livedesk 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const h of c)if(h.type==="childList")for(const d of h.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function s(c){const h={};return c.integrity&&(h.integrity=c.integrity),c.referrerPolicy&&(h.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?h.credentials="include":c.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function l(c){if(c.ep)return;c.ep=!0;const h=s(c);fetch(c.href,h)}})();var Hc={exports:{}},hr={};var ig;function Lv(){if(ig)return hr;ig=1;var i=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(l,c,h){var d=null;if(h!==void 0&&(d=""+h),c.key!==void 0&&(d=""+c.key),"key"in c){h={};for(var m in c)m!=="key"&&(h[m]=c[m])}else h=c;return c=h.ref,{$$typeof:i,type:l,key:d,ref:c!==void 0?c:null,props:h}}return hr.Fragment=n,hr.jsx=s,hr.jsxs=s,hr}var sg;function zv(){return sg||(sg=1,Hc.exports=Lv()),Hc.exports}var v=zv(),$c={exports:{}},ce={};var rg;function Mv(){if(rg)return ce;rg=1;var i=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),T=Symbol.iterator;function w(k){return k===null||typeof k!="object"?null:(k=T&&k[T]||k["@@iterator"],typeof k=="function"?k:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,q={};function $(k,L,K){this.props=k,this.context=L,this.refs=q,this.updater=K||R}$.prototype.isReactComponent={},$.prototype.setState=function(k,L){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,L,"setState")},$.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function H(){}H.prototype=$.prototype;function P(k,L,K){this.props=k,this.context=L,this.refs=q,this.updater=K||R}var X=P.prototype=new H;X.constructor=P,D(X,$.prototype),X.isPureReactComponent=!0;var ge=Array.isArray;function ne(){}var J={H:null,A:null,T:null,S:null},Te=Object.prototype.hasOwnProperty;function Ee(k,L,K){var Q=K.ref;return{$$typeof:i,type:k,key:L,ref:Q!==void 0?Q:null,props:K}}function ln(k,L){return Ee(k.type,L,k.props)}function ot(k){return typeof k=="object"&&k!==null&&k.$$typeof===i}function ze(k){var L={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(K){return L[K]})}var ut=/\/+/g;function dt(k,L){return typeof k=="object"&&k!==null&&k.key!=null?ze(""+k.key):L.toString(36)}function Pe(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(ne,ne):(k.status="pending",k.then(function(L){k.status==="pending"&&(k.status="fulfilled",k.value=L)},function(L){k.status==="pending"&&(k.status="rejected",k.reason=L)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function U(k,L,K,Q,ue){var de=typeof k;(de==="undefined"||de==="boolean")&&(k=null);var ke=!1;if(k===null)ke=!0;else switch(de){case"bigint":case"string":case"number":ke=!0;break;case"object":switch(k.$$typeof){case i:case n:ke=!0;break;case _:return ke=k._init,U(ke(k._payload),L,K,Q,ue)}}if(ke)return ue=ue(k),ke=Q===""?"."+dt(k,0):Q,ge(ue)?(K="",ke!=null&&(K=ke.replace(ut,"$&/")+"/"),U(ue,L,K,"",function(Ma){return Ma})):ue!=null&&(ot(ue)&&(ue=ln(ue,K+(ue.key==null||k&&k.key===ue.key?"":(""+ue.key).replace(ut,"$&/")+"/")+ke)),L.push(ue)),1;ke=0;var Ke=Q===""?".":Q+":";if(ge(k))for(var Ie=0;Ie<k.length;Ie++)Q=k[Ie],de=Ke+dt(Q,Ie),ke+=U(Q,L,K,de,ue);else if(Ie=w(k),typeof Ie=="function")for(k=Ie.call(k),Ie=0;!(Q=k.next()).done;)Q=Q.value,de=Ke+dt(Q,Ie++),ke+=U(Q,L,K,de,ue);else if(de==="object"){if(typeof k.then=="function")return U(Pe(k),L,K,Q,ue);throw L=String(k),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return ke}function V(k,L,K){if(k==null)return k;var Q=[],ue=0;return U(k,Q,"","",function(de){return L.call(K,de,ue++)}),Q}function te(k){if(k._status===-1){var L=k._result;L=L(),L.then(function(K){(k._status===0||k._status===-1)&&(k._status=1,k._result=K)},function(K){(k._status===0||k._status===-1)&&(k._status=2,k._result=K)}),k._status===-1&&(k._status=0,k._result=L)}if(k._status===1)return k._result.default;throw k._result}var W=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},Se={map:V,forEach:function(k,L,K){V(k,function(){L.apply(this,arguments)},K)},count:function(k){var L=0;return V(k,function(){L++}),L},toArray:function(k){return V(k,function(L){return L})||[]},only:function(k){if(!ot(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return ce.Activity=b,ce.Children=Se,ce.Component=$,ce.Fragment=s,ce.Profiler=c,ce.PureComponent=P,ce.StrictMode=l,ce.Suspense=g,ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=J,ce.__COMPILER_RUNTIME={__proto__:null,c:function(k){return J.H.useMemoCache(k)}},ce.cache=function(k){return function(){return k.apply(null,arguments)}},ce.cacheSignal=function(){return null},ce.cloneElement=function(k,L,K){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var Q=D({},k.props),ue=k.key;if(L!=null)for(de in L.key!==void 0&&(ue=""+L.key),L)!Te.call(L,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&L.ref===void 0||(Q[de]=L[de]);var de=arguments.length-2;if(de===1)Q.children=K;else if(1<de){for(var ke=Array(de),Ke=0;Ke<de;Ke++)ke[Ke]=arguments[Ke+2];Q.children=ke}return Ee(k.type,ue,Q)},ce.createContext=function(k){return k={$$typeof:d,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:h,_context:k},k},ce.createElement=function(k,L,K){var Q,ue={},de=null;if(L!=null)for(Q in L.key!==void 0&&(de=""+L.key),L)Te.call(L,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(ue[Q]=L[Q]);var ke=arguments.length-2;if(ke===1)ue.children=K;else if(1<ke){for(var Ke=Array(ke),Ie=0;Ie<ke;Ie++)Ke[Ie]=arguments[Ie+2];ue.children=Ke}if(k&&k.defaultProps)for(Q in ke=k.defaultProps,ke)ue[Q]===void 0&&(ue[Q]=ke[Q]);return Ee(k,de,ue)},ce.createRef=function(){return{current:null}},ce.forwardRef=function(k){return{$$typeof:m,render:k}},ce.isValidElement=ot,ce.lazy=function(k){return{$$typeof:_,_payload:{_status:-1,_result:k},_init:te}},ce.memo=function(k,L){return{$$typeof:p,type:k,compare:L===void 0?null:L}},ce.startTransition=function(k){var L=J.T,K={};J.T=K;try{var Q=k(),ue=J.S;ue!==null&&ue(K,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(ne,W)}catch(de){W(de)}finally{L!==null&&K.types!==null&&(L.types=K.types),J.T=L}},ce.unstable_useCacheRefresh=function(){return J.H.useCacheRefresh()},ce.use=function(k){return J.H.use(k)},ce.useActionState=function(k,L,K){return J.H.useActionState(k,L,K)},ce.useCallback=function(k,L){return J.H.useCallback(k,L)},ce.useContext=function(k){return J.H.useContext(k)},ce.useDebugValue=function(){},ce.useDeferredValue=function(k,L){return J.H.useDeferredValue(k,L)},ce.useEffect=function(k,L){return J.H.useEffect(k,L)},ce.useEffectEvent=function(k){return J.H.useEffectEvent(k)},ce.useId=function(){return J.H.useId()},ce.useImperativeHandle=function(k,L,K){return J.H.useImperativeHandle(k,L,K)},ce.useInsertionEffect=function(k,L){return J.H.useInsertionEffect(k,L)},ce.useLayoutEffect=function(k,L){return J.H.useLayoutEffect(k,L)},ce.useMemo=function(k,L){return J.H.useMemo(k,L)},ce.useOptimistic=function(k,L){return J.H.useOptimistic(k,L)},ce.useReducer=function(k,L,K){return J.H.useReducer(k,L,K)},ce.useRef=function(k){return J.H.useRef(k)},ce.useState=function(k){return J.H.useState(k)},ce.useSyncExternalStore=function(k,L,K){return J.H.useSyncExternalStore(k,L,K)},ce.useTransition=function(){return J.H.useTransition()},ce.version="19.2.7",ce}var lg;function wh(){return lg||(lg=1,$c.exports=Mv()),$c.exports}var G=wh(),qc={exports:{}},dr={},Pc={exports:{}},Gc={};var og;function Bv(){return og||(og=1,(function(i){function n(U,V){var te=U.length;U.push(V);e:for(;0<te;){var W=te-1>>>1,Se=U[W];if(0<c(Se,V))U[W]=V,U[te]=Se,te=W;else break e}}function s(U){return U.length===0?null:U[0]}function l(U){if(U.length===0)return null;var V=U[0],te=U.pop();if(te!==V){U[0]=te;e:for(var W=0,Se=U.length,k=Se>>>1;W<k;){var L=2*(W+1)-1,K=U[L],Q=L+1,ue=U[Q];if(0>c(K,te))Q<Se&&0>c(ue,K)?(U[W]=ue,U[Q]=te,W=Q):(U[W]=K,U[L]=te,W=L);else if(Q<Se&&0>c(ue,te))U[W]=ue,U[Q]=te,W=Q;else break e}}return V}function c(U,V){var te=U.sortIndex-V.sortIndex;return te!==0?te:U.id-V.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;i.unstable_now=function(){return h.now()}}else{var d=Date,m=d.now();i.unstable_now=function(){return d.now()-m}}var g=[],p=[],_=1,b=null,T=3,w=!1,R=!1,D=!1,q=!1,$=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function X(U){for(var V=s(p);V!==null;){if(V.callback===null)l(p);else if(V.startTime<=U)l(p),V.sortIndex=V.expirationTime,n(g,V);else break;V=s(p)}}function ge(U){if(D=!1,X(U),!R)if(s(g)!==null)R=!0,ne||(ne=!0,ze());else{var V=s(p);V!==null&&Pe(ge,V.startTime-U)}}var ne=!1,J=-1,Te=5,Ee=-1;function ln(){return q?!0:!(i.unstable_now()-Ee<Te)}function ot(){if(q=!1,ne){var U=i.unstable_now();Ee=U;var V=!0;try{e:{R=!1,D&&(D=!1,H(J),J=-1),w=!0;var te=T;try{t:{for(X(U),b=s(g);b!==null&&!(b.expirationTime>U&&ln());){var W=b.callback;if(typeof W=="function"){b.callback=null,T=b.priorityLevel;var Se=W(b.expirationTime<=U);if(U=i.unstable_now(),typeof Se=="function"){b.callback=Se,X(U),V=!0;break t}b===s(g)&&l(g),X(U)}else l(g);b=s(g)}if(b!==null)V=!0;else{var k=s(p);k!==null&&Pe(ge,k.startTime-U),V=!1}}break e}finally{b=null,T=te,w=!1}V=void 0}}finally{V?ze():ne=!1}}}var ze;if(typeof P=="function")ze=function(){P(ot)};else if(typeof MessageChannel<"u"){var ut=new MessageChannel,dt=ut.port2;ut.port1.onmessage=ot,ze=function(){dt.postMessage(null)}}else ze=function(){$(ot,0)};function Pe(U,V){J=$(function(){U(i.unstable_now())},V)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(U){U.callback=null},i.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"):Te=0<U?Math.floor(1e3/U):5},i.unstable_getCurrentPriorityLevel=function(){return T},i.unstable_next=function(U){switch(T){case 1:case 2:case 3:var V=3;break;default:V=T}var te=T;T=V;try{return U()}finally{T=te}},i.unstable_requestPaint=function(){q=!0},i.unstable_runWithPriority=function(U,V){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var te=T;T=U;try{return V()}finally{T=te}},i.unstable_scheduleCallback=function(U,V,te){var W=i.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?W+te:W):te=W,U){case 1:var Se=-1;break;case 2:Se=250;break;case 5:Se=1073741823;break;case 4:Se=1e4;break;default:Se=5e3}return Se=te+Se,U={id:_++,callback:V,priorityLevel:U,startTime:te,expirationTime:Se,sortIndex:-1},te>W?(U.sortIndex=te,n(p,U),s(g)===null&&U===s(p)&&(D?(H(J),J=-1):D=!0,Pe(ge,te-W))):(U.sortIndex=Se,n(g,U),R||w||(R=!0,ne||(ne=!0,ze()))),U},i.unstable_shouldYield=ln,i.unstable_wrapCallback=function(U){var V=T;return function(){var te=T;T=V;try{return U.apply(this,arguments)}finally{T=te}}}})(Gc)),Gc}var ug;function Hv(){return ug||(ug=1,Pc.exports=Bv()),Pc.exports}var Vc={exports:{}},St={};var cg;function $v(){if(cg)return St;cg=1;var i=wh();function n(g){var p="https://react.dev/errors/"+g;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)p+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+g+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var l={d:{f:s,r:function(){throw Error(n(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},c=Symbol.for("react.portal");function h(g,p,_){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:b==null?null:""+b,children:g,containerInfo:p,implementation:_}}var d=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,p){if(g==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return St.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,St.createPortal=function(g,p){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return h(g,p,null,_)},St.flushSync=function(g){var p=d.T,_=l.p;try{if(d.T=null,l.p=2,g)return g()}finally{d.T=p,l.p=_,l.d.f()}},St.preconnect=function(g,p){typeof g=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,l.d.C(g,p))},St.prefetchDNS=function(g){typeof g=="string"&&l.d.D(g)},St.preinit=function(g,p){if(typeof g=="string"&&p&&typeof p.as=="string"){var _=p.as,b=m(_,p.crossOrigin),T=typeof p.integrity=="string"?p.integrity:void 0,w=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;_==="style"?l.d.S(g,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:b,integrity:T,fetchPriority:w}):_==="script"&&l.d.X(g,{crossOrigin:b,integrity:T,fetchPriority:w,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},St.preinitModule=function(g,p){if(typeof g=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var _=m(p.as,p.crossOrigin);l.d.M(g,{crossOrigin:_,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&l.d.M(g)},St.preload=function(g,p){if(typeof g=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var _=p.as,b=m(_,p.crossOrigin);l.d.L(g,_,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},St.preloadModule=function(g,p){if(typeof g=="string")if(p){var _=m(p.as,p.crossOrigin);l.d.m(g,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:_,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else l.d.m(g)},St.requestFormReset=function(g){l.d.r(g)},St.unstable_batchedUpdates=function(g,p){return g(p)},St.useFormState=function(g,p,_){return d.H.useFormState(g,p,_)},St.useFormStatus=function(){return d.H.useHostTransitionStatus()},St.version="19.2.7",St}var hg;function qv(){if(hg)return Vc.exports;hg=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(n){console.error(n)}}return i(),Vc.exports=$v(),Vc.exports}var dg;function Pv(){if(dg)return dr;dg=1;var i=Hv(),n=wh(),s=qv();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function d(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(h(e)!==e)throw Error(l(188))}function p(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(l(188));return t!==e?null:e}for(var a=e,r=t;;){var o=a.return;if(o===null)break;var u=o.alternate;if(u===null){if(r=o.return,r!==null){a=r;continue}break}if(o.child===u.child){for(u=o.child;u;){if(u===a)return g(o),e;if(u===r)return g(o),t;u=u.sibling}throw Error(l(188))}if(a.return!==r.return)a=o,r=u;else{for(var f=!1,y=o.child;y;){if(y===a){f=!0,a=o,r=u;break}if(y===r){f=!0,r=o,a=u;break}y=y.sibling}if(!f){for(y=u.child;y;){if(y===a){f=!0,a=u,r=o;break}if(y===r){f=!0,r=u,a=o;break}y=y.sibling}if(!f)throw Error(l(189))}}if(a.alternate!==r)throw Error(l(190))}if(a.tag!==3)throw Error(l(188));return a.stateNode.current===a?e:t}function _(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,T=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),P=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),ge=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),Te=Symbol.for("react.lazy"),Ee=Symbol.for("react.activity"),ln=Symbol.for("react.memo_cache_sentinel"),ot=Symbol.iterator;function ze(e){return e===null||typeof e!="object"?null:(e=ot&&e[ot]||e["@@iterator"],typeof e=="function"?e:null)}var ut=Symbol.for("react.client.reference");function dt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ut?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case D:return"Fragment";case $:return"Profiler";case q:return"StrictMode";case ge:return"Suspense";case ne:return"SuspenseList";case Ee:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case R:return"Portal";case P:return e.displayName||"Context";case H:return(e._context.displayName||"Context")+".Consumer";case X:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case J:return t=e.displayName||null,t!==null?t:dt(e.type)||"Memo";case Te:t=e._payload,e=e._init;try{return dt(e(t))}catch{}}return null}var Pe=Array.isArray,U=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},W=[],Se=-1;function k(e){return{current:e}}function L(e){0>Se||(e.current=W[Se],W[Se]=null,Se--)}function K(e,t){Se++,W[Se]=e.current,e.current=t}var Q=k(null),ue=k(null),de=k(null),ke=k(null);function Ke(e,t){switch(K(de,t),K(ue,e),K(Q,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Cm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Cm(t),e=Rm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(Q),K(Q,e)}function Ie(){L(Q),L(ue),L(de)}function Ma(e){e.memoizedState!==null&&K(ke,e);var t=Q.current,a=Rm(t,e.type);t!==a&&(K(ue,e),K(Q,a))}function hi(e){ue.current===e&&(L(Q),L(ue)),ke.current===e&&(L(ke),lr._currentValue=te)}var sa,Lr;function Jt(e){if(sa===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);sa=t&&t[1]||"",Lr=-1<a.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+sa+e+Lr}var on=!1;function fs(e,t){if(!e||on)return"";on=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var B=function(){throw Error()};if(Object.defineProperty(B.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(B,[])}catch(N){var j=N}Reflect.construct(e,[],B)}else{try{B.call()}catch(N){j=N}e.call(B.prototype)}}else{try{throw Error()}catch(N){j=N}(B=e())&&typeof B.catch=="function"&&B.catch(function(){})}}catch(N){if(N&&j&&typeof N.stack=="string")return[N.stack,j.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=r.DetermineComponentFrameRoot(),f=u[0],y=u[1];if(f&&y){var S=f.split(`
|
|
4
|
-
`),x=y.split(`
|
|
5
|
-
`);for(o=r=0;r<S.length&&!S[r].includes("DetermineComponentFrameRoot");)r++;for(;o<x.length&&!x[o].includes("DetermineComponentFrameRoot");)o++;if(r===S.length||o===x.length)for(r=S.length-1,o=x.length-1;1<=r&&0<=o&&S[r]!==x[o];)o--;for(;1<=r&&0<=o;r--,o--)if(S[r]!==x[o]){if(r!==1||o!==1)do if(r--,o--,0>o||S[r]!==x[o]){var z=`
|
|
6
|
-
`+S[r].replace(" at new "," at ");return e.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",e.displayName)),z}while(1<=r&&0<=o);break}}}finally{on=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Jt(a):""}function ms(e,t){switch(e.tag){case 26:case 27:case 5:return Jt(e.type);case 16:return Jt("Lazy");case 13:return e.child!==t&&t!==null?Jt("Suspense Fallback"):Jt("Suspense");case 19:return Jt("SuspenseList");case 0:case 15:return fs(e.type,!1);case 11:return fs(e.type.render,!1);case 1:return fs(e.type,!0);case 31:return Jt("Activity");default:return""}}function gs(e){try{var t="",a=null;do t+=ms(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
|
|
7
|
-
Error generating stack: `+r.message+`
|
|
8
|
-
`+r.stack}}var Ba=Object.prototype.hasOwnProperty,di=i.unstable_scheduleCallback,Ge=i.unstable_cancelCallback,Ro=i.unstable_shouldYield,Xt=i.unstable_requestPaint,Et=i.unstable_now,zr=i.unstable_getCurrentPriorityLevel,fi=i.unstable_ImmediatePriority,ra=i.unstable_UserBlockingPriority,un=i.unstable_NormalPriority,oe=i.unstable_LowPriority,Bt=i.unstable_IdlePriority,Oo=i.log,ps=i.unstable_setDisableYieldValue,la=null,Oe=null;function kt(e){if(typeof Oo=="function"&&ps(e),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(la,e)}catch{}}var gt=Math.clz32?Math.clz32:Br,mi=Math.log,Mr=Math.LN2;function Br(e){return e>>>=0,e===0?32:31-(mi(e)/Mr|0)|0}var oa=256,gi=262144,Ha=4194304;function wn(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function $a(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var o=0,u=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var y=r&134217727;return y!==0?(r=y&~u,r!==0?o=wn(r):(f&=y,f!==0?o=wn(f):a||(a=y&~e,a!==0&&(o=wn(a))))):(y=r&~u,y!==0?o=wn(y):f!==0?o=wn(f):a||(a=r&~e,a!==0&&(o=wn(a)))),o===0?0:t!==0&&t!==o&&(t&u)===0&&(u=o&-o,a=t&-t,u>=a||u===32&&(a&4194048)!==0)?t:o}function ua(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ys(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 vs(){var e=Ha;return Ha<<=1,(Ha&62914560)===0&&(Ha=4194304),e}function bs(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Sn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pi(e,t,a,r,o,u){var f=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var y=e.entanglements,S=e.expirationTimes,x=e.hiddenUpdates;for(a=f&~a;0<a;){var z=31-gt(a),B=1<<z;y[z]=0,S[z]=-1;var j=x[z];if(j!==null)for(x[z]=null,z=0;z<j.length;z++){var N=j[z];N!==null&&(N.lane&=-536870913)}a&=~B}r!==0&&_s(e,r,0),u!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=u&~(f&~t))}function _s(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-gt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function ws(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-gt(a),o=1<<r;o&t|e[r]&t&&(e[r]|=t),a&=~o}}function ca(e,t){var a=t&-t;return a=(a&42)!==0?1:yi(a),(a&(e.suspendedLanes|t))!==0?0:a}function yi(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Dn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ss(){var e=V.p;return e!==0?e:(e=window.event,e===void 0?32:Zm(e.type))}function Hr(e,t){var a=V.p;try{return V.p=e,t()}finally{V.p=a}}var cn=Math.random().toString(36).slice(2),ct="__reactFiber$"+cn,_t="__reactProps$"+cn,Un="__reactContainer$"+cn,hn="__reactEvents$"+cn,xo="__reactListeners$"+cn,jo="__reactHandles$"+cn,Ts="__reactResources$"+cn,ha="__reactMarker$"+cn;function vi(e){delete e[ct],delete e[_t],delete e[hn],delete e[xo],delete e[jo]}function Ln(e){var t=e[ct];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Un]||a[ct]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Lm(e);e!==null;){if(a=e[ct])return a;e=Lm(e)}return t}e=a,a=e.parentNode}return null}function zn(e){if(e=e[ct]||e[Un]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function qa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function dn(e){var t=e[Ts];return t||(t=e[Ts]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function nt(e){e[ha]=!0}var $r=new Set,wt={};function Qt(e,t){Tn(e,t),Tn(e+"Capture",t)}function Tn(e,t){for(wt[e]=t,e=0;e<t.length;e++)$r.add(t[e])}var No=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]*$"),Do={},qr={};function Uo(e){return Ba.call(qr,e)?!0:Ba.call(Do,e)?!1:No.test(e)?qr[e]=!0:(Do[e]=!0,!1)}function Pa(e,t,a){if(Uo(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Ga(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Ht(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function Rt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Pr(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function A(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,u=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(f){a=""+f,u.call(this,f)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(f){a=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function I(e){if(!e._valueTracker){var t=Pr(e)?"checked":"value";e._valueTracker=A(e,t,""+e[t])}}function ae(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=Pr(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function he(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ve=/[\n"\\]/g;function se(e){return e.replace(ve,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ne(e,t,a,r,o,u,f,y){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Rt(t)):e.value!==""+Rt(t)&&(e.value=""+Rt(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?Je(e,f,Rt(t)):a!=null?Je(e,f,Rt(a)):r!=null&&e.removeAttribute("value"),o==null&&u!=null&&(e.defaultChecked=!!u),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.name=""+Rt(y):e.removeAttribute("name")}function Ot(e,t,a,r,o,u,f,y){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){I(e);return}a=a!=null?""+Rt(a):"",t=t!=null?""+Rt(t):a,y||t===e.value||(e.value=t),e.defaultValue=t}r=r??o,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=y?e.checked:!!r,e.defaultChecked=!!r,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),I(e)}function Je(e,t,a){t==="number"&&he(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Fe(e,t,a,r){if(e=e.options,t){t={};for(var o=0;o<a.length;o++)t["$"+a[o]]=!0;for(a=0;a<e.length;a++)o=t.hasOwnProperty("$"+e[a].value),e[a].selected!==o&&(e[a].selected=o),o&&r&&(e[a].defaultSelected=!0)}else{for(a=""+Rt(a),t=null,o=0;o<e.length;o++){if(e[o].value===a){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Gr(e,t,a){if(t!=null&&(t=""+Rt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Rt(a):""}function Vr(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(l(92));if(Pe(r)){if(1<r.length)throw Error(l(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=Rt(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),I(e)}function En(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Kr=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 bi(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||Kr.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Eh(e,t,a){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var o in t)r=t[o],t.hasOwnProperty(o)&&a[o]!==r&&bi(e,o,r)}else for(var u in t)t.hasOwnProperty(u)&&bi(e,u,t[u])}function Lo(e){if(e.indexOf("-")===-1)return!1;switch(e){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 jp=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"]]),Np=/^[\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 Ir(e){return Np.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Mn(){}var zo=null;function Mo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _i=null,wi=null;function kh(e){var t=zn(e);if(t&&(e=t.stateNode)){var a=e[_t]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ne(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+se(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var o=r[_t]||null;if(!o)throw Error(l(90));Ne(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&ae(r)}break e;case"textarea":Gr(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Fe(e,!!a.multiple,t,!1)}}}var Bo=!1;function Ah(e,t,a){if(Bo)return e(t,a);Bo=!0;try{var r=e(t);return r}finally{if(Bo=!1,(_i!==null||wi!==null)&&(Dl(),_i&&(t=_i,e=wi,wi=_i=null,kh(t),e)))for(t=0;t<e.length;t++)kh(e[t])}}function Es(e,t){var a=e.stateNode;if(a===null)return null;var r=a[_t]||null;if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(l(231,t,typeof a));return a}var Bn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ho=!1;if(Bn)try{var ks={};Object.defineProperty(ks,"passive",{get:function(){Ho=!0}}),window.addEventListener("test",ks,ks),window.removeEventListener("test",ks,ks)}catch{Ho=!1}var da=null,$o=null,Yr=null;function Ch(){if(Yr)return Yr;var e,t=$o,a=t.length,r,o="value"in da?da.value:da.textContent,u=o.length;for(e=0;e<a&&t[e]===o[e];e++);var f=a-e;for(r=1;r<=f&&t[a-r]===o[u-r];r++);return Yr=o.slice(e,1<r?1-r:void 0)}function Jr(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Xr(){return!0}function Rh(){return!1}function xt(e){function t(a,r,o,u,f){this._reactName=a,this._targetInst=o,this.type=r,this.nativeEvent=u,this.target=f,this.currentTarget=null;for(var y in e)e.hasOwnProperty(y)&&(a=e[y],this[y]=a?a(u):u[y]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Xr:Rh,this.isPropagationStopped=Rh,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Xr)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Xr)},persist:function(){},isPersistent:Xr}),t}var Va={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qr=xt(Va),As=b({},Va,{view:0,detail:0}),Dp=xt(As),qo,Po,Cs,Zr=b({},As,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vo,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Cs&&(Cs&&e.type==="mousemove"?(qo=e.screenX-Cs.screenX,Po=e.screenY-Cs.screenY):Po=qo=0,Cs=e),qo)},movementY:function(e){return"movementY"in e?e.movementY:Po}}),Oh=xt(Zr),Up=b({},Zr,{dataTransfer:0}),Lp=xt(Up),zp=b({},As,{relatedTarget:0}),Go=xt(zp),Mp=b({},Va,{animationName:0,elapsedTime:0,pseudoElement:0}),Bp=xt(Mp),Hp=b({},Va,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$p=xt(Hp),qp=b({},Va,{data:0}),xh=xt(qp),Pp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gp={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"},Vp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vp[e])?!!t[e]:!1}function Vo(){return Kp}var Ip=b({},As,{key:function(e){if(e.key){var t=Pp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Jr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Gp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vo,charCode:function(e){return e.type==="keypress"?Jr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Jr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Yp=xt(Ip),Jp=b({},Zr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jh=xt(Jp),Xp=b({},As,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vo}),Qp=xt(Xp),Zp=b({},Va,{propertyName:0,elapsedTime:0,pseudoElement:0}),Fp=xt(Zp),Wp=b({},Zr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ey=xt(Wp),ty=b({},Va,{newState:0,oldState:0}),ny=xt(ty),ay=[9,13,27,32],Ko=Bn&&"CompositionEvent"in window,Rs=null;Bn&&"documentMode"in document&&(Rs=document.documentMode);var iy=Bn&&"TextEvent"in window&&!Rs,Nh=Bn&&(!Ko||Rs&&8<Rs&&11>=Rs),Dh=" ",Uh=!1;function Lh(e,t){switch(e){case"keyup":return ay.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Si=!1;function sy(e,t){switch(e){case"compositionend":return zh(t);case"keypress":return t.which!==32?null:(Uh=!0,Dh);case"textInput":return e=t.data,e===Dh&&Uh?null:e;default:return null}}function ry(e,t){if(Si)return e==="compositionend"||!Ko&&Lh(e,t)?(e=Ch(),Yr=$o=da=null,Si=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Nh&&t.locale!=="ko"?null:t.data;default:return null}}var ly={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 Mh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ly[e.type]:t==="textarea"}function Bh(e,t,a,r){_i?wi?wi.push(r):wi=[r]:_i=r,t=$l(t,"onChange"),0<t.length&&(a=new Qr("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var Os=null,xs=null;function oy(e){wm(e,0)}function Fr(e){var t=qa(e);if(ae(t))return e}function Hh(e,t){if(e==="change")return t}var $h=!1;if(Bn){var Io;if(Bn){var Yo="oninput"in document;if(!Yo){var qh=document.createElement("div");qh.setAttribute("oninput","return;"),Yo=typeof qh.oninput=="function"}Io=Yo}else Io=!1;$h=Io&&(!document.documentMode||9<document.documentMode)}function Ph(){Os&&(Os.detachEvent("onpropertychange",Gh),xs=Os=null)}function Gh(e){if(e.propertyName==="value"&&Fr(xs)){var t=[];Bh(t,xs,e,Mo(e)),Ah(oy,t)}}function uy(e,t,a){e==="focusin"?(Ph(),Os=t,xs=a,Os.attachEvent("onpropertychange",Gh)):e==="focusout"&&Ph()}function cy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Fr(xs)}function hy(e,t){if(e==="click")return Fr(t)}function dy(e,t){if(e==="input"||e==="change")return Fr(t)}function fy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $t=typeof Object.is=="function"?Object.is:fy;function js(e,t){if($t(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var o=a[r];if(!Ba.call(t,o)||!$t(e[o],t[o]))return!1}return!0}function Vh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kh(e,t){var a=Vh(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Vh(a)}}function Ih(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ih(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=he(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=he(e.document)}return t}function Jo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var my=Bn&&"documentMode"in document&&11>=document.documentMode,Ti=null,Xo=null,Ns=null,Qo=!1;function Jh(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Qo||Ti==null||Ti!==he(r)||(r=Ti,"selectionStart"in r&&Jo(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ns&&js(Ns,r)||(Ns=r,r=$l(Xo,"onSelect"),0<r.length&&(t=new Qr("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Ti)))}function Ka(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Ei={animationend:Ka("Animation","AnimationEnd"),animationiteration:Ka("Animation","AnimationIteration"),animationstart:Ka("Animation","AnimationStart"),transitionrun:Ka("Transition","TransitionRun"),transitionstart:Ka("Transition","TransitionStart"),transitioncancel:Ka("Transition","TransitionCancel"),transitionend:Ka("Transition","TransitionEnd")},Zo={},Xh={};Bn&&(Xh=document.createElement("div").style,"AnimationEvent"in window||(delete Ei.animationend.animation,delete Ei.animationiteration.animation,delete Ei.animationstart.animation),"TransitionEvent"in window||delete Ei.transitionend.transition);function Ia(e){if(Zo[e])return Zo[e];if(!Ei[e])return e;var t=Ei[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Xh)return Zo[e]=t[a];return e}var Qh=Ia("animationend"),Zh=Ia("animationiteration"),Fh=Ia("animationstart"),gy=Ia("transitionrun"),py=Ia("transitionstart"),yy=Ia("transitioncancel"),Wh=Ia("transitionend"),ed=new Map,Fo="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(" ");Fo.push("scrollEnd");function fn(e,t){ed.set(e,t),Qt(t,[e])}var Wr=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Zt=[],ki=0,Wo=0;function el(){for(var e=ki,t=Wo=ki=0;t<e;){var a=Zt[t];Zt[t++]=null;var r=Zt[t];Zt[t++]=null;var o=Zt[t];Zt[t++]=null;var u=Zt[t];if(Zt[t++]=null,r!==null&&o!==null){var f=r.pending;f===null?o.next=o:(o.next=f.next,f.next=o),r.pending=o}u!==0&&td(a,o,u)}}function tl(e,t,a,r){Zt[ki++]=e,Zt[ki++]=t,Zt[ki++]=a,Zt[ki++]=r,Wo|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function eu(e,t,a,r){return tl(e,t,a,r),nl(e)}function Ya(e,t){return tl(e,null,null,t),nl(e)}function td(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var o=!1,u=e.return;u!==null;)u.childLanes|=a,r=u.alternate,r!==null&&(r.childLanes|=a),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(o=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,o&&t!==null&&(o=31-gt(a),e=u.hiddenUpdates,r=e[o],r===null?e[o]=[t]:r.push(t),t.lane=a|536870912),u):null}function nl(e){if(50<er)throw er=0,uc=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ai={};function vy(e,t,a,r){this.tag=e,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=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qt(e,t,a,r){return new vy(e,t,a,r)}function tu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hn(e,t){var a=e.alternate;return a===null?(a=qt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function nd(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function al(e,t,a,r,o,u){var f=0;if(r=e,typeof e=="function")tu(e)&&(f=1);else if(typeof e=="string")f=Tv(e,a,Q.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Ee:return e=qt(31,a,t,o),e.elementType=Ee,e.lanes=u,e;case D:return Ja(a.children,o,u,t);case q:f=8,o|=24;break;case $:return e=qt(12,a,t,o|2),e.elementType=$,e.lanes=u,e;case ge:return e=qt(13,a,t,o),e.elementType=ge,e.lanes=u,e;case ne:return e=qt(19,a,t,o),e.elementType=ne,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case P:f=10;break e;case H:f=9;break e;case X:f=11;break e;case J:f=14;break e;case Te:f=16,r=null;break e}f=29,a=Error(l(130,e===null?"null":typeof e,"")),r=null}return t=qt(f,a,t,o),t.elementType=e,t.type=r,t.lanes=u,t}function Ja(e,t,a,r){return e=qt(7,e,r,t),e.lanes=a,e}function nu(e,t,a){return e=qt(6,e,null,t),e.lanes=a,e}function ad(e){var t=qt(18,null,null,0);return t.stateNode=e,t}function au(e,t,a){return t=qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var id=new WeakMap;function Ft(e,t){if(typeof e=="object"&&e!==null){var a=id.get(e);return a!==void 0?a:(t={value:e,source:t,stack:gs(t)},id.set(e,t),t)}return{value:e,source:t,stack:gs(t)}}var Ci=[],Ri=0,il=null,Ds=0,Wt=[],en=0,fa=null,kn=1,An="";function $n(e,t){Ci[Ri++]=Ds,Ci[Ri++]=il,il=e,Ds=t}function sd(e,t,a){Wt[en++]=kn,Wt[en++]=An,Wt[en++]=fa,fa=e;var r=kn;e=An;var o=32-gt(r)-1;r&=~(1<<o),a+=1;var u=32-gt(t)+o;if(30<u){var f=o-o%5;u=(r&(1<<f)-1).toString(32),r>>=f,o-=f,kn=1<<32-gt(t)+o|a<<o|r,An=u+e}else kn=1<<u|a<<o|r,An=e}function iu(e){e.return!==null&&($n(e,1),sd(e,1,0))}function su(e){for(;e===il;)il=Ci[--Ri],Ci[Ri]=null,Ds=Ci[--Ri],Ci[Ri]=null;for(;e===fa;)fa=Wt[--en],Wt[en]=null,An=Wt[--en],Wt[en]=null,kn=Wt[--en],Wt[en]=null}function rd(e,t){Wt[en++]=kn,Wt[en++]=An,Wt[en++]=fa,kn=t.id,An=t.overflow,fa=e}var pt=null,$e=null,we=!1,ma=null,tn=!1,ru=Error(l(519));function ga(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Us(Ft(t,e)),ru}function ld(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[ct]=e,t[_t]=r,a){case"dialog":ye("cancel",t),ye("close",t);break;case"iframe":case"object":case"embed":ye("load",t);break;case"video":case"audio":for(a=0;a<nr.length;a++)ye(nr[a],t);break;case"source":ye("error",t);break;case"img":case"image":case"link":ye("error",t),ye("load",t);break;case"details":ye("toggle",t);break;case"input":ye("invalid",t),Ot(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ye("invalid",t);break;case"textarea":ye("invalid",t),Vr(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||km(t.textContent,a)?(r.popover!=null&&(ye("beforetoggle",t),ye("toggle",t)),r.onScroll!=null&&ye("scroll",t),r.onScrollEnd!=null&&ye("scrollend",t),r.onClick!=null&&(t.onclick=Mn),t=!0):t=!1,t||ga(e,!0)}function od(e){for(pt=e.return;pt;)switch(pt.tag){case 5:case 31:case 13:tn=!1;return;case 27:case 3:tn=!0;return;default:pt=pt.return}}function Oi(e){if(e!==pt)return!1;if(!we)return od(e),we=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Ec(e.type,e.memoizedProps)),a=!a),a&&$e&&ga(e),od(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));$e=Um(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));$e=Um(e)}else t===27?(t=$e,Oa(e.type)?(e=Oc,Oc=null,$e=e):$e=t):$e=pt?an(e.stateNode.nextSibling):null;return!0}function Xa(){$e=pt=null,we=!1}function lu(){var e=ma;return e!==null&&(Ut===null?Ut=e:Ut.push.apply(Ut,e),ma=null),e}function Us(e){ma===null?ma=[e]:ma.push(e)}var ou=k(null),Qa=null,qn=null;function pa(e,t,a){K(ou,t._currentValue),t._currentValue=a}function Pn(e){e._currentValue=ou.current,L(ou)}function uu(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function cu(e,t,a,r){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var u=o.dependencies;if(u!==null){var f=o.child;u=u.firstContext;e:for(;u!==null;){var y=u;u=o;for(var S=0;S<t.length;S++)if(y.context===t[S]){u.lanes|=a,y=u.alternate,y!==null&&(y.lanes|=a),uu(u.return,a,e),r||(f=null);break e}u=y.next}}else if(o.tag===18){if(f=o.return,f===null)throw Error(l(341));f.lanes|=a,u=f.alternate,u!==null&&(u.lanes|=a),uu(f,a,e),f=null}else f=o.child;if(f!==null)f.return=o;else for(f=o;f!==null;){if(f===e){f=null;break}if(o=f.sibling,o!==null){o.return=f.return,f=o;break}f=f.return}o=f}}function xi(e,t,a,r){e=null;for(var o=t,u=!1;o!==null;){if(!u){if((o.flags&524288)!==0)u=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var f=o.alternate;if(f===null)throw Error(l(387));if(f=f.memoizedProps,f!==null){var y=o.type;$t(o.pendingProps.value,f.value)||(e!==null?e.push(y):e=[y])}}else if(o===ke.current){if(f=o.alternate,f===null)throw Error(l(387));f.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(lr):e=[lr])}o=o.return}e!==null&&cu(t,e,a,r),t.flags|=262144}function sl(e){for(e=e.firstContext;e!==null;){if(!$t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Za(e){Qa=e,qn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function yt(e){return ud(Qa,e)}function rl(e,t){return Qa===null&&Za(e),ud(e,t)}function ud(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},qn===null){if(e===null)throw Error(l(308));qn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qn=qn.next=t;return a}var by=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},_y=i.unstable_scheduleCallback,wy=i.unstable_NormalPriority,at={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hu(){return{controller:new by,data:new Map,refCount:0}}function Ls(e){e.refCount--,e.refCount===0&&_y(wy,function(){e.controller.abort()})}var zs=null,du=0,ji=0,Ni=null;function Sy(e,t){if(zs===null){var a=zs=[];du=0,ji=gc(),Ni={status:"pending",value:void 0,then:function(r){a.push(r)}}}return du++,t.then(cd,cd),t}function cd(){if(--du===0&&zs!==null){Ni!==null&&(Ni.status="fulfilled");var e=zs;zs=null,ji=0,Ni=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ty(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(o){a.push(o)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var o=0;o<a.length;o++)(0,a[o])(t)},function(o){for(r.status="rejected",r.reason=o,o=0;o<a.length;o++)(0,a[o])(void 0)}),r}var hd=U.S;U.S=function(e,t){Xf=Et(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Sy(e,t),hd!==null&&hd(e,t)};var Fa=k(null);function fu(){var e=Fa.current;return e!==null?e:Me.pooledCache}function ll(e,t){t===null?K(Fa,Fa.current):K(Fa,t.pool)}function dd(){var e=fu();return e===null?null:{parent:at._currentValue,pool:e}}var Di=Error(l(460)),mu=Error(l(474)),ol=Error(l(542)),ul={then:function(){}};function fd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function md(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Mn,Mn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,pd(e),e;default:if(typeof t.status=="string")t.then(Mn,Mn);else{if(e=Me,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=r}},function(r){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,pd(e),e}throw ei=t,Di}}function Wa(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ei=a,Di):a}}var ei=null;function gd(){if(ei===null)throw Error(l(459));var e=ei;return ei=null,e}function pd(e){if(e===Di||e===ol)throw Error(l(483))}var Ui=null,Ms=0;function cl(e){var t=Ms;return Ms+=1,Ui===null&&(Ui=[]),md(Ui,e,t)}function Bs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function hl(e,t){throw t.$$typeof===T?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function yd(e){function t(C,E){if(e){var O=C.deletions;O===null?(C.deletions=[E],C.flags|=16):O.push(E)}}function a(C,E){if(!e)return null;for(;E!==null;)t(C,E),E=E.sibling;return null}function r(C){for(var E=new Map;C!==null;)C.key!==null?E.set(C.key,C):E.set(C.index,C),C=C.sibling;return E}function o(C,E){return C=Hn(C,E),C.index=0,C.sibling=null,C}function u(C,E,O){return C.index=O,e?(O=C.alternate,O!==null?(O=O.index,O<E?(C.flags|=67108866,E):O):(C.flags|=67108866,E)):(C.flags|=1048576,E)}function f(C){return e&&C.alternate===null&&(C.flags|=67108866),C}function y(C,E,O,M){return E===null||E.tag!==6?(E=nu(O,C.mode,M),E.return=C,E):(E=o(E,O),E.return=C,E)}function S(C,E,O,M){var ie=O.type;return ie===D?z(C,E,O.props.children,M,O.key):E!==null&&(E.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===Te&&Wa(ie)===E.type)?(E=o(E,O.props),Bs(E,O),E.return=C,E):(E=al(O.type,O.key,O.props,null,C.mode,M),Bs(E,O),E.return=C,E)}function x(C,E,O,M){return E===null||E.tag!==4||E.stateNode.containerInfo!==O.containerInfo||E.stateNode.implementation!==O.implementation?(E=au(O,C.mode,M),E.return=C,E):(E=o(E,O.children||[]),E.return=C,E)}function z(C,E,O,M,ie){return E===null||E.tag!==7?(E=Ja(O,C.mode,M,ie),E.return=C,E):(E=o(E,O),E.return=C,E)}function B(C,E,O){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=nu(""+E,C.mode,O),E.return=C,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case w:return O=al(E.type,E.key,E.props,null,C.mode,O),Bs(O,E),O.return=C,O;case R:return E=au(E,C.mode,O),E.return=C,E;case Te:return E=Wa(E),B(C,E,O)}if(Pe(E)||ze(E))return E=Ja(E,C.mode,O,null),E.return=C,E;if(typeof E.then=="function")return B(C,cl(E),O);if(E.$$typeof===P)return B(C,rl(C,E),O);hl(C,E)}return null}function j(C,E,O,M){var ie=E!==null?E.key:null;if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return ie!==null?null:y(C,E,""+O,M);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case w:return O.key===ie?S(C,E,O,M):null;case R:return O.key===ie?x(C,E,O,M):null;case Te:return O=Wa(O),j(C,E,O,M)}if(Pe(O)||ze(O))return ie!==null?null:z(C,E,O,M,null);if(typeof O.then=="function")return j(C,E,cl(O),M);if(O.$$typeof===P)return j(C,E,rl(C,O),M);hl(C,O)}return null}function N(C,E,O,M,ie){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return C=C.get(O)||null,y(E,C,""+M,ie);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case w:return C=C.get(M.key===null?O:M.key)||null,S(E,C,M,ie);case R:return C=C.get(M.key===null?O:M.key)||null,x(E,C,M,ie);case Te:return M=Wa(M),N(C,E,O,M,ie)}if(Pe(M)||ze(M))return C=C.get(O)||null,z(E,C,M,ie,null);if(typeof M.then=="function")return N(C,E,O,cl(M),ie);if(M.$$typeof===P)return N(C,E,O,rl(E,M),ie);hl(E,M)}return null}function Z(C,E,O,M){for(var ie=null,Ae=null,ee=E,me=E=0,_e=null;ee!==null&&me<O.length;me++){ee.index>me?(_e=ee,ee=null):_e=ee.sibling;var Ce=j(C,ee,O[me],M);if(Ce===null){ee===null&&(ee=_e);break}e&&ee&&Ce.alternate===null&&t(C,ee),E=u(Ce,E,me),Ae===null?ie=Ce:Ae.sibling=Ce,Ae=Ce,ee=_e}if(me===O.length)return a(C,ee),we&&$n(C,me),ie;if(ee===null){for(;me<O.length;me++)ee=B(C,O[me],M),ee!==null&&(E=u(ee,E,me),Ae===null?ie=ee:Ae.sibling=ee,Ae=ee);return we&&$n(C,me),ie}for(ee=r(ee);me<O.length;me++)_e=N(ee,C,me,O[me],M),_e!==null&&(e&&_e.alternate!==null&&ee.delete(_e.key===null?me:_e.key),E=u(_e,E,me),Ae===null?ie=_e:Ae.sibling=_e,Ae=_e);return e&&ee.forEach(function(Ua){return t(C,Ua)}),we&&$n(C,me),ie}function le(C,E,O,M){if(O==null)throw Error(l(151));for(var ie=null,Ae=null,ee=E,me=E=0,_e=null,Ce=O.next();ee!==null&&!Ce.done;me++,Ce=O.next()){ee.index>me?(_e=ee,ee=null):_e=ee.sibling;var Ua=j(C,ee,Ce.value,M);if(Ua===null){ee===null&&(ee=_e);break}e&&ee&&Ua.alternate===null&&t(C,ee),E=u(Ua,E,me),Ae===null?ie=Ua:Ae.sibling=Ua,Ae=Ua,ee=_e}if(Ce.done)return a(C,ee),we&&$n(C,me),ie;if(ee===null){for(;!Ce.done;me++,Ce=O.next())Ce=B(C,Ce.value,M),Ce!==null&&(E=u(Ce,E,me),Ae===null?ie=Ce:Ae.sibling=Ce,Ae=Ce);return we&&$n(C,me),ie}for(ee=r(ee);!Ce.done;me++,Ce=O.next())Ce=N(ee,C,me,Ce.value,M),Ce!==null&&(e&&Ce.alternate!==null&&ee.delete(Ce.key===null?me:Ce.key),E=u(Ce,E,me),Ae===null?ie=Ce:Ae.sibling=Ce,Ae=Ce);return e&&ee.forEach(function(Uv){return t(C,Uv)}),we&&$n(C,me),ie}function Le(C,E,O,M){if(typeof O=="object"&&O!==null&&O.type===D&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case w:e:{for(var ie=O.key;E!==null;){if(E.key===ie){if(ie=O.type,ie===D){if(E.tag===7){a(C,E.sibling),M=o(E,O.props.children),M.return=C,C=M;break e}}else if(E.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===Te&&Wa(ie)===E.type){a(C,E.sibling),M=o(E,O.props),Bs(M,O),M.return=C,C=M;break e}a(C,E);break}else t(C,E);E=E.sibling}O.type===D?(M=Ja(O.props.children,C.mode,M,O.key),M.return=C,C=M):(M=al(O.type,O.key,O.props,null,C.mode,M),Bs(M,O),M.return=C,C=M)}return f(C);case R:e:{for(ie=O.key;E!==null;){if(E.key===ie)if(E.tag===4&&E.stateNode.containerInfo===O.containerInfo&&E.stateNode.implementation===O.implementation){a(C,E.sibling),M=o(E,O.children||[]),M.return=C,C=M;break e}else{a(C,E);break}else t(C,E);E=E.sibling}M=au(O,C.mode,M),M.return=C,C=M}return f(C);case Te:return O=Wa(O),Le(C,E,O,M)}if(Pe(O))return Z(C,E,O,M);if(ze(O)){if(ie=ze(O),typeof ie!="function")throw Error(l(150));return O=ie.call(O),le(C,E,O,M)}if(typeof O.then=="function")return Le(C,E,cl(O),M);if(O.$$typeof===P)return Le(C,E,rl(C,O),M);hl(C,O)}return typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint"?(O=""+O,E!==null&&E.tag===6?(a(C,E.sibling),M=o(E,O),M.return=C,C=M):(a(C,E),M=nu(O,C.mode,M),M.return=C,C=M),f(C)):a(C,E)}return function(C,E,O,M){try{Ms=0;var ie=Le(C,E,O,M);return Ui=null,ie}catch(ee){if(ee===Di||ee===ol)throw ee;var Ae=qt(29,ee,null,C.mode);return Ae.lanes=M,Ae.return=C,Ae}}}var ti=yd(!0),vd=yd(!1),ya=!1;function gu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ba(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Re&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,t=nl(e),td(e,null,a),t}return tl(e,r,t,a),nl(e)}function Hs(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,ws(e,a)}}function yu(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var o=null,u=null;if(a=a.firstBaseUpdate,a!==null){do{var f={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};u===null?o=u=f:u=u.next=f,a=a.next}while(a!==null);u===null?o=u=t:u=u.next=t}else o=u=t;a={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:u,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var vu=!1;function $s(){if(vu){var e=Ni;if(e!==null)throw e}}function qs(e,t,a,r){vu=!1;var o=e.updateQueue;ya=!1;var u=o.firstBaseUpdate,f=o.lastBaseUpdate,y=o.shared.pending;if(y!==null){o.shared.pending=null;var S=y,x=S.next;S.next=null,f===null?u=x:f.next=x,f=S;var z=e.alternate;z!==null&&(z=z.updateQueue,y=z.lastBaseUpdate,y!==f&&(y===null?z.firstBaseUpdate=x:y.next=x,z.lastBaseUpdate=S))}if(u!==null){var B=o.baseState;f=0,z=x=S=null,y=u;do{var j=y.lane&-536870913,N=j!==y.lane;if(N?(be&j)===j:(r&j)===j){j!==0&&j===ji&&(vu=!0),z!==null&&(z=z.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var Z=e,le=y;j=t;var Le=a;switch(le.tag){case 1:if(Z=le.payload,typeof Z=="function"){B=Z.call(Le,B,j);break e}B=Z;break e;case 3:Z.flags=Z.flags&-65537|128;case 0:if(Z=le.payload,j=typeof Z=="function"?Z.call(Le,B,j):Z,j==null)break e;B=b({},B,j);break e;case 2:ya=!0}}j=y.callback,j!==null&&(e.flags|=64,N&&(e.flags|=8192),N=o.callbacks,N===null?o.callbacks=[j]:N.push(j))}else N={lane:j,tag:y.tag,payload:y.payload,callback:y.callback,next:null},z===null?(x=z=N,S=B):z=z.next=N,f|=j;if(y=y.next,y===null){if(y=o.shared.pending,y===null)break;N=y,y=N.next,N.next=null,o.lastBaseUpdate=N,o.shared.pending=null}}while(!0);z===null&&(S=B),o.baseState=S,o.firstBaseUpdate=x,o.lastBaseUpdate=z,u===null&&(o.shared.lanes=0),Ea|=f,e.lanes=f,e.memoizedState=B}}function bd(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function _d(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)bd(a[e],t)}var Li=k(null),dl=k(0);function wd(e,t){e=Zn,K(dl,e),K(Li,t),Zn=e|t.baseLanes}function bu(){K(dl,Zn),K(Li,Li.current)}function _u(){Zn=dl.current,L(Li),L(dl)}var Pt=k(null),nn=null;function _a(e){var t=e.alternate;K(We,We.current&1),K(Pt,e),nn===null&&(t===null||Li.current!==null||t.memoizedState!==null)&&(nn=e)}function wu(e){K(We,We.current),K(Pt,e),nn===null&&(nn=e)}function Sd(e){e.tag===22?(K(We,We.current),K(Pt,e),nn===null&&(nn=e)):wa()}function wa(){K(We,We.current),K(Pt,Pt.current)}function Gt(e){L(Pt),nn===e&&(nn=null),L(We)}var We=k(0);function fl(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Cc(a)||Rc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Gn=0,fe=null,De=null,it=null,ml=!1,zi=!1,ni=!1,gl=0,Ps=0,Mi=null,Ey=0;function Xe(){throw Error(l(321))}function Su(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!$t(e[a],t[a]))return!1;return!0}function Tu(e,t,a,r,o,u){return Gn=u,fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?rf:Bu,ni=!1,u=a(r,o),ni=!1,zi&&(u=Ed(t,a,r,o)),Td(e),u}function Td(e){U.H=Ks;var t=De!==null&&De.next!==null;if(Gn=0,it=De=fe=null,ml=!1,Ps=0,Mi=null,t)throw Error(l(300));e===null||st||(e=e.dependencies,e!==null&&sl(e)&&(st=!0))}function Ed(e,t,a,r){fe=e;var o=0;do{if(zi&&(Mi=null),Ps=0,zi=!1,25<=o)throw Error(l(301));if(o+=1,it=De=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}U.H=lf,u=t(a,r)}while(zi);return u}function ky(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?Gs(t):t,e=e.useState()[0],(De!==null?De.memoizedState:null)!==e&&(fe.flags|=1024),t}function Eu(){var e=gl!==0;return gl=0,e}function ku(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Au(e){if(ml){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ml=!1}Gn=0,it=De=fe=null,zi=!1,Ps=gl=0,Mi=null}function At(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return it===null?fe.memoizedState=it=e:it=it.next=e,it}function et(){if(De===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=De.next;var t=it===null?fe.memoizedState:it.next;if(t!==null)it=t,De=e;else{if(e===null)throw fe.alternate===null?Error(l(467)):Error(l(310));De=e,e={memoizedState:De.memoizedState,baseState:De.baseState,baseQueue:De.baseQueue,queue:De.queue,next:null},it===null?fe.memoizedState=it=e:it=it.next=e}return it}function pl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Gs(e){var t=Ps;return Ps+=1,Mi===null&&(Mi=[]),e=md(Mi,e,t),t=fe,(it===null?t.memoizedState:it.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?rf:Bu),e}function yl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Gs(e);if(e.$$typeof===P)return yt(e)}throw Error(l(438,String(e)))}function Cu(e){var t=null,a=fe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=fe.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=pl(),fe.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=ln;return t.index++,a}function Vn(e,t){return typeof t=="function"?t(e):t}function vl(e){var t=et();return Ru(t,De,e)}function Ru(e,t,a){var r=e.queue;if(r===null)throw Error(l(311));r.lastRenderedReducer=a;var o=e.baseQueue,u=r.pending;if(u!==null){if(o!==null){var f=o.next;o.next=u.next,u.next=f}t.baseQueue=o=u,r.pending=null}if(u=e.baseState,o===null)e.memoizedState=u;else{t=o.next;var y=f=null,S=null,x=t,z=!1;do{var B=x.lane&-536870913;if(B!==x.lane?(be&B)===B:(Gn&B)===B){var j=x.revertLane;if(j===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:x.action,hasEagerState:x.hasEagerState,eagerState:x.eagerState,next:null}),B===ji&&(z=!0);else if((Gn&j)===j){x=x.next,j===ji&&(z=!0);continue}else B={lane:0,revertLane:x.revertLane,gesture:null,action:x.action,hasEagerState:x.hasEagerState,eagerState:x.eagerState,next:null},S===null?(y=S=B,f=u):S=S.next=B,fe.lanes|=j,Ea|=j;B=x.action,ni&&a(u,B),u=x.hasEagerState?x.eagerState:a(u,B)}else j={lane:B,revertLane:x.revertLane,gesture:x.gesture,action:x.action,hasEagerState:x.hasEagerState,eagerState:x.eagerState,next:null},S===null?(y=S=j,f=u):S=S.next=j,fe.lanes|=B,Ea|=B;x=x.next}while(x!==null&&x!==t);if(S===null?f=u:S.next=y,!$t(u,e.memoizedState)&&(st=!0,z&&(a=Ni,a!==null)))throw a;e.memoizedState=u,e.baseState=f,e.baseQueue=S,r.lastRenderedState=u}return o===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ou(e){var t=et(),a=t.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=e;var r=a.dispatch,o=a.pending,u=t.memoizedState;if(o!==null){a.pending=null;var f=o=o.next;do u=e(u,f.action),f=f.next;while(f!==o);$t(u,t.memoizedState)||(st=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),a.lastRenderedState=u}return[u,r]}function kd(e,t,a){var r=fe,o=et(),u=we;if(u){if(a===void 0)throw Error(l(407));a=a()}else a=t();var f=!$t((De||o).memoizedState,a);if(f&&(o.memoizedState=a,st=!0),o=o.queue,Nu(Rd.bind(null,r,o,e),[e]),o.getSnapshot!==t||f||it!==null&&it.memoizedState.tag&1){if(r.flags|=2048,Bi(9,{destroy:void 0},Cd.bind(null,r,o,a,t),null),Me===null)throw Error(l(349));u||(Gn&127)!==0||Ad(r,t,a)}return a}function Ad(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=fe.updateQueue,t===null?(t=pl(),fe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Cd(e,t,a,r){t.value=a,t.getSnapshot=r,Od(t)&&xd(e)}function Rd(e,t,a){return a(function(){Od(t)&&xd(e)})}function Od(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!$t(e,a)}catch{return!0}}function xd(e){var t=Ya(e,2);t!==null&&Lt(t,e,2)}function xu(e){var t=At();if(typeof e=="function"){var a=e;if(e=a(),ni){kt(!0);try{a()}finally{kt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:e},t}function jd(e,t,a,r){return e.baseState=a,Ru(e,De,typeof r=="function"?r:Vn)}function Ay(e,t,a,r,o){if(wl(e))throw Error(l(485));if(e=t.action,e!==null){var u={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){u.listeners.push(f)}};U.T!==null?a(!0):u.isTransition=!1,r(u),a=t.pending,a===null?(u.next=t.pending=u,Nd(t,u)):(u.next=a.next,t.pending=a.next=u)}}function Nd(e,t){var a=t.action,r=t.payload,o=e.state;if(t.isTransition){var u=U.T,f={};U.T=f;try{var y=a(o,r),S=U.S;S!==null&&S(f,y),Dd(e,t,y)}catch(x){ju(e,t,x)}finally{u!==null&&f.types!==null&&(u.types=f.types),U.T=u}}else try{u=a(o,r),Dd(e,t,u)}catch(x){ju(e,t,x)}}function Dd(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){Ud(e,t,r)},function(r){return ju(e,t,r)}):Ud(e,t,a)}function Ud(e,t,a){t.status="fulfilled",t.value=a,Ld(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Nd(e,a)))}function ju(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,Ld(t),t=t.next;while(t!==r)}e.action=null}function Ld(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function zd(e,t){return t}function Md(e,t){if(we){var a=Me.formState;if(a!==null){e:{var r=fe;if(we){if($e){t:{for(var o=$e,u=tn;o.nodeType!==8;){if(!u){o=null;break t}if(o=an(o.nextSibling),o===null){o=null;break t}}u=o.data,o=u==="F!"||u==="F"?o:null}if(o){$e=an(o.nextSibling),r=o.data==="F!";break e}}ga(r)}r=!1}r&&(t=a[0])}}return a=At(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zd,lastRenderedState:t},a.queue=r,a=nf.bind(null,fe,r),r.dispatch=a,r=xu(!1),u=Mu.bind(null,fe,!1,r.queue),r=At(),o={state:t,dispatch:null,action:e,pending:null},r.queue=o,a=Ay.bind(null,fe,o,u,a),o.dispatch=a,r.memoizedState=e,[t,a,!1]}function Bd(e){var t=et();return Hd(t,De,e)}function Hd(e,t,a){if(t=Ru(e,t,zd)[0],e=vl(Vn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Gs(t)}catch(f){throw f===Di?ol:f}else r=t;t=et();var o=t.queue,u=o.dispatch;return a!==t.memoizedState&&(fe.flags|=2048,Bi(9,{destroy:void 0},Cy.bind(null,o,a),null)),[r,u,e]}function Cy(e,t){e.action=t}function $d(e){var t=et(),a=De;if(a!==null)return Hd(t,a,e);et(),t=t.memoizedState,a=et();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function Bi(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=fe.updateQueue,t===null&&(t=pl(),fe.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function qd(){return et().memoizedState}function bl(e,t,a,r){var o=At();fe.flags|=e,o.memoizedState=Bi(1|t,{destroy:void 0},a,r===void 0?null:r)}function _l(e,t,a,r){var o=et();r=r===void 0?null:r;var u=o.memoizedState.inst;De!==null&&r!==null&&Su(r,De.memoizedState.deps)?o.memoizedState=Bi(t,u,a,r):(fe.flags|=e,o.memoizedState=Bi(1|t,u,a,r))}function Pd(e,t){bl(8390656,8,e,t)}function Nu(e,t){_l(2048,8,e,t)}function Ry(e){fe.flags|=4;var t=fe.updateQueue;if(t===null)t=pl(),fe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Gd(e){var t=et().memoizedState;return Ry({ref:t,nextImpl:e}),function(){if((Re&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function Vd(e,t){return _l(4,2,e,t)}function Kd(e,t){return _l(4,4,e,t)}function Id(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Yd(e,t,a){a=a!=null?a.concat([e]):null,_l(4,4,Id.bind(null,t,e),a)}function Du(){}function Jd(e,t){var a=et();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&Su(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function Xd(e,t){var a=et();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&Su(t,r[1]))return r[0];if(r=e(),ni){kt(!0);try{e()}finally{kt(!1)}}return a.memoizedState=[r,t],r}function Uu(e,t,a){return a===void 0||(Gn&1073741824)!==0&&(be&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Zf(),fe.lanes|=e,Ea|=e,a)}function Qd(e,t,a,r){return $t(a,t)?a:Li.current!==null?(e=Uu(e,a,r),$t(e,t)||(st=!0),e):(Gn&42)===0||(Gn&1073741824)!==0&&(be&261930)===0?(st=!0,e.memoizedState=a):(e=Zf(),fe.lanes|=e,Ea|=e,t)}function Zd(e,t,a,r,o){var u=V.p;V.p=u!==0&&8>u?u:8;var f=U.T,y={};U.T=y,Mu(e,!1,t,a);try{var S=o(),x=U.S;if(x!==null&&x(y,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var z=Ty(S,r);Vs(e,t,z,It(e))}else Vs(e,t,r,It(e))}catch(B){Vs(e,t,{then:function(){},status:"rejected",reason:B},It())}finally{V.p=u,f!==null&&y.types!==null&&(f.types=y.types),U.T=f}}function Oy(){}function Lu(e,t,a,r){if(e.tag!==5)throw Error(l(476));var o=Fd(e).queue;Zd(e,o,t,te,a===null?Oy:function(){return Wd(e),a(r)})}function Fd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:te},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Wd(e){var t=Fd(e);t.next===null&&(t=e.alternate.memoizedState),Vs(e,t.next.queue,{},It())}function zu(){return yt(lr)}function ef(){return et().memoizedState}function tf(){return et().memoizedState}function xy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=It();e=va(a);var r=ba(t,e,a);r!==null&&(Lt(r,t,a),Hs(r,t,a)),t={cache:hu()},e.payload=t;return}t=t.return}}function jy(e,t,a){var r=It();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},wl(e)?af(t,a):(a=eu(e,t,a,r),a!==null&&(Lt(a,e,r),sf(a,t,r)))}function nf(e,t,a){var r=It();Vs(e,t,a,r)}function Vs(e,t,a,r){var o={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(wl(e))af(t,o);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var f=t.lastRenderedState,y=u(f,a);if(o.hasEagerState=!0,o.eagerState=y,$t(y,f))return tl(e,t,o,0),Me===null&&el(),!1}catch{}if(a=eu(e,t,o,r),a!==null)return Lt(a,e,r),sf(a,t,r),!0}return!1}function Mu(e,t,a,r){if(r={lane:2,revertLane:gc(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},wl(e)){if(t)throw Error(l(479))}else t=eu(e,a,r,2),t!==null&&Lt(t,e,2)}function wl(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function af(e,t){zi=ml=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function sf(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,ws(e,a)}}var Ks={readContext:yt,use:yl,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};Ks.useEffectEvent=Xe;var rf={readContext:yt,use:yl,useCallback:function(e,t){return At().memoizedState=[e,t===void 0?null:t],e},useContext:yt,useEffect:Pd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,bl(4194308,4,Id.bind(null,t,e),a)},useLayoutEffect:function(e,t){return bl(4194308,4,e,t)},useInsertionEffect:function(e,t){bl(4,2,e,t)},useMemo:function(e,t){var a=At();t=t===void 0?null:t;var r=e();if(ni){kt(!0);try{e()}finally{kt(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=At();if(a!==void 0){var o=a(t);if(ni){kt(!0);try{a(t)}finally{kt(!1)}}}else o=t;return r.memoizedState=r.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},r.queue=e,e=e.dispatch=jy.bind(null,fe,e),[r.memoizedState,e]},useRef:function(e){var t=At();return e={current:e},t.memoizedState=e},useState:function(e){e=xu(e);var t=e.queue,a=nf.bind(null,fe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Du,useDeferredValue:function(e,t){var a=At();return Uu(a,e,t)},useTransition:function(){var e=xu(!1);return e=Zd.bind(null,fe,e.queue,!0,!1),At().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=fe,o=At();if(we){if(a===void 0)throw Error(l(407));a=a()}else{if(a=t(),Me===null)throw Error(l(349));(be&127)!==0||Ad(r,t,a)}o.memoizedState=a;var u={value:a,getSnapshot:t};return o.queue=u,Pd(Rd.bind(null,r,u,e),[e]),r.flags|=2048,Bi(9,{destroy:void 0},Cd.bind(null,r,u,a,t),null),a},useId:function(){var e=At(),t=Me.identifierPrefix;if(we){var a=An,r=kn;a=(r&~(1<<32-gt(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=gl++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Ey++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:zu,useFormState:Md,useActionState:Md,useOptimistic:function(e){var t=At();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Mu.bind(null,fe,!0,a),a.dispatch=t,[e,t]},useMemoCache:Cu,useCacheRefresh:function(){return At().memoizedState=xy.bind(null,fe)},useEffectEvent:function(e){var t=At(),a={impl:e};return t.memoizedState=a,function(){if((Re&2)!==0)throw Error(l(440));return a.impl.apply(void 0,arguments)}}},Bu={readContext:yt,use:yl,useCallback:Jd,useContext:yt,useEffect:Nu,useImperativeHandle:Yd,useInsertionEffect:Vd,useLayoutEffect:Kd,useMemo:Xd,useReducer:vl,useRef:qd,useState:function(){return vl(Vn)},useDebugValue:Du,useDeferredValue:function(e,t){var a=et();return Qd(a,De.memoizedState,e,t)},useTransition:function(){var e=vl(Vn)[0],t=et().memoizedState;return[typeof e=="boolean"?e:Gs(e),t]},useSyncExternalStore:kd,useId:ef,useHostTransitionStatus:zu,useFormState:Bd,useActionState:Bd,useOptimistic:function(e,t){var a=et();return jd(a,De,e,t)},useMemoCache:Cu,useCacheRefresh:tf};Bu.useEffectEvent=Gd;var lf={readContext:yt,use:yl,useCallback:Jd,useContext:yt,useEffect:Nu,useImperativeHandle:Yd,useInsertionEffect:Vd,useLayoutEffect:Kd,useMemo:Xd,useReducer:Ou,useRef:qd,useState:function(){return Ou(Vn)},useDebugValue:Du,useDeferredValue:function(e,t){var a=et();return De===null?Uu(a,e,t):Qd(a,De.memoizedState,e,t)},useTransition:function(){var e=Ou(Vn)[0],t=et().memoizedState;return[typeof e=="boolean"?e:Gs(e),t]},useSyncExternalStore:kd,useId:ef,useHostTransitionStatus:zu,useFormState:$d,useActionState:$d,useOptimistic:function(e,t){var a=et();return De!==null?jd(a,De,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Cu,useCacheRefresh:tf};lf.useEffectEvent=Gd;function Hu(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:b({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var $u={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=It(),o=va(r);o.payload=t,a!=null&&(o.callback=a),t=ba(e,o,r),t!==null&&(Lt(t,e,r),Hs(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=It(),o=va(r);o.tag=1,o.payload=t,a!=null&&(o.callback=a),t=ba(e,o,r),t!==null&&(Lt(t,e,r),Hs(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=It(),r=va(a);r.tag=2,t!=null&&(r.callback=t),t=ba(e,r,a),t!==null&&(Lt(t,e,a),Hs(t,e,a))}};function of(e,t,a,r,o,u,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,u,f):t.prototype&&t.prototype.isPureReactComponent?!js(a,r)||!js(o,u):!0}function uf(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&$u.enqueueReplaceState(t,t.state,null)}function ai(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=b({},a));for(var o in e)a[o]===void 0&&(a[o]=e[o])}return a}function cf(e){Wr(e)}function hf(e){console.error(e)}function df(e){Wr(e)}function Sl(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function ff(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function qu(e,t,a){return a=va(a),a.tag=3,a.payload={element:null},a.callback=function(){Sl(e,t)},a}function mf(e){return e=va(e),e.tag=3,e}function gf(e,t,a,r){var o=a.type.getDerivedStateFromError;if(typeof o=="function"){var u=r.value;e.payload=function(){return o(u)},e.callback=function(){ff(t,a,r)}}var f=a.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){ff(t,a,r),typeof o!="function"&&(ka===null?ka=new Set([this]):ka.add(this));var y=r.stack;this.componentDidCatch(r.value,{componentStack:y!==null?y:""})})}function Ny(e,t,a,r,o){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&xi(t,a,o,!0),a=Pt.current,a!==null){switch(a.tag){case 31:case 13:return nn===null?Ul():a.alternate===null&&Qe===0&&(Qe=3),a.flags&=-257,a.flags|=65536,a.lanes=o,r===ul?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),dc(e,r,o)),!1;case 22:return a.flags|=65536,r===ul?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),dc(e,r,o)),!1}throw Error(l(435,a.tag))}return dc(e,r,o),Ul(),!1}if(we)return t=Pt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,r!==ru&&(e=Error(l(422),{cause:r}),Us(Ft(e,a)))):(r!==ru&&(t=Error(l(423),{cause:r}),Us(Ft(t,a))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,r=Ft(r,a),o=qu(e.stateNode,r,o),yu(e,o),Qe!==4&&(Qe=2)),!1;var u=Error(l(520),{cause:r});if(u=Ft(u,a),Ws===null?Ws=[u]:Ws.push(u),Qe!==4&&(Qe=2),t===null)return!0;r=Ft(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=o&-o,a.lanes|=e,e=qu(a.stateNode,r,e),yu(a,e),!1;case 1:if(t=a.type,u=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(ka===null||!ka.has(u))))return a.flags|=65536,o&=-o,a.lanes|=o,o=mf(o),gf(o,e,a,r),yu(a,o),!1}a=a.return}while(a!==null);return!1}var Pu=Error(l(461)),st=!1;function vt(e,t,a,r){t.child=e===null?vd(t,null,a,r):ti(t,e.child,a,r)}function pf(e,t,a,r,o){a=a.render;var u=t.ref;if("ref"in r){var f={};for(var y in r)y!=="ref"&&(f[y]=r[y])}else f=r;return Za(t),r=Tu(e,t,a,f,u,o),y=Eu(),e!==null&&!st?(ku(e,t,o),Kn(e,t,o)):(we&&y&&iu(t),t.flags|=1,vt(e,t,r,o),t.child)}function yf(e,t,a,r,o){if(e===null){var u=a.type;return typeof u=="function"&&!tu(u)&&u.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=u,vf(e,t,u,r,o)):(e=al(a.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Qu(e,o)){var f=u.memoizedProps;if(a=a.compare,a=a!==null?a:js,a(f,r)&&e.ref===t.ref)return Kn(e,t,o)}return t.flags|=1,e=Hn(u,r),e.ref=t.ref,e.return=t,t.child=e}function vf(e,t,a,r,o){if(e!==null){var u=e.memoizedProps;if(js(u,r)&&e.ref===t.ref)if(st=!1,t.pendingProps=r=u,Qu(e,o))(e.flags&131072)!==0&&(st=!0);else return t.lanes=e.lanes,Kn(e,t,o)}return Gu(e,t,a,r,o)}function bf(e,t,a,r){var o=r.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|a:a,e!==null){for(r=t.child=e.child,o=0;r!==null;)o=o|r.lanes|r.childLanes,r=r.sibling;r=o&~u}else r=0,t.child=null;return _f(e,t,u,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ll(t,u!==null?u.cachePool:null),u!==null?wd(t,u):bu(),Sd(t);else return r=t.lanes=536870912,_f(e,t,u!==null?u.baseLanes|a:a,a,r)}else u!==null?(ll(t,u.cachePool),wd(t,u),wa(),t.memoizedState=null):(e!==null&&ll(t,null),bu(),wa());return vt(e,t,o,a),t.child}function Is(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function _f(e,t,a,r,o){var u=fu();return u=u===null?null:{parent:at._currentValue,pool:u},t.memoizedState={baseLanes:a,cachePool:u},e!==null&&ll(t,null),bu(),Sd(t),e!==null&&xi(e,t,r,!0),t.childLanes=o,null}function Tl(e,t){return t=kl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function wf(e,t,a){return ti(t,e.child,null,a),e=Tl(t,t.pendingProps),e.flags|=2,Gt(t),t.memoizedState=null,e}function Dy(e,t,a){var r=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(we){if(r.mode==="hidden")return e=Tl(t,r),t.lanes=536870912,Is(null,e);if(wu(t),(e=$e)?(e=Dm(e,tn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:fa!==null?{id:kn,overflow:An}:null,retryLane:536870912,hydrationErrors:null},a=ad(e),a.return=t,t.child=a,pt=t,$e=null)):e=null,e===null)throw ga(t);return t.lanes=536870912,null}return Tl(t,r)}var u=e.memoizedState;if(u!==null){var f=u.dehydrated;if(wu(t),o)if(t.flags&256)t.flags&=-257,t=wf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(st||xi(e,t,a,!1),o=(a&e.childLanes)!==0,st||o){if(r=Me,r!==null&&(f=ca(r,a),f!==0&&f!==u.retryLane))throw u.retryLane=f,Ya(e,f),Lt(r,e,f),Pu;Ul(),t=wf(e,t,a)}else e=u.treeContext,$e=an(f.nextSibling),pt=t,we=!0,ma=null,tn=!1,e!==null&&rd(t,e),t=Tl(t,r),t.flags|=4096;return t}return e=Hn(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function El(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(l(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Gu(e,t,a,r,o){return Za(t),a=Tu(e,t,a,r,void 0,o),r=Eu(),e!==null&&!st?(ku(e,t,o),Kn(e,t,o)):(we&&r&&iu(t),t.flags|=1,vt(e,t,a,o),t.child)}function Sf(e,t,a,r,o,u){return Za(t),t.updateQueue=null,a=Ed(t,r,a,o),Td(e),r=Eu(),e!==null&&!st?(ku(e,t,u),Kn(e,t,u)):(we&&r&&iu(t),t.flags|=1,vt(e,t,a,u),t.child)}function Tf(e,t,a,r,o){if(Za(t),t.stateNode===null){var u=Ai,f=a.contextType;typeof f=="object"&&f!==null&&(u=yt(f)),u=new a(r,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=$u,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=r,u.state=t.memoizedState,u.refs={},gu(t),f=a.contextType,u.context=typeof f=="object"&&f!==null?yt(f):Ai,u.state=t.memoizedState,f=a.getDerivedStateFromProps,typeof f=="function"&&(Hu(t,a,f,r),u.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(f=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),f!==u.state&&$u.enqueueReplaceState(u,u.state,null),qs(t,r,u,o),$s(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){u=t.stateNode;var y=t.memoizedProps,S=ai(a,y);u.props=S;var x=u.context,z=a.contextType;f=Ai,typeof z=="object"&&z!==null&&(f=yt(z));var B=a.getDerivedStateFromProps;z=typeof B=="function"||typeof u.getSnapshotBeforeUpdate=="function",y=t.pendingProps!==y,z||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(y||x!==f)&&uf(t,u,r,f),ya=!1;var j=t.memoizedState;u.state=j,qs(t,r,u,o),$s(),x=t.memoizedState,y||j!==x||ya?(typeof B=="function"&&(Hu(t,a,B,r),x=t.memoizedState),(S=ya||of(t,a,S,r,j,x,f))?(z||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=x),u.props=r,u.state=x,u.context=f,r=S):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{u=t.stateNode,pu(e,t),f=t.memoizedProps,z=ai(a,f),u.props=z,B=t.pendingProps,j=u.context,x=a.contextType,S=Ai,typeof x=="object"&&x!==null&&(S=yt(x)),y=a.getDerivedStateFromProps,(x=typeof y=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(f!==B||j!==S)&&uf(t,u,r,S),ya=!1,j=t.memoizedState,u.state=j,qs(t,r,u,o),$s();var N=t.memoizedState;f!==B||j!==N||ya||e!==null&&e.dependencies!==null&&sl(e.dependencies)?(typeof y=="function"&&(Hu(t,a,y,r),N=t.memoizedState),(z=ya||of(t,a,z,r,j,N,S)||e!==null&&e.dependencies!==null&&sl(e.dependencies))?(x||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(r,N,S),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(r,N,S)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||f===e.memoizedProps&&j===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&j===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=N),u.props=r,u.state=N,u.context=S,r=z):(typeof u.componentDidUpdate!="function"||f===e.memoizedProps&&j===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&j===e.memoizedState||(t.flags|=1024),r=!1)}return u=r,El(e,t),r=(t.flags&128)!==0,u||r?(u=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&r?(t.child=ti(t,e.child,null,o),t.child=ti(t,null,a,o)):vt(e,t,a,o),t.memoizedState=u.state,e=t.child):e=Kn(e,t,o),e}function Ef(e,t,a,r){return Xa(),t.flags|=256,vt(e,t,a,r),t.child}var Vu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ku(e){return{baseLanes:e,cachePool:dd()}}function Iu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Kt),e}function kf(e,t,a){var r=t.pendingProps,o=!1,u=(t.flags&128)!==0,f;if((f=u)||(f=e!==null&&e.memoizedState===null?!1:(We.current&2)!==0),f&&(o=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(we){if(o?_a(t):wa(),(e=$e)?(e=Dm(e,tn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:fa!==null?{id:kn,overflow:An}:null,retryLane:536870912,hydrationErrors:null},a=ad(e),a.return=t,t.child=a,pt=t,$e=null)):e=null,e===null)throw ga(t);return Rc(e)?t.lanes=32:t.lanes=536870912,null}var y=r.children;return r=r.fallback,o?(wa(),o=t.mode,y=kl({mode:"hidden",children:y},o),r=Ja(r,o,a,null),y.return=t,r.return=t,y.sibling=r,t.child=y,r=t.child,r.memoizedState=Ku(a),r.childLanes=Iu(e,f,a),t.memoizedState=Vu,Is(null,r)):(_a(t),Yu(t,y))}var S=e.memoizedState;if(S!==null&&(y=S.dehydrated,y!==null)){if(u)t.flags&256?(_a(t),t.flags&=-257,t=Ju(e,t,a)):t.memoizedState!==null?(wa(),t.child=e.child,t.flags|=128,t=null):(wa(),y=r.fallback,o=t.mode,r=kl({mode:"visible",children:r.children},o),y=Ja(y,o,a,null),y.flags|=2,r.return=t,y.return=t,r.sibling=y,t.child=r,ti(t,e.child,null,a),r=t.child,r.memoizedState=Ku(a),r.childLanes=Iu(e,f,a),t.memoizedState=Vu,t=Is(null,r));else if(_a(t),Rc(y)){if(f=y.nextSibling&&y.nextSibling.dataset,f)var x=f.dgst;f=x,r=Error(l(419)),r.stack="",r.digest=f,Us({value:r,source:null,stack:null}),t=Ju(e,t,a)}else if(st||xi(e,t,a,!1),f=(a&e.childLanes)!==0,st||f){if(f=Me,f!==null&&(r=ca(f,a),r!==0&&r!==S.retryLane))throw S.retryLane=r,Ya(e,r),Lt(f,e,r),Pu;Cc(y)||Ul(),t=Ju(e,t,a)}else Cc(y)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,$e=an(y.nextSibling),pt=t,we=!0,ma=null,tn=!1,e!==null&&rd(t,e),t=Yu(t,r.children),t.flags|=4096);return t}return o?(wa(),y=r.fallback,o=t.mode,S=e.child,x=S.sibling,r=Hn(S,{mode:"hidden",children:r.children}),r.subtreeFlags=S.subtreeFlags&65011712,x!==null?y=Hn(x,y):(y=Ja(y,o,a,null),y.flags|=2),y.return=t,r.return=t,r.sibling=y,t.child=r,Is(null,r),r=t.child,y=e.child.memoizedState,y===null?y=Ku(a):(o=y.cachePool,o!==null?(S=at._currentValue,o=o.parent!==S?{parent:S,pool:S}:o):o=dd(),y={baseLanes:y.baseLanes|a,cachePool:o}),r.memoizedState=y,r.childLanes=Iu(e,f,a),t.memoizedState=Vu,Is(e.child,r)):(_a(t),a=e.child,e=a.sibling,a=Hn(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=a,t.memoizedState=null,a)}function Yu(e,t){return t=kl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function kl(e,t){return e=qt(22,e,null,t),e.lanes=0,e}function Ju(e,t,a){return ti(t,e.child,null,a),e=Yu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Af(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),uu(e.return,t,a)}function Xu(e,t,a,r,o,u){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:o,treeForkCount:u}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=r,f.tail=a,f.tailMode=o,f.treeForkCount=u)}function Cf(e,t,a){var r=t.pendingProps,o=r.revealOrder,u=r.tail;r=r.children;var f=We.current,y=(f&2)!==0;if(y?(f=f&1|2,t.flags|=128):f&=1,K(We,f),vt(e,t,r,a),r=we?Ds:0,!y&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Af(e,a,t);else if(e.tag===19)Af(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(a=t.child,o=null;a!==null;)e=a.alternate,e!==null&&fl(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),Xu(t,!1,o,a,u,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&fl(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}Xu(t,!0,a,null,u,r);break;case"together":Xu(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Kn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Ea|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(xi(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,a=Hn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Hn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Qu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&sl(e)))}function Uy(e,t,a){switch(t.tag){case 3:Ke(t,t.stateNode.containerInfo),pa(t,at,e.memoizedState.cache),Xa();break;case 27:case 5:Ma(t);break;case 4:Ke(t,t.stateNode.containerInfo);break;case 10:pa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,wu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(_a(t),t.flags|=128,null):(a&t.child.childLanes)!==0?kf(e,t,a):(_a(t),e=Kn(e,t,a),e!==null?e.sibling:null);_a(t);break;case 19:var o=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(xi(e,t,a,!1),r=(a&t.childLanes)!==0),o){if(r)return Cf(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),K(We,We.current),r)break;return null;case 22:return t.lanes=0,bf(e,t,a,t.pendingProps);case 24:pa(t,at,e.memoizedState.cache)}return Kn(e,t,a)}function Rf(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)st=!0;else{if(!Qu(e,a)&&(t.flags&128)===0)return st=!1,Uy(e,t,a);st=(e.flags&131072)!==0}else st=!1,we&&(t.flags&1048576)!==0&&sd(t,Ds,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Wa(t.elementType),t.type=e,typeof e=="function")tu(e)?(r=ai(e,r),t.tag=1,t=Tf(null,t,e,r,a)):(t.tag=0,t=Gu(null,t,e,r,a));else{if(e!=null){var o=e.$$typeof;if(o===X){t.tag=11,t=pf(null,t,e,r,a);break e}else if(o===J){t.tag=14,t=yf(null,t,e,r,a);break e}}throw t=dt(e)||e,Error(l(306,t,""))}}return t;case 0:return Gu(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,o=ai(r,t.pendingProps),Tf(e,t,r,o,a);case 3:e:{if(Ke(t,t.stateNode.containerInfo),e===null)throw Error(l(387));r=t.pendingProps;var u=t.memoizedState;o=u.element,pu(e,t),qs(t,r,null,a);var f=t.memoizedState;if(r=f.cache,pa(t,at,r),r!==u.cache&&cu(t,[at],a,!0),$s(),r=f.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=Ef(e,t,r,a);break e}else if(r!==o){o=Ft(Error(l(424)),t),Us(o),t=Ef(e,t,r,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,$e=an(e.firstChild),pt=t,we=!0,ma=null,tn=!0,a=vd(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Xa(),r===o){t=Kn(e,t,a);break e}vt(e,t,r,a)}t=t.child}return t;case 26:return El(e,t),e===null?(a=Hm(t.type,null,t.pendingProps,null))?t.memoizedState=a:we||(a=t.type,e=t.pendingProps,r=ql(de.current).createElement(a),r[ct]=t,r[_t]=e,bt(r,a,e),nt(r),t.stateNode=r):t.memoizedState=Hm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ma(t),e===null&&we&&(r=t.stateNode=zm(t.type,t.pendingProps,de.current),pt=t,tn=!0,o=$e,Oa(t.type)?(Oc=o,$e=an(r.firstChild)):$e=o),vt(e,t,t.pendingProps.children,a),El(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&we&&((o=r=$e)&&(r=cv(r,t.type,t.pendingProps,tn),r!==null?(t.stateNode=r,pt=t,$e=an(r.firstChild),tn=!1,o=!0):o=!1),o||ga(t)),Ma(t),o=t.type,u=t.pendingProps,f=e!==null?e.memoizedProps:null,r=u.children,Ec(o,u)?r=null:f!==null&&Ec(o,f)&&(t.flags|=32),t.memoizedState!==null&&(o=Tu(e,t,ky,null,null,a),lr._currentValue=o),El(e,t),vt(e,t,r,a),t.child;case 6:return e===null&&we&&((e=a=$e)&&(a=hv(a,t.pendingProps,tn),a!==null?(t.stateNode=a,pt=t,$e=null,e=!0):e=!1),e||ga(t)),null;case 13:return kf(e,t,a);case 4:return Ke(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ti(t,null,r,a):vt(e,t,r,a),t.child;case 11:return pf(e,t,t.type,t.pendingProps,a);case 7:return vt(e,t,t.pendingProps,a),t.child;case 8:return vt(e,t,t.pendingProps.children,a),t.child;case 12:return vt(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,pa(t,t.type,r.value),vt(e,t,r.children,a),t.child;case 9:return o=t.type._context,r=t.pendingProps.children,Za(t),o=yt(o),r=r(o),t.flags|=1,vt(e,t,r,a),t.child;case 14:return yf(e,t,t.type,t.pendingProps,a);case 15:return vf(e,t,t.type,t.pendingProps,a);case 19:return Cf(e,t,a);case 31:return Dy(e,t,a);case 22:return bf(e,t,a,t.pendingProps);case 24:return Za(t),r=yt(at),e===null?(o=fu(),o===null&&(o=Me,u=hu(),o.pooledCache=u,u.refCount++,u!==null&&(o.pooledCacheLanes|=a),o=u),t.memoizedState={parent:r,cache:o},gu(t),pa(t,at,o)):((e.lanes&a)!==0&&(pu(e,t),qs(t,null,null,a),$s()),o=e.memoizedState,u=t.memoizedState,o.parent!==r?(o={parent:r,cache:r},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),pa(t,at,r)):(r=u.cache,pa(t,at,r),r!==o.cache&&cu(t,[at],a,!0))),vt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function In(e){e.flags|=4}function Zu(e,t,a,r,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(tm())e.flags|=8192;else throw ei=ul,mu}else e.flags&=-16777217}function Of(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Vm(t))if(tm())e.flags|=8192;else throw ei=ul,mu}function Al(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?vs():536870912,e.lanes|=t,Pi|=t)}function Ys(e,t){if(!we)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags&65011712,r|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function Ly(e,t,a){var r=t.pendingProps;switch(su(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(t),null;case 1:return qe(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Pn(at),Ie(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Oi(t)?In(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,lu())),qe(t),null;case 26:var o=t.type,u=t.memoizedState;return e===null?(In(t),u!==null?(qe(t),Of(t,u)):(qe(t),Zu(t,o,null,r,a))):u?u!==e.memoizedState?(In(t),qe(t),Of(t,u)):(qe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&In(t),qe(t),Zu(t,o,e,r,a)),null;case 27:if(hi(t),a=de.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&In(t);else{if(!r){if(t.stateNode===null)throw Error(l(166));return qe(t),null}e=Q.current,Oi(t)?ld(t):(e=zm(o,r,a),t.stateNode=e,In(t))}return qe(t),null;case 5:if(hi(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&In(t);else{if(!r){if(t.stateNode===null)throw Error(l(166));return qe(t),null}if(u=Q.current,Oi(t))ld(t);else{var f=ql(de.current);switch(u){case 1:u=f.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:u=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":u=f.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":u=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":u=f.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof r.is=="string"?f.createElement("select",{is:r.is}):f.createElement("select"),r.multiple?u.multiple=!0:r.size&&(u.size=r.size);break;default:u=typeof r.is=="string"?f.createElement(o,{is:r.is}):f.createElement(o)}}u[ct]=t,u[_t]=r;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)u.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=u;e:switch(bt(u,o,r),o){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&In(t)}}return qe(t),Zu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&In(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(l(166));if(e=de.current,Oi(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,o=pt,o!==null)switch(o.tag){case 27:case 5:r=o.memoizedProps}e[ct]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||km(e.nodeValue,a)),e||ga(t,!0)}else e=ql(e).createTextNode(r),e[ct]=t,t.stateNode=e}return qe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Oi(t),a!==null){if(e===null){if(!r)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[ct]=t}else Xa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),e=!1}else a=lu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Gt(t),t):(Gt(t),null);if((t.flags&128)!==0)throw Error(l(558))}return qe(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Oi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(l(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(l(317));o[ct]=t}else Xa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),o=!1}else o=lu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Gt(t),t):(Gt(t),null)}return Gt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,o=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(o=r.alternate.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==o&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Al(t,t.updateQueue),qe(t),null);case 4:return Ie(),e===null&&bc(t.stateNode.containerInfo),qe(t),null;case 10:return Pn(t.type),qe(t),null;case 19:if(L(We),r=t.memoizedState,r===null)return qe(t),null;if(o=(t.flags&128)!==0,u=r.rendering,u===null)if(o)Ys(r,!1);else{if(Qe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=fl(e),u!==null){for(t.flags|=128,Ys(r,!1),e=u.updateQueue,t.updateQueue=e,Al(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)nd(a,e),a=a.sibling;return K(We,We.current&1|2),we&&$n(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Et()>jl&&(t.flags|=128,o=!0,Ys(r,!1),t.lanes=4194304)}else{if(!o)if(e=fl(u),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Al(t,e),Ys(r,!0),r.tail===null&&r.tailMode==="hidden"&&!u.alternate&&!we)return qe(t),null}else 2*Et()-r.renderingStartTime>jl&&a!==536870912&&(t.flags|=128,o=!0,Ys(r,!1),t.lanes=4194304);r.isBackwards?(u.sibling=t.child,t.child=u):(e=r.last,e!==null?e.sibling=u:t.child=u,r.last=u)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Et(),e.sibling=null,a=We.current,K(We,o?a&1|2:a&1),we&&$n(t,r.treeForkCount),e):(qe(t),null);case 22:case 23:return Gt(t),_u(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),a=t.updateQueue,a!==null&&Al(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&L(Fa),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Pn(at),qe(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function zy(e,t){switch(su(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pn(at),Ie(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return hi(t),null;case 31:if(t.memoizedState!==null){if(Gt(t),t.alternate===null)throw Error(l(340));Xa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Gt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));Xa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(We),null;case 4:return Ie(),null;case 10:return Pn(t.type),null;case 22:case 23:return Gt(t),_u(),e!==null&&L(Fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Pn(at),null;case 25:return null;default:return null}}function xf(e,t){switch(su(t),t.tag){case 3:Pn(at),Ie();break;case 26:case 27:case 5:hi(t);break;case 4:Ie();break;case 31:t.memoizedState!==null&&Gt(t);break;case 13:Gt(t);break;case 19:L(We);break;case 10:Pn(t.type);break;case 22:case 23:Gt(t),_u(),e!==null&&L(Fa);break;case 24:Pn(at)}}function Js(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var o=r.next;a=o;do{if((a.tag&e)===e){r=void 0;var u=a.create,f=a.inst;r=u(),f.destroy=r}a=a.next}while(a!==o)}}catch(y){je(t,t.return,y)}}function Sa(e,t,a){try{var r=t.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var u=o.next;r=u;do{if((r.tag&e)===e){var f=r.inst,y=f.destroy;if(y!==void 0){f.destroy=void 0,o=t;var S=a,x=y;try{x()}catch(z){je(o,S,z)}}}r=r.next}while(r!==u)}}catch(z){je(t,t.return,z)}}function jf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{_d(t,a)}catch(r){je(e,e.return,r)}}}function Nf(e,t,a){a.props=ai(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){je(e,t,r)}}function Xs(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(o){je(e,t,o)}}function Cn(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(o){je(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(o){je(e,t,o)}else a.current=null}function Df(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(o){je(e,e.return,o)}}function Fu(e,t,a){try{var r=e.stateNode;iv(r,e.type,a,t),r[_t]=t}catch(o){je(e,e.return,o)}}function Uf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Oa(e.type)||e.tag===4}function Wu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Uf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Oa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ec(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Mn));else if(r!==4&&(r===27&&Oa(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(ec(e,t,a),e=e.sibling;e!==null;)ec(e,t,a),e=e.sibling}function Cl(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&Oa(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Cl(e,t,a),e=e.sibling;e!==null;)Cl(e,t,a),e=e.sibling}function Lf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);bt(t,r,a),t[ct]=e,t[_t]=a}catch(u){je(e,e.return,u)}}var Yn=!1,rt=!1,tc=!1,zf=typeof WeakSet=="function"?WeakSet:Set,ft=null;function My(e,t){if(e=e.containerInfo,Sc=Jl,e=Yh(e),Jo(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var o=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{a.nodeType,u.nodeType}catch{a=null;break e}var f=0,y=-1,S=-1,x=0,z=0,B=e,j=null;t:for(;;){for(var N;B!==a||o!==0&&B.nodeType!==3||(y=f+o),B!==u||r!==0&&B.nodeType!==3||(S=f+r),B.nodeType===3&&(f+=B.nodeValue.length),(N=B.firstChild)!==null;)j=B,B=N;for(;;){if(B===e)break t;if(j===a&&++x===o&&(y=f),j===u&&++z===r&&(S=f),(N=B.nextSibling)!==null)break;B=j,j=B.parentNode}B=N}a=y===-1||S===-1?null:{start:y,end:S}}else a=null}a=a||{start:0,end:0}}else a=null;for(Tc={focusedElem:e,selectionRange:a},Jl=!1,ft=t;ft!==null;)if(t=ft,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ft=e;else for(;ft!==null;){switch(t=ft,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)o=e[a],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,a=t,o=u.memoizedProps,u=u.memoizedState,r=a.stateNode;try{var Z=ai(a.type,o);e=r.getSnapshotBeforeUpdate(Z,u),r.__reactInternalSnapshotBeforeUpdate=e}catch(le){je(a,a.return,le)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Ac(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ac(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=t.sibling,e!==null){e.return=t.return,ft=e;break}ft=t.return}}function Mf(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Xn(e,a),r&4&&Js(5,a);break;case 1:if(Xn(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(f){je(a,a.return,f)}else{var o=ai(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){je(a,a.return,f)}}r&64&&jf(a),r&512&&Xs(a,a.return);break;case 3:if(Xn(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{_d(e,t)}catch(f){je(a,a.return,f)}}break;case 27:t===null&&r&4&&Lf(a);case 26:case 5:Xn(e,a),t===null&&r&4&&Df(a),r&512&&Xs(a,a.return);break;case 12:Xn(e,a);break;case 31:Xn(e,a),r&4&&$f(e,a);break;case 13:Xn(e,a),r&4&&qf(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Iy.bind(null,a),dv(e,a))));break;case 22:if(r=a.memoizedState!==null||Yn,!r){t=t!==null&&t.memoizedState!==null||rt,o=Yn;var u=rt;Yn=r,(rt=t)&&!u?Qn(e,a,(a.subtreeFlags&8772)!==0):Xn(e,a),Yn=o,rt=u}break;case 30:break;default:Xn(e,a)}}function Bf(e){var t=e.alternate;t!==null&&(e.alternate=null,Bf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&vi(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ve=null,jt=!1;function Jn(e,t,a){for(a=a.child;a!==null;)Hf(e,t,a),a=a.sibling}function Hf(e,t,a){if(Oe&&typeof Oe.onCommitFiberUnmount=="function")try{Oe.onCommitFiberUnmount(la,a)}catch{}switch(a.tag){case 26:rt||Cn(a,t),Jn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:rt||Cn(a,t);var r=Ve,o=jt;Oa(a.type)&&(Ve=a.stateNode,jt=!1),Jn(e,t,a),ir(a.stateNode),Ve=r,jt=o;break;case 5:rt||Cn(a,t);case 6:if(r=Ve,o=jt,Ve=null,Jn(e,t,a),Ve=r,jt=o,Ve!==null)if(jt)try{(Ve.nodeType===9?Ve.body:Ve.nodeName==="HTML"?Ve.ownerDocument.body:Ve).removeChild(a.stateNode)}catch(u){je(a,t,u)}else try{Ve.removeChild(a.stateNode)}catch(u){je(a,t,u)}break;case 18:Ve!==null&&(jt?(e=Ve,jm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Qi(e)):jm(Ve,a.stateNode));break;case 4:r=Ve,o=jt,Ve=a.stateNode.containerInfo,jt=!0,Jn(e,t,a),Ve=r,jt=o;break;case 0:case 11:case 14:case 15:Sa(2,a,t),rt||Sa(4,a,t),Jn(e,t,a);break;case 1:rt||(Cn(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&Nf(a,t,r)),Jn(e,t,a);break;case 21:Jn(e,t,a);break;case 22:rt=(r=rt)||a.memoizedState!==null,Jn(e,t,a),rt=r;break;default:Jn(e,t,a)}}function $f(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qi(e)}catch(a){je(t,t.return,a)}}}function qf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qi(e)}catch(a){je(t,t.return,a)}}function By(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new zf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new zf),t;default:throw Error(l(435,e.tag))}}function Rl(e,t){var a=By(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var o=Yy.bind(null,e,r);r.then(o,o)}})}function Nt(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var o=a[r],u=e,f=t,y=f;e:for(;y!==null;){switch(y.tag){case 27:if(Oa(y.type)){Ve=y.stateNode,jt=!1;break e}break;case 5:Ve=y.stateNode,jt=!1;break e;case 3:case 4:Ve=y.stateNode.containerInfo,jt=!0;break e}y=y.return}if(Ve===null)throw Error(l(160));Hf(u,f,o),Ve=null,jt=!1,u=o.alternate,u!==null&&(u.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Pf(t,e),t=t.sibling}var mn=null;function Pf(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Nt(t,e),Dt(e),r&4&&(Sa(3,e,e.return),Js(3,e),Sa(5,e,e.return));break;case 1:Nt(t,e),Dt(e),r&512&&(rt||a===null||Cn(a,a.return)),r&64&&Yn&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var o=mn;if(Nt(t,e),Dt(e),r&512&&(rt||a===null||Cn(a,a.return)),r&4){var u=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,o=o.ownerDocument||o;t:switch(r){case"title":u=o.getElementsByTagName("title")[0],(!u||u[ha]||u[ct]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=o.createElement(r),o.head.insertBefore(u,o.querySelector("head > title"))),bt(u,r,a),u[ct]=e,nt(u),r=u;break e;case"link":var f=Pm("link","href",o).get(r+(a.href||""));if(f){for(var y=0;y<f.length;y++)if(u=f[y],u.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&u.getAttribute("rel")===(a.rel==null?null:a.rel)&&u.getAttribute("title")===(a.title==null?null:a.title)&&u.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){f.splice(y,1);break t}}u=o.createElement(r),bt(u,r,a),o.head.appendChild(u);break;case"meta":if(f=Pm("meta","content",o).get(r+(a.content||""))){for(y=0;y<f.length;y++)if(u=f[y],u.getAttribute("content")===(a.content==null?null:""+a.content)&&u.getAttribute("name")===(a.name==null?null:a.name)&&u.getAttribute("property")===(a.property==null?null:a.property)&&u.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&u.getAttribute("charset")===(a.charSet==null?null:a.charSet)){f.splice(y,1);break t}}u=o.createElement(r),bt(u,r,a),o.head.appendChild(u);break;default:throw Error(l(468,r))}u[ct]=e,nt(u),r=u}e.stateNode=r}else Gm(o,e.type,e.stateNode);else e.stateNode=qm(o,r,e.memoizedProps);else u!==r?(u===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):u.count--,r===null?Gm(o,e.type,e.stateNode):qm(o,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Fu(e,e.memoizedProps,a.memoizedProps)}break;case 27:Nt(t,e),Dt(e),r&512&&(rt||a===null||Cn(a,a.return)),a!==null&&r&4&&Fu(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Nt(t,e),Dt(e),r&512&&(rt||a===null||Cn(a,a.return)),e.flags&32){o=e.stateNode;try{En(o,"")}catch(Z){je(e,e.return,Z)}}r&4&&e.stateNode!=null&&(o=e.memoizedProps,Fu(e,o,a!==null?a.memoizedProps:o)),r&1024&&(tc=!0);break;case 6:if(Nt(t,e),Dt(e),r&4){if(e.stateNode===null)throw Error(l(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(Z){je(e,e.return,Z)}}break;case 3:if(Vl=null,o=mn,mn=Pl(t.containerInfo),Nt(t,e),mn=o,Dt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{Qi(t.containerInfo)}catch(Z){je(e,e.return,Z)}tc&&(tc=!1,Gf(e));break;case 4:r=mn,mn=Pl(e.stateNode.containerInfo),Nt(t,e),Dt(e),mn=r;break;case 12:Nt(t,e),Dt(e);break;case 31:Nt(t,e),Dt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Rl(e,r)));break;case 13:Nt(t,e),Dt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(xl=Et()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Rl(e,r)));break;case 22:o=e.memoizedState!==null;var S=a!==null&&a.memoizedState!==null,x=Yn,z=rt;if(Yn=x||o,rt=z||S,Nt(t,e),rt=z,Yn=x,Dt(e),r&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(a===null||S||Yn||rt||ii(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){S=a=t;try{if(u=S.stateNode,o)f=u.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{y=S.stateNode;var B=S.memoizedProps.style,j=B!=null&&B.hasOwnProperty("display")?B.display:null;y.style.display=j==null||typeof j=="boolean"?"":(""+j).trim()}}catch(Z){je(S,S.return,Z)}}}else if(t.tag===6){if(a===null){S=t;try{S.stateNode.nodeValue=o?"":S.memoizedProps}catch(Z){je(S,S.return,Z)}}}else if(t.tag===18){if(a===null){S=t;try{var N=S.stateNode;o?Nm(N,!0):Nm(S.stateNode,!1)}catch(Z){je(S,S.return,Z)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Rl(e,a))));break;case 19:Nt(t,e),Dt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Rl(e,r)));break;case 30:break;case 21:break;default:Nt(t,e),Dt(e)}}function Dt(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(Uf(r)){a=r;break}r=r.return}if(a==null)throw Error(l(160));switch(a.tag){case 27:var o=a.stateNode,u=Wu(e);Cl(e,u,o);break;case 5:var f=a.stateNode;a.flags&32&&(En(f,""),a.flags&=-33);var y=Wu(e);Cl(e,y,f);break;case 3:case 4:var S=a.stateNode.containerInfo,x=Wu(e);ec(e,x,S);break;default:throw Error(l(161))}}catch(z){je(e,e.return,z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Gf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Gf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Xn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Mf(e,t.alternate,t),t=t.sibling}function ii(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Sa(4,t,t.return),ii(t);break;case 1:Cn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Nf(t,t.return,a),ii(t);break;case 27:ir(t.stateNode);case 26:case 5:Cn(t,t.return),ii(t);break;case 22:t.memoizedState===null&&ii(t);break;case 30:ii(t);break;default:ii(t)}e=e.sibling}}function Qn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,o=e,u=t,f=u.flags;switch(u.tag){case 0:case 11:case 15:Qn(o,u,a),Js(4,u);break;case 1:if(Qn(o,u,a),r=u,o=r.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(x){je(r,r.return,x)}if(r=u,o=r.updateQueue,o!==null){var y=r.stateNode;try{var S=o.shared.hiddenCallbacks;if(S!==null)for(o.shared.hiddenCallbacks=null,o=0;o<S.length;o++)bd(S[o],y)}catch(x){je(r,r.return,x)}}a&&f&64&&jf(u),Xs(u,u.return);break;case 27:Lf(u);case 26:case 5:Qn(o,u,a),a&&r===null&&f&4&&Df(u),Xs(u,u.return);break;case 12:Qn(o,u,a);break;case 31:Qn(o,u,a),a&&f&4&&$f(o,u);break;case 13:Qn(o,u,a),a&&f&4&&qf(o,u);break;case 22:u.memoizedState===null&&Qn(o,u,a),Xs(u,u.return);break;case 30:break;default:Qn(o,u,a)}t=t.sibling}}function nc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Ls(a))}function ac(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ls(e))}function gn(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Vf(e,t,a,r),t=t.sibling}function Vf(e,t,a,r){var o=t.flags;switch(t.tag){case 0:case 11:case 15:gn(e,t,a,r),o&2048&&Js(9,t);break;case 1:gn(e,t,a,r);break;case 3:gn(e,t,a,r),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ls(e)));break;case 12:if(o&2048){gn(e,t,a,r),e=t.stateNode;try{var u=t.memoizedProps,f=u.id,y=u.onPostCommit;typeof y=="function"&&y(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){je(t,t.return,S)}}else gn(e,t,a,r);break;case 31:gn(e,t,a,r);break;case 13:gn(e,t,a,r);break;case 23:break;case 22:u=t.stateNode,f=t.alternate,t.memoizedState!==null?u._visibility&2?gn(e,t,a,r):Qs(e,t):u._visibility&2?gn(e,t,a,r):(u._visibility|=2,Hi(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),o&2048&&nc(f,t);break;case 24:gn(e,t,a,r),o&2048&&ac(t.alternate,t);break;default:gn(e,t,a,r)}}function Hi(e,t,a,r,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,f=t,y=a,S=r,x=f.flags;switch(f.tag){case 0:case 11:case 15:Hi(u,f,y,S,o),Js(8,f);break;case 23:break;case 22:var z=f.stateNode;f.memoizedState!==null?z._visibility&2?Hi(u,f,y,S,o):Qs(u,f):(z._visibility|=2,Hi(u,f,y,S,o)),o&&x&2048&&nc(f.alternate,f);break;case 24:Hi(u,f,y,S,o),o&&x&2048&&ac(f.alternate,f);break;default:Hi(u,f,y,S,o)}t=t.sibling}}function Qs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,o=r.flags;switch(r.tag){case 22:Qs(a,r),o&2048&&nc(r.alternate,r);break;case 24:Qs(a,r),o&2048&&ac(r.alternate,r);break;default:Qs(a,r)}t=t.sibling}}var Zs=8192;function $i(e,t,a){if(e.subtreeFlags&Zs)for(e=e.child;e!==null;)Kf(e,t,a),e=e.sibling}function Kf(e,t,a){switch(e.tag){case 26:$i(e,t,a),e.flags&Zs&&e.memoizedState!==null&&Ev(a,mn,e.memoizedState,e.memoizedProps);break;case 5:$i(e,t,a);break;case 3:case 4:var r=mn;mn=Pl(e.stateNode.containerInfo),$i(e,t,a),mn=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Zs,Zs=16777216,$i(e,t,a),Zs=r):$i(e,t,a));break;default:$i(e,t,a)}}function If(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Fs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];ft=r,Jf(r,e)}If(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Yf(e),e=e.sibling}function Yf(e){switch(e.tag){case 0:case 11:case 15:Fs(e),e.flags&2048&&Sa(9,e,e.return);break;case 3:Fs(e);break;case 12:Fs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ol(e)):Fs(e);break;default:Fs(e)}}function Ol(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];ft=r,Jf(r,e)}If(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Sa(8,t,t.return),Ol(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Ol(t));break;default:Ol(t)}e=e.sibling}}function Jf(e,t){for(;ft!==null;){var a=ft;switch(a.tag){case 0:case 11:case 15:Sa(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ls(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,ft=r;else e:for(a=e;ft!==null;){r=ft;var o=r.sibling,u=r.return;if(Bf(r),r===a){ft=null;break e}if(o!==null){o.return=u,ft=o;break e}ft=u}}}var Hy={getCacheForType:function(e){var t=yt(at),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return yt(at).controller.signal}},$y=typeof WeakMap=="function"?WeakMap:Map,Re=0,Me=null,pe=null,be=0,xe=0,Vt=null,Ta=!1,qi=!1,ic=!1,Zn=0,Qe=0,Ea=0,si=0,sc=0,Kt=0,Pi=0,Ws=null,Ut=null,rc=!1,xl=0,Xf=0,jl=1/0,Nl=null,ka=null,ht=0,Aa=null,Gi=null,Fn=0,lc=0,oc=null,Qf=null,er=0,uc=null;function It(){return(Re&2)!==0&&be!==0?be&-be:U.T!==null?gc():Ss()}function Zf(){if(Kt===0)if((be&536870912)===0||we){var e=gi;gi<<=1,(gi&3932160)===0&&(gi=262144),Kt=e}else Kt=536870912;return e=Pt.current,e!==null&&(e.flags|=32),Kt}function Lt(e,t,a){(e===Me&&(xe===2||xe===9)||e.cancelPendingCommit!==null)&&(Vi(e,0),Ca(e,be,Kt,!1)),Sn(e,a),((Re&2)===0||e!==Me)&&(e===Me&&((Re&2)===0&&(si|=a),Qe===4&&Ca(e,be,Kt,!1)),Rn(e))}function Ff(e,t,a){if((Re&6)!==0)throw Error(l(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||ua(e,t),o=r?Gy(e,t):hc(e,t,!0),u=r;do{if(o===0){qi&&!r&&Ca(e,t,0,!1);break}else{if(a=e.current.alternate,u&&!qy(a)){o=hc(e,t,!1),u=!1;continue}if(o===2){if(u=t,e.errorRecoveryDisabledLanes&u)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var y=e;o=Ws;var S=y.current.memoizedState.isDehydrated;if(S&&(Vi(y,f).flags|=256),f=hc(y,f,!1),f!==2){if(ic&&!S){y.errorRecoveryDisabledLanes|=u,si|=u,o=4;break e}u=Ut,Ut=o,u!==null&&(Ut===null?Ut=u:Ut.push.apply(Ut,u))}o=f}if(u=!1,o!==2)continue}}if(o===1){Vi(e,0),Ca(e,t,0,!0);break}e:{switch(r=e,u=o,u){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:Ca(r,t,Kt,!Ta);break e;case 2:Ut=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(o=xl+300-Et(),10<o)){if(Ca(r,t,Kt,!Ta),$a(r,0,!0)!==0)break e;Fn=t,r.timeoutHandle=Om(Wf.bind(null,r,a,Ut,Nl,rc,t,Kt,si,Pi,Ta,u,"Throttled",-0,0),o);break e}Wf(r,a,Ut,Nl,rc,t,Kt,si,Pi,Ta,u,null,-0,0)}}break}while(!0);Rn(e)}function Wf(e,t,a,r,o,u,f,y,S,x,z,B,j,N){if(e.timeoutHandle=-1,B=t.subtreeFlags,B&8192||(B&16785408)===16785408){B={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Mn},Kf(t,u,B);var Z=(u&62914560)===u?xl-Et():(u&4194048)===u?Xf-Et():0;if(Z=kv(B,Z),Z!==null){Fn=u,e.cancelPendingCommit=Z(lm.bind(null,e,t,u,a,r,o,f,y,S,z,B,null,j,N)),Ca(e,u,f,!x);return}}lm(e,t,u,a,r,o,f,y,S)}function qy(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var o=a[r],u=o.getSnapshot;o=o.value;try{if(!$t(u(),o))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ca(e,t,a,r){t&=~sc,t&=~si,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var o=t;0<o;){var u=31-gt(o),f=1<<u;r[u]=-1,o&=~f}a!==0&&_s(e,a,t)}function Dl(){return(Re&6)===0?(tr(0),!1):!0}function cc(){if(pe!==null){if(xe===0)var e=pe.return;else e=pe,qn=Qa=null,Au(e),Ui=null,Ms=0,e=pe;for(;e!==null;)xf(e.alternate,e),e=e.return;pe=null}}function Vi(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,lv(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Fn=0,cc(),Me=e,pe=a=Hn(e.current,null),be=t,xe=0,Vt=null,Ta=!1,qi=ua(e,t),ic=!1,Pi=Kt=sc=si=Ea=Qe=0,Ut=Ws=null,rc=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var o=31-gt(r),u=1<<o;t|=e[o],r&=~u}return Zn=t,el(),a}function em(e,t){fe=null,U.H=Ks,t===Di||t===ol?(t=gd(),xe=3):t===mu?(t=gd(),xe=4):xe=t===Pu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Vt=t,pe===null&&(Qe=1,Sl(e,Ft(t,e.current)))}function tm(){var e=Pt.current;return e===null?!0:(be&4194048)===be?nn===null:(be&62914560)===be||(be&536870912)!==0?e===nn:!1}function nm(){var e=U.H;return U.H=Ks,e===null?Ks:e}function am(){var e=U.A;return U.A=Hy,e}function Ul(){Qe=4,Ta||(be&4194048)!==be&&Pt.current!==null||(qi=!0),(Ea&134217727)===0&&(si&134217727)===0||Me===null||Ca(Me,be,Kt,!1)}function hc(e,t,a){var r=Re;Re|=2;var o=nm(),u=am();(Me!==e||be!==t)&&(Nl=null,Vi(e,t)),t=!1;var f=Qe;e:do try{if(xe!==0&&pe!==null){var y=pe,S=Vt;switch(xe){case 8:cc(),f=6;break e;case 3:case 2:case 9:case 6:Pt.current===null&&(t=!0);var x=xe;if(xe=0,Vt=null,Ki(e,y,S,x),a&&qi){f=0;break e}break;default:x=xe,xe=0,Vt=null,Ki(e,y,S,x)}}Py(),f=Qe;break}catch(z){em(e,z)}while(!0);return t&&e.shellSuspendCounter++,qn=Qa=null,Re=r,U.H=o,U.A=u,pe===null&&(Me=null,be=0,el()),f}function Py(){for(;pe!==null;)im(pe)}function Gy(e,t){var a=Re;Re|=2;var r=nm(),o=am();Me!==e||be!==t?(Nl=null,jl=Et()+500,Vi(e,t)):qi=ua(e,t);e:do try{if(xe!==0&&pe!==null){t=pe;var u=Vt;t:switch(xe){case 1:xe=0,Vt=null,Ki(e,t,u,1);break;case 2:case 9:if(fd(u)){xe=0,Vt=null,sm(t);break}t=function(){xe!==2&&xe!==9||Me!==e||(xe=7),Rn(e)},u.then(t,t);break e;case 3:xe=7;break e;case 4:xe=5;break e;case 7:fd(u)?(xe=0,Vt=null,sm(t)):(xe=0,Vt=null,Ki(e,t,u,7));break;case 5:var f=null;switch(pe.tag){case 26:f=pe.memoizedState;case 5:case 27:var y=pe;if(f?Vm(f):y.stateNode.complete){xe=0,Vt=null;var S=y.sibling;if(S!==null)pe=S;else{var x=y.return;x!==null?(pe=x,Ll(x)):pe=null}break t}}xe=0,Vt=null,Ki(e,t,u,5);break;case 6:xe=0,Vt=null,Ki(e,t,u,6);break;case 8:cc(),Qe=6;break e;default:throw Error(l(462))}}Vy();break}catch(z){em(e,z)}while(!0);return qn=Qa=null,U.H=r,U.A=o,Re=a,pe!==null?0:(Me=null,be=0,el(),Qe)}function Vy(){for(;pe!==null&&!Ro();)im(pe)}function im(e){var t=Rf(e.alternate,e,Zn);e.memoizedProps=e.pendingProps,t===null?Ll(e):pe=t}function sm(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Sf(a,t,t.pendingProps,t.type,void 0,be);break;case 11:t=Sf(a,t,t.pendingProps,t.type.render,t.ref,be);break;case 5:Au(t);default:xf(a,t),t=pe=nd(t,Zn),t=Rf(a,t,Zn)}e.memoizedProps=e.pendingProps,t===null?Ll(e):pe=t}function Ki(e,t,a,r){qn=Qa=null,Au(t),Ui=null,Ms=0;var o=t.return;try{if(Ny(e,o,t,a,be)){Qe=1,Sl(e,Ft(a,e.current)),pe=null;return}}catch(u){if(o!==null)throw pe=o,u;Qe=1,Sl(e,Ft(a,e.current)),pe=null;return}t.flags&32768?(we||r===1?e=!0:qi||(be&536870912)!==0?e=!1:(Ta=e=!0,(r===2||r===9||r===3||r===6)&&(r=Pt.current,r!==null&&r.tag===13&&(r.flags|=16384))),rm(t,e)):Ll(t)}function Ll(e){var t=e;do{if((t.flags&32768)!==0){rm(t,Ta);return}e=t.return;var a=Ly(t.alternate,t,Zn);if(a!==null){pe=a;return}if(t=t.sibling,t!==null){pe=t;return}pe=t=e}while(t!==null);Qe===0&&(Qe=5)}function rm(e,t){do{var a=zy(e.alternate,e);if(a!==null){a.flags&=32767,pe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){pe=e;return}pe=e=a}while(e!==null);Qe=6,pe=null}function lm(e,t,a,r,o,u,f,y,S){e.cancelPendingCommit=null;do zl();while(ht!==0);if((Re&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(u=t.lanes|t.childLanes,u|=Wo,pi(e,a,u,f,y,S),e===Me&&(pe=Me=null,be=0),Gi=t,Aa=e,Fn=a,lc=u,oc=o,Qf=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Jy(un,function(){return dm(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=U.T,U.T=null,o=V.p,V.p=2,f=Re,Re|=4;try{My(e,t,a)}finally{Re=f,V.p=o,U.T=r}}ht=1,om(),um(),cm()}}function om(){if(ht===1){ht=0;var e=Aa,t=Gi,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=U.T,U.T=null;var r=V.p;V.p=2;var o=Re;Re|=4;try{Pf(t,e);var u=Tc,f=Yh(e.containerInfo),y=u.focusedElem,S=u.selectionRange;if(f!==y&&y&&y.ownerDocument&&Ih(y.ownerDocument.documentElement,y)){if(S!==null&&Jo(y)){var x=S.start,z=S.end;if(z===void 0&&(z=x),"selectionStart"in y)y.selectionStart=x,y.selectionEnd=Math.min(z,y.value.length);else{var B=y.ownerDocument||document,j=B&&B.defaultView||window;if(j.getSelection){var N=j.getSelection(),Z=y.textContent.length,le=Math.min(S.start,Z),Le=S.end===void 0?le:Math.min(S.end,Z);!N.extend&&le>Le&&(f=Le,Le=le,le=f);var C=Kh(y,le),E=Kh(y,Le);if(C&&E&&(N.rangeCount!==1||N.anchorNode!==C.node||N.anchorOffset!==C.offset||N.focusNode!==E.node||N.focusOffset!==E.offset)){var O=B.createRange();O.setStart(C.node,C.offset),N.removeAllRanges(),le>Le?(N.addRange(O),N.extend(E.node,E.offset)):(O.setEnd(E.node,E.offset),N.addRange(O))}}}}for(B=[],N=y;N=N.parentNode;)N.nodeType===1&&B.push({element:N,left:N.scrollLeft,top:N.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<B.length;y++){var M=B[y];M.element.scrollLeft=M.left,M.element.scrollTop=M.top}}Jl=!!Sc,Tc=Sc=null}finally{Re=o,V.p=r,U.T=a}}e.current=t,ht=2}}function um(){if(ht===2){ht=0;var e=Aa,t=Gi,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=U.T,U.T=null;var r=V.p;V.p=2;var o=Re;Re|=4;try{Mf(e,t.alternate,t)}finally{Re=o,V.p=r,U.T=a}}ht=3}}function cm(){if(ht===4||ht===3){ht=0,Xt();var e=Aa,t=Gi,a=Fn,r=Qf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ht=5:(ht=0,Gi=Aa=null,hm(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(ka=null),Dn(a),t=t.stateNode,Oe&&typeof Oe.onCommitFiberRoot=="function")try{Oe.onCommitFiberRoot(la,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=U.T,o=V.p,V.p=2,U.T=null;try{for(var u=e.onRecoverableError,f=0;f<r.length;f++){var y=r[f];u(y.value,{componentStack:y.stack})}}finally{U.T=t,V.p=o}}(Fn&3)!==0&&zl(),Rn(e),o=e.pendingLanes,(a&261930)!==0&&(o&42)!==0?e===uc?er++:(er=0,uc=e):er=0,tr(0)}}function hm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ls(t)))}function zl(){return om(),um(),cm(),dm()}function dm(){if(ht!==5)return!1;var e=Aa,t=lc;lc=0;var a=Dn(Fn),r=U.T,o=V.p;try{V.p=32>a?32:a,U.T=null,a=oc,oc=null;var u=Aa,f=Fn;if(ht=0,Gi=Aa=null,Fn=0,(Re&6)!==0)throw Error(l(331));var y=Re;if(Re|=4,Yf(u.current),Vf(u,u.current,f,a),Re=y,tr(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot=="function")try{Oe.onPostCommitFiberRoot(la,u)}catch{}return!0}finally{V.p=o,U.T=r,hm(e,t)}}function fm(e,t,a){t=Ft(a,t),t=qu(e.stateNode,t,2),e=ba(e,t,2),e!==null&&(Sn(e,2),Rn(e))}function je(e,t,a){if(e.tag===3)fm(e,e,a);else for(;t!==null;){if(t.tag===3){fm(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ka===null||!ka.has(r))){e=Ft(a,e),a=mf(2),r=ba(t,a,2),r!==null&&(gf(a,r,t,e),Sn(r,2),Rn(r));break}}t=t.return}}function dc(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new $y;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(a)||(ic=!0,o.add(a),e=Ky.bind(null,e,t,a),t.then(e,e))}function Ky(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Me===e&&(be&a)===a&&(Qe===4||Qe===3&&(be&62914560)===be&&300>Et()-xl?(Re&2)===0&&Vi(e,0):sc|=a,Pi===be&&(Pi=0)),Rn(e)}function mm(e,t){t===0&&(t=vs()),e=Ya(e,t),e!==null&&(Sn(e,t),Rn(e))}function Iy(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),mm(e,a)}function Yy(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(a=o.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(l(314))}r!==null&&r.delete(t),mm(e,a)}function Jy(e,t){return di(e,t)}var Ml=null,Ii=null,fc=!1,Bl=!1,mc=!1,Ra=0;function Rn(e){e!==Ii&&e.next===null&&(Ii===null?Ml=Ii=e:Ii=Ii.next=e),Bl=!0,fc||(fc=!0,Qy())}function tr(e,t){if(!mc&&Bl){mc=!0;do for(var a=!1,r=Ml;r!==null;){if(e!==0){var o=r.pendingLanes;if(o===0)var u=0;else{var f=r.suspendedLanes,y=r.pingedLanes;u=(1<<31-gt(42|e)+1)-1,u&=o&~(f&~y),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,vm(r,u))}else u=be,u=$a(r,r===Me?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(u&3)===0||ua(r,u)||(a=!0,vm(r,u));r=r.next}while(a);mc=!1}}function Xy(){gm()}function gm(){Bl=fc=!1;var e=0;Ra!==0&&rv()&&(e=Ra);for(var t=Et(),a=null,r=Ml;r!==null;){var o=r.next,u=pm(r,t);u===0?(r.next=null,a===null?Ml=o:a.next=o,o===null&&(Ii=a)):(a=r,(e!==0||(u&3)!==0)&&(Bl=!0)),r=o}ht!==0&&ht!==5||tr(e),Ra!==0&&(Ra=0)}function pm(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var f=31-gt(u),y=1<<f,S=o[f];S===-1?((y&a)===0||(y&r)!==0)&&(o[f]=ys(y,t)):S<=t&&(e.expiredLanes|=y),u&=~y}if(t=Me,a=be,a=$a(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(xe===2||xe===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ge(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||ua(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&Ge(r),Dn(a)){case 2:case 8:a=ra;break;case 32:a=un;break;case 268435456:a=Bt;break;default:a=un}return r=ym.bind(null,e),a=di(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&Ge(r),e.callbackPriority=2,e.callbackNode=null,2}function ym(e,t){if(ht!==0&&ht!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(zl()&&e.callbackNode!==a)return null;var r=be;return r=$a(e,e===Me?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Ff(e,r,t),pm(e,Et()),e.callbackNode!=null&&e.callbackNode===a?ym.bind(null,e):null)}function vm(e,t){if(zl())return null;Ff(e,t,!0)}function Qy(){ov(function(){(Re&6)!==0?di(fi,Xy):gm()})}function gc(){if(Ra===0){var e=ji;e===0&&(e=oa,oa<<=1,(oa&261888)===0&&(oa=256)),Ra=e}return Ra}function bm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ir(""+e)}function _m(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Zy(e,t,a,r,o){if(t==="submit"&&a&&a.stateNode===o){var u=bm((o[_t]||null).action),f=r.submitter;f&&(t=(t=f[_t]||null)?bm(t.formAction):f.getAttribute("formAction"),t!==null&&(u=t,f=null));var y=new Qr("action","action",null,r,o);e.push({event:y,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Ra!==0){var S=f?_m(o,f):new FormData(o);Lu(a,{pending:!0,data:S,method:o.method,action:u},null,S)}}else typeof u=="function"&&(y.preventDefault(),S=f?_m(o,f):new FormData(o),Lu(a,{pending:!0,data:S,method:o.method,action:u},u,S))},currentTarget:o}]})}}for(var pc=0;pc<Fo.length;pc++){var yc=Fo[pc],Fy=yc.toLowerCase(),Wy=yc[0].toUpperCase()+yc.slice(1);fn(Fy,"on"+Wy)}fn(Qh,"onAnimationEnd"),fn(Zh,"onAnimationIteration"),fn(Fh,"onAnimationStart"),fn("dblclick","onDoubleClick"),fn("focusin","onFocus"),fn("focusout","onBlur"),fn(gy,"onTransitionRun"),fn(py,"onTransitionStart"),fn(yy,"onTransitionCancel"),fn(Wh,"onTransitionEnd"),Tn("onMouseEnter",["mouseout","mouseover"]),Tn("onMouseLeave",["mouseout","mouseover"]),Tn("onPointerEnter",["pointerout","pointerover"]),Tn("onPointerLeave",["pointerout","pointerover"]),Qt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nr="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(" "),ev=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(nr));function wm(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],o=r.event;r=r.listeners;e:{var u=void 0;if(t)for(var f=r.length-1;0<=f;f--){var y=r[f],S=y.instance,x=y.currentTarget;if(y=y.listener,S!==u&&o.isPropagationStopped())break e;u=y,o.currentTarget=x;try{u(o)}catch(z){Wr(z)}o.currentTarget=null,u=S}else for(f=0;f<r.length;f++){if(y=r[f],S=y.instance,x=y.currentTarget,y=y.listener,S!==u&&o.isPropagationStopped())break e;u=y,o.currentTarget=x;try{u(o)}catch(z){Wr(z)}o.currentTarget=null,u=S}}}}function ye(e,t){var a=t[hn];a===void 0&&(a=t[hn]=new Set);var r=e+"__bubble";a.has(r)||(Sm(t,e,2,!1),a.add(r))}function vc(e,t,a){var r=0;t&&(r|=4),Sm(a,e,r,t)}var Hl="_reactListening"+Math.random().toString(36).slice(2);function bc(e){if(!e[Hl]){e[Hl]=!0,$r.forEach(function(a){a!=="selectionchange"&&(ev.has(a)||vc(a,!1,e),vc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hl]||(t[Hl]=!0,vc("selectionchange",!1,t))}}function Sm(e,t,a,r){switch(Zm(t)){case 2:var o=Rv;break;case 8:o=Ov;break;default:o=Uc}a=o.bind(null,t,a,e),o=void 0,!Ho||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,a,{capture:!0,passive:o}):e.addEventListener(t,a,!0):o!==void 0?e.addEventListener(t,a,{passive:o}):e.addEventListener(t,a,!1)}function _c(e,t,a,r,o){var u=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var f=r.tag;if(f===3||f===4){var y=r.stateNode.containerInfo;if(y===o)break;if(f===4)for(f=r.return;f!==null;){var S=f.tag;if((S===3||S===4)&&f.stateNode.containerInfo===o)return;f=f.return}for(;y!==null;){if(f=Ln(y),f===null)return;if(S=f.tag,S===5||S===6||S===26||S===27){r=u=f;continue e}y=y.parentNode}}r=r.return}Ah(function(){var x=u,z=Mo(a),B=[];e:{var j=ed.get(e);if(j!==void 0){var N=Qr,Z=e;switch(e){case"keypress":if(Jr(a)===0)break e;case"keydown":case"keyup":N=Yp;break;case"focusin":Z="focus",N=Go;break;case"focusout":Z="blur",N=Go;break;case"beforeblur":case"afterblur":N=Go;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":N=Oh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":N=Lp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":N=Qp;break;case Qh:case Zh:case Fh:N=Bp;break;case Wh:N=Fp;break;case"scroll":case"scrollend":N=Dp;break;case"wheel":N=ey;break;case"copy":case"cut":case"paste":N=$p;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":N=jh;break;case"toggle":case"beforetoggle":N=ny}var le=(t&4)!==0,Le=!le&&(e==="scroll"||e==="scrollend"),C=le?j!==null?j+"Capture":null:j;le=[];for(var E=x,O;E!==null;){var M=E;if(O=M.stateNode,M=M.tag,M!==5&&M!==26&&M!==27||O===null||C===null||(M=Es(E,C),M!=null&&le.push(ar(E,M,O))),Le)break;E=E.return}0<le.length&&(j=new N(j,Z,null,a,z),B.push({event:j,listeners:le}))}}if((t&7)===0){e:{if(j=e==="mouseover"||e==="pointerover",N=e==="mouseout"||e==="pointerout",j&&a!==zo&&(Z=a.relatedTarget||a.fromElement)&&(Ln(Z)||Z[Un]))break e;if((N||j)&&(j=z.window===z?z:(j=z.ownerDocument)?j.defaultView||j.parentWindow:window,N?(Z=a.relatedTarget||a.toElement,N=x,Z=Z?Ln(Z):null,Z!==null&&(Le=h(Z),le=Z.tag,Z!==Le||le!==5&&le!==27&&le!==6)&&(Z=null)):(N=null,Z=x),N!==Z)){if(le=Oh,M="onMouseLeave",C="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(le=jh,M="onPointerLeave",C="onPointerEnter",E="pointer"),Le=N==null?j:qa(N),O=Z==null?j:qa(Z),j=new le(M,E+"leave",N,a,z),j.target=Le,j.relatedTarget=O,M=null,Ln(z)===x&&(le=new le(C,E+"enter",Z,a,z),le.target=O,le.relatedTarget=Le,M=le),Le=M,N&&Z)t:{for(le=tv,C=N,E=Z,O=0,M=C;M;M=le(M))O++;M=0;for(var ie=E;ie;ie=le(ie))M++;for(;0<O-M;)C=le(C),O--;for(;0<M-O;)E=le(E),M--;for(;O--;){if(C===E||E!==null&&C===E.alternate){le=C;break t}C=le(C),E=le(E)}le=null}else le=null;N!==null&&Tm(B,j,N,le,!1),Z!==null&&Le!==null&&Tm(B,Le,Z,le,!0)}}e:{if(j=x?qa(x):window,N=j.nodeName&&j.nodeName.toLowerCase(),N==="select"||N==="input"&&j.type==="file")var Ae=Hh;else if(Mh(j))if($h)Ae=dy;else{Ae=cy;var ee=uy}else N=j.nodeName,!N||N.toLowerCase()!=="input"||j.type!=="checkbox"&&j.type!=="radio"?x&&Lo(x.elementType)&&(Ae=Hh):Ae=hy;if(Ae&&(Ae=Ae(e,x))){Bh(B,Ae,a,z);break e}ee&&ee(e,j,x),e==="focusout"&&x&&j.type==="number"&&x.memoizedProps.value!=null&&Je(j,"number",j.value)}switch(ee=x?qa(x):window,e){case"focusin":(Mh(ee)||ee.contentEditable==="true")&&(Ti=ee,Xo=x,Ns=null);break;case"focusout":Ns=Xo=Ti=null;break;case"mousedown":Qo=!0;break;case"contextmenu":case"mouseup":case"dragend":Qo=!1,Jh(B,a,z);break;case"selectionchange":if(my)break;case"keydown":case"keyup":Jh(B,a,z)}var me;if(Ko)e:{switch(e){case"compositionstart":var _e="onCompositionStart";break e;case"compositionend":_e="onCompositionEnd";break e;case"compositionupdate":_e="onCompositionUpdate";break e}_e=void 0}else Si?Lh(e,a)&&(_e="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(_e="onCompositionStart");_e&&(Nh&&a.locale!=="ko"&&(Si||_e!=="onCompositionStart"?_e==="onCompositionEnd"&&Si&&(me=Ch()):(da=z,$o="value"in da?da.value:da.textContent,Si=!0)),ee=$l(x,_e),0<ee.length&&(_e=new xh(_e,e,null,a,z),B.push({event:_e,listeners:ee}),me?_e.data=me:(me=zh(a),me!==null&&(_e.data=me)))),(me=iy?sy(e,a):ry(e,a))&&(_e=$l(x,"onBeforeInput"),0<_e.length&&(ee=new xh("onBeforeInput","beforeinput",null,a,z),B.push({event:ee,listeners:_e}),ee.data=me)),Zy(B,e,x,a,z)}wm(B,t)})}function ar(e,t,a){return{instance:e,listener:t,currentTarget:a}}function $l(e,t){for(var a=t+"Capture",r=[];e!==null;){var o=e,u=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||u===null||(o=Es(e,a),o!=null&&r.unshift(ar(e,o,u)),o=Es(e,t),o!=null&&r.push(ar(e,o,u))),e.tag===3)return r;e=e.return}return[]}function tv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Tm(e,t,a,r,o){for(var u=t._reactName,f=[];a!==null&&a!==r;){var y=a,S=y.alternate,x=y.stateNode;if(y=y.tag,S!==null&&S===r)break;y!==5&&y!==26&&y!==27||x===null||(S=x,o?(x=Es(a,u),x!=null&&f.unshift(ar(a,x,S))):o||(x=Es(a,u),x!=null&&f.push(ar(a,x,S)))),a=a.return}f.length!==0&&e.push({event:t,listeners:f})}var nv=/\r\n?/g,av=/\u0000|\uFFFD/g;function Em(e){return(typeof e=="string"?e:""+e).replace(nv,`
|
|
9
|
-
`).replace(av,"")}function km(e,t){return t=Em(t),Em(e)===t}function Ue(e,t,a,r,o,u){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||En(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&En(e,""+r);break;case"className":Ga(e,"class",r);break;case"tabIndex":Ga(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Ga(e,a,r);break;case"style":Eh(e,r,u);break;case"data":if(t!=="object"){Ga(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Ir(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.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 u=="function"&&(a==="formAction"?(t!=="input"&&Ue(e,t,"name",o.name,o,null),Ue(e,t,"formEncType",o.formEncType,o,null),Ue(e,t,"formMethod",o.formMethod,o,null),Ue(e,t,"formTarget",o.formTarget,o,null)):(Ue(e,t,"encType",o.encType,o,null),Ue(e,t,"method",o.method,o,null),Ue(e,t,"target",o.target,o,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Ir(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=Mn);break;case"onScroll":r!=null&&ye("scroll",e);break;case"onScrollEnd":r!=null&&ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(l(61));if(a=r.__html,a!=null){if(o.children!=null)throw Error(l(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=Ir(""+r),e.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":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":ye("beforetoggle",e),ye("toggle",e),Pa(e,"popover",r);break;case"xlinkActuate":Ht(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Ht(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Ht(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Ht(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Ht(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Ht(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Pa(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=jp.get(a)||a,Pa(e,a,r))}}function wc(e,t,a,r,o,u){switch(a){case"style":Eh(e,r,u);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(l(61));if(a=r.__html,a!=null){if(o.children!=null)throw Error(l(60));e.innerHTML=a}}break;case"children":typeof r=="string"?En(e,r):(typeof r=="number"||typeof r=="bigint")&&En(e,""+r);break;case"onScroll":r!=null&&ye("scroll",e);break;case"onScrollEnd":r!=null&&ye("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Mn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wt.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(o=a.endsWith("Capture"),t=a.slice(2,o?a.length-7:void 0),u=e[_t]||null,u=u!=null?u[a]:null,typeof u=="function"&&e.removeEventListener(t,u,o),typeof r=="function")){typeof u!="function"&&u!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,o);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):Pa(e,a,r)}}}function bt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ye("error",e),ye("load",e);var r=!1,o=!1,u;for(u in a)if(a.hasOwnProperty(u)){var f=a[u];if(f!=null)switch(u){case"src":r=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Ue(e,t,u,f,a,null)}}o&&Ue(e,t,"srcSet",a.srcSet,a,null),r&&Ue(e,t,"src",a.src,a,null);return;case"input":ye("invalid",e);var y=u=f=o=null,S=null,x=null;for(r in a)if(a.hasOwnProperty(r)){var z=a[r];if(z!=null)switch(r){case"name":o=z;break;case"type":f=z;break;case"checked":S=z;break;case"defaultChecked":x=z;break;case"value":u=z;break;case"defaultValue":y=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(l(137,t));break;default:Ue(e,t,r,z,a,null)}}Ot(e,u,y,S,x,f,o,!1);return;case"select":ye("invalid",e),r=f=u=null;for(o in a)if(a.hasOwnProperty(o)&&(y=a[o],y!=null))switch(o){case"value":u=y;break;case"defaultValue":f=y;break;case"multiple":r=y;default:Ue(e,t,o,y,a,null)}t=u,a=f,e.multiple=!!r,t!=null?Fe(e,!!r,t,!1):a!=null&&Fe(e,!!r,a,!0);return;case"textarea":ye("invalid",e),u=o=r=null;for(f in a)if(a.hasOwnProperty(f)&&(y=a[f],y!=null))switch(f){case"value":r=y;break;case"defaultValue":o=y;break;case"children":u=y;break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(l(91));break;default:Ue(e,t,f,y,a,null)}Vr(e,r,o,u);return;case"option":for(S in a)a.hasOwnProperty(S)&&(r=a[S],r!=null)&&(S==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Ue(e,t,S,r,a,null));return;case"dialog":ye("beforetoggle",e),ye("toggle",e),ye("cancel",e),ye("close",e);break;case"iframe":case"object":ye("load",e);break;case"video":case"audio":for(r=0;r<nr.length;r++)ye(nr[r],e);break;case"image":ye("error",e),ye("load",e);break;case"details":ye("toggle",e);break;case"embed":case"source":case"link":ye("error",e),ye("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(x in a)if(a.hasOwnProperty(x)&&(r=a[x],r!=null))switch(x){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Ue(e,t,x,r,a,null)}return;default:if(Lo(t)){for(z in a)a.hasOwnProperty(z)&&(r=a[z],r!==void 0&&wc(e,t,z,r,a,void 0));return}}for(y in a)a.hasOwnProperty(y)&&(r=a[y],r!=null&&Ue(e,t,y,r,a,null))}function iv(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,u=null,f=null,y=null,S=null,x=null,z=null;for(N in a){var B=a[N];if(a.hasOwnProperty(N)&&B!=null)switch(N){case"checked":break;case"value":break;case"defaultValue":S=B;default:r.hasOwnProperty(N)||Ue(e,t,N,null,r,B)}}for(var j in r){var N=r[j];if(B=a[j],r.hasOwnProperty(j)&&(N!=null||B!=null))switch(j){case"type":u=N;break;case"name":o=N;break;case"checked":x=N;break;case"defaultChecked":z=N;break;case"value":f=N;break;case"defaultValue":y=N;break;case"children":case"dangerouslySetInnerHTML":if(N!=null)throw Error(l(137,t));break;default:N!==B&&Ue(e,t,j,N,r,B)}}Ne(e,f,y,S,x,z,u,o);return;case"select":N=f=y=j=null;for(u in a)if(S=a[u],a.hasOwnProperty(u)&&S!=null)switch(u){case"value":break;case"multiple":N=S;default:r.hasOwnProperty(u)||Ue(e,t,u,null,r,S)}for(o in r)if(u=r[o],S=a[o],r.hasOwnProperty(o)&&(u!=null||S!=null))switch(o){case"value":j=u;break;case"defaultValue":y=u;break;case"multiple":f=u;default:u!==S&&Ue(e,t,o,u,r,S)}t=y,a=f,r=N,j!=null?Fe(e,!!a,j,!1):!!r!=!!a&&(t!=null?Fe(e,!!a,t,!0):Fe(e,!!a,a?[]:"",!1));return;case"textarea":N=j=null;for(y in a)if(o=a[y],a.hasOwnProperty(y)&&o!=null&&!r.hasOwnProperty(y))switch(y){case"value":break;case"children":break;default:Ue(e,t,y,null,r,o)}for(f in r)if(o=r[f],u=a[f],r.hasOwnProperty(f)&&(o!=null||u!=null))switch(f){case"value":j=o;break;case"defaultValue":N=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(l(91));break;default:o!==u&&Ue(e,t,f,o,r,u)}Gr(e,j,N);return;case"option":for(var Z in a)j=a[Z],a.hasOwnProperty(Z)&&j!=null&&!r.hasOwnProperty(Z)&&(Z==="selected"?e.selected=!1:Ue(e,t,Z,null,r,j));for(S in r)j=r[S],N=a[S],r.hasOwnProperty(S)&&j!==N&&(j!=null||N!=null)&&(S==="selected"?e.selected=j&&typeof j!="function"&&typeof j!="symbol":Ue(e,t,S,j,r,N));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 le in a)j=a[le],a.hasOwnProperty(le)&&j!=null&&!r.hasOwnProperty(le)&&Ue(e,t,le,null,r,j);for(x in r)if(j=r[x],N=a[x],r.hasOwnProperty(x)&&j!==N&&(j!=null||N!=null))switch(x){case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(l(137,t));break;default:Ue(e,t,x,j,r,N)}return;default:if(Lo(t)){for(var Le in a)j=a[Le],a.hasOwnProperty(Le)&&j!==void 0&&!r.hasOwnProperty(Le)&&wc(e,t,Le,void 0,r,j);for(z in r)j=r[z],N=a[z],!r.hasOwnProperty(z)||j===N||j===void 0&&N===void 0||wc(e,t,z,j,r,N);return}}for(var C in a)j=a[C],a.hasOwnProperty(C)&&j!=null&&!r.hasOwnProperty(C)&&Ue(e,t,C,null,r,j);for(B in r)j=r[B],N=a[B],!r.hasOwnProperty(B)||j===N||j==null&&N==null||Ue(e,t,B,j,r,N)}function Am(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function sv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var o=a[r],u=o.transferSize,f=o.initiatorType,y=o.duration;if(u&&y&&Am(f)){for(f=0,y=o.responseEnd,r+=1;r<a.length;r++){var S=a[r],x=S.startTime;if(x>y)break;var z=S.transferSize,B=S.initiatorType;z&&Am(B)&&(S=S.responseEnd,f+=z*(S<y?1:(y-x)/(S-x)))}if(--r,t+=8*(u+f)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Sc=null,Tc=null;function ql(e){return e.nodeType===9?e:e.ownerDocument}function Cm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Rm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Ec(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var kc=null;function rv(){var e=window.event;return e&&e.type==="popstate"?e===kc?!1:(kc=e,!0):(kc=null,!1)}var Om=typeof setTimeout=="function"?setTimeout:void 0,lv=typeof clearTimeout=="function"?clearTimeout:void 0,xm=typeof Promise=="function"?Promise:void 0,ov=typeof queueMicrotask=="function"?queueMicrotask:typeof xm<"u"?function(e){return xm.resolve(null).then(e).catch(uv)}:Om;function uv(e){setTimeout(function(){throw e})}function Oa(e){return e==="head"}function jm(e,t){var a=t,r=0;do{var o=a.nextSibling;if(e.removeChild(a),o&&o.nodeType===8)if(a=o.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(o),Qi(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")ir(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ir(a);for(var u=a.firstChild;u;){var f=u.nextSibling,y=u.nodeName;u[ha]||y==="SCRIPT"||y==="STYLE"||y==="LINK"&&u.rel.toLowerCase()==="stylesheet"||a.removeChild(u),u=f}}else a==="body"&&ir(e.ownerDocument.body);a=o}while(a);Qi(t)}function Nm(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function Ac(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Ac(a),vi(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function cv(e,t,a,r){for(;e.nodeType===1;){var o=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[ha])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=an(e.nextSibling),e===null)break}return null}function hv(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=an(e.nextSibling),e===null))return null;return e}function Dm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=an(e.nextSibling),e===null))return null;return e}function Cc(e){return e.data==="$?"||e.data==="$~"}function Rc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function dv(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function an(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Oc=null;function Um(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return an(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Lm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function zm(e,t,a){switch(t=ql(a),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function ir(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);vi(e)}var sn=new Map,Mm=new Set;function Pl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Wn=V.d;V.d={f:fv,r:mv,D:gv,C:pv,L:yv,m:vv,X:_v,S:bv,M:wv};function fv(){var e=Wn.f(),t=Dl();return e||t}function mv(e){var t=zn(e);t!==null&&t.tag===5&&t.type==="form"?Wd(t):Wn.r(e)}var Yi=typeof document>"u"?null:document;function Bm(e,t,a){var r=Yi;if(r&&typeof t=="string"&&t){var o=se(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof a=="string"&&(o+='[crossorigin="'+a+'"]'),Mm.has(o)||(Mm.add(o),e={rel:e,crossOrigin:a,href:t},r.querySelector(o)===null&&(t=r.createElement("link"),bt(t,"link",e),nt(t),r.head.appendChild(t)))}}function gv(e){Wn.D(e),Bm("dns-prefetch",e,null)}function pv(e,t){Wn.C(e,t),Bm("preconnect",e,t)}function yv(e,t,a){Wn.L(e,t,a);var r=Yi;if(r&&e&&t){var o='link[rel="preload"][as="'+se(t)+'"]';t==="image"&&a&&a.imageSrcSet?(o+='[imagesrcset="'+se(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(o+='[imagesizes="'+se(a.imageSizes)+'"]')):o+='[href="'+se(e)+'"]';var u=o;switch(t){case"style":u=Ji(e);break;case"script":u=Xi(e)}sn.has(u)||(e=b({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),sn.set(u,e),r.querySelector(o)!==null||t==="style"&&r.querySelector(sr(u))||t==="script"&&r.querySelector(rr(u))||(t=r.createElement("link"),bt(t,"link",e),nt(t),r.head.appendChild(t)))}}function vv(e,t){Wn.m(e,t);var a=Yi;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+se(r)+'"][href="'+se(e)+'"]',u=o;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Xi(e)}if(!sn.has(u)&&(e=b({rel:"modulepreload",href:e},t),sn.set(u,e),a.querySelector(o)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(rr(u)))return}r=a.createElement("link"),bt(r,"link",e),nt(r),a.head.appendChild(r)}}}function bv(e,t,a){Wn.S(e,t,a);var r=Yi;if(r&&e){var o=dn(r).hoistableStyles,u=Ji(e);t=t||"default";var f=o.get(u);if(!f){var y={loading:0,preload:null};if(f=r.querySelector(sr(u)))y.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},a),(a=sn.get(u))&&xc(e,a);var S=f=r.createElement("link");nt(S),bt(S,"link",e),S._p=new Promise(function(x,z){S.onload=x,S.onerror=z}),S.addEventListener("load",function(){y.loading|=1}),S.addEventListener("error",function(){y.loading|=2}),y.loading|=4,Gl(f,t,r)}f={type:"stylesheet",instance:f,count:1,state:y},o.set(u,f)}}}function _v(e,t){Wn.X(e,t);var a=Yi;if(a&&e){var r=dn(a).hoistableScripts,o=Xi(e),u=r.get(o);u||(u=a.querySelector(rr(o)),u||(e=b({src:e,async:!0},t),(t=sn.get(o))&&jc(e,t),u=a.createElement("script"),nt(u),bt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(o,u))}}function wv(e,t){Wn.M(e,t);var a=Yi;if(a&&e){var r=dn(a).hoistableScripts,o=Xi(e),u=r.get(o);u||(u=a.querySelector(rr(o)),u||(e=b({src:e,async:!0,type:"module"},t),(t=sn.get(o))&&jc(e,t),u=a.createElement("script"),nt(u),bt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(o,u))}}function Hm(e,t,a,r){var o=(o=de.current)?Pl(o):null;if(!o)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Ji(a.href),a=dn(o).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Ji(a.href);var u=dn(o).hoistableStyles,f=u.get(e);if(f||(o=o.ownerDocument||o,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,f),(u=o.querySelector(sr(e)))&&!u._p&&(f.instance=u,f.state.loading=5),sn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},sn.set(e,a),u||Sv(o,e,a,f.state))),t&&r===null)throw Error(l(528,""));return f}if(t&&r!==null)throw Error(l(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Xi(a),a=dn(o).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function Ji(e){return'href="'+se(e)+'"'}function sr(e){return'link[rel="stylesheet"]['+e+"]"}function $m(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function Sv(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),bt(t,"link",a),nt(t),e.head.appendChild(t))}function Xi(e){return'[src="'+se(e)+'"]'}function rr(e){return"script[async]"+e}function qm(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+se(a.href)+'"]');if(r)return t.instance=r,nt(r),r;var o=b({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),nt(r),bt(r,"style",o),Gl(r,a.precedence,e),t.instance=r;case"stylesheet":o=Ji(a.href);var u=e.querySelector(sr(o));if(u)return t.state.loading|=4,t.instance=u,nt(u),u;r=$m(a),(o=sn.get(o))&&xc(r,o),u=(e.ownerDocument||e).createElement("link"),nt(u);var f=u;return f._p=new Promise(function(y,S){f.onload=y,f.onerror=S}),bt(u,"link",r),t.state.loading|=4,Gl(u,a.precedence,e),t.instance=u;case"script":return u=Xi(a.src),(o=e.querySelector(rr(u)))?(t.instance=o,nt(o),o):(r=a,(o=sn.get(u))&&(r=b({},a),jc(r,o)),e=e.ownerDocument||e,o=e.createElement("script"),nt(o),bt(o,"link",r),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Gl(r,a.precedence,e));return t.instance}function Gl(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=r.length?r[r.length-1]:null,u=o,f=0;f<r.length;f++){var y=r[f];if(y.dataset.precedence===t)u=y;else if(u!==o)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function xc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function jc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Vl=null;function Pm(e,t,a){if(Vl===null){var r=new Map,o=Vl=new Map;o.set(a,r)}else o=Vl,r=o.get(a),r||(r=new Map,o.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),o=0;o<a.length;o++){var u=a[o];if(!(u[ha]||u[ct]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var f=u.getAttribute(t)||"";f=e+f;var y=r.get(f);y?y.push(u):r.set(f,[u])}}return r}function Gm(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Tv(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Vm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ev(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var o=Ji(r.href),u=t.querySelector(sr(o));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Kl.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=u,nt(u);return}u=t.ownerDocument||t,r=$m(r),(o=sn.get(o))&&xc(r,o),u=u.createElement("link"),nt(u);var f=u;f._p=new Promise(function(y,S){f.onload=y,f.onerror=S}),bt(u,"link",r),a.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Kl.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Nc=0;function kv(e,t){return e.stylesheets&&e.count===0&&Yl(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Yl(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&Nc===0&&(Nc=62500*sv());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Yl(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>Nc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}function Kl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Il=null;function Yl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Il=new Map,t.forEach(Av,e),Il=null,Kl.call(e))}function Av(e,t){if(!(t.state.loading&4)){var a=Il.get(e);if(a)var r=a.get(null);else{a=new Map,Il.set(e,a);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<o.length;u++){var f=o[u];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(a.set(f.dataset.precedence,f),r=f)}r&&a.set(null,r)}o=t.instance,f=o.getAttribute("data-precedence"),u=a.get(f)||r,u===r&&a.set(null,o),a.set(f,o),this.count++,r=Kl.bind(this),o.addEventListener("load",r),o.addEventListener("error",r),u?u.parentNode.insertBefore(o,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var lr={$$typeof:P,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function Cv(e,t,a,r,o,u,f,y,S){this.tag=1,this.containerInfo=e,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=bs(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bs(0),this.hiddenUpdates=bs(null),this.identifierPrefix=r,this.onUncaughtError=o,this.onCaughtError=u,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function Km(e,t,a,r,o,u,f,y,S,x,z,B){return e=new Cv(e,t,a,f,S,x,z,B,y),t=1,u===!0&&(t|=24),u=qt(3,null,null,t),e.current=u,u.stateNode=e,t=hu(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:r,isDehydrated:a,cache:t},gu(u),e}function Im(e){return e?(e=Ai,e):Ai}function Ym(e,t,a,r,o,u){o=Im(o),r.context===null?r.context=o:r.pendingContext=o,r=va(t),r.payload={element:a},u=u===void 0?null:u,u!==null&&(r.callback=u),a=ba(e,r,t),a!==null&&(Lt(a,e,t),Hs(a,e,t))}function Jm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Dc(e,t){Jm(e,t),(e=e.alternate)&&Jm(e,t)}function Xm(e){if(e.tag===13||e.tag===31){var t=Ya(e,67108864);t!==null&&Lt(t,e,67108864),Dc(e,67108864)}}function Qm(e){if(e.tag===13||e.tag===31){var t=It();t=yi(t);var a=Ya(e,t);a!==null&&Lt(a,e,t),Dc(e,t)}}var Jl=!0;function Rv(e,t,a,r){var o=U.T;U.T=null;var u=V.p;try{V.p=2,Uc(e,t,a,r)}finally{V.p=u,U.T=o}}function Ov(e,t,a,r){var o=U.T;U.T=null;var u=V.p;try{V.p=8,Uc(e,t,a,r)}finally{V.p=u,U.T=o}}function Uc(e,t,a,r){if(Jl){var o=Lc(r);if(o===null)_c(e,t,r,Xl,a),Fm(e,r);else if(jv(o,e,t,a,r))r.stopPropagation();else if(Fm(e,r),t&4&&-1<xv.indexOf(e)){for(;o!==null;){var u=zn(o);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var f=wn(u.pendingLanes);if(f!==0){var y=u;for(y.pendingLanes|=2,y.entangledLanes|=2;f;){var S=1<<31-gt(f);y.entanglements[1]|=S,f&=~S}Rn(u),(Re&6)===0&&(jl=Et()+500,tr(0))}}break;case 31:case 13:y=Ya(u,2),y!==null&&Lt(y,u,2),Dl(),Dc(u,2)}if(u=Lc(r),u===null&&_c(e,t,r,Xl,a),u===o)break;o=u}o!==null&&r.stopPropagation()}else _c(e,t,r,null,a)}}function Lc(e){return e=Mo(e),zc(e)}var Xl=null;function zc(e){if(Xl=null,e=Ln(e),e!==null){var t=h(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=d(t),e!==null)return e;e=null}else if(a===31){if(e=m(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Xl=e,null}function Zm(e){switch(e){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(zr()){case fi:return 2;case ra:return 8;case un:case oe:return 32;case Bt:return 268435456;default:return 32}default:return 32}}var Mc=!1,xa=null,ja=null,Na=null,or=new Map,ur=new Map,Da=[],xv="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 Fm(e,t){switch(e){case"focusin":case"focusout":xa=null;break;case"dragenter":case"dragleave":ja=null;break;case"mouseover":case"mouseout":Na=null;break;case"pointerover":case"pointerout":or.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ur.delete(t.pointerId)}}function cr(e,t,a,r,o,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:u,targetContainers:[o]},t!==null&&(t=zn(t),t!==null&&Xm(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function jv(e,t,a,r,o){switch(t){case"focusin":return xa=cr(xa,e,t,a,r,o),!0;case"dragenter":return ja=cr(ja,e,t,a,r,o),!0;case"mouseover":return Na=cr(Na,e,t,a,r,o),!0;case"pointerover":var u=o.pointerId;return or.set(u,cr(or.get(u)||null,e,t,a,r,o)),!0;case"gotpointercapture":return u=o.pointerId,ur.set(u,cr(ur.get(u)||null,e,t,a,r,o)),!0}return!1}function Wm(e){var t=Ln(e.target);if(t!==null){var a=h(t);if(a!==null){if(t=a.tag,t===13){if(t=d(a),t!==null){e.blockedOn=t,Hr(e.priority,function(){Qm(a)});return}}else if(t===31){if(t=m(a),t!==null){e.blockedOn=t,Hr(e.priority,function(){Qm(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ql(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Lc(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);zo=r,a.target.dispatchEvent(r),zo=null}else return t=zn(a),t!==null&&Xm(t),e.blockedOn=a,!1;t.shift()}return!0}function eg(e,t,a){Ql(e)&&a.delete(t)}function Nv(){Mc=!1,xa!==null&&Ql(xa)&&(xa=null),ja!==null&&Ql(ja)&&(ja=null),Na!==null&&Ql(Na)&&(Na=null),or.forEach(eg),ur.forEach(eg)}function Zl(e,t){e.blockedOn===t&&(e.blockedOn=null,Mc||(Mc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Nv)))}var Fl=null;function tg(e){Fl!==e&&(Fl=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Fl===e&&(Fl=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],o=e[t+2];if(typeof r!="function"){if(zc(r||a)===null)continue;break}var u=zn(a);u!==null&&(e.splice(t,3),t-=3,Lu(u,{pending:!0,data:o,method:a.method,action:r},r,o))}}))}function Qi(e){function t(S){return Zl(S,e)}xa!==null&&Zl(xa,e),ja!==null&&Zl(ja,e),Na!==null&&Zl(Na,e),or.forEach(t),ur.forEach(t);for(var a=0;a<Da.length;a++){var r=Da[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Da.length&&(a=Da[0],a.blockedOn===null);)Wm(a),a.blockedOn===null&&Da.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var o=a[r],u=a[r+1],f=o[_t]||null;if(typeof u=="function")f||tg(a);else if(f){var y=null;if(u&&u.hasAttribute("formAction")){if(o=u,f=u[_t]||null)y=f.formAction;else if(zc(o)!==null)continue}else y=f.action;typeof y=="function"?a[r+1]=y:(a.splice(r,3),r-=3),tg(a)}}}function ng(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(f){return o=f})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function Bc(e){this._internalRoot=e}Wl.prototype.render=Bc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var a=t.current,r=It();Ym(a,r,e,t,null,null)},Wl.prototype.unmount=Bc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ym(e.current,2,null,e,null,null),Dl(),t[Un]=null}};function Wl(e){this._internalRoot=e}Wl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ss();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Da.length&&t!==0&&t<Da[a].priority;a++);Da.splice(a,0,e),a===0&&Wm(e)}};var ag=n.version;if(ag!=="19.2.7")throw Error(l(527,ag,"19.2.7"));V.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=p(t),e=e!==null?_(e):null,e=e===null?null:e.stateNode,e};var Dv={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var eo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eo.isDisabled&&eo.supportsFiber)try{la=eo.inject(Dv),Oe=eo}catch{}}return dr.createRoot=function(e,t){if(!c(e))throw Error(l(299));var a=!1,r="",o=cf,u=hf,f=df;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=Km(e,1,!1,null,null,a,r,null,o,u,f,ng),e[Un]=t.current,bc(e),new Bc(t)},dr.hydrateRoot=function(e,t,a){if(!c(e))throw Error(l(299));var r=!1,o="",u=cf,f=hf,y=df,S=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(o=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(f=a.onCaughtError),a.onRecoverableError!==void 0&&(y=a.onRecoverableError),a.formState!==void 0&&(S=a.formState)),t=Km(e,1,!0,t,a??null,r,o,S,u,f,y,ng),t.context=Im(null),a=t.current,r=It(),r=yi(r),o=va(r),o.callback=null,ba(a,o,r),a=r,t.current.lanes=a,Sn(t,a),Rn(t),e[Un]=t.current,bc(e),new Wl(t)},dr.version="19.2.7",dr}var fg;function Gv(){if(fg)return qc.exports;fg=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(n){console.error(n)}}return i(),qc.exports=Pv(),qc.exports}var Vv=Gv();const Kv=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Iv=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,s,l)=>l?l.toUpperCase():s.toLowerCase()),mg=i=>{const n=Iv(i);return n.charAt(0).toUpperCase()+n.slice(1)},ip=(...i)=>i.filter((n,s,l)=>!!n&&n.trim()!==""&&l.indexOf(n)===s).join(" ").trim(),Yv=i=>{for(const n in i)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var Jv={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Xv=G.forwardRef(({color:i="currentColor",size:n=24,strokeWidth:s=2,absoluteStrokeWidth:l,className:c="",children:h,iconNode:d,...m},g)=>G.createElement("svg",{ref:g,...Jv,width:n,height:n,stroke:i,strokeWidth:l?Number(s)*24/Number(n):s,className:ip("lucide",c),...!h&&!Yv(m)&&{"aria-hidden":"true"},...m},[...d.map(([p,_])=>G.createElement(p,_)),...Array.isArray(h)?h:[h]]));const Be=(i,n)=>{const s=G.forwardRef(({className:l,...c},h)=>G.createElement(Xv,{ref:h,iconNode:n,className:ip(`lucide-${Kv(mg(i))}`,`lucide-${i}`,l),...c}));return s.displayName=mg(i),s};const Qv=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],gg=Be("activity",Qv);const Zv=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Fv=Be("badge-check",Zv);const Wv=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],rh=Be("book-open",Wv);const e0=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],t0=Be("chevron-left",e0);const n0=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],a0=Be("chevron-right",n0);const i0=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],s0=Be("circle-check",i0);const r0=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],to=Be("clipboard",r0);const l0=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],lh=Be("credit-card",l0);const o0=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Kc=Be("database",o0);const u0=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],c0=Be("earth",u0);const h0=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Ic=Be("folder-open",h0);const d0=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],sp=Be("layout-grid",d0);const f0=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],m0=Be("log-in",f0);const g0=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],os=Be("monitor",g0);const p0=[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]],oh=Be("mouse-pointer-2",p0);const y0=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Yc=Be("play",y0);const v0=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],b0=Be("power",v0);const _0=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],w0=Be("rotate-ccw",_0);const S0=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Jc=Be("send",S0);const T0=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Xc=Be("server",T0);const E0=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],k0=Be("settings",E0);const A0=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Qc=Be("shield-check",A0);const C0=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],R0=Be("star",C0);const O0=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],is=Be("terminal",O0);const x0=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],pg=Be("volume-2",x0);const j0=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],yg=Be("wifi",j0);const N0=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],D0=Be("x",N0);function To(i,n){var s={};for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&n.indexOf(l)<0&&(s[l]=i[l]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,l=Object.getOwnPropertySymbols(i);c<l.length;c++)n.indexOf(l[c])<0&&Object.prototype.propertyIsEnumerable.call(i,l[c])&&(s[l[c]]=i[l[c]]);return s}function U0(i,n,s,l){function c(h){return h instanceof s?h:new s(function(d){d(h)})}return new(s||(s=Promise))(function(h,d){function m(_){try{p(l.next(_))}catch(b){d(b)}}function g(_){try{p(l.throw(_))}catch(b){d(b)}}function p(_){_.done?h(_.value):c(_.value).then(m,g)}p((l=l.apply(i,n||[])).next())})}const L0=i=>i?(...n)=>i(...n):(...n)=>fetch(...n);class Sh extends Error{constructor(n,s="FunctionsError",l){super(n),this.name=s,this.context=l}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class z0 extends Sh{constructor(n){super("Failed to send a request to the Edge Function","FunctionsFetchError",n)}}class vg extends Sh{constructor(n){super("Relay Error invoking the Edge Function","FunctionsRelayError",n)}}class bg extends Sh{constructor(n){super("Edge Function returned a non-2xx status code","FunctionsHttpError",n)}}var uh;(function(i){i.Any="any",i.ApNortheast1="ap-northeast-1",i.ApNortheast2="ap-northeast-2",i.ApSouth1="ap-south-1",i.ApSoutheast1="ap-southeast-1",i.ApSoutheast2="ap-southeast-2",i.CaCentral1="ca-central-1",i.EuCentral1="eu-central-1",i.EuWest1="eu-west-1",i.EuWest2="eu-west-2",i.EuWest3="eu-west-3",i.SaEast1="sa-east-1",i.UsEast1="us-east-1",i.UsWest1="us-west-1",i.UsWest2="us-west-2"})(uh||(uh={}));class M0{constructor(n,{headers:s={},customFetch:l,region:c=uh.Any}={}){this.url=n,this.headers=s,this.region=c,this.fetch=L0(l)}setAuth(n){this.headers.Authorization=`Bearer ${n}`}invoke(n){return U0(this,arguments,void 0,function*(s,l={}){var c;let h,d;try{const{headers:m,method:g,body:p,signal:_,timeout:b}=l;let T={},{region:w}=l;w||(w=this.region);const R=new URL(`${this.url}/${s}`);w&&w!=="any"&&(T["x-region"]=w,R.searchParams.set("forceFunctionRegion",w));let D;const q=!!m&&Object.keys(m).some(ne=>ne.toLowerCase()==="content-type");p&&!q?typeof Blob<"u"&&p instanceof Blob||p instanceof ArrayBuffer?(T["Content-Type"]="application/octet-stream",D=p):typeof p=="string"?(T["Content-Type"]="text/plain",D=p):typeof FormData<"u"&&p instanceof FormData?D=p:(T["Content-Type"]="application/json",D=JSON.stringify(p)):p&&typeof p!="string"&&!(typeof Blob<"u"&&p instanceof Blob)&&!(p instanceof ArrayBuffer)&&!(typeof FormData<"u"&&p instanceof FormData)?D=JSON.stringify(p):D=p;let $=_;b&&(d=new AbortController,h=setTimeout(()=>d.abort(),b),_?($=d.signal,_.addEventListener("abort",()=>d.abort())):$=d.signal);const H=yield this.fetch(R.toString(),{method:g||"POST",headers:Object.assign(Object.assign(Object.assign({},T),this.headers),m),body:D,signal:$}).catch(ne=>{throw new z0(ne)}),P=H.headers.get("x-relay-error");if(P&&P==="true")throw new vg(H);if(!H.ok)throw new bg(H);let X=((c=H.headers.get("Content-Type"))!==null&&c!==void 0?c:"text/plain").split(";")[0].trim(),ge;return X==="application/json"?ge=yield H.json():X==="application/octet-stream"||X==="application/pdf"?ge=yield H.blob():X==="text/event-stream"?ge=H:X==="multipart/form-data"?ge=yield H.formData():ge=yield H.text(),{data:ge,error:null,response:H}}catch(m){return{data:null,error:m,response:m instanceof bg||m instanceof vg?m.context:void 0}}finally{h&&clearTimeout(h)}})}}const rp=3,_g=i=>Math.min(1e3*2**i,3e4),B0=[520,503],lp=["GET","HEAD","OPTIONS"];var wg=class extends Error{constructor(i){super(i.message),this.name="PostgrestError",this.details=i.details,this.hint=i.hint,this.code=i.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Sg(i,n){return new Promise(s=>{if(n?.aborted){s();return}const l=setTimeout(()=>{n?.removeEventListener("abort",c),s()},i);function c(){clearTimeout(l),s()}n?.addEventListener("abort",c)})}function H0(i,n,s,l){return!(!l||s>=rp||!lp.includes(i)||!B0.includes(n))}var $0=class{constructor(i){var n,s,l,c,h;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=i.method,this.url=i.url,this.headers=new Headers(i.headers),this.schema=i.schema,this.body=i.body,this.shouldThrowOnError=(n=i.shouldThrowOnError)!==null&&n!==void 0?n:!1,this.signal=i.signal,this.isMaybeSingle=(s=i.isMaybeSingle)!==null&&s!==void 0?s:!1,this.shouldStripNulls=(l=i.shouldStripNulls)!==null&&l!==void 0?l:!1,this.urlLengthLimit=(c=i.urlLengthLimit)!==null&&c!==void 0?c:8e3,this.retryEnabled=(h=i.retry)!==null&&h!==void 0?h:!0,i.fetch?this.fetch=i.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(i,n){return this.headers=new Headers(this.headers),this.headers.set(i,n),this}retry(i){return this.retryEnabled=i,this}then(i,n){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 d=this.headers.get("Accept");d==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!d||d==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const l=this.fetch;let h=(async()=>{let d=0;for(;;){const p={};s.headers.forEach((b,T)=>{p[T]=b}),d>0&&(p["X-Retry-Count"]=String(d));let _;try{_=await l(s.url.toString(),{method:s.method,headers:p,body:JSON.stringify(s.body,(b,T)=>typeof T=="bigint"?T.toString():T),signal:s.signal})}catch(b){if(b?.name==="AbortError"||b?.code==="ABORT_ERR"||!lp.includes(s.method))throw b;if(s.retryEnabled&&d<rp){const T=_g(d);d++,await Sg(T,s.signal);continue}throw b}if(H0(s.method,_.status,d,s.retryEnabled)){var m,g;const b=(m=(g=_.headers)===null||g===void 0?void 0:g.get("Retry-After"))!==null&&m!==void 0?m:null,T=b!==null?Math.max(0,parseInt(b,10)||0)*1e3:_g(d);await _.text(),d++,await Sg(T,s.signal);continue}return await s.processResponse(_)}})();return this.shouldThrowOnError||(h=h.catch(d=>{var m;let g="",p="",_="";const b=d?.cause;if(b){var T,w,R,D;const H=(T=b?.message)!==null&&T!==void 0?T:"",P=(w=b?.code)!==null&&w!==void 0?w:"";g=`${(R=d?.name)!==null&&R!==void 0?R:"FetchError"}: ${d?.message}`,g+=`
|
|
10
|
-
|
|
11
|
-
Caused by: ${(D=b?.name)!==null&&D!==void 0?D:"Error"}: ${H}`,P&&(g+=` (${P})`),b?.stack&&(g+=`
|
|
12
|
-
${b.stack}`)}else{var q;g=(q=d?.stack)!==null&&q!==void 0?q:""}const $=this.url.toString().length;return d?.name==="AbortError"||d?.code==="ABORT_ERR"?(_="",p="Request was aborted (timeout or manual cancellation)",$>this.urlLengthLimit&&(p+=`. Note: Your request URL is ${$} 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.`)):(b?.name==="HeadersOverflowError"||b?.code==="UND_ERR_HEADERS_OVERFLOW")&&(_="",p="HTTP headers exceeded server limits (typically 16KB)",$>this.urlLengthLimit&&(p+=`. Your request URL is ${$} 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:`${(m=d?.name)!==null&&m!==void 0?m:"FetchError"}: ${d?.message}`,details:g,hint:p,code:_},data:null,count:null,status:0,statusText:""}})),h.then(i,n)}async processResponse(i){var n=this;let s=null,l=null,c=null,h=i.status,d=i.statusText;if(i.ok){var m,g;if(n.method!=="HEAD"){var p;const T=await i.text();if(T!=="")if(n.headers.get("Accept")==="text/csv")l=T;else if(n.headers.get("Accept")&&(!((p=n.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text")))l=T;else try{l=JSON.parse(T)}catch{if(s={message:T},l=null,n.shouldThrowOnError)throw new wg({message:T,details:"",hint:"",code:""})}}const _=(m=n.headers.get("Prefer"))===null||m===void 0?void 0:m.match(/count=(exact|planned|estimated)/),b=(g=i.headers.get("content-range"))===null||g===void 0?void 0:g.split("/");_&&b&&b.length>1&&(c=parseInt(b[1])),n.isMaybeSingle&&Array.isArray(l)&&(l.length>1?(s={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,c=null,h=406,d="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{const _=await i.text();try{s=JSON.parse(_),Array.isArray(s)&&i.status===404&&(l=[],s=null,h=200,d="OK")}catch{i.status===404&&_===""?(h=204,d="No Content"):s={message:_}}if(s&&n.shouldThrowOnError)throw new wg(s)}return{success:s===null,error:s,data:l,count:c,status:h,statusText:d}}returns(){return this}overrideTypes(){return this}},q0=class extends $0{throwOnError(){return super.throwOnError()}select(i){let n=!1;const s=(i??"*").split("").map(l=>/\s/.test(l)&&!n?"":(l==='"'&&(n=!n),l)).join("");return this.url.searchParams.set("select",s),this.headers.append("Prefer","return=representation"),this}order(i,{ascending:n=!0,nullsFirst:s,foreignTable:l,referencedTable:c=l}={}){const h=c?`${c}.order`:"order",d=this.url.searchParams.get(h);return this.url.searchParams.set(h,`${d?`${d},`:""}${i}.${n?"asc":"desc"}${s===void 0?"":s?".nullsfirst":".nullslast"}`),this}limit(i,{foreignTable:n,referencedTable:s=n}={}){const l=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(l,`${i}`),this}range(i,n,{foreignTable:s,referencedTable:l=s}={}){const c=typeof l>"u"?"offset":`${l}.offset`,h=typeof l>"u"?"limit":`${l}.limit`;return this.url.searchParams.set(c,`${i}`),this.url.searchParams.set(h,`${n-i+1}`),this}abortSignal(i){return this.signal=i,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:i=!1,verbose:n=!1,settings:s=!1,buffers:l=!1,wal:c=!1,format:h="text"}={}){var d;const m=[i?"analyze":null,n?"verbose":null,s?"settings":null,l?"buffers":null,c?"wal":null].filter(Boolean).join("|"),g=(d=this.headers.get("Accept"))!==null&&d!==void 0?d:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${h}; for="${g}"; options=${m};`),h==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(i){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${i}`),this}};const Tg=new RegExp("[,()]");var ss=class extends q0{throwOnError(){return super.throwOnError()}eq(i,n){return this.url.searchParams.append(i,`eq.${n}`),this}neq(i,n){return this.url.searchParams.append(i,`neq.${n}`),this}gt(i,n){return this.url.searchParams.append(i,`gt.${n}`),this}gte(i,n){return this.url.searchParams.append(i,`gte.${n}`),this}lt(i,n){return this.url.searchParams.append(i,`lt.${n}`),this}lte(i,n){return this.url.searchParams.append(i,`lte.${n}`),this}like(i,n){return this.url.searchParams.append(i,`like.${n}`),this}likeAllOf(i,n){return this.url.searchParams.append(i,`like(all).{${n.join(",")}}`),this}likeAnyOf(i,n){return this.url.searchParams.append(i,`like(any).{${n.join(",")}}`),this}ilike(i,n){return this.url.searchParams.append(i,`ilike.${n}`),this}ilikeAllOf(i,n){return this.url.searchParams.append(i,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(i,n){return this.url.searchParams.append(i,`ilike(any).{${n.join(",")}}`),this}regexMatch(i,n){return this.url.searchParams.append(i,`match.${n}`),this}regexIMatch(i,n){return this.url.searchParams.append(i,`imatch.${n}`),this}is(i,n){return this.url.searchParams.append(i,`is.${n}`),this}isDistinct(i,n){return this.url.searchParams.append(i,`isdistinct.${n}`),this}in(i,n){const s=Array.from(new Set(n)).map(l=>typeof l=="string"&&Tg.test(l)?`"${l}"`:`${l}`).join(",");return this.url.searchParams.append(i,`in.(${s})`),this}notIn(i,n){const s=Array.from(new Set(n)).map(l=>typeof l=="string"&&Tg.test(l)?`"${l}"`:`${l}`).join(",");return this.url.searchParams.append(i,`not.in.(${s})`),this}contains(i,n){return typeof n=="string"?this.url.searchParams.append(i,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(i,`cs.{${n.join(",")}}`):this.url.searchParams.append(i,`cs.${JSON.stringify(n)}`),this}containedBy(i,n){return typeof n=="string"?this.url.searchParams.append(i,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(i,`cd.{${n.join(",")}}`):this.url.searchParams.append(i,`cd.${JSON.stringify(n)}`),this}rangeGt(i,n){return this.url.searchParams.append(i,`sr.${n}`),this}rangeGte(i,n){return this.url.searchParams.append(i,`nxl.${n}`),this}rangeLt(i,n){return this.url.searchParams.append(i,`sl.${n}`),this}rangeLte(i,n){return this.url.searchParams.append(i,`nxr.${n}`),this}rangeAdjacent(i,n){return this.url.searchParams.append(i,`adj.${n}`),this}overlaps(i,n){return typeof n=="string"?this.url.searchParams.append(i,`ov.${n}`):this.url.searchParams.append(i,`ov.{${n.join(",")}}`),this}textSearch(i,n,{config:s,type:l}={}){let c="";l==="plain"?c="pl":l==="phrase"?c="ph":l==="websearch"&&(c="w");const h=s===void 0?"":`(${s})`;return this.url.searchParams.append(i,`${c}fts${h}.${n}`),this}match(i){return Object.entries(i).filter(([n,s])=>s!==void 0).forEach(([n,s])=>{this.url.searchParams.append(n,`eq.${s}`)}),this}not(i,n,s){return this.url.searchParams.append(i,`not.${n}.${s}`),this}or(i,{foreignTable:n,referencedTable:s=n}={}){const l=s?`${s}.or`:"or";return this.url.searchParams.append(l,`(${i})`),this}filter(i,n,s){return this.url.searchParams.append(i,`${n}.${s}`),this}},P0=class{constructor(i,{headers:n={},schema:s,fetch:l,urlLengthLimit:c=8e3,retry:h}){this.url=i,this.headers=new Headers(n),this.schema=s,this.fetch=l,this.urlLengthLimit=c,this.retry=h}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(i,n){const{head:s=!1,count:l}=n??{},c=s?"HEAD":"GET";let h=!1;const d=(i??"*").split("").map(p=>/\s/.test(p)&&!h?"":(p==='"'&&(h=!h),p)).join(""),{url:m,headers:g}=this.cloneRequestState();return m.searchParams.set("select",d),l&&g.append("Prefer",`count=${l}`),new ss({method:c,url:m,headers:g,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(i,{count:n,defaultToNull:s=!0}={}){var l;const c="POST",{url:h,headers:d}=this.cloneRequestState();if(n&&d.append("Prefer",`count=${n}`),s||d.append("Prefer","missing=default"),Array.isArray(i)){const m=i.reduce((g,p)=>g.concat(Object.keys(p)),[]);if(m.length>0){const g=[...new Set(m)].map(p=>`"${p}"`);h.searchParams.set("columns",g.join(","))}}return new ss({method:c,url:h,headers:d,schema:this.schema,body:i,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(i,{onConflict:n,ignoreDuplicates:s=!1,count:l,defaultToNull:c=!0}={}){var h;const d="POST",{url:m,headers:g}=this.cloneRequestState();if(g.append("Prefer",`resolution=${s?"ignore":"merge"}-duplicates`),n!==void 0&&m.searchParams.set("on_conflict",n),l&&g.append("Prefer",`count=${l}`),c||g.append("Prefer","missing=default"),Array.isArray(i)){const p=i.reduce((_,b)=>_.concat(Object.keys(b)),[]);if(p.length>0){const _=[...new Set(p)].map(b=>`"${b}"`);m.searchParams.set("columns",_.join(","))}}return new ss({method:d,url:m,headers:g,schema:this.schema,body:i,fetch:(h=this.fetch)!==null&&h!==void 0?h:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(i,{count:n}={}){var s;const l="PATCH",{url:c,headers:h}=this.cloneRequestState();return n&&h.append("Prefer",`count=${n}`),new ss({method:l,url:c,headers:h,schema:this.schema,body:i,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:i}={}){var n;const s="DELETE",{url:l,headers:c}=this.cloneRequestState();return i&&c.append("Prefer",`count=${i}`),new ss({method:s,url:l,headers:c,schema:this.schema,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function kr(i){"@babel/helpers - typeof";return kr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},kr(i)}function G0(i,n){if(kr(i)!="object"||!i)return i;var s=i[Symbol.toPrimitive];if(s!==void 0){var l=s.call(i,n);if(kr(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(i)}function V0(i){var n=G0(i,"string");return kr(n)=="symbol"?n:n+""}function K0(i,n,s){return(n=V0(n))in i?Object.defineProperty(i,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[n]=s,i}function Eg(i,n){var s=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);n&&(l=l.filter(function(c){return Object.getOwnPropertyDescriptor(i,c).enumerable})),s.push.apply(s,l)}return s}function no(i){for(var n=1;n<arguments.length;n++){var s=arguments[n]!=null?arguments[n]:{};n%2?Eg(Object(s),!0).forEach(function(l){K0(i,l,s[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(s)):Eg(Object(s)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(s,l))})}return i}var I0=class op{constructor(n,{headers:s={},schema:l,fetch:c,timeout:h,urlLengthLimit:d=8e3,retry:m}={}){this.url=n,this.headers=new Headers(s),this.schemaName=l,this.urlLengthLimit=d;const g=c??globalThis.fetch;h!==void 0&&h>0?this.fetch=(p,_)=>{const b=new AbortController,T=setTimeout(()=>b.abort(),h),w=_?.signal;if(w){if(w.aborted)return clearTimeout(T),g(p,_);const R=()=>{clearTimeout(T),b.abort()};return w.addEventListener("abort",R,{once:!0}),g(p,no(no({},_),{},{signal:b.signal})).finally(()=>{clearTimeout(T),w.removeEventListener("abort",R)})}return g(p,no(no({},_),{},{signal:b.signal})).finally(()=>clearTimeout(T))}:this.fetch=g,this.retry=m}from(n){if(!n||typeof n!="string"||n.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new P0(new URL(`${this.url}/${n}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(n){return new op(this.url,{headers:this.headers,schema:n,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(n,s={},{head:l=!1,get:c=!1,count:h}={}){var d;let m;const g=new URL(`${this.url}/rpc/${n}`);let p;const _=w=>w!==null&&typeof w=="object"&&(!Array.isArray(w)||w.some(_)),b=l&&Object.values(s).some(_);b?(m="POST",p=s):l||c?(m=l?"HEAD":"GET",Object.entries(s).filter(([w,R])=>R!==void 0).map(([w,R])=>[w,Array.isArray(R)?`{${R.join(",")}}`:`${R}`]).forEach(([w,R])=>{g.searchParams.append(w,R)})):(m="POST",p=s);const T=new Headers(this.headers);return b?T.set("Prefer",h?`count=${h},return=minimal`:"return=minimal"):h&&T.set("Prefer",`count=${h}`),new ss({method:m,url:g,headers:T,schema:this.schemaName,body:p,fetch:(d=this.fetch)!==null&&d!==void 0?d:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class Y0{constructor(){}static detectEnvironment(){var n;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 l=typeof global<"u"?global:void 0;if(l&&typeof l.WebSocket<"u")return{type:"native",wsConstructor:l.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"&&(!((n=navigator.userAgent)===null||n===void 0)&&n.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 c=globalThis.process;if(c){const h=c.versions;if(h&&h.node)return{type:"unsupported",error:"Node.js detected but native WebSocket not found.",workaround:"Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option."}}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 n=this.detectEnvironment();if(n.wsConstructor)return n.wsConstructor;let s=n.error||"WebSocket not supported in this environment.";throw n.workaround&&(s+=`
|
|
13
|
-
|
|
14
|
-
Suggested solution: ${n.workaround}`),new Error(s)}static isWebSocketSupported(){try{return this.detectEnvironment().type==="native"}catch{return!1}}}const J0="2.110.0",X0=`realtime-js/${J0}`,Q0="1.0.0",up="2.0.0",Z0=up,F0=1e4,W0=100,La={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},cp={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},ch={connecting:"connecting",closing:"closing",closed:"closed"};class eb{constructor(n){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=n??[]}encode(n,s){if(n.event===this.BROADCAST_EVENT&&!(n.payload instanceof ArrayBuffer)&&typeof n.payload.event=="string")return s(this._binaryEncodeUserBroadcastPush(n));let l=[n.join_ref,n.ref,n.topic,n.event,n.payload];return s(JSON.stringify(l))}_binaryEncodeUserBroadcastPush(n){var s;return this._isArrayBuffer((s=n.payload)===null||s===void 0?void 0:s.payload)?this._encodeBinaryUserBroadcastPush(n):this._encodeJsonUserBroadcastPush(n)}_encodeBinaryUserBroadcastPush(n){var s,l;const c=(l=(s=n.payload)===null||s===void 0?void 0:s.payload)!==null&&l!==void 0?l:new ArrayBuffer(0);return this._encodeUserBroadcastPush(n,this.BINARY_ENCODING,c)}_encodeJsonUserBroadcastPush(n){var s,l;const c=(l=(s=n.payload)===null||s===void 0?void 0:s.payload)!==null&&l!==void 0?l:{},d=new TextEncoder().encode(JSON.stringify(c)).buffer;return this._encodeUserBroadcastPush(n,this.JSON_ENCODING,d)}_encodeUserBroadcastPush(n,s,l){var c,h;const d=n.topic,m=(c=n.ref)!==null&&c!==void 0?c:"",g=(h=n.join_ref)!==null&&h!==void 0?h:"",p=n.payload.event,_=this.allowedMetadataKeys?this._pick(n.payload,this.allowedMetadataKeys):{},b=Object.keys(_).length===0?"":JSON.stringify(_);if(g.length>255)throw new Error(`joinRef length ${g.length} exceeds maximum of 255`);if(m.length>255)throw new Error(`ref length ${m.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`topic length ${d.length} exceeds maximum of 255`);if(p.length>255)throw new Error(`userEvent length ${p.length} exceeds maximum of 255`);if(b.length>255)throw new Error(`metadata length ${b.length} exceeds maximum of 255`);const T=this.USER_BROADCAST_PUSH_META_LENGTH+g.length+m.length+d.length+p.length+b.length,w=new ArrayBuffer(this.HEADER_LENGTH+T);let R=new DataView(w),D=0;R.setUint8(D++,this.KINDS.userBroadcastPush),R.setUint8(D++,g.length),R.setUint8(D++,m.length),R.setUint8(D++,d.length),R.setUint8(D++,p.length),R.setUint8(D++,b.length),R.setUint8(D++,s),Array.from(g,$=>R.setUint8(D++,$.charCodeAt(0))),Array.from(m,$=>R.setUint8(D++,$.charCodeAt(0))),Array.from(d,$=>R.setUint8(D++,$.charCodeAt(0))),Array.from(p,$=>R.setUint8(D++,$.charCodeAt(0))),Array.from(b,$=>R.setUint8(D++,$.charCodeAt(0)));var q=new Uint8Array(w.byteLength+l.byteLength);return q.set(new Uint8Array(w),0),q.set(new Uint8Array(l),w.byteLength),q.buffer}decode(n,s){if(this._isArrayBuffer(n)){let l=this._binaryDecode(n);return s(l)}if(typeof n=="string"){const l=JSON.parse(n),[c,h,d,m,g]=l;return s({join_ref:c,ref:h,topic:d,event:m,payload:g})}return s({})}_binaryDecode(n){const s=new DataView(n),l=s.getUint8(0),c=new TextDecoder;if(l===this.KINDS.userBroadcast)return this._decodeUserBroadcast(n,s,c)}_decodeUserBroadcast(n,s,l){const c=s.getUint8(1),h=s.getUint8(2),d=s.getUint8(3),m=s.getUint8(4);let g=this.HEADER_LENGTH+4;const p=l.decode(n.slice(g,g+c));g=g+c;const _=l.decode(n.slice(g,g+h));g=g+h;const b=l.decode(n.slice(g,g+d));g=g+d;const T=n.slice(g,n.byteLength),w=m===this.JSON_ENCODING?JSON.parse(l.decode(T)):T,R={type:this.BROADCAST_EVENT,event:_,payload:w};return d>0&&(R.meta=JSON.parse(b)),{join_ref:null,ref:null,topic:p,event:this.BROADCAST_EVENT,payload:R}}_isArrayBuffer(n){var s;return n instanceof ArrayBuffer||((s=n?.constructor)===null||s===void 0?void 0:s.name)==="ArrayBuffer"}_pick(n,s){return!n||typeof n!="object"?{}:Object.fromEntries(Object.entries(n).filter(([l])=>s.includes(l)))}}var He;(function(i){i.abstime="abstime",i.bool="bool",i.date="date",i.daterange="daterange",i.float4="float4",i.float8="float8",i.int2="int2",i.int4="int4",i.int4range="int4range",i.int8="int8",i.int8range="int8range",i.json="json",i.jsonb="jsonb",i.money="money",i.numeric="numeric",i.oid="oid",i.reltime="reltime",i.text="text",i.time="time",i.timestamp="timestamp",i.timestamptz="timestamptz",i.timetz="timetz",i.tsrange="tsrange",i.tstzrange="tstzrange"})(He||(He={}));const kg=(i,n,s={})=>{var l;const c=(l=s.skipTypes)!==null&&l!==void 0?l:[];return n?Object.keys(n).reduce((h,d)=>(h[d]=tb(d,i,n,c),h),{}):{}},tb=(i,n,s,l)=>{const c=n.find(m=>m.name===i),h=c?.type,d=s[i];return h&&!l.includes(h)?hp(h,d):hh(d)},hp=(i,n)=>{if(i.charAt(0)==="_"){const s=i.slice(1,i.length);return sb(n,s)}switch(i){case He.bool:return nb(n);case He.float4:case He.float8:case He.int2:case He.int4:case He.int8:case He.numeric:case He.oid:return ab(n);case He.json:case He.jsonb:return ib(n);case He.timestamp:return rb(n);case He.abstime:case He.date:case He.daterange:case He.int4range:case He.int8range:case He.money:case He.reltime:case He.text:case He.time:case He.timestamptz:case He.timetz:case He.tsrange:case He.tstzrange:return hh(n);default:return hh(n)}},hh=i=>i,nb=i=>{switch(i){case"t":return!0;case"f":return!1;default:return i}},ab=i=>{if(typeof i=="string"){const n=parseFloat(i);if(!Number.isNaN(n))return n}return i},ib=i=>{if(typeof i=="string")try{return JSON.parse(i)}catch{return i}return i},sb=(i,n)=>{if(typeof i!="string")return i;const s=i.length-1,l=i[s];if(i[0]==="{"&&l==="}"){let h;const d=i.slice(1,s);try{h=JSON.parse("["+d+"]")}catch{h=d?d.split(","):[]}return h.map(m=>hp(n,m))}return i},rb=i=>typeof i=="string"?i.replace(" ","T"):i,dp=i=>{const n=new URL(i);return n.protocol=n.protocol.replace(/^ws/i,"http"),n.pathname=n.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),n.pathname===""||n.pathname==="/"?n.pathname="/api/broadcast":n.pathname=n.pathname+"/api/broadcast",n.href};var br=i=>typeof i=="function"?i:function(){return i},lb=typeof self<"u"?self:null,rs=typeof window<"u"?window:null,On=lb||rs||globalThis,ob="2.0.0",ub=1e4,cb=1e3,xn={connecting:0,open:1,closing:2,closed:3},zt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},na={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},dh={longpoll:"longpoll",websocket:"websocket"},hb={complete:4},fh="base64url.bearer.phx.",ao=class{constructor(i,n,s,l){this.channel=i,this.event=n,this.payload=s||function(){return{}},this.receivedResp=null,this.timeout=l,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(i){this.timeout=i,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(i,n){return this.hasReceived(i)&&n(this.receivedResp.response),this.recHooks.push({status:i,callback:n}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:i,response:n,_ref:s}){this.recHooks.filter(l=>l.status===i).forEach(l=>l.callback(n))}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,i=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=i,this.matchReceive(i)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(i){return this.receivedResp&&this.receivedResp.status===i}trigger(i,n){this.channel.trigger(this.refEvent,{status:i,response:n})}},fp=class{constructor(i,n){this.callback=i,this.timerCalc=n,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))}},db=class{constructor(i,n,s){this.state=zt.closed,this.topic=i,this.params=br(n||{}),this.socket=s,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new ao(this,na.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new fp(()=>{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=zt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(l=>l.send()),this.pushBuffer=[]}),this.joinPush.receive("error",l=>{this.state=zt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,l),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=zt.closed,this.socket.remove(this)}),this.onError(l=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,l),this.isJoining()&&this.joinPush.reset(),this.state=zt.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 ao(this,na.leave,br({}),this.timeout).send(),this.state=zt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(na.reply,(l,c)=>{this.trigger(this.replyEventName(c),l)})}join(i=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=i,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(i=>i.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=zt.closed,this.bindings=[]}onClose(i){this.on(na.close,i)}onError(i){return this.on(na.error,n=>i(n))}on(i,n){let s=this.bindingRef++;return this.bindings.push({event:i,ref:s,callback:n}),s}off(i,n){this.bindings=this.bindings.filter(s=>!(s.event===i&&(typeof n>"u"||n===s.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(i,n,s=this.timeout){if(n=n||{},!this.joinedOnce)throw new Error(`tried to push '${i}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let l=new ao(this,i,function(){return n},s);return this.canPush()?l.send():(l.startTimeout(),this.pushBuffer.push(l)),l}leave(i=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=zt.leaving;let n=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(na.close,"leave")},s=new ao(this,na.leave,br({}),i);return s.receive("ok",()=>n()).receive("timeout",()=>n()),s.send(),this.canPush()||s.trigger("ok",{}),s}onMessage(i,n,s){return n}filterBindings(i,n,s){return!0}isMember(i,n,s,l){return this.topic!==i?!1:l&&l!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:i,event:n,payload:s,joinRef:l}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(i=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=zt.joining,this.joinPush.resend(i))}trigger(i,n,s,l){let c=this.onMessage(i,n,s,l);if(n&&!c)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let h=this.bindings.filter(d=>d.event===i&&this.filterBindings(d,n,s));for(let d=0;d<h.length;d++)h[d].callback(c,s,l||this.joinRef())}replyEventName(i){return`chan_reply_${i}`}isClosed(){return this.state===zt.closed}isErrored(){return this.state===zt.errored}isJoined(){return this.state===zt.joined}isJoining(){return this.state===zt.joining}isLeaving(){return this.state===zt.leaving}},go=class{static request(i,n,s,l,c,h,d){if(On.XDomainRequest){let m=new On.XDomainRequest;return this.xdomainRequest(m,i,n,l,c,h,d)}else if(On.XMLHttpRequest){let m=new On.XMLHttpRequest;return this.xhrRequest(m,i,n,s,l,c,h,d)}else{if(On.fetch&&On.AbortController)return this.fetchRequest(i,n,s,l,c,h,d);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(i,n,s,l,c,h,d){let m={method:i,headers:s,body:l},g=null;return c&&(g=new AbortController,setTimeout(()=>g.abort(),c),m.signal=g.signal),On.fetch(n,m).then(p=>p.text()).then(p=>this.parseJSON(p)).then(p=>d&&d(p)).catch(p=>{p.name==="AbortError"&&h?h():d&&d(null)}),g}static xdomainRequest(i,n,s,l,c,h,d){return i.timeout=c,i.open(n,s),i.onload=()=>{let m=this.parseJSON(i.responseText);d&&d(m)},h&&(i.ontimeout=h),i.onprogress=()=>{},i.send(l),i}static xhrRequest(i,n,s,l,c,h,d,m){i.open(n,s,!0),i.timeout=h;for(let[g,p]of Object.entries(l))i.setRequestHeader(g,p);return i.onerror=()=>m&&m(null),i.onreadystatechange=()=>{if(i.readyState===hb.complete&&m){let g=this.parseJSON(i.responseText);m(g)}},d&&(i.ontimeout=d),i.send(c),i}static parseJSON(i){if(!i||i==="")return null;try{return JSON.parse(i)}catch{return console&&console.log("failed to parse JSON response",i),null}}static serialize(i,n){let s=[];for(var l in i){if(!Object.prototype.hasOwnProperty.call(i,l))continue;let c=n?`${n}[${l}]`:l,h=i[l];typeof h=="object"?s.push(this.serialize(h,c)):s.push(encodeURIComponent(c)+"="+encodeURIComponent(h))}return s.join("&")}static appendParams(i,n){if(Object.keys(n).length===0)return i;let s=i.match(/\?/)?"&":"?";return`${i}${s}${this.serialize(n)}`}},fb=i=>{let n="",s=new Uint8Array(i),l=s.byteLength;for(let c=0;c<l;c++)n+=String.fromCharCode(s[c]);return btoa(n)},Zi=class{constructor(i,n){n&&n.length===2&&n[1].startsWith(fh)&&(this.authToken=atob(n[1].slice(fh.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(i),this.readyState=xn.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(i){return i.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+dh.websocket),"$1/"+dh.longpoll)}endpointURL(){return go.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(i,n,s){this.close(i,n,s),this.readyState=xn.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===xn.open||this.readyState===xn.connecting}poll(){const i={Accept:"application/json"};this.authToken&&(i["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",i,null,()=>this.ontimeout(),n=>{if(n){var{status:s,token:l,messages:c}=n;if(s===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=l}else s=0;switch(s){case 200:c.forEach(h=>{setTimeout(()=>this.onmessage({data:h}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=xn.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(i){typeof i!="string"&&(i=fb(i)),this.currentBatch?this.currentBatch.push(i):this.awaitingBatchAck?this.batchBuffer.push(i):(this.currentBatch=[i],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(i){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},i.join(`
|
|
15
|
-
`),()=>this.onerror("timeout"),n=>{this.awaitingBatchAck=!1,!n||n.status!==200?(this.onerror(n&&n.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(i,n,s){for(let c of this.reqs)c.abort();this.readyState=xn.closed;let l=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:i,reason:n,wasClean:s});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",l)):this.onclose(l)}ajax(i,n,s,l,c){let h,d=()=>{this.reqs.delete(h),l()};h=go.request(i,this.endpointURL(),n,s,this.timeout,d,m=>{this.reqs.delete(h),this.isActive()&&c(m)}),this.reqs.add(h)}},mb=class pr{constructor(n,s={}){let l=s.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=n,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(l.state,c=>{let{onJoin:h,onLeave:d,onSync:m}=this.caller;this.joinRef=this.channel.joinRef(),this.state=pr.syncState(this.state,c,h,d),this.pendingDiffs.forEach(g=>{this.state=pr.syncDiff(this.state,g,h,d)}),this.pendingDiffs=[],m()}),this.channel.on(l.diff,c=>{let{onJoin:h,onLeave:d,onSync:m}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(c):(this.state=pr.syncDiff(this.state,c,h,d),m())})}onJoin(n){this.caller.onJoin=n}onLeave(n){this.caller.onLeave=n}onSync(n){this.caller.onSync=n}list(n){return pr.list(this.state,n)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(n,s,l,c){let h=this.clone(n),d={},m={};return this.map(h,(g,p)=>{s[g]||(m[g]=p)}),this.map(s,(g,p)=>{let _=h[g];if(_){let b=p.metas.map(D=>D.phx_ref),T=_.metas.map(D=>D.phx_ref),w=p.metas.filter(D=>T.indexOf(D.phx_ref)<0),R=_.metas.filter(D=>b.indexOf(D.phx_ref)<0);w.length>0&&(d[g]=p,d[g].metas=w),R.length>0&&(m[g]=this.clone(_),m[g].metas=R)}else d[g]=p}),this.syncDiff(h,{joins:d,leaves:m},l,c)}static syncDiff(n,s,l,c){let{joins:h,leaves:d}=this.clone(s);return l||(l=function(){}),c||(c=function(){}),this.map(h,(m,g)=>{let p=n[m];if(n[m]=this.clone(g),p){let _=n[m].metas.map(T=>T.phx_ref),b=p.metas.filter(T=>_.indexOf(T.phx_ref)<0);n[m].metas.unshift(...b)}l(m,p,g)}),this.map(d,(m,g)=>{let p=n[m];if(!p)return;let _=g.metas.map(b=>b.phx_ref);p.metas=p.metas.filter(b=>_.indexOf(b.phx_ref)<0),c(m,p,g),p.metas.length===0&&delete n[m]}),n}static list(n,s){return s||(s=function(l,c){return c}),this.map(n,(l,c)=>s(l,c))}static map(n,s){return Object.getOwnPropertyNames(n).map(l=>s(l,n[l]))}static clone(n){return JSON.parse(JSON.stringify(n))}},io={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(i,n){if(i.payload.constructor===ArrayBuffer)return n(this.binaryEncode(i));{let s=[i.join_ref,i.ref,i.topic,i.event,i.payload];return n(JSON.stringify(s))}},decode(i,n){if(i.constructor===ArrayBuffer)return n(this.binaryDecode(i));{let[s,l,c,h,d]=JSON.parse(i);return n({join_ref:s,ref:l,topic:c,event:h,payload:d})}},binaryEncode(i){let{join_ref:n,ref:s,event:l,topic:c,payload:h}=i,d=this.META_LENGTH+n.length+s.length+c.length+l.length,m=new ArrayBuffer(this.HEADER_LENGTH+d),g=new DataView(m),p=0;g.setUint8(p++,this.KINDS.push),g.setUint8(p++,n.length),g.setUint8(p++,s.length),g.setUint8(p++,c.length),g.setUint8(p++,l.length),Array.from(n,b=>g.setUint8(p++,b.charCodeAt(0))),Array.from(s,b=>g.setUint8(p++,b.charCodeAt(0))),Array.from(c,b=>g.setUint8(p++,b.charCodeAt(0))),Array.from(l,b=>g.setUint8(p++,b.charCodeAt(0)));var _=new Uint8Array(m.byteLength+h.byteLength);return _.set(new Uint8Array(m),0),_.set(new Uint8Array(h),m.byteLength),_.buffer},binaryDecode(i){let n=new DataView(i),s=n.getUint8(0),l=new TextDecoder;switch(s){case this.KINDS.push:return this.decodePush(i,n,l);case this.KINDS.reply:return this.decodeReply(i,n,l);case this.KINDS.broadcast:return this.decodeBroadcast(i,n,l)}},decodePush(i,n,s){let l=n.getUint8(1),c=n.getUint8(2),h=n.getUint8(3),d=this.HEADER_LENGTH+this.META_LENGTH-1,m=s.decode(i.slice(d,d+l));d=d+l;let g=s.decode(i.slice(d,d+c));d=d+c;let p=s.decode(i.slice(d,d+h));d=d+h;let _=i.slice(d,i.byteLength);return{join_ref:m,ref:null,topic:g,event:p,payload:_}},decodeReply(i,n,s){let l=n.getUint8(1),c=n.getUint8(2),h=n.getUint8(3),d=n.getUint8(4),m=this.HEADER_LENGTH+this.META_LENGTH,g=s.decode(i.slice(m,m+l));m=m+l;let p=s.decode(i.slice(m,m+c));m=m+c;let _=s.decode(i.slice(m,m+h));m=m+h;let b=s.decode(i.slice(m,m+d));m=m+d;let T=i.slice(m,i.byteLength),w={status:b,response:T};return{join_ref:g,ref:p,topic:_,event:na.reply,payload:w}},decodeBroadcast(i,n,s){let l=n.getUint8(1),c=n.getUint8(2),h=this.HEADER_LENGTH+2,d=s.decode(i.slice(h,h+l));h=h+l;let m=s.decode(i.slice(h,h+c));h=h+c;let g=i.slice(h,i.byteLength);return{join_ref:null,ref:null,topic:d,event:m,payload:g}}},gb=class{constructor(i,n={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=n.timeout||ub,this.transport=n.transport||On.WebSocket||Zi,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=n.longPollFallbackMs,this.fallbackTimer=null;let s=null;try{s=On&&On.sessionStorage}catch{}this.sessionStore=n.sessionStorage||s,this.establishedConnections=0,this.defaultEncoder=io.encode.bind(io),this.defaultDecoder=io.decode.bind(io),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=n.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Zi?(this.encode=n.encode||this.defaultEncoder,this.decode=n.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let l=null;rs&&rs.addEventListener&&(rs.addEventListener("pagehide",c=>{this.conn&&(this.disconnect(),l=this.connectClock)}),rs.addEventListener("pageshow",c=>{l===this.connectClock&&(l=null,this.connect())}),rs.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=n.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=n.autoSendHeartbeat??!0,this.heartbeatCallback=n.heartbeatCallback??(()=>{}),this.rejoinAfterMs=c=>n.rejoinAfterMs?n.rejoinAfterMs(c):[1e3,2e3,5e3][c-1]||1e4,this.reconnectAfterMs=c=>n.reconnectAfterMs?n.reconnectAfterMs(c):[10,50,100,150,200,250,500,1e3,2e3][c-1]||5e3,this.logger=n.logger||null,!this.logger&&n.debug&&(this.logger=(c,h,d)=>{console.log(`${c}: ${h}`,d)}),this.longpollerTimeout=n.longpollerTimeout||2e4,this.params=br(n.params||{}),this.endPoint=`${i}/${dh.websocket}`,this.vsn=n.vsn||ob,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new fp(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{n.beforeReconnect&&await n.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=n.authToken}getLongPollTransport(){return Zi}replaceTransport(i){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=i}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let i=go.appendParams(go.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return i.charAt(0)!=="/"?i:i.charAt(1)==="/"?`${this.protocol()}:${i}`:`${this.protocol()}://${location.host}${i}`}disconnect(i,n,s){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,i&&i()},n,s)}connect(i){i&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=br(i)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Zi?this.connectWithFallback(Zi,this.longPollFallbackMs):this.transportConnect())}log(i,n,s){this.logger&&this.logger(i,n,s)}hasLogger(){return this.logger!==null}onOpen(i){let n=this.makeRef();return this.stateChangeCallbacks.open.push([n,i]),n}onClose(i){let n=this.makeRef();return this.stateChangeCallbacks.close.push([n,i]),n}onError(i){let n=this.makeRef();return this.stateChangeCallbacks.error.push([n,i]),n}onMessage(i){let n=this.makeRef();return this.stateChangeCallbacks.message.push([n,i]),n}onHeartbeat(i){this.heartbeatCallback=i}ping(i){if(!this.isConnected())return!1;let n=this.makeRef(),s=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:n});let l=this.onMessage(c=>{c.ref===n&&(this.off([l]),i(Date.now()-s))});return!0}transportName(i){return i===Zi?"LongPoll":i.name}transportConnect(){this.connectClock++,this.closeWasClean=!1;let i;this.authToken&&(i=["phoenix",`${fh}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),i),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=n=>this.onConnError(n),this.conn.onmessage=n=>this.onConnMessage(n),this.conn.onclose=n=>this.onConnClose(n)}getSession(i){return this.sessionStore&&this.sessionStore.getItem(i)}storeSession(i,n){this.sessionStore&&this.sessionStore.setItem(i,n)}connectWithFallback(i,n=2500){clearTimeout(this.fallbackTimer);let s=!1,l=!0,c,h,d=this.transportName(i),m=g=>{this.log("transport",`falling back to ${d}...`,g),this.off([c,h]),l=!1,this.replaceTransport(i),this.transportConnect()};if(this.getSession(`phx:fallback:${d}`))return m("memorized");this.fallbackTimer=setTimeout(m,n),h=this.onError(g=>{this.log("transport","error",g),l&&!s&&(clearTimeout(this.fallbackTimer),m(g))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(s=!0,!l){let g=this.transportName(i);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${g}`,"true"),this.log("transport",`established ${g} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(m,n),this.ping(g=>{this.log("transport","connected to primary after",g),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(i){this.log("error","error in heartbeat callback",i)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),cb,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(i,n,s){if(!this.conn)return i&&i();const l=this.conn;this.waitForBufferDone(l,()=>{n?l.close(n,s||""):l.close(),this.waitForSocketClosed(l,()=>{this.conn===l&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),i&&i()})})}waitForBufferDone(i,n,s=1){if(s===5||!i.bufferedAmount){n();return}setTimeout(()=>{this.waitForBufferDone(i,n,s+1)},150*s)}waitForSocketClosed(i,n,s=1){if(s===5||i.readyState===xn.closed){n();return}setTimeout(()=>{this.waitForSocketClosed(i,n,s+1)},150*s)}onConnClose(i){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",i),this.triggerChanError(i),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",i)}onConnError(i){this.hasLogger()&&this.log("transport","error",i);let n=this.transport,s=this.establishedConnections;this.triggerStateCallbacks("error",i,n,s),(n===this.transport||s>0)&&this.triggerChanError(i)}triggerChanError(i){this.channels.forEach(n=>{n.isErrored()||n.isLeaving()||n.isClosed()||n.trigger(na.error,i)})}connectionState(){switch(this.conn&&this.conn.readyState){case xn.connecting:return"connecting";case xn.open:return"open";case xn.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(i){this.off(i.stateChangeRefs),this.channels=this.channels.filter(n=>n!==i)}off(i){for(let n in this.stateChangeCallbacks)this.stateChangeCallbacks[n]=this.stateChangeCallbacks[n].filter(([s])=>i.indexOf(s)===-1)}channel(i,n={}){let s=new db(i,n,this);return this.channels.push(s),s}push(i){if(this.hasLogger()){let{topic:n,event:s,payload:l,ref:c,join_ref:h}=i;this.log("push",`${n} ${s} (${h}, ${c})`,l)}this.isConnected()?this.encode(i,n=>this.conn.send(n)):this.sendBuffer.push(()=>this.encode(i,n=>this.conn.send(n)))}makeRef(){let i=this.ref+1;return i===this.ref?this.ref=0:this.ref=i,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(i){this.log("error","error in heartbeat callback",i)}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(i){this.log("error","error in heartbeat callback",i)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(i=>i()),this.sendBuffer=[])}onConnMessage(i){this.decode(i.data,n=>{let{topic:s,event:l,payload:c,ref:h,join_ref:d}=n;if(h&&h===this.pendingHeartbeatRef){const m=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(c.status==="ok"?"ok":"error",m)}catch(g){this.log("error","error in heartbeat callback",g)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${c.status||""} ${s} ${l} ${h&&"("+h+")"||""}`.trim(),c);for(let m=0;m<this.channels.length;m++){const g=this.channels[m];g.isMember(s,l,c,d)&&g.trigger(l,c,h,d)}this.triggerStateCallbacks("message",n)})}triggerStateCallbacks(i,...n){try{this.stateChangeCallbacks[i].forEach(([s,l])=>{try{l(...n)}catch(c){this.log("error",`error in ${i} callback`,c)}})}catch(s){this.log("error",`error triggering ${i} callbacks`,s)}}leaveOpenTopic(i){let n=this.channels.find(s=>s.topic===i&&(s.isJoined()||s.isJoining()));n&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${i}"`),n.leave())}};class _r{constructor(n,s){const l=yb(s);this.presence=new mb(n.getChannel(),l),this.presence.onJoin((c,h,d)=>{const m=_r.onJoinPayload(c,h,d);n.getChannel().trigger("presence",m)}),this.presence.onLeave((c,h,d)=>{const m=_r.onLeavePayload(c,h,d);n.getChannel().trigger("presence",m)}),this.presence.onSync(()=>{n.getChannel().trigger("presence",{event:"sync"})})}get state(){return _r.transformState(this.presence.state)}static transformState(n){return n=pb(n),Object.getOwnPropertyNames(n).reduce((s,l)=>{const c=n[l];return s[l]=fo(c),s},{})}static onJoinPayload(n,s,l){const c=Ag(s),h=fo(l);return{event:"join",key:n,currentPresences:c,newPresences:h}}static onLeavePayload(n,s,l){const c=Ag(s),h=fo(l);return{event:"leave",key:n,currentPresences:c,leftPresences:h}}}function fo(i){return i.metas.map(n=>(n.presence_ref=n.phx_ref,delete n.phx_ref,delete n.phx_ref_prev,n))}function pb(i){return JSON.parse(JSON.stringify(i))}function yb(i){return i?.events&&{events:i.events}}function Ag(i){return i?.metas?fo(i):[]}var Cg;(function(i){i.SYNC="sync",i.JOIN="join",i.LEAVE="leave"})(Cg||(Cg={}));class vb{get state(){return this.presenceAdapter.state}constructor(n,s){this.channel=n,this.presenceAdapter=new _r(this.channel.channelAdapter,s)}}function bb(i){if(i instanceof Error)return i;if(typeof i=="string")return new Error(i);if(i&&typeof i=="object"){const n=i;if(typeof n.code=="number"){const s=typeof n.reason=="string"&&n.reason?` (${n.reason})`:"";return new Error(`socket closed: ${n.code}${s}`,{cause:i})}return new Error("channel error: transport failure",{cause:i})}return new Error("channel error: connection lost")}class _b{constructor(n,s,l){const c=wb(l);this.channel=n.getSocket().channel(s,c),this.socket=n}get state(){return this.channel.state}set state(n){this.channel.state=n}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(n,s){return this.channel.on(n,s)}off(n,s){this.channel.off(n,s)}subscribe(n){return this.channel.join(n)}unsubscribe(n){return this.channel.leave(n)}teardown(){this.channel.teardown()}onClose(n){this.channel.onClose(n)}onError(n){return this.channel.onError(n)}push(n,s,l){let c;try{c=this.channel.push(n,s,l)}catch{throw new Error(`tried to push '${n}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>W0){const h=this.channel.pushBuffer.shift();h.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${h.event}`,h.payload())}return c}updateJoinPayload(n){const s=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},s),n)}canPush(){return this.socket.isConnected()&&this.state===La.joined}isJoined(){return this.state===La.joined}isJoining(){return this.state===La.joining}isClosed(){return this.state===La.closed}isLeaving(){return this.state===La.leaving}updateFilterBindings(n){this.channel.filterBindings=n}updatePayloadTransform(n){this.channel.onMessage=n}getChannel(){return this.channel}}function wb(i){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},i.config)}}const Sb=/[,()"\\]/,Tb=i=>Sb.test(i)||i!==i.trim(),Eb=i=>`"${i.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,Rg=i=>{const n=i===null?"null":String(i);return Tb(n)?Eb(n):n},kb=i=>i===null?"null":String(i),Ab=(i,n)=>{if(i==="in"){const s=Array.isArray(n)?n:[n];if(s.length===0)throw new Error("Realtime `in` filter requires at least one value.");return`in.(${Array.from(new Set(s)).map(c=>Rg(c)).join(",")})`}return i==="is"?`is.${kb(n)}`:`${i}.${Rg(n)}`};class Cb{constructor(){this.filters=[]}add(n,s,l,c=!1){const h=c?"not.":"";return this.filters.push(`${n}=${h}${Ab(s,l)}`),this}eq(n,s){return this.add(n,"eq",s)}neq(n,s){return this.add(n,"neq",s)}gt(n,s){return this.add(n,"gt",s)}gte(n,s){return this.add(n,"gte",s)}lt(n,s){return this.add(n,"lt",s)}lte(n,s){return this.add(n,"lte",s)}in(n,s){return this.add(n,"in",s)}like(n,s){return this.add(n,"like",s)}ilike(n,s){return this.add(n,"ilike",s)}match(n,s){return this.add(n,"match",s)}imatch(n,s){return this.add(n,"imatch",s)}is(n,s){return this.add(n,"is",s)}isDistinct(n,s){return this.add(n,"isdistinct",s)}not(n,s,l){return this.add(n,s,l,!0)}build(){return this.filters.join(",")}toString(){return this.build()}}var Og;(function(i){i.ALL="*",i.INSERT="INSERT",i.UPDATE="UPDATE",i.DELETE="DELETE"})(Og||(Og={}));var us;(function(i){i.BROADCAST="broadcast",i.PRESENCE="presence",i.POSTGRES_CHANGES="postgres_changes",i.SYSTEM="system"})(us||(us={}));var aa;(function(i){i.SUBSCRIBED="SUBSCRIBED",i.TIMED_OUT="TIMED_OUT",i.CLOSED="CLOSED",i.CHANNEL_ERROR="CHANNEL_ERROR"})(aa||(aa={}));class wr{get state(){return this.channelAdapter.state}set state(n){this.channelAdapter.state=n}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(n,s={config:{}},l){var c,h;if(this.topic=n,this.params=s,this.socket=l,this.bindings={},this.subTopic=n.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},s.config),this.channelAdapter=new _b(this.socket.socketAdapter,n,this.params),this.presence=new vb(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=dp(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((h=(c=this.params.config)===null||c===void 0?void 0:c.broadcast)===null||h===void 0)&&h.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(n,s=this.timeout){var l,c,h;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:d,presence:m,private:g}}=this.params,p=(c=(l=this.bindings.postgres_changes)===null||l===void 0?void 0:l.map(w=>w.filter))!==null&&c!==void 0?c:[],_=!!this.bindings[us.PRESENCE]&&this.bindings[us.PRESENCE].length>0||((h=this.params.config.presence)===null||h===void 0?void 0:h.enabled)===!0,b={},T={broadcast:d,presence:Object.assign(Object.assign({},m),{enabled:_}),postgres_changes:p,private:g};this.socket.accessTokenValue&&(b.access_token=this.socket.accessTokenValue),this._onError(w=>{n?.(aa.CHANNEL_ERROR,bb(w))}),this._onClose(()=>n?.(aa.CLOSED)),this.updateJoinPayload(Object.assign({config:T},b)),this._updateFilterMessage(),this.channelAdapter.subscribe(s).receive("ok",async({postgres_changes:w})=>{if(this.socket._isManualToken()||this.socket.setAuth(),w===void 0){n?.(aa.SUBSCRIBED);return}this._updatePostgresBindings(w,n)}).receive("error",w=>{this.state=La.errored;const R=Object.values(w).join(", ")||"error";n?.(aa.CHANNEL_ERROR,new Error(R,{cause:w}))}).receive("timeout",()=>{n?.(aa.TIMED_OUT)})}return this}_updatePostgresBindings(n,s){var l;const c=this.bindings.postgres_changes,h=(l=c?.length)!==null&&l!==void 0?l:0,d=[];for(let m=0;m<h;m++){const g=c[m],{filter:{event:p,schema:_,table:b,filter:T}}=g,w=n&&n[m];if(w&&w.event===p&&wr.isFilterValueEqual(w.schema,_)&&wr.isFilterValueEqual(w.table,b)&&wr.isFilterValueEqual(w.filter,T))d.push(Object.assign(Object.assign({},g),{id:w.id}));else{this.unsubscribe(),this.state=La.errored,s?.(aa.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=d,this.state!=La.errored&&s&&s(aa.SUBSCRIBED)}presenceState(){return this.presence.state}async track(n,s={}){return await this.send({type:"presence",event:"track",payload:n},s.timeout||this.timeout)}async untrack(n={}){return await this.send({type:"presence",event:"untrack"},n)}on(n,s,l){const c=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),h=n===us.PRESENCE||n===us.POSTGRES_CHANGES;if(c&&h)throw this.socket.log("channel",`cannot add \`${n}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${n}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(n,s,l)}async httpSend(n,s,l={}){var c;if(s==null)return Promise.reject(new Error("Payload is required for httpSend()"));const h=s instanceof ArrayBuffer||ArrayBuffer.isView(s),d={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":h?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(d.Authorization=`Bearer ${this.socket.accessTokenValue}`);const m=new URL(this.broadcastEndpointURL);m.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(n)}`,this.private&&m.searchParams.set("private","true");const g={method:"POST",headers:d,body:h?s:JSON.stringify(s)},p=await this._fetchWithTimeout(m.toString(),g,(c=l.timeout)!==null&&c!==void 0?c:this.timeout);if(p.status===202)return{success:!0};if(p.status===404)return Promise.reject(new Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md"));let _=p.statusText;try{const b=await p.json();_=b.error||b.message||_}catch{}return Promise.reject(new Error(_))}async send(n,s={}){var l,c;if(!this.channelAdapter.canPush()&&n.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:h,payload:d}=n,m={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(m.Authorization=`Bearer ${this.socket.accessTokenValue}`);const g={method:"POST",headers:m,body:JSON.stringify({messages:[{topic:this.subTopic,event:h,payload:d,private:this.private}]})};try{const p=await this._fetchWithTimeout(this.broadcastEndpointURL,g,(l=s.timeout)!==null&&l!==void 0?l:this.timeout);return await((c=p.body)===null||c===void 0?void 0:c.cancel()),p.ok?"ok":"error"}catch(p){return p instanceof Error&&p.name==="AbortError"?"timed out":"error"}}else return new Promise(h=>{var d,m,g;const p=this.channelAdapter.push(n.type,n,s.timeout||this.timeout);n.type==="broadcast"&&!(!((g=(m=(d=this.params)===null||d===void 0?void 0:d.config)===null||m===void 0?void 0:m.broadcast)===null||g===void 0)&&g.ack)&&h("ok"),p.receive("ok",()=>h("ok")),p.receive("error",()=>h("error")),p.receive("timeout",()=>h("timed out"))})}updateJoinPayload(n){this.channelAdapter.updateJoinPayload(n)}async unsubscribe(n=this.timeout){return new Promise(s=>{this.channelAdapter.unsubscribe(n).receive("ok",()=>s("ok")).receive("timeout",()=>s("timed out")).receive("error",()=>s("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(n,s,l){const c=new AbortController,h=setTimeout(()=>c.abort(),l),d=await this.socket.fetch(n,Object.assign(Object.assign({},s),{signal:c.signal}));return clearTimeout(h),d}_on(n,s,l){const c=n.toLocaleLowerCase(),h=s?.filter;(h instanceof Cb||typeof h=="object"&&h!==null&&typeof h.build=="function")&&(s=Object.assign(Object.assign({},s),{filter:h.build()}));const d=this.channelAdapter.on(n,l),m={type:c,filter:s,callback:l,ref:d};return this.bindings[c]?this.bindings[c].push(m):this.bindings[c]=[m],this._updateFilterMessage(),this}_onClose(n){this.channelAdapter.onClose(n)}_onError(n){this.channelAdapter.onError(n)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((n,s,l)=>{var c,h,d,m,g,p,_;const b=n.event.toLocaleLowerCase();if(this._notThisChannelEvent(b,l))return!1;const T=(c=this.bindings[b])===null||c===void 0?void 0:c.find(w=>w.ref===n.ref);if(!T)return!0;if(["broadcast","presence","postgres_changes"].includes(b))if("id"in T){const w=T.id,R=(h=T.filter)===null||h===void 0?void 0:h.event;return w&&((d=s.ids)===null||d===void 0?void 0:d.includes(w))&&(R==="*"||R?.toLocaleLowerCase()===((m=s.data)===null||m===void 0?void 0:m.type.toLocaleLowerCase()))}else{const w=(p=(g=T?.filter)===null||g===void 0?void 0:g.event)===null||p===void 0?void 0:p.toLocaleLowerCase();return w==="*"||w===((_=s?.event)===null||_===void 0?void 0:_.toLocaleLowerCase())}else return T.type.toLocaleLowerCase()===b})}_notThisChannelEvent(n,s){const{close:l,error:c,leave:h,join:d}=cp;return s&&[l,c,h,d].includes(n)&&s!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((n,s,l)=>{if(typeof s=="object"&&"ids"in s){const c=s.data,{schema:h,table:d,commit_timestamp:m,type:g,errors:p}=c;return Object.assign(Object.assign({},{schema:h,table:d,commit_timestamp:m,eventType:g,new:{},old:{},errors:p}),this._getPayloadRecords(c))}return s})}copyBindings(n){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const s in n.bindings)for(const l of n.bindings[s])this._on(l.type,l.filter,l.callback)}static isFilterValueEqual(n,s){return(n??void 0)===(s??void 0)}_getPayloadRecords(n){const s={new:{},old:{}};return(n.type==="INSERT"||n.type==="UPDATE")&&(s.new=kg(n.columns,n.record)),(n.type==="UPDATE"||n.type==="DELETE")&&(s.old=kg(n.columns,n.old_record)),s}}class Rb{constructor(n,s){this.socket=new gb(n,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(n){this.socket.heartbeatCallback=n}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(n,s,l,c=1e4){return new Promise(h=>{setTimeout(()=>h("timeout"),c),this.socket.disconnect(()=>{n(),h("ok")},s,l)})}push(n){this.socket.push(n)}log(n,s,l){this.socket.log(n,s,l)}makeRef(){return this.socket.makeRef()}onOpen(n){this.socket.onOpen(n)}onClose(n){this.socket.onClose(n)}onError(n){this.socket.onError(n)}onMessage(n){this.socket.onMessage(n)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==ch.connecting}isDisconnecting(){return this.socket.connectionState()==ch.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const xg={HEARTBEAT_INTERVAL:25e3},Ob=[1e3,2e3,5e3,1e4],xb=1e4;function jb(){const i=new Map;return{get length(){return i.size},clear(){i.clear()},getItem(n){return i.has(n)?i.get(n):null},key(n){var s;return(s=Array.from(i.keys())[n])!==null&&s!==void 0?s:null},removeItem(n){i.delete(n)},setItem(n,s){i.set(n,String(s))}}}function Nb(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return jb()}const Db=`
|
|
16
|
-
addEventListener("message", (e) => {
|
|
17
|
-
if (e.data.event === "start") {
|
|
18
|
-
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
|
19
|
-
}
|
|
20
|
-
});`;class Ub{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(n,s){var l;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 eb,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=h=>h?(...d)=>h(...d):(...d)=>fetch(...d),!(!((l=s?.params)===null||l===void 0)&&l.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=s.params.apikey;const c=this._initializeOptions(s);this.socketAdapter=new Rb(n,c),this.httpEndpoint=dp(n),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(n){const s=n.message;throw new Error(`WebSocket not available: ${s}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(n,s){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},n,s)}getChannels(){return this.channels}async removeChannel(n){const s=await n.unsubscribe();return s==="ok"&&n.teardown(),s}async removeAllChannels(){const n=this.channels.map(async l=>{const c=await l.unsubscribe();return l.teardown(),c}),s=await Promise.all(n);return await this.disconnect(),s}log(n,s,l){this.socketAdapter.log(n,s,l)}connectionState(){return this.socketAdapter.connectionState()||ch.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(n,s={config:{}}){const l=`realtime:${n}`,c=this.getChannels().find(h=>h.topic===l);if(c)return c;{const h=new wr(`realtime:${n}`,s,this);return this._cancelPendingDisconnect(),this.channels.push(h),h}}push(n){this.socketAdapter.push(n)}async setAuth(n=null){this._authPromise=this._performAuth(n);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(n){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(n)}_makeRef(){return this.socketAdapter.makeRef()}_remove(n){this.channels=this.channels.filter(s=>s.topic!==n.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(n=null){let s,l=!1;if(n)s=n,l=!0;else if(this.accessToken)try{s=await this.accessToken()}catch(c){this.log("error","Error fetching access token from callback",c),s=this.accessTokenValue}else s=this.accessTokenValue;l?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=s&&(this.accessTokenValue=s,this.channels.forEach(c=>{const h={access_token:s,version:X0};s&&c.updateJoinPayload(h),c.joinedOnce&&c.channelAdapter.isJoined()&&c.channelAdapter.push(cp.access_token,{access_token:s})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(n="general"){this._isManualToken()||this.setAuth().catch(s=>{this.log("error",`Error setting auth in ${n}`,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(n=>{n.ref&&n.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(n){return(s,l)=>{s=="sent"&&this._setAuthSafely(),n&&n(s,l)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const n=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(n),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(n){let s;if(n)s=n;else{const l=new Blob([Db],{type:"application/javascript"});s=URL.createObjectURL(l)}return s}_initializeOptions(n){var s,l,c,h,d,m,g,p,_,b,T,w;this.worker=(s=n?.worker)!==null&&s!==void 0?s:!1,this.accessToken=(l=n?.accessToken)!==null&&l!==void 0?l:null;const R={};R.timeout=(c=n?.timeout)!==null&&c!==void 0?c:F0,R.heartbeatIntervalMs=(h=n?.heartbeatIntervalMs)!==null&&h!==void 0?h:xg.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(d=n?.disconnectOnEmptyChannelsAfterMs)!==null&&d!==void 0?d:2*((m=n?.heartbeatIntervalMs)!==null&&m!==void 0?m:xg.HEARTBEAT_INTERVAL),R.transport=(g=n?.transport)!==null&&g!==void 0?g:Y0.getWebSocketConstructor(),R.params=n?.params,R.logger=n?.logger,R.heartbeatCallback=this._wrapHeartbeatCallback(n?.heartbeatCallback),R.sessionStorage=(p=n?.sessionStorage)!==null&&p!==void 0?p:Nb(),R.reconnectAfterMs=(_=n?.reconnectAfterMs)!==null&&_!==void 0?_:(H=>Ob[H-1]||xb);let D,q;const $=(b=n?.vsn)!==null&&b!==void 0?b:Z0;switch($){case Q0:D=(H,P)=>P(JSON.stringify(H)),q=(H,P)=>P(JSON.parse(H));break;case up:D=this.serializer.encode.bind(this.serializer),q=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${R.vsn}`)}if(R.vsn=$,R.encode=(T=n?.encode)!==null&&T!==void 0?T:D,R.decode=(w=n?.decode)!==null&&w!==void 0?w:q,R.beforeReconnect=this._reconnectAuth.bind(this),(n?.logLevel||n?.log_level)&&(this.logLevel=n.logLevel||n.log_level,R.params=Object.assign(Object.assign({},R.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=n?.workerUrl,R.autoSendHeartbeat=!this.worker}return R}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var Ar=class extends Error{constructor(i,n){super(i),this.name="IcebergError",this.status=n.status,this.icebergType=n.icebergType,this.icebergCode=n.icebergCode,this.details=n.details,this.isCommitStateUnknown=n.icebergType==="CommitStateUnknownException"||[500,502,504].includes(n.status)&&n.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function Lb(i,n,s){const l=new URL(n,i);if(s)for(const[c,h]of Object.entries(s))h!==void 0&&l.searchParams.set(c,h);return l.toString()}async function zb(i){return!i||i.type==="none"?{}:i.type==="bearer"?{Authorization:`Bearer ${i.token}`}:i.type==="header"?{[i.name]:i.value}:i.type==="custom"?await i.getHeaders():{}}function Mb(i){const n=i.fetchImpl??globalThis.fetch;return{async request({method:s,path:l,query:c,body:h,headers:d}){const m=Lb(i.baseUrl,l,c),g=await zb(i.auth),p=await n(m,{method:s,headers:{...h?{"Content-Type":"application/json"}:{},...g,...d},body:h?JSON.stringify(h):void 0}),_=await p.text(),b=(p.headers.get("content-type")||"").includes("application/json"),T=b&&_?JSON.parse(_):_;if(!p.ok){const w=b?T:void 0,R=w?.error;throw new Ar(R?.message??`Request failed with status ${p.status}`,{status:p.status,icebergType:R?.type,icebergCode:R?.code,details:w})}return{status:p.status,headers:p.headers,data:T}}}}function so(i){return i.join("")}var Bb=class{constructor(i,n=""){this.client=i,this.prefix=n}async listNamespaces(i){const n=i?{parent:so(i.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:n})).data.namespaces.map(l=>({namespace:l}))}async createNamespace(i,n){const s={namespace:i.namespace,properties:n?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:s})).data}async dropNamespace(i){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${so(i.namespace)}`})}async loadNamespaceMetadata(i){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${so(i.namespace)}`})).data.properties}}async namespaceExists(i){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${so(i.namespace)}`}),!0}catch(n){if(n instanceof Ar&&n.status===404)return!1;throw n}}async createNamespaceIfNotExists(i,n){try{return await this.createNamespace(i,n)}catch(s){if(s instanceof Ar&&s.status===409)return;throw s}}};function Fi(i){return i.join("")}var Hb=class{constructor(i,n="",s){this.client=i,this.prefix=n,this.accessDelegation=s}async listTables(i){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Fi(i.namespace)}/tables`})).data.identifiers}async createTable(i,n){const s={};return this.accessDelegation&&(s["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Fi(i.namespace)}/tables`,body:n,headers:s})).data.metadata}async updateTable(i,n){const s=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Fi(i.namespace)}/tables/${i.name}`,body:n});return{"metadata-location":s.data["metadata-location"],metadata:s.data.metadata}}async dropTable(i,n){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Fi(i.namespace)}/tables/${i.name}`,query:{purgeRequested:String(n?.purge??!1)}})}async loadTable(i){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Fi(i.namespace)}/tables/${i.name}`,headers:n})).data.metadata}async tableExists(i){const n={};this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Fi(i.namespace)}/tables/${i.name}`,headers:n}),!0}catch(s){if(s instanceof Ar&&s.status===404)return!1;throw s}}async createTableIfNotExists(i,n){try{return await this.createTable(i,n)}catch(s){if(s instanceof Ar&&s.status===409)return await this.loadTable({namespace:i.namespace,name:n.name});throw s}}},$b=class{constructor(i){let n="v1";i.catalogName&&(n+=`/${i.catalogName}`);const s=i.baseUrl.endsWith("/")?i.baseUrl:`${i.baseUrl}/`;this.client=Mb({baseUrl:s,auth:i.auth,fetchImpl:i.fetch}),this.accessDelegation=i.accessDelegation?.join(","),this.namespaceOps=new Bb(this.client,n),this.tableOps=new Hb(this.client,n,this.accessDelegation)}async listNamespaces(i){return this.namespaceOps.listNamespaces(i)}async createNamespace(i,n){return this.namespaceOps.createNamespace(i,n)}async dropNamespace(i){await this.namespaceOps.dropNamespace(i)}async loadNamespaceMetadata(i){return this.namespaceOps.loadNamespaceMetadata(i)}async listTables(i){return this.tableOps.listTables(i)}async createTable(i,n){return this.tableOps.createTable(i,n)}async updateTable(i,n){return this.tableOps.updateTable(i,n)}async dropTable(i,n){await this.tableOps.dropTable(i,n)}async loadTable(i){return this.tableOps.loadTable(i)}async namespaceExists(i){return this.namespaceOps.namespaceExists(i)}async tableExists(i){return this.tableOps.tableExists(i)}async createNamespaceIfNotExists(i,n){return this.namespaceOps.createNamespaceIfNotExists(i,n)}async createTableIfNotExists(i,n){return this.tableOps.createTableIfNotExists(i,n)}};function Cr(i){"@babel/helpers - typeof";return Cr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Cr(i)}function qb(i,n){if(Cr(i)!="object"||!i)return i;var s=i[Symbol.toPrimitive];if(s!==void 0){var l=s.call(i,n);if(Cr(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(i)}function Pb(i){var n=qb(i,"string");return Cr(n)=="symbol"?n:n+""}function Gb(i,n,s){return(n=Pb(n))in i?Object.defineProperty(i,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[n]=s,i}function jg(i,n){var s=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);n&&(l=l.filter(function(c){return Object.getOwnPropertyDescriptor(i,c).enumerable})),s.push.apply(s,l)}return s}function re(i){for(var n=1;n<arguments.length;n++){var s=arguments[n]!=null?arguments[n]:{};n%2?jg(Object(s),!0).forEach(function(l){Gb(i,l,s[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(s)):jg(Object(s)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(s,l))})}return i}var Eo=class extends Error{constructor(i,n="storage",s,l){super(i),this.__isStorageError=!0,this.namespace=n,this.name=n==="vectors"?"StorageVectorsError":"StorageError",this.status=s,this.statusCode=l}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function ko(i){return typeof i=="object"&&i!==null&&"__isStorageError"in i}var mh=class extends Eo{constructor(i,n,s,l="storage"){super(i,l,n,s),this.name=l==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=n,this.statusCode=s}toJSON(){return re({},super.toJSON())}},mp=class extends Eo{constructor(i,n,s="storage"){super(i,s),this.name=s==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=n}};function po(i,n,s){const l=re({},i),c=n.toLowerCase();for(const h of Object.keys(l))h.toLowerCase()===c&&delete l[h];return l[c]=s,l}function Vb(i){const n={};for(const[s,l]of Object.entries(i))n[s.toLowerCase()]=l;return n}const Kb=i=>i?(...n)=>i(...n):(...n)=>fetch(...n),Ib=i=>{if(typeof i!="object"||i===null)return!1;const n=Object.getPrototypeOf(i);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)},gh=i=>{if(Array.isArray(i))return i.map(s=>gh(s));if(typeof i=="function"||i!==Object(i))return i;const n={};return Object.entries(i).forEach(([s,l])=>{const c=s.replace(/([-_][a-z])/gi,h=>h.toUpperCase().replace(/[-_]/g,""));n[c]=gh(l)}),n},Yb=i=>!i||typeof i!="string"||i.length===0||i.length>100||i.trim()!==i||i.includes("/")||i.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(i),Ng=i=>{if(typeof i=="object"&&i!==null){const n=i;if(typeof n.msg=="string")return n.msg;if(typeof n.message=="string")return n.message;if(typeof n.error_description=="string")return n.error_description;if(typeof n.error=="string")return n.error;if(typeof n.error=="object"&&n.error!==null){const s=n.error;if(typeof s.message=="string")return s.message}}return JSON.stringify(i)},Jb=async(i,n,s,l)=>{if(i!==null&&typeof i=="object"&&"json"in i&&typeof i.json=="function"){const c=i;let h=parseInt(String(c.status),10);Number.isFinite(h)||(h=500),c.json().then(d=>{const m=d?.statusCode||d?.code||h+"";n(new mh(Ng(d),h,m,l))}).catch(()=>{const d=h+"";n(new mh(c.statusText||`HTTP ${h} error`,h,d,l))})}else n(new mp(Ng(i),i,l))},Xb=(i,n,s,l)=>{const c={method:i,headers:n?.headers||{}};if(i==="GET"||i==="HEAD"||!l)return re(re({},c),s);if(Ib(l)){var h;const d=n?.headers||{};let m;for(const[g,p]of Object.entries(d))g.toLowerCase()==="content-type"&&(m=p);c.headers=po(d,"Content-Type",(h=m)!==null&&h!==void 0?h:"application/json"),c.body=JSON.stringify(l)}else c.body=l;return n?.duplex&&(c.duplex=n.duplex),re(re({},c),s)};async function fr(i,n,s,l,c,h,d){return new Promise((m,g)=>{i(s,Xb(n,l,c,h)).then(p=>{if(!p.ok)throw p;if(l?.noResolveJson)return p;if(d==="vectors"){const _=p.headers.get("content-type");if(p.headers.get("content-length")==="0"||p.status===204)return{};if(!_||!_.includes("application/json"))return{}}return p.json()}).then(p=>m(p)).catch(p=>Jb(p,g,l,d))})}function gp(i="storage"){return{get:async(n,s,l,c)=>fr(n,"GET",s,l,c,void 0,i),post:async(n,s,l,c,h)=>fr(n,"POST",s,c,h,l,i),put:async(n,s,l,c,h)=>fr(n,"PUT",s,c,h,l,i),head:async(n,s,l,c)=>fr(n,"HEAD",s,re(re({},l),{},{noResolveJson:!0}),c,void 0,i),remove:async(n,s,l,c,h)=>fr(n,"DELETE",s,c,h,l,i)}}const Qb=gp("storage"),{get:Rr,post:bn,put:ph,head:Zb,remove:Or}=Qb,Yt=gp("vectors");var ds=class{constructor(i,n={},s,l="storage"){this.shouldThrowOnError=!1,this.url=i,this.headers=Vb(n),this.fetch=Kb(s),this.namespace=l}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(i,n){return this.headers=po(this.headers,i,n),this}async handleOperation(i){var n=this;try{return{data:await i(),error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(ko(s))return{data:null,error:s};throw s}}};let pp;pp=Symbol.toStringTag;var Fb=class{constructor(i,n){this.downloadFn=i,this.shouldThrowOnError=n,this[pp]="StreamDownloadBuilder",this.promise=null}then(i,n){return this.getPromise().then(i,n)}catch(i){return this.getPromise().catch(i)}finally(i){return this.getPromise().finally(i)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var i=this;try{return{data:(await i.downloadFn()).body,error:null}}catch(n){if(i.shouldThrowOnError)throw n;if(ko(n))return{data:null,error:n};throw n}}};let yp;yp=Symbol.toStringTag;var Wb=class{constructor(i,n){this.downloadFn=i,this.shouldThrowOnError=n,this[yp]="BlobDownloadBuilder",this.promise=null}asStream(){return new Fb(this.downloadFn,this.shouldThrowOnError)}then(i,n){return this.getPromise().then(i,n)}catch(i){return this.getPromise().catch(i)}finally(i){return this.getPromise().finally(i)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var i=this;try{return{data:await(await i.downloadFn()).blob(),error:null}}catch(n){if(i.shouldThrowOnError)throw n;if(ko(n))return{data:null,error:n};throw n}}};const Zc={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Dg={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var e_=class extends ds{constructor(i,n={},s,l){super(i,n,l,"storage"),this.bucketId=s}async uploadOrUpdate(i,n,s,l){var c=this;return c.handleOperation(async()=>{let h;const d=re(re({},Dg),l);let m=re(re({},c.headers),i==="POST"&&{"x-upsert":String(d.upsert)});const g=d.metadata;if(typeof Blob<"u"&&s instanceof Blob?(h=new FormData,h.append("cacheControl",d.cacheControl),g&&h.append("metadata",c.encodeMetadata(g)),h.append("",s)):typeof FormData<"u"&&s instanceof FormData?(h=s,h.has("cacheControl")||h.append("cacheControl",d.cacheControl),g&&!h.has("metadata")&&h.append("metadata",c.encodeMetadata(g))):(h=s,m["cache-control"]=`max-age=${d.cacheControl}`,m["content-type"]=d.contentType,g&&(m["x-metadata"]=c.toBase64(c.encodeMetadata(g))),(typeof ReadableStream<"u"&&h instanceof ReadableStream||h&&typeof h=="object"&&"pipe"in h&&typeof h.pipe=="function")&&!d.duplex&&(d.duplex="half")),l?.headers)for(const[T,w]of Object.entries(l.headers))m=po(m,T,w);const p=c._removeEmptyFolders(n),_=c._getFinalPath(p),b=await(i=="PUT"?ph:bn)(c.fetch,`${c.url}/object/${_}`,h,re({headers:m},d?.duplex?{duplex:d.duplex}:{}));return{path:p,id:b.Id,fullPath:b.Key}})}async upload(i,n,s){return this.uploadOrUpdate("POST",i,n,s)}async uploadToSignedUrl(i,n,s,l){var c=this;const h=c._removeEmptyFolders(i),d=c._getFinalPath(h),m=new URL(c.url+`/object/upload/sign/${d}`);return m.searchParams.set("token",n),c.handleOperation(async()=>{let g;const p=re(re({},Dg),l);let _=re(re({},c.headers),{"x-upsert":String(p.upsert)});const b=p.metadata;if(typeof Blob<"u"&&s instanceof Blob?(g=new FormData,g.append("cacheControl",p.cacheControl),b&&g.append("metadata",c.encodeMetadata(b)),g.append("",s)):typeof FormData<"u"&&s instanceof FormData?(g=s,g.has("cacheControl")||g.append("cacheControl",p.cacheControl),b&&!g.has("metadata")&&g.append("metadata",c.encodeMetadata(b))):(g=s,_["cache-control"]=`max-age=${p.cacheControl}`,_["content-type"]=p.contentType,b&&(_["x-metadata"]=c.toBase64(c.encodeMetadata(b))),(typeof ReadableStream<"u"&&g instanceof ReadableStream||g&&typeof g=="object"&&"pipe"in g&&typeof g.pipe=="function")&&!p.duplex&&(p.duplex="half")),l?.headers)for(const[T,w]of Object.entries(l.headers))_=po(_,T,w);return{path:h,fullPath:(await ph(c.fetch,m.toString(),g,re({headers:_},p?.duplex?{duplex:p.duplex}:{}))).Key}})}async createSignedUploadUrl(i,n){var s=this;return s.handleOperation(async()=>{let l=s._getFinalPath(i);const c=re({},s.headers);n?.upsert&&(c["x-upsert"]="true");const h=await bn(s.fetch,`${s.url}/object/upload/sign/${l}`,{},{headers:c}),d=new URL(s.url+h.url),m=d.searchParams.get("token");if(!m)throw new Eo("No token returned by API");return{signedUrl:d.toString(),path:i,token:m}})}async update(i,n,s){return this.uploadOrUpdate("PUT",i,n,s)}async move(i,n,s){var l=this;return l.handleOperation(async()=>await bn(l.fetch,`${l.url}/object/move`,{bucketId:l.bucketId,sourceKey:i,destinationKey:n,destinationBucket:s?.destinationBucket},{headers:l.headers}))}async copy(i,n,s){var l=this;return l.handleOperation(async()=>({path:(await bn(l.fetch,`${l.url}/object/copy`,{bucketId:l.bucketId,sourceKey:i,destinationKey:n,destinationBucket:s?.destinationBucket},{headers:l.headers})).Key}))}async createSignedUrl(i,n,s){var l=this;return l.handleOperation(async()=>{let c=l._getFinalPath(i);const h=typeof s?.transform=="object"&&s.transform!==null&&Object.keys(s.transform).length>0;let d=await bn(l.fetch,`${l.url}/object/sign/${c}`,re({expiresIn:n},h?{transform:s.transform}:{}),{headers:l.headers});const m=new URLSearchParams;s?.download&&m.set("download",s.download===!0?"":s.download),s?.cacheNonce!=null&&m.set("cacheNonce",String(s.cacheNonce));const g=m.toString();return{signedUrl:encodeURI(`${l.url}${d.signedURL}${g?`&${g}`:""}`)}})}async createSignedUrls(i,n,s){var l=this;return l.handleOperation(async()=>{const c=await bn(l.fetch,`${l.url}/object/sign/${l.bucketId}`,{expiresIn:n,paths:i},{headers:l.headers}),h=new URLSearchParams;s?.download&&h.set("download",s.download===!0?"":s.download),s?.cacheNonce!=null&&h.set("cacheNonce",String(s.cacheNonce));const d=h.toString();return c.map(m=>re(re({},m),{},{signedUrl:m.signedURL?encodeURI(`${l.url}${m.signedURL}${d?`&${d}`:""}`):null}))})}download(i,n,s){const l=typeof n?.transform=="object"&&n.transform!==null&&Object.keys(n.transform).length>0?"render/image/authenticated":"object",c=new URLSearchParams;n?.transform&&this.applyTransformOptsToQuery(c,n.transform),n?.cacheNonce!=null&&c.set("cacheNonce",String(n.cacheNonce));const h=c.toString(),d=this._getFinalPath(i),m=()=>Rr(this.fetch,`${this.url}/${l}/${d}${h?`?${h}`:""}`,{headers:this.headers,noResolveJson:!0},s);return new Wb(m,this.shouldThrowOnError)}async info(i){var n=this;const s=n._getFinalPath(i);return n.handleOperation(async()=>gh(await Rr(n.fetch,`${n.url}/object/info/${s}`,{headers:n.headers})))}async exists(i){var n=this;const s=n._getFinalPath(i);try{return await Zb(n.fetch,`${n.url}/object/${s}`,{headers:n.headers}),{data:!0,error:null}}catch(c){if(n.shouldThrowOnError)throw c;if(ko(c)){var l;const h=c instanceof mh?c.status:c instanceof mp?(l=c.originalError)===null||l===void 0?void 0:l.status:void 0;if(h!==void 0&&[400,404].includes(h))return{data:!1,error:c}}throw c}}getPublicUrl(i,n){const s=this._getFinalPath(i),l=new URLSearchParams;n?.download&&l.set("download",n.download===!0?"":n.download),n?.transform&&this.applyTransformOptsToQuery(l,n.transform),n?.cacheNonce!=null&&l.set("cacheNonce",String(n.cacheNonce));const c=l.toString(),h=typeof n?.transform=="object"&&n.transform!==null&&Object.keys(n.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${h}/public/${s}`)+(c?`?${c}`:"")}}}async remove(i){var n=this;return n.handleOperation(async()=>await Or(n.fetch,`${n.url}/object/${n.bucketId}`,{prefixes:i},{headers:n.headers}))}async purgeCache(i,n,s){var l=this;return l.handleOperation(async()=>{const c=l._getFinalPath(i),h=new URLSearchParams;n?.transformations&&h.set("transformations","true");const d=h.toString();return await Or(l.fetch,`${l.url}/cdn/${c}${d?`?${d}`:""}`,{},{headers:l.headers},s)})}async list(i,n,s){var l=this;return l.handleOperation(async()=>{const c=n?.sortBy?re(re({},Zc.sortBy),n.sortBy):Zc.sortBy,h=re(re(re({},Zc),n),{},{sortBy:c,prefix:i||""});return await bn(l.fetch,`${l.url}/object/list/${l.bucketId}`,h,{headers:l.headers},s)})}async listV2(i,n){var s=this;return s.handleOperation(async()=>{const l=re({},i);return await bn(s.fetch,`${s.url}/object/list-v2/${s.bucketId}`,l,{headers:s.headers},n)})}encodeMetadata(i){return JSON.stringify(i)}toBase64(i){return typeof Buffer<"u"?Buffer.from(i).toString("base64"):btoa(i)}_getFinalPath(i){return`${this.bucketId}/${i.replace(/^\/+/,"")}`}_removeEmptyFolders(i){return i.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(i,n){return n.width&&i.set("width",n.width.toString()),n.height&&i.set("height",n.height.toString()),n.resize&&i.set("resize",n.resize),n.format&&i.set("format",n.format),n.quality&&i.set("quality",n.quality.toString()),i}};const t_="2.110.0",Dr={"X-Client-Info":`storage-js/${t_}`};var n_=class extends ds{constructor(i,n={},s,l){const c=new URL(i);l?.useNewHostname&&/supabase\.(co|in|red)$/.test(c.hostname)&&!c.hostname.includes("storage.supabase.")&&(c.hostname=c.hostname.replace("supabase.","storage.supabase."));const h=c.href.replace(/\/$/,""),d=re(re({},Dr),n);super(h,d,s,"storage")}async listBuckets(i){var n=this;return n.handleOperation(async()=>{const s=n.listBucketOptionsToQueryString(i);return await Rr(n.fetch,`${n.url}/bucket${s}`,{headers:n.headers})})}async getBucket(i){var n=this;return n.handleOperation(async()=>await Rr(n.fetch,`${n.url}/bucket/${i}`,{headers:n.headers}))}async createBucket(i,n={public:!1}){var s=this;return s.handleOperation(async()=>await bn(s.fetch,`${s.url}/bucket`,{id:i,name:i,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:s.headers}))}async updateBucket(i,n){var s=this;return s.handleOperation(async()=>await ph(s.fetch,`${s.url}/bucket/${i}`,{id:i,name:i,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:s.headers}))}async emptyBucket(i){var n=this;return n.handleOperation(async()=>await bn(n.fetch,`${n.url}/bucket/${i}/empty`,{},{headers:n.headers}))}async deleteBucket(i){var n=this;return n.handleOperation(async()=>await Or(n.fetch,`${n.url}/bucket/${i}`,{},{headers:n.headers}))}async purgeBucketCache(i,n,s){var l=this;return l.handleOperation(async()=>{const c=new URLSearchParams;n?.transformations&&c.set("transformations","true");const h=c.toString();return await Or(l.fetch,`${l.url}/cdn/${i}${h?`?${h}`:""}`,{},{headers:l.headers},s)})}listBucketOptionsToQueryString(i){const n={};return i&&("limit"in i&&(n.limit=String(i.limit)),"offset"in i&&(n.offset=String(i.offset)),i.search&&(n.search=i.search),i.sortColumn&&(n.sortColumn=i.sortColumn),i.sortOrder&&(n.sortOrder=i.sortOrder)),Object.keys(n).length>0?"?"+new URLSearchParams(n).toString():""}},a_=class extends ds{constructor(i,n={},s){const l=i.replace(/\/$/,""),c=re(re({},Dr),n);super(l,c,s,"storage")}async createBucket(i){var n=this;return n.handleOperation(async()=>await bn(n.fetch,`${n.url}/bucket`,{name:i},{headers:n.headers}))}async listBuckets(i){var n=this;return n.handleOperation(async()=>{const s=new URLSearchParams;i?.limit!==void 0&&s.set("limit",i.limit.toString()),i?.offset!==void 0&&s.set("offset",i.offset.toString()),i?.sortColumn&&s.set("sortColumn",i.sortColumn),i?.sortOrder&&s.set("sortOrder",i.sortOrder),i?.search&&s.set("search",i.search);const l=s.toString(),c=l?`${n.url}/bucket?${l}`:`${n.url}/bucket`;return await Rr(n.fetch,c,{headers:n.headers})})}async deleteBucket(i){var n=this;return n.handleOperation(async()=>await Or(n.fetch,`${n.url}/bucket/${i}`,{},{headers:n.headers}))}from(i){var n=this;if(!Yb(i))throw new Eo("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 $b({baseUrl:this.url,catalogName:i,auth:{type:"custom",getHeaders:async()=>n.headers},fetch:this.fetch}),l=this.shouldThrowOnError;return new Proxy(s,{get(c,h){const d=c[h];return typeof d!="function"?d:async(...m)=>{try{return{data:await d.apply(c,m),error:null}}catch(g){if(l)throw g;return{data:null,error:g}}}}})}},i_=class extends ds{constructor(i,n={},s){const l=i.replace(/\/$/,""),c=re(re({},Dr),{},{"Content-Type":"application/json"},n);super(l,c,s,"vectors")}async createIndex(i){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/CreateIndex`,i,{headers:n.headers})||{})}async getIndex(i,n){var s=this;return s.handleOperation(async()=>await Yt.post(s.fetch,`${s.url}/GetIndex`,{vectorBucketName:i,indexName:n},{headers:s.headers}))}async listIndexes(i){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/ListIndexes`,i,{headers:n.headers}))}async deleteIndex(i,n){var s=this;return s.handleOperation(async()=>await Yt.post(s.fetch,`${s.url}/DeleteIndex`,{vectorBucketName:i,indexName:n},{headers:s.headers})||{})}},s_=class extends ds{constructor(i,n={},s){const l=i.replace(/\/$/,""),c=re(re({},Dr),{},{"Content-Type":"application/json"},n);super(l,c,s,"vectors")}async putVectors(i){var n=this;if(i.vectors.length<1||i.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/PutVectors`,i,{headers:n.headers})||{})}async getVectors(i){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/GetVectors`,i,{headers:n.headers}))}async listVectors(i){var n=this;if(i.segmentCount!==void 0){if(i.segmentCount<1||i.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(i.segmentIndex!==void 0&&(i.segmentIndex<0||i.segmentIndex>=i.segmentCount))throw new Error(`segmentIndex must be between 0 and ${i.segmentCount-1}`)}return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/ListVectors`,i,{headers:n.headers}))}async queryVectors(i){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/QueryVectors`,i,{headers:n.headers}))}async deleteVectors(i){var n=this;if(i.keys.length<1||i.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/DeleteVectors`,i,{headers:n.headers})||{})}},r_=class extends ds{constructor(i,n={},s){const l=i.replace(/\/$/,""),c=re(re({},Dr),{},{"Content-Type":"application/json"},n);super(l,c,s,"vectors")}async createBucket(i){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/CreateVectorBucket`,{vectorBucketName:i},{headers:n.headers})||{})}async getBucket(i){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/GetVectorBucket`,{vectorBucketName:i},{headers:n.headers}))}async listBuckets(i={}){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/ListVectorBuckets`,i,{headers:n.headers}))}async deleteBucket(i){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/DeleteVectorBucket`,{vectorBucketName:i},{headers:n.headers})||{})}},l_=class extends r_{constructor(i,n={}){super(i,n.headers||{},n.fetch)}from(i){return new o_(this.url,this.headers,i,this.fetch)}async createBucket(i){var n=()=>super.createBucket,s=this;return n().call(s,i)}async getBucket(i){var n=()=>super.getBucket,s=this;return n().call(s,i)}async listBuckets(i={}){var n=()=>super.listBuckets,s=this;return n().call(s,i)}async deleteBucket(i){var n=()=>super.deleteBucket,s=this;return n().call(s,i)}},o_=class extends i_{constructor(i,n,s,l){super(i,n,l),this.vectorBucketName=s}async createIndex(i){var n=()=>super.createIndex,s=this;return n().call(s,re(re({},i),{},{vectorBucketName:s.vectorBucketName}))}async listIndexes(i={}){var n=()=>super.listIndexes,s=this;return n().call(s,re(re({},i),{},{vectorBucketName:s.vectorBucketName}))}async getIndex(i){var n=()=>super.getIndex,s=this;return n().call(s,s.vectorBucketName,i)}async deleteIndex(i){var n=()=>super.deleteIndex,s=this;return n().call(s,s.vectorBucketName,i)}index(i){return new u_(this.url,this.headers,this.vectorBucketName,i,this.fetch)}},u_=class extends s_{constructor(i,n,s,l,c){super(i,n,c),this.vectorBucketName=s,this.indexName=l}async putVectors(i){var n=()=>super.putVectors,s=this;return n().call(s,re(re({},i),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}async getVectors(i){var n=()=>super.getVectors,s=this;return n().call(s,re(re({},i),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}async listVectors(i={}){var n=()=>super.listVectors,s=this;return n().call(s,re(re({},i),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}async queryVectors(i){var n=()=>super.queryVectors,s=this;return n().call(s,re(re({},i),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}async deleteVectors(i){var n=()=>super.deleteVectors,s=this;return n().call(s,re(re({},i),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}},c_=class extends n_{constructor(i,n={},s,l){super(i,n,s,l)}from(i){return new e_(this.url,this.headers,i,this.fetch)}get vectors(){return new l_(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new a_(this.url+"/iceberg",this.headers,this.fetch)}};const vp="2.110.0",ia=30*1e3,yr=3,Fc=yr*ia,h_=2*ia,d_="http://localhost:9999",f_="supabase.auth.token",m_={"X-Client-Info":`gotrue-js/${vp}`},yh="X-Supabase-Api-Version",bp={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},g_=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,p_=600*1e3;class xr extends Error{constructor(n,s,l){super(n),this.__isAuthError=!0,this.name="AuthError",this.status=s,this.code=l}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function Y(i){return typeof i=="object"&&i!==null&&"__isAuthError"in i}class y_ extends xr{constructor(n,s,l){super(n,s,l),this.name="AuthApiError",this.status=s,this.code=l}}function v_(i){return Y(i)&&i.name==="AuthApiError"}class _n extends xr{constructor(n,s){super(n),this.name="AuthUnknownError",this.originalError=s}}class Nn extends xr{constructor(n,s,l,c){super(n,l,c),this.name=s,this.status=l}}class mt extends Nn{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function ro(i){return Y(i)&&i.name==="AuthSessionMissingError"}class Wi extends Nn{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class lo extends Nn{constructor(n){super(n,"AuthInvalidCredentialsError",400,void 0)}}class oo extends Nn{constructor(n,s=null){super(n,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=s}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function b_(i){return Y(i)&&i.name==="AuthImplicitGrantRedirectError"}class Ug extends Nn{constructor(n,s=null){super(n,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=s}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class __ extends Nn{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 vh extends Nn{constructor(n,s){super(n,"AuthRetryableFetchError",s,void 0)}}function Lg(i){return Y(i)&&i.name==="AuthRetryableFetchError"}class zg extends Nn{constructor(n="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(n,"AuthRefreshDiscardedError",409,void 0)}}function w_(i){return Y(i)&&i.name==="AuthRefreshDiscardedError"}class Mg extends Nn{constructor(n,s,l){super(n,"AuthWeakPasswordError",s,"weak_password"),this.reasons=l}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class yo extends Nn{constructor(n){super(n,"AuthInvalidJwtError",400,"invalid_jwt")}}const vo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Bg=`
|
|
21
|
-
\r=`.split(""),S_=(()=>{const i=new Array(128);for(let n=0;n<i.length;n+=1)i[n]=-1;for(let n=0;n<Bg.length;n+=1)i[Bg[n].charCodeAt(0)]=-2;for(let n=0;n<vo.length;n+=1)i[vo[n].charCodeAt(0)]=n;return i})();function Hg(i,n,s){if(i!==null)for(n.queue=n.queue<<8|i,n.queuedBits+=8;n.queuedBits>=6;){const l=n.queue>>n.queuedBits-6&63;s(vo[l]),n.queuedBits-=6}else if(n.queuedBits>0)for(n.queue=n.queue<<6-n.queuedBits,n.queuedBits=6;n.queuedBits>=6;){const l=n.queue>>n.queuedBits-6&63;s(vo[l]),n.queuedBits-=6}}function _p(i,n,s){const l=S_[i];if(l>-1)for(n.queue=n.queue<<6|l,n.queuedBits+=6;n.queuedBits>=8;)s(n.queue>>n.queuedBits-8&255),n.queuedBits-=8;else{if(l===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(i)}"`)}}function $g(i){const n=[],s=d=>{n.push(String.fromCodePoint(d))},l={utf8seq:0,codepoint:0},c={queue:0,queuedBits:0},h=d=>{k_(d,l,s)};for(let d=0;d<i.length;d+=1)_p(i.charCodeAt(d),c,h);return n.join("")}function T_(i,n){if(i<=127){n(i);return}else if(i<=2047){n(192|i>>6),n(128|i&63);return}else if(i<=65535){n(224|i>>12),n(128|i>>6&63),n(128|i&63);return}else if(i<=1114111){n(240|i>>18),n(128|i>>12&63),n(128|i>>6&63),n(128|i&63);return}throw new Error(`Unrecognized Unicode codepoint: ${i.toString(16)}`)}function E_(i,n){for(let s=0;s<i.length;s+=1){let l=i.charCodeAt(s);if(l>55295&&l<=56319){const c=(l-55296)*1024&65535;l=(i.charCodeAt(s+1)-56320&65535|c)+65536,s+=1}T_(l,n)}}function k_(i,n,s){if(n.utf8seq===0){if(i<=127){s(i);return}for(let l=1;l<6;l+=1)if((i>>7-l&1)===0){n.utf8seq=l;break}if(n.utf8seq===2)n.codepoint=i&31;else if(n.utf8seq===3)n.codepoint=i&15;else if(n.utf8seq===4)n.codepoint=i&7;else throw new Error("Invalid UTF-8 sequence");n.utf8seq-=1}else if(n.utf8seq>0){if(i<=127)throw new Error("Invalid UTF-8 sequence");n.codepoint=n.codepoint<<6|i&63,n.utf8seq-=1,n.utf8seq===0&&s(n.codepoint)}}function cs(i){const n=[],s={queue:0,queuedBits:0},l=c=>{n.push(c)};for(let c=0;c<i.length;c+=1)_p(i.charCodeAt(c),s,l);return new Uint8Array(n)}function A_(i){const n=[];return E_(i,s=>n.push(s)),new Uint8Array(n)}function ui(i){const n=[],s={queue:0,queuedBits:0},l=c=>{n.push(c)};return i.forEach(c=>Hg(c,s,l)),Hg(null,s,l),n.join("")}function C_(i){return Math.round(Date.now()/1e3)+i}function R_(){return Symbol("auth-callback")}const Tt=()=>typeof window<"u"&&typeof document<"u",ri={tested:!1,writable:!1},wp=()=>{if(!Tt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ri.tested)return ri.writable;const i=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(i,i),globalThis.localStorage.removeItem(i),ri.tested=!0,ri.writable=!0}catch{ri.tested=!0,ri.writable=!1}return ri.writable};function O_(i){const n={},s=new URL(i);if(s.hash&&s.hash[0]==="#")try{new URLSearchParams(s.hash.substring(1)).forEach((c,h)=>{n[h]=c})}catch{}return s.searchParams.forEach((l,c)=>{n[c]=l}),n}const Sp=i=>i?(...n)=>i(...n):(...n)=>fetch(...n),x_=i=>typeof i=="object"&&i!==null&&"status"in i&&"ok"in i&&"json"in i&&typeof i.json=="function",ls=async(i,n,s)=>{await i.setItem(n,JSON.stringify(s))},pn=async(i,n)=>{const s=await i.getItem(n);if(!s)return null;try{return JSON.parse(s)}catch{return null}},tt=async(i,n)=>{await i.removeItem(n)};class Ao{constructor(){this.promise=new Ao.promiseConstructor((n,s)=>{this.resolve=n,this.reject=s})}}Ao.promiseConstructor=Promise;function uo(i){const n=i.split(".");if(n.length!==3)throw new yo("Invalid JWT structure");for(let l=0;l<n.length;l++)if(!g_.test(n[l]))throw new yo("JWT not in base64url format");return{header:JSON.parse($g(n[0])),payload:JSON.parse($g(n[1])),signature:cs(n[2]),raw:{header:n[0],payload:n[1]}}}async function j_(i){return await new Promise(n=>{setTimeout(()=>n(null),i)})}function N_(i,n){return new Promise((l,c)=>{(async()=>{for(let h=0;h<1/0;h++)try{const d=await i(h);if(!n(h,null,d)){l(d);return}}catch(d){if(!n(h,d)){c(d);return}}})()})}function D_(i){return("0"+i.toString(16)).substr(-2)}function U_(){const n=new Uint32Array(56);if(typeof crypto>"u"){const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",l=s.length;let c="";for(let h=0;h<56;h++)c+=s.charAt(Math.floor(Math.random()*l));return c}return crypto.getRandomValues(n),Array.from(n,D_).join("")}async function L_(i){const s=new TextEncoder().encode(i),l=await crypto.subtle.digest("SHA-256",s),c=new Uint8Array(l);return Array.from(c).map(h=>String.fromCharCode(h)).join("")}async function z_(i){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."),i;const s=await L_(i);return btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function li(i,n,s=!1){const l=U_();let c=l;s&&(c+="/recovery"),await ls(i,`${n}-code-verifier`,c);const h=await z_(l);return[h,l===h?"plain":"s256"]}const M_=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function B_(i){const n=i.headers.get(yh);if(!n||!n.match(M_))return null;try{return new Date(`${n}T00:00:00.0Z`)}catch{return null}}function H_(i){if(!i)throw new Error("Missing exp claim");const n=Math.floor(Date.now()/1e3);if(i<=n)throw new Error("JWT has expired")}function $_(i){switch(i){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 q_=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function ea(i){if(!q_.test(i))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function yn(i){if(!i.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 Wc(){const i={};return new Proxy(i,{get:(n,s)=>{if(s==="__isUserNotAvailableProxy")return!0;if(typeof s=="symbol"){const l=s.toString();if(l==="Symbol(Symbol.toPrimitive)"||l==="Symbol(Symbol.toStringTag)"||l==="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:(n,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:(n,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 P_(i,n){return new Proxy(i,{get:(s,l,c)=>{if(l==="__isInsecureUserWarningProxy")return!0;if(typeof l=="symbol"){const h=l.toString();if(h==="Symbol(Symbol.toPrimitive)"||h==="Symbol(Symbol.toStringTag)"||h==="Symbol(util.inspect.custom)"||h==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(s,l,c)}return!n.value&&typeof l=="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."),n.value=!0),Reflect.get(s,l,c)}})}function qg(i){return JSON.parse(JSON.stringify(i))}const oi=i=>{if(typeof i=="object"&&i!==null){const n=i;if(typeof n.msg=="string")return n.msg;if(typeof n.message=="string")return n.message;if(typeof n.error_description=="string")return n.error_description;if(typeof n.error=="string")return n.error}return JSON.stringify(i)},G_=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function Pg(i){var n;if(!x_(i))throw new vh(oi(i),0);if(G_.includes(i.status))throw new vh(oi(i),i.status);let s;try{s=await i.json()}catch(h){throw new _n(oi(h),h)}let l;const c=B_(i);if(c&&c.getTime()>=bp["2024-01-01"].timestamp&&typeof s=="object"&&s&&typeof s.code=="string"?l=s.code:typeof s=="object"&&s&&typeof s.error_code=="string"&&(l=s.error_code),l){if(l==="weak_password")throw new Mg(oi(s),i.status,((n=s.weak_password)===null||n===void 0?void 0:n.reasons)||[]);if(l==="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((h,d)=>h&&typeof d=="string",!0))throw new Mg(oi(s),i.status,s.weak_password.reasons);throw new y_(oi(s),i.status||500,l)}const V_=(i,n,s,l)=>{const c={method:i,headers:n?.headers||{}};return i==="GET"?c:(c.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},n?.headers),c.body=JSON.stringify(l),Object.assign(Object.assign({},c),s))};async function F(i,n,s,l){var c;const h=Object.assign({},l?.headers);h[yh]||(h[yh]=bp["2024-01-01"].name),l?.jwt&&(h.Authorization=`Bearer ${l.jwt}`);const d=(c=l?.query)!==null&&c!==void 0?c:{};l?.redirectTo&&(d.redirect_to=l.redirectTo);const m=Object.keys(d).length?"?"+new URLSearchParams(d).toString():"",g=await K_(i,n,s+m,{headers:h,noResolveJson:l?.noResolveJson},{},l?.body);return l?.xform?l?.xform(g):{data:Object.assign({},g),error:null}}async function K_(i,n,s,l,c,h){const d=V_(n,l,c,h);let m;try{m=await i(s,Object.assign({},d))}catch(g){throw console.error(g),new vh(oi(g),0)}if(m.ok||await Pg(m),l?.noResolveJson)return m;try{return await m.json()}catch(g){await Pg(g)}}function rn(i){var n;let s=null;J_(i)&&(s=Object.assign({},i),i.expires_at||(s.expires_at=C_(i.expires_in)));const l=(n=i.user)!==null&&n!==void 0?n:typeof i?.id=="string"?i:null;return{data:{session:s,user:l},error:null}}function Gg(i){const n=rn(i);return!n.error&&i.weak_password&&typeof i.weak_password=="object"&&Array.isArray(i.weak_password.reasons)&&i.weak_password.reasons.length&&i.weak_password.message&&typeof i.weak_password.message=="string"&&i.weak_password.reasons.reduce((s,l)=>s&&typeof l=="string",!0)&&(n.data.weak_password=i.weak_password),n}function za(i){var n;return{data:{user:(n=i.user)!==null&&n!==void 0?n:i},error:null}}function I_(i){return{data:i,error:null}}function Y_(i){const{action_link:n,email_otp:s,hashed_token:l,redirect_to:c,verification_type:h}=i,d=To(i,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),m={action_link:n,email_otp:s,hashed_token:l,redirect_to:c,verification_type:h},g=Object.assign({},d);return{data:{properties:m,user:g},error:null}}function Vg(i){return i}function J_(i){return!!i.access_token&&!!i.refresh_token&&!!i.expires_in}const eh=["global","local","others"];class X_{constructor({url:n="",headers:s={},fetch:l,experimental:c}){this.url=n,this.headers=s,this.fetch=Sp(l),this.experimental=c??{},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(n,s=eh[0]){if(eh.indexOf(s)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${eh.join(", ")}`);try{return await F(this.fetch,"POST",`${this.url}/logout?scope=${s}`,{headers:this.headers,jwt:n,noResolveJson:!0}),{data:null,error:null}}catch(l){if(Y(l))return{data:null,error:l};throw l}}async inviteUserByEmail(n,s={}){try{return await F(this.fetch,"POST",`${this.url}/invite`,{body:{email:n,data:s.data},headers:this.headers,redirectTo:s.redirectTo,xform:za})}catch(l){if(Y(l))return{data:{user:null},error:l};throw l}}async generateLink(n){try{const{options:s}=n,l=To(n,["options"]),c=Object.assign(Object.assign({},l),s);return"newEmail"in l&&(c.new_email=l?.newEmail,delete c.newEmail),await F(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:c,headers:this.headers,xform:Y_,redirectTo:s?.redirectTo})}catch(s){if(Y(s))return{data:{properties:null,user:null},error:s};throw s}}async createUser(n){try{return await F(this.fetch,"POST",`${this.url}/admin/users`,{body:n,headers:this.headers,xform:za})}catch(s){if(Y(s))return{data:{user:null},error:s};throw s}}async listUsers(n){var s,l,c,h,d,m,g;try{const p={nextPage:null,lastPage:0,total:0},_=await F(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(l=(s=n?.page)===null||s===void 0?void 0:s.toString())!==null&&l!==void 0?l:"",per_page:(h=(c=n?.perPage)===null||c===void 0?void 0:c.toString())!==null&&h!==void 0?h:""},xform:Vg});if(_.error)throw _.error;const b=await _.json(),T=(d=_.headers.get("x-total-count"))!==null&&d!==void 0?d:0,w=(g=(m=_.headers.get("link"))===null||m===void 0?void 0:m.split(","))!==null&&g!==void 0?g:[];return w.length>0&&(w.forEach(R=>{const D=parseInt(R.split(";")[0].split("=")[1].substring(0,1)),q=JSON.parse(R.split(";")[1].split("=")[1]);p[`${q}Page`]=D}),p.total=parseInt(T)),{data:Object.assign(Object.assign({},b),p),error:null}}catch(p){if(Y(p))return{data:{users:[]},error:p};throw p}}async getUserById(n){ea(n);try{return await F(this.fetch,"GET",`${this.url}/admin/users/${n}`,{headers:this.headers,xform:za})}catch(s){if(Y(s))return{data:{user:null},error:s};throw s}}async updateUserById(n,s){ea(n);try{return await F(this.fetch,"PUT",`${this.url}/admin/users/${n}`,{body:s,headers:this.headers,xform:za})}catch(l){if(Y(l))return{data:{user:null},error:l};throw l}}async deleteUser(n,s=!1){ea(n);try{return await F(this.fetch,"DELETE",`${this.url}/admin/users/${n}`,{headers:this.headers,body:{should_soft_delete:s},xform:za})}catch(l){if(Y(l))return{data:{user:null},error:l};throw l}}async _listFactors(n){ea(n.userId);try{const{data:s,error:l}=await F(this.fetch,"GET",`${this.url}/admin/users/${n.userId}/factors`,{headers:this.headers,xform:c=>({data:{factors:c},error:null})});return{data:s,error:l}}catch(s){if(Y(s))return{data:null,error:s};throw s}}async _deleteFactor(n){ea(n.userId),ea(n.id);try{return{data:await F(this.fetch,"DELETE",`${this.url}/admin/users/${n.userId}/factors/${n.id}`,{headers:this.headers}),error:null}}catch(s){if(Y(s))return{data:null,error:s};throw s}}async _listOAuthClients(n){var s,l,c,h,d,m,g;try{const p={nextPage:null,lastPage:0,total:0},_=await F(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(l=(s=n?.page)===null||s===void 0?void 0:s.toString())!==null&&l!==void 0?l:"",per_page:(h=(c=n?.perPage)===null||c===void 0?void 0:c.toString())!==null&&h!==void 0?h:""},xform:Vg});if(_.error)throw _.error;const b=await _.json(),T=(d=_.headers.get("x-total-count"))!==null&&d!==void 0?d:0,w=(g=(m=_.headers.get("link"))===null||m===void 0?void 0:m.split(","))!==null&&g!==void 0?g:[];return w.length>0&&(w.forEach(R=>{const D=parseInt(R.split(";")[0].split("=")[1].substring(0,1)),q=JSON.parse(R.split(";")[1].split("=")[1]);p[`${q}Page`]=D}),p.total=parseInt(T)),{data:Object.assign(Object.assign({},b),p),error:null}}catch(p){if(Y(p))return{data:{clients:[]},error:p};throw p}}async _createOAuthClient(n){try{return await F(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:n,headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(Y(s))return{data:null,error:s};throw s}}async _getOAuthClient(n){try{return await F(this.fetch,"GET",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(Y(s))return{data:null,error:s};throw s}}async _updateOAuthClient(n,s){try{return await F(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${n}`,{body:s,headers:this.headers,xform:l=>({data:l,error:null})})}catch(l){if(Y(l))return{data:null,error:l};throw l}}async _deleteOAuthClient(n){try{return await F(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(s){if(Y(s))return{data:null,error:s};throw s}}async _regenerateOAuthClientSecret(n){try{return await F(this.fetch,"POST",`${this.url}/admin/oauth/clients/${n}/regenerate_secret`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(Y(s))return{data:null,error:s};throw s}}async _listCustomProviders(n){try{const s={};return n?.type&&(s.type=n.type),await F(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:s,xform:l=>{var c;return{data:{providers:(c=l?.providers)!==null&&c!==void 0?c:[]},error:null}}})}catch(s){if(Y(s))return{data:{providers:[]},error:s};throw s}}async _createCustomProvider(n){try{return await F(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:n,headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(Y(s))return{data:null,error:s};throw s}}async _getCustomProvider(n){try{return await F(this.fetch,"GET",`${this.url}/admin/custom-providers/${n}`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(Y(s))return{data:null,error:s};throw s}}async _updateCustomProvider(n,s){try{return await F(this.fetch,"PUT",`${this.url}/admin/custom-providers/${n}`,{body:s,headers:this.headers,xform:l=>({data:l,error:null})})}catch(l){if(Y(l))return{data:null,error:l};throw l}}async _deleteCustomProvider(n){try{return await F(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${n}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(s){if(Y(s))return{data:null,error:s};throw s}}async _adminListPasskeys(n){yn(this.experimental),ea(n.userId);try{return await F(this.fetch,"GET",`${this.url}/admin/users/${n.userId}/passkeys`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(Y(s))return{data:null,error:s};throw s}}async _adminDeletePasskey(n){yn(this.experimental),ea(n.userId),ea(n.passkeyId);try{return await F(this.fetch,"DELETE",`${this.url}/admin/users/${n.userId}/passkeys/${n.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(s){if(Y(s))return{data:null,error:s};throw s}}}function Kg(i={}){return{getItem:n=>i[n]||null,setItem:(n,s)=>{i[n]=s},removeItem:n=>{delete i[n]}}}globalThis&&wp()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class Q_ extends Error{constructor(n){super(n),this.isAcquireTimeout=!0}}function Z_(){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 Tp(i){if(!/^0x[a-fA-F0-9]{40}$/.test(i))throw new Error(`@supabase/auth-js: Address "${i}" is invalid.`);return i.toLowerCase()}function F_(i){return parseInt(i,16)}function W_(i){const n=new TextEncoder().encode(i);return"0x"+Array.from(n,l=>l.toString(16).padStart(2,"0")).join("")}function ew(i){var n;const{chainId:s,domain:l,expirationTime:c,issuedAt:h=new Date,nonce:d,notBefore:m,requestId:g,resources:p,scheme:_,uri:b,version:T}=i;{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(!l)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(d&&d.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${d}`);if(!b)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(T!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${T}`);if(!((n=i.statement)===null||n===void 0)&&n.includes(`
|
|
22
|
-
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${i.statement}`)}const w=Tp(i.address),R=_?`${_}://${l}`:l,D=i.statement?`${i.statement}
|
|
23
|
-
`:"",q=`${R} wants you to sign in with your Ethereum account:
|
|
24
|
-
${w}
|
|
25
|
-
|
|
26
|
-
${D}`;let $=`URI: ${b}
|
|
27
|
-
Version: ${T}
|
|
28
|
-
Chain ID: ${s}${d?`
|
|
29
|
-
Nonce: ${d}`:""}
|
|
30
|
-
Issued At: ${h.toISOString()}`;if(c&&($+=`
|
|
31
|
-
Expiration Time: ${c.toISOString()}`),m&&($+=`
|
|
32
|
-
Not Before: ${m.toISOString()}`),g&&($+=`
|
|
33
|
-
Request ID: ${g}`),p){let H=`
|
|
34
|
-
Resources:`;for(const P of p){if(!P||typeof P!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${P}`);H+=`
|
|
35
|
-
- ${P}`}$+=H}return`${q}
|
|
36
|
-
${$}`}class lt extends Error{constructor({message:n,code:s,cause:l,name:c}){var h;super(n,{cause:l}),this.__isWebAuthnError=!0,this.name=(h=c??(l instanceof Error?l.name:void 0))!==null&&h!==void 0?h:"Unknown Error",this.code=s}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class bo extends lt{constructor(n,s){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:s,message:n}),this.name="WebAuthnUnknownError",this.originalError=s}}function tw({error:i,options:n}){var s,l,c;const{publicKey:h}=n;if(!h)throw Error("options was missing required publicKey property");if(i.name==="AbortError"){if(n.signal instanceof AbortSignal)return new lt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:i})}else if(i.name==="ConstraintError"){if(((s=h.authenticatorSelection)===null||s===void 0?void 0:s.requireResidentKey)===!0)return new lt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:i});if(n.mediation==="conditional"&&((l=h.authenticatorSelection)===null||l===void 0?void 0:l.userVerification)==="required")return new lt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:i});if(((c=h.authenticatorSelection)===null||c===void 0?void 0:c.userVerification)==="required")return new lt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:i})}else{if(i.name==="InvalidStateError")return new lt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:i});if(i.name==="NotAllowedError")return new lt({message:i.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:i});if(i.name==="NotSupportedError")return h.pubKeyCredParams.filter(m=>m.type==="public-key").length===0?new lt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:i}):new lt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:i});if(i.name==="SecurityError"){const d=window.location.hostname;if(Ep(d)){if(h.rp.id!==d)return new lt({message:`The RP ID "${h.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:i})}else return new lt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:i})}else if(i.name==="TypeError"){if(h.user.id.byteLength<1||h.user.id.byteLength>64)return new lt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:i})}else if(i.name==="UnknownError")return new lt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:i})}return new lt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:i})}function nw({error:i,options:n}){const{publicKey:s}=n;if(!s)throw Error("options was missing required publicKey property");if(i.name==="AbortError"){if(n.signal instanceof AbortSignal)return new lt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:i})}else{if(i.name==="NotAllowedError")return new lt({message:i.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:i});if(i.name==="SecurityError"){const l=window.location.hostname;if(Ep(l)){if(s.rpId!==l)return new lt({message:`The RP ID "${s.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:i})}else return new lt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:i})}else if(i.name==="UnknownError")return new lt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:i})}return new lt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:i})}class aw{createNewAbortSignal(){if(this.controller){const s=new Error("Cancelling existing WebAuthn API call for new one");s.name="AbortError",this.controller.abort(s)}const n=new AbortController;return this.controller=n,n.signal}cancelCeremony(){if(this.controller){const n=new Error("Manually cancelling existing WebAuthn API call");n.name="AbortError",this.controller.abort(n),this.controller=void 0}}}const bh=new aw;function Ig(i){if(!i)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(i);const{challenge:n,user:s,excludeCredentials:l}=i,c=To(i,["challenge","user","excludeCredentials"]),h=cs(n).buffer,d=Object.assign(Object.assign({},s),{id:cs(s.id).buffer}),m=Object.assign(Object.assign({},c),{challenge:h,user:d});if(l&&l.length>0){m.excludeCredentials=new Array(l.length);for(let g=0;g<l.length;g++){const p=l[g];m.excludeCredentials[g]=Object.assign(Object.assign({},p),{id:cs(p.id).buffer,type:p.type||"public-key",transports:p.transports})}}return m}function Yg(i){if(!i)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(i);const{challenge:n,allowCredentials:s}=i,l=To(i,["challenge","allowCredentials"]),c=cs(n).buffer,h=Object.assign(Object.assign({},l),{challenge:c});if(s&&s.length>0){h.allowCredentials=new Array(s.length);for(let d=0;d<s.length;d++){const m=s[d];h.allowCredentials[d]=Object.assign(Object.assign({},m),{id:cs(m.id).buffer,type:m.type||"public-key",transports:m.transports})}}return h}function Jg(i){var n;if("toJSON"in i&&typeof i.toJSON=="function")return i.toJSON();const s=i;return{id:i.id,rawId:i.id,response:{attestationObject:ui(new Uint8Array(i.response.attestationObject)),clientDataJSON:ui(new Uint8Array(i.response.clientDataJSON))},type:"public-key",clientExtensionResults:i.getClientExtensionResults(),authenticatorAttachment:(n=s.authenticatorAttachment)!==null&&n!==void 0?n:void 0}}function Xg(i){var n;if("toJSON"in i&&typeof i.toJSON=="function")return i.toJSON();const s=i,l=i.getClientExtensionResults(),c=i.response;return{id:i.id,rawId:i.id,response:{authenticatorData:ui(new Uint8Array(c.authenticatorData)),clientDataJSON:ui(new Uint8Array(c.clientDataJSON)),signature:ui(new Uint8Array(c.signature)),userHandle:c.userHandle?ui(new Uint8Array(c.userHandle)):void 0},type:"public-key",clientExtensionResults:l,authenticatorAttachment:(n=s.authenticatorAttachment)!==null&&n!==void 0?n:void 0}}function Ep(i){return i==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(i)}function _o(){var i,n;return!!(Tt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((i=navigator?.credentials)===null||i===void 0?void 0:i.create)=="function"&&typeof((n=navigator?.credentials)===null||n===void 0?void 0:n.get)=="function")}async function kp(i){try{const n=await navigator.credentials.create(i);return n?n instanceof PublicKeyCredential?{data:n,error:null}:{data:null,error:new bo("Browser returned unexpected credential type",n)}:{data:null,error:new bo("Empty credential response",n)}}catch(n){return{data:null,error:tw({error:n,options:i})}}}async function Ap(i){try{const n=await navigator.credentials.get(i);return n?n instanceof PublicKeyCredential?{data:n,error:null}:{data:null,error:new bo("Browser returned unexpected credential type",n)}:{data:null,error:new bo("Empty credential response",n)}}catch(n){return{data:null,error:nw({error:n,options:i})}}}const iw={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},sw={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function wo(...i){const n=c=>c!==null&&typeof c=="object"&&!Array.isArray(c),s=c=>c instanceof ArrayBuffer||ArrayBuffer.isView(c),l={};for(const c of i)if(c)for(const h in c){const d=c[h];if(d!==void 0)if(Array.isArray(d))l[h]=d;else if(s(d))l[h]=d;else if(n(d)){const m=l[h];n(m)?l[h]=wo(m,d):l[h]=wo(d)}else l[h]=d}return l}function rw(i,n){return wo(iw,i,n||{})}function lw(i,n){return wo(sw,i,n||{})}class ow{constructor(n){this.client=n,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(n){return this.client.mfa.enroll(Object.assign(Object.assign({},n),{factorType:"webauthn"}))}async _challenge({factorId:n,webauthn:s,friendlyName:l,signal:c},h){var d;try{const{data:m,error:g}=await this.client.mfa.challenge({factorId:n,webauthn:s});if(!m)return{data:null,error:g};const p=c??bh.createNewAbortSignal();if(m.webauthn.type==="create"){const{user:_}=m.webauthn.credential_options.publicKey;if(!_.name){const b=l;if(b)_.name=`${_.id}:${b}`;else{const w=(await this.client.getUser()).data.user,R=((d=w?.user_metadata)===null||d===void 0?void 0:d.name)||w?.email||w?.id||"User";_.name=`${_.id}:${R}`}}_.displayName||(_.displayName=_.name)}switch(m.webauthn.type){case"create":{const _=rw(m.webauthn.credential_options.publicKey,h?.create),{data:b,error:T}=await kp({publicKey:_,signal:p});return b?{data:{factorId:n,challengeId:m.id,webauthn:{type:m.webauthn.type,credential_response:b}},error:null}:{data:null,error:T}}case"request":{const _=lw(m.webauthn.credential_options.publicKey,h?.request),{data:b,error:T}=await Ap(Object.assign(Object.assign({},m.webauthn.credential_options),{publicKey:_,signal:p}));return b?{data:{factorId:n,challengeId:m.id,webauthn:{type:m.webauthn.type,credential_response:b}},error:null}:{data:null,error:T}}}}catch(m){return Y(m)?{data:null,error:m}:{data:null,error:new _n("Unexpected error in challenge",m)}}}async _verify({challengeId:n,factorId:s,webauthn:l}){return this.client.mfa.verify({factorId:s,challengeId:n,webauthn:l})}async _authenticate({factorId:n,webauthn:{rpId:s=typeof window<"u"?window.location.hostname:void 0,rpOrigins:l=typeof window<"u"?[window.location.origin]:void 0,signal:c}={}},h){if(!s)return{data:null,error:new xr("rpId is required for WebAuthn authentication")};try{if(!_o())return{data:null,error:new _n("Browser does not support WebAuthn",null)};const{data:d,error:m}=await this.challenge({factorId:n,webauthn:{rpId:s,rpOrigins:l},signal:c},{request:h});if(!d)return{data:null,error:m};const{webauthn:g}=d;return this._verify({factorId:n,challengeId:d.challengeId,webauthn:{type:g.type,rpId:s,rpOrigins:l,credential_response:g.credential_response}})}catch(d){return Y(d)?{data:null,error:d}:{data:null,error:new _n("Unexpected error in authenticate",d)}}}async _register({friendlyName:n,webauthn:{rpId:s=typeof window<"u"?window.location.hostname:void 0,rpOrigins:l=typeof window<"u"?[window.location.origin]:void 0,signal:c}={}},h){if(!s)return{data:null,error:new xr("rpId is required for WebAuthn registration")};try{if(!_o())return{data:null,error:new _n("Browser does not support WebAuthn",null)};const{data:d,error:m}=await this._enroll({friendlyName:n});if(!d)return await this.client.mfa.listFactors().then(_=>{var b;return(b=_.data)===null||b===void 0?void 0:b.all.find(T=>T.factor_type==="webauthn"&&T.friendly_name===n&&T.status!=="unverified")}).then(_=>_?this.client.mfa.unenroll({factorId:_?.id}):void 0),{data:null,error:m};const{data:g,error:p}=await this._challenge({factorId:d.id,friendlyName:d.friendly_name,webauthn:{rpId:s,rpOrigins:l},signal:c},{create:h});return g?this._verify({factorId:d.id,challengeId:g.challengeId,webauthn:{rpId:s,rpOrigins:l,type:g.webauthn.type,credential_response:g.webauthn.credential_response}}):{data:null,error:p}}catch(d){return Y(d)?{data:null,error:d}:{data:null,error:new _n("Unexpected error in register",d)}}}}Z_();const uw={url:d_,storageKey:f_,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:m_,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},es={};class jr{get jwks(){var n,s;return(s=(n=es[this.storageKey])===null||n===void 0?void 0:n.jwks)!==null&&s!==void 0?s:{keys:[]}}set jwks(n){es[this.storageKey]=Object.assign(Object.assign({},es[this.storageKey]),{jwks:n})}get jwks_cached_at(){var n,s;return(s=(n=es[this.storageKey])===null||n===void 0?void 0:n.cachedAt)!==null&&s!==void 0?s:Number.MIN_SAFE_INTEGER}set jwks_cached_at(n){es[this.storageKey]=Object.assign(Object.assign({},es[this.storageKey]),{cachedAt:n})}constructor(n){var s,l,c;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const h=Object.assign(Object.assign({},uw),n);if(this.storageKey=h.storageKey,this.instanceID=(s=jr.nextInstanceID[this.storageKey])!==null&&s!==void 0?s:0,jr.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!h.debug,typeof h.debug=="function"&&(this.logger=h.debug),this.instanceID>0&&Tt()){const d=`${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(d),this.logDebugMessages&&console.trace(d)}if(this.persistSession=h.persistSession,this.autoRefreshToken=h.autoRefreshToken,this.experimental=(l=h.experimental)!==null&&l!==void 0?l:{},this.admin=new X_({url:h.url,headers:h.headers,fetch:h.fetch,experimental:this.experimental}),this.url=h.url,this.headers=h.headers,this.fetch=Sp(h.fetch),this.detectSessionInUrl=h.detectSessionInUrl,this.flowType=h.flowType,this.hasCustomAuthorizationHeader=h.hasCustomAuthorizationHeader,this.throwOnError=h.throwOnError,this.lockAcquireTimeout=h.lockAcquireTimeout,h.lock!=null&&(this.lock=h.lock),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 ow(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?(h.storage?this.storage=h.storage:wp()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Kg(this.memoryStorage)),h.userStorage&&(this.userStorage=h.userStorage)):(this.memoryStorage={},this.storage=Kg(this.memoryStorage)),Tt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(d){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",d)}(c=this.broadcastChannel)===null||c===void 0||c.addEventListener("message",async d=>{this._debug("received broadcast notification from other tab or client",d),(d.data.event==="TOKEN_REFRESHED"||d.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(d.data.event,d.data.session,!1)}catch(m){this._debug("#broadcastChannel","error",m)}})}h.skipAutoInitialize||this.initialize().catch(d=>{this._debug("#initialize()","error",d)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(n){if(this.throwOnError&&n&&n.error)throw n.error;return n}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${vp}) ${new Date().toISOString()}`}_debug(...n){return this.logDebugMessages&&this.logger(this._logPrefix(),...n),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())(),await this.initializePromise)}async _initialize(){var n;try{let s={},l="none";if(Tt()&&(s=O_(window.location.href),this._isImplicitGrantCallback(s)?l="implicit":await this._isPKCECallback(s)&&(l="pkce")),Tt()&&this.detectSessionInUrl&&l!=="none"){const{data:c,error:h}=await this._getSessionFromURL(s,l);if(h){if(this._debug("#_initialize()","error detecting session from URL",h),b_(h)){const g=(n=h.details)===null||n===void 0?void 0:n.code;if(g==="identity_already_exists"||g==="identity_not_found"||g==="single_identity_not_deletable")return{error:h}}return{error:h}}const{session:d,redirectType:m}=c;return this._debug("#_initialize()","detected session in URL",d,"redirect type",m),await this._saveSession(d),setTimeout(async()=>{m==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",d):await this._notifyAllSubscribers("SIGNED_IN",d)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(s){return Y(s)?this._returnResult({error:s}):this._returnResult({error:new _n("Unexpected error during initialization",s)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(n){var s,l,c;try{const h=await F(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(l=(s=n?.options)===null||s===void 0?void 0:s.data)!==null&&l!==void 0?l:{},gotrue_meta_security:{captcha_token:(c=n?.options)===null||c===void 0?void 0:c.captchaToken}},xform:rn}),{data:d,error:m}=h;if(m||!d)return this._returnResult({data:{user:null,session:null},error:m});const g=d.session,p=d.user;return d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("SIGNED_IN",g)),this._returnResult({data:{user:p,session:g},error:null})}catch(h){if(Y(h))return this._returnResult({data:{user:null,session:null},error:h});throw h}}async signUp(n){var s,l,c;try{let h;if("email"in n){const{email:_,password:b,options:T}=n;let w=null,R=null;this.flowType==="pkce"&&([w,R]=await li(this.storage,this.storageKey)),h=await F(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:T?.emailRedirectTo,body:{email:_,password:b,data:(s=T?.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:T?.captchaToken},code_challenge:w,code_challenge_method:R},xform:rn})}else if("phone"in n){const{phone:_,password:b,options:T}=n;h=await F(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:_,password:b,data:(l=T?.data)!==null&&l!==void 0?l:{},channel:(c=T?.channel)!==null&&c!==void 0?c:"sms",gotrue_meta_security:{captcha_token:T?.captchaToken}},xform:rn})}else throw new lo("You must provide either an email or phone number and a password");const{data:d,error:m}=h;if(m||!d)return await tt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:m});const g=d.session,p=d.user;return d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("SIGNED_IN",g)),this._returnResult({data:{user:p,session:g},error:null})}catch(h){if(await tt(this.storage,`${this.storageKey}-code-verifier`),Y(h))return this._returnResult({data:{user:null,session:null},error:h});throw h}}async signInWithPassword(n){try{let s;if("email"in n){const{email:h,password:d,options:m}=n;s=await F(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:h,password:d,gotrue_meta_security:{captcha_token:m?.captchaToken}},xform:Gg})}else if("phone"in n){const{phone:h,password:d,options:m}=n;s=await F(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:h,password:d,gotrue_meta_security:{captcha_token:m?.captchaToken}},xform:Gg})}else throw new lo("You must provide either an email or phone number and a password");const{data:l,error:c}=s;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l||!l.session||!l.user){const h=new Wi;return this._returnResult({data:{user:null,session:null},error:h})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:Object.assign({user:l.user,session:l.session},l.weak_password?{weakPassword:l.weak_password}:null),error:c})}catch(s){if(Y(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithOAuth(n){var s,l,c,h;return await this._handleProviderSignIn(n.provider,{redirectTo:(s=n.options)===null||s===void 0?void 0:s.redirectTo,scopes:(l=n.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=n.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:(h=n.options)===null||h===void 0?void 0:h.skipBrowserRedirect})}async exchangeCodeForSession(n){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(n)):this._exchangeCodeForSession(n)}async signInWithWeb3(n){const{chain:s}=n;switch(s){case"ethereum":return await this.signInWithEthereum(n);case"solana":return await this.signInWithSolana(n);default:throw new Error(`@supabase/auth-js: Unsupported chain "${s}"`)}}async signInWithEthereum(n){var s,l,c,h,d,m,g,p,_,b,T;let w,R;if("message"in n)w=n.message,R=n.signature;else{const{chain:D,wallet:q,statement:$,options:H}=n;let P;if(Tt())if(typeof q=="object")P=q;else{const Ee=window;if("ethereum"in Ee&&typeof Ee.ethereum=="object"&&"request"in Ee.ethereum&&typeof Ee.ethereum.request=="function")P=Ee.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 q!="object"||!H?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");P=q}const X=new URL((s=H?.url)!==null&&s!==void 0?s:window.location.href),ge=await P.request({method:"eth_requestAccounts"}).then(Ee=>Ee).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!ge||ge.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const ne=Tp(ge[0]);let J=(l=H?.signInWithEthereum)===null||l===void 0?void 0:l.chainId;if(!J){const Ee=await P.request({method:"eth_chainId"});J=F_(Ee)}const Te={domain:X.host,address:ne,statement:$,uri:X.href,version:"1",chainId:J,nonce:(c=H?.signInWithEthereum)===null||c===void 0?void 0:c.nonce,issuedAt:(d=(h=H?.signInWithEthereum)===null||h===void 0?void 0:h.issuedAt)!==null&&d!==void 0?d:new Date,expirationTime:(m=H?.signInWithEthereum)===null||m===void 0?void 0:m.expirationTime,notBefore:(g=H?.signInWithEthereum)===null||g===void 0?void 0:g.notBefore,requestId:(p=H?.signInWithEthereum)===null||p===void 0?void 0:p.requestId,resources:(_=H?.signInWithEthereum)===null||_===void 0?void 0:_.resources};w=ew(Te),R=await P.request({method:"personal_sign",params:[W_(w),ne]})}try{const{data:D,error:q}=await F(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:w,signature:R},!((b=n.options)===null||b===void 0)&&b.captchaToken?{gotrue_meta_security:{captcha_token:(T=n.options)===null||T===void 0?void 0:T.captchaToken}}:null),xform:rn});if(q)throw q;if(!D||!D.session||!D.user){const $=new Wi;return this._returnResult({data:{user:null,session:null},error:$})}return D.session&&(await this._saveSession(D.session),await this._notifyAllSubscribers("SIGNED_IN",D.session)),this._returnResult({data:Object.assign({},D),error:q})}catch(D){if(Y(D))return this._returnResult({data:{user:null,session:null},error:D});throw D}}async signInWithSolana(n){var s,l,c,h,d,m,g,p,_,b,T,w;let R,D;if("message"in n)R=n.message,D=n.signature;else{const{chain:q,wallet:$,statement:H,options:P}=n;let X;if(Tt())if(typeof $=="object")X=$;else{const ne=window;if("solana"in ne&&typeof ne.solana=="object"&&("signIn"in ne.solana&&typeof ne.solana.signIn=="function"||"signMessage"in ne.solana&&typeof ne.solana.signMessage=="function"))X=ne.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 $!="object"||!P?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");X=$}const ge=new URL((s=P?.url)!==null&&s!==void 0?s:window.location.href);if("signIn"in X&&X.signIn){const ne=await X.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},P?.signInWithSolana),{version:"1",domain:ge.host,uri:ge.href}),H?{statement:H}:null));let J;if(Array.isArray(ne)&&ne[0]&&typeof ne[0]=="object")J=ne[0];else if(ne&&typeof ne=="object"&&"signedMessage"in ne&&"signature"in ne)J=ne;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in J&&"signature"in J&&(typeof J.signedMessage=="string"||J.signedMessage instanceof Uint8Array)&&J.signature instanceof Uint8Array)R=typeof J.signedMessage=="string"?J.signedMessage:new TextDecoder().decode(J.signedMessage),D=J.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in X)||typeof X.signMessage!="function"||!("publicKey"in X)||typeof X!="object"||!X.publicKey||!("toBase58"in X.publicKey)||typeof X.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");R=[`${ge.host} wants you to sign in with your Solana account:`,X.publicKey.toBase58(),...H?["",H,""]:[""],"Version: 1",`URI: ${ge.href}`,`Issued At: ${(c=(l=P?.signInWithSolana)===null||l===void 0?void 0:l.issuedAt)!==null&&c!==void 0?c:new Date().toISOString()}`,...!((h=P?.signInWithSolana)===null||h===void 0)&&h.notBefore?[`Not Before: ${P.signInWithSolana.notBefore}`]:[],...!((d=P?.signInWithSolana)===null||d===void 0)&&d.expirationTime?[`Expiration Time: ${P.signInWithSolana.expirationTime}`]:[],...!((m=P?.signInWithSolana)===null||m===void 0)&&m.chainId?[`Chain ID: ${P.signInWithSolana.chainId}`]:[],...!((g=P?.signInWithSolana)===null||g===void 0)&&g.nonce?[`Nonce: ${P.signInWithSolana.nonce}`]:[],...!((p=P?.signInWithSolana)===null||p===void 0)&&p.requestId?[`Request ID: ${P.signInWithSolana.requestId}`]:[],...!((b=(_=P?.signInWithSolana)===null||_===void 0?void 0:_.resources)===null||b===void 0)&&b.length?["Resources",...P.signInWithSolana.resources.map(J=>`- ${J}`)]:[]].join(`
|
|
37
|
-
`);const ne=await X.signMessage(new TextEncoder().encode(R),"utf8");if(!ne||!(ne instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");D=ne}}try{const{data:q,error:$}=await F(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:R,signature:ui(D)},!((T=n.options)===null||T===void 0)&&T.captchaToken?{gotrue_meta_security:{captcha_token:(w=n.options)===null||w===void 0?void 0:w.captchaToken}}:null),xform:rn});if($)throw $;if(!q||!q.session||!q.user){const H=new Wi;return this._returnResult({data:{user:null,session:null},error:H})}return q.session&&(await this._saveSession(q.session),await this._notifyAllSubscribers("SIGNED_IN",q.session)),this._returnResult({data:Object.assign({},q),error:$})}catch(q){if(Y(q))return this._returnResult({data:{user:null,session:null},error:q});throw q}}async _exchangeCodeForSession(n){const s=await pn(this.storage,`${this.storageKey}-code-verifier`),[l,c]=(s??"").split("/");try{if(!l&&this.flowType==="pkce")throw new __;const{data:h,error:d}=await F(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:n,code_verifier:l},xform:rn});if(await tt(this.storage,`${this.storageKey}-code-verifier`),d)throw d;if(!h||!h.session||!h.user){const m=new Wi;return this._returnResult({data:{user:null,session:null,redirectType:null},error:m})}return h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers(c==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",h.session)),this._returnResult({data:Object.assign(Object.assign({},h),{redirectType:c??null}),error:d})}catch(h){if(await tt(this.storage,`${this.storageKey}-code-verifier`),Y(h))return this._returnResult({data:{user:null,session:null,redirectType:null},error:h});throw h}}async signInWithIdToken(n){try{const{options:s,provider:l,token:c,access_token:h,nonce:d}=n,m=await F(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:l,id_token:c,access_token:h,nonce:d,gotrue_meta_security:{captcha_token:s?.captchaToken}},xform:rn}),{data:g,error:p}=m;if(p)return this._returnResult({data:{user:null,session:null},error:p});if(!g||!g.session||!g.user){const _=new Wi;return this._returnResult({data:{user:null,session:null},error:_})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:g,error:p})}catch(s){if(Y(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithOtp(n){var s,l,c,h,d;try{if("email"in n){const{email:m,options:g}=n;let p=null,_=null;this.flowType==="pkce"&&([p,_]=await li(this.storage,this.storageKey));const{error:b}=await F(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:m,data:(s=g?.data)!==null&&s!==void 0?s:{},create_user:(l=g?.shouldCreateUser)!==null&&l!==void 0?l:!0,gotrue_meta_security:{captcha_token:g?.captchaToken},code_challenge:p,code_challenge_method:_},redirectTo:g?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:b})}if("phone"in n){const{phone:m,options:g}=n,{data:p,error:_}=await F(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:m,data:(c=g?.data)!==null&&c!==void 0?c:{},create_user:(h=g?.shouldCreateUser)!==null&&h!==void 0?h:!0,gotrue_meta_security:{captcha_token:g?.captchaToken},channel:(d=g?.channel)!==null&&d!==void 0?d:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:p?.message_id},error:_})}throw new lo("You must provide either an email or phone number.")}catch(m){if(await tt(this.storage,`${this.storageKey}-code-verifier`),Y(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async verifyOtp(n){var s,l;try{let c,h;"options"in n&&(c=(s=n.options)===null||s===void 0?void 0:s.redirectTo,h=(l=n.options)===null||l===void 0?void 0:l.captchaToken);const{data:d,error:m}=await F(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},n),{gotrue_meta_security:{captcha_token:h}}),redirectTo:c,xform:rn});if(m)throw m;if(!d)throw new Error("An error occurred on token verification.");const g=d.session,p=d.user;return g?.access_token&&(await this._saveSession(g),await this._notifyAllSubscribers(n.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",g)),this._returnResult({data:{user:p,session:g},error:null})}catch(c){if(Y(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}async signInWithSSO(n){var s,l,c,h,d;try{let m=null,g=null;this.flowType==="pkce"&&([m,g]=await li(this.storage,this.storageKey));const p=await F(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in n?{provider_id:n.providerId}:null),"domain"in n?{domain:n.domain}:null),{redirect_to:(l=(s=n.options)===null||s===void 0?void 0:s.redirectTo)!==null&&l!==void 0?l:void 0}),!((c=n?.options)===null||c===void 0)&&c.captchaToken?{gotrue_meta_security:{captcha_token:n.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:m,code_challenge_method:g}),headers:this.headers,xform:I_});return!((h=p.data)===null||h===void 0)&&h.url&&Tt()&&!(!((d=n.options)===null||d===void 0)&&d.skipBrowserRedirect)&&window.location.assign(p.data.url),this._returnResult(p)}catch(m){if(await tt(this.storage,`${this.storageKey}-code-verifier`),Y(m))return this._returnResult({data:null,error:m});throw m}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async n=>{const{data:{session:s},error:l}=n;if(l)throw l;if(!s)throw new mt;const{error:c}=await F(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:s.access_token});return this._returnResult({data:{user:null,session:null},error:c})})}catch(n){if(Y(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async resend(n){try{const s=`${this.url}/resend`;if("email"in n){const{email:l,type:c,options:h}=n;let d=null,m=null;this.flowType==="pkce"&&([d,m]=await li(this.storage,this.storageKey));const{error:g}=await F(this.fetch,"POST",s,{headers:this.headers,body:{email:l,type:c,gotrue_meta_security:{captcha_token:h?.captchaToken},code_challenge:d,code_challenge_method:m},redirectTo:h?.emailRedirectTo});return g&&await tt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:g})}else if("phone"in n){const{phone:l,type:c,options:h}=n,{data:d,error:m}=await F(this.fetch,"POST",s,{headers:this.headers,body:{phone:l,type:c,gotrue_meta_security:{captcha_token:h?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:d?.message_id},error:m})}throw new lo("You must provide either an email or phone number and a type")}catch(s){if(await tt(this.storage,`${this.storageKey}-code-verifier`),Y(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n)):await this._useSession(async n=>n)}async _acquireLock(n,s){this._debug("#_acquireLock","begin",n);try{if(this.lockAcquired){const l=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),c=(async()=>(await l,await s()))();return this.pendingInLock.push((async()=>{try{await c}catch{}})()),c}return await this.lock(`lock:${this.storageKey}`,n,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const l=s();for(this.pendingInLock.push((async()=>{try{await l}catch{}})()),await l;this.pendingInLock.length;){const c=[...this.pendingInLock];await Promise.all(c),this.pendingInLock.splice(0,c.length)}return await l}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(n){this._debug("#_useSession","begin");try{const s=await this.__loadSession();return await n(s)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lock!=null&&!this.lockAcquired&&this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let n=null;const s=await pn(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",s),s!==null&&(this._isValidSession(s)?n=s:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!n)return{data:{session:null},error:null};const l=n.expires_at?n.expires_at*1e3-Date.now()<Fc:!1;if(this._debug("#__loadSession()",`session has${l?"":" not"} expired`,"expires_at",n.expires_at),!l){if(this.userStorage){const d=await pn(this.userStorage,this.storageKey+"-user");d?.user?n.user=d.user:n.user=Wc()}if(this.storage.isServer&&n.user&&!n.user.__isUserNotAvailableProxy){const d={value:this.suppressGetSessionWarning};n.user=P_(n.user,d),d.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:n},error:null}}const{data:c,error:h}=await this._callRefreshToken(n.refresh_token);if(h){if(!!(n.expires_at&&n.expires_at*1e3>Date.now())){const m=await pn(this.storage,this.storageKey);if(m&&m.refresh_token===n.refresh_token)return this._returnResult({data:{session:n},error:null})}return this._returnResult({data:{session:null},error:h})}return this._returnResult({data:{session:c},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(n){if(n)return await this._getUser(n);await this.initializePromise;let s;return this.lock!=null?s=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):s=await this._getUser(),s.data.user&&(this.suppressGetSessionWarning=!0),s}async _getUser(n){try{return n?await F(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:n,xform:za}):await this._useSession(async s=>{var l,c,h;const{data:d,error:m}=s;if(m)throw m;return!(!((l=d.session)===null||l===void 0)&&l.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new mt}:await F(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(h=(c=d.session)===null||c===void 0?void 0:c.access_token)!==null&&h!==void 0?h:void 0,xform:za})})}catch(s){if(Y(s))return ro(s)&&(await this._removeSession(),await tt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:s});throw s}}async updateUser(n,s={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(n,s)):await this._updateUser(n,s)}async _updateUser(n,s={}){try{return await this._useSession(async l=>{const{data:c,error:h}=l;if(h)throw h;if(!c.session)throw new mt;const d=c.session;let m=null,g=null;this.flowType==="pkce"&&n.email!=null&&([m,g]=await li(this.storage,this.storageKey));const{data:p,error:_}=await F(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:s?.emailRedirectTo,body:Object.assign(Object.assign({},n),{code_challenge:m,code_challenge_method:g}),jwt:d.access_token,xform:za});if(_)throw _;return d.user=p.user,await this._saveSession(d),await this._notifyAllSubscribers("USER_UPDATED",d),this._returnResult({data:{user:d.user},error:null})})}catch(l){if(await tt(this.storage,`${this.storageKey}-code-verifier`),Y(l))return this._returnResult({data:{user:null},error:l});throw l}}async setSession(n){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(n)):await this._setSession(n)}async _setSession(n){try{if(!n.access_token||!n.refresh_token)throw new mt;const s=Date.now()/1e3;let l=s,c=!0,h=null;const{payload:d}=uo(n.access_token);if(d.exp&&(l=d.exp,c=l<=s),c){const{data:m,error:g}=await this._callRefreshToken(n.refresh_token);if(g)return this._returnResult({data:{user:null,session:null},error:g});if(!m)return{data:{user:null,session:null},error:null};h=m}else{const{data:m,error:g}=await this._getUser(n.access_token);if(g)return this._returnResult({data:{user:null,session:null},error:g});h={access_token:n.access_token,refresh_token:n.refresh_token,user:m.user,token_type:"bearer",expires_in:l-s,expires_at:l},await this._saveSession(h),await this._notifyAllSubscribers("SIGNED_IN",h)}return this._returnResult({data:{user:h.user,session:h},error:null})}catch(s){if(Y(s))return this._returnResult({data:{session:null,user:null},error:s});throw s}}async refreshSession(n){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(n)):await this._refreshSession(n)}async _refreshSession(n){try{return await this._useSession(async s=>{var l;if(!n){const{data:d,error:m}=s;if(m)throw m;n=(l=d.session)!==null&&l!==void 0?l:void 0}if(!n?.refresh_token)throw new mt;const{data:c,error:h}=await this._callRefreshToken(n.refresh_token);return h?this._returnResult({data:{user:null,session:null},error:h}):c?this._returnResult({data:{user:c.user,session:c},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(s){if(Y(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async _getSessionFromURL(n,s){var l;try{if(!Tt())throw new oo("No browser detected.");if(n.error||n.error_description||n.error_code)throw new oo(n.error_description||"Error in URL with unspecified error_description",{error:n.error||"unspecified_error",code:n.error_code||"unspecified_code"});switch(s){case"implicit":if(this.flowType==="pkce")throw new Ug("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new oo("Not a valid implicit grant flow url.");break;default:}if(s==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!n.code)throw new Ug("No code detected.");const{data:P,error:X}=await this._exchangeCodeForSession(n.code);if(X)throw X;const ge=new URL(window.location.href);return ge.searchParams.delete("code"),window.history.replaceState(window.history.state,"",ge.toString()),{data:{session:P.session,redirectType:(l=P.redirectType)!==null&&l!==void 0?l:null},error:null}}const{provider_token:c,provider_refresh_token:h,access_token:d,refresh_token:m,expires_in:g,expires_at:p,token_type:_}=n;if(!d||!g||!m||!_)throw new oo("No session defined in URL");const b=Math.round(Date.now()/1e3),T=parseInt(g);let w=b+T;p&&(w=parseInt(p));const R=w-b;R*1e3<=ia&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${R}s, should have been closer to ${T}s`);const D=w-T;b-D>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",D,w,b):b-D<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",D,w,b);const{data:q,error:$}=await this._getUser(d);if($)throw $;const H={provider_token:c,provider_refresh_token:h,access_token:d,expires_in:T,expires_at:w,refresh_token:m,token_type:_,user:q.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:H,redirectType:n.type},error:null})}catch(c){if(Y(c))return this._returnResult({data:{session:null,redirectType:null},error:c});throw c}}_isImplicitGrantCallback(n){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),n):!!(n.access_token||n.error||n.error_description||n.error_code)}async _isPKCECallback(n){const s=await pn(this.storage,`${this.storageKey}-code-verifier`);return!!(n.code&&s)}async signOut(n={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(n)):await this._signOut(n)}async _signOut({scope:n}={scope:"global"}){return await this._useSession(async s=>{var l;const{data:c,error:h}=s;if(h&&!ro(h))return this._returnResult({error:h});const d=(l=c.session)===null||l===void 0?void 0:l.access_token;if(d){const{error:m}=await this.admin.signOut(d,n);if(m&&!(v_(m)&&(m.status===404||m.status===401||m.status===403)||ro(m)))return this._returnResult({error:m})}return n!=="others"&&(await this._removeSession(),await tt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(n){const s=R_(),l={id:s,callback:n,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,l),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(s)}):await this._emitInitialSession(s)))(),{data:{subscription:l}}}async _emitInitialSession(n){return await this._useSession(async s=>{var l,c;try{const{data:{session:h},error:d}=s;if(d)throw d;await((l=this.stateChangeEmitters.get(n))===null||l===void 0?void 0:l.callback("INITIAL_SESSION",h)),this._debug("INITIAL_SESSION","callback id",n,"session",h)}catch(h){await((c=this.stateChangeEmitters.get(n))===null||c===void 0?void 0:c.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",n,"error",h),ro(h)?console.warn(h):console.error(h)}})}async resetPasswordForEmail(n,s={}){let l=null,c=null;this.flowType==="pkce"&&([l,c]=await li(this.storage,this.storageKey,!0));try{return await F(this.fetch,"POST",`${this.url}/recover`,{body:{email:n,code_challenge:l,code_challenge_method:c,gotrue_meta_security:{captcha_token:s.captchaToken}},headers:this.headers,redirectTo:s.redirectTo})}catch(h){if(await tt(this.storage,`${this.storageKey}-code-verifier`),Y(h))return this._returnResult({data:null,error:h});throw h}}async getUserIdentities(){var n;try{const{data:s,error:l}=await this.getUser();if(l)throw l;return this._returnResult({data:{identities:(n=s.user.identities)!==null&&n!==void 0?n:[]},error:null})}catch(s){if(Y(s))return this._returnResult({data:null,error:s});throw s}}async linkIdentity(n){return"token"in n?this.linkIdentityIdToken(n):this.linkIdentityOAuth(n)}async linkIdentityOAuth(n){var s;try{const{data:l,error:c}=await this._useSession(async h=>{var d,m,g,p,_;const{data:b,error:T}=h;if(T)throw T;const w=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,n.provider,{redirectTo:(d=n.options)===null||d===void 0?void 0:d.redirectTo,scopes:(m=n.options)===null||m===void 0?void 0:m.scopes,queryParams:(g=n.options)===null||g===void 0?void 0:g.queryParams,skipBrowserRedirect:!0});return await F(this.fetch,"GET",w,{headers:this.headers,jwt:(_=(p=b.session)===null||p===void 0?void 0:p.access_token)!==null&&_!==void 0?_:void 0})});if(c)throw c;return Tt()&&!(!((s=n.options)===null||s===void 0)&&s.skipBrowserRedirect)&&window.location.assign(l?.url),this._returnResult({data:{provider:n.provider,url:l?.url},error:null})}catch(l){if(Y(l))return this._returnResult({data:{provider:n.provider,url:null},error:l});throw l}}async linkIdentityIdToken(n){return await this._useSession(async s=>{var l;try{const{error:c,data:{session:h}}=s;if(c)throw c;const{options:d,provider:m,token:g,access_token:p,nonce:_}=n,b=await F(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(l=h?.access_token)!==null&&l!==void 0?l:void 0,body:{provider:m,id_token:g,access_token:p,nonce:_,link_identity:!0,gotrue_meta_security:{captcha_token:d?.captchaToken}},xform:rn}),{data:T,error:w}=b;return w?this._returnResult({data:{user:null,session:null},error:w}):!T||!T.session||!T.user?this._returnResult({data:{user:null,session:null},error:new Wi}):(T.session&&(await this._saveSession(T.session),await this._notifyAllSubscribers("USER_UPDATED",T.session)),this._returnResult({data:T,error:w}))}catch(c){if(await tt(this.storage,`${this.storageKey}-code-verifier`),Y(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}})}async unlinkIdentity(n){try{return await this._useSession(async s=>{var l,c;const{data:h,error:d}=s;if(d)throw d;return await F(this.fetch,"DELETE",`${this.url}/user/identities/${n.identity_id}`,{headers:this.headers,jwt:(c=(l=h.session)===null||l===void 0?void 0:l.access_token)!==null&&c!==void 0?c:void 0})})}catch(s){if(Y(s))return this._returnResult({data:null,error:s});throw s}}async _refreshAccessToken(n){const s="#_refreshAccessToken()";this._debug(s,"begin");try{const l=Date.now();return await N_(async c=>(c>0&&await j_(200*Math.pow(2,c-1)),this._debug(s,"refreshing attempt",c),await F(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:n},headers:this.headers,xform:rn})),(c,h)=>{const d=200*Math.pow(2,c);return h&&Lg(h)&&Date.now()+d-l<ia})}catch(l){if(this._debug(s,"error",l),Y(l))return this._returnResult({data:{session:null,user:null},error:l});throw l}finally{this._debug(s,"end")}}_isValidSession(n){return typeof n=="object"&&n!==null&&"access_token"in n&&"refresh_token"in n&&"expires_at"in n}async _handleProviderSignIn(n,s){const l=await this._getUrlForProvider(`${this.url}/authorize`,n,{redirectTo:s.redirectTo,scopes:s.scopes,queryParams:s.queryParams});return this._debug("#_handleProviderSignIn()","provider",n,"options",s,"url",l),Tt()&&!s.skipBrowserRedirect&&window.location.assign(l),{data:{provider:n,url:l},error:null}}async _recoverAndRefresh(){var n,s;const l="#_recoverAndRefresh()";this._debug(l,"begin");try{const c=await pn(this.storage,this.storageKey);if(c&&this.userStorage){let d=await pn(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!d&&(d={user:c.user},await ls(this.userStorage,this.storageKey+"-user",d)),c.user=(n=d?.user)!==null&&n!==void 0?n:Wc()}else if(c&&!c.user&&!c.user){const d=await pn(this.storage,this.storageKey+"-user");d&&d?.user?(c.user=d.user,await tt(this.storage,this.storageKey+"-user"),await ls(this.storage,this.storageKey,c)):c.user=Wc()}if(this._debug(l,"session from storage",c),!this._isValidSession(c)){this._debug(l,"session is not valid"),c!==null&&await this._removeSession();return}const h=((s=c.expires_at)!==null&&s!==void 0?s:1/0)*1e3-Date.now()<Fc;if(this._debug(l,`session has${h?"":" not"} expired with margin of ${Fc}s`),h){if(this.autoRefreshToken&&c.refresh_token){const{error:d}=await this._callRefreshToken(c.refresh_token);d&&(w_(d)?this._debug(l,"refresh discarded by commit guard",d):this._debug(l,"refresh failed",d))}}else if(c.user&&c.user.__isUserNotAvailableProxy===!0)try{const{data:d,error:m}=await this._getUser(c.access_token);!m&&d?.user?(c.user=d.user,await this._saveSession(c),await this._notifyAllSubscribers("SIGNED_IN",c)):this._debug(l,"could not get user data, skipping SIGNED_IN notification")}catch(d){console.error("Error getting user data:",d),this._debug(l,"error getting user data, skipping SIGNED_IN notification",d)}else await this._notifyAllSubscribers("SIGNED_IN",c)}catch(c){this._debug(l,"error",c),console.error(c);return}finally{this._debug(l,"end")}}async _callRefreshToken(n){var s,l;if(!n)throw new mt;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===n&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning cached failure (cooldown active)"),this.lastRefreshFailure.result;const c="#_callRefreshToken()";this._debug(c,"begin");try{this.refreshingDeferred=new Ao;const h=await pn(this.storage,this.storageKey),{data:d,error:m}=await this._refreshAccessToken(n);if(m)throw m;if(!d.session)throw new mt;const g=await pn(this.storage,this.storageKey);if(h!==null&&(g===null||g.refresh_token!==h.refresh_token)){this._debug(c,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:g?"replaced":"cleared"});const T={data:null,error:new zg};return this.refreshingDeferred.resolve(T),T}const _=this._sessionRemovalEpoch;if(await this._saveSession(d.session),this._sessionRemovalEpoch!==_){this._debug(c,"commit guard (post-save): _removeSession ran during _saveSession, undoing write"),await tt(this.storage,this.storageKey),this.userStorage&&await tt(this.userStorage,this.storageKey+"-user");const T={data:null,error:new zg};return this.refreshingDeferred.resolve(T),T}await this._notifyAllSubscribers("TOKEN_REFRESHED",d.session);const b={data:d.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(b),b}catch(h){if(this._debug(c,"error",h),Y(h)){const d={data:null,error:h};if(!Lg(h)){const m=await pn(this.storage,this.storageKey);!!(m?.expires_at&&m.expires_at*1e3>Date.now())?this._debug(c,"proactive refresh failed, access token still valid — preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:n,result:d,expiresAt:Date.now()+h_},(s=this.refreshingDeferred)===null||s===void 0||s.resolve(d),d}throw(l=this.refreshingDeferred)===null||l===void 0||l.reject(h),h}finally{this.refreshingDeferred=null,this._debug(c,"end")}}async _notifyAllSubscribers(n,s,l=!0){const c=`#_notifyAllSubscribers(${n})`;this._debug(c,"begin",s,`broadcast = ${l}`);try{this.broadcastChannel&&l&&this.broadcastChannel.postMessage({event:n,session:s});const h=[],d=Array.from(this.stateChangeEmitters.values()).map(async m=>{try{await m.callback(n,s)}catch(g){h.push(g)}});if(await Promise.all(d),h.length>0){for(let m=0;m<h.length;m+=1)console.error(h[m]);throw h[0]}}finally{this._debug(c,"end")}}async _saveSession(n){this._debug("#_saveSession()",n),this.suppressGetSessionWarning=!0,await tt(this.storage,`${this.storageKey}-code-verifier`);const s=Object.assign({},n),l=s.user&&s.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!l&&s.user&&await ls(this.userStorage,this.storageKey+"-user",{user:s.user});const c=Object.assign({},s);delete c.user;const h=qg(c);await ls(this.storage,this.storageKey,h)}else{const c=qg(s);await ls(this.storage,this.storageKey,c)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await tt(this.storage,this.storageKey),await tt(this.storage,this.storageKey+"-code-verifier"),await tt(this.storage,this.storageKey+"-user"),this.userStorage&&await tt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const n=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{n&&Tt()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",n)}catch(s){console.error("removing visibilitychange callback failed",s)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const n=setInterval(()=>this._autoRefreshTokenTick(),ia);this.autoRefreshTicker=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n);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 n=this.autoRefreshTicker;this.autoRefreshTicker=null,n&&clearInterval(n);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 dispose(){var n;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(n=this.broadcastChannel)===null||n===void 0||n.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{const n=Date.now();try{return await this._useSession(async s=>{const{data:{session:l}}=s;if(!l||!l.refresh_token||!l.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const c=Math.floor((l.expires_at*1e3-n)/ia);this._debug("#_autoRefreshTokenTick()",`access token expires in ${c} ticks, a tick lasts ${ia}ms, refresh threshold is ${yr} ticks`),c<=yr&&await this._callRefreshToken(l.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(n){if(n instanceof Q_)this._debug("auto refresh token tick lock not available");else throw n}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{const n=Date.now();try{await this._useSession(async s=>{const{data:{session:l}}=s;if(!l||!l.refresh_token||!l.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const c=Math.floor((l.expires_at*1e3-n)/ia);this._debug("#_autoRefreshTokenTick()",`access token expires in ${c} ticks, a tick lasts ${ia}ms, refresh threshold is ${yr} ticks`),c<=yr&&await this._callRefreshToken(l.refresh_token)})}catch(s){console.error("Auto refresh tick failed with error. This is likely a transient error.",s)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Tt()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(n){this._debug("#visibilityChangedCallback","error",n)}},window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(n){console.error("_handleVisibilityChange",n)}}async _onVisibilityChanged(n){const s=`#_onVisibilityChanged(${n})`;if(this._debug(s,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!n)if(await this.initializePromise,this.lock!=null)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()});else{if(document.visibilityState!=="visible"){this._debug(s,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(n,s,l){const c=[`provider=${encodeURIComponent(s)}`];if(l?.redirectTo&&c.push(`redirect_to=${encodeURIComponent(l.redirectTo)}`),l?.scopes&&c.push(`scopes=${encodeURIComponent(l.scopes)}`),this.flowType==="pkce"){const[h,d]=await li(this.storage,this.storageKey),m=new URLSearchParams({code_challenge:`${encodeURIComponent(h)}`,code_challenge_method:`${encodeURIComponent(d)}`});c.push(m.toString())}if(l?.queryParams){const h=new URLSearchParams(l.queryParams);c.push(h.toString())}return l?.skipBrowserRedirect&&c.push(`skip_http_redirect=${l.skipBrowserRedirect}`),`${n}?${c.join("&")}`}async _unenroll(n){try{return await this._useSession(async s=>{var l;const{data:c,error:h}=s;return h?this._returnResult({data:null,error:h}):await F(this.fetch,"DELETE",`${this.url}/factors/${n.factorId}`,{headers:this.headers,jwt:(l=c?.session)===null||l===void 0?void 0:l.access_token})})}catch(s){if(Y(s))return this._returnResult({data:null,error:s});throw s}}async _enroll(n){try{return await this._useSession(async s=>{var l,c;const{data:h,error:d}=s;if(d)return this._returnResult({data:null,error:d});const m=Object.assign({friendly_name:n.friendlyName,factor_type:n.factorType},n.factorType==="phone"?{phone:n.phone}:n.factorType==="totp"?{issuer:n.issuer}:{}),{data:g,error:p}=await F(this.fetch,"POST",`${this.url}/factors`,{body:m,headers:this.headers,jwt:(l=h?.session)===null||l===void 0?void 0:l.access_token});return p?this._returnResult({data:null,error:p}):(n.factorType==="totp"&&g.type==="totp"&&(!((c=g?.totp)===null||c===void 0)&&c.qr_code)&&(g.totp.qr_code=`data:image/svg+xml;utf-8,${g.totp.qr_code}`),this._returnResult({data:g,error:null}))})}catch(s){if(Y(s))return this._returnResult({data:null,error:s});throw s}}async _verify(n){const s=async()=>{try{return await this._useSession(async l=>{var c;const{data:h,error:d}=l;if(d)return this._returnResult({data:null,error:d});const m=Object.assign({challenge_id:n.challengeId},"webauthn"in n?{webauthn:Object.assign(Object.assign({},n.webauthn),{credential_response:n.webauthn.type==="create"?Jg(n.webauthn.credential_response):Xg(n.webauthn.credential_response)})}:{code:n.code}),{data:g,error:p}=await F(this.fetch,"POST",`${this.url}/factors/${n.factorId}/verify`,{body:m,headers:this.headers,jwt:(c=h?.session)===null||c===void 0?void 0:c.access_token});return p?this._returnResult({data:null,error:p}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+g.expires_in},g)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",g),this._returnResult({data:g,error:p}))})}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,s):s()}async _challenge(n){const s=async()=>{try{return await this._useSession(async l=>{var c;const{data:h,error:d}=l;if(d)return this._returnResult({data:null,error:d});const m=await F(this.fetch,"POST",`${this.url}/factors/${n.factorId}/challenge`,{body:n,headers:this.headers,jwt:(c=h?.session)===null||c===void 0?void 0:c.access_token});if(m.error)return m;const{data:g}=m;if(g.type!=="webauthn")return{data:g,error:null};switch(g.webauthn.type){case"create":return{data:Object.assign(Object.assign({},g),{webauthn:Object.assign(Object.assign({},g.webauthn),{credential_options:Object.assign(Object.assign({},g.webauthn.credential_options),{publicKey:Ig(g.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},g),{webauthn:Object.assign(Object.assign({},g.webauthn),{credential_options:Object.assign(Object.assign({},g.webauthn.credential_options),{publicKey:Yg(g.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,s):s()}async _challengeAndVerify(n){const{data:s,error:l}=await this._challenge({factorId:n.factorId});return l?this._returnResult({data:null,error:l}):await this._verify({factorId:n.factorId,challengeId:s.id,code:n.code})}async _listFactors(){var n;const{data:{user:s},error:l}=await this.getUser();if(l)return{data:null,error:l};const c={all:[],phone:[],totp:[],webauthn:[]};for(const h of(n=s?.factors)!==null&&n!==void 0?n:[])c.all.push(h),h.status==="verified"&&c[h.factor_type].push(h);return{data:c,error:null}}async _getAuthenticatorAssuranceLevel(n){var s,l,c,h;if(n)try{const{payload:w}=uo(n);let R=null;w.aal&&(R=w.aal);let D=R;const{data:{user:q},error:$}=await this.getUser(n);if($)return this._returnResult({data:null,error:$});((l=(s=q?.factors)===null||s===void 0?void 0:s.filter(X=>X.status==="verified"))!==null&&l!==void 0?l:[]).length>0&&(D="aal2");const P=w.amr||[];return{data:{currentLevel:R,nextLevel:D,currentAuthenticationMethods:P},error:null}}catch(w){if(Y(w))return this._returnResult({data:null,error:w});throw w}const{data:{session:d},error:m}=await this.getSession();if(m)return this._returnResult({data:null,error:m});if(!d)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:g}=uo(d.access_token);let p=null;g.aal&&(p=g.aal);let _=p;((h=(c=d.user.factors)===null||c===void 0?void 0:c.filter(w=>w.status==="verified"))!==null&&h!==void 0?h:[]).length>0&&(_="aal2");const T=g.amr||[];return{data:{currentLevel:p,nextLevel:_,currentAuthenticationMethods:T},error:null}}async _getAuthorizationDetails(n){try{return await this._useSession(async s=>{const{data:{session:l},error:c}=s;return c?this._returnResult({data:null,error:c}):l?await F(this.fetch,"GET",`${this.url}/oauth/authorizations/${n}`,{headers:this.headers,jwt:l.access_token,xform:h=>({data:h,error:null})}):this._returnResult({data:null,error:new mt})})}catch(s){if(Y(s))return this._returnResult({data:null,error:s});throw s}}async _approveAuthorization(n,s){try{return await this._useSession(async l=>{const{data:{session:c},error:h}=l;if(h)return this._returnResult({data:null,error:h});if(!c)return this._returnResult({data:null,error:new mt});const d=await F(this.fetch,"POST",`${this.url}/oauth/authorizations/${n}/consent`,{headers:this.headers,jwt:c.access_token,body:{action:"approve"},xform:m=>({data:m,error:null})});return d.data&&d.data.redirect_url&&Tt()&&!s?.skipBrowserRedirect&&window.location.assign(d.data.redirect_url),d})}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}}async _denyAuthorization(n,s){try{return await this._useSession(async l=>{const{data:{session:c},error:h}=l;if(h)return this._returnResult({data:null,error:h});if(!c)return this._returnResult({data:null,error:new mt});const d=await F(this.fetch,"POST",`${this.url}/oauth/authorizations/${n}/consent`,{headers:this.headers,jwt:c.access_token,body:{action:"deny"},xform:m=>({data:m,error:null})});return d.data&&d.data.redirect_url&&Tt()&&!s?.skipBrowserRedirect&&window.location.assign(d.data.redirect_url),d})}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}}async _listOAuthGrants(){try{return await this._useSession(async n=>{const{data:{session:s},error:l}=n;return l?this._returnResult({data:null,error:l}):s?await F(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:s.access_token,xform:c=>({data:c,error:null})}):this._returnResult({data:null,error:new mt})})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _revokeOAuthGrant(n){try{return await this._useSession(async s=>{const{data:{session:l},error:c}=s;return c?this._returnResult({data:null,error:c}):l?(await F(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:l.access_token,query:{client_id:n.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new mt})})}catch(s){if(Y(s))return this._returnResult({data:null,error:s});throw s}}async fetchJwk(n,s={keys:[]}){let l=s.keys.find(m=>m.kid===n);if(l)return l;const c=Date.now();if(l=this.jwks.keys.find(m=>m.kid===n),l&&this.jwks_cached_at+p_>c)return l;const{data:h,error:d}=await F(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(d)throw d;return!h.keys||h.keys.length===0||(this.jwks=h,this.jwks_cached_at=c,l=h.keys.find(m=>m.kid===n),!l)?null:l}async getClaims(n,s={}){try{let l=n;if(!l){const{data:w,error:R}=await this.getSession();if(R||!w.session)return this._returnResult({data:null,error:R});l=w.session.access_token}const{header:c,payload:h,signature:d,raw:{header:m,payload:g}}=uo(l);if(!s?.allowExpired)try{H_(h.exp)}catch(w){throw new yo(w instanceof Error?w.message:"JWT validation failed")}const p=!c.alg||c.alg.startsWith("HS")||!c.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(c.kid,s?.keys?{keys:s.keys}:s?.jwks);if(!p){const{error:w}=await this.getUser(l);if(w)throw w;return{data:{claims:h,header:c,signature:d},error:null}}const _=$_(c.alg),b=await crypto.subtle.importKey("jwk",p,_,!0,["verify"]);if(!await crypto.subtle.verify(_,b,d,A_(`${m}.${g}`)))throw new yo("Invalid JWT signature");return{data:{claims:h,header:c,signature:d},error:null}}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}}async signInWithPasskey(n){var s,l,c;yn(this.experimental);try{if(!_o())return this._returnResult({data:null,error:new _n("Browser does not support WebAuthn",null)});const{data:h,error:d}=await this._startPasskeyAuthentication({options:{captchaToken:(s=n?.options)===null||s===void 0?void 0:s.captchaToken}});if(d||!h)return this._returnResult({data:null,error:d});const m=Yg(h.options),g=(c=(l=n?.options)===null||l===void 0?void 0:l.signal)!==null&&c!==void 0?c:bh.createNewAbortSignal(),{data:p,error:_}=await Ap({publicKey:m,signal:g});if(_||!p)return this._returnResult({data:null,error:_??new _n("WebAuthn ceremony failed",null)});const b=Xg(p);return this._verifyPasskeyAuthentication({challengeId:h.challenge_id,credential:b})}catch(h){if(Y(h))return this._returnResult({data:null,error:h});throw h}}async registerPasskey(n){var s,l;yn(this.experimental);try{if(!_o())return this._returnResult({data:null,error:new _n("Browser does not support WebAuthn",null)});const{data:c,error:h}=await this._startPasskeyRegistration();if(h||!c)return this._returnResult({data:null,error:h});const d=Ig(c.options),m=(l=(s=n?.options)===null||s===void 0?void 0:s.signal)!==null&&l!==void 0?l:bh.createNewAbortSignal(),{data:g,error:p}=await kp({publicKey:d,signal:m});if(p||!g)return this._returnResult({data:null,error:p??new _n("WebAuthn ceremony failed",null)});const _=Jg(g);return this._verifyPasskeyRegistration({challengeId:c.challenge_id,credential:_})}catch(c){if(Y(c))return this._returnResult({data:null,error:c});throw c}}async _startPasskeyRegistration(){yn(this.experimental);try{return await this._useSession(async n=>{const{data:{session:s},error:l}=n;if(l)return this._returnResult({data:null,error:l});if(!s)return this._returnResult({data:null,error:new mt});const{data:c,error:h}=await F(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:s.access_token,body:{}});return h?this._returnResult({data:null,error:h}):this._returnResult({data:c,error:null})})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyRegistration(n){yn(this.experimental);try{return await this._useSession(async s=>{const{data:{session:l},error:c}=s;if(c)return this._returnResult({data:null,error:c});if(!l)return this._returnResult({data:null,error:new mt});const{data:h,error:d}=await F(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:l.access_token,body:{challenge_id:n.challengeId,credential:n.credential}});return d?this._returnResult({data:null,error:d}):this._returnResult({data:h,error:null})})}catch(s){if(Y(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyAuthentication(n){var s;yn(this.experimental);try{const{data:l,error:c}=await F(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(s=n?.options)===null||s===void 0?void 0:s.captchaToken}}});return c?this._returnResult({data:null,error:c}):this._returnResult({data:l,error:null})}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}}async _verifyPasskeyAuthentication(n){yn(this.experimental);try{const{data:s,error:l}=await F(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:n.challengeId,credential:n.credential},xform:rn});return l?this._returnResult({data:null,error:l}):(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:s,error:null}))}catch(s){if(Y(s))return this._returnResult({data:null,error:s});throw s}}async _listPasskeys(){yn(this.experimental);try{return await this._useSession(async n=>{const{data:{session:s},error:l}=n;if(l)return this._returnResult({data:null,error:l});if(!s)return this._returnResult({data:null,error:new mt});const{data:c,error:h}=await F(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:s.access_token,xform:d=>({data:d,error:null})});return h?this._returnResult({data:null,error:h}):this._returnResult({data:c,error:null})})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _updatePasskey(n){yn(this.experimental);try{return await this._useSession(async s=>{const{data:{session:l},error:c}=s;if(c)return this._returnResult({data:null,error:c});if(!l)return this._returnResult({data:null,error:new mt});const{data:h,error:d}=await F(this.fetch,"PATCH",`${this.url}/passkeys/${n.passkeyId}`,{headers:this.headers,jwt:l.access_token,body:{friendly_name:n.friendlyName}});return d?this._returnResult({data:null,error:d}):this._returnResult({data:h,error:null})})}catch(s){if(Y(s))return this._returnResult({data:null,error:s});throw s}}async _deletePasskey(n){yn(this.experimental);try{return await this._useSession(async s=>{const{data:{session:l},error:c}=s;if(c)return this._returnResult({data:null,error:c});if(!l)return this._returnResult({data:null,error:new mt});const{error:h}=await F(this.fetch,"DELETE",`${this.url}/passkeys/${n.passkeyId}`,{headers:this.headers,jwt:l.access_token,noResolveJson:!0});return h?this._returnResult({data:null,error:h}):this._returnResult({data:null,error:null})})}catch(s){if(Y(s))return this._returnResult({data:null,error:s});throw s}}}jr.nextInstanceID={};const cw=jr,hw="2.110.0";let vr="",So;if(typeof Deno<"u"){var th;vr="deno",So=(th=Deno.version)===null||th===void 0?void 0:th.deno}else if(typeof document<"u")vr="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")vr="react-native";else{var nh;vr="node",So=typeof process<"u"?(nh=process.version)===null||nh===void 0?void 0:nh.replace(/^v/,""):void 0}const Cp=[`runtime=${vr}`];So&&Cp.push(`runtime-version=${So}`);const dw={"X-Client-Info":`supabase-js/${hw}; ${Cp.join("; ")}`},fw={headers:dw},mw={schema:"public"},gw={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},pw={},yw={enabled:!1,respectSamplingDecision:!0};function vw(i,n,s,l){function c(h){return h instanceof s?h:new s(function(d){d(h)})}return new(s||(s=Promise))(function(h,d){function m(_){try{p(l.next(_))}catch(b){d(b)}}function g(_){try{p(l.throw(_))}catch(b){d(b)}}function p(_){_.done?h(_.value):c(_.value).then(m,g)}p((l=l.apply(i,[])).next())})}let ah=null;const bw="@opentelemetry/api";function _w(){return ah===null&&(ah=import(bw).catch(()=>null)),ah}function ww(){return vw(this,void 0,void 0,function*(){try{const i=yield _w();if(!i||!i.propagation||!i.context)return null;const n={};i.propagation.inject(i.context.active(),n);const s=n.traceparent;return s?{traceparent:s,tracestate:n.tracestate,baggage:n.baggage}:null}catch{return null}})}function Sw(i){if(!i||typeof i!="string")return null;const n=i.split("-");if(n.length!==4)return null;const[s,l,c,h]=n;if(s.length!==2||l.length!==32||c.length!==16||h.length!==2)return null;const d=/^[0-9a-f]+$/i;return!d.test(s)||!d.test(l)||!d.test(c)||!d.test(h)||l==="00000000000000000000000000000000"||c==="0000000000000000"?null:{version:s,traceId:l,parentId:c,traceFlags:h,isSampled:(parseInt(h,16)&1)===1}}function Tw(i,n){if(!i||!n||n.length===0)return!1;let s;if(i instanceof URL)s=i;else try{s=new URL(i)}catch{return!1}for(const l of n)try{if(typeof l=="string"){if(Ew(s.hostname,l))return!0}else if(l instanceof RegExp){if(l.test(s.hostname))return!0}else if(typeof l=="function"&&l(s))return!0}catch{continue}return!1}function Ew(i,n){if(n===i)return!0;if(n.startsWith("*.")){const s=n.slice(2);if(i.endsWith(s)&&(i===s||i.endsWith("."+s)))return!0}return!1}function kw(i){const n=[];try{const s=new URL(i);n.push(s.hostname)}catch{}return n.push("*.supabase.co","*.supabase.in"),n.push("localhost","127.0.0.1","[::1]"),n}function Nr(i){"@babel/helpers - typeof";return Nr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Nr(i)}function Aw(i,n){if(Nr(i)!="object"||!i)return i;var s=i[Symbol.toPrimitive];if(s!==void 0){var l=s.call(i,n);if(Nr(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(i)}function Cw(i){var n=Aw(i,"string");return Nr(n)=="symbol"?n:n+""}function Rw(i,n,s){return(n=Cw(n))in i?Object.defineProperty(i,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[n]=s,i}function Qg(i,n){var s=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);n&&(l=l.filter(function(c){return Object.getOwnPropertyDescriptor(i,c).enumerable})),s.push.apply(s,l)}return s}function Ze(i){for(var n=1;n<arguments.length;n++){var s=arguments[n]!=null?arguments[n]:{};n%2?Qg(Object(s),!0).forEach(function(l){Rw(i,l,s[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(s)):Qg(Object(s)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(s,l))})}return i}const Ow=i=>i?(...n)=>i(...n):(...n)=>fetch(...n),xw=()=>Headers,jw=(i,n,s,l,c)=>{const h=Ow(l),d=xw(),m=c?.enabled===!0,g=c?.respectSamplingDecision!==!1,p=m?kw(n):null;return async(_,b)=>{var T;const w=(T=await s())!==null&&T!==void 0?T:i;let R=new d(b?.headers);if(R.has("apikey")||R.set("apikey",i),R.has("Authorization")||R.set("Authorization",`Bearer ${w}`),p){const D=await Nw(_,p,g);D&&(D.traceparent&&!R.has("traceparent")&&R.set("traceparent",D.traceparent),D.tracestate&&!R.has("tracestate")&&R.set("tracestate",D.tracestate),D.baggage&&!R.has("baggage")&&R.set("baggage",D.baggage))}return h(_,Ze(Ze({},b),{},{headers:R}))}};async function Nw(i,n,s){if(!Tw(typeof i=="string"||i instanceof URL?i:i.url,n))return null;const l=await ww();if(!l||!l.traceparent)return null;if(s){const c=Sw(l.traceparent);if(c&&!c.isSampled)return null}return l}function Zg(i){return typeof i=="boolean"?{enabled:i}:i}function Dw(i){return i.endsWith("/")?i:i+"/"}function Uw(i,n){var s,l,c,h,d,m;const{db:g,auth:p,realtime:_,global:b}=i,{db:T,auth:w,realtime:R,global:D}=n,q=Zg(i.tracePropagation),$=Zg(n.tracePropagation),H={db:Ze(Ze({},T),g),auth:Ze(Ze({},w),p),realtime:Ze(Ze({},R),_),storage:{},global:Ze(Ze(Ze({},D),b),{},{headers:Ze(Ze({},(s=D?.headers)!==null&&s!==void 0?s:{}),(l=b?.headers)!==null&&l!==void 0?l:{})}),tracePropagation:{enabled:(c=(h=q?.enabled)!==null&&h!==void 0?h:$?.enabled)!==null&&c!==void 0?c:!1,respectSamplingDecision:(d=(m=q?.respectSamplingDecision)!==null&&m!==void 0?m:$?.respectSamplingDecision)!==null&&d!==void 0?d:!0},accessToken:async()=>""};return i.accessToken?H.accessToken=i.accessToken:delete H.accessToken,H}function Lw(i){const n=i?.trim();if(!n)throw new Error("supabaseUrl is required.");if(!n.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(Dw(n))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var zw=class extends cw{constructor(i){super(i)}},Mw=class{constructor(i,n,s){var l,c;this.supabaseUrl=i,this.supabaseKey=n;const h=Lw(i);if(!n)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",h),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",h),this.storageUrl=new URL("storage/v1",h),this.functionsUrl=new URL("functions/v1",h);const d=`sb-${h.hostname.split(".")[0]}-auth-token`,m={db:mw,realtime:pw,auth:Ze(Ze({},gw),{},{storageKey:d}),global:fw,tracePropagation:yw},g=Uw(s??{},m);if(this.settings=g,this.storageKey=(l=g.auth.storageKey)!==null&&l!==void 0?l:"",this.headers=(c=g.global.headers)!==null&&c!==void 0?c:{},g.accessToken)this.accessToken=g.accessToken,this.auth=new Proxy({},{get:(_,b)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(b)} is not possible`)}});else{var p;this.auth=this._initSupabaseAuthClient((p=g.auth)!==null&&p!==void 0?p:{},this.headers,g.global.fetch)}this.fetch=jw(n,i,this._getAccessToken.bind(this),g.global.fetch,g.tracePropagation),this.realtime=this._initRealtimeClient(Ze({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},g.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(_=>this.realtime.setAuth(_)).catch(_=>console.warn("Failed to set initial Realtime auth token:",_)),this.rest=new I0(new URL("rest/v1",h).href,{headers:this.headers,schema:g.db.schema,fetch:this.fetch,timeout:g.db.timeout,urlLengthLimit:g.db.urlLengthLimit}),this.storage=new c_(this.storageUrl.href,this.headers,this.fetch,s?.storage),g.accessToken||this._listenForAuthEvents()}get functions(){return new M0(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(i){return this.rest.from(i)}schema(i){return this.rest.schema(i)}rpc(i,n={},s={head:!1,get:!1,count:void 0}){return this.rest.rpc(i,n,s)}channel(i,n={config:{}}){return this.realtime.channel(i,n)}getChannels(){return this.realtime.getChannels()}removeChannel(i){return this.realtime.removeChannel(i)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var i=this,n,s;if(i.accessToken)return await i.accessToken();const{data:l}=await i.auth.getSession();return(n=(s=l.session)===null||s===void 0?void 0:s.access_token)!==null&&n!==void 0?n:i.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:i,persistSession:n,detectSessionInUrl:s,storage:l,userStorage:c,storageKey:h,flowType:d,lock:m,debug:g,throwOnError:p,experimental:_,lockAcquireTimeout:b,skipAutoInitialize:T},w,R){const D={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new zw({url:this.authUrl.href,headers:Ze(Ze({},D),w),storageKey:h,autoRefreshToken:i,persistSession:n,detectSessionInUrl:s,storage:l,userStorage:c,flowType:d,lock:m,debug:g,throwOnError:p,experimental:_,fetch:R,lockAcquireTimeout:b,skipAutoInitialize:T,hasCustomAuthorizationHeader:Object.keys(this.headers).some(q=>q.toLowerCase()==="authorization")})}_initRealtimeClient(i){return new Ub(this.realtimeUrl.href,Ze(Ze({},i),{},{params:Ze(Ze({},{apikey:this.supabaseKey}),i?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((i,n)=>{this._handleTokenChanged(i,"CLIENT",n?.access_token)})}_handleTokenChanged(i,n,s){(i==="TOKEN_REFRESHED"||i==="SIGNED_IN")&&this.changedAccessToken!==s?(this.changedAccessToken=s,this.realtime.setAuth(s)):i==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const Bw=(i,n,s)=>new Mw(i,n,s);function Hw(){if(typeof window<"u")return!1;const i=globalThis.process;if(!i)return!1;const n=i.version;if(n==null)return!1;const s=n.match(/^v(\d+)\./);return s?parseInt(s[1],10)<=20:!1}Hw()&&console.warn("⚠️ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715");const $w="https://otbyfkjxrkngvjziawki.supabase.co",qw="sb_publishable_NpUs0RDJH2YnllsqTKO6TQ_1jTdSsNQ",jn=Bw($w,qw,{auth:{autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"pkce",storageKey:"livedesk.mindexec.supabase.auth"}}),Sr=5179,Ct=Ur(`http://127.0.0.1:${Sr}`);function Pw(i){const n=i.split(".").map(s=>Number(s));return n.length===4&&n.every(s=>Number.isInteger(s)&&s>=0&&s<=255)?n:[]}function Gw(i){const n=i.trim().toLowerCase();return n==="localhost"||n==="127.0.0.1"||n==="::1"||n==="[::1]"}function Vw(i){const n=i.trim().toLowerCase();return!n||n==="0.0.0.0"||n==="::"||n==="[::]"}function Kw(i){const n=Pw(i);return n.length===0?!1:n[0]===10||n[0]===172&&n[1]>=16&&n[1]<=31||n[0]===192&&n[1]===168}function Iw(i){return i.includes(":")&&!i.startsWith("[")?`[${i}]`:i}function Yw(i){const n=String(i||"").trim();if(!n)return null;const s=/^[a-z][a-z\d+.-]*:\/\//i.test(n)?n:`tcp://${n}`;try{const l=new URL(s),c=l.hostname.replace(/^\[|\]$/g,""),h=Number(l.port);return!c||!Number.isInteger(h)||h<1||h>65535||Vw(c)?null:{host:c,port:h}}catch{return null}}function Ur(i){const n=String(i||"").trim()||`http://127.0.0.1:${Sr}`,s=/^[a-z][a-z\d+.-]*:\/\//i.test(n)?n:`http://${n}`;try{const l=new URL(s);return l.port||(l.port=String(Sr)),l.hash="",l.search="",l.toString().replace(/\/+$/,"")}catch{return`http://127.0.0.1:${Sr}`}}function Jw(i){const n=Yw(i);return n?Ur(`http://${Iw(n.host)}:${Sr}`):""}function Fg(i){const s=[i?.endpoint,...Array.isArray(i?.endpoint_candidates)?i.endpoint_candidates:[]].map(l=>Jw(String(l||""))).filter(Boolean);return[...new Set(s)]}function Tr(i=Ct){if(!(typeof window>"u"||window.location.protocol!=="https:"))try{const n=new URL(i);if(n.protocol!=="http:")return;if(Gw(n.hostname))return"loopback";if(Kw(n.hostname))return"local"}catch{return}}function Th(i,n=Ct){const s=new URL(i,Ur(n));return s.protocol=s.protocol==="https:"?"wss:":"ws:",s.toString()}async function vn(i,n,s=Ct){const l=Ur(s),c={...n,headers:{"Content-Type":"application/json",...n?.headers||{}},cache:"no-store"},h=Tr(l);h&&(c.targetAddressSpace=h);let d;try{d=await fetch(`${l}${i}`,c)}catch(m){throw h?new Error("LiveDesk manager is not reachable at this local network address. If Chrome shows a local network prompt, allow it; otherwise restart the manager so port 5179 is open on the network."):m}if(!d.ok)throw new Error(`${d.status} ${d.statusText}`);return await d.json()}function Xw(i){if(!i)return"-";const n=Date.now()-Date.parse(i);return Number.isFinite(n)?n<1e3?"now":n<6e4?`${Math.round(n/1e3)}s`:n<36e5?`${Math.round(n/6e4)}m`:`${Math.round(n/36e5)}h`:"-"}async function co(i){await navigator.clipboard.writeText(i)}const Wg="livedesk_remote_host_targets",Qw="livedesk_entitlements";function Zw(i){const s=(Array.isArray(i)?i:[i||Ct]).map(l=>Ur(l||Ct));return[...new Set(s.filter(Boolean))]}function Fw(){const[i,n]=G.useState(null),[s,l]=G.useState(!0);return G.useEffect(()=>{let c=!0;jn.auth.getSession().then(({data:d})=>{c&&(n(d.session??null),l(!1))});const{data:{subscription:h}}=jn.auth.onAuthStateChange((d,m)=>{n(m),l(!1)});return()=>{c=!1,h.unsubscribe()}},[]),{session:i,loading:s}}function Ww(i,n=!0){const[s,l]=G.useState(null),[c,h]=G.useState([]),[d,m]=G.useState(""),[g,p]=G.useState(""),[_,b]=G.useState(0),T=Array.isArray(i)?i.join(`
|
|
38
|
-
`):String(i||""),w=G.useMemo(()=>Zw(i),[T]),R=G.useMemo(()=>w.find($=>Tr($)==="loopback")||w[0]||Ct,[w]),D=G.useCallback(async()=>{if(!n){l(null),h([]),p(""),m("");return}let $=null;for(const H of w)try{const[P,X]=await Promise.all([vn("/api/remote/status",void 0,H),vn("/api/remote/devices",void 0,H)]);l(P),h(X.devices||[]),p(H),m("");return}catch(P){$=P}throw p(""),$||new Error("No LiveDesk manager endpoint is reachable.")},[n,w]),q=G.useCallback(()=>{D().catch($=>{m($ instanceof Error?$.message:String($))}),b($=>$+1)},[D]);return G.useEffect(()=>{if(!n){l(null),h([]),p(""),m("");return}let $=!0;const H=async()=>{try{await D()}catch(X){$&&m(X instanceof Error?X.message:String(X))}};H();const P=window.setInterval(H,2500);return()=>{$=!1,window.clearInterval(P)}},[n,D,_]),{status:s,devices:c,error:d,refresh:q,hubBaseUrl:g||R,hubCandidates:w}}function eS(i){const[n,s]=G.useState(null),[l,c]=G.useState(""),h=i?.user?.id||"",d=G.useCallback(async()=>{if(!h){s(null);return}const{data:m,error:g}=await jn.from(Wg).select("*").eq("user_id",h).maybeSingle();if(g){c(g.message);return}s(m),c("")},[h]);return G.useEffect(()=>{d()},[d]),G.useEffect(()=>{if(!h)return;const m=jn.channel(`livedesk-remote-host-targets-${h.replace(/[^a-zA-Z0-9]/g,"")}`).on("postgres_changes",{event:"*",schema:"public",table:Wg,filter:`user_id=eq.${h}`},g=>s(g.new)).subscribe();return()=>{jn.removeChannel(m)}},[h]),{target:n,error:l,refresh:d}}function tS(i){const[n,s]=G.useState(null),[l,c]=G.useState(!1),[h,d]=G.useState(""),m=i?.user?.id||"",g=G.useCallback(async()=>{if(!m){s(null),d(""),c(!1);return}c(!0);const{data:_,error:b}=await jn.from(Qw).select("*").eq("user_id",m).eq("product_key","livedesk").maybeSingle();if(b){d(b.message),c(!1);return}s(_),d(""),c(!1)},[m]);G.useEffect(()=>{g()},[g]);const p=G.useMemo(()=>!n||n.status!=="active"?!1:n.expires_at?new Date(n.expires_at).getTime()>Date.now():!0,[n]);return{entitlement:n,licensed:p,loading:l,error:h,refresh:g}}function nS(i,n,s=Ct){const[l,c]=G.useState(new Map),[h,d]=G.useState("idle"),m=G.useMemo(()=>[...i].sort().join(","),[i]);return G.useEffect(()=>{const g=m?m.split(",").filter(Boolean):[];if(g.length===0){d("idle"),c(new Map);return}const p=new WebSocket(Th(`/api/remote/frames/ws?devices=${encodeURIComponent(g.join(","))}`,s));return p.binaryType="arraybuffer",d("connecting"),p.addEventListener("open",()=>{d("open"),p.send(JSON.stringify({type:"subscribe",deviceIds:g,autoStartLive:n,fps:12,maxWidth:960,maxHeight:540,quality:60,mode:"remote-fast"}))}),p.addEventListener("message",_=>{if(typeof _.data=="string")return;const b=_.data instanceof ArrayBuffer?_.data:null;if(!b||b.byteLength<5)return;const w=new DataView(b).getUint32(0,!1);if(w<=0||w+4>b.byteLength)return;const R=new Uint8Array(b.slice(4,4+w)),D=JSON.parse(new TextDecoder().decode(R)),q=b.slice(4+w),$={deviceId:String(D.deviceId||""),kind:D.kind==="thumbnail"?"thumbnail":"live",frameSeq:Number(D.frameSeq||0),streamId:String(D.streamId||""),width:Number(D.width||0),height:Number(D.height||0),mimeType:String(D.mimeType||"image/jpeg"),capturedAt:String(D.capturedAt||""),receivedAt:String(D.receivedAt||""),byteLength:Number(D.byteLength||q.byteLength),contentHash:D.contentHash?String(D.contentHash):void 0,payload:q};$.deviceId&&c(H=>{const P=H.get($.deviceId);if(P&&P.frameSeq>$.frameSeq)return H;const X=new Map(H);return X.set($.deviceId,$),X})}),p.addEventListener("error",()=>d("error")),p.addEventListener("close",()=>d("closed")),()=>{p.close()}},[n,m,s]),{frames:l,state:h}}function aS(i,n=Ct){const s=G.useRef(null),[l,c]=G.useState("idle");G.useEffect(()=>{if(!i){s.current?.close(),s.current=null,c("idle");return}const d=new WebSocket(Th("/api/remote/input/ws",n));return s.current=d,c("connecting"),d.addEventListener("open",()=>c("open")),d.addEventListener("close",()=>c("closed")),d.addEventListener("error",()=>c("error")),()=>{d.close(),s.current===d&&(s.current=null)}},[i,n]);const h=G.useCallback((d,m)=>{const g=s.current;return!g||g.readyState!==WebSocket.OPEN||!d?!1:(g.send(JSON.stringify({type:"input",requestId:crypto.randomUUID(),deviceId:d,input:{...m,issuedAt:new Date().toISOString()}})),!0)},[]);return{state:l,sendInput:h}}function iS(i){const n=String(i||"").toLowerCase();return n.includes("audio/pcm")||n.includes("audio/l16")||n.includes("f32le")||n.includes("s16le")}function sS(i,n,s){const l=Math.max(1,Math.min(8,Math.floor(n.channels||2))),c=Math.max(8e3,Math.min(192e3,Math.floor(n.sampleRate||48e3))),h=String(n.mimeType||"").toLowerCase(),d=h.includes("s16le")||h.includes("audio/l16"),m=d?2:4,g=Math.floor(s.byteLength/m),p=Math.floor(g/l),_=i.createBuffer(l,p,c),b=new DataView(s);for(let T=0;T<l;T+=1){const w=_.getChannelData(T);for(let R=0;R<p;R+=1){const q=(R*l+T)*m;w[R]=d?Math.max(-1,Math.min(1,b.getInt16(q,!0)/32768)):Math.max(-1,Math.min(1,b.getFloat32(q,!0)))}}return _}function rS(i,n,s=Ct){const l=G.useRef(null),c=G.useRef(0),[h,d]=G.useState("idle"),[m,g]=G.useState(null),[p,_]=G.useState("");return G.useEffect(()=>{if(!n||!i){d("idle"),g(null),_("");return}const b=window.AudioContext||window.webkitAudioContext;if(!b){d("unsupported"),_("Audio playback is not supported in this browser.");return}const T=new b;l.current=T,c.current=T.currentTime;const w=new WebSocket(Th(`/api/remote/audio/ws?devices=${encodeURIComponent(i)}`,s));w.binaryType="arraybuffer";let R=!1;return d("connecting"),_(""),w.addEventListener("open",()=>{R||(d("open"),w.send(JSON.stringify({type:"subscribe",deviceIds:[i]})),T.resume())}),w.addEventListener("message",D=>{if(typeof D.data=="string")return;const q=D.data instanceof ArrayBuffer?D.data:null;!q||q.byteLength<5||(async()=>{try{const H=new DataView(q).getUint32(0,!1);if(H<=0||H+4>q.byteLength)return;const P=new Uint8Array(q.slice(4,4+H)),X=JSON.parse(new TextDecoder().decode(P)),ge=q.slice(4+H),ne={deviceId:String(X.deviceId||""),frameSeq:Number(X.frameSeq||0),streamId:String(X.streamId||""),mimeType:String(X.mimeType||"audio/webm;codecs=opus"),sampleRate:Number(X.sampleRate||48e3),channels:Number(X.channels||2),capturedAt:String(X.capturedAt||""),receivedAt:String(X.receivedAt||""),byteLength:Number(X.byteLength||ge.byteLength),payload:ge};if(!ne.deviceId||R)return;const J=iS(ne.mimeType)?sS(T,ne,ge):await T.decodeAudioData(ge.slice(0));if(R)return;const Te=T.createBufferSource();Te.buffer=J,Te.connect(T.destination);const Ee=Math.max(T.currentTime+.02,c.current);Te.start(Ee),c.current=Ee+J.duration,g(ne),d("playing")}catch($){R||(d("error"),_($ instanceof Error?$.message:String($)))}})()}),w.addEventListener("error",()=>{R||d("error")}),w.addEventListener("close",()=>{R||d("closed")}),()=>{R=!0,w.close(),T.close().catch(()=>{}),l.current===T&&(l.current=null)}},[i,n,s]),{state:h,lastFrame:m,error:p}}const lS=120,oS=999,ts=4,Rp="livedesk.remoteDirectory",_h="livedesk.localHubAccessEnabled",uS=24*1024*1024;function Er(i,n){const s=i.capabilities?.[n];return typeof s=="boolean"?s:/^(1|true|yes|on)$/i.test(String(s||"").trim())}function mo(i){return i.deviceName||i.hostname||i.deviceId}function cS(){return"npx @livedesk/client"}function hS(){try{return localStorage.getItem(Rp)||""}catch{return""}}function dS(){try{return localStorage.getItem(_h)==="1"}catch{return!1}}function ns(i){try{i?localStorage.setItem(_h,"1"):localStorage.removeItem(_h)}catch{}}function ep(i,n){return i.length!==n.length?!1:i.every((s,l)=>s===n[l])}function ci(i){if(!Number.isFinite(i)||i<=0)return"0 B";const n=["B","KB","MB","GB","TB"];let s=i,l=0;for(;s>=1024&&l<n.length-1;)s/=1024,l+=1;const c=l===0||s>=100?0:1;return`${s.toFixed(c)} ${n[l]}`}function fS(i){const n=new Uint8Array(i),s=32768;let l="";for(let c=0;c<n.length;c+=s){const h=n.subarray(c,c+s);l+=String.fromCharCode(...h)}return btoa(l)}function mS(i){return i===1?"middle":i===2?"right":"left"}function tp(i,...n){for(const s of n){const l=i?.[s];if(typeof l=="string"&&l.trim())return l.trim()}return""}function mr(i){const n=Number(i);return Number.isInteger(n)&&n>=1&&n<=oS?n:0}function Co(i,n){const s=n.split(".");let l=i;for(const c of s){if(l==null)return;if(Array.isArray(l)){const h=Number(c);l=Number.isInteger(h)?l[h]:void 0;continue}if(typeof l=="object"){l=l[c];continue}return}return l}function Ye(i,...n){for(const s of n){const l=Co(i,s),c=Number(l);if(Number.isFinite(c))return c}}function Mt(i,...n){for(const s of n){const l=Co(i,s);if(typeof l=="string"&&l.trim())return l.trim();if(typeof l=="number"&&Number.isFinite(l))return String(l)}return""}function gS(i,...n){for(const s of n){const l=Co(i,s);if(typeof l=="boolean")return l;if(/^(1|true|yes|on|online|running|ready)$/i.test(String(l||"").trim()))return!0;if(/^(0|false|no|off|offline|stopped|missing)$/i.test(String(l||"").trim()))return!1}}function ta(i){const n=Number(i);if(Number.isFinite(n))return Math.max(0,Math.min(1,n>1?n/100:n))}function ih(i,n){if(!(typeof i!="number"||typeof n!="number"||!Number.isFinite(i)||!Number.isFinite(n)||i<=0))return ta((i-Math.max(0,n))/i)}function gr(i){return i===void 0?"-":`${Math.round(i*100)}%`}function sh(i){return i===void 0||!Number.isFinite(i)?"":i>=1e3?`${(i/1e3).toFixed(i>=1e4?0:1)}Gb/s`:`${Math.round(i)}Mb/s`}function as(i,n=.92,s=.78){return i===void 0?"unknown":i>=n?"critical":i>=s?"warn":"good"}function Op(i){return!Number.isFinite(i)||!i||i<=0?"-":i<3600?`${Math.round(i/60)}m`:i<86400?`${Math.round(i/3600)}h`:`${Math.round(i/86400)}d`}function ho(i,n,s){const l=Co(i,`tools.${n}`),c=Mt(i,`tools.${n}.status`,`tooling.${n}.status`,`${n}.status`).toLowerCase(),h=gS(i,`tools.${n}.running`,`tooling.${n}.running`,`${n}.running`),d=Mt(i,`tools.${n}.version`,`tooling.${n}.version`,`${n}.version`),m=Mt(i,`tools.${n}.port`,`tooling.${n}.port`,`${n}.port`);let g="unknown";return c==="busy"?g="busy":["online","running","ready","active"].includes(c)||h===!0?g="online":(["offline","stopped","missing","not-found"].includes(c)||h===!1||l===!1)&&(g="offline"),{id:n,label:s,status:g,detail:g==="offline"?"offline":d||(m?`:${m}`:g==="unknown"?"not reported":g)}}function xp(i){const n=i.status||{},s=Ye(n,"cpu.cores","cpuCores","processorCount"),l=Ye(n,"loadavg.0","cpu.load1"),c=ta(Ye(n,"cpu.usedRatio","cpu.usageRatio","cpu.ratio","cpu.usedPct","cpu.usagePct","cpu.percent")??(s&&l!==void 0?l/Math.max(1,s):void 0)),h=Ye(n,"memory.totalBytes","totalMem"),d=Ye(n,"memory.freeBytes","freeMem"),m=ta(Ye(n,"memory.usedRatio","memory.usedPct","usedMemRatio"))??ih(h,d),g=Ye(n,"disk.totalBytes","rootDisk.totalBytes","storage.totalBytes"),p=Ye(n,"disk.freeBytes","rootDisk.freeBytes","storage.freeBytes"),_=ta(Ye(n,"disk.usedRatio","disk.usedPct","rootDisk.usedRatio","storage.usedRatio"))??ih(g,p),b=Ye(n,"thermal.cpuC","temperatureC","cpu.temperatureC","gpu.temperatureC"),T=ta(Ye(n,"gpu.usedRatio","gpu.usageRatio","gpu.usedPct","gpu.usagePct","gpu.percent","accelerators.gpu.usageRatio")),w=Mt(n,"gpu.name","gpu.model","accelerators.gpu.name"),R=Ye(n,"gpu.memory.totalBytes","gpu.totalMemoryBytes","gpu.vramTotalBytes"),D=Ye(n,"gpu.memory.freeBytes","gpu.freeMemoryBytes","gpu.vramFreeBytes"),q=ta(Ye(n,"gpu.memory.usedRatio","gpu.vramUsedRatio"))??ih(R,D),$=Ye(n,"gpu.temperatureC","thermal.gpuC"),H=ta(Ye(n,"npu.usedRatio","npu.usageRatio","npu.usedPct","npu.usagePct","npu.percent","accelerators.npu.usageRatio")),P=Mt(n,"npu.name","npu.model","accelerators.npu.name"),X=Ye(n,"npu.tops","npu.topsInt8","accelerators.npu.tops"),ge=Ye(n,"network.rxMbps","network.receiveMbps","network.downMbps"),ne=Ye(n,"network.txMbps","network.transmitMbps","network.upMbps"),J=Ye(n,"network.latencyMs","network.rttMs"),Te=ta(Ye(n,"network.usedRatio","network.usageRatio","network.saturationRatio")),Ee=Mt(n,"network.link","network.interface","network.name"),ln=b===void 0?void 0:ta((b-35)/60),ot=Mt(n,"workload.role","role","lane")||(Er(i,"aiAssist")?"Agent worker":Er(i,"taskDispatch")?"Task worker":"Local machine"),ze=Mt(i.latestTask,"status")||Mt(n,"workload.status")||"idle",ut=Mt(i.latestTask,"title","instructionPreview")||Mt(n,"workload.title"),dt=Mt(i.latestTask,"resultSummary","error","instructionPreview")||Mt(n,"workload.summary"),Pe=[ho(n,"ollama","Ollama"),ho(n,"lmStudio","LM Studio"),ho(n,"comfyui","ComfyUI"),ho(n,"stableDiffusion","Stable Diffusion")],U=Pe.some(L=>L.status!=="unknown"),V=Date.parse(i.lastSeenAt||i.connectedAt||""),te=Number.isFinite(V)?Date.now()-V:0;let W="online";i.connected?te>5*6e4?W="stale":(b??0)>=86||($??0)>=88||(c??0)>=.94||(T??0)>=.96||(H??0)>=.96||(m??0)>=.94||(_??0)>=.94||(J??0)>=200||ze==="failed"?W="critical":(b??0)>=78||($??0)>=80||(c??0)>=.82||(T??0)>=.86||(H??0)>=.86||(m??0)>=.82||(_??0)>=.86||(J??0)>=80?W="warn":(["queued","running","targeted"].includes(ze)||Pe.some(L=>L.status==="busy"))&&(W="busy"):W="offline";const Se={online:"Ready",busy:"Busy",warn:"Watch",critical:"Issue",stale:"Stale",offline:"Offline"},k=Pe.filter(L=>L.status==="online"||L.status==="busy").length;return{state:W,label:Se[W],role:ot,taskLabel:ut||(ze==="idle"?"idle":ze),taskStatus:ze,taskSummary:dt,tools:U?Pe:Pe.map(L=>({...L,detail:"not reported"})),metrics:[{id:"cpu",label:"CPU",value:gr(c),detail:s?`${s} cores`:l!==void 0?`load ${l.toFixed(1)}`:"not reported",ratio:c,state:as(c,.92,.78)},{id:"memory",label:"MEM",value:gr(m),detail:h?`${ci(h-(d||0))} / ${ci(h)}`:"not reported",ratio:m,state:as(m,.92,.78)},{id:"disk",label:"DISK",value:gr(_),detail:g&&p!==void 0?`${ci(p)} free`:"not reported",ratio:_,state:as(_,.92,.82)},{id:"gpu",label:"GPU",value:gr(T??q),detail:w||(R&&D!==void 0?`${ci(D)} VRAM free`:$!==void 0?`${Math.round($)}C`:"not reported"),ratio:T??q,state:$!==void 0&&$>=88?"critical":$!==void 0&&$>=80?"warn":as(T??q,.96,.86)},{id:"npu",label:"NPU",value:H!==void 0?gr(H):X!==void 0?`${Math.round(X)} TOPS`:"-",detail:P||(X!==void 0?"neural engine":"not reported"),ratio:H,state:as(H,.96,.86)},{id:"temp",label:"TEMP",value:b===void 0?"-":`${Math.round(b)}C`,detail:k>0?`${k} local tools`:`uptime ${Op(Ye(n,"uptimeSec"))}`,ratio:ln,state:b===void 0?"unknown":b>=86?"critical":b>=78?"warn":"good"},{id:"network",label:"NET",value:sh(ge)||(J!==void 0?`${Math.round(J)}ms`:Ee||"-"),detail:sh(ne)?`${sh(ne)} up`:Ee||"not reported",ratio:Te,state:J!==void 0&&J>=200?"critical":J!==void 0&&J>=80?"warn":as(Te,.9,.75)}]}}const pS=[{id:"small",label:"Small"},{id:"medium",label:"Medium"},{id:"large",label:"Large"}],yS=[{id:"wall",label:"Wall",icon:sp,accent:"blue"},{id:"control",label:"Control",icon:oh,accent:"red"},{id:"agents",label:"Agents",icon:is,accent:"violet"},{id:"doc",label:"Doc",icon:rh,accent:"amber"},{id:"pricing",label:"Pricing",icon:lh,accent:"green"},{id:"settings",label:"Settings",icon:k0,accent:"gray"}],hs={ko:{languageName:"한국어",languageLabel:"문서 언어",eyebrow:"LiveDesk Manual",title:"로컬 스크린 월 시작하기",intro:"LiveDesk는 매니저 PC 한 대에서 여러 작업 PC의 화면을 모니터링하고 필요한 기능을 실행하는 로컬 우선 원격 작업 데크입니다.",sections:[{title:"1. 매니저 먼저 실행",body:"화면을 보는 컴퓨터에서 LiveDesk 대시보드를 열고 Google 계정으로 로그인합니다.",points:["로컬 앱이 켜져 있어야 클라이언트가 붙을 수 있습니다.","로그인하면 매니저 주소와 연결 토큰이 Supabase에 짧게 갱신됩니다."]},{title:"2. 클라이언트 연결",body:"제어당할 컴퓨터에서 npm 명령을 실행하고 같은 Google 계정으로 로그인합니다.",points:["번호 없이 실행하면 빈 슬롯에 선착순 배치됩니다.","번호를 붙이면 해당 화면 위치에 고정됩니다. 예: npx @livedesk/client 3"]},{title:"3. 화면 배치와 기능",body:"연결된 컴퓨터는 스크린 월에 나타나며 Live, Control, Files, Reboot 같은 기능 버튼의 대상이 됩니다.",points:["Small, Medium, Large로 화면 밀도를 바꿀 수 있습니다.","LTD 라이선스가 있어야 라이브 모니터링과 제어 기능이 열립니다."]},{title:"4. 여러 장소 모니터링",body:"P2P나 클라우드 릴레이가 없으므로 외부 장소의 PC도 매니저 PC에 직접 닿을 수 있어야 합니다.",points:["VPN, Tailscale, ZeroTier, 사설망 터널이 가장 안전합니다.","공유기 포트포워딩은 가능하지만 신뢰된 IP로 제한하는 것이 좋습니다."]}],sync:{title:"Sync Server",body:"왼쪽 하단의 Sync Server는 현재 화면 wall을 클라이언트가 찾아올 manager로 Supabase에 등록합니다.",points:["manager 주소, 후보 주소, pair token, host instance, 짧은 lease를 Supabase에 기록합니다.","클라이언트는 npx @livedesk/client 실행 후 Google 로그인으로 이 기록을 읽고 manager에 접속합니다.","네트워크, 방화벽, VPN, manager 위치가 바뀌었거나 개발 중 이 화면을 active manager로 잡고 싶을 때 누릅니다.","자동 갱신은 같은 host instance만 연장하고, 다른 장소의 active manager는 Sync Server를 직접 눌렀을 때만 takeover합니다."]},firewall:{title:"매니저 방화벽과 외부 장소 연결",body:"다른 건물, 사무실, 해외 숙소의 화면을 한 매니저에서 보려면 클라이언트 PC가 매니저의 RemoteHub TCP 포트에 접근해야 합니다.",points:["기본 RemoteHub 포트는 TCP 5197입니다.","Windows 방화벽에서 매니저 PC의 TCP 5197 인바운드를 허용합니다.","공유기나 클라우드 네트워크에서 TCP 5197을 매니저 PC로 전달합니다.","인터넷 전체에 열기보다 VPN 또는 허용 IP 목록을 우선 사용합니다.","공개 노출 시 강한 pair token을 쓰고, 필요할 때만 열어두세요."]},commands:{title:"자주 쓰는 명령",body:"외부 장소의 PC도 같은 Google 로그인 흐름으로 연결합니다. 매니저 PC 방화벽과 네트워크 접근만 준비하면 됩니다.",primary:"기본 자동 연결",slot:"3번 슬롯에 배치",manual:"수동 LAN 또는 외부망 연결"}},en:{languageName:"English",languageLabel:"Document language",eyebrow:"LiveDesk Manual",title:"Start a local screen wall",intro:"LiveDesk is a local-first remote work deck for monitoring many workstations from one manager PC and running focused actions when needed.",sections:[{title:"1. Start the manager first",body:"Open the LiveDesk dashboard on the computer that will watch the screens, then sign in with Google.",points:["The local app must be running before clients can attach.","After sign-in, the manager refreshes its address and private token in Supabase for a short lease."]},{title:"2. Connect a client",body:"On the computer being monitored, run the npm command and sign in with the same Google account.",points:["Run without a number for first available placement.","Add a number to pin the computer to a slot. Example: npx @livedesk/client 3"]},{title:"3. Place screens and use tools",body:"Connected computers appear on the screen wall and become targets for Live, Control, Files, Reboot, and later tools.",points:["Switch Small, Medium, or Large to change wall density.","An LTD license unlocks live monitoring and control features."]},{title:"4. Monitor several locations",body:"Because there is no P2P or cloud relay, remote-site clients must be able to reach the manager PC directly.",points:["VPN, Tailscale, ZeroTier, or a private tunnel is the safest path.","Router port forwarding can work, but restrict it to trusted IP addresses."]}],sync:{title:"Sync Server",body:"The Sync Server button makes this screen wall the manager that clients discover through Supabase.",points:["It writes the manager address, endpoint candidates, pair token, host instance, and short lease to Supabase.","After Google sign-in, npx @livedesk/client reads that record and connects to this manager.","Click it after network, firewall, VPN, or manager-location changes, or when this browser should become the active manager during development.","Automatic refresh only renews the same host instance. A different active manager is taken over only when you click Sync Server or Sync access."]},firewall:{title:"Manager firewall for remote locations",body:"To monitor screens from another building, office, or country, clients and the screen wall must be able to reach the manager PC.",points:["Client connection port: TCP 5197.","Screen wall/API port: TCP 5179.","Allow inbound TCP 5197 and TCP 5179 on the manager PC firewall when remote access is needed.","Forward TCP 5197 and, only if you need the web wall outside the LAN, TCP 5179 from the router or network edge to the manager PC.","Prefer VPN or IP allowlists instead of exposing the port to the whole internet.","Use a strong pair token and keep public exposure temporary."]},commands:{title:"Common commands",body:"Remote-site PCs use the same Google sign-in flow. Prepare the manager firewall and network reachability, then run the simple client command.",primary:"Automatic connection",slot:"Place in slot 3",manual:"Manual LAN or remote-network connection"}},ja:{languageName:"日本語",languageLabel:"ドキュメント言語",eyebrow:"LiveDesk Manual",title:"ローカル画面ウォールを始める",intro:"LiveDesk は、1 台のマネージャー PC から複数の作業 PC を監視し、必要な操作を実行するローカル優先のリモート作業デッキです。",sections:[{title:"1. 先にマネージャーを起動",body:"画面を見る PC で LiveDesk ダッシュボードを開き、Google でログインします。",points:["クライアントを接続する前にローカルアプリを起動します。","ログイン後、マネージャーのアドレスと非公開トークンが Supabase に短時間登録されます。"]},{title:"2. クライアントを接続",body:"監視される PC で npm コマンドを実行し、同じ Google アカウントでログインします。",points:["番号なしなら空きスロットに自動配置されます。","番号を付けると固定スロットになります。例: npx @livedesk/client 3"]},{title:"3. 画面配置と機能",body:"接続された PC はスクリーンウォールに表示され、Live、Control、Files、Reboot などの対象になります。",points:["Small、Medium、Large で表示密度を変更できます。","LTD ライセンスでライブ監視と制御が有効になります。"]},{title:"4. 複数拠点の監視",body:"P2P やクラウドリレーはないため、外部拠点のクライアントはマネージャー PC に直接到達できる必要があります。",points:["VPN、Tailscale、ZeroTier、プライベートトンネルが安全です。","ポート転送を使う場合は信頼済み IP に限定してください。"]}],firewall:{title:"外部拠点用マネージャー防火壁",body:"別の建物や国の画面を監視するには、各クライアントがマネージャーの RemoteHub TCP ポートへ到達する必要があります。",points:["既定ポートは TCP 5197 です。","マネージャー PC の Windows 防火壁で TCP 5197 の受信を許可します。","ルーターで TCP 5197 をマネージャー PC に転送します。","インターネット全体へ開放せず VPN または許可 IP を優先します。","強い pair token を使い、公開は必要な時だけにします。"]},commands:{title:"よく使うコマンド",body:"外部拠点の PC も同じ Google ログインで接続します。マネージャーの防火壁と到達性だけを準備してください。",primary:"自動接続",slot:"3 番スロットに配置",manual:"手動 LAN / 外部ネットワーク接続"}},"zh-CN":{languageName:"简体中文",languageLabel:"文档语言",eyebrow:"LiveDesk Manual",title:"启动本地屏幕墙",intro:"LiveDesk 是一个本地优先的远程工作台,可从一台管理电脑监控多台工作站,并执行必要操作。",sections:[{title:"1. 先启动管理端",body:"在负责查看屏幕的电脑上打开 LiveDesk 仪表板,并使用 Google 登录。",points:["客户端连接前,本地应用必须运行。","登录后,管理端地址和私有令牌会短期刷新到 Supabase。"]},{title:"2. 连接客户端",body:"在被监控的电脑上运行 npm 命令,并使用同一个 Google 账号登录。",points:["不带数字会自动放到第一个空位。","带数字可固定到指定槽位。例如: npx @livedesk/client 3"]},{title:"3. 屏幕布局和工具",body:"已连接电脑会出现在屏幕墙中,并成为 Live、Control、Files、Reboot 等功能目标。",points:["用 Small、Medium、Large 调整屏幕密度。","LTD 许可证会解锁实时监控和控制功能。"]},{title:"4. 监控多个地点",body:"LiveDesk 没有 P2P 或云中继,外部地点的客户端必须能直接访问管理电脑。",points:["推荐 VPN、Tailscale、ZeroTier 或私有隧道。","端口转发可以使用,但应限制可信 IP。"]}],firewall:{title:"管理端防火墙和外部地点",body:"要监控其他建筑、办公室或国家的屏幕,客户端必须访问管理端 RemoteHub TCP 端口。",points:["默认 RemoteHub 端口是 TCP 5197。","在管理电脑防火墙中允许 TCP 5197 入站。","在路由器或网络边界把 TCP 5197 转发到管理电脑。","优先使用 VPN 或 IP 白名单,不要向整个互联网开放。","使用强 pair token,并只在需要时公开。"]},commands:{title:"常用命令",body:"外部地点的电脑也使用同一个 Google 登录流程。只需要准备好管理端防火墙和网络可达性。",primary:"自动连接",slot:"放到 3 号槽位",manual:"手动 LAN 或外部网络连接"}},"zh-TW":{languageName:"繁體中文",languageLabel:"文件語言",eyebrow:"LiveDesk Manual",title:"啟動本機螢幕牆",intro:"LiveDesk 是本機優先的遠端工作台,可由一台管理電腦監看多台工作站並執行必要操作。",sections:[{title:"1. 先啟動管理端",body:"在負責監看的電腦開啟 LiveDesk 儀表板,並使用 Google 登入。",points:["客戶端連線前,本機應用程式必須運行。","登入後,管理端位址和私密 token 會短期刷新到 Supabase。"]},{title:"2. 連接客戶端",body:"在被監看的電腦執行 npm 指令,並用同一個 Google 帳號登入。",points:["不加數字會自動放入第一個空位。","加上數字可固定到指定槽位。例如: npx @livedesk/client 3"]},{title:"3. 螢幕配置與功能",body:"已連線電腦會出現在螢幕牆,並成為 Live、Control、Files、Reboot 等功能目標。",points:["可用 Small、Medium、Large 調整顯示密度。","LTD 授權會開啟即時監看與控制功能。"]},{title:"4. 監看多個地點",body:"因為沒有 P2P 或雲端中繼,外部地點的客戶端必須能直接連到管理電腦。",points:["建議使用 VPN、Tailscale、ZeroTier 或私有通道。","可以使用連接埠轉發,但請限制可信任 IP。"]}],firewall:{title:"管理端防火牆與外部地點",body:"若要監看不同建物、辦公室或國家的畫面,各客戶端必須連到管理端 RemoteHub TCP 連接埠。",points:["預設 RemoteHub 連接埠是 TCP 5197。","在管理電腦防火牆允許 TCP 5197 輸入。","在路由器或網路邊界將 TCP 5197 轉發到管理電腦。","優先使用 VPN 或 IP 白名單,不要直接對全網開放。","使用強 pair token,且只在需要時公開。"]},commands:{title:"常用指令",body:"外部地點的電腦也使用同一個 Google 登入流程。只需要準備好管理端防火牆與網路可達性。",primary:"自動連線",slot:"放到 3 號槽位",manual:"手動 LAN 或外部網路連線"}},es:{languageName:"Español",languageLabel:"Idioma del manual",eyebrow:"LiveDesk Manual",title:"Inicia un muro de pantallas local",intro:"LiveDesk es una consola local para vigilar muchas estaciones desde un PC administrador y ejecutar acciones enfocadas cuando sea necesario.",sections:[{title:"1. Inicia primero el manager",body:"Abre el panel de LiveDesk en el equipo que verá las pantallas e inicia sesión con Google.",points:["La app local debe estar activa antes de conectar clientes.","Al iniciar sesión, la dirección del manager y el token privado se actualizan en Supabase por poco tiempo."]},{title:"2. Conecta un cliente",body:"En el equipo que será monitoreado, ejecuta el comando npm e inicia sesión con la misma cuenta de Google.",points:["Sin número se coloca en el primer espacio libre.","Con número queda fijo en una posición. Ejemplo: npx @livedesk/client 3"]},{title:"3. Organiza pantallas y herramientas",body:"Los equipos conectados aparecen en el muro y son destino de Live, Control, Files, Reboot y más.",points:["Cambia Small, Medium o Large para ajustar la densidad.","La licencia LTD desbloquea monitoreo en vivo y control."]},{title:"4. Monitorea varios lugares",body:"Como no hay P2P ni relay en la nube, los clientes externos deben llegar directamente al PC manager.",points:["VPN, Tailscale, ZeroTier o túnel privado es lo más seguro.","El reenvío de puertos funciona, pero limítalo a IP confiables."]}],firewall:{title:"Firewall del manager para sedes remotas",body:"Para ver pantallas de otra oficina, edificio o país, cada cliente debe alcanzar el puerto TCP RemoteHub del manager.",points:["Puerto predeterminado: TCP 5197.","Permite entrada TCP 5197 en el firewall del PC manager.","Reenvía TCP 5197 desde el router al PC manager.","Prefiere VPN o lista de IP permitidas antes que abrirlo a internet.","Usa un pair token fuerte y exposición temporal."]},commands:{title:"Comandos comunes",body:"Los equipos remotos usan el mismo inicio de sesión con Google. Prepara el firewall del manager y la conectividad de red.",primary:"Conexión automática",slot:"Colocar en el slot 3",manual:"Conexión manual LAN o remota"}},fr:{languageName:"Français",languageLabel:"Langue du manuel",eyebrow:"LiveDesk Manual",title:"Démarrer un mur d’écrans local",intro:"LiveDesk est un poste de contrôle local pour surveiller plusieurs machines depuis un PC manager et lancer des actions ciblées.",sections:[{title:"1. Lancez d’abord le manager",body:"Ouvrez le tableau de bord LiveDesk sur l’ordinateur qui observe les écrans, puis connectez-vous avec Google.",points:["L’application locale doit fonctionner avant l’arrivée des clients.","Après connexion, l’adresse du manager et le token privé sont rafraîchis dans Supabase pour une courte durée."]},{title:"2. Connectez un client",body:"Sur l’ordinateur surveillé, lancez la commande npm et connectez-vous avec le même compte Google.",points:["Sans numéro, la machine prend le premier emplacement libre.","Avec un numéro, elle reste fixée à ce slot. Exemple: npx @livedesk/client 3"]},{title:"3. Organisez les écrans",body:"Les machines connectées apparaissent dans le mur et deviennent les cibles de Live, Control, Files, Reboot et autres outils.",points:["Small, Medium et Large changent la densité du mur.","La licence LTD active le monitoring live et le contrôle."]},{title:"4. Surveillez plusieurs sites",body:"Sans P2P ni relais cloud, les clients distants doivent atteindre directement le PC manager.",points:["VPN, Tailscale, ZeroTier ou tunnel privé est recommandé.","Le port forwarding est possible, mais limitez-le aux IP de confiance."]}],firewall:{title:"Firewall du manager pour sites distants",body:"Pour surveiller un autre bâtiment, bureau ou pays, chaque client doit atteindre le port TCP RemoteHub du manager.",points:["Port par défaut: TCP 5197.","Autorisez le TCP entrant 5197 sur le firewall du manager.","Redirigez TCP 5197 du routeur vers le PC manager.","Préférez VPN ou liste d’IP autorisées plutôt qu’une exposition publique.","Utilisez un pair token fort et une exposition temporaire."]},commands:{title:"Commandes utiles",body:"Les PC distants utilisent le même flux de connexion Google. Préparez seulement le firewall du manager et l’accès réseau.",primary:"Connexion automatique",slot:"Placer dans le slot 3",manual:"Connexion LAN ou réseau distant manuelle"}},de:{languageName:"Deutsch",languageLabel:"Dokumentsprache",eyebrow:"LiveDesk Manual",title:"Lokale Bildschirmwand starten",intro:"LiveDesk ist ein lokales Remote-Deck, um viele Arbeitsrechner von einem Manager-PC zu überwachen und gezielte Aktionen auszuführen.",sections:[{title:"1. Manager zuerst starten",body:"Öffne das LiveDesk-Dashboard auf dem PC, der die Bildschirme überwacht, und melde dich mit Google an.",points:["Die lokale App muss laufen, bevor Clients verbinden.","Nach dem Login werden Manager-Adresse und privater Token kurzzeitig in Supabase aktualisiert."]},{title:"2. Client verbinden",body:"Führe auf dem überwachten PC den npm-Befehl aus und melde dich mit demselben Google-Konto an.",points:["Ohne Nummer wird der erste freie Slot genutzt.","Mit Nummer wird der PC auf diesen Slot gesetzt. Beispiel: npx @livedesk/client 3"]},{title:"3. Bildschirme und Tools",body:"Verbundene PCs erscheinen auf der Wall und werden Ziele für Live, Control, Files, Reboot und weitere Tools.",points:["Small, Medium und Large ändern die Dichte.","Die LTD-Lizenz schaltet Live-Monitoring und Steuerung frei."]},{title:"4. Mehrere Standorte",body:"Ohne P2P oder Cloud-Relay müssen externe Clients den Manager-PC direkt erreichen können.",points:["VPN, Tailscale, ZeroTier oder privater Tunnel ist am sichersten.","Portweiterleitung geht, sollte aber auf vertrauenswürdige IPs begrenzt sein."]}],firewall:{title:"Manager-Firewall für externe Standorte",body:"Für Bildschirme in anderen Gebäuden, Büros oder Ländern muss jeder Client den RemoteHub-TCP-Port des Managers erreichen.",points:["Standardport: TCP 5197.","Erlaube eingehend TCP 5197 in der Firewall des Manager-PCs.","Leite TCP 5197 am Router zum Manager-PC weiter.","Nutze bevorzugt VPN oder IP-Allowlist statt öffentlicher Freigabe.","Verwende einen starken pair token und öffne nur temporär."]},commands:{title:"Häufige Befehle",body:"Remote-PCs nutzen denselben Google-Login. Bereite nur die Manager-Firewall und die Netzwerkerreichbarkeit vor.",primary:"Automatische Verbindung",slot:"In Slot 3 platzieren",manual:"Manuelle LAN- oder Remote-Verbindung"}},"pt-BR":{languageName:"Português",languageLabel:"Idioma do manual",eyebrow:"LiveDesk Manual",title:"Inicie uma parede de telas local",intro:"LiveDesk é um painel local para monitorar várias estações a partir de um PC gerente e executar ações focadas quando necessário.",sections:[{title:"1. Inicie o gerente primeiro",body:"Abra o dashboard LiveDesk no computador que verá as telas e entre com Google.",points:["O app local precisa estar rodando antes dos clientes.","Após login, endereço do gerente e token privado são atualizados no Supabase por curto tempo."]},{title:"2. Conecte um cliente",body:"No computador monitorado, rode o comando npm e entre com a mesma conta Google.",points:["Sem número, ele usa o primeiro slot livre.","Com número, fica fixo no slot. Exemplo: npx @livedesk/client 3"]},{title:"3. Organize telas e ferramentas",body:"Computadores conectados aparecem na parede e viram alvos de Live, Control, Files, Reboot e mais.",points:["Use Small, Medium ou Large para mudar a densidade.","A licença LTD libera monitoramento ao vivo e controle."]},{title:"4. Monitore vários locais",body:"Sem P2P ou relay em nuvem, clientes externos precisam alcançar diretamente o PC gerente.",points:["VPN, Tailscale, ZeroTier ou túnel privado é o caminho mais seguro.","Port forwarding funciona, mas limite a IPs confiáveis."]}],firewall:{title:"Firewall do gerente para locais externos",body:"Para ver telas de outro prédio, escritório ou país, cada cliente precisa acessar a porta TCP RemoteHub do gerente.",points:["Porta padrão: TCP 5197.","Permita entrada TCP 5197 no firewall do PC gerente.","Encaminhe TCP 5197 do roteador para o PC gerente.","Prefira VPN ou allowlist de IP em vez de abrir para toda a internet.","Use pair token forte e exposição temporária."]},commands:{title:"Comandos comuns",body:"PCs em outros locais usam o mesmo login Google. Prepare apenas o firewall do gerente e o alcance de rede.",primary:"Conexão automática",slot:"Colocar no slot 3",manual:"Conexão manual LAN ou remota"}},it:{languageName:"Italiano",languageLabel:"Lingua del manuale",eyebrow:"LiveDesk Manual",title:"Avvia una parete di schermi locale",intro:"LiveDesk è un deck locale per monitorare molte workstation da un PC manager ed eseguire azioni mirate.",sections:[{title:"1. Avvia prima il manager",body:"Apri la dashboard LiveDesk sul computer che guarda gli schermi e accedi con Google.",points:["L’app locale deve essere attiva prima dei client.","Dopo il login, indirizzo e token privato del manager vengono aggiornati in Supabase per poco tempo."]},{title:"2. Collega un client",body:"Sul computer monitorato, esegui il comando npm e accedi con lo stesso account Google.",points:["Senza numero usa il primo slot libero.","Con un numero resta fissato a quello slot. Esempio: npx @livedesk/client 3"]},{title:"3. Schermi e strumenti",body:"I computer collegati appaiono nel wall e diventano target per Live, Control, Files, Reboot e altri strumenti.",points:["Small, Medium e Large cambiano la densità.","La licenza LTD sblocca monitoraggio live e controllo."]},{title:"4. Più sedi",body:"Senza P2P o relay cloud, i client esterni devono raggiungere direttamente il PC manager.",points:["VPN, Tailscale, ZeroTier o tunnel privato è preferibile.","Il port forwarding è possibile, ma solo verso IP affidabili."]}],firewall:{title:"Firewall del manager per sedi esterne",body:"Per monitorare schermi in un altro edificio, ufficio o paese, ogni client deve raggiungere la porta TCP RemoteHub del manager.",points:["Porta predefinita: TCP 5197.","Consenti TCP 5197 in ingresso sul firewall del PC manager.","Inoltra TCP 5197 dal router al PC manager.","Preferisci VPN o allowlist IP invece dell’esposizione pubblica.","Usa un pair token forte e apri solo quando serve."]},commands:{title:"Comandi comuni",body:"Anche i PC esterni usano lo stesso login Google. Prepara solo il firewall del manager e la raggiungibilità di rete.",primary:"Connessione automatica",slot:"Posiziona nello slot 3",manual:"Connessione LAN o remota manuale"}},id:{languageName:"Bahasa Indonesia",languageLabel:"Bahasa dokumen",eyebrow:"LiveDesk Manual",title:"Mulai dinding layar lokal",intro:"LiveDesk adalah dek kerja lokal untuk memantau banyak workstation dari satu PC manager dan menjalankan aksi terfokus.",sections:[{title:"1. Jalankan manager dulu",body:"Buka dashboard LiveDesk di komputer yang akan melihat layar, lalu masuk dengan Google.",points:["Aplikasi lokal harus berjalan sebelum client tersambung.","Setelah login, alamat manager dan token pribadi diperbarui sementara di Supabase."]},{title:"2. Sambungkan client",body:"Di komputer yang dipantau, jalankan perintah npm dan masuk dengan akun Google yang sama.",points:["Tanpa nomor, client masuk ke slot kosong pertama.","Dengan nomor, client tetap pada slot itu. Contoh: npx @livedesk/client 3"]},{title:"3. Atur layar dan fitur",body:"Komputer tersambung muncul di screen wall dan menjadi target Live, Control, Files, Reboot, dan fitur lain.",points:["Small, Medium, Large mengubah kepadatan tampilan.","Lisensi LTD membuka live monitoring dan control."]},{title:"4. Pantau banyak lokasi",body:"Tanpa P2P atau cloud relay, client di luar lokasi harus bisa mencapai PC manager secara langsung.",points:["VPN, Tailscale, ZeroTier, atau private tunnel paling aman.","Port forwarding bisa dipakai, tetapi batasi ke IP tepercaya."]}],firewall:{title:"Firewall manager untuk lokasi luar",body:"Untuk memantau layar dari gedung, kantor, atau negara lain, setiap client harus mencapai port TCP RemoteHub manager.",points:["Port bawaan: TCP 5197.","Izinkan inbound TCP 5197 pada firewall PC manager.","Forward TCP 5197 dari router ke PC manager.","Utamakan VPN atau allowlist IP daripada membuka ke seluruh internet.","Gunakan pair token kuat dan buka sementara saja."]},commands:{title:"Perintah umum",body:"PC di lokasi luar memakai alur login Google yang sama. Siapkan firewall manager dan jangkauan jaringan saja.",primary:"Koneksi otomatis",slot:"Tempatkan di slot 3",manual:"Koneksi LAN atau jaringan luar manual"}},vi:{languageName:"Tiếng Việt",languageLabel:"Ngôn ngữ tài liệu",eyebrow:"LiveDesk Manual",title:"Bắt đầu tường màn hình cục bộ",intro:"LiveDesk là bảng điều khiển ưu tiên mạng cục bộ để giám sát nhiều máy từ một PC quản lý và chạy hành động tập trung.",sections:[{title:"1. Chạy manager trước",body:"Mở dashboard LiveDesk trên máy sẽ xem màn hình và đăng nhập Google.",points:["Ứng dụng cục bộ phải chạy trước khi client kết nối.","Sau đăng nhập, địa chỉ manager và token riêng được làm mới ngắn hạn trong Supabase."]},{title:"2. Kết nối client",body:"Trên máy được giám sát, chạy lệnh npm và đăng nhập cùng tài khoản Google.",points:["Không có số thì vào slot trống đầu tiên.","Có số thì ghim vào slot đó. Ví dụ: npx @livedesk/client 3"]},{title:"3. Bố trí màn hình và công cụ",body:"Máy đã kết nối xuất hiện trên screen wall và là mục tiêu cho Live, Control, Files, Reboot và các công cụ khác.",points:["Small, Medium, Large thay đổi mật độ hiển thị.","Giấy phép LTD mở khóa giám sát live và điều khiển."]},{title:"4. Giám sát nhiều địa điểm",body:"Không có P2P hay cloud relay, client ở ngoài địa điểm phải truy cập trực tiếp được PC manager.",points:["VPN, Tailscale, ZeroTier hoặc tunnel riêng là an toàn nhất.","Port forwarding có thể dùng nhưng nên giới hạn IP tin cậy."]}],firewall:{title:"Firewall manager cho địa điểm ngoài",body:"Để xem màn hình ở tòa nhà, văn phòng hoặc quốc gia khác, mỗi client phải truy cập được cổng TCP RemoteHub của manager.",points:["Cổng mặc định: TCP 5197.","Cho phép inbound TCP 5197 trên firewall PC manager.","Forward TCP 5197 từ router tới PC manager.","Ưu tiên VPN hoặc allowlist IP thay vì mở toàn internet.","Dùng pair token mạnh và chỉ mở tạm thời."]},commands:{title:"Lệnh thường dùng",body:"PC ở địa điểm ngoài dùng cùng luồng đăng nhập Google. Chỉ cần chuẩn bị firewall manager và khả năng truy cập mạng.",primary:"Kết nối tự động",slot:"Đặt vào slot 3",manual:"Kết nối LAN hoặc mạng ngoài thủ công"}},th:{languageName:"ไทย",languageLabel:"ภาษาคู่มือ",eyebrow:"LiveDesk Manual",title:"เริ่มผนังหน้าจอแบบโลคัล",intro:"LiveDesk คือแผงควบคุมแบบโลคัลสำหรับดูหลายเครื่องจาก PC ผู้จัดการหนึ่งเครื่อง และสั่งงานเฉพาะจุดเมื่อจำเป็น",sections:[{title:"1. เปิด manager ก่อน",body:"เปิดแดชบอร์ด LiveDesk บนเครื่องที่จะดูหน้าจอ แล้วเข้าสู่ระบบด้วย Google",points:["แอปโลคัลต้องทำงานก่อน client จะเชื่อมต่อ","หลังเข้าสู่ระบบ ที่อยู่ manager และ token ส่วนตัวจะถูกอัปเดตใน Supabase ชั่วคราว"]},{title:"2. เชื่อมต่อ client",body:"บนเครื่องที่ต้องการมอนิเตอร์ ให้รันคำสั่ง npm และเข้าสู่ระบบด้วย Google บัญชีเดียวกัน",points:["ไม่ใส่หมายเลขจะใช้ช่องว่างแรก","ใส่หมายเลขเพื่อยึดตำแหน่ง เช่น npx @livedesk/client 3"]},{title:"3. จัดหน้าจอและใช้เครื่องมือ",body:"เครื่องที่เชื่อมต่อจะปรากฏบน screen wall และเป็นเป้าหมายของ Live, Control, Files, Reboot และเครื่องมืออื่น",points:["Small, Medium, Large เปลี่ยนความหนาแน่นของหน้าจอ","ใบอนุญาต LTD ปลดล็อก live monitoring และ control"]},{title:"4. มอนิเตอร์หลายสถานที่",body:"ไม่มี P2P หรือ cloud relay ดังนั้น client นอกสถานที่ต้องเข้าถึง PC manager ได้โดยตรง",points:["VPN, Tailscale, ZeroTier หรือ private tunnel ปลอดภัยที่สุด","port forwarding ใช้ได้ แต่ควรจำกัด IP ที่เชื่อถือได้"]}],firewall:{title:"ไฟร์วอลล์ manager สำหรับสถานที่ภายนอก",body:"หากต้องการดูหน้าจอจากอาคาร สำนักงาน หรือประเทศอื่น client ต้องเข้าถึงพอร์ต TCP RemoteHub ของ manager",points:["พอร์ตเริ่มต้นคือ TCP 5197","อนุญาต inbound TCP 5197 ในไฟร์วอลล์ของ PC manager","forward TCP 5197 จาก router ไปยัง PC manager","ควรใช้ VPN หรือรายการ IP ที่อนุญาต แทนการเปิดทั้งอินเทอร์เน็ต","ใช้ pair token ที่แข็งแรงและเปิดเฉพาะเวลาจำเป็น"]},commands:{title:"คำสั่งที่ใช้บ่อย",body:"PC ในสถานที่ภายนอกใช้ขั้นตอน Google login เดียวกัน เพียงเตรียม firewall ของ manager และการเข้าถึงเครือข่าย",primary:"เชื่อมต่ออัตโนมัติ",slot:"วางใน slot 3",manual:"เชื่อมต่อ LAN หรือเครือข่ายภายนอกแบบ manual"}},hi:{languageName:"हिन्दी",languageLabel:"दस्तावेज़ भाषा",eyebrow:"LiveDesk Manual",title:"स्थानीय स्क्रीन वॉल शुरू करें",intro:"LiveDesk एक local-first remote deck है जिससे एक manager PC से कई workstation देखे जा सकते हैं और जरूरी actions चलाए जा सकते हैं।",sections:[{title:"1. पहले manager चलाएं",body:"जिस कंप्यूटर से स्क्रीन देखनी है, उस पर LiveDesk dashboard खोलें और Google से sign in करें।",points:["Client जुड़ने से पहले local app चल रही होनी चाहिए।","Sign in के बाद manager address और private token थोड़े समय के लिए Supabase में refresh होते हैं।"]},{title:"2. Client जोड़ें",body:"जिस कंप्यूटर को monitor करना है, उस पर npm command चलाएं और उसी Google account से sign in करें।",points:["बिना नंबर के पहला खाली slot चुना जाएगा।","नंबर देने पर वही slot fix होगा। उदाहरण: npx @livedesk/client 3"]},{title:"3. Screens और tools",body:"Connected computers screen wall में दिखते हैं और Live, Control, Files, Reboot जैसे tools के target बनते हैं।",points:["Small, Medium, Large से density बदलें।","LTD license live monitoring और control खोलता है।"]},{title:"4. कई locations monitor करें",body:"P2P या cloud relay नहीं है, इसलिए remote-site clients को manager PC तक direct पहुंचना होगा।",points:["VPN, Tailscale, ZeroTier या private tunnel सबसे सुरक्षित है।","Port forwarding हो सकता है, लेकिन trusted IP तक सीमित रखें।"]}],firewall:{title:"Remote locations के लिए manager firewall",body:"दूसरे building, office या country की screens देखने के लिए हर client को manager RemoteHub TCP port तक पहुंचना होगा।",points:["Default port: TCP 5197.","Manager PC firewall में inbound TCP 5197 allow करें।","Router से TCP 5197 manager PC पर forward करें।","पूरे internet पर खोलने से बेहतर VPN या IP allowlist है।","मजबूत pair token इस्तेमाल करें और exposure temporary रखें।"]},commands:{title:"Common commands",body:"Remote-site PCs use the same Google sign-in flow. Prepare the manager firewall and network reachability, then run the simple command.",primary:"Automatic connection",slot:"Slot 3 में रखें",manual:"Manual LAN या remote-network connection"}},ar:{languageName:"العربية",languageLabel:"لغة الدليل",eyebrow:"LiveDesk Manual",title:"ابدأ جدار شاشات محلي",intro:"LiveDesk هو سطح عمل محلي لمراقبة عدة أجهزة من حاسوب مدير واحد وتنفيذ إجراءات مركزة عند الحاجة.",sections:[{title:"1. شغّل المدير أولاً",body:"افتح لوحة LiveDesk على الحاسوب الذي سيراقب الشاشات، ثم سجّل الدخول بحساب Google.",points:["يجب أن يعمل التطبيق المحلي قبل اتصال العملاء.","بعد تسجيل الدخول يتم تحديث عنوان المدير والرمز الخاص في Supabase لمدة قصيرة."]},{title:"2. صِل جهاز عميل",body:"على الحاسوب الذي ستتم مراقبته، شغّل أمر npm وسجّل الدخول بنفس حساب Google.",points:["بدون رقم يتم استخدام أول خانة فارغة.","مع رقم يتم تثبيت الجهاز في تلك الخانة. مثال: npx @livedesk/client 3"]},{title:"3. رتّب الشاشات والأدوات",body:"الأجهزة المتصلة تظهر في جدار الشاشات وتصبح أهدافاً لأدوات Live و Control و Files و Reboot.",points:["استخدم Small أو Medium أو Large لتغيير الكثافة.","ترخيص LTD يفتح المراقبة الحية والتحكم."]},{title:"4. راقب عدة مواقع",body:"لا يوجد P2P أو relay سحابي، لذلك يجب أن تصل أجهزة المواقع الخارجية مباشرة إلى حاسوب المدير.",points:["VPN أو Tailscale أو ZeroTier أو نفق خاص هو الخيار الآمن.","يمكن استخدام port forwarding لكن يجب حصره بعناوين IP موثوقة."]}],firewall:{title:"جدار حماية المدير للمواقع الخارجية",body:"لمراقبة شاشات من مبنى أو مكتب أو دولة أخرى، يجب أن يصل كل عميل إلى منفذ RemoteHub TCP في المدير.",points:["المنفذ الافتراضي: TCP 5197.","اسمح بالوارد TCP 5197 في جدار حماية حاسوب المدير.","حوّل TCP 5197 من الراوتر إلى حاسوب المدير.","فضّل VPN أو قائمة IP مسموحة بدلاً من فتحه للإنترنت كله.","استخدم pair token قوياً واجعل التعرض مؤقتاً."]},commands:{title:"أوامر شائعة",body:"الأجهزة في المواقع الخارجية تستخدم نفس تسجيل الدخول عبر Google. جهّز جدار حماية المدير وإمكانية الوصول الشبكي فقط.",primary:"اتصال تلقائي",slot:"وضعه في الخانة 3",manual:"اتصال LAN أو شبكة خارجية يدوي"}},tr:{languageName:"Türkçe",languageLabel:"Belge dili",eyebrow:"LiveDesk Manual",title:"Yerel ekran duvarını başlat",intro:"LiveDesk, tek bir yönetici PC’den birçok iş istasyonunu izlemek ve gerektiğinde odaklı eylemler çalıştırmak için yerel öncelikli bir çalışma panelidir.",sections:[{title:"1. Önce manager başlatın",body:"Ekranları izleyecek bilgisayarda LiveDesk panelini açın ve Google ile oturum açın.",points:["Client bağlanmadan önce yerel uygulama çalışmalıdır.","Oturum sonrası manager adresi ve özel token Supabase içinde kısa süreli yenilenir."]},{title:"2. Client bağlayın",body:"İzlenecek bilgisayarda npm komutunu çalıştırın ve aynı Google hesabıyla giriş yapın.",points:["Numarasız çalıştırırsanız ilk boş slota yerleşir.","Numara verirseniz o slota sabitlenir. Örnek: npx @livedesk/client 3"]},{title:"3. Ekranlar ve araçlar",body:"Bağlı bilgisayarlar screen wall üzerinde görünür ve Live, Control, Files, Reboot gibi araçların hedefi olur.",points:["Small, Medium, Large yoğunluğu değiştirir.","LTD lisansı live monitoring ve control özelliklerini açar."]},{title:"4. Birden çok konum",body:"P2P veya cloud relay olmadığı için uzak konumdaki client doğrudan manager PC’ye ulaşmalıdır.",points:["VPN, Tailscale, ZeroTier veya özel tünel en güvenli yoldur.","Port yönlendirme çalışır ama güvenilir IP’lerle sınırlandırılmalıdır."]}],firewall:{title:"Uzak konumlar için manager firewall",body:"Başka bina, ofis veya ülkedeki ekranları izlemek için her client manager RemoteHub TCP portuna ulaşmalıdır.",points:["Varsayılan port: TCP 5197.","Manager PC firewall içinde inbound TCP 5197 izin verin.","Router’dan TCP 5197’yi manager PC’ye yönlendirin.","Tüm internete açmak yerine VPN veya IP allowlist kullanın.","Güçlü pair token kullanın ve erişimi geçici tutun."]},commands:{title:"Yaygın komutlar",body:"Uzak konumdaki PC’ler aynı Google giriş akışını kullanır. Manager firewall ve ağ erişimini hazırlamanız yeterli.",primary:"Otomatik bağlantı",slot:"Slot 3’e yerleştir",manual:"Manuel LAN veya uzak ağ bağlantısı"}}},vS=Object.entries(hs).map(([i,n])=>({id:i,label:n.languageName}));function bS(){if(typeof navigator>"u")return"en";const i=navigator.languages?.length?navigator.languages:[navigator.language];for(const n of i){const s=n.toLowerCase();if(hs[n])return n;if(s.startsWith("zh-tw")||s.startsWith("zh-hk"))return"zh-TW";if(s.startsWith("pt"))return"pt-BR";const l=s.split("-")[0];if(hs[l])return l}return"en"}function np({index:i,selected:n,onSelect:s}){const l=i+1;return v.jsx("article",{className:`device-tile placeholder-tile ${n?"selected":""}`,children:v.jsxs("button",{className:"tile-screen",onClick:s,"aria-pressed":n,title:`Select slot ${l}`,type:"button",children:[v.jsx("span",{className:"slot-grid","aria-hidden":"true"}),v.jsxs("span",{className:"empty-screen",children:[v.jsx(os,{size:24}),v.jsxs("strong",{children:["Slot ",String(l).padStart(3,"0")]})]})]})})}function ap({device:i,frame:n,selected:s,controlEnabled:l,onSelect:c,onFocusDevice:h,onOpenControl:d,sendInput:m}){const g=G.useRef(null),p=G.useRef(0),_=xp(i);G.useEffect(()=>{const w=g.current;if(!w||!n)return;let R=!1;const D=new Blob([n.payload],{type:n.mimeType});return createImageBitmap(D).then(q=>{if(R){q.close();return}const $=n.width||q.width||960,H=n.height||q.height||540;(w.width!==$||w.height!==H)&&(w.width=$,w.height=H);const P=w.getContext("2d");P&&(P.clearRect(0,0,$,H),P.drawImage(q,0,0,$,H)),q.close()}).catch(()=>{}),()=>{R=!0}},[n]);const b=w=>{const R=w.currentTarget.getBoundingClientRect();return{normalizedX:Math.max(0,Math.min(1,(w.clientX-R.left)/Math.max(1,R.width))),normalizedY:Math.max(0,Math.min(1,(w.clientY-R.top)/Math.max(1,R.height)))}},T=(w,R)=>{if(l){if(R==="pointermove"){const D=performance.now();if(D-p.current<24)return;p.current=D}m(i.deviceId,{type:R,...b(w),button:mS(w.button)})}};return v.jsx("article",{className:`device-tile ${s?"selected":""} ${i.connected?"online":"offline"}`,children:v.jsxs("button",{className:"tile-screen","aria-pressed":s,onClick:()=>{l||c()},onDoubleClick:w=>{w.preventDefault(),d()},type:"button",children:[v.jsx("canvas",{ref:g,className:"remote-canvas",tabIndex:l?0:-1,onPointerDown:w=>{h(),w.currentTarget.focus(),w.currentTarget.setPointerCapture(w.pointerId),T(w,"pointerdown")},onPointerMove:w=>T(w,"pointermove"),onPointerUp:w=>T(w,"pointerup"),onWheel:w=>{l&&(w.preventDefault(),m(i.deviceId,{type:"wheel",deltaX:w.deltaX,deltaY:w.deltaY}))},onKeyDown:w=>{l&&m(i.deviceId,{type:"keydown",key:w.key,code:w.code,text:w.key.length===1?w.key:"",repeat:w.repeat})},onKeyUp:w=>{l&&m(i.deviceId,{type:"keyup",key:w.key,code:w.code,text:w.key.length===1?w.key:"",repeat:!1})},onContextMenu:w=>l&&w.preventDefault()}),!n&&v.jsx("span",{className:"empty-screen",children:v.jsx(os,{size:26})}),v.jsx("span",{className:`tile-health-pill state-${_.state}`,children:_.label}),v.jsx("span",{className:"tile-metrics","aria-label":`${mo(i)} status`,children:_.metrics.slice(0,3).map(w=>v.jsxs("span",{className:`tile-metric state-${w.state}`,children:[v.jsx("b",{children:w.label}),v.jsx("em",{children:w.value}),w.ratio!==void 0&&v.jsx("i",{style:{width:`${Math.round(w.ratio*100)}%`}})]},w.id))})]})})}function _S(){const{session:i,loading:n}=Fw(),{target:s,error:l,refresh:c}=eS(i),h=G.useMemo(()=>{if(!s?.active)return null;const A=s.expires_at?Date.parse(s.expires_at):Number.POSITIVE_INFINITY;return Number.isFinite(A)&&A<=Date.now()?null:s},[s]),d=G.useMemo(()=>Fg(h),[h]),m=G.useMemo(()=>d.length>0?[...new Set([...d,Ct])]:[Ct],[d]),[g,p]=G.useState(dS),_=G.useMemo(()=>m.some(A=>!!Tr(A)),[m]),b=!_||g,{status:T,devices:w,error:R,refresh:D,hubBaseUrl:q}=Ww(m,b),{entitlement:$,licensed:H,loading:P,error:X,refresh:ge}=tS(i),[ne,J]=G.useState([]),[Te,Ee]=G.useState([]),[ln,ot]=G.useState(""),[ze,ut]=G.useState(!1),[dt,Pe]=G.useState(!1),[U,V]=G.useState(""),[te,W]=G.useState(""),[Se,k]=G.useState(""),[L,K]=G.useState("wall"),[Q,ue]=G.useState("large"),[de,ke]=G.useState(bS),[Ke,Ie]=G.useState(!1),[Ma,hi]=G.useState(!1),[sa,Lr]=G.useState(hS),[Jt,on]=G.useState(null),[fs,ms]=G.useState(!1),gs=G.useRef(null),Ba=G.useRef(!1),di=G.useRef(0),Ge=G.useMemo(()=>w.filter(A=>A.connected),[w]),Ro=G.useMemo(()=>Ge.reduce((A,I)=>Math.max(A,mr(I.slotNumber)),0),[Ge]),Xt=Math.max(lS,Ge.length,Ro),Et=G.useMemo(()=>{const A=Array(Xt).fill(null),I=[];for(const ae of Ge){const he=mr(ae.slotNumber);he>0&&he<=Xt&&!A[he-1]?A[he-1]=ae:I.push(ae)}for(const ae of I){const he=A.findIndex(ve=>!ve);he<0?A.push(ae):A[he]=ae}return A},[Ge,Xt]),zr=G.useMemo(()=>Ge.map(A=>A.deviceId),[Ge]),fi=G.useMemo(()=>new Set(ne),[ne]),ra=G.useMemo(()=>new Set(Te),[Te]),un=G.useMemo(()=>Ge.filter(A=>fi.has(A.deviceId)||ra.has(mr(A.slotNumber))),[Ge,fi,ra]),oe=G.useMemo(()=>w.find(A=>A.deviceId===ln)||un[0]||null,[w,ln,un]),Bt=G.useMemo(()=>oe?xp(oe):null,[oe]),Oo=oe?Er(oe,"control"):!1,ps=oe?Er(oe,"audio")||Er(oe,"remoteAudio"):!1,la=Ge.length<=ts,Oe=H||la,kt=`Free plan includes up to ${ts} workstations. Upgrade to LTD for ${Ge.length} workstations.`,gt=Oe&&!!oe,mi=Oe&&!!oe&&Oo,Mr=Oe&&!!oe&&ps,Br=Oe?zr:[],{frames:oa,state:gi}=nS(Br,Br.length>0,q),{state:Ha,sendInput:wn}=aS(mi&&ze,q),{state:$a,error:ua}=rS(oe?.deviceId||"",Mr&&dt,q);G.useEffect(()=>{const A=new URLSearchParams(window.location.search).get("checkout");if(A==="success"){W("Checkout returned. Waiting for Dodo confirmation."),ge();const I=window.setInterval(()=>{ge()},4e3),ae=window.setTimeout(()=>{window.clearInterval(I)},45e3);return()=>{window.clearInterval(I),window.clearTimeout(ae)}}A==="cancelled"&&W("Checkout cancelled.")},[ge]),G.useEffect(()=>{!Oe&&ze&&ut(!1),!Oe&&dt&&Pe(!1)},[dt,ze,Oe]),G.useEffect(()=>{Pe(!1)},[oe?.deviceId]),G.useEffect(()=>{const A=Ge.map(ae=>ae.deviceId),I=new Set(A);J(ae=>{const he=ae.filter(ve=>I.has(ve));return ep(ae,he)?ae:he}),ot(ae=>ae&&I.has(ae)?ae:""),Ee(ae=>{const he=ae.filter(ve=>ve>=1&&ve<=Xt);return ep(ae.map(String),he.map(String))?ae:he})},[Ge,Xt]),G.useEffect(()=>{try{localStorage.setItem(Rp,sa)}catch{}},[sa]);const ys=G.useCallback(async()=>{const A=new Set(m);A.add(Ct);try{const se=await vn("/api/remote/status",void 0,Ct);Fg({endpoint:se.agentEndpoint,endpoint_candidates:[...se.agentEndpointCandidates||[],...se.hostTargetEndpointCandidates||[]]}).forEach(Ne=>A.add(Ne))}catch{}const I=[...A].sort((se,Ne)=>{const Ot=Je=>{const Fe=Tr(Je);return Fe==="local"?0:Fe==="loopback"?1:2};return Ot(se)-Ot(Ne)||se.localeCompare(Ne)});let ae=!1,he="",ve=!1;try{for(const se of I){const Ne=Tr(se);try{if(await vn("/api/health",void 0,se),Ne==="local")return p(!0),ns(!0),se;Ne==="loopback"&&(ae=!0,he=se)}catch{Ne==="local"&&(ve=!0)}}return ae?(ve&&W("Local hub is reachable on this PC, but not through the LAN address yet. Restart LiveDesk manager to bind 5179 on the network."),p(!0),ns(!0),he||Ct):(p(!1),ns(!1),"")}catch{return p(!1),ns(!1),""}},[m]),vs=async()=>{V("auth"),await ys();const{error:A}=await jn.auth.signInWithOAuth({provider:"google",options:{redirectTo:window.location.origin}});A&&(W(A.message),V(""))},bs=async()=>{V("auth"),await jn.auth.signOut(),V("")},Sn=G.useCallback(async(A={})=>{const I=A.silent===!0,ae=A.takeover===!0,he=A.requestLocalAccess===!0,ve=he?await ys():"";if(!i?.user){I||W("Sign in before publishing this host.");return}if(!Ba.current){Ba.current=!0,I||V("host");try{const se=ve||q||Ct,Ne=T||await vn("/api/remote/status",void 0,se);if(!Ne.started)throw new Error("Start LiveDesk on this computer before syncing the server.");const Ot=`livedesk-${i.user.id}`,Je=await vn("/api/remote/host-target",{method:"POST",body:JSON.stringify({nodeId:Ot,leaseMs:6e4,takeover:ae})},se);if(!Je.ok)throw new Error(Je.error||"host-target-failed");const Fe=await vn("/api/remote/status",void 0,se),Gr=Je.hostTarget||{},Vr=Fe.hostTargetEndpointCandidates||Fe.agentEndpointCandidates||Ne.agentEndpointCandidates||[Fe.agentEndpoint||Ne.agentEndpoint].filter(Boolean),{data:En,error:Kr}=await jn.rpc("set_livedesk_remote_host_target",{p_node_id:Ot,p_lease_id:String(Gr.leaseId||Fe.hostTargetLeaseId||crypto.randomUUID()),p_host_instance_id:Fe.hostInstanceId||Ot,p_endpoint:Fe.hostTargetEndpoint||Fe.agentEndpoint||Ne.agentEndpoint,p_pair_token:Fe.pairToken||"",p_manager_package:"@livedesk/hub",p_manager_version:Fe.managerVersion||"0.1.0",p_agent_package:"@livedesk/client",p_activated_at:new Date().toISOString(),p_expires_at:new Date(Date.now()+6e4).toISOString(),p_takeover:ae,p_endpoint_candidates:Vr});if(Kr)throw Kr;const bi=Array.isArray(En)?En[0]:En;if(bi&&bi.ok===!1)throw new Error(bi.reason||"registry-rejected");I||(W("Host published."),(he||_)&&(p(!0),ns(!0)),D()),c()}catch(se){if(!I){const Ne=se instanceof Error?se.message:String(se);Ne.includes("local network access")&&(p(!1),ns(!1)),W(Ne)}}finally{Ba.current=!1,I||V("")}}},[q,_,D,c,ys,i,T]);G.useEffect(()=>{if(!i?.user||!T?.started||R)return;const A=s?.expires_at?Date.parse(s.expires_at):Number.POSITIVE_INFINITY,I=s?.active===!0&&(!s.expires_at||!Number.isFinite(A)||A>Date.now()),ae=!!s?.host_instance_id&&!!T.hostInstanceId&&s.host_instance_id===T.hostInstanceId;if(I&&!ae)return;let he=!1;const ve=()=>{if(he)return;const Ne=Date.now();Ne-di.current<25e3||(di.current=Ne,Sn({silent:!0}))};ve();const se=window.setInterval(ve,3e4);return()=>{he=!0,window.clearInterval(se)}},[R,Sn,i?.user?.id,T?.agentEndpoint,T?.hostInstanceId,T?.started,s?.active,s?.expires_at,s?.host_instance_id]);const pi=G.useCallback(A=>{A&&(ot(A),J(I=>I.includes(A)?I:[...I,A]))},[]),_s=G.useCallback(A=>{if(!A)return;const I=Ge.find(ve=>ve.deviceId===A),ae=mr(I?.slotNumber),he=ne.includes(A)||ae>0&&Te.includes(ae);ot(he?"":A),ae>0&&Ee(ve=>ve.filter(se=>se!==ae)),J(ve=>he?ve.filter(se=>se!==A):[...ve,A])},[Ge,ne,Te]),ws=G.useCallback(A=>{!Number.isInteger(A)||A<1||A>Xt||(ot(""),Ee(I=>I.includes(A)?I.filter(ae=>ae!==A):[...I,A].sort((ae,he)=>ae-he)))},[Xt]),ca=G.useCallback(()=>{J([]),Ee([]),ot(""),ut(!1),Pe(!1)},[]),yi=G.useCallback(()=>{J([]),ot(""),ut(!1),Pe(!1),Ee(Array.from({length:Xt},(A,I)=>I+1))},[Xt]);G.useEffect(()=>{const A=I=>{const ae=I.target,he=ae?.tagName?.toLowerCase();ae?.isContentEditable||he==="input"||he==="textarea"||he==="select"||((I.ctrlKey||I.metaKey)&&I.key.toLowerCase()==="a"&&(I.preventDefault(),yi()),I.key==="Escape"&&ca())};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[ca,yi]);const Dn=async A=>{if(!Oe){W(kt);return}pi(A);try{await vn(`/api/remote/devices/${encodeURIComponent(A)}/live/start`,{method:"POST",body:JSON.stringify({fps:20,maxWidth:1280,maxHeight:720,quality:70,mode:"remote-fast"})},q),W("Live stream requested."),D()}catch(I){W(I instanceof Error?I.message:String(I))}},Ss=async A=>{if(pi(A),K("control"),!Oe){ut(!1),W(kt);return}ut(!0),await Dn(A)},Hr=async()=>{if(!oe){W("Select a workstation before playing audio.");return}if(!Oe){W(kt);return}if(!ps){W("Selected workstation does not report remote audio support yet.");return}const A=!dt;Pe(A);try{await vn(`/api/remote/devices/${encodeURIComponent(oe.deviceId)}/audio/${A?"start":"stop"}`,{method:"POST",body:JSON.stringify({mimeType:"audio/webm;codecs=opus",sampleRate:48e3,channels:2})},q),W(A?"Remote audio requested.":"Remote audio stopped.")}catch(I){Pe(!1),W(I instanceof Error?I.message:String(I))}},cn=async A=>{const I=Array.from(A).filter(se=>se.size>=0);if(I.length===0)return;if(!Oe){W(kt);return}const ae=un.length>0?un.map(se=>se.deviceId):oe?[oe.deviceId]:[];if(ae.length===0){W("Select at least one workstation before dropping files.");return}const he=I.reduce((se,Ne)=>se+Ne.size,0),ve=crypto.randomUUID();if(he>uS){on({id:ve,status:"failed",progress:100,message:`Transfer is too large (${ci(he)}).`});return}on({id:ve,status:"reading",progress:2,message:`Preparing ${I.length} file${I.length===1?"":"s"}`});try{let se=0;const Ne=[];for(const Je of I){const Fe=await Je.arrayBuffer();se+=Je.size,on({id:ve,status:"reading",progress:Math.max(4,Math.round(se/Math.max(1,he)*58)),message:`Preparing ${ci(se)} / ${ci(he)}`}),Ne.push({name:Je.name,relativePath:Je.webkitRelativePath||Je.name,size:Je.size,type:Je.type,lastModified:Je.lastModified,dataBase64:fS(Fe)})}on({id:ve,status:"sending",progress:72,message:`Sending to ${ae.length} workstation${ae.length===1?"":"s"}`});const Ot=await vn("/api/remote/files/transfer",{method:"POST",body:JSON.stringify({transferId:ve,deviceIds:ae,remoteDirectory:sa.trim(),files:Ne})},q);if(!Ot.ok)throw new Error(Ot.error||"file-transfer-not-queued");on({id:ve,status:"queued",progress:100,message:`Queued ${I.length} file${I.length===1?"":"s"} to ${Ot.queued}/${Ot.total}`}),window.setTimeout(()=>{on(Je=>Je?.id===ve&&Je.status==="queued"?null:Je)},4500)}catch(se){on({id:ve,status:"failed",progress:100,message:se instanceof Error?se.message:String(se)})}},ct=A=>{A.preventDefault(),A.stopPropagation(),ms(!1),cn(A.dataTransfer.files)},_t=async()=>{const A=Se.trim();if(A){if(!Oe){W(kt);return}V("task");try{await vn("/api/remote/tasks",{method:"POST",body:JSON.stringify({instruction:A,allConnected:!0,approvalLevel:"task-only"})},q),k(""),W("Task queued."),D()}catch(I){W(I instanceof Error?I.message:String(I))}finally{V("")}}},Un=async()=>{if(!i){W("Sign in with Google before checkout.");return}if(H){W("LiveDesk license is already active.");return}V("checkout");try{const{data:A,error:I}=await jn.functions.invoke("dodo-checkout",{body:{plan:"ltd"}});if(I)throw I;if(!A?.checkout_url)throw new Error("Checkout function did not return a checkout URL.");window.location.assign(A.checkout_url)}catch(A){W(A instanceof Error?A.message:String(A)),V("")}},hn=cS(),xo=Ge.length,jo=zr.filter(A=>oa.has(A)).length,Ts=R?"offline":T?.started?"online":"starting",ha=L==="settings",vi=L==="pricing",Ln=L==="doc",zn=!vi&&!Ln,qa=L==="control",dn=un.length+Te.filter(A=>!Ge.some(I=>mr(I.slotNumber)===A)).length,nt=Te.length===1?`Slot ${String(Te[0]).padStart(3,"0")}`:`${Te.length} slots selected`,$r=dn===0?"No workstation":dn>1?`${dn} selected`:oe?mo(oe):nt,wt=hs[de]||hs.en,Qt=wt.sync||hs.en.sync,Tn=n||P?"checking":H?`${($?.plan||"ltd").toUpperCase()} active`:la?`Free ${Ge.length}/${ts}`:`Upgrade ${Ge.length}/${ts}`,No=H?"Licensed":U==="checkout"?"Opening":"$30 LTD",qr=H?"License active":i?H?"Licensed":U==="checkout"?"Opening checkout":"Buy with Dodo":U==="auth"?"Opening Google":"Sign in to buy",Uo=H||U==="checkout"||U==="auth"||n||P,Pa=i?.user.user_metadata,Ga=tp(Pa,"avatar_url","picture"),Ht=tp(Pa,"full_name","name")||i?.user.email||"Google",Rt=Ht.slice(0,1).toUpperCase(),Pr=A=>{if(A==="control"){if(K(A),!Oe){ut(!1),W(kt);return}ut(!0),oe&&Dn(oe.deviceId);return}K(A),ut(!1)};return v.jsxs("main",{className:"app-shell",children:[v.jsxs("aside",{className:"tool-rail","aria-label":"LiveDesk tools",children:[v.jsx("div",{className:"rail-brand",title:"LiveDesk",children:v.jsx(os,{size:22})}),v.jsx("nav",{className:"rail-tools",children:yS.map(A=>{const I=A.icon;return v.jsxs("button",{className:`rail-tool ${L===A.id?"active":""} accent-${A.accent}`,onClick:()=>Pr(A.id),title:A.label,type:"button",children:[v.jsx(I,{size:19}),v.jsx("span",{children:A.label})]},A.id)})}),v.jsxs("div",{className:"rail-footer",children:[v.jsxs("button",{className:"rail-tool compact sync-server",onClick:()=>Sn({takeover:!0,requestLocalAccess:!0}),title:"Sync Server",type:"button",children:[v.jsx(Kc,{size:18}),v.jsx("span",{children:"Sync Server"})]}),v.jsxs("button",{className:`rail-account ${i?"signed-in":""}`,onClick:i?bs:vs,disabled:n||U==="auth",title:i?`Sign out ${i.user.email||Ht}`:"Sign in with Google",type:"button",children:[i?Ga?v.jsx("img",{src:Ga,alt:Ht,referrerPolicy:"no-referrer"}):v.jsx("span",{className:"avatar-fallback",children:Rt}):v.jsx(m0,{size:18}),v.jsx("span",{children:i?"Account":"Google"})]})]})]}),v.jsxs("section",{className:`desk-stage ${zn&&!Ke?"dock-open":""}`,children:[v.jsxs("header",{className:"topbar",children:[v.jsxs("div",{className:"brand",children:[v.jsx("span",{className:"brand-mark",children:v.jsx(gg,{size:18})}),v.jsxs("div",{children:[v.jsx("h1",{children:"LiveDesk"}),v.jsx("p",{children:"Control wall for local machines"})]})]}),zn&&v.jsx("div",{className:"top-actions",children:v.jsx("div",{className:"segmented-control","aria-label":"Screen size",children:pS.map(A=>v.jsx("button",{className:Q===A.id?"active":"",onClick:()=>ue(A.id),type:"button",children:A.label},A.id))})})]}),Ln?v.jsxs("section",{className:"doc-page",lang:de,dir:de==="ar"?"rtl":"ltr",children:[v.jsxs("section",{className:"doc-hero",children:[v.jsxs("div",{className:"doc-hero-copy",children:[v.jsxs("span",{className:"pricing-eyebrow",children:[v.jsx(rh,{size:16}),wt.eyebrow]}),v.jsx("h2",{children:wt.title}),v.jsx("p",{children:wt.intro})]}),v.jsxs("label",{className:"doc-language-picker",children:[v.jsxs("span",{children:[v.jsx(c0,{size:17}),wt.languageLabel]}),v.jsx("select",{value:de,onChange:A=>ke(A.target.value),children:vS.map(A=>v.jsx("option",{value:A.id,children:A.label},A.id))})]})]}),v.jsx("section",{className:"doc-grid",children:wt.sections.map((A,I)=>{const he=[Xc,is,sp,yg][I]||rh;return v.jsxs("article",{className:"doc-card",children:[v.jsx("div",{className:"doc-card-icon",children:v.jsx(he,{size:19})}),v.jsxs("div",{children:[v.jsx("h3",{children:A.title}),v.jsx("p",{children:A.body}),v.jsx("ul",{children:A.points.map(ve=>v.jsx("li",{children:ve},ve))})]})]},A.title)})}),Qt&&v.jsxs("section",{className:"doc-sync",children:[v.jsxs("div",{className:"doc-sync-head",children:[v.jsx(Kc,{size:20}),v.jsxs("div",{children:[v.jsx("h3",{children:Qt.title}),v.jsx("p",{children:Qt.body})]})]}),v.jsx("ul",{children:Qt.points.map(A=>v.jsx("li",{children:A},A))})]}),v.jsxs("section",{className:"doc-firewall",children:[v.jsxs("div",{className:"doc-firewall-head",children:[v.jsx(Qc,{size:20}),v.jsxs("div",{children:[v.jsx("h3",{children:wt.firewall.title}),v.jsx("p",{children:wt.firewall.body})]})]}),v.jsx("ul",{children:wt.firewall.points.map(A=>v.jsx("li",{children:A},A))})]}),v.jsxs("section",{className:"doc-command-panel",children:[v.jsxs("div",{className:"doc-command-head",children:[v.jsx(is,{size:20}),v.jsxs("div",{children:[v.jsx("h3",{children:wt.commands.title}),v.jsx("p",{children:wt.commands.body})]})]}),v.jsxs("div",{className:"doc-command-list",children:[v.jsxs("div",{className:"doc-command-row",children:[v.jsx("span",{children:wt.commands.primary}),v.jsx("code",{children:hn}),v.jsx("button",{className:"icon-button",onClick:()=>co(hn),title:"Copy command",type:"button",children:v.jsx(to,{size:16})})]}),v.jsxs("div",{className:"doc-command-row",children:[v.jsx("span",{children:wt.commands.slot}),v.jsx("code",{children:`${hn} 3`}),v.jsx("button",{className:"icon-button",onClick:()=>co(`${hn} 3`),title:"Copy command",type:"button",children:v.jsx(to,{size:16})})]})]})]})]}):vi?v.jsxs("section",{className:"pricing-page",children:[(X||te)&&v.jsx("section",{className:"notice-band",children:X||te}),v.jsxs("section",{className:"pricing-offer",children:[v.jsx("button",{className:"pricing-close",onClick:()=>K("wall"),title:"Close pricing",type:"button",children:v.jsx(D0,{size:18})}),v.jsxs("div",{className:"pricing-offer-head",children:[v.jsxs("span",{className:"pricing-eyebrow",children:[v.jsx(R0,{size:15}),"Founder launch"]}),v.jsxs("div",{className:"deal-price-line",children:[v.jsx("span",{className:"deal-original",children:"$59"}),v.jsx("span",{className:"deal-arrow",children:"→"}),v.jsx("strong",{children:"$30"}),v.jsxs("span",{className:"deal-badge",children:[v.jsx(Fv,{size:15}),"Lifetime deal"]})]}),v.jsx("p",{children:"Monitor and control your local workstation wall. Free for 4 PCs, then unlock larger local setups with one payment."})]}),v.jsxs("div",{className:"deal-table",role:"table","aria-label":"LiveDesk launch pricing",children:[v.jsxs("div",{className:"deal-row deal-row-head",role:"row",children:[v.jsx("span",{role:"columnheader",children:"Plan"}),v.jsx("span",{role:"columnheader",children:"Launch benefit"}),v.jsx("span",{role:"columnheader",children:"Now"})]}),v.jsxs("div",{className:"deal-row deal-row-highlight",role:"row",children:[v.jsx("strong",{role:"cell",children:"Founder LTD"}),v.jsxs("span",{role:"cell",children:[v.jsx("s",{children:"$59"})," local lifetime unlock"]}),v.jsx("strong",{role:"cell",children:"$30"})]}),v.jsxs("div",{className:"deal-row",role:"row",children:[v.jsx("strong",{role:"cell",children:"Free"}),v.jsx("span",{role:"cell",children:"Live, control, audio, files, tasks"}),v.jsx("strong",{role:"cell",children:"$0"})]}),v.jsxs("div",{className:"deal-row",role:"row",children:[v.jsx("strong",{role:"cell",children:"Workstations"}),v.jsx("span",{role:"cell",children:"4 free, larger walls with LTD"}),v.jsxs("strong",{role:"cell",children:[Ge.length,"/",ts]})]}),v.jsxs("div",{className:"deal-row",role:"row",children:[v.jsx("strong",{role:"cell",children:"Future monthly"}),v.jsx("span",{role:"cell",children:"Cloud relay and team features later"}),v.jsx("strong",{role:"cell",children:"separate"})]})]}),v.jsxs("section",{className:"deal-module",children:[v.jsxs("div",{className:"deal-module-title",children:[v.jsx("strong",{children:"LiveDesk includes"}),v.jsx("span",{children:Tn})]}),v.jsxs("ul",{className:"deal-feature-list",children:[v.jsxs("li",{children:[v.jsx(os,{size:16}),v.jsx("span",{children:"Screen wall slots"}),v.jsx("b",{children:"120+"})]}),v.jsxs("li",{children:[v.jsx(oh,{size:16}),v.jsx("span",{children:"Focused control"}),v.jsx("b",{children:"Local"})]}),v.jsxs("li",{children:[v.jsx(pg,{size:16}),v.jsx("span",{children:"Remote PC audio"}),v.jsx("b",{children:"PCM"})]}),v.jsxs("li",{children:[v.jsx(Ic,{size:16}),v.jsx("span",{children:"File transfer"}),v.jsx("b",{children:"24MB"})]})]})]}),v.jsxs("section",{className:"deal-open-price",children:[v.jsx("span",{children:"Opening special price"}),v.jsx("strong",{children:"$30 LTD"}),v.jsx("small",{children:"Early buyers keep this local lifetime license after monthly plans arrive."})]}),v.jsxs("p",{className:"deal-note",children:[v.jsx(s0,{size:15}),"Free plan stays available for up to ",ts," local workstations."]}),v.jsxs("button",{className:"deal-cta",onClick:i?Un:vs,disabled:Uo,type:"button",children:[v.jsx(lh,{size:18}),qr]}),v.jsx("button",{className:"deal-later",onClick:()=>K("wall"),type:"button",children:"Later"})]})]}):v.jsx(v.Fragment,{children:v.jsxs("section",{className:`monitor-layout ${Ke?"dock-collapsed":""}`,children:[v.jsx("section",{className:`screen-wall-panel ${fs?"drop-active":""}`,onClick:A=>{A.currentTarget===A.target&&ca()},onDragEnter:A=>{A.preventDefault(),ms(!0)},onDragOver:A=>{A.preventDefault(),A.dataTransfer.dropEffect="copy"},onDragLeave:A=>{A.currentTarget===A.target&&ms(!1)},onDrop:ct,children:qa?v.jsxs("section",{className:"control-focus",children:[v.jsxs("div",{className:"control-focus-head",children:[v.jsxs("div",{children:[v.jsx("span",{children:"Focused control"}),v.jsx("strong",{children:oe?mo(oe):"No workstation"})]}),v.jsxs("button",{className:"text-button",onClick:()=>oe&&Dn(oe.deviceId),disabled:!gt,type:"button",children:[v.jsx(Yc,{size:16}),"Start live"]})]}),v.jsx("div",{className:"screen-wall control-wall",onClick:A=>{A.currentTarget===A.target&&ca()},children:oe?v.jsx(ap,{device:oe,frame:oa.get(oe.deviceId),selected:!0,controlEnabled:mi&&ze,onSelect:()=>_s(oe.deviceId),onFocusDevice:()=>pi(oe.deviceId),onOpenControl:()=>Ss(oe.deviceId),sendInput:wn},oe.deviceId):v.jsx(np,{index:0,selected:ra.has(1),onSelect:()=>ws(1)})})]}):v.jsx("div",{className:`screen-wall size-${Q}`,onClick:A=>{A.currentTarget===A.target&&ca()},children:Et.map((A,I)=>{const ae=I+1;return A?v.jsx(ap,{device:A,frame:oa.get(A.deviceId),selected:fi.has(A.deviceId)||ra.has(ae),controlEnabled:mi&&ze&&oe?.deviceId===A.deviceId,onSelect:()=>_s(A.deviceId),onFocusDevice:()=>pi(A.deviceId),onOpenControl:()=>Ss(A.deviceId),sendInput:wn},A.deviceId):v.jsx(np,{index:I,selected:ra.has(ae),onSelect:()=>ws(ae)},`slot-${I}`)})})}),v.jsxs("aside",{className:`right-dock ${ha?"settings-mode":"actions-mode"} ${Ke?"collapsed":""}`,"aria-label":"LiveDesk tools",children:[v.jsx("button",{className:"dock-toggle",onClick:()=>Ie(A=>!A),"aria-label":Ke?"Show control panel":"Hide control panel",title:Ke?"Show control panel":"Hide control panel",type:"button",children:Ke?v.jsx(t0,{size:18}):v.jsx(a0,{size:18})}),!Ke&&(ha?v.jsxs(v.Fragment,{children:[(R||l||X||te)&&v.jsx("section",{className:"notice-band",children:R||l||X||te}),v.jsxs("section",{className:"command-deck",children:[v.jsxs("div",{className:"setup-card",children:[v.jsxs("div",{className:"setup-head",children:[v.jsx("span",{className:"setup-icon",children:v.jsx(os,{size:18})}),v.jsxs("div",{children:[v.jsx("strong",{children:"Add workstation"}),v.jsx("span",{children:"Connect another local PC to this wall."})]})]}),v.jsxs("button",{className:"text-button primary full",onClick:()=>co(hn),type:"button",children:[v.jsx(to,{size:16}),"Copy setup"]}),v.jsxs("button",{className:"setup-disclosure",onClick:()=>hi(A=>!A),type:"button",children:[v.jsx(is,{size:15}),"Advanced setup"]}),Ma&&v.jsxs("div",{className:"setup-code-row",children:[v.jsx("code",{children:hn}),v.jsx("button",{className:"icon-button",onClick:()=>co(hn),title:"Copy setup command",type:"button",children:v.jsx(to,{size:16})})]})]}),v.jsxs("div",{className:"settings-card",children:[v.jsxs("div",{className:"panel-title",children:[v.jsx(Ic,{size:17}),v.jsx("h2",{children:"Files"})]}),v.jsxs("label",{className:"field-row",children:[v.jsx("span",{children:"Remote folder"}),v.jsx("input",{value:sa,onChange:A=>Lr(A.target.value),placeholder:"Desktop/LiveDeskFiles"})]}),v.jsx("p",{className:"muted",children:"Blank uses Desktop/LiveDeskFiles on each workstation."})]}),v.jsxs("div",{className:"deck-actions",children:[v.jsxs("button",{className:"text-button primary",onClick:()=>Sn({takeover:!0,requestLocalAccess:!0}),disabled:!i||U==="host",type:"button",children:[v.jsx(Kc,{size:16}),"Sync access"]}),v.jsxs("button",{className:"text-button buy",onClick:Un,disabled:U==="checkout"||H,type:"button",children:[v.jsx(lh,{size:16}),No]})]})]}),v.jsxs("section",{className:"status-strip",children:[v.jsxs("div",{className:`status-item state-${Ts}`,children:[v.jsx(Xc,{size:18}),v.jsx("span",{children:"Local app"}),v.jsx("strong",{children:Ts})]}),v.jsxs("div",{className:"status-item",children:[v.jsx(yg,{size:18}),v.jsx("span",{children:"Slots"}),v.jsxs("strong",{children:[xo,"/",Xt]})]}),v.jsxs("div",{className:"status-item",children:[v.jsx(gg,{size:18}),v.jsx("span",{children:"Frames"}),v.jsxs("strong",{children:[jo," ",gi]})]}),v.jsxs("div",{className:"status-item",children:[v.jsx(Qc,{size:18}),v.jsx("span",{children:"Plan"}),v.jsx("strong",{children:Tn})]})]})]}):v.jsxs(v.Fragment,{children:[v.jsxs("section",{className:"action-dock",children:[v.jsxs("div",{className:"action-context",children:[v.jsx("span",{children:dn>0?"Selection":"No selection"}),v.jsx("strong",{children:$r})]}),v.jsx("input",{ref:gs,className:"hidden-file-input",type:"file",multiple:!0,onChange:A=>{A.currentTarget.files&&cn(A.currentTarget.files),A.currentTarget.value=""}}),(R||te)&&v.jsx("div",{className:"notice-band compact",children:v.jsx("span",{children:R||te})}),v.jsxs("div",{className:"action-grid",children:[v.jsxs("button",{className:"action-tile primary",onClick:()=>oe&&Dn(oe.deviceId),disabled:!gt,type:"button",children:[v.jsx(Yc,{size:21}),v.jsx("span",{children:"Live"})]}),v.jsxs("button",{className:`action-tile ${ze?"active":""}`,onClick:()=>ut(A=>!A),disabled:!mi,type:"button",children:[v.jsx(oh,{size:21}),v.jsx("span",{children:Ha!=="idle"?Ha:"Control"})]}),v.jsxs("button",{className:`action-tile ${dt?"active":""}`,onClick:Hr,disabled:!Mr,type:"button",title:ps?"Remote PC audio":"Remote audio is not supported by this workstation yet",children:[v.jsx(pg,{size:21}),v.jsx("span",{children:dt&&$a!=="idle"?$a:"Audio"})]}),v.jsxs("button",{className:"action-tile",onClick:()=>gs.current?.click(),disabled:!Oe||un.length===0,type:"button",title:"File transfer",children:[v.jsx(Ic,{size:21}),v.jsx("span",{children:"Files"})]}),v.jsxs("button",{className:"action-tile",disabled:!0,type:"button",title:"Reboot",children:[v.jsx(w0,{size:21}),v.jsx("span",{children:"Reboot"})]}),v.jsxs("button",{className:"action-tile",disabled:!0,type:"button",title:"Power",children:[v.jsx(b0,{size:21}),v.jsx("span",{children:"Power"})]}),v.jsxs("button",{className:"action-tile",disabled:!0,type:"button",title:"Terminal",children:[v.jsx(is,{size:21}),v.jsx("span",{children:"Shell"})]})]})]}),oe&&Bt&&v.jsxs("section",{className:"side-panel selected-panel",children:[v.jsxs("div",{className:"machine-detail-head",children:[v.jsxs("div",{className:"panel-title",children:[v.jsx(os,{size:17}),v.jsx("h2",{children:"Machine detail"})]}),v.jsx("span",{className:`machine-health state-${Bt.state}`,children:Bt.label})]}),v.jsxs("div",{className:"machine-title",children:[v.jsx("strong",{children:mo(oe)}),v.jsx("span",{children:Bt.role})]}),v.jsx("div",{className:"machine-metric-grid",children:Bt.metrics.map(A=>v.jsxs("article",{className:`machine-metric state-${A.state}`,children:[v.jsx("span",{children:A.label}),v.jsx("strong",{children:A.value}),v.jsx("small",{children:A.detail}),A.ratio!==void 0&&v.jsx("i",{children:v.jsx("b",{style:{width:`${Math.round(A.ratio*100)}%`}})})]},A.id))}),v.jsxs("section",{className:"machine-section",children:[v.jsxs("div",{className:"machine-section-title",children:[v.jsx(is,{size:15}),v.jsx("span",{children:"Local services"})]}),v.jsx("div",{className:"tool-probe-list",children:Bt.tools.map(A=>v.jsxs("span",{className:`tool-probe state-${A.status}`,children:[v.jsx("b",{children:A.label}),v.jsx("em",{children:A.detail})]},A.id))})]}),v.jsxs("section",{className:"machine-section",children:[v.jsxs("div",{className:"machine-section-title",children:[v.jsx(Jc,{size:15}),v.jsx("span",{children:"Workload"})]}),v.jsxs("div",{className:"workload-card",children:[v.jsx("strong",{children:Bt.taskLabel}),v.jsx("span",{children:Bt.taskStatus}),Bt.taskSummary&&v.jsx("p",{children:Bt.taskSummary})]})]}),v.jsxs("div",{className:"machine-section",children:[v.jsxs("div",{className:"machine-section-title",children:[v.jsx(Xc,{size:15}),v.jsx("span",{children:"System"})]}),v.jsxs("dl",{className:"facts compact",children:[v.jsx("dt",{children:"Platform"}),v.jsxs("dd",{children:[oe.platform||"-"," ",oe.arch||""]}),v.jsx("dt",{children:"Release"}),v.jsx("dd",{children:Mt(oe.status,"release")||"-"}),v.jsx("dt",{children:"Uptime"}),v.jsx("dd",{children:Op(Ye(oe.status,"uptimeSec"))}),v.jsx("dt",{children:"Last seen"}),v.jsx("dd",{children:Xw(oe.lastSeenAt||oe.connectedAt)}),v.jsx("dt",{children:"Agent"}),v.jsx("dd",{children:oe.agentVersion||"-"}),v.jsx("dt",{children:"Address"}),v.jsx("dd",{children:oe.remoteAddress||"-"})]})]}),ua&&v.jsx("p",{className:"panel-warning",children:ua}),v.jsxs("button",{className:"text-button full",onClick:()=>oe&&Dn(oe.deviceId),disabled:!gt,type:"button",children:[v.jsx(Yc,{size:16}),"Start live"]})]}),v.jsxs("section",{className:"side-panel task-panel",children:[v.jsxs("div",{className:"panel-title",children:[v.jsx(Jc,{size:17}),v.jsx("h2",{children:"Task"})]}),v.jsx("textarea",{value:Se,onChange:A=>k(A.target.value),placeholder:"Prepare a short status report.",rows:4}),v.jsxs("button",{className:"text-button full primary",onClick:_t,disabled:U==="task"||!Se.trim()||!Oe,type:"button",children:[v.jsx(Jc,{size:16}),"Send to connected"]})]}),v.jsxs("section",{className:"side-panel account-panel",children:[v.jsxs("div",{className:"panel-title",children:[v.jsx(Qc,{size:17}),v.jsx("h2",{children:"Account"})]}),v.jsxs("dl",{className:"facts",children:[v.jsx("dt",{children:"User"}),v.jsx("dd",{children:i?.user.email||"Not signed in"}),v.jsx("dt",{children:"Network"}),v.jsx("dd",{children:T?.started?"Local app ready":"Start LiveDesk"}),v.jsx("dt",{children:"Access"}),v.jsx("dd",{children:s?.active?"Published":i?"Not published":"Sign in required"}),v.jsx("dt",{children:"Plan"}),v.jsx("dd",{children:Tn})]})]})]}))]})]})})]}),Jt&&v.jsxs("aside",{className:`transfer-bar state-${Jt.status}`,"aria-live":"polite",children:[v.jsx("div",{className:"transfer-bar-track",children:v.jsx("span",{style:{width:`${Math.max(0,Math.min(100,Jt.progress))}%`}})}),v.jsx("p",{children:Jt.message})]})]})}Vv.createRoot(document.getElementById("root")).render(v.jsx(G.StrictMode,{children:v.jsx(_S,{})}));
|