const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/auth-DVfP9GnI.js","assets/sparkles-03J-Xlig.js","assets/createLucideIcon-CLoxTYdg.js","assets/_authenticated-BX_oPto8.js","assets/plus-hRIW8Mpr.js","assets/users-DDWp0-PV.js","assets/message-circle-CbAY9820.js","assets/index-BnSZ-4zt.js","assets/upload-BV464Zzd.js","assets/filters-MEo4wuNm.js","assets/x-2KYVzhnY.js","assets/profile-BRD39yzl.js","assets/useQuery-CcGvQRnN.js","assets/film-DkeMCN3s.js","assets/friends-B8l9PETy.js","assets/check-DOLe08hD.js","assets/search-NjdoEM1B.js","assets/user-plus-Cp3qAUHn.js","assets/feed-D1YH368C.js","assets/user-check-BCh__8I9.js","assets/chat-Cn85NLsy.js","assets/streak-C9WT0X4l.js","assets/u._userId-DkoTSOwh.js","assets/arrow-right-CEUNhYUq.js","assets/group.new-ACqkNTFN.js","assets/group._groupId-BGUrylxb.js","assets/send-E6WrMREs.js","assets/chat._friendId-CaTSA_We.js"])))=>i.map(i=>d[i]);
function Dv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ih={exports:{}},$i={};var Ym;function Uw(){if(Ym)return $i;Ym=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(i,l,u){var c=null;if(u!==void 0&&(c=""+u),l.key!==void 0&&(c=""+l.key),"key"in l){u={};for(var f in l)f!=="key"&&(u[f]=l[f])}else u=l;return l=u.ref,{$$typeof:e,type:i,key:c,ref:l!==void 0?l:null,props:u}}return $i.Fragment=t,$i.jsx=s,$i.jsxs=s,$i}var Fm;function zw(){return Fm||(Fm=1,Ih.exports=Uw()),Ih.exports}var J=zw(),qh={exports:{}},ge={};var Qm;function Pw(){if(Qm)return ge;Qm=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),b=Symbol.iterator;function _(C){return C===null||typeof C!="object"?null:(C=b&&C[b]||C["@@iterator"],typeof C=="function"?C:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,E={};function A(C,q,G){this.props=C,this.context=q,this.refs=E,this.updater=G||S}A.prototype.isReactComponent={},A.prototype.setState=function(C,q){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,q,"setState")},A.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function M(){}M.prototype=A.prototype;function j(C,q,G){this.props=C,this.context=q,this.refs=E,this.updater=G||S}var D=j.prototype=new M;D.constructor=j,O(D,A.prototype),D.isPureReactComponent=!0;var X=Array.isArray;function K(){}var H={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function Z(C,q,G){var Q=G.ref;return{$$typeof:e,type:C,key:q,ref:Q!==void 0?Q:null,props:G}}function le(C,q){return Z(C.type,q,C.props)}function ie(C){return typeof C=="object"&&C!==null&&C.$$typeof===e}function me(C){var q={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(G){return q[G]})}var _e=/\/+/g;function qe(C,q){return typeof C=="object"&&C!==null&&C.key!=null?me(""+C.key):q.toString(36)}function Me(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(K,K):(C.status="pending",C.then(function(q){C.status==="pending"&&(C.status="fulfilled",C.value=q)},function(q){C.status==="pending"&&(C.status="rejected",C.reason=q)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function U(C,q,G,Q,ee){var ce=typeof C;(ce==="undefined"||ce==="boolean")&&(C=null);var we=!1;if(C===null)we=!0;else switch(ce){case"bigint":case"string":case"number":we=!0;break;case"object":switch(C.$$typeof){case e:case t:we=!0;break;case y:return we=C._init,U(we(C._payload),q,G,Q,ee)}}if(we)return ee=ee(C),we=Q===""?"."+qe(C,0):Q,X(ee)?(G="",we!=null&&(G=we.replace(_e,"$&/")+"/"),U(ee,q,G,"",function(Dt){return Dt})):ee!=null&&(ie(ee)&&(ee=le(ee,G+(ee.key==null||C&&C.key===ee.key?"":(""+ee.key).replace(_e,"$&/")+"/")+we)),q.push(ee)),1;we=0;var de=Q===""?".":Q+":";if(X(C))for(var xe=0;xe<C.length;xe++)Q=C[xe],ce=de+qe(Q,xe),we+=U(Q,q,G,ce,ee);else if(xe=_(C),typeof xe=="function")for(C=xe.call(C),xe=0;!(Q=C.next()).done;)Q=Q.value,ce=de+qe(Q,xe++),we+=U(Q,q,G,ce,ee);else if(ce==="object"){if(typeof C.then=="function")return U(Me(C),q,G,Q,ee);throw q=String(C),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return we}function F(C,q,G){if(C==null)return C;var Q=[],ee=0;return U(C,Q,"","",function(ce){return q.call(G,ce,ee++)}),Q}function ae(C){if(C._status===-1){var q=C._result;q=q(),q.then(function(G){(C._status===0||C._status===-1)&&(C._status=1,C._result=G)},function(G){(C._status===0||C._status===-1)&&(C._status=2,C._result=G)}),C._status===-1&&(C._status=0,C._result=q)}if(C._status===1)return C._result.default;throw C._result}var Se=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},ye={map:F,forEach:function(C,q,G){F(C,function(){q.apply(this,arguments)},G)},count:function(C){var q=0;return F(C,function(){q++}),q},toArray:function(C){return F(C,function(q){return q})||[]},only:function(C){if(!ie(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return ge.Activity=m,ge.Children=ye,ge.Component=A,ge.Fragment=s,ge.Profiler=l,ge.PureComponent=j,ge.StrictMode=i,ge.Suspense=p,ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,ge.__COMPILER_RUNTIME={__proto__:null,c:function(C){return H.H.useMemoCache(C)}},ge.cache=function(C){return function(){return C.apply(null,arguments)}},ge.cacheSignal=function(){return null},ge.cloneElement=function(C,q,G){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var Q=O({},C.props),ee=C.key;if(q!=null)for(ce in q.key!==void 0&&(ee=""+q.key),q)!Y.call(q,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&q.ref===void 0||(Q[ce]=q[ce]);var ce=arguments.length-2;if(ce===1)Q.children=G;else if(1<ce){for(var we=Array(ce),de=0;de<ce;de++)we[de]=arguments[de+2];Q.children=we}return Z(C.type,ee,Q)},ge.createContext=function(C){return C={$$typeof:c,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:u,_context:C},C},ge.createElement=function(C,q,G){var Q,ee={},ce=null;if(q!=null)for(Q in q.key!==void 0&&(ce=""+q.key),q)Y.call(q,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(ee[Q]=q[Q]);var we=arguments.length-2;if(we===1)ee.children=G;else if(1<we){for(var de=Array(we),xe=0;xe<we;xe++)de[xe]=arguments[xe+2];ee.children=de}if(C&&C.defaultProps)for(Q in we=C.defaultProps,we)ee[Q]===void 0&&(ee[Q]=we[Q]);return Z(C,ce,ee)},ge.createRef=function(){return{current:null}},ge.forwardRef=function(C){return{$$typeof:f,render:C}},ge.isValidElement=ie,ge.lazy=function(C){return{$$typeof:y,_payload:{_status:-1,_result:C},_init:ae}},ge.memo=function(C,q){return{$$typeof:g,type:C,compare:q===void 0?null:q}},ge.startTransition=function(C){var q=H.T,G={};H.T=G;try{var Q=C(),ee=H.S;ee!==null&&ee(G,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(K,Se)}catch(ce){Se(ce)}finally{q!==null&&G.types!==null&&(q.types=G.types),H.T=q}},ge.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},ge.use=function(C){return H.H.use(C)},ge.useActionState=function(C,q,G){return H.H.useActionState(C,q,G)},ge.useCallback=function(C,q){return H.H.useCallback(C,q)},ge.useContext=function(C){return H.H.useContext(C)},ge.useDebugValue=function(){},ge.useDeferredValue=function(C,q){return H.H.useDeferredValue(C,q)},ge.useEffect=function(C,q){return H.H.useEffect(C,q)},ge.useEffectEvent=function(C){return H.H.useEffectEvent(C)},ge.useId=function(){return H.H.useId()},ge.useImperativeHandle=function(C,q,G){return H.H.useImperativeHandle(C,q,G)},ge.useInsertionEffect=function(C,q){return H.H.useInsertionEffect(C,q)},ge.useLayoutEffect=function(C,q){return H.H.useLayoutEffect(C,q)},ge.useMemo=function(C,q){return H.H.useMemo(C,q)},ge.useOptimistic=function(C,q){return H.H.useOptimistic(C,q)},ge.useReducer=function(C,q,G){return H.H.useReducer(C,q,G)},ge.useRef=function(C){return H.H.useRef(C)},ge.useState=function(C){return H.H.useState(C)},ge.useSyncExternalStore=function(C,q,G){return H.H.useSyncExternalStore(C,q,G)},ge.useTransition=function(){return H.H.useTransition()},ge.version="19.2.5",ge}var Jm;function bo(){return Jm||(Jm=1,qh.exports=Pw()),qh.exports}var ne=bo();const W=Dv(ne);var $h={exports:{}},Vi={},Vh={exports:{}},Gh={};var Xm;function Bw(){return Xm||(Xm=1,(function(e){function t(U,F){var ae=U.length;U.push(F);e:for(;0<ae;){var Se=ae-1>>>1,ye=U[Se];if(0<l(ye,F))U[Se]=F,U[ae]=ye,ae=Se;else break e}}function s(U){return U.length===0?null:U[0]}function i(U){if(U.length===0)return null;var F=U[0],ae=U.pop();if(ae!==F){U[0]=ae;e:for(var Se=0,ye=U.length,C=ye>>>1;Se<C;){var q=2*(Se+1)-1,G=U[q],Q=q+1,ee=U[Q];if(0>l(G,ae))Q<ye&&0>l(ee,G)?(U[Se]=ee,U[Q]=ae,Se=Q):(U[Se]=G,U[q]=ae,Se=q);else if(Q<ye&&0>l(ee,ae))U[Se]=ee,U[Q]=ae,Se=Q;else break e}}return F}function l(U,F){var ae=U.sortIndex-F.sortIndex;return ae!==0?ae:U.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var p=[],g=[],y=1,m=null,b=3,_=!1,S=!1,O=!1,E=!1,A=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function D(U){for(var F=s(g);F!==null;){if(F.callback===null)i(g);else if(F.startTime<=U)i(g),F.sortIndex=F.expirationTime,t(p,F);else break;F=s(g)}}function X(U){if(O=!1,D(U),!S)if(s(p)!==null)S=!0,K||(K=!0,me());else{var F=s(g);F!==null&&Me(X,F.startTime-U)}}var K=!1,H=-1,Y=5,Z=-1;function le(){return E?!0:!(e.unstable_now()-Z<Y)}function ie(){if(E=!1,K){var U=e.unstable_now();Z=U;var F=!0;try{e:{S=!1,O&&(O=!1,M(H),H=-1),_=!0;var ae=b;try{t:{for(D(U),m=s(p);m!==null&&!(m.expirationTime>U&&le());){var Se=m.callback;if(typeof Se=="function"){m.callback=null,b=m.priorityLevel;var ye=Se(m.expirationTime<=U);if(U=e.unstable_now(),typeof ye=="function"){m.callback=ye,D(U),F=!0;break t}m===s(p)&&i(p),D(U)}else i(p);m=s(p)}if(m!==null)F=!0;else{var C=s(g);C!==null&&Me(X,C.startTime-U),F=!1}}break e}finally{m=null,b=ae,_=!1}F=void 0}}finally{F?me():K=!1}}}var me;if(typeof j=="function")me=function(){j(ie)};else if(typeof MessageChannel<"u"){var _e=new MessageChannel,qe=_e.port2;_e.port1.onmessage=ie,me=function(){qe.postMessage(null)}}else me=function(){A(ie,0)};function Me(U,F){H=A(function(){U(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(U){switch(b){case 1:case 2:case 3:var F=3;break;default:F=b}var ae=b;b=F;try{return U()}finally{b=ae}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(U,F){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var ae=b;b=U;try{return F()}finally{b=ae}},e.unstable_scheduleCallback=function(U,F,ae){var Se=e.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?Se+ae:Se):ae=Se,U){case 1:var ye=-1;break;case 2:ye=250;break;case 5:ye=1073741823;break;case 4:ye=1e4;break;default:ye=5e3}return ye=ae+ye,U={id:y++,callback:F,priorityLevel:U,startTime:ae,expirationTime:ye,sortIndex:-1},ae>Se?(U.sortIndex=ae,t(g,U),s(p)===null&&U===s(g)&&(O?(M(H),H=-1):O=!0,Me(X,ae-Se))):(U.sortIndex=ye,t(p,U),S||_||(S=!0,K||(K=!0,me()))),U},e.unstable_shouldYield=le,e.unstable_wrapCallback=function(U){var F=b;return function(){var ae=b;b=F;try{return U.apply(this,arguments)}finally{b=ae}}}})(Gh)),Gh}var Zm;function Hw(){return Zm||(Zm=1,Vh.exports=Bw()),Vh.exports}var Kh={exports:{}},Ct={};var Wm;function Iw(){if(Wm)return Ct;Wm=1;var e=bo();function t(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)g+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var i={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},l=Symbol.for("react.portal");function u(p,g,y){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:m==null?null:""+m,children:p,containerInfo:g,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Ct.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Ct.createPortal=function(p,g){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(t(299));return u(p,g,null,y)},Ct.flushSync=function(p){var g=c.T,y=i.p;try{if(c.T=null,i.p=2,p)return p()}finally{c.T=g,i.p=y,i.d.f()}},Ct.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,i.d.C(p,g))},Ct.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},Ct.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var y=g.as,m=f(y,g.crossOrigin),b=typeof g.integrity=="string"?g.integrity:void 0,_=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;y==="style"?i.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:m,integrity:b,fetchPriority:_}):y==="script"&&i.d.X(p,{crossOrigin:m,integrity:b,fetchPriority:_,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Ct.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var y=f(g.as,g.crossOrigin);i.d.M(p,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&i.d.M(p)},Ct.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var y=g.as,m=f(y,g.crossOrigin);i.d.L(p,y,{crossOrigin:m,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Ct.preloadModule=function(p,g){if(typeof p=="string")if(g){var y=f(g.as,g.crossOrigin);i.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else i.d.m(p)},Ct.requestFormReset=function(p){i.d.r(p)},Ct.unstable_batchedUpdates=function(p,g){return p(g)},Ct.useFormState=function(p,g,y){return c.H.useFormState(p,g,y)},Ct.useFormStatus=function(){return c.H.useHostTransitionStatus()},Ct.version="19.2.5",Ct}var ey;function Lv(){if(ey)return Kh.exports;ey=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Kh.exports=Iw(),Kh.exports}var ty;function qw(){if(ty)return Vi;ty=1;var e=Hw(),t=bo(),s=Lv();function i(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+n+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function u(n){var r=n,a=n;if(n.alternate)for(;r.return;)r=r.return;else{n=r;do r=n,(r.flags&4098)!==0&&(a=r.return),n=r.return;while(n)}return r.tag===3?a:null}function c(n){if(n.tag===13){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function f(n){if(n.tag===31){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function p(n){if(u(n)!==n)throw Error(i(188))}function g(n){var r=n.alternate;if(!r){if(r=u(n),r===null)throw Error(i(188));return r!==n?null:n}for(var a=n,o=r;;){var h=a.return;if(h===null)break;var d=h.alternate;if(d===null){if(o=h.return,o!==null){a=o;continue}break}if(h.child===d.child){for(d=h.child;d;){if(d===a)return p(h),n;if(d===o)return p(h),r;d=d.sibling}throw Error(i(188))}if(a.return!==o.return)a=h,o=d;else{for(var v=!1,w=h.child;w;){if(w===a){v=!0,a=h,o=d;break}if(w===o){v=!0,o=h,a=d;break}w=w.sibling}if(!v){for(w=d.child;w;){if(w===a){v=!0,a=d,o=h;break}if(w===o){v=!0,o=d,a=h;break}w=w.sibling}if(!v)throw Error(i(189))}}if(a.alternate!==o)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?n:r}function y(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n;for(n=n.child;n!==null;){if(r=y(n),r!==null)return r;n=n.sibling}return null}var m=Object.assign,b=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),j=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),le=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function me(n){return n===null||typeof n!="object"?null:(n=ie&&n[ie]||n["@@iterator"],typeof n=="function"?n:null)}var _e=Symbol.for("react.client.reference");function qe(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===_e?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case O:return"Fragment";case A:return"Profiler";case E:return"StrictMode";case X:return"Suspense";case K:return"SuspenseList";case Z:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case S:return"Portal";case j:return n.displayName||"Context";case M:return(n._context.displayName||"Context")+".Consumer";case D:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case H:return r=n.displayName||null,r!==null?r:qe(n.type)||"Memo";case Y:r=n._payload,n=n._init;try{return qe(n(r))}catch{}}return null}var Me=Array.isArray,U=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},Se=[],ye=-1;function C(n){return{current:n}}function q(n){0>ye||(n.current=Se[ye],Se[ye]=null,ye--)}function G(n,r){ye++,Se[ye]=n.current,n.current=r}var Q=C(null),ee=C(null),ce=C(null),we=C(null);function de(n,r){switch(G(ce,r),G(ee,n),G(Q,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?mm(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=mm(r),n=ym(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}q(Q),G(Q,n)}function xe(){q(Q),q(ee),q(ce)}function Dt(n){n.memoizedState!==null&&G(we,n);var r=Q.current,a=ym(r,n.type);r!==a&&(G(ee,n),G(Q,a))}function Lt(n){ee.current===n&&(q(Q),q(ee)),we.current===n&&(q(we),Bi._currentValue=ae)}var kt,ls;function Ut(n){if(kt===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);kt=r&&r[1]||"",ls=-1<a.stack.indexOf(`
    at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
`+kt+n+ls}var us=!1;function Yn(n,r){if(!n||us)return"";us=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(r){var V=function(){throw Error()};if(Object.defineProperty(V.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(V,[])}catch(B){var P=B}Reflect.construct(n,[],V)}else{try{V.call()}catch(B){P=B}n.call(V.prototype)}}else{try{throw Error()}catch(B){P=B}(V=n())&&typeof V.catch=="function"&&V.catch(function(){})}}catch(B){if(B&&P&&typeof B.stack=="string")return[B.stack,P.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=o.DetermineComponentFrameRoot(),v=d[0],w=d[1];if(v&&w){var x=v.split(`
`),z=w.split(`
`);for(h=o=0;o<x.length&&!x[o].includes("DetermineComponentFrameRoot");)o++;for(;h<z.length&&!z[h].includes("DetermineComponentFrameRoot");)h++;if(o===x.length||h===z.length)for(o=x.length-1,h=z.length-1;1<=o&&0<=h&&x[o]!==z[h];)h--;for(;1<=o&&0<=h;o--,h--)if(x[o]!==z[h]){if(o!==1||h!==1)do if(o--,h--,0>h||x[o]!==z[h]){var I=`
`+x[o].replace(" at new "," at ");return n.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",n.displayName)),I}while(1<=o&&0<=h);break}}}finally{us=!1,Error.prepareStackTrace=a}return(a=n?n.displayName||n.name:"")?Ut(a):""}function Nn(n,r){switch(n.tag){case 26:case 27:case 5:return Ut(n.type);case 16:return Ut("Lazy");case 13:return n.child!==r&&r!==null?Ut("Suspense Fallback"):Ut("Suspense");case 19:return Ut("SuspenseList");case 0:case 15:return Yn(n.type,!1);case 11:return Yn(n.type.render,!1);case 1:return Yn(n.type,!0);case 31:return Ut("Activity");default:return""}}function ln(n){try{var r="",a=null;do r+=Nn(n,a),a=n,n=n.return;while(n);return r}catch(o){return`
Error generating stack: `+o.message+`
`+o.stack}}var bt=Object.prototype.hasOwnProperty,Zt=e.unstable_scheduleCallback,cs=e.unstable_cancelCallback,ht=e.unstable_shouldYield,Dn=e.unstable_requestPaint,ft=e.unstable_now,Ue=e.unstable_getCurrentPriorityLevel,Je=e.unstable_ImmediatePriority,un=e.unstable_UserBlockingPriority,Fn=e.unstable_NormalPriority,Za=e.unstable_LowPriority,Qn=e.unstable_IdlePriority,Eo=e.log,Er=e.unstable_setDisableYieldValue,hs=null,jt=null;function Tn(n){if(typeof Eo=="function"&&Er(n),jt&&typeof jt.setStrictMode=="function")try{jt.setStrictMode(hs,n)}catch{}}var Ot=Math.clz32?Math.clz32:Ln,ku=Math.log,Wa=Math.LN2;function Ln(n){return n>>>=0,n===0?32:31-(ku(n)/Wa|0)|0}var Gs=256,Ks=262144,fs=4194304;function Un(n){var r=n&42;if(r!==0)return r;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function pe(n,r,a){var o=n.pendingLanes;if(o===0)return 0;var h=0,d=n.suspendedLanes,v=n.pingedLanes;n=n.warmLanes;var w=o&134217727;return w!==0?(o=w&~d,o!==0?h=Un(o):(v&=w,v!==0?h=Un(v):a||(a=w&~n,a!==0&&(h=Un(a))))):(w=o&~d,w!==0?h=Un(w):v!==0?h=Un(v):a||(a=o&~n,a!==0&&(h=Un(a)))),h===0?0:r!==0&&r!==h&&(r&d)===0&&(d=h&-h,a=r&-r,d>=a||d===32&&(a&4194048)!==0)?r:h}function Ke(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function dt(n,r){switch(n){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xt(){var n=fs;return fs<<=1,(fs&62914560)===0&&(fs=4194304),n}function Tr(n){for(var r=[],a=0;31>a;a++)r.push(n);return r}function Qe(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function zt(n,r,a,o,h,d){var v=n.pendingLanes;n.pendingLanes=a,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=a,n.entangledLanes&=a,n.errorRecoveryDisabledLanes&=a,n.shellSuspendCounter=0;var w=n.entanglements,x=n.expirationTimes,z=n.hiddenUpdates;for(a=v&~a;0<a;){var I=31-Ot(a),V=1<<I;w[I]=0,x[I]=-1;var P=z[I];if(P!==null)for(z[I]=null,I=0;I<P.length;I++){var B=P[I];B!==null&&(B.lane&=-536870913)}a&=~V}o!==0&&ds(n,o,0),d!==0&&h===0&&n.tag!==0&&(n.suspendedLanes|=d&~(v&~r))}function ds(n,r,a){n.pendingLanes|=r,n.suspendedLanes&=~r;var o=31-Ot(r);n.entangledLanes|=r,n.entanglements[o]=n.entanglements[o]|1073741824|a&261930}function Pt(n,r){var a=n.entangledLanes|=r;for(n=n.entanglements;a;){var o=31-Ot(a),h=1<<o;h&r|n[o]&r&&(n[o]|=r),a&=~h}}function Bt(n,r){var a=r&-r;return a=(a&42)!==0?1:Ys(a),(a&(n.suspendedLanes|r))!==0?0:a}function Ys(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Rn(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function ju(){var n=F.p;return n!==0?n:(n=window.event,n===void 0?32:Hm(n.type))}function nd(n,r){var a=F.p;try{return F.p=n,r()}finally{F.p=a}}var Rr=Math.random().toString(36).slice(2),_t="__reactFiber$"+Rr,Ht="__reactProps$"+Rr,Fs="__reactContainer$"+Rr,Mu="__reactEvents$"+Rr,Rb="__reactListeners$"+Rr,Ab="__reactHandles$"+Rr,rd="__reactResources$"+Rr,ei="__reactMarker$"+Rr;function Nu(n){delete n[_t],delete n[Ht],delete n[Mu],delete n[Rb],delete n[Ab]}function Qs(n){var r=n[_t];if(r)return r;for(var a=n.parentNode;a;){if(r=a[Fs]||a[_t]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(n=Tm(n);n!==null;){if(a=n[_t])return a;n=Tm(n)}return r}n=a,a=n.parentNode}return null}function Js(n){if(n=n[_t]||n[Fs]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function ti(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(i(33))}function Xs(n){var r=n[rd];return r||(r=n[rd]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function pt(n){n[ei]=!0}var sd=new Set,ad={};function ps(n,r){Zs(n,r),Zs(n+"Capture",r)}function Zs(n,r){for(ad[n]=r,n=0;n<r.length;n++)sd.add(r[n])}var Ob=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),id={},od={};function xb(n){return bt.call(od,n)?!0:bt.call(id,n)?!1:Ob.test(n)?od[n]=!0:(id[n]=!0,!1)}function To(n,r,a){if(xb(r))if(a===null)n.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":n.removeAttribute(r);return;case"boolean":var o=r.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,""+a)}}function Ro(n,r,a){if(a===null)n.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,""+a)}}function Jn(n,r,a,o){if(o===null)n.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttributeNS(r,a,""+o)}}function cn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function ld(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Cb(n,r,a){var o=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,d=o.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return h.call(this)},set:function(v){a=""+v,d.call(this,v)}}),Object.defineProperty(n,r,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(v){a=""+v},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function Du(n){if(!n._valueTracker){var r=ld(n)?"checked":"value";n._valueTracker=Cb(n,r,""+n[r])}}function ud(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var a=r.getValue(),o="";return n&&(o=ld(n)?n.checked?"true":"false":n.value),n=o,n!==a?(r.setValue(n),!0):!1}function Ao(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var kb=/[\n"\\]/g;function hn(n){return n.replace(kb,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Lu(n,r,a,o,h,d,v,w){n.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?n.type=v:n.removeAttribute("type"),r!=null?v==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+cn(r)):n.value!==""+cn(r)&&(n.value=""+cn(r)):v!=="submit"&&v!=="reset"||n.removeAttribute("value"),r!=null?Uu(n,v,cn(r)):a!=null?Uu(n,v,cn(a)):o!=null&&n.removeAttribute("value"),h==null&&d!=null&&(n.defaultChecked=!!d),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?n.name=""+cn(w):n.removeAttribute("name")}function cd(n,r,a,o,h,d,v,w){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(n.type=d),r!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||r!=null)){Du(n);return}a=a!=null?""+cn(a):"",r=r!=null?""+cn(r):a,w||r===n.value||(n.value=r),n.defaultValue=r}o=o??h,o=typeof o!="function"&&typeof o!="symbol"&&!!o,n.checked=w?n.checked:!!o,n.defaultChecked=!!o,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(n.name=v),Du(n)}function Uu(n,r,a){r==="number"&&Ao(n.ownerDocument)===n||n.defaultValue===""+a||(n.defaultValue=""+a)}function Ws(n,r,a,o){if(n=n.options,r){r={};for(var h=0;h<a.length;h++)r["$"+a[h]]=!0;for(a=0;a<n.length;a++)h=r.hasOwnProperty("$"+n[a].value),n[a].selected!==h&&(n[a].selected=h),h&&o&&(n[a].defaultSelected=!0)}else{for(a=""+cn(a),r=null,h=0;h<n.length;h++){if(n[h].value===a){n[h].selected=!0,o&&(n[h].defaultSelected=!0);return}r!==null||n[h].disabled||(r=n[h])}r!==null&&(r.selected=!0)}}function hd(n,r,a){if(r!=null&&(r=""+cn(r),r!==n.value&&(n.value=r),a==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=a!=null?""+cn(a):""}function fd(n,r,a,o){if(r==null){if(o!=null){if(a!=null)throw Error(i(92));if(Me(o)){if(1<o.length)throw Error(i(93));o=o[0]}a=o}a==null&&(a=""),r=a}a=cn(r),n.defaultValue=a,o=n.textContent,o===a&&o!==""&&o!==null&&(n.value=o),Du(n)}function ea(n,r){if(r){var a=n.firstChild;if(a&&a===n.lastChild&&a.nodeType===3){a.nodeValue=r;return}}n.textContent=r}var jb=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function dd(n,r,a){var o=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":o?n.setProperty(r,a):typeof a!="number"||a===0||jb.has(r)?r==="float"?n.cssFloat=a:n[r]=(""+a).trim():n[r]=a+"px"}function pd(n,r,a){if(r!=null&&typeof r!="object")throw Error(i(62));if(n=n.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||r!=null&&r.hasOwnProperty(o)||(o.indexOf("--")===0?n.setProperty(o,""):o==="float"?n.cssFloat="":n[o]="");for(var h in r)o=r[h],r.hasOwnProperty(h)&&a[h]!==o&&dd(n,h,o)}else for(var d in r)r.hasOwnProperty(d)&&dd(n,d,r[d])}function zu(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Mb=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Nb=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Oo(n){return Nb.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Xn(){}var Pu=null;function Bu(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var ta=null,na=null;function gd(n){var r=Js(n);if(r&&(n=r.stateNode)){var a=n[Ht]||null;e:switch(n=r.stateNode,r.type){case"input":if(Lu(n,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=n;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+hn(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var o=a[r];if(o!==n&&o.form===n.form){var h=o[Ht]||null;if(!h)throw Error(i(90));Lu(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(r=0;r<a.length;r++)o=a[r],o.form===n.form&&ud(o)}break e;case"textarea":hd(n,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&Ws(n,!!a.multiple,r,!1)}}}var Hu=!1;function md(n,r,a){if(Hu)return n(r,a);Hu=!0;try{var o=n(r);return o}finally{if(Hu=!1,(ta!==null||na!==null)&&(pl(),ta&&(r=ta,n=na,na=ta=null,gd(r),n)))for(r=0;r<n.length;r++)gd(n[r])}}function ni(n,r){var a=n.stateNode;if(a===null)return null;var o=a[Ht]||null;if(o===null)return null;a=o[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(n=n.type,o=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!o;break e;default:n=!1}if(n)return null;if(a&&typeof a!="function")throw Error(i(231,r,typeof a));return a}var Zn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Iu=!1;if(Zn)try{var ri={};Object.defineProperty(ri,"passive",{get:function(){Iu=!0}}),window.addEventListener("test",ri,ri),window.removeEventListener("test",ri,ri)}catch{Iu=!1}var Ar=null,qu=null,xo=null;function yd(){if(xo)return xo;var n,r=qu,a=r.length,o,h="value"in Ar?Ar.value:Ar.textContent,d=h.length;for(n=0;n<a&&r[n]===h[n];n++);var v=a-n;for(o=1;o<=v&&r[a-o]===h[d-o];o++);return xo=h.slice(n,1<o?1-o:void 0)}function Co(n){var r=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&r===13&&(n=13)):n=r,n===10&&(n=13),32<=n||n===13?n:0}function ko(){return!0}function vd(){return!1}function It(n){function r(a,o,h,d,v){this._reactName=a,this._targetInst=h,this.type=o,this.nativeEvent=d,this.target=v,this.currentTarget=null;for(var w in n)n.hasOwnProperty(w)&&(a=n[w],this[w]=a?a(d):d[w]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?ko:vd,this.isPropagationStopped=vd,this}return m(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ko)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ko)},persist:function(){},isPersistent:ko}),r}var gs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jo=It(gs),si=m({},gs,{view:0,detail:0}),Db=It(si),$u,Vu,ai,Mo=m({},si,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ku,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==ai&&(ai&&n.type==="mousemove"?($u=n.screenX-ai.screenX,Vu=n.screenY-ai.screenY):Vu=$u=0,ai=n),$u)},movementY:function(n){return"movementY"in n?n.movementY:Vu}}),bd=It(Mo),Lb=m({},Mo,{dataTransfer:0}),Ub=It(Lb),zb=m({},si,{relatedTarget:0}),Gu=It(zb),Pb=m({},gs,{animationName:0,elapsedTime:0,pseudoElement:0}),Bb=It(Pb),Hb=m({},gs,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),Ib=It(Hb),qb=m({},gs,{data:0}),_d=It(qb),$b={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vb={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Gb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kb(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=Gb[n])?!!r[n]:!1}function Ku(){return Kb}var Yb=m({},si,{key:function(n){if(n.key){var r=$b[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=Co(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?Vb[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ku,charCode:function(n){return n.type==="keypress"?Co(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Co(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),Fb=It(Yb),Qb=m({},Mo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wd=It(Qb),Jb=m({},si,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ku}),Xb=It(Jb),Zb=m({},gs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wb=It(Zb),e_=m({},Mo,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),t_=It(e_),n_=m({},gs,{newState:0,oldState:0}),r_=It(n_),s_=[9,13,27,32],Yu=Zn&&"CompositionEvent"in window,ii=null;Zn&&"documentMode"in document&&(ii=document.documentMode);var a_=Zn&&"TextEvent"in window&&!ii,Sd=Zn&&(!Yu||ii&&8<ii&&11>=ii),Ed=" ",Td=!1;function Rd(n,r){switch(n){case"keyup":return s_.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ad(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ra=!1;function i_(n,r){switch(n){case"compositionend":return Ad(r);case"keypress":return r.which!==32?null:(Td=!0,Ed);case"textInput":return n=r.data,n===Ed&&Td?null:n;default:return null}}function o_(n,r){if(ra)return n==="compositionend"||!Yu&&Rd(n,r)?(n=yd(),xo=qu=Ar=null,ra=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Sd&&r.locale!=="ko"?null:r.data;default:return null}}var l_={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Od(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!l_[n.type]:r==="textarea"}function xd(n,r,a,o){ta?na?na.push(o):na=[o]:ta=o,r=wl(r,"onChange"),0<r.length&&(a=new jo("onChange","change",null,a,o),n.push({event:a,listeners:r}))}var oi=null,li=null;function u_(n){cm(n,0)}function No(n){var r=ti(n);if(ud(r))return n}function Cd(n,r){if(n==="change")return r}var kd=!1;if(Zn){var Fu;if(Zn){var Qu="oninput"in document;if(!Qu){var jd=document.createElement("div");jd.setAttribute("oninput","return;"),Qu=typeof jd.oninput=="function"}Fu=Qu}else Fu=!1;kd=Fu&&(!document.documentMode||9<document.documentMode)}function Md(){oi&&(oi.detachEvent("onpropertychange",Nd),li=oi=null)}function Nd(n){if(n.propertyName==="value"&&No(li)){var r=[];xd(r,li,n,Bu(n)),md(u_,r)}}function c_(n,r,a){n==="focusin"?(Md(),oi=r,li=a,oi.attachEvent("onpropertychange",Nd)):n==="focusout"&&Md()}function h_(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return No(li)}function f_(n,r){if(n==="click")return No(r)}function d_(n,r){if(n==="input"||n==="change")return No(r)}function p_(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var Wt=typeof Object.is=="function"?Object.is:p_;function ui(n,r){if(Wt(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var a=Object.keys(n),o=Object.keys(r);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var h=a[o];if(!bt.call(r,h)||!Wt(n[h],r[h]))return!1}return!0}function Dd(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Ld(n,r){var a=Dd(n);n=0;for(var o;a;){if(a.nodeType===3){if(o=n+a.textContent.length,n<=r&&o>=r)return{node:a,offset:r-n};n=o}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Dd(a)}}function Ud(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?Ud(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function zd(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=Ao(n.document);r instanceof n.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)n=r.contentWindow;else break;r=Ao(n.document)}return r}function Ju(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}var g_=Zn&&"documentMode"in document&&11>=document.documentMode,sa=null,Xu=null,ci=null,Zu=!1;function Pd(n,r,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Zu||sa==null||sa!==Ao(o)||(o=sa,"selectionStart"in o&&Ju(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ci&&ui(ci,o)||(ci=o,o=wl(Xu,"onSelect"),0<o.length&&(r=new jo("onSelect","select",null,r,a),n.push({event:r,listeners:o}),r.target=sa)))}function ms(n,r){var a={};return a[n.toLowerCase()]=r.toLowerCase(),a["Webkit"+n]="webkit"+r,a["Moz"+n]="moz"+r,a}var aa={animationend:ms("Animation","AnimationEnd"),animationiteration:ms("Animation","AnimationIteration"),animationstart:ms("Animation","AnimationStart"),transitionrun:ms("Transition","TransitionRun"),transitionstart:ms("Transition","TransitionStart"),transitioncancel:ms("Transition","TransitionCancel"),transitionend:ms("Transition","TransitionEnd")},Wu={},Bd={};Zn&&(Bd=document.createElement("div").style,"AnimationEvent"in window||(delete aa.animationend.animation,delete aa.animationiteration.animation,delete aa.animationstart.animation),"TransitionEvent"in window||delete aa.transitionend.transition);function ys(n){if(Wu[n])return Wu[n];if(!aa[n])return n;var r=aa[n],a;for(a in r)if(r.hasOwnProperty(a)&&a in Bd)return Wu[n]=r[a];return n}var Hd=ys("animationend"),Id=ys("animationiteration"),qd=ys("animationstart"),m_=ys("transitionrun"),y_=ys("transitionstart"),v_=ys("transitioncancel"),$d=ys("transitionend"),Vd=new Map,ec="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ec.push("scrollEnd");function An(n,r){Vd.set(n,r),ps(r,[n])}var Do=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},fn=[],ia=0,tc=0;function Lo(){for(var n=ia,r=tc=ia=0;r<n;){var a=fn[r];fn[r++]=null;var o=fn[r];fn[r++]=null;var h=fn[r];fn[r++]=null;var d=fn[r];if(fn[r++]=null,o!==null&&h!==null){var v=o.pending;v===null?h.next=h:(h.next=v.next,v.next=h),o.pending=h}d!==0&&Gd(a,h,d)}}function Uo(n,r,a,o){fn[ia++]=n,fn[ia++]=r,fn[ia++]=a,fn[ia++]=o,tc|=o,n.lanes|=o,n=n.alternate,n!==null&&(n.lanes|=o)}function nc(n,r,a,o){return Uo(n,r,a,o),zo(n)}function vs(n,r){return Uo(n,null,null,r),zo(n)}function Gd(n,r,a){n.lanes|=a;var o=n.alternate;o!==null&&(o.lanes|=a);for(var h=!1,d=n.return;d!==null;)d.childLanes|=a,o=d.alternate,o!==null&&(o.childLanes|=a),d.tag===22&&(n=d.stateNode,n===null||n._visibility&1||(h=!0)),n=d,d=d.return;return n.tag===3?(d=n.stateNode,h&&r!==null&&(h=31-Ot(a),n=d.hiddenUpdates,o=n[h],o===null?n[h]=[r]:o.push(r),r.lane=a|536870912),d):null}function zo(n){if(50<Mi)throw Mi=0,hh=null,Error(i(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var oa={};function b_(n,r,a,o){this.tag=n,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function en(n,r,a,o){return new b_(n,r,a,o)}function rc(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Wn(n,r){var a=n.alternate;return a===null?(a=en(n.tag,r,n.key,n.mode),a.elementType=n.elementType,a.type=n.type,a.stateNode=n.stateNode,a.alternate=n,n.alternate=a):(a.pendingProps=r,a.type=n.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=n.flags&65011712,a.childLanes=n.childLanes,a.lanes=n.lanes,a.child=n.child,a.memoizedProps=n.memoizedProps,a.memoizedState=n.memoizedState,a.updateQueue=n.updateQueue,r=n.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=n.sibling,a.index=n.index,a.ref=n.ref,a.refCleanup=n.refCleanup,a}function Kd(n,r){n.flags&=65011714;var a=n.alternate;return a===null?(n.childLanes=0,n.lanes=r,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=a.childLanes,n.lanes=a.lanes,n.child=a.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=a.memoizedProps,n.memoizedState=a.memoizedState,n.updateQueue=a.updateQueue,n.type=a.type,r=a.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function Po(n,r,a,o,h,d){var v=0;if(o=n,typeof n=="function")rc(n)&&(v=1);else if(typeof n=="string")v=Tw(n,a,Q.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case Z:return n=en(31,a,r,h),n.elementType=Z,n.lanes=d,n;case O:return bs(a.children,h,d,r);case E:v=8,h|=24;break;case A:return n=en(12,a,r,h|2),n.elementType=A,n.lanes=d,n;case X:return n=en(13,a,r,h),n.elementType=X,n.lanes=d,n;case K:return n=en(19,a,r,h),n.elementType=K,n.lanes=d,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case j:v=10;break e;case M:v=9;break e;case D:v=11;break e;case H:v=14;break e;case Y:v=16,o=null;break e}v=29,a=Error(i(130,n===null?"null":typeof n,"")),o=null}return r=en(v,a,r,h),r.elementType=n,r.type=o,r.lanes=d,r}function bs(n,r,a,o){return n=en(7,n,o,r),n.lanes=a,n}function sc(n,r,a){return n=en(6,n,null,r),n.lanes=a,n}function Yd(n){var r=en(18,null,null,0);return r.stateNode=n,r}function ac(n,r,a){return r=en(4,n.children!==null?n.children:[],n.key,r),r.lanes=a,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var Fd=new WeakMap;function dn(n,r){if(typeof n=="object"&&n!==null){var a=Fd.get(n);return a!==void 0?a:(r={value:n,source:r,stack:ln(r)},Fd.set(n,r),r)}return{value:n,source:r,stack:ln(r)}}var la=[],ua=0,Bo=null,hi=0,pn=[],gn=0,Or=null,zn=1,Pn="";function er(n,r){la[ua++]=hi,la[ua++]=Bo,Bo=n,hi=r}function Qd(n,r,a){pn[gn++]=zn,pn[gn++]=Pn,pn[gn++]=Or,Or=n;var o=zn;n=Pn;var h=32-Ot(o)-1;o&=~(1<<h),a+=1;var d=32-Ot(r)+h;if(30<d){var v=h-h%5;d=(o&(1<<v)-1).toString(32),o>>=v,h-=v,zn=1<<32-Ot(r)+h|a<<h|o,Pn=d+n}else zn=1<<d|a<<h|o,Pn=n}function ic(n){n.return!==null&&(er(n,1),Qd(n,1,0))}function oc(n){for(;n===Bo;)Bo=la[--ua],la[ua]=null,hi=la[--ua],la[ua]=null;for(;n===Or;)Or=pn[--gn],pn[gn]=null,Pn=pn[--gn],pn[gn]=null,zn=pn[--gn],pn[gn]=null}function Jd(n,r){pn[gn++]=zn,pn[gn++]=Pn,pn[gn++]=Or,zn=r.id,Pn=r.overflow,Or=n}var wt=null,Ve=null,Oe=!1,xr=null,mn=!1,lc=Error(i(519));function Cr(n){var r=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fi(dn(r,n)),lc}function Xd(n){var r=n.stateNode,a=n.type,o=n.memoizedProps;switch(r[_t]=n,r[Ht]=o,a){case"dialog":Te("cancel",r),Te("close",r);break;case"iframe":case"object":case"embed":Te("load",r);break;case"video":case"audio":for(a=0;a<Di.length;a++)Te(Di[a],r);break;case"source":Te("error",r);break;case"img":case"image":case"link":Te("error",r),Te("load",r);break;case"details":Te("toggle",r);break;case"input":Te("invalid",r),cd(r,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Te("invalid",r);break;case"textarea":Te("invalid",r),fd(r,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||o.suppressHydrationWarning===!0||pm(r.textContent,a)?(o.popover!=null&&(Te("beforetoggle",r),Te("toggle",r)),o.onScroll!=null&&Te("scroll",r),o.onScrollEnd!=null&&Te("scrollend",r),o.onClick!=null&&(r.onclick=Xn),r=!0):r=!1,r||Cr(n,!0)}function Zd(n){for(wt=n.return;wt;)switch(wt.tag){case 5:case 31:case 13:mn=!1;return;case 27:case 3:mn=!0;return;default:wt=wt.return}}function ca(n){if(n!==wt)return!1;if(!Oe)return Zd(n),Oe=!0,!1;var r=n.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=n.type,a=!(a!=="form"&&a!=="button")||Ah(n.type,n.memoizedProps)),a=!a),a&&Ve&&Cr(n),Zd(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));Ve=Em(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));Ve=Em(n)}else r===27?(r=Ve,$r(n.type)?(n=jh,jh=null,Ve=n):Ve=r):Ve=wt?vn(n.stateNode.nextSibling):null;return!0}function _s(){Ve=wt=null,Oe=!1}function uc(){var n=xr;return n!==null&&(Gt===null?Gt=n:Gt.push.apply(Gt,n),xr=null),n}function fi(n){xr===null?xr=[n]:xr.push(n)}var cc=C(null),ws=null,tr=null;function kr(n,r,a){G(cc,r._currentValue),r._currentValue=a}function nr(n){n._currentValue=cc.current,q(cc)}function hc(n,r,a){for(;n!==null;){var o=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,o!==null&&(o.childLanes|=r)):o!==null&&(o.childLanes&r)!==r&&(o.childLanes|=r),n===a)break;n=n.return}}function fc(n,r,a,o){var h=n.child;for(h!==null&&(h.return=n);h!==null;){var d=h.dependencies;if(d!==null){var v=h.child;d=d.firstContext;e:for(;d!==null;){var w=d;d=h;for(var x=0;x<r.length;x++)if(w.context===r[x]){d.lanes|=a,w=d.alternate,w!==null&&(w.lanes|=a),hc(d.return,a,n),o||(v=null);break e}d=w.next}}else if(h.tag===18){if(v=h.return,v===null)throw Error(i(341));v.lanes|=a,d=v.alternate,d!==null&&(d.lanes|=a),hc(v,a,n),v=null}else v=h.child;if(v!==null)v.return=h;else for(v=h;v!==null;){if(v===n){v=null;break}if(h=v.sibling,h!==null){h.return=v.return,v=h;break}v=v.return}h=v}}function ha(n,r,a,o){n=null;for(var h=r,d=!1;h!==null;){if(!d){if((h.flags&524288)!==0)d=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var v=h.alternate;if(v===null)throw Error(i(387));if(v=v.memoizedProps,v!==null){var w=h.type;Wt(h.pendingProps.value,v.value)||(n!==null?n.push(w):n=[w])}}else if(h===we.current){if(v=h.alternate,v===null)throw Error(i(387));v.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(Bi):n=[Bi])}h=h.return}n!==null&&fc(r,n,a,o),r.flags|=262144}function Ho(n){for(n=n.firstContext;n!==null;){if(!Wt(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Ss(n){ws=n,tr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function St(n){return Wd(ws,n)}function Io(n,r){return ws===null&&Ss(n),Wd(n,r)}function Wd(n,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},tr===null){if(n===null)throw Error(i(308));tr=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else tr=tr.next=r;return a}var __=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(a,o){n.push(o)}};this.abort=function(){r.aborted=!0,n.forEach(function(a){return a()})}},w_=e.unstable_scheduleCallback,S_=e.unstable_NormalPriority,nt={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function dc(){return{controller:new __,data:new Map,refCount:0}}function di(n){n.refCount--,n.refCount===0&&w_(S_,function(){n.controller.abort()})}var pi=null,pc=0,fa=0,da=null;function E_(n,r){if(pi===null){var a=pi=[];pc=0,fa=yh(),da={status:"pending",value:void 0,then:function(o){a.push(o)}}}return pc++,r.then(ep,ep),r}function ep(){if(--pc===0&&pi!==null){da!==null&&(da.status="fulfilled");var n=pi;pi=null,fa=0,da=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function T_(n,r){var a=[],o={status:"pending",value:null,reason:null,then:function(h){a.push(h)}};return n.then(function(){o.status="fulfilled",o.value=r;for(var h=0;h<a.length;h++)(0,a[h])(r)},function(h){for(o.status="rejected",o.reason=h,h=0;h<a.length;h++)(0,a[h])(void 0)}),o}var tp=U.S;U.S=function(n,r){Pg=ft(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&E_(n,r),tp!==null&&tp(n,r)};var Es=C(null);function gc(){var n=Es.current;return n!==null?n:He.pooledCache}function qo(n,r){r===null?G(Es,Es.current):G(Es,r.pool)}function np(){var n=gc();return n===null?null:{parent:nt._currentValue,pool:n}}var pa=Error(i(460)),mc=Error(i(474)),$o=Error(i(542)),Vo={then:function(){}};function rp(n){return n=n.status,n==="fulfilled"||n==="rejected"}function sp(n,r,a){switch(a=n[a],a===void 0?n.push(r):a!==r&&(r.then(Xn,Xn),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,ip(n),n;default:if(typeof r.status=="string")r.then(Xn,Xn);else{if(n=He,n!==null&&100<n.shellSuspendCounter)throw Error(i(482));n=r,n.status="pending",n.then(function(o){if(r.status==="pending"){var h=r;h.status="fulfilled",h.value=o}},function(o){if(r.status==="pending"){var h=r;h.status="rejected",h.reason=o}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,ip(n),n}throw Rs=r,pa}}function Ts(n){try{var r=n._init;return r(n._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Rs=a,pa):a}}var Rs=null;function ap(){if(Rs===null)throw Error(i(459));var n=Rs;return Rs=null,n}function ip(n){if(n===pa||n===$o)throw Error(i(483))}var ga=null,gi=0;function Go(n){var r=gi;return gi+=1,ga===null&&(ga=[]),sp(ga,n,r)}function mi(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function Ko(n,r){throw r.$$typeof===b?Error(i(525)):(n=Object.prototype.toString.call(r),Error(i(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function op(n){function r(N,k){if(n){var L=N.deletions;L===null?(N.deletions=[k],N.flags|=16):L.push(k)}}function a(N,k){if(!n)return null;for(;k!==null;)r(N,k),k=k.sibling;return null}function o(N){for(var k=new Map;N!==null;)N.key!==null?k.set(N.key,N):k.set(N.index,N),N=N.sibling;return k}function h(N,k){return N=Wn(N,k),N.index=0,N.sibling=null,N}function d(N,k,L){return N.index=L,n?(L=N.alternate,L!==null?(L=L.index,L<k?(N.flags|=67108866,k):L):(N.flags|=67108866,k)):(N.flags|=1048576,k)}function v(N){return n&&N.alternate===null&&(N.flags|=67108866),N}function w(N,k,L,$){return k===null||k.tag!==6?(k=sc(L,N.mode,$),k.return=N,k):(k=h(k,L),k.return=N,k)}function x(N,k,L,$){var ue=L.type;return ue===O?I(N,k,L.props.children,$,L.key):k!==null&&(k.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===Y&&Ts(ue)===k.type)?(k=h(k,L.props),mi(k,L),k.return=N,k):(k=Po(L.type,L.key,L.props,null,N.mode,$),mi(k,L),k.return=N,k)}function z(N,k,L,$){return k===null||k.tag!==4||k.stateNode.containerInfo!==L.containerInfo||k.stateNode.implementation!==L.implementation?(k=ac(L,N.mode,$),k.return=N,k):(k=h(k,L.children||[]),k.return=N,k)}function I(N,k,L,$,ue){return k===null||k.tag!==7?(k=bs(L,N.mode,$,ue),k.return=N,k):(k=h(k,L),k.return=N,k)}function V(N,k,L){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=sc(""+k,N.mode,L),k.return=N,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case _:return L=Po(k.type,k.key,k.props,null,N.mode,L),mi(L,k),L.return=N,L;case S:return k=ac(k,N.mode,L),k.return=N,k;case Y:return k=Ts(k),V(N,k,L)}if(Me(k)||me(k))return k=bs(k,N.mode,L,null),k.return=N,k;if(typeof k.then=="function")return V(N,Go(k),L);if(k.$$typeof===j)return V(N,Io(N,k),L);Ko(N,k)}return null}function P(N,k,L,$){var ue=k!==null?k.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return ue!==null?null:w(N,k,""+L,$);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case _:return L.key===ue?x(N,k,L,$):null;case S:return L.key===ue?z(N,k,L,$):null;case Y:return L=Ts(L),P(N,k,L,$)}if(Me(L)||me(L))return ue!==null?null:I(N,k,L,$,null);if(typeof L.then=="function")return P(N,k,Go(L),$);if(L.$$typeof===j)return P(N,k,Io(N,L),$);Ko(N,L)}return null}function B(N,k,L,$,ue){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return N=N.get(L)||null,w(k,N,""+$,ue);if(typeof $=="object"&&$!==null){switch($.$$typeof){case _:return N=N.get($.key===null?L:$.key)||null,x(k,N,$,ue);case S:return N=N.get($.key===null?L:$.key)||null,z(k,N,$,ue);case Y:return $=Ts($),B(N,k,L,$,ue)}if(Me($)||me($))return N=N.get(L)||null,I(k,N,$,ue,null);if(typeof $.then=="function")return B(N,k,L,Go($),ue);if($.$$typeof===j)return B(N,k,L,Io(k,$),ue);Ko(k,$)}return null}function re(N,k,L,$){for(var ue=null,Ce=null,oe=k,be=k=0,Ae=null;oe!==null&&be<L.length;be++){oe.index>be?(Ae=oe,oe=null):Ae=oe.sibling;var ke=P(N,oe,L[be],$);if(ke===null){oe===null&&(oe=Ae);break}n&&oe&&ke.alternate===null&&r(N,oe),k=d(ke,k,be),Ce===null?ue=ke:Ce.sibling=ke,Ce=ke,oe=Ae}if(be===L.length)return a(N,oe),Oe&&er(N,be),ue;if(oe===null){for(;be<L.length;be++)oe=V(N,L[be],$),oe!==null&&(k=d(oe,k,be),Ce===null?ue=oe:Ce.sibling=oe,Ce=oe);return Oe&&er(N,be),ue}for(oe=o(oe);be<L.length;be++)Ae=B(oe,N,be,L[be],$),Ae!==null&&(n&&Ae.alternate!==null&&oe.delete(Ae.key===null?be:Ae.key),k=d(Ae,k,be),Ce===null?ue=Ae:Ce.sibling=Ae,Ce=Ae);return n&&oe.forEach(function(Fr){return r(N,Fr)}),Oe&&er(N,be),ue}function he(N,k,L,$){if(L==null)throw Error(i(151));for(var ue=null,Ce=null,oe=k,be=k=0,Ae=null,ke=L.next();oe!==null&&!ke.done;be++,ke=L.next()){oe.index>be?(Ae=oe,oe=null):Ae=oe.sibling;var Fr=P(N,oe,ke.value,$);if(Fr===null){oe===null&&(oe=Ae);break}n&&oe&&Fr.alternate===null&&r(N,oe),k=d(Fr,k,be),Ce===null?ue=Fr:Ce.sibling=Fr,Ce=Fr,oe=Ae}if(ke.done)return a(N,oe),Oe&&er(N,be),ue;if(oe===null){for(;!ke.done;be++,ke=L.next())ke=V(N,ke.value,$),ke!==null&&(k=d(ke,k,be),Ce===null?ue=ke:Ce.sibling=ke,Ce=ke);return Oe&&er(N,be),ue}for(oe=o(oe);!ke.done;be++,ke=L.next())ke=B(oe,N,be,ke.value,$),ke!==null&&(n&&ke.alternate!==null&&oe.delete(ke.key===null?be:ke.key),k=d(ke,k,be),Ce===null?ue=ke:Ce.sibling=ke,Ce=ke);return n&&oe.forEach(function(Lw){return r(N,Lw)}),Oe&&er(N,be),ue}function Be(N,k,L,$){if(typeof L=="object"&&L!==null&&L.type===O&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case _:e:{for(var ue=L.key;k!==null;){if(k.key===ue){if(ue=L.type,ue===O){if(k.tag===7){a(N,k.sibling),$=h(k,L.props.children),$.return=N,N=$;break e}}else if(k.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===Y&&Ts(ue)===k.type){a(N,k.sibling),$=h(k,L.props),mi($,L),$.return=N,N=$;break e}a(N,k);break}else r(N,k);k=k.sibling}L.type===O?($=bs(L.props.children,N.mode,$,L.key),$.return=N,N=$):($=Po(L.type,L.key,L.props,null,N.mode,$),mi($,L),$.return=N,N=$)}return v(N);case S:e:{for(ue=L.key;k!==null;){if(k.key===ue)if(k.tag===4&&k.stateNode.containerInfo===L.containerInfo&&k.stateNode.implementation===L.implementation){a(N,k.sibling),$=h(k,L.children||[]),$.return=N,N=$;break e}else{a(N,k);break}else r(N,k);k=k.sibling}$=ac(L,N.mode,$),$.return=N,N=$}return v(N);case Y:return L=Ts(L),Be(N,k,L,$)}if(Me(L))return re(N,k,L,$);if(me(L)){if(ue=me(L),typeof ue!="function")throw Error(i(150));return L=ue.call(L),he(N,k,L,$)}if(typeof L.then=="function")return Be(N,k,Go(L),$);if(L.$$typeof===j)return Be(N,k,Io(N,L),$);Ko(N,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,k!==null&&k.tag===6?(a(N,k.sibling),$=h(k,L),$.return=N,N=$):(a(N,k),$=sc(L,N.mode,$),$.return=N,N=$),v(N)):a(N,k)}return function(N,k,L,$){try{gi=0;var ue=Be(N,k,L,$);return ga=null,ue}catch(oe){if(oe===pa||oe===$o)throw oe;var Ce=en(29,oe,null,N.mode);return Ce.lanes=$,Ce.return=N,Ce}}}var As=op(!0),lp=op(!1),jr=!1;function yc(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vc(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Mr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Nr(n,r,a){var o=n.updateQueue;if(o===null)return null;if(o=o.shared,(Ne&2)!==0){var h=o.pending;return h===null?r.next=r:(r.next=h.next,h.next=r),o.pending=r,r=zo(n),Gd(n,null,a),r}return Uo(n,o,r,a),zo(n)}function yi(n,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var o=r.lanes;o&=n.pendingLanes,a|=o,r.lanes=a,Pt(n,a)}}function bc(n,r){var a=n.updateQueue,o=n.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var h=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var v={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?h=d=v:d=d.next=v,a=a.next}while(a!==null);d===null?h=d=r:d=d.next=r}else h=d=r;a={baseState:o.baseState,firstBaseUpdate:h,lastBaseUpdate:d,shared:o.shared,callbacks:o.callbacks},n.updateQueue=a;return}n=a.lastBaseUpdate,n===null?a.firstBaseUpdate=r:n.next=r,a.lastBaseUpdate=r}var _c=!1;function vi(){if(_c){var n=da;if(n!==null)throw n}}function bi(n,r,a,o){_c=!1;var h=n.updateQueue;jr=!1;var d=h.firstBaseUpdate,v=h.lastBaseUpdate,w=h.shared.pending;if(w!==null){h.shared.pending=null;var x=w,z=x.next;x.next=null,v===null?d=z:v.next=z,v=x;var I=n.alternate;I!==null&&(I=I.updateQueue,w=I.lastBaseUpdate,w!==v&&(w===null?I.firstBaseUpdate=z:w.next=z,I.lastBaseUpdate=x))}if(d!==null){var V=h.baseState;v=0,I=z=x=null,w=d;do{var P=w.lane&-536870913,B=P!==w.lane;if(B?(Re&P)===P:(o&P)===P){P!==0&&P===fa&&(_c=!0),I!==null&&(I=I.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var re=n,he=w;P=r;var Be=a;switch(he.tag){case 1:if(re=he.payload,typeof re=="function"){V=re.call(Be,V,P);break e}V=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=he.payload,P=typeof re=="function"?re.call(Be,V,P):re,P==null)break e;V=m({},V,P);break e;case 2:jr=!0}}P=w.callback,P!==null&&(n.flags|=64,B&&(n.flags|=8192),B=h.callbacks,B===null?h.callbacks=[P]:B.push(P))}else B={lane:P,tag:w.tag,payload:w.payload,callback:w.callback,next:null},I===null?(z=I=B,x=V):I=I.next=B,v|=P;if(w=w.next,w===null){if(w=h.shared.pending,w===null)break;B=w,w=B.next,B.next=null,h.lastBaseUpdate=B,h.shared.pending=null}}while(!0);I===null&&(x=V),h.baseState=x,h.firstBaseUpdate=z,h.lastBaseUpdate=I,d===null&&(h.shared.lanes=0),Pr|=v,n.lanes=v,n.memoizedState=V}}function up(n,r){if(typeof n!="function")throw Error(i(191,n));n.call(r)}function cp(n,r){var a=n.callbacks;if(a!==null)for(n.callbacks=null,n=0;n<a.length;n++)up(a[n],r)}var ma=C(null),Yo=C(0);function hp(n,r){n=hr,G(Yo,n),G(ma,r),hr=n|r.baseLanes}function wc(){G(Yo,hr),G(ma,ma.current)}function Sc(){hr=Yo.current,q(ma),q(Yo)}var tn=C(null),yn=null;function Dr(n){var r=n.alternate;G(et,et.current&1),G(tn,n),yn===null&&(r===null||ma.current!==null||r.memoizedState!==null)&&(yn=n)}function Ec(n){G(et,et.current),G(tn,n),yn===null&&(yn=n)}function fp(n){n.tag===22?(G(et,et.current),G(tn,n),yn===null&&(yn=n)):Lr()}function Lr(){G(et,et.current),G(tn,tn.current)}function nn(n){q(tn),yn===n&&(yn=null),q(et)}var et=C(0);function Fo(n){for(var r=n;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Ch(a)||kh(a)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var rr=0,ve=null,ze=null,rt=null,Qo=!1,ya=!1,Os=!1,Jo=0,_i=0,va=null,R_=0;function Xe(){throw Error(i(321))}function Tc(n,r){if(r===null)return!1;for(var a=0;a<r.length&&a<n.length;a++)if(!Wt(n[a],r[a]))return!1;return!0}function Rc(n,r,a,o,h,d){return rr=d,ve=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,U.H=n===null||n.memoizedState===null?Qp:Hc,Os=!1,d=a(o,h),Os=!1,ya&&(d=pp(r,a,o,h)),dp(n),d}function dp(n){U.H=Ei;var r=ze!==null&&ze.next!==null;if(rr=0,rt=ze=ve=null,Qo=!1,_i=0,va=null,r)throw Error(i(300));n===null||st||(n=n.dependencies,n!==null&&Ho(n)&&(st=!0))}function pp(n,r,a,o){ve=n;var h=0;do{if(ya&&(va=null),_i=0,ya=!1,25<=h)throw Error(i(301));if(h+=1,rt=ze=null,n.updateQueue!=null){var d=n.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}U.H=Jp,d=r(a,o)}while(ya);return d}function A_(){var n=U.H,r=n.useState()[0];return r=typeof r.then=="function"?wi(r):r,n=n.useState()[0],(ze!==null?ze.memoizedState:null)!==n&&(ve.flags|=1024),r}function Ac(){var n=Jo!==0;return Jo=0,n}function Oc(n,r,a){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~a}function xc(n){if(Qo){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}Qo=!1}rr=0,rt=ze=ve=null,ya=!1,_i=Jo=0,va=null}function Mt(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rt===null?ve.memoizedState=rt=n:rt=rt.next=n,rt}function tt(){if(ze===null){var n=ve.alternate;n=n!==null?n.memoizedState:null}else n=ze.next;var r=rt===null?ve.memoizedState:rt.next;if(r!==null)rt=r,ze=n;else{if(n===null)throw ve.alternate===null?Error(i(467)):Error(i(310));ze=n,n={memoizedState:ze.memoizedState,baseState:ze.baseState,baseQueue:ze.baseQueue,queue:ze.queue,next:null},rt===null?ve.memoizedState=rt=n:rt=rt.next=n}return rt}function Xo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wi(n){var r=_i;return _i+=1,va===null&&(va=[]),n=sp(va,n,r),r=ve,(rt===null?r.memoizedState:rt.next)===null&&(r=r.alternate,U.H=r===null||r.memoizedState===null?Qp:Hc),n}function Zo(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return wi(n);if(n.$$typeof===j)return St(n)}throw Error(i(438,String(n)))}function Cc(n){var r=null,a=ve.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var o=ve.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(r={data:o.data.map(function(h){return h.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=Xo(),ve.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(n),o=0;o<n;o++)a[o]=le;return r.index++,a}function sr(n,r){return typeof r=="function"?r(n):r}function Wo(n){var r=tt();return kc(r,ze,n)}function kc(n,r,a){var o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=a;var h=n.baseQueue,d=o.pending;if(d!==null){if(h!==null){var v=h.next;h.next=d.next,d.next=v}r.baseQueue=h=d,o.pending=null}if(d=n.baseState,h===null)n.memoizedState=d;else{r=h.next;var w=v=null,x=null,z=r,I=!1;do{var V=z.lane&-536870913;if(V!==z.lane?(Re&V)===V:(rr&V)===V){var P=z.revertLane;if(P===0)x!==null&&(x=x.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),V===fa&&(I=!0);else if((rr&P)===P){z=z.next,P===fa&&(I=!0);continue}else V={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},x===null?(w=x=V,v=d):x=x.next=V,ve.lanes|=P,Pr|=P;V=z.action,Os&&a(d,V),d=z.hasEagerState?z.eagerState:a(d,V)}else P={lane:V,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},x===null?(w=x=P,v=d):x=x.next=P,ve.lanes|=V,Pr|=V;z=z.next}while(z!==null&&z!==r);if(x===null?v=d:x.next=w,!Wt(d,n.memoizedState)&&(st=!0,I&&(a=da,a!==null)))throw a;n.memoizedState=d,n.baseState=v,n.baseQueue=x,o.lastRenderedState=d}return h===null&&(o.lanes=0),[n.memoizedState,o.dispatch]}function jc(n){var r=tt(),a=r.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=n;var o=a.dispatch,h=a.pending,d=r.memoizedState;if(h!==null){a.pending=null;var v=h=h.next;do d=n(d,v.action),v=v.next;while(v!==h);Wt(d,r.memoizedState)||(st=!0),r.memoizedState=d,r.baseQueue===null&&(r.baseState=d),a.lastRenderedState=d}return[d,o]}function gp(n,r,a){var o=ve,h=tt(),d=Oe;if(d){if(a===void 0)throw Error(i(407));a=a()}else a=r();var v=!Wt((ze||h).memoizedState,a);if(v&&(h.memoizedState=a,st=!0),h=h.queue,Dc(vp.bind(null,o,h,n),[n]),h.getSnapshot!==r||v||rt!==null&&rt.memoizedState.tag&1){if(o.flags|=2048,ba(9,{destroy:void 0},yp.bind(null,o,h,a,r),null),He===null)throw Error(i(349));d||(rr&127)!==0||mp(o,r,a)}return a}function mp(n,r,a){n.flags|=16384,n={getSnapshot:r,value:a},r=ve.updateQueue,r===null?(r=Xo(),ve.updateQueue=r,r.stores=[n]):(a=r.stores,a===null?r.stores=[n]:a.push(n))}function yp(n,r,a,o){r.value=a,r.getSnapshot=o,bp(r)&&_p(n)}function vp(n,r,a){return a(function(){bp(r)&&_p(n)})}function bp(n){var r=n.getSnapshot;n=n.value;try{var a=r();return!Wt(n,a)}catch{return!0}}function _p(n){var r=vs(n,2);r!==null&&Kt(r,n,2)}function Mc(n){var r=Mt();if(typeof n=="function"){var a=n;if(n=a(),Os){Tn(!0);try{a()}finally{Tn(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sr,lastRenderedState:n},r}function wp(n,r,a,o){return n.baseState=a,kc(n,ze,typeof o=="function"?o:sr)}function O_(n,r,a,o,h){if(nl(n))throw Error(i(485));if(n=r.action,n!==null){var d={payload:h,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){d.listeners.push(v)}};U.T!==null?a(!0):d.isTransition=!1,o(d),a=r.pending,a===null?(d.next=r.pending=d,Sp(r,d)):(d.next=a.next,r.pending=a.next=d)}}function Sp(n,r){var a=r.action,o=r.payload,h=n.state;if(r.isTransition){var d=U.T,v={};U.T=v;try{var w=a(h,o),x=U.S;x!==null&&x(v,w),Ep(n,r,w)}catch(z){Nc(n,r,z)}finally{d!==null&&v.types!==null&&(d.types=v.types),U.T=d}}else try{d=a(h,o),Ep(n,r,d)}catch(z){Nc(n,r,z)}}function Ep(n,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){Tp(n,r,o)},function(o){return Nc(n,r,o)}):Tp(n,r,a)}function Tp(n,r,a){r.status="fulfilled",r.value=a,Rp(r),n.state=a,r=n.pending,r!==null&&(a=r.next,a===r?n.pending=null:(a=a.next,r.next=a,Sp(n,a)))}function Nc(n,r,a){var o=n.pending;if(n.pending=null,o!==null){o=o.next;do r.status="rejected",r.reason=a,Rp(r),r=r.next;while(r!==o)}n.action=null}function Rp(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function Ap(n,r){return r}function Op(n,r){if(Oe){var a=He.formState;if(a!==null){e:{var o=ve;if(Oe){if(Ve){t:{for(var h=Ve,d=mn;h.nodeType!==8;){if(!d){h=null;break t}if(h=vn(h.nextSibling),h===null){h=null;break t}}d=h.data,h=d==="F!"||d==="F"?h:null}if(h){Ve=vn(h.nextSibling),o=h.data==="F!";break e}}Cr(o)}o=!1}o&&(r=a[0])}}return a=Mt(),a.memoizedState=a.baseState=r,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ap,lastRenderedState:r},a.queue=o,a=Kp.bind(null,ve,o),o.dispatch=a,o=Mc(!1),d=Bc.bind(null,ve,!1,o.queue),o=Mt(),h={state:r,dispatch:null,action:n,pending:null},o.queue=h,a=O_.bind(null,ve,h,d,a),h.dispatch=a,o.memoizedState=n,[r,a,!1]}function xp(n){var r=tt();return Cp(r,ze,n)}function Cp(n,r,a){if(r=kc(n,r,Ap)[0],n=Wo(sr)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var o=wi(r)}catch(v){throw v===pa?$o:v}else o=r;r=tt();var h=r.queue,d=h.dispatch;return a!==r.memoizedState&&(ve.flags|=2048,ba(9,{destroy:void 0},x_.bind(null,h,a),null)),[o,d,n]}function x_(n,r){n.action=r}function kp(n){var r=tt(),a=ze;if(a!==null)return Cp(r,a,n);tt(),r=r.memoizedState,a=tt();var o=a.queue.dispatch;return a.memoizedState=n,[r,o,!1]}function ba(n,r,a,o){return n={tag:n,create:a,deps:o,inst:r,next:null},r=ve.updateQueue,r===null&&(r=Xo(),ve.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=n.next=n:(o=a.next,a.next=n,n.next=o,r.lastEffect=n),n}function jp(){return tt().memoizedState}function el(n,r,a,o){var h=Mt();ve.flags|=n,h.memoizedState=ba(1|r,{destroy:void 0},a,o===void 0?null:o)}function tl(n,r,a,o){var h=tt();o=o===void 0?null:o;var d=h.memoizedState.inst;ze!==null&&o!==null&&Tc(o,ze.memoizedState.deps)?h.memoizedState=ba(r,d,a,o):(ve.flags|=n,h.memoizedState=ba(1|r,d,a,o))}function Mp(n,r){el(8390656,8,n,r)}function Dc(n,r){tl(2048,8,n,r)}function C_(n){ve.flags|=4;var r=ve.updateQueue;if(r===null)r=Xo(),ve.updateQueue=r,r.events=[n];else{var a=r.events;a===null?r.events=[n]:a.push(n)}}function Np(n){var r=tt().memoizedState;return C_({ref:r,nextImpl:n}),function(){if((Ne&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}function Dp(n,r){return tl(4,2,n,r)}function Lp(n,r){return tl(4,4,n,r)}function Up(n,r){if(typeof r=="function"){n=n();var a=r(n);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function zp(n,r,a){a=a!=null?a.concat([n]):null,tl(4,4,Up.bind(null,r,n),a)}function Lc(){}function Pp(n,r){var a=tt();r=r===void 0?null:r;var o=a.memoizedState;return r!==null&&Tc(r,o[1])?o[0]:(a.memoizedState=[n,r],n)}function Bp(n,r){var a=tt();r=r===void 0?null:r;var o=a.memoizedState;if(r!==null&&Tc(r,o[1]))return o[0];if(o=n(),Os){Tn(!0);try{n()}finally{Tn(!1)}}return a.memoizedState=[o,r],o}function Uc(n,r,a){return a===void 0||(rr&1073741824)!==0&&(Re&261930)===0?n.memoizedState=r:(n.memoizedState=a,n=Hg(),ve.lanes|=n,Pr|=n,a)}function Hp(n,r,a,o){return Wt(a,r)?a:ma.current!==null?(n=Uc(n,a,o),Wt(n,r)||(st=!0),n):(rr&42)===0||(rr&1073741824)!==0&&(Re&261930)===0?(st=!0,n.memoizedState=a):(n=Hg(),ve.lanes|=n,Pr|=n,r)}function Ip(n,r,a,o,h){var d=F.p;F.p=d!==0&&8>d?d:8;var v=U.T,w={};U.T=w,Bc(n,!1,r,a);try{var x=h(),z=U.S;if(z!==null&&z(w,x),x!==null&&typeof x=="object"&&typeof x.then=="function"){var I=T_(x,o);Si(n,r,I,an(n))}else Si(n,r,o,an(n))}catch(V){Si(n,r,{then:function(){},status:"rejected",reason:V},an())}finally{F.p=d,v!==null&&w.types!==null&&(v.types=w.types),U.T=v}}function k_(){}function zc(n,r,a,o){if(n.tag!==5)throw Error(i(476));var h=qp(n).queue;Ip(n,h,r,ae,a===null?k_:function(){return $p(n),a(o)})}function qp(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sr,lastRenderedState:ae},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sr,lastRenderedState:a},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function $p(n){var r=qp(n);r.next===null&&(r=n.alternate.memoizedState),Si(n,r.next.queue,{},an())}function Pc(){return St(Bi)}function Vp(){return tt().memoizedState}function Gp(){return tt().memoizedState}function j_(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var a=an();n=Mr(a);var o=Nr(r,n,a);o!==null&&(Kt(o,r,a),yi(o,r,a)),r={cache:dc()},n.payload=r;return}r=r.return}}function M_(n,r,a){var o=an();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},nl(n)?Yp(r,a):(a=nc(n,r,a,o),a!==null&&(Kt(a,n,o),Fp(a,r,o)))}function Kp(n,r,a){var o=an();Si(n,r,a,o)}function Si(n,r,a,o){var h={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(nl(n))Yp(r,h);else{var d=n.alternate;if(n.lanes===0&&(d===null||d.lanes===0)&&(d=r.lastRenderedReducer,d!==null))try{var v=r.lastRenderedState,w=d(v,a);if(h.hasEagerState=!0,h.eagerState=w,Wt(w,v))return Uo(n,r,h,0),He===null&&Lo(),!1}catch{}if(a=nc(n,r,h,o),a!==null)return Kt(a,n,o),Fp(a,r,o),!0}return!1}function Bc(n,r,a,o){if(o={lane:2,revertLane:yh(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},nl(n)){if(r)throw Error(i(479))}else r=nc(n,a,o,2),r!==null&&Kt(r,n,2)}function nl(n){var r=n.alternate;return n===ve||r!==null&&r===ve}function Yp(n,r){ya=Qo=!0;var a=n.pending;a===null?r.next=r:(r.next=a.next,a.next=r),n.pending=r}function Fp(n,r,a){if((a&4194048)!==0){var o=r.lanes;o&=n.pendingLanes,a|=o,r.lanes=a,Pt(n,a)}}var Ei={readContext:St,use:Zo,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useLayoutEffect:Xe,useInsertionEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useSyncExternalStore:Xe,useId:Xe,useHostTransitionStatus:Xe,useFormState:Xe,useActionState:Xe,useOptimistic:Xe,useMemoCache:Xe,useCacheRefresh:Xe};Ei.useEffectEvent=Xe;var Qp={readContext:St,use:Zo,useCallback:function(n,r){return Mt().memoizedState=[n,r===void 0?null:r],n},useContext:St,useEffect:Mp,useImperativeHandle:function(n,r,a){a=a!=null?a.concat([n]):null,el(4194308,4,Up.bind(null,r,n),a)},useLayoutEffect:function(n,r){return el(4194308,4,n,r)},useInsertionEffect:function(n,r){el(4,2,n,r)},useMemo:function(n,r){var a=Mt();r=r===void 0?null:r;var o=n();if(Os){Tn(!0);try{n()}finally{Tn(!1)}}return a.memoizedState=[o,r],o},useReducer:function(n,r,a){var o=Mt();if(a!==void 0){var h=a(r);if(Os){Tn(!0);try{a(r)}finally{Tn(!1)}}}else h=r;return o.memoizedState=o.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},o.queue=n,n=n.dispatch=M_.bind(null,ve,n),[o.memoizedState,n]},useRef:function(n){var r=Mt();return n={current:n},r.memoizedState=n},useState:function(n){n=Mc(n);var r=n.queue,a=Kp.bind(null,ve,r);return r.dispatch=a,[n.memoizedState,a]},useDebugValue:Lc,useDeferredValue:function(n,r){var a=Mt();return Uc(a,n,r)},useTransition:function(){var n=Mc(!1);return n=Ip.bind(null,ve,n.queue,!0,!1),Mt().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,a){var o=ve,h=Mt();if(Oe){if(a===void 0)throw Error(i(407));a=a()}else{if(a=r(),He===null)throw Error(i(349));(Re&127)!==0||mp(o,r,a)}h.memoizedState=a;var d={value:a,getSnapshot:r};return h.queue=d,Mp(vp.bind(null,o,d,n),[n]),o.flags|=2048,ba(9,{destroy:void 0},yp.bind(null,o,d,a,r),null),a},useId:function(){var n=Mt(),r=He.identifierPrefix;if(Oe){var a=Pn,o=zn;a=(o&~(1<<32-Ot(o)-1)).toString(32)+a,r="_"+r+"R_"+a,a=Jo++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=R_++,r="_"+r+"r_"+a.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:Pc,useFormState:Op,useActionState:Op,useOptimistic:function(n){var r=Mt();r.memoizedState=r.baseState=n;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=Bc.bind(null,ve,!0,a),a.dispatch=r,[n,r]},useMemoCache:Cc,useCacheRefresh:function(){return Mt().memoizedState=j_.bind(null,ve)},useEffectEvent:function(n){var r=Mt(),a={impl:n};return r.memoizedState=a,function(){if((Ne&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Hc={readContext:St,use:Zo,useCallback:Pp,useContext:St,useEffect:Dc,useImperativeHandle:zp,useInsertionEffect:Dp,useLayoutEffect:Lp,useMemo:Bp,useReducer:Wo,useRef:jp,useState:function(){return Wo(sr)},useDebugValue:Lc,useDeferredValue:function(n,r){var a=tt();return Hp(a,ze.memoizedState,n,r)},useTransition:function(){var n=Wo(sr)[0],r=tt().memoizedState;return[typeof n=="boolean"?n:wi(n),r]},useSyncExternalStore:gp,useId:Vp,useHostTransitionStatus:Pc,useFormState:xp,useActionState:xp,useOptimistic:function(n,r){var a=tt();return wp(a,ze,n,r)},useMemoCache:Cc,useCacheRefresh:Gp};Hc.useEffectEvent=Np;var Jp={readContext:St,use:Zo,useCallback:Pp,useContext:St,useEffect:Dc,useImperativeHandle:zp,useInsertionEffect:Dp,useLayoutEffect:Lp,useMemo:Bp,useReducer:jc,useRef:jp,useState:function(){return jc(sr)},useDebugValue:Lc,useDeferredValue:function(n,r){var a=tt();return ze===null?Uc(a,n,r):Hp(a,ze.memoizedState,n,r)},useTransition:function(){var n=jc(sr)[0],r=tt().memoizedState;return[typeof n=="boolean"?n:wi(n),r]},useSyncExternalStore:gp,useId:Vp,useHostTransitionStatus:Pc,useFormState:kp,useActionState:kp,useOptimistic:function(n,r){var a=tt();return ze!==null?wp(a,ze,n,r):(a.baseState=n,[n,a.queue.dispatch])},useMemoCache:Cc,useCacheRefresh:Gp};Jp.useEffectEvent=Np;function Ic(n,r,a,o){r=n.memoizedState,a=a(o,r),a=a==null?r:m({},r,a),n.memoizedState=a,n.lanes===0&&(n.updateQueue.baseState=a)}var qc={enqueueSetState:function(n,r,a){n=n._reactInternals;var o=an(),h=Mr(o);h.payload=r,a!=null&&(h.callback=a),r=Nr(n,h,o),r!==null&&(Kt(r,n,o),yi(r,n,o))},enqueueReplaceState:function(n,r,a){n=n._reactInternals;var o=an(),h=Mr(o);h.tag=1,h.payload=r,a!=null&&(h.callback=a),r=Nr(n,h,o),r!==null&&(Kt(r,n,o),yi(r,n,o))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var a=an(),o=Mr(a);o.tag=2,r!=null&&(o.callback=r),r=Nr(n,o,a),r!==null&&(Kt(r,n,a),yi(r,n,a))}};function Xp(n,r,a,o,h,d,v){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(o,d,v):r.prototype&&r.prototype.isPureReactComponent?!ui(a,o)||!ui(h,d):!0}function Zp(n,r,a,o){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,o),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,o),r.state!==n&&qc.enqueueReplaceState(r,r.state,null)}function xs(n,r){var a=r;if("ref"in r){a={};for(var o in r)o!=="ref"&&(a[o]=r[o])}if(n=n.defaultProps){a===r&&(a=m({},a));for(var h in n)a[h]===void 0&&(a[h]=n[h])}return a}function Wp(n){Do(n)}function eg(n){console.error(n)}function tg(n){Do(n)}function rl(n,r){try{var a=n.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(o){setTimeout(function(){throw o})}}function ng(n,r,a){try{var o=n.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function $c(n,r,a){return a=Mr(a),a.tag=3,a.payload={element:null},a.callback=function(){rl(n,r)},a}function rg(n){return n=Mr(n),n.tag=3,n}function sg(n,r,a,o){var h=a.type.getDerivedStateFromError;if(typeof h=="function"){var d=o.value;n.payload=function(){return h(d)},n.callback=function(){ng(r,a,o)}}var v=a.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(n.callback=function(){ng(r,a,o),typeof h!="function"&&(Br===null?Br=new Set([this]):Br.add(this));var w=o.stack;this.componentDidCatch(o.value,{componentStack:w!==null?w:""})})}function N_(n,r,a,o,h){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(r=a.alternate,r!==null&&ha(r,a,h,!0),a=tn.current,a!==null){switch(a.tag){case 31:case 13:return yn===null?gl():a.alternate===null&&Ze===0&&(Ze=3),a.flags&=-257,a.flags|=65536,a.lanes=h,o===Vo?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([o]):r.add(o),ph(n,o,h)),!1;case 22:return a.flags|=65536,o===Vo?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([o]):a.add(o)),ph(n,o,h)),!1}throw Error(i(435,a.tag))}return ph(n,o,h),gl(),!1}if(Oe)return r=tn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=h,o!==lc&&(n=Error(i(422),{cause:o}),fi(dn(n,a)))):(o!==lc&&(r=Error(i(423),{cause:o}),fi(dn(r,a))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,o=dn(o,a),h=$c(n.stateNode,o,h),bc(n,h),Ze!==4&&(Ze=2)),!1;var d=Error(i(520),{cause:o});if(d=dn(d,a),ji===null?ji=[d]:ji.push(d),Ze!==4&&(Ze=2),r===null)return!0;o=dn(o,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,n=h&-h,a.lanes|=n,n=$c(a.stateNode,o,n),bc(a,n),!1;case 1:if(r=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Br===null||!Br.has(d))))return a.flags|=65536,h&=-h,a.lanes|=h,h=rg(h),sg(h,n,a,o),bc(a,h),!1}a=a.return}while(a!==null);return!1}var Vc=Error(i(461)),st=!1;function Et(n,r,a,o){r.child=n===null?lp(r,null,a,o):As(r,n.child,a,o)}function ag(n,r,a,o,h){a=a.render;var d=r.ref;if("ref"in o){var v={};for(var w in o)w!=="ref"&&(v[w]=o[w])}else v=o;return Ss(r),o=Rc(n,r,a,v,d,h),w=Ac(),n!==null&&!st?(Oc(n,r,h),ar(n,r,h)):(Oe&&w&&ic(r),r.flags|=1,Et(n,r,o,h),r.child)}function ig(n,r,a,o,h){if(n===null){var d=a.type;return typeof d=="function"&&!rc(d)&&d.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=d,og(n,r,d,o,h)):(n=Po(a.type,null,o,r,r.mode,h),n.ref=r.ref,n.return=r,r.child=n)}if(d=n.child,!Zc(n,h)){var v=d.memoizedProps;if(a=a.compare,a=a!==null?a:ui,a(v,o)&&n.ref===r.ref)return ar(n,r,h)}return r.flags|=1,n=Wn(d,o),n.ref=r.ref,n.return=r,r.child=n}function og(n,r,a,o,h){if(n!==null){var d=n.memoizedProps;if(ui(d,o)&&n.ref===r.ref)if(st=!1,r.pendingProps=o=d,Zc(n,h))(n.flags&131072)!==0&&(st=!0);else return r.lanes=n.lanes,ar(n,r,h)}return Gc(n,r,a,o,h)}function lg(n,r,a,o){var h=o.children,d=n!==null?n.memoizedState:null;if(n===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((r.flags&128)!==0){if(d=d!==null?d.baseLanes|a:a,n!==null){for(o=r.child=n.child,h=0;o!==null;)h=h|o.lanes|o.childLanes,o=o.sibling;o=h&~d}else o=0,r.child=null;return ug(n,r,d,a,o)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&qo(r,d!==null?d.cachePool:null),d!==null?hp(r,d):wc(),fp(r);else return o=r.lanes=536870912,ug(n,r,d!==null?d.baseLanes|a:a,a,o)}else d!==null?(qo(r,d.cachePool),hp(r,d),Lr(),r.memoizedState=null):(n!==null&&qo(r,null),wc(),Lr());return Et(n,r,h,a),r.child}function Ti(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function ug(n,r,a,o,h){var d=gc();return d=d===null?null:{parent:nt._currentValue,pool:d},r.memoizedState={baseLanes:a,cachePool:d},n!==null&&qo(r,null),wc(),fp(r),n!==null&&ha(n,r,o,!0),r.childLanes=h,null}function sl(n,r){return r=il({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function cg(n,r,a){return As(r,n.child,null,a),n=sl(r,r.pendingProps),n.flags|=2,nn(r),r.memoizedState=null,n}function D_(n,r,a){var o=r.pendingProps,h=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(Oe){if(o.mode==="hidden")return n=sl(r,o),r.lanes=536870912,Ti(null,n);if(Ec(r),(n=Ve)?(n=Sm(n,mn),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Or!==null?{id:zn,overflow:Pn}:null,retryLane:536870912,hydrationErrors:null},a=Yd(n),a.return=r,r.child=a,wt=r,Ve=null)):n=null,n===null)throw Cr(r);return r.lanes=536870912,null}return sl(r,o)}var d=n.memoizedState;if(d!==null){var v=d.dehydrated;if(Ec(r),h)if(r.flags&256)r.flags&=-257,r=cg(n,r,a);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(i(558));else if(st||ha(n,r,a,!1),h=(a&n.childLanes)!==0,st||h){if(o=He,o!==null&&(v=Bt(o,a),v!==0&&v!==d.retryLane))throw d.retryLane=v,vs(n,v),Kt(o,n,v),Vc;gl(),r=cg(n,r,a)}else n=d.treeContext,Ve=vn(v.nextSibling),wt=r,Oe=!0,xr=null,mn=!1,n!==null&&Jd(r,n),r=sl(r,o),r.flags|=4096;return r}return n=Wn(n.child,{mode:o.mode,children:o.children}),n.ref=r.ref,r.child=n,n.return=r,n}function al(n,r){var a=r.ref;if(a===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(n===null||n.ref!==a)&&(r.flags|=4194816)}}function Gc(n,r,a,o,h){return Ss(r),a=Rc(n,r,a,o,void 0,h),o=Ac(),n!==null&&!st?(Oc(n,r,h),ar(n,r,h)):(Oe&&o&&ic(r),r.flags|=1,Et(n,r,a,h),r.child)}function hg(n,r,a,o,h,d){return Ss(r),r.updateQueue=null,a=pp(r,o,a,h),dp(n),o=Ac(),n!==null&&!st?(Oc(n,r,d),ar(n,r,d)):(Oe&&o&&ic(r),r.flags|=1,Et(n,r,a,d),r.child)}function fg(n,r,a,o,h){if(Ss(r),r.stateNode===null){var d=oa,v=a.contextType;typeof v=="object"&&v!==null&&(d=St(v)),d=new a(o,d),r.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=qc,r.stateNode=d,d._reactInternals=r,d=r.stateNode,d.props=o,d.state=r.memoizedState,d.refs={},yc(r),v=a.contextType,d.context=typeof v=="object"&&v!==null?St(v):oa,d.state=r.memoizedState,v=a.getDerivedStateFromProps,typeof v=="function"&&(Ic(r,a,v,o),d.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(v=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),v!==d.state&&qc.enqueueReplaceState(d,d.state,null),bi(r,o,d,h),vi(),d.state=r.memoizedState),typeof d.componentDidMount=="function"&&(r.flags|=4194308),o=!0}else if(n===null){d=r.stateNode;var w=r.memoizedProps,x=xs(a,w);d.props=x;var z=d.context,I=a.contextType;v=oa,typeof I=="object"&&I!==null&&(v=St(I));var V=a.getDerivedStateFromProps;I=typeof V=="function"||typeof d.getSnapshotBeforeUpdate=="function",w=r.pendingProps!==w,I||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(w||z!==v)&&Zp(r,d,o,v),jr=!1;var P=r.memoizedState;d.state=P,bi(r,o,d,h),vi(),z=r.memoizedState,w||P!==z||jr?(typeof V=="function"&&(Ic(r,a,V,o),z=r.memoizedState),(x=jr||Xp(r,a,x,o,P,z,v))?(I||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(r.flags|=4194308)):(typeof d.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=o,r.memoizedState=z),d.props=o,d.state=z,d.context=v,o=x):(typeof d.componentDidMount=="function"&&(r.flags|=4194308),o=!1)}else{d=r.stateNode,vc(n,r),v=r.memoizedProps,I=xs(a,v),d.props=I,V=r.pendingProps,P=d.context,z=a.contextType,x=oa,typeof z=="object"&&z!==null&&(x=St(z)),w=a.getDerivedStateFromProps,(z=typeof w=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(v!==V||P!==x)&&Zp(r,d,o,x),jr=!1,P=r.memoizedState,d.state=P,bi(r,o,d,h),vi();var B=r.memoizedState;v!==V||P!==B||jr||n!==null&&n.dependencies!==null&&Ho(n.dependencies)?(typeof w=="function"&&(Ic(r,a,w,o),B=r.memoizedState),(I=jr||Xp(r,a,I,o,P,B,x)||n!==null&&n.dependencies!==null&&Ho(n.dependencies))?(z||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(o,B,x),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(o,B,x)),typeof d.componentDidUpdate=="function"&&(r.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof d.componentDidUpdate!="function"||v===n.memoizedProps&&P===n.memoizedState||(r.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||v===n.memoizedProps&&P===n.memoizedState||(r.flags|=1024),r.memoizedProps=o,r.memoizedState=B),d.props=o,d.state=B,d.context=x,o=I):(typeof d.componentDidUpdate!="function"||v===n.memoizedProps&&P===n.memoizedState||(r.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||v===n.memoizedProps&&P===n.memoizedState||(r.flags|=1024),o=!1)}return d=o,al(n,r),o=(r.flags&128)!==0,d||o?(d=r.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:d.render(),r.flags|=1,n!==null&&o?(r.child=As(r,n.child,null,h),r.child=As(r,null,a,h)):Et(n,r,a,h),r.memoizedState=d.state,n=r.child):n=ar(n,r,h),n}function dg(n,r,a,o){return _s(),r.flags|=256,Et(n,r,a,o),r.child}var Kc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yc(n){return{baseLanes:n,cachePool:np()}}function Fc(n,r,a){return n=n!==null?n.childLanes&~a:0,r&&(n|=sn),n}function pg(n,r,a){var o=r.pendingProps,h=!1,d=(r.flags&128)!==0,v;if((v=d)||(v=n!==null&&n.memoizedState===null?!1:(et.current&2)!==0),v&&(h=!0,r.flags&=-129),v=(r.flags&32)!==0,r.flags&=-33,n===null){if(Oe){if(h?Dr(r):Lr(),(n=Ve)?(n=Sm(n,mn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Or!==null?{id:zn,overflow:Pn}:null,retryLane:536870912,hydrationErrors:null},a=Yd(n),a.return=r,r.child=a,wt=r,Ve=null)):n=null,n===null)throw Cr(r);return kh(n)?r.lanes=32:r.lanes=536870912,null}var w=o.children;return o=o.fallback,h?(Lr(),h=r.mode,w=il({mode:"hidden",children:w},h),o=bs(o,h,a,null),w.return=r,o.return=r,w.sibling=o,r.child=w,o=r.child,o.memoizedState=Yc(a),o.childLanes=Fc(n,v,a),r.memoizedState=Kc,Ti(null,o)):(Dr(r),Qc(r,w))}var x=n.memoizedState;if(x!==null&&(w=x.dehydrated,w!==null)){if(d)r.flags&256?(Dr(r),r.flags&=-257,r=Jc(n,r,a)):r.memoizedState!==null?(Lr(),r.child=n.child,r.flags|=128,r=null):(Lr(),w=o.fallback,h=r.mode,o=il({mode:"visible",children:o.children},h),w=bs(w,h,a,null),w.flags|=2,o.return=r,w.return=r,o.sibling=w,r.child=o,As(r,n.child,null,a),o=r.child,o.memoizedState=Yc(a),o.childLanes=Fc(n,v,a),r.memoizedState=Kc,r=Ti(null,o));else if(Dr(r),kh(w)){if(v=w.nextSibling&&w.nextSibling.dataset,v)var z=v.dgst;v=z,o=Error(i(419)),o.stack="",o.digest=v,fi({value:o,source:null,stack:null}),r=Jc(n,r,a)}else if(st||ha(n,r,a,!1),v=(a&n.childLanes)!==0,st||v){if(v=He,v!==null&&(o=Bt(v,a),o!==0&&o!==x.retryLane))throw x.retryLane=o,vs(n,o),Kt(v,n,o),Vc;Ch(w)||gl(),r=Jc(n,r,a)}else Ch(w)?(r.flags|=192,r.child=n.child,r=null):(n=x.treeContext,Ve=vn(w.nextSibling),wt=r,Oe=!0,xr=null,mn=!1,n!==null&&Jd(r,n),r=Qc(r,o.children),r.flags|=4096);return r}return h?(Lr(),w=o.fallback,h=r.mode,x=n.child,z=x.sibling,o=Wn(x,{mode:"hidden",children:o.children}),o.subtreeFlags=x.subtreeFlags&65011712,z!==null?w=Wn(z,w):(w=bs(w,h,a,null),w.flags|=2),w.return=r,o.return=r,o.sibling=w,r.child=o,Ti(null,o),o=r.child,w=n.child.memoizedState,w===null?w=Yc(a):(h=w.cachePool,h!==null?(x=nt._currentValue,h=h.parent!==x?{parent:x,pool:x}:h):h=np(),w={baseLanes:w.baseLanes|a,cachePool:h}),o.memoizedState=w,o.childLanes=Fc(n,v,a),r.memoizedState=Kc,Ti(n.child,o)):(Dr(r),a=n.child,n=a.sibling,a=Wn(a,{mode:"visible",children:o.children}),a.return=r,a.sibling=null,n!==null&&(v=r.deletions,v===null?(r.deletions=[n],r.flags|=16):v.push(n)),r.child=a,r.memoizedState=null,a)}function Qc(n,r){return r=il({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function il(n,r){return n=en(22,n,null,r),n.lanes=0,n}function Jc(n,r,a){return As(r,n.child,null,a),n=Qc(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function gg(n,r,a){n.lanes|=r;var o=n.alternate;o!==null&&(o.lanes|=r),hc(n.return,r,a)}function Xc(n,r,a,o,h,d){var v=n.memoizedState;v===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:h,treeForkCount:d}:(v.isBackwards=r,v.rendering=null,v.renderingStartTime=0,v.last=o,v.tail=a,v.tailMode=h,v.treeForkCount=d)}function mg(n,r,a){var o=r.pendingProps,h=o.revealOrder,d=o.tail;o=o.children;var v=et.current,w=(v&2)!==0;if(w?(v=v&1|2,r.flags|=128):v&=1,G(et,v),Et(n,r,o,a),o=Oe?hi:0,!w&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&gg(n,a,r);else if(n.tag===19)gg(n,a,r);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break e;for(;n.sibling===null;){if(n.return===null||n.return===r)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(h){case"forwards":for(a=r.child,h=null;a!==null;)n=a.alternate,n!==null&&Fo(n)===null&&(h=a),a=a.sibling;a=h,a===null?(h=r.child,r.child=null):(h=a.sibling,a.sibling=null),Xc(r,!1,h,a,d,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,h=r.child,r.child=null;h!==null;){if(n=h.alternate,n!==null&&Fo(n)===null){r.child=h;break}n=h.sibling,h.sibling=a,a=h,h=n}Xc(r,!0,a,null,d,o);break;case"together":Xc(r,!1,null,null,void 0,o);break;default:r.memoizedState=null}return r.child}function ar(n,r,a){if(n!==null&&(r.dependencies=n.dependencies),Pr|=r.lanes,(a&r.childLanes)===0)if(n!==null){if(ha(n,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(i(153));if(r.child!==null){for(n=r.child,a=Wn(n,n.pendingProps),r.child=a,a.return=r;n.sibling!==null;)n=n.sibling,a=a.sibling=Wn(n,n.pendingProps),a.return=r;a.sibling=null}return r.child}function Zc(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&Ho(n)))}function L_(n,r,a){switch(r.tag){case 3:de(r,r.stateNode.containerInfo),kr(r,nt,n.memoizedState.cache),_s();break;case 27:case 5:Dt(r);break;case 4:de(r,r.stateNode.containerInfo);break;case 10:kr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Ec(r),null;break;case 13:var o=r.memoizedState;if(o!==null)return o.dehydrated!==null?(Dr(r),r.flags|=128,null):(a&r.child.childLanes)!==0?pg(n,r,a):(Dr(r),n=ar(n,r,a),n!==null?n.sibling:null);Dr(r);break;case 19:var h=(n.flags&128)!==0;if(o=(a&r.childLanes)!==0,o||(ha(n,r,a,!1),o=(a&r.childLanes)!==0),h){if(o)return mg(n,r,a);r.flags|=128}if(h=r.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),G(et,et.current),o)break;return null;case 22:return r.lanes=0,lg(n,r,a,r.pendingProps);case 24:kr(r,nt,n.memoizedState.cache)}return ar(n,r,a)}function yg(n,r,a){if(n!==null)if(n.memoizedProps!==r.pendingProps)st=!0;else{if(!Zc(n,a)&&(r.flags&128)===0)return st=!1,L_(n,r,a);st=(n.flags&131072)!==0}else st=!1,Oe&&(r.flags&1048576)!==0&&Qd(r,hi,r.index);switch(r.lanes=0,r.tag){case 16:e:{var o=r.pendingProps;if(n=Ts(r.elementType),r.type=n,typeof n=="function")rc(n)?(o=xs(n,o),r.tag=1,r=fg(null,r,n,o,a)):(r.tag=0,r=Gc(null,r,n,o,a));else{if(n!=null){var h=n.$$typeof;if(h===D){r.tag=11,r=ag(null,r,n,o,a);break e}else if(h===H){r.tag=14,r=ig(null,r,n,o,a);break e}}throw r=qe(n)||n,Error(i(306,r,""))}}return r;case 0:return Gc(n,r,r.type,r.pendingProps,a);case 1:return o=r.type,h=xs(o,r.pendingProps),fg(n,r,o,h,a);case 3:e:{if(de(r,r.stateNode.containerInfo),n===null)throw Error(i(387));o=r.pendingProps;var d=r.memoizedState;h=d.element,vc(n,r),bi(r,o,null,a);var v=r.memoizedState;if(o=v.cache,kr(r,nt,o),o!==d.cache&&fc(r,[nt],a,!0),vi(),o=v.element,d.isDehydrated)if(d={element:o,isDehydrated:!1,cache:v.cache},r.updateQueue.baseState=d,r.memoizedState=d,r.flags&256){r=dg(n,r,o,a);break e}else if(o!==h){h=dn(Error(i(424)),r),fi(h),r=dg(n,r,o,a);break e}else for(n=r.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,Ve=vn(n.firstChild),wt=r,Oe=!0,xr=null,mn=!0,a=lp(r,null,o,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(_s(),o===h){r=ar(n,r,a);break e}Et(n,r,o,a)}r=r.child}return r;case 26:return al(n,r),n===null?(a=xm(r.type,null,r.pendingProps,null))?r.memoizedState=a:Oe||(a=r.type,n=r.pendingProps,o=Sl(ce.current).createElement(a),o[_t]=r,o[Ht]=n,Tt(o,a,n),pt(o),r.stateNode=o):r.memoizedState=xm(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return Dt(r),n===null&&Oe&&(o=r.stateNode=Rm(r.type,r.pendingProps,ce.current),wt=r,mn=!0,h=Ve,$r(r.type)?(jh=h,Ve=vn(o.firstChild)):Ve=h),Et(n,r,r.pendingProps.children,a),al(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&Oe&&((h=o=Ve)&&(o=hw(o,r.type,r.pendingProps,mn),o!==null?(r.stateNode=o,wt=r,Ve=vn(o.firstChild),mn=!1,h=!0):h=!1),h||Cr(r)),Dt(r),h=r.type,d=r.pendingProps,v=n!==null?n.memoizedProps:null,o=d.children,Ah(h,d)?o=null:v!==null&&Ah(h,v)&&(r.flags|=32),r.memoizedState!==null&&(h=Rc(n,r,A_,null,null,a),Bi._currentValue=h),al(n,r),Et(n,r,o,a),r.child;case 6:return n===null&&Oe&&((n=a=Ve)&&(a=fw(a,r.pendingProps,mn),a!==null?(r.stateNode=a,wt=r,Ve=null,n=!0):n=!1),n||Cr(r)),null;case 13:return pg(n,r,a);case 4:return de(r,r.stateNode.containerInfo),o=r.pendingProps,n===null?r.child=As(r,null,o,a):Et(n,r,o,a),r.child;case 11:return ag(n,r,r.type,r.pendingProps,a);case 7:return Et(n,r,r.pendingProps,a),r.child;case 8:return Et(n,r,r.pendingProps.children,a),r.child;case 12:return Et(n,r,r.pendingProps.children,a),r.child;case 10:return o=r.pendingProps,kr(r,r.type,o.value),Et(n,r,o.children,a),r.child;case 9:return h=r.type._context,o=r.pendingProps.children,Ss(r),h=St(h),o=o(h),r.flags|=1,Et(n,r,o,a),r.child;case 14:return ig(n,r,r.type,r.pendingProps,a);case 15:return og(n,r,r.type,r.pendingProps,a);case 19:return mg(n,r,a);case 31:return D_(n,r,a);case 22:return lg(n,r,a,r.pendingProps);case 24:return Ss(r),o=St(nt),n===null?(h=gc(),h===null&&(h=He,d=dc(),h.pooledCache=d,d.refCount++,d!==null&&(h.pooledCacheLanes|=a),h=d),r.memoizedState={parent:o,cache:h},yc(r),kr(r,nt,h)):((n.lanes&a)!==0&&(vc(n,r),bi(r,null,null,a),vi()),h=n.memoizedState,d=r.memoizedState,h.parent!==o?(h={parent:o,cache:o},r.memoizedState=h,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=h),kr(r,nt,o)):(o=d.cache,kr(r,nt,o),o!==h.cache&&fc(r,[nt],a,!0))),Et(n,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(i(156,r.tag))}function ir(n){n.flags|=4}function Wc(n,r,a,o,h){if((r=(n.mode&32)!==0)&&(r=!1),r){if(n.flags|=16777216,(h&335544128)===h)if(n.stateNode.complete)n.flags|=8192;else if(Vg())n.flags|=8192;else throw Rs=Vo,mc}else n.flags&=-16777217}function vg(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Nm(r))if(Vg())n.flags|=8192;else throw Rs=Vo,mc}function ol(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?xt():536870912,n.lanes|=r,Ea|=r)}function Ri(n,r){if(!Oe)switch(n.tailMode){case"hidden":r=n.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?n.tail=null:a.sibling=null;break;case"collapsed":a=n.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:o.sibling=null}}function Ge(n){var r=n.alternate!==null&&n.alternate.child===n.child,a=0,o=0;if(r)for(var h=n.child;h!==null;)a|=h.lanes|h.childLanes,o|=h.subtreeFlags&65011712,o|=h.flags&65011712,h.return=n,h=h.sibling;else for(h=n.child;h!==null;)a|=h.lanes|h.childLanes,o|=h.subtreeFlags,o|=h.flags,h.return=n,h=h.sibling;return n.subtreeFlags|=o,n.childLanes=a,r}function U_(n,r,a){var o=r.pendingProps;switch(oc(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ge(r),null;case 1:return Ge(r),null;case 3:return a=r.stateNode,o=null,n!==null&&(o=n.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),nr(nt),xe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(n===null||n.child===null)&&(ca(r)?ir(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,uc())),Ge(r),null;case 26:var h=r.type,d=r.memoizedState;return n===null?(ir(r),d!==null?(Ge(r),vg(r,d)):(Ge(r),Wc(r,h,null,o,a))):d?d!==n.memoizedState?(ir(r),Ge(r),vg(r,d)):(Ge(r),r.flags&=-16777217):(n=n.memoizedProps,n!==o&&ir(r),Ge(r),Wc(r,h,n,o,a)),null;case 27:if(Lt(r),a=ce.current,h=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==o&&ir(r);else{if(!o){if(r.stateNode===null)throw Error(i(166));return Ge(r),null}n=Q.current,ca(r)?Xd(r):(n=Rm(h,o,a),r.stateNode=n,ir(r))}return Ge(r),null;case 5:if(Lt(r),h=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==o&&ir(r);else{if(!o){if(r.stateNode===null)throw Error(i(166));return Ge(r),null}if(d=Q.current,ca(r))Xd(r);else{var v=Sl(ce.current);switch(d){case 1:d=v.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:d=v.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":d=v.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":d=v.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":d=v.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof o.is=="string"?v.createElement("select",{is:o.is}):v.createElement("select"),o.multiple?d.multiple=!0:o.size&&(d.size=o.size);break;default:d=typeof o.is=="string"?v.createElement(h,{is:o.is}):v.createElement(h)}}d[_t]=r,d[Ht]=o;e:for(v=r.child;v!==null;){if(v.tag===5||v.tag===6)d.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===r)break e;for(;v.sibling===null;){if(v.return===null||v.return===r)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}r.stateNode=d;e:switch(Tt(d,h,o),h){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ir(r)}}return Ge(r),Wc(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,a),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==o&&ir(r);else{if(typeof o!="string"&&r.stateNode===null)throw Error(i(166));if(n=ce.current,ca(r)){if(n=r.stateNode,a=r.memoizedProps,o=null,h=wt,h!==null)switch(h.tag){case 27:case 5:o=h.memoizedProps}n[_t]=r,n=!!(n.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||pm(n.nodeValue,a)),n||Cr(r,!0)}else n=Sl(n).createTextNode(o),n[_t]=r,r.stateNode=n}return Ge(r),null;case 31:if(a=r.memoizedState,n===null||n.memoizedState!==null){if(o=ca(r),a!==null){if(n===null){if(!o)throw Error(i(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(557));n[_t]=r}else _s(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Ge(r),n=!1}else a=uc(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=a),n=!0;if(!n)return r.flags&256?(nn(r),r):(nn(r),null);if((r.flags&128)!==0)throw Error(i(558))}return Ge(r),null;case 13:if(o=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=ca(r),o!==null&&o.dehydrated!==null){if(n===null){if(!h)throw Error(i(318));if(h=r.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(i(317));h[_t]=r}else _s(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Ge(r),h=!1}else h=uc(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return r.flags&256?(nn(r),r):(nn(r),null)}return nn(r),(r.flags&128)!==0?(r.lanes=a,r):(a=o!==null,n=n!==null&&n.memoizedState!==null,a&&(o=r.child,h=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(h=o.alternate.memoizedState.cachePool.pool),d=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),d!==h&&(o.flags|=2048)),a!==n&&a&&(r.child.flags|=8192),ol(r,r.updateQueue),Ge(r),null);case 4:return xe(),n===null&&wh(r.stateNode.containerInfo),Ge(r),null;case 10:return nr(r.type),Ge(r),null;case 19:if(q(et),o=r.memoizedState,o===null)return Ge(r),null;if(h=(r.flags&128)!==0,d=o.rendering,d===null)if(h)Ri(o,!1);else{if(Ze!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(d=Fo(n),d!==null){for(r.flags|=128,Ri(o,!1),n=d.updateQueue,r.updateQueue=n,ol(r,n),r.subtreeFlags=0,n=a,a=r.child;a!==null;)Kd(a,n),a=a.sibling;return G(et,et.current&1|2),Oe&&er(r,o.treeForkCount),r.child}n=n.sibling}o.tail!==null&&ft()>fl&&(r.flags|=128,h=!0,Ri(o,!1),r.lanes=4194304)}else{if(!h)if(n=Fo(d),n!==null){if(r.flags|=128,h=!0,n=n.updateQueue,r.updateQueue=n,ol(r,n),Ri(o,!0),o.tail===null&&o.tailMode==="hidden"&&!d.alternate&&!Oe)return Ge(r),null}else 2*ft()-o.renderingStartTime>fl&&a!==536870912&&(r.flags|=128,h=!0,Ri(o,!1),r.lanes=4194304);o.isBackwards?(d.sibling=r.child,r.child=d):(n=o.last,n!==null?n.sibling=d:r.child=d,o.last=d)}return o.tail!==null?(n=o.tail,o.rendering=n,o.tail=n.sibling,o.renderingStartTime=ft(),n.sibling=null,a=et.current,G(et,h?a&1|2:a&1),Oe&&er(r,o.treeForkCount),n):(Ge(r),null);case 22:case 23:return nn(r),Sc(),o=r.memoizedState!==null,n!==null?n.memoizedState!==null!==o&&(r.flags|=8192):o&&(r.flags|=8192),o?(a&536870912)!==0&&(r.flags&128)===0&&(Ge(r),r.subtreeFlags&6&&(r.flags|=8192)):Ge(r),a=r.updateQueue,a!==null&&ol(r,a.retryQueue),a=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048),n!==null&&q(Es),null;case 24:return a=null,n!==null&&(a=n.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),nr(nt),Ge(r),null;case 25:return null;case 30:return null}throw Error(i(156,r.tag))}function z_(n,r){switch(oc(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return nr(nt),xe(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return Lt(r),null;case 31:if(r.memoizedState!==null){if(nn(r),r.alternate===null)throw Error(i(340));_s()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(nn(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(i(340));_s()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return q(et),null;case 4:return xe(),null;case 10:return nr(r.type),null;case 22:case 23:return nn(r),Sc(),n!==null&&q(Es),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return nr(nt),null;case 25:return null;default:return null}}function bg(n,r){switch(oc(r),r.tag){case 3:nr(nt),xe();break;case 26:case 27:case 5:Lt(r);break;case 4:xe();break;case 31:r.memoizedState!==null&&nn(r);break;case 13:nn(r);break;case 19:q(et);break;case 10:nr(r.type);break;case 22:case 23:nn(r),Sc(),n!==null&&q(Es);break;case 24:nr(nt)}}function Ai(n,r){try{var a=r.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var h=o.next;a=h;do{if((a.tag&n)===n){o=void 0;var d=a.create,v=a.inst;o=d(),v.destroy=o}a=a.next}while(a!==h)}}catch(w){Le(r,r.return,w)}}function Ur(n,r,a){try{var o=r.updateQueue,h=o!==null?o.lastEffect:null;if(h!==null){var d=h.next;o=d;do{if((o.tag&n)===n){var v=o.inst,w=v.destroy;if(w!==void 0){v.destroy=void 0,h=r;var x=a,z=w;try{z()}catch(I){Le(h,x,I)}}}o=o.next}while(o!==d)}}catch(I){Le(r,r.return,I)}}function _g(n){var r=n.updateQueue;if(r!==null){var a=n.stateNode;try{cp(r,a)}catch(o){Le(n,n.return,o)}}}function wg(n,r,a){a.props=xs(n.type,n.memoizedProps),a.state=n.memoizedState;try{a.componentWillUnmount()}catch(o){Le(n,r,o)}}function Oi(n,r){try{var a=n.ref;if(a!==null){switch(n.tag){case 26:case 27:case 5:var o=n.stateNode;break;case 30:o=n.stateNode;break;default:o=n.stateNode}typeof a=="function"?n.refCleanup=a(o):a.current=o}}catch(h){Le(n,r,h)}}function Bn(n,r){var a=n.ref,o=n.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(h){Le(n,r,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(h){Le(n,r,h)}else a.current=null}function Sg(n){var r=n.type,a=n.memoizedProps,o=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break e;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(h){Le(n,n.return,h)}}function eh(n,r,a){try{var o=n.stateNode;aw(o,n.type,a,r),o[Ht]=r}catch(h){Le(n,n.return,h)}}function Eg(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&$r(n.type)||n.tag===4}function th(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Eg(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&$r(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function nh(n,r,a){var o=n.tag;if(o===5||o===6)n=n.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(n,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(n),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=Xn));else if(o!==4&&(o===27&&$r(n.type)&&(a=n.stateNode,r=null),n=n.child,n!==null))for(nh(n,r,a),n=n.sibling;n!==null;)nh(n,r,a),n=n.sibling}function ll(n,r,a){var o=n.tag;if(o===5||o===6)n=n.stateNode,r?a.insertBefore(n,r):a.appendChild(n);else if(o!==4&&(o===27&&$r(n.type)&&(a=n.stateNode),n=n.child,n!==null))for(ll(n,r,a),n=n.sibling;n!==null;)ll(n,r,a),n=n.sibling}function Tg(n){var r=n.stateNode,a=n.memoizedProps;try{for(var o=n.type,h=r.attributes;h.length;)r.removeAttributeNode(h[0]);Tt(r,o,a),r[_t]=n,r[Ht]=a}catch(d){Le(n,n.return,d)}}var or=!1,at=!1,rh=!1,Rg=typeof WeakSet=="function"?WeakSet:Set,gt=null;function P_(n,r){if(n=n.containerInfo,Th=Cl,n=zd(n),Ju(n)){if("selectionStart"in n)var a={start:n.selectionStart,end:n.selectionEnd};else e:{a=(a=n.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var h=o.anchorOffset,d=o.focusNode;o=o.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var v=0,w=-1,x=-1,z=0,I=0,V=n,P=null;t:for(;;){for(var B;V!==a||h!==0&&V.nodeType!==3||(w=v+h),V!==d||o!==0&&V.nodeType!==3||(x=v+o),V.nodeType===3&&(v+=V.nodeValue.length),(B=V.firstChild)!==null;)P=V,V=B;for(;;){if(V===n)break t;if(P===a&&++z===h&&(w=v),P===d&&++I===o&&(x=v),(B=V.nextSibling)!==null)break;V=P,P=V.parentNode}V=B}a=w===-1||x===-1?null:{start:w,end:x}}else a=null}a=a||{start:0,end:0}}else a=null;for(Rh={focusedElem:n,selectionRange:a},Cl=!1,gt=r;gt!==null;)if(r=gt,n=r.child,(r.subtreeFlags&1028)!==0&&n!==null)n.return=r,gt=n;else for(;gt!==null;){switch(r=gt,d=r.alternate,n=r.flags,r.tag){case 0:if((n&4)!==0&&(n=r.updateQueue,n=n!==null?n.events:null,n!==null))for(a=0;a<n.length;a++)h=n[a],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&d!==null){n=void 0,a=r,h=d.memoizedProps,d=d.memoizedState,o=a.stateNode;try{var re=xs(a.type,h);n=o.getSnapshotBeforeUpdate(re,d),o.__reactInternalSnapshotBeforeUpdate=n}catch(he){Le(a,a.return,he)}}break;case 3:if((n&1024)!==0){if(n=r.stateNode.containerInfo,a=n.nodeType,a===9)xh(n);else if(a===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":xh(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(i(163))}if(n=r.sibling,n!==null){n.return=r.return,gt=n;break}gt=r.return}}function Ag(n,r,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:ur(n,a),o&4&&Ai(5,a);break;case 1:if(ur(n,a),o&4)if(n=a.stateNode,r===null)try{n.componentDidMount()}catch(v){Le(a,a.return,v)}else{var h=xs(a.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(h,r,n.__reactInternalSnapshotBeforeUpdate)}catch(v){Le(a,a.return,v)}}o&64&&_g(a),o&512&&Oi(a,a.return);break;case 3:if(ur(n,a),o&64&&(n=a.updateQueue,n!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{cp(n,r)}catch(v){Le(a,a.return,v)}}break;case 27:r===null&&o&4&&Tg(a);case 26:case 5:ur(n,a),r===null&&o&4&&Sg(a),o&512&&Oi(a,a.return);break;case 12:ur(n,a);break;case 31:ur(n,a),o&4&&Cg(n,a);break;case 13:ur(n,a),o&4&&kg(n,a),o&64&&(n=a.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(a=Y_.bind(null,a),dw(n,a))));break;case 22:if(o=a.memoizedState!==null||or,!o){r=r!==null&&r.memoizedState!==null||at,h=or;var d=at;or=o,(at=r)&&!d?cr(n,a,(a.subtreeFlags&8772)!==0):ur(n,a),or=h,at=d}break;case 30:break;default:ur(n,a)}}function Og(n){var r=n.alternate;r!==null&&(n.alternate=null,Og(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&Nu(r)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Ye=null,qt=!1;function lr(n,r,a){for(a=a.child;a!==null;)xg(n,r,a),a=a.sibling}function xg(n,r,a){if(jt&&typeof jt.onCommitFiberUnmount=="function")try{jt.onCommitFiberUnmount(hs,a)}catch{}switch(a.tag){case 26:at||Bn(a,r),lr(n,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:at||Bn(a,r);var o=Ye,h=qt;$r(a.type)&&(Ye=a.stateNode,qt=!1),lr(n,r,a),Ui(a.stateNode),Ye=o,qt=h;break;case 5:at||Bn(a,r);case 6:if(o=Ye,h=qt,Ye=null,lr(n,r,a),Ye=o,qt=h,Ye!==null)if(qt)try{(Ye.nodeType===9?Ye.body:Ye.nodeName==="HTML"?Ye.ownerDocument.body:Ye).removeChild(a.stateNode)}catch(d){Le(a,r,d)}else try{Ye.removeChild(a.stateNode)}catch(d){Le(a,r,d)}break;case 18:Ye!==null&&(qt?(n=Ye,_m(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,a.stateNode),ja(n)):_m(Ye,a.stateNode));break;case 4:o=Ye,h=qt,Ye=a.stateNode.containerInfo,qt=!0,lr(n,r,a),Ye=o,qt=h;break;case 0:case 11:case 14:case 15:Ur(2,a,r),at||Ur(4,a,r),lr(n,r,a);break;case 1:at||(Bn(a,r),o=a.stateNode,typeof o.componentWillUnmount=="function"&&wg(a,r,o)),lr(n,r,a);break;case 21:lr(n,r,a);break;case 22:at=(o=at)||a.memoizedState!==null,lr(n,r,a),at=o;break;default:lr(n,r,a)}}function Cg(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{ja(n)}catch(a){Le(r,r.return,a)}}}function kg(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{ja(n)}catch(a){Le(r,r.return,a)}}function B_(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new Rg),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new Rg),r;default:throw Error(i(435,n.tag))}}function ul(n,r){var a=B_(n);r.forEach(function(o){if(!a.has(o)){a.add(o);var h=F_.bind(null,n,o);o.then(h,h)}})}function $t(n,r){var a=r.deletions;if(a!==null)for(var o=0;o<a.length;o++){var h=a[o],d=n,v=r,w=v;e:for(;w!==null;){switch(w.tag){case 27:if($r(w.type)){Ye=w.stateNode,qt=!1;break e}break;case 5:Ye=w.stateNode,qt=!1;break e;case 3:case 4:Ye=w.stateNode.containerInfo,qt=!0;break e}w=w.return}if(Ye===null)throw Error(i(160));xg(d,v,h),Ye=null,qt=!1,d=h.alternate,d!==null&&(d.return=null),h.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)jg(r,n),r=r.sibling}var On=null;function jg(n,r){var a=n.alternate,o=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:$t(r,n),Vt(n),o&4&&(Ur(3,n,n.return),Ai(3,n),Ur(5,n,n.return));break;case 1:$t(r,n),Vt(n),o&512&&(at||a===null||Bn(a,a.return)),o&64&&or&&(n=n.updateQueue,n!==null&&(o=n.callbacks,o!==null&&(a=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var h=On;if($t(r,n),Vt(n),o&512&&(at||a===null||Bn(a,a.return)),o&4){var d=a!==null?a.memoizedState:null;if(o=n.memoizedState,a===null)if(o===null)if(n.stateNode===null){e:{o=n.type,a=n.memoizedProps,h=h.ownerDocument||h;t:switch(o){case"title":d=h.getElementsByTagName("title")[0],(!d||d[ei]||d[_t]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=h.createElement(o),h.head.insertBefore(d,h.querySelector("head > title"))),Tt(d,o,a),d[_t]=n,pt(d),o=d;break e;case"link":var v=jm("link","href",h).get(o+(a.href||""));if(v){for(var w=0;w<v.length;w++)if(d=v[w],d.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&d.getAttribute("rel")===(a.rel==null?null:a.rel)&&d.getAttribute("title")===(a.title==null?null:a.title)&&d.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){v.splice(w,1);break t}}d=h.createElement(o),Tt(d,o,a),h.head.appendChild(d);break;case"meta":if(v=jm("meta","content",h).get(o+(a.content||""))){for(w=0;w<v.length;w++)if(d=v[w],d.getAttribute("content")===(a.content==null?null:""+a.content)&&d.getAttribute("name")===(a.name==null?null:a.name)&&d.getAttribute("property")===(a.property==null?null:a.property)&&d.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&d.getAttribute("charset")===(a.charSet==null?null:a.charSet)){v.splice(w,1);break t}}d=h.createElement(o),Tt(d,o,a),h.head.appendChild(d);break;default:throw Error(i(468,o))}d[_t]=n,pt(d),o=d}n.stateNode=o}else Mm(h,n.type,n.stateNode);else n.stateNode=km(h,o,n.memoizedProps);else d!==o?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,o===null?Mm(h,n.type,n.stateNode):km(h,o,n.memoizedProps)):o===null&&n.stateNode!==null&&eh(n,n.memoizedProps,a.memoizedProps)}break;case 27:$t(r,n),Vt(n),o&512&&(at||a===null||Bn(a,a.return)),a!==null&&o&4&&eh(n,n.memoizedProps,a.memoizedProps);break;case 5:if($t(r,n),Vt(n),o&512&&(at||a===null||Bn(a,a.return)),n.flags&32){h=n.stateNode;try{ea(h,"")}catch(re){Le(n,n.return,re)}}o&4&&n.stateNode!=null&&(h=n.memoizedProps,eh(n,h,a!==null?a.memoizedProps:h)),o&1024&&(rh=!0);break;case 6:if($t(r,n),Vt(n),o&4){if(n.stateNode===null)throw Error(i(162));o=n.memoizedProps,a=n.stateNode;try{a.nodeValue=o}catch(re){Le(n,n.return,re)}}break;case 3:if(Rl=null,h=On,On=El(r.containerInfo),$t(r,n),On=h,Vt(n),o&4&&a!==null&&a.memoizedState.isDehydrated)try{ja(r.containerInfo)}catch(re){Le(n,n.return,re)}rh&&(rh=!1,Mg(n));break;case 4:o=On,On=El(n.stateNode.containerInfo),$t(r,n),Vt(n),On=o;break;case 12:$t(r,n),Vt(n);break;case 31:$t(r,n),Vt(n),o&4&&(o=n.updateQueue,o!==null&&(n.updateQueue=null,ul(n,o)));break;case 13:$t(r,n),Vt(n),n.child.flags&8192&&n.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(hl=ft()),o&4&&(o=n.updateQueue,o!==null&&(n.updateQueue=null,ul(n,o)));break;case 22:h=n.memoizedState!==null;var x=a!==null&&a.memoizedState!==null,z=or,I=at;if(or=z||h,at=I||x,$t(r,n),at=I,or=z,Vt(n),o&8192)e:for(r=n.stateNode,r._visibility=h?r._visibility&-2:r._visibility|1,h&&(a===null||x||or||at||Cs(n)),a=null,r=n;;){if(r.tag===5||r.tag===26){if(a===null){x=a=r;try{if(d=x.stateNode,h)v=d.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{w=x.stateNode;var V=x.memoizedProps.style,P=V!=null&&V.hasOwnProperty("display")?V.display:null;w.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(re){Le(x,x.return,re)}}}else if(r.tag===6){if(a===null){x=r;try{x.stateNode.nodeValue=h?"":x.memoizedProps}catch(re){Le(x,x.return,re)}}}else if(r.tag===18){if(a===null){x=r;try{var B=x.stateNode;h?wm(B,!0):wm(x.stateNode,!1)}catch(re){Le(x,x.return,re)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===n)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break e;for(;r.sibling===null;){if(r.return===null||r.return===n)break e;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}o&4&&(o=n.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,ul(n,a))));break;case 19:$t(r,n),Vt(n),o&4&&(o=n.updateQueue,o!==null&&(n.updateQueue=null,ul(n,o)));break;case 30:break;case 21:break;default:$t(r,n),Vt(n)}}function Vt(n){var r=n.flags;if(r&2){try{for(var a,o=n.return;o!==null;){if(Eg(o)){a=o;break}o=o.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var h=a.stateNode,d=th(n);ll(n,d,h);break;case 5:var v=a.stateNode;a.flags&32&&(ea(v,""),a.flags&=-33);var w=th(n);ll(n,w,v);break;case 3:case 4:var x=a.stateNode.containerInfo,z=th(n);nh(n,z,x);break;default:throw Error(i(161))}}catch(I){Le(n,n.return,I)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function Mg(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;Mg(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),n=n.sibling}}function ur(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Ag(n,r.alternate,r),r=r.sibling}function Cs(n){for(n=n.child;n!==null;){var r=n;switch(r.tag){case 0:case 11:case 14:case 15:Ur(4,r,r.return),Cs(r);break;case 1:Bn(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&wg(r,r.return,a),Cs(r);break;case 27:Ui(r.stateNode);case 26:case 5:Bn(r,r.return),Cs(r);break;case 22:r.memoizedState===null&&Cs(r);break;case 30:Cs(r);break;default:Cs(r)}n=n.sibling}}function cr(n,r,a){for(a=a&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var o=r.alternate,h=n,d=r,v=d.flags;switch(d.tag){case 0:case 11:case 15:cr(h,d,a),Ai(4,d);break;case 1:if(cr(h,d,a),o=d,h=o.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(z){Le(o,o.return,z)}if(o=d,h=o.updateQueue,h!==null){var w=o.stateNode;try{var x=h.shared.hiddenCallbacks;if(x!==null)for(h.shared.hiddenCallbacks=null,h=0;h<x.length;h++)up(x[h],w)}catch(z){Le(o,o.return,z)}}a&&v&64&&_g(d),Oi(d,d.return);break;case 27:Tg(d);case 26:case 5:cr(h,d,a),a&&o===null&&v&4&&Sg(d),Oi(d,d.return);break;case 12:cr(h,d,a);break;case 31:cr(h,d,a),a&&v&4&&Cg(h,d);break;case 13:cr(h,d,a),a&&v&4&&kg(h,d);break;case 22:d.memoizedState===null&&cr(h,d,a),Oi(d,d.return);break;case 30:break;default:cr(h,d,a)}r=r.sibling}}function sh(n,r){var a=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==a&&(n!=null&&n.refCount++,a!=null&&di(a))}function ah(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&di(n))}function xn(n,r,a,o){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Ng(n,r,a,o),r=r.sibling}function Ng(n,r,a,o){var h=r.flags;switch(r.tag){case 0:case 11:case 15:xn(n,r,a,o),h&2048&&Ai(9,r);break;case 1:xn(n,r,a,o);break;case 3:xn(n,r,a,o),h&2048&&(n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&di(n)));break;case 12:if(h&2048){xn(n,r,a,o),n=r.stateNode;try{var d=r.memoizedProps,v=d.id,w=d.onPostCommit;typeof w=="function"&&w(v,r.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(x){Le(r,r.return,x)}}else xn(n,r,a,o);break;case 31:xn(n,r,a,o);break;case 13:xn(n,r,a,o);break;case 23:break;case 22:d=r.stateNode,v=r.alternate,r.memoizedState!==null?d._visibility&2?xn(n,r,a,o):xi(n,r):d._visibility&2?xn(n,r,a,o):(d._visibility|=2,_a(n,r,a,o,(r.subtreeFlags&10256)!==0||!1)),h&2048&&sh(v,r);break;case 24:xn(n,r,a,o),h&2048&&ah(r.alternate,r);break;default:xn(n,r,a,o)}}function _a(n,r,a,o,h){for(h=h&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var d=n,v=r,w=a,x=o,z=v.flags;switch(v.tag){case 0:case 11:case 15:_a(d,v,w,x,h),Ai(8,v);break;case 23:break;case 22:var I=v.stateNode;v.memoizedState!==null?I._visibility&2?_a(d,v,w,x,h):xi(d,v):(I._visibility|=2,_a(d,v,w,x,h)),h&&z&2048&&sh(v.alternate,v);break;case 24:_a(d,v,w,x,h),h&&z&2048&&ah(v.alternate,v);break;default:_a(d,v,w,x,h)}r=r.sibling}}function xi(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=n,o=r,h=o.flags;switch(o.tag){case 22:xi(a,o),h&2048&&sh(o.alternate,o);break;case 24:xi(a,o),h&2048&&ah(o.alternate,o);break;default:xi(a,o)}r=r.sibling}}var Ci=8192;function wa(n,r,a){if(n.subtreeFlags&Ci)for(n=n.child;n!==null;)Dg(n,r,a),n=n.sibling}function Dg(n,r,a){switch(n.tag){case 26:wa(n,r,a),n.flags&Ci&&n.memoizedState!==null&&Rw(a,On,n.memoizedState,n.memoizedProps);break;case 5:wa(n,r,a);break;case 3:case 4:var o=On;On=El(n.stateNode.containerInfo),wa(n,r,a),On=o;break;case 22:n.memoizedState===null&&(o=n.alternate,o!==null&&o.memoizedState!==null?(o=Ci,Ci=16777216,wa(n,r,a),Ci=o):wa(n,r,a));break;default:wa(n,r,a)}}function Lg(n){var r=n.alternate;if(r!==null&&(n=r.child,n!==null)){r.child=null;do r=n.sibling,n.sibling=null,n=r;while(n!==null)}}function ki(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var o=r[a];gt=o,zg(o,n)}Lg(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Ug(n),n=n.sibling}function Ug(n){switch(n.tag){case 0:case 11:case 15:ki(n),n.flags&2048&&Ur(9,n,n.return);break;case 3:ki(n);break;case 12:ki(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,cl(n)):ki(n);break;default:ki(n)}}function cl(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var o=r[a];gt=o,zg(o,n)}Lg(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:Ur(8,r,r.return),cl(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,cl(r));break;default:cl(r)}n=n.sibling}}function zg(n,r){for(;gt!==null;){var a=gt;switch(a.tag){case 0:case 11:case 15:Ur(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:di(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,gt=o;else e:for(a=n;gt!==null;){o=gt;var h=o.sibling,d=o.return;if(Og(o),o===a){gt=null;break e}if(h!==null){h.return=d,gt=h;break e}gt=d}}}var H_={getCacheForType:function(n){var r=St(nt),a=r.data.get(n);return a===void 0&&(a=n(),r.data.set(n,a)),a},cacheSignal:function(){return St(nt).controller.signal}},I_=typeof WeakMap=="function"?WeakMap:Map,Ne=0,He=null,Ee=null,Re=0,De=0,rn=null,zr=!1,Sa=!1,ih=!1,hr=0,Ze=0,Pr=0,ks=0,oh=0,sn=0,Ea=0,ji=null,Gt=null,lh=!1,hl=0,Pg=0,fl=1/0,dl=null,Br=null,lt=0,Hr=null,Ta=null,fr=0,uh=0,ch=null,Bg=null,Mi=0,hh=null;function an(){return(Ne&2)!==0&&Re!==0?Re&-Re:U.T!==null?yh():ju()}function Hg(){if(sn===0)if((Re&536870912)===0||Oe){var n=Ks;Ks<<=1,(Ks&3932160)===0&&(Ks=262144),sn=n}else sn=536870912;return n=tn.current,n!==null&&(n.flags|=32),sn}function Kt(n,r,a){(n===He&&(De===2||De===9)||n.cancelPendingCommit!==null)&&(Ra(n,0),Ir(n,Re,sn,!1)),Qe(n,a),((Ne&2)===0||n!==He)&&(n===He&&((Ne&2)===0&&(ks|=a),Ze===4&&Ir(n,Re,sn,!1)),Hn(n))}function Ig(n,r,a){if((Ne&6)!==0)throw Error(i(327));var o=!a&&(r&127)===0&&(r&n.expiredLanes)===0||Ke(n,r),h=o?V_(n,r):dh(n,r,!0),d=o;do{if(h===0){Sa&&!o&&Ir(n,r,0,!1);break}else{if(a=n.current.alternate,d&&!q_(a)){h=dh(n,r,!1),d=!1;continue}if(h===2){if(d=r,n.errorRecoveryDisabledLanes&d)var v=0;else v=n.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){r=v;e:{var w=n;h=ji;var x=w.current.memoizedState.isDehydrated;if(x&&(Ra(w,v).flags|=256),v=dh(w,v,!1),v!==2){if(ih&&!x){w.errorRecoveryDisabledLanes|=d,ks|=d,h=4;break e}d=Gt,Gt=h,d!==null&&(Gt===null?Gt=d:Gt.push.apply(Gt,d))}h=v}if(d=!1,h!==2)continue}}if(h===1){Ra(n,0),Ir(n,r,0,!0);break}e:{switch(o=n,d=h,d){case 0:case 1:throw Error(i(345));case 4:if((r&4194048)!==r)break;case 6:Ir(o,r,sn,!zr);break e;case 2:Gt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((r&62914560)===r&&(h=hl+300-ft(),10<h)){if(Ir(o,r,sn,!zr),pe(o,0,!0)!==0)break e;fr=r,o.timeoutHandle=vm(qg.bind(null,o,a,Gt,dl,lh,r,sn,ks,Ea,zr,d,"Throttled",-0,0),h);break e}qg(o,a,Gt,dl,lh,r,sn,ks,Ea,zr,d,null,-0,0)}}break}while(!0);Hn(n)}function qg(n,r,a,o,h,d,v,w,x,z,I,V,P,B){if(n.timeoutHandle=-1,V=r.subtreeFlags,V&8192||(V&16785408)===16785408){V={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xn},Dg(r,d,V);var re=(d&62914560)===d?hl-ft():(d&4194048)===d?Pg-ft():0;if(re=Aw(V,re),re!==null){fr=d,n.cancelPendingCommit=re(Jg.bind(null,n,r,d,a,o,h,v,w,x,I,V,null,P,B)),Ir(n,d,v,!z);return}}Jg(n,r,d,a,o,h,v,w,x)}function q_(n){for(var r=n;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var h=a[o],d=h.getSnapshot;h=h.value;try{if(!Wt(d(),h))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Ir(n,r,a,o){r&=~oh,r&=~ks,n.suspendedLanes|=r,n.pingedLanes&=~r,o&&(n.warmLanes|=r),o=n.expirationTimes;for(var h=r;0<h;){var d=31-Ot(h),v=1<<d;o[d]=-1,h&=~v}a!==0&&ds(n,a,r)}function pl(){return(Ne&6)===0?(Ni(0),!1):!0}function fh(){if(Ee!==null){if(De===0)var n=Ee.return;else n=Ee,tr=ws=null,xc(n),ga=null,gi=0,n=Ee;for(;n!==null;)bg(n.alternate,n),n=n.return;Ee=null}}function Ra(n,r){var a=n.timeoutHandle;a!==-1&&(n.timeoutHandle=-1,lw(a)),a=n.cancelPendingCommit,a!==null&&(n.cancelPendingCommit=null,a()),fr=0,fh(),He=n,Ee=a=Wn(n.current,null),Re=r,De=0,rn=null,zr=!1,Sa=Ke(n,r),ih=!1,Ea=sn=oh=ks=Pr=Ze=0,Gt=ji=null,lh=!1,(r&8)!==0&&(r|=r&32);var o=n.entangledLanes;if(o!==0)for(n=n.entanglements,o&=r;0<o;){var h=31-Ot(o),d=1<<h;r|=n[h],o&=~d}return hr=r,Lo(),a}function $g(n,r){ve=null,U.H=Ei,r===pa||r===$o?(r=ap(),De=3):r===mc?(r=ap(),De=4):De=r===Vc?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,rn=r,Ee===null&&(Ze=1,rl(n,dn(r,n.current)))}function Vg(){var n=tn.current;return n===null?!0:(Re&4194048)===Re?yn===null:(Re&62914560)===Re||(Re&536870912)!==0?n===yn:!1}function Gg(){var n=U.H;return U.H=Ei,n===null?Ei:n}function Kg(){var n=U.A;return U.A=H_,n}function gl(){Ze=4,zr||(Re&4194048)!==Re&&tn.current!==null||(Sa=!0),(Pr&134217727)===0&&(ks&134217727)===0||He===null||Ir(He,Re,sn,!1)}function dh(n,r,a){var o=Ne;Ne|=2;var h=Gg(),d=Kg();(He!==n||Re!==r)&&(dl=null,Ra(n,r)),r=!1;var v=Ze;e:do try{if(De!==0&&Ee!==null){var w=Ee,x=rn;switch(De){case 8:fh(),v=6;break e;case 3:case 2:case 9:case 6:tn.current===null&&(r=!0);var z=De;if(De=0,rn=null,Aa(n,w,x,z),a&&Sa){v=0;break e}break;default:z=De,De=0,rn=null,Aa(n,w,x,z)}}$_(),v=Ze;break}catch(I){$g(n,I)}while(!0);return r&&n.shellSuspendCounter++,tr=ws=null,Ne=o,U.H=h,U.A=d,Ee===null&&(He=null,Re=0,Lo()),v}function $_(){for(;Ee!==null;)Yg(Ee)}function V_(n,r){var a=Ne;Ne|=2;var o=Gg(),h=Kg();He!==n||Re!==r?(dl=null,fl=ft()+500,Ra(n,r)):Sa=Ke(n,r);e:do try{if(De!==0&&Ee!==null){r=Ee;var d=rn;t:switch(De){case 1:De=0,rn=null,Aa(n,r,d,1);break;case 2:case 9:if(rp(d)){De=0,rn=null,Fg(r);break}r=function(){De!==2&&De!==9||He!==n||(De=7),Hn(n)},d.then(r,r);break e;case 3:De=7;break e;case 4:De=5;break e;case 7:rp(d)?(De=0,rn=null,Fg(r)):(De=0,rn=null,Aa(n,r,d,7));break;case 5:var v=null;switch(Ee.tag){case 26:v=Ee.memoizedState;case 5:case 27:var w=Ee;if(v?Nm(v):w.stateNode.complete){De=0,rn=null;var x=w.sibling;if(x!==null)Ee=x;else{var z=w.return;z!==null?(Ee=z,ml(z)):Ee=null}break t}}De=0,rn=null,Aa(n,r,d,5);break;case 6:De=0,rn=null,Aa(n,r,d,6);break;case 8:fh(),Ze=6;break e;default:throw Error(i(462))}}G_();break}catch(I){$g(n,I)}while(!0);return tr=ws=null,U.H=o,U.A=h,Ne=a,Ee!==null?0:(He=null,Re=0,Lo(),Ze)}function G_(){for(;Ee!==null&&!ht();)Yg(Ee)}function Yg(n){var r=yg(n.alternate,n,hr);n.memoizedProps=n.pendingProps,r===null?ml(n):Ee=r}function Fg(n){var r=n,a=r.alternate;switch(r.tag){case 15:case 0:r=hg(a,r,r.pendingProps,r.type,void 0,Re);break;case 11:r=hg(a,r,r.pendingProps,r.type.render,r.ref,Re);break;case 5:xc(r);default:bg(a,r),r=Ee=Kd(r,hr),r=yg(a,r,hr)}n.memoizedProps=n.pendingProps,r===null?ml(n):Ee=r}function Aa(n,r,a,o){tr=ws=null,xc(r),ga=null,gi=0;var h=r.return;try{if(N_(n,h,r,a,Re)){Ze=1,rl(n,dn(a,n.current)),Ee=null;return}}catch(d){if(h!==null)throw Ee=h,d;Ze=1,rl(n,dn(a,n.current)),Ee=null;return}r.flags&32768?(Oe||o===1?n=!0:Sa||(Re&536870912)!==0?n=!1:(zr=n=!0,(o===2||o===9||o===3||o===6)&&(o=tn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Qg(r,n)):ml(r)}function ml(n){var r=n;do{if((r.flags&32768)!==0){Qg(r,zr);return}n=r.return;var a=U_(r.alternate,r,hr);if(a!==null){Ee=a;return}if(r=r.sibling,r!==null){Ee=r;return}Ee=r=n}while(r!==null);Ze===0&&(Ze=5)}function Qg(n,r){do{var a=z_(n.alternate,n);if(a!==null){a.flags&=32767,Ee=a;return}if(a=n.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(n=n.sibling,n!==null)){Ee=n;return}Ee=n=a}while(n!==null);Ze=6,Ee=null}function Jg(n,r,a,o,h,d,v,w,x){n.cancelPendingCommit=null;do yl();while(lt!==0);if((Ne&6)!==0)throw Error(i(327));if(r!==null){if(r===n.current)throw Error(i(177));if(d=r.lanes|r.childLanes,d|=tc,zt(n,a,d,v,w,x),n===He&&(Ee=He=null,Re=0),Ta=r,Hr=n,fr=a,uh=d,ch=h,Bg=o,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,Q_(Fn,function(){return tm(),null})):(n.callbackNode=null,n.callbackPriority=0),o=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||o){o=U.T,U.T=null,h=F.p,F.p=2,v=Ne,Ne|=4;try{P_(n,r,a)}finally{Ne=v,F.p=h,U.T=o}}lt=1,Xg(),Zg(),Wg()}}function Xg(){if(lt===1){lt=0;var n=Hr,r=Ta,a=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||a){a=U.T,U.T=null;var o=F.p;F.p=2;var h=Ne;Ne|=4;try{jg(r,n);var d=Rh,v=zd(n.containerInfo),w=d.focusedElem,x=d.selectionRange;if(v!==w&&w&&w.ownerDocument&&Ud(w.ownerDocument.documentElement,w)){if(x!==null&&Ju(w)){var z=x.start,I=x.end;if(I===void 0&&(I=z),"selectionStart"in w)w.selectionStart=z,w.selectionEnd=Math.min(I,w.value.length);else{var V=w.ownerDocument||document,P=V&&V.defaultView||window;if(P.getSelection){var B=P.getSelection(),re=w.textContent.length,he=Math.min(x.start,re),Be=x.end===void 0?he:Math.min(x.end,re);!B.extend&&he>Be&&(v=Be,Be=he,he=v);var N=Ld(w,he),k=Ld(w,Be);if(N&&k&&(B.rangeCount!==1||B.anchorNode!==N.node||B.anchorOffset!==N.offset||B.focusNode!==k.node||B.focusOffset!==k.offset)){var L=V.createRange();L.setStart(N.node,N.offset),B.removeAllRanges(),he>Be?(B.addRange(L),B.extend(k.node,k.offset)):(L.setEnd(k.node,k.offset),B.addRange(L))}}}}for(V=[],B=w;B=B.parentNode;)B.nodeType===1&&V.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<V.length;w++){var $=V[w];$.element.scrollLeft=$.left,$.element.scrollTop=$.top}}Cl=!!Th,Rh=Th=null}finally{Ne=h,F.p=o,U.T=a}}n.current=r,lt=2}}function Zg(){if(lt===2){lt=0;var n=Hr,r=Ta,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=U.T,U.T=null;var o=F.p;F.p=2;var h=Ne;Ne|=4;try{Ag(n,r.alternate,r)}finally{Ne=h,F.p=o,U.T=a}}lt=3}}function Wg(){if(lt===4||lt===3){lt=0,Dn();var n=Hr,r=Ta,a=fr,o=Bg;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?lt=5:(lt=0,Ta=Hr=null,em(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(Br=null),Rn(a),r=r.stateNode,jt&&typeof jt.onCommitFiberRoot=="function")try{jt.onCommitFiberRoot(hs,r,void 0,(r.current.flags&128)===128)}catch{}if(o!==null){r=U.T,h=F.p,F.p=2,U.T=null;try{for(var d=n.onRecoverableError,v=0;v<o.length;v++){var w=o[v];d(w.value,{componentStack:w.stack})}}finally{U.T=r,F.p=h}}(fr&3)!==0&&yl(),Hn(n),h=n.pendingLanes,(a&261930)!==0&&(h&42)!==0?n===hh?Mi++:(Mi=0,hh=n):Mi=0,Ni(0)}}function em(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,di(r)))}function yl(){return Xg(),Zg(),Wg(),tm()}function tm(){if(lt!==5)return!1;var n=Hr,r=uh;uh=0;var a=Rn(fr),o=U.T,h=F.p;try{F.p=32>a?32:a,U.T=null,a=ch,ch=null;var d=Hr,v=fr;if(lt=0,Ta=Hr=null,fr=0,(Ne&6)!==0)throw Error(i(331));var w=Ne;if(Ne|=4,Ug(d.current),Ng(d,d.current,v,a),Ne=w,Ni(0,!1),jt&&typeof jt.onPostCommitFiberRoot=="function")try{jt.onPostCommitFiberRoot(hs,d)}catch{}return!0}finally{F.p=h,U.T=o,em(n,r)}}function nm(n,r,a){r=dn(a,r),r=$c(n.stateNode,r,2),n=Nr(n,r,2),n!==null&&(Qe(n,2),Hn(n))}function Le(n,r,a){if(n.tag===3)nm(n,n,a);else for(;r!==null;){if(r.tag===3){nm(r,n,a);break}else if(r.tag===1){var o=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Br===null||!Br.has(o))){n=dn(a,n),a=rg(2),o=Nr(r,a,2),o!==null&&(sg(a,o,r,n),Qe(o,2),Hn(o));break}}r=r.return}}function ph(n,r,a){var o=n.pingCache;if(o===null){o=n.pingCache=new I_;var h=new Set;o.set(r,h)}else h=o.get(r),h===void 0&&(h=new Set,o.set(r,h));h.has(a)||(ih=!0,h.add(a),n=K_.bind(null,n,r,a),r.then(n,n))}function K_(n,r,a){var o=n.pingCache;o!==null&&o.delete(r),n.pingedLanes|=n.suspendedLanes&a,n.warmLanes&=~a,He===n&&(Re&a)===a&&(Ze===4||Ze===3&&(Re&62914560)===Re&&300>ft()-hl?(Ne&2)===0&&Ra(n,0):oh|=a,Ea===Re&&(Ea=0)),Hn(n)}function rm(n,r){r===0&&(r=xt()),n=vs(n,r),n!==null&&(Qe(n,r),Hn(n))}function Y_(n){var r=n.memoizedState,a=0;r!==null&&(a=r.retryLane),rm(n,a)}function F_(n,r){var a=0;switch(n.tag){case 31:case 13:var o=n.stateNode,h=n.memoizedState;h!==null&&(a=h.retryLane);break;case 19:o=n.stateNode;break;case 22:o=n.stateNode._retryCache;break;default:throw Error(i(314))}o!==null&&o.delete(r),rm(n,a)}function Q_(n,r){return Zt(n,r)}var vl=null,Oa=null,gh=!1,bl=!1,mh=!1,qr=0;function Hn(n){n!==Oa&&n.next===null&&(Oa===null?vl=Oa=n:Oa=Oa.next=n),bl=!0,gh||(gh=!0,X_())}function Ni(n,r){if(!mh&&bl){mh=!0;do for(var a=!1,o=vl;o!==null;){if(n!==0){var h=o.pendingLanes;if(h===0)var d=0;else{var v=o.suspendedLanes,w=o.pingedLanes;d=(1<<31-Ot(42|n)+1)-1,d&=h&~(v&~w),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,om(o,d))}else d=Re,d=pe(o,o===He?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(d&3)===0||Ke(o,d)||(a=!0,om(o,d));o=o.next}while(a);mh=!1}}function J_(){sm()}function sm(){bl=gh=!1;var n=0;qr!==0&&ow()&&(n=qr);for(var r=ft(),a=null,o=vl;o!==null;){var h=o.next,d=am(o,r);d===0?(o.next=null,a===null?vl=h:a.next=h,h===null&&(Oa=a)):(a=o,(n!==0||(d&3)!==0)&&(bl=!0)),o=h}lt!==0&&lt!==5||Ni(n),qr!==0&&(qr=0)}function am(n,r){for(var a=n.suspendedLanes,o=n.pingedLanes,h=n.expirationTimes,d=n.pendingLanes&-62914561;0<d;){var v=31-Ot(d),w=1<<v,x=h[v];x===-1?((w&a)===0||(w&o)!==0)&&(h[v]=dt(w,r)):x<=r&&(n.expiredLanes|=w),d&=~w}if(r=He,a=Re,a=pe(n,n===r?a:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),o=n.callbackNode,a===0||n===r&&(De===2||De===9)||n.cancelPendingCommit!==null)return o!==null&&o!==null&&cs(o),n.callbackNode=null,n.callbackPriority=0;if((a&3)===0||Ke(n,a)){if(r=a&-a,r===n.callbackPriority)return r;switch(o!==null&&cs(o),Rn(a)){case 2:case 8:a=un;break;case 32:a=Fn;break;case 268435456:a=Qn;break;default:a=Fn}return o=im.bind(null,n),a=Zt(a,o),n.callbackPriority=r,n.callbackNode=a,r}return o!==null&&o!==null&&cs(o),n.callbackPriority=2,n.callbackNode=null,2}function im(n,r){if(lt!==0&&lt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var a=n.callbackNode;if(yl()&&n.callbackNode!==a)return null;var o=Re;return o=pe(n,n===He?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),o===0?null:(Ig(n,o,r),am(n,ft()),n.callbackNode!=null&&n.callbackNode===a?im.bind(null,n):null)}function om(n,r){if(yl())return null;Ig(n,r,!0)}function X_(){uw(function(){(Ne&6)!==0?Zt(Je,J_):sm()})}function yh(){if(qr===0){var n=fa;n===0&&(n=Gs,Gs<<=1,(Gs&261888)===0&&(Gs=256)),qr=n}return qr}function lm(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Oo(""+n)}function um(n,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,n.id&&a.setAttribute("form",n.id),r.parentNode.insertBefore(a,r),n=new FormData(n),a.parentNode.removeChild(a),n}function Z_(n,r,a,o,h){if(r==="submit"&&a&&a.stateNode===h){var d=lm((h[Ht]||null).action),v=o.submitter;v&&(r=(r=v[Ht]||null)?lm(r.formAction):v.getAttribute("formAction"),r!==null&&(d=r,v=null));var w=new jo("action","action",null,o,h);n.push({event:w,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(qr!==0){var x=v?um(h,v):new FormData(h);zc(a,{pending:!0,data:x,method:h.method,action:d},null,x)}}else typeof d=="function"&&(w.preventDefault(),x=v?um(h,v):new FormData(h),zc(a,{pending:!0,data:x,method:h.method,action:d},d,x))},currentTarget:h}]})}}for(var vh=0;vh<ec.length;vh++){var bh=ec[vh],W_=bh.toLowerCase(),ew=bh[0].toUpperCase()+bh.slice(1);An(W_,"on"+ew)}An(Hd,"onAnimationEnd"),An(Id,"onAnimationIteration"),An(qd,"onAnimationStart"),An("dblclick","onDoubleClick"),An("focusin","onFocus"),An("focusout","onBlur"),An(m_,"onTransitionRun"),An(y_,"onTransitionStart"),An(v_,"onTransitionCancel"),An($d,"onTransitionEnd"),Zs("onMouseEnter",["mouseout","mouseover"]),Zs("onMouseLeave",["mouseout","mouseover"]),Zs("onPointerEnter",["pointerout","pointerover"]),Zs("onPointerLeave",["pointerout","pointerover"]),ps("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ps("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ps("onBeforeInput",["compositionend","keypress","textInput","paste"]),ps("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ps("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ps("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Di="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),tw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Di));function cm(n,r){r=(r&4)!==0;for(var a=0;a<n.length;a++){var o=n[a],h=o.event;o=o.listeners;e:{var d=void 0;if(r)for(var v=o.length-1;0<=v;v--){var w=o[v],x=w.instance,z=w.currentTarget;if(w=w.listener,x!==d&&h.isPropagationStopped())break e;d=w,h.currentTarget=z;try{d(h)}catch(I){Do(I)}h.currentTarget=null,d=x}else for(v=0;v<o.length;v++){if(w=o[v],x=w.instance,z=w.currentTarget,w=w.listener,x!==d&&h.isPropagationStopped())break e;d=w,h.currentTarget=z;try{d(h)}catch(I){Do(I)}h.currentTarget=null,d=x}}}}function Te(n,r){var a=r[Mu];a===void 0&&(a=r[Mu]=new Set);var o=n+"__bubble";a.has(o)||(hm(r,n,2,!1),a.add(o))}function _h(n,r,a){var o=0;r&&(o|=4),hm(a,n,o,r)}var _l="_reactListening"+Math.random().toString(36).slice(2);function wh(n){if(!n[_l]){n[_l]=!0,sd.forEach(function(a){a!=="selectionchange"&&(tw.has(a)||_h(a,!1,n),_h(a,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[_l]||(r[_l]=!0,_h("selectionchange",!1,r))}}function hm(n,r,a,o){switch(Hm(r)){case 2:var h=Cw;break;case 8:h=kw;break;default:h=Uh}a=h.bind(null,r,a,n),h=void 0,!Iu||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(h=!0),o?h!==void 0?n.addEventListener(r,a,{capture:!0,passive:h}):n.addEventListener(r,a,!0):h!==void 0?n.addEventListener(r,a,{passive:h}):n.addEventListener(r,a,!1)}function Sh(n,r,a,o,h){var d=o;if((r&1)===0&&(r&2)===0&&o!==null)e:for(;;){if(o===null)return;var v=o.tag;if(v===3||v===4){var w=o.stateNode.containerInfo;if(w===h)break;if(v===4)for(v=o.return;v!==null;){var x=v.tag;if((x===3||x===4)&&v.stateNode.containerInfo===h)return;v=v.return}for(;w!==null;){if(v=Qs(w),v===null)return;if(x=v.tag,x===5||x===6||x===26||x===27){o=d=v;continue e}w=w.parentNode}}o=o.return}md(function(){var z=d,I=Bu(a),V=[];e:{var P=Vd.get(n);if(P!==void 0){var B=jo,re=n;switch(n){case"keypress":if(Co(a)===0)break e;case"keydown":case"keyup":B=Fb;break;case"focusin":re="focus",B=Gu;break;case"focusout":re="blur",B=Gu;break;case"beforeblur":case"afterblur":B=Gu;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":B=bd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":B=Ub;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":B=Xb;break;case Hd:case Id:case qd:B=Bb;break;case $d:B=Wb;break;case"scroll":case"scrollend":B=Db;break;case"wheel":B=t_;break;case"copy":case"cut":case"paste":B=Ib;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":B=wd;break;case"toggle":case"beforetoggle":B=r_}var he=(r&4)!==0,Be=!he&&(n==="scroll"||n==="scrollend"),N=he?P!==null?P+"Capture":null:P;he=[];for(var k=z,L;k!==null;){var $=k;if(L=$.stateNode,$=$.tag,$!==5&&$!==26&&$!==27||L===null||N===null||($=ni(k,N),$!=null&&he.push(Li(k,$,L))),Be)break;k=k.return}0<he.length&&(P=new B(P,re,null,a,I),V.push({event:P,listeners:he}))}}if((r&7)===0){e:{if(P=n==="mouseover"||n==="pointerover",B=n==="mouseout"||n==="pointerout",P&&a!==Pu&&(re=a.relatedTarget||a.fromElement)&&(Qs(re)||re[Fs]))break e;if((B||P)&&(P=I.window===I?I:(P=I.ownerDocument)?P.defaultView||P.parentWindow:window,B?(re=a.relatedTarget||a.toElement,B=z,re=re?Qs(re):null,re!==null&&(Be=u(re),he=re.tag,re!==Be||he!==5&&he!==27&&he!==6)&&(re=null)):(B=null,re=z),B!==re)){if(he=bd,$="onMouseLeave",N="onMouseEnter",k="mouse",(n==="pointerout"||n==="pointerover")&&(he=wd,$="onPointerLeave",N="onPointerEnter",k="pointer"),Be=B==null?P:ti(B),L=re==null?P:ti(re),P=new he($,k+"leave",B,a,I),P.target=Be,P.relatedTarget=L,$=null,Qs(I)===z&&(he=new he(N,k+"enter",re,a,I),he.target=L,he.relatedTarget=Be,$=he),Be=$,B&&re)t:{for(he=nw,N=B,k=re,L=0,$=N;$;$=he($))L++;$=0;for(var ue=k;ue;ue=he(ue))$++;for(;0<L-$;)N=he(N),L--;for(;0<$-L;)k=he(k),$--;for(;L--;){if(N===k||k!==null&&N===k.alternate){he=N;break t}N=he(N),k=he(k)}he=null}else he=null;B!==null&&fm(V,P,B,he,!1),re!==null&&Be!==null&&fm(V,Be,re,he,!0)}}e:{if(P=z?ti(z):window,B=P.nodeName&&P.nodeName.toLowerCase(),B==="select"||B==="input"&&P.type==="file")var Ce=Cd;else if(Od(P))if(kd)Ce=d_;else{Ce=h_;var oe=c_}else B=P.nodeName,!B||B.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?z&&zu(z.elementType)&&(Ce=Cd):Ce=f_;if(Ce&&(Ce=Ce(n,z))){xd(V,Ce,a,I);break e}oe&&oe(n,P,z),n==="focusout"&&z&&P.type==="number"&&z.memoizedProps.value!=null&&Uu(P,"number",P.value)}switch(oe=z?ti(z):window,n){case"focusin":(Od(oe)||oe.contentEditable==="true")&&(sa=oe,Xu=z,ci=null);break;case"focusout":ci=Xu=sa=null;break;case"mousedown":Zu=!0;break;case"contextmenu":case"mouseup":case"dragend":Zu=!1,Pd(V,a,I);break;case"selectionchange":if(g_)break;case"keydown":case"keyup":Pd(V,a,I)}var be;if(Yu)e:{switch(n){case"compositionstart":var Ae="onCompositionStart";break e;case"compositionend":Ae="onCompositionEnd";break e;case"compositionupdate":Ae="onCompositionUpdate";break e}Ae=void 0}else ra?Rd(n,a)&&(Ae="onCompositionEnd"):n==="keydown"&&a.keyCode===229&&(Ae="onCompositionStart");Ae&&(Sd&&a.locale!=="ko"&&(ra||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&ra&&(be=yd()):(Ar=I,qu="value"in Ar?Ar.value:Ar.textContent,ra=!0)),oe=wl(z,Ae),0<oe.length&&(Ae=new _d(Ae,n,null,a,I),V.push({event:Ae,listeners:oe}),be?Ae.data=be:(be=Ad(a),be!==null&&(Ae.data=be)))),(be=a_?i_(n,a):o_(n,a))&&(Ae=wl(z,"onBeforeInput"),0<Ae.length&&(oe=new _d("onBeforeInput","beforeinput",null,a,I),V.push({event:oe,listeners:Ae}),oe.data=be)),Z_(V,n,z,a,I)}cm(V,r)})}function Li(n,r,a){return{instance:n,listener:r,currentTarget:a}}function wl(n,r){for(var a=r+"Capture",o=[];n!==null;){var h=n,d=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||d===null||(h=ni(n,a),h!=null&&o.unshift(Li(n,h,d)),h=ni(n,r),h!=null&&o.push(Li(n,h,d))),n.tag===3)return o;n=n.return}return[]}function nw(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function fm(n,r,a,o,h){for(var d=r._reactName,v=[];a!==null&&a!==o;){var w=a,x=w.alternate,z=w.stateNode;if(w=w.tag,x!==null&&x===o)break;w!==5&&w!==26&&w!==27||z===null||(x=z,h?(z=ni(a,d),z!=null&&v.unshift(Li(a,z,x))):h||(z=ni(a,d),z!=null&&v.push(Li(a,z,x)))),a=a.return}v.length!==0&&n.push({event:r,listeners:v})}var rw=/\r\n?/g,sw=/\u0000|\uFFFD/g;function dm(n){return(typeof n=="string"?n:""+n).replace(rw,`
`).replace(sw,"")}function pm(n,r){return r=dm(r),dm(n)===r}function Pe(n,r,a,o,h,d){switch(a){case"children":typeof o=="string"?r==="body"||r==="textarea"&&o===""||ea(n,o):(typeof o=="number"||typeof o=="bigint")&&r!=="body"&&ea(n,""+o);break;case"className":Ro(n,"class",o);break;case"tabIndex":Ro(n,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Ro(n,a,o);break;case"style":pd(n,o,d);break;case"data":if(r!=="object"){Ro(n,"data",o);break}case"src":case"href":if(o===""&&(r!=="a"||a!=="href")){n.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){n.removeAttribute(a);break}o=Oo(""+o),n.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){n.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(a==="formAction"?(r!=="input"&&Pe(n,r,"name",h.name,h,null),Pe(n,r,"formEncType",h.formEncType,h,null),Pe(n,r,"formMethod",h.formMethod,h,null),Pe(n,r,"formTarget",h.formTarget,h,null)):(Pe(n,r,"encType",h.encType,h,null),Pe(n,r,"method",h.method,h,null),Pe(n,r,"target",h.target,h,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){n.removeAttribute(a);break}o=Oo(""+o),n.setAttribute(a,o);break;case"onClick":o!=null&&(n.onclick=Xn);break;case"onScroll":o!=null&&Te("scroll",n);break;case"onScrollEnd":o!=null&&Te("scrollend",n);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(a=o.__html,a!=null){if(h.children!=null)throw Error(i(60));n.innerHTML=a}}break;case"multiple":n.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":n.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){n.removeAttribute("xlink:href");break}a=Oo(""+o),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?n.setAttribute(a,""+o):n.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?n.setAttribute(a,""):n.removeAttribute(a);break;case"capture":case"download":o===!0?n.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?n.setAttribute(a,o):n.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?n.setAttribute(a,o):n.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?n.removeAttribute(a):n.setAttribute(a,o);break;case"popover":Te("beforetoggle",n),Te("toggle",n),To(n,"popover",o);break;case"xlinkActuate":Jn(n,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Jn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Jn(n,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Jn(n,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Jn(n,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Jn(n,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Jn(n,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Jn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Jn(n,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":To(n,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Mb.get(a)||a,To(n,a,o))}}function Eh(n,r,a,o,h,d){switch(a){case"style":pd(n,o,d);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(a=o.__html,a!=null){if(h.children!=null)throw Error(i(60));n.innerHTML=a}}break;case"children":typeof o=="string"?ea(n,o):(typeof o=="number"||typeof o=="bigint")&&ea(n,""+o);break;case"onScroll":o!=null&&Te("scroll",n);break;case"onScrollEnd":o!=null&&Te("scrollend",n);break;case"onClick":o!=null&&(n.onclick=Xn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ad.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(h=a.endsWith("Capture"),r=a.slice(2,h?a.length-7:void 0),d=n[Ht]||null,d=d!=null?d[a]:null,typeof d=="function"&&n.removeEventListener(r,d,h),typeof o=="function")){typeof d!="function"&&d!==null&&(a in n?n[a]=null:n.hasAttribute(a)&&n.removeAttribute(a)),n.addEventListener(r,o,h);break e}a in n?n[a]=o:o===!0?n.setAttribute(a,""):To(n,a,o)}}}function Tt(n,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Te("error",n),Te("load",n);var o=!1,h=!1,d;for(d in a)if(a.hasOwnProperty(d)){var v=a[d];if(v!=null)switch(d){case"src":o=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:Pe(n,r,d,v,a,null)}}h&&Pe(n,r,"srcSet",a.srcSet,a,null),o&&Pe(n,r,"src",a.src,a,null);return;case"input":Te("invalid",n);var w=d=v=h=null,x=null,z=null;for(o in a)if(a.hasOwnProperty(o)){var I=a[o];if(I!=null)switch(o){case"name":h=I;break;case"type":v=I;break;case"checked":x=I;break;case"defaultChecked":z=I;break;case"value":d=I;break;case"defaultValue":w=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(i(137,r));break;default:Pe(n,r,o,I,a,null)}}cd(n,d,w,x,z,v,h,!1);return;case"select":Te("invalid",n),o=v=d=null;for(h in a)if(a.hasOwnProperty(h)&&(w=a[h],w!=null))switch(h){case"value":d=w;break;case"defaultValue":v=w;break;case"multiple":o=w;default:Pe(n,r,h,w,a,null)}r=d,a=v,n.multiple=!!o,r!=null?Ws(n,!!o,r,!1):a!=null&&Ws(n,!!o,a,!0);return;case"textarea":Te("invalid",n),d=h=o=null;for(v in a)if(a.hasOwnProperty(v)&&(w=a[v],w!=null))switch(v){case"value":o=w;break;case"defaultValue":h=w;break;case"children":d=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(i(91));break;default:Pe(n,r,v,w,a,null)}fd(n,o,h,d);return;case"option":for(x in a)a.hasOwnProperty(x)&&(o=a[x],o!=null)&&(x==="selected"?n.selected=o&&typeof o!="function"&&typeof o!="symbol":Pe(n,r,x,o,a,null));return;case"dialog":Te("beforetoggle",n),Te("toggle",n),Te("cancel",n),Te("close",n);break;case"iframe":case"object":Te("load",n);break;case"video":case"audio":for(o=0;o<Di.length;o++)Te(Di[o],n);break;case"image":Te("error",n),Te("load",n);break;case"details":Te("toggle",n);break;case"embed":case"source":case"link":Te("error",n),Te("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(z in a)if(a.hasOwnProperty(z)&&(o=a[z],o!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:Pe(n,r,z,o,a,null)}return;default:if(zu(r)){for(I in a)a.hasOwnProperty(I)&&(o=a[I],o!==void 0&&Eh(n,r,I,o,a,void 0));return}}for(w in a)a.hasOwnProperty(w)&&(o=a[w],o!=null&&Pe(n,r,w,o,a,null))}function aw(n,r,a,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,d=null,v=null,w=null,x=null,z=null,I=null;for(B in a){var V=a[B];if(a.hasOwnProperty(B)&&V!=null)switch(B){case"checked":break;case"value":break;case"defaultValue":x=V;default:o.hasOwnProperty(B)||Pe(n,r,B,null,o,V)}}for(var P in o){var B=o[P];if(V=a[P],o.hasOwnProperty(P)&&(B!=null||V!=null))switch(P){case"type":d=B;break;case"name":h=B;break;case"checked":z=B;break;case"defaultChecked":I=B;break;case"value":v=B;break;case"defaultValue":w=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(i(137,r));break;default:B!==V&&Pe(n,r,P,B,o,V)}}Lu(n,v,w,x,z,I,d,h);return;case"select":B=v=w=P=null;for(d in a)if(x=a[d],a.hasOwnProperty(d)&&x!=null)switch(d){case"value":break;case"multiple":B=x;default:o.hasOwnProperty(d)||Pe(n,r,d,null,o,x)}for(h in o)if(d=o[h],x=a[h],o.hasOwnProperty(h)&&(d!=null||x!=null))switch(h){case"value":P=d;break;case"defaultValue":w=d;break;case"multiple":v=d;default:d!==x&&Pe(n,r,h,d,o,x)}r=w,a=v,o=B,P!=null?Ws(n,!!a,P,!1):!!o!=!!a&&(r!=null?Ws(n,!!a,r,!0):Ws(n,!!a,a?[]:"",!1));return;case"textarea":B=P=null;for(w in a)if(h=a[w],a.hasOwnProperty(w)&&h!=null&&!o.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Pe(n,r,w,null,o,h)}for(v in o)if(h=o[v],d=a[v],o.hasOwnProperty(v)&&(h!=null||d!=null))switch(v){case"value":P=h;break;case"defaultValue":B=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(i(91));break;default:h!==d&&Pe(n,r,v,h,o,d)}hd(n,P,B);return;case"option":for(var re in a)P=a[re],a.hasOwnProperty(re)&&P!=null&&!o.hasOwnProperty(re)&&(re==="selected"?n.selected=!1:Pe(n,r,re,null,o,P));for(x in o)P=o[x],B=a[x],o.hasOwnProperty(x)&&P!==B&&(P!=null||B!=null)&&(x==="selected"?n.selected=P&&typeof P!="function"&&typeof P!="symbol":Pe(n,r,x,P,o,B));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var he in a)P=a[he],a.hasOwnProperty(he)&&P!=null&&!o.hasOwnProperty(he)&&Pe(n,r,he,null,o,P);for(z in o)if(P=o[z],B=a[z],o.hasOwnProperty(z)&&P!==B&&(P!=null||B!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(i(137,r));break;default:Pe(n,r,z,P,o,B)}return;default:if(zu(r)){for(var Be in a)P=a[Be],a.hasOwnProperty(Be)&&P!==void 0&&!o.hasOwnProperty(Be)&&Eh(n,r,Be,void 0,o,P);for(I in o)P=o[I],B=a[I],!o.hasOwnProperty(I)||P===B||P===void 0&&B===void 0||Eh(n,r,I,P,o,B);return}}for(var N in a)P=a[N],a.hasOwnProperty(N)&&P!=null&&!o.hasOwnProperty(N)&&Pe(n,r,N,null,o,P);for(V in o)P=o[V],B=a[V],!o.hasOwnProperty(V)||P===B||P==null&&B==null||Pe(n,r,V,P,o,B)}function gm(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iw(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var h=a[o],d=h.transferSize,v=h.initiatorType,w=h.duration;if(d&&w&&gm(v)){for(v=0,w=h.responseEnd,o+=1;o<a.length;o++){var x=a[o],z=x.startTime;if(z>w)break;var I=x.transferSize,V=x.initiatorType;I&&gm(V)&&(x=x.responseEnd,v+=I*(x<w?1:(w-z)/(x-z)))}if(--o,r+=8*(d+v)/(h.duration/1e3),n++,10<n)break}}if(0<n)return r/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Th=null,Rh=null;function Sl(n){return n.nodeType===9?n:n.ownerDocument}function mm(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ym(n,r){if(n===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&r==="foreignObject"?0:n}function Ah(n,r){return n==="textarea"||n==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Oh=null;function ow(){var n=window.event;return n&&n.type==="popstate"?n===Oh?!1:(Oh=n,!0):(Oh=null,!1)}var vm=typeof setTimeout=="function"?setTimeout:void 0,lw=typeof clearTimeout=="function"?clearTimeout:void 0,bm=typeof Promise=="function"?Promise:void 0,uw=typeof queueMicrotask=="function"?queueMicrotask:typeof bm<"u"?function(n){return bm.resolve(null).then(n).catch(cw)}:vm;function cw(n){setTimeout(function(){throw n})}function $r(n){return n==="head"}function _m(n,r){var a=r,o=0;do{var h=a.nextSibling;if(n.removeChild(a),h&&h.nodeType===8)if(a=h.data,a==="/$"||a==="/&"){if(o===0){n.removeChild(h),ja(r);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")Ui(n.ownerDocument.documentElement);else if(a==="head"){a=n.ownerDocument.head,Ui(a);for(var d=a.firstChild;d;){var v=d.nextSibling,w=d.nodeName;d[ei]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&d.rel.toLowerCase()==="stylesheet"||a.removeChild(d),d=v}}else a==="body"&&Ui(n.ownerDocument.body);a=h}while(a);ja(r)}function wm(n,r){var a=n;n=0;do{var o=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(n===0)break;n--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||n++;a=o}while(a)}function xh(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":xh(a),Nu(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}n.removeChild(a)}}function hw(n,r,a,o){for(;n.nodeType===1;){var h=a;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!o&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(o){if(!n[ei])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(d=n.getAttribute("rel"),d==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(d!==h.rel||n.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||n.getAttribute("title")!==(h.title==null?null:h.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(d=n.getAttribute("src"),(d!==(h.src==null?null:h.src)||n.getAttribute("type")!==(h.type==null?null:h.type)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&d&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var d=h.name==null?null:""+h.name;if(h.type==="hidden"&&n.getAttribute("name")===d)return n}else return n;if(n=vn(n.nextSibling),n===null)break}return null}function fw(n,r,a){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=vn(n.nextSibling),n===null))return null;return n}function Sm(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=vn(n.nextSibling),n===null))return null;return n}function Ch(n){return n.data==="$?"||n.data==="$~"}function kh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function dw(n,r){var a=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||a.readyState!=="loading")r();else{var o=function(){r(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),n._reactRetry=o}}function vn(n){for(;n!=null;n=n.nextSibling){var r=n.nodeType;if(r===1||r===3)break;if(r===8){if(r=n.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return n}var jh=null;function Em(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var a=n.data;if(a==="/$"||a==="/&"){if(r===0)return vn(n.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}n=n.nextSibling}return null}function Tm(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var a=n.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return n;r--}else a!=="/$"&&a!=="/&"||r++}n=n.previousSibling}return null}function Rm(n,r,a){switch(r=Sl(a),n){case"html":if(n=r.documentElement,!n)throw Error(i(452));return n;case"head":if(n=r.head,!n)throw Error(i(453));return n;case"body":if(n=r.body,!n)throw Error(i(454));return n;default:throw Error(i(451))}}function Ui(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);Nu(n)}var bn=new Map,Am=new Set;function El(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var dr=F.d;F.d={f:pw,r:gw,D:mw,C:yw,L:vw,m:bw,X:ww,S:_w,M:Sw};function pw(){var n=dr.f(),r=pl();return n||r}function gw(n){var r=Js(n);r!==null&&r.tag===5&&r.type==="form"?$p(r):dr.r(n)}var xa=typeof document>"u"?null:document;function Om(n,r,a){var o=xa;if(o&&typeof r=="string"&&r){var h=hn(r);h='link[rel="'+n+'"][href="'+h+'"]',typeof a=="string"&&(h+='[crossorigin="'+a+'"]'),Am.has(h)||(Am.add(h),n={rel:n,crossOrigin:a,href:r},o.querySelector(h)===null&&(r=o.createElement("link"),Tt(r,"link",n),pt(r),o.head.appendChild(r)))}}function mw(n){dr.D(n),Om("dns-prefetch",n,null)}function yw(n,r){dr.C(n,r),Om("preconnect",n,r)}function vw(n,r,a){dr.L(n,r,a);var o=xa;if(o&&n&&r){var h='link[rel="preload"][as="'+hn(r)+'"]';r==="image"&&a&&a.imageSrcSet?(h+='[imagesrcset="'+hn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(h+='[imagesizes="'+hn(a.imageSizes)+'"]')):h+='[href="'+hn(n)+'"]';var d=h;switch(r){case"style":d=Ca(n);break;case"script":d=ka(n)}bn.has(d)||(n=m({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:n,as:r},a),bn.set(d,n),o.querySelector(h)!==null||r==="style"&&o.querySelector(zi(d))||r==="script"&&o.querySelector(Pi(d))||(r=o.createElement("link"),Tt(r,"link",n),pt(r),o.head.appendChild(r)))}}function bw(n,r){dr.m(n,r);var a=xa;if(a&&n){var o=r&&typeof r.as=="string"?r.as:"script",h='link[rel="modulepreload"][as="'+hn(o)+'"][href="'+hn(n)+'"]',d=h;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=ka(n)}if(!bn.has(d)&&(n=m({rel:"modulepreload",href:n},r),bn.set(d,n),a.querySelector(h)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Pi(d)))return}o=a.createElement("link"),Tt(o,"link",n),pt(o),a.head.appendChild(o)}}}function _w(n,r,a){dr.S(n,r,a);var o=xa;if(o&&n){var h=Xs(o).hoistableStyles,d=Ca(n);r=r||"default";var v=h.get(d);if(!v){var w={loading:0,preload:null};if(v=o.querySelector(zi(d)))w.loading=5;else{n=m({rel:"stylesheet",href:n,"data-precedence":r},a),(a=bn.get(d))&&Mh(n,a);var x=v=o.createElement("link");pt(x),Tt(x,"link",n),x._p=new Promise(function(z,I){x.onload=z,x.onerror=I}),x.addEventListener("load",function(){w.loading|=1}),x.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Tl(v,r,o)}v={type:"stylesheet",instance:v,count:1,state:w},h.set(d,v)}}}function ww(n,r){dr.X(n,r);var a=xa;if(a&&n){var o=Xs(a).hoistableScripts,h=ka(n),d=o.get(h);d||(d=a.querySelector(Pi(h)),d||(n=m({src:n,async:!0},r),(r=bn.get(h))&&Nh(n,r),d=a.createElement("script"),pt(d),Tt(d,"link",n),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(h,d))}}function Sw(n,r){dr.M(n,r);var a=xa;if(a&&n){var o=Xs(a).hoistableScripts,h=ka(n),d=o.get(h);d||(d=a.querySelector(Pi(h)),d||(n=m({src:n,async:!0,type:"module"},r),(r=bn.get(h))&&Nh(n,r),d=a.createElement("script"),pt(d),Tt(d,"link",n),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(h,d))}}function xm(n,r,a,o){var h=(h=ce.current)?El(h):null;if(!h)throw Error(i(446));switch(n){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=Ca(a.href),a=Xs(h).hoistableStyles,o=a.get(r),o||(o={type:"style",instance:null,count:0,state:null},a.set(r,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){n=Ca(a.href);var d=Xs(h).hoistableStyles,v=d.get(n);if(v||(h=h.ownerDocument||h,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(n,v),(d=h.querySelector(zi(n)))&&!d._p&&(v.instance=d,v.state.loading=5),bn.has(n)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},bn.set(n,a),d||Ew(h,n,a,v.state))),r&&o===null)throw Error(i(528,""));return v}if(r&&o!==null)throw Error(i(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=ka(a),a=Xs(h).hoistableScripts,o=a.get(r),o||(o={type:"script",instance:null,count:0,state:null},a.set(r,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,n))}}function Ca(n){return'href="'+hn(n)+'"'}function zi(n){return'link[rel="stylesheet"]['+n+"]"}function Cm(n){return m({},n,{"data-precedence":n.precedence,precedence:null})}function Ew(n,r,a,o){n.querySelector('link[rel="preload"][as="style"]['+r+"]")?o.loading=1:(r=n.createElement("link"),o.preload=r,r.addEventListener("load",function(){return o.loading|=1}),r.addEventListener("error",function(){return o.loading|=2}),Tt(r,"link",a),pt(r),n.head.appendChild(r))}function ka(n){return'[src="'+hn(n)+'"]'}function Pi(n){return"script[async]"+n}function km(n,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var o=n.querySelector('style[data-href~="'+hn(a.href)+'"]');if(o)return r.instance=o,pt(o),o;var h=m({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(n.ownerDocument||n).createElement("style"),pt(o),Tt(o,"style",h),Tl(o,a.precedence,n),r.instance=o;case"stylesheet":h=Ca(a.href);var d=n.querySelector(zi(h));if(d)return r.state.loading|=4,r.instance=d,pt(d),d;o=Cm(a),(h=bn.get(h))&&Mh(o,h),d=(n.ownerDocument||n).createElement("link"),pt(d);var v=d;return v._p=new Promise(function(w,x){v.onload=w,v.onerror=x}),Tt(d,"link",o),r.state.loading|=4,Tl(d,a.precedence,n),r.instance=d;case"script":return d=ka(a.src),(h=n.querySelector(Pi(d)))?(r.instance=h,pt(h),h):(o=a,(h=bn.get(d))&&(o=m({},a),Nh(o,h)),n=n.ownerDocument||n,h=n.createElement("script"),pt(h),Tt(h,"link",o),n.head.appendChild(h),r.instance=h);case"void":return null;default:throw Error(i(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(o=r.instance,r.state.loading|=4,Tl(o,a.precedence,n));return r.instance}function Tl(n,r,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=o.length?o[o.length-1]:null,d=h,v=0;v<o.length;v++){var w=o[v];if(w.dataset.precedence===r)d=w;else if(d!==h)break}d?d.parentNode.insertBefore(n,d.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(n,r.firstChild))}function Mh(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function Nh(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var Rl=null;function jm(n,r,a){if(Rl===null){var o=new Map,h=Rl=new Map;h.set(a,o)}else h=Rl,o=h.get(a),o||(o=new Map,h.set(a,o));if(o.has(n))return o;for(o.set(n,null),a=a.getElementsByTagName(n),h=0;h<a.length;h++){var d=a[h];if(!(d[ei]||d[_t]||n==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var v=d.getAttribute(r)||"";v=n+v;var w=o.get(v);w?w.push(d):o.set(v,[d])}}return o}function Mm(n,r,a){n=n.ownerDocument||n,n.head.insertBefore(a,r==="title"?n.querySelector("head > title"):null)}function Tw(n,r,a){if(a===1||r.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(n=r.disabled,typeof r.precedence=="string"&&n==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Nm(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function Rw(n,r,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var h=Ca(o.href),d=r.querySelector(zi(h));if(d){r=d._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=Al.bind(n),r.then(n,n)),a.state.loading|=4,a.instance=d,pt(d);return}d=r.ownerDocument||r,o=Cm(o),(h=bn.get(h))&&Mh(o,h),d=d.createElement("link"),pt(d);var v=d;v._p=new Promise(function(w,x){v.onload=w,v.onerror=x}),Tt(d,"link",o),a.instance=d}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(n.count++,a=Al.bind(n),r.addEventListener("load",a),r.addEventListener("error",a))}}var Dh=0;function Aw(n,r){return n.stylesheets&&n.count===0&&xl(n,n.stylesheets),0<n.count||0<n.imgCount?function(a){var o=setTimeout(function(){if(n.stylesheets&&xl(n,n.stylesheets),n.unsuspend){var d=n.unsuspend;n.unsuspend=null,d()}},6e4+r);0<n.imgBytes&&Dh===0&&(Dh=62500*iw());var h=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&xl(n,n.stylesheets),n.unsuspend)){var d=n.unsuspend;n.unsuspend=null,d()}},(n.imgBytes>Dh?50:800)+r);return n.unsuspend=a,function(){n.unsuspend=null,clearTimeout(o),clearTimeout(h)}}:null}function Al(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xl(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Ol=null;function xl(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Ol=new Map,r.forEach(Ow,n),Ol=null,Al.call(n))}function Ow(n,r){if(!(r.state.loading&4)){var a=Ol.get(n);if(a)var o=a.get(null);else{a=new Map,Ol.set(n,a);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<h.length;d++){var v=h[d];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(a.set(v.dataset.precedence,v),o=v)}o&&a.set(null,o)}h=r.instance,v=h.getAttribute("data-precedence"),d=a.get(v)||o,d===o&&a.set(null,h),a.set(v,h),this.count++,o=Al.bind(this),h.addEventListener("load",o),h.addEventListener("error",o),d?d.parentNode.insertBefore(h,d.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(h,n.firstChild)),r.state.loading|=4}}var Bi={$$typeof:j,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function xw(n,r,a,o,h,d,v,w,x){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Tr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tr(0),this.hiddenUpdates=Tr(null),this.identifierPrefix=o,this.onUncaughtError=h,this.onCaughtError=d,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=x,this.incompleteTransitions=new Map}function Dm(n,r,a,o,h,d,v,w,x,z,I,V){return n=new xw(n,r,a,v,x,z,I,V,w),r=1,d===!0&&(r|=24),d=en(3,null,null,r),n.current=d,d.stateNode=n,r=dc(),r.refCount++,n.pooledCache=r,r.refCount++,d.memoizedState={element:o,isDehydrated:a,cache:r},yc(d),n}function Lm(n){return n?(n=oa,n):oa}function Um(n,r,a,o,h,d){h=Lm(h),o.context===null?o.context=h:o.pendingContext=h,o=Mr(r),o.payload={element:a},d=d===void 0?null:d,d!==null&&(o.callback=d),a=Nr(n,o,r),a!==null&&(Kt(a,n,r),yi(a,n,r))}function zm(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var a=n.retryLane;n.retryLane=a!==0&&a<r?a:r}}function Lh(n,r){zm(n,r),(n=n.alternate)&&zm(n,r)}function Pm(n){if(n.tag===13||n.tag===31){var r=vs(n,67108864);r!==null&&Kt(r,n,67108864),Lh(n,67108864)}}function Bm(n){if(n.tag===13||n.tag===31){var r=an();r=Ys(r);var a=vs(n,r);a!==null&&Kt(a,n,r),Lh(n,r)}}var Cl=!0;function Cw(n,r,a,o){var h=U.T;U.T=null;var d=F.p;try{F.p=2,Uh(n,r,a,o)}finally{F.p=d,U.T=h}}function kw(n,r,a,o){var h=U.T;U.T=null;var d=F.p;try{F.p=8,Uh(n,r,a,o)}finally{F.p=d,U.T=h}}function Uh(n,r,a,o){if(Cl){var h=zh(o);if(h===null)Sh(n,r,o,kl,a),Im(n,o);else if(Mw(h,n,r,a,o))o.stopPropagation();else if(Im(n,o),r&4&&-1<jw.indexOf(n)){for(;h!==null;){var d=Js(h);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var v=Un(d.pendingLanes);if(v!==0){var w=d;for(w.pendingLanes|=2,w.entangledLanes|=2;v;){var x=1<<31-Ot(v);w.entanglements[1]|=x,v&=~x}Hn(d),(Ne&6)===0&&(fl=ft()+500,Ni(0))}}break;case 31:case 13:w=vs(d,2),w!==null&&Kt(w,d,2),pl(),Lh(d,2)}if(d=zh(o),d===null&&Sh(n,r,o,kl,a),d===h)break;h=d}h!==null&&o.stopPropagation()}else Sh(n,r,o,null,a)}}function zh(n){return n=Bu(n),Ph(n)}var kl=null;function Ph(n){if(kl=null,n=Qs(n),n!==null){var r=u(n);if(r===null)n=null;else{var a=r.tag;if(a===13){if(n=c(r),n!==null)return n;n=null}else if(a===31){if(n=f(r),n!==null)return n;n=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return kl=n,null}function Hm(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ue()){case Je:return 2;case un:return 8;case Fn:case Za:return 32;case Qn:return 268435456;default:return 32}default:return 32}}var Bh=!1,Vr=null,Gr=null,Kr=null,Hi=new Map,Ii=new Map,Yr=[],jw="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Im(n,r){switch(n){case"focusin":case"focusout":Vr=null;break;case"dragenter":case"dragleave":Gr=null;break;case"mouseover":case"mouseout":Kr=null;break;case"pointerover":case"pointerout":Hi.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ii.delete(r.pointerId)}}function qi(n,r,a,o,h,d){return n===null||n.nativeEvent!==d?(n={blockedOn:r,domEventName:a,eventSystemFlags:o,nativeEvent:d,targetContainers:[h]},r!==null&&(r=Js(r),r!==null&&Pm(r)),n):(n.eventSystemFlags|=o,r=n.targetContainers,h!==null&&r.indexOf(h)===-1&&r.push(h),n)}function Mw(n,r,a,o,h){switch(r){case"focusin":return Vr=qi(Vr,n,r,a,o,h),!0;case"dragenter":return Gr=qi(Gr,n,r,a,o,h),!0;case"mouseover":return Kr=qi(Kr,n,r,a,o,h),!0;case"pointerover":var d=h.pointerId;return Hi.set(d,qi(Hi.get(d)||null,n,r,a,o,h)),!0;case"gotpointercapture":return d=h.pointerId,Ii.set(d,qi(Ii.get(d)||null,n,r,a,o,h)),!0}return!1}function qm(n){var r=Qs(n.target);if(r!==null){var a=u(r);if(a!==null){if(r=a.tag,r===13){if(r=c(a),r!==null){n.blockedOn=r,nd(n.priority,function(){Bm(a)});return}}else if(r===31){if(r=f(a),r!==null){n.blockedOn=r,nd(n.priority,function(){Bm(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){n.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}n.blockedOn=null}function jl(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var a=zh(n.nativeEvent);if(a===null){a=n.nativeEvent;var o=new a.constructor(a.type,a);Pu=o,a.target.dispatchEvent(o),Pu=null}else return r=Js(a),r!==null&&Pm(r),n.blockedOn=a,!1;r.shift()}return!0}function $m(n,r,a){jl(n)&&a.delete(r)}function Nw(){Bh=!1,Vr!==null&&jl(Vr)&&(Vr=null),Gr!==null&&jl(Gr)&&(Gr=null),Kr!==null&&jl(Kr)&&(Kr=null),Hi.forEach($m),Ii.forEach($m)}function Ml(n,r){n.blockedOn===r&&(n.blockedOn=null,Bh||(Bh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Nw)))}var Nl=null;function Vm(n){Nl!==n&&(Nl=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Nl===n&&(Nl=null);for(var r=0;r<n.length;r+=3){var a=n[r],o=n[r+1],h=n[r+2];if(typeof o!="function"){if(Ph(o||a)===null)continue;break}var d=Js(a);d!==null&&(n.splice(r,3),r-=3,zc(d,{pending:!0,data:h,method:a.method,action:o},o,h))}}))}function ja(n){function r(x){return Ml(x,n)}Vr!==null&&Ml(Vr,n),Gr!==null&&Ml(Gr,n),Kr!==null&&Ml(Kr,n),Hi.forEach(r),Ii.forEach(r);for(var a=0;a<Yr.length;a++){var o=Yr[a];o.blockedOn===n&&(o.blockedOn=null)}for(;0<Yr.length&&(a=Yr[0],a.blockedOn===null);)qm(a),a.blockedOn===null&&Yr.shift();if(a=(n.ownerDocument||n).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var h=a[o],d=a[o+1],v=h[Ht]||null;if(typeof d=="function")v||Vm(a);else if(v){var w=null;if(d&&d.hasAttribute("formAction")){if(h=d,v=d[Ht]||null)w=v.formAction;else if(Ph(h)!==null)continue}else w=v.action;typeof w=="function"?a[o+1]=w:(a.splice(o,3),o-=3),Vm(a)}}}function Gm(){function n(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(v){return h=v})},focusReset:"manual",scroll:"manual"})}function r(){h!==null&&(h(),h=null),o||setTimeout(a,20)}function a(){if(!o&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,h=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){o=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),h!==null&&(h(),h=null)}}}function Hh(n){this._internalRoot=n}Dl.prototype.render=Hh.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(i(409));var a=r.current,o=an();Um(a,o,n,r,null,null)},Dl.prototype.unmount=Hh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;Um(n.current,2,null,n,null,null),pl(),r[Fs]=null}};function Dl(n){this._internalRoot=n}Dl.prototype.unstable_scheduleHydration=function(n){if(n){var r=ju();n={blockedOn:null,target:n,priority:r};for(var a=0;a<Yr.length&&r!==0&&r<Yr[a].priority;a++);Yr.splice(a,0,n),a===0&&qm(n)}};var Km=t.version;if(Km!=="19.2.5")throw Error(i(527,Km,"19.2.5"));F.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(i(188)):(n=Object.keys(n).join(","),Error(i(268,n)));return n=g(r),n=n!==null?y(n):null,n=n===null?null:n.stateNode,n};var Dw={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ll=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ll.isDisabled&&Ll.supportsFiber)try{hs=Ll.inject(Dw),jt=Ll}catch{}}return Vi.createRoot=function(n,r){if(!l(n))throw Error(i(299));var a=!1,o="",h=Wp,d=eg,v=tg;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(d=r.onCaughtError),r.onRecoverableError!==void 0&&(v=r.onRecoverableError)),r=Dm(n,1,!1,null,null,a,o,null,h,d,v,Gm),n[Fs]=r.current,wh(n),new Hh(r)},Vi.hydrateRoot=function(n,r,a){if(!l(n))throw Error(i(299));var o=!1,h="",d=Wp,v=eg,w=tg,x=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(v=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError),a.formState!==void 0&&(x=a.formState)),r=Dm(n,1,!0,r,a??null,o,h,x,d,v,w,Gm),r.context=Lm(null),a=r.current,o=an(),o=Ys(o),h=Mr(o),h.callback=null,Nr(a,h,o),a=o,r.current.lanes=a,Qe(r,a),Hn(r),n[Fs]=r.current,wh(n),new Dl(r)},Vi.version="19.2.5",Vi}var ny;function $w(){if(ny)return $h.exports;ny=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),$h.exports=qw(),$h.exports}var Vw=$w(),Gw="__TSS_CONTEXT",gf=Symbol.for("TSS_SERVER_FUNCTION"),Kw="application/x-tss-framed",pr={JSON:0,CHUNK:1,END:2,ERROR:3},Yw=/;\s*v=(\d+)/;function Fw(e){const t=e.match(Yw);return t?parseInt(t[1],10):void 0}function Qw(e){const t=Fw(e);if(t!==void 0&&t!==1)throw new Error(`Incompatible framed protocol version: server=${t}, client=1. Please ensure client and server are using compatible versions.`)}var Uv=()=>window.__TSS_START_OPTIONS__,zv=!1;function so(e){return e[e.length-1]}function Jw(e){return typeof e=="function"}function Wr(e,t){return Jw(e)?e(t):e}var Xw=Object.prototype.hasOwnProperty,ry=Object.prototype.propertyIsEnumerable,Zw=()=>Object.create(null),js=(e,t)=>Ls(e,t,Zw);function Ls(e,t,s=()=>({}),i=0){if(e===t)return e;if(i>500)return t;const l=t,u=iy(e)&&iy(l);if(!u&&!(Ja(e)&&Ja(l)))return l;const c=u?e:sy(e);if(!c)return l;const f=u?l:sy(l);if(!f)return l;const p=c.length,g=f.length,y=u?new Array(g):s();let m=0;for(let b=0;b<g;b++){const _=u?b:f[b],S=e[_],O=l[_];if(S===O){y[_]=S,(u?b<p:Xw.call(e,_))&&m++;continue}if(S===null||O===null||typeof S!="object"||typeof O!="object"){y[_]=O;continue}const E=Ls(S,O,s,i+1);y[_]=E,E===S&&m++}return p===g&&m===p?e:y}function sy(e){const t=Object.getOwnPropertyNames(e);for(const l of t)if(!ry.call(e,l))return!1;const s=Object.getOwnPropertySymbols(e);if(s.length===0)return t;const i=t;for(const l of s){if(!ry.call(e,l))return!1;i.push(l)}return i}function Ja(e){if(!ay(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!ay(s)||!s.hasOwnProperty("isPrototypeOf"))}function ay(e){return Object.prototype.toString.call(e)==="[object Object]"}function iy(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qt(e,t,s){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,l=e.length;i<l;i++)if(!Qt(e[i],t[i],s))return!1;return!0}if(Ja(e)&&Ja(t)){const i=s?.ignoreUndefined??!0;if(s?.partial){for(const c in t)if((!i||t[c]!==void 0)&&!Qt(e[c],t[c],s))return!1;return!0}let l=0;if(!i)l=Object.keys(e).length;else for(const c in e)e[c]!==void 0&&l++;let u=0;for(const c in t)if((!i||t[c]!==void 0)&&(u++,u>l||!Qt(e[c],t[c],s)))return!1;return l===u}return!1}function qs(e){let t,s;const i=new Promise((l,u)=>{t=l,s=u});return i.status="pending",i.resolve=l=>{i.status="resolved",i.value=l,t(l),e?.(l)},i.reject=l=>{i.status="rejected",s(l)},i}function Ww(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function ao(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function eS(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function oy(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return eS(t)}var tS=["http:","https:","mailto:","tel:"];function ru(e,t){if(!e)return!1;try{const s=new URL(e);return!t.has(s.protocol)}catch{return!1}}var nS={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},rS=/[&><\u2028\u2029]/g;function sS(e){return e.replace(rS,t=>nS[t])}function Gi(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let s=0,i="",l;for(;(l=t.exec(e))!==null;)i+=oy(e.slice(s,l.index))+l[0],s=t.lastIndex;i=i+oy(s?e.slice(s):e);let u=!1;return i.startsWith("//")&&(u=!0,i="/"+i.replace(/^\/+/,"")),{path:i,handledProtocolRelativeURL:u}}function aS(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function iS(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}function Xt(){throw new Error("Invariant failed")}function io(e){const t=new Map;let s,i;const l=u=>{u.next&&(u.prev?(u.prev.next=u.next,u.next.prev=u.prev,u.next=void 0,i&&(i.next=u,u.prev=i)):(u.next.prev=void 0,s=u.next,u.next=void 0,i&&(u.prev=i,i.next=u)),i=u)};return{get(u){const c=t.get(u);if(c)return l(c),c.value},set(u,c){if(t.size>=e&&s){const p=s;t.delete(p.key),p.next&&(s=p.next,p.next.prev=void 0),p===i&&(i=void 0)}const f=t.get(u);if(f)f.value=c,l(f);else{const p={key:u,value:c,prev:i};i&&(i.next=p),i=p,s||(s=p),t.set(u,p)}},clear(){t.clear(),s=void 0,i=void 0}}}var es=4,Pv=5;function oS(e){const t=e.indexOf("{");if(t===-1)return null;const s=e.indexOf("}",t);return s===-1||t+1>=e.length?null:[t,s]}function If(e,t,s=new Uint16Array(6)){const i=e.indexOf("/",t),l=i===-1?e.length:i,u=e.substring(t,l);if(!u||!u.includes("$"))return s[0]=0,s[1]=t,s[2]=t,s[3]=l,s[4]=l,s[5]=l,s;if(u==="$"){const f=e.length;return s[0]=2,s[1]=t,s[2]=t,s[3]=f,s[4]=f,s[5]=f,s}if(u.charCodeAt(0)===36)return s[0]=1,s[1]=t,s[2]=t+1,s[3]=l,s[4]=l,s[5]=l,s;const c=oS(u);if(c){const[f,p]=c,g=u.charCodeAt(f+1);if(g===45){if(f+2<u.length&&u.charCodeAt(f+2)===36){const y=f+3,m=p;if(y<m)return s[0]=3,s[1]=t+f,s[2]=t+y,s[3]=t+m,s[4]=t+p+1,s[5]=l,s}}else if(g===36){const y=f+1,m=f+2;return m===p?(s[0]=2,s[1]=t+f,s[2]=t+y,s[3]=t+m,s[4]=t+p+1,s[5]=e.length,s):(s[0]=1,s[1]=t+f,s[2]=t+m,s[3]=t+p,s[4]=t+p+1,s[5]=l,s)}}return s[0]=0,s[1]=t,s[2]=t,s[3]=l,s[4]=l,s[5]=l,s}function yu(e,t,s,i,l,u,c){c?.(s);let f=i;{const p=s.fullPath??s.from,g=p.length,y=s.options?.caseSensitive??e,m=!!(s.options?.params?.parse&&s.options?.skipRouteOnParseError?.params);for(;f<g;){const _=If(p,f,t);let S;const O=f,E=_[5];switch(f=E+1,u++,_[0]){case 0:{const A=p.substring(_[2],_[3]);if(y){const M=l.static?.get(A);if(M)S=M;else{l.static??=new Map;const j=Us(s.fullPath??s.from);j.parent=l,j.depth=u,S=j,l.static.set(A,j)}}else{const M=A.toLowerCase(),j=l.staticInsensitive?.get(M);if(j)S=j;else{l.staticInsensitive??=new Map;const D=Us(s.fullPath??s.from);D.parent=l,D.depth=u,S=D,l.staticInsensitive.set(M,D)}}break}case 1:{const A=p.substring(O,_[1]),M=p.substring(_[4],E),j=y&&!!(A||M),D=A?j?A:A.toLowerCase():void 0,X=M?j?M:M.toLowerCase():void 0,K=!m&&l.dynamic?.find(H=>!H.skipOnParamError&&H.caseSensitive===j&&H.prefix===D&&H.suffix===X);if(K)S=K;else{const H=Fh(1,s.fullPath??s.from,j,D,X);S=H,H.depth=u,H.parent=l,l.dynamic??=[],l.dynamic.push(H)}break}case 3:{const A=p.substring(O,_[1]),M=p.substring(_[4],E),j=y&&!!(A||M),D=A?j?A:A.toLowerCase():void 0,X=M?j?M:M.toLowerCase():void 0,K=!m&&l.optional?.find(H=>!H.skipOnParamError&&H.caseSensitive===j&&H.prefix===D&&H.suffix===X);if(K)S=K;else{const H=Fh(3,s.fullPath??s.from,j,D,X);S=H,H.parent=l,H.depth=u,l.optional??=[],l.optional.push(H)}break}case 2:{const A=p.substring(O,_[1]),M=p.substring(_[4],E),j=y&&!!(A||M),D=A?j?A:A.toLowerCase():void 0,X=M?j?M:M.toLowerCase():void 0,K=Fh(2,s.fullPath??s.from,j,D,X);S=K,K.parent=l,K.depth=u,l.wildcard??=[],l.wildcard.push(K)}}l=S}if(m&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const _=Us(s.fullPath??s.from);_.kind=Pv,_.parent=l,u++,_.depth=u,l.pathless??=[],l.pathless.push(_),l=_}const b=(s.path||!s.children)&&!s.isRoot;if(b&&p.endsWith("/")){const _=Us(s.fullPath??s.from);_.kind=es,_.parent=l,u++,_.depth=u,l.index=_,l=_}l.parse=s.options?.params?.parse??null,l.skipOnParamError=m,l.parsingPriority=s.options?.skipRouteOnParseError?.priority??0,b&&!l.route&&(l.route=s,l.fullPath=s.fullPath??s.from)}if(s.children)for(const p of s.children)yu(e,t,p,f,l,u,c)}function Yh(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Qr(e){if(e.pathless)for(const t of e.pathless)Qr(t);if(e.static)for(const t of e.static.values())Qr(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Qr(t);if(e.dynamic?.length){e.dynamic.sort(Yh);for(const t of e.dynamic)Qr(t)}if(e.optional?.length){e.optional.sort(Yh);for(const t of e.optional)Qr(t)}if(e.wildcard?.length){e.wildcard.sort(Yh);for(const t of e.wildcard)Qr(t)}}function Us(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Fh(e,t,s,i,l){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:s,prefix:i,suffix:l}}function lS(e,t){const s=Us("/"),i=new Uint16Array(6);for(const l of e)yu(!1,i,l,1,s,0);Qr(s),t.masksTree=s,t.flatCache=io(1e3)}function uS(e,t){e||="/";const s=t.flatCache.get(e);if(s)return s;const i=qf(e,t.masksTree);return t.flatCache.set(e,i),i}function cS(e,t,s,i,l){e||="/",i||="/";const u=t?`case\0${e}`:e;let c=l.singleCache.get(u);return c||(c=Us("/"),yu(t,new Uint16Array(6),{from:e},1,c,0),l.singleCache.set(u,c)),qf(i,c,s)}function hS(e,t,s=!1){const i=s?e:`nofuzz\0${e}`,l=t.matchCache.get(i);if(l!==void 0)return l;e||="/";let u;try{u=qf(e,t.segmentTree,s)}catch(c){if(c instanceof URIError)u=null;else throw c}return u&&(u.branch=pS(u.route)),t.matchCache.set(i,u),u}function fS(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function dS(e,t=!1,s){const i=Us(e.fullPath),l=new Uint16Array(6),u={},c={};let f=0;return yu(t,l,e,1,i,0,p=>{if(s?.(p,f),p.id in u&&Xt(),u[p.id]=p,f!==0&&p.path){const g=fS(p.fullPath);(!c[g]||p.fullPath.endsWith("/"))&&(c[g]=p)}f++}),Qr(i),{processedTree:{segmentTree:i,singleCache:io(1e3),matchCache:io(1e3),flatCache:null,masksTree:null},routesById:u,routesByPath:c}}function qf(e,t,s=!1){const i=e.split("/"),l=mS(e,i,t,s);if(!l)return null;const[u]=Bv(e,i,l);return{route:l.node.route,rawParams:u,parsedParams:l.parsedParams}}function Bv(e,t,s){const i=gS(s.node);let l=null;const u=Object.create(null);let c=s.extract?.part??0,f=s.extract?.node??0,p=s.extract?.path??0,g=s.extract?.segment??0;for(;f<i.length;c++,f++,p++,g++){const y=i[f];if(y.kind===es)break;if(y.kind===Pv){g--,c--,p--;continue}const m=t[c],b=p;if(m&&(p+=m.length),y.kind===1){l??=s.node.fullPath.split("/");const _=l[g],S=y.prefix?.length??0;if(_.charCodeAt(S)===123){const O=y.suffix?.length??0,E=_.substring(S+2,_.length-O-1),A=m.substring(S,m.length-O);u[E]=decodeURIComponent(A)}else{const O=_.substring(1);u[O]=decodeURIComponent(m)}}else if(y.kind===3){if(s.skipped&1<<f){c--,p=b-1;continue}l??=s.node.fullPath.split("/");const _=l[g],S=y.prefix?.length??0,O=y.suffix?.length??0,E=_.substring(S+3,_.length-O-1),A=y.suffix||y.prefix?m.substring(S,m.length-O):m;A&&(u[E]=decodeURIComponent(A))}else if(y.kind===2){const _=y,S=e.substring(b+(_.prefix?.length??0),e.length-(_.suffix?.length??0)),O=decodeURIComponent(S);u["*"]=O,u._splat=O;break}}return s.rawParams&&Object.assign(u,s.rawParams),[u,{part:c,node:f,path:p,segment:g}]}function pS(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function gS(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function mS(e,t,s,i){if(e==="/"&&s.index)return{node:s.index,skipped:0};const l=!so(t),u=l&&e!=="/",c=t.length-(l?1:0),f=[{node:s,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let p=null,g=null;for(;f.length;){const y=f.pop(),{node:m,index:b,skipped:_,depth:S,statics:O,dynamics:E,optionals:A}=y;let{extract:M,rawParams:j,parsedParams:D}=y;if(m.kind===2&&m.route&&!zl(g,y))continue;if(m.skipOnParamError){if(!ly(e,t,y))continue;j=y.rawParams,M=y.extract,D=y.parsedParams}i&&m.route&&m.kind!==es&&zl(p,y)&&(p=y);const X=b===c;if(X&&(m.route&&(!u||m.kind===es||m.kind===2)&&zl(g,y)&&(g=y),!m.optional&&!m.wildcard&&!m.index&&!m.pathless))continue;const K=X?void 0:t[b];let H;if(X&&m.index){const Y={node:m.index,index:b,skipped:_,depth:S+1,statics:O,dynamics:E,optionals:A,extract:M,rawParams:j,parsedParams:D};let Z=!0;if(m.index.skipOnParamError&&(ly(e,t,Y)||(Z=!1)),Z){if(!E&&!A&&!_&&yS(O,c))return Y;zl(g,Y)&&(g=Y)}}if(m.wildcard)for(let Y=m.wildcard.length-1;Y>=0;Y--){const Z=m.wildcard[Y],{prefix:le,suffix:ie}=Z;if(!(le&&(X||!(Z.caseSensitive?K:H??=K.toLowerCase()).startsWith(le)))){if(ie){if(X)continue;const me=t.slice(b).join("/").slice(-ie.length);if((Z.caseSensitive?me:me.toLowerCase())!==ie)continue}f.push({node:Z,index:c,skipped:_,depth:S+1,statics:O,dynamics:E,optionals:A,extract:M,rawParams:j,parsedParams:D})}}if(m.optional){const Y=_|1<<S,Z=S+1;for(let le=m.optional.length-1;le>=0;le--){const ie=m.optional[le];f.push({node:ie,index:b,skipped:Y,depth:Z,statics:O,dynamics:E,optionals:A,extract:M,rawParams:j,parsedParams:D})}if(!X)for(let le=m.optional.length-1;le>=0;le--){const ie=m.optional[le],{prefix:me,suffix:_e}=ie;if(me||_e){const qe=ie.caseSensitive?K:H??=K.toLowerCase();if(me&&!qe.startsWith(me)||_e&&!qe.endsWith(_e))continue}f.push({node:ie,index:b+1,skipped:_,depth:Z,statics:O,dynamics:E,optionals:A+Ul(c,b),extract:M,rawParams:j,parsedParams:D})}}if(!X&&m.dynamic&&K)for(let Y=m.dynamic.length-1;Y>=0;Y--){const Z=m.dynamic[Y],{prefix:le,suffix:ie}=Z;if(le||ie){const me=Z.caseSensitive?K:H??=K.toLowerCase();if(le&&!me.startsWith(le)||ie&&!me.endsWith(ie))continue}f.push({node:Z,index:b+1,skipped:_,depth:S+1,statics:O,dynamics:E+Ul(c,b),optionals:A,extract:M,rawParams:j,parsedParams:D})}if(!X&&m.staticInsensitive){const Y=m.staticInsensitive.get(H??=K.toLowerCase());Y&&f.push({node:Y,index:b+1,skipped:_,depth:S+1,statics:O+Ul(c,b),dynamics:E,optionals:A,extract:M,rawParams:j,parsedParams:D})}if(!X&&m.static){const Y=m.static.get(K);Y&&f.push({node:Y,index:b+1,skipped:_,depth:S+1,statics:O+Ul(c,b),dynamics:E,optionals:A,extract:M,rawParams:j,parsedParams:D})}if(m.pathless){const Y=S+1;for(let Z=m.pathless.length-1;Z>=0;Z--){const le=m.pathless[Z];f.push({node:le,index:b,skipped:_,depth:Y,statics:O,dynamics:E,optionals:A,extract:M,rawParams:j,parsedParams:D})}}}if(g)return g;if(i&&p){let y=p.index;for(let b=0;b<p.index;b++)y+=t[b].length;const m=y===e.length?"/":e.slice(y);return p.rawParams??=Object.create(null),p.rawParams["**"]=decodeURIComponent(m),p}return null}function Ul(e,t){return 2**(e-t-1)}function yS(e,t){return e===2**(t-1)-1}function ly(e,t,s){try{const[i,l]=Bv(e,t,s);s.rawParams=i,s.extract=l;const u=s.node.parse(i);return s.parsedParams=Object.assign(Object.create(null),s.parsedParams,u),!0}catch{return null}}function zl(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===es)>(e.node.kind===es)||t.node.kind===es==(e.node.kind===es)&&t.depth>e.depth))):!0}function Xl(e){return $f(e.filter(t=>t!==void 0).join("/"))}function $f(e){return e.replace(/\/{2,}/g,"/")}function Hv(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function ns(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Iv(e){return ns(Hv(e))}function su(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function vS(e,t,s){return su(e,s)===su(t,s)}function bS({base:e,to:t,trailingSlash:s="never",cache:i}){const l=t.startsWith("/"),u=!l&&t===".";let c;if(i){c=l?t:u?e:e+"\0"+t;const m=i.get(c);if(m)return m}let f;if(u)f=e.split("/");else if(l)f=t.split("/");else{for(f=e.split("/");f.length>1&&so(f)==="";)f.pop();const m=t.split("/");for(let b=0,_=m.length;b<_;b++){const S=m[b];S===""?b?b===_-1&&f.push(S):f=[S]:S===".."?f.pop():S==="."||f.push(S)}}f.length>1&&(so(f)===""?s==="never"&&f.pop():s==="always"&&f.push(""));let p,g="";for(let m=0;m<f.length;m++){m>0&&(g+="/");const b=f[m];if(!b)continue;p=If(b,0,p);const _=p[0];if(_===0){g+=b;continue}const S=p[5],O=b.substring(0,p[1]),E=b.substring(p[4],S),A=b.substring(p[2],p[3]);_===1?g+=O||E?`${O}{$${A}}${E}`:`$${A}`:_===2?g+=O||E?`${O}{$}${E}`:"$":g+=`${O}{-$${A}}${E}`}g=$f(g);const y=g||"/";return c&&i&&i.set(c,y),y}function _S(e){const t=new Map(e.map(l=>[encodeURIComponent(l),l])),s=Array.from(t.keys()).map(l=>l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),i=new RegExp(s,"g");return l=>l.replace(i,u=>t.get(u)??u)}function Qh(e,t,s){const i=t[e];return typeof i!="string"?i:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(i)?i:i.split("/").map(l=>cy(l,s)).join("/"):cy(i,s)}function uy({path:e,params:t,decoder:s,...i}){let l=!1;const u=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:u,isMissingParams:l};if(!e.includes("$"))return{interpolatedPath:e,usedParams:u,isMissingParams:l};const c=e.length;let f=0,p,g="";for(;f<c;){const y=f;p=If(e,y,p);const m=p[5];if(f=m+1,y===m)continue;const b=p[0];if(b===0){g+="/"+e.substring(y,m);continue}if(b===2){const _=t._splat;u._splat=_,u["*"]=_;const S=e.substring(y,p[1]),O=e.substring(p[4],m);if(!_){l=!0,(S||O)&&(g+="/"+S+O);continue}const E=Qh("_splat",t,s);g+="/"+S+E+O;continue}if(b===1){const _=e.substring(p[2],p[3]);!l&&!(_ in t)&&(l=!0),u[_]=t[_];const S=e.substring(y,p[1]),O=e.substring(p[4],m),E=Qh(_,t,s)??"undefined";g+="/"+S+E+O;continue}if(b===3){const _=e.substring(p[2],p[3]),S=t[_];if(S==null)continue;u[_]=S;const O=e.substring(y,p[1]),E=e.substring(p[4],m),A=Qh(_,t,s)??"";g+="/"+O+A+E;continue}}return e.endsWith("/")&&(g+="/"),{usedParams:u,interpolatedPath:g||"/",isMissingParams:l}}function cy(e,t){const s=encodeURIComponent(e);return t?.(s)??s}function yt(e){return e?.isNotFound===!0}function wS(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}var SS="tsr-scroll-restoration-v1_3";function ES(){const e=wS();if(!e)return null;let t={};try{const i=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");Ja(i)&&(t=i)}catch{}return{get state(){return t},set:i=>{t=Wr(i,t)||t},persist:()=>{try{e.setItem(SS,JSON.stringify(t))}catch{}}}}var hy=ES(),TS=e=>e.state.__TSR_key||e.href;function RS(e){const t=[];let s;for(;s=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(s.children,e)+1})`),e=s;return`${t.reverse().join(" > ")}`.toLowerCase()}var Pl=!1,Ki="window",fy="data-scroll-restoration-id";function AS(e,t){if(!hy)return;const s=hy;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!s)return;e.isScrollRestorationSetup=!0,Pl=!1;const i=e.options.getScrollRestorationKey||TS,l=new Map;window.history.scrollRestoration="manual";const u=f=>{if(!(Pl||!e.isScrollRestoring))if(f.target===document||f.target===window)l.set(Ki,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const p=f.target;l.set(p,{scrollX:p.scrollLeft||0,scrollY:p.scrollTop||0})}},c=f=>{if(!e.isScrollRestoring||!f||l.size===0||!s)return;const p=s.state[f]||={};for(const[g,y]of l){let m;if(g===Ki)m=Ki;else if(g.isConnected){const b=g.getAttribute(fy);m=b?`[${fy}="${b}"]`:RS(g)}m&&(p[m]=y)}};document.addEventListener("scroll",u,!0),e.subscribe("onBeforeLoad",f=>{c(f.fromLocation?i(f.fromLocation):void 0),l.clear()}),window.addEventListener("pagehide",()=>{c(i(e.stores.resolvedLocation.get()??e.stores.location.get())),s.persist()}),e.subscribe("onRendered",f=>{const p=i(f.toLocation),g=e.options.scrollRestorationBehavior,y=e.options.scrollToTopSelectors;if(l.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){Pl=!0;try{const m=e.isScrollRestoring?s.state[p]:void 0;let b=!1;if(m)for(const _ in m){const S=m[_];if(!Ja(S))continue;const{scrollX:O,scrollY:E}=S;if(!(!Number.isFinite(O)||!Number.isFinite(E))){if(_===Ki)window.scrollTo({top:E,left:O,behavior:g}),b=!0;else if(_){let A;try{A=document.querySelector(_)}catch{continue}A&&(A.scrollLeft=O,A.scrollTop=E,b=!0)}}}if(!b){const _=e.history.location.hash.slice(1);if(_){const S=window.history.state?.__hashScrollIntoViewOptions??!0;if(S){const O=document.getElementById(_);O&&O.scrollIntoView(S)}}else{const S={top:0,left:0,behavior:g};if(window.scrollTo(S),y)for(const O of y){if(O===Ki)continue;const E=typeof O=="function"?O():document.querySelector(O);E&&E.scrollTo(S)}}}}finally{Pl=!1}e.isScrollRestoring&&s.set(m=>(m[p]||={},m))}})}function qv(e,t=String){const s=new URLSearchParams;for(const i in e){const l=e[i];l!==void 0&&s.set(i,t(l))}return s.toString()}function Jh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function OS(e){const t=new URLSearchParams(e),s=Object.create(null);for(const[i,l]of t.entries()){const u=s[i];u==null?s[i]=Jh(l):Array.isArray(u)?u.push(Jh(l)):s[i]=[u,Jh(l)]}return s}var xS=kS(JSON.parse),CS=jS(JSON.stringify,JSON.parse);function kS(e){return t=>{t[0]==="?"&&(t=t.substring(1));const s=OS(t);for(const i in s){const l=s[i];if(typeof l=="string")try{s[i]=e(l)}catch{}}return s}}function jS(e,t){const s=typeof t=="function";function i(l){if(typeof l=="object"&&l!==null)try{return e(l)}catch{}else if(s&&typeof l=="string")try{return t(l),e(l)}catch{}return l}return l=>{const u=qv(l,i);return u?`?${u}`:""}}var Hs="__root__";function $v(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const s=new Response(null,{status:e.statusCode,headers:t});if(s.options=e,e.throw)throw s;return s}function Jt(e){return e instanceof Response&&!!e.options}function MS(e){if(e!==null&&typeof e=="object"&&e.isSerializedRedirect)return $v(e)}function NS(e){return{input:({url:t})=>{for(const s of e)t=mf(s,t);return t},output:({url:t})=>{for(let s=e.length-1;s>=0;s--)t=Vv(e[s],t);return t}}}function DS(e){const t=Iv(e.basepath),s=`/${t}`,i=`${s}/`,l=e.caseSensitive?s:s.toLowerCase(),u=e.caseSensitive?i:i.toLowerCase();return{input:({url:c})=>{const f=e.caseSensitive?c.pathname:c.pathname.toLowerCase();return f===l?c.pathname="/":f.startsWith(u)&&(c.pathname=c.pathname.slice(s.length)),c},output:({url:c})=>(c.pathname=Xl(["/",t,c.pathname]),c)}}function mf(e,t){const s=e?.input?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}function Vv(e,t){const s=e?.output?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}function LS(e,t){const{createMutableStore:s,createReadonlyStore:i,batch:l,init:u}=t,c=new Map,f=new Map,p=new Map,g=s(e.status),y=s(e.loadedAt),m=s(e.isLoading),b=s(e.isTransitioning),_=s(e.location),S=s(e.resolvedLocation),O=s(e.statusCode),E=s(e.redirect),A=s([]),M=s([]),j=s([]),D=i(()=>Xh(c,A.get())),X=i(()=>Xh(f,M.get())),K=i(()=>Xh(p,j.get())),H=i(()=>A.get()[0]),Y=i(()=>A.get().some(F=>c.get(F)?.get().status==="pending")),Z=i(()=>({locationHref:_.get().href,resolvedLocationHref:S.get()?.href,status:g.get()})),le=i(()=>({status:g.get(),loadedAt:y.get(),isLoading:m.get(),isTransitioning:b.get(),matches:D.get(),location:_.get(),resolvedLocation:S.get(),statusCode:O.get(),redirect:E.get()})),ie=io(64);function me(F){let ae=ie.get(F);return ae||(ae=i(()=>{const Se=A.get();for(const ye of Se){const C=c.get(ye);if(C&&C.routeId===F)return C.get()}}),ie.set(F,ae)),ae}const _e={status:g,loadedAt:y,isLoading:m,isTransitioning:b,location:_,resolvedLocation:S,statusCode:O,redirect:E,matchesId:A,pendingIds:M,cachedIds:j,matches:D,pendingMatches:X,cachedMatches:K,firstId:H,hasPending:Y,matchRouteDeps:Z,matchStores:c,pendingMatchStores:f,cachedMatchStores:p,__store:le,getRouteMatchStore:me,setMatches:qe,setPending:Me,setCached:U};qe(e.matches),u?.(_e);function qe(F){Zh(F,c,A,s,l)}function Me(F){Zh(F,f,M,s,l)}function U(F){Zh(F,p,j,s,l)}return _e}function Xh(e,t){const s=[];for(const i of t){const l=e.get(i);l&&s.push(l.get())}return s}function Zh(e,t,s,i,l){const u=e.map(f=>f.id),c=new Set(u);l(()=>{for(const f of t.keys())c.has(f)||t.delete(f);for(const f of e){const p=t.get(f.id);if(!p){const g=i(f);g.routeId=f.routeId,t.set(f.id,g);continue}p.routeId=f.routeId,p.get()!==f&&p.set(f)}iS(s.get(),u)||s.set(u)})}var yf=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},US=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),vu=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Is=(e,t,s=!0)=>{const i={...e.router.options.context??{}},l=s?t:t-1;for(let u=0;u<=l;u++){const c=e.matches[u];if(!c)continue;const f=e.router.getMatch(c.id);f&&Object.assign(i,f.__routeContext,f.__beforeLoadContext)}return i},dy=(e,t)=>{if(!e.matches.length)return;const s=t.routeId,i=e.matches.findIndex(c=>c.routeId===e.router.routeTree.id),l=i>=0?i:0;let u=s?e.matches.findIndex(c=>c.routeId===s):e.firstBadMatchIndex??e.matches.length-1;u<0&&(u=l);for(let c=u;c>=0;c--){const f=e.matches[c];if(e.router.looseRoutesById[f.routeId].options.notFoundComponent)return c}return s?u:l},ts=(e,t,s)=>{if(!(!Jt(s)&&!yt(s)))throw Jt(s)&&s.redirectHandled&&!s.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=s,e.updateMatch(t.id,i=>({...i,status:Jt(s)?"redirected":yt(s)?"notFound":i.status==="pending"?"success":i.status,context:Is(e,t.index),isFetching:!1,error:s})),yt(s)&&!s.routeId&&(s.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Jt(s)&&(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s))),s},Gv=(e,t)=>{const s=e.router.getMatch(t);return!!(!s||s._nonReactive.dehydrated)},py=(e,t,s)=>{const i=Is(e,s);e.updateMatch(t,l=>({...l,context:i}))},Yi=(e,t,s,i)=>{const{id:l,routeId:u}=e.matches[t],c=e.router.looseRoutesById[u];if(s instanceof Promise)throw s;s.routerCode=i,e.firstBadMatchIndex??=t,ts(e,e.router.getMatch(l),s);try{c.options.onError?.(s)}catch(f){s=f,ts(e,e.router.getMatch(l),s)}e.updateMatch(l,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Jt(s)&&!yt(s)&&(e.serialError??=s)},Kv=(e,t,s,i)=>{if(i._nonReactive.pendingTimeout!==void 0)return;const l=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!vu(e,t)&&(s.options.loader||s.options.beforeLoad||Fv(s))&&typeof l=="number"&&l!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const u=setTimeout(()=>{yf(e)},l);i._nonReactive.pendingTimeout=u}},zS=(e,t,s)=>{const i=e.router.getMatch(t);if(!i._nonReactive.beforeLoadPromise&&!i._nonReactive.loaderPromise)return;Kv(e,t,s,i);const l=()=>{const u=e.router.getMatch(t);u.preload&&(u.status==="redirected"||u.status==="notFound")&&ts(e,u,u.error)};return i._nonReactive.beforeLoadPromise?i._nonReactive.beforeLoadPromise.then(l):l()},PS=(e,t,s,i)=>{const l=e.router.getMatch(t);let u=l._nonReactive.loadPromise;l._nonReactive.loadPromise=qs(()=>{u?.resolve(),u=void 0});const{paramsError:c,searchError:f}=l;c&&Yi(e,s,c,"PARSE_PARAMS"),f&&Yi(e,s,f,"VALIDATE_SEARCH"),Kv(e,t,i,l);const p=new AbortController;let g=!1;const y=()=>{g||(g=!0,e.updateMatch(t,D=>({...D,isFetching:"beforeLoad",fetchCount:D.fetchCount+1,abortController:p})))},m=()=>{l._nonReactive.beforeLoadPromise?.resolve(),l._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,D=>({...D,isFetching:!1}))};if(!i.options.beforeLoad){e.router.batch(()=>{y(),m()});return}l._nonReactive.beforeLoadPromise=qs();const b={...Is(e,s,!1),...l.__routeContext},{search:_,params:S,cause:O}=l,E=vu(e,t),A={search:_,abortController:p,params:S,preload:E,context:b,location:e.location,navigate:D=>e.router.navigate({...D,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:E?"preload":O,matches:e.matches,routeId:i.id,...e.router.options.additionalContext},M=D=>{if(D===void 0){e.router.batch(()=>{y(),m()});return}(Jt(D)||yt(D))&&(y(),Yi(e,s,D,"BEFORE_LOAD")),e.router.batch(()=>{y(),e.updateMatch(t,X=>({...X,__beforeLoadContext:D})),m()})};let j;try{if(j=i.options.beforeLoad(A),ao(j))return y(),j.catch(D=>{Yi(e,s,D,"BEFORE_LOAD")}).then(M)}catch(D){y(),Yi(e,s,D,"BEFORE_LOAD")}M(j)},BS=(e,t)=>{const{id:s,routeId:i}=e.matches[t],l=e.router.looseRoutesById[i],u=()=>f(),c=()=>PS(e,s,t,l),f=()=>{if(Gv(e,s))return;const p=zS(e,s,l);return ao(p)?p.then(c):c()};return u()},HS=(e,t,s)=>{const i=e.router.getMatch(t);if(!i||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const l={ssr:e.router.options.ssr,matches:e.matches,match:i,params:i.params,loaderData:i.loaderData};return Promise.all([s.options.head?.(l),s.options.scripts?.(l),s.options.headers?.(l)]).then(([u,c,f])=>({meta:u?.meta,links:u?.links,headScripts:u?.scripts,headers:f,scripts:c,styles:u?.styles}))},Yv=(e,t,s,i,l)=>{const u=t[i-1],{params:c,loaderDeps:f,abortController:p,cause:g}=e.router.getMatch(s),y=Is(e,i),m=vu(e,s);return{params:c,deps:f,preload:!!m,parentMatchPromise:u,abortController:p,context:y,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),cause:m?"preload":g,route:l,...e.router.options.additionalContext}},gy=async(e,t,s,i,l)=>{try{const u=e.router.getMatch(s);try{(!(zv??e.router.isServer)||u.ssr===!0)&&oo(l);const c=l.options.loader,f=typeof c=="function"?c:c?.handler,p=f?.(Yv(e,t,s,i,l)),g=!!f&&ao(p);if((g||l._lazyPromise||l._componentsPromise||l.options.head||l.options.scripts||l.options.headers||u._nonReactive.minPendingPromise)&&e.updateMatch(s,m=>({...m,isFetching:"loader"})),f){const m=g?await p:p;ts(e,e.router.getMatch(s),m),m!==void 0&&e.updateMatch(s,b=>({...b,loaderData:m}))}l._lazyPromise&&await l._lazyPromise;const y=u._nonReactive.minPendingPromise;y&&await y,l._componentsPromise&&await l._componentsPromise,e.updateMatch(s,m=>({...m,error:void 0,context:Is(e,i),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(c){let f=c;if(f?.name==="AbortError"){if(u.abortController.signal.aborted){u._nonReactive.loaderPromise?.resolve(),u._nonReactive.loaderPromise=void 0;return}e.updateMatch(s,g=>({...g,status:g.status==="pending"?"success":g.status,isFetching:!1,context:Is(e,i)}));return}const p=u._nonReactive.minPendingPromise;p&&await p,yt(c)&&await l.options.notFoundComponent?.preload?.(),ts(e,e.router.getMatch(s),c);try{l.options.onError?.(c)}catch(g){f=g,ts(e,e.router.getMatch(s),g)}!Jt(f)&&!yt(f)&&await oo(l,["errorComponent"]),e.updateMatch(s,g=>({...g,error:f,context:Is(e,i),status:"error",isFetching:!1}))}}catch(u){const c=e.router.getMatch(s);c&&(c._nonReactive.loaderPromise=void 0),ts(e,c,u)}},IS=async(e,t,s)=>{async function i(_,S,O,E,A){const M=Date.now()-S.updatedAt,j=_?A.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:A.options.staleTime??e.router.options.defaultStaleTime??0,D=A.options.shouldReload,X=typeof D=="function"?D(Yv(e,t,l,s,A)):D,{status:K,invalid:H}=E,Y=M>=j&&(!!e.forceStaleReload||E.cause==="enter"||O!==void 0&&O!==E.id);c=K==="success"&&(H||(X??Y)),_&&A.options.preload===!1||(c&&!e.sync&&y?(f=!0,(async()=>{try{await gy(e,t,l,s,A);const Z=e.router.getMatch(l);Z._nonReactive.loaderPromise?.resolve(),Z._nonReactive.loadPromise?.resolve(),Z._nonReactive.loaderPromise=void 0,Z._nonReactive.loadPromise=void 0}catch(Z){Jt(Z)&&await e.router.navigate(Z.options)}})()):K!=="success"||c?await gy(e,t,l,s,A):py(e,l,s))}const{id:l,routeId:u}=e.matches[s];let c=!1,f=!1;const p=e.router.looseRoutesById[u],g=p.options.loader,y=((typeof g=="function"?void 0:g?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(Gv(e,l)){if(!e.router.getMatch(l))return e.matches[s];py(e,l,s)}else{const _=e.router.getMatch(l),S=e.router.stores.matchesId.get()[s],O=(S&&e.router.stores.matchStores.get(S)||null)?.routeId===u?S:e.router.stores.matches.get().find(A=>A.routeId===u)?.id,E=vu(e,l);if(_._nonReactive.loaderPromise){if(_.status==="success"&&!e.sync&&!_.preload&&y)return _;await _._nonReactive.loaderPromise;const A=e.router.getMatch(l),M=A._nonReactive.error||A.error;M&&ts(e,A,M),A.status==="pending"&&await i(E,_,O,A,p)}else{const A=E&&!e.router.stores.matchStores.has(l),M=e.router.getMatch(l);M._nonReactive.loaderPromise=qs(),A!==M.preload&&e.updateMatch(l,j=>({...j,preload:A})),await i(E,_,O,M,p)}}const m=e.router.getMatch(l);f||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,f||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const b=f?m.isFetching:!1;return b!==m.isFetching||m.invalid!==!1?(e.updateMatch(l,_=>({..._,isFetching:b,invalid:!1})),e.router.getMatch(l)):m};async function my(e){const t=e,s=[];US(t.router)&&yf(t);let i;for(let b=0;b<t.matches.length;b++){try{const _=BS(t,b);ao(_)&&await _}catch(_){if(Jt(_))throw _;if(yt(_))i=_;else if(!t.preload)throw _;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const l=t.firstBadMatchIndex??t.matches.length,u=i&&!t.preload?dy(t,i):void 0,c=i&&t.preload?0:u!==void 0?Math.min(u+1,l):l;let f,p;for(let b=0;b<c;b++)s.push(IS(t,s,b));try{await Promise.all(s)}catch{const b=await Promise.allSettled(s);for(const _ of b){if(_.status!=="rejected")continue;const S=_.reason;if(Jt(S))throw S;yt(S)?f??=S:p??=S}if(p!==void 0)throw p}const g=f??(i&&!t.preload?i:void 0);let y=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!g&&i&&t.preload)return t.matches;if(g){const b=dy(t,g);b===void 0&&Xt();const _=t.matches[b],S=t.router.looseRoutesById[_.routeId],O=t.router.options?.defaultNotFoundComponent;!S.options.notFoundComponent&&O&&(S.options.notFoundComponent=O),g.routeId=_.routeId;const E=_.routeId===t.router.routeTree.id;t.updateMatch(_.id,A=>({...A,...E?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:g},isFetching:!1})),y=b,await oo(S,["notFoundComponent"])}else if(!t.preload){const b=t.matches[0];b.globalNotFound||t.router.getMatch(b.id)?.globalNotFound&&t.updateMatch(b.id,_=>({..._,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const b=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await oo(b,["errorComponent"])}for(let b=0;b<=y;b++){const{id:_,routeId:S}=t.matches[b],O=t.router.looseRoutesById[S];try{const E=HS(t,_,O);if(E){const A=await E;t.updateMatch(_,M=>({...M,...A}))}}catch(E){console.error(`Error executing head for route ${S}:`,E)}}const m=yf(t);if(ao(m)&&await m,g)throw g;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function yy(e,t){const s=t.map(i=>e.options[i]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function oo(e,t=Zl){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(i=>{const{id:l,...u}=i.options;Object.assign(e.options,u),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const s=()=>e._componentsLoaded?void 0:t===Zl?(()=>{if(e._componentsPromise===void 0){const i=yy(e,Zl);i?e._componentsPromise=i.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():yy(e,t);return e._lazyPromise?e._lazyPromise.then(s):s()}function Fv(e){for(const t of Zl)if(e.options[t]?.preload)return!0;return!1}var Zl=["component","errorComponent","pendingComponent","notFoundComponent"],rs="__TSR_index",vy="popstate",by="beforeunload";function qS(e){let t=e.getLocation();const s=new Set,i=c=>{t=e.getLocation(),s.forEach(f=>f({location:t,action:c}))},l=c=>{e.notifyOnIndexChange??!0?i(c):t=e.getLocation()},u=async({task:c,navigateOpts:f,...p})=>{if(f?.ignoreBlocker??!1){c();return}const g=e.getBlockers?.()??[],y=p.type==="PUSH"||p.type==="REPLACE";if(typeof document<"u"&&g.length&&y)for(const m of g){const b=au(p.path,p.state);if(await m.blockerFn({currentLocation:t,nextLocation:b,action:p.type})){e.onBlocked?.();return}}c()};return{get location(){return t},get length(){return e.getLength()},subscribers:s,subscribe:c=>(s.add(c),()=>{s.delete(c)}),push:(c,f,p)=>{const g=t.state[rs];f=_y(g+1,f),u({task:()=>{e.pushState(c,f),i({type:"PUSH"})},navigateOpts:p,type:"PUSH",path:c,state:f})},replace:(c,f,p)=>{const g=t.state[rs];f=_y(g,f),u({task:()=>{e.replaceState(c,f),i({type:"REPLACE"})},navigateOpts:p,type:"REPLACE",path:c,state:f})},go:(c,f)=>{u({task:()=>{e.go(c),l({type:"GO",index:c})},navigateOpts:f,type:"GO"})},back:c=>{u({task:()=>{e.back(c?.ignoreBlocker??!1),l({type:"BACK"})},navigateOpts:c,type:"BACK"})},forward:c=>{u({task:()=>{e.forward(c?.ignoreBlocker??!1),l({type:"FORWARD"})},navigateOpts:c,type:"FORWARD"})},canGoBack:()=>t.state[rs]!==0,createHref:c=>e.createHref(c),block:c=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,c]),()=>{const p=e.getBlockers?.()??[];e.setBlockers?.(p.filter(g=>g!==c))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:i}}function _y(e,t){t||(t={});const s=Vf();return{...t,key:s,__TSR_key:s,[rs]:e}}function $S(e){const t=typeof document<"u"?window:void 0,s=t.history.pushState,i=t.history.replaceState;let l=[];const u=()=>l,c=Y=>l=Y,f=(Y=>Y),p=(()=>au(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const Y=Vf();t.history.replaceState({[rs]:0,key:Y,__TSR_key:Y},"")}let g=p(),y,m=!1,b=!1,_=!1,S=!1;const O=()=>g;let E,A;const M=()=>{E&&(H._ignoreSubscribers=!0,(E.isPush?t.history.pushState:t.history.replaceState)(E.state,"",E.href),H._ignoreSubscribers=!1,E=void 0,A=void 0,y=void 0)},j=(Y,Z,le)=>{const ie=f(Z);A||(y=g),g=au(Z,le),E={href:ie,state:le,isPush:E?.isPush||Y==="push"},A||(A=Promise.resolve().then(()=>M()))},D=Y=>{g=p(),H.notify({type:Y})},X=async()=>{if(b){b=!1;return}const Y=p(),Z=Y.state[rs]-g.state[rs],le=Z===1,ie=Z===-1,me=!le&&!ie||m;m=!1;const _e=me?"GO":ie?"BACK":"FORWARD",qe=me?{type:"GO",index:Z}:{type:ie?"BACK":"FORWARD"};if(_)_=!1;else{const Me=u();if(typeof document<"u"&&Me.length){for(const U of Me)if(await U.blockerFn({currentLocation:g,nextLocation:Y,action:_e})){b=!0,t.history.go(1),H.notify(qe);return}}}g=p(),H.notify(qe)},K=Y=>{if(S){S=!1;return}let Z=!1;const le=u();if(typeof document<"u"&&le.length)for(const ie of le){const me=ie.enableBeforeUnload??!0;if(me===!0){Z=!0;break}if(typeof me=="function"&&me()===!0){Z=!0;break}}if(Z)return Y.preventDefault(),Y.returnValue=""},H=qS({getLocation:O,getLength:()=>t.history.length,pushState:(Y,Z)=>j("push",Y,Z),replaceState:(Y,Z)=>j("replace",Y,Z),back:Y=>(Y&&(_=!0),S=!0,t.history.back()),forward:Y=>{Y&&(_=!0),S=!0,t.history.forward()},go:Y=>{m=!0,t.history.go(Y)},createHref:Y=>f(Y),flush:M,destroy:()=>{t.history.pushState=s,t.history.replaceState=i,t.removeEventListener(by,K,{capture:!0}),t.removeEventListener(vy,X)},onBlocked:()=>{y&&g!==y&&(g=y)},getBlockers:u,setBlockers:c,notifyOnIndexChange:!1});return t.addEventListener(by,K,{capture:!0}),t.addEventListener(vy,X),t.history.pushState=function(...Y){const Z=s.apply(t.history,Y);return H._ignoreSubscribers||D("PUSH"),Z},t.history.replaceState=function(...Y){const Z=i.apply(t.history,Y);return H._ignoreSubscribers||D("REPLACE"),Z},H}function VS(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function au(e,t){const s=VS(e),i=s.indexOf("#"),l=s.indexOf("?"),u=Vf();return{href:s,pathname:s.substring(0,i>0?l>0?Math.min(i,l):i:l>0?l:s.length),hash:i>-1?s.substring(i):"",search:l>-1?s.slice(l,i===-1?void 0:i):"",state:t||{[rs]:0,key:u,__TSR_key:u}}}function Vf(){return(Math.random()+1).toString(36).substring(7)}function GS(e){return e instanceof Error?{name:e.name,message:e.message}:{data:e}}function Ka(e,t){const s=t,i=e;return{fromLocation:s,toLocation:i,pathChanged:s?.pathname!==i.pathname,hrefChanged:s?.href!==i.href,hashChanged:s?.hash!==i.hash}}var KS=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=s=>s(),this.update=s=>{const i=this.options,l=this.basepath??i?.basepath??"/",u=this.basepath===void 0,c=i?.rewrite;if(this.options={...i,...s},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=_S(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=$S()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let y;this.resolvePathCache=io(1e3),y=this.buildRouteTree(),this.setRoutes(y)}if(!this.stores&&this.latestLocation){const y=this.getStoreConfig(this);this.batch=y.batch,this.stores=LS(FS(this.latestLocation),y),AS(this)}let f=!1;const p=this.options.basepath??"/",g=this.options.rewrite;if(u||l!==p||c!==g){this.basepath=p;const y=[],m=Iv(p);m&&m!=="/"&&y.push(DS({basepath:p})),g&&y.push(g),this.rewrite=y.length===0?void 0:y.length===1?y[0]:NS(y),this.history&&this.updateLatestLocation(),f=!0}f&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const s=dS(this.routeTree,this.options.caseSensitive,(i,l)=>{i.init({originalIndex:l})});return this.options.routeMasks&&lS(this.options.routeMasks,s.processedTree),s},this.subscribe=(s,i)=>{const l={eventType:s,fn:i};return this.subscribers.add(l),()=>{this.subscribers.delete(l)}},this.emit=s=>{this.subscribers.forEach(i=>{i.eventType===s.type&&i.fn(s)})},this.parseLocation=(s,i)=>{const l=({pathname:p,search:g,hash:y,href:m,state:b})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(p)){const A=this.options.parseSearch(g),M=this.options.stringifySearch(A);return{href:p+M+y,publicHref:p+M+y,pathname:Gi(p).path,external:!1,searchStr:M,search:js(i?.search,A),hash:Gi(y.slice(1)).path,state:Ls(i?.state,b)}}const _=new URL(m,this.origin),S=mf(this.rewrite,_),O=this.options.parseSearch(S.search),E=this.options.stringifySearch(O);return S.search=E,{href:S.href.replace(S.origin,""),publicHref:m,pathname:Gi(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:E,search:js(i?.search,O),hash:Gi(S.hash.slice(1)).path,state:Ls(i?.state,b)}},u=l(s),{__tempLocation:c,__tempKey:f}=u.state;if(c&&(!f||f===this.tempLocationKey)){const p=l(c);return p.state.key=u.state.key,p.state.__TSR_key=u.state.__TSR_key,delete p.state.__tempLocation,{...p,maskedLocation:u}}return u},this.resolvePathWithBase=(s,i)=>bS({base:s,to:$f(i),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(s,i,l)=>typeof s=="string"?this.matchRoutesInternal({pathname:s,search:i},l):this.matchRoutesInternal(s,i),this.getMatchedRoutes=s=>QS({pathname:s,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=s=>{const i=this.getMatch(s);i&&(i.abortController.abort(),clearTimeout(i._nonReactive.pendingTimeout),i._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(s=>{this.cancelMatch(s)}),this.stores.matchesId.get().forEach(s=>{if(this.stores.pendingMatchStores.has(s))return;const i=this.stores.matchStores.get(s)?.get();i&&(i.status==="pending"||i.isFetching==="loader")&&this.cancelMatch(s)})},this.buildLocation=s=>{const i=(u={})=>{const c=u._fromLocation||this.pendingBuiltLocation||this.latestLocation,f=this.matchRoutesLightweight(c);u.from;const p=u.unsafeRelative==="path"?c.pathname:u.from??f.fullPath,g=this.resolvePathWithBase(p,"."),y=f.search,m=Object.assign(Object.create(null),f.params),b=u.to?this.resolvePathWithBase(g,`${u.to}`):this.resolvePathWithBase(g,"."),_=u.params===!1||u.params===null?Object.create(null):(u.params??!0)===!0?m:Object.assign(m,Wr(u.params,m)),S=this.getMatchedRoutes(b);let O=S.matchedRoutes;if((!S.foundRoute||S.foundRoute.path!=="/"&&S.routeParams["**"])&&this.options.notFoundRoute&&(O=[...O,this.options.notFoundRoute]),Object.keys(_).length>0)for(const le of O){const ie=le.options.params?.stringify??le.options.stringifyParams;if(ie)try{Object.assign(_,ie(_))}catch{}}const E=s.leaveParams?b:Gi(uy({path:b,params:_,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let A=y;if(s._includeValidateSearch&&this.options.search?.strict){const le={};O.forEach(ie=>{if(ie.options.validateSearch)try{Object.assign(le,Wl(ie.options.validateSearch,{...le,...A}))}catch{}}),A=le}A=JS({search:A,dest:u,destRoutes:O,_includeValidateSearch:s._includeValidateSearch}),A=js(y,A);const M=this.options.stringifySearch(A),j=u.hash===!0?c.hash:u.hash?Wr(u.hash,c.hash):void 0,D=j?`#${j}`:"";let X=u.state===!0?c.state:u.state?Wr(u.state,c.state):{};X=Ls(c.state,X);const K=`${E}${M}${D}`;let H,Y,Z=!1;if(this.rewrite){const le=new URL(K,this.origin),ie=Vv(this.rewrite,le);H=le.href.replace(le.origin,""),ie.origin!==this.origin?(Y=ie.href,Z=!0):Y=ie.pathname+ie.search+ie.hash}else H=aS(K),Y=H;return{publicHref:Y,href:H,pathname:E,search:A,searchStr:M,state:X,hash:j??"",external:Z,unmaskOnReload:u.unmaskOnReload}},l=(u={},c)=>{const f=i(u);let p=c?i(c):void 0;if(!p){const g=Object.create(null);if(this.options.routeMasks){const y=uS(f.pathname,this.processedTree);if(y){Object.assign(g,y.rawParams);const{from:m,params:b,..._}=y.route,S=b===!1||b===null?Object.create(null):(b??!0)===!0?g:Object.assign(g,Wr(b,g));c={from:s.from,..._,params:S},p=i(c)}}}return p&&(f.maskedLocation=p),f};return s.mask?l(s,{from:s.from,...s.mask}):l(s)},this.commitLocation=async({viewTransition:s,ignoreBlocker:i,...l})=>{const u=()=>{const p=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];p.forEach(y=>{l.state[y]=this.latestLocation.state[y]});const g=Qt(l.state,this.latestLocation.state);return p.forEach(y=>{delete l.state[y]}),g},c=ns(this.latestLocation.href)===ns(l.href);let f=this.commitLocationPromise;if(this.commitLocationPromise=qs(()=>{f?.resolve(),f=void 0}),c&&u())this.load();else{let{maskedLocation:p,hashScrollIntoView:g,...y}=l;p&&(y={...p,state:{...p.state,__tempKey:void 0,__tempLocation:{...y,search:y.searchStr,state:{...y.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(y.unmaskOnReload??this.options.unmaskOnReload??!1)&&(y.state.__tempKey=this.tempLocationKey)),y.state.__hashScrollIntoViewOptions=g??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=s,this.history[l.replace?"replace":"push"](y.publicHref,y.state,{ignoreBlocker:i})}return this.resetNextScroll=l.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:s,resetScroll:i,hashScrollIntoView:l,viewTransition:u,ignoreBlocker:c,href:f,...p}={})=>{if(f){const m=this.history.location.state.__TSR_index,b=au(f,{__TSR_index:s?m:m+1}),_=new URL(b.pathname,this.origin);p.to=mf(this.rewrite,_).pathname,p.search=this.options.parseSearch(b.search),p.hash=b.hash.slice(1)}const g=this.buildLocation({...p,_includeValidateSearch:!0});this.pendingBuiltLocation=g;const y=this.commitLocation({...g,viewTransition:u,replace:s,resetScroll:i,hashScrollIntoView:l,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===g&&(this.pendingBuiltLocation=void 0)}),y},this.navigate=async({to:s,reloadDocument:i,href:l,publicHref:u,...c})=>{let f=!1;if(l)try{new URL(`${l}`),f=!0}catch{}if(f&&!i&&(i=!0),i){if(s!==void 0||!l){const g=this.buildLocation({to:s,...c});l=l??g.publicHref,u=u??g.publicHref}const p=!f&&u?u:l;if(ru(p,this.protocolAllowlist))return Promise.resolve();if(!c.ignoreBlocker){const g=this.history.getBlockers?.()??[];for(const y of g)if(y?.blockerFn&&await y.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return c.replace?window.location.replace(p):window.location.href=p,Promise.resolve()}return this.buildAndCommitLocation({...c,href:l,to:s,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const s=this.matchRoutes(this.latestLocation),i=this.stores.cachedMatches.get().filter(l=>!s.some(u=>u.id===l.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(s),this.stores.setCached(i)})},this.load=async s=>{let i,l,u;const c=this.stores.resolvedLocation.get()??this.stores.location.get();for(u=new Promise(p=>{this.startTransition(async()=>{try{this.beforeLoad();const g=this.latestLocation,y=Ka(g,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...y}),this.emit({type:"onBeforeLoad",...y}),await my({router:this,sync:s?.sync,forceStaleReload:c.href===g.href,matches:this.stores.pendingMatches.get(),location:g,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let m=null,b=null,_=null,S=null;this.batch(()=>{const O=this.stores.pendingMatches.get(),E=O.length,A=this.stores.matches.get();m=E?A.filter(D=>!this.stores.pendingMatchStores.has(D.id)):null;const M=new Set;for(const D of this.stores.pendingMatchStores.values())D.routeId&&M.add(D.routeId);const j=new Set;for(const D of this.stores.matchStores.values())D.routeId&&j.add(D.routeId);b=E?A.filter(D=>!M.has(D.routeId)):null,_=E?O.filter(D=>!j.has(D.routeId)):null,S=E?O.filter(D=>j.has(D.routeId)):A,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),E&&(this.stores.setMatches(O),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...m.filter(D=>D.status!=="error"&&D.status!=="notFound"&&D.status!=="redirected")]),this.clearExpiredCache())});for(const[O,E]of[[b,"onLeave"],[_,"onEnter"],[S,"onStay"]])if(O)for(const A of O)this.looseRoutesById[A.routeId].options[E]?.(A)})})}})}catch(g){Jt(g)?(i=g,this.navigate({...i.options,replace:!0,ignoreBlocker:!0})):yt(g)&&(l=g);const y=i?i.status:l?404:this.stores.matches.get().some(m=>m.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(y),this.stores.redirect.set(i)})}this.latestLoadPromise===u&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),p()})}),this.latestLoadPromise=u,await u;this.latestLoadPromise&&u!==this.latestLoadPromise;)await this.latestLoadPromise;let f;this.hasNotFoundMatch()?f=404:this.stores.matches.get().some(p=>p.status==="error")&&(f=500),f!==void 0&&this.stores.statusCode.set(f)},this.startViewTransition=s=>{const i=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,i&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let l;if(typeof i=="object"&&this.isViewTransitionTypesSupported){const u=this.latestLocation,c=this.stores.resolvedLocation.get(),f=typeof i.types=="function"?i.types(Ka(u,c)):i.types;if(f===!1){s();return}l={update:s,types:f}}else l=s;document.startViewTransition(l)}else s()},this.updateMatch=(s,i)=>{this.startTransition(()=>{const l=this.stores.pendingMatchStores.get(s);if(l){l.set(i);return}const u=this.stores.matchStores.get(s);if(u){u.set(i);return}const c=this.stores.cachedMatchStores.get(s);if(c){const f=i(c.get());f.status==="redirected"?this.stores.cachedMatchStores.delete(s)&&this.stores.cachedIds.set(p=>p.filter(g=>g!==s)):c.set(f)}})},this.getMatch=s=>this.stores.cachedMatchStores.get(s)?.get()??this.stores.pendingMatchStores.get(s)?.get()??this.stores.matchStores.get(s)?.get(),this.invalidate=s=>{const i=l=>s?.filter?.(l)??!0?{...l,invalid:!0,...s?.forcePending||l.status==="error"||l.status==="notFound"?{status:"pending",error:void 0}:void 0}:l;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(i)),this.stores.setCached(this.stores.cachedMatches.get().map(i)),this.stores.setPending(this.stores.pendingMatches.get().map(i))}),this.shouldViewTransition=!1,this.load({sync:s?.sync})},this.getParsedLocationHref=s=>s.publicHref||"/",this.resolveRedirect=s=>{const i=s.headers.get("Location");if(!s.options.href||s.options._builtLocation){const l=s.options._builtLocation??this.buildLocation(s.options),u=this.getParsedLocationHref(l);s.options.href=u,s.headers.set("Location",u)}else if(i)try{const l=new URL(i);if(this.origin&&l.origin===this.origin){const u=l.pathname+l.search+l.hash;s.options.href=u,s.headers.set("Location",u)}}catch{}if(s.options.href&&!s.options._builtLocation&&ru(s.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return s.headers.get("Location")||s.headers.set("Location",s.options.href),s},this.clearCache=s=>{const i=s?.filter;i!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(l=>!i(l))):this.stores.setCached([])},this.clearExpiredCache=()=>{const s=Date.now(),i=l=>{const u=this.looseRoutesById[l.routeId];if(!u.options.loader)return!0;const c=(l.preload?u.options.preloadGcTime??this.options.defaultPreloadGcTime:u.options.gcTime??this.options.defaultGcTime)??300*1e3;return l.status==="error"?!0:s-l.updatedAt>=c};this.clearCache({filter:i})},this.loadRouteChunk=oo,this.preloadRoute=async s=>{const i=s._builtLocation??this.buildLocation(s);let l=this.matchRoutes(i,{throwOnError:!0,preload:!0,dest:s});const u=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),c=new Set([...u,...this.stores.cachedIds.get()]),f=l.filter(p=>!c.has(p.id));if(f.length){const p=this.stores.cachedMatches.get();this.stores.setCached([...p,...f])}try{return l=await my({router:this,matches:l,location:i,preload:!0,updateMatch:(p,g)=>{u.has(p)?l=l.map(y=>y.id===p?g(y):y):this.updateMatch(p,g)}}),l}catch(p){if(Jt(p))return p.options.reloadDocument?void 0:await this.preloadRoute({...p.options,_fromLocation:i});yt(p)||console.error(p);return}},this.matchRoute=(s,i)=>{const l={...s,to:s.to?this.resolvePathWithBase(s.from||"",s.to):void 0,params:s.params||{},leaveParams:!0},u=this.buildLocation(l);if(i?.pending&&this.stores.status.get()!=="pending")return!1;const c=(i?.pending===void 0?!this.stores.isLoading.get():i.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),f=cS(u.pathname,i?.caseSensitive??!1,i?.fuzzy??!1,c.pathname,this.processedTree);return!f||s.params&&!Qt(f.rawParams,s.params,{partial:!0})?!1:i?.includeSearch??!0?Qt(c.search,u.search,{partial:!0})?f.rawParams:!1:f.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(s=>s.status==="notFound"||s.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??CS,parseSearch:e.parseSearch??xS,protocolAllowlist:e.protocolAllowlist??tS}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:s}){this.routesById=e,this.routesByPath=t,this.processedTree=s;const i=this.options.notFoundRoute;i&&(i.init({originalIndex:99999999999}),this.routesById[i.id]=i)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const s=this.getMatchedRoutes(e.pathname),{foundRoute:i,routeParams:l,parsedParams:u}=s;let{matchedRoutes:c}=s,f=!1;(i?i.path!=="/"&&l["**"]:ns(e.pathname))&&(this.options.notFoundRoute?c=[...c,this.options.notFoundRoute]:f=!0);const p=f?ZS(this.options.notFoundMode,c):void 0,g=new Array(c.length),y=new Map;for(const m of this.stores.matchStores.values())m.routeId&&y.set(m.routeId,m.get());for(let m=0;m<c.length;m++){const b=c[m],_=g[m-1];let S,O,E;{const _e=_?.search??e.search,qe=_?._strictSearch??void 0;try{const Me=Wl(b.options.validateSearch,{..._e})??void 0;S={..._e,...Me},O={...qe,...Me},E=void 0}catch(Me){let U=Me;if(Me instanceof iu||(U=new iu(Me.message,{cause:Me})),t?.throwOnError)throw U;S=_e,O={},E=U}}const A=b.options.loaderDeps?.({search:S})??"",M=A?JSON.stringify(A):"",{interpolatedPath:j,usedParams:D}=uy({path:b.fullPath,params:l,decoder:this.pathParamsDecoder,server:this.isServer}),X=b.id+j+M,K=this.getMatch(X),H=y.get(b.id),Y=K?._strictParams??D;let Z;if(!K)try{wy(b,D,u,Y)}catch(_e){if(yt(_e)||Jt(_e)?Z=_e:Z=new YS(_e.message,{cause:_e}),t?.throwOnError)throw Z}Object.assign(l,Y);const le=H?"stay":"enter";let ie;if(K)ie={...K,cause:le,params:H?.params??l,_strictParams:Y,search:js(H?H.search:K.search,S),_strictSearch:O};else{const _e=b.options.loader||b.options.beforeLoad||b.lazyFn||Fv(b)?"pending":"success";ie={id:X,ssr:b.options.ssr,index:m,routeId:b.id,params:H?.params??l,_strictParams:Y,pathname:j,updatedAt:Date.now(),search:H?js(H.search,S):S,_strictSearch:O,searchError:void 0,status:_e,isFetching:!1,error:void 0,paramsError:Z,__routeContext:void 0,_nonReactive:{loadPromise:qs()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:le,loaderDeps:H?Ls(H.loaderDeps,A):A,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:b.options.staticData||{},fullPath:b.fullPath}}t?.preload||(ie.globalNotFound=p===b.id),ie.searchError=E;const me=this.getParentContext(_);ie.context={...me,...ie.__routeContext,...ie.__beforeLoadContext},g[m]=ie}for(let m=0;m<g.length;m++){const b=g[m],_=this.looseRoutesById[b.routeId],S=this.getMatch(b.id),O=y.get(b.routeId);if(b.params=O?js(O.params,l):l,!S){const E=g[m-1],A=this.getParentContext(E);if(_.options.context){const M={deps:b.loaderDeps,params:b.params,context:A??{},location:e,navigate:j=>this.navigate({...j,_fromLocation:e}),buildLocation:this.buildLocation,cause:b.cause,abortController:b.abortController,preload:!!b.preload,matches:g,routeId:_.id};b.__routeContext=_.options.context(M)??void 0}b.context={...A,...b.__routeContext,...b.__beforeLoadContext}}}return g}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:s,parsedParams:i}=this.getMatchedRoutes(e.pathname),l=so(t),u={...e.search};for(const y of t)try{Object.assign(u,Wl(y.options.validateSearch,u))}catch{}const c=so(this.stores.matchesId.get()),f=c&&this.stores.matchStores.get(c)?.get(),p=f&&f.routeId===l.id&&f.pathname===e.pathname;let g;if(p)g=f.params;else{const y=Object.assign(Object.create(null),s);for(const m of t)try{wy(m,s,i??{},y)}catch{}g=y}return{matchedRoutes:t,fullPath:l.fullPath,search:u,params:g}}},iu=class extends Error{},YS=class extends Error{};function FS(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Wl(e,t){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(t);if(s instanceof Promise)throw new iu("Async validation not supported");if(s.issues)throw new iu(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function QS({pathname:e,routesById:t,processedTree:s}){const i=Object.create(null),l=ns(e);let u,c;const f=hS(l,s,!0);return f&&(u=f.route,Object.assign(i,f.rawParams),c=Object.assign(Object.create(null),f.parsedParams)),{matchedRoutes:f?.branch||[t.__root__],routeParams:i,foundRoute:u,parsedParams:c}}function JS({search:e,dest:t,destRoutes:s,_includeValidateSearch:i}){return XS(s)(e,t,i??!1)}function XS(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const l of e){if("search"in l.options)l.options.search?.middlewares&&t.middlewares.push(...l.options.search.middlewares);else if(l.options.preSearchFilters||l.options.postSearchFilters){const u=({search:c,next:f})=>{let p=c;"preSearchFilters"in l.options&&l.options.preSearchFilters&&(p=l.options.preSearchFilters.reduce((y,m)=>m(y),c));const g=f(p);return"postSearchFilters"in l.options&&l.options.postSearchFilters?l.options.postSearchFilters.reduce((y,m)=>m(y),g):g};t.middlewares.push(u)}if(l.options.validateSearch){const u=({search:c,next:f})=>{const p=f(c);if(!t._includeValidateSearch)return p;try{return{...p,...Wl(l.options.validateSearch,p)??void 0}}catch{return p}};t.middlewares.push(u)}}const s=({search:l})=>{const u=t.dest;return u.search?u.search===!0?l:Wr(u.search,l):{}};t.middlewares.push(s);const i=(l,u,c)=>{if(l>=c.length)return u;const f=c[l];return f({search:u,next:g=>i(l+1,g,c)})};return function(u,c,f){return t.dest=c,t._includeValidateSearch=f,i(0,u,t.middlewares)}}function ZS(e,t){if(e!=="root")for(let s=t.length-1;s>=0;s--){const i=t[s];if(i.children)return i.id}return Hs}function wy(e,t,s,i){const l=e.options.params?.parse??e.options.parseParams;if(l)if(e.options.skipRouteOnParseError)for(const u in t)u in s&&(i[u]=s[u]);else{const u=l(i);Object.assign(i,u)}}var Gn=Symbol.for("TSR_DEFERRED_PROMISE");function WS(e,t){const s=e;return s[Gn]||(s[Gn]={status:"pending"},s.then(i=>{s[Gn].status="success",s[Gn].data=i}).catch(i=>{s[Gn].status="error",s[Gn].error={data:GS(i),__isServerError:!0}})),s}var eE="Error preloading route! ☝️";function Sy(e,t){if(e)return typeof e=="string"?e:e[t]}function tE(e){return typeof e=="string"?{href:e,crossOrigin:void 0}:e}function nE(e){if(e.tag!=="link")return;const t=e.attrs?.rel,s=e.attrs?.href;if(typeof s=="string"&&(typeof t=="string"?t.split(/\s+/):[]).includes("stylesheet"))return s}function rE(e,t){const s=nE(t);return!!s&&e?.inlineCss?.styles[s]!==void 0}var Qv=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const s=this.options,i=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),i?this._path=Hs:this.parentRoute||Xt();let l=i?Hs:s?.path;l&&l!=="/"&&(l=Hv(l));const u=s?.id||l;let c=i?Hs:Xl([this.parentRoute.id==="__root__"?"":this.parentRoute.id,u]);l==="__root__"&&(l="/"),c!=="__root__"&&(c=Xl(["/",c]));const f=c==="__root__"?"/":Xl([this.parentRoute.fullPath,l]);this._path=l,this._id=c,this._fullPath=f,this._to=ns(f)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>$v({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},sE=class extends Qv{constructor(e){super(e)}};function aE(e){if(typeof document<"u"&&document.querySelector){const t=e.stores.location.get(),s=t.state.__hashScrollIntoViewOptions??!0;if(s&&t.hash!==""){const i=document.getElementById(t.hash);i&&i.scrollIntoView(s)}}}var iE=(e=>(e[e.AggregateError=1]="AggregateError",e[e.ArrowFunction=2]="ArrowFunction",e[e.ErrorPrototypeStack=4]="ErrorPrototypeStack",e[e.ObjectAssign=8]="ObjectAssign",e[e.BigIntTypedArray=16]="BigIntTypedArray",e[e.RegExp=32]="RegExp",e))(iE||{}),vr=Symbol.asyncIterator,Jv=Symbol.hasInstance,Ya=Symbol.isConcatSpreadable,br=Symbol.iterator,Xv=Symbol.match,Zv=Symbol.matchAll,Wv=Symbol.replace,e0=Symbol.search,t0=Symbol.species,n0=Symbol.split,r0=Symbol.toPrimitive,Fa=Symbol.toStringTag,s0=Symbol.unscopables,a0={[vr]:0,[Jv]:1,[Ya]:2,[br]:3,[Xv]:4,[Zv]:5,[Wv]:6,[e0]:7,[t0]:8,[n0]:9,[r0]:10,[Fa]:11,[s0]:12},oE={0:vr,1:Jv,2:Ya,3:br,4:Xv,5:Zv,6:Wv,7:e0,8:t0,9:n0,10:r0,11:Fa,12:s0},R=void 0,lE={2:!0,3:!1,1:R,0:null,4:-0,5:Number.POSITIVE_INFINITY,6:Number.NEGATIVE_INFINITY,7:Number.NaN},uE={0:"Error",1:"EvalError",2:"RangeError",3:"ReferenceError",4:"SyntaxError",5:"TypeError",6:"URIError"},cE={0:Error,1:EvalError,2:RangeError,3:ReferenceError,4:SyntaxError,5:TypeError,6:URIError};function je(e,t,s,i,l,u,c,f,p,g,y,m){return{t:e,i:t,s,c:i,m:l,p:u,e:c,a:f,f:p,b:g,o:y,l:m}}function ss(e){return je(2,R,e,R,R,R,R,R,R,R,R,R)}var i0=ss(2),o0=ss(3),hE=ss(1),fE=ss(0),dE=ss(4),pE=ss(5),gE=ss(6),mE=ss(7);function yE(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case`
`:return"\\n";case"\r":return"\\r";case"\b":return"\\b";case"	":return"\\t";case"\f":return"\\f";case"<":return"\\x3C";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return R}}function as(e){let t="",s=0,i;for(let l=0,u=e.length;l<u;l++)i=yE(e[l]),i&&(t+=e.slice(s,l)+i,s=l+1);return s===0?t=e:t+=e.slice(s),t}function vE(e){switch(e){case"\\\\":return"\\";case'\\"':return'"';case"\\n":return`
`;case"\\r":return"\r";case"\\b":return"\b";case"\\t":return"	";case"\\f":return"\f";case"\\x3C":return"<";case"\\u2028":return"\u2028";case"\\u2029":return"\u2029";default:return e}}function is(e){return e.replace(/(\\\\|\\"|\\n|\\r|\\b|\\t|\\f|\\u2028|\\u2029|\\x3C)/g,vE)}var Bl="__SEROVAL_REFS__",l0=new Map,$a=new Map;function u0(e){return l0.has(e)}function bE(e){return $a.has(e)}function _E(e){if(u0(e))return l0.get(e);throw new XE(e)}function wE(e){if(bE(e))return $a.get(e);throw new ZE(e)}typeof globalThis<"u"?Object.defineProperty(globalThis,Bl,{value:$a,configurable:!0,writable:!1,enumerable:!1}):typeof window<"u"?Object.defineProperty(window,Bl,{value:$a,configurable:!0,writable:!1,enumerable:!1}):typeof self<"u"?Object.defineProperty(self,Bl,{value:$a,configurable:!0,writable:!1,enumerable:!1}):typeof global<"u"&&Object.defineProperty(global,Bl,{value:$a,configurable:!0,writable:!1,enumerable:!1});function Gf(e){return e instanceof EvalError?1:e instanceof RangeError?2:e instanceof ReferenceError?3:e instanceof SyntaxError?4:e instanceof TypeError?5:e instanceof URIError?6:0}function SE(e){let t=uE[Gf(e)];return e.name!==t?{name:e.name}:e.constructor.name!==t?{name:e.constructor.name}:{}}function c0(e,t){let s=SE(e),i=Object.getOwnPropertyNames(e);for(let l=0,u=i.length,c;l<u;l++)c=i[l],c!=="name"&&c!=="message"&&(c==="stack"?t&4&&(s=s||{},s[c]=e[c]):(s=s||{},s[c]=e[c]));return s}function h0(e){return Object.isFrozen(e)?3:Object.isSealed(e)?2:Object.isExtensible(e)?0:1}function EE(e){switch(e){case Number.POSITIVE_INFINITY:return pE;case Number.NEGATIVE_INFINITY:return gE}return e!==e?mE:Object.is(e,-0)?dE:je(0,R,e,R,R,R,R,R,R,R,R,R)}function f0(e){return je(1,R,as(e),R,R,R,R,R,R,R,R,R)}function TE(e){return je(3,R,""+e,R,R,R,R,R,R,R,R,R)}function RE(e){return je(4,e,R,R,R,R,R,R,R,R,R,R)}function AE(e,t){let s=t.valueOf();return je(5,e,s!==s?"":t.toISOString(),R,R,R,R,R,R,R,R,R)}function OE(e,t){return je(6,e,R,as(t.source),t.flags,R,R,R,R,R,R,R)}function xE(e,t){return je(17,e,a0[t],R,R,R,R,R,R,R,R,R)}function CE(e,t){return je(18,e,as(_E(t)),R,R,R,R,R,R,R,R,R)}function kE(e,t,s){return je(25,e,s,as(t),R,R,R,R,R,R,R,R)}function jE(e,t,s){return je(9,e,R,R,R,R,R,s,R,R,h0(t),R)}function ME(e,t){return je(21,e,R,R,R,R,R,R,t,R,R,R)}function NE(e,t,s){return je(15,e,R,t.constructor.name,R,R,R,R,s,t.byteOffset,R,t.length)}function DE(e,t,s){return je(16,e,R,t.constructor.name,R,R,R,R,s,t.byteOffset,R,t.byteLength)}function LE(e,t,s){return je(20,e,R,R,R,R,R,R,s,t.byteOffset,R,t.byteLength)}function UE(e,t,s){return je(13,e,Gf(t),R,as(t.message),s,R,R,R,R,R,R)}function zE(e,t,s){return je(14,e,Gf(t),R,as(t.message),s,R,R,R,R,R,R)}function PE(e,t){return je(7,e,R,R,R,R,R,t,R,R,R,R)}function BE(e,t){return je(28,R,R,R,R,R,R,[e,t],R,R,R,R)}function HE(e,t){return je(30,R,R,R,R,R,R,[e,t],R,R,R,R)}function IE(e,t,s){return je(31,e,R,R,R,R,R,s,t,R,R,R)}function qE(e,t){return je(32,e,R,R,R,R,R,R,t,R,R,R)}function $E(e,t){return je(33,e,R,R,R,R,R,R,t,R,R,R)}function VE(e,t){return je(34,e,R,R,R,R,R,R,t,R,R,R)}function GE(e,t,s,i){return je(35,e,s,R,R,R,R,t,R,R,R,i)}var KE={parsing:1,serialization:2,deserialization:3};function YE(e){return`Seroval Error (step: ${KE[e]})`}var FE=(e,t)=>YE(e),d0=class extends Error{constructor(e,t){super(FE(e)),this.cause=t}},Ey=class extends d0{constructor(e){super("parsing",e)}},QE=class extends d0{constructor(e){super("deserialization",e)}};function _r(e){return`Seroval Error (specific: ${e})`}var bu=class extends Error{constructor(t){super(_r(1)),this.value=t}},p0=class extends Error{constructor(t){super(_r(2))}},JE=class extends Error{constructor(e){super(_r(3))}},_o=class extends Error{constructor(e){super(_r(4))}},XE=class extends Error{constructor(e){super(_r(5)),this.value=e}},ZE=class extends Error{constructor(e){super(_r(6))}},WE=class extends Error{constructor(e){super(_r(7))}},os=class extends Error{constructor(e){super(_r(8))}},eT=class extends Error{constructor(t){super(_r(9))}},tT=class{constructor(e,t){this.value=e,this.replacement=t}},_u=()=>{let e={p:0,s:0,f:0};return e.p=new Promise((t,s)=>{e.s=t,e.f=s}),e},nT=(e,t)=>{e.s(t),e.p.s=1,e.p.v=t},rT=(e,t)=>{e.f(t),e.p.s=2,e.p.v=t};_u.toString();nT.toString();rT.toString();var sT=()=>{let e=[],t=[],s=!0,i=!1,l=0,u=(p,g,y)=>{for(y=0;y<l;y++)t[y]&&t[y][g](p)},c=(p,g,y,m)=>{for(g=0,y=e.length;g<y;g++)m=e[g],!s&&g===y-1?p[i?"return":"throw"](m):p.next(m)},f=(p,g)=>(s&&(g=l++,t[g]=p),c(p),()=>{s&&(t[g]=t[l],t[l--]=void 0)});return{__SEROVAL_STREAM__:!0,on:p=>f(p),next:p=>{s&&(e.push(p),u(p,"next"))},throw:p=>{s&&(e.push(p),u(p,"throw"),s=!1,i=!1,t.length=0)},return:p=>{s&&(e.push(p),u(p,"return"),s=!1,i=!0,t.length=0)}}},aT=e=>t=>()=>{let s=0,i={[e]:()=>i,next:()=>{if(s>t.d)return{done:!0,value:void 0};let l=s++,u=t.v[l];if(l===t.t)throw u;return{done:l===t.d,value:u}}};return i},iT=(e,t)=>s=>()=>{let i=0,l=-1,u=!1,c=[],f=[],p=(y=0,m=f.length)=>{for(;y<m;y++)f[y].s({done:!0,value:void 0})};s.on({next:y=>{let m=f.shift();m&&m.s({done:!1,value:y}),c.push(y)},throw:y=>{let m=f.shift();m&&m.f(y),p(),l=c.length,u=!0,c.push(y)},return:y=>{let m=f.shift();m&&m.s({done:!0,value:y}),p(),l=c.length,c.push(y)}});let g={[e]:()=>g,next:()=>{if(l===-1){let b=i++;if(b>=c.length){let _=t();return f.push(_),_.p}return{done:!1,value:c[b]}}if(i>l)return{done:!0,value:void 0};let y=i++,m=c[y];if(y!==l)return{done:!1,value:m};if(u)throw m;return{done:!0,value:m}}};return g},g0=e=>{let t=atob(e),s=t.length,i=new Uint8Array(s);for(let l=0;l<s;l++)i[l]=t.charCodeAt(l);return i.buffer};g0.toString();function oT(e){return"__SEROVAL_SEQUENCE__"in e}function m0(e,t,s){return{__SEROVAL_SEQUENCE__:!0,v:e,t,d:s}}function lT(e){let t=[],s=-1,i=-1,l=e[br]();for(;;)try{let u=l.next();if(t.push(u.value),u.done){i=t.length-1;break}}catch(u){s=t.length,t.push(u)}return m0(t,s,i)}var uT=aT(br);function cT(e){return uT(e)}var hT={},fT={},dT={0:{},1:{},2:{},3:{},4:{},5:{}};function wu(e){return"__SEROVAL_STREAM__"in e}function $s(){return sT()}function pT(e){let t=$s(),s=e[vr]();async function i(){try{let l=await s.next();l.done?t.return(l.value):(t.next(l.value),await i())}catch(l){t.throw(l)}}return i().catch(()=>{}),t}var gT=iT(vr,_u);function mT(e){return gT(e)}async function yT(e){try{return[1,await e]}catch(t){return[0,t]}}function vT(e,t){return{plugins:t.plugins,mode:e,marked:new Set,features:63^(t.disabledFeatures||0),refs:t.refs||new Map,depthLimit:t.depthLimit||1e3}}function eu(e,t){e.marked.add(t)}function bT(e,t){let s=e.refs.size;return e.refs.set(t,s),s}function Su(e,t){let s=e.refs.get(t);return s!=null?(eu(e,s),{type:1,value:RE(s)}):{type:0,value:bT(e,t)}}function Kf(e,t){let s=Su(e,t);return s.type===1?s:u0(t)?{type:2,value:CE(s.value,t)}:s}function zs(e,t){let s=Kf(e,t);if(s.type!==0)return s.value;if(t in a0)return xE(s.value,t);throw new bu(t)}function Eu(e,t){let s=Su(e,dT[t]);return s.type===1?s.value:je(26,s.value,t,R,R,R,R,R,R,R,R,R)}function _T(e){let t=Su(e,hT);return t.type===1?t.value:je(27,t.value,R,R,R,R,R,R,zs(e,br),R,R,R)}function wT(e){let t=Su(e,fT);return t.type===1?t.value:je(29,t.value,R,R,R,R,R,[Eu(e,1),zs(e,vr)],R,R,R,R)}function ST(e,t,s,i){return je(s?11:10,e,R,R,R,i,R,R,R,R,h0(t),R)}function ET(e,t,s,i){return je(8,t,R,R,R,R,{k:s,v:i},R,Eu(e,0),R,R,R)}function TT(e,t,s){let i=new Uint8Array(s),l="";for(let u=0,c=i.length;u<c;u++)l+=String.fromCharCode(i[u]);return je(19,t,as(btoa(l)),R,R,R,R,R,Eu(e,5),R,R,R)}function RT(e,t){return{base:vT(e,t),child:void 0}}var AT=class{constructor(e,t){this._p=e,this.depth=t}parse(e){return ut(this._p,this.depth,e)}};async function OT(e,t,s){let i=[];for(let l=0,u=s.length;l<u;l++)l in s?i[l]=await ut(e,t,s[l]):i[l]=0;return i}async function xT(e,t,s,i){return jE(s,i,await OT(e,t,i))}async function Yf(e,t,s){let i=Object.entries(s),l=[],u=[];for(let c=0,f=i.length;c<f;c++)l.push(as(i[c][0])),u.push(await ut(e,t,i[c][1]));return br in s&&(l.push(zs(e.base,br)),u.push(BE(_T(e.base),await ut(e,t,lT(s))))),vr in s&&(l.push(zs(e.base,vr)),u.push(HE(wT(e.base),await ut(e,t,pT(s))))),Fa in s&&(l.push(zs(e.base,Fa)),u.push(f0(s[Fa]))),Ya in s&&(l.push(zs(e.base,Ya)),u.push(s[Ya]?i0:o0)),{k:l,v:u}}async function Wh(e,t,s,i,l){return ST(s,i,l,await Yf(e,t,i))}async function CT(e,t,s,i){return ME(s,await ut(e,t,i.valueOf()))}async function kT(e,t,s,i){return NE(s,i,await ut(e,t,i.buffer))}async function jT(e,t,s,i){return DE(s,i,await ut(e,t,i.buffer))}async function MT(e,t,s,i){return LE(s,i,await ut(e,t,i.buffer))}async function Ty(e,t,s,i){let l=c0(i,e.base.features);return UE(s,i,l?await Yf(e,t,l):R)}async function NT(e,t,s,i){let l=c0(i,e.base.features);return zE(s,i,l?await Yf(e,t,l):R)}async function DT(e,t,s,i){let l=[],u=[];for(let[c,f]of i.entries())l.push(await ut(e,t,c)),u.push(await ut(e,t,f));return ET(e.base,s,l,u)}async function LT(e,t,s,i){let l=[];for(let u of i.keys())l.push(await ut(e,t,u));return PE(s,l)}async function y0(e,t,s,i){let l=e.base.plugins;if(l)for(let u=0,c=l.length;u<c;u++){let f=l[u];if(f.parse.async&&f.test(i))return kE(s,f.tag,await f.parse.async(i,new AT(e,t),{id:s}))}return R}async function UT(e,t,s,i){let[l,u]=await yT(i);return je(12,s,l,R,R,R,R,R,await ut(e,t,u),R,R,R)}function zT(e,t,s,i,l){let u=[],c=s.on({next:f=>{eu(this.base,t),ut(this,e,f).then(p=>{u.push(qE(t,p))},p=>{l(p),c()})},throw:f=>{eu(this.base,t),ut(this,e,f).then(p=>{u.push($E(t,p)),i(u),c()},p=>{l(p),c()})},return:f=>{eu(this.base,t),ut(this,e,f).then(p=>{u.push(VE(t,p)),i(u),c()},p=>{l(p),c()})}})}async function PT(e,t,s,i){return IE(s,Eu(e.base,4),await new Promise(zT.bind(e,t,s,i)))}async function BT(e,t,s,i){let l=[];for(let u=0,c=i.v.length;u<c;u++)l[u]=await ut(e,t,i.v[u]);return GE(s,l,i.t,i.d)}async function HT(e,t,s,i){if(Array.isArray(i))return xT(e,t,s,i);if(wu(i))return PT(e,t,s,i);if(oT(i))return BT(e,t,s,i);let l=i.constructor;if(l===tT)return ut(e,t,i.replacement);let u=await y0(e,t,s,i);if(u)return u;switch(l){case Object:return Wh(e,t,s,i,!1);case R:return Wh(e,t,s,i,!0);case Date:return AE(s,i);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return Ty(e,t,s,i);case Number:case Boolean:case String:case BigInt:return CT(e,t,s,i);case ArrayBuffer:return TT(e.base,s,i);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return kT(e,t,s,i);case DataView:return MT(e,t,s,i);case Map:return DT(e,t,s,i);case Set:return LT(e,t,s,i)}if(l===Promise||i instanceof Promise)return UT(e,t,s,i);let c=e.base.features;if(c&32&&l===RegExp)return OE(s,i);if(c&16)switch(l){case BigInt64Array:case BigUint64Array:return jT(e,t,s,i)}if(c&1&&typeof AggregateError<"u"&&(l===AggregateError||i instanceof AggregateError))return NT(e,t,s,i);if(i instanceof Error)return Ty(e,t,s,i);if(br in i||vr in i)return Wh(e,t,s,i,!!l);throw new bu(i)}async function IT(e,t,s){let i=Kf(e.base,s);if(i.type!==0)return i.value;let l=await y0(e,t,i.value,s);if(l)return l;throw new bu(s)}async function ut(e,t,s){switch(typeof s){case"boolean":return s?i0:o0;case"undefined":return hE;case"string":return f0(s);case"number":return EE(s);case"bigint":return TE(s);case"object":{if(s){let i=Kf(e.base,s);return i.type===0?await HT(e,t+1,i.value,s):i.value}return fE}case"symbol":return zs(e.base,s);case"function":return IT(e,t,s);default:throw new bu(s)}}async function qT(e,t){try{return await ut(e,0,t)}catch(s){throw s instanceof Ey?s:new Ey(s)}}var $T=(e=>(e[e.Vanilla=1]="Vanilla",e[e.Cross=2]="Cross",e))($T||{});function v0(e,t){for(let s=0,i=t.length;s<i;s++){let l=t[s];e.has(l)||(e.add(l),l.extends&&v0(e,l.extends))}}function b0(e){if(e){let t=new Set;return v0(t,e),[...t]}}function VT(e){switch(e){case"Int8Array":return Int8Array;case"Int16Array":return Int16Array;case"Int32Array":return Int32Array;case"Uint8Array":return Uint8Array;case"Uint16Array":return Uint16Array;case"Uint32Array":return Uint32Array;case"Uint8ClampedArray":return Uint8ClampedArray;case"Float32Array":return Float32Array;case"Float64Array":return Float64Array;case"BigInt64Array":return BigInt64Array;case"BigUint64Array":return BigUint64Array;default:throw new WE(e)}}var GT=1e6,KT=1e4,YT=2e4;function _0(e,t){switch(t){case 3:return Object.freeze(e);case 1:return Object.preventExtensions(e);case 2:return Object.seal(e);default:return e}}var FT=1e3;function QT(e,t){var s;return{mode:e,plugins:t.plugins,refs:t.refs||new Map,features:(s=t.features)!=null?s:63^(t.disabledFeatures||0),depthLimit:t.depthLimit||FT}}function JT(e){return{mode:2,base:QT(2,e),child:R}}var XT=class{constructor(e,t){this._p=e,this.depth=t}deserialize(e){return Ie(this._p,this.depth,e)}};function w0(e,t){if(t<0||!Number.isFinite(t)||!Number.isInteger(t))throw new os({t:4,i:t});if(e.refs.has(t))throw new Error("Conflicted ref id: "+t)}function ZT(e,t,s){return w0(e.base,t),e.state.marked.has(t)&&e.base.refs.set(t,s),s}function WT(e,t,s){return w0(e.base,t),e.base.refs.set(t,s),s}function ct(e,t,s){return e.mode===1?ZT(e,t,s):WT(e,t,s)}function vf(e,t,s){if(Object.hasOwn(t,s))return t[s];throw new os(e)}function e1(e,t){return ct(e,t.i,wE(is(t.s)))}function t1(e,t,s){let i=s.a,l=i.length,u=ct(e,s.i,new Array(l));for(let c=0,f;c<l;c++)f=i[c],f&&(u[c]=Ie(e,t,f));return _0(u,s.o),u}function n1(e){switch(e){case"constructor":case"__proto__":case"prototype":case"__defineGetter__":case"__defineSetter__":case"__lookupGetter__":case"__lookupSetter__":return!1;default:return!0}}function r1(e){switch(e){case vr:case Ya:case Fa:case br:return!0;default:return!1}}function Ry(e,t,s){n1(t)?e[t]=s:Object.defineProperty(e,t,{value:s,configurable:!0,enumerable:!0,writable:!0})}function s1(e,t,s,i,l){if(typeof i=="string")Ry(s,is(i),Ie(e,t,l));else{let u=Ie(e,t,i);switch(typeof u){case"string":Ry(s,u,Ie(e,t,l));break;case"symbol":r1(u)&&(s[u]=Ie(e,t,l));break;default:throw new os(i)}}}function S0(e,t,s,i){let l=s.k;if(l.length>0)for(let u=0,c=s.v,f=l.length;u<f;u++)s1(e,t,i,l[u],c[u]);return i}function a1(e,t,s){let i=ct(e,s.i,s.t===10?{}:Object.create(null));return S0(e,t,s.p,i),_0(i,s.o),i}function i1(e,t){return ct(e,t.i,new Date(t.s))}function o1(e,t){if(e.base.features&32){let s=is(t.c);if(s.length>YT)throw new os(t);return ct(e,t.i,new RegExp(s,t.m))}throw new p0(t)}function l1(e,t,s){let i=ct(e,s.i,new Set);for(let l=0,u=s.a,c=u.length;l<c;l++)i.add(Ie(e,t,u[l]));return i}function u1(e,t,s){let i=ct(e,s.i,new Map);for(let l=0,u=s.e.k,c=s.e.v,f=u.length;l<f;l++)i.set(Ie(e,t,u[l]),Ie(e,t,c[l]));return i}function c1(e,t){if(t.s.length>GT)throw new os(t);return ct(e,t.i,g0(is(t.s)))}function h1(e,t,s){var i;let l=VT(s.c),u=Ie(e,t,s.f),c=(i=s.b)!=null?i:0;if(c<0||c>u.byteLength)throw new os(s);return ct(e,s.i,new l(u,c,s.l))}function f1(e,t,s){var i;let l=Ie(e,t,s.f),u=(i=s.b)!=null?i:0;if(u<0||u>l.byteLength)throw new os(s);return ct(e,s.i,new DataView(l,u,s.l))}function E0(e,t,s,i){if(s.p){let l=S0(e,t,s.p,{});Object.defineProperties(i,Object.getOwnPropertyDescriptors(l))}return i}function d1(e,t,s){let i=ct(e,s.i,new AggregateError([],is(s.m)));return E0(e,t,s,i)}function p1(e,t,s){let i=vf(s,cE,s.s),l=ct(e,s.i,new i(is(s.m)));return E0(e,t,s,l)}function g1(e,t,s){let i=_u(),l=ct(e,s.i,i.p),u=Ie(e,t,s.f);return s.s?i.s(u):i.f(u),l}function m1(e,t,s){return ct(e,s.i,Object(Ie(e,t,s.f)))}function y1(e,t,s){let i=e.base.plugins;if(i){let l=is(s.c);for(let u=0,c=i.length;u<c;u++){let f=i[u];if(f.tag===l)return ct(e,s.i,f.deserialize(s.s,new XT(e,t),{id:s.i}))}}throw new JE(s.c)}function v1(e,t){return ct(e,t.i,ct(e,t.s,_u()).p)}function b1(e,t,s){let i=e.base.refs.get(s.i);if(i)return i.s(Ie(e,t,s.a[1])),R;throw new _o("Promise")}function _1(e,t,s){let i=e.base.refs.get(s.i);if(i)return i.f(Ie(e,t,s.a[1])),R;throw new _o("Promise")}function w1(e,t,s){Ie(e,t,s.a[0]);let i=Ie(e,t,s.a[1]);return cT(i)}function S1(e,t,s){Ie(e,t,s.a[0]);let i=Ie(e,t,s.a[1]);return mT(i)}function E1(e,t,s){let i=ct(e,s.i,$s()),l=s.a,u=l.length;if(u)for(let c=0;c<u;c++)Ie(e,t,l[c]);return i}function T1(e,t,s){let i=e.base.refs.get(s.i);if(i&&wu(i))return i.next(Ie(e,t,s.f)),R;throw new _o("Stream")}function R1(e,t,s){let i=e.base.refs.get(s.i);if(i&&wu(i))return i.throw(Ie(e,t,s.f)),R;throw new _o("Stream")}function A1(e,t,s){let i=e.base.refs.get(s.i);if(i&&wu(i))return i.return(Ie(e,t,s.f)),R;throw new _o("Stream")}function O1(e,t,s){return Ie(e,t,s.f),R}function x1(e,t,s){return Ie(e,t,s.a[1]),R}function C1(e,t,s){let i=ct(e,s.i,m0([],s.s,s.l));for(let l=0,u=s.a.length;l<u;l++)i.v[l]=Ie(e,t,s.a[l]);return i}function Ie(e,t,s){if(t>e.base.depthLimit)throw new eT(e.base.depthLimit);switch(t+=1,s.t){case 2:return vf(s,lE,s.s);case 0:return Number(s.s);case 1:return is(String(s.s));case 3:if(String(s.s).length>KT)throw new os(s);return BigInt(s.s);case 4:return e.base.refs.get(s.i);case 18:return e1(e,s);case 9:return t1(e,t,s);case 10:case 11:return a1(e,t,s);case 5:return i1(e,s);case 6:return o1(e,s);case 7:return l1(e,t,s);case 8:return u1(e,t,s);case 19:return c1(e,s);case 16:case 15:return h1(e,t,s);case 20:return f1(e,t,s);case 14:return d1(e,t,s);case 13:return p1(e,t,s);case 12:return g1(e,t,s);case 17:return vf(s,oE,s.s);case 21:return m1(e,t,s);case 25:return y1(e,t,s);case 22:return v1(e,s);case 23:return b1(e,t,s);case 24:return _1(e,t,s);case 28:return w1(e,t,s);case 30:return S1(e,t,s);case 31:return E1(e,t,s);case 32:return T1(e,t,s);case 33:return R1(e,t,s);case 34:return A1(e,t,s);case 27:return O1(e,t,s);case 29:return x1(e,t,s);case 35:return C1(e,t,s);default:throw new p0(s)}}function k1(e,t){try{return Ie(e,0,t)}catch(s){throw new QE(s)}}var j1=()=>T;j1.toString();function Ay(e,t){let s=b0(t.plugins),i=JT({plugins:s,refs:t.refs,features:t.features,disabledFeatures:t.disabledFeatures,depthLimit:t.depthLimit});return k1(i,e)}async function M1(e,t={}){let s=b0(t.plugins),i=RT(1,{plugins:s,disabledFeatures:t.disabledFeatures});return{t:await qT(i,e),f:i.base.features,m:Array.from(i.base.marked)}}function N1(e){return{tag:"$TSR/t/"+e.key,test:e.test,parse:{sync(t,s,i){return{v:s.parse(e.toSerializable(t))}},async async(t,s,i){return{v:await s.parse(e.toSerializable(t))}},stream(t,s,i){return{v:s.parse(e.toSerializable(t))}}},serialize:void 0,deserialize(t,s,i){return e.fromSerializable(s.deserialize(t.v))}}}var D1=class{constructor(e,t){this.stream=e,this.hint=t?.hint??"binary"}},ou=globalThis.Buffer,T0=!!ou&&typeof ou.from=="function";function R0(e){if(e.length===0)return"";if(T0)return ou.from(e).toString("base64");const t=32768,s=[];for(let i=0;i<e.length;i+=t){const l=e.subarray(i,i+t);s.push(String.fromCharCode.apply(null,l))}return btoa(s.join(""))}function A0(e){if(e.length===0)return new Uint8Array(0);if(T0){const i=ou.from(e,"base64");return new Uint8Array(i.buffer,i.byteOffset,i.byteLength)}const t=atob(e),s=new Uint8Array(t.length);for(let i=0;i<t.length;i++)s[i]=t.charCodeAt(i);return s}var Fi=Object.create(null),Qi=Object.create(null),L1=e=>new ReadableStream({start(t){e.on({next(s){try{t.enqueue(A0(s))}catch{}},throw(s){t.error(s)},return(){try{t.close()}catch{}}})}}),U1=new TextEncoder,z1=e=>new ReadableStream({start(t){e.on({next(s){try{typeof s=="string"?t.enqueue(U1.encode(s)):t.enqueue(A0(s.$b64))}catch{}},throw(s){t.error(s)},return(){try{t.close()}catch{}}})}}),P1="(s=>new ReadableStream({start(c){s.on({next(b){try{const d=atob(b),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}catch(_){}},throw(e){c.error(e)},return(){try{c.close()}catch(_){}}})}}))",B1="(s=>{const e=new TextEncoder();return new ReadableStream({start(c){s.on({next(v){try{if(typeof v==='string'){c.enqueue(e.encode(v))}else{const d=atob(v.$b64),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}}catch(_){}},throw(x){c.error(x)},return(){try{c.close()}catch(_){}}})}})})";function Oy(e){const t=$s(),s=e.getReader();return(async()=>{try{for(;;){const{done:i,value:l}=await s.read();if(i){t.return(void 0);break}t.next(R0(l))}}catch(i){t.throw(i)}finally{s.releaseLock()}})(),t}function xy(e){const t=$s(),s=e.getReader(),i=new TextDecoder("utf-8",{fatal:!0});return(async()=>{try{for(;;){const{done:l,value:u}=await s.read();if(l){try{const c=i.decode();c.length>0&&t.next(c)}catch{}t.return(void 0);break}try{const c=i.decode(u,{stream:!0});c.length>0&&t.next(c)}catch{t.next({$b64:R0(u)})}}}catch(l){t.throw(l)}finally{s.releaseLock()}})(),t}var H1={tag:"tss/RawStream",extends:[{tag:"tss/RawStreamFactory",test(e){return e===Fi},parse:{sync(e,t,s){return{}},async async(e,t,s){return{}},stream(e,t,s){return{}}},serialize(e,t,s){return P1},deserialize(e,t,s){return Fi}},{tag:"tss/RawStreamFactoryText",test(e){return e===Qi},parse:{sync(e,t,s){return{}},async async(e,t,s){return{}},stream(e,t,s){return{}}},serialize(e,t,s){return B1},deserialize(e,t,s){return Qi}}],test(e){return e instanceof D1},parse:{sync(e,t,s){const i=e.hint==="text"?Qi:Fi;return{hint:t.parse(e.hint),factory:t.parse(i),stream:t.parse($s())}},async async(e,t,s){const i=e.hint==="text"?Qi:Fi,l=e.hint==="text"?xy(e.stream):Oy(e.stream);return{hint:await t.parse(e.hint),factory:await t.parse(i),stream:await t.parse(l)}},stream(e,t,s){const i=e.hint==="text"?Qi:Fi,l=e.hint==="text"?xy(e.stream):Oy(e.stream);return{hint:t.parse(e.hint),factory:t.parse(i),stream:t.parse(l)}}},serialize(e,t,s){return"("+t.serialize(e.factory)+")("+t.serialize(e.stream)+")"},deserialize(e,t,s){const i=t.deserialize(e.stream);return t.deserialize(e.hint)==="text"?z1(i):L1(i)}};function I1(e){return{tag:"tss/RawStream",test:()=>!1,parse:{},serialize(){throw new Error("RawStreamDeserializePlugin.serialize should not be called. Client only deserializes.")},deserialize(t,s,i){return e(typeof s?.deserialize=="function"?s.deserialize(t.streamId):t.streamId)}}}var q1={tag:"$TSR/Error",test(e){return e instanceof Error},parse:{sync(e,t){return{message:t.parse(e.message)}},async async(e,t){return{message:await t.parse(e.message)}},stream(e,t){return{message:t.parse(e.message)}}},serialize(e,t){return"new Error("+t.serialize(e.message)+")"},deserialize(e,t){return new Error(t.deserialize(e.message))}},Jr={},O0=e=>new ReadableStream({start:t=>{e.on({next:s=>{try{t.enqueue(s)}catch{}},throw:s=>{t.error(s)},return:()=>{try{t.close()}catch{}}})}}),$1={tag:"seroval-plugins/web/ReadableStreamFactory",test(e){return e===Jr},parse:{sync(){return Jr},async async(){return await Promise.resolve(Jr)},stream(){return Jr}},serialize(){return O0.toString()},deserialize(){return Jr}};function Cy(e){let t=$s(),s=e.getReader();async function i(){try{let l=await s.read();l.done?t.return(l.value):(t.next(l.value),await i())}catch(l){t.throw(l)}}return i().catch(()=>{}),t}var V1={tag:"seroval/plugins/web/ReadableStream",extends:[$1],test(e){return typeof ReadableStream>"u"?!1:e instanceof ReadableStream},parse:{sync(e,t){return{factory:t.parse(Jr),stream:t.parse($s())}},async async(e,t){return{factory:await t.parse(Jr),stream:await t.parse(Cy(e))}},stream(e,t){return{factory:t.parse(Jr),stream:t.parse(Cy(e))}}},serialize(e,t){return"("+t.serialize(e.factory)+")("+t.serialize(e.stream)+")"},deserialize(e,t){let s=t.deserialize(e.stream);return O0(s)}},G1=V1,K1=[q1,H1,G1];function Y1(){return[...Uv()?.serializationAdapters?.map(N1)??[],...K1]}var ky=new TextDecoder,F1=new Uint8Array(0),jy=16*1024*1024,My=32*1024*1024,Ny=1024,Dy=1e5;function Q1(e){const t=new Map,s=new Map,i=new Set;let l=!1,u=null,c=0,f;const p=new ReadableStream({start(m){f=m},cancel(){l=!0;try{u?.cancel()}catch{}t.forEach(m=>{try{m.error(new Error("Framed response cancelled"))}catch{}}),t.clear(),s.clear(),i.clear()}});function g(m){const b=s.get(m);if(b)return b;if(i.has(m))return new ReadableStream({start(S){S.close()}});if(s.size>=Ny)throw new Error(`Too many raw streams in framed response (max ${Ny})`);const _=new ReadableStream({start(S){t.set(m,S)},cancel(){i.add(m),t.delete(m),s.delete(m)}});return s.set(m,_),_}function y(m){return g(m),t.get(m)}return(async()=>{const m=e.getReader();u=m;const b=[];let _=0;function S(){if(_<9)return null;const E=b[0];if(E.length>=9)return{type:E[0],streamId:(E[1]<<24|E[2]<<16|E[3]<<8|E[4])>>>0,length:(E[5]<<24|E[6]<<16|E[7]<<8|E[8])>>>0};const A=new Uint8Array(9);let M=0,j=9;for(let D=0;D<b.length&&j>0;D++){const X=b[D],K=Math.min(X.length,j);A.set(X.subarray(0,K),M),M+=K,j-=K}return{type:A[0],streamId:(A[1]<<24|A[2]<<16|A[3]<<8|A[4])>>>0,length:(A[5]<<24|A[6]<<16|A[7]<<8|A[8])>>>0}}function O(E){if(E===0)return F1;const A=new Uint8Array(E);let M=0,j=E;for(;j>0&&b.length>0;){const D=b[0];if(!D)break;const X=Math.min(D.length,j);A.set(D.subarray(0,X),M),M+=X,j-=X,X===D.length?b.shift():b[0]=D.subarray(X)}return _-=E,A}try{for(;;){const{done:E,value:A}=await m.read();if(l||E)break;if(A){if(_+A.length>My)throw new Error(`Framed response buffer exceeded ${My} bytes`);for(b.push(A),_+=A.length;;){const M=S();if(!M)break;const{type:j,streamId:D,length:X}=M;if(j!==pr.JSON&&j!==pr.CHUNK&&j!==pr.END&&j!==pr.ERROR)throw new Error(`Unknown frame type: ${j}`);if(j===pr.JSON){if(D!==0)throw new Error("Invalid JSON frame streamId (expected 0)")}else if(D===0)throw new Error("Invalid raw frame streamId (expected non-zero)");if(X>jy)throw new Error(`Frame payload too large: ${X} bytes (max ${jy})`);const K=9+X;if(_<K)break;if(++c>Dy)throw new Error(`Too many frames in framed response (max ${Dy})`);O(9);const H=O(X);switch(j){case pr.JSON:try{f.enqueue(ky.decode(H))}catch{}break;case pr.CHUNK:{const Y=y(D);Y&&Y.enqueue(H);break}case pr.END:{const Y=y(D);if(i.add(D),Y){try{Y.close()}catch{}t.delete(D)}break}case pr.ERROR:{const Y=y(D);if(i.add(D),Y){const Z=ky.decode(H);Y.error(new Error(Z)),t.delete(D)}break}}}}}if(_!==0)throw new Error("Incomplete frame at end of framed response");try{f.close()}catch{}t.forEach(E=>{try{E.close()}catch{}}),t.clear()}catch(E){try{f.error(E)}catch{}t.forEach(A=>{try{A.error(E)}catch{}}),t.clear()}finally{try{m.releaseLock()}catch{}u=null}})(),{getOrCreateStream:g,jsonChunks:p}}var lo=null;async function bf(e){e.length>0&&await Promise.allSettled(e)}var J1=Object.prototype.hasOwnProperty;function x0(e){for(const t in e)if(J1.call(e,t))return!0;return!1}async function X1(e,t,s){lo||(lo=Y1());const i=t[0],l=i.fetch??s,u=i.data instanceof FormData?"formData":"payload",c=i.headers?new Headers(i.headers):new Headers;if(c.set("x-tsr-serverFn","true"),u==="payload"&&c.set("accept",`${Kw}, application/x-ndjson, application/json`),i.method==="GET"){if(u==="formData")throw new Error("FormData is not supported with GET requests");const p=await C0(i);if(p!==void 0){const g=qv({payload:p});e.includes("?")?e+=`&${g}`:e+=`?${g}`}}let f;if(i.method==="POST"){const p=await Z1(i);p?.contentType&&c.set("content-type",p.contentType),f=p?.body}return await W1(async()=>l(e,{method:i.method,headers:c,signal:i.signal,body:f}))}async function C0(e){let t=!1;const s={};if(e.data!==void 0&&(t=!0,s.data=e.data),e.context&&x0(e.context)&&(t=!0,s.context=e.context),t)return k0(s)}async function k0(e){return JSON.stringify(await Promise.resolve(M1(e,{plugins:lo})))}async function Z1(e){if(e.data instanceof FormData){let s;return e.context&&x0(e.context)&&(s=await k0(e.context)),s!==void 0&&e.data.set(Gw,s),{body:e.data}}const t=await C0(e);if(t)return{body:t,contentType:"application/json"}}async function W1(e){let t;try{t=await e()}catch(i){if(i instanceof Response)t=i;else throw console.log(i),i}if(t.headers.get("x-tss-raw")==="true")return t;const s=t.headers.get("content-type");if(s||Xt(),t.headers.get("x-tss-serialized")){let i;if(s.includes("application/x-tss-framed")){if(Qw(s),!t.body)throw new Error("No response body for framed response");const{getOrCreateStream:l,jsonChunks:u}=Q1(t.body),c=[I1(l),...lo||[]],f=new Map;i=await eR({jsonStream:u,onMessage:p=>Ay(p,{refs:f,plugins:c}),onError(p,g){console.error(p,g)}})}else if(s.includes("application/json")){const l=await t.json(),u=[];i=Ay(l,{plugins:lo}),await bf(u)}if(i||Xt(),i instanceof Error)throw i;return i}if(s.includes("application/json")){const i=await t.json(),l=MS(i);if(l)throw l;if(yt(i))throw i;return i}if(!t.ok)throw new Error(await t.text());return t}async function eR({jsonStream:e,onMessage:t,onError:s}){const i=e.getReader(),{value:l,done:u}=await i.read();if(u||!l)throw new Error("Stream ended before first object");const c=JSON.parse(l);let f=!1;const p=(async()=>{try{for(;;){const{value:m,done:b}=await i.read();if(b)break;if(m)try{const _=[];try{t(JSON.parse(m))}finally{}await bf(_)}catch(_){s?.(`Invalid JSON: ${m}`,_)}}}catch(m){f||s?.("Stream processing error:",m)}})();let g;const y=[];try{g=t(c)}catch(m){throw f=!0,i.cancel().catch(()=>{}),m}return await bf(y),Promise.resolve(g).catch(()=>{f=!0,i.cancel().catch(()=>{})}),p.finally(()=>{try{i.releaseLock()}catch{}}),g}function tR(e){const t="/_serverFn/"+e;return Object.assign((...l)=>{const u=Uv()?.serverFns?.fetch;return X1(t,l,u??fetch)},{url:t,serverFnMeta:{id:e},[gf]:!0})}var nR={key:"$TSS/serverfn",test:e=>typeof e!="function"||!(gf in e)?!1:!!e[gf],toSerializable:({serverFnMeta:e})=>({functionId:e.id}),fromSerializable:({functionId:e})=>tR(e)};function Ly(e){return e.replaceAll("\0","/").replaceAll("�","/")}function rR(e,t){e.id=t.i,e.__beforeLoadContext=t.b,e.loaderData=t.l,e.status=t.s,e.ssr=t.ssr,e.updatedAt=t.u,e.error=t.e,t.g!==void 0&&(e.globalNotFound=t.g)}async function sR(e){window.$_TSR||Xt();const t=e.options.serializationAdapters;if(t?.length){const E=new Map;t.forEach(A=>{E.set(A.key,A.fromSerializable)}),window.$_TSR.t=E,window.$_TSR.buffer.forEach(A=>A())}window.$_TSR.initialized=!0,window.$_TSR.router||Xt();const s=window.$_TSR.router;s.matches.forEach(E=>{E.i=Ly(E.i)}),s.lastMatchId&&(s.lastMatchId=Ly(s.lastMatchId));const{manifest:i,dehydratedData:l,lastMatchId:u}=s;e.ssr={manifest:i};const c=document.querySelector('meta[property="csp-nonce"]')?.content;e.options.ssr={nonce:c};const f=e.matchRoutes(e.stores.location.get()),p=Promise.all(f.map(E=>e.loadRouteChunk(e.looseRoutesById[E.routeId])));function g(E){const A=e.looseRoutesById[E.routeId].options.pendingMinMs??e.options.defaultPendingMinMs;if(A){const M=qs();E._nonReactive.minPendingPromise=M,E._forcePending=!0,setTimeout(()=>{M.resolve(),e.updateMatch(E.id,j=>(j._nonReactive.minPendingPromise=void 0,{...j,_forcePending:void 0}))},A)}}function y(E){const A=e.looseRoutesById[E.routeId];A&&(A.options.ssr=E.ssr)}let m;f.forEach(E=>{const A=s.matches.find(M=>M.i===E.id);if(!A){E._nonReactive.dehydrated=!1,E.ssr=!1,y(E);return}rR(E,A),y(E),E._nonReactive.dehydrated=E.ssr!==!1,(E.ssr==="data-only"||E.ssr===!1)&&m===void 0&&(m=E.index,g(E))}),e.stores.setMatches(f),await e.options.hydrate?.(l);const b=e.stores.matches.get(),_=e.stores.location.get();await Promise.all(b.map(async E=>{try{const A=e.looseRoutesById[E.routeId],M=b[E.index-1]?.context??e.options.context;if(A.options.context){const K={deps:E.loaderDeps,params:E.params,context:M??{},location:_,navigate:H=>e.navigate({...H,_fromLocation:_}),buildLocation:e.buildLocation,cause:E.cause,abortController:E.abortController,preload:!1,matches:f,routeId:A.id};E.__routeContext=A.options.context(K)??void 0}E.context={...M,...E.__routeContext,...E.__beforeLoadContext};const j={ssr:e.options.ssr,matches:b,match:E,params:E.params,loaderData:E.loaderData},D=await A.options.head?.(j),X=await A.options.scripts?.(j);E.meta=D?.meta,E.links=D?.links,E.headScripts=D?.scripts,E.styles=D?.styles,E.scripts=X}catch(A){if(yt(A))E.error={isNotFound:!0},console.error(`NotFound error during hydration for routeId: ${E.routeId}`,A);else throw E.error=A,console.error(`Error during hydration for route ${E.routeId}:`,A),A}}));const S=f[f.length-1].id!==u;if(!f.some(E=>E.ssr===!1)&&!S)return f.forEach(E=>{E._nonReactive.dehydrated=void 0}),e.stores.resolvedLocation.set(e.stores.location.get()),p;const O=Promise.resolve().then(()=>e.load()).catch(E=>{console.error("Error during router hydration:",E)});if(S){const E=f[1];E||Xt(),g(E),E._displayPending=!0,E._nonReactive.displayPendingPromise=O,O.then(()=>{e.batch(()=>{e.stores.status.get()==="pending"&&(e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())),e.updateMatch(E.id,A=>({...A,_displayPending:void 0,displayPendingPromise:void 0}))})})}return p}var lu=ne.use,Zi=typeof window<"u"?ne.useLayoutEffect:ne.useEffect;function ef(e){const t=ne.useRef({value:e,prev:null}),s=t.current.value;return e!==s&&(t.current={value:e,prev:s}),t.current.prev}function aR(e,t,s={},i={}){ne.useEffect(()=>{if(!e.current||i.disabled||typeof IntersectionObserver!="function")return;const l=new IntersectionObserver(([u])=>{t(u)},s);return l.observe(e.current),()=>{l.disconnect()}},[t,s,i.disabled,e])}function iR(e){const t=ne.useRef(null);return ne.useImperativeHandle(e,()=>t.current,[]),t}function oR({promise:e}){if(lu)return lu(e);const t=WS(e);if(t[Gn].status==="pending")throw t;if(t[Gn].status==="error")throw t[Gn].error;return t[Gn].data}function lR(e){const t=J.jsx(uR,{...e});return e.fallback?J.jsx(ne.Suspense,{fallback:e.fallback,children:t}):t}function uR(e){const t=oR(e);return e.children(t)}function Ff(e){const t=e.errorComponent??Qf;return J.jsx(cR,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:i})=>s?ne.createElement(t,{error:s,reset:i}):e.children})}var cR=class extends ne.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const s=e.getResetKey();return t.error&&t.resetKey!==s?{resetKey:s,error:null}:{resetKey:s}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Qf({error:e}){const[t,s]=ne.useState(!1);return J.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[J.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[J.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),J.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(i=>!i),children:t?"Hide Error":"Show Error"})]}),J.jsx("div",{style:{height:".25rem"}}),t?J.jsx("div",{children:J.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?J.jsx("code",{children:e.message}):null})}):null]})}function hR({children:e,fallback:t=null}){return Jf()?J.jsx(W.Fragment,{children:e}):J.jsx(W.Fragment,{children:t})}function Jf(){return W.useSyncExternalStore(fR,()=>!0,()=>!1)}function fR(){return()=>{}}var j0=ne.createContext(null);function vt(e){return ne.useContext(j0)}var Tu=ne.createContext(void 0),dR=ne.createContext(void 0),Fe=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Fe||{});function pR({update:e,notify:t,unwatched:s}){return{link:i,unlink:l,propagate:u,checkDirty:c,shallowPropagate:f};function i(g,y,m){const b=y.depsTail;if(b!==void 0&&b.dep===g)return;const _=b!==void 0?b.nextDep:y.deps;if(_!==void 0&&_.dep===g){_.version=m,y.depsTail=_;return}const S=g.subsTail;if(S!==void 0&&S.version===m&&S.sub===y)return;const O=y.depsTail=g.subsTail={version:m,dep:g,sub:y,prevDep:b,nextDep:_,prevSub:S,nextSub:void 0};_!==void 0&&(_.prevDep=O),b!==void 0?b.nextDep=O:y.deps=O,S!==void 0?S.nextSub=O:g.subs=O}function l(g,y=g.sub){const m=g.dep,b=g.prevDep,_=g.nextDep,S=g.nextSub,O=g.prevSub;return _!==void 0?_.prevDep=b:y.depsTail=b,b!==void 0?b.nextDep=_:y.deps=_,S!==void 0?S.prevSub=O:m.subsTail=O,O!==void 0?O.nextSub=S:(m.subs=S)===void 0&&s(m),_}function u(g){let y=g.nextSub,m;e:do{const b=g.sub;let _=b.flags;if(_&60?_&12?_&4?!(_&48)&&p(g,b)?(b.flags=_|40,_&=1):_=0:b.flags=_&-9|32:_=0:b.flags=_|32,_&2&&t(b),_&1){const S=b.subs;if(S!==void 0){const O=(g=S).nextSub;O!==void 0&&(m={value:y,prev:m},y=O);continue}}if((g=y)!==void 0){y=g.nextSub;continue}for(;m!==void 0;)if(g=m.value,m=m.prev,g!==void 0){y=g.nextSub;continue e}break}while(!0)}function c(g,y){let m,b=0,_=!1;e:do{const S=g.dep,O=S.flags;if(y.flags&16)_=!0;else if((O&17)===17){if(e(S)){const E=S.subs;E.nextSub!==void 0&&f(E),_=!0}}else if((O&33)===33){(g.nextSub!==void 0||g.prevSub!==void 0)&&(m={value:g,prev:m}),g=S.deps,y=S,++b;continue}if(!_){const E=g.nextDep;if(E!==void 0){g=E;continue}}for(;b--;){const E=y.subs,A=E.nextSub!==void 0;if(A?(g=m.value,m=m.prev):g=E,_){if(e(y)){A&&f(E),y=g.sub;continue}_=!1}else y.flags&=-33;y=g.sub;const M=g.nextDep;if(M!==void 0){g=M;continue e}}return _}while(!0)}function f(g){do{const y=g.sub,m=y.flags;(m&48)===32&&(y.flags=m|16,(m&6)===2&&t(y))}while((g=g.nextSub)!==void 0)}function p(g,y){let m=y.depsTail;for(;m!==void 0;){if(m===g)return!0;m=m.prevDep}return!1}}function gR(e,t,s){const i=typeof e=="object",l=i?e:void 0;return{next:(i?e.next:e)?.bind(l),error:(i?e.error:t)?.bind(l),complete:(i?e.complete:s)?.bind(l)}}const _f=[];let tu=0;const{link:Uy,unlink:mR,propagate:yR,checkDirty:M0,shallowPropagate:zy}=pR({update(e){return e._update()},notify(e){_f[wf++]=e,e.flags&=~Fe.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Fe.Mutable|Fe.Dirty,uu(e))}});let Hl=0,wf=0,$n,Sf=0;function N0(e){try{++Sf,e()}finally{--Sf||D0()}}function uu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=mR(s,e)}function D0(){if(!(Sf>0)){for(;Hl<wf;){const e=_f[Hl];_f[Hl++]=void 0,e.notify()}Hl=0,wf=0}}function Py(e,t){const s=typeof e=="function",i=e,l={_snapshot:s?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:s?Fe.None:Fe.Mutable,get(){return $n!==void 0&&Uy(l,$n,tu),l._snapshot},subscribe(u){const c=gR(u),f={current:!1},p=vR(()=>{l.get(),f.current?c.next?.(l._snapshot):f.current=!0});return{unsubscribe:()=>{p.stop()}}},_update(u){const c=$n,f=t?.compare??Object.is;if(s)$n=l,++tu,l.depsTail=void 0;else if(u===void 0)return!1;s&&(l.flags=Fe.Mutable|Fe.RecursedCheck);try{const p=l._snapshot,g=typeof u=="function"?u(p):u===void 0&&s?i(p):u;return p===void 0||!f(p,g)?(l._snapshot=g,!0):!1}finally{$n=c,s&&(l.flags&=~Fe.RecursedCheck),uu(l)}}};return s?(l.flags=Fe.Mutable|Fe.Dirty,l.get=function(){const u=l.flags;if(u&Fe.Dirty||u&Fe.Pending&&M0(l.deps,l)){if(l._update()){const c=l.subs;c!==void 0&&zy(c)}}else u&Fe.Pending&&(l.flags=u&~Fe.Pending);return $n!==void 0&&Uy(l,$n,tu),l._snapshot}):l.set=function(u){if(l._update(u)){const c=l.subs;c!==void 0&&(yR(c),zy(c),D0())}},l}function vR(e){const t=()=>{const i=$n;$n=s,++tu,s.depsTail=void 0,s.flags=Fe.Watching|Fe.RecursedCheck;try{return e()}finally{$n=i,s.flags&=~Fe.RecursedCheck,uu(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Fe.Watching|Fe.RecursedCheck,notify(){const i=this.flags;i&Fe.Dirty||i&Fe.Pending&&M0(this.deps,this)?t():this.flags=Fe.Watching},stop(){this.flags=Fe.None,this.depsTail=void 0,uu(this)}};return t(),s}var tf={exports:{}},nf={},rf={exports:{}},sf={};var By;function bR(){if(By)return sf;By=1;var e=bo();function t(m,b){return m===b&&(m!==0||1/m===1/b)||m!==m&&b!==b}var s=typeof Object.is=="function"?Object.is:t,i=e.useState,l=e.useEffect,u=e.useLayoutEffect,c=e.useDebugValue;function f(m,b){var _=b(),S=i({inst:{value:_,getSnapshot:b}}),O=S[0].inst,E=S[1];return u(function(){O.value=_,O.getSnapshot=b,p(O)&&E({inst:O})},[m,_,b]),l(function(){return p(O)&&E({inst:O}),m(function(){p(O)&&E({inst:O})})},[m]),c(_),_}function p(m){var b=m.getSnapshot;m=m.value;try{var _=b();return!s(m,_)}catch{return!0}}function g(m,b){return b()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:f;return sf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,sf}var Hy;function _R(){return Hy||(Hy=1,rf.exports=bR()),rf.exports}var Iy;function wR(){if(Iy)return nf;Iy=1;var e=bo(),t=_R();function s(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var i=typeof Object.is=="function"?Object.is:s,l=t.useSyncExternalStore,u=e.useRef,c=e.useEffect,f=e.useMemo,p=e.useDebugValue;return nf.useSyncExternalStoreWithSelector=function(g,y,m,b,_){var S=u(null);if(S.current===null){var O={hasValue:!1,value:null};S.current=O}else O=S.current;S=f(function(){function A(K){if(!M){if(M=!0,j=K,K=b(K),_!==void 0&&O.hasValue){var H=O.value;if(_(H,K))return D=H}return D=K}if(H=D,i(j,K))return H;var Y=b(K);return _!==void 0&&_(H,Y)?(j=K,H):(j=K,D=Y)}var M=!1,j,D,X=m===void 0?null:m;return[function(){return A(y())},X===null?void 0:function(){return A(X())}]},[y,m,b,_]);var E=l(g,S[0],S[1]);return c(function(){O.hasValue=!0,O.value=E},[E]),p(E),E},nf}var qy;function SR(){return qy||(qy=1,tf.exports=wR()),tf.exports}var ER=SR();function TR(e,t){return e===t}function ot(e,t,s=TR){const i=ne.useCallback(c=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(c);return f},[e]),l=ne.useCallback(()=>e?.get(),[e]);return ER.useSyncExternalStoreWithSelector(i,l,l,t,s)}var RR={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function Vs(e){const t=vt(),s=ne.useContext(e.from?dR:Tu),i=e.from??s,l=i?e.from?t.stores.getRouteMatchStore(i):t.stores.matchStores.get(i):void 0,u=ne.useRef(void 0);return ot(l??RR,c=>{if((e.shouldThrow??!0)&&!c&&Xt(),c===void 0)return;const f=e.select?e.select(c):c;if(e.structuralSharing??t.options.defaultStructuralSharing){const p=Ls(u.current,f);return u.current=p,p}return f})}function L0(e){return Vs({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function U0(e){const{select:t,...s}=e;return Vs({...s,select:i=>t?t(i.loaderDeps):i.loaderDeps})}function z0(e){return Vs({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const s=e.strict===!1?t.params:t._strictParams;return e.select?e.select(s):s}})}function P0(e){return Vs({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function B0(e){const t=vt();return ne.useCallback(s=>t.navigate({...s,from:s.from??e?.from}),[e?.from,t])}function H0(e){return Vs({...e,select:t=>e.select?e.select(t.context):t.context})}var I0=Lv();const AR=Dv(I0);function OR(e,t){const s=vt(),i=iR(t),{activeProps:l,inactiveProps:u,activeOptions:c,to:f,preload:p,preloadDelay:g,preloadIntentProximity:y,hashScrollIntoView:m,replace:b,startTransition:_,resetScroll:S,viewTransition:O,children:E,target:A,disabled:M,style:j,className:D,onClick:X,onBlur:K,onFocus:H,onMouseEnter:Y,onMouseLeave:Z,onTouchStart:le,ignoreBlocker:ie,params:me,search:_e,hash:qe,state:Me,mask:U,reloadDocument:F,unsafeRelative:ae,from:Se,_fromLocation:ye,...C}=e,q=Jf(),G=ne.useMemo(()=>e,[s,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),Q=ot(s.stores.location,Ue=>Ue,(Ue,Je)=>Ue.href===Je.href),ee=ne.useMemo(()=>{const Ue={_fromLocation:Q,...G};return s.buildLocation(Ue)},[s,Q,G]),ce=ee.maskedLocation?ee.maskedLocation.publicHref:ee.publicHref,we=ee.maskedLocation?ee.maskedLocation.external:ee.external,de=ne.useMemo(()=>NR(ce,we,s.history,M),[M,we,ce,s.history]),xe=ne.useMemo(()=>{if(de?.external)return ru(de.href,s.protocolAllowlist)?void 0:de.href;if(!DR(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),ru(f,s.protocolAllowlist)?void 0:f}catch{}},[f,de,s.protocolAllowlist]),Dt=ne.useMemo(()=>{if(xe)return!1;if(c?.exact){if(!vS(Q.pathname,ee.pathname,s.basepath))return!1}else{const Ue=su(Q.pathname,s.basepath),Je=su(ee.pathname,s.basepath);if(!(Ue.startsWith(Je)&&(Ue.length===Je.length||Ue[Je.length]==="/")))return!1}return(c?.includeSearch??!0)&&!Qt(Q.search,ee.search,{partial:!c?.exact,ignoreUndefined:!c?.explicitUndefined})?!1:c?.includeHash?q&&Q.hash===ee.hash:!0},[c?.exact,c?.explicitUndefined,c?.includeHash,c?.includeSearch,Q,xe,q,ee.hash,ee.pathname,ee.search,s.basepath]),Lt=Dt?Wr(l,{})??xR:af,kt=Dt?af:Wr(u,{})??af,ls=[D,Lt.className,kt.className].filter(Boolean).join(" "),Ut=(j||Lt.style||kt.style)&&{...j,...Lt.style,...kt.style},[us,Yn]=ne.useState(!1),Nn=ne.useRef(!1),ln=e.reloadDocument||xe?!1:p??s.options.defaultPreload,bt=g??s.options.defaultPreloadDelay??0,Zt=ne.useCallback(()=>{s.preloadRoute({...G,_builtLocation:ee}).catch(Ue=>{console.warn(Ue),console.warn(eE)})},[s,G,ee]);aR(i,ne.useCallback(Ue=>{Ue?.isIntersecting&&Zt()},[Zt]),MR,{disabled:!!M||ln!=="viewport"}),ne.useEffect(()=>{Nn.current||!M&&ln==="render"&&(Zt(),Nn.current=!0)},[M,Zt,ln]);const cs=Ue=>{const Je=Ue.currentTarget.getAttribute("target"),un=A!==void 0?A:Je;if(!M&&!LR(Ue)&&!Ue.defaultPrevented&&(!un||un==="_self")&&Ue.button===0){Ue.preventDefault(),I0.flushSync(()=>{Yn(!0)});const Fn=s.subscribe("onResolved",()=>{Fn(),Yn(!1)});s.navigate({...G,replace:b,resetScroll:S,hashScrollIntoView:m,startTransition:_,viewTransition:O,ignoreBlocker:ie})}};if(xe)return{...C,ref:i,href:xe,...E&&{children:E},...A&&{target:A},...M&&{disabled:M},...j&&{style:j},...D&&{className:D},...X&&{onClick:X},...K&&{onBlur:K},...H&&{onFocus:H},...Y&&{onMouseEnter:Y},...Z&&{onMouseLeave:Z},...le&&{onTouchStart:le}};const ht=Ue=>{if(M||ln!=="intent")return;if(!bt){Zt();return}const Je=Ue.currentTarget;if(Ji.has(Je))return;const un=setTimeout(()=>{Ji.delete(Je),Zt()},bt);Ji.set(Je,un)},Dn=Ue=>{M||ln!=="intent"||Zt()},ft=Ue=>{if(M||!ln||!bt)return;const Je=Ue.currentTarget,un=Ji.get(Je);un&&(clearTimeout(un),Ji.delete(Je))};return{...C,...Lt,...kt,href:de?.href,ref:i,onClick:Ma([X,cs]),onBlur:Ma([K,ft]),onFocus:Ma([H,ht]),onMouseEnter:Ma([Y,ht]),onMouseLeave:Ma([Z,ft]),onTouchStart:Ma([le,Dn]),disabled:!!M,target:A,...Ut&&{style:Ut},...ls&&{className:ls},...M&&CR,...Dt&&kR,...q&&us&&jR}}var af={},xR={className:"active"},CR={role:"link","aria-disabled":!0},kR={"data-status":"active","aria-current":"page"},jR={"data-transitioning":"transitioning"},Ji=new WeakMap,MR={rootMargin:"100px"},Ma=e=>t=>{for(const s of e)if(s){if(t.defaultPrevented)return;s(t)}};function NR(e,t,s,i){if(!i)return t?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function DR(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Xf=ne.forwardRef((e,t)=>{const{_asChild:s,...i}=e,{type:l,...u}=OR(i,t),c=typeof i.children=="function"?i.children({isActive:u["data-status"]==="active"}):i.children;if(!s){const{disabled:f,...p}=u;return ne.createElement("a",p,c)}return ne.createElement(s,u,c)});function LR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var UR=class extends Qv{constructor(t){super(t),this.useMatch=s=>Vs({select:s?.select,from:this.id,structuralSharing:s?.structuralSharing}),this.useRouteContext=s=>H0({...s,from:this.id}),this.useSearch=s=>P0({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useParams=s=>z0({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useLoaderDeps=s=>U0({...s,from:this.id}),this.useLoaderData=s=>L0({...s,from:this.id}),this.useNavigate=()=>B0({from:this.fullPath}),this.Link=W.forwardRef((s,i)=>J.jsx(Xf,{ref:i,from:this.fullPath,...s}))}};function zR(e){return new UR(e)}function PR(){return e=>HR(e)}var BR=class extends sE{constructor(e){super(e),this.useMatch=t=>Vs({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>H0({...t,from:this.id}),this.useSearch=t=>P0({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>z0({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>U0({...t,from:this.id}),this.useLoaderData=t=>L0({...t,from:this.id}),this.useNavigate=()=>B0({from:this.fullPath}),this.Link=W.forwardRef((t,s)=>J.jsx(Xf,{ref:s,from:this.fullPath,...t}))}};function HR(e){return new BR(e)}function wn(e){return new IR(e,{silent:!0}).createRoute}var IR=class{constructor(e,t){this.path=e,this.createRoute=s=>{const i=zR(s);return i.isRoot=!1,i},this.silent=t?.silent}};function Sn(e,t){let s,i,l,u;const c=()=>(s||(s=e().then(p=>{s=void 0,i=p[t]}).catch(p=>{if(l=p,Ww(l)&&l instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const g=`tanstack_router_reload:${l.message}`;sessionStorage.getItem(g)||(sessionStorage.setItem(g,"1"),u=!0)}})),s),f=function(g){if(u)throw window.location.reload(),new Promise(()=>{});if(l)throw l;if(!i)if(lu)lu(c());else throw c();return ne.createElement(i,g)};return f.preload=c,f}function qR(e){const t=vt(),s=`not-found-${ot(t.stores.location,i=>i.pathname)}-${ot(t.stores.status,i=>i)}`;return J.jsx(Ff,{getResetKey:()=>s,onCatch:(i,l)=>{if(yt(i))e.onCatch?.(i,l);else throw i},errorComponent:({error:i})=>{if(yt(i))return e.fallback?.(i);throw i},children:e.children})}function $R(){return J.jsx("p",{children:"Not Found"})}function Pa(e){return J.jsx(J.Fragment,{children:e.children})}function q0(e,t,s){return t.options.notFoundComponent?J.jsx(t.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?J.jsx(e.options.defaultNotFoundComponent,{...s}):J.jsx($R,{})}function VR(e){return null}function GR(){return VR(vt()),null}var $0=ne.memo(function({matchId:t}){const s=vt(),i=s.stores.matchStores.get(t);i||Xt();const l=ot(s.stores.loadedAt,c=>c),u=ot(i,c=>c);return J.jsx(KR,{router:s,matchId:t,resetKey:l,matchState:ne.useMemo(()=>{const c=u.routeId,f=s.routesById[c].parentRoute?.id;return{routeId:c,ssr:u.ssr,_displayPending:u._displayPending,parentRouteId:f}},[u._displayPending,u.routeId,u.ssr,s.routesById])})});function KR({router:e,matchId:t,resetKey:s,matchState:i}){const l=e.routesById[i.routeId],u=l.options.pendingComponent??e.options.defaultPendingComponent,c=u?J.jsx(u,{}):null,f=l.options.errorComponent??e.options.defaultErrorComponent,p=l.options.onCatch??e.options.defaultOnCatch,g=l.isRoot?l.options.notFoundComponent??e.options.notFoundRoute?.options.component:l.options.notFoundComponent,y=i.ssr===!1||i.ssr==="data-only",m=(!l.isRoot||l.options.wrapInSuspense||y)&&(l.options.wrapInSuspense??u??(l.options.errorComponent?.preload||y))?ne.Suspense:Pa,b=f?Ff:Pa,_=g?qR:Pa;return J.jsxs(l.isRoot?l.options.shellComponent??Pa:Pa,{children:[J.jsx(Tu.Provider,{value:t,children:J.jsx(m,{fallback:c,children:J.jsx(b,{getResetKey:()=>s,errorComponent:f||Qf,onCatch:(S,O)=>{if(yt(S))throw S.routeId??=i.routeId,S;p?.(S,O)},children:J.jsx(_,{fallback:S=>{if(S.routeId??=i.routeId,!g||S.routeId&&S.routeId!==i.routeId||!S.routeId&&!l.isRoot)throw S;return ne.createElement(g,S)},children:y||i._displayPending?J.jsx(hR,{fallback:c,children:J.jsx($y,{matchId:t})}):J.jsx($y,{matchId:t})})})})}),i.parentRouteId===Hs?J.jsxs(J.Fragment,{children:[J.jsx(YR,{resetKey:s}),e.options.scrollRestoration&&zv?J.jsx(GR,{}):null]}):null]})}function YR({resetKey:e}){const t=vt(),s=ne.useRef(void 0);return Zi(()=>{const i=t.latestLocation.href;(s.current===void 0||s.current!==i)&&(t.emit({type:"onRendered",...Ka(t.stores.location.get(),t.stores.resolvedLocation.get())}),s.current=i)},[t.latestLocation.state.__TSR_key,e,t]),null}var $y=ne.memo(function({matchId:t}){const s=vt(),i=(y,m)=>s.getMatch(y.id)?._nonReactive[m]??y._nonReactive[m],l=s.stores.matchStores.get(t);l||Xt();const u=ot(l,y=>y),c=u.routeId,f=s.routesById[c],p=ne.useMemo(()=>{const y=(s.routesById[c].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:c,loaderDeps:u.loaderDeps,params:u._strictParams,search:u._strictSearch});return y?JSON.stringify(y):void 0},[c,u.loaderDeps,u._strictParams,u._strictSearch,s.options.defaultRemountDeps,s.routesById]),g=ne.useMemo(()=>{const y=f.options.component??s.options.defaultComponent;return y?J.jsx(y,{},p):J.jsx(V0,{})},[p,f.options.component,s.options.defaultComponent]);if(u._displayPending)throw i(u,"displayPendingPromise");if(u._forcePending)throw i(u,"minPendingPromise");if(u.status==="pending"){const y=f.options.pendingMinMs??s.options.defaultPendingMinMs;if(y){const m=s.getMatch(u.id);if(m&&!m._nonReactive.minPendingPromise){const b=qs();m._nonReactive.minPendingPromise=b,setTimeout(()=>{b.resolve(),m._nonReactive.minPendingPromise=void 0},y)}}throw i(u,"loadPromise")}if(u.status==="notFound")return yt(u.error)||Xt(),q0(s,f,u.error);if(u.status==="redirected")throw Jt(u.error)||Xt(),i(u,"loadPromise");if(u.status==="error")throw u.error;return g}),V0=ne.memo(function(){const t=vt(),s=ne.useContext(Tu);let i,l=!1,u;{const g=s?t.stores.matchStores.get(s):void 0;[i,l]=ot(g,y=>[y?.routeId,y?.globalNotFound??!1]),u=ot(t.stores.matchesId,y=>y[y.findIndex(m=>m===s)+1])}const c=i?t.routesById[i]:void 0,f=t.options.defaultPendingComponent?J.jsx(t.options.defaultPendingComponent,{}):null;if(l)return c||Xt(),q0(t,c,void 0);if(!u)return null;const p=J.jsx($0,{matchId:u});return i===Hs?J.jsx(ne.Suspense,{fallback:f,children:p}):p});function FR(){const e=vt(),t=ne.useRef({router:e,mounted:!1}),[s,i]=ne.useState(!1),l=ot(e.stores.isLoading,m=>m),u=ot(e.stores.hasPending,m=>m),c=ef(l),f=l||s||u,p=ef(f),g=l||u,y=ef(g);return e.startTransition=m=>{i(!0),ne.startTransition(()=>{m(),i(!1)})},ne.useEffect(()=>{const m=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return ns(e.latestLocation.publicHref)!==ns(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{m()}},[e,e.history]),Zi(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(b){console.error(b)}})()},[e]),Zi(()=>{c&&!l&&e.emit({type:"onLoad",...Ka(e.stores.location.get(),e.stores.resolvedLocation.get())})},[c,e,l]),Zi(()=>{y&&!g&&e.emit({type:"onBeforeRouteMount",...Ka(e.stores.location.get(),e.stores.resolvedLocation.get())})},[g,y,e]),Zi(()=>{if(p&&!f){const m=Ka(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...m}),N0(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),m.hrefChanged&&aE(e)}},[f,p,e]),null}function QR(){const e=vt(),t=e.routesById[Hs].options.pendingComponent??e.options.defaultPendingComponent,s=t?J.jsx(t,{}):null,i=J.jsxs(typeof document<"u"&&e.ssr?Pa:ne.Suspense,{fallback:s,children:[J.jsx(FR,{}),J.jsx(JR,{})]});return e.options.InnerWrap?J.jsx(e.options.InnerWrap,{children:i}):i}function JR(){const e=vt(),t=ot(e.stores.firstId,l=>l),s=ot(e.stores.loadedAt,l=>l),i=t?J.jsx($0,{matchId:t}):null;return J.jsx(Tu.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?i:J.jsx(Ff,{getResetKey:()=>s,errorComponent:Qf,onCatch:void 0,children:i})})}var XR=e=>({createMutableStore:Py,createReadonlyStore:Py,batch:N0}),ZR=e=>new WR(e),WR=class extends KS{constructor(e){super(e,XR)}};function eA({router:e,children:t,...s}){Object.keys(s).length>0&&e.update({...e.options,...s,context:{...e.options.context,...s.context}});const i=J.jsx(j0.Provider,{value:e,children:t});return e.options.Wrap?J.jsx(e.options.Wrap,{children:i}):i}function tA({router:e,...t}){return J.jsx(eA,{router:e,...t,children:J.jsx(QR,{})})}function G0(e){const{attrs:t,children:s,nonce:i}=e;switch(e.tag){case"title":return J.jsx("title",{...t,suppressHydrationWarning:!0,children:s});case"meta":return J.jsx("meta",{...t,suppressHydrationWarning:!0});case"link":return J.jsx("link",{...t,precedence:t?.precedence??(t?.rel==="stylesheet"?"default":void 0),nonce:i,suppressHydrationWarning:!0});case"style":return e.inlineCss,J.jsx("style",{...t,dangerouslySetInnerHTML:{__html:s},nonce:i});case"script":return J.jsx(nA,{attrs:t,children:s});default:return null}}function nA({attrs:e,children:t}){vt();const s=Jf(),i=typeof e?.type=="string"&&e.type!==""&&e.type!=="text/javascript"&&e.type!=="module";if(ne.useEffect(()=>{if(!i){if(e?.src){const l=(()=>{try{const c=document.baseURI||window.location.href;return new URL(e.src,c).href}catch{return e.src}})();if(Array.from(document.querySelectorAll("script[src]")).find(c=>c.src===l))return;const u=document.createElement("script");for(const[c,f]of Object.entries(e))c!=="suppressHydrationWarning"&&f!==void 0&&f!==!1&&u.setAttribute(c,typeof f=="boolean"?"":String(f));return document.head.appendChild(u),()=>{u.parentNode&&u.parentNode.removeChild(u)}}if(typeof t=="string"){const l=typeof e?.type=="string"?e.type:"text/javascript",u=typeof e?.nonce=="string"?e.nonce:void 0;if(Array.from(document.querySelectorAll("script:not([src])")).find(f=>{if(!(f instanceof HTMLScriptElement))return!1;const p=f.getAttribute("type")??"text/javascript",g=f.getAttribute("nonce")??void 0;return f.textContent===t&&p===l&&g===u}))return;const c=document.createElement("script");if(c.textContent=t,e)for(const[f,p]of Object.entries(e))f!=="suppressHydrationWarning"&&p!==void 0&&p!==!1&&c.setAttribute(f,typeof p=="boolean"?"":String(p));return document.head.appendChild(c),()=>{c.parentNode&&c.parentNode.removeChild(c)}}}},[e,t,i]),i&&typeof t=="string")return J.jsx("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:t}});if(!s){if(e?.src)return J.jsx("script",{...e,suppressHydrationWarning:!0});if(typeof t=="string")return J.jsx("script",{...e,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0})}return null}var rA=e=>{const t=vt(),s=t.options.ssr?.nonce,i=ot(t.stores.matches,g=>g.map(y=>y.meta).filter(Boolean),Qt),l=ne.useMemo(()=>{const g=[],y={};let m;for(let b=i.length-1;b>=0;b--){const _=i[b];for(let S=_.length-1;S>=0;S--){const O=_[S];if(O)if(O.title)m||(m={tag:"title",children:O.title});else if("script:ld+json"in O)try{const E=JSON.stringify(O["script:ld+json"]);g.push({tag:"script",attrs:{type:"application/ld+json"},children:sS(E)})}catch{}else{const E=O.name??O.property;if(E){if(y[E])continue;y[E]=!0}g.push({tag:"meta",attrs:{...O,nonce:s}})}}}return m&&g.push(m),s&&g.push({tag:"meta",attrs:{property:"csp-nonce",content:s}}),g.reverse(),g},[i,s]),u=ot(t.stores.matches,g=>{const y=g.map(_=>_.links).filter(Boolean).flat(1).map(_=>({tag:"link",attrs:{..._,nonce:s}})),m=t.ssr?.manifest,b=g.map(_=>m?.routes[_.routeId]?.assets??[]).filter(Boolean).flat(1).flatMap(_=>_.tag==="link"?rE(m,_)?[]:[{tag:"link",attrs:{..._.attrs,crossOrigin:Sy(e,"stylesheet")??_.attrs?.crossOrigin,suppressHydrationWarning:!0,nonce:s}}]:_.tag==="style"?[{tag:"style",attrs:{..._.attrs,nonce:s},children:_.children,..._.inlineCss?{inlineCss:!0}:{}}]:[]);return[...y,...b]},Qt),c=ot(t.stores.matches,g=>{const y=[];return g.map(m=>t.looseRoutesById[m.routeId]).forEach(m=>t.ssr?.manifest?.routes[m.id]?.preloads?.filter(Boolean).forEach(b=>{const _=tE(b);y.push({tag:"link",attrs:{rel:"modulepreload",href:_.href,crossOrigin:Sy(e,"modulepreload")??_.crossOrigin,nonce:s}})})),y},Qt),f=ot(t.stores.matches,g=>g.map(y=>y.styles).flat(1).filter(Boolean).map(({children:y,...m})=>({tag:"style",attrs:{...m,nonce:s},children:y})),Qt),p=ot(t.stores.matches,g=>g.map(y=>y.headScripts).flat(1).filter(Boolean).map(({children:y,...m})=>({tag:"script",attrs:{...m,nonce:s},children:y})),Qt);return sA([...l,...c,...u,...f,...p],g=>JSON.stringify(g))};function sA(e,t){const s=new Set;return e.filter(i=>{const l=t(i);return s.has(l)?!1:(s.add(l),!0)})}function aA(e){const t=rA(e.assetCrossOrigin),s=vt().options.ssr?.nonce;return J.jsx(J.Fragment,{children:t.map(i=>ne.createElement(G0,{...i,key:`tsr-meta-${JSON.stringify(i)}`,nonce:s}))})}var iA=()=>{const e=vt(),t=e.options.ssr?.nonce,s=u=>{const c=[],f=e.ssr?.manifest;return f?(u.map(p=>e.looseRoutesById[p.routeId]).forEach(p=>f.routes[p.id]?.assets?.filter(g=>g.tag==="script").forEach(g=>{c.push({tag:"script",attrs:{...g.attrs,nonce:t},children:g.children})})),c):[]},i=u=>u.map(c=>c.scripts).flat(1).filter(Boolean).map(({children:c,...f})=>({tag:"script",attrs:{...f,suppressHydrationWarning:!0,nonce:t},children:c})),l=ot(e.stores.matches,s,Qt);return oA(e,ot(e.stores.matches,i,Qt),l)};function oA(e,t,s){let i;e.serverSsr&&(i=e.serverSsr.takeBufferedScripts());const l=[...t,...s];return i&&l.unshift(i),J.jsx(J.Fragment,{children:l.map((u,c)=>ne.createElement(G0,{...u,key:`tsr-scripts-${u.tag}-${c}`}))})}var Va=(e,t)=>{const s={type:"request",...t||e};return{options:s,middleware:i=>Va({},Object.assign(s,{middleware:i})),inputValidator:i=>Va({},Object.assign(s,{inputValidator:i})),client:i=>Va({},Object.assign(s,{client:i})),server:i=>Va({},Object.assign(s,{server:i}))}};function K0(e,t){for(let s=0,i=t.length;s<i;s++){const l=t[s];e.has(l)||(e.add(l),l.extends&&K0(e,l.extends))}}var lA=e=>({getOptions:async()=>{const t=await e();if(t.serializationAdapters){const s=new Set;K0(s,t.serializationAdapters),t.serializationAdapters=Array.from(s)}return t},createMiddleware:Va});const uA=Va(),Vy=lA(()=>({requestMiddleware:[uA]}));var Ru=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(){}},cA=class extends Ru{#e;#n;#t;constructor(){super(),this.#t=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Y0=new cA,hA={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},fA=class{#e=hA;#n=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Ef=new fA;function dA(e){setTimeout(e,0)}var pA=typeof window>"u"||"Deno"in globalThis;function kn(){}function gA(e,t){return typeof e=="function"?e(t):e}function mA(e){return typeof e=="number"&&e>=0&&e!==1/0}function yA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Tf(e,t){return typeof e=="function"?e(t):e}function vA(e,t){return typeof e=="function"?e(t):e}function Gy(e,t){const{type:s="all",exact:i,fetchStatus:l,predicate:u,queryKey:c,stale:f}=e;if(c){if(i){if(t.queryHash!==Zf(c,t.options))return!1}else if(!co(t.queryKey,c))return!1}if(s!=="all"){const p=t.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||l&&l!==t.state.fetchStatus||u&&!u(t))}function Ky(e,t){const{exact:s,status:i,predicate:l,mutationKey:u}=e;if(u){if(!t.options.mutationKey)return!1;if(s){if(uo(t.options.mutationKey)!==uo(u))return!1}else if(!co(t.options.mutationKey,u))return!1}return!(i&&t.state.status!==i||l&&!l(t))}function Zf(e,t){return(t?.queryKeyHashFn||uo)(e)}function uo(e){return JSON.stringify(e,(t,s)=>Rf(s)?Object.keys(s).sort().reduce((i,l)=>(i[l]=s[l],i),{}):s)}function co(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>co(e[s],t[s])):!1}var bA=Object.prototype.hasOwnProperty;function F0(e,t,s=0){if(e===t)return e;if(s>500)return t;const i=Yy(e)&&Yy(t);if(!i&&!(Rf(e)&&Rf(t)))return t;const u=(i?e:Object.keys(e)).length,c=i?t:Object.keys(t),f=c.length,p=i?new Array(f):{};let g=0;for(let y=0;y<f;y++){const m=i?y:c[y],b=e[m],_=t[m];if(b===_){p[m]=b,(i?y<u:bA.call(e,m))&&g++;continue}if(b===null||_===null||typeof b!="object"||typeof _!="object"){p[m]=_;continue}const S=F0(b,_,s+1);p[m]=S,S===b&&g++}return u===f&&g===u?e:p}function y2(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function Yy(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Rf(e){if(!Fy(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Fy(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Fy(e){return Object.prototype.toString.call(e)==="[object Object]"}function _A(e){return new Promise(t=>{Ef.setTimeout(t,e)})}function wA(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?F0(e,t):t}function SA(e,t,s=0){const i=[...e,t];return s&&i.length>s?i.slice(1):i}function EA(e,t,s=0){const i=[t,...e];return s&&i.length>s?i.slice(0,-1):i}var Wf=Symbol();function Q0(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Wf?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function v2(e,t){return typeof e=="function"?e(...t):!!e}function TA(e,t,s){let i=!1,l;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(l??=t(),i||(i=!0,l.aborted?s():l.addEventListener("abort",s,{once:!0})),l)}),e}var J0=(()=>{let e=()=>pA;return{isServer(){return e()},setIsServer(t){e=t}}})();function RA(){let e,t;const s=new Promise((l,u)=>{e=l,t=u});s.status="pending",s.catch(()=>{});function i(l){Object.assign(s,l),delete s.resolve,delete s.reject}return s.resolve=l=>{i({status:"fulfilled",value:l}),e(l)},s.reject=l=>{i({status:"rejected",reason:l}),t(l)},s}var AA=dA;function OA(){let e=[],t=0,s=f=>{f()},i=f=>{f()},l=AA;const u=f=>{t?e.push(f):l(()=>{s(f)})},c=()=>{const f=e;e=[],f.length&&l(()=>{i(()=>{f.forEach(p=>{s(p)})})})};return{batch:f=>{let p;t++;try{p=f()}finally{t--,t||c()}return p},batchCalls:f=>(...p)=>{u(()=>{f(...p)})},schedule:u,setNotifyFunction:f=>{s=f},setBatchNotifyFunction:f=>{i=f},setScheduler:f=>{l=f}}}var Nt=OA(),xA=class extends Ru{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(s=>{s(e)}))}isOnline(){return this.#e}},cu=new xA;function CA(e){return Math.min(1e3*2**e,3e4)}function X0(e){return(e??"online")==="online"?cu.isOnline():!0}var Af=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Z0(e){let t=!1,s=0,i;const l=RA(),u=()=>l.status!=="pending",c=O=>{if(!u()){const E=new Af(O);b(E),e.onCancel?.(E)}},f=()=>{t=!0},p=()=>{t=!1},g=()=>Y0.isFocused()&&(e.networkMode==="always"||cu.isOnline())&&e.canRun(),y=()=>X0(e.networkMode)&&e.canRun(),m=O=>{u()||(i?.(),l.resolve(O))},b=O=>{u()||(i?.(),l.reject(O))},_=()=>new Promise(O=>{i=E=>{(u()||g())&&O(E)},e.onPause?.()}).then(()=>{i=void 0,u()||e.onContinue?.()}),S=()=>{if(u())return;let O;const E=s===0?e.initialPromise:void 0;try{O=E??e.fn()}catch(A){O=Promise.reject(A)}Promise.resolve(O).then(m).catch(A=>{if(u())return;const M=e.retry??(J0.isServer()?0:3),j=e.retryDelay??CA,D=typeof j=="function"?j(s,A):j,X=M===!0||typeof M=="number"&&s<M||typeof M=="function"&&M(s,A);if(t||!X){b(A);return}s++,e.onFail?.(s,A),_A(D).then(()=>g()?void 0:_()).then(()=>{t?b(A):S()})})};return{promise:l,status:()=>l.status,cancel:c,continue:()=>(i?.(),l),cancelRetry:f,continueRetry:p,canStart:y,start:()=>(y()?S():_().then(S),l)}}var W0=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mA(this.gcTime)&&(this.#e=Ef.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(J0.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Ef.clearTimeout(this.#e),this.#e=void 0)}},kA=class extends W0{#e;#n;#t;#s;#r;#a;#i;constructor(e){super(),this.#i=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#t=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Jy(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Jy(this.options);t.data!==void 0&&(this.setState(Qy(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const s=wA(this.state.data,e,this.options);return this.#o({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(kn).catch(kn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>vA(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Wf||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Tf(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!yA(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#t.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.#r&&(this.#i||this.#l()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#t.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#l(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const s=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#i=!0,s.signal)})},l=()=>{const f=Q0(this.options,t),g=(()=>{const y={client:this.#s,queryKey:this.queryKey,meta:this.meta};return i(y),y})();return this.#i=!1,this.options.persister?this.options.persister(f,g,this):f(g)},c=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:l};return i(f),f})();this.options.behavior?.onFetch(c,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#o({type:"fetch",meta:c.fetchOptions?.meta}),this.#r=Z0({initialPromise:t?.initialPromise,fn:c.fetchFn,onCancel:f=>{f instanceof Af&&f.revert&&this.setState({...this.#n,fetchStatus:"idle"}),s.abort()},onFail:(f,p)=>{this.#o({type:"failed",failureCount:f,error:p})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const f=await this.#r.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#t.config.onSuccess?.(f,this),this.#t.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof Af){if(f.silent)return this.#r.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#o({type:"error",error:f}),this.#t.config.onError?.(f,this),this.#t.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#o(e){const t=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...jA(s.data,this.options),fetchMeta:e.meta??null};case"success":const i={...s,...Qy(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?i:void 0,i;case"error":const l=e.error;return{...s,error:l,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),Nt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function jA(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:X0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Qy(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Jy(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,i=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}function Xy(e){return{onFetch:(t,s)=>{const i=t.options,l=t.fetchOptions?.meta?.fetchMore?.direction,u=t.state.data?.pages||[],c=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},p=0;const g=async()=>{let y=!1;const m=S=>{TA(S,()=>t.signal,()=>y=!0)},b=Q0(t.options,t.fetchOptions),_=async(S,O,E)=>{if(y)return Promise.reject();if(O==null&&S.pages.length)return Promise.resolve(S);const M=(()=>{const K={client:t.client,queryKey:t.queryKey,pageParam:O,direction:E?"backward":"forward",meta:t.options.meta};return m(K),K})(),j=await b(M),{maxPages:D}=t.options,X=E?EA:SA;return{pages:X(S.pages,j,D),pageParams:X(S.pageParams,O,D)}};if(l&&u.length){const S=l==="backward",O=S?MA:Zy,E={pages:u,pageParams:c},A=O(i,E);f=await _(E,A,S)}else{const S=e??u.length;do{const O=p===0?c[0]??i.initialPageParam:Zy(i,f);if(p>0&&O==null)break;f=await _(f,O),p++}while(p<S)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(g,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=g}}}function Zy(e,{pages:t,pageParams:s}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,s[i],s):void 0}function MA(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var NA=class extends W0{#e;#n;#t;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#n=[],this.state=e.state||DA(),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.#n.includes(e)||(this.#n.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#n=this.#n.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Z0({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(u,c)=>{this.#r({type:"failed",failureCount:u,error:c})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const i=this.state.status==="pending",l=!this.#s.canStart();try{if(i)t();else{this.#r({type:"pending",variables:e,isPaused:l}),this.#t.config.onMutate&&await this.#t.config.onMutate(e,this,s);const c=await this.options.onMutate?.(e,s);c!==this.state.context&&this.#r({type:"pending",context:c,variables:e,isPaused:l})}const u=await this.#s.start();return await this.#t.config.onSuccess?.(u,e,this.state.context,this,s),await this.options.onSuccess?.(u,e,this.state.context,s),await this.#t.config.onSettled?.(u,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(u,null,e,this.state.context,s),this.#r({type:"success",data:u}),u}catch(u){try{await this.#t.config.onError?.(u,e,this.state.context,this,s)}catch(c){Promise.reject(c)}try{await this.options.onError?.(u,e,this.state.context,s)}catch(c){Promise.reject(c)}try{await this.#t.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,s)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,u,e,this.state.context,s)}catch(c){Promise.reject(c)}throw this.#r({type:"error",error:u}),u}finally{this.#t.runNext(this)}}#r(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,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{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Nt.batch(()=>{this.#n.forEach(s=>{s.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function DA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var LA=class extends Ru{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#n=new Map,this.#t=0}#e;#n;#t;build(e,t,s){const i=new NA({client:e,mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:s});return this.add(i),i}add(e){this.#e.add(e);const t=Il(e);if(typeof t=="string"){const s=this.#n.get(t);s?s.push(e):this.#n.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Il(e);if(typeof t=="string"){const s=this.#n.get(t);if(s)if(s.length>1){const i=s.indexOf(e);i!==-1&&s.splice(i,1)}else s[0]===e&&this.#n.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Il(e);if(typeof t=="string"){const i=this.#n.get(t)?.find(l=>l.state.status==="pending");return!i||i===e}else return!0}runNext(e){const t=Il(e);return typeof t=="string"?this.#n.get(t)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Nt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#n.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(s=>Ky(t,s))}findAll(e={}){return this.getAll().filter(t=>Ky(e,t))}notify(e){Nt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Nt.batch(()=>Promise.all(e.map(t=>t.continue().catch(kn))))}};function Il(e){return e.options.scope?.id}var UA=class extends Ru{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,s){const i=t.queryKey,l=t.queryHash??Zf(i,t);let u=this.get(l);return u||(u=new kA({client:e,queryKey:i,queryHash:l,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(i)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Nt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(s=>Gy(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>Gy(e,s)):t}notify(e){Nt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Nt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Nt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},zA=class{#e;#n;#t;#s;#r;#a;#i;#l;constructor(e={}){this.#e=e.queryCache||new UA,this.#n=e.mutationCache||new LA,this.#t=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#i=Y0.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=cu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#i?.(),this.#i=void 0,this.#l?.(),this.#l=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=this.#e.build(this,t),i=s.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(Tf(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:s})=>{const i=s.data;return[t,i]})}setQueryData(e,t,s){const i=this.defaultQueryOptions({queryKey:e}),u=this.#e.get(i.queryHash)?.state.data,c=gA(t,u);if(c!==void 0)return this.#e.build(this,i).setData(c,{...s,manual:!0})}setQueriesData(e,t,s){return Nt.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Nt.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#e;return Nt.batch(()=>(s.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},i=Nt.batch(()=>this.#e.findAll(e).map(l=>l.cancel(s)));return Promise.all(i).then(kn).catch(kn)}invalidateQueries(e,t={}){return Nt.batch(()=>(this.#e.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},i=Nt.batch(()=>this.#e.findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let u=l.fetch(void 0,s);return s.throwOnError||(u=u.catch(kn)),l.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(i).then(kn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#e.build(this,t);return s.isStaleByTime(Tf(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(kn).catch(kn)}fetchInfiniteQuery(e){return e.behavior=Xy(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(kn).catch(kn)}ensureInfiniteQueryData(e){return e.behavior=Xy(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return cu.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#n}getDefaultOptions(){return this.#t}setDefaultOptions(e){this.#t=e}setQueryDefaults(e,t){this.#s.set(uo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],s={};return t.forEach(i=>{co(e,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(e,t){this.#r.set(uo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],s={};return t.forEach(i=>{co(e,i.mutationKey)&&Object.assign(s,i.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#t.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Zf(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Wf&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#t.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#n.clear()}},eb=ne.createContext(void 0),tb=e=>{const t=ne.useContext(eb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},PA=({client:e,children:t})=>(ne.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),J.jsx(eb.Provider,{value:e,children:t}));function BA(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}const HA=e=>{switch(e){case"success":return $A;case"info":return GA;case"warning":return VA;case"error":return KA;default:return null}},IA=Array(12).fill(0),qA=({visible:e,className:t})=>W.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},W.createElement("div",{className:"sonner-spinner"},IA.map((s,i)=>W.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),$A=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.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"})),VA=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},W.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"})),GA=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.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"})),KA=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.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"})),YA=W.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"},W.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),W.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),FA=()=>{const[e,t]=W.useState(document.hidden);return W.useEffect(()=>{const s=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),e};let Of=1;class QA{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const s=this.subscribers.indexOf(t);this.subscribers.splice(s,1)}),this.publish=t=>{this.subscribers.forEach(s=>s(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var s;const{message:i,...l}=t,u=typeof t?.id=="number"||((s=t.id)==null?void 0:s.length)>0?t.id:Of++,c=this.toasts.find(p=>p.id===u),f=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),c?this.toasts=this.toasts.map(p=>p.id===u?(this.publish({...p,...t,id:u,title:i}),{...p,...t,id:u,dismissible:f,title:i}):p):this.addToast({title:i,...l,dismissible:f,id:u}),u},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(s=>s({id:t,dismiss:!0})))):this.toasts.forEach(s=>{this.subscribers.forEach(i=>i({id:s.id,dismiss:!0}))}),t),this.message=(t,s)=>this.create({...s,message:t}),this.error=(t,s)=>this.create({...s,message:t,type:"error"}),this.success=(t,s)=>this.create({...s,type:"success",message:t}),this.info=(t,s)=>this.create({...s,type:"info",message:t}),this.warning=(t,s)=>this.create({...s,type:"warning",message:t}),this.loading=(t,s)=>this.create({...s,type:"loading",message:t}),this.promise=(t,s)=>{if(!s)return;let i;s.loading!==void 0&&(i=this.create({...s,promise:t,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));const l=Promise.resolve(t instanceof Function?t():t);let u=i!==void 0,c;const f=l.then(async g=>{if(c=["resolve",g],W.isValidElement(g))u=!1,this.create({id:i,type:"default",message:g});else if(XA(g)&&!g.ok){u=!1;const m=typeof s.error=="function"?await s.error(`HTTP error! status: ${g.status}`):s.error,b=typeof s.description=="function"?await s.description(`HTTP error! status: ${g.status}`):s.description,S=typeof m=="object"&&!W.isValidElement(m)?m:{message:m};this.create({id:i,type:"error",description:b,...S})}else if(g instanceof Error){u=!1;const m=typeof s.error=="function"?await s.error(g):s.error,b=typeof s.description=="function"?await s.description(g):s.description,S=typeof m=="object"&&!W.isValidElement(m)?m:{message:m};this.create({id:i,type:"error",description:b,...S})}else if(s.success!==void 0){u=!1;const m=typeof s.success=="function"?await s.success(g):s.success,b=typeof s.description=="function"?await s.description(g):s.description,S=typeof m=="object"&&!W.isValidElement(m)?m:{message:m};this.create({id:i,type:"success",description:b,...S})}}).catch(async g=>{if(c=["reject",g],s.error!==void 0){u=!1;const y=typeof s.error=="function"?await s.error(g):s.error,m=typeof s.description=="function"?await s.description(g):s.description,_=typeof y=="object"&&!W.isValidElement(y)?y:{message:y};this.create({id:i,type:"error",description:m,..._})}}).finally(()=>{u&&(this.dismiss(i),i=void 0),s.finally==null||s.finally.call(s)}),p=()=>new Promise((g,y)=>f.then(()=>c[0]==="reject"?y(c[1]):g(c[1])).catch(y));return typeof i!="string"&&typeof i!="number"?{unwrap:p}:Object.assign(i,{unwrap:p})},this.custom=(t,s)=>{const i=s?.id||Of++;return this.create({jsx:t(i),id:i,...s}),i},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ft=new QA,JA=(e,t)=>{const s=t?.id||Of++;return Ft.addToast({title:e,...t,id:s}),s},XA=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",ZA=JA,WA=()=>Ft.toasts,eO=()=>Ft.getActiveToasts(),of=Object.assign(ZA,{success:Ft.success,info:Ft.info,warning:Ft.warning,error:Ft.error,custom:Ft.custom,message:Ft.message,promise:Ft.promise,dismiss:Ft.dismiss,loading:Ft.loading},{getHistory:WA,getToasts:eO});BA("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ql(e){return e.label!==void 0}const tO=3,nO="24px",rO="16px",Wy=4e3,sO=356,aO=14,iO=45,oO=200;function In(...e){return e.filter(Boolean).join(" ")}function lO(e){const[t,s]=e.split("-"),i=[];return t&&i.push(t),s&&i.push(s),i}const uO=e=>{var t,s,i,l,u,c,f,p,g;const{invert:y,toast:m,unstyled:b,interacting:_,setHeights:S,visibleToasts:O,heights:E,index:A,toasts:M,expanded:j,removeToast:D,defaultRichColors:X,closeButton:K,style:H,cancelButtonStyle:Y,actionButtonStyle:Z,className:le="",descriptionClassName:ie="",duration:me,position:_e,gap:qe,expandByDefault:Me,classNames:U,icons:F,closeButtonAriaLabel:ae="Close toast"}=e,[Se,ye]=W.useState(null),[C,q]=W.useState(null),[G,Q]=W.useState(!1),[ee,ce]=W.useState(!1),[we,de]=W.useState(!1),[xe,Dt]=W.useState(!1),[Lt,kt]=W.useState(!1),[ls,Ut]=W.useState(0),[us,Yn]=W.useState(0),Nn=W.useRef(m.duration||me||Wy),ln=W.useRef(null),bt=W.useRef(null),Zt=A===0,cs=A+1<=O,ht=m.type,Dn=m.dismissible!==!1,ft=m.className||"",Ue=m.descriptionClassName||"",Je=W.useMemo(()=>E.findIndex(pe=>pe.toastId===m.id)||0,[E,m.id]),un=W.useMemo(()=>{var pe;return(pe=m.closeButton)!=null?pe:K},[m.closeButton,K]),Fn=W.useMemo(()=>m.duration||me||Wy,[m.duration,me]),Za=W.useRef(0),Qn=W.useRef(0),Eo=W.useRef(0),Er=W.useRef(null),[hs,jt]=_e.split("-"),Tn=W.useMemo(()=>E.reduce((pe,Ke,dt)=>dt>=Je?pe:pe+Ke.height,0),[E,Je]),Ot=FA(),ku=m.invert||y,Wa=ht==="loading";Qn.current=W.useMemo(()=>Je*qe+Tn,[Je,Tn]),W.useEffect(()=>{Nn.current=Fn},[Fn]),W.useEffect(()=>{Q(!0)},[]),W.useEffect(()=>{const pe=bt.current;if(pe){const Ke=pe.getBoundingClientRect().height;return Yn(Ke),S(dt=>[{toastId:m.id,height:Ke,position:m.position},...dt]),()=>S(dt=>dt.filter(xt=>xt.toastId!==m.id))}},[S,m.id]),W.useLayoutEffect(()=>{if(!G)return;const pe=bt.current,Ke=pe.style.height;pe.style.height="auto";const dt=pe.getBoundingClientRect().height;pe.style.height=Ke,Yn(dt),S(xt=>xt.find(Qe=>Qe.toastId===m.id)?xt.map(Qe=>Qe.toastId===m.id?{...Qe,height:dt}:Qe):[{toastId:m.id,height:dt,position:m.position},...xt])},[G,m.title,m.description,S,m.id,m.jsx,m.action,m.cancel]);const Ln=W.useCallback(()=>{ce(!0),Ut(Qn.current),S(pe=>pe.filter(Ke=>Ke.toastId!==m.id)),setTimeout(()=>{D(m)},oO)},[m,D,S,Qn]);W.useEffect(()=>{if(m.promise&&ht==="loading"||m.duration===1/0||m.type==="loading")return;let pe;return j||_||Ot?(()=>{if(Eo.current<Za.current){const xt=new Date().getTime()-Za.current;Nn.current=Nn.current-xt}Eo.current=new Date().getTime()})():Nn.current!==1/0&&(Za.current=new Date().getTime(),pe=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),Ln()},Nn.current)),()=>clearTimeout(pe)},[j,_,m,ht,Ot,Ln]),W.useEffect(()=>{m.delete&&(Ln(),m.onDismiss==null||m.onDismiss.call(m,m))},[Ln,m.delete]);function Gs(){var pe;if(F?.loading){var Ke;return W.createElement("div",{className:In(U?.loader,m==null||(Ke=m.classNames)==null?void 0:Ke.loader,"sonner-loader"),"data-visible":ht==="loading"},F.loading)}return W.createElement(qA,{className:In(U?.loader,m==null||(pe=m.classNames)==null?void 0:pe.loader),visible:ht==="loading"})}const Ks=m.icon||F?.[ht]||HA(ht);var fs,Un;return W.createElement("li",{tabIndex:0,ref:bt,className:In(le,ft,U?.toast,m==null||(t=m.classNames)==null?void 0:t.toast,U?.default,U?.[ht],m==null||(s=m.classNames)==null?void 0:s[ht]),"data-sonner-toast":"","data-rich-colors":(fs=m.richColors)!=null?fs:X,"data-styled":!(m.jsx||m.unstyled||b),"data-mounted":G,"data-promise":!!m.promise,"data-swiped":Lt,"data-removed":ee,"data-visible":cs,"data-y-position":hs,"data-x-position":jt,"data-index":A,"data-front":Zt,"data-swiping":we,"data-dismissible":Dn,"data-type":ht,"data-invert":ku,"data-swipe-out":xe,"data-swipe-direction":C,"data-expanded":!!(j||Me&&G),"data-testid":m.testId,style:{"--index":A,"--toasts-before":A,"--z-index":M.length-A,"--offset":`${ee?ls:Qn.current}px`,"--initial-height":Me?"auto":`${us}px`,...H,...m.style},onDragEnd:()=>{de(!1),ye(null),Er.current=null},onPointerDown:pe=>{pe.button!==2&&(Wa||!Dn||(ln.current=new Date,Ut(Qn.current),pe.target.setPointerCapture(pe.pointerId),pe.target.tagName!=="BUTTON"&&(de(!0),Er.current={x:pe.clientX,y:pe.clientY})))},onPointerUp:()=>{var pe,Ke,dt;if(xe||!Dn)return;Er.current=null;const xt=Number(((pe=bt.current)==null?void 0:pe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Tr=Number(((Ke=bt.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Qe=new Date().getTime()-((dt=ln.current)==null?void 0:dt.getTime()),zt=Se==="x"?xt:Tr,ds=Math.abs(zt)/Qe;if(Math.abs(zt)>=iO||ds>.11){Ut(Qn.current),m.onDismiss==null||m.onDismiss.call(m,m),q(Se==="x"?xt>0?"right":"left":Tr>0?"down":"up"),Ln(),Dt(!0);return}else{var Pt,Bt;(Pt=bt.current)==null||Pt.style.setProperty("--swipe-amount-x","0px"),(Bt=bt.current)==null||Bt.style.setProperty("--swipe-amount-y","0px")}kt(!1),de(!1),ye(null)},onPointerMove:pe=>{var Ke,dt,xt;if(!Er.current||!Dn||((Ke=window.getSelection())==null?void 0:Ke.toString().length)>0)return;const Qe=pe.clientY-Er.current.y,zt=pe.clientX-Er.current.x;var ds;const Pt=(ds=e.swipeDirections)!=null?ds:lO(_e);!Se&&(Math.abs(zt)>1||Math.abs(Qe)>1)&&ye(Math.abs(zt)>Math.abs(Qe)?"x":"y");let Bt={x:0,y:0};const Ys=Rn=>1/(1.5+Math.abs(Rn)/20);if(Se==="y"){if(Pt.includes("top")||Pt.includes("bottom"))if(Pt.includes("top")&&Qe<0||Pt.includes("bottom")&&Qe>0)Bt.y=Qe;else{const Rn=Qe*Ys(Qe);Bt.y=Math.abs(Rn)<Math.abs(Qe)?Rn:Qe}}else if(Se==="x"&&(Pt.includes("left")||Pt.includes("right")))if(Pt.includes("left")&&zt<0||Pt.includes("right")&&zt>0)Bt.x=zt;else{const Rn=zt*Ys(zt);Bt.x=Math.abs(Rn)<Math.abs(zt)?Rn:zt}(Math.abs(Bt.x)>0||Math.abs(Bt.y)>0)&&kt(!0),(dt=bt.current)==null||dt.style.setProperty("--swipe-amount-x",`${Bt.x}px`),(xt=bt.current)==null||xt.style.setProperty("--swipe-amount-y",`${Bt.y}px`)}},un&&!m.jsx&&ht!=="loading"?W.createElement("button",{"aria-label":ae,"data-disabled":Wa,"data-close-button":!0,onClick:Wa||!Dn?()=>{}:()=>{Ln(),m.onDismiss==null||m.onDismiss.call(m,m)},className:In(U?.closeButton,m==null||(i=m.classNames)==null?void 0:i.closeButton)},(Un=F?.close)!=null?Un:YA):null,(ht||m.icon||m.promise)&&m.icon!==null&&(F?.[ht]!==null||m.icon)?W.createElement("div",{"data-icon":"",className:In(U?.icon,m==null||(l=m.classNames)==null?void 0:l.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Gs():null,m.type!=="loading"?Ks:null):null,W.createElement("div",{"data-content":"",className:In(U?.content,m==null||(u=m.classNames)==null?void 0:u.content)},W.createElement("div",{"data-title":"",className:In(U?.title,m==null||(c=m.classNames)==null?void 0:c.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?W.createElement("div",{"data-description":"",className:In(ie,Ue,U?.description,m==null||(f=m.classNames)==null?void 0:f.description)},typeof m.description=="function"?m.description():m.description):null),W.isValidElement(m.cancel)?m.cancel:m.cancel&&ql(m.cancel)?W.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||Y,onClick:pe=>{ql(m.cancel)&&Dn&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,pe),Ln())},className:In(U?.cancelButton,m==null||(p=m.classNames)==null?void 0:p.cancelButton)},m.cancel.label):null,W.isValidElement(m.action)?m.action:m.action&&ql(m.action)?W.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||Z,onClick:pe=>{ql(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,pe),!pe.defaultPrevented&&Ln())},className:In(U?.actionButton,m==null||(g=m.classNames)==null?void 0:g.actionButton)},m.action.label):null)};function ev(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function cO(e,t){const s={};return[e,t].forEach((i,l)=>{const u=l===1,c=u?"--mobile-offset":"--offset",f=u?rO:nO;function p(g){["top","right","bottom","left"].forEach(y=>{s[`${c}-${y}`]=typeof g=="number"?`${g}px`:g})}typeof i=="number"||typeof i=="string"?p(i):typeof i=="object"?["top","right","bottom","left"].forEach(g=>{i[g]===void 0?s[`${c}-${g}`]=f:s[`${c}-${g}`]=typeof i[g]=="number"?`${i[g]}px`:i[g]}):p(f)}),s}const hO=W.forwardRef(function(t,s){const{id:i,invert:l,position:u="bottom-right",hotkey:c=["altKey","KeyT"],expand:f,closeButton:p,className:g,offset:y,mobileOffset:m,theme:b="light",richColors:_,duration:S,style:O,visibleToasts:E=tO,toastOptions:A,dir:M=ev(),gap:j=aO,icons:D,containerAriaLabel:X="Notifications"}=t,[K,H]=W.useState([]),Y=W.useMemo(()=>i?K.filter(G=>G.toasterId===i):K.filter(G=>!G.toasterId),[K,i]),Z=W.useMemo(()=>Array.from(new Set([u].concat(Y.filter(G=>G.position).map(G=>G.position)))),[Y,u]),[le,ie]=W.useState([]),[me,_e]=W.useState(!1),[qe,Me]=W.useState(!1),[U,F]=W.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ae=W.useRef(null),Se=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),ye=W.useRef(null),C=W.useRef(!1),q=W.useCallback(G=>{H(Q=>{var ee;return(ee=Q.find(ce=>ce.id===G.id))!=null&&ee.delete||Ft.dismiss(G.id),Q.filter(({id:ce})=>ce!==G.id)})},[]);return W.useEffect(()=>Ft.subscribe(G=>{if(G.dismiss){requestAnimationFrame(()=>{H(Q=>Q.map(ee=>ee.id===G.id?{...ee,delete:!0}:ee))});return}setTimeout(()=>{AR.flushSync(()=>{H(Q=>{const ee=Q.findIndex(ce=>ce.id===G.id);return ee!==-1?[...Q.slice(0,ee),{...Q[ee],...G},...Q.slice(ee+1)]:[G,...Q]})})})}),[K]),W.useEffect(()=>{if(b!=="system"){F(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;const G=window.matchMedia("(prefers-color-scheme: dark)");try{G.addEventListener("change",({matches:Q})=>{F(Q?"dark":"light")})}catch{G.addListener(({matches:ee})=>{try{F(ee?"dark":"light")}catch(ce){console.error(ce)}})}},[b]),W.useEffect(()=>{K.length<=1&&_e(!1)},[K]),W.useEffect(()=>{const G=Q=>{var ee;if(c.every(de=>Q[de]||Q.code===de)){var we;_e(!0),(we=ae.current)==null||we.focus()}Q.code==="Escape"&&(document.activeElement===ae.current||(ee=ae.current)!=null&&ee.contains(document.activeElement))&&_e(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[c]),W.useEffect(()=>{if(ae.current)return()=>{ye.current&&(ye.current.focus({preventScroll:!0}),ye.current=null,C.current=!1)}},[ae.current]),W.createElement("section",{ref:s,"aria-label":`${X} ${Se}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},Z.map((G,Q)=>{var ee;const[ce,we]=G.split("-");return Y.length?W.createElement("ol",{key:G,dir:M==="auto"?ev():M,tabIndex:-1,ref:ae,className:g,"data-sonner-toaster":!0,"data-sonner-theme":U,"data-y-position":ce,"data-x-position":we,style:{"--front-toast-height":`${((ee=le[0])==null?void 0:ee.height)||0}px`,"--width":`${sO}px`,"--gap":`${j}px`,...O,...cO(y,m)},onBlur:de=>{C.current&&!de.currentTarget.contains(de.relatedTarget)&&(C.current=!1,ye.current&&(ye.current.focus({preventScroll:!0}),ye.current=null))},onFocus:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||C.current||(C.current=!0,ye.current=de.relatedTarget)},onMouseEnter:()=>_e(!0),onMouseMove:()=>_e(!0),onMouseLeave:()=>{qe||_e(!1)},onDragEnd:()=>_e(!1),onPointerDown:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||Me(!0)},onPointerUp:()=>Me(!1)},Y.filter(de=>!de.position&&Q===0||de.position===G).map((de,xe)=>{var Dt,Lt;return W.createElement(uO,{key:de.id,icons:D,index:xe,toast:de,defaultRichColors:_,duration:(Dt=A?.duration)!=null?Dt:S,className:A?.className,descriptionClassName:A?.descriptionClassName,invert:l,visibleToasts:E,closeButton:(Lt=A?.closeButton)!=null?Lt:p,interacting:qe,position:G,style:A?.style,unstyled:A?.unstyled,classNames:A?.classNames,cancelButtonStyle:A?.cancelButtonStyle,actionButtonStyle:A?.actionButtonStyle,closeButtonAriaLabel:A?.closeButtonAriaLabel,removeToast:q,toasts:Y.filter(kt=>kt.position==de.position),heights:le.filter(kt=>kt.position==de.position),setHeights:ie,expandByDefault:f,gap:j,expanded:me,swipeDirections:t.swipeDirections})})):null}))});function Au(e,t){var s={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,i=Object.getOwnPropertySymbols(e);l<i.length;l++)t.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(e,i[l])&&(s[i[l]]=e[i[l]]);return s}function fO(e,t,s,i){function l(u){return u instanceof s?u:new s(function(c){c(u)})}return new(s||(s=Promise))(function(u,c){function f(y){try{g(i.next(y))}catch(m){c(m)}}function p(y){try{g(i.throw(y))}catch(m){c(m)}}function g(y){y.done?u(y.value):l(y.value).then(f,p)}g((i=i.apply(e,t||[])).next())})}const dO=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class ed extends Error{constructor(t,s="FunctionsError",i){super(t),this.name=s,this.context=i}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class pO extends ed{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class tv extends ed{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class nv extends ed{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var xf;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(xf||(xf={}));class gO{constructor(t,{headers:s={},customFetch:i,region:l=xf.Any}={}){this.url=t,this.headers=s,this.region=l,this.fetch=dO(i)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return fO(this,arguments,void 0,function*(s,i={}){var l;let u,c;try{const{headers:f,method:p,body:g,signal:y,timeout:m}=i;let b={},{region:_}=i;_||(_=this.region);const S=new URL(`${this.url}/${s}`);_&&_!=="any"&&(b["x-region"]=_,S.searchParams.set("forceFunctionRegion",_));let O;g&&(f&&!Object.prototype.hasOwnProperty.call(f,"Content-Type")||!f)?typeof Blob<"u"&&g instanceof Blob||g instanceof ArrayBuffer?(b["Content-Type"]="application/octet-stream",O=g):typeof g=="string"?(b["Content-Type"]="text/plain",O=g):typeof FormData<"u"&&g instanceof FormData?O=g:(b["Content-Type"]="application/json",O=JSON.stringify(g)):g&&typeof g!="string"&&!(typeof Blob<"u"&&g instanceof Blob)&&!(g instanceof ArrayBuffer)&&!(typeof FormData<"u"&&g instanceof FormData)?O=JSON.stringify(g):O=g;let E=y;m&&(c=new AbortController,u=setTimeout(()=>c.abort(),m),y?(E=c.signal,y.addEventListener("abort",()=>c.abort())):E=c.signal);const A=yield this.fetch(S.toString(),{method:p||"POST",headers:Object.assign(Object.assign(Object.assign({},b),this.headers),f),body:O,signal:E}).catch(X=>{throw new pO(X)}),M=A.headers.get("x-relay-error");if(M&&M==="true")throw new tv(A);if(!A.ok)throw new nv(A);let j=((l=A.headers.get("Content-Type"))!==null&&l!==void 0?l:"text/plain").split(";")[0].trim(),D;return j==="application/json"?D=yield A.json():j==="application/octet-stream"||j==="application/pdf"?D=yield A.blob():j==="text/event-stream"?D=A:j==="multipart/form-data"?D=yield A.formData():D=yield A.text(),{data:D,error:null,response:A}}catch(f){return{data:null,error:f,response:f instanceof nv||f instanceof tv?f.context:void 0}}finally{u&&clearTimeout(u)}})}}const nb=3,rv=e=>Math.min(1e3*2**e,3e4),mO=[520,503],rb=["GET","HEAD","OPTIONS"];var yO=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function sv(e,t){return new Promise(s=>{if(t?.aborted){s();return}const i=setTimeout(()=>{t?.removeEventListener("abort",l),s()},e);function l(){clearTimeout(i),s()}t?.addEventListener("abort",l)})}function vO(e,t,s,i){return!(!i||s>=nb||!rb.includes(e)||!mO.includes(t))}var bO=class{constructor(e){var t,s,i,l,u;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(s=e.isMaybeSingle)!==null&&s!==void 0?s:!1,this.shouldStripNulls=(i=e.shouldStripNulls)!==null&&i!==void 0?i:!1,this.urlLengthLimit=(l=e.urlLengthLimit)!==null&&l!==void 0?l:8e3,this.retryEnabled=(u=e.retry)!==null&&u!==void 0?u:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var s=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const c=this.headers.get("Accept");c==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!c||c==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const i=this.fetch;let u=(async()=>{let c=0;for(;;){const g=new Headers(s.headers);c>0&&g.set("X-Retry-Count",String(c));let y;try{y=await i(s.url.toString(),{method:s.method,headers:g,body:JSON.stringify(s.body,(m,b)=>typeof b=="bigint"?b.toString():b),signal:s.signal})}catch(m){if(m?.name==="AbortError"||m?.code==="ABORT_ERR"||!rb.includes(s.method))throw m;if(s.retryEnabled&&c<nb){const b=rv(c);c++,await sv(b,s.signal);continue}throw m}if(vO(s.method,y.status,c,s.retryEnabled)){var f,p;const m=(f=(p=y.headers)===null||p===void 0?void 0:p.get("Retry-After"))!==null&&f!==void 0?f:null,b=m!==null?Math.max(0,parseInt(m,10)||0)*1e3:rv(c);await y.text(),c++,await sv(b,s.signal);continue}return await s.processResponse(y)}})();return this.shouldThrowOnError||(u=u.catch(c=>{var f;let p="",g="",y="";const m=c?.cause;if(m){var b,_,S,O;const M=(b=m?.message)!==null&&b!==void 0?b:"",j=(_=m?.code)!==null&&_!==void 0?_:"";p=`${(S=c?.name)!==null&&S!==void 0?S:"FetchError"}: ${c?.message}`,p+=`

Caused by: ${(O=m?.name)!==null&&O!==void 0?O:"Error"}: ${M}`,j&&(p+=` (${j})`),m?.stack&&(p+=`
${m.stack}`)}else{var E;p=(E=c?.stack)!==null&&E!==void 0?E:""}const A=this.url.toString().length;return c?.name==="AbortError"||c?.code==="ABORT_ERR"?(y="",g="Request was aborted (timeout or manual cancellation)",A>this.urlLengthLimit&&(g+=`. Note: Your request URL is ${A} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):(m?.name==="HeadersOverflowError"||m?.code==="UND_ERR_HEADERS_OVERFLOW")&&(y="",g="HTTP headers exceeded server limits (typically 16KB)",A>this.urlLengthLimit&&(g+=`. Your request URL is ${A} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(f=c?.name)!==null&&f!==void 0?f:"FetchError"}: ${c?.message}`,details:p,hint:g,code:y},data:null,count:null,status:0,statusText:""}})),u.then(e,t)}async processResponse(e){var t=this;let s=null,i=null,l=null,u=e.status,c=e.statusText;if(e.ok){var f,p;if(t.method!=="HEAD"){var g;const b=await e.text();b===""||(t.headers.get("Accept")==="text/csv"||t.headers.get("Accept")&&(!((g=t.headers.get("Accept"))===null||g===void 0)&&g.includes("application/vnd.pgrst.plan+text"))?i=b:i=JSON.parse(b))}const y=(f=t.headers.get("Prefer"))===null||f===void 0?void 0:f.match(/count=(exact|planned|estimated)/),m=(p=e.headers.get("content-range"))===null||p===void 0?void 0:p.split("/");y&&m&&m.length>1&&(l=parseInt(m[1])),t.isMaybeSingle&&Array.isArray(i)&&(i.length>1?(s={code:"PGRST116",details:`Results contain ${i.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},i=null,l=null,u=406,c="Not Acceptable"):i.length===1?i=i[0]:i=null)}else{const y=await e.text();try{s=JSON.parse(y),Array.isArray(s)&&e.status===404&&(i=[],s=null,u=200,c="OK")}catch{e.status===404&&y===""?(u=204,c="No Content"):s={message:y}}if(s&&t.shouldThrowOnError)throw new yO(s)}return{success:s===null,error:s,data:i,count:l,status:u,statusText:c}}returns(){return this}overrideTypes(){return this}},_O=class extends bO{select(e){let t=!1;const s=(e??"*").split("").map(i=>/\s/.test(i)&&!t?"":(i==='"'&&(t=!t),i)).join("");return this.url.searchParams.set("select",s),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:s,foreignTable:i,referencedTable:l=i}={}){const u=l?`${l}.order`:"order",c=this.url.searchParams.get(u);return this.url.searchParams.set(u,`${c?`${c},`:""}${e}.${t?"asc":"desc"}${s===void 0?"":s?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:s=t}={}){const i=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(i,`${e}`),this}range(e,t,{foreignTable:s,referencedTable:i=s}={}){const l=typeof i>"u"?"offset":`${i}.offset`,u=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(l,`${e}`),this.url.searchParams.set(u,`${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 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:s=!1,buffers:i=!1,wal:l=!1,format:u="text"}={}){var c;const f=[e?"analyze":null,t?"verbose":null,s?"settings":null,i?"buffers":null,l?"wal":null].filter(Boolean).join("|"),p=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${u}; for="${p}"; options=${f};`),u==="json"?this: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}};const av=new RegExp("[,()]");var Ba=class extends _O{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){const s=Array.from(new Set(t)).map(i=>typeof i=="string"&&av.test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(e,`in.(${s})`),this}notIn(e,t){const s=Array.from(new Set(t)).map(i=>typeof i=="string"&&av.test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(e,`not.in.(${s})`),this}contains(e,t){return typeof t=="string"?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 typeof t=="string"?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 typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:s,type:i}={}){let l="";i==="plain"?l="pl":i==="phrase"?l="ph":i==="websearch"&&(l="w");const u=s===void 0?"":`(${s})`;return this.url.searchParams.append(e,`${l}fts${u}.${t}`),this}match(e){return Object.entries(e).filter(([t,s])=>s!==void 0).forEach(([t,s])=>{this.url.searchParams.append(t,`eq.${s}`)}),this}not(e,t,s){return this.url.searchParams.append(e,`not.${t}.${s}`),this}or(e,{foreignTable:t,referencedTable:s=t}={}){const i=s?`${s}.or`:"or";return this.url.searchParams.append(i,`(${e})`),this}filter(e,t,s){return this.url.searchParams.append(e,`${t}.${s}`),this}},wO=class{constructor(e,{headers:t={},schema:s,fetch:i,urlLengthLimit:l=8e3,retry:u}){this.url=e,this.headers=new Headers(t),this.schema=s,this.fetch=i,this.urlLengthLimit=l,this.retry=u}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:s=!1,count:i}=t??{},l=s?"HEAD":"GET";let u=!1;const c=(e??"*").split("").map(g=>/\s/.test(g)&&!u?"":(g==='"'&&(u=!u),g)).join(""),{url:f,headers:p}=this.cloneRequestState();return f.searchParams.set("select",c),i&&p.append("Prefer",`count=${i}`),new Ba({method:l,url:f,headers:p,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:s=!0}={}){var i;const l="POST",{url:u,headers:c}=this.cloneRequestState();if(t&&c.append("Prefer",`count=${t}`),s||c.append("Prefer","missing=default"),Array.isArray(e)){const f=e.reduce((p,g)=>p.concat(Object.keys(g)),[]);if(f.length>0){const p=[...new Set(f)].map(g=>`"${g}"`);u.searchParams.set("columns",p.join(","))}}return new Ba({method:l,url:u,headers:c,schema:this.schema,body:e,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:s=!1,count:i,defaultToNull:l=!0}={}){var u;const c="POST",{url:f,headers:p}=this.cloneRequestState();if(p.append("Prefer",`resolution=${s?"ignore":"merge"}-duplicates`),t!==void 0&&f.searchParams.set("on_conflict",t),i&&p.append("Prefer",`count=${i}`),l||p.append("Prefer","missing=default"),Array.isArray(e)){const g=e.reduce((y,m)=>y.concat(Object.keys(m)),[]);if(g.length>0){const y=[...new Set(g)].map(m=>`"${m}"`);f.searchParams.set("columns",y.join(","))}}return new Ba({method:c,url:f,headers:p,schema:this.schema,body:e,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var s;const i="PATCH",{url:l,headers:u}=this.cloneRequestState();return t&&u.append("Prefer",`count=${t}`),new Ba({method:i,url:l,headers:u,schema:this.schema,body:e,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const s="DELETE",{url:i,headers:l}=this.cloneRequestState();return e&&l.append("Prefer",`count=${e}`),new Ba({method:s,url:i,headers:l,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function ho(e){"@babel/helpers - typeof";return ho=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ho(e)}function SO(e,t){if(ho(e)!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var i=s.call(e,t);if(ho(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function EO(e){var t=SO(e,"string");return ho(t)=="symbol"?t:t+""}function TO(e,t,s){return(t=EO(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function iv(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),s.push.apply(s,i)}return s}function $l(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{};t%2?iv(Object(s),!0).forEach(function(i){TO(e,i,s[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):iv(Object(s)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(s,i))})}return e}var RO=class sb{constructor(t,{headers:s={},schema:i,fetch:l,timeout:u,urlLengthLimit:c=8e3,retry:f}={}){this.url=t,this.headers=new Headers(s),this.schemaName=i,this.urlLengthLimit=c;const p=l??globalThis.fetch;u!==void 0&&u>0?this.fetch=(g,y)=>{const m=new AbortController,b=setTimeout(()=>m.abort(),u),_=y?.signal;if(_){if(_.aborted)return clearTimeout(b),p(g,y);const S=()=>{clearTimeout(b),m.abort()};return _.addEventListener("abort",S,{once:!0}),p(g,$l($l({},y),{},{signal:m.signal})).finally(()=>{clearTimeout(b),_.removeEventListener("abort",S)})}return p(g,$l($l({},y),{},{signal:m.signal})).finally(()=>clearTimeout(b))}:this.fetch=p,this.retry=f}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new wO(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new sb(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,s={},{head:i=!1,get:l=!1,count:u}={}){var c;let f;const p=new URL(`${this.url}/rpc/${t}`);let g;const y=_=>_!==null&&typeof _=="object"&&(!Array.isArray(_)||_.some(y)),m=i&&Object.values(s).some(y);m?(f="POST",g=s):i||l?(f=i?"HEAD":"GET",Object.entries(s).filter(([_,S])=>S!==void 0).map(([_,S])=>[_,Array.isArray(S)?`{${S.join(",")}}`:`${S}`]).forEach(([_,S])=>{p.searchParams.append(_,S)})):(f="POST",g=s);const b=new Headers(this.headers);return m?b.set("Prefer",u?`count=${u},return=minimal`:"return=minimal"):u&&b.set("Prefer",`count=${u}`),new Ba({method:f,url:p,headers:b,schema:this.schemaName,body:g,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class AO{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const s=globalThis;if(typeof globalThis<"u"&&typeof s.WebSocket<"u")return{type:"native",wsConstructor:s.WebSocket};const i=typeof global<"u"?global:void 0;if(i&&typeof i.WebSocket<"u")return{type:"native",wsConstructor:i.WebSocket};if(typeof globalThis<"u"&&typeof s.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")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(typeof globalThis<"u"&&s.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.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."};const l=globalThis.process;if(l){const u=l.versions;if(u&&u.node){const c=u.node,f=parseInt(c.replace(/^v/,"").split(".")[0]);return f>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${f} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${f} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
import ws from "ws"
new 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(){const t=this.detectEnvironment();if(t.wsConstructor)return t.wsConstructor;let s=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(s+=`

Suggested solution: ${t.workaround}`),new Error(s)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const OO="2.106.0",xO=`realtime-js/${OO}`,CO="1.0.0",ab="2.0.0",kO=ab,jO=1e4,MO=100,Xr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},ib={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Cf={connecting:"connecting",closing:"closing",closed:"closed"};class NO{constructor(t){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=t??[]}encode(t,s){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return s(this._binaryEncodeUserBroadcastPush(t));let i=[t.join_ref,t.ref,t.topic,t.event,t.payload];return s(JSON.stringify(i))}_binaryEncodeUserBroadcastPush(t){var s;return this._isArrayBuffer((s=t.payload)===null||s===void 0?void 0:s.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var s,i;const l=(i=(s=t.payload)===null||s===void 0?void 0:s.payload)!==null&&i!==void 0?i:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,l)}_encodeJsonUserBroadcastPush(t){var s,i;const l=(i=(s=t.payload)===null||s===void 0?void 0:s.payload)!==null&&i!==void 0?i:{},c=new TextEncoder().encode(JSON.stringify(l)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,c)}_encodeUserBroadcastPush(t,s,i){var l,u;const c=t.topic,f=(l=t.ref)!==null&&l!==void 0?l:"",p=(u=t.join_ref)!==null&&u!==void 0?u:"",g=t.payload.event,y=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},m=Object.keys(y).length===0?"":JSON.stringify(y);if(p.length>255)throw new Error(`joinRef length ${p.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`ref length ${f.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`topic length ${c.length} exceeds maximum of 255`);if(g.length>255)throw new Error(`userEvent length ${g.length} exceeds maximum of 255`);if(m.length>255)throw new Error(`metadata length ${m.length} exceeds maximum of 255`);const b=this.USER_BROADCAST_PUSH_META_LENGTH+p.length+f.length+c.length+g.length+m.length,_=new ArrayBuffer(this.HEADER_LENGTH+b);let S=new DataView(_),O=0;S.setUint8(O++,this.KINDS.userBroadcastPush),S.setUint8(O++,p.length),S.setUint8(O++,f.length),S.setUint8(O++,c.length),S.setUint8(O++,g.length),S.setUint8(O++,m.length),S.setUint8(O++,s),Array.from(p,A=>S.setUint8(O++,A.charCodeAt(0))),Array.from(f,A=>S.setUint8(O++,A.charCodeAt(0))),Array.from(c,A=>S.setUint8(O++,A.charCodeAt(0))),Array.from(g,A=>S.setUint8(O++,A.charCodeAt(0))),Array.from(m,A=>S.setUint8(O++,A.charCodeAt(0)));var E=new Uint8Array(_.byteLength+i.byteLength);return E.set(new Uint8Array(_),0),E.set(new Uint8Array(i),_.byteLength),E.buffer}decode(t,s){if(this._isArrayBuffer(t)){let i=this._binaryDecode(t);return s(i)}if(typeof t=="string"){const i=JSON.parse(t),[l,u,c,f,p]=i;return s({join_ref:l,ref:u,topic:c,event:f,payload:p})}return s({})}_binaryDecode(t){const s=new DataView(t),i=s.getUint8(0),l=new TextDecoder;if(i===this.KINDS.userBroadcast)return this._decodeUserBroadcast(t,s,l)}_decodeUserBroadcast(t,s,i){const l=s.getUint8(1),u=s.getUint8(2),c=s.getUint8(3),f=s.getUint8(4);let p=this.HEADER_LENGTH+4;const g=i.decode(t.slice(p,p+l));p=p+l;const y=i.decode(t.slice(p,p+u));p=p+u;const m=i.decode(t.slice(p,p+c));p=p+c;const b=t.slice(p,t.byteLength),_=f===this.JSON_ENCODING?JSON.parse(i.decode(b)):b,S={type:this.BROADCAST_EVENT,event:y,payload:_};return c>0&&(S.meta=JSON.parse(m)),{join_ref:null,ref:null,topic:g,event:this.BROADCAST_EVENT,payload:S}}_isArrayBuffer(t){var s;return t instanceof ArrayBuffer||((s=t?.constructor)===null||s===void 0?void 0:s.name)==="ArrayBuffer"}_pick(t,s){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([i])=>s.includes(i)))}}var $e;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})($e||($e={}));const ov=(e,t,s={})=>{var i;const l=(i=s.skipTypes)!==null&&i!==void 0?i:[];return t?Object.keys(t).reduce((u,c)=>(u[c]=DO(c,e,t,l),u),{}):{}},DO=(e,t,s,i)=>{const l=t.find(f=>f.name===e),u=l?.type,c=s[e];return u&&!i.includes(u)?ob(u,c):kf(c)},ob=(e,t)=>{if(e.charAt(0)==="_"){const s=e.slice(1,e.length);return PO(t,s)}switch(e){case $e.bool:return LO(t);case $e.float4:case $e.float8:case $e.int2:case $e.int4:case $e.int8:case $e.numeric:case $e.oid:return UO(t);case $e.json:case $e.jsonb:return zO(t);case $e.timestamp:return BO(t);case $e.abstime:case $e.date:case $e.daterange:case $e.int4range:case $e.int8range:case $e.money:case $e.reltime:case $e.text:case $e.time:case $e.timestamptz:case $e.timetz:case $e.tsrange:case $e.tstzrange:return kf(t);default:return kf(t)}},kf=e=>e,LO=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},UO=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},zO=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},PO=(e,t)=>{if(typeof e!="string")return e;const s=e.length-1,i=e[s];if(e[0]==="{"&&i==="}"){let u;const c=e.slice(1,s);try{u=JSON.parse("["+c+"]")}catch{u=c?c.split(","):[]}return u.map(f=>ob(t,f))}return e},BO=e=>typeof e=="string"?e.replace(" ","T"):e,lb=e=>{const 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};var to=e=>typeof e=="function"?e:function(){return e},HO=typeof self<"u"?self:null,Ha=typeof window<"u"?window:null,Vn=HO||Ha||globalThis,IO="2.0.0",qO=1e4,$O=1e3,Kn={connecting:0,open:1,closing:2,closed:3},Yt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},mr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},jf={longpoll:"longpoll",websocket:"websocket"},VO={complete:4},Mf="base64url.bearer.phx.",Vl=class{constructor(e,t,s,i){this.channel=e,this.event=t,this.payload=s||function(){return{}},this.receivedResp=null,this.timeout=i,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),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()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:s}){this.recHooks.filter(i=>i.status===e).forEach(i=>i.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),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)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},ub=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},GO=class{constructor(e,t,s){this.state=Yt.closed,this.topic=e,this.params=to(t||{}),this.socket=s,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Vl(this,mr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new ub(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Yt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(i=>i.send()),this.pushBuffer=[]}),this.joinPush.receive("error",i=>{this.state=Yt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,i),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Yt.closed,this.socket.remove(this)}),this.onError(i=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,i),this.isJoining()&&this.joinPush.reset(),this.state=Yt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new Vl(this,mr.leave,to({}),this.timeout).send(),this.state=Yt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(mr.reply,(i,l)=>{this.trigger(this.replyEventName(l),i)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Yt.closed,this.bindings=[]}onClose(e){this.on(mr.close,e)}onError(e){return this.on(mr.error,t=>e(t))}on(e,t){let s=this.bindingRef++;return this.bindings.push({event:e,ref:s,callback:t}),s}off(e,t){this.bindings=this.bindings.filter(s=>!(s.event===e&&(typeof t>"u"||t===s.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,s=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let i=new Vl(this,e,function(){return t},s);return this.canPush()?i.send():(i.startTimeout(),this.pushBuffer.push(i)),i}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Yt.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(mr.close,"leave")},s=new Vl(this,mr.leave,to({}),e);return s.receive("ok",()=>t()).receive("timeout",()=>t()),s.send(),this.canPush()||s.trigger("ok",{}),s}onMessage(e,t,s){return t}filterBindings(e,t,s){return!0}isMember(e,t,s,i){return this.topic!==e?!1:i&&i!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:s,joinRef:i}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Yt.joining,this.joinPush.resend(e))}trigger(e,t,s,i){let l=this.onMessage(e,t,s,i);if(t&&!l)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let u=this.bindings.filter(c=>c.event===e&&this.filterBindings(c,t,s));for(let c=0;c<u.length;c++)u[c].callback(l,s,i||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===Yt.closed}isErrored(){return this.state===Yt.errored}isJoined(){return this.state===Yt.joined}isJoining(){return this.state===Yt.joining}isLeaving(){return this.state===Yt.leaving}},hu=class{static request(e,t,s,i,l,u,c){if(Vn.XDomainRequest){let f=new Vn.XDomainRequest;return this.xdomainRequest(f,e,t,i,l,u,c)}else if(Vn.XMLHttpRequest){let f=new Vn.XMLHttpRequest;return this.xhrRequest(f,e,t,s,i,l,u,c)}else{if(Vn.fetch&&Vn.AbortController)return this.fetchRequest(e,t,s,i,l,u,c);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,s,i,l,u,c){let f={method:e,headers:s,body:i},p=null;return l&&(p=new AbortController,setTimeout(()=>p.abort(),l),f.signal=p.signal),Vn.fetch(t,f).then(g=>g.text()).then(g=>this.parseJSON(g)).then(g=>c&&c(g)).catch(g=>{g.name==="AbortError"&&u?u():c&&c(null)}),p}static xdomainRequest(e,t,s,i,l,u,c){return e.timeout=l,e.open(t,s),e.onload=()=>{let f=this.parseJSON(e.responseText);c&&c(f)},u&&(e.ontimeout=u),e.onprogress=()=>{},e.send(i),e}static xhrRequest(e,t,s,i,l,u,c,f){e.open(t,s,!0),e.timeout=u;for(let[p,g]of Object.entries(i))e.setRequestHeader(p,g);return e.onerror=()=>f&&f(null),e.onreadystatechange=()=>{if(e.readyState===VO.complete&&f){let p=this.parseJSON(e.responseText);f(p)}},c&&(e.ontimeout=c),e.send(l),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let s=[];for(var i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let l=t?`${t}[${i}]`:i,u=e[i];typeof u=="object"?s.push(this.serialize(u,l)):s.push(encodeURIComponent(l)+"="+encodeURIComponent(u))}return s.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let s=e.match(/\?/)?"&":"?";return`${e}${s}${this.serialize(t)}`}},KO=e=>{let t="",s=new Uint8Array(e),i=s.byteLength;for(let l=0;l<i;l++)t+=String.fromCharCode(s[l]);return btoa(t)},Na=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(Mf)&&(this.authToken=atob(t[1].slice(Mf.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=Kn.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+jf.websocket),"$1/"+jf.longpoll)}endpointURL(){return hu.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,s){this.close(e,t,s),this.readyState=Kn.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Kn.open||this.readyState===Kn.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:s,token:i,messages:l}=t;if(s===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=i}else s=0;switch(s){case 200:l.forEach(u=>{setTimeout(()=>this.onmessage({data:u}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Kn.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${s}`)}})}send(e){typeof e!="string"&&(e=KO(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(`
`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,s){for(let l of this.reqs)l.abort();this.readyState=Kn.closed;let i=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:s});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",i)):this.onclose(i)}ajax(e,t,s,i,l){let u,c=()=>{this.reqs.delete(u),i()};u=hu.request(e,this.endpointURL(),t,s,this.timeout,c,f=>{this.reqs.delete(u),this.isActive()&&l(f)}),this.reqs.add(u)}},YO=class Wi{constructor(t,s={}){let i=s.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(i.state,l=>{let{onJoin:u,onLeave:c,onSync:f}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Wi.syncState(this.state,l,u,c),this.pendingDiffs.forEach(p=>{this.state=Wi.syncDiff(this.state,p,u,c)}),this.pendingDiffs=[],f()}),this.channel.on(i.diff,l=>{let{onJoin:u,onLeave:c,onSync:f}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(l):(this.state=Wi.syncDiff(this.state,l,u,c),f())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return Wi.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,s,i,l){let u=this.clone(t),c={},f={};return this.map(u,(p,g)=>{s[p]||(f[p]=g)}),this.map(s,(p,g)=>{let y=u[p];if(y){let m=g.metas.map(O=>O.phx_ref),b=y.metas.map(O=>O.phx_ref),_=g.metas.filter(O=>b.indexOf(O.phx_ref)<0),S=y.metas.filter(O=>m.indexOf(O.phx_ref)<0);_.length>0&&(c[p]=g,c[p].metas=_),S.length>0&&(f[p]=this.clone(y),f[p].metas=S)}else c[p]=g}),this.syncDiff(u,{joins:c,leaves:f},i,l)}static syncDiff(t,s,i,l){let{joins:u,leaves:c}=this.clone(s);return i||(i=function(){}),l||(l=function(){}),this.map(u,(f,p)=>{let g=t[f];if(t[f]=this.clone(p),g){let y=t[f].metas.map(b=>b.phx_ref),m=g.metas.filter(b=>y.indexOf(b.phx_ref)<0);t[f].metas.unshift(...m)}i(f,g,p)}),this.map(c,(f,p)=>{let g=t[f];if(!g)return;let y=p.metas.map(m=>m.phx_ref);g.metas=g.metas.filter(m=>y.indexOf(m.phx_ref)<0),l(f,g,p),g.metas.length===0&&delete t[f]}),t}static list(t,s){return s||(s=function(i,l){return l}),this.map(t,(i,l)=>s(i,l))}static map(t,s){return Object.getOwnPropertyNames(t).map(i=>s(i,t[i]))}static clone(t){return JSON.parse(JSON.stringify(t))}},Gl={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let s=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(s))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[s,i,l,u,c]=JSON.parse(e);return t({join_ref:s,ref:i,topic:l,event:u,payload:c})}},binaryEncode(e){let{join_ref:t,ref:s,event:i,topic:l,payload:u}=e,c=this.META_LENGTH+t.length+s.length+l.length+i.length,f=new ArrayBuffer(this.HEADER_LENGTH+c),p=new DataView(f),g=0;p.setUint8(g++,this.KINDS.push),p.setUint8(g++,t.length),p.setUint8(g++,s.length),p.setUint8(g++,l.length),p.setUint8(g++,i.length),Array.from(t,m=>p.setUint8(g++,m.charCodeAt(0))),Array.from(s,m=>p.setUint8(g++,m.charCodeAt(0))),Array.from(l,m=>p.setUint8(g++,m.charCodeAt(0))),Array.from(i,m=>p.setUint8(g++,m.charCodeAt(0)));var y=new Uint8Array(f.byteLength+u.byteLength);return y.set(new Uint8Array(f),0),y.set(new Uint8Array(u),f.byteLength),y.buffer},binaryDecode(e){let t=new DataView(e),s=t.getUint8(0),i=new TextDecoder;switch(s){case this.KINDS.push:return this.decodePush(e,t,i);case this.KINDS.reply:return this.decodeReply(e,t,i);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,i)}},decodePush(e,t,s){let i=t.getUint8(1),l=t.getUint8(2),u=t.getUint8(3),c=this.HEADER_LENGTH+this.META_LENGTH-1,f=s.decode(e.slice(c,c+i));c=c+i;let p=s.decode(e.slice(c,c+l));c=c+l;let g=s.decode(e.slice(c,c+u));c=c+u;let y=e.slice(c,e.byteLength);return{join_ref:f,ref:null,topic:p,event:g,payload:y}},decodeReply(e,t,s){let i=t.getUint8(1),l=t.getUint8(2),u=t.getUint8(3),c=t.getUint8(4),f=this.HEADER_LENGTH+this.META_LENGTH,p=s.decode(e.slice(f,f+i));f=f+i;let g=s.decode(e.slice(f,f+l));f=f+l;let y=s.decode(e.slice(f,f+u));f=f+u;let m=s.decode(e.slice(f,f+c));f=f+c;let b=e.slice(f,e.byteLength),_={status:m,response:b};return{join_ref:p,ref:g,topic:y,event:mr.reply,payload:_}},decodeBroadcast(e,t,s){let i=t.getUint8(1),l=t.getUint8(2),u=this.HEADER_LENGTH+2,c=s.decode(e.slice(u,u+i));u=u+i;let f=s.decode(e.slice(u,u+l));u=u+l;let p=e.slice(u,e.byteLength);return{join_ref:null,ref:null,topic:c,event:f,payload:p}}},FO=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||qO,this.transport=t.transport||Vn.WebSocket||Na,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let s=null;try{s=Vn&&Vn.sessionStorage}catch{}this.sessionStore=t.sessionStorage||s,this.establishedConnections=0,this.defaultEncoder=Gl.encode.bind(Gl),this.defaultDecoder=Gl.decode.bind(Gl),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Na?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let i=null;Ha&&Ha.addEventListener&&(Ha.addEventListener("pagehide",l=>{this.conn&&(this.disconnect(),i=this.connectClock)}),Ha.addEventListener("pageshow",l=>{i===this.connectClock&&(i=null,this.connect())}),Ha.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=l=>t.rejoinAfterMs?t.rejoinAfterMs(l):[1e3,2e3,5e3][l-1]||1e4,this.reconnectAfterMs=l=>t.reconnectAfterMs?t.reconnectAfterMs(l):[10,50,100,150,200,250,500,1e3,2e3][l-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(l,u,c)=>{console.log(`${l}: ${u}`,c)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=to(t.params||{}),this.endPoint=`${e}/${jf.websocket}`,this.vsn=t.vsn||IO,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new ub(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return Na}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=hu.appendParams(hu.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,s){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,s)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=to(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Na?this.connectWithFallback(Na,this.longPollFallbackMs):this.transportConnect())}log(e,t,s){this.logger&&this.logger(e,t,s)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),s=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let i=this.onMessage(l=>{l.ref===t&&(this.off([i]),e(Date.now()-s))});return!0}transportName(e){return e===Na?"LongPoll":e.name}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${Mf}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let s=!1,i=!0,l,u,c=this.transportName(e),f=p=>{this.log("transport",`falling back to ${c}...`,p),this.off([l,u]),i=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${c}`))return f("memorized");this.fallbackTimer=setTimeout(f,t),u=this.onError(p=>{this.log("transport","error",p),i&&!s&&(clearTimeout(this.fallbackTimer),f(p))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(s=!0,!i){let p=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${p}`,"true"),this.log("transport",`established ${p} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(f,t),this.ping(p=>{this.log("transport","connected to primary after",p),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&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.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),$O,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,s){if(!this.conn)return e&&e();const i=this.conn;this.waitForBufferDone(i,()=>{t?i.close(t,s||""):i.close(),this.waitForSocketClosed(i,()=>{this.conn===i&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,s=1){if(s===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,s+1)},150*s)}waitForSocketClosed(e,t,s=1){if(s===5||e.readyState===Kn.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,s+1)},150*s)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,s=this.establishedConnections;this.triggerStateCallbacks("error",e,t,s),(t===this.transport||s>0)&&this.triggerChanError(e)}triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(mr.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case Kn.connecting:return"connecting";case Kn.open:return"open";case Kn.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([s])=>e.indexOf(s)===-1)}channel(e,t={}){let s=new GO(e,t,this);return this.channels.push(s),s}push(e){if(this.hasLogger()){let{topic:t,event:s,payload:i,ref:l,join_ref:u}=e;this.log("push",`${t} ${s} (${u}, ${l})`,i)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),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.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:s,event:i,payload:l,ref:u,join_ref:c}=t;if(u&&u===this.pendingHeartbeatRef){const f=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(l.status==="ok"?"ok":"error",f)}catch(p){this.log("error","error in heartbeat callback",p)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${l.status||""} ${s} ${i} ${u&&"("+u+")"||""}`.trim(),l);for(let f=0;f<this.channels.length;f++){const p=this.channels[f];p.isMember(s,i,l,c)&&p.trigger(i,l,u,c)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([s,i])=>{try{i(...t)}catch(l){this.log("error",`error in ${e} callback`,l)}})}catch(s){this.log("error",`error triggering ${e} callbacks`,s)}}leaveOpenTopic(e){let t=this.channels.find(s=>s.topic===e&&(s.isJoined()||s.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class no{constructor(t,s){const i=JO(s);this.presence=new YO(t.getChannel(),i),this.presence.onJoin((l,u,c)=>{const f=no.onJoinPayload(l,u,c);t.getChannel().trigger("presence",f)}),this.presence.onLeave((l,u,c)=>{const f=no.onLeavePayload(l,u,c);t.getChannel().trigger("presence",f)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return no.transformState(this.presence.state)}static transformState(t){return t=QO(t),Object.getOwnPropertyNames(t).reduce((s,i)=>{const l=t[i];return s[i]=nu(l),s},{})}static onJoinPayload(t,s,i){const l=lv(s),u=nu(i);return{event:"join",key:t,currentPresences:l,newPresences:u}}static onLeavePayload(t,s,i){const l=lv(s),u=nu(i);return{event:"leave",key:t,currentPresences:l,leftPresences:u}}}function nu(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function QO(e){return JSON.parse(JSON.stringify(e))}function JO(e){return e?.events&&{events:e.events}}function lv(e){return e?.metas?nu(e):[]}var uv;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(uv||(uv={}));class XO{get state(){return this.presenceAdapter.state}constructor(t,s){this.channel=t,this.presenceAdapter=new no(this.channel.channelAdapter,s)}}function ZO(e){if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);if(e&&typeof e=="object"){const t=e;if(typeof t.code=="number"){const s=typeof t.reason=="string"&&t.reason?` (${t.reason})`:"";return new Error(`socket closed: ${t.code}${s}`,{cause:e})}return new Error("channel error: transport failure",{cause:e})}return new Error("channel error: connection lost")}class WO{constructor(t,s,i){const l=ex(i);this.channel=t.getSocket().channel(s,l),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,s){return this.channel.on(t,s)}off(t,s){this.channel.off(t,s)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,s,i){let l;try{l=this.channel.push(t,s,i)}catch{throw new Error(`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>MO){const u=this.channel.pushBuffer.shift();u.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${u.event}`,u.payload())}return l}updateJoinPayload(t){const s=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},s),t)}canPush(){return this.socket.isConnected()&&this.state===Xr.joined}isJoined(){return this.state===Xr.joined}isJoining(){return this.state===Xr.joining}isClosed(){return this.state===Xr.closed}isLeaving(){return this.state===Xr.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function ex(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var cv;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(cv||(cv={}));var Ga;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Ga||(Ga={}));var yr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(yr||(yr={}));class ro{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,s={config:{}},i){var l,u;if(this.topic=t,this.params=s,this.socket=i,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},s.config),this.channelAdapter=new WO(this.socket.socketAdapter,t,this.params),this.presence=new XO(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=lb(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((u=(l=this.params.config)===null||l===void 0?void 0:l.broadcast)===null||u===void 0)&&u.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,s=this.timeout){var i,l,u;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:c,presence:f,private:p}}=this.params,g=(l=(i=this.bindings.postgres_changes)===null||i===void 0?void 0:i.map(_=>_.filter))!==null&&l!==void 0?l:[],y=!!this.bindings[Ga.PRESENCE]&&this.bindings[Ga.PRESENCE].length>0||((u=this.params.config.presence)===null||u===void 0?void 0:u.enabled)===!0,m={},b={broadcast:c,presence:Object.assign(Object.assign({},f),{enabled:y}),postgres_changes:g,private:p};this.socket.accessTokenValue&&(m.access_token=this.socket.accessTokenValue),this._onError(_=>{t?.(yr.CHANNEL_ERROR,ZO(_))}),this._onClose(()=>t?.(yr.CLOSED)),this.updateJoinPayload(Object.assign({config:b},m)),this._updateFilterMessage(),this.channelAdapter.subscribe(s).receive("ok",async({postgres_changes:_})=>{if(this.socket._isManualToken()||this.socket.setAuth(),_===void 0){t?.(yr.SUBSCRIBED);return}this._updatePostgresBindings(_,t)}).receive("error",_=>{this.state=Xr.errored;const S=Object.values(_).join(", ")||"error";t?.(yr.CHANNEL_ERROR,new Error(S,{cause:_}))}).receive("timeout",()=>{t?.(yr.TIMED_OUT)})}return this}_updatePostgresBindings(t,s){var i;const l=this.bindings.postgres_changes,u=(i=l?.length)!==null&&i!==void 0?i:0,c=[];for(let f=0;f<u;f++){const p=l[f],{filter:{event:g,schema:y,table:m,filter:b}}=p,_=t&&t[f];if(_&&_.event===g&&ro.isFilterValueEqual(_.schema,y)&&ro.isFilterValueEqual(_.table,m)&&ro.isFilterValueEqual(_.filter,b))c.push(Object.assign(Object.assign({},p),{id:_.id}));else{this.unsubscribe(),this.state=Xr.errored,s?.(yr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=c,this.state!=Xr.errored&&s&&s(yr.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,s={}){return await this.send({type:"presence",event:"track",payload:t},s.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,s,i){const l=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),u=t===Ga.PRESENCE||t===Ga.POSTGRES_CHANGES;if(l&&u)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,s,i)}async httpSend(t,s,i={}){var l;if(s==null)return Promise.reject(new Error("Payload is required for httpSend()"));const u={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(u.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:u,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:s,private:this.private}]})},f=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(l=i.timeout)!==null&&l!==void 0?l:this.timeout);if(f.status===202)return{success:!0};let p=f.statusText;try{const g=await f.json();p=g.error||g.message||p}catch{}return Promise.reject(new Error(p))}async send(t,s={}){var i,l;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:u,payload:c}=t,f={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(f.Authorization=`Bearer ${this.socket.accessTokenValue}`);const p={method:"POST",headers:f,body:JSON.stringify({messages:[{topic:this.subTopic,event:u,payload:c,private:this.private}]})};try{const g=await this._fetchWithTimeout(this.broadcastEndpointURL,p,(i=s.timeout)!==null&&i!==void 0?i:this.timeout);return await((l=g.body)===null||l===void 0?void 0:l.cancel()),g.ok?"ok":"error"}catch(g){return g instanceof Error&&g.name==="AbortError"?"timed out":"error"}}else return new Promise(u=>{var c,f,p;const g=this.channelAdapter.push(t.type,t,s.timeout||this.timeout);t.type==="broadcast"&&!(!((p=(f=(c=this.params)===null||c===void 0?void 0:c.config)===null||f===void 0?void 0:f.broadcast)===null||p===void 0)&&p.ack)&&u("ok"),g.receive("ok",()=>u("ok")),g.receive("error",()=>u("error")),g.receive("timeout",()=>u("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(s=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>s("ok")).receive("timeout",()=>s("timed out")).receive("error",()=>s("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,s,i){const l=new AbortController,u=setTimeout(()=>l.abort(),i),c=await this.socket.fetch(t,Object.assign(Object.assign({},s),{signal:l.signal}));return clearTimeout(u),c}_on(t,s,i){const l=t.toLocaleLowerCase(),u=this.channelAdapter.on(t,i),c={type:l,filter:s,callback:i,ref:u};return this.bindings[l]?this.bindings[l].push(c):this.bindings[l]=[c],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,s,i)=>{var l,u,c,f,p,g,y;const m=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(m,i))return!1;const b=(l=this.bindings[m])===null||l===void 0?void 0:l.find(_=>_.ref===t.ref);if(!b)return!0;if(["broadcast","presence","postgres_changes"].includes(m))if("id"in b){const _=b.id,S=(u=b.filter)===null||u===void 0?void 0:u.event;return _&&((c=s.ids)===null||c===void 0?void 0:c.includes(_))&&(S==="*"||S?.toLocaleLowerCase()===((f=s.data)===null||f===void 0?void 0:f.type.toLocaleLowerCase()))}else{const _=(g=(p=b?.filter)===null||p===void 0?void 0:p.event)===null||g===void 0?void 0:g.toLocaleLowerCase();return _==="*"||_===((y=s?.event)===null||y===void 0?void 0:y.toLocaleLowerCase())}else return b.type.toLocaleLowerCase()===m})}_notThisChannelEvent(t,s){const{close:i,error:l,leave:u,join:c}=ib;return s&&[i,l,u,c].includes(t)&&s!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,s,i)=>{if(typeof s=="object"&&"ids"in s){const l=s.data,{schema:u,table:c,commit_timestamp:f,type:p,errors:g}=l;return Object.assign(Object.assign({},{schema:u,table:c,commit_timestamp:f,eventType:p,new:{},old:{},errors:g}),this._getPayloadRecords(l))}return s})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const s in t.bindings)for(const i of t.bindings[s])this._on(i.type,i.filter,i.callback)}static isFilterValueEqual(t,s){return(t??void 0)===(s??void 0)}_getPayloadRecords(t){const s={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(s.new=ov(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(s.old=ov(t.columns,t.old_record)),s}}class tx{constructor(t,s){this.socket=new FO(t,s)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,s,i,l=1e4){return new Promise(u=>{setTimeout(()=>u("timeout"),l),this.socket.disconnect(()=>{t(),u("ok")},s,i)})}push(t){this.socket.push(t)}log(t,s,i){this.socket.log(t,s,i)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Cf.connecting}isDisconnecting(){return this.socket.connectionState()==Cf.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const hv={HEARTBEAT_INTERVAL:25e3},nx=[1e3,2e3,5e3,1e4],rx=1e4;function sx(){const e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){var s;return(s=Array.from(e.keys())[t])!==null&&s!==void 0?s:null},removeItem(t){e.delete(t)},setItem(t,s){e.set(t,String(s))}}}function ax(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return sx()}const ix=`
  addEventListener("message", (e) => {
    if (e.data.event === "start") {
      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
    }
  });`;class ox{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,s){var i;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new NO,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=u=>u?(...c)=>u(...c):(...c)=>fetch(...c),!(!((i=s?.params)===null||i===void 0)&&i.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=s.params.apikey;const l=this._initializeOptions(s);this.socketAdapter=new tx(t,l),this.httpEndpoint=lb(t),this.fetch=this._resolveFetch(s?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const s=t.message;throw s.includes("Node.js")?new Error(`${s}

To use Realtime in Node.js, you need to provide a WebSocket implementation:

Option 1: Use Node.js 22+ which has native WebSocket support
Option 2: Install and provide the "ws" package:

  npm install ws

  import ws from "ws"
  const client = new RealtimeClient(url, {
    ...options,
    transport: ws
  })`):new Error(`WebSocket not available: ${s}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,s){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,s)}getChannels(){return this.channels}async removeChannel(t){const s=await t.unsubscribe();return s==="ok"&&t.teardown(),s}async removeAllChannels(){const t=this.channels.map(async i=>{const l=await i.unsubscribe();return i.teardown(),l}),s=await Promise.all(t);return await this.disconnect(),s}log(t,s,i){this.socketAdapter.log(t,s,i)}connectionState(){return this.socketAdapter.connectionState()||Cf.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,s={config:{}}){const i=`realtime:${t}`,l=this.getChannels().find(u=>u.topic===i);if(l)return l;{const u=new ro(`realtime:${t}`,s,this);return this._cancelPendingDisconnect(),this.channels.push(u),u}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(s=>s.topic!==t.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(t=null){let s,i=!1;if(t)s=t,i=!0;else if(this.accessToken)try{s=await this.accessToken()}catch(l){this.log("error","Error fetching access token from callback",l),s=this.accessTokenValue}else s=this.accessTokenValue;i?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=s&&(this.accessTokenValue=s,this.channels.forEach(l=>{const u={access_token:s,version:xO};s&&l.updateJoinPayload(u),l.joinedOnce&&l.channelAdapter.isJoined()&&l.channelAdapter.push(ib.access_token,{access_token:s})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(s=>{this.log("error",`Error setting auth in ${t}`,s)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(s=>{this.log("error","error waiting for auth on connect",s)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(s,i)=>{s=="sent"&&this._setAuthSafely(),t&&t(s,i)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=s=>{this.log("worker","worker error",s.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=s=>{s.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let s;if(t)s=t;else{const i=new Blob([ix],{type:"application/javascript"});s=URL.createObjectURL(i)}return s}_initializeOptions(t){var s,i,l,u,c,f,p,g,y,m,b,_;this.worker=(s=t?.worker)!==null&&s!==void 0?s:!1,this.accessToken=(i=t?.accessToken)!==null&&i!==void 0?i:null;const S={};S.timeout=(l=t?.timeout)!==null&&l!==void 0?l:jO,S.heartbeatIntervalMs=(u=t?.heartbeatIntervalMs)!==null&&u!==void 0?u:hv.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(c=t?.disconnectOnEmptyChannelsAfterMs)!==null&&c!==void 0?c:2*((f=t?.heartbeatIntervalMs)!==null&&f!==void 0?f:hv.HEARTBEAT_INTERVAL),S.transport=(p=t?.transport)!==null&&p!==void 0?p:AO.getWebSocketConstructor(),S.params=t?.params,S.logger=t?.logger,S.heartbeatCallback=this._wrapHeartbeatCallback(t?.heartbeatCallback),S.sessionStorage=(g=t?.sessionStorage)!==null&&g!==void 0?g:ax(),S.reconnectAfterMs=(y=t?.reconnectAfterMs)!==null&&y!==void 0?y:(M=>nx[M-1]||rx);let O,E;const A=(m=t?.vsn)!==null&&m!==void 0?m:kO;switch(A){case CO:O=(M,j)=>j(JSON.stringify(M)),E=(M,j)=>j(JSON.parse(M));break;case ab:O=this.serializer.encode.bind(this.serializer),E=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${S.vsn}`)}if(S.vsn=A,S.encode=(b=t?.encode)!==null&&b!==void 0?b:O,S.decode=(_=t?.decode)!==null&&_!==void 0?_:E,S.beforeReconnect=this._reconnectAuth.bind(this),(t?.logLevel||t?.log_level)&&(this.logLevel=t.logLevel||t.log_level,S.params=Object.assign(Object.assign({},S.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t?.workerUrl,S.autoSendHeartbeat=!this.worker}return S}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var fo=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=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&t.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function lx(e,t,s){const i=new URL(t,e);if(s)for(const[l,u]of Object.entries(s))u!==void 0&&i.searchParams.set(l,u);return i.toString()}async function ux(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function cx(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:s,path:i,query:l,body:u,headers:c}){const f=lx(e.baseUrl,i,l),p=await ux(e.auth),g=await t(f,{method:s,headers:{...u?{"Content-Type":"application/json"}:{},...p,...c},body:u?JSON.stringify(u):void 0}),y=await g.text(),m=(g.headers.get("content-type")||"").includes("application/json"),b=m&&y?JSON.parse(y):y;if(!g.ok){const _=m?b:void 0,S=_?.error;throw new fo(S?.message??`Request failed with status ${g.status}`,{status:g.status,icebergType:S?.type,icebergCode:S?.code,details:_})}return{status:g.status,headers:g.headers,data:b}}}}function Kl(e){return e.join("")}var hx=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:Kl(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(i=>({namespace:i}))}async createNamespace(e,t){const s={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:s})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Kl(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Kl(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Kl(e.namespace)}`}),!0}catch(t){if(t instanceof fo&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(s){if(s instanceof fo&&s.status===409)return;throw s}}};function Da(e){return e.join("")}var fx=class{constructor(e,t="",s){this.client=e,this.prefix=t,this.accessDelegation=s}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Da(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const s={};return this.accessDelegation&&(s["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Da(e.namespace)}/tables`,body:t,headers:s})).data.metadata}async updateTable(e,t){const s=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Da(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":s.data["metadata-location"],metadata:s.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Da(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Da(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Da(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(s){if(s instanceof fo&&s.status===404)return!1;throw s}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(s){if(s instanceof fo&&s.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw s}}},dx=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const s=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=cx({baseUrl:s,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new hx(this.client,t),this.tableOps=new fx(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)}async 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)}};function po(e){"@babel/helpers - typeof";return po=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},po(e)}function px(e,t){if(po(e)!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var i=s.call(e,t);if(po(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gx(e){var t=px(e,"string");return po(t)=="symbol"?t:t+""}function mx(e,t,s){return(t=gx(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function fv(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),s.push.apply(s,i)}return s}function fe(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{};t%2?fv(Object(s),!0).forEach(function(i){mx(e,i,s[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):fv(Object(s)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(s,i))})}return e}var Ou=class extends Error{constructor(e,t="storage",s,i){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=s,this.statusCode=i}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function xu(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Nf=class extends Ou{constructor(e,t,s,i="storage"){super(e,i,t,s),this.name=i==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=s}toJSON(){return fe({},super.toJSON())}},cb=class extends Ou{constructor(e,t,s="storage"){super(e,s),this.name=s==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function fu(e,t,s){const i=fe({},e),l=t.toLowerCase();for(const u of Object.keys(i))u.toLowerCase()===l&&delete i[u];return i[l]=s,i}function yx(e){const t={};for(const[s,i]of Object.entries(e))t[s.toLowerCase()]=i;return t}const vx=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),bx=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Df=e=>{if(Array.isArray(e))return e.map(s=>Df(s));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([s,i])=>{const l=s.replace(/([-_][a-z])/gi,u=>u.toUpperCase().replace(/[-_]/g,""));t[l]=Df(i)}),t},_x=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),dv=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error;if(typeof t.error=="object"&&t.error!==null){const s=t.error;if(typeof s.message=="string")return s.message}}return JSON.stringify(e)},wx=async(e,t,s,i)=>{if(e!==null&&typeof e=="object"&&"json"in e&&typeof e.json=="function"){const l=e;let u=parseInt(String(l.status),10);Number.isFinite(u)||(u=500),l.json().then(c=>{const f=c?.statusCode||c?.code||u+"";t(new Nf(dv(c),u,f,i))}).catch(()=>{const c=u+"";t(new Nf(l.statusText||`HTTP ${u} error`,u,c,i))})}else t(new cb(dv(e),e,i))},Sx=(e,t,s,i)=>{const l={method:e,headers:t?.headers||{}};if(e==="GET"||e==="HEAD"||!i)return fe(fe({},l),s);if(bx(i)){var u;const c=t?.headers||{};let f;for(const[p,g]of Object.entries(c))p.toLowerCase()==="content-type"&&(f=g);l.headers=fu(c,"Content-Type",(u=f)!==null&&u!==void 0?u:"application/json"),l.body=JSON.stringify(i)}else l.body=i;return t?.duplex&&(l.duplex=t.duplex),fe(fe({},l),s)};async function Xi(e,t,s,i,l,u,c){return new Promise((f,p)=>{e(s,Sx(t,i,l,u)).then(g=>{if(!g.ok)throw g;if(i?.noResolveJson)return g;if(c==="vectors"){const y=g.headers.get("content-type");if(g.headers.get("content-length")==="0"||g.status===204)return{};if(!y||!y.includes("application/json"))return{}}return g.json()}).then(g=>f(g)).catch(g=>wx(g,p,i,c))})}function hb(e="storage"){return{get:async(t,s,i,l)=>Xi(t,"GET",s,i,l,void 0,e),post:async(t,s,i,l,u)=>Xi(t,"POST",s,l,u,i,e),put:async(t,s,i,l,u)=>Xi(t,"PUT",s,l,u,i,e),head:async(t,s,i,l)=>Xi(t,"HEAD",s,fe(fe({},i),{},{noResolveJson:!0}),l,void 0,e),remove:async(t,s,i,l,u)=>Xi(t,"DELETE",s,l,u,i,e)}}const Ex=hb("storage"),{get:go,post:jn,put:Lf,head:Tx,remove:td}=Ex,on=hb("vectors");var Xa=class{constructor(e,t={},s,i="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=yx(t),this.fetch=vx(s),this.namespace=i}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=fu(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(xu(s))return{data:null,error:s};throw s}}};let fb;fb=Symbol.toStringTag;var Rx=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[fb]="StreamDownloadBuilder",this.promise=null}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}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(xu(t))return{data:null,error:t};throw t}}};let db;db=Symbol.toStringTag;var Ax=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[db]="BlobDownloadBuilder",this.promise=null}asStream(){return new Rx(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}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(xu(t))return{data:null,error:t};throw t}}};const Ox={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},pv={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var xx=class extends Xa{constructor(e,t={},s,i){super(e,t,i,"storage"),this.bucketId=s}async uploadOrUpdate(e,t,s,i){var l=this;return l.handleOperation(async()=>{let u;const c=fe(fe({},pv),i);let f=fe(fe({},l.headers),e==="POST"&&{"x-upsert":String(c.upsert)});const p=c.metadata;if(typeof Blob<"u"&&s instanceof Blob?(u=new FormData,u.append("cacheControl",c.cacheControl),p&&u.append("metadata",l.encodeMetadata(p)),u.append("",s)):typeof FormData<"u"&&s instanceof FormData?(u=s,u.has("cacheControl")||u.append("cacheControl",c.cacheControl),p&&!u.has("metadata")&&u.append("metadata",l.encodeMetadata(p))):(u=s,f["cache-control"]=`max-age=${c.cacheControl}`,f["content-type"]=c.contentType,p&&(f["x-metadata"]=l.toBase64(l.encodeMetadata(p))),(typeof ReadableStream<"u"&&u instanceof ReadableStream||u&&typeof u=="object"&&"pipe"in u&&typeof u.pipe=="function")&&!c.duplex&&(c.duplex="half")),i?.headers)for(const[b,_]of Object.entries(i.headers))f=fu(f,b,_);const g=l._removeEmptyFolders(t),y=l._getFinalPath(g),m=await(e=="PUT"?Lf:jn)(l.fetch,`${l.url}/object/${y}`,u,fe({headers:f},c?.duplex?{duplex:c.duplex}:{}));return{path:g,id:m.Id,fullPath:m.Key}})}async upload(e,t,s){return this.uploadOrUpdate("POST",e,t,s)}async uploadToSignedUrl(e,t,s,i){var l=this;const u=l._removeEmptyFolders(e),c=l._getFinalPath(u),f=new URL(l.url+`/object/upload/sign/${c}`);return f.searchParams.set("token",t),l.handleOperation(async()=>{let p;const g=fe(fe({},pv),i);let y=fe(fe({},l.headers),{"x-upsert":String(g.upsert)});const m=g.metadata;if(typeof Blob<"u"&&s instanceof Blob?(p=new FormData,p.append("cacheControl",g.cacheControl),m&&p.append("metadata",l.encodeMetadata(m)),p.append("",s)):typeof FormData<"u"&&s instanceof FormData?(p=s,p.has("cacheControl")||p.append("cacheControl",g.cacheControl),m&&!p.has("metadata")&&p.append("metadata",l.encodeMetadata(m))):(p=s,y["cache-control"]=`max-age=${g.cacheControl}`,y["content-type"]=g.contentType,m&&(y["x-metadata"]=l.toBase64(l.encodeMetadata(m))),(typeof ReadableStream<"u"&&p instanceof ReadableStream||p&&typeof p=="object"&&"pipe"in p&&typeof p.pipe=="function")&&!g.duplex&&(g.duplex="half")),i?.headers)for(const[b,_]of Object.entries(i.headers))y=fu(y,b,_);return{path:u,fullPath:(await Lf(l.fetch,f.toString(),p,fe({headers:y},g?.duplex?{duplex:g.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var s=this;return s.handleOperation(async()=>{let i=s._getFinalPath(e);const l=fe({},s.headers);t?.upsert&&(l["x-upsert"]="true");const u=await jn(s.fetch,`${s.url}/object/upload/sign/${i}`,{},{headers:l}),c=new URL(s.url+u.url),f=c.searchParams.get("token");if(!f)throw new Ou("No token returned by API");return{signedUrl:c.toString(),path:e,token:f}})}async update(e,t,s){return this.uploadOrUpdate("PUT",e,t,s)}async move(e,t,s){var i=this;return i.handleOperation(async()=>await jn(i.fetch,`${i.url}/object/move`,{bucketId:i.bucketId,sourceKey:e,destinationKey:t,destinationBucket:s?.destinationBucket},{headers:i.headers}))}async copy(e,t,s){var i=this;return i.handleOperation(async()=>({path:(await jn(i.fetch,`${i.url}/object/copy`,{bucketId:i.bucketId,sourceKey:e,destinationKey:t,destinationBucket:s?.destinationBucket},{headers:i.headers})).Key}))}async createSignedUrl(e,t,s){var i=this;return i.handleOperation(async()=>{let l=i._getFinalPath(e);const u=typeof s?.transform=="object"&&s.transform!==null&&Object.keys(s.transform).length>0;let c=await jn(i.fetch,`${i.url}/object/sign/${l}`,fe({expiresIn:t},u?{transform:s.transform}:{}),{headers:i.headers});const f=new URLSearchParams;s?.download&&f.set("download",s.download===!0?"":s.download),s?.cacheNonce!=null&&f.set("cacheNonce",String(s.cacheNonce));const p=f.toString();return{signedUrl:encodeURI(`${i.url}${c.signedURL}${p?`&${p}`:""}`)}})}async createSignedUrls(e,t,s){var i=this;return i.handleOperation(async()=>{const l=await jn(i.fetch,`${i.url}/object/sign/${i.bucketId}`,{expiresIn:t,paths:e},{headers:i.headers}),u=new URLSearchParams;s?.download&&u.set("download",s.download===!0?"":s.download),s?.cacheNonce!=null&&u.set("cacheNonce",String(s.cacheNonce));const c=u.toString();return l.map(f=>fe(fe({},f),{},{signedUrl:f.signedURL?encodeURI(`${i.url}${f.signedURL}${c?`&${c}`:""}`):null}))})}download(e,t,s){const i=typeof t?.transform=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",l=new URLSearchParams;t?.transform&&this.applyTransformOptsToQuery(l,t.transform),t?.cacheNonce!=null&&l.set("cacheNonce",String(t.cacheNonce));const u=l.toString(),c=this._getFinalPath(e),f=()=>go(this.fetch,`${this.url}/${i}/${c}${u?`?${u}`:""}`,{headers:this.headers,noResolveJson:!0},s);return new Ax(f,this.shouldThrowOnError)}async info(e){var t=this;const s=t._getFinalPath(e);return t.handleOperation(async()=>Df(await go(t.fetch,`${t.url}/object/info/${s}`,{headers:t.headers})))}async exists(e){var t=this;const s=t._getFinalPath(e);try{return await Tx(t.fetch,`${t.url}/object/${s}`,{headers:t.headers}),{data:!0,error:null}}catch(l){if(t.shouldThrowOnError)throw l;if(xu(l)){var i;const u=l instanceof Nf?l.status:l instanceof cb?(i=l.originalError)===null||i===void 0?void 0:i.status:void 0;if(u!==void 0&&[400,404].includes(u))return{data:!1,error:l}}throw l}}getPublicUrl(e,t){const s=this._getFinalPath(e),i=new URLSearchParams;t?.download&&i.set("download",t.download===!0?"":t.download),t?.transform&&this.applyTransformOptsToQuery(i,t.transform),t?.cacheNonce!=null&&i.set("cacheNonce",String(t.cacheNonce));const l=i.toString(),u=typeof t?.transform=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${u}/public/${s}`)+(l?`?${l}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await td(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,s){var i=this;return i.handleOperation(async()=>{const l=fe(fe(fe({},Ox),t),{},{prefix:e||""});return await jn(i.fetch,`${i.url}/object/list/${i.bucketId}`,l,{headers:i.headers},s)})}async listV2(e,t){var s=this;return s.handleOperation(async()=>{const i=fe({},e);return await jn(s.fetch,`${s.url}/object/list-v2/${s.bucketId}`,i,{headers:s.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("quality",t.quality.toString()),e}};const Cx="2.106.0",wo={"X-Client-Info":`storage-js/${Cx}`};var kx=class extends Xa{constructor(e,t={},s,i){const l=new URL(e);i?.useNewHostname&&/supabase\.(co|in|red)$/.test(l.hostname)&&!l.hostname.includes("storage.supabase.")&&(l.hostname=l.hostname.replace("supabase.","storage.supabase."));const u=l.href.replace(/\/$/,""),c=fe(fe({},wo),t);super(u,c,s,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const s=t.listBucketOptionsToQueryString(e);return await go(t.fetch,`${t.url}/bucket${s}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await go(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var s=this;return s.handleOperation(async()=>await jn(s.fetch,`${s.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:s.headers}))}async updateBucket(e,t){var s=this;return s.handleOperation(async()=>await Lf(s.fetch,`${s.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:s.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await jn(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await td(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const 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():""}},jx=class extends Xa{constructor(e,t={},s){const i=e.replace(/\/$/,""),l=fe(fe({},wo),t);super(i,l,s,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await jn(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const s=new URLSearchParams;e?.limit!==void 0&&s.set("limit",e.limit.toString()),e?.offset!==void 0&&s.set("offset",e.offset.toString()),e?.sortColumn&&s.set("sortColumn",e.sortColumn),e?.sortOrder&&s.set("sortOrder",e.sortOrder),e?.search&&s.set("search",e.search);const i=s.toString(),l=i?`${t.url}/bucket?${i}`:`${t.url}/bucket`;return await go(t.fetch,l,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await td(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!_x(e))throw new Ou("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const s=new dx({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),i=this.shouldThrowOnError;return new Proxy(s,{get(l,u){const c=l[u];return typeof c!="function"?c:async(...f)=>{try{return{data:await c.apply(l,f),error:null}}catch(p){if(i)throw p;return{data:null,error:p}}}}})}},Mx=class extends Xa{constructor(e,t={},s){const i=e.replace(/\/$/,""),l=fe(fe({},wo),{},{"Content-Type":"application/json"},t);super(i,l,s,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var s=this;return s.handleOperation(async()=>await on.post(s.fetch,`${s.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:s.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var s=this;return s.handleOperation(async()=>await on.post(s.fetch,`${s.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:s.headers})||{})}},Nx=class extends Xa{constructor(e,t={},s){const i=e.replace(/\/$/,""),l=fe(fe({},wo),{},{"Content-Type":"application/json"},t);super(i,l,s,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},Dx=class extends Xa{constructor(e,t={},s){const i=e.replace(/\/$/,""),l=fe(fe({},wo),{},{"Content-Type":"application/json"},t);super(i,l,s,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},Lx=class extends Dx{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new Ux(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,s=this;return t().call(s,e)}async getBucket(e){var t=()=>super.getBucket,s=this;return t().call(s,e)}async listBuckets(e={}){var t=()=>super.listBuckets,s=this;return t().call(s,e)}async deleteBucket(e){var t=()=>super.deleteBucket,s=this;return t().call(s,e)}},Ux=class extends Mx{constructor(e,t,s,i){super(e,t,i),this.vectorBucketName=s}async createIndex(e){var t=()=>super.createIndex,s=this;return t().call(s,fe(fe({},e),{},{vectorBucketName:s.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,s=this;return t().call(s,fe(fe({},e),{},{vectorBucketName:s.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,s=this;return t().call(s,s.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,s=this;return t().call(s,s.vectorBucketName,e)}index(e){return new zx(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},zx=class extends Nx{constructor(e,t,s,i,l){super(e,t,l),this.vectorBucketName=s,this.indexName=i}async putVectors(e){var t=()=>super.putVectors,s=this;return t().call(s,fe(fe({},e),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}async getVectors(e){var t=()=>super.getVectors,s=this;return t().call(s,fe(fe({},e),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,s=this;return t().call(s,fe(fe({},e),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,s=this;return t().call(s,fe(fe({},e),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,s=this;return t().call(s,fe(fe({},e),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}},Px=class extends kx{constructor(e,t={},s,i){super(e,t,s,i)}from(e){return new xx(this.url,this.headers,e,this.fetch)}get vectors(){return new Lx(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new jx(this.url+"/iceberg",this.headers,this.fetch)}};const pb="2.106.0",Ia=30*1e3,Uf=3,lf=Uf*Ia,Bx="http://localhost:9999",Hx="supabase.auth.token",Ix={"X-Client-Info":`gotrue-js/${pb}`},zf="X-Supabase-Api-Version",gb={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},qx=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,$x=600*1e3;class mo extends Error{constructor(t,s,i){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=s,this.code=i}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function te(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class Vx extends mo{constructor(t,s,i){super(t,s,i),this.name="AuthApiError",this.status=s,this.code=i}}function Gx(e){return te(e)&&e.name==="AuthApiError"}class Mn extends mo{constructor(t,s){super(t),this.name="AuthUnknownError",this.originalError=s}}class wr extends mo{constructor(t,s,i,l){super(t,i,l),this.name=s,this.status=i}}class mt extends wr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Yl(e){return te(e)&&e.name==="AuthSessionMissingError"}class La extends wr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Fl extends wr{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Ql extends wr{constructor(t,s=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=s}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function Kx(e){return te(e)&&e.name==="AuthImplicitGrantRedirectError"}class gv extends wr{constructor(t,s=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=s}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class Yx extends wr{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Pf extends wr{constructor(t,s){super(t,"AuthRetryableFetchError",s,void 0)}}function uf(e){return te(e)&&e.name==="AuthRetryableFetchError"}class mv extends wr{constructor(t,s,i){super(t,"AuthWeakPasswordError",s,"weak_password"),this.reasons=i}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class Bf extends wr{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const du="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),yv=` 	
\r=`.split(""),Fx=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<yv.length;t+=1)e[yv[t].charCodeAt(0)]=-2;for(let t=0;t<du.length;t+=1)e[du[t].charCodeAt(0)]=t;return e})();function vv(e,t,s){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const i=t.queue>>t.queuedBits-6&63;s(du[i]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const i=t.queue>>t.queuedBits-6&63;s(du[i]),t.queuedBits-=6}}function mb(e,t,s){const i=Fx[e];if(i>-1)for(t.queue=t.queue<<6|i,t.queuedBits+=6;t.queuedBits>=8;)s(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(i===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function bv(e){const t=[],s=c=>{t.push(String.fromCodePoint(c))},i={utf8seq:0,codepoint:0},l={queue:0,queuedBits:0},u=c=>{Xx(c,i,s)};for(let c=0;c<e.length;c+=1)mb(e.charCodeAt(c),l,u);return t.join("")}function Qx(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 Jx(e,t){for(let s=0;s<e.length;s+=1){let i=e.charCodeAt(s);if(i>55295&&i<=56319){const l=(i-55296)*1024&65535;i=(e.charCodeAt(s+1)-56320&65535|l)+65536,s+=1}Qx(i,t)}}function Xx(e,t,s){if(t.utf8seq===0){if(e<=127){s(e);return}for(let i=1;i<6;i+=1)if((e>>7-i&1)===0){t.utf8seq=i;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&&s(t.codepoint)}}function Qa(e){const t=[],s={queue:0,queuedBits:0},i=l=>{t.push(l)};for(let l=0;l<e.length;l+=1)mb(e.charCodeAt(l),s,i);return new Uint8Array(t)}function Zx(e){const t=[];return Jx(e,s=>t.push(s)),new Uint8Array(t)}function Ps(e){const t=[],s={queue:0,queuedBits:0},i=l=>{t.push(l)};return e.forEach(l=>vv(l,s,i)),vv(null,s,i),t.join("")}function Wx(e){return Math.round(Date.now()/1e3)+e}function eC(){return Symbol("auth-callback")}const At=()=>typeof window<"u"&&typeof document<"u",Ms={tested:!1,writable:!1},yb=()=>{if(!At())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Ms.tested)return Ms.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Ms.tested=!0,Ms.writable=!0}catch{Ms.tested=!0,Ms.writable=!1}return Ms.writable};function tC(e){const t={},s=new URL(e);if(s.hash&&s.hash[0]==="#")try{new URLSearchParams(s.hash.substring(1)).forEach((l,u)=>{t[u]=l})}catch{}return s.searchParams.forEach((i,l)=>{t[l]=i}),t}const vb=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),nC=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",qa=async(e,t,s)=>{await e.setItem(t,JSON.stringify(s))},Ns=async(e,t)=>{const s=await e.getItem(t);if(!s)return null;try{return JSON.parse(s)}catch{return null}},Rt=async(e,t)=>{await e.removeItem(t)};class Cu{constructor(){this.promise=new Cu.promiseConstructor((t,s)=>{this.resolve=t,this.reject=s})}}Cu.promiseConstructor=Promise;function Jl(e){const t=e.split(".");if(t.length!==3)throw new Bf("Invalid JWT structure");for(let i=0;i<t.length;i++)if(!qx.test(t[i]))throw new Bf("JWT not in base64url format");return{header:JSON.parse(bv(t[0])),payload:JSON.parse(bv(t[1])),signature:Qa(t[2]),raw:{header:t[0],payload:t[1]}}}async function rC(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function sC(e,t){return new Promise((i,l)=>{(async()=>{for(let u=0;u<1/0;u++)try{const c=await e(u);if(!t(u,null,c)){i(c);return}}catch(c){if(!t(u,c)){l(c);return}}})()})}function aC(e){return("0"+e.toString(16)).substr(-2)}function iC(){const t=new Uint32Array(56);if(typeof crypto>"u"){const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",i=s.length;let l="";for(let u=0;u<56;u++)l+=s.charAt(Math.floor(Math.random()*i));return l}return crypto.getRandomValues(t),Array.from(t,aC).join("")}async function oC(e){const s=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",s),l=new Uint8Array(i);return Array.from(l).map(u=>String.fromCharCode(u)).join("")}async function lC(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const s=await oC(e);return btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Ua(e,t,s=!1){const i=iC();let l=i;s&&(l+="/recovery"),await qa(e,`${t}-code-verifier`,l);const u=await lC(i);return[u,i===u?"plain":"s256"]}const uC=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function cC(e){const t=e.headers.get(zf);if(!t||!t.match(uC))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function hC(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function fC(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 new Error("Invalid alg claim")}}const dC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function gr(e){if(!dC.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Cn(e){if(!e.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function cf(){const e={};return new Proxy(e,{get:(t,s)=>{if(s==="__isUserNotAvailableProxy")return!0;if(typeof s=="symbol"){const i=s.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${s}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,s)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${s}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,s)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${s}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function pC(e,t){return new Proxy(e,{get:(s,i,l)=>{if(i==="__isInsecureUserWarningProxy")return!0;if(typeof i=="symbol"){const u=i.toString();if(u==="Symbol(Symbol.toPrimitive)"||u==="Symbol(Symbol.toStringTag)"||u==="Symbol(util.inspect.custom)"||u==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(s,i,l)}return!t.value&&typeof i=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(s,i,l)}})}function _v(e){return JSON.parse(JSON.stringify(e))}const Ds=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error}return JSON.stringify(e)},gC=[502,503,504,520,521,522,523,524,530];async function wv(e){var t;if(!nC(e))throw new Pf(Ds(e),0);if(gC.includes(e.status))throw new Pf(Ds(e),e.status);let s;try{s=await e.json()}catch(u){throw new Mn(Ds(u),u)}let i;const l=cC(e);if(l&&l.getTime()>=gb["2024-01-01"].timestamp&&typeof s=="object"&&s&&typeof s.code=="string"?i=s.code:typeof s=="object"&&s&&typeof s.error_code=="string"&&(i=s.error_code),i){if(i==="weak_password")throw new mv(Ds(s),e.status,((t=s.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(i==="session_not_found")throw new mt}else if(typeof s=="object"&&s&&typeof s.weak_password=="object"&&s.weak_password&&Array.isArray(s.weak_password.reasons)&&s.weak_password.reasons.length&&s.weak_password.reasons.reduce((u,c)=>u&&typeof c=="string",!0))throw new mv(Ds(s),e.status,s.weak_password.reasons);throw new Vx(Ds(s),e.status||500,i)}const mC=(e,t,s,i)=>{const l={method:e,headers:t?.headers||{}};return e==="GET"?l:(l.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t?.headers),l.body=JSON.stringify(i),Object.assign(Object.assign({},l),s))};async function se(e,t,s,i){var l;const u=Object.assign({},i?.headers);u[zf]||(u[zf]=gb["2024-01-01"].name),i?.jwt&&(u.Authorization=`Bearer ${i.jwt}`);const c=(l=i?.query)!==null&&l!==void 0?l:{};i?.redirectTo&&(c.redirect_to=i.redirectTo);const f=Object.keys(c).length?"?"+new URLSearchParams(c).toString():"",p=await yC(e,t,s+f,{headers:u,noResolveJson:i?.noResolveJson},{},i?.body);return i?.xform?i?.xform(p):{data:Object.assign({},p),error:null}}async function yC(e,t,s,i,l,u){const c=mC(t,i,l,u);let f;try{f=await e(s,Object.assign({},c))}catch(p){throw console.error(p),new Pf(Ds(p),0)}if(f.ok||await wv(f),i?.noResolveJson)return f;try{return await f.json()}catch(p){await wv(p)}}function _n(e){var t;let s=null;_C(e)&&(s=Object.assign({},e),e.expires_at||(s.expires_at=Wx(e.expires_in)));const i=(t=e.user)!==null&&t!==void 0?t:null;return{data:{session:s,user:i},error:null}}function Sv(e){const t=_n(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((s,i)=>s&&typeof i=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Zr(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function vC(e){return{data:e,error:null}}function bC(e){const{action_link:t,email_otp:s,hashed_token:i,redirect_to:l,verification_type:u}=e,c=Au(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),f={action_link:t,email_otp:s,hashed_token:i,redirect_to:l,verification_type:u},p=Object.assign({},c);return{data:{properties:f,user:p},error:null}}function Ev(e){return e}function _C(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}const hf=["global","local","others"];class wC{constructor({url:t="",headers:s={},fetch:i,experimental:l}){this.url=t,this.headers=s,this.fetch=vb(i),this.experimental=l??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(t,s=hf[0]){if(hf.indexOf(s)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${hf.join(", ")}`);try{return await se(this.fetch,"POST",`${this.url}/logout?scope=${s}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(i){if(te(i))return{data:null,error:i};throw i}}async inviteUserByEmail(t,s={}){try{return await se(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:s.data},headers:this.headers,redirectTo:s.redirectTo,xform:Zr})}catch(i){if(te(i))return{data:{user:null},error:i};throw i}}async generateLink(t){try{const{options:s}=t,i=Au(t,["options"]),l=Object.assign(Object.assign({},i),s);return"newEmail"in i&&(l.new_email=i?.newEmail,delete l.newEmail),await se(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:l,headers:this.headers,xform:bC,redirectTo:s?.redirectTo})}catch(s){if(te(s))return{data:{properties:null,user:null},error:s};throw s}}async createUser(t){try{return await se(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Zr})}catch(s){if(te(s))return{data:{user:null},error:s};throw s}}async listUsers(t){var s,i,l,u,c,f,p;try{const g={nextPage:null,lastPage:0,total:0},y=await se(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(i=(s=t?.page)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:"",per_page:(u=(l=t?.perPage)===null||l===void 0?void 0:l.toString())!==null&&u!==void 0?u:""},xform:Ev});if(y.error)throw y.error;const m=await y.json(),b=(c=y.headers.get("x-total-count"))!==null&&c!==void 0?c:0,_=(p=(f=y.headers.get("link"))===null||f===void 0?void 0:f.split(","))!==null&&p!==void 0?p:[];return _.length>0&&(_.forEach(S=>{const O=parseInt(S.split(";")[0].split("=")[1].substring(0,1)),E=JSON.parse(S.split(";")[1].split("=")[1]);g[`${E}Page`]=O}),g.total=parseInt(b)),{data:Object.assign(Object.assign({},m),g),error:null}}catch(g){if(te(g))return{data:{users:[]},error:g};throw g}}async getUserById(t){gr(t);try{return await se(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Zr})}catch(s){if(te(s))return{data:{user:null},error:s};throw s}}async updateUserById(t,s){gr(t);try{return await se(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:s,headers:this.headers,xform:Zr})}catch(i){if(te(i))return{data:{user:null},error:i};throw i}}async deleteUser(t,s=!1){gr(t);try{return await se(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:s},xform:Zr})}catch(i){if(te(i))return{data:{user:null},error:i};throw i}}async _listFactors(t){gr(t.userId);try{const{data:s,error:i}=await se(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:l=>({data:{factors:l},error:null})});return{data:s,error:i}}catch(s){if(te(s))return{data:null,error:s};throw s}}async _deleteFactor(t){gr(t.userId),gr(t.id);try{return{data:await se(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(s){if(te(s))return{data:null,error:s};throw s}}async _listOAuthClients(t){var s,i,l,u,c,f,p;try{const g={nextPage:null,lastPage:0,total:0},y=await se(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(i=(s=t?.page)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:"",per_page:(u=(l=t?.perPage)===null||l===void 0?void 0:l.toString())!==null&&u!==void 0?u:""},xform:Ev});if(y.error)throw y.error;const m=await y.json(),b=(c=y.headers.get("x-total-count"))!==null&&c!==void 0?c:0,_=(p=(f=y.headers.get("link"))===null||f===void 0?void 0:f.split(","))!==null&&p!==void 0?p:[];return _.length>0&&(_.forEach(S=>{const O=parseInt(S.split(";")[0].split("=")[1].substring(0,1)),E=JSON.parse(S.split(";")[1].split("=")[1]);g[`${E}Page`]=O}),g.total=parseInt(b)),{data:Object.assign(Object.assign({},m),g),error:null}}catch(g){if(te(g))return{data:{clients:[]},error:g};throw g}}async _createOAuthClient(t){try{return await se(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(te(s))return{data:null,error:s};throw s}}async _getOAuthClient(t){try{return await se(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(te(s))return{data:null,error:s};throw s}}async _updateOAuthClient(t,s){try{return await se(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:s,headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if(te(i))return{data:null,error:i};throw i}}async _deleteOAuthClient(t){try{return await se(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(s){if(te(s))return{data:null,error:s};throw s}}async _regenerateOAuthClientSecret(t){try{return await se(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(te(s))return{data:null,error:s};throw s}}async _listCustomProviders(t){try{const s={};return t?.type&&(s.type=t.type),await se(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:s,xform:i=>{var l;return{data:{providers:(l=i?.providers)!==null&&l!==void 0?l:[]},error:null}}})}catch(s){if(te(s))return{data:{providers:[]},error:s};throw s}}async _createCustomProvider(t){try{return await se(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(te(s))return{data:null,error:s};throw s}}async _getCustomProvider(t){try{return await se(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(te(s))return{data:null,error:s};throw s}}async _updateCustomProvider(t,s){try{return await se(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:s,headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if(te(i))return{data:null,error:i};throw i}}async _deleteCustomProvider(t){try{return await se(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(s){if(te(s))return{data:null,error:s};throw s}}async _adminListPasskeys(t){Cn(this.experimental),gr(t.userId);try{return await se(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/passkeys`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(te(s))return{data:null,error:s};throw s}}async _adminDeletePasskey(t){Cn(this.experimental),gr(t.userId),gr(t.passkeyId);try{return await se(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/passkeys/${t.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(s){if(te(s))return{data:null,error:s};throw s}}}function Tv(e={}){return{getItem:t=>e[t]||null,setItem:(t,s)=>{e[t]=s},removeItem:t=>{delete e[t]}}}const qn={debug:!!(globalThis&&yb()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class bb extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class Rv extends bb{}async function SC(e,t,s){qn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const i=new globalThis.AbortController;let l;t>0&&(l=setTimeout(()=>{i.abort(),qn.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:i.signal},async u=>{if(u){clearTimeout(l),qn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,u.name);try{return await s()}finally{qn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,u.name)}}else{if(t===0)throw qn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new Rv(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(qn.debug)try{const c=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(c,null,"  "))}catch(c){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",c)}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"),clearTimeout(l),await s()}})}catch(u){if(t>0&&clearTimeout(l),u!==null&&typeof u=="object"&&"name"in u&&u.name==="AbortError"&&t>0){if(i.signal.aborted)return qn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async c=>{if(c){qn.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,c.name);try{return await s()}finally{qn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,c.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await s()}));throw qn.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new Rv(`Lock "${e}" was released because another request stole it`)}throw u}}function EC(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function _b(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function TC(e){return parseInt(e,16)}function RC(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,i=>i.toString(16).padStart(2,"0")).join("")}function AC(e){var t;const{chainId:s,domain:i,expirationTime:l,issuedAt:u=new Date,nonce:c,notBefore:f,requestId:p,resources:g,scheme:y,uri:m,version:b}=e;{if(!Number.isInteger(s))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${s}`);if(!i)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(c&&c.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${c}`);if(!m)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(b!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${b}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const _=_b(e.address),S=y?`${y}://${i}`:i,O=e.statement?`${e.statement}
`:"",E=`${S} wants you to sign in with your Ethereum account:
${_}

${O}`;let A=`URI: ${m}
Version: ${b}
Chain ID: ${s}${c?`
Nonce: ${c}`:""}
Issued At: ${u.toISOString()}`;if(l&&(A+=`
Expiration Time: ${l.toISOString()}`),f&&(A+=`
Not Before: ${f.toISOString()}`),p&&(A+=`
Request ID: ${p}`),g){let M=`
Resources:`;for(const j of g){if(!j||typeof j!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${j}`);M+=`
- ${j}`}A+=M}return`${E}
${A}`}class it extends Error{constructor({message:t,code:s,cause:i,name:l}){var u;super(t,{cause:i}),this.__isWebAuthnError=!0,this.name=(u=l??(i instanceof Error?i.name:void 0))!==null&&u!==void 0?u:"Unknown Error",this.code=s}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class pu extends it{constructor(t,s){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:s,message:t}),this.name="WebAuthnUnknownError",this.originalError=s}}function OC({error:e,options:t}){var s,i,l;const{publicKey:u}=t;if(!u)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new it({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((s=u.authenticatorSelection)===null||s===void 0?void 0:s.requireResidentKey)===!0)return new it({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((i=u.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new it({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((l=u.authenticatorSelection)===null||l===void 0?void 0:l.userVerification)==="required")return new it({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new it({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new it({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return u.pubKeyCredParams.filter(f=>f.type==="public-key").length===0?new it({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new it({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const c=window.location.hostname;if(wb(c)){if(u.rp.id!==c)return new it({message:`The RP ID "${u.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new it({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(u.user.id.byteLength<1||u.user.id.byteLength>64)return new it({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new it({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 it({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function xC({error:e,options:t}){const{publicKey:s}=t;if(!s)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new it({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new it({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const i=window.location.hostname;if(wb(i)){if(s.rpId!==i)return new it({message:`The RP ID "${s.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new it({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new it({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 it({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class CC{createNewAbortSignal(){if(this.controller){const s=new Error("Cancelling existing WebAuthn API call for new one");s.name="AbortError",this.controller.abort(s)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const Hf=new CC;function Av(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:s,excludeCredentials:i}=e,l=Au(e,["challenge","user","excludeCredentials"]),u=Qa(t).buffer,c=Object.assign(Object.assign({},s),{id:Qa(s.id).buffer}),f=Object.assign(Object.assign({},l),{challenge:u,user:c});if(i&&i.length>0){f.excludeCredentials=new Array(i.length);for(let p=0;p<i.length;p++){const g=i[p];f.excludeCredentials[p]=Object.assign(Object.assign({},g),{id:Qa(g.id).buffer,type:g.type||"public-key",transports:g.transports})}}return f}function Ov(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:s}=e,i=Au(e,["challenge","allowCredentials"]),l=Qa(t).buffer,u=Object.assign(Object.assign({},i),{challenge:l});if(s&&s.length>0){u.allowCredentials=new Array(s.length);for(let c=0;c<s.length;c++){const f=s[c];u.allowCredentials[c]=Object.assign(Object.assign({},f),{id:Qa(f.id).buffer,type:f.type||"public-key",transports:f.transports})}}return u}function xv(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const s=e;return{id:e.id,rawId:e.id,response:{attestationObject:Ps(new Uint8Array(e.response.attestationObject)),clientDataJSON:Ps(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=s.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Cv(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const s=e,i=e.getClientExtensionResults(),l=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:Ps(new Uint8Array(l.authenticatorData)),clientDataJSON:Ps(new Uint8Array(l.clientDataJSON)),signature:Ps(new Uint8Array(l.signature)),userHandle:l.userHandle?Ps(new Uint8Array(l.userHandle)):void 0},type:"public-key",clientExtensionResults:i,authenticatorAttachment:(t=s.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function wb(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function gu(){var e,t;return!!(At()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator?.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator?.credentials)===null||t===void 0?void 0:t.get)=="function")}async function Sb(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new pu("Browser returned unexpected credential type",t)}:{data:null,error:new pu("Empty credential response",t)}}catch(t){return{data:null,error:OC({error:t,options:e})}}}async function Eb(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new pu("Browser returned unexpected credential type",t)}:{data:null,error:new pu("Empty credential response",t)}}catch(t){return{data:null,error:xC({error:t,options:e})}}}const kC={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},jC={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function mu(...e){const t=l=>l!==null&&typeof l=="object"&&!Array.isArray(l),s=l=>l instanceof ArrayBuffer||ArrayBuffer.isView(l),i={};for(const l of e)if(l)for(const u in l){const c=l[u];if(c!==void 0)if(Array.isArray(c))i[u]=c;else if(s(c))i[u]=c;else if(t(c)){const f=i[u];t(f)?i[u]=mu(f,c):i[u]=mu(c)}else i[u]=c}return i}function MC(e,t){return mu(kC,e,t||{})}function NC(e,t){return mu(jC,e,t||{})}class DC{constructor(t){this.client=t,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(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:s,friendlyName:i,signal:l},u){var c;try{const{data:f,error:p}=await this.client.mfa.challenge({factorId:t,webauthn:s});if(!f)return{data:null,error:p};const g=l??Hf.createNewAbortSignal();if(f.webauthn.type==="create"){const{user:y}=f.webauthn.credential_options.publicKey;if(!y.name){const m=i;if(m)y.name=`${y.id}:${m}`;else{const _=(await this.client.getUser()).data.user,S=((c=_?.user_metadata)===null||c===void 0?void 0:c.name)||_?.email||_?.id||"User";y.name=`${y.id}:${S}`}}y.displayName||(y.displayName=y.name)}switch(f.webauthn.type){case"create":{const y=MC(f.webauthn.credential_options.publicKey,u?.create),{data:m,error:b}=await Sb({publicKey:y,signal:g});return m?{data:{factorId:t,challengeId:f.id,webauthn:{type:f.webauthn.type,credential_response:m}},error:null}:{data:null,error:b}}case"request":{const y=NC(f.webauthn.credential_options.publicKey,u?.request),{data:m,error:b}=await Eb(Object.assign(Object.assign({},f.webauthn.credential_options),{publicKey:y,signal:g}));return m?{data:{factorId:t,challengeId:f.id,webauthn:{type:f.webauthn.type,credential_response:m}},error:null}:{data:null,error:b}}}}catch(f){return te(f)?{data:null,error:f}:{data:null,error:new Mn("Unexpected error in challenge",f)}}}async _verify({challengeId:t,factorId:s,webauthn:i}){return this.client.mfa.verify({factorId:s,challengeId:t,webauthn:i})}async _authenticate({factorId:t,webauthn:{rpId:s=typeof window<"u"?window.location.hostname:void 0,rpOrigins:i=typeof window<"u"?[window.location.origin]:void 0,signal:l}={}},u){if(!s)return{data:null,error:new mo("rpId is required for WebAuthn authentication")};try{if(!gu())return{data:null,error:new Mn("Browser does not support WebAuthn",null)};const{data:c,error:f}=await this.challenge({factorId:t,webauthn:{rpId:s,rpOrigins:i},signal:l},{request:u});if(!c)return{data:null,error:f};const{webauthn:p}=c;return this._verify({factorId:t,challengeId:c.challengeId,webauthn:{type:p.type,rpId:s,rpOrigins:i,credential_response:p.credential_response}})}catch(c){return te(c)?{data:null,error:c}:{data:null,error:new Mn("Unexpected error in authenticate",c)}}}async _register({friendlyName:t,webauthn:{rpId:s=typeof window<"u"?window.location.hostname:void 0,rpOrigins:i=typeof window<"u"?[window.location.origin]:void 0,signal:l}={}},u){if(!s)return{data:null,error:new mo("rpId is required for WebAuthn registration")};try{if(!gu())return{data:null,error:new Mn("Browser does not support WebAuthn",null)};const{data:c,error:f}=await this._enroll({friendlyName:t});if(!c)return await this.client.mfa.listFactors().then(y=>{var m;return(m=y.data)===null||m===void 0?void 0:m.all.find(b=>b.factor_type==="webauthn"&&b.friendly_name===t&&b.status!=="unverified")}).then(y=>y?this.client.mfa.unenroll({factorId:y?.id}):void 0),{data:null,error:f};const{data:p,error:g}=await this._challenge({factorId:c.id,friendlyName:c.friendly_name,webauthn:{rpId:s,rpOrigins:i},signal:l},{create:u});return p?this._verify({factorId:c.id,challengeId:p.challengeId,webauthn:{rpId:s,rpOrigins:i,type:p.webauthn.type,credential_response:p.webauthn.credential_response}}):{data:null,error:g}}catch(c){return te(c)?{data:null,error:c}:{data:null,error:new Mn("Unexpected error in register",c)}}}}EC();const LC={url:Bx,storageKey:Hx,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Ix,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function kv(e,t,s){return await s()}const za={};class yo{get jwks(){var t,s;return(s=(t=za[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&s!==void 0?s:{keys:[]}}set jwks(t){za[this.storageKey]=Object.assign(Object.assign({},za[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,s;return(s=(t=za[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&s!==void 0?s:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){za[this.storageKey]=Object.assign(Object.assign({},za[this.storageKey]),{cachedAt:t})}constructor(t){var s,i,l,u;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=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;const c=Object.assign(Object.assign({},LC),t);if(this.storageKey=c.storageKey,this.instanceID=(s=yo.nextInstanceID[this.storageKey])!==null&&s!==void 0?s:0,yo.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!c.debug,typeof c.debug=="function"&&(this.logger=c.debug),this.instanceID>0&&At()){const f=`${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(f),this.logDebugMessages&&console.trace(f)}if(this.persistSession=c.persistSession,this.autoRefreshToken=c.autoRefreshToken,this.experimental=(i=c.experimental)!==null&&i!==void 0?i:{},this.admin=new wC({url:c.url,headers:c.headers,fetch:c.fetch,experimental:this.experimental}),this.url=c.url,this.headers=c.headers,this.fetch=vb(c.fetch),this.lock=c.lock||kv,this.detectSessionInUrl=c.detectSessionInUrl,this.flowType=c.flowType,this.hasCustomAuthorizationHeader=c.hasCustomAuthorizationHeader,this.throwOnError=c.throwOnError,this.lockAcquireTimeout=c.lockAcquireTimeout,c.lock?this.lock=c.lock:this.persistSession&&At()&&(!((l=globalThis?.navigator)===null||l===void 0)&&l.locks)?this.lock=SC:this.lock=kv,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 DC(this)},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.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(c.storage?this.storage=c.storage:yb()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Tv(this.memoryStorage)),c.userStorage&&(this.userStorage=c.userStorage)):(this.memoryStorage={},this.storage=Tv(this.memoryStorage)),At()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(f){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",f)}(u=this.broadcastChannel)===null||u===void 0||u.addEventListener("message",async f=>{this._debug("received broadcast notification from other tab or client",f);try{await this._notifyAllSubscribers(f.data.event,f.data.session,!1)}catch(p){this._debug("#broadcastChannel","error",p)}})}c.skipAutoInitialize||this.initialize().catch(f=>{this._debug("#initialize()","error",f)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${pb}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let s={},i="none";if(At()&&(s=tC(window.location.href),this._isImplicitGrantCallback(s)?i="implicit":await this._isPKCECallback(s)&&(i="pkce")),At()&&this.detectSessionInUrl&&i!=="none"){const{data:l,error:u}=await this._getSessionFromURL(s,i);if(u){if(this._debug("#_initialize()","error detecting session from URL",u),Kx(u)){const p=(t=u.details)===null||t===void 0?void 0:t.code;if(p==="identity_already_exists"||p==="identity_not_found"||p==="single_identity_not_deletable")return{error:u}}return{error:u}}const{session:c,redirectType:f}=l;return this._debug("#_initialize()","detected session in URL",c,"redirect type",f),await this._saveSession(c),setTimeout(async()=>{f==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",c):await this._notifyAllSubscribers("SIGNED_IN",c)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(s){return te(s)?this._returnResult({error:s}):this._returnResult({error:new Mn("Unexpected error during initialization",s)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var s,i,l;try{const u=await se(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(i=(s=t?.options)===null||s===void 0?void 0:s.data)!==null&&i!==void 0?i:{},gotrue_meta_security:{captcha_token:(l=t?.options)===null||l===void 0?void 0:l.captchaToken}},xform:_n}),{data:c,error:f}=u;if(f||!c)return this._returnResult({data:{user:null,session:null},error:f});const p=c.session,g=c.user;return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",p)),this._returnResult({data:{user:g,session:p},error:null})}catch(u){if(te(u))return this._returnResult({data:{user:null,session:null},error:u});throw u}}async signUp(t){var s,i,l;try{let u;if("email"in t){const{email:y,password:m,options:b}=t;let _=null,S=null;this.flowType==="pkce"&&([_,S]=await Ua(this.storage,this.storageKey)),u=await se(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:b?.emailRedirectTo,body:{email:y,password:m,data:(s=b?.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:b?.captchaToken},code_challenge:_,code_challenge_method:S},xform:_n})}else if("phone"in t){const{phone:y,password:m,options:b}=t;u=await se(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:y,password:m,data:(i=b?.data)!==null&&i!==void 0?i:{},channel:(l=b?.channel)!==null&&l!==void 0?l:"sms",gotrue_meta_security:{captcha_token:b?.captchaToken}},xform:_n})}else throw new Fl("You must provide either an email or phone number and a password");const{data:c,error:f}=u;if(f||!c)return await Rt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:f});const p=c.session,g=c.user;return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",p)),this._returnResult({data:{user:g,session:p},error:null})}catch(u){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),te(u))return this._returnResult({data:{user:null,session:null},error:u});throw u}}async signInWithPassword(t){try{let s;if("email"in t){const{email:u,password:c,options:f}=t;s=await se(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:u,password:c,gotrue_meta_security:{captcha_token:f?.captchaToken}},xform:Sv})}else if("phone"in t){const{phone:u,password:c,options:f}=t;s=await se(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:u,password:c,gotrue_meta_security:{captcha_token:f?.captchaToken}},xform:Sv})}else throw new Fl("You must provide either an email or phone number and a password");const{data:i,error:l}=s;if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!i||!i.session||!i.user){const u=new La;return this._returnResult({data:{user:null,session:null},error:u})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),this._returnResult({data:Object.assign({user:i.user,session:i.session},i.weak_password?{weakPassword:i.weak_password}:null),error:l})}catch(s){if(te(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithOAuth(t){var s,i,l,u;return await this._handleProviderSignIn(t.provider,{redirectTo:(s=t.options)===null||s===void 0?void 0:s.redirectTo,scopes:(i=t.options)===null||i===void 0?void 0:i.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:(u=t.options)===null||u===void 0?void 0:u.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:s}=t;switch(s){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${s}"`)}}async signInWithEthereum(t){var s,i,l,u,c,f,p,g,y,m,b;let _,S;if("message"in t)_=t.message,S=t.signature;else{const{chain:O,wallet:E,statement:A,options:M}=t;let j;if(At())if(typeof E=="object")j=E;else{const Z=window;if("ethereum"in Z&&typeof Z.ethereum=="object"&&"request"in Z.ethereum&&typeof Z.ethereum.request=="function")j=Z.ethereum;else throw new 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(typeof E!="object"||!M?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");j=E}const D=new URL((s=M?.url)!==null&&s!==void 0?s:window.location.href),X=await j.request({method:"eth_requestAccounts"}).then(Z=>Z).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!X||X.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const K=_b(X[0]);let H=(i=M?.signInWithEthereum)===null||i===void 0?void 0:i.chainId;if(!H){const Z=await j.request({method:"eth_chainId"});H=TC(Z)}const Y={domain:D.host,address:K,statement:A,uri:D.href,version:"1",chainId:H,nonce:(l=M?.signInWithEthereum)===null||l===void 0?void 0:l.nonce,issuedAt:(c=(u=M?.signInWithEthereum)===null||u===void 0?void 0:u.issuedAt)!==null&&c!==void 0?c:new Date,expirationTime:(f=M?.signInWithEthereum)===null||f===void 0?void 0:f.expirationTime,notBefore:(p=M?.signInWithEthereum)===null||p===void 0?void 0:p.notBefore,requestId:(g=M?.signInWithEthereum)===null||g===void 0?void 0:g.requestId,resources:(y=M?.signInWithEthereum)===null||y===void 0?void 0:y.resources};_=AC(Y),S=await j.request({method:"personal_sign",params:[RC(_),K]})}try{const{data:O,error:E}=await se(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:_,signature:S},!((m=t.options)===null||m===void 0)&&m.captchaToken?{gotrue_meta_security:{captcha_token:(b=t.options)===null||b===void 0?void 0:b.captchaToken}}:null),xform:_n});if(E)throw E;if(!O||!O.session||!O.user){const A=new La;return this._returnResult({data:{user:null,session:null},error:A})}return O.session&&(await this._saveSession(O.session),await this._notifyAllSubscribers("SIGNED_IN",O.session)),this._returnResult({data:Object.assign({},O),error:E})}catch(O){if(te(O))return this._returnResult({data:{user:null,session:null},error:O});throw O}}async signInWithSolana(t){var s,i,l,u,c,f,p,g,y,m,b,_;let S,O;if("message"in t)S=t.message,O=t.signature;else{const{chain:E,wallet:A,statement:M,options:j}=t;let D;if(At())if(typeof A=="object")D=A;else{const K=window;if("solana"in K&&typeof K.solana=="object"&&("signIn"in K.solana&&typeof K.solana.signIn=="function"||"signMessage"in K.solana&&typeof K.solana.signMessage=="function"))D=K.solana;else throw new 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(typeof A!="object"||!j?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");D=A}const X=new URL((s=j?.url)!==null&&s!==void 0?s:window.location.href);if("signIn"in D&&D.signIn){const K=await D.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},j?.signInWithSolana),{version:"1",domain:X.host,uri:X.href}),M?{statement:M}:null));let H;if(Array.isArray(K)&&K[0]&&typeof K[0]=="object")H=K[0];else if(K&&typeof K=="object"&&"signedMessage"in K&&"signature"in K)H=K;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in H&&"signature"in H&&(typeof H.signedMessage=="string"||H.signedMessage instanceof Uint8Array)&&H.signature instanceof Uint8Array)S=typeof H.signedMessage=="string"?H.signedMessage:new TextDecoder().decode(H.signedMessage),O=H.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in D)||typeof D.signMessage!="function"||!("publicKey"in D)||typeof D!="object"||!D.publicKey||!("toBase58"in D.publicKey)||typeof D.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");S=[`${X.host} wants you to sign in with your Solana account:`,D.publicKey.toBase58(),...M?["",M,""]:[""],"Version: 1",`URI: ${X.href}`,`Issued At: ${(l=(i=j?.signInWithSolana)===null||i===void 0?void 0:i.issuedAt)!==null&&l!==void 0?l:new Date().toISOString()}`,...!((u=j?.signInWithSolana)===null||u===void 0)&&u.notBefore?[`Not Before: ${j.signInWithSolana.notBefore}`]:[],...!((c=j?.signInWithSolana)===null||c===void 0)&&c.expirationTime?[`Expiration Time: ${j.signInWithSolana.expirationTime}`]:[],...!((f=j?.signInWithSolana)===null||f===void 0)&&f.chainId?[`Chain ID: ${j.signInWithSolana.chainId}`]:[],...!((p=j?.signInWithSolana)===null||p===void 0)&&p.nonce?[`Nonce: ${j.signInWithSolana.nonce}`]:[],...!((g=j?.signInWithSolana)===null||g===void 0)&&g.requestId?[`Request ID: ${j.signInWithSolana.requestId}`]:[],...!((m=(y=j?.signInWithSolana)===null||y===void 0?void 0:y.resources)===null||m===void 0)&&m.length?["Resources",...j.signInWithSolana.resources.map(H=>`- ${H}`)]:[]].join(`
`);const K=await D.signMessage(new TextEncoder().encode(S),"utf8");if(!K||!(K instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");O=K}}try{const{data:E,error:A}=await se(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:S,signature:Ps(O)},!((b=t.options)===null||b===void 0)&&b.captchaToken?{gotrue_meta_security:{captcha_token:(_=t.options)===null||_===void 0?void 0:_.captchaToken}}:null),xform:_n});if(A)throw A;if(!E||!E.session||!E.user){const M=new La;return this._returnResult({data:{user:null,session:null},error:M})}return E.session&&(await this._saveSession(E.session),await this._notifyAllSubscribers("SIGNED_IN",E.session)),this._returnResult({data:Object.assign({},E),error:A})}catch(E){if(te(E))return this._returnResult({data:{user:null,session:null},error:E});throw E}}async _exchangeCodeForSession(t){const s=await Ns(this.storage,`${this.storageKey}-code-verifier`),[i,l]=(s??"").split("/");try{if(!i&&this.flowType==="pkce")throw new Yx;const{data:u,error:c}=await se(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:i},xform:_n});if(await Rt(this.storage,`${this.storageKey}-code-verifier`),c)throw c;if(!u||!u.session||!u.user){const f=new La;return this._returnResult({data:{user:null,session:null,redirectType:null},error:f})}return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers(l==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u.session)),this._returnResult({data:Object.assign(Object.assign({},u),{redirectType:l??null}),error:c})}catch(u){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),te(u))return this._returnResult({data:{user:null,session:null,redirectType:null},error:u});throw u}}async signInWithIdToken(t){try{const{options:s,provider:i,token:l,access_token:u,nonce:c}=t,f=await se(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:i,id_token:l,access_token:u,nonce:c,gotrue_meta_security:{captcha_token:s?.captchaToken}},xform:_n}),{data:p,error:g}=f;if(g)return this._returnResult({data:{user:null,session:null},error:g});if(!p||!p.session||!p.user){const y=new La;return this._returnResult({data:{user:null,session:null},error:y})}return p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("SIGNED_IN",p.session)),this._returnResult({data:p,error:g})}catch(s){if(te(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithOtp(t){var s,i,l,u,c;try{if("email"in t){const{email:f,options:p}=t;let g=null,y=null;this.flowType==="pkce"&&([g,y]=await Ua(this.storage,this.storageKey));const{error:m}=await se(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:f,data:(s=p?.data)!==null&&s!==void 0?s:{},create_user:(i=p?.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:p?.captchaToken},code_challenge:g,code_challenge_method:y},redirectTo:p?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:m})}if("phone"in t){const{phone:f,options:p}=t,{data:g,error:y}=await se(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:f,data:(l=p?.data)!==null&&l!==void 0?l:{},create_user:(u=p?.shouldCreateUser)!==null&&u!==void 0?u:!0,gotrue_meta_security:{captcha_token:p?.captchaToken},channel:(c=p?.channel)!==null&&c!==void 0?c:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:g?.message_id},error:y})}throw new Fl("You must provide either an email or phone number.")}catch(f){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),te(f))return this._returnResult({data:{user:null,session:null},error:f});throw f}}async verifyOtp(t){var s,i;try{let l,u;"options"in t&&(l=(s=t.options)===null||s===void 0?void 0:s.redirectTo,u=(i=t.options)===null||i===void 0?void 0:i.captchaToken);const{data:c,error:f}=await se(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:u}}),redirectTo:l,xform:_n});if(f)throw f;if(!c)throw new Error("An error occurred on token verification.");const p=c.session,g=c.user;return p?.access_token&&(await this._saveSession(p),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",p)),this._returnResult({data:{user:g,session:p},error:null})}catch(l){if(te(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async signInWithSSO(t){var s,i,l,u,c;try{let f=null,p=null;this.flowType==="pkce"&&([f,p]=await Ua(this.storage,this.storageKey));const g=await se(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(i=(s=t.options)===null||s===void 0?void 0:s.redirectTo)!==null&&i!==void 0?i:void 0}),!((l=t?.options)===null||l===void 0)&&l.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:f,code_challenge_method:p}),headers:this.headers,xform:vC});return!((u=g.data)===null||u===void 0)&&u.url&&At()&&!(!((c=t.options)===null||c===void 0)&&c.skipBrowserRedirect)&&window.location.assign(g.data.url),this._returnResult(g)}catch(f){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),te(f))return this._returnResult({data:null,error:f});throw f}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:s},error:i}=t;if(i)throw i;if(!s)throw new mt;const{error:l}=await se(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:s.access_token});return this._returnResult({data:{user:null,session:null},error:l})})}catch(t){if(te(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const s=`${this.url}/resend`;if("email"in t){const{email:i,type:l,options:u}=t,{error:c}=await se(this.fetch,"POST",s,{headers:this.headers,body:{email:i,type:l,gotrue_meta_security:{captcha_token:u?.captchaToken}},redirectTo:u?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:c})}else if("phone"in t){const{phone:i,type:l,options:u}=t,{data:c,error:f}=await se(this.fetch,"POST",s,{headers:this.headers,body:{phone:i,type:l,gotrue_meta_security:{captcha_token:u?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:c?.message_id},error:f})}throw new Fl("You must provide either an email or phone number and a type")}catch(s){if(te(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async s=>s))}async _acquireLock(t,s){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const i=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),l=(async()=>(await i,await s()))();return this.pendingInLock.push((async()=>{try{await l}catch{}})()),l}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const i=s();for(this.pendingInLock.push((async()=>{try{await i}catch{}})()),await i;this.pendingInLock.length;){const l=[...this.pendingInLock];await Promise.all(l),this.pendingInLock.splice(0,l.length)}return await i}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const s=await this.__loadSession();return await t(s)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const s=await Ns(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",s),s!==null&&(this._isValidSession(s)?t=s:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const i=t.expires_at?t.expires_at*1e3-Date.now()<lf:!1;if(this._debug("#__loadSession()",`session has${i?"":" not"} expired`,"expires_at",t.expires_at),!i){if(this.userStorage){const c=await Ns(this.userStorage,this.storageKey+"-user");c?.user?t.user=c.user:t.user=cf()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const c={value:this.suppressGetSessionWarning};t.user=pC(t.user,c),c.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:l,error:u}=await this._callRefreshToken(t.refresh_token);return u?this._returnResult({data:{session:null},error:u}):this._returnResult({data:{session:l},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const s=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return s.data.user&&(this.suppressGetSessionWarning=!0),s}async _getUser(t){try{return t?await se(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Zr}):await this._useSession(async s=>{var i,l,u;const{data:c,error:f}=s;if(f)throw f;return!(!((i=c.session)===null||i===void 0)&&i.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new mt}:await se(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(u=(l=c.session)===null||l===void 0?void 0:l.access_token)!==null&&u!==void 0?u:void 0,xform:Zr})})}catch(s){if(te(s))return Yl(s)&&(await this._removeSession(),await Rt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:s});throw s}}async updateUser(t,s={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,s))}async _updateUser(t,s={}){try{return await this._useSession(async i=>{const{data:l,error:u}=i;if(u)throw u;if(!l.session)throw new mt;const c=l.session;let f=null,p=null;this.flowType==="pkce"&&t.email!=null&&([f,p]=await Ua(this.storage,this.storageKey));const{data:g,error:y}=await se(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:s?.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:f,code_challenge_method:p}),jwt:c.access_token,xform:Zr});if(y)throw y;return c.user=g.user,await this._saveSession(c),await this._notifyAllSubscribers("USER_UPDATED",c),this._returnResult({data:{user:c.user},error:null})})}catch(i){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),te(i))return this._returnResult({data:{user:null},error:i});throw i}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new mt;const s=Date.now()/1e3;let i=s,l=!0,u=null;const{payload:c}=Jl(t.access_token);if(c.exp&&(i=c.exp,l=i<=s),l){const{data:f,error:p}=await this._callRefreshToken(t.refresh_token);if(p)return this._returnResult({data:{user:null,session:null},error:p});if(!f)return{data:{user:null,session:null},error:null};u=f}else{const{data:f,error:p}=await this._getUser(t.access_token);if(p)return this._returnResult({data:{user:null,session:null},error:p});u={access_token:t.access_token,refresh_token:t.refresh_token,user:f.user,token_type:"bearer",expires_in:i-s,expires_at:i},await this._saveSession(u),await this._notifyAllSubscribers("SIGNED_IN",u)}return this._returnResult({data:{user:u.user,session:u},error:null})}catch(s){if(te(s))return this._returnResult({data:{session:null,user:null},error:s});throw s}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async s=>{var i;if(!t){const{data:c,error:f}=s;if(f)throw f;t=(i=c.session)!==null&&i!==void 0?i:void 0}if(!t?.refresh_token)throw new mt;const{data:l,error:u}=await this._callRefreshToken(t.refresh_token);return u?this._returnResult({data:{user:null,session:null},error:u}):l?this._returnResult({data:{user:l.user,session:l},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(s){if(te(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async _getSessionFromURL(t,s){var i;try{if(!At())throw new Ql("No browser detected.");if(t.error||t.error_description||t.error_code)throw new Ql(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(s){case"implicit":if(this.flowType==="pkce")throw new gv("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Ql("Not a valid implicit grant flow url.");break;default:}if(s==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new gv("No code detected.");const{data:j,error:D}=await this._exchangeCodeForSession(t.code);if(D)throw D;const X=new URL(window.location.href);return X.searchParams.delete("code"),window.history.replaceState(window.history.state,"",X.toString()),{data:{session:j.session,redirectType:(i=j.redirectType)!==null&&i!==void 0?i:null},error:null}}const{provider_token:l,provider_refresh_token:u,access_token:c,refresh_token:f,expires_in:p,expires_at:g,token_type:y}=t;if(!c||!p||!f||!y)throw new Ql("No session defined in URL");const m=Math.round(Date.now()/1e3),b=parseInt(p);let _=m+b;g&&(_=parseInt(g));const S=_-m;S*1e3<=Ia&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${S}s, should have been closer to ${b}s`);const O=_-b;m-O>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",O,_,m):m-O<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",O,_,m);const{data:E,error:A}=await this._getUser(c);if(A)throw A;const M={provider_token:l,provider_refresh_token:u,access_token:c,expires_in:b,expires_at:_,refresh_token:f,token_type:y,user:E.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:M,redirectType:t.type},error:null})}catch(l){if(te(l))return this._returnResult({data:{session:null,redirectType:null},error:l});throw l}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const s=await Ns(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&s)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async s=>{var i;const{data:l,error:u}=s;if(u&&!Yl(u))return this._returnResult({error:u});const c=(i=l.session)===null||i===void 0?void 0:i.access_token;if(c){const{error:f}=await this.admin.signOut(c,t);if(f&&!(Gx(f)&&(f.status===404||f.status===401||f.status===403)||Yl(f)))return this._returnResult({error:f})}return t!=="others"&&(await this._removeSession(),await Rt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const s=eC(),i={id:s,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",s),this.stateChangeEmitters.delete(s)}};return this._debug("#onAuthStateChange()","registered callback with id",s),this.stateChangeEmitters.set(s,i),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(s)})))(),{data:{subscription:i}}}async _emitInitialSession(t){return await this._useSession(async s=>{var i,l;try{const{data:{session:u},error:c}=s;if(c)throw c;await((i=this.stateChangeEmitters.get(t))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",u)),this._debug("INITIAL_SESSION","callback id",t,"session",u)}catch(u){await((l=this.stateChangeEmitters.get(t))===null||l===void 0?void 0:l.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",u),Yl(u)?console.warn(u):console.error(u)}})}async resetPasswordForEmail(t,s={}){let i=null,l=null;this.flowType==="pkce"&&([i,l]=await Ua(this.storage,this.storageKey,!0));try{return await se(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:i,code_challenge_method:l,gotrue_meta_security:{captcha_token:s.captchaToken}},headers:this.headers,redirectTo:s.redirectTo})}catch(u){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),te(u))return this._returnResult({data:null,error:u});throw u}}async getUserIdentities(){var t;try{const{data:s,error:i}=await this.getUser();if(i)throw i;return this._returnResult({data:{identities:(t=s.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(s){if(te(s))return this._returnResult({data:null,error:s});throw s}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var s;try{const{data:i,error:l}=await this._useSession(async u=>{var c,f,p,g,y;const{data:m,error:b}=u;if(b)throw b;const _=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(c=t.options)===null||c===void 0?void 0:c.redirectTo,scopes:(f=t.options)===null||f===void 0?void 0:f.scopes,queryParams:(p=t.options)===null||p===void 0?void 0:p.queryParams,skipBrowserRedirect:!0});return await se(this.fetch,"GET",_,{headers:this.headers,jwt:(y=(g=m.session)===null||g===void 0?void 0:g.access_token)!==null&&y!==void 0?y:void 0})});if(l)throw l;return At()&&!(!((s=t.options)===null||s===void 0)&&s.skipBrowserRedirect)&&window.location.assign(i?.url),this._returnResult({data:{provider:t.provider,url:i?.url},error:null})}catch(i){if(te(i))return this._returnResult({data:{provider:t.provider,url:null},error:i});throw i}}async linkIdentityIdToken(t){return await this._useSession(async s=>{var i;try{const{error:l,data:{session:u}}=s;if(l)throw l;const{options:c,provider:f,token:p,access_token:g,nonce:y}=t,m=await se(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(i=u?.access_token)!==null&&i!==void 0?i:void 0,body:{provider:f,id_token:p,access_token:g,nonce:y,link_identity:!0,gotrue_meta_security:{captcha_token:c?.captchaToken}},xform:_n}),{data:b,error:_}=m;return _?this._returnResult({data:{user:null,session:null},error:_}):!b||!b.session||!b.user?this._returnResult({data:{user:null,session:null},error:new La}):(b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("USER_UPDATED",b.session)),this._returnResult({data:b,error:_}))}catch(l){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),te(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}})}async unlinkIdentity(t){try{return await this._useSession(async s=>{var i,l;const{data:u,error:c}=s;if(c)throw c;return await se(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(l=(i=u.session)===null||i===void 0?void 0:i.access_token)!==null&&l!==void 0?l:void 0})})}catch(s){if(te(s))return this._returnResult({data:null,error:s});throw s}}async _refreshAccessToken(t){const s=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{const i=Date.now();return await sC(async l=>(l>0&&await rC(200*Math.pow(2,l-1)),this._debug(s,"refreshing attempt",l),await se(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:_n})),(l,u)=>{const c=200*Math.pow(2,l);return u&&uf(u)&&Date.now()+c-i<Ia})}catch(i){if(this._debug(s,"error",i),te(i))return this._returnResult({data:{session:null,user:null},error:i});throw i}finally{this._debug(s,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,s){const i=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:s.redirectTo,scopes:s.scopes,queryParams:s.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",s,"url",i),At()&&!s.skipBrowserRedirect&&window.location.assign(i),{data:{provider:t,url:i},error:null}}async _recoverAndRefresh(){var t,s;const i="#_recoverAndRefresh()";this._debug(i,"begin");try{const l=await Ns(this.storage,this.storageKey);if(l&&this.userStorage){let c=await Ns(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!c&&(c={user:l.user},await qa(this.userStorage,this.storageKey+"-user",c)),l.user=(t=c?.user)!==null&&t!==void 0?t:cf()}else if(l&&!l.user&&!l.user){const c=await Ns(this.storage,this.storageKey+"-user");c&&c?.user?(l.user=c.user,await Rt(this.storage,this.storageKey+"-user"),await qa(this.storage,this.storageKey,l)):l.user=cf()}if(this._debug(i,"session from storage",l),!this._isValidSession(l)){this._debug(i,"session is not valid"),l!==null&&await this._removeSession();return}const u=((s=l.expires_at)!==null&&s!==void 0?s:1/0)*1e3-Date.now()<lf;if(this._debug(i,`session has${u?"":" not"} expired with margin of ${lf}s`),u){if(this.autoRefreshToken&&l.refresh_token){const{error:c}=await this._callRefreshToken(l.refresh_token);c&&(console.error(c),uf(c)||(this._debug(i,"refresh failed with a non-retryable error, removing the session",c),await this._removeSession()))}}else if(l.user&&l.user.__isUserNotAvailableProxy===!0)try{const{data:c,error:f}=await this._getUser(l.access_token);!f&&c?.user?(l.user=c.user,await this._saveSession(l),await this._notifyAllSubscribers("SIGNED_IN",l)):this._debug(i,"could not get user data, skipping SIGNED_IN notification")}catch(c){console.error("Error getting user data:",c),this._debug(i,"error getting user data, skipping SIGNED_IN notification",c)}else await this._notifyAllSubscribers("SIGNED_IN",l)}catch(l){this._debug(i,"error",l),console.error(l);return}finally{this._debug(i,"end")}}async _callRefreshToken(t){var s,i;if(!t)throw new mt;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const l=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(l,"begin");try{this.refreshingDeferred=new Cu;const{data:u,error:c}=await this._refreshAccessToken(t);if(c)throw c;if(!u.session)throw new mt;await this._saveSession(u.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",u.session);const f={data:u.session,error:null};return this.refreshingDeferred.resolve(f),f}catch(u){if(this._debug(l,"error",u),te(u)){const c={data:null,error:u};return uf(u)||await this._removeSession(),(s=this.refreshingDeferred)===null||s===void 0||s.resolve(c),c}throw(i=this.refreshingDeferred)===null||i===void 0||i.reject(u),u}finally{this.refreshingDeferred=null,this._debug(l,"end")}}async _notifyAllSubscribers(t,s,i=!0){const l=`#_notifyAllSubscribers(${t})`;this._debug(l,"begin",s,`broadcast = ${i}`);try{this.broadcastChannel&&i&&this.broadcastChannel.postMessage({event:t,session:s});const u=[],c=Array.from(this.stateChangeEmitters.values()).map(async f=>{try{await f.callback(t,s)}catch(p){u.push(p)}});if(await Promise.all(c),u.length>0){for(let f=0;f<u.length;f+=1)console.error(u[f]);throw u[0]}}finally{this._debug(l,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Rt(this.storage,`${this.storageKey}-code-verifier`);const s=Object.assign({},t),i=s.user&&s.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!i&&s.user&&await qa(this.userStorage,this.storageKey+"-user",{user:s.user});const l=Object.assign({},s);delete l.user;const u=_v(l);await qa(this.storage,this.storageKey,u)}else{const l=_v(s);await qa(this.storage,this.storageKey,l)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Rt(this.storage,this.storageKey),await Rt(this.storage,this.storageKey+"-code-verifier"),await Rt(this.storage,this.storageKey+"-user"),this.userStorage&&await Rt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&At()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",t)}catch(s){console.error("removing visibilitychange callback failed",s)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),Ia);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const s=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=s,s&&typeof s=="object"&&typeof s.unref=="function"?s.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(s)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const s=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,s&&clearTimeout(s)}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{const t=Date.now();try{return await this._useSession(async s=>{const{data:{session:i}}=s;if(!i||!i.refresh_token||!i.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const l=Math.floor((i.expires_at*1e3-t)/Ia);this._debug("#_autoRefreshTokenTick()",`access token expires in ${l} ticks, a tick lasts ${Ia}ms, refresh threshold is ${Uf} ticks`),l<=Uf&&await this._callRefreshToken(i.refresh_token)})}catch(s){console.error("Auto refresh tick failed with error. This is likely a transient error.",s)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t instanceof bb)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!At()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const s=`#_onVisibilityChanged(${t})`;this._debug(s,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(s,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,s,i){const l=[`provider=${encodeURIComponent(s)}`];if(i?.redirectTo&&l.push(`redirect_to=${encodeURIComponent(i.redirectTo)}`),i?.scopes&&l.push(`scopes=${encodeURIComponent(i.scopes)}`),this.flowType==="pkce"){const[u,c]=await Ua(this.storage,this.storageKey),f=new URLSearchParams({code_challenge:`${encodeURIComponent(u)}`,code_challenge_method:`${encodeURIComponent(c)}`});l.push(f.toString())}if(i?.queryParams){const u=new URLSearchParams(i.queryParams);l.push(u.toString())}return i?.skipBrowserRedirect&&l.push(`skip_http_redirect=${i.skipBrowserRedirect}`),`${t}?${l.join("&")}`}async _unenroll(t){try{return await this._useSession(async s=>{var i;const{data:l,error:u}=s;return u?this._returnResult({data:null,error:u}):await se(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(i=l?.session)===null||i===void 0?void 0:i.access_token})})}catch(s){if(te(s))return this._returnResult({data:null,error:s});throw s}}async _enroll(t){try{return await this._useSession(async s=>{var i,l;const{data:u,error:c}=s;if(c)return this._returnResult({data:null,error:c});const f=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:p,error:g}=await se(this.fetch,"POST",`${this.url}/factors`,{body:f,headers:this.headers,jwt:(i=u?.session)===null||i===void 0?void 0:i.access_token});return g?this._returnResult({data:null,error:g}):(t.factorType==="totp"&&p.type==="totp"&&(!((l=p?.totp)===null||l===void 0)&&l.qr_code)&&(p.totp.qr_code=`data:image/svg+xml;utf-8,${p.totp.qr_code}`),this._returnResult({data:p,error:null}))})}catch(s){if(te(s))return this._returnResult({data:null,error:s});throw s}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async s=>{var i;const{data:l,error:u}=s;if(u)return this._returnResult({data:null,error:u});const c=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?xv(t.webauthn.credential_response):Cv(t.webauthn.credential_response)})}:{code:t.code}),{data:f,error:p}=await se(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:c,headers:this.headers,jwt:(i=l?.session)===null||i===void 0?void 0:i.access_token});return p?this._returnResult({data:null,error:p}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+f.expires_in},f)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",f),this._returnResult({data:f,error:p}))})}catch(s){if(te(s))return this._returnResult({data:null,error:s});throw s}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async s=>{var i;const{data:l,error:u}=s;if(u)return this._returnResult({data:null,error:u});const c=await se(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(i=l?.session)===null||i===void 0?void 0:i.access_token});if(c.error)return c;const{data:f}=c;if(f.type!=="webauthn")return{data:f,error:null};switch(f.webauthn.type){case"create":return{data:Object.assign(Object.assign({},f),{webauthn:Object.assign(Object.assign({},f.webauthn),{credential_options:Object.assign(Object.assign({},f.webauthn.credential_options),{publicKey:Av(f.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},f),{webauthn:Object.assign(Object.assign({},f.webauthn),{credential_options:Object.assign(Object.assign({},f.webauthn.credential_options),{publicKey:Ov(f.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(s){if(te(s))return this._returnResult({data:null,error:s});throw s}})}async _challengeAndVerify(t){const{data:s,error:i}=await this._challenge({factorId:t.factorId});return i?this._returnResult({data:null,error:i}):await this._verify({factorId:t.factorId,challengeId:s.id,code:t.code})}async _listFactors(){var t;const{data:{user:s},error:i}=await this.getUser();if(i)return{data:null,error:i};const l={all:[],phone:[],totp:[],webauthn:[]};for(const u of(t=s?.factors)!==null&&t!==void 0?t:[])l.all.push(u),u.status==="verified"&&l[u.factor_type].push(u);return{data:l,error:null}}async _getAuthenticatorAssuranceLevel(t){var s,i,l,u;if(t)try{const{payload:_}=Jl(t);let S=null;_.aal&&(S=_.aal);let O=S;const{data:{user:E},error:A}=await this.getUser(t);if(A)return this._returnResult({data:null,error:A});((i=(s=E?.factors)===null||s===void 0?void 0:s.filter(D=>D.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(O="aal2");const j=_.amr||[];return{data:{currentLevel:S,nextLevel:O,currentAuthenticationMethods:j},error:null}}catch(_){if(te(_))return this._returnResult({data:null,error:_});throw _}const{data:{session:c},error:f}=await this.getSession();if(f)return this._returnResult({data:null,error:f});if(!c)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:p}=Jl(c.access_token);let g=null;p.aal&&(g=p.aal);let y=g;((u=(l=c.user.factors)===null||l===void 0?void 0:l.filter(_=>_.status==="verified"))!==null&&u!==void 0?u:[]).length>0&&(y="aal2");const b=p.amr||[];return{data:{currentLevel:g,nextLevel:y,currentAuthenticationMethods:b},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async s=>{const{data:{session:i},error:l}=s;return l?this._returnResult({data:null,error:l}):i?await se(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:i.access_token,xform:u=>({data:u,error:null})}):this._returnResult({data:null,error:new mt})})}catch(s){if(te(s))return this._returnResult({data:null,error:s});throw s}}async _approveAuthorization(t,s){try{return await this._useSession(async i=>{const{data:{session:l},error:u}=i;if(u)return this._returnResult({data:null,error:u});if(!l)return this._returnResult({data:null,error:new mt});const c=await se(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:l.access_token,body:{action:"approve"},xform:f=>({data:f,error:null})});return c.data&&c.data.redirect_url&&At()&&!s?.skipBrowserRedirect&&window.location.assign(c.data.redirect_url),c})}catch(i){if(te(i))return this._returnResult({data:null,error:i});throw i}}async _denyAuthorization(t,s){try{return await this._useSession(async i=>{const{data:{session:l},error:u}=i;if(u)return this._returnResult({data:null,error:u});if(!l)return this._returnResult({data:null,error:new mt});const c=await se(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:l.access_token,body:{action:"deny"},xform:f=>({data:f,error:null})});return c.data&&c.data.redirect_url&&At()&&!s?.skipBrowserRedirect&&window.location.assign(c.data.redirect_url),c})}catch(i){if(te(i))return this._returnResult({data:null,error:i});throw i}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:s},error:i}=t;return i?this._returnResult({data:null,error:i}):s?await se(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:s.access_token,xform:l=>({data:l,error:null})}):this._returnResult({data:null,error:new mt})})}catch(t){if(te(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async s=>{const{data:{session:i},error:l}=s;return l?this._returnResult({data:null,error:l}):i?(await se(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:i.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new mt})})}catch(s){if(te(s))return this._returnResult({data:null,error:s});throw s}}async fetchJwk(t,s={keys:[]}){let i=s.keys.find(f=>f.kid===t);if(i)return i;const l=Date.now();if(i=this.jwks.keys.find(f=>f.kid===t),i&&this.jwks_cached_at+$x>l)return i;const{data:u,error:c}=await se(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(c)throw c;return!u.keys||u.keys.length===0||(this.jwks=u,this.jwks_cached_at=l,i=u.keys.find(f=>f.kid===t),!i)?null:i}async getClaims(t,s={}){try{let i=t;if(!i){const{data:_,error:S}=await this.getSession();if(S||!_.session)return this._returnResult({data:null,error:S});i=_.session.access_token}const{header:l,payload:u,signature:c,raw:{header:f,payload:p}}=Jl(i);s?.allowExpired||hC(u.exp);const g=!l.alg||l.alg.startsWith("HS")||!l.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(l.kid,s?.keys?{keys:s.keys}:s?.jwks);if(!g){const{error:_}=await this.getUser(i);if(_)throw _;return{data:{claims:u,header:l,signature:c},error:null}}const y=fC(l.alg),m=await crypto.subtle.importKey("jwk",g,y,!0,["verify"]);if(!await crypto.subtle.verify(y,m,c,Zx(`${f}.${p}`)))throw new Bf("Invalid JWT signature");return{data:{claims:u,header:l,signature:c},error:null}}catch(i){if(te(i))return this._returnResult({data:null,error:i});throw i}}async signInWithPasskey(t){var s,i,l;Cn(this.experimental);try{if(!gu())return this._returnResult({data:null,error:new Mn("Browser does not support WebAuthn",null)});const{data:u,error:c}=await this._startPasskeyAuthentication({options:{captchaToken:(s=t?.options)===null||s===void 0?void 0:s.captchaToken}});if(c||!u)return this._returnResult({data:null,error:c});const f=Ov(u.options),p=(l=(i=t?.options)===null||i===void 0?void 0:i.signal)!==null&&l!==void 0?l:Hf.createNewAbortSignal(),{data:g,error:y}=await Eb({publicKey:f,signal:p});if(y||!g)return this._returnResult({data:null,error:y??new Mn("WebAuthn ceremony failed",null)});const m=Cv(g);return this._verifyPasskeyAuthentication({challengeId:u.challenge_id,credential:m})}catch(u){if(te(u))return this._returnResult({data:null,error:u});throw u}}async registerPasskey(t){var s,i;Cn(this.experimental);try{if(!gu())return this._returnResult({data:null,error:new Mn("Browser does not support WebAuthn",null)});const{data:l,error:u}=await this._startPasskeyRegistration();if(u||!l)return this._returnResult({data:null,error:u});const c=Av(l.options),f=(i=(s=t?.options)===null||s===void 0?void 0:s.signal)!==null&&i!==void 0?i:Hf.createNewAbortSignal(),{data:p,error:g}=await Sb({publicKey:c,signal:f});if(g||!p)return this._returnResult({data:null,error:g??new Mn("WebAuthn ceremony failed",null)});const y=xv(p);return this._verifyPasskeyRegistration({challengeId:l.challenge_id,credential:y})}catch(l){if(te(l))return this._returnResult({data:null,error:l});throw l}}async _startPasskeyRegistration(){Cn(this.experimental);try{return await this._useSession(async t=>{const{data:{session:s},error:i}=t;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new mt});const{data:l,error:u}=await se(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:s.access_token,body:{}});return u?this._returnResult({data:null,error:u}):this._returnResult({data:l,error:null})})}catch(t){if(te(t))return this._returnResult({data:null,error:t});throw t}}async _verifyPasskeyRegistration(t){Cn(this.experimental);try{return await this._useSession(async s=>{const{data:{session:i},error:l}=s;if(l)return this._returnResult({data:null,error:l});if(!i)return this._returnResult({data:null,error:new mt});const{data:u,error:c}=await se(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:i.access_token,body:{challenge_id:t.challengeId,credential:t.credential}});return c?this._returnResult({data:null,error:c}):this._returnResult({data:u,error:null})})}catch(s){if(te(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyAuthentication(t){var s;Cn(this.experimental);try{const{data:i,error:l}=await se(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(s=t?.options)===null||s===void 0?void 0:s.captchaToken}}});return l?this._returnResult({data:null,error:l}):this._returnResult({data:i,error:null})}catch(i){if(te(i))return this._returnResult({data:null,error:i});throw i}}async _verifyPasskeyAuthentication(t){Cn(this.experimental);try{const{data:s,error:i}=await se(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:t.challengeId,credential:t.credential},xform:_n});return i?this._returnResult({data:null,error:i}):(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:s,error:null}))}catch(s){if(te(s))return this._returnResult({data:null,error:s});throw s}}async _listPasskeys(){Cn(this.experimental);try{return await this._useSession(async t=>{const{data:{session:s},error:i}=t;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new mt});const{data:l,error:u}=await se(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:s.access_token,xform:c=>({data:c,error:null})});return u?this._returnResult({data:null,error:u}):this._returnResult({data:l,error:null})})}catch(t){if(te(t))return this._returnResult({data:null,error:t});throw t}}async _updatePasskey(t){Cn(this.experimental);try{return await this._useSession(async s=>{const{data:{session:i},error:l}=s;if(l)return this._returnResult({data:null,error:l});if(!i)return this._returnResult({data:null,error:new mt});const{data:u,error:c}=await se(this.fetch,"PATCH",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:i.access_token,body:{friendly_name:t.friendlyName}});return c?this._returnResult({data:null,error:c}):this._returnResult({data:u,error:null})})}catch(s){if(te(s))return this._returnResult({data:null,error:s});throw s}}async _deletePasskey(t){Cn(this.experimental);try{return await this._useSession(async s=>{const{data:{session:i},error:l}=s;if(l)return this._returnResult({data:null,error:l});if(!i)return this._returnResult({data:null,error:new mt});const{error:u}=await se(this.fetch,"DELETE",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:i.access_token,noResolveJson:!0});return u?this._returnResult({data:null,error:u}):this._returnResult({data:null,error:null})})}catch(s){if(te(s))return this._returnResult({data:null,error:s});throw s}}}yo.nextInstanceID={};const UC=yo,zC="2.106.0";let eo="";typeof Deno<"u"?eo="deno":typeof document<"u"?eo="web":typeof navigator<"u"&&navigator.product==="ReactNative"?eo="react-native":eo="node";const PC={"X-Client-Info":`supabase-js-${eo}/${zC}`},BC={headers:PC},HC={schema:"public"},IC={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},qC={},$C={enabled:!1,respectSamplingDecision:!0};function VC(e,t,s,i){function l(u){return u instanceof s?u:new s(function(c){c(u)})}return new(s||(s=Promise))(function(u,c){function f(y){try{g(i.next(y))}catch(m){c(m)}}function p(y){try{g(i.throw(y))}catch(m){c(m)}}function g(y){y.done?u(y.value):l(y.value).then(f,p)}g((i=i.apply(e,[])).next())})}let ff=null;const GC="@opentelemetry/api";function KC(){return ff===null&&(ff=import(GC).catch(()=>null)),ff}function YC(){return VC(this,void 0,void 0,function*(){try{const e=yield KC();if(!e||!e.propagation||!e.context)return null;const t={};e.propagation.inject(e.context.active(),t);const s=t.traceparent;return s?{traceparent:s,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function FC(e){if(!e||typeof e!="string")return null;const t=e.split("-");if(t.length!==4)return null;const[s,i,l,u]=t;if(s.length!==2||i.length!==32||l.length!==16||u.length!==2)return null;const c=/^[0-9a-f]+$/i;return!c.test(s)||!c.test(i)||!c.test(l)||!c.test(u)||i==="00000000000000000000000000000000"||l==="0000000000000000"?null:{version:s,traceId:i,parentId:l,traceFlags:u,isSampled:(parseInt(u,16)&1)===1}}function QC(e,t){if(!e||!t||t.length===0)return!1;let s;if(e instanceof URL)s=e;else try{s=new URL(e)}catch{return!1}for(const i of t)try{if(typeof i=="string"){if(JC(s.hostname,i))return!0}else if(i instanceof RegExp){if(i.test(s.hostname))return!0}else if(typeof i=="function"&&i(s))return!0}catch{continue}return!1}function JC(e,t){if(t===e)return!0;if(t.startsWith("*.")){const s=t.slice(2);if(e.endsWith(s)&&(e===s||e.endsWith("."+s)))return!0}return!1}function XC(e){const t=[];try{const s=new URL(e);t.push(s.hostname)}catch{}return t.push("*.supabase.co","*.supabase.in"),t.push("localhost","127.0.0.1","[::1]"),t}function vo(e){"@babel/helpers - typeof";return vo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vo(e)}function ZC(e,t){if(vo(e)!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var i=s.call(e,t);if(vo(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function WC(e){var t=ZC(e,"string");return vo(t)=="symbol"?t:t+""}function ek(e,t,s){return(t=WC(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function jv(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),s.push.apply(s,i)}return s}function We(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{};t%2?jv(Object(s),!0).forEach(function(i){ek(e,i,s[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):jv(Object(s)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(s,i))})}return e}const tk=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),nk=()=>Headers,rk=(e,t,s,i,l)=>{const u=tk(i),c=nk(),f=l?.enabled===!0,p=l?.respectSamplingDecision!==!1,g=f?XC(t):null;return async(y,m)=>{var b;const _=(b=await s())!==null&&b!==void 0?b:e;let S=new c(m?.headers);if(S.has("apikey")||S.set("apikey",e),S.has("Authorization")||S.set("Authorization",`Bearer ${_}`),g){const O=await sk(y,g,p);O&&(O.traceparent&&!S.has("traceparent")&&S.set("traceparent",O.traceparent),O.tracestate&&!S.has("tracestate")&&S.set("tracestate",O.tracestate),O.baggage&&!S.has("baggage")&&S.set("baggage",O.baggage))}return u(y,We(We({},m),{},{headers:S}))}};async function sk(e,t,s){if(!QC(typeof e=="string"||e instanceof URL?e:e.url,t))return null;const i=await YC();if(!i||!i.traceparent)return null;if(s){const l=FC(i.traceparent);if(l&&!l.isSampled)return null}return i}function Mv(e){return typeof e=="boolean"?{enabled:e}:e}function ak(e){return e.endsWith("/")?e:e+"/"}function ik(e,t){var s,i,l,u,c,f;const{db:p,auth:g,realtime:y,global:m}=e,{db:b,auth:_,realtime:S,global:O}=t,E=Mv(e.tracePropagation),A=Mv(t.tracePropagation),M={db:We(We({},b),p),auth:We(We({},_),g),realtime:We(We({},S),y),storage:{},global:We(We(We({},O),m),{},{headers:We(We({},(s=O?.headers)!==null&&s!==void 0?s:{}),(i=m?.headers)!==null&&i!==void 0?i:{})}),tracePropagation:{enabled:(l=(u=E?.enabled)!==null&&u!==void 0?u:A?.enabled)!==null&&l!==void 0?l:!1,respectSamplingDecision:(c=(f=E?.respectSamplingDecision)!==null&&f!==void 0?f:A?.respectSamplingDecision)!==null&&c!==void 0?c:!0},accessToken:async()=>""};return e.accessToken?M.accessToken=e.accessToken:delete M.accessToken,M}function ok(e){const t=e?.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(ak(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var lk=class extends UC{constructor(e){super(e)}},uk=class{constructor(e,t,s){var i,l;this.supabaseUrl=e,this.supabaseKey=t;const u=ok(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",u),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",u),this.storageUrl=new URL("storage/v1",u),this.functionsUrl=new URL("functions/v1",u);const c=`sb-${u.hostname.split(".")[0]}-auth-token`,f={db:HC,realtime:qC,auth:We(We({},IC),{},{storageKey:c}),global:BC,tracePropagation:$C},p=ik(s??{},f);if(this.settings=p,this.storageKey=(i=p.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(l=p.global.headers)!==null&&l!==void 0?l:{},p.accessToken)this.accessToken=p.accessToken,this.auth=new Proxy({},{get:(y,m)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(m)} is not possible`)}});else{var g;this.auth=this._initSupabaseAuthClient((g=p.auth)!==null&&g!==void 0?g:{},this.headers,p.global.fetch)}this.fetch=rk(t,e,this._getAccessToken.bind(this),p.global.fetch,p.tracePropagation),this.realtime=this._initRealtimeClient(We({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},p.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(y=>this.realtime.setAuth(y)).catch(y=>console.warn("Failed to set initial Realtime auth token:",y)),this.rest=new RO(new URL("rest/v1",u).href,{headers:this.headers,schema:p.db.schema,fetch:this.fetch,timeout:p.db.timeout,urlLengthLimit:p.db.urlLengthLimit}),this.storage=new Px(this.storageUrl.href,this.headers,this.fetch,s?.storage),p.accessToken||this._listenForAuthEvents()}get functions(){return new gO(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={},s={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,s)}channel(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=this,t,s;if(e.accessToken)return await e.accessToken();const{data:i}=await e.auth.getSession();return(t=(s=i.session)===null||s===void 0?void 0:s.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:i,userStorage:l,storageKey:u,flowType:c,lock:f,debug:p,throwOnError:g,experimental:y,lockAcquireTimeout:m,skipAutoInitialize:b},_,S){const O={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new lk({url:this.authUrl.href,headers:We(We({},O),_),storageKey:u,autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:i,userStorage:l,flowType:c,lock:f,debug:p,throwOnError:g,experimental:y,fetch:S,lockAcquireTimeout:m,skipAutoInitialize:b,hasCustomAuthorizationHeader:Object.keys(this.headers).some(E=>E.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new ox(this.realtimeUrl.href,We(We({},e),{},{params:We(We({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t?.access_token)})}_handleTokenChanged(e,t,s){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==s?(this.changedAccessToken=s,this.realtime.setAuth(s)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const ck=(e,t,s)=>new uk(e,t,s);function hk(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const s=t.match(/^v(\d+)\./);return s?parseInt(s[1],10)<=18:!1}hk()&&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");function fk(){return ck("https://luktxkztrycvqenykcqi.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imx1a3R4a3p0cnljdnFlbnlrY3FpIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzkyNjU0NTIsImV4cCI6MjA5NDg0MTQ1Mn0.iALewhOvY8glEnTpEK6nQ52kHWFuOjy1yIkTvEkF-4c",{auth:{storage:typeof window<"u"?localStorage:void 0,persistSession:!0,autoRefreshToken:!0}})}let df;const Bs=new Proxy({},{get(e,t,s){return df||(df=fk()),Reflect.get(df,t,s)}});function dk(){const[e,t]=ne.useState(null),[s,i]=ne.useState(!0);return ne.useEffect(()=>{const{data:{subscription:l}}=Bs.auth.onAuthStateChange((u,c)=>{t(c),i(!1)});return Bs.auth.getSession().then(({data:u})=>{t(u.session),i(!1)}),()=>l.unsubscribe()},[]),{session:e,user:e?.user??null,loading:s}}function pk(){const{user:e}=dk(),t=tb(),s=ne.useRef(new Set);return ne.useEffect(()=>{if(!e)return;let i=!1;async function l(){const{data:f}=await Bs.from("videos").select("id").eq("user_id",e.id);i||(s.current=new Set((f??[]).map(p=>p.id)))}l();async function u(f){const{data:p}=await Bs.from("profiles").select("display_name,username").eq("id",f).maybeSingle();return p?.display_name||p?.username||"מישהו"}const c=Bs.channel(`notif-${e.id}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"messages",filter:`recipient_id=eq.${e.id}`},async f=>{const p=f.new,g=await u(p.sender_id);of(`💬 ${g}`,{description:p.content?.slice(0,80),action:{label:"פתח",onClick:()=>window.location.href=`/chat/${p.sender_id}`}}),t.invalidateQueries({queryKey:["messages"]}),t.invalidateQueries({queryKey:["chat-list"]})}).on("postgres_changes",{event:"INSERT",schema:"public",table:"comments"},async f=>{const p=f.new;if(p.user_id===e.id||!s.current.has(p.video_id))return;const g=await u(p.user_id);of(`💭 ${g} הגיב/ה`,{description:p.content?.slice(0,80)}),t.invalidateQueries({queryKey:["comments"]})}).on("postgres_changes",{event:"INSERT",schema:"public",table:"likes"},async f=>{const p=f.new;if(p.user_id===e.id||!s.current.has(p.video_id))return;const g=await u(p.user_id);of(`❤️ ${g} אהב/ה את הסרטון שלך`),t.invalidateQueries({queryKey:["feed"]})}).on("postgres_changes",{event:"INSERT",schema:"public",table:"videos",filter:`user_id=eq.${e.id}`},f=>{s.current.add(f.new.id)}).subscribe();return()=>{i=!0,Bs.removeChannel(c)}},[e,t]),null}const gk="/assets/styles-Bc2Ve3LQ.css";function mk(){return J.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4",children:J.jsxs("div",{className:"max-w-md text-center",children:[J.jsx("h1",{className:"text-7xl font-bold brand-gradient",children:"404"}),J.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"העמוד לא נמצא"}),J.jsx(Xf,{to:"/",className:"mt-6 inline-flex rounded-full bg-primary px-6 py-2 text-sm font-semibold text-primary-foreground neon-glow",children:"חזרה"})]})})}function yk({error:e,reset:t}){const s=vt();return console.error(e),J.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4",children:J.jsxs("div",{className:"max-w-md text-center",children:[J.jsx("h1",{className:"text-xl font-semibold",children:"משהו השתבש"}),J.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:e.message}),J.jsx("button",{onClick:()=>{s.invalidate(),t()},className:"mt-6 rounded-full bg-primary px-6 py-2 text-sm font-semibold text-primary-foreground",children:"נסה שוב"})]})})}const So=PR()({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1, viewport-fit=cover"},{title:"טיקנוב"},{name:"description",content:"אפליקציית סרטונים אנכיים עם פילטרים, חברים וצ'אט."},{name:"theme-color",content:"#0a0a0a"},{property:"og:title",content:"טיקנוב"},{name:"twitter:title",content:"טיקנוב"},{property:"og:description",content:"אפליקציית סרטונים אנכיים עם פילטרים, חברים וצ'אט."},{name:"twitter:description",content:"אפליקציית סרטונים אנכיים עם פילטרים, חברים וצ'אט."},{property:"og:image",content:"https://pub-bb2e103a32db4e198524a2e9ed8f35b4.r2.dev/85402009-131e-43ec-b5e5-380f8c109456/id-preview-420f543e--01bee5f8-205c-4007-8211-51555e42e933.lovable.app-1779275668619.png"},{name:"twitter:image",content:"https://pub-bb2e103a32db4e198524a2e9ed8f35b4.r2.dev/85402009-131e-43ec-b5e5-380f8c109456/id-preview-420f543e--01bee5f8-205c-4007-8211-51555e42e933.lovable.app-1779275668619.png"},{name:"twitter:card",content:"summary_large_image"},{property:"og:type",content:"website"}],links:[{rel:"stylesheet",href:gk}]}),shellComponent:vk,component:_k,notFoundComponent:mk,errorComponent:yk});function vk({children:e}){return J.jsxs("html",{lang:"he",dir:"rtl",className:"dark",children:[J.jsx("head",{children:J.jsx(aA,{})}),J.jsxs("body",{children:[e,J.jsx(iA,{})]})]})}function bk(){const e=vt(),t=tb();return ne.useEffect(()=>{const{data:{subscription:s}}=Bs.auth.onAuthStateChange(()=>{e.invalidate(),t.invalidateQueries()});return()=>s.unsubscribe()},[e,t]),null}function _k(){const{queryClient:e}=So.useRouteContext();return J.jsxs(PA,{client:e,children:[J.jsx(bk,{}),J.jsx(pk,{}),J.jsx(V0,{}),J.jsx(hO,{theme:"dark",position:"top-center",richColors:!0})]})}const wk="modulepreload",Sk=function(e){return"/"+e},Nv={},En=function(t,s,i){let l=Promise.resolve();if(s&&s.length>0){let p=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=c?.nonce||c?.getAttribute("nonce");l=p(s.map(g=>{if(g=Sk(g),g in Nv)return;Nv[g]=!0;const y=g.endsWith(".css"),m=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${m}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":wk,y||(b.as="script"),b.crossOrigin="",b.href=g,f&&b.setAttribute("nonce",f),document.head.appendChild(b),y)return new Promise((_,S)=>{b.addEventListener("load",_),b.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${g}`)))})}))}function u(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return l.then(c=>{for(const f of c||[])f.status==="rejected"&&u(f.reason);return t().catch(u)})},Ek=()=>En(()=>import("./auth-DVfP9GnI.js"),__vite__mapDeps([0,1,2])),Tk=wn("/auth")({component:Sn(Ek,"component"),head:()=>({meta:[{title:"התחברות — טיקנוב"}]})}),Rk=()=>En(()=>import("./_authenticated-BX_oPto8.js"),__vite__mapDeps([3,4,2,5,6])),Ak=wn("/_authenticated")({component:Sn(Rk,"component")}),Ok=()=>En(()=>import("./index-BnSZ-4zt.js"),__vite__mapDeps([7,1,2,5,6])),xk=wn("/")({component:Sn(Ok,"component")}),Ck=()=>En(()=>import("./upload-BV464Zzd.js"),__vite__mapDeps([8,9,2,10,1])),kk=wn("/_authenticated/upload")({component:Sn(Ck,"component"),head:()=>({meta:[{title:"צילום והעלאה — טיקנוב"}]})}),jk=()=>En(()=>import("./profile-BRD39yzl.js"),__vite__mapDeps([11,12,9,2,13])),Mk=wn("/_authenticated/profile")({component:Sn(jk,"component"),head:()=>({meta:[{title:"פרופיל — טיקנוב"}]})}),Nk=()=>En(()=>import("./friends-B8l9PETy.js"),__vite__mapDeps([14,12,6,2,10,15,16,17])),Dk=wn("/_authenticated/friends")({component:Sn(Nk,"component"),head:()=>({meta:[{title:"חברים — טיקנוב"}]})});function b2({profile:e,size:t=44}){return e?.avatar_url?J.jsx("img",{src:e.avatar_url,alt:"",className:"rounded-full object-cover shrink-0",style:{height:t,width:t}}):J.jsx("div",{className:"rounded-full flex items-center justify-center font-bold text-white shrink-0",style:{height:t,width:t,background:"var(--gradient-primary)"},children:(e?.display_name??"?")[0]?.toUpperCase()})}const Lk=()=>En(()=>import("./feed-D1YH368C.js"),__vite__mapDeps([18,12,9,1,2,16,19,17,6])),Uk=wn("/_authenticated/feed")({component:Sn(Lk,"component"),head:()=>({meta:[{title:"פיד — טיקנוב"}]})}),zk=()=>En(()=>import("./chat-Cn85NLsy.js"),__vite__mapDeps([20,4,2,12,9,10,21,6,5])),Pk=wn("/_authenticated/chat")({component:Sn(zk,"component"),head:()=>({meta:[{title:"צ'אט — טיקנוב"}]})}),Bk=()=>En(()=>import("./u._userId-DkoTSOwh.js"),__vite__mapDeps([22,12,9,23,2,19,17,15,6,13])),Hk=wn("/_authenticated/u/$userId")({component:Sn(Bk,"component"),head:()=>({meta:[{title:"פרופיל — טיקנוב"}]})}),Ik=()=>En(()=>import("./group.new-ACqkNTFN.js"),__vite__mapDeps([24,12,23,2,15])),qk=wn("/_authenticated/group/new")({component:Sn(Ik,"component"),head:()=>({meta:[{title:"קבוצה חדשה — טיקנוב"}]})}),$k=()=>En(()=>import("./group._groupId-BGUrylxb.js"),__vite__mapDeps([25,12,23,2,5,26])),Vk=wn("/_authenticated/group/$groupId")({component:Sn($k,"component"),head:()=>({meta:[{title:"קבוצה — טיקנוב"}]})}),Gk=()=>En(()=>import("./chat._friendId-CaTSA_We.js"),__vite__mapDeps([27,12,21,2,23,26])),Kk=wn("/_authenticated/chat/$friendId")({component:Sn(Gk,"component"),head:()=>({meta:[{title:"שיחה — טיקנוב"}]})}),Yk=Tk.update({id:"/auth",path:"/auth",getParentRoute:()=>So}),Sr=Ak.update({id:"/_authenticated",getParentRoute:()=>So}),Fk=xk.update({id:"/",path:"/",getParentRoute:()=>So}),Qk=kk.update({id:"/upload",path:"/upload",getParentRoute:()=>Sr}),Jk=Mk.update({id:"/profile",path:"/profile",getParentRoute:()=>Sr}),Xk=Dk.update({id:"/friends",path:"/friends",getParentRoute:()=>Sr}),Zk=Uk.update({id:"/feed",path:"/feed",getParentRoute:()=>Sr}),Tb=Pk.update({id:"/chat",path:"/chat",getParentRoute:()=>Sr}),Wk=Hk.update({id:"/u/$userId",path:"/u/$userId",getParentRoute:()=>Sr}),e2=qk.update({id:"/group/new",path:"/group/new",getParentRoute:()=>Sr}),t2=Vk.update({id:"/group/$groupId",path:"/group/$groupId",getParentRoute:()=>Sr}),n2=Kk.update({id:"/$friendId",path:"/$friendId",getParentRoute:()=>Tb}),r2={AuthenticatedChatFriendIdRoute:n2},s2=Tb._addFileChildren(r2),a2={AuthenticatedChatRoute:s2,AuthenticatedFeedRoute:Zk,AuthenticatedFriendsRoute:Xk,AuthenticatedProfileRoute:Jk,AuthenticatedUploadRoute:Qk,AuthenticatedGroupGroupIdRoute:t2,AuthenticatedGroupNewRoute:e2,AuthenticatedUUserIdRoute:Wk},i2=Sr._addFileChildren(a2),o2={IndexRoute:Fk,AuthenticatedRoute:i2,AuthRoute:Yk},l2=So._addFileChildren(o2),u2=()=>{const e=new zA;return ZR({routeTree:l2,context:{queryClient:e},scrollRestoration:!0,defaultPreloadStaleTime:0})};async function c2(){const e=await u2();let t;if(Vy){const s=await Vy.getOptions();s.serializationAdapters=s.serializationAdapters??[],window.__TSS_START_OPTIONS__=s,t=s.serializationAdapters,e.options.defaultSsr=s.defaultSsr}else t=[],window.__TSS_START_OPTIONS__={serializationAdapters:t};return t.push(nR),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:"",serializationAdapters:t}),e.stores.matchesId.get().length||await sR(e),e}async function h2(){const e=await c2();return window.$_TSR?.h(),e}var pf;function f2(){return pf||(pf=h2()),J.jsx(lR,{promise:pf,children:e=>J.jsx(tA,{router:e})})}ne.startTransition(()=>{Vw.hydrateRoot(document,J.jsx(ne.StrictMode,{children:J.jsx(f2,{})}))});export{b2 as A,Xf as L,V0 as O,Hk as R,Ru as S,dk as a,tb as b,vt as c,ot as d,Ls as e,Vk as f,Kk as g,vA as h,y2 as i,J as j,Tf as k,J0 as l,mA as m,kn as n,yA as o,RA as p,Ef as q,ne as r,Bs as s,of as t,B0 as u,Y0 as v,jA as w,wA as x,Nt as y,v2 as z};
