leglas 1.0.0 → 1.1.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/README.md +7 -1
- package/dist/bin.js +2384 -1629
- package/dist/index.d.ts +1 -1
- package/dist/index.js +143 -65
- package/dist/restart.d.ts +13 -0
- package/dist/run.d.ts +5 -0
- package/dist/shell/assets/index-BzaBzGEv.css +1 -0
- package/dist/shell/assets/index-CKmxj5gW.js +14 -0
- package/dist/shell/index.html +2 -2
- package/package.json +1 -1
- package/dist/shell/assets/index-BCvek69-.css +0 -1
- package/dist/shell/assets/index-BjY8sKEQ.js +0 -14
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))r(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const v of m.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&r(v)}).observe(document,{childList:!0,subtree:!0});function c(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function r(f){if(f.ep)return;f.ep=!0;const m=c(f);fetch(f.href,m)}})();var Wc={exports:{}},eu={};var _0;function _p(){if(_0)return eu;_0=1;var i=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function c(r,f,m){var v=null;if(m!==void 0&&(v=""+m),f.key!==void 0&&(v=""+f.key),"key"in f){m={};for(var b in f)b!=="key"&&(m[b]=f[b])}else m=f;return f=m.ref,{$$typeof:i,type:r,key:v,ref:f!==void 0?f:null,props:m}}return eu.Fragment=u,eu.jsx=c,eu.jsxs=c,eu}var L0;function Lp(){return L0||(L0=1,Wc.exports=_p()),Wc.exports}var o=Lp(),Ic={exports:{}},De={};var B0;function Bp(){if(B0)return De;B0=1;var i=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),v=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),D=Symbol.iterator;function R(E){return E===null||typeof E!="object"?null:(E=D&&E[D]||E["@@iterator"],typeof E=="function"?E:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},K=Object.assign,G={};function B(E,q,te){this.props=E,this.context=q,this.refs=G,this.updater=te||A}B.prototype.isReactComponent={},B.prototype.setState=function(E,q){if(typeof E!="object"&&typeof E!="function"&&E!=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,E,q,"setState")},B.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function Q(){}Q.prototype=B.prototype;function W(E,q,te){this.props=E,this.context=q,this.refs=G,this.updater=te||A}var ee=W.prototype=new Q;ee.constructor=W,K(ee,B.prototype),ee.isPureReactComponent=!0;var ae=Array.isArray;function se(){}var p={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function he(E,q,te){var oe=te.ref;return{$$typeof:i,type:E,key:q,ref:oe!==void 0?oe:null,props:te}}function pe(E,q){return he(E.type,q,E.props)}function le(E){return typeof E=="object"&&E!==null&&E.$$typeof===i}function ce(E){var q={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(te){return q[te]})}var Me=/\/+/g;function we(E,q){return typeof E=="object"&&E!==null&&E.key!=null?ce(""+E.key):q.toString(36)}function _e(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(se,se):(E.status="pending",E.then(function(q){E.status==="pending"&&(E.status="fulfilled",E.value=q)},function(q){E.status==="pending"&&(E.status="rejected",E.reason=q)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function U(E,q,te,oe,me){var je=typeof E;(je==="undefined"||je==="boolean")&&(E=null);var z=!1;if(E===null)z=!0;else switch(je){case"bigint":case"string":case"number":z=!0;break;case"object":switch(E.$$typeof){case i:case u:z=!0;break;case M:return z=E._init,U(z(E._payload),q,te,oe,me)}}if(z)return me=me(E),z=oe===""?"."+we(E,0):oe,ae(me)?(te="",z!=null&&(te=z.replace(Me,"$&/")+"/"),U(me,q,te,"",function(de){return de})):me!=null&&(le(me)&&(me=pe(me,te+(me.key==null||E&&E.key===me.key?"":(""+me.key).replace(Me,"$&/")+"/")+z)),q.push(me)),1;z=0;var Y=oe===""?".":oe+":";if(ae(E))for(var ne=0;ne<E.length;ne++)oe=E[ne],je=Y+we(oe,ne),z+=U(oe,q,te,je,me);else if(ne=R(E),typeof ne=="function")for(E=ne.call(E),ne=0;!(oe=E.next()).done;)oe=oe.value,je=Y+we(oe,ne++),z+=U(oe,q,te,je,me);else if(je==="object"){if(typeof E.then=="function")return U(_e(E),q,te,oe,me);throw q=String(E),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return z}function I(E,q,te){if(E==null)return E;var oe=[],me=0;return U(E,oe,"","",function(je){return q.call(te,je,me++)}),oe}function ie(E){if(E._status===-1){var q=E._result;q=q(),q.then(function(te){(E._status===0||E._status===-1)&&(E._status=1,E._result=te)},function(te){(E._status===0||E._status===-1)&&(E._status=2,E._result=te)}),E._status===-1&&(E._status=0,E._result=q)}if(E._status===1)return E._result.default;throw E._result}var Ne=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=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(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},Se={map:I,forEach:function(E,q,te){I(E,function(){q.apply(this,arguments)},te)},count:function(E){var q=0;return I(E,function(){q++}),q},toArray:function(E){return I(E,function(q){return q})||[]},only:function(E){if(!le(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return De.Activity=N,De.Children=Se,De.Component=B,De.Fragment=c,De.Profiler=f,De.PureComponent=W,De.StrictMode=r,De.Suspense=x,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=p,De.__COMPILER_RUNTIME={__proto__:null,c:function(E){return p.H.useMemoCache(E)}},De.cache=function(E){return function(){return E.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(E,q,te){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var oe=K({},E.props),me=E.key;if(q!=null)for(je in q.key!==void 0&&(me=""+q.key),q)!P.call(q,je)||je==="key"||je==="__self"||je==="__source"||je==="ref"&&q.ref===void 0||(oe[je]=q[je]);var je=arguments.length-2;if(je===1)oe.children=te;else if(1<je){for(var z=Array(je),Y=0;Y<je;Y++)z[Y]=arguments[Y+2];oe.children=z}return he(E.type,me,oe)},De.createContext=function(E){return E={$$typeof:v,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:m,_context:E},E},De.createElement=function(E,q,te){var oe,me={},je=null;if(q!=null)for(oe in q.key!==void 0&&(je=""+q.key),q)P.call(q,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(me[oe]=q[oe]);var z=arguments.length-2;if(z===1)me.children=te;else if(1<z){for(var Y=Array(z),ne=0;ne<z;ne++)Y[ne]=arguments[ne+2];me.children=Y}if(E&&E.defaultProps)for(oe in z=E.defaultProps,z)me[oe]===void 0&&(me[oe]=z[oe]);return he(E,je,me)},De.createRef=function(){return{current:null}},De.forwardRef=function(E){return{$$typeof:b,render:E}},De.isValidElement=le,De.lazy=function(E){return{$$typeof:M,_payload:{_status:-1,_result:E},_init:ie}},De.memo=function(E,q){return{$$typeof:y,type:E,compare:q===void 0?null:q}},De.startTransition=function(E){var q=p.T,te={};p.T=te;try{var oe=E(),me=p.S;me!==null&&me(te,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(se,Ne)}catch(je){Ne(je)}finally{q!==null&&te.types!==null&&(q.types=te.types),p.T=q}},De.unstable_useCacheRefresh=function(){return p.H.useCacheRefresh()},De.use=function(E){return p.H.use(E)},De.useActionState=function(E,q,te){return p.H.useActionState(E,q,te)},De.useCallback=function(E,q){return p.H.useCallback(E,q)},De.useContext=function(E){return p.H.useContext(E)},De.useDebugValue=function(){},De.useDeferredValue=function(E,q){return p.H.useDeferredValue(E,q)},De.useEffect=function(E,q){return p.H.useEffect(E,q)},De.useEffectEvent=function(E){return p.H.useEffectEvent(E)},De.useId=function(){return p.H.useId()},De.useImperativeHandle=function(E,q,te){return p.H.useImperativeHandle(E,q,te)},De.useInsertionEffect=function(E,q){return p.H.useInsertionEffect(E,q)},De.useLayoutEffect=function(E,q){return p.H.useLayoutEffect(E,q)},De.useMemo=function(E,q){return p.H.useMemo(E,q)},De.useOptimistic=function(E,q){return p.H.useOptimistic(E,q)},De.useReducer=function(E,q,te){return p.H.useReducer(E,q,te)},De.useRef=function(E){return p.H.useRef(E)},De.useState=function(E){return p.H.useState(E)},De.useSyncExternalStore=function(E,q,te){return p.H.useSyncExternalStore(E,q,te)},De.useTransition=function(){return p.H.useTransition()},De.version="19.2.8",De}var U0;function Mf(){return U0||(U0=1,Ic.exports=Bp()),Ic.exports}var w=Mf(),Pc={exports:{}},tu={},ef={exports:{}},tf={};var H0;function Up(){return H0||(H0=1,(function(i){function u(U,I){var ie=U.length;U.push(I);e:for(;0<ie;){var Ne=ie-1>>>1,Se=U[Ne];if(0<f(Se,I))U[Ne]=I,U[ie]=Se,ie=Ne;else break e}}function c(U){return U.length===0?null:U[0]}function r(U){if(U.length===0)return null;var I=U[0],ie=U.pop();if(ie!==I){U[0]=ie;e:for(var Ne=0,Se=U.length,E=Se>>>1;Ne<E;){var q=2*(Ne+1)-1,te=U[q],oe=q+1,me=U[oe];if(0>f(te,ie))oe<Se&&0>f(me,te)?(U[Ne]=me,U[oe]=ie,Ne=oe):(U[Ne]=te,U[q]=ie,Ne=q);else if(oe<Se&&0>f(me,ie))U[Ne]=me,U[oe]=ie,Ne=oe;else break e}}return I}function f(U,I){var ie=U.sortIndex-I.sortIndex;return ie!==0?ie:U.id-I.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;i.unstable_now=function(){return m.now()}}else{var v=Date,b=v.now();i.unstable_now=function(){return v.now()-b}}var x=[],y=[],M=1,N=null,D=3,R=!1,A=!1,K=!1,G=!1,B=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;function ee(U){for(var I=c(y);I!==null;){if(I.callback===null)r(y);else if(I.startTime<=U)r(y),I.sortIndex=I.expirationTime,u(x,I);else break;I=c(y)}}function ae(U){if(K=!1,ee(U),!A)if(c(x)!==null)A=!0,se||(se=!0,ce());else{var I=c(y);I!==null&&_e(ae,I.startTime-U)}}var se=!1,p=-1,P=5,he=-1;function pe(){return G?!0:!(i.unstable_now()-he<P)}function le(){if(G=!1,se){var U=i.unstable_now();he=U;var I=!0;try{e:{A=!1,K&&(K=!1,Q(p),p=-1),R=!0;var ie=D;try{t:{for(ee(U),N=c(x);N!==null&&!(N.expirationTime>U&&pe());){var Ne=N.callback;if(typeof Ne=="function"){N.callback=null,D=N.priorityLevel;var Se=Ne(N.expirationTime<=U);if(U=i.unstable_now(),typeof Se=="function"){N.callback=Se,ee(U),I=!0;break t}N===c(x)&&r(x),ee(U)}else r(x);N=c(x)}if(N!==null)I=!0;else{var E=c(y);E!==null&&_e(ae,E.startTime-U),I=!1}}break e}finally{N=null,D=ie,R=!1}I=void 0}}finally{I?ce():se=!1}}}var ce;if(typeof W=="function")ce=function(){W(le)};else if(typeof MessageChannel<"u"){var Me=new MessageChannel,we=Me.port2;Me.port1.onmessage=le,ce=function(){we.postMessage(null)}}else ce=function(){B(le,0)};function _e(U,I){p=B(function(){U(i.unstable_now())},I)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(U){U.callback=null},i.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<U?Math.floor(1e3/U):5},i.unstable_getCurrentPriorityLevel=function(){return D},i.unstable_next=function(U){switch(D){case 1:case 2:case 3:var I=3;break;default:I=D}var ie=D;D=I;try{return U()}finally{D=ie}},i.unstable_requestPaint=function(){G=!0},i.unstable_runWithPriority=function(U,I){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var ie=D;D=U;try{return I()}finally{D=ie}},i.unstable_scheduleCallback=function(U,I,ie){var Ne=i.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?Ne+ie:Ne):ie=Ne,U){case 1:var Se=-1;break;case 2:Se=250;break;case 5:Se=1073741823;break;case 4:Se=1e4;break;default:Se=5e3}return Se=ie+Se,U={id:M++,callback:I,priorityLevel:U,startTime:ie,expirationTime:Se,sortIndex:-1},ie>Ne?(U.sortIndex=ie,u(y,U),c(x)===null&&U===c(y)&&(K?(Q(p),p=-1):K=!0,_e(ae,ie-Ne))):(U.sortIndex=Se,u(x,U),A||R||(A=!0,se||(se=!0,ce()))),U},i.unstable_shouldYield=pe,i.unstable_wrapCallback=function(U){var I=D;return function(){var ie=D;D=I;try{return U.apply(this,arguments)}finally{D=ie}}}})(tf)),tf}var q0;function Hp(){return q0||(q0=1,ef.exports=Up()),ef.exports}var nf={exports:{}},Xt={};var $0;function qp(){if($0)return Xt;$0=1;var i=Mf();function u(x){var y="https://react.dev/errors/"+x;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var M=2;M<arguments.length;M++)y+="&args[]="+encodeURIComponent(arguments[M])}return"Minified React error #"+x+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var r={d:{f:c,r:function(){throw Error(u(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},f=Symbol.for("react.portal");function m(x,y,M){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:N==null?null:""+N,children:x,containerInfo:y,implementation:M}}var v=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function b(x,y){if(x==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return Xt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Xt.createPortal=function(x,y){var M=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(u(299));return m(x,y,null,M)},Xt.flushSync=function(x){var y=v.T,M=r.p;try{if(v.T=null,r.p=2,x)return x()}finally{v.T=y,r.p=M,r.d.f()}},Xt.preconnect=function(x,y){typeof x=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,r.d.C(x,y))},Xt.prefetchDNS=function(x){typeof x=="string"&&r.d.D(x)},Xt.preinit=function(x,y){if(typeof x=="string"&&y&&typeof y.as=="string"){var M=y.as,N=b(M,y.crossOrigin),D=typeof y.integrity=="string"?y.integrity:void 0,R=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;M==="style"?r.d.S(x,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:N,integrity:D,fetchPriority:R}):M==="script"&&r.d.X(x,{crossOrigin:N,integrity:D,fetchPriority:R,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},Xt.preinitModule=function(x,y){if(typeof x=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var M=b(y.as,y.crossOrigin);r.d.M(x,{crossOrigin:M,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&r.d.M(x)},Xt.preload=function(x,y){if(typeof x=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var M=y.as,N=b(M,y.crossOrigin);r.d.L(x,M,{crossOrigin:N,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})}},Xt.preloadModule=function(x,y){if(typeof x=="string")if(y){var M=b(y.as,y.crossOrigin);r.d.m(x,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:M,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else r.d.m(x)},Xt.requestFormReset=function(x){r.d.r(x)},Xt.unstable_batchedUpdates=function(x,y){return x(y)},Xt.useFormState=function(x,y,M){return v.H.useFormState(x,y,M)},Xt.useFormStatus=function(){return v.H.useHostTransitionStatus()},Xt.version="19.2.8",Xt}var Y0;function B1(){if(Y0)return nf.exports;Y0=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(u){console.error(u)}}return i(),nf.exports=qp(),nf.exports}var G0;function $p(){if(G0)return tu;G0=1;var i=Hp(),u=Mf(),c=B1();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}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 f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function v(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 b(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 x(e){if(m(e)!==e)throw Error(r(188))}function y(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(r(188));return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return x(a),e;if(s===l)return x(a),t;s=s.sibling}throw Error(r(188))}if(n.return!==l.return)n=a,l=s;else{for(var d=!1,g=a.child;g;){if(g===n){d=!0,n=a,l=s;break}if(g===l){d=!0,l=a,n=s;break}g=g.sibling}if(!d){for(g=s.child;g;){if(g===n){d=!0,n=s,l=a;break}if(g===l){d=!0,l=s,n=a;break}g=g.sibling}if(!d)throw Error(r(189))}}if(n.alternate!==l)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function M(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=M(e),t!==null)return t;e=e.sibling}return null}var N=Object.assign,D=Symbol.for("react.element"),R=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),W=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),he=Symbol.for("react.activity"),pe=Symbol.for("react.memo_cache_sentinel"),le=Symbol.iterator;function ce(e){return e===null||typeof e!="object"?null:(e=le&&e[le]||e["@@iterator"],typeof e=="function"?e:null)}var Me=Symbol.for("react.client.reference");function we(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case K:return"Fragment";case B:return"Profiler";case G:return"StrictMode";case ae:return"Suspense";case se:return"SuspenseList";case he:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case W:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case ee:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case p:return t=e.displayName||null,t!==null?t:we(e.type)||"Memo";case P:t=e._payload,e=e._init;try{return we(e(t))}catch{}}return null}var _e=Array.isArray,U=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},Ne=[],Se=-1;function E(e){return{current:e}}function q(e){0>Se||(e.current=Ne[Se],Ne[Se]=null,Se--)}function te(e,t){Se++,Ne[Se]=e.current,e.current=t}var oe=E(null),me=E(null),je=E(null),z=E(null);function Y(e,t){switch(te(je,t),te(me,e),te(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?a0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=a0(t),e=i0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(oe),te(oe,e)}function ne(){q(oe),q(me),q(je)}function de(e){e.memoizedState!==null&&te(z,e);var t=oe.current,n=i0(t,e.type);t!==n&&(te(me,e),te(oe,n))}function Oe(e){me.current===e&&(q(oe),q(me)),z.current===e&&(q(z),Js._currentValue=ie)}var qe,Ie;function nt(e){if(qe===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);qe=t&&t[1]||"",Ie=-1<n.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+qe+e+Ie}var Xe=!1;function Qe(e,t){if(!e||Xe)return"";Xe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(H){var _=H}Reflect.construct(e,[],F)}else{try{F.call()}catch(H){_=H}e.call(F.prototype)}}else{try{throw Error()}catch(H){_=H}(F=e())&&typeof F.catch=="function"&&F.catch(function(){})}}catch(H){if(H&&_&&typeof H.stack=="string")return[H.stack,_.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=l.DetermineComponentFrameRoot(),d=s[0],g=s[1];if(d&&g){var S=d.split(`
|
|
4
|
+
`),O=g.split(`
|
|
5
|
+
`);for(a=l=0;l<S.length&&!S[l].includes("DetermineComponentFrameRoot");)l++;for(;a<O.length&&!O[a].includes("DetermineComponentFrameRoot");)a++;if(l===S.length||a===O.length)for(l=S.length-1,a=O.length-1;1<=l&&0<=a&&S[l]!==O[a];)a--;for(;1<=l&&0<=a;l--,a--)if(S[l]!==O[a]){if(l!==1||a!==1)do if(l--,a--,0>a||S[l]!==O[a]){var X=`
|
|
6
|
+
`+S[l].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=l&&0<=a);break}}}finally{Xe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?nt(n):""}function jt(e,t){switch(e.tag){case 26:case 27:case 5:return nt(e.type);case 16:return nt("Lazy");case 13:return e.child!==t&&t!==null?nt("Suspense Fallback"):nt("Suspense");case 19:return nt("SuspenseList");case 0:case 15:return Qe(e.type,!1);case 11:return Qe(e.type.render,!1);case 1:return Qe(e.type,!0);case 31:return nt("Activity");default:return""}}function hn(e){try{var t="",n=null;do t+=jt(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
|
|
7
|
+
Error generating stack: `+l.message+`
|
|
8
|
+
`+l.stack}}var Qn=Object.prototype.hasOwnProperty,Bl=i.unstable_scheduleCallback,al=i.unstable_cancelCallback,Ul=i.unstable_shouldYield,ii=i.unstable_requestPaint,Rt=i.unstable_now,wa=i.unstable_getCurrentPriorityLevel,Sa=i.unstable_ImmediatePriority,il=i.unstable_UserBlockingPriority,mn=i.unstable_NormalPriority,si=i.unstable_LowPriority,ui=i.unstable_IdlePriority,Hl=i.log,Zn=i.unstable_setDisableYieldValue,Vn=null,pt=null;function Cn(e){if(typeof Hl=="function"&&Zn(e),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(Vn,e)}catch{}}var ct=Math.clz32?Math.clz32:Kn,sl=Math.log,Qt=Math.LN2;function Kn(e){return e>>>=0,e===0?32:31-(sl(e)/Qt|0)|0}var Mn=256,ul=262144,ol=4194304;function Wt(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 It(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var a=0,s=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var g=l&134217727;return g!==0?(l=g&~s,l!==0?a=Wt(l):(d&=g,d!==0?a=Wt(d):n||(n=g&~e,n!==0&&(a=Wt(n))))):(g=l&~s,g!==0?a=Wt(g):d!==0?a=Wt(d):n||(n=l&~e,n!==0&&(a=Wt(n)))),a===0?0:t!==0&&t!==a&&(t&s)===0&&(s=a&-a,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:a}function Fn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ql(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 oi(){var e=ol;return ol<<=1,(ol&62914560)===0&&(ol=4194304),e}function Ea(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function cl(e,t,n,l,a,s){var d=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var g=e.entanglements,S=e.expirationTimes,O=e.hiddenUpdates;for(n=d&~n;0<n;){var X=31-ct(n),F=1<<X;g[X]=0,S[X]=-1;var _=O[X];if(_!==null)for(O[X]=null,X=0;X<_.length;X++){var H=_[X];H!==null&&(H.lane&=-536870913)}n&=~F}l!==0&&ja(e,l,0),s!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=s&~(d&~t))}function ja(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-ct(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function Jn(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-ct(n),a=1<<l;a&t|e[l]&t&&(e[l]|=t),n&=~a}}function Ca(e,t){var n=t&-t;return n=(n&42)!==0?1:$(n),(n&(e.suspendedLanes|t))!==0?0:n}function $(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 re(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ae(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:A0(e.type))}function ve(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var Ee=Math.random().toString(36).slice(2),Le="__reactFiber$"+Ee,ke="__reactProps$"+Ee,ut="__reactContainer$"+Ee,Pt="__reactEvents$"+Ee,ou="__reactListeners$"+Ee,Ko="__reactHandles$"+Ee,ru="__reactResources$"+Ee,Hn="__reactMarker$"+Ee;function $l(e){delete e[Le],delete e[ke],delete e[Pt],delete e[ou],delete e[Ko]}function Nn(e){var t=e[Le];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ut]||n[Le]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=d0(e);e!==null;){if(n=e[Le])return n;e=d0(e)}return t}e=n,n=e.parentNode}return null}function fl(e){if(e=e[Le]||e[ut]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Je(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function pn(e){var t=e[ru];return t||(t=e[ru]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function vt(e){e[Hn]=!0}var Yl=new Set,cu={};function en(e,t){Wn(e,t),Wn(e+"Capture",t)}function Wn(e,t){for(cu[e]=t,e=0;e<t.length;e++)Yl.add(t[e])}var ri=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]*$"),fu={},Zt={};function ls(e){return Qn.call(Zt,e)?!0:Qn.call(fu,e)?!1:ri.test(e)?Zt[e]=!0:(fu[e]=!0,!1)}function qn(e,t,n){if(ls(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function ci(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function $n(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function Vt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function fi(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Fo(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var a=l.get,s=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(d){n=""+d,s.call(this,d)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ma(e){if(!e._valueTracker){var t=fi(e)?"checked":"value";e._valueTracker=Fo(e,t,""+e[t])}}function as(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=fi(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function dl(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 hl=/[\n"\\]/g;function tn(e){return e.replace(hl,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function di(e,t,n,l,a,s,d,g){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Vt(t)):e.value!==""+Vt(t)&&(e.value=""+Vt(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?ml(e,d,Vt(t)):n!=null?ml(e,d,Vt(n)):l!=null&&e.removeAttribute("value"),a==null&&s!=null&&(e.defaultChecked=!!s),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+Vt(g):e.removeAttribute("name")}function hi(e,t,n,l,a,s,d,g){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){Ma(e);return}n=n!=null?""+Vt(n):"",t=t!=null?""+Vt(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}l=l??a,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=g?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Ma(e)}function ml(e,t,n){t==="number"&&dl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Gl(e,t,n,l){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&l&&(e[n].defaultSelected=!0)}else{for(n=""+Vt(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,l&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Na(e,t,n){if(t!=null&&(t=""+Vt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Vt(n):""}function mi(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(r(92));if(_e(l)){if(1<l.length)throw Error(r(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=Vt(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Ma(e)}function Xl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jo=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 is(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||Jo.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Dt(e,t,n){if(t!=null&&typeof t!="object")throw Error(r(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var a in t)l=t[a],t.hasOwnProperty(a)&&n[a]!==l&&is(e,a,l)}else for(var s in t)t.hasOwnProperty(s)&&is(e,s,t[s])}function pl(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 qt=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"]]),Aa=/^[\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 Ql(e){return Aa.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function $t(){}var Zl=null;function pi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gn=null,gl=null;function ss(e){var t=fl(e);if(t&&(e=t.stateNode)){var n=e[ke]||null;e:switch(e=t.stateNode,t.type){case"input":if(di(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+tn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var a=l[ke]||null;if(!a)throw Error(r(90));di(l,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&as(l)}break e;case"textarea":Na(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Gl(e,!!n.multiple,t,!1)}}}var gi=!1;function us(e,t,n){if(gi)return e(t,n);gi=!0;try{var l=e(t);return l}finally{if(gi=!1,(gn!==null||gl!==null)&&(uo(),gn&&(t=gn,e=gl,gl=gn=null,ss(t),e)))for(t=0;t<e.length;t++)ss(e[t])}}function Yn(e,t){var n=e.stateNode;if(n===null)return null;var l=n[ke]||null;if(l===null)return null;n=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(r(231,t,typeof n));return n}var An=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),os=!1;if(An)try{var Ta={};Object.defineProperty(Ta,"passive",{get:function(){os=!0}}),window.addEventListener("test",Ta,Ta),window.removeEventListener("test",Ta,Ta)}catch{os=!1}var In=null,yi=null,xi=null;function vi(){if(xi)return xi;var e,t=yi,n=t.length,l,a="value"in In?In.value:In.textContent,s=a.length;for(e=0;e<n&&t[e]===a[e];e++);var d=n-e;for(l=1;l<=d&&t[n-l]===a[s-l];l++);return xi=a.slice(e,1<l?1-l:void 0)}function nn(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 Da(){return!0}function du(){return!1}function Yt(e){function t(n,l,a,s,d){this._reactName=n,this._targetInst=a,this.type=l,this.nativeEvent=s,this.target=d,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(n=e[g],this[g]=n?n(s):s[g]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Da:du,this.isPropagationStopped=du,this}return N(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Da)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Da)},persist:function(){},isPersistent:Da}),t}var kt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ka=Yt(kt),Tn=N({},kt,{view:0,detail:0}),Wo=Yt(Tn),yn,rs,za,bi=N({},Tn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ji,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!==za&&(za&&e.type==="mousemove"?(yn=e.screenX-za.screenX,rs=e.screenY-za.screenY):rs=yn=0,za=e),yn)},movementY:function(e){return"movementY"in e?e.movementY:rs}}),Pn=Yt(bi),cs=N({},bi,{dataTransfer:0}),xn=Yt(cs),wi=N({},Tn,{relatedTarget:0}),Si=Yt(wi),fs=N({},kt,{animationName:0,elapsedTime:0,pseudoElement:0}),Io=Yt(fs),yl=N({},kt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bt=Yt(yl),hu=N({},kt,{data:0}),Ei=Yt(hu),xl={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ds={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"},Gt={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hs(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Gt[e])?!!t[e]:!1}function ji(){return hs}var Po=N({},Tn,{key:function(e){if(e.key){var t=xl[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=nn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ds[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ji,charCode:function(e){return e.type==="keypress"?nn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?nn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Te=Yt(Po),er=N({},bi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ms=Yt(er),Ci=N({},Tn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ji}),tr=Yt(Ci),mu=N({},kt,{propertyName:0,elapsedTime:0,pseudoElement:0}),nr=Yt(mu),lr=N({},bi,{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}),ar=Yt(lr),ir=N({},kt,{newState:0,oldState:0}),sr=Yt(ir),pu=[9,13,27,32],Oa=An&&"CompositionEvent"in window,Ra=null;An&&"documentMode"in document&&(Ra=document.documentMode);var ur=An&&"TextEvent"in window&&!Ra,Mi=An&&(!Oa||Ra&&8<Ra&&11>=Ra),gu=" ",ps=!1;function Vl(e,t){switch(e){case"keyup":return pu.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 Kl=!1;function xu(e,t){switch(e){case"compositionend":return yu(t);case"keypress":return t.which!==32?null:(ps=!0,gu);case"textInput":return e=t.data,e===gu&&ps?null:e;default:return null}}function Ni(e,t){if(Kl)return e==="compositionend"||!Oa&&Vl(e,t)?(e=vi(),xi=yi=In=null,Kl=!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 Mi&&t.locale!=="ko"?null:t.data;default:return null}}var vu={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 bu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!vu[e.type]:t==="textarea"}function vl(e,t,n,l){gn?gl?gl.push(l):gl=[l]:gn=l,t=po(t,"onChange"),0<t.length&&(n=new ka("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var _a=null,La=null;function or(e){Ih(e,0)}function Ai(e){var t=Je(e);if(as(t))return e}function wu(e,t){if(e==="change")return t}var gs=!1;if(An){var ys;if(An){var bl="oninput"in document;if(!bl){var Dn=document.createElement("div");Dn.setAttribute("oninput","return;"),bl=typeof Dn.oninput=="function"}ys=bl}else ys=!1;gs=ys&&(!document.documentMode||9<document.documentMode)}function Su(){_a&&(_a.detachEvent("onpropertychange",Ba),La=_a=null)}function Ba(e){if(e.propertyName==="value"&&Ai(La)){var t=[];vl(t,La,e,pi(e)),us(or,t)}}function xs(e,t,n){e==="focusin"?(Su(),_a=t,La=n,_a.attachEvent("onpropertychange",Ba)):e==="focusout"&&Su()}function vs(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ai(La)}function Eu(e,t){if(e==="click")return Ai(t)}function ju(e,t){if(e==="input"||e==="change")return Ai(t)}function rr(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Kt=typeof Object.is=="function"?Object.is:rr;function Ua(e,t){if(Kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var a=n[l];if(!Qn.call(t,a)||!Kt(e[a],t[a]))return!1}return!0}function Cu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function bs(e,t){var n=Cu(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Cu(n)}}function Mu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=dl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=dl(e.document)}return t}function ws(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 cr=An&&"documentMode"in document&&11>=document.documentMode,Fl=null,h=null,j=null,L=!1;function Z(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;L||Fl==null||Fl!==dl(l)||(l=Fl,"selectionStart"in l&&ws(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),j&&Ua(j,l)||(j=l,l=po(h,"onSelect"),0<l.length&&(t=new ka("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Fl)))}function J(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ue={animationend:J("Animation","AnimationEnd"),animationiteration:J("Animation","AnimationIteration"),animationstart:J("Animation","AnimationStart"),transitionrun:J("Transition","TransitionRun"),transitionstart:J("Transition","TransitionStart"),transitioncancel:J("Transition","TransitionCancel"),transitionend:J("Transition","TransitionEnd")},fe={},ye={};An&&(ye=document.createElement("div").style,"AnimationEvent"in window||(delete ue.animationend.animation,delete ue.animationiteration.animation,delete ue.animationstart.animation),"TransitionEvent"in window||delete ue.transitionend.transition);function Ze(e){if(fe[e])return fe[e];if(!ue[e])return e;var t=ue[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ye)return fe[e]=t[n];return e}var Pe=Ze("animationend"),mt=Ze("animationiteration"),_t=Ze("animationstart"),Be=Ze("transitionrun"),zt=Ze("transitionstart"),wt=Ze("transitioncancel"),Ft=Ze("transitionend"),rt=new Map,Ha="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(" ");Ha.push("scrollEnd");function ln(e,t){rt.set(e,t),en(t,[e])}var qa=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)},gt=[],an=0,fr=0;function Au(){for(var e=an,t=fr=an=0;t<e;){var n=gt[t];gt[t++]=null;var l=gt[t];gt[t++]=null;var a=gt[t];gt[t++]=null;var s=gt[t];if(gt[t++]=null,l!==null&&a!==null){var d=l.pending;d===null?a.next=a:(a.next=d.next,d.next=a),l.pending=a}s!==0&&Of(n,a,s)}}function Tu(e,t,n,l){gt[an++]=e,gt[an++]=t,gt[an++]=n,gt[an++]=l,fr|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function dr(e,t,n,l){return Tu(e,t,n,l),Du(e)}function $a(e,t){return Tu(e,null,null,t),Du(e)}function Of(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var a=!1,s=e.return;s!==null;)s.childLanes|=n,l=s.alternate,l!==null&&(l.childLanes|=n),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(a=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,a&&t!==null&&(a=31-ct(n),e=s.hiddenUpdates,l=e[a],l===null?e[a]=[t]:l.push(t),t.lane=n|536870912),s):null}function Du(e){if(50<Gs)throw Gs=0,wc=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ti={};function xm(e,t,n,l){this.tag=e,this.key=n,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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vn(e,t,n,l){return new xm(e,t,n,l)}function hr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wl(e,t){var n=e.alternate;return n===null?(n=vn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Rf(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ku(e,t,n,l,a,s){var d=0;if(l=e,typeof e=="function")hr(e)&&(d=1);else if(typeof e=="string")d=Ep(e,n,oe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case he:return e=vn(31,n,t,a),e.elementType=he,e.lanes=s,e;case K:return Ya(n.children,a,s,t);case G:d=8,a|=24;break;case B:return e=vn(12,n,t,a|2),e.elementType=B,e.lanes=s,e;case ae:return e=vn(13,n,t,a),e.elementType=ae,e.lanes=s,e;case se:return e=vn(19,n,t,a),e.elementType=se,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case W:d=10;break e;case Q:d=9;break e;case ee:d=11;break e;case p:d=14;break e;case P:d=16,l=null;break e}d=29,n=Error(r(130,e===null?"null":typeof e,"")),l=null}return t=vn(d,n,t,a),t.elementType=e,t.type=l,t.lanes=s,t}function Ya(e,t,n,l){return e=vn(7,e,l,t),e.lanes=n,e}function mr(e,t,n){return e=vn(6,e,null,t),e.lanes=n,e}function _f(e){var t=vn(18,null,null,0);return t.stateNode=e,t}function pr(e,t,n){return t=vn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Lf=new WeakMap;function kn(e,t){if(typeof e=="object"&&e!==null){var n=Lf.get(e);return n!==void 0?n:(t={value:e,source:t,stack:hn(t)},Lf.set(e,t),t)}return{value:e,source:t,stack:hn(t)}}var Di=[],ki=0,zu=null,Ss=0,zn=[],On=0,Jl=null,el=1,tl="";function Sl(e,t){Di[ki++]=Ss,Di[ki++]=zu,zu=e,Ss=t}function Bf(e,t,n){zn[On++]=el,zn[On++]=tl,zn[On++]=Jl,Jl=e;var l=el;e=tl;var a=32-ct(l)-1;l&=~(1<<a),n+=1;var s=32-ct(t)+a;if(30<s){var d=a-a%5;s=(l&(1<<d)-1).toString(32),l>>=d,a-=d,el=1<<32-ct(t)+a|n<<a|l,tl=s+e}else el=1<<s|n<<a|l,tl=e}function gr(e){e.return!==null&&(Sl(e,1),Bf(e,1,0))}function yr(e){for(;e===zu;)zu=Di[--ki],Di[ki]=null,Ss=Di[--ki],Di[ki]=null;for(;e===Jl;)Jl=zn[--On],zn[On]=null,tl=zn[--On],zn[On]=null,el=zn[--On],zn[On]=null}function Uf(e,t){zn[On++]=el,zn[On++]=tl,zn[On++]=Jl,el=t.id,tl=t.overflow,Jl=e}var Lt=null,ft=null,Ge=!1,Wl=null,Rn=!1,xr=Error(r(519));function Il(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Es(kn(t,e)),xr}function Hf(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Le]=e,t[ke]=l,n){case"dialog":He("cancel",t),He("close",t);break;case"iframe":case"object":case"embed":He("load",t);break;case"video":case"audio":for(n=0;n<Qs.length;n++)He(Qs[n],t);break;case"source":He("error",t);break;case"img":case"image":case"link":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"input":He("invalid",t),hi(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":He("invalid",t);break;case"textarea":He("invalid",t),mi(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||n0(t.textContent,n)?(l.popover!=null&&(He("beforetoggle",t),He("toggle",t)),l.onScroll!=null&&He("scroll",t),l.onScrollEnd!=null&&He("scrollend",t),l.onClick!=null&&(t.onclick=$t),t=!0):t=!1,t||Il(e,!0)}function qf(e){for(Lt=e.return;Lt;)switch(Lt.tag){case 5:case 31:case 13:Rn=!1;return;case 27:case 3:Rn=!0;return;default:Lt=Lt.return}}function zi(e){if(e!==Lt)return!1;if(!Ge)return qf(e),Ge=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Lc(e.type,e.memoizedProps)),n=!n),n&&ft&&Il(e),qf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));ft=f0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));ft=f0(e)}else t===27?(t=ft,da(e.type)?(e=$c,$c=null,ft=e):ft=t):ft=Lt?Ln(e.stateNode.nextSibling):null;return!0}function Ga(){ft=Lt=null,Ge=!1}function vr(){var e=Wl;return e!==null&&(rn===null?rn=e:rn.push.apply(rn,e),Wl=null),e}function Es(e){Wl===null?Wl=[e]:Wl.push(e)}var br=E(null),Xa=null,El=null;function Pl(e,t,n){te(br,t._currentValue),t._currentValue=n}function jl(e){e._currentValue=br.current,q(br)}function wr(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function Sr(e,t,n,l){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var s=a.dependencies;if(s!==null){var d=a.child;s=s.firstContext;e:for(;s!==null;){var g=s;s=a;for(var S=0;S<t.length;S++)if(g.context===t[S]){s.lanes|=n,g=s.alternate,g!==null&&(g.lanes|=n),wr(s.return,n,e),l||(d=null);break e}s=g.next}}else if(a.tag===18){if(d=a.return,d===null)throw Error(r(341));d.lanes|=n,s=d.alternate,s!==null&&(s.lanes|=n),wr(d,n,e),d=null}else d=a.child;if(d!==null)d.return=a;else for(d=a;d!==null;){if(d===e){d=null;break}if(a=d.sibling,a!==null){a.return=d.return,d=a;break}d=d.return}a=d}}function Oi(e,t,n,l){e=null;for(var a=t,s=!1;a!==null;){if(!s){if((a.flags&524288)!==0)s=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var d=a.alternate;if(d===null)throw Error(r(387));if(d=d.memoizedProps,d!==null){var g=a.type;Kt(a.pendingProps.value,d.value)||(e!==null?e.push(g):e=[g])}}else if(a===z.current){if(d=a.alternate,d===null)throw Error(r(387));d.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(Js):e=[Js])}a=a.return}e!==null&&Sr(t,e,n,l),t.flags|=262144}function Ou(e){for(e=e.firstContext;e!==null;){if(!Kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qa(e){Xa=e,El=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Bt(e){return $f(Xa,e)}function Ru(e,t){return Xa===null&&Qa(e),$f(e,t)}function $f(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},El===null){if(e===null)throw Error(r(308));El=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else El=El.next=t;return n}var vm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},bm=i.unstable_scheduleCallback,wm=i.unstable_NormalPriority,Ct={$$typeof:W,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Er(){return{controller:new vm,data:new Map,refCount:0}}function js(e){e.refCount--,e.refCount===0&&bm(wm,function(){e.controller.abort()})}var Cs=null,jr=0,Ri=0,_i=null;function Sm(e,t){if(Cs===null){var n=Cs=[];jr=0,Ri=Nc(),_i={status:"pending",value:void 0,then:function(l){n.push(l)}}}return jr++,t.then(Yf,Yf),t}function Yf(){if(--jr===0&&Cs!==null){_i!==null&&(_i.status="fulfilled");var e=Cs;Cs=null,Ri=0,_i=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Em(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(l.status="rejected",l.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),l}var Gf=U.S;U.S=function(e,t){Mh=Rt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Sm(e,t),Gf!==null&&Gf(e,t)};var Za=E(null);function Cr(){var e=Za.current;return e!==null?e:ot.pooledCache}function _u(e,t){t===null?te(Za,Za.current):te(Za,t.pool)}function Xf(){var e=Cr();return e===null?null:{parent:Ct._currentValue,pool:e}}var Li=Error(r(460)),Mr=Error(r(474)),Lu=Error(r(542)),Bu={then:function(){}};function Qf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Zf(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then($t,$t),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Kf(e),e;default:if(typeof t.status=="string")t.then($t,$t);else{if(e=ot,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=l}},function(l){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Kf(e),e}throw Ka=t,Li}}function Va(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ka=n,Li):n}}var Ka=null;function Vf(){if(Ka===null)throw Error(r(459));var e=Ka;return Ka=null,e}function Kf(e){if(e===Li||e===Lu)throw Error(r(483))}var Bi=null,Ms=0;function Uu(e){var t=Ms;return Ms+=1,Bi===null&&(Bi=[]),Zf(Bi,e,t)}function Ns(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Hu(e,t){throw t.$$typeof===D?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Ff(e){function t(T,C){if(e){var k=T.deletions;k===null?(T.deletions=[C],T.flags|=16):k.push(C)}}function n(T,C){if(!e)return null;for(;C!==null;)t(T,C),C=C.sibling;return null}function l(T){for(var C=new Map;T!==null;)T.key!==null?C.set(T.key,T):C.set(T.index,T),T=T.sibling;return C}function a(T,C){return T=wl(T,C),T.index=0,T.sibling=null,T}function s(T,C,k){return T.index=k,e?(k=T.alternate,k!==null?(k=k.index,k<C?(T.flags|=67108866,C):k):(T.flags|=67108866,C)):(T.flags|=1048576,C)}function d(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function g(T,C,k,V){return C===null||C.tag!==6?(C=mr(k,T.mode,V),C.return=T,C):(C=a(C,k),C.return=T,C)}function S(T,C,k,V){var be=k.type;return be===K?X(T,C,k.props.children,V,k.key):C!==null&&(C.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===P&&Va(be)===C.type)?(C=a(C,k.props),Ns(C,k),C.return=T,C):(C=ku(k.type,k.key,k.props,null,T.mode,V),Ns(C,k),C.return=T,C)}function O(T,C,k,V){return C===null||C.tag!==4||C.stateNode.containerInfo!==k.containerInfo||C.stateNode.implementation!==k.implementation?(C=pr(k,T.mode,V),C.return=T,C):(C=a(C,k.children||[]),C.return=T,C)}function X(T,C,k,V,be){return C===null||C.tag!==7?(C=Ya(k,T.mode,V,be),C.return=T,C):(C=a(C,k),C.return=T,C)}function F(T,C,k){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=mr(""+C,T.mode,k),C.return=T,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case R:return k=ku(C.type,C.key,C.props,null,T.mode,k),Ns(k,C),k.return=T,k;case A:return C=pr(C,T.mode,k),C.return=T,C;case P:return C=Va(C),F(T,C,k)}if(_e(C)||ce(C))return C=Ya(C,T.mode,k,null),C.return=T,C;if(typeof C.then=="function")return F(T,Uu(C),k);if(C.$$typeof===W)return F(T,Ru(T,C),k);Hu(T,C)}return null}function _(T,C,k,V){var be=C!==null?C.key:null;if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return be!==null?null:g(T,C,""+k,V);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case R:return k.key===be?S(T,C,k,V):null;case A:return k.key===be?O(T,C,k,V):null;case P:return k=Va(k),_(T,C,k,V)}if(_e(k)||ce(k))return be!==null?null:X(T,C,k,V,null);if(typeof k.then=="function")return _(T,C,Uu(k),V);if(k.$$typeof===W)return _(T,C,Ru(T,k),V);Hu(T,k)}return null}function H(T,C,k,V,be){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return T=T.get(k)||null,g(C,T,""+V,be);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case R:return T=T.get(V.key===null?k:V.key)||null,S(C,T,V,be);case A:return T=T.get(V.key===null?k:V.key)||null,O(C,T,V,be);case P:return V=Va(V),H(T,C,k,V,be)}if(_e(V)||ce(V))return T=T.get(k)||null,X(C,T,V,be,null);if(typeof V.then=="function")return H(T,C,k,Uu(V),be);if(V.$$typeof===W)return H(T,C,k,Ru(C,V),be);Hu(C,V)}return null}function ge(T,C,k,V){for(var be=null,Ve=null,xe=C,Re=C=0,Ye=null;xe!==null&&Re<k.length;Re++){xe.index>Re?(Ye=xe,xe=null):Ye=xe.sibling;var Ke=_(T,xe,k[Re],V);if(Ke===null){xe===null&&(xe=Ye);break}e&&xe&&Ke.alternate===null&&t(T,xe),C=s(Ke,C,Re),Ve===null?be=Ke:Ve.sibling=Ke,Ve=Ke,xe=Ye}if(Re===k.length)return n(T,xe),Ge&&Sl(T,Re),be;if(xe===null){for(;Re<k.length;Re++)xe=F(T,k[Re],V),xe!==null&&(C=s(xe,C,Re),Ve===null?be=xe:Ve.sibling=xe,Ve=xe);return Ge&&Sl(T,Re),be}for(xe=l(xe);Re<k.length;Re++)Ye=H(xe,T,Re,k[Re],V),Ye!==null&&(e&&Ye.alternate!==null&&xe.delete(Ye.key===null?Re:Ye.key),C=s(Ye,C,Re),Ve===null?be=Ye:Ve.sibling=Ye,Ve=Ye);return e&&xe.forEach(function(ya){return t(T,ya)}),Ge&&Sl(T,Re),be}function Ce(T,C,k,V){if(k==null)throw Error(r(151));for(var be=null,Ve=null,xe=C,Re=C=0,Ye=null,Ke=k.next();xe!==null&&!Ke.done;Re++,Ke=k.next()){xe.index>Re?(Ye=xe,xe=null):Ye=xe.sibling;var ya=_(T,xe,Ke.value,V);if(ya===null){xe===null&&(xe=Ye);break}e&&xe&&ya.alternate===null&&t(T,xe),C=s(ya,C,Re),Ve===null?be=ya:Ve.sibling=ya,Ve=ya,xe=Ye}if(Ke.done)return n(T,xe),Ge&&Sl(T,Re),be;if(xe===null){for(;!Ke.done;Re++,Ke=k.next())Ke=F(T,Ke.value,V),Ke!==null&&(C=s(Ke,C,Re),Ve===null?be=Ke:Ve.sibling=Ke,Ve=Ke);return Ge&&Sl(T,Re),be}for(xe=l(xe);!Ke.done;Re++,Ke=k.next())Ke=H(xe,T,Re,Ke.value,V),Ke!==null&&(e&&Ke.alternate!==null&&xe.delete(Ke.key===null?Re:Ke.key),C=s(Ke,C,Re),Ve===null?be=Ke:Ve.sibling=Ke,Ve=Ke);return e&&xe.forEach(function(Rp){return t(T,Rp)}),Ge&&Sl(T,Re),be}function it(T,C,k,V){if(typeof k=="object"&&k!==null&&k.type===K&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case R:e:{for(var be=k.key;C!==null;){if(C.key===be){if(be=k.type,be===K){if(C.tag===7){n(T,C.sibling),V=a(C,k.props.children),V.return=T,T=V;break e}}else if(C.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===P&&Va(be)===C.type){n(T,C.sibling),V=a(C,k.props),Ns(V,k),V.return=T,T=V;break e}n(T,C);break}else t(T,C);C=C.sibling}k.type===K?(V=Ya(k.props.children,T.mode,V,k.key),V.return=T,T=V):(V=ku(k.type,k.key,k.props,null,T.mode,V),Ns(V,k),V.return=T,T=V)}return d(T);case A:e:{for(be=k.key;C!==null;){if(C.key===be)if(C.tag===4&&C.stateNode.containerInfo===k.containerInfo&&C.stateNode.implementation===k.implementation){n(T,C.sibling),V=a(C,k.children||[]),V.return=T,T=V;break e}else{n(T,C);break}else t(T,C);C=C.sibling}V=pr(k,T.mode,V),V.return=T,T=V}return d(T);case P:return k=Va(k),it(T,C,k,V)}if(_e(k))return ge(T,C,k,V);if(ce(k)){if(be=ce(k),typeof be!="function")throw Error(r(150));return k=be.call(k),Ce(T,C,k,V)}if(typeof k.then=="function")return it(T,C,Uu(k),V);if(k.$$typeof===W)return it(T,C,Ru(T,k),V);Hu(T,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(k=""+k,C!==null&&C.tag===6?(n(T,C.sibling),V=a(C,k),V.return=T,T=V):(n(T,C),V=mr(k,T.mode,V),V.return=T,T=V),d(T)):n(T,C)}return function(T,C,k,V){try{Ms=0;var be=it(T,C,k,V);return Bi=null,be}catch(xe){if(xe===Li||xe===Lu)throw xe;var Ve=vn(29,xe,null,T.mode);return Ve.lanes=V,Ve.return=T,Ve}}}var Fa=Ff(!0),Jf=Ff(!1),ea=!1;function Nr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ar(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 ta(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function na(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(We&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,t=Du(e),Of(e,null,n),t}return Tu(e,l,t,n),Du(e)}function As(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Jn(e,n)}}function Tr(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?a=s=d:s=s.next=d,n=n.next}while(n!==null);s===null?a=s=t:s=s.next=t}else a=s=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:s,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Dr=!1;function Ts(){if(Dr){var e=_i;if(e!==null)throw e}}function Ds(e,t,n,l){Dr=!1;var a=e.updateQueue;ea=!1;var s=a.firstBaseUpdate,d=a.lastBaseUpdate,g=a.shared.pending;if(g!==null){a.shared.pending=null;var S=g,O=S.next;S.next=null,d===null?s=O:d.next=O,d=S;var X=e.alternate;X!==null&&(X=X.updateQueue,g=X.lastBaseUpdate,g!==d&&(g===null?X.firstBaseUpdate=O:g.next=O,X.lastBaseUpdate=S))}if(s!==null){var F=a.baseState;d=0,X=O=S=null,g=s;do{var _=g.lane&-536870913,H=_!==g.lane;if(H?($e&_)===_:(l&_)===_){_!==0&&_===Ri&&(Dr=!0),X!==null&&(X=X.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var ge=e,Ce=g;_=t;var it=n;switch(Ce.tag){case 1:if(ge=Ce.payload,typeof ge=="function"){F=ge.call(it,F,_);break e}F=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Ce.payload,_=typeof ge=="function"?ge.call(it,F,_):ge,_==null)break e;F=N({},F,_);break e;case 2:ea=!0}}_=g.callback,_!==null&&(e.flags|=64,H&&(e.flags|=8192),H=a.callbacks,H===null?a.callbacks=[_]:H.push(_))}else H={lane:_,tag:g.tag,payload:g.payload,callback:g.callback,next:null},X===null?(O=X=H,S=F):X=X.next=H,d|=_;if(g=g.next,g===null){if(g=a.shared.pending,g===null)break;H=g,g=H.next,H.next=null,a.lastBaseUpdate=H,a.shared.pending=null}}while(!0);X===null&&(S=F),a.baseState=S,a.firstBaseUpdate=O,a.lastBaseUpdate=X,s===null&&(a.shared.lanes=0),ua|=d,e.lanes=d,e.memoizedState=F}}function Wf(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function If(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Wf(n[e],t)}var Ui=E(null),qu=E(0);function Pf(e,t){e=Ol,te(qu,e),te(Ui,t),Ol=e|t.baseLanes}function kr(){te(qu,Ol),te(Ui,Ui.current)}function zr(){Ol=qu.current,q(Ui),q(qu)}var bn=E(null),_n=null;function la(e){var t=e.alternate;te(St,St.current&1),te(bn,e),_n===null&&(t===null||Ui.current!==null||t.memoizedState!==null)&&(_n=e)}function Or(e){te(St,St.current),te(bn,e),_n===null&&(_n=e)}function ed(e){e.tag===22?(te(St,St.current),te(bn,e),_n===null&&(_n=e)):aa()}function aa(){te(St,St.current),te(bn,bn.current)}function wn(e){q(bn),_n===e&&(_n=null),q(St)}var St=E(0);function $u(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Hc(n)||qc(n)))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 Cl=0,ze=null,lt=null,Mt=null,Yu=!1,Hi=!1,Ja=!1,Gu=0,ks=0,qi=null,jm=0;function yt(){throw Error(r(321))}function Rr(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Kt(e[n],t[n]))return!1;return!0}function _r(e,t,n,l,a,s){return Cl=s,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?Bd:Jr,Ja=!1,s=n(l,a),Ja=!1,Hi&&(s=nd(t,n,l,a)),td(e),s}function td(e){U.H=Rs;var t=lt!==null&<.next!==null;if(Cl=0,Mt=lt=ze=null,Yu=!1,ks=0,qi=null,t)throw Error(r(300));e===null||Nt||(e=e.dependencies,e!==null&&Ou(e)&&(Nt=!0))}function nd(e,t,n,l){ze=e;var a=0;do{if(Hi&&(qi=null),ks=0,Hi=!1,25<=a)throw Error(r(301));if(a+=1,Mt=lt=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}U.H=Ud,s=t(n,l)}while(Hi);return s}function Cm(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?zs(t):t,e=e.useState()[0],(lt!==null?lt.memoizedState:null)!==e&&(ze.flags|=1024),t}function Lr(){var e=Gu!==0;return Gu=0,e}function Br(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ur(e){if(Yu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Yu=!1}Cl=0,Mt=lt=ze=null,Hi=!1,ks=Gu=0,qi=null}function Jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?ze.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function Et(){if(lt===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=Mt===null?ze.memoizedState:Mt.next;if(t!==null)Mt=t,lt=e;else{if(e===null)throw ze.alternate===null?Error(r(467)):Error(r(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Mt===null?ze.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function Xu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zs(e){var t=ks;return ks+=1,qi===null&&(qi=[]),e=Zf(qi,e,t),t=ze,(Mt===null?t.memoizedState:Mt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?Bd:Jr),e}function Qu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return zs(e);if(e.$$typeof===W)return Bt(e)}throw Error(r(438,String(e)))}function Hr(e){var t=null,n=ze.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=ze.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Xu(),ze.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=pe;return t.index++,n}function Ml(e,t){return typeof t=="function"?t(e):t}function Zu(e){var t=Et();return qr(t,lt,e)}function qr(e,t,n){var l=e.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var a=e.baseQueue,s=l.pending;if(s!==null){if(a!==null){var d=a.next;a.next=s.next,s.next=d}t.baseQueue=a=s,l.pending=null}if(s=e.baseState,a===null)e.memoizedState=s;else{t=a.next;var g=d=null,S=null,O=t,X=!1;do{var F=O.lane&-536870913;if(F!==O.lane?($e&F)===F:(Cl&F)===F){var _=O.revertLane;if(_===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null}),F===Ri&&(X=!0);else if((Cl&_)===_){O=O.next,_===Ri&&(X=!0);continue}else F={lane:0,revertLane:O.revertLane,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},S===null?(g=S=F,d=s):S=S.next=F,ze.lanes|=_,ua|=_;F=O.action,Ja&&n(s,F),s=O.hasEagerState?O.eagerState:n(s,F)}else _={lane:F,revertLane:O.revertLane,gesture:O.gesture,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},S===null?(g=S=_,d=s):S=S.next=_,ze.lanes|=F,ua|=F;O=O.next}while(O!==null&&O!==t);if(S===null?d=s:S.next=g,!Kt(s,e.memoizedState)&&(Nt=!0,X&&(n=_i,n!==null)))throw n;e.memoizedState=s,e.baseState=d,e.baseQueue=S,l.lastRenderedState=s}return a===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function $r(e){var t=Et(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var l=n.dispatch,a=n.pending,s=t.memoizedState;if(a!==null){n.pending=null;var d=a=a.next;do s=e(s,d.action),d=d.next;while(d!==a);Kt(s,t.memoizedState)||(Nt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,l]}function ld(e,t,n){var l=ze,a=Et(),s=Ge;if(s){if(n===void 0)throw Error(r(407));n=n()}else n=t();var d=!Kt((lt||a).memoizedState,n);if(d&&(a.memoizedState=n,Nt=!0),a=a.queue,Xr(sd.bind(null,l,a,e),[e]),a.getSnapshot!==t||d||Mt!==null&&Mt.memoizedState.tag&1){if(l.flags|=2048,$i(9,{destroy:void 0},id.bind(null,l,a,n,t),null),ot===null)throw Error(r(349));s||(Cl&127)!==0||ad(l,t,n)}return n}function ad(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ze.updateQueue,t===null?(t=Xu(),ze.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function id(e,t,n,l){t.value=n,t.getSnapshot=l,ud(t)&&od(e)}function sd(e,t,n){return n(function(){ud(t)&&od(e)})}function ud(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Kt(e,n)}catch{return!0}}function od(e){var t=$a(e,2);t!==null&&cn(t,e,2)}function Yr(e){var t=Jt();if(typeof e=="function"){var n=e;if(e=n(),Ja){Cn(!0);try{n()}finally{Cn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:e},t}function rd(e,t,n,l){return e.baseState=n,qr(e,lt,typeof l=="function"?l:Ml)}function Mm(e,t,n,l,a){if(Fu(e))throw Error(r(485));if(e=t.action,e!==null){var s={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){s.listeners.push(d)}};U.T!==null?n(!0):s.isTransition=!1,l(s),n=t.pending,n===null?(s.next=t.pending=s,cd(t,s)):(s.next=n.next,t.pending=n.next=s)}}function cd(e,t){var n=t.action,l=t.payload,a=e.state;if(t.isTransition){var s=U.T,d={};U.T=d;try{var g=n(a,l),S=U.S;S!==null&&S(d,g),fd(e,t,g)}catch(O){Gr(e,t,O)}finally{s!==null&&d.types!==null&&(s.types=d.types),U.T=s}}else try{s=n(a,l),fd(e,t,s)}catch(O){Gr(e,t,O)}}function fd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){dd(e,t,l)},function(l){return Gr(e,t,l)}):dd(e,t,n)}function dd(e,t,n){t.status="fulfilled",t.value=n,hd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,cd(e,n)))}function Gr(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,hd(t),t=t.next;while(t!==l)}e.action=null}function hd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function md(e,t){return t}function pd(e,t){if(Ge){var n=ot.formState;if(n!==null){e:{var l=ze;if(Ge){if(ft){t:{for(var a=ft,s=Rn;a.nodeType!==8;){if(!s){a=null;break t}if(a=Ln(a.nextSibling),a===null){a=null;break t}}s=a.data,a=s==="F!"||s==="F"?a:null}if(a){ft=Ln(a.nextSibling),l=a.data==="F!";break e}}Il(l)}l=!1}l&&(t=n[0])}}return n=Jt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:md,lastRenderedState:t},n.queue=l,n=Rd.bind(null,ze,l),l.dispatch=n,l=Yr(!1),s=Fr.bind(null,ze,!1,l.queue),l=Jt(),a={state:t,dispatch:null,action:e,pending:null},l.queue=a,n=Mm.bind(null,ze,a,s,n),a.dispatch=n,l.memoizedState=e,[t,n,!1]}function gd(e){var t=Et();return yd(t,lt,e)}function yd(e,t,n){if(t=qr(e,t,md)[0],e=Zu(Ml)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=zs(t)}catch(d){throw d===Li?Lu:d}else l=t;t=Et();var a=t.queue,s=a.dispatch;return n!==t.memoizedState&&(ze.flags|=2048,$i(9,{destroy:void 0},Nm.bind(null,a,n),null)),[l,s,e]}function Nm(e,t){e.action=t}function xd(e){var t=Et(),n=lt;if(n!==null)return yd(t,n,e);Et(),t=t.memoizedState,n=Et();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function $i(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=ze.updateQueue,t===null&&(t=Xu(),ze.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function vd(){return Et().memoizedState}function Vu(e,t,n,l){var a=Jt();ze.flags|=e,a.memoizedState=$i(1|t,{destroy:void 0},n,l===void 0?null:l)}function Ku(e,t,n,l){var a=Et();l=l===void 0?null:l;var s=a.memoizedState.inst;lt!==null&&l!==null&&Rr(l,lt.memoizedState.deps)?a.memoizedState=$i(t,s,n,l):(ze.flags|=e,a.memoizedState=$i(1|t,s,n,l))}function bd(e,t){Vu(8390656,8,e,t)}function Xr(e,t){Ku(2048,8,e,t)}function Am(e){ze.flags|=4;var t=ze.updateQueue;if(t===null)t=Xu(),ze.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function wd(e){var t=Et().memoizedState;return Am({ref:t,nextImpl:e}),function(){if((We&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Sd(e,t){return Ku(4,2,e,t)}function Ed(e,t){return Ku(4,4,e,t)}function jd(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Cd(e,t,n){n=n!=null?n.concat([e]):null,Ku(4,4,jd.bind(null,t,e),n)}function Qr(){}function Md(e,t){var n=Et();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&Rr(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Nd(e,t){var n=Et();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&Rr(t,l[1]))return l[0];if(l=e(),Ja){Cn(!0);try{e()}finally{Cn(!1)}}return n.memoizedState=[l,t],l}function Zr(e,t,n){return n===void 0||(Cl&1073741824)!==0&&($e&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Ah(),ze.lanes|=e,ua|=e,n)}function Ad(e,t,n,l){return Kt(n,t)?n:Ui.current!==null?(e=Zr(e,n,l),Kt(e,t)||(Nt=!0),e):(Cl&42)===0||(Cl&1073741824)!==0&&($e&261930)===0?(Nt=!0,e.memoizedState=n):(e=Ah(),ze.lanes|=e,ua|=e,t)}function Td(e,t,n,l,a){var s=I.p;I.p=s!==0&&8>s?s:8;var d=U.T,g={};U.T=g,Fr(e,!1,t,n);try{var S=a(),O=U.S;if(O!==null&&O(g,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var X=Em(S,l);Os(e,t,X,jn(e))}else Os(e,t,l,jn(e))}catch(F){Os(e,t,{then:function(){},status:"rejected",reason:F},jn())}finally{I.p=s,d!==null&&g.types!==null&&(d.types=g.types),U.T=d}}function Tm(){}function Vr(e,t,n,l){if(e.tag!==5)throw Error(r(476));var a=Dd(e).queue;Td(e,a,t,ie,n===null?Tm:function(){return kd(e),n(l)})}function Dd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:ie},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function kd(e){var t=Dd(e);t.next===null&&(t=e.alternate.memoizedState),Os(e,t.next.queue,{},jn())}function Kr(){return Bt(Js)}function zd(){return Et().memoizedState}function Od(){return Et().memoizedState}function Dm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jn();e=ta(n);var l=na(t,e,n);l!==null&&(cn(l,t,n),As(l,t,n)),t={cache:Er()},e.payload=t;return}t=t.return}}function km(e,t,n){var l=jn();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Fu(e)?_d(t,n):(n=dr(e,t,n,l),n!==null&&(cn(n,e,l),Ld(n,t,l)))}function Rd(e,t,n){var l=jn();Os(e,t,n,l)}function Os(e,t,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fu(e))_d(t,a);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var d=t.lastRenderedState,g=s(d,n);if(a.hasEagerState=!0,a.eagerState=g,Kt(g,d))return Tu(e,t,a,0),ot===null&&Au(),!1}catch{}if(n=dr(e,t,a,l),n!==null)return cn(n,e,l),Ld(n,t,l),!0}return!1}function Fr(e,t,n,l){if(l={lane:2,revertLane:Nc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Fu(e)){if(t)throw Error(r(479))}else t=dr(e,n,l,2),t!==null&&cn(t,e,2)}function Fu(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function _d(e,t){Hi=Yu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ld(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Jn(e,n)}}var Rs={readContext:Bt,use:Qu,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt};Rs.useEffectEvent=yt;var Bd={readContext:Bt,use:Qu,useCallback:function(e,t){return Jt().memoizedState=[e,t===void 0?null:t],e},useContext:Bt,useEffect:bd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Vu(4194308,4,jd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vu(4194308,4,e,t)},useInsertionEffect:function(e,t){Vu(4,2,e,t)},useMemo:function(e,t){var n=Jt();t=t===void 0?null:t;var l=e();if(Ja){Cn(!0);try{e()}finally{Cn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Jt();if(n!==void 0){var a=n(t);if(Ja){Cn(!0);try{n(t)}finally{Cn(!1)}}}else a=t;return l.memoizedState=l.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},l.queue=e,e=e.dispatch=km.bind(null,ze,e),[l.memoizedState,e]},useRef:function(e){var t=Jt();return e={current:e},t.memoizedState=e},useState:function(e){e=Yr(e);var t=e.queue,n=Rd.bind(null,ze,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Qr,useDeferredValue:function(e,t){var n=Jt();return Zr(n,e,t)},useTransition:function(){var e=Yr(!1);return e=Td.bind(null,ze,e.queue,!0,!1),Jt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=ze,a=Jt();if(Ge){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),ot===null)throw Error(r(349));($e&127)!==0||ad(l,t,n)}a.memoizedState=n;var s={value:n,getSnapshot:t};return a.queue=s,bd(sd.bind(null,l,s,e),[e]),l.flags|=2048,$i(9,{destroy:void 0},id.bind(null,l,s,n,t),null),n},useId:function(){var e=Jt(),t=ot.identifierPrefix;if(Ge){var n=tl,l=el;n=(l&~(1<<32-ct(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Gu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=jm++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Kr,useFormState:pd,useActionState:pd,useOptimistic:function(e){var t=Jt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Fr.bind(null,ze,!0,n),n.dispatch=t,[e,t]},useMemoCache:Hr,useCacheRefresh:function(){return Jt().memoizedState=Dm.bind(null,ze)},useEffectEvent:function(e){var t=Jt(),n={impl:e};return t.memoizedState=n,function(){if((We&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},Jr={readContext:Bt,use:Qu,useCallback:Md,useContext:Bt,useEffect:Xr,useImperativeHandle:Cd,useInsertionEffect:Sd,useLayoutEffect:Ed,useMemo:Nd,useReducer:Zu,useRef:vd,useState:function(){return Zu(Ml)},useDebugValue:Qr,useDeferredValue:function(e,t){var n=Et();return Ad(n,lt.memoizedState,e,t)},useTransition:function(){var e=Zu(Ml)[0],t=Et().memoizedState;return[typeof e=="boolean"?e:zs(e),t]},useSyncExternalStore:ld,useId:zd,useHostTransitionStatus:Kr,useFormState:gd,useActionState:gd,useOptimistic:function(e,t){var n=Et();return rd(n,lt,e,t)},useMemoCache:Hr,useCacheRefresh:Od};Jr.useEffectEvent=wd;var Ud={readContext:Bt,use:Qu,useCallback:Md,useContext:Bt,useEffect:Xr,useImperativeHandle:Cd,useInsertionEffect:Sd,useLayoutEffect:Ed,useMemo:Nd,useReducer:$r,useRef:vd,useState:function(){return $r(Ml)},useDebugValue:Qr,useDeferredValue:function(e,t){var n=Et();return lt===null?Zr(n,e,t):Ad(n,lt.memoizedState,e,t)},useTransition:function(){var e=$r(Ml)[0],t=Et().memoizedState;return[typeof e=="boolean"?e:zs(e),t]},useSyncExternalStore:ld,useId:zd,useHostTransitionStatus:Kr,useFormState:xd,useActionState:xd,useOptimistic:function(e,t){var n=Et();return lt!==null?rd(n,lt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Hr,useCacheRefresh:Od};Ud.useEffectEvent=wd;function Wr(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:N({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ir={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=jn(),a=ta(l);a.payload=t,n!=null&&(a.callback=n),t=na(e,a,l),t!==null&&(cn(t,e,l),As(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=jn(),a=ta(l);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=na(e,a,l),t!==null&&(cn(t,e,l),As(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jn(),l=ta(n);l.tag=2,t!=null&&(l.callback=t),t=na(e,l,n),t!==null&&(cn(t,e,n),As(t,e,n))}};function Hd(e,t,n,l,a,s,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,s,d):t.prototype&&t.prototype.isPureReactComponent?!Ua(n,l)||!Ua(a,s):!0}function qd(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Ir.enqueueReplaceState(t,t.state,null)}function Wa(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=N({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function $d(e){qa(e)}function Yd(e){console.error(e)}function Gd(e){qa(e)}function Ju(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Xd(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Pr(e,t,n){return n=ta(n),n.tag=3,n.payload={element:null},n.callback=function(){Ju(e,t)},n}function Qd(e){return e=ta(e),e.tag=3,e}function Zd(e,t,n,l){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var s=l.value;e.payload=function(){return a(s)},e.callback=function(){Xd(t,n,l)}}var d=n.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){Xd(t,n,l),typeof a!="function"&&(oa===null?oa=new Set([this]):oa.add(this));var g=l.stack;this.componentDidCatch(l.value,{componentStack:g!==null?g:""})})}function zm(e,t,n,l,a){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Oi(t,n,a,!0),n=bn.current,n!==null){switch(n.tag){case 31:case 13:return _n===null?oo():n.alternate===null&&xt===0&&(xt=3),n.flags&=-257,n.flags|=65536,n.lanes=a,l===Bu?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),jc(e,l,a)),!1;case 22:return n.flags|=65536,l===Bu?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),jc(e,l,a)),!1}throw Error(r(435,n.tag))}return jc(e,l,a),oo(),!1}if(Ge)return t=bn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,l!==xr&&(e=Error(r(422),{cause:l}),Es(kn(e,n)))):(l!==xr&&(t=Error(r(423),{cause:l}),Es(kn(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,l=kn(l,n),a=Pr(e.stateNode,l,a),Tr(e,a),xt!==4&&(xt=2)),!1;var s=Error(r(520),{cause:l});if(s=kn(s,n),Ys===null?Ys=[s]:Ys.push(s),xt!==4&&(xt=2),t===null)return!0;l=kn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Pr(n.stateNode,l,e),Tr(n,e),!1;case 1:if(t=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(oa===null||!oa.has(s))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Qd(a),Zd(a,e,n,l),Tr(n,a),!1}n=n.return}while(n!==null);return!1}var ec=Error(r(461)),Nt=!1;function Ut(e,t,n,l){t.child=e===null?Jf(t,null,n,l):Fa(t,e.child,n,l)}function Vd(e,t,n,l,a){n=n.render;var s=t.ref;if("ref"in l){var d={};for(var g in l)g!=="ref"&&(d[g]=l[g])}else d=l;return Qa(t),l=_r(e,t,n,d,s,a),g=Lr(),e!==null&&!Nt?(Br(e,t,a),Nl(e,t,a)):(Ge&&g&&gr(t),t.flags|=1,Ut(e,t,l,a),t.child)}function Kd(e,t,n,l,a){if(e===null){var s=n.type;return typeof s=="function"&&!hr(s)&&s.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=s,Fd(e,t,s,l,a)):(e=ku(n.type,null,l,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!oc(e,a)){var d=s.memoizedProps;if(n=n.compare,n=n!==null?n:Ua,n(d,l)&&e.ref===t.ref)return Nl(e,t,a)}return t.flags|=1,e=wl(s,l),e.ref=t.ref,e.return=t,t.child=e}function Fd(e,t,n,l,a){if(e!==null){var s=e.memoizedProps;if(Ua(s,l)&&e.ref===t.ref)if(Nt=!1,t.pendingProps=l=s,oc(e,a))(e.flags&131072)!==0&&(Nt=!0);else return t.lanes=e.lanes,Nl(e,t,a)}return tc(e,t,n,l,a)}function Jd(e,t,n,l){var a=l.children,s=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(s=s!==null?s.baseLanes|n:n,e!==null){for(l=t.child=e.child,a=0;l!==null;)a=a|l.lanes|l.childLanes,l=l.sibling;l=a&~s}else l=0,t.child=null;return Wd(e,t,s,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&_u(t,s!==null?s.cachePool:null),s!==null?Pf(t,s):kr(),ed(t);else return l=t.lanes=536870912,Wd(e,t,s!==null?s.baseLanes|n:n,n,l)}else s!==null?(_u(t,s.cachePool),Pf(t,s),aa(),t.memoizedState=null):(e!==null&&_u(t,null),kr(),aa());return Ut(e,t,a,n),t.child}function _s(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Wd(e,t,n,l,a){var s=Cr();return s=s===null?null:{parent:Ct._currentValue,pool:s},t.memoizedState={baseLanes:n,cachePool:s},e!==null&&_u(t,null),kr(),ed(t),e!==null&&Oi(e,t,l,!0),t.childLanes=a,null}function Wu(e,t){return t=Pu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Id(e,t,n){return Fa(t,e.child,null,n),e=Wu(t,t.pendingProps),e.flags|=2,wn(t),t.memoizedState=null,e}function Om(e,t,n){var l=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ge){if(l.mode==="hidden")return e=Wu(t,l),t.lanes=536870912,_s(null,e);if(Or(t),(e=ft)?(e=c0(e,Rn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Jl!==null?{id:el,overflow:tl}:null,retryLane:536870912,hydrationErrors:null},n=_f(e),n.return=t,t.child=n,Lt=t,ft=null)):e=null,e===null)throw Il(t);return t.lanes=536870912,null}return Wu(t,l)}var s=e.memoizedState;if(s!==null){var d=s.dehydrated;if(Or(t),a)if(t.flags&256)t.flags&=-257,t=Id(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(Nt||Oi(e,t,n,!1),a=(n&e.childLanes)!==0,Nt||a){if(l=ot,l!==null&&(d=Ca(l,n),d!==0&&d!==s.retryLane))throw s.retryLane=d,$a(e,d),cn(l,e,d),ec;oo(),t=Id(e,t,n)}else e=s.treeContext,ft=Ln(d.nextSibling),Lt=t,Ge=!0,Wl=null,Rn=!1,e!==null&&Uf(t,e),t=Wu(t,l),t.flags|=4096;return t}return e=wl(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Iu(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(r(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function tc(e,t,n,l,a){return Qa(t),n=_r(e,t,n,l,void 0,a),l=Lr(),e!==null&&!Nt?(Br(e,t,a),Nl(e,t,a)):(Ge&&l&&gr(t),t.flags|=1,Ut(e,t,n,a),t.child)}function Pd(e,t,n,l,a,s){return Qa(t),t.updateQueue=null,n=nd(t,l,n,a),td(e),l=Lr(),e!==null&&!Nt?(Br(e,t,s),Nl(e,t,s)):(Ge&&l&&gr(t),t.flags|=1,Ut(e,t,n,s),t.child)}function eh(e,t,n,l,a){if(Qa(t),t.stateNode===null){var s=Ti,d=n.contextType;typeof d=="object"&&d!==null&&(s=Bt(d)),s=new n(l,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Ir,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=l,s.state=t.memoizedState,s.refs={},Nr(t),d=n.contextType,s.context=typeof d=="object"&&d!==null?Bt(d):Ti,s.state=t.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(Wr(t,n,d,l),s.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(d=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),d!==s.state&&Ir.enqueueReplaceState(s,s.state,null),Ds(t,l,s,a),Ts(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){s=t.stateNode;var g=t.memoizedProps,S=Wa(n,g);s.props=S;var O=s.context,X=n.contextType;d=Ti,typeof X=="object"&&X!==null&&(d=Bt(X));var F=n.getDerivedStateFromProps;X=typeof F=="function"||typeof s.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,X||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(g||O!==d)&&qd(t,s,l,d),ea=!1;var _=t.memoizedState;s.state=_,Ds(t,l,s,a),Ts(),O=t.memoizedState,g||_!==O||ea?(typeof F=="function"&&(Wr(t,n,F,l),O=t.memoizedState),(S=ea||Hd(t,n,S,l,_,O,d))?(X||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=O),s.props=l,s.state=O,s.context=d,l=S):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{s=t.stateNode,Ar(e,t),d=t.memoizedProps,X=Wa(n,d),s.props=X,F=t.pendingProps,_=s.context,O=n.contextType,S=Ti,typeof O=="object"&&O!==null&&(S=Bt(O)),g=n.getDerivedStateFromProps,(O=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(d!==F||_!==S)&&qd(t,s,l,S),ea=!1,_=t.memoizedState,s.state=_,Ds(t,l,s,a),Ts();var H=t.memoizedState;d!==F||_!==H||ea||e!==null&&e.dependencies!==null&&Ou(e.dependencies)?(typeof g=="function"&&(Wr(t,n,g,l),H=t.memoizedState),(X=ea||Hd(t,n,X,l,_,H,S)||e!==null&&e.dependencies!==null&&Ou(e.dependencies))?(O||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(l,H,S),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(l,H,S)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||d===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=H),s.props=l,s.state=H,s.context=S,l=X):(typeof s.componentDidUpdate!="function"||d===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),l=!1)}return s=l,Iu(e,t),l=(t.flags&128)!==0,s||l?(s=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&l?(t.child=Fa(t,e.child,null,a),t.child=Fa(t,null,n,a)):Ut(e,t,n,a),t.memoizedState=s.state,e=t.child):e=Nl(e,t,a),e}function th(e,t,n,l){return Ga(),t.flags|=256,Ut(e,t,n,l),t.child}var nc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lc(e){return{baseLanes:e,cachePool:Xf()}}function ac(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=En),e}function nh(e,t,n){var l=t.pendingProps,a=!1,s=(t.flags&128)!==0,d;if((d=s)||(d=e!==null&&e.memoizedState===null?!1:(St.current&2)!==0),d&&(a=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ge){if(a?la(t):aa(),(e=ft)?(e=c0(e,Rn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Jl!==null?{id:el,overflow:tl}:null,retryLane:536870912,hydrationErrors:null},n=_f(e),n.return=t,t.child=n,Lt=t,ft=null)):e=null,e===null)throw Il(t);return qc(e)?t.lanes=32:t.lanes=536870912,null}var g=l.children;return l=l.fallback,a?(aa(),a=t.mode,g=Pu({mode:"hidden",children:g},a),l=Ya(l,a,n,null),g.return=t,l.return=t,g.sibling=l,t.child=g,l=t.child,l.memoizedState=lc(n),l.childLanes=ac(e,d,n),t.memoizedState=nc,_s(null,l)):(la(t),ic(t,g))}var S=e.memoizedState;if(S!==null&&(g=S.dehydrated,g!==null)){if(s)t.flags&256?(la(t),t.flags&=-257,t=sc(e,t,n)):t.memoizedState!==null?(aa(),t.child=e.child,t.flags|=128,t=null):(aa(),g=l.fallback,a=t.mode,l=Pu({mode:"visible",children:l.children},a),g=Ya(g,a,n,null),g.flags|=2,l.return=t,g.return=t,l.sibling=g,t.child=l,Fa(t,e.child,null,n),l=t.child,l.memoizedState=lc(n),l.childLanes=ac(e,d,n),t.memoizedState=nc,t=_s(null,l));else if(la(t),qc(g)){if(d=g.nextSibling&&g.nextSibling.dataset,d)var O=d.dgst;d=O,l=Error(r(419)),l.stack="",l.digest=d,Es({value:l,source:null,stack:null}),t=sc(e,t,n)}else if(Nt||Oi(e,t,n,!1),d=(n&e.childLanes)!==0,Nt||d){if(d=ot,d!==null&&(l=Ca(d,n),l!==0&&l!==S.retryLane))throw S.retryLane=l,$a(e,l),cn(d,e,l),ec;Hc(g)||oo(),t=sc(e,t,n)}else Hc(g)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,ft=Ln(g.nextSibling),Lt=t,Ge=!0,Wl=null,Rn=!1,e!==null&&Uf(t,e),t=ic(t,l.children),t.flags|=4096);return t}return a?(aa(),g=l.fallback,a=t.mode,S=e.child,O=S.sibling,l=wl(S,{mode:"hidden",children:l.children}),l.subtreeFlags=S.subtreeFlags&65011712,O!==null?g=wl(O,g):(g=Ya(g,a,n,null),g.flags|=2),g.return=t,l.return=t,l.sibling=g,t.child=l,_s(null,l),l=t.child,g=e.child.memoizedState,g===null?g=lc(n):(a=g.cachePool,a!==null?(S=Ct._currentValue,a=a.parent!==S?{parent:S,pool:S}:a):a=Xf(),g={baseLanes:g.baseLanes|n,cachePool:a}),l.memoizedState=g,l.childLanes=ac(e,d,n),t.memoizedState=nc,_s(e.child,l)):(la(t),n=e.child,e=n.sibling,n=wl(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=n,t.memoizedState=null,n)}function ic(e,t){return t=Pu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Pu(e,t){return e=vn(22,e,null,t),e.lanes=0,e}function sc(e,t,n){return Fa(t,e.child,null,n),e=ic(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function lh(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),wr(e.return,t,n)}function uc(e,t,n,l,a,s){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:a,treeForkCount:s}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=n,d.tailMode=a,d.treeForkCount=s)}function ah(e,t,n){var l=t.pendingProps,a=l.revealOrder,s=l.tail;l=l.children;var d=St.current,g=(d&2)!==0;if(g?(d=d&1|2,t.flags|=128):d&=1,te(St,d),Ut(e,t,l,n),l=Ge?Ss:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&lh(e,n,t);else if(e.tag===19)lh(e,n,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(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&$u(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),uc(t,!1,a,n,s,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&$u(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}uc(t,!0,n,null,s,l);break;case"together":uc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function Nl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ua|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Oi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=wl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=wl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function oc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ou(e)))}function Rm(e,t,n){switch(t.tag){case 3:Y(t,t.stateNode.containerInfo),Pl(t,Ct,e.memoizedState.cache),Ga();break;case 27:case 5:de(t);break;case 4:Y(t,t.stateNode.containerInfo);break;case 10:Pl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Or(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(la(t),t.flags|=128,null):(n&t.child.childLanes)!==0?nh(e,t,n):(la(t),e=Nl(e,t,n),e!==null?e.sibling:null);la(t);break;case 19:var a=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(Oi(e,t,n,!1),l=(n&t.childLanes)!==0),a){if(l)return ah(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),te(St,St.current),l)break;return null;case 22:return t.lanes=0,Jd(e,t,n,t.pendingProps);case 24:Pl(t,Ct,e.memoizedState.cache)}return Nl(e,t,n)}function ih(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Nt=!0;else{if(!oc(e,n)&&(t.flags&128)===0)return Nt=!1,Rm(e,t,n);Nt=(e.flags&131072)!==0}else Nt=!1,Ge&&(t.flags&1048576)!==0&&Bf(t,Ss,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Va(t.elementType),t.type=e,typeof e=="function")hr(e)?(l=Wa(e,l),t.tag=1,t=eh(null,t,e,l,n)):(t.tag=0,t=tc(null,t,e,l,n));else{if(e!=null){var a=e.$$typeof;if(a===ee){t.tag=11,t=Vd(null,t,e,l,n);break e}else if(a===p){t.tag=14,t=Kd(null,t,e,l,n);break e}}throw t=we(e)||e,Error(r(306,t,""))}}return t;case 0:return tc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,a=Wa(l,t.pendingProps),eh(e,t,l,a,n);case 3:e:{if(Y(t,t.stateNode.containerInfo),e===null)throw Error(r(387));l=t.pendingProps;var s=t.memoizedState;a=s.element,Ar(e,t),Ds(t,l,null,n);var d=t.memoizedState;if(l=d.cache,Pl(t,Ct,l),l!==s.cache&&Sr(t,[Ct],n,!0),Ts(),l=d.element,s.isDehydrated)if(s={element:l,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=th(e,t,l,n);break e}else if(l!==a){a=kn(Error(r(424)),t),Es(a),t=th(e,t,l,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,ft=Ln(e.firstChild),Lt=t,Ge=!0,Wl=null,Rn=!0,n=Jf(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ga(),l===a){t=Nl(e,t,n);break e}Ut(e,t,l,n)}t=t.child}return t;case 26:return Iu(e,t),e===null?(n=g0(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ge||(n=t.type,e=t.pendingProps,l=go(je.current).createElement(n),l[Le]=t,l[ke]=e,Ht(l,n,e),vt(l),t.stateNode=l):t.memoizedState=g0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return de(t),e===null&&Ge&&(l=t.stateNode=h0(t.type,t.pendingProps,je.current),Lt=t,Rn=!0,a=ft,da(t.type)?($c=a,ft=Ln(l.firstChild)):ft=a),Ut(e,t,t.pendingProps.children,n),Iu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ge&&((a=l=ft)&&(l=cp(l,t.type,t.pendingProps,Rn),l!==null?(t.stateNode=l,Lt=t,ft=Ln(l.firstChild),Rn=!1,a=!0):a=!1),a||Il(t)),de(t),a=t.type,s=t.pendingProps,d=e!==null?e.memoizedProps:null,l=s.children,Lc(a,s)?l=null:d!==null&&Lc(a,d)&&(t.flags|=32),t.memoizedState!==null&&(a=_r(e,t,Cm,null,null,n),Js._currentValue=a),Iu(e,t),Ut(e,t,l,n),t.child;case 6:return e===null&&Ge&&((e=n=ft)&&(n=fp(n,t.pendingProps,Rn),n!==null?(t.stateNode=n,Lt=t,ft=null,e=!0):e=!1),e||Il(t)),null;case 13:return nh(e,t,n);case 4:return Y(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Fa(t,null,l,n):Ut(e,t,l,n),t.child;case 11:return Vd(e,t,t.type,t.pendingProps,n);case 7:return Ut(e,t,t.pendingProps,n),t.child;case 8:return Ut(e,t,t.pendingProps.children,n),t.child;case 12:return Ut(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,Pl(t,t.type,l.value),Ut(e,t,l.children,n),t.child;case 9:return a=t.type._context,l=t.pendingProps.children,Qa(t),a=Bt(a),l=l(a),t.flags|=1,Ut(e,t,l,n),t.child;case 14:return Kd(e,t,t.type,t.pendingProps,n);case 15:return Fd(e,t,t.type,t.pendingProps,n);case 19:return ah(e,t,n);case 31:return Om(e,t,n);case 22:return Jd(e,t,n,t.pendingProps);case 24:return Qa(t),l=Bt(Ct),e===null?(a=Cr(),a===null&&(a=ot,s=Er(),a.pooledCache=s,s.refCount++,s!==null&&(a.pooledCacheLanes|=n),a=s),t.memoizedState={parent:l,cache:a},Nr(t),Pl(t,Ct,a)):((e.lanes&n)!==0&&(Ar(e,t),Ds(t,null,null,n),Ts()),a=e.memoizedState,s=t.memoizedState,a.parent!==l?(a={parent:l,cache:l},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Pl(t,Ct,l)):(l=s.cache,Pl(t,Ct,l),l!==a.cache&&Sr(t,[Ct],n,!0))),Ut(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function Al(e){e.flags|=4}function rc(e,t,n,l,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(zh())e.flags|=8192;else throw Ka=Bu,Mr}else e.flags&=-16777217}function sh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!w0(t))if(zh())e.flags|=8192;else throw Ka=Bu,Mr}function eo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?oi():536870912,e.lanes|=t,Qi|=t)}function Ls(e,t){if(!Ge)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function dt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags&65011712,l|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags,l|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function _m(e,t,n){var l=t.pendingProps;switch(yr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dt(t),null;case 1:return dt(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),jl(Ct),ne(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zi(t)?Al(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,vr())),dt(t),null;case 26:var a=t.type,s=t.memoizedState;return e===null?(Al(t),s!==null?(dt(t),sh(t,s)):(dt(t),rc(t,a,null,l,n))):s?s!==e.memoizedState?(Al(t),dt(t),sh(t,s)):(dt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Al(t),dt(t),rc(t,a,e,l,n)),null;case 27:if(Oe(t),n=je.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Al(t);else{if(!l){if(t.stateNode===null)throw Error(r(166));return dt(t),null}e=oe.current,zi(t)?Hf(t):(e=h0(a,l,n),t.stateNode=e,Al(t))}return dt(t),null;case 5:if(Oe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Al(t);else{if(!l){if(t.stateNode===null)throw Error(r(166));return dt(t),null}if(s=oe.current,zi(t))Hf(t);else{var d=go(je.current);switch(s){case 1:s=d.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:s=d.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":s=d.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":s=d.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":s=d.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?d.createElement(a,{is:l.is}):d.createElement(a)}}s[Le]=t,s[ke]=l;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)s.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=s;e:switch(Ht(s,a,l),a){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Al(t)}}return dt(t),rc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Al(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(r(166));if(e=je.current,zi(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,a=Lt,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}e[Le]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||n0(e.nodeValue,n)),e||Il(t,!0)}else e=go(e).createTextNode(l),e[Le]=t,t.stateNode=e}return dt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=zi(t),n!==null){if(e===null){if(!l)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Le]=t}else Ga(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),e=!1}else n=vr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(wn(t),t):(wn(t),null);if((t.flags&128)!==0)throw Error(r(558))}return dt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=zi(t),l!==null&&l.dehydrated!==null){if(e===null){if(!a)throw Error(r(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));a[Le]=t}else Ga(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),a=!1}else a=vr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(wn(t),t):(wn(t),null)}return wn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),eo(t,t.updateQueue),dt(t),null);case 4:return ne(),e===null&&kc(t.stateNode.containerInfo),dt(t),null;case 10:return jl(t.type),dt(t),null;case 19:if(q(St),l=t.memoizedState,l===null)return dt(t),null;if(a=(t.flags&128)!==0,s=l.rendering,s===null)if(a)Ls(l,!1);else{if(xt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=$u(e),s!==null){for(t.flags|=128,Ls(l,!1),e=s.updateQueue,t.updateQueue=e,eo(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Rf(n,e),n=n.sibling;return te(St,St.current&1|2),Ge&&Sl(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Rt()>io&&(t.flags|=128,a=!0,Ls(l,!1),t.lanes=4194304)}else{if(!a)if(e=$u(s),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,eo(t,e),Ls(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!Ge)return dt(t),null}else 2*Rt()-l.renderingStartTime>io&&n!==536870912&&(t.flags|=128,a=!0,Ls(l,!1),t.lanes=4194304);l.isBackwards?(s.sibling=t.child,t.child=s):(e=l.last,e!==null?e.sibling=s:t.child=s,l.last=s)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Rt(),e.sibling=null,n=St.current,te(St,a?n&1|2:n&1),Ge&&Sl(t,l.treeForkCount),e):(dt(t),null);case 22:case 23:return wn(t),zr(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(dt(t),t.subtreeFlags&6&&(t.flags|=8192)):dt(t),n=t.updateQueue,n!==null&&eo(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&q(Za),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),jl(Ct),dt(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function Lm(e,t){switch(yr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return jl(Ct),ne(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Oe(t),null;case 31:if(t.memoizedState!==null){if(wn(t),t.alternate===null)throw Error(r(340));Ga()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(wn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ga()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(St),null;case 4:return ne(),null;case 10:return jl(t.type),null;case 22:case 23:return wn(t),zr(),e!==null&&q(Za),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return jl(Ct),null;case 25:return null;default:return null}}function uh(e,t){switch(yr(t),t.tag){case 3:jl(Ct),ne();break;case 26:case 27:case 5:Oe(t);break;case 4:ne();break;case 31:t.memoizedState!==null&&wn(t);break;case 13:wn(t);break;case 19:q(St);break;case 10:jl(t.type);break;case 22:case 23:wn(t),zr(),e!==null&&q(Za);break;case 24:jl(Ct)}}function Bs(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&e)===e){l=void 0;var s=n.create,d=n.inst;l=s(),d.destroy=l}n=n.next}while(n!==a)}}catch(g){tt(t,t.return,g)}}function ia(e,t,n){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var s=a.next;l=s;do{if((l.tag&e)===e){var d=l.inst,g=d.destroy;if(g!==void 0){d.destroy=void 0,a=t;var S=n,O=g;try{O()}catch(X){tt(a,S,X)}}}l=l.next}while(l!==s)}}catch(X){tt(t,t.return,X)}}function oh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{If(t,n)}catch(l){tt(e,e.return,l)}}}function rh(e,t,n){n.props=Wa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){tt(e,t,l)}}function Us(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(a){tt(e,t,a)}}function nl(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(a){tt(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){tt(e,t,a)}else n.current=null}function ch(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(a){tt(e,e.return,a)}}function cc(e,t,n){try{var l=e.stateNode;ap(l,e.type,n,t),l[ke]=t}catch(a){tt(e,e.return,a)}}function fh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&da(e.type)||e.tag===4}function fc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fh(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&&da(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 dc(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$t));else if(l!==4&&(l===27&&da(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(dc(e,t,n),e=e.sibling;e!==null;)dc(e,t,n),e=e.sibling}function to(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&da(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(to(e,t,n),e=e.sibling;e!==null;)to(e,t,n),e=e.sibling}function dh(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Ht(t,l,n),t[Le]=e,t[ke]=n}catch(s){tt(e,e.return,s)}}var Tl=!1,At=!1,hc=!1,hh=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function Bm(e,t){if(e=e.containerInfo,Rc=Eo,e=Nu(e),ws(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var a=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var d=0,g=-1,S=-1,O=0,X=0,F=e,_=null;t:for(;;){for(var H;F!==n||a!==0&&F.nodeType!==3||(g=d+a),F!==s||l!==0&&F.nodeType!==3||(S=d+l),F.nodeType===3&&(d+=F.nodeValue.length),(H=F.firstChild)!==null;)_=F,F=H;for(;;){if(F===e)break t;if(_===n&&++O===a&&(g=d),_===s&&++X===l&&(S=d),(H=F.nextSibling)!==null)break;F=_,_=F.parentNode}F=H}n=g===-1||S===-1?null:{start:g,end:S}}else n=null}n=n||{start:0,end:0}}else n=null;for(_c={focusedElem:e,selectionRange:n},Eo=!1,Ot=t;Ot!==null;)if(t=Ot,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ot=e;else for(;Ot!==null;){switch(t=Ot,s=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(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&s!==null){e=void 0,n=t,a=s.memoizedProps,s=s.memoizedState,l=n.stateNode;try{var ge=Wa(n.type,a);e=l.getSnapshotBeforeUpdate(ge,s),l.__reactInternalSnapshotBeforeUpdate=e}catch(Ce){tt(n,n.return,Ce)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Uc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Uc(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(r(163))}if(e=t.sibling,e!==null){e.return=t.return,Ot=e;break}Ot=t.return}}function mh(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:kl(e,n),l&4&&Bs(5,n);break;case 1:if(kl(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(d){tt(n,n.return,d)}else{var a=Wa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){tt(n,n.return,d)}}l&64&&oh(n),l&512&&Us(n,n.return);break;case 3:if(kl(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{If(e,t)}catch(d){tt(n,n.return,d)}}break;case 27:t===null&&l&4&&dh(n);case 26:case 5:kl(e,n),t===null&&l&4&&ch(n),l&512&&Us(n,n.return);break;case 12:kl(e,n);break;case 31:kl(e,n),l&4&&yh(e,n);break;case 13:kl(e,n),l&4&&xh(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Zm.bind(null,n),dp(e,n))));break;case 22:if(l=n.memoizedState!==null||Tl,!l){t=t!==null&&t.memoizedState!==null||At,a=Tl;var s=At;Tl=l,(At=t)&&!s?zl(e,n,(n.subtreeFlags&8772)!==0):kl(e,n),Tl=a,At=s}break;case 30:break;default:kl(e,n)}}function ph(e){var t=e.alternate;t!==null&&(e.alternate=null,ph(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&$l(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 ht=null,sn=!1;function Dl(e,t,n){for(n=n.child;n!==null;)gh(e,t,n),n=n.sibling}function gh(e,t,n){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(Vn,n)}catch{}switch(n.tag){case 26:At||nl(n,t),Dl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:At||nl(n,t);var l=ht,a=sn;da(n.type)&&(ht=n.stateNode,sn=!1),Dl(e,t,n),Vs(n.stateNode),ht=l,sn=a;break;case 5:At||nl(n,t);case 6:if(l=ht,a=sn,ht=null,Dl(e,t,n),ht=l,sn=a,ht!==null)if(sn)try{(ht.nodeType===9?ht.body:ht.nodeName==="HTML"?ht.ownerDocument.body:ht).removeChild(n.stateNode)}catch(s){tt(n,t,s)}else try{ht.removeChild(n.stateNode)}catch(s){tt(n,t,s)}break;case 18:ht!==null&&(sn?(e=ht,o0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Pi(e)):o0(ht,n.stateNode));break;case 4:l=ht,a=sn,ht=n.stateNode.containerInfo,sn=!0,Dl(e,t,n),ht=l,sn=a;break;case 0:case 11:case 14:case 15:ia(2,n,t),At||ia(4,n,t),Dl(e,t,n);break;case 1:At||(nl(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&rh(n,t,l)),Dl(e,t,n);break;case 21:Dl(e,t,n);break;case 22:At=(l=At)||n.memoizedState!==null,Dl(e,t,n),At=l;break;default:Dl(e,t,n)}}function yh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Pi(e)}catch(n){tt(t,t.return,n)}}}function xh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Pi(e)}catch(n){tt(t,t.return,n)}}function Um(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new hh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new hh),t;default:throw Error(r(435,e.tag))}}function no(e,t){var n=Um(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var a=Vm.bind(null,e,l);l.then(a,a)}})}function un(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var a=n[l],s=e,d=t,g=d;e:for(;g!==null;){switch(g.tag){case 27:if(da(g.type)){ht=g.stateNode,sn=!1;break e}break;case 5:ht=g.stateNode,sn=!1;break e;case 3:case 4:ht=g.stateNode.containerInfo,sn=!0;break e}g=g.return}if(ht===null)throw Error(r(160));gh(s,d,a),ht=null,sn=!1,s=a.alternate,s!==null&&(s.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vh(t,e),t=t.sibling}var Gn=null;function vh(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:un(t,e),on(e),l&4&&(ia(3,e,e.return),Bs(3,e),ia(5,e,e.return));break;case 1:un(t,e),on(e),l&512&&(At||n===null||nl(n,n.return)),l&64&&Tl&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var a=Gn;if(un(t,e),on(e),l&512&&(At||n===null||nl(n,n.return)),l&4){var s=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(l){case"title":s=a.getElementsByTagName("title")[0],(!s||s[Hn]||s[Le]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=a.createElement(l),a.head.insertBefore(s,a.querySelector("head > title"))),Ht(s,l,n),s[Le]=e,vt(s),l=s;break e;case"link":var d=v0("link","href",a).get(l+(n.href||""));if(d){for(var g=0;g<d.length;g++)if(s=d[g],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){d.splice(g,1);break t}}s=a.createElement(l),Ht(s,l,n),a.head.appendChild(s);break;case"meta":if(d=v0("meta","content",a).get(l+(n.content||""))){for(g=0;g<d.length;g++)if(s=d[g],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){d.splice(g,1);break t}}s=a.createElement(l),Ht(s,l,n),a.head.appendChild(s);break;default:throw Error(r(468,l))}s[Le]=e,vt(s),l=s}e.stateNode=l}else b0(a,e.type,e.stateNode);else e.stateNode=x0(a,l,e.memoizedProps);else s!==l?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,l===null?b0(a,e.type,e.stateNode):x0(a,l,e.memoizedProps)):l===null&&e.stateNode!==null&&cc(e,e.memoizedProps,n.memoizedProps)}break;case 27:un(t,e),on(e),l&512&&(At||n===null||nl(n,n.return)),n!==null&&l&4&&cc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(un(t,e),on(e),l&512&&(At||n===null||nl(n,n.return)),e.flags&32){a=e.stateNode;try{Xl(a,"")}catch(ge){tt(e,e.return,ge)}}l&4&&e.stateNode!=null&&(a=e.memoizedProps,cc(e,a,n!==null?n.memoizedProps:a)),l&1024&&(hc=!0);break;case 6:if(un(t,e),on(e),l&4){if(e.stateNode===null)throw Error(r(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(ge){tt(e,e.return,ge)}}break;case 3:if(vo=null,a=Gn,Gn=yo(t.containerInfo),un(t,e),Gn=a,on(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Pi(t.containerInfo)}catch(ge){tt(e,e.return,ge)}hc&&(hc=!1,bh(e));break;case 4:l=Gn,Gn=yo(e.stateNode.containerInfo),un(t,e),on(e),Gn=l;break;case 12:un(t,e),on(e);break;case 31:un(t,e),on(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,no(e,l)));break;case 13:un(t,e),on(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(ao=Rt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,no(e,l)));break;case 22:a=e.memoizedState!==null;var S=n!==null&&n.memoizedState!==null,O=Tl,X=At;if(Tl=O||a,At=X||S,un(t,e),At=X,Tl=O,on(e),l&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||S||Tl||At||Ia(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){S=n=t;try{if(s=S.stateNode,a)d=s.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{g=S.stateNode;var F=S.memoizedProps.style,_=F!=null&&F.hasOwnProperty("display")?F.display:null;g.style.display=_==null||typeof _=="boolean"?"":(""+_).trim()}}catch(ge){tt(S,S.return,ge)}}}else if(t.tag===6){if(n===null){S=t;try{S.stateNode.nodeValue=a?"":S.memoizedProps}catch(ge){tt(S,S.return,ge)}}}else if(t.tag===18){if(n===null){S=t;try{var H=S.stateNode;a?r0(H,!0):r0(S.stateNode,!1)}catch(ge){tt(S,S.return,ge)}}}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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,no(e,n))));break;case 19:un(t,e),on(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,no(e,l)));break;case 30:break;case 21:break;default:un(t,e),on(e)}}function on(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(fh(l)){n=l;break}l=l.return}if(n==null)throw Error(r(160));switch(n.tag){case 27:var a=n.stateNode,s=fc(e);to(e,s,a);break;case 5:var d=n.stateNode;n.flags&32&&(Xl(d,""),n.flags&=-33);var g=fc(e);to(e,g,d);break;case 3:case 4:var S=n.stateNode.containerInfo,O=fc(e);dc(e,O,S);break;default:throw Error(r(161))}}catch(X){tt(e,e.return,X)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function kl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mh(e,t.alternate,t),t=t.sibling}function Ia(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ia(4,t,t.return),Ia(t);break;case 1:nl(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&rh(t,t.return,n),Ia(t);break;case 27:Vs(t.stateNode);case 26:case 5:nl(t,t.return),Ia(t);break;case 22:t.memoizedState===null&&Ia(t);break;case 30:Ia(t);break;default:Ia(t)}e=e.sibling}}function zl(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,a=e,s=t,d=s.flags;switch(s.tag){case 0:case 11:case 15:zl(a,s,n),Bs(4,s);break;case 1:if(zl(a,s,n),l=s,a=l.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(O){tt(l,l.return,O)}if(l=s,a=l.updateQueue,a!==null){var g=l.stateNode;try{var S=a.shared.hiddenCallbacks;if(S!==null)for(a.shared.hiddenCallbacks=null,a=0;a<S.length;a++)Wf(S[a],g)}catch(O){tt(l,l.return,O)}}n&&d&64&&oh(s),Us(s,s.return);break;case 27:dh(s);case 26:case 5:zl(a,s,n),n&&l===null&&d&4&&ch(s),Us(s,s.return);break;case 12:zl(a,s,n);break;case 31:zl(a,s,n),n&&d&4&&yh(a,s);break;case 13:zl(a,s,n),n&&d&4&&xh(a,s);break;case 22:s.memoizedState===null&&zl(a,s,n),Us(s,s.return);break;case 30:break;default:zl(a,s,n)}t=t.sibling}}function mc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&js(n))}function pc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&js(e))}function Xn(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wh(e,t,n,l),t=t.sibling}function wh(e,t,n,l){var a=t.flags;switch(t.tag){case 0:case 11:case 15:Xn(e,t,n,l),a&2048&&Bs(9,t);break;case 1:Xn(e,t,n,l);break;case 3:Xn(e,t,n,l),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&js(e)));break;case 12:if(a&2048){Xn(e,t,n,l),e=t.stateNode;try{var s=t.memoizedProps,d=s.id,g=s.onPostCommit;typeof g=="function"&&g(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){tt(t,t.return,S)}}else Xn(e,t,n,l);break;case 31:Xn(e,t,n,l);break;case 13:Xn(e,t,n,l);break;case 23:break;case 22:s=t.stateNode,d=t.alternate,t.memoizedState!==null?s._visibility&2?Xn(e,t,n,l):Hs(e,t):s._visibility&2?Xn(e,t,n,l):(s._visibility|=2,Yi(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),a&2048&&mc(d,t);break;case 24:Xn(e,t,n,l),a&2048&&pc(t.alternate,t);break;default:Xn(e,t,n,l)}}function Yi(e,t,n,l,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,d=t,g=n,S=l,O=d.flags;switch(d.tag){case 0:case 11:case 15:Yi(s,d,g,S,a),Bs(8,d);break;case 23:break;case 22:var X=d.stateNode;d.memoizedState!==null?X._visibility&2?Yi(s,d,g,S,a):Hs(s,d):(X._visibility|=2,Yi(s,d,g,S,a)),a&&O&2048&&mc(d.alternate,d);break;case 24:Yi(s,d,g,S,a),a&&O&2048&&pc(d.alternate,d);break;default:Yi(s,d,g,S,a)}t=t.sibling}}function Hs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,a=l.flags;switch(l.tag){case 22:Hs(n,l),a&2048&&mc(l.alternate,l);break;case 24:Hs(n,l),a&2048&&pc(l.alternate,l);break;default:Hs(n,l)}t=t.sibling}}var qs=8192;function Gi(e,t,n){if(e.subtreeFlags&qs)for(e=e.child;e!==null;)Sh(e,t,n),e=e.sibling}function Sh(e,t,n){switch(e.tag){case 26:Gi(e,t,n),e.flags&qs&&e.memoizedState!==null&&jp(n,Gn,e.memoizedState,e.memoizedProps);break;case 5:Gi(e,t,n);break;case 3:case 4:var l=Gn;Gn=yo(e.stateNode.containerInfo),Gi(e,t,n),Gn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=qs,qs=16777216,Gi(e,t,n),qs=l):Gi(e,t,n));break;default:Gi(e,t,n)}}function Eh(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 $s(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Ot=l,Ch(l,e)}Eh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jh(e),e=e.sibling}function jh(e){switch(e.tag){case 0:case 11:case 15:$s(e),e.flags&2048&&ia(9,e,e.return);break;case 3:$s(e);break;case 12:$s(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,lo(e)):$s(e);break;default:$s(e)}}function lo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Ot=l,Ch(l,e)}Eh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ia(8,t,t.return),lo(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,lo(t));break;default:lo(t)}e=e.sibling}}function Ch(e,t){for(;Ot!==null;){var n=Ot;switch(n.tag){case 0:case 11:case 15:ia(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:js(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Ot=l;else e:for(n=e;Ot!==null;){l=Ot;var a=l.sibling,s=l.return;if(ph(l),l===n){Ot=null;break e}if(a!==null){a.return=s,Ot=a;break e}Ot=s}}}var Hm={getCacheForType:function(e){var t=Bt(Ct),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Bt(Ct).controller.signal}},qm=typeof WeakMap=="function"?WeakMap:Map,We=0,ot=null,Ue=null,$e=0,et=0,Sn=null,sa=!1,Xi=!1,gc=!1,Ol=0,xt=0,ua=0,Pa=0,yc=0,En=0,Qi=0,Ys=null,rn=null,xc=!1,ao=0,Mh=0,io=1/0,so=null,oa=null,Tt=0,ra=null,Zi=null,Rl=0,vc=0,bc=null,Nh=null,Gs=0,wc=null;function jn(){return(We&2)!==0&&$e!==0?$e&-$e:U.T!==null?Nc():Ae()}function Ah(){if(En===0)if(($e&536870912)===0||Ge){var e=ul;ul<<=1,(ul&3932160)===0&&(ul=262144),En=e}else En=536870912;return e=bn.current,e!==null&&(e.flags|=32),En}function cn(e,t,n){(e===ot&&(et===2||et===9)||e.cancelPendingCommit!==null)&&(Vi(e,0),ca(e,$e,En,!1)),rl(e,n),((We&2)===0||e!==ot)&&(e===ot&&((We&2)===0&&(Pa|=n),xt===4&&ca(e,$e,En,!1)),ll(e))}function Th(e,t,n){if((We&6)!==0)throw Error(r(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Fn(e,t),a=l?Gm(e,t):Ec(e,t,!0),s=l;do{if(a===0){Xi&&!l&&ca(e,t,0,!1);break}else{if(n=e.current.alternate,s&&!$m(n)){a=Ec(e,t,!1),s=!1;continue}if(a===2){if(s=t,e.errorRecoveryDisabledLanes&s)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var g=e;a=Ys;var S=g.current.memoizedState.isDehydrated;if(S&&(Vi(g,d).flags|=256),d=Ec(g,d,!1),d!==2){if(gc&&!S){g.errorRecoveryDisabledLanes|=s,Pa|=s,a=4;break e}s=rn,rn=a,s!==null&&(rn===null?rn=s:rn.push.apply(rn,s))}a=d}if(s=!1,a!==2)continue}}if(a===1){Vi(e,0),ca(e,t,0,!0);break}e:{switch(l=e,s=a,s){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t)break;case 6:ca(l,t,En,!sa);break e;case 2:rn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(a=ao+300-Rt(),10<a)){if(ca(l,t,En,!sa),It(l,0,!0)!==0)break e;Rl=t,l.timeoutHandle=s0(Dh.bind(null,l,n,rn,so,xc,t,En,Pa,Qi,sa,s,"Throttled",-0,0),a);break e}Dh(l,n,rn,so,xc,t,En,Pa,Qi,sa,s,null,-0,0)}}break}while(!0);ll(e)}function Dh(e,t,n,l,a,s,d,g,S,O,X,F,_,H){if(e.timeoutHandle=-1,F=t.subtreeFlags,F&8192||(F&16785408)===16785408){F={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$t},Sh(t,s,F);var ge=(s&62914560)===s?ao-Rt():(s&4194048)===s?Mh-Rt():0;if(ge=Cp(F,ge),ge!==null){Rl=s,e.cancelPendingCommit=ge(Uh.bind(null,e,t,s,n,l,a,d,g,S,X,F,null,_,H)),ca(e,s,d,!O);return}}Uh(e,t,s,n,l,a,d,g,S)}function $m(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var a=n[l],s=a.getSnapshot;a=a.value;try{if(!Kt(s(),a))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ca(e,t,n,l){t&=~yc,t&=~Pa,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var a=t;0<a;){var s=31-ct(a),d=1<<s;l[s]=-1,a&=~d}n!==0&&ja(e,n,t)}function uo(){return(We&6)===0?(Xs(0),!1):!0}function Sc(){if(Ue!==null){if(et===0)var e=Ue.return;else e=Ue,El=Xa=null,Ur(e),Bi=null,Ms=0,e=Ue;for(;e!==null;)uh(e.alternate,e),e=e.return;Ue=null}}function Vi(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,up(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Rl=0,Sc(),ot=e,Ue=n=wl(e.current,null),$e=t,et=0,Sn=null,sa=!1,Xi=Fn(e,t),gc=!1,Qi=En=yc=Pa=ua=xt=0,rn=Ys=null,xc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var a=31-ct(l),s=1<<a;t|=e[a],l&=~s}return Ol=t,Au(),n}function kh(e,t){ze=null,U.H=Rs,t===Li||t===Lu?(t=Vf(),et=3):t===Mr?(t=Vf(),et=4):et=t===ec?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Sn=t,Ue===null&&(xt=1,Ju(e,kn(t,e.current)))}function zh(){var e=bn.current;return e===null?!0:($e&4194048)===$e?_n===null:($e&62914560)===$e||($e&536870912)!==0?e===_n:!1}function Oh(){var e=U.H;return U.H=Rs,e===null?Rs:e}function Rh(){var e=U.A;return U.A=Hm,e}function oo(){xt=4,sa||($e&4194048)!==$e&&bn.current!==null||(Xi=!0),(ua&134217727)===0&&(Pa&134217727)===0||ot===null||ca(ot,$e,En,!1)}function Ec(e,t,n){var l=We;We|=2;var a=Oh(),s=Rh();(ot!==e||$e!==t)&&(so=null,Vi(e,t)),t=!1;var d=xt;e:do try{if(et!==0&&Ue!==null){var g=Ue,S=Sn;switch(et){case 8:Sc(),d=6;break e;case 3:case 2:case 9:case 6:bn.current===null&&(t=!0);var O=et;if(et=0,Sn=null,Ki(e,g,S,O),n&&Xi){d=0;break e}break;default:O=et,et=0,Sn=null,Ki(e,g,S,O)}}Ym(),d=xt;break}catch(X){kh(e,X)}while(!0);return t&&e.shellSuspendCounter++,El=Xa=null,We=l,U.H=a,U.A=s,Ue===null&&(ot=null,$e=0,Au()),d}function Ym(){for(;Ue!==null;)_h(Ue)}function Gm(e,t){var n=We;We|=2;var l=Oh(),a=Rh();ot!==e||$e!==t?(so=null,io=Rt()+500,Vi(e,t)):Xi=Fn(e,t);e:do try{if(et!==0&&Ue!==null){t=Ue;var s=Sn;t:switch(et){case 1:et=0,Sn=null,Ki(e,t,s,1);break;case 2:case 9:if(Qf(s)){et=0,Sn=null,Lh(t);break}t=function(){et!==2&&et!==9||ot!==e||(et=7),ll(e)},s.then(t,t);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Qf(s)?(et=0,Sn=null,Lh(t)):(et=0,Sn=null,Ki(e,t,s,7));break;case 5:var d=null;switch(Ue.tag){case 26:d=Ue.memoizedState;case 5:case 27:var g=Ue;if(d?w0(d):g.stateNode.complete){et=0,Sn=null;var S=g.sibling;if(S!==null)Ue=S;else{var O=g.return;O!==null?(Ue=O,ro(O)):Ue=null}break t}}et=0,Sn=null,Ki(e,t,s,5);break;case 6:et=0,Sn=null,Ki(e,t,s,6);break;case 8:Sc(),xt=6;break e;default:throw Error(r(462))}}Xm();break}catch(X){kh(e,X)}while(!0);return El=Xa=null,U.H=l,U.A=a,We=n,Ue!==null?0:(ot=null,$e=0,Au(),xt)}function Xm(){for(;Ue!==null&&!Ul();)_h(Ue)}function _h(e){var t=ih(e.alternate,e,Ol);e.memoizedProps=e.pendingProps,t===null?ro(e):Ue=t}function Lh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Pd(n,t,t.pendingProps,t.type,void 0,$e);break;case 11:t=Pd(n,t,t.pendingProps,t.type.render,t.ref,$e);break;case 5:Ur(t);default:uh(n,t),t=Ue=Rf(t,Ol),t=ih(n,t,Ol)}e.memoizedProps=e.pendingProps,t===null?ro(e):Ue=t}function Ki(e,t,n,l){El=Xa=null,Ur(t),Bi=null,Ms=0;var a=t.return;try{if(zm(e,a,t,n,$e)){xt=1,Ju(e,kn(n,e.current)),Ue=null;return}}catch(s){if(a!==null)throw Ue=a,s;xt=1,Ju(e,kn(n,e.current)),Ue=null;return}t.flags&32768?(Ge||l===1?e=!0:Xi||($e&536870912)!==0?e=!1:(sa=e=!0,(l===2||l===9||l===3||l===6)&&(l=bn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Bh(t,e)):ro(t)}function ro(e){var t=e;do{if((t.flags&32768)!==0){Bh(t,sa);return}e=t.return;var n=_m(t.alternate,t,Ol);if(n!==null){Ue=n;return}if(t=t.sibling,t!==null){Ue=t;return}Ue=t=e}while(t!==null);xt===0&&(xt=5)}function Bh(e,t){do{var n=Lm(e.alternate,e);if(n!==null){n.flags&=32767,Ue=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ue=e;return}Ue=e=n}while(e!==null);xt=6,Ue=null}function Uh(e,t,n,l,a,s,d,g,S){e.cancelPendingCommit=null;do co();while(Tt!==0);if((We&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(s=t.lanes|t.childLanes,s|=fr,cl(e,n,s,d,g,S),e===ot&&(Ue=ot=null,$e=0),Zi=t,ra=e,Rl=n,vc=s,bc=a,Nh=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Km(mn,function(){return Gh(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=U.T,U.T=null,a=I.p,I.p=2,d=We,We|=4;try{Bm(e,t,n)}finally{We=d,I.p=a,U.T=l}}Tt=1,Hh(),qh(),$h()}}function Hh(){if(Tt===1){Tt=0;var e=ra,t=Zi,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=U.T,U.T=null;var l=I.p;I.p=2;var a=We;We|=4;try{vh(t,e);var s=_c,d=Nu(e.containerInfo),g=s.focusedElem,S=s.selectionRange;if(d!==g&&g&&g.ownerDocument&&Mu(g.ownerDocument.documentElement,g)){if(S!==null&&ws(g)){var O=S.start,X=S.end;if(X===void 0&&(X=O),"selectionStart"in g)g.selectionStart=O,g.selectionEnd=Math.min(X,g.value.length);else{var F=g.ownerDocument||document,_=F&&F.defaultView||window;if(_.getSelection){var H=_.getSelection(),ge=g.textContent.length,Ce=Math.min(S.start,ge),it=S.end===void 0?Ce:Math.min(S.end,ge);!H.extend&&Ce>it&&(d=it,it=Ce,Ce=d);var T=bs(g,Ce),C=bs(g,it);if(T&&C&&(H.rangeCount!==1||H.anchorNode!==T.node||H.anchorOffset!==T.offset||H.focusNode!==C.node||H.focusOffset!==C.offset)){var k=F.createRange();k.setStart(T.node,T.offset),H.removeAllRanges(),Ce>it?(H.addRange(k),H.extend(C.node,C.offset)):(k.setEnd(C.node,C.offset),H.addRange(k))}}}}for(F=[],H=g;H=H.parentNode;)H.nodeType===1&&F.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<F.length;g++){var V=F[g];V.element.scrollLeft=V.left,V.element.scrollTop=V.top}}Eo=!!Rc,_c=Rc=null}finally{We=a,I.p=l,U.T=n}}e.current=t,Tt=2}}function qh(){if(Tt===2){Tt=0;var e=ra,t=Zi,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=U.T,U.T=null;var l=I.p;I.p=2;var a=We;We|=4;try{mh(e,t.alternate,t)}finally{We=a,I.p=l,U.T=n}}Tt=3}}function $h(){if(Tt===4||Tt===3){Tt=0,ii();var e=ra,t=Zi,n=Rl,l=Nh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Tt=5:(Tt=0,Zi=ra=null,Yh(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(oa=null),re(n),t=t.stateNode,pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(Vn,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=U.T,a=I.p,I.p=2,U.T=null;try{for(var s=e.onRecoverableError,d=0;d<l.length;d++){var g=l[d];s(g.value,{componentStack:g.stack})}}finally{U.T=t,I.p=a}}(Rl&3)!==0&&co(),ll(e),a=e.pendingLanes,(n&261930)!==0&&(a&42)!==0?e===wc?Gs++:(Gs=0,wc=e):Gs=0,Xs(0)}}function Yh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,js(t)))}function co(){return Hh(),qh(),$h(),Gh()}function Gh(){if(Tt!==5)return!1;var e=ra,t=vc;vc=0;var n=re(Rl),l=U.T,a=I.p;try{I.p=32>n?32:n,U.T=null,n=bc,bc=null;var s=ra,d=Rl;if(Tt=0,Zi=ra=null,Rl=0,(We&6)!==0)throw Error(r(331));var g=We;if(We|=4,jh(s.current),wh(s,s.current,d,n),We=g,Xs(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(Vn,s)}catch{}return!0}finally{I.p=a,U.T=l,Yh(e,t)}}function Xh(e,t,n){t=kn(n,t),t=Pr(e.stateNode,t,2),e=na(e,t,2),e!==null&&(rl(e,2),ll(e))}function tt(e,t,n){if(e.tag===3)Xh(e,e,n);else for(;t!==null;){if(t.tag===3){Xh(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(oa===null||!oa.has(l))){e=kn(n,e),n=Qd(2),l=na(t,n,2),l!==null&&(Zd(n,l,t,e),rl(l,2),ll(l));break}}t=t.return}}function jc(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new qm;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(gc=!0,a.add(n),e=Qm.bind(null,e,t,n),t.then(e,e))}function Qm(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ot===e&&($e&n)===n&&(xt===4||xt===3&&($e&62914560)===$e&&300>Rt()-ao?(We&2)===0&&Vi(e,0):yc|=n,Qi===$e&&(Qi=0)),ll(e)}function Qh(e,t){t===0&&(t=oi()),e=$a(e,t),e!==null&&(rl(e,t),ll(e))}function Zm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Qh(e,n)}function Vm(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(t),Qh(e,n)}function Km(e,t){return Bl(e,t)}var fo=null,Fi=null,Cc=!1,ho=!1,Mc=!1,fa=0;function ll(e){e!==Fi&&e.next===null&&(Fi===null?fo=Fi=e:Fi=Fi.next=e),ho=!0,Cc||(Cc=!0,Jm())}function Xs(e,t){if(!Mc&&ho){Mc=!0;do for(var n=!1,l=fo;l!==null;){if(e!==0){var a=l.pendingLanes;if(a===0)var s=0;else{var d=l.suspendedLanes,g=l.pingedLanes;s=(1<<31-ct(42|e)+1)-1,s&=a&~(d&~g),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,Fh(l,s))}else s=$e,s=It(l,l===ot?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||Fn(l,s)||(n=!0,Fh(l,s));l=l.next}while(n);Mc=!1}}function Fm(){Zh()}function Zh(){ho=Cc=!1;var e=0;fa!==0&&sp()&&(e=fa);for(var t=Rt(),n=null,l=fo;l!==null;){var a=l.next,s=Vh(l,t);s===0?(l.next=null,n===null?fo=a:n.next=a,a===null&&(Fi=n)):(n=l,(e!==0||(s&3)!==0)&&(ho=!0)),l=a}Tt!==0&&Tt!==5||Xs(e),fa!==0&&(fa=0)}function Vh(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var d=31-ct(s),g=1<<d,S=a[d];S===-1?((g&n)===0||(g&l)!==0)&&(a[d]=ql(g,t)):S<=t&&(e.expiredLanes|=g),s&=~g}if(t=ot,n=$e,n=It(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(et===2||et===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&al(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Fn(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&al(l),re(n)){case 2:case 8:n=il;break;case 32:n=mn;break;case 268435456:n=ui;break;default:n=mn}return l=Kh.bind(null,e),n=Bl(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&al(l),e.callbackPriority=2,e.callbackNode=null,2}function Kh(e,t){if(Tt!==0&&Tt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(co()&&e.callbackNode!==n)return null;var l=$e;return l=It(e,e===ot?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Th(e,l,t),Vh(e,Rt()),e.callbackNode!=null&&e.callbackNode===n?Kh.bind(null,e):null)}function Fh(e,t){if(co())return null;Th(e,t,!0)}function Jm(){op(function(){(We&6)!==0?Bl(Sa,Fm):Zh()})}function Nc(){if(fa===0){var e=Ri;e===0&&(e=Mn,Mn<<=1,(Mn&261888)===0&&(Mn=256)),fa=e}return fa}function Jh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ql(""+e)}function Wh(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Wm(e,t,n,l,a){if(t==="submit"&&n&&n.stateNode===a){var s=Jh((a[ke]||null).action),d=l.submitter;d&&(t=(t=d[ke]||null)?Jh(t.formAction):d.getAttribute("formAction"),t!==null&&(s=t,d=null));var g=new ka("action","action",null,l,a);e.push({event:g,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(fa!==0){var S=d?Wh(a,d):new FormData(a);Vr(n,{pending:!0,data:S,method:a.method,action:s},null,S)}}else typeof s=="function"&&(g.preventDefault(),S=d?Wh(a,d):new FormData(a),Vr(n,{pending:!0,data:S,method:a.method,action:s},s,S))},currentTarget:a}]})}}for(var Ac=0;Ac<Ha.length;Ac++){var Tc=Ha[Ac],Im=Tc.toLowerCase(),Pm=Tc[0].toUpperCase()+Tc.slice(1);ln(Im,"on"+Pm)}ln(Pe,"onAnimationEnd"),ln(mt,"onAnimationIteration"),ln(_t,"onAnimationStart"),ln("dblclick","onDoubleClick"),ln("focusin","onFocus"),ln("focusout","onBlur"),ln(Be,"onTransitionRun"),ln(zt,"onTransitionStart"),ln(wt,"onTransitionCancel"),ln(Ft,"onTransitionEnd"),Wn("onMouseEnter",["mouseout","mouseover"]),Wn("onMouseLeave",["mouseout","mouseover"]),Wn("onPointerEnter",["pointerout","pointerover"]),Wn("onPointerLeave",["pointerout","pointerover"]),en("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),en("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),en("onBeforeInput",["compositionend","keypress","textInput","paste"]),en("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),en("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),en("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qs="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(" "),ep=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Qs));function Ih(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],a=l.event;l=l.listeners;e:{var s=void 0;if(t)for(var d=l.length-1;0<=d;d--){var g=l[d],S=g.instance,O=g.currentTarget;if(g=g.listener,S!==s&&a.isPropagationStopped())break e;s=g,a.currentTarget=O;try{s(a)}catch(X){qa(X)}a.currentTarget=null,s=S}else for(d=0;d<l.length;d++){if(g=l[d],S=g.instance,O=g.currentTarget,g=g.listener,S!==s&&a.isPropagationStopped())break e;s=g,a.currentTarget=O;try{s(a)}catch(X){qa(X)}a.currentTarget=null,s=S}}}}function He(e,t){var n=t[Pt];n===void 0&&(n=t[Pt]=new Set);var l=e+"__bubble";n.has(l)||(Ph(t,e,2,!1),n.add(l))}function Dc(e,t,n){var l=0;t&&(l|=4),Ph(n,e,l,t)}var mo="_reactListening"+Math.random().toString(36).slice(2);function kc(e){if(!e[mo]){e[mo]=!0,Yl.forEach(function(n){n!=="selectionchange"&&(ep.has(n)||Dc(n,!1,e),Dc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[mo]||(t[mo]=!0,Dc("selectionchange",!1,t))}}function Ph(e,t,n,l){switch(A0(t)){case 2:var a=Ap;break;case 8:a=Tp;break;default:a=Zc}n=a.bind(null,t,n,e),a=void 0,!os||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),l?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function zc(e,t,n,l,a){var s=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var g=l.stateNode.containerInfo;if(g===a)break;if(d===4)for(d=l.return;d!==null;){var S=d.tag;if((S===3||S===4)&&d.stateNode.containerInfo===a)return;d=d.return}for(;g!==null;){if(d=Nn(g),d===null)return;if(S=d.tag,S===5||S===6||S===26||S===27){l=s=d;continue e}g=g.parentNode}}l=l.return}us(function(){var O=s,X=pi(n),F=[];e:{var _=rt.get(e);if(_!==void 0){var H=ka,ge=e;switch(e){case"keypress":if(nn(n)===0)break e;case"keydown":case"keyup":H=Te;break;case"focusin":ge="focus",H=Si;break;case"focusout":ge="blur",H=Si;break;case"beforeblur":case"afterblur":H=Si;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":H=Pn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":H=xn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":H=tr;break;case Pe:case mt:case _t:H=Io;break;case Ft:H=nr;break;case"scroll":case"scrollend":H=Wo;break;case"wheel":H=ar;break;case"copy":case"cut":case"paste":H=bt;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":H=ms;break;case"toggle":case"beforetoggle":H=sr}var Ce=(t&4)!==0,it=!Ce&&(e==="scroll"||e==="scrollend"),T=Ce?_!==null?_+"Capture":null:_;Ce=[];for(var C=O,k;C!==null;){var V=C;if(k=V.stateNode,V=V.tag,V!==5&&V!==26&&V!==27||k===null||T===null||(V=Yn(C,T),V!=null&&Ce.push(Zs(C,V,k))),it)break;C=C.return}0<Ce.length&&(_=new H(_,ge,null,n,X),F.push({event:_,listeners:Ce}))}}if((t&7)===0){e:{if(_=e==="mouseover"||e==="pointerover",H=e==="mouseout"||e==="pointerout",_&&n!==Zl&&(ge=n.relatedTarget||n.fromElement)&&(Nn(ge)||ge[ut]))break e;if((H||_)&&(_=X.window===X?X:(_=X.ownerDocument)?_.defaultView||_.parentWindow:window,H?(ge=n.relatedTarget||n.toElement,H=O,ge=ge?Nn(ge):null,ge!==null&&(it=m(ge),Ce=ge.tag,ge!==it||Ce!==5&&Ce!==27&&Ce!==6)&&(ge=null)):(H=null,ge=O),H!==ge)){if(Ce=Pn,V="onMouseLeave",T="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=ms,V="onPointerLeave",T="onPointerEnter",C="pointer"),it=H==null?_:Je(H),k=ge==null?_:Je(ge),_=new Ce(V,C+"leave",H,n,X),_.target=it,_.relatedTarget=k,V=null,Nn(X)===O&&(Ce=new Ce(T,C+"enter",ge,n,X),Ce.target=k,Ce.relatedTarget=it,V=Ce),it=V,H&&ge)t:{for(Ce=tp,T=H,C=ge,k=0,V=T;V;V=Ce(V))k++;V=0;for(var be=C;be;be=Ce(be))V++;for(;0<k-V;)T=Ce(T),k--;for(;0<V-k;)C=Ce(C),V--;for(;k--;){if(T===C||C!==null&&T===C.alternate){Ce=T;break t}T=Ce(T),C=Ce(C)}Ce=null}else Ce=null;H!==null&&e0(F,_,H,Ce,!1),ge!==null&&it!==null&&e0(F,it,ge,Ce,!0)}}e:{if(_=O?Je(O):window,H=_.nodeName&&_.nodeName.toLowerCase(),H==="select"||H==="input"&&_.type==="file")var Ve=wu;else if(bu(_))if(gs)Ve=ju;else{Ve=vs;var xe=xs}else H=_.nodeName,!H||H.toLowerCase()!=="input"||_.type!=="checkbox"&&_.type!=="radio"?O&&pl(O.elementType)&&(Ve=wu):Ve=Eu;if(Ve&&(Ve=Ve(e,O))){vl(F,Ve,n,X);break e}xe&&xe(e,_,O),e==="focusout"&&O&&_.type==="number"&&O.memoizedProps.value!=null&&ml(_,"number",_.value)}switch(xe=O?Je(O):window,e){case"focusin":(bu(xe)||xe.contentEditable==="true")&&(Fl=xe,h=O,j=null);break;case"focusout":j=h=Fl=null;break;case"mousedown":L=!0;break;case"contextmenu":case"mouseup":case"dragend":L=!1,Z(F,n,X);break;case"selectionchange":if(cr)break;case"keydown":case"keyup":Z(F,n,X)}var Re;if(Oa)e:{switch(e){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else Kl?Vl(e,n)&&(Ye="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ye="onCompositionStart");Ye&&(Mi&&n.locale!=="ko"&&(Kl||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&Kl&&(Re=vi()):(In=X,yi="value"in In?In.value:In.textContent,Kl=!0)),xe=po(O,Ye),0<xe.length&&(Ye=new Ei(Ye,e,null,n,X),F.push({event:Ye,listeners:xe}),Re?Ye.data=Re:(Re=yu(n),Re!==null&&(Ye.data=Re)))),(Re=ur?xu(e,n):Ni(e,n))&&(Ye=po(O,"onBeforeInput"),0<Ye.length&&(xe=new Ei("onBeforeInput","beforeinput",null,n,X),F.push({event:xe,listeners:Ye}),xe.data=Re)),Wm(F,e,O,n,X)}Ih(F,t)})}function Zs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function po(e,t){for(var n=t+"Capture",l=[];e!==null;){var a=e,s=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||s===null||(a=Yn(e,n),a!=null&&l.unshift(Zs(e,a,s)),a=Yn(e,t),a!=null&&l.push(Zs(e,a,s))),e.tag===3)return l;e=e.return}return[]}function tp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function e0(e,t,n,l,a){for(var s=t._reactName,d=[];n!==null&&n!==l;){var g=n,S=g.alternate,O=g.stateNode;if(g=g.tag,S!==null&&S===l)break;g!==5&&g!==26&&g!==27||O===null||(S=O,a?(O=Yn(n,s),O!=null&&d.unshift(Zs(n,O,S))):a||(O=Yn(n,s),O!=null&&d.push(Zs(n,O,S)))),n=n.return}d.length!==0&&e.push({event:t,listeners:d})}var np=/\r\n?/g,lp=/\u0000|\uFFFD/g;function t0(e){return(typeof e=="string"?e:""+e).replace(np,`
|
|
9
|
+
`).replace(lp,"")}function n0(e,t){return t=t0(t),t0(e)===t}function at(e,t,n,l,a,s){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Xl(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Xl(e,""+l);break;case"className":ci(e,"class",l);break;case"tabIndex":ci(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ci(e,n,l);break;case"style":Dt(e,l,s);break;case"data":if(t!=="object"){ci(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=Ql(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"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 s=="function"&&(n==="formAction"?(t!=="input"&&at(e,t,"name",a.name,a,null),at(e,t,"formEncType",a.formEncType,a,null),at(e,t,"formMethod",a.formMethod,a,null),at(e,t,"formTarget",a.formTarget,a,null)):(at(e,t,"encType",a.encType,a,null),at(e,t,"method",a.method,a,null),at(e,t,"target",a.target,a,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=Ql(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=$t);break;case"onScroll":l!=null&&He("scroll",e);break;case"onScrollEnd":l!=null&&He("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=Ql(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):e.removeAttribute(n);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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":He("beforetoggle",e),He("toggle",e),qn(e,"popover",l);break;case"xlinkActuate":$n(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":$n(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":$n(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":$n(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":$n(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":$n(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":$n(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":$n(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":$n(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":qn(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=qt.get(n)||n,qn(e,n,l))}}function Oc(e,t,n,l,a,s){switch(n){case"style":Dt(e,l,s);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"children":typeof l=="string"?Xl(e,l):(typeof l=="number"||typeof l=="bigint")&&Xl(e,""+l);break;case"onScroll":l!=null&&He("scroll",e);break;case"onScrollEnd":l!=null&&He("scrollend",e);break;case"onClick":l!=null&&(e.onclick=$t);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!cu.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),s=e[ke]||null,s=s!=null?s[n]:null,typeof s=="function"&&e.removeEventListener(t,s,a),typeof l=="function")){typeof s!="function"&&s!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,a);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):qn(e,n,l)}}}function Ht(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",e),He("load",e);var l=!1,a=!1,s;for(s in n)if(n.hasOwnProperty(s)){var d=n[s];if(d!=null)switch(s){case"src":l=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:at(e,t,s,d,n,null)}}a&&at(e,t,"srcSet",n.srcSet,n,null),l&&at(e,t,"src",n.src,n,null);return;case"input":He("invalid",e);var g=s=d=a=null,S=null,O=null;for(l in n)if(n.hasOwnProperty(l)){var X=n[l];if(X!=null)switch(l){case"name":a=X;break;case"type":d=X;break;case"checked":S=X;break;case"defaultChecked":O=X;break;case"value":s=X;break;case"defaultValue":g=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(137,t));break;default:at(e,t,l,X,n,null)}}hi(e,s,g,S,O,d,a,!1);return;case"select":He("invalid",e),l=d=s=null;for(a in n)if(n.hasOwnProperty(a)&&(g=n[a],g!=null))switch(a){case"value":s=g;break;case"defaultValue":d=g;break;case"multiple":l=g;default:at(e,t,a,g,n,null)}t=s,n=d,e.multiple=!!l,t!=null?Gl(e,!!l,t,!1):n!=null&&Gl(e,!!l,n,!0);return;case"textarea":He("invalid",e),s=a=l=null;for(d in n)if(n.hasOwnProperty(d)&&(g=n[d],g!=null))switch(d){case"value":l=g;break;case"defaultValue":a=g;break;case"children":s=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(r(91));break;default:at(e,t,d,g,n,null)}mi(e,l,a,s);return;case"option":for(S in n)n.hasOwnProperty(S)&&(l=n[S],l!=null)&&(S==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":at(e,t,S,l,n,null));return;case"dialog":He("beforetoggle",e),He("toggle",e),He("cancel",e),He("close",e);break;case"iframe":case"object":He("load",e);break;case"video":case"audio":for(l=0;l<Qs.length;l++)He(Qs[l],e);break;case"image":He("error",e),He("load",e);break;case"details":He("toggle",e);break;case"embed":case"source":case"link":He("error",e),He("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(O in n)if(n.hasOwnProperty(O)&&(l=n[O],l!=null))switch(O){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:at(e,t,O,l,n,null)}return;default:if(pl(t)){for(X in n)n.hasOwnProperty(X)&&(l=n[X],l!==void 0&&Oc(e,t,X,l,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(l=n[g],l!=null&&at(e,t,g,l,n,null))}function ap(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,s=null,d=null,g=null,S=null,O=null,X=null;for(H in n){var F=n[H];if(n.hasOwnProperty(H)&&F!=null)switch(H){case"checked":break;case"value":break;case"defaultValue":S=F;default:l.hasOwnProperty(H)||at(e,t,H,null,l,F)}}for(var _ in l){var H=l[_];if(F=n[_],l.hasOwnProperty(_)&&(H!=null||F!=null))switch(_){case"type":s=H;break;case"name":a=H;break;case"checked":O=H;break;case"defaultChecked":X=H;break;case"value":d=H;break;case"defaultValue":g=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(r(137,t));break;default:H!==F&&at(e,t,_,H,l,F)}}di(e,d,g,S,O,X,s,a);return;case"select":H=d=g=_=null;for(s in n)if(S=n[s],n.hasOwnProperty(s)&&S!=null)switch(s){case"value":break;case"multiple":H=S;default:l.hasOwnProperty(s)||at(e,t,s,null,l,S)}for(a in l)if(s=l[a],S=n[a],l.hasOwnProperty(a)&&(s!=null||S!=null))switch(a){case"value":_=s;break;case"defaultValue":g=s;break;case"multiple":d=s;default:s!==S&&at(e,t,a,s,l,S)}t=g,n=d,l=H,_!=null?Gl(e,!!n,_,!1):!!l!=!!n&&(t!=null?Gl(e,!!n,t,!0):Gl(e,!!n,n?[]:"",!1));return;case"textarea":H=_=null;for(g in n)if(a=n[g],n.hasOwnProperty(g)&&a!=null&&!l.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:at(e,t,g,null,l,a)}for(d in l)if(a=l[d],s=n[d],l.hasOwnProperty(d)&&(a!=null||s!=null))switch(d){case"value":_=a;break;case"defaultValue":H=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(r(91));break;default:a!==s&&at(e,t,d,a,l,s)}Na(e,_,H);return;case"option":for(var ge in n)_=n[ge],n.hasOwnProperty(ge)&&_!=null&&!l.hasOwnProperty(ge)&&(ge==="selected"?e.selected=!1:at(e,t,ge,null,l,_));for(S in l)_=l[S],H=n[S],l.hasOwnProperty(S)&&_!==H&&(_!=null||H!=null)&&(S==="selected"?e.selected=_&&typeof _!="function"&&typeof _!="symbol":at(e,t,S,_,l,H));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 Ce in n)_=n[Ce],n.hasOwnProperty(Ce)&&_!=null&&!l.hasOwnProperty(Ce)&&at(e,t,Ce,null,l,_);for(O in l)if(_=l[O],H=n[O],l.hasOwnProperty(O)&&_!==H&&(_!=null||H!=null))switch(O){case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(137,t));break;default:at(e,t,O,_,l,H)}return;default:if(pl(t)){for(var it in n)_=n[it],n.hasOwnProperty(it)&&_!==void 0&&!l.hasOwnProperty(it)&&Oc(e,t,it,void 0,l,_);for(X in l)_=l[X],H=n[X],!l.hasOwnProperty(X)||_===H||_===void 0&&H===void 0||Oc(e,t,X,_,l,H);return}}for(var T in n)_=n[T],n.hasOwnProperty(T)&&_!=null&&!l.hasOwnProperty(T)&&at(e,t,T,null,l,_);for(F in l)_=l[F],H=n[F],!l.hasOwnProperty(F)||_===H||_==null&&H==null||at(e,t,F,_,l,H)}function l0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ip(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var a=n[l],s=a.transferSize,d=a.initiatorType,g=a.duration;if(s&&g&&l0(d)){for(d=0,g=a.responseEnd,l+=1;l<n.length;l++){var S=n[l],O=S.startTime;if(O>g)break;var X=S.transferSize,F=S.initiatorType;X&&l0(F)&&(S=S.responseEnd,d+=X*(S<g?1:(g-O)/(S-O)))}if(--l,t+=8*(s+d)/(a.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,_c=null;function go(e){return e.nodeType===9?e:e.ownerDocument}function a0(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 i0(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 Lc(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 Bc=null;function sp(){var e=window.event;return e&&e.type==="popstate"?e===Bc?!1:(Bc=e,!0):(Bc=null,!1)}var s0=typeof setTimeout=="function"?setTimeout:void 0,up=typeof clearTimeout=="function"?clearTimeout:void 0,u0=typeof Promise=="function"?Promise:void 0,op=typeof queueMicrotask=="function"?queueMicrotask:typeof u0<"u"?function(e){return u0.resolve(null).then(e).catch(rp)}:s0;function rp(e){setTimeout(function(){throw e})}function da(e){return e==="head"}function o0(e,t){var n=t,l=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(a),Pi(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Vs(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Vs(n);for(var s=n.firstChild;s;){var d=s.nextSibling,g=s.nodeName;s[Hn]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=d}}else n==="body"&&Vs(e.ownerDocument.body);n=a}while(n);Pi(t)}function r0(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function Uc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Uc(n),$l(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function cp(e,t,n,l){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Hn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=Ln(e.nextSibling),e===null)break}return null}function fp(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ln(e.nextSibling),e===null))return null;return e}function c0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ln(e.nextSibling),e===null))return null;return e}function Hc(e){return e.data==="$?"||e.data==="$~"}function qc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function dp(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Ln(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 $c=null;function f0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Ln(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function d0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function h0(e,t,n){switch(t=go(n),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function Vs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);$l(e)}var Bn=new Map,m0=new Set;function yo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _l=I.d;I.d={f:hp,r:mp,D:pp,C:gp,L:yp,m:xp,X:bp,S:vp,M:wp};function hp(){var e=_l.f(),t=uo();return e||t}function mp(e){var t=fl(e);t!==null&&t.tag===5&&t.type==="form"?kd(t):_l.r(e)}var Ji=typeof document>"u"?null:document;function p0(e,t,n){var l=Ji;if(l&&typeof t=="string"&&t){var a=tn(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),m0.has(a)||(m0.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement("link"),Ht(t,"link",e),vt(t),l.head.appendChild(t)))}}function pp(e){_l.D(e),p0("dns-prefetch",e,null)}function gp(e,t){_l.C(e,t),p0("preconnect",e,t)}function yp(e,t,n){_l.L(e,t,n);var l=Ji;if(l&&e&&t){var a='link[rel="preload"][as="'+tn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+tn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+tn(n.imageSizes)+'"]')):a+='[href="'+tn(e)+'"]';var s=a;switch(t){case"style":s=Wi(e);break;case"script":s=Ii(e)}Bn.has(s)||(e=N({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Bn.set(s,e),l.querySelector(a)!==null||t==="style"&&l.querySelector(Ks(s))||t==="script"&&l.querySelector(Fs(s))||(t=l.createElement("link"),Ht(t,"link",e),vt(t),l.head.appendChild(t)))}}function xp(e,t){_l.m(e,t);var n=Ji;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+tn(l)+'"][href="'+tn(e)+'"]',s=a;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Ii(e)}if(!Bn.has(s)&&(e=N({rel:"modulepreload",href:e},t),Bn.set(s,e),n.querySelector(a)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Fs(s)))return}l=n.createElement("link"),Ht(l,"link",e),vt(l),n.head.appendChild(l)}}}function vp(e,t,n){_l.S(e,t,n);var l=Ji;if(l&&e){var a=pn(l).hoistableStyles,s=Wi(e);t=t||"default";var d=a.get(s);if(!d){var g={loading:0,preload:null};if(d=l.querySelector(Ks(s)))g.loading=5;else{e=N({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Bn.get(s))&&Yc(e,n);var S=d=l.createElement("link");vt(S),Ht(S,"link",e),S._p=new Promise(function(O,X){S.onload=O,S.onerror=X}),S.addEventListener("load",function(){g.loading|=1}),S.addEventListener("error",function(){g.loading|=2}),g.loading|=4,xo(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:g},a.set(s,d)}}}function bp(e,t){_l.X(e,t);var n=Ji;if(n&&e){var l=pn(n).hoistableScripts,a=Ii(e),s=l.get(a);s||(s=n.querySelector(Fs(a)),s||(e=N({src:e,async:!0},t),(t=Bn.get(a))&&Gc(e,t),s=n.createElement("script"),vt(s),Ht(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(a,s))}}function wp(e,t){_l.M(e,t);var n=Ji;if(n&&e){var l=pn(n).hoistableScripts,a=Ii(e),s=l.get(a);s||(s=n.querySelector(Fs(a)),s||(e=N({src:e,async:!0,type:"module"},t),(t=Bn.get(a))&&Gc(e,t),s=n.createElement("script"),vt(s),Ht(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(a,s))}}function g0(e,t,n,l){var a=(a=je.current)?yo(a):null;if(!a)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Wi(n.href),n=pn(a).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Wi(n.href);var s=pn(a).hoistableStyles,d=s.get(e);if(d||(a=a.ownerDocument||a,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,d),(s=a.querySelector(Ks(e)))&&!s._p&&(d.instance=s,d.state.loading=5),Bn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Bn.set(e,n),s||Sp(a,e,n,d.state))),t&&l===null)throw Error(r(528,""));return d}if(t&&l!==null)throw Error(r(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ii(n),n=pn(a).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Wi(e){return'href="'+tn(e)+'"'}function Ks(e){return'link[rel="stylesheet"]['+e+"]"}function y0(e){return N({},e,{"data-precedence":e.precedence,precedence:null})}function Sp(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Ht(t,"link",n),vt(t),e.head.appendChild(t))}function Ii(e){return'[src="'+tn(e)+'"]'}function Fs(e){return"script[async]"+e}function x0(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+tn(n.href)+'"]');if(l)return t.instance=l,vt(l),l;var a=N({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),vt(l),Ht(l,"style",a),xo(l,n.precedence,e),t.instance=l;case"stylesheet":a=Wi(n.href);var s=e.querySelector(Ks(a));if(s)return t.state.loading|=4,t.instance=s,vt(s),s;l=y0(n),(a=Bn.get(a))&&Yc(l,a),s=(e.ownerDocument||e).createElement("link"),vt(s);var d=s;return d._p=new Promise(function(g,S){d.onload=g,d.onerror=S}),Ht(s,"link",l),t.state.loading|=4,xo(s,n.precedence,e),t.instance=s;case"script":return s=Ii(n.src),(a=e.querySelector(Fs(s)))?(t.instance=a,vt(a),a):(l=n,(a=Bn.get(s))&&(l=N({},n),Gc(l,a)),e=e.ownerDocument||e,a=e.createElement("script"),vt(a),Ht(a,"link",l),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,xo(l,n.precedence,e));return t.instance}function xo(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,s=a,d=0;d<l.length;d++){var g=l[d];if(g.dataset.precedence===t)s=g;else if(s!==a)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Yc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Gc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var vo=null;function v0(e,t,n){if(vo===null){var l=new Map,a=vo=new Map;a.set(n,l)}else a=vo,l=a.get(n),l||(l=new Map,a.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var s=n[a];if(!(s[Hn]||s[Le]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var d=s.getAttribute(t)||"";d=e+d;var g=l.get(d);g?g.push(s):l.set(d,[s])}}return l}function b0(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Ep(e,t,n){if(n===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 w0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function jp(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=Wi(l.href),s=t.querySelector(Ks(a));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=bo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,vt(s);return}s=t.ownerDocument||t,l=y0(l),(a=Bn.get(a))&&Yc(l,a),s=s.createElement("link"),vt(s);var d=s;d._p=new Promise(function(g,S){d.onload=g,d.onerror=S}),Ht(s,"link",l),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=bo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Xc=0;function Cp(e,t){return e.stylesheets&&e.count===0&&So(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&So(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&Xc===0&&(Xc=62500*ip());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&So(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>Xc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function bo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)So(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var wo=null;function So(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,wo=new Map,t.forEach(Mp,e),wo=null,bo.call(e))}function Mp(e,t){if(!(t.state.loading&4)){var n=wo.get(e);if(n)var l=n.get(null);else{n=new Map,wo.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<a.length;s++){var d=a[s];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),l=d)}l&&n.set(null,l)}a=t.instance,d=a.getAttribute("data-precedence"),s=n.get(d)||l,s===l&&n.set(null,a),n.set(d,a),this.count++,l=bo.bind(this),a.addEventListener("load",l),a.addEventListener("error",l),s?s.parentNode.insertBefore(a,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var Js={$$typeof:W,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function Np(e,t,n,l,a,s,d,g,S){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ea(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ea(0),this.hiddenUpdates=Ea(null),this.identifierPrefix=l,this.onUncaughtError=a,this.onCaughtError=s,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function S0(e,t,n,l,a,s,d,g,S,O,X,F){return e=new Np(e,t,n,d,S,O,X,F,g),t=1,s===!0&&(t|=24),s=vn(3,null,null,t),e.current=s,s.stateNode=e,t=Er(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:l,isDehydrated:n,cache:t},Nr(s),e}function E0(e){return e?(e=Ti,e):Ti}function j0(e,t,n,l,a,s){a=E0(a),l.context===null?l.context=a:l.pendingContext=a,l=ta(t),l.payload={element:n},s=s===void 0?null:s,s!==null&&(l.callback=s),n=na(e,l,t),n!==null&&(cn(n,e,t),As(n,e,t))}function C0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Qc(e,t){C0(e,t),(e=e.alternate)&&C0(e,t)}function M0(e){if(e.tag===13||e.tag===31){var t=$a(e,67108864);t!==null&&cn(t,e,67108864),Qc(e,67108864)}}function N0(e){if(e.tag===13||e.tag===31){var t=jn();t=$(t);var n=$a(e,t);n!==null&&cn(n,e,t),Qc(e,t)}}var Eo=!0;function Ap(e,t,n,l){var a=U.T;U.T=null;var s=I.p;try{I.p=2,Zc(e,t,n,l)}finally{I.p=s,U.T=a}}function Tp(e,t,n,l){var a=U.T;U.T=null;var s=I.p;try{I.p=8,Zc(e,t,n,l)}finally{I.p=s,U.T=a}}function Zc(e,t,n,l){if(Eo){var a=Vc(l);if(a===null)zc(e,t,l,jo,n),T0(e,l);else if(kp(a,e,t,n,l))l.stopPropagation();else if(T0(e,l),t&4&&-1<Dp.indexOf(e)){for(;a!==null;){var s=fl(a);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var d=Wt(s.pendingLanes);if(d!==0){var g=s;for(g.pendingLanes|=2,g.entangledLanes|=2;d;){var S=1<<31-ct(d);g.entanglements[1]|=S,d&=~S}ll(s),(We&6)===0&&(io=Rt()+500,Xs(0))}}break;case 31:case 13:g=$a(s,2),g!==null&&cn(g,s,2),uo(),Qc(s,2)}if(s=Vc(l),s===null&&zc(e,t,l,jo,n),s===a)break;a=s}a!==null&&l.stopPropagation()}else zc(e,t,l,null,n)}}function Vc(e){return e=pi(e),Kc(e)}var jo=null;function Kc(e){if(jo=null,e=Nn(e),e!==null){var t=m(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=v(t),e!==null)return e;e=null}else if(n===31){if(e=b(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return jo=e,null}function A0(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(wa()){case Sa:return 2;case il:return 8;case mn:case si:return 32;case ui:return 268435456;default:return 32}default:return 32}}var Fc=!1,ha=null,ma=null,pa=null,Ws=new Map,Is=new Map,ga=[],Dp="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 T0(e,t){switch(e){case"focusin":case"focusout":ha=null;break;case"dragenter":case"dragleave":ma=null;break;case"mouseover":case"mouseout":pa=null;break;case"pointerover":case"pointerout":Ws.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Is.delete(t.pointerId)}}function Ps(e,t,n,l,a,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:s,targetContainers:[a]},t!==null&&(t=fl(t),t!==null&&M0(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function kp(e,t,n,l,a){switch(t){case"focusin":return ha=Ps(ha,e,t,n,l,a),!0;case"dragenter":return ma=Ps(ma,e,t,n,l,a),!0;case"mouseover":return pa=Ps(pa,e,t,n,l,a),!0;case"pointerover":var s=a.pointerId;return Ws.set(s,Ps(Ws.get(s)||null,e,t,n,l,a)),!0;case"gotpointercapture":return s=a.pointerId,Is.set(s,Ps(Is.get(s)||null,e,t,n,l,a)),!0}return!1}function D0(e){var t=Nn(e.target);if(t!==null){var n=m(t);if(n!==null){if(t=n.tag,t===13){if(t=v(n),t!==null){e.blockedOn=t,ve(e.priority,function(){N0(n)});return}}else if(t===31){if(t=b(n),t!==null){e.blockedOn=t,ve(e.priority,function(){N0(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Co(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Vc(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);Zl=l,n.target.dispatchEvent(l),Zl=null}else return t=fl(n),t!==null&&M0(t),e.blockedOn=n,!1;t.shift()}return!0}function k0(e,t,n){Co(e)&&n.delete(t)}function zp(){Fc=!1,ha!==null&&Co(ha)&&(ha=null),ma!==null&&Co(ma)&&(ma=null),pa!==null&&Co(pa)&&(pa=null),Ws.forEach(k0),Is.forEach(k0)}function Mo(e,t){e.blockedOn===t&&(e.blockedOn=null,Fc||(Fc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,zp)))}var No=null;function z0(e){No!==e&&(No=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){No===e&&(No=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],a=e[t+2];if(typeof l!="function"){if(Kc(l||n)===null)continue;break}var s=fl(n);s!==null&&(e.splice(t,3),t-=3,Vr(s,{pending:!0,data:a,method:n.method,action:l},l,a))}}))}function Pi(e){function t(S){return Mo(S,e)}ha!==null&&Mo(ha,e),ma!==null&&Mo(ma,e),pa!==null&&Mo(pa,e),Ws.forEach(t),Is.forEach(t);for(var n=0;n<ga.length;n++){var l=ga[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<ga.length&&(n=ga[0],n.blockedOn===null);)D0(n),n.blockedOn===null&&ga.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var a=n[l],s=n[l+1],d=a[ke]||null;if(typeof s=="function")d||z0(n);else if(d){var g=null;if(s&&s.hasAttribute("formAction")){if(a=s,d=s[ke]||null)g=d.formAction;else if(Kc(a)!==null)continue}else g=d.action;typeof g=="function"?n[l+1]=g:(n.splice(l,3),l-=3),z0(n)}}}function O0(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(d){return a=d})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function Jc(e){this._internalRoot=e}Ao.prototype.render=Jc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var n=t.current,l=jn();j0(n,l,e,t,null,null)},Ao.prototype.unmount=Jc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;j0(e.current,2,null,e,null,null),uo(),t[ut]=null}};function Ao(e){this._internalRoot=e}Ao.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ae();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ga.length&&t!==0&&t<ga[n].priority;n++);ga.splice(n,0,e),n===0&&D0(e)}};var R0=u.version;if(R0!=="19.2.8")throw Error(r(527,R0,"19.2.8"));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=y(t),e=e!==null?M(e):null,e=e===null?null:e.stateNode,e};var Op={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var To=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!To.isDisabled&&To.supportsFiber)try{Vn=To.inject(Op),pt=To}catch{}}return tu.createRoot=function(e,t){if(!f(e))throw Error(r(299));var n=!1,l="",a=$d,s=Yd,d=Gd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=S0(e,1,!1,null,null,n,l,null,a,s,d,O0),e[ut]=t.current,kc(e),new Jc(t)},tu.hydrateRoot=function(e,t,n){if(!f(e))throw Error(r(299));var l=!1,a="",s=$d,d=Yd,g=Gd,S=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(S=n.formState)),t=S0(e,1,!0,t,n??null,l,a,S,s,d,g,O0),t.context=E0(null),n=t.current,l=jn(),l=$(l),a=ta(l),a.callback=null,na(n,a,l),n=l,t.current.lanes=n,rl(t,n),ll(t),e[ut]=t.current,kc(e),new Ao(t)},tu.version="19.2.8",tu}var X0;function Yp(){if(X0)return Pc.exports;X0=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(u){console.error(u)}}return i(),Pc.exports=$p(),Pc.exports}var Gp=Yp();function lf(i,u,c){return i+(u-i)*c}function U1(i){return i-Math.floor(i)}function af(i,u){const c=Math.floor(i),r=Math.floor(u);let f=i-c,m=u-r;f=f*f*(3-2*f),m=m*m*(3-2*m);const v=Un(c,r),b=Un(c+1,r),x=Un(c,r+1),y=Un(c+1,r+1);return v+(b-v)*f+(x-v)*m+(v-b-x+y)*f*m}function Un(i,u){const c=Math.sin(i*12.9898+u*78.233)*43758.5453;return c-Math.floor(c)}function Nf(i,u){const c=Math.PI*(3-Math.sqrt(5)),r=1-2*(i+.5)/u,f=Math.sqrt(1-r*r),m=i*c;return[f*Math.cos(m),r,f*Math.sin(m)]}function Xp(i,u){return Math.atan2(Math.sin(i-u),Math.cos(i-u))}function ni(i,u,c,r,f){const m=Math.sin(u),v=Math.cos(u),b=Math.sin(i),x=Math.cos(i);return(y,M,N)=>{const D=y*x+N*b,R=-y*b+N*x,A=M*v-R*m,K=M*m+R*v;return[c+D*f,r-A*f,K]}}function ba(i,u,c,r=.3){u.sort((f,m)=>f.z-m.z);for(const f of u){const m=f.a??1;if(m<.02)continue;const v=Math.min(1,Math.max(0,f.white)),b=Math.round((c?1-v:v)*255);i.fillStyle=`rgba(${b},${b},${b},${m})`,i.beginPath(),i.arc(f.x,f.y,Math.max(r,f.r),0,Math.PI*2),i.fill()}}function Qp(i,u,c){for(const r of u){const f=r.a??1;if(f<.02)continue;const m=Math.min(1,Math.max(0,r.white)),v=Math.round((c?1-m:m)*255);i.strokeStyle=`rgba(${v},${v},${v},${f})`,i.lineWidth=r.w,i.beginPath(),i.moveTo(r.x1,r.y1),i.lineTo(r.x2,r.y2),i.stroke()}}function li(i,u){return(i/300)**u}const Zp=(i,u,c,r,f)=>{const m=u/2,v=u/2,b=u/2*.76,x=ni(c*.4,.3,m,v,1),y=li(u,f.rsPow??.6),M=[],N=f.ghostN??150;for(let A=0;A<N;A++){const K=Nf(A,N),[G,B,Q]=x(K[0]*b,K[1]*b,K[2]*b),W=(Q/b+1)/2;M.push({x:G,y:B,z:Q,r:.8*y,white:.78,a:.1+.22*W})}const D=f.strandN??52,R=f.turns??3;for(let A=0;A<3;A++){const K=A/3*2*Math.PI;for(let G=0;G<D;G++){const B=(U1(G/D+c*.045)*2-1)*.96,Q=Math.sqrt(Math.max(0,1-B*B)),W=Math.min(1,(1-Math.abs(B))/.1),ee=B*Math.PI*R+K,ae=1+.075*Math.sin(B*Math.PI*R*2+K*2+c*.8),se=Q*b*ae,[p,P,he]=x(Math.cos(ee)*se,B*b*ae,Math.sin(ee)*se),pe=(he/b+1)/2;M.push({x:p,y:P,z:he,r:((f.rBase??1.2)+(f.rDepth??1.8)*pe)*y,white:.55-.45*pe,a:W*(.45+.55*pe)})}}ba(i,M,r,f.rMin)};function Vp(i,u,c,r){const f=2*u*c+r,m=i%f,v=new Array(u).fill(0);let b=-1;if(m<2*u*c){const x=Math.floor(m/c),y=(m-x*c)/c,M=1-(1-Math.min(1,y/.7))**3;if(x<u){for(let N=0;N<x;N++)v[N]=1;v[x]=M,b=x}else{const N=2*u-1-x;for(let D=0;D<N;D++)v[D]=1;v[N]=1-M,b=N}}return{amount:v,active:b}}function Kp(i,u,c){let[r,f,m]=i,v=!1;for(let b=0;b<u.length;b++){if(c.amount[b]<=0)continue;const x=u[b],y=x.axis===0?r:x.axis===1?f:m;if(y<x.lo||y>=x.hi)continue;b===c.active&&(v=!0);const M=x.ang*c.amount[b],N=Math.cos(M),D=Math.sin(M);if(x.axis===0){const R=f*N-m*D;m=f*D+m*N,f=R}else if(x.axis===1){const R=r*N+m*D;m=-r*D+m*N,r=R}else{const R=r*N-f*D;f=r*D+f*N,r=R}}return[r,f,m,v]}function Fp(i){const u=[];for(let c=0;c<i;c++){const r=Math.min(2,Math.floor(Un(c,2.3)*3)),f=-1+.5*Math.min(3,Math.floor(Un(c,5.9)*4)),m=Un(c,7.7)<.5?1:-1;u.push({axis:r,lo:f,hi:f+.5,ang:m*Math.PI/2})}return u}const Jp=(i,u,c,r,f)=>{const m=u/2,v=u/2,b=u/2*.82,x=.4+.06*Math.sin(c*.35),y=ni(c*.5,x,m,v,b),M=c*(.5+(1.7-.5)*(f.scanMul??1)),N=li(u,f.rsPow??.6),D=f.dimBase??1,R=[],A=f.latRings??17,K=f.lonDensity??44;for(let G=0;G<=A;G++){const B=-Math.PI/2+G/A*Math.PI,Q=Math.cos(B),W=Math.sin(B),ee=Math.max(1,Math.round(Math.abs(Q)*K));for(let ae=0;ae<ee;ae++){const se=ae/ee*2*Math.PI,[p,P,he]=y(Q*Math.cos(se),W,Q*Math.sin(se)),pe=(he+1)/2,le=Xp(se+c*.5,M),ce=Math.exp(-(le*le)/.18)*Math.max(0,he);R.push({x:p,y:P,z:he,r:((f.rBase??.6)+(f.rDepth??1.7)*pe+(f.rBoost??1)*ce)*N,white:(f.inkFar??.62)-(f.inkSpan??.54)*pe,a:D+(1-D)*Math.min(1,ce)})}}ba(i,R,r,f.rMin)},Wp=(i,u,c,r,f)=>{const m=u/2,v=u/2,b=u/2*.82,x=ni(c*.55,.35+.1*Math.sin(c*.9),m,v,b),y=li(u,f.rsPow??.6),M=f.moveCount??14,N=Fp(M),D=Vp(c,M,.42,1.2),R=[],A=f.latRings??15,K=f.lonDensity??40;for(let G=0;G<=A;G++){const B=-Math.PI/2+G/A*Math.PI,Q=Math.cos(B),W=Math.sin(B),ee=Math.max(1,Math.round(Math.abs(Q)*K));for(let ae=0;ae<ee;ae++){const se=ae/ee*2*Math.PI,[p,P,he,pe]=Kp([Q*Math.cos(se),W,Q*Math.sin(se)],N,D),[le,ce,Me]=x(p,P,he),we=(Me+1)/2;R.push({x:le,y:ce,z:Me,r:((f.rBase??.6)+(f.rDepth??1.7)*we+(pe?f.rActive??.3:0))*y,white:(f.inkFar??.62)-(f.inkSpan??.54)*we-(pe?.14:0)})}}ba(i,R,r,f.rMin)},Ip=(i,u,c,r,f)=>{const m=u/2,v=u/2,b=u/2*.874,x=ni(c*.18,.38,m,v,1),y=li(u,f.rsPow??.6),M=[],N=f.rings??15,D=f.lonDensity??40;for(let R=0;R<=N;R++){const A=-Math.PI/2+R/N*Math.PI,K=Math.cos(A),G=Math.sin(A),B=.62*Math.sin(c*2.1-R*.52)+.38*Math.sin(c*1.27+R*.83),Q=b*(.88+.105*B),W=Math.max(1,Math.round(Math.abs(K)*D));for(let ee=0;ee<W;ee++){const ae=ee/W*2*Math.PI,[se,p,P]=x(K*Math.cos(ae)*Q,G*Q,K*Math.sin(ae)*Q),he=(P/b+1)/2,pe=Math.max(0,B);M.push({x:se,y:p,z:P,r:((f.rBase??.6)+(f.rDepth??1.7)*he)*(1+.4*pe)*y,white:.66-.56*he-.1*pe})}}ba(i,M,r,f.rMin)};function Pp(i){return i*i*(3-2*i)}function H1(i){const u=i.length,c=[];let r=0;for(let f=0;f<u;f++){const m=i[f],v=i[(f+1)%u],b=Math.hypot(v[0]-m[0],v[1]-m[1]);c.push(b),r+=b}return f=>{let m=f*r,v=0;for(;m>c[v]&&v<u-1;)m-=c[v],v++;const b=i[v],x=i[(v+1)%u],y=c[v]?Math.min(1,m/c[v]):0;return[b[0]+(x[0]-b[0])*y,b[1]+(x[1]-b[1])*y]}}const eg=i=>{const u=-Math.PI/2+i*2*Math.PI;return[Math.cos(u)*.24,Math.sin(u)*.24]},tg=H1([[0,-.26],[.24,.16],[-.24,.16]]),ng=H1([[0,-.2],[.2,-.2],[.2,.2],[-.2,.2],[-.2,-.2]]),sf=[eg,tg,ng];function lg(i){return Math.max(6,Math.round(34*i))}const vf=1.4,q1=.9,uf=vf+q1,ag=(i,u,c,r,f)=>{const m=sf.length,v=c%(uf*m),b=Math.floor(v/uf),x=v-b*uf,y=x>vf?Pp((x-vf)/q1):0,M=f.spread??1,N=sf[b],D=sf[(b+1)%m],R=160,A=[];for(let P=0;P<R;P++){const he=P/R,pe=N(he),le=D(he);A.push([(pe[0]+(le[0]-pe[0])*y)*M,(pe[1]+(le[1]-pe[1])*y)*M])}const K=[];let G=0;for(let P=0;P<R;P++){const he=A[P],pe=A[(P+1)%R],le=Math.hypot(pe[0]-he[0],pe[1]-he[1]);K.push(le),G+=le}const B=lg(f.iconD??1),Q=(f.rDot??.021)*1.35*M,W=1+.02*Math.sin(x*3.1),ee=[],ae=u/2;let se=0,p=0;for(let P=0;P<B;P++){const he=P/B*G;for(;p+K[se]<he&&se<R-1;)p+=K[se],se++;const pe=A[se],le=A[(se+1)%R],ce=K[se]?Math.min(1,(he-p)/K[se]):0,Me=(pe[0]+(le[0]-pe[0])*ce)*W,we=(pe[1]+(le[1]-pe[1])*ce)*W;ee.push({x:ae+Me*u,y:ae+we*u,z:0,r:Math.max(.35,Q*u),white:.1})}ba(i,ee,r,f.rMin)},ig=(i,u,c,r,f)=>{const m=u/2,v=u/2,b=u/2*.82,x=ni(c*.12,.3,m,v,1),y=li(u,f.rsPow??.6),M=[],N=f.orbitN??12,D=f.ghostN??40,R=f.particles??3;for(let A=0;A<N;A++){const K=Un(A,1.7),G=Un(A,5.2),B=Un(A,8.9),Q=b*(.45+.52*K),W=K*2*Math.PI,ee=Math.acos(2*G-1),ae=Math.sin(ee)*Math.cos(W),se=Math.cos(ee),p=Math.sin(ee)*Math.sin(W);let P=-se,he=ae;const pe=0,le=Math.max(1e-6,Math.sqrt(P*P+he*he));P/=le,he/=le;const ce=se*pe-p*he,Me=p*P-ae*pe,we=ae*he-se*P,_e=(.25+.55*B)*(B>.5?1:-1);for(let U=0;U<D;U++){const I=U/D*2*Math.PI,[ie,Ne,Se]=x((P*Math.cos(I)+ce*Math.sin(I))*Q,(he*Math.cos(I)+Me*Math.sin(I))*Q,(pe*Math.cos(I)+we*Math.sin(I))*Q),E=(Se/Q+1)/2;M.push({x:ie,y:Ne,z:Se,r:(f.ghostR??.9)*y,white:.72,a:(f.ghostA??.5)*(.4+.6*E)})}for(let U=0;U<R;U++){const I=c*_e+U/R*2*Math.PI+G*6,[ie,Ne,Se]=x((P*Math.cos(I)+ce*Math.sin(I))*Q,(he*Math.cos(I)+Me*Math.sin(I))*Q,(pe*Math.cos(I)+we*Math.sin(I))*Q),E=(Se/Q+1)/2;M.push({x:ie,y:Ne,z:Se,r:((f.partR??1.2)+(f.partRDepth??1.6)*E)*y,white:.3-.22*E})}}ba(i,M,r,f.rMin)},Q0=(i,u,c,r,f)=>{const m=u/2,v=u/2,b=u/2*.78,x=f.spin??1,y=.3,M=ni(c*.1*x,y,m,v,1),N=li(u,f.rsPow??.6),D=[],R=f.ghostN??150;for(let we=0;we<R;we++){const _e=Nf(we,R),[U,I,ie]=M(_e[0]*b,_e[1]*b,_e[2]*b),Ne=(ie/b+1)/2;D.push({x:U,y:I,z:ie,r:.8*N,white:.78,a:.1+.22*Ne})}const A=c*.24*x,K=f.faceOn?-y:.55+.3*Math.sin(c*.18)*x,G=Math.cos(A),B=0,Q=Math.sin(A),W=-Q*Math.sin(K),ee=Math.cos(K),ae=G*Math.sin(K),se=B*ae-Q*ee,p=Q*W-G*ae,P=G*ee-B*W,he=.23*(f.wobMul??1),pe=f.faceOn?b/(1+.85*he):b,le=f.lanes??5,ce=f.segs??88,Me=Math.max(1,Math.round(le*(f.bandMul??1)));for(let we=0;we<Me;we++){const _e=(we-(Me-1)/2)*.075,U=Math.abs(we-(Me-1)/2)/Math.max(1,(Me-1)/2);for(let I=0;I<ce;I++){const ie=I/ce*2*Math.PI,Ne=(.16*Math.sin(ie*3-c*1.7+we*.22)+.07*Math.sin(ie*5+c*1.1))*(f.wobMul??1),Se=f.faceOn?1+Ne:1,E=f.faceOn?_e:_e+Ne,q=G*Math.cos(ie)+W*Math.sin(ie)+se*E,te=B*Math.cos(ie)+ee*Math.sin(ie)+p*E,oe=Q*Math.cos(ie)+ae*Math.sin(ie)+P*E,me=Math.sqrt(q*q+te*te+oe*oe),je=pe*Se,[z,Y,ne]=M(q/me*je,te/me*je,oe/me*je),de=(ne/b+1)/2;D.push({x:z,y:Y,z:ne,r:((f.rBase??1.1)+(f.rDepth??1.7)*de)*(1-.25*U)*N,white:.52-.44*de+.18*U,a:.4+.6*de})}}ba(i,D,r,f.rMin)},sg=(i,u,c,r,f)=>{const m=u/2,v=u/2,b=u/2*.8*(f.spread??1),x=ni(c*.12,.32,m,v,b),y=li(u,f.rsPow??.6),M=f.nodeN??30,N=f.thr??.72,D=f.nodeR??1.4,R=f.nodeRDepth??1.8,A=[];for(let Q=0;Q<M;Q++){const W=Nf(Q,M),ee=W[0]+.3*(af(Q*.31+9,c*.24)-.5)*2,ae=W[1]+.3*(af(Q*.53+27,c*.21)-.5)*2,se=W[2]+.3*(af(Q*.77+55,c*.27)-.5)*2,p=Math.sqrt(ee*ee+ae*ae+se*se);A.push([ee/p,ae/p,se/p])}const K=[],G=[];for(let Q=0;Q<M;Q++)for(let W=Q+1;W<M;W++){const ee=A[Q][0]-A[W][0],ae=A[Q][1]-A[W][1],se=A[Q][2]-A[W][2],p=Math.sqrt(ee*ee+ae*ae+se*se);if(p>=N)continue;const[P,he,pe]=x(A[Q][0],A[Q][1],A[Q][2]),[le,ce,Me]=x(A[W][0],A[W][1],A[W][2]),we=((pe+Me)/2+1)/2;K.push({x1:P,y1:he,x2:le,y2:ce,white:.42,a:(1-p/N)*(.3+.55*we),w:Math.max(.6,(f.lineW??.8)*y)})}for(let Q=0;Q<M;Q++){const[W,ee,ae]=x(A[Q][0],A[Q][1],A[Q][2]),se=(ae+1)/2,p=1+.25*Math.sin(c*1.4+Q*2.7);G.push({x:W,y:ee,z:ae,r:(D+R*se)*p*y,white:.55-.45*se})}const B=f.signals??5;for(let Q=0;Q<B;Q++){const W=Math.floor(c*.55+Q*7.31),ee=Math.floor(Un(W,Q*3.1+1.7)*M),ae=Math.floor(Un(W,Q*5.7+4.2)*M);if(ee===ae)continue;const se=U1(c*.55+Q*7.31),p=lf(A[ee][0],A[ae][0],se),P=lf(A[ee][1],A[ae][1],se),he=lf(A[ee][2],A[ae][2],se),pe=Math.max(1e-6,Math.sqrt(p*p+P*P+he*he)),[le,ce,Me]=x(p/pe,P/pe,he/pe),we=(Me+1)/2;G.push({x:le,y:ce,z:Me,r:(D*1.5+R*we)*y,white:.05,a:.5+.5*we})}Qp(i,K,r),ba(i,G,r,f.rMin)},ug={orbits:ig,globe:Jp,rubik:Wp,wave:Ip,web:sg,braid:Zp,ribbon:Q0,ring:Q0,morph:ag},og=[["latRings","lonDensity"],["rings","lonDensity"],["lanes","segs"]],rg=["orbitN","ghostN","nodeN","strandN","signals"],cg=["iconD"],fg=["rBase","rDepth","rActive","rDot","ghostR","partR","partRDepth","nodeR","nodeRDepth"];function dg(i,u){const c={...i},r=new Set,f=Math.sqrt(u);for(const[m,v]of og){const b=c[m],x=c[v];b!=null&&x!=null&&!r.has(m)&&!r.has(v)&&(c[m]=Math.max(2,Math.round(b*f)),c[v]=Math.max(2,Math.round(x*f)),r.add(m),r.add(v))}for(const m of rg){const v=c[m];v!=null&&v!==0&&!r.has(m)&&(c[m]=Math.max(1,Math.round(v*u)))}for(const m of cg){const v=c[m];v!=null&&(c[m]=Math.max(.02,v*u))}return c}function hg(i,u){const c={...i};for(const r of fg){const f=c[r];f!=null&&(c[r]=f*u)}return c.rSizeMul=(c.rSizeMul??1)*u,c}const mg={globe:{latRings:17,lonDensity:44,rBase:.6,rDepth:1.7,rBoost:1,inkFar:.62,inkSpan:.54,rsPow:.6,rMin:.3},orbits:{orbitN:12,ghostN:40,ghostR:.9,ghostA:.5,particles:3,partR:1.2,partRDepth:1.6,rsPow:.6,rMin:.3},rubik:{latRings:15,lonDensity:40,moveCount:14,rBase:.6,rDepth:1.7,rActive:.3,inkFar:.62,inkSpan:.54,rsPow:.6,rMin:.3},wave:{rings:15,lonDensity:40,rBase:.6,rDepth:1.7,rsPow:.6,rMin:.3},web:{nodeN:30,thr:.72,signals:5,nodeR:1.4,nodeRDepth:1.8,lineW:.8,rsPow:.6,rMin:.3},braid:{strandN:52,turns:3,ghostN:150,rBase:1.2,rDepth:1.8,rsPow:.6,rMin:.3},ribbon:{lanes:5,segs:88,ghostN:150,rBase:1.1,rDepth:1.7,rsPow:.6,rMin:.3},ring:{lanes:5,segs:88,ghostN:0,faceOn:1,rBase:1.1,rDepth:1.7,rsPow:.6,rMin:.3},morph:{rDot:.021,iconD:1,rMin:.25}},pg={working:"orbits",searching:"globe",solving:"rubik",listening:"wave",connecting:"web",weaving:"braid",composing:"ribbon",breathing:"ring",shaping:"morph"},gg={orbits:{64:{speed:1.885,count:1,size:1},20:{speed:3.9,count:.238,size:2.4}},globe:{64:{speed:2.015,count:.42,size:1.15,extra:{scanMul:4.08,dimBase:.45}},20:{speed:2.665,count:.105,size:1.75,extra:{scanMul:4.335,dimBase:.45}}},rubik:{64:{speed:1.82,count:.35,size:1.05},20:{speed:1.95,count:.088,size:1.9}},wave:{64:{speed:4.388,count:.341,size:1},20:{speed:3.998,count:.105,size:1.6}},web:{64:{speed:3.315,count:1.35,size:.95},20:{speed:6.63,count:.25,size:1.52}},braid:{64:{speed:1.625,count:.5,size:1},20:{speed:2.75,count:.1125,size:1.36}},ribbon:{64:{speed:2.34,count:.25,size:.85,extra:{spin:0,bandMul:3.9,wobMul:1}},20:{speed:3.12,count:.051,size:1.073,extra:{spin:0,bandMul:4.94,wobMul:1}}},ring:{64:{speed:3.24,count:.25,size:.956,extra:{spin:0,bandMul:3.627,wobMul:.368}},20:{speed:3.78,count:.028,size:1.622,extra:{spin:0,bandMul:3.968,wobMul:.565}}},morph:{64:{speed:2.405,count:.702,size:.395,extra:{spread:1.45}},20:{speed:2.08,count:.53,size:1.011,extra:{spread:1.45}}}},Z0=new Map;function yg(i,u){const c=`${i}-${u}`,r=Z0.get(c);if(r)return r;const f=pg[i],m=gg[f][u];let v={...mg[f]};m.count!==1&&(v=dg(v,m.count)),m.size!==1&&(v=hg(v,m.size)),m.extra&&(v={...v,...m.extra});const b={mode:f,speed:m.speed,opts:v};return Z0.set(c,b),b}function xg(i){let u=i;for(;u;){const c=u.getAttribute("data-theme");if(c==="dark")return!0;if(c==="light")return!1;if(u.classList.contains("dark"))return!0;if(u.classList.contains("light"))return!1;u=u.parentElement}return null}function vg(){return typeof matchMedia>"u"||matchMedia("(prefers-color-scheme: dark)").matches}function bg(i,u){const[c,r]=w.useState(!0);return w.useEffect(()=>{if(i==="dark"){r(!0);return}if(i==="light"){r(!1);return}const f=()=>{const x=xg(u.current);r(x??vg())};f();const m=typeof matchMedia<"u"?matchMedia("(prefers-color-scheme: dark)"):null,v=()=>f();m?.addEventListener("change",v);let b=null;return typeof MutationObserver<"u"&&u.current&&(b=new MutationObserver(f),b.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"],subtree:!0})),()=>{m?.removeEventListener("change",v),b?.disconnect()}},[i,u]),c}function wg(){const[i,u]=w.useState(!1);return w.useEffect(()=>{if(typeof matchMedia>"u")return;const c=matchMedia("(prefers-reduced-motion: reduce)");u(c.matches);const r=f=>u(f.matches);return c.addEventListener("change",r),()=>c.removeEventListener("change",r)},[]),i}const Sg={working:"Working…",searching:"Searching…",solving:"Solving…",listening:"Listening…",connecting:"Connecting…",weaving:"Weaving…",composing:"Composing…",breathing:"Thinking…",shaping:"Shaping…"};function bf({state:i="working",size:u=64,theme:c="auto",speed:r=1,paused:f=!1,style:m,"aria-label":v,...b}){const x=w.useRef(null),y=bg(c,x),M=wg();return w.useEffect(()=>{const N=x.current;if(!N)return;const D=Math.min(2,typeof devicePixelRatio<"u"&&devicePixelRatio||1);N.width=Math.round(u*D),N.height=Math.round(u*D);const R=N.getContext("2d");if(!R)return;const{mode:A,speed:K,opts:G}=yg(i,u),B=ug[A],Q=K*r,W=ce=>{R.setTransform(D,0,0,D,0,0),R.clearRect(0,0,u,u),B(R,u,ce,y,G)};if(M){W(.6);return}let ee=0,ae=!1;const se=()=>{W(performance.now()/1e3*Q),ae&&(ee=requestAnimationFrame(se))},p=()=>{ae||f||(ae=!0,ee=requestAnimationFrame(se))},P=()=>{ae=!1,cancelAnimationFrame(ee)};W(performance.now()/1e3*Q);let he=!0;const pe=typeof IntersectionObserver<"u"?new IntersectionObserver(([ce])=>{he=ce.isIntersecting,he&&document.visibilityState!=="hidden"?p():P()}):null;pe?.observe(N);const le=()=>{document.visibilityState==="hidden"?P():he&&p()};return document.addEventListener("visibilitychange",le),pe||p(),()=>{P(),pe?.disconnect(),document.removeEventListener("visibilitychange",le)}},[i,u,y,r,f,M]),o.jsx("canvas",{ref:x,role:"img","aria-label":v??Sg[i],style:{width:u,height:u,display:"block",...m},...b})}const of=["searching","solving","composing","breathing","shaping"];function Eg(i){const u=Math.floor(i*of.length);return of[Math.min(of.length-1,Math.max(0,u))]}const wf=Eg(Math.random()),ei="ease-[cubic-bezier(0.32,0.72,0,1)]",$1=274,Y1=395,G1=368,X1=[{label:"Full",width:null},{label:"1440",width:1440},{label:"834",width:834},{label:"390",width:390}],xa={collapsed:!1,collapsedFamilies:[],deleted:[],corner:"bottom-right",font:"satoshi",hidden:[],order:[],renames:{},scaleSplit:!0,showDevOverlays:!0,showWidget:!0,viewport:null,width:G1};function jg(i){return`leglas:${i}`}function Q1(i,u){const c=u.map(r=>r.title);try{if(!i)return{...xa,order:c};const r=JSON.parse(i),f={...xa,...r},m=(Array.isArray(f.deleted)?f.deleted:[]).filter(y=>c.includes(y)),v=c.filter(y=>!m.includes(y)),b=(Array.isArray(f.order)?f.order:[]).filter(y=>v.includes(y)),x=["bottom-left","bottom-right","top-left","top-right"];return{collapsed:!!f.collapsed,collapsedFamilies:(Array.isArray(f.collapsedFamilies)?f.collapsedFamilies:[]).filter(y=>v.includes(y)),corner:x.includes(f.corner)?f.corner:xa.corner,deleted:m,font:typeof f.font=="string"?f.font:xa.font,hidden:(Array.isArray(f.hidden)?f.hidden:[]).filter(y=>v.includes(y)),order:[...b,...v.filter(y=>!b.includes(y))],renames:Object.fromEntries(Object.entries(f.renames??{}).filter(([y])=>v.includes(y))),scaleSplit:typeof r.scaleSplit=="boolean"?r.scaleSplit:xa.scaleSplit,showDevOverlays:typeof r.showDevOverlays=="boolean"?r.showDevOverlays:xa.showDevOverlays,showWidget:typeof r.showWidget=="boolean"?r.showWidget:xa.showWidget,viewport:X1.some(y=>y.width===f.viewport)?f.viewport:null,width:Number.isFinite(f.width)?Math.round(Math.min(Y1,Math.max($1,f.width))):G1}}catch{return{...xa,order:c}}}function Cg(i,u){const c=new Set(u),r=Object.fromEntries(Object.entries(i.renames).filter(([f])=>!c.has(f)));return{...i,collapsedFamilies:i.collapsedFamilies.filter(f=>!c.has(f)),deleted:[...new Set([...i.deleted,...u])],hidden:i.hidden.filter(f=>!c.has(f)),order:i.order.filter(f=>!c.has(f)),renames:r}}function Z1(i,u){if(i.length===0)return[...u];const c=new Set(u),r=i.filter(m=>c.has(m)),f=new Set(r);return[...r,...u.filter(m=>!f.has(m))]}const V1=8,Mg=8;function Ng(i,u,c=V1){return i.left<c?c-i.left:i.right>u-c?Math.max(c-i.left,u-c-i.right):0}function Ag(i,u,c,r=V1){if(i.top>=r)return!1;const f=i.bottom-i.top;return u.bottom+r+f<=c-r}function Tg(i,u,c,r){const f=i.at==="right"?i.x:i.x-u.width/2,m=i.at==="top"?i.y-u.height:i.at==="bottom"?i.y:i.y-u.height/2,v={bottom:m+u.height,left:f,right:f+u.width,top:m};if(i.at==="top"&&Ag(v,c,r.height))return{at:"bottom",shift:i.shift,y:c.bottom+Mg};const b=Ng(v,r.width);return b===i.shift?null:{at:i.at,shift:b,y:i.y}}function au({size:i=18}){return o.jsxs("svg",{"aria-hidden":!0,height:i,strokeLinejoin:"round",strokeWidth:22,viewBox:"160 370 1050 1320",width:Math.round(i*(1050/1320)),children:[o.jsxs("defs",{children:[o.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-up",x1:"791.957",x2:"210",y1:"723.095",y2:"1010",children:[o.jsx("stop",{offset:"0",stopColor:"#7C38E8"}),o.jsx("stop",{offset:"0.68",stopColor:"#CDB6F1"}),o.jsx("stop",{offset:"1",stopColor:"#E9E0FA"})]}),o.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-down",x1:"789.954",x2:"210",y1:"1330.46",y2:"1035",children:[o.jsx("stop",{offset:"0",stopColor:"#3EC2A8"}),o.jsx("stop",{offset:"0.68",stopColor:"#9EDAE8"}),o.jsx("stop",{offset:"1",stopColor:"#E1F2F6"})]}),o.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-shaft",x1:"884.016",x2:"182",y1:"1023.26",y2:"1023.26",children:[o.jsx("stop",{offset:"0",stopColor:"#7E97DD"}),o.jsx("stop",{offset:"0.48",stopColor:"#5F7FD8"}),o.jsx("stop",{offset:"0.71",stopColor:"#9AABE2"}),o.jsx("stop",{offset:"1",stopColor:"#E2E8F6"})]}),o.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-head",x1:"1192",x2:"874.81",y1:"1021.57",y2:"1024.91",children:[o.jsx("stop",{offset:"0",stopColor:"#E8ECF7"}),o.jsx("stop",{offset:"1",stopColor:"#92A7E0"})]})]}),o.jsx("path",{d:"M 671.122 381.199 C 708.12 378.001 733.579 414.981 702.643 437.984 C 705.64 430.245 708.163 423.315 705.553 415.028 C 700.981 400.516 684.107 396.94 671.252 401.81 C 662.713 405.098 655.849 411.671 652.193 420.059 C 645.933 434.059 649.404 447.111 654.599 460.446 C 665.665 467.718 660.114 472.463 666.664 480.695 C 694.852 516.12 737.817 543.026 774.246 568.848 C 841.225 616.324 905.267 670.31 939.022 747.101 C 953.651 782.815 964.144 815.411 953.49 854.107 C 944.702 886.028 889.413 910.644 901.624 945.63 C 905.247 956.01 926.305 965.294 936.684 957.439 C 947.74 949.072 949.919 942.473 953.06 929.336 C 967.974 962.891 939.504 987.655 907.14 982.376 C 893.109 980.134 880.552 972.384 872.258 960.847 C 839.018 914.253 888.968 876.15 898.307 834.712 C 902.782 814.853 894.952 783.534 888.142 764.672 C 860.48 688.068 798.139 632.327 735.838 583.312 C 700.284 555.045 669.551 529.466 642.632 492.392 C 627.896 510.927 608.893 531.804 593.068 550.006 L 506.523 649.582 L 278.039 912.109 C 245.455 949.199 213.059 986.454 180.851 1023.87 C 231.765 1079.46 283.65 1142.04 333.374 1199.45 L 642.829 1555.74 C 666.446 1520.75 700.163 1494.07 732.424 1467.5 C 795.117 1417.7 858.256 1363.37 887.261 1286.25 C 898.113 1256.93 906.911 1217.89 889.705 1189.06 C 873.478 1161.87 852.143 1132.56 865.539 1099.12 C 871.003 1085.24 881.904 1074.2 895.712 1068.56 C 930.406 1054.52 970.704 1079.86 953.232 1118.88 C 950.548 1106.58 948.459 1099.64 937.837 1091.37 C 926.133 1082.27 907.942 1089.57 901.99 1101.66 C 890.169 1127.27 924.549 1151.85 939.219 1169.81 C 966.471 1203.18 959.658 1245.71 945.71 1284.44 C 914.285 1371.69 840.069 1433.7 765.809 1484.61 C 733.647 1506.66 698.091 1531.58 672.306 1561.08 C 665.933 1568.59 659.014 1581.87 653.634 1590.29 C 648.506 1598.32 647.787 1615.38 650.833 1624.56 C 653.881 1633.77 660.579 1641.32 669.359 1645.45 C 681.85 1651.27 699.281 1649.12 705.041 1634.65 C 708.705 1625.45 705.419 1617.29 701.581 1608.8 L 702.848 1609.85 C 737.88 1638.68 697.51 1681.47 657.106 1662.8 C 643.389 1656.45 632.826 1644.83 627.824 1630.56 C 619.064 1605.85 626.824 1585.32 637.489 1563.26 C 610.659 1534.07 581.755 1498.91 555.456 1468.66 L 383.745 1271.03 L 242.504 1108.25 C 219.223 1081.36 191.596 1051.06 169.707 1023.52 C 181.894 1007.58 201.352 986.522 215.082 970.737 L 301.342 871.646 L 539.659 597.67 C 572.041 560.265 605.914 522.417 637.6 484.482 C 616.356 444.192 617.849 392.637 671.122 381.199 z",fill:"#E8ECF7",stroke:"#E8ECF7"}),o.jsx("path",{d:"M 791.002 712.436 C 791.99 712.378 791.355 712.338 792.831 712.983 C 791.837 718.407 719.488 841.546 710.03 858.509 C 707.23 840.677 702.304 817.013 698.274 799.446 C 555 895 360 995 182 1023 C 355 963 525 870 674.863 761.103 C 659.702 748.905 644.649 736.575 629.704 724.113 C 681.16 722.084 738.984 715.793 791.002 712.436 z",fill:"url(#lm-up)",stroke:"url(#lm-up)"}),o.jsx("path",{d:"M 182 1023 C 360 1051 555 1151 698.326 1248.65 C 702.16 1232.41 707.425 1206.32 709.871 1189.79 C 737.246 1238.39 766.184 1286.55 793.713 1335.16 C 739.167 1331.05 684.598 1327.24 630.009 1323.75 C 644.462 1311.53 659.652 1298.21 674.331 1286.42 C 525 1176 355 1083 182 1023 z",fill:"url(#lm-down)",stroke:"url(#lm-down)"}),o.jsx("path",{d:"M 182 1023.5 L 884.044 1002.33 L 881.311 1004.34 C 882.15 1018.85 886.981 1021.89 881.356 1038.74 C 878.766 1040.79 876.225 1042.9 873.734 1045.08 z",fill:"url(#lm-shaft)",stroke:"url(#lm-shaft)"}),o.jsx("path",{d:"M 1005.63 925.199 L 1121.78 984.34 C 1142.45 994.767 1179.5 1012.52 1198.4 1023.72 L 1070.98 1089.03 C 1051.67 1098.95 1023.69 1114.54 1004.93 1122.53 C 1013.61 1097.65 1022.5 1072.85 1031.59 1048.12 L 873.734 1045.08 C 876.225 1042.9 878.766 1040.79 881.356 1038.74 C 886.981 1021.89 882.15 1018.85 881.311 1004.34 L 884.044 1002.33 L 1030.81 999.036 C 1023.04 976.689 1012.03 947.529 1005.63 925.199 z",fill:"url(#lm-head)",stroke:"url(#lm-head)"})]})}function K1({height:i=16}){return o.jsxs("svg",{"aria-label":"Leglas",fill:"#E8ECF7",height:i,role:"img",viewBox:"1256 928 642 222",width:Math.round(i*(642/222)),children:[o.jsx("path",{d:"M 1532.93 979.19 C 1552.43 978.051 1561.54 979.865 1574.88 995.12 L 1575.07 981.036 L 1598.92 981.151 L 1598.96 1052.38 C 1598.98 1086.98 1603.87 1127.82 1557.89 1134.37 C 1533.59 1137.83 1517.6 1134.59 1498.35 1119.87 L 1504.96 1108.54 L 1508.69 1102.35 C 1525.04 1114.93 1548.42 1124.68 1566.62 1107.48 C 1575.66 1098.94 1575.05 1084.76 1574.99 1073.16 C 1568.8 1080.06 1562.18 1085.4 1553.24 1088.34 C 1542.19 1091.88 1530.17 1090.79 1519.94 1085.31 C 1486.94 1067.75 1484.12 1009.92 1513.66 987.847 C 1520.32 982.873 1525.18 981.186 1532.93 979.19 z M 1541.52 1000.13 C 1555.85 998.918 1566.45 1003.26 1574.9 1015.05 C 1575.09 1027.93 1574.91 1041.22 1574.89 1054.14 C 1567.52 1063.25 1562.65 1066.25 1551.25 1068.92 C 1511.01 1069.99 1505.34 1012.62 1541.52 1000.13 z",fillRule:"evenodd"}),o.jsx("path",{d:"M 1416.95 979.231 C 1461.09 974.139 1477.7 1004.91 1478.08 1043.29 L 1395.13 1043.56 C 1404.31 1072.49 1429.03 1082.58 1454.48 1064.74 C 1457.34 1062.33 1456.68 1062.04 1459.58 1062.05 C 1464.01 1065.22 1467.95 1071.97 1471.41 1076.59 C 1414.1 1122.22 1344.57 1064.4 1381 1001.64 C 1388.32 989.03 1403.12 982.109 1416.95 979.231 z M 1419.64 998.169 C 1442.21 996.072 1449.85 1006.61 1455.14 1026.51 C 1448.55 1026.96 1438.16 1026.58 1431.31 1026.54 C 1419.15 1026.65 1406.99 1026.63 1394.83 1026.48 C 1398.74 1009.86 1403.7 1003.36 1419.64 998.169 z",fillRule:"evenodd"}),o.jsx("path",{d:"M 1713.27 979.252 C 1728.04 977.573 1745.26 979.123 1756.3 989.97 C 1768.26 1001.72 1767.44 1017.49 1767.31 1032.81 C 1767.15 1051.82 1767.12 1070.77 1767.06 1089.74 L 1757.36 1089.93 C 1733.55 1090.35 1748.04 1086.51 1742.3 1080.97 C 1727.07 1089.66 1714.5 1096.6 1695.79 1090.38 C 1685.07 1086.81 1679.16 1079.18 1674.51 1069.31 C 1663.26 1025.76 1710.42 1008.22 1743.06 1033.45 C 1743.17 1029.64 1743.75 1021.08 1742.89 1017.76 C 1734.81 986.781 1704.35 998.377 1687.37 1012 C 1684.28 1006.47 1681.22 1000.93 1678.2 995.358 C 1689.81 985.727 1698.69 981.852 1713.27 979.252 z M 1714.53 1038.21 C 1726.37 1037.77 1733.38 1039.57 1742.94 1046.21 C 1743.21 1052.09 1743.05 1058.97 1743.05 1064.94 C 1736.15 1071.44 1733.92 1072.52 1724.6 1074.96 C 1709.1 1075.75 1690.77 1070.07 1698.16 1048.49 C 1700.08 1042.9 1708.94 1039.56 1714.53 1038.21 z",fillRule:"evenodd"}),o.jsx("path",{d:"M 1823.29 979.174 C 1843.68 977.649 1857.91 980.343 1873.82 993.561 L 1864.19 1010.31 C 1854.9 1002.37 1842.52 996.264 1830.29 997.499 C 1810.54 999.496 1804.87 1016.41 1827.99 1021.78 C 1853.42 1027.68 1886.98 1035.62 1875.05 1070.07 C 1869.31 1086.64 1852.8 1091.05 1837.21 1092.35 C 1816.02 1092.18 1803.14 1089.58 1786.76 1075.52 L 1797.03 1058.98 C 1810.81 1068.5 1823.36 1075.69 1840.97 1072.95 C 1848.65 1071.76 1856.31 1065.31 1853.69 1057.02 C 1850.58 1049.89 1837.32 1046.22 1830.02 1044.91 C 1802.77 1040.01 1777.57 1024.93 1796.42 994.719 C 1802.7 984.652 1812.04 981.686 1823.29 979.174 z"}),o.jsx("path",{d:"M 1266.98 939.821 L 1293.02 939.95 L 1293.03 1066.58 L 1358.72 1066.65 L 1358.8 1089.73 L 1266.88 1089.69 L 1266.98 939.821 z"}),o.jsx("path",{d:"M 1627.11 939.241 L 1650.97 939.358 L 1650.98 1089.81 L 1627.17 1089.88 C 1626.5 1040.3 1626.89 988.911 1627.11 939.241 z"})]})}const fn={copy:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z",pencil:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z",link:"M87.5,151.52l64-64a12,12,0,0,1,17,17l-64,64a12,12,0,0,1-17-17Zm131-114a60.08,60.08,0,0,0-84.87,0L103.51,67.61a12,12,0,0,0,17,17l30.07-30.06a36,36,0,0,1,50.93,50.92L171.4,135.52a12,12,0,1,0,17,17l30.08-30.06A60.09,60.09,0,0,0,218.45,37.55ZM135.52,171.4l-30.07,30.08a36,36,0,0,1-50.92-50.93l30.06-30.07a12,12,0,0,0-17-17L37.55,133.58a60,60,0,0,0,84.88,84.87l30.06-30.07a12,12,0,0,0-17-17Z",search:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z",split:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60h72V196H44ZM212,196H140V60h72Z",sidebar:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z",trash:"M216,48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM188,204H68V72H188ZM76,20A12,12,0,0,1,88,8h80a12,12,0,0,1,0,24H88A12,12,0,0,1,76,20Z"},va="flex h-6 w-6 items-center justify-center rounded text-[#D1D5DB] hover:bg-[#2E2E2E] hover:text-white",F1="flex h-7 w-full items-center justify-center rounded-md bg-[#E8E8EA] text-xs font-medium text-[#1C1C20] transition-[background-color,transform] duration-150 hover:bg-white active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none";function rf({on:i}){return o.jsx("span",{"aria-hidden":"true",className:`relative h-3.5 w-6 shrink-0 rounded-full transition-colors duration-150 motion-reduce:transition-none ${i?"bg-[#E6E8EC]":"bg-[#17181B]"}`,children:o.jsx("span",{className:`absolute left-0.5 top-0.5 size-2.5 rounded-full transition-transform duration-150 motion-reduce:transition-none ${i?"translate-x-2.5 bg-[#17181B]":"bg-[#84848C]"}`})})}function qo({className:i=""}){return o.jsx("span",{"aria-hidden":!0,className:`leglas-live-dot block size-1.5 rounded-full ${i}`})}function Dg({size:i=14}){return o.jsxs("svg",{"aria-hidden":!0,fill:"none",height:i,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6",viewBox:"0 0 16 16",width:i,children:[o.jsx("path",{d:"M8 9.75V2.75"}),o.jsx("path",{d:"m5.25 5.5 2.75-2.75 2.75 2.75"}),o.jsx("path",{d:"M3.25 8.75v3.5a1.5 1.5 0 0 0 1.5 1.5h6.5a1.5 1.5 0 0 0 1.5-1.5v-3.5"})]})}function ti({size:i=3}){return o.jsx("span",{"aria-hidden":!0,className:`block ${i===3?"size-3":"size-3.5"} shrink-0 animate-spin rounded-full border-[1.5px] border-white/15 border-t-white/70 motion-reduce:animate-none`})}function Af({size:i=12}){return o.jsxs("svg",{"aria-hidden":"true",className:"shrink-0 text-amber-400/90",fill:"none",height:i,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 16 16",width:i,children:[o.jsx("path",{d:"M8 2.6 14.6 13.4H1.4Z"}),o.jsx("path",{d:"M8 6.8v2.7"}),o.jsx("path",{d:"M8 11.6h.01"})]})}function dn({d:i,size:u=13}){return o.jsx("svg",{"aria-hidden":!0,fill:"currentColor",height:u,viewBox:"0 0 256 256",width:u,children:o.jsx("path",{d:i})})}let V0=0;function st({children:i,label:u,side:c="top",wide:r=!1}){const f=w.useRef(null),m=w.useRef(null),v=w.useRef(null),b=w.useRef(null),[x,y]=w.useState(null);w.useLayoutEffect(()=>{const R=m.current,A=f.current?.firstElementChild;if(!x||x.out||!R||!A)return;const K=Tg(x,{height:R.offsetHeight,width:R.offsetWidth},A.getBoundingClientRect(),{height:window.innerHeight,width:window.innerWidth});K&&y(G=>G&&{...G,...K})},[u,x?.at,x?.out,x?.shift,x?.x,x?.y]),w.useEffect(()=>()=>{v.current&&clearTimeout(v.current),b.current&&clearTimeout(b.current)},[]);const M=()=>{const R=f.current?.firstElementChild;if(!R)return;const A=R.getBoundingClientRect();b.current&&clearTimeout(b.current),y(c==="top"?{at:"top",out:!1,shift:0,x:A.left+A.width/2,y:A.top-8}:{at:"right",out:!1,shift:0,x:A.right+8,y:A.top+A.height/2})},N=()=>{v.current&&clearTimeout(v.current),v.current=setTimeout(M,Date.now()<V0?0:300)},D=()=>{v.current&&clearTimeout(v.current),V0=Date.now()+300,y(R=>R&&!R.out?{...R,out:!0}:R),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>y(null),120)};return o.jsxs("span",{className:"contents",onBlur:D,onFocus:R=>{R.target.matches(":focus-visible")&&M()},onPointerDown:D,onPointerEnter:N,onPointerLeave:D,ref:f,children:[i,x&&o.jsx("span",{"aria-hidden":!0,className:"pointer-events-none fixed z-[60]",style:{left:x.x+x.shift,top:x.y},children:o.jsx("span",{className:`block ${{bottom:"-translate-x-1/2",right:"-translate-y-1/2",top:"-translate-x-1/2 -translate-y-full"}[x.at]}`,children:o.jsx("span",{className:`leglas-tip block rounded-lg border border-white/10 bg-[#171717] px-2 py-1 text-xs font-medium text-white shadow-lg ${r?"w-64 whitespace-normal":"whitespace-nowrap"} ${x.out?`leglas-tip-out-${x.at}`:`leglas-tip-in-${x.at}`}`,ref:m,children:u})})})]})}function kg({error:i,initial:u,label:c,onCancel:r,onCommit:f}){const m=w.useRef(!1);return w.useEffect(()=>{i&&(m.current=!1)}),o.jsx("form",{className:"leglas-rename min-w-0 flex-1",onSubmit:v=>{v.preventDefault();const b=new FormData(v.currentTarget).get("name");m.current=!0,f(typeof b=="string"?b.trim():"","submit")},children:o.jsx("input",{"aria-describedby":i?"leglas-rename-error":void 0,"aria-invalid":i?!0:void 0,"aria-label":c,autoFocus:!0,className:`-mx-1 block w-[calc(100%+0.5rem)] rounded-[4px] bg-transparent px-1 py-0 text-sm font-medium leading-5 text-white outline-none ring-1 ${i?"ring-amber-400/60":"ring-[#D1D5DB]/45 focus:ring-[#D1D5DB]/70"}`,defaultValue:u,name:"name",onBlur:v=>{m.current||f(v.currentTarget.value.trim(),"blur")},onKeyDown:v=>{v.key==="Escape"&&(m.current=!0,r())},type:"text"})})}const zg={danger:"bg-amber-300",info:"bg-[#9CA3AF]",success:"bg-emerald-300"},Og=140;function Rg({onDismiss:i,toast:u}){const[c,r]=w.useState(!1),[f,m]=w.useState(!1),[v,b]=w.useState(!1),x=w.useRef(u.ttl),y=w.useRef(null),M=()=>{y.current||(r(!0),y.current=setTimeout(i,Og))},N=f||v;return w.useEffect(()=>{if(c||N||x.current===null)return;const D=Date.now(),R=setTimeout(M,x.current);return()=>{clearTimeout(R),x.current!==null&&(x.current=Math.max(0,x.current-(Date.now()-D)))}},[c,N]),w.useEffect(()=>()=>{y.current&&clearTimeout(y.current)},[]),o.jsxs("li",{className:`pointer-events-auto flex items-start gap-2.5 rounded-lg border border-white/10 bg-[#2E2E2E] px-3 py-2.5 shadow-xl shadow-black/40 ${c?"leglas-toast-out":"leglas-toast-in"}`,onBlur:()=>b(!1),onFocus:()=>b(!0),onPointerEnter:()=>m(!0),onPointerLeave:()=>m(!1),children:[o.jsx("span",{"aria-hidden":!0,className:`mt-[5px] size-1.5 shrink-0 rounded-full ${zg[u.tone]}`}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block text-xs leading-snug text-[#E8E8EA]",children:u.message}),u.detail?o.jsx("span",{className:"mt-1 block cursor-text select-text break-all text-[10px] leading-snug text-[#9CA3AF]","data-selectable":"",style:{fontFamily:"var(--font-mono)"},children:u.detail}):null,u.note?o.jsx("span",{className:"mt-1 block text-[11px] leading-snug text-[#9CA3AF]",children:u.note}):null]}),u.action?o.jsx("button",{className:"shrink-0 rounded px-1 py-0.5 text-[11px] font-medium text-white underline decoration-white/30 underline-offset-2 transition-colors hover:decoration-white focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60",onClick:()=>{u.action?.run(),M()},type:"button",children:u.action.label}):null,o.jsx("button",{"aria-label":"Dismiss",className:"-mr-1 flex size-5 shrink-0 items-center justify-center rounded text-[#84848C] transition-colors hover:bg-white/[0.06] hover:text-white focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60",onClick:M,type:"button",children:o.jsx("svg",{className:"size-2.5",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 10 10",children:o.jsx("path",{d:"M2.5 2.5 7.5 7.5M7.5 2.5 2.5 7.5",strokeLinecap:"round"})})})]})}function _g({bottom:i,left:u,onDismiss:c,toasts:r,width:f}){return o.jsx("ol",{"aria-live":"polite",className:`pointer-events-none fixed z-40 flex flex-col gap-2 transition-[bottom,left,width] duration-200 ${ei} motion-reduce:transition-none`,style:{bottom:i,left:u,width:f},children:r.map(m=>o.jsx(Rg,{onDismiss:()=>c(m.id),toast:m},m.id))})}function Lg({loaded:i}){return o.jsxs("div",{"aria-hidden":!0,className:`absolute inset-0 overflow-hidden bg-white transition-opacity duration-700 ${ei} ${i?"pointer-events-none opacity-0":"opacity-100"}`,children:[o.jsxs("div",{children:[o.jsx("div",{className:"mx-auto mt-6 h-12 w-[400px] max-w-[80%] rounded-full bg-neutral-200/80"}),o.jsxs("div",{className:"mx-auto mt-24 grid w-full max-w-5xl grid-cols-[1.05fr_0.95fr] items-start gap-16 px-12 max-[900px]:grid-cols-1",children:[o.jsxs("div",{children:[o.jsx("div",{className:"h-14 w-4/5 rounded-lg bg-neutral-200"}),o.jsx("div",{className:"mt-3 h-14 w-3/5 rounded-lg bg-neutral-200"}),o.jsx("div",{className:"mt-8 h-4 w-full max-w-[420px] rounded bg-neutral-200/80"}),o.jsx("div",{className:"mt-2 h-4 w-4/5 max-w-[360px] rounded bg-neutral-200/80"}),o.jsx("div",{className:"mt-10 h-12 w-44 rounded-full bg-neutral-200"})]}),o.jsx("div",{className:"h-[420px] w-60 justify-self-center rounded-[2.5rem] bg-neutral-200 max-[900px]:hidden"})]})]}),o.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden motion-reduce:hidden",children:o.jsx("div",{className:"absolute inset-0 -translate-x-full animate-[leglas-skeleton-sweep_1.6s_ease-in-out_infinite]",style:{background:"linear-gradient(100deg, transparent 32%, rgba(255,255,255,0.55) 50%, transparent 68%)"}})}),o.jsxs("span",{className:"absolute bottom-4 right-5 flex items-center gap-2",children:[o.jsx(bf,{"aria-label":"",size:20,state:wf,theme:"light"}),o.jsx("span",{className:"leglas-shimmer-text text-xs font-medium",children:"Loading preview…"})]})]})}function Bg({branch:i,onStart:u,state:c}){if(c.status==="failed")return o.jsx(J1,{onReload:u,reason:c.reason});const r=c.status==="starting"?{"checking out":`Checking out ${i}`,installing:"Installing what it needs",starting:"Starting its dev server"}[c.phase]:`Opening ${i}`;return o.jsxs("div",{"aria-live":"polite",className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",children:[o.jsx("span",{className:"size-4 animate-spin rounded-full border-2 border-neutral-300 border-t-neutral-800 motion-reduce:animate-none"}),o.jsxs("div",{className:"max-w-xs",children:[o.jsx("p",{className:"text-sm font-medium text-neutral-800",children:r}),o.jsx("p",{className:"mt-1 text-xs leading-snug text-neutral-500",children:"A branch runs in its own checkout, built the first time you open it this session."})]})]})}function J1({onReload:i,reason:u}){return o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",role:"alert",children:[o.jsxs("div",{className:"max-w-xs",children:[o.jsx("p",{className:"text-sm font-medium text-neutral-800",children:"Preview didn’t load"}),o.jsx("p",{className:"mt-1 text-xs leading-snug text-neutral-500",children:u})]}),o.jsx("button",{className:"rounded-md bg-neutral-900 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-neutral-700",onClick:i,type:"button",children:"Reload"})]})}function es({id:i,size:u=14}){const c=w.useId();return i==="claude"?o.jsx("svg",{"aria-hidden":"true",fill:"#D97757",height:u,viewBox:"0 0 24 24",width:u,children:o.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):i==="cursor"?o.jsx("svg",{"aria-hidden":"true",fill:"currentColor",height:u,viewBox:"0 0 24 24",width:u,children:o.jsx("path",{d:"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23"})}):i==="codex"?o.jsxs("svg",{"aria-hidden":"true",height:u,viewBox:"0 0 24 24",width:u,children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:c,x1:"0",x2:"0",y1:"0",y2:"1",children:[o.jsx("stop",{offset:"0",stopColor:"#9B96F2"}),o.jsx("stop",{offset:"0.55",stopColor:"#5E6CF6"}),o.jsx("stop",{offset:"1",stopColor:"#3B32EF"})]})}),o.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457z",fill:`url(#${c})`}),o.jsx("path",{d:"M7.282 8.307a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zM12.728 14.547a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z",fill:"#F4F4FE"})]}):i==="custom"?o.jsx("svg",{"aria-hidden":"true",fill:"none",height:u,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:u,children:o.jsx("path",{d:"m5 6 6 6-6 6M13 18h6"})}):null}const $o=15e3,Ug=["config","requests","health","share"];function Hg(i){return typeof i=="string"&&Ug.includes(i)}function qg(i){if(typeof i!="string")return null;try{const u=JSON.parse(i);if(typeof u!="object"||u===null)return null;const c=Reflect.get(u,"changed");return Hg(c)?c:null}catch{return null}}const K0=250,$g=3e4;function Yg(i){return i<=0?K0:Math.min($g,K0*2**i)}function Gg(){const{host:i,protocol:u}=window.location;return`${u==="https:"?"wss":"ws"}://${i}/leglas/api/live`}let F0=null;function iu(){return F0??=Xg(),F0}function Xg(i={}){const u=i.connect??(D=>new WebSocket(D)),c=i.setTimeout??((D,R)=>globalThis.setTimeout(D,R)),r=i.clearTimeout??(D=>globalThis.clearTimeout(D)),f=new Map;let m=null,v=!1,b=0,x=null,y=!1;const M=()=>{if(y)return;let D;try{D=u(i.url??Gg())}catch{return N()}m=D,D.addEventListener("open",()=>{y||(v=!0,b=0)}),D.addEventListener("message",A=>{const K=qg(A.data);if(K!==null)for(const G of f.get(K)??[])G()});const R=()=>{m===D&&(v=!1,m=null,N())};D.addEventListener("close",R),D.addEventListener("error",R)},N=()=>{if(y||x!==null)return;const D=Yg(b);b+=1,x=c(()=>{x=null,M()},D)};return M(),{on(D,R){const A=f.get(D)??new Set;return A.add(R),f.set(D,A),()=>{A.delete(R),A.size===0&&f.delete(D)}},get connected(){return v},stop(){y=!0,v=!1,x!==null&&r(x),x=null,f.clear();const D=m;m=null;try{D?.close()}catch{}}}}function cf(i){return typeof i=="object"&&i!==null&&i.name==="AbortError"}const Qg=1e4,Zg={setInterval:(i,u)=>globalThis.setInterval(i,u),clearInterval:i=>globalThis.clearInterval(i),setTimeout:(i,u)=>globalThis.setTimeout(i,u),clearTimeout:i=>globalThis.clearTimeout(i)};function su(i,u){const{everyMs:c,timeoutMs:r=Qg,timers:f=Zg}=u;let m=!1,v=null;const b=()=>{if(m||v!==null)return;const M=new AbortController,N=f.setTimeout(()=>{M.abort(),v?.controller===M&&(v=null)},r),D={controller:M,deadline:N};v=D;const R=()=>{v===D&&(f.clearTimeout(N),v=null)};i(M.signal).then(R,R)};b();const x=f.setInterval(b,c),y=u.subscribe?.(b);return()=>{m=!0,y?.(),f.clearInterval(x),v!==null&&(f.clearTimeout(v.deadline),v.controller.abort(),v=null)}}function Vg(i){const u=document.createElement("textarea");u.value=i,u.setAttribute("readonly",""),u.style.cssText="position:fixed;top:-1000px;opacity:0",document.body.append(u),u.select();try{return document.execCommand("copy")}finally{u.remove()}}function Kg(){return{clipboard:typeof navigator>"u"?void 0:navigator.clipboard,legacy:typeof document>"u"?void 0:Vg}}async function Zo(i,u=Kg()){if(u.clipboard)try{return await u.clipboard.writeText(i),"copied"}catch{}try{if(u.legacy?.(i))return"copied"}catch{}return"blocked"}const Fg=9;function Jg(i){if((i.metaKey||i.ctrlKey)&&!i.altKey&&!i.shiftKey&&i.key.toLowerCase()==="k")return{kind:"search"};if(i.typing||i.metaKey||i.ctrlKey||i.altKey)return null;const{key:u}=i;if(u==="?")return{kind:"help"};if(u==="ArrowDown")return{kind:"move",delta:1};if(u==="ArrowUp")return{kind:"move",delta:-1};const c=u.length===1?u.toLowerCase():"";return c==="a"?{kind:"note"}:c==="c"?{kind:"split"}:c==="b"?{kind:"rail"}:c==="r"?{kind:"request"}:c==="t"?{kind:"tools"}:u.length===1&&u>="1"&&u<=String(Fg)?{kind:"jump",index:Number(u)-1}:null}function W1(i){return i?"⌘Cmd+K":"Ctrl+K"}function Wg(i,u=!1){const c=[{keys:["↑","↓"],label:"Move between directions"},{keys:["1","9"],join:"to",label:"Jump straight to a direction"},{keys:["C"],label:"Compare against the direction you were last on"},{keys:["R"],label:"Ask for a change to this direction",changes:!0},{keys:["A"],label:"Annotate the design: point at what is wrong",changes:!0},{keys:[W1(i)],label:"Search"},{keys:["B"],label:"Collapse or open the rail"},{keys:["T"],label:"Open or close the Leglas dev tool menu"},{keys:["?"],label:"This list"},{keys:["Esc"],label:"Clear the search, or close what is open"}],r=[];for(const{changes:f,...m}of c)u&&f||r.push(m);return r}function Ig(i,u,c){return`${i}\0${u}\0${c}`}function Pg(i,u,c){return i[u]===c}function e2(i,u,c){return i[u]===c?i:{...i,[u]:c}}function t2(i,u){if(!(u in i))return i;const c={...i};return delete c[u],c}function Sf(i){try{const u=i.contentDocument;return u!==null&&u.location.href!=="about:blank"&&u.readyState!=="loading"}catch{return!1}}function n2({frame:i,onFailure:u,onReady:c,sameOrigin:r,timeoutMs:f}){let m=!1,v=null;const b=()=>{i.removeEventListener("load",M),i.removeEventListener("error",N),v!==null&&(globalThis.clearTimeout(v),v=null)},x=D=>m||(r?!Sf(i):!D)?!1:(m=!0,b(),c(),!0),y=D=>{m||D&&r&&x(!1)||(m=!0,b(),u())};function M(){x(!r)}function N(){y(!1)}return i.addEventListener("load",M),i.addEventListener("error",N),v=globalThis.setTimeout(()=>y(!0),f),r&&x(!1),()=>{m||(m=!0,b())}}function l2(i){if(typeof i!="object"||i===null)return null;const u=Reflect.get(i,"type");return u==="leglas:preview-ready"?"ready":u==="leglas:preview-error"?"error":null}function a2(i,u){if(u===null)return null;for(const c of i)if(c.contentWindow===u)return c;return null}function J0(i){return i.file===void 0&&i.branch===void 0&&i.url.startsWith("/")}const i2={reachable:!0,wasDown:!1};function s2(i,u){return u?i.reachable?i:{reachable:!0,wasDown:i.wasDown}:!i.reachable&&i.wasDown?i:{reachable:!1,wasDown:!0}}function u2(i){const u=i.rows,c=r=>r!=null&&r!==i.active&&(u===void 0||u.includes(r));return c(i.pinned)?i.pinned:c(i.parent)?i.parent:c(i.previous)?i.previous:u?.find(r=>r!==i.active)??null}function o2(i){return!i.split||i.compare===null||i.compare===i.active?[i.active]:[i.active,i.compare]}const r2=.999,c2=.05;function f2(i){const{gutter:u,panes:c,scaleSplit:r,stageHeight:f,stageWidth:m,viewport:v}=i,b=c>1?(m-(c-1))/c:m,x=v??m,y=b-(v!==null?u:0),M=f-(v!==null?u:0),D=r&&c>1&&m>0&&x>0?Math.max(c2,Math.min(1,y/x)):1,R=D<r2;return{boxHeight:M*D,boxWidth:x*D,designWidth:x,frameHeight:M,scale:D,scaling:R}}const d2="#__next-build-watcher,#nuxt-devtools-anchor,astro-dev-toolbar{display:none!important}",h2="#devtools-indicator{display:none!important}",m2=12;function p2(i,u,c=[],r=[]){const f=i.replace(/\s+/g," ").trim().toLowerCase();return f.length<m2?null:P1(`${u.join(">")} ${f} ${c.join("|")} ${r.join("|")}`.trimEnd())}const I1=new Set(["LINK","META","NOSCRIPT","SCRIPT","STYLE","TEMPLATE"]),Do=720,W0=180,g2=["display","visibility","position","top","right","bottom","left","inset","box-sizing","width","height","min-width","min-height","max-width","max-height","margin-top","margin-right","margin-bottom","margin-left","padding-top","padding-right","padding-bottom","padding-left","overflow-x","overflow-y","opacity","transform","transform-origin","perspective","z-index","color","background-color","background-image","background-position","background-size","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","box-shadow","outline","filter","backdrop-filter","-webkit-backdrop-filter","clip-path","mask-image","mix-blend-mode","isolation","object-fit","object-position","font-family","font-size","font-style","font-weight","line-height","letter-spacing","text-align","text-transform","white-space","flex-direction","flex-wrap","flex-grow","flex-shrink","flex-basis","align-items","align-self","justify-content","justify-self","gap","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-column","grid-row","aspect-ratio","pointer-events","animation-name","animation-duration","animation-delay","animation-iteration-count","animation-direction","animation-timing-function"],y2=new Set(["bottom","filter","height","left","opacity","right","top","transform","width"]),x2=["content","display","position","inset","width","height","opacity","transform","color","background-color","background-image","border-radius","box-shadow","filter","clip-path"],v2=["viewBox","d","points","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height","fill","stroke","stroke-width"],I0=["nextjs-portal","vite-error-overlay","#webpack-dev-server-client-overlay","#leglas-hide-dev-overlays"].join(",");function ko(i){if(!Number.isFinite(i))return"?";const u=Math.round(i*2)/2;return Object.is(u,-0)?"0":String(u)}function P1(i){let u=2166136261,c=2654435769;for(let r=0;r<i.length;r+=1){const f=i.charCodeAt(r);u=Math.imul(u^f,16777619),c=Math.imul(c^f,2246822507)}return`${(u>>>0).toString(16)}${(c>>>0).toString(16)}`}function Yo(i,u=480){const c=i.replace(/\s+/g," ").trim();return c.length<=u?c:`${c.slice(0,180)}…${c.slice(-80)}#${c.length}:${P1(c)}`}function b2(i){return I1.has(i.tagName)||i.matches(I0)||i.closest(I0)!==null}function w2(i){if(i.length<=Do)return i.map((f,m)=>m);const u=new Set,c=f=>{f>=0&&f<i.length&&u.size<Do&&u.add(f)};for(let f=0;f<W0;f+=1)c(f);for(let f=Math.max(0,i.length-W0);f<i.length;f+=1)c(f);for(let f=0;f<i.length&&u.size<Do;f+=1){const m=i[f];if(!m.matches("a,button,input,select,textarea,summary,[role],svg,svg *,canvas,img,picture,video,audio,iframe"))continue;c(f);let v=m.parentElement;for(let b=0;v!==null&&b<3;b+=1)c(i.indexOf(v)),v=v.parentElement}const r=Do-u.size;if(r>0){const f=(i.length-1)/Math.max(1,r-1);for(let m=0;m<r;m+=1)c(Math.round(m*f))}return[...u].sort((f,m)=>f-m)}function S2(i,u){if(u.getPropertyValue("animation-name").trim()!=="none")return!0;const c=i.getAnimations;if(typeof c!="function")return!1;try{return c.call(i).some(r=>r.playState==="running")}catch{return!1}}function E2(i,u){if(u)return"rect:animated";let c;try{c=i.getBoundingClientRect()}catch{return"rect:?"}const r=i.ownerDocument.defaultView,f=r?.getComputedStyle(i).position,m=f==="fixed"?0:r?.scrollX??0,v=f==="fixed"?0:r?.scrollY??0;return`rect:${ko(c.left+m)},${ko(c.top+v)},${ko(c.width)},${ko(c.height)}`}function j2(i){const u=[];for(const r of v2){const f=i.getAttribute(r);f!==null&&u.push(`${r}:${Yo(f)}`)}const c=i.tagName;if(["A","AUDIO","IFRAME","IMG","SOURCE","VIDEO"].includes(c))for(const r of["href","src","srcset","poster"]){const f=i.getAttribute(r);f!==null&&u.push(`${r}:${Yo(f)}`)}if(c==="CANVAS"){const r=i;u.push(`bitmap:${r.width}x${r.height}`)}return u.join(",")}function P0(i,u,c){let r;try{r=c(i,u)}catch{return""}const f=r.getPropertyValue("content").trim();return f===""||f==="none"||f==="normal"?"":`${u}{${x2.map(m=>`${m}:${Yo(r.getPropertyValue(m))}`).join(";")}}`}function C2(i,u){if(!i)return[];const c=[i,...i.querySelectorAll("*")].filter(r=>!b2(r));return w2(c).map(r=>{const f=c[r],m=u(f),v=S2(f,m),b=g2.map(R=>{const A=v&&y2.has(R)?"<animated>":Yo(m.getPropertyValue(R));return`${R}:${A}`}).join(";"),x=f.getAttribute("role"),y=f.getAttribute("type"),M=[x&&`role:${x}`,y&&`type:${y}`].filter(Boolean).join(","),N=P0(f,"::before",u),D=P0(f,"::after",u);return`${f.tagName}${M?`[${M}]`:""}{${E2(f,v)};${b};${j2(f)};${N};${D}}`})}function M2(i,u){if(!i)return[];const c=[];let r=i;for(let f=0;f<4;f+=1){const m=u(r);c.push(`${m.backgroundColor};${m.backgroundImage};${m.color}`);const v=Array.from(r.children).filter(x=>!I1.has(x.tagName??"")),b=v.length===1?v[0]:void 0;if(b===void 0)break;r=b}return c}function N2(i){const u=new Map;for(const[r,f]of Object.entries(i)){if(f===null)continue;const m=u.get(f);m?m.push(r):u.set(f,[r])}const c={};for(const r of u.values())if(!(r.length<2))for(const f of r)c[f]=r.filter(m=>m!==f);return c}function em(i,u){const c=u[i.title];return c?.url===i.url?c:null}function ff(i,u){let c=null;for(const r of u)r in i&&(c??={...i},delete c[r]);return c??i}function A2(i,u){const c=[];for(const[r,f]of u){const m=i.get(r);m!==void 0&&m!==f&&c.push(r)}return c}function T2(i,u,c){const r=c.status==="complete"?{url:u.url,status:"complete",signature:c.signature}:{url:u.url,status:"failed"},f=i[u.title],m=f?.status==="failed"&&r.status==="failed"||f?.status==="complete"&&r.status==="complete"&&f.signature===r.signature;return f?.url===r.url&&m?i:{...i,[u.title]:r}}function D2(i,u){const c={};for(const r of i){const f=em(r,u);f?.status==="complete"&&(c[r.title]=f.signature)}return c}function k2(i,u){return i.filter(c=>c.url?.startsWith("/")?em(c,u)===null:!1)}const e1=24,z2=10,t1=44;function O2(i,u){const c=(r,f)=>{const m=Math.min(e1,f/2),v=Math.max(m,f-e1);return Math.max(m,Math.min(v,r))};return{x:c(i.x,u.width),y:c(i.y,u.height)}}function R2(i){return{x:i.x-t1/2,y:i.y-t1/2}}function _2(i,u,c=z2){return Math.abs(u.x-i.x)>c||Math.abs(u.y-i.y)>c}function L2(i,u){const c=i.x<u.width/2,r=i.y<u.height/2;return r&&c?{corner:"top-left"}:r?{corner:"top-right"}:c?{corner:"bottom-left"}:{corner:"bottom-right"}}function B2(i,u,c){const r=new Set([i]);let f=u.get(i);for(;f!==void 0&&!r.has(f);){if(c.has(f))return f;r.add(f),f=u.get(f)}return null}function U2(i,u){const c=new Set(i),r=new Map,f=new Map,m=[];for(const x of i){const y=B2(x,u,c);if(y===null){m.push(x);continue}r.set(x,y);const M=f.get(y);M?M.push(x):f.set(y,[x])}const v=new Set,b=x=>{if(!v.has(x)){v.add(x);for(const y of f.get(x)??[])b(y)}};for(const x of m)b(x);for(const x of i){if(v.has(x))continue;const y=r.get(x);y!==void 0&&(f.set(y,(f.get(y)??[]).filter(M=>M!==x)),r.delete(x)),m.push(x),b(x)}return{children:f,parentOf:r,roots:m}}function n1(i,u,c){const r=U2(i,u),f=M=>(r.children.get(M)??[]).reduce((N,D)=>N+f(D),1),m=[],v=[],b=()=>{const M=v.indexOf(null);return M!==-1?M:(v.push(null),v.length-1)},x=(M,N,D,R)=>{const A=c.has(M)?[]:r.children.get(M)??[],K=v.flatMap((B,Q)=>B!==null&&Q!==D?[Q]:[]),G=A.slice(1).map(B=>{const Q=b();return v[Q]=B,Q});if(m.push({title:M,depth:N,lane:D,fromAbove:R,toBelow:A.length>0,forks:G,through:K}),A.length===0){v[D]=null;return}x(A[0],N+1,D,!0),A.slice(1).forEach((B,Q)=>x(B,N+1,G[Q],!0))};for(const M of r.roots){const N=b();v[N]=M,x(M,0,N,!1)}const y=new Map(m.map(M=>[M.title,{depth:M.depth,variants:M.depth===0?f(M.title)-1:0,descendants:f(M.title)-1,folded:c.has(M.title),graph:M}]));return{rows:m.map(M=>M.title),meta:y,parents:r.parentOf,children:r.children,roots:r.roots}}function H2(i,u,c,r,f){const m=(i.length?i:u).filter(b=>b!==c),v=r!==null&&m.includes(r)?m.indexOf(r):Math.max(-1,...f.filter(b=>b!==c).map(b=>m.indexOf(b)))+1;return m.splice(v,0,c),m}function df(i){const u=["mark"];i.fromAbove&&u.push("above"),i.toBelow&&u.push("below");for(const c of i.forks)u.push(`fork:${c}`);for(const c of i.through)u.push(`through:${c}`);return u}function q2(i,u){const c=[u];for(let r=i.get(u);r!==void 0&&!c.includes(r);r=i.get(r))c.unshift(r);return c}function $2(i,u,c){const r=q2(i,c),f=[...r],m=[];for(let x=0;x+1<r.length;x+=1)m.push([r[x],r[x+1]]);if(r.length>1)return{nodes:f,edges:m};const v=new Set(f),b=x=>{for(const y of u.get(x)??[])v.has(y)||(v.add(y),f.push(y),m.push([x,y]),b(y))};return b(c),{nodes:f,edges:m}}function Y2(i,u,c){const r=new Map,f=(m,v)=>{const b=r.get(m);b?b.add(v):r.set(m,new Set([v]))};for(const m of c.nodes)u.has(m)&&f(m,"mark");for(const[m,v]of c.edges){if(!u.has(m)||!u.has(v))continue;const b=u.get(v)?.graph?.lane??0;f(m,u.get(m)?.graph?.lane===b?"below":`fork:${b}`);for(let x=i.indexOf(m)+1;x<i.indexOf(v);x+=1)f(i[x],`through:${b}`);f(v,"above")}return r}function G2(i){let u=-1;for(const{graph:c}of i.values())c!==null&&(u=Math.max(u,c.lane,...c.forks,...c.through));return u}function X2(i,u){const c=[],r=new Set([i]);let f=u.get(i);for(;f!==void 0&&!r.has(f);)c.unshift(f),r.add(f),f=u.get(f);return c}function Q2(i,u=3){return i.length<=u?{head:[...i],hidden:[],tail:[]}:{head:[i[0]],hidden:i.slice(1,-1),tail:[i[i.length-1]]}}const l1=i=>Math.round(i*100)/100,Go=.5523,hf=4,Z2=([i,u],c,r)=>[[i,u],[i,u+Go*c],[i+r*(c-Go*c),u+c],[i+r*c,u+c]],V2=([i,u],c,r)=>[[i,u],[i+r*Go*c,u],[i+r*c,u+c-Go*c],[i+r*c,u+c]],K2=(i,u)=>[i,[i[0]+(u[0]-i[0])/3,i[1]+(u[1]-i[1])/3],[i[0]+(u[0]-i[0])*2/3,i[1]+(u[1]-i[1])*2/3],u];function tm(i,u,c){const r=Math.abs(c-i),f=c>i?1:-1,m=r/2,v=[i,u+hf],b=[i+f*m,u+hf+m];return{knee:u+hf+r,segments:[K2([i,u],v),Z2(v,m,f),V2(b,m,f)]}}function nm(i,u,c){return tm(i,u,c).knee}const F2=([i,u,c,r],f)=>{const m=1-f;return[m*m*m*i[0]+3*m*m*f*u[0]+3*m*f*f*c[0]+f*f*f*r[0],m*m*m*i[1]+3*m*m*f*u[1]+3*m*f*f*c[1]+f*f*f*r[1]]};function J2([i,u,c,r],f){const m=(N,D)=>[N[0]+(D[0]-N[0])*f,N[1]+(D[1]-N[1])*f],v=m(i,u),b=m(u,c),x=m(c,r),y=m(v,b),M=m(b,x);return[m(y,M),M,x,r]}function lm(i,u,c,r=0){const{segments:f}=tm(i,u,c);let m=r;const v=[];for(const y of f){if(m<=0){v.push(y);continue}const M=48;let N=0,D=y[0],R=null;for(let A=1;A<=M;A+=1){const K=F2(y,A/M),G=Math.hypot(K[0]-D[0],K[1]-D[1]);if(N+G>=m){R=(A-1+(m-N)/G)/M;break}N+=G,D=K}if(R===null){m-=N;continue}m=0,v.push(J2(y,R))}const b=v[0];if(b===void 0)return"";const x=y=>`${l1(y[0])} ${l1(y[1])}`;return`M ${x(b[0])} ${v.map(y=>`C ${x(y[1])}, ${x(y[2])}, ${x(y[3])}`).join(" ")}`}function W2(i){let u="";for(let c=1;c<i.length;c+=1){const r=i[c-1],f=i[c],m=r.clear??0,v=r.y+m,b=f.y-(f.clear??0);if(b<=v)continue;if(f.x===r.x){u+=`${u?" ":""}M ${r.x} ${v} L ${f.x} ${b}`;continue}const x=nm(r.x,r.y,f.x);if(x>b){u+=`${u?" ":""}M ${r.x} ${v} L ${f.x} ${b}`;continue}const y=lm(r.x,r.y,f.x,m);u+=`${u?" ":""}${y===""?`M ${f.x} ${x}`:y} L ${f.x} ${b}`}return u}const Xo=10,Qo=4,am=44,I2=8,P2=10,a1=4,ey="#4A4A54",ty="#41414A",ny="#8E8E98",i1="#7C7C85",ly="#D1D5DB",s1="#E8E8EA",zo="160ms cubic-bezier(0.2, 0.7, 0.2, 1)";function ay(i){return i<0?0:Math.max(am,Qo+i*Xo+10)}const u1=16,iy=am-12,sy=2,uy=8;function oy(i){let u=0,c=0;for(const{descendants:r,graph:f}of i.values())if(f!==null&&(f.fromAbove||f.toBelow||f.forks.length>0||r>0))if(f.depth===0)u=Math.max(u,u1,Qo+Math.max(0,...f.forks)*Xo+sy);else{const m=Math.max(f.lane,...f.forks,...f.through);c=Math.max(c,iy,Qo+m*Xo+uy)}return c>0&&(u=Math.max(u,u1)),{root:u,variant:c}}function ry({active:i,arriving:u=!1,bloom:c=0,delay:r=0,family:f=!1,folded:m=!1,fresh:v,lifted:b=!1,lit:x,row:y,tint:M="#FB7185",width:N,working:D=!1}){const R=le=>Qo+le*Xo,A=R(y.lane),K=a1+I2+P2,G=a1,B=le=>x?.has(le)??!1,Q=B("mark"),W=y.fromAbove||y.toBelow||y.forks.length>0||f,ae=i||y.forks.length>0||!y.fromAbove||!y.toBelow?y.depth===0?3.5:3:D?3:1.5,se=i?ae+5:0,p=[];for(const le of y.through)p.push({key:`t${le}`,lane:le,segment:`through:${le}`,shape:"line",x:R(le),y1:0,y2:"100%"});y.fromAbove&&p.push({key:"a",lane:y.lane,segment:"above",shape:"line",x:A,y1:0,y2:K-se}),y.toBelow&&p.push({key:"b",lane:y.lane,segment:"below",shape:"line",x:A,y1:K+se,y2:"100%"});for(const le of y.forks){const ce=nm(A,K,R(le)),Me=lm(A,K,R(le),se);Me!==""&&p.push({key:`fc${le}`,lane:le,segment:`fork:${le}`,shape:"path",d:Me}),p.push({key:`ft${le}`,lane:le,segment:`fork:${le}`,shape:"line",x:R(le),y1:ce,y2:"100%"})}const P=(le,ce)=>le.shape==="line"?o.jsx("line",{pathLength:1,x1:le.x,x2:le.x,y1:le.y1,y2:le.y2,...ce},le.key):o.jsx("path",{d:le.d,pathLength:1,...ce},le.key),he=le=>({className:v?.has(le.segment)?"leglas-draw":void 0,style:{animationDelay:`${r}ms`,stroke:B(le.segment)?ny:le.lane>0?ty:ey,transition:`stroke ${zo}`}}),pe=u;return o.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-0",style:{width:N},children:o.jsxs("svg",{className:"absolute left-0 overflow-visible",fill:"none",shapeRendering:"geometricPrecision",strokeWidth:1.25,style:{height:`calc(100% + ${G*2}px)`,top:-G,width:N},children:[p.map(le=>P(le,he(le))),W&&o.jsxs(o.Fragment,{children:[i&&o.jsx("circle",{cx:A,cy:K,fill:"none",r:ae+2.5,stroke:s1,strokeWidth:1.25,style:{transition:`r ${zo}`}}),o.jsx("circle",{className:D?"leglas-breathe":v?.has("mark")?"leglas-pop":void 0,cx:A,cy:K,"data-mark":"",fill:D?M:i?s1:Q?ly:i1,r:i?Math.max(2,ae-1):ae,stroke:"none",style:{animationDelay:`${r+120}ms`,transition:`fill ${zo}, r ${zo}`}}),m&&[8,14,20].map((le,ce)=>o.jsx("circle",{cx:A,cy:K+le,fill:i1,opacity:.6-ce*.18,r:1,stroke:"none"},le)),(pe||c>0)&&o.jsx("circle",{className:"leglas-bloom",cx:A,cy:K,fill:M,r:ae,stroke:"none"},`bloom-${c}-${pe?"landed":""}`)]})]})})}var cy=B1();const o1=200;function fy({askedFor:i,chain:u,displayName:c,onCompare:r,onGo:f,onRail:m,onTrace:v,openAsk:b=!1,self:x,tint:y,traced:M=null}){const[N,D]=w.useState(!1),[R,A]=w.useState(!1),[K,G]=w.useState(!0),B=w.useRef(null);w.useEffect(()=>()=>{B.current&&clearTimeout(B.current)},[]);const Q=()=>{const p=window.matchMedia("(prefers-reduced-motion: reduce)").matches;G(p),A(P=>!P),B.current&&clearTimeout(B.current),B.current=setTimeout(()=>G(!0),p?0:o1+20)},W=N?{head:[...u],hidden:[],tail:[]}:Q2(u),ee=o.jsx("span",{"aria-hidden":!0,className:"select-none text-[#84848C]/50",children:"›"}),ae=p=>{const P=c(p);return m(p)?o.jsx(st,{label:o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"block",children:["Go to ",P]}),o.jsx("span",{className:"block text-[#9CA3AF]",children:"Shift-click to compare"})]}),children:o.jsx("button",{className:`max-w-36 truncate rounded text-left transition-colors duration-150 hover:text-[#E8E8EA] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60 ${M===p?"text-[#E8E8EA]":""}`,onClick:he=>he.shiftKey?r(p):f(p),onPointerEnter:()=>v?.(p),onPointerLeave:()=>v?.(null),type:"button",children:P})}):o.jsx("span",{className:"max-w-36 truncate text-[#84848C]/70",title:`${P} is not on the rail`,children:P})},se=i===null?null:`You asked for “${i}”`;return o.jsxs("div",{className:"px-3 pb-2",children:[o.jsxs("nav",{"aria-label":`Where ${c(x)} came from`,className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 text-[10px] leading-snug text-[#84848C]",children:[W.head.map(p=>o.jsxs(w.Fragment,{children:[ae(p),ee]},p)),W.hidden.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(st,{label:o.jsx(o.Fragment,{children:W.hidden.map(p=>o.jsx("span",{className:"block",children:c(p)},p))}),wide:!0,children:o.jsx("button",{"aria-label":`Show the ${W.hidden.length} directions between`,className:"rounded px-0.5 tracking-widest transition-colors hover:text-[#D1D5DB] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60",onClick:()=>D(!0),type:"button",children:"…"})}),ee]}),W.tail.map(p=>o.jsxs(w.Fragment,{children:[ae(p),ee]},p)),o.jsxs("span",{className:`inline-flex max-w-36 items-center gap-1 truncate transition-colors duration-150 ${M===x?"text-[#E8E8EA]":"text-[#D1D5DB]"}`,children:[y!==void 0&&o.jsx("span",{"aria-hidden":!0,className:"inline-block size-[5px] shrink-0 rounded-full",style:{background:y}}),c(x)]})]}),se===null?null:b?o.jsx("button",{"aria-expanded":R,"aria-label":R?"Show less of the request":"Show the whole request",className:"mt-0.5 block w-full cursor-pointer overflow-hidden text-left text-[10px] leading-snug text-[#84848C] transition-[max-height,color] ease-out hover:text-[#A1A1AA] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60 motion-reduce:transition-none",onClick:Q,style:{maxHeight:R?96:14,transitionDuration:`${o1}ms`},type:"button",children:o.jsx("span",{className:!R&&K?"line-clamp-1":"block",children:se})}):o.jsx("p",{className:"mt-0.5 min-w-0 truncate text-[10px] leading-snug text-[#84848C]",title:i??"",children:se})]})}const Oo=320,dy=22,nu=240,hy=150,my=2600,py=5200,gy=2200,r1=900,c1=420,Uo={current:["#FB7185","#FB923C","#F9A8D4","#E879F9","#FB7185"],bloom:"#FECDD3"},yy=typeof performance<"u"?performance.now():0;function xy(i){const u=(f,m,v)=>3*f*v*(1-v)**2+3*m*v**2*(1-v)+v**3;let c=0,r=1;for(let f=0;f<24;f+=1){const m=(c+r)/2;u(.5,.2,m)<i?c=m:r=m}return u(0,1,(c+r)/2)}function f1({d:i,height:u,leaving:c=!1,marks:r,still:f=!1,width:m}){const v=w.useId().replace(/\W/g,""),b=`current-${v}`,x=`surge-${v}`,y=w.useRef(null),M=w.useRef(null),N=w.useRef(null),D=w.useRef([]),R=w.useRef(r);return R.current=r,w.useEffect(()=>{if(f)return;const A=y.current,K=M.current,G=N.current;if(!A||!K||!G)return;const B=R.current,Q=Math.min(...B.map(le=>le.y)),W=Math.max(...B.map(le=>le.y)),ee=Q-nu,ae=W+nu,se=Math.min(py,Math.max(my,(ae-ee)/hy*1e3)),p=se+gy,P=B.map(()=>-1/0);let he=0;const pe=le=>{const ce=Math.max(0,le-yy),Me=ce/1e3*dy;A.setAttribute("y1",`${Me%Oo}`),A.setAttribute("y2",`${Me%Oo+Oo}`);const we=ce%p,_e=we<se,U=ee+(ae-ee)*(_e?xy(we/se):1);K.setAttribute("y1",`${U-nu/2}`),K.setAttribute("y2",`${U+nu/2}`);const I=Math.min(1,we/500),ie=Math.min(1,Math.max(0,(se-we)/700));G.setAttribute("opacity",`${_e?Math.min(I,ie).toFixed(3):"0"}`);const Ne=ce-we;B.forEach((Se,E)=>{const q=D.current[E];if(!q)return;_e&&U>=Se.y&&(P[E]??-1/0)<Ne&&(P[E]=ce);const te=ce-(P[E]??-1/0),oe=te<r1?1-te/r1:0,me=oe*oe*(3-2*oe);q.setAttribute("opacity",`${(me*.75).toFixed(3)}`),q.setAttribute("r",`${(2.5+(1-me)*6).toFixed(2)}`)}),he=requestAnimationFrame(pe)};return he=requestAnimationFrame(pe),()=>cancelAnimationFrame(he)},[i,f]),o.jsxs("svg",{"aria-hidden":!0,className:"pointer-events-none absolute left-0 top-0 z-20",fill:"none",height:u,style:{animation:c||f?void 0:`leglas-arrive ${c1}ms ease-out both`,opacity:c?0:void 0,transition:f?void 0:`opacity ${c1}ms ease-in`},width:m,children:[o.jsxs("defs",{children:[o.jsx("linearGradient",{gradientUnits:"userSpaceOnUse",id:b,ref:y,spreadMethod:"repeat",x1:0,x2:0,y1:0,y2:Oo,children:Uo.current.map((A,K)=>o.jsx("stop",{offset:K/(Uo.current.length-1),stopColor:A},K))}),o.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:x,ref:M,x1:0,x2:0,y1:-nu,y2:0,children:[o.jsx("stop",{offset:"0",stopColor:"#FFFFFF",stopOpacity:0}),o.jsx("stop",{offset:"0.3",stopColor:"#F0F4FF",stopOpacity:.35}),o.jsx("stop",{offset:"0.5",stopColor:"#FFFFFF",stopOpacity:.95}),o.jsx("stop",{offset:"0.7",stopColor:"#F0F4FF",stopOpacity:.35}),o.jsx("stop",{offset:"1",stopColor:"#FFFFFF",stopOpacity:0})]})]}),o.jsxs("g",{stroke:`url(#${b})`,strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:i,opacity:.1,strokeWidth:7}),o.jsx("path",{d:i,opacity:.24,strokeWidth:3.5}),o.jsx("path",{d:i,opacity:.85,strokeWidth:1.75})]}),o.jsxs("g",{opacity:0,ref:N,stroke:`url(#${x})`,strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:i,opacity:.16,strokeWidth:9}),o.jsx("path",{d:i,opacity:.4,strokeWidth:4}),o.jsx("path",{d:i,opacity:.9,strokeWidth:1.75})]}),r.map((A,K)=>o.jsx("circle",{cx:A.x,cy:A.y,fill:Uo.bloom,opacity:0,r:2.5,ref:G=>{D.current[K]=G}},`${A.x},${A.y}`))]})}const vy=3,Fe={action:6e3,plain:2600};function by(i,u,c=vy){return[...i.filter(f=>f.kind!==u.kind),u].slice(-c)}function wy(i,u){return i.filter(c=>c.id!==u)}const d1=i=>i.trim().replace(/\s+/g," ").toLowerCase();function Sy(i,u,c){const r=i.trim().replace(/\s+/g," "),f=c.get(u)??u;if(r===""||r===u)return f===u?{kind:"same"}:{kind:"reset",value:u};if(r===f)return{kind:"same"};for(const[m,v]of c)if(m!==u&&d1(v)===d1(r))return{kind:"taken",by:v};return{kind:"set",value:r}}function Ey(i,u){try{return new URL(i,u).toString()}catch{return i}}function jy({displayName:i,preview:u,previewUrl:c,title:r}){const f=i===r?"":` (shown as ${JSON.stringify(i)})`,m=u?.note?` — ${u.note}`:"",v=u?.tags.length?` [${u.tags.join(", ")}]`:"",b=[`Leglas direction ${JSON.stringify(r)}${f}${m}${v}`];return u?.file?b.push(`Source: ${u.file}`):u?.branch?b.push(`Branch: ${u.branch}`):u&&b.push(`Route: ${u.url}`),b.push(`Preview: ${c}`),u?.basedOn&&b.push(`A variant of: ${u.basedOn}`),b.push("","Inspect this direction in full:",` npx leglas show ${JSON.stringify(r)} --json`),b.join(`
|
|
10
|
+
`)}const Cy=["order","renames","collapsedFamilies","viewport"];function im(i){return i===void 0?"is not on the rail":i.branch!==void 0?"runs on its own port and can't be shared yet":null}function sm(i,u,c){const r=new Set(u);return{order:[...u],renames:Object.fromEntries(Object.entries(i.renames).filter(([f])=>r.has(f))),collapsedFamilies:i.collapsedFamilies.filter(f=>r.has(f)),compare:c,viewport:i.viewport}}function h1(i,u,c="open",r=[]){const f=new Map(u.map(y=>[y.title,y])),m=new Set([...i.deleted,...i.hidden]),v=Z1(i.order,u.map(y=>y.title)).filter(y=>!m.has(y)),b=[],x=[];for(const y of v)(im(f.get(y))===null?x:b).push(y);return{request:{scope:"rail",titles:x,layout:sm(i,x,null),reach:c,routes:[...r]},leftOut:b}}function My(i,u,c,r,f="open",m=[]){const v=new Map(u.map(y=>[y.title,y])),b=r===null||r===c?[c]:[c,r];if(c==="")return{request:null,reason:"Nothing is on stage yet"};for(const y of b){const M=im(v.get(y));if(M!==null)return{request:null,reason:`${i.renames[y]??y} ${M}`}}const x=b.length===2?"compare":"direction";return{request:{scope:x,titles:b,layout:sm(i,b,x==="compare"?r:null),reach:f,routes:[...m]},reason:null}}function mf(i,u){return i.length===u.length&&i.every((c,r)=>c===u[r])}function Ny(i,u){if(i.scope!==u.scope||!mf(i.titles,u.titles)||i.reach!==u.reach)return!1;const c=i.layout,r=u.layout,f=Object.entries(c.renames).toSorted(),m=Object.entries(r.renames).toSorted();return mf(c.order,r.order)&&mf([...c.collapsedFamilies].toSorted(),[...r.collapsedFamilies].toSorted())&&c.compare===r.compare&&c.viewport===r.viewport&&f.length===m.length&&f.every(([v,b],x)=>v===m[x]?.[0]&&b===m[x]?.[1])}function Ef(i){return JSON.stringify({collapsedFamilies:i.collapsedFamilies,order:i.order,renames:i.renames,viewport:i.viewport})}function Ay(i,u,c){const r=Q1(Ef(u),c),f={...i};for(const m of Cy)f[m]=r[m];return f}function um(i,u,c){return i==="rail"?`The whole rail · ${u.length} direction${u.length===1?"":"s"}`:u.map(c).join(" + ")}function om(i){return i===0?"nobody on it yet":i===1?"1 watching":`${i} watching`}function Ty(i,u,c){const r=new Set(u),f=new Set;for(const m of i){const v=m.dataset.preview;if(v===void 0||!r.has(v))continue;let b=[];try{b=m.contentWindow?.performance.getEntriesByType("resource")??[]}catch{continue}for(const x of b)try{const{origin:y,pathname:M}=new URL(x.name);if(y!==c)continue;f.add(M)}catch{}}return[...f].toSorted()}function pf(i){const u=i.lastIndexOf("/");return u<=0?null:i.slice(0,u+1)}function Dy(i){return i.reduce((u,c)=>u+c.viewers,0)}function ky(i,u){const c=i-u;if(c<=0)return"expired";const r=Math.round(c/6e4);return r<60?`${Math.max(1,r)}m left`:`${Math.round(c/36e5)}h left`}function zy(i,u){return i.trim()===""?`Link ${u+1}`:i}function Oy({previews:i,project:u,searchRef:c,onToggleSplit:r,onToggleHelp:f,onToggleTools:m,onToggleNote:v,suspended:b=!1,viewer:x}){const y=jg(u),M=()=>Q1(x!==void 0?Ef(x.layout):typeof window>"u"?null:window.localStorage.getItem(y),i),[N,D]=w.useState(M),R=new Map(i.map($=>[$.title,$])),A=()=>{const $=M();return $.order.find(re=>!$.hidden.includes(re))??$.order[0]??""},[K,G]=w.useState(A),B=typeof window<"u"&&window.self!==window.top,[Q,W]=w.useState(()=>[A()]),[ee,ae]=w.useState(""),[se,p]=w.useState([]),P=$=>{p(re=>re.length?[]:re),ae($)},[he,pe]=w.useState(!1),[le,ce]=w.useState(()=>new Set),[Me,we]=w.useState(null),[_e,U]=w.useState(null),[I,ie]=w.useState(null),[Ne,Se]=w.useState(!1),[E,q]=w.useState({}),[te,oe]=w.useState([]),[me,je]=w.useState(null),z=w.useRef(1),Y=w.useRef(null),ne=w.useRef(0),de=$=>{ne.current+=1,oe(re=>by(re,{...$,id:ne.current}))},Oe=$=>oe(re=>wy(re,$)),qe=$=>{G($),W(re=>re.includes($)?re:[...re,$])};w.useEffect(()=>{x===void 0&&window.localStorage.setItem(y,JSON.stringify(N))},[N,y,x]);const Ie=x===void 0?null:Ef(x.layout),[nt,Xe]=w.useState(Ie);Ie!==nt&&(Xe(Ie),x!==void 0&&D($=>Ay($,x.layout,i))),w.useEffect(()=>()=>{Y.current&&clearTimeout(Y.current)},[]);const Qe=$=>N.renames[$]??$,jt=$=>R.get($)?.url??"/",hn=$=>{const re=R.get($);return re?.branch===void 0?null:re.state??{status:"idle"}},Qn=$=>{x===void 0&&fetch("/leglas/api/previews/start",{body:JSON.stringify({title:$}),headers:{"content-type":"application/json"},method:"POST"}).catch(()=>{})},Bl=$=>{if(!ee.trim())return!0;const re=ee.toLowerCase(),Ae=R.get($);return Qe($).toLowerCase().includes(re)||$.toLowerCase().includes(re)||(Ae?.note??"").toLowerCase().includes(re)||(Ae?.tags??[]).some(ve=>ve.toLowerCase().includes(re))},al=i.map($=>$.title).filter($=>!N.deleted.includes($)),Ul=Z1(N.order,al),ii=ee.trim()!=="",Rt=ii?se:N.collapsedFamilies,wa=new Map(i.flatMap($=>$.basedOn===void 0?[]:[[$.title,$.basedOn]])),Sa=Ul.filter($=>!N.hidden.includes($)&&Bl($)),{rows:il,meta:mn,parents:si,children:ui,roots:Hl}=n1(Sa,wa,new Set([...Rt,...le])),Zn=oy(n1(Sa,wa,new Set).meta),Vn=($,re,Ae)=>D(ve=>({...ve,order:H2(ve.order,i.map(Ee=>Ee.title),$,re,Ae)})),pt=$=>X2($,wa),Cn=G2(mn),ct=($,re)=>$.includes(re)?$.filter(Ae=>Ae!==re):[...$,re],sl=$=>ii?p(re=>ct(re,$)):D(re=>({...re,collapsedFamilies:ct(re.collapsedFamilies,$)})),Qt=$=>R.get($)?.basedOn??null,Kn=Ul.filter($=>!N.hidden.includes($)).length,Mn=($,re=!1)=>{D(Ae=>({...Ae,hidden:Ae.hidden.filter(ve=>ve!==$)})),re&&qe($)},ul=$=>{const re=Qe($),Ae=K===$;if(D(ve=>({...ve,hidden:[...ve.hidden,$]})),Ae){const ve=Ul.find(Ee=>Ee!==$&&!N.hidden.includes(Ee));ve&&qe(ve)}de({action:{label:"Undo",run:()=>Mn($,Ae)},kind:`remove:${$}`,message:`${re} removed from the list`,tone:"info",ttl:Fe.action})},ol=async $=>{const re=[...new Set($)].filter(Ee=>N.hidden.includes(Ee)),Ae=re.filter(Ee=>R.get(Ee)?.local===!0);if(Ae.length>0){const Ee=await fetch("/leglas/api/previews/delete",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({titles:Ae})});if(!Ee.ok){const Le=await Ee.json().catch(()=>null);throw new Error(Le?.error??"The directions could not be deleted from Leglas.")}}const ve=new Set(re);if(D(Ee=>Cg(Ee,re)),W(Ee=>Ee.filter(Le=>!ve.has(Le))),re.includes(K)){const Ee=Ul.find(Le=>!ve.has(Le)&&!N.hidden.includes(Le));G(Ee??"")}N.hidden.every(Ee=>ve.has(Ee))&&pe(!1)},Wt=($,re)=>D(Ae=>{const ve={...Ae.renames};return re===void 0?delete ve[$]:ve[$]=re,x!==void 0?{...Ae,renames:ve}:(fetch("/leglas/api/renames",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({renames:ve})}).catch(()=>{}),{...Ae,renames:ve})}),It=$=>{we($),U(null)},Fn=($,re,Ae="submit")=>{const ve=new Map(al.map(ke=>[ke,Qe(ke)])),Ee=Sy(re,$,ve);if(Ee.kind==="taken"){if(Ae==="submit"){U(`${Ee.by} already goes by that name.`);return}It(null),de({kind:`rename:${$}`,message:`Still called ${Qe($)}. ${Ee.by} already goes by that name.`,tone:"info",ttl:Fe.plain});return}if(It(null),Ee.kind==="same")return;const Le=N.renames[$];Wt($,Ee.kind==="reset"?void 0:Ee.value),de({action:{label:"Undo",run:()=>Wt($,Le)},kind:`rename:${$}`,message:Ee.kind==="reset"?`Name reset to ${Ee.value}`:`Renamed to ${Ee.value}`,tone:"success",ttl:Fe.action})};w.useEffect(()=>{const $=il,re=ve=>{const Ee=ve.target,Le=Ee?.tagName?.toLowerCase(),ke=Jg({key:ve.key,altKey:ve.altKey,ctrlKey:ve.ctrlKey,metaKey:ve.metaKey,shiftKey:ve.shiftKey,typing:Le==="input"||Le==="textarea"||Le==="select"||(Ee?.isContentEditable??!1)});if(ke&&!(b&&ke.kind!=="help")&&!(x!==void 0&&(ke.kind==="request"||ke.kind==="note"))){if(ke.kind==="search"||ke.kind==="request")ve.preventDefault(),D(ut=>ut.collapsed?{...ut,collapsed:!1}:ut),je({target:ke.kind,nonce:z.current++});else if(ke.kind==="split")ve.preventDefault(),r?.();else if(ke.kind==="help")ve.preventDefault(),f?.();else if(ke.kind==="tools")ve.preventDefault(),m?.();else if(ke.kind==="note")ve.preventDefault(),v?.();else if(ke.kind==="rail")D(ut=>({...ut,collapsed:!ut.collapsed}));else if(ke.kind==="jump"){const ut=$[ke.index];ut&&(ve.preventDefault(),qe(ut))}else if(ke.kind==="move"){ve.preventDefault();const ut=$.indexOf(K),Pt=ke.delta===1?$[Math.min($.length-1,ut+1)]:$[Math.max(0,ut-1)];Pt&&qe(Pt)}}},Ae=[window];for(const ve of Array.from(document.querySelectorAll("iframe")))try{const Ee=ve.contentDocument;Ee&&Ae.push(Ee)}catch{}for(const ve of Ae)ve.addEventListener("keydown",re);return()=>{for(const ve of Ae)ve.removeEventListener("keydown",re)}},[K,il.join("|"),r,f,m,v,b,Q.join("|"),Object.entries(E).filter(([,$])=>$).map(([$])=>$).join("|")]);const ql=($,re)=>{const Ae=Ey(jt($),window.location.origin),ve=re==="link"?Ae:jy({displayName:Qe($),preview:R.get($),previewUrl:Ae,title:$});Zo(ve).then(Ee=>{if(Ee==="blocked"){ie(null),de({detail:Ae,kind:"copy",message:"Your browser blocked the clipboard. The direction is at:",tone:"danger",ttl:null});return}ie({kind:re,title:$}),Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>ie(null),1200),de({kind:"copy",message:re==="link"?`Link to ${Qe($)} copied`:`Reference to ${Qe($)} copied`,tone:"success",ttl:Fe.plain})})},oi=$=>ql($,"link"),Ea=$=>ql($,"reference"),rl=$=>{$.preventDefault();const re=$.currentTarget;re.setPointerCapture($.pointerId);const Ae=$.clientX,ve=N.width;Se(!0);const Ee=ke=>{const ut=Math.min(Y1,Math.max($1,ve+ke.clientX-Ae));D(Pt=>Pt.width===ut?Pt:{...Pt,width:ut})},Le=ke=>{re.releasePointerCapture(ke.pointerId),re.removeEventListener("pointermove",Ee),re.removeEventListener("pointerup",Le),re.removeEventListener("pointercancel",Le),Se(!1)};re.addEventListener("pointermove",Ee),re.addEventListener("pointerup",Le),re.addEventListener("pointercancel",Le)},cl=($,re)=>q(Ae=>e2(Ae,$,re)),ja=($,re)=>Pg(E,$,re),Jn=$=>q(re=>t2(re,$)),Ca=B?[K]:al.filter($=>Q.includes($));return{active:K,ancestryOf:pt,copied:I,copyLink:oi,copyReference:Ea,deleteRemoved:ol,displayName:Qe,dismissToast:Oe,dragFolded:le,focusing:me,hiddenCount:N.hidden.length,hide:ul,isLoaded:ja,lanes:Cn,insets:Zn,loaded:E,markLoaded:cl,matches:Bl,nested:B,notify:de,onHandlePointerDown:rl,panes:Ca,prefs:N,railChildren:ui,railParents:si,railRoots:Hl,reorderAmong:Vn,previewFor:$=>R.get($),query:ee,rename:Fn,renameError:_e,renaming:Me,parentOf:Qt,resetLoaded:Jn,resizing:Ne,restore:Mn,rowMeta:mn,rows:il,toggleFamily:sl,setActive:qe,setDragFolded:ce,setPrefs:D,setQuery:P,setShowHidden:pe,showHidden:he,startRename:It,toasts:te,urlFor:jt,branchState:hn,startBranch:Qn,visibleCount:Kn,viewports:X1,viewing:x!==void 0}}function m1(i){const u=i?.trim()??"";return u===""?null:u}function jf(i){const u=m1(i?.basedOn),c=m1(i?.askedFor);return u===null&&c===null?null:{basedOn:u,askedFor:c}}function Ry(i,u){const c=i===null?null:`Variant of ${i}`,r=u===null?null:`asked for “${u}”`;return c===null?r===null?null:`You ${r}`:r===null?c:`${c} · you ${r}`}const p1=80,_y=6,Ly=8;function By(i){if(typeof i!="string")return null;const u=i.trim();return/^[A-Za-z][\w-]*$/.test(u)?u:null}function Uy(i){return typeof i!="string"?[]:i.trim().split(/\s+/).filter(Boolean).slice(0,_y)}function Ho(i){const u=(i??"").replace(/\s+/g," ").trim();return u.length>p1?`${u.slice(0,p1-1)}…`:u}function Hy(i){const u=[];let c=i;for(;c!==null&&u.length<Ly;){const r=c.tagName.toLowerCase();if(r==="body"||r==="html")break;const f=By(c.id);if(f!==null)return u.unshift(`#${f}`),u.join(" > ");const m=c.parentElement;if(m===null){u.unshift(r);break}let v=1;for(let b=0;b<m.children.length;b+=1){const x=m.children[b];if(x===c)break;x?.tagName===c.tagName&&(v+=1)}u.unshift(`${r}:nth-of-type(${v})`),c=m}return u.join(" > ")}function g1(i,u){return!Number.isFinite(i)||!Number.isFinite(u)||u<=0?.5:Math.round(Math.min(1,Math.max(0,i/u))*1e3)/1e3}function y1(i,u,c,r){return{classes:Uy(i.className),rect:{height:Math.round(u.height),width:Math.round(u.width),x:Math.round(u.x),y:Math.round(u.y)},selector:Hy(i),spot:{x:r===void 0?.5:g1(r.x-u.x,u.width),y:r===void 0?.5:g1(r.y-u.y,u.height)},tag:i.tagName.toLowerCase(),text:Ho(i.textContent),viewport:Math.round(c)}}const x1=6;function v1(i,u){return Math.abs(u.x-i.x)>=x1||Math.abs(u.y-i.y)>=x1}function b1(i,u){return{height:Math.abs(u.y-i.y),width:Math.abs(u.x-i.x),x:Math.min(i.x,u.x),y:Math.min(i.y,u.y)}}function qy(i,u){return i.x<u.x+u.width&&i.x+i.width>u.x&&i.y<u.y+u.height&&i.y+i.height>u.y}function w1(i,u){return u.x>=i.x&&u.y>=i.y&&u.x+u.width<=i.x+i.width&&u.y+u.height<=i.y+i.height}function $y(i,u){const c=i.width>0?i.width:1,r=i.height>0?i.height:1,f=m=>Math.round(Math.min(1,Math.max(0,m))*1e3)/1e3;return{height:f(u.height/r),width:f(u.width/c),x:f((u.x-i.x)/c),y:f((u.y-i.y)/r)}}function Yy(i,u){return{height:u.height*i.height,width:u.width*i.width,x:i.x+u.x*i.width,y:i.y+u.y*i.height}}function Gy(i){const u=i.gap??8,{anchor:c,bounds:r,card:f}=i,m=c.y+c.height+u,v=c.y-u-f.height,b=m+f.height>r.height&&v>=0,x=b?v:m;let y=c.x;return y+f.width>r.width&&(y=r.width-f.width),{flipped:b,left:Math.max(0,y),top:Math.max(0,Math.min(x,Math.max(0,r.height-f.height)))}}function Xy(i){return!Number.isFinite(i)||i<=0?256:Math.round(Math.min(256,Math.max(180,i-48)))}function Qy(i){if(i.length===0)return null;const u=Math.min(...i.map(m=>m.x)),c=Math.min(...i.map(m=>m.y)),r=Math.max(...i.map(m=>m.x+m.width));return{height:Math.max(...i.map(m=>m.y+m.height))-c,width:r-u,x:u,y:c}}const Zy=8;function Vy(i){const u=new Set,c=[];for(const r of i){const f=`${r.tag}:${r.text}`;if(!u.has(f)&&(u.add(f),c.push(r),c.length===Zy))break}return c}const Ro=2,Ky=4e3,S1=600,E1=80;function Fy(i){const u=i.note.length>E1?`${i.note.slice(0,E1-1)}…`:i.note;return[`Annotation ${i.number}`,u===""?null:`: ${u}`,i.sent?". Sent with a change.":null,i.stale?". Its element has gone.":null].filter(c=>c!==null).join("")}function Jy(i){const u=[i.stale?"This element has moved or gone since the annotation was left.":null,i.sent?"Already sent with a change that has not landed yet.":null].filter(c=>c!==null);return u.length===0?void 0:u.join(" ")}function Ll(i){return"left"in i?{height:i.height,width:i.width,x:i.left,y:i.top}:i}function Wy(i,u){return u.x>=i.x&&u.y>=i.y&&u.x<=i.x+i.width&&u.y<=i.y+i.height}function Iy({notes:i,onExit:u,onForget:c,onKeep:r,onRevise:f,paneScale:m,scaling:v,sent:b,title:x}){const y=w.useRef(null),M=w.useRef(null),N=w.useRef(null),D=w.useRef(null),[R,A]=w.useState(null),[K,G]=w.useState(null),[B,Q]=w.useState(null),W=w.useRef(0),[ee,ae]=w.useState(null),[se,p]=w.useState(null),[P,he]=w.useState([]),[pe,le]=w.useState({height:92,width:256}),ce=w.useCallback(()=>{const z=document.querySelector(`iframe[data-preview="${CSS.escape(x)}"]`);if(z===null)return null;let Y=null;try{Y=z.contentDocument}catch{return null}const ne=Y?.defaultView??null;if(Y===null||ne===null)return null;const de=z.getBoundingClientRect();return{doc:Y,rect:de,scale:ne.innerWidth>0?de.width/ne.innerWidth:1,view:ne}},[x]),Me=w.useCallback((z,Y)=>{const ne=ce();return ne===null?null:{x:(z-ne.rect.left)/ne.scale,y:(Y-ne.rect.top)/ne.scale}},[ce]),we=w.useCallback((z,Y)=>{const ne=z.doc.elementFromPoint(Y.x,Y.y);if(ne===null)return null;const de=new Set;let Oe=ne,qe=0;for(let Xe=0;Oe!==null&&Xe<3&&qe<S1;Xe+=1){de.add(Oe);const Qe=z.doc.createTreeWalker(Oe,NodeFilter.SHOW_ELEMENT);let jt=Qe.nextNode();for(;jt!==null&&qe<S1;)de.has(jt)||(de.add(jt),qe+=1),jt=Qe.nextNode();Oe=Oe.parentElement}const Ie=Xe=>{const Qe=Xe.tagName.toLowerCase();return(Ho(Xe.textContent)===""?0:4)+(Qe==="a"||Qe==="button"||Qe==="img"?3:0)+(/^h[1-6]$/.test(Qe)||Qe==="p"||Qe==="li"?2:0)},nt=[...de].filter(Xe=>{const Qe=Xe.tagName.toLowerCase();if(Xe===z.doc.body||Xe===z.doc.documentElement||Qe==="head"||Qe==="script"||Qe==="style")return!1;const jt=Ll(Xe.getBoundingClientRect());if(jt.width<=0||jt.height<=0||!Wy(jt,Y))return!1;const hn=z.view.getComputedStyle(Xe);return hn.display!=="none"&&hn.visibility!=="hidden"}).map(Xe=>({box:Ll(Xe.getBoundingClientRect()),element:Xe,weight:Ie(Xe)}));return nt.length===0?null:(nt.sort((Xe,Qe)=>{const jt=Xe.element.contains(Qe.element),hn=Qe.element.contains(Xe.element);if(jt!==hn)return jt?1:-1;const Qn=Qe.weight-Xe.weight;return Qn!==0?Qn:Xe.box.width*Xe.box.height-Qe.box.width*Qe.box.height}),nt[0]??null)},[]),_e=w.useCallback((z,Y)=>{let ne=null;try{ne=z.doc.querySelector(Y.selector)}catch{}const de=Ll(ne===null?Y.rect:ne.getBoundingClientRect()),Oe=Y.spot??{x:.5,y:.5},qe=Y.region?Yy(de,Y.region):null;return{about:qe??de,box:qe??{height:0,width:0,x:de.x+Oe.x*de.width,y:de.y+Oe.y*de.height},stale:ne===null}},[]),U=w.useCallback(()=>{const z=ce();return z===null?[]:i.map((Y,ne)=>{const de=_e(z,Y.anchor);return{anchor:Y.anchor,box:de.box,id:Y.id,note:Y.note,number:ne+1,region:Y.anchor.region?de.about:null,sent:b.has(Y.id),stale:de.stale}})},[_e,ce,i,b]),I=w.useCallback(()=>he(U()),[U]),ie=w.useCallback(()=>{const z=N.current,Y=ce();z===null||Y===null||B!==null||A(we(Y,z)?.box??null)},[we,ce,B]);w.useEffect(()=>{I();const z=ce(),Y=()=>{I(),ie()};return z?.view.addEventListener("scroll",Y,{passive:!0}),z?.view.addEventListener("resize",Y),window.addEventListener("resize",Y),()=>{z?.view.removeEventListener("scroll",Y),z?.view.removeEventListener("resize",Y),window.removeEventListener("resize",Y)}},[ce,I,ie]),w.useEffect(()=>{const z=y.current;if(z===null)return;const Y=ne=>{const de=ce();de!==null&&(ne.preventDefault(),de.view.scrollBy({behavior:"auto",left:ne.deltaX,top:ne.deltaY}))};return z.addEventListener("wheel",Y,{passive:!1}),()=>z.removeEventListener("wheel",Y)},[ce]),w.useEffect(()=>{const z=de=>{if(de.key==="Escape"){if(B!==null){Q(null);return}u()}},Y=[window],ne=ce();ne!==null&&Y.push(ne.doc);for(const de of Y)de.addEventListener("keydown",z);return()=>{for(const de of Y)de.removeEventListener("keydown",z)}},[ce,u,B]),w.useEffect(()=>{B===null||B.kind!=="kept"||i.some(z=>z.id===B.id)||Q({anchor:B.anchor,answered:!0,field:B.field,kind:"new",note:B.note})},[i,B]),w.useEffect(()=>{const z=M.current;if(B===null||z===null)return;const Y=z.offsetHeight,ne=z.offsetWidth;le(de=>de.height===Y&&de.width===ne?de:{height:Y,width:ne})},[B]);const Ne=(z,Y)=>{const ne=[...z.doc.body.querySelectorAll("*")].slice(0,Ky),de=ne.filter(Ie=>{const nt=Ll(Ie.getBoundingClientRect());return nt.width>0&&nt.height>0&&qy(Y,nt)}),Oe=de.filter(Ie=>!de.some(nt=>nt!==Ie&&Ie.contains(nt))&&!w1(Ll(Ie.getBoundingClientRect()),Y)&&(Ho(Ie.textContent)!==""||["a","button","canvas","img","input","svg","video"].includes(Ie.tagName.toLowerCase())));let qe=z.doc.body;for(const Ie of ne){const nt=Ll(Ie.getBoundingClientRect());w1(nt,Y)&&qe.contains(Ie)&&(qe=Ie)}return{bounds:Qy(Oe.map(Ie=>Ll(Ie.getBoundingClientRect())))??Y,covers:Vy(Oe.map(Ie=>({tag:Ie.tagName.toLowerCase(),text:Ho(Ie.textContent)}))),holder:qe}},Se=(z,Y)=>{const ne=ce();if(ne===null)return;if(Y!==null&&v1(Y,z)){const Oe=b1(Y,z),{bounds:qe,covers:Ie,holder:nt}=Ne(ne,Oe),Xe=Ll(nt.getBoundingClientRect());Q({anchor:{...y1(nt,Xe,ne.view.innerWidth,{x:qe.x+qe.width/2,y:qe.y+qe.height/2}),covers:Ie,region:$y(Xe,qe)},field:String(W.current+=1),kind:"new",note:""}),p(null);return}const de=we(ne,z);de!==null&&(Q({anchor:y1(de.element,de.box,ne.view.innerWidth,z),field:String(W.current+=1),kind:"new",note:""}),p(null))},E=v&&m>0?1/m:1,q=ce(),te={height:q?.view.innerHeight??0,width:q?.view.innerWidth??0},oe=Xy(te.width),me=B===null||q===null?null:_e(q,B.anchor),je=me===null?null:Gy({anchor:me.about,bounds:te,card:{height:pe.height*E,width:oe*E}});return o.jsxs("div",{className:`absolute inset-0 z-20 ${B===null?"cursor-crosshair":"cursor-default"}`,onPointerDown:z=>{if(B!==null)return;const Y=Me(z.clientX,z.clientY),ne=ce();if(!(Y===null||ne===null)){try{z.currentTarget.setPointerCapture(z.pointerId)}catch{}D.current={from:Y,scroll:{x:ne.view.scrollX,y:ne.view.scrollY}}}},onPointerLeave:()=>{N.current=null,D.current===null&&A(null)},onPointerMove:z=>{if(B!==null)return;const Y=Me(z.clientX,z.clientY),ne=ce();if(Y===null||ne===null)return;N.current=Y;const de=D.current;if(de!==null){const Oe={x:de.from.x+de.scroll.x-ne.view.scrollX,y:de.from.y+de.scroll.y-ne.view.scrollY};G(v1(Oe,Y)?b1(Oe,Y):null),A(null);return}A(we(ne,Y)?.box??null)},onPointerUp:z=>{const Y=D.current;if(D.current=null,G(null),B!==null)return;const ne=Me(z.clientX,z.clientY),de=ce();if(ne===null||de===null)return;const Oe=Y===null?null:{x:Y.from.x+Y.scroll.x-de.view.scrollX,y:Y.from.y+Y.scroll.y-de.view.scrollY};A(null),Se(ne,Oe)},ref:y,children:[R!==null&&B===null&&K===null?o.jsx("div",{className:"pointer-events-none absolute bg-[#7C9CFF]/10 outline outline-2 outline-[#7C9CFF]",style:{height:R.height,left:R.x,top:R.y,width:R.width}}):null,K!==null?o.jsx("div",{className:"pointer-events-none absolute rounded-sm border-2 border-dashed border-[#7C9CFF] bg-[#7C9CFF]/10",style:{height:K.height,left:K.x,top:K.y,width:K.width}}):null,P.map(z=>o.jsxs("div",{children:[z.region===null?null:o.jsx("div",{className:`pointer-events-none absolute rounded-sm border-2 border-dashed ${z.stale?"border-amber-500/70 bg-amber-500/5":"border-[#7C9CFF]/70 bg-[#7C9CFF]/5"}`,style:{height:z.region.height+Ro*2,left:z.region.x-Ro,top:z.region.y-Ro,width:z.region.width+Ro*2}}),o.jsxs("button",{"aria-label":Fy(z),className:"group/pin absolute size-5 cursor-pointer",onClick:Y=>{Y.stopPropagation(),Q({anchor:z.anchor,field:String(W.current+=1),id:z.id,kind:"kept",note:z.note}),p(null)},onPointerDown:Y=>Y.stopPropagation(),onPointerMove:Y=>Y.stopPropagation(),onPointerUp:Y=>Y.stopPropagation(),style:{left:z.box.x,top:z.box.y,transform:`translate(-50%, -50%) scale(${E})`,transformOrigin:"center"},type:"button",children:[o.jsx("span",{"aria-hidden":!0,className:"absolute -inset-1.5"}),o.jsx("span",{className:`flex size-5 shrink-0 items-center justify-center rounded-full text-[10px] font-semibold text-white shadow-lg outline-offset-2 group-focus-visible/pin:outline group-focus-visible/pin:outline-2 group-focus-visible/pin:outline-white ${z.stale?"bg-amber-500":"bg-[#7C9CFF]"} ${z.sent?"ring-2 ring-white/80":""}`,title:Jy(z),children:z.number}),o.jsx("span",{className:"pointer-events-none absolute left-full top-1/2 ml-1 w-max max-w-56 -translate-y-1/2 truncate rounded-md border border-white/10 bg-[#171717] px-1.5 py-1 text-left text-[11px] leading-snug text-white opacity-0 shadow-lg transition-opacity group-focus-visible/pin:opacity-100 group-hover/pin:opacity-100",children:z.note||"No words"})]})]},z.id)),B!==null&&me!==null&&je!==null?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"pointer-events-none absolute bg-[#7C9CFF]/10 outline outline-2 outline-[#7C9CFF]",style:{height:me.about.height,left:me.about.x,top:me.about.y,width:me.about.width}}),o.jsxs("form",{className:"absolute z-30 rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 shadow-2xl",onClick:z=>z.stopPropagation(),onPointerDown:z=>z.stopPropagation(),onSubmit:z=>{z.preventDefault();const Y=B.field;if(ee===Y)return;const ne=z.currentTarget.elements.namedItem("note"),de=ne instanceof HTMLInputElement?ne.value.trim():"";ae(Y),p(Oe=>Oe===Y?null:Oe),(B.kind==="new"?r(B.anchor,de):f(B.id,de)).then(Oe=>{ae(qe=>qe===Y?null:qe),Oe?Q(qe=>qe?.field===Y?null:qe):p(Y)}).catch(()=>{ae(Oe=>Oe===Y?null:Oe),p(Y)})},ref:M,style:{left:je.left,top:je.top,transform:`scale(${E})`,transformOrigin:je.flipped?"bottom left":"top left",width:oe},children:[o.jsx("input",{autoFocus:!0,className:"w-full rounded border border-[#232328] bg-[#2E2E2E]/40 px-2 py-1 text-xs text-white placeholder:text-[#84848C] focus:border-[#D1D5DB]/40 focus:outline-none",defaultValue:B.note,onInput:se===B.field?()=>p(null):void 0,name:"note",placeholder:B.kind==="kept"?"What is wrong with it?":B.anchor.region?"What is wrong with this area?":`What is wrong with this ${B.anchor.tag}?`},B.field),B.kind==="kept"?o.jsxs(o.Fragment,{children:[b.has(B.id)?o.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#B7A57A]",children:"Already sent. New words go with the next change."}):null,me.stale?o.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-amber-500/90",children:"Its element has gone. The outline is where it was."}):null,se===B.field?o.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#F87171]",children:"Those words were not saved. Enter tries again."}):null,o.jsxs("div",{className:"flex items-center justify-between gap-3 px-1 pt-1 text-[10px] leading-snug text-[#84848C]",children:[o.jsx("button",{className:"rounded transition-colors hover:text-[#F87171]",onClick:()=>{c(B.id),Q(null)},type:"button",children:"Forget it"}),o.jsx("span",{children:"Enter saves · Esc drops"})]})]}):o.jsxs(o.Fragment,{children:[B.answered?o.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#B7A57A]",children:"That change has landed. Enter leaves these words as a new note."}):null,se===B.field?o.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#F87171]",children:"Those words were not saved. Enter tries again."}):null,o.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#84848C]",children:B.anchor.covers&&B.anchor.covers.length>0?`${B.anchor.covers.length} ${B.anchor.covers.length===1?"element":"elements"} · Enter keeps it · Esc drops it`:"Enter keeps it · Esc drops it"})]})]})]}):null]})}function rm(i,u,c,r){const f=w.useRef(r);w.useLayoutEffect(()=>{f.current=r},[r]),w.useEffect(()=>{if(!i)return;u.current?.focus();const m=c.current,v=y=>{y.key==="Escape"&&(f.current(),m?.focus())},b=y=>{const M=y.target;!u.current?.contains(M)&&!m?.contains(M)&&f.current()},x=()=>f.current();return window.addEventListener("keydown",v),window.addEventListener("pointerdown",b),window.addEventListener("blur",x),()=>{window.removeEventListener("keydown",v),window.removeEventListener("pointerdown",b),window.removeEventListener("blur",x)}},[i,u,c])}async function ts(i,u){const c=await i.json().catch(()=>null);return new Error(typeof c?.error=="string"?c.error:u)}async function Tf(i,u,c){const r=await fetch(i,{body:JSON.stringify(u),headers:{"content-type":"application/json"},method:"POST"});if(!r.ok)throw await ts(r,c);return r.json()}async function Py(i){const u=await fetch("/leglas/api/share",i===void 0?{}:{signal:i});if(!u.ok)throw new Error(`the server answered ${u.status}`);return u.json()}async function j1(i){const u=await fetch("/leglas/api/share",{body:JSON.stringify(i),headers:{"content-type":"application/json"},method:"POST"});if(!u.ok)throw await ts(u,"Leglas could not start sharing.");return(await u.json()).share}async function ex(i){const u=await fetch("/leglas/api/share/update",{body:JSON.stringify(i),headers:{"content-type":"application/json"},method:"POST"});if(!u.ok)throw await ts(u,"Leglas could not update the share.");return(await u.json()).share}async function uu(i,u,c){const r=await fetch(`/leglas/api/share${i}`,{body:JSON.stringify(u??{}),headers:{"content-type":"application/json"},method:"POST"});if(!r.ok)throw await ts(r,c);return(await r.json()).share}function tx(i,u=!1){return uu("/allow",{path:i,subtree:u},"Leglas could not allow that path.")}function nx(i){return uu("/grants",{name:i},"Leglas could not make another link.")}function lx(i){return uu("/grants/revoke",{id:i},"Leglas could not turn that link off.")}function ax(i){return uu("/grants/extend",{id:i},"Leglas could not extend that link.")}function ix(){return uu("/rotate",{},"Leglas could not replace the links.")}async function C1(){const i=await fetch("/leglas/api/share/stop",{body:"{}",headers:{"content-type":"application/json"},method:"POST"});if(!i.ok)throw await ts(i,"Leglas could not stop sharing.")}const cm={cloudflared:"cloudflared",ngrok:"ngrok"},sx=1400;function ux(){return o.jsx("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8",viewBox:"0 0 16 16",width:"11",children:o.jsx("path",{d:"M8 3.5v9M3.5 8h9"})})}function _o({checked:i,detail:u,disabled:c=!1,onPick:r,title:f}){return o.jsxs("button",{"aria-checked":i,className:`flex w-full items-start gap-2.5 rounded-md px-2 py-1.5 text-left transition-colors ${c?"cursor-not-allowed opacity-50":i?"bg-[#2E2E2E]/70":"hover:bg-white/[0.04]"}`,disabled:c,onClick:r,role:"radio",type:"button",children:[o.jsx("span",{"aria-hidden":!0,className:`mt-[3px] flex size-3 shrink-0 items-center justify-center rounded-full border transition-colors ${i?"border-[#E8E8EA]":"border-[#84848C]"}`,children:o.jsx("span",{className:`size-1.5 rounded-full bg-[#E8E8EA] transition-transform duration-150 motion-reduce:transition-none ${i?"scale-100":"scale-0"}`})}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:`block text-xs ${i?"text-white":"text-[#D1D5DB]"}`,children:f}),o.jsx("span",{className:"mt-0.5 block truncate text-[10px] leading-snug text-[#84848C]",children:u})]})]})}function ox({busy:i,choice:u,displayName:c,onPick:r,onReach:f,onStart:m,provider:v,rail:b,reach:x,seeded:y,stage:M,stageOfPair:N}){const D=u==="rail"?b.request:M.request,R=b.request.titles.length;return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block px-1 pb-1 pt-0.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Share"}),o.jsxs("div",{"aria-label":"What to share",className:"flex flex-col gap-0.5",role:"radiogroup",children:[o.jsx(_o,{checked:u==="rail",detail:R===0?"Nothing on the rail can be shared yet":`${R} direction${R===1?"":"s"}${b.leftOut.length===0?", as you see them":` · ${b.leftOut.length} on ${b.leftOut.length===1?"a branch":"branches"} left out`}`,disabled:R===0,onPick:()=>r("rail"),title:"The whole rail"}),o.jsx(_o,{checked:u==="stage",detail:M.request===null?M.reason??"":um(M.request.scope,M.request.titles,c),disabled:M.request===null,onPick:()=>r("stage"),title:N?"The comparison on stage":"The direction on stage"})]}),o.jsx("span",{className:"block px-1 pb-1 pt-2.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"How far they can go"}),o.jsxs("div",{"aria-label":"How far a viewer can go",className:"flex flex-col gap-0.5",role:"radiogroup",children:[o.jsx(_o,{checked:x==="open",detail:"Your whole dev server, over GET",onPick:()=>f("open"),title:"Anywhere in the app"}),o.jsx(_o,{checked:x==="listed",detail:y===0?"Open a direction first, so Leglas knows what it loads":`These pages and the ${y} files they loaded`,disabled:y===0,onPick:()=>f("listed"),title:"Only what you shared"})]}),o.jsx("div",{className:"mt-1.5 border-t border-[#232328] px-1 pb-1 pt-2",children:v==="none"?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] text-amber-300/90",children:[o.jsx(Af,{}),"No tunnel program found"]}),o.jsxs("p",{className:"mt-1 text-[10px] leading-snug text-[#84848C]",children:["Install ",o.jsx("span",{className:"text-[#9CA3AF]",children:"cloudflared"})," or"," ",o.jsx("span",{className:"text-[#9CA3AF]",children:"ngrok"})," and Leglas will use it. Without one the link only works on this machine."]})]}):o.jsxs("p",{className:"text-[10px] leading-snug text-[#84848C]",children:["Out through ",o.jsx("span",{className:"text-[#9CA3AF]",children:cm[v]})," on this machine. The link lives as long as Leglas does."]})}),o.jsx("button",{className:`mt-1 ${F1}`,disabled:i!==null||D===null||D.titles.length===0,onClick:m,type:"button",children:i==="start"?o.jsx(ti,{}):v==="none"?"Start on this machine":"Start sharing"}),o.jsx("p",{className:"px-1 pb-0.5 pt-2 text-[10px] leading-snug text-[#84848C]",children:x==="open"?"They see the real app and can flip, compare and change the width. They cannot change anything, and they read whatever your dev server serves.":"They see the real app and can flip, compare and change the width. Anything outside what you shared is refused, and Leglas tells you what it turned away so you can let it in."})]})}function rx({busy:i,copied:u,grant:c,index:r,now:f,onCopy:m,onExtend:v,onRevoke:b,only:x}){const y=ky(c.expiresAt,f),M=c.expiresAt-f<3600*1e3,N=zy(c.name,r);return o.jsxs("li",{className:"group relative flex h-8 items-center gap-2 rounded-md px-2 transition-colors hover:bg-white/[0.04]",children:[o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-[#D1D5DB]",children:N}),o.jsx("span",{className:`shrink-0 text-[10px] group-hover:hidden group-has-[button:focus-visible]:hidden ${M?"text-amber-300/80":c.viewers>0?"text-[#D1D5DB]":"text-[#84848C]"}`,children:c.viewers>0?`${om(c.viewers)} · ${y}`:y}),o.jsxs("span",{className:"pointer-events-none absolute right-2 flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity duration-150 group-hover:pointer-events-auto group-hover:opacity-100 group-has-[button:focus-visible]:pointer-events-auto group-has-[button:focus-visible]:opacity-100 motion-reduce:transition-none",children:[o.jsx(st,{label:u?"Copied":"Copy this link",children:o.jsx("button",{"aria-label":`Copy the ${N} link`,className:va,onClick:m,type:"button",children:u?o.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):o.jsx(dn,{d:fn.link})})}),o.jsx(st,{label:"Another 24 hours",children:o.jsx("button",{"aria-label":`Extend the ${N} link`,className:va,disabled:i!==null,onClick:v,type:"button",children:o.jsx(ux,{})})}),o.jsx(st,{label:x?"Turn off · the last link":"Turn off",children:o.jsx("button",{"aria-label":`Turn the ${N} link off`,className:`${va} hover:text-red-300`,disabled:i!==null,onClick:b,type:"button",children:o.jsx(dn,{d:fn.trash,size:12})})})]})]})}function cx({busy:i,onCreate:u}){const[c,r]=w.useState(""),[f,m]=w.useState(!1);return f?o.jsxs("form",{className:"mt-0.5 flex items-center gap-1 px-2 py-1",onSubmit:v=>{v.preventDefault(),u(c.trim()),r(""),m(!1)},children:[o.jsx("input",{"aria-label":"Who this link is for",autoFocus:!0,className:"min-w-0 flex-1 rounded border border-[#232328] bg-[#2E2E2E]/40 px-1.5 py-1 text-[11px] text-white placeholder:text-[#84848C] focus:outline-none focus:ring-1 focus:ring-[#D1D5DB]/40",maxLength:60,onChange:v=>r(v.target.value),onKeyDown:v=>{v.key==="Escape"&&(r(""),m(!1))},placeholder:"Who is it for?",value:c}),o.jsx("button",{className:"shrink-0 rounded px-2 py-1 text-[11px] font-medium text-[#D1D5DB] transition-colors hover:bg-white/[0.06] hover:text-white disabled:opacity-50",disabled:i!==null,type:"submit",children:i==="grant"?o.jsx(ti,{}):"Make"})]}):o.jsx("button",{className:"mt-0.5 w-full rounded-md px-2 py-1.5 text-left text-[11px] text-[#84848C] transition-colors hover:bg-white/[0.04] hover:text-[#D1D5DB] disabled:opacity-50",disabled:i!==null,onClick:()=>m(!0),type:"button",children:"+ Another link"})}function fx({busy:i,changed:u,copiedId:c,displayName:r,now:f,onAllow:m,onCopy:v,onCreate:b,onExtend:x,onRetry:y,onRevoke:M,onRotate:N,onStop:D,onUpdate:R,share:A}){const K=A.tunnel;return o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex items-center gap-1.5 px-1 pb-1 pt-0.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:[K.status==="ready"?o.jsx(qo,{}):null,"Sharing"]}),o.jsx("div",{"aria-live":"polite",className:"px-1 pb-1.5 text-[11px] leading-snug",children:K.status==="ready"?o.jsxs("p",{className:"flex items-center gap-1.5",children:[o.jsx(qo,{}),o.jsx("span",{className:"min-w-0 flex-1 truncate select-text font-mono text-[10px] text-[#D1D5DB]","data-selectable":!0,children:new URL(A.grants[0]?.url??"http://x").host})]}):K.status==="starting"?o.jsxs("div",{className:"flex items-start gap-1.5 text-[#9CA3AF]",children:[o.jsx("span",{className:"mt-[3px]",children:o.jsx(ti,{})}),K.url===void 0?o.jsxs("span",{children:["Opening a tunnel through ",cm[K.provider],"…"]}):K.slow?o.jsx("span",{children:"Still waiting for the link to answer from here. New tunnel names take a minute to spread, so it may already work for whoever you send it to."}):o.jsx("span",{children:"Waiting for the link to answer…"})]}):K.status==="failed"?o.jsxs("div",{children:[o.jsxs("p",{className:"flex items-start gap-1.5 text-amber-300/90",children:[o.jsx("span",{className:"mt-0.5",children:o.jsx(Af,{})}),o.jsx("span",{children:K.reason})]}),o.jsx("button",{className:"mt-1 rounded text-[10px] text-[#9CA3AF] underline underline-offset-2 transition-colors hover:text-white disabled:opacity-50",disabled:i!==null,onClick:y,type:"button",children:"Try again"})]}):o.jsxs("p",{className:"text-[#9CA3AF]",children:["Reachable from this machine only. Point a tunnel of your own at"," ",o.jsxs("span",{className:"select-text font-mono text-[#D1D5DB]","data-selectable":!0,children:["127.0.0.1:",A.sharePort]})," ","and send that host with the same path."]})}),o.jsxs("ul",{"aria-label":"Links into this share",className:"max-h-64 overflow-y-auto",children:[A.grants.map((G,B)=>o.jsx(rx,{busy:i,copied:c===G.id,grant:G,index:B,now:f,onCopy:()=>v(G),onExtend:()=>x(G),onRevoke:()=>M(G),only:A.grants.length===1},G.id)),A.grants.length===0?o.jsx("li",{className:"px-2 py-1.5 text-[11px] text-[#84848C]",children:"No links. Nobody can open this share until you make one."}):null]}),o.jsx(cx,{busy:i,onCreate:b}),A.reach==="listed"&&A.refused.length>0?o.jsxs("div",{className:"mt-1.5 border-t border-[#232328] pt-1.5",children:[o.jsxs("span",{className:"flex items-baseline gap-1.5 px-1 pb-1",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-amber-300/90",children:"Turned away"}),o.jsxs("span",{className:"text-[10px] text-[#84848C]",children:[A.refused.length," ",A.refused.length===1?"path":"paths"," your app asked for"]})]}),o.jsx("ul",{"aria-label":"Paths this share turned away",className:"max-h-32 overflow-y-auto",children:A.refused.map(G=>o.jsxs("li",{className:"group flex h-7 items-center gap-2 rounded-md px-2 transition-colors hover:bg-white/[0.04]",children:[o.jsx("span",{className:"min-w-0 flex-1 select-text truncate font-mono text-[10px] text-[#D1D5DB]","data-selectable":!0,title:G,children:G}),o.jsxs("span",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-has-[button:focus-visible]:opacity-100 motion-reduce:transition-none",children:[o.jsx("button",{"aria-label":`Let ${G} through`,className:"rounded px-1.5 py-0.5 text-[10px] text-[#9CA3AF] transition-colors hover:bg-white/[0.06] hover:text-white disabled:opacity-50",disabled:i!==null,onClick:()=>m(G,!1),type:"button",children:"Allow"}),pf(G)===null?null:o.jsx("button",{"aria-label":`Let everything in ${pf(G)} through`,className:"rounded px-1.5 py-0.5 text-[10px] text-[#9CA3AF] transition-colors hover:bg-white/[0.06] hover:text-white disabled:opacity-50",disabled:i!==null,onClick:()=>m(pf(G),!0),type:"button",children:"+ folder"})]})]},G))})]}):null,o.jsxs("p",{className:"truncate px-1 pt-1.5 text-[10px] text-[#84848C]",children:[um(A.scope,A.titles,r),A.reach==="listed"?" · only what you shared":""]}),o.jsxs("div",{className:"mt-2 flex items-center gap-1 border-t border-[#232328] pt-1.5",children:[u?o.jsx("button",{className:"flex h-7 min-w-0 flex-1 items-center justify-center rounded-md bg-[#2E2E2E] px-2 text-xs font-medium text-white transition-[background-color,transform] duration-150 hover:bg-[#3A3A40] active:scale-[0.98] disabled:opacity-50 motion-reduce:transition-none",disabled:i!==null,onClick:R,type:"button",children:i==="update"?o.jsx(ti,{}):"Update what they see"}):o.jsx("span",{className:"min-w-0 flex-1 truncate px-2 text-[10px] text-[#84848C]",children:A.scope==="rail"?"They see the rail as you do":"They see what you shared"}),o.jsx(st,{label:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:"Replace every link."}),o.jsx("span",{className:"block text-[#9CA3AF]",children:"For when one got somewhere you did not mean to send it."})]}),wide:!0,children:o.jsx("button",{"aria-label":"Replace every link and the address with them",className:"flex h-7 shrink-0 items-center justify-center rounded-md px-2 text-xs text-[#9CA3AF] transition-[color,background-color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.98] disabled:opacity-50 motion-reduce:transition-none",disabled:i!==null,onClick:N,type:"button",children:i==="rotate"?o.jsx(ti,{}):"Replace all"})}),o.jsx("button",{className:"flex h-7 shrink-0 items-center justify-center rounded-md px-2.5 text-xs text-[#9CA3AF] transition-[color,background-color,transform] duration-150 hover:bg-white/[0.06] hover:text-red-300 active:scale-[0.98] disabled:opacity-50 motion-reduce:transition-none",disabled:i!==null,onClick:D,type:"button",children:i==="stop"?o.jsx(ti,{}):"Stop"})]})]})}function dx({active:i,compare:u,displayName:c,notify:r,onClose:f,open:m,prefs:v,previews:b,share:x,triggerRef:y,tunnels:M}){const N=w.useRef(null),[D,R]=w.useState("rail"),[A,K]=w.useState("open"),[G,B]=w.useState(null),[Q,W]=w.useState(null),[ee,ae]=w.useState(()=>Date.now());w.useEffect(()=>{if(!m)return;ae(Date.now());const z=window.setInterval(()=>ae(Date.now()),6e4);return()=>window.clearInterval(z)},[m]);const se=w.useRef(null),p=w.useRef(null),P=w.useRef(null);rm(m,N,y,f);const[he,pe]=w.useState([]),le=w.useMemo(()=>h1(v,b).request.titles,[v,b]);w.useEffect(()=>{m&&pe(Ty(document.querySelectorAll("iframe[data-preview]"),le,window.location.origin))},[m,le]);const ce=w.useMemo(()=>h1(v,b,A,he),[v,b,A,he]),Me=w.useMemo(()=>My(v,b,i,u,A,he),[v,b,i,u,A,he]),we=M[0]??"none",_e=x===null?null:x.scope==="rail"?ce.request:Me.request,U=x!==null&&_e!==null&&!Ny(_e,{scope:x.scope,titles:x.titles,layout:x.layout,reach:x.reach,routes:x.routes}),I=x?.grants[0]??null,ie=I===null?null:I.url!==null?I.url:x?.tunnel.status==="none"?I.localUrl:null;w.useEffect(()=>()=>{se.current&&clearTimeout(se.current)},[]);const Ne=(z,Y=!1,ne=null)=>Zo(z).then(de=>{if(de==="blocked"){if(W(null),Y)return;r({detail:z,kind:"share",message:"Your browser blocked the clipboard. The link is:",tone:"danger",ttl:null});return}W(ne),se.current&&clearTimeout(se.current),se.current=setTimeout(()=>W(null),sx),Y||r({kind:"share",message:"Share link copied",tone:"success",ttl:Fe.plain})}),Se=x?.tunnel.status??null;w.useEffect(()=>{if(!(x===null||ie===null||p.current!==x.id)){if(P.current!==x.id){P.current=x.id,Ne(ie,!0).then(()=>r({kind:"share",message:Se==="ready"||Se==="none"?"Your share is live. Link copied.":"Share link copied. Waiting for it to answer…",tone:"success",ttl:Fe.action}));return}Se==="ready"&&r({kind:"share",message:"Your share is live.",tone:"success",ttl:Fe.plain})}},[x?.id,ie,Se]);const E=(z,Y)=>r({kind:"share",message:z instanceof Error?z.message:Y,tone:"danger",ttl:Fe.action}),q=z=>{G===null&&(B("start"),j1({...z,tunnel:we}).then(Y=>{p.current=Y.id}).catch(Y=>E(Y,"Leglas could not start sharing.")).finally(()=>B(null)))},te=()=>{G===null&&(B("stop"),C1().then(()=>{r({kind:"share",message:"Stopped sharing",tone:"info",ttl:Fe.plain})}).catch(z=>E(z,"Leglas could not stop sharing.")).finally(()=>B(null)))},oe=()=>{G!==null||_e===null||(B("update"),ex(_e).then(()=>{r({kind:"share",message:"Viewers now see the rail as you do",tone:"success",ttl:Fe.plain})}).catch(z=>E(z,"Leglas could not update the share.")).finally(()=>B(null)))},me=(z,Y,ne)=>{G===null&&(B(z),Y().then(()=>{r({kind:"share",message:ne,tone:"success",ttl:Fe.plain})}).catch(de=>E(de,"That did not work.")).finally(()=>B(null)))},je=()=>{if(G!==null||x===null)return;const z={scope:x.scope,titles:x.titles,layout:x.layout,reach:x.reach,routes:x.routes};B("start"),C1().then(()=>j1({...z,tunnel:we})).then(Y=>{p.current=Y.id}).catch(Y=>E(Y,"Leglas could not start sharing.")).finally(()=>B(null))};return o.jsx("div",{"aria-hidden":!m,"aria-label":"Share",className:`absolute inset-x-3 top-full z-30 mt-1.5 origin-top-right rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 text-[#D1D5DB] shadow-2xl transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.165,0.84,0.44,1)] focus:outline-none motion-reduce:transition-none ${m?"translate-y-0 scale-100 opacity-100":"pointer-events-none -translate-y-1 scale-95 opacity-0"}`,inert:!m,ref:N,role:"dialog",tabIndex:-1,children:x===null?o.jsx(ox,{busy:G,choice:D,onReach:K,reach:A,seeded:he.length,displayName:c,onPick:R,onStart:()=>{const z=D==="rail"?ce.request:Me.request;z!==null&&q(z)},provider:we,rail:ce,stage:Me,stageOfPair:u!==null&&u!==i}):o.jsx(fx,{busy:G,changed:U,copiedId:Q,displayName:c,now:ee,onAllow:(z,Y)=>me("allow",()=>tx(z,Y),`${z} is in`),onCopy:z=>{const Y=z.url??z.localUrl;Ne(Y,!1,z.id)},onCreate:z=>me("grant",()=>nx(z),z===""?"Link made":`Link for ${z}`),onExtend:z=>me("extend",()=>ax(z.id),"Another 24 hours on that link"),onRetry:je,onRevoke:z=>me("revoke",()=>lx(z.id),"That link is off"),onRotate:()=>me("rotate",()=>ix(),"Every link replaced, and the address with them"),onStop:te,onUpdate:oe,share:x})})}const hx=9e4,mx=6*6e4,Lo="https://leglas.vercel.app/changelog/",Cf="leglas:updated";function fm(i){return i!==null&&i.available&&i.latest!==null&&i.latest.version!==i.skipped}function M1(i){return i===null?"Leglas":fm(i)&&i.latest!==null?`${i.latest.version} is out`:`Leglas ${i.version}`}function px(i,u){const c=u-Date.parse(i);if(!Number.isFinite(c)||c<6e4)return"just now";const r=Math.floor(c/6e4);if(r<60)return`${r} minute${r===1?"":"s"} ago`;const f=Math.floor(r/60);if(f<24)return`${f} hour${f===1?"":"s"} ago`;const m=Math.floor(f/24);return m===1?"yesterday":`${m} days ago`}function dm(i,u){return i.replace("@latest",`@${u}`)}function hm(i){switch(i){case"pnpm":return"pnpm dlx";case"bun":return"bunx";case"yarn":return"yarn dlx";default:return"npx"}}function N1(i){if(i===null)return"npx leglas";switch(i.install.kind){case"npx":return`${hm(i.install.manager)} leglas`;case"project":return`${i.install.manager==="npm"?"npx":`${i.install.manager} exec`} leglas`;default:return"leglas"}}function A1(i){return{heading:"Restarting Leglas",detail:`This page reloads once ${i} answers.`,spinner:!0}}function gx(i,u){const{install:c}=i;if(c.kind==="source")return"You run Leglas from a checkout, so pull to update.";if(i.busy)return"Wait for the running change to finish, then update.";if(c.kind==="npx")return`Restarts Leglas with ${u} through ${hm(c.manager)}. Your rail stays as it is.`;if(c.command===null)return null;const r=c.kind==="project"?" in this project":"";return`Runs ${dm(c.command,u)}${r}, then restarts Leglas. Your rail stays as it is.`}function yx(i,u,c,r){const f={heading:"Leglas",title:null,detail:null,meta:null,note:null,link:null,spinner:!1,warning:!1,primary:null,skip:!1};if(u.status==="waiting")return{...f,...A1(u.version)};if(u.status==="wrong")return{...f,heading:"Something else answered",detail:`Leglas ${u.got} is on this port now, not the ${u.version} that was installed.`,note:`Start it again from your terminal: ${N1(i)}`,warning:!0};if(u.status==="lost")return{...f,heading:"Leglas did not come back",detail:`${u.version} was installed, but nothing answered here.`,note:`Look in the terminal: it may have started on another port. Otherwise start it again there with ${N1(i)}.`,warning:!0};if(i===null)return{...f,detail:"Reading…",spinner:!0};const{phase:m}=i;if(m.status==="installing")return{...f,heading:`Updating to ${m.version}`,detail:`Installing with ${i.install.manager}…`,spinner:!0};if(m.status==="waiting")return{...f,heading:`Updating to ${m.version}`,detail:"Installed. Waiting for the running change to finish, then restarting.",spinner:!0};if(m.status==="restarting")return{...f,...A1(m.version)};if(m.status==="failed")return{...f,heading:`Could not update to ${m.version}`,detail:m.reason,note:i.install.command===null?null:`Or run ${dm(i.install.command,m.version)} yourself.`,warning:!0,primary:{label:"Try again",action:"install",disabled:i.busy}};const v=c||m.status==="checking";if(i.available&&i.latest!==null){const{latest:y}=i,M=y.version===i.skipped,N=i.install.kind!=="source";return{...f,heading:`${y.version} is out`,title:y.title,detail:M?"Skipped. Nothing will nag until the next release.":null,meta:`You have ${i.version}`,note:gx(i,y.version),link:{label:"What's new",url:y.url},primary:N?{label:M?"Update anyway":"Update",action:"install",disabled:i.busy}:null,skip:!M}}const b=i.checkedAt===null?null:px(i.checkedAt,r),x=b===null?null:`Checked ${b}`;return v?{...f,heading:i.version,detail:"Asking npm…",meta:x,link:{label:"Changelog",url:Lo},spinner:!0,primary:{label:"Check again",action:"check",disabled:!0}}:i.checkError!==null?{...f,heading:i.version,detail:i.checkError,meta:b===null?null:`Last answer ${b}`,link:{label:"Changelog",url:Lo},warning:!0,primary:{label:"Try again",action:"check",disabled:!1}}:i.latest===null?{...f,heading:i.version,detail:"Not checked yet.",link:{label:"Changelog",url:Lo},primary:{label:"Check for updates",action:"check",disabled:!1}}:{...f,heading:i.version,detail:"This is the latest version.",meta:x,link:{label:"Changelog",url:Lo},primary:{label:"Check again",action:"check",disabled:!1}}}const xx="flex h-7 shrink-0 items-center justify-center rounded-md px-2.5 text-xs text-[#9CA3AF] transition-colors duration-150 hover:bg-white/[0.06] hover:text-[#D1D5DB] disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none",vx="flex h-7 flex-1 items-center justify-center rounded-md border border-[#2E2E33] px-3 text-xs text-[#D1D5DB] transition-colors duration-150 hover:bg-white/[0.04] hover:text-white motion-reduce:transition-none";function bx({onClose:i,open:u,triggerRef:c,updates:r}){const f=w.useRef(null);rm(u,f,c,i);const[m,v]=w.useState(()=>Date.now());w.useEffect(()=>{if(!u)return;v(Date.now());const y=window.setInterval(()=>v(Date.now()),6e4);return()=>window.clearInterval(y)},[u]);const b=yx(r.status,r.wait,r.checking,m),x=()=>{b.primary!==null&&(b.primary.action==="check"?r.check():r.install())};return o.jsxs("div",{"aria-hidden":!u,"aria-label":"Updates",className:`absolute inset-x-3 top-full z-30 mt-1.5 origin-top-left rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 text-[#D1D5DB] shadow-2xl transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.165,0.84,0.44,1)] focus:outline-none motion-reduce:transition-none ${u?"translate-y-0 scale-100 opacity-100":"pointer-events-none -translate-y-1 scale-95 opacity-0"}`,inert:!u,ref:f,role:"dialog",tabIndex:-1,children:[o.jsxs("div",{className:"flex items-center justify-between px-1 pb-1.5 pt-0.5",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Leglas"}),b.link!==null&&o.jsx("a",{className:"text-[10px] text-[#84848C] transition-colors hover:text-[#D1D5DB]",href:b.link.url,rel:"noreferrer",target:"_blank",children:b.link.label})]}),o.jsxs("div",{className:"px-1",children:[o.jsx("p",{className:"text-xs leading-snug text-white",children:b.heading}),b.title!==null&&o.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-[#D1D5DB]",children:b.title}),b.detail!==null&&o.jsxs("p",{"aria-live":"polite",className:`mt-1 flex items-start gap-1.5 text-[10px] leading-snug ${b.warning?"text-amber-300/90":"text-[#9CA3AF]"}`,children:[b.spinner&&o.jsx("span",{className:"mt-px",children:o.jsx(ti,{})}),b.warning&&o.jsx("span",{className:"mt-px",children:o.jsx(Af,{})}),o.jsx("span",{children:b.detail})]}),b.meta!==null&&o.jsx("p",{className:"mt-0.5 text-[10px] leading-snug text-[#84848C]",children:b.meta})]}),(b.primary!==null||b.skip)&&o.jsxs("div",{className:"mt-2.5 flex items-center gap-1 px-1",children:[b.primary!==null&&o.jsx("button",{className:F1,disabled:b.primary.disabled,onClick:x,type:"button",children:b.primary.label}),b.skip&&o.jsx("button",{className:b.primary===null?vx:xx,onClick:r.skip,type:"button",children:b.primary===null?"Skip this version":"Skip"})]}),b.note!==null&&o.jsx("p",{className:"px-1 pb-0.5 pt-2 text-[10px] leading-snug text-[#84848C]",children:b.note})]})}async function wx(i){const u=await fetch("/leglas/api/update",i===void 0?{}:{signal:i});if(!u.ok)throw await ts(u,`the server answered ${u.status}`);return u.json()}function Sx(){return Tf("/leglas/api/update/check",{},"Leglas could not check for updates.")}function Ex(i){return Tf("/leglas/api/update/skip",{version:i},"Leglas could not skip that version.")}function jx(){return Tf("/leglas/api/update/install",{},"Leglas could not start the update.")}const Cx=15*6e4,Mx=15e3,Nx=1e3;function T1(i){if(i===null)return null;const{phase:u}=i;return u.status==="installing"||u.status==="waiting"?{version:u.version,allowance:mx}:u.status==="restarting"?{version:u.version,allowance:hx}:null}function Ax(i){try{window.sessionStorage.setItem(Cf,i)}catch{}window.location.reload()}function Tx(i,u,c){const[r,f]=w.useState(null),[m,v]=w.useState({status:"none"}),[b,x]=w.useState(!1),y=w.useRef({status:r,wait:m,notify:c});w.useEffect(()=>{y.current={status:r,wait:m,notify:c}});const M=m.status==="waiting";w.useEffect(()=>{if(!i)return;let G=!1;const B=su(Q=>wx(Q).then(W=>{if(G)return;const ee=y.current;if(ee.status!==null&&W.version!==ee.status.version){const ae=ee.wait.status!=="none"?ee.wait.version:T1(ee.status)?.version??null;if(ae===null||W.version===ae){Ax(W.version);return}(ee.wait.status!=="wrong"||ee.wait.got!==W.version)&&v({status:"wrong",version:ae,got:W.version})}else ee.wait.status!=="none"&&v({status:"none"});f(ae=>JSON.stringify(ae)===JSON.stringify(W)?ae:W)}).catch(()=>{if(G||y.current.wait.status!=="none")return;const W=T1(y.current.status);if(W===null)return;const ee=Date.now();v({status:"waiting",version:W.version,since:ee,until:ee+W.allowance})}),{everyMs:M?Nx:u?Mx:Cx,subscribe:Q=>iu().on("update",Q)});return()=>{G=!0,B()}},[i,u,M]),w.useEffect(()=>{if(m.status!=="waiting")return;const{version:G,until:B}=m,Q=window.setTimeout(()=>v(W=>W.status==="waiting"?{status:"lost",version:G}:W),Math.max(0,B-Date.now()));return()=>window.clearTimeout(Q)},[m]);const N=r!==null;w.useEffect(()=>{if(!N)return;let G=null;try{G=window.sessionStorage.getItem(Cf),G!==null&&window.sessionStorage.removeItem(Cf)}catch{return}G!==null&&y.current.notify({kind:"update",message:`Leglas is now ${y.current.status?.version??G}`,tone:"success",ttl:Fe.action})},[N]);const D=G=>B=>y.current.notify({kind:"update",message:B instanceof Error?B.message:G,tone:"danger",ttl:Fe.action});return{status:r,wait:m,checking:b,check:()=>{b||(x(!0),Sx().then(G=>f(G)).catch(D("Leglas could not check for updates.")).finally(()=>x(!1)))},skip:()=>{const G=y.current.status?.latest?.version;G!==void 0&&Ex(G).then(B=>{f(B),y.current.notify({kind:"update",message:`${G} skipped`,note:"Nothing will nag until the next release.",tone:"info",ttl:Fe.plain})}).catch(D("Leglas could not skip that version."))},install:()=>{jx().then(G=>f(G)).catch(D("Leglas could not start the update."))}}}const Dx=6e4,kx={share:null,tunnels:[]};function zx(i){const[u,c]=w.useState(kx),r=u.share!==null;return w.useEffect(()=>{if(!i)return;let f=!1;const m=su(v=>Py(v).then(b=>{f||c(x=>JSON.stringify(x)===JSON.stringify(b)?x:b)}).catch(()=>{}),{everyMs:r?$o:Dx,subscribe:v=>iu().on("share",v)});return()=>{f=!0,m()}},[i,r]),u}const mm=["image/png","image/jpeg","image/webp","image/gif"],Df=4,Ox=1e7;function Rx(i){return mm.includes(i.type)}function _x(i,u){const c=[],r=[];let f=Math.max(0,Df-i.length);for(const m of u){if(!Rx(m)){r.push({file:m,why:"not-an-image"});continue}if(m.size>Ox){r.push({file:m,why:"too-big"});continue}if(f===0){r.push({file:m,why:"too-many"});continue}f-=1,c.push(m)}return{accepted:c,refused:r}}function Lx(i){const u=i[0];if(u===void 0)return null;const c=i.length>1;switch(u.why){case"too-many":return`Up to ${Df} images can ride with a change. ${c?`${i.length} were`:"One was"} left off.`;case"too-big":return`${c?"Some images are":"That image is"} over 10MB, which is more than an agent needs. Left off.`;case"not-an-image":return c?"Only PNG, JPEG, WebP and GIF images can be attached.":`${kf(u.file.name)} is not an image Leglas can attach. PNG, JPEG, WebP or GIF.`}}function kf(i){const u=i.replace(/\s+/g," ").trim();return u===""?"image":u}function Bx(i){const u=kf(i).replace(/[^\x20-\x7E]/g,"").trim();return(u===""?"image":u).slice(0,80)}function Ux(i){if(i<1024)return`${i} B`;const u=i/1024;if(u<1024)return`${Math.round(u)} KB`;const c=u/1024;return`${c<10?c.toFixed(1):Math.round(c)} MB`}function Hx(i){return i.flatMap(u=>u.status==="ready"&&u.id!==null?[u.id]:[])}function qx(i){return i.some(u=>u.status==="failed")?"failed":i.some(u=>u.status==="uploading")?"uploading":null}function Bo(i){return i===void 0?!1:Array.from(i).includes("Files")}function $x({drafts:i,onRemove:u,onRetry:c}){return i.length===0?null:o.jsx("ul",{"aria-label":"Images attached to this change",className:"flex flex-wrap gap-1.5 px-2 pt-2",children:i.map(r=>{const f=r.status==="failed";return o.jsxs("li",{className:"leglas-reference group/reference relative",children:[o.jsx(st,{label:f?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:"Did not upload"}),o.jsx("span",{className:"block text-[#9CA3AF]",children:"Click to try again"})]}):`${r.name} · ${Ux(r.bytes)}`,children:f?o.jsx("button",{"aria-label":`${r.name} did not upload. Try again`,className:"block rounded transition-transform duration-150 focus-visible:outline-2 focus-visible:outline-offset-2 active:scale-[0.96] motion-reduce:transition-none",onClick:()=>c(r.key),type:"button",children:o.jsx(D1,{draft:r,failed:!0})}):o.jsx(D1,{draft:r,failed:!1})}),r.status==="uploading"?o.jsx("span",{"aria-label":"Uploading",className:"absolute bottom-1 right-1 size-3 animate-spin rounded-full border-[1.5px] border-white/30 border-t-white motion-reduce:animate-none",role:"status"}):f?o.jsx("span",{"aria-hidden":"true",className:"absolute bottom-1 right-1 flex size-3 items-center justify-center rounded-full bg-amber-400 text-[9px] font-semibold leading-none text-[#1C1C20]",children:"!"}):null,o.jsx("button",{"aria-label":`Remove ${r.name}`,className:"absolute -right-1.5 -top-1.5 flex size-4 items-center justify-center rounded-full bg-[#1E1E22] text-[#D1D5DB] opacity-0 shadow-[0_0_0_1px_rgba(255,255,255,0.12)] transition-[opacity,color,transform] duration-150 hover:text-white focus-visible:opacity-100 active:scale-[0.96] group-hover/reference:opacity-100 motion-reduce:transition-none",onClick:()=>u(r.key),type:"button",children:o.jsx("svg",{"aria-hidden":!0,fill:"none",height:"8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"8",children:o.jsx("path",{d:"m4 4 8 8M12 4l-8 8"})})})]},r.key)})})}function D1({draft:i,failed:u}){return o.jsx("img",{alt:i.name,className:`block h-10 w-auto min-w-10 max-w-28 rounded object-cover ${u?"opacity-70 shadow-[0_0_0_1px_rgba(251,191,36,0.8)]":"shadow-[0_0_0_1px_rgba(255,255,255,0.1)]"}`,draggable:!1,src:i.url})}const Yx=(i,u)=>fetch(i,u);async function Gx(i,u=Yx){const c=await u("/leglas/api/references",{body:i,headers:{"content-type":i.type,"x-leglas-filename":Bx(i.name??"")},method:"POST"});if(!c.ok)throw new Error("Leglas refused the image.");const r=await c.json(),f=r.reference?.id,m=r.reference?.file;if(r.ok!==!0||typeof f!="string"||typeof m!="string")throw new Error("Leglas refused the image.");return{id:f,file:m}}const Vo=(i,u)=>fetch(i,u);async function Xx(i=Vo){const u=await i("/leglas/api/annotations");if(!u.ok)throw new Error("Leglas refused the notes.");return(await u.json()).annotations??[]}async function zf(i,u,c){const r=await c(i,{body:JSON.stringify(u),headers:{"content-type":"application/json"},method:"POST"});if(!r.ok)throw new Error("Leglas refused the note.");const f=await r.json();if(f.ok!==!0)throw new Error("Leglas refused the note.");return f}function Qx(i,u,c,r=Vo){return zf("/leglas/api/annotations",{anchor:c,note:u,title:i},r)}function Zx(i,u,c=Vo){return zf("/leglas/api/annotations/update",{id:i,note:u},c)}function Vx(i,u=Vo){return zf("/leglas/api/annotations/delete",{ids:i},u)}function Kx(i){return[...new Set(i.filter(u=>u.mode!=="variant"&&(u.status==="queued"||u.status==="picked-up"||u.status==="running")).map(u=>u.title))]}function Fx(i){return new Set(i.filter(u=>u.status==="queued"||u.status==="picked-up"||u.status==="running").flatMap(u=>u.notes??[]))}function Jx(i){return new Set(i.filter(u=>u.status==="picked-up"||u.status==="running").map(u=>u.title))}function Wx(i,u,c=null){if(i==="custom"){const f=c?.trim().split(/\s+/)[0]??"";return{kind:"chosen",id:"custom",name:f===""?"Custom":f.split("/").pop()??"Custom"}}const r=i===null?void 0:u.find(f=>f.id===i);return r?.available?{kind:"chosen",id:r.id,name:r.name}:u.some(f=>f.available)?{kind:"choose"}:{kind:"none"}}function Ix(i){const u=i.max===null?`retry ${i.attempt}`:`retry ${i.attempt} of ${i.max}`,c=i.status,r=i.reason??"";return c===429||r.includes("rate")?`provider is rate limiting · ${u}`:c===401||c===403||r.includes("auth")?`provider refused the login · ${u}`:c===529||c===503||r.includes("overload")?`provider is overloaded · ${u}`:`provider returned an error · ${u}`}function Px(i){const u=Math.max(0,Math.floor(i/1e3));return u<60?`${u}s`:`${Math.floor(u/60)}m ${String(u%60).padStart(2,"0")}s`}function ev(i,u,c){const r=i.find(v=>v.status==="running");if(u.running||r!==void 0)return{kind:"running",id:r?.id??null,name:u.name??"Your agent",activity:u.activity,startedAt:u.startedAt,title:r?.title??null,stopping:u.stopping===!0,waiting:u.stopping===!0?null:u.waiting??null};const f=i.filter(v=>v.status==="queued").length;if(f>0)return{kind:"queued",count:f,attended:c};if(i.some(v=>v.status==="picked-up"))return{kind:"picked-up"};const m=i.findLast(v=>v.status==="failed"||v.status==="cancelled");return m===void 0?null:m.status==="cancelled"?{kind:"stopped",id:m.id,title:m.title}:{kind:"failed",id:m.id,title:m.title,reason:m.failure?.message??null}}const ai=(i,u)=>fetch(i,u),tv=5e3,nv=1e4;async function pm(i,u,c,r){const f=new AbortController,m=setTimeout(()=>f.abort(),c);try{return await r(i,{...u,signal:f.signal})}finally{clearTimeout(m)}}async function k1(i=!1,u=ai){const c=await pm(`/leglas/api/agents${i?"?refresh=1":""}`,void 0,tv,u);if(!c.ok)throw new Error("Leglas refused the agent request.");return c.json()}async function ns(i,u,c){const r=await pm(i,{method:"POST",...u===null?{}:{headers:{"content-type":"application/json"},body:JSON.stringify(u)}},nv,c);if(!r.ok)throw new Error("Leglas refused the agent request.");if((await r.json()).ok!==!0)throw new Error("Leglas refused the agent request.")}function lv(i,u,c=ai){return ns("/leglas/api/agent",{agent:i},c)}function av(i,u,c=ai){return ns("/leglas/api/agent",{agent:i,effort:u},c)}function iv(i=ai){return ns("/leglas/api/agents/warm",null,i)}function sv(i,u=ai){return ns("/leglas/api/requests/cancel",i==null?null:{id:i},u)}function uv(i,u=ai){return ns("/leglas/api/requests/retry",{id:i},u)}function ov(i,u=ai){return ns("/leglas/api/requests/dismiss",{id:i},u)}const gf={claude:{codeLabel:"Terminal command",copyLabel:"Copy Claude Code command",description:"Add Leglas with one terminal command.",label:"Claude Code",nextStep:"Run this command from your project, then ask Claude to list your Leglas directions.",snippet:"claude mcp add leglas -- npx -y leglas-mcp"},other:{codeLabel:"MCP configuration",copyLabel:"Copy MCP configuration",description:"Use standard MCP JSON with another coding agent.",label:"Codex, Cursor & others",nextStep:"Add this configuration in your client's MCP settings, restart the client, then ask it to list your Leglas directions.",snippet:`{
|
|
11
|
+
"mcpServers": {
|
|
12
|
+
"leglas": { "command": "npx", "args": ["-y", "leglas-mcp"] }
|
|
13
|
+
}
|
|
14
|
+
}`}};function rv(i,u){return u==="copying"?"Copying…":u==="copied"?"Copied":i.copyLabel}function cv(i){return i?{title:"Agent connected",detail:"Leglas received activity from an MCP agent in this project."}:{title:"Waiting for agent activity",detail:"This updates after the agent uses a Leglas tool."}}function fv({client:i}){return o.jsx("span",{"aria-hidden":"true",className:"mt-0.5 flex h-5 w-7 shrink-0 items-center justify-center text-[#D1D5DB]",children:i==="claude"?o.jsx(es,{id:"claude",size:17}):o.jsxs("span",{className:"flex -space-x-1.5",children:[o.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-[#25252B] ring-1 ring-[#3A3A42]",children:o.jsx(es,{id:"codex",size:14})}),o.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-[#25252B] ring-1 ring-[#3A3A42]",children:o.jsx(es,{id:"cursor",size:13})})]})})}function dv({connected:i,fallbackFocusRef:u,onClose:c}){const[r,f]=w.useState("claude"),[m,v]=w.useState("idle"),b=w.useRef(null),x=w.useRef(null),y=w.useRef(c);y.current=c,w.useEffect(()=>{const A=b.current;if(A===null)return;const K=document.activeElement,G=Q=>{Q.preventDefault(),y.current()},B=Q=>{if(Q.key!=="Tab")return;const W=Array.from(A.querySelectorAll("button:not(:disabled), input:not(:disabled), [href], [tabindex]:not([tabindex='-1'])")),ee=W[0],ae=W.at(-1);ee===void 0||ae===void 0?(Q.preventDefault(),A.focus()):Q.shiftKey&&document.activeElement===ee?(Q.preventDefault(),ae.focus()):!Q.shiftKey&&document.activeElement===ae&&(Q.preventDefault(),ee.focus())};return A.addEventListener("cancel",G),A.addEventListener("keydown",B),A.open||A.showModal(),x.current?.focus(),()=>{A.removeEventListener("cancel",G),A.removeEventListener("keydown",B),A.open&&A.close();const Q=u.current;(Q?.isConnected?Q:K)?.focus()}},[u]);const M=gf[r],N=cv(i),D=A=>{f(A),v("idle")},R=async()=>{if(m==="copying")return;v("copying");const A=await Zo(M.snippet);v(A==="copied"?"copied":"blocked")};return o.jsx("dialog",{"aria-describedby":"mcp-connect-description","aria-labelledby":"mcp-connect-title","aria-modal":"true",className:"m-auto max-h-[calc(100dvh-2rem)] max-w-none overflow-visible border-0 bg-transparent p-0 text-start text-inherit backdrop:bg-black/55 backdrop:backdrop-blur-sm",onPointerDown:A=>{A.target===A.currentTarget&&c()},ref:b,tabIndex:-1,children:o.jsxs("div",{className:"w-[calc(100vw-2rem)] max-w-lg overscroll-contain rounded-xl border border-[#2A2A30] bg-[#1E1E22] p-5 shadow-2xl",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("span",{"aria-hidden":"true",className:"flex size-10 shrink-0 items-center justify-center rounded-lg border border-[#34343B] bg-[#25252A] shadow-inner",children:o.jsx(au,{size:24})}),o.jsxs("div",{className:"min-w-0 pt-0.5",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(K1,{height:11}),o.jsx("span",{className:"rounded-full bg-[#7C9CFF]/10 px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-[0.08em] text-[#AFC2FF]",children:"MCP setup"})]}),o.jsx("h2",{className:"mt-2 text-base font-medium text-white",id:"mcp-connect-title",children:"Connect agent via MCP"}),o.jsx("p",{className:"mt-1.5 max-w-md text-xs leading-relaxed text-[#9CA3AF]",id:"mcp-connect-description",children:"Connect an MCP-compatible agent so it can handle requests in this project."})]})]}),o.jsxs("fieldset",{className:"mt-5",children:[o.jsx("legend",{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-[#84848C]",children:"MCP client"}),o.jsx("div",{className:"mt-2 grid grid-cols-1 gap-2 sm:grid-cols-2",children:Object.keys(gf).map((A,K)=>{const G=gf[A],B=r===A;return o.jsxs("label",{className:`flex cursor-pointer items-start gap-2.5 rounded-lg border p-3 transition-[background-color,border-color,color] duration-150 ${B?"border-[#6678B8] bg-[#7C9CFF]/10 text-white":"border-[#2A2A30] bg-[#19191D] text-[#D1D5DB] hover:border-[#3A3A42] hover:bg-[#24242A]"}`,children:[o.jsx("input",{checked:B,className:"mt-0.5 size-3.5 shrink-0 accent-[#AFC2FF] focus-visible:outline-2 focus-visible:outline-offset-2",name:"mcp-client",onChange:()=>D(A),ref:K===0?x:void 0,type:"radio",value:A}),o.jsx(fv,{client:A}),o.jsxs("span",{className:"min-w-0",children:[o.jsx("span",{className:"block text-xs font-medium",children:G.label}),o.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-[#84848C]",children:G.description})]})]},A)})})]}),o.jsxs("div",{className:"mt-5 overflow-hidden rounded-lg border border-[#2A2A30] bg-[#151519]",children:[o.jsxs("div",{className:"flex min-h-9 items-center justify-between gap-3 border-b border-[#2A2A30] px-3",children:[o.jsx("span",{className:"text-[10px] font-medium text-[#84848C]",children:M.codeLabel}),o.jsxs("button",{className:"flex min-h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-[10px] font-medium text-[#D1D5DB] transition-[background-color,color,scale] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:opacity-60",disabled:m==="copying",onClick:()=>{R()},type:"button",children:[o.jsx(dn,{d:fn.copy,size:12}),rv(M,m)]})]}),o.jsx("pre",{"aria-label":M.codeLabel,className:"max-h-44 overflow-auto whitespace-pre-wrap break-words p-3 font-mono text-[11px] leading-relaxed text-[#D1D5DB]",tabIndex:0,children:o.jsx("code",{children:M.snippet})})]}),o.jsx("p",{className:"mt-2 min-h-4 text-[10px] leading-relaxed",role:"status",children:m==="blocked"?o.jsx("span",{className:"text-red-300",children:"Clipboard access is blocked. Select and copy the text above."}):m==="copied"?o.jsx("span",{className:"text-emerald-300",children:"Copied to the clipboard."}):null}),o.jsxs("div",{className:"mt-4 space-y-4",children:[o.jsx("p",{className:"text-xs leading-relaxed text-[#9CA3AF]",children:M.nextStep}),o.jsxs("div",{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5 ${i?"bg-emerald-400/10":"bg-white/[0.04]"}`,role:"status",children:[o.jsx("span",{"aria-hidden":"true",className:`mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full ${i?"bg-emerald-400 text-[#123326]":"border border-[#5B5B66]"}`,children:i?o.jsx("svg",{fill:"none",height:"10",viewBox:"0 0 12 12",width:"10",children:o.jsx("path",{d:"m2.2 6.1 2.2 2.2 5.4-5.2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8"})}):null}),o.jsxs("span",{className:"min-w-0",children:[o.jsx("span",{className:`block text-xs font-medium ${i?"text-emerald-200":"text-[#D1D5DB]"}`,children:N.title}),o.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-[#84848C]",children:N.detail})]})]})]}),o.jsx("div",{className:"mt-5 flex justify-end",children:o.jsx("button",{className:"rounded-md bg-[#E8E8EA] px-3 py-1.5 text-xs font-medium text-[#1C1C20] transition-[background-color,scale] duration-150 hover:bg-white active:scale-[0.96]",onClick:c,type:"button",children:"Done"})})]})})}function hv({children:i,label:u}){return u===null?o.jsx(o.Fragment,{children:i}):o.jsx(st,{label:u,side:"right",wide:!0,children:i})}function mv(i,u,c){const r=jf(i);return r===null?null:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block text-white",children:u}),i?.note?o.jsx("span",{className:"mt-0.5 block font-normal text-[#D1D5DB]",children:i.note}):null,o.jsxs("span",{className:"mt-1.5 block border-t border-white/10 pt-1.5 font-normal text-[#84848C]",children:[r.basedOn===null?null:o.jsxs("span",{className:"block",children:["Variant of ",c(r.basedOn)]}),r.askedFor===null?null:o.jsxs("span",{className:"mt-0.5 block",children:["You asked for “",r.askedFor,"”"]})]})]})}const yf=[{key:"satoshi",label:"Satoshi",stack:"var(--font-satoshi)"},{key:"outfit",label:"Outfit",stack:"var(--font-outfit)"},{key:"geist",label:"Geist",stack:"var(--font-geist)"}],xf=["#34D399","#38BDF8","#818CF8","#C084FC","#FB7185","#FB923C"];function pv(i){let u=0;for(const r of i)u=u*31+r.charCodeAt(0)|0;const c=xf[Math.abs(u)%xf.length]??xf[0];return{backgroundColor:`${c}22`,color:c}}const z1=15e3,gv=3e4,O1={height:800,width:1280},yv=96,R1={attached:!1,running:!1,name:null,activity:null,startedAt:null,stopping:!1,waiting:null},xv={agents:[],choice:null,customRun:null,effort:null},_1={low:"Low",medium:"Medium",high:"High",xhigh:"Extra high",max:"Maximum"},gm=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),vv=W1(gm);function bv({mac:i,onClose:u,viewer:c}){const r=w.useRef(null),f=Wg(i,c);return w.useEffect(()=>{const m=document.activeElement;r.current?.focus();const v=b=>{b.key==="Escape"&&(b.preventDefault(),u())};return window.addEventListener("keydown",v),()=>{window.removeEventListener("keydown",v),m?.focus?.()}},[u]),o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-6 backdrop-blur-sm",onPointerDown:m=>{m.target===m.currentTarget&&u()},children:o.jsxs("div",{"aria-label":"Keyboard shortcuts","aria-modal":"true",className:"w-full max-w-sm rounded-lg border border-[#232328] bg-[#1E1E22] p-4 shadow-2xl focus:outline-none",ref:r,role:"dialog",tabIndex:-1,children:[o.jsx("span",{className:"block pb-3 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Keyboard"}),o.jsx("dl",{className:"flex flex-col gap-2.5",children:f.map(m=>o.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[o.jsx("dt",{className:"flex shrink-0 items-baseline gap-1",children:m.keys.map((v,b)=>o.jsxs("span",{className:"flex items-baseline gap-1",children:[b>0&&m.join?o.jsx("span",{className:"text-[10px] text-[#84848C]",children:m.join}):null,o.jsx("kbd",{className:"rounded border border-[#232328] bg-[#2E2E2E]/60 px-1.5 py-0.5 font-sans text-[11px] text-[#E8E8EA]",children:v})]},v))}),o.jsx("dd",{className:"text-right text-xs leading-snug text-[#9CA3AF]",children:m.label})]},m.label))})]})})}function wv({busy:i,count:u,error:c,fallbackFocusRef:r,name:f,onCancel:m,onConfirm:v}){const b=w.useRef(null),x=w.useRef(null),y=w.useRef(m);y.current=m,w.useEffect(()=>{const R=x.current;if(R===null)return;const A=document.activeElement,K=B=>{B.preventDefault(),y.current()},G=B=>{if(B.key!=="Tab")return;const Q=Array.from(R.querySelectorAll("button:not(:disabled)")),W=Q[0],ee=Q.at(-1);W===void 0||ee===void 0?(B.preventDefault(),R.focus()):B.shiftKey&&document.activeElement===W?(B.preventDefault(),ee.focus()):!B.shiftKey&&document.activeElement===ee&&(B.preventDefault(),W.focus())};return R.addEventListener("cancel",K),R.addEventListener("keydown",G),R.open||R.showModal(),b.current?.focus(),()=>{R.removeEventListener("cancel",K),R.removeEventListener("keydown",G),R.open&&R.close(),(A?.isConnected?A:r.current)?.focus()}},[]);const M=u===1,N=M?"Delete removed direction?":"Clear removed directions?",D=M?`This permanently removes “${f??"this direction"}” from Leglas.`:`This permanently removes all ${u} directions from Leglas.`;return o.jsx("dialog",{"aria-describedby":"delete-removed-description","aria-labelledby":"delete-removed-title","aria-modal":"true",className:"m-auto max-h-[calc(100dvh-3rem)] max-w-none overflow-visible border-0 bg-transparent p-0 text-left text-inherit backdrop:bg-black/50 backdrop:backdrop-blur-sm",onPointerDown:R=>{R.target===R.currentTarget&&!i&&m()},ref:x,role:"alertdialog",tabIndex:-1,children:o.jsxs("div",{className:"w-[calc(100vw-3rem)] max-w-sm overscroll-contain rounded-lg border border-[#232328] bg-[#1E1E22] p-4 shadow-2xl",children:[o.jsx("h2",{className:"text-sm font-medium text-white",id:"delete-removed-title",children:N}),o.jsxs("div",{className:"mt-2 space-y-1 text-xs leading-relaxed text-[#9CA3AF]",id:"delete-removed-description",children:[o.jsx("p",{children:D}),o.jsx("p",{children:"Source files and shared project config stay untouched."})]}),c!==null?o.jsx("p",{className:"mt-3 text-xs leading-relaxed text-red-300",role:"alert",children:c}):null,o.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[o.jsx("button",{className:"rounded-md px-3 py-1.5 text-xs text-[#D1D5DB] transition-[background-color,color,scale] hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:opacity-50",disabled:i,onClick:m,ref:b,type:"button",children:"Cancel"}),o.jsx("button",{className:"rounded-md bg-red-500/90 px-3 py-1.5 text-xs font-medium text-white transition-[background-color,scale] hover:bg-red-500 active:scale-[0.96] disabled:opacity-60",disabled:i,onClick:v,type:"button",children:i?"Deleting…":M?"Delete":"Delete all"})]})]})})}const L1="linear-gradient(to bottom, transparent, black 12px, black calc(100% - 12px), transparent)";function Sv(i){let u=0;for(const c of i)u=u*31+c.charCodeAt(0)|0;return Math.abs(u).toString(36)}function Ev({previews:i,project:u,scanPreviews:c=!0,viewer:r,warnings:f=[]}){const m=w.useRef(null),v=w.useRef(null),b=w.useRef(null),[x,y]=w.useState(!1),[M,N]=w.useState(null),[D,R]=w.useState(!1),[A,K]=w.useState(!1),G=w.useCallback(()=>b.current?.(),[]),B=w.useCallback(()=>y(h=>!h),[]),Q=w.useCallback(()=>y(!1),[]),[W,ee]=w.useState(!1),ae=w.useCallback(()=>ee(h=>!h),[]),se=w.useCallback(()=>cs(h=>!h),[]),p=Oy({previews:i,project:u,searchRef:m,onToggleSplit:G,onToggleHelp:B,onToggleTools:ae,onToggleNote:r===void 0?se:void 0,suspended:x||M!==null||D,viewer:r===void 0?void 0:{layout:r.layout}}),P=p.viewing,[he,pe]=w.useState(!1),le=w.useCallback(()=>pe(!1),[]),ce=w.useRef(null),Me=zx(!P),[we,_e]=w.useState(!1),U=w.useCallback(()=>_e(!1),[]),I=w.useRef(null),ie=Tx(!P,we,p.notify),Ne=fm(ie.status),Se=ay(p.lanes),E=p.insets,q=Uo.current[0],te=w.useRef(null),oe=w.useRef(new Map),me=h=>{if(te.current===null)return!1;!te.current.has(h)&&!oe.current.has(h)&&oe.current.set(h,performance.now());const j=oe.current.get(h);return j!==void 0&&performance.now()-j<1e3},je=h=>me(h)||(p.railChildren.get(h)??[]).some(j=>me(j));w.useEffect(()=>{const h=te.current??new Set;for(const j of p.rows)h.add(j);te.current=h});const[z,Y]=w.useState({nonce:0,title:""});w.useEffect(()=>{if(z.title==="")return;const h=setTimeout(()=>Y(j=>({...j,title:""})),950);return()=>clearTimeout(h)},[z]);const[ne,de]=w.useState(null),Oe=w.useRef(null),qe=w.useCallback(h=>{if(Oe.current&&clearTimeout(Oe.current),Oe.current=null,h===null){de(null);return}Oe.current=setTimeout(()=>{Oe.current=null,de(h)},120)},[]);w.useEffect(()=>()=>{Oe.current&&clearTimeout(Oe.current)},[]);const Ie=h=>h===""?{nodes:[],edges:[]}:$2(p.railParents,p.railChildren,h),nt=ne!==null?Ie(ne):{nodes:[],edges:[]},Xe=nt.edges.length>0?nt:Ie(p.active),Qe=Y2(p.rows,p.rowMeta,Xe),jt=w.useRef(new Map),hn=w.useRef(!1);hn.current=!1;const[,Qn]=w.useReducer(h=>h+1,0),Bl=h=>{const j=p.rowMeta.get(h)?.graph;if(!j)return;const L=jt.current.get(h),Z=new Set(df(j).filter(J=>!L?.has(J)));return Z.size>0&&(hn.current=!0),Z},al=p.rows.map(h=>{const j=p.rowMeta.get(h)?.graph;return j?`${h}=${df(j).join(",")}`:h}).join("|");w.useEffect(()=>{const h=p.rows.map(Z=>[Z,p.rowMeta.get(Z)?.graph]),j=hn.current,L=setTimeout(()=>{jt.current=new Map(h.flatMap(([Z,J])=>J?[[Z,new Set(df(J))]]:[])),j&&Qn()},700);return()=>clearTimeout(L)},[al]);const Ul=h=>{if(!ls&&typeof document.startViewTransition=="function"){document.startViewTransition(()=>cy.flushSync(()=>p.toggleFamily(h)));return}p.toggleFamily(h)},ii=h=>{if(qe(h),h===null){Nn(L=>({...L,on:!1}));return}Y(L=>({nonce:L.nonce+1,title:h}));const j=[...Hn.current?.querySelectorAll("li[data-title]")??[]].find(L=>L.dataset.title===h);j&&Nn(fl(j))},Rt=()=>{A||N(null)},wa=async()=>{if(M===null||A)return;const h=M;K(!0),N({...h,error:null});try{await p.deleteRemoved(h.titles),N(null),p.notify({kind:`delete:${h.titles.join("|")}`,message:h.titles.length===1?`${p.displayName(h.titles[0]??"")} permanently deleted`:`${h.titles.length} removed directions permanently deleted`,tone:"info",ttl:Fe.plain})}catch(j){N({...h,error:j instanceof Error?j.message:"The directions could not be deleted."})}finally{K(!1)}},[Sa,il]=w.useState(!1),[mn,si]=w.useState(null),ui=mn!==null,Hl=w.useRef(!1),[Zn,Vn]=w.useState(""),[pt,Cn]=w.useState("variant");w.useEffect(()=>{const h=v.current;h!==null&&(h.style.height="0px",h.style.height=`${Math.min(h.scrollHeight,96)}px`)},[Zn,p.prefs.width]);const[ct,sl]=w.useState(!1),[Qt,Kn]=w.useState([]),Mn=w.useRef(new Map),ul=w.useRef(null),[ol,Wt]=w.useState(!1),It=w.useRef(0),Fn=w.useCallback((h,j)=>{Mn.current.set(h,j),Kn(L=>L.map(Z=>Z.key===h?{...Z,status:"uploading",id:null}:Z)),Gx(j).then(({id:L})=>Kn(Z=>Z.map(J=>J.key===h?{...J,status:"ready",id:L}:J))).catch(()=>Kn(L=>L.map(Z=>Z.key===h?{...Z,status:"failed",id:null}:Z)))},[]),ql=h=>{if(p.active===null||ct)return;const{accepted:j,refused:L}=_x(Qt,h),Z=Lx(L);if(Z!==null&&p.notify({kind:"reference",message:Z,tone:"info",ttl:Fe.action}),j.length===0)return;const J=j.map(ue=>({key:crypto.randomUUID(),name:kf(ue.name),type:ue.type,bytes:ue.size,url:URL.createObjectURL(ue),status:"uploading",id:null}));Kn(ue=>[...ue,...J]),J.forEach((ue,fe)=>{const ye=j[fe];ye!==void 0&&Fn(ue.key,ye)})},oi=h=>{Mn.current.delete(h);const j=Qt.find(L=>L.key===h);j!==void 0&&URL.revokeObjectURL(j.url),Kn(L=>L.filter(Z=>Z.key!==h))},Ea=h=>{const j=Mn.current.get(h);j!==void 0&&Fn(h,j)},rl=()=>{Mn.current.clear();for(const h of Qt)URL.revokeObjectURL(h.url);Kn([])},[cl,ja]=w.useState(null),[Jn,Ca]=w.useState(!1),[$,re]=w.useState(!1),[Ae,ve]=w.useState(null),Ee=w.useRef(null),Le=w.useRef(null),ke=w.useRef(null),ut=w.useRef(null),Pt=w.useRef(null),ou=w.useRef(null),[Ko,ru]=w.useState(yv);w.useEffect(()=>{const h=ou.current;if(h===null||typeof ResizeObserver>"u")return;const j=()=>ru(h.offsetHeight);j();const L=new ResizeObserver(j);return L.observe(h),()=>L.disconnect()},[]);const Hn=w.useRef(null),[$l,Nn]=w.useState({height:0,left:0,on:!1,top:0}),fl=h=>({height:h.offsetHeight,left:h.querySelector('[role="button"]')?.offsetLeft??0,on:!0,top:h.offsetTop});w.useEffect(()=>{Nn(h=>h.on?{...h,on:!1}:h)},[p.rows.join("|")]);const[Je,pn]=w.useState(null),vt=w.useRef(null),Yl=w.useRef(null);w.useEffect(()=>{vt.current=Je},[Je]),w.useEffect(()=>{if(!p.focusing)return;const h=p.focusing.target==="search"?m.current:v.current;h?.focus(),h?.select()},[p.focusing]),w.useEffect(()=>{if(!Je)return;const h=Yl.current;if(!h)return;const j=Z=>{const J=Z.clientY-h.startY,ue=Z.clientX-h.startX;pn(fe=>{if(!fe||fe.settling)return fe;if(!fe.started)return Math.abs(J)<=4&&Math.abs(ue)<=4?{...fe,dy:J}:Math.abs(ue)>Math.abs(J)?null:(window.getSelection()?.removeAllRanges(),p.setDragFolded(new Set(h.siblings.filter(gt=>(p.rowMeta.get(gt)?.descendants??0)>0))),{...fe,dy:0,measured:!1,started:!0});if(!fe.measured)return fe;const ye=h.rows[fe.from];if(!ye)return fe;const[Ze,Pe]=fe.span??[0,h.rows.length-1],mt=gt=>{const an=h.rows[gt];return an?gt<=fe.from?an.top:an.top+an.height-ye.height:ye.top},_t=mt(Ze)-ye.top,Be=mt(Pe)-ye.top,zt=ye.height,wt=zt/3;let Ft=J,rt=!1;J<_t?(Ft=_t+Math.max(-wt,(J-_t)*.3),rt=J<_t-zt):J>Be&&(Ft=Be+Math.min(wt,(J-Be)*.3),rt=J>Be+zt),Ft=Math.max(h.minDy,Math.min(h.maxDy,Ft));const Ha=ye.top+Math.max(_t,Math.min(Be,J));let ln=fe.from,qa=1/0;for(let gt=Ze;gt<=Pe;gt+=1){const an=Math.abs(mt(gt)-Ha);an<qa&&(qa=an,ln=gt)}return{...fe,blocked:rt,dy:Ft,started:!0,to:ln}})},L=()=>{const Z=vt.current;if(!Z?.started){pn(null);return}h.suppressed=!0;const J=Z.blocked&&Z.reason!==null,ue=J?Z.from:Z.to,fe=h.rows[Z.from],ye=h.rows[ue];let Ze=0;fe&&ye&&(Ze=(ue<=Z.from?ye.top:ye.top+ye.height-fe.height)-fe.top),pn({...Z,dy:Ze,settling:!0,to:ue}),window.setTimeout(()=>{if(J)p.notify(cu(Z.title,h.parent,h.siblings));else if(ue!==Z.from){const[,Pe]=Z.span??[0,h.rows.length-1],mt=ue>Z.from?ue+1<=Pe?h.rows[ue+1]?.title??null:null:h.rows[ue]?.title??null;p.reorderAmong(Z.title,mt,h.siblings)}p.setDragFolded(new Set),pn(null),window.setTimeout(()=>{h.suppressed=!1},0)},190)};return window.addEventListener("pointermove",j),window.addEventListener("pointerup",L),window.addEventListener("pointercancel",L),()=>{window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",L),window.removeEventListener("pointercancel",L)}},[Je!==null]),w.useLayoutEffect(()=>{if(!Je?.started||Je.measured)return;const h=Yl.current,j=Hn.current,L=j?.parentElement;if(!h||!j||!L)return;const Z=[...j.querySelectorAll("li[data-title]")],J=Z.map(Be=>({height:Be.offsetHeight,mid:Be.offsetTop+Be.offsetHeight/2,title:Be.dataset.title??"",top:Be.offsetTop})),ue=J.findIndex(Be=>Be.title===Je.title),fe=J[ue],ye=Z[ue];if(!fe||!ye)return;h.startY-=h.oldTop-fe.top,h.rows=J;const Ze=L.getBoundingClientRect(),Pe=ye.getBoundingClientRect();h.minDy=Ze.top-Pe.top,h.maxDy=Ze.bottom-Pe.bottom;const mt=h.siblings.map(Be=>J.findIndex(zt=>zt.title===Be)).filter(Be=>Be!==-1),_t=mt.length?[Math.min(...mt),Math.max(...mt)]:null;pn(Be=>Be&&!Be.measured?{...Be,from:ue,height:fe.height,measured:!0,span:_t,to:ue}:Be)},[Je?.started,Je?.measured,Je?.title]);const cu=(h,j,L)=>{const Z=p.displayName(h),J=j===null?null:p.displayName(j),ue=L.length<2;return{note:J===null?`${Z} is the only direction at the top level; its variants travel with it.`:ue?`Nothing to reorder it among. Drag ${J} to move the whole family.`:`Where a direction sits comes from what it was based on. Drag ${J} to move the whole family.`,kind:"reorder",message:J===null?"Nothing to reorder":ue?`${Z} is ${J}'s only variant`:`${Z} stays under ${J}`,tone:"info",ttl:Fe.action}};w.useEffect(()=>{if(!W)return;Le.current?.focus();const h=Z=>{Z.key==="Escape"&&(ee(!1),Ee.current?.focus())},j=Z=>{const J=Z.target;!Le.current?.contains(J)&&!Ee.current?.contains(J)&&ee(!1)},L=()=>ee(!1);return window.addEventListener("keydown",h),window.addEventListener("pointerdown",j),window.addEventListener("blur",L),()=>{window.removeEventListener("keydown",h),window.removeEventListener("pointerdown",j),window.removeEventListener("blur",L)}},[W]);const en="flex h-7 w-full items-center justify-between gap-2 whitespace-nowrap rounded px-2 text-xs hover:bg-[#2E2E2E] hover:text-white disabled:cursor-not-allowed disabled:opacity-40",Wn=yf.find(h=>h.key===p.prefs.font)??yf[0],ri=p.prefs.viewport!==null,fu=48,Zt=Je?.started??!1,[ls]=w.useState(()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches),[qn,ci]=w.useState(null),[$n,Vt]=w.useState([]),fi=Xe.edges,Fo=`${fi.map(h=>h.join(">")).join(",")}|${Zt}|${p.prefs.width}|${Se}`,Ma=h=>ci(j=>{if(j?.d===h?.d)return j;if(j!==null){const L=j;Vt(Z=>[...Z.filter(J=>J.d!==L.d),L]),setTimeout(()=>Vt(Z=>Z.filter(J=>J!==L)),460)}return h});w.useLayoutEffect(()=>{const h=Hn.current;if(Zt||h===null||fi.length===0){Ma(null);return}const j=()=>{const Z=h.getBoundingClientRect(),J=new Map,ue=[...h.querySelectorAll("li[data-title]")];for(const ye of Xe.nodes){const Ze=ue.find(zt=>zt.dataset.title===ye),Pe=Ze?.querySelector("[data-mark]");if(!Ze||!Pe)return Ma(null);const mt=Pe.getBoundingClientRect(),_t=Number(Pe.getAttribute("r")??0),Be=ye===p.active?3.75:0;J.set(ye,{clear:Be>0||_t>1.5?_t+2+Be:0,x:mt.left+mt.width/2-Z.left,y:mt.top+mt.height/2-Ze.getBoundingClientRect().top+Ze.offsetTop})}const fe=fi.map(([ye,Ze])=>W2([J.get(ye),J.get(Ze)])).join(" ");Ma({d:fe,height:h.scrollHeight,marks:[...J.values()]})};j();const L=new ResizeObserver(j);return L.observe(h),()=>L.disconnect()},[Zt,Fo]);const as=p.resizing||Zt||ui,[dl,hl]=w.useState({}),[tn,di]=w.useState({}),[hi,ml]=w.useState(r?.scope==="compare"),[Gl,Na]=w.useState(r?.layout.compare??null),mi=r===void 0?null:`${r.scope}${r.layout.compare??""}`,[Xl,Jo]=w.useState(mi);mi!==Xl&&(Jo(mi),r!==void 0&&(ml(r.scope==="compare"),Na(r.layout.compare)));const is=w.useRef(null);w.useEffect(()=>()=>{is.current=p.active},[p.active]),b.current=()=>{!hi&&Dt!==null&&Na(Dt),(Dt!==null||hi)&&ml(h=>!h)};const Dt=u2({active:p.active,previous:is.current,pinned:Gl,parent:p.parentOf(p.active),rows:p.rows}),pl=o2({active:p.active,compare:Dt,split:hi}),qt=pl.length>1,Aa=pl,Ql=w.useRef(new Map),$t=h=>Ig(h,p.urlFor(h),tn[h]??0),Zl=h=>{const j=$t(h);return Ql.current.get(h)===j&&p.isLoaded(h,j)},pi=Aa.filter(h=>p.branchState(h)?.status==="idle").join("");w.useEffect(()=>{for(const h of pi.split("").filter(Boolean))p.startBranch(h)},[pi]);const gn=new Map(Aa.map(h=>[h,$t(h)])),gl=[...gn.values()].join(""),ss=w.useRef(gn);ss.current=gn,w.useLayoutEffect(()=>{const h=Ql.current,j=[...gn].filter(([L,Z])=>h.get(L)!==Z);for(const[L]of j)p.resetLoaded(L);j.some(([L])=>dl[L])&&hl(L=>{const Z={...L};for(const[J]of j)Z[J]=!1;return Z}),Ql.current=new Map(gn)},[gl]);const gi=w.useRef(null),us=w.useRef(null),[Yn,An]=w.useState({height:0,width:0}),os=w.useCallback(h=>{if(gi.current=h,us.current?.disconnect(),h===null)return;const j=h.getBoundingClientRect();An({height:j.height,width:j.width});const L=new ResizeObserver(([Z])=>{const J=Z?.contentRect;J&&An({height:J.height,width:J.width})});L.observe(h),us.current=L},[]),{boxHeight:Ta,boxWidth:In,designWidth:yi,frameHeight:xi,scale:vi,scaling:nn}=f2({gutter:fu,panes:pl.length,scaleSplit:p.prefs.scaleSplit,stageHeight:Yn.height,stageWidth:Yn.width,viewport:p.prefs.viewport}),Da=p.prefs.viewport!==null?Math.round(p.prefs.viewport):Yn.width<=0?null:Math.round(qt&&!nn?(Yn.width-1)/2:Yn.width),du=mn?(()=>{const{x:h,y:j}=R2(mn);return{bottom:"auto",left:h,right:"auto",top:j}})():void 0,Yt=h=>{if(h.button!==0)return;const j=gi.current?.getBoundingClientRect();if(!j)return;const L=h.currentTarget;L.setPointerCapture(h.pointerId),Hl.current=!1;const Z={x:h.clientX,y:h.clientY};let J=!1;const ue=ye=>{!J&&!_2(Z,{x:ye.clientX,y:ye.clientY})||(J=!0,si(O2({x:ye.clientX-j.left,y:ye.clientY-j.top},{width:j.width,height:j.height})))},fe=ye=>{if(L.hasPointerCapture(ye.pointerId)&&L.releasePointerCapture(ye.pointerId),L.removeEventListener("pointermove",ue),L.removeEventListener("pointerup",fe),L.removeEventListener("pointercancel",fe),si(null),!J)return;Hl.current=!0;const{corner:Ze}=L2({x:ye.clientX-j.left,y:ye.clientY-j.top},{width:j.width,height:j.height});p.setPrefs(Pe=>({...Pe,corner:Ze})),ee(!1)};L.addEventListener("pointermove",ue),L.addEventListener("pointerup",fe),L.addEventListener("pointercancel",fe)},[kt,ka]=w.useState(i2),Tn=new Set(i.filter(J0).map(h=>h.title)),Wo=Tn.size>0,[yn,rs]=w.useState({requests:[],agent:R1}),[za,bi]=w.useState([]),[Pn,cs]=w.useState(!1),[xn,wi]=w.useState(xv),[Si,fs]=w.useReducer(h=>h+1,0);w.useEffect(()=>{if(P)return;let h=!1;return k1(Si>0).then(j=>{h||wi(L=>JSON.stringify(L)===JSON.stringify(j)?L:j)}).catch(()=>{}),()=>{h=!0}},[Si,P]);const[Io,yl]=w.useReducer(h=>h+1,0);w.useEffect(()=>{if(P)return;let h=!1;const L=su(async Z=>{const J=(ue,fe)=>fetch(ue,{...fe,signal:Z});await fetch("/leglas/api/requests",{signal:Z}).then(ue=>ue.json()).then(ue=>{if(h)return;const fe={requests:ue.requests,agent:ue.agent??R1};rs(ye=>JSON.stringify(ye)===JSON.stringify(fe)?ye:fe)}).catch(()=>{}),await Xx(J).then(ue=>{h||bi(fe=>JSON.stringify(fe)===JSON.stringify(ue)?fe:ue)}).catch(()=>{})},{everyMs:$o,subscribe:Z=>iu().on("requests",Z)});return()=>{h=!0,L()}},[Io,P]);const bt=Wx(xn.choice,xn.agents,xn.customRun),hu=w.useRef(0),Ei=()=>{if(bt.kind!=="chosen")return;const h=Date.now();h-hu.current<gv||(hu.current=h,iv().catch(()=>{}))},xl=bt.kind==="chosen"?xn.agents.find(h=>h.id===bt.id&&h.available):void 0,ds=xn.effort!==null&&xl?.efforts.includes(xn.effort)?xn.effort:null,Gt=p.active===null?[]:za.filter(h=>h.title===p.active),hs=(()=>{const h=jf(p.active===null?void 0:p.previewFor(p.active));return h===null?null:Ry(h.basedOn===null?null:p.displayName(h.basedOn),h.askedFor)})(),ji=p.active===""?[]:p.ancestryOf(p.active),Po=bt.kind==="chosen"&&xn.agents.some(h=>h.id===bt.id&&h.auth==="signed-out"),Te=ev(yn.requests,yn.agent,bt.kind==="chosen"||yn.agent.attached),er=Te===null?null:Te.kind==="running"?Te.stopping?`Stopping ${Te.name}`:`${Te.name} is on it`:Te.kind==="queued"?Te.count===1?"Change queued":`${Te.count} changes queued`:Te.kind==="picked-up"?"Your agent is on it":Te.kind==="stopped"?"You stopped that change":"That change failed",ms=Te===null?null:Te.kind==="running"?Te.stopping?"waiting for it to exit":Te.waiting!==null?Ix(Te.waiting):Te.activity??Te.title:Te.kind==="queued"?Te.attended?"your agent picks it up next":"pick who runs your changes":Te.kind==="failed"?Te.reason??Te.title:Te.kind==="stopped"?Te.title:null,Ci=Te?.kind==="running"?Te.startedAt:null,[tr,mu]=w.useState(()=>Date.now());w.useEffect(()=>{if(Ci===null)return;mu(Date.now());const h=window.setInterval(()=>mu(Date.now()),1e3);return()=>window.clearInterval(h)},[Ci]),w.useEffect(()=>{bt.kind==="none"&&re(!1)},[bt.kind]),w.useEffect(()=>{if(!$)return;ke.current?.focus();const h=Z=>{Z.key==="Escape"&&(re(!1),ut.current?.focus())},j=Z=>{const J=Z.target;!ke.current?.contains(J)&&!ut.current?.contains(J)&&re(!1)},L=()=>re(!1);return window.addEventListener("keydown",h),window.addEventListener("pointerdown",j),window.addEventListener("blur",L),()=>{window.removeEventListener("keydown",h),window.removeEventListener("pointerdown",j),window.removeEventListener("blur",L)}},[$]);const nr=h=>{if(cl!==null||Jn)return;const j=xn.agents.find(L=>L.id===h)?.name??"Agent";ja(h),lv(h).then(()=>{fs(),re(!1)}).catch(async()=>{try{const L=await k1(!0);if(wi(L),L.choice===h){re(!1);return}}catch{}p.notify({kind:"agent-choice",message:`${j} wasn’t selected. Try again.`,tone:"danger",ttl:Fe.action})}).finally(()=>ja(null))},lr=h=>{if(xl===void 0||Jn||cl!==null)return;const j=xn.effort;Ca(!0),wi(L=>({...L,effort:h})),av(xl.id,h).then(()=>fs()).catch(()=>{wi(L=>({...L,effort:j})),p.notify({kind:"agent-choice",message:"Effort could not be saved. Agent settings did not change.",tone:"danger",ttl:Fe.action})}).finally(()=>Ca(!1))},ar=h=>{Ae===null&&(ve("cancel"),sv(h).then(()=>yl()).catch(()=>{p.notify({kind:"agent-cancel",message:"Leglas could not stop that run.",tone:"danger",ttl:Fe.action})}).finally(()=>ve(null)))},ir=h=>{Ae===null&&(ve("retry"),uv(h).then(()=>yl()).catch(()=>{p.notify({kind:"agent-retry",message:"That change could not be retried.",tone:"danger",ttl:Fe.action})}).finally(()=>ve(null)))},sr=h=>{Ae===null&&(ve("dismiss"),ov(h).then(()=>yl()).catch(()=>{p.notify({kind:"agent-dismiss",message:"That change could not be dismissed.",tone:"danger",ttl:Fe.action})}).finally(()=>ve(null)))};w.useEffect(()=>{let h=!1;const L=su(Z=>fetch("/leglas/api/health",{signal:Z}).then(J=>J.json()).then(({reachable:J})=>{h||ka(ue=>s2(ue,J))}).catch(()=>{}),{everyMs:$o,subscribe:Z=>iu().on("health",Z)});return()=>{h=!0,L()}},[]),w.useEffect(()=>{!kt.reachable||!kt.wasDown||(hl(h=>{const j={...h};for(const L of Object.keys(j))Tn.has(L)&&(j[L]=!1);return j}),di(h=>{const j={...h};for(const L of Tn)j[L]=(j[L]??0)+1;return j}),ka(h=>({...h,wasDown:!1})))},[kt.reachable,kt.wasDown]);const[pu,Oa]=w.useState({}),[Ra,ur]=w.useState(()=>!document.hidden);w.useEffect(()=>{const h=()=>ur(!document.hidden);return document.addEventListener("visibilitychange",h),()=>document.removeEventListener("visibilitychange",h)},[]);const Mi=new Map(i.map(h=>[h.title,$t(h.title)])),gu=[...Mi].map(([h,j])=>`${h}${j}`).join(""),ps=w.useRef(new Map);w.useLayoutEffect(()=>{const h=A2(ps.current,Mi);h.length>0&&Oa(j=>ff(j,h)),ps.current=new Map(Mi)},[gu]);const Vl=(h,j)=>{let L=null;try{L=h.contentDocument}catch{return}if(!L?.head)return;const Z="leglas-hide-dev-overlays",J=(ue,fe,ye)=>{const Ze=ue.getElementById(Z);if(!j){Ze?.remove();return}if(Ze)return;const Pe=L.createElement("style");Pe.id=Z,Pe.textContent=ye,fe.appendChild(Pe)};J(L,L.head,d2);for(const ue of L.querySelectorAll("nextjs-portal")){const fe=ue.shadowRoot;fe&&J(fe,fe,h2)}};w.useEffect(()=>{for(const h of document.querySelectorAll("iframe"))Vl(h,!p.prefs.showDevOverlays)});const yu=h=>{let j=null;try{j=h.contentDocument}catch{return}if(!j?.body)return;const L=[...j.body.querySelectorAll("*")].slice(0,400).map(fe=>fe.tagName),Z=j.defaultView,J=Z?M2(j.body,fe=>{const ye=Z.getComputedStyle(fe);return{backgroundColor:ye.backgroundColor,backgroundImage:ye.backgroundImage,color:ye.color}}):[],ue=Z?C2(j.body,(fe,ye)=>Z.getComputedStyle(fe,ye)):[];return p2(j.body.innerText??"",L,J,ue)},Kl=(h,j)=>{let L;try{L=h.contentDocument?.fonts}catch{}const Z=new Promise(ue=>window.setTimeout(ue,900));(L?.status==="loading"?Promise.race([L.ready.then(()=>{}),Z]):Promise.resolve()).then(()=>{const ue=()=>{Vl(h,!p.prefs.showDevOverlays),j(yu(h))};typeof window.requestIdleCallback=="function"?window.requestIdleCallback(ue,{timeout:1200}):window.setTimeout(ue,0)})},xu=w.useRef(new WeakSet),Ni=(h,j,L)=>{if(ss.current.get(h)!==j)return;p.markLoaded(h,j),hl(J=>J[h]?{...J,[h]:!1}:J),Vl(L,!p.prefs.showDevOverlays);let Z=null;try{Z=L.contentDocument}catch{}Z===null||xu.current.has(Z)||xu.current.add(Z)},vu=w.useRef(Ni);vu.current=Ni,w.useEffect(()=>{const h=j=>{if(j.origin!==window.location.origin)return;const L=l2(j.data);if(L===null)return;const Z=a2(document.querySelectorAll("iframe[data-preview]"),j.source),J=Z?.dataset.preview,ue=Z?.dataset.previewIdentity;Z===null||J===void 0||ue===void 0||(L==="ready"?vu.current(J,ue,Z):hl(fe=>({...fe,[J]:!0})))};return window.addEventListener("message",h),()=>window.removeEventListener("message",h)},[]);const bu=c&&!P?kt.reachable?i:i.filter(h=>!J0(h)):[],vl=Kx(yn.requests),_a=vl.toSorted().join("\0"),La=yn.agent.running||vl.length>0,or=Jx(yn.requests),Ai=Fx(yn.requests);w.useEffect(()=>{vl.length!==0&&Oa(h=>ff(h,vl))},[_a]);const wu=Aa.every(h=>Zl(h)),gs=vl.length>0?ff(pu,vl):pu,ys=D2(i,gs),bl=N2(ys),Dn=!La&&wu&&Ra?k2(bu,gs)[0]??null:null,Su=Dn?.title??null,Ba=Dn===null?null:`${Dn.title}\0${Dn.url}`,xs=w.useRef(Ba);xs.current=Ba;const vs=w.useRef(null),Eu=w.useRef(new Map(i.map(h=>[h.title,h.url])));Eu.current=new Map(i.map(h=>[h.title,h.url]));const ju=(h,j,L)=>{const Z=`${h.title}\0${h.url}`;xs.current===Z&&vs.current===L&&Eu.current.get(h.title)===h.url&&Oa(J=>T2(J,h,j))};w.useEffect(()=>{if(Dn===null)return;const h=vs.current;if(h===null)return;const j=window.setTimeout(()=>{ju(Dn,{status:"failed"},h)},z1);return()=>clearTimeout(j)},[Ba]);const rr=(h,j)=>{Sf(j)&&(Vl(j,!p.prefs.showDevOverlays),window.setTimeout(()=>{const L=`${h.title}\0${h.url}`;xs.current===L&&Kl(j,Z=>{ju(h,Z===void 0?{status:"failed"}:{status:"complete",signature:Z},j)})},600))};w.useEffect(()=>{const h=[];for(const j of Aa){const L=gn.get(j)??$t(j);if(p.isLoaded(j,L)||dl[j])continue;const Z=document.querySelector(`iframe[data-preview="${CSS.escape(j)}"]`);if(Z===null)continue;const J=kt.reachable||!Tn.has(j)?z1:0;h.push(n2({frame:Z,onFailure:()=>hl(ue=>({...ue,[j]:!0})),onReady:()=>Ni(j,L,Z),sameOrigin:p.urlFor(j).startsWith("/"),timeoutMs:J}))}return()=>{for(const j of h)j()}},[gl,p.loaded,dl,kt.reachable]);const Kt=h=>{hl(j=>({...j,[h]:!1})),p.resetLoaded(h),di(j=>({...j,[h]:(j[h]??0)+1}))},Ua=(h,j)=>L=>{if(L.button!==0||P||p.renaming||p.query.trim()||p.rows.length<2||L.target.closest("button, [data-selectable]"))return;const Z=Hn.current,J=Z?.parentElement;if(!Z||!J)return;const ue=[...Z.querySelectorAll("li[data-title]")],fe=ue.map(wt=>({height:wt.offsetHeight,mid:wt.offsetTop+wt.offsetHeight/2,title:wt.dataset.title??"",top:wt.offsetTop})),ye=J.getBoundingClientRect(),Ze=ue[j]?.getBoundingClientRect(),Pe=p.railParents.get(h)??null,mt=Pe===null?p.railRoots:p.railChildren.get(Pe)??[h],_t=mt.length<2?Pe===null?"Nothing to reorder":`${p.displayName(Pe)}'s only variant`:Pe===null?null:`Stays under ${p.displayName(Pe)}`;Yl.current={maxDy:Ze?ye.bottom-Ze.bottom:0,minDy:Ze?ye.top-Ze.top:0,oldTop:fe[j]?.top??0,parent:Pe,rows:fe,siblings:mt,startX:L.clientX,startY:L.clientY,suppressed:!1};const Be=fe[0],zt=fe[1];pn({blocked:!1,dy:0,from:j,gap:Be&&zt?zt.top-Be.top-Be.height:0,height:fe[j]?.height??0,measured:!0,reason:_t,span:null,title:h,settling:!1,started:!1,to:j})},Cu=h=>{if(!Je?.started)return 0;const j=Je.height+Je.gap;return h<Je.from&&h>=Je.to?j:h>Je.from&&h<=Je.to?-j:0},bs=w.useCallback(()=>cs(!1),[]),Mu=(h,j,L)=>(Ei(),Qx(h,L,j).then(()=>(yl(),!0)).catch(()=>(p.notify({kind:"request",message:"That annotation could not be kept.",tone:"danger",ttl:Fe.action}),!1))),Nu=(h,j)=>Zx(h,j).then(()=>(yl(),!0)).catch(()=>(p.notify({kind:"request",message:"That annotation could not be changed.",tone:"danger",ttl:Fe.action}),!1)),ws=h=>{Vx([h]).then(()=>yl()).catch(()=>{})},cr=h=>{window.open(p.urlFor(h),"_blank","noopener,noreferrer")},Fl=(h,j)=>{const L=h===p.active,Z=or.has(h),J=p.previewFor(h),ue=Zt&&Je?.title===h,fe=Zt&&!ue?Cu(j):0,ye=p.rowMeta.get(h),Pe=(ye?.depth??0)>0,mt=Zt&&p.dragFolded.has(h)&&(ye?.variants??0)===0?ye?.descendants??0:0,_t=Pe?E.variant:E.root,Be=ye?.variants??0,zt=ye?.folded??!1,wt=p.renaming===h,Ft=ue&&Je?.blocked?"opacity-0 transition-opacity duration-150":Zt||wt?"transition-opacity duration-150":"group-hover:hidden group-has-[button:focus-visible]:hidden";return o.jsxs("li",{className:`group relative ${ue?`z-30 ${Je?.settling?`transition-transform duration-200 ${ei} motion-reduce:transition-none`:""}`:"z-10"} ${Zt&&!ue?`transition-transform duration-200 ${ei} motion-reduce:transition-none`:""}`,"data-title":h,onPointerEnter:rt=>{qe(h),Nn(fl(rt.currentTarget))},style:{...ue?{transform:`translateY(${Je?.dy??0}px)`}:fe?{transform:`translateY(${fe}px)`}:{},paddingLeft:_t,viewTransitionName:`row-${Sv(h)}`},children:[ue&&Je?.reason!=null?o.jsx("span",{"aria-live":"polite",className:`pointer-events-none absolute right-2 top-1.5 z-40 rounded bg-white/[0.1] px-1.5 py-0.5 text-[10px] font-medium leading-normal text-[#E8E8EA] shadow-md transition-opacity duration-150 motion-reduce:transition-none ${Je.blocked?"opacity-100":"opacity-0"}`,children:Je.reason}):null,Se>0&&ye?.graph?o.jsx(ry,{active:L,arriving:je(h),bloom:z.title===h?z.nonce:0,delay:Math.min(j,12)*28,family:(ye?.descendants??0)>0,folded:ye?.folded??!1,fresh:Bl(h),lifted:ue,lit:Qe?.get(h),row:ye.graph,tint:q,width:Se,working:Z}):null,o.jsx(hv,{label:wt?null:mv(J,p.displayName(h),p.displayName),children:o.jsx("div",{"aria-pressed":L,className:`relative flex w-full items-start gap-2 rounded-md py-2 pl-3 pr-3 text-left transition-colors ${P?"cursor-pointer":"cursor-grab active:cursor-grabbing"} ${L?"bg-[#2E2E2E] ring-1 ring-inset ring-[#D1D5DB]/40":ue?"bg-white/[0.06]":""} ${ue?"shadow-2xl":""}`,onClick:()=>{if(!wt){if(Yl.current?.suppressed){Yl.current.suppressed=!1;return}p.setActive(h)}},onDoubleClick:rt=>{wt||rt.target.closest("button")||(window.getSelection()?.removeAllRanges(),cr(h))},onKeyDown:rt=>{rt.target===rt.currentTarget&&(rt.key==="Enter"||rt.key===" ")&&(rt.preventDefault(),p.setActive(h))},onPointerDown:Ua(h,j),role:"button",tabIndex:0,children:o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsxs("span",{className:`flex items-center gap-2 ${Zt||wt?"":P?L?"":"group-hover:pr-[20px] group-has-[button:focus-visible]:pr-[20px]":L?"group-hover:pr-[72px] group-has-[button:focus-visible]:pr-[72px]":"group-hover:pr-[98px] group-has-[button:focus-visible]:pr-[98px]"}`,children:[Be>0&&o.jsx(st,{label:zt?`Show ${Be} variant${Be===1?"":"s"}`:"Fold the variants away",children:o.jsxs("button",{"aria-expanded":!zt,"aria-label":`${zt?"Show":"Hide"} the variants of ${p.displayName(h)}`,className:"flex shrink-0 items-center gap-1 rounded px-0.5 py-1 text-[#84848C] transition-colors hover:text-[#E8EAED]",onClick:rt=>{rt.stopPropagation(),Ul(h)},onPointerDown:rt=>rt.stopPropagation(),type:"button",children:[o.jsx("svg",{className:`size-2.5 transition-transform duration-150 motion-reduce:transition-none ${zt?"-rotate-90":""}`,fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 10 10",children:o.jsx("path",{d:"M2 3.5 5 6.5 8 3.5",strokeLinecap:"round",strokeLinejoin:"round"})}),zt?o.jsx("span",{className:"text-[10px] leading-none tabular-nums",children:Be}):null]})}),wt?o.jsx(kg,{error:p.renameError,initial:p.displayName(h),label:`Rename the ${p.displayName(h)} direction`,onCancel:()=>p.startRename(null),onCommit:(rt,Ha)=>p.rename(h,rt,Ha)}):o.jsx("span",{className:`min-w-0 flex-1 text-sm font-medium leading-5 transition-colors duration-150 ${L?"text-white":"text-[#D1D5DB] group-hover:text-[#E8EAED]"}`,children:o.jsx("span",{className:`block w-fit min-w-[70%] max-w-full truncate -my-1 py-1 pr-2 ${P?"":"cursor-text"} ${Be>0?"":"-ml-3 pl-3"}`,onDoubleClick:P?void 0:rt=>{rt.stopPropagation(),window.getSelection()?.removeAllRanges(),p.startRename(h)},children:p.displayName(h)})}),mt>0?o.jsxs("span",{className:`shrink-0 rounded bg-white/[0.08] px-1.5 py-0.5 text-[10px] font-medium leading-normal tabular-nums text-[#E8E8EA] ${Ft}`,children:["+",mt]}):qt&&h===Dt?o.jsx("span",{className:`shrink-0 rounded bg-white/[0.08] px-1.5 py-0.5 text-[10px] font-medium leading-normal text-[#E8E8EA] ${Ft}`,children:"Comparing"}):Z?o.jsxs("span",{className:`flex h-5 shrink-0 items-center gap-1 rounded bg-white/[0.04] pl-0.5 pr-1.5 text-[10px] font-medium leading-none text-[#84848C]/80 ${Ft}`,children:[o.jsx(bf,{"aria-label":"Working on direction",size:20,state:wf,theme:"dark"}),"Cooking"]}):bl[h]?o.jsx(st,{label:`Rendered structure, layout, visual styles, media and vector geometry match ${bl[h]?.join(", ")} in a 1280 × 800 comparison.`,children:o.jsxs("span",{className:`shrink-0 rounded bg-amber-400/10 px-1.5 py-0.5 text-[10px] font-medium leading-normal text-amber-300/90 ${Ft}`,children:["Same as ",bl[h]?.length===1?bl[h]?.[0]:`${bl[h]?.length} others`]})}):Su===h?o.jsxs("span",{className:`flex h-5 shrink-0 items-center gap-1 rounded bg-white/[0.04] pl-0.5 pr-1.5 text-[10px] font-medium leading-none text-[#84848C]/80 ${Ft}`,children:[o.jsx(bf,{"aria-label":"Checking for duplicates",size:20,state:wf,theme:"dark"}),"Cooking"]}):J?.tags[0]&&o.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium leading-normal ${Ft}`,style:pv(J.tags[0]),children:J.tags[0]})]}),o.jsx("span",{className:`mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug transition-colors ${wt&&p.renameError?"text-amber-300/90":L?"text-[#D1D5DB]":"text-[#84848C]"}`,id:wt&&p.renameError?"leglas-rename-error":void 0,children:wt&&p.renameError?p.renameError:J?.note??(J?.branch===void 0?J?.url:J.branch)})]})})}),o.jsxs("div",{className:`pointer-events-none absolute right-2 top-1.5 flex items-center gap-0.5 opacity-0 transition-opacity duration-150 ${wt?"invisible":""} ${Zt?"":"group-hover:pointer-events-auto group-hover:opacity-100 group-has-[button:focus-visible]:pointer-events-auto group-has-[button:focus-visible]:opacity-100"}`,children:[h!==p.active&&o.jsx(st,{label:qt&&h===Dt?"Stop comparing":`Compare with ${p.displayName(p.active)}`,children:o.jsx("button",{"aria-label":qt&&h===Dt?`Stop comparing ${p.displayName(h)}`:`Compare ${p.displayName(h)} with ${p.displayName(p.active)}`,"aria-pressed":qt&&h===Dt,className:`${va} ${qt&&h===Dt?"text-white":""}`,onClick:rt=>{if(rt.stopPropagation(),qt&&h===Dt){ml(!1);return}Na(h),ml(!0)},type:"button",children:o.jsx(dn,{d:fn.split})})}),!P&&o.jsxs(o.Fragment,{children:[o.jsx(st,{label:p.copied?.kind==="link"&&p.copied.title===h?"Copied":"Copy preview link",children:o.jsx("button",{"aria-label":`Copy the preview link to the ${p.displayName(h)} direction`,className:va,onClick:()=>p.copyLink(h),type:"button",children:p.copied?.kind==="link"&&p.copied.title===h?o.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):o.jsx(dn,{d:fn.link})})}),o.jsx(st,{label:p.copied?.kind==="reference"&&p.copied.title===h?"Copied":o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:"Copy a detailed reference."}),o.jsx("span",{className:"block",children:"For a teammate or an agent."})]}),children:o.jsx("button",{"aria-label":`Copy a detailed reference to the ${p.displayName(h)} direction`,className:va,onClick:()=>p.copyReference(h),type:"button",children:p.copied?.kind==="reference"&&p.copied.title===h?o.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):o.jsx(dn,{d:fn.copy,size:12})})}),o.jsx(st,{label:"Rename",children:o.jsx("button",{"aria-label":`Rename the ${p.displayName(h)} direction`,className:va,onClick:()=>p.startRename(h),type:"button",children:o.jsx(dn,{d:fn.pencil,size:12})})}),o.jsx(st,{label:"Remove from list",children:o.jsx("button",{"aria-label":`Remove the ${p.displayName(h)} direction from the list`,className:va,onClick:()=>p.hide(h),type:"button",children:o.jsx(dn,{d:fn.trash,size:12})})})]})]})]},h)};return o.jsxs("main",{className:`flex h-dvh bg-[#1C1C20] text-white antialiased selection:bg-[#E6E8EC] selection:text-[#17181B] ${p.resizing?"cursor-col-resize":""} ${as?"select-none":""}`,"data-leglas-shell":"",style:{fontFamily:Wn.stack},children:[o.jsxs("aside",{className:`relative shrink-0 overflow-hidden border-r border-[#232328] ${p.prefs.collapsed?"":"shadow-2xl"} ${p.resizing?"":`transition-[width] duration-200 ${ei} motion-reduce:transition-none`}`,style:{width:p.prefs.collapsed?48:p.prefs.width},children:[o.jsxs("div",{className:`flex h-full flex-col transition-opacity duration-150 ${p.prefs.collapsed?"pointer-events-none opacity-0":"opacity-100"}`,inert:p.prefs.collapsed,style:{width:p.prefs.width},children:[o.jsxs("div",{className:"relative z-10 flex shrink-0 items-center justify-between gap-2 border-b border-[#232328] bg-[#1E1E22] px-2.5 py-2.5",children:[o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(au,{size:28}),o.jsx(K1,{height:18}),!P&&ie.status!==null&&o.jsx(st,{label:M1(ie.status),children:o.jsxs("button",{"aria-expanded":we,"aria-haspopup":"dialog","aria-label":Ne?`Leglas ${ie.status.version}. ${M1(ie.status)}. Open updates`:`Leglas ${ie.status.version}. Open updates`,className:`relative mt-px flex h-5 shrink-0 items-center rounded px-1 text-[10px] font-medium leading-none tabular-nums transition-colors duration-150 hover:bg-white/[0.06] ${Ne||we?"text-[#D1D5DB] hover:text-white":"text-[#84848C] hover:text-[#D1D5DB]"}`,onClick:()=>{pe(!1),_e(h=>!h)},ref:I,type:"button",children:[ie.status.version,Ne&&o.jsx("span",{"aria-hidden":!0,className:"absolute -right-px top-0 size-1.5 rounded-full bg-[#7C9CFF]"})]})})]}),o.jsxs("span",{className:"flex shrink-0 items-center gap-0.5",children:[!P&&o.jsx(st,{label:Me.share===null?"Share this rail":Me.share.tunnel.status==="ready"?`Sharing · ${om(Dy(Me.share.grants))}`:"Sharing",children:o.jsxs("button",{"aria-expanded":he,"aria-haspopup":"dialog","aria-label":Me.share===null?"Share":"Sharing. Open the share panel",className:`relative flex h-6 w-6 shrink-0 items-center justify-center rounded p-1 transition-colors hover:bg-[#2E2E2E] hover:text-white ${he||Me.share!==null?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{_e(!1),pe(h=>!h)},ref:ce,type:"button",children:[o.jsx(Dg,{}),Me.share!==null&&o.jsx(qo,{className:"absolute right-0 top-0"})]})}),o.jsx(st,{label:o.jsxs(o.Fragment,{children:["Collapse panel ",o.jsx("kbd",{className:"ml-1 text-[#9CA3AF]",children:"["})]}),side:"right",children:o.jsx("button",{"aria-label":"Collapse the directions panel",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded p-1 text-[#9CA3AF] transition-colors hover:bg-[#2E2E2E] hover:text-white",onClick:()=>p.setPrefs(h=>({...h,collapsed:!0})),type:"button",children:o.jsx(dn,{d:fn.sidebar,size:16})})})]}),!P&&o.jsx(bx,{onClose:U,open:we,triggerRef:I,updates:ie}),!P&&o.jsx(dx,{active:p.active,compare:qt?Dt:null,displayName:p.displayName,notify:p.notify,onClose:le,open:he,prefs:p.prefs,previews:i,share:Me.share,triggerRef:ce,tunnels:Me.tunnels})]}),r!==void 0&&o.jsx(st,{label:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:"Someone is sharing their Leglas with you, live."}),o.jsx("span",{className:"block text-[#9CA3AF]",children:"Flip, compare and change the width. Nothing you do reaches their machine."})]}),side:"right",wide:!0,children:o.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-[#232328] bg-[#1E1E22] px-3 py-1.5",children:[o.jsx(qo,{}),o.jsx("span",{className:"text-[11px] text-[#D1D5DB]",children:"Shared with you"}),o.jsx("span",{className:"ml-auto min-w-0 truncate text-[10px] text-[#84848C]",children:r.scope==="rail"?"the whole rail":r.scope==="compare"?"a comparison":"one direction"})]})}),o.jsx("div",{className:"px-3 pb-1 pt-2",children:o.jsxs("div",{className:"relative",children:[o.jsx("span",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-[#D1D5DB]",children:o.jsx(dn,{d:fn.search})}),o.jsx("kbd",{className:`pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 rounded border border-[#232328] bg-[#2E2E2E]/60 px-1.5 py-0.5 font-sans text-[10px] leading-none tracking-wide text-[#84848C] transition-opacity duration-150 motion-reduce:transition-none ${p.query||Sa?"opacity-0":"opacity-100"}`,children:vv}),o.jsx("input",{"aria-label":"Search directions",className:"w-full rounded-md border border-[#232328] bg-[#2E2E2E]/40 py-1.5 pl-7 pr-16 text-xs text-white placeholder:text-[#E8EAED] focus:outline-none focus:ring-1 focus:ring-[#D1D5DB]/60",onBlur:()=>il(!1),onFocus:()=>il(!0),onChange:h=>p.setQuery(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(p.query?p.setQuery(""):h.currentTarget.blur())},placeholder:"Search directions…",ref:m,type:"text",value:p.query})]})}),f.length>0&&o.jsxs("section",{"aria-label":"Preview warning",className:"mx-3 mb-1 mt-1 rounded-md border border-amber-400/20 bg-amber-400/[0.07] px-2.5 py-2",children:[o.jsx("p",{className:"text-xs font-medium text-amber-300/90",children:"Preview may be from another project"}),f.map(h=>o.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-[#9CA3AF]",children:h},h))]}),Wo&&!kt.reachable&&o.jsxs("div",{className:"mx-3 mb-1 mt-1 rounded-md border border-amber-400/20 bg-amber-400/[0.07] px-2.5 py-2",children:[o.jsx("p",{className:"text-xs font-medium text-amber-300/90",children:"Dev server not responding"}),o.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-[#9CA3AF]",children:"Anything on screen is from before it stopped. Previews return on their own once it is back."})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{WebkitMaskImage:L1,maskImage:L1},children:[o.jsxs("ul",{className:"relative flex flex-col gap-1","data-traced":ne??"",onPointerLeave:()=>{qe(null),Nn(h=>({...h,on:!1}))},ref:Hn,children:[o.jsx("div",{"aria-hidden":!0,className:`pointer-events-none absolute right-0 z-0 rounded-md bg-white/[0.06] transition-[transform,height,opacity,left] duration-150 ${ei} motion-reduce:transition-none`,style:{height:$l.height,left:$l.left,opacity:$l.on&&!Zt?1:0,transform:`translateY(${$l.top}px)`}}),p.rows.map((h,j)=>Fl(h,j)),$n.filter(h=>h.d!==qn?.d).map(h=>o.jsx(f1,{d:h.d,height:h.height,leaving:!0,marks:h.marks,still:ls,width:Se},`leaving:${h.d}`)),qn!==null&&o.jsx(f1,{d:qn.d,height:qn.height,marks:qn.marks,still:ls,width:Se},qn.d)]}),p.rows.length===0&&o.jsx("div",{className:"px-3 py-2",children:p.query.trim()?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"text-xs text-[#9CA3AF]",children:["Nothing matches “",p.query,"”."]}),o.jsx("button",{className:"mt-1 rounded text-xs text-[#84848C] underline underline-offset-2 transition-colors hover:text-[#D1D5DB]",onClick:()=>p.setQuery(""),type:"button",children:"Clear search"})]}):o.jsx("p",{className:"text-xs leading-snug text-[#9CA3AF]",children:P?"Nothing here was shared.":p.visibleCount===0&&p.hiddenCount>0?"Every direction is removed. Restore one below.":"No directions yet. Add them to leglas.config.ts."})}),!P&&p.hiddenCount>0&&o.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2",children:[o.jsxs("button",{className:"min-w-0 flex-1 rounded px-3 py-1.5 text-left text-[11px] text-[#84848C] transition-colors hover:text-[#D1D5DB]",onClick:()=>p.setShowHidden(h=>!h),type:"button",children:[p.showHidden?"Hide":"Show"," removed (",p.hiddenCount,")"]}),p.showHidden?o.jsx("button",{className:"rounded px-3 py-1.5 text-[11px] text-[#9CA3AF] transition-[color,scale] hover:text-red-300 active:scale-[0.96]",onClick:()=>N({error:null,titles:[...p.prefs.hidden]}),type:"button",children:"Clear all"}):null]}),!P&&p.showHidden&&o.jsx("ul",{className:"relative",children:p.prefs.hidden.filter(p.matches).map(h=>o.jsx("li",{className:"group relative",children:o.jsxs("div",{className:"flex items-center justify-between rounded-md px-3 py-2 transition-colors group-hover:bg-white/[0.04]",children:[o.jsx("span",{className:"truncate text-sm font-medium text-[#9CA3AF]",children:p.displayName(h)}),o.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[o.jsx("button",{className:"rounded text-[11px] text-[#9CA3AF] transition-colors hover:text-white",onClick:()=>{p.restore(h),p.notify({kind:`remove:${h}`,message:`${p.displayName(h)} is back in the list`,tone:"success",ttl:Fe.plain})},type:"button",children:"Restore"}),o.jsx("button",{className:"rounded text-[11px] text-[#84848C] transition-[color,scale] hover:text-red-300 active:scale-[0.96]",onClick:()=>N({error:null,titles:[h]}),type:"button",children:"Delete"})]})]})},h))})]}),o.jsxs("div",{ref:ou,children:[!P&&Te!==null&&o.jsx("div",{className:"mx-3 mt-2 rounded-lg border border-[#232328] bg-[#1E1E22] px-2.5 py-2 shadow-lg",role:"status",children:o.jsxs("div",{className:"flex items-center gap-2",children:[Te.kind==="stopped"?o.jsx("span",{"aria-hidden":"true",className:"flex size-3.5 shrink-0 items-center justify-center text-[#84848C]",children:o.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})}):Te.kind==="failed"?o.jsxs("svg",{"aria-hidden":"true",className:"shrink-0 text-amber-400/90",fill:"none",height:"14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 16 16",width:"14",children:[o.jsx("path",{d:"M8 2.6 14.6 13.4H1.4Z"}),o.jsx("path",{d:"M8 6.8v2.7"}),o.jsx("path",{d:"M8 11.6h.01"})]}):Te.kind==="queued"?o.jsx("span",{"aria-hidden":"true",className:"flex size-3.5 shrink-0 items-center justify-center",children:o.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-[#84848C] motion-reduce:animate-none"})}):o.jsx("span",{"aria-hidden":"true",className:"size-3.5 shrink-0 animate-spin rounded-full border-[1.5px] border-white/15 border-t-white/70 motion-reduce:animate-none"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-[11px] font-medium leading-tight text-[#D1D5DB]",children:er}),ms!==null&&o.jsx("p",{className:"mt-0.5 text-[10px] leading-tight text-[#84848C]",children:ms})]}),Te.kind==="running"&&Ci!==null&&o.jsx("span",{className:"shrink-0 text-[10px] tabular-nums text-[#84848C]",children:Px(tr-Ci)}),Te.kind==="running"&&o.jsx(st,{label:"Stop this run",children:o.jsx("button",{"aria-label":"Stop this run",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[#84848C] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:cursor-wait disabled:opacity-40 motion-reduce:transition-none",disabled:Ae!==null||Te.stopping,onClick:()=>ar(Te.id),type:"button",children:Ae==="cancel"||Te.stopping?o.jsx("span",{className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):o.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})})}),(Te.kind==="failed"||Te.kind==="stopped")&&o.jsxs("span",{className:"flex shrink-0 items-center",children:[o.jsx(st,{label:Te.kind==="stopped"?"Run it after all":"Try it again",children:o.jsx("button",{"aria-label":Te.kind==="stopped"?"Run this change after all":"Retry this change",className:"flex h-6 w-6 items-center justify-center rounded-md text-[#84848C] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:cursor-wait disabled:opacity-40 motion-reduce:transition-none",disabled:Ae!==null,onClick:()=>ir(Te.id),type:"button",children:Ae==="retry"?o.jsx("span",{className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"13",children:[o.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 1-1.6-3.9"}),o.jsx("path",{d:"M13.7 1.8v2.7H11"})]})})}),o.jsx(st,{label:"Let it go",children:o.jsx("button",{"aria-label":Te.kind==="stopped"?"Dismiss this stopped change":"Dismiss this failed change",className:"flex h-6 w-6 items-center justify-center rounded-md text-[#84848C] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:cursor-wait disabled:opacity-40 motion-reduce:transition-none",disabled:Ae!==null,onClick:()=>sr(Te.id),type:"button",children:Ae==="dismiss"?o.jsx("span",{className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):o.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"13",children:o.jsx("path",{d:"m4 4 8 8M12 4l-8 8"})})})})]})]})}),!P&&o.jsx("form",{className:"relative px-3 pb-2.5 pt-2",onSubmit:h=>{h.preventDefault();const j=Zn.trim(),L=p.active;if(!j&&Gt.length===0||!L||ct)return;const Z=p.displayName(L),J=qx(Qt);if(J!==null){p.notify({kind:"request",message:J==="uploading"?"Still uploading an image. Try again in a moment.":"One image did not upload. Retry it or remove it, then send.",tone:"info",ttl:Fe.action});return}const ue=Hx(Qt);sl(!0),fetch("/leglas/api/request",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({title:L,intent:j,mode:pt,...Da===null?{}:{width:Da},...qt&&Dt!==null&&Dt!==L?{compare:Dt}:{},...ue.length===0?{}:{references:ue}})}).then(fe=>fe.json()).then(fe=>{if(fe.duplicate===!0){sl(!1),p.notify({kind:"request",message:`That exact change to ${Z} is already queued.`,tone:"info",ttl:Fe.action});return}if(!fe.ok&&typeof fe.error=="string"){sl(!1),p.notify({kind:"request",message:fe.error,tone:"danger",ttl:Fe.action});return}if(!fe.ok||!fe.prompt)throw new Error("refused");Vn(""),rl(),sl(!1),yl(),p.notify({kind:"request",message:`Asked for a change to ${Z}.`,tone:"success",ttl:Fe.plain}),Zo(fe.prompt).then(ye=>{p.notify({kind:"request",message:ye==="copied"?`Asked for a change to ${Z}. Prompt copied.`:`Asked for a change to ${Z}. Your browser blocked the clipboard, so read it with npx leglas requests.`,tone:"success",ttl:Fe.plain})})}).catch(()=>{sl(!1),p.notify({kind:"request",message:`That request never reached Leglas. ${Z} is unchanged.`,tone:"danger",ttl:Fe.action})})},children:o.jsxs("div",{className:`rounded-md border bg-[#2E2E2E]/40 transition-colors ${ol?"border-[#7C9CFF]/70 ring-1 ring-[#7C9CFF]/40":"border-[#232328] focus-within:border-[#D1D5DB]/40 focus-within:ring-1 focus-within:ring-[#D1D5DB]/40"}`,onDragEnter:h=>{Bo(h.dataTransfer.types)&&(h.preventDefault(),It.current+=1,Wt(!0))},onDragLeave:h=>{Bo(h.dataTransfer.types)&&(It.current=Math.max(0,It.current-1),It.current===0&&Wt(!1))},onDragOver:h=>{Bo(h.dataTransfer.types)&&(h.preventDefault(),h.dataTransfer.dropEffect="copy")},onDrop:h=>{Bo(h.dataTransfer.types)&&(h.preventDefault(),It.current=0,Wt(!1),ql(Array.from(h.dataTransfer.files)))},children:[o.jsx($x,{drafts:Qt,onRemove:oi,onRetry:Ea}),o.jsx("textarea",{"aria-label":p.active?`Ask your agent to change the ${p.displayName(p.active)} direction`:"Ask your agent to change a direction",className:"block w-full resize-none overflow-y-auto bg-transparent px-2.5 pb-1 pt-2 text-xs leading-4 text-white placeholder:text-[#84848C] focus:outline-none disabled:cursor-not-allowed disabled:opacity-60",disabled:ct||!p.active,onChange:h=>{Zn===""&&h.target.value!==""&&Ei(),Vn(h.target.value)},onFocus:Ei,onKeyDown:h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),h.currentTarget.form?.requestSubmit())},onPaste:h=>{const j=Array.from(h.clipboardData.files);j.length!==0&&(h.preventDefault(),ql(j))},placeholder:p.active===null?"No direction to change yet":ol?"Drop the image here":Qt.length>0&&Gt.length===0?`Say what to take from the ${Qt.length===1?"image":"images"}…`:Gt.length>0?`Send ${Gt.length===1?"the annotation":`${Gt.length} annotations`}, or add words…`:`Change ${p.displayName(p.active)}…`,ref:v,rows:1,value:Zn}),o.jsxs("div",{className:"flex items-center justify-end gap-1.5 p-1",children:[o.jsx(st,{label:pt==="variant"?"Builds a new direction beside this one and leaves this one alone.":"Changes this direction itself. Nothing is kept of what it was.",children:o.jsxs("button",{"aria-label":pt==="variant"?"This change makes a new variant. Switch to changing the direction itself.":"This change edits the direction itself. Switch to making a new variant.",className:"mr-auto flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 text-[10px] font-medium leading-none text-[#84848C] transition-colors hover:bg-white/[0.06] hover:text-[#D1D5DB]",onClick:()=>Cn(pt==="variant"?"replace":"variant"),type:"button",children:[pt==="variant"?o.jsxs("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:[o.jsx("circle",{cx:"4.5",cy:"3.6",r:"1.9"}),o.jsx("circle",{cx:"11.5",cy:"12.4",r:"1.9"}),o.jsx("path",{d:"M4.5 5.5v2.6a4.3 4.3 0 0 0 4.3 4.3h0.8",strokeLinecap:"round"})]}):o.jsx("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:o.jsx("path",{d:"M10.8 2.9 13.1 5.2 5.6 12.7H3.3v-2.3z",strokeLinejoin:"round"})}),pt==="variant"?"as a variant":"in place"]})}),o.jsx("input",{accept:mm.join(","),className:"sr-only",multiple:!0,onChange:h=>{ql(Array.from(h.currentTarget.files??[])),h.currentTarget.value=""},ref:ul,tabIndex:-1,type:"file"}),o.jsx(st,{label:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:"Attach a reference image"}),o.jsx("span",{className:"block text-[#9CA3AF]",children:"Paste or drop one, too"})]}),children:o.jsx("button",{"aria-label":Qt.length>0?`Attach another image, ${Qt.length} attached`:"Attach a reference image",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[#84848C] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-[#D1D5DB] active:scale-[0.96] disabled:cursor-not-allowed disabled:opacity-40 motion-reduce:transition-none",disabled:!p.active||ct||Qt.length>=Df,onClick:()=>ul.current?.click(),type:"button",children:o.jsxs("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:[o.jsx("rect",{height:"10.5",rx:"1.8",width:"12.5",x:"1.75",y:"2.75"}),o.jsx("circle",{cx:"5.6",cy:"6.3",r:"1.1"}),o.jsx("path",{d:"m14.25 10.4-3.1-3.1a1 1 0 0 0-1.4 0L4.5 12.5"})]})})}),o.jsx(st,{label:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:Pn?"Stop annotating":Gt.length>0?"Show what you marked up":"Point at what is wrong, instead of describing where it is"}),o.jsx("span",{className:"block text-[#9CA3AF]",children:Pn?"Click a detail · drag an area · Esc to stop":o.jsx("kbd",{className:"font-sans",children:"A"})})]}),children:o.jsxs("button",{"aria-keyshortcuts":"a","aria-label":Pn?"Stop annotating the design":`Annotate the design${Gt.length>0?`, ${Gt.length} annotation${Gt.length===1?"":"s"} so far`:""}`,"aria-pressed":Pn,className:`flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 text-[10px] font-medium leading-none transition-colors ${Pn?"bg-[#7C9CFF]/20 text-[#AFC2FF]":"text-[#84848C] hover:bg-white/[0.06] hover:text-[#D1D5DB]"}`,onClick:()=>Pn?bs():cs(!0),type:"button",children:[o.jsxs("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:[o.jsx("path",{d:"M8 1.8a4.2 4.2 0 0 1 4.2 4.2c0 3-4.2 8-4.2 8S3.8 9 3.8 6A4.2 4.2 0 0 1 8 1.8Z",strokeLinejoin:"round"}),o.jsx("circle",{cx:"8",cy:"6",r:"1.4"})]}),"Annotate",Gt.length>0?o.jsx("span",{className:"rounded-full bg-white/15 px-1 text-[9px] leading-[1.5] text-white",children:Gt.length}):null]})}),bt.kind==="none"?o.jsxs("button",{className:"flex min-w-0 items-center gap-1.5 rounded px-1.5 py-1 text-[10px] leading-none text-[#84848C] transition-colors duration-150 hover:bg-white/[0.04] hover:text-[#D1D5DB]",onClick:()=>R(!0),ref:Pt,type:"button",children:[o.jsx(dn,{d:fn.link,size:12}),o.jsx("span",{className:"truncate",children:"Connect agent via MCP…"})]}):o.jsxs("div",{className:"relative flex min-w-0 items-center",children:[o.jsxs("div",{"aria-hidden":!$,"aria-label":"Who runs your changes",className:`absolute bottom-full right-0 z-10 mb-1.5 w-max min-w-48 origin-bottom-right rounded-lg border border-[#232328] bg-[#1E1E22] p-1 text-[#D1D5DB] shadow-2xl transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.165,0.84,0.44,1)] focus:outline-none motion-reduce:transition-none ${$?"translate-y-0 scale-100 opacity-100":"pointer-events-none translate-y-1 scale-95 opacity-0"}`,inert:!$,ref:ke,role:"dialog",tabIndex:-1,children:[xn.agents.filter(h=>h.available).map(h=>{const j=bt.kind==="chosen"&&h.id===bt.id;return o.jsxs("button",{className:en,disabled:cl!==null||Jn,onClick:()=>j?re(!1):nr(h.id),type:"button",children:[o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(es,{id:h.id}),o.jsx("span",{className:"truncate",children:h.name})]}),cl===h.id?o.jsx("span",{"aria-label":"selecting",className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):h.auth==="signed-out"?o.jsx("span",{className:"text-[10px] text-amber-400/80",children:"signed out"}):j&&o.jsx("span",{"aria-label":"current choice",children:"✓"})]},h.id)}),bt.kind==="chosen"&&bt.id==="custom"?o.jsxs("button",{className:en,onClick:()=>re(!1),type:"button",children:[o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(es,{id:"custom"}),o.jsx("span",{className:"truncate",children:bt.name})]}),o.jsx("span",{"aria-label":"current choice",children:"✓"})]}):null,xl!==void 0&&xl.efforts.length>0?o.jsx("div",{className:"mt-1 border-t border-[#232328] px-1 pb-0.5 pt-1.5",children:o.jsxs("label",{className:"flex min-h-7 items-center justify-between gap-3",children:[o.jsx("span",{className:"text-[10px] font-medium text-[#84848C]",children:"Effort"}),o.jsxs("select",{"aria-busy":Jn,"aria-label":`${xl.name} effort`,className:"min-h-7 rounded-md border border-[#303038] bg-[#17171B] px-2 text-[10px] text-[#D1D5DB] focus-visible:outline-2 focus-visible:outline-offset-2 disabled:opacity-60",disabled:Jn||cl!==null,onChange:h=>{const j=h.currentTarget.value;lr(j===""?null:j)},value:ds??"",children:[o.jsx("option",{value:"",children:"Agent default"}),xl.efforts.map(h=>o.jsx("option",{value:h,children:_1[h]},h))]})]})}):null,o.jsx("div",{className:"mt-1 border-t border-[#232328] pt-1",children:o.jsx("button",{className:`${en} text-[#84848C]`,onClick:()=>{re(!1),R(!0)},ref:Pt,type:"button",children:o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(dn,{d:fn.link,size:14}),o.jsx("span",{className:"truncate",children:"Connect agent via MCP…"})]})})})]}),o.jsxs("button",{"aria-expanded":$,"aria-haspopup":"dialog",className:"flex min-w-0 items-center gap-1.5 rounded px-1.5 py-1 text-[11px] leading-none text-[#84848C] transition-colors hover:bg-white/[0.04] hover:text-[#D1D5DB]",onClick:()=>{$||fs(),re(h=>!h)},ref:ut,type:"button",children:[bt.kind==="chosen"&&o.jsx(es,{id:bt.id,size:12}),o.jsx("span",{className:"truncate",children:bt.kind==="chosen"?`${bt.name}${ds===null?"":` · ${_1[ds]}`}`:"Choose an agent"}),Po&&o.jsx("span",{className:"size-1.5 shrink-0 rounded-full bg-amber-400",title:"This CLI is signed out. Sign in in your terminal.",children:o.jsx("span",{className:"sr-only",children:"signed out"})}),o.jsx("svg",{"aria-hidden":"true",className:`shrink-0 transition-transform duration-150 motion-reduce:transition-none ${$?"rotate-180":""}`,fill:"none",height:"12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"12",children:o.jsx("path",{d:"M4 6.5 8 10.5l4-4"})})]})]}),o.jsx("button",{"aria-label":p.active?`Send the change to ${p.displayName(p.active)}`:"Send the change",className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md transition-[background-color,color,transform] duration-150 active:scale-[0.96] motion-reduce:transition-none ${(Zn.trim()!==""||Gt.length>0)&&p.active&&!ct?"bg-[#E8E8EA] text-[#1C1C20] hover:bg-white":"pointer-events-none text-[#84848C]/60"}`,disabled:Zn.trim()===""&&Gt.length===0||!p.active||ct,type:"submit",children:ct?o.jsx("span",{className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):o.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"13",children:o.jsx("path",{d:"M8 13V3M3.5 7.5 8 3l4.5 4.5"})})})]})]})}),ct?o.jsx("div",{className:"px-3 pb-2",children:o.jsx("p",{"aria-live":"polite",className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",children:"Capturing the design for your agent…"})}):ji.length>0?o.jsx(fy,{askedFor:jf(p.previewFor(p.active))?.askedFor??null,chain:ji,displayName:p.displayName,onCompare:h=>{Na(h),ml(!0)},onGo:p.setActive,onRail:h=>p.rows.includes(h),onTrace:ii,openAsk:!0,self:p.active,tint:q,traced:ne}):hs===null?null:o.jsx("div",{className:"px-3 pb-2",children:o.jsx("p",{className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",title:hs,children:hs})}),p.prefs.showWidget?!P&&yn.agent.attached&&Te===null?o.jsx("div",{className:"px-3 pb-2",children:o.jsx("p",{className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",children:"Your agent is listening"})}):null:o.jsx("div",{className:"px-3 pb-2",children:o.jsxs("button",{className:"min-w-0 max-w-full truncate rounded text-left text-[10px] leading-snug text-[#84848C] transition-colors hover:text-[#D1D5DB]",onClick:()=>ee(!0),type:"button",children:["Bring the tools back ",o.jsx("kbd",{className:"font-sans text-[#9CA3AF]",children:"T"})]})})]})]}),o.jsxs("div",{className:`absolute inset-y-0 left-0 z-30 flex w-12 flex-col items-center bg-[#1C1C20] py-3 transition-opacity duration-150 ${p.prefs.collapsed?"opacity-100":"pointer-events-none opacity-0"}`,inert:!p.prefs.collapsed,children:[o.jsx(au,{size:24}),o.jsx(st,{label:o.jsxs(o.Fragment,{children:["Open directions ",o.jsx("kbd",{className:"ml-1 text-[#9CA3AF]",children:"["})]}),side:"right",children:o.jsx("button",{"aria-label":"Open the directions panel",className:"mt-3 flex h-6 w-6 items-center justify-center rounded p-1 text-[#9CA3AF] transition-colors hover:bg-[#2E2E2E] hover:text-white",onClick:()=>p.setPrefs(h=>({...h,collapsed:!1})),type:"button",children:o.jsx(dn,{d:fn.sidebar,size:16})})})]}),!p.prefs.collapsed&&o.jsx("div",{"aria-hidden":!0,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",onPointerDown:p.onHandlePointerDown,children:o.jsx("span",{className:`h-full transition-all duration-150 ${p.resizing?"w-0.5 bg-[#9CA3AF]":"w-px bg-[#232328] group-hover/resize:w-0.5 group-hover/resize:bg-[#9CA3AF]"}`})})]}),o.jsx("span",{"aria-live":"polite",className:"sr-only",role:"status",children:p.copied===null?"":p.copied.kind==="link"?"Link copied":"Reference copied"}),o.jsxs("div",{className:`relative min-w-0 flex-1 ${qt?"flex":"overflow-auto"}`,ref:os,children:[Aa.map(h=>o.jsxs("div",{className:pl.includes(h)?qt?`relative min-w-0 flex-1 overflow-auto ${h===Dt?"border-l border-[#232328]":""} ${nn?"flex flex-col items-center justify-center gap-2.5":ri?"flex min-h-full justify-center p-6":""}`:ri?"flex min-h-full justify-center p-6":"absolute inset-0":"hidden",style:qt?{order:pl.indexOf(h)}:void 0,children:[qt&&o.jsx("div",{className:nn?"pointer-events-none z-10 flex justify-center":"pointer-events-none absolute inset-x-0 top-0 z-10 flex justify-center p-3",children:o.jsxs("span",{className:"rounded-full bg-[#1C1C20]/85 px-2.5 py-1 text-[11px] font-medium text-[#E8E8EA] shadow-lg backdrop-blur",children:[p.displayName(h),nn&&o.jsxs("span",{className:"ml-1.5 font-normal text-[#8E8E96]",children:[Math.round(yi),"px · ",Math.round(vi*100),"%"]})]})}),o.jsxs("div",{className:nn?"relative shrink-0 overflow-hidden rounded-[10px] shadow-[0_0_0_1px_rgba(255,255,255,0.12)]":ri?`relative h-[calc(100dvh-48px)] shrink-0 overflow-hidden rounded-[10px] shadow-[0_0_0_1px_rgba(255,255,255,0.10)] transition-[width] duration-200 ${ei} motion-reduce:transition-none`:"relative size-full",style:nn?{height:Ta,width:In}:ri?{width:p.prefs.viewport??void 0}:void 0,children:[o.jsxs("div",{className:nn?"relative origin-top-left":"relative size-full",style:nn?{height:xi,transform:`scale(${vi})`,width:yi}:void 0,children:[(()=>{const j=p.branchState(h);return j!==null&&j.status!=="ready"?o.jsx(Bg,{branch:p.previewFor(h)?.branch??h,onStart:()=>p.startBranch(h),state:j}):o.jsx("iframe",{className:`size-full border-0 bg-white ${as?"pointer-events-none":""}`,onError:()=>hl(L=>({...L,[h]:!0})),onLoad:L=>{const Z=p.urlFor(h),J=L.currentTarget.dataset.previewIdentity;J!==void 0&&(!Z.startsWith("/")||Sf(L.currentTarget))&&Ni(h,J,L.currentTarget)},"data-preview":h,"data-preview-identity":$t(h),src:p.urlFor(h),title:`Preview: ${p.displayName(h)}`},$t(h))})(),!P&&Pn&&h===p.active?o.jsx(Iy,{notes:Gt,onExit:bs,onForget:ws,onKeep:(j,L)=>Mu(h,j,L),onRevise:Nu,paneScale:vi,scaling:nn,sent:Ai,title:h}):null]}),p.branchState(h)!==null&&p.branchState(h)?.status!=="ready"?null:dl[h]?o.jsx(J1,{onReload:()=>Kt(h),reason:kt.reachable||!Tn.has(h)?`${p.urlFor(h)} didn’t respond.`:"Your dev server stopped. This returns on its own once it is back."}):o.jsx(Lg,{loaded:Zl(h)}),!kt.reachable&&Zl(h)&&Tn.has(h)&&o.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 flex justify-center p-3",children:o.jsx("span",{className:"rounded-full bg-[#1C1C20]/90 px-2.5 py-1 text-[11px] font-medium text-amber-300/90 shadow-lg",children:"Stale — dev server stopped"})})]})]},h)),o.jsxs("div",{className:`absolute z-50 flex gap-2 ${mn?"flex-col items-start":{"bottom-right":"bottom-4 right-4 flex-col items-end","bottom-left":"bottom-4 left-4 flex-col items-start","top-right":"right-4 top-4 flex-col-reverse items-end","top-left":"left-4 top-4 flex-col-reverse items-start"}[p.prefs.corner]}`,style:du,children:[o.jsxs("div",{"aria-hidden":!W,"aria-label":"Leglas tools",className:`w-56 rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 shadow-2xl transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.165,0.84,0.44,1)] focus:outline-none motion-reduce:transition-none ${mn?"hidden ":""}${W?"translate-y-0 scale-100 opacity-100":"pointer-events-none translate-y-1 scale-95 opacity-0"}`,inert:!W,ref:Le,role:"dialog",tabIndex:-1,children:[o.jsx("span",{className:"block px-1 pb-1 pt-0.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Typeface"}),o.jsx("div",{"aria-label":"Interface typeface",className:"flex items-center gap-0.5 rounded-md bg-[#2E2E2E]/40 p-0.5",role:"group",children:yf.map(h=>o.jsx("button",{"aria-pressed":Wn.key===h.key,className:`flex-1 rounded px-2 py-1 text-xs transition-colors ${Wn.key===h.key?"bg-[#2E2E2E] font-medium text-white":"text-[#9CA3AF] hover:text-[#D1D5DB]"}`,onClick:()=>p.setPrefs(j=>({...j,font:h.key})),style:{fontFamily:h.stack},type:"button",children:h.label},h.key))}),o.jsx("span",{className:"block px-1 pb-1 pt-2 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Viewport"}),o.jsx("div",{"aria-label":"Viewport width",className:"flex items-center gap-0.5 rounded-md bg-[#2E2E2E]/40 p-0.5",role:"group",children:p.viewports.map(({label:h,width:j})=>o.jsx("button",{className:`flex-1 rounded px-2 py-1 text-xs transition-colors ${p.prefs.viewport===j?"bg-[#2E2E2E] font-medium text-white":"text-[#9CA3AF] hover:text-[#D1D5DB]"}`,onClick:()=>p.setPrefs(L=>({...L,viewport:j})),type:"button",children:h},h))}),qt&&o.jsxs("button",{"aria-checked":p.prefs.scaleSplit,className:`${en} mt-1 ${p.prefs.scaleSplit?"text-white":"text-[#9CA3AF]"}`,onClick:()=>p.setPrefs(h=>({...h,scaleSplit:!h.scaleSplit})),role:"switch",type:"button",children:[o.jsx("span",{children:"Scale each side to fit"}),o.jsx(rf,{on:p.prefs.scaleSplit})]}),o.jsx("span",{className:"block px-1 pb-1 pt-2 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Dev overlays"}),o.jsxs("button",{"aria-checked":p.prefs.showDevOverlays,className:`${en} ${p.prefs.showDevOverlays?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{const h=!p.prefs.showDevOverlays;p.setPrefs(j=>({...j,showDevOverlays:h}));for(const j of document.querySelectorAll("iframe"))Vl(j,!h)},role:"switch",type:"button",children:[o.jsx("span",{children:"Show dev tool overlay"}),o.jsx(rf,{on:p.prefs.showDevOverlays})]}),o.jsxs("button",{"aria-checked":p.prefs.showWidget,className:`${en} ${p.prefs.showWidget?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{const h=!p.prefs.showWidget;p.setPrefs(j=>({...j,showWidget:h})),h||p.notify({kind:"widget",message:"Press T to reopen the tools",tone:"info",ttl:Fe.plain+3e3})},role:"switch",type:"button",children:[o.jsx("span",{children:"Show Leglas overlay"}),o.jsx(rf,{on:p.prefs.showWidget})]}),!P&&o.jsxs("button",{className:"mt-1 flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-[#D1D5DB] transition-colors hover:bg-[#2E2E2E]/60 hover:text-white",onClick:()=>p.copyReference(p.active),type:"button",children:[o.jsx(dn,{d:fn.copy,size:12}),p.copied?.kind==="reference"&&p.copied.title===p.active?"Copied":"Copy reference"]}),o.jsx(st,{label:"Or double-click any direction in the rail",children:o.jsxs("a",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-[#D1D5DB] transition-colors hover:bg-[#2E2E2E]/60 hover:text-white",href:p.urlFor(p.active),rel:"noreferrer",target:"_blank",children:[o.jsx("span",{className:"inline-block size-3 rounded-sm border border-current"}),"Open in new tab"]})}),o.jsxs("button",{className:"flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left text-xs text-[#D1D5DB] transition-colors hover:bg-[#2E2E2E]/60 hover:text-white",onClick:()=>{ee(!1),y(!0)},type:"button",children:[o.jsx("span",{children:"Keyboard shortcuts"}),o.jsx("kbd",{className:"rounded border border-[#232328] bg-[#2E2E2E]/60 px-1 py-0.5 font-sans text-[10px] text-[#84848C]",children:"?"})]})]}),(p.prefs.showWidget||W)&&o.jsx(st,{label:"Leglas tools",children:o.jsxs("button",{"aria-expanded":W,"aria-haspopup":"dialog","aria-label":"Leglas tools",className:"relative flex h-11 w-11 items-center justify-center rounded-full border border-white/10 bg-[#1C1C20] shadow-lg transition-[border-color,transform] duration-150 hover:scale-[1.04] hover:border-white/20 active:scale-[0.95] motion-reduce:transform-none motion-reduce:hover:scale-100 motion-reduce:active:scale-100",onClick:()=>{if(Hl.current){Hl.current=!1;return}ee(h=>!h)},onPointerDown:Yt,ref:Ee,type:"button",children:[o.jsx(au,{size:30}),!Zl(p.active)&&o.jsx("span",{className:"absolute -right-0.5 -top-0.5 size-2 animate-pulse rounded-full bg-amber-400 motion-reduce:animate-none"})]})})]})]}),o.jsx(_g,{bottom:p.prefs.collapsed?12:Ko+8,left:p.prefs.collapsed?60:12,onDismiss:p.dismissToast,toasts:p.toasts,width:(p.prefs.collapsed?320:p.prefs.width)-24}),Dn!==null&&o.jsx("iframe",{"aria-hidden":!0,className:"pointer-events-none fixed border-0",onLoad:h=>rr(Dn,h.currentTarget),ref:vs,src:Dn.url,style:{height:O1.height,left:-2400,top:0,width:O1.width},tabIndex:-1,title:"Off-stage duplicate scan"},Ba??void 0),x?o.jsx(bv,{mac:gm,onClose:Q,viewer:P}):null,D?o.jsx(dv,{connected:yn.agent.attached,fallbackFocusRef:bt.kind==="none"?Pt:ut,onClose:()=>R(!1)}):null,M!==null?o.jsx(wv,{busy:A,count:M.titles.length,error:M.error,fallbackFocusRef:m,name:M.titles.length===1?p.displayName(M.titles[0]??""):null,onCancel:Rt,onConfirm:()=>{wa()}}):null]})}function lu({children:i,title:u}){return o.jsxs("div",{className:"flex h-dvh flex-col items-center justify-center gap-3 bg-[#1C1C20] px-6 text-center antialiased",style:{fontFamily:"var(--font-satoshi)"},children:[o.jsx(au,{size:22}),o.jsx("p",{className:"text-sm font-medium text-white",children:u}),o.jsx("div",{className:"max-w-md text-xs leading-relaxed text-[#84848C]",children:i})]})}function jv(){const[i,u]=w.useState({status:"loading"}),[c,r]=w.useReducer(m=>m+1,0),f=w.useRef(0);return w.useEffect(()=>{let m=!1;const v=x=>fetch("/leglas/api/config",{signal:x}).then(y=>{if(!y.ok)throw Object.assign(new Error(`the server answered ${y.status}`),{status:y.status});return y.json()}),b=su(x=>v(x).then(y=>{m||(f.current=0,u(M=>M.status==="ready"&&JSON.stringify(M.config)===JSON.stringify(y)?M:{status:"ready",config:y}))}).catch(y=>{if(m)return;cf(y)||(f.current+=1);const M=y.status===403;u(N=>(N.status==="ready"||N.status==="ended")&&N.config.viewer!==void 0?cf(y)||!M&&f.current<2?N:{status:"ended",config:N.config,final:M}:N.status==="ready"?N:{status:"failed",message:cf(y)?"it did not answer in time":y instanceof Error?y.message:String(y)})}),{everyMs:$o,subscribe:x=>iu().on("config",x)});return()=>{m=!0,b()}},[c]),i.status==="loading"?o.jsx(lu,{title:"Starting Leglas…",children:null}):i.status==="ended"?i.final?o.jsx(lu,{title:"This share has ended",children:"The person sharing it stopped. A share they start later comes with a new link, so ask them for that one."}):o.jsxs(lu,{title:"This share isn’t answering",children:["The link is not reaching their Leglas right now: their machine may be asleep, or the tunnel between you is resetting. It comes back on its own when it can.",o.jsx("p",{className:"mt-4",children:o.jsx("button",{className:"rounded-md bg-[#2E2E2E] px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-[#3A3A40]",onClick:r,type:"button",children:"Try again"})})]}):i.status==="failed"?o.jsxs(lu,{title:"Couldn’t reach the Leglas server",children:[i.message,". The interface is served by the same process that proxies your app, so this usually means it stopped."]}):i.config.errors.length>0?o.jsxs(lu,{title:"Your config needs fixing",children:[o.jsx("ul",{className:"space-y-1 text-left",children:i.config.errors.map(m=>o.jsx("li",{children:m},m))}),o.jsx("p",{className:"mt-3",children:"Fix it and restart Leglas."})]}):o.jsx(Ev,{previews:i.config.previews,project:i.config.project,scanPreviews:i.config.scanPreviews??!0,viewer:i.config.viewer,warnings:i.config.warnings??[]})}const ym=document.getElementById("root");if(!ym)throw new Error("Leglas: #root is missing from the document.");Gp.createRoot(ym).render(o.jsx(w.StrictMode,{children:o.jsx(jv,{})}));
|