vendor: 4,543 bytes, lines 1-17
1(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const h of o)if(h.type==="childList")for(const f of h.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function i(o){const h={};return o.integrity&&(h.integrity=o.integrity),o.referrerPolicy&&(h.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?h.credentials="include":o.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function l(o){if(o.ep)return;o.ep=!0;const h=i(o);fetch(o.href,h)}})();function gx(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Hh={exports:{}},Rr={};/** 2 * @license React 3 * react-jsx-runtime.production.js 4 * 5 * Copyright (c) Meta Platforms, Inc. and affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var av;function px(){if(av)return Rr;av=1;var s=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(l,o,h){var f=null;if(h!==void 0&&(f=""+h),o.key!==void 0&&(f=""+o.key),"key"in o){h={};for(var m in o)m!=="key"&&(h[m]=o[m])}else h=o;return o=h.ref,{$$typeof:s,type:l,key:f,ref:o!==void 0?o:null,props:h}}return Rr.Fragment=n,Rr.jsx=i,Rr.jsxs=i,Rr}var sv;function vx(){return sv||(sv=1,Hh.exports=px()),Hh.exports}var d=vx(),qh={exports:{}},ce={};/** 10 * @license React 11 * react.production.js 12 * 13 * Copyright (c) Meta Platforms, Inc. and affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var iv;function yx(){if(iv)return ce;iv=1;var s=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),w=Symbol.for("react.view_transition"),x=Symbol.iterator;function R(O){return O===null||typeof O!="object"?null:(O=x&&O[x]||O["@@iterator"],typeof O=="function"?O:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,T={};function C(O,V,se){this.props=O,this.context=V,this.refs=T,this.updater=se||j}C.prototype.isReactComponent={},C.prototype.setState=function(O,V){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,V,"setState")},C.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function B(){}B.prototype=C.prototype;function Q(O,V,se){this.props=O,this.context=V,this.refs=T,this.updater=se||j}var ee=Q.prototype=new B;ee.constructor=Q,N(ee,C.prototype),ee.isPureReactComponent=!0;var $=Array.isArray;function G(){}var H={H:null,A:null,T:null,S:null},ae=Object.prototype.hasOwnProperty;function ye(O,V,se){var ie=se.ref;return{$$typeof:s,type:O,key:V,ref:ie!==void 0?ie:null,props:se}}function $e(O,V){return ye(O.type,V,O.props)}function Qe(O){return typeof O=="object"&&O!==null&&O.$$typeof===s}function ht(O){var V={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(se){return V[se]})}var xt=/\/+/g;function K(O,V){return typeof O=="object"&&O!==null&&O.key!=null?ht(""+O.key):V.toString(36)}function q(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(G,G):(O.status="pending",O.then(function(V){O.status==="pending"&&(O.status="fulfilled",O.value=V)},function(V){O.status==="pending"&&(O.status="rejected",O.reason=V)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function Z(O,V,se,ie,we){var Se=typeof O;(Se==="undefined"||Se==="boolean")&&(O=null);var je=!1;if(O===null)je=!0;else switch(Se){case"bigint":case"string":case"number":je=!0;break;case"object":switch(O.$$typeof){case s:case n:je=!0;break;case b:return je=O._init,Z(je(O._payload),V,se,ie,we)}}if(je)return we=we(O),je=ie===""?"."+K(O,0):ie,$(we)?(se="",je!=null&&(se=je.replace(xt,"$&/")+"/"),Z(we,V,se,"",function(qn){return qn}
vendor: 7,427 bytes, lines 17-25
17)):we!=null&&(Qe(we)&&(we=$e(we,se+(we.key==null||O&&O.key===we.key?"":(""+we.key).replace(xt,"$&/")+"/")+je)),V.push(we)),1;je=0;var te=ie===""?".":ie+":";if($(O))for(var ue=0;ue<O.length;ue++)ie=O[ue],Se=te+K(ie,ue),je+=Z(ie,V,se,Se,we);else if(ue=R(O),typeof ue=="function")for(O=ue.call(O),ue=0;!(ie=O.next()).done;)ie=ie.value,Se=te+K(ie,ue++),je+=Z(ie,V,se,Se,we);else if(Se==="object"){if(typeof O.then=="function")return Z(q(O),V,se,ie,we);throw V=String(O),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return je}function oe(O,V,se){if(O==null)return O;var ie=[],we=0;return Z(O,ie,"","",function(Se){return V.call(se,Se,we++)}),ie}function Ue(O){if(O._status===-1){var V=O._result,se=V();se.then(function(ie){(O._status===0||O._status===-1)&&(O._status=1,O._result=ie,se.status===void 0&&(se.status="fulfilled",se.value=ie))},function(ie){(O._status===0||O._status===-1)&&(O._status=2,O._result=ie,se.status===void 0&&(se.status="rejected",se.reason=ie))}),O._status===-1&&(O._status=0,O._result=se)}if(O._status===1)return O._result.default;throw O._result}var Re=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)};function on(O){var V=H.T,se={};se.types=V!==null?V.types:null,H.T=se;try{var ie=O(),we=H.S;we!==null&&we(se,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(G,Re)}catch(Se){Re(Se)}finally{V!==null&&se.types!==null&&(V.types=se.types),H.T=V}}function Hn(O){var V=H.T;if(V!==null){var se=V.types;se===null?V.types=[O]:se.indexOf(O)===-1&&se.push(O)}else on(Hn.bind(null,O))}var Ga={map:oe,forEach:function(O,V,se){oe(O,function(){V.apply(this,arguments)},se)},count:function(O){var V=0;return oe(O,function(){V++}),V},toArray:function(O){return oe(O,function(V){return V})||[]},only:function(O){if(!Qe(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return ce.Activity=y,ce.Children=Ga,ce.Component=C,ce.Fragment=i,ce.Profiler=o,ce.PureComponent=Q,ce.StrictMode=l,ce.Suspense=g,ce.ViewTransition=w,ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,ce.__COMPILER_RUNTIME={__proto__:null,c:function(O){return H.H.useMemoCache(O)}},ce.addTransitionType=Hn,ce.cache=function(O){return function(){return O.apply(null,arguments)}},ce.cacheSignal=function(){return null},ce.cloneElement=function(O,V,se){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ie=N({},O.props),we=O.key;if(V!=null)for(Se in V.key!==void 0&&(we=""+V.key),V)!ae.call(V,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&V.ref===void 0||(ie[Se]=V[Se]);var Se=arguments.length-2;if(Se===1)ie.children=se;else if(1<Se){for(var je=Array(Se),te=0;te<Se;te++)je[te]=arguments[te+2];ie.children=je}return ye(O.type,we,ie)},ce.createContext=function(O){return O={$$typeof:f,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:h,_context:O},O},ce.createElement=function(O,V,se){var ie,we={},Se=null;if(V!=null)for(ie in V.key!==void 0&&(Se=""+V.key),V)ae.call(V,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(we[ie]=V[ie]);var je=arguments.length-2;if(je===1)we.children=se;else if(1<je){for(var te=Array(je),ue=0;ue<je;ue++)te[ue]=arguments[ue+2];we.children=te}if(O&&O.defaultProps)for(ie in je=O.defaultProps,je)we[ie]===void 0&&(we[ie]=je[ie]);return ye(O,Se,we)},ce.createRef=function(){return{current:null}},ce.forwardRef=function(O){return{$$typeof:m,render:O}},ce.isValidElement=Qe,ce.lazy=function(O){return{$$typeof:b,_payload:{_status:-1,_result:O},_init:Ue}},ce.memo=function(O,V){return{$$typeof:v,type:O,compare:V===void 0?null:V}},ce.startTransition=on,ce.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},ce.use=function(O){return H.H.use(O)},ce.useActionState=function(O,V,se){return H.H.useActionState(O,V,se)},ce.useCallback=function(O,V){return H.H.useCallback(O,V)},ce.useContext=function(O){return H.H.useContext(O)},ce.useDebugValue=function(){},ce.useDeferredValue=function(O,V){return H.H.useDeferredValue(O,V)},ce.useEffect=function(O,V){return H.H.useEffect(O,V)},ce.useEffectEvent=function(O){return H.H.useEffectEvent(O)},ce.useId=function(){return H.H.useId()},ce.useImperativeHandle=function(O,V,se){return H.H.useImperativeHandle(O,V,se)},ce.useInsertionEffect=function(O,V){return H.H.useInsertionEffect(O,V)},ce.useLayoutEffect=function(O,V){return H.H.useLayoutEffect(O,V)},ce.useMemo=function(O,V){return H.H.useMemo(O,V)},ce.useOptimistic=function(O,V){return H.H.useOptimistic(O,V)},ce.useReducer=function(O,V,se){return H.H.useReducer(O,V,se)},ce.useRef=function(O){return H.H.useRef(O)},ce.useState=function(O){return H.H.useState(O)},ce.useSyncExternalStore=function(O,V,se){return H.H.useSyncExternalStore(O,V,se)},ce.useTransition=function(){return H.H.useTransition()},ce.version="19.3.0",ce}var rv;function pd(){return rv||(rv=1,qh.exports=yx()),qh.exports}var E=pd();const bx=gx(E);var $h={exports:{}},Ar={},Ih={exports:{}},Ph={};/** 18 * @license React 19 * scheduler.production.js 20 * 21 * Copyright (c) Meta Platforms, Inc. and affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */var lv;function _x(){return lv||(lv=1,(function(s){function n(q,Z){var oe=q.length;q.push(Z);e:for(;0<oe;){var Ue=oe-1>>>1,Re=q[Ue];if(0<o(Re,Z))q[Ue]=Z,q[oe]=Re,oe=Ue;else break e}}function i(q){return q.length===0?null:q[0]}function l(q){if(q.length===0)return null;var Z=q[0],oe=q.pop();if(oe!==Z){q[0]=oe;e:for(var Ue=0,Re=q.length,on=Re>>>1;Ue<on;){var Hn=2*(Ue+1)-1,Ga=q[Hn],O=Hn+1,V=q[O];if(0>o(Ga,oe))O<Re&&0>o(V,Ga)?(q[Ue]=V,q[O]=oe,Ue=O):(q[Ue]=Ga,q[Hn]=oe,Ue=Hn);else if(O<Re&&0>o(V,oe))q[Ue]=V,q[O]=oe,Ue=O;else break e}}return Z}function o(q,Z){var oe=q.sortIndex-Z.sortIndex;return oe!==0?oe:q.id-Z.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;s.unstable_now=function(){return h.now()}}else{var f=Date,m=f.now();s.unstable_now=function(){return f.now()-m}}var g=[],v=[],b=1,y=null,w=3,x=!1,R=!1,j=!1,N=!1,T=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function Q(q){for(var Z=i(v);Z!==null;){if(Z.callback===null)l(v);else if(Z.startTime<=q)l(v),Z.sortIndex=Z.expirationTime,n(g,Z);else break;Z=i(v)}}function ee(q){if(j=!1,Q(q),!R)if(i(g)!==null)R=!0,$||($=!0,Qe());else{var Z=i(v);Z!==null&&K(ee,Z.startTime-q)}}var $=!1,G=-1,H=5,ae=-1;function ye(){return N?!0:!(s.unstable_now()-ae<H)}function $e(){if(N=!1,$){var q=s.unstable_now();ae=q;var Z=!0;try{e:{R=!1,j&&(j=!1,C(G),G=-1),x=!0;var oe=w;try{t:{for(Q(q),y=i(g);y!==null&&!(y.expirationTime>q&&ye());){var Ue=y.callback;if(typeof Ue=="function"){y.callback=null,w=y.priorityLevel;var Re=Ue(y.expirationTime<=q);
vendor: 7,694 bytes, lines 25-41
25if(q=s.unstable_now(),typeof Re=="function"){y.callback=Re,Q(q),Z=!0;break t}y===i(g)&&l(g),Q(q)}else l(g);y=i(g)}if(y!==null)Z=!0;else{var on=i(v);on!==null&&K(ee,on.startTime-q),Z=!1}}break e}finally{y=null,w=oe,x=!1}Z=void 0}}finally{Z?Qe():$=!1}}}var Qe;if(typeof B=="function")Qe=function(){B($e)};else if(typeof MessageChannel<"u"){var ht=new MessageChannel,xt=ht.port2;ht.port1.onmessage=$e,Qe=function(){xt.postMessage(null)}}else Qe=function(){T($e,0)};function K(q,Z){G=T(function(){q(s.unstable_now())},Z)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(q){q.callback=null},s.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<q?Math.floor(1e3/q):5},s.unstable_getCurrentPriorityLevel=function(){return w},s.unstable_next=function(q){switch(w){case 1:case 2:case 3:var Z=3;break;default:Z=w}var oe=w;w=Z;try{return q()}finally{w=oe}},s.unstable_requestPaint=function(){N=!0},s.unstable_runWithPriority=function(q,Z){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var oe=w;w=q;try{return Z()}finally{w=oe}},s.unstable_scheduleCallback=function(q,Z,oe){var Ue=s.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?Ue+oe:Ue):oe=Ue,q){case 1:var Re=-1;break;case 2:Re=250;break;case 5:Re=1073741823;break;case 4:Re=1e4;break;default:Re=5e3}return Re=oe+Re,q={id:b++,callback:Z,priorityLevel:q,startTime:oe,expirationTime:Re,sortIndex:-1},oe>Ue?(q.sortIndex=oe,n(v,q),i(g)===null&&q===i(v)&&(j?(C(G),G=-1):j=!0,K(ee,oe-Ue))):(q.sortIndex=Re,n(g,q),R||x||(R=!0,$||($=!0,Qe()))),q},s.unstable_shouldYield=ye,s.unstable_wrapCallback=function(q){var Z=w;return function(){var oe=w;w=Z;try{return q.apply(this,arguments)}finally{w=oe}}}})(Ph)),Ph}var ov;function xx(){return ov||(ov=1,Ih.exports=_x()),Ih.exports}var Gh={exports:{}},bt={};/** 26 * @license React 27 * react-dom.production.js 28 * 29 * Copyright (c) Meta Platforms, Inc. and affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var uv;function wx(){if(uv)return bt;uv=1;var s=pd();function n(b){var y="https://react.dev/errors/"+b;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)y+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+b+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var l={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal"),h=Symbol.for("react.recoverable"),f=Symbol.for("react.optimistic_key");function m(b,y,w){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:x==null?null:x===f?f:""+x,children:b,containerInfo:y,implementation:w}}var g=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(b,y){if(b==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return bt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,bt.browser=function(b){return{$$typeof:h,_reason:b}},bt.createPortal=function(b,y){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(n(299));return m(b,y,null,w)},bt.flushSync=function(b){var y=g.T,w=l.p;try{if(g.T=null,l.p=2,b)return b()}finally{g.T=y,l.p=w,l.d.f()}},bt.preconnect=function(b,y){typeof b=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,l.d.C(b,y))},bt.prefetchDNS=function(b){typeof b=="string"&&l.d.D(b)},bt.preinit=function(b,y){if(typeof b=="string"&&y&&typeof y.as=="string"){var w=y.as,x=v(w,y.crossOrigin),R=typeof y.integrity=="string"?y.integrity:void 0,j=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;w==="style"?l.d.S(b,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:x,integrity:R,fetchPriority:j}):w==="script"&&l.d.X(b,{crossOrigin:x,integrity:R,fetchPriority:j,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},bt.preinitModule=function(b,y){if(typeof b=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var w=v(y.as,y.crossOrigin);l.d.M(b,{crossOrigin:w,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}}else y==null&&l.d.M(b)},bt.preload=function(b,y){if(typeof b=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var w=y.as,x=v(w,y.crossOrigin);l.d.L(b,w,{crossOrigin:x,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},bt.preloadModule=function(b,y){if(typeof b=="string")if(y){var w=v(y.as,y.crossOrigin);l.d.m(b,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:w,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}else l.d.m(b)},bt.requestFormReset=function(b){l.d.r(b)},bt.unstable_batchedUpdates=function(b,y){return b(y)},bt.useFormState=function(b,y,w){return g.H.useFormState(b,y,w)},bt.useFormStatus=function(){return g.H.useHostTransitionStatus()},bt.version="19.3.0",bt}var cv;function Sx(){if(cv)return Gh.exports;cv=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(n){console.error(n)}}return s(),Gh.exports=wx(),Gh.exports}/** 34 * @license React 35 * react-dom-client.production.js 36 * 37 * Copyright (c) Meta Platforms, Inc. and affiliates. 38 * 39 * This source code is licensed under the MIT license found in the 40 * LICENSE file in the root directory of this source tree. 41 */var hv;function Ex(){if(hv)return Ar;hv=1;var s=xx(),n=pd(),i=Sx();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 o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){for(var t=e,a=t;a&&!a.alternate;)t=a,(t.flags&4098)!==0&&(e=t.return),a=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function f(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 v(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 u=a.return;if(u===null)break;var c=u.alternate;if(c===null){if(r=u.return,r!==null){a=r;
vendor: 20,715 bytes, lines 41-48
41continue}break}if(u.child===c.child){for(c=u.child;c;){if(c===a)return g(u),e;if(c===r)return g(u),t;c=c.sibling}throw Error(l(188))}if(a.return!==r.return)a=u,r=c;else{for(var p=!1,_=u.child;_;){if(_===a){p=!0,a=u,r=c;break}if(_===r){p=!0,r=u,a=c;break}_=_.sibling}if(!p){for(_=c.child;_;){if(_===a){p=!0,a=c,r=u;break}if(_===r){p=!0,r=c,a=u;break}_=_.sibling}if(!p)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 b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}function y(e,t,a,r,u,c){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&a(e,r,u,c)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&y(e.child,t,a,r,u,c))return!0;e=e.sibling}return!1}function w(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function x(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function R(e){var t=[null,null],a=w(e);return a===null||j(t,e,a.child,{foundSelf:!1}),t}function j(e,t,a,r){for(;a!==null;){if(a===t)r.foundSelf=!0;else if(a.tag===5||a.tag===27||a.tag===6){if(r.foundSelf)return e[1]=a,!0;e[0]=a}else if((a.tag!==22||a.memoizedState===null)&&j(e,t,a.child,r))return!0;a=a.sibling}return!1}function N(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(l(559))}}var T=null,C=null;function B(e,t,a){return e===a?!0:e===t?(T=e,!0):!1}function Q(e,t,a){return e===a?(C=e,!1):e===t?(C!==null&&(T=e),!0):!1}function ee(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function $(e,t,a){for(var r=0,u=e;u;u=a(u))r++;u=0;for(var c=t;c;c=a(c))u++;for(;0<r-u;)e=a(e),r--;for(;0<u-r;)t=a(t),u--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=a(e),t=a(t)}return null}var G=Object.assign,H=Symbol.for("react.element"),ae=Symbol.for("react.transitional.element"),ye=Symbol.for("react.portal"),$e=Symbol.for("react.fragment"),Qe=Symbol.for("react.strict_mode"),ht=Symbol.for("react.profiler"),xt=Symbol.for("react.consumer"),K=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),oe=Symbol.for("react.suspense_list"),Ue=Symbol.for("react.memo"),Re=Symbol.for("react.lazy"),on=Symbol.for("react.activity"),Hn=Symbol.for("react.legacy_hidden"),Ga=Symbol.for("react.memo_cache_sentinel"),O=Symbol.for("react.view_transition"),V=Symbol.for("react.recoverable"),se=Symbol.iterator;function ie(e){return e===null||typeof e!="object"?null:(e=se&&e[se]||e["@@iterator"],typeof e=="function"?e:null)}var we=Symbol.for("react.client.reference");function Se(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===we?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $e:return"Fragment";case ht:return"Profiler";case Qe:return"StrictMode";case Z:return"Suspense";case oe:return"SuspenseList";case on:return"Activity";case O:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case ye:return"Portal";case K:return e.displayName||"Context";case xt:return(e._context.displayName||"Context")+".Consumer";case q:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ue:return t=e.displayName||null,t!==null?t:Se(e.type)||"Memo";case Re:t=e._payload,e=e._init;try{return Se(e(t))}catch{}}return null}var je=Array.isArray,te=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,qn={pending:!1,data:null,method:null,action:null},su=[],ws=-1;function Sn(e){return{current:e}}function dt(e){0>ws||(e.current=su[ws],su[ws]=null,ws--)}function Me(e,t){ws++,su[ws]=e.current,e.current=t}var En=Sn(null),Di=Sn(null),ha=Sn(null),Qr=Sn(null);function Xr(e,t){switch(Me(ha,t),Me(Di,e),Me(En,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dp(t),e=fp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}dt(En),Me(En,e)}function Ss(){dt(En),dt(Di),dt(ha)}function iu(e){var t=e.memoizedState;t!==null&&(ci._currentValue=t.memoizedState,Me(Qr,e)),t=En.current;var a=fp(t,e.type);t!==a&&(Me(Di,e),Me(En,a))}function Zr(e){Di.current===e&&(dt(En),dt(Di)),Qr.current===e&&(dt(Qr),ci._currentValue=qn)}var ru,kd;function da(e){if(ru===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);ru=t&&t[1]||"",kd=-1<a.stack.indexOf(` 42 at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return` 43`+ru+e+kd}var lu=!1;function ou(e,t){if(!e||lu)return"";lu=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(J){var k=J}Reflect.construct(e,[],P)}else{try{P.call()}catch(J){k=J}P=!1;try{var M=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),P=!0,new e}finally{P&&(M!==void 0?Object.defineProperty(e.prototype,"props",M):delete e.prototype.props)}}}else{try{throw Error()}catch(J){k=J}(P=e())&&typeof P.catch=="function"&&P.catch(function(){})}}catch(J){if(J&&k&&typeof J.stack=="string")return[J.stack,k.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=r.DetermineComponentFrameRoot(),p=c[0],_=c[1];if(p&&_){var S=p.split(` 44`),U=_.split(` 45`);for(u=r=0;r<S.length&&!S[r].includes("DetermineComponentFrameRoot");)r++;for(;u<U.length&&!U[u].includes("DetermineComponentFrameRoot");)u++;if(r===S.length||u===U.length)for(r=S.length-1,u=U.length-1;1<=r&&0<=u&&S[r]!==U[u];)u--;for(;1<=r&&0<=u;r--,u--)if(S[r]!==U[u]){if(r!==1||u!==1)do if(r--,u--,0>u||S[r]!==U[u]){var z=` 46`+S[r].replace(" at new "," at ");return e.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",e.displayName)),z}while(1<=r&&0<=u);break}}}finally{lu=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?da(a):""}function b0(e,t){switch(e.tag){case 26:case 27:case 5:return da(e.type);case 16:return da("Lazy");case 13:return e.child!==t&&t!==null?da("Suspense Fallback"):da("Suspense");case 19:return da("SuspenseList");case 0:case 15:return ou(e.type,!1);case 11:return ou(e.type.render,!1);case 1:return ou(e.type,!0);case 31:return da("Activity");case 30:return da("ViewTransition");default:return""}}function Dd(e){try{var t="",a=null;do t+=b0(e,a),a=e,e=e.return;while(e);return t}catch(r){return` 47Error generating stack: `+r.message+` 48`+r.stack}}var uu=Object.prototype.hasOwnProperty,cu=s.unstable_scheduleCallback,hu=s.unstable_cancelCallback,_0=s.unstable_shouldYield,x0=s.unstable_requestPaint,Mt=s.unstable_now,w0=s.unstable_getCurrentPriorityLevel,Ud=s.unstable_ImmediatePriority,Ld=s.unstable_UserBlockingPriority,Fr=s.unstable_NormalPriority,S0=s.unstable_LowPriority,Md=s.unstable_IdlePriority,E0=s.log,j0=s.unstable_setDisableYieldValue,Ui=null,zt=null;function fa(e){if(typeof E0=="function"&&j0(e),zt&&typeof zt.setStrictMode=="function")try{zt.setStrictMode(Ui,e)}catch{}}var Bt=Math.clz32?Math.clz32:A0,T0=Math.log,R0=Math.LN2;function A0(e){return e>>>=0,e===0?32:31-(T0(e)/R0|0)|0}var Wr=256,el=262144,tl=4194304;function Va(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&-e;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 nl(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var u=0,c=e.suspendedLanes,p=e.pingedLanes;e=e.warmLanes;var _=r&134217727;return _!==0?(r=_&~c,r!==0?u=Va(r):(p&=_,p!==0?u=Va(p):a||(a=_&~e,a!==0&&(u=Va(a))))):(_=r&~c,_!==0?u=Va(_):p!==0?u=Va(p):a||(a=r&~e,a!==0&&(u=Va(a)))),u===0?0:t!==0&&t!==u&&(t&c)===0&&(c=u&-u,a=t&-t,c>=a||c===32&&(a&4194048)!==0)?t:u}function Li(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function zd(e,t){(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var r=31-Bt(a),u=1<<r;t|=e[r],a&=~u}return t}function N0(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 Bd(){var e=tl;return tl<<=1,(tl&62914560)===0&&(tl=4194304),e}function du(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Mi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function O0(e,t,a,r,u,c){var p=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 _=e.entanglements,S=e.expirationTimes,U=e.hiddenUpdates;for(a=p&~a;0<a;){var z=31-Bt(a),P=1<<z;_[z]=0,S[z]=-1;var k=U[z];if(k!==null)for(U[z]=null,z=0;z<k.length;z++){var M=k[z];M!==null&&(M.lane&=-536870913)}a&=~P}r!==0&&Hd(e,r,0),c!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=c&~(p&~t))}function Hd(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Bt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function qd(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-Bt(a),u=1<<r;u&t|e[r]&t&&(e[r]|=t),a&=~u}}function $d(e,t){var a=t&-t;return a=(a&42)!==0?1:fu(a),(a&(e.suspendedLanes|t))!==0?0:a}function fu(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 mu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Id(){var e=ue.p;return e!==0?e:(e=window.event,e===void 0?32:Xp(e.type))}function Pd(e,t){var a=ue.p;try{return ue.p=e,t()}finally{ue.p=a}}var $n=Math.random().toString(36).slice(2),ft="__reactFiber$"+$n,At="__reactProps$"+$n,Es="__reactContainer$"+$n,Gd="__reactEvents$"+$n,C0="__reactListeners$"+$n,k0="__reactHandles$"+$n,Vd="__reactResources$"+$n,zi="__reactMarker$"+$n,al="__reactLoad$"+$n;function sl(e){delete e[ft],delete e[At],delete e[C0],delete e[k0]}function Ka(e){var t;if(t=e[ft])return t;for(var a=e.parentNode;a;){if(t=a[Es]||a[ft]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Op(e);e!==null;){if(a=e[ft])return a;e=Op(e)}return t}e=a,a=e.parentNode}return null}function js(e){if(e=e[ft]||e[Es]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Bi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function Ts(e){var t=e[Vd];return t||(t=e[Vd]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function it(e){e[zi]=!0}function Kd(e){e[al]=void 0}var Yd=new Set,Jd={};function Ya(e,t){Rs(e,t),Rs(e+"Capture",t)}function Rs(e,t){for(Jd[e]=t,e=0;e<t.length;e++)Yd.add(t[e])}var D0=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]*$"),Qd={},Xd={};function U0(e){return uu.call(Xd,e)?!0:uu.call(Qd,e)?!1:D0.test(e)?Xd[e]=!0:(Qd[e]=!0,!1)}var Ee=!1;function Zd(){var e=Ee;return Ee=!1,e}function il(e,t,a){if(U0(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 rl(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 In(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 Ht(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Fd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function L0(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 u=r.get,c=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(p){a=""+p,c.call(this,p)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(p){a=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gu(e){if(!e._valueTracker){var t=Fd(e)?"checked":"value";e._valueTracker=L0(e,t,""+e[t])}}function Wd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=Fd(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}var M0=/[\n"\\]/g;function Xt(e){return e.replace(M0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function pu(e,t,a,r,u,c,p,_){e.name="",p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.type=p:e.removeAttribute("type"),t!=null?p==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ht(t)):e.value!==""+Ht(t)&&(e.value=""+Ht(t)):p!=="submit"&&p!=="reset"||e.removeAttribute("value"),t!=null?p==="number"&&e.value==t?vu(e,Ht(e.value)):vu(e,Ht(t)):a!=null?vu(e,Ht(a)):r!=null&&e.removeAttribute("value"),u==null&&c!=null&&(e.defaultChecked=!!c),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.name=""+Ht(_):e.removeAttribute("name")}function ef(e,t,a,r,u,c,p,_){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||a!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){gu(e);return}a=a!=null?""+Ht(a):"",t=t!=null?""+Ht(t):a,_||t===e.value||(e.value=t),e.defaultValue=t}r=r??u,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=_?e.checked:!!r,e.defaultChecked=!!r,p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.name=p),gu(e)}function vu(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function As(e,t,a,r){if(e=e.options,t){t={};for(var u=0;u<a.length;u++)t["$"+a[u]]=!0;for(a=0;a<e.length;a++)u=t.hasOwnProperty("$"+e[a].value),e[a].selected!==u&&(e[a].selected=u),u&&r&&(e[a].defaultSelected=!0)}else{for(a=""+Ht(a),t=null,u=0;u<e.length;u++){if(e[u].value===a){e[u].selected=!0,r&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function tf(e,t,a){if(t!=null&&(t=""+Ht(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Ht(a):""}function nf(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(l(92));if(je(r)){if(1<r.length)throw Error(l(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=Ht(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),gu(e)}function Ns(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var z0=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 af(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||z0.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function sf(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]="",Ee=!0);for(var u in t)r=t[u],t.hasOwnProperty(u)&&a[u]!==r&&(af(e,u,r),Ee=!0)}else for(var c in t)t.hasOwnProperty(c)&&af(e,c,t[c])}function yu(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 B0=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"],["maskType","mask-type"],["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
48-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"]]),H0=/^[\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 ll(e){return H0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function jn(){}var bu=null;function _u(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Os=null,Cs=null;function rf(e){var t=js(e);if(t&&(e=t.stateNode)){var a=e[At]||null;e:switch(e=t.stateNode,t.type){case"input":if(pu(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="'+Xt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var u=r[At]||null;if(!u)throw Error(l(90));pu(r,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&Wd(r)}break e;case"textarea":tf(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&As(e,!!a.multiple,t,!1)}}}var xu=!1;function lf(e,t,a){if(xu)return e(t,a);xu=!0;try{var r=e(t);return r}finally{if(xu=!1,(Os!==null||Cs!==null)&&(lo(),Os&&(t=Os,e=Cs,Cs=Os=null,rf(t),e)))for(t=0;t<e.length;t++)rf(e[t])}}function Hi(e,t){var a=e.stateNode;if(a===null)return null;var r=a[At]||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 Pn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wu=!1;if(Pn)try{var qi={};Object.defineProperty(qi,"passive",{get:function(){wu=!0}}),window.addEventListener("test",qi,qi),window.removeEventListener("test",qi,qi)}catch{wu=!1}var ma=null,Su=null,ol=null;function of(){if(ol)return ol;var e,t=Su,a=t.length,r,u="value"in ma?ma.value:ma.textContent,c=u.length;for(e=0;e<a&&t[e]===u[e];e++);var p=a-e;for(r=1;r<=p&&t[a-r]===u[c-r];r++);return ol=u.slice(e,1<r?1-r:void 0)}function ul(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 cl(){return!0}function uf(){return!1}function Et(e){function t(a,r,u,c,p){this._reactName=a,this._targetInst=u,this.type=r,this.nativeEvent=c,this.target=p,this.currentTarget=null;for(var _ in e)e.hasOwnProperty(_)&&(a=e[_],this[_]=a?a(c):c[_]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?cl:uf,this.isPropagationStopped=uf,this}return G(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=cl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=cl)},persist:function(){},isPersistent:cl}),t}var ga={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hl=Et(ga),$i=G({},ga,{view:0,detail:0}),q0=Et($i),Eu,ju,Ii,dl=G({},$i,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ru,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!==Ii&&(Ii&&e.type==="mousemove"?(Eu=e.screenX-Ii.screenX,ju=e.screenY-Ii.screenY):ju=Eu=0,Ii=e),Eu)},movementY:function(e){return"movementY"in e?e.movementY:ju}}),cf=Et(dl),$0=G({},dl,{dataTransfer:0}),I0=Et($0),P0=G({},$i,{relatedTarget:0}),Tu=Et(P0),G0=G({},ga,{animationName:0,elapsedTime:0,pseudoElement:0}),V0=Et(G0),K0=G({},ga,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Y0=Et(K0),J0=G({},ga,{data:0}),hf=Et(J0),Q0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},X0={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"},Z0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function F0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Z0[e])?!!t[e]:!1}function Ru(){return F0}var W0=G({},$i,{key:function(e){if(e.key){var t=Q0[e.key]||e.key;if(t!=="Unidentified")return t}
vendor: 5,373 bytes, line 48
48return e.type==="keypress"?(e=ul(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?X0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ru,charCode:function(e){return e.type==="keypress"?ul(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ul(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),eb=Et(W0),tb=G({},dl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),df=Et(tb),nb=G({},ga,{submitter:0}),ab=Et(nb),sb=G({},$i,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ru}),ib=Et(sb),rb=G({},ga,{propertyName:0,elapsedTime:0,pseudoElement:0}),lb=Et(rb),ob=G({},dl,{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}),ub=Et(ob),cb=G({},ga,{newState:0,oldState:0,source:0}),hb=Et(cb),db=[9,13,27,32],Au=Pn&&"CompositionEvent"in window,Pi=null;Pn&&"documentMode"in document&&(Pi=document.documentMode);var fb=Pn&&"TextEvent"in window&&!Pi,ff=Pn&&(!Au||Pi&&8<Pi&&11>=Pi),mf=" ",gf=!1;function pf(e,t){switch(e){case"keyup":return db.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ks=!1;function mb(e,t){switch(e){case"compositionend":return vf(t);case"keypress":return t.which!==32?null:(gf=!0,mf);case"textInput":return e=t.data,e===mf&&gf?null:e;default:return null}}function gb(e,t){if(ks)return e==="compositionend"||!Au&&pf(e,t)?(e=of(),ol=Su=ma=null,ks=!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 ff&&t.locale!=="ko"?null:t.data;default:return null}}var pb={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 yf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!pb[e.type]:t==="textarea"}function bf(e,t,a,r){Os?Cs?Cs.push(r):Cs=[r]:Os=r,t=mo(t,"onChange"),0<t.length&&(a=new hl("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var Gi=null,Vi=null;function vb(e){rp(e,0)}function fl(e){var t=Bi(e);if(Wd(t))return e}function _f(e,t){if(e==="change")return t}var xf=!1;if(Pn){var Nu;if(Pn){var Ou="oninput"in document;if(!Ou){var wf=document.createElement("div");wf.setAttribute("oninput","return;"),Ou=typeof wf.oninput=="function"}Nu=Ou}else Nu=!1;xf=Nu&&(!document.documentMode||9<document.documentMode)}function Sf(){Gi&&(Gi.detachEvent("onpropertychange",Ef),Vi=Gi=null)}function Ef(e){if(e.propertyName==="value"&&fl(Vi)){var t=[];bf(t,Vi,e,_u(e)),lf(vb,t)}}function yb(e,t,a){e==="focusin"?(Sf(),Gi=t,Vi=a,Gi.attachEvent("onpropertychange",Ef)):e==="focusout"&&Sf()}function bb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return fl(Vi)}function _b(e,t){if(e==="click")return fl(t)}function xb(e,t){if(e==="input"||e==="change")return fl(t)}function wb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qt=typeof Object.is=="function"?Object.is:wb;function Ki(e,t){if(qt(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 u=a[r];if(!uu.call(t,u)||!qt(e[u],t[u]))return!1}return!0}function Cu(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}}function jf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tf(e,t){var a=jf(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=jf(a)}}function Rf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Rf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Af(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Cu(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=Cu(e.document)}return t}function ku(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 Sb=Pn&&"documentMode"in document&&11>=document.documentMode,Ds=null,Du=null,Yi=null,Uu=!1;function Nf(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Uu||Ds==null||Ds!==Cu(r)||(r=Ds,"selectionStart"in r&&ku(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 111,196 bytes, line 48
48sNode:r.focusNode,focusOffset:r.focusOffset}),Yi&&Ki(Yi,r)||(Yi=r,r=mo(Du,"onSelect"),0<r.length&&(t=new hl("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Ds)))}function Ja(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Us={animationend:Ja("Animation","AnimationEnd"),animationiteration:Ja("Animation","AnimationIteration"),animationstart:Ja("Animation","AnimationStart"),transitionrun:Ja("Transition","TransitionRun"),transitionstart:Ja("Transition","TransitionStart"),transitioncancel:Ja("Transition","TransitionCancel"),transitionend:Ja("Transition","TransitionEnd")},Lu={},Of={};Pn&&(Of=document.createElement("div").style,"AnimationEvent"in window||(delete Us.animationend.animation,delete Us.animationiteration.animation,delete Us.animationstart.animation),"TransitionEvent"in window||delete Us.transitionend.transition);function Qa(e){if(Lu[e])return Lu[e];if(!Us[e])return e;var t=Us[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Of)return Lu[e]=t[a];return e}var Cf=Qa("animationend"),kf=Qa("animationiteration"),Df=Qa("animationstart"),Eb=Qa("transitionrun"),jb=Qa("transitionstart"),Tb=Qa("transitioncancel"),Uf=Qa("transitionend"),Lf=new Map,Mu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Mu.push("scrollEnd");function un(e,t){Lf.set(e,t),Ya(t,[e])}var Rb=0;function Gn(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=fn.identifierPrefix;var a=Rb++;return e="_"+e+"t_"+a.toString(32)+"_",t.autoName=e}function Mf(e){if(e==null||typeof e=="string")return e;var t=null,a=ei;if(a!==null)for(var r=0;r<a.length;r++){var u=e[a[r]];if(u!=null){if(u==="none")return"none";t=t==null?u:t+(" "+u)}}return t??e.default}function Vn(e,t){return e=Mf(e),t=Mf(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var ml=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=[],Ls=0,zu=0;function gl(){for(var e=Ls,t=zu=Ls=0;t<e;){var a=Zt[t];Zt[t++]=null;var r=Zt[t];Zt[t++]=null;var u=Zt[t];Zt[t++]=null;var c=Zt[t];if(Zt[t++]=null,r!==null&&u!==null){var p=r.pending;p===null?u.next=u:(u.next=p.next,p.next=u),r.pending=u}c!==0&&zf(a,u,c)}}function pl(e,t,a,r){Zt[Ls++]=e,Zt[Ls++]=t,Zt[Ls++]=a,Zt[Ls++]=r,zu|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Bu(e,t,a,r){return pl(e,t,a,r),vl(e)}function Xa(e,t){return pl(e,null,null,t),vl(e)}function zf(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var u=!1,c=e.return;c!==null;)c.childLanes|=a,r=c.alternate,r!==null&&(r.childLanes|=a),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(u=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,u&&t!==null&&(u=31-Bt(a),e=c.hiddenUpdates,r=e[u],r===null?e[u]=[t]:r.push(t),t.lane=a|536870912),c):null}function vl(e){if(50<gr)throw gr=0,ro=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ms={};function Ab(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 Nt(e,t,a,r){return new Ab(e,t,a,r)}function Hu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Kn(e,t){var a=e.alternate;return a===null?(a=Nt(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&1206910976,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 Bf(e,t){e.flags&=1206910978;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 yl(e,t,a,r,u,c){var p=0;if(r=e,typeof r=="function")Hu(r)&&(p=1);else if(typeof r=="string")p=nx(e,a,En.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(r){case on:return e=Nt(31,a,t,u),e.elementType=on,e.lanes=c,e;case $e:return Za(a.children,u,c,t);case Qe:p=8,u|=24;break;case ht:return e=Nt(12,a,t,u|2),e.elementType=ht,e.lanes=c,e;case Z:return e=Nt(13,a,t,u),e.elementType=Z,e.lanes=c,e;case oe:return e=Nt(19,a,t,u),e.elementType=oe,e.lanes=c,e;case Hn:case O:return e=u|32,e=Nt(30,a,t,e),e.elementType=O,e.lanes=c,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case K:p=10;break e;case xt:p=9;break e;case q:p=11;break e;case Ue:p=14;break e;case Re:p=16,r=null;break e}p=29,a=Error(l(130,e===null?"null":typeof e,"")),r=null}return t=Nt(p,a,t,u),t.elementType=e,t.type=r,t.lanes=c,t}function Za(e,t,a,r){return e=Nt(7,e,r,t),e.lanes=a,e}function qu(e,t,a){return e=Nt(6,e,null,t),e.lanes=a,e}function Hf(e){var t=Nt(18,null,null,0);return t.stateNode=e,t}function $u(e,t,a){return t=Nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var qf=new WeakMap;function Ft(e,t){if(typeof e=="object"&&e!==null){var a=qf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Dd(t)},qf.set(e,t),t)}return{value:e,source:t,stack:Dd(t)}}var zs=[],Bs=0,bl=null,Ji=0,Wt=[],en=0,pa=null,Tn=1,Rn="";function Yn(e,t){zs[Bs++]=Ji,zs[Bs++]=bl,bl=e,Ji=t}function $f(e,t,a){Wt[en++]=Tn,Wt[en++]=Rn,Wt[en++]=pa,pa=e;var r=Tn;e=Rn;var u=32-Bt(r)-1;r&=~(1<<u),a+=1;var c=32-Bt(t)+u;if(30<c){var p=u-u%5;c=(r&(1<<p)-1).toString(32),r>>=p,u-=p,Tn=1<<32-Bt(t)+u|a<<u|r,Rn=c+e}else Tn=1<<c|a<<u|r,Rn=e}function _l(e){e.return!==null&&(Yn(e,1),$f(e,1,0))}function Iu(e){for(;e===bl;)bl=zs[--Bs],zs[Bs]=null,Ji=zs[--Bs],zs[Bs]=null;for(;e===pa;)pa=Wt[--en],Wt[en]=null,Rn=Wt[--en],Wt[en]=null,Tn=Wt[--en],Wt[en]=null}function If(e,t){Wt[en++]=Tn,Wt[en++]=Rn,Wt[en++]=pa,Tn=t.id,Rn=t.overflow,pa=e}var rt=null,ze=null,me=!1,va=null,tn=!1,Pu=Error(l(519));function ya(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qi(Ft(t,e)),Pu}function Pf(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[ft]=e,t[At]=r,a){case"dialog":ve("cancel",t),ve("close",t);break;case"iframe":case"object":case"embed":ve("load",t);break;case"video":case"audio":for(a=0;a<vr.length;a++)ve(vr[a],t);break;case"source":ve("error",t);break;case"img":case"image":case"link":ve("error",t),ve("load",t);break;case"details":ve("toggle",t);break;case"input":ve("invalid",t),ef(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ve("invalid",t);break;case"textarea":ve("invalid",t),nf(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||cp(t.textContent,a)?(r.popover!=null&&(ve("beforetoggle",t),ve("toggle",t)),r.onScroll!=null&&ve("scroll",t),r.onScrollEnd!=null&&ve("scrollend",t),r.onClick!=null&&(t.onclick=jn),t=!0):t=!1,t||ya(e,!0)}function xl(e){for(rt=e.return;rt;)switch(rt.tag){case 5:case 31:case 13:tn=!1;return;case 27:case 3:tn=!0;return;default:rt=rt.return}}function Hs(e){if(e!==rt)return!1;if(!me)return xl(e),me=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||bh(e.type,e.memoizedProps)),a=!a),a&&ze&&ya(e),xl(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));ze=Np(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));ze=Np(e)}else t===27?(t=ze,Ua(e.type)?(e=Ah,Ah=null,ze=e):ze=t):ze=rt?an(e.stateNode.nextSibling):null;return!0}function Fa(){ze=rt=null,me=!1}function Gu(){var e=va;return e!==null&&(kt===null?kt=e:kt.push.apply(kt,e),va=null),e}function Qi(e){va===null?va=[e]:va.push(e)}var Vu=Sn(null),Wa=null,Jn=null;function ba(e,t,a){Me(Vu,t._currentValue),t._currentValue=a}function Qn(e){e._currentValue=Vu.current,dt(Vu)}function wl(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 Ku(e,t,a,r){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var c=u.dependencies;if(c!==null){var p=u.child;c=c.firstContext;e:for(;c!==null;){var _=c;c=u;for(var S=0;S<t.length;S++)if(_.context===t[S]){c.lanes|=a,_=c.alternate,_!==null&&(_.lanes|=a),wl(c.return,a,e),r||(p=null);break e}c=_.next}}else if(u.tag===18){if(p=u.return,p===null)throw Error(l(341));p.lanes|=a,c=p.alternate,c!==null&&(c.lanes|=a),wl(p,a,e),p=null}else u.tag===13&&u.memoizedState!==null&&u.memoizedState.dehydrated===null?(u.lanes|=a,p=u.alternate,p!==null&&(p.lanes|=a),wl(u.return,a,e),p=u.child,p=p!==null?p.sibling:null):p=u.child;if(p!==null)p.return=u;else for(p=u;p!==null;){if(p===e){p=null;break}if(u=p.sibling,u!==null){u.return=p.return,p=u;break}p=p.return}u=p}}function es(e,t,a,r){e=null;for(var u=t,c=!1;u!==null;){if(!c){if((u.flags&524288)!==0)c=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var p=u.alternate;if(p===null)throw Error(l(387));if(p=p.memoizedProps,p!==null){var _=u.type;qt(u.pendingProps.value,p.value)||(e!==null?e.push(_):e=[_])}}else if(u===Qr.current){if(p=u.alternate,p===null)throw Error(l(387));p.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(ci):e=[ci])}u=u.return}return e!==null&&Ku(t,e,a,r),t.flags|=262144,e!==null}function Sl(e){for(e=e.firstContext;e!==null;){if(!qt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ts(e){Wa=e,Jn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function mt(e){return Gf(Wa,e)}function El(e,t){return Wa===null&&ts(e),Gf(e,t)}function Gf(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Jn===null){if(e===null)throw Error(l(308));Jn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Jn=Jn.next=t;return a}var Nb=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()})}},Ob=s.unstable_scheduleCallback,Cb=s.unstable_NormalPriority,Fe={$$typeof:K,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Yu(){return{controller:new Nb,data:new Map,refCount:0}}function Xi(e){e.refCount--,e.refCount===0&&Ob(Cb,function(){e.controller.abort()})}function Vf(e,t){if((e.pendingLanes&4194048)!==0){var a=e.transitionTypes;for(a===null&&(a=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];a.indexOf(r)===-1&&a.push(r)}}}var Zi=null;function kb(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Fi=null,Ju=0,ns=0,qs=null;function Db(e,t){if(Fi===null){var a=Fi=[];Ju=0,ns=ch(),qs={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Ju++,t.then(Kf,Kf),t}function Kf(){if(--Ju===0&&(Zi=null,Fi!==null)){qs!==null&&(qs.status="fulfilled");var e=Fi;Fi=null,ns=0,qs=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ub(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(u){a.push(u)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var u=0;u<a.length;u++)(0,a[u])(t)},function(u){for(r.status="rejected",r.reason=u,u=0;u<a.length;u++)(0,a[u])(void 0)}),r}var Yf=te.S;te.S=function(e,t){if(Hg=Mt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Db(e,t),Zi!==null)for(var a=si;a!==null;)Vf(a,Zi),a=a.next;if(a=e.types,a!==null){for(var r=si;r!==null;)Vf(r,a),r=r.next;if(ns!==0){r=Zi,r===null&&(r=Zi=[]);for(var u=0;u<a.length;u++){var c=a[u];r.indexOf(c)===-1&&r.push(c)}}}Yf!==null&&Yf(e,t)};var as=Sn(null);function Qu(){var e=as.current;return e!==null?e:Le.pooledCache}function jl(e,t){t===null?Me(as,as.current):Me(as,t.pool)}function Jf(){var e=Qu();return e===null?null:{parent:Fe._currentValue,pool:e}}var $s=Error(l(460)),Xu=Error(l(474)),Tl=Error(l(542)),Rl={then:function(){}};function Qf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Xf(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(jn,jn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ff(e),e===void 0&&!("reason"in t)?Error(l(600)):e;default:if(typeof t.status=="string")t.then(jn,jn);else{if(e=Le,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=r}},function(r){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ff(e),e}throw is=t,$s}}function ss(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(is=a,$s):a}}var is=null;function Zf(){if(is===null)throw Error(l(459));var e=is;return is=null,e}function Ff(e){if(e===$s||e===Tl)throw Error(l(483))}var Is=null,Wi=0;function Al(e){var t=Wi;return Wi+=1,Is===null&&(Is=[]),Xf(Is,e,t)}function _a(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Nl(e,t){throw t.$$typeof===H?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Wf(e){function t(D,A){if(e){var L=D.deletions;L===null?(D.deletions=[A],D.flags|=16):L.push(A)}}function a(D,A){if(!e)return null;for(;A!==null;)t(D,A),A=A.sibling;return null}function r(D){for(var A=new Map;D!==null;)D.key===null?A.set(D.index,D):A.set(D.key,D),D=D.sibling;return A}function u(D,A){return D=Kn(D,A),D.index=0,D.sibling=null,D}function c(D,A,L){return D.index=L,e?(L=D.alternate,L!==null?(L=L.index,L<A?(D.flags|=2,A):L):(D.flags|=134217730,A)):(D.flags|=1048576,A)}function p(D){return e&&D.alternate===null&&(D.flags|=134217730),D}function _(D,A,L,I){return A===null||A.tag!==6?(A=qu(L,D.mode,I),A.return=D,A):(A=u(A,L),A.return=D,A)}function S(D,A,L,I){var F=L.type;return F===$e?(D=z(D,A,L.props.children,I,L.key),_a(D,L),D):A!==null&&(A.elementType===F||typeof F=="object"&&F!==null&&F.$$typeof===Re&&ss(F)===A.type)?(A=u(A,L.props),_a(A,L),A.return=D,A):(A=yl(L.type,L.key,L.props,null,D.mode,I),_a(A,L),A.return=D,A)}function U(D,A,L,I){return A===null||A.tag!==4||A.stateNode.containerInfo!==L.containerInfo||A.stateNode.implementation!==L.implementation?(A=$u(L,D.mode,I),A.return=D,A):(A=u(A,L.children||[]),A.return=D,A)}function z(D,A,L,I,F){return A===null||A.tag!==7?(A=Za(L,D.mode,I,F),A.return=D,A):(A=u(A,L),A.return=D,A)}function P(D,A,L){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=qu(""+A,D.mode,L),A.return=D,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case ae:return L=yl(A.type,A.key,A.props,null,D.mode,L),_a(L,A),L.return=D,L;case ye:return A=$u(A,D.mode,L),A.return=D,A;case Re:return A=ss(A),P(D,A,L)}if(je(A)||ie(A))return A=Za(A,D.mode,L,null),A.return=D,A;if(typeof A.then=="function")return P(D,Al(A),L);if(A.$$typeof===K)return P(D,El(D,A),L);Nl(D,A)}return null}function k(D,A,L,I){var F=A!==null?A.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return F!==null?null:_(D,A,""+L,I);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case ae:return L.key===F?S(D,A,L,I):null;case ye:return L.key===F?U(D,A,L,I):null;case Re:return L=ss(L),k(D,A,L,I)}if(je(L)||ie(L))return F!==null?null:z(D,A,L,I,null);if(typeof L.then=="function")return k(D,A,Al(L),I);if(L.$$typeof===K)return k(D,A,El(D,L),I);Nl(D,L)}return null}function M(D,A,L,I,F){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return D=D.get(L)||null,_(A,D,""+I,F);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case ae:return D=D.get(I.key===null?L:I.key)||null,S(A,D,I,F);case ye:return D=D.get(I.key===null?L:I.key)||null,U(A,D,I,F);case Re:return I=ss(I),M(D,A,L,I,F)}if(je(I)||ie(I))return D=D.get(L)||null,z(A,D,I,F,null);if(typeof I.then=="function")return M(D,A,L,Al(I),F);if(I.$$typeof===K)return M(D,A,L,El(A,I),F);Nl(A,I)}return null}function J(D,A,L,I){for(var F=null,_e=null,ne=A,le=A=0,tt=null;ne!==null&&le<L.length;le++){ne.index>le?(tt=ne,ne=null):tt=ne.sibling;var xe=k(D,ne,L[le],I);if(xe===null){ne===null&&(ne=tt);break}e&&ne&&xe.alternate===null&&t(D,ne),A=c(xe,A,le),_e===null?F=xe:_e.sibling=xe,_e=xe,ne=tt}if(le===L.length)return a(D,ne),me&&Yn(D,le),F;if(ne===null){for(;le<L.length;le++)ne=P(D,L[le],I),ne!==null&&(A=c(ne,A,le),_e===null?F=ne:_e.sibling=ne,_e=ne);return me&&Yn(D,le),F}for(ne=r(ne);le<L.length;le++)tt=M(ne,D,le,L[le],I),tt!==null&&(e&&(xe=tt.alternate,xe!==null&&ne.delete(xe.key===null?le:xe.key)),A=c(tt,A,le),_e===null?F=tt:_e.sibling=tt,_e=tt);return e&&ne.forEach(function(Ha){return t(D,Ha)}),me&&Yn(D,le),F}function W(D,A,L,I){if(L==null)throw Error(l(151));for(var F=null,_e=null,ne=A,le=A=0,tt=null,xe=L.next();ne!==null&&!xe.done;le++,xe=L.next()){ne.index>le?(tt=ne,ne=null):tt=ne.sibling;var Ha=k(D,ne,xe.value,I);if(Ha===null){ne===null&&(ne=tt);break}e&&ne&&Ha.alternate===null&&t(D,ne),A=c(Ha,A,le),_e===null?F=Ha:_e.sibling=Ha,_e=Ha,ne=tt}if(xe.done)return a(D,ne),me&&Yn(D,le),F;if(ne===null){for(;!xe.done;le++,xe=L.next())xe=P(D,xe.value,I),xe!==null&&(A=c(xe,A,le),_e===null?F=xe:_e.sibling=xe,_e=xe);return me&&Yn(D,le),F}for(ne=r(ne);!xe.done;le++,xe=L.next())xe=M(ne,D,le,xe.value,I),xe!==null&&(e&&(tt=xe.alternate,tt!==null&&ne.delete(tt.key===null?le:tt.key)),A=c(xe,A,le),_e===null?F=xe:_e.sibling=xe,_e=xe);return e&&ne.forEach(function(mx){return t(D,mx)}),me&&Yn(D,le),F}function fe(D,A,L,I){if(typeof L=="object"&&L!==null&&L.type===$e&&L.key===null&&L.props.ref===void 0&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case ae:e:{for(var F=L.key;A!==null;){if(A.key===F){if(F=L.type,F===$e){if(A.tag===7){a(D,A.sibling),I=u(A,L.props.children),_a(I,L),I.return=D,D=I;break e}}else if(A.elementType===F||typeof F=="object"&&F!==null&&F.$$typeof===Re&&ss(F)===A.type){a(D,A.sibling),I=u(A,L.props),_a(I,L),I.return=D,D=I;break e}a(D,A);break}else t(D,A);A=A.sibling}L.type===$e?(I=Za(L.props.children,D.mode,I,L.key),_a(I,L),I.return=D,D=I):(I=yl(L.type,L.key,L.props,null,D.mode,I),_a(I,L),I.return=D,D=I)}return p(D);case ye:e:{for(F=L.key;A!==null;){if(A.key===F)if(A.tag===4&&A.stateNode.containerInfo===L.containerInfo&&A.stateNode.implementation===L.implementation){a(D,A.sibling),I=u(A,L.children||[]),I.return=D,D=I;break e}else{a(D,A);break}else t(D,A);A=A.sibling}I=$u(L,D.mode,I),I.return=D,D=I}return p(D);case Re:return L=ss(L),fe(D,A,L,I)}if(je(L))return J(D,A,L,I);if(ie(L)){if(F=ie(L),typeof F!="function")throw Error(l(150));return L=F.call(L),W(D,A,L,I)}if(typeof L.then=="function")return fe(D,A,Al(L),I);if(L.$$typeof===K)return fe(D,A,El(D,L),I);Nl(D,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,A!==null&&A.tag===6?(a(D,A.sibling),I=u(A,L),I.return=D,D=I):(a(D,A),I=qu(L,D.mode,I),I.return=D,D=I),p(D)):a(D,A)}return function(D,A,L,I){try{Wi=0;var F=fe(D,A,L,I);return Is=null,F}catch(ne){if(ne===$s||ne===Tl)throw ne;var _e=Nt(29,ne,null,D.mode);return _e.lanes=I,_e.return=D,_e}finally{}}}var rs=Wf(!0),em=Wf(!1),xa=!1;function Zu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fu(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 wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Sa(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Te&2)!==0){var u=r.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),r.pending=t,t=vl(e),zf(e,null,a),t}return pl(e,r,t,a),vl(e)}function er(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,qd(e,a)}}function Wu(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var u=null,c=null;if(a=a.firstBaseUpdate,a!==null){do{var p={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};c===null?u=c=p:c=c.next=p,a=a.next}while(a!==null);c===null?u=c=t:c=c.next=t}else u=c=t;a={baseState:r.baseState,firstBaseUpdate:u,lastBaseUpdate:c,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 ec=!1;function tr(){if(ec){var e=qs;if(e!==null)throw e}}function nr(e,t,a,r){ec=!1;var u=e.updateQueue;xa=!1;var c=u.firstBaseUpdate,p=u.lastBaseUpdate,_=u.shared.pending;if(_!==null){u.shared.pending=null;var S=_,U=S.next;S.next=null,p===null?c=U:p.next=U,p=S;var z=e.alternate;z!==null&&(z=z.updateQueue,_=z.lastBaseUpdate,_!==p&&(_===null?z.firstBaseUpdate=U:_.next=U,z.lastBaseUpdate=S))}if(c!==null){var P=u.baseState;p=0,z=U=S=null,_=c;do{var k=_.lane&-536870913,M=k!==_.lane;if(M?(be&k)===k:(r&k)===k){k!==0&&k===ns&&(ec=!0),z!==null&&(z=z.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var J=e,W=_;k=t;var fe=a;switch(W.tag){case 1:if(J=W.payload,typeof J=="function"){P=J.call(fe,P,k);break e}P=J;break e;case 3:J.flags=J.flags&-65537|128;case 0:if(J=W.payload,k=typeof J=="function"?J.call(fe,P,k):J,k==null)break e;P=G({},P,k);break e;case 2:xa=!0}}k=_.callback,k!==null&&(e.flags|=64,M&&(e.flags|=8192),M=u.callbacks,M===null?u.callbacks=[k]:M.push(k))}else M={lane:k,tag:_.tag,payload:_.payload,callback:_.callback,next:null},z===null?(U=z=M,S=P):z=z.next=M,p|=k;if(_=_.next,_===null){if(_=u.shared.pending,_===null)break;M=_,_=M.next,M.next=null,u.lastBaseUpdate=M,u.shared.pending=null}}while(!0);z===null&&(S=P),u.baseState=S,u.firstBaseUpdate=U,u.lastBaseUpdate=z,c===null&&(u.shared.lanes=0),Oa|=p,e.lanes=p,e.memoizedState=P}}function tm(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function nm(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)tm(a[e],t)}var Ea=Sn(null),Ol=Sn(0);function am(e,t){e=ea,Me(Ol,e),Me(Ea,t),ea=e|t.baseLanes}function tc(){Me(Ol,ea),Me(Ea,Ea.current)}function nc(){ea=Ol.current,dt(Ea),dt(Ol)}var gt=Sn(null),wt=null;function ja(e){var t=e.alternate;Me(pt,pt.current&1),Me(gt,e),wt===null&&(t===null||Ea.current!==null||t.memoizedState!==null)&&(wt=e)}function ac(e){Me(pt,pt.current),Me(gt,e),wt===null&&(wt=e)}function sm(e){e.tag===22?(Me(pt,pt.current),Me(gt,e),wt===null&&(wt=e)):Ta()}function Ta(){Me(pt,pt.current),Me(gt,gt.current)}function $t(e){dt(gt),wt===e&&(wt=null),dt(pt)}var pt=Sn(0);function ar(e,t){Me(gt,gt.current),Me(pt,t)}function sc(e){dt(pt),dt(gt),wt===e&&(wt=null)}function Cl(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Th(a)||Rh(a)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){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 Xn=0,de=null,De=null,We=null,kl=!1,Ps=!1,ls=!1,Dl=0,sr=0,Gs=null,Lb=0;function Ve(){throw Error(l(321))}function ic(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!qt(e[a],t[a]))return!1;return!0}function rc(e,t,a,r,u,c){return Xn=c,de=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,te.H=e===null||e.memoizedState===null?$m:Im,ls=!1,c=a(r,u),ls=!1,Ps&&(c=rm(t,a,r,u)),im(e),c}function im(e){te.H=ql;var t=De!==null&&De.next!==null;if(Xn=0,We=De=de=null,kl=!1,sr=0,Gs=null,t)throw Error(l(300));e===null||et||(e=e.dependencies,e!==null&&Sl(e)&&(et=!0))}function rm(e,t,a,r){de=e;var u=0;do{if(Ps&&(Gs=null),sr=0,Ps=!1,25<=u)throw Error(l(301));if(u+=1,We=De=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}te.H=Pb,c=t(a,r)}while(Ps);return c}function Mb(){var e=te.H,t=e.useState()[0];return t=typeof t.then=="function"?ir(t):t,e=e.useState()[0],(De!==null?De.memoizedState:null)!==e&&(de.flags|=1024),t}function lc(){var e=Dl!==0;return Dl=0,e}function oc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function uc(e){if(kl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}kl=!1}Xn=0,We=De=de=null,Ps=!1,sr=Dl=0,Gs=null}function jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?de.memoizedState=We=e:We=We.next=e,We}function Xe(){if(De===null){var e=de.alternate;e=e!==null?e.memoizedState:null}else e=De.next;var t=We===null?de.memoizedState:We.next;if(t!==null)We=t,De=e;else{if(e===null)throw de.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},We===null?de.memoizedState=We=e:We=We.next=e}return We}function Ul(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ir(e){var t=sr;return sr+=1,Gs===null&&(Gs=[]),e=Xf(Gs,e,t),t=de,(We===null?t.memoizedState:We.next)===null&&(t=t.alternate,te.H=t===null||t.memoizedState===null?$m:Im),e}function Ll(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ir(e);if(e.$$typeof===V)return;if(e.$$typeof===K)return mt(e)}throw Error(l(438,String(e)))}function cc(e){var t=null,a=de.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=de.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Ul(),de.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]=Ga;return t.index++,a}function Zn(e,t){return typeof t=="function"?t(e):t}function Ml(e){var t=Xe();return hc(t,De,e)}function hc(e,t,a){var r=e.queue;if(r===null)throw Error(l(311));r.lastRenderedReducer=a;var u=e.baseQueue,c=r.pending;if(c!==null){if(u!==null){var p=u.next;u.next=c.next,c.next=p}t.baseQueue=u=c,r.pending=null}if(c=e.baseState,u===null)e.memoizedState=c;else{t=u.next;var _=p=null,S=null,U=t,z=!1;do{var P=U.lane&-536870913;if(P!==U.lane?(be&P)===P:(Xn&P)===P){var k=U.revertLane;if(k===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),P===ns&&(z=!0);else if((Xn&k)===k){U=U.next,k===ns&&(z=!0);continue}else P={lane:0,revertLane:U.revertLane,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},S===null?(_=S=P,p=c):S=S.next=P,de.lanes|=k,Oa|=k;P=U.action,ls&&a(c,P),c=U.hasEagerState?U.eagerState:a(c,P)}else k={lane:P,revertLane:U.revertLane,gesture:U.gesture,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},S===null?(_=S=k,p=c):S=S.next=k,de.lanes|=P,Oa|=P;U=U.next}while(U!==null&&U!==t);if(S===null?p=c:S.next=_,!qt(c,e.memoizedState)&&(et=!0,z&&(a=qs,a!==null)))throw a;e.memoizedState=c,e.baseState=p,e.baseQueue=S,r.lastRenderedState=c}return u===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function dc(e){var t=Xe(),a=t.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=e;var r=a.dispatch,u=a.pending,c=t.memoizedState;if(u!==null){a.pending=null;var p=u=u.next;do c=e(c,p.action),p=p.next;while(p!==u);qt(c,t.memoizedState)||(et=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),a.lastRenderedState=c}return[c,r]}function lm(e,t,a){var r=de,u=Xe(),c=me;if(c){if(a===void 0)throw Error(l(407));a=a()}else a=t();var p=!qt((De||u).memoizedState,a);if(p&&(u.memoizedState=a,et=!0),u=u.queue,gc(cm.bind(null,r,u,e),[e]),e=u.getSnapshot!==t||p||We!==null&&(We.memoizedState.tag&1)!==0,Vs(e?9:8,{destroy:void 0},um.bind(null,r,u,a,t),null),e){if(r.flags|=2048,Le===null)throw Error(l(349));c||(Xn&127)!==0||om(r,t,a)}return a}function om(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=de.updateQueue,t===null?(t=Ul(),de.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function um(e,t,a,r){t.value=a,t.getSnapshot=r,hm(t)&&dm(e)}function cm(e,t,a){return a(function(){hm(t)&&dm(e)})}function hm(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!qt(e,a)}catch{return!0}}function dm(e){var t=Xa(e,2);t!==null&&Dt(t,e,2)}function fc(e){var t=jt();if(typeof e=="function"){var a=e;if(e=a(),ls){fa(!0);try{a()}finally{fa(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:e},t}function fm(e,t,a,r){return e.baseState=a,hc(e,De,typeof r=="function"?r:Zn)}function zb(e,t,a,r,u){if(Hl(e))throw Error(l(485));if(e=t.action,e!==null){var c={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(p){c.listeners.push(p)}};te.T!==null?a(!0):c.isTransition=!1,r(c),a=t.pending,a===null?(c.next=t.pending=c,mm(t,c)):(c.next=a.next,t.pending=a.next=c)}}function mm(e,t){var a=t.action,r=t.payload,u=e.state;if(t.isTransition){var c=te.T,p={};p.types=c!==null?c.types:null,te.T=p;try{var _=a(u,r),S=te.S;S!==null&&S(p,_),gm(e,t,_)}catch(U){mc(e,t,U)}finally{c!==null&&p.types!==null&&(c.types=p.types),te.T=c}}else try{c=a(u,r),gm(e,t,c)}catch(U){mc(e,t,U)}}function gm(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){pm(e,t,r)},function(r){return mc(e,t,r)}):pm(e,t,a)}function pm(e,t,a){t.status="fulfilled",t.value=a,vm(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,mm(e,a)))}function mc(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,vm(t),t=t.next;while(t!==r)}e.action=null}function vm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ym(e,t){return t}function bm(e,t){if(me){var a=Le.formState;if(a!==null){e:{var r=de;if(me){if(ze){t:{for(var u=ze,c=tn;u.nodeType!==8;){if(!c){u=null;break t}if(u=an(u.nextSibling),u===null){u=null;break t}}c=u.data,u=c==="F!"||c==="F"?u:null}if(u){ze=an(u.nextSibling),r=u.data==="F!";break e}}ya(r)}r=!1}r&&(t=a[0])}}return a=jt(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ym,lastRenderedState:t},a.queue=r,a=Bm.bind(null,de,r),r.dispatch=a,r=fc(!1),c=_c.bind(null,de,!1,r.queue),r=jt(),u={state:t,dispatch:null,action:e,pending:null},r.queue=u,a=zb.bind(null,de,u,c,a),u.dispatch=a,r.memoizedState=e,[t,a,!1]}function _m(e){var t=Xe();return xm(t,De,e)}function xm(e,t,a){if(t=hc(e,t,ym)[0],e=Ml(Zn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=ir(t)}catch(p){throw p===$s?Tl:p}else r=t;t=Xe();var u=t.queue,c=u.dispatch;return a!==t.memoizedState&&(de.flags|=2048,Vs(9,{destroy:void 0},Bb.bind(null,u,a),null)),[r,c,e]}function Bb(e,t){e.action=t}function wm(e){var t=Xe(),a=De;if(a!==null)return xm(t,a,e);Xe(),t=t.memoizedState,a=Xe();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function Vs(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=de.updateQueue,t===null&&(t=Ul(),de.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 Sm(){return Xe().memoizedState}function zl(e,t,a,r){var u=jt();de.flags|=e,u.memoizedState=Vs(1|t,{destroy:void 0},a,r===void 0?null:r)}function Bl(e,t,a,r){var u=Xe();r=r===void 0?null:r;var c=u.memoizedState.inst;De!==null&&r!==null&&ic(r,De.memoizedState.deps)?u.memoizedState=Vs(t,c,a,r):(de.flags|=e,u.memoizedState=Vs(1|t,c,a,r))}function Em(e,t){zl(8390656,8,e,t)}function gc(e,t){Bl(2048,8,e,t)}function Hb(e){de.flags|=4;var t=de.updateQueue;if(t===null)t=Ul(),de.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function jm(e){var t=Xe().memoizedState;return Hb({ref:t,nextImpl:e}),function(){if((Te&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function Tm(e,t){return Bl(4,2,e,t)}function Rm(e,t){return Bl(4,4,e,t)}function Am(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 Nm(e,t,a){a=a!=null?a.concat([e]):null,Bl(4,4,Am.bind(null,t,e),a)}function pc(){}function Om(e,t){var a=Xe();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&ic(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function Cm(e,t){var a=Xe();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&ic(t,r[1]))return r[0];if(r=e(),ls){fa(!0);try{e()}finally{fa(!1)}}return a.memoizedState=[r,t],r}function vc(e,t,a){return a===void 0||(Xn&1073741824)!==0&&(be&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=$g(),de.lanes|=e,Oa|=e,a)}function km(e,t,a,r){return qt(a,t)?a:Ea.current!==null?(e=vc(e,a,r),qt(e,t)||(et=!0),e):(Xn&106)===0||(Xn&1073741824)!==0&&(be&261930)===0?(et=!0,e.memoizedState=a):(e=$g(),de.lanes|=e,Oa|=e,t)}function Dm(e,t,a,r,u){var c=ue.p;ue.p=c!==0&&8>c?c:8;var p=te.T,_={};_.types=p!==null?p.types:null,te.T=_,_c(e,!1,t,a);try{var S=u(),U=te.S;if(U!==null&&U(_,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var z=Ub(S,r);rr(e,t,z,Vt(e))}else rr(e,t,r,Vt(e))}catch(P){rr(e,t,{then:function(){},status:"rejected",reason:P},Vt())}finally{ue.p=c,p!==null&&_.types!==null&&(p.types=_.types),te.T=p}}function qb(){}function yc(e,t,a,r){if(e.tag!==5)throw Error(l(476));var u=Um(e).queue;Dm(e,u,t,qn,a===null?qb:function(){return Lm(e),a(r)})}function Um(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:qn,baseState:qn,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:qn},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Lm(e){var t=Um(e);t.next===null&&(t=e.alternate.memoizedState),rr(e,t.next.queue,{},Vt())}function bc(){return mt(ci)}function Mm(){return Xe().memoizedState}function zm(){return Xe().memoizedState}function $b(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Vt();e=wa(a);var r=Sa(t,e,a);r!==null&&(Dt(r,t,a),er(r,t,a)),t={cache:Yu()},e.payload=t;return}t=t.return}}function Ib(e,t,a){var r=Vt();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Hl(e)?Hm(t,a):(a=Bu(e,t,a,r),a!==null&&(Dt(a,e,r),qm(a,t,r)))}function Bm(e,t,a){var r=Vt();rr(e,t,a,r)}function rr(e,t,a,r){var u={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Hl(e))Hm(t,u);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var p=t.lastRenderedState,_=c(p,a);if(u.hasEagerState=!0,u.eagerState=_,qt(_,p))return pl(e,t,u,0),Le===null&&gl(),!1}catch{}finally{}if(a=Bu(e,t,u,r),a!==null)return Dt(a,e,r),qm(a,t,r),!0}return!1}function _c(e,t,a,r){if(r={lane:2,revertLane:ch(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Hl(e)){if(t)throw Error(l(479))}else t=Bu(e,a,r,2),t!==null&&Dt(t,e,2)}function Hl(e){var t=e.alternate;return e===de||t!==null&&t===de}function Hm(e,t){Ps=kl=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function qm(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,qd(e,a)}}var ql={readContext:mt,use:Ll,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useLayoutEffect:Ve,useInsertionEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useSyncExternalStore:Ve,useId:Ve,useHostTransitionStatus:Ve,useFormState:Ve,useActionState:Ve,useOptimistic:Ve,useMemoCache:Ve,useCacheRefresh:Ve,useEffectEvent:Ve},$m={readContext:mt,use:Ll,useCallback:function(e,t){return jt().memoizedState=[e,t===void 0?null:t],e},useContext:mt,useEffect:Em,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,zl(4194308,4,Am.bind(null,t,e),a)},useLayoutEffect:function(e,t){return zl(4194308,4,e,t)},useInsertionEffect:function(e,t){zl(4,2,e,t)},useMemo:function(e,t){var a=jt();t=t===void 0?null:t;var r=e();if(ls){fa(!0);try{e()}finally{fa(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=jt();if(a!==void 0){var u=a(t);if(ls){fa(!0);try{a(t)}finally{fa(!1)}}}else u=t;return r.memoizedState=r.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},r.queue=e,e=e.dispatch=Ib.bind(null,de,e),[r.memoizedState,e]},useRef:function(e){var t=jt();return e={current:e},t.memoizedState=e},useState:function(e){e=fc(e);var t=e.queue,a=Bm.bind(null,de,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:pc,useDeferredValue:function(e,t){var a=jt();return vc(a,e,t)},useTransition:function(){var e=fc(!1);return e=Dm.bind(null,de,e.queue,!0,!1),jt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=de,u=jt();if(me){if(a===void 0)throw Error(l(407));a=a()}else{if(a=t(),Le===null)throw Error(l(349));(be&127)!==0||om(r,t,a)}u.memoizedState=a;var c={value:a,getSnapshot:t};return u.queue=c,Em(cm.bind(null,r,c,e),[e]),r.flags|=2048,Vs(9,{destroy:void 0},um.bind(null,r,c,a,t),null),a},useId:function(){var e=jt(),t=Le.identifierPrefix;if(me){var a=Rn,r=Tn;a=(r&~(1<<32-Bt(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Dl++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Lb++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:bc,useFormState:bm,useActionState:bm,useOptimistic:function(e){var t=jt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=_c.bind(null,de,!0,a),a.dispatch=t,[e,t]},useMemoCache:cc,useCacheRefresh:function(){return jt().memoizedState=$b.bind(null,de)},useEffectEvent:function(e){var t=jt(),a={impl:e};return t.memoizedState=a,function(){if((Te&2)!==0)throw Error(l(440));return a.impl.apply(void 0,arguments)}}},Im={readContext:mt,use:Ll,useCallback:Om,useContext:mt,useEffect:gc,useImperativeHandle:Nm,useInsertionEffect:Tm,useLayoutEffect:Rm,useMemo:Cm,useReducer:Ml,useRef:Sm,useState:function(){return Ml(Zn)},useDebugValue:pc,useDeferredValue:function(e,t){var a=Xe();return km(a,De.memoizedState,e,t)},useTransition:function(){var e=Ml(Zn)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:ir(e),t]},useSyncExternalStore:lm,useId:Mm,useHostTransitionStatus:bc,useFormState:_m,useActionState:_m,useOptimistic:function(e,t){var a=Xe();return fm(a,De,e,t)},useMemoCache:cc,useCacheRefresh:zm,useEffectEvent:jm},Pb={readContext:mt,use:Ll,useCallback:Om,useContext:mt,useEffect:gc,useImperativeHandle:Nm,useInsertionEffect:Tm,useLayoutEffect:Rm,useMemo:Cm,useReducer:dc,useRef:Sm,useState:function(){return dc(Zn)},useDebugValue:pc,useDeferredValue:function(e,t){var a=Xe();return De===null?vc(a,e,t):km(a,De.memoizedState,e,t)},useTransition:function(){var e=dc(Zn)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:ir(e),t]},useSyncExternalStore:lm,useId:Mm,useHostTransitionStatus:bc,useFormState:wm,useActionState:wm,useOptimistic:function(e,t){var a=Xe();return De!==null?fm(a,De,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:cc,useCacheRefresh:zm,useEffectEvent:jm};function xc(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:G({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var wc={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=Vt(),u=wa(r);u.payload=t,a!=null&&(u.callback=a),t=Sa(e,u,r),t!==null&&(Dt(t,e,r),er(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=Vt(),u=wa(r);u.tag=1,u.payload=t,a!=null&&(u.callback=a),t=Sa(e,u,r),t!==null&&(Dt(t,e,r),er(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Vt(),r=wa(a);r.tag=2,t!=null&&(r.callback=t),t=Sa(e,r,a),t!==null&&(Dt(t,e,a),er(t,e,a))}};function Pm(e,t,a,r,u,c,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,c,p):t.prototype&&t.prototype.isPureReactComponent?!Ki(a,r)||!Ki(u,c):!0}function Gm(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&&wc.enqueueReplaceState(t,t.state,null)}function os(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=G({},a));for(var u in e)a[u]===void 0&&(a[u]=e[u])}return a}function Vm(e){ml(e)}function Km(e){console.error(e)}function Ym(e){ml(e)}function $l(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Jm(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Sc(e,t,a){return a=wa(a),a.tag=3,a.payload={element:null},a.callback=function(){$l(e,t)},a}function Qm(e){return e=wa(e),e.tag=3,e}function Xm(e,t,a,r){var u=a.type.getDerivedStateFromError;if(typeof u=="function"){var c=r.value;e.payload=function(){return u(c)},e.callback=function(){Jm(t,a,r)}}var p=a.stateNode;p!==null&&typeof p.componentDidCatch=="function"&&(e.callback=function(){Jm(t,a,r),typeof u!="function"&&(Ca===null?Ca=new Set([this]):Ca.add(this));var _=r.stack;this.componentDidCatch(r.value,{componentStack:_!==null?_:""})})}function Gb(e,t,a,r,u){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&es(t,a,u,!0),a=gt.current,a!==null){switch(a.tag){case 31:case 13:case 19:return wt===null?oo():a.alternate===null&&Ke===0&&(Ke=3),a.flags&=-257,a.flags|=65536,a.lanes=u,r===Rl?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),lh(e,r,u)),!1;case 22:return a.flags|=65536,r===Rl?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)),lh(e,r,u)),!1}throw Error(l(435,a.tag))}return lh(e,r,u),oo(),!1}if(me)return t=gt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,r!==Pu&&(e=Error(l(422),{cause:r}),Qi(Ft(e,a)))):(r!==Pu&&(t=Error(l(423),{cause:r}),Qi(Ft(t,a))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,r=Ft(r,a),u=Sc(e.stateNode,r,u),Wu(e,u),Ke!==4&&(Ke=2)),!1;var c=Error(l(520),{cause:r});if(c=Ft(c,a),mr===null?mr=[c]:mr.push(c),Ke!==4&&(Ke=2),t===null)return!0;r=Ft(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=u&-u,a.lanes|=e,e=Sc(a.stateNode,r,e),Wu(a,e),!1;case 1:if(t=a.type,c=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Ca===null||!Ca.has(c))))return a.flags|=65536,u&=-u,a.lanes|=u,u=Qm(u),Xm(u,e,a,r),Wu(a,u),!1;break;case 22:if(a.memoizedState!==null)return a.flags|=65536,!1}a=a.return}while(a!==null);return!1}var Ec=Error(l(461)),et=!1;function at(e,t,a,r){t.child=e===null?em(t,null,a,r):rs(t,e.child,a,r)}function Zm(e,t,a,r,u){a=a.render;var c=t.ref;if("ref"in r){var p={};for(var _ in r)_!=="ref"&&(p[_]=r[_])}else p=r;return ts(t),r=rc(e,t,a,p,c,u),_=lc(),e!==null&&!et?(oc(e,t,u),Fn(e,t,u)):(me&&_&&_l(t),t.flags|=1,at(e,t,r,u),t.child)}function Fm(e,t,a,r,u){if(e===null){var c=a.type;return typeof c=="function"&&!Hu(c)&&c.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=c,Wm(e,t,c,r,u)):(e=yl(a.type,null,r,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!kc(e,u)){var p=c.memoizedProps;if(a=a.compare,a=a!==null?a:Ki,a(p,r)&&e.ref===t.ref)return Fn(e,t,u)}return t.flags|=1,e=Kn(c,r),e.ref=t.ref,e.return=t,t.child=e}function Wm(e,t,a,r,u){if(e!==null){var c=e.memoizedProps;if(Ki(c,r)&&e.ref===t.ref)if(et=!1,t.pendingProps=r=c,kc(e,u))(e.flags&131072)!==0&&(et=!0);else return t.lanes=e.lanes,Fn(e,t,u)}return jc(e,t,a,r,u)}function eg(e,t,a,r){var u=r.children,c=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(c=c!==null?c.baseLanes|a:a,e!==null){for(r=t.child=e.child,u=0;r!==null;)u=u|r.lanes|r.childLanes,r=r.sibling;r=u&~c}else r=0,t.child=null;return tg(e,t,c,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&jl(t,c!==null?c.cachePool:null),c!==null?am(t,c):tc(),sm(t);else return r=t.lanes=536870912,tg(e,t,c!==null?c.baseLanes|a:a,a,r)}else c!==null?(jl(t,c.cachePool),am(t,c),Ta(),t.memoizedState=null):(e!==null&&jl(t,null),tc(),Ta());return at(e,t,u,a),t.child}function lr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function tg(e,t,a,r,u){var c=Qu();return c=c===null?null:{parent:Fe._currentValue,pool:c},t.memoizedState={baseLanes:a,cachePool:c},e!==null&&jl(t,null),tc(),sm(t),e!==null&&es(e,t,r,!0),t.childLanes=u,null}function Il(e,t){return t=Pl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ng(e,t,a){return rs(t,e.child,null,a),e=Il(t,t.pendingProps),e.flags|=2,$t(t),t.memoizedState=null,e}function Vb(e,t,a){var r=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(me){if(r.mode==="hidden")return e=Il(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},lr(null,e);if(ac(t),(e=ze)?(e=Ap(e,tn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pa!==null?{id:Tn,overflow:Rn}:null,retryLane:536870912,hydrationErrors:null},a=Hf(e),a.return=t,t.child=a,rt=t,ze=null)):e=null,e===null)throw ya(t);return t.lanes=536870912,null}return Il(t,r)}var c=e.memoizedState;if(c!==null){var p=c.dehydrated;if(ac(t),u)if(t.flags&256)t.flags&=-257,t=ng(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(et||es(e,t,a,!1),u=(a&e.childLanes)!==0,et||u){if(Ea.current===null){if(r=Le,r!==null&&(p=$d(r,a),p!==0&&p!==c.retryLane))throw c.retryLane=p,Xa(e,p),Dt(r,e,p),Ec;oo()}t=ng(e,t,a)}else e=c.treeContext,ze=an(p.nextSibling),rt=t,me=!0,va=null,tn=!1,e!==null&&If(t,e),t=Il(t,r),t.flags|=134221824;return t}return e=Kn(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ks(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 jc(e,t,a,r,u){return ts(t),a=rc(e,t,a,r,void 0,u),r=lc(),e!==null&&!et?(oc(e,t,u),Fn(e,t,u)):(me&&r&&_l(t),t.flags|=1,at(e,t,a,u),t.child)}function ag(e,t,a,r,u,c){return ts(t),t.updateQueue=null,a=rm(t,r,a,u),im(e),r=lc(),e!==null&&!et?(oc(e,t,c),Fn(e,t,c)):(me&&r&&_l(t),t.flags|=1,at(e,t,a,c),t.child)}function sg(e,t,a,r,u){if(ts(t),t.stateNode===null){var c=Ms,p=a.contextType;typeof p=="object"&&p!==null&&(c=mt(p)),c=new a(r,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=wc,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=r,c.state=t.memoizedState,c.refs={},Zu(t),p=a.contextType,c.context=typeof p=="object"&&p!==null?mt(p):Ms,c.state=t.memoizedState,p=a.getDerivedStateFromProps,typeof p=="function"&&(xc(t,a,p,r),c.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(p=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),p!==c.state&&wc.enqueueReplaceState(c,c.state,null),nr(t,r,c,u),tr(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){c=t.stateNode;var _=t.memoizedProps,S=os(a,_);c.props=S;var U=c.context,z=a.contextType;p=Ms,typeof z=="object"&&z!==null&&(p=mt(z));var P=a.getDerivedStateFromProps;z=typeof P=="function"||typeof c.getSnapshotBeforeUpdate=="function",_=t.pendingProps!==_,z||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(_||U!==p)&&Gm(t,c,r,p),xa=!1;var k=t.memoizedState;c.state=k,nr(t,r,c,u),tr(),U=t.memoizedState,_||k!==U||xa?(typeof P=="function"&&(xc(t,a,P,r),U=t.memoizedState),(S=xa||Pm(t,a,S,r,k,U,p))?(z||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=U),c.props=r,c.state=U,c.context=p,r=S):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{c=t.stateNode,Fu(e,t),p=t.memoizedProps,z=os(a,p),c.props=z,P=t.pendingProps,k=c.context,U=a.contextType,S=Ms,typeof U=="object"&&U!==null&&(S=mt(U)),_=a.getDerivedStateFromProps,(U=typeof _=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(p!==P||k!==S)&&Gm(t,c,r,S),xa=!1,k=t.memoizedState,c.state=k,nr(t,r,c,u),tr();var M=t.memoizedState;p!==P||k!==M||xa||e!==null&&e.dependencies!==null&&Sl(e.dependencies)?(typeof _=="function"&&(xc(t,a,_,r),M=t.memoizedState),(z=xa||Pm(t,a,z,r,k,M,S)||e!==null&&e.dependencies!==null&&Sl(e.dependencies))?(U||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(r,M,S),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(r,M,S)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||p===e.memoizedProps&&k===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&k===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=M),c.props=r,c.state=M,c.context=S,r=z):(typeof c.componentDidUpdate!="function"||p===e.memoizedProps&&k===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&k===e.memoizedState||(t.flags|=1024),r=!1)}return c=r,Ks(e,t),r=(t.flags&128)!==0,c||r?(c=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&r?(t.child=rs(t,e.child,null,u),t.child=rs(t,null,a,u)):at(e,t,a,u),t.memoizedState=c.state,e=t.child):e=Fn(e,t,u),e}function ig(e,t,a,r){return Fa(),t.flags|=256,at(e,t,a,r),t.child}var Tc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Rc(e){return{baseLanes:e,cachePool:Jf()}}function Ac(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Gt),e}function rg(e,t,a){var r=t.pendingProps,u=!1,c=(t.flags&128)!==0,p;if((p=c)||(p=e!==null&&e.memoizedState===null?!1:(pt.current&2)!==0),p&&(u=!0,t.flags&=-129),p=(t.flags&32)!==0,t.flags&=-33,e===null){if(me){if(u?ja(t):Ta(),(e=ze)?(e=Ap(e,tn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pa!==null?{id:Tn,overflow:Rn}:null,retryLane:536870912,hydrationErrors:null},a=Hf(e),a.return=t,t.child=a,rt=t,ze=null)):e=null,e===null)throw ya(t);return Rh(e)?t.lanes=32:t.lanes=536870912,null}return c=r.children,r=r.fallback,u?(Ta(),u=t.mode,c=Pl({mode:"hidden",children:c},u),r=Za(r,u,a,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Rc(a),r.childLanes=Ac(e,p,a),t.memoizedState=Tc,lr(null,r)):(ja(t),Nc(t,c))}var _=e.memoizedState;if(_!==null){var S=_.dehydrated;if(S!==null)return Kb(e,t,c,p,r,S,_,a)}return u?(Ta(),u=r.fallback,c=t.mode,_=e.child,S=_.sibling,r=Kn(_,{mode:"hidden",children:r.children}),r.subtreeFlags=_.subtreeFlags&1206910976,S!==null?u=Kn(S,u):(u=Za(u,c,a,null),u.flags|=2),u.return=t,r.return=t,r.sibling=u,t.child=r,lr(null,r),r=t.child,u=e.child.memoizedState,u===null?u=Rc(a):(c=u.cachePool,c!==null?(_=Fe._currentValue,c=c.parent!==_?{parent:_,pool:_}:c):c=Jf(),u={baseLanes:u.baseLanes|a,cachePool:c}),r.memoizedState=u,r.childLanes=Ac(e,p,a),t.memoizedState=Tc,lr(e.child,r)):(ja(t),a=e.child,e=a.sibling,a=Kn(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(p=t.deletions,p===null?(t.deletions=[e],t.flags|=16):p.push(e)),t.child=a,t.memoizedState=null,a)}function Nc(e,t){return t=Pl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Pl(e,t){return e=Nt(22,e,null,t),e.lanes=0,e}function Gl(e,t,a){return rs(t,e.child,null,a),e=Nc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Kb(e,t,a,r,u,c,p,_){if(a)return t.flags&256?(ja(t),t.flags&=-257,Gl(e,t,_)):t.memoizedState!==null?(Ta(),t.child=e.child,t.flags|=128,null):(Ta(),c=u.fallback,p=t.mode,u=Pl({mode:"visible",children:u.children},p),c=Za(c,p,_,null),c.flags|=2,u.return=t,c.return=t,u.sibling=c,t.child=u,rs(t,e.child,null,_),u=t.child,u.memoizedState=Rc(_),u.childLanes=Ac(e,r,_),t.memoizedState=Tc,lr(null,u));if(ja(t),Rh(c)){if(r=c.nextSibling&&c.nextSibling.dataset,r)var S=r.dgst;return r=S,r!==""&&(u=Error(l(419)),u.stack="",u.digest=r,Qi({value:u,source:null,stack:null})),Gl(e,t,_)}if(et||es(e,t,_,!1),r=(_&e.childLanes)!==0,et||r){if(Ea.current!==null)return Gl(e,t,_);if(r=Le,r!==null&&(u=$d(r,_),u!==0&&u!==p.retryLane))throw p.retryLane=u,Xa(e,u),Dt(r,e,u),Ec;return Th(c)||oo(),Gl(e,t,_)}return Th(c)?(t.flags|=192,t.child=e.child,null):(e=p.treeContext,ze=an(c.nextSibling),rt=t,me=!0,va=null,tn=!1,e!==null&&If(t,e),t=Nc(t,u.children),t.flags|=134221824,t)}function lg(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),wl(e.return,t,a)}function og(e){for(var t=null;e!==null;){var a=e.alternate;a!==null&&Cl(a)===null&&(t=e),e=e.sibling}return t}function Vl(e,t,a,r,u,c){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:u,treeForkCount:c}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=r,p.tail=a,p.tailMode=u,p.treeForkCount=c)}function Oc(e){var t=e.child;for(e.child=null;t!==null;){var a=t.sibling;t.sibling=e.child,e.child=t,t=a}}function Cc(e,t,a){var r=t.pendingProps,u=r.revealOrder,c=r.tail;r=r.children;var p=pt.current;if(t.flags&128)return ar(t,p),null;var _=(p&2)!==0;if(_?(p=p&1|2,t.flags|=128):p&=1,ar(t,p),u==="backwards"&&e!==null?(Oc(e),at(e,t,r,a),Oc(e)):at(e,t,r,a),r=me?Ji:0,!_&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&lg(e,a,t);else if(e.tag===19)lg(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(u){case"backwards":a=og(t.child),a===null?(u=t.child,t.child=null):(u=a.sibling,a.sibling=null,Oc(t)),Vl(t,!0,u,null,c,r);break;case"unstable_legacy-backwards":for(a=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Cl(e)===null){t.child=u;break}e=u.sibling,u.sibling=a,a=u,u=e}Vl(t,!0,a,null,c,r);break;case"together":Vl(t,!1,null,null,void 0,r);break;case"independent":t.memoizedState=null;break;default:a=og(t.child),a===null?(u=t.child,t.child=null):(u=a.sibling,a.sibling=null),Vl(t,!1,u,a,c,r)}return t.child}function ug(e,t,a){var r=t.pendingProps;return ba(t,t.type,r.value),at(e,t,r.children,a),t.child}function Fn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Oa|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(es(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=Kn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Kn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function kc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Sl(e)))}function Yb(e,t,a){switch(t.tag){case 3:Xr(t,t.stateNode.containerInfo),ba(t,Fe,e.memoizedState.cache),Fa();break;case 27:case 5:iu(t);break;case 4:Xr(t,t.stateNode.containerInfo);break;case 10:ba(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ac(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return ja(t),t.flags|=128,null;r=es(e,t,a,!1);var u=t.child.childLanes;return r||(a&u)!==0?rg(e,t,a):(ja(t),e=Fn(e,t,a),e!==null?e.sibling:null)}ja(t);break;case 19:if(t.flags&128)return Cc(e,t,a);if(u=(e.flags&128)!==0,r=(a&t.childLanes)!==0,r||(es(e,t,a,!1),r=(a&t.childLanes)!==0),u){if(r)return Cc(e,t,a);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ar(t,pt.current),r)break;return null;case 22:return t.lanes=0,eg(e,t,a,t.pendingProps);case 24:ba(t,Fe,e.memoizedState.cache)}return Fn(e,t,a)}function cg(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)et=!0;else{if(!kc(e,a)&&(t.flags&128)===0)return et=!1,Yb(e,t,a);et=(e.flags&131072)!==0}else et=!1,me&&(t.flags&1048576)!==0&&$f(t,Ji,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=ss(t.elementType),t.type=e,typeof e=="function")Hu(e)?(r=os(e,r),t.tag=1,t=sg(null,t,e,r,a)):(t.tag=0,t=jc(null,t,e,r,a));else{if(e!=null){var u=e.$$typeof;if(u===q){t.tag=11,t=Zm(null,t,e,r,a);break e}else if(u===Ue){t.tag=14,t=Fm(null,t,e,r,a);break e}else if(u===K){t.tag=10,t.type=e,t=ug(null,t,a);break e}}throw t=Se(e)||e,Error(l(306,t,""))}}return t;case 0:return jc(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,u=os(r,t.pendingProps),sg(e,t,r,u,a);case 3:e:{if(Xr(t,t.stateNode.containerInfo),e===null)throw Error(l(387));r=t.pendingProps;var c=t.memoizedState;u=c.element,Fu(e,t),nr(t,r,null,a);var p=t.memoizedState;if(r=p.cache,ba(t,Fe,r),r!==c.cache&&Ku(t,[Fe],a,!0),tr(),r=p.element,c.isDehydrated)if(c={element:r,isDehydrated:!1,cache:p.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=ig(e,t,r,a);break e}else if(r!==u){u=Ft(Error(l(424)),t),Qi(u),t=ig(e,t,r,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ze=an(e.firstChild),rt=t,me=!0,va=null,tn=!0,a=em(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|134221824,a=a.sibling}else{if(Fa(),r===u){t=Fn(e,t,a);break e}at(e,t,r,a)}t=t.child}return t;case 26:return Ks(e,t),e===null?(a=Lp(t.type,null,t.pendingProps,null))?t.memoizedState=a:me||(t.stateNode=mp(t.type,t.pendingProps,ha.current,t)):t.memoizedState=Lp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return iu(t),e===null&&me&&(r=t.stateNode=Cp(t.type,t.pendingProps,ha.current),rt=t,tn=!0,u=ze,Ua(t.type)?(Ah=u,ze=an(r.firstChild)):ze=u),at(e,t,t.pendingProps.children,a),Ks(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&me&&((u=r=ze)&&(r=$_(r,t.type,t.pendingProps,tn),r!==null?(t.stateNode=r,rt=t,ze=an(r.firstChild),tn=!1,u=!0):u=!1),u||ya(t)),iu(t),u=t.type,c=t.pendingProps,p=e!==null?e.memoizedProps:null,r=c.children,bh(u,c)?r=null:p!==null&&bh(u,p)&&(t.flags|=32),t.memoizedState!==null&&(u=rc(e,t,Mb,null,null,a),ci._currentValue=u),Ks(e,t),at(e,t,r,a),t.child;case 6:return e===null&&me&&((e=a=ze)&&(a=I_(a,t.pendingProps,tn),a!==null?(t.stateNode=a,rt=t,ze=null,e=!0):e=!1),e||ya(t)),null;case 13:return rg(e,t,a);case 4:return Xr(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=rs(t,null,r,a):at(e,t,r,a),t.child;case 11:return Zm(e,t,t.type,t.pendingProps,a);case 7:return r=t.pendingProps,Ks(e,t),at(e,t,r,a),t.child;case 8:return at(e,t,t.pendingProps.children,a),t.child;case 12:return at(e,t,t.pendingProps.children,a),t.child;case 10:return ug(e,t,a);case 9:return u=t.type._context,r=t.pendingProps.children,ts(t),u=mt(u),r=r(u),t.flags|=1,at(e,t,r,a),t.child;case 14:return Fm(e,t,t.type,t.pendingProps,a);case 15:return Wm(e,t,t.type,t.pendingProps,a);case 19:return Cc(e,t,a);case 31:return Vb(e,t,a);case 22:return eg(e,t,a,t.pendingProps);case 24:return ts(t),r=mt(Fe),e===null?(u=Qu(),u===null&&(u=Le,c=Yu(),u.pooledCache=c,c.refCount++,c!==null&&(u.pooledCacheLanes|=a),u=c),t.memoizedState={parent:r,cache:u},Zu(t),ba(t,Fe,u)):((e.lanes&a)!==0&&(Fu(e,t),nr(t,null,null,a),tr()),u=e.memoizedState,c=t.memoizedState,u.parent!==r?(u={parent:r,cache:r},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),ba(t,Fe,r)):(r=c.cache,ba(t,Fe,r),r!==u.cache&&Ku(t,[Fe],a,!0))),at(e,t,t.pendingProps.children,a),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!=="auto"?t.flags|=e===null?18882560:18874368:me&&_l(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Ks(e,t),at(e,t,r.children,a),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function Wn(e){e.flags|=4}function Dc(e,t,a,r,u){var c;if((c=(e.mode&32)!==0)&&(c=a===null?Hp(t,r):Hp(t,r)&&(r.src!==a.src||r.srcSet!==a.srcSet)),c){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Vg())e.flags|=8192;else throw is=Rl,Xu}else e.flags&=-16777217}function hg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!qp(t))if(Vg())e.flags|=8192;else throw is=Rl,Xu}function Kl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Bd():536870912,e.lanes|=t,Zs|=t)}function or(e,t){if(!me)switch(e.tailMode){case"visible":break;case"collapsed":for(var a=e.tail,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;break;default:for(t=e.tail,a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null}}function Be(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var u=e.child;u!==null;)a|=u.lanes|u.childLanes,r|=u.subtreeFlags&1206910976,r|=u.flags&1206910976,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)a|=u.lanes|u.childLanes,r|=u.subtreeFlags,r|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function Jb(e,t,a){var r=t.pendingProps;switch(Iu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Be(t),null;case 1:return Be(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Qn(Fe),Ss(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Hs(t)?Wn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Gu())),Be(t),null;case 26:var u=t.type,c=t.memoizedState;return e===null?(Wn(t),c!==null?(Be(t),hg(t,c)):(Be(t),Dc(t,u,null,r,a))):c?c!==e.memoizedState?(Wn(t),Be(t),hg(t,c)):(Be(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Wn(t),Be(t),Dc(t,u,e,r,a)),null;case 27:if(Zr(t),a=ha.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Wn(t);else{if(!r){if(t.stateNode===null)throw Error(l(166));return Be(t),t.subtreeFlags&=-33554433,null}e=En.current,Hs(t)?Pf(t):(e=Cp(u,r,a),t.stateNode=e,Wn(t))}return Be(t),t.subtreeFlags&=-33554433,null;case 5:if(Zr(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Wn(t);else{if(!r){if(t.stateNode===null)throw Error(l(166));return Be(t),t.subtreeFlags&=-33554433,null}if(c=En.current,Hs(t))Pf(t);else{var p=br(ha.current);switch(c){case 1:c=p.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:c=p.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":c=p.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":c=p.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":c=p.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof r.is=="string"?p.createElement("select",{is:r.is}):p.createElement("select"),r.multiple?c.multiple=!0:r.size&&(c.size=r.size);break;default:c=typeof r.is=="string"?p.createElement(u,{is:r.is}):p.createElement(u)}}c[ft]=t,c[At]=r;e:for(p=t.child;p!==null;){if(p.tag===5||p.tag===6)c.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===t)break e;for(;p.sibling===null;){if(p.return===null||p.return===t)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}t.stateNode=c;e:switch(yt(c,u,r),u){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Wn(t)}}return Be(t),t.subtreeFlags&=-33554433,Dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Wn(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(l(166));if(e=ha.current,Hs(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,u=rt,u!==null)switch(u.tag){case 27:case 5:r=u.memoizedProps}e[ft]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||cp(e.nodeValue,a)),e||ya(t,!0)}else e=br(e).createTextNode(r),e[ft]=t,t.stateNode=e}return Be(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hs(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[ft]=t}else Fa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Be(t),e=!1}else a=Gu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?($t(t),t):($t(t),null);if((t.flags&128)!==0)throw Error(l(558))}return Be(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Hs(t),r!==null&&r.dehydrated!==null){if(e===null){if(!u)throw Error(l(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(l(317));u[ft]=t}else Fa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Be(t),u=!1}else u=Gu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?($t(t),t):($t(t),null)}return $t(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,u=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(u=r.alternate.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==u&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Kl(t,t.updateQueue),Be(t),null);case 4:return Ss(),e===null&&mh(t.stateNode.containerInfo),t.flags|=67108864,Be(t),null;case 10:return Qn(t.type),Be(t),null;case 19:if(sc(t),r=t.memoizedState,r===null)return Be(t),null;if(u=(t.flags&128)!==0,c=r.rendering,c===null)if(u)or(r,!1);else{if(Ke!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Cl(e),c!==null){for(t.flags|=128,or(r,!1),e=c.updateQueue,t.updateQueue=e,Kl(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Bf(a,e),a=a.sibling;return ar(t,pt.current&1|2),me&&Yn(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Mt()>so&&(t.flags|=128,u=!0,or(r,!1),t.lanes=4194304)}else{if(!u)if(e=Cl(c),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Kl(t,e),or(r,!0),r.tail===null&&r.tailMode!=="collapsed"&&r.tailMode!=="visible"&&!c.alternate&&!me)return Be(t),null}else 2*Mt()-r.renderingStartTime>so&&a!==536870912&&(t.flags|=128,u=!0,or(r,!1),t.lanes=4194304);r.isBackwards?(c.sibling=t.child,t.child=c):(e=r.last,e!==null?e.sibling=c:t.child=c,r.last=c)}if(r.tail!==null){e=r.tail;e:{for(a=e;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Mt(),e.sibling=null,c=pt.current,c=u?c&1|2:c&1,r.tailMode==="visible"||r.tailMode==="collapsed"||!a||me?ar(t,c):(a=c,Me(gt,t),Me(pt,a),wt===null&&(wt=t)),me&&Yn(t,r.treeForkCount),e}return Be(t),null;case 22:case 23:return $t(t),nc(),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&&(Be(t),t.subtreeFlags&6&&(t.flags|=8192)):Be(t),a=t.updateQueue,a!==null&&Kl(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&&dt(as),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Qn(Fe),Be(t),null;case 25:return null;case 30:return t.flags|=33554432,Be(t),null}throw Error(l(156,t.tag))}function Qb(e,t){switch(Iu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qn(Fe),Ss(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Zr(t),null;case 31:if(t.memoizedState!==null){if($t(t),t.alternate===null)throw Error(l(340));Fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if($t(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));Fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return sc(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ss(),null;case 10:return Qn(t.type),null;case 22:case 23:return $t(t),nc(),e!==null&&dt(as),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qn(Fe),null;case 25:return null;default:return null}}function dg(e,t){switch(Iu(t),t.tag){case 3:Qn(Fe),Ss();break;case 26:case 27:case 5:Zr(t);break;case 4:Ss();break;case 31:t.memoizedState!==null&&$t(t);break;case 13:$t(t);break;case 19:sc(t);break;case 10:Qn(t.type);break;case 22:case 23:$t(t),nc(),e!==null&&dt(as);break;case 24:Qn(Fe)}}function ur(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var u=r.next;a=u;do{if((a.tag&e)===e){r=void 0;var c=a.create,p=a.inst;r=c(),p.destroy=r}a=a.next}while(a!==u)}}catch(_){Ce(t,t.return,_)}}function Ra(e,t,a){try{var r=t.updateQueue,u=r!==null?r.lastEffect:null;if(u!==null){var c=u.next;r=c;do{if((r.tag&e)===e){var p=r.inst,_=p.destroy;if(_!==void 0){p.destroy=void 0,u=t;var S=a,U=_;try{U()}catch(z){Ce(u,S,z)}}}r=r.next}while(r!==c)}}catch(z){Ce(t,t.return,z)}}function fg(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{nm(t,a)}catch(r){Ce(e,e.return,r)}}}function mg(e,t,a){a.props=os(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){Ce(e,t,r)}}function An(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:var u=e.stateNode,c=Gn(e.memoizedProps,u);(u.ref===null||u.ref.name!==c)&&(u.ref=xp(c)),r=u.ref;break;case 7:if(e.stateNode===null){var p=new Kt(e);y(e.child,!1,H_,p,void 0,void 0),e.stateNode=p}r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(_){Ce(e,t,_)}}function vt(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(u){Ce(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){Ce(e,t,u)}else a.current=null}function Yl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var a=0;a<t.length;a++)Rp(e.stateNode,t[a])}function gg(e){for(var t=e.return;t!==null&&(Lc(t)&&Rp(e.stateNode,t.stateNode),!Uc(t));)t=t.return}function cr(e){for(var t=e.return;t!==null&&(Lc(t)&&q_(e.stateNode,t.stateNode),!Uc(t));)t=t.return}function Uc(e){return e.tag===5||e.tag===3||e.tag===27}function Lc(e){return e&&e.tag===7&&e.stateNode!==null}function Mc(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(u){Ce(e,e.return,u)}}function zc(e,t,a){try{var r=e.stateNode;x_(r,e.type,a,t),r[At]=t}catch(u){Ce(e,e.return,u)}}function pg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ua(e.type)||e.tag===4}function Bc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||pg(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&&Ua(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 Hc(e,t,a,r){var u=e.tag;if(u===5||u===6)u=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(u,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(u),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=jn)),Yl(e,r),Ee=!0;else if(u!==4&&(u===27&&(Yl(e,r),r=null,Ua(e.type)&&(a=e.stateNode,t=null)),e=e.child,e!==null))for(Hc(e,t,a,r),e=e.sibling;e!==null;)Hc(e,t,a,r),e=e.sibling}function Jl(e,t,a,r){var u=e.tag;if(u===5||u===6)u=e.stateNode,t?a.insertBefore(u,t):a.appendChild(u),Yl(e,r),Ee=!0;else if(u!==4&&(u===27&&(Yl(e,r),r=null,Ua(e.type)&&(a=e.stateNode)),e=e.child,e!==null))for(Jl(e,t,a,r),e=e.sibling;e!==null;)Jl(e,t,a,r),e=e.sibling}function vg(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);yt(t,r,a),t[ft]=e,t[At]=a}catch(c){Ce(e,e.return,c)}}var Ql=!1,It=null;function yg(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Ql=!0)}var Nn=null;function bg(){var e=Nn;return Nn=null,e}var Ot=0;function Ys(e,t,a,r,u){return Ot=0,_g(e.child,t,a,r,u)}function _g(e,t,a,r,u){for(var c=!1;e!==null;){if(e.tag===5){var p=e.stateNode;if(r!==null){var _=wh(p);r.push(_),_.view&&(c=!0)}else c||wh(p).view&&(c=!0);Ql=!0,bp(p,Ot===0?t:t+"_"+Ot,a),Ot++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&u||_g(e.child,t,a,r,u)&&(c=!0));e=e.sibling}return c}function On(e,t){for(;e!==null;)e.tag===5?_p(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||On(e.child,t)),e=e.sibling}function Xl(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Xl(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(l(544));var a=t.name;t=Vn(t.default,t.share),t!=="none"&&(Ys(e,a,t,null,!1)||On(e.child,!1))}e=e.sibling}}function qc(e,t){if(e.tag===30){var a=e.stateNode,r=e.memoizedProps,u=Gn(r,a),c=Vn(r.default,a.paired?r.share:r.enter);c!=="none"?Ys(e,u,c,null,!1)?(Xl(e),a.paired||t||ti(e,r.onEnter)):On(e.child,!1):Xl(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)qc(e,t),e=e.sibling;else Xl(e)}function $c(e){if(It!==null&&It.size!==0){var t=It;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var a=e.memoizedProps,r=a.name;if(r!=null&&r!=="auto"){var u=t.get(r);if(u!==void 0){var c=Vn(a.default,a.share);if(c!=="none"&&(Ys(e,r,c,null,!1)?(c=e.stateNode,u.paired=c,c.paired=u,ti(e,a.onShare)):On(e.child,!1)),t.delete(r),t.size===0)break}}}$c(e)}e=e.sibling}}}function Ic(e){if(e.tag===30){var t=e.memoizedProps,a=Gn(t,e.stateNode),r=It!==null?It.get(a):void 0,u=Vn(t.default,r!==void 0?t.share:t.exit);u!=="none"&&(Ys(e,a,u,null,!1)?r!==void 0?(u=e.stateNode,r.paired=u,u.paired=r,It.delete(a),ti(e,t.onShare)):ti(e,t.onExit):On(e.child,!1)),It!==null&&$c(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Ic(e),e=e.sibling;else It!==null&&$c(e)}function xg(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,a=Gn(t,e.stateNode);t=Vn(t.default,t.update),e.flags&=-5,t!=="none"&&Ys(e,a,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&xg(e);e=e.sibling}}function Pc(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,On(e.child,!1))}Pc(e)}e=e.sibling}}function Zl(e){if(e.tag===30)e.stateNode.paired=null,On(e.child,!1),Pc(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Zl(e),e=e.sibling;else Pc(e)}function wg(e){for(e=e.child;e!==null;)e.tag===30?On(e.child,!1):(e.subtreeFlags&33554432)!==0&&wg(e),e=e.sibling}function Gc(e,t,a,r,u,c,p){for(var _=!1;t!==null;){if(t.tag===5){var S=t.stateNode;if(c!==null&&Ot<c.length){var U=c[Ot],z=wh(S);(U.view||z.view)&&(_=!0);var P;if(P=(e.flags&4)===0)if(z.clip)P=!0;else{P=U.rect;var k=z.rect;P=P.y!==k.y||P.x!==k.x||P.height!==k.height||P.width!==k.width}P&&(e.flags|=4),z.abs?z=!U.abs:(U=U.rect,z=z.rect,z=U.height!==z.height||U.width!==z.width),z&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&bp(S,Ot===0?a:a+"_"+Ot,u),_&&(e.flags&4)!==0||(Nn===null&&(Nn=[]),Nn.push(S,Ot===0?r:r+"_"+Ot,t.memoizedProps)),Ot++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&p?e.flags|=t.flags&32:Gc(e,t.child,a,r,u,c,p)&&(_=!0));t=t.sibling}return _}function Sg(e,t){for(e=e.child;e!==null;){if(e.tag===30){var a=e.memoizedProps,r=e.stateNode,u=Gn(a,r),c=Vn(a.default,a.update),p;p=e.memoizedState,e.memoizedState=null,r=e;var _=e.child;Ot=0,u=Gc(r,_,u,u,c,p,!1),(e.flags&4)!==0&&u&&ti(e,a.onUpdate)}else(e.subtreeFlags&33554432)!==0&&Sg(e);e=e.sibling}}var lt=!1,Ae=!1,Cn=!1,Vc=!1,Eg=typeof WeakSet=="function"?WeakSet:Set,ot=null,kn=!1,hr=!1,Fl=!1,Kc=!1;function Xb(e,t,a){if(e=e.containerInfo,vh=hi,e=Af(e),ku(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var u=r.getSelection&&r.getSelection();if(u&&u.rangeCount!==0){r=u.anchorNode;var c=u.anchorOffset,p=u.focusNode;u=u.focusOffset;try{r.nodeType,p.nodeType}catch{r=null;break e}var _=0,S=-1,U=-1,z=0,P=0,k=e,M=null;t:for(;;){for(var J;k!==r||c!==0&&k.nodeType!==3||(S=_+c),k!==p||u!==0&&k.nodeType!==3||(U=_+u),k.nodeType===3&&(_+=k.nodeValue.length),(J=k.firstChild)!==null;)M=k,k=J;for(;;){if(k===e)break t;if(M===r&&++z===c&&(S=_),M===p&&++P===u&&(U=_),(J=k.nextSibling)!==null)break;k=M,M=k.parentNode}k=J}r=S===-1||U===-1?null:{start:S,end:U}}else r=null}r=r||{start:0,end:0}}else r=null;for(yh={focusedElem:e,selectionRange:r},hi=!1,a=(a&335544064)===a,ot=t,t=a?9270:1024;ot!==null;){if(e=ot,a&&(r=e.deletions,r!==null))for(c=0;c<r.length;c++)a&&Ic(r[c]);if(e.alternate===null&&(e.flags&2)!==0)a&&yg(e),Wl(a);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&a&&Ic(r),Wl(a);continue}else if(r!==null&&r.memoizedState!==null){a&&yg(e),Wl(a);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,ot=r):(a&&xg(e),Wl(a))}}It=null}function Wl(e){for(;ot!==null;){var t=ot,a=e,r=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((u&1024)!==0&&r!==null){a=void 0,u=r.memoizedProps,r=r.memoizedState;var c=t.stateNode;try{var p=os(t.type,u);a=c.getSnapshotBeforeUpdate(p,r),c.__reactInternalSnapshotBeforeUpdate=a}catch(_){Ce(t,t.return,_)}}break;case 3:if((u&1024)!==0){if(r=t.stateNode.containerInfo,a=r.nodeType,a===9)jh(r);else if(a===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":jh(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:a&&r!==null&&(a=Gn(r.memoizedProps,r.stateNode),u=t.memoizedProps,u=Vn(u.default,u.update),u!=="none"&&Ys(r,a,u,r.memoizedState=[],!0));break;default:if((u&1024)!==0)throw Error(l(163))}if(r=t.sibling,r!==null){r.return=t.return,ot=r;break}ot=t.return}}function jg(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Dn(e,a),r&4&&ur(5,a);break;case 1:if(Dn(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(p){Ce(a,a.return,p)}else{var u=os(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(p){Ce(a,a.return,p)}}r&64&&fg(a),r&512&&An(a,a.return);break;case 3:if(Dn(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{nm(e,t)}catch(p){Ce(a,a.return,p)}}break;case 27:t===null&&r&4&&vg(a);case 26:case 5:Dn(e,a),t===null&&r&4&&Mc(a),r&512&&An(a,a.return);break;case 12:Dn(e,a);break;case 31:Dn(e,a),r&4&&Ng(e,a);break;case 13:Dn(e,a),r&4&&Og(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=o_.bind(null,a),P_(e,a))));break;case 22:if(r=a.memoizedState!==null||lt,!r){var c=t!==null&&t.memoizedState!==null||Ae;t=lt,u=Ae,lt=r,(Ae=c)&&!u?(r=2,(a.subtreeFlags&8772)!==0&&(r|=1),dn(e,a,r)):Dn(e,a),lt=t,Ae=u}break;case 30:Dn(e,a),r&512&&An(a,a.return);break;case 7:r&512&&An(a,a.return);default:Dn(e,a)}}function Yc(e,t){for(e=e.child;e!==null;)Tg(e,t),e=e.sibling}function Tg(e,t){switch(e.tag){case 5:case 26:try{var a=e.stateNode;if(t){var r=a.style;typeof r.setProperty=="function"?r.setProperty("display","none","important"):r.display="none"}else{var u=e.stateNode,c=e.memoizedProps.style,p=c!=null&&c.hasOwnProperty("display")?c.display:null;u.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(S){Ce(e,e.return,S)}Jc(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Ee=!0}catch(S){Ce(e,e.return,S)}break;case 18:try{var _=e.stateNode;t?yp(_,!0):yp(e.stateNode,!1)}catch(S){Ce(e,e.return,S)}break;case 22:case 23:e.memoizedState===null&&Yc(e,t);break;default:Yc(e,t)}}function Jc(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var a=e,r=t;switch(a.tag){case 4:Tg(a,r);break e;case 22:a.memoizedState===null&&Jc(a,r);break e;default:Jc(a,r)}}e=e.sibling}}function Rg(e){var t=e.alternate;t!==null&&(e.alternate=null,Rg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&sl(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 Ie=null,Ct=!1;function cn(e,t,a){for(a=a.child;a!==null;)Ag(e,t,a),a=a.sibling}function Ag(e,t,a){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(Ui,a)}catch{}switch(a.tag){case 26:Ae||vt(a,t),cn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&!Ae&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ae||vt(a,t),cr(a);var r=Ie,u=Ct;Ua(a.type)&&(Ie=a.stateNode,Ct=!1),cn(e,t,a),kp(a.stateNode,a.type,a.memoizedProps),Ie=r,Ct=u;break;case 5:Ae||vt(a,t),cr(a);case 6:if(a.tag===6&&cr(a),r=Ie,u=Ct,Ie=null,cn(e,t,a),Ie=r,Ct=u,Ie!==null)if(Ct)try{(Ie.nodeType===9?Ie.body:Ie.nodeName==="HTML"?Ie.ownerDocument.body:Ie).removeChild(a.stateNode),Ee=!0}catch(c){Ce(a,t,c)}else try{Ie.removeChild(a.stateNode),Ee=!0}catch(c){Ce(a,t,c)}break;case 18:Ie!==null&&(Ct?(e=Ie,vp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),di(e)):vp(Ie,a.stateNode));break;case 4:r=Ie,u=Ct,Ie=a.stateNode.containerInfo,Ct=!0,cn(e,t,a),Ie=r,Ct=u;break;case 0:case 11:case 14:case 15:Ra(2,a,t),Ae||Ra(4,a,t),cn(e,t,a);break;case 1:Ae||(vt(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&mg(a,t,r)),cn(e,t,a);break;case 21:cn(e,t,a);break;case 22:Ae=(r=Ae)||a.memoizedState!==null,cn(e,t,a),Ae=r;break;case 30:vt(a,t),cn(e,t,a);break;case 7:Ae||vt(a,t),cn(e,t,a);break;default:cn(e,t,a)}}function Ng(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{di(e)}catch(a){Ce(t,t.return,a)}}}function Og(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{di(e)}catch(a){Ce(t,t.return,a)}}function Zb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Eg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Eg),t;default:throw Error(l(435,e.tag))}}function eo(e,t){var a=Zb(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var u=u_.bind(null,e,r);r.then(u,u)}})}function Tt(e,t,a){var r=t.deletions;if(r!==null)for(var u=0;u<r.length;u++){var c=r[u],p=e,_=t,S=_;e:for(;S!==null;){switch(S.tag){case 27:if(Ua(S.type)){Ie=S.stateNode,Ct=!1;break e}break;case 5:Ie=S.stateNode,Ct=!1;break e;case 3:case 4:Ie=S.stateNode.containerInfo,Ct=!0;break e}S=S.return}if(Ie===null)throw Error(l(160));Ag(p,_,c),Ie=null,Ct=!1,p=c.alternate,p!==null&&(p.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Cg(t,e,a),t=t.sibling}var hn=null;function Cg(e,t,a){var r=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(u&4&&(r=e.updateQueue,r=r!==null?r.events:null,r!==null))for(var c=0;c<r.length;c++){var p=r[c];p.ref.impl=p.nextImpl}Tt(t,e,a),Rt(e),u&4&&(Ra(3,e,e.return),ur(3,e),Ra(5,e,e.return));break;case 1:Tt(t,e,a),Rt(e),u&512&&(Ae||r===null||vt(r,r.return)),u&64&<&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?t:a.concat(t))));break;case 26:if(c=hn,Tt(t,e,a),Rt(e),u&512&&(Ae||r===null||vt(r,r.return)),u&4)if(u=r!==null?r.memoizedState:null,a=e.memoizedState,r===null)if(a===null)if(e.stateNode===null)if(lt)e.stateNode=mp(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,a=e.memoizedProps,u=c.ownerDocument||c;t:switch(t){case"title":r=u.getElementsByTagName("title")[0],(!r||r[zi]||r[ft]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=u.createElement(t),u.head.insertBefore(r,u.querySelector("head > title"))),yt(r,t,a),r[ft]=e,it(r),t=r;break e;case"link":if(c=Bp("link","href",u).get(t+(a.href||""))){for(p=0;p<c.length;p++)if(r=c[p],r.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&r.getAttribute("rel")===(a.rel==null?null:a.rel)&&r.getAttribute("title")===(a.title==null?null:a.title)&&r.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){c.splice(p,1);break t}}r=u.createElement(t),yt(r,t,a),u.head.appendChild(r);break;case"meta":if(c=Bp("meta","content",u).get(t+(a.content||""))){for(p=0;p<c.length;p++)if(r=c[p],r.getAttribute("content")===(a.content==null?null:""+a.content)&&r.getAttribute("name")===(a.name==null?null:a.name)&&r.getAttribute("property")===(a.property==null?null:a.property)&&r.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&r.getAttribute("charset")===(a.charSet==null?null:a.charSet)){c.splice(p,1);break t}}r=u.createElement(t),yt(r,t,a),u.head.appendChild(r);break;default:throw Error(l(468,t))}r[ft]=e,it(r),t=r}e.stateNode=t}else lt||kh(c,e.type,e.stateNode);else e.stateNode=zp(c,a,e.memoizedProps);else u!==a?(u===null?(t=r.stateNode,t===null||Ae||t.parentNode.removeChild(t)):u.count--,a===null?lt||kh(c,e.type,e.stateNode):zp(c,a,e.memoizedProps)):a===null&&e.stateNode!==null&&zc(e,e.memoizedProps,r.memoizedProps);break;case 27:Tt(t,e,a),Rt(e),u&512&&(Ae||r===null||vt(r,r.return)),r!==null&&u&4&&zc(e,e.memoizedProps,r.memoizedProps);break;case 5:if(c=Cn,Cn=!1,Tt(t,e,a),Cn=c,Rt(e),u&512&&(Ae||r===null||vt(r,r.return)),e.flags&32){t=e.stateNode;try{Ns(t,""),Ee=!0}catch(z){Ce(e,e.return,z)}}u&4&&e.stateNode!=null&&(t=e.memoizedProps,zc(e,t,r!==null?r.memoizedProps:t)),u&1024&&(Vc=!0);break;case 6:if(Tt(t,e,a),Rt(e),u&4){if(e.stateNode===null)throw Error(l(162));t=e.memoizedProps,a=e.stateNode;try{a.nodeValue=t,Ee=!0}catch(z){Ce(e,e.return,z)}}break;case 3:if(Ee=!1,po=null,c=hn,hn=_r(t.containerInfo),Tt(t,e,a),hn=c,Rt(e),u&4&&r!==null&&r.memoizedState.isDehydrated)try{di(t.containerInfo)}catch(z){Ce(e,e.return,z)}Vc&&(Vc=!1,kg(e)),Ee=!1;break;case 4:u=Cn,Cn=lt,r=Zd(),c=hn,hn=_r(e.stateNode.containerInfo),Tt(t,e,a),Rt(e),hn=c,Ee&&hr&&(Fl=!0),Ee=r,Cn=u;break;case 12:Tt(t,e,a),Rt(e);break;case 31:Tt(t,e,a),Rt(e),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,eo(e,t)));break;case 13:Tt(t,e,a),Rt(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(ao=Mt()),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,eo(e,t)));break;case 22:c=e.memoizedState!==null,p=r!==null&&r.memoizedState!==null;var _=lt,S=Ae,U=Cn;lt=_||c,Cn=U||c,Ae=S||p,Tt(t,e,a),Ae=S,Cn=U,lt=_,Rt(e),u&8192&&(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,!c||r===null||p||lt||Ae||(t=p||Ae,a=lt,r=Ae,lt=c||lt,Ae=t,Aa(e,2),lt=a,Ae=r),!c&&Cn||Yc(e,c)),u&4&&(t=e.updateQueue,t!==null&&(a=t.retryQueue,a!==null&&(t.retryQueue=null,eo(e,a))));break;case 19:Tt(t,e,a),Rt(e),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,eo(e,t)));break;case 30:u&512&&(Ae||r===null||vt(r,r.return)),u=Zd(),c=hr,p=(a&335544064)===a,_=e.memoizedProps,hr=p&&Vn(_.default,_.update)!=="none",Tt(t,e,a),Rt(e),p&&r!==null&&Ee&&(e.flags|=4),hr=c,Ee=u;break;case 21:break;case 7:u&512&&(Ae||r===null||vt(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Tt(t,e,a),Rt(e)}}function Rt(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(pg(r)){a=r;break}r=r.return}r=null;for(var u=e.return;u!==null;){if(Lc(u)){var c=u.stateNode;r===null?r=[c]:r.push(c)}if(Uc(u))break;u=u.return}var p=r;if(a==null)throw Error(l(160));switch(a.tag){case 27:var _=a.stateNode,S=Bc(e);Jl(e,S,_,p);break;case 5:var U=a.stateNode;a.flags&32&&(Ns(U,""),a.flags&=-33);var z=Bc(e);Jl(e,z,U,p);break;case 3:case 4:var P=a.stateNode.containerInfo,k=Bc(e);Hc(e,k,P,p);break;default:throw Error(l(161))}}catch(M){Ce(e,e.return,M)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function kg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;kg(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,hi=!0,t.reset(),hi=!1),e=e.sibling}}function Js(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Dg(t,e),t=t.sibling;else Sg(t)}function Dg(e,t){var a=e.alternate;if(a===null)qc(e,!1);else switch(e.tag){case 3:if(Kc=kn=!1,bg(),Js(t,e),!kn&&!Fl){if(e=Nn,e!==null)for(var r=0;r<e.length;r+=3){a=e[r];var u=e[r+1];_p(a,e[r+2]),a=a.ownerDocument.documentElement,a!==null&&a.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+u+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Kc=!0}Nn=null;break;case 5:Js(t,e);break;case 4:r=kn,kn=!1,Js(t,e),kn&&(Fl=!0),kn=r;break;case 22:e.memoizedState===null&&(a.memoizedState!==null?qc(e,!1):Js(t,e));break;case 30:r=kn,u=bg(),kn=!1,Js(t,e),kn&&(e.flags|=4);var c=e.memoizedProps,p=e.stateNode;t=Gn(c,p),p=Gn(a.memoizedProps,p);var _=Vn(c.default,c.update);_==="none"?t=!1:(c=a.memoizedState,a.memoizedState=null,a=e.child,Ot=0,t=Gc(e,a,t,p,_,c,!0),Ot!==(c===null?0:c.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(ti(e,e.memoizedProps.onUpdate),Nn=u):u!==null&&(u.push.apply(u,Nn),Nn=u),kn=(e.flags&32)!==0?!0:r;break;default:Js(t,e)}}function Dn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)jg(e,t.alternate,t),t=t.sibling}function Aa(e,t){for(e=e.child;e!==null;){var a=e,r=t;switch(a.tag){case 0:case 11:case 14:case 15:Ra(4,a,a.return),Aa(a,r);break;case 1:vt(a,a.return);var u=a.stateNode;typeof u.componentWillUnmount=="function"&&mg(a,a.return,u),Aa(a,r);break;case 27:(r&2)!==0&&kp(a.stateNode,a.type,a.memoizedProps);case 5:vt(a,a.return),a.tag!==5&&a.tag!==27||cr(a),Aa(a,r);break;case 6:cr(a);break;case 26:vt(a,a.return),u=a.stateNode,a.memoizedState!==null||u===null||Ae||u.parentNode.removeChild(u),Aa(a,r);break;case 22:a.memoizedState===null&&Aa(a,r);break;case 30:vt(a,a.return),Aa(a,r);break;case 7:vt(a,a.return);default:Aa(a,r)}e=e.sibling}}function dn(e,t,a){for(a=(t.subtreeFlags&8772)!==0?a:a&-2,t=t.child;t!==null;){var r=t.alternate,u=e,c=t,p=c.flags,_=(a&1)!==0;switch(c.tag){case 0:case 11:case 15:dn(u,c,a),ur(4,c);break;case 1:if(dn(u,c,a),r=c,u=r.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(z){Ce(r,r.return,z)}if(r=c,u=r.updateQueue,u!==null){var S=r.stateNode;try{var U=u.shared.hiddenCallbacks;if(U!==null)for(u.shared.hiddenCallbacks=null,u=0;u<U.length;u++)tm(U[u],S)}catch(z){Ce(r,r.return,z)}}_&&p&64&&fg(c),An(c,c.return);break;case 27:(a&2)!==0&&vg(c);case 5:c.tag!==5&&c.tag!==27||gg(c),dn(u,c,a),_&&r===null&&p&4&&Mc(c),An(c,c.return);break;case 6:gg(c);break;case 26:S=c.stateNode,c.memoizedState!==null||S===null||lt||kh(_r(S.ownerDocument),c.type,S),dn(u,c,a),_&&r===null&&p&4&&Mc(c),An(c,c.return);break;case 12:dn(u,c,a);break;case 31:dn(u,c,a),_&&p&4&&Ng(u,c);break;case 13:dn(u,c,a),_&&p&4&&Og(u,c);break;case 22:c.memoizedState===null&&dn(u,c,a),An(c,c.return);break;case 30:dn(u,c,a),An(c,c.return);break;case 7:An(c,c.return);default:dn(u,c,a)}t=t.sibling}}function Qc(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&&Xi(a))}function Xc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xi(e))}function nn(e,t,a,r){var u=(a&335544064)===a;if(t.subtreeFlags&(u?10262:10256))for(t=t.child;t!==null;)Ug(e,t,a,r),t=t.sibling;else u&&wg(t)}function Ug(e,t,a,r){var u=(a&335544064)===a;u&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Zl(t);var c=t.flags;switch(t.tag){case 0:case 11:case 15:nn(e,t,a,r),c&2048&&ur(9,t);break;case 1:nn(e,t,a,r);break;case 3:nn(e,t,a,r),u&&Kc&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),c&2048&&(c=null,t.alternate!==null&&(c=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==c&&(t.refCount++,c!=null&&Xi(c)));break;case 12:if(c&2048){nn(e,t,a,r),c=t.stateNode;try{var p=t.memoizedProps,_=p.id,S=p.onPostCommit;typeof S=="function"&&S(_,t.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(U){Ce(t,t.return,U)}}else nn(e,t,a,r);break;case 31:nn(e,t,a,r);break;case 13:nn(e,t,a,r);break;case 23:break;case 22:p=t.stateNode,_=t.alternate,t.memoizedState!==null?(u&&_!==null&&_.memoizedState===null&&Zl(_),p._visibility&2?nn(e,t,a,r):dr(e,t)):(u&&_!==null&&_.memoizedState!==null&&Zl(t),p._visibility&2?nn(e,t,a,r):(p._visibility|=2,Qs(e,t,a,r,(t.subtreeFlags&10256)!==0||!1))),c&2048&&Qc(_,t);break;case 24:nn(e,t,a,r),c&2048&&Xc(t.alternate,t);break;case 30:u&&(c=t.alternate,c!==null&&(On(c.child,!0),On(t.child,!0))),nn(e,t,a,r);break;default:nn(e,t,a,r)}}function Qs(e,t,a,r,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,p=t,_=a,S=r,U=p.flags;switch(p.tag){case 0:case 11:case 15:Qs(c,p,_,S,u),ur(8,p);break;case 23:break;case 22:var z=p.stateNode;p.memoizedState!==null?z._visibility&2?Qs(c,p,_,S,u):dr(c,p):(z._visibility|=2,Qs(c,p,_,S,u)),u&&U&2048&&Qc(p.alternate,p);break;case 24:Qs(c,p,_,S,u),u&&U&2048&&Xc(p.alternate,p);break;default:Qs(c,p,_,S,u)}t=t.sibling}}function dr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,u=r.flags;switch(r.tag){case 22:dr(a,r),u&2048&&Qc(r.alternate,r);break;case 24:dr(a,r),u&2048&&Xc(r.alternate,r);break;default:dr(a,r)}t=t.sibling}}var us=8192;function cs(e,t,a){if(e.subtreeFlags&us)for(e=e.child;e!==null;)Lg(e,t,a),e=e.sibling}function Lg(e,t,a){switch(e.tag){case 26:cs(e,t,a),e.flags&us&&(e.memoizedState!==null?ax(a,hn,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&Ip(a,e)));break;case 5:cs(e,t,a),e.flags&us&&(e=e.stateNode,(t&335544128)===t&&Ip(a,e));break;case 3:case 4:var r=hn;hn=_r(e.stateNode.containerInfo),cs(e,t,a),hn=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=us,us=16777216,cs(e,t,a),us=r):cs(e,t,a));break;case 30:if((e.flags&us)!==0&&(r=e.memoizedProps.name,r!=null&&r!=="auto")){var u=e.stateNode;u.paired=null,It===null&&(It=new Map),It.set(r,u)}cs(e,t,a);break;default:cs(e,t,a)}}function Mg(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 fr(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];ot=r,Bg(r,e)}Mg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)zg(e),e=e.sibling}function zg(e){switch(e.tag){case 0:case 11:case 15:fr(e),e.flags&2048&&Ra(9,e,e.return);break;case 3:fr(e);break;case 12:fr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,to(e)):fr(e);break;default:fr(e)}}function to(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];ot=r,Bg(r,e)}Mg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ra(8,t,t.return),to(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,to(t));break;default:to(t)}e=e.sibling}}function Bg(e,t){for(;ot!==null;){var a=ot;switch(a.tag){case 0:case 11:case 15:Ra(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:Xi(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,ot=r;else e:for(a=e;ot!==null;){r=ot;var u=r.sibling,c=r.return;if(Rg(r),r===a){ot=null;break e}if(u!==null){u.return=c,ot=u;break e}ot=c}}}var Fb={getCacheForType:function(e){var t=mt(Fe),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return mt(Fe).controller.signal}},Wb=typeof WeakMap=="function"?WeakMap:Map,Te=0,Le=null,pe=null,be=0,Oe=0,Pt=null,Na=!1,Xs=!1,Zc=!1,ea=0,Ke=0,Oa=0,hs=0,no=0,Gt=0,Zs=0,mr=null,kt=null,Fc=!1,ao=0,Hg=0,so=1/0,io=null,Ca=null,Ge=0,fn=null,ds=null,Un=0,Wc=0,eh=null,qg=null,Fs=null,Ws=null,ei=null,gr=0,ro=null;function Vt(){return(Te&2)!==0&&be!==0?be&-be:te.T!==null?ch():Id()}function $g(){if(Gt===0)if((be&536870912)===0||me){var e=el;el<<=1,(el&3932160)===0&&(el=262144),Gt=e}else Gt=536870912;return e=gt.current,e!==null&&(e.flags|=32),Gt}function ti(e,t){if(t!=null){var a=e.stateNode,r=a.ref;r===null&&(r=a.ref=xp(Gn(e.memoizedProps,a))),Ws===null&&(Ws=[]),Ws.push(t.bind(null,r))}}function Dt(e,t,a){(e===Le&&(Oe===2||Oe===9)||e.cancelPendingCommit!==null)&&(ni(e,0),ka(e,be,Gt,!1)),Mi(e,a),((Te&2)===0||e!==Le)&&(e===Le&&((Te&2)===0&&(hs|=a),Ke===4&&ka(e,be,Gt,!1)),Ln(e))}function Ig(e,t,a){if((Te&6)!==0)throw Error(l(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Li(e,t),u=r?n_(e,t):nh(e,t,!0),c=r;do{if(u===0){Xs&&!r&&ka(e,t,0,!1);break}else{if(a=e.current.alternate,c&&!e_(a)){u=nh(e,t,!1),c=!1;continue}if(u===2){if(c=t,e.errorRecoveryDisabledLanes&c)var p=0;else p=e.pendingLanes&-536870913,p=p!==0?p:p&536870912?536870912:0;if(p!==0){t=p;e:{var _=e;u=mr;var S=_.current.memoizedState.isDehydrated;if(S&&(ni(_,p).flags|=256),p=nh(_,p,!1),p!==2&&p!==6){if(Zc&&!S){_.errorRecoveryDisabledLanes|=c,hs|=c,u=4;break e}c=kt,kt=u,c!==null&&(kt===null?kt=c:kt.push.apply(kt,c))}u=p}if(c=!1,u!==2)continue}}if(u===1){ni(e,0),ka(e,t,0,!0);break}e:{switch(r=e,c=u,c){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:ka(r,t,Gt,!Na);break e;case 2:kt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(u=ao+300-Mt(),10<u)){if(ka(r,t,Gt,!Na),nl(r,0,!0)!==0)break e;Un=t,r.timeoutHandle=xh(Pg.bind(null,r,a,kt,io,Fc,t,Gt,hs,Zs,Na,c,"Throttled",-0,0),u);break e}Pg(r,a,kt,io,Fc,t,Gt,hs,Zs,Na,c,null,-0,0)}}break}while(!0);Ln(e)}function Pg(e,t,a,r,u,c,p,_,S,U,z,P,k,M){e.timeoutHandle=-1;var J=t.subtreeFlags,W=(c&335544064)===c;if(P=null,(W||J&8192||(J&16785408)===16785408)&&(P={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:jn},It=null,Lg(t,c,P),W&&(J=P,W=e.containerInfo,W=(W.nodeType===9?W:W.ownerDocument).__reactViewTransition,W!=null&&(J.count++,J.waitingForViewTransition=!0,J=Sr.bind(J),W.finished.then(J,J))),J=(c&62914560)===c?ao-Mt():(c&4194048)===c?Hg-Mt():0,J=sx(P,J),J!==null)){Un=c,e.cancelPendingCommit=J(Zg.bind(null,e,t,c,a,r,u,p,_,S,U,z,P,null,k,M)),ka(e,c,p,!U);return}Zg(e,t,c,a,r,u,p,_,S,U,z,P)}function e_(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 u=a[r],c=u.getSnapshot;u=u.value;try{if(!qt(c(),u))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 ka(e,t,a,r){t=zd(e,t),t&=~no,t&=~hs,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var u=t;0<u;){var c=31-Bt(u),p=1<<c;r[c]=-1,u&=~p}a!==0&&Hd(e,a,t)}function lo(){return(Te&6)===0?(pr(0),!1):!0}function th(){if(pe!==null){if(Oe===0)var e=pe.return;else e=pe,Jn=Wa=null,uc(e),Is=null,Wi=0,e=pe;for(;e!==null;)dg(e.alternate,e),e=e.return;pe=null}}function ni(e,t){var a=e.timeoutHandle;return a!==-1&&(e.timeoutHandle=-1,E_(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Un=0,th(),Le=e,pe=a=Kn(e.current,null),be=t,Oe=0,Pt=null,Na=!1,Xs=Li(e,t),Zc=!1,Zs=Gt=no=hs=Oa=Ke=0,kt=mr=null,Fc=!1,ea=zd(e,t),gl(),a}function Gg(e,t){de=null,te.H=ql,t===$s||t===Tl?(t=Zf(),Oe=3):t===Xu?(t=Zf(),Oe=4):Oe=t===Ec?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Pt=t,pe===null&&(Ke=1,$l(e,Ft(t,e.current)))}function Vg(){var e=gt.current;return e===null?!0:(be&4194048)===be?wt===null:(be&62914560)===be||(be&536870912)!==0?e===wt:!1}function Kg(){var e=te.H;return te.H=ql,e===null?ql:e}function Yg(){var e=te.A;return te.A=Fb,e}function oo(){Ke=4,Na||(be&4194048)!==be&>.current!==null||(Xs=!0),(Oa&134217727)===0&&(hs&134217727)===0||Le===null||ka(Le,be,Gt,!1)}function nh(e,t,a){var r=Te;Te|=2;var u=Kg(),c=Yg();(Le!==e||be!==t)&&(io=null,ni(e,t)),t=!1;var p=Ke;e:do try{if(Oe!==0&&pe!==null){var _=pe,S=Pt;switch(Oe){case 8:th(),p=6;break e;case 3:case 2:case 9:case 6:gt.current===null&&(t=!0);var U=Oe;if(Oe=0,Pt=null,ai(e,_,S,U),a&&Xs){p=0;break e}break;default:U=Oe,Oe=0,Pt=null,ai(e,_,S,U)}}t_(),p=Ke;break}catch(z){Gg(e,z)}while(!0);return t&&e.shellSuspendCounter++,Jn=Wa=null,Te=r,te.H=u,te.A=c,pe===null&&(Le=null,be=0,gl()),p}function t_(){for(;pe!==null;)Jg(pe)}function n_(e,t){var a=Te;Te|=2;var r=Kg(),u=Yg();Le!==e||be!==t?(io=null,so=Mt()+500,ni(e,t)):Xs=Li(e,t);e:do try{if(Oe!==0&&pe!==null){t=pe;var c=Pt;t:switch(Oe){case 1:Oe=0,Pt=null,ai(e,t,c,1);break;case 2:case 9:if(Qf(c)){Oe=0,Pt=null,Qg(t);break}t=function(){Oe!==2&&Oe!==9||Le!==e||(Oe=7),Ln(e)},c.then(t,t);break e;case 3:Oe=7;break e;case 4:Oe=5;break e;case 7:Qf(c)?(Oe=0,Pt=null,Qg(t)):(Oe=0,Pt=null,ai(e,t,c,7));break;case 5:var p=null;switch(pe.tag){case 26:p=pe.memoizedState;case 5:case 27:var _=pe;if(p?qp(p):_.stateNode.complete){Oe=0,Pt=null;var S=_.sibling;if(S!==null)pe=S;else{var U=_.return;U!==null?(pe=U,uo(U)):pe=null}break t}}Oe=0,Pt=null,ai(e,t,c,5);break;case 6:Oe=0,Pt=null,ai(e,t,c,6);break;case 8:th(),Ke=6;break e;default:throw Error(l(462))}}a_();break}catch(z){Gg(e,z)}while(!0);return Jn=Wa=null,te.H=r,te.A=u,Te=a,pe!==null?0:(Le=null,be=0,gl(),Ke)}function a_(){for(;pe!==null&&!_0();)Jg(pe)}function Jg(e){var t=cg(e.alternate,e,ea);e.memoizedProps=e.pendingProps,t===null?uo(e):pe=t}function Qg(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=ag(a,t,t.pendingProps,t.type,void 0,be);break;case 11:t=ag(a,t,t.pendingProps,t.type.render,t.ref,be);break;case 5:uc(t);var r=t;r===rt&&(me?(xl(r),r.tag===5&&r.stateNode!=null&&(ze=r.stateNode)):(xl(r),me=!0));default:dg(a,t),t=pe=Bf(t,ea),t=cg(a,t,ea)}e.memoizedProps=e.pendingProps,t===null?uo(e):pe=t}function ai(e,t,a,r){Jn=Wa=null,uc(t),Is=null,Wi=0;var u=t.return;try{if(Gb(e,u,t,a,be)){Ke=1,$l(e,Ft(a,e.current)),pe=null;return}}catch(c){if(u!==null)throw pe=u,c;Ke=1,$l(e,Ft(a,e.current)),pe=null;return}t.flags&32768?(me||r===1?e=!0:Xs||(be&536870912)!==0?e=!1:(Na=e=!0,(r===2||r===9||r===3||r===6)&&(r=gt.current,r!==null&&r.tag===13&&(r.flags|=16384))),Xg(t,e)):uo(t)}function uo(e){var t=e;do{if((t.flags&32768)!==0){Xg(t,Na);return}e=t.return;var a=Jb(t.alternate,t,ea);if(a!==null){pe=a;return}if(t=t.sibling,t!==null){pe=t;return}pe=t=e}while(t!==null);Ke===0&&(Ke=5)}function Xg(e,t){do{var a=Qb(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);Ke=6,pe=null}function Zg(e,t,a,r,u,c,p,_,S,U,z,P){e.cancelPendingCommit=null;do co();while(Ge!==0);if((Te&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));e===Le&&(pe=Le=null,be=0),ds=t,fn=e,Un=a,eh=u,qg=r,s_(e,t,a,p,_,S,P)}}function s_(e,t,a,r,u,c,p){var _=t.lanes|t.childLanes;if(Wc=_,_|=zu,O0(e,a,_,r,u,c),Ws=null,(a&335544064)===a?(ei=kb(e),r=10262):(ei=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,c_(Fr,function(){return rh(),null})):(e.callbackNode=null,e.callbackPriority=0),Ql=!1,r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=te.T,te.T=null,u=ue.p,ue.p=2,c=Te,Te|=4;try{Xb(e,t,a)}finally{Te=c,ue.p=u,te.T=r}}Ge=1,Ql?Fs=O_(p,e.containerInfo,ei,ah,sh,r_,ih,rh,i_):(ah(),sh(),ih())}function i_(e){if(Ge!==0){var t=fn.onRecoverableError;t(e,{componentStack:null})}}function r_(){Ge===3&&(Ge=0,Dg(ds,fn),Ge=4)}function ah(){if(Ge===1){Ge=0;var e=fn,t=ds,a=Un,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=te.T,te.T=null;var u=ue.p;ue.p=2;var c=Te;Te|=4;try{hr=Fl=!1,Cg(t,e,a),a=yh;var p=Af(e.containerInfo),_=a.focusedElem,S=a.selectionRange;if(p!==_&&_&&_.ownerDocument&&Rf(_.ownerDocument.documentElement,_)){if(S!==null&&ku(_)){var U=S.start,z=S.end;if(z===void 0&&(z=U),"selectionStart"in _)_.selectionStart=U,_.selectionEnd=Math.min(z,_.value.length);else{var P=_.ownerDocument||document,k=P&&P.defaultView||window;if(k.getSelection){var M=k.getSelection(),J=_.textContent.length,W=Math.min(S.start,J),fe=S.end===void 0?W:Math.min(S.end,J);!M.extend&&W>fe&&(p=fe,fe=W,W=p);var D=Tf(_,W),A=Tf(_,fe);if(D&&A&&(M.rangeCount!==1||M.anchorNode!==D.node||M.anchorOffset!==D.offset||M.focusNode!==A.node||M.focusOffset!==A.offset)){var L=P.createRange();L.setStart(D.node,D.offset),M.removeAllRanges(),W>fe?(M.addRange(L),M.extend(A.node,A.offset)):(L.setEnd(A.node,A.offset),M.addRange(L))}}}}for(P=[],M=_;M=M.parentNode;)M.nodeType===1&&P.push({element:M,left:M.scrollLeft,top:M.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<P.length;_++){var I=P[_];I.element.scrollLeft=I.left,I.element.scrollTop=I.top}}hi=!!vh,yh=vh=null}finally{Te=c,ue.p=u,te.T=r}}e.current=t,Ge=2}}function sh(){if(Ge===2){Ge=0;var e=fn,t=ds,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=te.T,te.T=null;var r=ue.p;ue.p=2;var u=Te;Te|=4;try{jg(e,t.alternate,t)}finally{Te=u,ue.p=r,te.T=a}}Ge=3}}function ih(){if(Ge===4||Ge===3){Ge=0;var e=Fs;Fs=null,x0();var t=fn,a=ds,r=Un,u=qg,c=(r&335544064)===r?10262:10256;if((a.subtreeFlags&c)!==0||(a.flags&c)!==0?Ge=5:(Ge=0,ds=fn=null,Fg(t,t.pendingLanes)),c=t.pendingLanes,c===0&&(Ca=null),mu(r),a=a.stateNode,zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(Ui,a,void 0,(a.current.flags&128)===128)}catch{}if(u!==null){a=te.T,c=ue.p,ue.p=2,te.T=null;try{for(var p=t.onRecoverableError,_=0;_<u.length;_++){var S=u[_];p(S.value,{componentStack:S.stack})}}finally{te.T=a,ue.p=c}}if(u=Ws,p=ei,ei=null,u!==null&&(Ws=null,p===null&&(p=[]),e!==null))for(S=0;S<u.length;S++)a=(0,u[S])(p),a!==void 0&&e.finished.finally(a);(Un&3)!==0&&co(),Ln(t),c=t.pendingLanes,(r&261930)!==0&&(c&42)!==0?t===ro?gr++:(gr=0,ro=t):(gr=0,ro=null),pr(0)}}function Fg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Xi(t)))}function co(){return Fs!==null&&(Fs.skipTransition(),Fs=null),ah(),sh(),ih(),rh()}function rh(){if(Ge!==5)return!1;var e=fn,t=Wc;Wc=0;var a=mu(Un),r=te.T,u=ue.p;try{ue.p=32>a?32:a,te.T=null,a=eh,eh=null;var c=fn,p=Un;if(Ge=0,ds=fn=null,Un=0,(Te&6)!==0)throw Error(l(331));var _=Te;if(Te|=4,zg(c.current),Ug(c,c.current,p,a),Te=_,pr(0,!1),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(Ui,c)}catch{}return!0}finally{ue.p=u,te.T=r,Fg(e,t)}}function Wg(e,t,a){t=Ft(a,t),t=Sc(e.stateNode,t,2),e=Sa(e,t,2),e!==null&&(Mi(e,2),Ln(e))}function Ce(e,t,a){if(e.tag===3)Wg(e,e,a);else for(;t!==null;){if(t.tag===3){Wg(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ca===null||!Ca.has(r))){e=Ft(a,e),a=Qm(2),r=Sa(t,a,2),r!==null&&(Xm(a,r,t,e),Mi(r,2),Ln(r));break}}t=t.return}}function lh(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new Wb;var u=new Set;r.set(t,u)}else u=r.get(t),u===void 0&&(u=new Set,r.set(t,u));u.has(a)||(Zc=!0,u.add(a),e=l_.bind(null,e,t,a),t.then(e,e))}function l_(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Le===e&&(be&a)===a&&((Ke===4||Ke===3&&(be&62914560)===be&&300>Mt()-ao)&&(Te&2)===0?ni(e,0):no|=a,Zs===be&&(Zs=0)),Ln(e)}function ep(e,t){t===0&&(t=Bd()),e=Xa(e,t),e!==null&&(Mi(e,t),Ln(e))}function o_(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),ep(e,a)}function u_(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,u=e.memoizedState;u!==null&&(a=u.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),ep(e,a)}function c_(e,t){return cu(e,t)}var si=null,ii=null,oh=!1,ho=!1,uh=!1,Da=0;
vendor: 5,646 bytes, line 48
48function Ln(e){e!==ii&&e.next===null&&(ii===null?si=ii=e:ii=ii.next=e),ho=!0,oh||(oh=!0,d_())}function pr(e,t){if(!uh&&ho){uh=!0;do for(var a=!1,r=si;r!==null;){if(e!==0){var u=r.pendingLanes;if(u===0)var c=0;else{var p=r.suspendedLanes,_=r.pingedLanes;c=(1<<31-Bt(42|e)+1)-1,c&=u&~(p&~_),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(a=!0,sp(r,c))}else c=be,c=nl(r,r===Le?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(c&3)===0||Li(r,c)||(a=!0,sp(r,c));r=r.next}while(a);uh=!1}}function h_(){tp()}function tp(){ho=oh=!1;var e=0;Da!==0&&S_()&&(e=Da);for(var t=Mt(),a=null,r=si;r!==null;){var u=r.next,c=np(r,t);c===0?(r.next=null,a===null?si=u:a.next=u,u===null&&(ii=a)):(a=r,(e!==0||(c&3)!==0)&&(ho=!0)),r=u}Ge!==0&&Ge!==5||pr(e),Da!==0&&(Da=0)}function np(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,u=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var p=31-Bt(c),_=1<<p,S=u[p];S===-1?((_&a)===0||(_&r)!==0)&&(u[p]=N0(_,t)):S<=t&&(e.expiredLanes|=_),c&=~_}if(t=Le,a=be,a=nl(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(Oe===2||Oe===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&hu(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Li(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&hu(r),mu(a)){case 2:case 8:a=Ld;break;case 32:a=Fr;break;case 268435456:a=Md;break;default:a=Fr}return r=ap.bind(null,e),a=cu(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&hu(r),e.callbackPriority=2,e.callbackNode=null,2}function ap(e,t){if(Ge!==0&&Ge!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(co()&&e.callbackNode!==a)return null;var r=be;return r=nl(e,e===Le?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Ig(e,r,t),np(e,Mt()),e.callbackNode!=null&&e.callbackNode===a?ap.bind(null,e):null)}function sp(e,t){if(co())return null;Ig(e,t,!0)}function d_(){j_(function(){(Te&6)!==0?cu(Ud,h_):tp()})}function ch(){if(Da===0){var e=ns;e===0&&(e=Wr,Wr<<=1,(Wr&261888)===0&&(Wr=256)),Da=e}return Da}function ip(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ll(e)}function f_(e,t,a,r,u){if(t==="submit"&&a&&a.stateNode===u){var c=ip((u[At]||null).action),p=r.submitter;p&&(t=(t=p[At]||null)?ip(t.formAction):p.getAttribute("formAction"),t!==null&&(c=t,p=null));var _=new hl("action","action",null,r,u);e.push({event:_,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Da!==0){var S=new FormData(u,p);yc(a,{pending:!0,data:S,method:u.method,action:c},null,S)}}else typeof c=="function"&&(_.preventDefault(),S=new FormData(u,p),yc(a,{pending:!0,data:S,method:u.method,action:c},c,S))},currentTarget:u}]})}}for(var hh=0;hh<Mu.length;hh++){var dh=Mu[hh],m_=dh.toLowerCase(),g_=dh[0].toUpperCase()+dh.slice(1);un(m_,"on"+g_)}un(Cf,"onAnimationEnd"),un(kf,"onAnimationIteration"),un(Df,"onAnimationStart"),un("dblclick","onDoubleClick"),un("focusin","onFocus"),un("focusout","onBlur"),un(Eb,"onTransitionRun"),un(jb,"onTransitionStart"),un(Tb,"onTransitionCancel"),un(Uf,"onTransitionEnd"),Rs("onMouseEnter",["mouseout","mouseover"]),Rs("onMouseLeave",["mouseout","mouseover"]),Rs("onPointerEnter",["pointerout","pointerover"]),Rs("onPointerLeave",["pointerout","pointerover"]),Ya("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ya("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ya("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ya("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ya("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ya("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vr="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(" "),p_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vr));function rp(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],u=r.event;r=r.listeners;e:{var c=void 0;if(t)for(var p=r.length-1;0<=p;p--){var _=r[p],S=_.instance,U=_.currentTarget;if(_=_.listener,S!==c&&u.isPropagationStopped())break e;c=_,u.currentTarget=U;try{c(u)}catch(z){ml(z)}u.currentTarget=null,c=S}else for(p=0;p<r.length;p++){if(_=r[p],S=_.instance,U=_.currentTarget,_=_.listener,S!==c&&u.isPropagationStopped())break e;c=_,u.currentTarget=U;try{c(u)}catch(z){ml(z)}u.currentTarget=null,c=S}}}}function ve(e,t){var a=t[Gd];a===void 0&&(a=t[Gd]=new Set);var r=e+"__bubble";a.has(r)||(lp(t,e,2,!1),a.add(r))}function fh(e,t,a){var r=0;t&&(r|=4),lp(a,e,r,t)}var fo="_reactListening"+Math.random().toString(36).slice(2);function mh(e){if(!e[fo]){e[fo]=!0,Yd.forEach(function(a){a!=="selectionchange"&&(p_.has(a)||fh(a,!1,e),fh(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fo]||(t[fo]=!0,fh("selectionchange",!1,t))}}function lp(e,t,a,r){switch(Xp(t)){case 2:var u=ox;break;case 8:u=ux;break;default:u=Uh}a=u.bind(null,t,a,e),u=void 0,!wu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),r?u!==void 0?e.addEventListener(t,a,{capture:!0,passive:u}):e.addEventListener(t,a,!0):u!==void 0?e.addEventListener(t,a,{passive:u}):e.addEventListener(t,a,!1)}function gh(e,t,a,r,u){var c=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var p=r.tag;if(p===3||p===4){var _=r.stateNode.containerInfo;
vendor: 30,991 bytes, lines 48-49
48if(_===u)break;if(p===4)for(p=r.return;p!==null;){var S=p.tag;if((S===3||S===4)&&p.stateNode.containerInfo===u)return;p=p.return}for(;_!==null;){if(p=Ka(_),p===null)return;if(S=p.tag,S===5||S===6||S===26||S===27){r=c=p;continue e}_=_.parentNode}}r=r.return}lf(function(){var U=c,z=_u(a),P=[];e:{var k=Lf.get(e);if(k!==void 0){var M=hl,J=e;switch(e){case"keypress":if(ul(a)===0)break e;case"keydown":case"keyup":M=eb;break;case"focusin":J="focus",M=Tu;break;case"focusout":J="blur",M=Tu;break;case"beforeblur":case"afterblur":M=Tu;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":M=cf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":M=I0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":M=ib;break;case Cf:case kf:case Df:M=V0;break;case Uf:M=lb;break;case"scroll":case"scrollend":M=q0;break;case"wheel":M=ub;break;case"copy":case"cut":case"paste":M=Y0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":M=df;break;case"submit":M=ab;break;case"toggle":case"beforetoggle":M=hb}var W=(t&4)!==0,fe=!W&&(e==="scroll"||e==="scrollend"),D=W?k!==null?k+"Capture":null:k;W=[];for(var A=U,L;A!==null;){var I=A;if(L=I.stateNode,I=I.tag,I!==5&&I!==26&&I!==27||L===null||D===null||(I=Hi(A,D),I!=null&&W.push(yr(A,I,L))),fe)break;A=A.return}0<W.length&&(k=new M(k,J,null,a,z),P.push({event:k,listeners:W}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",k=e==="mouseout"||e==="pointerout",M&&a!==bu&&(J=a.relatedTarget||a.fromElement)&&(Ka(J)||J[Es]))break e;(k||M)&&(J=z.window===z?z:(M=z.ownerDocument)?M.defaultView||M.parentWindow:window,k?(M=a.relatedTarget||a.toElement,k=U,M=M?Ka(M):null,M!==null&&(fe=h(M),W=M.tag,M!==fe||W!==5&&W!==27&&W!==6)&&(M=null)):(k=null,M=U),k!==M&&(W=cf,I="onMouseLeave",D="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(W=df,I="onPointerLeave",D="onPointerEnter",A="pointer"),fe=k==null?J:Bi(k),L=M==null?J:Bi(M),J=new W(I,A+"leave",k,a,z),J.target=fe,J.relatedTarget=L,I=null,Ka(z)===U&&(W=new W(D,A+"enter",M,a,z),W.target=L,W.relatedTarget=fe,I=W),fe=I,W=k&&M?$(k,M,v_):null,k!==null&&op(P,J,k,W,!1),M!==null&&fe!==null&&op(P,fe,M,W,!0)))}e:{if(k=U?Bi(U):window,M=k.nodeName&&k.nodeName.toLowerCase(),M==="select"||M==="input"&&k.type==="file")var F=_f;else if(yf(k))if(xf)F=xb;else{F=bb;var _e=yb}else M=k.nodeName,!M||M.toLowerCase()!=="input"||k.type!=="checkbox"&&k.type!=="radio"?U&&yu(U.elementType)&&(F=_f):F=_b;if(F&&(F=F(e,U))){bf(P,F,a,z);break e}_e&&_e(e,k,U)}switch(_e=U?Bi(U):window,e){case"focusin":(yf(_e)||_e.contentEditable==="true")&&(Ds=_e,Du=U,Yi=null);break;case"focusout":Yi=Du=Ds=null;break;case"mousedown":Uu=!0;break;case"contextmenu":case"mouseup":case"dragend":Uu=!1,Nf(P,a,z);break;case"selectionchange":if(Sb)break;case"keydown":case"keyup":Nf(P,a,z)}var ne;if(Au)e:{switch(e){case"compositionstart":var le="onCompositionStart";break e;case"compositionend":le="onCompositionEnd";break e;case"compositionupdate":le="onCompositionUpdate";break e}le=void 0}else ks?pf(e,a)&&(le="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(le="onCompositionStart");le&&(ff&&a.locale!=="ko"&&(ks||le!=="onCompositionStart"?le==="onCompositionEnd"&&ks&&(ne=of()):(ma=z,Su="value"in ma?ma.value:ma.textContent,ks=!0)),_e=mo(U,le),0<_e.length&&(le=new hf(le,e,null,a,z),P.push({event:le,listeners:_e}),ne?le.data=ne:(ne=vf(a),ne!==null&&(le.data=ne)))),(ne=fb?mb(e,a):gb(e,a))&&(le=mo(U,"onBeforeInput"),0<le.length&&(_e=new hf("onBeforeInput","beforeinput",null,a,z),P.push({event:_e,listeners:le}),_e.data=ne)),f_(P,e,U,a,z)}rp(P,t)})}function yr(e,t,a){return{instance:e,listener:t,currentTarget:a}}function mo(e,t){for(var a=t+"Capture",r=[];e!==null;){var u=e,c=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||c===null||(u=Hi(e,a),u!=null&&r.unshift(yr(e,u,c)),u=Hi(e,t),u!=null&&r.push(yr(e,u,c))),e.tag===3)return r;e=e.return}return[]}function v_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function op(e,t,a,r,u){for(var c=t._reactName,p=[];a!==null&&a!==r;){var _=a,S=_.alternate,U=_.stateNode;if(_=_.tag,S!==null&&S===r)break;_!==5&&_!==26&&_!==27||U===null||(S=U,u?(U=Hi(a,c),U!=null&&p.unshift(yr(a,U,S))):u||(U=Hi(a,c),U!=null&&p.push(yr(a,U,S)))),a=a.return}p.length!==0&&e.push({event:t,listeners:p})}var y_=/\r\n?/g,b_=/\u0000|\uFFFD/g;function up(e){return(typeof e=="string"?e:""+e).replace(y_,` 49`).replace(b_,"")}function cp(e,t){return t=up(t),up(e)===t}function ke(e,t,a,r,u,c){switch(a){case"children":if(typeof r=="string")t==="body"||t==="textarea"&&r===""||Ns(e,r);else if(typeof r=="number"||typeof r=="bigint")t!=="body"&&Ns(e,""+r);else return;break;case"className":rl(e,"class",r);break;case"tabIndex":rl(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":rl(e,a,r);break;case"style":sf(e,r,c);return;case"data":if(t!=="object"){rl(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=ll(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 c=="function"&&(a==="formAction"?(t!=="input"&&ke(e,t,"name",u.name,u,null),ke(e,t,"formEncType",u.formEncType,u,null),ke(e,t,"formMethod",u.formMethod,u,null),ke(e,t,"formTarget",u.formTarget,u,null)):(ke(e,t,"encType",u.encType,u,null),ke(e,t,"method",u.method,u,null),ke(e,t,"target",u.target,u,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=ll(r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=jn);return;case"onScroll":r!=null&&ve("scroll",e);return;case"onScrollEnd":r!=null&&ve("scrollend",e);return;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(l(61));if(a=r.__html,a!=null){if(u.children!=null)throw Error(l(60));(c!=null?c.__html:void 0)!==a&&(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=ll(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"credentialless":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":ve("beforetoggle",e),ve("toggle",e),il(e,"popover",r);break;case"xlinkActuate":In(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":In(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":In(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":In(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":In(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":In(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":In(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":In(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":In(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":il(e,"is",r);break;case"innerText":case"textContent":return;default:if(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")a=B0.get(a)||a,il(e,a,r);else return}Ee=!0}function ph(e,t,a,r,u,c){switch(a){case"style":sf(e,r,c);return;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(l(61));if(a=r.__html,a!=null){if(u.children!=null)throw Error(l(60));(c!=null?c.__html:void 0)!==a&&(e.innerHTML=a)}}break;case"children":if(typeof r=="string")Ns(e,r);else if(typeof r=="number"||typeof r=="bigint")Ns(e,""+r);else return;break;case"onScroll":r!=null&&ve("scroll",e);return;case"onScrollEnd":r!=null&&ve("scrollend",e);return;case"onClick":r!=null&&(e.onclick=jn);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Jd.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(u=a.endsWith("Capture"),c=a.slice(2,u?a.length-7:void 0),t=e[At]||null,t=t!=null?t[a]:null,typeof t=="function"&&e.removeEventListener(c,t,u),typeof r=="function")){typeof t!="function"&&t!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(c,r,u);break e}Ee=!0,a in e?e[a]=r:r===!0?e.setAttribute(a,""):il(e,a,r)}return}Ee=!0}function yt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ve("error",e),ve("load",e);var r=!1,u=!1,c;for(c in a)if(a.hasOwnProperty(c)){var p=a[c];if(p!=null)switch(c){case"src":r=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:ke(e,t,c,p,a,null)}}u&&ke(e,t,"srcSet",a.srcSet,a,null),r&&ke(e,t,"src",a.src,a,null);return;case"input":ve("invalid",e);var _=c=p=u=null,S=null,U=null;for(r in a)if(a.hasOwnProperty(r)){var z=a[r];if(z!=null)switch(r){case"name":u=z;break;case"type":p=z;break;case"checked":S=z;break;case"defaultChecked":U=z;break;case"value":c=z;break;case"defaultValue":_=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(l(137,t));break;default:ke(e,t,r,z,a,null)}}ef(e,c,_,S,U,p,u,!1);return;case"select":ve("invalid",e),r=p=c=null;for(u in a)if(a.hasOwnProperty(u)&&(_=a[u],_!=null))switch(u){case"value":c=_;break;case"defaultValue":p=_;break;case"multiple":r=_;default:ke(e,t,u,_,a,null)}t=c,a=p,e.multiple=!!r,t!=null?As(e,!!r,t,!1):a!=null&&As(e,!!r,a,!0);return;case"textarea":ve("invalid",e),c=u=r=null;for(p in a)if(a.hasOwnProperty(p)&&(_=a[p],_!=null))switch(p){case"value":r=_;break;case"defaultValue":u=_;break;case"children":c=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(l(91));break;default:ke(e,t,p,_,a,null)}nf(e,r,u,c);return;case"option":for(S in a)if(a.hasOwnProperty(S)&&(r=a[S],r!=null))switch(S){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:ke(e,t,S,r,a,null)}return;case"dialog":ve("beforetoggle",e),ve("toggle",e),ve("cancel",e),ve("close",e);break;case"iframe":case"object":ve("load",e);break;case"video":case"audio":for(r=0;r<vr.length;r++)ve(vr[r],e);break;case"image":ve("error",e),ve("load",e);break;case"details":ve("toggle",e);break;case"embed":case"source":case"link":ve("error",e),ve("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(U in a)if(a.hasOwnProperty(U)&&(r=a[U],r!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:ke(e,t,U,r,a,null)}return;default:if(yu(t)){for(z in a)a.hasOwnProperty(z)&&(r=a[z],r!==void 0&&ph(e,t,z,r,a,void 0));return}}for(_ in a)a.hasOwnProperty(_)&&(r=a[_],r!=null&&ke(e,t,_,r,a,null))}var __={};function x_(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 u=null,c=null,p=null,_=null,S=null,U=null,z=null;for(M in a){var P=a[M];if(a.hasOwnProperty(M)&&P!=null)switch(M){case"checked":break;case"value":break;case"defaultValue":S=P;default:r.hasOwnProperty(M)||ke(e,t,M,null,r,P)}}for(var k in r){var M=r[k];if(P=a[k],r.hasOwnProperty(k)&&(M!=null||P!=null))switch(k){case"type":M!==P&&(Ee=!0),c=M;break;case"name":M!==P&&(Ee=!0),u=M;break;case"checked":M!==P&&(Ee=!0),U=M;break;case"defaultChecked":M!==P&&(Ee=!0),z=M;break;case"value":M!==P&&(Ee=!0),p=M;break;case"defaultValue":M!==P&&(Ee=!0),_=M;break;case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(l(137,t));break;default:M!==P&&ke(e,t,k,M,r,P)}}pu(e,p,_,S,U,z,c,u);return;case"select":M=p=_=k=null;for(c in a)if(S=a[c],a.hasOwnProperty(c)&&S!=null)switch(c){case"value":break;case"multiple":M=S;default:r.hasOwnProperty(c)||ke(e,t,c,null,r,S)}for(u in r)if(c=r[u],S=a[u],r.hasOwnProperty(u)&&(c!=null||S!=null))switch(u){case"value":c!==S&&(Ee=!0),k=c;break;case"defaultValue":c!==S&&(Ee=!0),_=c;break;case"multiple":c!==S&&(Ee=!0),p=c;default:c!==S&&ke(e,t,u,c,r,S)}t=_,a=p,r=M,k!=null?As(e,!!a,k,!1):!!r!=!!a&&(t!=null?As(e,!!a,t,!0):As(e,!!a,a?[]:"",!1));return;case"textarea":M=k=null;for(_ in a)if(u=a[_],a.hasOwnProperty(_)&&u!=null&&!r.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:ke(e,t,_,null,r,u)}for(p in r)if(u=r[p],c=a[p],r.hasOwnProperty(p)&&(u!=null||c!=null))switch(p){case"value":u!==c&&(Ee=!0),k=u;break;case"defaultValue":u!==c&&(Ee=!0),M=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(l(91));break;default:u!==c&&ke(e,t,p,u,r,c)}tf(e,k,M);return;case"option":for(var J in a)if(k=a[J],a.hasOwnProperty(J)&&k!=null&&!r.hasOwnProperty(J))switch(J){case"selected":e.selected=!1;break;default:ke(e,t,J,null,r,k)}for(S in r)if(k=r[S],M=a[S],r.hasOwnProperty(S)&&k!==M&&(k!=null||M!=null))switch(S){case"selected":k!==M&&(Ee=!0),e.selected=k&&typeof k!="function"&&typeof k!="symbol";break;default:ke(e,t,S,k,r,M)}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 W in a)k=a[W],a.hasOwnProperty(W)&&k!=null&&!r.hasOwnProperty(W)&&ke(e,t,W,null,r,k);for(U in r)if(k=r[U],M=a[U],r.hasOwnProperty(U)&&k!==M&&(k!=null||M!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(k!=null)throw Error(l(137,t));break;default:ke(e,t,U,k,r,M)}return;default:if(yu(t)){for(var fe in a)k=a[fe],a.hasOwnProperty(fe)&&k!==void 0&&!r.hasOwnProperty(fe)&&ph(e,t,fe,void 0,r,k);for(z in r)k=r[z],M=a[z],!r.hasOwnProperty(z)||k===M||k===void 0&&M===void 0||ph(e,t,z,k,r,M);return}}for(var D in a)k=a[D],a.hasOwnProperty(D)&&k!=null&&!r.hasOwnProperty(D)&&ke(e,t,D,null,r,k);for(P in r)k=r[P],M=a[P],!r.hasOwnProperty(P)||k===M||k==null&&M==null||ke(e,t,P,k,r,M)}function hp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function w_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var u=a[r],c=u.transferSize,p=u.initiatorType,_=u.duration;if(c&&_&&hp(p)){for(p=0,_=u.responseEnd,r+=1;r<a.length;r++){var S=a[r],U=S.startTime;if(U>_)break;var z=S.transferSize,P=S.initiatorType;z&&hp(P)&&(S=S.responseEnd,p+=z*(S<_?1:(_-U)/(S-U)))}if(--r,t+=8*(c+p)/(u.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 vh=null,yh=null;function br(e){return e.nodeType===9?e:e.ownerDocument}function dp(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 fp(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 mp(e,t,a,r){return a=br(a).createElement(e),a[ft]=r,a[At]=t,yt(a,e,t),it(a),a}function bh(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 _h=null;function S_(){var e=window.event;return e&&e.type==="popstate"?e===_h?!1:(_h=e,!0):(_h=null,!1)}var xh=typeof setTimeout=="function"?setTimeout:void 0,E_=typeof clearTimeout=="function"?clearTimeout:void 0,gp=typeof Promise=="function"?Promise:void 0,pp=typeof requestAnimationFrame=="function"?requestAnimationFrame:xh,j_=typeof queueMicrotask=="function"?queueMicrotask:typeof gp<"u"?function(e){return gp.resolve(null).then(e).catch(T_)}:xh;function T_(e){setTimeout(function(){throw e})}function Ua(e){return e==="head"}function vp(e,t){var a=t,r=0;do{var u=a.nextSibling;if(e.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(u),di(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")Nh(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Nh(a);for(var c=a.firstChild;c;){var p=c.nextSibling,_=c.nodeName;c[zi]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&c.rel.toLowerCase()==="stylesheet"||a.removeChild(c),c=p}}else a==="body"&&Nh(e.ownerDocument.body);a=u}while(a);di(t)}function yp(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 bp(e,t,a){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,a!=null&&(e.style.viewTransitionClass=a),a=getComputedStyle(e),a.display==="inline"){if(t=e.getClientRects(),t.length===1)var r=1;else for(var u=r=0;u<t.length;u++){var c=t[u];0<c.width&&0<c.height&&r++}r===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+a.paddingTop,e.marginBottom="-"+a.paddingBottom)}}function _p(e,t){e=e.style,t=t.style;var a=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=a==null||typeof a=="boolean"?"":(""+a).trim(),a=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=a==null||typeof a=="boolean"?"":(""+a).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(a=t.display,e.display=a==null||typeof a=="boolean"?"":a,a=t.margin,a!=null?e.margin=a:(a=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=a==null||typeof a=="boolean"?"":a,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function R_(e,t,a){return a=a.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=a.innerHeight&&e.left<=a.innerWidth}}function wh(e){var t=e.getBoundingClientRect(),a=getComputedStyle(e);return R_(t,a,e)}function A_(e){return e.documentElement.clientHeight}function N_(e){this.addEventListener("load",e),this.addEventListener("error",e)}function O_(e,t,a,r,u,c,p,_,S){var U=t.nodeType===9?t:t.ownerDocument;try{var z=U.startViewTransition({update:function(){var k=U.defaultView,M=k.navigation&&k.navigation.transition,J=U.fonts.status;r();var W=[];if(J==="loaded"&&(A_(U),U.fonts.status==="loading"&&W.push(U.fonts.ready)),J=W.length,e!==null)for(var fe=e.suspenseyImages,D=0,A=0;A<fe.length;A++){var L=fe[A];if(!L.complete){var I=L.getBoundingClientRect();if(0<I.bottom&&0<I.right&&I.top<k.innerHeight&&I.left<k.innerWidth){if(D+=$p(L),D>vo){W.length=J;break}L=new Promise(N_.bind(L)),W.push(L)}}}if(0<W.length)return k=Promise.race([Promise.all(W),new Promise(function(F){return setTimeout(F,500)})]).then(u,u),(M?Promise.allSettled([M.finished,k]):k).then(c,c);if(u(),M)return M.finished.then(c,c);c()},types:a});U.__reactViewTransition=z;var P=[];return z.ready.then(function(){for(var k=U.documentElement.getAnimations({subtree:!0}),M=0;M<k.length;M++){var J=k[M],W=J.effect,fe=W.pseudoElement;if(fe!=null&&fe.startsWith("::view-transition")){P.push(J),J=W.getKeyframes();for(var D=fe=void 0,A=!0,L=0;L<J.length;L++){var I=J[L],F=I.width;if(fe===void 0)fe=F;else if(fe!==F){A=!1;break}if(F=I.height,D===void 0)D=F;else if(D!==F){A=!1;break}delete I.width,delete I.height,I.transform==="none"&&delete I.transform}A&&fe!==void 0&&D!==void 0&&(W.setKeyframes(J),A=getComputedStyle(W.target,W.pseudoElement),A.width!==fe||A.height!==D)&&(A=J[0],A.width=fe,A.height=D,A=J[J.length-1],A.width=fe,A.height=D,W.setKeyframes(J))}}p()},function(k){U.__reactViewTransition===z&&(U.__reactViewTransition=null);try{if(typeof k=="object"&&k!==null)switch(k.name){case"InvalidStateError":(k.message==="View transition was skipped because document visibility state is hidden."||k.message==="Skipping view transition because document visibility state has become hidden."||k.message==="Skipping view transition because viewport size changed."||k.message==="Transition was aborted because of invalid state")&&(k=null)}k!==null&&S(k)}finally{r(),u(),p()}}),z.finished.finally(function(){for(var k=0;k<P.length;k++)P[k].cancel();U.__reactViewTransition===z&&(U.__reactViewTransition=null),_()}),z}catch{return r(),u(),p(),null}}function fs(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}fs.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:G({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},fs.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,a=e.getAnimations({subtree:!0}),r=[],u=0;u<a.length;u++){var c=a[u].effect;c!==null&&c.target===e&&c.pseudoElement===t&&r.push(a[u])}return r},fs.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function xp(e){return{name:e,group:new fs("group",e),imagePair:new fs("image-pair",e),old:new fs("old",e),new:new fs("new",e)}}function Kt(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Kt.prototype.addEventListener=function(e,t,a){var r=null,u=null;if(!(a!=null&&typeof a!="boolean"&&(r=a.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var c=this._eventListeners;if(Sp(c,e,t,a)===-1){var p=this,_=t;a!=null&&typeof a!="boolean"&&a.once===!0&&(_=function(S){p.removeEventListener(e,t,a),typeof t=="function"?t.call(this,S):t.handleEvent(S)}),r!==null&&(u=p.removeEventListener.bind(p,e,t,a),r.addEventListener("abort",u,{once:!0}),u=r.removeEventListener.bind(r,"abort",u)),r=ri(a),c.push({type:e,listener:t,optionsOrUseCapture:a,attachedListener:_,cleanup:u}),y(this._fragmentFiber.child,!1,C_,e,_,r)}this._eventListeners=c}};function C_(e,t,a,r){return N(e).addEventListener(t,a,r),!1}Kt.prototype.removeEventListener=function(e,t,a){var r=this._eventListeners;if(r!==null&&(t=Sp(r,e,t,a),t!==-1)){var u=r[t];a=u.attachedListener;var c=u.cleanup;u=ri(u.optionsOrUseCapture),y(this._fragmentFiber.child,!1,k_,e,a,u),r.splice(t,1),c!==null&&c()}};function k_(e,t,a,r){return N(e).removeEventListener(t,a,r),!1}function ri(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function wp(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Sp(e,t,a,r){if(e.length===0)return-1;r=wp(r);for(var u=0;u<e.length;u++){var c=e[u];if(c.type===t&&c.listener===a&&wp(c.optionsOrUseCapture)===r)return u}return-1}Kt.prototype.dispatchEvent=function(e){var t=w(this._fragmentFiber);if(t===null)return!0;t=N(t);var a=this._eventListeners;if(a!==null&&0<a.length||!e.bubbles){var r=t.nodeType===9?t.createComment(""):document.createTextNode("");if(a)for(var u=0;u<a.length;u++){var c=a[u];r.addEventListener(c.type,c.attachedListener,ri(c.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),a)for(u=0;u<a.length;u++)c=a[u],r.removeEventListener(c.type,c.attachedListener,ri(c.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Kt.prototype.focus=function(e){y(this._fragmentFiber.child,!0,Ep,e,void 0,void 0)};function Ep(e,t){return e.tag===6?!1:(e=N(e),G_(e,t))}Kt.prototype.focusLast=function(e){var t=[];y(this._fragmentFiber.child,!0,Sh,t,void 0,void 0);for(var a=t.length-1;0<=a&&!Ep(t[a],e);a--);};function Sh(e,t){return t.push(e),!1}Kt.prototype.blur=function(){var e=w(this._fragmentFiber);e!==null&&(e=N(e),e=br(e).activeElement,e!==null&&y(this._fragmentFiber.child,!1,D_,e,void 0,void 0))};function D_(e,t){return e.tag===6?!1:(e=N(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Kt.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),y(this._fragmentFiber.child,!1,U_,e,void 0,void 0)};function U_(e,t){return e.tag===6||(e=N(e),t.observe(e)),!1}Kt.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),y(this._fragmentFiber.child,!1,L_,e,void 0,void 0);for(var a=t=0;a<mn.length;a++){var r=mn[a];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):mn[t++]=r}mn.length=t}};function L_(e,t){return e.tag===6||(e=N(e),t.unobserve(e)),!1}var mn=[],Eh=!1;function M_(e,t,a){mn.push({fragmentInstance:e,observer:t,instance:a}),Eh||(Eh=!0,V_(function(){Eh=!1;var r=mn;mn=[];for(var u=0;u<r.length;u++){var c=r[u];c.observer.unobserve(c.instance)}}))}Kt.prototype.getClientRects=function(){var e=[];return y(this._fragmentFiber.child,!1,z_,e,void 0,void 0),e};function z_(e,t){if(e.tag===6){e=e.stateNode;var a=e.ownerDocument.createRange();a.selectNodeContents(e),t.push.apply(t,a.getClientRects())}else e=N(e),t.push.apply(t,e.getClientRects());return!1}Kt.prototype.getRootNode=function(e){var t=w(this._fragmentFiber);return t===null?this:N(t).getRootNode(e)},Kt.prototype.compareDocumentPosition=function(e){var t=w(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var a=[];y(this._fragmentFiber.child,!1,Sh,a,void 0,void 0);var r=N(t);if(a.length===0){if(a=r,x(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(a=t)}t=this._fragmentFiber;var u=r=a.compareDocumentPosition(e);return a===e?u=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(a=R(t)[1],a===null?u=Node.DOCUMENT_POSITION_PRECEDING:(e=N(a).compareDocumentPosition(e),u=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),u|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=N(a[0]),u=N(a[a.length-1]);var c=x(this._fragmentFiber)?t.parentElement:r;if(c==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=c.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,c=c.compareDocumentPosition(u)&Node.DOCUMENT_POSITION_CONTAINED_BY;var p=t.compareDocumentPosition(e),_=u.compareDocumentPosition(e),S=p&Node.DOCUMENT_POSITION_CONTAINED_BY||_&Node.DOCUMENT_POSITION_CONTAINED_BY;return _=r&&c&&p&Node.DOCUMENT_POSITION_FOLLOWING&&_&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||c&&u===e||S||_?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!c&&u===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:p,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||B_(t,this._fragmentFiber,a[0],a[a.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function B_(e,t,a,r,u){var c=Ka(u);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(a=!!c)e:{for(;c!==null;){if(c.tag===7&&(c===t||c.alternate===t)){a=!0;break e}c=c.return}a=!1}return a}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(c===null)return c=u.ownerDocument,u===c||u===c.documentElement||u===c.body;e:{for(c=t,t=w(t);c!==null;){if(!(c.tag!==5&&c.tag!==3&&c.tag!==27||c!==t&&c.alternate!==t)){c=!0;break e}c=c.return}c=!1}return c}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!c)&&!(t=c===a)&&(t=$(a,c,ee),t===null?t=!1:(y(t,!0,B,c,a),c=T,T=null,t=c!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!c)&&!(t=c===r)&&(t=$(r,c,ee),t===null?t=!1:(y(t,!0,Q,c,r),c=T,C=T=null,t=c!==null)),t):!1}function jp(e,t){var a=e.ownerDocument.createRange();a.selectNodeContents(e),e=a.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Kt.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(l(566));var t=[];y(this._fragmentFiber.child,!1,Sh,t,void 0,void 0);var a=e!==!1;if(t.length===0){var r=R(this._fragmentFiber);if(r=a?r[1]||r[0]||w(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=N(r),jp(e,a);return}if(r=N(r),r.nodeType!==9){if(r.nodeType===11){a="host"in r?r.host:null,a!==null&&a.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=a?t.length-1:0;r!==(a?-1:t.length);){var u=t[r];u.tag===6?(u=N(u),jp(u,a)):N(u).scrollIntoView(e),r+=a?-1:1}};function H_(e,t){return e=N(e),Tp(e,t),!1}function Tp(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Rp(e,t){var a=t._eventListeners;if(a!==null)for(var r=0;r<a.length;r++){var u=a[r];e.addEventListener(u.type,u.attachedListener,ri(u.optionsOrUseCapture))}e.nodeType!==3&&(a=t._observers,a!==null&&a.forEach(function(c){for(var p=0,_=0;_<mn.length;_++){var S=mn[_];(S.fragmentInstance!==t||S.observer!==c||S.instance!==e)&&(mn[p++]=S)}mn.length=p,c.observe(e)}),Tp(e,t))}function q_(e,t){var a=t._eventListeners;if(a!==null)for(var r=0;r<a.length;r++){var u=a[r];e.removeEventListener(u.type,u.attachedListener,ri(u.optionsOrUseCapture))}e.nodeType!==3&&(a=t._observers,a!==null&&a.forEach(function(c){typeof c.rootMargin=="str
49ing"?M_(t,c,e):c.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function jh(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":jh(a),sl(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function $_(e,t,a,r){for(;e.nodeType===1;){var u=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[zi])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=an(e.nextSibling),e===null)break}return null}function I_(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 Ap(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 Th(e){return e.data==="$?"||e.data==="$~"}function Rh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function P_(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 Ah=null;function Np(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 Op(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 G_(e,t){function a(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener("focus",a,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",a,!0)}return r}function V_(e){pp(function(){pp(function(t){return e(t)})})}function Cp(e,t,a){switch(t=br(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 kp(e,t,a){for(var r in a){var u=a[r];a.hasOwnProperty(r)&&u!=null&&ke(e,t,r,null,__,u)}a.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===jn&&(e.onclick=null),sl(e)}function Nh(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);sl(e)}var sn=new Map,Dp=new Set;function _r(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var ta=ue.d;ue.d={f:K_,r:Y_,D:J_,C:Q_,L:X_,m:Z_,X:W_,S:F_,M:ex};function K_(){var e=ta.f(),t=lo();return e||t}function Y_(e){var t=js(e);t!==null&&t.tag===5&&t.type==="form"?Lm(t):ta.r(e)}var li=typeof document>"u"?null:document;function Up(e,t,a){var r=li;if(r&&typeof t=="string"&&t){var u=Xt(t);
vendor: 8,076 bytes, line 49
49u='link[rel="'+e+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),Dp.has(u)||(Dp.add(u),e={rel:e,crossOrigin:a,href:t},r.querySelector(u)===null&&(t=r.createElement("link"),yt(t,"link",e),it(t),r.head.appendChild(t)))}}function J_(e){ta.D(e),Up("dns-prefetch",e,null)}function Q_(e,t){ta.C(e,t),Up("preconnect",e,t)}function X_(e,t,a){ta.L(e,t,a);var r=li;if(r&&e&&t){var u='link[rel="preload"][as="'+Xt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+Xt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+Xt(a.imageSizes)+'"]')):u+='[href="'+Xt(e)+'"]';var c=u;switch(t){case"style":c=oi(e);break;case"script":c=ui(e)}if(!(sn.has(c)||(e=G({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),sn.set(c,e),r.querySelector(u)!==null||t==="style"&&r.querySelector(xr(c))||t==="script"&&r.querySelector(wr(c))))){var p=r.createElement("link");yt(p,"link",e),t==="style"&&(p[al]=!0,p.onload=p.onerror=function(){Kd(p)}),it(p),r.head.appendChild(p)}}}function Z_(e,t){ta.m(e,t);var a=li;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Xt(r)+'"][href="'+Xt(e)+'"]',c=u;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=ui(e)}if(!sn.has(c)&&(e=G({rel:"modulepreload",href:e},t),sn.set(c,e),a.querySelector(u)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(wr(c)))return}r=a.createElement("link"),yt(r,"link",e),it(r),a.head.appendChild(r)}}}function F_(e,t,a){ta.S(e,t,a);var r=li;if(r&&e){var u=Ts(r).hoistableStyles,c=oi(e);t=t||"default";var p=u.get(c);if(!p){var _={loading:0,preload:null};if(p=r.querySelector(xr(c)))_.loading=5;else{e=G({rel:"stylesheet",href:e,"data-precedence":t},a),(a=sn.get(c))&&Oh(e,a);var S=p=r.createElement("link");it(S),yt(S,"link",e),S._p=new Promise(function(U,z){S.onload=U,S.onerror=z}),S.addEventListener("load",function(){_.loading|=1}),S.addEventListener("error",function(){_.loading|=2}),_.loading|=4,go(p,t,r)}p={type:"stylesheet",instance:p,count:1,state:_},u.set(c,p)}}}function W_(e,t){ta.X(e,t);var a=li;if(a&&e){var r=Ts(a).hoistableScripts,u=ui(e),c=r.get(u);c||(c=a.querySelector(wr(u)),c||(e=G({src:e,async:!0},t),(t=sn.get(u))&&Ch(e,t),c=a.createElement("script"),it(c),yt(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},r.set(u,c))}}function ex(e,t){ta.M(e,t);var a=li;if(a&&e){var r=Ts(a).hoistableScripts,u=ui(e),c=r.get(u);c||(c=a.querySelector(wr(u)),c||(e=G({src:e,async:!0,type:"module"},t),(t=sn.get(u))&&Ch(e,t),c=a.createElement("script"),it(c),yt(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},r.set(u,c))}}function Lp(e,t,a,r){var u=(u=ha.current)?_r(u):null;if(!u)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(a=oi(a.href),t=Ts(u).hoistableStyles,r=t.get(a),r||(r={type:"style",instance:null,count:0,state:null},t.set(a,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=oi(a.href);var c=Ts(u).hoistableStyles,p=c.get(e);if(p||(u=u.ownerDocument||u,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,p),(c=u.querySelector(xr(e)))?c._p||(p.instance=c,p.state.loading=5):(c=sn.get(e),c||(c={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,c)),tx(u,e,c,p.state))),t&&r===null)throw Error(l(528,""));return p}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"?(a=ui(a),t=Ts(u).hoistableScripts,r=t.get(a),r||(r={type:"script",instance:null,count:0,state:null},t.set(a,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function oi(e){return'href="'+Xt(e)+'"'}function xr(e){return'link[rel="stylesheet"]['+e+"]"}function Mp(e){return G({},e,{"data-precedence":e.precedence,precedence:null})}function tx(e,t,a,r){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[al]!==!0){r.loading=1;return}}else t=e.createElement("link"),t[al]=!0,t.onload=t.onerror=Kd.bind(null,t),yt(t,"link",a),it(t),e.head.appendChild(t);r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2})}function ui(e){return'[src="'+Xt(e)+'"]'}function wr(e){return"script[async]"+e}function zp(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Xt(a.href)+'"]');if(r)return t.instance=r,it(r),r;var u=G({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),it(r),yt(r,"style",u),go(r,a.precedence,e),t.instance=r;case"stylesheet":u=oi(a.href);var c=e.querySelector(xr(u));if(c)return t.state.loading|=4,t.instance=c,it(c),c;r=Mp(a),(u=sn.get(u))&&Oh(r,u),c=(e.ownerDocument||e).createElement("link"),it(c);var p=c;return p._p=new Promise(function(_,S){p.onload=_,p.onerror=S}),yt(c,"link",r),t.state.loading|=4,go(c,a.precedence,e),t.instance=c;case"script":return c=ui(a.src),(u=e.querySelector(wr(c)))?(t.instance=u,it(u),u):(r=a,(u=sn.get(c))&&(r=G({},a),Ch(r,u)),e=e.ownerDocument||e,u=e.createElement("script"),it(u),yt(u,"link",r),e.head.appendChild(u),t.instance=u);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,go(r,a.precedence,e));return t.instance}function go(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=r.length?r[r.length-1]:null,c=u,p=0;p<r.length;p++){var _=r[p];if(_.dataset.precedence===t)c=_;else if(c!==u)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Oh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ch(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var po=null;function Bp(e,t,a){if(po===null){var r=new Map,u=po=new Map;u.set(a,r)}else u=po,r=u.get(a),r||(r=new Map,u.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),u=0;u<a.length;u++){var c=a[u];if(!(c[zi]||c[ft]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var p=c.getAttribute(t)||"";p=e+p;var _=r.get(p);_?_.push(c):r.set(p,[c])}}return r}function kh(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function nx(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;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!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 Hp(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function qp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function $p(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Ip(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=$p(t),e.suspenseyImages.push(t)),e=ix.bind(e),t.decode().then(e,e))}function ax(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="str
49ing"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=oi(r.href),c=t.querySelector(xr(u));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Sr.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=c,it(c);return}c=t.ownerDocument||t,r=Mp(r),(u=sn.get(u))&&Oh(r,u),c=c.createElement("link"),it(c);var p=c;p._p=new Promise(function(_,S){p.onload=_,p.onerror=S}),yt(c,"link",r),a.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Sr.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var vo=0;function sx(e,t){return e.stylesheets&&e.count===0&&bo(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&bo(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&vo===0&&(vo=62500*w_());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&bo(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>vo?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(u)}}:null}function Pp(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)bo(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Sr(){this.count--,Pp(this)}function ix(){this.imgCount--,Pp(this)}var yo=null;function bo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,yo=new Map,t.forEach(rx,e),yo=null,Sr.call(e))}function rx(e,t){if(!(t.state.loading&4)){var a=yo.get(e);if(a)var r=a.get(null);else{a=new Map,yo.set(e,a);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<u.length;c++){var p=u[c];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(a.set(p.dataset.precedence,p),r=p)}r&&a.set(null,r)}u=t.instance,p=u.getAttribute("data-precedence"),c=a.get(p)||r,c===r&&a.set(null,u),a.set(p,u),this.count++,r=Sr.bind(this),u.addEventListener("load",r),u.addEventListener("error",r),c?c.parentNode.insertBefore(u,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var ci={$$typeof:K,Provider:null,Consumer:null,_currentValue:qn,_currentValue2:qn,_threadCount:0};function lx(e,t,a,r,u,c,p,_,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=du(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=du(0),this.hiddenUpdates=du(null),this.identifierPrefix=r,this.onUncaughtError=u,this.onCaughtError=c,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.transitionTypes=null,this.incompleteTransitions=new Map}function Gp(e,t,a,r,u,c,p,_,S,U,z,P){return e=new lx(e,t,a,p,S,U,z,P,_),t=1,c===!0&&(t|=24),c=Nt(3,null,null,t),e.current=c,c.stateNode=e,t=Yu(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:r,isDehydrated:a,cache:t},Zu(c),e}function Vp(e){return e?(e=Ms,e):Ms}function Kp(e,t,a,r,u,c){u=Vp(u),r.context===null?r.context=u:r.pendingContext=u,r=wa(t),r.payload={element:a},c=c===void 0?null:c,c!==null&&(r.callback=c),a=Sa(e,r,t),a!==null&&(Dt(a,e,t),er(a,e,t))}function Yp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Dh(e,t){Yp(e,t),(e=e.alternate)&&Yp(e,t)}function Jp(e){if(e.tag===13||e.tag===31){var t=Xa(e,67108864);t!==null&&Dt(t,e,67108864),Dh(e,67108864)}}function Qp(e){if(e.tag===13||e.tag===31){var t=Vt();t=fu(t);var a=Xa(e,t);a!==null&&Dt(a,e,t),Dh(e,t)}}var hi=!0;function ox(e,t,a,r){var u=te.T;te.T=null;var c=ue.p;try{ue.p=2,Uh(e,t,a,r)}finally{ue.p=c,te.T=u}}function ux(e,t,a,r){var u=te.T;te.T=null;var c=ue.p;try{ue.p=8,Uh(e,t,a,r)}finally{ue.p=c,te.T=u}}function Uh(e,t,a,r){if(hi){var u=Lh(r);if(u===null)gh(e,t,r,_o,a),Zp(e,r);else if(hx(u,e,t,a,r))r.stopPropagation();else if(Zp(e,r),t&4&&-1<cx.indexOf(e)){for(;u!==null;){var c=js(u);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var p=Va(c.pendingLanes);if(p!==0){var _=c;for(_.pendingLanes|=2,_.entangledLanes|=2;p;){var S=1<<31-Bt(p);_.entanglements[1]|=S,p&=~S}Ln(c),(Te&6)===0&&(so=Mt()+500,pr(0))}}break;case 31:case 13:_=Xa(c,2),_!==null&&Dt(_,c,2),lo(),Dh(c,2)}if(c=Lh(r),c===null&&gh(e,t,r,_o,a),c===u)break;u=c}u!==null&&r.stopPropagation()}else gh(e,t,r,null,a)}}function Lh(e){return e=_u(e),Mh(e)}var _o=null;function Mh(e){if(_o=null,e=Ka(e),e!==null){var t=h(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=f(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 _o=e,null}function Xp(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close"
vendor: 6,280 bytes, line 49
49: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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(w0()){case Ud:return 2;case Ld:return 8;case Fr:case S0:return 32;case Md:return 268435456;default:return 32}default:return 32}}var zh=!1,La=null,Ma=null,za=null,Er=new Map,jr=new Map,Ba=[],cx="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 Zp(e,t){switch(e){case"focusin":case"focusout":La=null;break;case"dragenter":case"dragleave":Ma=null;break;case"mouseover":case"mouseout":za=null;break;case"pointerover":case"pointerout":Er.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":jr.delete(t.pointerId)}}function Tr(e,t,a,r,u,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:c,targetContainers:[u]},t!==null&&(t=js(t),t!==null&&Jp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function hx(e,t,a,r,u){switch(t){case"focusin":return La=Tr(La,e,t,a,r,u),!0;case"dragenter":return Ma=Tr(Ma,e,t,a,r,u),!0;case"mouseover":return za=Tr(za,e,t,a,r,u),!0;case"pointerover":var c=u.pointerId;return Er.set(c,Tr(Er.get(c)||null,e,t,a,r,u)),!0;case"gotpointercapture":return c=u.pointerId,jr.set(c,Tr(jr.get(c)||null,e,t,a,r,u)),!0}return!1}function Fp(e){var t=Ka(e.target);if(t!==null){var a=h(t);if(a!==null){if(t=a.tag,t===13){if(t=f(a),t!==null){e.blockedOn=t,Pd(e.priority,function(){Qp(a)});return}}else if(t===31){if(t=m(a),t!==null){e.blockedOn=t,Pd(e.priority,function(){Qp(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 xo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Lh(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);bu=r,a.target.dispatchEvent(r),bu=null}else return t=js(a),t!==null&&Jp(t),e.blockedOn=a,!1;t.shift()}return!0}function Wp(e,t,a){xo(e)&&a.delete(t)}function dx(){zh=!1,La!==null&&xo(La)&&(La=null),Ma!==null&&xo(Ma)&&(Ma=null),za!==null&&xo(za)&&(za=null),Er.forEach(Wp),jr.forEach(Wp)}function wo(e,t){e.blockedOn===t&&(e.blockedOn=null,zh||(zh=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,dx)))}var So=null;function ev(e){So!==e&&(So=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){So===e&&(So=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],u=e[t+2];if(typeof r!="function"){if(Mh(r||a)===null)continue;break}var c=js(a);c!==null&&(e.splice(t,3),t-=3,yc(c,{pending:!0,data:u,method:a.method,action:r},r,u))}}))}function di(e){function t(S){return wo(S,e)}La!==null&&wo(La,e),Ma!==null&&wo(Ma,e),za!==null&&wo(za,e),Er.forEach(t),jr.forEach(t);for(var a=0;a<Ba.length;a++){var r=Ba[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ba.length&&(a=Ba[0],a.blockedOn===null);)Fp(a),a.blockedOn===null&&Ba.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var u=a[r],c=a[r+1],p=u[At]||null;if(typeof c=="function")p||ev(a);else if(p){var _=null;if(c&&c.hasAttribute("formAction")){if(u=c,p=c[At]||null)_=p.formAction;else if(Mh(u)!==null)continue}else _=p.action;typeof _=="function"?a[r+1]=_:(a.splice(r,3),r-=3),ev(a)}}}function tv(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(p){return u=p})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,u=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),u!==null&&(u(),u=null)}}}function Bh(e){this._internalRoot=e}Eo.prototype.render=Bh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var a=t.current,r=Vt();Kp(a,r,e,t,null,null)},Eo.prototype.unmount=Bh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Kp(e.current,2,null,e,null,null),lo(),t[Es]=null}};function Eo(e){this._internalRoot=e}Eo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Id();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Ba.length&&t!==0&&t<Ba[a].priority;a++);Ba.splice(a,0,e),a===0&&Fp(e)}};var nv=n.version;if(nv!=="19.3.0")throw Error(l(527,nv,"19.3.0"));ue.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=v(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var fx={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:te,reconcilerVersion:"19.3.0"};
49if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var jo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jo.isDisabled&&jo.supportsFiber)try{Ui=jo.inject(fx),zt=jo}catch{}}return Ar.createRoot=function(e,t){if(!o(e))throw Error(l(299));var a=!1,r="",u=Vm,c=Km,p=Ym;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(p=t.onRecoverableError)),t=Gp(e,1,!1,null,null,a,r,null,u,c,p,tv),e[Es]=t.current,mh(e),new Bh(t)},Ar.hydrateRoot=function(e,t,a){if(!o(e))throw Error(l(299));var r=!1,u="",c=Vm,p=Km,_=Ym,S=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(c=a.onUncaughtError),a.onCaughtError!==void 0&&(p=a.onCaughtError),a.onRecoverableError!==void 0&&(_=a.onRecoverableError),a.formState!==void 0&&(S=a.formState)),t=Gp(e,1,!0,t,a??null,r,u,S,c,p,_,tv),t.context=Vp(null),a=t.current,r=Vt(),r=fu(r),u=wa(r),u.callback=null,Sa(a,u,r),a=r,t.current.lanes=a,Mi(t,a),Ln(t),e[Es]=t.current,mh(e),new Eo(t)},Ar.version="19.3.0",Ar}var dv;function jx(){if(dv)return $h.exports;dv=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(n){console.error(n)}}return s(),$h.exports=Ex(),$h.exports}var Tx=jx();/** 50 * react-router v7.18.4 51 * 52 * Copyright (c) Remix Software Inc. 53 * 54 * This source code is licensed under the MIT license found in the 55 * LICENSE.md file in the root directory of this source tree. 56 * 57 * @license MIT 58 */var vd=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,_y=/^[\\/]{2}/;function Rx(s,n){return n+s.replace(/\\/g,"/")}var fv="popstate";function mv(s){return typeof s=="object"&&s!=null&&"pathname"in s&&"search"in s&&"hash"in s&&"state"in s&&"key"in s}function Ax(s={}){function n(l,o){var v;let h=(v=o.state)==null?void 0:v.masked,{pathname:f,search:m,hash:g}=h||l.location;return nd("",{pathname:f,search:m,hash:g},o.state&&o.state.usr||null,o.state&&o.state.key||"default",h?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,o){return typeof o=="string"?o:_s(o)}return Ox(n,i,null,s)}function Pe(s,n){if(s===!1||s===null||typeof s>"u")throw new Error(n)}function ln(s,n){if(!s){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function Nx(){return Math.random().toString(36).substring(2,10)}function gv(s,n){return{usr:s.state,key:s.key,idx:n,masked:s.mask?{pathname:s.pathname,search:s.search,hash:s.hash}:void 0}}function nd(s,n,i=null,l,o){return{pathname:typeof s=="string"?s:s.pathname,search:"",hash:"",...typeof n=="string"?Ai(n):n,state:i,key:n&&n.key||l||Nx(),mask:o}}function _s({pathname:s="/",search:n="",hash:i=""}){return n&&n!=="?"&&(s+=n.charAt(0)==="?"?n:"?"+n),i&&i!=="#"&&(s+=i.charAt(0)==="#"?i:"#"+i),s}function Ai(s){let n={};if(s){let i=s.indexOf("#");i>=0&&(n.hash=s.substring(i),s=s.substring(0,i));let l=s.indexOf("?");l>=0&&(n.search=s.substring(l),s=s.substring(0,l)),s&&(n.pathname=s)}return n}function Ox(s,n,i,l={}){let{window:o=document.defaultView,v5Compat:h=!1}=l,f=o.history,m="POP",g=null,v=b();v==null&&(v=0,f.replaceState({...f.state,idx:v},""));function b(){return(f.state||{idx:null}).idx}function y(){m="POP";let N=b(),T=N==null?null:N-v;v=N,g&&g({action:m,location:j.location,delta:T})}function w(N,T){m="PUSH";let C=mv(N)?N:nd(j.location,N,T);v=b()+1;let B=gv(C,v),Q=j.createHref(C.mask||C);try{f.pushState(B,"",Q)}catch(ee){if(ee instanceof DOMException&&ee.name==="DataCloneError")throw ee;o.location.assign(Q)}h&&g&&g({action:m,location:j.location,delta:1})}function x(N,T){m="REPLACE";let C=mv(N)?N:nd(j.location,N,T);v=b();let B=gv(C,v),Q=j.createHref(C.mask||C);f.replaceState(B,"",Q),h&&g&&g({action:m,location:j.location,delta:0})}function R(N){return Cx(o,N)}let j={get action(){return m},get location(){return s(o,f)},listen(N){if(g)throw new Error("A history only accepts one active listener");return o.addEventListener(fv,y),g=N,()=>{o.removeEventListener(fv,y),g=null}},createHref(N){return n(o,N)},createURL:R,encodeLocation(N){let T=R(N);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:w,replace:x,go(N){return f.go(N)}};return j}function Cx(s,n,i=!1){let l="http://localhost";s&&(l=s.location.origin!=="null"?s.location.origin:s.location.href),Pe(l,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:_s(n);return o=o.replace(/ $/,"%20"),!i&&_y.test(o)&&(o=l+o),new URL(o,l)}function xy(s,n,i="/"){return kx(s,n,i,!1)}function kx(s,n,i,l,o){let h=typeof n=="string"?Ai(n):n,f=ca(h.pathname||"/",i);if(f==null)return null;let m=Dx(s),g=null,v=Gx(f);for(let b=0;g==null&&b<m.length;++b)g=Px(m[b],v,l);return g}function Dx(s){let n=wy(s);return Ux(n),n}function wy(s,n=[],i=[],l="",o=!1){let h=(f,m,g=o,v)=>{let b={relativePath:v===void 0?f.path||"":v,caseSensitive:f.caseSensitive===!0,childrenIndex:m,route:f};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(l)&&g)return;Pe(b.relativePath.startsWith(l),`Absolute route path "${b.relativePath}" nested under path "${l}
58" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(l.length)}let y=yn([l,b.relativePath]),w=i.concat(b);f.children&&f.children.length>0&&(Pe(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),wy(f.children,n,w,y,g)),!(f.path==null&&!f.index)&&n.push({path:y,score:$x(y,f.index),routesMeta:w.map((x,R)=>{let[j,N]=jy(x.relativePath,x.caseSensitive,R===w.length-1);return{...x,matcher:j,compiledParams:N}})})};return s.forEach((f,m)=>{var g;if(f.path===""||!((g=f.path)!=null&&g.includes("?")))h(f,m);else for(let v of Sy(f.path))h(f,m,!0,v)}),n}function Sy(s){let n=s.split("/");if(n.length===0)return[];let[i,...l]=n,o=i.endsWith("?"),h=i.replace(/\?$/,"");if(l.length===0)return o?[h,""]:[h];let f=Sy(l.join("/")),m=[];return m.push(...f.map(g=>g===""?h:[h,g].join("/"))),o&&m.push(...f),m.map(g=>s.startsWith("/")&&g===""?"/":g)}function Ux(s){s.sort((n,i)=>n.score!==i.score?i.score-n.score:Ix(n.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var Lx=/^:[\w-]+$/,Mx=3,zx=2,Bx=1,Hx=10,qx=-2,pv=s=>s==="*";function $x(s,n){let i=s.split("/"),l=i.length;return i.some(pv)&&(l+=qx),n&&(l+=zx),i.filter(o=>!pv(o)).reduce((o,h)=>o+(Lx.test(h)?Mx:h===""?Bx:Hx),l)}function Ix(s,n){return s.length===n.length&&s.slice(0,-1).every((l,o)=>l===n[o])?s[s.length-1]-n[n.length-1]:0}function Px(s,n,i=!1){let{routesMeta:l}=s,o={},h="/",f=[];for(let m=0;m<l.length;++m){let g=l[m],v=m===l.length-1,b=h==="/"?n:n.slice(h.length)||"/",y={path:g.relativePath,caseSensitive:g.caseSensitive,end:v},w=g.matcher&&g.compiledParams?Ey(y,b,g.matcher,g.compiledParams):qo(y,b),x=g.route;if(!w&&v&&i&&!l[l.length-1].route.index&&(w=qo({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},b)),!w)return null;
58Object.assign(o,w.params),f.push({params:o,pathname:yn([h,w.pathname]),pathnameBase:Yx(yn([h,w.pathnameBase])),route:x}),w.pathnameBase!=="/"&&(h=yn([h,w.pathnameBase]))}return f}function qo(s,n){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[i,l]=jy(s.path,s.caseSensitive,s.end);return Ey(s,n,i,l)}function Ey(s,n,i,l){let o=n.match(i);if(!o)return null;let h=o[0],f=ji(h,1),m=o.slice(1);return{params:l.reduce((v,{paramName:b,isOptional:y},w)=>{if(b==="*"){let R=m[w]||"";f=ji(h.slice(0,h.length-R.length),1)}const x=m[w];return y&&!x?v[b]=void 0:v[b]=(x||"").replace(/%2F/g,"/"),v},{}),pathname:h,pathnameBase:f,pattern:s}}function jy(s,n=!1,i=!0){ln(s==="*"||!s.endsWith("*")||s.endsWith("/*"),`Route path "${s}" will be treated as if it were "${s.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${s.replace(/\*$/,"/*")}".`);let l=[],o="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,m,g,v,b)=>{if(l.push({paramName:m,isOptional:g!=null}),g){let y=b.charAt(v+f.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return s.endsWith("*")?(l.push({paramName:"*"}),o+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?o+="\\/*$":s!==""&&s!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),l]}function Gx(s){try{return s.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return ln(!1,`The URL path "${s}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),s}}function ca(s,n){if(n==="/")return s;if(!s.toLowerCase().startsWith(n.toLowerCase()))return null;let i=n.endsWith("/")?n.length-1:n.length,l=s.charAt(i);return l&&l!=="/"?null:s.slice(i)||"/"}function Vx(s,n="/"){let{pathname:i,search:l="",hash:o=""}=typeof s=="string"?Ai(s):s,h;return i?(i=Ty(i),i.startsWith("/")||i.startsWith("\\")?h=vv(i.substring(1),"/"):h=vv(i,n)):h=n,{pathname:h,search:Jx(l),hash:Qx(o)}}function vv(s,n){let i=ji(n).split("/");return s.split("/").forEach(o=>{o===".."?i.length>1&&i.pop():o!=="."&&i.push(o)}),i.length>1?i.join("/"):"/"}function Vh(s,n,i,l){return`Cannot include a '${s}' character in a manually specified \`to.${n}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Kx(s){return s.filter((n,i)=>i===0||n.route.path&&n.route.path.length>0)}function yd(s){let n=Kx(s);return n.map((i,l)=>l===n.length-1?i.pathname:i.pathnameBase)}function Xo(s,n,i,l=!1){let o;typeof s=="string"?o=Ai(s):(o={...s},Pe(!o.pathname||!o.pathname.includes("?"),Vh("?","pathname","search",o)),Pe(!o.pathname||!o.pathname.includes("#"),Vh("#","pathname","hash",o)),Pe(!o.search||!o.search.includes("#"),Vh("#","search","hash",o)));let h=s===""||o.pathname==="",f=h?"/":o.pathname,m;if(f==null)m=i;else{let y=n.length-1;if(!l&&f.startsWith("..")){let w=f.split("/");for(;w[0]==="..";)w.shift(),y-=1;o.pathname=w.join("/")}m=y>=0?n[y]:"/"}let g=Vx(o,m),v=f&&f!=="/"&&f.endsWith("/"),b=(h||f===".")&&i.endsWith("/");return!g.pathname.endsWith("/")&&(v||b)&&(g.pathname+="/"),g}var Ty=s=>s.replace(/[\\/]{2,}/g,"/"),yn=s=>Ty(s.join("/"));function ji(s,n=0){let i=s.length;for(;i>n&&s.charCodeAt(i-1)===47;)i--;return i===s.length?s:s.slice(0,i)}var Yx=s=>ji(s).replace(/^\/*/,"/"),Jx=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,Qx=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s,Xx=class{constructor(s,n,i,l=!1){this.status=s,this.statusText=n||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Zx(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}function Fx(s){let n=s.map(i=>i.route.path).filter(Boolean);return yn(n)||"/"}var Ry=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ay(s,n){let i=s;
58if(typeof i!="string"||!vd.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,o=!1;if(Ry)try{let h=new URL(window.location.href),f=_y.test(i)?new URL(Rx(i,h.protocol)):new URL(i),m=ca(f.pathname,n);f.origin===h.origin&&m!=null?i=m+f.search+f.hash:o=!0}catch{ln(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:o,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var yv=new URL("http://localhost");function bd(s){if(s.createURL)return s.createURL("/");try{return new URL(s.createHref("/"),yv)}catch{return yv}}function Kh(s,n){return s.origin===n.origin&&(s.origin!=="null"||s.protocol===n.protocol&&s.host===n.host)}function Wx(s,n){if(s.startsWith("//"))return!0;let i=n.protocol.toLowerCase();return s.toLowerCase().startsWith(i)?n.host===""||s.slice(i.length).startsWith("//"):!1}function _d(s,n,i,l){let o=null;try{o=s==null?null:new URL(s,i)}catch{}let h=new URL(n,i),f=o!=null&&!Kh(o,i),m=!Kh(h,i);if(l==="reject"){if(f||m)throw new Error("External navigation is not allowed")}else if(m&&(o==null||!Wx(s,o)||!Kh(o,h)))throw new Error("External navigation is not allowed")}var Ny=["POST","PUT","PATCH","DELETE"];new Set(Ny);var ew=["GET",...Ny];new Set(ew);var tw=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function nw(s){try{return tw.includes(new URL(s).protocol)}catch{return!1}}var Ni=E.createContext(null);Ni.displayName="DataRouter";var Zo=E.createContext(null);Zo.displayName="DataRouterState";var Oy=E.createContext(!1);function aw(){return E.useContext(Oy)}var Cy=E.createContext({isTransitioning:!1});Cy.displayName="ViewTransition";var sw=E.createContext(new Map);sw.displayName="Fetchers";var iw=E.createContext(null);iw.displayName="Await";var Qt=E.createContext(null);Qt.displayName="Navigation";var Gr=E.createContext(null);Gr.displayName="Location";var bn=E.createContext({outlet:null,matches:[],isDataRoute:!1});bn.displayName="Route";
58var xd=E.createContext(null);xd.displayName="RouteError";var ky="REACT_ROUTER_ERROR",rw="REDIRECT",lw="ROUTE_ERROR_RESPONSE";function ow(s){if(s.startsWith(`${ky}:${rw}:{`))try{let n=JSON.parse(s.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function uw(s){if(s.startsWith(`${ky}:${lw}:{`))try{let n=JSON.parse(s.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new Xx(n.status,n.statusText,n.data)}catch{}}function cw(s,{relative:n}={}){Pe(Oi(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:l}=E.useContext(Qt),{hash:o,pathname:h,search:f}=Kr(s,{relative:n}),m=h;return i!=="/"&&(m=h==="/"?i:yn([i,h])),l.createHref({pathname:m,search:f,hash:o})}function Oi(){return E.useContext(Gr)!=null}function _n(){return Pe(Oi(),"useLocation() may be used only in the context of a <Router> component."),E.useContext(Gr).location}var Dy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Uy(s){E.useContext(Qt).static||E.useLayoutEffect(s)}function Vr(){let{isDataRoute:s}=E.useContext(bn);return s?Sw():hw()}function hw(){Pe(Oi(),"useNavigate() may be used only in the context of a <Router> component.");let s=E.useContext(Ni),{basename:n,navigator:i}=E.useContext(Qt),{matches:l}=E.useContext(bn),{pathname:o}=_n(),h=JSON.stringify(yd(l)),f=E.useRef(!1);return Uy(()=>{f.current=!0}),E.useCallback((g,v={})=>{if(ln(f.current,Dy),!f.current)return;if(typeof g=="number"){i.go(g);return}let b=Xo(g,JSON.parse(h),o,v.relative==="path");s==null&&n!=="/"&&(b.pathname=b.pathname==="/"?n:yn([n,b.pathname])),_d(typeof g=="string"?g:_s(g),i.createHref(b),bd(i),"reject"),(v.replace?i.replace:i.push)(b,v.state,v)},[n,i,h,o,s])}E.createContext(null);function xs(){let{matches:s}=E.useContext(bn),n=s[s.length-1];return(n==null?void 0:n.params)??{}}function Kr(s,{relative:n}={}){let{matches:i}=E.useContext(bn),{pathname:l}=_n(),o=JSON.stringify(yd(i));return E.useMemo(()=>Xo(s,JSON.parse(o),l,n==="path"),[s,o,l,n])}function dw(s,n){return Ly(s,n)}function Ly(s,n,i){var N;Pe(Oi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=E.useContext(Qt),{matches:o}=E.useContext(bn),h=o[o.length-1],f=h?h.params:{},m=h?h.pathname:"/",g=h?h.pathnameBase:"/",v=h&&h.route;{let T=v&&v.path||"";zy(m,!v||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. 59 60Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let b=_n(),y;if(n){let T=typeof n=="string"?Ai(n):n;Pe(g==="/"||((N=T.pathname)==null?void 0:N.startsWith(g)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${T.pathname}" was given in the \`location\` prop.`),y=T}else y=b;let w=y.pathname||"/",x=w;if(g!=="/"){let T=g.replace(/^\//,"").split("/");x="/"+w.replace(/^\//,"").split("/").slice(T.length).join("/")}let R=i&&i.state.matches.length?i.state.matches.map(T=>Object.assign(T,{route:i.manifest[T.route.id]||T.route})):xy(s,{pathname:x});ln(v||R!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),ln(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=vw(R&&R.map(T=>Object.assign({},T,{params:Object.assign({},f,T.params),pathname:yn([g,l.encodeLocation?l.encodeLocation(T.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?g:yn([g,l.encodeLocation?l.encodeLocation(T.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),o,i);return n&&j?E.createElement(Gr.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},j):j}function fw(){let s=ww(),n=Zx(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),i=s instanceof Error?s.stack:null,l="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:l},h={padding:"2px 4px",backgroundColor:l},f=null;return console.error("Error handled by React Router default ErrorBoundary:",s),f=E.createElement(E.Fragment,null,E.createElement("p",null,"ð¿ Hey developer ð"),E.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",E.createElement("code",{style:h},"ErrorBoundary")," or"," ",E.createElement("code",{style:h},"errorElement")," prop on your route.")),E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application
60Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},n),i?E.createElement("pre",{style:o},i):null,f)}var mw=E.createElement(fw,null),My=class extends E.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,n){return n.location!==s.location||n.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:n.error,location:n.location,revalidation:s.revalidation||n.revalidation}}componentDidCatch(s,n){this.props.onError?this.props.onError(s,n):console.error("React Router caught the following error during render",s)}render(){let s=this.state.error;if(this.context&&typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){const i=uw(s.digest);i&&(s=i)}let n=s!==void 0?E.createElement(bn.Provider,{value:this.props.routeContext},E.createElement(xd.Provider,{value:s,children:this.props.component})):this.props.children;return this.context?E.createElement(gw,{error:s},n):n}};My.contextType=Oy;var Yh=new WeakMap;function gw({children:s,error:n}){let{basename:i,navigator:l}=E.useContext(Qt);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=ow(n.digest);if(o){let h=Yh.get(n);if(h)throw h;let f=Ay(o.location,i),m=f.absoluteURL||f.to;if(_d(o.location,m,bd(l),"allow-explicit"),nw(m))throw new Error("Invalid redirect location");if(Ry&&!Yh.get(n))if(f.isExternal||o.reloadDocument)window.location.href=m;else{const g=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:o.replace}));throw Yh.set(n,g),g}return E.createElement("meta",{httpEquiv:"refresh",content:`0;url=${m}`})}}return s}function pw({routeContext:s,match:n,children:i}){let l=E.useContext(Ni);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),E.createElement(bn.Provider,{value:s},i)}function vw(s,n=[],i){let l=i==null?void 0:i.state;if(s==null){if(!l)return null;if(l.errors)s=l.matches;else if(n.length===0&&!l.initialized&&l.matches.length>0)s=l.matches;else return null}let o=s,h=l==null?void 0:l.errors;if(h!=null){let b=o.findIndex(y=>y.route.id&&(h==null?void 0:h[y.route.id])!==void 0);Pe(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),o=o.slice(0,Math.min(o.length,b+1))}let f=!1,m=-1;if(i&&l){f=l.renderFallback;for(let b=0;b<o.length;b++){let y=o[b];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(m=b),y.route.id){let{loaderData:w,errors:x}=l,R=y.route.loader&&!w.hasOwnProperty(y.route.id)&&(!x||x[y.route.id]===void 0);if(y.route.lazy||R){i.isStatic&&(f=!0),m>=0?o=o.slice(0,m+1):o=[o[0]];break}}}}let g=i==null?void 0:i.onError,v=l&&g?(b,y)=>{var w,x;g(b,{location:l.location,params:((x=(w=l.matches)==null?void 0:w[0])==null?void 0:x.params)??{},pattern:Fx(l.matches),errorInfo:y})}:void 0;return o.reduceRight((b,y,w)=>{let x,R=!1,j=null,N=null;l&&(x=h&&y.route.id?h[y.route.id]:void 0,j=y.route.errorElement||mw,f&&(m<0&&w===0?(zy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,N=null):m===w&&(R=!0,N=y.route.hydrateFallbackElement||null)));let T=n.concat(o.slice(0,w+1)),C=()=>{let B;return x?B=j:R?B=N:y.route.Component?B=E.createElement(y.route.Component,null):y.route.element?B=y.route.element:B=b,E.createElement(pw,{match:y,routeContext:{outlet:b,matches:T,isDataRoute:l!=null},children:B})};return l&&(y.route.ErrorBoundary||y.route.errorElement||w===0)?E.createElement(My,{location:l.location,revalidation:l.revalidation,component:j,error:x,children:C(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:v}):C()},null)}function wd(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yw(s){let n=E.useContext(Ni);return Pe(n,wd(s)),n}function bw(s){let n=E.useContext(Zo);return Pe(n,wd(s)),n}function _w(s){let n=E.useContext(bn);return Pe(n,wd(s)),n}
60function Sd(s){let n=_w(s),i=n.matches[n.matches.length-1];return Pe(i.route.id,`${s} can only be used on routes that contain a unique "id"`),i.route.id}function xw(){return Sd("useRouteId")}function ww(){var l;let s=E.useContext(xd),n=bw("useRouteError"),i=Sd("useRouteError");return s!==void 0?s:(l=n.errors)==null?void 0:l[i]}function Sw(){let{router:s}=yw("useNavigate"),n=Sd("useNavigate"),i=E.useRef(!1);return Uy(()=>{i.current=!0}),E.useCallback(async(o,h={})=>{ln(i.current,Dy),i.current&&(typeof o=="number"?await s.navigate(o):await s.navigate(o,{fromRouteId:n,...h}))},[s,n])}var bv={};function zy(s,n,i){!n&&!bv[s]&&(bv[s]=!0,ln(!1,i))}E.memo(Ew);function Ew({routes:s,manifest:n,future:i,state:l,isStatic:o,onError:h}){return Ly(s,void 0,{manifest:n,state:l,isStatic:o,onError:h})}function jw({to:s,replace:n,state:i,relative:l}){Pe(Oi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o,navigator:h}=E.useContext(Qt);ln(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=E.useContext(bn),{pathname:m}=_n(),g=Vr(),v=Xo(s,yd(f),m,l==="path");_d(typeof s=="string"?s:_s(s),h.createHref(v),bd(h),"reject");let b=JSON.stringify(v);return E.useEffect(()=>{g(JSON.parse(b),{replace:n,state:i,relative:l})},[g,b,l,n,i]),null}function st(s){Pe(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Tw({basename:s="/",children:n=null,location:i,navigationType:l="POP",navigator:o,static:h=!1,useTransitions:f}){Pe(!Oi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=s.replace(/^\/*/,"/"),g=E.useMemo(()=>({basename:m,navigator:o,static:h,useTransitions:f,future:{}}),[m,o,h,f]);typeof i=="string"&&(i=Ai(i));let{pathname:v="/",search:b="",hash:y="",state:w=null,key:x="default",mask:R}=i,j=E.useMemo(()=>{let N=ca(v,m);return N==null?null:{location:{pathname:N,search:b,hash:y,state:w,key:x,mask:R},navigationType:l}},[m,v,b,y,w,x,l,R]);return ln(j!=null,`<Router basename="${m}"> is not able to match the URL "${v}${b}${y}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:E.createElement(Qt.Provider,{value:g},E.createElement(Gr.Provider,{children:n,value:j}))}function _v({children:s,location:n}){return dw(ad(s),n)}function ad(s,n=[]){let i=[];return E.Children.forEach(s,(l,o)=>{if(!E.isValidElement(l))return;let h=[...n,o];if(l.type===E.Fragment){i.push.apply(i,ad(l.props.children,h));return}Pe(l.type===st,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Pe(!l.props.index||!l.props.children,"An index route cannot have child routes.");let f={id:l.props.id||h.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(f.children=ad(l.props.children,h)),i.push(f)}),i}var Lo="get",Mo="application/x-www-form-urlencoded";function Fo(s){return typeof HTMLElement<"u"&&s instanceof HTMLElement}function Rw(s){return Fo(s)&&s.tagName.toLowerCase()==="button"}function Aw(s){return Fo(s)&&s.tagName.toLowerCase()==="form"}function Nw(s){return Fo(s)&&s.tagName.toLowerCase()==="input"}function Ow(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function Cw(s,n){return s.button===0&&(!n||n==="_self")&&!Ow(s)}function sd(s=""){return new URLSearchParams(typeof s=="string"||Array.isArray(s)||s instanceof URLSearchParams?s:Object.keys(s).reduce((n,i)=>{let l=s[i];return n.concat(Array.isArray(l)?l.map(o=>[i,o]):[[i,l]])},[]))}function kw(s,n){let i=sd(s);
60return n&&n.forEach((l,o)=>{i.has(o)||n.getAll(o).forEach(h=>{i.append(o,h)})}),i}var To=null;function Dw(){if(To===null)try{new FormData(document.createElement("form"),0),To=!1}catch{To=!0}return To}var Uw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Jh(s){return s!=null&&!Uw.has(s)?(ln(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Mo}"`),null):s}function Lw(s,n){let i,l,o,h,f;if(Aw(s)){let m=s.getAttribute("action");l=m?ca(m,n):null,i=s.getAttribute("method")||Lo,o=Jh(s.getAttribute("enctype"))||Mo,h=new FormData(s)}else if(Rw(s)||Nw(s)&&(s.type==="submit"||s.type==="image")){let m=s.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=s.getAttribute("formaction")||m.getAttribute("action");if(l=g?ca(g,n):null,i=s.getAttribute("formmethod")||m.getAttribute("method")||Lo,o=Jh(s.getAttribute("formenctype"))||Jh(m.getAttribute("enctype"))||Mo,h=new FormData(m,s),!Dw()){let{name:v,type:b,value:y}=s;if(b==="image"){let w=v?`${v}.`:"";h.append(`${w}x`,"0"),h.append(`${w}y`,"0")}else v&&h.append(v,y)}}else{if(Fo(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Lo,l=null,o=Mo,f=s}return h&&o==="text/plain"&&(f=h,h=void 0),{action:l,method:i.toLowerCase(),encType:o,formData:h,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ed(s,n){if(s===!1||s===null||typeof s>"u")throw new Error(n)}function By(s,n,i,l){let o=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return i?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${l}`:o.pathname=`${o.pathname}.${l}`:o.pathname==="/"?o.pathname=`_root.${l}`:n&&ca(o.pathname,n)==="/"?o.pathname=`${ji(n)}/_root.${l}`:o.pathname=`${ji(o.pathname)}.${l}`,o}async function Mw(s,n){if(s.id in n)return n[s.id];try{let i=await import(s.module);return n[s.id]=i,i}catch(i){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function zw(s){return s==null?!1:s.href==null?s.rel==="preload"&&typeof s.imageSrcSet=="string"&&typeof s.imageSizes=="string":typeof s.rel=="string"&&typeof s.href=="string"}async function Bw(s,n,i){let l=await Promise.all(s.map(async o=>{let h=n.routes[o.route.id];if(h){let f=await Mw(h,i);return f.links?f.links():[]}return[]}));return Iw(l.flat(1).filter(zw).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function xv(s,n,i,l,o,h){let f=(g,v)=>i[v]?g.route.id!==i[v].route.id:!0,m=(g,v)=>{var b;return i[v].pathname!==g.pathname||((b=i[v].route.path)==null?void 0:b.endsWith("*"))&&i[v].params["*"]!==g.params["*"]};return h==="assets"?n.filter((g,v)=>f(g,v)||m(g,v)):h==="data"?n.filter((g,v)=>{var y;let b=l.routes[g.route.id];if(!b||!b.hasLoader)return!1;if(f(g,v)||m(g,v))return!0;if(g.route.shouldRevalidate){let w=g.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((y=i[0])==null?void 0:y.params)||{},nextUrl:new URL(s,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function Hw(s,n,{includeHydrateFallback:i}={}){return qw(s.map(l=>{let o=n.routes[l.route.id];if(!o)return[];let h=[o.module];return o.clientActionModule&&(h=h.concat(o.clientActionModule)),o.clientLoaderModule&&(h=h.concat(o.clientLoaderModule)),i&&o.hydrateFallbackModule&&(h=h.concat(o.hydrateFallbackModule)),o.imports&&(h=h.concat(o.imports)),h}).flat(1))}function qw(s){return[...new Set(s)]}function $w(s){let n={},i=Object.keys(s).sort();for(let l of i)n[l]=s[l];return n}function Iw(s,n){let i=new Set;return new Set(n),s.reduce((l,o)=>{let h=JSON.stringify($w(o));return i.has(h)||(i.add(h),l.push({key:h,link:o})),l},[])}function jd(){let s=E.useContext(Ni);return Ed(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function Pw(){let s=E.useContext(Zo);return Ed(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var Td=E.createContext(void 0);Td.displayName="FrameworkContext";function Wo(){let s=E.useContext(Td);return Ed(s,"You must render this element inside a <HydratedRouter> element"),s}function Gw(s,n){let i=E.useContext(Td),[l,o]=E.useState(!1),[h,f]=E.useState(!1),{onFocus:m,onBlur:g,onMouseEnter:v,onMouseLeave:b,onTouchStart:y}=n,w=E.useRef(null);E.useEffect(()=>
60{if(s==="render"&&f(!0),s==="viewport"){let j=T=>{T.forEach(C=>{f(C.isIntersecting)})},N=new IntersectionObserver(j,{threshold:.5});return w.current&&N.observe(w.current),()=>{N.disconnect()}}},[s]),E.useEffect(()=>{if(l){let j=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(j)}}},[l]);let x=()=>{o(!0)},R=()=>{o(!1),f(!1)};return i?s!=="intent"?[h,w,{}]:[h,w,{onFocus:Nr(m,x),onBlur:Nr(g,R),onMouseEnter:Nr(v,x),onMouseLeave:Nr(b,R),onTouchStart:Nr(y,x)}]:[!1,w,{}]}function Nr(s,n){return i=>{s&&s(i),i.defaultPrevented||n(i)}}function Vw({page:s,...n}){let i=aw(),{nonce:l}=Wo(),{router:o}=jd(),h=E.useMemo(()=>xy(o.routes,s,o.basename),[o.routes,s,o.basename]);return h?(n.nonce==null&&l&&(n={...n,nonce:l}),i?E.createElement(Yw,{page:s,matches:h,...n}):E.createElement(Jw,{page:s,matches:h,...n})):null}function Kw(s){let{manifest:n,routeModules:i}=Wo(),[l,o]=E.useState([]);return E.useEffect(()=>{let h=!1;return Bw(s,n,i).then(f=>{h||o(f)}),()=>{h=!0}},[s,n,i]),l}function Yw({page:s,matches:n,...i}){let l=_n(),{future:o}=Wo(),{basename:h}=jd(),f=E.useMemo(()=>{if(s===l.pathname+l.search+l.hash)return[];let m=By(s,h,o.v8_trailingSlashAwareDataRequests,"rsc"),g=!1,v=[];for(let b of n)typeof b.route.shouldRevalidate=="function"?g=!0:v.push(b.route.id);return g&&v.length>0&&m.searchParams.set("_routes",v.join(",")),[m.pathname+m.search]},[h,o.v8_trailingSlashAwareDataRequests,s,l,n]);return E.createElement(E.Fragment,null,f.map(m=>E.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...i})))}function Jw({page:s,matches:n,...i}){let l=_n(),{future:o,manifest:h,routeModules:f}=Wo(),{basename:m}=jd(),{loaderData:g,matches:v}=Pw(),b=E.useMemo(()=>xv(s,n,v,h,l,"data"),[s,n,v,h,l]),y=E.useMemo(()=>xv(s,n,v,h,l,"assets"),[s,n,v,h,l]),w=E.useMemo(()=>{if(s===l.pathname+l.search+l.hash)return[];let j=new Set,N=!1;if(n.forEach(C=>{var Q;let B=h.routes[C.route.id];!B||!B.hasLoader||(!b.some(ee=>ee.route.id===C.route.id)&&C.route.id in g&&((Q=f[C.route.id])!=null&&Q.shouldRevalidate)||B.hasClientLoader?N=!0:j.add(C.route.id))}),j.size===0)return[];let T=By(s,m,o.v8_trailingSlashAwareDataRequests,"data");return N&&j.size>0&&T.searchParams.set("_routes",n.filter(C=>j.has(C.route.id)).map(C=>C.route.id).join(",")),[T.pathname+T.search]},[m,o.v8_trailingSlashAwareDataRequests,g,l,h,b,n,s,f]),x=E.useMemo(()=>Hw(y,h),[y,h]),R=Kw(y);return E.createElement(E.Fragment,null,w.map(j=>E.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...i})),x.map(j=>E.createElement("link",{key:j,rel:"modulepreload",href:j,...i})),R.map(({key:j,link:N})=>E.createElement("link",{key:j,nonce:i.nonce,...N,crossOrigin:N.crossOrigin??i.crossOrigin})))}function Qw(...s){return n=>{s.forEach(i=>{typeof i=="function"?i(n):i!=null&&(i.current=n)})}}var Xw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Xw&&(window.__reactRouterVersion="7.18.4")}catch{}function Zw({basename:s,children:n,useTransitions:i,window:l}){let o=E.useRef();o.current==null&&(o.current=Ax({window:l,v5Compat:!0}));let h=o.current,[f,m]=E.useState({action:h.action,location:h.location}),g=E.useCallback(v=>{i===!1?m(v):E.startTransition(()=>m(v))},[i]);return E.useLayoutEffect(()=>h.listen(g),[h,g]),E.createElement(Tw,{basename:s,children:n,location:f.location,navigationType:f.action,navigator:h,useTransitions:i})}var Ne=E.forwardRef(function({onClick:n,discover:i="render",prefetch:l="none",relative:o,reloadDocument:h,replace:f,mask:m,state:g,target:v,to:b,preventScrollReset:y,viewTransition:w,defaultShouldRevalidate:x,...R},j){let{basename:N,navigator:T,useTransitions:C}=E.useContext(Qt),B=typeof b=="string"&&vd.test(b),Q=Ay(b,N);b=Q.to;let ee=cw(b,{relative:o}),$=_n(),G=null;if(m){let K=Xo(m,[],$.mask?$.mask.pathname:"/",!0);N!=="/"&&(K.pathname=K.pathname==="/"?N:yn([N,K.pathname])),G=T.createHref(K)}let[H,ae,ye]=Gw(l,R),$e=eS(b,{replace:f,mask:m,state:g,target:v,preventScrollReset:y,relative:o,viewTransition:w,defaultShouldRevalidate:x,useTransitions:C});function Qe(K){n&&n(K),K.defaultPrevented||$e(K)}let ht=!(Q.isExternal||h),xt=E.createElement("a",{...R,...ye,href:(ht?G:void 0)||Q.absoluteURL||ee,onClick:ht?Qe:n,ref:Qw(j,ae),target:v,"data-discover":!B&&i==="render"?"true":void 0});return H&&!B?E.createElement(E.Fragment,null,xt,E.createElement(Vw,{page:ee})):xt});Ne.displayName="Link";var Hy=E.forwardRef(function({"aria-current":n="page",caseSensitive:i=!1,className:l="",end:o=!1,style:h,to:f,viewTransition:m,children:g,...v},b){let y=Kr(f,{relative:v.relative}),w=_n(),x=E.useContext(Zo),{navigator:R,basename:j}=E.useContext(Qt),N=x!=null&&rS(y)&&m===!0,T=R.encodeLocation?R.encodeLocation(y).pathname:y.pathname,C=w.pathname,B=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;i||(C=C.toLowerCase(),B=B?B.toLowerCase():null,T=T.toLowerCase()),B&&j&&(B=ca(B,j)||B);const Q=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let ee=C===T||!o&&C.startsWith(T)&&C.charAt(Q)==="/",$=B!=null&&(B===T||!o&&B.startsWith(T)&&B.charAt(T.length)==="/"),G={isActive:ee,isPending:$,isTransitioning:N},H=ee?n:void 0,ae;typeof l=="function"?ae=l(G):ae=[l,ee?"active":null,$?"pending":null,N?"transitioning":null].filter(
60Boolean).join(" ");let ye=typeof h=="function"?h(G):h;return E.createElement(Ne,{...v,"aria-current":H,className:ae,ref:b,style:ye,to:f,viewTransition:m},typeof g=="function"?g(G):g)});Hy.displayName="NavLink";var Fw=E.forwardRef(({discover:s="render",fetcherKey:n,navigate:i,reloadDocument:l,replace:o,state:h,method:f=Lo,action:m,onSubmit:g,relative:v,preventScrollReset:b,viewTransition:y,defaultShouldRevalidate:w,...x},R)=>{let{useTransitions:j}=E.useContext(Qt),N=sS(),T=iS(m,{relative:v}),C=f.toLowerCase()==="get"?"get":"post",B=typeof m=="string"&&vd.test(m),Q=ee=>{if(g&&g(ee),ee.defaultPrevented)return;ee.preventDefault();let $=ee.nativeEvent.submitter,G=($==null?void 0:$.getAttribute("formmethod"))||f,H=()=>N($||ee.currentTarget,{fetcherKey:n,method:G,navigate:i,replace:o,state:h,relative:v,preventScrollReset:b,viewTransition:y,defaultShouldRevalidate:w});j&&i!==!1?E.startTransition(()=>H()):H()};return E.createElement("form",{ref:R,method:C,action:T,onSubmit:l?g:Q,...x,"data-discover":!B&&s==="render"?"true":void 0})});Fw.displayName="Form";function Ww(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qy(s){let n=E.useContext(Ni);return Pe(n,Ww(s)),n}function eS(s,{target:n,replace:i,mask:l,state:o,preventScrollReset:h,relative:f,viewTransition:m,defaultShouldRevalidate:g,useTransitions:v}={}){let b=Vr(),y=_n(),w=Kr(s,{relative:f});return E.useCallback(x=>{if(Cw(x,n)){x.preventDefault();let R=i!==void 0?i:_s(y)===_s(w),j=()=>b(s,{replace:R,mask:l,state:o,preventScrollReset:h,relative:f,viewTransition:m,defaultShouldRevalidate:g});v?E.startTransition(()=>j()):j()}},[y,b,w,i,l,o,n,s,h,f,m,g,v])}function tS(s){ln(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let n=E.useRef(sd(s)),i=E.useRef(!1),l=_n(),o=E.useMemo(()=>kw(l.search,i.current?null:n.current),[l.search]),h=Vr(),f=E.useCallback((m,g)=>{const v=sd(typeof m=="function"?m(new URLSearchParams(o)):m);i.current=!0,h("?"+v,g)},[h,o]);return[o,f]}var nS=0,aS=()=>`__${String(++nS)}__`;function sS(){let{router:s}=qy("useSubmit"),{basename:n}=E.useContext(Qt),i=xw(),l=s.fetch,o=s.navigate;return E.useCallback(async(h,f={})=>{let{action:m,method:g,encType:v,formData:b,body:y}=Lw(h,n);if(f.navigate===!1){let w=f.fetcherKey||aS();await l(w,i,f.action||m,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:b,body:y,formMethod:f.method||g,formEncType:f.encType||v,flushSync:f.flushSync})}else await o(f.action||m,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:b,body:y,formMethod:f.method||g,formEncType:f.encType||v,replace:f.replace,state:f.state,fromRouteId:i,flushSync:f.flushSync,viewTransition:f.viewTransition})},[l,o,n,i])}function iS(s,{relative:n}={}){let{basename:i}=E.useContext(Qt),l=E.useContext(bn);Pe(l,"useFormAction must be used inside a RouteContext");let[o]=l.matches.slice(-1),h={...Kr(s||".",{relative:n})},f=_n();if(s==null){h.search=f.search;let m=new URLSearchParams(h.search),g=m.getAll("index");if(g.some(b=>b==="")){m.delete("index"),g.filter(y=>y).forEach(y=>m.append("index",y));let b=m.toString();h.search=b?`?${b}`:""}}return(!s||s===".")&&o.route.index&&(h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(h.pathname=h.pathname==="/"?i:yn([i,h.pathname])),_s(h)}function rS(s,{relative:n}={}){let i=E.useContext(Cy);Pe(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=qy("useViewTransitionState"),o=Kr(s,{relative:n});if(!i.isTransitioning)return!1;let h=ca(i.currentLocation.pathname,l)||i.currentLocation.pathname,f=ca(i.nextLocation.pathname,l)||i.nextLocation.pathname;return qo(o.pathname,f)!=null||qo(o.pathname,h)!=null}/** 61 * @license lucide-react v0.469.0 - ISC 62 * 63 * This source code is licensed under the ISC license. 64 * See the LICENSE file in the root directory of this source tree. 65 */const lS=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$y=(...s)=>s.filter((n,i,l)=>!!n&&n.trim()!==""&&l.indexOf(n)===i).join(" ").trim();/** 66 * @license lucide-react v0.469.0 - ISC 67 * 68 * This source code is licensed under the ISC license. 69 * See the LICENSE file in the root directory of this source tree. 70 */var oS={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"};/** 71 * @license lucide-react v0.469.0 - ISC 72 * 73 * This source code is licensed under the ISC license. 74 * See the LICENSE file in the root directory of this source tree. 75 */const uS=E.forwardRef(({color:s="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:l,className:o="",children:h,iconNode:f,...m},g)=>E.createElement("svg",{ref:g,...oS,width:n,height:n,stroke:s,strokeWidth:l?Number(i)*24/Number(n):i,className:$y("lucide",o),...m},[...f.map(([v,b])=>E.createElement(v,b)),...Array.isArray(h)?h:[h]]));/** 76 * @license lucide-react v0.469.0 - ISC 77 * 78 * This source code is licensed under the ISC license. 79 * See the LICENSE file in the root directory of this source tree. 80 */const xn=(s,n)=>{const i=E.forwardRef(({className:l,...o},h)=>E.createElement(uS,{ref:h,iconNode:n,className:$y(`lucide-${lS(s)}`,l),...o}));return i.displayName=`${s}`,i};/** 81 * @license lucide-react v0.469.0 - ISC 82 * 83 * This source code is licensed under the ISC license. 84 * See the LICENSE file in the root directory of this source tree. 85 */const cS=xn("Activity",[["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
85-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** 86 * @license lucide-react v0.469.0 - ISC 87 * 88 * This source code is licensed under the ISC license. 89 * See the LICENSE file in the root directory of this source tree. 90 */const Iy=xn("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** 91 * @license lucide-react v0.469.0 - ISC 92 * 93 * This source code is licensed under the ISC license. 94 * See the LICENSE file in the root directory of this source tree. 95 */const hS=xn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 96 * @license lucide-react v0.469.0 - ISC 97 * 98 * This source code is licensed under the ISC license. 99 * See the LICENSE file in the root directory of this source tree. 100 */const dS=xn("Columns3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/** 101 * @license lucide-react v0.469.0 - ISC 102 * 103 * This source code is licensed under the ISC license. 104 * See the LICENSE file in the root directory of this source tree. 105 */const fS=xn("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** 106 * @license lucide-react v0.469.0 - ISC 107 * 108 * This source code is licensed under the ISC license. 109 * See the LICENSE file in the root directory of this source tree. 110 */const mS=xn("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** 111 * @license lucide-react v0.469.0 - ISC 112 * 113 * This source code is licensed under the ISC license. 114 * See the LICENSE file in the root directory of this source tree. 115 */const gS=xn("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 116 * @license lucide-react v0.469.0 - ISC 117 * 118 * This source code is licensed under the ISC license. 119 * See the LICENSE file in the root directory of this source tree. 120 */const pS=xn("Radar",[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]]);/** 121 * @license lucide-react v0.469.0 - ISC 122 * 123 * This source code is licensed under the ISC license. 124 * See the LICENSE file in the root directory of this source tree. 125 */const vS=xn("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** 126 * @license lucide-react v0.469.0 - ISC 127 * 128 * This source code is licensed under the ISC license. 129 * See the LICENSE file in the root directory of this source tree. 130 */const yS=xn("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 131 * @license lucide-react v0.469.0 - ISC 132 * 133 * This source code is licensed under the ISC license. 134 * See the LICENSE file in the root directory of this source tree. 135 */const bS=xn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),qe=s=>s.replaceAll("_"," ").replace(/\b\w/g,n=>n.toUpperCase()),Je=s=>s?new Date(s).toLocaleString():"â",Rd=s=>s.slice(0,8).toUpperCase(),wv=["prospect-finder","zaferesearch","ritwik","jordanbelfort"],_S={raj:"/agents/raj.png","prospect-finder":"/agents/prospect-finder.png",zaferesearch:"/agents/zaferesearch.png",ritwik:"/agents/ritwik.png",jordanbelfort:"/agents/jordanbelfort.png"};function xS({slug:s}){const n=_S[s];return n?d.jsx("img",{className:"agent-node__avatar",src:n,alt:"",width:"48",height:"52"}):d.jsx(Iy,{className:"h-5 w-5",strokeWidth:1.7})}function Sv({agent:s,leader:n=!1,index:i}){var f;const l=s,o=((f=l.current_ticket)==null?void 0:f.title)||s.current_task_title||(s.status==="offline"?"Unavailable for tasks":"Ready for assignment"),h=l.live_status||s.status;return d.jsxs(Ne,{to:`/agents/${s.slug}`,className:`agent-node agent-node--${n?"leader":"worker"} agent-node--${s.slug}`,"aria-label":`View ${s.name}, ${s.role}, ${qe(h)}`,children:[d.jsxs("div",{className:"agent-node__eyebrow",children:[d.jsx("span",{children:n?"ORCHESTRATOR":`WORKER ${String((i??0)+1).padStart(2,"0")}`}),d.jsx(hS,{className:"h-4 w-4",strokeWidth:1.7,"aria-hidden":"true"})]}),d.jsxs("div",{className:"agent-node__identity",children:[d.jsx("span",{className:"agent-node__icon","aria-hidden":"true",children:d.jsx(xS,{slug:s.slug})}),d.jsxs("span",{className:"min-w-0",children:[d.jsx("span",{className:"agent-node__name",children:s.name}),d.jsx("span",{className:"agent-node__role",children:s.role})]})]}),d.jsxs("div",{className:"agent-node__current",children:[d.jsx("span",{className:"agent-node__field-label",children:"CURRENT FOCUS"}),d.jsx("span",{className:"agent-node__task",title:o,children:o})]}),d.jsxs("div",{className:"agent-node__footer",children:[d.jsx("span",{className:"agent-node__provider",children:s.provider==="Grok Bot"?"GROK BOT":s.provider.toUpperCase()}),d.jsxs("span",{className:`agent-node__status agent-node__status--${h.toLowerCase()}`,children:[d.jsx("span",{className:"agent-node__status-dot","aria-hidden":"true"}),qe(h)]})]}),d.jsxs("span",{className:"sr-only",children:["Last seen ",Je(s.last_seen_at),". ",s.completed_count??0," completed tasks."]})]})}function wS({agents:s}){const n=s.find(l=>l.slug==="raj")||s[0],i=s.filter(l=>l.id!==(n==null?void 0:n.id)).sort((l,o)=>{const h=wv.indexOf(l.slug),f=wv.indexOf(o.slug);
135return(h<0?999:h)-(f<0?999:f)||l.name.localeCompare(o.name)});return n?d.jsxs("section",{className:"agent-map","aria-labelledby":"agent-map-title",children:[d.jsxs("div",{className:"agent-map__header",children:[d.jsxs("div",{children:[d.jsx("span",{className:"agent-map__kicker",children:"OPERATIONS / NETWORK"}),d.jsx("h2",{id:"agent-map-title",className:"agent-map__title",children:"Agent network"}),d.jsx("p",{className:"agent-map__subtitle",children:"Raj coordinates work across the gateway's active workforce."})]}),d.jsxs("div",{className:"agent-map__count",children:[d.jsx("span",{className:"agent-map__count-dot"}),s.length," agents ",d.jsx("span",{className:"text-faint",children:"/"})," ",i.length," workers"]})]}),d.jsx("div",{className:"agent-map__canvas",children:d.jsxs("div",{className:"agent-map__canvas-inner",style:{"--agent-columns":Math.max(i.length,1),"--branch-edge":`calc(${50/Math.max(i.length,1)}% - ${11*(i.length-1)/Math.max(i.length,1)}px)`,"--agent-min-width":i.length>3?`${i.length*240+(i.length-1)*22}px`:"0px"},children:[d.jsx("div",{className:"agent-map__leader",children:d.jsx(Sv,{agent:n,leader:!0})}),i.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"agent-map__trunk","aria-hidden":"true",children:d.jsx("span",{})}),d.jsx("div",{className:"agent-map__branches",children:i.map((l,o)=>d.jsx("div",{className:"agent-map__branch",children:d.jsx(Sv,{agent:l,index:o})},l.id))})]})]})}),d.jsxs("div",{className:"agent-map__footnote",children:[d.jsxs("span",{children:[d.jsx("span",{className:"agent-map__footnote-line"})," Assignment path"]}),d.jsx("span",{children:"Select an agent to view its activity and task history"})]})]}):d.jsx("div",{className:"card p-10 text-center text-sm text-muted",children:"No agents are registered yet."})}const SS=Symbol.for("@supabase/supabase-js.traceContextExtractor");function ES(){return globalThis[SS]}function eu(s,n){var i={};for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&n.indexOf(l)<0&&(i[l]=s[l]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,l=Object.getOwnPropertySymbols(s);o<l.length;o++)n.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(s,l[o])&&(i[l[o]]=s[l[o]]);return i}function jS(s,n,i,l){function o(h){return h instanceof i?h:new i(function(f){f(h)})}return new(i||(i=Promise))(function(h,f){function m(b){try{v(l.next(b))}catch(y){f(y)}}function g(b){try{v(l.throw(b))}catch(y){f(y)}}function v(b){b.done?h(b.value):o(b.value).then(m,g)}v((l=l.apply(s,n||[])).next())})}const TS=s=>s?(...n)=>s(...n):(...n)=>fetch(...n);
135class Ad extends Error{constructor(n,i="FunctionsError",l){super(n),this.name=i,this.context=l}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class RS extends Ad{constructor(n){super("Failed to send a request to the Edge Function","FunctionsFetchError",n)}}class Ev extends Ad{constructor(n){super("Relay Error invoking the Edge Function","FunctionsRelayError",n)}}class jv extends Ad{constructor(n){super("Edge Function returned a non-2xx status code","FunctionsHttpError",n)}}var id;(function(s){s.Any="any",s.ApNortheast1="ap-northeast-1",s.ApNortheast2="ap-northeast-2",s.ApSouth1="ap-south-1",s.ApSoutheast1="ap-southeast-1",s.ApSoutheast2="ap-southeast-2",s.CaCentral1="ca-central-1",s.EuCentral1="eu-central-1",s.EuWest1="eu-west-1",s.EuWest2="eu-west-2",s.EuWest3="eu-west-3",s.SaEast1="sa-east-1",s.UsEast1="us-east-1",s.UsWest1="us-west-1",s.UsWest2="us-west-2"})(id||(id={}));class AS{constructor(n,{headers:i={},customFetch:l,region:o=id.Any}={}){this.url=n,this.headers=i,this.region=o,this.fetch=TS(l)}setAuth(n){this.headers.Authorization=`Bearer ${n}`}invoke(n){return jS(this,arguments,void 0,function*(i,l={}){var o,h;let f,m,g;try{const{headers:v,method:b,body:y,signal:w,timeout:x}=l;let R={},{region:j}=l;j||(j=this.region);const N=new URL(`${this.url}/${i}`);j&&j!=="any"&&(R["x-region"]=j,N.searchParams.set("forceFunctionRegion",j));let T;const C=!!v&&Object.keys(v).some(H=>H.toLowerCase()==="content-type");y&&!C?typeof Blob<"u"&&y instanceof Blob||y instanceof ArrayBuffer?(R["Content-Type"]="application/octet-stream",T=y):typeof y=="string"?(R["Content-Type"]="text/plain",T=y):typeof FormData<"u"&&y instanceof FormData?T=y:(R["Content-Type"]="application/json",T=JSON.stringify(y)):y&&typeof y!="string"&&!(typeof Blob<"u"&&y instanceof Blob)&&!(y instanceof ArrayBuffer)&&!(typeof FormData<"u"&&y instanceof FormData)?T=JSON.stringify(y):T=y;let B=w;x&&(m=new AbortController,f=setTimeout(()=>m.abort(),x),w?(B=m.signal,g=()=>m.abort(),w.addEventListener("abort",g)):B=m.signal);const Q=yield this.fetch(N.toString(),{method:b||"POST",headers:Object.assign(Object.assign(Object.assign({},R),this.headers),v),body:T,signal:B}).catch(H=>{throw new RS(H)}),ee=Q.headers.get("x-relay-error");if(ee&&ee==="true")throw new Ev(Q);if(!Q.ok)throw new jv(Q);let $=((o=Q.headers.get("Content-Type"))!==null&&o!==void 0?o:"text/plain").split(";")[0].trim().toLowerCase(),G;return $==="application/json"?G=yield Q.json():$==="application/octet-stream"||$==="application/pdf"?G=yield Q.blob():$==="text/event-stream"?G=Q:$==="multipart/form-data"?G=yield Q.formData():G=yield Q.text(),{data:G,error:null,response:Q}}catch(v){return{data:null,error:v,response:v instanceof jv||v instanceof Ev?v.context:void 0}}finally{f&&clearTimeout(f),g&&((h=l.signal)===null||h===void 0||h.removeEventListener("abort",g))}})}}var _i=class extends Error{constructor(s){super(s.message),this.name="PostgrestError",this.details=s.details,this.hint=s.hint,this.co
135de=s.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};const Py=3,Tv=s=>Math.min(1e3*2**s,3e4),NS=[520,503],Gy=["GET","HEAD","OPTIONS"];function zr(s){"@babel/helpers - typeof";return zr=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},zr(s)}function OS(s,n){if(zr(s)!="object"||!s)return s;var i=s[Symbol.toPrimitive];if(i!==void 0){var l=i.call(s,n);if(zr(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(s)}function CS(s){var n=OS(s,"string");return zr(n)=="symbol"?n:n+""}function kS(s,n,i){return(n=CS(n))in s?Object.defineProperty(s,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):s[n]=i,s}function Rv(s,n){var i=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);n&&(l=l.filter(function(o){return Object.getOwnPropertyDescriptor(s,o).enumerable})),i.push.apply(i,l)}return i}function vs(s){for(var n=1;n<arguments.length;n++){var i=arguments[n]!=null?arguments[n]:{};n%2?Rv(Object(i),!0).forEach(function(l){kS(s,l,i[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(i)):Rv(Object(i)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(i,l))})}return s}function Av(s,n){return new Promise(i=>{if(n!=null&&n.aborted){i();return}const l=setTimeout(()=>{n==null||n.removeEventListener("abort",o),i()},s);function o(){clearTimeout(l),i()}n==null||n.addEventListener("abort",o)})}function DS(s,n,i,l){return!(!l||i>=Py||!Gy.includes(s)||!NS.includes(n))}async function Vy(s,n,i,l){let o=0;for(;;){const m=vs({},i.headers);o>0&&(m["X-Retry-Count"]=String(o));let g;try{g=await s(n,{method:i.method,headers:m,body:i.body,signal:i.signal})}catch(v){if((v==null?void 0:v.name)==="AbortError"||(v==null?void 0:v.code)==="ABORT_ERR"||!Gy.includes(i.method))throw v;if(l&&o<Py){const b=Tv(o);o++,await Av(b,i.signal);continue}throw v}if(DS(i.method,g.status,o,l)){var h,f;const v=(h=(f=g.headers)===null||f===void 0?void 0:f.get("Retry-After"))!==null&&h!==void 0?h:null,b=v!==null?Math.max(0,parseInt(v,10)||0)*1e3:Tv(o);await g.text(),o++,await Av(b,i.signal);continue}return g}}var US=class{constructor(s){var n,i,l,o,h;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=s.method,this.url=s.url,this.headers=new Headers(s.headers),this.schema=s.schema,this.body=s.body,this.shouldThrowOnError=(n=s.shouldThrowOnError)!==null&&n!==void 0?n:!1,this.signal=s.signal,this.isMaybeSingle=(i=s.isMaybeSingle)!==null&&i!==void 0?i:!1,this.shouldStripNulls=(l=s.shouldStripNulls)!==null&&l!==void 0?l:!1,this.urlLengthLimit=(o=s.urlLengthLimit)!==null&&o!==void 0?o:8e3,this.retryEnabled=(h=s.retry)!==null&&h!==void 0?h:!0,s.fetch?this.fetch=s.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(s,n){return this.headers=new Headers(this.headers),this.headers.set(s,n),this}retry(s){return this.retryEnabled=s,this}then(s,n){var i=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 f=this.headers.get("Accept");f==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!f||f==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const l=this.fetch;let h=(async()=>{const f={};i.headers.forEach((g,v)=>{f[v]=g});const m=await Vy(l,i.url.toString(),{method:i.method,headers:f,body:JSON.stringify(i.body,(g,v)=>typeof v=="bigint"?v.toString():v),signal:i.signal},i.retryEnabled);return await i.processResponse(m)})();return this.shouldThrowOnError||(h=h.catch(f=>{var m;let g="",v="",b="";const y=f==null?void 0:f.cause;if(y){var w,x,R,j;const C=(w=y==null?void 0:y.message)!==null&&w!==void 0?w:"",B=(x=y==null?void 0:y.code)!==null&&x!==void 0?x:"";g=`${(R=f==null?void 0:f.name)!==null&&R!==void 0?R:"FetchError"}: ${f==null?void 0:f.message}`,g+=` 136 137Caused by: ${(j=y==null?void 0:y.name)!==null&&j!==void 0?j:"Error"}: ${C}`,B&&(g+=` (${B})`),y!=null&&y.stack&&(g+=` 138${y.stack}`)}else{var N;g=(N=f==null?void 0:f.stack)!==null&&N!==void 0?N:""}const T=this.url.toString().length;return(f==null?void 0:f.name)==="AbortError"||(f==null?void 0:f.code)==="ABORT_ERR"?(b="",v="Request was aborted (timeout or manual cancellation)",T>this.urlLengthLimit&&(v+=`. Note: Your request URL is ${T} 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.`)):((y==null?void 0:y.name)==="HeadersOverflowError"||(y==null?void 0:y.code)==="UND_ERR_HEADERS_OVERFLOW")&&(b="",v="HTTP headers exceeded server limits (typically 16KB)",T>this.urlLengthLimit&&(v+=`. Your request URL is ${T} 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=f==null?void 0:f.name)!==null&&m!==void 0?m:"FetchError"}: ${f==null?void 0:f.message}`,details:g,hint:v,code:b},data:null,count:null,status:0,statusText:""}}
138)),h.then(s,n)}async processResponse(s){var n=this;let i=null,l=null,o=null,h=s.status,f=s.statusText;if(s.ok){var m,g;if(n.method!=="HEAD"){var v;const x=await s.text();if(x!=="")if(n.headers.get("Accept")==="text/csv")l=x;else if(n.headers.get("Accept")&&(!((v=n.headers.get("Accept"))===null||v===void 0)&&v.includes("application/vnd.pgrst.plan+text")))l=x;else try{l=JSON.parse(x)}catch{if(i={message:x},l=null,n.shouldThrowOnError)throw new _i({message:x,details:"",hint:"",code:""})}}const y=(m=n.headers.get("Prefer"))===null||m===void 0?void 0:m.match(/count=(exact|planned|estimated)/),w=(g=s.headers.get("content-range"))===null||g===void 0?void 0:g.split("/");if(y&&w&&w.length>1&&(o=parseInt(w[1])),n.isMaybeSingle&&Array.isArray(l))if(l.length>1){if(i={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,o=null,h=406,f="Not Acceptable",n.shouldThrowOnError){var b;throw new _i(vs(vs({},i),{},{hint:(b=i.hint)!==null&&b!==void 0?b:""}))}}else l.length===1?l=l[0]:l=null}else{const y=await s.text();try{i=JSON.parse(y),Array.isArray(i)&&s.status===404&&(l=[],i=null,h=200,f="OK")}catch{s.status===404&&y===""?(h=204,f="No Content"):i={message:y}}if(i&&n.shouldThrowOnError)throw new _i(i)}return{success:i===null,error:i,data:l,count:o,status:h,statusText:f}}returns(){return this}overrideTypes(){return this}},LS=class extends US{throwOnError(){return super.throwOnError()}select(s){let n=!1;const i=(s??"*").split("").map(l=>/\s/.test(l)&&!n?"":(l==='"'&&(n=!n),l)).join("");return this.url.searchParams.set("select",i),this.headers.append("Prefer","return=representation"),this}order(s,{ascending:n=!0,nullsFirst:i,foreignTable:l,referencedTable:o=l}={}){const h=o?`${o}.order`:"order",f=this.url.searchParams.get(h);return this.url.searchParams.set(h,`${f?`${f},`:""}${s}.${n?"asc":"desc"}${i===void 0?"":i?".nullsfirst":".nullslast"}`),this}limit(s,{foreignTable:n,referencedTable:i=n}={}){const l=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(l,`${s}`),this}range(s,n,{foreignTable:i,referencedTable:l=i}={}){const o=typeof l>"u"?"offset":`${l}.offset`,h=typeof l>"u"?"limit":`${l}.limit`;return this.url.searchParams.set(o,`${s}`),this.url.searchParams.set(h,`${n-s+1}`),this}abortSignal(s){return this.signal=s,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:s=!1,verbose:n=!1,settings:i=!1,buffers:l=!1,wal:o=!1,format:h="text"}={}){var f;const m=[s?"analyze":null,n?"verbose":null,i?"settings":null,l?"buffers":null,o?"wal":null].filter(Boolean).join("|"),g=(f=this.headers.get("Accept"))!==null&&f!==void 0?f:"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(s){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${s}`),this}};const Nv=new RegExp("[,()]");var vi=class extends LS{throwOnError(){return super.throwOnError()}eq(s,n){return this.url.searchParams.append(s,`eq.${n}`),this}neq(s,n){return this.url.searchParams.append(s,`neq.${n}`),this}gt(s,n){return this.url.searchParams.append(s,`gt.${n}`),this}gte(s,n){return this.url.searchParams.append(s,`gte.${n}`),this}lt(s,n){return this.url.searchParams.append(s,`lt.${n}`),this}lte(s,n){return this.url.searchParams.append(s,`lte.${n}`),this}like(s,n){return this.url.searchParams.append(s,`like.${n}`),this}likeAllOf(s,n){return this.url.searchParams.append(s,`like(all).{${n.join(",")}}`),this}likeAnyOf(s,n){return this.url.searchParams.append(s,`like(any).{${n.join(",")}}`),this}ilike(s,n){return this.url.searchParams.append(s,`ilike.${n}`),this}ilikeAllOf(s,n){return this.url.searchParams.append(s,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(s,n){return this.url.searchParams.append(s,`ilike(any).{${n.join(",")}}`),this}regexMatch(s,n){return this.url.searchParams.append(s,`match.${n}`),this}regexIMatch(s,n){return this.url.searchParams.append(s,`imatch.${n}`),this}is(s,n){return this.url.searchParams.append(s,`is.${n}`),this}isDistinct(s,n){return this.url.searchParams.append(s,`isdistinct.${n}`),this}in(s,n){const i=Array.from(new Set(n)).map(l=>typeof l=="string"&&Nv.test(l)?`"${l}"`:`${l}`).join(",");return this.url.searchParams.append(s,`in.(${i})`),this}notIn(s,n){const i=Array.from(new Set(n)).map(l=>typeof l=="string"&&Nv.test(l)?`"${l}"`:`${l}`).join(",");return this.url.searchParams.append(s,`not.in.(${i})`),this}contains(s,n){return typeof n=="string"?this.url.searchParams.append(s,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(s,`cs.{${n.join(",")}}`):this.url.searchParams.append(s,`cs.${JSON.stringify(n)}`),this}containedBy(s,n){return typeof n=="string"?this.url.searchParams.append(s,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(s,`cd.{${n.join(",")}}`):this.url.searchParams.append(s,`cd.${JSON.stringify(n)}`),this}rangeGt(s,n){return this.url.searchParams.append(s,`sr.${n}`),this}rangeGte(s,n){return this.url.searchParams.append(s,`nxl.${n}`),this}rangeLt(s,n){return this.url.searchParams.append(s,`sl.${n}`),this}rangeLte(s,n){return this.url.searchParams.append(s,`nxr.${n}`),this}rangeAdjacent(s,n){return this.url.searchParams.append(s,`adj.${n}`),this}overlaps(s,n){return typeof n=="string"?this.url.searchParams.append(s,`ov.${n}`):this.url.searchParams.append(s,`ov.{${n.join(",")}}`),this}textSearch(s,n,{config:i,type:l}={}){let o="";l==="plain"?o="pl":l==="phrase"?o="ph":l==="websearch"&&(o="w");const h=i===void 0?"":`(${i})`;return this.url.searchParams.append(s,`${o}fts${h}.${n}`),this}match(s){return Object.entries(s).filter(([n,i])=>
138i!==void 0).forEach(([n,i])=>{this.url.searchParams.append(n,`eq.${i}`)}),this}not(s,n,i){return this.url.searchParams.append(s,`not.${n}.${i}`),this}or(s,{foreignTable:n,referencedTable:i=n}={}){const l=i?`${i}.or`:"or";return this.url.searchParams.append(l,`(${s})`),this}filter(s,n,i){return this.url.searchParams.append(s,`${n}.${i}`),this}},MS=class{constructor(s,{headers:n={},schema:i,fetch:l,urlLengthLimit:o=8e3,retry:h}){this.url=s,this.headers=new Headers(n),this.schema=i,this.fetch=l,this.urlLengthLimit=o,this.retry=h}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(s,n){const{head:i=!1,count:l}=n??{},o=i?"HEAD":"GET";let h=!1;const f=(s??"*").split("").map(v=>/\s/.test(v)&&!h?"":(v==='"'&&(h=!h),v)).join(""),{url:m,headers:g}=this.cloneRequestState();return m.searchParams.set("select",f),l&&g.append("Prefer",`count=${l}`),new vi({method:o,url:m,headers:g,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(s,{count:n,defaultToNull:i=!0}={}){var l;const o="POST",{url:h,headers:f}=this.cloneRequestState();if(n&&f.append("Prefer",`count=${n}`),i||f.append("Prefer","missing=default"),Array.isArray(s)){const m=s.reduce((g,v)=>g.concat(Object.keys(v)),[]);if(m.length>0){const g=[...new Set(m)].map(v=>`"${v}"`);h.searchParams.set("columns",g.join(","))}}return new vi({method:o,url:h,headers:f,schema:this.schema,body:s,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(s,{onConflict:n,ignoreDuplicates:i=!1,count:l,defaultToNull:o=!0}={}){var h;const f="POST",{url:m,headers:g}=this.cloneRequestState();if(g.append("Prefer",`resolution=${i?"ignore":"merge"}-duplicates`),n!==void 0&&m.searchParams.set("on_conflict",n),l&&g.append("Prefer",`count=${l}`),o||g.append("Prefer","missing=default"),Array.isArray(s)){const v=s.reduce((b,y)=>b.concat(Object.keys(y)),[]);if(v.length>0){const b=[...new Set(v)].map(y=>`"${y}"`);m.searchParams.set("columns",b.join(","))}}return new vi({method:f,url:m,headers:g,schema:this.schema,body:s,fetch:(h=this.fetch)!==null&&h!==void 0?h:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(s,{count:n}={}){var i;const l="PATCH",{url:o,headers:h}=this.cloneRequestState();return n&&h.append("Prefer",`count=${n}`),new vi({method:l,url:o,headers:h,schema:this.schema,body:s,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:s}={}){var n;const i="DELETE",{url:l,headers:o}=this.cloneRequestState();return s&&o.append("Prefer",`count=${s}`),new vi({method:i,url:l,headers:o,schema:this.schema,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function zS(s,n){try{const f=JSON.parse(s);if(f&&typeof f=="object"&&!Array.isArray(f)){var i,l,o,h;return new _i({message:String((i=f.message)!==null&&i!==void 0?i:s),details:(l=f.details)!==null&&l!==void 0?l:"",hint:(o=f.hint)!==null&&o!==void 0?o:"",code:(h=f.code)!==null&&h!==void 0?h:""})}}catch{}return new _i({message:s||n,details:"",hint:"",code:""})}function Ov(s,n,i){var l;const o=s;return{success:!1,error:new _i({message:`${(l=o==null?void 0:o.name)!==null&&l!==void 0?l:"FetchError"}: ${o==null?void 0:o.message}`,details:"",hint:"",code:""}),data:null,count:null,status:n,statusText:i}}var BS=class Ky{constructor(n,{headers:i={},schema:l,fetch:o,timeout:h,urlLengthLimit:f=8e3,retry:m}={}){this.url=n,this.headers=new Headers(i),this.schemaName=l,this.urlLengthLimit=f;const g=o??globalThis.fetch;h!==void 0&&h>0?this.fetch=(v,b)=>{const y=new AbortController,w=setTimeout(()=>y.abort(),h),x=b==null?void 0:b.signal;if(x){if(x.aborted)return clearTimeout(w),g(v,b);const R=()=>{clearTimeout(w),y.abort()};return x.addEventListener("abort",R,{once:!0}),g(v,vs(vs({},b),{},{signal:y.signal})).finally(()=>{clearTimeout(w),x.removeEventListener("abort",R)})}return g(v,vs(vs({},b),{},{signal:y.signal})).finally(()=>clearTimeout(w))}: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 MS(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 Ky(this.url,{headers:this.headers,schema:n,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}async getOpenApiSpec(){var n=this,i;const l=new Headers(n.headers);l.set("Accept","application/openapi+json"),n.schemaName&&l.set("Accept-Profile",n.schemaName);const o={};l.forEach((v,b)=>{o[b]=v});const h=(i=n.fetch)!==null&&i!==void 0?i:globalThis.fetch;let f;try{var m;f=await Vy(h,`${n.url}/`,{method:"GET",headers:o},(m=n.retry)!==null&&m!==void 0?m:!0)}catch(v){return Ov(v,0,"")}let g;
138try{g=await f.text()}catch(v){return Ov(v,f.status,f.statusText)}if(f.ok)try{return{success:!0,error:null,data:JSON.parse(g),count:null,status:f.status,statusText:f.statusText}}catch{}return{success:!1,error:zS(g,f.statusText),data:null,count:null,status:f.status,statusText:f.statusText}}rpc(n,i={},{head:l=!1,get:o=!1,count:h}={}){var f;let m;const g=new URL(`${this.url}/rpc/${n}`);let v;const b=x=>x!==null&&typeof x=="object"&&(!Array.isArray(x)||x.some(b)),y=l&&Object.values(i).some(b);y?(m="POST",v=i):l||o?(m=l?"HEAD":"GET",Object.entries(i).filter(([x,R])=>R!==void 0).map(([x,R])=>[x,Array.isArray(R)?`{${R.join(",")}}`:`${R}`]).forEach(([x,R])=>{g.searchParams.append(x,R)})):(m="POST",v=i);const w=new Headers(this.headers);return y?w.set("Prefer",h?`count=${h},return=minimal`:"return=minimal"):h&&w.set("Prefer",`count=${h}`),new vi({method:m,url:g,headers:w,schema:this.schemaName,body:v,fetch:(f=this.fetch)!==null&&f!==void 0?f:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class HS{constructor(){}static detectEnvironment(){var n;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const i=globalThis;if(typeof globalThis<"u"&&typeof i.WebSocket<"u")return{type:"native",wsConstructor:i.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 i.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"&&i.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 o=globalThis.process;if(o){const h=o.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 i=n.error||"WebSocket not supported in this environment.";throw n.workaround&&(i+=` 139 140Suggested solution: ${n.workaround}`),new Error(i)}static isWebSocketSupported(){try{return this.detectEnvironment().type==="native"}catch{return!1}}}const qS="2.117.2",$S=`realtime-js/${qS}`,IS="1.0.0",Yy="2.0.0",PS=Yy,GS=1e4,VS=15e3,KS=1e4,YS=100,qa={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Jy={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},rd={connecting:"connecting",closing:"closing",closed:"closed"};class JS{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,i){if(n.event===this.BROADCAST_EVENT&&!(n.payload instanceof ArrayBuffer)&&typeof n.payload.event=="string")return i(this._binaryEncodeUserBroadcastPush(n));let l=[n.join_ref,n.ref,n.topic,n.event,n.payload];return i(JSON.stringify(l))}_binaryEncodeUserBroadcastPush(n){var i;return this._isArrayBuffer((i=n.payload)===null||i===void 0?void 0:i.payload)?this._encodeBinaryUserBroadcastPush(n):this._encodeJsonUserBroadcastPush(n)}_encodeBinaryUserBroadcastPush(n){var i,l;const o=(l=(i=n.payload)===null||i===void 0?void 0:i.payload)!==null&&l!==void 0?l:new ArrayBuffer(0);return this._encodeUserBroadcastPush(n,this.BINARY_ENCODING,o)}_encodeJsonUserBroadcastPush(n){var i,l;const o=(l=(i=n.payload)===null||i===void 0?void 0:i.payload)!==null&&l!==void 0?l:{},f=new TextEncoder().encode(JSON.stringify(o)).buffer;return this._encodeUserBroadcastPush(n,this.JSON_ENCODING,f)}_encodeUserBroadcastPush(n,i,l){var o,h;const f=new TextEncoder,m=f.encode(n.topic),g=f.encode((o=n.ref)!==null&&o!==void 0?o:""),v=f.encode((h=n.join_ref)!==null&&h!==void 0?h:""),b=f.encode(n.payload.event),y=this.allowedMetadataKeys?this._pick(n.payload,this.allowedMetadataKeys):{},w=f.encode(Object.keys(y).length===0?"":JSON.stringify(y));if(v.length>255)throw new Error(`joinRef length ${v.length} exceeds maximum of 255`);if(g.length>255)throw new Error(`ref length ${g.length} exceeds maximum of 255`);if(m.length>255)throw new Error(`topic length ${m.length} exceeds maximum of 255`);if(b.length>255)throw new Error(`userEvent length ${b.length} exceeds maximum of 255`);if(w.length>255)throw new Error(`metadata length ${w.length} exceeds maximum of 255`);const x=this.USER_BROADCAST_PUSH_META_LENGTH+v.length+g.length+m.length+b.length+w.length,R=new ArrayBuffer(this.HEADER_LENGTH+x),j=new DataView(R),N=new Uint8Array(R);let T=0;j.setUint8(T++,this.KINDS.userBroadcastPush),j.setUint8(T++,v.length),j.setUint8(T++,g.length),j.setUint8(T++,m.length),j.setUint8(T++,b.length),j.setUint8(T++,w.length),j.setUint8(T++,i),N.set(v,T),T+=v.length,N.set(g,T),T+=g.length,N.set(m,T),T+=m.length,N.set(b,T),T+=b.length,N.set(w,T),T+=w.length;var C=new Uint8Array(R.byteLength+l.byteLength);return C.set(new Uint8Array(R),0),C.set(new Uint8Array(l),R.byteLength),C.buffer}decode(n,i){if(this._isArrayBuffer(n)){let l=this._binaryDecode(n);return i(l)}if(typeof n=="string"){const l=JSON.parse(n),[o,h,f,m,g]=l;return i({join_ref:o,ref:h,topic:f,event:m,payload:g})}return i({})}_binaryDecode(n){const i=new DataView(n),l=i.getUint8(0),o=new TextDecoder;switch(l){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(n,i,o)}}_decodeUserBroadcast(n,i,l){const o=i.getUint8(1),h=i.getUint8(2),f=i.getUint8(3),m=i.getUint8(4);let g=this.HEADER_LENGTH+4;const v=l.decode(n.slice(g,g+o));g=g+o;const b=l.decode(n.slice(g,g+h));g=g+h;const y=l.decode(n.slice(g,g+f));g=g+f;const w=n.slice(g,n.byteLength),x=m===this.JSON_ENCODING?JSON.parse(l.decode(w)):w,R={type:this.BROADCAST_EVENT,event:b,payload:x};return f>0&&(R.meta=JSON.parse(y)),{join_ref:null,ref:null,topic:v,event:this.BROADCAST_EVENT,payload:R}}_isArrayBuffer(n){var i;return n instanceof ArrayBuffer||((i=n==null?void 0:n.constructor)===null||i===void 0?void 0:i.name)==="ArrayBuffer"}_pick(n,i){return!n||typeof n!="object"?{}:Object.fromEntries(Object.entries(n).filter(([l])=>i.includes(l)))}}var He;(function(s){s.abstime="abstime",s.bool="bool",s.date="date",s.daterange="daterange",s.float4="float4",s.float8="float8",s.int2="int2",s.int4="int4",s.int4range="int4range",s.int8="int8",s.int8range="int8range",s.json="json",s.jsonb="jsonb",s.money="money",s.numeric="numeric",s.oid="oid",s.reltime="reltime",s.text="text",s.time="time",s.timestamp="timestamp",s.timestamptz="timestamptz",s.timetz="timetz",s.tsrange="tsrange",s.tstzrange="tstzrange"})(He||(He={}));const Cv=(s,n,i={})=>{var l;const o=(l=i.skipTypes)!==null&&l!==void 0?l:[];return n?Object.keys(n).reduce((h,f)=>
vendor: 9,782 bytes, line 140
140(h[f]=QS(f,s,n,o),h),{}):{}},QS=(s,n,i,l)=>{const o=n.find(m=>m.name===s),h=o==null?void 0:o.type,f=i[s];return h&&!l.includes(h)?Qy(h,f):ld(f)},Qy=(s,n)=>{if(s.charAt(0)==="_"){const i=s.slice(1,s.length);return WS(n,i)}switch(s){case He.bool:return XS(n);case He.float4:case He.float8:case He.int2:case He.int4:case He.int8:case He.numeric:case He.oid:return ZS(n);case He.json:case He.jsonb:return FS(n);case He.timestamp:return eE(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 ld(n);default:return ld(n)}},ld=s=>s,XS=s=>{switch(s){case"t":return!0;case"f":return!1;default:return s}},ZS=s=>{if(typeof s=="string"){const n=parseFloat(s);if(!Number.isNaN(n))return n}return s},FS=s=>{if(typeof s=="string")try{return JSON.parse(s)}catch{return s}return s},WS=(s,n)=>{if(typeof s!="string")return s;const i=s.length-1,l=s[i];if(s[0]==="{"&&l==="}"){let h;const f=s.slice(1,i);try{h=JSON.parse("["+f+"]")}catch{h=f?f.split(","):[]}return h.map(m=>Qy(n,m))}return s},eE=s=>typeof s=="string"?s.replace(" ","T"):s,Xy=s=>{const n=new URL(s);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 xi=s=>typeof s=="function"?s:function(){return s},tE=typeof self<"u"?self:null,yi=typeof window<"u"?window:null,Mn=tE||yi||globalThis,nE="2.0.0",aE=1e4,sE=1e3,iE=100,zn={connecting:0,open:1,closing:2,closed:3},Ut={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},aa={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},od={longpoll:"longpoll",websocket:"websocket"},rE={complete:4},ud="base64url.bearer.phx.",Ro=class{constructor(s,n,i,l){this.channel=s,this.event=n,this.payload=i||function(){return{}},this.receivedResp=null,this.timeout=l,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(s){this.timeout=s,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(s,n){return this.hasReceived(s)&&n(this.receivedResp.response),this.recHooks.push({status:s,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:s,response:n,_ref:i}){this.recHooks.filter(l=>l.status===s).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,s=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=s,this.matchReceive(s)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(s){return this.receivedResp&&this.receivedResp.status===s}trigger(s,n){this.channel.trigger(this.refEvent,{status:s,response:n})}},Zy=class{constructor(s,n){this.callback=s,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))}},lE=class{constructor(s,n,i){this.state=Ut.closed,this.topic=s,this.params=xi(n||{}),this.socket=i,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Ro(this,aa.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Zy(()=>{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=Ut.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(l=>l.send()),this.pushBuffer=[]}),this.joinPush.receive("error",l=>{this.state=Ut.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=Ut.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=Ut.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 Ro(this,aa.leave,xi({}),this.timeout).send(),this.state=Ut.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(aa.reply,(l,o)=>{this.trigger(this.replyEventName(o),l)})}join(s=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=s,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(s=>s.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Ut.closed,this.bindings=[]}onClose(s){this.on(aa.close,s)}onError(s){return this.on(aa.error,n=>s(n))}on(s,n){let i=this.bindingRef++;return this.bindings.push({event:s,ref:i,callback:n}),i}off(s,n){this.bindings=this.bindings.filter(i=>!(i.event===s&&(typeof n>"u"||n===i.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(s,n,i=this.timeout){if(n=n||{},!this.joinedOnce)throw new Error(`tried to push '${s}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let l=new Ro(this,s,function(){return n},i);return this.canPush()?l.send():(l.startTimeout(),this.pushBuffer.push(l)),l}leave(s=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Ut.leaving;let n=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(aa.close,"leave")},i=new Ro(this,aa.leave,xi({}),s);return i.receive("ok",()=>n()).receive("timeout",()=>n()),i.send(),this.canPush()||i.trigger("ok",{}),i}onMessage(s,n,i){return n}filterBindings(s,n,i){return!0}isMember(s,n,i,l){return this.topic!==s?!1:l&&l!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:s,event:n,payload:i,joinRef:l}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(s=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Ut.joining,this.joinPush.resend(s))}trigger(s,n,i,l){let o=this.onMessage(s,n,i,l);if(n&&!o)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let h=this.bindings.filter(f=>f.event===s&&this.filterBindings(f,n,i));for(let f=0;f<h.length;f++)h[f].callback(o,i,l||this.joinRef())}replyEventName(s){return`chan_reply_${s}`}isClosed(){return this.state===Ut.closed}isErrored(){return this.state===Ut.errored}isJoined(){return this.state===Ut.joined}isJoining(){return this.state===Ut.joining}isLeaving(){return this.state===Ut.leaving}},$o=class{static request(s,n,i,l,o,h,f){if(Mn.XDomainRequest){let m=new Mn.XDomainRequest;return this.xdomainRequest(m,s,n,l,o,h,f)}else if(Mn.XMLHttpRequest){let m=new Mn.XMLHttpRequest;return this.xhrRequest(m,s,n,i,l,o,h,f)}else{if(Mn.fetch&&Mn.AbortController)return this.fetchRequest(s,n,i,l,o,h,f);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(s,n,i,l,o,h,f){let m={method:s,headers:i,body:l},g=null;return o&&(g=new AbortController,setTimeout(()=>g.abort(),o),m.signal=g.signal),Mn.fetch(n,m).then(v=>v.text()).then(v=>this.parseJSON(v)).then(v=>f&&f(v)).catch(v=>{v.name==="AbortError"&&h?h():f&&f(null)}),g}static xdomainRequest(s,n,i,l,o,h,f){return s.timeout=o,s.open(n,i),s.onload=()=>{let m=this.parseJSON(s.responseText);f&&f(m)},h&&(s.ontimeout=h),s.onprogress=()=>{},s.send(l),s}static xhrRequest(s,n,i,l,o,h,f,m){s.open(n,i,!0),s.timeout=h;for(let[g,v]of Object.entries(l))s.setRequestHeader(g,v);return s.onerror=()=>m&&m(null),s.onreadystatechange=()=>{if(s.readyState===rE.complete&&m){let g=this.parseJSON(s.responseText);m(g)}},f&&(s.ontimeout=f),s.send(o),s}static parseJSON(s){if(!s||s==="")return null;try{return JSON.parse(s)}catch{return console&&console.log("failed to parse JSON response",s),null}}static serialize(s,n){let i=[];for(var l in s){if(!Object.prototype.hasOwnProperty.call(s,l))continue;let o=n?`${n}[${l}]`:l,h=s[l];typeof h=="object"?i.push(this.serialize(h,o)):i.push(encodeURIComponent(o)+"="+encodeURIComponent(h))}return i.join("&")}static appendParams(s,n){if(Object.keys(n).length===0)return s;let i=s.match(/\?/)?"&":"?";return`${s}${i}${this.serialize(n)}`}},oE=s=>{let n="",i=new Uint8Array(s),l=i.byteLength;for(let o=0;o<l;o++)n+=String.fromCharCode(i[o]);return btoa(n)},fi=class{constructor(s,n){n&&n.length===2&&n[1].startsWith(ud)&&(this.authToken=atob(n[1].slice(ud.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(){}
vendor: 14,617 bytes, lines 140-141
140,this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(s),this.readyState=zn.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(s){return s.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+od.websocket),"$1/"+od.longpoll)}endpointURL(){return $o.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(s,n,i){this.close(s,n,i),this.readyState=zn.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===zn.open||this.readyState===zn.connecting}poll(){const s={Accept:"application/json"};this.authToken&&(s["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",s,null,()=>this.ontimeout(),n=>{if(n){var{status:i,token:l,messages:o}=n;if(i===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=l}else i=0;switch(i){case 200:o.forEach(h=>{setTimeout(()=>this.onmessage({data:h}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=zn.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 ${i}`)}})}send(s){typeof s!="string"&&(s=oE(s)),this.currentBatch?this.currentBatch.push(s):this.awaitingBatchAck?this.batchBuffer.push(s):(this.currentBatch=[s],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(s,n=0){this.awaitingBatchAck=!0;const i=n+iE,l=s.slice(n,i);this.ajax("POST",{"Content-Type":"application/x-ndjson"},l.join(` 141`),()=>this.onerror("timeout"),o=>{!o||o.status!==200?(this.awaitingBatchAck=!1,this.onerror(o&&o.status),this.closeAndRetry(1011,"internal server error",!1)):i<s.length?this.batchSend(s,i):this.batchBuffer.length>0?(this.batchSend(this.batchBuffer),this.batchBuffer=[]):this.awaitingBatchAck=!1})}close(s,n,i){for(let o of this.reqs)o.abort();this.readyState=zn.closed;let l=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:s,reason:n,wasClean:i});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",l)):this.onclose(l)}ajax(s,n,i,l,o){let h,f=()=>{this.reqs.delete(h),l()};h=$o.request(s,this.endpointURL(),n,i,this.timeout,f,m=>{this.reqs.delete(h),this.isActive()&&o(m)}),this.reqs.add(h)}},uE=class kr{constructor(n,i={}){let l=i.events||{state:"presence_state",diff:"presence_diff"};this.state=Object.create(null),this.pendingDiffs=[],this.channel=n,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(l.state,o=>{let{onJoin:h,onLeave:f,onSync:m}=this.caller;this.joinRef=this.channel.joinRef(),this.state=kr.syncState(this.state,o,h,f),this.pendingDiffs.forEach(g=>{this.state=kr.syncDiff(this.state,g,h,f)}),this.pendingDiffs=[],m()}),this.channel.on(l.diff,o=>{let{onJoin:h,onLeave:f,onSync:m}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=kr.syncDiff(this.state,o,h,f),m())})}onJoin(n){this.caller.onJoin=n}onLeave(n){this.caller.onLeave=n}onSync(n){this.caller.onSync=n}list(n){return kr.list(this.state,n)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(n,i,l,o){let h=this.toNullProtoObj(this.clone(n));i=this.toNullProtoObj(i);let f=Object.create(null),m=Object.create(null);return this.map(h,(g,v)=>{i[g]||(m[g]=v)}),this.map(i,(g,v)=>{let b=h[g];if(b){let y=v.metas.map(j=>j.phx_ref),w=b.metas.map(j=>j.phx_ref),x=v.metas.filter(j=>w.indexOf(j.phx_ref)<0),R=b.metas.filter(j=>y.indexOf(j.phx_ref)<0);x.length>0&&(f[g]=v,f[g].metas=x),R.length>0&&(m[g]=this.clone(b),m[g].metas=R)}else f[g]=v}),this.syncDiff(h,{joins:f,leaves:m},l,o)}static syncDiff(n,i,l,o){n=this.toNullProtoObj(n);let{joins:h,leaves:f}=this.clone(i);return l||(l=function(){}),o||(o=function(){}),this.map(h,(m,g)=>{let v=n[m];if(n[m]=this.clone(g),v){let b=n[m].metas.map(w=>w.phx_ref),y=v.metas.filter(w=>b.indexOf(w.phx_ref)<0);n[m].metas.unshift(...y)}l(m,v,g)}),this.map(f,(m,g)=>{let v=n[m];if(!v)return;let b=g.metas.map(y=>y.phx_ref);v.metas=v.metas.filter(y=>b.indexOf(y.phx_ref)<0),o(m,v,g),v.metas.length===0&&delete n[m]}),n}static list(n,i){return i||(i=function(l,o){return o}),this.map(n,(l,o)=>i(l,o))}static map(n,i){return Object.getOwnPropertyNames(n).map(l=>i(l,n[l]))}static toNullProtoObj(n){if(Object.getPrototypeOf(n)===null)return n;let i=Object.create(null);return Object.getOwnPropertyNames(n).forEach(l=>{i[l]=n[l]}),i}static clone(n){return JSON.parse(JSON.stringify(n))}},Ao={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(s,n){if(s.payload.constructor===ArrayBuffer)return n(this.binaryEncode(s));{let i=[s.join_ref,s.ref,s.topic,s.event,s.payload];return n(JSON.stringify(i))}},decode(s,n){if(s.constructor===ArrayBuffer)return n(this.binaryDecode(s));{let[i,l,o,h,f]=JSON.parse(s);return n({join_ref:i,ref:l,topic:o,event:h,payload:f})}},binaryEncode(s){let{join_ref:n,ref:i,event:l,topic:o,payload:h}=s,f=new TextEncoder,m=f.encode(n),g=f.encode(i),v=f.encode(o),b=f.encode(l);this.assertFieldSize(m.byteLength,"join_ref"),this.assertFieldSize(g.byteLength,"ref"),this.assertFieldSize(v.byteLength,"topic"),this.assertFieldSize(b.byteLength,"event");let y=this.META_LENGTH+m.byteLength+g.byteLength+v.byteLength+b.byteLength,w=new ArrayBuffer(this.HEADER_LENGTH+y),x=new Uint8Array(w),R=new DataView(w),j=0;R.setUint8(j++,this.KINDS.push),R.setUint8(j++,m.byteLength),R.setUint8(j++,g.byteLength),R.setUint8(j++,v.byteLength),R.setUint8(j++,b.byteLength),x.set(m,j),j+=m.byteLength,x.set(g,j),j+=g.byteLength,x.set(v,j),j+=v.byteLength,x.set(b,j),j+=b.byteLength;var N=new Uint8Array(w.byteLength+h.byteLength);return N.set(x,0),N.set(new Uint8Array(h),w.byteLength),N.buffer},assertFieldSize(s,n){if(s>255)throw new Error(`unable to convert ${n} to binary: must be less than or equal to 255 bytes, but is ${s} bytes`)},binaryDecode(s){let n=new DataView(s),i=n.getUint8(0),l=new TextDecoder;switch(i){case this.KINDS.push:return this.decodePush(s,n,l);case this.KINDS.reply:return this.decodeReply(s,n,l);case this.KINDS.broadcast:return this.decodeBroadcast(s,n,l)}},decodePush(s,n,i){let l=n.getUint8(1),o=n.getUint8(2),h=n.getUint8(3),f=this.HEADER_LENGTH+this.META_LENGTH-1,m=i.decode(s.slice(f,f+l));f=f+l;let g=i.decode(s.slice(f,f+o));f=f+o;let v=i.decode(s.slice(f,f+h));f=f+h;let b=s.slice(f,s.byteLength);return{join_ref:m,ref:null,topic:g,event:v,payload:b}},decodeReply(s,n,i){let l=n.getUint8(1),o=n.getUint8(2),h=n.getUint8(3),f=n.getUint8(4),m=this.HEADER_LENGTH+this.META_LENGTH,g=i.decode(s.slice(m,m+l));m=m+l;let v=i.decode(s.slice(m,m+o));m=m+o;let b=i.decode(s.slice(m,m+h));m=m+h;let y=i.decode(s.slice(m,m+f));m=m+f;let w=s.slice(m,s.byteLength),x={status:y,response:w};return{join_ref:g,ref:v,topic:b,event:aa.reply,payload:x}},decodeBroadcast(s,n,i){let l=n.getUint8(1),o=n.getUint8(2),h=this.HEADER_LENGTH+2,f=i.decode(s.slice(h,h+l));h=h+l;let m=i.decode(s.slice(h,h+o));h=h+o;let g=s.slice(h,s.byteLength);return{join_ref:null,ref:null,topic:f,event:m,payload:g}}},cE=class{constructor(s,n={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=n.timeout||aE,this.transport=n.transport||Mn.WebSocket||fi,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=n.longPollFallbackMs,this.fallbackTimer=null;let i=null;try{i=Mn&&Mn.sessionStorage}catch{}this.sessionStore=n.sessionStorage||i,this.establishedConnections=0,this.defaultEncoder=Ao.encode.bind(Ao),this.defaultDecoder=Ao.decode.bind(Ao),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!==fi?(this.encode=n.encode||this.defaultEncoder,this.decode=n.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let l=null;yi&&yi.addEventListener&&(yi.addEventListener("pagehide",o=>{this.conn&&(this.disconnect(),l=this.connectClock)}),yi.addEventListener("pageshow",o=>{l===this.connectClock&&(l=null,this.connect())}),yi.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=o=>n.rejoinAfterMs?n.rejoinAfterMs(o):[1e3,2e3,5e3][o-1]||1e4,this.reconnectAfterMs=o=>n.reconnectAfterMs?n.reconnectAfterMs(o):[10,50,100,150,200,250,500,1e3,2e3][o-1]||5e3,this.logger=n.logger||null,!this.logger&&n.debug&&(this.logger=(o,h,f)=>{console.log(`${o}: ${h}`,f)}),this.longpollerTimeout=n.longpollerTimeout||2e4,this.params=xi(n.params||{}),this.endPoint=`${s}/${od.websocket}`,this.vsn=n.vsn||nE,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Zy(()=>{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&&xi(n.authToken)}getLongPollTransport(){return fi}replaceTransport(s){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=s}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let s=$o.appendParams($o.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return s.charAt(0)!=="/"?s:s.charAt(1)==="/"?`${this.protocol()}:${s}`:`${this.protocol()}://${location.host}${s}`}disconnect(s,n,i){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,s&&s()},n,i)}connect(s){s&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=xi(s)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==fi?this.connectWithFallback(fi,this.longPollFallbackMs):this.transportConnect())}log(s,n,i){this.logger&&this.logger(s,n,i)}hasLogger(){return this.logger!==null}onOpen(s){let n=this.makeRef();return this.stateChangeCallbacks.open.push([n,s]),n}onClose(s){let n=this.makeRef();return this.stateChangeCallbacks.close.push([n,s]),n}onError(s){let n=this.makeRef();return this.stateChangeCallbacks.error.push([n,s]),n}onMessage(s){let n=this.makeRef();return this.stateChangeCallbacks.message.push([n,s]),n}onHeartbeat(s){this.heartbeatCallback=s}ping(s){if(!this.isConnected())return!1;let n=this.makeRef(),i=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:n});let l=this.onMessage(o=>{o.ref===n&&(this.off([l]),s(Date.now()-i))});return!0}transportName(s){switch(s){case fi:return"LongPoll";default:return s.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let s;this.authToken&&(s=["phoenix",`${ud}${btoa(this.authToken()).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),s),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(s){return this.sessionStore&&this.sessionStore.getItem(s)}storeSession(s,n){this.sessionStore&&this.sessionStore.setItem(s,n)}connectWithFallback(s,n=2500){clearTimeout(this.fallbackTimer);let i=!1,l=!0,o,h,f=this.transportName(s),m=g=>{this.log("transport",`falling back to ${f}...`,g),this.off([o,h]),l=!1,this.replaceTransport(s),this.transportConnect()};if(this.getSession(`phx:fallback:${f}`))return m("memorized");this.fallbackTimer=setTimeout(m,n),h=this.onError(g=>{this.log("transport","error",g),l&&!i&&(clearTimeout(this.fallbackTimer),m(g))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(i=!0,!l){let g=this.transportName(s);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(s){this.log("error","error in heartbeat callback",s)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),sE,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(s,n,i){if(!this.conn)return s&&s();const l=this.conn;this.waitForBufferDone(l,()=>{n?l.close(n,i||""):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),s&&s()})})}waitForBufferDone(s,n,i=1){if(i===5||!s.bufferedAmount){n();return}setTimeout(()=>{this.waitForBufferDone(s,n,i+1)},150*i)}waitForSocketClosed(s,n,i=1){if(i===5||s.readyState===zn.closed){n();return}setTimeout(()=>{this.waitForSocketClosed(s,n,i+1)},150*i)}onConnClose(s){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",s),this.triggerChanError(s),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",s
vendor: 4,457 bytes, line 141
141)}onConnError(s){this.hasLogger()&&this.log("transport","error",s);let n=this.transport,i=this.establishedConnections;this.triggerStateCallbacks("error",s,n,i),(n===this.transport||i>0)&&this.triggerChanError(s)}triggerChanError(s){this.channels.forEach(n=>{n.isErrored()||n.isLeaving()||n.isClosed()||n.trigger(aa.error,s)})}connectionState(){switch(this.conn&&this.conn.readyState){case zn.connecting:return"connecting";case zn.open:return"open";case zn.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(s){this.off(s.stateChangeRefs),this.channels=this.channels.filter(n=>n!==s)}off(s){for(let n in this.stateChangeCallbacks)this.stateChangeCallbacks[n]=this.stateChangeCallbacks[n].filter(([i])=>s.indexOf(i)===-1)}channel(s,n={}){let i=new lE(s,n,this);return this.channels.push(i),i}push(s){if(this.hasLogger()){let{topic:n,event:i,payload:l,ref:o,join_ref:h}=s;this.log("push",`${n} ${i} (${h}, ${o})`,l)}this.isConnected()?this.encode(s,n=>this.conn.send(n)):this.sendBuffer.push(()=>this.encode(s,n=>this.conn.send(n)))}makeRef(){let s=this.ref+1;return s===this.ref?this.ref=0:this.ref=s,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(s){this.log("error","error in heartbeat callback",s)}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(s){this.log("error","error in heartbeat callback",s)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(s=>s()),this.sendBuffer=[])}onConnMessage(s){this.decode(s.data,n=>{let{topic:i,event:l,payload:o,ref:h,join_ref:f}=n;if(h&&h===this.pendingHeartbeatRef){const m=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(o.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",`${o.status||""} ${i} ${l} ${h&&"("+h+")"||""}`.trim(),o);for(let m=0;m<this.channels.length;m++){const g=this.channels[m];g.isMember(i,l,o,f)&&g.trigger(l,o,h,f)}this.triggerStateCallbacks("message",n)})}triggerStateCallbacks(s,...n){try{this.stateChangeCallbacks[s].forEach(([i,l])=>{try{l(...n)}catch(o){this.log("error",`error in ${s} callback`,o)}})}catch(i){this.log("error",`error triggering ${s} callbacks`,i)}}leaveOpenTopic(s){let n=this.channels.find(i=>i.topic===s&&(i.isJoined()||i.isJoining()));n&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${s}"`),n.leave())}};class Lr{constructor(n,i){const l=dE(i);this.presence=new uE(n.getChannel(),l),this.presence.onJoin((o,h,f)=>{const m=Lr.onJoinPayload(o,h,f);n.getChannel().trigger("presence",m)}),this.presence.onLeave((o,h,f)=>{const m=Lr.onLeavePayload(o,h,f);n.getChannel().trigger("presence",m)}),this.presence.onSync(()=>{n.getChannel().trigger("presence",{event:"sync"})})}get state(){return Lr.transformState(this.presence.state)}static transformState(n){return n=hE(n),Object.getOwnPropertyNames(n).reduce((i,l)=>{const o=n[l];return i[l]=zo(o),i},{})}static onJoinPayload(n,i,l){const o=kv(i),h=zo(l);return{event:"join",key:n,currentPresences:o,newPresences:h}}static onLeavePayload(n,i,l){const o=kv(i),h=zo(l);return{event:"leave",key:n,currentPresences:o,leftPresences:h}}}function zo(s){return s.metas.map(n=>{const i=Object.getOwnPropertyDescriptors(n),l=Object.defineProperties({},i);return l.presence_ref=l.phx_ref,delete l.phx_ref,delete l.phx_ref_prev,l})}function hE(s){return JSON.parse(JSON.stringify(s))}function dE(s){return(s==null?void 0:s.events)&&{events:s.events}}function kv(s){return s!=null&&s.metas?zo(s):[]}var Dv;(function(s){s.SYNC="sync",s.JOIN="join",s.LEAVE="leave"})(Dv||(Dv={}));class fE{get state(){return this.presenceAdapter.state}constructor(n,i){this.channel=n,this.presenceAdapter=new Lr(this.channel.channelAdapter,i)}}function mE(s){if(s instanceof Error)return s;if(typeof s=="string")return new Error(s);if(s&&typeof s=="object"){const n=s;
141if(typeof n.code=="number"){const i=typeof n.reason=="string"&&n.reason?` (${n.reason})`:"";return new Error(`socket closed: ${n.code}${i}`,{cause:s})}return new Error("channel error: transport failure",{cause:s})}return new Error("channel error: connection lost")}class gE{constructor(n,i,l){const o=pE(l);this.channel=n.getSocket().channel(i,o),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,i){return this.channel.on(n,i)}off(n,i){this.channel.off(n,i)}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,i,l){let o;try{o=this.channel.push(n,i,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>YS){const h=this.channel.pushBuffer.shift();h.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${h.event}`,h.payload())}return o}updateJoinPayload(n){const i=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},i),n)}canPush(){return this.socket.isConnected()&&this.state===qa.joined}isJoined(){return this.state===qa.joined}isJoining(){return this.state===qa.joining}isClosed(){return this.state===qa.closed}isLeaving(){return this.state===qa.leaving}updateFilterBindings(n){this.channel.filterBindings=n}updatePayloadTransform(n){this.channel.onMessage=n}getChannel(){return this.channel}}function pE(s){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},s.config)}}const vE=/[,()"\\]/,yE=s=>vE.test(s)||s!==s.trim(),bE=s=>`"${s.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,Uv=s=>{const n=s===null?"null":String(s);return yE(n)?bE(n):n},_E=s=>s===null?"null":String(s),xE=(s,n)=>{if(s==="in"){const i=Array.isArray(n)?n:[n];if(i.length===0)throw new Error("Realtime `in` filter requires at least one value.");return`in.(${Array.from(new Set(i)).map(o=>Uv(o)).join(",")})`}return s==="is"?`is.${_E(n)}`:`${s}.${Uv(n)}`};class wE{constructor(){this.filters=[]}add(n,i,l,o=!1){const h=o?"not.":"";return this.filters.push(`${n}=${h}${xE(i,l)}`),this}eq(n,i){return this.add(n,"eq",i)}neq(n,i){return this.add(n,"neq",i)}gt(n,i){return this.add(n,"gt",i)}gte(n,i){return this.add(n,"gte",i)}lt(n,i){return this.add(n,"lt",i)}lte(n,i){return this.add(n,"lte",i)}in(n,i){return this.add(n,"in",i)}like(n,i){return this.add(n,"like",i)}ilike(n,i){return this.add(n,"ilike",i)}match(n,i){return this.add(n,"match",i)}imatch(n,i){return this.add(n,"imatch",i)}is(n,i){return this.add(n,"is",i)}isDistinct(n,i){return this.add(n,"isdistinct",i)}not(n,i,l){return this.add(n,i,l,!0)}build(){return this.filters.join(",")}toString(){return this.build()}}var Lv;(function(s){s.ALL="*",s.INSERT="INSERT",s.UPDATE="UPDATE",s.DELETE="DELETE"})(Lv||(Lv={}));var ps;(function(s){s.BROADCAST="broadcast",s.PRESENCE="presence",s.POSTGRES_CHANGES="postgres_changes",s.SYSTEM="system"})(ps||(ps={}));var sa;(function(s){s.SUBSCRIBED="SUBSCRIBED",s.TIMED_OUT="TIMED_OUT",s.CLOSED="CLOSED",s.CHANNEL_ERROR="CHANNEL_ERROR"})(sa||(sa={}));class ia{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,i={config:{}},l){var o,h;if(this.topic=n,this.params=i,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},i.config),this.channelAdapter=new gE(this.socket.socketAdapter,n,this.params),this.presence=new fE(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=Xy(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((h=(o=this.params.config)===null||o===void 0?void 0:o.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,i=this.timeout){var l,o,h,f;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:m,presence:g,private:v,postgres_changes_options:b}}=this.params,y=(o=(l=this.bindings.postgres_changes)===null||l===void 0?void 0:l.map(N=>N.filter))!==null&&o!==void 0?o:[],w=!!this.bindings[ps.PRESENCE]&&this.bindings[ps.PRESENCE].length>
1410||((h=this.params.config.presence)===null||h===void 0?void 0:h.enabled)===!0,x={},R=Object.assign({broadcast:m,presence:Object.assign(Object.assign({},g),{enabled:w}),postgres_changes:y,private:v},b?{postgres_changes_options:b}:{});this.socket.accessTokenValue&&(x.access_token=this.socket.accessTokenValue),this._onError(N=>{n==null||n(sa.CHANNEL_ERROR,mE(N))}),this._onClose(()=>n==null?void 0:n(sa.CLOSED)),this.updateJoinPayload(Object.assign({config:R},x)),this._updateFilterMessage();const j=b!=null&&b.wait&&y.length>0?Math.max(i,((f=b.timeout)!==null&&f!==void 0?f:VS)+KS):i;this.channelAdapter.subscribe(j).receive("ok",async({postgres_changes:N})=>{if(this.socket._isManualToken()||this.socket.setAuth(),N===void 0){n==null||n(sa.SUBSCRIBED);return}this._updatePostgresBindings(N,n)}).receive("error",N=>{this.state=qa.errored;const T=Object.values(N).join(", ")||"error";n==null||n(sa.CHANNEL_ERROR,new Error(T,{cause:N}))}).receive("timeout",()=>{n==null||n(sa.TIMED_OUT)})}return this}_updatePostgresBindings(n,i){var l;const o=this.bindings.postgres_changes,h=(l=o==null?void 0:o.length)!==null&&l!==void 0?l:0,f=[];for(let m=0;m<h;m++){const g=o[m],{filter:{event:v,schema:b,table:y,filter:w}}=g,x=n&&n[m];if(x&&x.event===v&&ia.isFilterValueEqual(x.schema,b)&&ia.isFilterValueEqual(x.table,y)&&ia.isFilterValueEqual(x.filter,w))f.push(Object.assign(Object.assign({},g),{id:x.id}));else{this.unsubscribe(),this.state=qa.errored,i==null||i(sa.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=f,this.state!=qa.errored&&i&&i(sa.SUBSCRIBED)}presenceState(){return this.presence.state}async track(n,i={}){return await this.send({type:"presence",event:"track",payload:n},i)}async untrack(n={}){return await this.send({type:"presence",event:"untrack"},n)}on(n,i,l){const o=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),h=n===ps.PRESENCE||n===ps.POSTGRES_CHANGES;if(o&&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,i,l)}async httpSend(n,i,l={}){var o;if(i==null)return Promise.reject(new Error("Payload is required for httpSend()"));const h=i instanceof ArrayBuffer||ArrayBuffer.isView(i),f={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":h?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(f.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:f,body:h?i:JSON.stringify(i)},v=await this._fetchWithTimeout(m.toString(),g,(o=l.timeout)!==null&&o!==void 0?o:this.timeout);if(v.status===202)return{success:!0};if(v.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 b=v.statusText;try{const y=await v.json();b=y.error||y.message||b}catch{}return Promise.reject(new Error(b))}async send(n,i={}){var l,o;if(!this.channelAdapter.canPush()&&n.type==="broadcast"){const h="Realtime send() is automatically falling back to REST API. This behavior will be deprecated
141in the future. Please use httpSend() explicitly for REST delivery.";this.socket.hasLogger()?this.socket.log("channel",h):console.warn(h);const{event:f,payload:m}=n,g={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(g.Authorization=`Bearer ${this.socket.accessTokenValue}`);const v={method:"POST",headers:g,body:JSON.stringify({messages:[{topic:this.subTopic,event:f,payload:m,private:this.private}]})};try{const b=await this._fetchWithTimeout(this.broadcastEndpointURL,v,(l=i.timeout)!==null&&l!==void 0?l:this.timeout);return await((o=b.body)===null||o===void 0?void 0:o.cancel()),b.ok?"ok":"error"}catch(b){return b instanceof Error&&b.name==="AbortError"?"timed out":"error"}}else return new Promise(h=>{var f,m,g;const v=this.channelAdapter.push(n.type,n,i.timeout||this.timeout);n.type==="broadcast"&&!(!((g=(m=(f=this.params)===null||f===void 0?void 0:f.config)===null||m===void 0?void 0:m.broadcast)===null||g===void 0)&&g.ack)&&h("ok"),v.receive("ok",()=>h("ok")),v.receive("error",()=>h("error")),v.receive("timeout",()=>h("timed out"))})}updateJoinPayload(n){this.channelAdapter.updateJoinPayload(n)}async unsubscribe(n=this.timeout){return new Promise(i=>{this.channelAdapter.unsubscribe(n).receive("ok",()=>i("ok")).receive("timeout",()=>i("timed out")).receive("error",()=>i("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(n,i,l){const o=new AbortController,h=setTimeout(()=>o.abort(),l),f=await this.socket.fetch(n,Object.assign(Object.assign({},i),{signal:o.signal}));return clearTimeout(h),f}_on(n,i,l){var o;const h=n.toLocaleLowerCase(),f=i==null?void 0:i.filter;if((f instanceof wE||typeof f=="object"&&f!==null&&typeof f.build=="function")&&(i=Object.assign(Object.assign({},i),{filter:f.build()})),h===ps.POSTGRES_CHANGES&&((o=this.bindings[h])===null||o===void 0?void 0:o.find(b=>ia.isSamePostgresFilter(b.filter,i))))return this.socket.log("error",`duplicate \`postgres_changes\` binding for ${this.topic} ignored`,i),this;const m=this.channelAdapter.on(n,l),g={type:h,filter:i,callback:l,ref:m};return this.bindings[h]?this.bindings[h].push(g):this.bindings[h]=[g],this._updateFilterMessage(),this}_onClose(n){this.channelAdapter.onClose(n)}_onError(n){this.channelAdapter.onError(n)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((n,i,l)=>{var o,h,f,m,g,v,b;const y=n.event.toLocaleLowerCase();if(this._notThisChannelEvent(y,l))return!1;const w=(o=this.bindings[y])===null||o===void 0?void 0:o.find(x=>x.ref===n.ref);if(!w)return!0;if(["broadcast","presence","postgres_changes"].includes(y))if("id"in w){const x=w.id,R=(h=w.filter)===null||h===void 0?void 0:h.event;return x&&((f=i.ids)===null||f===void 0?void 0:f.includes(x))&&(R==="*"||(R==null?void 0:R.toLocaleLowerCase())===((m=i.data)===null||m===void 0?void 0:m.type.toLocaleLowerCase()))}else{const x=(v=(g=w==null?void 0:w.filter)===null||g===void 0?void 0:g.event)===null||v===void 0?void 0:v.toLocaleLowerCase();return x==="*"||x===((b=i==null?void 0:i.event)===null||b===void 0?void 0:b.toLocaleLowerCase())}else return w.type.toLocaleLowerCase()===y})}_notThisChannelEvent(n,i){const{close:l,error:o,leave:h,join:f}=Jy;return i&&[l,o,h,f].includes(n)&&i!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((n,i,l)=>{if(typeof i=="object"&&"ids"in i){const o=i.data,{schema:h,table:f,commit_timestamp:m,type:g,errors:v}=o;return Object.assign(Object.assign({},{schema:h,table:f,commit_timestamp:m,eventType:g,new:{},old:{},errors:v}),this._getPayloadRecords(o))}return i})}copyBindings(n){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const i in n.bindings)for(const l of n.bindings[i])this._on(l.type,l.filter,l.callback)}static isFilterValueEqual(n,i){return(n??void 0)===(i??void 0)}static isSamePostgresFilter(n,i){var l,o,h,f;const m=(o=(l=n==null?void 0:n.select)===null||l===void 0?void 0:l.join())!==null&&o!==void 0?o:void 0,g=(f=(h=i==null?void 0:i.select)===null||h===void 0?void 0:h.join())!==null&&f!==void 0?f:void 0;return(n==null?void 0:n.event)===(i==null?void 0:i.event)&&ia.isFilterValueEqual(n==null?void 0:n.schema,i==null?void 0:i.schema)&&ia.isFilterValueEqual(n==null?void 0:n.table,i==null?void 0:i.table)&&ia.isFilterValueEqual(n==null?void 0:n.filter,i==null?void 0:i.filter)&&m===g}_getPayloadRecords(n){const i={new:{},old:{}};
141return(n.type==="INSERT"||n.type==="UPDATE")&&(i.new=Cv(n.columns,n.record)),(n.type==="UPDATE"||n.type==="DELETE")&&(i.old=Cv(n.columns,n.old_record)),i}}class SE{constructor(n,i){this.socket=new cE(n,i)}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,i,l,o=1e4){return new Promise(h=>{setTimeout(()=>h("timeout"),o),this.socket.disconnect(()=>{n(),h("ok")},i,l)})}push(n){this.socket.push(n)}log(n,i,l){this.socket.log(n,i,l)}hasLogger(){return this.socket.hasLogger()}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()==rd.connecting}isDisconnecting(){return this.socket.connectionState()==rd.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const Mv={HEARTBEAT_INTERVAL:25e3},EE=[1e3,2e3,5e3,1e4],jE=1e4;function TE(){const s=new Map;return{get length(){return s.size},clear(){s.clear()},getItem(n){return s.has(n)?s.get(n):null},key(n){var i;return(i=Array.from(s.keys())[n])!==null&&i!==void 0?i:null},removeItem(n){s.delete(n)},setItem(n,i){s.set(n,String(i))}}}function RE(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return TE()}const AE=` 142 addEventListener("message", (e) => { 143 if (e.data.event === "start") { 144 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 145 } 146 });`;class NE{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,i){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 JS,this._manuallySetToken=!1,this._authPromise=null,this._authGeneration=0,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=h=>h?(...f)=>h(...f):(...f)=>fetch(...f),!(!((l=i==null?void 0:i.params)===null||l===void 0)&&l.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=i.params.apikey;const o=this._initializeOptions(i);this.socketAdapter=new SE(n,o),this.httpEndpoint=Xy(n),this.fetch=this._resolveFetch(i==null?void 0:i.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 i=n.message;throw new Error(`WebSocket not available: ${i}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(n,i){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},n,i)}getChannels(){return this.channels}async removeChannel(n){const i=await n.unsubscribe();return i==="ok"&&n.teardown(),i}async removeAllChannels(){const n=this.channels.map(async l=>{const o=await l.unsubscribe();return l.teardown(),o}),i=await Promise.all(n);return await this.disconnect(),i}log(n,i,l){this.socketAdapter.log(n,i,l)}hasLogger(){return this.socketAdapter.hasLogger()}connectionState(){return this.socketAdapter.connectionState()||rd.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(n,i={config:{}}){const l=`realtime:${n}`,o=this.getChannels().find(h=>h.topic===l);if(o)return o;{const h=new ia(`realtime:${n}`,i,this);return this._cancelPendingDisconnect(),this.channels.push(h),h}}push(n){this.socketAdapter.push(n)}async setAuth(n=null){const i=++this._authGeneration,l=this._performAuth(n,i);i===this._authGeneration&&(this._authPromise=l);try{await l}finally{this._authPromise===l&&(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(i=>i.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}
146this._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,i){let l,o=!1;if(n)l=n,o=!0;else if(this.accessToken)try{l=await this.accessToken()}catch(h){this.log("error","Error fetching access token from callback",h),l=this.accessTokenValue}else l=this.accessTokenValue;i===this._authGeneration&&(this.accessToken?this._manuallySetToken=!1:o&&(this._manuallySetToken=!0),this.accessTokenValue!=l&&(this.accessTokenValue=l,this.channels.forEach(h=>{const f={access_token:l,version:$S};h.updateJoinPayload(f),h.joinedOnce&&h.channelAdapter.isJoined()&&h.channelAdapter.push(Jy.access_token,{access_token:l})})))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(n="general"){this._isManualToken()||this.setAuth().catch(i=>{this.log("error",`Error setting auth in ${n}`,i)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(i=>{this.log("error","error waiting for auth on connect",i)}),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(i,l)=>{i!=="disconnected"&&(i=="sent"&&this._setAuthSafely(),n&&n(i,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=i=>{this.log("worker","worker error",i.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=i=>{i.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 i;if(n)i=n;else{const l=new Blob([AE],{type:"application/javascript"});i=URL.createObjectURL(l)}return i}_initializeOptions(n){var i,l,o,h,f,m,g,v,b,y,w,x;this.worker=(i=n==null?void 0:n.worker)!==null&&i!==void 0?i:!1,this.accessToken=(l=n==null?void 0:n.accessToken)!==null&&l!==void 0?l:null;const R={};R.timeout=(o=n==null?void 0:n.timeout)!==null&&o!==void 0?o:GS,R.heartbeatIntervalMs=(h=n==null?void 0:n.heartbeatIntervalMs)!==null&&h!==void 0?h:Mv.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(f=n==null?void 0:n.disconnectOnEmptyChannelsAfterMs)!==null&&f!==void 0?f:2*((m=n==null?void 0:n.heartbeatIntervalMs)!==null&&m!==void 0?m:Mv.HEARTBEAT_INTERVAL),R.transport=(g=n==null?void 0:n.transport)!==null&&g!==void 0?g:HS.getWebSocketConstructor(),R.params=n==null?void 0:n.params,R.logger=n==null?void 0:n.logger,R.heartbeatCallback=this._wrapHeartbeatCallback(n==null?void 0:n.heartbeatCallback),R.sessionStorage=(v=n==null?void 0:n.sessionStorage)!==null&&v!==void 0?v:RE(),R.reconnectAfterMs=(b=n==null?void 0:n.reconnectAfterMs)!==null&&b!==void 0?b:(C=>EE[C-1]||jE);let j,N;const T=(y=n==null?void 0:n.vsn)!==null&&y!==void 0?y:PS;switch(T){case IS:j=(C,B)=>B(JSON.stringify(C)),N=(C,B)=>B(JSON.parse(C));break;case Yy:j=this.serializer.encode.bind(this.serializer),N=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${R.vsn}`)}if(R.vsn=T,R.encode=(w=n==null?void 0:n.encode)!==null&&w!==void 0?w:j,R.decode=(x=n==null?void 0:n.decode)!==null&&x!==void 0?x:N,R.beforeReconnect=this._reconnectAuth.bind(this),(n!=null&&n.logLevel||n!=null&&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==null?void 0:n.workerUrl,R.autoSendHeartbeat=!this.worker}return R}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
146var Br=class extends Error{constructor(s,n){var i;super(s),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)&&((i=n.icebergType)==null?void 0:i.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function OE(s,n,i){const l=new URL(n,s);if(i)for(const[o,h]of Object.entries(i))h!==void 0&&l.searchParams.set(o,h);return l.toString()}async function CE(s){return!s||s.type==="none"?{}:s.type==="bearer"?{Authorization:`Bearer ${s.token}`}:s.type==="header"?{[s.name]:s.value}:s.type==="custom"?await s.getHeaders():{}}function kE(s){const n=s.fetchImpl??globalThis.fetch;return{async request({method:i,path:l,query:o,body:h,headers:f}){const m=OE(s.baseUrl,l,o),g=await CE(s.auth),v=await n(m,{method:i,headers:{...h?{"Content-Type":"application/json"}:{},...g,...f},body:h?JSON.stringify(h):void 0}),b=await v.text(),y=(v.headers.get("content-type")||"").includes("application/json"),w=y&&b?JSON.parse(b):b;if(!v.ok){const x=y?w:void 0,R=x==null?void 0:x.error;throw new Br((R==null?void 0:R.message)??`Request failed with status ${v.status}`,{status:v.status,icebergType:R==null?void 0:R.type,icebergCode:R==null?void 0:R.code,details:x})}return{status:v.status,headers:v.headers,data:w}}}}function No(s){return s.join("�")}var DE=class{constructor(s,n=""){this.client=s,this.prefix=n}async listNamespaces(s){const n=s?{parent:No(s.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:n})).data.namespaces.map(l=>({namespace:l}))}async createNamespace(s,n){const i={namespace:s.namespace,properties:n==null?void 0:n.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:i})).data}async dropNamespace(s){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${No(s.namespace)}`})}async loadNamespaceMetadata(s){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${No(s.namespace)}`})).data.properties}}async namespaceExists(s){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${No(s.namespace)}`}),!0}catch(n){if(n instanceof Br&&n.status===404)return!1;throw n}}async createNamespaceIfNotExists(s,n){try{return await this.createNamespace(s,n)}catch(i){if(i instanceof Br&&i.status===409)return;throw i}}};function mi(s){return s.join("�")}var UE=class{constructor(s,n="",i){this.client=s,this.prefix=n,this.accessDelegation=i}async listTables(s){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${mi(s.namespace)}/tables`})).data.identifiers}async createTable(s,n){const i={};return this.accessDelegation&&(i["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${mi(s.namespace)}/tables`,body:n,headers:i})).data.metadata}async updateTable(s,n){const i=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${mi(s.namespace)}/tables/${s.name}`,body:n});return{"metadata-location":i.data["metadata-location"],metadata:i.data.metadata}}async dropTable(s,n){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${mi(s.namespace)}/tables/${s.name}`,query:{purgeRequested:String((n==null?void 0:n.purge)??!1)}})}async loadTable(s){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${mi(s.namespace)}/tables/${s.name}`,headers:n})).data.metadata}async tableExists(s){const n={};this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${mi(s.namespace)}/tables/${s.name}`,headers:n}),!0}catch(i){if(i instanceof Br&&i.status===404)return!1;throw i}}async createTableIfNotExists(s,n){try{return await this.createTable(s,n)}catch(i){if(i instanceof Br&&i.status===409)return await this.loadTable({namespace:s.namespace,name:n.name});throw i}}},LE=class{constructor(s){var l;let n="v1";s.catalogName&&(n+=`/${s.catalogName}`);const i=s.baseUrl.endsWith("/")?s.baseUrl:`${s.baseUrl}/`;this.client=kE({baseUrl:i,auth:s.auth,fetchImpl:s.fetch}),this.accessDelegation=(l=s.accessDelegation)==null?void 0:l.join(","),this.namespaceOps=new DE(this.client,n),this.tableOps=new UE(this.client,n,this.accessDelegation)}async listNamespaces(s){return this.namespaceOps.listNamespaces(s)}async createNamespace(s,n){return this.namespaceOps.createNamespace(s,n)}async dropNamespace(s){await this.namespaceOps.dropNamespace(s)}async loadNamespaceMetadata(s){return this.namespaceOps.loadNamespaceMetadata(s)}async listTables(s){return this.tableOps.listTables(s)}
146async createTable(s,n){return this.tableOps.createTable(s,n)}async updateTable(s,n){return this.tableOps.updateTable(s,n)}async dropTable(s,n){await this.tableOps.dropTable(s,n)}async loadTable(s){return this.tableOps.loadTable(s)}async namespaceExists(s){return this.namespaceOps.namespaceExists(s)}async tableExists(s){return this.tableOps.tableExists(s)}async createNamespaceIfNotExists(s,n){return this.namespaceOps.createNamespaceIfNotExists(s,n)}async createTableIfNotExists(s,n){return this.tableOps.createTableIfNotExists(s,n)}};function Hr(s){"@babel/helpers - typeof";return Hr=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},Hr(s)}function ME(s,n){if(Hr(s)!="object"||!s)return s;var i=s[Symbol.toPrimitive];if(i!==void 0){var l=i.call(s,n);if(Hr(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(s)}function zE(s){var n=ME(s,"string");return Hr(n)=="symbol"?n:n+""}function BE(s,n,i){return(n=zE(n))in s?Object.defineProperty(s,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):s[n]=i,s}function zv(s,n){var i=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);n&&(l=l.filter(function(o){return Object.getOwnPropertyDescriptor(s,o).enumerable})),i.push.apply(i,l)}return i}function re(s){for(var n=1;n<arguments.length;n++){var i=arguments[n]!=null?arguments[n]:{};n%2?zv(Object(i),!0).forEach(function(l){BE(s,l,i[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(i)):zv(Object(i)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(i,l))})}return s}var tu=class extends Error{constructor(s,n="storage",i,l){super(s),this.__isStorageError=!0,this.namespace=n,this.name=n==="vectors"?"StorageVectorsError":"StorageError",this.status=i,this.statusCode=l}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function nu(s){return typeof s=="object"&&s!==null&&"__isStorageError"in s}var cd=class extends tu{constructor(s,n,i,l="storage",o){super(s,l,n,i),this.name=l==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=n,this.statusCode=i,this.code=o}toJSON(){return re(re({},super.toJSON()),{},{code:this.code})}},Fy=class extends tu{constructor(s,n,i="storage"){super(s,i),this.name=i==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=n}};function Io(s,n,i){const l=re({},s),o=n.toLowerCase();for(const h of Object.keys(l))h.toLowerCase()===o&&delete l[h];return l[o]=i,l}function HE(s){const n={};for(const[i,l]of Object.entries(s))n[i.toLowerCase()]=l;return n}const qE=s=>s?(...n)=>s(...n):(...n)=>fetch(...n),$E=s=>{if(typeof s!="object"||s===null)return!1;const n=Object.getPrototypeOf(s);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},hd=s=>{if(Array.isArray(s))return s.map(i=>hd(i));if(typeof s=="function"||s!==Object(s))return s;const n={};return Object.entries(s).forEach(([i,l])=>{const o=i.replace(/([-_][a-z])/gi,h=>h.toUpperCase().replace(/[-_]/g,""));n[o]=hd(l)}),n},IE=s=>!s||typeof s!="string"||s.length===0||s.length>100||s.trim()!==s||s.includes("/")||s.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(s),dd=s=>s.split("/").map(encodeURIComponent).join("/"),Bv=s=>{if(typeof s=="object"&&s!==null){const n=s;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 i=n.error;if(typeof i.message=="string")return i.message}}return JSON.stringify(s)},PE=async(s,n,i,l)=>{if(s!==null&&typeof s=="object"&&"json"in s&&typeof s.json=="function"){const o=s;let h=parseInt(String(o.status),10);Number.isFinite(h)||(h=500),o.json().then(f=>{const m=(f==null?void 0:f.statusCode)||(f==null?void 0:f.code)||h+"";n(new cd(Bv(f),h,m,l,f==null?void 0:f.code))}).catch(()=>{const f=h+"";n(new cd(o.statusText||`HTTP ${h} error`,h,f,l))})}else n(new Fy(Bv(s),s,l))},GE=(s,n,i,l)=>{const o={method:s,headers:(n==null?void 0:n.headers)||{}};if(s==="GET"||s==="HEAD"||!l)return re(re({},o),i);if($E(l)){var h;const f=(n==null?void 0:n.headers)||{};let m;
146for(const[g,v]of Object.entries(f))g.toLowerCase()==="content-type"&&(m=v);o.headers=Io(f,"Content-Type",(h=m)!==null&&h!==void 0?h:"application/json"),o.body=JSON.stringify(l)}else o.body=l;return n!=null&&n.duplex&&(o.duplex=n.duplex),re(re({},o),i)};async function Or(s,n,i,l,o,h,f){return new Promise((m,g)=>{s(i,GE(n,l,o,h)).then(v=>{if(!v.ok)throw v;if(l!=null&&l.noResolveJson)return v;if(f==="vectors"){const b=v.headers.get("content-type");if(v.headers.get("content-length")==="0"||v.status===204)return{};if(!b||!b.includes("application/json"))return{}}return v.json()}).then(v=>m(v)).catch(v=>PE(v,g,l,f))})}function Wy(s="storage"){return{get:async(n,i,l,o)=>Or(n,"GET",i,l,o,void 0,s),post:async(n,i,l,o,h)=>Or(n,"POST",i,o,h,l,s),put:async(n,i,l,o,h)=>Or(n,"PUT",i,o,h,l,s),head:async(n,i,l,o)=>Or(n,"HEAD",i,re(re({},l),{},{noResolveJson:!0}),o,void 0,s),remove:async(n,i,l,o,h)=>Or(n,"DELETE",i,o,h,l,s)}}const VE=Wy("storage"),{get:wi,post:pn,put:Po,head:KE,remove:Si}=VE,Yt=Wy("vectors");var Ci=class{constructor(s,n={},i,l="storage"){this.shouldThrowOnError=!1,this.url=s,this.headers=HE(n),this.fetch=qE(i),this.namespace=l}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(s,n){return this.headers=Io(this.headers,s,n),this}async handleOperation(s){var n=this;try{return{data:await s(),error:null}}catch(i){if(n.shouldThrowOnError)throw i;if(nu(i))return{data:null,error:i};throw i}}};let e0;e0=Symbol.toStringTag;var YE=class{constructor(s,n){this.downloadFn=s,this.shouldThrowOnError=n,this[e0]="StreamDownloadBuilder",this.promise=null}then(s,n){return this.getPromise().then(s,n)}catch(s){return this.getPromise().catch(s)}finally(s){return this.getPromise().finally(s)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var s=this;try{return{data:(await s.downloadFn()).body,error:null}}catch(n){if(s.shouldThrowOnError)throw n;if(nu(n))return{data:null,error:n};throw n}}};let t0;t0=Symbol.toStringTag;var JE=class{constructor(s,n){this.downloadFn=s,this.shouldThrowOnError=n,this[t0]="BlobDownloadBuilder",this.promise=null}asStream(){return new YE(this.downloadFn,this.shouldThrowOnError)}then(s,n){return this.getPromise().then(s,n)}catch(s){return this.getPromise().catch(s)}finally(s){return this.getPromise().finally(s)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var s=this;try{return{data:await(await s.downloadFn()).blob(),error:null}}catch(n){if(s.shouldThrowOnError)throw n;if(nu(n))return{data:null,error:n};throw n}}};const Qh={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Hv={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var QE=class extends Ci{constructor(s,n={},i,l){super(s,n,l,"storage"),this.bucketId=i}async uploadOrUpdate(s,n,i,l){var o=this;return o.handleOperation(async()=>{let h;const f=re(re({},Hv),l);let m=re(re({},o.headers),s==="POST"&&{"x-upsert":String(f.upsert)});const g=f.metadata;if(typeof Blob<"u"&&i instanceof Blob?(h=new FormData,h.append("cacheControl",f.cacheControl),g&&h.append("metadata",o.encodeMetadata(g)),h.append("",i)):typeof FormData<"u"&&i instanceof FormData?(h=i,h.has("cacheControl")||h.append("cacheControl",f.cacheControl),g&&!h.has("metadata")&&h.append("metadata",o.encodeMetadata(g))):(h=i,m["cache-control"]=`max-age=${f.cacheControl}`,m["content-type"]=f.contentType,g&&(m["x-metadata"]=o.toBase64(o.encodeMetadata(g))),(typeof ReadableStream<"u"&&h instanceof ReadableStream||h&&typeof h=="object"&&"pipe"in h&&typeof h.pipe=="function")&&!f.duplex&&(f.duplex="half")),l!=null&&l.headers)for(const[w,x]of Object.entries(l.headers))m=Io(m,w,x);const v=o._removeEmptyFolders(n),b=o._getFinalPath(v),y=await(s=="PUT"?Po:pn)(o.fetch,`${o.url}/object/${b}`,h,re({headers:m},f!=null&&f.duplex?{duplex:f.duplex}:{}));return{path:v,id:y.Id,fullPath:y.Key}})}async upload(s,n,i){return this.uploadOrUpdate("POST",s,n,i)}async uploadToSignedUrl(s,n,i,l){var o=this;const h=o._removeEmptyFolders(s),f=o._getFinalPath(h),m=new URL(o.url+`/object/upload/sign/${f}`);return m.searchParams.set("token",n),o.handleOperation(async()=>{let g;const v=re(re({},Hv),l);let b=re(re({},o.headers),{"x-upsert":String(v.upsert)});const y=v.metadata;
146if(typeof Blob<"u"&&i instanceof Blob?(g=new FormData,g.append("cacheControl",v.cacheControl),y&&g.append("metadata",o.encodeMetadata(y)),g.append("",i)):typeof FormData<"u"&&i instanceof FormData?(g=i,g.has("cacheControl")||g.append("cacheControl",v.cacheControl),y&&!g.has("metadata")&&g.append("metadata",o.encodeMetadata(y))):(g=i,b["cache-control"]=`max-age=${v.cacheControl}`,b["content-type"]=v.contentType,y&&(b["x-metadata"]=o.toBase64(o.encodeMetadata(y))),(typeof ReadableStream<"u"&&g instanceof ReadableStream||g&&typeof g=="object"&&"pipe"in g&&typeof g.pipe=="function")&&!v.duplex&&(v.duplex="half")),l!=null&&l.headers)for(const[w,x]of Object.entries(l.headers))b=Io(b,w,x);return{path:h,fullPath:(await Po(o.fetch,m.toString(),g,re({headers:b},v!=null&&v.duplex?{duplex:v.duplex}:{}))).Key}})}async createSignedUploadUrl(s,n){var i=this;return i.handleOperation(async()=>{let l=i._getFinalPath(s);const o=re({},i.headers);n!=null&&n.upsert&&(o["x-upsert"]="true");const h=await pn(i.fetch,`${i.url}/object/upload/sign/${l}`,{},{headers:o}),f=new URL(i.url+h.url),m=f.searchParams.get("token");if(!m)throw new tu("No token returned by API");return{signedUrl:f.toString(),path:s,token:m}})}async update(s,n,i){return this.uploadOrUpdate("PUT",s,n,i)}async move(s,n,i){var l=this;return l.handleOperation(async()=>await pn(l.fetch,`${l.url}/object/move`,{bucketId:l.bucketId,sourceKey:s,destinationKey:n,destinationBucket:i==null?void 0:i.destinationBucket,sourceVersionId:i==null?void 0:i.sourceVersionId},{headers:l.headers}))}async copy(s,n,i){var l=this;return l.handleOperation(async()=>({path:(await pn(l.fetch,`${l.url}/object/copy`,{bucketId:l.bucketId,sourceKey:s,destinationKey:n,destinationBucket:i==null?void 0:i.destinationBucket,sourceVersionId:i==null?void 0:i.sourceVersionId},{headers:l.headers})).Key}))}async createSignedUrl(s,n,i){var l=this;return l.handleOperation(async()=>{let o=l._getFinalPath(s);const h=typeof(i==null?void 0:i.transform)=="object"&&i.transform!==null&&Object.keys(i.transform).length>0;let f=await pn(l.fetch,`${l.url}/object/sign/${o}`,re(re({expiresIn:n},h?{transform:i.transform}:{}),(i==null?void 0:i.versionId)!=null?{versionId:i.versionId}:{}),{headers:l.headers});const m=new URLSearchParams;i!=null&&i.download&&m.set("download",i.download===!0?"":i.download),(i==null?void 0:i.cacheNonce)!=null&&m.set("cacheNonce",String(i.cacheNonce));const g=m.toString();return{signedUrl:encodeURI(`${l.url}${f.signedURL}${g?`&${g}`:""}`)}})}async createSignedUrls(s,n,i){var l=this;return l.handleOperation(async()=>{const o=await pn(l.fetch,`${l.url}/object/sign/${l.bucketId}`,{expiresIn:n,paths:s},{headers:l.headers}),h=new URLSearchParams;i!=null&&i.download&&h.set("download",i.download===!0?"":i.download),(i==null?void 0:i.cacheNonce)!=null&&h.set("cacheNonce",String(i.cacheNonce));const f=h.toString();return o.map(m=>re(re({},m),{},{signedUrl:m.signedURL?encodeURI(`${l.url}${m.signedURL}${f?`&${f}`:""}`):null}))})}download(s,n,i){const l=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0?"render/image/authenticated":"object",o=new URLSearchParams;n!=null&&n.transform&&this.applyTransformOptsToQuery(o,n.transform),(n==null?void 0:n.cacheNonce)!=null&&o.set("cacheNonce",String(n.cacheNonce)),(n==null?void 0:n.versionId)!=null&&o.set("versionId",String(n.versionId));const h=o.toString(),f=this._getFinalPath(s),m=()=>wi(this.fetch,`${this.url}/${l}/${f}${h?`?${h}`:""}`,{headers:this.headers,noResolveJson:!0},i);return new JE(m,this.shouldThrowOnError)}async info(s,n){var i=this;const l=i._getFinalPath(s),o=new URLSearchParams;(n==null?void 0:n.versionId)!=null&&o.set("versionId",String(n.versionId));const h=o.toString();return i.handleOperation(async()=>hd(await wi(i.fetch,`${i.url}/object/info/${l}${h?`?${h}`:""}`,{headers:i.headers})))}async exists(s){var n=this;const i=n._getFinalPath(s);try{return await KE(n.fetch,`${n.url}/object/${i}`,{headers:n.headers}),{data:!0,error:null}}catch(o){if(n.shouldThrowOnError)throw o;if(nu(o)){var l;const h=o instanceof cd?o.status:o instanceof Fy?(l=o.originalError)===null||l===void 0?void 0:l.status:void 0;if(h!==void 0&&[400,404].includes(h))return{data:!1,error:o}}throw o}}getPublicUrl(s,n){const i=this._getFinalPath(s),l=new URLSearchParams;n!=null&&n.download&&l.set("download",n.download===!0?"":n.download),n!=null&&n.transform&&this.applyTransformOptsToQuery(l,n.transform),(n==null?void 0:n.cacheNonce)!=null&&l.set("cacheNonce",String(n.cacheNonce)),(n==null?void 0:n.versionId)!=null&&l.set("versionId",String(n.versionId));const o=l.toString(),h=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${h}/public/${i}`)+(o?`?${o}`:"")}}}async remove(s){var n=this;return n.handleOperation(async()=>await Si(n.fetch,`${n.url}/object/${n.bucketId}`,{prefixes:s},{headers:n.headers}))}async purgeCache(s,n,i){var l=this;return l.handleOperation(async()=>{const o=dd(l._getFinalPath(s)),h=new URLSearchParams;n!=null&&n.transformations&&h.set("transformations","true");const f=h.toString();return await Si(l.fetch,`${l.url}/cdn/${o}${f?`?${f}`:""}`,{},{headers:l.headers},i)})}async list(s,n,i){var l=this;return l.handleOperation(async()=>{const o=n!=null&&n.sortBy?re(re({},Qh.sortBy),n.sortBy):Qh.sortBy,h=re(re(re({},Qh),n),{},{sortBy:o,prefix:s||""});return await pn(l.fetch,`${l.url}/object/list/${l.bucketId}`,h,{headers:l.headers},i)})}async listV2(s,n){var i=this;return i.handleOperation(async()=>{const l=re({},s);return await pn(i.fetch,`${i.url}/object/list-v2/${i.bucketId}`,l,{headers:i.headers},n)})}encodeMetadata(s){return JSON.stringify(s)}toBase64(s){return typeof Buffer<"u"?Buffer.from(s).toString("base64"):btoa(s)}_getFinalPath(s){return`${this.bucketId}/${s.replace(/^\/+/,"")}`}_removeEmptyFolders(s){return s.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(s,n){return n.width&&s.set("width",n.width.toString()),n.height&&s.set("height",n.height.toString()),n.resize&&s.set("resize",n.resize),n.format&&s.set("format",n.format),n.quality&&s.set("qual
146ity",n.quality.toString()),s}};const XE="2.117.2",Yr={"X-Client-Info":`storage-js/${XE}`};var ZE=class extends Ci{constructor(s,n={},i,l){const o=new URL(s);l!=null&&l.useNewHostname&&/supabase\.(co|in|red)$/.test(o.hostname)&&!o.hostname.includes("storage.supabase.")&&(o.hostname=o.hostname.replace("supabase.","storage.supabase."));const h=o.href.replace(/\/$/,""),f=re(re({},Yr),n);super(h,f,i,"storage")}async listBuckets(s){var n=this;return n.handleOperation(async()=>{const i=n.listBucketOptionsToQueryString(s);return await wi(n.fetch,`${n.url}/bucket${i}`,{headers:n.headers})})}async getBucket(s){var n=this;return n.handleOperation(async()=>await wi(n.fetch,`${n.url}/bucket/${s}`,{headers:n.headers}))}async createBucket(s,n={public:!1}){var i=this;return i.handleOperation(async()=>await pn(i.fetch,`${i.url}/bucket`,{id:s,name:s,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes,versioning_status:n.versioningStatus},{headers:i.headers}))}async updateBucket(s,n){var i=this;return i.handleOperation(async()=>await Po(i.fetch,`${i.url}/bucket/${s}`,{id:s,name:s,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes,versioning_status:n.versioningStatus},{headers:i.headers}))}async emptyBucket(s){var n=this;return n.handleOperation(async()=>await pn(n.fetch,`${n.url}/bucket/${s}/empty`,{},{headers:n.headers}))}async deleteBucket(s){var n=this;return n.handleOperation(async()=>await Si(n.fetch,`${n.url}/bucket/${s}`,{},{headers:n.headers}))}async getBucketLifecycle(s){var n=this;return n.handleOperation(async()=>await wi(n.fetch,n.bucketLifecycleUrl(s),{headers:n.headers}))}async updateBucketLifecycle(s,n){var i=this;return i.handleOperation(async()=>await Po(i.fetch,i.bucketLifecycleUrl(s),n,{headers:i.headers}))}async deleteBucketLifecycle(s){var n=this;return n.handleOperation(async()=>await Si(n.fetch,n.bucketLifecycleUrl(s),{},{headers:n.headers}))}async purgeBucketCache(s,n,i){var l=this;return l.handleOperation(async()=>{const o=new URLSearchParams;n!=null&&n.transformations&&o.set("transformations","true");const h=o.toString();return await Si(l.fetch,`${l.url}/cdn/${dd(s)}${h?`?${h}`:""}`,{},{headers:l.headers},i)})}bucketLifecycleUrl(s){return`${this.url}/bucket/${dd(s)}/lifecycle`}listBucketOptionsToQueryString(s){const n={};return s&&("limit"in s&&(n.limit=String(s.limit)),"offset"in s&&(n.offset=String(s.offset)),s.search&&(n.search=s.search),s.sortColumn&&(n.sortColumn=s.sortColumn),s.sortOrder&&(n.sortOrder=s.sortOrder)),Object.keys(n).length>0?"?"+new URLSearchParams(n).toString():""}},FE=class extends Ci{constructor(s,n={},i){const l=s.replace(/\/$/,""),o=re(re({},Yr),n);super(l,o,i,"storage")}async createBucket(s){var n=this;return n.handleOperation(async()=>await pn(n.fetch,`${n.url}/bucket`,{name:s},{headers:n.headers}))}async listBuckets(s){var n=this;return n.handleOperation(async()=>{const i=new URLSearchParams;(s==null?void 0:s.limit)!==void 0&&i.set("limit",s.limit.toString()),(s==null?void 0:s.offset)!==void 0&&i.set("offset",s.offset.toString()),s!=null&&s.sortColumn&&i.set("sortColumn",s.sortColumn),s!=null&&s.sortOrder&&i.set("sortOrder",s.sortOrder),s!=null&&s.search&&i.set("search",s.search);const l=i.toString(),o=l?`${n.url}/bucket?${l}`:`${n.url}/bucket`;return await wi(n.fetch,o,{headers:n.headers})})}async deleteBucket(s){var n=this;return n.handleOperation(async()=>await Si(n.fetch,`${n.url}/bucket/${s}`,{},{headers:n.headers}))}from(s){var n=this;if(!IE(s))throw new tu("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 i=new LE({baseUrl:this.url,catalogName:s,auth:{type:"custom",getHeaders:async()=>n.headers},fetch:this.fetch}),l=this.shouldThrowOnError;return new Proxy(i,{get(o,h){const f=o[h];return typeof f!="function"?f:async(...m)=>{try{return{data:await f.apply(o,m),error:null}}catch(g){if(l)throw g;return{data:null,error:g}}}}})}},WE=class extends Ci{constructor(s,n={},i){const l=s.replace(/\/$/,""),o=re(re({},Yr),{},{"Content-Type":"application/json"},n);super(l,o,i,"vectors")}async createIndex(s){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/CreateIndex`,s,{headers:n.headers})||{})}async getIndex(s,n){var i=this;return i.handleOperation(async()=>await Yt.post(i.fetch,`${i.url}/GetIndex`,{vectorBucketName:s,indexName:n},{headers:i.headers}))}async listIndexes(s){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/ListIndexes`,s,{headers:n.headers}))}async deleteIndex(s,n){var i=this;return i.handleOperation(async()=>await Yt.post(i.fetch,`${i.url}/DeleteIndex`,{vectorBucketName:s,indexName:n},{headers:i.headers})||{})}},ej=class extends Ci{constructor(s,n={},i){const l=s.replace(/\/$/,""),o=re(re({},Yr),{},{"Content-Type":"application/json"},n);super(l,o,i,"vectors")}async putVectors(s){var n=this;if(s.vectors.length<1||s.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`,s,{headers:n.headers})||{})}async getVectors(s){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/GetVectors`,s,{headers:n.headers}))}async listVectors(s){var n=this;if(s.segmentCount!==void 0){if(s.segmentCount<1||s.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
146if(s.segmentIndex!==void 0&&(s.segmentIndex<0||s.segmentIndex>=s.segmentCount))throw new Error(`segmentIndex must be between 0 and ${s.segmentCount-1}`)}return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/ListVectors`,s,{headers:n.headers}))}async queryVectors(s){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/QueryVectors`,s,{headers:n.headers}))}async deleteVectors(s){var n=this;if(s.keys.length<1||s.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`,s,{headers:n.headers})||{})}},tj=class extends Ci{constructor(s,n={},i){const l=s.replace(/\/$/,""),o=re(re({},Yr),{},{"Content-Type":"application/json"},n);super(l,o,i,"vectors")}async createBucket(s){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/CreateVectorBucket`,{vectorBucketName:s},{headers:n.headers})||{})}async getBucket(s){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/GetVectorBucket`,{vectorBucketName:s},{headers:n.headers}))}async listBuckets(s={}){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/ListVectorBuckets`,s,{headers:n.headers}))}async deleteBucket(s){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/DeleteVectorBucket`,{vectorBucketName:s},{headers:n.headers})||{})}},nj=class extends tj{constructor(s,n={}){super(s,n.headers||{},n.fetch)}from(s){return new aj(this.url,this.headers,s,this.fetch)}async createBucket(s){var n=()=>super.createBucket,i=this;return n().call(i,s)}async getBucket(s){var n=()=>super.getBucket,i=this;return n().call(i,s)}async listBuckets(s={}){var n=()=>super.listBuckets,i=this;return n().call(i,s)}async deleteBucket(s){var n=()=>super.deleteBucket,i=this;return n().call(i,s)}},aj=class extends WE{constructor(s,n,i,l){super(s,n,l),this.vectorBucketName=i}async createIndex(s){var n=()=>super.createIndex,i=this;return n().call(i,re(re({},s),{},{vectorBucketName:i.vectorBucketName}))}async listIndexes(s={}){var n=()=>super.listIndexes,i=this;return n().call(i,re(re({},s),{},{vectorBucketName:i.vectorBucketName}))}async getIndex(s){var n=()=>super.getIndex,i=this;return n().call(i,i.vectorBucketName,s)}async deleteIndex(s){var n=()=>super.deleteIndex,i=this;return n().call(i,i.vectorBucketName,s)}index(s){return new sj(this.url,this.headers,this.vectorBucketName,s,this.fetch)}},sj=class extends ej{constructor(s,n,i,l,o){super(s,n,o),this.vectorBucketName=i,this.indexName=l}async putVectors(s){var n=()=>super.putVectors,i=this;return n().call(i,re(re({},s),{},{vectorBucketName:i.vectorBucketName,indexName:i.indexName}))}async getVectors(s){var n=()=>super.getVectors,i=this;return n().call(i,re(re({},s),{},{vectorBucketName:i.vectorBucketName,indexName:i.indexName}))}async listVectors(s={}){var n=()=>super.listVectors,i=this;return n().call(i,re(re({},s),{},{vectorBucketName:i.vectorBucketName,indexName:i.indexName}))}async queryVectors(s){var n=()=>super.queryVectors,i=this;return n().call(i,re(re({},s),{},{vectorBucketName:i.vectorBucketName,indexName:i.indexName}))}async deleteVectors(s){var n=()=>super.deleteVectors,i=this;return n().call(i,re(re({},s),{},{vectorBucketName:i.vectorBucketName,indexName:i.indexName}))}},ij=class extends ZE{constructor(s,n={},i,l){super(s,n,i,l)}from(s){return new QE(this.url,this.headers,s,this.fetch)}get vectors(){return new nj(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new FE(this.url+"/iceberg",this.headers,this.fetch)}};const n0="2.117.2",ra=30*1e3,Dr=3,Xh=Dr*ra,rj=2*ra,lj="http://localhost:9999",oj="supabase.auth.token",uj={"X-Client-Info":`gotrue-js/${n0}`},fd="X-Supabase-Api-Version",a0={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},cj=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,ys="sb_flow_id",hj=5,dj=600*1e3;class qr extends Error{constructor(n,i,l){super(n),this.__isAuthError=!0,this.name="AuthError",this.status=i,this.code=l}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function Y(s){return typeof s=="object"&&s!==null&&"__isAuthError"in s}class fj extends qr{constructor(n,i,l){super(n,i,l),this.name="AuthApiError",this.status=i,this.code=l}}function qv(s){return Y(s)&&s.name==="AuthApiError"}class vn extends qr{constructor(n,i){super(n),this.name="AuthUnknownError",this.originalError=i}}class Bn extends qr{constructor(n,i,l,o){super(n,l,o),this.name=i,this.status=l}}class ut extends Bn{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Oo(s){return Y(s)&&s.name==="AuthSessionMissingError"}class gi extends Bn{constructor(){super("Auth session or user missing","AuthInvalidToken
146ResponseError",500,void 0)}}class Co extends Bn{constructor(n){super(n,"AuthInvalidCredentialsError",400,void 0)}}class ko extends Bn{constructor(n,i=null){super(n,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=i}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function mj(s){return Y(s)&&s.name==="AuthImplicitGrantRedirectError"}class $v extends Bn{constructor(n,i=null){super(n,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=i}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class gj extends Bn{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 Bo extends Bn{constructor(n,i){super(n,"AuthRetryableFetchError",i,void 0)}}function Do(s){return Y(s)&&s.name==="AuthRetryableFetchError"}class Iv extends Bn{constructor(n="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(n,"AuthRefreshDiscardedError",409,void 0)}}function Pv(s){return Y(s)&&s.name==="AuthRefreshDiscardedError"}class Gv extends Bn{constructor(n,i,l){super(n,"AuthWeakPasswordError",i,"weak_password"),this.reasons=l}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class Go extends Bn{constructor(n){super(n,"AuthInvalidJwtError",400,"invalid_jwt")}}const Vo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Vv=` 147\r=`.split(""),pj=(()=>{const s=new Array(128);for(let n=0;n<s.length;n+=1)s[n]=-1;for(let n=0;n<Vv.length;n+=1)s[Vv[n].charCodeAt(0)]=-2;for(let n=0;n<Vo.length;n+=1)s[Vo[n].charCodeAt(0)]=n;return s})();function Kv(s,n,i){if(s!==null)for(n.queue=n.queue<<8|s,n.queuedBits+=8;n.queuedBits>=6;){const l=n.queue>>n.queuedBits-6&63;i(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;i(Vo[l]),n.queuedBits-=6}}function s0(s,n,i){const l=pj[s];if(l>-1)for(n.queue=n.queue<<6|l,n.queuedBits+=6;n.queuedBits>=8;)i(n.queue>>n.queuedBits-8&255),n.queuedBits-=8;else{if(l===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(s)}"`)}}function Yv(s){const n=[],i=f=>{n.push(String.fromCodePoint(f))},l={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},h=f=>{bj(f,l,i)};for(let f=0;f<s.length;f+=1)s0(s.charCodeAt(f),o,h);return n.join("")}function vj(s,n){if(s<=127){n(s);return}else if(s<=2047){n(192|s>>6),n(128|s&63);return}else if(s<=65535){n(224|s>>12),n(128|s>>6&63),n(128|s&63);return}else if(s<=1114111){n(240|s>>18),n(128|s>>12&63),n(128|s>>6&63),n(128|s&63);return}throw new Error(`Unrecognized Unicode codepoint: ${s.toString(16)}`)}function yj(s,n){for(let i=0;i<s.length;i+=1){let l=s.charCodeAt(i);if(l>55295&&l<=56319){const o=(l-55296)*1024&65535;l=(s.charCodeAt(i+1)-56320&65535|o)+65536,i+=1}vj(l,n)}}function bj(s,n,i){if(n.utf8seq===0){if(s<=127){i(s);return}for(let l=1;l<6;l+=1)if((s>>7-l&1)===0){n.utf8seq=l;break}if(n.utf8seq===2)n.codepoint=s&31;else if(n.utf8seq===3)n.codepoint=s&15;else if(n.utf8seq===4)n.codepoint=s&7;else throw new Error("Invalid UTF-8 sequence");n.utf8seq-=1}else if(n.utf8seq>0){if(s<=127)throw new Error("Invalid UTF-8 sequence");n.codepoint=n.codepoint<<6|s&63,n.utf8seq-=1,n.utf8seq===0&&i(n.codepoint)}}function Ei(s){const n=[],i={queue:0,queuedBits:0},l=o=>{n.push(o)};for(let o=0;o<s.length;o+=1)s0(s.charCodeAt(o),i,l);return new Uint8Array(n)}function _j(s){const n=[];return yj(s,i=>n.push(i)),new Uint8Array(n)}function bs(s){const n=[],i={queue:0,queuedBits:0},l=o=>{n.push(o)};return s.forEach(o=>Kv(o,i,l)),Kv(null,i,l),n.join("")}function i0(s){return Math.round(Date.now()/1e3)+s}function xj(){return Symbol("auth-callback")}const _t=()=>typeof window<"u"&&typeof document<"u",ms={tested:!1,writable:!1},r0=()=>
147{if(!_t())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ms.tested)return ms.writable;const s=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(s,s),globalThis.localStorage.removeItem(s),ms.tested=!0,ms.writable=!0}catch{ms.tested=!0,ms.writable=!1}return ms.writable};function Jv(s){const n={},i=new URL(s);if(i.hash&&i.hash[0]==="#")try{new URLSearchParams(i.hash.substring(1)).forEach((o,h)=>{n[h]=o})}catch{}return i.searchParams.forEach((l,o)=>{n[o]=l}),n}const l0=s=>s?(...n)=>s(...n):(...n)=>fetch(...n),wj=s=>typeof s=="object"&&s!==null&&"status"in s&&"ok"in s&&"json"in s&&typeof s.json=="function",ua=async(s,n,i)=>{await s.setItem(n,JSON.stringify(i))},St=async(s,n)=>{const i=await s.getItem(n);if(!i)return null;try{return JSON.parse(i)}catch{return null}},Lt=async(s,n)=>{await s.removeItem(n)};class au{constructor(){this.promise=new au.promiseConstructor((n,i)=>{this.resolve=n,this.reject=i})}}au.promiseConstructor=Promise;function Uo(s){const n=s.split(".");if(n.length!==3)throw new Go("Invalid JWT structure");for(let l=0;l<n.length;l++)if(!cj.test(n[l]))throw new Go("JWT not in base64url format");return{header:JSON.parse(Yv(n[0])),payload:JSON.parse(Yv(n[1])),signature:Ei(n[2]),raw:{header:n[0],payload:n[1]}}}async function Sj(s){return await new Promise(n=>{setTimeout(()=>n(null),s)})}function Ej(s,n){return new Promise((l,o)=>{(async()=>{for(let h=0;h<1/0;h++)try{const f=await s(h);if(!n(h,null,f)){l(f);return}}catch(f){if(!n(h,f)){o(f);return}}})()})}function o0(s){return("0"+s.toString(16)).substr(-2)}function jj(){const n=new Uint32Array(56);if(typeof crypto>"u"){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",l=i.length;let o="";for(let h=0;h<56;h++)o+=i.charAt(Math.floor(Math.random()*l));return o}return crypto.getRandomValues(n),Array.from(n,o0).join("")}async function Tj(s){const i=new TextEncoder().encode(s),l=await crypto.subtle.digest("SHA-256",i),o=new Uint8Array(l);return Array.from(o).map(h=>String.fromCharCode(h)).join("")}async function Rj(s){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."),s;const i=await Tj(s);return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const Aj=/^[a-zA-Z0-9_-]{8,64}$/;function Ho(s){return typeof s=="string"&&Aj.test(s)?s:null}function Nj(){if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){const n=new Uint8Array(16);return crypto.getRandomValues(n),Array.from(n,o0).join("")}let s="";for(let n=0;n<32;n++)s+=Math.floor(Math.random()*16).toString(16);return s}const Ti=(s,n)=>`${s}-flow-${n}-code-verifier`,$r=s=>`${s}-flows-code-verifier`;async function Nd(s,n){const i=await St(s,$r(n));return Array.isArray(i)?i.filter(l=>Ho(l)!==null):[]}async function Oj(s,n,i,l,o){await ua(s,Ti(n,i),l);const h=(await Nd(s,n)).filter(f=>f!==i);for(h.push(i);h.length>hj;){const f=h.shift();await Lt(s,Ti(n,f)),o==null||o(f)}await ua(s,$r(n),h),await ua(s,`${n}-code-verifier`,l)}async function Cj(s,n,i){if(i){const o=await St(s,Ti(n,i));return{verifier:typeof o=="string"?o:null,flowId:i}}const l=await St(s,`${n}-code-verifier`);return{verifier:typeof l=="string"?l:null,flowId:null}}async function gn(s,n,i){const l=`${n}-code-verifier`;if(!i){await Lt(s,l);return}const o=Ti(n,i),h=await St(s,o);await Lt(s,o);const f=await Nd(s,n),m=f.filter(g=>g!==i);m.length!==f.length&&(m.length>0?await ua(s,$r(n),m):await Lt(s,$r(n))),h!=null&&h===await St(s,l)&&await Lt(s,l)}async function kj(s,n){const i=await Nd(s,n);for(const l of i)await Lt(s,Ti(n,l));await Lt(s,$r(n)),await Lt(s,`${n}-code-verifier`)}function Dj(s,n){const i=s.indexOf("#");let l=i===-1?s:s.slice(0,i);const o=i===-1?"":s.slice(i),h=l.indexOf("?");if(h!==-1){const m=l.slice(0,h),g=l.slice(h+1).split("&").filter(v=>v!==""&&v!==ys&&!v.startsWith(`${ys}=`));l=g.length>0?`${m}?${g.join("&")}`:m}const f=l.includes("?")?"&":"?";return`${l}${f}${ys}=${encodeURIComponent(n)}${o}`}async function Uj(s,n,i=!1,l){const o=jj();let h=o;i&&(h+="/recovery");const f=Nj();await Oj(s,n,f,h,l);const m=await Rj(o);return[m,o===m?"plain":"s256",f]}const Lj=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Mj(s){const n=s.headers.get(fd);if(!n||!n.match(Lj))return null;try{return new Date(`${n}T00:00:00.0Z`)}catch{return null}}
147function zj(s){if(!s)throw new Error("Missing exp claim");const n=Math.floor(Date.now()/1e3);if(s<=n)throw new Error("JWT has expired")}function Bj(s){switch(s){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 Hj=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function na(s){if(!Hj.test(s))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Cr(s){if(!s.recoveryCodes)throw new Error("@supabase/auth-js: the MFA recovery codes API is experimental and disabled by default. Enable it by passing `auth: { experimental: { recoveryCodes: true } }` to createClient (or to the GoTrueClient constructor).")}function Zh(){const s={};return new Proxy(s,{get:(n,i)=>{if(i==="__isUserNotAvailableProxy")return!0;if(typeof i=="symbol"){const l=i.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 "${i}" property of the session object is not supported. Please use getUser() instead.`)},set:(n,i)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${i}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(n,i)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${i}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function qj(s,n){return new Proxy(s,{get:(i,l,o)=>{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(i,l,o)}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(i,l,o)}})}function Qv(s){return JSON.parse(JSON.stringify(s))}const gs=s=>{if(typeof s=="object"&&s!==null){const n=s;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(s)},Xv=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function Zv(s){var n;if(!wj(s))throw new Bo(gs(s),0);let i;try{i=await s.json()}catch(h){throw Xv.includes(s.status)?new Bo(s.statusText||`HTTP ${s.status}`,s.status):new vn(gs(h),h)}if(Xv.includes(s.status))throw new Bo(gs(i),s.status);let l;const o=Mj(s);if(o&&o.getTime()>=a0["2024-01-01"].timestamp&&typeof i=="object"&&i&&typeof i.code=="string"?l=i.code:typeof i=="object"&&i&&typeof i.error_code=="string"&&(l=i.error_code),l){if(l==="weak_password")throw new Gv(gs(i),s.status,((n=i.weak_password)===null||n===void 0?void 0:n.reasons)||[]);if(l==="session_not_found")throw new ut}else if(typeof i=="object"&&i&&typeof i.weak_password=="object"&&i.weak_password&&Array.isArray(i.weak_password.reasons)&&i.weak_password.reasons.length&&i.weak_password.reasons.reduce((h,f)=>h&&typeof f=="string",!0))throw new Gv(gs(i),s.status,i.weak_password.reasons);throw new fj(gs(i),s.status||500,l)}const $j=(s,n,i,l)=>{const o={method:s,headers:(n==null?void 0:n.headers)||{}};return s==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},n==null?void 0:n.headers),o.body=JSON.stringify(l),Object.assign(Object.assign({},o),i))};async function X(s,n,i,l){var o;const h=Object.assign({},l==null?void 0:l.headers);h[fd]||(h[fd]=a0["2024-01-01"].name),l!=null&&l.jwt&&(h.Authorization=`Bearer ${l.jwt}`);const f=(o=l==null?void 0:l.query)!==null&&o!==void 0?o:{};l!=null&&l.redirectTo&&(f.redirect_to=l.redirectTo);const m=Object.keys(f).length?"?"+new URLSearchParams(f).toString():"",g=await Ij(s,n,i+m,{headers:h,noResolveJson:l==null?void 0:l.noResolveJson},{},l==null?void 0:l.body);return l!=null&&l.xform?l==null?void 0:l.xform(g):{data:Object.assign({},g),error:null}}async function Ij(s,n,i,l,o,h){const f=$j(n,l,o,h);let m;try{m=await s(i,Object.assign({},f))}catch(g){throw new Bo(gs(g),0)}if(m.ok||await Zv(m),l!=null&&l.noResolveJson)return m;try{return await m.json()}catch(g){await Zv(g)}
147}function rn(s){var n;let i=null;Vj(s)&&(i=Object.assign({},s),s.expires_at||(i.expires_at=i0(s.expires_in)));const l=(n=s.user)!==null&&n!==void 0?n:typeof(s==null?void 0:s.id)=="string"?s:null;return{data:{session:i,user:l},error:null}}function Fv(s){const n=rn(s);return!n.error&&s.weak_password&&typeof s.weak_password=="object"&&Array.isArray(s.weak_password.reasons)&&s.weak_password.reasons.length&&s.weak_password.message&&typeof s.weak_password.message=="string"&&s.weak_password.reasons.reduce((i,l)=>i&&typeof l=="string",!0)&&(n.data.weak_password=s.weak_password),n}function $a(s){var n;return{data:{user:(n=s.user)!==null&&n!==void 0?n:s},error:null}}function Pj(s){return{data:s,error:null}}function Gj(s){const{action_link:n,email_otp:i,hashed_token:l,redirect_to:o,verification_type:h}=s,f=eu(s,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),m={action_link:n,email_otp:i,hashed_token:l,redirect_to:o,verification_type:h},g=Object.assign({},f);return{data:{properties:m,user:g},error:null}}function Wv(s){return s}function Vj(s){return!!s.access_token&&!!s.refresh_token&&!!s.expires_in}const Fh=["global","local","others"];class Kj{constructor({url:n="",headers:i={},fetch:l,experimental:o}){this.url=n,this.headers=i,this.fetch=l0(l),this.experimental=o??{},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,i=Fh[0]){if(Fh.indexOf(i)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Fh.join(", ")}`);try{return await X(this.fetch,"POST",`${this.url}/logout?scope=${i}`,{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,i={}){try{return await X(this.fetch,"POST",`${this.url}/invite`,{body:{email:n,data:i.data},headers:this.headers,redirectTo:i.redirectTo,xform:$a})}catch(l){if(Y(l))return{data:{user:null},error:l};throw l}}async generateLink(n){try{const{options:i}=n,l=eu(n,["options"]),o=Object.assign(Object.assign({},l),i);return"newEmail"in l&&(o.new_email=l==null?void 0:l.newEmail,delete o.newEmail),await X(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:Gj,redirectTo:i==null?void 0:i.redirectTo})}catch(i){if(Y(i))return{data:{properties:null,user:null},error:i};throw i}}async createUser(n){try{return await X(this.fetch,"POST",`${this.url}/admin/users`,{body:n,headers:this.headers,xform:$a})}catch(i){if(Y(i))return{data:{user:null},error:i};throw i}}async listUsers(n){var i,l,o,h,f,m,g;try{const v={nextPage:null,lastPage:0,total:0},b=await X(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(l=(i=n==null?void 0:n.page)===null||i===void 0?void 0:i.toString())!==null&&l!==void 0?l:"",per_page:(h=(o=n==null?void 0:n.perPage)===null||o===void 0?void 0:o.toString())!==null&&h!==void 0?h:""},xform:Wv});if(b.error)throw b.error;const y=await b.json(),w=(f=b.headers.get("x-total-count"))!==null&&f!==void 0?f:0,x=(g=(m=b.headers.get("link"))===null||m===void 0?void 0:m.split(","))!==null&&g!==void 0?g:[];return x.length>0&&(x.forEach(R=>{const j=parseInt(R.split(";")[0].split("=")[1].substring(0,1)),N=JSON.parse(R.split(";")[1].split("=")[1]);v[`${N}Page`]=j}),v.total=parseInt(w)),{data:Object.assign(Object.assign({},y),v),error:null}}catch(v){if(Y(v))return{data:{users:[]},error:v};throw v}}async getUserById(n){na(n);try{return await X(this.fetch,"GET",`${this.url}/admin/users/${n}`,{headers:this.headers,xform:$a})}catch(i){if(Y(i))return{data:{user:null},error:i};throw i}}async updateUserById(n,i){na(n);try{return await X(this.fetch,"PUT",`${this.url}/admin/users/${n}`,{body:i,headers:this.headers,xform:$a})}catch(l){if(Y(l))return{data:{user:null},error:l};throw l}}async deleteUser(n,i=!1){na(n);
147try{return await X(this.fetch,"DELETE",`${this.url}/admin/users/${n}`,{headers:this.headers,body:{should_soft_delete:i},xform:$a})}catch(l){if(Y(l))return{data:{user:null},error:l};throw l}}async _listFactors(n){na(n.userId);try{const{data:i,error:l}=await X(this.fetch,"GET",`${this.url}/admin/users/${n.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:i,error:l}}catch(i){if(Y(i))return{data:null,error:i};throw i}}async _deleteFactor(n){na(n.userId),na(n.id);try{return{data:await X(this.fetch,"DELETE",`${this.url}/admin/users/${n.userId}/factors/${n.id}`,{headers:this.headers}),error:null}}catch(i){if(Y(i))return{data:null,error:i};throw i}}async _listOAuthClients(n){var i,l,o,h,f,m,g;try{const v={nextPage:null,lastPage:0,total:0},b=await X(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(l=(i=n==null?void 0:n.page)===null||i===void 0?void 0:i.toString())!==null&&l!==void 0?l:"",per_page:(h=(o=n==null?void 0:n.perPage)===null||o===void 0?void 0:o.toString())!==null&&h!==void 0?h:""},xform:Wv});if(b.error)throw b.error;const y=await b.json(),w=(f=b.headers.get("x-total-count"))!==null&&f!==void 0?f:0,x=(g=(m=b.headers.get("link"))===null||m===void 0?void 0:m.split(","))!==null&&g!==void 0?g:[];return x.length>0&&(x.forEach(R=>{const j=parseInt(R.split(";")[0].split("=")[1].substring(0,1)),N=JSON.parse(R.split(";")[1].split("=")[1]);v[`${N}Page`]=j}),v.total=parseInt(w)),{data:Object.assign(Object.assign({},y),v),error:null}}catch(v){if(Y(v))return{data:{clients:[]},error:v};throw v}}async _createOAuthClient(n){try{return await X(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:n,headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if(Y(i))return{data:null,error:i};throw i}}async _getOAuthClient(n){try{return await X(this.fetch,"GET",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if(Y(i))return{data:null,error:i};throw i}}async _updateOAuthClient(n,i){try{return await X(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${n}`,{body:i,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 X(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(i){if(Y(i))return{data:null,error:i};throw i}}async _regenerateOAuthClientSecret(n){try{return await X(this.fetch,"POST",`${this.url}/admin/oauth/clients/${n}/regenerate_secret`,{headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if(Y(i))return{data:null,error:i};throw i}}async _listCustomProviders(n){try{const i={};return n!=null&&n.type&&(i.type=n.type),await X(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:i,xform:l=>{var o;return{data:{providers:(o=l==null?void 0:l.providers)!==null&&o!==void 0?o:[]},error:null}}})}catch(i){if(Y(i))return{data:{providers:[]},error:i};throw i}}async _createCustomProvider(n){try{return await X(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:n,headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if(Y(i))return{data:null,error:i};throw i}}async _getCustomProvider(n){try{return await X(this.fetch,"GET",`${this.url}/admin/custom-providers/${n}`,{headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if(Y(i))return{data:null,error:i};throw i}}async _updateCustomProvider(n,i){try{return await X(this.fetch,"PUT",`${this.url}/admin/custom-providers/${n}`,{body:i,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 X(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${n}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(i){if(Y(i))return{data:null,error:i};throw i}}async _adminListPasskeys(n){na(n.userId);try{return await X(this.fetch,"GET",`${this.url}/admin/users/${n.userId}/passkeys`,{headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if(Y(i))return{data:null,error:i};throw i}}async _adminDeletePasskey(n){na(n.userId),na(n.passkeyId);
147try{return await X(this.fetch,"DELETE",`${this.url}/admin/users/${n.userId}/passkeys/${n.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(i){if(Y(i))return{data:null,error:i};throw i}}}function ey(s={}){return{getItem:n=>s[n]||null,setItem:(n,i)=>{s[n]=i},removeItem:n=>{delete s[n]}}}globalThis&&r0()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class Yj extends Error{constructor(n){super(n),this.isAcquireTimeout=!0}}function Jj(){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 u0(s){if(!/^0x[a-fA-F0-9]{40}$/.test(s))throw new Error(`@supabase/auth-js: Address "${s}" is invalid.`);return s.toLowerCase()}function Qj(s){return parseInt(s,16)}function Xj(s){const n=new TextEncoder().encode(s);return"0x"+Array.from(n,l=>l.toString(16).padStart(2,"0")).join("")}function Zj(s){var n;const{chainId:i,domain:l,expirationTime:o,issuedAt:h=new Date,nonce:f,notBefore:m,requestId:g,resources:v,scheme:b,uri:y,version:w}=s;{if(!Number.isInteger(i))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${i}`);if(!l)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(f&&f.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${f}`);if(!y)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(w!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${w}`);if(!((n=s.statement)===null||n===void 0)&&n.includes(` 148`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${s.statement}`)}const x=u0(s.address),R=b?`${b}://${l}`:l,j=s.statement?`${s.statement} 149`:"",N=`${R} wants you to sign in with your Ethereum account: 150${x} 151 152${j}`;let T=`URI: ${y} 153Version: ${w} 154Chain ID: ${i}${f?` 155Nonce: ${f}`:""} 156Issued At: ${h.toISOString()}`;if(o&&(T+=` 157Expiration Time: ${o.toISOString()}`),m&&(T+=` 158Not Before: ${m.toISOString()}`),g&&(T+=` 159Request ID: ${g}`),v){let C=` 160Resources:`;for(const B of v){if(!B||typeof B!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${B}`);C+=` 161- ${B}`}T+=C}return`${N} 162${T}`}class nt extends Error{constructor({message:n,code:i,cause:l,name:o}){var h;super(n,{cause:l}),this.__isWebAuthnError=!0,this.name=(h=o??(l instanceof Error?l.name:void 0))!==null&&h!==void 0?h:"Unknown Error",this.code=i}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class Ko extends nt{constructor(n,i){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:i,message:n}),this.name="WebAuthnUnknownError",this.originalError=i}}function Fj({error:s,options:n}){var i,l,o;const{publicKey:h}=n;if(!h)throw Error("options was missing required publicKey property");if(s.name==="AbortError"){if(n.signal instanceof AbortSignal)return new nt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:s})}else if(s.name==="ConstraintError"){if(((i=h.authenticatorSelection)===null||i===void 0?void 0:i.requireResidentKey)===!0)return new nt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:s});if(n.mediation==="conditional"&&((l=h.authenticatorSelection)===null||l===void 0?void 0:l.userVerification)==="required")return new nt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:s});if(((o=h.authenticatorSelection)===null||o===void 0?void 0:o.userVerification)==="required")return new nt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:s})}else{if(s.name==="InvalidStateError")return new nt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:s});if(s.name==="NotAllowedError")return new nt({message:s.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:s});if(s.name==="NotSupportedError")return h.pubKeyCredParams.filter(m=>m.type==="public-key").length===0?new nt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:s}):new nt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:s});if(s.name==="SecurityError"){const f=window.location.hostname;if(c0(f)){if(h.rp.id!==f)return new nt({message:`The RP ID "${h.rp.id}
162" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:s})}else return new nt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:s})}else if(s.name==="TypeError"){if(h.user.id.byteLength<1||h.user.id.byteLength>64)return new nt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:s})}else if(s.name==="UnknownError")return new nt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:s})}return new nt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:s})}function Wj({error:s,options:n}){const{publicKey:i}=n;if(!i)throw Error("options was missing required publicKey property");if(s.name==="AbortError"){if(n.signal instanceof AbortSignal)return new nt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:s})}else{if(s.name==="NotAllowedError")return new nt({message:s.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:s});if(s.name==="SecurityError"){const l=window.location.hostname;if(c0(l)){if(i.rpId!==l)return new nt({message:`The RP ID "${i.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:s})}else return new nt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:s})}else if(s.name==="UnknownError")return new nt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:s})}return new nt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:s})}class eT{createNewAbortSignal(){if(this.controller){const i=new Error("Cancelling existing WebAuthn API call for new one");i.name="AbortError",this.controller.abort(i)}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 md=new eT;function ty(s){if(!s)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(s);const{challenge:n,user:i,excludeCredentials:l}=s,o=eu(s,["challenge","user","excludeCredentials"]),h=Ei(n).buffer,f=Object.assign(Object.assign({},i),{id:Ei(i.id).buffer}),m=Object.assign(Object.assign({},o),{challenge:h,user:f});if(l&&l.length>0){m.excludeCredentials=new Array(l.length);for(let g=0;g<l.length;g++){const v=l[g];m.excludeCredentials[g]=Object.assign(Object.assign({},v),{id:Ei(v.id).buffer,type:v.type||"public-key",transports:v.transports})}}return m}function ny(s){if(!s)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(s);const{challenge:n,allowCredentials:i}=s,l=eu(s,["challenge","allowCredentials"]),o=Ei(n).buffer,h=Object.assign(Object.assign({},l),{challenge:o});if(i&&i.length>0){h.allowCredentials=new Array(i.length);for(let f=0;f<i.length;f++){const m=i[f];h.allowCredentials[f]=Object.assign(Object.assign({},m),{id:Ei(m.id).buffer,type:m.type||"public-key",transports:m.transports})}}return h}function ay(s){var n;if("toJSON"in s&&typeof s.toJSON=="function")return s.toJSON();const i=s;return{id:s.id,rawId:s.id,response:{attestationObject:bs(new Uint8Array(s.response.attestationObject)),clientDataJSON:bs(new Uint8Array(s.response.clientDataJSON))},type:"public-key",clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:(n=i.authenticatorAttachment)!==null&&n!==void 0?n:void 0}}function sy(s){var n;if("toJSON"in s&&typeof s.toJSON=="function")return s.toJSON();const i=s,l=s.getClientExtensionResults(),o=s.response;return{id:s.id,rawId:s.id,response:{authenticatorData:bs(new Uint8Array(o.authenticatorData)),clientDataJSON:bs(new Uint8Array(o.clientDataJSON)),signature:bs(new Uint8Array(o.signature)),userHandle:o.userHandle?bs(new Uint8Array(o.userHandle)):void 0},type:"public-key",clientExtensionResults:l,authenticatorAttachment:(n=i.authenticatorAttachment)!==null&&n!==void 0?n:void 0}}function c0(s){return s==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(s)}function Yo(){var s,n;return!!(_t()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((s=navigator==null?void 0:navigator.credentials)===null||s===void 0?void 0:s.create)=="function"&&typeof((n=navigator==null?void 0:navigator.credentials)===null||n===void 0?void 0:n.get)=="function")}async function h0(s){try{const n=await navigator.credentials.create(s);return n?n instanceof PublicKeyCredential?{data:n,error:null}:{data:null,error:new Ko("Browser returned unexpected credential type",n)}:{data:null,error:new Ko("Empty credential response",n)}}catch(n){return{data:null,error:Fj({error:n,options:s})}}}async function d0(s){try{const n=await navigator.credentials.get(s);return n?n instanceof PublicKeyCredential?{data:n,error:null}:{data:null,error:new Ko("Browser returned unexpected credential type",n)}:{data:null,error:new Ko("Empty credential response",n)}}catch(n){return{data:null,error:Wj({error:n,options:s})}}}const tT={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},nT={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Jo(...s){const n=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),i=o=>o instanceof ArrayBuffer||ArrayBuffer.isView(o),l={};
162for(const o of s)if(o)for(const h in o){const f=o[h];if(f!==void 0)if(Array.isArray(f))l[h]=f;else if(i(f))l[h]=f;else if(n(f)){const m=l[h];n(m)?l[h]=Jo(m,f):l[h]=Jo(f)}else l[h]=f}return l}function aT(s,n){return Jo(tT,s,n||{})}function sT(s,n){return Jo(nT,s,n||{})}class iT{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:i,friendlyName:l,signal:o},h){var f;try{const{data:m,error:g}=await this.client.mfa.challenge({factorId:n,webauthn:i});if(!m)return{data:null,error:g};const v=o??md.createNewAbortSignal();if(m.webauthn.type==="create"){const{user:b}=m.webauthn.credential_options.publicKey;if(!b.name){const y=l;if(y)b.name=`${b.id}:${y}`;else{const x=(await this.client.getUser()).data.user,R=((f=x==null?void 0:x.user_metadata)===null||f===void 0?void 0:f.name)||(x==null?void 0:x.email)||(x==null?void 0:x.id)||"User";b.name=`${b.id}:${R}`}}b.displayName||(b.displayName=b.name)}switch(m.webauthn.type){case"create":{const b=aT(m.webauthn.credential_options.publicKey,h==null?void 0:h.create),{data:y,error:w}=await h0({publicKey:b,signal:v});return y?{data:{factorId:n,challengeId:m.id,webauthn:{type:m.webauthn.type,credential_response:y}},error:null}:{data:null,error:w}}case"request":{const b=sT(m.webauthn.credential_options.publicKey,h==null?void 0:h.request),{data:y,error:w}=await d0(Object.assign(Object.assign({},m.webauthn.credential_options),{publicKey:b,signal:v}));return y?{data:{factorId:n,challengeId:m.id,webauthn:{type:m.webauthn.type,credential_response:y}},error:null}:{data:null,error:w}}}}catch(m){return Y(m)?{data:null,error:m}:{data:null,error:new vn("Unexpected error in challenge",m)}}}async _verify({challengeId:n,factorId:i,webauthn:l}){return this.client.mfa.verify({factorId:i,challengeId:n,webauthn:l})}async _authenticate({factorId:n,webauthn:{rpId:i=typeof window<"u"?window.location.hostname:void 0,rpOrigins:l=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},h){if(!i)return{data:null,error:new qr("rpId is required for WebAuthn authentication")};try{if(!Yo())return{data:null,error:new vn("Browser does not support WebAuthn",null)};const{data:f,error:m}=await this.challenge({factorId:n,webauthn:{rpId:i,rpOrigins:l},signal:o},{request:h});if(!f)return{data:null,error:m};const{webauthn:g}=f;return this._verify({factorId:n,challengeId:f.challengeId,webauthn:{type:g.type,rpId:i,rpOrigins:l,credential_response:g.credential_response}})}catch(f){return Y(f)?{data:null,error:f}:{data:null,error:new vn("Unexpected error in authenticate",f)}}}async _register({friendlyName:n,webauthn:{rpId:i=typeof window<"u"?window.location.hostname:void 0,rpOrigins:l=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},h){if(!i)return{data:null,error:new qr("rpId is required for WebAuthn registration")};try{if(!Yo())return{data:null,error:new vn("Browser does not support WebAuthn",null)};const{data:f,error:m}=await this._enroll({friendlyName:n});if(!f)return await this.client.mfa.listFactors().then(b=>{var y;return(y=b.data)===null||y===void 0?void 0:y.all.find(w=>w.factor_type==="webauthn"&&w.friendly_name===n&&w.status==="unverified")}).then(b=>b?this.client.mfa.unenroll({factorId:b==null?void 0:b.id}):void 0),{data:null,error:m};const{data:g,error:v}=await this._challenge({factorId:f.id,friendlyName:f.friendly_name,webauthn:{rpId:i,rpOrigins:l},signal:o},{create:h});return g?this._verify({factorId:f.id,challengeId:g.challengeId,webauthn:{rpId:i,rpOrigins:l,type:g.webauthn.type,credential_response:g.webauthn.credential_response}}):{data:null,error:v}}catch(f){return Y(f)?{data:null,error:f}:{data:null,error:new vn("Unexpected error in register",f)}}}}Jj();const rT={url:lj,storageKey:oj,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:uj,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},pi={};let iy=!1;class Ir{get jwks(){var n,i;return(i=(n=pi[this.storageKey])===null||n===void 0?void 0:n.jwks)!==null&&i!==void 0?i:{keys:[]}}set jwks(n){pi[this.storageKey]=Object.assign(Object.assign({},pi[this.storageKey]),{jwks:n})}get jwks_cached_at(){var n,i;return(i=(n=pi[this.storageKey])===null||n===void 0?void 0:n.cachedAt)!==null&&i!==void 0?i:Number.MIN_SAFE_INTEGER}set jwks_cached_at(n){pi[this.storageKey]=Object.assign(Object.assign({},pi[this.storageKey]),{cachedAt:n})}constructor(n){var i,l,o;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._pendingInitNotifications=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({},rT),n);if(this.storageKey=h.storageKey,this.instanceID=(i=Ir.nextInstanceID[this.storageKey])!==null&&i!==void 0?i:0,Ir.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!h.debug,typeof h.debug=="function"&&(this.logger=h.debug),this.instanceID>0&&_t()){const f=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(f),this.logDebugMessages&&console.trace(f)}if(this.persistSession=h.persistSession,this.autoRefreshToken=h.autoRefreshToken,this.experimental=(l=h.experimental)!==null&&l!==void 0?l:{},this.admin=new Kj({url:h.url,headers:h.headers,fetch:h.fetch,experimental:this.experimental}),this.url=h.url,this.headers=h.headers,this.fetch=l0(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,iy||(iy=!0,console.warn(`${this._logPrefix()} The "lock" option is deprecated and will be removed in v3. The client now coordinates session refreshes without a lock, so most apps can drop the option. See https://github.com/supabase/supabase-js/blob/master/packages/core/auth-js/migrations/lockless-coordination.md`))),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 iT(this),recoveryCodes:{getStatus:this._getRecoveryCodesStatus.bind(this),generate:this._generateRecoveryCodes.bind(this),verify:this._verifyRecoveryCode.bind(this),regenerate:this._regenerateRecoveryCodes.bind(this),unenroll:this._unenrollRecoveryCodes.bind(this)}}
162,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:r0()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=ey(this.memoryStorage)),h.userStorage&&(this.userStorage=h.userStorage)):(this.memoryStorage={},this.storage=ey(this.memoryStorage)),_t()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(f){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",f)}(o=this.broadcastChannel)===null||o===void 0||o.addEventListener("message",async f=>{this._debug("received broadcast notification from other tab or client",f),(f.data.event==="TOKEN_REFRESHED"||f.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(f.data.event,f.data.session,!1)}catch(m){this._debug("#broadcastChannel","error",m)}})}h.skipAutoInitialize||this.initialize().catch(f=>{this._debug("#initialize()","error",f)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(n){if(this.throwOnError&&n&&n.error)throw n.error;return n}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${n0}) ${new Date().toISOString()}`}_debug(...n){return this.logDebugMessages&&this.logger(this._logPrefix(),...n),this}async initialize(){var n;if(this.initializePromise)return await this.initializePromise;this._pendingInitNotifications=[],this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())();const i=await this.initializePromise,l=(n=this._pendingInitNotifications)!==null&&n!==void 0?n:[];this._pendingInitNotifications=null;for(const o of l)await this._notifyAllSubscribers(o.event,o.session,o.broadcast);return i}async _initialize(){var n;try{let i={},l="none";if(_t()&&(i=Jv(window.location.href),this._isImplicitGrantCallback(i)?l="implicit":await this._isPKCECallback(i)&&(l="pkce")),_t()&&this.detectSessionInUrl&&l!=="none"){const{data:o,error:h}=await this._getSessionFromURL(i,l);if(h){if(this._debug("#_initialize()","error detecting session from URL",h),mj(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:f,redirectType:m}=o;return this._debug("#_initialize()","detected session in URL",f,"redirect type",m),await this._saveSession(f),setTimeout(async()=>{m==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",f):await this._notifyAllSubscribers("SIGNED_IN",f)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(i){return Y(i)?this._returnResult({error:i}):this._returnResult({error:new vn("Unexpected error during initialization",i)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(n){var i,l,o;try{const h=await X(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(l=(i=n==null?void 0:n.options)===null||i===void 0?void 0:i.data)!==null&&l!==void 0?l:{},gotrue_meta_security:{captcha_token:(o=n==null?void 0:n.options)===null||o===void 0?void 0:o.captchaToken}},xform:rn}),{data:f,error:m}=h;if(m||!f)return this._returnResult({data:{user:null,session:null},error:m});const g=f.session,v=f.user;return f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("SIGNED_IN",g)),this._returnResult({data:{user:v,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 i,l,o;let h=null;try{let f;if("email"in n){const{email:y,password:w,options:x}=n;let R=null,j=null;this.flowType==="pkce"&&([R,j,h]=await this._getCodeChallengeAndMethod()),f=await X(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(x==null?void 0:x.emailRedirectTo,h),body:{email:y,password:w,data:(i=x==null?void 0:x.data)!==null&&i!==void 0?i:{},gotrue_meta_security:{captcha_token:x==null?void 0:x.captchaToken},code_challenge:R,code_challenge_method:j},xform:rn})}else if("phone"in n){const{phone:y,password:w,options:x}=n;f=await X(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:y,password:w,data:(l=x==null?void 0:x.data)!==null&&l!==void 0?l:{},channel:(o=x==null?void 0:x.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:x==null?void 0:x.captchaToken}},xform:rn})}else throw new Co("You must provide either an email or phone number and a password");const{data:m,error:g}=f;if(g||!m)return await gn(this.storage,this.storageKey,h),this._returnResult({data:{user:null,session:null},error:g});const v=m.session,b=m.user;return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",v)),this._returnResult({data:{user:b,session:v},error:null})}catch(f){if(await gn(this.storage,this.storageKey,h),Y(f))return this._returnResult({data:{user:null,session:null},error:f});throw f}}async signInWithPassword(n){try{let i;if("email"in n){const{email:h,password:f,options:m}=n;i=await X(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:h,password:f,gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken}},xform:Fv})}else if("phone"in n){const{phone:h,password:f,options:m}=n;i=await X(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:h,password:f,gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken}},xform:Fv})}else throw new Co("You must provide either an email or phone number and a password");const{data:l,error:o}=i;if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!l||!l.session||!l.user){const h=new gi;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:o})}catch(i){if(Y(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithOAuth(n){var i,l,o,h;return await this._handleProviderSignIn(n.provider,{redirectTo:(i=n.options)===null||i===void 0?void 0:i.redirectTo,scopes:(l=n.options)===null||l===void 0?void 0:l.scopes,queryParams:(o=n.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(h=n.options)===null||h===void 0?void 0:h.skipBrowserRedirect})}async exchangeCodeForSession(n,i){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(n,i)):this._exchangeCodeForSession(n,i)}async signInWithWeb3(n){const{chain:i}=n;switch(i){case"ethereum":return await this.signInWithEthereum(n);case"solana":return await this.signInWithSolana(n);default:throw new Error(`@supabase/auth-js: Unsupported chain "${i}"`)}}async signInWithEthereum(n){var i,l,o,h,f,m,g,v,b,y,w;let x,R;if("message"in n)x=n.message,R=n.signature;else{const{chain:j,wallet:N,statement:T,options:C}=n;let B;if(_t())if(typeof N=="object")B=N;else{const ae=window;if("ethereum"in ae&&typeof ae.ethereum=="object"&&"request"in ae.ethereum&&typeof ae.ethereum.request=="function")B=ae.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 N!="object"||!(C!=null&&C.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");B=N}const Q=new URL((i=C==null?void 0:C.url)!==null&&i!==void 0?i:window.location.href),ee=await B.request({method:"eth_requestAccounts"}).then(ae=>ae).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!ee||ee.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const $=u0(ee[0]);let G=(l=C==null?void 0:C.signInWithEthereum)===null||l===void 0?void 0:l.chainId;if(!G){const ae=await B.request({method:"eth_chainId"});G=Qj(ae)}const H={domain:Q.host,address:$,statement:T,uri:Q.href,version:"1",chainId:G,nonce:(o=C==null?void 0:C.signInWithEthereum)===null||o===void 0?void 0:o.nonce,issuedAt:(f=(h=C==null?void 0:C.signInWithEthereum)===null||h===void 0?void 0:h.issuedAt)!==null&&f!==void 0?f:new Date,expirationTime:(m=C==null?void 0:C.signInWithEthereum)===null||m===void 0?void 0:m.expirationTime,notBefore:(g=C==null?void 0:C.signInWithEthereum)===null||g===void 0?void 0:g.notBefore,requestId:(v=C==null?void 0:C.signInWithEthereum)===null||v===void 0?void 0:v.requestId,resources:(b=C==null?void 0:C.signInWithEthereum)===null||b===void 0?void 0:b.resources};x=Zj(H),R=await B.request({method:"personal_sign",params:[Xj(x),$]})}try{const{data:j,error:N}=await X(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:x,signature:R},!((y=n.options)===null||y===void 0)&&y.captchaToken?{gotrue_meta_security:{captcha_token:(w=n.options)===null||w===void 0?void 0:w.captchaToken}}:null),xform:rn});if(N)throw N;if(!j||!j.session||!j.user){const T=new gi;return this._returnResult({data:{user:null,session:null},error:T})}return j.session&&(await this._saveSession(j.session),await this._notifyAllSubscribers("SIGNED_IN",j.session)),this._returnResult({data:Object.assign({},j),error:N})}catch(j){if(Y(j))return this._returnResult({data:{user:null,session:null},error:j});throw j}}async signInWithSolana(n){var i,l,o,h,f,m,g,v,b,y,w,x;let R,j;if("message"in n)R=n.message,j=n.signature;else{const{chain:N,wallet:T,statement:C,options:B}=n;let Q;if(_t())if(typeof T=="object")Q=T;else{const $=window;if("solana"in $&&typeof $.solana=="object"&&("signIn"in $.solana&&typeof $.solana.signIn=="function"||"signMessage"in $.solana&&typeof $.solana.signMessage=="function"))Q=$.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 T!="object"||!(B!=null&&B.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");Q=T}const ee=new URL((i=B==null?void 0:B.url)!==null&&i!==void 0?i:window.location.href);if("signIn"in Q&&Q.signIn){const $=await Q.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},B==null?void 0:B.signInWithSolana),{version:"1",domain:ee.host,uri:ee.href}),C?{statement:C}:null));let G;if(Array.isArray($)&&$[0]&&typeof $[0]=="object")G=$[0];else if($&&typeof $=="object"&&"signedMessage"in $&&"signature"in $)G=$;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in G&&"signature"in G&&(typeof G.signedMessage=="string"||G.signedMessage instanceof Uint8Array)&&G.signature instanceof Uint8Array)R=typeof G.signedMessage=="string"?G.signedMessage:new TextDecoder().decode(G.signedMessage),j=G.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in Q)||typeof Q.signMessage!="function"||!("publicKey"in Q)||typeof Q!="object"||!Q.publicKey||!("toBase58"in Q.publicKey)||typeof Q.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");R=[`${ee.host} wants you to sign in with your Solana account:`,Q.publicKey.toBase58(),...C?["",C,""]:[""],"Version: 1",`URI: ${ee.href}`,`Issued At: ${(o=(l=B==null?void 0:B.signInWithSolana)===null||l===void 0?void 0:l.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((h=B==null?void 0:B.signInWithSolana)===null||h===void 0)&&h.notBefore?[`Not Before: ${B.signInWithSolana.notBefore}`]:[],...!((f=B==null?void 0:B.signInWithSolana)===null||f===void 0)&&f.expirationTime?[`Expiration Time: ${B.signInWithSolana.expirationTime}`]:[],...!((m=B==null?void 0:B.signInWithSolana)===null||m===void 0)&&m.chainId?[`Chain ID: ${B.signInWithSolana.chainId}`]:[],...!((g=B==null?void 0:B.signInWithSolana)===null||g===void 0)&&g.nonce?[`Nonce: ${B.signInWithSolana.nonce}`]:[],...!((v=B==null?void 0:B.signInWithSolana)===null||v===void 0)&&v.requestId?[`Request ID: ${B.signInWithSolana.requestId}`]:[],...!((y=(b=B==null?void 0:B.signInWithSolana)===null||b===void 0?void 0:b.resources)===null||y===void 0)&&y.length?["Resources",...B.signInWithSolana.resources.map(G=>`- ${G}`)]:[]].join(` 163`);const $=await Q.signMessage(new TextEncoder().encode(R),"utf8");if(!$||!($ instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");j=$}}try{const{data:N,error:T}=await X(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:R,signature:bs(j)},!((w=n.options)===null||w===void 0)&&w.captchaToken?{gotrue_meta_security:{captcha_token:(x=n.options)===null||x===void 0?void 0:x.captchaToken}}:null),xform:rn});if(T)throw T;if(!N||!N.session||!N.user){const C=new gi;return this._returnResult({data:{user:null,session:null},error:C})}return N.session&&(await this._saveSession(N.session),await this._notifyAllSubscribers("SIGNED_IN",N.session)),this._returnResult({data:Object.assign({},N),error:T})}catch(N){if(Y(N))return this._returnResult({data:{user:null,session:null},error:N});throw N}}async _exchangeCodeForSession(n,i){const l=(i==null?void 0:i.flowId)!=null,o=l?Ho(i==null?void 0:i.flowId):_t()?Ho(Jv(window.location.href)[ys]):null;l&&!o&&this._debug("#_exchangeCodeForSession()","provided flowId is not a valid flow id",i==null?void 0:i.flowId);const{verifier:h,flowId:f}=l&&!o?{verifier:null,flowId:null}:await Cj(this.storage,this.storageKey,o),[m,g]=(h??"").split("/");try{if(!m&&this.flowType==="pkce")throw new gj;const{data:v,error:b}=await X(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:n,code_verifier:m},xform:rn});if(await gn(this.storage,this.storageKey,f),b)throw b;if(!v||!v.session||!v.user){const y=new gi;return this._returnResult({data:{user:null,session:null,redirectType:null},error:y})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers(g==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",v.session)),this._returnResult({data:Object.assign(Object.assign({},v),{redirectType:g??null}),error:b})}catch(v){if(await gn(this.storage,this.storageKey,f),Y(v))return this._returnResult({data:{user:null,session:null,redirectType:null},error:v});throw v}}async signInWithIdToken(n){try{const{options:i,provider:l,token:o,access_token:h,nonce:f}=n,m=await X(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:l,id_token:o,access_token:h,nonce:f,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},xform:rn}),{data:g,error:v}=m;if(v)return this._returnResult({data:{user:null,session:null},error:v});if(!g||!g.session||!g.user){const b=new gi;return this._returnResult({data:{user:null,session:null},error:b})}return g.session&&(await this._saveSession(g.session),await this._noti
163fyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:g,error:v})}catch(i){if(Y(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithOtp(n){var i,l,o,h,f;let m=null;try{if("email"in n){const{email:g,options:v}=n;let b=null,y=null;this.flowType==="pkce"&&([b,y,m]=await this._getCodeChallengeAndMethod());const{error:w}=await X(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:g,data:(i=v==null?void 0:v.data)!==null&&i!==void 0?i:{},create_user:(l=v==null?void 0:v.shouldCreateUser)!==null&&l!==void 0?l:!0,gotrue_meta_security:{captcha_token:v==null?void 0:v.captchaToken},code_challenge:b,code_challenge_method:y},redirectTo:this._maybeAppendFlowIdToRedirect(v==null?void 0:v.emailRedirectTo,m)});return this._returnResult({data:{user:null,session:null},error:w})}if("phone"in n){const{phone:g,options:v}=n,{data:b,error:y}=await X(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:g,data:(o=v==null?void 0:v.data)!==null&&o!==void 0?o:{},create_user:(h=v==null?void 0:v.shouldCreateUser)!==null&&h!==void 0?h:!0,gotrue_meta_security:{captcha_token:v==null?void 0:v.captchaToken},channel:(f=v==null?void 0:v.channel)!==null&&f!==void 0?f:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:b==null?void 0:b.message_id},error:y})}throw new Co("You must provide either an email or phone number.")}catch(g){if(await gn(this.storage,this.storageKey,m),Y(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async verifyOtp(n){var i,l;try{let o,h;"options"in n&&(o=(i=n.options)===null||i===void 0?void 0:i.redirectTo,h=(l=n.options)===null||l===void 0?void 0:l.captchaToken);const{data:f,error:m}=await X(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},n),{gotrue_meta_security:{captcha_token:h}}),redirectTo:o,xform:rn});if(m)throw m;if(!f)throw new Error("An error occurred on token verification.");const g=f.session,v=f.user;return g!=null&&g.access_token&&(await this._saveSession(g),await this._notifyAllSubscribers(n.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",g)),this._returnResult({data:{user:v,session:g},error:null})}catch(o){if(Y(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithSSO(n){var i,l,o,h;let f=null;try{let m=null,g=null;this.flowType==="pkce"&&([m,g,f]=await this._getCodeChallengeAndMethod());const v=await X(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:this._maybeAppendFlowIdToRedirect((i=n.options)===null||i===void 0?void 0:i.redirectTo,f)}),!((l=n==null?void 0:n.options)===null||l===void 0)&&l.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:Pj});return!((o=v.data)===null||o===void 0)&&o.url&&_t()&&!(!((h=n.options)===null||h===void 0)&&h.skipBrowserRedirect)&&window.location.assign(v.data.url),this._returnResult(v)}catch(m){if(await gn(this.storage,this.storageKey,f),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:i},error:l}=n;if(l)throw l;if(!i)throw new ut;const{error:o}=await X(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:i.access_token});return this._returnResult({data:{user:null,session:null},error:o})})}catch(n){if(Y(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async resend(n){let i=null;try{const l=`${this.url}/resend`;if("email"in n){const{email:o,type:h,options:f}=n;let m=null,g=null;this.flowType==="pkce"&&([m,g,i]=await this._getCodeChallengeAndMethod());const{error:v}=await X(this.fetch,"POST",l,{headers:this.headers,body:{email:o,type:h,gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:m,code_challenge_method:g},redirectTo:this._maybeAppendFlowIdToRedirect(f==null?void 0:f.emailRedirectTo,i)});return v&&await gn(this.storage,this.storageKey,i),this._returnResult({data:{user:null,session:null},error:v})}else if("phone"in n){const{phone:o,type:h,options:f}=n,{data:m,error:g}=await X(this.fetch,"POST",l,{headers:this.headers,body:{phone:o,type:h,gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:m==null?void 0:m.message_id},error:g})}throw new Co("You must provide either an email or phone number and a type")}catch(l){if(await gn(this.storage,this.storageKey,i),Y(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}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,i){this._debug("#_acquireLock","begin",n);try{if(this.lockAcquired){const l=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await l,await i()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}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=i();for(this.pendingInLock.push((async()=>{try{await l}catch{}})()),await l;this.pendingInLock.length;){const o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.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 i=await this.__loadSession();return await n(i)}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 i=await St(this.storage,this.storageKey);
163if(this._debug("#getSession()","session from storage",i),i!==null&&(this._isValidSession(i)?n=i:(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()<Xh:!1;if(this._debug("#__loadSession()",`session has${l?"":" not"} expired`,"expires_at",n.expires_at),!l)return{data:{session:await this._hydrateSessionUser(n)},error:null};const{data:o,error:h}=await this._callRefreshToken(n.refresh_token);if(h){const f=await St(this.storage,this.storageKey);return f&&this._isValidSession(f)&&f.expires_at&&f.expires_at*1e3>Date.now()?this._returnResult({data:{session:await this._hydrateSessionUser(f)},error:null}):this._returnResult({data:{session:null},error:h})}return this._returnResult({data:{session:o},error:null})}finally{this._debug("#__loadSession()","end")}}async _hydrateSessionUser(n){if(this.userStorage){const i=await St(this.userStorage,this.storageKey+"-user");n.user=i!=null&&i.user?i.user:Zh()}if(this.storage.isServer&&n.user&&!n.user.__isUserNotAvailableProxy){const i={value:this.suppressGetSessionWarning};n.user=qj(n.user,i),i.value&&(this.suppressGetSessionWarning=!0)}return n}async getUser(n){if(n)return await this._getUser(n);await this.initializePromise;let i;return this.lock!=null?i=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):i=await this._getUser(),i.data.user&&(this.suppressGetSessionWarning=!0),i}async _getUser(n){try{return n?await X(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:n,xform:$a}):await this._useSession(async i=>{var l,o,h;const{data:f,error:m}=i;if(m)throw m;return!(!((l=f.session)===null||l===void 0)&&l.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new ut}:await X(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(h=(o=f.session)===null||o===void 0?void 0:o.access_token)!==null&&h!==void 0?h:void 0,xform:$a})})}catch(i){if(Y(i))return Oo(i)&&await this._removeSession(),this._returnResult({data:{user:null},error:i});throw i}}async updateUser(n,i={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(n,i)):await this._updateUser(n,i)}async _updateUser(n,i={}){let l=null;try{return await this._useSession(async o=>{const{data:h,error:f}=o;if(f)throw f;if(!h.session)throw new ut;const m=h.session;let g=null,v=null;this.flowType==="pkce"&&n.email!=null&&([g,v,l]=await this._getCodeChallengeAndMethod());const{data:b,error:y}=await X(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(i==null?void 0:i.emailRedirectTo,l),body:Object.assign(Object.assign({},n),{code_challenge:g,code_challenge_method:v}),jwt:m.access_token,xform:$a});if(y)throw y;return m.user=b.user,await this._saveSession(m),await this._notifyAllSubscribers("USER_UPDATED",m),this._returnResult({data:{user:m.user},error:null})})}catch(o){if(await gn(this.storage,this.storageKey,l),Y(o))return this._returnResult({data:{user:null},error:o});throw o}}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 ut;const i=Date.now()/1e3;let l=i,o=!0,h=null;const{payload:f}=Uo(n.access_token);if(f.exp&&(l=f.exp,o=l<=i),o){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-i,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(i){if(Y(i))return this._returnResult({data:{session:null,user:null},error:i});throw i}}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 i=>{var l;if(!n){const{data:f,error:m}=i;if(m)throw m;n=(l=f.session)!==null&&l!==void 0?l:void 0}if(!(n!=null&&n.refresh_token))throw new ut;const{data:o,error:h}=await this._callRefreshToken(n.refresh_token);return h?this._returnResult({data:{user:null,session:null},error:h}):o?this._returnResult({data:{user:o.user,session:o},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(i){if(Y(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async _getSessionFromURL(n,i){var l;try{if(!_t())throw new ko("No browser detected.");
163if(n.error||n.error_description||n.error_code)throw new ko(n.error_description||"Error in URL with unspecified error_description",{error:n.error||"unspecified_error",code:n.error_code||"unspecified_code"});switch(i){case"implicit":if(this.flowType==="pkce")throw new $v("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new ko("Not a valid implicit grant flow url.");break;default:}if(i==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!n.code)throw new $v("No code detected.");const{data:B,error:Q}=await this._exchangeCodeForSession(n.code,{flowId:n[ys]});if(Q)throw Q;const ee=new URL(window.location.href);return ee.searchParams.delete("code"),ee.searchParams.delete(ys),window.history.replaceState(window.history.state,"",ee.toString()),{data:{session:B.session,redirectType:(l=B.redirectType)!==null&&l!==void 0?l:null},error:null}}const{provider_token:o,provider_refresh_token:h,access_token:f,refresh_token:m,expires_in:g,expires_at:v,token_type:b}=n;if(!f||!g||!m||!b)throw new ko("No session defined in URL");const y=Math.round(Date.now()/1e3),w=parseInt(g);let x=y+w;v&&(x=parseInt(v));const R=x-y;R*1e3<=ra&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${R}s, should have been closer to ${w}s`);const j=x-w;y-j>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",j,x,y):y-j<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",j,x,y);const{data:N,error:T}=await this._getUser(f);if(T)throw T;const C={provider_token:o,provider_refresh_token:h,access_token:f,expires_in:w,expires_at:x,refresh_token:m,token_type:b,user:N.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:C,redirectType:n.type},error:null})}catch(o){if(Y(o))return this._returnResult({data:{session:null,redirectType:null},error:o});throw o}}_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){if(!n.code)return!1;const i=Ho(n[ys]);return i&&await St(this.storage,Ti(this.storageKey,i))?!0:!!await St(this.storage,`${this.storageKey}-code-verifier`)}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 i=>{var l;const o=async()=>{await this._removeSession()},{data:h,error:f}=i;if(f&&!Oo(f))return this._returnResult({error:f});const m=(l=h.session)===null||l===void 0?void 0:l.access_token;if(m){const{error:g}=await this.admin.signOut(m,n);if(g&&!(qv(g)&&(g.status===404||g.status===401||g.status===403)||Oo(g)))return n!=="others"&&await o(),this._returnResult({error:g})}return n!=="others"&&await o(),this._returnResult({error:null})})}onAuthStateChange(n){const i=xj(),l={id:i,callback:n,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",i),this.stateChangeEmitters.delete(i)}};return this._debug("#onAuthStateChange()","registered callback with id",i),this.stateChangeEmitters.set(i,l),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(i)}):await this._emitInitialSession(i)))(),{data:{subscription:l}}}async _emitInitialSession(n){return await this._useSession(async i=>{var l,o;try{const{data:{session:h},error:f}=i;if(f)throw f;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){if(await((o=this.stateChangeEmitters.get(n))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",n,"error",h),Pv(h))return;Oo(h)||Do(h)||qv(h)&&(h.code==="refresh_token_not_found"||h.code==="refresh_token_already_used"||h.co
163de==="session_expired")?console.warn(h):console.error(h)}})}async resetPasswordForEmail(n,i={}){let l=null,o=null,h=null;this.flowType==="pkce"&&([l,o,h]=await this._getCodeChallengeAndMethod(!0));try{return await X(this.fetch,"POST",`${this.url}/recover`,{body:{email:n,code_challenge:l,code_challenge_method:o,gotrue_meta_security:{captcha_token:i.captchaToken}},headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(i.redirectTo,h)})}catch(f){if(await gn(this.storage,this.storageKey,h),Y(f))return this._returnResult({data:null,error:f});throw f}}async getUserIdentities(){var n;try{const{data:i,error:l}=await this.getUser();if(l)throw l;return this._returnResult({data:{identities:(n=i.user.identities)!==null&&n!==void 0?n:[]},error:null})}catch(i){if(Y(i))return this._returnResult({data:null,error:i});throw i}}async linkIdentity(n){return"token"in n?this.linkIdentityIdToken(n):this.linkIdentityOAuth(n)}async linkIdentityOAuth(n){var i;let l=null;try{const{data:o,error:h}=await this._useSession(async f=>{var m,g,v,b,y;const{data:w,error:x}=f;if(x)throw x;const{url:R,flowId:j}=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,n.provider,{redirectTo:(m=n.options)===null||m===void 0?void 0:m.redirectTo,scopes:(g=n.options)===null||g===void 0?void 0:g.scopes,queryParams:(v=n.options)===null||v===void 0?void 0:v.queryParams,skipBrowserRedirect:!0});return l=j,await X(this.fetch,"GET",R,{headers:this.headers,jwt:(y=(b=w.session)===null||b===void 0?void 0:b.access_token)!==null&&y!==void 0?y:void 0})});if(h)throw h;return _t()&&!(!((i=n.options)===null||i===void 0)&&i.skipBrowserRedirect)&&window.location.assign(o==null?void 0:o.url),this._returnResult({data:{provider:n.provider,url:o==null?void 0:o.url,flowId:l},error:null})}catch(o){if(Y(o))return this._returnResult({data:{provider:n.provider,url:null,flowId:l},error:o});throw o}}async linkIdentityIdToken(n){return await this._useSession(async i=>{var l;try{const{error:o,data:{session:h}}=i;if(o)throw o;const{options:f,provider:m,token:g,access_token:v,nonce:b}=n,y=await X(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(l=h==null?void 0:h.access_token)!==null&&l!==void 0?l:void 0,body:{provider:m,id_token:g,access_token:v,nonce:b,link_identity:!0,gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:rn}),{data:w,error:x}=y;return x?this._returnResult({data:{user:null,session:null},error:x}):!w||!w.session||!w.user?this._returnResult({data:{user:null,session:null},error:new gi}):(w.session&&(await this._saveSession(w.session),await this._notifyAllSubscribers("USER_UPDATED",w.session)),this._returnResult({data:w,error:x}))}catch(o){if(await gn(this.storage,this.storageKey,null),Y(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}})}async unlinkIdentity(n){try{return await this._useSession(async i=>{var l,o;const{data:h,error:f}=i;if(f)throw f;return await X(this.fetch,"DELETE",`${this.url}/user/identities/${n.identity_id}`,{headers:this.headers,jwt:(o=(l=h.session)===null||l===void 0?void 0:l.access_token)!==null&&o!==void 0?o:void 0})})}catch(i){if(Y(i))return this._returnResult({data:null,error:i});throw i}}async _refreshAccessToken(n){const i="#_refreshAccessToken()";this._debug(i,"begin");try{const l=Date.now();return await Ej(async o=>(o>0&&await Sj(200*Math.pow(2,o-1)),this._debug(i,"refreshing attempt",o),await X(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:n},headers:this.headers,xform:rn})),(o,h)=>{const f=200*Math.pow(2,o);return h&&Do(h)&&Date.now()+f-l<ra})}catch(l){if(this._debug(i,"error",l),Y(l))return this._returnResult({data:{session:null,user:null},error:l});throw l}finally{this._debug(i,"end")}}_isValidSession(n){return typeof n=="object"&&n!==null&&"access_token"in n&&"refresh_token"in n&&"expires_at"in n}async _handleProviderSignIn(n,i){const{url:l,flowId:o}=await this._getUrlForProvider(`${this.url}/authorize`,n,{redirectTo:i.redirectTo,scopes:i.scopes,queryParams:i.queryParams});return this._debug("#_handleProviderSignIn()","provider",n,"options",i,"url",l),_t()&&!i.skipBrowserRedirect&&window.location.assign(l),{data:{provider:n,url:l,flowId:o},error:null}}async _recoverAndRefresh(){var n,i;const l="#_recoverAndRefresh()";this._debug(l,"begin");try{const o=await St(this.storage,this.storageKey);if(o&&this.userStorage){let f=await St(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!f&&(f={user:o.user},await ua(this.userStorage,this.storageKey+"-user",f)),o.user=(n=f==null?void 0:f.user)!==null&&n!==void 0?n:Zh()}else if(o&&!o.user&&!o.user){const f=await St(this.storage,this.storageKey+"-user");f&&(f!=null&&f.user)?(o.user=f.user,await Lt(this.storage,this.storageKey+"-user"),await ua(this.storage,this.storageKey,o)):o.user=Zh()}if(this._debug(l,"session from storage",o),!this._isValidSession(o)){this._debug(l,"session is not val
163id"),o!==null&&await this._removeSession();return}const h=((i=o.expires_at)!==null&&i!==void 0?i:1/0)*1e3-Date.now()<Xh;if(this._debug(l,`session has${h?"":" not"} expired with margin of ${Xh}s`),h){if(this.autoRefreshToken&&o.refresh_token){const{error:f}=await this._callRefreshToken(o.refresh_token);f&&(Pv(f)?this._debug(l,"refresh discarded by commit guard",f):this._debug(l,"refresh failed",f))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{const{data:f,error:m}=await this._getUser(o.access_token);!m&&(f!=null&&f.user)?(o.user=f.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(l,"could not get user data, skipping SIGNED_IN notification")}catch(f){console.error("Error getting user data:",f),this._debug(l,"error getting user data, skipping SIGNED_IN notification",f)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(l,"error",o),Do(o)?console.warn(o):console.error(o);return}finally{this._debug(l,"end")}}async _callRefreshToken(n){var i,l;if(!n)throw new ut;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 o="#_callRefreshToken()";this._debug(o,"begin");try{this.refreshingDeferred=new au,this.refreshingDeferred.promise.then(void 0,()=>{});const h=await St(this.storage,this.storageKey),{data:f,error:m}=await this._refreshAccessToken(n);if(m)throw m;if(!f.session)throw new ut;const g=await St(this.storage,this.storageKey);if(h!==null&&(g===null||g.refresh_token!==h.refresh_token)){this._debug(o,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:g?"replaced":"cleared"});const w={data:null,error:new Iv};return this.refreshingDeferred.resolve(w),w}const b=this._sessionRemovalEpoch;if(await this._saveSession(f.session),this._sessionRemovalEpoch!==b){this._debug(o,"commit guard (post-save): _removeSession ran during _saveSession, undoing write"),await Lt(this.storage,this.storageKey),this.userStorage&&await Lt(this.userStorage,this.storageKey+"-user");const w={data:null,error:new Iv};return this.refreshingDeferred.resolve(w),w}await this._notifyAllSubscribers("TOKEN_REFRESHED",f.session);const y={data:f.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(y),y}catch(h){if(this._debug(o,"error",h),Y(h)){const f={data:null,error:h};if(!Do(h)){const m=await St(this.storage,this.storageKey);!!(m!=null&&m.expires_at&&m.expires_at*1e3>Date.now())?this._debug(o,"proactive refresh failed, access token still valid â preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:n,result:f,expiresAt:Date.now()+rj},(i=this.refreshingDeferred)===null||i===void 0||i.resolve(f),f}throw(l=this.refreshingDeferred)===null||l===void 0||l.reject(h),h}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(n,i,l=!0){if(this._pendingInitNotifications!==null&&l){this._pendingInitNotifications.push({event:n,session:i,broadcast:l});return}const o=`#_notifyAllSubscribers(${n})`;this._debug(o,"begin",i,`broadcast = ${l}`);try{this.broadcastChannel&&l&&this.broadcastChannel.postMessage({event:n,session:i});const h=[],f=Array.from(this.stateChangeEmitters.values()).map(async m=>{try{await m.callback(n,i)}catch(g){h.push(g)}});if(await Promise.all(f),h.length>0){for(let m=0;m<h.length;m+=1)console.error(h[m]);throw h[0]}}finally{this._debug(o,"end")}}async _saveSession(n){this._debug("#_saveSession()",n),this.suppressGetSessionWarning=!0;const i=Object.assign({},n),l=i.user&&i.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!l&&i.user&&await ua(this.userStorage,this.storageKey+"-user",{user:i.user});const o=Object.assign({},i);delete o.user;const h=Qv(o);await ua(this.storage,this.storageKey,h)}else{const o=Qv(i);await ua(this.storage,this.storageKey,o)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await Lt(this.storage,this.storageKey),await kj(this.storage,this.storageKey),await Lt(this.storage,this.storageKey+"-user"),this.userStorage&&await Lt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const n=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{n&&_t()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",n)}
163catch(i){console.error("removing visibilitychange callback failed",i)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const n=setInterval(()=>this._autoRefreshTokenTick(),ra);this.autoRefreshTicker=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n);const i=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=i,i&&typeof i=="object"&&typeof i.unref=="function"?i.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(i)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const n=this.autoRefreshTicker;this.autoRefreshTicker=null,n&&clearInterval(n);const i=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,i&&clearTimeout(i)}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 i=>{const{data:{session:l}}=i;if(!l||!l.refresh_token||!l.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const o=Math.floor((l.expires_at*1e3-n)/ra);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${ra}ms, refresh threshold is ${Dr} ticks`),o<=Dr&&await this._callRefreshToken(l.refresh_token)})}catch(i){console.error("Auto refresh tick failed with error. This is likely a transient error.",i)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(n){if(n instanceof Yj)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 i=>{const{data:{session:l}}=i;if(!l||!l.refresh_token||!l.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const o=Math.floor((l.expires_at*1e3-n)/ra);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${ra}ms, refresh threshold is ${Dr} ticks`),o<=Dr&&await this._callRefreshToken(l.refresh_token)})}catch(i){console.error("Auto refresh tick failed with error. This is likely a transient error.",i)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!_t()||!(window!=null&&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==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(n){console.error("_handleVisibilityChange",n)}}async _onVisibilityChanged(n){const i=`#_onVisibilityChanged(${n})`;if(this._debug(i,"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(i,"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(i,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(n,i,l){let o=l==null?void 0:l.redirectTo,h=null,f=null,m=null;this.flowType==="pkce"&&([h,f,m]=await this._getCodeChallengeAndMethod(),o=this._maybeAppendFlowIdToRedirect(o,m));const g=[`provider=${encodeURIComponent(i)}`];if(o&&g.push(`redirect_to=${encodeURIComponent(o)}`),l!=null&&l.scopes&&g.push(`scopes=${encodeURIComponent(l.scopes)}`),h!=null&&f!=null){const v=new URLSearchParams({code_challenge:`${encodeURIComponent(h)}`,code_challenge_method:`${encodeURIComponent(f)}`});g.push(v.toString())}if(l!=null&&l.queryParams){const v=new URLSearchParams(l.queryParams);g.push(v.toString())}
163return l!=null&&l.skipBrowserRedirect&&g.push(`skip_http_redirect=${l.skipBrowserRedirect}`),{url:`${n}?${g.join("&")}`,flowId:m}}_maybeAppendFlowIdToRedirect(n,i){return!n||!i||!this.experimental.appendPkceFlowIdToRedirects?n??void 0:Dj(n,i)}async _getCodeChallengeAndMethod(n=!1){return Uj(this.storage,this.storageKey,n,i=>this._debug("#_getCodeChallengeAndMethod()","evicted oldest pending PKCE verifier slot",i))}async _unenroll(n){try{return await this._useSession(async i=>{var l;const{data:o,error:h}=i;return h?this._returnResult({data:null,error:h}):await X(this.fetch,"DELETE",`${this.url}/factors/${n.factorId}`,{headers:this.headers,jwt:(l=o==null?void 0:o.session)===null||l===void 0?void 0:l.access_token})})}catch(i){if(Y(i))return this._returnResult({data:null,error:i});throw i}}async _enroll(n){try{return await this._useSession(async i=>{var l,o;const{data:h,error:f}=i;if(f)return this._returnResult({data:null,error:f});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:v}=await X(this.fetch,"POST",`${this.url}/factors`,{body:m,headers:this.headers,jwt:(l=h==null?void 0:h.session)===null||l===void 0?void 0:l.access_token});return v?this._returnResult({data:null,error:v}):(n.factorType==="totp"&&g.type==="totp"&&(!((o=g==null?void 0:g.totp)===null||o===void 0)&&o.qr_code)&&(g.totp.qr_code=`data:image/svg+xml;utf-8,${g.totp.qr_code}`),this._returnResult({data:g,error:null}))})}catch(i){if(Y(i))return this._returnResult({data:null,error:i});throw i}}async _verify(n){const i=async()=>{try{return await this._useSession(async l=>{var o;const{data:h,error:f}=l;if(f)return this._returnResult({data:null,error:f});const m=Object.assign({challenge_id:n.challengeId},"webauthn"in n?{webauthn:Object.assign(Object.assign({},n.webauthn),{credential_response:n.webauthn.type==="create"?ay(n.webauthn.credential_response):sy(n.webauthn.credential_response)})}:{code:n.code}),{data:g,error:v}=await X(this.fetch,"POST",`${this.url}/factors/${n.factorId}/verify`,{body:m,headers:this.headers,jwt:(o=h==null?void 0:h.session)===null||o===void 0?void 0:o.access_token});return v?this._returnResult({data:null,error:v}):(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:v}))})}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,i):i()}async _challenge(n){const i=async()=>{try{return await this._useSession(async l=>{var o;const{data:h,error:f}=l;if(f)return this._returnResult({data:null,error:f});const m=await X(this.fetch,"POST",`${this.url}/factors/${n.factorId}/challenge`,{body:n,headers:this.headers,jwt:(o=h==null?void 0:h.session)===null||o===void 0?void 0:o.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:ty(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:ny(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,i):i()}async _challengeAndVerify(n){const{data:i,error:l}=await this._challenge({factorId:n.factorId});return l?this._returnResult({data:null,error:l}):await this._verify({factorId:n.factorId,challengeId:i.id,code:n.code})}async _listFactors(){var n;const{data:{user:i},error:l}=await this.getUser();if(l)return{data:null,error:l};const o={all:[],phone:[],totp:[],webauthn:[],recovery_code:[]};for(const h of(n=i==null?void 0:i.factors)!==null&&n!==void 0?n:[])o.all.push(h),h.status==="verified"&&h.factor_type in o&&Array.isArray(o[h.factor_type])&&o[h.factor_type].push(h);return{data:o,error:null}}async _getAuthenticatorAssuranceLevel(n){var i,l,o,h;if(n)try{const{payload:x}=Uo(n);let R=null;x.aal&&(R=x.aal);let j=R;const{data:{user:N},error:T}=await this.getUser(n);if(T)return this._returnResult({data:null,error:T});((l=(i=N==null?void 0:N.factors)===null||i===void 0?void 0:i.filter(Q=>Q.status==="verified"))!==null&&l!==void 0?l:[]).length>0&&(j="aal2");const B=x.amr||[];return{data:{currentLevel:R,nextLevel:j,currentAuthenticationMethods:B},error:null}}
163catch(x){if(Y(x))return this._returnResult({data:null,error:x});throw x}const{data:{session:f},error:m}=await this.getSession();if(m)return this._returnResult({data:null,error:m});if(!f)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:g}=Uo(f.access_token);let v=null;g.aal&&(v=g.aal);let b=v;((h=(o=f.user.factors)===null||o===void 0?void 0:o.filter(x=>x.status==="verified"))!==null&&h!==void 0?h:[]).length>0&&(b="aal2");const w=g.amr||[];return{data:{currentLevel:v,nextLevel:b,currentAuthenticationMethods:w},error:null}}async _getRecoveryCodesStatus(){Cr(this.experimental);try{return await this._useSession(async n=>{var i;const{data:l,error:o}=n;if(o)return this._returnResult({data:null,error:o});const{data:h,error:f}=await X(this.fetch,"GET",`${this.url}/factors/recovery-codes`,{headers:this.headers,jwt:(i=l==null?void 0:l.session)===null||i===void 0?void 0:i.access_token});return f?this._returnResult({data:null,error:f}):this._returnResult({data:h,error:null})})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _generateRecoveryCodes(n){Cr(this.experimental);try{return await this._useSession(async i=>{var l;const{data:o,error:h}=i;if(h)return this._returnResult({data:null,error:h});const{data:f,error:m}=await X(this.fetch,"POST",`${this.url}/factors/recovery-codes`,{body:n!=null&&n.friendlyName?{friendly_name:n.friendlyName}:void 0,headers:this.headers,jwt:(l=o==null?void 0:o.session)===null||l===void 0?void 0:l.access_token});return m?this._returnResult({data:null,error:m}):this._returnResult({data:f,error:null})})}catch(i){if(Y(i))return this._returnResult({data:null,error:i});throw i}}async _verifyRecoveryCode(n){Cr(this.experimental);const i=async()=>{try{return await this._useSession(async l=>{var o;const{data:h,error:f}=l;if(f)return this._returnResult({data:null,error:f});const{data:m,error:g}=await X(this.fetch,"POST",`${this.url}/factors/recovery-codes/verify`,{body:{code:n.code},headers:this.headers,jwt:(o=h==null?void 0:h.session)===null||o===void 0?void 0:o.access_token});if(g)return this._returnResult({data:null,error:g});const v=Object.assign({expires_at:i0(m.expires_in)},m);return await this._saveSession(v),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",v),this._returnResult({data:m,error:null})})}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,i):i()}async _regenerateRecoveryCodes(){Cr(this.experimental);try{return await this._useSession(async n=>{var i;const{data:l,error:o}=n;if(o)return this._returnResult({data:null,error:o});const{data:h,error:f}=await X(this.fetch,"POST",`${this.url}/factors/recovery-codes/regenerate`,{headers:this.headers,jwt:(i=l==null?void 0:l.session)===null||i===void 0?void 0:i.access_token});return f?this._returnResult({data:null,error:f}):this._returnResult({data:h,error:null})})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _unenrollRecoveryCodes(){Cr(this.experimental);try{return await this._useSession(async n=>{var i;const{data:l,error:o}=n;if(o)return this._returnResult({data:null,error:o});const{data:h,error:f}=await X(this.fetch,"DELETE",`${this.url}/factors/recovery-codes`,{headers:this.headers,jwt:(i=l==null?void 0:l.session)===null||i===void 0?void 0:i.access_token});return f?this._returnResult({data:null,error:f}):this._returnResult({data:h,error:null})})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _getAuthorizationDetails(n){try{return await this._useSession(async i=>{const{data:{session:l},error:o}=i;return o?this._returnResult({data:null,error:o}):l?await X(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 ut})})}catch(i){if(Y(i))return this._returnResult({data:null,error:i});throw i}}async _approveAuthorization(n,i){try{return await this._useSession(async l=>{const{data:{session:o},error:h}=l;if(h)return this._returnResult({data:null,error:h});if(!o)return this._returnResult({data:null,error:new ut});const f=await X(this.fetch,"POST",`${this.url}/oauth/authorizations/${n}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"approve"},xform:m=>({data:m,error:null})});return f.data&&f.data.redirect_url&&_t()&&!(i!=null&&i.skipBrowserRedirect)&&window.location.assign(f.data.redirect_url),f})}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}}async _denyAuthorization(n,i){try{return await this._useSession(async l=>{const{data:{session:o},error:h}=l;if(h)return this._returnResult({data:null,error:h});if(!o)return this._returnResult({data:null,error:new ut});const f=await X(this.fetch,"POST",`${this.url}/oauth/authorizations/${n}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"deny"},xform:m=>({data:m,error:null})});return f.data&&f.data.redirect_url&&_t()&&!(i!=null&&i.skipBrowserRedirect)&&window.location.assign(f.data.redirect_url),f})}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:i},error:l}=n;return l?this._returnResult({data:null,error:l}):i?await X(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:i.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new ut})})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _revokeOAuthGrant(n){try{return await this._useSession(async i=>{const{data:{session:l},error:o}=i;return o?this._returnResult({data:null,error:o}
163):l?(await X(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 ut})})}catch(i){if(Y(i))return this._returnResult({data:null,error:i});throw i}}async fetchJwk(n,i={keys:[]}){let l=i.keys.find(m=>m.kid===n);if(l)return l;const o=Date.now();if(l=this.jwks.keys.find(m=>m.kid===n),l&&this.jwks_cached_at+dj>o)return l;const{data:h,error:f}=await X(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(f)throw f;return!h.keys||h.keys.length===0||(this.jwks=h,this.jwks_cached_at=o,l=h.keys.find(m=>m.kid===n),!l)?null:l}async getClaims(n,i={}){try{let l=n;if(!l){const{data:x,error:R}=await this.getSession();if(R||!x.session)return this._returnResult({data:null,error:R});l=x.session.access_token}const{header:o,payload:h,signature:f,raw:{header:m,payload:g}}=Uo(l);if(!(i!=null&&i.allowExpired))try{zj(h.exp)}catch(x){throw new Go(x instanceof Error?x.message:"JWT validation failed")}const v=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,i!=null&&i.keys?{keys:i.keys}:i==null?void 0:i.jwks);if(!v){const{error:x}=await this.getUser(l);if(x)throw x;return{data:{claims:h,header:o,signature:f},error:null}}const b=Bj(o.alg),y=await crypto.subtle.importKey("jwk",v,b,!0,["verify"]);if(!await crypto.subtle.verify(b,y,f,_j(`${m}.${g}`)))throw new Go("Invalid JWT signature");return{data:{claims:h,header:o,signature:f},error:null}}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}}async signInWithPasskey(n){var i,l,o,h;try{if(!Yo())return this._returnResult({data:null,error:new vn("Browser does not support WebAuthn",null)});const{data:f,error:m}=await this._startPasskeyAuthentication({options:{captchaToken:(i=n==null?void 0:n.options)===null||i===void 0?void 0:i.captchaToken}});if(m||!f)return this._returnResult({data:null,error:m});const g=ny(f.options),v=(o=(l=n==null?void 0:n.options)===null||l===void 0?void 0:l.signal)!==null&&o!==void 0?o:md.createNewAbortSignal(),{data:b,error:y}=await d0({publicKey:g,signal:v,mediation:(h=n==null?void 0:n.options)===null||h===void 0?void 0:h.mediation});if(y||!b)return this._returnResult({data:null,error:y??new vn("WebAuthn ceremony failed",null)});const w=sy(b);return this._verifyPasskeyAuthentication({challengeId:f.challenge_id,credential:w})}catch(f){if(Y(f))return this._returnResult({data:null,error:f});throw f}}async registerPasskey(n){var i,l;try{if(!Yo())return this._returnResult({data:null,error:new vn("Browser does not support WebAuthn",null)});const{data:o,error:h}=await this._startPasskeyRegistration();if(h||!o)return this._returnResult({data:null,error:h});const f=ty(o.options),m=(l=(i=n==null?void 0:n.options)===null||i===void 0?void 0:i.signal)!==null&&l!==void 0?l:md.createNewAbortSignal(),{data:g,error:v}=await h0({publicKey:f,signal:m});if(v||!g)return this._returnResult({data:null,error:v??new vn("WebAuthn ceremony failed",null)});const b=ay(g);return this._verifyPasskeyRegistration({challengeId:o.challenge_id,credential:b})}catch(o){if(Y(o))return this._returnResult({data:null,error:o});throw o}}async _startPasskeyRegistration(){try{return await this._useSession(async n=>{const{data:{session:i},error:l}=n;if(l)return this._returnResult({data:null,error:l});if(!i)return this._returnResult({data:null,error:new ut});const{data:o,error:h}=await X(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:i.access_token,body:{}});return h?this._returnResult({data:null,error:h}):this._returnResult({data:o,error:null})})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyRegistration(n){try{return await this._useSession(async i=>{const{data:{session:l},error:o}=i;if(o)return this._returnResult({data:null,error:o});if(!l)return this._returnResult({data:null,error:new ut});const{data:h,error:f}=await X(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:l.access_token,body:{challenge_id:n.challengeId,credential:n.credential}});return f?this._returnResult({data:null,error:f}):this._returnResult({data:h,error:null})})}catch(i){if(Y(i))return this._returnResult({data:null,error:i});throw i}}async _startPasskeyAuthentication(n){var i;try{const{data:l,error:o}=await X(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(i=n==null?void 0:n.options)===null||i===void 0?void 0:i.captchaToken}}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:l,error:null})}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}}async _verifyPasskeyAuthentication(n){try{const{data:i,error:l}=await X(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}):(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),this._returnResult({data:i,error:null}))}catch(i){if(Y(i))return this._returnResult({data:null,error:i});throw i}}async _listPasskeys(){try{return await this._useSession(async n=>{const{data:{session:i},error:l}=n;if(l)return this._returnResult({data:null,error:l});if(!i)return this._returnResult({data:null,error:new ut});const{data:o,error:h}=await X(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:i.access_token,xform:f=>({data:f,error:null})});return h?this._returnResult({data:null,error:h}):this._returnResult({data:o,error:null})})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _updatePasskey(n){try{return await this._useSession(async i=>{const{data:{session:l},error:o}=i;if(o)return this._returnResult({data:null,error:o});if(!l)return this._returnResult({data:null,error:new ut});const{data:h,error:f}=await X(this.fetch,"PATCH",`${this.url}/passkeys/${n.passkeyId}`,{headers:this.headers,jwt:l.access_token,body:{friendly_name:n.friendlyName}});return f?this._returnResult({data:null,error:f}):this._returnResult({data:h,error:null})})}catch(i){if(Y(i))return this._returnResult({data:null,error:i});throw i}}async _deletePasskey(n){try{return await this._useSession(async i=>{const{data:{session:l},error:o}=i;if(o)return this._returnResult({data:null,error:o});if(!l)return this._returnResult({data:null,error:new ut});const{error:h}
163=await X(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(i){if(Y(i))return this._returnResult({data:null,error:i});throw i}}}Ir.nextInstanceID={};const lT=Ir,oT="2.117.2";let Ur="",Qo;if(typeof Deno<"u"){var Wh;Ur="deno",Qo=(Wh=Deno.version)===null||Wh===void 0?void 0:Wh.deno}else if(typeof document<"u")Ur="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")Ur="react-native";else{var ed;Ur="node";const s=globalThis.process;Qo=s==null||(ed=s.version)===null||ed===void 0?void 0:ed.replace(/^v/,"")}const f0=[`runtime=${Ur}`];Qo&&f0.push(`runtime-version=${Qo}`);const uT={"X-Client-Info":`supabase-js/${oT}; ${f0.join("; ")}`},cT={headers:uT},hT={schema:"public"},dT={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},fT={},mT={enabled:!1,respectSamplingDecision:!0};function gT(s){if(!s||typeof s!="string")return null;const n=s.split("-");if(n.length!==4)return null;const[i,l,o,h]=n;if(i.length!==2||l.length!==32||o.length!==16||h.length!==2)return null;const f=/^[0-9a-f]+$/i;return!f.test(i)||!f.test(l)||!f.test(o)||!f.test(h)||l==="00000000000000000000000000000000"||o==="0000000000000000"?null:{version:i,traceId:l,parentId:o,traceFlags:h,isSampled:(parseInt(h,16)&1)===1}}function pT(s,n){if(!s||!n||n.length===0)return!1;let i;if(s instanceof URL)i=s;else try{i=new URL(s)}catch{return!1}for(const l of n)try{if(typeof l=="string"){if(vT(i.hostname,l))return!0}else if(l instanceof RegExp){if(l.test(i.hostname))return!0}else if(typeof l=="function"&&l(i))return!0}catch{continue}return!1}function vT(s,n){if(n===s)return!0;if(n.startsWith("*.")){const i=n.slice(2);if(s.endsWith(i)&&(s===i||s.endsWith("."+i)))return!0}return!1}function yT(s){const n=[];try{const i=new URL(s);n.push(i.hostname)}catch{}return n.push("*.supabase.co","*.supabase.in"),n.push("localhost","127.0.0.1","[::1]"),n}function Pr(s){"@babel/helpers - typeof";return Pr=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},Pr(s)}function bT(s,n){if(Pr(s)!="object"||!s)return s;var i=s[Symbol.toPrimitive];if(i!==void 0){var l=i.call(s,n);if(Pr(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(s)}function _T(s){var n=bT(s,"string");return Pr(n)=="symbol"?n:n+""}function xT(s,n,i){return(n=_T(n))in s?Object.defineProperty(s,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):s[n]=i,s}function ry(s,n){var i=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);n&&(l=l.filter(function(o){return Object.getOwnPropertyDescriptor(s,o).enumerable})),i.push.apply(i,l)}return i}function Ye(s){for(var n=1;n<arguments.length;n++){var i=arguments[n]!=null?arguments[n]:{};n%2?ry(Object(i),!0).forEach(function(l){xT(s,l,i[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(i)):ry(Object(i)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(i,l))})}return s}const wT=s=>s?(...n)=>s(...n):(...n)=>fetch(...n),ST=()=>Headers,m0=s=>s.startsWith("sb_publishable_")||s.startsWith("sb_secret_"),ET="sb_temp_",ly=new Set,jT=s=>{var n,i;if(!s.startsWith("sb_")||m0(s)||s.startsWith(ET))return;const l=(n=(i=s.match(/^sb_[a-zA-Z0-9]+_/))===null||i===void 0?void 0:i[0])!==null&&n!==void 0?n:"unknown";ly.has(l)||(ly.add(l),console.warn("@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed and send this key as-is; if you see authentication errors you may need to upgrade @supabase/supabase-js to a version that recognizes this key type."))},oy=(s,n,i,l,o,h)=>{const f=wT(l),m=ST(),g=(o==null?void 0:o.enabled)===!0,v=(o==null?void 0:o.respectSamplingDecision)!==!1,b=g?yT(n):null,y=!(h!=null&&h.omitApiKeyAsBearer&&m0(s));return async(w,x)=>{const R=await i();let j=new m(x==null?void 0:x.headers);if(j.has("apikey")||j.set("apikey",s),!j.has("Authorization")){const N=R??(y?s:null);N&&j.set("Authorization",`Bearer ${N}`)}if(b){const N=TT(w,b,v);N&&(N.traceparent&&!j.has("traceparent")&&j.set("traceparent",N.traceparent),N.tracestate&&!j.has("tracestate")&&j.set("tracestate",N.tracestate),N.baggage&&!j.has("baggage")&&j.set("baggage",N.baggage))}return f(w,Ye(Ye({},x),{},{headers:j}))}};let uy=!1,cy=!1;function TT(s,n,i){const l=ES();if(!l)return uy||(uy=!0,console.warn("@supabase/supabase-js: tracePropagation is enabled but the tracing runtime is not loaded, so trace headers will not be attached. Add `import '@supabase/supabase-js/tracing'` at your application entry point (requires the OpenTelemetry API package to be installed). The CDN/UMD build does not support trace propagation.")),null;if(!pT(typeof s=="string"||s instanceof URL?s:s.url,n))return null;const o=l();if(!o||!o.traceparent){var h;if(!(o==null||(h=o.carrierKeys)===null||h===void 0)&&h.length&&!cy){cy=!0;const f=o.carrierKeys.includes("sentry-trace")?" Sentry detected: set `propagateTraceparent: true` in Sentry.init() to emit it."
163:" Configure your tracing SDK to emit W3C trace context on outgoing requests.";console.warn(`@supabase/supabase-js: tracePropagation is enabled and a tracing SDK is active, but its propagator wrote [${o.carrierKeys.join(", ")}] and no W3C traceparent header, so trace headers will not be attached.`+f)}return null}if(i){const f=gT(o.traceparent);if(f&&!f.isSampled)return{traceparent:o.traceparent}}return o}function hy(s){return typeof s=="boolean"?{enabled:s}:s}function RT(s){return s.endsWith("/")?s:s+"/"}let dy=!1;function AT(s){dy||typeof s!="object"||s===null||!("schema"in s)||s.schema===void 0||(dy=!0,console.warn(`@supabase/supabase-js: The "schema" option must be nested under "db", e.g. createClient(url, key, { db: { schema: 'myschema' } }). A top-level "schema" is ignored and queries go to the default schema.`))}function NT(s,n){var i,l,o,h,f,m;const{db:g,auth:v,realtime:b,global:y}=s,{db:w,auth:x,realtime:R,global:j}=n,N=hy(s.tracePropagation),T=hy(n.tracePropagation),C={db:Ye(Ye({},w),g),auth:Ye(Ye({},x),v),realtime:Ye(Ye({},R),b),storage:{},global:Ye(Ye(Ye({},j),y),{},{headers:Ye(Ye({},(i=j==null?void 0:j.headers)!==null&&i!==void 0?i:{}),(l=y==null?void 0:y.headers)!==null&&l!==void 0?l:{})}),tracePropagation:{enabled:(o=(h=N==null?void 0:N.enabled)!==null&&h!==void 0?h:T==null?void 0:T.enabled)!==null&&o!==void 0?o:!1,respectSamplingDecision:(f=(m=N==null?void 0:N.respectSamplingDecision)!==null&&m!==void 0?m:T==null?void 0:T.respectSamplingDecision)!==null&&f!==void 0?f:!0},accessToken:async()=>""};return s.accessToken?C.accessToken=s.accessToken:delete C.accessToken,C}function OT(s){const n=s==null?void 0:s.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(RT(n))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var CT=class extends lT{constructor(s){super(s)}},kT=class{constructor(s,n,i){var l,o;this.supabaseUrl=s,this.supabaseKey=n;const h=OT(s);if(!n)throw new Error("supabaseKey is required.");jT(n),AT(i),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 f=`sb-${h.hostname.split(".")[0]}-auth-token`,m={db:hT,realtime:fT,auth:Ye(Ye({},dT),{},{storageKey:f}),global:cT,tracePropagation:mT},g=NT(i??{},m);if(this.settings=g,this.storageKey=(l=g.auth.storageKey)!==null&&l!==void 0?l:"",this.headers=(o=g.global.headers)!==null&&o!==void 0?o:{},g.accessToken)this.accessToken=g.accessToken,this.auth=new Proxy({},{get:(b,y)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(y)} is not possible`)}});else{var v;this.auth=this._initSupabaseAuthClient((v=g.auth)!==null&&v!==void 0?v:{},this.headers,g.global.fetch)}this.fetch=oy(n,s,this._getSessionToken.bind(this),g.global.fetch,g.tracePropagation),this.functionsFetch=oy(n,s,this._getSessionToken.bind(this),g.global.fetch,g.tracePropagation,{omitApiKeyAsBearer:!0}),this.realtime=this._initRealtimeClient(Ye({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},g.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(b=>this.realtime.setAuth(b)).catch(b=>console.warn("Failed to set initial Realtime auth token:",b)),this.rest=new BS(new URL("rest/v1",h).href,{headers:this.headers,schema:g.db.schema,fetch:this.fetch,timeout:g.db.timeout,urlLengthLimit:g.db.urlLengthLimit,retry:g.db.retry}),this.storage=new ij(this.storageUrl.href,this.headers,this.fetch,i==null?void 0:i.storage),g.accessToken||this._listenForAuthEvents()}get functions(){return new AS(this.functionsUrl.href,{headers:this.headers,customFetch:this.functionsFetch})}from(s){return this.rest.from(s)}schema(s){return this.rest.schema(s)}getOpenApiSpec(){return this.rest.getOpenApiSpec()}rpc(s,n={},i={head:!1,get:!1,count:void 0}){return this.rest.rpc(s,n,i)}channel(s,n={config:{}}){return this.realtime.channel(s,n)}getChannels(){return this.realtime.getChannels()}removeChannel(s){return this.realtime.removeChannel(s)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getSessionToken(){var s=this,n,i;if(s.accessToken)return await s.accessToken();const{data:l}=await s.auth.getSession();return(n=(i=l.session)===null||i===void 0?void 0:i.access_token)!==null&&n!==void 0?n:null}async _getAccessToken(){var s=this,n;return(n=await s._getSessionToken())!==null&&n!==void 0?n:s.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:s,persistSession:n,detectSessionInUrl:i,storage:l,userStorage:o,storageKey:h,flowType:f,lock:m,debug:g,throwOnError:v,experimental:b,lockAcquireTimeout:y,skipAutoInitialize:w},x,R){const j={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new CT({url:this.authUrl.href,headers:Ye(Ye({},j),x),storageKey:h,autoRefreshToken:s,persistSession:n,detectSessionInUrl:i,storage:l,userStorage:o,flowType:f,lock:m,debug:g,throwOnError:v,experimental:b,fetch:R,lockAcquireTimeout:y,skipAutoInitialize:w,hasCustomAuthorizationHeader:Object.keys(this.headers).some(N=>N.toLowerCase()==="authorization")})}_initRealtimeClient(s){return new NE(this.realtimeUrl.href,Ye(Ye({},s),{},{params:Ye(Ye({},{apikey:this.supabaseKey}),s==null?void 0:s.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((s,n)=>{this._handleTokenChanged(s,"CLIENT",n==null?void 0:n.access_token)})}_handleTokenChanged(s,n,i){(s==="TOKEN_REFRESHED"||s==="SIGNED_IN"||s==="INITIAL_SESSION")&&this.changedAccessToken!==i?(this.changedAccessToken=i,this.realtime.setAuth(i)):s==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const DT=(s,n,i)=>new kT(s,n,i);
163function UT(){if(typeof window<"u"||globalThis.Deno!==void 0)return!1;const s=globalThis.process;if(!s)return!1;const n=s.version;if(n==null)return!1;const i=n.match(/^v(\d+)\./);return i?parseInt(i[1],10)<=20:!1}UT()&&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 LT="https://ufshuedarhueuituppjo.supabase.co",MT="sb_publishable_pdkOzNe8XMP9lI23RKdY8Q_XSSOi8Zp",Mr=DT(LT,MT);function zT({children:s}){const[n,i]=E.useState(!1),[l,o]=E.useState(!1),[h,f]=E.useState(""),[m,g]=E.useState(""),[v,b]=E.useState(""),[y,w]=E.useState(!1),x=E.useRef(0);E.useEffect(()=>{let j=!0;async function N(C){const B=++x.current;if(!C){j&&(o(!1),i(!0));return}try{const Q=await fetch("/api/me",{headers:{Authorization:`Bearer ${C}`}});if(!j||B!==x.current)return;o(Q.ok),b(Q.ok?"":Q.status===403?"This account does not have access to Agent Gateway.":"Could not verify your session.")}catch{j&&B===x.current&&(o(!1),b("Could not reach Agent Gateway."))}finally{j&&B===x.current&&i(!0)}}Mr.auth.getSession().then(({data:C})=>{var B;return N((B=C.session)==null?void 0:B.access_token)}).catch(()=>{j&&(i(!0),b("Could not load your Zafe session."))});const{data:T}=Mr.auth.onAuthStateChange((C,B)=>{N(B==null?void 0:B.access_token)});return()=>{j=!1,x.current++,T.subscription.unsubscribe()}},[]);async function R(j){j.preventDefault(),w(!0),b("");const{error:N}=await Mr.auth.signInWithPassword({email:h.trim(),password:m});N&&b("Incorrect email or password."),w(!1)}return n?l?d.jsx(d.Fragment,{children:s}):d.jsx("main",{className:"flex min-h-screen items-center justify-center bg-canvas px-6 py-12",children:d.jsxs("div",{className:"w-full max-w-[360px]",children:[d.jsxs("div",{className:"mb-11 text-center",children:[d.jsx("img",{src:"/zafe-wordmark-light.png",alt:"Zafe",className:"mx-auto h-auto w-36"}),d.jsx("p",{className:"mt-4 text-xs font-medium uppercase tracking-[0.24em] text-muted",children:"Agent Gateway"})]}),d.jsxs("form",{onSubmit:R,className:"space-y-3",children:[d.jsx("label",{htmlFor:"gateway-email",className:"sr-only",children:"Email"}),d.jsx("input",{id:"gateway-email",type:"email",autoComplete:"username",placeholder:"Email",required:!0,value:h,onChange:j=>f(j.target.value),className:"h-12"}),d.jsx("label",{htmlFor:"gateway-password",className:"sr-only",children:"Password"}),d.jsx("input",{id:"gateway-password",type:"password",autoComplete:"current-password",placeholder:"Password",required:!0,value:m,onChange:j=>g(j.target.value),className:"h-12"}),v&&d.jsx("p",{role:"alert",className:"py-1 text-sm text-red-300",children:v}),d.jsx("button",{type:"submit",className:"btn btn-primary mt-2 h-12 w-full",disabled:y,children:y?"Enteringâ¦":"Enter"})]})]})}):d.jsx("main",{className:"flex min-h-screen items-center justify-center bg-canvas text-sm text-muted",children:"Loadingâ¦"})}async function Pa(s,n={}){const{data:{session:i}}=await Mr.auth.getSession();if(!i)throw new Error("Sign in with your Zafe admin account");const l=await fetch(`/api${s}`,{...n,headers:{...n.body?{"Content-Type":"application/json"}:{},Authorization:`Bearer ${i.access_token}`,...n.headers}}),o=await l.json().catch(()=>({}));if(!l.ok)throw new Error(o.error||`Request failed (${l.status})`);return o}const la=(s,n)=>Pa(s,{method:"POST",...n===void 0?{}:{body:JSON.stringify(n)}}),BT=(s,n)=>Pa(s,{method:"PATCH",body:JSON.stringify(n)}),g0=E.createContext(null);function HT({children:s}){const[n,i]=E.useState(null),[l,o]=E.useState(""),[h,f]=E.useState(!0),m=E.useRef(!1),g=E.useCallback(async()=>{if(!m.current){m.current=!0;try{const T=await Pa("/operations/snapshot");i(T),o("")}catch(T){o(T.message)}finally{f(!1),m.current=!1}}},[]);E.useEffect(()=>{g();const T=window.setInterval(()=>{document.hidden||g()},4e3),C=()=>{document.hidden||g()};return document.addEventListener("visibilitychange",C),()=>{window.clearInterval(T),document.removeEventListener("visibilitychange",C)}},[g]);const v=async T=>{await la("/operations/missions",T),await g()},b=async T=>{const C=await Pa(`/operations/missions/${T}`,{method:"DELETE"});return await g(),C},y=async(T,C)=>{await la(`/operations/tickets/${T}/actions`,C),await g()},w=async(T,C)=>{await la(`/operations/missions/${T}/actions`,{action:C}),await g()},x=async(T,C)=>{await la(`/operations/prospects/${T}/actions`,{action:C}),await g()},R=async T=>{await la("/operations/artifacts",T),await g()},j=async(T,C)=>{const B=await la(`/operations/tickets/${T}/research-media`,C);return await g(),B},N=async(T,C)=>{await BT(`/operations/profiles/${T}`,C),await g()};return d.jsx(g0.Provider,{value:{data:n,loading:h,error:l,refresh:g,createMission:v,deleteMission:b,act:y,actMission:w,actProspect:x,addArtifact:R,amendResearchMedia:j,updateProfile:N},children:s})}function ct(){const s=E.useContext(g0);if(!s)throw new Error("OperationsProvider missing");return s}function wn({title:s,subtitle:n,action:i}){return d.jsxs("header",{className:"mb-7 flex flex-wrap items-start justify-between gap-4",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:s}),n&&d.jsx("p",{className:"mt-1 text-sm text-muted",children:n})]}),i]})}function he({title:s,children:n,action:i}){return d.jsxs("section",{className:"card overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line px-5 py-4",children:[d.jsx("h2",{className:"text-sm font-semibold",children:s}),i]}),n]})}function Ze({text:s}){return d.jsx("p",{className:"p-8 text-center text-sm text-muted",children:s})}function Jt({value:s}){return d.jsx("span",{className:`badge badge-${s.toLowerCase()}`,children:qe(s)})}
163function ge({name:s,value:n,href:i}){const l=n==null||n===""?"â":String(n);return d.jsxs("div",{className:"min-w-0 border-b border-line py-3 last:border-0",children:[d.jsx("dt",{className:"text-[11px] font-semibold uppercase tracking-wider text-faint",children:s}),d.jsx("dd",{className:"mt-1 min-w-0 break-words text-sm [overflow-wrap:anywhere]",children:i&&l!=="â"?d.jsx("a",{className:"text-blue-300 hover:underline",target:"_blank",rel:"noreferrer",href:i,children:l}):l})]})}function Ia({value:s}){return d.jsx("pre",{className:"overflow-x-auto rounded-md border border-line bg-canvas p-4 text-xs leading-6 text-muted",children:JSON.stringify(s??{},null,2)})}function Ri({ticket:s}){return d.jsx(Ne,{to:`/tickets/${s.ticket_id}`,className:"font-mono text-xs font-semibold text-fg hover:underline",children:s.ticket_id})}function Od({prospect:s}){return d.jsx(Ne,{to:`/prospects/${s.prospect_id}`,className:"font-medium hover:underline",children:s.business_name})}function oa({tickets:s}){return s.length?d.jsx("div",{className:"table-wrap",children:d.jsxs("table",{children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"Ticket"}),d.jsx("th",{children:"Prospect"}),d.jsx("th",{children:"Agent"}),d.jsx("th",{children:"Status"}),d.jsx("th",{children:"Priority"}),d.jsx("th",{children:"Updated"})]})}),d.jsx("tbody",{children:s.map(n=>{var i,l;return d.jsxs("tr",{children:[d.jsxs("td",{children:[d.jsx(Ri,{ticket:n}),d.jsx("div",{className:"mt-1 text-xs text-muted",children:qe(n.ticket_type)})]}),d.jsx("td",{children:n.prospect?d.jsx(Od,{prospect:n.prospect}):d.jsx("span",{className:"text-muted",children:"Batch"})}),d.jsx("td",{children:d.jsx(Ne,{className:"text-sm hover:underline",to:`/agents/${(i=n.agent)==null?void 0:i.slug}`,children:(l=n.agent)==null?void 0:l.name})}),d.jsx("td",{children:d.jsx(Jt,{value:n.status})}),d.jsx("td",{className:"text-sm text-muted",children:qe(n.priority)}),d.jsx("td",{className:"whitespace-nowrap text-xs text-faint",children:Je(n.updated_at)})]},n.id)})})]})}):d.jsx(Ze,{text:"No tickets match this view."})}function Jr({events:s}){return s.length?d.jsx("ol",{className:"divide-y divide-line",children:s.map(n=>d.jsxs("li",{className:"flex gap-4 px-5 py-3",children:[d.jsx("span",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full bg-blue-300"}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm",children:n.message}),d.jsxs("p",{className:"mt-1 text-xs text-faint",children:[qe(n.event_type)," · ",Je(n.created_at)]})]})]},n.id))}):d.jsx(Ze,{text:"No activity yet."})}const ki=s=>{if(!s)return"â";const n=Math.max(0,Math.floor((Date.now()-new Date(s).getTime())/1e3));return n<60?`${n}s`:n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}d`};function qT(){const{data:s,loading:n,error:i}=ct(),l=(s==null?void 0:s.prospects)||[],o=(s==null?void 0:s.tickets)||[],f=[["Active missions",((s==null?void 0:s.missions)||[]).filter(m=>m.status==="ACTIVE").length,"/missions"],["Prospects found",l.length,"/prospects"],["Researching",l.filter(m=>["RESEARCH_QUEUED","RESEARCHING"].includes(m.pipeline_stage)).length,"/pipeline"],["Qualified",l.filter(m=>m.qualification_status==="QUALIFIED").length,"/prospects"],["Disqualified",l.filter(m=>m.pipeline_stage==="DISQUALIFIED").length,"/prospects"],["Demos building",l.filter(m=>m.pipeline_stage==="DEMO_BUILDING").length,"/pipeline"],["Demos in review",o.filter(m=>m.status==="AWAITING_REVIEW").length,"/tickets"],["Ready for outreach",l.filter(m=>m.pipeline_stage==="READY_FOR_OUTREACH").length,"/pipeline"],["Active outreach",o.filter(m=>m.ticket_type==="OUTREACH"&&!["DONE","CANCELLED"].includes(m.status)).length,"/tickets"],["Follow-ups due",l.filter(m=>!!(m.next_follow_up_at&&new Date(m.next_follow_up_at)<=new Date&&!["WON","LOST"].includes(m.pipeline_stage))).length,"/prospects"],["Replies",l.filter(m=>["REPLIED","INTERESTED","NEGOTIATING","WON","LOST"].includes(m.pipeline_stage)).length,"/prospects"],["Deals won",l.filter(m=>m.pipeline_stage==="WON").length,"/pipeline"],["Deals lost",l.filter(m=>m.pipeline_stage==="LOST").length,"/pipeline"],["Revenue",`$${l.reduce((m,g)=>{var v;return m+(g.pipeline_stage==="WON"?Number(((v=g.sales_data)==null?void 0:v.revenue)||0):0)}
163,0).toLocaleString()}`,"/missions"],["Blocked tickets",o.filter(m=>m.status==="BLOCKED").length,"/tickets"],["Failed tickets",o.filter(m=>m.status==="FAILED").length,"/tickets"]];return d.jsxs(d.Fragment,{children:[d.jsx(wn,{title:"Overview",subtitle:"Mission, ticket, and prospect activity from the gateway database",action:d.jsx(Ne,{to:"/missions",className:"btn btn-primary",children:"Create mission"})}),i&&d.jsx("p",{role:"alert",className:"mb-4 text-sm text-red-300",children:i}),n&&!s?d.jsx(Ze,{text:"Loading operationsâ¦"}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:f.map(([m,g,v])=>d.jsxs(Ne,{to:v,className:"card p-4 transition-colors hover:bg-elevated",children:[d.jsx("div",{className:"text-xs text-muted",children:m}),d.jsx("div",{className:"mt-3 text-2xl font-semibold tabular-nums",children:g})]},m))}),d.jsxs("div",{className:"mt-6 grid gap-6 xl:grid-cols-[1.2fr_.8fr]",children:[d.jsx(he,{title:"Live agent status",action:d.jsx(Ne,{to:"/live",className:"text-xs text-muted hover:text-fg",children:"Open live status â"}),children:d.jsx("div",{className:"divide-y divide-line",children:s==null?void 0:s.agents.map(m=>d.jsxs(Ne,{to:`/agents/${m.slug}`,className:"flex items-center justify-between gap-3 px-5 py-3 hover:bg-elevated",children:[d.jsxs("div",{children:[d.jsx("div",{className:"text-sm font-medium",children:m.name}),d.jsx("div",{className:"mt-1 text-xs text-muted",children:m.current_ticket?`${m.current_ticket.ticket_id} · ${m.current_ticket.title}`:m.role})]}),d.jsxs("div",{className:"text-right",children:[d.jsx(Jt,{value:m.live_status}),d.jsxs("div",{className:"mt-1 text-[11px] text-faint",children:["Queue ",m.queue_size]})]})]},m.id))})}),d.jsx(he,{title:"Raj review queue",children:o.filter(m=>["AWAITING_REVIEW","AWAITING_APPROVAL"].includes(m.status)).length?d.jsx("div",{className:"divide-y divide-line",children:o.filter(m=>["AWAITING_REVIEW","AWAITING_APPROVAL"].includes(m.status)).map(m=>{var g;return d.jsxs("div",{className:"flex items-center justify-between gap-3 p-4",children:[d.jsxs("div",{children:[d.jsx(Ri,{ticket:m}),d.jsx("p",{className:"mt-1 text-xs text-muted",children:((g=m.prospect)==null?void 0:g.business_name)||m.title})]}),d.jsx(Jt,{value:m.status})]},m.id)})}):d.jsx(Ze,{text:"Nothing awaits review or approval."})})]}),d.jsx("div",{className:"mt-6",children:d.jsx(he,{title:"Latest activity",action:d.jsx(Ne,{to:"/activity",className:"text-xs text-muted hover:text-fg",children:"All activity â"}),children:d.jsx(Jr,{events:((s==null?void 0:s.events)||[]).slice(0,12)})})}),d.jsxs("div",{className:"mt-4 text-right text-[11px] text-faint",children:["Updated ",s?ki(s.as_of):"â"," ago · refreshes every 4 seconds"]})]})]})}function $T(){const{data:s,error:n}=ct();return d.jsxs(d.Fragment,{children:[d.jsx(wn,{title:"Live status",subtitle:"Current executions and queues, updated from the database every 4 seconds"}),n&&d.jsx("p",{role:"alert",className:"text-red-300",children:n}),d.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s==null?void 0:s.agents.map(i=>{var l,o,h,f,m,g,v,b,y;return d.jsxs(he,{title:i.name,action:d.jsx("div",{className:"flex items-center gap-2",children:d.jsx(Jt,{value:i.live_status})}),children:[d.jsxs("div",{className:"grid gap-4 p-5 sm:grid-cols-2",children:[d.jsxs("div",{className:"space-y-3 text-sm",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-faint",children:"ROLE"}),d.jsx("p",{children:i.role})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-faint",children:"RUNTIME / MODEL"}),d.jsxs("p",{children:[((l=i.profile)==null?void 0:l.provider)||i.provider,(o=i.profile)!=null&&o.model_name?` · ${i.profile.model_name}`:""]})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-faint",children:"CURRENT TICKET"}),d.jsx("p",{children:i.current_ticket?d.jsx(Ne,{className:"font-mono hover:underline",to:`/tickets/${i.current_ticket.ticket_id}`,children:i.current_ticket.ticket_id}):"None"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-faint",children:"CURRENT TASK"}),d.jsx("p",{children:((h=i.current_ticket)==null?void 0:h.progress_label)||((f=i.current_ticket)==null?void 0:f.title)||"Waiting for work"})]})]}),d.jsxs("div",{className:"space-y-3 text-sm",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-faint",children:"PROSPECT / MISSION"}),d.jsx("p",{children:((m=i.current_prospect)==null?void 0:m.business_name)||((g=i.current_mission)==null?void 0:g.name)||"â"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-xs text-faint",children:"ELAPSED"}),d.jsx("p",{children:ki(((v=i.current_ticket)==null?void 0:v.started_at)||((b=i.current_ticket)==null?void 0:b.claimed_at)||null)})]}),d.jsx("div",{className:"grid grid-cols-3 gap-2 pt-1",children:[["Queue",i.queue_size],["Active",i.active_count],["Tickets completed today",i.completed_today],["Failed",i.failed_today],["Review",i.awaiting_review],["Approval",i.awaiting_approval]].map(([w,x])=>d.jsxs("div",{className:"rounded-md border border-line p-2",children:[d.jsx("div",{className:"text-[10px] text-faint",children:w}),d.jsx("div",{className:"mt-1 font-semibold",children:x})]},w))})]})]}),(y=i.current_ticket)!=null&&y.progress_total?d.jsxs("div",{className:"px-5 pb-5",children:[d.jsxs("div",{className:"mb-1 text-xs text-muted",children:["Progress ",i.current_ticket.progress_current||0," / ",i.current_ticket.progress_total]}),d.jsx("progress",{className:"w-full",value:i.current_ticket.progress_current||0,max:i.current_ticket.progress_total})]}):null]},i.id)}),!s&&d.jsx(Ze,{text:"Loading live statusâ¦"})]})]})}function IT({mission:s}){const{actMission:n,deleteMission:i}=ct(),l=Vr(),[o,h]=E.useState(""),[f,m]=E.useState(!1);async function g(b){m(!0),h("");try{await n(s.id,b)}catch(y){h(y.message)}finally{m(!1)}}async function v(){if(window.prompt(`Permanently delete ${s.name} (${s.mission_id}) and all its linked prospects, tickets, results, and history? 164 165Type ${s.mission_id} to confirm.`)===s.mission_id){m(!0),h("");try{await i(s.id),l("/missions")}catch(y){h(y.message),m(!1)}}}return d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(Ne,{to:"/missions",className:"btn",children:"All missions"}),s.status==="ACTIVE"&&d.jsx("button",{className:"btn",disabled:f,onClick:()=>void g("pause"),children:"Pause"}),s.status==="PAUSED"&&d.jsx("button",{className:"btn",disabled:f,onClick:()=>void g("resume"),children:"Resume"}),["ACTIVE","PAUSED"].includes(s.status)&&d.jsx("button",{className:"btn",disabled:f,onClick:()=>void g("complete"),children:"Complete"}),d.jsx("button",{className:"btn btn-danger",disabled:f,onClick:()=>void v(),children:"Delete mission"}),o&&d.jsx("span",{role:"alert",className:"text-xs text-red-300",children:o})]})}function PT({prospect:s}){const{actProspect:n}=ct(),[i,l]=E.useState(""),[o,h]=E.useState(!1);return d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx("span",{className:`badge badge-${s.pipeline_stage.toLowerCase()}`,children:s.pipeline_stage.replaceAll("_"," ")}),["DISQUALIFIED","FILTERED_OUT","LOST","WON"].includes(s.pipeline_stage)&&d.jsx("button",{className:"btn",disabled:o,onClick:async()=>{h(!0),l("");try{await n(s.id,"reactivate")}catch(f){l(f.message)}finally{h(!1)}},children:"Start new workflow"}),i&&d.jsx("span",{role:"alert",className:"text-xs text-red-300",children:i})]})}function GT(){const{data:s,createMission:n}=ct(),i=Vr(),[l,o]=E.useState(!1),[h,f]=E.useState(""),[m,g]=E.useState({name:"",industry:"",targetLocation:"",targetQuantity:"",description:"",minimumGoogleReviews:0,minimumRating:0,requirePhone:!1,excludeFranchises:!1,requirePublicPhotos:!0,minimumPublicPhotos:1,photoCoveragePercent:75,prospectFinderRules:"",researchRules:""});async function v(b){b.preventDefault(),f("");try{await n({name:m.name,description:m.description,industry:m.industry,targetL
165ocation:m.targetLocation,targetQuantity:Number(m.targetQuantity),criteria:{minimumGoogleReviews:Number(m.minimumGoogleReviews),minimumRating:Number(m.minimumRating),requirePhone:m.requirePhone,excludeFranchises:m.excludeFranchises,requirePublicPhotos:m.requirePublicPhotos,minimumPublicPhotos:Number(m.minimumPublicPhotos),photoCoveragePercent:Number(m.photoCoveragePercent),prospectFinderRules:m.prospectFinderRules,researchRules:m.researchRules}}),o(!1),i("/missions")}catch(y){f(y.message)}}return d.jsxs(d.Fragment,{children:[d.jsx(wn,{title:"Missions",subtitle:"Campaign intent set by Raj; each mission creates a discovery ticket",action:d.jsx("button",{className:"btn btn-primary",onClick:()=>o(b=>!b),children:l?"Close form":"Create mission"})}),l&&d.jsx(he,{title:"New mission",children:d.jsxs("form",{onSubmit:v,className:"grid gap-4 p-5 sm:grid-cols-2",children:[d.jsxs("label",{className:"sm:col-span-2",children:["Mission name",d.jsx("input",{required:!0,value:m.name,onChange:b=>g({...m,name:b.target.value}),placeholder:"Campaign name"})]}),d.jsxs("label",{children:["Industry",d.jsx("input",{value:m.industry,onChange:b=>g({...m,industry:b.target.value}),placeholder:"Industry to target"})]}),d.jsxs("label",{children:["Target location",d.jsx("input",{value:m.targetLocation,onChange:b=>g({...m,targetLocation:b.target.value}),placeholder:"City or region"})]}),d.jsxs("label",{children:["Research tickets target",d.jsx("input",{type:"number",min:"1",max:"10000",required:!0,value:m.targetQuantity,onChange:b=>g({...m,targetQuantity:b.target.value})})]}),d.jsxs("label",{children:["Minimum Google reviews",d.jsx("input",{type:"number",min:"0",value:m.minimumGoogleReviews,onChange:b=>g({...m,minimumGoogleReviews:Number(b.target.value)})})]}),d.jsxs("label",{children:["Minimum rating",d.jsx("input",{type:"number",min:"0",max:"5",step:"0.1",value:m.minimumRating,onChange:b=>g({...m,minimumRating:Number(b.target.value)})})]}),d.jsxs("label",{className:"flex items-center gap-2",children:[d.jsx("input",{className:"!w-auto",type:"checkbox",checked:m.requirePhone,onChange:b=>g({...m,requirePhone:b.target.checked})}),"Require phone"]}),d.jsxs("label",{className:"flex items-center gap-2",children:[d.jsx("input",{className:"!w-auto",type:"checkbox",checked:m.excludeFranchises,onChange:b=>g({...m,excludeFranchises:b.target.checked})}),"Exclude franchises"]}),d.jsxs("label",{className:"flex items-center gap-2",children:[d.jsx("input",{className:"!w-auto",type:"checkbox",checked:m.requirePublicPhotos,onChange:b=>g({...m,requirePublicPhotos:b.target.checked})}),"Require public business photos"]}),d.jsxs("label",{children:["Minimum public photos",d.jsx("input",{type:"number",min:"1",max:"1000",value:m.minimumPublicPhotos,onChange:b=>g({...m,minimumPublicPhotos:Number(b.target.value)})})]}),d.jsxs("label",{children:["Photo collection target (%)",d.jsx("input",{type:"number",min:"51",max:"100",value:m.photoCoveragePercent,onChange:b=>g({...m,photoCoveragePercent:Number(b.target.value)})})]}),d.jsx("p",{className:"sm:col-span-2 text-xs text-muted",children:"Discovery must keep going until this many eligible businesses have individual Research tickets. Research should collect at least this percentage of each businessâs publicly accessible photos."}),d.jsxs("label",{className:"sm:col-span-2",children:["Prospect Finder rules",d.jsx("textarea",{rows:3,value:m.prospectFinderRules,onChange:b=>g({...m,prospectFinderRules:b.target.value}),placeholder:"Add mission-specific discovery restrictions"})]}),d.jsxs("label",{className:"sm:col-span-2",children:["ZAFE Research rules",d.jsx("textarea",{rows:3,value:m.researchRules,onChange:b=>g({...m,researchRules:b.target.value}),placeholder:"Add mission-specific research restrictions"})]}),d.jsxs("label",{className:"sm:col-span-2",children:["Description",d.jsx("textarea",{rows:3,value:m.description,onChange:b=>g({...m,description:b.target.value})})]}),h&&d.jsx("p",{role:"alert",className:"text-sm text-red-300 sm:col-span-2",children:h}),d.jsx("button",{className:"btn btn-primary sm:col-span-2",children:"Create mission and discovery ticket"})]})}),d.jsx("div",{className:l?"mt-6":"",children:d.jsx(he,{title:"Campaigns",children:s!=null&&s.missions.length?d.jsx("div",{className:"table-wrap",children:d.jsxs("table",{children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"Mission"}),d.jsx("th",{children:"Target"}),d.jsx("th",{children:"Status"}),d.jsx("th",{children:"Found"}),d.jsx("th",{children:"Research tickets"}),d.jsx("th",{children:"Qualified"}),d.jsx("th",{children:"Demos"}),d.jsx("th",{children:"Won"})]})}),d.jsx("tbody",{children:s.missions.map(b=>{var y,w,x,R,j;return d.jsxs("tr",{children:[d.jsxs("td",{children:[d.jsx(Ne,{className:"font-medium hover:underline",to:`/missions/${b.mission_id}`,children:b.name}),d.jsx("div",{className:"mt-1 font-mono text-xs text-faint",children:b.mission_id})]}),d.jsxs("td",{className:"text-sm text-muted",children:[b.target_quantity," · ",b.industry," · ",b.target_location]}),d.jsx("td",{children:d.jsx(Jt,{value:b.status})}),d.jsx("td",{children:((y=b.stats)==null?void 0:y.found)||0}),d.jsxs("td",{children:[((w=b.stats)==null?void 0:w.researchTickets)||0," / ",b.target_quantity]}),d.jsx("td",{children:((x=b.stats)==null?void 0:x.qualified)||0}),d.jsx("td",{children:((R=b.stats)==null?void 0:R.demos)||0}),d.jsx("td",{children:((j=b.stats)==null?void 0:j.won)||0})]},b.id)})})]})}):d.jsx(Ze,{text:"No missions yet. Create one to open a discovery ticket."})})})]})}function VT(){const{id:s}=xs(),{data:n}=ct(),i=n==null?void 0:n.missions.find(h=>h.id===s||h.mission_id===s),l=(n==null?void 0:n.prospects.filter(h=>h.mission_id===(i==null?void 0:i.id)))||[],o=(n==null?void 0:n.tickets.filter(h=>h.mission_id===(i==null?void 0:i.id)))||[];return i?d.jsxs(d.Fragment,{children:[d.jsx(wn,{title:i.name,subtitle:`${i.mission_id} · ${qe(i.status)}`,action:d.jsx(IT,{mission:i})}),d.jsxs("div",{className:"grid gap-5 xl:grid-cols-[1fr_2fr]",children:[d.jsx(he,{title:"Mission brief",children:d.jsxs("div",{className:"space-y-3 p-5 text-sm",children:[d.jsx("p",{children:i.description||"No description provided."}),d.jsxs("p",{children:[d.jsx("span",{className:"text-muted",children:"Industry:"})," ",i.industry||"â"]}
165),d.jsxs("p",{children:[d.jsx("span",{className:"text-muted",children:"Location:"})," ",i.target_location||"â"]}),d.jsxs("p",{children:[d.jsx("span",{className:"text-muted",children:"Research ticket target:"})," ",i.target_quantity]}),d.jsxs("p",{children:[d.jsx("span",{className:"text-muted",children:"Created:"})," ",Je(i.created_at)]}),d.jsx(Ia,{value:i.criteria})]})}),d.jsx(he,{title:"Campaign funnel",children:d.jsx("div",{className:"grid grid-cols-2 gap-3 p-5 sm:grid-cols-4",children:Object.entries(i.stats||{}).map(([h,f])=>d.jsxs("div",{className:"rounded-md border border-line p-3",children:[d.jsx("div",{className:"text-xs text-faint",children:qe(h)}),d.jsx("div",{className:"mt-2 text-xl font-semibold",children:h==="revenue"?`$${f.toLocaleString()}`:f})]},h))})})]}),d.jsxs("div",{className:"mt-6 grid gap-6 xl:grid-cols-2",children:[d.jsx(he,{title:"Prospects",children:l.length?d.jsx("div",{className:"divide-y divide-line",children:l.map(h=>d.jsxs("div",{className:"flex justify-between gap-3 p-4 text-sm",children:[d.jsxs("div",{children:[d.jsx(Od,{prospect:h}),d.jsx("p",{className:"mt-1 font-mono text-xs text-faint",children:h.prospect_id})]}),d.jsx(Jt,{value:h.pipeline_stage})]},h.id))}):d.jsx(Ze,{text:"Discovery has not produced prospects yet."})}),d.jsx(he,{title:"Mission tickets",children:d.jsx(oa,{tickets:o})})]})]}):d.jsx(Ze,{text:"Mission not found."})}function KT(){const{data:s}=ct(),[n,i]=E.useState(""),[l,o]=E.useState(""),[h,f]=E.useState(""),[m,g]=E.useState(""),[v,b]=E.useState(""),[y,w]=E.useState(""),[x,R]=E.useState(""),[j,N]=E.useState(""),[T,C]=E.useState(""),[B,Q]=E.useState(""),[ee,$]=E.useState(""),G=E.useMemo(()=>((s==null?void 0:s.prospects)||[]).filter(H=>{var ae,ye;return(!n||[H.business_name,H.prospect_id,H.phone,H.email,H.website].some($e=>$e==null?void 0:$e.toLowerCase().includes(n.toLowerCase())))&&(!l||H.pipeline_stage===l)&&(!h||H.mission_id===h)&&(!m||((ae=H.current_agent)==null?void 0:ae.slug)===m)&&(!v||H.qualification_status===v)&&(!y||((ye=H.industry)==null?void 0:ye.toLowerCase().includes(y.toLowerCase())))&&(!x||[H.city,H.state].join(" ").toLowerCase().includes(x.toLowerCase()))&&(!j||H.sales_status===j)&&(!T||T==="demo"&&!!H.demo_url||T==="email"&&!!H.email||T==="phone"&&!!H.phone)&&(!B||H.created_at>=B)&&(!ee||H.created_at.slice(0,10)<=ee)}),[s,n,l,h,m,v,y,x,j,T,B,ee]);return d.jsxs(d.Fragment,{children:[d.jsx(wn,{title:"Prospects",subtitle:"One permanent business record with discovery, research, demo, and sales history"}),d.jsxs("div",{className:"mb-5 grid gap-2 sm:grid-cols-2 lg:grid-cols-6",children:[d.jsx("input",{"aria-label":"Search prospects",placeholder:"Name, ID, phone, email, website",value:n,onChange:H=>i(H.target.value)}),d.jsxs("select",{"aria-label":"Stage",value:l,onChange:H=>o(H.target.value),children:[d.jsx("option",{value:"",children:"All stages"}),Array.from(new Set((s==null?void 0:s.prospects.map(H=>H.pipeline_stage))||[])).map(H=>d.jsx("option",{children:H},H))]}),d.jsxs("select",{"aria-label":"Mission",value:h,onChange:H=>f(H.target.value),children:[d.jsx("option",{value:"",children:"All missions"}),s==null?void 0:s.missions.map(H=>d.jsx("option",{value:H.id,children:H.name},H.id))]}),d.jsxs("select",{"aria-label":"Current agent",value:m,onChange:H=>g(H.target.value),children:[d.jsx("option",{value:"",children:"All agents"}),s==null?void 0:s.agents.map(H=>d.jsx("option",{value:H.slug,children:H.name},H.id))]}),d.jsxs("select",{"aria-label":"Qualification",value:v,onChange:H=>b(H.target.value),children:[d.jsx("option",{value:"",children:"All qualifications"}),d.jsx("option",{children:"QUALIFIED"}),d.jsx("option",{children:"DISQUALIFIED"}),d.jsx("option",{children:"FILTERED_OUT"})]}),d.jsx("input",{"aria-label":"Industry",placeholder:"Industry",value:y,onChange:H=>w(H.target.value)}),d.jsx("input",{"aria-label":"Location",placeholder:"City or state",value:x,onChange:H=>R(H.target.value)}),d.jsxs("select",{"aria-label":"Contact status",value:j,onChange:H=>N(H.target.value),children:[d.jsx("option",{value:"",children:"All contact statuses"}),Array.from(new Set((s==null?void 0:s.prospects.map(H=>
165H.sales_status).filter(Boolean))||[])).map(H=>d.jsx("option",{value:H,children:H},H))]}),d.jsxs("select",{"aria-label":"Has information",value:T,onChange:H=>C(H.target.value),children:[d.jsx("option",{value:"",children:"Any information"}),d.jsx("option",{value:"demo",children:"Has demo"}),d.jsx("option",{value:"email",children:"Has email"}),d.jsx("option",{value:"phone",children:"Has phone"})]}),d.jsx("input",{"aria-label":"Created from",type:"date",value:B,onChange:H=>Q(H.target.value)}),d.jsx("input",{"aria-label":"Created through",type:"date",value:ee,onChange:H=>$(H.target.value)})]}),d.jsx(he,{title:`${G.length} prospects`,children:G.length?d.jsx("div",{className:"table-wrap",children:d.jsxs("table",{children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"Business"}),d.jsx("th",{children:"Location"}),d.jsx("th",{children:"Mission"}),d.jsx("th",{children:"Stage"}),d.jsx("th",{children:"Current agent"}),d.jsx("th",{children:"Ticket"}),d.jsx("th",{children:"Contact"}),d.jsx("th",{children:"Website / demo"}),d.jsx("th",{children:"Rating"})]})}),d.jsx("tbody",{children:G.map(H=>{var ae,ye;return d.jsxs("tr",{children:[d.jsxs("td",{children:[d.jsx(Od,{prospect:H}),d.jsxs("div",{className:"mt-1 font-mono text-xs text-faint",children:[H.prospect_id," · ",H.industry||"â"]})]}),d.jsx("td",{className:"text-sm",children:[H.city,H.state].filter(Boolean).join(", ")||"â"}),d.jsx("td",{className:"text-xs",children:((ae=H.mission)==null?void 0:ae.name)||"â"}),d.jsx("td",{children:d.jsx(Jt,{value:H.pipeline_stage})}),d.jsx("td",{className:"text-xs",children:((ye=H.current_agent)==null?void 0:ye.name)||"â"}),d.jsx("td",{children:H.current_ticket?d.jsx(Ri,{ticket:H.current_ticket}):"â"}),d.jsx("td",{className:"text-xs",children:H.phone||H.email||"â"}),d.jsx("td",{className:"text-xs",children:H.demo_url?d.jsx("a",{href:H.demo_url,target:"_blank",rel:"noreferrer",className:"text-blue-300",children:"Demo â"}):H.website?d.jsx("a",{href:H.website,target:"_blank",rel:"noreferrer",className:"text-blue-300",children:"Website â"}):"â"}),d.jsxs("td",{className:"text-xs",children:[H.google_rating||"â"," (",H.google_review_count||0,")"]})]},H.id)})})]})}):d.jsx(Ze,{text:"No prospects match the filters."})})]})}function YT({prospect:s}){return d.jsxs("dl",{className:"min-w-0",children:[d.jsx(ge,{name:"Website",value:s.website,href:s.website||void 0}),d.jsx(ge,{name:"Facebook",value:s.facebook_url,href:s.facebook_url||void 0}),d.jsx(ge,{name:"Instagram",value:s.instagram_url,href:s.instagram_url||void 0}),d.jsx(ge,{name:"LinkedIn",value:s.linkedin_url,href:s.linkedin_url||void 0}),d.jsx(ge,{name:"Google Business",value:s.google_business_url,href:s.google_business_url||void 0})]})}function JT(){var v;const{id:s}=xs(),{data:n}=ct(),i=n==null?void 0:n.prospects.find(b=>b.id===s||b.prospect_id===s);if(!i)return d.jsx(Ze,{text:"Prospect not found."});const l=(n==null?void 0:n.tickets.filter(b=>b.prospect_id===i.id))||[],o=(n==null?void 0:n.events.filter(b=>b.prospect_id===i.id))||[],h=(n==null?void 0:n.artifacts.filter(b=>b.prospect_id===i.id))||[],f=(n==null?void 0:n.communications.filter(b=>b.prospect_id===i.id))||[],m=(v=l.find(b=>b.ticket_type==="LEAD_RESEARCH"))==null?void 0:v.source_ticket_id,g=n==null?void 0:n.tickets.find(b=>b.id===m);return d.jsxs(d.Fragment,{children:[d.jsx(wn,{title:i.business_name,subtitle:`${i.prospect_id} · ${i.industry||"Business"} · ${[i.city,i.state].filter(Boolean).join(", ")}`,action:d.jsx(PT,{prospect:i})}),d.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,2fr)_minmax(300px,1fr)]",children:[d.jsxs("div",{className:"space-y-6",children:[d.jsx(he,{title:"Business overview",children:d.jsxs("div",{className:"grid gap-5 p-5 sm:grid-cols-2",children:[d.jsxs("dl",{className:"min-w-0",children:[d.jsx(ge,{name:"Description",value:i.business_description}),d.jsx(ge,{name:"Address",value:[i.address,i.city,i.state,i.zip_code].filter(Boolean).join(", ")}),d.jsx(ge,{name:"Phone",value:i.phone}),d.jsx(ge,{name:"Email",value:i.email}),d.jsx(ge,{name:"Contact",value:[i.contact_name,i.contact_title].filter(
165Boolean).join(" · ")}),d.jsx(ge,{name:"Lead source",value:i.lead_source}),d.jsx(ge,{name:"Google rating",value:i.google_rating}),d.jsx(ge,{name:"Reviews",value:i.google_review_count})]}),d.jsx(YT,{prospect:i})]})}),d.jsx(he,{title:"Discovery",children:d.jsxs("div",{className:"space-y-3 p-5 text-sm",children:[d.jsxs("p",{children:["Source ticket: ",g?d.jsx(Ri,{ticket:g}):"â"]}),d.jsxs("p",{children:["Initial website quality: ",d.jsx(Jt,{value:i.website_quality})]}),d.jsx(Ia,{value:i.discovery_data})]})}),d.jsx(he,{title:"Deep research",children:d.jsxs("div",{className:"space-y-3 p-5 text-sm",children:[d.jsxs("p",{children:["Qualification: ",i.qualification_status||"Pending"]}),d.jsxs("p",{children:["Reason: ",i.qualification_reason||"â"]}),d.jsx(Ia,{value:i.research_data})]})}),d.jsx(he,{title:"Demo",children:d.jsxs("div",{className:"space-y-3 p-5 text-sm",children:[d.jsxs("p",{children:["Demo URL: ",i.demo_url?d.jsx("a",{className:"text-blue-300 hover:underline",href:i.demo_url,target:"_blank",rel:"noreferrer",children:i.demo_url}):"â"]}),d.jsx(Ia,{value:i.demo_data})]})}),d.jsxs(he,{title:"Outreach and sales",children:[d.jsxs("div",{className:"space-y-3 p-5 text-sm",children:[d.jsxs("p",{children:["Sales status: ",i.sales_status||"â"]}),d.jsxs("p",{children:["Last contact: ",Je(i.last_contact_at)]}),d.jsxs("p",{children:["Next follow-up: ",Je(i.next_follow_up_at)]}),d.jsx(Ia,{value:i.sales_data})]}),f.length?d.jsx("div",{className:"divide-y divide-line border-t border-line",children:f.map(b=>d.jsxs("div",{className:"p-4 text-sm",children:[d.jsxs("span",{className:"text-xs text-muted",children:[b.direction," · ",b.channel," · ",b.status," · ",Je(b.created_at)]}),d.jsx("p",{className:"mt-2 whitespace-pre-wrap",children:b.body})]},b.id))}):d.jsx(Ze,{text:"No communications recorded."})]}),d.jsx(he,{title:"Artifacts",children:d.jsxs("div",{className:"divide-y divide-line",children:[h.map(b=>d.jsxs("div",{className:"p-4 text-sm",children:[d.jsx("span",{className:"text-xs text-faint",children:qe(b.artifact_type)}),d.jsx("p",{children:b.url?d.jsxs("a",{href:b.url,target:"_blank",rel:"noreferrer",className:"text-blue-300 hover:underline",children:[b.name," â"]}):b.name})]},b.id)),!h.length&&d.jsx(Ze,{text:"No artifacts yet."})]})}),d.jsx(he,{title:"All tickets",children:d.jsx(oa,{tickets:l})}),d.jsx(he,{title:"Activity",children:d.jsx(Jr,{events:o})})]}),d.jsxs("div",{className:"space-y-6",children:[d.jsx(he,{title:"Current assignment",children:d.jsxs("div",{className:"p-5 text-sm",children:[d.jsxs("p",{children:["Agent: ",i.current_agent?d.jsx(Ne,{className:"hover:underline",to:`/agents/${i.current_agent.slug}`,children:i.current_agent.name}):"â"]}),d.jsxs("p",{className:"mt-3",children:["Ticket: ",i.current_ticket?d.jsx(Ri,{ticket:i.current_ticket}):"â"]}),d.jsxs("p",{className:"mt-3",children:["Mission: ",i.mission?d.jsx(Ne,{className:"hover:underline",to:`/missions/${i.mission.mission_id}`,children:i.mission.name}):"â"]})]})}),d.jsx(he,{title:"Record details",children:d.jsxs("dl",{className:"px-5",children:[d.jsx(ge,{name:"Priority",value:qe(i.priority)}),d.jsx(ge,{name:"Created",value:Je(i.created_at)}),d.jsx(ge,{name:"Updated",value:Je(i.updated_at)}),d.jsx(ge,{name:"Qualification",value:i.qualification_status}),d.jsx(ge,{name:"Sales status",value:i.sales_status})]})})]})]})]})}const QT=[["New",["NEW"]],["Discovered",["DISCOVERED","FILTERED_OUT"]],["Researching",["RESEARCH_QUEUED","RESEARCHING"]],["Qualified",["QUALIFIED","DEMO_QUEUED"]],["Building demo",["DEMO_BUILDING"]],["Demo review",["DEMO_REVIEW"]],["Ready for outreach",["READY_FOR_OUTREACH","OUTREACH_DRAFTING","OUTREACH_APPROVAL"]],["Contacted",["CONTACTED"]],["Follow-up",["FOLLOW_UP"]],["Replied",["REPLIED","INTERESTED"]],["Negotiating",["NEGOTIATING"]],["Won",["WON"]],["Lost",["LOST"]]];function XT(){const{data:s}=ct(),[n,i]=E.useState(""),l=((s==null?void 0:s.prospects)||[]).filter(o=>!n||o.mission_id===n);return d.jsxs(d.Fragment,{children:[d.jsx(wn,{title:"Pipeline",subtitle:"Prospects move as ticket actions change their database stage",action:d.jsxs("select",{className:"max-w-64","aria-label":"Mission",value:n,onChange:o=>i(o.target.value),children:[d.jsx("option",{value:"",children:"All missions"}),s==null?void 0:s.missions.map(o=>d.jsx("option",{value:o.id,children:o.name},o.id))]})}),d.jsx("div",{className:"table-wrap pb-4",children:d.jsx("div",{className:"flex min-w-max gap-3",children:QT.map(([o,h])=>d.jsxs("section",{className:"w-60 shrink-0 rounded-lg border border-line bg-surface/70",children:[d.jsxs("div",{className:"flex justify-between border-b border-line p-3 text-xs font-semibold uppercase tracking-wide",children:[d.jsx("span",{children:o}),d.jsx("span",{className:"text-faint",children:l.filter(f=>h.includes(f.pipeline_stage)).length})]}),d.jsx("div",{className:"min-h-32 space-y-2 p-2",children:l.filter(f=>h.includes(f.pipeline_stage)).map(f=>{var m,g;return d.jsxs(Ne,{to:`/prospects/${f.prospect_id}`,className:"block rounded border border-line bg-elevated p-3 hover:border-line-strong",children:[d.jsx("p",{className:"text-sm font-medium",children:f.business_name}),d.jsx("p",{className:"mt-1 font-mono text-[11px] text-faint",children:f.prospect_id}),d.jsxs("div",{className:"mt-3 flex justify-between gap-2 text-[11px] text-muted",children:[d.jsx("span",{children:((m=f.current_agent)==null?void 0:m.name)||"Unassigned"}),d.jsx("span",{children:((g=f.current_ticket)==null?void 0:g.ticket_id)||"â"})]}),d.jsxs("p",{className:"mt-2 text-[11px] text-faint",children:[qe(f.pipeline_stage)," · ",qe(f.priority)]})]},f.id)})})]},o))})})]})}const fy=new Set(["IMAGE","LOGO","BUSINESS_PHOTO","SCREENSHOT"]),ZT=["businessPhotos","business_photos","photos","images","galleryImages","gallery_images"],FT=["logoUrl","logoURL","logoSource","logo_url","logo"],WT=["desktopScreenshot","mobileScreenshot","mockupImage","screenshot"];
165function my(s){if(typeof s!="string")return null;try{const n=new URL(s);return["https:","http:"].includes(n.protocol)?n.href:null}catch{return null}}function eR(s){if(typeof s=="string")return my(s);if(!s||typeof s!="object"||Array.isArray(s))return null;const n=s;return my(n.url??n.src??n.imageUrl??n.photoUrl)}function p0(s,n){var m,g,v,b;const i=[],l=new Set,o=(y,w,x,R)=>{const j=eR(y);j&&!l.has(j)&&(l.add(j),i.push({url:j,name:w,kind:x,source:R}))},h=(y,w)=>{if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;for(const R of FT)o(x[R],"Business logo","logo",w);for(const R of ZT){const j=x[R];Array.isArray(j)&&j.forEach((N,T)=>o(N,`Business photo ${T+1}`,"photo",w))}for(const R of WT)o(x[R],R==="mobileScreenshot"?"Mobile screenshot":"Demo screenshot","screenshot",w)};h((m=s.input_data)==null?void 0:m.research,"Research"),h(((g=s.input_data)==null?void 0:g.prospect)&&s.input_data.prospect.research_data,"Prospect research"),h((v=s.prospect)==null?void 0:v.research_data,"Prospect research"),h(s.input_data,"Ticket input"),h(s.output_data,"Ticket output");for(const y of n)fy.has(y.artifact_type)&&o(y.url,y.name,y.artifact_type==="LOGO"?"logo":y.artifact_type==="SCREENSHOT"?"screenshot":"photo","Artifact");const f=(b=s.input_data)==null?void 0:b.artifacts;if(Array.isArray(f))for(const y of f){if(!y||typeof y!="object")continue;const w=y;fy.has(String(w.artifact_type??w.artifactType??w.type))&&o(w.url,String(w.name??"Business photo"),"photo","Research artifact")}return i}function tR({image:s}){const[n,i]=E.useState(!1);return d.jsxs("figure",{className:"overflow-hidden rounded-lg border border-line bg-elevated",children:[d.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer",className:"block","aria-label":`Open ${s.name}`,children:n?d.jsx("div",{className:"flex aspect-[4/3] items-center justify-center p-4 text-center text-xs text-muted",children:"Preview unavailable · Open original"}):d.jsx("img",{src:s.url,alt:s.name,loading:"lazy",onError:()=>i(!0),className:`aspect-[4/3] w-full object-contain ${s.kind==="logo"?"p-5":""}`})}),d.jsxs("figcaption",{className:"flex items-center justify-between gap-2 px-3 py-2 text-xs",children:[d.jsx("span",{className:"truncate",children:s.name}),d.jsx("span",{className:"shrink-0 text-faint",children:s.source})]})]})}function nR({ticket:s,artifacts:n}){const i=p0(s,n);return d.jsx(he,{title:`Business photos & images${i.length?` · ${i.length}`:""}`,children:i.length?d.jsx("div",{className:"grid gap-3 p-4 sm:grid-cols-2 lg:grid-cols-3",children:i.map(l=>d.jsx(tR,{image:l},l.url))}):d.jsx(Ze,{text:"No photo URLs have been recorded for this ticket yet. Add a Business photo, Logo, or Screenshot artifact below."})})}function aR({ticket:s,artifacts:n}){var o;const i=p0(s,n),l=i.find(h=>h.kind==="photo")??i[0];return l?d.jsx("img",{src:l.url,alt:`${((o=s.prospect)==null?void 0:o.business_name)??s.title} preview`,loading:"lazy",className:"mt-3 aspect-[16/9] w-full rounded border border-line bg-canvas object-cover",onError:h=>{h.currentTarget.style.display="none"}}):null}function sR({ticket:s}){const{data:n,act:i,amendResearchMedia:l}=ct(),[o,h]=E.useState(""),[f,m]=E.useState(""),[g,v]=E.useState(""),[b,y]=E.useState(""),[w,x]=E.useState(!1),[R,j]=E.useState(!1),[N,T]=E.useState(""),C=n==null?void 0:n.tickets.find($=>$.ticket_type==="DEMO_BUILD"&&$.prospect_id===s.prospect_id&&$.status!=="CANCELLED"),B=s.output_data.qualifiedForDemo===!0;async function Q($){$.preventDefault(),j(!0),T("");try{await i(s.id,{action:"repair_demo_handoff"}),T("Gateway created the missing Demo ticket for Ritwik.")}catch(G){T(G.message)}finally{j(!1)}}async function ee($){$.preventDefault(),x(!0),y("");try{const G=o.split(/\r?\n/).map(ae=>ae.trim()).filter(Boolean).map((ae,ye)=>({url:ae,name:`Business photo ${ye+1}`,...f.trim()?{sourcePage:f.trim()}:{}})),H=await l(s.id,{photos:G,note:g.trim()||void 0});y(`${H.added} photo${H.added===1?"":"s"} added to this research ticket and its demo input.`),h(""),v("")}catch(G){y(G.message)}finally{x(!1)}}return d.jsxs(d.Fragment,{children:[d.jsxs("section",{className:"space-y-3 border-t border-line pt-4","aria-label":"Research handoff",children:[d.jsx("h3",{className:"text-sm font-semibold",children:"Research decision"}),d.jsx("p",{className:"text-sm",children:B?"Research recommends a demo":"Research does not recommend a demo"}),!B&&d.jsx("p",{className:"text-xs text-muted",children:String(s.output_data.qualificationReason||"No qualification reason was supplied.")}),C?d.jsxs("p",{className:"text-xs text-muted",children:["Next ticket: ",d.jsxs(Ne,{className:"text-blue-300 hover:underline",to:`/tickets/${C.ticket_id}`,children:[C.ticket_id," · Ritwik"]})]}):d.jsxs("form",{onSubmit:Q,className:"space-y-2",children:[d.jsx("p",{className:"text-xs text-muted",children:"Gateway should have created a Demo ticket when Research f
165inished. Repair the missing handoff while keeping the original result."}),d.jsx("button",{className:"btn",disabled:R,children:"Repair missing Demo ticket"})]}),N&&d.jsx("p",{role:"status",className:"text-xs text-muted",children:N})]}),d.jsxs("form",{onSubmit:ee,className:"space-y-3 border-t border-line pt-4",children:[d.jsx("h3",{className:"text-sm font-semibold",children:"Add photos to completed research"}),d.jsx("p",{className:"text-xs text-muted",children:"Paste direct public image URLs, one per line. This updates the existing demo ticket and keeps this ticketâs completion history."}),d.jsxs("label",{children:["Photo URLs",d.jsx("textarea",{required:!0,rows:5,className:"font-mono",value:o,onChange:$=>h($.target.value),placeholder:"https://business.example/photos/project.jpg"})]}),d.jsxs("label",{children:["Source page",d.jsx("input",{type:"url",value:f,onChange:$=>m($.target.value),placeholder:"https://business.example/gallery/"})]}),d.jsxs("label",{children:["Amendment note",d.jsx("input",{value:g,onChange:$=>v($.target.value),placeholder:"Photos from the business gallery"})]}),d.jsx("button",{className:"btn btn-primary",disabled:w||!o.trim(),children:"Save photos"}),b&&d.jsx("p",{role:"status",className:"text-xs text-muted",children:b})]})]})}function iR({tickets:s}){return s.length?d.jsx("div",{className:"table-wrap",children:d.jsxs("table",{children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"Ticket"}),d.jsx("th",{children:"Type"}),d.jsx("th",{children:"Prospect"}),d.jsx("th",{children:"Mission"}),d.jsx("th",{children:"Agent"}),d.jsx("th",{children:"Status"}),d.jsx("th",{children:"Priority"}),d.jsx("th",{children:"Created"}),d.jsx("th",{children:"Assigned"}),d.jsx("th",{children:"Started"}),d.jsx("th",{children:"Duration"}),d.jsx("th",{children:"Updated"}),d.jsx("th",{children:"Completed"})]})}),d.jsx("tbody",{children:s.map(n=>{var i,l,o;return d.jsxs("tr",{children:[d.jsx("td",{children:d.jsx(Ri,{ticket:n})}),d.jsx("td",{className:"whitespace-nowrap text-xs",children:qe(n.ticket_type)}),d.jsx("td",{className:"text-sm",children:((i=n.prospect)==null?void 0:i.business_name)||"Batch"}),d.jsx("td",{className:"text-xs",children:((l=n.mission)==null?void 0:l.name)||"â"}),d.jsx("td",{className:"text-xs",children:((o=n.agent)==null?void 0:o.name)||"â"}),d.jsx("td",{children:d.jsx(Jt,{value:n.status})}),d.jsx("td",{className:"text-xs",children:qe(n.priority)}),d.jsx("td",{className:"whitespace-nowrap text-xs text-muted",children:Je(n.created_at)}),d.jsx("td",{className:"whitespace-nowrap text-xs text-muted",children:Je(n.assigned_at)}),d.jsx("td",{className:"whitespace-nowrap text-xs text-muted",children:Je(n.started_at)}),d.jsx("td",{className:"text-xs",children:n.started_at?ki(n.started_at):"â"}),d.jsx("td",{className:"whitespace-nowrap text-xs text-muted",children:Je(n.updated_at)}),d.jsx("td",{className:"whitespace-nowrap text-xs text-muted",children:Je(n.completed_at)})]},n.id)})})]})}):d.jsx(Ze,{text:"No tickets match the filters."})}const gy=["BACKLOG","READY","CLAIMED","IN_PROGRESS","AWAITING_REVIEW","AWAITING_APPROVAL","BLOCKED","FAILED","DONE"],v0=s=>s==="PROSPECT_DISCOVERY"?"JSON with a prospectsDiscovered array":s==="LEAD_RESEARCH"?"JSON with qualifiedForDemo (true or false) and research findings":s==="DEMO_BUILD"?"JSON with deploymentUrl and build details":"JSON with at least one outreach draft";function rR(){const{data:s}=ct(),[n,i]=E.useState("kanban"),[l,o]=E.useState(""),[h,f]=E.useState(""),[m,g]=E.useState(""),[v,b]=E.useState(""),[y,w]=E.useState(""),[x,R]=E.useState(""),[j,N]=E.useState(""),[T,C]=E.useState(""),[B,Q]=E.useState(""),ee=E.useMemo(()=>((s==null?void 0:s.tickets)||[]).filter($=>{var G,H,ae;return(!l||((G=$.agent)==null?void 0:G.slug)===l)&&(!h||$.ticket_type===h)&&(!m||$.status===m)&&(!v||$.mission_id===v)&&(!y||$.priority===y)&&(!x||$.prospect_id===x)&&(!j||$.created_at>=j)&&(!T||$.created_at.slice(0,10)<=T)&&(!B||[$.ticket_id,$.title,(H=$.prospect)==null?void 0:H.business_name,(ae=$.mission)==null?void 0:ae.name].some(ye=>ye==null?void 0:ye.toLowerCase().includes(B.toLowerCase())))}),[s,l,h,m,v,y,x,j,T,B]);return d.jsxs(d.Fragment,{children:[d.jsx(wn,{title:"Tickets",subtitle:"Every agent job, with a live board and full history",action:d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{className:`btn ${n==="kanban"?"btn-primary":""}`,onClick:()=>i("kanban"),children:"Kanban"}),d.jsx("button",{className:`btn ${n==="table"?"btn-primary":""}`,onClick:()=>i("table"),children:"Table"})]})}),d.jsxs("div",{className:"mb-5 grid gap-2 sm:grid-cols-3 lg:grid-cols-6",children:[d.jsx("input",{"aria-label":"Search tickets",placeholder:"Search tickets",value:
165B,onChange:$=>Q($.target.value)}),d.jsxs("select",{"aria-label":"Filter by agent",value:l,onChange:$=>o($.target.value),children:[d.jsx("option",{value:"",children:"All agents"}),s==null?void 0:s.agents.map($=>d.jsx("option",{value:$.slug,children:$.name},$.id))]}),d.jsxs("select",{"aria-label":"Filter by type",value:h,onChange:$=>f($.target.value),children:[d.jsx("option",{value:"",children:"All types"}),["PROSPECT_DISCOVERY","LEAD_RESEARCH","DEMO_BUILD","OUTREACH"].map($=>d.jsx("option",{children:$},$))]}),d.jsxs("select",{"aria-label":"Filter by status",value:m,onChange:$=>g($.target.value),children:[d.jsx("option",{value:"",children:"All statuses"}),gy.map($=>d.jsx("option",{children:$},$))]}),d.jsxs("select",{"aria-label":"Filter by mission",value:v,onChange:$=>b($.target.value),children:[d.jsx("option",{value:"",children:"All missions"}),s==null?void 0:s.missions.map($=>d.jsx("option",{value:$.id,children:$.name},$.id))]}),d.jsxs("select",{"aria-label":"Filter by priority",value:y,onChange:$=>w($.target.value),children:[d.jsx("option",{value:"",children:"All priorities"}),["LOW","NORMAL","HIGH","URGENT"].map($=>d.jsx("option",{children:$},$))]}),d.jsxs("select",{"aria-label":"Filter by prospect",value:x,onChange:$=>R($.target.value),children:[d.jsx("option",{value:"",children:"All prospects"}),s==null?void 0:s.prospects.map($=>d.jsx("option",{value:$.id,children:$.business_name},$.id))]}),d.jsx("input",{"aria-label":"Created from",type:"date",value:j,onChange:$=>N($.target.value)}),d.jsx("input",{"aria-label":"Created through",type:"date",value:T,onChange:$=>C($.target.value)})]}),n==="table"?d.jsx(he,{title:`${ee.length} tickets`,children:d.jsx(iR,{tickets:ee})}):d.jsx("div",{className:"table-wrap pb-4",children:d.jsx("div",{className:"flex min-w-max gap-3",children:gy.map($=>d.jsxs("section",{className:"w-64 shrink-0 rounded-lg border border-line bg-surface/70",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3 text-xs font-semibold uppercase tracking-wide",children:[d.jsx("span",{children:qe($)}),d.jsx("span",{className:"rounded bg-elevated px-2 py-0.5 text-faint",children:ee.filter(G=>G.status===$).length})]}),d.jsx("div",{className:"min-h-36 space-y-2 p-2",children:ee.filter(G=>G.status===$).map(G=>{var H,ae,ye;return d.jsxs(Ne,{to:`/tickets/${G.ticket_id}`,className:"block rounded-md border border-line bg-elevated p-3 transition-colors hover:border-line-strong",children:[d.jsxs("div",{className:"flex justify-between gap-2",children:[d.jsx("span",{className:"font-mono text-xs font-semibold",children:G.ticket_id}),d.jsx("span",{className:"text-[10px] text-faint",children:ki(G.status_changed_at)})]}),d.jsx("div",{className:"mt-2 text-sm font-medium",children:((H=G.prospect)==null?void 0:H.business_name)||G.title}),d.jsx("div",{className:"mt-1 text-xs text-muted",children:qe(G.ticket_type)}),G.ticket_type==="DEMO_BUILD"&&d.jsx(aR,{ticket:G,artifacts:(s==null?void 0:s.artifacts.filter($e=>$e.ticket_id===G.id))||[]}),d.jsx("div",{className:"mt-1 truncate text-[11px] text-faint",children:((ae=G.mission)==null?void 0:ae.name)||"â"}),d.jsxs("div",{className:"mt-3 flex justify-between gap-2 border-t border-line pt-2 text-[11px] text-faint",children:[d.jsx("span",{children:(ye=G.agent)==null?void 0:ye.name}),d.jsx("span",{children:qe(G.priority)})]}),G.progress_label&&d.jsx("p",{className:"mt-2 truncate text-[11px] text-muted",children:G.progress_label})]},G.id)})})]},$))})})]})}function td({ticket:s,action:n,labelText:i,body:l}){const{act:o}=ct(),[h,f]=E.useState(!1),[m,g]=E.useState("");return d.jsxs("span",{className:"inline-flex flex-col gap-1",children:[d.jsx("button",{className:"btn",disabled:h,onClick:async()=>{f(!0),g("");try{await o(s.id,{action:n,...l})}catch(v){g(v.message)}finally{f(!1)}},children:i}),m&&d.jsx("span",{role:"alert",className:"max-w-60 text-xs text-red-300",children:m})]})}function py(){var Qe,ht,xt;const{id:s}=xs(),{data:n,act:i,addArtifact:l}=ct(),o=n==null?void 0:n.tickets.find(K=>K.id===s||K.ticket_id===s),[h,f]=E.useState(""),[m,g]=E.useState(""),[v,b]=E.useState(""),[y,w]=E.useState(""),[x,R]=E.useState(""),[j,N]=E.useState(!1),[T,C]=E.useState(""),[B,Q]=E.useState("URL");if(!o)return d.jsx(Ze,{text:"Ticket not found."});const ee=(n==null?void 0:n.events.filter(K=>K.ticket_id===o.id))||[],$=(n==null?void 0:n.executions.filter(K=>K.ticket_id===o.id))||[],G=(n==null?void 0:n.artifacts.filter(K=>K.ticket_id===o.id))||[],H=(n==null?void 0:n.tickets.filter(K=>K.source_ticket_id===o.id||K.parent_ticket_id===o.id))||[];async function ae(K,q={}){N(!0),R("");try{await i(o.id,{action:K,...q})}catch(Z){R(Z.message)}finally{N(!1)}}async function ye(K){K.preventDefault();try{await ae("complete",{output:JSON.parse(h)})}catch(q){R(q.message)}}async function $e(K){K.preventDefault(),R("");try{await l({artifactType:B,name:`${qe(B)} for ${o.ticket_id}`,url:T,ticketId:o.id,prospectId:o.prospect_id||void 0,missionId:o.mission_id||void 0,agentId:o.assigned_agent_id}),C("")}catch(q){R(q.message)}}return d.jsxs(d.Fragment,{children:[d.jsx(wn,{title:o.ticket_id,subtitle:o.title,action:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Jt,{value:o.status}),d.jsx(Jt,{value:o.priority})]})}),x&&d.jsx("p",{role:"alert",className:"mb-4 rounded border border-red-900 p-3 text-sm text-red-300",children:x}),d.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,2fr)_minmax(300px,1fr)]",children:[d.jsxs("div",{className:"space-y-6",children:[d.jsx(he,{title:"Work item",children:d.jsxs("div",{className:"space-y-4 p-5 text-sm",children:[d.jsx("p",{children:o.description}),d.jsxs("div",{className:"flex flex-wrap gap-4 text-muted",children:[d.jsxs("span",{children:["Type: ",qe(o.ticket_type)]}),d.jsxs("span",{children:["Agent: ",d.jsx(Ne,{to:`/agents/${(Qe=o.agent)==null?void 0:Qe.slug}`,className:"text-fg hover:underline",children:(ht=o.agent)==null?void 0:ht.name})]}),o.prospect&&d.jsxs("span",{children:["Prospect: ",d.jsx(Ne,{to:`/prospects/${o.prospect.prospect_id}`,className:"text-fg hover:underline",children:o.prospect.business_name})]}),o.mission&&d.jsxs("span",{children:["Mission: ",d.jsx(Ne,{to:`/missions/${o.mission.mission_id}`,className:"text-fg hover:underline",children:o.mission.name})]})]})]})}),["DEMO_BUILD","LEAD_RESEARCH"].includes(o.ticket_type)&&d.jsx(nR,{ticket:o,artifacts:G}),d.jsx(he,{title:"Input data",children:d.jsx("div",{className:"p-5",children:d.jsx(Ia,{value:o.input_data})})}),d.jsx(he,{title:"Output and progress",children:d.jsxs("div",{className:"space-y-4 p-5",children:[o.progress_label&&d.jsxs("div",{className:"text-sm",children:[o.progress_label,o.progress_total?` · ${o.progress_current||0} / ${o.progress_total}`:""]}),d.jsx(Ia,{value:o.output_data})]})}),d.jsxs(he,{title:"Artifacts",children:[d.jsxs("div",{className:"divide-y divide-line",children:[G.map(K=>d.jsxs("div",{className:"p-4 text-sm",children:[d.jsx("span",{className:"text-xs text-muted",children:qe(K.artifact_type)}),d.jsx("p",{className:"mt-1",children:K.url?d.jsx("a",{className:"text-blue-300 hover:underline",target:"_blank",rel:"noreferrer",href:K.url,children:K.name}):K.name})]},K.id)),!G.length&&d.jsx(Ze,{text:"No artifacts yet."})]}),d.jsxs("form",{onSubmit:$e,className:"flex flex-wrap gap-2 border-t border-line p-4",children:[d.jsx("select",{className:"max-w-40",value:
165B,onChange:K=>Q(K.target.value),children:["URL","DEMO_URL","REPOSITORY","SCREENSHOT","LOGO","BUSINESS_PHOTO","BUILD_LOG","DOCUMENT","OTHER"].map(K=>d.jsx("option",{children:K},K))}),d.jsx("input",{required:!0,type:"url",className:"min-w-40 flex-1",placeholder:"https://â¦",value:T,onChange:K=>C(K.target.value)}),d.jsx("button",{className:"btn",children:"Add artifact"})]})]}),d.jsx(he,{title:"Execution history",children:$.length?d.jsxs("div",{className:"table-wrap",children:[d.jsxs("table",{children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"Attempt"}),d.jsx("th",{children:"Status"}),d.jsx("th",{children:"Model"}),d.jsx("th",{children:"Tokens"}),d.jsx("th",{children:"Duration"}),d.jsx("th",{children:"Error"})]})}),d.jsx("tbody",{children:$.map((K,q)=>d.jsxs("tr",{children:[d.jsx("td",{children:q+1}),d.jsx("td",{children:d.jsx(Jt,{value:K.status})}),d.jsxs("td",{className:"text-xs",children:[K.provider," ",K.model]}),d.jsx("td",{children:(K.input_tokens||0)+(K.output_tokens||0)}),d.jsx("td",{children:K.duration_ms?`${Math.round(K.duration_ms/1e3)}s`:"â"}),d.jsx("td",{className:"text-xs text-red-300",children:K.error||"â"})]},K.id))})]}),d.jsx("div",{className:"divide-y divide-line border-t border-line",children:$.map((K,q)=>d.jsxs("details",{className:"p-4",children:[d.jsxs("summary",{className:"cursor-pointer text-sm",children:["Attempt ",q+1," output · ",qe(K.status)]}),d.jsx("div",{className:"mt-3",children:d.jsx(Ia,{value:K.output_data})})]},K.id))})]}):d.jsx(Ze,{text:"No executions yet."})}),d.jsx(he,{title:"Activity timeline",children:d.jsx(Jr,{events:ee})})]}),d.jsxs("div",{className:"space-y-6",children:[d.jsx(he,{title:"Actions",children:d.jsxs("div",{className:"space-y-4 p-5",children:[d.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.status==="READY"&&d.jsx("button",{className:"btn btn-primary",disabled:j,onClick:()=>void ae("claim"),children:"Claim ticket"}),o.status==="CLAIMED"&&d.jsx("button",{className:"btn btn-primary",disabled:j,onClick:()=>void ae("start"),children:"Start work"}),o.status==="AWAITING_REVIEW"&&d.jsxs(d.Fragment,{children:[d.jsx("button",{className:"btn btn-primary",disabled:j,onClick:()=>void ae("approve_demo",{reviewedBy:"Raj",notes:y}),children:"Approve demo"}),d.jsx("button",{className:"btn",disabled:j||!y.trim(),onClick:()=>void ae("reject_demo",{reviewedBy:"Raj",notes:y}),children:"Request revision"})]}),o.status==="AWAITING_APPROVAL"&&d.jsxs(d.Fragment,{children:[d.jsx("button",{className:"btn btn-primary",disabled:j,onClick:()=>void ae("approve_outreach",{reviewedBy:"Raj",notes:y}),children:"Approve outreach draft"}),d.jsx("button",{className:"btn",disabled:j||!y.trim(),onClick:()=>void ae("reject_outreach",{reviewedBy:"Raj",notes:y}),children:"Request draft revision"})]}),["FAILED","BLOCKED"].includes(o.status)&&d.jsx(td,{ticket:o,action:"retry",labelText:"Retry ticket"}),!["DONE","CANCELLED","BLOCKED"].includes(o.status)&&d.jsx(td,{ticket:o,action:"block",labelText:"Block ticket",body:{reason:"Blocked by Raj"}}),!["DONE","CANCELLED"].includes(o.status)&&d.jsx(td,{ticket:o,action:"cancel",labelText:"Cancel ticket"})]}),o.ticket_type==="LEAD_RESEARCH"&&o.status==="DONE"&&d.jsx(sR,{ticket:o}),["AWAITING_REVIEW","AWAITING_APPROVAL"].includes(o.status)&&d.jsxs("label",{children:["Review notes",d.jsx("textarea",{rows:3,value:y,onChange:K=>w(K.target.value)})]}),o.status==="IN_PROGRESS"&&d.jsxs(d.Fragment,{children:[d.jsxs("form",{onSubmit:K=>{K.preventDefault(),ae("progress",{label:m,current:v?Number(v):void 0,output:{}})},className:"space-y-3 border-t border-line pt-4",children:[d.jsxs("label",{children:["Progress update",d.jsx("input",{value:m,onChange:K=>g(K.target.value),placeholder:"Building frontend"})]}),d.jsxs("label",{children:["Current count",d.jsx("input",{type:"number",min:"0",value:v,onChange:K=>b(K.target.value)})]}),d.jsx("button",{className:"btn",disabled:j,children:"Save progress"})]}),o.ticket_type!=="OUTREACH"&&d.jsxs("form",{onSubmit:ye,className:"space-y-3 border-t border-line pt-4",children:[d.jsxs("label",{children:["Structured result JSON",d.jsx("textarea",{className:"font-mono",required:!0,rows:12,value:h,placeholder:v0(o.ticket_type),onChange:K=>f(K.target.value)})]}),d.jsx("button",{className:"btn btn-primary",disabled:j,children:"Submit result"})]}),o.ticket_type==="OUTREACH"&&d.jsx(lR,{ticket:o}),d.jsxs("form",{onSubmit:K=>{K.preventDefault(),ae("fail",{errorMessage:y||"Worker reported failure"})},className:"border-t border-line pt-4",children:[d.jsxs("label",{children:["Failure reason",d.jsx("textarea",{rows:2,value:y,onChange:K=>w(K.target.value)})]}),d.jsx("button",{className:"btn btn-danger mt-2",disabled:j||!y.trim(),children:"Mark failed"})]})]})]})}),d.jsx(he,{title:"Ticket details",children:d.jsxs("dl",{className:"px-5",children:[d.jsx(ge,{name:"Created",value:Je(o.created_at)}),d.jsx(ge,{name:"Assigned",value:Je(o.assigned_at)}),d.jsx(ge,{name:"Claimed",value:Je(o.claimed_at)}),d.jsx(ge,{name:"Started",value:Je(o.started_at)}),d.jsx(ge,{name:"Updated",value:Je(o.updated_at)}),d.jsx(ge,{name:"Completed",value:Je(o.completed_at)}),d.jsx(ge,{name:"Time in status",value:ki(o.status_changed_at)}),d.jsx(ge,{name:"Attempts",value:o.attempt_count}),d.jsx(ge,{name:"Revisions",value:o.revision_count}),d.jsx(ge,{name:"Review",value:o.review_status}),d.jsx(ge,{name:"Review notes",value:o.review_notes}),d.jsx(ge,{name:"Model",value:o.model_name||o.model_provider||"Not configured"}),d.jsx(ge,{name:"Reasoning",value:o.reasoning_level}),d.jsx(ge,{name:"Execution ID",value:o.execution_id}),d.jsx(ge,{name:"Source ticket",value:(xt=n==null?void 0:n.tickets.find(K=>K.id===o.source_ticket_id))==null?void 0:xt.ticket_id}),d.jsx(ge,{name:"Error",value:o.error_message})]})}),H.length>0&&d.jsx(he,{title:"Child tickets",children:d.jsx(oa,{tickets:H})})]})]})]})}function lR({ticket:s}){const{act:n}=ct(),[i,l]=E.useState(""),[o,h]=E.useState(""),[f,m]=E.useState("email"),[g,v]=E.useState(""),[b,y]=E.useState("REPLIED"),[w,x]=E.useState(""),[R,j]=E.useState("");async function N(T,C){l("");try{await n(s.id,{action:T,...C}),h(""),v("")}
165catch(B){l(B.message)}}return d.jsxs("div",{className:"space-y-4 border-t border-line pt-4",children:[s.review_status!=="APPROVED"?d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"text-xs text-muted",children:"Draft outreach for Rajâs approval before recording a send."}),d.jsxs("label",{children:["Outreach draft JSON",d.jsx("textarea",{className:"font-mono",rows:8,value:o,onChange:T=>h(T.target.value),placeholder:v0("OUTREACH")})]}),d.jsx("button",{className:"btn btn-primary",disabled:!o.trim(),onClick:()=>{try{N("complete",{output:JSON.parse(o)})}catch(T){l(T.message)}},children:"Submit draft"})]}):d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"text-xs text-muted",children:"Record an actual external send. The gateway does not send messages itself."}),d.jsxs("label",{children:["Channel",d.jsxs("select",{value:f,onChange:T=>m(T.target.value),children:[d.jsx("option",{value:"email",children:"Email"}),d.jsx("option",{value:"facebook",children:"Facebook"}),d.jsx("option",{value:"sms",children:"SMS"})]})]}),d.jsxs("label",{children:["Sent message",d.jsx("textarea",{rows:4,value:o,onChange:T=>h(T.target.value)})]}),d.jsxs("label",{children:["External message ID",d.jsx("input",{value:g,onChange:T=>v(T.target.value)})]}),d.jsx("button",{className:"btn btn-primary",disabled:!o.trim()||!g.trim(),onClick:()=>void N("record_sent",{channel:f,body:o,externalMessageId:g}),children:"Record sent message"}),d.jsx("button",{className:"btn",disabled:!o.trim()||!g.trim(),onClick:()=>void N("record_follow_up",{channel:f,body:o,externalMessageId:g}),children:"Record follow-up"}),d.jsxs("div",{className:"border-t border-line pt-4",children:[d.jsxs("label",{children:["Response classification",d.jsxs("select",{value:b,onChange:T=>y(T.target.value),children:[d.jsx("option",{children:"REPLIED"}),d.jsx("option",{children:"INTERESTED"}),d.jsx("option",{children:"NOT_INTERESTED"})]})]}),d.jsxs("label",{className:"mt-2",children:["Response text",d.jsx("textarea",{rows:3,value:o,onChange:T=>h(T.target.value)})]}),d.jsx("button",{className:"btn mt-2",disabled:!o.trim(),onClick:()=>void N("record_response",{channel:f,body:o,classification:b}),children:"Record response"}),d.jsxs("label",{className:"mt-3",children:["Meeting time",d.jsx("input",{type:"datetime-local",value:R,onChange:T=>j(T.target.value)})]}),d.jsx("button",{className:"btn mt-2",disabled:!R,onClick:()=>void N("book_meeting",{meetingAt:new Date(R).toISOString()}),children:"Record meeting"}),d.jsx("button",{className:"btn ml-2 mt-2",onClick:()=>void N("negotiating",{notes:o}),children:"Mark negotiating"})]}),d.jsxs("div",{className:"border-t border-line pt-4",children:[d.jsxs("label",{children:["Revenue if won",d.jsx("input",{type:"number",min:"0",value:w,onChange:T=>x(T.target.value)})]}),d.jsxs("div",{className:"mt-2 flex gap-2",children:[d.jsx("button",{className:"btn btn-primary",onClick:()=>void N("record_outcome",{result:"WON",revenue:Number(w)||0}),children:"Mark won"}),d.jsx("button",{className:"btn",onClick:()=>void N("record_outcome",{result:"LOST"}),children:"Mark lost"})]})]})]}),i&&d.jsx("p",{role:"alert",className:"text-xs text-red-300",children:i})]})}function oR(){const{data:s}=ct(),[n,i]=E.useState(""),[l,o]=E.useState(""),[h,f]=E.useState(""),[m,g]=E.useState(""),[v,b]=E.useState(""),[y,w]=E.useState(""),[x,R]=E.useState(""),[j,N]=E.useState(""),T=((s==null?void 0:s.events)||[]).filter(C=>(!n||C.agent_id===n)&&(!l||C.mission_id===l)&&(!h||C.event_type===h)&&(!m||C.prospect_id===m)&&(!v||C.ticket_id===v)&&(!y||C.created_at>=y)&&(!x||C.created_at.slice(0,10)<=x)&&(!j||C.message.toLowerCase().includes(j.toLowerCase())));return d.jsxs(d.Fragment,{children:[d.jsx(wn,{title:"Activity",subtitle:"Chronological audit trail of mission, ticket, prospect, and outreach changes"}),d.jsxs("div",{className:"mb-5 grid gap-2 sm:grid-cols-2 lg:grid-cols-4",children:[d.jsx("input",{"aria-label":"Search activity",placeholder:"Search activity",value:j,onChange:C=>N(C.target.value)}),d.jsxs("select",{"aria-label":"Agent",value:n,onChange:C=>i(C.target.value),children:[d.jsx("option",{value:"",children:"All agents"}),s==null?void 0:s.agents.map(C=>d.jsx("option",{value:C.id,children:C.name},C.id))]}
165),d.jsxs("select",{"aria-label":"Mission",value:l,onChange:C=>o(C.target.value),children:[d.jsx("option",{value:"",children:"All missions"}),s==null?void 0:s.missions.map(C=>d.jsx("option",{value:C.id,children:C.name},C.id))]}),d.jsxs("select",{"aria-label":"Event type",value:h,onChange:C=>f(C.target.value),children:[d.jsx("option",{value:"",children:"All event types"}),Array.from(new Set((s==null?void 0:s.events.map(C=>C.event_type))||[])).map(C=>d.jsx("option",{children:C},C))]}),d.jsxs("select",{"aria-label":"Prospect",value:m,onChange:C=>g(C.target.value),children:[d.jsx("option",{value:"",children:"All prospects"}),s==null?void 0:s.prospects.map(C=>d.jsx("option",{value:C.id,children:C.business_name},C.id))]}),d.jsxs("select",{"aria-label":"Ticket",value:v,onChange:C=>b(C.target.value),children:[d.jsx("option",{value:"",children:"All tickets"}),s==null?void 0:s.tickets.map(C=>d.jsx("option",{value:C.id,children:C.ticket_id},C.id))]}),d.jsx("input",{"aria-label":"From date",type:"date",value:y,onChange:C=>w(C.target.value)}),d.jsx("input",{"aria-label":"Through date",type:"date",value:x,onChange:C=>R(C.target.value)})]}),d.jsx(he,{title:`${T.length} events`,children:d.jsx(Jr,{events:T})})]})}const uR=["CURRENT","QUEUE","REVIEW / APPROVAL","COMPLETED","FAILED","ALL TICKETS","ACTIVITY","USAGE","LEGACY TASKS"];function cR(){var Q,ee,$,G,H,ae,ye,$e,Qe,ht,xt,K;const{slug:s}=xs(),{data:n,updateProfile:i}=ct(),[l,o]=E.useState("CURRENT"),[h,f]=E.useState(""),[m,g]=E.useState(""),[v,b]=E.useState([]),[y,w]=E.useState([]),x=n==null?void 0:n.agents.find(q=>q.slug===s),R=(n==null?void 0:n.tickets.filter(q=>q.assigned_agent_id===(x==null?void 0:x.id)))||[],j=(n==null?void 0:n.events.filter(q=>q.agent_id===(x==null?void 0:x.id)))||[],N=(n==null?void 0:n.executions.filter(q=>q.agent_id===(x==null?void 0:x.id)))||[];if(E.useEffect(()=>{s&&Promise.all([Pa(`/tasks?agent=${s}`),Pa(`/activity?agent=${s}`)]).then(([q,Z])=>{b(q),w(Z)}).catch(()=>{})},[s]),!x)return d.jsx(Ze,{text:"Agent not found."});const T=R.filter(q=>["CLAIMED","IN_PROGRESS"].includes(q.status)),C=R.filter(q=>["BACKLOG","READY"].includes(q.status)),B=R.filter(q=>["AWAITING_REVIEW","AWAITING_APPROVAL"].includes(q.status));return d.jsxs(d.Fragment,{children:[d.jsx(wn,{title:x.name,subtitle:`${x.role} · ${x.provider}`,action:d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Jt,{value:x.live_status}),d.jsx(Ne,{className:"btn",to:`/worker/${x.slug}`,children:"Worker queue"})]})}),d.jsx("div",{className:"mb-6 grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[["Current ticket",((Q=x.current_ticket)==null?void 0:Q.ticket_id)||"None"],["Queue",x.queue_size],["Tickets completed today",x.completed_today],["Failed today",x.failed_today],["Review / approval",B.length],["Current prospect",((ee=x.current_prospect)==null?void 0:ee.business_name)||"â"],["Execution duration",ki((($=x.current_ticket)==null?void 0:$.started_at)||null)],["Runtime / model",((G=x.profile)==null?void 0:G.model_name)||((H=x.profile)==null?void 0:H.provider)||x.provider]].map(([q,Z])=>d.jsxs("div",{className:"card p-4",children:[d.jsx("div",{className:"text-xs text-faint",children:q}),d.jsx("div",{className:"mt-2 text-sm font-semibold",children:Z})]},q))}),d.jsx("div",{className:"mb-5 flex flex-wrap gap-2",role:"tablist","aria-label":"Agent details",children:uR.map(q=>d.jsx("button",{role:"tab","aria-selected":l===q,onClick:()=>o(q),className:`btn ${l===q?"btn-primary":""}`,children:q},q))}),l==="CURRENT"&&d.jsxs("div",{className:"grid gap-5 lg:grid-cols-[2fr_1fr]",children:[d.jsx(he,{title:"Active ticket",children:d.jsx(oa,{tickets:T})}),d.jsx(he,{title:"Agent",children:d.jsxs("dl",{className:"px-5",children:[d.jsx(ge,{name:"Description",value:x.description}),d.jsx(ge,{name:"Runtime",value:x.provider}),d.jsx(ge,{name:"Last seen",value:Je(x.last_seen_at)}),d.jsx(ge,{name:"Capacity",value:x.max_concurrent_tickets}),d.jsx(ge,{name:"Latest activity",value:(ae=x.latest_event)==null?void 0:ae.message})]})})]}),l==="QUEUE"&&d.jsx(he,{title:`${C.length} queued tickets`,children:d.jsx(oa,{tickets:C})}),l==="REVIEW / APPROVAL"&&d.jsx(he,{title:`${B.length} waiting tickets`,children:d.jsx(oa,{tickets:B})}),l==="COMPLETED"&&d.jsx(he,{title:"Completed tickets",children:d.jsx(oa,{tickets:R.filter(q=>q.status==="DONE")})}),l==="FAILED"&&d.jsx(he,{title:"Failed tickets",children:d.jsx(oa,{tickets:R.filter(q=>q.status==="FAILED")})}),l==="ALL TICKETS"&&d.jsx(he,{title:"All assigned tickets",children:d.jsx(oa,{tickets:R})}),l==="ACTIVITY"&&d.jsx(he,{title:"Agent activity",children:d.jsx(Jr,{events:j})}),l==="LEGACY TASKS"&&d.jsxs("div",{className:"grid gap-5 lg:grid-cols-2",children:[d.jsx(he,{title:"Task history",children:v.length?d.jsx("div",{className:"divide-y divide-line",children:v.map(q=>d.jsxs(Ne,{to:`/worker/${s}
165/tasks/${q.id}`,className:"block p-4 text-sm hover:bg-elevated",children:[d.jsxs("span",{className:"font-mono text-xs text-faint",children:["#",Rd(q.id)," · ",q.status]}),d.jsx("p",{className:"mt-1",children:q.title})]},q.id))}):d.jsx(Ze,{text:"No legacy tasks."})}),d.jsx(he,{title:"Recent legacy activity",children:y.length?d.jsx("div",{className:"divide-y divide-line",children:y.map(q=>d.jsxs("div",{className:"p-4 text-sm",children:[q.message,d.jsx("div",{className:"mt-1 text-xs text-faint",children:Je(q.created_at)})]},q.id))}):d.jsx(Ze,{text:"No legacy activity."})})]}),l==="USAGE"&&d.jsxs("div",{className:"grid gap-5 lg:grid-cols-2",children:[d.jsx(he,{title:"Execution profile",children:d.jsxs("div",{className:"space-y-3 p-5 text-sm",children:[d.jsxs("p",{children:["Provider: ",((ye=x.profile)==null?void 0:ye.provider)||"â"]}),d.jsxs("p",{children:["Model: ",(($e=x.profile)==null?void 0:$e.model_name)||"Not configured"]}),d.jsxs("p",{children:["Reasoning: ",((Qe=x.profile)==null?void 0:Qe.reasoning_level)||"â"]}),d.jsxs("p",{children:["Web search: ",(ht=x.profile)!=null&&ht.web_search_enabled?"Enabled":"Disabled"]}),d.jsxs("p",{children:["Token budget: ",((xt=x.profile)==null?void 0:xt.token_budget)||"â"]}),d.jsxs("p",{children:["Concurrency: ",((K=x.profile)==null?void 0:K.max_concurrent_tickets)||x.max_concurrent_tickets]}),x.profile&&d.jsxs("form",{onSubmit:async q=>{q.preventDefault(),f("");try{await i(x.profile.id,{modelName:m||null})}catch(Z){f(Z.message)}},children:[d.jsxs("label",{children:["Model name",d.jsx("input",{value:m,onChange:q=>g(q.target.value),placeholder:x.profile.model_name||"Set model when connected"})]}),d.jsx("button",{className:"btn mt-2",children:"Save model setting"})]}),h&&d.jsx("p",{role:"alert",className:"text-red-300",children:h})]})}),d.jsxs(he,{title:"Recorded usage",children:[d.jsx("div",{className:"grid grid-cols-2 gap-3 p-5",children:[["Executions",N.length],["Input tokens",N.reduce((q,Z)=>q+(Z.input_tokens||0),0)],["Output tokens",N.reduce((q,Z)=>q+(Z.output_tokens||0),0)],["Tool calls",N.reduce((q,Z)=>q+(Z.tool_calls||0),0)],["Search calls",N.reduce((q,Z)=>q+(Z.search_calls||0),0)],["Estimated cost",`$${N.reduce((q,Z)=>q+(Number(Z.estimated_cost)||0),0).toFixed(2)}`]].map(([q,Z])=>d.jsxs("div",{className:"rounded border border-line p-3",children:[d.jsx("div",{className:"text-xs text-faint",children:q}),d.jsx("div",{className:"mt-2 font-semibold",children:Z})]},q))}),!N.length&&d.jsx(Ze,{text:"Usage appears after a worker reports execution metrics."})]})]})]})}const vy={"prospect-finder":"Prospect Finder",zaferesearch:"ZAFE Research",jordanbelfort:"Jordan Belfort"};function hR(){const{slug:s}=xs(),[n]=tS(),i=n.get("payload")||"",l=n.get("signature")||"",[o,h]=E.useState(null),[f,m]=E.useState(""),[g,v]=E.useState(!1);E.useEffect(()=>{let y=!0;if(!s||!vy[s]||!i||!l){m("This connection link is invalid. Start again in Grok Bot.");return}return Pa(`/mcp/consent?payload=${encodeURIComponent(i)}&signature=${encodeURIComponent(l)}`).then(w=>{if(y){if(w.agentSlug!==s){m("This link is for a different worker.");return}h(w)}}).catch(w=>{y&&m(w.message)}),()=>{y=!1}},[s,i,l]);async function b(){if(!(g||!o)){v(!0),m("");try{const y=await la("/mcp/authorize",{payload:i,signature:l}),w=new URL(y.continueUrl);if(w.protocol!=="https:"||!w.hostname.endsWith(".zafesoftware.workers.dev")||w.pathname!=="/authorize/complete")throw new Error("The connection returned an invalid destination");window.location.assign(w.toString())}catch(y){m(y.message),v(!1)}}}return d.jsx("main",{className:"flex min-h-screen items-center justify-center bg-canvas px-5 py-10 text-fg",children:d.jsxs("section",{className:"card w-full max-w-lg p-7 sm:p-9","aria-labelledby":"connect-title",children:[d.jsx("img",{src:"/zafe-wordmark-light.png",alt:"Zafe",className:"mb-9 h-7 w-auto"}),d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[.16em] text-muted",children:"Agent Gateway connection"}),d.jsxs("h1",{id:"connect-title",className:"mt-2 text-2xl font-semibold",children:["Connect ",vy[s||""]||"worker"]}),f?d.jsx("p",{role:"alert",className:"mt-5 text-sm text-red-300",children:f}):o?d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"mt-5 text-sm leading-6 text-muted",children:[d.jsx("strong",{className:"text-fg",children:o.clientName}
165)," is requesting access to this workerâs Agent Gateway tickets."]}),d.jsxs("dl",{className:"mt-5 space-y-3 rounded-lg border border-line p-4 text-sm",children:[d.jsxs("div",{children:[d.jsx("dt",{className:"text-faint",children:"Access returns to"}),d.jsx("dd",{className:"mt-1 font-medium",children:o.redirectHost})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-faint",children:"Permissions"}),d.jsx("dd",{className:"mt-1 font-medium",children:o.scope.join(", ")})]}),o.clientDomain&&d.jsxs("div",{children:[d.jsx("dt",{className:"text-faint",children:"Verified client domain"}),d.jsx("dd",{className:"mt-1 font-medium",children:o.clientDomain})]})]}),!o.clientDomain&&d.jsx("p",{className:"mt-4 text-xs text-faint",children:"The client name is self-reported. Confirm that you started this connection in Grok Bot."}),d.jsx("button",{className:"btn btn-primary mt-7 w-full justify-center py-3",onClick:()=>void b(),disabled:g,children:g?"Connectingâ¦":"Authorize connection"})]}):f?null:d.jsx("p",{className:"mt-5 text-sm text-muted",children:"Checking the connection requestâ¦"}),d.jsx(Ne,{to:"/agents",className:"mt-5 inline-block text-sm text-muted hover:text-fg",children:"Back to Agent Gateway"})]})})}function gd(s){const[n,i]=E.useState(null),[l,o]=E.useState(""),[h,f]=E.useState(!0),m=E.useCallback(async()=>{f(!0);try{i(await Pa(s)),o("")}catch(g){o(g.message)}finally{f(!1)}},[s]);return E.useEffect(()=>{m()},[m]),{data:n,error:l,loading:h,reload:m}}function Cd({error:s}){return s?d.jsx("div",{role:"alert",className:"card mb-5 border-red-900 p-4 text-sm text-red-300",children:s}):null}function dR({value:s}){return d.jsx("span",{className:`badge badge-${s}`,children:qe(s)})}function yy({children:s}){return d.jsx("div",{className:"p-8 text-center text-sm text-muted",children:s})}function bi({title:s,action:n,children:i}){return d.jsxs("section",{className:"card overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line px-5 py-4",children:[d.jsx("h2",{className:"text-sm font-semibold",children:s}),n]}),i]})}function y0({title:s,description:n,action:i}){return d.jsxs("div",{className:"mb-7 flex flex-wrap items-start justify-between gap-4",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:s}),n&&d.jsx("p",{className:"mt-1 text-sm text-muted",children:n})]}),i]})}const fR=[{to:"/",text:"Overview",icon:fS},{to:"/live",text:"Live Status",icon:pS},{to:"/missions",text:"Missions",icon:vS},{to:"/prospects",text:"Prospects",icon:yS},{to:"/tickets",text:"Tickets",icon:mS},{to:"/pipeline",text:"Pipeline",icon:dS},{to:"/agents",text:"Agents",icon:Iy},{to:"/activity",text:"Activity",icon:cS}];function mR({children:s}){const[n,i]=E.useState(!1);return d.jsxs("div",{className:"min-h-screen md:pl-60",children:[d.jsxs("aside",{className:`fixed inset-y-0 left-0 z-40 w-60 border-r border-line bg-surface p-4 transition-transform md:translate-x-0 ${n?"translate-x-0":"-translate-x-full"}`,children:[d.jsxs("div",{className:"mb-8 flex items-center justify-between",children:[d.jsxs(Ne,{to:"/",className:"flex items-center gap-2.5",onClick:()=>i(!1),children:[d.jsx("img",{src:"/zafe-wordmark-light.png",alt:"Zafe",className:"h-6 w-auto"}),d.jsx("span",{className:"border-l border-line pl-2.5 text-xs font-semibold text-muted",children:"AGENT GATEWAY"})]}),d.jsx("button",{className:"md:hidden","aria-label":"Close navigation",onClick:()=>i(!1),children:d.jsx(bS,{size:18})})]}),d.jsx("div",{className:"mb-3 px-3 text-[10px] font-semibold uppercase tracking-[.16em] text-faint",children:"Workspace"}),d.jsx("nav",{"aria-label":"Main navigation",className:"space-y-1",children:fR.map(l=>d.jsxs(Hy,{to:l.to,end:l.to==="/",onClick:()=>i(!1),className:({isActive:o})=>`flex items-center gap-3 rounded-md px-3 py-2 text-sm ${o?"bg-elevated text-fg":"text-muted hover:bg-elevated hover:text-fg"}`,children:[d.jsx(l.icon,{size:17,strokeWidth:1.8}),l.text]},l.to))}),d.jsxs("div",{className:"absolute bottom-8 left-4 right-4 border-t border-line pt-4",children:[d.jsx("button",{className:"text-xs text-muted hover:text-fg",onClick:()=>void Mr.auth.signOut(),children:"Sign out"}),d.jsx("div",{className:"mt-3 text-xs text-faint",children:"Zafe operations control plane"})]})]}),d.jsxs("header",{className:"sticky top-0 z-30 flex h-14 items-center gap-3 border-b border-line bg-canvas/95 px-4 backdrop-blur md:hidden",children:[d.jsx("button",{"aria-label":"Open navigation",onClick:()=>i(!0),children:d.jsx(gS,{size:20})}),d.jsx("span",{className:"text-sm font-semibold",children:"Agent Gateway"})]}),d.jsx("main",{className:"mx-auto max-w-[1450px] px-4 py-7 sm:px-6 lg:px-8",children:s})]})}function gR(){const{data:s,error:n,loading:i}=ct();return d.jsxs(d.Fragment,{children:[d.jsx(y0,{title:"Agents",description:"See how Raj coordinates the gateway workforce"}),d.jsx(Cd,{error:n}),i&&!s?d.jsx("div",{className:"card p-10 text-center text-sm text-muted",children:"Loading agent networkâ¦"}):d.jsx(wS,{agents:(s==null?void 0:s.agents)||[]})]})}function by({value:s}){return d.jsx("pre",{className:"overflow-x-auto rounded-md border border-line bg-canvas p-4 text-xs leading-6 text-muted",children:JSON.stringify(s,null,2)})}function pR(){const{slug:s}=xs(),{data:n,error:i}=gd(`/agents/${s}`),{data:l,error:o}=gd(`/workers/${s}/tasks?status=queued`),{data:h}=ct(),f=(h==null?void 0:h.tickets.filter(m=>{var g;return((g=m.agent)==null?void 0:g.slug)===s&&["READY","CLAIMED","IN_PROGRESS","AWAITING_REVIEW","AWAITING_APPROVAL"].includes(m.status)}))||[];return d.jsxs("div",{className:"mx-auto max-w-3xl py-4",children:[d.jsxs("div",{className:"mb-8 flex justify-between gap-4",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[.18em] text-faint",children:"Worker queue"}),d.jsx("h1",{className:"mt-2 text-2xl font-semibold uppercase",children:(n==null?void 0:n.name)||s}),d.jsx("p",{className:"mt-1 text-sm text-muted",children:n==null?void 0:n.role})]}),d.jsx(Ne,{to:"/agents",className:"text-xs text-muted hover:text-fg",children:"Agents â"})]}),d.jsx(Cd,{error:i||o}),d.jsx(bi,{title:"Assigned tickets",children:f.length?f.map(m=>{var g,v;return d.jsxs("article",{className:"flex flex-wrap items-center justify-between gap-4 border-b border-line p-5 last:border-0",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"font-mono text-xs text-faint",children:[m.ticket_id," · ",qe(m.status)]}),d.jsx("h2",{className:"mt-2 font-medium",children:m.title}),d.jsxs("p",{className:"mt-1 text-xs text-muted",children:[((g=m.prospect)==null?void 0:g.business_name)||((v=m.mission)==null?void 0:v.name)," · Priority: ",qe(m.priority)]})]}),d.jsx(Ne,{className:"btn btn-primary",to:`/worker/${s}/tickets/${m.ticket_id}`,children:"Open ticket"})]},m.id)}):d.jsx(yy,{children:"No active tickets assigned to this worker."})}),d.jsx("div",{className:"mt-5",children:d.jsx(bi,{title:"Legacy task queue",children:l!=null&&l.length?l.map(m=>d.jsxs("article",{className:"flex flex-wrap items-center justify-between gap-4 border-b border-line p-5 last:border-0",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"font-mono text-xs text-faint",children:["TASK #",Rd(m.id)]}),d.jsx("h2",{className:"mt-2 font-medium",children:m.title}),d.jsxs("p",{className:"mt-1 text-xs text-muted",children:["Pri
165ority: ",qe(m.priority)]})]}),d.jsx(Ne,{className:"btn",to:`/worker/${s}/tasks/${m.id}`,children:"Open task"})]},m.id)):d.jsx(yy,{children:"No queued legacy tasks."})})})]})}function vR(){var x,R,j,N;const{slug:s,id:n}=xs(),{data:i,error:l,reload:o}=gd(`/tasks/${n}`),[h,f]=E.useState({summary:"",confidence:"0.8",notes:"",outputJson:"{}"}),[m,g]=E.useState(""),[v,b]=E.useState(!1);async function y(){b(!0);try{await la(`/tasks/${n}/start`),await o()}catch(T){g(T.message)}finally{b(!1)}}async function w(T){T.preventDefault(),b(!0);try{await la(`/tasks/${n}/complete`,{summary:h.summary,confidence:Number(h.confidence),notes:h.notes,outputJson:JSON.parse(h.outputJson)}),await o()}catch(C){g(C.message)}finally{b(!1)}}return d.jsxs("div",{className:"mx-auto max-w-3xl py-4",children:[d.jsx(Ne,{to:`/worker/${s}`,className:"mb-7 inline-block text-sm text-muted hover:text-fg",children:"â Back to queue"}),d.jsx(y0,{title:(i==null?void 0:i.title)||"Task",description:i?`TASK #${Rd(i.id)}`:void 0}),d.jsx(Cd,{error:l||m}),i&&d.jsxs("div",{className:"space-y-5",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[d.jsx(dR,{value:i.status}),d.jsxs("span",{className:"text-xs text-muted",children:["Priority: ",qe(i.priority)]})]}),d.jsx(bi,{title:"Objective",children:d.jsx("p",{className:"p-5 text-sm leading-7",children:i.objective})}),d.jsx(bi,{title:"Instructions",children:d.jsx("div",{className:"p-5",children:d.jsx(by,{value:i.instructions})})}),i.status==="queued"&&d.jsx("button",{className:"btn btn-primary w-full py-3",disabled:v,onClick:()=>void y(),children:"Start task"}),i.status==="in_progress"&&d.jsx(bi,{title:"Submit structured result",children:d.jsxs("form",{onSubmit:w,className:"space-y-5 p-5",children:[d.jsxs("label",{children:["Summary",d.jsx("textarea",{required:!0,rows:3,value:h.summary,onChange:T=>f({...h,summary:T.target.value})})]}),d.jsxs("label",{children:["Confidence (0 to 1)",d.jsx("input",{required:!0,type:"number",min:"0",max:"1",step:"0.01",value:h.confidence,onChange:T=>f({...h,confidence:T.target.value})})]}),d.jsxs("label",{children:["Notes",d.jsx("textarea",{rows:3,value:h.notes,onChange:T=>f({...h,notes:T.target.value})})]}),d.jsxs("label",{children:["JSON output",d.jsx("textarea",{required:!0,rows:10,className:"font-mono",value:h.outputJson,onChange:T=>f({...h,outputJson:T.target.value})})]}),d.jsx("button",{className:"btn btn-primary w-full",disabled:v,children:"Submit result"})]})}),i.status==="completed"&&d.jsx(bi,{title:"Submitted result",children:d.jsxs("div",{className:"p-5",children:[d.jsx("p",{className:"mb-4 text-sm",children:(R=(x=i.results)==null?void 0:x[0])==null?void 0:R.summary}),d.jsx(by,{value:(N=(j=i.results)==null?void 0:j[0])==null?void 0:N.output_json})]})})]})]})}function yR(){return d.jsx(zT,{children:d.jsx(HT,{children:d.jsxs(_v,{children:[d.jsx(st,{path:"/connect/:slug",element:d.jsx(hR,{})}),d.jsx(st,{path:"/worker/:slug",element:d.jsx(pR,{})}),d.jsx(st,{path:"/worker/:slug/tasks/:id",element:d.jsx(vR,{})}),d.jsx(st,{path:"/worker/:slug/tickets/:id",element:d.jsx("main",{className:"mx-auto max-w-5xl p-5",children:d.jsx(py,{})})}),d.jsx(st,{path:"*",element:d.jsx(mR,{children:d.jsxs(_v,{children:[d.jsx(st,{path:"/",element:d.jsx(qT,{})}),d.jsx(st,{path:"/live",element:d.jsx($T,{})}),d.jsx(st,{path:"/missions",element:d.jsx(GT,{})}),d.jsx(st,{path:"/missions/:id",element:d.jsx(VT,{})}),d.jsx(st,{path:"/prospects",element:d.jsx(KT,{})}),d.jsx(st,{path:"/prospects/:id",element:d.jsx(JT,{})}),d.jsx(st,{path:"/tickets",element:d.jsx(rR,{})}),d.jsx(st,{path:"/tickets/:id",element:d.jsx(py,{})}),d.jsx(st,{path:"/pipeline",element:d.jsx(XT,{})}),d.jsx(st,{path:"/agents",element:d.jsx(gR,{})}),d.jsx(st,{path:"/agents/:slug",element:d.jsx(cR,{})}),d.jsx(st,{path:"/activity",element:d.jsx(oR,{})}),d.jsx(st,{path:"*",element:d.jsx(jw,{to:"/",replace:!0})})]})})})]})})})}Tx.createRoot(document.getElementById("root")).render(d.jsx(bx.StrictMode,{children:d.jsx(Zw,{children:d.jsx(yR,{})})}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.