@source-repo/rpc-cli 4.4.0 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/web/app.js CHANGED
@@ -1,12 +1,12 @@
1
- var bv=Object.create;var kc=Object.defineProperty;var wv=Object.getOwnPropertyDescriptor;var dp=(r,n)=>(n=Symbol[r])?n:Symbol.for("Symbol."+r),ha=r=>{throw TypeError(r)};var pp=(r,n,a)=>n in r?kc(r,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[n]=a;var up=(r,n)=>kc(r,"name",{value:n,configurable:!0});var mp=r=>[,,,bv(r?.[dp("metadata")]??null)],yp=["class","method","getter","setter","accessor","field","value","get","set"],fa=r=>r!==void 0&&typeof r!="function"?ha("Function expected"):r,Sv=(r,n,a,l,u)=>({kind:yp[r],name:n,metadata:l,addInitializer:f=>a._?ha("Already initialized"):u.push(fa(f||null))}),xv=(r,n)=>pp(n,dp("metadata"),r[3]),Tc=(r,n,a,l)=>{for(var u=0,f=r[n>>1],d=f&&f.length;u<d;u++)n&1?f[u].call(a):l=f[u].call(a,l);return l},Vl=(r,n,a,l,u,f)=>{var d,m,y,b,R,w=n&7,j=!!(n&8),L=!!(n&16),K=w>3?r.length+1:w?j?1:2:0,P=yp[w+5],W=w>3&&(r[K-1]=[]),z=r[K]||(r[K]=[]),X=w&&(!L&&!j&&(u=u.prototype),w<5&&(w>3||!L)&&wv(w<4?u:{get[a](){return fp(this,f)},set[a](N){return hp(this,f,N)}},a));w?L&&w<4&&up(f,(w>2?"set ":w>1?"get ":"")+a):up(u,a);for(var J=l.length-1;J>=0;J--)b=Sv(w,a,y={},r[3],z),w&&(b.static=j,b.private=L,R=b.access={has:L?N=>Ev(u,N):N=>a in N},w^3&&(R.get=L?N=>(w^1?fp:kv)(N,u,w^4?f:X.get):N=>N[a]),w>2&&(R.set=L?(N,C)=>hp(N,u,C,w^4?f:X.set):(N,C)=>N[a]=C)),m=(0,l[J])(w?w<4?L?f:X[P]:w>4?void 0:{get:X.get,set:X.set}:u,b),y._=1,w^4||m===void 0?fa(m)&&(w>4?W.unshift(m):w?L?f=m:X[P]=m:u=m):typeof m!="object"||m===null?ha("Object expected"):(fa(d=m.get)&&(X.get=d),fa(d=m.set)&&(X.set=d),fa(d=m.init)&&W.unshift(d));return w||xv(r,u),X&&kc(u,a,X),L?w^4?f:X:u},gp=(r,n,a)=>pp(r,typeof n!="symbol"?n+"":n,a),_c=(r,n,a)=>n.has(r)||ha("Cannot "+a),Ev=(r,n)=>Object(n)!==n?ha('Cannot use the "in" operator on this value'):r.has(n),fp=(r,n,a)=>(_c(r,n,"read from private field"),a?a.call(r):n.get(r));var hp=(r,n,a,l)=>(_c(r,n,"write to private field"),l?l.call(r,a):n.set(r,a),a),kv=(r,n,a)=>(_c(r,n,"access private method"),a);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))l(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function a(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function l(u){if(u.ep)return;u.ep=!0;const f=a(u);fetch(u.href,f)}})();function Tv(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ac={exports:{}},da={};var vp;function _v(){if(vp)return da;vp=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(l,u,f){var d=null;if(f!==void 0&&(d=""+f),u.key!==void 0&&(d=""+u.key),"key"in u){f={};for(var m in u)m!=="key"&&(f[m]=u[m])}else f=u;return u=f.ref,{$$typeof:r,type:l,key:d,ref:u!==void 0?u:null,props:f}}return da.Fragment=n,da.jsx=a,da.jsxs=a,da}var bp;function Av(){return bp||(bp=1,Ac.exports=_v()),Ac.exports}var g=Av(),Nc={exports:{}},ce={};var wp;function Nv(){if(wp)return ce;wp=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),j=Symbol.iterator;function L(S){return S===null||typeof S!="object"?null:(S=j&&S[j]||S["@@iterator"],typeof S=="function"?S:null)}var K={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},P=Object.assign,W={};function z(S,q,G){this.props=S,this.context=q,this.refs=W,this.updater=G||K}z.prototype.isReactComponent={},z.prototype.setState=function(S,q){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,q,"setState")},z.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function X(){}X.prototype=z.prototype;function J(S,q,G){this.props=S,this.context=q,this.refs=W,this.updater=G||K}var N=J.prototype=new X;N.constructor=J,P(N,z.prototype),N.isPureReactComponent=!0;var C=Array.isArray;function H(){}var B={H:null,A:null,T:null,S:null},Q=Object.prototype.hasOwnProperty;function ne(S,q,G){var ee=G.ref;return{$$typeof:r,type:S,key:q,ref:ee!==void 0?ee:null,props:G}}function se(S,q){return ne(S.type,q,S.props)}function xe(S){return typeof S=="object"&&S!==null&&S.$$typeof===r}function ue(S){var q={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(G){return q[G]})}var je=/\/+/g;function Ge(S,q){return typeof S=="object"&&S!==null&&S.key!=null?ue(""+S.key):q.toString(36)}function V(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(H,H):(S.status="pending",S.then(function(q){S.status==="pending"&&(S.status="fulfilled",S.value=q)},function(q){S.status==="pending"&&(S.status="rejected",S.reason=q)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function k(S,q,G,ee,oe){var he=typeof S;(he==="undefined"||he==="boolean")&&(S=null);var Ee=!1;if(S===null)Ee=!0;else switch(he){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(S.$$typeof){case r:case n:Ee=!0;break;case R:return Ee=S._init,k(Ee(S._payload),q,G,ee,oe)}}if(Ee)return oe=oe(S),Ee=ee===""?"."+Ge(S,0):ee,C(oe)?(G="",Ee!=null&&(G=Ee.replace(je,"$&/")+"/"),k(oe,q,G,"",function(ti){return ti})):oe!=null&&(xe(oe)&&(oe=se(oe,G+(oe.key==null||S&&S.key===oe.key?"":(""+oe.key).replace(je,"$&/")+"/")+Ee)),q.push(oe)),1;Ee=0;var it=ee===""?".":ee+":";if(C(S))for(var Ce=0;Ce<S.length;Ce++)ee=S[Ce],he=it+Ge(ee,Ce),Ee+=k(ee,q,G,he,oe);else if(Ce=L(S),typeof Ce=="function")for(S=Ce.call(S),Ce=0;!(ee=S.next()).done;)ee=ee.value,he=it+Ge(ee,Ce++),Ee+=k(ee,q,G,he,oe);else if(he==="object"){if(typeof S.then=="function")return k(V(S),q,G,ee,oe);throw q=String(S),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function $(S,q,G){if(S==null)return S;var ee=[],oe=0;return k(S,ee,"","",function(he){return q.call(G,he,oe++)}),ee}function F(S){if(S._status===-1){var q=S._result;q=q(),q.then(function(G){(S._status===0||S._status===-1)&&(S._status=1,S._result=G)},function(G){(S._status===0||S._status===-1)&&(S._status=2,S._result=G)}),S._status===-1&&(S._status=0,S._result=q)}if(S._status===1)return S._result.default;throw S._result}var re=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},pe={map:$,forEach:function(S,q,G){$(S,function(){q.apply(this,arguments)},G)},count:function(S){var q=0;return $(S,function(){q++}),q},toArray:function(S){return $(S,function(q){return q})||[]},only:function(S){if(!xe(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return ce.Activity=w,ce.Children=pe,ce.Component=z,ce.Fragment=a,ce.Profiler=u,ce.PureComponent=J,ce.StrictMode=l,ce.Suspense=y,ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,ce.__COMPILER_RUNTIME={__proto__:null,c:function(S){return B.H.useMemoCache(S)}},ce.cache=function(S){return function(){return S.apply(null,arguments)}},ce.cacheSignal=function(){return null},ce.cloneElement=function(S,q,G){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var ee=P({},S.props),oe=S.key;if(q!=null)for(he in q.key!==void 0&&(oe=""+q.key),q)!Q.call(q,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&q.ref===void 0||(ee[he]=q[he]);var he=arguments.length-2;if(he===1)ee.children=G;else if(1<he){for(var Ee=Array(he),it=0;it<he;it++)Ee[it]=arguments[it+2];ee.children=Ee}return ne(S.type,oe,ee)},ce.createContext=function(S){return S={$$typeof:d,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:f,_context:S},S},ce.createElement=function(S,q,G){var ee,oe={},he=null;if(q!=null)for(ee in q.key!==void 0&&(he=""+q.key),q)Q.call(q,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(oe[ee]=q[ee]);var Ee=arguments.length-2;if(Ee===1)oe.children=G;else if(1<Ee){for(var it=Array(Ee),Ce=0;Ce<Ee;Ce++)it[Ce]=arguments[Ce+2];oe.children=it}if(S&&S.defaultProps)for(ee in Ee=S.defaultProps,Ee)oe[ee]===void 0&&(oe[ee]=Ee[ee]);return ne(S,he,oe)},ce.createRef=function(){return{current:null}},ce.forwardRef=function(S){return{$$typeof:m,render:S}},ce.isValidElement=xe,ce.lazy=function(S){return{$$typeof:R,_payload:{_status:-1,_result:S},_init:F}},ce.memo=function(S,q){return{$$typeof:b,type:S,compare:q===void 0?null:q}},ce.startTransition=function(S){var q=B.T,G={};B.T=G;try{var ee=S(),oe=B.S;oe!==null&&oe(G,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(H,re)}catch(he){re(he)}finally{q!==null&&G.types!==null&&(q.types=G.types),B.T=q}},ce.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},ce.use=function(S){return B.H.use(S)},ce.useActionState=function(S,q,G){return B.H.useActionState(S,q,G)},ce.useCallback=function(S,q){return B.H.useCallback(S,q)},ce.useContext=function(S){return B.H.useContext(S)},ce.useDebugValue=function(){},ce.useDeferredValue=function(S,q){return B.H.useDeferredValue(S,q)},ce.useEffect=function(S,q){return B.H.useEffect(S,q)},ce.useEffectEvent=function(S){return B.H.useEffectEvent(S)},ce.useId=function(){return B.H.useId()},ce.useImperativeHandle=function(S,q,G){return B.H.useImperativeHandle(S,q,G)},ce.useInsertionEffect=function(S,q){return B.H.useInsertionEffect(S,q)},ce.useLayoutEffect=function(S,q){return B.H.useLayoutEffect(S,q)},ce.useMemo=function(S,q){return B.H.useMemo(S,q)},ce.useOptimistic=function(S,q){return B.H.useOptimistic(S,q)},ce.useReducer=function(S,q,G){return B.H.useReducer(S,q,G)},ce.useRef=function(S){return B.H.useRef(S)},ce.useState=function(S){return B.H.useState(S)},ce.useSyncExternalStore=function(S,q,G){return B.H.useSyncExternalStore(S,q,G)},ce.useTransition=function(){return B.H.useTransition()},ce.version="19.2.8",ce}var Sp;function Pc(){return Sp||(Sp=1,Nc.exports=Nv()),Nc.exports}var Z=Pc(),Oc={exports:{}},pa={},jc={exports:{}},Rc={};var xp;function Ov(){return xp||(xp=1,(function(r){function n(k,$){var F=k.length;k.push($);e:for(;0<F;){var re=F-1>>>1,pe=k[re];if(0<u(pe,$))k[re]=$,k[F]=pe,F=re;else break e}}function a(k){return k.length===0?null:k[0]}function l(k){if(k.length===0)return null;var $=k[0],F=k.pop();if(F!==$){k[0]=F;e:for(var re=0,pe=k.length,S=pe>>>1;re<S;){var q=2*(re+1)-1,G=k[q],ee=q+1,oe=k[ee];if(0>u(G,F))ee<pe&&0>u(oe,G)?(k[re]=oe,k[ee]=F,re=ee):(k[re]=G,k[q]=F,re=q);else if(ee<pe&&0>u(oe,F))k[re]=oe,k[ee]=F,re=ee;else break e}}return $}function u(k,$){var F=k.sortIndex-$.sortIndex;return F!==0?F:k.id-$.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;r.unstable_now=function(){return f.now()}}else{var d=Date,m=d.now();r.unstable_now=function(){return d.now()-m}}var y=[],b=[],R=1,w=null,j=3,L=!1,K=!1,P=!1,W=!1,z=typeof setTimeout=="function"?setTimeout:null,X=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;function N(k){for(var $=a(b);$!==null;){if($.callback===null)l(b);else if($.startTime<=k)l(b),$.sortIndex=$.expirationTime,n(y,$);else break;$=a(b)}}function C(k){if(P=!1,N(k),!K)if(a(y)!==null)K=!0,H||(H=!0,ue());else{var $=a(b);$!==null&&V(C,$.startTime-k)}}var H=!1,B=-1,Q=5,ne=-1;function se(){return W?!0:!(r.unstable_now()-ne<Q)}function xe(){if(W=!1,H){var k=r.unstable_now();ne=k;var $=!0;try{e:{K=!1,P&&(P=!1,X(B),B=-1),L=!0;var F=j;try{t:{for(N(k),w=a(y);w!==null&&!(w.expirationTime>k&&se());){var re=w.callback;if(typeof re=="function"){w.callback=null,j=w.priorityLevel;var pe=re(w.expirationTime<=k);if(k=r.unstable_now(),typeof pe=="function"){w.callback=pe,N(k),$=!0;break t}w===a(y)&&l(y),N(k)}else l(y);w=a(y)}if(w!==null)$=!0;else{var S=a(b);S!==null&&V(C,S.startTime-k),$=!1}}break e}finally{w=null,j=F,L=!1}$=void 0}}finally{$?ue():H=!1}}}var ue;if(typeof J=="function")ue=function(){J(xe)};else if(typeof MessageChannel<"u"){var je=new MessageChannel,Ge=je.port2;je.port1.onmessage=xe,ue=function(){Ge.postMessage(null)}}else ue=function(){z(xe,0)};function V(k,$){B=z(function(){k(r.unstable_now())},$)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(k){k.callback=null},r.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<k?Math.floor(1e3/k):5},r.unstable_getCurrentPriorityLevel=function(){return j},r.unstable_next=function(k){switch(j){case 1:case 2:case 3:var $=3;break;default:$=j}var F=j;j=$;try{return k()}finally{j=F}},r.unstable_requestPaint=function(){W=!0},r.unstable_runWithPriority=function(k,$){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var F=j;j=k;try{return $()}finally{j=F}},r.unstable_scheduleCallback=function(k,$,F){var re=r.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?re+F:re):F=re,k){case 1:var pe=-1;break;case 2:pe=250;break;case 5:pe=1073741823;break;case 4:pe=1e4;break;default:pe=5e3}return pe=F+pe,k={id:R++,callback:$,priorityLevel:k,startTime:F,expirationTime:pe,sortIndex:-1},F>re?(k.sortIndex=F,n(b,k),a(y)===null&&k===a(b)&&(P?(X(B),B=-1):P=!0,V(C,F-re))):(k.sortIndex=pe,n(y,k),K||L||(K=!0,H||(H=!0,ue()))),k},r.unstable_shouldYield=se,r.unstable_wrapCallback=function(k){var $=j;return function(){var F=j;j=$;try{return k.apply(this,arguments)}finally{j=F}}}})(Rc)),Rc}var Ep;function jv(){return Ep||(Ep=1,jc.exports=Ov()),jc.exports}var zc={exports:{}},ft={};var kp;function Rv(){if(kp)return ft;kp=1;var r=Pc();function n(y){var b="https://react.dev/errors/"+y;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var R=2;R<arguments.length;R++)b+="&args[]="+encodeURIComponent(arguments[R])}return"Minified React error #"+y+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var l={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},u=Symbol.for("react.portal");function f(y,b,R){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:w==null?null:""+w,children:y,containerInfo:b,implementation:R}}var d=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(y,b){if(y==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return ft.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,ft.createPortal=function(y,b){var R=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(n(299));return f(y,b,null,R)},ft.flushSync=function(y){var b=d.T,R=l.p;try{if(d.T=null,l.p=2,y)return y()}finally{d.T=b,l.p=R,l.d.f()}},ft.preconnect=function(y,b){typeof y=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,l.d.C(y,b))},ft.prefetchDNS=function(y){typeof y=="string"&&l.d.D(y)},ft.preinit=function(y,b){if(typeof y=="string"&&b&&typeof b.as=="string"){var R=b.as,w=m(R,b.crossOrigin),j=typeof b.integrity=="string"?b.integrity:void 0,L=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;R==="style"?l.d.S(y,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:w,integrity:j,fetchPriority:L}):R==="script"&&l.d.X(y,{crossOrigin:w,integrity:j,fetchPriority:L,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},ft.preinitModule=function(y,b){if(typeof y=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var R=m(b.as,b.crossOrigin);l.d.M(y,{crossOrigin:R,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})}}else b==null&&l.d.M(y)},ft.preload=function(y,b){if(typeof y=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var R=b.as,w=m(R,b.crossOrigin);l.d.L(y,R,{crossOrigin:w,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},ft.preloadModule=function(y,b){if(typeof y=="string")if(b){var R=m(b.as,b.crossOrigin);l.d.m(y,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:R,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else l.d.m(y)},ft.requestFormReset=function(y){l.d.r(y)},ft.unstable_batchedUpdates=function(y,b){return y(b)},ft.useFormState=function(y,b,R){return d.H.useFormState(y,b,R)},ft.useFormStatus=function(){return d.H.useHostTransitionStatus()},ft.version="19.2.8",ft}var Tp;function zv(){if(Tp)return zc.exports;Tp=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),zc.exports=Rv(),zc.exports}var _p;function Mv(){if(_p)return pa;_p=1;var r=jv(),n=Pc(),a=zv();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function d(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(f(e)!==e)throw Error(l(188))}function b(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(l(188));return t!==e?null:e}for(var i=e,s=t;;){var o=i.return;if(o===null)break;var c=o.alternate;if(c===null){if(s=o.return,s!==null){i=s;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===i)return y(o),e;if(c===s)return y(o),t;c=c.sibling}throw Error(l(188))}if(i.return!==s.return)i=o,s=c;else{for(var h=!1,p=o.child;p;){if(p===i){h=!0,i=o,s=c;break}if(p===s){h=!0,s=o,i=c;break}p=p.sibling}if(!h){for(p=c.child;p;){if(p===i){h=!0,i=c,s=o;break}if(p===s){h=!0,s=c,i=o;break}p=p.sibling}if(!h)throw Error(l(189))}}if(i.alternate!==s)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?e:t}function R(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=R(e),t!==null)return t;e=e.sibling}return null}var w=Object.assign,j=Symbol.for("react.element"),L=Symbol.for("react.transitional.element"),K=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),J=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),xe=Symbol.iterator;function ue(e){return e===null||typeof e!="object"?null:(e=xe&&e[xe]||e["@@iterator"],typeof e=="function"?e:null)}var je=Symbol.for("react.client.reference");function Ge(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===je?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case P:return"Fragment";case z:return"Profiler";case W:return"StrictMode";case C:return"Suspense";case H:return"SuspenseList";case ne:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case K:return"Portal";case J:return e.displayName||"Context";case X:return(e._context.displayName||"Context")+".Consumer";case N:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B:return t=e.displayName||null,t!==null?t:Ge(e.type)||"Memo";case Q:t=e._payload,e=e._init;try{return Ge(e(t))}catch{}}return null}var V=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},re=[],pe=-1;function S(e){return{current:e}}function q(e){0>pe||(e.current=re[pe],re[pe]=null,pe--)}function G(e,t){pe++,re[pe]=e.current,e.current=t}var ee=S(null),oe=S(null),he=S(null),Ee=S(null);function it(e,t){switch(G(he,t),G(oe,e),G(ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Md(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Md(t),e=Cd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(ee),G(ee,e)}function Ce(){q(ee),q(oe),q(he)}function ti(e){e.memoizedState!==null&&G(Ee,e);var t=ee.current,i=Cd(t,e.type);t!==i&&(G(oe,e),G(ee,i))}function Jt(e){oe.current===e&&(q(ee),q(oe)),Ee.current===e&&(q(Ee),ra._currentValue=F)}var ms,ys;function rn(e){if(ms===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);ms=t&&t[1]||"",ys=-1<i.stack.indexOf(`
1
+ var Sv=Object.create;var kc=Object.defineProperty;var xv=Object.getOwnPropertyDescriptor;var pp=(r,n)=>(n=Symbol[r])?n:Symbol.for("Symbol."+r),ha=r=>{throw TypeError(r)};var mp=(r,n,a)=>n in r?kc(r,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[n]=a;var fp=(r,n)=>kc(r,"name",{value:n,configurable:!0});var yp=r=>[,,,Sv(r?.[pp("metadata")]??null)],gp=["class","method","getter","setter","accessor","field","value","get","set"],fa=r=>r!==void 0&&typeof r!="function"?ha("Function expected"):r,Ev=(r,n,a,l,u)=>({kind:gp[r],name:n,metadata:l,addInitializer:f=>a._?ha("Already initialized"):u.push(fa(f||null))}),kv=(r,n)=>mp(n,pp("metadata"),r[3]),Tc=(r,n,a,l)=>{for(var u=0,f=r[n>>1],d=f&&f.length;u<d;u++)n&1?f[u].call(a):l=f[u].call(a,l);return l},Vl=(r,n,a,l,u,f)=>{var d,m,g,y,z,w=n&7,j=!!(n&8),L=!!(n&16),K=w>3?r.length+1:w?j?1:2:0,F=gp[w+5],ee=w>3&&(r[K-1]=[]),R=r[K]||(r[K]=[]),Z=w&&(!L&&!j&&(u=u.prototype),w<5&&(w>3||!L)&&xv(w<4?u:{get[a](){return hp(this,f)},set[a](N){return dp(this,f,N)}},a));w?L&&w<4&&fp(f,(w>2?"set ":w>1?"get ":"")+a):fp(u,a);for(var X=l.length-1;X>=0;X--)y=Ev(w,a,g={},r[3],R),w&&(y.static=j,y.private=L,z=y.access={has:L?N=>Tv(u,N):N=>a in N},w^3&&(z.get=L?N=>(w^1?hp:_v)(N,u,w^4?f:Z.get):N=>N[a]),w>2&&(z.set=L?(N,M)=>dp(N,u,M,w^4?f:Z.set):(N,M)=>N[a]=M)),m=(0,l[X])(w?w<4?L?f:Z[F]:w>4?void 0:{get:Z.get,set:Z.set}:u,y),g._=1,w^4||m===void 0?fa(m)&&(w>4?ee.unshift(m):w?L?f=m:Z[F]=m:u=m):typeof m!="object"||m===null?ha("Object expected"):(fa(d=m.get)&&(Z.get=d),fa(d=m.set)&&(Z.set=d),fa(d=m.init)&&ee.unshift(d));return w||kv(r,u),Z&&kc(u,a,Z),L?w^4?f:Z:u},vp=(r,n,a)=>mp(r,typeof n!="symbol"?n+"":n,a),_c=(r,n,a)=>n.has(r)||ha("Cannot "+a),Tv=(r,n)=>Object(n)!==n?ha('Cannot use the "in" operator on this value'):r.has(n),hp=(r,n,a)=>(_c(r,n,"read from private field"),a?a.call(r):n.get(r));var dp=(r,n,a,l)=>(_c(r,n,"write to private field"),l?l.call(r,a):n.set(r,a),a),_v=(r,n,a)=>(_c(r,n,"access private method"),a);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))l(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function a(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function l(u){if(u.ep)return;u.ep=!0;const f=a(u);fetch(u.href,f)}})();function Av(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ac={exports:{}},da={};var bp;function Nv(){if(bp)return da;bp=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(l,u,f){var d=null;if(f!==void 0&&(d=""+f),u.key!==void 0&&(d=""+u.key),"key"in u){f={};for(var m in u)m!=="key"&&(f[m]=u[m])}else f=u;return u=f.ref,{$$typeof:r,type:l,key:d,ref:u!==void 0?u:null,props:f}}return da.Fragment=n,da.jsx=a,da.jsxs=a,da}var wp;function Ov(){return wp||(wp=1,Ac.exports=Nv()),Ac.exports}var v=Ov(),Nc={exports:{}},ue={};var Sp;function jv(){if(Sp)return ue;Sp=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),j=Symbol.iterator;function L(S){return S===null||typeof S!="object"?null:(S=j&&S[j]||S["@@iterator"],typeof S=="function"?S:null)}var K={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},F=Object.assign,ee={};function R(S,q,G){this.props=S,this.context=q,this.refs=ee,this.updater=G||K}R.prototype.isReactComponent={},R.prototype.setState=function(S,q){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,q,"setState")},R.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function Z(){}Z.prototype=R.prototype;function X(S,q,G){this.props=S,this.context=q,this.refs=ee,this.updater=G||K}var N=X.prototype=new Z;N.constructor=X,F(N,R.prototype),N.isPureReactComponent=!0;var M=Array.isArray;function H(){}var B={H:null,A:null,T:null,S:null},Q=Object.prototype.hasOwnProperty;function ne(S,q,G){var P=G.ref;return{$$typeof:r,type:S,key:q,ref:P!==void 0?P:null,props:G}}function se(S,q){return ne(S.type,q,S.props)}function xe(S){return typeof S=="object"&&S!==null&&S.$$typeof===r}function oe(S){var q={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(G){return q[G]})}var je=/\/+/g;function Ge(S,q){return typeof S=="object"&&S!==null&&S.key!=null?oe(""+S.key):q.toString(36)}function V(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(H,H):(S.status="pending",S.then(function(q){S.status==="pending"&&(S.status="fulfilled",S.value=q)},function(q){S.status==="pending"&&(S.status="rejected",S.reason=q)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function k(S,q,G,P,ce){var he=typeof S;(he==="undefined"||he==="boolean")&&(S=null);var Ee=!1;if(S===null)Ee=!0;else switch(he){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(S.$$typeof){case r:case n:Ee=!0;break;case z:return Ee=S._init,k(Ee(S._payload),q,G,P,ce)}}if(Ee)return ce=ce(S),Ee=P===""?"."+Ge(S,0):P,M(ce)?(G="",Ee!=null&&(G=Ee.replace(je,"$&/")+"/"),k(ce,q,G,"",function(ti){return ti})):ce!=null&&(xe(ce)&&(ce=se(ce,G+(ce.key==null||S&&S.key===ce.key?"":(""+ce.key).replace(je,"$&/")+"/")+Ee)),q.push(ce)),1;Ee=0;var it=P===""?".":P+":";if(M(S))for(var Ce=0;Ce<S.length;Ce++)P=S[Ce],he=it+Ge(P,Ce),Ee+=k(P,q,G,he,ce);else if(Ce=L(S),typeof Ce=="function")for(S=Ce.call(S),Ce=0;!(P=S.next()).done;)P=P.value,he=it+Ge(P,Ce++),Ee+=k(P,q,G,he,ce);else if(he==="object"){if(typeof S.then=="function")return k(V(S),q,G,P,ce);throw q=String(S),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function $(S,q,G){if(S==null)return S;var P=[],ce=0;return k(S,P,"","",function(he){return q.call(G,he,ce++)}),P}function W(S){if(S._status===-1){var q=S._result;q=q(),q.then(function(G){(S._status===0||S._status===-1)&&(S._status=1,S._result=G)},function(G){(S._status===0||S._status===-1)&&(S._status=2,S._result=G)}),S._status===-1&&(S._status=0,S._result=q)}if(S._status===1)return S._result.default;throw S._result}var re=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},pe={map:$,forEach:function(S,q,G){$(S,function(){q.apply(this,arguments)},G)},count:function(S){var q=0;return $(S,function(){q++}),q},toArray:function(S){return $(S,function(q){return q})||[]},only:function(S){if(!xe(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return ue.Activity=w,ue.Children=pe,ue.Component=R,ue.Fragment=a,ue.Profiler=u,ue.PureComponent=X,ue.StrictMode=l,ue.Suspense=g,ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,ue.__COMPILER_RUNTIME={__proto__:null,c:function(S){return B.H.useMemoCache(S)}},ue.cache=function(S){return function(){return S.apply(null,arguments)}},ue.cacheSignal=function(){return null},ue.cloneElement=function(S,q,G){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var P=F({},S.props),ce=S.key;if(q!=null)for(he in q.key!==void 0&&(ce=""+q.key),q)!Q.call(q,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&q.ref===void 0||(P[he]=q[he]);var he=arguments.length-2;if(he===1)P.children=G;else if(1<he){for(var Ee=Array(he),it=0;it<he;it++)Ee[it]=arguments[it+2];P.children=Ee}return ne(S.type,ce,P)},ue.createContext=function(S){return S={$$typeof:d,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:f,_context:S},S},ue.createElement=function(S,q,G){var P,ce={},he=null;if(q!=null)for(P in q.key!==void 0&&(he=""+q.key),q)Q.call(q,P)&&P!=="key"&&P!=="__self"&&P!=="__source"&&(ce[P]=q[P]);var Ee=arguments.length-2;if(Ee===1)ce.children=G;else if(1<Ee){for(var it=Array(Ee),Ce=0;Ce<Ee;Ce++)it[Ce]=arguments[Ce+2];ce.children=it}if(S&&S.defaultProps)for(P in Ee=S.defaultProps,Ee)ce[P]===void 0&&(ce[P]=Ee[P]);return ne(S,he,ce)},ue.createRef=function(){return{current:null}},ue.forwardRef=function(S){return{$$typeof:m,render:S}},ue.isValidElement=xe,ue.lazy=function(S){return{$$typeof:z,_payload:{_status:-1,_result:S},_init:W}},ue.memo=function(S,q){return{$$typeof:y,type:S,compare:q===void 0?null:q}},ue.startTransition=function(S){var q=B.T,G={};B.T=G;try{var P=S(),ce=B.S;ce!==null&&ce(G,P),typeof P=="object"&&P!==null&&typeof P.then=="function"&&P.then(H,re)}catch(he){re(he)}finally{q!==null&&G.types!==null&&(q.types=G.types),B.T=q}},ue.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},ue.use=function(S){return B.H.use(S)},ue.useActionState=function(S,q,G){return B.H.useActionState(S,q,G)},ue.useCallback=function(S,q){return B.H.useCallback(S,q)},ue.useContext=function(S){return B.H.useContext(S)},ue.useDebugValue=function(){},ue.useDeferredValue=function(S,q){return B.H.useDeferredValue(S,q)},ue.useEffect=function(S,q){return B.H.useEffect(S,q)},ue.useEffectEvent=function(S){return B.H.useEffectEvent(S)},ue.useId=function(){return B.H.useId()},ue.useImperativeHandle=function(S,q,G){return B.H.useImperativeHandle(S,q,G)},ue.useInsertionEffect=function(S,q){return B.H.useInsertionEffect(S,q)},ue.useLayoutEffect=function(S,q){return B.H.useLayoutEffect(S,q)},ue.useMemo=function(S,q){return B.H.useMemo(S,q)},ue.useOptimistic=function(S,q){return B.H.useOptimistic(S,q)},ue.useReducer=function(S,q,G){return B.H.useReducer(S,q,G)},ue.useRef=function(S){return B.H.useRef(S)},ue.useState=function(S){return B.H.useState(S)},ue.useSyncExternalStore=function(S,q,G){return B.H.useSyncExternalStore(S,q,G)},ue.useTransition=function(){return B.H.useTransition()},ue.version="19.2.8",ue}var xp;function eu(){return xp||(xp=1,Nc.exports=jv()),Nc.exports}var J=eu(),Oc={exports:{}},pa={},jc={exports:{}},Rc={};var Ep;function Rv(){return Ep||(Ep=1,(function(r){function n(k,$){var W=k.length;k.push($);e:for(;0<W;){var re=W-1>>>1,pe=k[re];if(0<u(pe,$))k[re]=$,k[W]=pe,W=re;else break e}}function a(k){return k.length===0?null:k[0]}function l(k){if(k.length===0)return null;var $=k[0],W=k.pop();if(W!==$){k[0]=W;e:for(var re=0,pe=k.length,S=pe>>>1;re<S;){var q=2*(re+1)-1,G=k[q],P=q+1,ce=k[P];if(0>u(G,W))P<pe&&0>u(ce,G)?(k[re]=ce,k[P]=W,re=P):(k[re]=G,k[q]=W,re=q);else if(P<pe&&0>u(ce,W))k[re]=ce,k[P]=W,re=P;else break e}}return $}function u(k,$){var W=k.sortIndex-$.sortIndex;return W!==0?W:k.id-$.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;r.unstable_now=function(){return f.now()}}else{var d=Date,m=d.now();r.unstable_now=function(){return d.now()-m}}var g=[],y=[],z=1,w=null,j=3,L=!1,K=!1,F=!1,ee=!1,R=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function N(k){for(var $=a(y);$!==null;){if($.callback===null)l(y);else if($.startTime<=k)l(y),$.sortIndex=$.expirationTime,n(g,$);else break;$=a(y)}}function M(k){if(F=!1,N(k),!K)if(a(g)!==null)K=!0,H||(H=!0,oe());else{var $=a(y);$!==null&&V(M,$.startTime-k)}}var H=!1,B=-1,Q=5,ne=-1;function se(){return ee?!0:!(r.unstable_now()-ne<Q)}function xe(){if(ee=!1,H){var k=r.unstable_now();ne=k;var $=!0;try{e:{K=!1,F&&(F=!1,Z(B),B=-1),L=!0;var W=j;try{t:{for(N(k),w=a(g);w!==null&&!(w.expirationTime>k&&se());){var re=w.callback;if(typeof re=="function"){w.callback=null,j=w.priorityLevel;var pe=re(w.expirationTime<=k);if(k=r.unstable_now(),typeof pe=="function"){w.callback=pe,N(k),$=!0;break t}w===a(g)&&l(g),N(k)}else l(g);w=a(g)}if(w!==null)$=!0;else{var S=a(y);S!==null&&V(M,S.startTime-k),$=!1}}break e}finally{w=null,j=W,L=!1}$=void 0}}finally{$?oe():H=!1}}}var oe;if(typeof X=="function")oe=function(){X(xe)};else if(typeof MessageChannel<"u"){var je=new MessageChannel,Ge=je.port2;je.port1.onmessage=xe,oe=function(){Ge.postMessage(null)}}else oe=function(){R(xe,0)};function V(k,$){B=R(function(){k(r.unstable_now())},$)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(k){k.callback=null},r.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<k?Math.floor(1e3/k):5},r.unstable_getCurrentPriorityLevel=function(){return j},r.unstable_next=function(k){switch(j){case 1:case 2:case 3:var $=3;break;default:$=j}var W=j;j=$;try{return k()}finally{j=W}},r.unstable_requestPaint=function(){ee=!0},r.unstable_runWithPriority=function(k,$){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var W=j;j=k;try{return $()}finally{j=W}},r.unstable_scheduleCallback=function(k,$,W){var re=r.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?re+W:re):W=re,k){case 1:var pe=-1;break;case 2:pe=250;break;case 5:pe=1073741823;break;case 4:pe=1e4;break;default:pe=5e3}return pe=W+pe,k={id:z++,callback:$,priorityLevel:k,startTime:W,expirationTime:pe,sortIndex:-1},W>re?(k.sortIndex=W,n(y,k),a(g)===null&&k===a(y)&&(F?(Z(B),B=-1):F=!0,V(M,W-re))):(k.sortIndex=pe,n(g,k),K||L||(K=!0,H||(H=!0,oe()))),k},r.unstable_shouldYield=se,r.unstable_wrapCallback=function(k){var $=j;return function(){var W=j;j=$;try{return k.apply(this,arguments)}finally{j=W}}}})(Rc)),Rc}var kp;function zv(){return kp||(kp=1,jc.exports=Rv()),jc.exports}var zc={exports:{}},ft={};var Tp;function Mv(){if(Tp)return ft;Tp=1;var r=eu();function n(g){var y="https://react.dev/errors/"+g;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var z=2;z<arguments.length;z++)y+="&args[]="+encodeURIComponent(arguments[z])}return"Minified React error #"+g+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var l={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},u=Symbol.for("react.portal");function f(g,y,z){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:w==null?null:""+w,children:g,containerInfo:y,implementation:z}}var d=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,y){if(g==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return ft.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,ft.createPortal=function(g,y){var z=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 f(g,y,null,z)},ft.flushSync=function(g){var y=d.T,z=l.p;try{if(d.T=null,l.p=2,g)return g()}finally{d.T=y,l.p=z,l.d.f()}},ft.preconnect=function(g,y){typeof g=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,l.d.C(g,y))},ft.prefetchDNS=function(g){typeof g=="string"&&l.d.D(g)},ft.preinit=function(g,y){if(typeof g=="string"&&y&&typeof y.as=="string"){var z=y.as,w=m(z,y.crossOrigin),j=typeof y.integrity=="string"?y.integrity:void 0,L=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;z==="style"?l.d.S(g,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:w,integrity:j,fetchPriority:L}):z==="script"&&l.d.X(g,{crossOrigin:w,integrity:j,fetchPriority:L,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},ft.preinitModule=function(g,y){if(typeof g=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var z=m(y.as,y.crossOrigin);l.d.M(g,{crossOrigin:z,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&l.d.M(g)},ft.preload=function(g,y){if(typeof g=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var z=y.as,w=m(z,y.crossOrigin);l.d.L(g,z,{crossOrigin:w,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})}},ft.preloadModule=function(g,y){if(typeof g=="string")if(y){var z=m(y.as,y.crossOrigin);l.d.m(g,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:z,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else l.d.m(g)},ft.requestFormReset=function(g){l.d.r(g)},ft.unstable_batchedUpdates=function(g,y){return g(y)},ft.useFormState=function(g,y,z){return d.H.useFormState(g,y,z)},ft.useFormStatus=function(){return d.H.useHostTransitionStatus()},ft.version="19.2.8",ft}var _p;function Cv(){if(_p)return zc.exports;_p=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),zc.exports=Mv(),zc.exports}var Ap;function Uv(){if(Ap)return pa;Ap=1;var r=zv(),n=eu(),a=Cv();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function d(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(f(e)!==e)throw Error(l(188))}function y(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(l(188));return t!==e?null:e}for(var i=e,s=t;;){var o=i.return;if(o===null)break;var c=o.alternate;if(c===null){if(s=o.return,s!==null){i=s;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===i)return g(o),e;if(c===s)return g(o),t;c=c.sibling}throw Error(l(188))}if(i.return!==s.return)i=o,s=c;else{for(var h=!1,p=o.child;p;){if(p===i){h=!0,i=o,s=c;break}if(p===s){h=!0,s=o,i=c;break}p=p.sibling}if(!h){for(p=c.child;p;){if(p===i){h=!0,i=c,s=o;break}if(p===s){h=!0,s=c,i=o;break}p=p.sibling}if(!h)throw Error(l(189))}}if(i.alternate!==s)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?e:t}function z(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=z(e),t!==null)return t;e=e.sibling}return null}var w=Object.assign,j=Symbol.for("react.element"),L=Symbol.for("react.transitional.element"),K=Symbol.for("react.portal"),F=Symbol.for("react.fragment"),ee=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),X=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),xe=Symbol.iterator;function oe(e){return e===null||typeof e!="object"?null:(e=xe&&e[xe]||e["@@iterator"],typeof e=="function"?e:null)}var je=Symbol.for("react.client.reference");function Ge(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===je?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case F:return"Fragment";case R:return"Profiler";case ee:return"StrictMode";case M:return"Suspense";case H:return"SuspenseList";case ne:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case K:return"Portal";case X:return e.displayName||"Context";case Z:return(e._context.displayName||"Context")+".Consumer";case N:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B:return t=e.displayName||null,t!==null?t:Ge(e.type)||"Memo";case Q:t=e._payload,e=e._init;try{return Ge(e(t))}catch{}}return null}var V=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},re=[],pe=-1;function S(e){return{current:e}}function q(e){0>pe||(e.current=re[pe],re[pe]=null,pe--)}function G(e,t){pe++,re[pe]=e.current,e.current=t}var P=S(null),ce=S(null),he=S(null),Ee=S(null);function it(e,t){switch(G(he,t),G(ce,e),G(P,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Cd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Cd(t),e=Ud(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(P),G(P,e)}function Ce(){q(P),q(ce),q(he)}function ti(e){e.memoizedState!==null&&G(Ee,e);var t=P.current,i=Ud(t,e.type);t!==i&&(G(ce,e),G(P,i))}function Jt(e){ce.current===e&&(q(P),q(ce)),Ee.current===e&&(q(Ee),ra._currentValue=W)}var ms,ys;function rn(e){if(ms===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);ms=t&&t[1]||"",ys=-1<i.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+ms+e+ys}var gs=!1;function ni(e,t){if(!e||gs)return"";gs=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var D=function(){throw Error()};if(Object.defineProperty(D.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(D,[])}catch(O){var A=O}Reflect.construct(e,[],D)}else{try{D.call()}catch(O){A=O}e.call(D.prototype)}}else{try{throw Error()}catch(O){A=O}(D=e())&&typeof D.catch=="function"&&D.catch(function(){})}}catch(O){if(O&&A&&typeof O.stack=="string")return[O.stack,A.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=s.DetermineComponentFrameRoot(),h=c[0],p=c[1];if(h&&p){var v=h.split(`
3
+ `+ms+e+ys}var gs=!1;function ni(e,t){if(!e||gs)return"";gs=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var D=function(){throw Error()};if(Object.defineProperty(D.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(D,[])}catch(O){var A=O}Reflect.construct(e,[],D)}else{try{D.call()}catch(O){A=O}e.call(D.prototype)}}else{try{throw Error()}catch(O){A=O}(D=e())&&typeof D.catch=="function"&&D.catch(function(){})}}catch(O){if(O&&A&&typeof O.stack=="string")return[O.stack,A.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=s.DetermineComponentFrameRoot(),h=c[0],p=c[1];if(h&&p){var b=h.split(`
4
4
  `),_=p.split(`
5
- `);for(o=s=0;s<v.length&&!v[s].includes("DetermineComponentFrameRoot");)s++;for(;o<_.length&&!_[o].includes("DetermineComponentFrameRoot");)o++;if(s===v.length||o===_.length)for(s=v.length-1,o=_.length-1;1<=s&&0<=o&&v[s]!==_[o];)o--;for(;1<=s&&0<=o;s--,o--)if(v[s]!==_[o]){if(s!==1||o!==1)do if(s--,o--,0>o||v[s]!==_[o]){var M=`
6
- `+v[s].replace(" at new "," at ");return e.displayName&&M.includes("<anonymous>")&&(M=M.replace("<anonymous>",e.displayName)),M}while(1<=s&&0<=o);break}}}finally{gs=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?rn(i):""}function Ft(e,t){switch(e.tag){case 26:case 27:case 5:return rn(e.type);case 16:return rn("Lazy");case 13:return e.child!==t&&t!==null?rn("Suspense Fallback"):rn("Suspense");case 19:return rn("SuspenseList");case 0:case 15:return ni(e.type,!1);case 11:return ni(e.type.render,!1);case 1:return ni(e.type,!0);case 31:return rn("Activity");default:return""}}function vs(e){try{var t="",i=null;do t+=Ft(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
5
+ `);for(o=s=0;s<b.length&&!b[s].includes("DetermineComponentFrameRoot");)s++;for(;o<_.length&&!_[o].includes("DetermineComponentFrameRoot");)o++;if(s===b.length||o===_.length)for(s=b.length-1,o=_.length-1;1<=s&&0<=o&&b[s]!==_[o];)o--;for(;1<=s&&0<=o;s--,o--)if(b[s]!==_[o]){if(s!==1||o!==1)do if(s--,o--,0>o||b[s]!==_[o]){var C=`
6
+ `+b[s].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),C}while(1<=s&&0<=o);break}}}finally{gs=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?rn(i):""}function Ft(e,t){switch(e.tag){case 26:case 27:case 5:return rn(e.type);case 16:return rn("Lazy");case 13:return e.child!==t&&t!==null?rn("Suspense Fallback"):rn("Suspense");case 19:return rn("SuspenseList");case 0:case 15:return ni(e.type,!1);case 11:return ni(e.type.render,!1);case 1:return ni(e.type,!0);case 31:return rn("Activity");default:return""}}function vs(e){try{var t="",i=null;do t+=Ft(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
7
7
  Error generating stack: `+s.message+`
8
- `+s.stack}}var Y=Object.prototype.hasOwnProperty,ae=r.unstable_scheduleCallback,De=r.unstable_cancelCallback,me=r.unstable_shouldYield,st=r.unstable_requestPaint,Qe=r.unstable_now,Ei=r.unstable_getCurrentPriorityLevel,uu=r.unstable_ImmediatePriority,fu=r.unstable_UserBlockingPriority,_a=r.unstable_NormalPriority,ey=r.unstable_LowPriority,hu=r.unstable_IdlePriority,ty=r.log,ny=r.unstable_setDisableYieldValue,bs=null,St=null;function An(e){if(typeof ty=="function"&&ny(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(bs,e)}catch{}}var xt=Math.clz32?Math.clz32:ay,iy=Math.log,sy=Math.LN2;function ay(e){return e>>>=0,e===0?32:31-(iy(e)/sy|0)|0}var Aa=256,Na=262144,Oa=4194304;function ii(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ja(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var o=0,c=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var p=s&134217727;return p!==0?(s=p&~c,s!==0?o=ii(s):(h&=p,h!==0?o=ii(h):i||(i=p&~e,i!==0&&(o=ii(i))))):(p=s&~c,p!==0?o=ii(p):h!==0?o=ii(h):i||(i=s&~e,i!==0&&(o=ii(i)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,i=t&-t,c>=i||c===32&&(i&4194048)!==0)?t:o}function ws(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ly(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 du(){var e=Oa;return Oa<<=1,(Oa&62914560)===0&&(Oa=4194304),e}function fr(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Ss(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ry(e,t,i,s,o,c){var h=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var p=e.entanglements,v=e.expirationTimes,_=e.hiddenUpdates;for(i=h&~i;0<i;){var M=31-xt(i),D=1<<M;p[M]=0,v[M]=-1;var A=_[M];if(A!==null)for(_[M]=null,M=0;M<A.length;M++){var O=A[M];O!==null&&(O.lane&=-536870913)}i&=~D}s!==0&&pu(e,s,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(h&~t))}function pu(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-xt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function mu(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-xt(i),o=1<<s;o&t|e[s]&t&&(e[s]|=t),i&=~o}}function yu(e,t){var i=t&-t;return i=(i&42)!==0?1:hr(i),(i&(e.suspendedLanes|t))!==0?0:i}function hr(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 dr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function gu(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:ip(e.type))}function vu(e,t){var i=$.p;try{return $.p=e,t()}finally{$.p=i}}var Nn=Math.random().toString(36).slice(2),at="__reactFiber$"+Nn,pt="__reactProps$"+Nn,ki="__reactContainer$"+Nn,pr="__reactEvents$"+Nn,oy="__reactListeners$"+Nn,cy="__reactHandles$"+Nn,bu="__reactResources$"+Nn,xs="__reactMarker$"+Nn;function mr(e){delete e[at],delete e[pt],delete e[pr],delete e[oy],delete e[cy]}function Ti(e){var t=e[at];if(t)return t;for(var i=e.parentNode;i;){if(t=i[ki]||i[at]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=$d(e);e!==null;){if(i=e[at])return i;e=$d(e)}return t}e=i,i=e.parentNode}return null}function _i(e){if(e=e[at]||e[ki]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Es(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function Ai(e){var t=e[bu];return t||(t=e[bu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function tt(e){e[xs]=!0}var wu=new Set,Su={};function si(e,t){Ni(e,t),Ni(e+"Capture",t)}function Ni(e,t){for(Su[e]=t,e=0;e<t.length;e++)wu.add(t[e])}var uy=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]*$"),xu={},Eu={};function fy(e){return Y.call(Eu,e)?!0:Y.call(xu,e)?!1:uy.test(e)?Eu[e]=!0:(xu[e]=!0,!1)}function Ra(e,t,i){if(fy(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function za(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function on(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+s)}}function Rt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ku(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hy(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var o=s.get,c=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(h){i=""+h,c.call(this,h)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(h){i=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yr(e){if(!e._valueTracker){var t=ku(e)?"checked":"value";e._valueTracker=hy(e,t,""+e[t])}}function Tu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=ku(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function Ma(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var dy=/[\n"\\]/g;function zt(e){return e.replace(dy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function gr(e,t,i,s,o,c,h,p){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Rt(t)):e.value!==""+Rt(t)&&(e.value=""+Rt(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?vr(e,h,Rt(t)):i!=null?vr(e,h,Rt(i)):s!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+Rt(p):e.removeAttribute("name")}function _u(e,t,i,s,o,c,h,p){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||i!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){yr(e);return}i=i!=null?""+Rt(i):"",t=t!=null?""+Rt(t):i,p||t===e.value||(e.value=t),e.defaultValue=t}s=s??o,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=p?e.checked:!!s,e.defaultChecked=!!s,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),yr(e)}function vr(e,t,i){t==="number"&&Ma(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Oi(e,t,i,s){if(e=e.options,t){t={};for(var o=0;o<i.length;o++)t["$"+i[o]]=!0;for(i=0;i<e.length;i++)o=t.hasOwnProperty("$"+e[i].value),e[i].selected!==o&&(e[i].selected=o),o&&s&&(e[i].defaultSelected=!0)}else{for(i=""+Rt(i),t=null,o=0;o<e.length;o++){if(e[o].value===i){e[o].selected=!0,s&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Au(e,t,i){if(t!=null&&(t=""+Rt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Rt(i):""}function Nu(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(l(92));if(V(s)){if(1<s.length)throw Error(l(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=Rt(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),yr(e)}function ji(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var py=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 Ou(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||py.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function ju(e,t,i){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var o in t)s=t[o],t.hasOwnProperty(o)&&i[o]!==s&&Ou(e,o,s)}else for(var c in t)t.hasOwnProperty(c)&&Ou(e,c,t[c])}function br(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 my=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),yy=/^[\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 Ca(e){return yy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function cn(){}var wr=null;function Sr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ri=null,zi=null;function Ru(e){var t=_i(e);if(t&&(e=t.stateNode)){var i=e[pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(gr(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+zt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var o=s[pt]||null;if(!o)throw Error(l(90));gr(s,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&Tu(s)}break e;case"textarea":Au(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Oi(e,!!i.multiple,t,!1)}}}var xr=!1;function zu(e,t,i){if(xr)return e(t,i);xr=!0;try{var s=e(t);return s}finally{if(xr=!1,(Ri!==null||zi!==null)&&(Sl(),Ri&&(t=Ri,e=zi,zi=Ri=null,Ru(t),e)))for(t=0;t<e.length;t++)Ru(e[t])}}function ks(e,t){var i=e.stateNode;if(i===null)return null;var s=i[pt]||null;if(s===null)return null;i=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(l(231,t,typeof i));return i}var un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Er=!1;if(un)try{var Ts={};Object.defineProperty(Ts,"passive",{get:function(){Er=!0}}),window.addEventListener("test",Ts,Ts),window.removeEventListener("test",Ts,Ts)}catch{Er=!1}var On=null,kr=null,Ua=null;function Mu(){if(Ua)return Ua;var e,t=kr,i=t.length,s,o="value"in On?On.value:On.textContent,c=o.length;for(e=0;e<i&&t[e]===o[e];e++);var h=i-e;for(s=1;s<=h&&t[i-s]===o[c-s];s++);return Ua=o.slice(e,1<s?1-s:void 0)}function Da(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 Ba(){return!0}function Cu(){return!1}function mt(e){function t(i,s,o,c,h){this._reactName=i,this._targetInst=o,this.type=s,this.nativeEvent=c,this.target=h,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(i=e[p],this[p]=i?i(c):c[p]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Ba:Cu,this.isPropagationStopped=Cu,this}return w(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Ba)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Ba)},persist:function(){},isPersistent:Ba}),t}var ai={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qa=mt(ai),_s=w({},ai,{view:0,detail:0}),gy=mt(_s),Tr,_r,As,La=w({},_s,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nr,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!==As&&(As&&e.type==="mousemove"?(Tr=e.screenX-As.screenX,_r=e.screenY-As.screenY):_r=Tr=0,As=e),Tr)},movementY:function(e){return"movementY"in e?e.movementY:_r}}),Uu=mt(La),vy=w({},La,{dataTransfer:0}),by=mt(vy),wy=w({},_s,{relatedTarget:0}),Ar=mt(wy),Sy=w({},ai,{animationName:0,elapsedTime:0,pseudoElement:0}),xy=mt(Sy),Ey=w({},ai,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ky=mt(Ey),Ty=w({},ai,{data:0}),Du=mt(Ty),_y={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ay={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"},Ny={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Oy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ny[e])?!!t[e]:!1}function Nr(){return Oy}var jy=w({},_s,{key:function(e){if(e.key){var t=_y[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Da(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ay[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nr,charCode:function(e){return e.type==="keypress"?Da(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Da(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ry=mt(jy),zy=w({},La,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bu=mt(zy),My=w({},_s,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nr}),Cy=mt(My),Uy=w({},ai,{propertyName:0,elapsedTime:0,pseudoElement:0}),Dy=mt(Uy),By=w({},La,{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}),qy=mt(By),Ly=w({},ai,{newState:0,oldState:0}),Hy=mt(Ly),$y=[9,13,27,32],Or=un&&"CompositionEvent"in window,Ns=null;un&&"documentMode"in document&&(Ns=document.documentMode);var Yy=un&&"TextEvent"in window&&!Ns,qu=un&&(!Or||Ns&&8<Ns&&11>=Ns),Lu=" ",Hu=!1;function $u(e,t){switch(e){case"keyup":return $y.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Mi=!1;function Vy(e,t){switch(e){case"compositionend":return Yu(t);case"keypress":return t.which!==32?null:(Hu=!0,Lu);case"textInput":return e=t.data,e===Lu&&Hu?null:e;default:return null}}function Xy(e,t){if(Mi)return e==="compositionend"||!Or&&$u(e,t)?(e=Mu(),Ua=kr=On=null,Mi=!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 qu&&t.locale!=="ko"?null:t.data;default:return null}}var Gy={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 Vu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Gy[e.type]:t==="textarea"}function Xu(e,t,i,s){Ri?zi?zi.push(s):zi=[s]:Ri=s,t=Nl(t,"onChange"),0<t.length&&(i=new qa("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var Os=null,js=null;function Qy(e){Ad(e,0)}function Ha(e){var t=Es(e);if(Tu(t))return e}function Gu(e,t){if(e==="change")return t}var Qu=!1;if(un){var jr;if(un){var Rr="oninput"in document;if(!Rr){var Ku=document.createElement("div");Ku.setAttribute("oninput","return;"),Rr=typeof Ku.oninput=="function"}jr=Rr}else jr=!1;Qu=jr&&(!document.documentMode||9<document.documentMode)}function Zu(){Os&&(Os.detachEvent("onpropertychange",Ju),js=Os=null)}function Ju(e){if(e.propertyName==="value"&&Ha(js)){var t=[];Xu(t,js,e,Sr(e)),zu(Qy,t)}}function Ky(e,t,i){e==="focusin"?(Zu(),Os=t,js=i,Os.attachEvent("onpropertychange",Ju)):e==="focusout"&&Zu()}function Zy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ha(js)}function Jy(e,t){if(e==="click")return Ha(t)}function Fy(e,t){if(e==="input"||e==="change")return Ha(t)}function Wy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Et=typeof Object.is=="function"?Object.is:Wy;function Rs(e,t){if(Et(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var o=i[s];if(!Y.call(t,o)||!Et(e[o],t[o]))return!1}return!0}function Fu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wu(e,t){var i=Fu(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Fu(i)}}function Iu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Iu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ma(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Ma(e.document)}return t}function zr(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 Iy=un&&"documentMode"in document&&11>=document.documentMode,Ci=null,Mr=null,zs=null,Cr=!1;function ef(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Cr||Ci==null||Ci!==Ma(s)||(s=Ci,"selectionStart"in s&&zr(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),zs&&Rs(zs,s)||(zs=s,s=Nl(Mr,"onSelect"),0<s.length&&(t=new qa("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=Ci)))}function li(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ui={animationend:li("Animation","AnimationEnd"),animationiteration:li("Animation","AnimationIteration"),animationstart:li("Animation","AnimationStart"),transitionrun:li("Transition","TransitionRun"),transitionstart:li("Transition","TransitionStart"),transitioncancel:li("Transition","TransitionCancel"),transitionend:li("Transition","TransitionEnd")},Ur={},tf={};un&&(tf=document.createElement("div").style,"AnimationEvent"in window||(delete Ui.animationend.animation,delete Ui.animationiteration.animation,delete Ui.animationstart.animation),"TransitionEvent"in window||delete Ui.transitionend.transition);function ri(e){if(Ur[e])return Ur[e];if(!Ui[e])return e;var t=Ui[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in tf)return Ur[e]=t[i];return e}var nf=ri("animationend"),sf=ri("animationiteration"),af=ri("animationstart"),Py=ri("transitionrun"),eg=ri("transitionstart"),tg=ri("transitioncancel"),lf=ri("transitionend"),rf=new Map,Dr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Dr.push("scrollEnd");function Yt(e,t){rf.set(e,t),si(t,[e])}var $a=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)},Mt=[],Di=0,Br=0;function Ya(){for(var e=Di,t=Br=Di=0;t<e;){var i=Mt[t];Mt[t++]=null;var s=Mt[t];Mt[t++]=null;var o=Mt[t];Mt[t++]=null;var c=Mt[t];if(Mt[t++]=null,s!==null&&o!==null){var h=s.pending;h===null?o.next=o:(o.next=h.next,h.next=o),s.pending=o}c!==0&&of(i,o,c)}}function Va(e,t,i,s){Mt[Di++]=e,Mt[Di++]=t,Mt[Di++]=i,Mt[Di++]=s,Br|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function qr(e,t,i,s){return Va(e,t,i,s),Xa(e)}function oi(e,t){return Va(e,null,null,t),Xa(e)}function of(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var o=!1,c=e.return;c!==null;)c.childLanes|=i,s=c.alternate,s!==null&&(s.childLanes|=i),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(o=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,o&&t!==null&&(o=31-xt(i),e=c.hiddenUpdates,s=e[o],s===null?e[o]=[t]:s.push(t),t.lane=i|536870912),c):null}function Xa(e){if(50<ea)throw ea=0,Zo=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Bi={};function ng(e,t,i,s){this.tag=e,this.key=i,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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kt(e,t,i,s){return new ng(e,t,i,s)}function Lr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fn(e,t){var i=e.alternate;return i===null?(i=kt(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function cf(e,t){e.flags&=65011714;var i=e.alternate;return i===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=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ga(e,t,i,s,o,c){var h=0;if(s=e,typeof e=="function")Lr(e)&&(h=1);else if(typeof e=="string")h=rv(e,i,ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ne:return e=kt(31,i,t,o),e.elementType=ne,e.lanes=c,e;case P:return ci(i.children,o,c,t);case W:h=8,o|=24;break;case z:return e=kt(12,i,t,o|2),e.elementType=z,e.lanes=c,e;case C:return e=kt(13,i,t,o),e.elementType=C,e.lanes=c,e;case H:return e=kt(19,i,t,o),e.elementType=H,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case J:h=10;break e;case X:h=9;break e;case N:h=11;break e;case B:h=14;break e;case Q:h=16,s=null;break e}h=29,i=Error(l(130,e===null?"null":typeof e,"")),s=null}return t=kt(h,i,t,o),t.elementType=e,t.type=s,t.lanes=c,t}function ci(e,t,i,s){return e=kt(7,e,s,t),e.lanes=i,e}function Hr(e,t,i){return e=kt(6,e,null,t),e.lanes=i,e}function uf(e){var t=kt(18,null,null,0);return t.stateNode=e,t}function $r(e,t,i){return t=kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ff=new WeakMap;function Ct(e,t){if(typeof e=="object"&&e!==null){var i=ff.get(e);return i!==void 0?i:(t={value:e,source:t,stack:vs(t)},ff.set(e,t),t)}return{value:e,source:t,stack:vs(t)}}var qi=[],Li=0,Qa=null,Ms=0,Ut=[],Dt=0,jn=null,Wt=1,It="";function hn(e,t){qi[Li++]=Ms,qi[Li++]=Qa,Qa=e,Ms=t}function hf(e,t,i){Ut[Dt++]=Wt,Ut[Dt++]=It,Ut[Dt++]=jn,jn=e;var s=Wt;e=It;var o=32-xt(s)-1;s&=~(1<<o),i+=1;var c=32-xt(t)+o;if(30<c){var h=o-o%5;c=(s&(1<<h)-1).toString(32),s>>=h,o-=h,Wt=1<<32-xt(t)+o|i<<o|s,It=c+e}else Wt=1<<c|i<<o|s,It=e}function Yr(e){e.return!==null&&(hn(e,1),hf(e,1,0))}function Vr(e){for(;e===Qa;)Qa=qi[--Li],qi[Li]=null,Ms=qi[--Li],qi[Li]=null;for(;e===jn;)jn=Ut[--Dt],Ut[Dt]=null,It=Ut[--Dt],Ut[Dt]=null,Wt=Ut[--Dt],Ut[Dt]=null}function df(e,t){Ut[Dt++]=Wt,Ut[Dt++]=It,Ut[Dt++]=jn,Wt=t.id,It=t.overflow,jn=e}var lt=null,Be=null,we=!1,Rn=null,Bt=!1,Xr=Error(l(519));function zn(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Cs(Ct(t,e)),Xr}function pf(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[at]=e,t[pt]=s,i){case"dialog":ge("cancel",t),ge("close",t);break;case"iframe":case"object":case"embed":ge("load",t);break;case"video":case"audio":for(i=0;i<na.length;i++)ge(na[i],t);break;case"source":ge("error",t);break;case"img":case"image":case"link":ge("error",t),ge("load",t);break;case"details":ge("toggle",t);break;case"input":ge("invalid",t),_u(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":ge("invalid",t);break;case"textarea":ge("invalid",t),Nu(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||Rd(t.textContent,i)?(s.popover!=null&&(ge("beforetoggle",t),ge("toggle",t)),s.onScroll!=null&&ge("scroll",t),s.onScrollEnd!=null&&ge("scrollend",t),s.onClick!=null&&(t.onclick=cn),t=!0):t=!1,t||zn(e,!0)}function mf(e){for(lt=e.return;lt;)switch(lt.tag){case 5:case 31:case 13:Bt=!1;return;case 27:case 3:Bt=!0;return;default:lt=lt.return}}function Hi(e){if(e!==lt)return!1;if(!we)return mf(e),we=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||cc(e.type,e.memoizedProps)),i=!i),i&&Be&&zn(e),mf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));Be=Hd(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));Be=Hd(e)}else t===27?(t=Be,Qn(e.type)?(e=pc,pc=null,Be=e):Be=t):Be=lt?Lt(e.stateNode.nextSibling):null;return!0}function ui(){Be=lt=null,we=!1}function Gr(){var e=Rn;return e!==null&&(bt===null?bt=e:bt.push.apply(bt,e),Rn=null),e}function Cs(e){Rn===null?Rn=[e]:Rn.push(e)}var Qr=S(null),fi=null,dn=null;function Mn(e,t,i){G(Qr,t._currentValue),t._currentValue=i}function pn(e){e._currentValue=Qr.current,q(Qr)}function Kr(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function Zr(e,t,i,s){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){var h=o.child;c=c.firstContext;e:for(;c!==null;){var p=c;c=o;for(var v=0;v<t.length;v++)if(p.context===t[v]){c.lanes|=i,p=c.alternate,p!==null&&(p.lanes|=i),Kr(c.return,i,e),s||(h=null);break e}c=p.next}}else if(o.tag===18){if(h=o.return,h===null)throw Error(l(341));h.lanes|=i,c=h.alternate,c!==null&&(c.lanes|=i),Kr(h,i,e),h=null}else h=o.child;if(h!==null)h.return=o;else for(h=o;h!==null;){if(h===e){h=null;break}if(o=h.sibling,o!==null){o.return=h.return,h=o;break}h=h.return}o=h}}function $i(e,t,i,s){e=null;for(var o=t,c=!1;o!==null;){if(!c){if((o.flags&524288)!==0)c=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var h=o.alternate;if(h===null)throw Error(l(387));if(h=h.memoizedProps,h!==null){var p=o.type;Et(o.pendingProps.value,h.value)||(e!==null?e.push(p):e=[p])}}else if(o===Ee.current){if(h=o.alternate,h===null)throw Error(l(387));h.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(ra):e=[ra])}o=o.return}e!==null&&Zr(t,e,i,s),t.flags|=262144}function Ka(e){for(e=e.firstContext;e!==null;){if(!Et(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function hi(e){fi=e,dn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function rt(e){return yf(fi,e)}function Za(e,t){return fi===null&&hi(e),yf(e,t)}function yf(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},dn===null){if(e===null)throw Error(l(308));dn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else dn=dn.next=t;return i}var ig=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},sg=r.unstable_scheduleCallback,ag=r.unstable_NormalPriority,Ke={$$typeof:J,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Jr(){return{controller:new ig,data:new Map,refCount:0}}function Us(e){e.refCount--,e.refCount===0&&sg(ag,function(){e.controller.abort()})}var Ds=null,Fr=0,Yi=0,Vi=null;function lg(e,t){if(Ds===null){var i=Ds=[];Fr=0,Yi=ec(),Vi={status:"pending",value:void 0,then:function(s){i.push(s)}}}return Fr++,t.then(gf,gf),t}function gf(){if(--Fr===0&&Ds!==null){Vi!==null&&(Vi.status="fulfilled");var e=Ds;Ds=null,Yi=0,Vi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function rg(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(o){i.push(o)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var o=0;o<i.length;o++)(0,i[o])(t)},function(o){for(s.status="rejected",s.reason=o,o=0;o<i.length;o++)(0,i[o])(void 0)}),s}var vf=k.S;k.S=function(e,t){td=Qe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&lg(e,t),vf!==null&&vf(e,t)};var di=S(null);function Wr(){var e=di.current;return e!==null?e:Ue.pooledCache}function Ja(e,t){t===null?G(di,di.current):G(di,t.pool)}function bf(){var e=Wr();return e===null?null:{parent:Ke._currentValue,pool:e}}var Xi=Error(l(460)),Ir=Error(l(474)),Fa=Error(l(542)),Wa={then:function(){}};function wf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Sf(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(cn,cn),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ef(e),e;default:if(typeof t.status=="string")t.then(cn,cn);else{if(e=Ue,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=s}},function(s){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ef(e),e}throw mi=t,Xi}}function pi(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(mi=i,Xi):i}}var mi=null;function xf(){if(mi===null)throw Error(l(459));var e=mi;return mi=null,e}function Ef(e){if(e===Xi||e===Fa)throw Error(l(483))}var Gi=null,Bs=0;function Ia(e){var t=Bs;return Bs+=1,Gi===null&&(Gi=[]),Sf(Gi,e,t)}function qs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Pa(e,t){throw t.$$typeof===j?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function kf(e){function t(E,x){if(e){var T=E.deletions;T===null?(E.deletions=[x],E.flags|=16):T.push(x)}}function i(E,x){if(!e)return null;for(;x!==null;)t(E,x),x=x.sibling;return null}function s(E){for(var x=new Map;E!==null;)E.key!==null?x.set(E.key,E):x.set(E.index,E),E=E.sibling;return x}function o(E,x){return E=fn(E,x),E.index=0,E.sibling=null,E}function c(E,x,T){return E.index=T,e?(T=E.alternate,T!==null?(T=T.index,T<x?(E.flags|=67108866,x):T):(E.flags|=67108866,x)):(E.flags|=1048576,x)}function h(E){return e&&E.alternate===null&&(E.flags|=67108866),E}function p(E,x,T,U){return x===null||x.tag!==6?(x=Hr(T,E.mode,U),x.return=E,x):(x=o(x,T),x.return=E,x)}function v(E,x,T,U){var ie=T.type;return ie===P?M(E,x,T.props.children,U,T.key):x!==null&&(x.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===Q&&pi(ie)===x.type)?(x=o(x,T.props),qs(x,T),x.return=E,x):(x=Ga(T.type,T.key,T.props,null,E.mode,U),qs(x,T),x.return=E,x)}function _(E,x,T,U){return x===null||x.tag!==4||x.stateNode.containerInfo!==T.containerInfo||x.stateNode.implementation!==T.implementation?(x=$r(T,E.mode,U),x.return=E,x):(x=o(x,T.children||[]),x.return=E,x)}function M(E,x,T,U,ie){return x===null||x.tag!==7?(x=ci(T,E.mode,U,ie),x.return=E,x):(x=o(x,T),x.return=E,x)}function D(E,x,T){if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return x=Hr(""+x,E.mode,T),x.return=E,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case L:return T=Ga(x.type,x.key,x.props,null,E.mode,T),qs(T,x),T.return=E,T;case K:return x=$r(x,E.mode,T),x.return=E,x;case Q:return x=pi(x),D(E,x,T)}if(V(x)||ue(x))return x=ci(x,E.mode,T,null),x.return=E,x;if(typeof x.then=="function")return D(E,Ia(x),T);if(x.$$typeof===J)return D(E,Za(E,x),T);Pa(E,x)}return null}function A(E,x,T,U){var ie=x!==null?x.key:null;if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return ie!==null?null:p(E,x,""+T,U);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case L:return T.key===ie?v(E,x,T,U):null;case K:return T.key===ie?_(E,x,T,U):null;case Q:return T=pi(T),A(E,x,T,U)}if(V(T)||ue(T))return ie!==null?null:M(E,x,T,U,null);if(typeof T.then=="function")return A(E,x,Ia(T),U);if(T.$$typeof===J)return A(E,x,Za(E,T),U);Pa(E,T)}return null}function O(E,x,T,U,ie){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return E=E.get(T)||null,p(x,E,""+U,ie);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case L:return E=E.get(U.key===null?T:U.key)||null,v(x,E,U,ie);case K:return E=E.get(U.key===null?T:U.key)||null,_(x,E,U,ie);case Q:return U=pi(U),O(E,x,T,U,ie)}if(V(U)||ue(U))return E=E.get(T)||null,M(x,E,U,ie,null);if(typeof U.then=="function")return O(E,x,T,Ia(U),ie);if(U.$$typeof===J)return O(E,x,T,Za(x,U),ie);Pa(x,U)}return null}function I(E,x,T,U){for(var ie=null,ke=null,te=x,de=x=0,be=null;te!==null&&de<T.length;de++){te.index>de?(be=te,te=null):be=te.sibling;var Te=A(E,te,T[de],U);if(Te===null){te===null&&(te=be);break}e&&te&&Te.alternate===null&&t(E,te),x=c(Te,x,de),ke===null?ie=Te:ke.sibling=Te,ke=Te,te=be}if(de===T.length)return i(E,te),we&&hn(E,de),ie;if(te===null){for(;de<T.length;de++)te=D(E,T[de],U),te!==null&&(x=c(te,x,de),ke===null?ie=te:ke.sibling=te,ke=te);return we&&hn(E,de),ie}for(te=s(te);de<T.length;de++)be=O(te,E,de,T[de],U),be!==null&&(e&&be.alternate!==null&&te.delete(be.key===null?de:be.key),x=c(be,x,de),ke===null?ie=be:ke.sibling=be,ke=be);return e&&te.forEach(function(Wn){return t(E,Wn)}),we&&hn(E,de),ie}function le(E,x,T,U){if(T==null)throw Error(l(151));for(var ie=null,ke=null,te=x,de=x=0,be=null,Te=T.next();te!==null&&!Te.done;de++,Te=T.next()){te.index>de?(be=te,te=null):be=te.sibling;var Wn=A(E,te,Te.value,U);if(Wn===null){te===null&&(te=be);break}e&&te&&Wn.alternate===null&&t(E,te),x=c(Wn,x,de),ke===null?ie=Wn:ke.sibling=Wn,ke=Wn,te=be}if(Te.done)return i(E,te),we&&hn(E,de),ie;if(te===null){for(;!Te.done;de++,Te=T.next())Te=D(E,Te.value,U),Te!==null&&(x=c(Te,x,de),ke===null?ie=Te:ke.sibling=Te,ke=Te);return we&&hn(E,de),ie}for(te=s(te);!Te.done;de++,Te=T.next())Te=O(te,E,de,Te.value,U),Te!==null&&(e&&Te.alternate!==null&&te.delete(Te.key===null?de:Te.key),x=c(Te,x,de),ke===null?ie=Te:ke.sibling=Te,ke=Te);return e&&te.forEach(function(vv){return t(E,vv)}),we&&hn(E,de),ie}function Me(E,x,T,U){if(typeof T=="object"&&T!==null&&T.type===P&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case L:e:{for(var ie=T.key;x!==null;){if(x.key===ie){if(ie=T.type,ie===P){if(x.tag===7){i(E,x.sibling),U=o(x,T.props.children),U.return=E,E=U;break e}}else if(x.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===Q&&pi(ie)===x.type){i(E,x.sibling),U=o(x,T.props),qs(U,T),U.return=E,E=U;break e}i(E,x);break}else t(E,x);x=x.sibling}T.type===P?(U=ci(T.props.children,E.mode,U,T.key),U.return=E,E=U):(U=Ga(T.type,T.key,T.props,null,E.mode,U),qs(U,T),U.return=E,E=U)}return h(E);case K:e:{for(ie=T.key;x!==null;){if(x.key===ie)if(x.tag===4&&x.stateNode.containerInfo===T.containerInfo&&x.stateNode.implementation===T.implementation){i(E,x.sibling),U=o(x,T.children||[]),U.return=E,E=U;break e}else{i(E,x);break}else t(E,x);x=x.sibling}U=$r(T,E.mode,U),U.return=E,E=U}return h(E);case Q:return T=pi(T),Me(E,x,T,U)}if(V(T))return I(E,x,T,U);if(ue(T)){if(ie=ue(T),typeof ie!="function")throw Error(l(150));return T=ie.call(T),le(E,x,T,U)}if(typeof T.then=="function")return Me(E,x,Ia(T),U);if(T.$$typeof===J)return Me(E,x,Za(E,T),U);Pa(E,T)}return typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint"?(T=""+T,x!==null&&x.tag===6?(i(E,x.sibling),U=o(x,T),U.return=E,E=U):(i(E,x),U=Hr(T,E.mode,U),U.return=E,E=U),h(E)):i(E,x)}return function(E,x,T,U){try{Bs=0;var ie=Me(E,x,T,U);return Gi=null,ie}catch(te){if(te===Xi||te===Fa)throw te;var ke=kt(29,te,null,E.mode);return ke.lanes=U,ke.return=E,ke}}}var yi=kf(!0),Tf=kf(!1),Cn=!1;function Pr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function eo(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 Un(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Dn(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ae&2)!==0){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,t=Xa(e),of(e,null,i),t}return Va(e,s,t,i),Xa(e)}function Ls(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,mu(e,i)}}function to(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var o=null,c=null;if(i=i.firstBaseUpdate,i!==null){do{var h={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};c===null?o=c=h:c=c.next=h,i=i.next}while(i!==null);c===null?o=c=t:c=c.next=t}else o=c=t;i={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var no=!1;function Hs(){if(no){var e=Vi;if(e!==null)throw e}}function $s(e,t,i,s){no=!1;var o=e.updateQueue;Cn=!1;var c=o.firstBaseUpdate,h=o.lastBaseUpdate,p=o.shared.pending;if(p!==null){o.shared.pending=null;var v=p,_=v.next;v.next=null,h===null?c=_:h.next=_,h=v;var M=e.alternate;M!==null&&(M=M.updateQueue,p=M.lastBaseUpdate,p!==h&&(p===null?M.firstBaseUpdate=_:p.next=_,M.lastBaseUpdate=v))}if(c!==null){var D=o.baseState;h=0,M=_=v=null,p=c;do{var A=p.lane&-536870913,O=A!==p.lane;if(O?(ve&A)===A:(s&A)===A){A!==0&&A===Yi&&(no=!0),M!==null&&(M=M.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var I=e,le=p;A=t;var Me=i;switch(le.tag){case 1:if(I=le.payload,typeof I=="function"){D=I.call(Me,D,A);break e}D=I;break e;case 3:I.flags=I.flags&-65537|128;case 0:if(I=le.payload,A=typeof I=="function"?I.call(Me,D,A):I,A==null)break e;D=w({},D,A);break e;case 2:Cn=!0}}A=p.callback,A!==null&&(e.flags|=64,O&&(e.flags|=8192),O=o.callbacks,O===null?o.callbacks=[A]:O.push(A))}else O={lane:A,tag:p.tag,payload:p.payload,callback:p.callback,next:null},M===null?(_=M=O,v=D):M=M.next=O,h|=A;if(p=p.next,p===null){if(p=o.shared.pending,p===null)break;O=p,p=O.next,O.next=null,o.lastBaseUpdate=O,o.shared.pending=null}}while(!0);M===null&&(v=D),o.baseState=v,o.firstBaseUpdate=_,o.lastBaseUpdate=M,c===null&&(o.shared.lanes=0),$n|=h,e.lanes=h,e.memoizedState=D}}function _f(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Af(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)_f(i[e],t)}var Qi=S(null),el=S(0);function Nf(e,t){e=En,G(el,e),G(Qi,t),En=e|t.baseLanes}function io(){G(el,En),G(Qi,Qi.current)}function so(){En=el.current,q(Qi),q(el)}var Tt=S(null),qt=null;function Bn(e){var t=e.alternate;G(Ye,Ye.current&1),G(Tt,e),qt===null&&(t===null||Qi.current!==null||t.memoizedState!==null)&&(qt=e)}function ao(e){G(Ye,Ye.current),G(Tt,e),qt===null&&(qt=e)}function Of(e){e.tag===22?(G(Ye,Ye.current),G(Tt,e),qt===null&&(qt=e)):qn()}function qn(){G(Ye,Ye.current),G(Tt,Tt.current)}function _t(e){q(Tt),qt===e&&(qt=null),q(Ye)}var Ye=S(0);function tl(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||hc(i)||dc(i)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var mn=0,fe=null,Re=null,Ze=null,nl=!1,Ki=!1,gi=!1,il=0,Ys=0,Zi=null,og=0;function He(){throw Error(l(321))}function lo(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Et(e[i],t[i]))return!1;return!0}function ro(e,t,i,s,o,c){return mn=c,fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?hh:Eo,gi=!1,c=i(s,o),gi=!1,Ki&&(c=Rf(t,i,s,o)),jf(e),c}function jf(e){k.H=Gs;var t=Re!==null&&Re.next!==null;if(mn=0,Ze=Re=fe=null,nl=!1,Ys=0,Zi=null,t)throw Error(l(300));e===null||Je||(e=e.dependencies,e!==null&&Ka(e)&&(Je=!0))}function Rf(e,t,i,s){fe=e;var o=0;do{if(Ki&&(Zi=null),Ys=0,Ki=!1,25<=o)throw Error(l(301));if(o+=1,Ze=Re=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}k.H=dh,c=t(i,s)}while(Ki);return c}function cg(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?Vs(t):t,e=e.useState()[0],(Re!==null?Re.memoizedState:null)!==e&&(fe.flags|=1024),t}function oo(){var e=il!==0;return il=0,e}function co(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function uo(e){if(nl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}nl=!1}mn=0,Ze=Re=fe=null,Ki=!1,Ys=il=0,Zi=null}function ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ze===null?fe.memoizedState=Ze=e:Ze=Ze.next=e,Ze}function Ve(){if(Re===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=Re.next;var t=Ze===null?fe.memoizedState:Ze.next;if(t!==null)Ze=t,Re=e;else{if(e===null)throw fe.alternate===null?Error(l(467)):Error(l(310));Re=e,e={memoizedState:Re.memoizedState,baseState:Re.baseState,baseQueue:Re.baseQueue,queue:Re.queue,next:null},Ze===null?fe.memoizedState=Ze=e:Ze=Ze.next=e}return Ze}function sl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Vs(e){var t=Ys;return Ys+=1,Zi===null&&(Zi=[]),e=Sf(Zi,e,t),t=fe,(Ze===null?t.memoizedState:Ze.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?hh:Eo),e}function al(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Vs(e);if(e.$$typeof===J)return rt(e)}throw Error(l(438,String(e)))}function fo(e){var t=null,i=fe.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=fe.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=sl(),fe.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=se;return t.index++,i}function yn(e,t){return typeof t=="function"?t(e):t}function ll(e){var t=Ve();return ho(t,Re,e)}function ho(e,t,i){var s=e.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=i;var o=e.baseQueue,c=s.pending;if(c!==null){if(o!==null){var h=o.next;o.next=c.next,c.next=h}t.baseQueue=o=c,s.pending=null}if(c=e.baseState,o===null)e.memoizedState=c;else{t=o.next;var p=h=null,v=null,_=t,M=!1;do{var D=_.lane&-536870913;if(D!==_.lane?(ve&D)===D:(mn&D)===D){var A=_.revertLane;if(A===0)v!==null&&(v=v.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),D===Yi&&(M=!0);else if((mn&A)===A){_=_.next,A===Yi&&(M=!0);continue}else D={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},v===null?(p=v=D,h=c):v=v.next=D,fe.lanes|=A,$n|=A;D=_.action,gi&&i(c,D),c=_.hasEagerState?_.eagerState:i(c,D)}else A={lane:D,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},v===null?(p=v=A,h=c):v=v.next=A,fe.lanes|=D,$n|=D;_=_.next}while(_!==null&&_!==t);if(v===null?h=c:v.next=p,!Et(c,e.memoizedState)&&(Je=!0,M&&(i=Vi,i!==null)))throw i;e.memoizedState=c,e.baseState=h,e.baseQueue=v,s.lastRenderedState=c}return o===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function po(e){var t=Ve(),i=t.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=e;var s=i.dispatch,o=i.pending,c=t.memoizedState;if(o!==null){i.pending=null;var h=o=o.next;do c=e(c,h.action),h=h.next;while(h!==o);Et(c,t.memoizedState)||(Je=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),i.lastRenderedState=c}return[c,s]}function zf(e,t,i){var s=fe,o=Ve(),c=we;if(c){if(i===void 0)throw Error(l(407));i=i()}else i=t();var h=!Et((Re||o).memoizedState,i);if(h&&(o.memoizedState=i,Je=!0),o=o.queue,go(Uf.bind(null,s,o,e),[e]),o.getSnapshot!==t||h||Ze!==null&&Ze.memoizedState.tag&1){if(s.flags|=2048,Ji(9,{destroy:void 0},Cf.bind(null,s,o,i,t),null),Ue===null)throw Error(l(349));c||(mn&127)!==0||Mf(s,t,i)}return i}function Mf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=fe.updateQueue,t===null?(t=sl(),fe.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Cf(e,t,i,s){t.value=i,t.getSnapshot=s,Df(t)&&Bf(e)}function Uf(e,t,i){return i(function(){Df(t)&&Bf(e)})}function Df(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Et(e,i)}catch{return!0}}function Bf(e){var t=oi(e,2);t!==null&&wt(t,e,2)}function mo(e){var t=ht();if(typeof e=="function"){var i=e;if(e=i(),gi){An(!0);try{i()}finally{An(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yn,lastRenderedState:e},t}function qf(e,t,i,s){return e.baseState=i,ho(e,Re,typeof s=="function"?s:yn)}function ug(e,t,i,s,o){if(cl(e))throw Error(l(485));if(e=t.action,e!==null){var c={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){c.listeners.push(h)}};k.T!==null?i(!0):c.isTransition=!1,s(c),i=t.pending,i===null?(c.next=t.pending=c,Lf(t,c)):(c.next=i.next,t.pending=i.next=c)}}function Lf(e,t){var i=t.action,s=t.payload,o=e.state;if(t.isTransition){var c=k.T,h={};k.T=h;try{var p=i(o,s),v=k.S;v!==null&&v(h,p),Hf(e,t,p)}catch(_){yo(e,t,_)}finally{c!==null&&h.types!==null&&(c.types=h.types),k.T=c}}else try{c=i(o,s),Hf(e,t,c)}catch(_){yo(e,t,_)}}function Hf(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){$f(e,t,s)},function(s){return yo(e,t,s)}):$f(e,t,i)}function $f(e,t,i){t.status="fulfilled",t.value=i,Yf(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Lf(e,i)))}function yo(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,Yf(t),t=t.next;while(t!==s)}e.action=null}function Yf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Vf(e,t){return t}function Xf(e,t){if(we){var i=Ue.formState;if(i!==null){e:{var s=fe;if(we){if(Be){t:{for(var o=Be,c=Bt;o.nodeType!==8;){if(!c){o=null;break t}if(o=Lt(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){Be=Lt(o.nextSibling),s=o.data==="F!";break e}}zn(s)}s=!1}s&&(t=i[0])}}return i=ht(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vf,lastRenderedState:t},i.queue=s,i=ch.bind(null,fe,s),s.dispatch=i,s=mo(!1),c=xo.bind(null,fe,!1,s.queue),s=ht(),o={state:t,dispatch:null,action:e,pending:null},s.queue=o,i=ug.bind(null,fe,o,c,i),o.dispatch=i,s.memoizedState=e,[t,i,!1]}function Gf(e){var t=Ve();return Qf(t,Re,e)}function Qf(e,t,i){if(t=ho(e,t,Vf)[0],e=ll(yn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Vs(t)}catch(h){throw h===Xi?Fa:h}else s=t;t=Ve();var o=t.queue,c=o.dispatch;return i!==t.memoizedState&&(fe.flags|=2048,Ji(9,{destroy:void 0},fg.bind(null,o,i),null)),[s,c,e]}function fg(e,t){e.action=t}function Kf(e){var t=Ve(),i=Re;if(i!==null)return Qf(t,i,e);Ve(),t=t.memoizedState,i=Ve();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function Ji(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=fe.updateQueue,t===null&&(t=sl(),fe.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function Zf(){return Ve().memoizedState}function rl(e,t,i,s){var o=ht();fe.flags|=e,o.memoizedState=Ji(1|t,{destroy:void 0},i,s===void 0?null:s)}function ol(e,t,i,s){var o=Ve();s=s===void 0?null:s;var c=o.memoizedState.inst;Re!==null&&s!==null&&lo(s,Re.memoizedState.deps)?o.memoizedState=Ji(t,c,i,s):(fe.flags|=e,o.memoizedState=Ji(1|t,c,i,s))}function Jf(e,t){rl(8390656,8,e,t)}function go(e,t){ol(2048,8,e,t)}function hg(e){fe.flags|=4;var t=fe.updateQueue;if(t===null)t=sl(),fe.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Ff(e){var t=Ve().memoizedState;return hg({ref:t,nextImpl:e}),function(){if((Ae&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function Wf(e,t){return ol(4,2,e,t)}function If(e,t){return ol(4,4,e,t)}function Pf(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function eh(e,t,i){i=i!=null?i.concat([e]):null,ol(4,4,Pf.bind(null,t,e),i)}function vo(){}function th(e,t){var i=Ve();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&lo(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function nh(e,t){var i=Ve();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&lo(t,s[1]))return s[0];if(s=e(),gi){An(!0);try{e()}finally{An(!1)}}return i.memoizedState=[s,t],s}function bo(e,t,i){return i===void 0||(mn&1073741824)!==0&&(ve&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=id(),fe.lanes|=e,$n|=e,i)}function ih(e,t,i,s){return Et(i,t)?i:Qi.current!==null?(e=bo(e,i,s),Et(e,t)||(Je=!0),e):(mn&42)===0||(mn&1073741824)!==0&&(ve&261930)===0?(Je=!0,e.memoizedState=i):(e=id(),fe.lanes|=e,$n|=e,t)}function sh(e,t,i,s,o){var c=$.p;$.p=c!==0&&8>c?c:8;var h=k.T,p={};k.T=p,xo(e,!1,t,i);try{var v=o(),_=k.S;if(_!==null&&_(p,v),v!==null&&typeof v=="object"&&typeof v.then=="function"){var M=rg(v,s);Xs(e,t,M,Ot(e))}else Xs(e,t,s,Ot(e))}catch(D){Xs(e,t,{then:function(){},status:"rejected",reason:D},Ot())}finally{$.p=c,h!==null&&p.types!==null&&(h.types=p.types),k.T=h}}function dg(){}function wo(e,t,i,s){if(e.tag!==5)throw Error(l(476));var o=ah(e).queue;sh(e,o,t,F,i===null?dg:function(){return lh(e),i(s)})}function ah(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yn,lastRenderedState:F},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yn,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function lh(e){var t=ah(e);t.next===null&&(t=e.alternate.memoizedState),Xs(e,t.next.queue,{},Ot())}function So(){return rt(ra)}function rh(){return Ve().memoizedState}function oh(){return Ve().memoizedState}function pg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Ot();e=Un(i);var s=Dn(t,e,i);s!==null&&(wt(s,t,i),Ls(s,t,i)),t={cache:Jr()},e.payload=t;return}t=t.return}}function mg(e,t,i){var s=Ot();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},cl(e)?uh(t,i):(i=qr(e,t,i,s),i!==null&&(wt(i,e,s),fh(i,t,s)))}function ch(e,t,i){var s=Ot();Xs(e,t,i,s)}function Xs(e,t,i,s){var o={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(cl(e))uh(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,p=c(h,i);if(o.hasEagerState=!0,o.eagerState=p,Et(p,h))return Va(e,t,o,0),Ue===null&&Ya(),!1}catch{}if(i=qr(e,t,o,s),i!==null)return wt(i,e,s),fh(i,t,s),!0}return!1}function xo(e,t,i,s){if(s={lane:2,revertLane:ec(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},cl(e)){if(t)throw Error(l(479))}else t=qr(e,i,s,2),t!==null&&wt(t,e,2)}function cl(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function uh(e,t){Ki=nl=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function fh(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,mu(e,i)}}var Gs={readContext:rt,use:al,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useLayoutEffect:He,useInsertionEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useSyncExternalStore:He,useId:He,useHostTransitionStatus:He,useFormState:He,useActionState:He,useOptimistic:He,useMemoCache:He,useCacheRefresh:He};Gs.useEffectEvent=He;var hh={readContext:rt,use:al,useCallback:function(e,t){return ht().memoizedState=[e,t===void 0?null:t],e},useContext:rt,useEffect:Jf,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,rl(4194308,4,Pf.bind(null,t,e),i)},useLayoutEffect:function(e,t){return rl(4194308,4,e,t)},useInsertionEffect:function(e,t){rl(4,2,e,t)},useMemo:function(e,t){var i=ht();t=t===void 0?null:t;var s=e();if(gi){An(!0);try{e()}finally{An(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=ht();if(i!==void 0){var o=i(t);if(gi){An(!0);try{i(t)}finally{An(!1)}}}else o=t;return s.memoizedState=s.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},s.queue=e,e=e.dispatch=mg.bind(null,fe,e),[s.memoizedState,e]},useRef:function(e){var t=ht();return e={current:e},t.memoizedState=e},useState:function(e){e=mo(e);var t=e.queue,i=ch.bind(null,fe,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:vo,useDeferredValue:function(e,t){var i=ht();return bo(i,e,t)},useTransition:function(){var e=mo(!1);return e=sh.bind(null,fe,e.queue,!0,!1),ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=fe,o=ht();if(we){if(i===void 0)throw Error(l(407));i=i()}else{if(i=t(),Ue===null)throw Error(l(349));(ve&127)!==0||Mf(s,t,i)}o.memoizedState=i;var c={value:i,getSnapshot:t};return o.queue=c,Jf(Uf.bind(null,s,c,e),[e]),s.flags|=2048,Ji(9,{destroy:void 0},Cf.bind(null,s,c,i,t),null),i},useId:function(){var e=ht(),t=Ue.identifierPrefix;if(we){var i=It,s=Wt;i=(s&~(1<<32-xt(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=il++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=og++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:So,useFormState:Xf,useActionState:Xf,useOptimistic:function(e){var t=ht();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=xo.bind(null,fe,!0,i),i.dispatch=t,[e,t]},useMemoCache:fo,useCacheRefresh:function(){return ht().memoizedState=pg.bind(null,fe)},useEffectEvent:function(e){var t=ht(),i={impl:e};return t.memoizedState=i,function(){if((Ae&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Eo={readContext:rt,use:al,useCallback:th,useContext:rt,useEffect:go,useImperativeHandle:eh,useInsertionEffect:Wf,useLayoutEffect:If,useMemo:nh,useReducer:ll,useRef:Zf,useState:function(){return ll(yn)},useDebugValue:vo,useDeferredValue:function(e,t){var i=Ve();return ih(i,Re.memoizedState,e,t)},useTransition:function(){var e=ll(yn)[0],t=Ve().memoizedState;return[typeof e=="boolean"?e:Vs(e),t]},useSyncExternalStore:zf,useId:rh,useHostTransitionStatus:So,useFormState:Gf,useActionState:Gf,useOptimistic:function(e,t){var i=Ve();return qf(i,Re,e,t)},useMemoCache:fo,useCacheRefresh:oh};Eo.useEffectEvent=Ff;var dh={readContext:rt,use:al,useCallback:th,useContext:rt,useEffect:go,useImperativeHandle:eh,useInsertionEffect:Wf,useLayoutEffect:If,useMemo:nh,useReducer:po,useRef:Zf,useState:function(){return po(yn)},useDebugValue:vo,useDeferredValue:function(e,t){var i=Ve();return Re===null?bo(i,e,t):ih(i,Re.memoizedState,e,t)},useTransition:function(){var e=po(yn)[0],t=Ve().memoizedState;return[typeof e=="boolean"?e:Vs(e),t]},useSyncExternalStore:zf,useId:rh,useHostTransitionStatus:So,useFormState:Kf,useActionState:Kf,useOptimistic:function(e,t){var i=Ve();return Re!==null?qf(i,Re,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:fo,useCacheRefresh:oh};dh.useEffectEvent=Ff;function ko(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:w({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var To={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=Ot(),o=Un(s);o.payload=t,i!=null&&(o.callback=i),t=Dn(e,o,s),t!==null&&(wt(t,e,s),Ls(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=Ot(),o=Un(s);o.tag=1,o.payload=t,i!=null&&(o.callback=i),t=Dn(e,o,s),t!==null&&(wt(t,e,s),Ls(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Ot(),s=Un(i);s.tag=2,t!=null&&(s.callback=t),t=Dn(e,s,i),t!==null&&(wt(t,e,i),Ls(t,e,i))}};function ph(e,t,i,s,o,c,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,c,h):t.prototype&&t.prototype.isPureReactComponent?!Rs(i,s)||!Rs(o,c):!0}function mh(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&To.enqueueReplaceState(t,t.state,null)}function vi(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=w({},i));for(var o in e)i[o]===void 0&&(i[o]=e[o])}return i}function yh(e){$a(e)}function gh(e){console.error(e)}function vh(e){$a(e)}function ul(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function bh(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function _o(e,t,i){return i=Un(i),i.tag=3,i.payload={element:null},i.callback=function(){ul(e,t)},i}function wh(e){return e=Un(e),e.tag=3,e}function Sh(e,t,i,s){var o=i.type.getDerivedStateFromError;if(typeof o=="function"){var c=s.value;e.payload=function(){return o(c)},e.callback=function(){bh(t,i,s)}}var h=i.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){bh(t,i,s),typeof o!="function"&&(Yn===null?Yn=new Set([this]):Yn.add(this));var p=s.stack;this.componentDidCatch(s.value,{componentStack:p!==null?p:""})})}function yg(e,t,i,s,o){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&$i(t,i,o,!0),i=Tt.current,i!==null){switch(i.tag){case 31:case 13:return qt===null?xl():i.alternate===null&&$e===0&&($e=3),i.flags&=-257,i.flags|=65536,i.lanes=o,s===Wa?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),Wo(e,s,o)),!1;case 22:return i.flags|=65536,s===Wa?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),Wo(e,s,o)),!1}throw Error(l(435,i.tag))}return Wo(e,s,o),xl(),!1}if(we)return t=Tt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,s!==Xr&&(e=Error(l(422),{cause:s}),Cs(Ct(e,i)))):(s!==Xr&&(t=Error(l(423),{cause:s}),Cs(Ct(t,i))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,s=Ct(s,i),o=_o(e.stateNode,s,o),to(e,o),$e!==4&&($e=2)),!1;var c=Error(l(520),{cause:s});if(c=Ct(c,i),Ps===null?Ps=[c]:Ps.push(c),$e!==4&&($e=2),t===null)return!0;s=Ct(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=o&-o,i.lanes|=e,e=_o(i.stateNode,s,e),to(i,e),!1;case 1:if(t=i.type,c=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Yn===null||!Yn.has(c))))return i.flags|=65536,o&=-o,i.lanes|=o,o=wh(o),Sh(o,e,i,s),to(i,o),!1}i=i.return}while(i!==null);return!1}var Ao=Error(l(461)),Je=!1;function ot(e,t,i,s){t.child=e===null?Tf(t,null,i,s):yi(t,e.child,i,s)}function xh(e,t,i,s,o){i=i.render;var c=t.ref;if("ref"in s){var h={};for(var p in s)p!=="ref"&&(h[p]=s[p])}else h=s;return hi(t),s=ro(e,t,i,h,c,o),p=oo(),e!==null&&!Je?(co(e,t,o),gn(e,t,o)):(we&&p&&Yr(t),t.flags|=1,ot(e,t,s,o),t.child)}function Eh(e,t,i,s,o){if(e===null){var c=i.type;return typeof c=="function"&&!Lr(c)&&c.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=c,kh(e,t,c,s,o)):(e=Ga(i.type,null,s,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Uo(e,o)){var h=c.memoizedProps;if(i=i.compare,i=i!==null?i:Rs,i(h,s)&&e.ref===t.ref)return gn(e,t,o)}return t.flags|=1,e=fn(c,s),e.ref=t.ref,e.return=t,t.child=e}function kh(e,t,i,s,o){if(e!==null){var c=e.memoizedProps;if(Rs(c,s)&&e.ref===t.ref)if(Je=!1,t.pendingProps=s=c,Uo(e,o))(e.flags&131072)!==0&&(Je=!0);else return t.lanes=e.lanes,gn(e,t,o)}return No(e,t,i,s,o)}function Th(e,t,i,s){var o=s.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|i:i,e!==null){for(s=t.child=e.child,o=0;s!==null;)o=o|s.lanes|s.childLanes,s=s.sibling;s=o&~c}else s=0,t.child=null;return _h(e,t,c,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ja(t,c!==null?c.cachePool:null),c!==null?Nf(t,c):io(),Of(t);else return s=t.lanes=536870912,_h(e,t,c!==null?c.baseLanes|i:i,i,s)}else c!==null?(Ja(t,c.cachePool),Nf(t,c),qn(),t.memoizedState=null):(e!==null&&Ja(t,null),io(),qn());return ot(e,t,o,i),t.child}function Qs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function _h(e,t,i,s,o){var c=Wr();return c=c===null?null:{parent:Ke._currentValue,pool:c},t.memoizedState={baseLanes:i,cachePool:c},e!==null&&Ja(t,null),io(),Of(t),e!==null&&$i(e,t,s,!0),t.childLanes=o,null}function fl(e,t){return t=dl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Ah(e,t,i){return yi(t,e.child,null,i),e=fl(t,t.pendingProps),e.flags|=2,_t(t),t.memoizedState=null,e}function gg(e,t,i){var s=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(we){if(s.mode==="hidden")return e=fl(t,s),t.lanes=536870912,Qs(null,e);if(ao(t),(e=Be)?(e=Ld(e,Bt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jn!==null?{id:Wt,overflow:It}:null,retryLane:536870912,hydrationErrors:null},i=uf(e),i.return=t,t.child=i,lt=t,Be=null)):e=null,e===null)throw zn(t);return t.lanes=536870912,null}return fl(t,s)}var c=e.memoizedState;if(c!==null){var h=c.dehydrated;if(ao(t),o)if(t.flags&256)t.flags&=-257,t=Ah(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(Je||$i(e,t,i,!1),o=(i&e.childLanes)!==0,Je||o){if(s=Ue,s!==null&&(h=yu(s,i),h!==0&&h!==c.retryLane))throw c.retryLane=h,oi(e,h),wt(s,e,h),Ao;xl(),t=Ah(e,t,i)}else e=c.treeContext,Be=Lt(h.nextSibling),lt=t,we=!0,Rn=null,Bt=!1,e!==null&&df(t,e),t=fl(t,s),t.flags|=4096;return t}return e=fn(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function hl(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function No(e,t,i,s,o){return hi(t),i=ro(e,t,i,s,void 0,o),s=oo(),e!==null&&!Je?(co(e,t,o),gn(e,t,o)):(we&&s&&Yr(t),t.flags|=1,ot(e,t,i,o),t.child)}function Nh(e,t,i,s,o,c){return hi(t),t.updateQueue=null,i=Rf(t,s,i,o),jf(e),s=oo(),e!==null&&!Je?(co(e,t,c),gn(e,t,c)):(we&&s&&Yr(t),t.flags|=1,ot(e,t,i,c),t.child)}function Oh(e,t,i,s,o){if(hi(t),t.stateNode===null){var c=Bi,h=i.contextType;typeof h=="object"&&h!==null&&(c=rt(h)),c=new i(s,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=To,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=s,c.state=t.memoizedState,c.refs={},Pr(t),h=i.contextType,c.context=typeof h=="object"&&h!==null?rt(h):Bi,c.state=t.memoizedState,h=i.getDerivedStateFromProps,typeof h=="function"&&(ko(t,i,h,s),c.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(h=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),h!==c.state&&To.enqueueReplaceState(c,c.state,null),$s(t,s,c,o),Hs(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){c=t.stateNode;var p=t.memoizedProps,v=vi(i,p);c.props=v;var _=c.context,M=i.contextType;h=Bi,typeof M=="object"&&M!==null&&(h=rt(M));var D=i.getDerivedStateFromProps;M=typeof D=="function"||typeof c.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,M||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(p||_!==h)&&mh(t,c,s,h),Cn=!1;var A=t.memoizedState;c.state=A,$s(t,s,c,o),Hs(),_=t.memoizedState,p||A!==_||Cn?(typeof D=="function"&&(ko(t,i,D,s),_=t.memoizedState),(v=Cn||ph(t,i,v,s,A,_,h))?(M||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=s,t.memoizedState=_),c.props=s,c.state=_,c.context=h,s=v):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{c=t.stateNode,eo(e,t),h=t.memoizedProps,M=vi(i,h),c.props=M,D=t.pendingProps,A=c.context,_=i.contextType,v=Bi,typeof _=="object"&&_!==null&&(v=rt(_)),p=i.getDerivedStateFromProps,(_=typeof p=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==D||A!==v)&&mh(t,c,s,v),Cn=!1,A=t.memoizedState,c.state=A,$s(t,s,c,o),Hs();var O=t.memoizedState;h!==D||A!==O||Cn||e!==null&&e.dependencies!==null&&Ka(e.dependencies)?(typeof p=="function"&&(ko(t,i,p,s),O=t.memoizedState),(M=Cn||ph(t,i,M,s,A,O,v)||e!==null&&e.dependencies!==null&&Ka(e.dependencies))?(_||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(s,O,v),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(s,O,v)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=O),c.props=s,c.state=O,c.context=v,s=M):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),s=!1)}return c=s,hl(e,t),s=(t.flags&128)!==0,c||s?(c=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&s?(t.child=yi(t,e.child,null,o),t.child=yi(t,null,i,o)):ot(e,t,i,o),t.memoizedState=c.state,e=t.child):e=gn(e,t,o),e}function jh(e,t,i,s){return ui(),t.flags|=256,ot(e,t,i,s),t.child}var Oo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jo(e){return{baseLanes:e,cachePool:bf()}}function Ro(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Nt),e}function Rh(e,t,i){var s=t.pendingProps,o=!1,c=(t.flags&128)!==0,h;if((h=c)||(h=e!==null&&e.memoizedState===null?!1:(Ye.current&2)!==0),h&&(o=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(we){if(o?Bn(t):qn(),(e=Be)?(e=Ld(e,Bt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jn!==null?{id:Wt,overflow:It}:null,retryLane:536870912,hydrationErrors:null},i=uf(e),i.return=t,t.child=i,lt=t,Be=null)):e=null,e===null)throw zn(t);return dc(e)?t.lanes=32:t.lanes=536870912,null}var p=s.children;return s=s.fallback,o?(qn(),o=t.mode,p=dl({mode:"hidden",children:p},o),s=ci(s,o,i,null),p.return=t,s.return=t,p.sibling=s,t.child=p,s=t.child,s.memoizedState=jo(i),s.childLanes=Ro(e,h,i),t.memoizedState=Oo,Qs(null,s)):(Bn(t),zo(t,p))}var v=e.memoizedState;if(v!==null&&(p=v.dehydrated,p!==null)){if(c)t.flags&256?(Bn(t),t.flags&=-257,t=Mo(e,t,i)):t.memoizedState!==null?(qn(),t.child=e.child,t.flags|=128,t=null):(qn(),p=s.fallback,o=t.mode,s=dl({mode:"visible",children:s.children},o),p=ci(p,o,i,null),p.flags|=2,s.return=t,p.return=t,s.sibling=p,t.child=s,yi(t,e.child,null,i),s=t.child,s.memoizedState=jo(i),s.childLanes=Ro(e,h,i),t.memoizedState=Oo,t=Qs(null,s));else if(Bn(t),dc(p)){if(h=p.nextSibling&&p.nextSibling.dataset,h)var _=h.dgst;h=_,s=Error(l(419)),s.stack="",s.digest=h,Cs({value:s,source:null,stack:null}),t=Mo(e,t,i)}else if(Je||$i(e,t,i,!1),h=(i&e.childLanes)!==0,Je||h){if(h=Ue,h!==null&&(s=yu(h,i),s!==0&&s!==v.retryLane))throw v.retryLane=s,oi(e,s),wt(h,e,s),Ao;hc(p)||xl(),t=Mo(e,t,i)}else hc(p)?(t.flags|=192,t.child=e.child,t=null):(e=v.treeContext,Be=Lt(p.nextSibling),lt=t,we=!0,Rn=null,Bt=!1,e!==null&&df(t,e),t=zo(t,s.children),t.flags|=4096);return t}return o?(qn(),p=s.fallback,o=t.mode,v=e.child,_=v.sibling,s=fn(v,{mode:"hidden",children:s.children}),s.subtreeFlags=v.subtreeFlags&65011712,_!==null?p=fn(_,p):(p=ci(p,o,i,null),p.flags|=2),p.return=t,s.return=t,s.sibling=p,t.child=s,Qs(null,s),s=t.child,p=e.child.memoizedState,p===null?p=jo(i):(o=p.cachePool,o!==null?(v=Ke._currentValue,o=o.parent!==v?{parent:v,pool:v}:o):o=bf(),p={baseLanes:p.baseLanes|i,cachePool:o}),s.memoizedState=p,s.childLanes=Ro(e,h,i),t.memoizedState=Oo,Qs(e.child,s)):(Bn(t),i=e.child,e=i.sibling,i=fn(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=i,t.memoizedState=null,i)}function zo(e,t){return t=dl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function dl(e,t){return e=kt(22,e,null,t),e.lanes=0,e}function Mo(e,t,i){return yi(t,e.child,null,i),e=zo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zh(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Kr(e.return,t,i)}function Co(e,t,i,s,o,c){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:o,treeForkCount:c}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=s,h.tail=i,h.tailMode=o,h.treeForkCount=c)}function Mh(e,t,i){var s=t.pendingProps,o=s.revealOrder,c=s.tail;s=s.children;var h=Ye.current,p=(h&2)!==0;if(p?(h=h&1|2,t.flags|=128):h&=1,G(Ye,h),ot(e,t,s,i),s=we?Ms:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zh(e,i,t);else if(e.tag===19)zh(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(i=t.child,o=null;i!==null;)e=i.alternate,e!==null&&tl(e)===null&&(o=i),i=i.sibling;i=o,i===null?(o=t.child,t.child=null):(o=i.sibling,i.sibling=null),Co(t,!1,o,i,c,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&tl(e)===null){t.child=o;break}e=o.sibling,o.sibling=i,i=o,o=e}Co(t,!0,i,null,c,s);break;case"together":Co(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function gn(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),$n|=t.lanes,(i&t.childLanes)===0)if(e!==null){if($i(e,t,i,!1),(i&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,i=fn(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=fn(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Uo(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ka(e)))}function vg(e,t,i){switch(t.tag){case 3:it(t,t.stateNode.containerInfo),Mn(t,Ke,e.memoizedState.cache),ui();break;case 27:case 5:ti(t);break;case 4:it(t,t.stateNode.containerInfo);break;case 10:Mn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ao(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Bn(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Rh(e,t,i):(Bn(t),e=gn(e,t,i),e!==null?e.sibling:null);Bn(t);break;case 19:var o=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||($i(e,t,i,!1),s=(i&t.childLanes)!==0),o){if(s)return Mh(e,t,i);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),G(Ye,Ye.current),s)break;return null;case 22:return t.lanes=0,Th(e,t,i,t.pendingProps);case 24:Mn(t,Ke,e.memoizedState.cache)}return gn(e,t,i)}function Ch(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Je=!0;else{if(!Uo(e,i)&&(t.flags&128)===0)return Je=!1,vg(e,t,i);Je=(e.flags&131072)!==0}else Je=!1,we&&(t.flags&1048576)!==0&&hf(t,Ms,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=pi(t.elementType),t.type=e,typeof e=="function")Lr(e)?(s=vi(e,s),t.tag=1,t=Oh(null,t,e,s,i)):(t.tag=0,t=No(null,t,e,s,i));else{if(e!=null){var o=e.$$typeof;if(o===N){t.tag=11,t=xh(null,t,e,s,i);break e}else if(o===B){t.tag=14,t=Eh(null,t,e,s,i);break e}}throw t=Ge(e)||e,Error(l(306,t,""))}}return t;case 0:return No(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,o=vi(s,t.pendingProps),Oh(e,t,s,o,i);case 3:e:{if(it(t,t.stateNode.containerInfo),e===null)throw Error(l(387));s=t.pendingProps;var c=t.memoizedState;o=c.element,eo(e,t),$s(t,s,null,i);var h=t.memoizedState;if(s=h.cache,Mn(t,Ke,s),s!==c.cache&&Zr(t,[Ke],i,!0),Hs(),s=h.element,c.isDehydrated)if(c={element:s,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=jh(e,t,s,i);break e}else if(s!==o){o=Ct(Error(l(424)),t),Cs(o),t=jh(e,t,s,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Be=Lt(e.firstChild),lt=t,we=!0,Rn=null,Bt=!0,i=Tf(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(ui(),s===o){t=gn(e,t,i);break e}ot(e,t,s,i)}t=t.child}return t;case 26:return hl(e,t),e===null?(i=Gd(t.type,null,t.pendingProps,null))?t.memoizedState=i:we||(i=t.type,e=t.pendingProps,s=Ol(he.current).createElement(i),s[at]=t,s[pt]=e,ct(s,i,e),tt(s),t.stateNode=s):t.memoizedState=Gd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ti(t),e===null&&we&&(s=t.stateNode=Yd(t.type,t.pendingProps,he.current),lt=t,Bt=!0,o=Be,Qn(t.type)?(pc=o,Be=Lt(s.firstChild)):Be=o),ot(e,t,t.pendingProps.children,i),hl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&we&&((o=s=Be)&&(s=Zg(s,t.type,t.pendingProps,Bt),s!==null?(t.stateNode=s,lt=t,Be=Lt(s.firstChild),Bt=!1,o=!0):o=!1),o||zn(t)),ti(t),o=t.type,c=t.pendingProps,h=e!==null?e.memoizedProps:null,s=c.children,cc(o,c)?s=null:h!==null&&cc(o,h)&&(t.flags|=32),t.memoizedState!==null&&(o=ro(e,t,cg,null,null,i),ra._currentValue=o),hl(e,t),ot(e,t,s,i),t.child;case 6:return e===null&&we&&((e=i=Be)&&(i=Jg(i,t.pendingProps,Bt),i!==null?(t.stateNode=i,lt=t,Be=null,e=!0):e=!1),e||zn(t)),null;case 13:return Rh(e,t,i);case 4:return it(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=yi(t,null,s,i):ot(e,t,s,i),t.child;case 11:return xh(e,t,t.type,t.pendingProps,i);case 7:return ot(e,t,t.pendingProps,i),t.child;case 8:return ot(e,t,t.pendingProps.children,i),t.child;case 12:return ot(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,Mn(t,t.type,s.value),ot(e,t,s.children,i),t.child;case 9:return o=t.type._context,s=t.pendingProps.children,hi(t),o=rt(o),s=s(o),t.flags|=1,ot(e,t,s,i),t.child;case 14:return Eh(e,t,t.type,t.pendingProps,i);case 15:return kh(e,t,t.type,t.pendingProps,i);case 19:return Mh(e,t,i);case 31:return gg(e,t,i);case 22:return Th(e,t,i,t.pendingProps);case 24:return hi(t),s=rt(Ke),e===null?(o=Wr(),o===null&&(o=Ue,c=Jr(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=i),o=c),t.memoizedState={parent:s,cache:o},Pr(t),Mn(t,Ke,o)):((e.lanes&i)!==0&&(eo(e,t),$s(t,null,null,i),Hs()),o=e.memoizedState,c=t.memoizedState,o.parent!==s?(o={parent:s,cache:s},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),Mn(t,Ke,s)):(s=c.cache,Mn(t,Ke,s),s!==o.cache&&Zr(t,[Ke],i,!0))),ot(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function vn(e){e.flags|=4}function Do(e,t,i,s,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(rd())e.flags|=8192;else throw mi=Wa,Ir}else e.flags&=-16777217}function Uh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Fd(t))if(rd())e.flags|=8192;else throw mi=Wa,Ir}function pl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?du():536870912,e.lanes|=t,Pi|=t)}function Ks(e,t){if(!we)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var o=e.child;o!==null;)i|=o.lanes|o.childLanes,s|=o.subtreeFlags&65011712,s|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)i|=o.lanes|o.childLanes,s|=o.subtreeFlags,s|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function bg(e,t,i){var s=t.pendingProps;switch(Vr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(t),null;case 1:return qe(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),pn(Ke),Ce(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?vn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Gr())),qe(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(vn(t),c!==null?(qe(t),Uh(t,c)):(qe(t),Do(t,o,null,s,i))):c?c!==e.memoizedState?(vn(t),qe(t),Uh(t,c)):(qe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&vn(t),qe(t),Do(t,o,e,s,i)),null;case 27:if(Jt(t),i=he.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&vn(t);else{if(!s){if(t.stateNode===null)throw Error(l(166));return qe(t),null}e=ee.current,Hi(t)?pf(t):(e=Yd(o,s,i),t.stateNode=e,vn(t))}return qe(t),null;case 5:if(Jt(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&vn(t);else{if(!s){if(t.stateNode===null)throw Error(l(166));return qe(t),null}if(c=ee.current,Hi(t))pf(t);else{var h=Ol(he.current);switch(c){case 1:c=h.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:c=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":c=h.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":c=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":c=h.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof s.is=="string"?h.createElement("select",{is:s.is}):h.createElement("select"),s.multiple?c.multiple=!0:s.size&&(c.size=s.size);break;default:c=typeof s.is=="string"?h.createElement(o,{is:s.is}):h.createElement(o)}}c[at]=t,c[pt]=s;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)c.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=c;e:switch(ct(c,o,s),o){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&vn(t)}}return qe(t),Do(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&vn(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(l(166));if(e=he.current,Hi(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,o=lt,o!==null)switch(o.tag){case 27:case 5:s=o.memoizedProps}e[at]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||Rd(e.nodeValue,i)),e||zn(t,!0)}else e=Ol(e).createTextNode(s),e[at]=t,t.stateNode=e}return qe(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Hi(t),i!==null){if(e===null){if(!s)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[at]=t}else ui(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),e=!1}else i=Gr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(_t(t),t):(_t(t),null);if((t.flags&128)!==0)throw Error(l(558))}return qe(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Hi(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(l(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(l(317));o[at]=t}else ui(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),o=!1}else o=Gr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(_t(t),t):(_t(t),null)}return _t(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,o=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(o=s.alternate.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==o&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),pl(t,t.updateQueue),qe(t),null);case 4:return Ce(),e===null&&sc(t.stateNode.containerInfo),qe(t),null;case 10:return pn(t.type),qe(t),null;case 19:if(q(Ye),s=t.memoizedState,s===null)return qe(t),null;if(o=(t.flags&128)!==0,c=s.rendering,c===null)if(o)Ks(s,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=tl(e),c!==null){for(t.flags|=128,Ks(s,!1),e=c.updateQueue,t.updateQueue=e,pl(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)cf(i,e),i=i.sibling;return G(Ye,Ye.current&1|2),we&&hn(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Qe()>bl&&(t.flags|=128,o=!0,Ks(s,!1),t.lanes=4194304)}else{if(!o)if(e=tl(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,pl(t,e),Ks(s,!0),s.tail===null&&s.tailMode==="hidden"&&!c.alternate&&!we)return qe(t),null}else 2*Qe()-s.renderingStartTime>bl&&i!==536870912&&(t.flags|=128,o=!0,Ks(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(e=s.last,e!==null?e.sibling=c:t.child=c,s.last=c)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Qe(),e.sibling=null,i=Ye.current,G(Ye,o?i&1|2:i&1),we&&hn(t,s.treeForkCount),e):(qe(t),null);case 22:case 23:return _t(t),so(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),i=t.updateQueue,i!==null&&pl(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&q(di),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),pn(Ke),qe(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function wg(e,t){switch(Vr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pn(Ke),Ce(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Jt(t),null;case 31:if(t.memoizedState!==null){if(_t(t),t.alternate===null)throw Error(l(340));ui()}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));ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(Ye),null;case 4:return Ce(),null;case 10:return pn(t.type),null;case 22:case 23:return _t(t),so(),e!==null&&q(di),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return pn(Ke),null;case 25:return null;default:return null}}function Dh(e,t){switch(Vr(t),t.tag){case 3:pn(Ke),Ce();break;case 26:case 27:case 5:Jt(t);break;case 4:Ce();break;case 31:t.memoizedState!==null&&_t(t);break;case 13:_t(t);break;case 19:q(Ye);break;case 10:pn(t.type);break;case 22:case 23:_t(t),so(),e!==null&&q(di);break;case 24:pn(Ke)}}function Zs(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var o=s.next;i=o;do{if((i.tag&e)===e){s=void 0;var c=i.create,h=i.inst;s=c(),h.destroy=s}i=i.next}while(i!==o)}}catch(p){Oe(t,t.return,p)}}function Ln(e,t,i){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var c=o.next;s=c;do{if((s.tag&e)===e){var h=s.inst,p=h.destroy;if(p!==void 0){h.destroy=void 0,o=t;var v=i,_=p;try{_()}catch(M){Oe(o,v,M)}}}s=s.next}while(s!==c)}}catch(M){Oe(t,t.return,M)}}function Bh(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Af(t,i)}catch(s){Oe(e,e.return,s)}}}function qh(e,t,i){i.props=vi(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){Oe(e,t,s)}}function Js(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(o){Oe(e,t,o)}}function Pt(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(o){Oe(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(o){Oe(e,t,o)}else i.current=null}function Lh(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(o){Oe(e,e.return,o)}}function Bo(e,t,i){try{var s=e.stateNode;Yg(s,e.type,i,t),s[pt]=t}catch(o){Oe(e,e.return,o)}}function Hh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qn(e.type)||e.tag===4}function qo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Hh(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&&Qn(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 Lo(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=cn));else if(s!==4&&(s===27&&Qn(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Lo(e,t,i),e=e.sibling;e!==null;)Lo(e,t,i),e=e.sibling}function ml(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(s!==4&&(s===27&&Qn(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(ml(e,t,i),e=e.sibling;e!==null;)ml(e,t,i),e=e.sibling}function $h(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);ct(t,s,i),t[at]=e,t[pt]=i}catch(c){Oe(e,e.return,c)}}var bn=!1,Fe=!1,Ho=!1,Yh=typeof WeakSet=="function"?WeakSet:Set,nt=null;function Sg(e,t){if(e=e.containerInfo,rc=Dl,e=Pu(e),zr(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var o=s.anchorOffset,c=s.focusNode;s=s.focusOffset;try{i.nodeType,c.nodeType}catch{i=null;break e}var h=0,p=-1,v=-1,_=0,M=0,D=e,A=null;t:for(;;){for(var O;D!==i||o!==0&&D.nodeType!==3||(p=h+o),D!==c||s!==0&&D.nodeType!==3||(v=h+s),D.nodeType===3&&(h+=D.nodeValue.length),(O=D.firstChild)!==null;)A=D,D=O;for(;;){if(D===e)break t;if(A===i&&++_===o&&(p=h),A===c&&++M===s&&(v=h),(O=D.nextSibling)!==null)break;D=A,A=D.parentNode}D=O}i=p===-1||v===-1?null:{start:p,end:v}}else i=null}i=i||{start:0,end:0}}else i=null;for(oc={focusedElem:e,selectionRange:i},Dl=!1,nt=t;nt!==null;)if(t=nt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,nt=e;else for(;nt!==null;){switch(t=nt,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)o=e[i],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,i=t,o=c.memoizedProps,c=c.memoizedState,s=i.stateNode;try{var I=vi(i.type,o);e=s.getSnapshotBeforeUpdate(I,c),s.__reactInternalSnapshotBeforeUpdate=e}catch(le){Oe(i,i.return,le)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)fc(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":fc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=t.sibling,e!==null){e.return=t.return,nt=e;break}nt=t.return}}function Vh(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:Sn(e,i),s&4&&Zs(5,i);break;case 1:if(Sn(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(h){Oe(i,i.return,h)}else{var o=vi(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Oe(i,i.return,h)}}s&64&&Bh(i),s&512&&Js(i,i.return);break;case 3:if(Sn(e,i),s&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{Af(e,t)}catch(h){Oe(i,i.return,h)}}break;case 27:t===null&&s&4&&$h(i);case 26:case 5:Sn(e,i),t===null&&s&4&&Lh(i),s&512&&Js(i,i.return);break;case 12:Sn(e,i);break;case 31:Sn(e,i),s&4&&Qh(e,i);break;case 13:Sn(e,i),s&4&&Kh(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=jg.bind(null,i),Fg(e,i))));break;case 22:if(s=i.memoizedState!==null||bn,!s){t=t!==null&&t.memoizedState!==null||Fe,o=bn;var c=Fe;bn=s,(Fe=t)&&!c?xn(e,i,(i.subtreeFlags&8772)!==0):Sn(e,i),bn=o,Fe=c}break;case 30:break;default:Sn(e,i)}}function Xh(e){var t=e.alternate;t!==null&&(e.alternate=null,Xh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mr(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 Le=null,yt=!1;function wn(e,t,i){for(i=i.child;i!==null;)Gh(e,t,i),i=i.sibling}function Gh(e,t,i){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(bs,i)}catch{}switch(i.tag){case 26:Fe||Pt(i,t),wn(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Fe||Pt(i,t);var s=Le,o=yt;Qn(i.type)&&(Le=i.stateNode,yt=!1),wn(e,t,i),sa(i.stateNode),Le=s,yt=o;break;case 5:Fe||Pt(i,t);case 6:if(s=Le,o=yt,Le=null,wn(e,t,i),Le=s,yt=o,Le!==null)if(yt)try{(Le.nodeType===9?Le.body:Le.nodeName==="HTML"?Le.ownerDocument.body:Le).removeChild(i.stateNode)}catch(c){Oe(i,t,c)}else try{Le.removeChild(i.stateNode)}catch(c){Oe(i,t,c)}break;case 18:Le!==null&&(yt?(e=Le,Bd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),rs(e)):Bd(Le,i.stateNode));break;case 4:s=Le,o=yt,Le=i.stateNode.containerInfo,yt=!0,wn(e,t,i),Le=s,yt=o;break;case 0:case 11:case 14:case 15:Ln(2,i,t),Fe||Ln(4,i,t),wn(e,t,i);break;case 1:Fe||(Pt(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&qh(i,t,s)),wn(e,t,i);break;case 21:wn(e,t,i);break;case 22:Fe=(s=Fe)||i.memoizedState!==null,wn(e,t,i),Fe=s;break;default:wn(e,t,i)}}function Qh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{rs(e)}catch(i){Oe(t,t.return,i)}}}function Kh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{rs(e)}catch(i){Oe(t,t.return,i)}}function xg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Yh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Yh),t;default:throw Error(l(435,e.tag))}}function yl(e,t){var i=xg(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var o=Rg.bind(null,e,s);s.then(o,o)}})}function gt(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var o=i[s],c=e,h=t,p=h;e:for(;p!==null;){switch(p.tag){case 27:if(Qn(p.type)){Le=p.stateNode,yt=!1;break e}break;case 5:Le=p.stateNode,yt=!1;break e;case 3:case 4:Le=p.stateNode.containerInfo,yt=!0;break e}p=p.return}if(Le===null)throw Error(l(160));Gh(c,h,o),Le=null,yt=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Zh(t,e),t=t.sibling}var Vt=null;function Zh(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gt(t,e),vt(e),s&4&&(Ln(3,e,e.return),Zs(3,e),Ln(5,e,e.return));break;case 1:gt(t,e),vt(e),s&512&&(Fe||i===null||Pt(i,i.return)),s&64&&bn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?s:i.concat(s))));break;case 26:var o=Vt;if(gt(t,e),vt(e),s&512&&(Fe||i===null||Pt(i,i.return)),s&4){var c=i!==null?i.memoizedState:null;if(s=e.memoizedState,i===null)if(s===null)if(e.stateNode===null){e:{s=e.type,i=e.memoizedProps,o=o.ownerDocument||o;t:switch(s){case"title":c=o.getElementsByTagName("title")[0],(!c||c[xs]||c[at]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(s),o.head.insertBefore(c,o.querySelector("head > title"))),ct(c,s,i),c[at]=e,tt(c),s=c;break e;case"link":var h=Zd("link","href",o).get(s+(i.href||""));if(h){for(var p=0;p<h.length;p++)if(c=h[p],c.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&c.getAttribute("rel")===(i.rel==null?null:i.rel)&&c.getAttribute("title")===(i.title==null?null:i.title)&&c.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){h.splice(p,1);break t}}c=o.createElement(s),ct(c,s,i),o.head.appendChild(c);break;case"meta":if(h=Zd("meta","content",o).get(s+(i.content||""))){for(p=0;p<h.length;p++)if(c=h[p],c.getAttribute("content")===(i.content==null?null:""+i.content)&&c.getAttribute("name")===(i.name==null?null:i.name)&&c.getAttribute("property")===(i.property==null?null:i.property)&&c.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&c.getAttribute("charset")===(i.charSet==null?null:i.charSet)){h.splice(p,1);break t}}c=o.createElement(s),ct(c,s,i),o.head.appendChild(c);break;default:throw Error(l(468,s))}c[at]=e,tt(c),s=c}e.stateNode=s}else Jd(o,e.type,e.stateNode);else e.stateNode=Kd(o,s,e.memoizedProps);else c!==s?(c===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):c.count--,s===null?Jd(o,e.type,e.stateNode):Kd(o,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Bo(e,e.memoizedProps,i.memoizedProps)}break;case 27:gt(t,e),vt(e),s&512&&(Fe||i===null||Pt(i,i.return)),i!==null&&s&4&&Bo(e,e.memoizedProps,i.memoizedProps);break;case 5:if(gt(t,e),vt(e),s&512&&(Fe||i===null||Pt(i,i.return)),e.flags&32){o=e.stateNode;try{ji(o,"")}catch(I){Oe(e,e.return,I)}}s&4&&e.stateNode!=null&&(o=e.memoizedProps,Bo(e,o,i!==null?i.memoizedProps:o)),s&1024&&(Ho=!0);break;case 6:if(gt(t,e),vt(e),s&4){if(e.stateNode===null)throw Error(l(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(I){Oe(e,e.return,I)}}break;case 3:if(zl=null,o=Vt,Vt=jl(t.containerInfo),gt(t,e),Vt=o,vt(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{rs(t.containerInfo)}catch(I){Oe(e,e.return,I)}Ho&&(Ho=!1,Jh(e));break;case 4:s=Vt,Vt=jl(e.stateNode.containerInfo),gt(t,e),vt(e),Vt=s;break;case 12:gt(t,e),vt(e);break;case 31:gt(t,e),vt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,yl(e,s)));break;case 13:gt(t,e),vt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(vl=Qe()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,yl(e,s)));break;case 22:o=e.memoizedState!==null;var v=i!==null&&i.memoizedState!==null,_=bn,M=Fe;if(bn=_||o,Fe=M||v,gt(t,e),Fe=M,bn=_,vt(e),s&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(i===null||v||bn||Fe||bi(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){v=i=t;try{if(c=v.stateNode,o)h=c.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{p=v.stateNode;var D=v.memoizedProps.style,A=D!=null&&D.hasOwnProperty("display")?D.display:null;p.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch(I){Oe(v,v.return,I)}}}else if(t.tag===6){if(i===null){v=t;try{v.stateNode.nodeValue=o?"":v.memoizedProps}catch(I){Oe(v,v.return,I)}}}else if(t.tag===18){if(i===null){v=t;try{var O=v.stateNode;o?qd(O,!0):qd(v.stateNode,!1)}catch(I){Oe(v,v.return,I)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,yl(e,i))));break;case 19:gt(t,e),vt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,yl(e,s)));break;case 30:break;case 21:break;default:gt(t,e),vt(e)}}function vt(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(Hh(s)){i=s;break}s=s.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var o=i.stateNode,c=qo(e);ml(e,c,o);break;case 5:var h=i.stateNode;i.flags&32&&(ji(h,""),i.flags&=-33);var p=qo(e);ml(e,p,h);break;case 3:case 4:var v=i.stateNode.containerInfo,_=qo(e);Lo(e,_,v);break;default:throw Error(l(161))}}catch(M){Oe(e,e.return,M)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Jh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Jh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Sn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Vh(e,t.alternate,t),t=t.sibling}function bi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ln(4,t,t.return),bi(t);break;case 1:Pt(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&qh(t,t.return,i),bi(t);break;case 27:sa(t.stateNode);case 26:case 5:Pt(t,t.return),bi(t);break;case 22:t.memoizedState===null&&bi(t);break;case 30:bi(t);break;default:bi(t)}e=e.sibling}}function xn(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,o=e,c=t,h=c.flags;switch(c.tag){case 0:case 11:case 15:xn(o,c,i),Zs(4,c);break;case 1:if(xn(o,c,i),s=c,o=s.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(_){Oe(s,s.return,_)}if(s=c,o=s.updateQueue,o!==null){var p=s.stateNode;try{var v=o.shared.hiddenCallbacks;if(v!==null)for(o.shared.hiddenCallbacks=null,o=0;o<v.length;o++)_f(v[o],p)}catch(_){Oe(s,s.return,_)}}i&&h&64&&Bh(c),Js(c,c.return);break;case 27:$h(c);case 26:case 5:xn(o,c,i),i&&s===null&&h&4&&Lh(c),Js(c,c.return);break;case 12:xn(o,c,i);break;case 31:xn(o,c,i),i&&h&4&&Qh(o,c);break;case 13:xn(o,c,i),i&&h&4&&Kh(o,c);break;case 22:c.memoizedState===null&&xn(o,c,i),Js(c,c.return);break;case 30:break;default:xn(o,c,i)}t=t.sibling}}function $o(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Us(i))}function Yo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Us(e))}function Xt(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Fh(e,t,i,s),t=t.sibling}function Fh(e,t,i,s){var o=t.flags;switch(t.tag){case 0:case 11:case 15:Xt(e,t,i,s),o&2048&&Zs(9,t);break;case 1:Xt(e,t,i,s);break;case 3:Xt(e,t,i,s),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Us(e)));break;case 12:if(o&2048){Xt(e,t,i,s),e=t.stateNode;try{var c=t.memoizedProps,h=c.id,p=c.onPostCommit;typeof p=="function"&&p(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(v){Oe(t,t.return,v)}}else Xt(e,t,i,s);break;case 31:Xt(e,t,i,s);break;case 13:Xt(e,t,i,s);break;case 23:break;case 22:c=t.stateNode,h=t.alternate,t.memoizedState!==null?c._visibility&2?Xt(e,t,i,s):Fs(e,t):c._visibility&2?Xt(e,t,i,s):(c._visibility|=2,Fi(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),o&2048&&$o(h,t);break;case 24:Xt(e,t,i,s),o&2048&&Yo(t.alternate,t);break;default:Xt(e,t,i,s)}}function Fi(e,t,i,s,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,h=t,p=i,v=s,_=h.flags;switch(h.tag){case 0:case 11:case 15:Fi(c,h,p,v,o),Zs(8,h);break;case 23:break;case 22:var M=h.stateNode;h.memoizedState!==null?M._visibility&2?Fi(c,h,p,v,o):Fs(c,h):(M._visibility|=2,Fi(c,h,p,v,o)),o&&_&2048&&$o(h.alternate,h);break;case 24:Fi(c,h,p,v,o),o&&_&2048&&Yo(h.alternate,h);break;default:Fi(c,h,p,v,o)}t=t.sibling}}function Fs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,o=s.flags;switch(s.tag){case 22:Fs(i,s),o&2048&&$o(s.alternate,s);break;case 24:Fs(i,s),o&2048&&Yo(s.alternate,s);break;default:Fs(i,s)}t=t.sibling}}var Ws=8192;function Wi(e,t,i){if(e.subtreeFlags&Ws)for(e=e.child;e!==null;)Wh(e,t,i),e=e.sibling}function Wh(e,t,i){switch(e.tag){case 26:Wi(e,t,i),e.flags&Ws&&e.memoizedState!==null&&ov(i,Vt,e.memoizedState,e.memoizedProps);break;case 5:Wi(e,t,i);break;case 3:case 4:var s=Vt;Vt=jl(e.stateNode.containerInfo),Wi(e,t,i),Vt=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Ws,Ws=16777216,Wi(e,t,i),Ws=s):Wi(e,t,i));break;default:Wi(e,t,i)}}function Ih(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 Is(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];nt=s,ed(s,e)}Ih(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ph(e),e=e.sibling}function Ph(e){switch(e.tag){case 0:case 11:case 15:Is(e),e.flags&2048&&Ln(9,e,e.return);break;case 3:Is(e);break;case 12:Is(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,gl(e)):Is(e);break;default:Is(e)}}function gl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];nt=s,ed(s,e)}Ih(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ln(8,t,t.return),gl(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,gl(t));break;default:gl(t)}e=e.sibling}}function ed(e,t){for(;nt!==null;){var i=nt;switch(i.tag){case 0:case 11:case 15:Ln(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Us(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,nt=s;else e:for(i=e;nt!==null;){s=nt;var o=s.sibling,c=s.return;if(Xh(s),s===i){nt=null;break e}if(o!==null){o.return=c,nt=o;break e}nt=c}}}var Eg={getCacheForType:function(e){var t=rt(Ke),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return rt(Ke).controller.signal}},kg=typeof WeakMap=="function"?WeakMap:Map,Ae=0,Ue=null,ye=null,ve=0,Ne=0,At=null,Hn=!1,Ii=!1,Vo=!1,En=0,$e=0,$n=0,wi=0,Xo=0,Nt=0,Pi=0,Ps=null,bt=null,Go=!1,vl=0,td=0,bl=1/0,wl=null,Yn=null,Pe=0,Vn=null,es=null,kn=0,Qo=0,Ko=null,nd=null,ea=0,Zo=null;function Ot(){return(Ae&2)!==0&&ve!==0?ve&-ve:k.T!==null?ec():gu()}function id(){if(Nt===0)if((ve&536870912)===0||we){var e=Na;Na<<=1,(Na&3932160)===0&&(Na=262144),Nt=e}else Nt=536870912;return e=Tt.current,e!==null&&(e.flags|=32),Nt}function wt(e,t,i){(e===Ue&&(Ne===2||Ne===9)||e.cancelPendingCommit!==null)&&(ts(e,0),Xn(e,ve,Nt,!1)),Ss(e,i),((Ae&2)===0||e!==Ue)&&(e===Ue&&((Ae&2)===0&&(wi|=i),$e===4&&Xn(e,ve,Nt,!1)),en(e))}function sd(e,t,i){if((Ae&6)!==0)throw Error(l(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||ws(e,t),o=s?Ag(e,t):Fo(e,t,!0),c=s;do{if(o===0){Ii&&!s&&Xn(e,t,0,!1);break}else{if(i=e.current.alternate,c&&!Tg(i)){o=Fo(e,t,!1),c=!1;continue}if(o===2){if(c=t,e.errorRecoveryDisabledLanes&c)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var p=e;o=Ps;var v=p.current.memoizedState.isDehydrated;if(v&&(ts(p,h).flags|=256),h=Fo(p,h,!1),h!==2){if(Vo&&!v){p.errorRecoveryDisabledLanes|=c,wi|=c,o=4;break e}c=bt,bt=o,c!==null&&(bt===null?bt=c:bt.push.apply(bt,c))}o=h}if(c=!1,o!==2)continue}}if(o===1){ts(e,0),Xn(e,t,0,!0);break}e:{switch(s=e,c=o,c){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:Xn(s,t,Nt,!Hn);break e;case 2:bt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(o=vl+300-Qe(),10<o)){if(Xn(s,t,Nt,!Hn),ja(s,0,!0)!==0)break e;kn=t,s.timeoutHandle=Ud(ad.bind(null,s,i,bt,wl,Go,t,Nt,wi,Pi,Hn,c,"Throttled",-0,0),o);break e}ad(s,i,bt,wl,Go,t,Nt,wi,Pi,Hn,c,null,-0,0)}}break}while(!0);en(e)}function ad(e,t,i,s,o,c,h,p,v,_,M,D,A,O){if(e.timeoutHandle=-1,D=t.subtreeFlags,D&8192||(D&16785408)===16785408){D={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:cn},Wh(t,c,D);var I=(c&62914560)===c?vl-Qe():(c&4194048)===c?td-Qe():0;if(I=cv(D,I),I!==null){kn=c,e.cancelPendingCommit=I(dd.bind(null,e,t,c,i,s,o,h,p,v,M,D,null,A,O)),Xn(e,c,h,!_);return}}dd(e,t,c,i,s,o,h,p,v)}function Tg(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var o=i[s],c=o.getSnapshot;o=o.value;try{if(!Et(c(),o))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 Xn(e,t,i,s){t&=~Xo,t&=~wi,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var o=t;0<o;){var c=31-xt(o),h=1<<c;s[c]=-1,o&=~h}i!==0&&pu(e,i,t)}function Sl(){return(Ae&6)===0?(ta(0),!1):!0}function Jo(){if(ye!==null){if(Ne===0)var e=ye.return;else e=ye,dn=fi=null,uo(e),Gi=null,Bs=0,e=ye;for(;e!==null;)Dh(e.alternate,e),e=e.return;ye=null}}function ts(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,Gg(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),kn=0,Jo(),Ue=e,ye=i=fn(e.current,null),ve=t,Ne=0,At=null,Hn=!1,Ii=ws(e,t),Vo=!1,Pi=Nt=Xo=wi=$n=$e=0,bt=Ps=null,Go=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var o=31-xt(s),c=1<<o;t|=e[o],s&=~c}return En=t,Ya(),i}function ld(e,t){fe=null,k.H=Gs,t===Xi||t===Fa?(t=xf(),Ne=3):t===Ir?(t=xf(),Ne=4):Ne=t===Ao?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,At=t,ye===null&&($e=1,ul(e,Ct(t,e.current)))}function rd(){var e=Tt.current;return e===null?!0:(ve&4194048)===ve?qt===null:(ve&62914560)===ve||(ve&536870912)!==0?e===qt:!1}function od(){var e=k.H;return k.H=Gs,e===null?Gs:e}function cd(){var e=k.A;return k.A=Eg,e}function xl(){$e=4,Hn||(ve&4194048)!==ve&&Tt.current!==null||(Ii=!0),($n&134217727)===0&&(wi&134217727)===0||Ue===null||Xn(Ue,ve,Nt,!1)}function Fo(e,t,i){var s=Ae;Ae|=2;var o=od(),c=cd();(Ue!==e||ve!==t)&&(wl=null,ts(e,t)),t=!1;var h=$e;e:do try{if(Ne!==0&&ye!==null){var p=ye,v=At;switch(Ne){case 8:Jo(),h=6;break e;case 3:case 2:case 9:case 6:Tt.current===null&&(t=!0);var _=Ne;if(Ne=0,At=null,ns(e,p,v,_),i&&Ii){h=0;break e}break;default:_=Ne,Ne=0,At=null,ns(e,p,v,_)}}_g(),h=$e;break}catch(M){ld(e,M)}while(!0);return t&&e.shellSuspendCounter++,dn=fi=null,Ae=s,k.H=o,k.A=c,ye===null&&(Ue=null,ve=0,Ya()),h}function _g(){for(;ye!==null;)ud(ye)}function Ag(e,t){var i=Ae;Ae|=2;var s=od(),o=cd();Ue!==e||ve!==t?(wl=null,bl=Qe()+500,ts(e,t)):Ii=ws(e,t);e:do try{if(Ne!==0&&ye!==null){t=ye;var c=At;t:switch(Ne){case 1:Ne=0,At=null,ns(e,t,c,1);break;case 2:case 9:if(wf(c)){Ne=0,At=null,fd(t);break}t=function(){Ne!==2&&Ne!==9||Ue!==e||(Ne=7),en(e)},c.then(t,t);break e;case 3:Ne=7;break e;case 4:Ne=5;break e;case 7:wf(c)?(Ne=0,At=null,fd(t)):(Ne=0,At=null,ns(e,t,c,7));break;case 5:var h=null;switch(ye.tag){case 26:h=ye.memoizedState;case 5:case 27:var p=ye;if(h?Fd(h):p.stateNode.complete){Ne=0,At=null;var v=p.sibling;if(v!==null)ye=v;else{var _=p.return;_!==null?(ye=_,El(_)):ye=null}break t}}Ne=0,At=null,ns(e,t,c,5);break;case 6:Ne=0,At=null,ns(e,t,c,6);break;case 8:Jo(),$e=6;break e;default:throw Error(l(462))}}Ng();break}catch(M){ld(e,M)}while(!0);return dn=fi=null,k.H=s,k.A=o,Ae=i,ye!==null?0:(Ue=null,ve=0,Ya(),$e)}function Ng(){for(;ye!==null&&!me();)ud(ye)}function ud(e){var t=Ch(e.alternate,e,En);e.memoizedProps=e.pendingProps,t===null?El(e):ye=t}function fd(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Nh(i,t,t.pendingProps,t.type,void 0,ve);break;case 11:t=Nh(i,t,t.pendingProps,t.type.render,t.ref,ve);break;case 5:uo(t);default:Dh(i,t),t=ye=cf(t,En),t=Ch(i,t,En)}e.memoizedProps=e.pendingProps,t===null?El(e):ye=t}function ns(e,t,i,s){dn=fi=null,uo(t),Gi=null,Bs=0;var o=t.return;try{if(yg(e,o,t,i,ve)){$e=1,ul(e,Ct(i,e.current)),ye=null;return}}catch(c){if(o!==null)throw ye=o,c;$e=1,ul(e,Ct(i,e.current)),ye=null;return}t.flags&32768?(we||s===1?e=!0:Ii||(ve&536870912)!==0?e=!1:(Hn=e=!0,(s===2||s===9||s===3||s===6)&&(s=Tt.current,s!==null&&s.tag===13&&(s.flags|=16384))),hd(t,e)):El(t)}function El(e){var t=e;do{if((t.flags&32768)!==0){hd(t,Hn);return}e=t.return;var i=bg(t.alternate,t,En);if(i!==null){ye=i;return}if(t=t.sibling,t!==null){ye=t;return}ye=t=e}while(t!==null);$e===0&&($e=5)}function hd(e,t){do{var i=wg(e.alternate,e);if(i!==null){i.flags&=32767,ye=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){ye=e;return}ye=e=i}while(e!==null);$e=6,ye=null}function dd(e,t,i,s,o,c,h,p,v){e.cancelPendingCommit=null;do kl();while(Pe!==0);if((Ae&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(c=t.lanes|t.childLanes,c|=Br,ry(e,i,c,h,p,v),e===Ue&&(ye=Ue=null,ve=0),es=t,Vn=e,kn=i,Qo=c,Ko=o,nd=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,zg(_a,function(){return vd(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=k.T,k.T=null,o=$.p,$.p=2,h=Ae,Ae|=4;try{Sg(e,t,i)}finally{Ae=h,$.p=o,k.T=s}}Pe=1,pd(),md(),yd()}}function pd(){if(Pe===1){Pe=0;var e=Vn,t=es,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=k.T,k.T=null;var s=$.p;$.p=2;var o=Ae;Ae|=4;try{Zh(t,e);var c=oc,h=Pu(e.containerInfo),p=c.focusedElem,v=c.selectionRange;if(h!==p&&p&&p.ownerDocument&&Iu(p.ownerDocument.documentElement,p)){if(v!==null&&zr(p)){var _=v.start,M=v.end;if(M===void 0&&(M=_),"selectionStart"in p)p.selectionStart=_,p.selectionEnd=Math.min(M,p.value.length);else{var D=p.ownerDocument||document,A=D&&D.defaultView||window;if(A.getSelection){var O=A.getSelection(),I=p.textContent.length,le=Math.min(v.start,I),Me=v.end===void 0?le:Math.min(v.end,I);!O.extend&&le>Me&&(h=Me,Me=le,le=h);var E=Wu(p,le),x=Wu(p,Me);if(E&&x&&(O.rangeCount!==1||O.anchorNode!==E.node||O.anchorOffset!==E.offset||O.focusNode!==x.node||O.focusOffset!==x.offset)){var T=D.createRange();T.setStart(E.node,E.offset),O.removeAllRanges(),le>Me?(O.addRange(T),O.extend(x.node,x.offset)):(T.setEnd(x.node,x.offset),O.addRange(T))}}}}for(D=[],O=p;O=O.parentNode;)O.nodeType===1&&D.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<D.length;p++){var U=D[p];U.element.scrollLeft=U.left,U.element.scrollTop=U.top}}Dl=!!rc,oc=rc=null}finally{Ae=o,$.p=s,k.T=i}}e.current=t,Pe=2}}function md(){if(Pe===2){Pe=0;var e=Vn,t=es,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=k.T,k.T=null;var s=$.p;$.p=2;var o=Ae;Ae|=4;try{Vh(e,t.alternate,t)}finally{Ae=o,$.p=s,k.T=i}}Pe=3}}function yd(){if(Pe===4||Pe===3){Pe=0,st();var e=Vn,t=es,i=kn,s=nd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Pe=5:(Pe=0,es=Vn=null,gd(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Yn=null),dr(i),t=t.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(bs,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=k.T,o=$.p,$.p=2,k.T=null;try{for(var c=e.onRecoverableError,h=0;h<s.length;h++){var p=s[h];c(p.value,{componentStack:p.stack})}}finally{k.T=t,$.p=o}}(kn&3)!==0&&kl(),en(e),o=e.pendingLanes,(i&261930)!==0&&(o&42)!==0?e===Zo?ea++:(ea=0,Zo=e):ea=0,ta(0)}}function gd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Us(t)))}function kl(){return pd(),md(),yd(),vd()}function vd(){if(Pe!==5)return!1;var e=Vn,t=Qo;Qo=0;var i=dr(kn),s=k.T,o=$.p;try{$.p=32>i?32:i,k.T=null,i=Ko,Ko=null;var c=Vn,h=kn;if(Pe=0,es=Vn=null,kn=0,(Ae&6)!==0)throw Error(l(331));var p=Ae;if(Ae|=4,Ph(c.current),Fh(c,c.current,h,i),Ae=p,ta(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(bs,c)}catch{}return!0}finally{$.p=o,k.T=s,gd(e,t)}}function bd(e,t,i){t=Ct(i,t),t=_o(e.stateNode,t,2),e=Dn(e,t,2),e!==null&&(Ss(e,2),en(e))}function Oe(e,t,i){if(e.tag===3)bd(e,e,i);else for(;t!==null;){if(t.tag===3){bd(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Yn===null||!Yn.has(s))){e=Ct(i,e),i=wh(2),s=Dn(t,i,2),s!==null&&(Sh(i,s,t,e),Ss(s,2),en(s));break}}t=t.return}}function Wo(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new kg;var o=new Set;s.set(t,o)}else o=s.get(t),o===void 0&&(o=new Set,s.set(t,o));o.has(i)||(Vo=!0,o.add(i),e=Og.bind(null,e,t,i),t.then(e,e))}function Og(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Ue===e&&(ve&i)===i&&($e===4||$e===3&&(ve&62914560)===ve&&300>Qe()-vl?(Ae&2)===0&&ts(e,0):Xo|=i,Pi===ve&&(Pi=0)),en(e)}function wd(e,t){t===0&&(t=du()),e=oi(e,t),e!==null&&(Ss(e,t),en(e))}function jg(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),wd(e,i)}function Rg(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(i=o.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(l(314))}s!==null&&s.delete(t),wd(e,i)}function zg(e,t){return ae(e,t)}var Tl=null,is=null,Io=!1,_l=!1,Po=!1,Gn=0;function en(e){e!==is&&e.next===null&&(is===null?Tl=is=e:is=is.next=e),_l=!0,Io||(Io=!0,Cg())}function ta(e,t){if(!Po&&_l){Po=!0;do for(var i=!1,s=Tl;s!==null;){if(e!==0){var o=s.pendingLanes;if(o===0)var c=0;else{var h=s.suspendedLanes,p=s.pingedLanes;c=(1<<31-xt(42|e)+1)-1,c&=o&~(h&~p),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(i=!0,kd(s,c))}else c=ve,c=ja(s,s===Ue?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(c&3)===0||ws(s,c)||(i=!0,kd(s,c));s=s.next}while(i);Po=!1}}function Mg(){Sd()}function Sd(){_l=Io=!1;var e=0;Gn!==0&&Xg()&&(e=Gn);for(var t=Qe(),i=null,s=Tl;s!==null;){var o=s.next,c=xd(s,t);c===0?(s.next=null,i===null?Tl=o:i.next=o,o===null&&(is=i)):(i=s,(e!==0||(c&3)!==0)&&(_l=!0)),s=o}Pe!==0&&Pe!==5||ta(e),Gn!==0&&(Gn=0)}function xd(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var h=31-xt(c),p=1<<h,v=o[h];v===-1?((p&i)===0||(p&s)!==0)&&(o[h]=ly(p,t)):v<=t&&(e.expiredLanes|=p),c&=~p}if(t=Ue,i=ve,i=ja(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(Ne===2||Ne===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&De(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||ws(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&De(s),dr(i)){case 2:case 8:i=fu;break;case 32:i=_a;break;case 268435456:i=hu;break;default:i=_a}return s=Ed.bind(null,e),i=ae(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&De(s),e.callbackPriority=2,e.callbackNode=null,2}function Ed(e,t){if(Pe!==0&&Pe!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(kl()&&e.callbackNode!==i)return null;var s=ve;return s=ja(e,e===Ue?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(sd(e,s,t),xd(e,Qe()),e.callbackNode!=null&&e.callbackNode===i?Ed.bind(null,e):null)}function kd(e,t){if(kl())return null;sd(e,t,!0)}function Cg(){Qg(function(){(Ae&6)!==0?ae(uu,Mg):Sd()})}function ec(){if(Gn===0){var e=Yi;e===0&&(e=Aa,Aa<<=1,(Aa&261888)===0&&(Aa=256)),Gn=e}return Gn}function Td(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ca(""+e)}function _d(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function Ug(e,t,i,s,o){if(t==="submit"&&i&&i.stateNode===o){var c=Td((o[pt]||null).action),h=s.submitter;h&&(t=(t=h[pt]||null)?Td(t.formAction):h.getAttribute("formAction"),t!==null&&(c=t,h=null));var p=new qa("action","action",null,s,o);e.push({event:p,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Gn!==0){var v=h?_d(o,h):new FormData(o);wo(i,{pending:!0,data:v,method:o.method,action:c},null,v)}}else typeof c=="function"&&(p.preventDefault(),v=h?_d(o,h):new FormData(o),wo(i,{pending:!0,data:v,method:o.method,action:c},c,v))},currentTarget:o}]})}}for(var tc=0;tc<Dr.length;tc++){var nc=Dr[tc],Dg=nc.toLowerCase(),Bg=nc[0].toUpperCase()+nc.slice(1);Yt(Dg,"on"+Bg)}Yt(nf,"onAnimationEnd"),Yt(sf,"onAnimationIteration"),Yt(af,"onAnimationStart"),Yt("dblclick","onDoubleClick"),Yt("focusin","onFocus"),Yt("focusout","onBlur"),Yt(Py,"onTransitionRun"),Yt(eg,"onTransitionStart"),Yt(tg,"onTransitionCancel"),Yt(lf,"onTransitionEnd"),Ni("onMouseEnter",["mouseout","mouseover"]),Ni("onMouseLeave",["mouseout","mouseover"]),Ni("onPointerEnter",["pointerout","pointerover"]),Ni("onPointerLeave",["pointerout","pointerover"]),si("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),si("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),si("onBeforeInput",["compositionend","keypress","textInput","paste"]),si("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),si("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),si("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var na="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(" "),qg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(na));function Ad(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],o=s.event;s=s.listeners;e:{var c=void 0;if(t)for(var h=s.length-1;0<=h;h--){var p=s[h],v=p.instance,_=p.currentTarget;if(p=p.listener,v!==c&&o.isPropagationStopped())break e;c=p,o.currentTarget=_;try{c(o)}catch(M){$a(M)}o.currentTarget=null,c=v}else for(h=0;h<s.length;h++){if(p=s[h],v=p.instance,_=p.currentTarget,p=p.listener,v!==c&&o.isPropagationStopped())break e;c=p,o.currentTarget=_;try{c(o)}catch(M){$a(M)}o.currentTarget=null,c=v}}}}function ge(e,t){var i=t[pr];i===void 0&&(i=t[pr]=new Set);var s=e+"__bubble";i.has(s)||(Nd(t,e,2,!1),i.add(s))}function ic(e,t,i){var s=0;t&&(s|=4),Nd(i,e,s,t)}var Al="_reactListening"+Math.random().toString(36).slice(2);function sc(e){if(!e[Al]){e[Al]=!0,wu.forEach(function(i){i!=="selectionchange"&&(qg.has(i)||ic(i,!1,e),ic(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Al]||(t[Al]=!0,ic("selectionchange",!1,t))}}function Nd(e,t,i,s){switch(ip(t)){case 2:var o=hv;break;case 8:o=dv;break;default:o=bc}i=o.bind(null,t,i,e),o=void 0,!Er||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),s?o!==void 0?e.addEventListener(t,i,{capture:!0,passive:o}):e.addEventListener(t,i,!0):o!==void 0?e.addEventListener(t,i,{passive:o}):e.addEventListener(t,i,!1)}function ac(e,t,i,s,o){var c=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var h=s.tag;if(h===3||h===4){var p=s.stateNode.containerInfo;if(p===o)break;if(h===4)for(h=s.return;h!==null;){var v=h.tag;if((v===3||v===4)&&h.stateNode.containerInfo===o)return;h=h.return}for(;p!==null;){if(h=Ti(p),h===null)return;if(v=h.tag,v===5||v===6||v===26||v===27){s=c=h;continue e}p=p.parentNode}}s=s.return}zu(function(){var _=c,M=Sr(i),D=[];e:{var A=rf.get(e);if(A!==void 0){var O=qa,I=e;switch(e){case"keypress":if(Da(i)===0)break e;case"keydown":case"keyup":O=Ry;break;case"focusin":I="focus",O=Ar;break;case"focusout":I="blur",O=Ar;break;case"beforeblur":case"afterblur":O=Ar;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":O=Uu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=by;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=Cy;break;case nf:case sf:case af:O=xy;break;case lf:O=Dy;break;case"scroll":case"scrollend":O=gy;break;case"wheel":O=qy;break;case"copy":case"cut":case"paste":O=ky;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=Bu;break;case"toggle":case"beforetoggle":O=Hy}var le=(t&4)!==0,Me=!le&&(e==="scroll"||e==="scrollend"),E=le?A!==null?A+"Capture":null:A;le=[];for(var x=_,T;x!==null;){var U=x;if(T=U.stateNode,U=U.tag,U!==5&&U!==26&&U!==27||T===null||E===null||(U=ks(x,E),U!=null&&le.push(ia(x,U,T))),Me)break;x=x.return}0<le.length&&(A=new O(A,I,null,i,M),D.push({event:A,listeners:le}))}}if((t&7)===0){e:{if(A=e==="mouseover"||e==="pointerover",O=e==="mouseout"||e==="pointerout",A&&i!==wr&&(I=i.relatedTarget||i.fromElement)&&(Ti(I)||I[ki]))break e;if((O||A)&&(A=M.window===M?M:(A=M.ownerDocument)?A.defaultView||A.parentWindow:window,O?(I=i.relatedTarget||i.toElement,O=_,I=I?Ti(I):null,I!==null&&(Me=f(I),le=I.tag,I!==Me||le!==5&&le!==27&&le!==6)&&(I=null)):(O=null,I=_),O!==I)){if(le=Uu,U="onMouseLeave",E="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(le=Bu,U="onPointerLeave",E="onPointerEnter",x="pointer"),Me=O==null?A:Es(O),T=I==null?A:Es(I),A=new le(U,x+"leave",O,i,M),A.target=Me,A.relatedTarget=T,U=null,Ti(M)===_&&(le=new le(E,x+"enter",I,i,M),le.target=T,le.relatedTarget=Me,U=le),Me=U,O&&I)t:{for(le=Lg,E=O,x=I,T=0,U=E;U;U=le(U))T++;U=0;for(var ie=x;ie;ie=le(ie))U++;for(;0<T-U;)E=le(E),T--;for(;0<U-T;)x=le(x),U--;for(;T--;){if(E===x||x!==null&&E===x.alternate){le=E;break t}E=le(E),x=le(x)}le=null}else le=null;O!==null&&Od(D,A,O,le,!1),I!==null&&Me!==null&&Od(D,Me,I,le,!0)}}e:{if(A=_?Es(_):window,O=A.nodeName&&A.nodeName.toLowerCase(),O==="select"||O==="input"&&A.type==="file")var ke=Gu;else if(Vu(A))if(Qu)ke=Fy;else{ke=Zy;var te=Ky}else O=A.nodeName,!O||O.toLowerCase()!=="input"||A.type!=="checkbox"&&A.type!=="radio"?_&&br(_.elementType)&&(ke=Gu):ke=Jy;if(ke&&(ke=ke(e,_))){Xu(D,ke,i,M);break e}te&&te(e,A,_),e==="focusout"&&_&&A.type==="number"&&_.memoizedProps.value!=null&&vr(A,"number",A.value)}switch(te=_?Es(_):window,e){case"focusin":(Vu(te)||te.contentEditable==="true")&&(Ci=te,Mr=_,zs=null);break;case"focusout":zs=Mr=Ci=null;break;case"mousedown":Cr=!0;break;case"contextmenu":case"mouseup":case"dragend":Cr=!1,ef(D,i,M);break;case"selectionchange":if(Iy)break;case"keydown":case"keyup":ef(D,i,M)}var de;if(Or)e:{switch(e){case"compositionstart":var be="onCompositionStart";break e;case"compositionend":be="onCompositionEnd";break e;case"compositionupdate":be="onCompositionUpdate";break e}be=void 0}else Mi?$u(e,i)&&(be="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(be="onCompositionStart");be&&(qu&&i.locale!=="ko"&&(Mi||be!=="onCompositionStart"?be==="onCompositionEnd"&&Mi&&(de=Mu()):(On=M,kr="value"in On?On.value:On.textContent,Mi=!0)),te=Nl(_,be),0<te.length&&(be=new Du(be,e,null,i,M),D.push({event:be,listeners:te}),de?be.data=de:(de=Yu(i),de!==null&&(be.data=de)))),(de=Yy?Vy(e,i):Xy(e,i))&&(be=Nl(_,"onBeforeInput"),0<be.length&&(te=new Du("onBeforeInput","beforeinput",null,i,M),D.push({event:te,listeners:be}),te.data=de)),Ug(D,e,_,i,M)}Ad(D,t)})}function ia(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Nl(e,t){for(var i=t+"Capture",s=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=ks(e,i),o!=null&&s.unshift(ia(e,o,c)),o=ks(e,t),o!=null&&s.push(ia(e,o,c))),e.tag===3)return s;e=e.return}return[]}function Lg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,i,s,o){for(var c=t._reactName,h=[];i!==null&&i!==s;){var p=i,v=p.alternate,_=p.stateNode;if(p=p.tag,v!==null&&v===s)break;p!==5&&p!==26&&p!==27||_===null||(v=_,o?(_=ks(i,c),_!=null&&h.unshift(ia(i,_,v))):o||(_=ks(i,c),_!=null&&h.push(ia(i,_,v)))),i=i.return}h.length!==0&&e.push({event:t,listeners:h})}var Hg=/\r\n?/g,$g=/\u0000|\uFFFD/g;function jd(e){return(typeof e=="string"?e:""+e).replace(Hg,`
9
- `).replace($g,"")}function Rd(e,t){return t=jd(t),jd(e)===t}function ze(e,t,i,s,o,c){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||ji(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&ji(e,""+s);break;case"className":za(e,"class",s);break;case"tabIndex":za(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":za(e,i,s);break;case"style":ju(e,s,c);break;case"data":if(t!=="object"){za(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Ca(""+s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(i,"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"&&(i==="formAction"?(t!=="input"&&ze(e,t,"name",o.name,o,null),ze(e,t,"formEncType",o.formEncType,o,null),ze(e,t,"formMethod",o.formMethod,o,null),ze(e,t,"formTarget",o.formTarget,o,null)):(ze(e,t,"encType",o.encType,o,null),ze(e,t,"method",o.method,o,null),ze(e,t,"target",o.target,o,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Ca(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=cn);break;case"onScroll":s!=null&&ge("scroll",e);break;case"onScrollEnd":s!=null&&ge("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(i=s.__html,i!=null){if(o.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=Ca(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""+s):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":ge("beforetoggle",e),ge("toggle",e),Ra(e,"popover",s);break;case"xlinkActuate":on(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":on(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":on(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":on(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":on(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":on(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":on(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":on(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":on(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Ra(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=my.get(i)||i,Ra(e,i,s))}}function lc(e,t,i,s,o,c){switch(i){case"style":ju(e,s,c);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(i=s.__html,i!=null){if(o.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"children":typeof s=="string"?ji(e,s):(typeof s=="number"||typeof s=="bigint")&&ji(e,""+s);break;case"onScroll":s!=null&&ge("scroll",e);break;case"onScrollEnd":s!=null&&ge("scrollend",e);break;case"onClick":s!=null&&(e.onclick=cn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Su.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(o=i.endsWith("Capture"),t=i.slice(2,o?i.length-7:void 0),c=e[pt]||null,c=c!=null?c[i]:null,typeof c=="function"&&e.removeEventListener(t,c,o),typeof s=="function")){typeof c!="function"&&c!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,o);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):Ra(e,i,s)}}}function ct(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ge("error",e),ge("load",e);var s=!1,o=!1,c;for(c in i)if(i.hasOwnProperty(c)){var h=i[c];if(h!=null)switch(c){case"src":s=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:ze(e,t,c,h,i,null)}}o&&ze(e,t,"srcSet",i.srcSet,i,null),s&&ze(e,t,"src",i.src,i,null);return;case"input":ge("invalid",e);var p=c=h=o=null,v=null,_=null;for(s in i)if(i.hasOwnProperty(s)){var M=i[s];if(M!=null)switch(s){case"name":o=M;break;case"type":h=M;break;case"checked":v=M;break;case"defaultChecked":_=M;break;case"value":c=M;break;case"defaultValue":p=M;break;case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(l(137,t));break;default:ze(e,t,s,M,i,null)}}_u(e,c,p,v,_,h,o,!1);return;case"select":ge("invalid",e),s=h=c=null;for(o in i)if(i.hasOwnProperty(o)&&(p=i[o],p!=null))switch(o){case"value":c=p;break;case"defaultValue":h=p;break;case"multiple":s=p;default:ze(e,t,o,p,i,null)}t=c,i=h,e.multiple=!!s,t!=null?Oi(e,!!s,t,!1):i!=null&&Oi(e,!!s,i,!0);return;case"textarea":ge("invalid",e),c=o=s=null;for(h in i)if(i.hasOwnProperty(h)&&(p=i[h],p!=null))switch(h){case"value":s=p;break;case"defaultValue":o=p;break;case"children":c=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(l(91));break;default:ze(e,t,h,p,i,null)}Nu(e,s,o,c);return;case"option":for(v in i)i.hasOwnProperty(v)&&(s=i[v],s!=null)&&(v==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":ze(e,t,v,s,i,null));return;case"dialog":ge("beforetoggle",e),ge("toggle",e),ge("cancel",e),ge("close",e);break;case"iframe":case"object":ge("load",e);break;case"video":case"audio":for(s=0;s<na.length;s++)ge(na[s],e);break;case"image":ge("error",e),ge("load",e);break;case"details":ge("toggle",e);break;case"embed":case"source":case"link":ge("error",e),ge("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(_ in i)if(i.hasOwnProperty(_)&&(s=i[_],s!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:ze(e,t,_,s,i,null)}return;default:if(br(t)){for(M in i)i.hasOwnProperty(M)&&(s=i[M],s!==void 0&&lc(e,t,M,s,i,void 0));return}}for(p in i)i.hasOwnProperty(p)&&(s=i[p],s!=null&&ze(e,t,p,s,i,null))}function Yg(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,c=null,h=null,p=null,v=null,_=null,M=null;for(O in i){var D=i[O];if(i.hasOwnProperty(O)&&D!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":v=D;default:s.hasOwnProperty(O)||ze(e,t,O,null,s,D)}}for(var A in s){var O=s[A];if(D=i[A],s.hasOwnProperty(A)&&(O!=null||D!=null))switch(A){case"type":c=O;break;case"name":o=O;break;case"checked":_=O;break;case"defaultChecked":M=O;break;case"value":h=O;break;case"defaultValue":p=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(l(137,t));break;default:O!==D&&ze(e,t,A,O,s,D)}}gr(e,h,p,v,_,M,c,o);return;case"select":O=h=p=A=null;for(c in i)if(v=i[c],i.hasOwnProperty(c)&&v!=null)switch(c){case"value":break;case"multiple":O=v;default:s.hasOwnProperty(c)||ze(e,t,c,null,s,v)}for(o in s)if(c=s[o],v=i[o],s.hasOwnProperty(o)&&(c!=null||v!=null))switch(o){case"value":A=c;break;case"defaultValue":p=c;break;case"multiple":h=c;default:c!==v&&ze(e,t,o,c,s,v)}t=p,i=h,s=O,A!=null?Oi(e,!!i,A,!1):!!s!=!!i&&(t!=null?Oi(e,!!i,t,!0):Oi(e,!!i,i?[]:"",!1));return;case"textarea":O=A=null;for(p in i)if(o=i[p],i.hasOwnProperty(p)&&o!=null&&!s.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:ze(e,t,p,null,s,o)}for(h in s)if(o=s[h],c=i[h],s.hasOwnProperty(h)&&(o!=null||c!=null))switch(h){case"value":A=o;break;case"defaultValue":O=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(l(91));break;default:o!==c&&ze(e,t,h,o,s,c)}Au(e,A,O);return;case"option":for(var I in i)A=i[I],i.hasOwnProperty(I)&&A!=null&&!s.hasOwnProperty(I)&&(I==="selected"?e.selected=!1:ze(e,t,I,null,s,A));for(v in s)A=s[v],O=i[v],s.hasOwnProperty(v)&&A!==O&&(A!=null||O!=null)&&(v==="selected"?e.selected=A&&typeof A!="function"&&typeof A!="symbol":ze(e,t,v,A,s,O));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var le in i)A=i[le],i.hasOwnProperty(le)&&A!=null&&!s.hasOwnProperty(le)&&ze(e,t,le,null,s,A);for(_ in s)if(A=s[_],O=i[_],s.hasOwnProperty(_)&&A!==O&&(A!=null||O!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(l(137,t));break;default:ze(e,t,_,A,s,O)}return;default:if(br(t)){for(var Me in i)A=i[Me],i.hasOwnProperty(Me)&&A!==void 0&&!s.hasOwnProperty(Me)&&lc(e,t,Me,void 0,s,A);for(M in s)A=s[M],O=i[M],!s.hasOwnProperty(M)||A===O||A===void 0&&O===void 0||lc(e,t,M,A,s,O);return}}for(var E in i)A=i[E],i.hasOwnProperty(E)&&A!=null&&!s.hasOwnProperty(E)&&ze(e,t,E,null,s,A);for(D in s)A=s[D],O=i[D],!s.hasOwnProperty(D)||A===O||A==null&&O==null||ze(e,t,D,A,s,O)}function zd(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Vg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var o=i[s],c=o.transferSize,h=o.initiatorType,p=o.duration;if(c&&p&&zd(h)){for(h=0,p=o.responseEnd,s+=1;s<i.length;s++){var v=i[s],_=v.startTime;if(_>p)break;var M=v.transferSize,D=v.initiatorType;M&&zd(D)&&(v=v.responseEnd,h+=M*(v<p?1:(p-_)/(v-_)))}if(--s,t+=8*(c+h)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var rc=null,oc=null;function Ol(e){return e.nodeType===9?e:e.ownerDocument}function Md(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 Cd(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 cc(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 uc=null;function Xg(){var e=window.event;return e&&e.type==="popstate"?e===uc?!1:(uc=e,!0):(uc=null,!1)}var Ud=typeof setTimeout=="function"?setTimeout:void 0,Gg=typeof clearTimeout=="function"?clearTimeout:void 0,Dd=typeof Promise=="function"?Promise:void 0,Qg=typeof queueMicrotask=="function"?queueMicrotask:typeof Dd<"u"?function(e){return Dd.resolve(null).then(e).catch(Kg)}:Ud;function Kg(e){setTimeout(function(){throw e})}function Qn(e){return e==="head"}function Bd(e,t){var i=t,s=0;do{var o=i.nextSibling;if(e.removeChild(i),o&&o.nodeType===8)if(i=o.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(o),rs(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")sa(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,sa(i);for(var c=i.firstChild;c;){var h=c.nextSibling,p=c.nodeName;c[xs]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&c.rel.toLowerCase()==="stylesheet"||i.removeChild(c),c=h}}else i==="body"&&sa(e.ownerDocument.body);i=o}while(i);rs(t)}function qd(e,t){var i=e;e=0;do{var s=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function fc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":fc(i),mr(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function Zg(e,t,i,s){for(;e.nodeType===1;){var o=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[xs])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!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=Lt(e.nextSibling),e===null)break}return null}function Jg(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Lt(e.nextSibling),e===null))return null;return e}function Ld(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Lt(e.nextSibling),e===null))return null;return e}function hc(e){return e.data==="$?"||e.data==="$~"}function dc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Fg(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Lt(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 pc=null;function Hd(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Lt(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function $d(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function Yd(e,t,i){switch(t=Ol(i),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 sa(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mr(e)}var Ht=new Map,Vd=new Set;function jl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Tn=$.d;$.d={f:Wg,r:Ig,D:Pg,C:ev,L:tv,m:nv,X:sv,S:iv,M:av};function Wg(){var e=Tn.f(),t=Sl();return e||t}function Ig(e){var t=_i(e);t!==null&&t.tag===5&&t.type==="form"?lh(t):Tn.r(e)}var ss=typeof document>"u"?null:document;function Xd(e,t,i){var s=ss;if(s&&typeof t=="string"&&t){var o=zt(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof i=="string"&&(o+='[crossorigin="'+i+'"]'),Vd.has(o)||(Vd.add(o),e={rel:e,crossOrigin:i,href:t},s.querySelector(o)===null&&(t=s.createElement("link"),ct(t,"link",e),tt(t),s.head.appendChild(t)))}}function Pg(e){Tn.D(e),Xd("dns-prefetch",e,null)}function ev(e,t){Tn.C(e,t),Xd("preconnect",e,t)}function tv(e,t,i){Tn.L(e,t,i);var s=ss;if(s&&e&&t){var o='link[rel="preload"][as="'+zt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(o+='[imagesrcset="'+zt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(o+='[imagesizes="'+zt(i.imageSizes)+'"]')):o+='[href="'+zt(e)+'"]';var c=o;switch(t){case"style":c=as(e);break;case"script":c=ls(e)}Ht.has(c)||(e=w({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Ht.set(c,e),s.querySelector(o)!==null||t==="style"&&s.querySelector(aa(c))||t==="script"&&s.querySelector(la(c))||(t=s.createElement("link"),ct(t,"link",e),tt(t),s.head.appendChild(t)))}}function nv(e,t){Tn.m(e,t);var i=ss;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+zt(s)+'"][href="'+zt(e)+'"]',c=o;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=ls(e)}if(!Ht.has(c)&&(e=w({rel:"modulepreload",href:e},t),Ht.set(c,e),i.querySelector(o)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(la(c)))return}s=i.createElement("link"),ct(s,"link",e),tt(s),i.head.appendChild(s)}}}function iv(e,t,i){Tn.S(e,t,i);var s=ss;if(s&&e){var o=Ai(s).hoistableStyles,c=as(e);t=t||"default";var h=o.get(c);if(!h){var p={loading:0,preload:null};if(h=s.querySelector(aa(c)))p.loading=5;else{e=w({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Ht.get(c))&&mc(e,i);var v=h=s.createElement("link");tt(v),ct(v,"link",e),v._p=new Promise(function(_,M){v.onload=_,v.onerror=M}),v.addEventListener("load",function(){p.loading|=1}),v.addEventListener("error",function(){p.loading|=2}),p.loading|=4,Rl(h,t,s)}h={type:"stylesheet",instance:h,count:1,state:p},o.set(c,h)}}}function sv(e,t){Tn.X(e,t);var i=ss;if(i&&e){var s=Ai(i).hoistableScripts,o=ls(e),c=s.get(o);c||(c=i.querySelector(la(o)),c||(e=w({src:e,async:!0},t),(t=Ht.get(o))&&yc(e,t),c=i.createElement("script"),tt(c),ct(c,"link",e),i.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function av(e,t){Tn.M(e,t);var i=ss;if(i&&e){var s=Ai(i).hoistableScripts,o=ls(e),c=s.get(o);c||(c=i.querySelector(la(o)),c||(e=w({src:e,async:!0,type:"module"},t),(t=Ht.get(o))&&yc(e,t),c=i.createElement("script"),tt(c),ct(c,"link",e),i.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function Gd(e,t,i,s){var o=(o=he.current)?jl(o):null;if(!o)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=as(i.href),i=Ai(o).hoistableStyles,s=i.get(t),s||(s={type:"style",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=as(i.href);var c=Ai(o).hoistableStyles,h=c.get(e);if(h||(o=o.ownerDocument||o,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,h),(c=o.querySelector(aa(e)))&&!c._p&&(h.instance=c,h.state.loading=5),Ht.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Ht.set(e,i),c||lv(o,e,i,h.state))),t&&s===null)throw Error(l(528,""));return h}if(t&&s!==null)throw Error(l(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ls(i),i=Ai(o).hoistableScripts,s=i.get(t),s||(s={type:"script",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function as(e){return'href="'+zt(e)+'"'}function aa(e){return'link[rel="stylesheet"]['+e+"]"}function Qd(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function lv(e,t,i,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),ct(t,"link",i),tt(t),e.head.appendChild(t))}function ls(e){return'[src="'+zt(e)+'"]'}function la(e){return"script[async]"+e}function Kd(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+zt(i.href)+'"]');if(s)return t.instance=s,tt(s),s;var o=w({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),tt(s),ct(s,"style",o),Rl(s,i.precedence,e),t.instance=s;case"stylesheet":o=as(i.href);var c=e.querySelector(aa(o));if(c)return t.state.loading|=4,t.instance=c,tt(c),c;s=Qd(i),(o=Ht.get(o))&&mc(s,o),c=(e.ownerDocument||e).createElement("link"),tt(c);var h=c;return h._p=new Promise(function(p,v){h.onload=p,h.onerror=v}),ct(c,"link",s),t.state.loading|=4,Rl(c,i.precedence,e),t.instance=c;case"script":return c=ls(i.src),(o=e.querySelector(la(c)))?(t.instance=o,tt(o),o):(s=i,(o=Ht.get(c))&&(s=w({},i),yc(s,o)),e=e.ownerDocument||e,o=e.createElement("script"),tt(o),ct(o,"link",s),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Rl(s,i.precedence,e));return t.instance}function Rl(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=s.length?s[s.length-1]:null,c=o,h=0;h<s.length;h++){var p=s[h];if(p.dataset.precedence===t)c=p;else if(c!==o)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function mc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function yc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var zl=null;function Zd(e,t,i){if(zl===null){var s=new Map,o=zl=new Map;o.set(i,s)}else o=zl,s=o.get(i),s||(s=new Map,o.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),o=0;o<i.length;o++){var c=i[o];if(!(c[xs]||c[at]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var h=c.getAttribute(t)||"";h=e+h;var p=s.get(h);p?p.push(c):s.set(h,[c])}}return s}function Jd(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function rv(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Fd(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function ov(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var o=as(s.href),c=t.querySelector(aa(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ml.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=c,tt(c);return}c=t.ownerDocument||t,s=Qd(s),(o=Ht.get(o))&&mc(s,o),c=c.createElement("link"),tt(c);var h=c;h._p=new Promise(function(p,v){h.onload=p,h.onerror=v}),ct(c,"link",s),i.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Ml.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var gc=0;function cv(e,t){return e.stylesheets&&e.count===0&&Ul(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&Ul(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&gc===0&&(gc=62500*Vg());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ul(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>gc?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(o)}}:null}function Ml(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ul(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Cl=null;function Ul(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Cl=new Map,t.forEach(uv,e),Cl=null,Ml.call(e))}function uv(e,t){if(!(t.state.loading&4)){var i=Cl.get(e);if(i)var s=i.get(null);else{i=new Map,Cl.set(e,i);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<o.length;c++){var h=o[c];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(i.set(h.dataset.precedence,h),s=h)}s&&i.set(null,s)}o=t.instance,h=o.getAttribute("data-precedence"),c=i.get(h)||s,c===s&&i.set(null,o),i.set(h,o),this.count++,s=Ml.bind(this),o.addEventListener("load",s),o.addEventListener("error",s),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var ra={$$typeof:J,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function fv(e,t,i,s,o,c,h,p,v){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=fr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fr(0),this.hiddenUpdates=fr(null),this.identifierPrefix=s,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=v,this.incompleteTransitions=new Map}function Wd(e,t,i,s,o,c,h,p,v,_,M,D){return e=new fv(e,t,i,h,v,_,M,D,p),t=1,c===!0&&(t|=24),c=kt(3,null,null,t),e.current=c,c.stateNode=e,t=Jr(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:s,isDehydrated:i,cache:t},Pr(c),e}function Id(e){return e?(e=Bi,e):Bi}function Pd(e,t,i,s,o,c){o=Id(o),s.context===null?s.context=o:s.pendingContext=o,s=Un(t),s.payload={element:i},c=c===void 0?null:c,c!==null&&(s.callback=c),i=Dn(e,s,t),i!==null&&(wt(i,e,t),Ls(i,e,t))}function ep(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function vc(e,t){ep(e,t),(e=e.alternate)&&ep(e,t)}function tp(e){if(e.tag===13||e.tag===31){var t=oi(e,67108864);t!==null&&wt(t,e,67108864),vc(e,67108864)}}function np(e){if(e.tag===13||e.tag===31){var t=Ot();t=hr(t);var i=oi(e,t);i!==null&&wt(i,e,t),vc(e,t)}}var Dl=!0;function hv(e,t,i,s){var o=k.T;k.T=null;var c=$.p;try{$.p=2,bc(e,t,i,s)}finally{$.p=c,k.T=o}}function dv(e,t,i,s){var o=k.T;k.T=null;var c=$.p;try{$.p=8,bc(e,t,i,s)}finally{$.p=c,k.T=o}}function bc(e,t,i,s){if(Dl){var o=wc(s);if(o===null)ac(e,t,s,Bl,i),sp(e,s);else if(mv(o,e,t,i,s))s.stopPropagation();else if(sp(e,s),t&4&&-1<pv.indexOf(e)){for(;o!==null;){var c=_i(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var h=ii(c.pendingLanes);if(h!==0){var p=c;for(p.pendingLanes|=2,p.entangledLanes|=2;h;){var v=1<<31-xt(h);p.entanglements[1]|=v,h&=~v}en(c),(Ae&6)===0&&(bl=Qe()+500,ta(0))}}break;case 31:case 13:p=oi(c,2),p!==null&&wt(p,c,2),Sl(),vc(c,2)}if(c=wc(s),c===null&&ac(e,t,s,Bl,i),c===o)break;o=c}o!==null&&s.stopPropagation()}else ac(e,t,s,null,i)}}function wc(e){return e=Sr(e),Sc(e)}var Bl=null;function Sc(e){if(Bl=null,e=Ti(e),e!==null){var t=f(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=d(t),e!==null)return e;e=null}else if(i===31){if(e=m(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Bl=e,null}function ip(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ei()){case uu:return 2;case fu:return 8;case _a:case ey:return 32;case hu:return 268435456;default:return 32}default:return 32}}var xc=!1,Kn=null,Zn=null,Jn=null,oa=new Map,ca=new Map,Fn=[],pv="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 sp(e,t){switch(e){case"focusin":case"focusout":Kn=null;break;case"dragenter":case"dragleave":Zn=null;break;case"mouseover":case"mouseout":Jn=null;break;case"pointerover":case"pointerout":oa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ca.delete(t.pointerId)}}function ua(e,t,i,s,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:c,targetContainers:[o]},t!==null&&(t=_i(t),t!==null&&tp(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function mv(e,t,i,s,o){switch(t){case"focusin":return Kn=ua(Kn,e,t,i,s,o),!0;case"dragenter":return Zn=ua(Zn,e,t,i,s,o),!0;case"mouseover":return Jn=ua(Jn,e,t,i,s,o),!0;case"pointerover":var c=o.pointerId;return oa.set(c,ua(oa.get(c)||null,e,t,i,s,o)),!0;case"gotpointercapture":return c=o.pointerId,ca.set(c,ua(ca.get(c)||null,e,t,i,s,o)),!0}return!1}function ap(e){var t=Ti(e.target);if(t!==null){var i=f(t);if(i!==null){if(t=i.tag,t===13){if(t=d(i),t!==null){e.blockedOn=t,vu(e.priority,function(){np(i)});return}}else if(t===31){if(t=m(i),t!==null){e.blockedOn=t,vu(e.priority,function(){np(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ql(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=wc(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);wr=s,i.target.dispatchEvent(s),wr=null}else return t=_i(i),t!==null&&tp(t),e.blockedOn=i,!1;t.shift()}return!0}function lp(e,t,i){ql(e)&&i.delete(t)}function yv(){xc=!1,Kn!==null&&ql(Kn)&&(Kn=null),Zn!==null&&ql(Zn)&&(Zn=null),Jn!==null&&ql(Jn)&&(Jn=null),oa.forEach(lp),ca.forEach(lp)}function Ll(e,t){e.blockedOn===t&&(e.blockedOn=null,xc||(xc=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,yv)))}var Hl=null;function rp(e){Hl!==e&&(Hl=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){Hl===e&&(Hl=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],o=e[t+2];if(typeof s!="function"){if(Sc(s||i)===null)continue;break}var c=_i(i);c!==null&&(e.splice(t,3),t-=3,wo(c,{pending:!0,data:o,method:i.method,action:s},s,o))}}))}function rs(e){function t(v){return Ll(v,e)}Kn!==null&&Ll(Kn,e),Zn!==null&&Ll(Zn,e),Jn!==null&&Ll(Jn,e),oa.forEach(t),ca.forEach(t);for(var i=0;i<Fn.length;i++){var s=Fn[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Fn.length&&(i=Fn[0],i.blockedOn===null);)ap(i),i.blockedOn===null&&Fn.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var o=i[s],c=i[s+1],h=o[pt]||null;if(typeof c=="function")h||rp(i);else if(h){var p=null;if(c&&c.hasAttribute("formAction")){if(o=c,h=c[pt]||null)p=h.formAction;else if(Sc(o)!==null)continue}else p=h.action;typeof p=="function"?i[s+1]=p:(i.splice(s,3),s-=3),rp(i)}}}function op(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(h){return o=h})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),s||setTimeout(i,20)}function i(){if(!s&&!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 s=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function Ec(e){this._internalRoot=e}$l.prototype.render=Ec.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var i=t.current,s=Ot();Pd(i,s,e,t,null,null)},$l.prototype.unmount=Ec.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Pd(e.current,2,null,e,null,null),Sl(),t[ki]=null}};function $l(e){this._internalRoot=e}$l.prototype.unstable_scheduleHydration=function(e){if(e){var t=gu();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Fn.length&&t!==0&&t<Fn[i].priority;i++);Fn.splice(i,0,e),i===0&&ap(e)}};var cp=n.version;if(cp!=="19.2.8")throw Error(l(527,cp,"19.2.8"));$.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=b(t),e=e!==null?R(e):null,e=e===null?null:e.stateNode,e};var gv={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yl.isDisabled&&Yl.supportsFiber)try{bs=Yl.inject(gv),St=Yl}catch{}}return pa.createRoot=function(e,t){if(!u(e))throw Error(l(299));var i=!1,s="",o=yh,c=gh,h=vh;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=Wd(e,1,!1,null,null,i,s,null,o,c,h,op),e[ki]=t.current,sc(e),new Ec(t)},pa.hydrateRoot=function(e,t,i){if(!u(e))throw Error(l(299));var s=!1,o="",c=yh,h=gh,p=vh,v=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(o=i.identifierPrefix),i.onUncaughtError!==void 0&&(c=i.onUncaughtError),i.onCaughtError!==void 0&&(h=i.onCaughtError),i.onRecoverableError!==void 0&&(p=i.onRecoverableError),i.formState!==void 0&&(v=i.formState)),t=Wd(e,1,!0,t,i??null,s,o,v,c,h,p,op),t.context=Id(null),i=t.current,s=Ot(),s=hr(s),o=Un(s),o.callback=null,Dn(i,o,s),i=s,t.current.lanes=i,Ss(t,i),en(t),e[ki]=t.current,sc(e),new $l(t)},pa.version="19.2.8",pa}var Ap;function Cv(){if(Ap)return Oc.exports;Ap=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),Oc.exports=Mv(),Oc.exports}var Uv=Cv(),Xl={exports:{}},Np;function Dv(){if(Np)return Xl.exports;Np=1;var r=typeof Reflect=="object"?Reflect:null,n=r&&typeof r.apply=="function"?r.apply:function(C,H,B){return Function.prototype.apply.call(C,H,B)},a;r&&typeof r.ownKeys=="function"?a=r.ownKeys:Object.getOwnPropertySymbols?a=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:a=function(C){return Object.getOwnPropertyNames(C)};function l(N){console&&console.warn&&console.warn(N)}var u=Number.isNaN||function(C){return C!==C};function f(){f.init.call(this)}Xl.exports=f,Xl.exports.once=z,f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var d=10;function m(N){if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N)}Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(N){if(typeof N!="number"||N<0||u(N))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+N+".");d=N}}),f.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},f.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||u(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function y(N){return N._maxListeners===void 0?f.defaultMaxListeners:N._maxListeners}f.prototype.getMaxListeners=function(){return y(this)},f.prototype.emit=function(C){for(var H=[],B=1;B<arguments.length;B++)H.push(arguments[B]);var Q=C==="error",ne=this._events;if(ne!==void 0)Q=Q&&ne.error===void 0;else if(!Q)return!1;if(Q){var se;if(H.length>0&&(se=H[0]),se instanceof Error)throw se;var xe=new Error("Unhandled error."+(se?" ("+se.message+")":""));throw xe.context=se,xe}var ue=ne[C];if(ue===void 0)return!1;if(typeof ue=="function")n(ue,this,H);else for(var je=ue.length,Ge=K(ue,je),B=0;B<je;++B)n(Ge[B],this,H);return!0};function b(N,C,H,B){var Q,ne,se;if(m(H),ne=N._events,ne===void 0?(ne=N._events=Object.create(null),N._eventsCount=0):(ne.newListener!==void 0&&(N.emit("newListener",C,H.listener?H.listener:H),ne=N._events),se=ne[C]),se===void 0)se=ne[C]=H,++N._eventsCount;else if(typeof se=="function"?se=ne[C]=B?[H,se]:[se,H]:B?se.unshift(H):se.push(H),Q=y(N),Q>0&&se.length>Q&&!se.warned){se.warned=!0;var xe=new Error("Possible EventEmitter memory leak detected. "+se.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");xe.name="MaxListenersExceededWarning",xe.emitter=N,xe.type=C,xe.count=se.length,l(xe)}return N}f.prototype.addListener=function(C,H){return b(this,C,H,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(C,H){return b(this,C,H,!0)};function R(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function w(N,C,H){var B={fired:!1,wrapFn:void 0,target:N,type:C,listener:H},Q=R.bind(B);return Q.listener=H,B.wrapFn=Q,Q}f.prototype.once=function(C,H){return m(H),this.on(C,w(this,C,H)),this},f.prototype.prependOnceListener=function(C,H){return m(H),this.prependListener(C,w(this,C,H)),this},f.prototype.removeListener=function(C,H){var B,Q,ne,se,xe;if(m(H),Q=this._events,Q===void 0)return this;if(B=Q[C],B===void 0)return this;if(B===H||B.listener===H)--this._eventsCount===0?this._events=Object.create(null):(delete Q[C],Q.removeListener&&this.emit("removeListener",C,B.listener||H));else if(typeof B!="function"){for(ne=-1,se=B.length-1;se>=0;se--)if(B[se]===H||B[se].listener===H){xe=B[se].listener,ne=se;break}if(ne<0)return this;ne===0?B.shift():P(B,ne),B.length===1&&(Q[C]=B[0]),Q.removeListener!==void 0&&this.emit("removeListener",C,xe||H)}return this},f.prototype.off=f.prototype.removeListener,f.prototype.removeAllListeners=function(C){var H,B,Q;if(B=this._events,B===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):B[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete B[C]),this;if(arguments.length===0){var ne=Object.keys(B),se;for(Q=0;Q<ne.length;++Q)se=ne[Q],se!=="removeListener"&&this.removeAllListeners(se);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(H=B[C],typeof H=="function")this.removeListener(C,H);else if(H!==void 0)for(Q=H.length-1;Q>=0;Q--)this.removeListener(C,H[Q]);return this};function j(N,C,H){var B=N._events;if(B===void 0)return[];var Q=B[C];return Q===void 0?[]:typeof Q=="function"?H?[Q.listener||Q]:[Q]:H?W(Q):K(Q,Q.length)}f.prototype.listeners=function(C){return j(this,C,!0)},f.prototype.rawListeners=function(C){return j(this,C,!1)},f.listenerCount=function(N,C){return typeof N.listenerCount=="function"?N.listenerCount(C):L.call(N,C)},f.prototype.listenerCount=L;function L(N){var C=this._events;if(C!==void 0){var H=C[N];if(typeof H=="function")return 1;if(H!==void 0)return H.length}return 0}f.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]};function K(N,C){for(var H=new Array(C),B=0;B<C;++B)H[B]=N[B];return H}function P(N,C){for(;C+1<N.length;C++)N[C]=N[C+1];N.pop()}function W(N){for(var C=new Array(N.length),H=0;H<C.length;++H)C[H]=N[H].listener||N[H];return C}function z(N,C){return new Promise(function(H,B){function Q(se){N.removeListener(C,ne),B(se)}function ne(){typeof N.removeListener=="function"&&N.removeListener("error",Q),H([].slice.call(arguments))}J(N,C,ne,{once:!0}),C!=="error"&&X(N,Q,{once:!0})})}function X(N,C,H){typeof N.on=="function"&&J(N,"error",C,H)}function J(N,C,H,B){if(typeof N.on=="function")B.once?N.once(C,H):N.on(C,H);else if(typeof N.addEventListener=="function")N.addEventListener(C,function Q(ne){B.once&&N.removeEventListener(C,Q),H(ne)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof N)}return Xl.exports}var ei=Dv();const Il=Tv(ei),Bv=Object.prototype.toString,qv="[object Uint8Array]",Lv="[object ArrayBuffer]";function pm(r,n,a){return r?r.constructor===n?!0:Bv.call(r)===a:!1}function Hv(r){return pm(r,Uint8Array,qv)}function $v(r){return pm(r,ArrayBuffer,Lv)}function Yv(r){return Hv(r)||$v(r)}function Vv(r){if(!Yv(r))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof r}\``)}const Op={utf8:new globalThis.TextDecoder("utf8")};function mm(r,n="utf8"){return Vv(r),Op[n]??=new globalThis.TextDecoder(n),Op[n].decode(r)}function Xv(r){if(typeof r!="string")throw new TypeError(`Expected \`string\`, got \`${typeof r}\``)}const Gv=new globalThis.TextEncoder;function ym(r){return Xv(r),Gv.encode(r)}Array.from({length:256},(r,n)=>n.toString(16).padStart(2,"0"));const ut=[];for(let r=0;r<256;++r)ut.push((r+256).toString(16).slice(1));function Qv(r,n=0){return(ut[r[n+0]]+ut[r[n+1]]+ut[r[n+2]]+ut[r[n+3]]+"-"+ut[r[n+4]]+ut[r[n+5]]+"-"+ut[r[n+6]]+ut[r[n+7]]+"-"+ut[r[n+8]]+ut[r[n+9]]+"-"+ut[r[n+10]]+ut[r[n+11]]+ut[r[n+12]]+ut[r[n+13]]+ut[r[n+14]]+ut[r[n+15]]).toLowerCase()}const Kv=new Uint8Array(16);function Zv(){return crypto.getRandomValues(Kv)}function et(r,n,a){return crypto.randomUUID?crypto.randomUUID():Jv(r)}function Jv(r,n,a){r=r||{};const l=r.random??r.rng?.()??Zv();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,Qv(l)}const Lc=1024,jp="$",Si={openBrace:123,closeBrace:125,quote:34,backslash:92,delimiter:36},Rp=(r,n)=>{if(n===0||r(0)!==Si.openBrace)return-1;const a=Math.min(n,Lc);let l=0,u=!1,f=!1;for(let d=0;d<a;d++){const m=r(d);if(u){f?f=!1:m===Si.backslash?f=!0:m===Si.quote&&(u=!1);continue}if(m===Si.quote)u=!0;else if(m===Si.openBrace)l++;else if(m===Si.closeBrace&&--l===0){const y=d+1;return y<a&&r(y)===Si.delimiter?y:-1}}return-1},_e={connected:"connected",disconnected:"disconnected",peerOnline:"peerOnline",peerGone:"peerGone",peerDisplaced:"peerDisplaced",peerShape:"peerShape",rejected:"rejected",unroutable:"unroutable",transportError:"transportError",relayed:"relayed"};class gm{maxPeers;peers=new Map;constructor(n=1e4){this.maxPeers=n}set(n,a){for(this.peers.delete(n),this.peers.set(n,a);this.peers.size>this.maxPeers;){const l=this.peers.keys().next();if(l.done)break;this.peers.delete(l.value)}}get(n){return this.peers.get(n)}delete(n){return this.shapes.delete(n),this.peers.delete(n)}clear(){this.peers.clear(),this.shapes.clear()}shapes=new Map;noteShape(n,a){if(this.shapes.get(n)===a)return!1;for(this.shapes.delete(n),this.shapes.set(n,a);this.shapes.size>this.maxPeers;){const l=this.shapes.keys().next();if(l.done)break;this.shapes.delete(l.value)}return!0}shapeOf(n){return this.shapes.get(n)}get size(){return this.peers.size}namesFor(n){const a=[];for(const[l,u]of this.peers)u===n&&a.push(l);return a}names(){return[...this.peers.keys()]}}class rr extends ei.EventEmitter{name;destinations=[];peerRegistry=new gm;readyFlag=!1;seq=0;constructor(n,a){super(),this.name=n,n||(this.name=et()),a&&a.forEach(l=>{l.pipe(this)})}async ready(n=3e4){const a=Date.now()+n;for(;!this.readyFlag;){if(Date.now()>a)return!1;await new Promise(l=>setTimeout(l,10))}return!0}async open(){}async close(){}buildHeader(n,a,l){return{source:n,target:a,time:Date.now(),seq:this.seq++,...l}}prependHeader(n,a,l){return this.frameMessage(this.buildHeader(n,a),l)}frameMessage(n,a){const l=JSON.stringify(n)+jp,u=ym(l);if(u.length>Lc)throw new Error(`message header is ${u.length} bytes, over the ${Lc} byte limit (source '${n.source}', target '${n.target}') - shorten the peer names`);if(typeof a=="string")return l+a;const f=new Uint8Array(u.length+a.length);return f.set(u,0),f.set(a,u.length),f}extractHeader(n){const a=typeof n=="string",l=Rp(a?y=>n.charCodeAt(y):y=>n[y],n.length);if(l<0)return[void 0,"","no msgrpc header"];const u=a?n.substring(0,l):mm(n.subarray(0,l));let f;try{f=JSON.parse(u)}catch(y){return[void 0,"",`unparsable header: ${String(y)}`]}if(!f||typeof f!="object")return[void 0,"","header is not an object"];if(typeof f.target!="string"||!f.target)return[void 0,"","header names no target"];if(typeof f.source!="string"||!f.source)return[void 0,"","header names no source"];const d=l+jp.length,m=a?n.substring(d):n.slice(d);return this.setKnownSource(f.source),[f,m]}getName(){return this.name}targetExists(n,a){let l;this.name===n&&(l=this);const u=this.peerRegistry.get(n);return u&&(l=u),l||this.destinations.map(f=>{!l&&!f.target.isTransport()&&f.target.targetExists(n,(a||0)+1)&&(l=f.target)}),l}pipe(n){const a=et();return this.destinations.push({id:a,target:n}),()=>{this.destinations=this.destinations.filter(l=>l.id!==a)}}async receive(n,a,l){}async receivePayload(n,a,l){}async send(n,a,l){await Promise.all(this.destinations.map(async u=>await u.target.receive(n,a,l)))}setKnownSource(n){this.peerRegistry.set(n,this)}usePeerRegistry(n){return this.peerRegistry=n,this}getIdentity(n){}async sendPayload(n,a,l,u){}isTransport(){return!1}}var We;(function(r){r.RequestMessage="REQUEST",r.ResponseMessage="RESPONSE",r.ErrorMessage="ERROR",r.EventMessage="EVENT",r.UnknownMessage="UNKNOWN"})(We||(We={}));class vm{type;payload}const Fv=(r,n,a,l)=>{const u=new vm;return u.type=l||We.UnknownMessage,u.payload=r,u};class bm extends rr{name;constructor(n,a){super(n),this.name=n,n||(this.name=et()),a&&a.forEach(l=>{l.pipe(this)})}pipe(n){const a=et();return this.destinations.push({id:a,target:n}),()=>{this.destinations=this.destinations.filter(l=>l.id!==a)}}receive(n,a,l){return Promise.resolve()}async send(n,a,l){await Promise.all(this.destinations.map(async u=>await u.target.receive(n,a,l)))}async sendPayload(n,a,l,u){const f=Fv(n,this.name,u,a);await this.send(f,l,u)}}const Wv=r=>r==="on"||r==="addListener"||r==="prependListener"||r==="once"||r==="prependOnceListener"||r==="off"||r==="removeListener"||r==="emit"||r==="removeListener"||r==="removeAllListeners"||r==="setMaxListeners"||r==="getMaxListeners";var Xe;(function(r){r.CallInstanceMethod="POST",r.success="SUCCESS",r.error="ERROR",r.event="EVENT"})(Xe||(Xe={}));const Gl={query:0,"idempotent-command":1,"non-repeatable-command":2},Mc=r=>{if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&typeof r=="object"){const n=r;if(typeof n.message=="string")return{name:typeof n.name=="string"?n.name:"Error",message:n.message}}return{name:"Error",message:String(r)}},Iv=r=>"code"in r,Hc=new WeakMap,$c=new WeakMap,Yc=new WeakMap,Vc=new WeakMap,Xc=new WeakMap,Pv=(r,n,a,l,u,f)=>{let d=Hc.get(r);if(d||Hc.set(r,d=new Set),d.add(n),l){let y=Yc.get(r);y||Yc.set(r,y=new Set),y.add(n)}if(u){let y=Vc.get(r);y||Vc.set(r,y=new Set),y.add(n)}if(f){let y=Xc.get(r);y||Xc.set(r,y=new Set),y.add(n)}if(!a)return;let m=$c.get(r);m||$c.set(r,m=new Map),m.set(n,a)},zp=(r,n)=>{if(r.static)throw new Error("@rpc: static methods cannot be exposed");if(r.private)throw new Error("@rpc: private methods cannot be exposed");r.addInitializer(function(){Pv(this.constructor,String(r.name),n.semantics,n.conflate,n.requiresAuthority,n.injectInvocation)})};function fs(r,n){if(typeof r=="function"&&n)return zp(n,{});const a=r;return(l,u)=>zp(u,a)}const wm=new WeakMap,Sm=(r,n={})=>(a,l)=>(wm.set(a,{name:r,version:n.version,execution:n.execution,mailbox:n.mailbox}),a),e0=r=>{for(let n=r.constructor;n;n=Object.getPrototypeOf(n)){const a=wm.get(n);if(a)return a}},t0=r=>{const n=new Set;for(let a=r.constructor;a;a=Object.getPrototypeOf(a))for(const l of Hc.get(a)??[])n.add(l);return n.size?n:void 0},n0=r=>{const n=new Map;for(let a=r.constructor;a;a=Object.getPrototypeOf(a))for(const[l,u]of $c.get(a)??[])n.has(l)||n.set(l,u);return n},i0=r=>{const n=new Set;for(let a=r.constructor;a;a=Object.getPrototypeOf(a))for(const l of Yc.get(a)??[])n.add(l);return n},s0=r=>{const n=new Set;for(let a=r.constructor;a;a=Object.getPrototypeOf(a))for(const l of Vc.get(a)??[])n.add(l);return n},a0=r=>{const n=new Set;for(let a=r.constructor;a;a=Object.getPrototypeOf(a))for(const l of Xc.get(a)??[])n.add(l);return n},l0=Symbol("@source-repo/rpc/invocation"),Mp=(r,n)=>!!r&&!!n&&r.peer===n.peer&&r.instance===n.instance;class r0{durable=!1;async load(){}async save(){}}const dt="$host",Ql=128,xm=/[\u0000-\u001f\u007f]/,In=(r,n)=>{if(!r)throw new Error(`topology: ${n} is empty`);if(xm.test(r))throw new Error(`topology: ${n} contains a control character, and ids never do`)},Cc=r=>{if(r!==void 0&&xm.test(r))throw new Error("topology: a label contains a control character")};class o0{peer;options;records=new Map;onCommitted;listeners=new Map;store;loaded=!1;constructor(n,a={}){this.peer=n,this.options=a;for(const l of a.place??[])In(l,`place segment '${l}'`);Cc(a.label),this.store=a.store??new r0}async init(){const n=await this.store.load();if(n)for(const a of n)this.records.set(a.ref.instance,a);this.records.has(dt)||this.records.set(dt,{ref:{peer:this.peer,instance:dt},parent:null,owner:null,parentEpoch:et(),ownerEpoch:et(),version:{epoch:et(),revision:0},...this.options.label!==void 0?{label:this.options.label}:{}}),this.loaded=!0,await this.persist()}ref(n){return{peer:this.peer,instance:n}}get(n){return this.records.get(n)}all(){return[...this.records.values()]}get place(){return this.options.place}capabilities(){return{authorityScope:"host",cycleGuarantee:"detected",reverseIndex:"eventual",deletion:"tombstone",durability:this.store.durable?"durable":"volatile"}}async declare(n,a={}){if(this.assertLoaded(),In(n,`instance '${n}'`),n===dt)throw new Error(`topology: ${dt} is the synthetic root - set its links with updateHost()`);if(this.records.has(n))throw new Error(`topology: ${n} is already declared - changes go through update() with the expected version`);Cc(a.label);const l=a.parent===void 0?this.ref(dt):a.parent;this.checkParent(n,l),this.checkOwner(n,a.owner??null);const u={ref:this.ref(n),parent:l,owner:a.owner??null,parentEpoch:et(),ownerEpoch:et(),version:{epoch:et(),revision:0},...a.label!==void 0?{label:a.label}:{}};return this.records.set(n,u),await this.persist(),this.notify(n),u}async update(n,a,l){this.assertLoaded();const u=this.records.get(n);if(!u)throw new Error(`topology: ${n} is not declared here`);if(u.version.epoch!==l.expectedVersion.epoch||u.version.revision!==l.expectedVersion.revision)throw new Error(`topology: ${n} is at revision ${u.version.revision}, not ${l.expectedVersion.revision} - read it again and decide again`);Cc(a.label),a.parent!==void 0&&(n===dt?this.checkRootParent(a.parent):this.checkParent(n,a.parent)),a.owner!==void 0&&this.checkOwner(n,a.owner);const f={...u,...a.parent!==void 0?{parent:a.parent,parentEpoch:et()}:{},...a.owner!==void 0?{owner:a.owner,ownerEpoch:et()}:{},...a.label!==void 0?{label:a.label}:{},version:{epoch:u.version.epoch,revision:u.version.revision+1}};return this.records.set(n,f),await this.persist(),this.notify(n),f}async updateHost(n,a){return this.update(dt,n,a)}checkParent(n,a){if(a===null)return;if(In(a.peer,"parent peer"),In(a.instance,"parent instance"),a.peer!==this.peer)throw new Error(`topology: ${n} cannot have a remote physical parent - only the ${dt} root may, root to root`);if(a.instance===n)throw new Error(`topology: ${n} cannot be its own parent`);const l=new Set([n]);let u=a.instance;for(;u!==void 0;){if(l.has(u))throw new Error(`topology: parenting ${n} under ${a.instance} closes a physical cycle`);l.add(u);const f=this.records.get(u);u=f?.parent&&f.parent.peer===this.peer?f.parent.instance:void 0}}checkRootParent(n){if(n!==null){if(In(n.peer,"parent peer"),In(n.instance,"parent instance"),n.peer===this.peer)throw new Error(`topology: the ${dt} root's parent is another host's root, not something on this host`);if(n.instance!==dt)throw new Error("topology: a host root's parent must be another host root - physical edges cross hosts only root to root")}}checkOwner(n,a){if(a!==null&&(In(a.peer,"owner peer"),In(a.instance,"owner instance"),a.peer===this.peer&&a.instance===n))throw new Error(`topology: ${n} cannot own itself`)}physicalPath(n){const a=this.options.place??[this.peer],l=[],u=new Set;let f=n;for(let d=0;d<=Ql;d++){if(f===void 0)return{segments:l,validity:{status:"valid"}};if(f===dt)return{segments:[...a,...l],validity:{status:"valid"}};if(u.has(f))return{segments:l,validity:{status:"cycle",path:[...u].map(y=>this.ref(y))}};u.add(f);const m=this.records.get(f);if(!m)return{segments:l,validity:{status:"unresolved",at:this.ref(f)}};l.unshift(f),f=m.parent===null?void 0:m.parent.peer===this.peer?m.parent.instance:dt}return{segments:l,validity:{status:"depth-exceeded",maxDepth:Ql}}}ownerChain(n){const a=[],l=new Set;let u=n;for(let f=0;f<=Ql;f++){if(u===void 0)return{chain:a,validity:{status:"valid"}};if(l.has(u))return{chain:a,validity:{status:"cycle",path:a.slice(a.findIndex(m=>m.instance===u))}};l.add(u);const d=this.records.get(u);if(!d)return{chain:a,validity:{status:"unresolved",at:this.ref(u)}};if(a.push(d.ref),d.owner===null)return{chain:a,validity:{status:"valid"}};if(d.owner.peer!==this.peer)return{chain:a,continuesAt:d.owner,validity:{status:"valid"}};u=d.owner.instance}return{chain:a,validity:{status:"depth-exceeded",maxDepth:Ql}}}externalStore(n){return{getSnapshot:()=>this.records.get(n),subscribe:a=>{let l=this.listeners.get(n);return l||this.listeners.set(n,l=new Set),l.add(a),()=>l.delete(a)}}}notify(n){try{this.onCommitted?.()}catch{}for(const a of[...this.listeners.get(n)??[]])try{a()}catch{}}assertLoaded(){if(!this.loaded)throw new Error("topology: not loaded yet - await the server ready()")}async persist(){await this.store.save(this.all())}}const c0=16*1024,Cp=64*1024,u0=128,Em=r=>{const n=JSON.stringify(r);return n===void 0?8:n.length};class f0 extends ei.EventEmitter{topology;providers=new Map;subscriptions=new Map;push;constructor(n){super(),this.topology=n}key(n,a){return`${n}\0${a}`}provide(n,a,l){const u=this.key(n,a.id);if(this.providers.has(u))throw new Error(`context: ${n} already provides ${a.id} - one provider owns one value`);const f=a.maxSerializedBytes??c0,d=y=>{const b=Em(y);if(b>f)throw new Error(`context: a ${a.id} value of ${b} bytes exceeds its ${f} byte bound - context is ambient data, not a payload`);return y},m={token:a,value:d(l),epoch:et(),revision:0};return this.providers.set(u,m),this.changed(),{set:y=>{m.value=d(y),m.revision++,this.changed()},clear:()=>{this.providers.get(u)===m&&(this.providers.delete(u),this.changed())}}}changed(){for(const[n,a]of this.subscriptions)a.queued||(a.queued=!0,queueMicrotask(()=>{a.queued=!1,this.subscriptions.has(n)&&(a.seq++,this.push?.(a.source,{subscriptionId:a.subscriptionId,snapshot:this.snapshotFor(a.node,a.tokenIds,a.seq,!0)}))}));this.emit("contextChanged")}walk(n,a){const l=[],u=new Set;let f=n;for(let d=0;d<=u0;d++){if(f===void 0)return{refs:l};if(u.has(f))return{refs:l,trouble:{axis:a,status:"cycle",path:l.slice(l.findIndex(b=>b.instance===f))}};u.add(f);const m=this.topology.get(f);if(!m)return{refs:l,trouble:{axis:a,status:"invalid-reference",at:{peer:this.topology.peer,instance:f}}};l.push(m.ref);const y=a==="physical"?m.parent:m.owner;if(y===null)return{refs:l};if(y.peer!==this.topology.peer)return{refs:l,continues:y};f=y.instance}return{refs:l,trouble:{axis:a,status:"depth-exceeded"}}}chainKeyOf(n,a){return n.map(l=>{const u=this.topology.get(l.instance);return u?a==="physical"?u.parentEpoch:u.ownerEpoch:"missing"}).join("\0")}snapshotFor(n,a,l,u){const f=this.walk(n,"physical"),d=this.walk(n,"logical"),m=[...f.trouble?[f.trouble]:[],...d.trouble?[d.trouble]:[]],y=a.map(b=>{const R=[];for(const[w,j]of[["physical",f.refs],["logical",d.refs]])for(const L of j){const K=this.providers.get(this.key(L.instance,b));!K||K.token.axis!==w||u&&(K.token.exposure??"remote")==="local"||R.push({node:L,axis:w,value:K.value,provider:{epoch:K.epoch,revision:K.revision}})}return{tokenId:b,entries:R}});return{node:this.topology.ref(n),walked:{physical:f.refs,logical:d.refs},continues:{...f.continues?{physical:f.continues}:{},...d.continues?{logical:d.continues}:{}},trouble:m,chainKey:{physical:this.chainKeyOf(f.refs,"physical"),logical:this.chainKeyOf(d.refs,"logical")},tokens:y,seq:l}}subscribe(n,a,l,u){const f=`${n}\0${a}`,d=this.subscriptions.get(f),m=d?++d.seq:0;return this.subscriptions.set(f,{source:n,subscriptionId:a,node:l,tokenIds:u,seq:m,queued:!1}),this.snapshotFor(l,u,m,!0)}unsubscribe(n,a){this.subscriptions.delete(`${n}\0${a}`)}dropSubscriber(n){for(const[a,l]of this.subscriptions)l.source===n&&this.subscriptions.delete(a)}get subscriptionCount(){return this.subscriptions.size}}const Ea="$context",km="$context",h0=(r,n)=>{const a=[];for(const{token:u,entry:f}of n){if((u.capture??"never")!=="explicit")throw new Error(`context: ${u.id} declares capture '${u.capture??"never"}', so it stays on its chain`);if((u.exposure??"remote")==="local")throw new Error(`context: ${u.id} is local-only, and a capture is precisely a value leaving the host`);f&&a.push(f)}const l=a.reduce((u,f)=>u+Em(f.value),0);if(l>Cp)throw new Error(`context: a capture of ${l} bytes exceeds the ${Cp} byte bound`);return{source:r,entries:a}},_n="$snapshot",Tm=new WeakMap,Zt=r=>{const n=Tm.get(r);if(!n)throw new Error("not an RpcComponent - components are constructed through the RpcComponent base class");return n},Kl=r=>Object.freeze({...r}),Up=(r,n)=>{const a=Zt(r),l=n.props??a.props,u=n.state??a.state,f=a.validate?.(l,u);if(f)throw new Error(`component snapshot rejected: ${f}`);a.props=l,a.state=u,a.revision++,a.notify?.()};class hs extends ei.EventEmitter{constructor(n,a){super(),Tm.set(this,{epoch:et(),revision:0,props:Kl(n),state:Kl(a),authority:Object.freeze({generation:0})})}get props(){return Zt(this).props}get state(){return Zt(this).state}setState=n=>{const a=this.state,l=typeof n=="function"?n(a):n;return Up(this,{state:Kl({...a,...l})}),this.state};replaceState=n=>{const a=typeof n=="function"?n(this.state):n;return Up(this,{state:Kl(a)}),this.state}}const eu=r=>{const n=Zt(r);return{epoch:n.epoch,revision:n.revision,props:n.props,state:n.state,authority:n.authority}},d0=r=>Zt(r).authority,p0=6e4,tu=(r,n,a)=>{const l=Zt(r),u=l.authority.holder;l.expiryTimer&&clearTimeout(l.expiryTimer),l.expiryTimer=void 0,l.authority=Object.freeze(n),l.revision++,n.expiresAt!==void 0&&(l.expiryTimer=setTimeout(()=>{l.expiryTimer=void 0,!(l.authority.holder!==n.holder||l.authority.generation!==n.generation)&&tu(r,{generation:l.authority.generation+1},"expired")},n.expiresAt-Date.now()),l.expiryTimer.unref?.()),r instanceof ei.EventEmitter&&r.emit("authorityChanged",{reason:a,authority:l.authority,previousHolder:u}),l.notify?.()},m0=(r,n,a,l)=>{const f=Zt(r).authority,d=Date.now(),m=f.holder!==void 0&&(f.expiresAt??0)>d;if(m&&f.holder!==n&&!l)return{granted:!1,holder:f.holder,expiresAt:f.expiresAt};const y=m&&f.holder===n;return tu(r,{holder:n,expiresAt:d+a,generation:y?f.generation:f.generation+1},y?"renewed":m?"taken":"acquired"),{granted:!0,authority:Zt(r).authority}},y0=(r,n)=>{const a=Zt(r);return a.authority.holder!==n?"ok - was not holding":(tu(r,{generation:a.authority.generation+1},"released"),"ok")},g0=1048576,v0=(r,n)=>{Zt(r).validate=n},b0=(r,n,a,l)=>{const u=Zt(r),f=n.minPublishIntervalMs??0,d=n.maxSnapshotBytes??g0;let m=!1,y=0,b;const R=()=>{y=Date.now();const w=eu(r),j=JSON.stringify(w).length;if(j>d){l?.log("Error","component snapshot not published: {estimated} bytes exceeds the {maxBytes} byte bound",{estimated:j,maxBytes:d});return}a()};u.notify=()=>{m||(m=!0,queueMicrotask(()=>{m=!1;const w=y+f-Date.now();if(w<=0)return R();b||(b=setTimeout(()=>{b=void 0,R()},w),b.unref?.())}))}},w0=1,Dp=32,Gt=r=>r===null?"null":Array.isArray(r)?"array":r instanceof Uint8Array?"bytes":r instanceof Date?"date":typeof r,Sa=r=>{switch(r.kind){case"literal":return JSON.stringify(r.value);case"array":return`${Sa(r.items)}[]`;case"tuple":return`[${r.items.map(Sa).join(", ")}]`;case"union":return r.options.map(Sa).join(" | ");case"ref":return r.name;case"object":return"object";case"record":return`{ [key: string]: ${Sa(r.values)} }`;default:return r.kind}},Bp=r=>typeof r=="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof Uint8Array)&&!(r instanceof Date),tn=(r,n,a={},l="",u=0)=>{if(u>Dp)return`${l||"value"}: nested deeper than ${Dp} levels`;const f=l||"value";switch(n.kind){case"any":return;case"null":return r===null?void 0:`${f}: expected null, got ${Gt(r)}`;case"boolean":return typeof r=="boolean"?void 0:`${f}: expected boolean, got ${Gt(r)}`;case"number":return typeof r!="number"||Number.isNaN(r)?`${f}: expected number, got ${Gt(r)}`:n.integer&&!Number.isInteger(r)?`${f}: expected an integer, got ${r}`:n.min!==void 0&&r<n.min?`${f}: ${r} is below the minimum ${n.min}`:n.max!==void 0&&r>n.max?`${f}: ${r} is above the maximum ${n.max}`:void 0;case"string":return typeof r!="string"?`${f}: expected string, got ${Gt(r)}`:n.minLength!==void 0&&r.length<n.minLength?`${f}: shorter than ${n.minLength} characters`:n.maxLength!==void 0&&r.length>n.maxLength?`${f}: longer than ${n.maxLength} characters`:n.pattern!==void 0&&!new RegExp(n.pattern).test(r)?`${f}: does not match ${n.pattern}`:void 0;case"bytes":return r instanceof Uint8Array?n.maxBytes!==void 0&&r.length>n.maxBytes?`${f}: longer than ${n.maxBytes} bytes`:void 0:`${f}: expected bytes, got ${Gt(r)}`;case"date":return r instanceof Date&&!Number.isNaN(r.getTime())?void 0:`${f}: expected a date, got ${Gt(r)}`;case"literal":return r===n.value?void 0:`${f}: expected ${JSON.stringify(n.value)}`;case"array":{if(!Array.isArray(r))return`${f}: expected an array, got ${Gt(r)}`;if(n.maxItems!==void 0&&r.length>n.maxItems)return`${f}: more than ${n.maxItems} items`;for(let d=0;d<r.length;d++){const m=tn(r[d],n.items,a,`${f}[${d}]`,u+1);if(m)return m}return}case"tuple":{if(!Array.isArray(r))return`${f}: expected a tuple, got ${Gt(r)}`;if(r.length!==n.items.length)return`${f}: expected ${n.items.length} elements, got ${r.length}`;for(let d=0;d<n.items.length;d++){const m=tn(r[d],n.items[d],a,`${f}[${d}]`,u+1);if(m)return m}return}case"object":{if(!Bp(r))return`${f}: expected an object, got ${Gt(r)}`;const d=r;for(const[m,y]of Object.entries(n.fields)){if(!(d[m]!==void 0)){if(y.optional)continue;return`${f}.${m}: missing`}const R=tn(d[m],y.type,a,`${f}.${m}`,u+1);if(R)return R}if(!n.additional){const m=Object.keys(d).find(y=>!(y in n.fields));if(m!==void 0)return`${f}.${m}: not part of this type`}return}case"record":{if(!Bp(r))return`${f}: expected an object, got ${Gt(r)}`;const d=Object.keys(r);if(n.maxEntries!==void 0&&d.length>n.maxEntries)return`${f}: more than ${n.maxEntries} entries`;const m=n.keyPattern===void 0?void 0:new RegExp(n.keyPattern);for(const y of d){if(m&&!m.test(y))return`${f}.${y}: key does not match ${n.keyPattern}`;const b=tn(r[y],n.values,a,`${f}.${y}`,u+1);if(b)return b}return}case"union":{for(const d of n.options)if(!tn(r,d,a,f,u+1))return;return`${f}: expected ${Sa(n)}, got ${Gt(r)}`}case"ref":{const d=a[n.name];return d?tn(r,d,a,f,u+1):`${f}: unknown type '${n.name}'`}}return`${f}: unknown type kind '${n.kind}'`},S0=(r,n,a={})=>{const l=n.params.filter((u,f)=>!x0(n.params[f])).length;if(r.length<l)return`expected at least ${l} argument${l===1?"":"s"}, got ${r.length}`;if(r.length>n.params.length&&!n.rest)return`expected at most ${n.params.length} arguments, got ${r.length}`;for(let u=0;u<r.length;u++){const f=u<n.params.length?n.params[u]:n.rest,d=tn(r[u],f,a,`argument ${u}`);if(d)return d}},x0=r=>r.kind==="any"||r.kind==="union"&&r.options.some(n=>n.kind==="literal"&&n.value===null),Gc=(r,n)=>r.kind==="ref"?Gc(n?.[r.name]??{kind:"any"},n):r,qp=(r,n)=>!(n.integer&&!r.integer||n.min!==void 0&&(r.min===void 0||r.min<n.min)||n.max!==void 0&&(r.max===void 0||r.max>n.max)),Kt=(r,n,a={},l=0,u=new Set)=>{if(l>64)return!1;if(r.kind==="ref"&&n.kind==="ref"){const m=`${r.name} <: ${n.name}`;if(u.has(m))return!0;u.add(m)}const f=Gc(r,a),d=Gc(n,a);if(d.kind==="any")return!0;if(f.kind==="any")return!1;if(f.kind==="union")return f.options.every(m=>Kt(m,d,a,l+1,u));if(d.kind==="union")return d.options.some(m=>Kt(f,m,a,l+1,u));if(f.kind==="literal")return d.kind==="literal"?f.value===d.value:(f.value===null?"null":typeof f.value)!==d.kind?!1:d.kind==="number"&&typeof f.value=="number"?qp({min:f.value,max:f.value,integer:Number.isInteger(f.value)},d):!0;if(f.kind!==d.kind)return!1;switch(f.kind){case"null":case"boolean":case"date":return!0;case"number":return qp(f,d);case"string":{const m=d;return!(m.minLength!==void 0&&(f.minLength===void 0||f.minLength<m.minLength)||m.maxLength!==void 0&&(f.maxLength===void 0||f.maxLength>m.maxLength)||m.pattern!==void 0&&m.pattern!==f.pattern)}case"bytes":{const m=d;return m.maxBytes===void 0||f.maxBytes!==void 0&&f.maxBytes<=m.maxBytes}case"array":{const m=d;return m.maxItems!==void 0&&(f.maxItems===void 0||f.maxItems>m.maxItems)?!1:Kt(f.items,m.items,a,l+1,u)}case"tuple":{const m=d;return f.items.length!==m.items.length?!1:f.items.every((y,b)=>Kt(y,m.items[b],a,l+1,u))}case"record":{const m=d;return m.maxEntries!==void 0&&(f.maxEntries===void 0||f.maxEntries>m.maxEntries)||m.keyPattern!==void 0&&m.keyPattern!==f.keyPattern?!1:Kt(f.values,m.values,a,l+1,u)}case"object":{const m=d;for(const[y,b]of Object.entries(m.fields)){const R=f.fields[y];if(!R){if(b.optional)continue;return!1}if(!b.optional&&R.optional||!Kt(R.type,b.type,a,l+1,u))return!1}if(!m.additional){for(const y of Object.keys(f.fields))if(!(y in m.fields))return!1}return!0}default:return!1}},Zl=r=>r.params.filter(n=>!(n.kind==="any"||n.kind==="union"&&n.options.some(a=>a.kind==="literal"&&a.value===null))).length,E0=(r,n,a,l)=>{const u=[];!a.rest&&a.params.length<n.params.length&&u.push({where:r,reason:`takes at most ${a.params.length} arguments, but a caller may send ${n.params.length}`}),Zl(a)>Zl(n)&&u.push({where:r,reason:`requires ${Zl(a)} arguments, but a caller may send as few as ${Zl(n)}`});for(let m=0;m<n.params.length;m++){const y=m<a.params.length?a.params[m]:a.rest;y&&(Kt(n.params[m],y,l)||u.push({where:`${r} argument ${m}`,reason:"narrowed, so a value the caller may send is no longer accepted"}))}n.returns&&a.returns&&!Kt(a.returns,n.returns,l)&&u.push({where:`${r} return`,reason:"widened, so a value this contract may return is not one the caller expects"});const f=n.semantics,d=a.semantics;return f&&d&&Gl[d]>Gl[f]&&u.push({where:r,reason:`is now ${d} where the caller was told ${f}, so a retry the caller may already make is no longer safe`}),f&&!d&&Gl[f]<Gl["non-repeatable-command"]&&u.push({where:r,reason:`no longer declares that it is ${f}, so a caller relying on that promise has nothing to rely on`}),u},k0=(r,n,a={})=>{const l=[];for(const[u,f]of Object.entries(r.methods)){const d=n.methods[u];if(!d){l.push({where:u,reason:"no longer exists"});continue}l.push(...E0(u,f,d,a))}for(const[u,f]of Object.entries(r.events??{})){const d=n.events?.[u];if(!d){l.push({where:`event ${u}`,reason:"is no longer emitted, so a subscription to it would never fire"});continue}for(let m=0;m<d.params.length;m++){const y=f.params[m];if(!y){l.push({where:`event ${u} argument ${m}`,reason:"is emitted but the caller does not expect it"});continue}Kt(d.params[m],y,a)||l.push({where:`event ${u} argument ${m}`,reason:"widened, so a value this contract may emit is not one the caller expects"})}}for(const u of r.capabilities??[])n.capabilities?.includes(u)||l.push({where:`capability ${u}`,reason:"is no longer declared, so whatever found this peer by it will stop finding it"});return r.component&&(n.component?(Kt(n.component.props,r.component.props,a)||l.push({where:"component props",reason:"widened, so a snapshot this contract may serve is not one the observer expects"}),Kt(n.component.state,r.component.state,a)||l.push({where:"component state",reason:"widened, so a snapshot this contract may serve is not one the observer expects"})):l.push({where:"component",reason:"is no longer served, so an observer would wait forever for a snapshot"})),l},T0=(r,n,a,l)=>l.length?`${r}@${n} is not compatible with ${r}@${a??"current"}: `+l.map(u=>`${u.where} ${u.reason}`).join("; "):void 0;class _0{rpcServer;instance;event;target;instanceName;listener=(...n)=>{this.rpcServer.sendEvent(this.target,this.event,n,this.instanceName).catch(a=>this.rpcServer.emit("deliveryError",{target:this.target,event:this.event,path:this.instanceName,error:a}))};constructor(n,a,l,u,f){this.rpcServer=n,this.instance=a,this.event=l,this.target=u,this.instanceName=f}attach(){this.instance.on(this.event,this.listener)}detach(){this.instance.removeListener(this.event,this.listener)}}const Lp=(r,n,a)=>`${r}\0${n}\0${a}`,Hp=r=>r.type===Xe.CallInstanceMethod,A0=100,N0=new Set(["Unauthorized","Forbidden","InvalidParams","IncompatibleVersion","ClassNotFound","MethodNotFound","TransportError","Timeout","UnknownOutcome"]),O0=r=>{const n=r?.code;return typeof n=="string"&&N0.has(n)?n:"Exception"};class j0 extends bm{manageRpc=new R0;eventProxies=new Map;epoch=typeof globalThis.crypto?.randomUUID=="function"?globalThis.crypto.randomUUID().slice(0,8):et().slice(0,8);eventSequences=new Map;eventCounters=new Map;eventTracked=new Map;eventSequenceKey(n,a){return`${n}\0${a}`}trackEvent(n,a){if(a===_n)return;const l=this.eventSequenceKey(n,a);if(this.eventCounters.has(l))return;const u=this.manageRpc.exposedNameSpaceInstances[n];if(!(u instanceof Il))return;const f=()=>this.eventSequences.set(l,(this.eventSequences.get(l)??0)+1);this.eventCounters.set(l,f),this.eventSequences.set(l,this.eventSequences.get(l)??0),this.eventTracked.set(l,Date.now()),u.on(a,f)}eventTrackedSince(n,a){return this.eventTracked.get(this.eventSequenceKey(n,a))}trackDeclaredEvents(){for(const[n,a]of Object.entries(this.schema?.namespaces??{}))if(this.manageRpc.exposedNameSpaceInstances[n])for(const l of Object.keys(a.events??{}))this.trackEvent(n,l)}eventSequenceOf(n,a){return this.eventSequences.get(this.eventSequenceKey(n,a))}authorize;resolveIdentity;requireIdentity=!1;deduplicateRequests=!0;maxTrackedRequests=1e3;refuseExpiredCalls=!0;idempotency;schema;validation="described";hostTopology;hostContext;allowTopologyMutation=!1;validateResults=!1;unknownVersion="allow";compatibility=new Map;recentResponses=new Map;inFlightRequests=new Set;constructor(n,a){super(n,a),this.manageRpc.logger?.log("Information","RpcServerHandler {name} starting",{name:n})}async checkAccess(n,a,l){const u=this.resolveIdentity?.(a);if(this.requireIdentity&&!u)return"Unauthorized";if(!this.authorize)return;const f={identity:u,source:a,instanceName:n.path,method:n.method,params:n.params,subscription:l};try{return await this.authorize(f)?void 0:"Forbidden"}catch{return"Forbidden"}}checkParams(n){if(!this.schema||this.validation==="off")return;const a=this.schema.namespaces[n.path];if(!a)return this.validation==="required"?`${n.path} is not described by the schema`:void 0;if(a.validate===!1)return;const l=a.methods[n.method];if(!l)return this.validation==="required"?`${n.path}.${n.method} is not described by the schema`:void 0;const u=S0(n.params,l,this.schema.types);if(u)return a.version?`${u} (this server serves ${n.path}@${a.version})`:u}checkVersion(n){if(!this.schema||this.validation==="off"||!n.version)return;const a=this.schema.namespaces[n.path];if(!a||n.version===a.version)return;const l=`${n.path}@${n.version}`;if(this.compatibility.has(l))return this.compatibility.get(l);const u=a.history?.[n.version];let f;return u?f=T0(n.path,n.version,a.version,k0(u,a,this.schema.types)):f=this.unknownVersion==="reject"?`${n.path}@${n.version} is unknown to this server, which serves ${n.path}@${a.version??"an unversioned contract"}`:void 0,this.compatibility.set(l,f),f}async receive(n,a,l){this.manageRpc.logger?.log("Debug","RpcServerHandler {name} received message type {type} from {source} to {target}: {message}",{name:this.name,type:n.type,source:a,target:l,message:JSON.stringify(n)}),n.payload&&this.receivePayload(n.payload,a,l).catch(u=>this.emit("handlerError",{source:a,target:l,error:u}))}respond(n,a,l,u){if(this.deduplicateRequests)for(this.inFlightRequests.delete(n),this.recentResponses.set(n,l);this.recentResponses.size>this.maxTrackedRequests;){const f=this.recentResponses.keys().next();if(f.done)break;this.recentResponses.delete(f.value)}return this.sendPayload(l,u,this.name,a)}async receivePayload(n,a,l){try{await this.dispatch(n,a,l)}catch(u){await this.reportDispatchFailure(n,a,u)}}async reportDispatchFailure(n,a,l){this.emit("handlerError",{source:a,payload:n,error:l});const u=n.id;if(!(!Hp(n)||!u)){this.deduplicateRequests&&this.inFlightRequests.delete(u);try{await this.sendPayload({type:Xe.error,id:u,code:"Exception",error:Mc(l)},We.ErrorMessage,this.name,a)}catch{}}}async dispatch(n,a,l){const u=Date.now();if(Hp(n)){if(this.deduplicateRequests){const L=this.recentResponses.get(n.id);if(L){const K=L.code?We.ErrorMessage:We.ResponseMessage;await this.sendPayload(L,K,this.name,a);return}if(this.inFlightRequests.has(n.id))return;this.inFlightRequests.add(n.id)}const f=this.manageRpc.findNameSpaceMethodMap(n.path),d=f?.get(n.method);if(!d){const L=n.path,K=n.params[0],P=this.manageRpc.exposedNameSpaceInstances[L];if(n.method==="on"&&K===_n&&P&&!(P instanceof hs)){await this.sendError(n.id,a,"ClassNotFound",`${n.path} is not an observable component`);return}if(n.method==="on"&&P instanceof Il){const W=await this.checkAccess(n,a,!0);if(W){await this.sendError(n.id,a,W,`not permitted to subscribe to ${n.path}.${K}`);return}const z=Lp(L,K,a);let X=this.eventProxies.get(z),J="ok - already exists";X||(this.trackEvent(L,K),X=new _0(this,P,K,a,L),this.eventProxies.set(z,X),X.attach(),J="ok"),K===_n&&await this.sendEvent(a,_n,[eu(P)],L),await this.respond(n.id,a,{type:Xe.success,result:J,id:n.id},We.ResponseMessage)}else if((n.method==="off"||n.method==="removeListener")&&P instanceof Il){const W=Lp(L,K,a),z=this.eventProxies.get(W);z&&(z.detach(),this.eventProxies.delete(W)),await this.respond(n.id,a,{type:Xe.success,result:z?"ok":"ok - was not subscribed",id:n.id},We.ResponseMessage)}else if(n.path===Ea&&(n.method==="read"||n.method==="subscribe"||n.method==="unsubscribe")){if(!this.hostContext){await this.sendError(n.id,a,"ClassNotFound","this host serves no context");return}const W=await this.checkAccess(n,a,!1);if(W){await this.sendError(n.id,a,W,`not permitted to call ${n.path}.${n.method}`);return}const z=J=>Array.isArray(J)?J.map(String):[];let X;n.method==="read"?X=this.hostContext.snapshotFor(String(n.params[0]),z(n.params[1]),0,!0):n.method==="subscribe"?X=this.hostContext.subscribe(a,String(n.params[0]),String(n.params[1]),z(n.params[2])):(this.hostContext.unsubscribe(a,String(n.params[0])),X="ok"),await this.respond(n.id,a,{type:Xe.success,result:X,id:n.id},We.ResponseMessage)}else if((n.method==="$acquire"||n.method==="$release")&&P){if(!(P instanceof hs)){await this.sendError(n.id,a,"ClassNotFound",`${n.path} is not an observable component, so it has no authority to hold`);return}const W=await this.checkAccess(n,a,!1);if(W){await this.sendError(n.id,a,W,`not permitted to call ${n.path}.${n.method}`);return}if(n.method==="$acquire"){const z=n.params[0]??p0;if(typeof z!="number"||!Number.isFinite(z)||z<=0){await this.sendError(n.id,a,"InvalidParams","$acquire: the lease must expire, so its ttl is a positive number of milliseconds");return}const X=n.params[1]?.take===!0,J=m0(P,a,z,X);if(!J.granted){await this.sendError(n.id,a,"NotInControl",`${n.path} is controlled by ${J.holder} until ${new Date(J.expiresAt).toISOString()}`);return}await this.respond(n.id,a,{type:Xe.success,result:J.authority,id:n.id},We.ResponseMessage)}else{const z=y0(P,a);await this.respond(n.id,a,{type:Xe.success,result:z,id:n.id},We.ResponseMessage)}}else await this.sendError(n.id,a,f?"MethodNotFound":"ClassNotFound",`${n.path}.${n.method} is not exposed`);return}const m=await this.checkAccess(n,a,!1);if(m){await this.sendError(n.id,a,m,`not permitted to call ${n.path}.${n.method}`);return}const y=this.checkVersion(n);if(y){await this.sendError(n.id,a,"IncompatibleVersion",y);return}const b=this.checkParams(n);if(b){await this.sendError(n.id,a,"InvalidParams",b);return}const R=this.authorityRefusal(n,a);if(R){await this.sendError(n.id,a,"NotInControl",R);return}const w=this.fenceRefusal(n);if(w){await this.sendError(n.id,a,"OwnershipChanged",w);return}const j=this.executionKey(n,a);j===void 0?await this.invoke(n,a,u,d):await this.enqueue(j,n,a,u,d)}}async enqueue(n,a,l,u,f){const d=this.manageRpc.exposedConflation[a.path]?.has(a.method)?`${n}\0${a.method}`:void 0;let m=!1;if(d){const j=this.conflatable.get(d);j&&(j.supersede(),m=!0)}const y=this.executionWaiting.get(n)??0,b=this.manageRpc.exposedMailbox[a.path]??A0;if(!m&&y>=b){await this.sendError(a.id,l,"Busy",`${a.path}.${a.method} was not queued: ${y} calls are already waiting on this instance`);return}let R=!1;const w=d?{supersede:()=>{R=!0,this.sendError(a.id,l,"Superseded",`${a.path}.${a.method} was superseded by a newer call before it ran`).catch(()=>{})}}:void 0;d&&w&&this.conflatable.set(d,w),this.executionWaiting.set(n,y+1),await this.serialise(n,async()=>{const j=this.executionWaiting.get(n)??1;j<=1?this.executionWaiting.delete(n):this.executionWaiting.set(n,j-1),d&&this.conflatable.get(d)===w&&this.conflatable.delete(d),!R&&await this.invoke(a,l,u,f)})}executionWaiting=new Map;conflatable=new Map;async invoke(n,a,l,u){const f=this.expiredBy(n,l);if(f!==void 0){await this.sendError(n.id,a,"Timeout",`${n.path}.${n.method} was not run: its caller stopped waiting ${f} ms ago`);return}const d=this.authorityRefusal(n,a);if(d){await this.sendError(n.id,a,"NotInControl",d);return}const m=this.fenceRefusal(n);if(m){await this.sendError(n.id,a,"OwnershipChanged",m);return}const y=this.invocationFor(n,a);let b=!1;if(y){let j;try{j=await this.idempotency.begin(y)}catch(L){await this.sendError(n.id,a,"UnknownOutcome",`${n.path}.${n.method} was not run: its idempotency store could not be reached (${L instanceof Error?L.message:String(L)})`);return}if(j==="in-progress"){this.inFlightRequests.delete(n.id);return}if(j!=="acquired"){const L=Iv(j)?{type:Xe.error,id:n.id,code:j.code,error:j.error}:{type:Xe.success,id:n.id,result:j.result};await this.respond(n.id,a,L,L.type===Xe.error?We.ErrorMessage:We.ResponseMessage);return}b=!0}const R=[...n.params];if(this.manageRpc.exposedInjection[n.path]?.has(n.method)){for(;R.length<u.length-1;)R.push(void 0);const j=Object.freeze({[l0]:!0,context:Object.freeze({requestId:n.id,source:a,...this.resolveIdentity?.(a)?{identity:this.resolveIdentity(a)}:{},...n.ttl!==void 0?{ttl:n.ttl}:{},...n.idempotencyKey?{idempotencyKey:n.idempotencyKey}:{}})});R.push(j)}let w;try{w=await u(...R);const j=this.checkResult(n,w);if(j){await this.settle(y,b,{code:"InvalidParams",error:{name:"RpcError",message:j}}),await this.sendError(n.id,a,"InvalidParams",j);return}await this.settle(y,b,{result:w}),await this.respond(n.id,a,{type:Xe.success,id:n.id,result:w},We.ResponseMessage)}catch(j){const L=O0(j);await this.settle(y,b,{code:L,error:Mc(j)}),await this.respond(n.id,a,{type:Xe.error,id:n.id,code:L,error:Mc(j)},We.ErrorMessage)}}async settle(n,a,l){if(!(!n||!a))try{await this.idempotency.complete(n,l)}catch(u){this.emit("idempotencyError",{invocation:n,outcome:l,error:u})}}invocationFor(n,a){if(!(!this.idempotency||this.semanticsOf(n)!=="non-repeatable-command"))return{idempotencyKey:n.idempotencyKey??n.id,requestId:n.id,scope:`${n.path}.${n.method}`,source:a,...n.ttl!==void 0?{ttl:n.ttl}:{}}}authorityRefusal(n,a){if(!this.manageRpc.exposedAuthority[n.path]?.has(n.method))return;const l=this.manageRpc.exposedNameSpaceInstances[n.path];if(!(l instanceof hs))return;const u=d0(l),f=u.holder!==void 0&&(u.expiresAt??0)>Date.now();if(!(f&&u.holder===a))return f?`${n.path}.${n.method} requires authority: ${u.holder} is in control`:`${n.path}.${n.method} requires authority: nobody is in control - $acquire it first`}fenceRefusal(n){const a=n.fence;if(!a)return;const l=this.hostTopology?.get(n.path);if(!l)return`${n.path} has no topology record here to check the owner fence against`;if(l.ownerEpoch!==a.ownerEpoch)return`${n.path} changed owner generation while this call was on its way - read the topology again and decide again`}semanticsOf(n){return this.manageRpc.exposedSemantics[n.path]?.get(n.method)??this.schema?.namespaces[n.path]?.methods[n.method]?.semantics}executionKey(n,a){const l=this.manageRpc.exposedExecution[n.path];if(!l){const f=this.semanticsOf(n);return f==="idempotent-command"||f==="non-repeatable-command"?n.path:void 0}if(l==="parallel")return;if(l==="serial")return n.path;const u={identity:this.resolveIdentity?.(a),source:a,instanceName:n.path,method:n.method,params:n.params,subscription:!1};try{return`${n.path}\0${l(u)}`}catch{return n.path}}executionQueues=new Map;async serialise(n,a){const l=this.executionQueues.get(n)??Promise.resolve();let u;const f=new Promise(m=>u=m),d=l.then(()=>f);this.executionQueues.set(n,d),await l;try{return await a()}finally{u(),this.executionQueues.get(n)===d&&this.executionQueues.delete(n)}}expiredBy(n,a){if(!this.refuseExpiredCalls||n.ttl===void 0||!Number.isFinite(n.ttl)||n.ttl<0)return;const l=Date.now()-(a+n.ttl);return l>0?l:void 0}checkResult(n,a){if(!this.validateResults||!this.schema)return;const l=this.schema.namespaces[n.path]?.methods[n.method]?.returns;if(!l)return;const u=tn(a,l,this.schema.types,"result");return u?`${n.path}.${n.method} returned a value its own schema forbids: ${u}`:void 0}sendError(n,a,l,u){return this.respond(n,a,{type:Xe.error,id:n,code:l,error:{name:"RpcError",message:u}},We.ErrorMessage)}removePeer(n){for(const[a,l]of this.eventProxies)l.target===n&&(l.detach(),this.eventProxies.delete(a))}async sendEvent(n,a,l,u){const f=u?this.eventSequenceOf(u,a):void 0;return await this.sendPayload({type:Xe.event,event:a,params:l,path:u,...f!==void 0?{seq:f,epoch:this.epoch}:{}},We.EventMessage,this.name,n)}}class R0{logger;exposedNameSpaceMethodMaps={};exposedNameSpaceInstances={};exposedClasses={};createdInstances=new Map;exposedSemantics={};exposedExecution={};exposedConflation={};exposedAuthority={};exposedInjection={};exposedMailbox={};componentContractFor;constructor(n){this.logger=n}exposeManagement(){this.getNameSpaceMethodMap("manageRpc").set("createRpcInstance",(...a)=>this.createRpcInstance(a[0],a[1],...a.slice(2))),this.exposedNameSpaceInstances.manageRpc=this}getNameSpaceMethodMap(n){let a=this.exposedNameSpaceMethodMaps[n];return a||(a=new Map,this.exposedNameSpaceMethodMaps[n]=a),a}findNameSpaceMethodMap(n){return this.exposedNameSpaceMethodMaps[n]}requireExplicitExposure=!1;exposeClassInstance(n,a,l){const u=e0(n),f=a??u?.name;if(!f)throw new Error(`exposeClassInstance: ${n.constructor.name} declares no @rpcNamespace, so a name is required`);const d=typeof l=="number"?{prototypeSteps:l}:l??{};let m=d.prototypeSteps;const y=t0(n);if(!y&&this.requireExplicitExposure)throw new Error(`exposeClassInstance: ${n.constructor.name} marks no @rpc methods and requireExplicitExposure is on`);this.exposedNameSpaceInstances[f]=n;const b=d.execution??u?.execution;b&&(this.exposedExecution[f]=b);const R=n0(n);R.size&&(this.exposedSemantics[f]=R);const w=i0(n);if(w.size){for(const X of w)if(R.get(X)!=="idempotent-command")throw new Error(`exposeClassInstance: ${f}.${X} declares conflate without 'idempotent-command' semantics - only a command that is free to repeat is free to skip`);this.exposedConflation[f]=w}const j=s0(n);if(j.size){if(!(n instanceof hs))throw new Error(`exposeClassInstance: ${f}.${[...j][0]} declares requiresAuthority, but ${n.constructor.name} is not an RpcComponent - there is no authority to check against`);this.exposedAuthority[f]=j}const L=a0(n);L.size&&(this.exposedInjection[f]=L);const K=d.mailbox??u?.mailbox;if(K!==void 0){if(!Number.isInteger(K)||K<1)throw new Error(`exposeClassInstance: ${f} declares a mailbox of ${K}; the bound is a positive count of waiting calls`);this.exposedMailbox[f]=K}if(n instanceof hs){const X=this.componentContractFor?.(f);X&&v0(n,(J,N)=>tn(J,X.component.props,X.types,"props")??tn(N,X.component.state,X.types,"state")),b0(n,d.component??{},()=>{n.emit(_n,eu(n))},this.logger)}let P=Object.getOwnPropertyNames(n.constructor.prototype),W=Object.getPrototypeOf(n.constructor.prototype);for(;W&&W.constructor.name!=="Object"&&W.constructor.name!=="EventEmitter";){const X=Object.getOwnPropertyNames(W);if(P=P.concat(X),W=Object.getPrototypeOf(W),m&&m--===0)break}const z=this.getNameSpaceMethodMap(f);for(const X of P)X==="constructor"||typeof n[X]!="function"||y&&!y.has(X)||z.set(X,n[X].bind(n))}exposeClass(n,a){let l=n.name;a&&(l=a),this.exposedClasses[l]=n}exposeObject(n,a){this.exposedNameSpaceInstances[a]=n;const l=Object.getOwnPropertyNames(n);for(const u of l)u!=="constructor"&&typeof n[u]=="function"&&this.getNameSpaceMethodMap(a).set(u,n[u])}expose(n,a){this.getNameSpaceMethodMap(n).set(n,a)}async createRpcInstance(n,a,...l){let u="";const f=this.exposedClasses[n];if(f){const d=a||et(),m=new f(...l);this.createdInstances.set(d,m),this.exposeClassInstance(m,d),u=d}return u}}const _m=1e4,Pl=(r,n,a)=>`${r}\0${n}\0${a}`;class ma extends Error{code;remoteStack;constructor(n,a,l){super(a?`${n}: ${a}`:n),this.code=n,this.remoteStack=l,this.name="RpcError"}}function z0(r){return r.type===Xe.success}function M0(r){return r.type===Xe.event}function C0(r){return r.type===Xe.error}class U0 extends bm{callTimeout;responsePromiseMap=new Map;responseTimeoutMap=new Map;schemaVersions;subscriptions=new Map;eventEmitter=new ei.EventEmitter;constructor(n,a,l=_m){super(n,a),this.callTimeout=l}async receive(n,a,l){const u=n.payload;if(u){if(M0(u)){this.deliverEvent(u,a);return}if(z0(u)){this.takePending(u.id)?.resolve(u.result);return}C0(u)&&this.takePending(u.id)?.reject(new ma(u.code,u.error?.message,u.error?.stack))}}lastDeliveredStamp;deliverEvent(n,a){this.lastDeliveredStamp=n.seq!==void 0&&n.epoch?{peer:a??"",...n.path?{namespace:n.path}:{},event:n.event,seq:n.seq,epoch:n.epoch}:void 0;const l=this.eventEmitter;if(l instanceof ei.EventEmitter){const u=a??"",f=n.path?[Pl(u,n.path,n.event),Pl("",n.path,n.event)]:l.eventNames().filter(d=>typeof d=="string").filter(d=>{const[m,,y]=d.split("\0");return y===n.event&&(m===u||m==="")});for(const d of new Set(f))this.deliverSafely(()=>l.emit(d,...n.params),n)}this.deliverSafely(()=>this.emit(n.event,n.params),n)}deliverSafely(n,a){try{n()}catch(l){this.emit("subscriberError",{event:a.event,path:a.path,error:l})}}async resubscribe(){const n=[...this.subscriptions.values()],a=await Promise.allSettled(n.map(u=>this.call(u.remote,u.instanceName,"on",u.event))),l=a.flatMap((u,f)=>u.status==="rejected"?[{peer:n[f].remote,namespace:n[f].instanceName,event:n[f].event,error:u.reason}]:[]);return l.length&&this.emit("resubscribeFailed",l),a.length-l.length}failPendingCalls(n){for(const a of[...this.responsePromiseMap.keys()]){const l=this.sentRequests.has(a);this.sentRequests.delete(a),this.takePending(a)?.reject(l?new ma("UnknownOutcome",`${n}, after the request was sent - it may or may not have run`):new ma("TransportError",`${n}, before the request was sent`))}}sentRequests=new Set;takePending(n){if(n===void 0)return;const a=this.responsePromiseMap.get(n);this.responsePromiseMap.delete(n),this.sentRequests.delete(n);const l=this.responseTimeoutMap.get(n);return l!==void 0&&(clearTimeout(l),this.responseTimeoutMap.delete(n)),a}call(n,a,l,...u){return this.callWith({},n,a,l,...u)}callWith(n,a,l,u,...f){const d=n.timeoutMs??this.callTimeout;if(!Number.isInteger(d)||d<0)return Promise.reject(new Error(`${l}.${u}: timeoutMs must be a finite non-negative integer, not ${String(n.timeoutMs)}`));const m={id:et(),type:Xe.CallInstanceMethod,path:l,method:u,params:f,version:this.schemaVersions?.[l],ttl:d>0?d:void 0,...n.idempotencyKey?{idempotencyKey:n.idempotencyKey}:{},...n.ownerEpoch?{fence:{ownerEpoch:n.ownerEpoch}}:{}};return new Promise((y,b)=>{this.responsePromiseMap.set(m.id,{resolve:y,reject:b}),d>0&&this.responseTimeoutMap.set(m.id,setTimeout(()=>{this.takePending(m.id)?.reject(new ma("Timeout",`no response to ${l}.${u} within ${d} ms`))},d)),this.sendPayload(m,We.RequestMessage,this.name,a).then(()=>{this.responsePromiseMap.has(m.id)&&this.sentRequests.add(m.id)},R=>{this.takePending(m.id)?.reject(new ma("TransportError",R instanceof Error?R.message:String(R)))})})}proxy(n,a,l={}){const u={};return new Proxy(u,{get:(f,d)=>{let m;if(typeof d=="string"){if(f[d])return f[d];if(d==="then")return;d==="$with"?f[d]=y=>this.proxy(n,a,{...l,...y}):Wv(d)?f[d]=(...y)=>{const b=y[0];if(typeof b=="string"){const R=Pl(a??"",n,b);if(this.eventEmitter[d](R,...y.slice(1)),d==="on")this.subscriptions.set(R,{remote:a,instanceName:n,event:b});else if(d==="off"||d==="removeListener"){if(this.eventEmitter.listenerCount(R)>0)return Promise.resolve("ok - other local handlers remain");this.subscriptions.delete(R)}}else this.eventEmitter[d](...y);return this.call(a,n,d,y[0])}:f[d]=(...y)=>this.callWith(l,a,n,d,...y),m=f[d]}return m}})}}const Am=Symbol("@source-repo/rpc/component");class D0{namespace;target;release;view={epoch:"",revision:-1,props:Object.freeze({}),state:Object.freeze({}),status:"initializing",receivedAt:0};users=0;inner;store;first;listeners=new Set;retired=new Set;settleFirst;handler=n=>this.accept(n);constructor(n,a,l,u){this.namespace=a,this.target=l,this.release=u,this.inner=n.proxy(a,l),this.first=new Promise(f=>this.settleFirst=f),this.store={getSnapshot:()=>this.view,subscribe:f=>(this.listeners.add(f),()=>this.listeners.delete(f)),close:()=>this.close()}}async open(){await this.inner.on(_n,this.handler),await this.first}accept(n){this.view.status!=="closed"&&(this.retired.has(n.epoch)||this.view.epoch===n.epoch&&n.revision<=this.view.revision||(this.view.epoch&&this.view.epoch!==n.epoch&&this.retired.add(this.view.epoch),this.view={...n,status:"live",receivedAt:Date.now()},this.settleFirst(),this.notify()))}markStale(){this.view.status==="live"&&(this.view={...this.view,status:"stale",staleSince:Date.now()},this.notify())}async close(){this.users>0&&this.users--,!(this.users>0)&&(this.view={...this.view,status:"closed"},this.notify(),this.release(),await this.inner.off(_n,this.handler).catch(()=>{}))}markClosed(){this.view.status!=="closed"&&(this.view={...this.view,status:"closed"},this.notify())}notify(){for(const n of[...this.listeners])try{n()}catch{}}}class B0{handler;channels=new Map;constructor(n,a){this.handler=n,a.on(_e.disconnected,()=>{for(const l of this.channels.values())l.markStale()});for(const l of[_e.peerGone,_e.peerDisplaced])a.on(l,u=>{for(const f of this.channels.values())f.target===u&&f.markStale()})}async open(n,a){const l=`${a??""}\0${n}`;let u=this.channels.get(l);if(u)await u.first;else{u=new D0(this.handler,n,a,()=>{this.channels.delete(l)}),this.channels.set(l,u);try{await u.open()}catch(f){throw this.channels.delete(l),f}}return u.users++,u}closeAll(){for(const n of this.channels.values())n.markClosed();this.channels.clear()}}const Nm=(r,n)=>new Proxy(n,{get:(a,l)=>l==="props"?r.view.props:l==="state"?r.view.state:l===Am?r.store:l==="$with"?u=>Nm(r,n.$with(u)):a[l],set:(a,l,u)=>{if(l==="props"||l==="state")throw new TypeError(`${String(l)} is read-only on a component proxy - call a method to change the world`);return a[l]=u,!0}}),ln=Object.create(null);ln.open="0";ln.close="1";ln.ping="2";ln.pong="3";ln.message="4";ln.upgrade="5";ln.noop="6";const er=Object.create(null);Object.keys(ln).forEach(r=>{er[ln[r]]=r});const Qc={type:"error",data:"parser error"},Om=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",jm=typeof ArrayBuffer=="function",Rm=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,nu=({type:r,data:n},a,l)=>Om&&n instanceof Blob?a?l(n):$p(n,l):jm&&(n instanceof ArrayBuffer||Rm(n))?a?l(n):$p(new Blob([n]),l):l(ln[r]+(n||"")),$p=(r,n)=>{const a=new FileReader;return a.onload=function(){const l=a.result.split(",")[1];n("b"+(l||""))},a.readAsDataURL(r)};function Yp(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let Uc;function q0(r,n){if(Om&&r.data instanceof Blob)return r.data.arrayBuffer().then(Yp).then(n);if(jm&&(r.data instanceof ArrayBuffer||Rm(r.data)))return n(Yp(r.data));nu(r,!1,a=>{Uc||(Uc=new TextEncoder),n(Uc.encode(a))})}const Vp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<Vp.length;r++)xa[Vp.charCodeAt(r)]=r;const L0=r=>{let n=r.length*.75,a=r.length,l,u=0,f,d,m,y;r[r.length-1]==="="&&(n--,r[r.length-2]==="="&&n--);const b=new ArrayBuffer(n),R=new Uint8Array(b);for(l=0;l<a;l+=4)f=xa[r.charCodeAt(l)],d=xa[r.charCodeAt(l+1)],m=xa[r.charCodeAt(l+2)],y=xa[r.charCodeAt(l+3)],R[u++]=f<<2|d>>4,R[u++]=(d&15)<<4|m>>2,R[u++]=(m&3)<<6|y&63;return b},H0=typeof ArrayBuffer=="function",iu=(r,n)=>{if(typeof r!="string")return{type:"message",data:zm(r,n)};const a=r.charAt(0);return a==="b"?{type:"message",data:$0(r.substring(1),n)}:er[a]?r.length>1?{type:er[a],data:r.substring(1)}:{type:er[a]}:Qc},$0=(r,n)=>{if(H0){const a=L0(r);return zm(a,n)}else return{base64:!0,data:r}},zm=(r,n)=>n==="blob"?r instanceof Blob?r:new Blob([r]):r instanceof ArrayBuffer?r:r.buffer,Mm="",Y0=(r,n)=>{const a=r.length,l=new Array(a);let u=0;r.forEach((f,d)=>{nu(f,!1,m=>{l[d]=m,++u===a&&n(l.join(Mm))})})},V0=(r,n)=>{const a=r.split(Mm),l=[];for(let u=0;u<a.length;u++){const f=iu(a[u],n);if(l.push(f),f.type==="error")break}return l};function X0(){return new TransformStream({transform(r,n){q0(r,a=>{const l=a.length;let u;if(l<126)u=new Uint8Array(1),new DataView(u.buffer).setUint8(0,l);else if(l<65536){u=new Uint8Array(3);const f=new DataView(u.buffer);f.setUint8(0,126),f.setUint16(1,l)}else{u=new Uint8Array(9);const f=new DataView(u.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(l))}r.data&&typeof r.data!="string"&&(u[0]|=128),n.enqueue(u),n.enqueue(a)})}})}let Dc;function Jl(r){return r.reduce((n,a)=>n+a.length,0)}function Fl(r,n){if(r[0].length===n)return r.shift();const a=new Uint8Array(n);let l=0;for(let u=0;u<n;u++)a[u]=r[0][l++],l===r[0].length&&(r.shift(),l=0);return r.length&&l<r[0].length&&(r[0]=r[0].slice(l)),a}function G0(r,n){Dc||(Dc=new TextDecoder);const a=[];let l=0,u=-1,f=!1;return new TransformStream({transform(d,m){for(a.push(d);;){if(l===0){if(Jl(a)<1)break;const y=Fl(a,1);f=(y[0]&128)===128,u=y[0]&127,u<126?l=3:u===126?l=1:l=2}else if(l===1){if(Jl(a)<2)break;const y=Fl(a,2);u=new DataView(y.buffer,y.byteOffset,y.length).getUint16(0),l=3}else if(l===2){if(Jl(a)<8)break;const y=Fl(a,8),b=new DataView(y.buffer,y.byteOffset,y.length),R=b.getUint32(0);if(R>Math.pow(2,21)-1){m.enqueue(Qc);break}u=R*Math.pow(2,32)+b.getUint32(4),l=3}else{if(Jl(a)<u)break;const y=Fl(a,u);m.enqueue(iu(f?y:Dc.decode(y),n)),l=0}if(u===0||u>r){m.enqueue(Qc);break}}}})}const Cm=4;function Ie(r){if(r)return Q0(r)}function Q0(r){for(var n in Ie.prototype)r[n]=Ie.prototype[n];return r}Ie.prototype.on=Ie.prototype.addEventListener=function(r,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(n),this};Ie.prototype.once=function(r,n){function a(){this.off(r,a),n.apply(this,arguments)}return a.fn=n,this.on(r,a),this};Ie.prototype.off=Ie.prototype.removeListener=Ie.prototype.removeAllListeners=Ie.prototype.removeEventListener=function(r,n){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var a=this._callbacks["$"+r];if(!a)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var l,u=0;u<a.length;u++)if(l=a[u],l===n||l.fn===n){a.splice(u,1);break}return a.length===0&&delete this._callbacks["$"+r],this};Ie.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var n=new Array(arguments.length-1),a=this._callbacks["$"+r],l=1;l<arguments.length;l++)n[l-1]=arguments[l];if(a){a=a.slice(0);for(var l=0,u=a.length;l<u;++l)a[l].apply(this,n)}return this};Ie.prototype.emitReserved=Ie.prototype.emit;Ie.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};Ie.prototype.hasListeners=function(r){return!!this.listeners(r).length};const or=typeof Promise=="function"&&typeof Promise.resolve=="function"?n=>Promise.resolve().then(n):(n,a)=>a(n,0),$t=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),K0="arraybuffer";function Um(r,...n){return n.reduce((a,l)=>(r.hasOwnProperty(l)&&(a[l]=r[l]),a),{})}const Z0=$t.setTimeout,J0=$t.clearTimeout;function cr(r,n){n.useNativeTimers?(r.setTimeoutFn=Z0.bind($t),r.clearTimeoutFn=J0.bind($t)):(r.setTimeoutFn=$t.setTimeout.bind($t),r.clearTimeoutFn=$t.clearTimeout.bind($t))}const F0=1.33;function W0(r){return typeof r=="string"?I0(r):Math.ceil((r.byteLength||r.size)*F0)}function I0(r){let n=0,a=0;for(let l=0,u=r.length;l<u;l++)n=r.charCodeAt(l),n<128?a+=1:n<2048?a+=2:n<55296||n>=57344?a+=3:(l++,a+=4);return a}function Dm(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function P0(r){let n="";for(let a in r)r.hasOwnProperty(a)&&(n.length&&(n+="&"),n+=encodeURIComponent(a)+"="+encodeURIComponent(r[a]));return n}function eb(r){let n={},a=r.split("&");for(let l=0,u=a.length;l<u;l++){let f=a[l].split("=");n[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return n}class tb extends Error{constructor(n,a,l){super(n),this.description=a,this.context=l,this.type="TransportError"}}class su extends Ie{constructor(n){super(),this.writable=!1,cr(this,n),this.opts=n,this.query=n.query,this.socket=n.socket,this.supportsBinary=!n.forceBase64}onError(n,a,l){return super.emitReserved("error",new tb(n,a,l)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(n){this.readyState==="open"&&this.write(n)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(n){const a=iu(n,this.socket.binaryType);this.onPacket(a)}onPacket(n){super.emitReserved("packet",n)}onClose(n){this.readyState="closed",super.emitReserved("close",n)}pause(n){}createUri(n,a={}){return n+"://"+this._hostname()+this._port()+this.opts.path+this._query(a)}_hostname(){const n=this.opts.hostname;return n.indexOf(":")===-1?n:"["+n+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(n){const a=P0(n);return a.length?"?"+a:""}}class nb extends su{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(n){this.readyState="pausing";const a=()=>{this.readyState="paused",n()};if(this._polling||!this.writable){let l=0;this._polling&&(l++,this.once("pollComplete",function(){--l||a()})),this.writable||(l++,this.once("drain",function(){--l||a()}))}else a()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(n){const a=l=>{if(this.readyState==="opening"&&l.type==="open"&&this.onOpen(),l.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(l)};V0(n,this.socket.binaryType).forEach(a),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const n=()=>{this.write([{type:"close"}])};this.readyState==="open"?n():this.once("open",n)}write(n){this.writable=!1,Y0(n,a=>{this.doWrite(a,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const n=this.opts.secure?"https":"http",a=this.query||{};return this.opts.timestampRequests!==!1&&(a[this.opts.timestampParam]=Dm()),!this.supportsBinary&&!a.sid&&(a.b64=1),this.createUri(n,a)}}let Bm=!1;try{Bm=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const ib=Bm;function sb(){}class ab extends nb{constructor(n){if(super(n),typeof location<"u"){const a=location.protocol==="https:";let l=location.port;l||(l=a?"443":"80"),this.xd=typeof location<"u"&&n.hostname!==location.hostname||l!==n.port}}doWrite(n,a){const l=this.request({method:"POST",data:n});l.on("success",a),l.on("error",(u,f)=>{this.onError("xhr post error",u,f)})}doPoll(){const n=this.request();n.on("data",this.onData.bind(this)),n.on("error",(a,l)=>{this.onError("xhr poll error",a,l)}),this.pollXhr=n}}class an extends Ie{constructor(n,a,l){super(),this.createRequest=n,cr(this,l),this._opts=l,this._method=l.method||"GET",this._uri=a,this._data=l.data!==void 0?l.data:null,this._create()}_create(){var n;const a=Um(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");a.xdomain=!!this._opts.xd;const l=this._xhr=this.createRequest(a);try{l.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){l.setDisableHeaderCheck&&l.setDisableHeaderCheck(!0);for(let u in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(u)&&l.setRequestHeader(u,this._opts.extraHeaders[u])}}catch{}if(this._method==="POST")try{l.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{l.setRequestHeader("Accept","*/*")}catch{}(n=this._opts.cookieJar)===null||n===void 0||n.addCookies(l),"withCredentials"in l&&(l.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(l.timeout=this._opts.requestTimeout),l.onreadystatechange=()=>{var u;l.readyState===3&&((u=this._opts.cookieJar)===null||u===void 0||u.parseCookies(l.getResponseHeader("set-cookie"))),l.readyState===4&&(l.status===200||l.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof l.status=="number"?l.status:0)},0))},l.send(this._data)}catch(u){this.setTimeoutFn(()=>{this._onError(u)},0);return}typeof document<"u"&&(this._index=an.requestsCount++,an.requests[this._index]=this)}_onError(n){this.emitReserved("error",n,this._xhr),this._cleanup(!0)}_cleanup(n){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=sb,n)try{this._xhr.abort()}catch{}typeof document<"u"&&delete an.requests[this._index],this._xhr=null}}_onLoad(){const n=this._xhr.responseText;n!==null&&(this.emitReserved("data",n),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}an.requestsCount=0;an.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Xp);else if(typeof addEventListener=="function"){const r="onpagehide"in $t?"pagehide":"unload";addEventListener(r,Xp,!1)}}function Xp(){for(let r in an.requests)an.requests.hasOwnProperty(r)&&an.requests[r].abort()}const lb=(function(){const r=qm({xdomain:!1});return r&&r.responseType!==null})();class rb extends ab{constructor(n){super(n);const a=n&&n.forceBase64;this.supportsBinary=lb&&!a}request(n={}){return Object.assign(n,{xd:this.xd},this.opts),new an(qm,this.uri(),n)}}function qm(r){const n=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!n||ib))return new XMLHttpRequest}catch{}if(!n)try{return new $t[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Lm=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ob extends su{get name(){return"websocket"}doOpen(){const n=this.uri(),a=this.opts.protocols,l=Lm?{}:Um(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(l.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(n,a,l)}catch(u){return this.emitReserved("error",u)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=n=>this.onClose({description:"websocket connection closed",context:n}),this.ws.onmessage=n=>this.onData(n.data),this.ws.onerror=n=>this.onError("websocket error",n)}write(n){this.writable=!1;for(let a=0;a<n.length;a++){const l=n[a],u=a===n.length-1;nu(l,this.supportsBinary,f=>{try{this.doWrite(l,f)}catch{}u&&or(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const n=this.opts.secure?"wss":"ws",a=this.query||{};return this.opts.timestampRequests&&(a[this.opts.timestampParam]=Dm()),this.supportsBinary||(a.b64=1),this.createUri(n,a)}}const Bc=$t.WebSocket||$t.MozWebSocket;class cb extends ob{createSocket(n,a,l){return Lm?new Bc(n,a,l):a?new Bc(n,a):new Bc(n)}doWrite(n,a){this.ws.send(a)}}class ub extends su{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(n){return this.emitReserved("error",n)}this._transport.closed.then(()=>{this.onClose()}).catch(n=>{this.onError("webtransport error",n)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(n=>{const a=G0(Number.MAX_SAFE_INTEGER,this.socket.binaryType),l=n.readable.pipeThrough(a).getReader(),u=X0();u.readable.pipeTo(n.writable),this._writer=u.writable.getWriter();const f=()=>{l.read().then(({done:m,value:y})=>{m||(this.onPacket(y),f())}).catch(m=>{})};f();const d={type:"open"};this.query.sid&&(d.data=`{"sid":"${this.query.sid}"}`),this._writer.write(d).then(()=>this.onOpen())})})}write(n){this.writable=!1;for(let a=0;a<n.length;a++){const l=n[a],u=a===n.length-1;this._writer.write(l).then(()=>{u&&or(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var n;(n=this._transport)===null||n===void 0||n.close()}}const fb={websocket:cb,webtransport:ub,polling:rb},hb=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,db=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Kc(r){if(r.length>8e3)throw"URI too long";const n=r,a=r.indexOf("["),l=r.indexOf("]");a!=-1&&l!=-1&&(r=r.substring(0,a)+r.substring(a,l).replace(/:/g,";")+r.substring(l,r.length));let u=hb.exec(r||""),f={},d=14;for(;d--;)f[db[d]]=u[d]||"";return a!=-1&&l!=-1&&(f.source=n,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=pb(f,f.path),f.queryKey=mb(f,f.query),f}function pb(r,n){const a=/\/{2,9}/g,l=n.replace(a,"/").split("/");return(n.slice(0,1)=="/"||n.length===0)&&l.splice(0,1),n.slice(-1)=="/"&&l.splice(l.length-1,1),l}function mb(r,n){const a={};return n.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(l,u,f){u&&(a[u]=f)}),a}const Zc=typeof addEventListener=="function"&&typeof removeEventListener=="function",tr=[];Zc&&addEventListener("offline",()=>{tr.forEach(r=>r())},!1);class Pn extends Ie{constructor(n,a){if(super(),this.binaryType=K0,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,n&&typeof n=="object"&&(a=n,n=null),n){const l=Kc(n);a.hostname=l.host,a.secure=l.protocol==="https"||l.protocol==="wss",a.port=l.port,l.query&&(a.query=l.query)}else a.host&&(a.hostname=Kc(a.host).host);cr(this,a),this.secure=a.secure!=null?a.secure:typeof location<"u"&&location.protocol==="https:",a.hostname&&!a.port&&(a.port=this.secure?"443":"80"),this.hostname=a.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=a.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},a.transports.forEach(l=>{const u=l.prototype.name;this.transports.push(u),this._transportsByName[u]=l}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},a),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=eb(this.opts.query)),Zc&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},tr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(n){const a=Object.assign({},this.opts.query);a.EIO=Cm,a.transport=n,this.id&&(a.sid=this.id);const l=Object.assign({},this.opts,{query:a,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[n]);return new this._transportsByName[n](l)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const n=this.opts.rememberUpgrade&&Pn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const a=this.createTransport(n);a.open(),this.setTransport(a)}setTransport(n){this.transport&&this.transport.removeAllListeners(),this.transport=n,n.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",a=>this._onClose("transport close",a))}onOpen(){this.readyState="open",Pn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",n),this.emitReserved("heartbeat"),n.type){case"open":this.onHandshake(JSON.parse(n.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const a=new Error("server error");a.code=n.data,this._onError(a);break;case"message":this.emitReserved("data",n.data),this.emitReserved("message",n.data);break}}onHandshake(n){this.emitReserved("handshake",n),this.id=n.sid,this.transport.query.sid=n.sid,this._pingInterval=n.pingInterval,this._pingTimeout=n.pingTimeout,this._maxPayload=n.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const n=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+n,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},n),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const n=this._getWritablePackets();this.transport.send(n),this._prevBufferLen=n.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let a=1;for(let l=0;l<this.writeBuffer.length;l++){const u=this.writeBuffer[l].data;if(u&&(a+=W0(u)),l>0&&a>this._maxPayload)return this.writeBuffer.slice(0,l);a+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const n=Date.now()>this._pingTimeoutTime;return n&&(this._pingTimeoutTime=0,or(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),n}write(n,a,l){return this._sendPacket("message",n,a,l),this}send(n,a,l){return this._sendPacket("message",n,a,l),this}_sendPacket(n,a,l,u){if(typeof a=="function"&&(u=a,a=void 0),typeof l=="function"&&(u=l,l=null),this.readyState==="closing"||this.readyState==="closed")return;l=l||{},l.compress=l.compress!==!1;const f={type:n,data:a,options:l};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),u&&this.once("flush",u),this.flush()}close(){const n=()=>{this._onClose("forced close"),this.transport.close()},a=()=>{this.off("upgrade",a),this.off("upgradeError",a),n()},l=()=>{this.once("upgrade",a),this.once("upgradeError",a)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?l():n()}):this.upgrading?l():n()),this}_onError(n){if(Pn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",n),this._onClose("transport error",n)}_onClose(n,a){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Zc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const l=tr.indexOf(this._offlineEventListener);l!==-1&&tr.splice(l,1)}this.readyState="closed",this.id=null,this.emitReserved("close",n,a),this.writeBuffer=[],this._prevBufferLen=0}}}Pn.protocol=Cm;class yb extends Pn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let n=0;n<this._upgrades.length;n++)this._probe(this._upgrades[n])}_probe(n){let a=this.createTransport(n),l=!1;Pn.priorWebsocketSuccess=!1;const u=()=>{l||(a.send([{type:"ping",data:"probe"}]),a.once("packet",w=>{if(!l)if(w.type==="pong"&&w.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",a),!a)return;Pn.priorWebsocketSuccess=a.name==="websocket",this.transport.pause(()=>{l||this.readyState!=="closed"&&(R(),this.setTransport(a),a.send([{type:"upgrade"}]),this.emitReserved("upgrade",a),a=null,this.upgrading=!1,this.flush())})}else{const j=new Error("probe error");j.transport=a.name,this.emitReserved("upgradeError",j)}}))};function f(){l||(l=!0,R(),a.close(),a=null)}const d=w=>{const j=new Error("probe error: "+w);j.transport=a.name,f(),this.emitReserved("upgradeError",j)};function m(){d("transport closed")}function y(){d("socket closed")}function b(w){a&&w.name!==a.name&&f()}const R=()=>{a.removeListener("open",u),a.removeListener("error",d),a.removeListener("close",m),this.off("close",y),this.off("upgrading",b)};a.once("open",u),a.once("error",d),a.once("close",m),this.once("close",y),this.once("upgrading",b),this._upgrades.indexOf("webtransport")!==-1&&n!=="webtransport"?this.setTimeoutFn(()=>{l||a.open()},200):a.open()}onHandshake(n){this._upgrades=this._filterUpgrades(n.upgrades),super.onHandshake(n)}_filterUpgrades(n){const a=[];for(let l=0;l<n.length;l++)~this.transports.indexOf(n[l])&&a.push(n[l]);return a}}let gb=class extends yb{constructor(n,a={}){const l=typeof n=="object",u=l?{...n}:{...a};(!u.transports||u.transports&&typeof u.transports[0]=="string")&&(u.transports=(u.transports||["polling","websocket","webtransport"]).map(f=>fb[f]).filter(f=>!!f)),super(l?u:n,u)}};function vb(r,n="",a){let l=r;a=a||typeof location<"u"&&location,r==null&&(r=a.protocol+"//"+a.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=a.protocol+r:r=a.host+r),/^(https?|wss?):\/\//.test(r)||(typeof a<"u"?r=a.protocol+"//"+r:r="https://"+r),l=Kc(r)),l.port||(/^(http|ws)$/.test(l.protocol)?l.port="80":/^(http|ws)s$/.test(l.protocol)&&(l.port="443")),l.path=l.path||"/";const f=l.host.indexOf(":")!==-1?"["+l.host+"]":l.host;return l.id=l.protocol+"://"+f+":"+l.port+n,l.href=l.protocol+"://"+f+(a&&a.port===l.port?"":":"+l.port),l}const bb=typeof ArrayBuffer=="function",wb=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Hm=Object.prototype.toString,Sb=typeof Blob=="function"||typeof Blob<"u"&&Hm.call(Blob)==="[object BlobConstructor]",xb=typeof File=="function"||typeof File<"u"&&Hm.call(File)==="[object FileConstructor]";function au(r){return bb&&(r instanceof ArrayBuffer||wb(r))||Sb&&r instanceof Blob||xb&&r instanceof File}function nr(r,n){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let a=0,l=r.length;a<l;a++)if(nr(r[a]))return!0;return!1}if(au(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return nr(r.toJSON(),!0);for(const a in r)if(Object.prototype.hasOwnProperty.call(r,a)&&nr(r[a]))return!0;return!1}function Eb(r){const n=[],a=r.data,l=r;return l.data=ir(a,n),l.attachments=n.length,{packet:l,buffers:n}}function ir(r,n,a){if(!r)return r;if(au(r)){const l={_placeholder:!0,num:n.length};return n.push(r),l}else if(Array.isArray(r)){const l=new Array(r.length);for(let u=0;u<r.length;u++)l[u]=ir(r[u],n);return l}else if(typeof r=="object"&&!(r instanceof Date)){if(r.toJSON&&typeof r.toJSON=="function"&&!a)return ir(r.toJSON(),n,!0);const l={};for(const u in r)Object.prototype.hasOwnProperty.call(r,u)&&(l[u]=ir(r[u],n));return l}return r}function kb(r,n){return r.data=Jc(r.data,n),delete r.attachments,r}function Jc(r,n){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<n.length)return n[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let a=0;a<r.length;a++)r[a]=Jc(r[a],n);else if(typeof r=="object")for(const a in r)Object.prototype.hasOwnProperty.call(r,a)&&(r[a]=Jc(r[a],n));return r}const Tb=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Se;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(Se||(Se={}));let _b=class{constructor(n){this.replacer=n}encode(n){return(n.type===Se.EVENT||n.type===Se.ACK)&&nr(n)?this.encodeAsBinary({type:n.type===Se.EVENT?Se.BINARY_EVENT:Se.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id}):[this.encodeAsString(n)]}encodeAsString(n){let a=""+n.type;return(n.type===Se.BINARY_EVENT||n.type===Se.BINARY_ACK)&&(a+=n.attachments+"-"),n.nsp&&n.nsp!=="/"&&(a+=n.nsp+","),n.id!=null&&(a+=n.id),n.data!=null&&(a+=JSON.stringify(n.data,this.replacer)),a}encodeAsBinary(n){const a=Eb(n),l=this.encodeAsString(a.packet),u=a.buffers;return u.unshift(l),u}},Ab=class $m extends Ie{constructor(n){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof n=="function"?{reviver:n}:n)}add(n){let a;if(typeof n=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");a=this.decodeString(n);const l=a.type===Se.BINARY_EVENT;l||a.type===Se.BINARY_ACK?(a.type=l?Se.EVENT:Se.ACK,this.reconstructor=new Nb(a)):super.emitReserved("decoded",a)}else if(au(n)||n.base64)if(this.reconstructor)a=this.reconstructor.takeBinaryData(n),a&&(this.reconstructor=null,super.emitReserved("decoded",a));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+n)}decodeString(n){let a=0;const l={type:Number(n.charAt(0))};if(Se[l.type]===void 0)throw new Error("unknown packet type "+l.type);if(l.type===Se.BINARY_EVENT||l.type===Se.BINARY_ACK){const f=a+1;for(;n.charAt(++a)!=="-"&&a!=n.length;);const d=n.substring(f,a);if(d!=Number(d)||n.charAt(a)!=="-")throw new Error("Illegal attachments");const m=Number(d);if(!Ob(m)||m<1)throw new Error("Illegal attachments");if(m>this.opts.maxAttachments)throw new Error("too many attachments");l.attachments=m}if(n.charAt(a+1)==="/"){const f=a+1;for(;++a&&!(n.charAt(a)===","||a===n.length););l.nsp=n.substring(f,a)}else l.nsp="/";const u=n.charAt(a+1);if(u!==""&&Number(u)==u){const f=a+1;for(;++a;){const d=n.charAt(a);if(d==null||Number(d)!=d){--a;break}if(a===n.length)break}l.id=Number(n.substring(f,a+1))}if(n.charAt(++a)){const f=this.tryParse(n.substr(a));if($m.isPayloadValid(l.type,f))l.data=f;else throw new Error("invalid payload")}return l}tryParse(n){try{return JSON.parse(n,this.opts.reviver)}catch{return!1}}static isPayloadValid(n,a){switch(n){case Se.CONNECT:return Gp(a);case Se.DISCONNECT:return a===void 0;case Se.CONNECT_ERROR:return typeof a=="string"||Gp(a);case Se.EVENT:case Se.BINARY_EVENT:return Array.isArray(a)&&(typeof a[0]=="number"||typeof a[0]=="string"&&Tb.indexOf(a[0])===-1);case Se.ACK:case Se.BINARY_ACK:return Array.isArray(a)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};class Nb{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){const a=kb(this.reconPack,this.buffers);return this.finishedReconstruction(),a}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Ob=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function Gp(r){return Object.prototype.toString.call(r)==="[object Object]"}const jb=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ab,Encoder:_b,get PacketType(){return Se}},Symbol.toStringTag,{value:"Module"}));function Qt(r,n,a){return r.on(n,a),function(){r.off(n,a)}}const Rb=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ym extends Ie{constructor(n,a,l){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=n,this.nsp=a,l&&l.auth&&(this.auth=l.auth),this._opts=Object.assign({},l),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const n=this.io;this.subs=[Qt(n,"open",this.onopen.bind(this)),Qt(n,"packet",this.onpacket.bind(this)),Qt(n,"error",this.onerror.bind(this)),Qt(n,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...n){return n.unshift("message"),this.emit.apply(this,n),this}emit(n,...a){var l,u,f;if(Rb.hasOwnProperty(n))throw new Error('"'+n.toString()+'" is a reserved event name');if(a.unshift(n),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(a),this;const d={type:Se.EVENT,data:a};if(d.options={},d.options.compress=this.flags.compress!==!1,typeof a[a.length-1]=="function"){const R=this.ids++,w=a.pop();this._registerAckCallback(R,w),d.id=R}const m=(u=(l=this.io.engine)===null||l===void 0?void 0:l.transport)===null||u===void 0?void 0:u.writable,y=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!m||(y?(this.notifyOutgoingListeners(d),this.packet(d)):this.sendBuffer.push(d)),this.flags={},this}_registerAckCallback(n,a){var l;const u=(l=this.flags.timeout)!==null&&l!==void 0?l:this._opts.ackTimeout;if(u===void 0){this.acks[n]=a;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[n];for(let m=0;m<this.sendBuffer.length;m++)this.sendBuffer[m].id===n&&this.sendBuffer.splice(m,1);a.call(this,new Error("operation has timed out"))},u),d=(...m)=>{this.io.clearTimeoutFn(f),a.apply(this,m)};d.withError=!0,this.acks[n]=d}emitWithAck(n,...a){return new Promise((l,u)=>{const f=(d,m)=>d?u(d):l(m);f.withError=!0,a.push(f),this.emit(n,...a)})}_addToQueue(n){let a;typeof n[n.length-1]=="function"&&(a=n.pop());const l={id:this._queueSeq++,tryCount:0,pending:!1,args:n,flags:Object.assign({fromQueue:!0},this.flags)};n.push((u,...f)=>(this._queue[0],u!==null?l.tryCount>this._opts.retries&&(this._queue.shift(),a&&a(u)):(this._queue.shift(),a&&a(null,...f)),l.pending=!1,this._drainQueue())),this._queue.push(l),this._drainQueue()}_drainQueue(n=!1){if(!this.connected||this._queue.length===0)return;const a=this._queue[0];a.pending&&!n||(a.pending=!0,a.tryCount++,this.flags=a.flags,this.emit.apply(this,a.args))}packet(n){n.nsp=this.nsp,this.io._packet(n)}onopen(){typeof this.auth=="function"?this.auth(n=>{this._sendConnectPacket(n)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(n){this.packet({type:Se.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},n):n})}onerror(n){this.connected||this.emitReserved("connect_error",n)}onclose(n,a){this.connected=!1,delete this.id,this.emitReserved("disconnect",n,a),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(n=>{if(!this.sendBuffer.some(l=>String(l.id)===n)){const l=this.acks[n];delete this.acks[n],l.withError&&l.call(this,new Error("socket has been disconnected"))}})}onpacket(n){if(n.nsp===this.nsp)switch(n.type){case Se.CONNECT:n.data&&n.data.sid?this.onconnect(n.data.sid,n.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Se.EVENT:case Se.BINARY_EVENT:this.onevent(n);break;case Se.ACK:case Se.BINARY_ACK:this.onack(n);break;case Se.DISCONNECT:this.ondisconnect();break;case Se.CONNECT_ERROR:this.destroy();const l=new Error(n.data.message);l.data=n.data.data,this.emitReserved("connect_error",l);break}}onevent(n){const a=n.data||[];n.id!=null&&a.push(this.ack(n.id)),this.connected?this.emitEvent(a):this.receiveBuffer.push(Object.freeze(a))}emitEvent(n){if(this._anyListeners&&this._anyListeners.length){const a=this._anyListeners.slice();for(const l of a)l.apply(this,n)}super.emit.apply(this,n),this._pid&&n.length&&typeof n[n.length-1]=="string"&&(this._lastOffset=n[n.length-1])}ack(n){const a=this;let l=!1;return function(...u){l||(l=!0,a.packet({type:Se.ACK,id:n,data:u}))}}onack(n){const a=this.acks[n.id];typeof a=="function"&&(delete this.acks[n.id],a.withError&&n.data.unshift(null),a.apply(this,n.data))}onconnect(n,a){this.id=n,this.recovered=a&&this._pid===a,this._pid=a,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(n=>this.emitEvent(n)),this.receiveBuffer=[],this.sendBuffer.forEach(n=>{this.notifyOutgoingListeners(n),this.packet(n)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(n=>n()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Se.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}timeout(n){return this.flags.timeout=n,this}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){const a=this._anyListeners;for(let l=0;l<a.length;l++)if(n===a[l])return a.splice(l,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(n),this}prependAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(n),this}offAnyOutgoing(n){if(!this._anyOutgoingListeners)return this;if(n){const a=this._anyOutgoingListeners;for(let l=0;l<a.length;l++)if(n===a[l])return a.splice(l,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const a=this._anyOutgoingListeners.slice();for(const l of a)l.apply(this,n.data)}}}function ds(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}ds.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),a=Math.floor(n*this.jitter*r);r=(Math.floor(n*10)&1)==0?r-a:r+a}return Math.min(r,this.max)|0};ds.prototype.reset=function(){this.attempts=0};ds.prototype.setMin=function(r){this.ms=r};ds.prototype.setMax=function(r){this.max=r};ds.prototype.setJitter=function(r){this.jitter=r};class Fc extends Ie{constructor(n,a){var l;super(),this.nsps={},this.subs=[],n&&typeof n=="object"&&(a=n,n=void 0),a=a||{},a.path=a.path||"/socket.io",this.opts=a,cr(this,a),this.reconnection(a.reconnection!==!1),this.reconnectionAttempts(a.reconnectionAttempts||1/0),this.reconnectionDelay(a.reconnectionDelay||1e3),this.reconnectionDelayMax(a.reconnectionDelayMax||5e3),this.randomizationFactor((l=a.randomizationFactor)!==null&&l!==void 0?l:.5),this.backoff=new ds({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(a.timeout==null?2e4:a.timeout),this._readyState="closed",this.uri=n;const u=a.parser||jb;this.encoder=new u.Encoder,this.decoder=new u.Decoder,this._autoConnect=a.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(n){return arguments.length?(this._reconnection=!!n,n||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(n){return n===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=n,this)}reconnectionDelay(n){var a;return n===void 0?this._reconnectionDelay:(this._reconnectionDelay=n,(a=this.backoff)===null||a===void 0||a.setMin(n),this)}randomizationFactor(n){var a;return n===void 0?this._randomizationFactor:(this._randomizationFactor=n,(a=this.backoff)===null||a===void 0||a.setJitter(n),this)}reconnectionDelayMax(n){var a;return n===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=n,(a=this.backoff)===null||a===void 0||a.setMax(n),this)}timeout(n){return arguments.length?(this._timeout=n,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(n){if(~this._readyState.indexOf("open"))return this;this.engine=new gb(this.uri,this.opts);const a=this.engine,l=this;this._readyState="opening",this.skipReconnect=!1;const u=Qt(a,"open",function(){l.onopen(),n&&n()}),f=m=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",m),n?n(m):this.maybeReconnectOnOpen()},d=Qt(a,"error",f);if(this._timeout!==!1){const m=this._timeout,y=this.setTimeoutFn(()=>{u(),f(new Error("timeout")),a.close()},m);this.opts.autoUnref&&y.unref(),this.subs.push(()=>{this.clearTimeoutFn(y)})}return this.subs.push(u),this.subs.push(d),this}connect(n){return this.open(n)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const n=this.engine;this.subs.push(Qt(n,"ping",this.onping.bind(this)),Qt(n,"data",this.ondata.bind(this)),Qt(n,"error",this.onerror.bind(this)),Qt(n,"close",this.onclose.bind(this)),Qt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(n){try{this.decoder.add(n)}catch(a){this.onclose("parse error",a)}}ondecoded(n){or(()=>{this.emitReserved("packet",n)},this.setTimeoutFn)}onerror(n){this.emitReserved("error",n)}socket(n,a){let l=this.nsps[n];return l?this._autoConnect&&!l.active&&l.connect():(l=new Ym(this,n,a),this.nsps[n]=l),l}_destroy(n){const a=Object.keys(this.nsps);for(const l of a)if(this.nsps[l].active)return;this._close()}_packet(n){const a=this.encoder.encode(n);for(let l=0;l<a.length;l++)this.engine.write(a[l],n.options)}cleanup(){this.subs.forEach(n=>n()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(n,a){var l;this.cleanup(),(l=this.engine)===null||l===void 0||l.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",n,a),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const n=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const a=this.backoff.duration();this._reconnecting=!0;const l=this.setTimeoutFn(()=>{n.skipReconnect||(this.emitReserved("reconnect_attempt",n.backoff.attempts),!n.skipReconnect&&n.open(u=>{u?(n._reconnecting=!1,n.reconnect(),this.emitReserved("reconnect_error",u)):n.onreconnect()}))},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}}onreconnect(){const n=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",n)}}const ya={};function ka(r,n){typeof r=="object"&&(n=r,r=void 0),n=n||{};const a=vb(r,n.path||"/socket.io"),l=a.source,u=a.id,f=a.path,d=ya[u]&&f in ya[u].nsps,m=n.forceNew||n["force new connection"]||n.multiplex===!1||d;let y;return m?y=new Fc(l,n):(ya[u]||(ya[u]=new Fc(l,n)),y=ya[u]),a.query&&!n.query&&(n.query=a.queryKey),y.socket(a.path,n)}Object.assign(ka,{Manager:Fc,Socket:Ym,io:ka,connect:ka});function zb(r){const n=r.length;let a=0,l=0;for(;l<n;){let u=r.charCodeAt(l++);if((u&4294967168)===0){a++;continue}else if((u&4294965248)===0)a+=2;else{if(u>=55296&&u<=56319&&l<n){const f=r.charCodeAt(l);(f&64512)===56320&&(++l,u=((u&1023)<<10)+(f&1023)+65536)}(u&4294901760)===0?a+=3:a+=4}}return a}function Mb(r,n,a){const l=r.length;let u=a,f=0;for(;f<l;){let d=r.charCodeAt(f++);if((d&4294967168)===0){n[u++]=d;continue}else if((d&4294965248)===0)n[u++]=d>>6&31|192;else{if(d>=55296&&d<=56319&&f<l){const m=r.charCodeAt(f);(m&64512)===56320&&(++f,d=((d&1023)<<10)+(m&1023)+65536)}(d&4294901760)===0?(n[u++]=d>>12&15|224,n[u++]=d>>6&63|128):(n[u++]=d>>18&7|240,n[u++]=d>>12&63|128,n[u++]=d>>6&63|128)}n[u++]=d&63|128}}const Cb=new TextEncoder,Ub=50;function Db(r,n,a){Cb.encodeInto(r,n.subarray(a))}function Bb(r,n,a){r.length>Ub?Db(r,n,a):Mb(r,n,a)}const qb=4096;function Vm(r,n,a){let l=n;const u=l+a,f=[];let d="";for(;l<u;){const m=r[l++];if((m&128)===0)f.push(m);else if((m&224)===192){const y=r[l++]&63;f.push((m&31)<<6|y)}else if((m&240)===224){const y=r[l++]&63,b=r[l++]&63;f.push((m&31)<<12|y<<6|b)}else if((m&248)===240){const y=r[l++]&63,b=r[l++]&63,R=r[l++]&63;let w=(m&7)<<18|y<<12|b<<6|R;w>65535&&(w-=65536,f.push(w>>>10&1023|55296),w=56320|w&1023),f.push(w)}else f.push(m);f.length>=qb&&(d+=String.fromCharCode(...f),f.length=0)}return f.length>0&&(d+=String.fromCharCode(...f)),d}const Lb=new TextDecoder,Hb=200;function $b(r,n,a){const l=r.subarray(n,n+a);return Lb.decode(l)}function Yb(r,n,a){return a>Hb?$b(r,n,a):Vm(r,n,a)}class Wl{type;data;constructor(n,a){this.type=n,this.data=a}}class jt extends Error{constructor(n){super(n);const a=Object.create(jt.prototype);Object.setPrototypeOf(this,a),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:jt.name})}}const ga=4294967295;function Vb(r,n,a){const l=a/4294967296,u=a;r.setUint32(n,l),r.setUint32(n+4,u)}function Xm(r,n,a){const l=Math.floor(a/4294967296),u=a;r.setUint32(n,l),r.setUint32(n+4,u)}function Gm(r,n){const a=r.getInt32(n),l=r.getUint32(n+4);return a*4294967296+l}function Xb(r,n){const a=r.getUint32(n),l=r.getUint32(n+4);return a*4294967296+l}const Gb=-1,Qb=4294967296-1,Kb=17179869184-1;function Zb({sec:r,nsec:n}){if(r>=0&&n>=0&&r<=Kb)if(n===0&&r<=Qb){const a=new Uint8Array(4);return new DataView(a.buffer).setUint32(0,r),a}else{const a=r/4294967296,l=r&4294967295,u=new Uint8Array(8),f=new DataView(u.buffer);return f.setUint32(0,n<<2|a&3),f.setUint32(4,l),u}else{const a=new Uint8Array(12),l=new DataView(a.buffer);return l.setUint32(0,n),Xm(l,4,r),a}}function Jb(r){const n=r.getTime(),a=Math.floor(n/1e3),l=(n-a*1e3)*1e6,u=Math.floor(l/1e9);return{sec:a+u,nsec:l-u*1e9}}function Fb(r){if(r instanceof Date){const n=Jb(r);return Zb(n)}else return null}function Wb(r){const n=new DataView(r.buffer,r.byteOffset,r.byteLength);switch(r.byteLength){case 4:return{sec:n.getUint32(0),nsec:0};case 8:{const a=n.getUint32(0),l=n.getUint32(4),u=(a&3)*4294967296+l,f=a>>>2;return{sec:u,nsec:f}}case 12:{const a=Gm(n,4),l=n.getUint32(0);return{sec:a,nsec:l}}default:throw new jt(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${r.length}`)}}function Ib(r){const n=Wb(r);return new Date(n.sec*1e3+n.nsec/1e6)}const Pb={type:Gb,encode:Fb,decode:Ib};class ur{static defaultCodec=new ur;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(Pb)}register({type:n,encode:a,decode:l}){if(n>=0)this.encoders[n]=a,this.decoders[n]=l;else{const u=-1-n;this.builtInEncoders[u]=a,this.builtInDecoders[u]=l}}tryToEncode(n,a){for(let l=0;l<this.builtInEncoders.length;l++){const u=this.builtInEncoders[l];if(u!=null){const f=u(n,a);if(f!=null){const d=-1-l;return new Wl(d,f)}}}for(let l=0;l<this.encoders.length;l++){const u=this.encoders[l];if(u!=null){const f=u(n,a);if(f!=null){const d=l;return new Wl(d,f)}}}return n instanceof Wl?n:null}decode(n,a,l){const u=a<0?this.builtInDecoders[-1-a]:this.decoders[a];return u?u(n,a,l):new Wl(a,n)}}function ew(r){return r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer}function Wc(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):ew(r)?new Uint8Array(r):Uint8Array.from(r)}const tw=100,nw=2048;class lu{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(n){this.extensionCodec=n?.extensionCodec??ur.defaultCodec,this.context=n?.context,this.useBigInt64=n?.useBigInt64??!1,this.maxDepth=n?.maxDepth??tw,this.initialBufferSize=n?.initialBufferSize??nw,this.sortKeys=n?.sortKeys??!1,this.forceFloat32=n?.forceFloat32??!1,this.ignoreUndefined=n?.ignoreUndefined??!1,this.forceIntegerToFloat=n?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new lu({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(n){if(this.entered)return this.clone().encodeSharedRef(n);try{return this.entered=!0,this.reinitializeState(),this.doEncode(n,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(n){if(this.entered)return this.clone().encode(n);try{return this.entered=!0,this.reinitializeState(),this.doEncode(n,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(n,a){if(a>this.maxDepth)throw new Error(`Too deep objects in depth ${a}`);n==null?this.encodeNil():typeof n=="boolean"?this.encodeBoolean(n):typeof n=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(n):this.encodeNumber(n):typeof n=="string"?this.encodeString(n):this.useBigInt64&&typeof n=="bigint"?this.encodeBigInt64(n):this.encodeObject(n,a)}ensureBufferSizeToWrite(n){const a=this.pos+n;this.view.byteLength<a&&this.resizeBuffer(a*2)}resizeBuffer(n){const a=new ArrayBuffer(n),l=new Uint8Array(a),u=new DataView(a);l.set(this.bytes),this.view=u,this.bytes=l}encodeNil(){this.writeU8(192)}encodeBoolean(n){n===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(n){!this.forceIntegerToFloat&&Number.isSafeInteger(n)?n>=0?n<128?this.writeU8(n):n<256?(this.writeU8(204),this.writeU8(n)):n<65536?(this.writeU8(205),this.writeU16(n)):n<4294967296?(this.writeU8(206),this.writeU32(n)):this.useBigInt64?this.encodeNumberAsFloat(n):(this.writeU8(207),this.writeU64(n)):n>=-32?this.writeU8(224|n+32):n>=-128?(this.writeU8(208),this.writeI8(n)):n>=-32768?(this.writeU8(209),this.writeI16(n)):n>=-2147483648?(this.writeU8(210),this.writeI32(n)):this.useBigInt64?this.encodeNumberAsFloat(n):(this.writeU8(211),this.writeI64(n)):this.encodeNumberAsFloat(n)}encodeNumberAsFloat(n){this.forceFloat32?(this.writeU8(202),this.writeF32(n)):(this.writeU8(203),this.writeF64(n))}encodeBigInt64(n){n>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(n)):(this.writeU8(211),this.writeBigInt64(n))}writeStringHeader(n){if(n<32)this.writeU8(160+n);else if(n<256)this.writeU8(217),this.writeU8(n);else if(n<65536)this.writeU8(218),this.writeU16(n);else if(n<4294967296)this.writeU8(219),this.writeU32(n);else throw new Error(`Too long string: ${n} bytes in UTF-8`)}encodeString(n){const l=zb(n);this.ensureBufferSizeToWrite(5+l),this.writeStringHeader(l),Bb(n,this.bytes,this.pos),this.pos+=l}encodeObject(n,a){const l=this.extensionCodec.tryToEncode(n,this.context);if(l!=null)this.encodeExtension(l);else if(Array.isArray(n))this.encodeArray(n,a);else if(ArrayBuffer.isView(n))this.encodeBinary(n);else if(typeof n=="object")this.encodeMap(n,a);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(n)}`)}encodeBinary(n){const a=n.byteLength;if(a<256)this.writeU8(196),this.writeU8(a);else if(a<65536)this.writeU8(197),this.writeU16(a);else if(a<4294967296)this.writeU8(198),this.writeU32(a);else throw new Error(`Too large binary: ${a}`);const l=Wc(n);this.writeU8a(l)}encodeArray(n,a){const l=n.length;if(l<16)this.writeU8(144+l);else if(l<65536)this.writeU8(220),this.writeU16(l);else if(l<4294967296)this.writeU8(221),this.writeU32(l);else throw new Error(`Too large array: ${l}`);for(const u of n)this.doEncode(u,a+1)}countWithoutUndefined(n,a){let l=0;for(const u of a)n[u]!==void 0&&l++;return l}encodeMap(n,a){const l=Object.keys(n);this.sortKeys&&l.sort();const u=this.ignoreUndefined?this.countWithoutUndefined(n,l):l.length;if(u<16)this.writeU8(128+u);else if(u<65536)this.writeU8(222),this.writeU16(u);else if(u<4294967296)this.writeU8(223),this.writeU32(u);else throw new Error(`Too large map object: ${u}`);for(const f of l){const d=n[f];this.ignoreUndefined&&d===void 0||(this.encodeString(f),this.doEncode(d,a+1))}}encodeExtension(n){if(typeof n.data=="function"){const l=n.data(this.pos+6),u=l.length;if(u>=4294967296)throw new Error(`Too large extension object: ${u}`);this.writeU8(201),this.writeU32(u),this.writeI8(n.type),this.writeU8a(l);return}const a=n.data.length;if(a===1)this.writeU8(212);else if(a===2)this.writeU8(213);else if(a===4)this.writeU8(214);else if(a===8)this.writeU8(215);else if(a===16)this.writeU8(216);else if(a<256)this.writeU8(199),this.writeU8(a);else if(a<65536)this.writeU8(200),this.writeU16(a);else if(a<4294967296)this.writeU8(201),this.writeU32(a);else throw new Error(`Too large extension object: ${a}`);this.writeI8(n.type),this.writeU8a(n.data)}writeU8(n){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,n),this.pos++}writeU8a(n){const a=n.length;this.ensureBufferSizeToWrite(a),this.bytes.set(n,this.pos),this.pos+=a}writeI8(n){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,n),this.pos++}writeU16(n){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,n),this.pos+=2}writeI16(n){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,n),this.pos+=2}writeU32(n){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,n),this.pos+=4}writeI32(n){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,n),this.pos+=4}writeF32(n){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,n),this.pos+=4}writeF64(n){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,n),this.pos+=8}writeU64(n){this.ensureBufferSizeToWrite(8),Vb(this.view,this.pos,n),this.pos+=8}writeI64(n){this.ensureBufferSizeToWrite(8),Xm(this.view,this.pos,n),this.pos+=8}writeBigUint64(n){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,n),this.pos+=8}writeBigInt64(n){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,n),this.pos+=8}}function iw(r,n){return new lu(n).encodeSharedRef(r)}function qc(r){return`${r<0?"-":""}0x${Math.abs(r).toString(16).padStart(2,"0")}`}const sw=16,aw=16;class lw{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(n=sw,a=aw){this.maxKeyLength=n,this.maxLengthPerKey=a,this.caches=[];for(let l=0;l<this.maxKeyLength;l++)this.caches.push([])}canBeCached(n){return n>0&&n<=this.maxKeyLength}find(n,a,l){const u=this.caches[l-1];e:for(const f of u){const d=f.bytes;for(let m=0;m<l;m++)if(d[m]!==n[a+m])continue e;return f.str}return null}store(n,a){const l=this.caches[n.length-1],u={bytes:n,str:a};l.length>=this.maxLengthPerKey?l[Math.random()*l.length|0]=u:l.push(u)}decode(n,a,l){const u=this.find(n,a,l);if(u!=null)return this.hit++,u;this.miss++;const f=Vm(n,a,l),d=Uint8Array.prototype.slice.call(n,a,a+l);return this.store(d,f),f}}const Ic="array",Ta="map_key",Qm="map_value",rw=r=>{if(typeof r=="string"||typeof r=="number")return r;throw new jt("The type of key must be string or number but "+typeof r)};class ow{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(n){const a=this.getUninitializedStateFromPool();a.type=Ic,a.position=0,a.size=n,a.array=new Array(n)}pushMapState(n){const a=this.getUninitializedStateFromPool();a.type=Ta,a.readCount=0,a.size=n,a.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const n={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(n)}return this.stack[this.stackHeadPosition]}release(n){if(this.stack[this.stackHeadPosition]!==n)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(n.type===Ic){const l=n;l.size=0,l.array=void 0,l.position=0,l.type=void 0}if(n.type===Ta||n.type===Qm){const l=n;l.size=0,l.map=void 0,l.readCount=0,l.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const va=-1,ru=new DataView(new ArrayBuffer(0)),cw=new Uint8Array(ru.buffer);try{ru.getInt8(0)}catch(r){if(!(r instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const Qp=new RangeError("Insufficient data"),uw=new lw;class ou{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=ru;bytes=cw;headByte=va;stack=new ow;entered=!1;constructor(n){this.extensionCodec=n?.extensionCodec??ur.defaultCodec,this.context=n?.context,this.useBigInt64=n?.useBigInt64??!1,this.rawStrings=n?.rawStrings??!1,this.maxStrLength=n?.maxStrLength??ga,this.maxBinLength=n?.maxBinLength??ga,this.maxArrayLength=n?.maxArrayLength??ga,this.maxMapLength=n?.maxMapLength??ga,this.maxExtLength=n?.maxExtLength??ga,this.keyDecoder=n?.keyDecoder!==void 0?n.keyDecoder:uw,this.mapKeyConverter=n?.mapKeyConverter??rw}clone(){return new ou({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=va,this.stack.reset()}setBuffer(n){const a=Wc(n);this.bytes=a,this.view=new DataView(a.buffer,a.byteOffset,a.byteLength),this.pos=0}appendBuffer(n){if(this.headByte===va&&!this.hasRemaining(1))this.setBuffer(n);else{const a=this.bytes.subarray(this.pos),l=Wc(n),u=new Uint8Array(a.length+l.length);u.set(a),u.set(l,a.length),this.setBuffer(u)}}hasRemaining(n){return this.view.byteLength-this.pos>=n}createExtraByteError(n){const{view:a,pos:l}=this;return new RangeError(`Extra ${a.byteLength-l} of ${a.byteLength} byte(s) found at buffer[${n}]`)}decode(n){if(this.entered)return this.clone().decode(n);try{this.entered=!0,this.reinitializeState(),this.setBuffer(n);const a=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return a}finally{this.entered=!1}}*decodeMulti(n){if(this.entered){yield*this.clone().decodeMulti(n);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(n);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(n){if(this.entered)return this.clone().decodeAsync(n);try{this.entered=!0;let a=!1,l;for await(const m of n){if(a)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(m);try{l=this.doDecodeSync(),a=!0}catch(y){if(!(y instanceof RangeError))throw y}this.totalPos+=this.pos}if(a){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return l}const{headByte:u,pos:f,totalPos:d}=this;throw new RangeError(`Insufficient data in parsing ${qc(u)} at ${d} (${f} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(n){return this.decodeMultiAsync(n,!0)}decodeStream(n){return this.decodeMultiAsync(n,!1)}async*decodeMultiAsync(n,a){if(this.entered){yield*this.clone().decodeMultiAsync(n,a);return}try{this.entered=!0;let l=a,u=-1;for await(const f of n){if(a&&u===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(f),l&&(u=this.readArraySize(),l=!1,this.complete());try{for(;yield this.doDecodeSync(),--u!==0;);}catch(d){if(!(d instanceof RangeError))throw d}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const n=this.readHeadByte();let a;if(n>=224)a=n-256;else if(n<192)if(n<128)a=n;else if(n<144){const u=n-128;if(u!==0){this.pushMapState(u),this.complete();continue e}else a={}}else if(n<160){const u=n-144;if(u!==0){this.pushArrayState(u),this.complete();continue e}else a=[]}else{const u=n-160;a=this.decodeString(u,0)}else if(n===192)a=null;else if(n===194)a=!1;else if(n===195)a=!0;else if(n===202)a=this.readF32();else if(n===203)a=this.readF64();else if(n===204)a=this.readU8();else if(n===205)a=this.readU16();else if(n===206)a=this.readU32();else if(n===207)this.useBigInt64?a=this.readU64AsBigInt():a=this.readU64();else if(n===208)a=this.readI8();else if(n===209)a=this.readI16();else if(n===210)a=this.readI32();else if(n===211)this.useBigInt64?a=this.readI64AsBigInt():a=this.readI64();else if(n===217){const u=this.lookU8();a=this.decodeString(u,1)}else if(n===218){const u=this.lookU16();a=this.decodeString(u,2)}else if(n===219){const u=this.lookU32();a=this.decodeString(u,4)}else if(n===220){const u=this.readU16();if(u!==0){this.pushArrayState(u),this.complete();continue e}else a=[]}else if(n===221){const u=this.readU32();if(u!==0){this.pushArrayState(u),this.complete();continue e}else a=[]}else if(n===222){const u=this.readU16();if(u!==0){this.pushMapState(u),this.complete();continue e}else a={}}else if(n===223){const u=this.readU32();if(u!==0){this.pushMapState(u),this.complete();continue e}else a={}}else if(n===196){const u=this.lookU8();a=this.decodeBinary(u,1)}else if(n===197){const u=this.lookU16();a=this.decodeBinary(u,2)}else if(n===198){const u=this.lookU32();a=this.decodeBinary(u,4)}else if(n===212)a=this.decodeExtension(1,0);else if(n===213)a=this.decodeExtension(2,0);else if(n===214)a=this.decodeExtension(4,0);else if(n===215)a=this.decodeExtension(8,0);else if(n===216)a=this.decodeExtension(16,0);else if(n===199){const u=this.lookU8();a=this.decodeExtension(u,1)}else if(n===200){const u=this.lookU16();a=this.decodeExtension(u,2)}else if(n===201){const u=this.lookU32();a=this.decodeExtension(u,4)}else throw new jt(`Unrecognized type byte: ${qc(n)}`);this.complete();const l=this.stack;for(;l.length>0;){const u=l.top();if(u.type===Ic)if(u.array[u.position]=a,u.position++,u.position===u.size)a=u.array,l.release(u);else continue e;else if(u.type===Ta){if(a==="__proto__")throw new jt("The key __proto__ is not allowed");u.key=this.mapKeyConverter(a),u.type=Qm;continue e}else if(u.map[u.key]=a,u.readCount++,u.readCount===u.size)a=u.map,l.release(u);else{u.key=null,u.type=Ta;continue e}}return a}}readHeadByte(){return this.headByte===va&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=va}readArraySize(){const n=this.readHeadByte();switch(n){case 220:return this.readU16();case 221:return this.readU32();default:{if(n<160)return n-144;throw new jt(`Unrecognized array type byte: ${qc(n)}`)}}}pushMapState(n){if(n>this.maxMapLength)throw new jt(`Max length exceeded: map length (${n}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(n)}pushArrayState(n){if(n>this.maxArrayLength)throw new jt(`Max length exceeded: array length (${n}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(n)}decodeString(n,a){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(n,a):this.decodeBinary(n,a)}decodeUtf8String(n,a){if(n>this.maxStrLength)throw new jt(`Max length exceeded: UTF-8 byte length (${n}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+a+n)throw Qp;const l=this.pos+a;let u;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(n)?u=this.keyDecoder.decode(this.bytes,l,n):u=Yb(this.bytes,l,n),this.pos+=a+n,u}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===Ta:!1}decodeBinary(n,a){if(n>this.maxBinLength)throw new jt(`Max length exceeded: bin length (${n}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(n+a))throw Qp;const l=this.pos+a,u=this.bytes.subarray(l,l+n);return this.pos+=a+n,u}decodeExtension(n,a){if(n>this.maxExtLength)throw new jt(`Max length exceeded: ext length (${n}) > maxExtLength (${this.maxExtLength})`);const l=this.view.getInt8(this.pos+a),u=this.decodeBinary(n,a+1);return this.extensionCodec.decode(u,l,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const n=this.view.getUint8(this.pos);return this.pos++,n}readI8(){const n=this.view.getInt8(this.pos);return this.pos++,n}readU16(){const n=this.view.getUint16(this.pos);return this.pos+=2,n}readI16(){const n=this.view.getInt16(this.pos);return this.pos+=2,n}readU32(){const n=this.view.getUint32(this.pos);return this.pos+=4,n}readI32(){const n=this.view.getInt32(this.pos);return this.pos+=4,n}readU64(){const n=Xb(this.view,this.pos);return this.pos+=8,n}readI64(){const n=Gm(this.view,this.pos);return this.pos+=8,n}readU64AsBigInt(){const n=this.view.getBigUint64(this.pos);return this.pos+=8,n}readI64AsBigInt(){const n=this.view.getBigInt64(this.pos);return this.pos+=8,n}readF32(){const n=this.view.getFloat32(this.pos);return this.pos+=4,n}readF64(){const n=this.view.getFloat64(this.pos);return this.pos+=8,n}}function fw(r,n){return new ou(n).decode(r)}const Km={contentType:"application/msgpack",encode:r=>iw(r,{ignoreUndefined:!0}),decode:r=>fw(r)},hw={contentType:"application/json",encode:r=>ym(JSON.stringify(r)),decode:r=>JSON.parse(mm(r))},dw=r=>r?Km:hw,Kp=async(r,n,a,l,u,f)=>{if(r.emit(_e.unroutable,{source:a,target:l,reason:f}),n.type!==We.RequestMessage)return;const d=n.payload?.id;if(!d)return;const m={type:Xe.error,id:d,code:u,error:{name:"RpcError",message:`${r.name}: ${f}`}},y=new vm;y.type=We.ErrorMessage,y.payload=m;try{await r.receive(y,r.name,a)}catch{}},pw=64,mw=r=>typeof r=="string"&&r.length>0&&r.length<=pw,Zp="presence",yw=128,Jp=8,Fp=r=>typeof r=="string"&&r.length>0&&r.length<=yw&&![...r].some(n=>n===" "||n.charCodeAt(0)<32||n.charCodeAt(0)===127),gw=async(r,n)=>{const a=r.map(u=>u.presenceSettled?.()??Promise.resolve());let l;await Promise.race([Promise.all(a).then(()=>{}),new Promise(u=>{l=setTimeout(u,n),l.unref?.()})]),l!==void 0&&clearTimeout(l)};class Wp extends rr{url;options;announcePresence;allowInsecureTls;socket;connected=!1;codec=Km;knownPeers=new Set;carrying=[];sweepLanded;sweep=new Promise(n=>this.sweepLanded=n);presenceSettled(){return this.announcePresence||this.sweepLanded?.(),this.sweep}constructor(n,a,l,u={},f=!0,d=!1){super(n,l),this.url=a,this.options=u,this.announcePresence=f,this.allowInsecureTls=d,queueMicrotask(()=>{this.open().catch(m=>this.emit(_e.transportError,m))})}closing=!1;async close(){this.closing=!0,this.sweepLanded?.(),this.sweepLanded=void 0;const n=this.socket;if(this.socket=void 0,this.connected=!1,this.readyFlag=!1,!n)return;n.io.reconnection(!1);const a=n.io.engine,l=n.connected&&a?new Promise(u=>{const f=setTimeout(u,2e3);f.unref?.(),a.once("close",()=>{clearTimeout(f),u()})}):Promise.resolve();n.disconnect(),await l,n.removeAllListeners(),this.knownPeers.clear()}async open(){if(this.socket)return;super.open();const n=this.url;this.allowInsecureTls&&(this.options={rejectUnauthorized:!1,...this.options},this.warnAboutInsecureTls()),this.socket=n?ka(n,this.options):ka(this.options),this.socket.on("message",async a=>{try{const[l,u,f]=this.extractHeader(new Uint8Array(a));if(!l){this.emit(_e.rejected,{source:"unknown",reason:f??"no msgrpc header"});return}const d=this.codec.decode(u);await this.deliver(d,l.source,l.target,l.hops??0)}catch(l){this.emit(_e.rejected,{source:"unknown",reason:`undecodable frame: ${String(l)}`,error:l})}}),this.socket.on(Zp,a=>{try{this.onPresence(a)}catch(l){this.emit(_e.rejected,{source:"unknown",reason:`bad presence update: ${String(l)}`,error:l})}}),this.socket.on("connect",()=>{this.connected=!0,this.readyFlag=!0,this.announcePresence&&this.announce(),this.emit(_e.connected)}),this.socket.on("disconnect",a=>{this.connected=!1,this.readyFlag=!1;for(const l of[...this.knownPeers])this.knownPeers.delete(l),this.emit(_e.peerGone,l);this.emit(_e.disconnected,a),a==="io server disconnect"&&!this.closing&&setTimeout(()=>{!this.closing&&this.socket?.disconnected&&this.socket.connect()},1e3).unref?.()})}warnAboutInsecureTls(){!this.url||!/^(https|wss):/i.test(this.url)||console.warn(`source-rpc: '${this.name}' is connecting to ${this.url} with allowInsecureTls, so the server's certificate is not checked. Anything able to answer on that address can read and rewrite this link. Use it for a development server, not a plant.`)}registerIfUnrouted(n){this.peerRegistry.get(n)||this.setKnownSource(n)}announce(){const n={name:this.name};this.carrying.length&&(n.carrying=this.carrying),this.shape&&(n.shape=this.shape),this.socket?.emit(Zp,n)}shape;announceShape(n){this.shape!==n&&(this.shape=n,this.connected&&this.announcePresence&&this.announce())}advertise(n){const a=[...n].sort();a.length===this.carrying.length&&a.every((l,u)=>l===this.carrying[u])||(this.carrying=a,this.connected&&this.announcePresence&&this.announce())}noteShape(n,a){mw(a)&&this.peerRegistry.noteShape(n,a)&&this.emit(_e.peerShape,n,a)}onPresence(n){if(Array.isArray(n.peers)){const a=this.sweepLanded;this.sweepLanded=void 0,a?.();for(const l of n.peers)!Fp(l)||l===this.name||(n.shapes&&Object.prototype.hasOwnProperty.call(n.shapes,l)&&this.noteShape(l,n.shapes[l]),!this.knownPeers.has(l)&&(this.knownPeers.add(l),this.registerIfUnrouted(l),this.emit(_e.peerOnline,l)));return}if(!(!Fp(n.peer)||n.peer===this.name))if(n.state==="offline"){if(!this.knownPeers.delete(n.peer))return;this.emit(_e.peerGone,n.peer)}else{if(n.shape!==void 0&&this.noteShape(n.peer,n.shape),this.knownPeers.has(n.peer))return;this.knownPeers.add(n.peer),this.registerIfUnrouted(n.peer),this.emit(_e.peerOnline,n.peer)}}async deliver(n,a,l,u){if(l!==this.name){const f=this.peerRegistry.get(l);if(f&&f!==this&&f.isTransport()){if(u+1>Jp){await Kp(this,n,a,l,"TransportError",`over ${Jp} relays`);return}const d=f;d.forward?d.forward(n,a,l,u+1):await f.receive(n,a,l);return}}if(this.targetExists(l)){await this.send(n,a,l);return}await Kp(this,n,a,l,"TransportError",`no route to '${l}'`)}forward(n,a,l,u){try{this.requireSocket().emit("message",this.frameMessage(this.buildHeader(a,l,{hops:u}),this.codec.encode(n)))}catch(f){this.emit(_e.unroutable,{source:a,target:l,reason:`cannot forward: ${String(f)}`,error:f})}}requireSocket(){if(!this.socket)throw new Error(`SocketIoClientTransport '${this.name}': not connected to ${this.url??"the default url"}`);return this.socket}async receive(n,a,l){this.requireSocket().emit("message",this.frameMessage(this.buildHeader(a,l),this.codec.encode(n)))}isTransport(){return!0}}const cu=Object.freeze(`abandon
8
+ `+s.stack}}var Y=Object.prototype.hasOwnProperty,ae=r.unstable_scheduleCallback,De=r.unstable_cancelCallback,me=r.unstable_shouldYield,st=r.unstable_requestPaint,Qe=r.unstable_now,Ei=r.unstable_getCurrentPriorityLevel,fu=r.unstable_ImmediatePriority,hu=r.unstable_UserBlockingPriority,_a=r.unstable_NormalPriority,ny=r.unstable_LowPriority,du=r.unstable_IdlePriority,iy=r.log,sy=r.unstable_setDisableYieldValue,bs=null,St=null;function An(e){if(typeof iy=="function"&&sy(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(bs,e)}catch{}}var xt=Math.clz32?Math.clz32:ry,ay=Math.log,ly=Math.LN2;function ry(e){return e>>>=0,e===0?32:31-(ay(e)/ly|0)|0}var Aa=256,Na=262144,Oa=4194304;function ii(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ja(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var o=0,c=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var p=s&134217727;return p!==0?(s=p&~c,s!==0?o=ii(s):(h&=p,h!==0?o=ii(h):i||(i=p&~e,i!==0&&(o=ii(i))))):(p=s&~c,p!==0?o=ii(p):h!==0?o=ii(h):i||(i=s&~e,i!==0&&(o=ii(i)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,i=t&-t,c>=i||c===32&&(i&4194048)!==0)?t:o}function ws(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function oy(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 pu(){var e=Oa;return Oa<<=1,(Oa&62914560)===0&&(Oa=4194304),e}function fr(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Ss(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function cy(e,t,i,s,o,c){var h=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var p=e.entanglements,b=e.expirationTimes,_=e.hiddenUpdates;for(i=h&~i;0<i;){var C=31-xt(i),D=1<<C;p[C]=0,b[C]=-1;var A=_[C];if(A!==null)for(_[C]=null,C=0;C<A.length;C++){var O=A[C];O!==null&&(O.lane&=-536870913)}i&=~D}s!==0&&mu(e,s,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(h&~t))}function mu(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-xt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function yu(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-xt(i),o=1<<s;o&t|e[s]&t&&(e[s]|=t),i&=~o}}function gu(e,t){var i=t&-t;return i=(i&42)!==0?1:hr(i),(i&(e.suspendedLanes|t))!==0?0:i}function hr(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 dr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function vu(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:sp(e.type))}function bu(e,t){var i=$.p;try{return $.p=e,t()}finally{$.p=i}}var Nn=Math.random().toString(36).slice(2),at="__reactFiber$"+Nn,pt="__reactProps$"+Nn,ki="__reactContainer$"+Nn,pr="__reactEvents$"+Nn,uy="__reactListeners$"+Nn,fy="__reactHandles$"+Nn,wu="__reactResources$"+Nn,xs="__reactMarker$"+Nn;function mr(e){delete e[at],delete e[pt],delete e[pr],delete e[uy],delete e[fy]}function Ti(e){var t=e[at];if(t)return t;for(var i=e.parentNode;i;){if(t=i[ki]||i[at]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=Yd(e);e!==null;){if(i=e[at])return i;e=Yd(e)}return t}e=i,i=e.parentNode}return null}function _i(e){if(e=e[at]||e[ki]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Es(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function Ai(e){var t=e[wu];return t||(t=e[wu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function tt(e){e[xs]=!0}var Su=new Set,xu={};function si(e,t){Ni(e,t),Ni(e+"Capture",t)}function Ni(e,t){for(xu[e]=t,e=0;e<t.length;e++)Su.add(t[e])}var hy=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]*$"),Eu={},ku={};function dy(e){return Y.call(ku,e)?!0:Y.call(Eu,e)?!1:hy.test(e)?ku[e]=!0:(Eu[e]=!0,!1)}function Ra(e,t,i){if(dy(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function za(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function on(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+s)}}function Rt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Tu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function py(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var o=s.get,c=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(h){i=""+h,c.call(this,h)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(h){i=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yr(e){if(!e._valueTracker){var t=Tu(e)?"checked":"value";e._valueTracker=py(e,t,""+e[t])}}function _u(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=Tu(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function Ma(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var my=/[\n"\\]/g;function zt(e){return e.replace(my,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function gr(e,t,i,s,o,c,h,p){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Rt(t)):e.value!==""+Rt(t)&&(e.value=""+Rt(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?vr(e,h,Rt(t)):i!=null?vr(e,h,Rt(i)):s!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+Rt(p):e.removeAttribute("name")}function Au(e,t,i,s,o,c,h,p){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||i!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){yr(e);return}i=i!=null?""+Rt(i):"",t=t!=null?""+Rt(t):i,p||t===e.value||(e.value=t),e.defaultValue=t}s=s??o,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=p?e.checked:!!s,e.defaultChecked=!!s,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),yr(e)}function vr(e,t,i){t==="number"&&Ma(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Oi(e,t,i,s){if(e=e.options,t){t={};for(var o=0;o<i.length;o++)t["$"+i[o]]=!0;for(i=0;i<e.length;i++)o=t.hasOwnProperty("$"+e[i].value),e[i].selected!==o&&(e[i].selected=o),o&&s&&(e[i].defaultSelected=!0)}else{for(i=""+Rt(i),t=null,o=0;o<e.length;o++){if(e[o].value===i){e[o].selected=!0,s&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Nu(e,t,i){if(t!=null&&(t=""+Rt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Rt(i):""}function Ou(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(l(92));if(V(s)){if(1<s.length)throw Error(l(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=Rt(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),yr(e)}function ji(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var yy=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 ju(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||yy.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function Ru(e,t,i){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var o in t)s=t[o],t.hasOwnProperty(o)&&i[o]!==s&&ju(e,o,s)}else for(var c in t)t.hasOwnProperty(c)&&ju(e,c,t[c])}function br(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 gy=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),vy=/^[\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 Ca(e){return vy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function cn(){}var wr=null;function Sr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ri=null,zi=null;function zu(e){var t=_i(e);if(t&&(e=t.stateNode)){var i=e[pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(gr(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+zt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var o=s[pt]||null;if(!o)throw Error(l(90));gr(s,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&_u(s)}break e;case"textarea":Nu(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Oi(e,!!i.multiple,t,!1)}}}var xr=!1;function Mu(e,t,i){if(xr)return e(t,i);xr=!0;try{var s=e(t);return s}finally{if(xr=!1,(Ri!==null||zi!==null)&&(Sl(),Ri&&(t=Ri,e=zi,zi=Ri=null,zu(t),e)))for(t=0;t<e.length;t++)zu(e[t])}}function ks(e,t){var i=e.stateNode;if(i===null)return null;var s=i[pt]||null;if(s===null)return null;i=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(l(231,t,typeof i));return i}var un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Er=!1;if(un)try{var Ts={};Object.defineProperty(Ts,"passive",{get:function(){Er=!0}}),window.addEventListener("test",Ts,Ts),window.removeEventListener("test",Ts,Ts)}catch{Er=!1}var On=null,kr=null,Ua=null;function Cu(){if(Ua)return Ua;var e,t=kr,i=t.length,s,o="value"in On?On.value:On.textContent,c=o.length;for(e=0;e<i&&t[e]===o[e];e++);var h=i-e;for(s=1;s<=h&&t[i-s]===o[c-s];s++);return Ua=o.slice(e,1<s?1-s:void 0)}function Da(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 Ba(){return!0}function Uu(){return!1}function mt(e){function t(i,s,o,c,h){this._reactName=i,this._targetInst=o,this.type=s,this.nativeEvent=c,this.target=h,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(i=e[p],this[p]=i?i(c):c[p]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Ba:Uu,this.isPropagationStopped=Uu,this}return w(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Ba)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Ba)},persist:function(){},isPersistent:Ba}),t}var ai={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qa=mt(ai),_s=w({},ai,{view:0,detail:0}),by=mt(_s),Tr,_r,As,La=w({},_s,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nr,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!==As&&(As&&e.type==="mousemove"?(Tr=e.screenX-As.screenX,_r=e.screenY-As.screenY):_r=Tr=0,As=e),Tr)},movementY:function(e){return"movementY"in e?e.movementY:_r}}),Du=mt(La),wy=w({},La,{dataTransfer:0}),Sy=mt(wy),xy=w({},_s,{relatedTarget:0}),Ar=mt(xy),Ey=w({},ai,{animationName:0,elapsedTime:0,pseudoElement:0}),ky=mt(Ey),Ty=w({},ai,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_y=mt(Ty),Ay=w({},ai,{data:0}),Bu=mt(Ay),Ny={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Oy={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"},jy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ry(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jy[e])?!!t[e]:!1}function Nr(){return Ry}var zy=w({},_s,{key:function(e){if(e.key){var t=Ny[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Da(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Oy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nr,charCode:function(e){return e.type==="keypress"?Da(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Da(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),My=mt(zy),Cy=w({},La,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qu=mt(Cy),Uy=w({},_s,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nr}),Dy=mt(Uy),By=w({},ai,{propertyName:0,elapsedTime:0,pseudoElement:0}),qy=mt(By),Ly=w({},La,{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}),Hy=mt(Ly),$y=w({},ai,{newState:0,oldState:0}),Yy=mt($y),Vy=[9,13,27,32],Or=un&&"CompositionEvent"in window,Ns=null;un&&"documentMode"in document&&(Ns=document.documentMode);var Xy=un&&"TextEvent"in window&&!Ns,Lu=un&&(!Or||Ns&&8<Ns&&11>=Ns),Hu=" ",$u=!1;function Yu(e,t){switch(e){case"keyup":return Vy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Mi=!1;function Gy(e,t){switch(e){case"compositionend":return Vu(t);case"keypress":return t.which!==32?null:($u=!0,Hu);case"textInput":return e=t.data,e===Hu&&$u?null:e;default:return null}}function Qy(e,t){if(Mi)return e==="compositionend"||!Or&&Yu(e,t)?(e=Cu(),Ua=kr=On=null,Mi=!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 Lu&&t.locale!=="ko"?null:t.data;default:return null}}var Ky={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 Xu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ky[e.type]:t==="textarea"}function Gu(e,t,i,s){Ri?zi?zi.push(s):zi=[s]:Ri=s,t=Nl(t,"onChange"),0<t.length&&(i=new qa("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var Os=null,js=null;function Zy(e){Nd(e,0)}function Ha(e){var t=Es(e);if(_u(t))return e}function Qu(e,t){if(e==="change")return t}var Ku=!1;if(un){var jr;if(un){var Rr="oninput"in document;if(!Rr){var Zu=document.createElement("div");Zu.setAttribute("oninput","return;"),Rr=typeof Zu.oninput=="function"}jr=Rr}else jr=!1;Ku=jr&&(!document.documentMode||9<document.documentMode)}function Ju(){Os&&(Os.detachEvent("onpropertychange",Fu),js=Os=null)}function Fu(e){if(e.propertyName==="value"&&Ha(js)){var t=[];Gu(t,js,e,Sr(e)),Mu(Zy,t)}}function Jy(e,t,i){e==="focusin"?(Ju(),Os=t,js=i,Os.attachEvent("onpropertychange",Fu)):e==="focusout"&&Ju()}function Fy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ha(js)}function Wy(e,t){if(e==="click")return Ha(t)}function Iy(e,t){if(e==="input"||e==="change")return Ha(t)}function Py(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Et=typeof Object.is=="function"?Object.is:Py;function Rs(e,t){if(Et(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var o=i[s];if(!Y.call(t,o)||!Et(e[o],t[o]))return!1}return!0}function Wu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Iu(e,t){var i=Wu(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Wu(i)}}function Pu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ef(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ma(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Ma(e.document)}return t}function zr(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 eg=un&&"documentMode"in document&&11>=document.documentMode,Ci=null,Mr=null,zs=null,Cr=!1;function tf(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Cr||Ci==null||Ci!==Ma(s)||(s=Ci,"selectionStart"in s&&zr(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),zs&&Rs(zs,s)||(zs=s,s=Nl(Mr,"onSelect"),0<s.length&&(t=new qa("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=Ci)))}function li(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ui={animationend:li("Animation","AnimationEnd"),animationiteration:li("Animation","AnimationIteration"),animationstart:li("Animation","AnimationStart"),transitionrun:li("Transition","TransitionRun"),transitionstart:li("Transition","TransitionStart"),transitioncancel:li("Transition","TransitionCancel"),transitionend:li("Transition","TransitionEnd")},Ur={},nf={};un&&(nf=document.createElement("div").style,"AnimationEvent"in window||(delete Ui.animationend.animation,delete Ui.animationiteration.animation,delete Ui.animationstart.animation),"TransitionEvent"in window||delete Ui.transitionend.transition);function ri(e){if(Ur[e])return Ur[e];if(!Ui[e])return e;var t=Ui[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in nf)return Ur[e]=t[i];return e}var sf=ri("animationend"),af=ri("animationiteration"),lf=ri("animationstart"),tg=ri("transitionrun"),ng=ri("transitionstart"),ig=ri("transitioncancel"),rf=ri("transitionend"),of=new Map,Dr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Dr.push("scrollEnd");function Yt(e,t){of.set(e,t),si(t,[e])}var $a=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)},Mt=[],Di=0,Br=0;function Ya(){for(var e=Di,t=Br=Di=0;t<e;){var i=Mt[t];Mt[t++]=null;var s=Mt[t];Mt[t++]=null;var o=Mt[t];Mt[t++]=null;var c=Mt[t];if(Mt[t++]=null,s!==null&&o!==null){var h=s.pending;h===null?o.next=o:(o.next=h.next,h.next=o),s.pending=o}c!==0&&cf(i,o,c)}}function Va(e,t,i,s){Mt[Di++]=e,Mt[Di++]=t,Mt[Di++]=i,Mt[Di++]=s,Br|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function qr(e,t,i,s){return Va(e,t,i,s),Xa(e)}function oi(e,t){return Va(e,null,null,t),Xa(e)}function cf(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var o=!1,c=e.return;c!==null;)c.childLanes|=i,s=c.alternate,s!==null&&(s.childLanes|=i),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(o=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,o&&t!==null&&(o=31-xt(i),e=c.hiddenUpdates,s=e[o],s===null?e[o]=[t]:s.push(t),t.lane=i|536870912),c):null}function Xa(e){if(50<ea)throw ea=0,Zo=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Bi={};function sg(e,t,i,s){this.tag=e,this.key=i,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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kt(e,t,i,s){return new sg(e,t,i,s)}function Lr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fn(e,t){var i=e.alternate;return i===null?(i=kt(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function uf(e,t){e.flags&=65011714;var i=e.alternate;return i===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=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ga(e,t,i,s,o,c){var h=0;if(s=e,typeof e=="function")Lr(e)&&(h=1);else if(typeof e=="string")h=cv(e,i,P.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ne:return e=kt(31,i,t,o),e.elementType=ne,e.lanes=c,e;case F:return ci(i.children,o,c,t);case ee:h=8,o|=24;break;case R:return e=kt(12,i,t,o|2),e.elementType=R,e.lanes=c,e;case M:return e=kt(13,i,t,o),e.elementType=M,e.lanes=c,e;case H:return e=kt(19,i,t,o),e.elementType=H,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case X:h=10;break e;case Z:h=9;break e;case N:h=11;break e;case B:h=14;break e;case Q:h=16,s=null;break e}h=29,i=Error(l(130,e===null?"null":typeof e,"")),s=null}return t=kt(h,i,t,o),t.elementType=e,t.type=s,t.lanes=c,t}function ci(e,t,i,s){return e=kt(7,e,s,t),e.lanes=i,e}function Hr(e,t,i){return e=kt(6,e,null,t),e.lanes=i,e}function ff(e){var t=kt(18,null,null,0);return t.stateNode=e,t}function $r(e,t,i){return t=kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var hf=new WeakMap;function Ct(e,t){if(typeof e=="object"&&e!==null){var i=hf.get(e);return i!==void 0?i:(t={value:e,source:t,stack:vs(t)},hf.set(e,t),t)}return{value:e,source:t,stack:vs(t)}}var qi=[],Li=0,Qa=null,Ms=0,Ut=[],Dt=0,jn=null,Wt=1,It="";function hn(e,t){qi[Li++]=Ms,qi[Li++]=Qa,Qa=e,Ms=t}function df(e,t,i){Ut[Dt++]=Wt,Ut[Dt++]=It,Ut[Dt++]=jn,jn=e;var s=Wt;e=It;var o=32-xt(s)-1;s&=~(1<<o),i+=1;var c=32-xt(t)+o;if(30<c){var h=o-o%5;c=(s&(1<<h)-1).toString(32),s>>=h,o-=h,Wt=1<<32-xt(t)+o|i<<o|s,It=c+e}else Wt=1<<c|i<<o|s,It=e}function Yr(e){e.return!==null&&(hn(e,1),df(e,1,0))}function Vr(e){for(;e===Qa;)Qa=qi[--Li],qi[Li]=null,Ms=qi[--Li],qi[Li]=null;for(;e===jn;)jn=Ut[--Dt],Ut[Dt]=null,It=Ut[--Dt],Ut[Dt]=null,Wt=Ut[--Dt],Ut[Dt]=null}function pf(e,t){Ut[Dt++]=Wt,Ut[Dt++]=It,Ut[Dt++]=jn,Wt=t.id,It=t.overflow,jn=e}var lt=null,Be=null,we=!1,Rn=null,Bt=!1,Xr=Error(l(519));function zn(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Cs(Ct(t,e)),Xr}function mf(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[at]=e,t[pt]=s,i){case"dialog":ge("cancel",t),ge("close",t);break;case"iframe":case"object":case"embed":ge("load",t);break;case"video":case"audio":for(i=0;i<na.length;i++)ge(na[i],t);break;case"source":ge("error",t);break;case"img":case"image":case"link":ge("error",t),ge("load",t);break;case"details":ge("toggle",t);break;case"input":ge("invalid",t),Au(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":ge("invalid",t);break;case"textarea":ge("invalid",t),Ou(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||zd(t.textContent,i)?(s.popover!=null&&(ge("beforetoggle",t),ge("toggle",t)),s.onScroll!=null&&ge("scroll",t),s.onScrollEnd!=null&&ge("scrollend",t),s.onClick!=null&&(t.onclick=cn),t=!0):t=!1,t||zn(e,!0)}function yf(e){for(lt=e.return;lt;)switch(lt.tag){case 5:case 31:case 13:Bt=!1;return;case 27:case 3:Bt=!0;return;default:lt=lt.return}}function Hi(e){if(e!==lt)return!1;if(!we)return yf(e),we=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||cc(e.type,e.memoizedProps)),i=!i),i&&Be&&zn(e),yf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));Be=$d(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));Be=$d(e)}else t===27?(t=Be,Qn(e.type)?(e=pc,pc=null,Be=e):Be=t):Be=lt?Lt(e.stateNode.nextSibling):null;return!0}function ui(){Be=lt=null,we=!1}function Gr(){var e=Rn;return e!==null&&(bt===null?bt=e:bt.push.apply(bt,e),Rn=null),e}function Cs(e){Rn===null?Rn=[e]:Rn.push(e)}var Qr=S(null),fi=null,dn=null;function Mn(e,t,i){G(Qr,t._currentValue),t._currentValue=i}function pn(e){e._currentValue=Qr.current,q(Qr)}function Kr(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function Zr(e,t,i,s){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){var h=o.child;c=c.firstContext;e:for(;c!==null;){var p=c;c=o;for(var b=0;b<t.length;b++)if(p.context===t[b]){c.lanes|=i,p=c.alternate,p!==null&&(p.lanes|=i),Kr(c.return,i,e),s||(h=null);break e}c=p.next}}else if(o.tag===18){if(h=o.return,h===null)throw Error(l(341));h.lanes|=i,c=h.alternate,c!==null&&(c.lanes|=i),Kr(h,i,e),h=null}else h=o.child;if(h!==null)h.return=o;else for(h=o;h!==null;){if(h===e){h=null;break}if(o=h.sibling,o!==null){o.return=h.return,h=o;break}h=h.return}o=h}}function $i(e,t,i,s){e=null;for(var o=t,c=!1;o!==null;){if(!c){if((o.flags&524288)!==0)c=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var h=o.alternate;if(h===null)throw Error(l(387));if(h=h.memoizedProps,h!==null){var p=o.type;Et(o.pendingProps.value,h.value)||(e!==null?e.push(p):e=[p])}}else if(o===Ee.current){if(h=o.alternate,h===null)throw Error(l(387));h.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(ra):e=[ra])}o=o.return}e!==null&&Zr(t,e,i,s),t.flags|=262144}function Ka(e){for(e=e.firstContext;e!==null;){if(!Et(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function hi(e){fi=e,dn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function rt(e){return gf(fi,e)}function Za(e,t){return fi===null&&hi(e),gf(e,t)}function gf(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},dn===null){if(e===null)throw Error(l(308));dn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else dn=dn.next=t;return i}var ag=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},lg=r.unstable_scheduleCallback,rg=r.unstable_NormalPriority,Ke={$$typeof:X,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Jr(){return{controller:new ag,data:new Map,refCount:0}}function Us(e){e.refCount--,e.refCount===0&&lg(rg,function(){e.controller.abort()})}var Ds=null,Fr=0,Yi=0,Vi=null;function og(e,t){if(Ds===null){var i=Ds=[];Fr=0,Yi=ec(),Vi={status:"pending",value:void 0,then:function(s){i.push(s)}}}return Fr++,t.then(vf,vf),t}function vf(){if(--Fr===0&&Ds!==null){Vi!==null&&(Vi.status="fulfilled");var e=Ds;Ds=null,Yi=0,Vi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function cg(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(o){i.push(o)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var o=0;o<i.length;o++)(0,i[o])(t)},function(o){for(s.status="rejected",s.reason=o,o=0;o<i.length;o++)(0,i[o])(void 0)}),s}var bf=k.S;k.S=function(e,t){nd=Qe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&og(e,t),bf!==null&&bf(e,t)};var di=S(null);function Wr(){var e=di.current;return e!==null?e:Ue.pooledCache}function Ja(e,t){t===null?G(di,di.current):G(di,t.pool)}function wf(){var e=Wr();return e===null?null:{parent:Ke._currentValue,pool:e}}var Xi=Error(l(460)),Ir=Error(l(474)),Fa=Error(l(542)),Wa={then:function(){}};function Sf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function xf(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(cn,cn),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,kf(e),e;default:if(typeof t.status=="string")t.then(cn,cn);else{if(e=Ue,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=s}},function(s){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,kf(e),e}throw mi=t,Xi}}function pi(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(mi=i,Xi):i}}var mi=null;function Ef(){if(mi===null)throw Error(l(459));var e=mi;return mi=null,e}function kf(e){if(e===Xi||e===Fa)throw Error(l(483))}var Gi=null,Bs=0;function Ia(e){var t=Bs;return Bs+=1,Gi===null&&(Gi=[]),xf(Gi,e,t)}function qs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Pa(e,t){throw t.$$typeof===j?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Tf(e){function t(E,x){if(e){var T=E.deletions;T===null?(E.deletions=[x],E.flags|=16):T.push(x)}}function i(E,x){if(!e)return null;for(;x!==null;)t(E,x),x=x.sibling;return null}function s(E){for(var x=new Map;E!==null;)E.key!==null?x.set(E.key,E):x.set(E.index,E),E=E.sibling;return x}function o(E,x){return E=fn(E,x),E.index=0,E.sibling=null,E}function c(E,x,T){return E.index=T,e?(T=E.alternate,T!==null?(T=T.index,T<x?(E.flags|=67108866,x):T):(E.flags|=67108866,x)):(E.flags|=1048576,x)}function h(E){return e&&E.alternate===null&&(E.flags|=67108866),E}function p(E,x,T,U){return x===null||x.tag!==6?(x=Hr(T,E.mode,U),x.return=E,x):(x=o(x,T),x.return=E,x)}function b(E,x,T,U){var ie=T.type;return ie===F?C(E,x,T.props.children,U,T.key):x!==null&&(x.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===Q&&pi(ie)===x.type)?(x=o(x,T.props),qs(x,T),x.return=E,x):(x=Ga(T.type,T.key,T.props,null,E.mode,U),qs(x,T),x.return=E,x)}function _(E,x,T,U){return x===null||x.tag!==4||x.stateNode.containerInfo!==T.containerInfo||x.stateNode.implementation!==T.implementation?(x=$r(T,E.mode,U),x.return=E,x):(x=o(x,T.children||[]),x.return=E,x)}function C(E,x,T,U,ie){return x===null||x.tag!==7?(x=ci(T,E.mode,U,ie),x.return=E,x):(x=o(x,T),x.return=E,x)}function D(E,x,T){if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return x=Hr(""+x,E.mode,T),x.return=E,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case L:return T=Ga(x.type,x.key,x.props,null,E.mode,T),qs(T,x),T.return=E,T;case K:return x=$r(x,E.mode,T),x.return=E,x;case Q:return x=pi(x),D(E,x,T)}if(V(x)||oe(x))return x=ci(x,E.mode,T,null),x.return=E,x;if(typeof x.then=="function")return D(E,Ia(x),T);if(x.$$typeof===X)return D(E,Za(E,x),T);Pa(E,x)}return null}function A(E,x,T,U){var ie=x!==null?x.key:null;if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return ie!==null?null:p(E,x,""+T,U);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case L:return T.key===ie?b(E,x,T,U):null;case K:return T.key===ie?_(E,x,T,U):null;case Q:return T=pi(T),A(E,x,T,U)}if(V(T)||oe(T))return ie!==null?null:C(E,x,T,U,null);if(typeof T.then=="function")return A(E,x,Ia(T),U);if(T.$$typeof===X)return A(E,x,Za(E,T),U);Pa(E,T)}return null}function O(E,x,T,U,ie){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return E=E.get(T)||null,p(x,E,""+U,ie);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case L:return E=E.get(U.key===null?T:U.key)||null,b(x,E,U,ie);case K:return E=E.get(U.key===null?T:U.key)||null,_(x,E,U,ie);case Q:return U=pi(U),O(E,x,T,U,ie)}if(V(U)||oe(U))return E=E.get(T)||null,C(x,E,U,ie,null);if(typeof U.then=="function")return O(E,x,T,Ia(U),ie);if(U.$$typeof===X)return O(E,x,T,Za(x,U),ie);Pa(x,U)}return null}function I(E,x,T,U){for(var ie=null,ke=null,te=x,de=x=0,be=null;te!==null&&de<T.length;de++){te.index>de?(be=te,te=null):be=te.sibling;var Te=A(E,te,T[de],U);if(Te===null){te===null&&(te=be);break}e&&te&&Te.alternate===null&&t(E,te),x=c(Te,x,de),ke===null?ie=Te:ke.sibling=Te,ke=Te,te=be}if(de===T.length)return i(E,te),we&&hn(E,de),ie;if(te===null){for(;de<T.length;de++)te=D(E,T[de],U),te!==null&&(x=c(te,x,de),ke===null?ie=te:ke.sibling=te,ke=te);return we&&hn(E,de),ie}for(te=s(te);de<T.length;de++)be=O(te,E,de,T[de],U),be!==null&&(e&&be.alternate!==null&&te.delete(be.key===null?de:be.key),x=c(be,x,de),ke===null?ie=be:ke.sibling=be,ke=be);return e&&te.forEach(function(Wn){return t(E,Wn)}),we&&hn(E,de),ie}function le(E,x,T,U){if(T==null)throw Error(l(151));for(var ie=null,ke=null,te=x,de=x=0,be=null,Te=T.next();te!==null&&!Te.done;de++,Te=T.next()){te.index>de?(be=te,te=null):be=te.sibling;var Wn=A(E,te,Te.value,U);if(Wn===null){te===null&&(te=be);break}e&&te&&Wn.alternate===null&&t(E,te),x=c(Wn,x,de),ke===null?ie=Wn:ke.sibling=Wn,ke=Wn,te=be}if(Te.done)return i(E,te),we&&hn(E,de),ie;if(te===null){for(;!Te.done;de++,Te=T.next())Te=D(E,Te.value,U),Te!==null&&(x=c(Te,x,de),ke===null?ie=Te:ke.sibling=Te,ke=Te);return we&&hn(E,de),ie}for(te=s(te);!Te.done;de++,Te=T.next())Te=O(te,E,de,Te.value,U),Te!==null&&(e&&Te.alternate!==null&&te.delete(Te.key===null?de:Te.key),x=c(Te,x,de),ke===null?ie=Te:ke.sibling=Te,ke=Te);return e&&te.forEach(function(wv){return t(E,wv)}),we&&hn(E,de),ie}function Me(E,x,T,U){if(typeof T=="object"&&T!==null&&T.type===F&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case L:e:{for(var ie=T.key;x!==null;){if(x.key===ie){if(ie=T.type,ie===F){if(x.tag===7){i(E,x.sibling),U=o(x,T.props.children),U.return=E,E=U;break e}}else if(x.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===Q&&pi(ie)===x.type){i(E,x.sibling),U=o(x,T.props),qs(U,T),U.return=E,E=U;break e}i(E,x);break}else t(E,x);x=x.sibling}T.type===F?(U=ci(T.props.children,E.mode,U,T.key),U.return=E,E=U):(U=Ga(T.type,T.key,T.props,null,E.mode,U),qs(U,T),U.return=E,E=U)}return h(E);case K:e:{for(ie=T.key;x!==null;){if(x.key===ie)if(x.tag===4&&x.stateNode.containerInfo===T.containerInfo&&x.stateNode.implementation===T.implementation){i(E,x.sibling),U=o(x,T.children||[]),U.return=E,E=U;break e}else{i(E,x);break}else t(E,x);x=x.sibling}U=$r(T,E.mode,U),U.return=E,E=U}return h(E);case Q:return T=pi(T),Me(E,x,T,U)}if(V(T))return I(E,x,T,U);if(oe(T)){if(ie=oe(T),typeof ie!="function")throw Error(l(150));return T=ie.call(T),le(E,x,T,U)}if(typeof T.then=="function")return Me(E,x,Ia(T),U);if(T.$$typeof===X)return Me(E,x,Za(E,T),U);Pa(E,T)}return typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint"?(T=""+T,x!==null&&x.tag===6?(i(E,x.sibling),U=o(x,T),U.return=E,E=U):(i(E,x),U=Hr(T,E.mode,U),U.return=E,E=U),h(E)):i(E,x)}return function(E,x,T,U){try{Bs=0;var ie=Me(E,x,T,U);return Gi=null,ie}catch(te){if(te===Xi||te===Fa)throw te;var ke=kt(29,te,null,E.mode);return ke.lanes=U,ke.return=E,ke}}}var yi=Tf(!0),_f=Tf(!1),Cn=!1;function Pr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function eo(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 Un(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Dn(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ae&2)!==0){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,t=Xa(e),cf(e,null,i),t}return Va(e,s,t,i),Xa(e)}function Ls(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,yu(e,i)}}function to(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var o=null,c=null;if(i=i.firstBaseUpdate,i!==null){do{var h={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};c===null?o=c=h:c=c.next=h,i=i.next}while(i!==null);c===null?o=c=t:c=c.next=t}else o=c=t;i={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var no=!1;function Hs(){if(no){var e=Vi;if(e!==null)throw e}}function $s(e,t,i,s){no=!1;var o=e.updateQueue;Cn=!1;var c=o.firstBaseUpdate,h=o.lastBaseUpdate,p=o.shared.pending;if(p!==null){o.shared.pending=null;var b=p,_=b.next;b.next=null,h===null?c=_:h.next=_,h=b;var C=e.alternate;C!==null&&(C=C.updateQueue,p=C.lastBaseUpdate,p!==h&&(p===null?C.firstBaseUpdate=_:p.next=_,C.lastBaseUpdate=b))}if(c!==null){var D=o.baseState;h=0,C=_=b=null,p=c;do{var A=p.lane&-536870913,O=A!==p.lane;if(O?(ve&A)===A:(s&A)===A){A!==0&&A===Yi&&(no=!0),C!==null&&(C=C.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var I=e,le=p;A=t;var Me=i;switch(le.tag){case 1:if(I=le.payload,typeof I=="function"){D=I.call(Me,D,A);break e}D=I;break e;case 3:I.flags=I.flags&-65537|128;case 0:if(I=le.payload,A=typeof I=="function"?I.call(Me,D,A):I,A==null)break e;D=w({},D,A);break e;case 2:Cn=!0}}A=p.callback,A!==null&&(e.flags|=64,O&&(e.flags|=8192),O=o.callbacks,O===null?o.callbacks=[A]:O.push(A))}else O={lane:A,tag:p.tag,payload:p.payload,callback:p.callback,next:null},C===null?(_=C=O,b=D):C=C.next=O,h|=A;if(p=p.next,p===null){if(p=o.shared.pending,p===null)break;O=p,p=O.next,O.next=null,o.lastBaseUpdate=O,o.shared.pending=null}}while(!0);C===null&&(b=D),o.baseState=b,o.firstBaseUpdate=_,o.lastBaseUpdate=C,c===null&&(o.shared.lanes=0),$n|=h,e.lanes=h,e.memoizedState=D}}function Af(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Nf(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Af(i[e],t)}var Qi=S(null),el=S(0);function Of(e,t){e=En,G(el,e),G(Qi,t),En=e|t.baseLanes}function io(){G(el,En),G(Qi,Qi.current)}function so(){En=el.current,q(Qi),q(el)}var Tt=S(null),qt=null;function Bn(e){var t=e.alternate;G(Ye,Ye.current&1),G(Tt,e),qt===null&&(t===null||Qi.current!==null||t.memoizedState!==null)&&(qt=e)}function ao(e){G(Ye,Ye.current),G(Tt,e),qt===null&&(qt=e)}function jf(e){e.tag===22?(G(Ye,Ye.current),G(Tt,e),qt===null&&(qt=e)):qn()}function qn(){G(Ye,Ye.current),G(Tt,Tt.current)}function _t(e){q(Tt),qt===e&&(qt=null),q(Ye)}var Ye=S(0);function tl(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||hc(i)||dc(i)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var mn=0,fe=null,Re=null,Ze=null,nl=!1,Ki=!1,gi=!1,il=0,Ys=0,Zi=null,ug=0;function He(){throw Error(l(321))}function lo(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Et(e[i],t[i]))return!1;return!0}function ro(e,t,i,s,o,c){return mn=c,fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?dh:Eo,gi=!1,c=i(s,o),gi=!1,Ki&&(c=zf(t,i,s,o)),Rf(e),c}function Rf(e){k.H=Gs;var t=Re!==null&&Re.next!==null;if(mn=0,Ze=Re=fe=null,nl=!1,Ys=0,Zi=null,t)throw Error(l(300));e===null||Je||(e=e.dependencies,e!==null&&Ka(e)&&(Je=!0))}function zf(e,t,i,s){fe=e;var o=0;do{if(Ki&&(Zi=null),Ys=0,Ki=!1,25<=o)throw Error(l(301));if(o+=1,Ze=Re=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}k.H=ph,c=t(i,s)}while(Ki);return c}function fg(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?Vs(t):t,e=e.useState()[0],(Re!==null?Re.memoizedState:null)!==e&&(fe.flags|=1024),t}function oo(){var e=il!==0;return il=0,e}function co(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function uo(e){if(nl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}nl=!1}mn=0,Ze=Re=fe=null,Ki=!1,Ys=il=0,Zi=null}function ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ze===null?fe.memoizedState=Ze=e:Ze=Ze.next=e,Ze}function Ve(){if(Re===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=Re.next;var t=Ze===null?fe.memoizedState:Ze.next;if(t!==null)Ze=t,Re=e;else{if(e===null)throw fe.alternate===null?Error(l(467)):Error(l(310));Re=e,e={memoizedState:Re.memoizedState,baseState:Re.baseState,baseQueue:Re.baseQueue,queue:Re.queue,next:null},Ze===null?fe.memoizedState=Ze=e:Ze=Ze.next=e}return Ze}function sl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Vs(e){var t=Ys;return Ys+=1,Zi===null&&(Zi=[]),e=xf(Zi,e,t),t=fe,(Ze===null?t.memoizedState:Ze.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?dh:Eo),e}function al(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Vs(e);if(e.$$typeof===X)return rt(e)}throw Error(l(438,String(e)))}function fo(e){var t=null,i=fe.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=fe.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=sl(),fe.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=se;return t.index++,i}function yn(e,t){return typeof t=="function"?t(e):t}function ll(e){var t=Ve();return ho(t,Re,e)}function ho(e,t,i){var s=e.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=i;var o=e.baseQueue,c=s.pending;if(c!==null){if(o!==null){var h=o.next;o.next=c.next,c.next=h}t.baseQueue=o=c,s.pending=null}if(c=e.baseState,o===null)e.memoizedState=c;else{t=o.next;var p=h=null,b=null,_=t,C=!1;do{var D=_.lane&-536870913;if(D!==_.lane?(ve&D)===D:(mn&D)===D){var A=_.revertLane;if(A===0)b!==null&&(b=b.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),D===Yi&&(C=!0);else if((mn&A)===A){_=_.next,A===Yi&&(C=!0);continue}else D={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},b===null?(p=b=D,h=c):b=b.next=D,fe.lanes|=A,$n|=A;D=_.action,gi&&i(c,D),c=_.hasEagerState?_.eagerState:i(c,D)}else A={lane:D,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},b===null?(p=b=A,h=c):b=b.next=A,fe.lanes|=D,$n|=D;_=_.next}while(_!==null&&_!==t);if(b===null?h=c:b.next=p,!Et(c,e.memoizedState)&&(Je=!0,C&&(i=Vi,i!==null)))throw i;e.memoizedState=c,e.baseState=h,e.baseQueue=b,s.lastRenderedState=c}return o===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function po(e){var t=Ve(),i=t.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=e;var s=i.dispatch,o=i.pending,c=t.memoizedState;if(o!==null){i.pending=null;var h=o=o.next;do c=e(c,h.action),h=h.next;while(h!==o);Et(c,t.memoizedState)||(Je=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),i.lastRenderedState=c}return[c,s]}function Mf(e,t,i){var s=fe,o=Ve(),c=we;if(c){if(i===void 0)throw Error(l(407));i=i()}else i=t();var h=!Et((Re||o).memoizedState,i);if(h&&(o.memoizedState=i,Je=!0),o=o.queue,go(Df.bind(null,s,o,e),[e]),o.getSnapshot!==t||h||Ze!==null&&Ze.memoizedState.tag&1){if(s.flags|=2048,Ji(9,{destroy:void 0},Uf.bind(null,s,o,i,t),null),Ue===null)throw Error(l(349));c||(mn&127)!==0||Cf(s,t,i)}return i}function Cf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=fe.updateQueue,t===null?(t=sl(),fe.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Uf(e,t,i,s){t.value=i,t.getSnapshot=s,Bf(t)&&qf(e)}function Df(e,t,i){return i(function(){Bf(t)&&qf(e)})}function Bf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Et(e,i)}catch{return!0}}function qf(e){var t=oi(e,2);t!==null&&wt(t,e,2)}function mo(e){var t=ht();if(typeof e=="function"){var i=e;if(e=i(),gi){An(!0);try{i()}finally{An(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yn,lastRenderedState:e},t}function Lf(e,t,i,s){return e.baseState=i,ho(e,Re,typeof s=="function"?s:yn)}function hg(e,t,i,s,o){if(cl(e))throw Error(l(485));if(e=t.action,e!==null){var c={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){c.listeners.push(h)}};k.T!==null?i(!0):c.isTransition=!1,s(c),i=t.pending,i===null?(c.next=t.pending=c,Hf(t,c)):(c.next=i.next,t.pending=i.next=c)}}function Hf(e,t){var i=t.action,s=t.payload,o=e.state;if(t.isTransition){var c=k.T,h={};k.T=h;try{var p=i(o,s),b=k.S;b!==null&&b(h,p),$f(e,t,p)}catch(_){yo(e,t,_)}finally{c!==null&&h.types!==null&&(c.types=h.types),k.T=c}}else try{c=i(o,s),$f(e,t,c)}catch(_){yo(e,t,_)}}function $f(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){Yf(e,t,s)},function(s){return yo(e,t,s)}):Yf(e,t,i)}function Yf(e,t,i){t.status="fulfilled",t.value=i,Vf(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Hf(e,i)))}function yo(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,Vf(t),t=t.next;while(t!==s)}e.action=null}function Vf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xf(e,t){return t}function Gf(e,t){if(we){var i=Ue.formState;if(i!==null){e:{var s=fe;if(we){if(Be){t:{for(var o=Be,c=Bt;o.nodeType!==8;){if(!c){o=null;break t}if(o=Lt(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){Be=Lt(o.nextSibling),s=o.data==="F!";break e}}zn(s)}s=!1}s&&(t=i[0])}}return i=ht(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xf,lastRenderedState:t},i.queue=s,i=uh.bind(null,fe,s),s.dispatch=i,s=mo(!1),c=xo.bind(null,fe,!1,s.queue),s=ht(),o={state:t,dispatch:null,action:e,pending:null},s.queue=o,i=hg.bind(null,fe,o,c,i),o.dispatch=i,s.memoizedState=e,[t,i,!1]}function Qf(e){var t=Ve();return Kf(t,Re,e)}function Kf(e,t,i){if(t=ho(e,t,Xf)[0],e=ll(yn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Vs(t)}catch(h){throw h===Xi?Fa:h}else s=t;t=Ve();var o=t.queue,c=o.dispatch;return i!==t.memoizedState&&(fe.flags|=2048,Ji(9,{destroy:void 0},dg.bind(null,o,i),null)),[s,c,e]}function dg(e,t){e.action=t}function Zf(e){var t=Ve(),i=Re;if(i!==null)return Kf(t,i,e);Ve(),t=t.memoizedState,i=Ve();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function Ji(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=fe.updateQueue,t===null&&(t=sl(),fe.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function Jf(){return Ve().memoizedState}function rl(e,t,i,s){var o=ht();fe.flags|=e,o.memoizedState=Ji(1|t,{destroy:void 0},i,s===void 0?null:s)}function ol(e,t,i,s){var o=Ve();s=s===void 0?null:s;var c=o.memoizedState.inst;Re!==null&&s!==null&&lo(s,Re.memoizedState.deps)?o.memoizedState=Ji(t,c,i,s):(fe.flags|=e,o.memoizedState=Ji(1|t,c,i,s))}function Ff(e,t){rl(8390656,8,e,t)}function go(e,t){ol(2048,8,e,t)}function pg(e){fe.flags|=4;var t=fe.updateQueue;if(t===null)t=sl(),fe.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Wf(e){var t=Ve().memoizedState;return pg({ref:t,nextImpl:e}),function(){if((Ae&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function If(e,t){return ol(4,2,e,t)}function Pf(e,t){return ol(4,4,e,t)}function eh(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function th(e,t,i){i=i!=null?i.concat([e]):null,ol(4,4,eh.bind(null,t,e),i)}function vo(){}function nh(e,t){var i=Ve();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&lo(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function ih(e,t){var i=Ve();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&lo(t,s[1]))return s[0];if(s=e(),gi){An(!0);try{e()}finally{An(!1)}}return i.memoizedState=[s,t],s}function bo(e,t,i){return i===void 0||(mn&1073741824)!==0&&(ve&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=sd(),fe.lanes|=e,$n|=e,i)}function sh(e,t,i,s){return Et(i,t)?i:Qi.current!==null?(e=bo(e,i,s),Et(e,t)||(Je=!0),e):(mn&42)===0||(mn&1073741824)!==0&&(ve&261930)===0?(Je=!0,e.memoizedState=i):(e=sd(),fe.lanes|=e,$n|=e,t)}function ah(e,t,i,s,o){var c=$.p;$.p=c!==0&&8>c?c:8;var h=k.T,p={};k.T=p,xo(e,!1,t,i);try{var b=o(),_=k.S;if(_!==null&&_(p,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var C=cg(b,s);Xs(e,t,C,Ot(e))}else Xs(e,t,s,Ot(e))}catch(D){Xs(e,t,{then:function(){},status:"rejected",reason:D},Ot())}finally{$.p=c,h!==null&&p.types!==null&&(h.types=p.types),k.T=h}}function mg(){}function wo(e,t,i,s){if(e.tag!==5)throw Error(l(476));var o=lh(e).queue;ah(e,o,t,W,i===null?mg:function(){return rh(e),i(s)})}function lh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yn,lastRenderedState:W},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yn,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rh(e){var t=lh(e);t.next===null&&(t=e.alternate.memoizedState),Xs(e,t.next.queue,{},Ot())}function So(){return rt(ra)}function oh(){return Ve().memoizedState}function ch(){return Ve().memoizedState}function yg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Ot();e=Un(i);var s=Dn(t,e,i);s!==null&&(wt(s,t,i),Ls(s,t,i)),t={cache:Jr()},e.payload=t;return}t=t.return}}function gg(e,t,i){var s=Ot();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},cl(e)?fh(t,i):(i=qr(e,t,i,s),i!==null&&(wt(i,e,s),hh(i,t,s)))}function uh(e,t,i){var s=Ot();Xs(e,t,i,s)}function Xs(e,t,i,s){var o={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(cl(e))fh(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,p=c(h,i);if(o.hasEagerState=!0,o.eagerState=p,Et(p,h))return Va(e,t,o,0),Ue===null&&Ya(),!1}catch{}if(i=qr(e,t,o,s),i!==null)return wt(i,e,s),hh(i,t,s),!0}return!1}function xo(e,t,i,s){if(s={lane:2,revertLane:ec(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},cl(e)){if(t)throw Error(l(479))}else t=qr(e,i,s,2),t!==null&&wt(t,e,2)}function cl(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function fh(e,t){Ki=nl=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function hh(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,yu(e,i)}}var Gs={readContext:rt,use:al,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useLayoutEffect:He,useInsertionEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useSyncExternalStore:He,useId:He,useHostTransitionStatus:He,useFormState:He,useActionState:He,useOptimistic:He,useMemoCache:He,useCacheRefresh:He};Gs.useEffectEvent=He;var dh={readContext:rt,use:al,useCallback:function(e,t){return ht().memoizedState=[e,t===void 0?null:t],e},useContext:rt,useEffect:Ff,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,rl(4194308,4,eh.bind(null,t,e),i)},useLayoutEffect:function(e,t){return rl(4194308,4,e,t)},useInsertionEffect:function(e,t){rl(4,2,e,t)},useMemo:function(e,t){var i=ht();t=t===void 0?null:t;var s=e();if(gi){An(!0);try{e()}finally{An(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=ht();if(i!==void 0){var o=i(t);if(gi){An(!0);try{i(t)}finally{An(!1)}}}else o=t;return s.memoizedState=s.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},s.queue=e,e=e.dispatch=gg.bind(null,fe,e),[s.memoizedState,e]},useRef:function(e){var t=ht();return e={current:e},t.memoizedState=e},useState:function(e){e=mo(e);var t=e.queue,i=uh.bind(null,fe,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:vo,useDeferredValue:function(e,t){var i=ht();return bo(i,e,t)},useTransition:function(){var e=mo(!1);return e=ah.bind(null,fe,e.queue,!0,!1),ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=fe,o=ht();if(we){if(i===void 0)throw Error(l(407));i=i()}else{if(i=t(),Ue===null)throw Error(l(349));(ve&127)!==0||Cf(s,t,i)}o.memoizedState=i;var c={value:i,getSnapshot:t};return o.queue=c,Ff(Df.bind(null,s,c,e),[e]),s.flags|=2048,Ji(9,{destroy:void 0},Uf.bind(null,s,c,i,t),null),i},useId:function(){var e=ht(),t=Ue.identifierPrefix;if(we){var i=It,s=Wt;i=(s&~(1<<32-xt(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=il++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=ug++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:So,useFormState:Gf,useActionState:Gf,useOptimistic:function(e){var t=ht();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=xo.bind(null,fe,!0,i),i.dispatch=t,[e,t]},useMemoCache:fo,useCacheRefresh:function(){return ht().memoizedState=yg.bind(null,fe)},useEffectEvent:function(e){var t=ht(),i={impl:e};return t.memoizedState=i,function(){if((Ae&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Eo={readContext:rt,use:al,useCallback:nh,useContext:rt,useEffect:go,useImperativeHandle:th,useInsertionEffect:If,useLayoutEffect:Pf,useMemo:ih,useReducer:ll,useRef:Jf,useState:function(){return ll(yn)},useDebugValue:vo,useDeferredValue:function(e,t){var i=Ve();return sh(i,Re.memoizedState,e,t)},useTransition:function(){var e=ll(yn)[0],t=Ve().memoizedState;return[typeof e=="boolean"?e:Vs(e),t]},useSyncExternalStore:Mf,useId:oh,useHostTransitionStatus:So,useFormState:Qf,useActionState:Qf,useOptimistic:function(e,t){var i=Ve();return Lf(i,Re,e,t)},useMemoCache:fo,useCacheRefresh:ch};Eo.useEffectEvent=Wf;var ph={readContext:rt,use:al,useCallback:nh,useContext:rt,useEffect:go,useImperativeHandle:th,useInsertionEffect:If,useLayoutEffect:Pf,useMemo:ih,useReducer:po,useRef:Jf,useState:function(){return po(yn)},useDebugValue:vo,useDeferredValue:function(e,t){var i=Ve();return Re===null?bo(i,e,t):sh(i,Re.memoizedState,e,t)},useTransition:function(){var e=po(yn)[0],t=Ve().memoizedState;return[typeof e=="boolean"?e:Vs(e),t]},useSyncExternalStore:Mf,useId:oh,useHostTransitionStatus:So,useFormState:Zf,useActionState:Zf,useOptimistic:function(e,t){var i=Ve();return Re!==null?Lf(i,Re,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:fo,useCacheRefresh:ch};ph.useEffectEvent=Wf;function ko(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:w({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var To={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=Ot(),o=Un(s);o.payload=t,i!=null&&(o.callback=i),t=Dn(e,o,s),t!==null&&(wt(t,e,s),Ls(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=Ot(),o=Un(s);o.tag=1,o.payload=t,i!=null&&(o.callback=i),t=Dn(e,o,s),t!==null&&(wt(t,e,s),Ls(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Ot(),s=Un(i);s.tag=2,t!=null&&(s.callback=t),t=Dn(e,s,i),t!==null&&(wt(t,e,i),Ls(t,e,i))}};function mh(e,t,i,s,o,c,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,c,h):t.prototype&&t.prototype.isPureReactComponent?!Rs(i,s)||!Rs(o,c):!0}function yh(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&To.enqueueReplaceState(t,t.state,null)}function vi(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=w({},i));for(var o in e)i[o]===void 0&&(i[o]=e[o])}return i}function gh(e){$a(e)}function vh(e){console.error(e)}function bh(e){$a(e)}function ul(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function wh(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function _o(e,t,i){return i=Un(i),i.tag=3,i.payload={element:null},i.callback=function(){ul(e,t)},i}function Sh(e){return e=Un(e),e.tag=3,e}function xh(e,t,i,s){var o=i.type.getDerivedStateFromError;if(typeof o=="function"){var c=s.value;e.payload=function(){return o(c)},e.callback=function(){wh(t,i,s)}}var h=i.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){wh(t,i,s),typeof o!="function"&&(Yn===null?Yn=new Set([this]):Yn.add(this));var p=s.stack;this.componentDidCatch(s.value,{componentStack:p!==null?p:""})})}function vg(e,t,i,s,o){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&$i(t,i,o,!0),i=Tt.current,i!==null){switch(i.tag){case 31:case 13:return qt===null?xl():i.alternate===null&&$e===0&&($e=3),i.flags&=-257,i.flags|=65536,i.lanes=o,s===Wa?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),Wo(e,s,o)),!1;case 22:return i.flags|=65536,s===Wa?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),Wo(e,s,o)),!1}throw Error(l(435,i.tag))}return Wo(e,s,o),xl(),!1}if(we)return t=Tt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,s!==Xr&&(e=Error(l(422),{cause:s}),Cs(Ct(e,i)))):(s!==Xr&&(t=Error(l(423),{cause:s}),Cs(Ct(t,i))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,s=Ct(s,i),o=_o(e.stateNode,s,o),to(e,o),$e!==4&&($e=2)),!1;var c=Error(l(520),{cause:s});if(c=Ct(c,i),Ps===null?Ps=[c]:Ps.push(c),$e!==4&&($e=2),t===null)return!0;s=Ct(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=o&-o,i.lanes|=e,e=_o(i.stateNode,s,e),to(i,e),!1;case 1:if(t=i.type,c=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Yn===null||!Yn.has(c))))return i.flags|=65536,o&=-o,i.lanes|=o,o=Sh(o),xh(o,e,i,s),to(i,o),!1}i=i.return}while(i!==null);return!1}var Ao=Error(l(461)),Je=!1;function ot(e,t,i,s){t.child=e===null?_f(t,null,i,s):yi(t,e.child,i,s)}function Eh(e,t,i,s,o){i=i.render;var c=t.ref;if("ref"in s){var h={};for(var p in s)p!=="ref"&&(h[p]=s[p])}else h=s;return hi(t),s=ro(e,t,i,h,c,o),p=oo(),e!==null&&!Je?(co(e,t,o),gn(e,t,o)):(we&&p&&Yr(t),t.flags|=1,ot(e,t,s,o),t.child)}function kh(e,t,i,s,o){if(e===null){var c=i.type;return typeof c=="function"&&!Lr(c)&&c.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=c,Th(e,t,c,s,o)):(e=Ga(i.type,null,s,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Uo(e,o)){var h=c.memoizedProps;if(i=i.compare,i=i!==null?i:Rs,i(h,s)&&e.ref===t.ref)return gn(e,t,o)}return t.flags|=1,e=fn(c,s),e.ref=t.ref,e.return=t,t.child=e}function Th(e,t,i,s,o){if(e!==null){var c=e.memoizedProps;if(Rs(c,s)&&e.ref===t.ref)if(Je=!1,t.pendingProps=s=c,Uo(e,o))(e.flags&131072)!==0&&(Je=!0);else return t.lanes=e.lanes,gn(e,t,o)}return No(e,t,i,s,o)}function _h(e,t,i,s){var o=s.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|i:i,e!==null){for(s=t.child=e.child,o=0;s!==null;)o=o|s.lanes|s.childLanes,s=s.sibling;s=o&~c}else s=0,t.child=null;return Ah(e,t,c,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ja(t,c!==null?c.cachePool:null),c!==null?Of(t,c):io(),jf(t);else return s=t.lanes=536870912,Ah(e,t,c!==null?c.baseLanes|i:i,i,s)}else c!==null?(Ja(t,c.cachePool),Of(t,c),qn(),t.memoizedState=null):(e!==null&&Ja(t,null),io(),qn());return ot(e,t,o,i),t.child}function Qs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ah(e,t,i,s,o){var c=Wr();return c=c===null?null:{parent:Ke._currentValue,pool:c},t.memoizedState={baseLanes:i,cachePool:c},e!==null&&Ja(t,null),io(),jf(t),e!==null&&$i(e,t,s,!0),t.childLanes=o,null}function fl(e,t){return t=dl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Nh(e,t,i){return yi(t,e.child,null,i),e=fl(t,t.pendingProps),e.flags|=2,_t(t),t.memoizedState=null,e}function bg(e,t,i){var s=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(we){if(s.mode==="hidden")return e=fl(t,s),t.lanes=536870912,Qs(null,e);if(ao(t),(e=Be)?(e=Hd(e,Bt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jn!==null?{id:Wt,overflow:It}:null,retryLane:536870912,hydrationErrors:null},i=ff(e),i.return=t,t.child=i,lt=t,Be=null)):e=null,e===null)throw zn(t);return t.lanes=536870912,null}return fl(t,s)}var c=e.memoizedState;if(c!==null){var h=c.dehydrated;if(ao(t),o)if(t.flags&256)t.flags&=-257,t=Nh(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(Je||$i(e,t,i,!1),o=(i&e.childLanes)!==0,Je||o){if(s=Ue,s!==null&&(h=gu(s,i),h!==0&&h!==c.retryLane))throw c.retryLane=h,oi(e,h),wt(s,e,h),Ao;xl(),t=Nh(e,t,i)}else e=c.treeContext,Be=Lt(h.nextSibling),lt=t,we=!0,Rn=null,Bt=!1,e!==null&&pf(t,e),t=fl(t,s),t.flags|=4096;return t}return e=fn(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function hl(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function No(e,t,i,s,o){return hi(t),i=ro(e,t,i,s,void 0,o),s=oo(),e!==null&&!Je?(co(e,t,o),gn(e,t,o)):(we&&s&&Yr(t),t.flags|=1,ot(e,t,i,o),t.child)}function Oh(e,t,i,s,o,c){return hi(t),t.updateQueue=null,i=zf(t,s,i,o),Rf(e),s=oo(),e!==null&&!Je?(co(e,t,c),gn(e,t,c)):(we&&s&&Yr(t),t.flags|=1,ot(e,t,i,c),t.child)}function jh(e,t,i,s,o){if(hi(t),t.stateNode===null){var c=Bi,h=i.contextType;typeof h=="object"&&h!==null&&(c=rt(h)),c=new i(s,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=To,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=s,c.state=t.memoizedState,c.refs={},Pr(t),h=i.contextType,c.context=typeof h=="object"&&h!==null?rt(h):Bi,c.state=t.memoizedState,h=i.getDerivedStateFromProps,typeof h=="function"&&(ko(t,i,h,s),c.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(h=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),h!==c.state&&To.enqueueReplaceState(c,c.state,null),$s(t,s,c,o),Hs(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){c=t.stateNode;var p=t.memoizedProps,b=vi(i,p);c.props=b;var _=c.context,C=i.contextType;h=Bi,typeof C=="object"&&C!==null&&(h=rt(C));var D=i.getDerivedStateFromProps;C=typeof D=="function"||typeof c.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,C||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(p||_!==h)&&yh(t,c,s,h),Cn=!1;var A=t.memoizedState;c.state=A,$s(t,s,c,o),Hs(),_=t.memoizedState,p||A!==_||Cn?(typeof D=="function"&&(ko(t,i,D,s),_=t.memoizedState),(b=Cn||mh(t,i,b,s,A,_,h))?(C||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=s,t.memoizedState=_),c.props=s,c.state=_,c.context=h,s=b):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{c=t.stateNode,eo(e,t),h=t.memoizedProps,C=vi(i,h),c.props=C,D=t.pendingProps,A=c.context,_=i.contextType,b=Bi,typeof _=="object"&&_!==null&&(b=rt(_)),p=i.getDerivedStateFromProps,(_=typeof p=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==D||A!==b)&&yh(t,c,s,b),Cn=!1,A=t.memoizedState,c.state=A,$s(t,s,c,o),Hs();var O=t.memoizedState;h!==D||A!==O||Cn||e!==null&&e.dependencies!==null&&Ka(e.dependencies)?(typeof p=="function"&&(ko(t,i,p,s),O=t.memoizedState),(C=Cn||mh(t,i,C,s,A,O,b)||e!==null&&e.dependencies!==null&&Ka(e.dependencies))?(_||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(s,O,b),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(s,O,b)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=O),c.props=s,c.state=O,c.context=b,s=C):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),s=!1)}return c=s,hl(e,t),s=(t.flags&128)!==0,c||s?(c=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&s?(t.child=yi(t,e.child,null,o),t.child=yi(t,null,i,o)):ot(e,t,i,o),t.memoizedState=c.state,e=t.child):e=gn(e,t,o),e}function Rh(e,t,i,s){return ui(),t.flags|=256,ot(e,t,i,s),t.child}var Oo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jo(e){return{baseLanes:e,cachePool:wf()}}function Ro(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Nt),e}function zh(e,t,i){var s=t.pendingProps,o=!1,c=(t.flags&128)!==0,h;if((h=c)||(h=e!==null&&e.memoizedState===null?!1:(Ye.current&2)!==0),h&&(o=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(we){if(o?Bn(t):qn(),(e=Be)?(e=Hd(e,Bt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jn!==null?{id:Wt,overflow:It}:null,retryLane:536870912,hydrationErrors:null},i=ff(e),i.return=t,t.child=i,lt=t,Be=null)):e=null,e===null)throw zn(t);return dc(e)?t.lanes=32:t.lanes=536870912,null}var p=s.children;return s=s.fallback,o?(qn(),o=t.mode,p=dl({mode:"hidden",children:p},o),s=ci(s,o,i,null),p.return=t,s.return=t,p.sibling=s,t.child=p,s=t.child,s.memoizedState=jo(i),s.childLanes=Ro(e,h,i),t.memoizedState=Oo,Qs(null,s)):(Bn(t),zo(t,p))}var b=e.memoizedState;if(b!==null&&(p=b.dehydrated,p!==null)){if(c)t.flags&256?(Bn(t),t.flags&=-257,t=Mo(e,t,i)):t.memoizedState!==null?(qn(),t.child=e.child,t.flags|=128,t=null):(qn(),p=s.fallback,o=t.mode,s=dl({mode:"visible",children:s.children},o),p=ci(p,o,i,null),p.flags|=2,s.return=t,p.return=t,s.sibling=p,t.child=s,yi(t,e.child,null,i),s=t.child,s.memoizedState=jo(i),s.childLanes=Ro(e,h,i),t.memoizedState=Oo,t=Qs(null,s));else if(Bn(t),dc(p)){if(h=p.nextSibling&&p.nextSibling.dataset,h)var _=h.dgst;h=_,s=Error(l(419)),s.stack="",s.digest=h,Cs({value:s,source:null,stack:null}),t=Mo(e,t,i)}else if(Je||$i(e,t,i,!1),h=(i&e.childLanes)!==0,Je||h){if(h=Ue,h!==null&&(s=gu(h,i),s!==0&&s!==b.retryLane))throw b.retryLane=s,oi(e,s),wt(h,e,s),Ao;hc(p)||xl(),t=Mo(e,t,i)}else hc(p)?(t.flags|=192,t.child=e.child,t=null):(e=b.treeContext,Be=Lt(p.nextSibling),lt=t,we=!0,Rn=null,Bt=!1,e!==null&&pf(t,e),t=zo(t,s.children),t.flags|=4096);return t}return o?(qn(),p=s.fallback,o=t.mode,b=e.child,_=b.sibling,s=fn(b,{mode:"hidden",children:s.children}),s.subtreeFlags=b.subtreeFlags&65011712,_!==null?p=fn(_,p):(p=ci(p,o,i,null),p.flags|=2),p.return=t,s.return=t,s.sibling=p,t.child=s,Qs(null,s),s=t.child,p=e.child.memoizedState,p===null?p=jo(i):(o=p.cachePool,o!==null?(b=Ke._currentValue,o=o.parent!==b?{parent:b,pool:b}:o):o=wf(),p={baseLanes:p.baseLanes|i,cachePool:o}),s.memoizedState=p,s.childLanes=Ro(e,h,i),t.memoizedState=Oo,Qs(e.child,s)):(Bn(t),i=e.child,e=i.sibling,i=fn(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=i,t.memoizedState=null,i)}function zo(e,t){return t=dl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function dl(e,t){return e=kt(22,e,null,t),e.lanes=0,e}function Mo(e,t,i){return yi(t,e.child,null,i),e=zo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Mh(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Kr(e.return,t,i)}function Co(e,t,i,s,o,c){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:o,treeForkCount:c}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=s,h.tail=i,h.tailMode=o,h.treeForkCount=c)}function Ch(e,t,i){var s=t.pendingProps,o=s.revealOrder,c=s.tail;s=s.children;var h=Ye.current,p=(h&2)!==0;if(p?(h=h&1|2,t.flags|=128):h&=1,G(Ye,h),ot(e,t,s,i),s=we?Ms:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Mh(e,i,t);else if(e.tag===19)Mh(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(i=t.child,o=null;i!==null;)e=i.alternate,e!==null&&tl(e)===null&&(o=i),i=i.sibling;i=o,i===null?(o=t.child,t.child=null):(o=i.sibling,i.sibling=null),Co(t,!1,o,i,c,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&tl(e)===null){t.child=o;break}e=o.sibling,o.sibling=i,i=o,o=e}Co(t,!0,i,null,c,s);break;case"together":Co(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function gn(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),$n|=t.lanes,(i&t.childLanes)===0)if(e!==null){if($i(e,t,i,!1),(i&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,i=fn(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=fn(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Uo(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ka(e)))}function wg(e,t,i){switch(t.tag){case 3:it(t,t.stateNode.containerInfo),Mn(t,Ke,e.memoizedState.cache),ui();break;case 27:case 5:ti(t);break;case 4:it(t,t.stateNode.containerInfo);break;case 10:Mn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ao(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Bn(t),t.flags|=128,null):(i&t.child.childLanes)!==0?zh(e,t,i):(Bn(t),e=gn(e,t,i),e!==null?e.sibling:null);Bn(t);break;case 19:var o=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||($i(e,t,i,!1),s=(i&t.childLanes)!==0),o){if(s)return Ch(e,t,i);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),G(Ye,Ye.current),s)break;return null;case 22:return t.lanes=0,_h(e,t,i,t.pendingProps);case 24:Mn(t,Ke,e.memoizedState.cache)}return gn(e,t,i)}function Uh(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Je=!0;else{if(!Uo(e,i)&&(t.flags&128)===0)return Je=!1,wg(e,t,i);Je=(e.flags&131072)!==0}else Je=!1,we&&(t.flags&1048576)!==0&&df(t,Ms,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=pi(t.elementType),t.type=e,typeof e=="function")Lr(e)?(s=vi(e,s),t.tag=1,t=jh(null,t,e,s,i)):(t.tag=0,t=No(null,t,e,s,i));else{if(e!=null){var o=e.$$typeof;if(o===N){t.tag=11,t=Eh(null,t,e,s,i);break e}else if(o===B){t.tag=14,t=kh(null,t,e,s,i);break e}}throw t=Ge(e)||e,Error(l(306,t,""))}}return t;case 0:return No(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,o=vi(s,t.pendingProps),jh(e,t,s,o,i);case 3:e:{if(it(t,t.stateNode.containerInfo),e===null)throw Error(l(387));s=t.pendingProps;var c=t.memoizedState;o=c.element,eo(e,t),$s(t,s,null,i);var h=t.memoizedState;if(s=h.cache,Mn(t,Ke,s),s!==c.cache&&Zr(t,[Ke],i,!0),Hs(),s=h.element,c.isDehydrated)if(c={element:s,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=Rh(e,t,s,i);break e}else if(s!==o){o=Ct(Error(l(424)),t),Cs(o),t=Rh(e,t,s,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Be=Lt(e.firstChild),lt=t,we=!0,Rn=null,Bt=!0,i=_f(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(ui(),s===o){t=gn(e,t,i);break e}ot(e,t,s,i)}t=t.child}return t;case 26:return hl(e,t),e===null?(i=Qd(t.type,null,t.pendingProps,null))?t.memoizedState=i:we||(i=t.type,e=t.pendingProps,s=Ol(he.current).createElement(i),s[at]=t,s[pt]=e,ct(s,i,e),tt(s),t.stateNode=s):t.memoizedState=Qd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ti(t),e===null&&we&&(s=t.stateNode=Vd(t.type,t.pendingProps,he.current),lt=t,Bt=!0,o=Be,Qn(t.type)?(pc=o,Be=Lt(s.firstChild)):Be=o),ot(e,t,t.pendingProps.children,i),hl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&we&&((o=s=Be)&&(s=Fg(s,t.type,t.pendingProps,Bt),s!==null?(t.stateNode=s,lt=t,Be=Lt(s.firstChild),Bt=!1,o=!0):o=!1),o||zn(t)),ti(t),o=t.type,c=t.pendingProps,h=e!==null?e.memoizedProps:null,s=c.children,cc(o,c)?s=null:h!==null&&cc(o,h)&&(t.flags|=32),t.memoizedState!==null&&(o=ro(e,t,fg,null,null,i),ra._currentValue=o),hl(e,t),ot(e,t,s,i),t.child;case 6:return e===null&&we&&((e=i=Be)&&(i=Wg(i,t.pendingProps,Bt),i!==null?(t.stateNode=i,lt=t,Be=null,e=!0):e=!1),e||zn(t)),null;case 13:return zh(e,t,i);case 4:return it(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=yi(t,null,s,i):ot(e,t,s,i),t.child;case 11:return Eh(e,t,t.type,t.pendingProps,i);case 7:return ot(e,t,t.pendingProps,i),t.child;case 8:return ot(e,t,t.pendingProps.children,i),t.child;case 12:return ot(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,Mn(t,t.type,s.value),ot(e,t,s.children,i),t.child;case 9:return o=t.type._context,s=t.pendingProps.children,hi(t),o=rt(o),s=s(o),t.flags|=1,ot(e,t,s,i),t.child;case 14:return kh(e,t,t.type,t.pendingProps,i);case 15:return Th(e,t,t.type,t.pendingProps,i);case 19:return Ch(e,t,i);case 31:return bg(e,t,i);case 22:return _h(e,t,i,t.pendingProps);case 24:return hi(t),s=rt(Ke),e===null?(o=Wr(),o===null&&(o=Ue,c=Jr(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=i),o=c),t.memoizedState={parent:s,cache:o},Pr(t),Mn(t,Ke,o)):((e.lanes&i)!==0&&(eo(e,t),$s(t,null,null,i),Hs()),o=e.memoizedState,c=t.memoizedState,o.parent!==s?(o={parent:s,cache:s},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),Mn(t,Ke,s)):(s=c.cache,Mn(t,Ke,s),s!==o.cache&&Zr(t,[Ke],i,!0))),ot(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function vn(e){e.flags|=4}function Do(e,t,i,s,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(od())e.flags|=8192;else throw mi=Wa,Ir}else e.flags&=-16777217}function Dh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Wd(t))if(od())e.flags|=8192;else throw mi=Wa,Ir}function pl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?pu():536870912,e.lanes|=t,Pi|=t)}function Ks(e,t){if(!we)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var o=e.child;o!==null;)i|=o.lanes|o.childLanes,s|=o.subtreeFlags&65011712,s|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)i|=o.lanes|o.childLanes,s|=o.subtreeFlags,s|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function Sg(e,t,i){var s=t.pendingProps;switch(Vr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(t),null;case 1:return qe(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),pn(Ke),Ce(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?vn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Gr())),qe(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(vn(t),c!==null?(qe(t),Dh(t,c)):(qe(t),Do(t,o,null,s,i))):c?c!==e.memoizedState?(vn(t),qe(t),Dh(t,c)):(qe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&vn(t),qe(t),Do(t,o,e,s,i)),null;case 27:if(Jt(t),i=he.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&vn(t);else{if(!s){if(t.stateNode===null)throw Error(l(166));return qe(t),null}e=P.current,Hi(t)?mf(t):(e=Vd(o,s,i),t.stateNode=e,vn(t))}return qe(t),null;case 5:if(Jt(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&vn(t);else{if(!s){if(t.stateNode===null)throw Error(l(166));return qe(t),null}if(c=P.current,Hi(t))mf(t);else{var h=Ol(he.current);switch(c){case 1:c=h.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:c=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":c=h.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":c=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":c=h.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof s.is=="string"?h.createElement("select",{is:s.is}):h.createElement("select"),s.multiple?c.multiple=!0:s.size&&(c.size=s.size);break;default:c=typeof s.is=="string"?h.createElement(o,{is:s.is}):h.createElement(o)}}c[at]=t,c[pt]=s;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)c.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=c;e:switch(ct(c,o,s),o){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&vn(t)}}return qe(t),Do(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&vn(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(l(166));if(e=he.current,Hi(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,o=lt,o!==null)switch(o.tag){case 27:case 5:s=o.memoizedProps}e[at]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||zd(e.nodeValue,i)),e||zn(t,!0)}else e=Ol(e).createTextNode(s),e[at]=t,t.stateNode=e}return qe(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Hi(t),i!==null){if(e===null){if(!s)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[at]=t}else ui(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),e=!1}else i=Gr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(_t(t),t):(_t(t),null);if((t.flags&128)!==0)throw Error(l(558))}return qe(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Hi(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(l(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(l(317));o[at]=t}else ui(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),o=!1}else o=Gr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(_t(t),t):(_t(t),null)}return _t(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,o=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(o=s.alternate.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==o&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),pl(t,t.updateQueue),qe(t),null);case 4:return Ce(),e===null&&sc(t.stateNode.containerInfo),qe(t),null;case 10:return pn(t.type),qe(t),null;case 19:if(q(Ye),s=t.memoizedState,s===null)return qe(t),null;if(o=(t.flags&128)!==0,c=s.rendering,c===null)if(o)Ks(s,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=tl(e),c!==null){for(t.flags|=128,Ks(s,!1),e=c.updateQueue,t.updateQueue=e,pl(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)uf(i,e),i=i.sibling;return G(Ye,Ye.current&1|2),we&&hn(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Qe()>bl&&(t.flags|=128,o=!0,Ks(s,!1),t.lanes=4194304)}else{if(!o)if(e=tl(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,pl(t,e),Ks(s,!0),s.tail===null&&s.tailMode==="hidden"&&!c.alternate&&!we)return qe(t),null}else 2*Qe()-s.renderingStartTime>bl&&i!==536870912&&(t.flags|=128,o=!0,Ks(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(e=s.last,e!==null?e.sibling=c:t.child=c,s.last=c)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Qe(),e.sibling=null,i=Ye.current,G(Ye,o?i&1|2:i&1),we&&hn(t,s.treeForkCount),e):(qe(t),null);case 22:case 23:return _t(t),so(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),i=t.updateQueue,i!==null&&pl(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&q(di),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),pn(Ke),qe(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function xg(e,t){switch(Vr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pn(Ke),Ce(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Jt(t),null;case 31:if(t.memoizedState!==null){if(_t(t),t.alternate===null)throw Error(l(340));ui()}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));ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(Ye),null;case 4:return Ce(),null;case 10:return pn(t.type),null;case 22:case 23:return _t(t),so(),e!==null&&q(di),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return pn(Ke),null;case 25:return null;default:return null}}function Bh(e,t){switch(Vr(t),t.tag){case 3:pn(Ke),Ce();break;case 26:case 27:case 5:Jt(t);break;case 4:Ce();break;case 31:t.memoizedState!==null&&_t(t);break;case 13:_t(t);break;case 19:q(Ye);break;case 10:pn(t.type);break;case 22:case 23:_t(t),so(),e!==null&&q(di);break;case 24:pn(Ke)}}function Zs(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var o=s.next;i=o;do{if((i.tag&e)===e){s=void 0;var c=i.create,h=i.inst;s=c(),h.destroy=s}i=i.next}while(i!==o)}}catch(p){Oe(t,t.return,p)}}function Ln(e,t,i){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var c=o.next;s=c;do{if((s.tag&e)===e){var h=s.inst,p=h.destroy;if(p!==void 0){h.destroy=void 0,o=t;var b=i,_=p;try{_()}catch(C){Oe(o,b,C)}}}s=s.next}while(s!==c)}}catch(C){Oe(t,t.return,C)}}function qh(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Nf(t,i)}catch(s){Oe(e,e.return,s)}}}function Lh(e,t,i){i.props=vi(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){Oe(e,t,s)}}function Js(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(o){Oe(e,t,o)}}function Pt(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(o){Oe(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(o){Oe(e,t,o)}else i.current=null}function Hh(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(o){Oe(e,e.return,o)}}function Bo(e,t,i){try{var s=e.stateNode;Xg(s,e.type,i,t),s[pt]=t}catch(o){Oe(e,e.return,o)}}function $h(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qn(e.type)||e.tag===4}function qo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$h(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&&Qn(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 Lo(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=cn));else if(s!==4&&(s===27&&Qn(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Lo(e,t,i),e=e.sibling;e!==null;)Lo(e,t,i),e=e.sibling}function ml(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(s!==4&&(s===27&&Qn(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(ml(e,t,i),e=e.sibling;e!==null;)ml(e,t,i),e=e.sibling}function Yh(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);ct(t,s,i),t[at]=e,t[pt]=i}catch(c){Oe(e,e.return,c)}}var bn=!1,Fe=!1,Ho=!1,Vh=typeof WeakSet=="function"?WeakSet:Set,nt=null;function Eg(e,t){if(e=e.containerInfo,rc=Dl,e=ef(e),zr(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var o=s.anchorOffset,c=s.focusNode;s=s.focusOffset;try{i.nodeType,c.nodeType}catch{i=null;break e}var h=0,p=-1,b=-1,_=0,C=0,D=e,A=null;t:for(;;){for(var O;D!==i||o!==0&&D.nodeType!==3||(p=h+o),D!==c||s!==0&&D.nodeType!==3||(b=h+s),D.nodeType===3&&(h+=D.nodeValue.length),(O=D.firstChild)!==null;)A=D,D=O;for(;;){if(D===e)break t;if(A===i&&++_===o&&(p=h),A===c&&++C===s&&(b=h),(O=D.nextSibling)!==null)break;D=A,A=D.parentNode}D=O}i=p===-1||b===-1?null:{start:p,end:b}}else i=null}i=i||{start:0,end:0}}else i=null;for(oc={focusedElem:e,selectionRange:i},Dl=!1,nt=t;nt!==null;)if(t=nt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,nt=e;else for(;nt!==null;){switch(t=nt,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)o=e[i],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,i=t,o=c.memoizedProps,c=c.memoizedState,s=i.stateNode;try{var I=vi(i.type,o);e=s.getSnapshotBeforeUpdate(I,c),s.__reactInternalSnapshotBeforeUpdate=e}catch(le){Oe(i,i.return,le)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)fc(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":fc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=t.sibling,e!==null){e.return=t.return,nt=e;break}nt=t.return}}function Xh(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:Sn(e,i),s&4&&Zs(5,i);break;case 1:if(Sn(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(h){Oe(i,i.return,h)}else{var o=vi(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Oe(i,i.return,h)}}s&64&&qh(i),s&512&&Js(i,i.return);break;case 3:if(Sn(e,i),s&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{Nf(e,t)}catch(h){Oe(i,i.return,h)}}break;case 27:t===null&&s&4&&Yh(i);case 26:case 5:Sn(e,i),t===null&&s&4&&Hh(i),s&512&&Js(i,i.return);break;case 12:Sn(e,i);break;case 31:Sn(e,i),s&4&&Kh(e,i);break;case 13:Sn(e,i),s&4&&Zh(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=zg.bind(null,i),Ig(e,i))));break;case 22:if(s=i.memoizedState!==null||bn,!s){t=t!==null&&t.memoizedState!==null||Fe,o=bn;var c=Fe;bn=s,(Fe=t)&&!c?xn(e,i,(i.subtreeFlags&8772)!==0):Sn(e,i),bn=o,Fe=c}break;case 30:break;default:Sn(e,i)}}function Gh(e){var t=e.alternate;t!==null&&(e.alternate=null,Gh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mr(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 Le=null,yt=!1;function wn(e,t,i){for(i=i.child;i!==null;)Qh(e,t,i),i=i.sibling}function Qh(e,t,i){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(bs,i)}catch{}switch(i.tag){case 26:Fe||Pt(i,t),wn(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Fe||Pt(i,t);var s=Le,o=yt;Qn(i.type)&&(Le=i.stateNode,yt=!1),wn(e,t,i),sa(i.stateNode),Le=s,yt=o;break;case 5:Fe||Pt(i,t);case 6:if(s=Le,o=yt,Le=null,wn(e,t,i),Le=s,yt=o,Le!==null)if(yt)try{(Le.nodeType===9?Le.body:Le.nodeName==="HTML"?Le.ownerDocument.body:Le).removeChild(i.stateNode)}catch(c){Oe(i,t,c)}else try{Le.removeChild(i.stateNode)}catch(c){Oe(i,t,c)}break;case 18:Le!==null&&(yt?(e=Le,qd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),rs(e)):qd(Le,i.stateNode));break;case 4:s=Le,o=yt,Le=i.stateNode.containerInfo,yt=!0,wn(e,t,i),Le=s,yt=o;break;case 0:case 11:case 14:case 15:Ln(2,i,t),Fe||Ln(4,i,t),wn(e,t,i);break;case 1:Fe||(Pt(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&Lh(i,t,s)),wn(e,t,i);break;case 21:wn(e,t,i);break;case 22:Fe=(s=Fe)||i.memoizedState!==null,wn(e,t,i),Fe=s;break;default:wn(e,t,i)}}function Kh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{rs(e)}catch(i){Oe(t,t.return,i)}}}function Zh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{rs(e)}catch(i){Oe(t,t.return,i)}}function kg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Vh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Vh),t;default:throw Error(l(435,e.tag))}}function yl(e,t){var i=kg(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var o=Mg.bind(null,e,s);s.then(o,o)}})}function gt(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var o=i[s],c=e,h=t,p=h;e:for(;p!==null;){switch(p.tag){case 27:if(Qn(p.type)){Le=p.stateNode,yt=!1;break e}break;case 5:Le=p.stateNode,yt=!1;break e;case 3:case 4:Le=p.stateNode.containerInfo,yt=!0;break e}p=p.return}if(Le===null)throw Error(l(160));Qh(c,h,o),Le=null,yt=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Jh(t,e),t=t.sibling}var Vt=null;function Jh(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gt(t,e),vt(e),s&4&&(Ln(3,e,e.return),Zs(3,e),Ln(5,e,e.return));break;case 1:gt(t,e),vt(e),s&512&&(Fe||i===null||Pt(i,i.return)),s&64&&bn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?s:i.concat(s))));break;case 26:var o=Vt;if(gt(t,e),vt(e),s&512&&(Fe||i===null||Pt(i,i.return)),s&4){var c=i!==null?i.memoizedState:null;if(s=e.memoizedState,i===null)if(s===null)if(e.stateNode===null){e:{s=e.type,i=e.memoizedProps,o=o.ownerDocument||o;t:switch(s){case"title":c=o.getElementsByTagName("title")[0],(!c||c[xs]||c[at]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(s),o.head.insertBefore(c,o.querySelector("head > title"))),ct(c,s,i),c[at]=e,tt(c),s=c;break e;case"link":var h=Jd("link","href",o).get(s+(i.href||""));if(h){for(var p=0;p<h.length;p++)if(c=h[p],c.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&c.getAttribute("rel")===(i.rel==null?null:i.rel)&&c.getAttribute("title")===(i.title==null?null:i.title)&&c.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){h.splice(p,1);break t}}c=o.createElement(s),ct(c,s,i),o.head.appendChild(c);break;case"meta":if(h=Jd("meta","content",o).get(s+(i.content||""))){for(p=0;p<h.length;p++)if(c=h[p],c.getAttribute("content")===(i.content==null?null:""+i.content)&&c.getAttribute("name")===(i.name==null?null:i.name)&&c.getAttribute("property")===(i.property==null?null:i.property)&&c.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&c.getAttribute("charset")===(i.charSet==null?null:i.charSet)){h.splice(p,1);break t}}c=o.createElement(s),ct(c,s,i),o.head.appendChild(c);break;default:throw Error(l(468,s))}c[at]=e,tt(c),s=c}e.stateNode=s}else Fd(o,e.type,e.stateNode);else e.stateNode=Zd(o,s,e.memoizedProps);else c!==s?(c===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):c.count--,s===null?Fd(o,e.type,e.stateNode):Zd(o,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Bo(e,e.memoizedProps,i.memoizedProps)}break;case 27:gt(t,e),vt(e),s&512&&(Fe||i===null||Pt(i,i.return)),i!==null&&s&4&&Bo(e,e.memoizedProps,i.memoizedProps);break;case 5:if(gt(t,e),vt(e),s&512&&(Fe||i===null||Pt(i,i.return)),e.flags&32){o=e.stateNode;try{ji(o,"")}catch(I){Oe(e,e.return,I)}}s&4&&e.stateNode!=null&&(o=e.memoizedProps,Bo(e,o,i!==null?i.memoizedProps:o)),s&1024&&(Ho=!0);break;case 6:if(gt(t,e),vt(e),s&4){if(e.stateNode===null)throw Error(l(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(I){Oe(e,e.return,I)}}break;case 3:if(zl=null,o=Vt,Vt=jl(t.containerInfo),gt(t,e),Vt=o,vt(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{rs(t.containerInfo)}catch(I){Oe(e,e.return,I)}Ho&&(Ho=!1,Fh(e));break;case 4:s=Vt,Vt=jl(e.stateNode.containerInfo),gt(t,e),vt(e),Vt=s;break;case 12:gt(t,e),vt(e);break;case 31:gt(t,e),vt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,yl(e,s)));break;case 13:gt(t,e),vt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(vl=Qe()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,yl(e,s)));break;case 22:o=e.memoizedState!==null;var b=i!==null&&i.memoizedState!==null,_=bn,C=Fe;if(bn=_||o,Fe=C||b,gt(t,e),Fe=C,bn=_,vt(e),s&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(i===null||b||bn||Fe||bi(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){b=i=t;try{if(c=b.stateNode,o)h=c.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{p=b.stateNode;var D=b.memoizedProps.style,A=D!=null&&D.hasOwnProperty("display")?D.display:null;p.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch(I){Oe(b,b.return,I)}}}else if(t.tag===6){if(i===null){b=t;try{b.stateNode.nodeValue=o?"":b.memoizedProps}catch(I){Oe(b,b.return,I)}}}else if(t.tag===18){if(i===null){b=t;try{var O=b.stateNode;o?Ld(O,!0):Ld(b.stateNode,!1)}catch(I){Oe(b,b.return,I)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,yl(e,i))));break;case 19:gt(t,e),vt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,yl(e,s)));break;case 30:break;case 21:break;default:gt(t,e),vt(e)}}function vt(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if($h(s)){i=s;break}s=s.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var o=i.stateNode,c=qo(e);ml(e,c,o);break;case 5:var h=i.stateNode;i.flags&32&&(ji(h,""),i.flags&=-33);var p=qo(e);ml(e,p,h);break;case 3:case 4:var b=i.stateNode.containerInfo,_=qo(e);Lo(e,_,b);break;default:throw Error(l(161))}}catch(C){Oe(e,e.return,C)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Fh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Sn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Xh(e,t.alternate,t),t=t.sibling}function bi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ln(4,t,t.return),bi(t);break;case 1:Pt(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&Lh(t,t.return,i),bi(t);break;case 27:sa(t.stateNode);case 26:case 5:Pt(t,t.return),bi(t);break;case 22:t.memoizedState===null&&bi(t);break;case 30:bi(t);break;default:bi(t)}e=e.sibling}}function xn(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,o=e,c=t,h=c.flags;switch(c.tag){case 0:case 11:case 15:xn(o,c,i),Zs(4,c);break;case 1:if(xn(o,c,i),s=c,o=s.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(_){Oe(s,s.return,_)}if(s=c,o=s.updateQueue,o!==null){var p=s.stateNode;try{var b=o.shared.hiddenCallbacks;if(b!==null)for(o.shared.hiddenCallbacks=null,o=0;o<b.length;o++)Af(b[o],p)}catch(_){Oe(s,s.return,_)}}i&&h&64&&qh(c),Js(c,c.return);break;case 27:Yh(c);case 26:case 5:xn(o,c,i),i&&s===null&&h&4&&Hh(c),Js(c,c.return);break;case 12:xn(o,c,i);break;case 31:xn(o,c,i),i&&h&4&&Kh(o,c);break;case 13:xn(o,c,i),i&&h&4&&Zh(o,c);break;case 22:c.memoizedState===null&&xn(o,c,i),Js(c,c.return);break;case 30:break;default:xn(o,c,i)}t=t.sibling}}function $o(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Us(i))}function Yo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Us(e))}function Xt(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Wh(e,t,i,s),t=t.sibling}function Wh(e,t,i,s){var o=t.flags;switch(t.tag){case 0:case 11:case 15:Xt(e,t,i,s),o&2048&&Zs(9,t);break;case 1:Xt(e,t,i,s);break;case 3:Xt(e,t,i,s),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Us(e)));break;case 12:if(o&2048){Xt(e,t,i,s),e=t.stateNode;try{var c=t.memoizedProps,h=c.id,p=c.onPostCommit;typeof p=="function"&&p(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(b){Oe(t,t.return,b)}}else Xt(e,t,i,s);break;case 31:Xt(e,t,i,s);break;case 13:Xt(e,t,i,s);break;case 23:break;case 22:c=t.stateNode,h=t.alternate,t.memoizedState!==null?c._visibility&2?Xt(e,t,i,s):Fs(e,t):c._visibility&2?Xt(e,t,i,s):(c._visibility|=2,Fi(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),o&2048&&$o(h,t);break;case 24:Xt(e,t,i,s),o&2048&&Yo(t.alternate,t);break;default:Xt(e,t,i,s)}}function Fi(e,t,i,s,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,h=t,p=i,b=s,_=h.flags;switch(h.tag){case 0:case 11:case 15:Fi(c,h,p,b,o),Zs(8,h);break;case 23:break;case 22:var C=h.stateNode;h.memoizedState!==null?C._visibility&2?Fi(c,h,p,b,o):Fs(c,h):(C._visibility|=2,Fi(c,h,p,b,o)),o&&_&2048&&$o(h.alternate,h);break;case 24:Fi(c,h,p,b,o),o&&_&2048&&Yo(h.alternate,h);break;default:Fi(c,h,p,b,o)}t=t.sibling}}function Fs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,o=s.flags;switch(s.tag){case 22:Fs(i,s),o&2048&&$o(s.alternate,s);break;case 24:Fs(i,s),o&2048&&Yo(s.alternate,s);break;default:Fs(i,s)}t=t.sibling}}var Ws=8192;function Wi(e,t,i){if(e.subtreeFlags&Ws)for(e=e.child;e!==null;)Ih(e,t,i),e=e.sibling}function Ih(e,t,i){switch(e.tag){case 26:Wi(e,t,i),e.flags&Ws&&e.memoizedState!==null&&uv(i,Vt,e.memoizedState,e.memoizedProps);break;case 5:Wi(e,t,i);break;case 3:case 4:var s=Vt;Vt=jl(e.stateNode.containerInfo),Wi(e,t,i),Vt=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Ws,Ws=16777216,Wi(e,t,i),Ws=s):Wi(e,t,i));break;default:Wi(e,t,i)}}function Ph(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 Is(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];nt=s,td(s,e)}Ph(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ed(e),e=e.sibling}function ed(e){switch(e.tag){case 0:case 11:case 15:Is(e),e.flags&2048&&Ln(9,e,e.return);break;case 3:Is(e);break;case 12:Is(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,gl(e)):Is(e);break;default:Is(e)}}function gl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];nt=s,td(s,e)}Ph(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ln(8,t,t.return),gl(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,gl(t));break;default:gl(t)}e=e.sibling}}function td(e,t){for(;nt!==null;){var i=nt;switch(i.tag){case 0:case 11:case 15:Ln(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Us(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,nt=s;else e:for(i=e;nt!==null;){s=nt;var o=s.sibling,c=s.return;if(Gh(s),s===i){nt=null;break e}if(o!==null){o.return=c,nt=o;break e}nt=c}}}var Tg={getCacheForType:function(e){var t=rt(Ke),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return rt(Ke).controller.signal}},_g=typeof WeakMap=="function"?WeakMap:Map,Ae=0,Ue=null,ye=null,ve=0,Ne=0,At=null,Hn=!1,Ii=!1,Vo=!1,En=0,$e=0,$n=0,wi=0,Xo=0,Nt=0,Pi=0,Ps=null,bt=null,Go=!1,vl=0,nd=0,bl=1/0,wl=null,Yn=null,Pe=0,Vn=null,es=null,kn=0,Qo=0,Ko=null,id=null,ea=0,Zo=null;function Ot(){return(Ae&2)!==0&&ve!==0?ve&-ve:k.T!==null?ec():vu()}function sd(){if(Nt===0)if((ve&536870912)===0||we){var e=Na;Na<<=1,(Na&3932160)===0&&(Na=262144),Nt=e}else Nt=536870912;return e=Tt.current,e!==null&&(e.flags|=32),Nt}function wt(e,t,i){(e===Ue&&(Ne===2||Ne===9)||e.cancelPendingCommit!==null)&&(ts(e,0),Xn(e,ve,Nt,!1)),Ss(e,i),((Ae&2)===0||e!==Ue)&&(e===Ue&&((Ae&2)===0&&(wi|=i),$e===4&&Xn(e,ve,Nt,!1)),en(e))}function ad(e,t,i){if((Ae&6)!==0)throw Error(l(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||ws(e,t),o=s?Og(e,t):Fo(e,t,!0),c=s;do{if(o===0){Ii&&!s&&Xn(e,t,0,!1);break}else{if(i=e.current.alternate,c&&!Ag(i)){o=Fo(e,t,!1),c=!1;continue}if(o===2){if(c=t,e.errorRecoveryDisabledLanes&c)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var p=e;o=Ps;var b=p.current.memoizedState.isDehydrated;if(b&&(ts(p,h).flags|=256),h=Fo(p,h,!1),h!==2){if(Vo&&!b){p.errorRecoveryDisabledLanes|=c,wi|=c,o=4;break e}c=bt,bt=o,c!==null&&(bt===null?bt=c:bt.push.apply(bt,c))}o=h}if(c=!1,o!==2)continue}}if(o===1){ts(e,0),Xn(e,t,0,!0);break}e:{switch(s=e,c=o,c){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:Xn(s,t,Nt,!Hn);break e;case 2:bt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(o=vl+300-Qe(),10<o)){if(Xn(s,t,Nt,!Hn),ja(s,0,!0)!==0)break e;kn=t,s.timeoutHandle=Dd(ld.bind(null,s,i,bt,wl,Go,t,Nt,wi,Pi,Hn,c,"Throttled",-0,0),o);break e}ld(s,i,bt,wl,Go,t,Nt,wi,Pi,Hn,c,null,-0,0)}}break}while(!0);en(e)}function ld(e,t,i,s,o,c,h,p,b,_,C,D,A,O){if(e.timeoutHandle=-1,D=t.subtreeFlags,D&8192||(D&16785408)===16785408){D={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:cn},Ih(t,c,D);var I=(c&62914560)===c?vl-Qe():(c&4194048)===c?nd-Qe():0;if(I=fv(D,I),I!==null){kn=c,e.cancelPendingCommit=I(pd.bind(null,e,t,c,i,s,o,h,p,b,C,D,null,A,O)),Xn(e,c,h,!_);return}}pd(e,t,c,i,s,o,h,p,b)}function Ag(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var o=i[s],c=o.getSnapshot;o=o.value;try{if(!Et(c(),o))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 Xn(e,t,i,s){t&=~Xo,t&=~wi,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var o=t;0<o;){var c=31-xt(o),h=1<<c;s[c]=-1,o&=~h}i!==0&&mu(e,i,t)}function Sl(){return(Ae&6)===0?(ta(0),!1):!0}function Jo(){if(ye!==null){if(Ne===0)var e=ye.return;else e=ye,dn=fi=null,uo(e),Gi=null,Bs=0,e=ye;for(;e!==null;)Bh(e.alternate,e),e=e.return;ye=null}}function ts(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,Kg(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),kn=0,Jo(),Ue=e,ye=i=fn(e.current,null),ve=t,Ne=0,At=null,Hn=!1,Ii=ws(e,t),Vo=!1,Pi=Nt=Xo=wi=$n=$e=0,bt=Ps=null,Go=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var o=31-xt(s),c=1<<o;t|=e[o],s&=~c}return En=t,Ya(),i}function rd(e,t){fe=null,k.H=Gs,t===Xi||t===Fa?(t=Ef(),Ne=3):t===Ir?(t=Ef(),Ne=4):Ne=t===Ao?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,At=t,ye===null&&($e=1,ul(e,Ct(t,e.current)))}function od(){var e=Tt.current;return e===null?!0:(ve&4194048)===ve?qt===null:(ve&62914560)===ve||(ve&536870912)!==0?e===qt:!1}function cd(){var e=k.H;return k.H=Gs,e===null?Gs:e}function ud(){var e=k.A;return k.A=Tg,e}function xl(){$e=4,Hn||(ve&4194048)!==ve&&Tt.current!==null||(Ii=!0),($n&134217727)===0&&(wi&134217727)===0||Ue===null||Xn(Ue,ve,Nt,!1)}function Fo(e,t,i){var s=Ae;Ae|=2;var o=cd(),c=ud();(Ue!==e||ve!==t)&&(wl=null,ts(e,t)),t=!1;var h=$e;e:do try{if(Ne!==0&&ye!==null){var p=ye,b=At;switch(Ne){case 8:Jo(),h=6;break e;case 3:case 2:case 9:case 6:Tt.current===null&&(t=!0);var _=Ne;if(Ne=0,At=null,ns(e,p,b,_),i&&Ii){h=0;break e}break;default:_=Ne,Ne=0,At=null,ns(e,p,b,_)}}Ng(),h=$e;break}catch(C){rd(e,C)}while(!0);return t&&e.shellSuspendCounter++,dn=fi=null,Ae=s,k.H=o,k.A=c,ye===null&&(Ue=null,ve=0,Ya()),h}function Ng(){for(;ye!==null;)fd(ye)}function Og(e,t){var i=Ae;Ae|=2;var s=cd(),o=ud();Ue!==e||ve!==t?(wl=null,bl=Qe()+500,ts(e,t)):Ii=ws(e,t);e:do try{if(Ne!==0&&ye!==null){t=ye;var c=At;t:switch(Ne){case 1:Ne=0,At=null,ns(e,t,c,1);break;case 2:case 9:if(Sf(c)){Ne=0,At=null,hd(t);break}t=function(){Ne!==2&&Ne!==9||Ue!==e||(Ne=7),en(e)},c.then(t,t);break e;case 3:Ne=7;break e;case 4:Ne=5;break e;case 7:Sf(c)?(Ne=0,At=null,hd(t)):(Ne=0,At=null,ns(e,t,c,7));break;case 5:var h=null;switch(ye.tag){case 26:h=ye.memoizedState;case 5:case 27:var p=ye;if(h?Wd(h):p.stateNode.complete){Ne=0,At=null;var b=p.sibling;if(b!==null)ye=b;else{var _=p.return;_!==null?(ye=_,El(_)):ye=null}break t}}Ne=0,At=null,ns(e,t,c,5);break;case 6:Ne=0,At=null,ns(e,t,c,6);break;case 8:Jo(),$e=6;break e;default:throw Error(l(462))}}jg();break}catch(C){rd(e,C)}while(!0);return dn=fi=null,k.H=s,k.A=o,Ae=i,ye!==null?0:(Ue=null,ve=0,Ya(),$e)}function jg(){for(;ye!==null&&!me();)fd(ye)}function fd(e){var t=Uh(e.alternate,e,En);e.memoizedProps=e.pendingProps,t===null?El(e):ye=t}function hd(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Oh(i,t,t.pendingProps,t.type,void 0,ve);break;case 11:t=Oh(i,t,t.pendingProps,t.type.render,t.ref,ve);break;case 5:uo(t);default:Bh(i,t),t=ye=uf(t,En),t=Uh(i,t,En)}e.memoizedProps=e.pendingProps,t===null?El(e):ye=t}function ns(e,t,i,s){dn=fi=null,uo(t),Gi=null,Bs=0;var o=t.return;try{if(vg(e,o,t,i,ve)){$e=1,ul(e,Ct(i,e.current)),ye=null;return}}catch(c){if(o!==null)throw ye=o,c;$e=1,ul(e,Ct(i,e.current)),ye=null;return}t.flags&32768?(we||s===1?e=!0:Ii||(ve&536870912)!==0?e=!1:(Hn=e=!0,(s===2||s===9||s===3||s===6)&&(s=Tt.current,s!==null&&s.tag===13&&(s.flags|=16384))),dd(t,e)):El(t)}function El(e){var t=e;do{if((t.flags&32768)!==0){dd(t,Hn);return}e=t.return;var i=Sg(t.alternate,t,En);if(i!==null){ye=i;return}if(t=t.sibling,t!==null){ye=t;return}ye=t=e}while(t!==null);$e===0&&($e=5)}function dd(e,t){do{var i=xg(e.alternate,e);if(i!==null){i.flags&=32767,ye=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){ye=e;return}ye=e=i}while(e!==null);$e=6,ye=null}function pd(e,t,i,s,o,c,h,p,b){e.cancelPendingCommit=null;do kl();while(Pe!==0);if((Ae&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(c=t.lanes|t.childLanes,c|=Br,cy(e,i,c,h,p,b),e===Ue&&(ye=Ue=null,ve=0),es=t,Vn=e,kn=i,Qo=c,Ko=o,id=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Cg(_a,function(){return bd(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=k.T,k.T=null,o=$.p,$.p=2,h=Ae,Ae|=4;try{Eg(e,t,i)}finally{Ae=h,$.p=o,k.T=s}}Pe=1,md(),yd(),gd()}}function md(){if(Pe===1){Pe=0;var e=Vn,t=es,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=k.T,k.T=null;var s=$.p;$.p=2;var o=Ae;Ae|=4;try{Jh(t,e);var c=oc,h=ef(e.containerInfo),p=c.focusedElem,b=c.selectionRange;if(h!==p&&p&&p.ownerDocument&&Pu(p.ownerDocument.documentElement,p)){if(b!==null&&zr(p)){var _=b.start,C=b.end;if(C===void 0&&(C=_),"selectionStart"in p)p.selectionStart=_,p.selectionEnd=Math.min(C,p.value.length);else{var D=p.ownerDocument||document,A=D&&D.defaultView||window;if(A.getSelection){var O=A.getSelection(),I=p.textContent.length,le=Math.min(b.start,I),Me=b.end===void 0?le:Math.min(b.end,I);!O.extend&&le>Me&&(h=Me,Me=le,le=h);var E=Iu(p,le),x=Iu(p,Me);if(E&&x&&(O.rangeCount!==1||O.anchorNode!==E.node||O.anchorOffset!==E.offset||O.focusNode!==x.node||O.focusOffset!==x.offset)){var T=D.createRange();T.setStart(E.node,E.offset),O.removeAllRanges(),le>Me?(O.addRange(T),O.extend(x.node,x.offset)):(T.setEnd(x.node,x.offset),O.addRange(T))}}}}for(D=[],O=p;O=O.parentNode;)O.nodeType===1&&D.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<D.length;p++){var U=D[p];U.element.scrollLeft=U.left,U.element.scrollTop=U.top}}Dl=!!rc,oc=rc=null}finally{Ae=o,$.p=s,k.T=i}}e.current=t,Pe=2}}function yd(){if(Pe===2){Pe=0;var e=Vn,t=es,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=k.T,k.T=null;var s=$.p;$.p=2;var o=Ae;Ae|=4;try{Xh(e,t.alternate,t)}finally{Ae=o,$.p=s,k.T=i}}Pe=3}}function gd(){if(Pe===4||Pe===3){Pe=0,st();var e=Vn,t=es,i=kn,s=id;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Pe=5:(Pe=0,es=Vn=null,vd(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Yn=null),dr(i),t=t.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(bs,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=k.T,o=$.p,$.p=2,k.T=null;try{for(var c=e.onRecoverableError,h=0;h<s.length;h++){var p=s[h];c(p.value,{componentStack:p.stack})}}finally{k.T=t,$.p=o}}(kn&3)!==0&&kl(),en(e),o=e.pendingLanes,(i&261930)!==0&&(o&42)!==0?e===Zo?ea++:(ea=0,Zo=e):ea=0,ta(0)}}function vd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Us(t)))}function kl(){return md(),yd(),gd(),bd()}function bd(){if(Pe!==5)return!1;var e=Vn,t=Qo;Qo=0;var i=dr(kn),s=k.T,o=$.p;try{$.p=32>i?32:i,k.T=null,i=Ko,Ko=null;var c=Vn,h=kn;if(Pe=0,es=Vn=null,kn=0,(Ae&6)!==0)throw Error(l(331));var p=Ae;if(Ae|=4,ed(c.current),Wh(c,c.current,h,i),Ae=p,ta(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(bs,c)}catch{}return!0}finally{$.p=o,k.T=s,vd(e,t)}}function wd(e,t,i){t=Ct(i,t),t=_o(e.stateNode,t,2),e=Dn(e,t,2),e!==null&&(Ss(e,2),en(e))}function Oe(e,t,i){if(e.tag===3)wd(e,e,i);else for(;t!==null;){if(t.tag===3){wd(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Yn===null||!Yn.has(s))){e=Ct(i,e),i=Sh(2),s=Dn(t,i,2),s!==null&&(xh(i,s,t,e),Ss(s,2),en(s));break}}t=t.return}}function Wo(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new _g;var o=new Set;s.set(t,o)}else o=s.get(t),o===void 0&&(o=new Set,s.set(t,o));o.has(i)||(Vo=!0,o.add(i),e=Rg.bind(null,e,t,i),t.then(e,e))}function Rg(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Ue===e&&(ve&i)===i&&($e===4||$e===3&&(ve&62914560)===ve&&300>Qe()-vl?(Ae&2)===0&&ts(e,0):Xo|=i,Pi===ve&&(Pi=0)),en(e)}function Sd(e,t){t===0&&(t=pu()),e=oi(e,t),e!==null&&(Ss(e,t),en(e))}function zg(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Sd(e,i)}function Mg(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(i=o.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(l(314))}s!==null&&s.delete(t),Sd(e,i)}function Cg(e,t){return ae(e,t)}var Tl=null,is=null,Io=!1,_l=!1,Po=!1,Gn=0;function en(e){e!==is&&e.next===null&&(is===null?Tl=is=e:is=is.next=e),_l=!0,Io||(Io=!0,Dg())}function ta(e,t){if(!Po&&_l){Po=!0;do for(var i=!1,s=Tl;s!==null;){if(e!==0){var o=s.pendingLanes;if(o===0)var c=0;else{var h=s.suspendedLanes,p=s.pingedLanes;c=(1<<31-xt(42|e)+1)-1,c&=o&~(h&~p),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(i=!0,Td(s,c))}else c=ve,c=ja(s,s===Ue?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(c&3)===0||ws(s,c)||(i=!0,Td(s,c));s=s.next}while(i);Po=!1}}function Ug(){xd()}function xd(){_l=Io=!1;var e=0;Gn!==0&&Qg()&&(e=Gn);for(var t=Qe(),i=null,s=Tl;s!==null;){var o=s.next,c=Ed(s,t);c===0?(s.next=null,i===null?Tl=o:i.next=o,o===null&&(is=i)):(i=s,(e!==0||(c&3)!==0)&&(_l=!0)),s=o}Pe!==0&&Pe!==5||ta(e),Gn!==0&&(Gn=0)}function Ed(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var h=31-xt(c),p=1<<h,b=o[h];b===-1?((p&i)===0||(p&s)!==0)&&(o[h]=oy(p,t)):b<=t&&(e.expiredLanes|=p),c&=~p}if(t=Ue,i=ve,i=ja(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(Ne===2||Ne===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&De(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||ws(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&De(s),dr(i)){case 2:case 8:i=hu;break;case 32:i=_a;break;case 268435456:i=du;break;default:i=_a}return s=kd.bind(null,e),i=ae(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&De(s),e.callbackPriority=2,e.callbackNode=null,2}function kd(e,t){if(Pe!==0&&Pe!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(kl()&&e.callbackNode!==i)return null;var s=ve;return s=ja(e,e===Ue?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(ad(e,s,t),Ed(e,Qe()),e.callbackNode!=null&&e.callbackNode===i?kd.bind(null,e):null)}function Td(e,t){if(kl())return null;ad(e,t,!0)}function Dg(){Zg(function(){(Ae&6)!==0?ae(fu,Ug):xd()})}function ec(){if(Gn===0){var e=Yi;e===0&&(e=Aa,Aa<<=1,(Aa&261888)===0&&(Aa=256)),Gn=e}return Gn}function _d(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ca(""+e)}function Ad(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function Bg(e,t,i,s,o){if(t==="submit"&&i&&i.stateNode===o){var c=_d((o[pt]||null).action),h=s.submitter;h&&(t=(t=h[pt]||null)?_d(t.formAction):h.getAttribute("formAction"),t!==null&&(c=t,h=null));var p=new qa("action","action",null,s,o);e.push({event:p,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Gn!==0){var b=h?Ad(o,h):new FormData(o);wo(i,{pending:!0,data:b,method:o.method,action:c},null,b)}}else typeof c=="function"&&(p.preventDefault(),b=h?Ad(o,h):new FormData(o),wo(i,{pending:!0,data:b,method:o.method,action:c},c,b))},currentTarget:o}]})}}for(var tc=0;tc<Dr.length;tc++){var nc=Dr[tc],qg=nc.toLowerCase(),Lg=nc[0].toUpperCase()+nc.slice(1);Yt(qg,"on"+Lg)}Yt(sf,"onAnimationEnd"),Yt(af,"onAnimationIteration"),Yt(lf,"onAnimationStart"),Yt("dblclick","onDoubleClick"),Yt("focusin","onFocus"),Yt("focusout","onBlur"),Yt(tg,"onTransitionRun"),Yt(ng,"onTransitionStart"),Yt(ig,"onTransitionCancel"),Yt(rf,"onTransitionEnd"),Ni("onMouseEnter",["mouseout","mouseover"]),Ni("onMouseLeave",["mouseout","mouseover"]),Ni("onPointerEnter",["pointerout","pointerover"]),Ni("onPointerLeave",["pointerout","pointerover"]),si("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),si("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),si("onBeforeInput",["compositionend","keypress","textInput","paste"]),si("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),si("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),si("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var na="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(" "),Hg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(na));function Nd(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],o=s.event;s=s.listeners;e:{var c=void 0;if(t)for(var h=s.length-1;0<=h;h--){var p=s[h],b=p.instance,_=p.currentTarget;if(p=p.listener,b!==c&&o.isPropagationStopped())break e;c=p,o.currentTarget=_;try{c(o)}catch(C){$a(C)}o.currentTarget=null,c=b}else for(h=0;h<s.length;h++){if(p=s[h],b=p.instance,_=p.currentTarget,p=p.listener,b!==c&&o.isPropagationStopped())break e;c=p,o.currentTarget=_;try{c(o)}catch(C){$a(C)}o.currentTarget=null,c=b}}}}function ge(e,t){var i=t[pr];i===void 0&&(i=t[pr]=new Set);var s=e+"__bubble";i.has(s)||(Od(t,e,2,!1),i.add(s))}function ic(e,t,i){var s=0;t&&(s|=4),Od(i,e,s,t)}var Al="_reactListening"+Math.random().toString(36).slice(2);function sc(e){if(!e[Al]){e[Al]=!0,Su.forEach(function(i){i!=="selectionchange"&&(Hg.has(i)||ic(i,!1,e),ic(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Al]||(t[Al]=!0,ic("selectionchange",!1,t))}}function Od(e,t,i,s){switch(sp(t)){case 2:var o=pv;break;case 8:o=mv;break;default:o=bc}i=o.bind(null,t,i,e),o=void 0,!Er||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),s?o!==void 0?e.addEventListener(t,i,{capture:!0,passive:o}):e.addEventListener(t,i,!0):o!==void 0?e.addEventListener(t,i,{passive:o}):e.addEventListener(t,i,!1)}function ac(e,t,i,s,o){var c=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var h=s.tag;if(h===3||h===4){var p=s.stateNode.containerInfo;if(p===o)break;if(h===4)for(h=s.return;h!==null;){var b=h.tag;if((b===3||b===4)&&h.stateNode.containerInfo===o)return;h=h.return}for(;p!==null;){if(h=Ti(p),h===null)return;if(b=h.tag,b===5||b===6||b===26||b===27){s=c=h;continue e}p=p.parentNode}}s=s.return}Mu(function(){var _=c,C=Sr(i),D=[];e:{var A=of.get(e);if(A!==void 0){var O=qa,I=e;switch(e){case"keypress":if(Da(i)===0)break e;case"keydown":case"keyup":O=My;break;case"focusin":I="focus",O=Ar;break;case"focusout":I="blur",O=Ar;break;case"beforeblur":case"afterblur":O=Ar;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":O=Du;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=Sy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=Dy;break;case sf:case af:case lf:O=ky;break;case rf:O=qy;break;case"scroll":case"scrollend":O=by;break;case"wheel":O=Hy;break;case"copy":case"cut":case"paste":O=_y;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=qu;break;case"toggle":case"beforetoggle":O=Yy}var le=(t&4)!==0,Me=!le&&(e==="scroll"||e==="scrollend"),E=le?A!==null?A+"Capture":null:A;le=[];for(var x=_,T;x!==null;){var U=x;if(T=U.stateNode,U=U.tag,U!==5&&U!==26&&U!==27||T===null||E===null||(U=ks(x,E),U!=null&&le.push(ia(x,U,T))),Me)break;x=x.return}0<le.length&&(A=new O(A,I,null,i,C),D.push({event:A,listeners:le}))}}if((t&7)===0){e:{if(A=e==="mouseover"||e==="pointerover",O=e==="mouseout"||e==="pointerout",A&&i!==wr&&(I=i.relatedTarget||i.fromElement)&&(Ti(I)||I[ki]))break e;if((O||A)&&(A=C.window===C?C:(A=C.ownerDocument)?A.defaultView||A.parentWindow:window,O?(I=i.relatedTarget||i.toElement,O=_,I=I?Ti(I):null,I!==null&&(Me=f(I),le=I.tag,I!==Me||le!==5&&le!==27&&le!==6)&&(I=null)):(O=null,I=_),O!==I)){if(le=Du,U="onMouseLeave",E="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(le=qu,U="onPointerLeave",E="onPointerEnter",x="pointer"),Me=O==null?A:Es(O),T=I==null?A:Es(I),A=new le(U,x+"leave",O,i,C),A.target=Me,A.relatedTarget=T,U=null,Ti(C)===_&&(le=new le(E,x+"enter",I,i,C),le.target=T,le.relatedTarget=Me,U=le),Me=U,O&&I)t:{for(le=$g,E=O,x=I,T=0,U=E;U;U=le(U))T++;U=0;for(var ie=x;ie;ie=le(ie))U++;for(;0<T-U;)E=le(E),T--;for(;0<U-T;)x=le(x),U--;for(;T--;){if(E===x||x!==null&&E===x.alternate){le=E;break t}E=le(E),x=le(x)}le=null}else le=null;O!==null&&jd(D,A,O,le,!1),I!==null&&Me!==null&&jd(D,Me,I,le,!0)}}e:{if(A=_?Es(_):window,O=A.nodeName&&A.nodeName.toLowerCase(),O==="select"||O==="input"&&A.type==="file")var ke=Qu;else if(Xu(A))if(Ku)ke=Iy;else{ke=Fy;var te=Jy}else O=A.nodeName,!O||O.toLowerCase()!=="input"||A.type!=="checkbox"&&A.type!=="radio"?_&&br(_.elementType)&&(ke=Qu):ke=Wy;if(ke&&(ke=ke(e,_))){Gu(D,ke,i,C);break e}te&&te(e,A,_),e==="focusout"&&_&&A.type==="number"&&_.memoizedProps.value!=null&&vr(A,"number",A.value)}switch(te=_?Es(_):window,e){case"focusin":(Xu(te)||te.contentEditable==="true")&&(Ci=te,Mr=_,zs=null);break;case"focusout":zs=Mr=Ci=null;break;case"mousedown":Cr=!0;break;case"contextmenu":case"mouseup":case"dragend":Cr=!1,tf(D,i,C);break;case"selectionchange":if(eg)break;case"keydown":case"keyup":tf(D,i,C)}var de;if(Or)e:{switch(e){case"compositionstart":var be="onCompositionStart";break e;case"compositionend":be="onCompositionEnd";break e;case"compositionupdate":be="onCompositionUpdate";break e}be=void 0}else Mi?Yu(e,i)&&(be="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(be="onCompositionStart");be&&(Lu&&i.locale!=="ko"&&(Mi||be!=="onCompositionStart"?be==="onCompositionEnd"&&Mi&&(de=Cu()):(On=C,kr="value"in On?On.value:On.textContent,Mi=!0)),te=Nl(_,be),0<te.length&&(be=new Bu(be,e,null,i,C),D.push({event:be,listeners:te}),de?be.data=de:(de=Vu(i),de!==null&&(be.data=de)))),(de=Xy?Gy(e,i):Qy(e,i))&&(be=Nl(_,"onBeforeInput"),0<be.length&&(te=new Bu("onBeforeInput","beforeinput",null,i,C),D.push({event:te,listeners:be}),te.data=de)),Bg(D,e,_,i,C)}Nd(D,t)})}function ia(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Nl(e,t){for(var i=t+"Capture",s=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=ks(e,i),o!=null&&s.unshift(ia(e,o,c)),o=ks(e,t),o!=null&&s.push(ia(e,o,c))),e.tag===3)return s;e=e.return}return[]}function $g(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function jd(e,t,i,s,o){for(var c=t._reactName,h=[];i!==null&&i!==s;){var p=i,b=p.alternate,_=p.stateNode;if(p=p.tag,b!==null&&b===s)break;p!==5&&p!==26&&p!==27||_===null||(b=_,o?(_=ks(i,c),_!=null&&h.unshift(ia(i,_,b))):o||(_=ks(i,c),_!=null&&h.push(ia(i,_,b)))),i=i.return}h.length!==0&&e.push({event:t,listeners:h})}var Yg=/\r\n?/g,Vg=/\u0000|\uFFFD/g;function Rd(e){return(typeof e=="string"?e:""+e).replace(Yg,`
9
+ `).replace(Vg,"")}function zd(e,t){return t=Rd(t),Rd(e)===t}function ze(e,t,i,s,o,c){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||ji(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&ji(e,""+s);break;case"className":za(e,"class",s);break;case"tabIndex":za(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":za(e,i,s);break;case"style":Ru(e,s,c);break;case"data":if(t!=="object"){za(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Ca(""+s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(i,"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"&&(i==="formAction"?(t!=="input"&&ze(e,t,"name",o.name,o,null),ze(e,t,"formEncType",o.formEncType,o,null),ze(e,t,"formMethod",o.formMethod,o,null),ze(e,t,"formTarget",o.formTarget,o,null)):(ze(e,t,"encType",o.encType,o,null),ze(e,t,"method",o.method,o,null),ze(e,t,"target",o.target,o,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Ca(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=cn);break;case"onScroll":s!=null&&ge("scroll",e);break;case"onScrollEnd":s!=null&&ge("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(i=s.__html,i!=null){if(o.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=Ca(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""+s):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":ge("beforetoggle",e),ge("toggle",e),Ra(e,"popover",s);break;case"xlinkActuate":on(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":on(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":on(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":on(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":on(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":on(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":on(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":on(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":on(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Ra(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=gy.get(i)||i,Ra(e,i,s))}}function lc(e,t,i,s,o,c){switch(i){case"style":Ru(e,s,c);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(i=s.__html,i!=null){if(o.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"children":typeof s=="string"?ji(e,s):(typeof s=="number"||typeof s=="bigint")&&ji(e,""+s);break;case"onScroll":s!=null&&ge("scroll",e);break;case"onScrollEnd":s!=null&&ge("scrollend",e);break;case"onClick":s!=null&&(e.onclick=cn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xu.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(o=i.endsWith("Capture"),t=i.slice(2,o?i.length-7:void 0),c=e[pt]||null,c=c!=null?c[i]:null,typeof c=="function"&&e.removeEventListener(t,c,o),typeof s=="function")){typeof c!="function"&&c!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,o);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):Ra(e,i,s)}}}function ct(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ge("error",e),ge("load",e);var s=!1,o=!1,c;for(c in i)if(i.hasOwnProperty(c)){var h=i[c];if(h!=null)switch(c){case"src":s=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:ze(e,t,c,h,i,null)}}o&&ze(e,t,"srcSet",i.srcSet,i,null),s&&ze(e,t,"src",i.src,i,null);return;case"input":ge("invalid",e);var p=c=h=o=null,b=null,_=null;for(s in i)if(i.hasOwnProperty(s)){var C=i[s];if(C!=null)switch(s){case"name":o=C;break;case"type":h=C;break;case"checked":b=C;break;case"defaultChecked":_=C;break;case"value":c=C;break;case"defaultValue":p=C;break;case"children":case"dangerouslySetInnerHTML":if(C!=null)throw Error(l(137,t));break;default:ze(e,t,s,C,i,null)}}Au(e,c,p,b,_,h,o,!1);return;case"select":ge("invalid",e),s=h=c=null;for(o in i)if(i.hasOwnProperty(o)&&(p=i[o],p!=null))switch(o){case"value":c=p;break;case"defaultValue":h=p;break;case"multiple":s=p;default:ze(e,t,o,p,i,null)}t=c,i=h,e.multiple=!!s,t!=null?Oi(e,!!s,t,!1):i!=null&&Oi(e,!!s,i,!0);return;case"textarea":ge("invalid",e),c=o=s=null;for(h in i)if(i.hasOwnProperty(h)&&(p=i[h],p!=null))switch(h){case"value":s=p;break;case"defaultValue":o=p;break;case"children":c=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(l(91));break;default:ze(e,t,h,p,i,null)}Ou(e,s,o,c);return;case"option":for(b in i)i.hasOwnProperty(b)&&(s=i[b],s!=null)&&(b==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":ze(e,t,b,s,i,null));return;case"dialog":ge("beforetoggle",e),ge("toggle",e),ge("cancel",e),ge("close",e);break;case"iframe":case"object":ge("load",e);break;case"video":case"audio":for(s=0;s<na.length;s++)ge(na[s],e);break;case"image":ge("error",e),ge("load",e);break;case"details":ge("toggle",e);break;case"embed":case"source":case"link":ge("error",e),ge("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(_ in i)if(i.hasOwnProperty(_)&&(s=i[_],s!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:ze(e,t,_,s,i,null)}return;default:if(br(t)){for(C in i)i.hasOwnProperty(C)&&(s=i[C],s!==void 0&&lc(e,t,C,s,i,void 0));return}}for(p in i)i.hasOwnProperty(p)&&(s=i[p],s!=null&&ze(e,t,p,s,i,null))}function Xg(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,c=null,h=null,p=null,b=null,_=null,C=null;for(O in i){var D=i[O];if(i.hasOwnProperty(O)&&D!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":b=D;default:s.hasOwnProperty(O)||ze(e,t,O,null,s,D)}}for(var A in s){var O=s[A];if(D=i[A],s.hasOwnProperty(A)&&(O!=null||D!=null))switch(A){case"type":c=O;break;case"name":o=O;break;case"checked":_=O;break;case"defaultChecked":C=O;break;case"value":h=O;break;case"defaultValue":p=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(l(137,t));break;default:O!==D&&ze(e,t,A,O,s,D)}}gr(e,h,p,b,_,C,c,o);return;case"select":O=h=p=A=null;for(c in i)if(b=i[c],i.hasOwnProperty(c)&&b!=null)switch(c){case"value":break;case"multiple":O=b;default:s.hasOwnProperty(c)||ze(e,t,c,null,s,b)}for(o in s)if(c=s[o],b=i[o],s.hasOwnProperty(o)&&(c!=null||b!=null))switch(o){case"value":A=c;break;case"defaultValue":p=c;break;case"multiple":h=c;default:c!==b&&ze(e,t,o,c,s,b)}t=p,i=h,s=O,A!=null?Oi(e,!!i,A,!1):!!s!=!!i&&(t!=null?Oi(e,!!i,t,!0):Oi(e,!!i,i?[]:"",!1));return;case"textarea":O=A=null;for(p in i)if(o=i[p],i.hasOwnProperty(p)&&o!=null&&!s.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:ze(e,t,p,null,s,o)}for(h in s)if(o=s[h],c=i[h],s.hasOwnProperty(h)&&(o!=null||c!=null))switch(h){case"value":A=o;break;case"defaultValue":O=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(l(91));break;default:o!==c&&ze(e,t,h,o,s,c)}Nu(e,A,O);return;case"option":for(var I in i)A=i[I],i.hasOwnProperty(I)&&A!=null&&!s.hasOwnProperty(I)&&(I==="selected"?e.selected=!1:ze(e,t,I,null,s,A));for(b in s)A=s[b],O=i[b],s.hasOwnProperty(b)&&A!==O&&(A!=null||O!=null)&&(b==="selected"?e.selected=A&&typeof A!="function"&&typeof A!="symbol":ze(e,t,b,A,s,O));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var le in i)A=i[le],i.hasOwnProperty(le)&&A!=null&&!s.hasOwnProperty(le)&&ze(e,t,le,null,s,A);for(_ in s)if(A=s[_],O=i[_],s.hasOwnProperty(_)&&A!==O&&(A!=null||O!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(l(137,t));break;default:ze(e,t,_,A,s,O)}return;default:if(br(t)){for(var Me in i)A=i[Me],i.hasOwnProperty(Me)&&A!==void 0&&!s.hasOwnProperty(Me)&&lc(e,t,Me,void 0,s,A);for(C in s)A=s[C],O=i[C],!s.hasOwnProperty(C)||A===O||A===void 0&&O===void 0||lc(e,t,C,A,s,O);return}}for(var E in i)A=i[E],i.hasOwnProperty(E)&&A!=null&&!s.hasOwnProperty(E)&&ze(e,t,E,null,s,A);for(D in s)A=s[D],O=i[D],!s.hasOwnProperty(D)||A===O||A==null&&O==null||ze(e,t,D,A,s,O)}function Md(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Gg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var o=i[s],c=o.transferSize,h=o.initiatorType,p=o.duration;if(c&&p&&Md(h)){for(h=0,p=o.responseEnd,s+=1;s<i.length;s++){var b=i[s],_=b.startTime;if(_>p)break;var C=b.transferSize,D=b.initiatorType;C&&Md(D)&&(b=b.responseEnd,h+=C*(b<p?1:(p-_)/(b-_)))}if(--s,t+=8*(c+h)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var rc=null,oc=null;function Ol(e){return e.nodeType===9?e:e.ownerDocument}function Cd(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 Ud(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 cc(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 uc=null;function Qg(){var e=window.event;return e&&e.type==="popstate"?e===uc?!1:(uc=e,!0):(uc=null,!1)}var Dd=typeof setTimeout=="function"?setTimeout:void 0,Kg=typeof clearTimeout=="function"?clearTimeout:void 0,Bd=typeof Promise=="function"?Promise:void 0,Zg=typeof queueMicrotask=="function"?queueMicrotask:typeof Bd<"u"?function(e){return Bd.resolve(null).then(e).catch(Jg)}:Dd;function Jg(e){setTimeout(function(){throw e})}function Qn(e){return e==="head"}function qd(e,t){var i=t,s=0;do{var o=i.nextSibling;if(e.removeChild(i),o&&o.nodeType===8)if(i=o.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(o),rs(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")sa(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,sa(i);for(var c=i.firstChild;c;){var h=c.nextSibling,p=c.nodeName;c[xs]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&c.rel.toLowerCase()==="stylesheet"||i.removeChild(c),c=h}}else i==="body"&&sa(e.ownerDocument.body);i=o}while(i);rs(t)}function Ld(e,t){var i=e;e=0;do{var s=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function fc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":fc(i),mr(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function Fg(e,t,i,s){for(;e.nodeType===1;){var o=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[xs])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!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=Lt(e.nextSibling),e===null)break}return null}function Wg(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Lt(e.nextSibling),e===null))return null;return e}function Hd(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Lt(e.nextSibling),e===null))return null;return e}function hc(e){return e.data==="$?"||e.data==="$~"}function dc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ig(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Lt(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 pc=null;function $d(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Lt(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function Yd(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function Vd(e,t,i){switch(t=Ol(i),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 sa(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mr(e)}var Ht=new Map,Xd=new Set;function jl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Tn=$.d;$.d={f:Pg,r:ev,D:tv,C:nv,L:iv,m:sv,X:lv,S:av,M:rv};function Pg(){var e=Tn.f(),t=Sl();return e||t}function ev(e){var t=_i(e);t!==null&&t.tag===5&&t.type==="form"?rh(t):Tn.r(e)}var ss=typeof document>"u"?null:document;function Gd(e,t,i){var s=ss;if(s&&typeof t=="string"&&t){var o=zt(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof i=="string"&&(o+='[crossorigin="'+i+'"]'),Xd.has(o)||(Xd.add(o),e={rel:e,crossOrigin:i,href:t},s.querySelector(o)===null&&(t=s.createElement("link"),ct(t,"link",e),tt(t),s.head.appendChild(t)))}}function tv(e){Tn.D(e),Gd("dns-prefetch",e,null)}function nv(e,t){Tn.C(e,t),Gd("preconnect",e,t)}function iv(e,t,i){Tn.L(e,t,i);var s=ss;if(s&&e&&t){var o='link[rel="preload"][as="'+zt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(o+='[imagesrcset="'+zt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(o+='[imagesizes="'+zt(i.imageSizes)+'"]')):o+='[href="'+zt(e)+'"]';var c=o;switch(t){case"style":c=as(e);break;case"script":c=ls(e)}Ht.has(c)||(e=w({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Ht.set(c,e),s.querySelector(o)!==null||t==="style"&&s.querySelector(aa(c))||t==="script"&&s.querySelector(la(c))||(t=s.createElement("link"),ct(t,"link",e),tt(t),s.head.appendChild(t)))}}function sv(e,t){Tn.m(e,t);var i=ss;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+zt(s)+'"][href="'+zt(e)+'"]',c=o;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=ls(e)}if(!Ht.has(c)&&(e=w({rel:"modulepreload",href:e},t),Ht.set(c,e),i.querySelector(o)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(la(c)))return}s=i.createElement("link"),ct(s,"link",e),tt(s),i.head.appendChild(s)}}}function av(e,t,i){Tn.S(e,t,i);var s=ss;if(s&&e){var o=Ai(s).hoistableStyles,c=as(e);t=t||"default";var h=o.get(c);if(!h){var p={loading:0,preload:null};if(h=s.querySelector(aa(c)))p.loading=5;else{e=w({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Ht.get(c))&&mc(e,i);var b=h=s.createElement("link");tt(b),ct(b,"link",e),b._p=new Promise(function(_,C){b.onload=_,b.onerror=C}),b.addEventListener("load",function(){p.loading|=1}),b.addEventListener("error",function(){p.loading|=2}),p.loading|=4,Rl(h,t,s)}h={type:"stylesheet",instance:h,count:1,state:p},o.set(c,h)}}}function lv(e,t){Tn.X(e,t);var i=ss;if(i&&e){var s=Ai(i).hoistableScripts,o=ls(e),c=s.get(o);c||(c=i.querySelector(la(o)),c||(e=w({src:e,async:!0},t),(t=Ht.get(o))&&yc(e,t),c=i.createElement("script"),tt(c),ct(c,"link",e),i.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function rv(e,t){Tn.M(e,t);var i=ss;if(i&&e){var s=Ai(i).hoistableScripts,o=ls(e),c=s.get(o);c||(c=i.querySelector(la(o)),c||(e=w({src:e,async:!0,type:"module"},t),(t=Ht.get(o))&&yc(e,t),c=i.createElement("script"),tt(c),ct(c,"link",e),i.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function Qd(e,t,i,s){var o=(o=he.current)?jl(o):null;if(!o)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=as(i.href),i=Ai(o).hoistableStyles,s=i.get(t),s||(s={type:"style",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=as(i.href);var c=Ai(o).hoistableStyles,h=c.get(e);if(h||(o=o.ownerDocument||o,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,h),(c=o.querySelector(aa(e)))&&!c._p&&(h.instance=c,h.state.loading=5),Ht.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Ht.set(e,i),c||ov(o,e,i,h.state))),t&&s===null)throw Error(l(528,""));return h}if(t&&s!==null)throw Error(l(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ls(i),i=Ai(o).hoistableScripts,s=i.get(t),s||(s={type:"script",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function as(e){return'href="'+zt(e)+'"'}function aa(e){return'link[rel="stylesheet"]['+e+"]"}function Kd(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function ov(e,t,i,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),ct(t,"link",i),tt(t),e.head.appendChild(t))}function ls(e){return'[src="'+zt(e)+'"]'}function la(e){return"script[async]"+e}function Zd(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+zt(i.href)+'"]');if(s)return t.instance=s,tt(s),s;var o=w({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),tt(s),ct(s,"style",o),Rl(s,i.precedence,e),t.instance=s;case"stylesheet":o=as(i.href);var c=e.querySelector(aa(o));if(c)return t.state.loading|=4,t.instance=c,tt(c),c;s=Kd(i),(o=Ht.get(o))&&mc(s,o),c=(e.ownerDocument||e).createElement("link"),tt(c);var h=c;return h._p=new Promise(function(p,b){h.onload=p,h.onerror=b}),ct(c,"link",s),t.state.loading|=4,Rl(c,i.precedence,e),t.instance=c;case"script":return c=ls(i.src),(o=e.querySelector(la(c)))?(t.instance=o,tt(o),o):(s=i,(o=Ht.get(c))&&(s=w({},i),yc(s,o)),e=e.ownerDocument||e,o=e.createElement("script"),tt(o),ct(o,"link",s),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Rl(s,i.precedence,e));return t.instance}function Rl(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=s.length?s[s.length-1]:null,c=o,h=0;h<s.length;h++){var p=s[h];if(p.dataset.precedence===t)c=p;else if(c!==o)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function mc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function yc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var zl=null;function Jd(e,t,i){if(zl===null){var s=new Map,o=zl=new Map;o.set(i,s)}else o=zl,s=o.get(i),s||(s=new Map,o.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),o=0;o<i.length;o++){var c=i[o];if(!(c[xs]||c[at]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var h=c.getAttribute(t)||"";h=e+h;var p=s.get(h);p?p.push(c):s.set(h,[c])}}return s}function Fd(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function cv(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Wd(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function uv(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var o=as(s.href),c=t.querySelector(aa(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ml.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=c,tt(c);return}c=t.ownerDocument||t,s=Kd(s),(o=Ht.get(o))&&mc(s,o),c=c.createElement("link"),tt(c);var h=c;h._p=new Promise(function(p,b){h.onload=p,h.onerror=b}),ct(c,"link",s),i.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Ml.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var gc=0;function fv(e,t){return e.stylesheets&&e.count===0&&Ul(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&Ul(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&gc===0&&(gc=62500*Gg());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ul(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>gc?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(o)}}:null}function Ml(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ul(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Cl=null;function Ul(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Cl=new Map,t.forEach(hv,e),Cl=null,Ml.call(e))}function hv(e,t){if(!(t.state.loading&4)){var i=Cl.get(e);if(i)var s=i.get(null);else{i=new Map,Cl.set(e,i);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<o.length;c++){var h=o[c];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(i.set(h.dataset.precedence,h),s=h)}s&&i.set(null,s)}o=t.instance,h=o.getAttribute("data-precedence"),c=i.get(h)||s,c===s&&i.set(null,o),i.set(h,o),this.count++,s=Ml.bind(this),o.addEventListener("load",s),o.addEventListener("error",s),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var ra={$$typeof:X,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function dv(e,t,i,s,o,c,h,p,b){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=fr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fr(0),this.hiddenUpdates=fr(null),this.identifierPrefix=s,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=b,this.incompleteTransitions=new Map}function Id(e,t,i,s,o,c,h,p,b,_,C,D){return e=new dv(e,t,i,h,b,_,C,D,p),t=1,c===!0&&(t|=24),c=kt(3,null,null,t),e.current=c,c.stateNode=e,t=Jr(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:s,isDehydrated:i,cache:t},Pr(c),e}function Pd(e){return e?(e=Bi,e):Bi}function ep(e,t,i,s,o,c){o=Pd(o),s.context===null?s.context=o:s.pendingContext=o,s=Un(t),s.payload={element:i},c=c===void 0?null:c,c!==null&&(s.callback=c),i=Dn(e,s,t),i!==null&&(wt(i,e,t),Ls(i,e,t))}function tp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function vc(e,t){tp(e,t),(e=e.alternate)&&tp(e,t)}function np(e){if(e.tag===13||e.tag===31){var t=oi(e,67108864);t!==null&&wt(t,e,67108864),vc(e,67108864)}}function ip(e){if(e.tag===13||e.tag===31){var t=Ot();t=hr(t);var i=oi(e,t);i!==null&&wt(i,e,t),vc(e,t)}}var Dl=!0;function pv(e,t,i,s){var o=k.T;k.T=null;var c=$.p;try{$.p=2,bc(e,t,i,s)}finally{$.p=c,k.T=o}}function mv(e,t,i,s){var o=k.T;k.T=null;var c=$.p;try{$.p=8,bc(e,t,i,s)}finally{$.p=c,k.T=o}}function bc(e,t,i,s){if(Dl){var o=wc(s);if(o===null)ac(e,t,s,Bl,i),ap(e,s);else if(gv(o,e,t,i,s))s.stopPropagation();else if(ap(e,s),t&4&&-1<yv.indexOf(e)){for(;o!==null;){var c=_i(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var h=ii(c.pendingLanes);if(h!==0){var p=c;for(p.pendingLanes|=2,p.entangledLanes|=2;h;){var b=1<<31-xt(h);p.entanglements[1]|=b,h&=~b}en(c),(Ae&6)===0&&(bl=Qe()+500,ta(0))}}break;case 31:case 13:p=oi(c,2),p!==null&&wt(p,c,2),Sl(),vc(c,2)}if(c=wc(s),c===null&&ac(e,t,s,Bl,i),c===o)break;o=c}o!==null&&s.stopPropagation()}else ac(e,t,s,null,i)}}function wc(e){return e=Sr(e),Sc(e)}var Bl=null;function Sc(e){if(Bl=null,e=Ti(e),e!==null){var t=f(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=d(t),e!==null)return e;e=null}else if(i===31){if(e=m(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Bl=e,null}function sp(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ei()){case fu:return 2;case hu:return 8;case _a:case ny:return 32;case du:return 268435456;default:return 32}default:return 32}}var xc=!1,Kn=null,Zn=null,Jn=null,oa=new Map,ca=new Map,Fn=[],yv="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 ap(e,t){switch(e){case"focusin":case"focusout":Kn=null;break;case"dragenter":case"dragleave":Zn=null;break;case"mouseover":case"mouseout":Jn=null;break;case"pointerover":case"pointerout":oa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ca.delete(t.pointerId)}}function ua(e,t,i,s,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:c,targetContainers:[o]},t!==null&&(t=_i(t),t!==null&&np(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function gv(e,t,i,s,o){switch(t){case"focusin":return Kn=ua(Kn,e,t,i,s,o),!0;case"dragenter":return Zn=ua(Zn,e,t,i,s,o),!0;case"mouseover":return Jn=ua(Jn,e,t,i,s,o),!0;case"pointerover":var c=o.pointerId;return oa.set(c,ua(oa.get(c)||null,e,t,i,s,o)),!0;case"gotpointercapture":return c=o.pointerId,ca.set(c,ua(ca.get(c)||null,e,t,i,s,o)),!0}return!1}function lp(e){var t=Ti(e.target);if(t!==null){var i=f(t);if(i!==null){if(t=i.tag,t===13){if(t=d(i),t!==null){e.blockedOn=t,bu(e.priority,function(){ip(i)});return}}else if(t===31){if(t=m(i),t!==null){e.blockedOn=t,bu(e.priority,function(){ip(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ql(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=wc(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);wr=s,i.target.dispatchEvent(s),wr=null}else return t=_i(i),t!==null&&np(t),e.blockedOn=i,!1;t.shift()}return!0}function rp(e,t,i){ql(e)&&i.delete(t)}function vv(){xc=!1,Kn!==null&&ql(Kn)&&(Kn=null),Zn!==null&&ql(Zn)&&(Zn=null),Jn!==null&&ql(Jn)&&(Jn=null),oa.forEach(rp),ca.forEach(rp)}function Ll(e,t){e.blockedOn===t&&(e.blockedOn=null,xc||(xc=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,vv)))}var Hl=null;function op(e){Hl!==e&&(Hl=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){Hl===e&&(Hl=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],o=e[t+2];if(typeof s!="function"){if(Sc(s||i)===null)continue;break}var c=_i(i);c!==null&&(e.splice(t,3),t-=3,wo(c,{pending:!0,data:o,method:i.method,action:s},s,o))}}))}function rs(e){function t(b){return Ll(b,e)}Kn!==null&&Ll(Kn,e),Zn!==null&&Ll(Zn,e),Jn!==null&&Ll(Jn,e),oa.forEach(t),ca.forEach(t);for(var i=0;i<Fn.length;i++){var s=Fn[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Fn.length&&(i=Fn[0],i.blockedOn===null);)lp(i),i.blockedOn===null&&Fn.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var o=i[s],c=i[s+1],h=o[pt]||null;if(typeof c=="function")h||op(i);else if(h){var p=null;if(c&&c.hasAttribute("formAction")){if(o=c,h=c[pt]||null)p=h.formAction;else if(Sc(o)!==null)continue}else p=h.action;typeof p=="function"?i[s+1]=p:(i.splice(s,3),s-=3),op(i)}}}function cp(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(h){return o=h})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),s||setTimeout(i,20)}function i(){if(!s&&!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 s=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function Ec(e){this._internalRoot=e}$l.prototype.render=Ec.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var i=t.current,s=Ot();ep(i,s,e,t,null,null)},$l.prototype.unmount=Ec.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ep(e.current,2,null,e,null,null),Sl(),t[ki]=null}};function $l(e){this._internalRoot=e}$l.prototype.unstable_scheduleHydration=function(e){if(e){var t=vu();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Fn.length&&t!==0&&t<Fn[i].priority;i++);Fn.splice(i,0,e),i===0&&lp(e)}};var up=n.version;if(up!=="19.2.8")throw Error(l(527,up,"19.2.8"));$.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=y(t),e=e!==null?z(e):null,e=e===null?null:e.stateNode,e};var bv={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yl.isDisabled&&Yl.supportsFiber)try{bs=Yl.inject(bv),St=Yl}catch{}}return pa.createRoot=function(e,t){if(!u(e))throw Error(l(299));var i=!1,s="",o=gh,c=vh,h=bh;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=Id(e,1,!1,null,null,i,s,null,o,c,h,cp),e[ki]=t.current,sc(e),new Ec(t)},pa.hydrateRoot=function(e,t,i){if(!u(e))throw Error(l(299));var s=!1,o="",c=gh,h=vh,p=bh,b=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(o=i.identifierPrefix),i.onUncaughtError!==void 0&&(c=i.onUncaughtError),i.onCaughtError!==void 0&&(h=i.onCaughtError),i.onRecoverableError!==void 0&&(p=i.onRecoverableError),i.formState!==void 0&&(b=i.formState)),t=Id(e,1,!0,t,i??null,s,o,b,c,h,p,cp),t.context=Pd(null),i=t.current,s=Ot(),s=hr(s),o=Un(s),o.callback=null,Dn(i,o,s),i=s,t.current.lanes=i,Ss(t,i),en(t),e[ki]=t.current,sc(e),new $l(t)},pa.version="19.2.8",pa}var Np;function Dv(){if(Np)return Oc.exports;Np=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),Oc.exports=Uv(),Oc.exports}var Bv=Dv(),Xl={exports:{}},Op;function qv(){if(Op)return Xl.exports;Op=1;var r=typeof Reflect=="object"?Reflect:null,n=r&&typeof r.apply=="function"?r.apply:function(M,H,B){return Function.prototype.apply.call(M,H,B)},a;r&&typeof r.ownKeys=="function"?a=r.ownKeys:Object.getOwnPropertySymbols?a=function(M){return Object.getOwnPropertyNames(M).concat(Object.getOwnPropertySymbols(M))}:a=function(M){return Object.getOwnPropertyNames(M)};function l(N){console&&console.warn&&console.warn(N)}var u=Number.isNaN||function(M){return M!==M};function f(){f.init.call(this)}Xl.exports=f,Xl.exports.once=R,f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var d=10;function m(N){if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N)}Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(N){if(typeof N!="number"||N<0||u(N))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+N+".");d=N}}),f.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},f.prototype.setMaxListeners=function(M){if(typeof M!="number"||M<0||u(M))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+M+".");return this._maxListeners=M,this};function g(N){return N._maxListeners===void 0?f.defaultMaxListeners:N._maxListeners}f.prototype.getMaxListeners=function(){return g(this)},f.prototype.emit=function(M){for(var H=[],B=1;B<arguments.length;B++)H.push(arguments[B]);var Q=M==="error",ne=this._events;if(ne!==void 0)Q=Q&&ne.error===void 0;else if(!Q)return!1;if(Q){var se;if(H.length>0&&(se=H[0]),se instanceof Error)throw se;var xe=new Error("Unhandled error."+(se?" ("+se.message+")":""));throw xe.context=se,xe}var oe=ne[M];if(oe===void 0)return!1;if(typeof oe=="function")n(oe,this,H);else for(var je=oe.length,Ge=K(oe,je),B=0;B<je;++B)n(Ge[B],this,H);return!0};function y(N,M,H,B){var Q,ne,se;if(m(H),ne=N._events,ne===void 0?(ne=N._events=Object.create(null),N._eventsCount=0):(ne.newListener!==void 0&&(N.emit("newListener",M,H.listener?H.listener:H),ne=N._events),se=ne[M]),se===void 0)se=ne[M]=H,++N._eventsCount;else if(typeof se=="function"?se=ne[M]=B?[H,se]:[se,H]:B?se.unshift(H):se.push(H),Q=g(N),Q>0&&se.length>Q&&!se.warned){se.warned=!0;var xe=new Error("Possible EventEmitter memory leak detected. "+se.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");xe.name="MaxListenersExceededWarning",xe.emitter=N,xe.type=M,xe.count=se.length,l(xe)}return N}f.prototype.addListener=function(M,H){return y(this,M,H,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(M,H){return y(this,M,H,!0)};function z(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function w(N,M,H){var B={fired:!1,wrapFn:void 0,target:N,type:M,listener:H},Q=z.bind(B);return Q.listener=H,B.wrapFn=Q,Q}f.prototype.once=function(M,H){return m(H),this.on(M,w(this,M,H)),this},f.prototype.prependOnceListener=function(M,H){return m(H),this.prependListener(M,w(this,M,H)),this},f.prototype.removeListener=function(M,H){var B,Q,ne,se,xe;if(m(H),Q=this._events,Q===void 0)return this;if(B=Q[M],B===void 0)return this;if(B===H||B.listener===H)--this._eventsCount===0?this._events=Object.create(null):(delete Q[M],Q.removeListener&&this.emit("removeListener",M,B.listener||H));else if(typeof B!="function"){for(ne=-1,se=B.length-1;se>=0;se--)if(B[se]===H||B[se].listener===H){xe=B[se].listener,ne=se;break}if(ne<0)return this;ne===0?B.shift():F(B,ne),B.length===1&&(Q[M]=B[0]),Q.removeListener!==void 0&&this.emit("removeListener",M,xe||H)}return this},f.prototype.off=f.prototype.removeListener,f.prototype.removeAllListeners=function(M){var H,B,Q;if(B=this._events,B===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):B[M]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete B[M]),this;if(arguments.length===0){var ne=Object.keys(B),se;for(Q=0;Q<ne.length;++Q)se=ne[Q],se!=="removeListener"&&this.removeAllListeners(se);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(H=B[M],typeof H=="function")this.removeListener(M,H);else if(H!==void 0)for(Q=H.length-1;Q>=0;Q--)this.removeListener(M,H[Q]);return this};function j(N,M,H){var B=N._events;if(B===void 0)return[];var Q=B[M];return Q===void 0?[]:typeof Q=="function"?H?[Q.listener||Q]:[Q]:H?ee(Q):K(Q,Q.length)}f.prototype.listeners=function(M){return j(this,M,!0)},f.prototype.rawListeners=function(M){return j(this,M,!1)},f.listenerCount=function(N,M){return typeof N.listenerCount=="function"?N.listenerCount(M):L.call(N,M)},f.prototype.listenerCount=L;function L(N){var M=this._events;if(M!==void 0){var H=M[N];if(typeof H=="function")return 1;if(H!==void 0)return H.length}return 0}f.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]};function K(N,M){for(var H=new Array(M),B=0;B<M;++B)H[B]=N[B];return H}function F(N,M){for(;M+1<N.length;M++)N[M]=N[M+1];N.pop()}function ee(N){for(var M=new Array(N.length),H=0;H<M.length;++H)M[H]=N[H].listener||N[H];return M}function R(N,M){return new Promise(function(H,B){function Q(se){N.removeListener(M,ne),B(se)}function ne(){typeof N.removeListener=="function"&&N.removeListener("error",Q),H([].slice.call(arguments))}X(N,M,ne,{once:!0}),M!=="error"&&Z(N,Q,{once:!0})})}function Z(N,M,H){typeof N.on=="function"&&X(N,"error",M,H)}function X(N,M,H,B){if(typeof N.on=="function")B.once?N.once(M,H):N.on(M,H);else if(typeof N.addEventListener=="function")N.addEventListener(M,function Q(ne){B.once&&N.removeEventListener(M,Q),H(ne)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof N)}return Xl.exports}var ei=qv();const Il=Av(ei),Lv=Object.prototype.toString,Hv="[object Uint8Array]",$v="[object ArrayBuffer]";function ym(r,n,a){return r?r.constructor===n?!0:Lv.call(r)===a:!1}function Yv(r){return ym(r,Uint8Array,Hv)}function Vv(r){return ym(r,ArrayBuffer,$v)}function Xv(r){return Yv(r)||Vv(r)}function Gv(r){if(!Xv(r))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof r}\``)}const jp={utf8:new globalThis.TextDecoder("utf8")};function gm(r,n="utf8"){return Gv(r),jp[n]??=new globalThis.TextDecoder(n),jp[n].decode(r)}function Qv(r){if(typeof r!="string")throw new TypeError(`Expected \`string\`, got \`${typeof r}\``)}const Kv=new globalThis.TextEncoder;function vm(r){return Qv(r),Kv.encode(r)}Array.from({length:256},(r,n)=>n.toString(16).padStart(2,"0"));const ut=[];for(let r=0;r<256;++r)ut.push((r+256).toString(16).slice(1));function Zv(r,n=0){return(ut[r[n+0]]+ut[r[n+1]]+ut[r[n+2]]+ut[r[n+3]]+"-"+ut[r[n+4]]+ut[r[n+5]]+"-"+ut[r[n+6]]+ut[r[n+7]]+"-"+ut[r[n+8]]+ut[r[n+9]]+"-"+ut[r[n+10]]+ut[r[n+11]]+ut[r[n+12]]+ut[r[n+13]]+ut[r[n+14]]+ut[r[n+15]]).toLowerCase()}const Jv=new Uint8Array(16);function Fv(){return crypto.getRandomValues(Jv)}function et(r,n,a){return crypto.randomUUID?crypto.randomUUID():Wv(r)}function Wv(r,n,a){r=r||{};const l=r.random??r.rng?.()??Fv();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,Zv(l)}const Lc=1024,Rp="$",Si={openBrace:123,closeBrace:125,quote:34,backslash:92,delimiter:36},zp=(r,n)=>{if(n===0||r(0)!==Si.openBrace)return-1;const a=Math.min(n,Lc);let l=0,u=!1,f=!1;for(let d=0;d<a;d++){const m=r(d);if(u){f?f=!1:m===Si.backslash?f=!0:m===Si.quote&&(u=!1);continue}if(m===Si.quote)u=!0;else if(m===Si.openBrace)l++;else if(m===Si.closeBrace&&--l===0){const g=d+1;return g<a&&r(g)===Si.delimiter?g:-1}}return-1},_e={connected:"connected",disconnected:"disconnected",peerOnline:"peerOnline",peerGone:"peerGone",peerDisplaced:"peerDisplaced",peerShape:"peerShape",rejected:"rejected",unroutable:"unroutable",transportError:"transportError",relayed:"relayed"};class bm{maxPeers;peers=new Map;constructor(n=1e4){this.maxPeers=n}set(n,a){for(this.peers.delete(n),this.peers.set(n,a);this.peers.size>this.maxPeers;){const l=this.peers.keys().next();if(l.done)break;this.peers.delete(l.value)}}get(n){return this.peers.get(n)}delete(n){return this.shapes.delete(n),this.peers.delete(n)}clear(){this.peers.clear(),this.shapes.clear()}shapes=new Map;noteShape(n,a){if(this.shapes.get(n)===a)return!1;for(this.shapes.delete(n),this.shapes.set(n,a);this.shapes.size>this.maxPeers;){const l=this.shapes.keys().next();if(l.done)break;this.shapes.delete(l.value)}return!0}shapeOf(n){return this.shapes.get(n)}get size(){return this.peers.size}namesFor(n){const a=[];for(const[l,u]of this.peers)u===n&&a.push(l);return a}names(){return[...this.peers.keys()]}}class rr extends ei.EventEmitter{name;destinations=[];peerRegistry=new bm;readyFlag=!1;seq=0;constructor(n,a){super(),this.name=n,n||(this.name=et()),a&&a.forEach(l=>{l.pipe(this)})}async ready(n=3e4){const a=Date.now()+n;for(;!this.readyFlag;){if(Date.now()>a)return!1;await new Promise(l=>setTimeout(l,10))}return!0}async open(){}async close(){}buildHeader(n,a,l){return{source:n,target:a,time:Date.now(),seq:this.seq++,...l}}prependHeader(n,a,l){return this.frameMessage(this.buildHeader(n,a),l)}frameMessage(n,a){const l=JSON.stringify(n)+Rp,u=vm(l);if(u.length>Lc)throw new Error(`message header is ${u.length} bytes, over the ${Lc} byte limit (source '${n.source}', target '${n.target}') - shorten the peer names`);if(typeof a=="string")return l+a;const f=new Uint8Array(u.length+a.length);return f.set(u,0),f.set(a,u.length),f}extractHeader(n){const a=typeof n=="string",l=zp(a?g=>n.charCodeAt(g):g=>n[g],n.length);if(l<0)return[void 0,"","no msgrpc header"];const u=a?n.substring(0,l):gm(n.subarray(0,l));let f;try{f=JSON.parse(u)}catch(g){return[void 0,"",`unparsable header: ${String(g)}`]}if(!f||typeof f!="object")return[void 0,"","header is not an object"];if(typeof f.target!="string"||!f.target)return[void 0,"","header names no target"];if(typeof f.source!="string"||!f.source)return[void 0,"","header names no source"];const d=l+Rp.length,m=a?n.substring(d):n.slice(d);return this.setKnownSource(f.source),[f,m]}getName(){return this.name}targetExists(n,a){let l;this.name===n&&(l=this);const u=this.peerRegistry.get(n);return u&&(l=u),l||this.destinations.map(f=>{!l&&!f.target.isTransport()&&f.target.targetExists(n,(a||0)+1)&&(l=f.target)}),l}pipe(n){const a=et();return this.destinations.push({id:a,target:n}),()=>{this.destinations=this.destinations.filter(l=>l.id!==a)}}async receive(n,a,l){}async receivePayload(n,a,l){}async send(n,a,l){await Promise.all(this.destinations.map(async u=>await u.target.receive(n,a,l)))}setKnownSource(n){this.peerRegistry.set(n,this)}usePeerRegistry(n){return this.peerRegistry=n,this}getIdentity(n){}async sendPayload(n,a,l,u){}isTransport(){return!1}}var We;(function(r){r.RequestMessage="REQUEST",r.ResponseMessage="RESPONSE",r.ErrorMessage="ERROR",r.EventMessage="EVENT",r.UnknownMessage="UNKNOWN"})(We||(We={}));class wm{type;payload}const Iv=(r,n,a,l)=>{const u=new wm;return u.type=l||We.UnknownMessage,u.payload=r,u};class Sm extends rr{name;constructor(n,a){super(n),this.name=n,n||(this.name=et()),a&&a.forEach(l=>{l.pipe(this)})}pipe(n){const a=et();return this.destinations.push({id:a,target:n}),()=>{this.destinations=this.destinations.filter(l=>l.id!==a)}}receive(n,a,l){return Promise.resolve()}async send(n,a,l){await Promise.all(this.destinations.map(async u=>await u.target.receive(n,a,l)))}async sendPayload(n,a,l,u){const f=Iv(n,this.name,u,a);await this.send(f,l,u)}}const Pv=r=>r==="on"||r==="addListener"||r==="prependListener"||r==="once"||r==="prependOnceListener"||r==="off"||r==="removeListener"||r==="emit"||r==="removeListener"||r==="removeAllListeners"||r==="setMaxListeners"||r==="getMaxListeners";var Xe;(function(r){r.CallInstanceMethod="POST",r.success="SUCCESS",r.error="ERROR",r.event="EVENT"})(Xe||(Xe={}));const Gl={query:0,"idempotent-command":1,"non-repeatable-command":2},Mc=r=>{if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&typeof r=="object"){const n=r;if(typeof n.message=="string")return{name:typeof n.name=="string"?n.name:"Error",message:n.message}}return{name:"Error",message:String(r)}},e0=r=>"code"in r,Hc=new WeakMap,$c=new WeakMap,Yc=new WeakMap,Vc=new WeakMap,Xc=new WeakMap,Gc=new WeakMap,t0=(r,n,a,l,u,f,d)=>{let m=Hc.get(r);if(m||Hc.set(r,m=new Set),m.add(n),l){let y=Yc.get(r);y||Yc.set(r,y=new Set),y.add(n)}if(u){let y=Vc.get(r);y||Vc.set(r,y=new Set),y.add(n)}if(f){let y=Xc.get(r);y||Xc.set(r,y=new Set),y.add(n)}if(d){let y=Gc.get(r);y||Gc.set(r,y=new Map),y.set(n,d)}if(!a)return;let g=$c.get(r);g||$c.set(r,g=new Map),g.set(n,a)},Mp=(r,n)=>{if(r.static)throw new Error("@rpc: static methods cannot be exposed");if(r.private)throw new Error("@rpc: private methods cannot be exposed");r.addInitializer(function(){t0(this.constructor,String(r.name),n.semantics,n.conflate,n.requiresAuthority,n.injectInvocation,n.effect)})};function fs(r,n){if(typeof r=="function"&&n)return Mp(n,{});const a=r;return(l,u)=>Mp(u,a)}const xm=new WeakMap,Em=(r,n={})=>(a,l)=>(xm.set(a,{name:r,version:n.version,execution:n.execution,mailbox:n.mailbox}),a),n0=r=>{for(let n=r.constructor;n;n=Object.getPrototypeOf(n)){const a=xm.get(n);if(a)return a}},i0=r=>{const n=new Set;for(let a=r.constructor;a;a=Object.getPrototypeOf(a))for(const l of Hc.get(a)??[])n.add(l);return n.size?n:void 0},s0=r=>{const n=new Map;for(let a=r.constructor;a;a=Object.getPrototypeOf(a))for(const[l,u]of $c.get(a)??[])n.has(l)||n.set(l,u);return n},a0=r=>{const n=new Map;for(let a=r.constructor;a;a=Object.getPrototypeOf(a))for(const[l,u]of Gc.get(a)??[])n.has(l)||n.set(l,u);return n},l0=r=>{const n=new Set;for(let a=r.constructor;a;a=Object.getPrototypeOf(a))for(const l of Yc.get(a)??[])n.add(l);return n},r0=r=>{const n=new Set;for(let a=r.constructor;a;a=Object.getPrototypeOf(a))for(const l of Vc.get(a)??[])n.add(l);return n},o0=r=>{const n=new Set;for(let a=r.constructor;a;a=Object.getPrototypeOf(a))for(const l of Xc.get(a)??[])n.add(l);return n},c0=Symbol("@source-repo/rpc/invocation"),Cp=(r,n)=>!!r&&!!n&&r.peer===n.peer&&r.instance===n.instance;class u0{durable=!1;async load(){}async save(){}}const dt="$host",Ql=128,km=/[\u0000-\u001f\u007f]/,In=(r,n)=>{if(!r)throw new Error(`topology: ${n} is empty`);if(km.test(r))throw new Error(`topology: ${n} contains a control character, and ids never do`)},Cc=r=>{if(r!==void 0&&km.test(r))throw new Error("topology: a label contains a control character")};class f0{peer;options;records=new Map;onCommitted;listeners=new Map;store;loaded=!1;constructor(n,a={}){this.peer=n,this.options=a;for(const l of a.place??[])In(l,`place segment '${l}'`);Cc(a.label),this.store=a.store??new u0}async init(){const n=await this.store.load();if(n)for(const a of n)this.records.set(a.ref.instance,a);this.records.has(dt)||this.records.set(dt,{ref:{peer:this.peer,instance:dt},parent:null,owner:null,parentEpoch:et(),ownerEpoch:et(),version:{epoch:et(),revision:0},...this.options.label!==void 0?{label:this.options.label}:{}}),this.loaded=!0,await this.persist()}ref(n){return{peer:this.peer,instance:n}}get(n){return this.records.get(n)}all(){return[...this.records.values()]}get place(){return this.options.place}capabilities(){return{authorityScope:"host",cycleGuarantee:"detected",reverseIndex:"eventual",deletion:"tombstone",durability:this.store.durable?"durable":"volatile"}}async declare(n,a={}){if(this.assertLoaded(),In(n,`instance '${n}'`),n===dt)throw new Error(`topology: ${dt} is the synthetic root - set its links with updateHost()`);if(this.records.has(n))throw new Error(`topology: ${n} is already declared - changes go through update() with the expected version`);Cc(a.label);const l=a.parent===void 0?this.ref(dt):a.parent;this.checkParent(n,l),this.checkOwner(n,a.owner??null);const u={ref:this.ref(n),parent:l,owner:a.owner??null,parentEpoch:et(),ownerEpoch:et(),version:{epoch:et(),revision:0},...a.label!==void 0?{label:a.label}:{}};return this.records.set(n,u),await this.persist(),this.notify(n),u}async update(n,a,l){this.assertLoaded();const u=this.records.get(n);if(!u)throw new Error(`topology: ${n} is not declared here`);if(u.version.epoch!==l.expectedVersion.epoch||u.version.revision!==l.expectedVersion.revision)throw new Error(`topology: ${n} is at revision ${u.version.revision}, not ${l.expectedVersion.revision} - read it again and decide again`);Cc(a.label),a.parent!==void 0&&(n===dt?this.checkRootParent(a.parent):this.checkParent(n,a.parent)),a.owner!==void 0&&this.checkOwner(n,a.owner);const f={...u,...a.parent!==void 0?{parent:a.parent,parentEpoch:et()}:{},...a.owner!==void 0?{owner:a.owner,ownerEpoch:et()}:{},...a.label!==void 0?{label:a.label}:{},version:{epoch:u.version.epoch,revision:u.version.revision+1}};return this.records.set(n,f),await this.persist(),this.notify(n),f}async updateHost(n,a){return this.update(dt,n,a)}checkParent(n,a){if(a===null)return;if(In(a.peer,"parent peer"),In(a.instance,"parent instance"),a.peer!==this.peer)throw new Error(`topology: ${n} cannot have a remote physical parent - only the ${dt} root may, root to root`);if(a.instance===n)throw new Error(`topology: ${n} cannot be its own parent`);const l=new Set([n]);let u=a.instance;for(;u!==void 0;){if(l.has(u))throw new Error(`topology: parenting ${n} under ${a.instance} closes a physical cycle`);l.add(u);const f=this.records.get(u);u=f?.parent&&f.parent.peer===this.peer?f.parent.instance:void 0}}checkRootParent(n){if(n!==null){if(In(n.peer,"parent peer"),In(n.instance,"parent instance"),n.peer===this.peer)throw new Error(`topology: the ${dt} root's parent is another host's root, not something on this host`);if(n.instance!==dt)throw new Error("topology: a host root's parent must be another host root - physical edges cross hosts only root to root")}}checkOwner(n,a){if(a!==null&&(In(a.peer,"owner peer"),In(a.instance,"owner instance"),a.peer===this.peer&&a.instance===n))throw new Error(`topology: ${n} cannot own itself`)}physicalPath(n){const a=this.options.place??[this.peer],l=[],u=new Set;let f=n;for(let d=0;d<=Ql;d++){if(f===void 0)return{segments:l,validity:{status:"valid"}};if(f===dt)return{segments:[...a,...l],validity:{status:"valid"}};if(u.has(f))return{segments:l,validity:{status:"cycle",path:[...u].map(g=>this.ref(g))}};u.add(f);const m=this.records.get(f);if(!m)return{segments:l,validity:{status:"unresolved",at:this.ref(f)}};l.unshift(f),f=m.parent===null?void 0:m.parent.peer===this.peer?m.parent.instance:dt}return{segments:l,validity:{status:"depth-exceeded",maxDepth:Ql}}}ownerChain(n){const a=[],l=new Set;let u=n;for(let f=0;f<=Ql;f++){if(u===void 0)return{chain:a,validity:{status:"valid"}};if(l.has(u))return{chain:a,validity:{status:"cycle",path:a.slice(a.findIndex(m=>m.instance===u))}};l.add(u);const d=this.records.get(u);if(!d)return{chain:a,validity:{status:"unresolved",at:this.ref(u)}};if(a.push(d.ref),d.owner===null)return{chain:a,validity:{status:"valid"}};if(d.owner.peer!==this.peer)return{chain:a,continuesAt:d.owner,validity:{status:"valid"}};u=d.owner.instance}return{chain:a,validity:{status:"depth-exceeded",maxDepth:Ql}}}externalStore(n){return{getSnapshot:()=>this.records.get(n),subscribe:a=>{let l=this.listeners.get(n);return l||this.listeners.set(n,l=new Set),l.add(a),()=>l.delete(a)}}}notify(n){try{this.onCommitted?.()}catch{}for(const a of[...this.listeners.get(n)??[]])try{a()}catch{}}assertLoaded(){if(!this.loaded)throw new Error("topology: not loaded yet - await the server ready()")}async persist(){await this.store.save(this.all())}}const h0=16*1024,Up=64*1024,d0=128,Tm=r=>{const n=JSON.stringify(r);return n===void 0?8:n.length};class p0 extends ei.EventEmitter{topology;providers=new Map;subscriptions=new Map;push;constructor(n){super(),this.topology=n}key(n,a){return`${n}\0${a}`}provide(n,a,l){const u=this.key(n,a.id);if(this.providers.has(u))throw new Error(`context: ${n} already provides ${a.id} - one provider owns one value`);const f=a.maxSerializedBytes??h0,d=g=>{const y=Tm(g);if(y>f)throw new Error(`context: a ${a.id} value of ${y} bytes exceeds its ${f} byte bound - context is ambient data, not a payload`);return g},m={token:a,value:d(l),epoch:et(),revision:0};return this.providers.set(u,m),this.changed(),{set:g=>{m.value=d(g),m.revision++,this.changed()},clear:()=>{this.providers.get(u)===m&&(this.providers.delete(u),this.changed())}}}changed(){for(const[n,a]of this.subscriptions)a.queued||(a.queued=!0,queueMicrotask(()=>{a.queued=!1,this.subscriptions.has(n)&&(a.seq++,this.push?.(a.source,{subscriptionId:a.subscriptionId,snapshot:this.snapshotFor(a.node,a.tokenIds,a.seq,!0)}))}));this.emit("contextChanged")}walk(n,a){const l=[],u=new Set;let f=n;for(let d=0;d<=d0;d++){if(f===void 0)return{refs:l};if(u.has(f))return{refs:l,trouble:{axis:a,status:"cycle",path:l.slice(l.findIndex(y=>y.instance===f))}};u.add(f);const m=this.topology.get(f);if(!m)return{refs:l,trouble:{axis:a,status:"invalid-reference",at:{peer:this.topology.peer,instance:f}}};l.push(m.ref);const g=a==="physical"?m.parent:m.owner;if(g===null)return{refs:l};if(g.peer!==this.topology.peer)return{refs:l,continues:g};f=g.instance}return{refs:l,trouble:{axis:a,status:"depth-exceeded"}}}chainKeyOf(n,a){return n.map(l=>{const u=this.topology.get(l.instance);return u?a==="physical"?u.parentEpoch:u.ownerEpoch:"missing"}).join("\0")}snapshotFor(n,a,l,u){const f=this.walk(n,"physical"),d=this.walk(n,"logical"),m=[...f.trouble?[f.trouble]:[],...d.trouble?[d.trouble]:[]],g=a.map(y=>{const z=[];for(const[w,j]of[["physical",f.refs],["logical",d.refs]])for(const L of j){const K=this.providers.get(this.key(L.instance,y));!K||K.token.axis!==w||u&&(K.token.exposure??"remote")==="local"||z.push({node:L,axis:w,value:K.value,provider:{epoch:K.epoch,revision:K.revision}})}return{tokenId:y,entries:z}});return{node:this.topology.ref(n),walked:{physical:f.refs,logical:d.refs},continues:{...f.continues?{physical:f.continues}:{},...d.continues?{logical:d.continues}:{}},trouble:m,chainKey:{physical:this.chainKeyOf(f.refs,"physical"),logical:this.chainKeyOf(d.refs,"logical")},tokens:g,seq:l}}subscribe(n,a,l,u){const f=`${n}\0${a}`,d=this.subscriptions.get(f),m=d?++d.seq:0;return this.subscriptions.set(f,{source:n,subscriptionId:a,node:l,tokenIds:u,seq:m,queued:!1}),this.snapshotFor(l,u,m,!0)}unsubscribe(n,a){this.subscriptions.delete(`${n}\0${a}`)}dropSubscriber(n){for(const[a,l]of this.subscriptions)l.source===n&&this.subscriptions.delete(a)}get subscriptionCount(){return this.subscriptions.size}}const Ea="$context",_m="$context",m0=(r,n)=>{const a=[];for(const{token:u,entry:f}of n){if((u.capture??"never")!=="explicit")throw new Error(`context: ${u.id} declares capture '${u.capture??"never"}', so it stays on its chain`);if((u.exposure??"remote")==="local")throw new Error(`context: ${u.id} is local-only, and a capture is precisely a value leaving the host`);f&&a.push(f)}const l=a.reduce((u,f)=>u+Tm(f.value),0);if(l>Up)throw new Error(`context: a capture of ${l} bytes exceeds the ${Up} byte bound`);return{source:r,entries:a}},_n="$snapshot",Am=new WeakMap,Zt=r=>{const n=Am.get(r);if(!n)throw new Error("not an RpcComponent - components are constructed through the RpcComponent base class");return n},Kl=r=>Object.freeze({...r}),Dp=(r,n)=>{const a=Zt(r),l=n.props??a.props,u=n.state??a.state,f=a.validate?.(l,u);if(f)throw new Error(`component snapshot rejected: ${f}`);a.props=l,a.state=u,a.revision++,a.notify?.()};class hs extends ei.EventEmitter{constructor(n,a){super(),Am.set(this,{epoch:et(),revision:0,props:Kl(n),state:Kl(a),authority:Object.freeze({generation:0})})}get props(){return Zt(this).props}get state(){return Zt(this).state}setState=n=>{const a=this.state,l=typeof n=="function"?n(a):n;return Dp(this,{state:Kl({...a,...l})}),this.state};replaceState=n=>{const a=typeof n=="function"?n(this.state):n;return Dp(this,{state:Kl(a)}),this.state}}const tu=r=>{const n=Zt(r);return{epoch:n.epoch,revision:n.revision,props:n.props,state:n.state,authority:n.authority}},y0=r=>Zt(r).authority,g0=6e4,nu=(r,n,a)=>{const l=Zt(r),u=l.authority.holder;l.expiryTimer&&clearTimeout(l.expiryTimer),l.expiryTimer=void 0,l.authority=Object.freeze(n),l.revision++,n.expiresAt!==void 0&&(l.expiryTimer=setTimeout(()=>{l.expiryTimer=void 0,!(l.authority.holder!==n.holder||l.authority.generation!==n.generation)&&nu(r,{generation:l.authority.generation+1},"expired")},n.expiresAt-Date.now()),l.expiryTimer.unref?.()),r instanceof ei.EventEmitter&&r.emit("authorityChanged",{reason:a,authority:l.authority,previousHolder:u}),l.notify?.()},v0=(r,n,a,l)=>{const f=Zt(r).authority,d=Date.now(),m=f.holder!==void 0&&(f.expiresAt??0)>d;if(m&&f.holder!==n&&!l)return{granted:!1,holder:f.holder,expiresAt:f.expiresAt};const g=m&&f.holder===n;return nu(r,{holder:n,expiresAt:d+a,generation:g?f.generation:f.generation+1},g?"renewed":m?"taken":"acquired"),{granted:!0,authority:Zt(r).authority}},b0=(r,n)=>{const a=Zt(r);return a.authority.holder!==n?"ok - was not holding":(nu(r,{generation:a.authority.generation+1},"released"),"ok")},w0=1048576,S0=(r,n)=>{Zt(r).validate=n},x0=(r,n,a,l)=>{const u=Zt(r),f=n.minPublishIntervalMs??0,d=n.maxSnapshotBytes??w0;let m=!1,g=0,y;const z=()=>{g=Date.now();const w=tu(r),j=JSON.stringify(w).length;if(j>d){l?.log("Error","component snapshot not published: {estimated} bytes exceeds the {maxBytes} byte bound",{estimated:j,maxBytes:d});return}a()};u.notify=()=>{m||(m=!0,queueMicrotask(()=>{m=!1;const w=g+f-Date.now();if(w<=0)return z();y||(y=setTimeout(()=>{y=void 0,z()},w),y.unref?.())}))}},E0=1,Bp=32,Gt=r=>r===null?"null":Array.isArray(r)?"array":r instanceof Uint8Array?"bytes":r instanceof Date?"date":typeof r,Sa=r=>{switch(r.kind){case"literal":return JSON.stringify(r.value);case"array":return`${Sa(r.items)}[]`;case"tuple":return`[${r.items.map(Sa).join(", ")}]`;case"union":return r.options.map(Sa).join(" | ");case"ref":return r.name;case"object":return"object";case"record":return`{ [key: string]: ${Sa(r.values)} }`;default:return r.kind}},qp=r=>typeof r=="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof Uint8Array)&&!(r instanceof Date),tn=(r,n,a={},l="",u=0)=>{if(u>Bp)return`${l||"value"}: nested deeper than ${Bp} levels`;const f=l||"value";switch(n.kind){case"any":return;case"null":return r===null?void 0:`${f}: expected null, got ${Gt(r)}`;case"boolean":return typeof r=="boolean"?void 0:`${f}: expected boolean, got ${Gt(r)}`;case"number":return typeof r!="number"||Number.isNaN(r)?`${f}: expected number, got ${Gt(r)}`:n.integer&&!Number.isInteger(r)?`${f}: expected an integer, got ${r}`:n.min!==void 0&&r<n.min?`${f}: ${r} is below the minimum ${n.min}`:n.max!==void 0&&r>n.max?`${f}: ${r} is above the maximum ${n.max}`:void 0;case"string":return typeof r!="string"?`${f}: expected string, got ${Gt(r)}`:n.minLength!==void 0&&r.length<n.minLength?`${f}: shorter than ${n.minLength} characters`:n.maxLength!==void 0&&r.length>n.maxLength?`${f}: longer than ${n.maxLength} characters`:n.pattern!==void 0&&!new RegExp(n.pattern).test(r)?`${f}: does not match ${n.pattern}`:void 0;case"bytes":return r instanceof Uint8Array?n.maxBytes!==void 0&&r.length>n.maxBytes?`${f}: longer than ${n.maxBytes} bytes`:void 0:`${f}: expected bytes, got ${Gt(r)}`;case"date":return r instanceof Date&&!Number.isNaN(r.getTime())?void 0:`${f}: expected a date, got ${Gt(r)}`;case"literal":return r===n.value?void 0:`${f}: expected ${JSON.stringify(n.value)}`;case"array":{if(!Array.isArray(r))return`${f}: expected an array, got ${Gt(r)}`;if(n.maxItems!==void 0&&r.length>n.maxItems)return`${f}: more than ${n.maxItems} items`;for(let d=0;d<r.length;d++){const m=tn(r[d],n.items,a,`${f}[${d}]`,u+1);if(m)return m}return}case"tuple":{if(!Array.isArray(r))return`${f}: expected a tuple, got ${Gt(r)}`;if(r.length!==n.items.length)return`${f}: expected ${n.items.length} elements, got ${r.length}`;for(let d=0;d<n.items.length;d++){const m=tn(r[d],n.items[d],a,`${f}[${d}]`,u+1);if(m)return m}return}case"object":{if(!qp(r))return`${f}: expected an object, got ${Gt(r)}`;const d=r;for(const[m,g]of Object.entries(n.fields)){if(!(d[m]!==void 0)){if(g.optional)continue;return`${f}.${m}: missing`}const z=tn(d[m],g.type,a,`${f}.${m}`,u+1);if(z)return z}if(!n.additional){const m=Object.keys(d).find(g=>!(g in n.fields));if(m!==void 0)return`${f}.${m}: not part of this type`}return}case"record":{if(!qp(r))return`${f}: expected an object, got ${Gt(r)}`;const d=Object.keys(r);if(n.maxEntries!==void 0&&d.length>n.maxEntries)return`${f}: more than ${n.maxEntries} entries`;const m=n.keyPattern===void 0?void 0:new RegExp(n.keyPattern);for(const g of d){if(m&&!m.test(g))return`${f}.${g}: key does not match ${n.keyPattern}`;const y=tn(r[g],n.values,a,`${f}.${g}`,u+1);if(y)return y}return}case"union":{for(const d of n.options)if(!tn(r,d,a,f,u+1))return;return`${f}: expected ${Sa(n)}, got ${Gt(r)}`}case"ref":{const d=a[n.name];return d?tn(r,d,a,f,u+1):`${f}: unknown type '${n.name}'`}}return`${f}: unknown type kind '${n.kind}'`},k0=(r,n,a={})=>{const l=n.params.filter((u,f)=>!T0(n.params[f])).length;if(r.length<l)return`expected at least ${l} argument${l===1?"":"s"}, got ${r.length}`;if(r.length>n.params.length&&!n.rest)return`expected at most ${n.params.length} arguments, got ${r.length}`;for(let u=0;u<r.length;u++){const f=u<n.params.length?n.params[u]:n.rest,d=tn(r[u],f,a,`argument ${u}`);if(d)return d}},T0=r=>r.kind==="any"||r.kind==="union"&&r.options.some(n=>n.kind==="literal"&&n.value===null),Lp={observe:0,operate:1,program:2,"security-admin":3},Qc=(r,n)=>r.kind==="ref"?Qc(n?.[r.name]??{kind:"any"},n):r,Hp=(r,n)=>!(n.integer&&!r.integer||n.min!==void 0&&(r.min===void 0||r.min<n.min)||n.max!==void 0&&(r.max===void 0||r.max>n.max)),Kt=(r,n,a={},l=0,u=new Set)=>{if(l>64)return!1;if(r.kind==="ref"&&n.kind==="ref"){const m=`${r.name} <: ${n.name}`;if(u.has(m))return!0;u.add(m)}const f=Qc(r,a),d=Qc(n,a);if(d.kind==="any")return!0;if(f.kind==="any")return!1;if(f.kind==="union")return f.options.every(m=>Kt(m,d,a,l+1,u));if(d.kind==="union")return d.options.some(m=>Kt(f,m,a,l+1,u));if(f.kind==="literal")return d.kind==="literal"?f.value===d.value:(f.value===null?"null":typeof f.value)!==d.kind?!1:d.kind==="number"&&typeof f.value=="number"?Hp({min:f.value,max:f.value,integer:Number.isInteger(f.value)},d):!0;if(f.kind!==d.kind)return!1;switch(f.kind){case"null":case"boolean":case"date":return!0;case"number":return Hp(f,d);case"string":{const m=d;return!(m.minLength!==void 0&&(f.minLength===void 0||f.minLength<m.minLength)||m.maxLength!==void 0&&(f.maxLength===void 0||f.maxLength>m.maxLength)||m.pattern!==void 0&&m.pattern!==f.pattern)}case"bytes":{const m=d;return m.maxBytes===void 0||f.maxBytes!==void 0&&f.maxBytes<=m.maxBytes}case"array":{const m=d;return m.maxItems!==void 0&&(f.maxItems===void 0||f.maxItems>m.maxItems)?!1:Kt(f.items,m.items,a,l+1,u)}case"tuple":{const m=d;return f.items.length!==m.items.length?!1:f.items.every((g,y)=>Kt(g,m.items[y],a,l+1,u))}case"record":{const m=d;return m.maxEntries!==void 0&&(f.maxEntries===void 0||f.maxEntries>m.maxEntries)||m.keyPattern!==void 0&&m.keyPattern!==f.keyPattern?!1:Kt(f.values,m.values,a,l+1,u)}case"object":{const m=d;for(const[g,y]of Object.entries(m.fields)){const z=f.fields[g];if(!z){if(y.optional)continue;return!1}if(!y.optional&&z.optional||!Kt(z.type,y.type,a,l+1,u))return!1}if(!m.additional){for(const g of Object.keys(f.fields))if(!(g in m.fields))return!1}return!0}default:return!1}},Zl=r=>r.params.filter(n=>!(n.kind==="any"||n.kind==="union"&&n.options.some(a=>a.kind==="literal"&&a.value===null))).length,_0=(r,n,a,l)=>{const u=[];!a.rest&&a.params.length<n.params.length&&u.push({where:r,reason:`takes at most ${a.params.length} arguments, but a caller may send ${n.params.length}`}),Zl(a)>Zl(n)&&u.push({where:r,reason:`requires ${Zl(a)} arguments, but a caller may send as few as ${Zl(n)}`});for(let y=0;y<n.params.length;y++){const z=y<a.params.length?a.params[y]:a.rest;z&&(Kt(n.params[y],z,l)||u.push({where:`${r} argument ${y}`,reason:"narrowed, so a value the caller may send is no longer accepted"}))}n.returns&&a.returns&&!Kt(a.returns,n.returns,l)&&u.push({where:`${r} return`,reason:"widened, so a value this contract may return is not one the caller expects"});const f=n.semantics,d=a.semantics;f&&d&&Gl[d]>Gl[f]&&u.push({where:r,reason:`is now ${d} where the caller was told ${f}, so a retry the caller may already make is no longer safe`}),f&&!d&&Gl[f]<Gl["non-repeatable-command"]&&u.push({where:r,reason:`no longer declares that it is ${f}, so a caller relying on that promise has nothing to rely on`});const m=n.effect,g=a.effect;return m&&g&&Lp[g]>Lp[m]&&u.push({where:r,reason:`now has effect '${g}' where the caller was told '${m}', so a caller granted the lesser authority is refused`}),m&&!g&&u.push({where:r,reason:`no longer declares effect '${m}', so it falls back to the default and a grant written against the declaration no longer matches`}),u},A0=(r,n,a={})=>{const l=[];for(const[u,f]of Object.entries(r.methods)){const d=n.methods[u];if(!d){l.push({where:u,reason:"no longer exists"});continue}l.push(..._0(u,f,d,a))}for(const[u,f]of Object.entries(r.events??{})){const d=n.events?.[u];if(!d){l.push({where:`event ${u}`,reason:"is no longer emitted, so a subscription to it would never fire"});continue}for(let m=0;m<d.params.length;m++){const g=f.params[m];if(!g){l.push({where:`event ${u} argument ${m}`,reason:"is emitted but the caller does not expect it"});continue}Kt(d.params[m],g,a)||l.push({where:`event ${u} argument ${m}`,reason:"widened, so a value this contract may emit is not one the caller expects"})}}for(const u of r.capabilities??[])n.capabilities?.includes(u)||l.push({where:`capability ${u}`,reason:"is no longer declared, so whatever found this peer by it will stop finding it"});return r.component&&(n.component?(Kt(n.component.props,r.component.props,a)||l.push({where:"component props",reason:"widened, so a snapshot this contract may serve is not one the observer expects"}),Kt(n.component.state,r.component.state,a)||l.push({where:"component state",reason:"widened, so a snapshot this contract may serve is not one the observer expects"})):l.push({where:"component",reason:"is no longer served, so an observer would wait forever for a snapshot"})),l},N0=(r,n,a,l)=>l.length?`${r}@${n} is not compatible with ${r}@${a??"current"}: `+l.map(u=>`${u.where} ${u.reason}`).join("; "):void 0;class O0{rpcServer;instance;event;target;instanceName;listener=(...n)=>{this.rpcServer.sendEvent(this.target,this.event,n,this.instanceName).catch(a=>this.rpcServer.emit("deliveryError",{target:this.target,event:this.event,path:this.instanceName,error:a}))};constructor(n,a,l,u,f){this.rpcServer=n,this.instance=a,this.event=l,this.target=u,this.instanceName=f}attach(){this.instance.on(this.event,this.listener)}detach(){this.instance.removeListener(this.event,this.listener)}}const $p=(r,n,a)=>`${r}\0${n}\0${a}`,Yp=r=>r.type===Xe.CallInstanceMethod,j0=100,R0=new Set(["Unauthorized","Forbidden","InvalidParams","IncompatibleVersion","ClassNotFound","MethodNotFound","TransportError","Timeout","UnknownOutcome"]),z0=r=>{const n=r?.code;return typeof n=="string"&&R0.has(n)?n:"Exception"};class M0 extends Sm{manageRpc=new C0;eventProxies=new Map;epoch=typeof globalThis.crypto?.randomUUID=="function"?globalThis.crypto.randomUUID().slice(0,8):et().slice(0,8);eventSequences=new Map;eventCounters=new Map;eventTracked=new Map;eventSequenceKey(n,a){return`${n}\0${a}`}trackEvent(n,a){if(a===_n)return;const l=this.eventSequenceKey(n,a);if(this.eventCounters.has(l))return;const u=this.manageRpc.exposedNameSpaceInstances[n];if(!(u instanceof Il))return;const f=()=>this.eventSequences.set(l,(this.eventSequences.get(l)??0)+1);this.eventCounters.set(l,f),this.eventSequences.set(l,this.eventSequences.get(l)??0),this.eventTracked.set(l,Date.now()),u.on(a,f)}eventTrackedSince(n,a){return this.eventTracked.get(this.eventSequenceKey(n,a))}trackDeclaredEvents(){for(const[n,a]of Object.entries(this.schema?.namespaces??{}))if(this.manageRpc.exposedNameSpaceInstances[n])for(const l of Object.keys(a.events??{}))this.trackEvent(n,l)}eventSequenceOf(n,a){return this.eventSequences.get(this.eventSequenceKey(n,a))}authorize;resolveIdentity;requireIdentity=!1;deduplicateRequests=!0;maxTrackedRequests=1e3;refuseExpiredCalls=!0;idempotency;schema;validation="described";hostTopology;hostContext;allowTopologyMutation=!1;validateResults=!1;unknownVersion="allow";compatibility=new Map;recentResponses=new Map;inFlightRequests=new Set;constructor(n,a){super(n,a),this.manageRpc.logger?.log("Information","RpcServerHandler {name} starting",{name:n})}async checkAccess(n,a,l){const u=this.resolveIdentity?.(a);if(this.requireIdentity&&!u)return"Unauthorized";if(!this.authorize)return;const f={identity:u,source:a,instanceName:n.path,method:n.method,params:n.params,subscription:l};try{return await this.authorize(f)?void 0:"Forbidden"}catch{return"Forbidden"}}checkParams(n){if(!this.schema||this.validation==="off")return;const a=this.schema.namespaces[n.path];if(!a)return this.validation==="required"?`${n.path} is not described by the schema`:void 0;if(a.validate===!1)return;const l=a.methods[n.method];if(!l)return this.validation==="required"?`${n.path}.${n.method} is not described by the schema`:void 0;const u=k0(n.params,l,this.schema.types);if(u)return a.version?`${u} (this server serves ${n.path}@${a.version})`:u}checkVersion(n){if(!this.schema||this.validation==="off"||!n.version)return;const a=this.schema.namespaces[n.path];if(!a||n.version===a.version)return;const l=`${n.path}@${n.version}`;if(this.compatibility.has(l))return this.compatibility.get(l);const u=a.history?.[n.version];let f;return u?f=N0(n.path,n.version,a.version,A0(u,a,this.schema.types)):f=this.unknownVersion==="reject"?`${n.path}@${n.version} is unknown to this server, which serves ${n.path}@${a.version??"an unversioned contract"}`:void 0,this.compatibility.set(l,f),f}async receive(n,a,l){this.manageRpc.logger?.log("Debug","RpcServerHandler {name} received message type {type} from {source} to {target}: {message}",{name:this.name,type:n.type,source:a,target:l,message:JSON.stringify(n)}),n.payload&&this.receivePayload(n.payload,a,l).catch(u=>this.emit("handlerError",{source:a,target:l,error:u}))}respond(n,a,l,u){if(this.deduplicateRequests)for(this.inFlightRequests.delete(n),this.recentResponses.set(n,l);this.recentResponses.size>this.maxTrackedRequests;){const f=this.recentResponses.keys().next();if(f.done)break;this.recentResponses.delete(f.value)}return this.sendPayload(l,u,this.name,a)}async receivePayload(n,a,l){try{await this.dispatch(n,a,l)}catch(u){await this.reportDispatchFailure(n,a,u)}}async reportDispatchFailure(n,a,l){this.emit("handlerError",{source:a,payload:n,error:l});const u=n.id;if(!(!Yp(n)||!u)){this.deduplicateRequests&&this.inFlightRequests.delete(u);try{await this.sendPayload({type:Xe.error,id:u,code:"Exception",error:Mc(l)},We.ErrorMessage,this.name,a)}catch{}}}async dispatch(n,a,l){const u=Date.now();if(Yp(n)){if(this.deduplicateRequests){const L=this.recentResponses.get(n.id);if(L){const K=L.code?We.ErrorMessage:We.ResponseMessage;await this.sendPayload(L,K,this.name,a);return}if(this.inFlightRequests.has(n.id))return;this.inFlightRequests.add(n.id)}const f=this.manageRpc.findNameSpaceMethodMap(n.path),d=f?.get(n.method);if(!d){const L=n.path,K=n.params[0],F=this.manageRpc.exposedNameSpaceInstances[L];if(n.method==="on"&&K===_n&&F&&!(F instanceof hs)){await this.sendError(n.id,a,"ClassNotFound",`${n.path} is not an observable component`);return}if(n.method==="on"&&F instanceof Il){const ee=await this.checkAccess(n,a,!0);if(ee){await this.sendError(n.id,a,ee,`not permitted to subscribe to ${n.path}.${K}`);return}const R=$p(L,K,a);let Z=this.eventProxies.get(R),X="ok - already exists";Z||(this.trackEvent(L,K),Z=new O0(this,F,K,a,L),this.eventProxies.set(R,Z),Z.attach(),X="ok"),K===_n&&await this.sendEvent(a,_n,[tu(F)],L),await this.respond(n.id,a,{type:Xe.success,result:X,id:n.id},We.ResponseMessage)}else if((n.method==="off"||n.method==="removeListener")&&F instanceof Il){const ee=$p(L,K,a),R=this.eventProxies.get(ee);R&&(R.detach(),this.eventProxies.delete(ee)),await this.respond(n.id,a,{type:Xe.success,result:R?"ok":"ok - was not subscribed",id:n.id},We.ResponseMessage)}else if(n.path===Ea&&(n.method==="read"||n.method==="subscribe"||n.method==="unsubscribe")){if(!this.hostContext){await this.sendError(n.id,a,"ClassNotFound","this host serves no context");return}const ee=await this.checkAccess(n,a,!1);if(ee){await this.sendError(n.id,a,ee,`not permitted to call ${n.path}.${n.method}`);return}const R=X=>Array.isArray(X)?X.map(String):[];let Z;n.method==="read"?Z=this.hostContext.snapshotFor(String(n.params[0]),R(n.params[1]),0,!0):n.method==="subscribe"?Z=this.hostContext.subscribe(a,String(n.params[0]),String(n.params[1]),R(n.params[2])):(this.hostContext.unsubscribe(a,String(n.params[0])),Z="ok"),await this.respond(n.id,a,{type:Xe.success,result:Z,id:n.id},We.ResponseMessage)}else if((n.method==="$acquire"||n.method==="$release")&&F){if(!(F instanceof hs)){await this.sendError(n.id,a,"ClassNotFound",`${n.path} is not an observable component, so it has no authority to hold`);return}const ee=await this.checkAccess(n,a,!1);if(ee){await this.sendError(n.id,a,ee,`not permitted to call ${n.path}.${n.method}`);return}if(n.method==="$acquire"){const R=n.params[0]??g0;if(typeof R!="number"||!Number.isFinite(R)||R<=0){await this.sendError(n.id,a,"InvalidParams","$acquire: the lease must expire, so its ttl is a positive number of milliseconds");return}const Z=n.params[1]?.take===!0,X=v0(F,a,R,Z);if(!X.granted){await this.sendError(n.id,a,"NotInControl",`${n.path} is controlled by ${X.holder} until ${new Date(X.expiresAt).toISOString()}`);return}await this.respond(n.id,a,{type:Xe.success,result:X.authority,id:n.id},We.ResponseMessage)}else{const R=b0(F,a);await this.respond(n.id,a,{type:Xe.success,result:R,id:n.id},We.ResponseMessage)}}else await this.sendError(n.id,a,f?"MethodNotFound":"ClassNotFound",`${n.path}.${n.method} is not exposed`);return}const m=await this.checkAccess(n,a,!1);if(m){await this.sendError(n.id,a,m,`not permitted to call ${n.path}.${n.method}`);return}const g=this.checkVersion(n);if(g){await this.sendError(n.id,a,"IncompatibleVersion",g);return}const y=this.checkParams(n);if(y){await this.sendError(n.id,a,"InvalidParams",y);return}const z=this.authorityRefusal(n,a);if(z){await this.sendError(n.id,a,"NotInControl",z);return}const w=this.fenceRefusal(n);if(w){await this.sendError(n.id,a,"OwnershipChanged",w);return}const j=this.executionKey(n,a);j===void 0?await this.invoke(n,a,u,d):await this.enqueue(j,n,a,u,d)}}async enqueue(n,a,l,u,f){const d=this.manageRpc.exposedConflation[a.path]?.has(a.method)?`${n}\0${a.method}`:void 0;let m=!1;if(d){const j=this.conflatable.get(d);j&&(j.supersede(),m=!0)}const g=this.executionWaiting.get(n)??0,y=this.manageRpc.exposedMailbox[a.path]??j0;if(!m&&g>=y){await this.sendError(a.id,l,"Busy",`${a.path}.${a.method} was not queued: ${g} calls are already waiting on this instance`);return}let z=!1;const w=d?{supersede:()=>{z=!0,this.sendError(a.id,l,"Superseded",`${a.path}.${a.method} was superseded by a newer call before it ran`).catch(()=>{})}}:void 0;d&&w&&this.conflatable.set(d,w),this.executionWaiting.set(n,g+1),await this.serialise(n,async()=>{const j=this.executionWaiting.get(n)??1;j<=1?this.executionWaiting.delete(n):this.executionWaiting.set(n,j-1),d&&this.conflatable.get(d)===w&&this.conflatable.delete(d),!z&&await this.invoke(a,l,u,f)})}executionWaiting=new Map;conflatable=new Map;async invoke(n,a,l,u){const f=this.expiredBy(n,l);if(f!==void 0){await this.sendError(n.id,a,"Timeout",`${n.path}.${n.method} was not run: its caller stopped waiting ${f} ms ago`);return}const d=this.authorityRefusal(n,a);if(d){await this.sendError(n.id,a,"NotInControl",d);return}const m=this.fenceRefusal(n);if(m){await this.sendError(n.id,a,"OwnershipChanged",m);return}const g=this.invocationFor(n,a);let y=!1;if(g){let j;try{j=await this.idempotency.begin(g)}catch(L){await this.sendError(n.id,a,"UnknownOutcome",`${n.path}.${n.method} was not run: its idempotency store could not be reached (${L instanceof Error?L.message:String(L)})`);return}if(j==="in-progress"){this.inFlightRequests.delete(n.id);return}if(j!=="acquired"){const L=e0(j)?{type:Xe.error,id:n.id,code:j.code,error:j.error}:{type:Xe.success,id:n.id,result:j.result};await this.respond(n.id,a,L,L.type===Xe.error?We.ErrorMessage:We.ResponseMessage);return}y=!0}const z=[...n.params];if(this.manageRpc.exposedInjection[n.path]?.has(n.method)){for(;z.length<u.length-1;)z.push(void 0);const j=Object.freeze({[c0]:!0,context:Object.freeze({requestId:n.id,source:a,...this.resolveIdentity?.(a)?{identity:this.resolveIdentity(a)}:{},...n.ttl!==void 0?{ttl:n.ttl}:{},...n.idempotencyKey?{idempotencyKey:n.idempotencyKey}:{}})});z.push(j)}let w;try{w=await u(...z);const j=this.checkResult(n,w);if(j){await this.settle(g,y,{code:"InvalidParams",error:{name:"RpcError",message:j}}),await this.sendError(n.id,a,"InvalidParams",j);return}await this.settle(g,y,{result:w}),await this.respond(n.id,a,{type:Xe.success,id:n.id,result:w},We.ResponseMessage)}catch(j){const L=z0(j);await this.settle(g,y,{code:L,error:Mc(j)}),await this.respond(n.id,a,{type:Xe.error,id:n.id,code:L,error:Mc(j)},We.ErrorMessage)}}async settle(n,a,l){if(!(!n||!a))try{await this.idempotency.complete(n,l)}catch(u){this.emit("idempotencyError",{invocation:n,outcome:l,error:u})}}invocationFor(n,a){if(!(!this.idempotency||this.semanticsOf(n)!=="non-repeatable-command"))return{idempotencyKey:n.idempotencyKey??n.id,requestId:n.id,scope:`${n.path}.${n.method}`,source:a,...n.ttl!==void 0?{ttl:n.ttl}:{}}}authorityRefusal(n,a){if(!this.manageRpc.exposedAuthority[n.path]?.has(n.method))return;const l=this.manageRpc.exposedNameSpaceInstances[n.path];if(!(l instanceof hs))return;const u=y0(l),f=u.holder!==void 0&&(u.expiresAt??0)>Date.now();if(!(f&&u.holder===a))return f?`${n.path}.${n.method} requires authority: ${u.holder} is in control`:`${n.path}.${n.method} requires authority: nobody is in control - $acquire it first`}fenceRefusal(n){const a=n.fence;if(!a)return;const l=this.hostTopology?.get(n.path);if(!l)return`${n.path} has no topology record here to check the owner fence against`;if(l.ownerEpoch!==a.ownerEpoch)return`${n.path} changed owner generation while this call was on its way - read the topology again and decide again`}semanticsOf(n){return this.manageRpc.exposedSemantics[n.path]?.get(n.method)??this.schema?.namespaces[n.path]?.methods[n.method]?.semantics}effectOf(n){const a=this.manageRpc.exposedEffect[n.path]?.get(n.method)??this.schema?.namespaces[n.path]?.methods[n.method]?.effect;return a||(this.semanticsOf(n)==="query"?"observe":"operate")}executionKey(n,a){const l=this.manageRpc.exposedExecution[n.path];if(!l){const f=this.semanticsOf(n);return f==="idempotent-command"||f==="non-repeatable-command"?n.path:void 0}if(l==="parallel")return;if(l==="serial")return n.path;const u={identity:this.resolveIdentity?.(a),source:a,instanceName:n.path,method:n.method,params:n.params,subscription:!1};try{return`${n.path}\0${l(u)}`}catch{return n.path}}executionQueues=new Map;async serialise(n,a){const l=this.executionQueues.get(n)??Promise.resolve();let u;const f=new Promise(m=>u=m),d=l.then(()=>f);this.executionQueues.set(n,d),await l;try{return await a()}finally{u(),this.executionQueues.get(n)===d&&this.executionQueues.delete(n)}}expiredBy(n,a){if(!this.refuseExpiredCalls||n.ttl===void 0||!Number.isFinite(n.ttl)||n.ttl<0)return;const l=Date.now()-(a+n.ttl);return l>0?l:void 0}checkResult(n,a){if(!this.validateResults||!this.schema)return;const l=this.schema.namespaces[n.path]?.methods[n.method]?.returns;if(!l)return;const u=tn(a,l,this.schema.types,"result");return u?`${n.path}.${n.method} returned a value its own schema forbids: ${u}`:void 0}sendError(n,a,l,u){return this.respond(n,a,{type:Xe.error,id:n,code:l,error:{name:"RpcError",message:u}},We.ErrorMessage)}removePeer(n){for(const[a,l]of this.eventProxies)l.target===n&&(l.detach(),this.eventProxies.delete(a))}async sendEvent(n,a,l,u){const f=u?this.eventSequenceOf(u,a):void 0;return await this.sendPayload({type:Xe.event,event:a,params:l,path:u,...f!==void 0?{seq:f,epoch:this.epoch}:{}},We.EventMessage,this.name,n)}}class C0{logger;exposedNameSpaceMethodMaps={};exposedNameSpaceInstances={};exposedClasses={};createdInstances=new Map;exposedSemantics={};exposedEffect={};exposedExecution={};exposedConflation={};exposedAuthority={};exposedInjection={};exposedMailbox={};componentContractFor;constructor(n){this.logger=n}exposeManagement(){this.getNameSpaceMethodMap("manageRpc").set("createRpcInstance",(...a)=>this.createRpcInstance(a[0],a[1],...a.slice(2))),this.exposedNameSpaceInstances.manageRpc=this}getNameSpaceMethodMap(n){let a=this.exposedNameSpaceMethodMaps[n];return a||(a=new Map,this.exposedNameSpaceMethodMaps[n]=a),a}findNameSpaceMethodMap(n){return this.exposedNameSpaceMethodMaps[n]}requireExplicitExposure=!1;exposeClassInstance(n,a,l){const u=n0(n),f=a??u?.name;if(!f)throw new Error(`exposeClassInstance: ${n.constructor.name} declares no @rpcNamespace, so a name is required`);const d=typeof l=="number"?{prototypeSteps:l}:l??{};let m=d.prototypeSteps;const g=i0(n);if(!g&&this.requireExplicitExposure)throw new Error(`exposeClassInstance: ${n.constructor.name} marks no @rpc methods and requireExplicitExposure is on`);this.exposedNameSpaceInstances[f]=n;const y=d.execution??u?.execution;y&&(this.exposedExecution[f]=y);const z=s0(n);z.size&&(this.exposedSemantics[f]=z);const w=a0(n);w.size&&(this.exposedEffect[f]=w);const j=l0(n);if(j.size){for(const X of j)if(z.get(X)!=="idempotent-command")throw new Error(`exposeClassInstance: ${f}.${X} declares conflate without 'idempotent-command' semantics - only a command that is free to repeat is free to skip`);this.exposedConflation[f]=j}const L=r0(n);if(L.size){if(!(n instanceof hs))throw new Error(`exposeClassInstance: ${f}.${[...L][0]} declares requiresAuthority, but ${n.constructor.name} is not an RpcComponent - there is no authority to check against`);this.exposedAuthority[f]=L}const K=o0(n);K.size&&(this.exposedInjection[f]=K);const F=d.mailbox??u?.mailbox;if(F!==void 0){if(!Number.isInteger(F)||F<1)throw new Error(`exposeClassInstance: ${f} declares a mailbox of ${F}; the bound is a positive count of waiting calls`);this.exposedMailbox[f]=F}if(n instanceof hs){const X=this.componentContractFor?.(f);X&&S0(n,(N,M)=>tn(N,X.component.props,X.types,"props")??tn(M,X.component.state,X.types,"state")),x0(n,d.component??{},()=>{n.emit(_n,tu(n))},this.logger)}let ee=Object.getOwnPropertyNames(n.constructor.prototype),R=Object.getPrototypeOf(n.constructor.prototype);for(;R&&R.constructor.name!=="Object"&&R.constructor.name!=="EventEmitter";){const X=Object.getOwnPropertyNames(R);if(ee=ee.concat(X),R=Object.getPrototypeOf(R),m&&m--===0)break}const Z=this.getNameSpaceMethodMap(f);for(const X of ee)X==="constructor"||typeof n[X]!="function"||g&&!g.has(X)||Z.set(X,n[X].bind(n))}exposeClass(n,a){let l=n.name;a&&(l=a),this.exposedClasses[l]=n}exposeObject(n,a){this.exposedNameSpaceInstances[a]=n;const l=Object.getOwnPropertyNames(n);for(const u of l)u!=="constructor"&&typeof n[u]=="function"&&this.getNameSpaceMethodMap(a).set(u,n[u])}expose(n,a){this.getNameSpaceMethodMap(n).set(n,a)}async createRpcInstance(n,a,...l){let u="";const f=this.exposedClasses[n];if(f){const d=a||et(),m=new f(...l);this.createdInstances.set(d,m),this.exposeClassInstance(m,d),u=d}return u}}const Nm=1e4,Pl=(r,n,a)=>`${r}\0${n}\0${a}`;class ma extends Error{code;remoteStack;constructor(n,a,l){super(a?`${n}: ${a}`:n),this.code=n,this.remoteStack=l,this.name="RpcError"}}function U0(r){return r.type===Xe.success}function D0(r){return r.type===Xe.event}function B0(r){return r.type===Xe.error}class q0 extends Sm{callTimeout;responsePromiseMap=new Map;responseTimeoutMap=new Map;schemaVersions;subscriptions=new Map;eventEmitter=new ei.EventEmitter;constructor(n,a,l=Nm){super(n,a),this.callTimeout=l}async receive(n,a,l){const u=n.payload;if(u){if(D0(u)){this.deliverEvent(u,a);return}if(U0(u)){this.takePending(u.id)?.resolve(u.result);return}B0(u)&&this.takePending(u.id)?.reject(new ma(u.code,u.error?.message,u.error?.stack))}}lastDeliveredStamp;deliverEvent(n,a){this.lastDeliveredStamp=n.seq!==void 0&&n.epoch?{peer:a??"",...n.path?{namespace:n.path}:{},event:n.event,seq:n.seq,epoch:n.epoch}:void 0;const l=this.eventEmitter;if(l instanceof ei.EventEmitter){const u=a??"",f=n.path?[Pl(u,n.path,n.event),Pl("",n.path,n.event)]:l.eventNames().filter(d=>typeof d=="string").filter(d=>{const[m,,g]=d.split("\0");return g===n.event&&(m===u||m==="")});for(const d of new Set(f))this.deliverSafely(()=>l.emit(d,...n.params),n)}this.deliverSafely(()=>this.emit(n.event,n.params),n)}deliverSafely(n,a){try{n()}catch(l){this.emit("subscriberError",{event:a.event,path:a.path,error:l})}}async resubscribe(){const n=[...this.subscriptions.values()],a=await Promise.allSettled(n.map(u=>this.call(u.remote,u.instanceName,"on",u.event))),l=a.flatMap((u,f)=>u.status==="rejected"?[{peer:n[f].remote,namespace:n[f].instanceName,event:n[f].event,error:u.reason}]:[]);return l.length&&this.emit("resubscribeFailed",l),a.length-l.length}failPendingCalls(n){for(const a of[...this.responsePromiseMap.keys()]){const l=this.sentRequests.has(a);this.sentRequests.delete(a),this.takePending(a)?.reject(l?new ma("UnknownOutcome",`${n}, after the request was sent - it may or may not have run`):new ma("TransportError",`${n}, before the request was sent`))}}sentRequests=new Set;takePending(n){if(n===void 0)return;const a=this.responsePromiseMap.get(n);this.responsePromiseMap.delete(n),this.sentRequests.delete(n);const l=this.responseTimeoutMap.get(n);return l!==void 0&&(clearTimeout(l),this.responseTimeoutMap.delete(n)),a}call(n,a,l,...u){return this.callWith({},n,a,l,...u)}callWith(n,a,l,u,...f){const d=n.timeoutMs??this.callTimeout;if(!Number.isInteger(d)||d<0)return Promise.reject(new Error(`${l}.${u}: timeoutMs must be a finite non-negative integer, not ${String(n.timeoutMs)}`));const m={id:et(),type:Xe.CallInstanceMethod,path:l,method:u,params:f,version:this.schemaVersions?.[l],ttl:d>0?d:void 0,...n.idempotencyKey?{idempotencyKey:n.idempotencyKey}:{},...n.ownerEpoch?{fence:{ownerEpoch:n.ownerEpoch}}:{}};return new Promise((g,y)=>{this.responsePromiseMap.set(m.id,{resolve:g,reject:y}),d>0&&this.responseTimeoutMap.set(m.id,setTimeout(()=>{this.takePending(m.id)?.reject(new ma("Timeout",`no response to ${l}.${u} within ${d} ms`))},d)),this.sendPayload(m,We.RequestMessage,this.name,a).then(()=>{this.responsePromiseMap.has(m.id)&&this.sentRequests.add(m.id)},z=>{this.takePending(m.id)?.reject(new ma("TransportError",z instanceof Error?z.message:String(z)))})})}proxy(n,a,l={}){const u={};return new Proxy(u,{get:(f,d)=>{let m;if(typeof d=="string"){if(f[d])return f[d];if(d==="then")return;d==="$with"?f[d]=g=>this.proxy(n,a,{...l,...g}):Pv(d)?f[d]=(...g)=>{const y=g[0];if(typeof y=="string"){const z=Pl(a??"",n,y);if(this.eventEmitter[d](z,...g.slice(1)),d==="on")this.subscriptions.set(z,{remote:a,instanceName:n,event:y});else if(d==="off"||d==="removeListener"){if(this.eventEmitter.listenerCount(z)>0)return Promise.resolve("ok - other local handlers remain");this.subscriptions.delete(z)}}else this.eventEmitter[d](...g);return this.call(a,n,d,g[0])}:f[d]=(...g)=>this.callWith(l,a,n,d,...g),m=f[d]}return m}})}}const Om=Symbol("@source-repo/rpc/component");class L0{namespace;target;release;view={epoch:"",revision:-1,props:Object.freeze({}),state:Object.freeze({}),status:"initializing",receivedAt:0};users=0;inner;store;first;listeners=new Set;retired=new Set;settleFirst;handler=n=>this.accept(n);constructor(n,a,l,u){this.namespace=a,this.target=l,this.release=u,this.inner=n.proxy(a,l),this.first=new Promise(f=>this.settleFirst=f),this.store={getSnapshot:()=>this.view,subscribe:f=>(this.listeners.add(f),()=>this.listeners.delete(f)),close:()=>this.close()}}async open(){await this.inner.on(_n,this.handler),await this.first}accept(n){this.view.status!=="closed"&&(this.retired.has(n.epoch)||this.view.epoch===n.epoch&&n.revision<=this.view.revision||(this.view.epoch&&this.view.epoch!==n.epoch&&this.retired.add(this.view.epoch),this.view={...n,status:"live",receivedAt:Date.now()},this.settleFirst(),this.notify()))}markStale(){this.view.status==="live"&&(this.view={...this.view,status:"stale",staleSince:Date.now()},this.notify())}async close(){this.users>0&&this.users--,!(this.users>0)&&(this.view={...this.view,status:"closed"},this.notify(),this.release(),await this.inner.off(_n,this.handler).catch(()=>{}))}markClosed(){this.view.status!=="closed"&&(this.view={...this.view,status:"closed"},this.notify())}notify(){for(const n of[...this.listeners])try{n()}catch{}}}class H0{handler;channels=new Map;constructor(n,a){this.handler=n,a.on(_e.disconnected,()=>{for(const l of this.channels.values())l.markStale()});for(const l of[_e.peerGone,_e.peerDisplaced])a.on(l,u=>{for(const f of this.channels.values())f.target===u&&f.markStale()})}async open(n,a){const l=`${a??""}\0${n}`;let u=this.channels.get(l);if(u)await u.first;else{u=new L0(this.handler,n,a,()=>{this.channels.delete(l)}),this.channels.set(l,u);try{await u.open()}catch(f){throw this.channels.delete(l),f}}return u.users++,u}closeAll(){for(const n of this.channels.values())n.markClosed();this.channels.clear()}}const jm=(r,n)=>new Proxy(n,{get:(a,l)=>l==="props"?r.view.props:l==="state"?r.view.state:l===Om?r.store:l==="$with"?u=>jm(r,n.$with(u)):a[l],set:(a,l,u)=>{if(l==="props"||l==="state")throw new TypeError(`${String(l)} is read-only on a component proxy - call a method to change the world`);return a[l]=u,!0}}),ln=Object.create(null);ln.open="0";ln.close="1";ln.ping="2";ln.pong="3";ln.message="4";ln.upgrade="5";ln.noop="6";const er=Object.create(null);Object.keys(ln).forEach(r=>{er[ln[r]]=r});const Kc={type:"error",data:"parser error"},Rm=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",zm=typeof ArrayBuffer=="function",Mm=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,iu=({type:r,data:n},a,l)=>Rm&&n instanceof Blob?a?l(n):Vp(n,l):zm&&(n instanceof ArrayBuffer||Mm(n))?a?l(n):Vp(new Blob([n]),l):l(ln[r]+(n||"")),Vp=(r,n)=>{const a=new FileReader;return a.onload=function(){const l=a.result.split(",")[1];n("b"+(l||""))},a.readAsDataURL(r)};function Xp(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let Uc;function $0(r,n){if(Rm&&r.data instanceof Blob)return r.data.arrayBuffer().then(Xp).then(n);if(zm&&(r.data instanceof ArrayBuffer||Mm(r.data)))return n(Xp(r.data));iu(r,!1,a=>{Uc||(Uc=new TextEncoder),n(Uc.encode(a))})}const Gp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<Gp.length;r++)xa[Gp.charCodeAt(r)]=r;const Y0=r=>{let n=r.length*.75,a=r.length,l,u=0,f,d,m,g;r[r.length-1]==="="&&(n--,r[r.length-2]==="="&&n--);const y=new ArrayBuffer(n),z=new Uint8Array(y);for(l=0;l<a;l+=4)f=xa[r.charCodeAt(l)],d=xa[r.charCodeAt(l+1)],m=xa[r.charCodeAt(l+2)],g=xa[r.charCodeAt(l+3)],z[u++]=f<<2|d>>4,z[u++]=(d&15)<<4|m>>2,z[u++]=(m&3)<<6|g&63;return y},V0=typeof ArrayBuffer=="function",su=(r,n)=>{if(typeof r!="string")return{type:"message",data:Cm(r,n)};const a=r.charAt(0);return a==="b"?{type:"message",data:X0(r.substring(1),n)}:er[a]?r.length>1?{type:er[a],data:r.substring(1)}:{type:er[a]}:Kc},X0=(r,n)=>{if(V0){const a=Y0(r);return Cm(a,n)}else return{base64:!0,data:r}},Cm=(r,n)=>n==="blob"?r instanceof Blob?r:new Blob([r]):r instanceof ArrayBuffer?r:r.buffer,Um="",G0=(r,n)=>{const a=r.length,l=new Array(a);let u=0;r.forEach((f,d)=>{iu(f,!1,m=>{l[d]=m,++u===a&&n(l.join(Um))})})},Q0=(r,n)=>{const a=r.split(Um),l=[];for(let u=0;u<a.length;u++){const f=su(a[u],n);if(l.push(f),f.type==="error")break}return l};function K0(){return new TransformStream({transform(r,n){$0(r,a=>{const l=a.length;let u;if(l<126)u=new Uint8Array(1),new DataView(u.buffer).setUint8(0,l);else if(l<65536){u=new Uint8Array(3);const f=new DataView(u.buffer);f.setUint8(0,126),f.setUint16(1,l)}else{u=new Uint8Array(9);const f=new DataView(u.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(l))}r.data&&typeof r.data!="string"&&(u[0]|=128),n.enqueue(u),n.enqueue(a)})}})}let Dc;function Jl(r){return r.reduce((n,a)=>n+a.length,0)}function Fl(r,n){if(r[0].length===n)return r.shift();const a=new Uint8Array(n);let l=0;for(let u=0;u<n;u++)a[u]=r[0][l++],l===r[0].length&&(r.shift(),l=0);return r.length&&l<r[0].length&&(r[0]=r[0].slice(l)),a}function Z0(r,n){Dc||(Dc=new TextDecoder);const a=[];let l=0,u=-1,f=!1;return new TransformStream({transform(d,m){for(a.push(d);;){if(l===0){if(Jl(a)<1)break;const g=Fl(a,1);f=(g[0]&128)===128,u=g[0]&127,u<126?l=3:u===126?l=1:l=2}else if(l===1){if(Jl(a)<2)break;const g=Fl(a,2);u=new DataView(g.buffer,g.byteOffset,g.length).getUint16(0),l=3}else if(l===2){if(Jl(a)<8)break;const g=Fl(a,8),y=new DataView(g.buffer,g.byteOffset,g.length),z=y.getUint32(0);if(z>Math.pow(2,21)-1){m.enqueue(Kc);break}u=z*Math.pow(2,32)+y.getUint32(4),l=3}else{if(Jl(a)<u)break;const g=Fl(a,u);m.enqueue(su(f?g:Dc.decode(g),n)),l=0}if(u===0||u>r){m.enqueue(Kc);break}}}})}const Dm=4;function Ie(r){if(r)return J0(r)}function J0(r){for(var n in Ie.prototype)r[n]=Ie.prototype[n];return r}Ie.prototype.on=Ie.prototype.addEventListener=function(r,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(n),this};Ie.prototype.once=function(r,n){function a(){this.off(r,a),n.apply(this,arguments)}return a.fn=n,this.on(r,a),this};Ie.prototype.off=Ie.prototype.removeListener=Ie.prototype.removeAllListeners=Ie.prototype.removeEventListener=function(r,n){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var a=this._callbacks["$"+r];if(!a)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var l,u=0;u<a.length;u++)if(l=a[u],l===n||l.fn===n){a.splice(u,1);break}return a.length===0&&delete this._callbacks["$"+r],this};Ie.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var n=new Array(arguments.length-1),a=this._callbacks["$"+r],l=1;l<arguments.length;l++)n[l-1]=arguments[l];if(a){a=a.slice(0);for(var l=0,u=a.length;l<u;++l)a[l].apply(this,n)}return this};Ie.prototype.emitReserved=Ie.prototype.emit;Ie.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};Ie.prototype.hasListeners=function(r){return!!this.listeners(r).length};const or=typeof Promise=="function"&&typeof Promise.resolve=="function"?n=>Promise.resolve().then(n):(n,a)=>a(n,0),$t=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),F0="arraybuffer";function Bm(r,...n){return n.reduce((a,l)=>(r.hasOwnProperty(l)&&(a[l]=r[l]),a),{})}const W0=$t.setTimeout,I0=$t.clearTimeout;function cr(r,n){n.useNativeTimers?(r.setTimeoutFn=W0.bind($t),r.clearTimeoutFn=I0.bind($t)):(r.setTimeoutFn=$t.setTimeout.bind($t),r.clearTimeoutFn=$t.clearTimeout.bind($t))}const P0=1.33;function eb(r){return typeof r=="string"?tb(r):Math.ceil((r.byteLength||r.size)*P0)}function tb(r){let n=0,a=0;for(let l=0,u=r.length;l<u;l++)n=r.charCodeAt(l),n<128?a+=1:n<2048?a+=2:n<55296||n>=57344?a+=3:(l++,a+=4);return a}function qm(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function nb(r){let n="";for(let a in r)r.hasOwnProperty(a)&&(n.length&&(n+="&"),n+=encodeURIComponent(a)+"="+encodeURIComponent(r[a]));return n}function ib(r){let n={},a=r.split("&");for(let l=0,u=a.length;l<u;l++){let f=a[l].split("=");n[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return n}class sb extends Error{constructor(n,a,l){super(n),this.description=a,this.context=l,this.type="TransportError"}}class au extends Ie{constructor(n){super(),this.writable=!1,cr(this,n),this.opts=n,this.query=n.query,this.socket=n.socket,this.supportsBinary=!n.forceBase64}onError(n,a,l){return super.emitReserved("error",new sb(n,a,l)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(n){this.readyState==="open"&&this.write(n)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(n){const a=su(n,this.socket.binaryType);this.onPacket(a)}onPacket(n){super.emitReserved("packet",n)}onClose(n){this.readyState="closed",super.emitReserved("close",n)}pause(n){}createUri(n,a={}){return n+"://"+this._hostname()+this._port()+this.opts.path+this._query(a)}_hostname(){const n=this.opts.hostname;return n.indexOf(":")===-1?n:"["+n+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(n){const a=nb(n);return a.length?"?"+a:""}}class ab extends au{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(n){this.readyState="pausing";const a=()=>{this.readyState="paused",n()};if(this._polling||!this.writable){let l=0;this._polling&&(l++,this.once("pollComplete",function(){--l||a()})),this.writable||(l++,this.once("drain",function(){--l||a()}))}else a()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(n){const a=l=>{if(this.readyState==="opening"&&l.type==="open"&&this.onOpen(),l.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(l)};Q0(n,this.socket.binaryType).forEach(a),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const n=()=>{this.write([{type:"close"}])};this.readyState==="open"?n():this.once("open",n)}write(n){this.writable=!1,G0(n,a=>{this.doWrite(a,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const n=this.opts.secure?"https":"http",a=this.query||{};return this.opts.timestampRequests!==!1&&(a[this.opts.timestampParam]=qm()),!this.supportsBinary&&!a.sid&&(a.b64=1),this.createUri(n,a)}}let Lm=!1;try{Lm=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const lb=Lm;function rb(){}class ob extends ab{constructor(n){if(super(n),typeof location<"u"){const a=location.protocol==="https:";let l=location.port;l||(l=a?"443":"80"),this.xd=typeof location<"u"&&n.hostname!==location.hostname||l!==n.port}}doWrite(n,a){const l=this.request({method:"POST",data:n});l.on("success",a),l.on("error",(u,f)=>{this.onError("xhr post error",u,f)})}doPoll(){const n=this.request();n.on("data",this.onData.bind(this)),n.on("error",(a,l)=>{this.onError("xhr poll error",a,l)}),this.pollXhr=n}}class an extends Ie{constructor(n,a,l){super(),this.createRequest=n,cr(this,l),this._opts=l,this._method=l.method||"GET",this._uri=a,this._data=l.data!==void 0?l.data:null,this._create()}_create(){var n;const a=Bm(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");a.xdomain=!!this._opts.xd;const l=this._xhr=this.createRequest(a);try{l.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){l.setDisableHeaderCheck&&l.setDisableHeaderCheck(!0);for(let u in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(u)&&l.setRequestHeader(u,this._opts.extraHeaders[u])}}catch{}if(this._method==="POST")try{l.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{l.setRequestHeader("Accept","*/*")}catch{}(n=this._opts.cookieJar)===null||n===void 0||n.addCookies(l),"withCredentials"in l&&(l.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(l.timeout=this._opts.requestTimeout),l.onreadystatechange=()=>{var u;l.readyState===3&&((u=this._opts.cookieJar)===null||u===void 0||u.parseCookies(l.getResponseHeader("set-cookie"))),l.readyState===4&&(l.status===200||l.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof l.status=="number"?l.status:0)},0))},l.send(this._data)}catch(u){this.setTimeoutFn(()=>{this._onError(u)},0);return}typeof document<"u"&&(this._index=an.requestsCount++,an.requests[this._index]=this)}_onError(n){this.emitReserved("error",n,this._xhr),this._cleanup(!0)}_cleanup(n){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=rb,n)try{this._xhr.abort()}catch{}typeof document<"u"&&delete an.requests[this._index],this._xhr=null}}_onLoad(){const n=this._xhr.responseText;n!==null&&(this.emitReserved("data",n),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}an.requestsCount=0;an.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Qp);else if(typeof addEventListener=="function"){const r="onpagehide"in $t?"pagehide":"unload";addEventListener(r,Qp,!1)}}function Qp(){for(let r in an.requests)an.requests.hasOwnProperty(r)&&an.requests[r].abort()}const cb=(function(){const r=Hm({xdomain:!1});return r&&r.responseType!==null})();class ub extends ob{constructor(n){super(n);const a=n&&n.forceBase64;this.supportsBinary=cb&&!a}request(n={}){return Object.assign(n,{xd:this.xd},this.opts),new an(Hm,this.uri(),n)}}function Hm(r){const n=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!n||lb))return new XMLHttpRequest}catch{}if(!n)try{return new $t[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const $m=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class fb extends au{get name(){return"websocket"}doOpen(){const n=this.uri(),a=this.opts.protocols,l=$m?{}:Bm(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(l.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(n,a,l)}catch(u){return this.emitReserved("error",u)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=n=>this.onClose({description:"websocket connection closed",context:n}),this.ws.onmessage=n=>this.onData(n.data),this.ws.onerror=n=>this.onError("websocket error",n)}write(n){this.writable=!1;for(let a=0;a<n.length;a++){const l=n[a],u=a===n.length-1;iu(l,this.supportsBinary,f=>{try{this.doWrite(l,f)}catch{}u&&or(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const n=this.opts.secure?"wss":"ws",a=this.query||{};return this.opts.timestampRequests&&(a[this.opts.timestampParam]=qm()),this.supportsBinary||(a.b64=1),this.createUri(n,a)}}const Bc=$t.WebSocket||$t.MozWebSocket;class hb extends fb{createSocket(n,a,l){return $m?new Bc(n,a,l):a?new Bc(n,a):new Bc(n)}doWrite(n,a){this.ws.send(a)}}class db extends au{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(n){return this.emitReserved("error",n)}this._transport.closed.then(()=>{this.onClose()}).catch(n=>{this.onError("webtransport error",n)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(n=>{const a=Z0(Number.MAX_SAFE_INTEGER,this.socket.binaryType),l=n.readable.pipeThrough(a).getReader(),u=K0();u.readable.pipeTo(n.writable),this._writer=u.writable.getWriter();const f=()=>{l.read().then(({done:m,value:g})=>{m||(this.onPacket(g),f())}).catch(m=>{})};f();const d={type:"open"};this.query.sid&&(d.data=`{"sid":"${this.query.sid}"}`),this._writer.write(d).then(()=>this.onOpen())})})}write(n){this.writable=!1;for(let a=0;a<n.length;a++){const l=n[a],u=a===n.length-1;this._writer.write(l).then(()=>{u&&or(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var n;(n=this._transport)===null||n===void 0||n.close()}}const pb={websocket:hb,webtransport:db,polling:ub},mb=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,yb=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Zc(r){if(r.length>8e3)throw"URI too long";const n=r,a=r.indexOf("["),l=r.indexOf("]");a!=-1&&l!=-1&&(r=r.substring(0,a)+r.substring(a,l).replace(/:/g,";")+r.substring(l,r.length));let u=mb.exec(r||""),f={},d=14;for(;d--;)f[yb[d]]=u[d]||"";return a!=-1&&l!=-1&&(f.source=n,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=gb(f,f.path),f.queryKey=vb(f,f.query),f}function gb(r,n){const a=/\/{2,9}/g,l=n.replace(a,"/").split("/");return(n.slice(0,1)=="/"||n.length===0)&&l.splice(0,1),n.slice(-1)=="/"&&l.splice(l.length-1,1),l}function vb(r,n){const a={};return n.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(l,u,f){u&&(a[u]=f)}),a}const Jc=typeof addEventListener=="function"&&typeof removeEventListener=="function",tr=[];Jc&&addEventListener("offline",()=>{tr.forEach(r=>r())},!1);class Pn extends Ie{constructor(n,a){if(super(),this.binaryType=F0,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,n&&typeof n=="object"&&(a=n,n=null),n){const l=Zc(n);a.hostname=l.host,a.secure=l.protocol==="https"||l.protocol==="wss",a.port=l.port,l.query&&(a.query=l.query)}else a.host&&(a.hostname=Zc(a.host).host);cr(this,a),this.secure=a.secure!=null?a.secure:typeof location<"u"&&location.protocol==="https:",a.hostname&&!a.port&&(a.port=this.secure?"443":"80"),this.hostname=a.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=a.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},a.transports.forEach(l=>{const u=l.prototype.name;this.transports.push(u),this._transportsByName[u]=l}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},a),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=ib(this.opts.query)),Jc&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},tr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(n){const a=Object.assign({},this.opts.query);a.EIO=Dm,a.transport=n,this.id&&(a.sid=this.id);const l=Object.assign({},this.opts,{query:a,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[n]);return new this._transportsByName[n](l)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const n=this.opts.rememberUpgrade&&Pn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const a=this.createTransport(n);a.open(),this.setTransport(a)}setTransport(n){this.transport&&this.transport.removeAllListeners(),this.transport=n,n.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",a=>this._onClose("transport close",a))}onOpen(){this.readyState="open",Pn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",n),this.emitReserved("heartbeat"),n.type){case"open":this.onHandshake(JSON.parse(n.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const a=new Error("server error");a.code=n.data,this._onError(a);break;case"message":this.emitReserved("data",n.data),this.emitReserved("message",n.data);break}}onHandshake(n){this.emitReserved("handshake",n),this.id=n.sid,this.transport.query.sid=n.sid,this._pingInterval=n.pingInterval,this._pingTimeout=n.pingTimeout,this._maxPayload=n.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const n=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+n,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},n),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const n=this._getWritablePackets();this.transport.send(n),this._prevBufferLen=n.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let a=1;for(let l=0;l<this.writeBuffer.length;l++){const u=this.writeBuffer[l].data;if(u&&(a+=eb(u)),l>0&&a>this._maxPayload)return this.writeBuffer.slice(0,l);a+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const n=Date.now()>this._pingTimeoutTime;return n&&(this._pingTimeoutTime=0,or(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),n}write(n,a,l){return this._sendPacket("message",n,a,l),this}send(n,a,l){return this._sendPacket("message",n,a,l),this}_sendPacket(n,a,l,u){if(typeof a=="function"&&(u=a,a=void 0),typeof l=="function"&&(u=l,l=null),this.readyState==="closing"||this.readyState==="closed")return;l=l||{},l.compress=l.compress!==!1;const f={type:n,data:a,options:l};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),u&&this.once("flush",u),this.flush()}close(){const n=()=>{this._onClose("forced close"),this.transport.close()},a=()=>{this.off("upgrade",a),this.off("upgradeError",a),n()},l=()=>{this.once("upgrade",a),this.once("upgradeError",a)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?l():n()}):this.upgrading?l():n()),this}_onError(n){if(Pn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",n),this._onClose("transport error",n)}_onClose(n,a){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Jc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const l=tr.indexOf(this._offlineEventListener);l!==-1&&tr.splice(l,1)}this.readyState="closed",this.id=null,this.emitReserved("close",n,a),this.writeBuffer=[],this._prevBufferLen=0}}}Pn.protocol=Dm;class bb extends Pn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let n=0;n<this._upgrades.length;n++)this._probe(this._upgrades[n])}_probe(n){let a=this.createTransport(n),l=!1;Pn.priorWebsocketSuccess=!1;const u=()=>{l||(a.send([{type:"ping",data:"probe"}]),a.once("packet",w=>{if(!l)if(w.type==="pong"&&w.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",a),!a)return;Pn.priorWebsocketSuccess=a.name==="websocket",this.transport.pause(()=>{l||this.readyState!=="closed"&&(z(),this.setTransport(a),a.send([{type:"upgrade"}]),this.emitReserved("upgrade",a),a=null,this.upgrading=!1,this.flush())})}else{const j=new Error("probe error");j.transport=a.name,this.emitReserved("upgradeError",j)}}))};function f(){l||(l=!0,z(),a.close(),a=null)}const d=w=>{const j=new Error("probe error: "+w);j.transport=a.name,f(),this.emitReserved("upgradeError",j)};function m(){d("transport closed")}function g(){d("socket closed")}function y(w){a&&w.name!==a.name&&f()}const z=()=>{a.removeListener("open",u),a.removeListener("error",d),a.removeListener("close",m),this.off("close",g),this.off("upgrading",y)};a.once("open",u),a.once("error",d),a.once("close",m),this.once("close",g),this.once("upgrading",y),this._upgrades.indexOf("webtransport")!==-1&&n!=="webtransport"?this.setTimeoutFn(()=>{l||a.open()},200):a.open()}onHandshake(n){this._upgrades=this._filterUpgrades(n.upgrades),super.onHandshake(n)}_filterUpgrades(n){const a=[];for(let l=0;l<n.length;l++)~this.transports.indexOf(n[l])&&a.push(n[l]);return a}}let wb=class extends bb{constructor(n,a={}){const l=typeof n=="object",u=l?{...n}:{...a};(!u.transports||u.transports&&typeof u.transports[0]=="string")&&(u.transports=(u.transports||["polling","websocket","webtransport"]).map(f=>pb[f]).filter(f=>!!f)),super(l?u:n,u)}};function Sb(r,n="",a){let l=r;a=a||typeof location<"u"&&location,r==null&&(r=a.protocol+"//"+a.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=a.protocol+r:r=a.host+r),/^(https?|wss?):\/\//.test(r)||(typeof a<"u"?r=a.protocol+"//"+r:r="https://"+r),l=Zc(r)),l.port||(/^(http|ws)$/.test(l.protocol)?l.port="80":/^(http|ws)s$/.test(l.protocol)&&(l.port="443")),l.path=l.path||"/";const f=l.host.indexOf(":")!==-1?"["+l.host+"]":l.host;return l.id=l.protocol+"://"+f+":"+l.port+n,l.href=l.protocol+"://"+f+(a&&a.port===l.port?"":":"+l.port),l}const xb=typeof ArrayBuffer=="function",Eb=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Ym=Object.prototype.toString,kb=typeof Blob=="function"||typeof Blob<"u"&&Ym.call(Blob)==="[object BlobConstructor]",Tb=typeof File=="function"||typeof File<"u"&&Ym.call(File)==="[object FileConstructor]";function lu(r){return xb&&(r instanceof ArrayBuffer||Eb(r))||kb&&r instanceof Blob||Tb&&r instanceof File}function nr(r,n){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let a=0,l=r.length;a<l;a++)if(nr(r[a]))return!0;return!1}if(lu(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return nr(r.toJSON(),!0);for(const a in r)if(Object.prototype.hasOwnProperty.call(r,a)&&nr(r[a]))return!0;return!1}function _b(r){const n=[],a=r.data,l=r;return l.data=ir(a,n),l.attachments=n.length,{packet:l,buffers:n}}function ir(r,n,a){if(!r)return r;if(lu(r)){const l={_placeholder:!0,num:n.length};return n.push(r),l}else if(Array.isArray(r)){const l=new Array(r.length);for(let u=0;u<r.length;u++)l[u]=ir(r[u],n);return l}else if(typeof r=="object"&&!(r instanceof Date)){if(r.toJSON&&typeof r.toJSON=="function"&&!a)return ir(r.toJSON(),n,!0);const l={};for(const u in r)Object.prototype.hasOwnProperty.call(r,u)&&(l[u]=ir(r[u],n));return l}return r}function Ab(r,n){return r.data=Fc(r.data,n),delete r.attachments,r}function Fc(r,n){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<n.length)return n[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let a=0;a<r.length;a++)r[a]=Fc(r[a],n);else if(typeof r=="object")for(const a in r)Object.prototype.hasOwnProperty.call(r,a)&&(r[a]=Fc(r[a],n));return r}const Nb=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Se;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(Se||(Se={}));let Ob=class{constructor(n){this.replacer=n}encode(n){return(n.type===Se.EVENT||n.type===Se.ACK)&&nr(n)?this.encodeAsBinary({type:n.type===Se.EVENT?Se.BINARY_EVENT:Se.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id}):[this.encodeAsString(n)]}encodeAsString(n){let a=""+n.type;return(n.type===Se.BINARY_EVENT||n.type===Se.BINARY_ACK)&&(a+=n.attachments+"-"),n.nsp&&n.nsp!=="/"&&(a+=n.nsp+","),n.id!=null&&(a+=n.id),n.data!=null&&(a+=JSON.stringify(n.data,this.replacer)),a}encodeAsBinary(n){const a=_b(n),l=this.encodeAsString(a.packet),u=a.buffers;return u.unshift(l),u}},jb=class Vm extends Ie{constructor(n){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof n=="function"?{reviver:n}:n)}add(n){let a;if(typeof n=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");a=this.decodeString(n);const l=a.type===Se.BINARY_EVENT;l||a.type===Se.BINARY_ACK?(a.type=l?Se.EVENT:Se.ACK,this.reconstructor=new Rb(a)):super.emitReserved("decoded",a)}else if(lu(n)||n.base64)if(this.reconstructor)a=this.reconstructor.takeBinaryData(n),a&&(this.reconstructor=null,super.emitReserved("decoded",a));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+n)}decodeString(n){let a=0;const l={type:Number(n.charAt(0))};if(Se[l.type]===void 0)throw new Error("unknown packet type "+l.type);if(l.type===Se.BINARY_EVENT||l.type===Se.BINARY_ACK){const f=a+1;for(;n.charAt(++a)!=="-"&&a!=n.length;);const d=n.substring(f,a);if(d!=Number(d)||n.charAt(a)!=="-")throw new Error("Illegal attachments");const m=Number(d);if(!zb(m)||m<1)throw new Error("Illegal attachments");if(m>this.opts.maxAttachments)throw new Error("too many attachments");l.attachments=m}if(n.charAt(a+1)==="/"){const f=a+1;for(;++a&&!(n.charAt(a)===","||a===n.length););l.nsp=n.substring(f,a)}else l.nsp="/";const u=n.charAt(a+1);if(u!==""&&Number(u)==u){const f=a+1;for(;++a;){const d=n.charAt(a);if(d==null||Number(d)!=d){--a;break}if(a===n.length)break}l.id=Number(n.substring(f,a+1))}if(n.charAt(++a)){const f=this.tryParse(n.substr(a));if(Vm.isPayloadValid(l.type,f))l.data=f;else throw new Error("invalid payload")}return l}tryParse(n){try{return JSON.parse(n,this.opts.reviver)}catch{return!1}}static isPayloadValid(n,a){switch(n){case Se.CONNECT:return Kp(a);case Se.DISCONNECT:return a===void 0;case Se.CONNECT_ERROR:return typeof a=="string"||Kp(a);case Se.EVENT:case Se.BINARY_EVENT:return Array.isArray(a)&&(typeof a[0]=="number"||typeof a[0]=="string"&&Nb.indexOf(a[0])===-1);case Se.ACK:case Se.BINARY_ACK:return Array.isArray(a)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};class Rb{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){const a=Ab(this.reconPack,this.buffers);return this.finishedReconstruction(),a}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const zb=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function Kp(r){return Object.prototype.toString.call(r)==="[object Object]"}const Mb=Object.freeze(Object.defineProperty({__proto__:null,Decoder:jb,Encoder:Ob,get PacketType(){return Se}},Symbol.toStringTag,{value:"Module"}));function Qt(r,n,a){return r.on(n,a),function(){r.off(n,a)}}const Cb=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Xm extends Ie{constructor(n,a,l){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=n,this.nsp=a,l&&l.auth&&(this.auth=l.auth),this._opts=Object.assign({},l),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const n=this.io;this.subs=[Qt(n,"open",this.onopen.bind(this)),Qt(n,"packet",this.onpacket.bind(this)),Qt(n,"error",this.onerror.bind(this)),Qt(n,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...n){return n.unshift("message"),this.emit.apply(this,n),this}emit(n,...a){var l,u,f;if(Cb.hasOwnProperty(n))throw new Error('"'+n.toString()+'" is a reserved event name');if(a.unshift(n),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(a),this;const d={type:Se.EVENT,data:a};if(d.options={},d.options.compress=this.flags.compress!==!1,typeof a[a.length-1]=="function"){const z=this.ids++,w=a.pop();this._registerAckCallback(z,w),d.id=z}const m=(u=(l=this.io.engine)===null||l===void 0?void 0:l.transport)===null||u===void 0?void 0:u.writable,g=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!m||(g?(this.notifyOutgoingListeners(d),this.packet(d)):this.sendBuffer.push(d)),this.flags={},this}_registerAckCallback(n,a){var l;const u=(l=this.flags.timeout)!==null&&l!==void 0?l:this._opts.ackTimeout;if(u===void 0){this.acks[n]=a;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[n];for(let m=0;m<this.sendBuffer.length;m++)this.sendBuffer[m].id===n&&this.sendBuffer.splice(m,1);a.call(this,new Error("operation has timed out"))},u),d=(...m)=>{this.io.clearTimeoutFn(f),a.apply(this,m)};d.withError=!0,this.acks[n]=d}emitWithAck(n,...a){return new Promise((l,u)=>{const f=(d,m)=>d?u(d):l(m);f.withError=!0,a.push(f),this.emit(n,...a)})}_addToQueue(n){let a;typeof n[n.length-1]=="function"&&(a=n.pop());const l={id:this._queueSeq++,tryCount:0,pending:!1,args:n,flags:Object.assign({fromQueue:!0},this.flags)};n.push((u,...f)=>(this._queue[0],u!==null?l.tryCount>this._opts.retries&&(this._queue.shift(),a&&a(u)):(this._queue.shift(),a&&a(null,...f)),l.pending=!1,this._drainQueue())),this._queue.push(l),this._drainQueue()}_drainQueue(n=!1){if(!this.connected||this._queue.length===0)return;const a=this._queue[0];a.pending&&!n||(a.pending=!0,a.tryCount++,this.flags=a.flags,this.emit.apply(this,a.args))}packet(n){n.nsp=this.nsp,this.io._packet(n)}onopen(){typeof this.auth=="function"?this.auth(n=>{this._sendConnectPacket(n)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(n){this.packet({type:Se.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},n):n})}onerror(n){this.connected||this.emitReserved("connect_error",n)}onclose(n,a){this.connected=!1,delete this.id,this.emitReserved("disconnect",n,a),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(n=>{if(!this.sendBuffer.some(l=>String(l.id)===n)){const l=this.acks[n];delete this.acks[n],l.withError&&l.call(this,new Error("socket has been disconnected"))}})}onpacket(n){if(n.nsp===this.nsp)switch(n.type){case Se.CONNECT:n.data&&n.data.sid?this.onconnect(n.data.sid,n.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Se.EVENT:case Se.BINARY_EVENT:this.onevent(n);break;case Se.ACK:case Se.BINARY_ACK:this.onack(n);break;case Se.DISCONNECT:this.ondisconnect();break;case Se.CONNECT_ERROR:this.destroy();const l=new Error(n.data.message);l.data=n.data.data,this.emitReserved("connect_error",l);break}}onevent(n){const a=n.data||[];n.id!=null&&a.push(this.ack(n.id)),this.connected?this.emitEvent(a):this.receiveBuffer.push(Object.freeze(a))}emitEvent(n){if(this._anyListeners&&this._anyListeners.length){const a=this._anyListeners.slice();for(const l of a)l.apply(this,n)}super.emit.apply(this,n),this._pid&&n.length&&typeof n[n.length-1]=="string"&&(this._lastOffset=n[n.length-1])}ack(n){const a=this;let l=!1;return function(...u){l||(l=!0,a.packet({type:Se.ACK,id:n,data:u}))}}onack(n){const a=this.acks[n.id];typeof a=="function"&&(delete this.acks[n.id],a.withError&&n.data.unshift(null),a.apply(this,n.data))}onconnect(n,a){this.id=n,this.recovered=a&&this._pid===a,this._pid=a,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(n=>this.emitEvent(n)),this.receiveBuffer=[],this.sendBuffer.forEach(n=>{this.notifyOutgoingListeners(n),this.packet(n)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(n=>n()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Se.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}timeout(n){return this.flags.timeout=n,this}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){const a=this._anyListeners;for(let l=0;l<a.length;l++)if(n===a[l])return a.splice(l,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(n),this}prependAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(n),this}offAnyOutgoing(n){if(!this._anyOutgoingListeners)return this;if(n){const a=this._anyOutgoingListeners;for(let l=0;l<a.length;l++)if(n===a[l])return a.splice(l,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const a=this._anyOutgoingListeners.slice();for(const l of a)l.apply(this,n.data)}}}function ds(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}ds.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),a=Math.floor(n*this.jitter*r);r=(Math.floor(n*10)&1)==0?r-a:r+a}return Math.min(r,this.max)|0};ds.prototype.reset=function(){this.attempts=0};ds.prototype.setMin=function(r){this.ms=r};ds.prototype.setMax=function(r){this.max=r};ds.prototype.setJitter=function(r){this.jitter=r};class Wc extends Ie{constructor(n,a){var l;super(),this.nsps={},this.subs=[],n&&typeof n=="object"&&(a=n,n=void 0),a=a||{},a.path=a.path||"/socket.io",this.opts=a,cr(this,a),this.reconnection(a.reconnection!==!1),this.reconnectionAttempts(a.reconnectionAttempts||1/0),this.reconnectionDelay(a.reconnectionDelay||1e3),this.reconnectionDelayMax(a.reconnectionDelayMax||5e3),this.randomizationFactor((l=a.randomizationFactor)!==null&&l!==void 0?l:.5),this.backoff=new ds({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(a.timeout==null?2e4:a.timeout),this._readyState="closed",this.uri=n;const u=a.parser||Mb;this.encoder=new u.Encoder,this.decoder=new u.Decoder,this._autoConnect=a.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(n){return arguments.length?(this._reconnection=!!n,n||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(n){return n===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=n,this)}reconnectionDelay(n){var a;return n===void 0?this._reconnectionDelay:(this._reconnectionDelay=n,(a=this.backoff)===null||a===void 0||a.setMin(n),this)}randomizationFactor(n){var a;return n===void 0?this._randomizationFactor:(this._randomizationFactor=n,(a=this.backoff)===null||a===void 0||a.setJitter(n),this)}reconnectionDelayMax(n){var a;return n===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=n,(a=this.backoff)===null||a===void 0||a.setMax(n),this)}timeout(n){return arguments.length?(this._timeout=n,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(n){if(~this._readyState.indexOf("open"))return this;this.engine=new wb(this.uri,this.opts);const a=this.engine,l=this;this._readyState="opening",this.skipReconnect=!1;const u=Qt(a,"open",function(){l.onopen(),n&&n()}),f=m=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",m),n?n(m):this.maybeReconnectOnOpen()},d=Qt(a,"error",f);if(this._timeout!==!1){const m=this._timeout,g=this.setTimeoutFn(()=>{u(),f(new Error("timeout")),a.close()},m);this.opts.autoUnref&&g.unref(),this.subs.push(()=>{this.clearTimeoutFn(g)})}return this.subs.push(u),this.subs.push(d),this}connect(n){return this.open(n)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const n=this.engine;this.subs.push(Qt(n,"ping",this.onping.bind(this)),Qt(n,"data",this.ondata.bind(this)),Qt(n,"error",this.onerror.bind(this)),Qt(n,"close",this.onclose.bind(this)),Qt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(n){try{this.decoder.add(n)}catch(a){this.onclose("parse error",a)}}ondecoded(n){or(()=>{this.emitReserved("packet",n)},this.setTimeoutFn)}onerror(n){this.emitReserved("error",n)}socket(n,a){let l=this.nsps[n];return l?this._autoConnect&&!l.active&&l.connect():(l=new Xm(this,n,a),this.nsps[n]=l),l}_destroy(n){const a=Object.keys(this.nsps);for(const l of a)if(this.nsps[l].active)return;this._close()}_packet(n){const a=this.encoder.encode(n);for(let l=0;l<a.length;l++)this.engine.write(a[l],n.options)}cleanup(){this.subs.forEach(n=>n()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(n,a){var l;this.cleanup(),(l=this.engine)===null||l===void 0||l.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",n,a),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const n=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const a=this.backoff.duration();this._reconnecting=!0;const l=this.setTimeoutFn(()=>{n.skipReconnect||(this.emitReserved("reconnect_attempt",n.backoff.attempts),!n.skipReconnect&&n.open(u=>{u?(n._reconnecting=!1,n.reconnect(),this.emitReserved("reconnect_error",u)):n.onreconnect()}))},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}}onreconnect(){const n=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",n)}}const ya={};function ka(r,n){typeof r=="object"&&(n=r,r=void 0),n=n||{};const a=Sb(r,n.path||"/socket.io"),l=a.source,u=a.id,f=a.path,d=ya[u]&&f in ya[u].nsps,m=n.forceNew||n["force new connection"]||n.multiplex===!1||d;let g;return m?g=new Wc(l,n):(ya[u]||(ya[u]=new Wc(l,n)),g=ya[u]),a.query&&!n.query&&(n.query=a.queryKey),g.socket(a.path,n)}Object.assign(ka,{Manager:Wc,Socket:Xm,io:ka,connect:ka});function Ub(r){const n=r.length;let a=0,l=0;for(;l<n;){let u=r.charCodeAt(l++);if((u&4294967168)===0){a++;continue}else if((u&4294965248)===0)a+=2;else{if(u>=55296&&u<=56319&&l<n){const f=r.charCodeAt(l);(f&64512)===56320&&(++l,u=((u&1023)<<10)+(f&1023)+65536)}(u&4294901760)===0?a+=3:a+=4}}return a}function Db(r,n,a){const l=r.length;let u=a,f=0;for(;f<l;){let d=r.charCodeAt(f++);if((d&4294967168)===0){n[u++]=d;continue}else if((d&4294965248)===0)n[u++]=d>>6&31|192;else{if(d>=55296&&d<=56319&&f<l){const m=r.charCodeAt(f);(m&64512)===56320&&(++f,d=((d&1023)<<10)+(m&1023)+65536)}(d&4294901760)===0?(n[u++]=d>>12&15|224,n[u++]=d>>6&63|128):(n[u++]=d>>18&7|240,n[u++]=d>>12&63|128,n[u++]=d>>6&63|128)}n[u++]=d&63|128}}const Bb=new TextEncoder,qb=50;function Lb(r,n,a){Bb.encodeInto(r,n.subarray(a))}function Hb(r,n,a){r.length>qb?Lb(r,n,a):Db(r,n,a)}const $b=4096;function Gm(r,n,a){let l=n;const u=l+a,f=[];let d="";for(;l<u;){const m=r[l++];if((m&128)===0)f.push(m);else if((m&224)===192){const g=r[l++]&63;f.push((m&31)<<6|g)}else if((m&240)===224){const g=r[l++]&63,y=r[l++]&63;f.push((m&31)<<12|g<<6|y)}else if((m&248)===240){const g=r[l++]&63,y=r[l++]&63,z=r[l++]&63;let w=(m&7)<<18|g<<12|y<<6|z;w>65535&&(w-=65536,f.push(w>>>10&1023|55296),w=56320|w&1023),f.push(w)}else f.push(m);f.length>=$b&&(d+=String.fromCharCode(...f),f.length=0)}return f.length>0&&(d+=String.fromCharCode(...f)),d}const Yb=new TextDecoder,Vb=200;function Xb(r,n,a){const l=r.subarray(n,n+a);return Yb.decode(l)}function Gb(r,n,a){return a>Vb?Xb(r,n,a):Gm(r,n,a)}class Wl{type;data;constructor(n,a){this.type=n,this.data=a}}class jt extends Error{constructor(n){super(n);const a=Object.create(jt.prototype);Object.setPrototypeOf(this,a),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:jt.name})}}const ga=4294967295;function Qb(r,n,a){const l=a/4294967296,u=a;r.setUint32(n,l),r.setUint32(n+4,u)}function Qm(r,n,a){const l=Math.floor(a/4294967296),u=a;r.setUint32(n,l),r.setUint32(n+4,u)}function Km(r,n){const a=r.getInt32(n),l=r.getUint32(n+4);return a*4294967296+l}function Kb(r,n){const a=r.getUint32(n),l=r.getUint32(n+4);return a*4294967296+l}const Zb=-1,Jb=4294967296-1,Fb=17179869184-1;function Wb({sec:r,nsec:n}){if(r>=0&&n>=0&&r<=Fb)if(n===0&&r<=Jb){const a=new Uint8Array(4);return new DataView(a.buffer).setUint32(0,r),a}else{const a=r/4294967296,l=r&4294967295,u=new Uint8Array(8),f=new DataView(u.buffer);return f.setUint32(0,n<<2|a&3),f.setUint32(4,l),u}else{const a=new Uint8Array(12),l=new DataView(a.buffer);return l.setUint32(0,n),Qm(l,4,r),a}}function Ib(r){const n=r.getTime(),a=Math.floor(n/1e3),l=(n-a*1e3)*1e6,u=Math.floor(l/1e9);return{sec:a+u,nsec:l-u*1e9}}function Pb(r){if(r instanceof Date){const n=Ib(r);return Wb(n)}else return null}function ew(r){const n=new DataView(r.buffer,r.byteOffset,r.byteLength);switch(r.byteLength){case 4:return{sec:n.getUint32(0),nsec:0};case 8:{const a=n.getUint32(0),l=n.getUint32(4),u=(a&3)*4294967296+l,f=a>>>2;return{sec:u,nsec:f}}case 12:{const a=Km(n,4),l=n.getUint32(0);return{sec:a,nsec:l}}default:throw new jt(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${r.length}`)}}function tw(r){const n=ew(r);return new Date(n.sec*1e3+n.nsec/1e6)}const nw={type:Zb,encode:Pb,decode:tw};class ur{static defaultCodec=new ur;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(nw)}register({type:n,encode:a,decode:l}){if(n>=0)this.encoders[n]=a,this.decoders[n]=l;else{const u=-1-n;this.builtInEncoders[u]=a,this.builtInDecoders[u]=l}}tryToEncode(n,a){for(let l=0;l<this.builtInEncoders.length;l++){const u=this.builtInEncoders[l];if(u!=null){const f=u(n,a);if(f!=null){const d=-1-l;return new Wl(d,f)}}}for(let l=0;l<this.encoders.length;l++){const u=this.encoders[l];if(u!=null){const f=u(n,a);if(f!=null){const d=l;return new Wl(d,f)}}}return n instanceof Wl?n:null}decode(n,a,l){const u=a<0?this.builtInDecoders[-1-a]:this.decoders[a];return u?u(n,a,l):new Wl(a,n)}}function iw(r){return r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer}function Ic(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):iw(r)?new Uint8Array(r):Uint8Array.from(r)}const sw=100,aw=2048;class ru{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(n){this.extensionCodec=n?.extensionCodec??ur.defaultCodec,this.context=n?.context,this.useBigInt64=n?.useBigInt64??!1,this.maxDepth=n?.maxDepth??sw,this.initialBufferSize=n?.initialBufferSize??aw,this.sortKeys=n?.sortKeys??!1,this.forceFloat32=n?.forceFloat32??!1,this.ignoreUndefined=n?.ignoreUndefined??!1,this.forceIntegerToFloat=n?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new ru({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(n){if(this.entered)return this.clone().encodeSharedRef(n);try{return this.entered=!0,this.reinitializeState(),this.doEncode(n,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(n){if(this.entered)return this.clone().encode(n);try{return this.entered=!0,this.reinitializeState(),this.doEncode(n,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(n,a){if(a>this.maxDepth)throw new Error(`Too deep objects in depth ${a}`);n==null?this.encodeNil():typeof n=="boolean"?this.encodeBoolean(n):typeof n=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(n):this.encodeNumber(n):typeof n=="string"?this.encodeString(n):this.useBigInt64&&typeof n=="bigint"?this.encodeBigInt64(n):this.encodeObject(n,a)}ensureBufferSizeToWrite(n){const a=this.pos+n;this.view.byteLength<a&&this.resizeBuffer(a*2)}resizeBuffer(n){const a=new ArrayBuffer(n),l=new Uint8Array(a),u=new DataView(a);l.set(this.bytes),this.view=u,this.bytes=l}encodeNil(){this.writeU8(192)}encodeBoolean(n){n===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(n){!this.forceIntegerToFloat&&Number.isSafeInteger(n)?n>=0?n<128?this.writeU8(n):n<256?(this.writeU8(204),this.writeU8(n)):n<65536?(this.writeU8(205),this.writeU16(n)):n<4294967296?(this.writeU8(206),this.writeU32(n)):this.useBigInt64?this.encodeNumberAsFloat(n):(this.writeU8(207),this.writeU64(n)):n>=-32?this.writeU8(224|n+32):n>=-128?(this.writeU8(208),this.writeI8(n)):n>=-32768?(this.writeU8(209),this.writeI16(n)):n>=-2147483648?(this.writeU8(210),this.writeI32(n)):this.useBigInt64?this.encodeNumberAsFloat(n):(this.writeU8(211),this.writeI64(n)):this.encodeNumberAsFloat(n)}encodeNumberAsFloat(n){this.forceFloat32?(this.writeU8(202),this.writeF32(n)):(this.writeU8(203),this.writeF64(n))}encodeBigInt64(n){n>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(n)):(this.writeU8(211),this.writeBigInt64(n))}writeStringHeader(n){if(n<32)this.writeU8(160+n);else if(n<256)this.writeU8(217),this.writeU8(n);else if(n<65536)this.writeU8(218),this.writeU16(n);else if(n<4294967296)this.writeU8(219),this.writeU32(n);else throw new Error(`Too long string: ${n} bytes in UTF-8`)}encodeString(n){const l=Ub(n);this.ensureBufferSizeToWrite(5+l),this.writeStringHeader(l),Hb(n,this.bytes,this.pos),this.pos+=l}encodeObject(n,a){const l=this.extensionCodec.tryToEncode(n,this.context);if(l!=null)this.encodeExtension(l);else if(Array.isArray(n))this.encodeArray(n,a);else if(ArrayBuffer.isView(n))this.encodeBinary(n);else if(typeof n=="object")this.encodeMap(n,a);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(n)}`)}encodeBinary(n){const a=n.byteLength;if(a<256)this.writeU8(196),this.writeU8(a);else if(a<65536)this.writeU8(197),this.writeU16(a);else if(a<4294967296)this.writeU8(198),this.writeU32(a);else throw new Error(`Too large binary: ${a}`);const l=Ic(n);this.writeU8a(l)}encodeArray(n,a){const l=n.length;if(l<16)this.writeU8(144+l);else if(l<65536)this.writeU8(220),this.writeU16(l);else if(l<4294967296)this.writeU8(221),this.writeU32(l);else throw new Error(`Too large array: ${l}`);for(const u of n)this.doEncode(u,a+1)}countWithoutUndefined(n,a){let l=0;for(const u of a)n[u]!==void 0&&l++;return l}encodeMap(n,a){const l=Object.keys(n);this.sortKeys&&l.sort();const u=this.ignoreUndefined?this.countWithoutUndefined(n,l):l.length;if(u<16)this.writeU8(128+u);else if(u<65536)this.writeU8(222),this.writeU16(u);else if(u<4294967296)this.writeU8(223),this.writeU32(u);else throw new Error(`Too large map object: ${u}`);for(const f of l){const d=n[f];this.ignoreUndefined&&d===void 0||(this.encodeString(f),this.doEncode(d,a+1))}}encodeExtension(n){if(typeof n.data=="function"){const l=n.data(this.pos+6),u=l.length;if(u>=4294967296)throw new Error(`Too large extension object: ${u}`);this.writeU8(201),this.writeU32(u),this.writeI8(n.type),this.writeU8a(l);return}const a=n.data.length;if(a===1)this.writeU8(212);else if(a===2)this.writeU8(213);else if(a===4)this.writeU8(214);else if(a===8)this.writeU8(215);else if(a===16)this.writeU8(216);else if(a<256)this.writeU8(199),this.writeU8(a);else if(a<65536)this.writeU8(200),this.writeU16(a);else if(a<4294967296)this.writeU8(201),this.writeU32(a);else throw new Error(`Too large extension object: ${a}`);this.writeI8(n.type),this.writeU8a(n.data)}writeU8(n){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,n),this.pos++}writeU8a(n){const a=n.length;this.ensureBufferSizeToWrite(a),this.bytes.set(n,this.pos),this.pos+=a}writeI8(n){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,n),this.pos++}writeU16(n){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,n),this.pos+=2}writeI16(n){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,n),this.pos+=2}writeU32(n){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,n),this.pos+=4}writeI32(n){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,n),this.pos+=4}writeF32(n){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,n),this.pos+=4}writeF64(n){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,n),this.pos+=8}writeU64(n){this.ensureBufferSizeToWrite(8),Qb(this.view,this.pos,n),this.pos+=8}writeI64(n){this.ensureBufferSizeToWrite(8),Qm(this.view,this.pos,n),this.pos+=8}writeBigUint64(n){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,n),this.pos+=8}writeBigInt64(n){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,n),this.pos+=8}}function lw(r,n){return new ru(n).encodeSharedRef(r)}function qc(r){return`${r<0?"-":""}0x${Math.abs(r).toString(16).padStart(2,"0")}`}const rw=16,ow=16;class cw{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(n=rw,a=ow){this.maxKeyLength=n,this.maxLengthPerKey=a,this.caches=[];for(let l=0;l<this.maxKeyLength;l++)this.caches.push([])}canBeCached(n){return n>0&&n<=this.maxKeyLength}find(n,a,l){const u=this.caches[l-1];e:for(const f of u){const d=f.bytes;for(let m=0;m<l;m++)if(d[m]!==n[a+m])continue e;return f.str}return null}store(n,a){const l=this.caches[n.length-1],u={bytes:n,str:a};l.length>=this.maxLengthPerKey?l[Math.random()*l.length|0]=u:l.push(u)}decode(n,a,l){const u=this.find(n,a,l);if(u!=null)return this.hit++,u;this.miss++;const f=Gm(n,a,l),d=Uint8Array.prototype.slice.call(n,a,a+l);return this.store(d,f),f}}const Pc="array",Ta="map_key",Zm="map_value",uw=r=>{if(typeof r=="string"||typeof r=="number")return r;throw new jt("The type of key must be string or number but "+typeof r)};class fw{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(n){const a=this.getUninitializedStateFromPool();a.type=Pc,a.position=0,a.size=n,a.array=new Array(n)}pushMapState(n){const a=this.getUninitializedStateFromPool();a.type=Ta,a.readCount=0,a.size=n,a.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const n={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(n)}return this.stack[this.stackHeadPosition]}release(n){if(this.stack[this.stackHeadPosition]!==n)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(n.type===Pc){const l=n;l.size=0,l.array=void 0,l.position=0,l.type=void 0}if(n.type===Ta||n.type===Zm){const l=n;l.size=0,l.map=void 0,l.readCount=0,l.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const va=-1,ou=new DataView(new ArrayBuffer(0)),hw=new Uint8Array(ou.buffer);try{ou.getInt8(0)}catch(r){if(!(r instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const Zp=new RangeError("Insufficient data"),dw=new cw;class cu{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=ou;bytes=hw;headByte=va;stack=new fw;entered=!1;constructor(n){this.extensionCodec=n?.extensionCodec??ur.defaultCodec,this.context=n?.context,this.useBigInt64=n?.useBigInt64??!1,this.rawStrings=n?.rawStrings??!1,this.maxStrLength=n?.maxStrLength??ga,this.maxBinLength=n?.maxBinLength??ga,this.maxArrayLength=n?.maxArrayLength??ga,this.maxMapLength=n?.maxMapLength??ga,this.maxExtLength=n?.maxExtLength??ga,this.keyDecoder=n?.keyDecoder!==void 0?n.keyDecoder:dw,this.mapKeyConverter=n?.mapKeyConverter??uw}clone(){return new cu({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=va,this.stack.reset()}setBuffer(n){const a=Ic(n);this.bytes=a,this.view=new DataView(a.buffer,a.byteOffset,a.byteLength),this.pos=0}appendBuffer(n){if(this.headByte===va&&!this.hasRemaining(1))this.setBuffer(n);else{const a=this.bytes.subarray(this.pos),l=Ic(n),u=new Uint8Array(a.length+l.length);u.set(a),u.set(l,a.length),this.setBuffer(u)}}hasRemaining(n){return this.view.byteLength-this.pos>=n}createExtraByteError(n){const{view:a,pos:l}=this;return new RangeError(`Extra ${a.byteLength-l} of ${a.byteLength} byte(s) found at buffer[${n}]`)}decode(n){if(this.entered)return this.clone().decode(n);try{this.entered=!0,this.reinitializeState(),this.setBuffer(n);const a=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return a}finally{this.entered=!1}}*decodeMulti(n){if(this.entered){yield*this.clone().decodeMulti(n);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(n);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(n){if(this.entered)return this.clone().decodeAsync(n);try{this.entered=!0;let a=!1,l;for await(const m of n){if(a)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(m);try{l=this.doDecodeSync(),a=!0}catch(g){if(!(g instanceof RangeError))throw g}this.totalPos+=this.pos}if(a){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return l}const{headByte:u,pos:f,totalPos:d}=this;throw new RangeError(`Insufficient data in parsing ${qc(u)} at ${d} (${f} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(n){return this.decodeMultiAsync(n,!0)}decodeStream(n){return this.decodeMultiAsync(n,!1)}async*decodeMultiAsync(n,a){if(this.entered){yield*this.clone().decodeMultiAsync(n,a);return}try{this.entered=!0;let l=a,u=-1;for await(const f of n){if(a&&u===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(f),l&&(u=this.readArraySize(),l=!1,this.complete());try{for(;yield this.doDecodeSync(),--u!==0;);}catch(d){if(!(d instanceof RangeError))throw d}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const n=this.readHeadByte();let a;if(n>=224)a=n-256;else if(n<192)if(n<128)a=n;else if(n<144){const u=n-128;if(u!==0){this.pushMapState(u),this.complete();continue e}else a={}}else if(n<160){const u=n-144;if(u!==0){this.pushArrayState(u),this.complete();continue e}else a=[]}else{const u=n-160;a=this.decodeString(u,0)}else if(n===192)a=null;else if(n===194)a=!1;else if(n===195)a=!0;else if(n===202)a=this.readF32();else if(n===203)a=this.readF64();else if(n===204)a=this.readU8();else if(n===205)a=this.readU16();else if(n===206)a=this.readU32();else if(n===207)this.useBigInt64?a=this.readU64AsBigInt():a=this.readU64();else if(n===208)a=this.readI8();else if(n===209)a=this.readI16();else if(n===210)a=this.readI32();else if(n===211)this.useBigInt64?a=this.readI64AsBigInt():a=this.readI64();else if(n===217){const u=this.lookU8();a=this.decodeString(u,1)}else if(n===218){const u=this.lookU16();a=this.decodeString(u,2)}else if(n===219){const u=this.lookU32();a=this.decodeString(u,4)}else if(n===220){const u=this.readU16();if(u!==0){this.pushArrayState(u),this.complete();continue e}else a=[]}else if(n===221){const u=this.readU32();if(u!==0){this.pushArrayState(u),this.complete();continue e}else a=[]}else if(n===222){const u=this.readU16();if(u!==0){this.pushMapState(u),this.complete();continue e}else a={}}else if(n===223){const u=this.readU32();if(u!==0){this.pushMapState(u),this.complete();continue e}else a={}}else if(n===196){const u=this.lookU8();a=this.decodeBinary(u,1)}else if(n===197){const u=this.lookU16();a=this.decodeBinary(u,2)}else if(n===198){const u=this.lookU32();a=this.decodeBinary(u,4)}else if(n===212)a=this.decodeExtension(1,0);else if(n===213)a=this.decodeExtension(2,0);else if(n===214)a=this.decodeExtension(4,0);else if(n===215)a=this.decodeExtension(8,0);else if(n===216)a=this.decodeExtension(16,0);else if(n===199){const u=this.lookU8();a=this.decodeExtension(u,1)}else if(n===200){const u=this.lookU16();a=this.decodeExtension(u,2)}else if(n===201){const u=this.lookU32();a=this.decodeExtension(u,4)}else throw new jt(`Unrecognized type byte: ${qc(n)}`);this.complete();const l=this.stack;for(;l.length>0;){const u=l.top();if(u.type===Pc)if(u.array[u.position]=a,u.position++,u.position===u.size)a=u.array,l.release(u);else continue e;else if(u.type===Ta){if(a==="__proto__")throw new jt("The key __proto__ is not allowed");u.key=this.mapKeyConverter(a),u.type=Zm;continue e}else if(u.map[u.key]=a,u.readCount++,u.readCount===u.size)a=u.map,l.release(u);else{u.key=null,u.type=Ta;continue e}}return a}}readHeadByte(){return this.headByte===va&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=va}readArraySize(){const n=this.readHeadByte();switch(n){case 220:return this.readU16();case 221:return this.readU32();default:{if(n<160)return n-144;throw new jt(`Unrecognized array type byte: ${qc(n)}`)}}}pushMapState(n){if(n>this.maxMapLength)throw new jt(`Max length exceeded: map length (${n}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(n)}pushArrayState(n){if(n>this.maxArrayLength)throw new jt(`Max length exceeded: array length (${n}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(n)}decodeString(n,a){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(n,a):this.decodeBinary(n,a)}decodeUtf8String(n,a){if(n>this.maxStrLength)throw new jt(`Max length exceeded: UTF-8 byte length (${n}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+a+n)throw Zp;const l=this.pos+a;let u;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(n)?u=this.keyDecoder.decode(this.bytes,l,n):u=Gb(this.bytes,l,n),this.pos+=a+n,u}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===Ta:!1}decodeBinary(n,a){if(n>this.maxBinLength)throw new jt(`Max length exceeded: bin length (${n}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(n+a))throw Zp;const l=this.pos+a,u=this.bytes.subarray(l,l+n);return this.pos+=a+n,u}decodeExtension(n,a){if(n>this.maxExtLength)throw new jt(`Max length exceeded: ext length (${n}) > maxExtLength (${this.maxExtLength})`);const l=this.view.getInt8(this.pos+a),u=this.decodeBinary(n,a+1);return this.extensionCodec.decode(u,l,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const n=this.view.getUint8(this.pos);return this.pos++,n}readI8(){const n=this.view.getInt8(this.pos);return this.pos++,n}readU16(){const n=this.view.getUint16(this.pos);return this.pos+=2,n}readI16(){const n=this.view.getInt16(this.pos);return this.pos+=2,n}readU32(){const n=this.view.getUint32(this.pos);return this.pos+=4,n}readI32(){const n=this.view.getInt32(this.pos);return this.pos+=4,n}readU64(){const n=Kb(this.view,this.pos);return this.pos+=8,n}readI64(){const n=Km(this.view,this.pos);return this.pos+=8,n}readU64AsBigInt(){const n=this.view.getBigUint64(this.pos);return this.pos+=8,n}readI64AsBigInt(){const n=this.view.getBigInt64(this.pos);return this.pos+=8,n}readF32(){const n=this.view.getFloat32(this.pos);return this.pos+=4,n}readF64(){const n=this.view.getFloat64(this.pos);return this.pos+=8,n}}function pw(r,n){return new cu(n).decode(r)}const Jm={contentType:"application/msgpack",encode:r=>lw(r,{ignoreUndefined:!0}),decode:r=>pw(r)},mw={contentType:"application/json",encode:r=>vm(JSON.stringify(r)),decode:r=>JSON.parse(gm(r))},yw=r=>r?Jm:mw,Jp=async(r,n,a,l,u,f)=>{if(r.emit(_e.unroutable,{source:a,target:l,reason:f}),n.type!==We.RequestMessage)return;const d=n.payload?.id;if(!d)return;const m={type:Xe.error,id:d,code:u,error:{name:"RpcError",message:`${r.name}: ${f}`}},g=new wm;g.type=We.ErrorMessage,g.payload=m;try{await r.receive(g,r.name,a)}catch{}},gw=64,vw=r=>typeof r=="string"&&r.length>0&&r.length<=gw,Fp="presence",bw=128,Wp=8,Ip=r=>typeof r=="string"&&r.length>0&&r.length<=bw&&![...r].some(n=>n===" "||n.charCodeAt(0)<32||n.charCodeAt(0)===127),ww=async(r,n)=>{const a=r.map(u=>u.presenceSettled?.()??Promise.resolve());let l;await Promise.race([Promise.all(a).then(()=>{}),new Promise(u=>{l=setTimeout(u,n),l.unref?.()})]),l!==void 0&&clearTimeout(l)};class Pp extends rr{url;options;announcePresence;allowInsecureTls;socket;connected=!1;codec=Jm;knownPeers=new Set;carrying=[];sweepLanded;sweep=new Promise(n=>this.sweepLanded=n);presenceSettled(){return this.announcePresence||this.sweepLanded?.(),this.sweep}constructor(n,a,l,u={},f=!0,d=!1){super(n,l),this.url=a,this.options=u,this.announcePresence=f,this.allowInsecureTls=d,queueMicrotask(()=>{this.open().catch(m=>this.emit(_e.transportError,m))})}closing=!1;async close(){this.closing=!0,this.sweepLanded?.(),this.sweepLanded=void 0;const n=this.socket;if(this.socket=void 0,this.connected=!1,this.readyFlag=!1,!n)return;n.io.reconnection(!1);const a=n.io.engine,l=n.connected&&a?new Promise(u=>{const f=setTimeout(u,2e3);f.unref?.(),a.once("close",()=>{clearTimeout(f),u()})}):Promise.resolve();n.disconnect(),await l,n.removeAllListeners(),this.knownPeers.clear()}async open(){if(this.socket)return;super.open();const n=this.url;this.allowInsecureTls&&(this.options={rejectUnauthorized:!1,...this.options},this.warnAboutInsecureTls()),this.socket=n?ka(n,this.options):ka(this.options),this.socket.on("message",async a=>{try{const[l,u,f]=this.extractHeader(new Uint8Array(a));if(!l){this.emit(_e.rejected,{source:"unknown",reason:f??"no msgrpc header"});return}const d=this.codec.decode(u);await this.deliver(d,l.source,l.target,l.hops??0)}catch(l){this.emit(_e.rejected,{source:"unknown",reason:`undecodable frame: ${String(l)}`,error:l})}}),this.socket.on(Fp,a=>{try{this.onPresence(a)}catch(l){this.emit(_e.rejected,{source:"unknown",reason:`bad presence update: ${String(l)}`,error:l})}}),this.socket.on("connect",()=>{this.connected=!0,this.readyFlag=!0,this.announcePresence&&this.announce(),this.emit(_e.connected)}),this.socket.on("disconnect",a=>{this.connected=!1,this.readyFlag=!1;for(const l of[...this.knownPeers])this.knownPeers.delete(l),this.emit(_e.peerGone,l);this.emit(_e.disconnected,a),a==="io server disconnect"&&!this.closing&&setTimeout(()=>{!this.closing&&this.socket?.disconnected&&this.socket.connect()},1e3).unref?.()})}warnAboutInsecureTls(){!this.url||!/^(https|wss):/i.test(this.url)||console.warn(`source-rpc: '${this.name}' is connecting to ${this.url} with allowInsecureTls, so the server's certificate is not checked. Anything able to answer on that address can read and rewrite this link. Use it for a development server, not a plant.`)}registerIfUnrouted(n){this.peerRegistry.get(n)||this.setKnownSource(n)}announce(){const n={name:this.name};this.carrying.length&&(n.carrying=this.carrying),this.shape&&(n.shape=this.shape),this.socket?.emit(Fp,n)}shape;announceShape(n){this.shape!==n&&(this.shape=n,this.connected&&this.announcePresence&&this.announce())}advertise(n){const a=[...n].sort();a.length===this.carrying.length&&a.every((l,u)=>l===this.carrying[u])||(this.carrying=a,this.connected&&this.announcePresence&&this.announce())}noteShape(n,a){vw(a)&&this.peerRegistry.noteShape(n,a)&&this.emit(_e.peerShape,n,a)}onPresence(n){if(Array.isArray(n.peers)){const a=this.sweepLanded;this.sweepLanded=void 0,a?.();for(const l of n.peers)!Ip(l)||l===this.name||(n.shapes&&Object.prototype.hasOwnProperty.call(n.shapes,l)&&this.noteShape(l,n.shapes[l]),!this.knownPeers.has(l)&&(this.knownPeers.add(l),this.registerIfUnrouted(l),this.emit(_e.peerOnline,l)));return}if(!(!Ip(n.peer)||n.peer===this.name))if(n.state==="offline"){if(!this.knownPeers.delete(n.peer))return;this.emit(_e.peerGone,n.peer)}else{if(n.shape!==void 0&&this.noteShape(n.peer,n.shape),this.knownPeers.has(n.peer))return;this.knownPeers.add(n.peer),this.registerIfUnrouted(n.peer),this.emit(_e.peerOnline,n.peer)}}async deliver(n,a,l,u){if(l!==this.name){const f=this.peerRegistry.get(l);if(f&&f!==this&&f.isTransport()){if(u+1>Wp){await Jp(this,n,a,l,"TransportError",`over ${Wp} relays`);return}const d=f;d.forward?d.forward(n,a,l,u+1):await f.receive(n,a,l);return}}if(this.targetExists(l)){await this.send(n,a,l);return}await Jp(this,n,a,l,"TransportError",`no route to '${l}'`)}forward(n,a,l,u){try{this.requireSocket().emit("message",this.frameMessage(this.buildHeader(a,l,{hops:u}),this.codec.encode(n)))}catch(f){this.emit(_e.unroutable,{source:a,target:l,reason:`cannot forward: ${String(f)}`,error:f})}}requireSocket(){if(!this.socket)throw new Error(`SocketIoClientTransport '${this.name}': not connected to ${this.url??"the default url"}`);return this.socket}async receive(n,a,l){this.requireSocket().emit("message",this.frameMessage(this.buildHeader(a,l),this.codec.encode(n)))}isTransport(){return!0}}const uu=Object.freeze(`abandon
10
10
  ability
11
11
  able
12
12
  about
@@ -2054,10 +2054,10 @@ zebra
2054
2054
  zero
2055
2055
  zone
2056
2056
  zoo`.split(`
2057
- `));cu.length;const vw=r=>{const n=new Uint32Array(r);return crypto.getRandomValues(n),[...n].map(a=>a%cu.length)},bw=(r=3)=>vw(r).map(n=>cu[n]).join("-"),ww=(r,n=3)=>`${r}-${bw(n)}`,Ip=128;class Sw{local;peer;caller;chains=new Map;constructor(n,a,l,u){this.local=n,this.peer=a,this.caller=l,n.on("contextChanged",()=>{for(const f of this.chains.values())f.localChanged()}),u.on(_e.disconnected,()=>{for(const f of this.chains.values())f.markStale()});for(const f of[_e.peerGone,_e.peerDisplaced])u.on(f,d=>{for(const m of this.chains.values())m.peerLost(String(d))});u.on(_e.connected,()=>{for(const f of this.chains.values())f.reconnect()})}store(n,a){let l=this.chains.get(n);return l||this.chains.set(n,l=new xw(this,n,()=>this.chains.delete(n))),l.storeFor(a)}require(n,a){const l=this.store(n,a).getSnapshot();if(l.status==="invalid")throw new Error(`context: ${a.id} at ${n} is invalid (${l.invalidReason}) - topology-dependent decisions fail closed`);if(l.status==="missing")throw new Error(`context: nothing provides ${a.id} on ${n}'s ${a.axis} chain`);if(l.status==="stale"&&(a.stalePolicy??"allow")==="reject")throw new Error(`context: ${a.id} at ${n} is stale, and this token rejects stale answers`);if(l.status!=="live"&&l.status!=="stale")throw new Error(`context: ${a.id} at ${n} is still ${l.status}`);const u=l.entry??l.entries?.[0];if(!u)throw new Error(`context: nothing provides ${a.id} on ${n}'s ${a.axis} chain`);return u.value}capture(n,a){return h0({peer:this.peer,instance:n},a.map(l=>{const u=this.store(n,l).getSnapshot(),f=u.entry??u.entries?.[0];return{token:l,...f&&(u.status==="live"||u.status==="stale")?{entry:{tokenId:l.id,schemaVersion:l.schemaVersion,axis:l.axis,provider:f.provider,providerVersion:f.providerVersion,mountEpoch:u.mountEpoch,value:f.value}}:{}}}))}}class xw{resolver;node;release;tokens=new Map;hops={physical:[],logical:[]};localSnapshot;retired=new Set;cycles={};mountKeys={};mountEpochs={};reasons={};constructor(n,a,l){this.resolver=n,this.node=a,this.release=l}storeFor(n){let a=this.tokens.get(n.id);a||(a={token:n,view:{tokenId:n.id,axis:n.axis,status:"initializing",mountEpoch:"",resolvedAt:0,transitionReason:"initial-load"},listeners:new Set,users:0},this.tokens.set(n.id,a),this.localChanged()),a.users++;const l=a;return{getSnapshot:()=>l.view,subscribe:u=>(l.listeners.add(u),()=>l.listeners.delete(u)),close:()=>{if(l.users--,!(l.users>0)&&(l.view={...l.view,status:"closed"},this.notify(l),this.tokens.delete(l.token.id),this.tokens.size===0)){for(const u of["physical","logical"])this.retireFrom(u,0);this.release()}}}}localChanged(){this.localSnapshot=this.resolver.local.snapshotFor(this.node,[...this.tokens.keys()],0,!1),this.rebuild("physical"),this.rebuild("logical");for(const n of["physical","logical"])for(const a of this.hops[n])a.retired||(a.peer===this.resolver.peer||a.tokenKey!==this.tokensFor(n).join(","))&&this.open(a);this.recompute()}markStale(){for(const n of["physical","logical"])for(const a of this.hops[n])a.stale=!0;this.recompute()}peerLost(n){for(const a of["physical","logical"])for(const l of this.hops[a])l.peer===n&&(l.stale=!0);this.recompute()}reconnect(){for(const n of["physical","logical"])for(const a of this.hops[n])a.stale&&!a.retired&&(this.reasons[n]="reconnect",this.open(a))}rebuild(n){const a=this.hops[n];this.cycles[n]=void 0;let l=[...this.localSnapshot?.walked[n]??[]],u=this.localSnapshot?.continues[n],f=0;for(;u;){const d=u,m=l.findIndex(R=>Mp(R,d));if(m!==-1){this.cycles[n]=l.slice(m),this.retireFrom(n,f);return}const y=a[f];if(y&&y.peer===u.peer&&y.node===u.instance){y.snapshot&&(l=[...l,...y.snapshot.walked[n]]),u=y.snapshot?.continues[n],f++;continue}this.retireFrom(n,f);const b={peer:u.peer,node:u.instance,axis:n,subscriptionId:et(),stale:!1,retired:!1};a[f]=b,this.open(b),u=void 0,f++}this.retireFrom(n,f)}retireFrom(n,a){const l=this.hops[n];for(const u of l.splice(a)){u.retired=!0,this.retired.add(u.subscriptionId),u.detach?.();const f=this.resolver.caller.proxy(Ea,u.peer);Promise.resolve(f.unsubscribe(u.subscriptionId)).catch(()=>{})}}tokensFor(n){return[...this.tokens.values()].filter(a=>a.token.axis===n).map(a=>a.token.id)}async open(n){if(n.tokenKey=this.tokensFor(n.axis).join(","),n.peer===this.resolver.peer){this.accept(n,this.resolver.local.snapshotFor(n.node,this.tokensFor(n.axis),0,!1));return}const a=this.resolver.caller.eventEmitter;if(!n.detach){const l=Pl(n.peer,Ea,km),u=f=>{const d=f;d.subscriptionId!==n.subscriptionId||n.retired||n.snapshot&&d.snapshot.seq<=n.snapshot.seq||this.accept(n,d.snapshot)};a.on(l,u),n.detach=()=>{a.removeListener(l,u)}}try{const u=await this.resolver.caller.proxy(Ea,n.peer).subscribe(n.subscriptionId,n.node,this.tokensFor(n.axis));if(n.retired)return;n.stale=!1,this.accept(n,u)}catch{n.retired||(n.stale=!0,this.recompute(),setTimeout(()=>{!n.retired&&n.stale&&this.open(n)},2e3).unref?.())}}accept(n,a){const l=!n.snapshot||!Mp(n.snapshot.continues[n.axis]??null,a.continues[n.axis]??null);n.snapshot=a,n.stale=!1,l&&this.rebuild(n.axis),this.recompute()}recompute(){for(const n of this.tokens.values()){const a=n.token.axis,l=this.hops[a],u=[...this.localSnapshot?[this.localSnapshot]:[],...l.flatMap(N=>N.snapshot?[N.snapshot]:[])],f=u.map(N=>N.chainKey[a]).join(" ")+" "+l.map(N=>N.subscriptionId).join(" ");let d=!1;this.mountKeys[a]!==f&&(this.mountKeys[a]!==void 0&&this.reasons[a]!=="reconnect"&&(this.reasons[a]=a==="logical"?"owner-remount":"parent-remount"),this.mountKeys[a]=f,this.mountEpochs[a]=et(),d=!0);const m=this.mountEpochs[a]??"",y=this.reasons[a]??"initial-load",b=u.flatMap(N=>N.trouble.filter(C=>C.axis===a)),R=l.some(N=>!N.snapshot&&!N.retired),w=l.some(N=>N.stale&&!N.retired),j=u.flatMap(N=>N.walked[a]),L=this.cycles[a],K=u.flatMap(N=>(N.tokens.find(C=>C.tokenId===n.token.id)?.entries??[]).filter(C=>C.axis===a).map(C=>({value:C.value,provider:C.node,providerVersion:C.provider}))),P=!R&&!w,W=d&&(n.view.entry||n.view.entries)?{previous:n.view.entry??n.view.entries}:n.view.previous?{previous:n.view.previous}:{};let z;const X={tokenId:n.token.id,axis:a,mountEpoch:m,resolvedAt:Date.now(),transitionReason:y,...W};if(b.length||L||j.length>Ip){const N=b[0];z={...X,status:"invalid",invalidReason:L?"cycle":j.length>Ip?"depth-exceeded":N.status==="cycle"?"cycle":N.status,...L?{invalidPath:L}:N?.path?{invalidPath:N.path}:{}}}else if(R)z={...X,status:"initializing"};else if(K.length===0)z={...X,status:w?"stale":"missing",...w?{staleSince:n.view.staleSince??Date.now()}:{}};else{const N=n.token.resolution??"nearest";z={...X,status:w?"stale":"live",...w?{staleSince:n.view.staleSince??Date.now()}:{},...N==="nearest"?{entry:K[0]}:{entries:K}}}z.status==="stale"&&!z.entry&&!z.entries&&(n.view.entry||n.view.entries)&&(z={...z,...n.view.entry?{entry:n.view.entry}:{},...n.view.entries?{entries:n.view.entries}:{}}),P&&z.status==="live"&&(this.reasons[a]=void 0),JSON.stringify({...n.view,resolvedAt:0})!==JSON.stringify({...z,resolvedAt:0})&&(n.view=z,this.notify(n))}}notify(n){for(const a of[...n.listeners])try{a()}catch{}}}const Ew=JSON.parse('{"RpcTopologyRecord":{"kind":"object","fields":{"ref":{"type":{"kind":"ref","name":"RpcRef"}},"parent":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"owner":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"parentEpoch":{"type":{"kind":"string"}},"ownerEpoch":{"type":{"kind":"string"}},"version":{"type":{"kind":"ref","name":"RpcTopologyVersion"}},"label":{"type":{"kind":"string"},"optional":true}}},"RpcRef":{"kind":"object","fields":{"peer":{"type":{"kind":"string"}},"instance":{"type":{"kind":"string"}}}},"RpcTopologyVersion":{"kind":"object","fields":{"epoch":{"type":{"kind":"string"}},"revision":{"type":{"kind":"number"}}}},"RpcTopologyCapabilities":{"kind":"object","fields":{"authorityScope":{"type":{"kind":"literal","value":"host"}},"cycleGuarantee":{"type":{"kind":"literal","value":"detected"}},"reverseIndex":{"type":{"kind":"literal","value":"eventual"}},"deletion":{"type":{"kind":"literal","value":"tombstone"}},"durability":{"type":{"kind":"union","options":[{"kind":"literal","value":"volatile"},{"kind":"literal","value":"durable"}]}}}},"RpcTopologyPatch":{"kind":"object","fields":{"parent":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"owner":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"label":{"type":{"kind":"string"},"optional":true}}},"RpcTopologyMutation":{"kind":"object","fields":{"expectedVersion":{"type":{"kind":"ref","name":"RpcTopologyVersion"}},"reason":{"type":{"kind":"string"},"optional":true}}},"ServerDescription":{"kind":"object","fields":{"name":{"type":{"kind":"string"}},"version":{"type":{"kind":"string"},"optional":true},"validating":{"type":{"kind":"boolean"}},"namespaces":{"type":{"kind":"array","items":{"kind":"ref","name":"DescribedNamespace"}}},"host":{"type":{"kind":"object","fields":{"root":{"type":{"kind":"ref","name":"RpcRef"}},"parent":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"owner":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"place":{"type":{"kind":"array","items":{"kind":"string"}},"optional":true},"label":{"type":{"kind":"string"},"optional":true},"capabilities":{"type":{"kind":"ref","name":"RpcTopologyCapabilities"}}}},"optional":true},"types":{"type":{"kind":"record","values":{"kind":"ref","name":"TypeNode"}},"optional":true}}},"DescribedNamespace":{"kind":"object","fields":{"name":{"type":{"kind":"string"}},"version":{"type":{"kind":"string"},"optional":true},"className":{"type":{"kind":"string"},"optional":true},"created":{"type":{"kind":"boolean"}},"emitter":{"type":{"kind":"boolean"}},"serialised":{"type":{"kind":"boolean"},"optional":true},"component":{"type":{"kind":"ref","name":"DescribedComponent"},"optional":true},"topology":{"type":{"kind":"ref","name":"DescribedTopology"},"optional":true},"capabilities":{"type":{"kind":"array","items":{"kind":"string"}},"optional":true},"methods":{"type":{"kind":"array","items":{"kind":"ref","name":"DescribedMethod"}}},"events":{"type":{"kind":"array","items":{"kind":"ref","name":"DescribedEvent"}}}}},"DescribedComponent":{"kind":"object","fields":{"props":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"state":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"subscribers":{"type":{"kind":"number"}}}},"TypeNode":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"FieldNode":{"kind":"object","fields":{"type":{"type":{"kind":"ref","name":"TypeNode"}},"optional":{"type":{"kind":"boolean"},"optional":true}}},"DescribedTopology":{"kind":"object","fields":{"parent":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"owner":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"parentEpoch":{"type":{"kind":"string"}},"ownerEpoch":{"type":{"kind":"string"}},"label":{"type":{"kind":"string"},"optional":true}}},"DescribedMethod":{"kind":"object","fields":{"name":{"type":{"kind":"string"}},"params":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}},"optional":true},"paramNames":{"type":{"kind":"array","items":{"kind":"string"}},"optional":true},"rest":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"returns":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"semantics":{"type":{"kind":"union","options":[{"kind":"literal","value":"query"},{"kind":"literal","value":"idempotent-command"},{"kind":"literal","value":"non-repeatable-command"}]},"optional":true},"requiresAuthority":{"type":{"kind":"boolean"},"optional":true}}},"DescribedEvent":{"kind":"object","fields":{"name":{"type":{"kind":"string"}},"params":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}},"optional":true},"subscribers":{"type":{"kind":"number"}}}}}'),kw={msgrpc:{methods:{topology:{params:[],returns:{kind:"object",fields:{records:{type:{kind:"array",items:{kind:"ref",name:"RpcTopologyRecord"}}},place:{type:{kind:"array",items:{kind:"string"}},optional:!0},capabilities:{type:{kind:"ref",name:"RpcTopologyCapabilities"}}}},semantics:"query"},updateTopology:{params:[{kind:"string"},{kind:"ref",name:"RpcTopologyPatch"},{kind:"ref",name:"RpcTopologyMutation"}],paramNames:["instance","patch","mutation"],returns:{kind:"ref",name:"RpcTopologyRecord"},semantics:"idempotent-command"},eventCursor:{params:[{kind:"string"},{kind:"string"}],paramNames:["namespace","event"],returns:{kind:"object",fields:{epoch:{type:{kind:"string"}},seq:{type:{kind:"union",options:[{kind:"null"},{kind:"number"}]},optional:!0},since:{type:{kind:"number"},optional:!0}}},semantics:"query"},describe:{params:[],returns:{kind:"ref",name:"ServerDescription"}}}}},Tw={types:Ew,namespaces:kw};var Pp=function(r,n,a){for(var l=arguments.length>2,u=0;u<n.length;u++)a=l?n[u].call(r,a):n[u].call(r);return l?a:void 0},ba=function(r,n,a,l,u,f){function d(z){if(z!==void 0&&typeof z!="function")throw new TypeError("Function expected");return z}for(var m=l.kind,y=m==="getter"?"get":m==="setter"?"set":"value",b=!n&&r?l.static?r:r.prototype:null,R=n||(b?Object.getOwnPropertyDescriptor(b,l.name):{}),w,j=!1,L=a.length-1;L>=0;L--){var K={};for(var P in l)K[P]=P==="access"?{}:l[P];for(var P in l.access)K.access[P]=l.access[P];K.addInitializer=function(z){if(j)throw new TypeError("Cannot add initializers after decoration has completed");f.push(d(z||null))};var W=(0,a[L])(m==="accessor"?{get:R.get,set:R.set}:R[y],K);if(m==="accessor"){if(W===void 0)continue;if(W===null||typeof W!="object")throw new TypeError("Object expected");(w=d(W.get))&&(R.get=w),(w=d(W.set))&&(R.set=w),(w=d(W.init))&&u.unshift(w)}else(w=d(W))&&(m==="field"?u.unshift(w):R[y]=w)}b&&Object.defineProperty(b,l.name,R),j=!0};const Zm="msgrpc.",nn=r=>{switch(r.kind){case"ref":return{...r,name:Zm+r.name};case"array":return{...r,items:nn(r.items)};case"record":return{...r,values:nn(r.values)};case"tuple":return{...r,items:r.items.map(nn)};case"union":return{...r,options:r.options.map(nn)};case"object":return{...r,fields:Object.fromEntries(Object.entries(r.fields).map(([n,a])=>[n,{...a,type:nn(a.type)}]))};default:return r}},_w=r=>({...r,params:r.params.map(nn),...r.rest?{rest:nn(r.rest)}:{},...r.returns?{returns:nn(r.returns)}:{}}),wa=Tw,em={namespace:{...wa.namespaces.msgrpc,methods:Object.fromEntries(Object.entries(wa.namespaces.msgrpc.methods).map(([r,n])=>[r,_w(n)])),...wa.namespaces.msgrpc.events?{events:Object.fromEntries(Object.entries(wa.namespaces.msgrpc.events).map(([r,n])=>[r,{params:n.params.map(nn)}]))}:{}},types:Object.fromEntries(Object.entries(wa.types??{}).map(([r,n])=>[Zm+r,nn(n)]))},Aw=r=>r?.namespaces.msgrpc?r:{schema:w0,...r,types:{...r?.types,...em.types},namespaces:{...r?.namespaces,msgrpc:em.namespace}};let Nw=(()=>{var b;let r=[Sm("msgrpc")],n,a=[],l,u=[],f,d,m,y;return b=class{handler=Pp(this,u);constructor(w){this.handler=w}async topology(){const w=this.handler.hostTopology;if(w)return{records:w.all(),...w.place?{place:w.place}:{},capabilities:w.capabilities()}}async updateTopology(w,j,L){const K=this.handler.hostTopology;if(!K)throw new Error("this host keeps no topology records");if(!this.handler.allowTopologyMutation)throw new Error("this host does not accept remote topology mutation - it is enabled with topology.allowRemoteMutation, and gated by authorize() like any call");return w===dt?K.updateHost(j,L):K.update(w,j,L)}async eventCursor(w,j){this.handler.eventSequenceOf(w,j)===void 0&&this.handler.trackEvent(w,j);const K=this.handler.eventSequenceOf(w,j);return{epoch:this.handler.epoch,seq:K??null,...K!==void 0?{since:this.handler.eventTrackedSince(w,j)}:{}}}async describe(){const w=this.handler.manageRpc,j=this.handler.schema,L=new Set(w.createdInstances.keys()),K=Object.entries(w.exposedNameSpaceInstances).map(([z,X])=>{const J=j?.namespaces[z],C=[...w.findNameSpaceMethodMap(z)?.keys()??[]].sort().map(ue=>{const je=J?.methods[ue],Ge=this.handler.semanticsOf({path:z,method:ue});return{name:ue,...je?{params:je.params,paramNames:je.paramNames,rest:je.rest,returns:je.returns}:{},...Ge?{semantics:Ge}:{},...w.exposedAuthority[z]?.has(ue)?{requiresAuthority:!0}:{}}}),H=new Set(Object.keys(J?.events??{}));for(const ue of this.handler.eventProxies.values())ue.instanceName===z&&H.add(ue.event);H.delete(_n);const B=[...H].sort().map(ue=>({name:ue,...J?.events?.[ue]?{params:J.events[ue].params}:{},subscribers:[...this.handler.eventProxies.values()].filter(je=>je.instanceName===z&&je.event===ue).length})),Q=this.handler.hostTopology?.get(z),ne=Q?{parent:Q.parent,owner:Q.owner,parentEpoch:Q.parentEpoch,ownerEpoch:Q.ownerEpoch,...Q.label!==void 0?{label:Q.label}:{}}:void 0,se=w.exposedExecution[z],xe=X instanceof hs?{...J?.component?{props:J.component.props,state:J.component.state}:{},subscribers:[...this.handler.eventProxies.values()].filter(ue=>ue.instanceName===z&&ue.event===_n).length}:void 0;return{name:z,...J?.version?{version:J.version}:{},...se&&se!=="parallel"?{serialised:!0}:{},className:X.constructor?.name,created:L.has(z),emitter:X instanceof Il,...xe?{component:xe}:{},...ne?{topology:ne}:{},...J?.capabilities?{capabilities:J.capabilities}:{},methods:C,events:B}}),P=this.handler.hostTopology,W=P?.get(dt);return{name:this.handler.name,...j?.version?{version:j.version}:{},validating:!!j&&this.handler.validation!=="off",namespaces:K.sort((z,X)=>z.name.localeCompare(X.name)),...P&&W?{host:{root:W.ref,parent:W.parent,...W.owner?{owner:W.owner}:{},...P.place?{place:P.place}:{},...W.label!==void 0?{label:W.label}:{},capabilities:P.capabilities()}}:{},...j?.types?{types:j.types}:{}}}},l=b,(()=>{const w=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;f=[fs({semantics:"query"})],d=[fs({semantics:"idempotent-command"})],m=[fs({semantics:"query"})],y=[fs],ba(b,null,f,{kind:"method",name:"topology",static:!1,private:!1,access:{has:j=>"topology"in j,get:j=>j.topology},metadata:w},null,u),ba(b,null,d,{kind:"method",name:"updateTopology",static:!1,private:!1,access:{has:j=>"updateTopology"in j,get:j=>j.updateTopology},metadata:w},null,u),ba(b,null,m,{kind:"method",name:"eventCursor",static:!1,private:!1,access:{has:j=>"eventCursor"in j,get:j=>j.eventCursor},metadata:w},null,u),ba(b,null,y,{kind:"method",name:"describe",static:!1,private:!1,access:{has:j=>"describe"in j,get:j=>j.describe},metadata:w},null,u),ba(null,n={value:l},r,{kind:"class",name:l.name,metadata:w},null,a),l=n.value,w&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:w}),Pp(l,a)})(),l})();const Ow=r=>{let n=0xcbf29ce484222325n;for(let a=0;a<r.length;a++)n^=BigInt(r.charCodeAt(a)),n=n*0x100000001b3n&0xffffffffffffffffn;return n.toString(16).padStart(16,"0")},tm=r=>{const n=r.manageRpc,a=r.schema,l=Object.keys(n.exposedNameSpaceInstances).sort().map(u=>{const f=a?.namespaces[u],d=[...n.findNameSpaceMethodMap(u)?.keys()??[]].sort().map(m=>{const y=r.semanticsOf({path:u,method:m});return{name:m,...f?.methods[m]?{signature:f.methods[m]}:{},...y?{semantics:y}:{},...n.exposedAuthority[u]?.has(m)?{requiresAuthority:!0}:{}}});return{name:u,...f?.version?{version:f.version}:{},className:n.exposedNameSpaceInstances[u]?.constructor?.name,methods:d,events:Object.keys(f?.events??{}).sort(),...f?.capabilities?{capabilities:[...f.capabilities].sort()}:{},...f?.component?{component:f.component}:{}}});return Ow(JSON.stringify(l))};class jw extends rr{getTarget;targets=new Map;constructor(n,a){super("",n),this.getTarget=a}async receive(n,a,l){let u;if(this.getTarget&&(u=this.getTarget(l)),u||(u=this.targetExists(l)),u||(u=super.targetExists(l)),!u)throw this.emit(_e.unroutable,{source:a,target:l,reason:"no switch target for this peer"}),new Error(`no route to '${l}': nothing here reaches that peer. If it has only just connected, its presence may not have arrived yet - await it before calling.`);await u.receive(n,a,l)}setTarget(n,a){const u=a===void 0?(d=>d.getName())(n):a;this.targets.set(u,n);let f=!1;return()=>{f||(f=!0,this.targets.delete(u))}}setTargets(n){for(const a of n)this.setTarget(a)}targetExists(n,a=0){let l;return this.targets.forEach(u=>{!l&&!u.isTransport()&&u.targetExists(n,a+1)&&(l=u)}),l}}class Rw{rpc;caller;readyFlag=!1;switch;transports=[];peers=new gm;topology;context;contextResolver;componentChannels;componentLifecycle=new ei.EventEmitter;options={name:"*",transports:[],useMsgPack:!0,readyTimeout:3e4};constructor(n={}){this.options={...this.options,...n},this.rpc=new j0(this.options.name),this.caller=new U0(this.options.name,[],this.options.callTimeout??_m),this.switch=new jw([this.rpc,this.caller]);for(const a of[this.rpc,this.caller,this.switch])a.usePeerRegistry(this.peers);this.rpc.authorize=this.options.authorize,this.rpc.requireIdentity=this.options.requireAuthenticatedPeers??!!this.options.authenticate,this.rpc.resolveIdentity=a=>{for(const l of this.transports){const u=l.getIdentity(a);if(u)return u}},this.rpc.schema=this.options.schema,this.rpc.validation=this.options.validation??(this.options.schema?"described":"off"),this.rpc.validateResults=this.options.validateResults??!1,this.options.validateComponentSnapshots&&(this.rpc.manageRpc.componentContractFor=a=>{const l=this.rpc.schema?.namespaces[a]?.component;return l?{component:l,types:this.rpc.schema?.types}:void 0}),this.rpc.unknownVersion=this.options.unknownVersion??"allow",this.rpc.idempotency=this.options.idempotency,this.rpc.manageRpc.requireExplicitExposure=this.options.requireExplicitExposure??!1,this.options.exposeManagement&&this.rpc.manageRpc.exposeManagement(),this.options.exposeIntrospection&&(this.rpc.manageRpc.exposeClassInstance(new Nw(this.rpc)),this.rpc.schema=Aw(this.rpc.schema)),this.topology=new o0(this.options.name,this.options.topology),this.rpc.hostTopology=this.topology,this.rpc.allowTopologyMutation=this.options.topology?.allowRemoteMutation??!1,this.context=new f0(this.topology),this.topology.onCommitted=()=>this.context.changed(),this.rpc.hostContext=this.context,this.context.push=(a,l)=>{this.rpc.sendEvent(a,km,[l],Ea).catch(()=>{})},this.contextResolver=new Sw(this.context,this.options.name,this.caller,this.componentLifecycle),this.starting=this.topology.init().then(()=>this.buildTransports()).then(()=>{this.readyFlag=!0},a=>{this.initError=a}),this.init().catch(a=>{this.initError=a,this.emitSafely("initError",a)})}initError;starting=Promise.resolve();configuredTransports(){return this.options.transports}async buildTransport(n){if(n instanceof rr)return n;if(n.connect){const a=n;return new Wp(this.options.name,a.connect,[],{...a.path?{path:a.path}:{},...a.credentials?{auth:a.credentials}:{},...a.ca?{ca:a.ca}:{}},!0,a.allowInsecureTls)}}async buildTransports(){const n=dw(this.options.useMsgPack);for(const a of this.configuredTransports()){const l=await this.buildTransport(a);if(!l)throw new Error(`RpcServer '${this.options.name}': no transport can be built from ${JSON.stringify(a)}`);l.codec=n,this.options.relay!==void 0&&"relay"in l&&(l.relay=this.options.relay),this.attach(l)}}announceShape(){if(!this.rpc)return;this.rpc.trackDeclaredEvents();const n=tm(this.rpc);for(const a of this.transports)a.announceShape?.(n)}attach(n){this.transports.push(n),n.announceShape?.(tm(this.rpc)),n.usePeerRegistry(this.peers),n.pipe(this.rpc),n.pipe(this.caller),this.switch?.setTarget(n),n.on(_e.peerGone,a=>this.safely("peerGone",a,()=>{this.rpc.removePeer(a),this.context.dropSubscriber(a),this.peers.delete(a),this.relayPresence(n,a,"offline");for(const l of this.transports){const u=l;u.stopWatchingFor&&u.stopWatchingFor(a).catch(f=>this.emitSafely("presenceError",{peer:a,error:f}))}})),n.on(_e.peerOnline,a=>this.safely("peerOnline",a,()=>this.relayPresence(n,a,"online"))),n.on(_e.connected,()=>{this.caller.resubscribe().catch(a=>this.emitSafely("resubscribeError",a))});for(const a of[_e.disconnected,_e.peerGone,_e.peerDisplaced,_e.connected])n.on(a,l=>this.componentLifecycle.emit(a,l))}relayPresence(n,a,l){for(const u of this.transports){if(u===n)continue;const f=u;f.announcePeer&&f.announcePeer(a,l)}this.advertiseReachability()}advertiseReachability(){for(const n of this.transports)n instanceof Wp&&n.advertise(this.peers.names().filter(a=>a!==this.options.name&&this.peers.get(a)!==n))}emitSafely(n,a){for(const l of this.transports)l.emit(n,a)}safely(n,a,l){try{l()}catch(u){this.emitSafely("presenceError",{what:n,peer:a,error:u})}}async proxy(n,a){return await this.ready(),this.caller.proxy(n,a??"*")}async component(n,a){await this.ready(),this.componentChannels??=new B0(this.caller,this.componentLifecycle);const l=await this.componentChannels.open(n,a);return Nm(l,l.inner)}provideContext(n,a,l){return this.context.provide(n,a,l)}contextOf(n,a){return this.contextResolver.store(n,a)}requireContext(n,a){return this.contextResolver.require(n,a)}captureContext(n,a){return this.contextResolver.capture(n,a)}async close(){await this.starting.catch(()=>{}),this.componentChannels?.closeAll(),this.caller.failPendingCalls("server closed"),this.caller.subscriptions.clear(),await this.caller.close(),await Promise.all(this.transports.map(n=>n.close())),this.transports=[],this.peers.clear()}exposeClassInstance(n,a,l){this.rpc.manageRpc.exposeClassInstance(n,a,l),this.announceShape()}exposeClass(n,a){this.rpc.manageRpc.exposeClass(n,a),this.announceShape()}exposeObject(n,a){this.rpc.manageRpc.exposeObject(n,a),this.announceShape()}expose(n,a){this.rpc.manageRpc.expose(n,a),this.announceShape()}async createRpcInstance(n,a,...l){const u=await this.rpc.manageRpc.createRpcInstance(n,a,...l);return this.announceShape(),u}addTarget(n,a){this.switch?.setTarget(a)}async init(){}async ready(){await this.starting;const n=()=>this.transports.filter(l=>!l.readyFlag).length==0,a=Date.now()+this.options.readyTimeout;for(;!n()||!this.readyFlag;){const l=this.transports.find(u=>u.startupError!==void 0);if(l&&(this.initError=l.startupError),this.initError!==void 0)throw new Error(`RpcServer '${this.options.name}': could not start: ${this.initError instanceof Error?this.initError.message:String(this.initError)}`,{cause:this.initError});if(this.options.readyTimeout>0&&Date.now()>a){const u=this.transports.filter(f=>!f.readyFlag).map(f=>f.getName());throw new Error(`RpcServer '${this.options.name}': transports not ready within ${this.options.readyTimeout} ms: ${u.join(", ")}`)}await new Promise(u=>setTimeout(u,10))}}async awaitPeer(n,a=5e3){const l=Date.now()+a;for(;;){if(this.peers.get(n))return!0;if(Date.now()>=l)return!1;await new Promise(u=>setTimeout(u,20))}}async peersSettled(n=2e3){return await this.ready(),await gw(this.transports,n),this.peers.names().filter(a=>a!==this.options.name)}}const nm="msgrpc-page-name",zw=()=>{const r=new URLSearchParams(window.location.search).get("name")?.trim();if(r)return r;let n=sessionStorage.getItem(nm);return n||sessionStorage.setItem(nm,n=ww("page")),n},Mw=({peer:r,messages:n,onSend:a})=>{const[l,u]=Z.useState(""),[f,d]=Z.useState(null),[m,y]=Z.useState(!1),b=Z.useRef(null);Z.useEffect(()=>{b.current?.scrollIntoView({block:"end"})},[n.length]);const R=async()=>{!l.trim()||!r||(y(!0),d(await a(l.trim()).finally(()=>y(!1))??null),u(""))};return g.jsxs("div",{className:"chat",children:[g.jsxs("header",{children:[g.jsx("h1",{children:"Chat"}),g.jsx("span",{className:"muted mono",children:r??"—"})]}),!r&&g.jsx("p",{className:"muted",children:"Select a peer to talk to it. Any peer running this console can answer."}),r&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"chat-log",children:[n.length===0&&g.jsxs("p",{className:"muted",children:["Nothing yet. Say something to ",r,"."]}),n.map((w,j)=>g.jsx("div",{className:w.mine?"said mine":"said",children:g.jsx("span",{className:"text",children:w.text})},`${w.at}-${j}`)),g.jsx("div",{ref:b})]}),g.jsxs("div",{className:"chat-send",children:[g.jsx("input",{className:"control",value:l,placeholder:`say something to ${r}`,onChange:w=>u(w.target.value),onKeyDown:w=>{w.key==="Enter"&&R()}}),g.jsx("button",{className:"primary",disabled:m||!l.trim(),onClick:()=>{R()},children:m?"…":"Send"})]}),f&&g.jsx("p",{className:"muted bad",children:f})]})]})};var fm,hm,dm,os;dm=[Sm("chat")],hm=[fs({injectInvocation:!0})],fm=[fs];class cs{constructor(n){Tc(os,5,this);gp(this,"onMessage");this.onMessage=n}async say(n,a,l){const u=l.context.identity?.name??l.context.source;return this.onMessage(String(u),String(a)),"delivered"}async who(){return{app:"source-rpc console",kind:"browser page"}}}os=mp(null),Vl(os,1,"say",hm,cs),Vl(os,1,"who",fm,cs),cs=Vl(os,0,"ChatService",dm,cs),Tc(os,1,cs);const Cw=1,Uw={chat:{methods:{say:{params:[{kind:"string"},{kind:"string"}],paramNames:["from","text"],returns:{kind:"string"}},who:{params:[],returns:{kind:"object",fields:{app:{type:{kind:"string"}},kind:{type:{kind:"string"}}}}}}}},Dw={schema:Cw,namespaces:Uw},Bw=r=>{if(typeof r!="object"||r===null||Array.isArray(r))return null;const n=r;return!("value"in n)||!("quality"in n)&&!("unit"in n)&&!("forced"in n)?null:{value:n.value,quality:typeof n.quality=="string"?n.quality:void 0,unit:typeof n.unit=="string"?n.unit:void 0,forced:n.forced===!0}},im=r=>typeof r=="string"?r:JSON.stringify(r)??"undefined",sm=({name:r,value:n})=>{const a=Bw(n);return g.jsxs("div",{className:"value-row",children:[g.jsx("span",{className:"value-name mono",children:r}),a?g.jsxs("span",{className:"value mono",children:[im(a.value),a.unit&&g.jsxs("span",{className:"unit",children:[" ",a.unit]})]}):g.jsx("span",{className:"value mono",children:im(n)}),a?.forced&&g.jsx("span",{className:"quality forced",children:"forced"}),a?.quality&&g.jsx("span",{className:`quality q-${a.quality}`,children:a.quality})]})},qw=({peer:r,namespace:n,component:a,server:l,onSubscribed:u})=>{const[f,d]=Z.useState(null),[m,y]=Z.useState(null),[b,R]=Z.useState(!1),w=Z.useCallback(z=>f?f.subscribe(z):()=>{},[f]),j=Z.useCallback(()=>f?.getSnapshot()??null,[f]),L=Z.useSyncExternalStore(w,j);Z.useEffect(()=>()=>{f?.close()},[f]);const K=async()=>{const z=l.current;if(z){R(!0),y(null);try{const X=await z.component(n,r);d(X[Am]),u?.()}catch(X){y(X.message??String(X))}finally{R(!1)}}},P=()=>{d(null),u?.()},W=L?.status==="stale";return g.jsxs("div",{className:`component${W?" stale":""}`,children:[g.jsxs("div",{className:"component-head",children:[g.jsx("span",{className:"comp-label",children:"component"}),L&&g.jsx("span",{className:`status-badge ${L.status}`,children:L.status}),L&&L.receivedAt>0&&g.jsxs("span",{className:"muted",children:["rev ",L.revision," ·"," ",W&&L.staleSince?`last known ${new Date(L.receivedAt).toLocaleTimeString()}, stale since ${new Date(L.staleSince).toLocaleTimeString()}`:`updated ${new Date(L.receivedAt).toLocaleTimeString()}`]}),g.jsxs("span",{className:"muted",children:[a.subscribers," observer",a.subscribers===1?"":"s"]}),!f&&g.jsx("button",{className:"toggle",onClick:()=>{K()},disabled:b,children:b?"observing…":"observe"}),f&&g.jsx("button",{className:"toggle on",onClick:P,children:"stop"})]}),m&&g.jsx("p",{className:"component-error",children:m}),!f&&!m&&g.jsx("p",{className:"muted",children:"Cached props and state, read without a call. Observe to subscribe."}),f&&L&&L.receivedAt>0&&g.jsxs("div",{className:"component-body",children:[g.jsxs("div",{className:"value-table",children:[g.jsx("h4",{children:"props"}),Object.entries(L.props).map(([z,X])=>g.jsx(sm,{name:z,value:X},z)),Object.keys(L.props).length===0&&g.jsx("p",{className:"muted",children:"empty"})]}),g.jsxs("div",{className:"value-table",children:[g.jsx("h4",{children:"state"}),Object.entries(L.state).map(([z,X])=>g.jsx(sm,{name:z,value:X},z)),Object.keys(L.state).length===0&&g.jsx("p",{className:"muted",children:"empty"})]})]})]})},am=(r,n)=>r.peer===n?r.instance:`${r.peer}/${r.instance}`,Lw=({owner:r,home:n,peers:a,onSelectPeer:l})=>r.peer!==n&&a.includes(r.peer)?g.jsxs("button",{className:"owner-chip link",onClick:()=>l(r.peer),title:`owned by ${r.peer}/${r.instance} - select that peer`,children:["⤳ ",am(r,n)]}):g.jsxs("span",{className:"owner-chip",title:"logical owner",children:["⤳ ",am(r,n)]}),Jm=({namespace:r,childrenOf:n,home:a,peers:l,onSelectPeer:u})=>g.jsxs("li",{children:[g.jsxs("span",{className:"node",children:[g.jsx("span",{className:"mono",children:r.name}),r.topology?.label&&g.jsx("span",{className:"node-label",children:r.topology.label}),r.topology?.owner&&g.jsx(Lw,{owner:r.topology.owner,home:a,peers:l,onSelectPeer:u})]}),n(r.name).length>0&&g.jsx("ul",{children:n(r.name).map(f=>g.jsx(Jm,{namespace:f,childrenOf:n,home:a,peers:l,onSelectPeer:u},f.name))})]}),Hw=({description:r,peers:n,onSelectPeer:a})=>{const l=r.name,u=r.namespaces.filter(b=>b.topology);if(!r.host&&u.length===0)return null;const f=new Set,d=b=>f.has(b)?[]:(f.add(b),u.filter(R=>R.topology.parent?.instance===b&&R.topology.parent?.peer===l)),m=u.filter(b=>b.topology.parent===null||b.topology.parent.instance==="$host"),y=r.host?.place?.join(" / ")??l;return g.jsxs("div",{className:"structure",children:[g.jsxs("div",{className:"structure-head",children:[g.jsx("span",{className:"comp-label",children:"structure"}),g.jsx("span",{className:"mono",children:y}),r.host?.label&&g.jsx("span",{className:"node-label",children:r.host.label}),r.host?.parent&&g.jsxs("span",{className:"muted",children:["attached under"," ",n.includes(r.host.parent.peer)?g.jsx("button",{className:"owner-chip link",onClick:()=>a(r.host.parent.peer),children:r.host.parent.peer}):g.jsx("span",{className:"mono",children:r.host.parent.peer})]}),r.host&&g.jsxs("span",{className:"muted",title:"which topology guarantees this host actually offers",children:[r.host.capabilities.durability," · cycles ",r.host.capabilities.cycleGuarantee]})]}),m.length===0&&g.jsx("p",{className:"muted",children:"Nothing declares a place on this host yet."}),m.length>0&&g.jsx("ul",{className:"tree",children:m.map(b=>g.jsx(Jm,{namespace:b,childrenOf:d,home:l,peers:n,onSelectPeer:a},b.name))})]})},Fm=()=>new URL(".",document.baseURI),$w="console.json",Yw=async()=>{const r=await fetch(new URL($w,Fm()));if(!r.ok)throw new Error(`the console did not say who it is (${r.status})`);return(await r.json()).name},Vw=()=>`${Fm().pathname}socket.io`,ps=(r,n)=>r?.kind==="ref"?ps(n?.[r.name],n):r,sn=r=>{if(!r)return"unknown";switch(r.kind){case"literal":return JSON.stringify(r.value);case"array":return`${sn(r.items)}[]`;case"tuple":return`[${r.items.map(sn).join(", ")}]`;case"union":return r.options.map(sn).join(" | ");case"ref":return r.name;case"object":return`{ ${Object.entries(r.fields).map(([n,a])=>`${n}${a.optional?"?":""}: ${sn(a.type)}`).join(", ")} }`;case"record":return`{ [key: string]: ${sn(r.values)} }`;case"number":return r.min!==void 0||r.max!==void 0?`number(${r.min??""}..${r.max??""})`:"number";default:return r.kind}},sr=r=>r?.kind==="any"||r?.kind==="union"&&r.options.some(n=>n.kind==="literal"&&n.value===null),xi=r=>{if(r?.kind!=="union")return r;const n=r.options.filter(a=>!(a.kind==="literal"&&a.value===null));return n.length===1?n[0]:{...r,options:n}},lr=r=>{if(r?.kind!=="union")return;const n=r.options.filter(a=>a.kind==="literal").map(a=>a.value);return n.length===r.options.length&&n.length>0?n:void 0},Wm=r=>{const n=r.replace(/[\s:]/g,"");if(n.length%2)throw new Error("expected an even number of hex digits");if(n&&!/^[0-9a-fA-F]+$/.test(n))throw new Error("expected hex digits");return Uint8Array.from(n.match(/../g)?.map(a=>parseInt(a,16))??[])},Xw=r=>r.options.find(n=>!(n.kind==="literal"&&n.value===null))??r.options[0],ar=(r,n,a=0)=>{const l=ps(xi(r),n);if(!l||a>4)return null;switch(l.kind){case"number":return l.min??0;case"string":case"bytes":return"";case"boolean":return!1;case"date":return new Date;case"literal":return l.value;case"array":return[];case"record":return{};case"tuple":return l.items.map(u=>ar(u,n,a+1));case"union":return ar(Xw(l),n,a+1);case"object":return Object.fromEntries(Object.entries(l.fields).filter(([,u])=>!u.optional).map(([u,f])=>[u,ar(f.type,n,a+1)]));default:return null}},us=(r,n,a,l=0)=>{const u=ps(n,a);if(!u||r===null||r===void 0||l>8)return r;switch(u.kind){case"date":return typeof r=="string"||typeof r=="number"?new Date(r):r;case"bytes":return typeof r=="string"?Wm(r):r;case"array":return Array.isArray(r)?r.map(f=>us(f,u.items,a,l+1)):r;case"tuple":return Array.isArray(r)?r.map((f,d)=>us(f,u.items[d],a,l+1)):r;case"object":return typeof r!="object"||Array.isArray(r)?r:Object.fromEntries(Object.entries(r).map(([f,d])=>[f,us(d,u.fields[f]?.type,a,l+1)]));case"record":return typeof r!="object"||Array.isArray(r)?r:Object.fromEntries(Object.entries(r).map(([f,d])=>[f,us(d,u.values,a,l+1)]));case"union":{const f=u.options.filter(d=>!(d.kind==="literal"&&d.value===null));return f.length===1?us(r,f[0],a,l+1):r}default:return r}},Gw=(r,n,a)=>{const l=ps(xi(n),a),u=r.trim();switch(l?.kind){case"number":{if(u==="")throw new Error("expected a number");const f=Number(u);if(Number.isNaN(f))throw new Error(`${u} is not a number`);return f}case"boolean":return u==="true";case"string":return r;case"date":{const f=new Date(u);if(Number.isNaN(f.getTime()))throw new Error("expected a date");return f}case"bytes":return Wm(u);case"literal":return l.value;default:{if(lr(l)){const d=lr(l).find(m=>String(m)===u);if(d!==void 0)return d}if(u==="")return;let f;try{f=JSON.parse(u)}catch{throw new Error("expected JSON")}return us(f,xi(n),a)}}},Qw=(r,n)=>{const a=ps(xi(r),n),l=lr(a);if(l)return String(l[0]);switch(a?.kind){case"number":return String(a.min??0);case"boolean":return"false";case"date":return new Date().toISOString().slice(0,16);case"array":return"[]";case"record":return"{}";case"tuple":case"object":return JSON.stringify(ar(a,n),null,2);default:return""}},Kw=({name:r,type:n,types:a,state:l,onChange:u})=>{const f=sr(n),d=ps(xi(n),a),m=lr(d),y=w=>u({...l,text:w}),b=f&&!l.include,R=()=>{if(m)return g.jsx("select",{className:"control",value:l.text,disabled:b,onChange:w=>y(w.target.value),children:m.map(w=>g.jsx("option",{value:String(w),children:String(w)},String(w)))});switch(d?.kind){case"boolean":return g.jsxs("label",{className:"checkbox",children:[g.jsx("input",{type:"checkbox",checked:l.text==="true",disabled:b,onChange:w=>y(String(w.target.checked))}),g.jsx("span",{children:l.text==="true"?"true":"false"})]});case"number":return g.jsx("input",{className:"control",type:"number",value:l.text,disabled:b,min:d.min,max:d.max,step:d.integer?1:"any",onChange:w=>y(w.target.value)});case"date":return g.jsx("input",{className:"control",type:"datetime-local",value:l.text,disabled:b,onChange:w=>y(w.target.value)});case"string":return g.jsx("input",{className:"control",type:"text",value:l.text,disabled:b,onChange:w=>y(w.target.value)});case"bytes":return g.jsx("input",{className:"control mono",type:"text",placeholder:"hex, e.g. 01 ff 2a",value:l.text,disabled:b,onChange:w=>y(w.target.value)});default:return g.jsx("textarea",{className:"control mono",rows:Math.min(12,Math.max(2,l.text.split(`
2058
- `).length)),placeholder:"JSON",value:l.text,disabled:b,onChange:w=>y(w.target.value)})}};return g.jsxs("div",{className:`field${b?" off":""}`,children:[g.jsxs("div",{className:"field-label",children:[f&&g.jsx("input",{type:"checkbox",className:"include",checked:l.include,title:"send this argument",onChange:w=>u({...l,include:w.target.checked})}),g.jsxs("span",{className:"name",children:[r,f?"?":""]}),g.jsx("span",{className:"type",children:sn(xi(n))})]}),R()]})},lm=20,Zw=(r,n,a,l,u)=>{const f=[...u.broker?["--broker",u.broker]:[],...u.hub?["--hub",u.hub]:[],...u.prefix?["--prefix",u.prefix]:[]],d=m=>{const y=typeof m=="string"?m:JSON.stringify(m);return/^[A-Za-z0-9._@/:+-]+$/.test(y??"")?y:`'${String(y).replace(/'/g,"'\\''")}'`};return["msgrpc","call",r,`${n}.${a}`,...l.map(d),...f].join(" ")},Im=(r,n)=>`msgrpc.presets.${r}.${n}`,Jw=(r,n)=>{try{const a=window.localStorage.getItem(Im(r,n));return a?JSON.parse(a):[]}catch{return[]}},rm=(r,n,a)=>{try{window.localStorage.setItem(Im(r,n),JSON.stringify(a))}catch{}},Fw=r=>{if(!r.length)return 0;const n=[...r].sort((a,l)=>a-l);return n[Math.floor(n.length/2)]},Ww=({peer:r,namespace:n,method:a,types:l,service:u,network:f})=>{const d=a.params??[],m=a.paramNames??d.map((V,k)=>`argument ${k}`),[y,b]=Z.useState(!1),[R,w]=Z.useState(()=>d.map(V=>({text:Qw(V,l),include:!sr(V)}))),[j,L]=Z.useState(!1),[K,P]=Z.useState(!1),[W,z]=Z.useState(null),[X,J]=Z.useState([]),[N,C]=Z.useState(!1),[H,B]=Z.useState(()=>Jw(n,a.name)),Q=`${a.name}(${a.params?d.map((V,k)=>`${m[k]}${sr(V)?"?":""}: ${sn(xi(V))}`).join(", "):"…"})${a.returns?`: ${sn(a.returns)}`:""}`,ne=()=>{const V=d.map((k,$)=>R[$].include?Gw(R[$].text,k,l):void 0);for(;V.length&&V[V.length-1]===void 0&&sr(d[V.length-1]);)V.pop();return V},se=async(V=1)=>{let k;try{k=ne()}catch(re){z({ok:!1,text:re.message});return}L(!0),z(null);const $=[];let F=null;try{for(let re=0;re<V;re++){const pe=await u.call(r,n,a.name,k);if($.push(pe.ms),F=pe.error?{ok:!1,text:`${pe.code?pe.code+": ":""}${pe.error}`}:{ok:!0,text:`${JSON.stringify(pe.result,null,2)??"undefined"}
2057
+ `));uu.length;const Sw=r=>{const n=new Uint32Array(r);return crypto.getRandomValues(n),[...n].map(a=>a%uu.length)},xw=(r=3)=>Sw(r).map(n=>uu[n]).join("-"),Ew=(r,n=3)=>`${r}-${xw(n)}`,em=128;class kw{local;peer;caller;chains=new Map;constructor(n,a,l,u){this.local=n,this.peer=a,this.caller=l,n.on("contextChanged",()=>{for(const f of this.chains.values())f.localChanged()}),u.on(_e.disconnected,()=>{for(const f of this.chains.values())f.markStale()});for(const f of[_e.peerGone,_e.peerDisplaced])u.on(f,d=>{for(const m of this.chains.values())m.peerLost(String(d))});u.on(_e.connected,()=>{for(const f of this.chains.values())f.reconnect()})}store(n,a){let l=this.chains.get(n);return l||this.chains.set(n,l=new Tw(this,n,()=>this.chains.delete(n))),l.storeFor(a)}require(n,a){const l=this.store(n,a).getSnapshot();if(l.status==="invalid")throw new Error(`context: ${a.id} at ${n} is invalid (${l.invalidReason}) - topology-dependent decisions fail closed`);if(l.status==="missing")throw new Error(`context: nothing provides ${a.id} on ${n}'s ${a.axis} chain`);if(l.status==="stale"&&(a.stalePolicy??"allow")==="reject")throw new Error(`context: ${a.id} at ${n} is stale, and this token rejects stale answers`);if(l.status!=="live"&&l.status!=="stale")throw new Error(`context: ${a.id} at ${n} is still ${l.status}`);const u=l.entry??l.entries?.[0];if(!u)throw new Error(`context: nothing provides ${a.id} on ${n}'s ${a.axis} chain`);return u.value}capture(n,a){return m0({peer:this.peer,instance:n},a.map(l=>{const u=this.store(n,l).getSnapshot(),f=u.entry??u.entries?.[0];return{token:l,...f&&(u.status==="live"||u.status==="stale")?{entry:{tokenId:l.id,schemaVersion:l.schemaVersion,axis:l.axis,provider:f.provider,providerVersion:f.providerVersion,mountEpoch:u.mountEpoch,value:f.value}}:{}}}))}}class Tw{resolver;node;release;tokens=new Map;hops={physical:[],logical:[]};localSnapshot;retired=new Set;cycles={};mountKeys={};mountEpochs={};reasons={};constructor(n,a,l){this.resolver=n,this.node=a,this.release=l}storeFor(n){let a=this.tokens.get(n.id);a||(a={token:n,view:{tokenId:n.id,axis:n.axis,status:"initializing",mountEpoch:"",resolvedAt:0,transitionReason:"initial-load"},listeners:new Set,users:0},this.tokens.set(n.id,a),this.localChanged()),a.users++;const l=a;return{getSnapshot:()=>l.view,subscribe:u=>(l.listeners.add(u),()=>l.listeners.delete(u)),close:()=>{if(l.users--,!(l.users>0)&&(l.view={...l.view,status:"closed"},this.notify(l),this.tokens.delete(l.token.id),this.tokens.size===0)){for(const u of["physical","logical"])this.retireFrom(u,0);this.release()}}}}localChanged(){this.localSnapshot=this.resolver.local.snapshotFor(this.node,[...this.tokens.keys()],0,!1),this.rebuild("physical"),this.rebuild("logical");for(const n of["physical","logical"])for(const a of this.hops[n])a.retired||(a.peer===this.resolver.peer||a.tokenKey!==this.tokensFor(n).join(","))&&this.open(a);this.recompute()}markStale(){for(const n of["physical","logical"])for(const a of this.hops[n])a.stale=!0;this.recompute()}peerLost(n){for(const a of["physical","logical"])for(const l of this.hops[a])l.peer===n&&(l.stale=!0);this.recompute()}reconnect(){for(const n of["physical","logical"])for(const a of this.hops[n])a.stale&&!a.retired&&(this.reasons[n]="reconnect",this.open(a))}rebuild(n){const a=this.hops[n];this.cycles[n]=void 0;let l=[...this.localSnapshot?.walked[n]??[]],u=this.localSnapshot?.continues[n],f=0;for(;u;){const d=u,m=l.findIndex(z=>Cp(z,d));if(m!==-1){this.cycles[n]=l.slice(m),this.retireFrom(n,f);return}const g=a[f];if(g&&g.peer===u.peer&&g.node===u.instance){g.snapshot&&(l=[...l,...g.snapshot.walked[n]]),u=g.snapshot?.continues[n],f++;continue}this.retireFrom(n,f);const y={peer:u.peer,node:u.instance,axis:n,subscriptionId:et(),stale:!1,retired:!1};a[f]=y,this.open(y),u=void 0,f++}this.retireFrom(n,f)}retireFrom(n,a){const l=this.hops[n];for(const u of l.splice(a)){u.retired=!0,this.retired.add(u.subscriptionId),u.detach?.();const f=this.resolver.caller.proxy(Ea,u.peer);Promise.resolve(f.unsubscribe(u.subscriptionId)).catch(()=>{})}}tokensFor(n){return[...this.tokens.values()].filter(a=>a.token.axis===n).map(a=>a.token.id)}async open(n){if(n.tokenKey=this.tokensFor(n.axis).join(","),n.peer===this.resolver.peer){this.accept(n,this.resolver.local.snapshotFor(n.node,this.tokensFor(n.axis),0,!1));return}const a=this.resolver.caller.eventEmitter;if(!n.detach){const l=Pl(n.peer,Ea,_m),u=f=>{const d=f;d.subscriptionId!==n.subscriptionId||n.retired||n.snapshot&&d.snapshot.seq<=n.snapshot.seq||this.accept(n,d.snapshot)};a.on(l,u),n.detach=()=>{a.removeListener(l,u)}}try{const u=await this.resolver.caller.proxy(Ea,n.peer).subscribe(n.subscriptionId,n.node,this.tokensFor(n.axis));if(n.retired)return;n.stale=!1,this.accept(n,u)}catch{n.retired||(n.stale=!0,this.recompute(),setTimeout(()=>{!n.retired&&n.stale&&this.open(n)},2e3).unref?.())}}accept(n,a){const l=!n.snapshot||!Cp(n.snapshot.continues[n.axis]??null,a.continues[n.axis]??null);n.snapshot=a,n.stale=!1,l&&this.rebuild(n.axis),this.recompute()}recompute(){for(const n of this.tokens.values()){const a=n.token.axis,l=this.hops[a],u=[...this.localSnapshot?[this.localSnapshot]:[],...l.flatMap(N=>N.snapshot?[N.snapshot]:[])],f=u.map(N=>N.chainKey[a]).join(" ")+" "+l.map(N=>N.subscriptionId).join(" ");let d=!1;this.mountKeys[a]!==f&&(this.mountKeys[a]!==void 0&&this.reasons[a]!=="reconnect"&&(this.reasons[a]=a==="logical"?"owner-remount":"parent-remount"),this.mountKeys[a]=f,this.mountEpochs[a]=et(),d=!0);const m=this.mountEpochs[a]??"",g=this.reasons[a]??"initial-load",y=u.flatMap(N=>N.trouble.filter(M=>M.axis===a)),z=l.some(N=>!N.snapshot&&!N.retired),w=l.some(N=>N.stale&&!N.retired),j=u.flatMap(N=>N.walked[a]),L=this.cycles[a],K=u.flatMap(N=>(N.tokens.find(M=>M.tokenId===n.token.id)?.entries??[]).filter(M=>M.axis===a).map(M=>({value:M.value,provider:M.node,providerVersion:M.provider}))),F=!z&&!w,ee=d&&(n.view.entry||n.view.entries)?{previous:n.view.entry??n.view.entries}:n.view.previous?{previous:n.view.previous}:{};let R;const Z={tokenId:n.token.id,axis:a,mountEpoch:m,resolvedAt:Date.now(),transitionReason:g,...ee};if(y.length||L||j.length>em){const N=y[0];R={...Z,status:"invalid",invalidReason:L?"cycle":j.length>em?"depth-exceeded":N.status==="cycle"?"cycle":N.status,...L?{invalidPath:L}:N?.path?{invalidPath:N.path}:{}}}else if(z)R={...Z,status:"initializing"};else if(K.length===0)R={...Z,status:w?"stale":"missing",...w?{staleSince:n.view.staleSince??Date.now()}:{}};else{const N=n.token.resolution??"nearest";R={...Z,status:w?"stale":"live",...w?{staleSince:n.view.staleSince??Date.now()}:{},...N==="nearest"?{entry:K[0]}:{entries:K}}}R.status==="stale"&&!R.entry&&!R.entries&&(n.view.entry||n.view.entries)&&(R={...R,...n.view.entry?{entry:n.view.entry}:{},...n.view.entries?{entries:n.view.entries}:{}}),F&&R.status==="live"&&(this.reasons[a]=void 0),JSON.stringify({...n.view,resolvedAt:0})!==JSON.stringify({...R,resolvedAt:0})&&(n.view=R,this.notify(n))}}notify(n){for(const a of[...n.listeners])try{a()}catch{}}}const _w=JSON.parse('{"RpcTopologyRecord":{"kind":"object","fields":{"ref":{"type":{"kind":"ref","name":"RpcRef"}},"parent":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"owner":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"parentEpoch":{"type":{"kind":"string"}},"ownerEpoch":{"type":{"kind":"string"}},"version":{"type":{"kind":"ref","name":"RpcTopologyVersion"}},"label":{"type":{"kind":"string"},"optional":true}}},"RpcRef":{"kind":"object","fields":{"peer":{"type":{"kind":"string"}},"instance":{"type":{"kind":"string"}}}},"RpcTopologyVersion":{"kind":"object","fields":{"epoch":{"type":{"kind":"string"}},"revision":{"type":{"kind":"number"}}}},"RpcTopologyCapabilities":{"kind":"object","fields":{"authorityScope":{"type":{"kind":"literal","value":"host"}},"cycleGuarantee":{"type":{"kind":"literal","value":"detected"}},"reverseIndex":{"type":{"kind":"literal","value":"eventual"}},"deletion":{"type":{"kind":"literal","value":"tombstone"}},"durability":{"type":{"kind":"union","options":[{"kind":"literal","value":"volatile"},{"kind":"literal","value":"durable"}]}}}},"RpcTopologyPatch":{"kind":"object","fields":{"parent":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"owner":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"label":{"type":{"kind":"string"},"optional":true}}},"RpcTopologyMutation":{"kind":"object","fields":{"expectedVersion":{"type":{"kind":"ref","name":"RpcTopologyVersion"}},"reason":{"type":{"kind":"string"},"optional":true}}},"ServerDescription":{"kind":"object","fields":{"name":{"type":{"kind":"string"}},"version":{"type":{"kind":"string"},"optional":true},"validating":{"type":{"kind":"boolean"}},"namespaces":{"type":{"kind":"array","items":{"kind":"ref","name":"DescribedNamespace"}}},"host":{"type":{"kind":"object","fields":{"root":{"type":{"kind":"ref","name":"RpcRef"}},"parent":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"owner":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"place":{"type":{"kind":"array","items":{"kind":"string"}},"optional":true},"label":{"type":{"kind":"string"},"optional":true},"capabilities":{"type":{"kind":"ref","name":"RpcTopologyCapabilities"}}}},"optional":true},"types":{"type":{"kind":"record","values":{"kind":"ref","name":"TypeNode"}},"optional":true}}},"DescribedNamespace":{"kind":"object","fields":{"name":{"type":{"kind":"string"}},"version":{"type":{"kind":"string"},"optional":true},"className":{"type":{"kind":"string"},"optional":true},"created":{"type":{"kind":"boolean"}},"emitter":{"type":{"kind":"boolean"}},"serialised":{"type":{"kind":"boolean"},"optional":true},"component":{"type":{"kind":"ref","name":"DescribedComponent"},"optional":true},"topology":{"type":{"kind":"ref","name":"DescribedTopology"},"optional":true},"capabilities":{"type":{"kind":"array","items":{"kind":"string"}},"optional":true},"methods":{"type":{"kind":"array","items":{"kind":"ref","name":"DescribedMethod"}}},"events":{"type":{"kind":"array","items":{"kind":"ref","name":"DescribedEvent"}}}}},"DescribedComponent":{"kind":"object","fields":{"props":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"state":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"subscribers":{"type":{"kind":"number"}}}},"TypeNode":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"FieldNode":{"kind":"object","fields":{"type":{"type":{"kind":"ref","name":"TypeNode"}},"optional":{"type":{"kind":"boolean"},"optional":true}}},"DescribedTopology":{"kind":"object","fields":{"parent":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"owner":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"parentEpoch":{"type":{"kind":"string"}},"ownerEpoch":{"type":{"kind":"string"}},"label":{"type":{"kind":"string"},"optional":true}}},"DescribedMethod":{"kind":"object","fields":{"name":{"type":{"kind":"string"}},"params":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}},"optional":true},"paramNames":{"type":{"kind":"array","items":{"kind":"string"}},"optional":true},"rest":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"returns":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"semantics":{"type":{"kind":"union","options":[{"kind":"literal","value":"query"},{"kind":"literal","value":"idempotent-command"},{"kind":"literal","value":"non-repeatable-command"}]},"optional":true},"effect":{"type":{"kind":"union","options":[{"kind":"literal","value":"observe"},{"kind":"literal","value":"operate"},{"kind":"literal","value":"program"},{"kind":"literal","value":"security-admin"}]},"optional":true},"requiresAuthority":{"type":{"kind":"boolean"},"optional":true}}},"DescribedEvent":{"kind":"object","fields":{"name":{"type":{"kind":"string"}},"params":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}},"optional":true},"subscribers":{"type":{"kind":"number"}}}}}'),Aw={msgrpc:{methods:{topology:{params:[],returns:{kind:"object",fields:{records:{type:{kind:"array",items:{kind:"ref",name:"RpcTopologyRecord"}}},place:{type:{kind:"array",items:{kind:"string"}},optional:!0},capabilities:{type:{kind:"ref",name:"RpcTopologyCapabilities"}}}},semantics:"query"},updateTopology:{params:[{kind:"string"},{kind:"ref",name:"RpcTopologyPatch"},{kind:"ref",name:"RpcTopologyMutation"}],paramNames:["instance","patch","mutation"],returns:{kind:"ref",name:"RpcTopologyRecord"},semantics:"idempotent-command"},eventCursor:{params:[{kind:"string"},{kind:"string"}],paramNames:["namespace","event"],returns:{kind:"object",fields:{epoch:{type:{kind:"string"}},seq:{type:{kind:"union",options:[{kind:"null"},{kind:"number"}]},optional:!0},since:{type:{kind:"number"},optional:!0}}},semantics:"query"},describe:{params:[],returns:{kind:"ref",name:"ServerDescription"}}}}},Nw={types:_w,namespaces:Aw};var tm=function(r,n,a){for(var l=arguments.length>2,u=0;u<n.length;u++)a=l?n[u].call(r,a):n[u].call(r);return l?a:void 0},ba=function(r,n,a,l,u,f){function d(R){if(R!==void 0&&typeof R!="function")throw new TypeError("Function expected");return R}for(var m=l.kind,g=m==="getter"?"get":m==="setter"?"set":"value",y=!n&&r?l.static?r:r.prototype:null,z=n||(y?Object.getOwnPropertyDescriptor(y,l.name):{}),w,j=!1,L=a.length-1;L>=0;L--){var K={};for(var F in l)K[F]=F==="access"?{}:l[F];for(var F in l.access)K.access[F]=l.access[F];K.addInitializer=function(R){if(j)throw new TypeError("Cannot add initializers after decoration has completed");f.push(d(R||null))};var ee=(0,a[L])(m==="accessor"?{get:z.get,set:z.set}:z[g],K);if(m==="accessor"){if(ee===void 0)continue;if(ee===null||typeof ee!="object")throw new TypeError("Object expected");(w=d(ee.get))&&(z.get=w),(w=d(ee.set))&&(z.set=w),(w=d(ee.init))&&u.unshift(w)}else(w=d(ee))&&(m==="field"?u.unshift(w):z[g]=w)}y&&Object.defineProperty(y,l.name,z),j=!0};const Fm="msgrpc.",nn=r=>{switch(r.kind){case"ref":return{...r,name:Fm+r.name};case"array":return{...r,items:nn(r.items)};case"record":return{...r,values:nn(r.values)};case"tuple":return{...r,items:r.items.map(nn)};case"union":return{...r,options:r.options.map(nn)};case"object":return{...r,fields:Object.fromEntries(Object.entries(r.fields).map(([n,a])=>[n,{...a,type:nn(a.type)}]))};default:return r}},Ow=r=>({...r,params:r.params.map(nn),...r.rest?{rest:nn(r.rest)}:{},...r.returns?{returns:nn(r.returns)}:{}}),wa=Nw,nm={namespace:{...wa.namespaces.msgrpc,methods:Object.fromEntries(Object.entries(wa.namespaces.msgrpc.methods).map(([r,n])=>[r,Ow(n)])),...wa.namespaces.msgrpc.events?{events:Object.fromEntries(Object.entries(wa.namespaces.msgrpc.events).map(([r,n])=>[r,{params:n.params.map(nn)}]))}:{}},types:Object.fromEntries(Object.entries(wa.types??{}).map(([r,n])=>[Fm+r,nn(n)]))},jw=r=>r?.namespaces.msgrpc?r:{schema:E0,...r,types:{...r?.types,...nm.types},namespaces:{...r?.namespaces,msgrpc:nm.namespace}};let Rw=(()=>{var y;let r=[Em("msgrpc")],n,a=[],l,u=[],f,d,m,g;return y=class{handler=tm(this,u);constructor(w){this.handler=w}async topology(){const w=this.handler.hostTopology;if(w)return{records:w.all(),...w.place?{place:w.place}:{},capabilities:w.capabilities()}}async updateTopology(w,j,L){const K=this.handler.hostTopology;if(!K)throw new Error("this host keeps no topology records");if(!this.handler.allowTopologyMutation)throw new Error("this host does not accept remote topology mutation - it is enabled with topology.allowRemoteMutation, and gated by authorize() like any call");return w===dt?K.updateHost(j,L):K.update(w,j,L)}async eventCursor(w,j){this.handler.eventSequenceOf(w,j)===void 0&&this.handler.trackEvent(w,j);const K=this.handler.eventSequenceOf(w,j);return{epoch:this.handler.epoch,seq:K??null,...K!==void 0?{since:this.handler.eventTrackedSince(w,j)}:{}}}async describe(){const w=this.handler.manageRpc,j=this.handler.schema,L=new Set(w.createdInstances.keys()),K=Object.entries(w.exposedNameSpaceInstances).map(([R,Z])=>{const X=j?.namespaces[R],M=[...w.findNameSpaceMethodMap(R)?.keys()??[]].sort().map(oe=>{const je=X?.methods[oe],Ge=this.handler.semanticsOf({path:R,method:oe});return{name:oe,...je?{params:je.params,paramNames:je.paramNames,rest:je.rest,returns:je.returns}:{},...Ge?{semantics:Ge}:{},effect:this.handler.effectOf({path:R,method:oe}),...w.exposedAuthority[R]?.has(oe)?{requiresAuthority:!0}:{}}}),H=new Set(Object.keys(X?.events??{}));for(const oe of this.handler.eventProxies.values())oe.instanceName===R&&H.add(oe.event);H.delete(_n);const B=[...H].sort().map(oe=>({name:oe,...X?.events?.[oe]?{params:X.events[oe].params}:{},subscribers:[...this.handler.eventProxies.values()].filter(je=>je.instanceName===R&&je.event===oe).length})),Q=this.handler.hostTopology?.get(R),ne=Q?{parent:Q.parent,owner:Q.owner,parentEpoch:Q.parentEpoch,ownerEpoch:Q.ownerEpoch,...Q.label!==void 0?{label:Q.label}:{}}:void 0,se=w.exposedExecution[R],xe=Z instanceof hs?{...X?.component?{props:X.component.props,state:X.component.state}:{},subscribers:[...this.handler.eventProxies.values()].filter(oe=>oe.instanceName===R&&oe.event===_n).length}:void 0;return{name:R,...X?.version?{version:X.version}:{},...se&&se!=="parallel"?{serialised:!0}:{},className:Z.constructor?.name,created:L.has(R),emitter:Z instanceof Il,...xe?{component:xe}:{},...ne?{topology:ne}:{},...X?.capabilities?{capabilities:X.capabilities}:{},methods:M,events:B}}),F=this.handler.hostTopology,ee=F?.get(dt);return{name:this.handler.name,...j?.version?{version:j.version}:{},validating:!!j&&this.handler.validation!=="off",namespaces:K.sort((R,Z)=>R.name.localeCompare(Z.name)),...F&&ee?{host:{root:ee.ref,parent:ee.parent,...ee.owner?{owner:ee.owner}:{},...F.place?{place:F.place}:{},...ee.label!==void 0?{label:ee.label}:{},capabilities:F.capabilities()}}:{},...j?.types?{types:j.types}:{}}}},l=y,(()=>{const w=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;f=[fs({semantics:"query"})],d=[fs({semantics:"idempotent-command"})],m=[fs({semantics:"query"})],g=[fs],ba(y,null,f,{kind:"method",name:"topology",static:!1,private:!1,access:{has:j=>"topology"in j,get:j=>j.topology},metadata:w},null,u),ba(y,null,d,{kind:"method",name:"updateTopology",static:!1,private:!1,access:{has:j=>"updateTopology"in j,get:j=>j.updateTopology},metadata:w},null,u),ba(y,null,m,{kind:"method",name:"eventCursor",static:!1,private:!1,access:{has:j=>"eventCursor"in j,get:j=>j.eventCursor},metadata:w},null,u),ba(y,null,g,{kind:"method",name:"describe",static:!1,private:!1,access:{has:j=>"describe"in j,get:j=>j.describe},metadata:w},null,u),ba(null,n={value:l},r,{kind:"class",name:l.name,metadata:w},null,a),l=n.value,w&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:w}),tm(l,a)})(),l})();const zw=r=>{let n=0xcbf29ce484222325n;for(let a=0;a<r.length;a++)n^=BigInt(r.charCodeAt(a)),n=n*0x100000001b3n&0xffffffffffffffffn;return n.toString(16).padStart(16,"0")},im=r=>{const n=r.manageRpc,a=r.schema,l=Object.keys(n.exposedNameSpaceInstances).sort().map(u=>{const f=a?.namespaces[u],d=[...n.findNameSpaceMethodMap(u)?.keys()??[]].sort().map(m=>{const g=r.semanticsOf({path:u,method:m});return{name:m,...f?.methods[m]?{signature:f.methods[m]}:{},...g?{semantics:g}:{},effect:r.effectOf({path:u,method:m}),...n.exposedAuthority[u]?.has(m)?{requiresAuthority:!0}:{}}});return{name:u,...f?.version?{version:f.version}:{},className:n.exposedNameSpaceInstances[u]?.constructor?.name,methods:d,events:Object.keys(f?.events??{}).sort(),...f?.capabilities?{capabilities:[...f.capabilities].sort()}:{},...f?.component?{component:f.component}:{}}});return zw(JSON.stringify(l))};class Mw extends rr{getTarget;targets=new Map;constructor(n,a){super("",n),this.getTarget=a}async receive(n,a,l){let u;if(this.getTarget&&(u=this.getTarget(l)),u||(u=this.targetExists(l)),u||(u=super.targetExists(l)),!u)throw this.emit(_e.unroutable,{source:a,target:l,reason:"no switch target for this peer"}),new Error(`no route to '${l}': nothing here reaches that peer. If it has only just connected, its presence may not have arrived yet - await it before calling.`);await u.receive(n,a,l)}setTarget(n,a){const u=a===void 0?(d=>d.getName())(n):a;this.targets.set(u,n);let f=!1;return()=>{f||(f=!0,this.targets.delete(u))}}setTargets(n){for(const a of n)this.setTarget(a)}targetExists(n,a=0){let l;return this.targets.forEach(u=>{!l&&!u.isTransport()&&u.targetExists(n,a+1)&&(l=u)}),l}}class Cw{rpc;caller;readyFlag=!1;switch;transports=[];peers=new bm;topology;context;contextResolver;componentChannels;componentLifecycle=new ei.EventEmitter;options={name:"*",transports:[],useMsgPack:!0,readyTimeout:3e4};constructor(n={}){this.options={...this.options,...n},this.rpc=new M0(this.options.name),this.caller=new q0(this.options.name,[],this.options.callTimeout??Nm),this.switch=new Mw([this.rpc,this.caller]);for(const a of[this.rpc,this.caller,this.switch])a.usePeerRegistry(this.peers);this.rpc.authorize=this.options.authorize,this.rpc.requireIdentity=this.options.requireAuthenticatedPeers??!!this.options.authenticate,this.rpc.resolveIdentity=a=>{for(const l of this.transports){const u=l.getIdentity(a);if(u)return u}},this.rpc.schema=this.options.schema,this.rpc.validation=this.options.validation??(this.options.schema?"described":"off"),this.rpc.validateResults=this.options.validateResults??!1,this.options.validateComponentSnapshots&&(this.rpc.manageRpc.componentContractFor=a=>{const l=this.rpc.schema?.namespaces[a]?.component;return l?{component:l,types:this.rpc.schema?.types}:void 0}),this.rpc.unknownVersion=this.options.unknownVersion??"allow",this.rpc.idempotency=this.options.idempotency,this.rpc.manageRpc.requireExplicitExposure=this.options.requireExplicitExposure??!1,this.options.exposeManagement&&this.rpc.manageRpc.exposeManagement(),this.options.exposeIntrospection&&(this.rpc.manageRpc.exposeClassInstance(new Rw(this.rpc)),this.rpc.schema=jw(this.rpc.schema)),this.topology=new f0(this.options.name,this.options.topology),this.rpc.hostTopology=this.topology,this.rpc.allowTopologyMutation=this.options.topology?.allowRemoteMutation??!1,this.context=new p0(this.topology),this.topology.onCommitted=()=>this.context.changed(),this.rpc.hostContext=this.context,this.context.push=(a,l)=>{this.rpc.sendEvent(a,_m,[l],Ea).catch(()=>{})},this.contextResolver=new kw(this.context,this.options.name,this.caller,this.componentLifecycle),this.starting=this.topology.init().then(()=>this.buildTransports()).then(()=>{this.readyFlag=!0},a=>{this.initError=a}),this.init().catch(a=>{this.initError=a,this.emitSafely("initError",a)})}initError;starting=Promise.resolve();configuredTransports(){return this.options.transports}async buildTransport(n){if(n instanceof rr)return n;if(n.connect){const a=n;return new Pp(this.options.name,a.connect,[],{...a.path?{path:a.path}:{},...a.credentials?{auth:a.credentials}:{},...a.ca?{ca:a.ca}:{}},!0,a.allowInsecureTls)}}async buildTransports(){const n=yw(this.options.useMsgPack);for(const a of this.configuredTransports()){const l=await this.buildTransport(a);if(!l)throw new Error(`RpcServer '${this.options.name}': no transport can be built from ${JSON.stringify(a)}`);l.codec=n,this.options.relay!==void 0&&"relay"in l&&(l.relay=this.options.relay),this.attach(l)}}announceShape(){if(!this.rpc)return;this.rpc.trackDeclaredEvents();const n=im(this.rpc);for(const a of this.transports)a.announceShape?.(n)}attach(n){this.transports.push(n),n.announceShape?.(im(this.rpc)),n.usePeerRegistry(this.peers),n.pipe(this.rpc),n.pipe(this.caller),this.switch?.setTarget(n),n.on(_e.peerGone,a=>this.safely("peerGone",a,()=>{this.rpc.removePeer(a),this.context.dropSubscriber(a),this.peers.delete(a),this.relayPresence(n,a,"offline");for(const l of this.transports){const u=l;u.stopWatchingFor&&u.stopWatchingFor(a).catch(f=>this.emitSafely("presenceError",{peer:a,error:f}))}})),n.on(_e.peerOnline,a=>this.safely("peerOnline",a,()=>this.relayPresence(n,a,"online"))),n.on(_e.connected,()=>{this.caller.resubscribe().catch(a=>this.emitSafely("resubscribeError",a))});for(const a of[_e.disconnected,_e.peerGone,_e.peerDisplaced,_e.connected])n.on(a,l=>this.componentLifecycle.emit(a,l))}relayPresence(n,a,l){for(const u of this.transports){if(u===n)continue;const f=u;f.announcePeer&&f.announcePeer(a,l)}this.advertiseReachability()}advertiseReachability(){for(const n of this.transports)n instanceof Pp&&n.advertise(this.peers.names().filter(a=>a!==this.options.name&&this.peers.get(a)!==n))}emitSafely(n,a){for(const l of this.transports)l.emit(n,a)}safely(n,a,l){try{l()}catch(u){this.emitSafely("presenceError",{what:n,peer:a,error:u})}}async proxy(n,a){return await this.ready(),this.caller.proxy(n,a??"*")}async component(n,a){await this.ready(),this.componentChannels??=new H0(this.caller,this.componentLifecycle);const l=await this.componentChannels.open(n,a);return jm(l,l.inner)}provideContext(n,a,l){return this.context.provide(n,a,l)}contextOf(n,a){return this.contextResolver.store(n,a)}requireContext(n,a){return this.contextResolver.require(n,a)}captureContext(n,a){return this.contextResolver.capture(n,a)}async close(){await this.starting.catch(()=>{}),this.componentChannels?.closeAll(),this.caller.failPendingCalls("server closed"),this.caller.subscriptions.clear(),await this.caller.close(),await Promise.all(this.transports.map(n=>n.close())),this.transports=[],this.peers.clear()}exposeClassInstance(n,a,l){this.rpc.manageRpc.exposeClassInstance(n,a,l),this.announceShape()}exposeClass(n,a){this.rpc.manageRpc.exposeClass(n,a),this.announceShape()}exposeObject(n,a){this.rpc.manageRpc.exposeObject(n,a),this.announceShape()}expose(n,a){this.rpc.manageRpc.expose(n,a),this.announceShape()}async createRpcInstance(n,a,...l){const u=await this.rpc.manageRpc.createRpcInstance(n,a,...l);return this.announceShape(),u}addTarget(n,a){this.switch?.setTarget(a)}async init(){}async ready(){await this.starting;const n=()=>this.transports.filter(l=>!l.readyFlag).length==0,a=Date.now()+this.options.readyTimeout;for(;!n()||!this.readyFlag;){const l=this.transports.find(u=>u.startupError!==void 0);if(l&&(this.initError=l.startupError),this.initError!==void 0)throw new Error(`RpcServer '${this.options.name}': could not start: ${this.initError instanceof Error?this.initError.message:String(this.initError)}`,{cause:this.initError});if(this.options.readyTimeout>0&&Date.now()>a){const u=this.transports.filter(f=>!f.readyFlag).map(f=>f.getName());throw new Error(`RpcServer '${this.options.name}': transports not ready within ${this.options.readyTimeout} ms: ${u.join(", ")}`)}await new Promise(u=>setTimeout(u,10))}}async awaitPeer(n,a=5e3){const l=Date.now()+a;for(;;){if(this.peers.get(n))return!0;if(Date.now()>=l)return!1;await new Promise(u=>setTimeout(u,20))}}async peersSettled(n=2e3){return await this.ready(),await ww(this.transports,n),this.peers.names().filter(a=>a!==this.options.name)}}const sm="msgrpc-page-name",Uw=()=>{const r=new URLSearchParams(window.location.search).get("name")?.trim();if(r)return r;let n=sessionStorage.getItem(sm);return n||sessionStorage.setItem(sm,n=Ew("page")),n},Dw=({peer:r,messages:n,onSend:a})=>{const[l,u]=J.useState(""),[f,d]=J.useState(null),[m,g]=J.useState(!1),y=J.useRef(null);J.useEffect(()=>{y.current?.scrollIntoView({block:"end"})},[n.length]);const z=async()=>{!l.trim()||!r||(g(!0),d(await a(l.trim()).finally(()=>g(!1))??null),u(""))};return v.jsxs("div",{className:"chat",children:[v.jsxs("header",{children:[v.jsx("h1",{children:"Chat"}),v.jsx("span",{className:"muted mono",children:r??"—"})]}),!r&&v.jsx("p",{className:"muted",children:"Select a peer to talk to it. Any peer running this console can answer."}),r&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"chat-log",children:[n.length===0&&v.jsxs("p",{className:"muted",children:["Nothing yet. Say something to ",r,"."]}),n.map((w,j)=>v.jsx("div",{className:w.mine?"said mine":"said",children:v.jsx("span",{className:"text",children:w.text})},`${w.at}-${j}`)),v.jsx("div",{ref:y})]}),v.jsxs("div",{className:"chat-send",children:[v.jsx("input",{className:"control",value:l,placeholder:`say something to ${r}`,onChange:w=>u(w.target.value),onKeyDown:w=>{w.key==="Enter"&&z()}}),v.jsx("button",{className:"primary",disabled:m||!l.trim(),onClick:()=>{z()},children:m?"…":"Send"})]}),f&&v.jsx("p",{className:"muted bad",children:f})]})]})};var dm,pm,mm,os;mm=[Em("chat")],pm=[fs({injectInvocation:!0})],dm=[fs];class cs{constructor(n){Tc(os,5,this);vp(this,"onMessage");this.onMessage=n}async say(n,a,l){const u=l.context.identity?.name??l.context.source;return this.onMessage(String(u),String(a)),"delivered"}async who(){return{app:"source-rpc console",kind:"browser page"}}}os=yp(null),Vl(os,1,"say",pm,cs),Vl(os,1,"who",dm,cs),cs=Vl(os,0,"ChatService",mm,cs),Tc(os,1,cs);const Bw=1,qw={chat:{methods:{say:{params:[{kind:"string"},{kind:"string"}],paramNames:["from","text"],returns:{kind:"string"}},who:{params:[],returns:{kind:"object",fields:{app:{type:{kind:"string"}},kind:{type:{kind:"string"}}}}}}}},Lw={schema:Bw,namespaces:qw},Hw=r=>{if(typeof r!="object"||r===null||Array.isArray(r))return null;const n=r;return!("value"in n)||!("quality"in n)&&!("unit"in n)&&!("forced"in n)?null:{value:n.value,quality:typeof n.quality=="string"?n.quality:void 0,unit:typeof n.unit=="string"?n.unit:void 0,forced:n.forced===!0}},am=r=>typeof r=="string"?r:JSON.stringify(r)??"undefined",lm=({name:r,value:n})=>{const a=Hw(n);return v.jsxs("div",{className:"value-row",children:[v.jsx("span",{className:"value-name mono",children:r}),a?v.jsxs("span",{className:"value mono",children:[am(a.value),a.unit&&v.jsxs("span",{className:"unit",children:[" ",a.unit]})]}):v.jsx("span",{className:"value mono",children:am(n)}),a?.forced&&v.jsx("span",{className:"quality forced",children:"forced"}),a?.quality&&v.jsx("span",{className:`quality q-${a.quality}`,children:a.quality})]})},$w=({peer:r,namespace:n,component:a,server:l,onSubscribed:u})=>{const[f,d]=J.useState(null),[m,g]=J.useState(null),[y,z]=J.useState(!1),w=J.useCallback(R=>f?f.subscribe(R):()=>{},[f]),j=J.useCallback(()=>f?.getSnapshot()??null,[f]),L=J.useSyncExternalStore(w,j);J.useEffect(()=>()=>{f?.close()},[f]);const K=async()=>{const R=l.current;if(R){z(!0),g(null);try{const Z=await R.component(n,r);d(Z[Om]),u?.()}catch(Z){g(Z.message??String(Z))}finally{z(!1)}}},F=()=>{d(null),u?.()},ee=L?.status==="stale";return v.jsxs("div",{className:`component${ee?" stale":""}`,children:[v.jsxs("div",{className:"component-head",children:[v.jsx("span",{className:"comp-label",children:"component"}),L&&v.jsx("span",{className:`status-badge ${L.status}`,children:L.status}),L&&L.receivedAt>0&&v.jsxs("span",{className:"muted",children:["rev ",L.revision," ·"," ",ee&&L.staleSince?`last known ${new Date(L.receivedAt).toLocaleTimeString()}, stale since ${new Date(L.staleSince).toLocaleTimeString()}`:`updated ${new Date(L.receivedAt).toLocaleTimeString()}`]}),v.jsxs("span",{className:"muted",children:[a.subscribers," observer",a.subscribers===1?"":"s"]}),!f&&v.jsx("button",{className:"toggle",onClick:()=>{K()},disabled:y,children:y?"observing…":"observe"}),f&&v.jsx("button",{className:"toggle on",onClick:F,children:"stop"})]}),m&&v.jsx("p",{className:"component-error",children:m}),!f&&!m&&v.jsx("p",{className:"muted",children:"Cached props and state, read without a call. Observe to subscribe."}),f&&L&&L.receivedAt>0&&v.jsxs("div",{className:"component-body",children:[v.jsxs("div",{className:"value-table",children:[v.jsx("h4",{children:"props"}),Object.entries(L.props).map(([R,Z])=>v.jsx(lm,{name:R,value:Z},R)),Object.keys(L.props).length===0&&v.jsx("p",{className:"muted",children:"empty"})]}),v.jsxs("div",{className:"value-table",children:[v.jsx("h4",{children:"state"}),Object.entries(L.state).map(([R,Z])=>v.jsx(lm,{name:R,value:Z},R)),Object.keys(L.state).length===0&&v.jsx("p",{className:"muted",children:"empty"})]})]})]})},rm=(r,n)=>r.peer===n?r.instance:`${r.peer}/${r.instance}`,Yw=({owner:r,home:n,peers:a,onSelectPeer:l})=>r.peer!==n&&a.includes(r.peer)?v.jsxs("button",{className:"owner-chip link",onClick:()=>l(r.peer),title:`owned by ${r.peer}/${r.instance} - select that peer`,children:["⤳ ",rm(r,n)]}):v.jsxs("span",{className:"owner-chip",title:"logical owner",children:["⤳ ",rm(r,n)]}),Wm=({namespace:r,childrenOf:n,home:a,peers:l,onSelectPeer:u})=>v.jsxs("li",{children:[v.jsxs("span",{className:"node",children:[v.jsx("span",{className:"mono",children:r.name}),r.topology?.label&&v.jsx("span",{className:"node-label",children:r.topology.label}),r.topology?.owner&&v.jsx(Yw,{owner:r.topology.owner,home:a,peers:l,onSelectPeer:u})]}),n(r.name).length>0&&v.jsx("ul",{children:n(r.name).map(f=>v.jsx(Wm,{namespace:f,childrenOf:n,home:a,peers:l,onSelectPeer:u},f.name))})]}),Vw=({description:r,peers:n,onSelectPeer:a})=>{const l=r.name,u=r.namespaces.filter(y=>y.topology);if(!r.host&&u.length===0)return null;const f=new Set,d=y=>f.has(y)?[]:(f.add(y),u.filter(z=>z.topology.parent?.instance===y&&z.topology.parent?.peer===l)),m=u.filter(y=>y.topology.parent===null||y.topology.parent.instance==="$host"),g=r.host?.place?.join(" / ")??l;return v.jsxs("div",{className:"structure",children:[v.jsxs("div",{className:"structure-head",children:[v.jsx("span",{className:"comp-label",children:"structure"}),v.jsx("span",{className:"mono",children:g}),r.host?.label&&v.jsx("span",{className:"node-label",children:r.host.label}),r.host?.parent&&v.jsxs("span",{className:"muted",children:["attached under"," ",n.includes(r.host.parent.peer)?v.jsx("button",{className:"owner-chip link",onClick:()=>a(r.host.parent.peer),children:r.host.parent.peer}):v.jsx("span",{className:"mono",children:r.host.parent.peer})]}),r.host&&v.jsxs("span",{className:"muted",title:"which topology guarantees this host actually offers",children:[r.host.capabilities.durability," · cycles ",r.host.capabilities.cycleGuarantee]})]}),m.length===0&&v.jsx("p",{className:"muted",children:"Nothing declares a place on this host yet."}),m.length>0&&v.jsx("ul",{className:"tree",children:m.map(y=>v.jsx(Wm,{namespace:y,childrenOf:d,home:l,peers:n,onSelectPeer:a},y.name))})]})},Im=()=>new URL(".",document.baseURI),Xw="console.json",Gw=async()=>{const r=await fetch(new URL(Xw,Im()));if(!r.ok)throw new Error(`the console did not say who it is (${r.status})`);return(await r.json()).name},Qw=()=>`${Im().pathname}socket.io`,ps=(r,n)=>r?.kind==="ref"?ps(n?.[r.name],n):r,sn=r=>{if(!r)return"unknown";switch(r.kind){case"literal":return JSON.stringify(r.value);case"array":return`${sn(r.items)}[]`;case"tuple":return`[${r.items.map(sn).join(", ")}]`;case"union":return r.options.map(sn).join(" | ");case"ref":return r.name;case"object":return`{ ${Object.entries(r.fields).map(([n,a])=>`${n}${a.optional?"?":""}: ${sn(a.type)}`).join(", ")} }`;case"record":return`{ [key: string]: ${sn(r.values)} }`;case"number":return r.min!==void 0||r.max!==void 0?`number(${r.min??""}..${r.max??""})`:"number";default:return r.kind}},sr=r=>r?.kind==="any"||r?.kind==="union"&&r.options.some(n=>n.kind==="literal"&&n.value===null),xi=r=>{if(r?.kind!=="union")return r;const n=r.options.filter(a=>!(a.kind==="literal"&&a.value===null));return n.length===1?n[0]:{...r,options:n}},lr=r=>{if(r?.kind!=="union")return;const n=r.options.filter(a=>a.kind==="literal").map(a=>a.value);return n.length===r.options.length&&n.length>0?n:void 0},Pm=r=>{const n=r.replace(/[\s:]/g,"");if(n.length%2)throw new Error("expected an even number of hex digits");if(n&&!/^[0-9a-fA-F]+$/.test(n))throw new Error("expected hex digits");return Uint8Array.from(n.match(/../g)?.map(a=>parseInt(a,16))??[])},Kw=r=>r.options.find(n=>!(n.kind==="literal"&&n.value===null))??r.options[0],ar=(r,n,a=0)=>{const l=ps(xi(r),n);if(!l||a>4)return null;switch(l.kind){case"number":return l.min??0;case"string":case"bytes":return"";case"boolean":return!1;case"date":return new Date;case"literal":return l.value;case"array":return[];case"record":return{};case"tuple":return l.items.map(u=>ar(u,n,a+1));case"union":return ar(Kw(l),n,a+1);case"object":return Object.fromEntries(Object.entries(l.fields).filter(([,u])=>!u.optional).map(([u,f])=>[u,ar(f.type,n,a+1)]));default:return null}},us=(r,n,a,l=0)=>{const u=ps(n,a);if(!u||r===null||r===void 0||l>8)return r;switch(u.kind){case"date":return typeof r=="string"||typeof r=="number"?new Date(r):r;case"bytes":return typeof r=="string"?Pm(r):r;case"array":return Array.isArray(r)?r.map(f=>us(f,u.items,a,l+1)):r;case"tuple":return Array.isArray(r)?r.map((f,d)=>us(f,u.items[d],a,l+1)):r;case"object":return typeof r!="object"||Array.isArray(r)?r:Object.fromEntries(Object.entries(r).map(([f,d])=>[f,us(d,u.fields[f]?.type,a,l+1)]));case"record":return typeof r!="object"||Array.isArray(r)?r:Object.fromEntries(Object.entries(r).map(([f,d])=>[f,us(d,u.values,a,l+1)]));case"union":{const f=u.options.filter(d=>!(d.kind==="literal"&&d.value===null));return f.length===1?us(r,f[0],a,l+1):r}default:return r}},Zw=(r,n,a)=>{const l=ps(xi(n),a),u=r.trim();switch(l?.kind){case"number":{if(u==="")throw new Error("expected a number");const f=Number(u);if(Number.isNaN(f))throw new Error(`${u} is not a number`);return f}case"boolean":return u==="true";case"string":return r;case"date":{const f=new Date(u);if(Number.isNaN(f.getTime()))throw new Error("expected a date");return f}case"bytes":return Pm(u);case"literal":return l.value;default:{if(lr(l)){const d=lr(l).find(m=>String(m)===u);if(d!==void 0)return d}if(u==="")return;let f;try{f=JSON.parse(u)}catch{throw new Error("expected JSON")}return us(f,xi(n),a)}}},Jw=(r,n)=>{const a=ps(xi(r),n),l=lr(a);if(l)return String(l[0]);switch(a?.kind){case"number":return String(a.min??0);case"boolean":return"false";case"date":return new Date().toISOString().slice(0,16);case"array":return"[]";case"record":return"{}";case"tuple":case"object":return JSON.stringify(ar(a,n),null,2);default:return""}},Fw=({name:r,type:n,types:a,state:l,onChange:u})=>{const f=sr(n),d=ps(xi(n),a),m=lr(d),g=w=>u({...l,text:w}),y=f&&!l.include,z=()=>{if(m)return v.jsx("select",{className:"control",value:l.text,disabled:y,onChange:w=>g(w.target.value),children:m.map(w=>v.jsx("option",{value:String(w),children:String(w)},String(w)))});switch(d?.kind){case"boolean":return v.jsxs("label",{className:"checkbox",children:[v.jsx("input",{type:"checkbox",checked:l.text==="true",disabled:y,onChange:w=>g(String(w.target.checked))}),v.jsx("span",{children:l.text==="true"?"true":"false"})]});case"number":return v.jsx("input",{className:"control",type:"number",value:l.text,disabled:y,min:d.min,max:d.max,step:d.integer?1:"any",onChange:w=>g(w.target.value)});case"date":return v.jsx("input",{className:"control",type:"datetime-local",value:l.text,disabled:y,onChange:w=>g(w.target.value)});case"string":return v.jsx("input",{className:"control",type:"text",value:l.text,disabled:y,onChange:w=>g(w.target.value)});case"bytes":return v.jsx("input",{className:"control mono",type:"text",placeholder:"hex, e.g. 01 ff 2a",value:l.text,disabled:y,onChange:w=>g(w.target.value)});default:return v.jsx("textarea",{className:"control mono",rows:Math.min(12,Math.max(2,l.text.split(`
2058
+ `).length)),placeholder:"JSON",value:l.text,disabled:y,onChange:w=>g(w.target.value)})}};return v.jsxs("div",{className:`field${y?" off":""}`,children:[v.jsxs("div",{className:"field-label",children:[f&&v.jsx("input",{type:"checkbox",className:"include",checked:l.include,title:"send this argument",onChange:w=>u({...l,include:w.target.checked})}),v.jsxs("span",{className:"name",children:[r,f?"?":""]}),v.jsx("span",{className:"type",children:sn(xi(n))})]}),z()]})},om=20,Ww=(r,n,a,l,u)=>{const f=[...u.broker?["--broker",u.broker]:[],...u.hub?["--hub",u.hub]:[],...u.prefix?["--prefix",u.prefix]:[]],d=m=>{const g=typeof m=="string"?m:JSON.stringify(m);return/^[A-Za-z0-9._@/:+-]+$/.test(g??"")?g:`'${String(g).replace(/'/g,"'\\''")}'`};return["msgrpc","call",r,`${n}.${a}`,...l.map(d),...f].join(" ")},ey=(r,n)=>`msgrpc.presets.${r}.${n}`,Iw=(r,n)=>{try{const a=window.localStorage.getItem(ey(r,n));return a?JSON.parse(a):[]}catch{return[]}},cm=(r,n,a)=>{try{window.localStorage.setItem(ey(r,n),JSON.stringify(a))}catch{}},Pw=r=>{if(!r.length)return 0;const n=[...r].sort((a,l)=>a-l);return n[Math.floor(n.length/2)]},eS=({peer:r,namespace:n,method:a,types:l,service:u,network:f})=>{const d=a.params??[],m=a.paramNames??d.map((V,k)=>`argument ${k}`),[g,y]=J.useState(!1),[z,w]=J.useState(()=>d.map(V=>({text:Jw(V,l),include:!sr(V)}))),[j,L]=J.useState(!1),[K,F]=J.useState(!1),[ee,R]=J.useState(null),[Z,X]=J.useState([]),[N,M]=J.useState(!1),[H,B]=J.useState(()=>Iw(n,a.name)),Q=`${a.name}(${a.params?d.map((V,k)=>`${m[k]}${sr(V)?"?":""}: ${sn(xi(V))}`).join(", "):"…"})${a.returns?`: ${sn(a.returns)}`:""}`,ne=()=>{const V=d.map((k,$)=>z[$].include?Zw(z[$].text,k,l):void 0);for(;V.length&&V[V.length-1]===void 0&&sr(d[V.length-1]);)V.pop();return V},se=async(V=1)=>{let k;try{k=ne()}catch(re){R({ok:!1,text:re.message});return}L(!0),R(null);const $=[];let W=null;try{for(let re=0;re<V;re++){const pe=await u.call(r,n,a.name,k);if($.push(pe.ms),W=pe.error?{ok:!1,text:`${pe.code?pe.code+": ":""}${pe.error}`}:{ok:!0,text:`${JSON.stringify(pe.result,null,2)??"undefined"}
2059
2059
 
2060
- // ${pe.ms} ms`},pe.error)break}z(F)}catch(re){z({ok:!1,text:re.message})}finally{J(re=>[...re,...$].slice(-200)),L(!1)}},xe=()=>{const V=R.map(F=>F.include?F.text:"—").join(", ")||"no arguments",$=[{label:V,texts:R.map(F=>F.text),include:R.map(F=>F.include)},...H.filter(F=>F.label!==V)].slice(0,8);B($),rm(n,a.name,$)},ue=V=>w(R.map((k,$)=>({text:V.texts[$]??k.text,include:V.include[$]??k.include}))),je=V=>{const k=H.filter($=>$.label!==V);B(k),rm(n,a.name,k)},Ge=()=>{let V;try{V=ne()}catch{V=[]}navigator.clipboard?.writeText(Zw(r,n,a.name,V,f)).then(()=>{C(!0),setTimeout(()=>C(!1),1500)})};return g.jsxs("div",{className:`method${y?" open":""}`,children:[g.jsxs("button",{className:"method-head",onClick:()=>b(!y),"aria-expanded":y,children:[g.jsx("span",{className:"chevron",children:y?"▾":"▸"}),g.jsx("code",{children:Q}),a.semantics==="query"&&g.jsx("span",{className:"sem query",children:"query"}),a.semantics==="idempotent-command"&&g.jsx("span",{className:"sem idempotent",children:"idempotent"}),a.semantics==="non-repeatable-command"&&g.jsx("span",{className:"sem once",children:"won't repeat"})]}),y&&g.jsxs("div",{className:"method-body",children:[d.length===0&&g.jsx("p",{className:"muted",children:"No arguments."}),d.map((V,k)=>g.jsx(Kw,{name:m[k],type:V,types:l,state:R[k],onChange:$=>w(R.map((F,re)=>re===k?$:F))},k)),d.length>0&&(H.length>0||R.length>0)&&g.jsxs("div",{className:"presets",children:[H.map(V=>g.jsxs("span",{className:"preset",children:[g.jsx("button",{className:"toggle",onClick:()=>ue(V),title:"put these arguments back in the form",children:V.label}),g.jsx("button",{className:"forget",onClick:()=>je(V.label),title:"forget this one",children:"×"})]},V.label)),g.jsx("button",{className:"toggle",onClick:xe,title:"keep these arguments for next time",children:"save"})]}),a.rest&&g.jsxs("p",{className:"muted",children:["Takes further ",sn(a.rest)," arguments, which this form does not send."]}),!a.params&&g.jsx("p",{className:"muted",children:"No schema describes this method, so its arguments cannot be shown as fields."}),!a.semantics&&g.jsx("p",{className:"muted",children:"The contract does not say what calling this does. Treat it as a command until someone who knows says otherwise."}),K&&g.jsxs("div",{className:"confirm",children:[g.jsxs("span",{children:["Not free to repeat — sent once, it has happened. Send ",g.jsx("code",{children:a.name}),"?"]}),g.jsx("button",{className:"primary",onClick:()=>{P(!1),se()},children:"send once"}),g.jsx("button",{className:"toggle",onClick:()=>P(!1),children:"cancel"})]}),g.jsxs("div",{className:"actions",children:[g.jsx("button",{className:"primary",onClick:()=>a.semantics==="non-repeatable-command"?P(!0):void se(),disabled:j||K,children:j?"calling…":"Call"}),(a.semantics==="query"||a.semantics==="idempotent-command")&&g.jsxs("button",{className:"toggle",onClick:()=>{se(lm)},disabled:j,title:"call it repeatedly and keep the timings",children:["×",lm]}),g.jsx("button",{className:"toggle",onClick:Ge,title:"the command line that makes the same call",children:N?"copied":"copy as CLI"}),X.length>0&&g.jsxs("span",{className:"muted timing",children:[X.length," call",X.length===1?"":"s"," · p50 ",Fw(X)," ms · last ",X[X.length-1]," ms"]})]}),W&&g.jsx("pre",{className:W.ok?"result":"result bad",children:W.text})]})]})},Iw=["POST","SUCCESS","ERROR","EVENT"],Pm=500,Pw=r=>r==="POST"?"→":r==="EVENT"?"⇒":"←",om=r=>`${r.namespace??"?"}.${r.method??r.event??"?"}`,cm=r=>{if(r.params!==void 0)return JSON.stringify(r.params);if(r.result!==void 0)return JSON.stringify(r.result)},eS=({service:r,selected:n,frames:a,onClear:l,paused:u,onPaused:f,hidden:d})=>{const[m,y]=Z.useState(null),[b,R]=Z.useState([]),[w,j]=Z.useState(!1),[L,K]=Z.useState(null),[P,W]=Z.useState(!0),[z,X]=Z.useState(!1),[J,N]=Z.useState([]),[C,H]=Z.useState(""),[B,Q]=Z.useState(new Set),ne=Z.useRef(null);Z.useEffect(()=>{ne.current=m},[m]),Z.useEffect(()=>()=>{ne.current&&r?.untap(ne.current)},[r]);const se=async()=>{if(r){j(!0),K(null);try{const V={payloads:P,...z&&n?{peer:n}:{},...J.length?{kinds:J}:{}},k=await r.tap(V);y(k.token),R(k.sources),k.sources.length||K("Nothing here can watch traffic: no broker exposing a bus, and no MQTT link.")}catch(V){K(V.message)}finally{j(!1)}}},xe=async()=>{if(!(!r||!m)){j(!0);try{await r.untap(m)}catch{}finally{y(null),R([]),j(!1)}}},ue=V=>N(k=>k.includes(V)?k.filter($=>$!==V):[...k,V]),je=C.trim().toLowerCase(),Ge=a.filter(V=>!je||`${V.source} ${V.target} ${om(V)} ${cm(V)??""}`.toLowerCase().includes(je)).slice(0,Pm);return g.jsxs("div",{className:d?"traffic hidden":"traffic",children:[g.jsxs("header",{children:[g.jsx("h1",{children:"Traffic"}),g.jsxs("div",{className:"traffic-actions",children:[a.length>0&&g.jsx("button",{className:"toggle",onClick:l,children:"clear"}),m&&g.jsx("button",{className:u?"toggle on":"toggle",onClick:()=>f(!u),children:u?"paused":"pause"}),g.jsx("button",{className:m?"toggle on":"toggle",onClick:()=>{m?xe():se()},disabled:w||!r,children:w?"…":m?"tapping":"tap"})]})]}),!m&&g.jsxs("div",{className:"tap-setup",children:[g.jsxs("label",{className:"checkbox",children:[g.jsx("input",{type:"checkbox",checked:P,onChange:V=>W(V.target.checked)}),"arguments and results"]}),g.jsxs("label",{className:"checkbox",children:[g.jsx("input",{type:"checkbox",checked:z,disabled:!n,onChange:V=>X(V.target.checked)}),"only ",n??"the selected peer"]}),g.jsxs("div",{className:"kinds",children:[Iw.map(V=>g.jsx("button",{className:J.includes(V)?"toggle on":"toggle",onClick:()=>ue(V),children:V},V)),J.length===0&&g.jsx("span",{className:"muted",children:"all kinds"})]}),g.jsx("p",{className:"muted",children:"Watches what other peers say to each other. It costs something at the other end, so it is off until asked and stops when this tab does."})]}),L&&g.jsx("p",{className:"bad",children:L}),m&&b.length>0&&g.jsxs("p",{className:"muted tap-where",children:["watching via ",g.jsx("span",{className:"mono",children:b.join(", ")}),u&&" · paused"]}),m&&g.jsx("input",{className:"control",placeholder:"filter by peer, method or payload",value:C,onChange:V=>H(V.target.value)}),m&&a.length===0&&g.jsx("p",{className:"muted",children:"Nothing has crossed yet."}),Ge.map((V,k)=>{const $=cm(V),F=B.has(V.at*1e3+k),re=V.at*1e3+k;return g.jsxs("div",{className:`frame ${V.kind.toLowerCase()}`,children:[g.jsxs("div",{className:"frame-head",children:[g.jsx("time",{children:new Date(V.at).toLocaleTimeString()}),g.jsx("span",{className:"arrow",children:Pw(V.kind)}),g.jsxs("span",{className:"mono peers",children:[V.source," → ",V.target]}),g.jsx("code",{children:om(V)}),V.ms!==void 0&&g.jsxs("span",{className:"muted ms",children:[V.ms," ms"]}),V.code&&g.jsx("span",{className:"code",children:V.code})]}),V.error&&g.jsx("p",{className:"frame-error",children:V.error}),$&&g.jsx("pre",{className:F?"frame-payload open":"frame-payload",onClick:()=>Q(pe=>{const S=new Set(pe);return S.has(re)?S.delete(re):S.add(re),S}),children:$})]},`${V.at}-${k}`)})]})},tS=Pm,nS={rejected:"refused before it reached the RPC layer",unroutable:"nowhere to deliver it",peerDisplaced:"two peers are answering to one name",transportError:"the link itself failed"},iS=({problems:r,onClear:n})=>g.jsxs("div",{className:"problems",children:[g.jsxs("header",{children:[g.jsx("h1",{children:"Problems"}),r.length>0&&g.jsx("button",{className:"toggle",onClick:n,children:"clear"})]}),r.length===0&&g.jsx("p",{className:"muted",children:"Nothing refused, undeliverable or displaced. This is where a call that never comes back says why."}),r.map((a,l)=>g.jsxs("div",{className:`problem ${a.kind}`,children:[g.jsxs("div",{className:"problem-head",children:[g.jsx("time",{children:new Date(a.at).toLocaleTimeString()}),g.jsx("span",{className:"kind",children:a.kind}),g.jsxs("span",{className:"muted link",children:["on ",a.link]})]}),g.jsxs("div",{className:"problem-body",children:[a.peer&&g.jsxs("code",{className:"mono",children:[a.peer,a.target?` → ${a.target}`:""]}),g.jsx("p",{children:a.reason??nS[a.kind]??""})]})]},`${a.at}-${l}`))]}),sS=3,aS=({changes:r,onClear:n})=>{const a=new Map;for(const u of r)u.state==="online"&&a.set(u.peer,(a.get(u.peer)??0)+1);const l=[...a.entries()].filter(([,u])=>u>=sS).sort((u,f)=>f[1]-u[1]);return g.jsxs("div",{className:"presence",children:[g.jsxs("header",{children:[g.jsx("h1",{children:"Presence"}),r.length>0&&g.jsx("button",{className:"toggle",onClick:n,children:"clear"})]}),l.length>0&&g.jsx("div",{className:"flapping",children:l.map(([u,f])=>g.jsxs("p",{children:[g.jsx("span",{className:"mono",children:u})," has arrived ",f," times"]},u))}),r.length===0&&g.jsx("p",{className:"muted",children:"Nobody has arrived or left since this console started."}),r.map((u,f)=>g.jsxs("div",{className:`coming ${u.state}`,children:[g.jsx("time",{children:new Date(u.at).toLocaleTimeString()}),g.jsx("span",{className:"mark",children:u.state==="online"?"+":"−"}),g.jsx("span",{className:"mono",children:u.peer}),u.link&&u.link!=="this console"&&g.jsx("span",{className:"muted link",children:u.link})]},`${u.at}-${f}`))]})},um=3,lS=()=>{const[r,n]=Z.useState(null),[a,l]=Z.useState(""),[u,f]=Z.useState("connecting"),d=Z.useRef(null),m=Z.useRef(null),y=Z.useRef(null),b=Z.useRef(null),R=Z.useRef(null),w=Z.useRef(null);return Z.useEffect(()=>{let j,L=0,K=!1;const P=()=>{j?.close()};window.addEventListener("pagehide",P);const W=async()=>{try{const z=await Yw(),X=zw();l(X),j=new Rw({name:X,transports:[{connect:window.location.origin,path:Vw()}],readyTimeout:1e4,schema:Dw,exposeIntrospection:!0}),j.exposeClassInstance(new cs((B,Q)=>y.current?.(B,Q)));const J=j.transports[0];J?.on(_e.disconnected,()=>f("reconnecting")),J?.on(_e.connected,()=>f("connected")),await j.ready();for(const B of j.transports)B.on(_e.disconnected,()=>f("reconnecting")),B.on(_e.connected,()=>f("connected"));w.current=j;const N=await j.proxy("console",z);await N.on("event",B=>d.current?.(B)),await N.on("peer",B=>{const Q=B;m.current?.(Q.peer,Q.state,Q)}),await N.on("frame",B=>b.current?.(B)),await N.on("problem",B=>R.current?.(B));const C=N,{callTimeout:H}=await C.peers();H&&(j.caller.callTimeout=H+5e3),n(C),f("connected")}catch(z){if(K)return;if(await j?.close().catch(()=>{}),j=void 0,++L<=um){f(`cannot reach the console, trying again (${L}/${um})`),await new Promise(X=>setTimeout(X,L*1e3)),K||await W();return}f(`cannot reach the console: ${z.message}`)}};return W(),()=>{K=!0,window.removeEventListener("pagehide",P),j?.close()}},[]),{service:r,status:u,me:a,events:d,peerChange:m,said:y,frames:b,problems:R,peer:w}},rS=(r,n)=>{const a=new Blob([r.map(f=>JSON.stringify(f)).join(`
2060
+ // ${pe.ms} ms`},pe.error)break}R(W)}catch(re){R({ok:!1,text:re.message})}finally{X(re=>[...re,...$].slice(-200)),L(!1)}},xe=()=>{const V=z.map(W=>W.include?W.text:"—").join(", ")||"no arguments",$=[{label:V,texts:z.map(W=>W.text),include:z.map(W=>W.include)},...H.filter(W=>W.label!==V)].slice(0,8);B($),cm(n,a.name,$)},oe=V=>w(z.map((k,$)=>({text:V.texts[$]??k.text,include:V.include[$]??k.include}))),je=V=>{const k=H.filter($=>$.label!==V);B(k),cm(n,a.name,k)},Ge=()=>{let V;try{V=ne()}catch{V=[]}navigator.clipboard?.writeText(Ww(r,n,a.name,V,f)).then(()=>{M(!0),setTimeout(()=>M(!1),1500)})};return v.jsxs("div",{className:`method${g?" open":""}`,children:[v.jsxs("button",{className:"method-head",onClick:()=>y(!g),"aria-expanded":g,children:[v.jsx("span",{className:"chevron",children:g?"▾":"▸"}),v.jsx("code",{children:Q}),a.semantics==="query"&&v.jsx("span",{className:"sem query",children:"query"}),a.semantics==="idempotent-command"&&v.jsx("span",{className:"sem idempotent",children:"idempotent"}),a.semantics==="non-repeatable-command"&&v.jsx("span",{className:"sem once",children:"won't repeat"})]}),g&&v.jsxs("div",{className:"method-body",children:[d.length===0&&v.jsx("p",{className:"muted",children:"No arguments."}),d.map((V,k)=>v.jsx(Fw,{name:m[k],type:V,types:l,state:z[k],onChange:$=>w(z.map((W,re)=>re===k?$:W))},k)),d.length>0&&(H.length>0||z.length>0)&&v.jsxs("div",{className:"presets",children:[H.map(V=>v.jsxs("span",{className:"preset",children:[v.jsx("button",{className:"toggle",onClick:()=>oe(V),title:"put these arguments back in the form",children:V.label}),v.jsx("button",{className:"forget",onClick:()=>je(V.label),title:"forget this one",children:"×"})]},V.label)),v.jsx("button",{className:"toggle",onClick:xe,title:"keep these arguments for next time",children:"save"})]}),a.rest&&v.jsxs("p",{className:"muted",children:["Takes further ",sn(a.rest)," arguments, which this form does not send."]}),!a.params&&v.jsx("p",{className:"muted",children:"No schema describes this method, so its arguments cannot be shown as fields."}),!a.semantics&&v.jsx("p",{className:"muted",children:"The contract does not say what calling this does. Treat it as a command until someone who knows says otherwise."}),K&&v.jsxs("div",{className:"confirm",children:[v.jsxs("span",{children:["Not free to repeat — sent once, it has happened. Send ",v.jsx("code",{children:a.name}),"?"]}),v.jsx("button",{className:"primary",onClick:()=>{F(!1),se()},children:"send once"}),v.jsx("button",{className:"toggle",onClick:()=>F(!1),children:"cancel"})]}),v.jsxs("div",{className:"actions",children:[v.jsx("button",{className:"primary",onClick:()=>a.semantics==="non-repeatable-command"?F(!0):void se(),disabled:j||K,children:j?"calling…":"Call"}),(a.semantics==="query"||a.semantics==="idempotent-command")&&v.jsxs("button",{className:"toggle",onClick:()=>{se(om)},disabled:j,title:"call it repeatedly and keep the timings",children:["×",om]}),v.jsx("button",{className:"toggle",onClick:Ge,title:"the command line that makes the same call",children:N?"copied":"copy as CLI"}),Z.length>0&&v.jsxs("span",{className:"muted timing",children:[Z.length," call",Z.length===1?"":"s"," · p50 ",Pw(Z)," ms · last ",Z[Z.length-1]," ms"]})]}),ee&&v.jsx("pre",{className:ee.ok?"result":"result bad",children:ee.text})]})]})},tS=["POST","SUCCESS","ERROR","EVENT"],ty=500,nS=r=>r==="POST"?"→":r==="EVENT"?"⇒":"←",um=r=>`${r.namespace??"?"}.${r.method??r.event??"?"}`,fm=r=>{if(r.params!==void 0)return JSON.stringify(r.params);if(r.result!==void 0)return JSON.stringify(r.result)},iS=({service:r,selected:n,frames:a,onClear:l,paused:u,onPaused:f,hidden:d})=>{const[m,g]=J.useState(null),[y,z]=J.useState([]),[w,j]=J.useState(!1),[L,K]=J.useState(null),[F,ee]=J.useState(!0),[R,Z]=J.useState(!1),[X,N]=J.useState([]),[M,H]=J.useState(""),[B,Q]=J.useState(new Set),ne=J.useRef(null);J.useEffect(()=>{ne.current=m},[m]),J.useEffect(()=>()=>{ne.current&&r?.untap(ne.current)},[r]);const se=async()=>{if(r){j(!0),K(null);try{const V={payloads:F,...R&&n?{peer:n}:{},...X.length?{kinds:X}:{}},k=await r.tap(V);g(k.token),z(k.sources),k.sources.length||K("Nothing here can watch traffic: no broker exposing a bus, and no MQTT link.")}catch(V){K(V.message)}finally{j(!1)}}},xe=async()=>{if(!(!r||!m)){j(!0);try{await r.untap(m)}catch{}finally{g(null),z([]),j(!1)}}},oe=V=>N(k=>k.includes(V)?k.filter($=>$!==V):[...k,V]),je=M.trim().toLowerCase(),Ge=a.filter(V=>!je||`${V.source} ${V.target} ${um(V)} ${fm(V)??""}`.toLowerCase().includes(je)).slice(0,ty);return v.jsxs("div",{className:d?"traffic hidden":"traffic",children:[v.jsxs("header",{children:[v.jsx("h1",{children:"Traffic"}),v.jsxs("div",{className:"traffic-actions",children:[a.length>0&&v.jsx("button",{className:"toggle",onClick:l,children:"clear"}),m&&v.jsx("button",{className:u?"toggle on":"toggle",onClick:()=>f(!u),children:u?"paused":"pause"}),v.jsx("button",{className:m?"toggle on":"toggle",onClick:()=>{m?xe():se()},disabled:w||!r,children:w?"…":m?"tapping":"tap"})]})]}),!m&&v.jsxs("div",{className:"tap-setup",children:[v.jsxs("label",{className:"checkbox",children:[v.jsx("input",{type:"checkbox",checked:F,onChange:V=>ee(V.target.checked)}),"arguments and results"]}),v.jsxs("label",{className:"checkbox",children:[v.jsx("input",{type:"checkbox",checked:R,disabled:!n,onChange:V=>Z(V.target.checked)}),"only ",n??"the selected peer"]}),v.jsxs("div",{className:"kinds",children:[tS.map(V=>v.jsx("button",{className:X.includes(V)?"toggle on":"toggle",onClick:()=>oe(V),children:V},V)),X.length===0&&v.jsx("span",{className:"muted",children:"all kinds"})]}),v.jsx("p",{className:"muted",children:"Watches what other peers say to each other. It costs something at the other end, so it is off until asked and stops when this tab does."})]}),L&&v.jsx("p",{className:"bad",children:L}),m&&y.length>0&&v.jsxs("p",{className:"muted tap-where",children:["watching via ",v.jsx("span",{className:"mono",children:y.join(", ")}),u&&" · paused"]}),m&&v.jsx("input",{className:"control",placeholder:"filter by peer, method or payload",value:M,onChange:V=>H(V.target.value)}),m&&a.length===0&&v.jsx("p",{className:"muted",children:"Nothing has crossed yet."}),Ge.map((V,k)=>{const $=fm(V),W=B.has(V.at*1e3+k),re=V.at*1e3+k;return v.jsxs("div",{className:`frame ${V.kind.toLowerCase()}`,children:[v.jsxs("div",{className:"frame-head",children:[v.jsx("time",{children:new Date(V.at).toLocaleTimeString()}),v.jsx("span",{className:"arrow",children:nS(V.kind)}),v.jsxs("span",{className:"mono peers",children:[V.source," → ",V.target]}),v.jsx("code",{children:um(V)}),V.ms!==void 0&&v.jsxs("span",{className:"muted ms",children:[V.ms," ms"]}),V.code&&v.jsx("span",{className:"code",children:V.code})]}),V.error&&v.jsx("p",{className:"frame-error",children:V.error}),$&&v.jsx("pre",{className:W?"frame-payload open":"frame-payload",onClick:()=>Q(pe=>{const S=new Set(pe);return S.has(re)?S.delete(re):S.add(re),S}),children:$})]},`${V.at}-${k}`)})]})},sS=ty,aS={rejected:"refused before it reached the RPC layer",unroutable:"nowhere to deliver it",peerDisplaced:"two peers are answering to one name",transportError:"the link itself failed"},lS=({problems:r,onClear:n})=>v.jsxs("div",{className:"problems",children:[v.jsxs("header",{children:[v.jsx("h1",{children:"Problems"}),r.length>0&&v.jsx("button",{className:"toggle",onClick:n,children:"clear"})]}),r.length===0&&v.jsx("p",{className:"muted",children:"Nothing refused, undeliverable or displaced. This is where a call that never comes back says why."}),r.map((a,l)=>v.jsxs("div",{className:`problem ${a.kind}`,children:[v.jsxs("div",{className:"problem-head",children:[v.jsx("time",{children:new Date(a.at).toLocaleTimeString()}),v.jsx("span",{className:"kind",children:a.kind}),v.jsxs("span",{className:"muted link",children:["on ",a.link]})]}),v.jsxs("div",{className:"problem-body",children:[a.peer&&v.jsxs("code",{className:"mono",children:[a.peer,a.target?` → ${a.target}`:""]}),v.jsx("p",{children:a.reason??aS[a.kind]??""})]})]},`${a.at}-${l}`))]}),rS=3,oS=({changes:r,onClear:n})=>{const a=new Map;for(const u of r)u.state==="online"&&a.set(u.peer,(a.get(u.peer)??0)+1);const l=[...a.entries()].filter(([,u])=>u>=rS).sort((u,f)=>f[1]-u[1]);return v.jsxs("div",{className:"presence",children:[v.jsxs("header",{children:[v.jsx("h1",{children:"Presence"}),r.length>0&&v.jsx("button",{className:"toggle",onClick:n,children:"clear"})]}),l.length>0&&v.jsx("div",{className:"flapping",children:l.map(([u,f])=>v.jsxs("p",{children:[v.jsx("span",{className:"mono",children:u})," has arrived ",f," times"]},u))}),r.length===0&&v.jsx("p",{className:"muted",children:"Nobody has arrived or left since this console started."}),r.map((u,f)=>v.jsxs("div",{className:`coming ${u.state}`,children:[v.jsx("time",{children:new Date(u.at).toLocaleTimeString()}),v.jsx("span",{className:"mark",children:u.state==="online"?"+":"−"}),v.jsx("span",{className:"mono",children:u.peer}),u.link&&u.link!=="this console"&&v.jsx("span",{className:"muted link",children:u.link})]},`${u.at}-${f}`))]})},hm=3,cS=()=>{const[r,n]=J.useState(null),[a,l]=J.useState(""),[u,f]=J.useState("connecting"),d=J.useRef(null),m=J.useRef(null),g=J.useRef(null),y=J.useRef(null),z=J.useRef(null),w=J.useRef(null);return J.useEffect(()=>{let j,L=0,K=!1;const F=()=>{j?.close()};window.addEventListener("pagehide",F);const ee=async()=>{try{const R=await Gw(),Z=Uw();l(Z),j=new Cw({name:Z,transports:[{connect:window.location.origin,path:Qw()}],readyTimeout:1e4,schema:Lw,exposeIntrospection:!0}),j.exposeClassInstance(new cs((B,Q)=>g.current?.(B,Q)));const X=j.transports[0];X?.on(_e.disconnected,()=>f("reconnecting")),X?.on(_e.connected,()=>f("connected")),await j.ready();for(const B of j.transports)B.on(_e.disconnected,()=>f("reconnecting")),B.on(_e.connected,()=>f("connected"));w.current=j;const N=await j.proxy("console",R);await N.on("event",B=>d.current?.(B)),await N.on("peer",B=>{const Q=B;m.current?.(Q.peer,Q.state,Q)}),await N.on("frame",B=>y.current?.(B)),await N.on("problem",B=>z.current?.(B));const M=N,{callTimeout:H}=await M.peers();H&&(j.caller.callTimeout=H+5e3),n(M),f("connected")}catch(R){if(K)return;if(await j?.close().catch(()=>{}),j=void 0,++L<=hm){f(`cannot reach the console, trying again (${L}/${hm})`),await new Promise(Z=>setTimeout(Z,L*1e3)),K||await ee();return}f(`cannot reach the console: ${R.message}`)}};return ee(),()=>{K=!0,window.removeEventListener("pagehide",F),j?.close()}},[]),{service:r,status:u,me:a,events:d,peerChange:m,said:g,frames:y,problems:z,peer:w}},uS=(r,n)=>{const a=new Blob([r.map(f=>JSON.stringify(f)).join(`
2061
2061
  `)+`
2062
- `],{type:"application/x-ndjson"}),l=URL.createObjectURL(a),u=document.createElement("a");u.href=l,u.download=n,u.click(),URL.revokeObjectURL(l)},oS=()=>{const{service:r,status:n,me:a,events:l,peerChange:u,said:f,frames:d,problems:m,peer:y}=lS(),[b,R]=Z.useState({}),[w,j]=Z.useState({}),[L,K]=Z.useState([]),[P,W]=Z.useState(new Set),[z,X]=Z.useState(null),[J,N]=Z.useState(null),[C,H]=Z.useState(new Set),[B,Q]=Z.useState([]),[ne,se]=Z.useState("events"),[xe,ue]=Z.useState([]),[je,Ge]=Z.useState(!1),[V,k]=Z.useState([]),[$,F]=Z.useState({}),[re,pe]=Z.useState({}),[S,q]=Z.useState({}),[G,ee]=Z.useState({}),[oe,he]=Z.useState([]),[Ee,it]=Z.useState(""),[Ce,ti]=Z.useState(!1),Jt=Z.useCallback(async()=>{if(!r)return;const Y=await r.peers();K(Y.peers),H(new Set(Y.watching)),F(Y.links??{}),pe(Y.network??{}),q(Y.roles??{}),ee(Y.structure??{})},[r]);Z.useEffect(()=>{a&&(document.title=a)},[a]),Z.useEffect(()=>{f.current=(Y,ae)=>{R(De=>({...De,[Y]:[...De[Y]??[],{from:Y,text:ae,at:Date.now(),mine:!1}]})),j(De=>({...De,[Y]:(De[Y]??0)+1}))}},[f]),Z.useEffect(()=>{ne!=="chat"||!z||j(Y=>Y[z]?{...Y,[z]:0}:Y)},[ne,z,b]);const ms=async Y=>{if(!y.current||!z)return"not connected";R(ae=>({...ae,[z]:[...ae[z]??[],{from:a,text:Y,at:Date.now(),mine:!0}]}));try{await(await y.current.proxy("chat",z)).say(a,Y);return}catch(ae){return`${z} did not take it: ${ae.message??String(ae)}`}};Z.useEffect(()=>{Jt(),l.current=Y=>{Ce||Q(ae=>[Y,...ae].slice(0,500))},u.current=(Y,ae,De)=>{if(ae==="reshaped"){Jt(),r&&Y===z&&r.describe(Y).then(N).catch(()=>{});return}W(me=>{const st=new Set(me);return ae==="offline"?st.add(Y):st.delete(Y),st}),he(me=>[De,...me].slice(0,200)),Jt()}},[r,Jt,l,u,Ce,z]),Z.useEffect(()=>{d.current=Y=>{je||ue(ae=>[Y,...ae].slice(0,tS))}},[d,je]),Z.useEffect(()=>{m.current=Y=>k(ae=>[Y,...ae].slice(0,200)),r&&r.problems().then(({problems:Y})=>k(Y)).catch(()=>{}),r&&r.presence().then(({changes:Y})=>he(Y)).catch(()=>{})},[r,m]);const ys=async Y=>{X(Y),N(null),r&&(N(await r.describe(Y)),await Jt())},rn=async(Y,ae)=>{if(!(!r||!z)){for(const De of ae){if(C.has(`${z}/${Y}/${De.name}`))continue;(await r.watch(z,Y,De.name)).watching&&H(st=>new Set(st).add(`${z}/${Y}/${De.name}`))}N(await r.describe(z))}},gs=async(Y,ae)=>{if(!r||!z)return;const De=`${z}/${Y}/${ae.name}`,me=C.has(De)?await r.unwatch(z,Y,ae.name):await r.watch(z,Y,ae.name);H(st=>{const Qe=new Set(st);return me.watching?Qe.add(De):Qe.delete(De),Qe}),z&&N(await r.describe(z))},ni=J&&"error"in J?J:null,Ft=J&&!("error"in J)?J:null,vs=Object.values(w).reduce((Y,ae)=>Y+ae,0);return g.jsxs("div",{className:"app",children:[g.jsxs("aside",{children:[g.jsxs("div",{className:"identity",children:[g.jsx("span",{className:"muted",children:"this page is"}),g.jsx("span",{className:"mono name",title:"the peer name this page serves and calls under",children:a||"…"})]}),g.jsxs("header",{children:[g.jsx("h1",{children:"Peers"}),g.jsx("span",{className:`status ${n==="connected"?"ok":"warn"}`,children:n})]}),L.length===0&&g.jsx("p",{className:"muted",children:"Waiting for a peer to announce itself…"}),(()=>{const Y=new Set(L),ae=L.filter(me=>{const st=G[me]?.parent;return!st||st===me||!Y.has(st)}),De=(me,st,Qe)=>g.jsxs("div",{children:[g.jsxs("button",{className:`peer${me===z?" selected":""}`,style:st>0?{paddingLeft:10+st*14}:void 0,onClick:()=>{ys(me)},children:[g.jsx("span",{className:`dot${P.has(me)?" off":""}`}),g.jsxs("span",{className:"peer-lines",children:[g.jsxs("span",{children:[me,me===a&&g.jsx("span",{className:"you",children:"you"}),w[me]>0&&g.jsx("span",{className:"count",children:w[me]}),S[me]&&g.jsx("span",{className:`role ${S[me]}`,children:S[me]==="undescribed"?"no contract":S[me]}),$[me]&&$[me]!=="this console"&&g.jsx("span",{className:"link",children:$[me]})]}),(G[me]?.place||G[me]?.label)&&g.jsxs("span",{className:"peer-place",children:[G[me]?.place?.join(" / ")??"",G[me]?.label?` ${G[me].label}`:""]})]})]}),!Qe.has(me)&&L.filter(Ei=>G[Ei]?.parent===me&&Ei!==me).map(Ei=>De(Ei,st+1,new Set([...Qe,me])))]},me);return ae.map(me=>De(me,0,new Set))})()]}),g.jsxs("main",{children:[!z&&g.jsx("p",{className:"muted",children:"Select a peer to see what it exposes."}),z&&!J&&g.jsxs("p",{className:"muted",children:["Describing ",z,"…"]}),ni&&g.jsxs("div",{className:"notice",children:[g.jsx("strong",{children:ni.code??"Error"}),g.jsx("p",{children:ni.error}),g.jsx("p",{className:"muted",children:"A server answers this only when it is started with exposeIntrospection."})]}),Ft&&g.jsxs(g.Fragment,{children:[g.jsxs("header",{className:"peer-head",children:[g.jsx("h1",{children:Ft.name}),g.jsxs("span",{className:"muted",children:[Ft.version?`contract ${Ft.version} · `:"",Ft.validating?"arguments checked":"arguments not checked"]})]}),g.jsx(Hw,{description:Ft,peers:L,onSelectPeer:Y=>{ys(Y)}}),Ft.namespaces.map(Y=>g.jsxs("section",{className:"namespace",children:[g.jsxs("h2",{children:[Y.name,Y.version&&g.jsxs("span",{className:"badge",children:["@",Y.version]}),g.jsxs("span",{className:"muted mono",children:[Y.className,Y.created?" · created at runtime":""]}),Y.capabilities?.map(ae=>g.jsx("span",{className:"capability",title:"implements this contract interface",children:ae},ae))]}),Y.component&&g.jsx(qw,{peer:z,namespace:Y.name,component:Y.component,server:y,onSubscribed:()=>{r&&z&&r.describe(z).then(N).catch(()=>{})}}),Y.methods.map(ae=>g.jsx(Ww,{peer:z,namespace:Y.name,method:ae,types:Ft.types,service:r,network:re},ae.name)),Y.events.length>0&&g.jsxs("div",{className:"events",children:[g.jsxs("h3",{children:["events",Y.events.some(ae=>!C.has(`${z}/${Y.name}/${ae.name}`))&&g.jsx("button",{className:"toggle",onClick:()=>{rn(Y.name,Y.events)},children:"watch all"})]}),Y.events.map(ae=>{const De=C.has(`${z}/${Y.name}/${ae.name}`);return g.jsxs("div",{className:"event-row",children:[g.jsxs("code",{children:[ae.name,"(",ae.params?ae.params.map(sn).join(", "):"…",")"]}),g.jsx("button",{className:De?"toggle on":"toggle",onClick:()=>{gs(Y.name,ae)},children:De?"unwatch":"watch"}),g.jsxs("span",{className:"muted",children:[ae.subscribers," subscriber",ae.subscribers===1?"":"s"]})]},ae.name)})]})]},Y.name))]})]}),g.jsxs("section",{className:"side",children:[g.jsx("nav",{className:"tabs",children:["events","traffic","problems","presence","chat"].map(Y=>g.jsxs("button",{className:ne===Y?"tab on":"tab",onClick:()=>se(Y),children:[Y,Y==="traffic"&&xe.length>0&&g.jsx("span",{className:"count",children:xe.length}),Y==="problems"&&V.length>0&&g.jsx("span",{className:"count bad",children:V.length}),Y==="chat"&&vs>0&&g.jsx("span",{className:"count",children:vs})]},Y))}),ne==="chat"&&g.jsx(Mw,{peer:z,messages:z?b[z]??[]:[],onSend:ms}),ne==="problems"&&g.jsx(iS,{problems:V,onClear:()=>k([])}),ne==="presence"&&g.jsx(aS,{changes:oe,onClear:()=>he([])}),g.jsx(eS,{service:r,selected:z,frames:xe,onClear:()=>ue([]),paused:je,onPaused:Ge,hidden:ne!=="traffic"}),ne==="events"&&g.jsxs("div",{className:"stream",children:[g.jsxs("header",{children:[g.jsx("h1",{children:"Events"}),g.jsxs("div",{className:"traffic-actions",children:[B.length>0&&g.jsx("button",{className:"toggle",onClick:()=>rS(B,"events.jsonl"),title:"save what is here as jsonl",children:"export"}),B.length>0&&g.jsx("button",{className:"toggle",onClick:()=>Q([]),children:"clear"}),g.jsx("button",{className:Ce?"toggle on":"toggle",onClick:()=>ti(!Ce),children:Ce?"paused":"pause"})]})]}),B.length>0&&g.jsx("input",{className:"control",placeholder:"filter by peer, event or payload",value:Ee,onChange:Y=>it(Y.target.value)}),B.length===0&&g.jsx("p",{className:"muted",children:"Watch an event to see it here."}),B.filter(Y=>{const ae=Ee.trim().toLowerCase();return!ae||`${Y.peer} ${Y.namespace}.${Y.event} ${JSON.stringify(Y.args)}`.toLowerCase().includes(ae)}).map((Y,ae)=>g.jsxs("div",{className:"streamed",children:[g.jsx("time",{children:new Date(Y.at).toLocaleTimeString()}),g.jsxs("code",{children:[Y.peer,"/",Y.namespace,".",Y.event]}),g.jsx("pre",{children:JSON.stringify(Y.args)})]},`${Y.at}-${ae}`))]})]})]})};Uv.createRoot(document.getElementById("root")).render(g.jsx(Z.StrictMode,{children:g.jsx(oS,{})}));
2062
+ `],{type:"application/x-ndjson"}),l=URL.createObjectURL(a),u=document.createElement("a");u.href=l,u.download=n,u.click(),URL.revokeObjectURL(l)},fS=()=>{const{service:r,status:n,me:a,events:l,peerChange:u,said:f,frames:d,problems:m,peer:g}=cS(),[y,z]=J.useState({}),[w,j]=J.useState({}),[L,K]=J.useState([]),[F,ee]=J.useState(new Set),[R,Z]=J.useState(null),[X,N]=J.useState(null),[M,H]=J.useState(new Set),[B,Q]=J.useState([]),[ne,se]=J.useState("events"),[xe,oe]=J.useState([]),[je,Ge]=J.useState(!1),[V,k]=J.useState([]),[$,W]=J.useState({}),[re,pe]=J.useState({}),[S,q]=J.useState({}),[G,P]=J.useState({}),[ce,he]=J.useState([]),[Ee,it]=J.useState(""),[Ce,ti]=J.useState(!1),Jt=J.useCallback(async()=>{if(!r)return;const Y=await r.peers();K(Y.peers),H(new Set(Y.watching)),W(Y.links??{}),pe(Y.network??{}),q(Y.roles??{}),P(Y.structure??{})},[r]);J.useEffect(()=>{a&&(document.title=a)},[a]),J.useEffect(()=>{f.current=(Y,ae)=>{z(De=>({...De,[Y]:[...De[Y]??[],{from:Y,text:ae,at:Date.now(),mine:!1}]})),j(De=>({...De,[Y]:(De[Y]??0)+1}))}},[f]),J.useEffect(()=>{ne!=="chat"||!R||j(Y=>Y[R]?{...Y,[R]:0}:Y)},[ne,R,y]);const ms=async Y=>{if(!g.current||!R)return"not connected";z(ae=>({...ae,[R]:[...ae[R]??[],{from:a,text:Y,at:Date.now(),mine:!0}]}));try{await(await g.current.proxy("chat",R)).say(a,Y);return}catch(ae){return`${R} did not take it: ${ae.message??String(ae)}`}};J.useEffect(()=>{Jt(),l.current=Y=>{Ce||Q(ae=>[Y,...ae].slice(0,500))},u.current=(Y,ae,De)=>{if(ae==="reshaped"){Jt(),r&&Y===R&&r.describe(Y).then(N).catch(()=>{});return}ee(me=>{const st=new Set(me);return ae==="offline"?st.add(Y):st.delete(Y),st}),he(me=>[De,...me].slice(0,200)),Jt()}},[r,Jt,l,u,Ce,R]),J.useEffect(()=>{d.current=Y=>{je||oe(ae=>[Y,...ae].slice(0,sS))}},[d,je]),J.useEffect(()=>{m.current=Y=>k(ae=>[Y,...ae].slice(0,200)),r&&r.problems().then(({problems:Y})=>k(Y)).catch(()=>{}),r&&r.presence().then(({changes:Y})=>he(Y)).catch(()=>{})},[r,m]);const ys=async Y=>{Z(Y),N(null),r&&(N(await r.describe(Y)),await Jt())},rn=async(Y,ae)=>{if(!(!r||!R)){for(const De of ae){if(M.has(`${R}/${Y}/${De.name}`))continue;(await r.watch(R,Y,De.name)).watching&&H(st=>new Set(st).add(`${R}/${Y}/${De.name}`))}N(await r.describe(R))}},gs=async(Y,ae)=>{if(!r||!R)return;const De=`${R}/${Y}/${ae.name}`,me=M.has(De)?await r.unwatch(R,Y,ae.name):await r.watch(R,Y,ae.name);H(st=>{const Qe=new Set(st);return me.watching?Qe.add(De):Qe.delete(De),Qe}),R&&N(await r.describe(R))},ni=X&&"error"in X?X:null,Ft=X&&!("error"in X)?X:null,vs=Object.values(w).reduce((Y,ae)=>Y+ae,0);return v.jsxs("div",{className:"app",children:[v.jsxs("aside",{children:[v.jsxs("div",{className:"identity",children:[v.jsx("span",{className:"muted",children:"this page is"}),v.jsx("span",{className:"mono name",title:"the peer name this page serves and calls under",children:a||"…"})]}),v.jsxs("header",{children:[v.jsx("h1",{children:"Peers"}),v.jsx("span",{className:`status ${n==="connected"?"ok":"warn"}`,children:n})]}),L.length===0&&v.jsx("p",{className:"muted",children:"Waiting for a peer to announce itself…"}),(()=>{const Y=new Set(L),ae=L.filter(me=>{const st=G[me]?.parent;return!st||st===me||!Y.has(st)}),De=(me,st,Qe)=>v.jsxs("div",{children:[v.jsxs("button",{className:`peer${me===R?" selected":""}`,style:st>0?{paddingLeft:10+st*14}:void 0,onClick:()=>{ys(me)},children:[v.jsx("span",{className:`dot${F.has(me)?" off":""}`}),v.jsxs("span",{className:"peer-lines",children:[v.jsxs("span",{children:[me,me===a&&v.jsx("span",{className:"you",children:"you"}),w[me]>0&&v.jsx("span",{className:"count",children:w[me]}),S[me]&&v.jsx("span",{className:`role ${S[me]}`,children:S[me]==="undescribed"?"no contract":S[me]}),$[me]&&$[me]!=="this console"&&v.jsx("span",{className:"link",children:$[me]})]}),(G[me]?.place||G[me]?.label)&&v.jsxs("span",{className:"peer-place",children:[G[me]?.place?.join(" / ")??"",G[me]?.label?` ${G[me].label}`:""]})]})]}),!Qe.has(me)&&L.filter(Ei=>G[Ei]?.parent===me&&Ei!==me).map(Ei=>De(Ei,st+1,new Set([...Qe,me])))]},me);return ae.map(me=>De(me,0,new Set))})()]}),v.jsxs("main",{children:[!R&&v.jsx("p",{className:"muted",children:"Select a peer to see what it exposes."}),R&&!X&&v.jsxs("p",{className:"muted",children:["Describing ",R,"…"]}),ni&&v.jsxs("div",{className:"notice",children:[v.jsx("strong",{children:ni.code??"Error"}),v.jsx("p",{children:ni.error}),v.jsx("p",{className:"muted",children:"A server answers this only when it is started with exposeIntrospection."})]}),Ft&&v.jsxs(v.Fragment,{children:[v.jsxs("header",{className:"peer-head",children:[v.jsx("h1",{children:Ft.name}),v.jsxs("span",{className:"muted",children:[Ft.version?`contract ${Ft.version} · `:"",Ft.validating?"arguments checked":"arguments not checked"]})]}),v.jsx(Vw,{description:Ft,peers:L,onSelectPeer:Y=>{ys(Y)}}),Ft.namespaces.map(Y=>v.jsxs("section",{className:"namespace",children:[v.jsxs("h2",{children:[Y.name,Y.version&&v.jsxs("span",{className:"badge",children:["@",Y.version]}),v.jsxs("span",{className:"muted mono",children:[Y.className,Y.created?" · created at runtime":""]}),Y.capabilities?.map(ae=>v.jsx("span",{className:"capability",title:"implements this contract interface",children:ae},ae))]}),Y.component&&v.jsx($w,{peer:R,namespace:Y.name,component:Y.component,server:g,onSubscribed:()=>{r&&R&&r.describe(R).then(N).catch(()=>{})}}),Y.methods.map(ae=>v.jsx(eS,{peer:R,namespace:Y.name,method:ae,types:Ft.types,service:r,network:re},ae.name)),Y.events.length>0&&v.jsxs("div",{className:"events",children:[v.jsxs("h3",{children:["events",Y.events.some(ae=>!M.has(`${R}/${Y.name}/${ae.name}`))&&v.jsx("button",{className:"toggle",onClick:()=>{rn(Y.name,Y.events)},children:"watch all"})]}),Y.events.map(ae=>{const De=M.has(`${R}/${Y.name}/${ae.name}`);return v.jsxs("div",{className:"event-row",children:[v.jsxs("code",{children:[ae.name,"(",ae.params?ae.params.map(sn).join(", "):"…",")"]}),v.jsx("button",{className:De?"toggle on":"toggle",onClick:()=>{gs(Y.name,ae)},children:De?"unwatch":"watch"}),v.jsxs("span",{className:"muted",children:[ae.subscribers," subscriber",ae.subscribers===1?"":"s"]})]},ae.name)})]})]},Y.name))]})]}),v.jsxs("section",{className:"side",children:[v.jsx("nav",{className:"tabs",children:["events","traffic","problems","presence","chat"].map(Y=>v.jsxs("button",{className:ne===Y?"tab on":"tab",onClick:()=>se(Y),children:[Y,Y==="traffic"&&xe.length>0&&v.jsx("span",{className:"count",children:xe.length}),Y==="problems"&&V.length>0&&v.jsx("span",{className:"count bad",children:V.length}),Y==="chat"&&vs>0&&v.jsx("span",{className:"count",children:vs})]},Y))}),ne==="chat"&&v.jsx(Dw,{peer:R,messages:R?y[R]??[]:[],onSend:ms}),ne==="problems"&&v.jsx(lS,{problems:V,onClear:()=>k([])}),ne==="presence"&&v.jsx(oS,{changes:ce,onClear:()=>he([])}),v.jsx(iS,{service:r,selected:R,frames:xe,onClear:()=>oe([]),paused:je,onPaused:Ge,hidden:ne!=="traffic"}),ne==="events"&&v.jsxs("div",{className:"stream",children:[v.jsxs("header",{children:[v.jsx("h1",{children:"Events"}),v.jsxs("div",{className:"traffic-actions",children:[B.length>0&&v.jsx("button",{className:"toggle",onClick:()=>uS(B,"events.jsonl"),title:"save what is here as jsonl",children:"export"}),B.length>0&&v.jsx("button",{className:"toggle",onClick:()=>Q([]),children:"clear"}),v.jsx("button",{className:Ce?"toggle on":"toggle",onClick:()=>ti(!Ce),children:Ce?"paused":"pause"})]})]}),B.length>0&&v.jsx("input",{className:"control",placeholder:"filter by peer, event or payload",value:Ee,onChange:Y=>it(Y.target.value)}),B.length===0&&v.jsx("p",{className:"muted",children:"Watch an event to see it here."}),B.filter(Y=>{const ae=Ee.trim().toLowerCase();return!ae||`${Y.peer} ${Y.namespace}.${Y.event} ${JSON.stringify(Y.args)}`.toLowerCase().includes(ae)}).map((Y,ae)=>v.jsxs("div",{className:"streamed",children:[v.jsx("time",{children:new Date(Y.at).toLocaleTimeString()}),v.jsxs("code",{children:[Y.peer,"/",Y.namespace,".",Y.event]}),v.jsx("pre",{children:JSON.stringify(Y.args)})]},`${Y.at}-${ae}`))]})]})]})};Bv.createRoot(document.getElementById("root")).render(v.jsx(J.StrictMode,{children:v.jsx(fS,{})}));
2063
2063
  //# sourceMappingURL=app.js.map