nomadexapp 0.2.7 → 0.2.8
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/bin/nomadex.mjs +35 -6
- package/dist/assets/{dist-CtZnR5SU.js → dist-BUbVsQdM.js} +1 -1
- package/dist/assets/{dist-CQ2y23jC.js → dist-BhphvNZp.js} +1 -1
- package/dist/assets/{dist-DLKfnbJq.js → dist-CRPXogT9.js} +1 -1
- package/dist/assets/{dist-5lEVZR9k.js → dist-CUPZ-IZ-.js} +1 -1
- package/dist/assets/{dist-DI2cogpO.js → dist-CZX_BxNx.js} +1 -1
- package/dist/assets/{dist-Da00El95.js → dist-CsLgvisI.js} +1 -1
- package/dist/assets/{dist-eahr6WYj.js → dist-D2GTvids.js} +1 -1
- package/dist/assets/{dist-L8N1FWpZ.js → dist-D5lJl_QN.js} +1 -1
- package/dist/assets/{dist-DBuCfFb6.js → dist-DGl_CjTP.js} +1 -1
- package/dist/assets/{dist-C6K4bU_E.js → dist-DR5p3y2B.js} +1 -1
- package/dist/assets/{dist-C5yratmO.js → dist-DwkZjLjZ.js} +1 -1
- package/dist/assets/{dist-Bb5X5pWX.js → dist-KzqaUjZC.js} +1 -1
- package/dist/assets/{dist-BU1nwyfe.js → dist-wU4D680r.js} +1 -1
- package/dist/assets/{dist-Di_686oq.js → dist-xy6Nd-hn.js} +1 -1
- package/dist/assets/{index-KrGECVTD.js → index-dUko-1DC.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-DR5p3y2B.js","assets/dist-DhhFPaYP.js","assets/dist-C_ZftsU-.js","assets/dist-DYBvJnrG.js","assets/dist-xy6Nd-hn.js","assets/dist-DGl_CjTP.js","assets/dist-wU4D680r.js","assets/dist-CRPXogT9.js","assets/dist-elfU6IUT.js","assets/dist-CUPZ-IZ-.js","assets/dist-Cc03jTPl.js","assets/dist-BhphvNZp.js","assets/dist-DwkZjLjZ.js","assets/dist-CZX_BxNx.js","assets/dist-D5lJl_QN.js","assets/dist-KzqaUjZC.js","assets/dist-C6S96i9v.js","assets/dist-D2GTvids.js","assets/dist-BSpuB3dZ.js","assets/dist-DIQDx3Dq.js","assets/dist-CftiQ_Tf.js","assets/dockerfile-BBRxgo6-.js","assets/simple-mode-BwNcRC8_.js","assets/factor-bi5FmZTz.js","assets/nsis-BHchP6IS.js","assets/pug-C39WZDG2.js","assets/javascript-B9Zm1tmO.js","assets/dist-CsLgvisI.js","assets/dist-BUbVsQdM.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{$ as e,A as t,At as n,Ct as r,Dt as i,E as a,Et as o,Ft as s,G as c,J as l,K as u,L as d,Mt as f,Nt as p,O as m,Ot as h,P as g,Pt as _,Q as v,S as y,St as b,T as x,Tt as S,W as C,X as w,Y as T,Z as E,_t as D,a as O,at as k,bt as ee,c as te,ct as ne,dt as A,et as j,f as re,ft as ie,g as ae,gt as oe,ht as se,it as M,j as ce,jt as le,kt as ue,l as de,lt as fe,mt as pe,n as me,nt as he,o as ge,ot as _e,pt as ve,q as ye,rt as be,st as xe,t as Se,tt as Ce,ut as we,v as Te,vt as N,w as Ee,wt as De,x as Oe,xt as ke,yt as Ae}from"./dist-DhhFPaYP.js";var je=Object.create,Me=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Pe=Object.getOwnPropertyNames,Fe=Object.getPrototypeOf,Ie=Object.prototype.hasOwnProperty,P=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Le=(e,t)=>{let n={};for(var r in e)Me(n,r,{get:e[r],enumerable:!0});return t||Me(n,Symbol.toStringTag,{value:`Module`}),n},Re=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Pe(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Ie.call(e,s)&&s!==n&&Me(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Ne(t,s))||r.enumerable});return e},ze=(e,t,n)=>(n=e==null?{}:je(Fe(e)),Re(t||!e||!e.__esModule?Me(n,`default`,{value:e,enumerable:!0}):n,e));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Be=P((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&te(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&te(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function te(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Ve=P(((e,t)=>{t.exports=Be()})),He=P((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){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,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function te(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function ne(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function A(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,A(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+te(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+te(a,u),c+=A(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+te(a,u++),c+=A(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return A(ne(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function j(e,t,n){if(e==null)return e;var r=[],i=0;return A(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ie=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&&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)},ae={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ae,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:re}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,ie)}catch(e){ie(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.4`})),Ue=P(((e,t)=>{t.exports=He()})),We=P((e=>{var t=Ue();function n(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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),Ge=P(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=We()})),Ke=P((e=>{var t=Ve(),n=Ue(),r=Ge();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var ee=Symbol.for(`react.client.reference`);function te(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?te(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}var ne=Array.isArray,A=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ie=[],ae=-1;function oe(e){return{current:e}}function se(e){0>ae||(e.current=ie[ae],ie[ae]=null,ae--)}function M(e,t){ae++,ie[ae]=e.current,e.current=t}var ce=oe(null),le=oe(null),ue=oe(null),de=oe(null);function fe(e,t){switch(M(ue,t),M(le,e),M(ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qd(t),e=Jd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}se(ce),M(ce,e)}function pe(){se(ce),se(le),se(ue)}function me(e){e.memoizedState!==null&&M(de,e);var t=ce.current,n=Jd(t,e.type);t!==n&&(M(le,e),M(ce,n))}function he(e){le.current===e&&(se(ce),se(le)),de.current===e&&(se(de),np._currentValue=re)}var ge,_e;function ve(e){if(ge===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ge=t&&t[1]||``,_e=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+ge+e+_e}var ye=!1;function be(e,t){if(!e||ye)return``;ye=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -6,8 +6,8 @@ import{$ as e,A as t,At as n,Ct as r,Dt as i,E as a,Et as o,Ft as s,G as c,J as
|
|
|
6
6
|
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
7
|
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ye=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ve(n):``}function xe(e,t){switch(e.tag){case 26:case 27:case 5:return ve(e.type);case 16:return ve(`Lazy`);case 13:return e.child!==t&&t!==null?ve(`Suspense Fallback`):ve(`Suspense`);case 19:return ve(`SuspenseList`);case 0:case 15:return be(e.type,!1);case 11:return be(e.type.render,!1);case 1:return be(e.type,!0);case 31:return ve(`Activity`);default:return``}}function Se(e){try{var t=``,n=null;do t+=xe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
8
|
Error generating stack: `+e.message+`
|
|
9
|
-
`+e.stack}}var Ce=Object.prototype.hasOwnProperty,we=t.unstable_scheduleCallback,Te=t.unstable_cancelCallback,N=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,P=null;function Le(e){if(typeof Pe==`function`&&Fe(e),P&&typeof P.setStrictMode==`function`)try{P.setStrictMode(Ie,e)}catch{}}var Re=Math.clz32?Math.clz32:He,ze=Math.log,Be=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(ze(e)/Be|0)|0}var We=256,Ke=262144,qe=4194304;function Je(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 Ye(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Je(n))):i=Je(o):i=Je(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Je(n))):i=Je(o)):i=Je(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Xe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ze(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 Qe(){var e=qe;return qe<<=1,!(qe&62914560)&&(qe=4194304),e}function $e(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function et(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function tt(e,t,n,r,i,a){var o=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 s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Re(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&nt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function nt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Re(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function rt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Re(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function it(e,t){var n=t&-t;return n=n&42?1:at(n),(n&(e.suspendedLanes|t))===0?n:0}function at(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 ot(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function st(){var e=j.p;return e===0?(e=window.event,e===void 0?32:vp(e.type)):e}function ct(e,t){var n=j.p;try{return j.p=e,t()}finally{j.p=n}}var lt=Math.random().toString(36).slice(2),ut=`__reactFiber$`+lt,dt=`__reactProps$`+lt,ft=`__reactContainer$`+lt,pt=`__reactEvents$`+lt,mt=`__reactListeners$`+lt,ht=`__reactHandles$`+lt,gt=`__reactResources$`+lt,_t=`__reactMarker$`+lt;function vt(e){delete e[ut],delete e[dt],delete e[pt],delete e[mt],delete e[ht]}function yt(e){var t=e[ut];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ft]||n[ut]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_f(e);e!==null;){if(n=e[ut])return n;e=_f(e)}return t}e=n,n=e.parentNode}return null}function bt(e){if(e=e[ut]||e[ft]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function xt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function St(e){var t=e[gt];return t||=e[gt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ct(e){e[_t]=!0}var wt=new Set,Tt={};function Et(e,t){Dt(e,t),Dt(e+`Capture`,t)}function Dt(e,t){for(Tt[e]=t,e=0;e<t.length;e++)wt.add(t[e])}var Ot=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]*$`),kt={},At={};function jt(e){return Ce.call(At,e)?!0:Ce.call(kt,e)?!1:Ot.test(e)?At[e]=!0:(kt[e]=!0,!1)}function Mt(e,t,n){if(jt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Nt(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 Pt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Ft(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function It(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Lt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rt(e){if(!e._valueTracker){var t=It(e)?`checked`:`value`;e._valueTracker=Lt(e,t,``+e[t])}}function zt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=It(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Bt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Vt=/[\n"\\]/g;function Ht(e){return e.replace(Vt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ut(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Ft(t)):e.value!==``+Ft(t)&&(e.value=``+Ft(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Gt(e,o,Ft(n)):Gt(e,o,Ft(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Ft(s):e.removeAttribute(`name`)}function Wt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Rt(e);return}n=n==null?``:``+Ft(n),t=t==null?n:``+Ft(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Rt(e)}function Gt(e,t,n){t===`number`&&Bt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Kt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Ft(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function qt(e,t,n){if(t!=null&&(t=``+Ft(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ft(n)}function Jt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ft(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Rt(e)}function F(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var I=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 Yt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||I.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Xt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Yt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Yt(e,o,t[o])}function Zt(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`]]),$t=/^[\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 en(e){return $t.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function tn(){}var nn=null;function rn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var an=null,on=null;function sn(e){var t=bt(e);if(t&&(e=t.stateNode)){var n=e[dt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ut(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="`+Ht(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[dt]||null;if(!a)throw Error(i(90));Ut(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&zt(r)}break a;case`textarea`:qt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Kt(e,!!n.multiple,t,!1)}}}var cn=!1;function ln(e,t,n){if(cn)return e(t,n);cn=!0;try{return e(t)}finally{if(cn=!1,(an!==null||on!==null)&&(wu(),an&&(t=an,e=on,on=an=null,sn(t),e)))for(t=0;t<e.length;t++)sn(e[t])}}function un(e,t){var n=e.stateNode;if(n===null)return null;var r=n[dt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var dn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),fn=!1;if(dn)try{var pn={};Object.defineProperty(pn,`passive`,{get:function(){fn=!0}}),window.addEventListener(`test`,pn,pn),window.removeEventListener(`test`,pn,pn)}catch{fn=!1}var L=null,mn=null,hn=null;function gn(){if(hn)return hn;var e,t=mn,n=t.length,r,i=`value`in L?L.value:L.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return hn=i.slice(e,1<r?1-r:void 0)}function _n(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 vn(){return!0}function yn(){return!1}function bn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?vn:yn,this.isPropagationStopped=yn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=vn)},persist:function(){},isPersistent:vn}),t}var xn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sn=bn(xn),Cn=f({},xn,{view:0,detail:0}),wn=bn(Cn),Tn,En,Dn,On=f({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zn,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!==Dn&&(Dn&&e.type===`mousemove`?(Tn=e.screenX-Dn.screenX,En=e.screenY-Dn.screenY):En=Tn=0,Dn=e),Tn)},movementY:function(e){return`movementY`in e?e.movementY:En}}),kn=bn(On),An=bn(f({},On,{dataTransfer:0})),jn=bn(f({},Cn,{relatedTarget:0})),Mn=bn(f({},xn,{animationName:0,elapsedTime:0,pseudoElement:0})),Nn=bn(f({},xn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Pn=bn(f({},xn,{data:0})),Fn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},In={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`},Ln={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ln[e])?!!t[e]:!1}function zn(){return Rn}var Bn=bn(f({},Cn,{key:function(e){if(e.key){var t=Fn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=_n(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?In[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zn,charCode:function(e){return e.type===`keypress`?_n(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?_n(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Vn=bn(f({},On,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Hn=bn(f({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zn})),Un=bn(f({},xn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Wn=bn(f({},On,{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})),Gn=bn(f({},xn,{newState:0,oldState:0})),Kn=[9,13,27,32],qn=dn&&`CompositionEvent`in window,Jn=null;dn&&`documentMode`in document&&(Jn=document.documentMode);var Yn=dn&&`TextEvent`in window&&!Jn,Xn=dn&&(!qn||Jn&&8<Jn&&11>=Jn),Zn=` `,Qn=!1;function $n(e,t){switch(e){case`keyup`:return Kn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var tr=!1;function nr(e,t){switch(e){case`compositionend`:return er(t);case`keypress`:return t.which===32?(Qn=!0,Zn):null;case`textInput`:return e=t.data,e===Zn&&Qn?null:e;default:return null}}function rr(e,t){if(tr)return e===`compositionend`||!qn&&$n(e,t)?(e=gn(),hn=mn=L=null,tr=!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 Xn&&t.locale!==`ko`?null:t.data;default:return null}}var ir={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 ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ir[e.type]:t===`textarea`}function or(e,t,n,r){an?on?on.push(r):on=[r]:an=r,t=jd(t,`onChange`),0<t.length&&(n=new Sn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var sr=null,cr=null;function lr(e){wd(e,0)}function ur(e){if(zt(xt(e)))return e}function dr(e,t){if(e===`change`)return t}var fr=!1;if(dn){var pr;if(dn){var mr=`oninput`in document;if(!mr){var hr=document.createElement(`div`);hr.setAttribute(`oninput`,`return;`),mr=typeof hr.oninput==`function`}pr=mr}else pr=!1;fr=pr&&(!document.documentMode||9<document.documentMode)}function gr(){sr&&(sr.detachEvent(`onpropertychange`,_r),cr=sr=null)}function _r(e){if(e.propertyName===`value`&&ur(cr)){var t=[];or(t,cr,e,rn(e)),ln(lr,t)}}function vr(e,t,n){e===`focusin`?(gr(),sr=t,cr=n,sr.attachEvent(`onpropertychange`,_r)):e===`focusout`&&gr()}function yr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ur(cr)}function br(e,t){if(e===`click`)return ur(t)}function xr(e,t){if(e===`input`||e===`change`)return ur(t)}function R(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Sr=typeof Object.is==`function`?Object.is:R;function Cr(e,t){if(Sr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ce.call(t,i)||!Sr(e[i],t[i]))return!1}return!0}function wr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tr(e,t){var n=wr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=wr(n)}}function Er(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Er(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bt(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=Bt(e.document)}return t}function Or(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 kr=dn&&`documentMode`in document&&11>=document.documentMode,Ar=null,jr=null,Mr=null,Nr=!1;function z(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nr||Ar==null||Ar!==Bt(r)||(r=Ar,`selectionStart`in r&&Or(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Mr&&Cr(Mr,r)||(Mr=r,r=jd(jr,`onSelect`),0<r.length&&(t=new Sn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ar)))}function Pr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Fr={animationend:Pr(`Animation`,`AnimationEnd`),animationiteration:Pr(`Animation`,`AnimationIteration`),animationstart:Pr(`Animation`,`AnimationStart`),transitionrun:Pr(`Transition`,`TransitionRun`),transitionstart:Pr(`Transition`,`TransitionStart`),transitioncancel:Pr(`Transition`,`TransitionCancel`),transitionend:Pr(`Transition`,`TransitionEnd`)},Ir={},Lr={};dn&&(Lr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Fr.animationend.animation,delete Fr.animationiteration.animation,delete Fr.animationstart.animation),`TransitionEvent`in window||delete Fr.transitionend.transition);function Rr(e){if(Ir[e])return Ir[e];if(!Fr[e])return e;var t=Fr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lr)return Ir[e]=t[n];return e}var zr=Rr(`animationend`),Br=Rr(`animationiteration`),Vr=Rr(`animationstart`),Hr=Rr(`transitionrun`),Ur=Rr(`transitionstart`),Wr=Rr(`transitioncancel`),Gr=Rr(`transitionend`),Kr=new Map,qr=`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(` `);qr.push(`scrollEnd`);function Jr(e,t){Kr.set(e,t),Et(t,[e])}var Yr=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&&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)},Xr=[],Zr=0,Qr=0;function $r(){for(var e=Zr,t=Qr=Zr=0;t<e;){var n=Xr[t];Xr[t++]=null;var r=Xr[t];Xr[t++]=null;var i=Xr[t];Xr[t++]=null;var a=Xr[t];if(Xr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ri(n,i,a)}}function ei(e,t,n,r){Xr[Zr++]=e,Xr[Zr++]=t,Xr[Zr++]=n,Xr[Zr++]=r,Qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ti(e,t,n,r){return ei(e,t,n,r),ii(e)}function ni(e,t){return ei(e,null,null,t),ii(e)}function ri(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Re(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ii(e){if(50<hu)throw hu=0,gu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ai={};function oi(e,t,n,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function si(e,t,n,r){return new oi(e,t,n,r)}function ci(e){return e=e.prototype,!(!e||!e.isReactComponent)}function li(e,t){var n=e.alternate;return n===null?(n=si(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 ui(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 di(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ci(e)&&(s=1);else if(typeof e==`string`)s=qf(e,n,ce.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=si(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return fi(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=si(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=si(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=si(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=si(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function fi(e,t,n,r){return e=si(7,e,r,t),e.lanes=n,e}function pi(e,t,n){return e=si(6,e,null,t),e.lanes=n,e}function mi(e){var t=si(18,null,null,0);return t.stateNode=e,t}function hi(e,t,n){return t=si(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gi=new WeakMap;function _i(e,t){if(typeof e==`object`&&e){var n=gi.get(e);return n===void 0?(t={value:e,source:t,stack:Se(t)},gi.set(e,t),t):n}return{value:e,source:t,stack:Se(t)}}var vi=[],yi=0,bi=null,xi=0,Si=[],Ci=0,wi=null,Ti=1,Ei=``;function Di(e,t){vi[yi++]=xi,vi[yi++]=bi,bi=e,xi=t}function Oi(e,t,n){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,wi=e;var r=Ti;e=Ei;var i=32-Re(r)-1;r&=~(1<<i),n+=1;var a=32-Re(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ti=1<<32-Re(t)+i|n<<i|r,Ei=a+e}else Ti=1<<a|n<<i|r,Ei=e}function ki(e){e.return!==null&&(Di(e,1),Oi(e,1,0))}function Ai(e){for(;e===bi;)bi=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null;for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ei=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null}function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,Ti=t.id,Ei=t.overflow,wi=e}var Mi=null,Ni=null,B=!1,Pi=null,Fi=!1,Ii=Error(i(519));function Li(e){throw Ui(_i(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ii}function Ri(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ut]=e,t[dt]=r,n){case`dialog`:q(`cancel`,t),q(`close`,t);break;case`iframe`:case`object`:case`embed`:q(`load`,t);break;case`video`:case`audio`:for(n=0;n<Sd.length;n++)q(Sd[n],t);break;case`source`:q(`error`,t);break;case`img`:case`image`:case`link`:q(`error`,t),q(`load`,t);break;case`details`:q(`toggle`,t);break;case`input`:q(`invalid`,t),Wt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:q(`invalid`,t);break;case`textarea`:q(`invalid`,t),Jt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Ld(t.textContent,n)?(r.popover!=null&&(q(`beforetoggle`,t),q(`toggle`,t)),r.onScroll!=null&&q(`scroll`,t),r.onScrollEnd!=null&&q(`scrollend`,t),r.onClick!=null&&(t.onclick=tn),t=!0):t=!1,t||Li(e,!0)}function zi(e){for(Mi=e.return;Mi;)switch(Mi.tag){case 5:case 31:case 13:Fi=!1;return;case 27:case 3:Fi=!0;return;default:Mi=Mi.return}}function Bi(e){if(e!==Mi)return!1;if(!B)return zi(e),B=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Yd(e.type,e.memoizedProps)),n=!n),n&&Ni&&Li(e),zi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=gf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=gf(e)}else t===27?(t=Ni,rf(e.type)?(e=hf,hf=null,Ni=e):Ni=t):Ni=Mi?mf(e.stateNode.nextSibling):null;return!0}function Vi(){Ni=Mi=null,B=!1}function Hi(){var e=Pi;return e!==null&&(nu===null?nu=e:nu.push.apply(nu,e),Pi=null),e}function Ui(e){Pi===null?Pi=[e]:Pi.push(e)}var Wi=oe(null),Gi=null,Ki=null;function qi(e,t,n){M(Wi,t._currentValue),t._currentValue=n}function Ji(e){e._currentValue=Wi.current,se(Wi)}function Yi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Xi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Yi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Yi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Zi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Sr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===de.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[np]:e.push(np))}a=a.return}e!==null&&Xi(t,e,n,r),t.flags|=262144}function Qi(e){for(e=e.firstContext;e!==null;){if(!Sr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $i(e){Gi=e,Ki=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ea(e){return na(Gi,e)}function ta(e,t){return Gi===null&&$i(e),na(e,t)}function na(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ki===null){if(e===null)throw Error(i(308));Ki=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ki=Ki.next=t;return n}var ra=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ia=t.unstable_scheduleCallback,aa=t.unstable_NormalPriority,oa={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sa(){return{controller:new ra,data:new Map,refCount:0}}function ca(e){e.refCount--,e.refCount===0&&ia(aa,function(){e.controller.abort()})}var la=null,ua=0,da=0,fa=null;function pa(e,t){if(la===null){var n=la=[];ua=0,da=gd(),fa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ua++,t.then(ma,ma),t}function ma(){if(--ua===0&&la!==null){fa!==null&&(fa.status=`fulfilled`);var e=la;la=null,da=0,fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ha(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ga=A.S;A.S=function(e,t){au=De(),typeof t==`object`&&t&&typeof t.then==`function`&&pa(e,t),ga!==null&&ga(e,t)};var _a=oe(null);function va(){var e=_a.current;return e===null?Hl.pooledCache:e}function ya(e,t){t===null?M(_a,_a.current):M(_a,t.pool)}function ba(){var e=va();return e===null?null:{parent:oa._currentValue,pool:e}}var xa=Error(i(460)),Sa=Error(i(474)),Ca=Error(i(542)),wa={then:function(){}};function Ta(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ea(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(tn,tn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Aa(e),e;default:if(typeof t.status==`string`)t.then(tn,tn);else{if(e=Hl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Aa(e),e}throw Oa=t,xa}}function Da(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Oa=e,xa):e}}var Oa=null;function ka(){if(Oa===null)throw Error(i(459));var e=Oa;return Oa=null,e}function Aa(e){if(e===xa||e===Ca)throw Error(i(483))}var ja=null,Ma=0;function Na(e){var t=Ma;return Ma+=1,ja===null&&(ja=[]),Ea(ja,e,t)}function Pa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Fa(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ia(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=li(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=pi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&Da(i)===t.type)?(t=a(t,n.props),Pa(t,n),t.return=e,t):(t=di(n.type,n.key,n.props,null,e.mode,r),Pa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=hi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=fi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=di(t.type,t.key,t.props,null,e.mode,n),Pa(n,t),n.return=e,n;case h:return t=hi(t,e.mode,n),t.return=e,t;case T:return t=Da(t),f(e,t,n)}if(ne(t)||k(t))return t=fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Na(t),n);if(t.$$typeof===b)return f(e,ta(e,t),n);Fa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=Da(n),p(e,t,n,r)}if(ne(n)||k(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Na(n),r);if(n.$$typeof===b)return p(e,t,ta(e,n),r);Fa(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=Da(r),_(e,t,n,r,i)}if(ne(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Na(r),i);if(r.$$typeof===b)return _(e,t,n,ta(t,r),i);Fa(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),B&&Di(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return B&&Di(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),B&&Di(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),B&&Di(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return B&&Di(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),B&&Di(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Da(l)===r.type){n(e,r.sibling),c=a(r,o.props),Pa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===g?(c=fi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=di(o.type,o.key,o.props,null,e.mode,c),Pa(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=hi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Da(o),x(e,r,o,c)}if(ne(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Na(o),c);if(o.$$typeof===b)return x(e,r,ta(e,o),c);Fa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ma=0;var i=x(e,t,n,r);return ja=null,i}catch(t){if(t===xa||t===Ca)throw t;var a=si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var La=Ia(!0),Ra=Ia(!1),za=!1;function Ba(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Va(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 Ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Vl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ii(e),ri(e,null,n),t}return ei(e,r,t,n),ii(e)}function Wa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rt(e,n)}}function Ga(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ka=!1;function qa(){if(Ka){var e=fa;if(e!==null)throw e}}function Ja(e,t,n,r){Ka=!1;var i=e.updateQueue;za=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(G&p)===p:(r&p)===p){p!==0&&p===da&&(Ka=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:za=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Xl|=o,e.lanes=o,e.memoizedState=d}}function Ya(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Xa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ya(n[e],t)}var Za=oe(null),Qa=oe(0);function $a(e,t){e=Jl,M(Qa,e),M(Za,t),Jl=e|t.baseLanes}function eo(){M(Qa,Jl),M(Za,Za.current)}function to(){Jl=Qa.current,se(Za),se(Qa)}var no=oe(null),ro=null;function io(e){var t=e.alternate;M(lo,lo.current&1),M(no,e),ro===null&&(t===null||Za.current!==null||t.memoizedState!==null)&&(ro=e)}function ao(e){M(lo,lo.current),M(no,e),ro===null&&(ro=e)}function oo(e){e.tag===22?(M(lo,lo.current),M(no,e),ro===null&&(ro=e)):so(e)}function so(){M(lo,lo.current),M(no,no.current)}function co(e){se(no),ro===e&&(ro=null),se(lo)}var lo=oe(0);function uo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||df(n)||ff(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)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 fo=0,V=null,po=null,mo=null,ho=!1,go=!1,_o=!1,vo=0,yo=0,bo=null,xo=0;function H(){throw Error(i(321))}function So(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Sr(e[n],t[n]))return!1;return!0}function Co(e,t,n,r,i,a){return fo=a,V=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?Bs:Vs,_o=!1,a=n(r,i),_o=!1,go&&(a=To(t,n,r,i)),wo(e),a}function wo(e){A.H=zs;var t=po!==null&&po.next!==null;if(fo=0,mo=po=V=null,ho=!1,yo=0,bo=null,t)throw Error(i(300));e===null||ic||(e=e.dependencies,e!==null&&Qi(e)&&(ic=!0))}function To(e,t,n,r){V=e;var a=0;do{if(go&&(bo=null),yo=0,go=!1,25<=a)throw Error(i(301));if(a+=1,mo=po=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}A.H=Hs,o=t(n,r)}while(go);return o}function Eo(){var e=A.H,t=e.useState()[0];return t=typeof t.then==`function`?No(t):t,e=e.useState()[0],(po===null?null:po.memoizedState)!==e&&(V.flags|=1024),t}function Do(){var e=vo!==0;return vo=0,e}function Oo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ko(e){if(ho){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ho=!1}fo=0,mo=po=V=null,go=!1,yo=vo=0,bo=null}function Ao(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mo===null?V.memoizedState=mo=e:mo=mo.next=e,mo}function jo(){if(po===null){var e=V.alternate;e=e===null?null:e.memoizedState}else e=po.next;var t=mo===null?V.memoizedState:mo.next;if(t!==null)mo=t,po=e;else{if(e===null)throw V.alternate===null?Error(i(467)):Error(i(310));po=e,e={memoizedState:po.memoizedState,baseState:po.baseState,baseQueue:po.baseQueue,queue:po.queue,next:null},mo===null?V.memoizedState=mo=e:mo=mo.next=e}return mo}function Mo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function No(e){var t=yo;return yo+=1,bo===null&&(bo=[]),e=Ea(bo,e,t),t=V,(mo===null?t.memoizedState:mo.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?Bs:Vs),e}function Po(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return No(e);if(e.$$typeof===b)return ea(e)}throw Error(i(438,String(e)))}function Fo(e){var t=null,n=V.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=V.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Mo(),V.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=D;return t.index++,n}function Io(e,t){return typeof t==`function`?t(e):t}function Lo(e){return Ro(jo(),po,e)}function Ro(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(fo&f)===f:(G&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===da&&(d=!0);else if((fo&p)===p){u=u.next,p===da&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,V.lanes|=p,Xl|=p;f=u.action,_o&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,V.lanes|=f,Xl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Sr(o,e.memoizedState)&&(ic=!0,d&&(n=fa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function zo(e){var t=jo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Sr(o,t.memoizedState)||(ic=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Bo(e,t,n){var r=V,a=jo(),o=B;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Sr((po||a).memoizedState,n);if(s&&(a.memoizedState=n,ic=!0),a=a.queue,ds(Uo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||mo!==null&&mo.memoizedState.tag&1){if(r.flags|=2048,os(9,{destroy:void 0},Ho.bind(null,r,a,n,t),null),Hl===null)throw Error(i(349));o||fo&127||Vo(r,t,n)}return n}function Vo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=V.updateQueue,t===null?(t=Mo(),V.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ho(e,t,n,r){t.value=n,t.getSnapshot=r,Wo(t)&&Go(e)}function Uo(e,t,n){return n(function(){Wo(t)&&Go(e)})}function Wo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Sr(e,n)}catch{return!0}}function Go(e){var t=ni(e,2);t!==null&&yu(t,e,2)}function Ko(e){var t=Ao();if(typeof e==`function`){var n=e;if(e=n(),_o){Le(!0);try{n()}finally{Le(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:e},t}function qo(e,t,n,r){return e.baseState=n,Ro(e,po,typeof r==`function`?r:Io)}function Jo(e,t,n,r,a){if(Is(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};A.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Yo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Yo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=A.T,o={};A.T=o;try{var s=n(i,r),c=A.S;c!==null&&c(o,s),Xo(e,t,s)}catch(n){Qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),A.T=a}}else try{a=n(i,r),Xo(e,t,a)}catch(n){Qo(e,t,n)}}function Xo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Zo(e,t,n)},function(n){return Qo(e,t,n)}):Zo(e,t,n)}function Zo(e,t,n){t.status=`fulfilled`,t.value=n,$o(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Yo(e,n)))}function Qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,$o(t),t=t.next;while(t!==r)}e.action=null}function $o(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function es(e,t){return t}function ts(e,t){if(B){var n=Hl.formState;if(n!==null){a:{var r=V;if(B){if(Ni){b:{for(var i=Ni,a=Fi;i.nodeType!==8;){if(!a){i=null;break b}if(i=mf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ni=mf(i.nextSibling),r=i.data===`F!`;break a}}Li(r)}r=!1}r&&(t=n[0])}}return n=Ao(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:es,lastRenderedState:t},n.queue=r,n=Ns.bind(null,V,r),r.dispatch=n,r=Ko(!1),a=Fs.bind(null,V,!1,r.queue),r=Ao(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Jo.bind(null,V,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ns(e){return rs(jo(),po,e)}function rs(e,t,n){if(t=Ro(e,t,es)[0],e=Lo(Io)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=No(t)}catch(e){throw e===xa?Ca:e}else r=t;t=jo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(V.flags|=2048,os(9,{destroy:void 0},is.bind(null,i,n),null)),[r,a,e]}function is(e,t){e.action=t}function as(e){var t=jo(),n=po;if(n!==null)return rs(t,n,e);jo(),t=t.memoizedState,n=jo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function os(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=V.updateQueue,t===null&&(t=Mo(),V.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ss(){return jo().memoizedState}function cs(e,t,n,r){var i=Ao();V.flags|=e,i.memoizedState=os(1|t,{destroy:void 0},n,r===void 0?null:r)}function ls(e,t,n,r){var i=jo();r=r===void 0?null:r;var a=i.memoizedState.inst;po!==null&&r!==null&&So(r,po.memoizedState.deps)?i.memoizedState=os(t,a,n,r):(V.flags|=e,i.memoizedState=os(1|t,a,n,r))}function us(e,t){cs(8390656,8,e,t)}function ds(e,t){ls(2048,8,e,t)}function fs(e){V.flags|=4;var t=V.updateQueue;if(t===null)t=Mo(),V.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ps(e){var t=jo().memoizedState;return fs({ref:t,nextImpl:e}),function(){if(Vl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ms(e,t){return ls(4,2,e,t)}function hs(e,t){return ls(4,4,e,t)}function gs(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 _s(e,t,n){n=n==null?null:n.concat([e]),ls(4,4,gs.bind(null,t,e),n)}function vs(){}function ys(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&So(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function bs(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&So(t,r[1]))return r[0];if(r=e(),_o){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r}function xs(e,t,n){return n===void 0||fo&1073741824&&!(G&261930)?e.memoizedState=t:(e.memoizedState=n,e=vu(),V.lanes|=e,Xl|=e,n)}function Ss(e,t,n,r){return Sr(n,t)?n:Za.current===null?!(fo&42)||fo&1073741824&&!(G&261930)?(ic=!0,e.memoizedState=n):(e=vu(),V.lanes|=e,Xl|=e,t):(e=xs(e,n,r),Sr(e,t)||(ic=!0),e)}function Cs(e,t,n,r,i){var a=j.p;j.p=a!==0&&8>a?a:8;var o=A.T,s={};A.T=s,Fs(e,!1,t,n);try{var c=i(),l=A.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ps(e,t,ha(c,r),_u(e)):Ps(e,t,r,_u(e))}catch(n){Ps(e,t,{then:function(){},status:`rejected`,reason:n},_u())}finally{j.p=a,o!==null&&s.types!==null&&(o.types=s.types),A.T=o}}function ws(){}function Ts(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Es(e).queue;Cs(e,a,t,re,n===null?ws:function(){return Ds(e),n(r)})}function Es(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ds(e){var t=Es(e);t.next===null&&(t=e.alternate.memoizedState),Ps(e,t.next.queue,{},_u())}function Os(){return ea(np)}function ks(){return jo().memoizedState}function As(){return jo().memoizedState}function js(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=_u();e=Ha(n);var r=Ua(t,e,n);r!==null&&(yu(r,t,n),Wa(r,t,n)),t={cache:sa()},e.payload=t;return}t=t.return}}function Ms(e,t,n){var r=_u();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Is(e)?Ls(t,n):(n=ti(e,t,n,r),n!==null&&(yu(n,e,r),Rs(n,t,r)))}function Ns(e,t,n){Ps(e,t,n,_u())}function Ps(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Is(e))Ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Sr(s,o))return ei(e,t,i,0),Hl===null&&$r(),!1}catch{}if(n=ti(e,t,i,r),n!==null)return yu(n,e,r),Rs(n,t,r),!0}return!1}function Fs(e,t,n,r){if(r={lane:2,revertLane:gd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Is(e)){if(t)throw Error(i(479))}else t=ti(e,n,r,2),t!==null&&yu(t,e,2)}function Is(e){var t=e.alternate;return e===V||t!==null&&t===V}function Ls(e,t){go=ho=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rt(e,n)}}var zs={readContext:ea,use:Po,useCallback:H,useContext:H,useEffect:H,useImperativeHandle:H,useLayoutEffect:H,useInsertionEffect:H,useMemo:H,useReducer:H,useRef:H,useState:H,useDebugValue:H,useDeferredValue:H,useTransition:H,useSyncExternalStore:H,useId:H,useHostTransitionStatus:H,useFormState:H,useActionState:H,useOptimistic:H,useMemoCache:H,useCacheRefresh:H};zs.useEffectEvent=H;var Bs={readContext:ea,use:Po,useCallback:function(e,t){return Ao().memoizedState=[e,t===void 0?null:t],e},useContext:ea,useEffect:us,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),cs(4194308,4,gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return cs(4194308,4,e,t)},useInsertionEffect:function(e,t){cs(4,2,e,t)},useMemo:function(e,t){var n=Ao();t=t===void 0?null:t;var r=e();if(_o){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Ao();if(n!==void 0){var i=n(t);if(_o){Le(!0);try{n(t)}finally{Le(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ms.bind(null,V,e),[r.memoizedState,e]},useRef:function(e){var t=Ao();return e={current:e},t.memoizedState=e},useState:function(e){e=Ko(e);var t=e.queue,n=Ns.bind(null,V,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:vs,useDeferredValue:function(e,t){return xs(Ao(),e,t)},useTransition:function(){var e=Ko(!1);return e=Cs.bind(null,V,e.queue,!0,!1),Ao().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=V,a=Ao();if(B){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Hl===null)throw Error(i(349));G&127||Vo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,us(Uo.bind(null,r,o,e),[e]),r.flags|=2048,os(9,{destroy:void 0},Ho.bind(null,r,o,n,t),null),n},useId:function(){var e=Ao(),t=Hl.identifierPrefix;if(B){var n=Ei,r=Ti;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=vo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Os,useFormState:ts,useActionState:ts,useOptimistic:function(e){var t=Ao();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Fs.bind(null,V,!0,n),n.dispatch=t,[e,t]},useMemoCache:Fo,useCacheRefresh:function(){return Ao().memoizedState=js.bind(null,V)},useEffectEvent:function(e){var t=Ao(),n={impl:e};return t.memoizedState=n,function(){if(Vl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Vs={readContext:ea,use:Po,useCallback:ys,useContext:ea,useEffect:ds,useImperativeHandle:_s,useInsertionEffect:ms,useLayoutEffect:hs,useMemo:bs,useReducer:Lo,useRef:ss,useState:function(){return Lo(Io)},useDebugValue:vs,useDeferredValue:function(e,t){return Ss(jo(),po.memoizedState,e,t)},useTransition:function(){var e=Lo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:Bo,useId:ks,useHostTransitionStatus:Os,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){return qo(jo(),po,e,t)},useMemoCache:Fo,useCacheRefresh:As};Vs.useEffectEvent=ps;var Hs={readContext:ea,use:Po,useCallback:ys,useContext:ea,useEffect:ds,useImperativeHandle:_s,useInsertionEffect:ms,useLayoutEffect:hs,useMemo:bs,useReducer:zo,useRef:ss,useState:function(){return zo(Io)},useDebugValue:vs,useDeferredValue:function(e,t){var n=jo();return po===null?xs(n,e,t):Ss(n,po.memoizedState,e,t)},useTransition:function(){var e=zo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:Bo,useId:ks,useHostTransitionStatus:Os,useFormState:as,useActionState:as,useOptimistic:function(e,t){var n=jo();return po===null?(n.baseState=e,[e,n.queue.dispatch]):qo(n,po,e,t)},useMemoCache:Fo,useCacheRefresh:As};Hs.useEffectEvent=ps;function Us(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ws={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_u(),i=Ha(r);i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(yu(t,e,r),Wa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_u(),i=Ha(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(yu(t,e,r),Wa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_u(),r=Ha(n);r.tag=2,t!=null&&(r.callback=t),t=Ua(e,r,n),t!==null&&(yu(t,e,n),Wa(t,e,n))}};function Gs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Cr(n,r)||!Cr(i,a):!0}function Ks(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ws.enqueueReplaceState(t,t.state,null)}function qs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Js(e){Yr(e)}function Ys(e){console.error(e)}function Xs(e){Yr(e)}function Zs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Qs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function $s(e,t,n){return n=Ha(n),n.tag=3,n.payload={element:null},n.callback=function(){Zs(e,t)},n}function ec(e){return e=Ha(e),e.tag=3,e}function tc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Qs(t,n,r),typeof i!=`function`&&(K===null?K=new Set([this]):K.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function nc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Zi(t,n,a,!0),n=no.current,n!==null){switch(n.tag){case 31:case 13:return ro===null?ju():n.alternate===null&&Yl===0&&(Yl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===wa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Xu(e,r,a)),!1;case 22:return n.flags|=65536,r===wa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Xu(e,r,a)),!1}throw Error(i(435,n.tag))}return Xu(e,r,a),ju(),!1}if(B)return t=no.current,t===null?(r!==Ii&&(t=Error(i(423),{cause:r}),Ui(_i(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=_i(r,n),a=$s(e.stateNode,r,a),Ga(e,a),Yl!==4&&(Yl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ii&&(e=Error(i(422),{cause:r}),Ui(_i(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=_i(o,n),tu===null?tu=[o]:tu.push(o),Yl!==4&&(Yl=2),t===null)return!0;r=_i(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=$s(n.stateNode,r,e),Ga(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(K===null||!K.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ec(a),tc(a,e,n,r),Ga(n,a),!1}n=n.return}while(n!==null);return!1}var rc=Error(i(461)),ic=!1;function ac(e,t,n,r){t.child=e===null?Ra(t,null,n,r):La(t,e.child,n,r)}function oc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return $i(t),r=Co(e,t,n,o,a,i),s=Do(),e!==null&&!ic?(Oo(e,t,i),Ac(e,t,i)):(B&&s&&ki(t),t.flags|=1,ac(e,t,r,i),t.child)}function sc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ci(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,cc(e,t,a,r,i)):(e=di(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!jc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Cr:n,n(o,r)&&e.ref===t.ref)return Ac(e,t,i)}return t.flags|=1,e=li(a,r),e.ref=t.ref,e.return=t,t.child=e}function cc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Cr(a,r)&&e.ref===t.ref)if(ic=!1,t.pendingProps=r=a,jc(e,i))e.flags&131072&&(ic=!0);else return t.lanes=e.lanes,Ac(e,t,i)}return gc(e,t,n,r,i)}function lc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return dc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ya(t,a===null?null:a.cachePool),a===null?eo():$a(t,a),oo(t);else return r=t.lanes=536870912,dc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ya(t,null),eo(),so(t)):(ya(t,a.cachePool),$a(t,a),so(t),t.memoizedState=null);return ac(e,t,i,n),t.child}function uc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function dc(e,t,n,r,i){var a=va();return a=a===null?null:{parent:oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ya(t,null),eo(),oo(t),e!==null&&Zi(e,t,r,!0),t.childLanes=i,null}function fc(e,t){return t=Tc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function pc(e,t,n){return La(t,e.child,null,n),e=fc(t,t.pendingProps),e.flags|=2,co(t),t.memoizedState=null,e}function mc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(B){if(r.mode===`hidden`)return e=fc(t,r),t.lanes=536870912,uc(null,e);if(ao(t),(e=Ni)?(e=uf(e,Fi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Li(t);return t.lanes=536870912,null}return fc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ao(t),a)if(t.flags&256)t.flags&=-257,t=pc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ic||Zi(e,t,n,!1),a=(n&e.childLanes)!==0,ic||a){if(r=Hl,r!==null&&(s=it(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ni(e,s),yu(r,e,s),rc;ju(),t=pc(e,t,n)}else e=o.treeContext,Ni=mf(s.nextSibling),Mi=t,B=!0,Pi=null,Fi=!1,e!==null&&ji(t,e),t=fc(t,r),t.flags|=4096;return t}return e=li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function hc(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(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function gc(e,t,n,r,i){return $i(t),n=Co(e,t,n,r,void 0,i),r=Do(),e!==null&&!ic?(Oo(e,t,i),Ac(e,t,i)):(B&&r&&ki(t),t.flags|=1,ac(e,t,n,i),t.child)}function _c(e,t,n,r,i,a){return $i(t),t.updateQueue=null,n=To(t,r,n,i),wo(e),r=Do(),e!==null&&!ic?(Oo(e,t,a),Ac(e,t,a)):(B&&r&&ki(t),t.flags|=1,ac(e,t,n,a),t.child)}function vc(e,t,n,r,i){if($i(t),t.stateNode===null){var a=ai,o=n.contextType;typeof o==`object`&&o&&(a=ea(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ws,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ba(t),o=n.contextType,a.context=typeof o==`object`&&o?ea(o):ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Us(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ws.enqueueReplaceState(a,a.state,null),Ja(t,r,a,i),qa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=qs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ai,typeof u==`object`&&u&&(o=ea(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ks(t,a,r,o),za=!1;var f=t.memoizedState;a.state=f,Ja(t,r,a,i),qa(),l=t.memoizedState,s||f!==l||za?(typeof d==`function`&&(Us(t,n,d,r),l=t.memoizedState),(c=za||Gs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Va(e,t),o=t.memoizedProps,u=qs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ai,typeof l==`object`&&l&&(c=ea(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ks(t,a,r,c),za=!1,f=t.memoizedState,a.state=f,Ja(t,r,a,i),qa();var p=t.memoizedState;o!==d||f!==p||za||e!==null&&e.dependencies!==null&&Qi(e.dependencies)?(typeof s==`function`&&(Us(t,n,s,r),p=t.memoizedState),(u=za||Gs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Qi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,hc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=La(t,e.child,null,i),t.child=La(t,null,n,i)):ac(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ac(e,t,i),e}function yc(e,t,n,r){return Vi(),t.flags|=256,ac(e,t,n,r),t.child}var bc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xc(e){return{baseLanes:e,cachePool:ba()}}function Sc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=$l),e}function Cc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(lo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(B){if(a?io(t):so(t),(e=Ni)?(e=uf(e,Fi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Li(t);return ff(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(so(t),a=t.mode,c=Tc({mode:`hidden`,children:c},a),r=fi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=xc(n),r.childLanes=Sc(e,s,n),t.memoizedState=bc,uc(null,r)):(io(t),wc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(io(t),t.flags&=-257,t=Ec(e,t,n)):t.memoizedState===null?(so(t),c=r.fallback,a=t.mode,r=Tc({mode:`visible`,children:r.children},a),c=fi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,La(t,e.child,null,n),r=t.child,r.memoizedState=xc(n),r.childLanes=Sc(e,s,n),t.memoizedState=bc,t=uc(null,r)):(so(t),t.child=e.child,t.flags|=128,t=null);else if(io(t),ff(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ui({value:r,source:null,stack:null}),t=Ec(e,t,n)}else if(ic||Zi(e,t,n,!1),s=(n&e.childLanes)!==0,ic||s){if(s=Hl,s!==null&&(r=it(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ni(e,r),yu(s,e,r),rc;df(c)||ju(),t=Ec(e,t,n)}else df(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ni=mf(c.nextSibling),Mi=t,B=!0,Pi=null,Fi=!1,e!==null&&ji(t,e),t=wc(t,r.children),t.flags|=4096);return t}return a?(so(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=li(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=fi(c,a,n,null),c.flags|=2):c=li(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,uc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=xc(n):(a=c.cachePool,a===null?a=ba():(l=oa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Sc(e,s,n),t.memoizedState=bc,uc(e.child,r)):(io(t),n=e.child,e=n.sibling,n=li(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function wc(e,t){return t=Tc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Tc(e,t){return e=si(22,e,null,t),e.lanes=0,e}function Ec(e,t,n){return La(t,e.child,null,n),e=wc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Yi(e.return,t,n)}function Oc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function kc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=lo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,M(lo,o),ac(e,t,r,n),r=B?xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Dc(e,n,t);else if(e.tag===19)Dc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&uo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Oc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&uo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Oc(t,!0,n,null,a,r);break;case`together`:Oc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ac(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Xl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Zi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function jc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Qi(e))):!0}function Mc(e,t,n){switch(t.tag){case 3:fe(t,t.stateNode.containerInfo),qi(t,oa,e.memoizedState.cache),Vi();break;case 27:case 5:me(t);break;case 4:fe(t,t.stateNode.containerInfo);break;case 10:qi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(io(t),e=Ac(e,t,n),e===null?null:e.sibling):Cc(e,t,n):(io(t),t.flags|=128,null);io(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Zi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return kc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),M(lo,lo.current),r)break;return null;case 22:return t.lanes=0,lc(e,t,n,t.pendingProps);case 24:qi(t,oa,e.memoizedState.cache)}return Ac(e,t,n)}function Nc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ic=!0;else{if(!jc(e,n)&&!(t.flags&128))return ic=!1,Mc(e,t,n);ic=!!(e.flags&131072)}else ic=!1,B&&t.flags&1048576&&Oi(t,xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Da(t.elementType),t.type=e,typeof e==`function`)ci(e)?(r=qs(e,r),t.tag=1,t=vc(null,t,e,r,n)):(t.tag=0,t=gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=oc(null,t,e,r,n);break a}else if(a===w){t.tag=14,t=sc(null,t,e,r,n);break a}}throw t=te(e)||e,Error(i(306,t,``))}}return t;case 0:return gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=qs(r,t.pendingProps),vc(e,t,r,a,n);case 3:a:{if(fe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Va(e,t),Ja(t,r,null,n);var s=t.memoizedState;if(r=s.cache,qi(t,oa,r),r!==o.cache&&Xi(t,[oa],n,!0),qa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=yc(e,t,r,n);break a}else if(r!==a){a=_i(Error(i(424)),t),Ui(a),t=yc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ni=mf(e.firstChild),Mi=t,B=!0,Pi=null,Fi=!0,n=Ra(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Vi(),r===a){t=Ac(e,t,n);break a}ac(e,t,r,n)}t=t.child}return t;case 26:return hc(e,t),e===null?(n=Ff(t.type,null,t.pendingProps,null))?t.memoizedState=n:B||(n=t.type,e=t.pendingProps,r=Kd(ue.current).createElement(n),r[ut]=t,r[dt]=e,Bd(r,n,e),Ct(r),t.stateNode=r):t.memoizedState=Ff(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return me(t),e===null&&B&&(r=t.stateNode=vf(t.type,t.pendingProps,ue.current),Mi=t,Fi=!0,a=Ni,rf(t.type)?(hf=a,Ni=mf(r.firstChild)):Ni=a),ac(e,t,t.pendingProps.children,n),hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&B&&((a=r=Ni)&&(r=cf(r,t.type,t.pendingProps,Fi),r===null?a=!1:(t.stateNode=r,Mi=t,Ni=mf(r.firstChild),Fi=!1,a=!0)),a||Li(t)),me(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Yd(a,o)?r=null:s!==null&&Yd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Co(e,t,Eo,null,null,n),np._currentValue=a),hc(e,t),ac(e,t,r,n),t.child;case 6:return e===null&&B&&((e=n=Ni)&&(n=lf(n,t.pendingProps,Fi),n===null?e=!1:(t.stateNode=n,Mi=t,Ni=null,e=!0)),e||Li(t)),null;case 13:return Cc(e,t,n);case 4:return fe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=La(t,null,r,n):ac(e,t,r,n),t.child;case 11:return oc(e,t,t.type,t.pendingProps,n);case 7:return ac(e,t,t.pendingProps,n),t.child;case 8:return ac(e,t,t.pendingProps.children,n),t.child;case 12:return ac(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,qi(t,t.type,r.value),ac(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,$i(t),a=ea(a),r=r(a),t.flags|=1,ac(e,t,r,n),t.child;case 14:return sc(e,t,t.type,t.pendingProps,n);case 15:return cc(e,t,t.type,t.pendingProps,n);case 19:return kc(e,t,n);case 31:return mc(e,t,n);case 22:return lc(e,t,n,t.pendingProps);case 24:return $i(t),r=ea(oa),e===null?(a=va(),a===null&&(a=Hl,o=sa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ba(t),qi(t,oa,a)):((e.lanes&n)!==0&&(Va(e,t),Ja(t,null,null,n),qa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,qi(t,oa,r),r!==a.cache&&Xi(t,[oa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),qi(t,oa,r))),ac(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Pc(e){e.flags|=4}function Fc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Ou())e.flags|=8192;else throw Oa=wa,Sa}else e.flags&=-16777217}function Ic(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Jf(t))if(Ou())e.flags|=8192;else throw Oa=wa,Sa}function Lc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Qe(),e.lanes|=t,eu|=t)}function Rc(e,t){if(!B)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function zc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Bc(e,t,n){var r=t.pendingProps;switch(Ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zc(t),null;case 1:return zc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ji(oa),pe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Bi(t)?Pc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Hi())),zc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Pc(t),o===null?(zc(t),Fc(t,a,null,r,n)):(zc(t),Ic(t,o))):o?o===e.memoizedState?(zc(t),t.flags&=-16777217):(Pc(t),zc(t),Ic(t,o)):(e=e.memoizedProps,e!==r&&Pc(t),zc(t),Fc(t,a,e,r,n)),null;case 27:if(he(t),n=ue.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return zc(t),null}e=ce.current,Bi(t)?Ri(t,e):(e=vf(a,r,n),t.stateNode=e,Pc(t))}return zc(t),null;case 5:if(he(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return zc(t),null}if(o=ce.current,Bi(t))Ri(t,o);else{var s=Kd(ue.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ut]=t,o[dt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Bd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Pc(t)}}return zc(t),Fc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ue.current,Bi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Mi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ut]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ld(e.nodeValue,n)),e||Li(t,!0)}else e=Kd(e).createTextNode(r),e[ut]=t,t.stateNode=e}return zc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Bi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ut]=t}else Vi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zc(t),e=!1}else n=Hi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(co(t),t):(co(t),null);if(t.flags&128)throw Error(i(558))}return zc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Bi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ut]=t}else Vi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zc(t),a=!1}else a=Hi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(co(t),t):(co(t),null)}return co(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Lc(t,t.updateQueue),zc(t),null);case 4:return pe(),e===null&&Dd(t.stateNode.containerInfo),zc(t),null;case 10:return Ji(t.type),zc(t),null;case 19:if(se(lo),r=t.memoizedState,r===null)return zc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Rc(r,!1);else{if(Yl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=uo(e),o!==null){for(t.flags|=128,Rc(r,!1),e=o.updateQueue,t.updateQueue=e,Lc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ui(n,e),n=n.sibling;return M(lo,lo.current&1|2),B&&Di(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>ou&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304)}else{if(!a)if(e=uo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Lc(t,e),Rc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!B)return zc(t),null}else 2*De()-r.renderingStartTime>ou&&n!==536870912&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(zc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=lo.current,M(lo,a?n&1|2:n&1),B&&Di(t,r.treeForkCount),e);case 22:case 23:return co(t),to(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(zc(t),t.subtreeFlags&6&&(t.flags|=8192)):zc(t),n=t.updateQueue,n!==null&&Lc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&se(_a),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ji(oa),zc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Vc(e,t){switch(Ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ji(oa),pe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return he(t),null;case 31:if(t.memoizedState!==null){if(co(t),t.alternate===null)throw Error(i(340));Vi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(co(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Vi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return se(lo),null;case 4:return pe(),null;case 10:return Ji(t.type),null;case 22:case 23:return co(t),to(),e!==null&&se(_a),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ji(oa),null;case 25:return null;default:return null}}function Hc(e,t){switch(Ai(t),t.tag){case 3:Ji(oa),pe();break;case 26:case 27:case 5:he(t);break;case 4:pe();break;case 31:t.memoizedState!==null&&co(t);break;case 13:co(t);break;case 19:se(lo);break;case 10:Ji(t.type);break;case 22:case 23:co(t),to(),e!==null&&se(_a);break;case 24:Ji(oa)}}function Uc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Yu(t,t.return,e)}}function Wc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Yu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Yu(t,t.return,e)}}function Gc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xa(t,n)}catch(t){Yu(e,e.return,t)}}}function Kc(e,t,n){n.props=qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Yu(e,t,n)}}function qc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Yu(e,t,n)}}function Jc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Yu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Yu(e,t,n)}else n.current=null}function Yc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Yu(e,e.return,t)}}function Xc(e,t,n){try{var r=e.stateNode;Vd(r,e.type,n,t),r[dt]=t}catch(t){Yu(e,e.return,t)}}function Zc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&rf(e.type)||e.tag===4}function Qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Zc(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&&rf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $c(e,t,n){var r=e.tag;if(r===5||r===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=tn));else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Bd(t,r,n),t[ut]=e,t[dt]=n}catch(t){Yu(e,e.return,t)}}var nl=!1,rl=!1,il=!1,al=typeof WeakSet==`function`?WeakSet:Set,ol=null;function sl(e,t){if(e=e.containerInfo,Wd=dp,e=Dr(e),Or(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Gd={focusedElem:e,selectionRange:n},dp=!1,ol=t;ol!==null;)if(t=ol,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ol=e;else for(;ol!==null;){switch(t=ol,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,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&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=qs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Yu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)sf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:sf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,ol=e;break}ol=t.return}}function cl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Sl(e,n),r&4&&Uc(5,n);break;case 1:if(Sl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Yu(n,n.return,e)}else{var i=qs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Yu(n,n.return,e)}}r&64&&Gc(n),r&512&&qc(n,n.return);break;case 3:if(Sl(e,n),r&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{Xa(e,t)}catch(e){Yu(n,n.return,e)}}break;case 27:t===null&&r&4&&tl(n);case 26:case 5:Sl(e,n),t===null&&r&4&&Yc(n),r&512&&qc(n,n.return);break;case 12:Sl(e,n);break;case 31:Sl(e,n),r&4&&pl(e,n);break;case 13:Sl(e,n),r&4&&ml(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=$u.bind(null,n),pf(e,n))));break;case 22:if(r=n.memoizedState!==null||nl,!r){t=t!==null&&t.memoizedState!==null||rl,i=nl;var a=rl;nl=r,(rl=t)&&!a?wl(e,n,(n.subtreeFlags&8772)!=0):Sl(e,n),nl=i,rl=a}break;case 30:break;default:Sl(e,n)}}function U(e){var t=e.alternate;t!==null&&(e.alternate=null,U(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&vt(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 ll=null,ul=!1;function dl(e,t,n){for(n=n.child;n!==null;)fl(e,t,n),n=n.sibling}function fl(e,t,n){if(P&&typeof P.onCommitFiberUnmount==`function`)try{P.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:rl||Jc(n,t),dl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:rl||Jc(n,t);var r=ll,i=ul;rf(n.type)&&(ll=n.stateNode,ul=!1),dl(e,t,n),yf(n.stateNode),ll=r,ul=i;break;case 5:rl||Jc(n,t);case 6:if(r=ll,i=ul,ll=null,dl(e,t,n),ll=r,ul=i,ll!==null)if(ul)try{(ll.nodeType===9?ll.body:ll.nodeName===`HTML`?ll.ownerDocument.body:ll).removeChild(n.stateNode)}catch(e){Yu(n,t,e)}else try{ll.removeChild(n.stateNode)}catch(e){Yu(n,t,e)}break;case 18:ll!==null&&(ul?(e=ll,af(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Lp(e)):af(ll,n.stateNode));break;case 4:r=ll,i=ul,ll=n.stateNode.containerInfo,ul=!0,dl(e,t,n),ll=r,ul=i;break;case 0:case 11:case 14:case 15:Wc(2,n,t),rl||Wc(4,n,t),dl(e,t,n);break;case 1:rl||(Jc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Kc(n,t,r)),dl(e,t,n);break;case 21:dl(e,t,n);break;case 22:rl=(r=rl)||n.memoizedState!==null,dl(e,t,n),rl=r;break;default:dl(e,t,n)}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Lp(e)}catch(e){Yu(t,t.return,e)}}}function ml(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Lp(e)}catch(e){Yu(t,t.return,e)}}function hl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new al),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new al),t;default:throw Error(i(435,e.tag))}}function gl(e,t){var n=hl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=ed.bind(null,e,t);t.then(r,r)}})}function _l(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(rf(c.type)){ll=c.stateNode,ul=!1;break a}break;case 5:ll=c.stateNode,ul=!1;break a;case 3:case 4:ll=c.stateNode.containerInfo,ul=!0;break a}c=c.return}if(ll===null)throw Error(i(160));fl(o,s,a),ll=null,ul=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yl(t,e),t=t.sibling}var vl=null;function yl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:_l(t,e),bl(e),r&4&&(Wc(3,e,e.return),Uc(3,e),Wc(5,e,e.return));break;case 1:_l(t,e),bl(e),r&512&&(rl||n===null||Jc(n,n.return)),r&64&&nl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=vl;if(_l(t,e),bl(e),r&512&&(rl||n===null||Jc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[_t]||o[ut]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Bd(o,r,n),o[ut]=e,Ct(o),r=o;break a;case`link`:var s=Gf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Gf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ut]=e,Ct(o),r=o}e.stateNode=r}else Kf(a,e.type,e.stateNode);else e.stateNode=Y(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Xc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Kf(a,e.type,e.stateNode):Y(a,r,e.memoizedProps))}break;case 27:_l(t,e),bl(e),r&512&&(rl||n===null||Jc(n,n.return)),n!==null&&r&4&&Xc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(_l(t,e),bl(e),r&512&&(rl||n===null||Jc(n,n.return)),e.flags&32){a=e.stateNode;try{F(a,``)}catch(t){Yu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Xc(e,a,n===null?a:n.memoizedProps)),r&1024&&(il=!0);break;case 6:if(_l(t,e),bl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Yu(e,e.return,t)}}break;case 3:if(Wf=null,a=vl,vl=Sf(t.containerInfo),_l(t,e),vl=a,bl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Lp(t.containerInfo)}catch(t){Yu(e,e.return,t)}il&&(il=!1,xl(e));break;case 4:r=vl,vl=Sf(e.stateNode.containerInfo),_l(t,e),bl(e),vl=r;break;case 12:_l(t,e),bl(e);break;case 31:_l(t,e),bl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 13:_l(t,e),bl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(iu=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=nl,d=rl;if(nl=u||a,rl=d||l,_l(t,e),rl=d,nl=u,bl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||nl||rl||Cl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Yu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Yu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?of(m,!0):of(l.stateNode,!1)}catch(e){Yu(l,l.return,e)}}}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 a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,gl(e,n))));break;case 19:_l(t,e),bl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 30:break;case 21:break;default:_l(t,e),bl(e)}}function bl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Zc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;el(e,Qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(F(o,``),n.flags&=-33),el(e,Qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;$c(e,Qc(e),s);break;default:throw Error(i(161))}}catch(t){Yu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;xl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Sl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)cl(e,t.alternate,t),t=t.sibling}function Cl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Wc(4,t,t.return),Cl(t);break;case 1:Jc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Kc(t,t.return,n),Cl(t);break;case 27:yf(t.stateNode);case 26:case 5:Jc(t,t.return),Cl(t);break;case 22:t.memoizedState===null&&Cl(t);break;case 30:Cl(t);break;default:Cl(t)}e=e.sibling}}function wl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:wl(i,a,n),Uc(4,a);break;case 1:if(wl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Yu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ya(c[i],s)}catch(e){Yu(r,r.return,e)}}n&&o&64&&Gc(a),qc(a,a.return);break;case 27:tl(a);case 26:case 5:wl(i,a,n),n&&r===null&&o&4&&Yc(a),qc(a,a.return);break;case 12:wl(i,a,n);break;case 31:wl(i,a,n),n&&o&4&&pl(i,a);break;case 13:wl(i,a,n),n&&o&4&&ml(i,a);break;case 22:a.memoizedState===null&&wl(i,a,n),qc(a,a.return);break;case 30:break;default:wl(i,a,n)}t=t.sibling}}function Tl(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&&ca(n))}function El(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ca(e))}function Dl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ol(e,t,n,r),t=t.sibling}function Ol(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Dl(e,t,n,r),i&2048&&Uc(9,t);break;case 1:Dl(e,t,n,r);break;case 3:Dl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ca(e)));break;case 12:if(i&2048){Dl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Yu(t,t.return,e)}}else Dl(e,t,n,r);break;case 31:Dl(e,t,n,r);break;case 13:Dl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Dl(e,t,n,r):(a._visibility|=2,kl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Dl(e,t,n,r):Al(e,t),i&2048&&Tl(o,t);break;case 24:Dl(e,t,n,r),i&2048&&El(t.alternate,t);break;default:Dl(e,t,n,r)}}function kl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:kl(a,o,s,c,i),Uc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,kl(a,o,s,c,i)):u._visibility&2?kl(a,o,s,c,i):Al(a,o),i&&l&2048&&Tl(o.alternate,o);break;case 24:kl(a,o,s,c,i),i&&l&2048&&El(o.alternate,o);break;default:kl(a,o,s,c,i)}t=t.sibling}}function Al(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Al(n,r),i&2048&&Tl(r.alternate,r);break;case 24:Al(n,r),i&2048&&El(r.alternate,r);break;default:Al(n,r)}t=t.sibling}}var jl=8192;function Ml(e,t,n){if(e.subtreeFlags&jl)for(e=e.child;e!==null;)Nl(e,t,n),e=e.sibling}function Nl(e,t,n){switch(e.tag){case 26:Ml(e,t,n),e.flags&jl&&e.memoizedState!==null&&Yf(n,vl,e.memoizedState,e.memoizedProps);break;case 5:Ml(e,t,n);break;case 3:case 4:var r=vl;vl=Sf(e.stateNode.containerInfo),Ml(e,t,n),vl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=jl,jl=16777216,Ml(e,t,n),jl=r):Ml(e,t,n));break;default:Ml(e,t,n)}}function Pl(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 Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ol=r,Rl(r,e)}Pl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Il(e),e=e.sibling}function Il(e){switch(e.tag){case 0:case 11:case 15:Fl(e),e.flags&2048&&Wc(9,e,e.return);break;case 3:Fl(e);break;case 12:Fl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ll(e)):Fl(e);break;default:Fl(e)}}function Ll(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ol=r,Rl(r,e)}Pl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Wc(8,t,t.return),Ll(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ll(t));break;default:Ll(t)}e=e.sibling}}function Rl(e,t){for(;ol!==null;){var n=ol;switch(n.tag){case 0:case 11:case 15:Wc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ca(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ol=r;else a:for(n=e;ol!==null;){r=ol;var i=r.sibling,a=r.return;if(U(r),r===n){ol=null;break a}if(i!==null){i.return=a,ol=i;break a}ol=a}}}var zl={getCacheForType:function(e){var t=ea(oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ea(oa).controller.signal}},Bl=typeof WeakMap==`function`?WeakMap:Map,Vl=0,Hl=null,W=null,G=0,Ul=0,Wl=null,Gl=!1,Kl=!1,ql=!1,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=0,eu=0,tu=null,nu=null,ru=!1,iu=0,au=0,ou=1/0,su=null,K=null,cu=0,lu=null,uu=null,du=0,fu=0,pu=null,mu=null,hu=0,gu=null;function _u(){return Vl&2&&G!==0?G&-G:A.T===null?st():gd()}function vu(){if($l===0)if(!(G&536870912)||B){var e=Ke;Ke<<=1,!(Ke&3932160)&&(Ke=262144),$l=e}else $l=536870912;return e=no.current,e!==null&&(e.flags|=32),$l}function yu(e,t,n){(e===Hl&&(Ul===2||Ul===9)||e.cancelPendingCommit!==null)&&(Eu(e,0),Cu(e,G,$l,!1)),et(e,n),(!(Vl&2)||e!==Hl)&&(e===Hl&&(!(Vl&2)&&(Zl|=n),Yl===4&&Cu(e,G,$l,!1)),cd(e))}function bu(e,t,n){if(Vl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Xe(e,t),a=r?Pu(e,t):Mu(e,t,!0),o=r;do{if(a===0){Kl&&!r&&Cu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Su(n)){a=Mu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=tu;var l=c.current.memoizedState.isDehydrated;if(l&&(Eu(c,s).flags|=256),s=Mu(c,s,!1),s!==2){if(ql&&!l){c.errorRecoveryDisabledLanes|=o,Zl|=o,a=4;break a}o=nu,nu=a,o!==null&&(nu===null?nu=o:nu.push.apply(nu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Eu(e,0),Cu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Cu(r,t,$l,!Gl);break a;case 2:nu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=iu+300-De(),10<a)){if(Cu(r,t,$l,!Gl),Ye(r,0,!0)!==0)break a;du=t,r.timeoutHandle=Qd(xu.bind(null,r,n,nu,su,ru,t,$l,Zl,eu,Gl,o,`Throttled`,-0,0),a);break a}xu(r,n,nu,su,ru,t,$l,Zl,eu,Gl,o,null,-0,0)}}break}while(1);cd(e)}function xu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tn},Nl(t,a,d);var m=(a&62914560)===a?iu-De():(a&4194048)===a?au-De():0;if(m=Zf(d,m),m!==null){du=a,e.cancelPendingCommit=m(Vu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Cu(e,a,o,!l);return}}Vu(e,t,a,n,r,i,o,s,c)}function Su(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 r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Sr(a(),i))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 Cu(e,t,n,r){t&=~Ql,t&=~Zl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Re(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&nt(e,n,t)}function wu(){return Vl&6?!0:(ld(0,!1),!1)}function Tu(){if(W!==null){if(Ul===0)var e=W.return;else e=W,Ki=Gi=null,ko(e),ja=null,Ma=0,e=W;for(;e!==null;)Hc(e.alternate,e),e=e.return;W=null}}function Eu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,$d(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),du=0,Tu(),Hl=e,W=n=li(e.current,null),G=t,Ul=0,Wl=null,Gl=!1,Kl=Xe(e,t),ql=!1,eu=$l=Ql=Zl=Xl=Yl=0,nu=tu=null,ru=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Re(r),a=1<<i;t|=e[i],r&=~a}return Jl=t,$r(),n}function Du(e,t){V=null,A.H=zs,t===xa||t===Ca?(t=ka(),Ul=3):t===Sa?(t=ka(),Ul=4):Ul=t===rc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Wl=t,W===null&&(Yl=1,Zs(e,_i(t,e.current)))}function Ou(){var e=no.current;return e===null?!0:(G&4194048)===G?ro===null:(G&62914560)===G||G&536870912?e===ro:!1}function ku(){var e=A.H;return A.H=zs,e===null?zs:e}function Au(){var e=A.A;return A.A=zl,e}function ju(){Yl=4,Gl||(G&4194048)!==G&&no.current!==null||(Kl=!0),!(Xl&134217727)&&!(Zl&134217727)||Hl===null||Cu(Hl,G,$l,!1)}function Mu(e,t,n){var r=Vl;Vl|=2;var i=ku(),a=Au();(Hl!==e||G!==t)&&(su=null,Eu(e,t)),t=!1;var o=Yl;a:do try{if(Ul!==0&&W!==null){var s=W,c=Wl;switch(Ul){case 8:Tu(),o=6;break a;case 3:case 2:case 9:case 6:no.current===null&&(t=!0);var l=Ul;if(Ul=0,Wl=null,Ru(e,s,c,l),n&&Kl){o=0;break a}break;default:l=Ul,Ul=0,Wl=null,Ru(e,s,c,l)}}Nu(),o=Yl;break}catch(t){Du(e,t)}while(1);return t&&e.shellSuspendCounter++,Ki=Gi=null,Vl=r,A.H=i,A.A=a,W===null&&(Hl=null,G=0,$r()),o}function Nu(){for(;W!==null;)Iu(W)}function Pu(e,t){var n=Vl;Vl|=2;var r=ku(),a=Au();Hl!==e||G!==t?(su=null,ou=De()+500,Eu(e,t)):Kl=Xe(e,t);a:do try{if(Ul!==0&&W!==null){t=W;var o=Wl;b:switch(Ul){case 1:Ul=0,Wl=null,Ru(e,t,o,1);break;case 2:case 9:if(Ta(o)){Ul=0,Wl=null,Lu(t);break}t=function(){Ul!==2&&Ul!==9||Hl!==e||(Ul=7),cd(e)},o.then(t,t);break a;case 3:Ul=7;break a;case 4:Ul=5;break a;case 7:Ta(o)?(Ul=0,Wl=null,Lu(t)):(Ul=0,Wl=null,Ru(e,t,o,7));break;case 5:var s=null;switch(W.tag){case 26:s=W.memoizedState;case 5:case 27:var c=W;if(s?Jf(s):c.stateNode.complete){Ul=0,Wl=null;var l=c.sibling;if(l!==null)W=l;else{var u=c.return;u===null?W=null:(W=u,zu(u))}break b}}Ul=0,Wl=null,Ru(e,t,o,5);break;case 6:Ul=0,Wl=null,Ru(e,t,o,6);break;case 8:Tu(),Yl=6;break a;default:throw Error(i(462))}}Fu();break}catch(t){Du(e,t)}while(1);return Ki=Gi=null,A.H=r,A.A=a,Vl=n,W===null?(Hl=null,G=0,$r(),Yl):0}function Fu(){for(;W!==null&&!N();)Iu(W)}function Iu(e){var t=Nc(e.alternate,e,Jl);e.memoizedProps=e.pendingProps,t===null?zu(e):W=t}function Lu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=_c(n,t,t.pendingProps,t.type,void 0,G);break;case 11:t=_c(n,t,t.pendingProps,t.type.render,t.ref,G);break;case 5:ko(t);default:Hc(n,t),t=W=ui(t,Jl),t=Nc(n,t,Jl)}e.memoizedProps=e.pendingProps,t===null?zu(e):W=t}function Ru(e,t,n,r){Ki=Gi=null,ko(t),ja=null,Ma=0;var i=t.return;try{if(nc(e,i,t,n,G)){Yl=1,Zs(e,_i(n,e.current)),W=null;return}}catch(t){if(i!==null)throw W=i,t;Yl=1,Zs(e,_i(n,e.current)),W=null;return}t.flags&32768?(B||r===1?e=!0:Kl||G&536870912?e=!1:(Gl=e=!0,(r===2||r===9||r===3||r===6)&&(r=no.current,r!==null&&r.tag===13&&(r.flags|=16384))),Bu(t,e)):zu(t)}function zu(e){var t=e;do{if(t.flags&32768){Bu(t,Gl);return}e=t.return;var n=Bc(t.alternate,t,Jl);if(n!==null){W=n;return}if(t=t.sibling,t!==null){W=t;return}W=t=e}while(t!==null);Yl===0&&(Yl=5)}function Bu(e,t){do{var n=Vc(e.alternate,e);if(n!==null){n.flags&=32767,W=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){W=e;return}W=e=n}while(e!==null);Yl=6,W=null}function Vu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Ku();while(cu!==0);if(Vl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Qr,tt(e,n,o,s,c,l),e===Hl&&(W=Hl=null,G=0),uu=t,lu=e,du=n,fu=o,pu=a,mu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,td(je,function(){return qu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=A.T,A.T=null,a=j.p,j.p=2,s=Vl,Vl|=4;try{sl(e,t,n)}finally{Vl=s,j.p=a,A.T=r}}cu=1,Hu(),Uu(),Wu()}}function Hu(){if(cu===1){cu=0;var e=lu,t=uu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=A.T,A.T=null;var r=j.p;j.p=2;var i=Vl;Vl|=4;try{yl(t,e);var a=Gd,o=Dr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Er(s.ownerDocument.documentElement,s)){if(c!==null&&Or(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Tr(s,h),v=Tr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}dp=!!Wd,Gd=Wd=null}finally{Vl=i,j.p=r,A.T=n}}e.current=t,cu=2}}function Uu(){if(cu===2){cu=0;var e=lu,t=uu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=A.T,A.T=null;var r=j.p;j.p=2;var i=Vl;Vl|=4;try{cl(e,t.alternate,t)}finally{Vl=i,j.p=r,A.T=n}}cu=3}}function Wu(){if(cu===4||cu===3){cu=0,Ee();var e=lu,t=uu,n=du,r=mu;t.subtreeFlags&10256||t.flags&10256?cu=5:(cu=0,uu=lu=null,Gu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(K=null),ot(n),t=t.stateNode,P&&typeof P.onCommitFiberRoot==`function`)try{P.onCommitFiberRoot(Ie,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=A.T,i=j.p,j.p=2,A.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{A.T=t,j.p=i}}du&3&&Ku(),cd(e),i=e.pendingLanes,n&261930&&i&42?e===gu?hu++:(hu=0,gu=e):hu=0,ld(0,!1)}}function Gu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ca(t)))}function Ku(){return Hu(),Uu(),Wu(),qu()}function qu(){if(cu!==5)return!1;var e=lu,t=fu;fu=0;var n=ot(du),r=A.T,a=j.p;try{j.p=32>n?32:n,A.T=null,n=pu,pu=null;var o=lu,s=du;if(cu=0,uu=lu=null,du=0,Vl&6)throw Error(i(331));var c=Vl;if(Vl|=4,Il(o.current),Ol(o,o.current,s,n),Vl=c,ld(0,!1),P&&typeof P.onPostCommitFiberRoot==`function`)try{P.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{j.p=a,A.T=r,Gu(e,t)}}function Ju(e,t,n){t=_i(n,t),t=$s(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(et(e,2),cd(e))}function Yu(e,t,n){if(e.tag===3)Ju(e,e,n);else for(;t!==null;){if(t.tag===3){Ju(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(K===null||!K.has(r))){e=_i(n,e),n=ec(2),r=Ua(t,n,2),r!==null&&(tc(n,r,t,e),et(r,2),cd(r));break}}t=t.return}}function Xu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Bl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ql=!0,i.add(n),e=Zu.bind(null,e,t,n),t.then(e,e))}function Zu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Hl===e&&(G&n)===n&&(Yl===4||Yl===3&&(G&62914560)===G&&300>De()-iu?!(Vl&2)&&Eu(e,0):Ql|=n,eu===G&&(eu=0)),cd(e)}function Qu(e,t){t===0&&(t=Qe()),e=ni(e,t),e!==null&&(et(e,t),cd(e))}function $u(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Qu(e,n)}function ed(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Qu(e,n)}function td(e,t){return we(e,t)}var nd=null,rd=null,id=!1,ad=!1,od=!1,sd=0;function cd(e){e!==rd&&e.next===null&&(rd===null?nd=rd=e:rd=rd.next=e),ad=!0,id||(id=!0,hd())}function ld(e,t){if(!od&&ad){od=!0;do for(var n=!1,r=nd;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Re(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,md(r,a))}else a=G,a=Ye(r,r===Hl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Xe(r,a)||(n=!0,md(r,a));r=r.next}while(n);od=!1}}function ud(){dd()}function dd(){ad=id=!1;var e=0;sd!==0&&Zd()&&(e=sd);for(var t=De(),n=null,r=nd;r!==null;){var i=r.next,a=fd(r,t);a===0?(r.next=null,n===null?nd=i:n.next=i,i===null&&(rd=n)):(n=r,(e!==0||a&3)&&(ad=!0)),r=i}cu!==0&&cu!==5||ld(e,!1),sd!==0&&(sd=0)}function fd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Re(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ze(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Hl,n=G,n=Ye(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ul===2||Ul===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Te(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Xe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Te(r),ot(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=Ne;break;default:n=je}return r=pd.bind(null,e),n=we(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Te(r),e.callbackPriority=2,e.callbackNode=null,2}function pd(e,t){if(cu!==0&&cu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ku()&&e.callbackNode!==n)return null;var r=G;return r=Ye(e,e===Hl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(bu(e,r,t),fd(e,De()),e.callbackNode!=null&&e.callbackNode===n?pd.bind(null,e):null)}function md(e,t){if(Ku())return null;bu(e,t,!0)}function hd(){tf(function(){Vl&6?we(ke,ud):dd()})}function gd(){if(sd===0){var e=da;e===0&&(e=We,We<<=1,!(We&261888)&&(We=256)),sd=e}return sd}function _d(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:en(``+e)}function vd(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 yd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=_d((i[dt]||null).action),o=r.submitter;o&&(t=(t=o[dt]||null)?_d(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Sn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(sd!==0){var e=o?vd(i,o):new FormData(i);Ts(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?vd(i,o):new FormData(i),Ts(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var bd=0;bd<qr.length;bd++){var xd=qr[bd];Jr(xd.toLowerCase(),`on`+(xd[0].toUpperCase()+xd.slice(1)))}Jr(zr,`onAnimationEnd`),Jr(Br,`onAnimationIteration`),Jr(Vr,`onAnimationStart`),Jr(`dblclick`,`onDoubleClick`),Jr(`focusin`,`onFocus`),Jr(`focusout`,`onBlur`),Jr(Hr,`onTransitionRun`),Jr(Ur,`onTransitionStart`),Jr(Wr,`onTransitionCancel`),Jr(Gr,`onTransitionEnd`),Dt(`onMouseEnter`,[`mouseout`,`mouseover`]),Dt(`onMouseLeave`,[`mouseout`,`mouseover`]),Dt(`onPointerEnter`,[`pointerout`,`pointerover`]),Dt(`onPointerLeave`,[`pointerout`,`pointerover`]),Et(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Et(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Et(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Et(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Et(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Et(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Sd=`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(` `),Cd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Sd));function wd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}}}}function q(e,t){var n=t[pt];n===void 0&&(n=t[pt]=new Set);var r=e+`__bubble`;n.has(r)||(Od(t,e,2,!1),n.add(r))}function Td(e,t,n){var r=0;t&&(r|=4),Od(n,e,r,t)}var Ed=`_reactListening`+Math.random().toString(36).slice(2);function Dd(e){if(!e[Ed]){e[Ed]=!0,wt.forEach(function(t){t!==`selectionchange`&&(Cd.has(t)||Td(t,!1,e),Td(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ed]||(t[Ed]=!0,Td(`selectionchange`,!1,t))}}function Od(e,t,n,r){switch(vp(t)){case 2:var i=fp;break;case 8:i=pp;break;default:i=mp}n=i.bind(null,t,n,e),i=void 0,!fn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function kd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=yt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}ln(function(){var r=a,i=rn(n),s=[];a:{var c=Kr.get(e);if(c!==void 0){var l=Sn,u=e;switch(e){case`keypress`:if(_n(n)===0)break a;case`keydown`:case`keyup`:l=Bn;break;case`focusin`:u=`focus`,l=jn;break;case`focusout`:u=`blur`,l=jn;break;case`beforeblur`:case`afterblur`:l=jn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=An;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Hn;break;case zr:case Br:case Vr:l=Mn;break;case Gr:l=Un;break;case`scroll`:case`scrollend`:l=wn;break;case`wheel`:l=Wn;break;case`copy`:case`cut`:case`paste`:l=Nn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Vn;break;case`toggle`:case`beforetoggle`:l=Gn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=un(m,p),g!=null&&d.push(Ad(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==nn&&(u=n.relatedTarget||n.fromElement)&&(yt(u)||u[ft]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?yt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Vn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:xt(l),h=u==null?c:xt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,yt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Md,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Nd(s,c,l,d,!1),u!==null&&f!==null&&Nd(s,f,u,d,!0)}}a:{if(c=r?xt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=dr;else if(ar(c))if(fr)v=xr;else{v=yr;var y=vr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Zt(r.elementType)&&(v=dr):v=br;if(v&&=v(e,r)){or(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Gt(c,`number`,c.value)}switch(y=r?xt(r):window,e){case`focusin`:(ar(y)||y.contentEditable===`true`)&&(Ar=y,jr=r,Mr=null);break;case`focusout`:Mr=jr=Ar=null;break;case`mousedown`:Nr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Nr=!1,z(s,n,i);break;case`selectionchange`:if(kr)break;case`keydown`:case`keyup`:z(s,n,i)}var b;if(qn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else tr?$n(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Xn&&n.locale!==`ko`&&(tr||x!==`onCompositionStart`?x===`onCompositionEnd`&&tr&&(b=gn()):(L=i,mn=`value`in L?L.value:L.textContent,tr=!0)),y=jd(r,x),0<y.length&&(x=new Pn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=er(n),b!==null&&(x.data=b)))),(b=Yn?nr(e,n):rr(e,n))&&(x=jd(r,`onBeforeInput`),0<x.length&&(y=new Pn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),yd(s,e,r,n,i)}wd(s,t)})}function Ad(e,t,n){return{instance:e,listener:t,currentTarget:n}}function jd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=un(e,n),i!=null&&r.unshift(Ad(e,i,a)),i=un(e,t),i!=null&&r.push(Ad(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Md(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Nd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=un(n,a),l!=null&&o.unshift(Ad(n,l,c))):i||(l=un(n,a),l!=null&&o.push(Ad(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Pd=/\r\n?/g,Fd=/\u0000|\uFFFD/g;function Id(e){return(typeof e==`string`?e:``+e).replace(Pd,`
|
|
10
|
-
`).replace(Fd,``)}function Ld(e,t){return t=Id(t),Id(e)===t}function Rd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||F(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&F(e,``+r);break;case`className`:Nt(e,`class`,r);break;case`tabIndex`:Nt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Nt(e,n,r);break;case`style`:Xt(e,r,o);break;case`data`:if(t!==`object`){Nt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`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 o==`function`&&(n===`formAction`?(t!==`input`&&Rd(e,t,`name`,a.name,a,null),Rd(e,t,`formEncType`,a.formEncType,a,null),Rd(e,t,`formMethod`,a.formMethod,a,null),Rd(e,t,`formTarget`,a.formTarget,a,null)):(Rd(e,t,`encType`,a.encType,a,null),Rd(e,t,`method`,a.method,a,null),Rd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`onScroll`:r!=null&&q(`scroll`,e);break;case`onScrollEnd`:r!=null&&q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=en(``+r),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`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:q(`beforetoggle`,e),q(`toggle`,e),Mt(e,`popover`,r);break;case`xlinkActuate`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Mt(e,`is`,r);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,Mt(e,n,r))}}function zd(e,t,n,r,a,o){switch(n){case`style`:Xt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?F(e,r):(typeof r==`number`||typeof r==`bigint`)&&F(e,``+r);break;case`onScroll`:r!=null&&q(`scroll`,e);break;case`onScrollEnd`:r!=null&&q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Tt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[dt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Mt(e,n,r)}}}function Bd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:q(`error`,e),q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Rd(e,t,o,s,n,null)}}a&&Rd(e,t,`srcSet`,n.srcSet,n,null),r&&Rd(e,t,`src`,n.src,n,null);return;case`input`:q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Rd(e,t,r,d,n,null)}}Wt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Rd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Kt(e,!!r,n,!0):Kt(e,!!r,t,!1);return;case`textarea`:for(s in q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Rd(e,t,s,c,n,null)}Jt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Rd(e,t,l,r,n,null)}return;case`dialog`:q(`beforetoggle`,e),q(`toggle`,e),q(`cancel`,e),q(`close`,e);break;case`iframe`:case`object`:q(`load`,e);break;case`video`:case`audio`:for(r=0;r<Sd.length;r++)q(Sd[r],e);break;case`image`:q(`error`,e),q(`load`,e);break;case`details`:q(`toggle`,e);break;case`embed`:case`source`:case`link`:q(`error`,e),q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Rd(e,t,u,r,n,null)}return;default:if(Zt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&zd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Rd(e,t,c,r,n,null))}function Vd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Rd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Rd(e,t,p,m,r,f)}}Ut(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Rd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Rd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Kt(e,!!n,n?[]:``,!1):Kt(e,!!n,t,!0)):Kt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Rd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Rd(e,t,s,a,r,o)}qt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Rd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Rd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Rd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Rd(e,t,u,p,r,m)}return;default:if(Zt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&zd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||zd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Rd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Rd(e,t,f,p,r,m)}function Hd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ud(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Hd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Hd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.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 Wd=null,Gd=null;function Kd(e){return e.nodeType===9?e:e.ownerDocument}function qd(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 Jd(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 Yd(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 Xd=null;function Zd(){var e=window.event;return e&&e.type===`popstate`?e===Xd?!1:(Xd=e,!0):(Xd=null,!1)}var Qd=typeof setTimeout==`function`?setTimeout:void 0,$d=typeof clearTimeout==`function`?clearTimeout:void 0,ef=typeof Promise==`function`?Promise:void 0,tf=typeof queueMicrotask==`function`?queueMicrotask:ef===void 0?Qd:function(e){return ef.resolve(null).then(e).catch(nf)};function nf(e){setTimeout(function(){throw e})}function rf(e){return e===`head`}function af(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Lp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)yf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,yf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[_t]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&yf(e.ownerDocument.body);n=i}while(n);Lp(t)}function of(e,t){var n=e;e=0;do{var r=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||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function sf(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`:sf(n),vt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function cf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[_t])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=mf(e.nextSibling),e===null)break}return null}function lf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=mf(e.nextSibling),e===null))return null;return e}function uf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=mf(e.nextSibling),e===null))return null;return e}function df(e){return e.data===`$?`||e.data===`$~`}function ff(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function pf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function mf(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 hf=null;function gf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return mf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function _f(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 vf(e,t,n){switch(t=Kd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function yf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);vt(e)}var bf=new Map,xf=new Set;function Sf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Cf=j.d;j.d={f:wf,r:Tf,D:Of,C:kf,L:Af,m:jf,X:Nf,S:Mf,M:Pf};function wf(){var e=Cf.f(),t=wu();return e||t}function Tf(e){var t=bt(e);t!==null&&t.tag===5&&t.type===`form`?Ds(t):Cf.r(e)}var Ef=typeof document>`u`?null:document;function Df(e,t,n){var r=Ef;if(r&&typeof t==`string`&&t){var i=Ht(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),xf.has(i)||(xf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Bd(t,`link`,e),Ct(t),r.head.appendChild(t)))}}function Of(e){Cf.D(e),Df(`dns-prefetch`,e,null)}function kf(e,t){Cf.C(e,t),Df(`preconnect`,e,t)}function Af(e,t,n){Cf.L(e,t,n);var r=Ef;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ht(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ht(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ht(n.imageSizes)+`"]`)):i+=`[href="`+Ht(e)+`"]`;var a=i;switch(t){case`style`:a=If(e);break;case`script`:a=zf(e)}bf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),bf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lf(a))||t===`script`&&r.querySelector(Bf(a))||(t=r.createElement(`link`),Bd(t,`link`,e),Ct(t),r.head.appendChild(t)))}}function jf(e,t){Cf.m(e,t);var n=Ef;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ht(r)+`"][href="`+Ht(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zf(e)}if(!bf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),bf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bf(a)))return}r=n.createElement(`link`),Bd(r,`link`,e),Ct(r),n.head.appendChild(r)}}}function Mf(e,t,n){Cf.S(e,t,n);var r=Ef;if(r&&e){var i=St(r).hoistableStyles,a=If(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=bf.get(a))&&Hf(e,n);var c=o=r.createElement(`link`);Ct(c),Bd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nf(e,t){Cf.X(e,t);var n=Ef;if(n&&e){var r=St(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=f({src:e,async:!0},t),(t=bf.get(i))&&Uf(e,t),a=n.createElement(`script`),Ct(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t){Cf.M(e,t);var n=Ef;if(n&&e){var r=St(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=bf.get(i))&&Uf(e,t),a=n.createElement(`script`),Ct(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ff(e,t,n,r){var a=(a=ue.current)?Sf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=If(n.href),n=St(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=If(n.href);var o=St(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Lf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),bf.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},bf.set(e,n),o||J(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=zf(n),n=St(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function If(e){return`href="`+Ht(e)+`"`}function Lf(e){return`link[rel="stylesheet"][`+e+`]`}function Rf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function J(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Bd(t,`link`,n),Ct(t),e.head.appendChild(t))}function zf(e){return`[src="`+Ht(e)+`"]`}function Bf(e){return`script[async]`+e}function Y(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ht(n.href)+`"]`);if(r)return t.instance=r,Ct(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ct(r),Bd(r,`style`,a),Vf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=If(n.href);var o=e.querySelector(Lf(a));if(o)return t.state.loading|=4,t.instance=o,Ct(o),o;r=Rf(n),(a=bf.get(a))&&Hf(r,a),o=(e.ownerDocument||e).createElement(`link`),Ct(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Bd(o,`link`,r),t.state.loading|=4,Vf(o,n.precedence,e),t.instance=o;case`script`:return o=zf(n.src),(a=e.querySelector(Bf(o)))?(t.instance=a,Ct(a),a):(r=n,(a=bf.get(o))&&(r=f({},n),Uf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ct(a),Bd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vf(r,n.precedence,e));return t.instance}function Vf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wf=null;function Gf(e,t,n){if(Wf===null){var r=new Map,i=Wf=new Map;i.set(n,r)}else i=Wf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[_t]||a[ut]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Kf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qf(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;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Yf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=If(r.href),a=t.querySelector(Lf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Qf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ct(a);return}a=t.ownerDocument||t,r=Rf(r),(i=bf.get(i))&&Hf(r,i),a=a.createElement(`link`),Ct(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Bd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Qf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Xf=0;function Zf(e,t){return e.stylesheets&&e.count===0&&ep(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ep(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Xf===0&&(Xf=62500*Ud());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ep(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Xf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Qf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ep(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var $f=null;function ep(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$f=new Map,t.forEach(tp,e),$f=null,Qf.call(e))}function tp(e,t){if(!(t.state.loading&4)){var n=$f.get(e);if(n)var r=n.get(null);else{n=new Map,$f.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Qf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var np={$$typeof:b,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function rp(e,t,n,r,i,a,o,s,c){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=$e(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$e(0),this.hiddenUpdates=$e(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ip(e,t,n,r,i,a,o,s,c,l,u,d){return e=new rp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=si(3,null,null,t),e.current=a,a.stateNode=e,t=sa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ba(a),e}function ap(e){return e?(e=ai,e):ai}function op(e,t,n,r,i,a){i=ap(i),r.context===null?r.context=i:r.pendingContext=i,r=Ha(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ua(e,r,t),n!==null&&(yu(n,e,t),Wa(n,e,t))}function sp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function cp(e,t){sp(e,t),(e=e.alternate)&&sp(e,t)}function lp(e){if(e.tag===13||e.tag===31){var t=ni(e,67108864);t!==null&&yu(t,e,67108864),cp(e,67108864)}}function up(e){if(e.tag===13||e.tag===31){var t=_u();t=at(t);var n=ni(e,t);n!==null&&yu(n,e,t),cp(e,t)}}var dp=!0;function fp(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=2,mp(e,t,n,r)}finally{j.p=a,A.T=i}}function pp(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=8,mp(e,t,n,r)}finally{j.p=a,A.T=i}}function mp(e,t,n,r){if(dp){var i=hp(r);if(i===null)kd(e,t,r,gp,n),Dp(e,r);else if(kp(i,e,t,n,r))r.stopPropagation();else if(Dp(e,r),t&4&&-1<Ep.indexOf(e)){for(;i!==null;){var a=bt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Je(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Re(o);s.entanglements[1]|=c,o&=~c}cd(a),!(Vl&6)&&(ou=De()+500,ld(0,!1))}}break;case 31:case 13:s=ni(a,2),s!==null&&yu(s,a,2),wu(),cp(a,2)}if(a=hp(r),a===null&&kd(e,t,r,gp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else kd(e,t,r,null,n)}}function hp(e){return e=rn(e),_p(e)}var gp=null;function _p(e){if(gp=null,e=yt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 gp=e,null}function vp(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(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var yp=!1,bp=null,xp=null,Sp=null,Cp=new Map,wp=new Map,Tp=[],Ep=`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 Dp(e,t){switch(e){case`focusin`:case`focusout`:bp=null;break;case`dragenter`:case`dragleave`:xp=null;break;case`mouseover`:case`mouseout`:Sp=null;break;case`pointerover`:case`pointerout`:Cp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:wp.delete(t.pointerId)}}function Op(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=bt(t),t!==null&&lp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function kp(e,t,n,r,i){switch(t){case`focusin`:return bp=Op(bp,e,t,n,r,i),!0;case`dragenter`:return xp=Op(xp,e,t,n,r,i),!0;case`mouseover`:return Sp=Op(Sp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Cp.set(a,Op(Cp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,wp.set(a,Op(wp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ap(e){var t=yt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ct(e.priority,function(){up(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ct(e.priority,function(){up(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 jp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=hp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nn=r,n.target.dispatchEvent(r),nn=null}else return t=bt(n),t!==null&&lp(t),e.blockedOn=n,!1;t.shift()}return!0}function Mp(e,t,n){jp(e)&&n.delete(t)}function Np(){yp=!1,bp!==null&&jp(bp)&&(bp=null),xp!==null&&jp(xp)&&(xp=null),Sp!==null&&jp(Sp)&&(Sp=null),Cp.forEach(Mp),wp.forEach(Mp)}function Pp(e,n){e.blockedOn===n&&(e.blockedOn=null,yp||(yp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Np)))}var Fp=null;function Ip(e){Fp!==e&&(Fp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Fp===e&&(Fp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(_p(r||n)===null)continue;break}var a=bt(n);a!==null&&(e.splice(t,3),t-=3,Ts(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Lp(e){function t(t){return Pp(t,e)}bp!==null&&Pp(bp,e),xp!==null&&Pp(xp,e),Sp!==null&&Pp(Sp,e),Cp.forEach(t),wp.forEach(t);for(var n=0;n<Tp.length;n++){var r=Tp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Tp.length&&(n=Tp[0],n.blockedOn===null);)Ap(n),n.blockedOn===null&&Tp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[dt]||null;if(typeof a==`function`)o||Ip(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[dt]||null)s=o.formAction;else if(_p(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Ip(n)}}}function Rp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function zp(e){this._internalRoot=e}Bp.prototype.render=zp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;op(n,_u(),e,t,null,null)},Bp.prototype.unmount=zp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;op(e.current,2,null,e,null,null),wu(),t[ft]=null}};function Bp(e){this._internalRoot=e}Bp.prototype.unstable_scheduleHydration=function(e){if(e){var t=st();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Tp.length&&t!==0&&t<Tp[n].priority;n++);Tp.splice(n,0,e),n===0&&Ap(e)}};var Vp=n.version;if(Vp!==`19.2.4`)throw Error(i(527,Vp,`19.2.4`));j.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Hp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:A,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Up=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Up.isDisabled&&Up.supportsFiber)try{Ie=Up.inject(Hp),P=Up}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Js,s=Ys,c=Xs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ip(e,1,!1,null,null,n,r,null,o,s,c,Rp),e[ft]=t.current,Dd(e),new zp(t)}})),qe=P(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ke()})),Je=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ye=new class extends Je{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Xe={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ze=new class{#e=Xe;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Qe(e){setTimeout(e,0)}var $e=typeof window>`u`||`Deno`in globalThis;function et(){}function tt(e,t){return typeof e==`function`?e(t):e}function nt(e){return typeof e==`number`&&e>=0&&e!==1/0}function rt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function it(e,t){return typeof e==`function`?e(t):e}function at(e,t){return typeof e==`function`?e(t):e}function ot(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ct(o,t.options))return!1}else if(!ut(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function st(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(lt(t.options.mutationKey)!==lt(a))return!1}else if(!ut(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ct(e,t){return(t?.queryKeyHashFn||lt)(e)}function lt(e){return JSON.stringify(e,(e,t)=>mt(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ut(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>ut(e[n],t[n])):!1}var dt=Object.prototype.hasOwnProperty;function ft(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=pt(e)&&pt(t);if(!r&&!(mt(e)&&mt(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:dt.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ft(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function pt(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function mt(e){if(!ht(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ht(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ht(e){return Object.prototype.toString.call(e)===`[object Object]`}function gt(e){return new Promise(t=>{Ze.setTimeout(t,e)})}function _t(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ft(e,t)}function vt(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function yt(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var bt=Symbol();function xt(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===bt?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function St(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Ct=(()=>{let e=()=>$e;return{isServer(){return e()},setIsServer(t){e=t}}})();function wt(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Tt=Qe;function Et(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Tt,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Dt=Et(),Ot=new class extends Je{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function kt(e){return Math.min(1e3*2**e,3e4)}function At(e){return(e??`online`)===`online`?Ot.isOnline():!0}var jt=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Mt(e){let t=!1,n=0,r,i=wt(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new jt(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Ye.isFocused()&&(e.networkMode===`always`||Ot.isOnline())&&e.canRun(),u=()=>At(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Ct.isServer()?0:3),o=e.retryDelay??kt,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),gt(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Nt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nt(this.gcTime)&&(this.#e=Ze.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ct.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(Ze.clearTimeout(this.#e),void 0)}},Pt=class extends Nt{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Lt(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Lt(this.options);e.data!==void 0&&(this.setState(It(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=_t(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(et).catch(et):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>at(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===bt||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>it(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!rt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=xt(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=Mt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof jt&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof jt){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ft(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...It(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),Dt.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function Ft(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:At(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function It(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Lt(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}function Rt(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{St(e,()=>t.signal,()=>n=!0)},u=xt(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?yt:vt;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Bt:zt,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:zt(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function zt(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Bt(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Vt=class extends Nt{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ht(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Mt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),Dt.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ht(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ut=class extends Je{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Vt({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Wt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Wt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Wt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Wt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Dt.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>st(t,e))}findAll(e={}){return this.getAll().filter(t=>st(e,t))}notify(e){Dt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Dt.batch(()=>Promise.all(e.map(e=>e.continue().catch(et))))}};function Wt(e){return e.options.scope?.id}var Gt=class extends Je{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ct(r,t),a=this.get(i);return a||(a=new Pt({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Dt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ot(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ot(e,t)):t}notify(e){Dt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Dt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Dt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Kt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Gt,this.#t=e.mutationCache||new Ut,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Ye.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Ot.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(it(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=tt(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Dt.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Dt.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Dt.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Dt.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(et).catch(et)}invalidateQueries(e,t={}){return Dt.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Dt.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(et)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(et)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(it(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(et).catch(et)}fetchInfiniteQuery(e){return e.behavior=Rt(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(et).catch(et)}ensureInfiniteQueryData(e){return e.behavior=Rt(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ot.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(lt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ut(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(lt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ut(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ct(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===bt&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},qt=P((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Jt=P(((e,t)=>{t.exports=qt()})),F=ze(Ue(),1),I=Jt(),Yt=F.createContext(void 0),Xt=({client:e,children:t})=>(F.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,I.jsx)(Yt.Provider,{value:e,children:t}));F.use;var Zt=typeof window<`u`?F.useLayoutEffect:F.useEffect;function Qt(e){let t=F.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function $t(e,t,n={},r={}){F.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function en(e){let t=F.useRef(null);return F.useImperativeHandle(e,()=>t.current,[]),t}function tn(e){return e[e.length-1]}function nn(e){return typeof e==`function`}function rn(e,t){return nn(e)?e(t):e}var an=Object.prototype.hasOwnProperty,on=Object.prototype.propertyIsEnumerable,sn=()=>Object.create(null),cn=(e,t)=>ln(e,t,sn);function ln(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=pn(e)&&pn(i);if(!a&&!(dn(e)&&dn(i)))return i;let o=a?e:un(e);if(!o)return i;let s=a?i:un(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:an.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=ln(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function un(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!on.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!on.call(e,t))return!1;r.push(t)}return r}function dn(e){if(!fn(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!fn(n)||!n.hasOwnProperty(`isPrototypeOf`))}function fn(e){return Object.prototype.toString.call(e)===`[object Object]`}function pn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function L(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!L(e[r],t[r],n))return!1;return!0}if(dn(e)&&dn(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!L(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!L(e[o],t[o],n)))return!1;return i===a}return!1}function mn(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function hn(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function gn(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function _n(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return gn(t)}var vn=[`http:`,`https:`,`mailto:`,`tel:`];function yn(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}var bn={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},xn=/[&><\u2028\u2029]/g;function Sn(e){return e.replace(xn,e=>bn[e])}function Cn(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=_n(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=_n(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function wn(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Tn(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var En=!0,Dn=`Invariant failed`;function On(e,t){if(!e){if(En)throw Error(Dn);var n=typeof t==`function`?t():t,r=n?`${Dn}: ${n}`:Dn;throw Error(r)}}var kn=4,An=5;function jn(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function Mn(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=jn(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Nn(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;s<o;){let e=Mn(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=In(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=In(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Ln(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Ln(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=Ln(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=In(n.fullPath??n.from);e.kind=An,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=In(n.fullPath??n.from);e.kind=kn,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=n.options?.params?.parse??null,i.skipOnParamError=l,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)Nn(e,t,r,s,i,a,o)}function Pn(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Fn(e){if(e.pathless)for(let t of e.pathless)Fn(t);if(e.static)for(let t of e.static.values())Fn(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())Fn(t);if(e.dynamic?.length){e.dynamic.sort(Pn);for(let t of e.dynamic)Fn(t)}if(e.optional?.length){e.optional.sort(Pn);for(let t of e.optional)Fn(t)}if(e.wildcard?.length){e.wildcard.sort(Pn);for(let t of e.wildcard)Fn(t)}}function In(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Ln(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function Rn(e,t){let n=In(`/`),r=new Uint16Array(6);for(let t of e)Nn(!1,r,t,1,n,0);Fn(n),t.masksTree=n,t.flatCache=Tn(1e3)}function zn(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Wn(e,t.masksTree);return t.flatCache.set(e,r),r}function Bn(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=In(`/`),Nn(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Wn(r,o,n)}function Vn(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Wn(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Kn(a.route)),t.matchCache.set(r,a),a}function Hn(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Un(e,t=!1,n){let r=In(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return Nn(t,i,e,1,r,0,e=>{if(n?.(e,s),On(!(e.id in a),`Duplicate routes found with id: ${String(e.id)}`),a[e.id]=e,s!==0&&e.path){let t=Hn(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),Fn(r),{processedTree:{segmentTree:r,singleCache:Tn(1e3),matchCache:Tn(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Wn(e,t,n=!1){let r=e.split(`/`),i=Jn(e,r,t,n);if(!i)return null;let[a]=Gn(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function Gn(e,t,n){let r=qn(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===kn)break;if(u.kind===An){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Kn(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function qn(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Jn(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!tn(t),a=i&&e!==`/`,o=t.length-(i?1:0),s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let n=s.pop(),{node:i,index:d,skipped:f,depth:p,statics:m,dynamics:h,optionals:g}=n,{extract:_,rawParams:v,parsedParams:y}=n;if(i.skipOnParamError){if(!Yn(e,t,n))continue;v=n.rawParams,_=n.extract,y=n.parsedParams}r&&i.route&&i.kind!==kn&&Xn(l,n)&&(l=n);let b=d===o;if(b&&(i.route&&!a&&Xn(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let x=b?void 0:t[d],S;if(b&&i.index){let n={node:i.index,index:d,skipped:f,depth:p+1,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y},r=!0;if(i.index.skipOnParamError&&(Yn(e,t,n)||(r=!1)),r){if(m===o&&!h&&!g&&!f)return n;Xn(u,n)&&(u=n)}}if(i.wildcard&&Xn(c,n))for(let n of i.wildcard){let{prefix:r,suffix:i}=n;if(r&&(b||!(n.caseSensitive?x:S??=x.toLowerCase()).startsWith(r)))continue;if(i){if(b)continue;let e=t.slice(d).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let a={node:n,index:o,skipped:f,depth:p,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y};if(!(n.skipOnParamError&&!Yn(e,t,a))){c=a;break}}if(i.optional){let e=f|1<<p,t=p+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:d,skipped:e,depth:t,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?x:S??=x.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:d+1,skipped:f,depth:t,statics:m,dynamics:h,optionals:g+1,extract:_,rawParams:v,parsedParams:y})}}if(!b&&i.dynamic&&x)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?x:S??=x.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:d+1,skipped:f,depth:p+1,statics:m,dynamics:h+1,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.staticInsensitive){let e=i.staticInsensitive.get(S??=x.toLowerCase());e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.static){let e=i.static.get(x);e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(i.pathless){let e=p+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:d,skipped:f,depth:e,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}}}if(u&&c)return Xn(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function Yn(e,t,n){try{let[r,i]=Gn(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function Xn(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===kn)>(e.node.kind===kn)||t.node.kind===kn==(e.node.kind===kn)&&t.depth>e.depth))):!0}function Zn(e){return Qn(e.filter(e=>e!==void 0).join(`/`))}function Qn(e){return e.replace(/\/{2,}/g,`/`)}function $n(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function er(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function tr(e){return er($n(e))}function nr(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function rr(e,t,n){return nr(e,n)===nr(t,n)}function ir({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&tn(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(tn(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=Mn(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=Qn(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function ar(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function or(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>cr(e,n)).join(`/`):cr(r,n):r}function sr({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=Mn(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=or(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=or(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=or(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function cr(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function lr(e){return!!e?.isNotFound}function ur(){try{if(typeof window<`u`&&typeof window.sessionStorage==`object`)return window.sessionStorage}catch{}}var dr=`tsr-scroll-restoration-v1_3`,fr=(e,t)=>{let n;return(...r)=>{n||=setTimeout(()=>{e(...r),n=null},t)}};function pr(){let e=ur();if(!e)return null;let t=e.getItem(dr),n=t?JSON.parse(t):{};return{state:n,set:t=>{n=rn(t,n)||n;try{e.setItem(dr,JSON.stringify(n))}catch{console.warn(`[ts-router] Could not persist scroll restoration state to sessionStorage.`)}}}}var mr=pr(),hr=e=>e.state.__TSR_key||e.href;function gr(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var _r=!1;function vr({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||`{}`)}catch(e){console.error(e);return}let s=t||window.history.state?.__TSR_key,c=o[s];_r=!0;scroll:{if(r&&c&&Object.keys(c).length>0){for(let e in c){let t=c[e];if(e===`window`)window.scrollTo({top:t.scrollY,left:t.scrollX,behavior:n});else if(e){let n=document.querySelector(e);n&&(n.scrollLeft=t.scrollX,n.scrollTop=t.scrollY)}}break scroll}let e=(a??window.location).hash.split(`#`,2)[1];if(e){let t=window.history.state?.__hashScrollIntoViewOptions??!0;if(t){let n=document.getElementById(e);n&&n.scrollIntoView(t)}break scroll}let t={top:0,left:0,behavior:n};if(window.scrollTo(t),i)for(let e of i){if(e===`window`)continue;let n=typeof e==`function`?e():document.querySelector(e);n&&n.scrollTo(t)}}_r=!1}function yr(e,t){if(!mr||((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!mr))return;e.isScrollRestorationSetup=!0,_r=!1;let n=e.options.getScrollRestorationKey||hr;window.history.scrollRestoration=`manual`,typeof document<`u`&&document.addEventListener(`scroll`,fr(t=>{if(_r||!e.isScrollRestoring)return;let r=``;if(t.target===document||t.target===window)r=`window`;else{let e=t.target.getAttribute(`data-scroll-restoration-id`);r=e?`[data-scroll-restoration-id="${e}"]`:gr(t.target)}let i=n(e.state.location);mr.set(e=>{let t=e[i]||={},n=t[r]||={};if(r===`window`)n.scrollX=window.scrollX||0,n.scrollY=window.scrollY||0;else if(r){let e=document.querySelector(r);e&&(n.scrollX=e.scrollLeft||0,n.scrollY=e.scrollTop||0)}return e})},100),!0),e.subscribe(`onRendered`,t=>{let r=n(t.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation})||(vr({storageKey:dr,key:r,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&mr.set(e=>(e[r]||={},e)))})}function br(e){if(typeof document<`u`&&document.querySelector){let t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==``){let n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function xr(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function R(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Sr(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=R(r):Array.isArray(t)?t.push(R(r)):n[e]=[t,R(r)]}return n}var Cr=Tr(JSON.parse),wr=Er(JSON.stringify,JSON.parse);function Tr(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Sr(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Er(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=xr(e,r);return t?`?${t}`:``}}var Dr=`__root__`;function Or(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function kr(e){return e instanceof Response&&!!e.options}function Ar(e){return{input:({url:t})=>{for(let n of e)t=Mr(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Nr(e[n],t);return t}}}function jr(e){let t=tr(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Zn([`/`,t,e.pathname]),e)}}function Mr(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Nr(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}var z=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(z||{});function Pr({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}var Fr=0,Ir=0,Lr=0,Rr=[],{link:zr,unlink:Br,propagate:Vr,checkDirty:Hr,shallowPropagate:Ur}=Pr({update(e){return e.depsTail===void 0?Jr(e):qr(e)},notify(e){let t=Lr,n=t;do if(Rr[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Lr=t;n<--t;){let e=Rr[n];Rr[n++]=Rr[t],Rr[t]=e}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Qr(e)):Zr.call(e)}});function Wr(){return Fr}function Gr(){++Fr}function Kr(){--Fr||Xr()}function qr(e){e.depsTail=void 0,e.flags=5;try{let t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Qr(e)}}function Jr(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Yr(e){let t=e.flags;if(t&16||t&32&&Hr(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Qr(e)}}else e.flags=2}function Xr(){try{for(;Ir<Lr;){let e=Rr[Ir];Rr[Ir++]=void 0,Yr(e)}}finally{for(;Ir<Lr;){let e=Rr[Ir];Rr[Ir++]=void 0,e.flags|=10}Ir=0,Lr=0}}function Zr(){this.depsTail=void 0,this.flags=0,Qr(this);let e=this.subs;e!==void 0&&Br(e)}function Qr(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Br(n,e)}function $r(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var ei=[],ti=0,{link:ni,unlink:ri,propagate:ii,checkDirty:ai,shallowPropagate:oi}=Pr({update(e){return e._update()},notify(e){ei[ci++]=e,e.flags&=~z.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=z.Mutable|z.Dirty,ui(e))}}),si=0,ci=0,li;function ui(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=ri(n,e)}function di(){if(!(Wr()>0)){for(;si<ci;){let e=ei[si];ei[si++]=void 0,e.notify()}si=0,ci=0}}function fi(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?z.None:z.Mutable,get(){return li!==void 0&&ni(i,li,ti),i._snapshot},subscribe(e){let t=$r(e),n={current:!1},r=pi(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=li,o=t?.compare??Object.is;if(n)li=i,++ti,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=z.Mutable|z.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{li=a,n&&(i.flags&=~z.RecursedCheck),ui(i)}}};return n?(i.flags=z.Mutable|z.Dirty,i.get=function(){let e=i.flags;if(e&z.Dirty||e&z.Pending&&ai(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&oi(e)}}else e&z.Pending&&(i.flags=e&~z.Pending);return li!==void 0&&ni(i,li,ti),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(ii(e),oi(e),di())}},i}function pi(e){let t=()=>{let t=li;li=n,++ti,n.depsTail=void 0,n.flags=z.Watching|z.RecursedCheck;try{return e()}finally{li=t,n.flags&=~z.RecursedCheck,ui(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:z.Watching|z.RecursedCheck,notify(){let e=this.flags;e&z.Dirty||e&z.Pending&&ai(this.deps,this)?t():this.flags=z.Watching},stop(){this.flags=z.None,this.depsTail=void 0,ui(this)}};return t(),n}var mi=class{constructor(e){this.atom=fi(e)}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe($r(e))}},hi=class{constructor(e){this.atom=fi(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe($r(e))}};function gi(e){return typeof e==`function`?new hi(e):new mi(e)}function _i(e){try{Gr(),e()}finally{Kr(),di()}}function vi(e){let t;return _i(()=>{t=e()}),t}var yi=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},bi=(e,t)=>!!(e.preload&&!e.router.state.matches.some(e=>e.id===t)),xi=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Si=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},Ci=(e,t,n)=>{if(!(!kr(n)&&!lr(n)))throw kr(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:kr(n)?`redirected`:r.status===`pending`?`success`:r.status,context:xi(e,t.index),isFetching:!1,error:n})),lr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),kr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},wi=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Ti=(e,t,n)=>{let r=xi(e,n);e.updateMatch(t,e=>({...e,context:r}))},Ei=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Ci(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,Ci(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!kr(n)&&!lr(n)&&(e.serialError??=n)},Di=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!bi(e,t)&&(n.options.loader||n.options.beforeLoad||Li(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{yi(e)},i);r._nonReactive.pendingTimeout=t}},Oi=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Di(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&Ci(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},ki=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=mn(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Ei(e,n,o,`PARSE_PARAMS`),s&&Ei(e,n,s,`VALIDATE_SEARCH`),Di(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){vi(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=mn();let f={...xi(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=bi(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){vi(()=>{u(),d()});return}(kr(r)||lr(r))&&(u(),Ei(e,n,r,`BEFORE_LOAD`)),vi(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),hn(y))return u(),y.catch(t=>{Ei(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),Ei(e,n,t,`BEFORE_LOAD`)}v(y)},Ai=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>ki(e,n,t,i),s=()=>{if(wi(e,n))return;let t=Oi(e,n,i);return hn(t)?t.then(o):o()};return a()},ji=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Mi=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=xi(e,r),d=bi(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},Ni=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{Ii(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(Mi(e,t,n,r,i)),l=!!s&&hn(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;Ci(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:xi(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:xi(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,lr(t)&&await i.options.notFoundComponent?.preload?.(),Ci(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,Ci(e,e.router.getMatch(n),t)}!kr(o)&&!lr(o)&&await Ii(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:xi(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),Ci(e,r,t)}},B=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(Mi(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await Ni(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){kr(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await Ni(e,t,i,n,d):Ti(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(wi(e,i)){if(!e.router.getMatch(i))return e.matches[n];Ti(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.state.matches[n]?.routeId===a?e.router.state.matches[n].id:e.router.state.matches.find(e=>e.routeId===a)?.id,s=bi(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&Ci(e,n,a),n.status===`pending`&&await r(s,t,o,n,c)}else{let n=s&&!e.router.state.matches.some(e=>e.id===i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=mn(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(s,t,o,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function Pi(e){let t=e,n=[];t.router.state.matches.some(e=>e._forcePending)&&yi(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=Ai(t,e);hn(n)&&await n}catch(e){if(kr(e))throw e;if(lr(e))r=e;else if(!t.preload)throw e;break}if(t.serialError)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?Si(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(B(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(kr(e))throw e;lr(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!l&&r&&t.preload)return t.matches;if(l){let e=Si(t,l);On(e!==void 0,`Could not find match for notFound boundary`);let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await Ii(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Ii(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=ji(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=yi(t);if(hn(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Fi(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Ii(e,t=Ri){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===Ri?(()=>{if(e._componentsPromise===void 0){let t=Fi(e,Ri);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Fi(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Li(e){for(let t of Ri)if(e.options[t]?.preload)return!0;return!1}var Ri=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],zi=`__TSR_index`,Bi=`popstate`,Vi=`beforeunload`;function Hi(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Ki(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[zi];i=Ui(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[zi];i=Ui(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[zi]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Ui(e,t){t||={};let n=qi();return{...t,key:n,__TSR_key:n,[zi]:e}}function Wi(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Ki(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=qi();t.history.replaceState({[zi]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Ki(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[zi]-l.state[zi],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=Hi({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Vi,S,{capture:!0}),t.removeEventListener(Bi,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Vi,S,{capture:!0}),t.addEventListener(Bi,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function Gi(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Ki(e,t){let n=Gi(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=qi();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[zi]:0,key:a,__TSR_key:a}}}function qi(){return(Math.random()+1).toString(36).substring(7)}function Ji(e){let t=e.resolvedLocation,n=e.location;return{fromLocation:t,toLocation:n,pathChanged:t?.pathname!==n.pathname,hrefChanged:t?.href!==n.href,hashChanged:t?.hash!==n.hash}}function Yi(e){let t=e.filter(e=>e.status!==`redirected`);return t.length===e.length?e:t}var Xi=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=ar(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Wi()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Tn(1e3),e=this.buildRouteTree(),this.setRoutes(e)}!this.__store&&this.latestLocation&&(this.__store=gi($i(this.latestLocation)),yr(this));let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=tr(o);t&&t!==`/`&&e.push(jr({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Ar(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&this.__store.setState(e=>({...e,location:this.latestLocation})),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Un(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Rn(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let o=this.options.parseSearch(n),s=this.options.stringifySearch(o);return{href:e+s+r,publicHref:i,pathname:Cn(e).path,external:!1,searchStr:s,search:cn(t?.search,o),hash:Cn(r.slice(1)).path,state:ln(t?.state,a)}}let o=new URL(i,this.origin),s=Mr(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:Cn(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:cn(t?.search,c),hash:Cn(s.hash.slice(1)).path,state:ln(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>ir({base:e,to:Qn(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>ta({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{let e=this.state.matches.filter(e=>e.status===`pending`),t=this.state.matches.filter(e=>e.isFetching===`loader`);new Set([...this.state.pendingMatches??[],...e,...t]).forEach(e=>{this.cancelMatch(e.id)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,s=Object.assign(Object.create(null),r.params),c=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),l=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,rn(t.params,s)),u=this.getMatchedRoutes(c),d=u.matchedRoutes;if((!u.foundRoute||u.foundRoute.path!==`/`&&u.routeParams[`**`])&&this.options.notFoundRoute&&(d=[...d,this.options.notFoundRoute]),Object.keys(l).length>0)for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(l,t(l))}catch{}}let f=e.leaveParams?c:Cn(sr({path:c,params:l,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,p=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,ea(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=na({search:p,dest:t,destRoutes:d,_includeValidateSearch:e._includeValidateSearch}),p=cn(o,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?rn(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?rn(t.state,n.state):{};_=ln(n.state,_);let v=`${f}${m}${g}`,y,b,x=!1;if(this.rewrite){let e=new URL(v,this.origin),t=Nr(this.rewrite,e);y=e.href.replace(e.origin,``),t.origin===this.origin?b=t.pathname+t.search+t.hash:(b=t.href,x=!0)}else y=wn(v),b=y;return{publicHref:b,href:y,pathname:f,search:p,searchStr:m,state:_,hash:h??``,external:x,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=zn(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,rn(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=L(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=er(this.latestLocation.href)===er(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=mn(()=>{a?.resolve(),a=void 0}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Ki(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Mr(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(yn(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation);this.__store.setState(t=>({...t,status:`pending`,statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:t.cachedMatches.filter(t=>!e.some(e=>e.id===t.id))}))},this.load=async e=>{let t,n,r,i=this.state.resolvedLocation??this.state.location;for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=this.state.resolvedLocation;this.state.redirect||this.emit({type:`onBeforeNavigate`,...Ji({resolvedLocation:n,location:t})}),this.emit({type:`onBeforeLoad`,...Ji({resolvedLocation:n,location:t})}),await Pi({router:this,sync:e?.sync,forceStaleReload:i.href===t.href,matches:this.state.pendingMatches,location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=[],t=[],n=[],r=[];vi(()=>{this.__store.setState(i=>{let a=i.matches,o=i.pendingMatches||i.matches;return e=a.filter(e=>!o.some(t=>t.id===e.id)),t=a.filter(e=>!o.some(t=>t.routeId===e.routeId)),n=o.filter(e=>!a.some(t=>t.routeId===e.routeId)),r=o.filter(e=>a.some(t=>t.routeId===e.routeId)),{...i,isLoading:!1,loadedAt:Date.now(),matches:o,pendingMatches:void 0,cachedMatches:[...i.cachedMatches,...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]}}),this.clearExpiredCache()}),[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]].forEach(([e,t])=>{e.forEach(e=>{this.looseRoutesById[e.routeId].options[t]?.(e)})})})})}})}catch(e){kr(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):lr(e)&&(n=e),this.__store.setState(e=>({...e,statusCode:t?t.status:n?404:e.matches.some(e=>e.status===`error`)?500:200,redirect:t}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(e=>e.status===`error`)&&(a=500),a!==void 0&&this.__store.setState(e=>({...e,statusCode:a}))},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.state.resolvedLocation,a=typeof t.types==`function`?t.types(Ji({resolvedLocation:i,location:r})):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.state.pendingMatches?.some(t=>t.id===e)?`pendingMatches`:this.state.matches.some(t=>t.id===e)?`matches`:this.state.cachedMatches.some(t=>t.id===e)?`cachedMatches`:``;n&&(n===`cachedMatches`?this.__store.setState(n=>({...n,cachedMatches:Yi(n.cachedMatches.map(n=>n.id===e?t(n):n))})):this.__store.setState(r=>({...r,[n]:r[n]?.map(n=>n.id===e?t(n):n)})))})},this.getMatch=e=>{let t=t=>t.id===e;return this.state.cachedMatches.find(t)??this.state.pendingMatches?.find(t)??this.state.matches.find(t)},this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.__store.setState(e=>({...e,matches:e.matches.map(t),cachedMatches:e.cachedMatches.map(t),pendingMatches:e.pendingMatches?.map(t)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&yn(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.__store.setState(e=>({...e,cachedMatches:[]})):this.__store.setState(e=>({...e,cachedMatches:e.cachedMatches.filter(e=>!t(e))}))},this.clearExpiredCache=()=>{this.clearCache({filter:e=>{let t=this.looseRoutesById[e.routeId];if(!t.options.loader)return!0;let n=(e.preload?t.options.preloadGcTime??this.options.defaultPreloadGcTime:t.options.gcTime??this.options.defaultGcTime)??300*1e3;return e.status===`error`?!0:Date.now()-e.updatedAt>=n}})},this.loadRouteChunk=Ii,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(e=>e.id)),i=new Set([...r,...this.state.cachedMatches.map(e=>e.id)]);vi(()=>{n.forEach(e=>{i.has(e.id)||this.__store.setState(t=>({...t,cachedMatches:[...t.cachedMatches,e]}))})});try{return n=await Pi({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(kr(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});lr(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.state.status!==`pending`)return!1;let i=(t?.pending===void 0?!this.state.isLoading:t.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=Bn(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!L(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?L(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status===`notFound`||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??wr,parseSearch:e.parseSearch??Cr,protocolAllowlist:e.protocolAllowlist??vn}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:o}=n,s=!1;(r?r.path!==`/`&&i[`**`]:er(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?ia(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map(this.state.matches.map(e=>[e.routeId,e]));for(let n=0;n<o.length;n++){let r=o[n],s=l[n-1],d,f,p;{let n=s?.search??e.search,i=s?._strictSearch??void 0;try{let e=ea(r.options.validateSearch,{...n})??void 0;d={...n,...e},f={...i,...e},p=void 0}catch(e){let r=e;if(e instanceof Zi||(r=new Zi(e.message,{cause:e})),t?.throwOnError)throw r;d=n,f={},p=r}}let m=r.options.loaderDeps?.({search:d})??``,h=m?JSON.stringify(m):``,{interpolatedPath:g,usedParams:_}=sr({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),v=r.id+g+h,y=this.getMatch(v),b=u.get(r.id),x=y?._strictParams??_,S;if(!y)try{aa(r,_,a,x)}catch(e){if(S=lr(e)||kr(e)?e:new Qi(e.message,{cause:e}),t?.throwOnError)throw S}Object.assign(i,x);let C=b?`stay`:`enter`,w;if(y)w={...y,cause:C,params:b?.params??i,_strictParams:x,search:cn(b?b.search:y.search,d),_strictSearch:f};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Li(r)?`pending`:`success`;w={id:v,ssr:r.options.ssr,index:n,routeId:r.id,params:b?.params??i,_strictParams:x,pathname:g,updatedAt:Date.now(),search:b?cn(b.search,d):d,_strictSearch:f,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:S,__routeContext:void 0,_nonReactive:{loadPromise:mn()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:b?ln(b.loaderDeps,m):m,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(w.globalNotFound=c===r.id),w.searchError=p;let T=this.getParentContext(s);w.context={...T,...w.__routeContext,...w.__beforeLoadContext},l[n]=w}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?cn(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=tn(t),a={...e.search};for(let e of t)try{Object.assign(a,ea(e.options.validateSearch,a))}catch{}let o=tn(this.state.matches),s=o&&o.routeId===i.id&&e.pathname===this.state.location.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let i of t)try{aa(i,n,r??{},e)}catch{}c=e}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:c}}},Zi=class extends Error{},Qi=class extends Error{};function $i(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function ea(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Zi(`Async validation not supported`);if(n.issues)throw new Zi(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function ta({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=er(e),a,o,s=Vn(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign(Object.create(null),s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function na({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return ra(n)(e,t,r??!1)}function ra(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...ea(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:rn(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function ia(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return Dr}function aa(e,t,n,r){let i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=i(r);Object.assign(r,e)}}var oa=`Error preloading route! ☝️`,sa=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Dr:this.parentRoute||On(!1,`Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);let r=n?Dr:t?.path;r&&r!==`/`&&(r=$n(r));let i=t?.id||r,a=n?Dr:Zn([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Zn([`/`,a]));let o=a===`__root__`?`/`:Zn([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=er(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Or({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},ca=class extends sa{constructor(e){super(e)}};function la(e){let t=e.errorComponent??da;return(0,I.jsx)(ua,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?F.createElement(t,{error:n,reset:r}):e.children})}var ua=class extends F.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey===this.props.getResetKey()?this.state.error:null,reset:()=>{this.reset()}})}};function da({error:e}){let[t,n]=F.useState(!1);return(0,I.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,I.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,I.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,I.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,I.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,I.jsx)(`div`,{children:(0,I.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,I.jsx)(`code`,{children:e.message}):null})}):null]})}function fa({children:e,fallback:t=null}){return pa()?(0,I.jsx)(F.Fragment,{children:e}):(0,I.jsx)(F.Fragment,{children:t})}function pa(){return F.useSyncExternalStore(ma,()=>!0,()=>!1)}function ma(){return()=>{}}var ha=F.createContext(null),ga=!0;function _a(e,t){if(!ga){if(e)return;var n=`Warning: `+t;typeof console<`u`&&console.warn(n);try{throw Error(n)}catch{}}}function va(e){let t=F.useContext(ha);return _a(!((e?.warn??!0)&&!t),`useRouter must be used inside a <RouterProvider> component!`),t}var ya=P((e=>{var t=Ue();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),ba=P(((e,t)=>{t.exports=ya()})),xa=P((e=>{var t=Ue(),n=ba();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Sa=P(((e,t)=>{t.exports=xa()}))();function Ca(e,t){return e===t}function wa(e,t,n=Ca){let r=(0,F.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,F.useCallback)(()=>e?.get(),[e]);return(0,Sa.useSyncExternalStoreWithSelector)(r,i,i,t,n)}function Ta(e){let t=va({warn:e?.router===void 0}),n=e?.router||t,r=(0,F.useRef)(void 0);return wa(n.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=ln(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var Ea=F.createContext(void 0),Da=F.createContext(void 0);function Oa(e){let t=F.useContext(e.from?Da:Ea);return Ta({select:n=>{let r=n.matches.find(n=>e.from?e.from===n.routeId:n.id===t);if(On(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:`a nearest match!`}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function ka(e){return Oa({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Aa(e){let{select:t,...n}=e;return Oa({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function ja(e){return Oa({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Ma(e){return Oa({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Na(e){let t=va();return F.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Pa(e){return Oa({...e,select:t=>e.select?e.select(t.context):t.context})}var Fa=Ge();function Ia(e,t){let n=va(),r=en(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,hashScrollIntoView:u,replace:d,startTransition:f,resetScroll:p,viewTransition:m,children:h,target:g,disabled:_,style:v,className:y,onClick:b,onBlur:x,onFocus:S,onMouseEnter:C,onMouseLeave:w,onTouchStart:T,ignoreBlocker:E,params:D,search:O,hash:k,state:ee,mask:te,reloadDocument:ne,unsafeRelative:A,from:j,_fromLocation:re,...ie}=e,ae=pa(),oe=Ta({select:e=>{let t=e.matches[e.matches.length-1];return{search:t?.search,hash:e.location.hash,path:t?.pathname}},structuralSharing:!0}),se=e.from,M=F.useMemo(()=>({...e,from:se}),[n,oe,se,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ce=F.useMemo(()=>n.buildLocation({...M}),[n,M]),le=ce.maskedLocation?ce.maskedLocation.publicHref:ce.publicHref,ue=ce.maskedLocation?ce.maskedLocation.external:ce.external,de=F.useMemo(()=>Ga(le,ue,n.history,_),[_,ue,le,n.history]),fe=F.useMemo(()=>{if(de?.external)return yn(de.href,n.protocolAllowlist)?void 0:de.href;if(!Ka(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),yn(s,n.protocolAllowlist)?void 0:s}catch{}},[s,de,n.protocolAllowlist]),pe=Ta({select:e=>{if(fe)return!1;if(o?.exact){if(!rr(e.location.pathname,ce.pathname,n.basepath))return!1}else{let t=nr(e.location.pathname,n.basepath),r=nr(ce.pathname,n.basepath);if(!(t.startsWith(r)&&(t.length===r.length||t[r.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!L(e.location.search,ce.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?ae&&e.location.hash===ce.hash:!0}}),me=pe?rn(i,{})??Ra:La,he=pe?La:rn(a,{})??La,ge=[y,me.className,he.className].filter(Boolean).join(` `),_e=(v||me.style||he.style)&&{...v,...me.style,...he.style},[ve,ye]=F.useState(!1),be=F.useRef(!1),xe=e.reloadDocument||fe?!1:c??n.options.defaultPreload,Se=l??n.options.defaultPreloadDelay??0,Ce=F.useCallback(()=>{n.preloadRoute({...M,_builtLocation:ce}).catch(e=>{console.warn(e),console.warn(oa)})},[n,M,ce]);$t(r,F.useCallback(e=>{e?.isIntersecting&&Ce()},[Ce]),Ua,{disabled:!!_||xe!==`viewport`}),F.useEffect(()=>{be.current||!_&&xe===`render`&&(Ce(),be.current=!0)},[_,Ce,xe]);let we=e=>{let t=e.currentTarget.getAttribute(`target`),r=g===void 0?t:g;if(!_&&!Ja(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,Fa.flushSync)(()=>{ye(!0)});let t=n.subscribe(`onResolved`,()=>{t(),ye(!1)});n.navigate({...M,replace:d,resetScroll:p,hashScrollIntoView:u,startTransition:f,viewTransition:m,ignoreBlocker:E})}};if(fe)return{...ie,ref:r,href:fe,...h&&{children:h},...g&&{target:g},..._&&{disabled:_},...v&&{style:v},...y&&{className:y},...b&&{onClick:b},...x&&{onBlur:x},...S&&{onFocus:S},...C&&{onMouseEnter:C},...w&&{onMouseLeave:w},...T&&{onTouchStart:T}};let Te=e=>{if(_||xe!==`intent`)return;if(!Se){Ce();return}let t=e.currentTarget;if(Ha.has(t))return;let n=setTimeout(()=>{Ha.delete(t),Ce()},Se);Ha.set(t,n)},N=e=>{_||xe!==`intent`||Ce()},Ee=e=>{if(_||!xe||!Se)return;let t=e.currentTarget,n=Ha.get(t);n&&(clearTimeout(n),Ha.delete(t))};return{...ie,...me,...he,href:de?.href,ref:r,onClick:Wa([b,we]),onBlur:Wa([x,Ee]),onFocus:Wa([S,Te]),onMouseEnter:Wa([C,Te]),onMouseLeave:Wa([w,Ee]),onTouchStart:Wa([T,N]),disabled:!!_,target:g,..._e&&{style:_e},...ge&&{className:ge},..._&&za,...pe&&Ba,...ae&&ve&&Va}}var La={},Ra={className:`active`},za={role:`link`,"aria-disabled":!0},Ba={"data-status":`active`,"aria-current":`page`},Va={"data-transitioning":`transitioning`},Ha=new WeakMap,Ua={rootMargin:`100px`},Wa=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Ga(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Ka(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var qa=F.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Ia(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return F.createElement(`a`,t,o)}return F.createElement(n,a,o)});function Ja(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Ya=class extends sa{constructor(e){super(e),this.useMatch=e=>Oa({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Pa({...e,from:this.id}),this.useSearch=e=>Ma({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ja({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Aa({...e,from:this.id}),this.useLoaderData=e=>ka({...e,from:this.id}),this.useNavigate=()=>Na({from:this.fullPath}),this.Link=F.forwardRef((e,t)=>(0,I.jsx)(qa,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function Xa(e){return new Ya(e)}var Za=class extends ca{constructor(e){super(e),this.useMatch=e=>Oa({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Pa({...e,from:this.id}),this.useSearch=e=>Ma({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ja({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Aa({...e,from:this.id}),this.useLoaderData=e=>ka({...e,from:this.id}),this.useNavigate=()=>Na({from:this.fullPath}),this.Link=F.forwardRef((e,t)=>(0,I.jsx)(qa,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function Qa(e){return new Za(e)}function $a(e){return typeof e==`object`?new eo(e,{silent:!0}).createRoute(e):new eo(e,{silent:!0}).createRoute}var eo=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=Xa(e);return t.isRoot=!1,t},this.silent=t?.silent}},to=class{constructor(e){this.useMatch=e=>Oa({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Pa({...e,from:this.options.id}),this.useSearch=e=>Ma({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>ja({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>Aa({...e,from:this.options.id}),this.useLoaderData=e=>ka({...e,from:this.options.id}),this.useNavigate=()=>Na({from:va().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for(`react.memo`)}};function no(e){return typeof e==`object`?new to(e):t=>new to({id:e,...t})}function ro(e){let t=Ta({select:e=>`not-found-${e.location.pathname}-${e.status}`});return(0,I.jsx)(la,{getResetKey:()=>t,onCatch:(t,n)=>{if(lr(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(lr(t))return e.fallback?.(t);throw t},children:e.children})}function io(){return(0,I.jsx)(`p`,{children:`Not Found`})}function ao({children:e}){return va(),null}function oo(e){return(0,I.jsx)(I.Fragment,{children:e.children})}function so(e,t,n){return t.options.notFoundComponent?(0,I.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,I.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,I.jsx)(io,{})}function co(){let e=va();if(!e.isScrollRestoring||!0)return null;let t=(e.options.getScrollRestorationKey||hr)(e.latestLocation),n=t===hr(e.latestLocation)?void 0:t,r={storageKey:dr,shouldScrollRestoration:!0};return n&&(r.key=n),(0,I.jsx)(ao,{children:`(${vr.toString()})(${Sn(JSON.stringify(r))})`})}var lo=F.memo(function({matchId:e}){let t=va(),n=Ta({select:t=>{let n=t.matches.findIndex(t=>t.id===e),r=t.matches[n];return On(r,`Could not find match for matchId "${e}". Please file an issue!`),{routeId:r.routeId,ssr:r.ssr,_displayPending:r._displayPending,resetKey:t.loadedAt,parentRouteId:t.matches[n-1]?.routeId}},structuralSharing:!0}),r=t.routesById[n.routeId],i=r.options.pendingComponent??t.options.defaultPendingComponent,a=i?(0,I.jsx)(i,{}):null,o=r.options.errorComponent??t.options.defaultErrorComponent,s=r.options.onCatch??t.options.defaultOnCatch,c=r.isRoot?r.options.notFoundComponent??t.options.notFoundRoute?.options.component:r.options.notFoundComponent,l=n.ssr===!1||n.ssr===`data-only`,u=(!r.isRoot||r.options.wrapInSuspense||l)&&(r.options.wrapInSuspense??i??(r.options.errorComponent?.preload||l))?F.Suspense:oo,d=o?la:oo,f=c?ro:oo;return(0,I.jsxs)(r.isRoot?r.options.shellComponent??oo:oo,{children:[(0,I.jsx)(Ea.Provider,{value:e,children:(0,I.jsx)(u,{fallback:a,children:(0,I.jsx)(d,{getResetKey:()=>n.resetKey,errorComponent:o||da,onCatch:(t,n)=>{if(lr(t))throw t;_a(!1,`Error in route match: ${e}`),s?.(t,n)},children:(0,I.jsx)(f,{fallback:e=>{if(!c||e.routeId&&e.routeId!==n.routeId||!e.routeId&&!r.isRoot)throw e;return F.createElement(c,e)},children:l||n._displayPending?(0,I.jsx)(fa,{fallback:a,children:(0,I.jsx)(fo,{matchId:e})}):(0,I.jsx)(fo,{matchId:e})})})})}),n.parentRouteId===`__root__`&&t.options.scrollRestoration?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(uo,{}),(0,I.jsx)(co,{})]}):null]})});function uo(){let e=va(),t=F.useRef(void 0);return(0,I.jsx)(`script`,{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:`onRendered`,...Ji(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var fo=F.memo(function({matchId:e}){let t=va(),{match:n,key:r,routeId:i}=Ta({select:n=>{let r=n.matches.find(t=>t.id===e),i=r.routeId,a=(t.routesById[i].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:i,loaderDeps:r.loaderDeps,params:r._strictParams,search:r._strictSearch});return{key:a?JSON.stringify(a):void 0,routeId:i,match:{id:r.id,status:r.status,error:r.error,_forcePending:r._forcePending,_displayPending:r._displayPending}}},structuralSharing:!0}),a=t.routesById[i],o=F.useMemo(()=>{let e=a.options.component??t.options.defaultComponent;return e?(0,I.jsx)(e,{},r):(0,I.jsx)(V,{})},[r,a.options.component,t.options.defaultComponent]);if(n._displayPending)throw t.getMatch(n.id)?._nonReactive.displayPendingPromise;if(n._forcePending)throw t.getMatch(n.id)?._nonReactive.minPendingPromise;if(n.status===`pending`){let e=a.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let r=t.getMatch(n.id);if(r&&!r._nonReactive.minPendingPromise){let t=mn();r._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),r._nonReactive.minPendingPromise=void 0},e)}}throw t.getMatch(n.id)?._nonReactive.loadPromise}if(n.status===`notFound`)return On(lr(n.error),`Expected a notFound error`),so(t,a,n.error);if(n.status===`redirected`)throw On(kr(n.error),`Expected a redirect error`),t.getMatch(n.id)?._nonReactive.loadPromise;if(n.status===`error`)throw n.error;return o}),V=F.memo(function(){let e=va(),t=F.useContext(Ea),n=Ta({select:e=>e.matches.find(e=>e.id===t)?.routeId}),r=e.routesById[n],i=Ta({select:e=>{let n=e.matches.find(e=>e.id===t);return On(n,`Could not find parent match for matchId "${t}"`),n.globalNotFound}}),a=Ta({select:e=>{let n=e.matches;return n[n.findIndex(e=>e.id===t)+1]?.id}}),o=e.options.defaultPendingComponent?(0,I.jsx)(e.options.defaultPendingComponent,{}):null;if(i)return so(e,r,void 0);if(!a)return null;let s=(0,I.jsx)(lo,{matchId:a});return n===`__root__`?(0,I.jsx)(F.Suspense,{fallback:o,children:s}):s});function po(){let e=va(),t=F.useRef({router:e,mounted:!1}),[n,r]=F.useState(!1),{hasPendingMatches:i,isLoading:a}=Ta({select:e=>({isLoading:e.isLoading,hasPendingMatches:e.matches.some(e=>e.status===`pending`)}),structuralSharing:!0}),o=Qt(a),s=a||n||i,c=Qt(s),l=a||i,u=Qt(l);return e.startTransition=e=>{r(!0),F.startTransition(()=>{e(),r(!1)})},F.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return er(e.latestLocation.publicHref)!==er(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),Zt(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),Zt(()=>{o&&!a&&e.emit({type:`onLoad`,...Ji(e.state)})},[o,e,a]),Zt(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...Ji(e.state)})},[l,u,e]),Zt(()=>{if(c&&!s){let t=Ji(e.state);e.emit({type:`onResolved`,...t}),e.__store.setState(e=>({...e,status:`idle`,resolvedLocation:e.location})),t.hrefChanged&&br(e)}},[s,c,e]),null}function mo(){let e=va(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,I.jsx)(t,{}):null,r=(0,I.jsxs)(typeof document<`u`&&e.ssr?oo:F.Suspense,{fallback:n,children:[(0,I.jsx)(po,{}),(0,I.jsx)(ho,{})]});return e.options.InnerWrap?(0,I.jsx)(e.options.InnerWrap,{children:r}):r}function ho(){let e=va(),t=Ta({select:e=>e.matches[0]?.id}),n=Ta({select:e=>e.loadedAt}),r=t?(0,I.jsx)(lo,{matchId:t}):null;return(0,I.jsx)(Ea.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,I.jsx)(la,{getResetKey:()=>n,errorComponent:da,onCatch:void 0,children:r})})}var go=e=>new _o(e),_o=class extends Xi{constructor(e){super(e)}};typeof globalThis<`u`?(globalThis.createFileRoute=$a,globalThis.createLazyFileRoute=no):typeof window<`u`&&(window.createFileRoute=$a,window.createLazyFileRoute=no);function vo({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,I.jsx)(ha.Provider,{value:e,children:t});return e.options.Wrap?(0,I.jsx)(e.options.Wrap,{children:r}):r}function yo({router:e,...t}){return(0,I.jsx)(vo,{router:e,...t,children:(0,I.jsx)(mo,{})})}var bo=qe();function xo(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=xo(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function H(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xo(e))&&(r&&(r+=` `),r+=t);return r}var So=/(?:^|\n)\s{0,3}#{0,6}\s*my request(?:\s+for\s+[^:\n]+)?\s*:?\s*/giu,Co=e=>e.replace(/[\\/]+$/u,``),wo=(e,t)=>`${Co(e)}/${t.replace(/^\/+/u,``)}`,To=(e,t)=>wo(t,e.uploadRootDirName),Eo=(e,t)=>wo(t,e.uploadFilesDirName),Do=(e,t,n)=>`${To(e,t)}/${n}`,Oo=(e,t,n)=>`${Eo(e,t)}/${n}`,ko=(e,t)=>`${e.localImagePath}?path=${encodeURIComponent(t)}`,Ao=(e,t)=>`${e.localBrowsePath}${encodeURI(t)}`,jo=e=>e.availability===`ready`,Mo={id:`antigravity`,displayName:`Antigravity`,description:`CLI provider scaffold for Antigravity sessions.`,transportLabel:`scaffolded CLI adapter`,availability:`scaffolded`,transportKind:`cli`,defaultModel:null,wsProxyPath:`/antigravity-ws`,authCompletePath:`/antigravity-auth/complete`,localImagePath:`/antigravity-local-image`,localBrowsePath:`/antigravity-local-browse/`,uploadRootDirName:`.antigravity-web/uploads`,uploadFilesDirName:`.antigravity-web/uploads/files`,requestHeading:`# My request for Antigravity:`,requestMarkerPattern:So},No={id:`codex`,displayName:`Codex`,description:`Live Codex bridge connected to the current Nomadex workspace.`,transportLabel:`local agent bridge`,availability:`ready`,transportKind:`bridge`,defaultModel:`gpt-5.4`,wsProxyPath:`/codex-ws`,authCompletePath:`/codex-auth/complete`,localImagePath:`/codex-local-image`,localBrowsePath:`/codex-local-browse/`,uploadRootDirName:`.codex-web/uploads`,uploadFilesDirName:`.codex-web/uploads/files`,requestHeading:`# My request:`,requestMarkerPattern:So},Po={id:`gemini-cli`,displayName:`Gemini CLI`,description:`CLI provider scaffold for Gemini CLI workspaces.`,transportLabel:`scaffolded CLI adapter`,availability:`scaffolded`,transportKind:`cli`,defaultModel:null,wsProxyPath:`/gemini-cli-ws`,authCompletePath:`/gemini-cli-auth/complete`,localImagePath:`/gemini-cli-local-image`,localBrowsePath:`/gemini-cli-local-browse/`,uploadRootDirName:`.gemini-cli-web/uploads`,uploadFilesDirName:`.gemini-cli-web/uploads/files`,requestHeading:`# My request for Gemini CLI:`,requestMarkerPattern:So},Fo={id:`github-copilot`,displayName:`GitHub Copilot`,description:`CLI provider scaffold for GitHub Copilot coding sessions.`,transportLabel:`scaffolded CLI adapter`,availability:`scaffolded`,transportKind:`cli`,defaultModel:null,wsProxyPath:`/github-copilot-ws`,authCompletePath:`/github-copilot-auth/complete`,localImagePath:`/github-copilot-local-image`,localBrowsePath:`/github-copilot-local-browse/`,uploadRootDirName:`.github-copilot-web/uploads`,uploadFilesDirName:`.github-copilot-web/uploads/files`,requestHeading:`# My request for GitHub Copilot:`,requestMarkerPattern:So},Io={id:`opencode`,displayName:`OpenCode`,description:`Headless OpenCode CLI turns through the local Nomadex bridge.`,transportLabel:`local OpenCode CLI`,availability:`ready`,transportKind:`cli`,defaultModel:`opencode/big-pickle`,installCommand:`npm i -g opencode-ai@latest`,wsProxyPath:`/codex-ws`,authCompletePath:`/codex-auth/complete`,localImagePath:`/codex-local-image`,localBrowsePath:`/codex-local-browse/`,uploadRootDirName:`.opencode-web/uploads`,uploadFilesDirName:`.opencode-web/uploads/files`,requestHeading:`# My request for OpenCode:`,requestMarkerPattern:So},Lo={id:`qwen-code`,displayName:`Qwen Code`,description:`Headless Qwen Code turns through the local Nomadex bridge.`,transportLabel:`local Qwen Code CLI`,availability:`ready`,transportKind:`cli`,defaultModel:`default`,installCommand:`npm i -g @qwen-code/qwen-code@latest`,wsProxyPath:`/codex-ws`,authCompletePath:`/codex-auth/complete`,localImagePath:`/codex-local-image`,localBrowsePath:`/codex-local-browse/`,uploadRootDirName:`.qwen-code-web/uploads`,uploadFilesDirName:`.qwen-code-web/uploads/files`,requestHeading:`# My request for Qwen Code:`,requestMarkerPattern:So},Ro=`nomadex-provider`,zo={codex:No,antigravity:Mo,"gemini-cli":Po,"github-copilot":Fo,opencode:Io,"qwen-code":Lo},Bo=`codex`,Vo=()=>Object.values(zo),Ho=(e=Bo)=>zo[e],Uo=e=>!!(e&&e in zo),Wo=()=>{if(typeof window>`u`)return Bo;let e=window.localStorage.getItem(Ro);return Uo(e)?e:Bo},Go=e=>{typeof window>`u`||window.localStorage.setItem(Ro,e)},Ko=(e,t)=>({reasoningEffort:e,description:t}),qo=(...e)=>e,Jo=({id:e,displayName:t,description:n,defaultReasoningEffort:r,supportedReasoningEfforts:i,inputModalities:a,isDefault:o=!1})=>({id:e,model:e,upgrade:null,upgradeInfo:null,availabilityNux:null,displayName:t,description:n,hidden:!1,supportedReasoningEfforts:i.map(e=>Ko(e,`${t} supports ${e} reasoning.`)),defaultReasoningEffort:r,inputModalities:a,supportsPersonality:!0,isDefault:o}),Yo=[],Xo=[Jo({id:`opencode/big-pickle`,displayName:`Big Pickle`,description:`OpenCode Zen free model. Limited-time free access.`,defaultReasoningEffort:`medium`,supportedReasoningEfforts:[`low`,`medium`,`high`],inputModalities:qo(`text`),isDefault:!0}),Jo({id:`opencode/minimax-m2.5-free`,displayName:`MiniMax M2.5 Free`,description:`OpenCode Zen free model. Limited-time free access.`,defaultReasoningEffort:`medium`,supportedReasoningEfforts:[`low`,`medium`,`high`],inputModalities:qo(`text`)}),Jo({id:`opencode/mimo-v2-pro-free`,displayName:`MiMo V2 Pro Free`,description:`OpenCode Zen free model. Limited-time free access.`,defaultReasoningEffort:`medium`,supportedReasoningEfforts:[`low`,`medium`,`high`],inputModalities:qo(`text`)}),Jo({id:`opencode/mimo-v2-omni-free`,displayName:`MiMo V2 Omni Free`,description:`OpenCode Zen free model. Limited-time free access.`,defaultReasoningEffort:`medium`,supportedReasoningEfforts:[`low`,`medium`,`high`],inputModalities:qo(`text`)}),Jo({id:`opencode/nemotron-3-super-free`,displayName:`Nemotron 3 Super Free`,description:`OpenCode Zen free model. Limited-time free access.`,defaultReasoningEffort:`medium`,supportedReasoningEfforts:[`low`,`medium`,`high`],inputModalities:qo(`text`)})],Zo=(e,t)=>e===`opencode`?Xo:e===`codex`?t:Yo,Qo=(e,t,n)=>Zo(e,n).find(e=>e.id===t)??null,$o=/^##\s+(.+?):\s+(.+?)\s*$/,es=/^#\s*files mentioned by the user\s*:?\s*$/i;function ts(e){return e.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()||e}function ns(e){if(!e||/\s/u.test(e)||e.endsWith(`/`)||e.endsWith(`\\`)||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(e))return!1;let t=e.startsWith(`/`),n=/^[A-Za-z]:[\\/]/u.test(e),r=e.startsWith(`./`)||e.startsWith(`../`)||e.startsWith(`~/`),i=e.includes(`/`)||e.includes(`\\`);return t||n||r||i}function rs(e){if(!e)return null;let t=e,n=null,r=t.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(r)t=r[1],n=Number(r[2]);else{let e=t.match(/^(.*):(\d+)(?::\d+)?$/u);e&&(t=e[1],n=Number(e[2]))}return ns(t)?{path:t,line:n}:null}var is=e=>e.startsWith(`/`)||/^[A-Za-z]:[\\/]/u.test(e);function as(e,t){let n=e.trim();if(!n)return null;let r=Ho(t),i=rs(n);return!i?.path||!is(i.path)?null:{path:i.path,line:i.line,browseUrl:Ao(r,i.path)}}function os(e,t){let n=ts(e);return t===null?n:`${n}:${String(t)}`}function ss(e){if(!e.includes(`[`)||!e.includes(`](`))return[{kind:`text`,value:e}];let t=[],n=/\[([^\]\n]+)\]\(([^)\n]+)\)/gu,r=0;for(let i of e.matchAll(n)){let n=i[0],a=i[1]?.trim()??``,o=i[2]?.trim()??``,s=i.index??-1;if(s<0)continue;s>r&&t.push({kind:`text`,value:e.slice(r,s)});let c=rs(o);c?t.push({kind:`file`,value:a||o,path:c.path,line:c.line,displayPath:os(c.path,c.line),downloadName:ts(c.path)}):t.push({kind:`text`,value:n}),r=s+n.length}return r<e.length&&t.push({kind:`text`,value:e.slice(r)}),t.length>0?t:[{kind:`text`,value:e}]}function cs(e,t){ss(t).forEach(t=>{t.kind===`text`&&t.value.length===0||e.push(t)})}function ls(e){let t=e.split(`
|
|
9
|
+
`+e.stack}}var Ce=Object.prototype.hasOwnProperty,we=t.unstable_scheduleCallback,Te=t.unstable_cancelCallback,N=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,P=null;function Le(e){if(typeof Pe==`function`&&Fe(e),P&&typeof P.setStrictMode==`function`)try{P.setStrictMode(Ie,e)}catch{}}var Re=Math.clz32?Math.clz32:He,ze=Math.log,Be=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(ze(e)/Be|0)|0}var We=256,Ke=262144,qe=4194304;function Je(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 Ye(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Je(n))):i=Je(o):i=Je(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Je(n))):i=Je(o)):i=Je(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Xe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ze(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 Qe(){var e=qe;return qe<<=1,!(qe&62914560)&&(qe=4194304),e}function $e(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function et(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function tt(e,t,n,r,i,a){var o=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 s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Re(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&nt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function nt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Re(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function rt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Re(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function it(e,t){var n=t&-t;return n=n&42?1:at(n),(n&(e.suspendedLanes|t))===0?n:0}function at(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 ot(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function st(){var e=j.p;return e===0?(e=window.event,e===void 0?32:vp(e.type)):e}function ct(e,t){var n=j.p;try{return j.p=e,t()}finally{j.p=n}}var lt=Math.random().toString(36).slice(2),ut=`__reactFiber$`+lt,dt=`__reactProps$`+lt,ft=`__reactContainer$`+lt,pt=`__reactEvents$`+lt,mt=`__reactListeners$`+lt,ht=`__reactHandles$`+lt,gt=`__reactResources$`+lt,_t=`__reactMarker$`+lt;function vt(e){delete e[ut],delete e[dt],delete e[pt],delete e[mt],delete e[ht]}function yt(e){var t=e[ut];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ft]||n[ut]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_f(e);e!==null;){if(n=e[ut])return n;e=_f(e)}return t}e=n,n=e.parentNode}return null}function bt(e){if(e=e[ut]||e[ft]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function xt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function St(e){var t=e[gt];return t||=e[gt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ct(e){e[_t]=!0}var wt=new Set,Tt={};function Et(e,t){Dt(e,t),Dt(e+`Capture`,t)}function Dt(e,t){for(Tt[e]=t,e=0;e<t.length;e++)wt.add(t[e])}var Ot=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]*$`),kt={},At={};function jt(e){return Ce.call(At,e)?!0:Ce.call(kt,e)?!1:Ot.test(e)?At[e]=!0:(kt[e]=!0,!1)}function Mt(e,t,n){if(jt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Nt(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 Pt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Ft(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function It(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Lt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rt(e){if(!e._valueTracker){var t=It(e)?`checked`:`value`;e._valueTracker=Lt(e,t,``+e[t])}}function zt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=It(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Bt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Vt=/[\n"\\]/g;function Ht(e){return e.replace(Vt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ut(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Ft(t)):e.value!==``+Ft(t)&&(e.value=``+Ft(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Gt(e,o,Ft(n)):Gt(e,o,Ft(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Ft(s):e.removeAttribute(`name`)}function Wt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Rt(e);return}n=n==null?``:``+Ft(n),t=t==null?n:``+Ft(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Rt(e)}function Gt(e,t,n){t===`number`&&Bt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Kt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Ft(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function qt(e,t,n){if(t!=null&&(t=``+Ft(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ft(n)}function Jt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ft(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Rt(e)}function F(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var I=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 Yt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||I.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Xt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Yt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Yt(e,o,t[o])}function Zt(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`]]),$t=/^[\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 en(e){return $t.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function tn(){}var nn=null;function rn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var an=null,on=null;function sn(e){var t=bt(e);if(t&&(e=t.stateNode)){var n=e[dt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ut(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="`+Ht(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[dt]||null;if(!a)throw Error(i(90));Ut(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&zt(r)}break a;case`textarea`:qt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Kt(e,!!n.multiple,t,!1)}}}var cn=!1;function ln(e,t,n){if(cn)return e(t,n);cn=!0;try{return e(t)}finally{if(cn=!1,(an!==null||on!==null)&&(wu(),an&&(t=an,e=on,on=an=null,sn(t),e)))for(t=0;t<e.length;t++)sn(e[t])}}function un(e,t){var n=e.stateNode;if(n===null)return null;var r=n[dt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var dn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),fn=!1;if(dn)try{var pn={};Object.defineProperty(pn,`passive`,{get:function(){fn=!0}}),window.addEventListener(`test`,pn,pn),window.removeEventListener(`test`,pn,pn)}catch{fn=!1}var mn=null,hn=null,L=null;function gn(){if(L)return L;var e,t=hn,n=t.length,r,i=`value`in mn?mn.value:mn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return L=i.slice(e,1<r?1-r:void 0)}function _n(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 vn(){return!0}function yn(){return!1}function bn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?vn:yn,this.isPropagationStopped=yn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=vn)},persist:function(){},isPersistent:vn}),t}var xn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sn=bn(xn),Cn=f({},xn,{view:0,detail:0}),wn=bn(Cn),Tn,En,Dn,On=f({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zn,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!==Dn&&(Dn&&e.type===`mousemove`?(Tn=e.screenX-Dn.screenX,En=e.screenY-Dn.screenY):En=Tn=0,Dn=e),Tn)},movementY:function(e){return`movementY`in e?e.movementY:En}}),kn=bn(On),An=bn(f({},On,{dataTransfer:0})),jn=bn(f({},Cn,{relatedTarget:0})),Mn=bn(f({},xn,{animationName:0,elapsedTime:0,pseudoElement:0})),Nn=bn(f({},xn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Pn=bn(f({},xn,{data:0})),Fn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},In={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`},Ln={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ln[e])?!!t[e]:!1}function zn(){return Rn}var Bn=bn(f({},Cn,{key:function(e){if(e.key){var t=Fn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=_n(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?In[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zn,charCode:function(e){return e.type===`keypress`?_n(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?_n(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Vn=bn(f({},On,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Hn=bn(f({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zn})),Un=bn(f({},xn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Wn=bn(f({},On,{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})),Gn=bn(f({},xn,{newState:0,oldState:0})),Kn=[9,13,27,32],qn=dn&&`CompositionEvent`in window,Jn=null;dn&&`documentMode`in document&&(Jn=document.documentMode);var Yn=dn&&`TextEvent`in window&&!Jn,Xn=dn&&(!qn||Jn&&8<Jn&&11>=Jn),Zn=` `,Qn=!1;function $n(e,t){switch(e){case`keyup`:return Kn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var tr=!1;function nr(e,t){switch(e){case`compositionend`:return er(t);case`keypress`:return t.which===32?(Qn=!0,Zn):null;case`textInput`:return e=t.data,e===Zn&&Qn?null:e;default:return null}}function rr(e,t){if(tr)return e===`compositionend`||!qn&&$n(e,t)?(e=gn(),L=hn=mn=null,tr=!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 Xn&&t.locale!==`ko`?null:t.data;default:return null}}var ir={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 ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ir[e.type]:t===`textarea`}function or(e,t,n,r){an?on?on.push(r):on=[r]:an=r,t=jd(t,`onChange`),0<t.length&&(n=new Sn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var sr=null,cr=null;function lr(e){wd(e,0)}function ur(e){if(zt(xt(e)))return e}function dr(e,t){if(e===`change`)return t}var fr=!1;if(dn){var pr;if(dn){var mr=`oninput`in document;if(!mr){var hr=document.createElement(`div`);hr.setAttribute(`oninput`,`return;`),mr=typeof hr.oninput==`function`}pr=mr}else pr=!1;fr=pr&&(!document.documentMode||9<document.documentMode)}function gr(){sr&&(sr.detachEvent(`onpropertychange`,_r),cr=sr=null)}function _r(e){if(e.propertyName===`value`&&ur(cr)){var t=[];or(t,cr,e,rn(e)),ln(lr,t)}}function vr(e,t,n){e===`focusin`?(gr(),sr=t,cr=n,sr.attachEvent(`onpropertychange`,_r)):e===`focusout`&&gr()}function yr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ur(cr)}function br(e,t){if(e===`click`)return ur(t)}function xr(e,t){if(e===`input`||e===`change`)return ur(t)}function Sr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Cr=typeof Object.is==`function`?Object.is:Sr;function R(e,t){if(Cr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ce.call(t,i)||!Cr(e[i],t[i]))return!1}return!0}function wr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tr(e,t){var n=wr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=wr(n)}}function Er(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Er(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bt(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=Bt(e.document)}return t}function Or(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 kr=dn&&`documentMode`in document&&11>=document.documentMode,Ar=null,jr=null,Mr=null,Nr=!1;function Pr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nr||Ar==null||Ar!==Bt(r)||(r=Ar,`selectionStart`in r&&Or(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Mr&&R(Mr,r)||(Mr=r,r=jd(jr,`onSelect`),0<r.length&&(t=new Sn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ar)))}function Fr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var z={animationend:Fr(`Animation`,`AnimationEnd`),animationiteration:Fr(`Animation`,`AnimationIteration`),animationstart:Fr(`Animation`,`AnimationStart`),transitionrun:Fr(`Transition`,`TransitionRun`),transitionstart:Fr(`Transition`,`TransitionStart`),transitioncancel:Fr(`Transition`,`TransitionCancel`),transitionend:Fr(`Transition`,`TransitionEnd`)},Ir={},Lr={};dn&&(Lr=document.createElement(`div`).style,`AnimationEvent`in window||(delete z.animationend.animation,delete z.animationiteration.animation,delete z.animationstart.animation),`TransitionEvent`in window||delete z.transitionend.transition);function Rr(e){if(Ir[e])return Ir[e];if(!z[e])return e;var t=z[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lr)return Ir[e]=t[n];return e}var zr=Rr(`animationend`),Br=Rr(`animationiteration`),Vr=Rr(`animationstart`),Hr=Rr(`transitionrun`),Ur=Rr(`transitionstart`),Wr=Rr(`transitioncancel`),Gr=Rr(`transitionend`),Kr=new Map,qr=`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(` `);qr.push(`scrollEnd`);function Jr(e,t){Kr.set(e,t),Et(t,[e])}var Yr=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&&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)},Xr=[],Zr=0,Qr=0;function $r(){for(var e=Zr,t=Qr=Zr=0;t<e;){var n=Xr[t];Xr[t++]=null;var r=Xr[t];Xr[t++]=null;var i=Xr[t];Xr[t++]=null;var a=Xr[t];if(Xr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ri(n,i,a)}}function ei(e,t,n,r){Xr[Zr++]=e,Xr[Zr++]=t,Xr[Zr++]=n,Xr[Zr++]=r,Qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ti(e,t,n,r){return ei(e,t,n,r),ii(e)}function ni(e,t){return ei(e,null,null,t),ii(e)}function ri(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Re(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ii(e){if(50<hu)throw hu=0,gu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ai={};function oi(e,t,n,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function si(e,t,n,r){return new oi(e,t,n,r)}function ci(e){return e=e.prototype,!(!e||!e.isReactComponent)}function li(e,t){var n=e.alternate;return n===null?(n=si(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 ui(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 di(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ci(e)&&(s=1);else if(typeof e==`string`)s=qf(e,n,ce.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=si(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return fi(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=si(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=si(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=si(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=si(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function fi(e,t,n,r){return e=si(7,e,r,t),e.lanes=n,e}function pi(e,t,n){return e=si(6,e,null,t),e.lanes=n,e}function mi(e){var t=si(18,null,null,0);return t.stateNode=e,t}function hi(e,t,n){return t=si(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gi=new WeakMap;function _i(e,t){if(typeof e==`object`&&e){var n=gi.get(e);return n===void 0?(t={value:e,source:t,stack:Se(t)},gi.set(e,t),t):n}return{value:e,source:t,stack:Se(t)}}var vi=[],yi=0,bi=null,xi=0,Si=[],Ci=0,wi=null,Ti=1,Ei=``;function Di(e,t){vi[yi++]=xi,vi[yi++]=bi,bi=e,xi=t}function Oi(e,t,n){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,wi=e;var r=Ti;e=Ei;var i=32-Re(r)-1;r&=~(1<<i),n+=1;var a=32-Re(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ti=1<<32-Re(t)+i|n<<i|r,Ei=a+e}else Ti=1<<a|n<<i|r,Ei=e}function ki(e){e.return!==null&&(Di(e,1),Oi(e,1,0))}function Ai(e){for(;e===bi;)bi=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null;for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ei=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null}function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,Ti=t.id,Ei=t.overflow,wi=e}var Mi=null,Ni=null,B=!1,Pi=null,Fi=!1,Ii=Error(i(519));function Li(e){throw Ui(_i(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ii}function Ri(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ut]=e,t[dt]=r,n){case`dialog`:q(`cancel`,t),q(`close`,t);break;case`iframe`:case`object`:case`embed`:q(`load`,t);break;case`video`:case`audio`:for(n=0;n<Sd.length;n++)q(Sd[n],t);break;case`source`:q(`error`,t);break;case`img`:case`image`:case`link`:q(`error`,t),q(`load`,t);break;case`details`:q(`toggle`,t);break;case`input`:q(`invalid`,t),Wt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:q(`invalid`,t);break;case`textarea`:q(`invalid`,t),Jt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Ld(t.textContent,n)?(r.popover!=null&&(q(`beforetoggle`,t),q(`toggle`,t)),r.onScroll!=null&&q(`scroll`,t),r.onScrollEnd!=null&&q(`scrollend`,t),r.onClick!=null&&(t.onclick=tn),t=!0):t=!1,t||Li(e,!0)}function zi(e){for(Mi=e.return;Mi;)switch(Mi.tag){case 5:case 31:case 13:Fi=!1;return;case 27:case 3:Fi=!0;return;default:Mi=Mi.return}}function Bi(e){if(e!==Mi)return!1;if(!B)return zi(e),B=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Yd(e.type,e.memoizedProps)),n=!n),n&&Ni&&Li(e),zi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=gf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=gf(e)}else t===27?(t=Ni,rf(e.type)?(e=hf,hf=null,Ni=e):Ni=t):Ni=Mi?mf(e.stateNode.nextSibling):null;return!0}function Vi(){Ni=Mi=null,B=!1}function Hi(){var e=Pi;return e!==null&&(nu===null?nu=e:nu.push.apply(nu,e),Pi=null),e}function Ui(e){Pi===null?Pi=[e]:Pi.push(e)}var Wi=oe(null),Gi=null,Ki=null;function qi(e,t,n){M(Wi,t._currentValue),t._currentValue=n}function Ji(e){e._currentValue=Wi.current,se(Wi)}function Yi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Xi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Yi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Yi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Zi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Cr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===de.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[np]:e.push(np))}a=a.return}e!==null&&Xi(t,e,n,r),t.flags|=262144}function Qi(e){for(e=e.firstContext;e!==null;){if(!Cr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $i(e){Gi=e,Ki=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ea(e){return na(Gi,e)}function ta(e,t){return Gi===null&&$i(e),na(e,t)}function na(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ki===null){if(e===null)throw Error(i(308));Ki=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ki=Ki.next=t;return n}var ra=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ia=t.unstable_scheduleCallback,aa=t.unstable_NormalPriority,oa={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sa(){return{controller:new ra,data:new Map,refCount:0}}function ca(e){e.refCount--,e.refCount===0&&ia(aa,function(){e.controller.abort()})}var la=null,ua=0,da=0,fa=null;function pa(e,t){if(la===null){var n=la=[];ua=0,da=gd(),fa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ua++,t.then(ma,ma),t}function ma(){if(--ua===0&&la!==null){fa!==null&&(fa.status=`fulfilled`);var e=la;la=null,da=0,fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ha(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ga=A.S;A.S=function(e,t){au=De(),typeof t==`object`&&t&&typeof t.then==`function`&&pa(e,t),ga!==null&&ga(e,t)};var _a=oe(null);function va(){var e=_a.current;return e===null?Hl.pooledCache:e}function ya(e,t){t===null?M(_a,_a.current):M(_a,t.pool)}function ba(){var e=va();return e===null?null:{parent:oa._currentValue,pool:e}}var xa=Error(i(460)),Sa=Error(i(474)),Ca=Error(i(542)),wa={then:function(){}};function Ta(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ea(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(tn,tn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Aa(e),e;default:if(typeof t.status==`string`)t.then(tn,tn);else{if(e=Hl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Aa(e),e}throw Oa=t,xa}}function Da(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Oa=e,xa):e}}var Oa=null;function ka(){if(Oa===null)throw Error(i(459));var e=Oa;return Oa=null,e}function Aa(e){if(e===xa||e===Ca)throw Error(i(483))}var ja=null,Ma=0;function Na(e){var t=Ma;return Ma+=1,ja===null&&(ja=[]),Ea(ja,e,t)}function Pa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Fa(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ia(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=li(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=pi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&Da(i)===t.type)?(t=a(t,n.props),Pa(t,n),t.return=e,t):(t=di(n.type,n.key,n.props,null,e.mode,r),Pa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=hi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=fi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=di(t.type,t.key,t.props,null,e.mode,n),Pa(n,t),n.return=e,n;case h:return t=hi(t,e.mode,n),t.return=e,t;case T:return t=Da(t),f(e,t,n)}if(ne(t)||k(t))return t=fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Na(t),n);if(t.$$typeof===b)return f(e,ta(e,t),n);Fa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=Da(n),p(e,t,n,r)}if(ne(n)||k(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Na(n),r);if(n.$$typeof===b)return p(e,t,ta(e,n),r);Fa(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=Da(r),_(e,t,n,r,i)}if(ne(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Na(r),i);if(r.$$typeof===b)return _(e,t,n,ta(t,r),i);Fa(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),B&&Di(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return B&&Di(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),B&&Di(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),B&&Di(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return B&&Di(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),B&&Di(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Da(l)===r.type){n(e,r.sibling),c=a(r,o.props),Pa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===g?(c=fi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=di(o.type,o.key,o.props,null,e.mode,c),Pa(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=hi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Da(o),x(e,r,o,c)}if(ne(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Na(o),c);if(o.$$typeof===b)return x(e,r,ta(e,o),c);Fa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ma=0;var i=x(e,t,n,r);return ja=null,i}catch(t){if(t===xa||t===Ca)throw t;var a=si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var La=Ia(!0),Ra=Ia(!1),za=!1;function Ba(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Va(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 Ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Vl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ii(e),ri(e,null,n),t}return ei(e,r,t,n),ii(e)}function Wa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rt(e,n)}}function Ga(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ka=!1;function qa(){if(Ka){var e=fa;if(e!==null)throw e}}function Ja(e,t,n,r){Ka=!1;var i=e.updateQueue;za=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(G&p)===p:(r&p)===p){p!==0&&p===da&&(Ka=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:za=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Xl|=o,e.lanes=o,e.memoizedState=d}}function Ya(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Xa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ya(n[e],t)}var Za=oe(null),Qa=oe(0);function $a(e,t){e=Jl,M(Qa,e),M(Za,t),Jl=e|t.baseLanes}function eo(){M(Qa,Jl),M(Za,Za.current)}function to(){Jl=Qa.current,se(Za),se(Qa)}var no=oe(null),ro=null;function io(e){var t=e.alternate;M(lo,lo.current&1),M(no,e),ro===null&&(t===null||Za.current!==null||t.memoizedState!==null)&&(ro=e)}function ao(e){M(lo,lo.current),M(no,e),ro===null&&(ro=e)}function oo(e){e.tag===22?(M(lo,lo.current),M(no,e),ro===null&&(ro=e)):so(e)}function so(){M(lo,lo.current),M(no,no.current)}function co(e){se(no),ro===e&&(ro=null),se(lo)}var lo=oe(0);function uo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||df(n)||ff(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)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 fo=0,V=null,po=null,mo=null,ho=!1,go=!1,_o=!1,vo=0,yo=0,bo=null,xo=0;function H(){throw Error(i(321))}function So(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Cr(e[n],t[n]))return!1;return!0}function Co(e,t,n,r,i,a){return fo=a,V=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?Bs:Vs,_o=!1,a=n(r,i),_o=!1,go&&(a=To(t,n,r,i)),wo(e),a}function wo(e){A.H=zs;var t=po!==null&&po.next!==null;if(fo=0,mo=po=V=null,ho=!1,yo=0,bo=null,t)throw Error(i(300));e===null||ic||(e=e.dependencies,e!==null&&Qi(e)&&(ic=!0))}function To(e,t,n,r){V=e;var a=0;do{if(go&&(bo=null),yo=0,go=!1,25<=a)throw Error(i(301));if(a+=1,mo=po=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}A.H=Hs,o=t(n,r)}while(go);return o}function Eo(){var e=A.H,t=e.useState()[0];return t=typeof t.then==`function`?No(t):t,e=e.useState()[0],(po===null?null:po.memoizedState)!==e&&(V.flags|=1024),t}function Do(){var e=vo!==0;return vo=0,e}function Oo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ko(e){if(ho){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ho=!1}fo=0,mo=po=V=null,go=!1,yo=vo=0,bo=null}function Ao(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mo===null?V.memoizedState=mo=e:mo=mo.next=e,mo}function jo(){if(po===null){var e=V.alternate;e=e===null?null:e.memoizedState}else e=po.next;var t=mo===null?V.memoizedState:mo.next;if(t!==null)mo=t,po=e;else{if(e===null)throw V.alternate===null?Error(i(467)):Error(i(310));po=e,e={memoizedState:po.memoizedState,baseState:po.baseState,baseQueue:po.baseQueue,queue:po.queue,next:null},mo===null?V.memoizedState=mo=e:mo=mo.next=e}return mo}function Mo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function No(e){var t=yo;return yo+=1,bo===null&&(bo=[]),e=Ea(bo,e,t),t=V,(mo===null?t.memoizedState:mo.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?Bs:Vs),e}function Po(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return No(e);if(e.$$typeof===b)return ea(e)}throw Error(i(438,String(e)))}function Fo(e){var t=null,n=V.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=V.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Mo(),V.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=D;return t.index++,n}function Io(e,t){return typeof t==`function`?t(e):t}function Lo(e){return Ro(jo(),po,e)}function Ro(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(fo&f)===f:(G&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===da&&(d=!0);else if((fo&p)===p){u=u.next,p===da&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,V.lanes|=p,Xl|=p;f=u.action,_o&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,V.lanes|=f,Xl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Cr(o,e.memoizedState)&&(ic=!0,d&&(n=fa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function zo(e){var t=jo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Cr(o,t.memoizedState)||(ic=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Bo(e,t,n){var r=V,a=jo(),o=B;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Cr((po||a).memoizedState,n);if(s&&(a.memoizedState=n,ic=!0),a=a.queue,ds(Uo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||mo!==null&&mo.memoizedState.tag&1){if(r.flags|=2048,os(9,{destroy:void 0},Ho.bind(null,r,a,n,t),null),Hl===null)throw Error(i(349));o||fo&127||Vo(r,t,n)}return n}function Vo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=V.updateQueue,t===null?(t=Mo(),V.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ho(e,t,n,r){t.value=n,t.getSnapshot=r,Wo(t)&&Go(e)}function Uo(e,t,n){return n(function(){Wo(t)&&Go(e)})}function Wo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Cr(e,n)}catch{return!0}}function Go(e){var t=ni(e,2);t!==null&&yu(t,e,2)}function Ko(e){var t=Ao();if(typeof e==`function`){var n=e;if(e=n(),_o){Le(!0);try{n()}finally{Le(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:e},t}function qo(e,t,n,r){return e.baseState=n,Ro(e,po,typeof r==`function`?r:Io)}function Jo(e,t,n,r,a){if(Is(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};A.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Yo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Yo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=A.T,o={};A.T=o;try{var s=n(i,r),c=A.S;c!==null&&c(o,s),Xo(e,t,s)}catch(n){Qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),A.T=a}}else try{a=n(i,r),Xo(e,t,a)}catch(n){Qo(e,t,n)}}function Xo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Zo(e,t,n)},function(n){return Qo(e,t,n)}):Zo(e,t,n)}function Zo(e,t,n){t.status=`fulfilled`,t.value=n,$o(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Yo(e,n)))}function Qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,$o(t),t=t.next;while(t!==r)}e.action=null}function $o(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function es(e,t){return t}function ts(e,t){if(B){var n=Hl.formState;if(n!==null){a:{var r=V;if(B){if(Ni){b:{for(var i=Ni,a=Fi;i.nodeType!==8;){if(!a){i=null;break b}if(i=mf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ni=mf(i.nextSibling),r=i.data===`F!`;break a}}Li(r)}r=!1}r&&(t=n[0])}}return n=Ao(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:es,lastRenderedState:t},n.queue=r,n=Ns.bind(null,V,r),r.dispatch=n,r=Ko(!1),a=Fs.bind(null,V,!1,r.queue),r=Ao(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Jo.bind(null,V,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ns(e){return rs(jo(),po,e)}function rs(e,t,n){if(t=Ro(e,t,es)[0],e=Lo(Io)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=No(t)}catch(e){throw e===xa?Ca:e}else r=t;t=jo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(V.flags|=2048,os(9,{destroy:void 0},is.bind(null,i,n),null)),[r,a,e]}function is(e,t){e.action=t}function as(e){var t=jo(),n=po;if(n!==null)return rs(t,n,e);jo(),t=t.memoizedState,n=jo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function os(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=V.updateQueue,t===null&&(t=Mo(),V.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ss(){return jo().memoizedState}function cs(e,t,n,r){var i=Ao();V.flags|=e,i.memoizedState=os(1|t,{destroy:void 0},n,r===void 0?null:r)}function ls(e,t,n,r){var i=jo();r=r===void 0?null:r;var a=i.memoizedState.inst;po!==null&&r!==null&&So(r,po.memoizedState.deps)?i.memoizedState=os(t,a,n,r):(V.flags|=e,i.memoizedState=os(1|t,a,n,r))}function us(e,t){cs(8390656,8,e,t)}function ds(e,t){ls(2048,8,e,t)}function fs(e){V.flags|=4;var t=V.updateQueue;if(t===null)t=Mo(),V.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ps(e){var t=jo().memoizedState;return fs({ref:t,nextImpl:e}),function(){if(Vl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ms(e,t){return ls(4,2,e,t)}function hs(e,t){return ls(4,4,e,t)}function gs(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 _s(e,t,n){n=n==null?null:n.concat([e]),ls(4,4,gs.bind(null,t,e),n)}function vs(){}function ys(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&So(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function bs(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&So(t,r[1]))return r[0];if(r=e(),_o){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r}function xs(e,t,n){return n===void 0||fo&1073741824&&!(G&261930)?e.memoizedState=t:(e.memoizedState=n,e=vu(),V.lanes|=e,Xl|=e,n)}function Ss(e,t,n,r){return Cr(n,t)?n:Za.current===null?!(fo&42)||fo&1073741824&&!(G&261930)?(ic=!0,e.memoizedState=n):(e=vu(),V.lanes|=e,Xl|=e,t):(e=xs(e,n,r),Cr(e,t)||(ic=!0),e)}function Cs(e,t,n,r,i){var a=j.p;j.p=a!==0&&8>a?a:8;var o=A.T,s={};A.T=s,Fs(e,!1,t,n);try{var c=i(),l=A.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ps(e,t,ha(c,r),_u(e)):Ps(e,t,r,_u(e))}catch(n){Ps(e,t,{then:function(){},status:`rejected`,reason:n},_u())}finally{j.p=a,o!==null&&s.types!==null&&(o.types=s.types),A.T=o}}function ws(){}function Ts(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Es(e).queue;Cs(e,a,t,re,n===null?ws:function(){return Ds(e),n(r)})}function Es(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ds(e){var t=Es(e);t.next===null&&(t=e.alternate.memoizedState),Ps(e,t.next.queue,{},_u())}function Os(){return ea(np)}function ks(){return jo().memoizedState}function As(){return jo().memoizedState}function js(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=_u();e=Ha(n);var r=Ua(t,e,n);r!==null&&(yu(r,t,n),Wa(r,t,n)),t={cache:sa()},e.payload=t;return}t=t.return}}function Ms(e,t,n){var r=_u();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Is(e)?Ls(t,n):(n=ti(e,t,n,r),n!==null&&(yu(n,e,r),Rs(n,t,r)))}function Ns(e,t,n){Ps(e,t,n,_u())}function Ps(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Is(e))Ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Cr(s,o))return ei(e,t,i,0),Hl===null&&$r(),!1}catch{}if(n=ti(e,t,i,r),n!==null)return yu(n,e,r),Rs(n,t,r),!0}return!1}function Fs(e,t,n,r){if(r={lane:2,revertLane:gd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Is(e)){if(t)throw Error(i(479))}else t=ti(e,n,r,2),t!==null&&yu(t,e,2)}function Is(e){var t=e.alternate;return e===V||t!==null&&t===V}function Ls(e,t){go=ho=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rt(e,n)}}var zs={readContext:ea,use:Po,useCallback:H,useContext:H,useEffect:H,useImperativeHandle:H,useLayoutEffect:H,useInsertionEffect:H,useMemo:H,useReducer:H,useRef:H,useState:H,useDebugValue:H,useDeferredValue:H,useTransition:H,useSyncExternalStore:H,useId:H,useHostTransitionStatus:H,useFormState:H,useActionState:H,useOptimistic:H,useMemoCache:H,useCacheRefresh:H};zs.useEffectEvent=H;var Bs={readContext:ea,use:Po,useCallback:function(e,t){return Ao().memoizedState=[e,t===void 0?null:t],e},useContext:ea,useEffect:us,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),cs(4194308,4,gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return cs(4194308,4,e,t)},useInsertionEffect:function(e,t){cs(4,2,e,t)},useMemo:function(e,t){var n=Ao();t=t===void 0?null:t;var r=e();if(_o){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Ao();if(n!==void 0){var i=n(t);if(_o){Le(!0);try{n(t)}finally{Le(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ms.bind(null,V,e),[r.memoizedState,e]},useRef:function(e){var t=Ao();return e={current:e},t.memoizedState=e},useState:function(e){e=Ko(e);var t=e.queue,n=Ns.bind(null,V,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:vs,useDeferredValue:function(e,t){return xs(Ao(),e,t)},useTransition:function(){var e=Ko(!1);return e=Cs.bind(null,V,e.queue,!0,!1),Ao().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=V,a=Ao();if(B){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Hl===null)throw Error(i(349));G&127||Vo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,us(Uo.bind(null,r,o,e),[e]),r.flags|=2048,os(9,{destroy:void 0},Ho.bind(null,r,o,n,t),null),n},useId:function(){var e=Ao(),t=Hl.identifierPrefix;if(B){var n=Ei,r=Ti;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=vo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Os,useFormState:ts,useActionState:ts,useOptimistic:function(e){var t=Ao();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Fs.bind(null,V,!0,n),n.dispatch=t,[e,t]},useMemoCache:Fo,useCacheRefresh:function(){return Ao().memoizedState=js.bind(null,V)},useEffectEvent:function(e){var t=Ao(),n={impl:e};return t.memoizedState=n,function(){if(Vl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Vs={readContext:ea,use:Po,useCallback:ys,useContext:ea,useEffect:ds,useImperativeHandle:_s,useInsertionEffect:ms,useLayoutEffect:hs,useMemo:bs,useReducer:Lo,useRef:ss,useState:function(){return Lo(Io)},useDebugValue:vs,useDeferredValue:function(e,t){return Ss(jo(),po.memoizedState,e,t)},useTransition:function(){var e=Lo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:Bo,useId:ks,useHostTransitionStatus:Os,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){return qo(jo(),po,e,t)},useMemoCache:Fo,useCacheRefresh:As};Vs.useEffectEvent=ps;var Hs={readContext:ea,use:Po,useCallback:ys,useContext:ea,useEffect:ds,useImperativeHandle:_s,useInsertionEffect:ms,useLayoutEffect:hs,useMemo:bs,useReducer:zo,useRef:ss,useState:function(){return zo(Io)},useDebugValue:vs,useDeferredValue:function(e,t){var n=jo();return po===null?xs(n,e,t):Ss(n,po.memoizedState,e,t)},useTransition:function(){var e=zo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:Bo,useId:ks,useHostTransitionStatus:Os,useFormState:as,useActionState:as,useOptimistic:function(e,t){var n=jo();return po===null?(n.baseState=e,[e,n.queue.dispatch]):qo(n,po,e,t)},useMemoCache:Fo,useCacheRefresh:As};Hs.useEffectEvent=ps;function Us(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ws={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_u(),i=Ha(r);i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(yu(t,e,r),Wa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_u(),i=Ha(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(yu(t,e,r),Wa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_u(),r=Ha(n);r.tag=2,t!=null&&(r.callback=t),t=Ua(e,r,n),t!==null&&(yu(t,e,n),Wa(t,e,n))}};function Gs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!R(n,r)||!R(i,a):!0}function Ks(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ws.enqueueReplaceState(t,t.state,null)}function qs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Js(e){Yr(e)}function Ys(e){console.error(e)}function Xs(e){Yr(e)}function Zs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Qs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function $s(e,t,n){return n=Ha(n),n.tag=3,n.payload={element:null},n.callback=function(){Zs(e,t)},n}function ec(e){return e=Ha(e),e.tag=3,e}function tc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Qs(t,n,r),typeof i!=`function`&&(K===null?K=new Set([this]):K.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function nc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Zi(t,n,a,!0),n=no.current,n!==null){switch(n.tag){case 31:case 13:return ro===null?ju():n.alternate===null&&Yl===0&&(Yl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===wa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Xu(e,r,a)),!1;case 22:return n.flags|=65536,r===wa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Xu(e,r,a)),!1}throw Error(i(435,n.tag))}return Xu(e,r,a),ju(),!1}if(B)return t=no.current,t===null?(r!==Ii&&(t=Error(i(423),{cause:r}),Ui(_i(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=_i(r,n),a=$s(e.stateNode,r,a),Ga(e,a),Yl!==4&&(Yl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ii&&(e=Error(i(422),{cause:r}),Ui(_i(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=_i(o,n),tu===null?tu=[o]:tu.push(o),Yl!==4&&(Yl=2),t===null)return!0;r=_i(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=$s(n.stateNode,r,e),Ga(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(K===null||!K.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ec(a),tc(a,e,n,r),Ga(n,a),!1}n=n.return}while(n!==null);return!1}var rc=Error(i(461)),ic=!1;function ac(e,t,n,r){t.child=e===null?Ra(t,null,n,r):La(t,e.child,n,r)}function oc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return $i(t),r=Co(e,t,n,o,a,i),s=Do(),e!==null&&!ic?(Oo(e,t,i),Ac(e,t,i)):(B&&s&&ki(t),t.flags|=1,ac(e,t,r,i),t.child)}function sc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ci(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,cc(e,t,a,r,i)):(e=di(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!jc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?R:n,n(o,r)&&e.ref===t.ref)return Ac(e,t,i)}return t.flags|=1,e=li(a,r),e.ref=t.ref,e.return=t,t.child=e}function cc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(R(a,r)&&e.ref===t.ref)if(ic=!1,t.pendingProps=r=a,jc(e,i))e.flags&131072&&(ic=!0);else return t.lanes=e.lanes,Ac(e,t,i)}return gc(e,t,n,r,i)}function lc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return dc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ya(t,a===null?null:a.cachePool),a===null?eo():$a(t,a),oo(t);else return r=t.lanes=536870912,dc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ya(t,null),eo(),so(t)):(ya(t,a.cachePool),$a(t,a),so(t),t.memoizedState=null);return ac(e,t,i,n),t.child}function uc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function dc(e,t,n,r,i){var a=va();return a=a===null?null:{parent:oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ya(t,null),eo(),oo(t),e!==null&&Zi(e,t,r,!0),t.childLanes=i,null}function fc(e,t){return t=Tc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function pc(e,t,n){return La(t,e.child,null,n),e=fc(t,t.pendingProps),e.flags|=2,co(t),t.memoizedState=null,e}function mc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(B){if(r.mode===`hidden`)return e=fc(t,r),t.lanes=536870912,uc(null,e);if(ao(t),(e=Ni)?(e=uf(e,Fi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Li(t);return t.lanes=536870912,null}return fc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ao(t),a)if(t.flags&256)t.flags&=-257,t=pc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ic||Zi(e,t,n,!1),a=(n&e.childLanes)!==0,ic||a){if(r=Hl,r!==null&&(s=it(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ni(e,s),yu(r,e,s),rc;ju(),t=pc(e,t,n)}else e=o.treeContext,Ni=mf(s.nextSibling),Mi=t,B=!0,Pi=null,Fi=!1,e!==null&&ji(t,e),t=fc(t,r),t.flags|=4096;return t}return e=li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function hc(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(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function gc(e,t,n,r,i){return $i(t),n=Co(e,t,n,r,void 0,i),r=Do(),e!==null&&!ic?(Oo(e,t,i),Ac(e,t,i)):(B&&r&&ki(t),t.flags|=1,ac(e,t,n,i),t.child)}function _c(e,t,n,r,i,a){return $i(t),t.updateQueue=null,n=To(t,r,n,i),wo(e),r=Do(),e!==null&&!ic?(Oo(e,t,a),Ac(e,t,a)):(B&&r&&ki(t),t.flags|=1,ac(e,t,n,a),t.child)}function vc(e,t,n,r,i){if($i(t),t.stateNode===null){var a=ai,o=n.contextType;typeof o==`object`&&o&&(a=ea(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ws,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ba(t),o=n.contextType,a.context=typeof o==`object`&&o?ea(o):ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Us(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ws.enqueueReplaceState(a,a.state,null),Ja(t,r,a,i),qa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=qs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ai,typeof u==`object`&&u&&(o=ea(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ks(t,a,r,o),za=!1;var f=t.memoizedState;a.state=f,Ja(t,r,a,i),qa(),l=t.memoizedState,s||f!==l||za?(typeof d==`function`&&(Us(t,n,d,r),l=t.memoizedState),(c=za||Gs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Va(e,t),o=t.memoizedProps,u=qs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ai,typeof l==`object`&&l&&(c=ea(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ks(t,a,r,c),za=!1,f=t.memoizedState,a.state=f,Ja(t,r,a,i),qa();var p=t.memoizedState;o!==d||f!==p||za||e!==null&&e.dependencies!==null&&Qi(e.dependencies)?(typeof s==`function`&&(Us(t,n,s,r),p=t.memoizedState),(u=za||Gs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Qi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,hc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=La(t,e.child,null,i),t.child=La(t,null,n,i)):ac(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ac(e,t,i),e}function yc(e,t,n,r){return Vi(),t.flags|=256,ac(e,t,n,r),t.child}var bc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xc(e){return{baseLanes:e,cachePool:ba()}}function Sc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=$l),e}function Cc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(lo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(B){if(a?io(t):so(t),(e=Ni)?(e=uf(e,Fi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Li(t);return ff(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(so(t),a=t.mode,c=Tc({mode:`hidden`,children:c},a),r=fi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=xc(n),r.childLanes=Sc(e,s,n),t.memoizedState=bc,uc(null,r)):(io(t),wc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(io(t),t.flags&=-257,t=Ec(e,t,n)):t.memoizedState===null?(so(t),c=r.fallback,a=t.mode,r=Tc({mode:`visible`,children:r.children},a),c=fi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,La(t,e.child,null,n),r=t.child,r.memoizedState=xc(n),r.childLanes=Sc(e,s,n),t.memoizedState=bc,t=uc(null,r)):(so(t),t.child=e.child,t.flags|=128,t=null);else if(io(t),ff(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ui({value:r,source:null,stack:null}),t=Ec(e,t,n)}else if(ic||Zi(e,t,n,!1),s=(n&e.childLanes)!==0,ic||s){if(s=Hl,s!==null&&(r=it(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ni(e,r),yu(s,e,r),rc;df(c)||ju(),t=Ec(e,t,n)}else df(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ni=mf(c.nextSibling),Mi=t,B=!0,Pi=null,Fi=!1,e!==null&&ji(t,e),t=wc(t,r.children),t.flags|=4096);return t}return a?(so(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=li(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=fi(c,a,n,null),c.flags|=2):c=li(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,uc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=xc(n):(a=c.cachePool,a===null?a=ba():(l=oa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Sc(e,s,n),t.memoizedState=bc,uc(e.child,r)):(io(t),n=e.child,e=n.sibling,n=li(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function wc(e,t){return t=Tc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Tc(e,t){return e=si(22,e,null,t),e.lanes=0,e}function Ec(e,t,n){return La(t,e.child,null,n),e=wc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Yi(e.return,t,n)}function Oc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function kc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=lo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,M(lo,o),ac(e,t,r,n),r=B?xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Dc(e,n,t);else if(e.tag===19)Dc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&uo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Oc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&uo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Oc(t,!0,n,null,a,r);break;case`together`:Oc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ac(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Xl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Zi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function jc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Qi(e))):!0}function Mc(e,t,n){switch(t.tag){case 3:fe(t,t.stateNode.containerInfo),qi(t,oa,e.memoizedState.cache),Vi();break;case 27:case 5:me(t);break;case 4:fe(t,t.stateNode.containerInfo);break;case 10:qi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(io(t),e=Ac(e,t,n),e===null?null:e.sibling):Cc(e,t,n):(io(t),t.flags|=128,null);io(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Zi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return kc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),M(lo,lo.current),r)break;return null;case 22:return t.lanes=0,lc(e,t,n,t.pendingProps);case 24:qi(t,oa,e.memoizedState.cache)}return Ac(e,t,n)}function Nc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ic=!0;else{if(!jc(e,n)&&!(t.flags&128))return ic=!1,Mc(e,t,n);ic=!!(e.flags&131072)}else ic=!1,B&&t.flags&1048576&&Oi(t,xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Da(t.elementType),t.type=e,typeof e==`function`)ci(e)?(r=qs(e,r),t.tag=1,t=vc(null,t,e,r,n)):(t.tag=0,t=gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=oc(null,t,e,r,n);break a}else if(a===w){t.tag=14,t=sc(null,t,e,r,n);break a}}throw t=te(e)||e,Error(i(306,t,``))}}return t;case 0:return gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=qs(r,t.pendingProps),vc(e,t,r,a,n);case 3:a:{if(fe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Va(e,t),Ja(t,r,null,n);var s=t.memoizedState;if(r=s.cache,qi(t,oa,r),r!==o.cache&&Xi(t,[oa],n,!0),qa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=yc(e,t,r,n);break a}else if(r!==a){a=_i(Error(i(424)),t),Ui(a),t=yc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ni=mf(e.firstChild),Mi=t,B=!0,Pi=null,Fi=!0,n=Ra(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Vi(),r===a){t=Ac(e,t,n);break a}ac(e,t,r,n)}t=t.child}return t;case 26:return hc(e,t),e===null?(n=Ff(t.type,null,t.pendingProps,null))?t.memoizedState=n:B||(n=t.type,e=t.pendingProps,r=Kd(ue.current).createElement(n),r[ut]=t,r[dt]=e,Bd(r,n,e),Ct(r),t.stateNode=r):t.memoizedState=Ff(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return me(t),e===null&&B&&(r=t.stateNode=vf(t.type,t.pendingProps,ue.current),Mi=t,Fi=!0,a=Ni,rf(t.type)?(hf=a,Ni=mf(r.firstChild)):Ni=a),ac(e,t,t.pendingProps.children,n),hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&B&&((a=r=Ni)&&(r=cf(r,t.type,t.pendingProps,Fi),r===null?a=!1:(t.stateNode=r,Mi=t,Ni=mf(r.firstChild),Fi=!1,a=!0)),a||Li(t)),me(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Yd(a,o)?r=null:s!==null&&Yd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Co(e,t,Eo,null,null,n),np._currentValue=a),hc(e,t),ac(e,t,r,n),t.child;case 6:return e===null&&B&&((e=n=Ni)&&(n=lf(n,t.pendingProps,Fi),n===null?e=!1:(t.stateNode=n,Mi=t,Ni=null,e=!0)),e||Li(t)),null;case 13:return Cc(e,t,n);case 4:return fe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=La(t,null,r,n):ac(e,t,r,n),t.child;case 11:return oc(e,t,t.type,t.pendingProps,n);case 7:return ac(e,t,t.pendingProps,n),t.child;case 8:return ac(e,t,t.pendingProps.children,n),t.child;case 12:return ac(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,qi(t,t.type,r.value),ac(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,$i(t),a=ea(a),r=r(a),t.flags|=1,ac(e,t,r,n),t.child;case 14:return sc(e,t,t.type,t.pendingProps,n);case 15:return cc(e,t,t.type,t.pendingProps,n);case 19:return kc(e,t,n);case 31:return mc(e,t,n);case 22:return lc(e,t,n,t.pendingProps);case 24:return $i(t),r=ea(oa),e===null?(a=va(),a===null&&(a=Hl,o=sa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ba(t),qi(t,oa,a)):((e.lanes&n)!==0&&(Va(e,t),Ja(t,null,null,n),qa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,qi(t,oa,r),r!==a.cache&&Xi(t,[oa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),qi(t,oa,r))),ac(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Pc(e){e.flags|=4}function Fc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Ou())e.flags|=8192;else throw Oa=wa,Sa}else e.flags&=-16777217}function Ic(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Jf(t))if(Ou())e.flags|=8192;else throw Oa=wa,Sa}function Lc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Qe(),e.lanes|=t,eu|=t)}function Rc(e,t){if(!B)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function zc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Bc(e,t,n){var r=t.pendingProps;switch(Ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zc(t),null;case 1:return zc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ji(oa),pe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Bi(t)?Pc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Hi())),zc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Pc(t),o===null?(zc(t),Fc(t,a,null,r,n)):(zc(t),Ic(t,o))):o?o===e.memoizedState?(zc(t),t.flags&=-16777217):(Pc(t),zc(t),Ic(t,o)):(e=e.memoizedProps,e!==r&&Pc(t),zc(t),Fc(t,a,e,r,n)),null;case 27:if(he(t),n=ue.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return zc(t),null}e=ce.current,Bi(t)?Ri(t,e):(e=vf(a,r,n),t.stateNode=e,Pc(t))}return zc(t),null;case 5:if(he(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return zc(t),null}if(o=ce.current,Bi(t))Ri(t,o);else{var s=Kd(ue.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ut]=t,o[dt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Bd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Pc(t)}}return zc(t),Fc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ue.current,Bi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Mi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ut]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ld(e.nodeValue,n)),e||Li(t,!0)}else e=Kd(e).createTextNode(r),e[ut]=t,t.stateNode=e}return zc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Bi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ut]=t}else Vi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zc(t),e=!1}else n=Hi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(co(t),t):(co(t),null);if(t.flags&128)throw Error(i(558))}return zc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Bi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ut]=t}else Vi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zc(t),a=!1}else a=Hi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(co(t),t):(co(t),null)}return co(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Lc(t,t.updateQueue),zc(t),null);case 4:return pe(),e===null&&Dd(t.stateNode.containerInfo),zc(t),null;case 10:return Ji(t.type),zc(t),null;case 19:if(se(lo),r=t.memoizedState,r===null)return zc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Rc(r,!1);else{if(Yl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=uo(e),o!==null){for(t.flags|=128,Rc(r,!1),e=o.updateQueue,t.updateQueue=e,Lc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ui(n,e),n=n.sibling;return M(lo,lo.current&1|2),B&&Di(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>ou&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304)}else{if(!a)if(e=uo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Lc(t,e),Rc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!B)return zc(t),null}else 2*De()-r.renderingStartTime>ou&&n!==536870912&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(zc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=lo.current,M(lo,a?n&1|2:n&1),B&&Di(t,r.treeForkCount),e);case 22:case 23:return co(t),to(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(zc(t),t.subtreeFlags&6&&(t.flags|=8192)):zc(t),n=t.updateQueue,n!==null&&Lc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&se(_a),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ji(oa),zc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Vc(e,t){switch(Ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ji(oa),pe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return he(t),null;case 31:if(t.memoizedState!==null){if(co(t),t.alternate===null)throw Error(i(340));Vi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(co(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Vi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return se(lo),null;case 4:return pe(),null;case 10:return Ji(t.type),null;case 22:case 23:return co(t),to(),e!==null&&se(_a),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ji(oa),null;case 25:return null;default:return null}}function Hc(e,t){switch(Ai(t),t.tag){case 3:Ji(oa),pe();break;case 26:case 27:case 5:he(t);break;case 4:pe();break;case 31:t.memoizedState!==null&&co(t);break;case 13:co(t);break;case 19:se(lo);break;case 10:Ji(t.type);break;case 22:case 23:co(t),to(),e!==null&&se(_a);break;case 24:Ji(oa)}}function Uc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Yu(t,t.return,e)}}function Wc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Yu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Yu(t,t.return,e)}}function Gc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xa(t,n)}catch(t){Yu(e,e.return,t)}}}function Kc(e,t,n){n.props=qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Yu(e,t,n)}}function qc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Yu(e,t,n)}}function Jc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Yu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Yu(e,t,n)}else n.current=null}function Yc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Yu(e,e.return,t)}}function Xc(e,t,n){try{var r=e.stateNode;Vd(r,e.type,n,t),r[dt]=t}catch(t){Yu(e,e.return,t)}}function Zc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&rf(e.type)||e.tag===4}function Qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Zc(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&&rf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $c(e,t,n){var r=e.tag;if(r===5||r===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=tn));else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Bd(t,r,n),t[ut]=e,t[dt]=n}catch(t){Yu(e,e.return,t)}}var nl=!1,rl=!1,il=!1,al=typeof WeakSet==`function`?WeakSet:Set,ol=null;function sl(e,t){if(e=e.containerInfo,Wd=dp,e=Dr(e),Or(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Gd={focusedElem:e,selectionRange:n},dp=!1,ol=t;ol!==null;)if(t=ol,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ol=e;else for(;ol!==null;){switch(t=ol,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,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&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=qs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Yu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)sf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:sf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,ol=e;break}ol=t.return}}function cl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Sl(e,n),r&4&&Uc(5,n);break;case 1:if(Sl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Yu(n,n.return,e)}else{var i=qs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Yu(n,n.return,e)}}r&64&&Gc(n),r&512&&qc(n,n.return);break;case 3:if(Sl(e,n),r&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{Xa(e,t)}catch(e){Yu(n,n.return,e)}}break;case 27:t===null&&r&4&&tl(n);case 26:case 5:Sl(e,n),t===null&&r&4&&Yc(n),r&512&&qc(n,n.return);break;case 12:Sl(e,n);break;case 31:Sl(e,n),r&4&&pl(e,n);break;case 13:Sl(e,n),r&4&&ml(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=$u.bind(null,n),pf(e,n))));break;case 22:if(r=n.memoizedState!==null||nl,!r){t=t!==null&&t.memoizedState!==null||rl,i=nl;var a=rl;nl=r,(rl=t)&&!a?wl(e,n,(n.subtreeFlags&8772)!=0):Sl(e,n),nl=i,rl=a}break;case 30:break;default:Sl(e,n)}}function U(e){var t=e.alternate;t!==null&&(e.alternate=null,U(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&vt(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 ll=null,ul=!1;function dl(e,t,n){for(n=n.child;n!==null;)fl(e,t,n),n=n.sibling}function fl(e,t,n){if(P&&typeof P.onCommitFiberUnmount==`function`)try{P.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:rl||Jc(n,t),dl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:rl||Jc(n,t);var r=ll,i=ul;rf(n.type)&&(ll=n.stateNode,ul=!1),dl(e,t,n),yf(n.stateNode),ll=r,ul=i;break;case 5:rl||Jc(n,t);case 6:if(r=ll,i=ul,ll=null,dl(e,t,n),ll=r,ul=i,ll!==null)if(ul)try{(ll.nodeType===9?ll.body:ll.nodeName===`HTML`?ll.ownerDocument.body:ll).removeChild(n.stateNode)}catch(e){Yu(n,t,e)}else try{ll.removeChild(n.stateNode)}catch(e){Yu(n,t,e)}break;case 18:ll!==null&&(ul?(e=ll,af(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Lp(e)):af(ll,n.stateNode));break;case 4:r=ll,i=ul,ll=n.stateNode.containerInfo,ul=!0,dl(e,t,n),ll=r,ul=i;break;case 0:case 11:case 14:case 15:Wc(2,n,t),rl||Wc(4,n,t),dl(e,t,n);break;case 1:rl||(Jc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Kc(n,t,r)),dl(e,t,n);break;case 21:dl(e,t,n);break;case 22:rl=(r=rl)||n.memoizedState!==null,dl(e,t,n),rl=r;break;default:dl(e,t,n)}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Lp(e)}catch(e){Yu(t,t.return,e)}}}function ml(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Lp(e)}catch(e){Yu(t,t.return,e)}}function hl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new al),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new al),t;default:throw Error(i(435,e.tag))}}function gl(e,t){var n=hl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=ed.bind(null,e,t);t.then(r,r)}})}function _l(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(rf(c.type)){ll=c.stateNode,ul=!1;break a}break;case 5:ll=c.stateNode,ul=!1;break a;case 3:case 4:ll=c.stateNode.containerInfo,ul=!0;break a}c=c.return}if(ll===null)throw Error(i(160));fl(o,s,a),ll=null,ul=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yl(t,e),t=t.sibling}var vl=null;function yl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:_l(t,e),bl(e),r&4&&(Wc(3,e,e.return),Uc(3,e),Wc(5,e,e.return));break;case 1:_l(t,e),bl(e),r&512&&(rl||n===null||Jc(n,n.return)),r&64&&nl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=vl;if(_l(t,e),bl(e),r&512&&(rl||n===null||Jc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[_t]||o[ut]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Bd(o,r,n),o[ut]=e,Ct(o),r=o;break a;case`link`:var s=Gf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Gf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ut]=e,Ct(o),r=o}e.stateNode=r}else Kf(a,e.type,e.stateNode);else e.stateNode=Y(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Xc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Kf(a,e.type,e.stateNode):Y(a,r,e.memoizedProps))}break;case 27:_l(t,e),bl(e),r&512&&(rl||n===null||Jc(n,n.return)),n!==null&&r&4&&Xc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(_l(t,e),bl(e),r&512&&(rl||n===null||Jc(n,n.return)),e.flags&32){a=e.stateNode;try{F(a,``)}catch(t){Yu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Xc(e,a,n===null?a:n.memoizedProps)),r&1024&&(il=!0);break;case 6:if(_l(t,e),bl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Yu(e,e.return,t)}}break;case 3:if(Wf=null,a=vl,vl=Sf(t.containerInfo),_l(t,e),vl=a,bl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Lp(t.containerInfo)}catch(t){Yu(e,e.return,t)}il&&(il=!1,xl(e));break;case 4:r=vl,vl=Sf(e.stateNode.containerInfo),_l(t,e),bl(e),vl=r;break;case 12:_l(t,e),bl(e);break;case 31:_l(t,e),bl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 13:_l(t,e),bl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(iu=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=nl,d=rl;if(nl=u||a,rl=d||l,_l(t,e),rl=d,nl=u,bl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||nl||rl||Cl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Yu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Yu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?of(m,!0):of(l.stateNode,!1)}catch(e){Yu(l,l.return,e)}}}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 a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,gl(e,n))));break;case 19:_l(t,e),bl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 30:break;case 21:break;default:_l(t,e),bl(e)}}function bl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Zc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;el(e,Qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(F(o,``),n.flags&=-33),el(e,Qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;$c(e,Qc(e),s);break;default:throw Error(i(161))}}catch(t){Yu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;xl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Sl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)cl(e,t.alternate,t),t=t.sibling}function Cl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Wc(4,t,t.return),Cl(t);break;case 1:Jc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Kc(t,t.return,n),Cl(t);break;case 27:yf(t.stateNode);case 26:case 5:Jc(t,t.return),Cl(t);break;case 22:t.memoizedState===null&&Cl(t);break;case 30:Cl(t);break;default:Cl(t)}e=e.sibling}}function wl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:wl(i,a,n),Uc(4,a);break;case 1:if(wl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Yu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ya(c[i],s)}catch(e){Yu(r,r.return,e)}}n&&o&64&&Gc(a),qc(a,a.return);break;case 27:tl(a);case 26:case 5:wl(i,a,n),n&&r===null&&o&4&&Yc(a),qc(a,a.return);break;case 12:wl(i,a,n);break;case 31:wl(i,a,n),n&&o&4&&pl(i,a);break;case 13:wl(i,a,n),n&&o&4&&ml(i,a);break;case 22:a.memoizedState===null&&wl(i,a,n),qc(a,a.return);break;case 30:break;default:wl(i,a,n)}t=t.sibling}}function Tl(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&&ca(n))}function El(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ca(e))}function Dl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ol(e,t,n,r),t=t.sibling}function Ol(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Dl(e,t,n,r),i&2048&&Uc(9,t);break;case 1:Dl(e,t,n,r);break;case 3:Dl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ca(e)));break;case 12:if(i&2048){Dl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Yu(t,t.return,e)}}else Dl(e,t,n,r);break;case 31:Dl(e,t,n,r);break;case 13:Dl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Dl(e,t,n,r):(a._visibility|=2,kl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Dl(e,t,n,r):Al(e,t),i&2048&&Tl(o,t);break;case 24:Dl(e,t,n,r),i&2048&&El(t.alternate,t);break;default:Dl(e,t,n,r)}}function kl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:kl(a,o,s,c,i),Uc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,kl(a,o,s,c,i)):u._visibility&2?kl(a,o,s,c,i):Al(a,o),i&&l&2048&&Tl(o.alternate,o);break;case 24:kl(a,o,s,c,i),i&&l&2048&&El(o.alternate,o);break;default:kl(a,o,s,c,i)}t=t.sibling}}function Al(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Al(n,r),i&2048&&Tl(r.alternate,r);break;case 24:Al(n,r),i&2048&&El(r.alternate,r);break;default:Al(n,r)}t=t.sibling}}var jl=8192;function Ml(e,t,n){if(e.subtreeFlags&jl)for(e=e.child;e!==null;)Nl(e,t,n),e=e.sibling}function Nl(e,t,n){switch(e.tag){case 26:Ml(e,t,n),e.flags&jl&&e.memoizedState!==null&&Yf(n,vl,e.memoizedState,e.memoizedProps);break;case 5:Ml(e,t,n);break;case 3:case 4:var r=vl;vl=Sf(e.stateNode.containerInfo),Ml(e,t,n),vl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=jl,jl=16777216,Ml(e,t,n),jl=r):Ml(e,t,n));break;default:Ml(e,t,n)}}function Pl(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 Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ol=r,Rl(r,e)}Pl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Il(e),e=e.sibling}function Il(e){switch(e.tag){case 0:case 11:case 15:Fl(e),e.flags&2048&&Wc(9,e,e.return);break;case 3:Fl(e);break;case 12:Fl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ll(e)):Fl(e);break;default:Fl(e)}}function Ll(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ol=r,Rl(r,e)}Pl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Wc(8,t,t.return),Ll(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ll(t));break;default:Ll(t)}e=e.sibling}}function Rl(e,t){for(;ol!==null;){var n=ol;switch(n.tag){case 0:case 11:case 15:Wc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ca(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ol=r;else a:for(n=e;ol!==null;){r=ol;var i=r.sibling,a=r.return;if(U(r),r===n){ol=null;break a}if(i!==null){i.return=a,ol=i;break a}ol=a}}}var zl={getCacheForType:function(e){var t=ea(oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ea(oa).controller.signal}},Bl=typeof WeakMap==`function`?WeakMap:Map,Vl=0,Hl=null,W=null,G=0,Ul=0,Wl=null,Gl=!1,Kl=!1,ql=!1,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=0,eu=0,tu=null,nu=null,ru=!1,iu=0,au=0,ou=1/0,su=null,K=null,cu=0,lu=null,uu=null,du=0,fu=0,pu=null,mu=null,hu=0,gu=null;function _u(){return Vl&2&&G!==0?G&-G:A.T===null?st():gd()}function vu(){if($l===0)if(!(G&536870912)||B){var e=Ke;Ke<<=1,!(Ke&3932160)&&(Ke=262144),$l=e}else $l=536870912;return e=no.current,e!==null&&(e.flags|=32),$l}function yu(e,t,n){(e===Hl&&(Ul===2||Ul===9)||e.cancelPendingCommit!==null)&&(Eu(e,0),Cu(e,G,$l,!1)),et(e,n),(!(Vl&2)||e!==Hl)&&(e===Hl&&(!(Vl&2)&&(Zl|=n),Yl===4&&Cu(e,G,$l,!1)),cd(e))}function bu(e,t,n){if(Vl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Xe(e,t),a=r?Pu(e,t):Mu(e,t,!0),o=r;do{if(a===0){Kl&&!r&&Cu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Su(n)){a=Mu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=tu;var l=c.current.memoizedState.isDehydrated;if(l&&(Eu(c,s).flags|=256),s=Mu(c,s,!1),s!==2){if(ql&&!l){c.errorRecoveryDisabledLanes|=o,Zl|=o,a=4;break a}o=nu,nu=a,o!==null&&(nu===null?nu=o:nu.push.apply(nu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Eu(e,0),Cu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Cu(r,t,$l,!Gl);break a;case 2:nu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=iu+300-De(),10<a)){if(Cu(r,t,$l,!Gl),Ye(r,0,!0)!==0)break a;du=t,r.timeoutHandle=Qd(xu.bind(null,r,n,nu,su,ru,t,$l,Zl,eu,Gl,o,`Throttled`,-0,0),a);break a}xu(r,n,nu,su,ru,t,$l,Zl,eu,Gl,o,null,-0,0)}}break}while(1);cd(e)}function xu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tn},Nl(t,a,d);var m=(a&62914560)===a?iu-De():(a&4194048)===a?au-De():0;if(m=Zf(d,m),m!==null){du=a,e.cancelPendingCommit=m(Vu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Cu(e,a,o,!l);return}}Vu(e,t,a,n,r,i,o,s,c)}function Su(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 r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Cr(a(),i))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 Cu(e,t,n,r){t&=~Ql,t&=~Zl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Re(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&nt(e,n,t)}function wu(){return Vl&6?!0:(ld(0,!1),!1)}function Tu(){if(W!==null){if(Ul===0)var e=W.return;else e=W,Ki=Gi=null,ko(e),ja=null,Ma=0,e=W;for(;e!==null;)Hc(e.alternate,e),e=e.return;W=null}}function Eu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,$d(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),du=0,Tu(),Hl=e,W=n=li(e.current,null),G=t,Ul=0,Wl=null,Gl=!1,Kl=Xe(e,t),ql=!1,eu=$l=Ql=Zl=Xl=Yl=0,nu=tu=null,ru=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Re(r),a=1<<i;t|=e[i],r&=~a}return Jl=t,$r(),n}function Du(e,t){V=null,A.H=zs,t===xa||t===Ca?(t=ka(),Ul=3):t===Sa?(t=ka(),Ul=4):Ul=t===rc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Wl=t,W===null&&(Yl=1,Zs(e,_i(t,e.current)))}function Ou(){var e=no.current;return e===null?!0:(G&4194048)===G?ro===null:(G&62914560)===G||G&536870912?e===ro:!1}function ku(){var e=A.H;return A.H=zs,e===null?zs:e}function Au(){var e=A.A;return A.A=zl,e}function ju(){Yl=4,Gl||(G&4194048)!==G&&no.current!==null||(Kl=!0),!(Xl&134217727)&&!(Zl&134217727)||Hl===null||Cu(Hl,G,$l,!1)}function Mu(e,t,n){var r=Vl;Vl|=2;var i=ku(),a=Au();(Hl!==e||G!==t)&&(su=null,Eu(e,t)),t=!1;var o=Yl;a:do try{if(Ul!==0&&W!==null){var s=W,c=Wl;switch(Ul){case 8:Tu(),o=6;break a;case 3:case 2:case 9:case 6:no.current===null&&(t=!0);var l=Ul;if(Ul=0,Wl=null,Ru(e,s,c,l),n&&Kl){o=0;break a}break;default:l=Ul,Ul=0,Wl=null,Ru(e,s,c,l)}}Nu(),o=Yl;break}catch(t){Du(e,t)}while(1);return t&&e.shellSuspendCounter++,Ki=Gi=null,Vl=r,A.H=i,A.A=a,W===null&&(Hl=null,G=0,$r()),o}function Nu(){for(;W!==null;)Iu(W)}function Pu(e,t){var n=Vl;Vl|=2;var r=ku(),a=Au();Hl!==e||G!==t?(su=null,ou=De()+500,Eu(e,t)):Kl=Xe(e,t);a:do try{if(Ul!==0&&W!==null){t=W;var o=Wl;b:switch(Ul){case 1:Ul=0,Wl=null,Ru(e,t,o,1);break;case 2:case 9:if(Ta(o)){Ul=0,Wl=null,Lu(t);break}t=function(){Ul!==2&&Ul!==9||Hl!==e||(Ul=7),cd(e)},o.then(t,t);break a;case 3:Ul=7;break a;case 4:Ul=5;break a;case 7:Ta(o)?(Ul=0,Wl=null,Lu(t)):(Ul=0,Wl=null,Ru(e,t,o,7));break;case 5:var s=null;switch(W.tag){case 26:s=W.memoizedState;case 5:case 27:var c=W;if(s?Jf(s):c.stateNode.complete){Ul=0,Wl=null;var l=c.sibling;if(l!==null)W=l;else{var u=c.return;u===null?W=null:(W=u,zu(u))}break b}}Ul=0,Wl=null,Ru(e,t,o,5);break;case 6:Ul=0,Wl=null,Ru(e,t,o,6);break;case 8:Tu(),Yl=6;break a;default:throw Error(i(462))}}Fu();break}catch(t){Du(e,t)}while(1);return Ki=Gi=null,A.H=r,A.A=a,Vl=n,W===null?(Hl=null,G=0,$r(),Yl):0}function Fu(){for(;W!==null&&!N();)Iu(W)}function Iu(e){var t=Nc(e.alternate,e,Jl);e.memoizedProps=e.pendingProps,t===null?zu(e):W=t}function Lu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=_c(n,t,t.pendingProps,t.type,void 0,G);break;case 11:t=_c(n,t,t.pendingProps,t.type.render,t.ref,G);break;case 5:ko(t);default:Hc(n,t),t=W=ui(t,Jl),t=Nc(n,t,Jl)}e.memoizedProps=e.pendingProps,t===null?zu(e):W=t}function Ru(e,t,n,r){Ki=Gi=null,ko(t),ja=null,Ma=0;var i=t.return;try{if(nc(e,i,t,n,G)){Yl=1,Zs(e,_i(n,e.current)),W=null;return}}catch(t){if(i!==null)throw W=i,t;Yl=1,Zs(e,_i(n,e.current)),W=null;return}t.flags&32768?(B||r===1?e=!0:Kl||G&536870912?e=!1:(Gl=e=!0,(r===2||r===9||r===3||r===6)&&(r=no.current,r!==null&&r.tag===13&&(r.flags|=16384))),Bu(t,e)):zu(t)}function zu(e){var t=e;do{if(t.flags&32768){Bu(t,Gl);return}e=t.return;var n=Bc(t.alternate,t,Jl);if(n!==null){W=n;return}if(t=t.sibling,t!==null){W=t;return}W=t=e}while(t!==null);Yl===0&&(Yl=5)}function Bu(e,t){do{var n=Vc(e.alternate,e);if(n!==null){n.flags&=32767,W=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){W=e;return}W=e=n}while(e!==null);Yl=6,W=null}function Vu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Ku();while(cu!==0);if(Vl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Qr,tt(e,n,o,s,c,l),e===Hl&&(W=Hl=null,G=0),uu=t,lu=e,du=n,fu=o,pu=a,mu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,td(je,function(){return qu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=A.T,A.T=null,a=j.p,j.p=2,s=Vl,Vl|=4;try{sl(e,t,n)}finally{Vl=s,j.p=a,A.T=r}}cu=1,Hu(),Uu(),Wu()}}function Hu(){if(cu===1){cu=0;var e=lu,t=uu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=A.T,A.T=null;var r=j.p;j.p=2;var i=Vl;Vl|=4;try{yl(t,e);var a=Gd,o=Dr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Er(s.ownerDocument.documentElement,s)){if(c!==null&&Or(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Tr(s,h),v=Tr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}dp=!!Wd,Gd=Wd=null}finally{Vl=i,j.p=r,A.T=n}}e.current=t,cu=2}}function Uu(){if(cu===2){cu=0;var e=lu,t=uu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=A.T,A.T=null;var r=j.p;j.p=2;var i=Vl;Vl|=4;try{cl(e,t.alternate,t)}finally{Vl=i,j.p=r,A.T=n}}cu=3}}function Wu(){if(cu===4||cu===3){cu=0,Ee();var e=lu,t=uu,n=du,r=mu;t.subtreeFlags&10256||t.flags&10256?cu=5:(cu=0,uu=lu=null,Gu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(K=null),ot(n),t=t.stateNode,P&&typeof P.onCommitFiberRoot==`function`)try{P.onCommitFiberRoot(Ie,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=A.T,i=j.p,j.p=2,A.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{A.T=t,j.p=i}}du&3&&Ku(),cd(e),i=e.pendingLanes,n&261930&&i&42?e===gu?hu++:(hu=0,gu=e):hu=0,ld(0,!1)}}function Gu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ca(t)))}function Ku(){return Hu(),Uu(),Wu(),qu()}function qu(){if(cu!==5)return!1;var e=lu,t=fu;fu=0;var n=ot(du),r=A.T,a=j.p;try{j.p=32>n?32:n,A.T=null,n=pu,pu=null;var o=lu,s=du;if(cu=0,uu=lu=null,du=0,Vl&6)throw Error(i(331));var c=Vl;if(Vl|=4,Il(o.current),Ol(o,o.current,s,n),Vl=c,ld(0,!1),P&&typeof P.onPostCommitFiberRoot==`function`)try{P.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{j.p=a,A.T=r,Gu(e,t)}}function Ju(e,t,n){t=_i(n,t),t=$s(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(et(e,2),cd(e))}function Yu(e,t,n){if(e.tag===3)Ju(e,e,n);else for(;t!==null;){if(t.tag===3){Ju(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(K===null||!K.has(r))){e=_i(n,e),n=ec(2),r=Ua(t,n,2),r!==null&&(tc(n,r,t,e),et(r,2),cd(r));break}}t=t.return}}function Xu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Bl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ql=!0,i.add(n),e=Zu.bind(null,e,t,n),t.then(e,e))}function Zu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Hl===e&&(G&n)===n&&(Yl===4||Yl===3&&(G&62914560)===G&&300>De()-iu?!(Vl&2)&&Eu(e,0):Ql|=n,eu===G&&(eu=0)),cd(e)}function Qu(e,t){t===0&&(t=Qe()),e=ni(e,t),e!==null&&(et(e,t),cd(e))}function $u(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Qu(e,n)}function ed(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Qu(e,n)}function td(e,t){return we(e,t)}var nd=null,rd=null,id=!1,ad=!1,od=!1,sd=0;function cd(e){e!==rd&&e.next===null&&(rd===null?nd=rd=e:rd=rd.next=e),ad=!0,id||(id=!0,hd())}function ld(e,t){if(!od&&ad){od=!0;do for(var n=!1,r=nd;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Re(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,md(r,a))}else a=G,a=Ye(r,r===Hl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Xe(r,a)||(n=!0,md(r,a));r=r.next}while(n);od=!1}}function ud(){dd()}function dd(){ad=id=!1;var e=0;sd!==0&&Zd()&&(e=sd);for(var t=De(),n=null,r=nd;r!==null;){var i=r.next,a=fd(r,t);a===0?(r.next=null,n===null?nd=i:n.next=i,i===null&&(rd=n)):(n=r,(e!==0||a&3)&&(ad=!0)),r=i}cu!==0&&cu!==5||ld(e,!1),sd!==0&&(sd=0)}function fd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Re(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ze(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Hl,n=G,n=Ye(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ul===2||Ul===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Te(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Xe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Te(r),ot(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=Ne;break;default:n=je}return r=pd.bind(null,e),n=we(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Te(r),e.callbackPriority=2,e.callbackNode=null,2}function pd(e,t){if(cu!==0&&cu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ku()&&e.callbackNode!==n)return null;var r=G;return r=Ye(e,e===Hl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(bu(e,r,t),fd(e,De()),e.callbackNode!=null&&e.callbackNode===n?pd.bind(null,e):null)}function md(e,t){if(Ku())return null;bu(e,t,!0)}function hd(){tf(function(){Vl&6?we(ke,ud):dd()})}function gd(){if(sd===0){var e=da;e===0&&(e=We,We<<=1,!(We&261888)&&(We=256)),sd=e}return sd}function _d(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:en(``+e)}function vd(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 yd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=_d((i[dt]||null).action),o=r.submitter;o&&(t=(t=o[dt]||null)?_d(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Sn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(sd!==0){var e=o?vd(i,o):new FormData(i);Ts(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?vd(i,o):new FormData(i),Ts(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var bd=0;bd<qr.length;bd++){var xd=qr[bd];Jr(xd.toLowerCase(),`on`+(xd[0].toUpperCase()+xd.slice(1)))}Jr(zr,`onAnimationEnd`),Jr(Br,`onAnimationIteration`),Jr(Vr,`onAnimationStart`),Jr(`dblclick`,`onDoubleClick`),Jr(`focusin`,`onFocus`),Jr(`focusout`,`onBlur`),Jr(Hr,`onTransitionRun`),Jr(Ur,`onTransitionStart`),Jr(Wr,`onTransitionCancel`),Jr(Gr,`onTransitionEnd`),Dt(`onMouseEnter`,[`mouseout`,`mouseover`]),Dt(`onMouseLeave`,[`mouseout`,`mouseover`]),Dt(`onPointerEnter`,[`pointerout`,`pointerover`]),Dt(`onPointerLeave`,[`pointerout`,`pointerover`]),Et(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Et(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Et(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Et(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Et(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Et(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Sd=`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(` `),Cd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Sd));function wd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}}}}function q(e,t){var n=t[pt];n===void 0&&(n=t[pt]=new Set);var r=e+`__bubble`;n.has(r)||(Od(t,e,2,!1),n.add(r))}function Td(e,t,n){var r=0;t&&(r|=4),Od(n,e,r,t)}var Ed=`_reactListening`+Math.random().toString(36).slice(2);function Dd(e){if(!e[Ed]){e[Ed]=!0,wt.forEach(function(t){t!==`selectionchange`&&(Cd.has(t)||Td(t,!1,e),Td(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ed]||(t[Ed]=!0,Td(`selectionchange`,!1,t))}}function Od(e,t,n,r){switch(vp(t)){case 2:var i=fp;break;case 8:i=pp;break;default:i=mp}n=i.bind(null,t,n,e),i=void 0,!fn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function kd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=yt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}ln(function(){var r=a,i=rn(n),s=[];a:{var c=Kr.get(e);if(c!==void 0){var l=Sn,u=e;switch(e){case`keypress`:if(_n(n)===0)break a;case`keydown`:case`keyup`:l=Bn;break;case`focusin`:u=`focus`,l=jn;break;case`focusout`:u=`blur`,l=jn;break;case`beforeblur`:case`afterblur`:l=jn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=An;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Hn;break;case zr:case Br:case Vr:l=Mn;break;case Gr:l=Un;break;case`scroll`:case`scrollend`:l=wn;break;case`wheel`:l=Wn;break;case`copy`:case`cut`:case`paste`:l=Nn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Vn;break;case`toggle`:case`beforetoggle`:l=Gn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=un(m,p),g!=null&&d.push(Ad(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==nn&&(u=n.relatedTarget||n.fromElement)&&(yt(u)||u[ft]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?yt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Vn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:xt(l),h=u==null?c:xt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,yt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Md,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Nd(s,c,l,d,!1),u!==null&&f!==null&&Nd(s,f,u,d,!0)}}a:{if(c=r?xt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=dr;else if(ar(c))if(fr)v=xr;else{v=yr;var y=vr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Zt(r.elementType)&&(v=dr):v=br;if(v&&=v(e,r)){or(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Gt(c,`number`,c.value)}switch(y=r?xt(r):window,e){case`focusin`:(ar(y)||y.contentEditable===`true`)&&(Ar=y,jr=r,Mr=null);break;case`focusout`:Mr=jr=Ar=null;break;case`mousedown`:Nr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Nr=!1,Pr(s,n,i);break;case`selectionchange`:if(kr)break;case`keydown`:case`keyup`:Pr(s,n,i)}var b;if(qn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else tr?$n(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Xn&&n.locale!==`ko`&&(tr||x!==`onCompositionStart`?x===`onCompositionEnd`&&tr&&(b=gn()):(mn=i,hn=`value`in mn?mn.value:mn.textContent,tr=!0)),y=jd(r,x),0<y.length&&(x=new Pn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=er(n),b!==null&&(x.data=b)))),(b=Yn?nr(e,n):rr(e,n))&&(x=jd(r,`onBeforeInput`),0<x.length&&(y=new Pn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),yd(s,e,r,n,i)}wd(s,t)})}function Ad(e,t,n){return{instance:e,listener:t,currentTarget:n}}function jd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=un(e,n),i!=null&&r.unshift(Ad(e,i,a)),i=un(e,t),i!=null&&r.push(Ad(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Md(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Nd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=un(n,a),l!=null&&o.unshift(Ad(n,l,c))):i||(l=un(n,a),l!=null&&o.push(Ad(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Pd=/\r\n?/g,Fd=/\u0000|\uFFFD/g;function Id(e){return(typeof e==`string`?e:``+e).replace(Pd,`
|
|
10
|
+
`).replace(Fd,``)}function Ld(e,t){return t=Id(t),Id(e)===t}function Rd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||F(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&F(e,``+r);break;case`className`:Nt(e,`class`,r);break;case`tabIndex`:Nt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Nt(e,n,r);break;case`style`:Xt(e,r,o);break;case`data`:if(t!==`object`){Nt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`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 o==`function`&&(n===`formAction`?(t!==`input`&&Rd(e,t,`name`,a.name,a,null),Rd(e,t,`formEncType`,a.formEncType,a,null),Rd(e,t,`formMethod`,a.formMethod,a,null),Rd(e,t,`formTarget`,a.formTarget,a,null)):(Rd(e,t,`encType`,a.encType,a,null),Rd(e,t,`method`,a.method,a,null),Rd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`onScroll`:r!=null&&q(`scroll`,e);break;case`onScrollEnd`:r!=null&&q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=en(``+r),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`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:q(`beforetoggle`,e),q(`toggle`,e),Mt(e,`popover`,r);break;case`xlinkActuate`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Mt(e,`is`,r);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,Mt(e,n,r))}}function zd(e,t,n,r,a,o){switch(n){case`style`:Xt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?F(e,r):(typeof r==`number`||typeof r==`bigint`)&&F(e,``+r);break;case`onScroll`:r!=null&&q(`scroll`,e);break;case`onScrollEnd`:r!=null&&q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Tt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[dt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Mt(e,n,r)}}}function Bd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:q(`error`,e),q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Rd(e,t,o,s,n,null)}}a&&Rd(e,t,`srcSet`,n.srcSet,n,null),r&&Rd(e,t,`src`,n.src,n,null);return;case`input`:q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Rd(e,t,r,d,n,null)}}Wt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Rd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Kt(e,!!r,n,!0):Kt(e,!!r,t,!1);return;case`textarea`:for(s in q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Rd(e,t,s,c,n,null)}Jt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Rd(e,t,l,r,n,null)}return;case`dialog`:q(`beforetoggle`,e),q(`toggle`,e),q(`cancel`,e),q(`close`,e);break;case`iframe`:case`object`:q(`load`,e);break;case`video`:case`audio`:for(r=0;r<Sd.length;r++)q(Sd[r],e);break;case`image`:q(`error`,e),q(`load`,e);break;case`details`:q(`toggle`,e);break;case`embed`:case`source`:case`link`:q(`error`,e),q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Rd(e,t,u,r,n,null)}return;default:if(Zt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&zd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Rd(e,t,c,r,n,null))}function Vd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Rd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Rd(e,t,p,m,r,f)}}Ut(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Rd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Rd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Kt(e,!!n,n?[]:``,!1):Kt(e,!!n,t,!0)):Kt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Rd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Rd(e,t,s,a,r,o)}qt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Rd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Rd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Rd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Rd(e,t,u,p,r,m)}return;default:if(Zt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&zd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||zd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Rd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Rd(e,t,f,p,r,m)}function Hd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ud(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Hd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Hd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.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 Wd=null,Gd=null;function Kd(e){return e.nodeType===9?e:e.ownerDocument}function qd(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 Jd(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 Yd(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 Xd=null;function Zd(){var e=window.event;return e&&e.type===`popstate`?e===Xd?!1:(Xd=e,!0):(Xd=null,!1)}var Qd=typeof setTimeout==`function`?setTimeout:void 0,$d=typeof clearTimeout==`function`?clearTimeout:void 0,ef=typeof Promise==`function`?Promise:void 0,tf=typeof queueMicrotask==`function`?queueMicrotask:ef===void 0?Qd:function(e){return ef.resolve(null).then(e).catch(nf)};function nf(e){setTimeout(function(){throw e})}function rf(e){return e===`head`}function af(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Lp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)yf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,yf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[_t]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&yf(e.ownerDocument.body);n=i}while(n);Lp(t)}function of(e,t){var n=e;e=0;do{var r=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||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function sf(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`:sf(n),vt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function cf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[_t])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=mf(e.nextSibling),e===null)break}return null}function lf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=mf(e.nextSibling),e===null))return null;return e}function uf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=mf(e.nextSibling),e===null))return null;return e}function df(e){return e.data===`$?`||e.data===`$~`}function ff(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function pf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function mf(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 hf=null;function gf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return mf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function _f(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 vf(e,t,n){switch(t=Kd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function yf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);vt(e)}var bf=new Map,xf=new Set;function Sf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Cf=j.d;j.d={f:wf,r:Tf,D:Of,C:kf,L:Af,m:jf,X:Nf,S:Mf,M:Pf};function wf(){var e=Cf.f(),t=wu();return e||t}function Tf(e){var t=bt(e);t!==null&&t.tag===5&&t.type===`form`?Ds(t):Cf.r(e)}var Ef=typeof document>`u`?null:document;function Df(e,t,n){var r=Ef;if(r&&typeof t==`string`&&t){var i=Ht(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),xf.has(i)||(xf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Bd(t,`link`,e),Ct(t),r.head.appendChild(t)))}}function Of(e){Cf.D(e),Df(`dns-prefetch`,e,null)}function kf(e,t){Cf.C(e,t),Df(`preconnect`,e,t)}function Af(e,t,n){Cf.L(e,t,n);var r=Ef;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ht(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ht(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ht(n.imageSizes)+`"]`)):i+=`[href="`+Ht(e)+`"]`;var a=i;switch(t){case`style`:a=If(e);break;case`script`:a=zf(e)}bf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),bf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lf(a))||t===`script`&&r.querySelector(Bf(a))||(t=r.createElement(`link`),Bd(t,`link`,e),Ct(t),r.head.appendChild(t)))}}function jf(e,t){Cf.m(e,t);var n=Ef;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ht(r)+`"][href="`+Ht(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zf(e)}if(!bf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),bf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bf(a)))return}r=n.createElement(`link`),Bd(r,`link`,e),Ct(r),n.head.appendChild(r)}}}function Mf(e,t,n){Cf.S(e,t,n);var r=Ef;if(r&&e){var i=St(r).hoistableStyles,a=If(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=bf.get(a))&&Hf(e,n);var c=o=r.createElement(`link`);Ct(c),Bd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nf(e,t){Cf.X(e,t);var n=Ef;if(n&&e){var r=St(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=f({src:e,async:!0},t),(t=bf.get(i))&&Uf(e,t),a=n.createElement(`script`),Ct(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t){Cf.M(e,t);var n=Ef;if(n&&e){var r=St(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=bf.get(i))&&Uf(e,t),a=n.createElement(`script`),Ct(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ff(e,t,n,r){var a=(a=ue.current)?Sf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=If(n.href),n=St(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=If(n.href);var o=St(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Lf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),bf.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},bf.set(e,n),o||J(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=zf(n),n=St(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function If(e){return`href="`+Ht(e)+`"`}function Lf(e){return`link[rel="stylesheet"][`+e+`]`}function Rf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function J(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Bd(t,`link`,n),Ct(t),e.head.appendChild(t))}function zf(e){return`[src="`+Ht(e)+`"]`}function Bf(e){return`script[async]`+e}function Y(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ht(n.href)+`"]`);if(r)return t.instance=r,Ct(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ct(r),Bd(r,`style`,a),Vf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=If(n.href);var o=e.querySelector(Lf(a));if(o)return t.state.loading|=4,t.instance=o,Ct(o),o;r=Rf(n),(a=bf.get(a))&&Hf(r,a),o=(e.ownerDocument||e).createElement(`link`),Ct(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Bd(o,`link`,r),t.state.loading|=4,Vf(o,n.precedence,e),t.instance=o;case`script`:return o=zf(n.src),(a=e.querySelector(Bf(o)))?(t.instance=a,Ct(a),a):(r=n,(a=bf.get(o))&&(r=f({},n),Uf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ct(a),Bd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vf(r,n.precedence,e));return t.instance}function Vf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wf=null;function Gf(e,t,n){if(Wf===null){var r=new Map,i=Wf=new Map;i.set(n,r)}else i=Wf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[_t]||a[ut]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Kf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qf(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;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Yf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=If(r.href),a=t.querySelector(Lf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Qf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ct(a);return}a=t.ownerDocument||t,r=Rf(r),(i=bf.get(i))&&Hf(r,i),a=a.createElement(`link`),Ct(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Bd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Qf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Xf=0;function Zf(e,t){return e.stylesheets&&e.count===0&&ep(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ep(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Xf===0&&(Xf=62500*Ud());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ep(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Xf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Qf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ep(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var $f=null;function ep(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$f=new Map,t.forEach(tp,e),$f=null,Qf.call(e))}function tp(e,t){if(!(t.state.loading&4)){var n=$f.get(e);if(n)var r=n.get(null);else{n=new Map,$f.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Qf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var np={$$typeof:b,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function rp(e,t,n,r,i,a,o,s,c){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=$e(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$e(0),this.hiddenUpdates=$e(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ip(e,t,n,r,i,a,o,s,c,l,u,d){return e=new rp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=si(3,null,null,t),e.current=a,a.stateNode=e,t=sa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ba(a),e}function ap(e){return e?(e=ai,e):ai}function op(e,t,n,r,i,a){i=ap(i),r.context===null?r.context=i:r.pendingContext=i,r=Ha(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ua(e,r,t),n!==null&&(yu(n,e,t),Wa(n,e,t))}function sp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function cp(e,t){sp(e,t),(e=e.alternate)&&sp(e,t)}function lp(e){if(e.tag===13||e.tag===31){var t=ni(e,67108864);t!==null&&yu(t,e,67108864),cp(e,67108864)}}function up(e){if(e.tag===13||e.tag===31){var t=_u();t=at(t);var n=ni(e,t);n!==null&&yu(n,e,t),cp(e,t)}}var dp=!0;function fp(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=2,mp(e,t,n,r)}finally{j.p=a,A.T=i}}function pp(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=8,mp(e,t,n,r)}finally{j.p=a,A.T=i}}function mp(e,t,n,r){if(dp){var i=hp(r);if(i===null)kd(e,t,r,gp,n),Dp(e,r);else if(kp(i,e,t,n,r))r.stopPropagation();else if(Dp(e,r),t&4&&-1<Ep.indexOf(e)){for(;i!==null;){var a=bt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Je(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Re(o);s.entanglements[1]|=c,o&=~c}cd(a),!(Vl&6)&&(ou=De()+500,ld(0,!1))}}break;case 31:case 13:s=ni(a,2),s!==null&&yu(s,a,2),wu(),cp(a,2)}if(a=hp(r),a===null&&kd(e,t,r,gp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else kd(e,t,r,null,n)}}function hp(e){return e=rn(e),_p(e)}var gp=null;function _p(e){if(gp=null,e=yt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 gp=e,null}function vp(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(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var yp=!1,bp=null,xp=null,Sp=null,Cp=new Map,wp=new Map,Tp=[],Ep=`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 Dp(e,t){switch(e){case`focusin`:case`focusout`:bp=null;break;case`dragenter`:case`dragleave`:xp=null;break;case`mouseover`:case`mouseout`:Sp=null;break;case`pointerover`:case`pointerout`:Cp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:wp.delete(t.pointerId)}}function Op(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=bt(t),t!==null&&lp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function kp(e,t,n,r,i){switch(t){case`focusin`:return bp=Op(bp,e,t,n,r,i),!0;case`dragenter`:return xp=Op(xp,e,t,n,r,i),!0;case`mouseover`:return Sp=Op(Sp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Cp.set(a,Op(Cp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,wp.set(a,Op(wp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ap(e){var t=yt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ct(e.priority,function(){up(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ct(e.priority,function(){up(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 jp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=hp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nn=r,n.target.dispatchEvent(r),nn=null}else return t=bt(n),t!==null&&lp(t),e.blockedOn=n,!1;t.shift()}return!0}function Mp(e,t,n){jp(e)&&n.delete(t)}function Np(){yp=!1,bp!==null&&jp(bp)&&(bp=null),xp!==null&&jp(xp)&&(xp=null),Sp!==null&&jp(Sp)&&(Sp=null),Cp.forEach(Mp),wp.forEach(Mp)}function Pp(e,n){e.blockedOn===n&&(e.blockedOn=null,yp||(yp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Np)))}var Fp=null;function Ip(e){Fp!==e&&(Fp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Fp===e&&(Fp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(_p(r||n)===null)continue;break}var a=bt(n);a!==null&&(e.splice(t,3),t-=3,Ts(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Lp(e){function t(t){return Pp(t,e)}bp!==null&&Pp(bp,e),xp!==null&&Pp(xp,e),Sp!==null&&Pp(Sp,e),Cp.forEach(t),wp.forEach(t);for(var n=0;n<Tp.length;n++){var r=Tp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Tp.length&&(n=Tp[0],n.blockedOn===null);)Ap(n),n.blockedOn===null&&Tp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[dt]||null;if(typeof a==`function`)o||Ip(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[dt]||null)s=o.formAction;else if(_p(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Ip(n)}}}function Rp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function zp(e){this._internalRoot=e}Bp.prototype.render=zp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;op(n,_u(),e,t,null,null)},Bp.prototype.unmount=zp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;op(e.current,2,null,e,null,null),wu(),t[ft]=null}};function Bp(e){this._internalRoot=e}Bp.prototype.unstable_scheduleHydration=function(e){if(e){var t=st();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Tp.length&&t!==0&&t<Tp[n].priority;n++);Tp.splice(n,0,e),n===0&&Ap(e)}};var Vp=n.version;if(Vp!==`19.2.4`)throw Error(i(527,Vp,`19.2.4`));j.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Hp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:A,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Up=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Up.isDisabled&&Up.supportsFiber)try{Ie=Up.inject(Hp),P=Up}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Js,s=Ys,c=Xs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ip(e,1,!1,null,null,n,r,null,o,s,c,Rp),e[ft]=t.current,Dd(e),new zp(t)}})),qe=P(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ke()})),Je=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ye=new class extends Je{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Xe={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ze=new class{#e=Xe;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Qe(e){setTimeout(e,0)}var $e=typeof window>`u`||`Deno`in globalThis;function et(){}function tt(e,t){return typeof e==`function`?e(t):e}function nt(e){return typeof e==`number`&&e>=0&&e!==1/0}function rt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function it(e,t){return typeof e==`function`?e(t):e}function at(e,t){return typeof e==`function`?e(t):e}function ot(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ct(o,t.options))return!1}else if(!ut(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function st(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(lt(t.options.mutationKey)!==lt(a))return!1}else if(!ut(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ct(e,t){return(t?.queryKeyHashFn||lt)(e)}function lt(e){return JSON.stringify(e,(e,t)=>mt(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ut(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>ut(e[n],t[n])):!1}var dt=Object.prototype.hasOwnProperty;function ft(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=pt(e)&&pt(t);if(!r&&!(mt(e)&&mt(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:dt.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ft(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function pt(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function mt(e){if(!ht(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ht(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ht(e){return Object.prototype.toString.call(e)===`[object Object]`}function gt(e){return new Promise(t=>{Ze.setTimeout(t,e)})}function _t(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ft(e,t)}function vt(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function yt(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var bt=Symbol();function xt(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===bt?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function St(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Ct=(()=>{let e=()=>$e;return{isServer(){return e()},setIsServer(t){e=t}}})();function wt(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Tt=Qe;function Et(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Tt,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Dt=Et(),Ot=new class extends Je{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function kt(e){return Math.min(1e3*2**e,3e4)}function At(e){return(e??`online`)===`online`?Ot.isOnline():!0}var jt=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Mt(e){let t=!1,n=0,r,i=wt(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new jt(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Ye.isFocused()&&(e.networkMode===`always`||Ot.isOnline())&&e.canRun(),u=()=>At(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Ct.isServer()?0:3),o=e.retryDelay??kt,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),gt(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Nt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nt(this.gcTime)&&(this.#e=Ze.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ct.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(Ze.clearTimeout(this.#e),void 0)}},Pt=class extends Nt{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Lt(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Lt(this.options);e.data!==void 0&&(this.setState(It(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=_t(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(et).catch(et):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>at(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===bt||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>it(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!rt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=xt(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=Mt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof jt&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof jt){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ft(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...It(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),Dt.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function Ft(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:At(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function It(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Lt(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}function Rt(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{St(e,()=>t.signal,()=>n=!0)},u=xt(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?yt:vt;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Bt:zt,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:zt(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function zt(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Bt(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Vt=class extends Nt{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ht(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Mt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),Dt.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ht(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ut=class extends Je{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Vt({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Wt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Wt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Wt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Wt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Dt.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>st(t,e))}findAll(e={}){return this.getAll().filter(t=>st(e,t))}notify(e){Dt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Dt.batch(()=>Promise.all(e.map(e=>e.continue().catch(et))))}};function Wt(e){return e.options.scope?.id}var Gt=class extends Je{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ct(r,t),a=this.get(i);return a||(a=new Pt({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Dt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ot(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ot(e,t)):t}notify(e){Dt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Dt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Dt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Kt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Gt,this.#t=e.mutationCache||new Ut,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Ye.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Ot.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(it(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=tt(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Dt.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Dt.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Dt.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Dt.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(et).catch(et)}invalidateQueries(e,t={}){return Dt.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Dt.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(et)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(et)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(it(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(et).catch(et)}fetchInfiniteQuery(e){return e.behavior=Rt(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(et).catch(et)}ensureInfiniteQueryData(e){return e.behavior=Rt(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ot.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(lt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ut(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(lt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ut(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ct(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===bt&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},qt=P((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Jt=P(((e,t)=>{t.exports=qt()})),F=ze(Ue(),1),I=Jt(),Yt=F.createContext(void 0),Xt=({client:e,children:t})=>(F.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,I.jsx)(Yt.Provider,{value:e,children:t}));F.use;var Zt=typeof window<`u`?F.useLayoutEffect:F.useEffect;function Qt(e){let t=F.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function $t(e,t,n={},r={}){F.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function en(e){let t=F.useRef(null);return F.useImperativeHandle(e,()=>t.current,[]),t}function tn(e){return e[e.length-1]}function nn(e){return typeof e==`function`}function rn(e,t){return nn(e)?e(t):e}var an=Object.prototype.hasOwnProperty,on=Object.prototype.propertyIsEnumerable,sn=()=>Object.create(null),cn=(e,t)=>ln(e,t,sn);function ln(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=pn(e)&&pn(i);if(!a&&!(dn(e)&&dn(i)))return i;let o=a?e:un(e);if(!o)return i;let s=a?i:un(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:an.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=ln(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function un(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!on.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!on.call(e,t))return!1;r.push(t)}return r}function dn(e){if(!fn(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!fn(n)||!n.hasOwnProperty(`isPrototypeOf`))}function fn(e){return Object.prototype.toString.call(e)===`[object Object]`}function pn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function mn(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!mn(e[r],t[r],n))return!1;return!0}if(dn(e)&&dn(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!mn(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!mn(e[o],t[o],n)))return!1;return i===a}return!1}function hn(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function L(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function gn(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function _n(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return gn(t)}var vn=[`http:`,`https:`,`mailto:`,`tel:`];function yn(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}var bn={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},xn=/[&><\u2028\u2029]/g;function Sn(e){return e.replace(xn,e=>bn[e])}function Cn(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=_n(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=_n(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function wn(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Tn(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var En=!0,Dn=`Invariant failed`;function On(e,t){if(!e){if(En)throw Error(Dn);var n=typeof t==`function`?t():t,r=n?`${Dn}: ${n}`:Dn;throw Error(r)}}var kn=4,An=5;function jn(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function Mn(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=jn(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Nn(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;s<o;){let e=Mn(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=In(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=In(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Ln(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Ln(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=Ln(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=In(n.fullPath??n.from);e.kind=An,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=In(n.fullPath??n.from);e.kind=kn,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=n.options?.params?.parse??null,i.skipOnParamError=l,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)Nn(e,t,r,s,i,a,o)}function Pn(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Fn(e){if(e.pathless)for(let t of e.pathless)Fn(t);if(e.static)for(let t of e.static.values())Fn(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())Fn(t);if(e.dynamic?.length){e.dynamic.sort(Pn);for(let t of e.dynamic)Fn(t)}if(e.optional?.length){e.optional.sort(Pn);for(let t of e.optional)Fn(t)}if(e.wildcard?.length){e.wildcard.sort(Pn);for(let t of e.wildcard)Fn(t)}}function In(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Ln(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function Rn(e,t){let n=In(`/`),r=new Uint16Array(6);for(let t of e)Nn(!1,r,t,1,n,0);Fn(n),t.masksTree=n,t.flatCache=Tn(1e3)}function zn(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Wn(e,t.masksTree);return t.flatCache.set(e,r),r}function Bn(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=In(`/`),Nn(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Wn(r,o,n)}function Vn(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Wn(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Kn(a.route)),t.matchCache.set(r,a),a}function Hn(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Un(e,t=!1,n){let r=In(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return Nn(t,i,e,1,r,0,e=>{if(n?.(e,s),On(!(e.id in a),`Duplicate routes found with id: ${String(e.id)}`),a[e.id]=e,s!==0&&e.path){let t=Hn(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),Fn(r),{processedTree:{segmentTree:r,singleCache:Tn(1e3),matchCache:Tn(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Wn(e,t,n=!1){let r=e.split(`/`),i=Jn(e,r,t,n);if(!i)return null;let[a]=Gn(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function Gn(e,t,n){let r=qn(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===kn)break;if(u.kind===An){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Kn(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function qn(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Jn(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!tn(t),a=i&&e!==`/`,o=t.length-(i?1:0),s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let n=s.pop(),{node:i,index:d,skipped:f,depth:p,statics:m,dynamics:h,optionals:g}=n,{extract:_,rawParams:v,parsedParams:y}=n;if(i.skipOnParamError){if(!Yn(e,t,n))continue;v=n.rawParams,_=n.extract,y=n.parsedParams}r&&i.route&&i.kind!==kn&&Xn(l,n)&&(l=n);let b=d===o;if(b&&(i.route&&!a&&Xn(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let x=b?void 0:t[d],S;if(b&&i.index){let n={node:i.index,index:d,skipped:f,depth:p+1,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y},r=!0;if(i.index.skipOnParamError&&(Yn(e,t,n)||(r=!1)),r){if(m===o&&!h&&!g&&!f)return n;Xn(u,n)&&(u=n)}}if(i.wildcard&&Xn(c,n))for(let n of i.wildcard){let{prefix:r,suffix:i}=n;if(r&&(b||!(n.caseSensitive?x:S??=x.toLowerCase()).startsWith(r)))continue;if(i){if(b)continue;let e=t.slice(d).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let a={node:n,index:o,skipped:f,depth:p,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y};if(!(n.skipOnParamError&&!Yn(e,t,a))){c=a;break}}if(i.optional){let e=f|1<<p,t=p+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:d,skipped:e,depth:t,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?x:S??=x.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:d+1,skipped:f,depth:t,statics:m,dynamics:h,optionals:g+1,extract:_,rawParams:v,parsedParams:y})}}if(!b&&i.dynamic&&x)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?x:S??=x.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:d+1,skipped:f,depth:p+1,statics:m,dynamics:h+1,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.staticInsensitive){let e=i.staticInsensitive.get(S??=x.toLowerCase());e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.static){let e=i.static.get(x);e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(i.pathless){let e=p+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:d,skipped:f,depth:e,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}}}if(u&&c)return Xn(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function Yn(e,t,n){try{let[r,i]=Gn(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function Xn(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===kn)>(e.node.kind===kn)||t.node.kind===kn==(e.node.kind===kn)&&t.depth>e.depth))):!0}function Zn(e){return Qn(e.filter(e=>e!==void 0).join(`/`))}function Qn(e){return e.replace(/\/{2,}/g,`/`)}function $n(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function er(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function tr(e){return er($n(e))}function nr(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function rr(e,t,n){return nr(e,n)===nr(t,n)}function ir({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&tn(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(tn(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=Mn(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=Qn(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function ar(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function or(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>cr(e,n)).join(`/`):cr(r,n):r}function sr({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=Mn(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=or(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=or(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=or(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function cr(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function lr(e){return!!e?.isNotFound}function ur(){try{if(typeof window<`u`&&typeof window.sessionStorage==`object`)return window.sessionStorage}catch{}}var dr=`tsr-scroll-restoration-v1_3`,fr=(e,t)=>{let n;return(...r)=>{n||=setTimeout(()=>{e(...r),n=null},t)}};function pr(){let e=ur();if(!e)return null;let t=e.getItem(dr),n=t?JSON.parse(t):{};return{state:n,set:t=>{n=rn(t,n)||n;try{e.setItem(dr,JSON.stringify(n))}catch{console.warn(`[ts-router] Could not persist scroll restoration state to sessionStorage.`)}}}}var mr=pr(),hr=e=>e.state.__TSR_key||e.href;function gr(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var _r=!1;function vr({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||`{}`)}catch(e){console.error(e);return}let s=t||window.history.state?.__TSR_key,c=o[s];_r=!0;scroll:{if(r&&c&&Object.keys(c).length>0){for(let e in c){let t=c[e];if(e===`window`)window.scrollTo({top:t.scrollY,left:t.scrollX,behavior:n});else if(e){let n=document.querySelector(e);n&&(n.scrollLeft=t.scrollX,n.scrollTop=t.scrollY)}}break scroll}let e=(a??window.location).hash.split(`#`,2)[1];if(e){let t=window.history.state?.__hashScrollIntoViewOptions??!0;if(t){let n=document.getElementById(e);n&&n.scrollIntoView(t)}break scroll}let t={top:0,left:0,behavior:n};if(window.scrollTo(t),i)for(let e of i){if(e===`window`)continue;let n=typeof e==`function`?e():document.querySelector(e);n&&n.scrollTo(t)}}_r=!1}function yr(e,t){if(!mr||((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!mr))return;e.isScrollRestorationSetup=!0,_r=!1;let n=e.options.getScrollRestorationKey||hr;window.history.scrollRestoration=`manual`,typeof document<`u`&&document.addEventListener(`scroll`,fr(t=>{if(_r||!e.isScrollRestoring)return;let r=``;if(t.target===document||t.target===window)r=`window`;else{let e=t.target.getAttribute(`data-scroll-restoration-id`);r=e?`[data-scroll-restoration-id="${e}"]`:gr(t.target)}let i=n(e.state.location);mr.set(e=>{let t=e[i]||={},n=t[r]||={};if(r===`window`)n.scrollX=window.scrollX||0,n.scrollY=window.scrollY||0;else if(r){let e=document.querySelector(r);e&&(n.scrollX=e.scrollLeft||0,n.scrollY=e.scrollTop||0)}return e})},100),!0),e.subscribe(`onRendered`,t=>{let r=n(t.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation})||(vr({storageKey:dr,key:r,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&mr.set(e=>(e[r]||={},e)))})}function br(e){if(typeof document<`u`&&document.querySelector){let t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==``){let n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function xr(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Sr(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Cr(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Sr(r):Array.isArray(t)?t.push(Sr(r)):n[e]=[t,Sr(r)]}return n}var R=Tr(JSON.parse),wr=Er(JSON.stringify,JSON.parse);function Tr(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Cr(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Er(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=xr(e,r);return t?`?${t}`:``}}var Dr=`__root__`;function Or(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function kr(e){return e instanceof Response&&!!e.options}function Ar(e){return{input:({url:t})=>{for(let n of e)t=Mr(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Nr(e[n],t);return t}}}function jr(e){let t=tr(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Zn([`/`,t,e.pathname]),e)}}function Mr(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Nr(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}var Pr=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(Pr||{});function Fr({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}var z=0,Ir=0,Lr=0,Rr=[],{link:zr,unlink:Br,propagate:Vr,checkDirty:Hr,shallowPropagate:Ur}=Fr({update(e){return e.depsTail===void 0?Jr(e):qr(e)},notify(e){let t=Lr,n=t;do if(Rr[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Lr=t;n<--t;){let e=Rr[n];Rr[n++]=Rr[t],Rr[t]=e}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Qr(e)):Zr.call(e)}});function Wr(){return z}function Gr(){++z}function Kr(){--z||Xr()}function qr(e){e.depsTail=void 0,e.flags=5;try{let t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Qr(e)}}function Jr(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Yr(e){let t=e.flags;if(t&16||t&32&&Hr(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Qr(e)}}else e.flags=2}function Xr(){try{for(;Ir<Lr;){let e=Rr[Ir];Rr[Ir++]=void 0,Yr(e)}}finally{for(;Ir<Lr;){let e=Rr[Ir];Rr[Ir++]=void 0,e.flags|=10}Ir=0,Lr=0}}function Zr(){this.depsTail=void 0,this.flags=0,Qr(this);let e=this.subs;e!==void 0&&Br(e)}function Qr(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Br(n,e)}function $r(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var ei=[],ti=0,{link:ni,unlink:ri,propagate:ii,checkDirty:ai,shallowPropagate:oi}=Fr({update(e){return e._update()},notify(e){ei[ci++]=e,e.flags&=~Pr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Pr.Mutable|Pr.Dirty,ui(e))}}),si=0,ci=0,li;function ui(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=ri(n,e)}function di(){if(!(Wr()>0)){for(;si<ci;){let e=ei[si];ei[si++]=void 0,e.notify()}si=0,ci=0}}function fi(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Pr.None:Pr.Mutable,get(){return li!==void 0&&ni(i,li,ti),i._snapshot},subscribe(e){let t=$r(e),n={current:!1},r=pi(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=li,o=t?.compare??Object.is;if(n)li=i,++ti,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=Pr.Mutable|Pr.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{li=a,n&&(i.flags&=~Pr.RecursedCheck),ui(i)}}};return n?(i.flags=Pr.Mutable|Pr.Dirty,i.get=function(){let e=i.flags;if(e&Pr.Dirty||e&Pr.Pending&&ai(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&oi(e)}}else e&Pr.Pending&&(i.flags=e&~Pr.Pending);return li!==void 0&&ni(i,li,ti),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(ii(e),oi(e),di())}},i}function pi(e){let t=()=>{let t=li;li=n,++ti,n.depsTail=void 0,n.flags=Pr.Watching|Pr.RecursedCheck;try{return e()}finally{li=t,n.flags&=~Pr.RecursedCheck,ui(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Pr.Watching|Pr.RecursedCheck,notify(){let e=this.flags;e&Pr.Dirty||e&Pr.Pending&&ai(this.deps,this)?t():this.flags=Pr.Watching},stop(){this.flags=Pr.None,this.depsTail=void 0,ui(this)}};return t(),n}var mi=class{constructor(e){this.atom=fi(e)}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe($r(e))}},hi=class{constructor(e){this.atom=fi(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe($r(e))}};function gi(e){return typeof e==`function`?new hi(e):new mi(e)}function _i(e){try{Gr(),e()}finally{Kr(),di()}}function vi(e){let t;return _i(()=>{t=e()}),t}var yi=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},bi=(e,t)=>!!(e.preload&&!e.router.state.matches.some(e=>e.id===t)),xi=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Si=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},Ci=(e,t,n)=>{if(!(!kr(n)&&!lr(n)))throw kr(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:kr(n)?`redirected`:r.status===`pending`?`success`:r.status,context:xi(e,t.index),isFetching:!1,error:n})),lr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),kr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},wi=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Ti=(e,t,n)=>{let r=xi(e,n);e.updateMatch(t,e=>({...e,context:r}))},Ei=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Ci(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,Ci(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!kr(n)&&!lr(n)&&(e.serialError??=n)},Di=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!bi(e,t)&&(n.options.loader||n.options.beforeLoad||Li(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{yi(e)},i);r._nonReactive.pendingTimeout=t}},Oi=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Di(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&Ci(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},ki=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=hn(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Ei(e,n,o,`PARSE_PARAMS`),s&&Ei(e,n,s,`VALIDATE_SEARCH`),Di(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){vi(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=hn();let f={...xi(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=bi(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){vi(()=>{u(),d()});return}(kr(r)||lr(r))&&(u(),Ei(e,n,r,`BEFORE_LOAD`)),vi(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),L(y))return u(),y.catch(t=>{Ei(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),Ei(e,n,t,`BEFORE_LOAD`)}v(y)},Ai=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>ki(e,n,t,i),s=()=>{if(wi(e,n))return;let t=Oi(e,n,i);return L(t)?t.then(o):o()};return a()},ji=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Mi=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=xi(e,r),d=bi(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},Ni=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{Ii(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(Mi(e,t,n,r,i)),l=!!s&&L(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;Ci(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:xi(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:xi(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,lr(t)&&await i.options.notFoundComponent?.preload?.(),Ci(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,Ci(e,e.router.getMatch(n),t)}!kr(o)&&!lr(o)&&await Ii(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:xi(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),Ci(e,r,t)}},B=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(Mi(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await Ni(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){kr(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await Ni(e,t,i,n,d):Ti(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(wi(e,i)){if(!e.router.getMatch(i))return e.matches[n];Ti(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.state.matches[n]?.routeId===a?e.router.state.matches[n].id:e.router.state.matches.find(e=>e.routeId===a)?.id,s=bi(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&Ci(e,n,a),n.status===`pending`&&await r(s,t,o,n,c)}else{let n=s&&!e.router.state.matches.some(e=>e.id===i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=hn(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(s,t,o,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function Pi(e){let t=e,n=[];t.router.state.matches.some(e=>e._forcePending)&&yi(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=Ai(t,e);L(n)&&await n}catch(e){if(kr(e))throw e;if(lr(e))r=e;else if(!t.preload)throw e;break}if(t.serialError)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?Si(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(B(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(kr(e))throw e;lr(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!l&&r&&t.preload)return t.matches;if(l){let e=Si(t,l);On(e!==void 0,`Could not find match for notFound boundary`);let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await Ii(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Ii(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=ji(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=yi(t);if(L(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Fi(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Ii(e,t=Ri){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===Ri?(()=>{if(e._componentsPromise===void 0){let t=Fi(e,Ri);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Fi(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Li(e){for(let t of Ri)if(e.options[t]?.preload)return!0;return!1}var Ri=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],zi=`__TSR_index`,Bi=`popstate`,Vi=`beforeunload`;function Hi(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Ki(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[zi];i=Ui(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[zi];i=Ui(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[zi]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Ui(e,t){t||={};let n=qi();return{...t,key:n,__TSR_key:n,[zi]:e}}function Wi(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Ki(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=qi();t.history.replaceState({[zi]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Ki(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[zi]-l.state[zi],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=Hi({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Vi,S,{capture:!0}),t.removeEventListener(Bi,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Vi,S,{capture:!0}),t.addEventListener(Bi,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function Gi(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Ki(e,t){let n=Gi(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=qi();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[zi]:0,key:a,__TSR_key:a}}}function qi(){return(Math.random()+1).toString(36).substring(7)}function Ji(e){let t=e.resolvedLocation,n=e.location;return{fromLocation:t,toLocation:n,pathChanged:t?.pathname!==n.pathname,hrefChanged:t?.href!==n.href,hashChanged:t?.hash!==n.hash}}function Yi(e){let t=e.filter(e=>e.status!==`redirected`);return t.length===e.length?e:t}var Xi=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=ar(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Wi()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Tn(1e3),e=this.buildRouteTree(),this.setRoutes(e)}!this.__store&&this.latestLocation&&(this.__store=gi($i(this.latestLocation)),yr(this));let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=tr(o);t&&t!==`/`&&e.push(jr({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Ar(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&this.__store.setState(e=>({...e,location:this.latestLocation})),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Un(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Rn(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let o=this.options.parseSearch(n),s=this.options.stringifySearch(o);return{href:e+s+r,publicHref:i,pathname:Cn(e).path,external:!1,searchStr:s,search:cn(t?.search,o),hash:Cn(r.slice(1)).path,state:ln(t?.state,a)}}let o=new URL(i,this.origin),s=Mr(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:Cn(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:cn(t?.search,c),hash:Cn(s.hash.slice(1)).path,state:ln(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>ir({base:e,to:Qn(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>ta({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{let e=this.state.matches.filter(e=>e.status===`pending`),t=this.state.matches.filter(e=>e.isFetching===`loader`);new Set([...this.state.pendingMatches??[],...e,...t]).forEach(e=>{this.cancelMatch(e.id)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,s=Object.assign(Object.create(null),r.params),c=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),l=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,rn(t.params,s)),u=this.getMatchedRoutes(c),d=u.matchedRoutes;if((!u.foundRoute||u.foundRoute.path!==`/`&&u.routeParams[`**`])&&this.options.notFoundRoute&&(d=[...d,this.options.notFoundRoute]),Object.keys(l).length>0)for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(l,t(l))}catch{}}let f=e.leaveParams?c:Cn(sr({path:c,params:l,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,p=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,ea(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=na({search:p,dest:t,destRoutes:d,_includeValidateSearch:e._includeValidateSearch}),p=cn(o,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?rn(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?rn(t.state,n.state):{};_=ln(n.state,_);let v=`${f}${m}${g}`,y,b,x=!1;if(this.rewrite){let e=new URL(v,this.origin),t=Nr(this.rewrite,e);y=e.href.replace(e.origin,``),t.origin===this.origin?b=t.pathname+t.search+t.hash:(b=t.href,x=!0)}else y=wn(v),b=y;return{publicHref:b,href:y,pathname:f,search:p,searchStr:m,state:_,hash:h??``,external:x,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=zn(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,rn(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=mn(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=er(this.latestLocation.href)===er(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=hn(()=>{a?.resolve(),a=void 0}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Ki(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Mr(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(yn(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation);this.__store.setState(t=>({...t,status:`pending`,statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:t.cachedMatches.filter(t=>!e.some(e=>e.id===t.id))}))},this.load=async e=>{let t,n,r,i=this.state.resolvedLocation??this.state.location;for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=this.state.resolvedLocation;this.state.redirect||this.emit({type:`onBeforeNavigate`,...Ji({resolvedLocation:n,location:t})}),this.emit({type:`onBeforeLoad`,...Ji({resolvedLocation:n,location:t})}),await Pi({router:this,sync:e?.sync,forceStaleReload:i.href===t.href,matches:this.state.pendingMatches,location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=[],t=[],n=[],r=[];vi(()=>{this.__store.setState(i=>{let a=i.matches,o=i.pendingMatches||i.matches;return e=a.filter(e=>!o.some(t=>t.id===e.id)),t=a.filter(e=>!o.some(t=>t.routeId===e.routeId)),n=o.filter(e=>!a.some(t=>t.routeId===e.routeId)),r=o.filter(e=>a.some(t=>t.routeId===e.routeId)),{...i,isLoading:!1,loadedAt:Date.now(),matches:o,pendingMatches:void 0,cachedMatches:[...i.cachedMatches,...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]}}),this.clearExpiredCache()}),[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]].forEach(([e,t])=>{e.forEach(e=>{this.looseRoutesById[e.routeId].options[t]?.(e)})})})})}})}catch(e){kr(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):lr(e)&&(n=e),this.__store.setState(e=>({...e,statusCode:t?t.status:n?404:e.matches.some(e=>e.status===`error`)?500:200,redirect:t}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(e=>e.status===`error`)&&(a=500),a!==void 0&&this.__store.setState(e=>({...e,statusCode:a}))},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.state.resolvedLocation,a=typeof t.types==`function`?t.types(Ji({resolvedLocation:i,location:r})):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.state.pendingMatches?.some(t=>t.id===e)?`pendingMatches`:this.state.matches.some(t=>t.id===e)?`matches`:this.state.cachedMatches.some(t=>t.id===e)?`cachedMatches`:``;n&&(n===`cachedMatches`?this.__store.setState(n=>({...n,cachedMatches:Yi(n.cachedMatches.map(n=>n.id===e?t(n):n))})):this.__store.setState(r=>({...r,[n]:r[n]?.map(n=>n.id===e?t(n):n)})))})},this.getMatch=e=>{let t=t=>t.id===e;return this.state.cachedMatches.find(t)??this.state.pendingMatches?.find(t)??this.state.matches.find(t)},this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.__store.setState(e=>({...e,matches:e.matches.map(t),cachedMatches:e.cachedMatches.map(t),pendingMatches:e.pendingMatches?.map(t)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&yn(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.__store.setState(e=>({...e,cachedMatches:[]})):this.__store.setState(e=>({...e,cachedMatches:e.cachedMatches.filter(e=>!t(e))}))},this.clearExpiredCache=()=>{this.clearCache({filter:e=>{let t=this.looseRoutesById[e.routeId];if(!t.options.loader)return!0;let n=(e.preload?t.options.preloadGcTime??this.options.defaultPreloadGcTime:t.options.gcTime??this.options.defaultGcTime)??300*1e3;return e.status===`error`?!0:Date.now()-e.updatedAt>=n}})},this.loadRouteChunk=Ii,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(e=>e.id)),i=new Set([...r,...this.state.cachedMatches.map(e=>e.id)]);vi(()=>{n.forEach(e=>{i.has(e.id)||this.__store.setState(t=>({...t,cachedMatches:[...t.cachedMatches,e]}))})});try{return n=await Pi({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(kr(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});lr(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.state.status!==`pending`)return!1;let i=(t?.pending===void 0?!this.state.isLoading:t.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=Bn(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!mn(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?mn(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status===`notFound`||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??wr,parseSearch:e.parseSearch??R,protocolAllowlist:e.protocolAllowlist??vn}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:o}=n,s=!1;(r?r.path!==`/`&&i[`**`]:er(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?ia(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map(this.state.matches.map(e=>[e.routeId,e]));for(let n=0;n<o.length;n++){let r=o[n],s=l[n-1],d,f,p;{let n=s?.search??e.search,i=s?._strictSearch??void 0;try{let e=ea(r.options.validateSearch,{...n})??void 0;d={...n,...e},f={...i,...e},p=void 0}catch(e){let r=e;if(e instanceof Zi||(r=new Zi(e.message,{cause:e})),t?.throwOnError)throw r;d=n,f={},p=r}}let m=r.options.loaderDeps?.({search:d})??``,h=m?JSON.stringify(m):``,{interpolatedPath:g,usedParams:_}=sr({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),v=r.id+g+h,y=this.getMatch(v),b=u.get(r.id),x=y?._strictParams??_,S;if(!y)try{aa(r,_,a,x)}catch(e){if(S=lr(e)||kr(e)?e:new Qi(e.message,{cause:e}),t?.throwOnError)throw S}Object.assign(i,x);let C=b?`stay`:`enter`,w;if(y)w={...y,cause:C,params:b?.params??i,_strictParams:x,search:cn(b?b.search:y.search,d),_strictSearch:f};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Li(r)?`pending`:`success`;w={id:v,ssr:r.options.ssr,index:n,routeId:r.id,params:b?.params??i,_strictParams:x,pathname:g,updatedAt:Date.now(),search:b?cn(b.search,d):d,_strictSearch:f,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:S,__routeContext:void 0,_nonReactive:{loadPromise:hn()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:b?ln(b.loaderDeps,m):m,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(w.globalNotFound=c===r.id),w.searchError=p;let T=this.getParentContext(s);w.context={...T,...w.__routeContext,...w.__beforeLoadContext},l[n]=w}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?cn(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=tn(t),a={...e.search};for(let e of t)try{Object.assign(a,ea(e.options.validateSearch,a))}catch{}let o=tn(this.state.matches),s=o&&o.routeId===i.id&&e.pathname===this.state.location.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let i of t)try{aa(i,n,r??{},e)}catch{}c=e}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:c}}},Zi=class extends Error{},Qi=class extends Error{};function $i(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function ea(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Zi(`Async validation not supported`);if(n.issues)throw new Zi(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function ta({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=er(e),a,o,s=Vn(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign(Object.create(null),s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function na({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return ra(n)(e,t,r??!1)}function ra(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...ea(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:rn(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function ia(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return Dr}function aa(e,t,n,r){let i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=i(r);Object.assign(r,e)}}var oa=`Error preloading route! ☝️`,sa=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Dr:this.parentRoute||On(!1,`Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);let r=n?Dr:t?.path;r&&r!==`/`&&(r=$n(r));let i=t?.id||r,a=n?Dr:Zn([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Zn([`/`,a]));let o=a===`__root__`?`/`:Zn([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=er(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Or({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},ca=class extends sa{constructor(e){super(e)}};function la(e){let t=e.errorComponent??da;return(0,I.jsx)(ua,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?F.createElement(t,{error:n,reset:r}):e.children})}var ua=class extends F.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey===this.props.getResetKey()?this.state.error:null,reset:()=>{this.reset()}})}};function da({error:e}){let[t,n]=F.useState(!1);return(0,I.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,I.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,I.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,I.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,I.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,I.jsx)(`div`,{children:(0,I.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,I.jsx)(`code`,{children:e.message}):null})}):null]})}function fa({children:e,fallback:t=null}){return pa()?(0,I.jsx)(F.Fragment,{children:e}):(0,I.jsx)(F.Fragment,{children:t})}function pa(){return F.useSyncExternalStore(ma,()=>!0,()=>!1)}function ma(){return()=>{}}var ha=F.createContext(null),ga=!0;function _a(e,t){if(!ga){if(e)return;var n=`Warning: `+t;typeof console<`u`&&console.warn(n);try{throw Error(n)}catch{}}}function va(e){let t=F.useContext(ha);return _a(!((e?.warn??!0)&&!t),`useRouter must be used inside a <RouterProvider> component!`),t}var ya=P((e=>{var t=Ue();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),ba=P(((e,t)=>{t.exports=ya()})),xa=P((e=>{var t=Ue(),n=ba();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Sa=P(((e,t)=>{t.exports=xa()}))();function Ca(e,t){return e===t}function wa(e,t,n=Ca){let r=(0,F.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,F.useCallback)(()=>e?.get(),[e]);return(0,Sa.useSyncExternalStoreWithSelector)(r,i,i,t,n)}function Ta(e){let t=va({warn:e?.router===void 0}),n=e?.router||t,r=(0,F.useRef)(void 0);return wa(n.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=ln(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var Ea=F.createContext(void 0),Da=F.createContext(void 0);function Oa(e){let t=F.useContext(e.from?Da:Ea);return Ta({select:n=>{let r=n.matches.find(n=>e.from?e.from===n.routeId:n.id===t);if(On(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:`a nearest match!`}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function ka(e){return Oa({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Aa(e){let{select:t,...n}=e;return Oa({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function ja(e){return Oa({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Ma(e){return Oa({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Na(e){let t=va();return F.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Pa(e){return Oa({...e,select:t=>e.select?e.select(t.context):t.context})}var Fa=Ge();function Ia(e,t){let n=va(),r=en(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,hashScrollIntoView:u,replace:d,startTransition:f,resetScroll:p,viewTransition:m,children:h,target:g,disabled:_,style:v,className:y,onClick:b,onBlur:x,onFocus:S,onMouseEnter:C,onMouseLeave:w,onTouchStart:T,ignoreBlocker:E,params:D,search:O,hash:k,state:ee,mask:te,reloadDocument:ne,unsafeRelative:A,from:j,_fromLocation:re,...ie}=e,ae=pa(),oe=Ta({select:e=>{let t=e.matches[e.matches.length-1];return{search:t?.search,hash:e.location.hash,path:t?.pathname}},structuralSharing:!0}),se=e.from,M=F.useMemo(()=>({...e,from:se}),[n,oe,se,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ce=F.useMemo(()=>n.buildLocation({...M}),[n,M]),le=ce.maskedLocation?ce.maskedLocation.publicHref:ce.publicHref,ue=ce.maskedLocation?ce.maskedLocation.external:ce.external,de=F.useMemo(()=>Ga(le,ue,n.history,_),[_,ue,le,n.history]),fe=F.useMemo(()=>{if(de?.external)return yn(de.href,n.protocolAllowlist)?void 0:de.href;if(!Ka(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),yn(s,n.protocolAllowlist)?void 0:s}catch{}},[s,de,n.protocolAllowlist]),pe=Ta({select:e=>{if(fe)return!1;if(o?.exact){if(!rr(e.location.pathname,ce.pathname,n.basepath))return!1}else{let t=nr(e.location.pathname,n.basepath),r=nr(ce.pathname,n.basepath);if(!(t.startsWith(r)&&(t.length===r.length||t[r.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!mn(e.location.search,ce.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?ae&&e.location.hash===ce.hash:!0}}),me=pe?rn(i,{})??Ra:La,he=pe?La:rn(a,{})??La,ge=[y,me.className,he.className].filter(Boolean).join(` `),_e=(v||me.style||he.style)&&{...v,...me.style,...he.style},[ve,ye]=F.useState(!1),be=F.useRef(!1),xe=e.reloadDocument||fe?!1:c??n.options.defaultPreload,Se=l??n.options.defaultPreloadDelay??0,Ce=F.useCallback(()=>{n.preloadRoute({...M,_builtLocation:ce}).catch(e=>{console.warn(e),console.warn(oa)})},[n,M,ce]);$t(r,F.useCallback(e=>{e?.isIntersecting&&Ce()},[Ce]),Ua,{disabled:!!_||xe!==`viewport`}),F.useEffect(()=>{be.current||!_&&xe===`render`&&(Ce(),be.current=!0)},[_,Ce,xe]);let we=e=>{let t=e.currentTarget.getAttribute(`target`),r=g===void 0?t:g;if(!_&&!Ja(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,Fa.flushSync)(()=>{ye(!0)});let t=n.subscribe(`onResolved`,()=>{t(),ye(!1)});n.navigate({...M,replace:d,resetScroll:p,hashScrollIntoView:u,startTransition:f,viewTransition:m,ignoreBlocker:E})}};if(fe)return{...ie,ref:r,href:fe,...h&&{children:h},...g&&{target:g},..._&&{disabled:_},...v&&{style:v},...y&&{className:y},...b&&{onClick:b},...x&&{onBlur:x},...S&&{onFocus:S},...C&&{onMouseEnter:C},...w&&{onMouseLeave:w},...T&&{onTouchStart:T}};let Te=e=>{if(_||xe!==`intent`)return;if(!Se){Ce();return}let t=e.currentTarget;if(Ha.has(t))return;let n=setTimeout(()=>{Ha.delete(t),Ce()},Se);Ha.set(t,n)},N=e=>{_||xe!==`intent`||Ce()},Ee=e=>{if(_||!xe||!Se)return;let t=e.currentTarget,n=Ha.get(t);n&&(clearTimeout(n),Ha.delete(t))};return{...ie,...me,...he,href:de?.href,ref:r,onClick:Wa([b,we]),onBlur:Wa([x,Ee]),onFocus:Wa([S,Te]),onMouseEnter:Wa([C,Te]),onMouseLeave:Wa([w,Ee]),onTouchStart:Wa([T,N]),disabled:!!_,target:g,..._e&&{style:_e},...ge&&{className:ge},..._&&za,...pe&&Ba,...ae&&ve&&Va}}var La={},Ra={className:`active`},za={role:`link`,"aria-disabled":!0},Ba={"data-status":`active`,"aria-current":`page`},Va={"data-transitioning":`transitioning`},Ha=new WeakMap,Ua={rootMargin:`100px`},Wa=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Ga(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Ka(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var qa=F.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Ia(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return F.createElement(`a`,t,o)}return F.createElement(n,a,o)});function Ja(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Ya=class extends sa{constructor(e){super(e),this.useMatch=e=>Oa({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Pa({...e,from:this.id}),this.useSearch=e=>Ma({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ja({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Aa({...e,from:this.id}),this.useLoaderData=e=>ka({...e,from:this.id}),this.useNavigate=()=>Na({from:this.fullPath}),this.Link=F.forwardRef((e,t)=>(0,I.jsx)(qa,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function Xa(e){return new Ya(e)}var Za=class extends ca{constructor(e){super(e),this.useMatch=e=>Oa({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Pa({...e,from:this.id}),this.useSearch=e=>Ma({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ja({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Aa({...e,from:this.id}),this.useLoaderData=e=>ka({...e,from:this.id}),this.useNavigate=()=>Na({from:this.fullPath}),this.Link=F.forwardRef((e,t)=>(0,I.jsx)(qa,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function Qa(e){return new Za(e)}function $a(e){return typeof e==`object`?new eo(e,{silent:!0}).createRoute(e):new eo(e,{silent:!0}).createRoute}var eo=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=Xa(e);return t.isRoot=!1,t},this.silent=t?.silent}},to=class{constructor(e){this.useMatch=e=>Oa({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Pa({...e,from:this.options.id}),this.useSearch=e=>Ma({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>ja({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>Aa({...e,from:this.options.id}),this.useLoaderData=e=>ka({...e,from:this.options.id}),this.useNavigate=()=>Na({from:va().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for(`react.memo`)}};function no(e){return typeof e==`object`?new to(e):t=>new to({id:e,...t})}function ro(e){let t=Ta({select:e=>`not-found-${e.location.pathname}-${e.status}`});return(0,I.jsx)(la,{getResetKey:()=>t,onCatch:(t,n)=>{if(lr(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(lr(t))return e.fallback?.(t);throw t},children:e.children})}function io(){return(0,I.jsx)(`p`,{children:`Not Found`})}function ao({children:e}){return va(),null}function oo(e){return(0,I.jsx)(I.Fragment,{children:e.children})}function so(e,t,n){return t.options.notFoundComponent?(0,I.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,I.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,I.jsx)(io,{})}function co(){let e=va();if(!e.isScrollRestoring||!0)return null;let t=(e.options.getScrollRestorationKey||hr)(e.latestLocation),n=t===hr(e.latestLocation)?void 0:t,r={storageKey:dr,shouldScrollRestoration:!0};return n&&(r.key=n),(0,I.jsx)(ao,{children:`(${vr.toString()})(${Sn(JSON.stringify(r))})`})}var lo=F.memo(function({matchId:e}){let t=va(),n=Ta({select:t=>{let n=t.matches.findIndex(t=>t.id===e),r=t.matches[n];return On(r,`Could not find match for matchId "${e}". Please file an issue!`),{routeId:r.routeId,ssr:r.ssr,_displayPending:r._displayPending,resetKey:t.loadedAt,parentRouteId:t.matches[n-1]?.routeId}},structuralSharing:!0}),r=t.routesById[n.routeId],i=r.options.pendingComponent??t.options.defaultPendingComponent,a=i?(0,I.jsx)(i,{}):null,o=r.options.errorComponent??t.options.defaultErrorComponent,s=r.options.onCatch??t.options.defaultOnCatch,c=r.isRoot?r.options.notFoundComponent??t.options.notFoundRoute?.options.component:r.options.notFoundComponent,l=n.ssr===!1||n.ssr===`data-only`,u=(!r.isRoot||r.options.wrapInSuspense||l)&&(r.options.wrapInSuspense??i??(r.options.errorComponent?.preload||l))?F.Suspense:oo,d=o?la:oo,f=c?ro:oo;return(0,I.jsxs)(r.isRoot?r.options.shellComponent??oo:oo,{children:[(0,I.jsx)(Ea.Provider,{value:e,children:(0,I.jsx)(u,{fallback:a,children:(0,I.jsx)(d,{getResetKey:()=>n.resetKey,errorComponent:o||da,onCatch:(t,n)=>{if(lr(t))throw t;_a(!1,`Error in route match: ${e}`),s?.(t,n)},children:(0,I.jsx)(f,{fallback:e=>{if(!c||e.routeId&&e.routeId!==n.routeId||!e.routeId&&!r.isRoot)throw e;return F.createElement(c,e)},children:l||n._displayPending?(0,I.jsx)(fa,{fallback:a,children:(0,I.jsx)(fo,{matchId:e})}):(0,I.jsx)(fo,{matchId:e})})})})}),n.parentRouteId===`__root__`&&t.options.scrollRestoration?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(uo,{}),(0,I.jsx)(co,{})]}):null]})});function uo(){let e=va(),t=F.useRef(void 0);return(0,I.jsx)(`script`,{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:`onRendered`,...Ji(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var fo=F.memo(function({matchId:e}){let t=va(),{match:n,key:r,routeId:i}=Ta({select:n=>{let r=n.matches.find(t=>t.id===e),i=r.routeId,a=(t.routesById[i].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:i,loaderDeps:r.loaderDeps,params:r._strictParams,search:r._strictSearch});return{key:a?JSON.stringify(a):void 0,routeId:i,match:{id:r.id,status:r.status,error:r.error,_forcePending:r._forcePending,_displayPending:r._displayPending}}},structuralSharing:!0}),a=t.routesById[i],o=F.useMemo(()=>{let e=a.options.component??t.options.defaultComponent;return e?(0,I.jsx)(e,{},r):(0,I.jsx)(V,{})},[r,a.options.component,t.options.defaultComponent]);if(n._displayPending)throw t.getMatch(n.id)?._nonReactive.displayPendingPromise;if(n._forcePending)throw t.getMatch(n.id)?._nonReactive.minPendingPromise;if(n.status===`pending`){let e=a.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let r=t.getMatch(n.id);if(r&&!r._nonReactive.minPendingPromise){let t=hn();r._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),r._nonReactive.minPendingPromise=void 0},e)}}throw t.getMatch(n.id)?._nonReactive.loadPromise}if(n.status===`notFound`)return On(lr(n.error),`Expected a notFound error`),so(t,a,n.error);if(n.status===`redirected`)throw On(kr(n.error),`Expected a redirect error`),t.getMatch(n.id)?._nonReactive.loadPromise;if(n.status===`error`)throw n.error;return o}),V=F.memo(function(){let e=va(),t=F.useContext(Ea),n=Ta({select:e=>e.matches.find(e=>e.id===t)?.routeId}),r=e.routesById[n],i=Ta({select:e=>{let n=e.matches.find(e=>e.id===t);return On(n,`Could not find parent match for matchId "${t}"`),n.globalNotFound}}),a=Ta({select:e=>{let n=e.matches;return n[n.findIndex(e=>e.id===t)+1]?.id}}),o=e.options.defaultPendingComponent?(0,I.jsx)(e.options.defaultPendingComponent,{}):null;if(i)return so(e,r,void 0);if(!a)return null;let s=(0,I.jsx)(lo,{matchId:a});return n===`__root__`?(0,I.jsx)(F.Suspense,{fallback:o,children:s}):s});function po(){let e=va(),t=F.useRef({router:e,mounted:!1}),[n,r]=F.useState(!1),{hasPendingMatches:i,isLoading:a}=Ta({select:e=>({isLoading:e.isLoading,hasPendingMatches:e.matches.some(e=>e.status===`pending`)}),structuralSharing:!0}),o=Qt(a),s=a||n||i,c=Qt(s),l=a||i,u=Qt(l);return e.startTransition=e=>{r(!0),F.startTransition(()=>{e(),r(!1)})},F.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return er(e.latestLocation.publicHref)!==er(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),Zt(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),Zt(()=>{o&&!a&&e.emit({type:`onLoad`,...Ji(e.state)})},[o,e,a]),Zt(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...Ji(e.state)})},[l,u,e]),Zt(()=>{if(c&&!s){let t=Ji(e.state);e.emit({type:`onResolved`,...t}),e.__store.setState(e=>({...e,status:`idle`,resolvedLocation:e.location})),t.hrefChanged&&br(e)}},[s,c,e]),null}function mo(){let e=va(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,I.jsx)(t,{}):null,r=(0,I.jsxs)(typeof document<`u`&&e.ssr?oo:F.Suspense,{fallback:n,children:[(0,I.jsx)(po,{}),(0,I.jsx)(ho,{})]});return e.options.InnerWrap?(0,I.jsx)(e.options.InnerWrap,{children:r}):r}function ho(){let e=va(),t=Ta({select:e=>e.matches[0]?.id}),n=Ta({select:e=>e.loadedAt}),r=t?(0,I.jsx)(lo,{matchId:t}):null;return(0,I.jsx)(Ea.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,I.jsx)(la,{getResetKey:()=>n,errorComponent:da,onCatch:void 0,children:r})})}var go=e=>new _o(e),_o=class extends Xi{constructor(e){super(e)}};typeof globalThis<`u`?(globalThis.createFileRoute=$a,globalThis.createLazyFileRoute=no):typeof window<`u`&&(window.createFileRoute=$a,window.createLazyFileRoute=no);function vo({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,I.jsx)(ha.Provider,{value:e,children:t});return e.options.Wrap?(0,I.jsx)(e.options.Wrap,{children:r}):r}function yo({router:e,...t}){return(0,I.jsx)(vo,{router:e,...t,children:(0,I.jsx)(mo,{})})}var bo=qe();function xo(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=xo(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function H(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xo(e))&&(r&&(r+=` `),r+=t);return r}var So=/(?:^|\n)\s{0,3}#{0,6}\s*my request(?:\s+for\s+[^:\n]+)?\s*:?\s*/giu,Co=e=>e.replace(/[\\/]+$/u,``),wo=(e,t)=>`${Co(e)}/${t.replace(/^\/+/u,``)}`,To=(e,t)=>wo(t,e.uploadRootDirName),Eo=(e,t)=>wo(t,e.uploadFilesDirName),Do=(e,t,n)=>`${To(e,t)}/${n}`,Oo=(e,t,n)=>`${Eo(e,t)}/${n}`,ko=(e,t)=>`${e.localImagePath}?path=${encodeURIComponent(t)}`,Ao=(e,t)=>`${e.localBrowsePath}${encodeURI(t)}`,jo=e=>e.availability===`ready`,Mo={id:`antigravity`,displayName:`Antigravity`,description:`CLI provider scaffold for Antigravity sessions.`,transportLabel:`scaffolded CLI adapter`,availability:`scaffolded`,transportKind:`cli`,defaultModel:null,wsProxyPath:`/antigravity-ws`,authCompletePath:`/antigravity-auth/complete`,localImagePath:`/antigravity-local-image`,localBrowsePath:`/antigravity-local-browse/`,uploadRootDirName:`.antigravity-web/uploads`,uploadFilesDirName:`.antigravity-web/uploads/files`,requestHeading:`# My request for Antigravity:`,requestMarkerPattern:So},No={id:`codex`,displayName:`Codex`,description:`Live Codex bridge connected to the current Nomadex workspace.`,transportLabel:`local agent bridge`,availability:`ready`,transportKind:`bridge`,defaultModel:`gpt-5.4`,wsProxyPath:`/codex-ws`,authCompletePath:`/codex-auth/complete`,localImagePath:`/codex-local-image`,localBrowsePath:`/codex-local-browse/`,uploadRootDirName:`.codex-web/uploads`,uploadFilesDirName:`.codex-web/uploads/files`,requestHeading:`# My request:`,requestMarkerPattern:So},Po={id:`gemini-cli`,displayName:`Gemini CLI`,description:`CLI provider scaffold for Gemini CLI workspaces.`,transportLabel:`scaffolded CLI adapter`,availability:`scaffolded`,transportKind:`cli`,defaultModel:null,wsProxyPath:`/gemini-cli-ws`,authCompletePath:`/gemini-cli-auth/complete`,localImagePath:`/gemini-cli-local-image`,localBrowsePath:`/gemini-cli-local-browse/`,uploadRootDirName:`.gemini-cli-web/uploads`,uploadFilesDirName:`.gemini-cli-web/uploads/files`,requestHeading:`# My request for Gemini CLI:`,requestMarkerPattern:So},Fo={id:`github-copilot`,displayName:`GitHub Copilot`,description:`CLI provider scaffold for GitHub Copilot coding sessions.`,transportLabel:`scaffolded CLI adapter`,availability:`scaffolded`,transportKind:`cli`,defaultModel:null,wsProxyPath:`/github-copilot-ws`,authCompletePath:`/github-copilot-auth/complete`,localImagePath:`/github-copilot-local-image`,localBrowsePath:`/github-copilot-local-browse/`,uploadRootDirName:`.github-copilot-web/uploads`,uploadFilesDirName:`.github-copilot-web/uploads/files`,requestHeading:`# My request for GitHub Copilot:`,requestMarkerPattern:So},Io={id:`opencode`,displayName:`OpenCode`,description:`Headless OpenCode CLI turns through the local Nomadex bridge.`,transportLabel:`local OpenCode CLI`,availability:`ready`,transportKind:`cli`,defaultModel:`opencode/big-pickle`,installCommand:`npm i -g opencode-ai@latest`,wsProxyPath:`/codex-ws`,authCompletePath:`/codex-auth/complete`,localImagePath:`/codex-local-image`,localBrowsePath:`/codex-local-browse/`,uploadRootDirName:`.opencode-web/uploads`,uploadFilesDirName:`.opencode-web/uploads/files`,requestHeading:`# My request for OpenCode:`,requestMarkerPattern:So},Lo={id:`qwen-code`,displayName:`Qwen Code`,description:`Headless Qwen Code turns through the local Nomadex bridge.`,transportLabel:`local Qwen Code CLI`,availability:`ready`,transportKind:`cli`,defaultModel:`default`,installCommand:`npm i -g @qwen-code/qwen-code@latest`,wsProxyPath:`/codex-ws`,authCompletePath:`/codex-auth/complete`,localImagePath:`/codex-local-image`,localBrowsePath:`/codex-local-browse/`,uploadRootDirName:`.qwen-code-web/uploads`,uploadFilesDirName:`.qwen-code-web/uploads/files`,requestHeading:`# My request for Qwen Code:`,requestMarkerPattern:So},Ro=`nomadex-provider`,zo={codex:No,antigravity:Mo,"gemini-cli":Po,"github-copilot":Fo,opencode:Io,"qwen-code":Lo},Bo=`codex`,Vo=()=>Object.values(zo),Ho=(e=Bo)=>zo[e],Uo=e=>!!(e&&e in zo),Wo=()=>{if(typeof window>`u`)return Bo;let e=window.localStorage.getItem(Ro);return Uo(e)?e:Bo},Go=e=>{typeof window>`u`||window.localStorage.setItem(Ro,e)},Ko=(e,t)=>({reasoningEffort:e,description:t}),qo=(...e)=>e,Jo=({id:e,displayName:t,description:n,defaultReasoningEffort:r,supportedReasoningEfforts:i,inputModalities:a,isDefault:o=!1})=>({id:e,model:e,upgrade:null,upgradeInfo:null,availabilityNux:null,displayName:t,description:n,hidden:!1,supportedReasoningEfforts:i.map(e=>Ko(e,`${t} supports ${e} reasoning.`)),defaultReasoningEffort:r,inputModalities:a,supportsPersonality:!0,isDefault:o}),Yo=[],Xo=[Jo({id:`opencode/big-pickle`,displayName:`Big Pickle`,description:`OpenCode Zen free model. Limited-time free access.`,defaultReasoningEffort:`medium`,supportedReasoningEfforts:[`low`,`medium`,`high`],inputModalities:qo(`text`),isDefault:!0}),Jo({id:`opencode/minimax-m2.5-free`,displayName:`MiniMax M2.5 Free`,description:`OpenCode Zen free model. Limited-time free access.`,defaultReasoningEffort:`medium`,supportedReasoningEfforts:[`low`,`medium`,`high`],inputModalities:qo(`text`)}),Jo({id:`opencode/mimo-v2-pro-free`,displayName:`MiMo V2 Pro Free`,description:`OpenCode Zen free model. Limited-time free access.`,defaultReasoningEffort:`medium`,supportedReasoningEfforts:[`low`,`medium`,`high`],inputModalities:qo(`text`)}),Jo({id:`opencode/mimo-v2-omni-free`,displayName:`MiMo V2 Omni Free`,description:`OpenCode Zen free model. Limited-time free access.`,defaultReasoningEffort:`medium`,supportedReasoningEfforts:[`low`,`medium`,`high`],inputModalities:qo(`text`)}),Jo({id:`opencode/nemotron-3-super-free`,displayName:`Nemotron 3 Super Free`,description:`OpenCode Zen free model. Limited-time free access.`,defaultReasoningEffort:`medium`,supportedReasoningEfforts:[`low`,`medium`,`high`],inputModalities:qo(`text`)})],Zo=(e,t)=>e===`opencode`?Xo:e===`codex`?t:Yo,Qo=(e,t,n)=>Zo(e,n).find(e=>e.id===t)??null,$o=/^##\s+(.+?):\s+(.+?)\s*$/,es=/^#\s*files mentioned by the user\s*:?\s*$/i;function ts(e){return e.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()||e}function ns(e){if(!e||/\s/u.test(e)||e.endsWith(`/`)||e.endsWith(`\\`)||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(e))return!1;let t=e.startsWith(`/`),n=/^[A-Za-z]:[\\/]/u.test(e),r=e.startsWith(`./`)||e.startsWith(`../`)||e.startsWith(`~/`),i=e.includes(`/`)||e.includes(`\\`);return t||n||r||i}function rs(e){if(!e)return null;let t=e,n=null,r=t.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(r)t=r[1],n=Number(r[2]);else{let e=t.match(/^(.*):(\d+)(?::\d+)?$/u);e&&(t=e[1],n=Number(e[2]))}return ns(t)?{path:t,line:n}:null}var is=e=>e.startsWith(`/`)||/^[A-Za-z]:[\\/]/u.test(e);function as(e,t){let n=e.trim();if(!n)return null;let r=Ho(t),i=rs(n);return!i?.path||!is(i.path)?null:{path:i.path,line:i.line,browseUrl:Ao(r,i.path)}}function os(e,t){let n=ts(e);return t===null?n:`${n}:${String(t)}`}function ss(e){if(!e.includes(`[`)||!e.includes(`](`))return[{kind:`text`,value:e}];let t=[],n=/\[([^\]\n]+)\]\(([^)\n]+)\)/gu,r=0;for(let i of e.matchAll(n)){let n=i[0],a=i[1]?.trim()??``,o=i[2]?.trim()??``,s=i.index??-1;if(s<0)continue;s>r&&t.push({kind:`text`,value:e.slice(r,s)});let c=rs(o);c?t.push({kind:`file`,value:a||o,path:c.path,line:c.line,displayPath:os(c.path,c.line),downloadName:ts(c.path)}):t.push({kind:`text`,value:n}),r=s+n.length}return r<e.length&&t.push({kind:`text`,value:e.slice(r)}),t.length>0?t:[{kind:`text`,value:e}]}function cs(e,t){ss(t).forEach(t=>{t.kind===`text`&&t.value.length===0||e.push(t)})}function ls(e){let t=e.split(`
|
|
11
11
|
`).findIndex(e=>es.test(e.trim()));if(t<0)return[];let n=e.split(`
|
|
12
12
|
`).slice(t+1),r=[],i=new Set;for(let e of n){let t=e.trim();if(!t)continue;let n=t.match($o);if(!n)break;let a=n[1]?.trim(),o=n[2]?.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,``);if(a&&o){let e=`${a.toLowerCase()}:${o}`;if(i.has(e))continue;i.add(e),r.push({label:a,path:o})}}return r}function us(e){return e.startsWith(`blob:`)||e.startsWith(`data:`)}function ds(e,t){let n=Ho(t).requestMarkerPattern,r=Array.from(e.matchAll(n));if(r.length===0)return e.trim();let i=r.at(-1);if(!i||typeof i.index!=`number`)return e.trim();let a=i.index+i[0].length;return e.slice(a).trim()}function fs(e,t){let n=[],r=[];for(let t of e.content)t.type===`text`&&typeof t.text==`string`&&t.text.length>0&&n.push(t.text),t.type===`image`&&typeof t.url==`string`&&t.url.trim().length>0&&r.push(t.url.trim()),t.type===`localImage`&&typeof t.path==`string`&&t.path.trim().length>0&&r.push(t.path.trim());let i=r.filter(e=>!us(e)),a=[...new Set(i.length>0?i:r)],o=n.join(`
|
|
13
13
|
`);return{text:ds(o,t),images:a,fileAttachments:ls(o)}}function ps(e){if(!e.includes("`"))return ss(e);let t=[],n=0,r=0;for(;n<e.length;){if(e[n]!=="`"){n+=1;continue}let i=1;for(;n+i<e.length&&e[n+i]==="`";)i+=1;let a="`".repeat(i),o=n+i,s=-1;for(;o<e.length;){let t=e.indexOf(a,o);if(t<0)break;let r=t>0&&e[t-1]==="`",c=t+i<e.length&&e[t+i]==="`",l=e.slice(n+i,t).includes(`
|
|
@@ -206,9 +206,9 @@ console.log(qwenRoot);`],cwd:e,timeoutMs:5e3});if(t.exitCode!==0){let e=Jl([t.st
|
|
|
206
206
|
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
207
207
|
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Qy(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Yb.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function ax(){return{exit:{taskListCheckValueChecked:sx,taskListCheckValueUnchecked:sx,paragraph:cx}}}function ox(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:lx}}}function sx(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function cx(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function lx(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Yb.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function ux(){return[gy(),By(),Gy(),Xb(),ax()]}function dx(e){return{extensions:[_y(),Vy(e),Ky(),ix(e),ox()]}}var fx={tokenize:Ex,partial:!0},px={tokenize:Dx,partial:!0},mx={tokenize:Ox,partial:!0},hx={tokenize:kx,partial:!0},gx={tokenize:Ax,partial:!0},_x={name:`wwwAutolink`,tokenize:wx,previous:jx},vx={name:`protocolAutolink`,tokenize:Tx,previous:Mx},yx={name:`emailAutolink`,tokenize:Cx,previous:Nx},bx={};function xx(){return{text:bx}}for(var Sx=48;Sx<123;)bx[Sx]=yx,Sx++,Sx===58?Sx=65:Sx===91&&(Sx=97);bx[43]=yx,bx[45]=yx,bx[46]=yx,bx[95]=yx,bx[72]=[yx,vx],bx[104]=[yx,vx],bx[87]=[yx,_x],bx[119]=[yx,_x];function Cx(e,t,n){let r=this,i,a;return o;function o(t){return!Px(t)||!Nx.call(r,r.previous)||Fx(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Px(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(gx,u,l)(t):t===45||t===95||vm(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&_m(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function wx(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!jx.call(r,r.previous)||Fx(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(fx,e.attempt(px,e.attempt(mx,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Tx(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Mx.call(r,r.previous)&&!Fx(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(_m(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||bm(t)||wm(t)||Em(t)||Tm(t)?n(t):e.attempt(px,e.attempt(mx,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Ex(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Dx(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(hx,c,s)(t):t===null||wm(t)||Em(t)||t!==45&&Tm(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Ox(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(hx,t,a)(o):o===null||wm(o)||Em(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function kx(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||wm(o)||Em(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||wm(e)||Em(e)?t(e):r(e)}function a(e){return _m(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):_m(t)?(e.consume(t),o):n(t)}}function Ax(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return vm(e)?n(e):t(e)}}function jx(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||wm(e)}function Mx(e){return!_m(e)}function Nx(e){return!(e===47||Px(e))}function Px(e){return e===43||e===45||e===46||e===95||vm(e)}function Fx(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Ix={tokenize:Wx,partial:!0};function Lx(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Vx,continuation:{tokenize:Hx},exit:Ux}},text:{91:{name:`gfmFootnoteCall`,tokenize:Bx},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Rx,resolveTo:zx}}}}function Rx(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=gm(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function zx(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Bx(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||wm(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(gm(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return wm(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Vx(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||wm(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=gm(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return wm(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),km(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Hx(e,t,n){return e.check(Wm,t,e.attempt(Ix,t,n))}function Ux(e){e.exit(`gfmFootnoteDefinition`)}function Wx(e,t,n){let r=this;return km(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Gx(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&lm(o,o.length,0,Lm(s,e.slice(r+1,n),t)),lm(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),lm(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Im(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Im(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Kx=class{constructor(){this.map=[]}add(e,t,n){qx(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function qx(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Jx(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Yx(){return{flow:{null:{name:`table`,tokenize:Xx,resolveAll:Zx}}}}function Xx(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):X(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Z(t)?km(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||wm(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Z(t)?km(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Z(t)?km(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||X(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Z(t)?km(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||X(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||X(n)?(e.exit(`tableRow`),t(n)):Z(n)?km(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||wm(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Zx(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Kx;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&($x(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Qx(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Qx(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Qx(f,t,o,i,n,d)):(o[0]=o[1],d=Qx(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&$x(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Jx(t.events,n))}return e}function Qx(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},eS(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=eS(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=eS(t.events,n[2]),a=eS(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},eS(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function $x(e,t,n,r,i){let a=[],o=eS(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function eS(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var tS={name:`tasklistCheck`,tokenize:rS};function nS(){return{text:{91:tS}}}function rS(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return wm(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return X(r)?t(r):Z(r)?e.check({tokenize:iS},t,n)(r):n(r)}}function iS(e,t,n){return km(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function aS(e){return fm([xx(),Lx(),Gx(e),Yx(),nS()])}var oS={};function sS(e){let t=this,n=e||oS,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(aS(n)),a.push(ux()),o.push(dx(n))}function cS({alt:e=`Nomadex logo`,className:t}){return(0,I.jsx)(`img`,{alt:e,className:[`brand-mark`,t].filter(Boolean).join(` `),decoding:`async`,draggable:!1,src:`/favicon.svg`})}var lS=[`Opening workspace`,`Setting environment`,`Initializing modules`,`Starting services`],uS=1600,dS=380;function fS({messages:e=lS,metaText:t=`Connecting to workspace backend`,variant:n=`screen`,visibleRangeStart:r=0,visibleRangeEnd:i}){let a=e.length>0?e:lS,o=a.length-1,s=Math.max(0,Math.min(r,o)),c=Math.max(s,Math.min(i??o,o)),[l,u]=(0,F.useState)(s),[d,f]=(0,F.useState)(null),[p,m]=(0,F.useState)(!1);(0,F.useEffect)(()=>{if(c-s<1)return;let e=window.setInterval(()=>{u(e=>{let t=e<s||e>c?s:e;return f(t),m(!1),t>=c?s:t+1})},uS);return()=>{window.clearInterval(e)}},[c,s]),(0,F.useEffect)(()=>{if(d===null)return;let e=window.requestAnimationFrame(()=>{m(!0)}),t=window.setTimeout(()=>{f(null),m(!1)},dS);return()=>{window.cancelAnimationFrame(e),window.clearTimeout(t)}},[l,d]);let h=l<s||l>c?s:l,g=d!==null&&d>=s&&d<=c?d:null,_=a[h]??a[s],v=g===null?null:a[g]??null;return(0,I.jsxs)(`div`,{"aria-live":`polite`,className:H(`connection-loading-screen`,n===`inline`&&`inline`),role:`status`,children:[(0,I.jsx)(cS,{alt:``,className:`connection-loading-mark`}),(0,I.jsxs)(`div`,{className:`connection-loading-row`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`connection-loading-spinner`}),(0,I.jsxs)(`div`,{className:`connection-loading-slot`,children:[v?(0,I.jsx)(`span`,{className:H(`connection-loading-message`,`leaving`,p&&`animate`),children:v}):null,(0,I.jsx)(`span`,{className:H(`connection-loading-message`,v?`entering`:`resting`,p&&`animate`),children:_})]}),(0,I.jsxs)(`span`,{"aria-hidden":`true`,className:`connection-loading-dots`,children:[(0,I.jsx)(`span`,{}),(0,I.jsx)(`span`,{}),(0,I.jsx)(`span`,{})]})]}),(0,I.jsx)(`div`,{className:`connection-loading-meta`,children:t})]})}var pS={add:`new`,update:`mod`,delete:`del`},mS=e=>e.replace(/\\/g,`/`).split(`/`).filter(Boolean).at(-1)??e;function hS({entries:e,onOpenFile:t,title:n,variant:r=`turn`}){if(e.length===0)return null;let i=`${e.length}`;return(0,I.jsxs)(`div`,{className:H(`file-change-summary`,`file-change-summary-${r}`),children:[(0,I.jsxs)(`div`,{className:`file-change-summary-head`,children:[(0,I.jsx)(`div`,{className:`file-change-summary-title`,children:n}),(0,I.jsx)(`div`,{className:`file-change-summary-count`,children:i})]}),(0,I.jsx)(`div`,{className:`file-change-summary-list`,children:e.map(e=>{let n=mS(e.path);return(0,I.jsxs)(`button`,{className:H(`file-change-summary-item`,`file-change-kind-${e.kind}`),onClick:()=>t(e.path),title:e.path,type:`button`,children:[(0,I.jsx)(`span`,{className:`file-change-summary-kind`,children:pS[e.kind]}),(0,I.jsx)(`span`,{className:`file-change-summary-path`,children:n})]},`${e.itemId}:${e.path}`)})})]})}var gS=`Agent`;function _S({onFill:e,onSlash:t}){return(0,I.jsxs)(`div`,{className:`ww`,children:[(0,I.jsx)(cS,{className:`wico`}),(0,I.jsx)(`h1`,{children:`Nomadex`}),(0,I.jsx)(`p`,{children:`Agentic coding workspace for live threads, repo edits, command runs, and multi-provider orchestration.`}),(0,I.jsxs)(`div`,{className:`wbadges`,children:[(0,I.jsx)(`div`,{className:`wbadge`,children:`⚡ Live stream`}),(0,I.jsx)(`div`,{className:`wbadge`,children:`🔍 Web search`}),(0,I.jsx)(`div`,{className:`wbadge`,children:`⑂ Multi-agent`}),(0,I.jsx)(`div`,{className:`wbadge`,children:`🔧 MCP tools`}),(0,I.jsx)(`div`,{className:`wbadge`,children:`📋 Skills ($)`}),(0,I.jsx)(`div`,{className:`wbadge`,children:`apply_patch`}),(0,I.jsx)(`div`,{className:`wbadge`,children:`/ 25 slash cmds`})]}),(0,I.jsxs)(`div`,{className:`wsug`,children:[(0,I.jsxs)(`button`,{className:`sug`,type:`button`,onClick:()=>e(`Refactor the auth middleware to use JWT properly with full TypeScript types`),children:[(0,I.jsx)(`div`,{className:`sug-i`,children:`⚡`}),(0,I.jsx)(`div`,{className:`sug-t`,children:`Refactor code`}),(0,I.jsx)(`div`,{className:`sug-d`,children:`apply_patch + diffs`})]}),(0,I.jsxs)(`button`,{className:`sug`,type:`button`,onClick:()=>t(`/review`),children:[(0,I.jsx)(`div`,{className:`sug-i`,children:`🔍`}),(0,I.jsx)(`div`,{className:`sug-t`,children:`/review`}),(0,I.jsx)(`div`,{className:`sug-d`,children:`Audit working tree`})]}),(0,I.jsxs)(`button`,{className:`sug`,type:`button`,onClick:()=>e(`Write Jest unit tests for the auth service with 80%+ coverage`),children:[(0,I.jsx)(`div`,{className:`sug-i`,children:`🧪`}),(0,I.jsx)(`div`,{className:`sug-t`,children:`Write tests`}),(0,I.jsx)(`div`,{className:`sug-d`,children:`Jest + coverage`})]}),(0,I.jsxs)(`button`,{className:`sug`,type:`button`,onClick:()=>t(`/init`),children:[(0,I.jsx)(`div`,{className:`sug-i`,children:`📋`}),(0,I.jsx)(`div`,{className:`sug-t`,children:`/init`}),(0,I.jsx)(`div`,{className:`sug-d`,children:`Generate AGENTS.md`})]})]}),(0,I.jsx)(`p`,{className:`welcome-foot`,children:`/slash cmds · $skills · @file or /mention · !shell · ⌘K palette · Ctrl+G editor`})]})}function vS({threadLabelText:e}){return(0,I.jsx)(fS,{messages:[`Opening conversation`,`Reattaching thread`,`Loading recent history`,`Syncing transcript`],metaText:`Restoring ${Hd(e,42)}`,variant:`inline`})}var yS=(0,F.memo)(function({activeThread:e,activeThreadLabel:t,activeTurns:n,existingThreadHistoryPending:r,rollbackPendingTurnId:i,streamVisible:a,onReview:o,onRollback:s,onFill:c,onSlash:l,onCopy:u,onFork:d,onPlan:f,onEdit:p,onContext:m,onOpenFile:h,providerId:g}){if(!e)return(0,I.jsx)(_S,{onFill:c,onSlash:l});if(r)return(0,I.jsx)(vS,{threadLabelText:t});if(n.length===0)return(0,I.jsx)(_S,{onFill:c,onSlash:l});let _=n[n.length-1]?.id??null,v=n.some(e=>e.status===`inProgress`)||i!==null;return(0,I.jsx)(I.Fragment,{children:n.map(t=>{let n=gf(t),r=_s(t),c=t.items.filter(e=>e.type===`userMessage`).map(e=>xS(fs(e,g).text)).filter(Boolean),l=(e.steers??[]).filter(e=>e.turnId===t.id).filter(e=>e.status===`pending`?!0:!c.includes(xS(e.prompt))),y=t.status===`inProgress`?[...t.items].reverse().find(e=>e.type===`agentMessage`)?.id??null:null;return(0,I.jsxs)(`div`,{className:`turn-block`,children:[t.items.map(n=>(0,I.jsx)(zS,{item:n,onContext:m,onCopy:u,onEdit:p,onFork:d,onOpenFile:h,onPlan:f,onRollback:s,providerId:g,onReview:o,rollbackPending:i===t.id,rollbackDisabled:v,showRollback:n.type===`userMessage`,turnId:t.id,outputVisible:n.type===`commandExecution`?a[`${n.id}:aggregatedOutput`]:void 0,streaming:n.type===`agentMessage`&&n.id===y,textVisible:n.type===`agentMessage`?a[`${n.id}:text`]:void 0,plan:t.id===_?e.plan:null,turnStatus:t.status},n.id)),l.map(e=>(0,I.jsx)(SS,{entry:e,onOpenFile:h,providerId:g},e.id)),n?(0,I.jsx)(jS,{code:_f(t.error?.codexErrorInfo??null),onOpenFile:h,providerId:g,status:t.status,text:n}):null,t.status===`inProgress`?null:(0,I.jsx)(hS,{entries:r,onOpenFile:h,title:`Changed`,variant:`turn`})]},t.id)})})}),bS=new Intl.DateTimeFormat([],{hour:`numeric`,minute:`2-digit`}),xS=e=>e.replace(/\s+/gu,` `).trim(),SS=(0,F.memo)(function({entry:e,onOpenFile:t,providerId:n}){return(0,I.jsxs)(`div`,{className:H(`steer-card`,e.status===`pending`&&`pending`),children:[(0,I.jsxs)(`div`,{className:`steer-card-head`,children:[(0,I.jsx)(`span`,{className:`steer-card-label`,children:`Steer`}),(0,I.jsx)(`span`,{className:`steer-card-meta`,children:e.status===`pending`?`Applying`:bS.format(new Date(e.createdAt))})]}),(0,I.jsx)(`div`,{className:`steer-card-body`,children:(0,I.jsx)(MS,{onOpenFile:t,providerId:n,text:e.prompt})})]})}),CS=e=>{switch(e.status){case`inProgress`:return`Running`;case`completed`:return e.exitCode===0?`Completed`:`Exit ${e.exitCode??`?`}`;case`failed`:return`Failed`;case`declined`:return`Declined`;default:return e.status}},wS=e=>e.status===`inProgress`?`run`:e.status===`completed`&&e.exitCode===0?`ok`:`err`,TS=e=>e.replace(/\\/gu,`/`).split(`/`).filter(Boolean).pop()??e,ES=e=>{if(e==null)return null;if(e<1e3)return`${e}ms`;if(e<6e4){let t=e/1e3;return`${t>=10?t.toFixed(0):t.toFixed(1).replace(/\.0$/u,``)}s`}return`${Math.floor(e/6e4)}m ${Math.round(e%6e4/1e3)}s`},DS=e=>{let t=e.replace(/\\/gu,`/`).trim();if(!t)return`(cwd)`;let n=t.split(`/`).filter(Boolean);return n.length===0?`/`:t.startsWith(`/home/`)&&n.length>=3?`~/${n.slice(2).join(`/`)}`:n.length>3?`.../${n.slice(-3).join(`/`)}`:t},OS=/^(?:\/usr\/bin\/env\s+)?((?:\/[^ "'`]+|[A-Za-z0-9_.-]+))(?:\s+(?:--?[A-Za-z0-9_-]+))*\s+(?:-lc|-c|\/c|-Command|-command)\s+(['"])([\s\S]*)\2$/u,kS=e=>{let t=e.commandActions.find(e=>e.command?.trim())?.command.trim()??e.command.trim(),n=t.match(OS),r=TS(n?.[1]??t).replace(/\.(?:bat|cmd|exe)$/iu,``)||`terminal`;return{commandText:n?.[3]?.trim()||t||`(command)`,cwdText:DS(e.cwd),durationText:ES(e.durationMs),processText:e.processId??`pty`,shellLabel:r}},AS=(e,t)=>`${e.trim().toLowerCase()}:${t.trim()}`,jS=(0,F.memo)(function({status:e,text:t,code:n,onOpenFile:r,providerId:i}){return(0,I.jsxs)(`div`,{className:`msg`,children:[(0,I.jsxs)(`div`,{className:`mh`,children:[(0,I.jsx)(`div`,{className:`mav a`,children:`⬡`}),(0,I.jsx)(`span`,{className:`mn`,children:gS}),(0,I.jsx)(`span`,{className:`mt`,children:e})]}),(0,I.jsx)(`div`,{className:`mb`,children:(0,I.jsxs)(`div`,{className:`turn-error-card`,children:[(0,I.jsx)(LS,{onOpenFile:r,providerId:i,text:t}),n?(0,I.jsx)(`div`,{className:`turn-error-code`,children:n}):null]})})]})}),MS=(0,F.memo)(function({text:e,onOpenFile:t,providerId:n}){return(0,I.jsx)(I.Fragment,{children:(0,F.useMemo)(()=>ps(e),[e]).map((e,r)=>e.kind===`text`?(0,I.jsx)(`span`,{children:e.value},`text-${r}`):e.kind===`code`?(0,I.jsx)(`code`,{className:`message-inline-code`,children:e.value},`code-${r}`):hs(e.path,n)===`#`?t?(0,I.jsx)(`button`,{className:`message-file-link file-link-button`,onClick:()=>t(e.path,e.line),title:e.path,type:`button`,children:e.displayPath},`file-${r}`):(0,I.jsx)(`code`,{className:`message-inline-code`,children:e.displayPath},`file-${r}`):(0,I.jsx)(`button`,{className:`message-file-link file-link-button`,onClick:()=>t(e.path,e.line),title:e.path,type:`button`,children:e.displayPath},`file-${r}`))})});function NS({url:e,alt:t,markdown:n,className:r}){let[i,a]=(0,F.useState)(!1);return i&&n?(0,I.jsx)(`p`,{className:`message-text`,children:n}):(0,I.jsx)(`a`,{className:`message-image-link`,href:e,rel:`noreferrer noopener`,target:`_blank`,children:(0,I.jsx)(`img`,{alt:t,className:H(`message-image-preview`,r),loading:`lazy`,onError:()=>a(!0),src:e})})}var PS=e=>{for(let t of F.Children.toArray(e)){if(!(0,F.isValidElement)(t))continue;let e=t.props.className;if(typeof e!=`string`)continue;let n=e.match(/language-([A-Za-z0-9_-]+)/u);if(n?.[1])return n[1]}return null},FS=e=>{let t=e;return(t.match(/```/gu)??[]).length%2==1&&(t=`${t}\n\`\`\``),(t.match(/~~~/gu)??[]).length%2==1&&(t=`${t}\n~~~`),t},IS=(0,F.memo)(function({text:e,onOpenFile:t,streaming:n=!1,showCursor:r=!1,providerId:i}){let a=(0,F.useDeferredValue)(e),o=n?a:e,s=(0,F.useMemo)(()=>n?FS(o):o,[o,n]),c=(0,F.useMemo)(()=>({a({href:e,children:n}){let r=typeof e==`string`?as(e,i):null;return r?(0,I.jsx)(`button`,{className:`message-file-link file-link-button message-markdown-link`,onClick:()=>t(r.path,r.line),title:r.path,type:`button`,children:n}):e?(0,I.jsx)(`a`,{className:`message-markdown-anchor`,href:e,rel:`noreferrer noopener`,target:`_blank`,children:n}):(0,I.jsx)(`span`,{className:`message-markdown-anchor`,children:n})},img({src:e,alt:t}){let n=typeof e==`string`?ms(e,i):``;return n?(0,I.jsx)(NS,{alt:t||`Embedded message image`,className:`message-markdown-image`,url:n}):t?(0,I.jsx)(`span`,{className:`message-inline-code`,children:t}):null},pre({children:e}){return(0,I.jsxs)(`div`,{className:`message-code-shell`,children:[(0,I.jsx)(`div`,{className:`message-code-head`,children:(0,I.jsx)(`span`,{children:PS(e)??`text`})}),(0,I.jsx)(`pre`,{className:`message-code-block`,children:e})]})},code({className:e,children:t}){return(0,I.jsx)(`code`,{className:H(`message-markdown-code`,e),children:t})}}),[t,i]);return(0,I.jsxs)(`div`,{className:H(`message-text-flow`,`message-markdown`,n&&`message-text-flow-streaming message-markdown-streaming`),children:[(0,I.jsx)(ry,{components:c,remarkPlugins:[sS],children:s}),r?(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`live-cursor message-stream-cursor`}):null]})}),LS=(0,F.memo)(function({text:e,onOpenFile:t,textFx:n,streaming:r=!1,showCursor:i=!1,providerId:a}){let o=(0,F.useMemo)(()=>r?[]:gs(e,a),[a,r,e]).reduce((e,t)=>({entries:[...e.entries,{block:t,start:e.nextStart}],nextStart:e.nextStart+(t.kind===`image`?t.markdown.length:t.value.length)}),{entries:[],nextStart:0}).entries;if(r){let t=n??null,r=t?Math.max(0,Math.min(e.length,t.from)):0,a=t?Math.max(r,Math.min(e.length,t.to)):0;return(0,I.jsx)(`div`,{className:`message-text-flow message-text-flow-streaming`,children:(0,I.jsxs)(`p`,{className:`message-text message-text-streaming`,children:[e.slice(0,r),a>r?(0,I.jsx)(`span`,{className:`message-text-tail`,children:e.slice(r,a)}):null,e.slice(a),i?(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`live-cursor live-cursor-inline`}):null]})})}return(0,I.jsx)(`div`,{className:`message-text-flow`,children:o.map(({block:e,start:r},i)=>{if(e.kind===`image`)return(0,I.jsx)(NS,{alt:e.alt||`Embedded message image`,className:`message-markdown-image`,markdown:e.markdown,url:e.url},`image-${i}`);if(!e.value)return null;let o=r+e.value.length,s=n??null,c=s?Math.max(0,s.from-r):0,l=s?Math.max(0,Math.min(e.value.length,s.to-r)):0,u=!1;if(s&&(u=s.to>s.from&&l>c&&o>s.from&&r<s.to),!u)return(0,I.jsx)(`p`,{className:`message-text`,children:(0,I.jsx)(MS,{onOpenFile:t,providerId:a,text:e.value})},`text-${i}`);let d=e.value.slice(0,c),f=e.value.slice(c,l),p=e.value.slice(l);return(0,I.jsxs)(`p`,{className:`message-text`,children:[d?(0,I.jsx)(MS,{onOpenFile:t,providerId:a,text:d}):null,f?(0,I.jsx)(`span`,{className:`message-text-tail`,children:(0,I.jsx)(MS,{onOpenFile:t,providerId:a,text:f})},`tail-${i}-${s?.to??e.value.length}`):null,p?(0,I.jsx)(MS,{onOpenFile:t,providerId:a,text:p}):null]},`text-${i}`)})})}),RS=(0,F.memo)(function({itemText:e,plan:t}){let n=t?.steps??[],r=t?.explanation?.trim()||e.trim();if(n.length===0)return(0,I.jsxs)(`div`,{className:`compact-bar`,children:[(0,I.jsx)(`span`,{className:`compact-ico`,children:`Plan`}),(0,I.jsx)(`span`,{className:`meta-glint`,children:r||e})]});let i=n.filter(e=>e.status===`completed`).length;return(0,I.jsxs)(`div`,{className:`turn-plan-card`,children:[(0,I.jsx)(`div`,{className:`turn-plan-card-head`,children:(0,I.jsxs)(`span`,{className:`turn-plan-card-progress`,children:[i,` of `,n.length,` tasks completed`]})}),r?(0,I.jsx)(`div`,{className:`turn-plan-card-summary`,children:r}):null,(0,I.jsx)(`ol`,{className:`turn-plan-card-list`,children:n.map((e,t)=>(0,I.jsxs)(`li`,{className:H(`turn-plan-card-step`,`is-${e.status}`),children:[(0,I.jsx)(`span`,{className:`turn-plan-card-step-marker`,"aria-hidden":`true`}),(0,I.jsxs)(`span`,{className:`turn-plan-card-step-index`,children:[t+1,`.`]}),(0,I.jsx)(`span`,{className:`turn-plan-card-step-text`,children:e.step})]},`${t}-${e.step}`))})]})}),zS=(0,F.memo)(function({item:e,plan:t,turnStatus:n,streaming:r=!1,textVisible:i,outputVisible:a,onCopy:o,onFork:s,onPlan:c,onRollback:l,onReview:u,onEdit:d,onContext:f,onOpenFile:p,providerId:m,turnId:h,showRollback:g=!1,rollbackPending:_=!1,rollbackDisabled:v=!1}){let[y,b]=(0,F.useState)(e.type===`commandExecution`?e.status===`inProgress`:!1),[x]=(0,F.useState)(()=>e.type===`userMessage`?new Intl.DateTimeFormat([],{hour:`numeric`,minute:`2-digit`}).format(new Date):``),S=(0,F.useRef)(e.type===`commandExecution`?e.status:null),C=e.type===`commandExecution`?e.status:null;if((0,F.useEffect)(()=>{if(e.type!==`commandExecution`||!C){S.current=null;return}let t=null,n=null;return C===`inProgress`?t=window.requestAnimationFrame(()=>{b(!0)}):S.current===`inProgress`&&(n=window.setTimeout(()=>b(!1),1e3)),S.current=C,()=>{t!==null&&window.cancelAnimationFrame(t),n!==null&&window.clearTimeout(n)}},[C,e.type]),e.type===`userMessage`){let t=fs(e,m),n=new Set(t.fileAttachments.map(e=>AS(e.label,e.path))),r=e.content.filter(e=>e.type===`skill`?!0:e.type===`mention`?!n.has(AS(e.name,e.path)):!1);return(0,I.jsxs)(`div`,{className:`msg user`,onContextMenu:t=>f(t,e),children:[(0,I.jsxs)(`div`,{className:`mb`,children:[t.images.length>0?(0,I.jsx)(`div`,{className:`message-image-list`,children:t.images.map((t,n)=>{let r=ms(t,m);return r?(0,I.jsx)(NS,{alt:`Message image preview`,url:r},`${e.id}-image-${n}`):null})}):null,t.fileAttachments.length>0||r.length>0?(0,I.jsxs)(`div`,{className:`attachment-row`,children:[t.fileAttachments.map(t=>{let n=mf(t.label,t.path);return(0,I.jsxs)(`button`,{className:H(`attachment-chip attachment-chip-file file-link-button`,`file-tone-${n.tone}`),onClick:()=>p(t.path),title:t.path,type:`button`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`file-chip-preview`,children:(0,I.jsx)(`span`,{className:`file-chip-ext`,children:n.badge})}),(0,I.jsxs)(`span`,{className:`file-chip-copy`,children:[(0,I.jsx)(`span`,{className:`file-chip-title`,children:n.title}),(0,I.jsx)(`span`,{className:`file-chip-meta`,children:n.kindLabel})]})]},`${e.id}-file-${t.path}`)}),r.map(t=>{if(t.type===`mention`){let n=mf(t.name,t.path);return(0,I.jsxs)(`button`,{className:H(`attachment-chip attachment-chip-file file-link-button`,`file-tone-${n.tone}`),onClick:()=>p(t.path),title:t.path,type:`button`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`file-chip-preview`,children:(0,I.jsx)(`span`,{className:`file-chip-ext`,children:n.badge})}),(0,I.jsxs)(`span`,{className:`file-chip-copy`,children:[(0,I.jsx)(`span`,{className:`file-chip-title`,children:n.title}),(0,I.jsx)(`span`,{className:`file-chip-meta`,children:n.kindLabel})]})]},`${e.id}-${t.type}-${t.name}`)}return(0,I.jsxs)(`span`,{className:`attachment-chip`,children:[(0,I.jsx)(`span`,{children:`📋`}),(0,I.jsx)(`span`,{children:t.name})]},`${e.id}-${t.type}-${t.name}`)})]}):null,t.text?(0,I.jsx)(LS,{onOpenFile:p,providerId:m,text:t.text}):null,(0,I.jsx)(`div`,{className:`msg-time`,children:x})]}),(0,I.jsxs)(`div`,{className:`macts`,children:[g?(0,I.jsx)(`button`,{className:H(`mact rollback`,_&&`is-loading`),disabled:v,title:_?`Rolling back from this prompt…`:v?`Wait for the current response to finish before rolling back.`:`Remove this prompt and everything after it.`,type:`button`,onClick:()=>l(h),children:_?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`mact-spinner`}),`Rolling back…`]}):`↶ Rollback`}):null,(0,I.jsx)(`button`,{className:`mact`,type:`button`,onClick:()=>o(t.text),children:`📋 Copy`}),(0,I.jsx)(`button`,{className:`mact`,type:`button`,onClick:()=>d(t.text),children:`✏ Edit`})]})]})}if(e.type===`agentMessage`){let t=typeof i==`number`?e.text.slice(0,i):e.text;return(0,I.jsxs)(`div`,{className:H(`msg assistant`,r&&`streaming`),onContextMenu:t=>f(t,e),children:[(0,I.jsxs)(`div`,{className:`mh`,children:[(0,I.jsx)(`div`,{className:`mav a`,children:`⬡`}),(0,I.jsx)(`span`,{className:`mn`,children:gS}),(0,I.jsx)(`span`,{className:`mt`,children:n===`inProgress`?`live`:n})]}),(0,I.jsx)(`div`,{className:`mb`,children:t?r?(0,I.jsx)(IS,{onOpenFile:p,providerId:m,showCursor:r,streaming:r,text:t}):(0,I.jsx)(IS,{onOpenFile:p,providerId:m,text:t}):null}),(0,I.jsxs)(`div`,{className:`macts`,children:[(0,I.jsx)(`button`,{className:`mact`,type:`button`,onClick:()=>s(),children:`⑂ /fork`}),(0,I.jsx)(`button`,{className:`mact`,type:`button`,onClick:()=>c(),children:`📋 /plan`}),(0,I.jsx)(`button`,{className:`mact`,type:`button`,onClick:()=>o(e.text),children:`📋`})]})]})}if(e.type===`reasoning`)return null;if(e.type===`plan`)return(0,I.jsx)(RS,{itemText:e.text,plan:t});if(e.type===`commandExecution`){let t=typeof a==`number`&&e.aggregatedOutput?e.aggregatedOutput.slice(0,a):e.aggregatedOutput??``,n=wS(e),r=kS(e);return(0,I.jsxs)(`div`,{className:H(`cmd-inline`,n,y&&`open`),children:[(0,I.jsxs)(`button`,{className:H(`cmd-inline-row`,n,y&&`open`),type:`button`,onClick:()=>b(e=>!e),children:[(0,I.jsxs)(`div`,{className:`cmd-inline-window-bar`,children:[(0,I.jsxs)(`div`,{className:`cmd-inline-traffic`,"aria-hidden":`true`,children:[(0,I.jsx)(`span`,{className:`cmd-inline-dot close`}),(0,I.jsx)(`span`,{className:`cmd-inline-dot minimize`}),(0,I.jsx)(`span`,{className:`cmd-inline-dot zoom`})]}),(0,I.jsx)(`span`,{className:`cmd-inline-shell meta-glint`,children:r.shellLabel}),(0,I.jsx)(`span`,{className:H(`cmd-inline-status-chip`,`meta-glint`,n),children:CS(e)})]}),(0,I.jsxs)(`div`,{className:`cmd-inline-main`,children:[(0,I.jsx)(`span`,{className:H(`cmd-inline-chevron`,y&&`open`),children:`▶`}),(0,I.jsxs)(`div`,{className:`cmd-inline-copy`,children:[(0,I.jsx)(`code`,{className:`cmd-inline-label`,children:r.commandText}),(0,I.jsxs)(`div`,{className:`cmd-inline-meta-line`,children:[(0,I.jsx)(`span`,{className:`cmd-inline-meta-pill`,children:r.cwdText}),(0,I.jsx)(`span`,{className:`cmd-inline-meta-pill`,children:r.processText}),r.durationText?(0,I.jsx)(`span`,{className:`cmd-inline-meta-pill`,children:r.durationText}):null]})]})]})]}),y?(0,I.jsxs)(`div`,{className:`cmd-inline-output`,children:[(0,I.jsxs)(`div`,{className:`cmd-inline-output-head`,children:[(0,I.jsx)(`span`,{children:`Output`}),(0,I.jsx)(`span`,{children:e.cwd})]}),(0,I.jsx)(`pre`,{children:t||`(no output)`})]}):null]})}if(e.type===`fileChange`)return(0,I.jsx)(BS,{item:e,onReview:u});if(e.type===`mcpToolCall`){let t=e.result?JSON.stringify(e.result.structuredContent??e.result.content??{},null,2):e.error?.message??`No output`;return(0,I.jsxs)(`div`,{className:H(`tool`,e.error?`err`:`ok`),children:[(0,I.jsxs)(`div`,{className:`tool-h`,children:[(0,I.jsxs)(`span`,{className:`meta-glint`,children:[e.error?`✗`:`✓`,` MCP · `,e.server,`/`,e.tool]}),(0,I.jsx)(`span`,{className:`tbadge meta-glint`,children:e.status})]}),(0,I.jsx)(`div`,{className:`tool-b`,children:(0,I.jsx)(`pre`,{className:`tool-pre`,children:t})})]})}return e.type===`dynamicToolCall`?(0,I.jsxs)(`div`,{className:H(`tool`,e.success?`ok`:`run`),children:[(0,I.jsxs)(`div`,{className:`tool-h`,children:[(0,I.jsxs)(`span`,{className:`meta-glint`,children:[e.success?`✓`:`↻`,` Tool · `,e.tool]}),(0,I.jsx)(`span`,{className:`tbadge meta-glint`,children:e.status})]}),(0,I.jsx)(`div`,{className:`tool-b`,children:e.contentItems?.map((t,n)=>(0,I.jsx)(`div`,{children:JSON.stringify(t)},`${e.id}-${n}`))??`No tool payload.`})]}):e.type===`collabAgentToolCall`?(0,I.jsxs)(`div`,{className:`agc`,children:[(0,I.jsxs)(`div`,{className:`agh`,children:[(0,I.jsx)(`div`,{className:`agdot`}),(0,I.jsxs)(`span`,{className:`agn meta-glint`,children:[`⑂ `,e.tool]}),(0,I.jsx)(`span`,{className:`ags meta-glint`,children:e.status})]}),(0,I.jsx)(`div`,{className:`agt`,children:e.prompt??`Subagent activity`}),(0,I.jsx)(`div`,{className:`agprog`,children:(0,I.jsx)(`div`,{className:`agbar`,style:{width:e.status===`completed`?`100%`:`58%`}})})]}):e.type===`webSearch`?(0,I.jsxs)(`div`,{className:`tool ok`,children:[(0,I.jsxs)(`div`,{className:`tool-h`,children:[(0,I.jsx)(`span`,{className:`meta-glint`,children:`✓ Web search`}),(0,I.jsx)(`span`,{className:`tbadge meta-glint`,children:`search`})]}),(0,I.jsx)(`div`,{className:`tool-b`,children:e.query})]}):e.type===`imageView`?(0,I.jsxs)(`div`,{className:`image-card`,children:[(0,I.jsxs)(`div`,{className:`tool-h`,children:[(0,I.jsx)(`span`,{className:`meta-glint`,children:`🖼 Image`}),(0,I.jsx)(`span`,{className:`tbadge meta-glint`,children:`view`})]}),(0,I.jsx)(`div`,{className:`tool-b`,children:e.path})]}):e.type===`imageGeneration`?(0,I.jsxs)(`div`,{className:`tool ok`,children:[(0,I.jsxs)(`div`,{className:`tool-h`,children:[(0,I.jsx)(`span`,{className:`meta-glint`,children:`✓ Image generation`}),(0,I.jsx)(`span`,{className:`tbadge meta-glint`,children:e.status})]}),(0,I.jsxs)(`div`,{className:`tool-b`,children:[(0,I.jsx)(`div`,{children:e.revisedPrompt}),(0,I.jsx)(`div`,{children:e.result})]})]}):e.type===`enteredReviewMode`||e.type===`exitedReviewMode`?(0,I.jsxs)(`div`,{className:`compact-bar`,children:[(0,I.jsx)(`span`,{className:`compact-ico`,children:e.type===`enteredReviewMode`?`🔍`:`✓`}),(0,I.jsx)(`span`,{className:`meta-glint`,children:e.review})]}):e.type===`contextCompaction`?(0,I.jsxs)(`div`,{className:`compact-bar`,children:[(0,I.jsx)(`span`,{className:`compact-ico`,children:`🗜`}),(0,I.jsx)(`span`,{className:`meta-glint`,children:`Conversation compacted to free context tokens.`})]}):null});function BS({item:e,onReview:t}){let n=e.status===`inProgress`?`editing`:e.status===`completed`?`applied`:e.status===`failed`?`failed`:e.status;return(0,I.jsx)(I.Fragment,{children:(e.changes.length>0?e.changes:[{path:`Editing files`,kind:{type:`update`,move_path:null},diff:``}]).map((r,i)=>(0,I.jsxs)(`div`,{className:H(`dw`,e.status===`inProgress`&&`live`,r.kind.type===`add`&&`new-file`),"data-change-kind":r.kind.type,children:[(0,I.jsxs)(`div`,{className:`dh`,children:[(0,I.jsxs)(`span`,{className:`meta-glint`,children:[`📄 `,r.path]}),(0,I.jsxs)(`div`,{className:`diff-head-actions`,children:[(0,I.jsx)(`button`,{className:`diff-review`,type:`button`,onClick:()=>t(vf(e.id,i,r.path)),children:`Review diff`}),(0,I.jsxs)(`span`,{className:`dstats`,children:[r.kind.type===`add`?(0,I.jsx)(`span`,{className:`diff-new`,children:`new`}):null,r.kind.type===`update`?(0,I.jsx)(`span`,{className:`diff-mod`,children:`mod`}):null,r.kind.type===`delete`?(0,I.jsx)(`span`,{className:`diff-del`,children:`del`}):null,(0,I.jsx)(`span`,{className:H(`diff-status`,e.status===`inProgress`&&`live`,e.status===`failed`&&`err`),children:n})]})]})]}),r.diff?r.diff.split(`
|
|
208
208
|
`).map((e,t)=>(0,I.jsx)(`div`,{className:H(`dl`,e.startsWith(`+`)&&`add`,e.startsWith(`-`)&&`rem`,!e.startsWith(`+`)&&!e.startsWith(`-`)&&`ctx`),children:e},`${r.path}-${t}`)):(0,I.jsx)(`div`,{className:`dl ctx`,children:`Waiting for diff…`})]},`${e.id}-${r.path}-${i}`))})}var VS=(e,t)=>{switch(t){case`accept`:switch(e.kind){case`command`:return`Run command`;case`patch`:return`Apply changes`;case`permissions`:return`Grant access`;default:return`Approve`}case`acceptForSession`:switch(e.kind){case`command`:return`Allow for session`;case`patch`:return`Allow writes for session`;case`permissions`:return`Grant for session`;default:return`Allow for session`}case`cancel`:return`Cancel`;default:return`Decline`}},HS=e=>{switch(e){case`accept`:case`acceptForSession`:return`approve`;case`cancel`:return`neutral`;default:return`danger`}};function US({approval:e,mcpContentText:t,onMcpContentChange:n,onResolve:r,onSubmitMcp:i}){let a=e.availableDecisions&&e.availableDecisions.length>0?e.availableDecisions:[`accept`,`decline`],o=e.state===`pending`;return(0,I.jsxs)(`div`,{className:`approval-request-card`,children:[(0,I.jsxs)(`div`,{className:`approval-request-head`,children:[(0,I.jsxs)(`div`,{className:`approval-request-copy`,children:[(0,I.jsx)(`strong`,{children:e.title}),(0,I.jsx)(`span`,{children:e.detail})]}),(0,I.jsxs)(`div`,{className:`approval-request-badges`,children:[(0,I.jsx)(`span`,{className:H(`approval-request-risk`,e.risk),children:e.risk}),(0,I.jsx)(`span`,{className:`approval-request-state`,children:e.state})]})]}),e.kind===`question`?null:(0,I.jsxs)(`div`,{className:`approval-request-body`,children:[e.command?(0,I.jsxs)(`div`,{className:`approval-request-block`,children:[(0,I.jsx)(`div`,{className:`approval-request-label`,children:`Command`}),(0,I.jsx)(`code`,{className:`approval-request-command`,children:e.command})]}):null,e.cwd?(0,I.jsxs)(`div`,{className:`approval-request-meta`,children:[(0,I.jsx)(`span`,{className:`approval-request-label`,children:`Working directory`}),(0,I.jsx)(`span`,{className:`approval-request-value`,children:e.cwd})]}):null,e.files&&e.files.length>0?(0,I.jsxs)(`div`,{className:`approval-request-block`,children:[(0,I.jsx)(`div`,{className:`approval-request-label`,children:e.kind===`patch`?`Paths`:`Files`}),(0,I.jsx)(`div`,{className:`approval-request-list`,children:e.files.map(e=>(0,I.jsx)(`span`,{className:`approval-request-item`,children:e},e))})]}):null,e.permissionsSummary&&e.permissionsSummary.length>0?(0,I.jsxs)(`div`,{className:`approval-request-block`,children:[(0,I.jsx)(`div`,{className:`approval-request-label`,children:`Requested access`}),(0,I.jsx)(`div`,{className:`approval-request-list`,children:e.permissionsSummary.map(e=>(0,I.jsx)(`span`,{className:`approval-request-item`,children:e},e))})]}):null,e.kind===`mcp`?(0,I.jsxs)(I.Fragment,{children:[e.serverName?(0,I.jsxs)(`div`,{className:`approval-request-meta`,children:[(0,I.jsx)(`span`,{className:`approval-request-label`,children:`Server`}),(0,I.jsx)(`span`,{className:`approval-request-value`,children:e.serverName})]}):null,e.form?(0,I.jsxs)(`div`,{className:`approval-request-block`,children:[(0,I.jsx)(`div`,{className:`approval-request-label`,children:`Prompt details`}),(0,I.jsx)(`pre`,{className:`approval-request-pre`,children:e.form})]}):null,(0,I.jsxs)(`div`,{className:`approval-request-block`,children:[(0,I.jsx)(`label`,{className:`approval-request-label`,htmlFor:`approval-mcp-${e.id}`,children:`Response`}),(0,I.jsx)(`textarea`,{className:`approval-request-textarea`,id:`approval-mcp-${e.id}`,onChange:e=>n(e.target.value),placeholder:`Provide the response to send back to the MCP server.`,rows:5,value:t})]})]}):null]}),(0,I.jsx)(`div`,{className:`approval-request-actions`,children:e.kind===`mcp`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{className:`approval-request-button approve`,disabled:!o,onClick:()=>i(`accept`,t),type:`button`,children:`Send response`}),(0,I.jsx)(`button`,{className:`approval-request-button danger`,disabled:!o,onClick:()=>i(`decline`,t),type:`button`,children:`Decline`}),(0,I.jsx)(`button`,{className:`approval-request-button neutral`,disabled:!o,onClick:()=>i(`cancel`,t),type:`button`,children:`Cancel`})]}):a.map(t=>(0,I.jsx)(`button`,{className:H(`approval-request-button`,HS(t)),disabled:!o,onClick:()=>r(t),type:`button`,children:VS(e,t)},`${e.id}:${t}`))})]})}var WS=(0,F.memo)(function({branchLabel:e,dirty:t,hasStagedChanges:n,message:r,preferencesPath:i,providers:a,selectedProviderId:o,summary:s,generating:c,committing:l,onCommit:u,onGenerate:d,onMessageChange:f,onProviderChange:p}){let m=a.find(e=>e.id===o)??a[0]??null,h=c||l;return(0,I.jsxs)(`section`,{className:`commit-composer-card`,children:[(0,I.jsxs)(`div`,{className:`commit-composer-head`,children:[(0,I.jsxs)(`div`,{className:`commit-composer-copy`,children:[(0,I.jsx)(`div`,{className:`commit-composer-title`,children:`Commit changes`}),(0,I.jsxs)(`div`,{className:`commit-composer-meta`,children:[(0,I.jsx)(`span`,{children:e}),(0,I.jsx)(`span`,{children:s||(t?`Working tree ready`:`Working tree clean`)})]})]}),(0,I.jsx)(`button`,{className:`commit-generate-button`,disabled:!t||h,onClick:d,type:`button`,children:c?`Generating…`:`Generate`})]}),(0,I.jsxs)(`div`,{className:`commit-composer-toolbar`,children:[(0,I.jsxs)(`label`,{className:`commit-provider-field`,children:[(0,I.jsx)(`span`,{children:`Provider`}),(0,I.jsx)(`select`,{className:`commit-provider-select`,disabled:h,onChange:e=>p(e.target.value),value:o,children:a.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.displayName},e.id))})]}),(0,I.jsxs)(`div`,{className:`commit-provider-note`,children:[(0,I.jsx)(`strong`,{children:m?.displayName??`Provider`}),(0,I.jsx)(`span`,{children:i?`Saved per project in .nomadex/project.json`:`Using the current workspace provider`})]})]}),(0,I.jsx)(`textarea`,{className:`commit-message-input`,disabled:l,onChange:e=>f(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),!l&&r.trim()&&u())},placeholder:`feat(scope): short summary`,rows:4,value:r}),(0,I.jsxs)(`div`,{className:`commit-composer-footer`,children:[(0,I.jsx)(`div`,{className:`commit-composer-hint`,children:n?`Commits the staged files.`:t?`Stages all current files first, then commits.`:`No pending files to commit.`}),(0,I.jsx)(`button`,{className:`commit-submit-button`,disabled:!t||!r.trim()||h,onClick:u,type:`button`,children:l?`Committing…`:`Commit`})]})]})}),GS=[`var(--ac)`,`var(--ac2)`,`var(--ac3)`,`var(--gn)`,`var(--og)`],KS=e=>e.kind===`head`||e.active?`current`:e.kind===`remote`?`remote`:e.kind===`tag`?`tag`:`local`,qS=(e,t,n)=>{let r=e.padEnd(t,` `);return(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`git-activity-graph-text`,children:Array.from(r).map((e,t)=>{if(e===` `)return(0,I.jsx)(`span`,{className:`git-activity-graph-char`,children:` `},`blank:${t}`);let r=n[t%n.length]??`var(--ac)`;return(0,I.jsx)(`span`,{className:H(`git-activity-graph-char`,`on`,e===`*`&&`node`),style:{"--graph-accent":r},children:e},`${e}:${t}`)})})},JS=(0,F.memo)(function({model:e,onOpenThread:t}){let n=e.lanes.length>0?e.lanes.map(e=>e.accent):GS;return(0,I.jsxs)(`section`,{className:`git-activity-card`,children:[(0,I.jsxs)(`div`,{className:`git-activity-toolbar`,children:[(0,I.jsxs)(`div`,{className:`git-activity-copy`,children:[(0,I.jsx)(`div`,{className:`git-activity-title`,children:`Git Graph`}),(0,I.jsx)(`div`,{className:`git-activity-meta`,children:e.repoLabel})]}),(0,I.jsxs)(`div`,{className:`git-activity-summary`,children:[(0,I.jsx)(`span`,{className:`git-activity-summary-label`,children:e.branchLabel}),e.commitLabel?(0,I.jsx)(`code`,{className:`git-activity-summary-code`,children:e.commitLabel}):null]})]}),e.lanes.length>0?(0,I.jsx)(`div`,{className:`git-activity-legend`,role:`list`,"aria-label":`Branch legend`,children:e.lanes.map(e=>(0,I.jsxs)(`div`,{className:H(`git-activity-legend-item`,e.emphasis),role:`listitem`,style:{"--lane-accent":e.accent},children:[(0,I.jsx)(`span`,{className:`git-activity-legend-swatch`}),(0,I.jsx)(`span`,{className:`git-activity-legend-label`,children:e.label})]},e.id))}):null,e.workingTree?(0,I.jsxs)(`div`,{className:`git-working-tree-card`,children:[(0,I.jsxs)(`div`,{className:`git-working-tree-toolbar`,children:[(0,I.jsx)(`div`,{className:`git-working-tree-title`,children:`Working tree`}),(0,I.jsx)(`div`,{className:H(`git-working-tree-summary`,e.workingTree.dirty&&`dirty`),children:e.workingTree.summary})]}),e.workingTree.buckets.length>0?(0,I.jsx)(`div`,{className:`git-working-tree-grid`,children:e.workingTree.buckets.map(e=>(0,I.jsxs)(`div`,{className:`git-working-tree-group`,children:[(0,I.jsxs)(`div`,{className:`git-working-tree-group-head`,children:[(0,I.jsx)(`span`,{children:e.label}),(0,I.jsx)(`span`,{children:e.entries.length})]}),(0,I.jsxs)(`div`,{className:`git-working-tree-list`,children:[e.entries.slice(0,6).map(e=>(0,I.jsxs)(`div`,{className:`git-working-tree-item`,children:[(0,I.jsx)(`span`,{className:H(`git-working-tree-badge`,e.kind),children:e.badge}),(0,I.jsx)(`span`,{className:`git-working-tree-path`,title:e.originalPath?`${e.originalPath} -> ${e.path}`:e.path,children:e.path})]},e.id)),e.entries.length>6?(0,I.jsxs)(`div`,{className:`git-working-tree-more`,children:[`+`,e.entries.length-6,` more`]}):null]})]},e.id))}):(0,I.jsx)(`div`,{className:`git-working-tree-clean`,children:`No uncommitted files in this repo.`})]}):null,(0,I.jsxs)(`div`,{className:`git-activity-table`,children:[(0,I.jsxs)(`div`,{className:`git-activity-table-head`,children:[(0,I.jsx)(`div`,{className:`git-activity-graph-head`,style:{width:`${Math.max(e.graphWidth,4)+1}ch`}}),(0,I.jsx)(`div`,{className:`git-activity-head-message`,children:`Message`}),(0,I.jsx)(`div`,{className:`git-activity-head-date`,children:`Date`}),(0,I.jsx)(`div`,{className:`git-activity-head-author`,children:`Author`}),(0,I.jsx)(`div`,{className:`git-activity-head-sha`,children:`Commit`})]}),(0,I.jsx)(`div`,{className:`git-activity-table-body`,children:e.rows.map(r=>{let i=!!(r.threadId&&t),a=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`git-activity-graph-cell`,style:{width:`${Math.max(e.graphWidth,4)+1}ch`},children:qS(r.graph,Math.max(e.graphWidth,4),n)}),(0,I.jsxs)(`div`,{className:`git-activity-message-cell`,title:r.hint??r.subject,children:[r.refs.length>0?(0,I.jsx)(`div`,{className:`git-activity-ref-row`,children:r.refs.slice(0,3).map(e=>(0,I.jsx)(`span`,{className:H(`git-activity-ref`,KS(e)),children:e.label},e.id))}):null,(0,I.jsx)(`div`,{className:`git-activity-message-text`,children:r.subject})]}),(0,I.jsx)(`div`,{className:`git-activity-cell git-activity-date-cell`,children:r.dateLabel}),(0,I.jsx)(`div`,{className:`git-activity-cell git-activity-author-cell`,children:r.author}),(0,I.jsx)(`code`,{className:`git-activity-cell git-activity-sha-cell`,children:r.sha})]});return i&&r.threadId&&t?(0,I.jsx)(`button`,{className:H(`git-activity-table-row`,r.emphasis,`interactive`),onClick:()=>t(r.threadId),type:`button`,children:a},r.id):(0,I.jsx)(`div`,{className:H(`git-activity-table-row`,r.emphasis),children:a},r.id)})})]})]})});function YS({approval:e,answers:t,onAnswerChange:n,onSubmit:r}){let i=e.questions??[],a=i.length>0&&i.every(e=>(t[e.id]??``).trim().length>0);return(0,I.jsxs)(`div`,{className:`question-request-card`,children:[(0,I.jsxs)(`div`,{className:`question-request-head`,children:[(0,I.jsxs)(`div`,{className:`question-request-copy`,children:[(0,I.jsx)(`strong`,{children:e.title}),(0,I.jsx)(`span`,{children:e.detail})]}),(0,I.jsx)(`span`,{className:`question-request-state`,children:e.state})]}),(0,I.jsx)(`div`,{className:`question-request-body`,children:i.map((e,r)=>{let i=t[e.id]??``,a=e.isOther||(e.options?.length??0)===0;return(0,I.jsxs)(`div`,{className:`question-request-item`,children:[(0,I.jsxs)(`div`,{className:`question-request-item-head`,children:[(0,I.jsxs)(`span`,{className:`question-request-index`,children:[r+1,`.`]}),(0,I.jsxs)(`div`,{className:`question-request-item-copy`,children:[(0,I.jsx)(`span`,{className:`question-request-header`,children:e.header}),(0,I.jsx)(`div`,{className:`question-request-text`,children:e.question})]})]}),e.options&&e.options.length>0?(0,I.jsx)(`div`,{className:`question-request-options`,children:e.options.map(t=>(0,I.jsxs)(`button`,{className:H(`question-request-option`,i===t.label&&`active`),onClick:()=>n(e.id,t.label),type:`button`,children:[(0,I.jsx)(`span`,{className:`question-request-option-label`,children:t.label}),t.description?(0,I.jsx)(`span`,{className:`question-request-option-description`,children:t.description}):null]},`${e.id}:${t.label}`))}):null,a?(0,I.jsx)(`input`,{className:`question-request-input`,onChange:t=>n(e.id,t.target.value),placeholder:e.isSecret?`Enter value`:`Type your answer`,type:e.isSecret?`password`:`text`,value:i}):null]},e.id)})}),(0,I.jsx)(`div`,{className:`question-request-actions`,children:(0,I.jsx)(`button`,{className:`question-request-submit`,disabled:!a||e.state!==`pending`,onClick:r,type:`button`,children:`Submit answers`})})]})}var XS=e=>{if(!e)return`Reset time unavailable`;let t=new Date(e*1e3),n=Date.now();return t.getTime()-n<=1e3*60*60*24?`Resets ${t.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}`:`Resets ${t.toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}`},ZS=(e,t)=>t?[e.name,e.description,e.scope??``,e.repo??``,e.downloads??``,...e.tags??[]].join(` `).toLowerCase().includes(t):!0,QS=(0,F.memo)(function({snapshot:e,actions:t,onClose:n,pushToast:r}){let[i,a]=(0,F.useState)(``),o=i.trim().toLowerCase(),s=(0,F.useMemo)(()=>e.installedSkills.filter(e=>e.enabled).length,[e.installedSkills]),c=(0,F.useMemo)(()=>e.installedSkills.filter(e=>ZS(e,o)),[o,e.installedSkills]),l=(0,F.useMemo)(()=>e.remoteSkills.filter(e=>ZS(e,o)),[o,e.remoteSkills]);return(0,F.useEffect)(()=>{let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[n]),(0,I.jsx)(`div`,{className:`skills-library-overlay`,onClick:e=>{e.target===e.currentTarget&&n()},children:(0,I.jsxs)(`div`,{className:`skills-library-modal`,children:[(0,I.jsxs)(`div`,{className:`skills-library-hero`,children:[(0,I.jsxs)(`div`,{className:`skills-library-copy`,children:[(0,I.jsx)(`div`,{className:`skills-library-kicker`,children:`Nomadex Skill Library`}),(0,I.jsx)(`div`,{className:`skills-library-title`,children:`Manage installed and remote skills in one place`}),(0,I.jsx)(`div`,{className:`skills-library-subtitle`,children:`Toggle what stays active globally, browse marketplace packs, and keep the composer focused on actual prompts instead of setup.`})]}),(0,I.jsx)(`button`,{"aria-label":`Close skill library`,className:`skills-library-close`,onClick:n,type:`button`,children:`×`})]}),(0,I.jsxs)(`div`,{className:`skills-library-toolbar`,children:[(0,I.jsxs)(`div`,{className:`skills-library-stats`,children:[(0,I.jsxs)(`div`,{className:`skills-library-stat`,children:[(0,I.jsx)(`strong`,{children:e.installedSkills.length}),(0,I.jsx)(`span`,{children:`Installed`})]}),(0,I.jsxs)(`div`,{className:`skills-library-stat`,children:[(0,I.jsx)(`strong`,{children:s}),(0,I.jsx)(`span`,{children:`Enabled`})]}),(0,I.jsxs)(`div`,{className:`skills-library-stat`,children:[(0,I.jsx)(`strong`,{children:e.remoteSkills.length}),(0,I.jsx)(`span`,{children:`Marketplace`})]})]}),(0,I.jsx)(`input`,{autoFocus:!0,className:`skills-library-search`,onChange:e=>a(e.target.value),placeholder:`Search skills, tags, repo, or description…`,value:i})]}),(0,I.jsxs)(`div`,{className:`skills-library-grid`,children:[(0,I.jsxs)(`section`,{className:`skills-library-pane`,children:[(0,I.jsxs)(`div`,{className:`skills-library-pane-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`skills-library-pane-title`,children:`Installed`}),(0,I.jsx)(`div`,{className:`skills-library-pane-copy`,children:`Toggle globally available skills and inspect their local path.`})]}),(0,I.jsx)(`span`,{className:`skills-library-pane-count`,children:c.length})]}),(0,I.jsx)(`div`,{className:`skills-library-list`,children:c.length===0?(0,I.jsx)(`div`,{className:`skills-library-empty`,children:`No installed skills matched this search.`}):c.map(e=>(0,I.jsxs)(`article`,{className:H(`skills-library-card installed`,e.enabled&&`enabled`),children:[(0,I.jsxs)(`div`,{className:`skills-library-card-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`skills-library-card-title`,children:e.name}),(0,I.jsxs)(`div`,{className:`skills-library-card-meta`,children:[(0,I.jsx)(`span`,{className:`skills-library-chip`,children:e.scope}),(0,I.jsx)(`span`,{className:H(`skills-library-chip`,e.enabled&&`live`),children:e.enabled?`Enabled`:`Disabled`})]})]}),(0,I.jsx)(`button`,{className:H(`skills-library-action`,e.enabled&&`active`),onClick:()=>void t.toggleInstalledSkill(e.id),type:`button`,children:e.enabled?`Disable`:`Enable`})]}),(0,I.jsx)(`div`,{className:`skills-library-card-description`,children:e.description}),e.tags.length>0?(0,I.jsx)(`div`,{className:`skills-library-tag-row`,children:e.tags.map(e=>(0,I.jsx)(`span`,{className:`skills-library-tag`,children:e},e))}):null,(0,I.jsx)(`code`,{className:`skills-library-path`,children:e.path})]},e.id))})]}),(0,I.jsxs)(`section`,{className:`skills-library-pane marketplace`,children:[(0,I.jsxs)(`div`,{className:`skills-library-pane-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`skills-library-pane-title`,children:`Marketplace`}),(0,I.jsx)(`div`,{className:`skills-library-pane-copy`,children:`Install remote skills into your local workspace catalog.`})]}),(0,I.jsx)(`span`,{className:`skills-library-pane-count`,children:l.length})]}),(0,I.jsx)(`div`,{className:`skills-library-list`,children:l.length===0?(0,I.jsx)(`div`,{className:`skills-library-empty`,children:`No marketplace skills matched this search.`}):l.map(e=>(0,I.jsxs)(`article`,{className:`skills-library-card remote`,children:[(0,I.jsxs)(`div`,{className:`skills-library-card-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`skills-library-card-title`,children:e.name}),(0,I.jsxs)(`div`,{className:`skills-library-card-meta`,children:[(0,I.jsxs)(`span`,{className:`skills-library-chip`,children:[e.downloads,` downloads`]}),(0,I.jsx)(`span`,{className:`skills-library-chip`,children:e.repo})]})]}),(0,I.jsx)(`button`,{className:`skills-library-action install`,onClick:()=>{t.installSkill(e.id),r(`Installing ${e.name}`,`ok`)},type:`button`,children:`Install`})]}),(0,I.jsx)(`div`,{className:`skills-library-card-description`,children:e.description}),e.tags.length>0?(0,I.jsx)(`div`,{className:`skills-library-tag-row`,children:e.tags.map(e=>(0,I.jsx)(`span`,{className:`skills-library-tag`,children:e},e))}):null]},e.id))})]})]})]})})}),$S=(0,F.memo)(function({activeTheme:e,onClose:t,onSelect:n,themes:r}){return(0,I.jsx)(`div`,{className:`theme-picker-overlay`,onClick:e=>{e.target===e.currentTarget&&t()},children:(0,I.jsxs)(`div`,{id:`tpicker`,children:[(0,I.jsxs)(`div`,{className:`tpicker-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`tpicker-title`,children:`Theme`}),(0,I.jsx)(`div`,{className:`tpicker-subtitle`,children:`Shell palettes for Nomadex.`})]}),(0,I.jsx)(`button`,{className:`tpicker-close`,onClick:t,type:`button`,"aria-label":`Close theme picker`,children:`×`})]}),(0,I.jsx)(`div`,{className:`tpicker-grid`,children:r.map(t=>(0,I.jsxs)(`button`,{className:H(`theme-card`,e===t.id&&`active`),onClick:()=>n(t.id),type:`button`,children:[(0,I.jsxs)(`div`,{className:`theme-card-preview`,children:[(0,I.jsx)(`span`,{className:`theme-card-surface`,style:{background:t.swatches[0]}}),(0,I.jsx)(`span`,{className:`theme-card-accent`,style:{background:t.swatches[1]}}),(0,I.jsx)(`span`,{className:`theme-card-accent`,style:{background:t.swatches[2]}})]}),(0,I.jsxs)(`div`,{className:`theme-card-copy`,children:[(0,I.jsxs)(`div`,{className:`theme-card-name`,children:[t.name,(0,I.jsx)(`span`,{className:`theme-card-mode`,children:t.mode})]}),(0,I.jsx)(`div`,{className:`theme-card-description`,children:t.description})]})]},t.id))})]})})}),eC=(0,F.memo)(function({snapshot:e,activeThreadLabel:t,actions:n,pushToast:r,selectModel:i,activeTheme:a,onOpenSkills:o,onOpenTheme:s}){let[c,l]=(0,F.useState)(``),[u,d]=(0,F.useState)({key:``,value:``}),f=a.charAt(0).toUpperCase()+a.slice(1),p=e.providers.find(t=>t.id===e.settings.provider)??e.providers[0],m=p?Zo(p.id,e.models):e.models,h=p?.transportKind===`cli`,g=p?e.providerSetup[p.id]:null,_=p?e.providerAuth[p.id]:null,v=_?.status===`starting`||_?.status===`waiting`||_?.status===`checking`,y=h?p?.id===`opencode`&&_?.status===`waiting`?`Paste the OpenCode Zen API key below`:_?.status===`waiting`?`Finish sign-in below`:g?.status===`ready`?`Local CLI session ready`:`Sign in or configure this local CLI`:`${e.account.planType} · ${e.account.authMode}`,b=h?v?_?.status===`checking`?`Checking`:`Signing in…`:g?.status===`ready`?`Ready`:`External`:e.account.loginInProgress?`Signing in…`:e.account.loggedIn?`Active`:`Signed out`,x=p?.id===`opencode`?`Use OpenCode Zen`:p?.id===`qwen-code`?`Use Qwen Code`:`Use ${p?.displayName??`provider`}`,S=h&&(g?.authenticated===!0||g?.status===`ready`||_?.status===`completed`),C=g?g.status===`ready`?`Ready`:g.status===`checking`?`Checking`:g.status===`needsInstall`?`Install`:g.status===`needsAuth`?`Sign in`:g.status===`needsConfig`?`Config`:g.status===`error`?`Error`:`Unknown`:`Unknown`,w=h&&_!==null&&_.status!==`idle`&&_.status!==`completed`,T=p?.id===`opencode`&&_?.status===`waiting`,E=`${p?.id??`none`}:${_?.status??`idle`}`,D=u.key===E?u.value:``,O=_?.authUrl??null,k=_?.userCode??null;(0,F.useEffect)(()=>{!h||!p||!g||g.status!==`unknown`||n.checkProviderSetup(p.id)},[n,p,g,h]);let ee=(0,F.useCallback)(async()=>{try{let t=await n.startChatGptLogin();t&&window.open(t,`_blank`,`noopener,noreferrer`),r(e.account.loggedIn?`Opened ChatGPT account switch`:`Opened ChatGPT sign-in`,`ok`),r(`If mobile redirects to localhost:1455, paste that callback URL below.`,``)}catch(e){r(e instanceof Error?e.message:`Failed to start ChatGPT login`,`err`)}},[n,r,e.account.loggedIn]),te=(0,F.useCallback)(async()=>{if(!c.trim()){r(`Paste the full callback URL first`,`warn`);return}try{await n.completeChatGptLogin(c.trim()),l(``),r(`Mobile sign-in completed`,`ok`)}catch(e){r(e instanceof Error?e.message:`Failed to complete mobile sign-in`,`err`)}},[n,c,r]),ne=(0,F.useCallback)(async()=>{let t=window.prompt(e.account.authMode===`apiKey`?`Enter the replacement API key`:`Enter your OpenAI API key`,``);if(t?.trim())try{await n.loginWithApiKey(t.trim()),r(`API key account connected`,`ok`)}catch(e){r(e instanceof Error?e.message:`Failed to connect API key`,`err`)}},[n,r,e.account.authMode]),A=(0,F.useCallback)(async()=>{try{await n.logoutAccount(),r(`Signed out of account`,`ok`)}catch(e){r(e instanceof Error?e.message:`Failed to sign out`,`err`)}},[n,r]),j=(0,F.useCallback)(async()=>{try{await n.refreshAccount(),r(`Account status refreshed`,`ok`)}catch(e){r(e instanceof Error?e.message:`Failed to refresh account`,`err`)}},[n,r]),re=(0,F.useCallback)(async()=>{if(!(!p||!h))try{await n.startProviderAuth(p.id,p.id===`opencode`?`apiKey`:`oauth`),r(`${p.displayName} sign-in started`,`ok`)}catch(e){r(e instanceof Error?e.message:`Failed to start provider sign-in`,`err`)}},[n,p,h,r]),ie=(0,F.useCallback)(async()=>{if(!(!p||!h))try{await n.switchProviderAccount(p.id,p.id===`opencode`?`apiKey`:`oauth`),r(`${p.displayName} is ready for a new sign-in`,`ok`)}catch(e){r(e instanceof Error?e.message:`Failed to switch provider account`,`err`)}},[n,p,h,r]),ae=(0,F.useCallback)(async()=>{if(!(!p||!h))try{await n.cancelProviderAuth(p.id),r(`${p.displayName} sign-in cancelled`,`ok`)}catch(e){r(e instanceof Error?e.message:`Failed to cancel provider sign-in`,`err`)}},[n,p,h,r]),oe=(0,F.useCallback)(()=>{O&&window.open(O,`_blank`,`noopener,noreferrer`)},[O]),se=(0,F.useCallback)(async()=>{if(k)try{await navigator.clipboard.writeText(k),r(`Copied sign-in code`,`ok`)}catch(e){r(e instanceof Error?e.message:`Failed to copy sign-in code`,`err`)}},[k,r]),M=(0,F.useCallback)(async()=>{if(!(!p||!T)){if(!D.trim()){r(`Paste the API key first`,`warn`);return}try{await n.submitProviderAuthSecret(p.id,D.trim()),d({key:E,value:``}),r(`API key submitted to OpenCode`,`ok`)}catch(e){r(e instanceof Error?e.message:`Failed to submit the provider secret`,`err`)}}},[n,p,E,D,r,T]);return(0,I.jsxs)(`div`,{className:`config-stack`,children:[(0,I.jsxs)(`div`,{className:`sg`,children:[(0,I.jsx)(`div`,{className:`sg-t`,children:`Account`}),(0,I.jsxs)(`div`,{className:`account-card`,children:[(0,I.jsxs)(`div`,{className:`account-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`strong`,{children:h?`${p.displayName} local session`:e.account.loggedIn?e.account.workspace:`No active account`}),(0,I.jsx)(`div`,{className:`account-copy`,children:y})]}),(0,I.jsx)(`span`,{className:H(`account-badge`,h&&(v||g?.status===`ready`)||e.account.loggedIn?`ok`:`off`),children:b})]}),(0,I.jsxs)(`div`,{className:`account-meta`,children:[h?(0,I.jsx)(`span`,{children:p.transportLabel}):(0,I.jsx)(`span`,{children:e.account.credits}),!h&&e.account.requiresOpenaiAuth?(0,I.jsx)(`span`,{children:`OpenAI auth required`}):null]}),h?(0,I.jsxs)(I.Fragment,{children:[g?(0,I.jsxs)(`div`,{className:`usage-limit-list`,children:[(0,I.jsxs)(`div`,{className:`usage-limit-card provider-detail-card`,children:[(0,I.jsxs)(`div`,{className:`usage-limit-head`,children:[(0,I.jsx)(`strong`,{children:`Session`}),(0,I.jsx)(`span`,{children:C})]}),(0,I.jsx)(`div`,{className:`provider-detail-copy`,children:g.summary}),g.detail?(0,I.jsx)(`div`,{className:`usage-limit-copy`,children:g.detail}):null]}),(0,I.jsxs)(`div`,{className:`usage-limit-card provider-detail-card`,children:[(0,I.jsxs)(`div`,{className:`usage-limit-head`,children:[(0,I.jsx)(`strong`,{children:`Transport`}),(0,I.jsx)(`span`,{children:p.transportLabel})]}),(0,I.jsx)(`div`,{className:`provider-detail-copy`,children:g.sourcePath??`Local CLI session on this host.`}),(0,I.jsx)(`div`,{className:`usage-limit-copy`,children:g.checkedAt?`Checked ${g.checkedAt}`:`Not checked yet.`})]}),(0,I.jsxs)(`div`,{className:`usage-limit-card provider-detail-card`,children:[(0,I.jsxs)(`div`,{className:`usage-limit-head`,children:[(0,I.jsx)(`strong`,{children:`CLI`}),(0,I.jsx)(`span`,{children:g.version?`Detected`:`Unknown`})]}),(0,I.jsx)(`div`,{className:`provider-detail-copy`,children:g.version?`Version ${g.version}`:`Version unavailable`}),(0,I.jsx)(`div`,{className:`usage-limit-copy`,children:S?`Ready for new turns.`:`Sign in or configure the provider to use it in Nomadex.`})]})]}):null,w?(0,I.jsxs)(`div`,{className:`account-helper`,children:[(0,I.jsxs)(`div`,{className:`account-helper-copy`,children:[_?.summary,_?.detail?` ${_.detail}`:``]}),_?.userCode||_?.authUrl?(0,I.jsxs)(`div`,{className:`account-callback-form`,children:[_.userCode?(0,I.jsxs)(`div`,{className:`provider-auth-value`,children:[(0,I.jsx)(`span`,{children:`Code`}),(0,I.jsx)(`code`,{children:_.userCode})]}):null,_.authUrl?(0,I.jsxs)(`div`,{className:`provider-auth-value`,children:[(0,I.jsx)(`span`,{children:`URL`}),(0,I.jsx)(`code`,{children:_.authUrl})]}):null]}):null,T?(0,I.jsx)(`div`,{className:`account-callback-form`,children:(0,I.jsx)(`input`,{className:`account-callback-input`,type:`password`,value:D,onChange:e=>d({key:E,value:e.target.value}),placeholder:`Paste OpenCode Zen API key`,autoComplete:`off`,spellCheck:!1})}):null,(0,I.jsxs)(`div`,{className:`provider-auth-actions`,children:[_?.authUrl?(0,I.jsx)(`button`,{className:`mini-action`,type:`button`,onClick:oe,children:`Open auth page`}):null,_?.userCode?(0,I.jsx)(`button`,{className:`mini-action`,type:`button`,onClick:()=>void se(),children:`Copy code`}):null,T?(0,I.jsx)(`button`,{className:`mini-action`,type:`button`,disabled:!D.trim(),onClick:()=>void M(),children:`Submit key`}):null,v?(0,I.jsx)(`button`,{className:`mini-action danger`,type:`button`,onClick:()=>void ae(),children:`Cancel`}):null]})]}):(0,I.jsx)(`div`,{className:`usage-limit-empty`,children:p.id===`opencode`?(0,I.jsxs)(I.Fragment,{children:[`OpenCode Zen uses an API key from`,` `,(0,I.jsx)(`code`,{children:`opencode.ai/auth`}),`. Start the sign-in below, open the auth page, then paste the Zen API key back into Nomadex.`]}):p.id===`qwen-code`?(0,I.jsxs)(I.Fragment,{children:[`Use the provider action below to connect`,` `,p.displayName,`. Nomadex will verify the local session automatically after the provider flow completes.`]}):p.installCommand?(0,I.jsxs)(I.Fragment,{children:[`Install with `,(0,I.jsx)(`code`,{children:p.installCommand}),`, then sign in or configure that CLI on the host machine. Nomadex will use the existing local session for new turns.`]}):(0,I.jsxs)(I.Fragment,{children:[`Sign in or configure `,p.displayName,` on the host machine first. Nomadex will use the existing local CLI session.`]})})]}):(0,I.jsxs)(`div`,{className:`usage-limit-list`,children:[e.account.usageWindows.map(e=>(0,I.jsxs)(`div`,{className:`usage-limit-card`,children:[(0,I.jsxs)(`div`,{className:`usage-limit-head`,children:[(0,I.jsx)(`strong`,{children:e.label}),(0,I.jsxs)(`span`,{children:[Math.round(e.usedPercent),`% used`]})]}),(0,I.jsx)(`div`,{className:`usage-limit-bar`,children:(0,I.jsx)(`span`,{className:`usage-limit-fill`,style:{width:`${Math.max(0,Math.min(100,e.usedPercent))}%`}})}),(0,I.jsx)(`div`,{className:`usage-limit-copy`,children:XS(e.resetsAt)})]},e.id)),e.account.usageWindows.length===0?(0,I.jsx)(`div`,{className:`usage-limit-empty`,children:`Sign in to view your account usage windows.`}):null]}),(0,I.jsx)(`div`,{className:`account-actions`,children:h?(0,I.jsxs)(I.Fragment,{children:[p.id===`opencode`||p.id===`qwen-code`?(0,I.jsx)(`button`,{className:`mini-action`,type:`button`,disabled:v,onClick:()=>void(S?ie():re()),children:v?`Starting…`:S?`Switch account`:x}):null,(0,I.jsx)(`button`,{className:`mini-action`,type:`button`,disabled:g?.status===`checking`,onClick:()=>void n.checkProviderSetup(p.id),children:g?.status===`checking`?`Checking…`:`Check setup`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{className:`mini-action`,type:`button`,onClick:()=>void j(),children:`Refresh`}),(0,I.jsx)(`button`,{className:`mini-action`,type:`button`,onClick:()=>void ee(),children:e.account.authMode===`chatgpt`?`Switch ChatGPT`:`Use ChatGPT`}),(0,I.jsx)(`button`,{className:`mini-action`,type:`button`,onClick:()=>void ne(),children:e.account.authMode===`apiKey`?`Replace API key`:`Use API key`}),e.account.loggedIn?(0,I.jsx)(`button`,{className:`mini-action danger`,type:`button`,onClick:()=>void A(),children:`Log out`}):null]})}),!h&&e.account.loginInProgress?(0,I.jsxs)(`div`,{className:`account-helper`,children:[(0,I.jsxs)(`div`,{className:`account-helper-copy`,children:[`On mobile, if ChatGPT returns to `,(0,I.jsx)(`code`,{children:`localhost:1455`}),`, copy that full URL and paste it here. You can also replace the failed callback host with`,` `,(0,I.jsx)(`code`,{children:typeof window<`u`?window.location.origin:``}),` `,`and keep the same path/query.`]}),(0,I.jsxs)(`div`,{className:`account-callback-form`,children:[(0,I.jsx)(`input`,{className:`account-callback-input`,placeholder:`http://localhost:1455/auth/callback?code=…&state=…`,value:c,onChange:e=>l(e.target.value)}),(0,I.jsx)(`button`,{className:`mini-action`,type:`button`,onClick:()=>void te(),children:`Finish mobile login`})]})]}):null,!h&&e.account.loginError?(0,I.jsx)(`div`,{className:`account-error`,children:e.account.loginError}):null]})]}),(0,I.jsxs)(`div`,{className:`sg`,children:[(0,I.jsx)(`div`,{className:`sg-t`,children:`Model`}),(0,I.jsxs)(`div`,{className:`sr`,children:[(0,I.jsx)(`span`,{className:`sl`,children:`provider`}),(0,I.jsx)(`select`,{className:`ssel`,value:e.settings.provider,onChange:t=>{let r=e.providers.find(e=>e.id===t.target.value);n.updateSettings({provider:t.target.value,model:r?.defaultModel??e.settings.model})},children:e.providers.map(e=>(0,I.jsxs)(`option`,{disabled:e.availability!==`ready`,value:e.id,children:[e.displayName,e.availability===`ready`?``:` (scaffolded)`]},e.id))})]}),(0,I.jsxs)(`div`,{className:`config-provider-note`,children:[(0,I.jsx)(`strong`,{children:p?.displayName??`Provider`}),(0,I.jsx)(`span`,{children:p?.availability===`ready`?p.installCommand?`${p.transportLabel} · ${p.installCommand}`:p.transportLabel:`Scaffolded on this branch. Transport wiring comes next.`})]}),(0,I.jsxs)(`div`,{className:`sr`,children:[(0,I.jsx)(`span`,{className:`sl`,children:`model`}),m.length===0?(0,I.jsx)(`span`,{className:`sl`,children:`provider default`}):(0,I.jsx)(`select`,{className:`ssel`,value:e.settings.model,onChange:e=>void i(e.target.value),children:m.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.displayName},e.id))})]}),(0,I.jsxs)(`div`,{className:`sr`,children:[(0,I.jsx)(`span`,{className:`sl`,children:`reasoning_effort`}),(0,I.jsxs)(`select`,{className:`ssel`,value:e.settings.reasoningEffort,onChange:e=>void n.updateSettings({reasoningEffort:e.target.value}),children:[(0,I.jsx)(`option`,{value:`low`,children:`low`}),(0,I.jsx)(`option`,{value:`medium`,children:`medium`}),(0,I.jsx)(`option`,{value:`high`,children:`high`}),(0,I.jsx)(`option`,{value:`xhigh`,children:`xhigh`})]})]})]}),(0,I.jsxs)(`div`,{className:`sg`,children:[(0,I.jsx)(`div`,{className:`sg-t`,children:`Approval & Sandbox`}),(0,I.jsxs)(`div`,{className:`sr`,children:[(0,I.jsx)(`span`,{className:`sl`,children:`approval_policy`}),(0,I.jsxs)(`select`,{className:`ssel`,value:Pd(e.settings),onChange:e=>void n.updateSettings(Fd(e.target.value)),children:[(0,I.jsx)(`option`,{value:`auto`,children:`auto`}),(0,I.jsx)(`option`,{value:`ro`,children:`read-only`}),(0,I.jsx)(`option`,{value:`fa`,children:`full-access`})]})]}),(0,I.jsxs)(`div`,{className:`sr`,children:[(0,I.jsx)(`span`,{className:`sl`,children:`sandbox`}),(0,I.jsxs)(`select`,{className:`ssel`,value:e.settings.sandboxMode,onChange:e=>void n.updateSettings({sandboxMode:e.target.value}),children:[(0,I.jsx)(`option`,{value:`workspace-write`,children:`workspace-write`}),(0,I.jsx)(`option`,{value:`read-only`,children:`read-only`}),(0,I.jsx)(`option`,{value:`danger-full-access`,children:`danger-full-access`})]})]}),(0,I.jsxs)(`div`,{className:`sr`,children:[(0,I.jsx)(`span`,{className:`sl`,children:`web_search`}),(0,I.jsx)(`div`,{className:H(`tog`,e.settings.webSearch&&`on`),onClick:()=>void n.updateSettings({webSearch:!e.settings.webSearch}),role:`button`,tabIndex:0,onKeyDown:()=>void 0})]})]}),(0,I.jsxs)(`div`,{className:`sg`,children:[(0,I.jsx)(`div`,{className:`sg-t`,children:`Appearance`}),(0,I.jsxs)(`div`,{className:`config-shortcut-card appearance-shortcut-card`,children:[(0,I.jsxs)(`div`,{className:`config-shortcut-copy`,children:[(0,I.jsxs)(`strong`,{children:[f,` theme active`]}),(0,I.jsx)(`span`,{children:`Ambient background, shell surfaces, and persistent palette selection.`})]}),(0,I.jsx)(`button`,{className:`mini-action`,onClick:s,type:`button`,children:`Open Theme Picker`})]})]}),(0,I.jsxs)(`div`,{className:`sg`,children:[(0,I.jsx)(`div`,{className:`sg-t`,children:`Skills`}),(0,I.jsxs)(`div`,{className:`config-shortcut-card skill-shortcut-card`,children:[(0,I.jsxs)(`div`,{className:`config-shortcut-copy`,children:[(0,I.jsx)(`strong`,{children:`Skills moved into a dedicated library`}),(0,I.jsxs)(`span`,{children:[e.installedSkills.length,` installed ·`,` `,e.installedSkills.filter(e=>e.enabled).length,` `,`enabled · `,e.remoteSkills.length,` available to install`]})]}),(0,I.jsx)(`button`,{className:`mini-action`,onClick:o,type:`button`,children:`Open Skills Library`})]})]}),(0,I.jsxs)(`div`,{className:`sg`,children:[(0,I.jsx)(`div`,{className:`sg-t`,children:`MCP`}),e.mcpServers.map(e=>(0,I.jsxs)(`div`,{className:`mcp-card`,children:[(0,I.jsxs)(`div`,{className:`mcp-head`,children:[(0,I.jsx)(`strong`,{children:e.name}),(0,I.jsx)(`span`,{children:e.authStatus})]}),(0,I.jsx)(`div`,{className:`mcp-tools`,children:Object.keys(e.tools).slice(0,4).join(` · `)}),(0,I.jsx)(`button`,{className:`mini-action`,type:`button`,onClick:()=>void n.toggleMcpAuth(e.name),children:e.authStatus===`notLoggedIn`?`Connect`:`Refresh`})]},e.name))]}),(0,I.jsxs)(`div`,{className:`sg`,children:[(0,I.jsxs)(`div`,{className:`sg-t`,children:[`Feature Flags`,` `,(0,I.jsx)(`button`,{className:`feature-refresh`,type:`button`,onClick:()=>r(`Feature flags refreshed`,`ok`),children:`⟳`})]}),e.featureFlags.map(e=>(0,I.jsxs)(`div`,{className:`sr`,children:[(0,I.jsxs)(`span`,{className:`sl`,children:[e.name,` `,(0,I.jsxs)(`small`,{children:[`(`,e.stage,`)`]})]}),(0,I.jsx)(`div`,{className:H(`tog`,e.enabled&&`on`),onClick:()=>void n.toggleFeatureFlag(e.name),role:`button`,tabIndex:0,onKeyDown:()=>void 0})]},e.name))]}),(0,I.jsxs)(`div`,{className:`config-preview`,children:[(0,I.jsx)(`div`,{className:`config-title`,children:`Session config snapshot`}),(0,I.jsx)(`div`,{children:`# Nomadex workspace config`}),(0,I.jsxs)(`div`,{children:[`provider = "`,e.settings.provider,`"`]}),(0,I.jsxs)(`div`,{children:[`model = "`,e.settings.model,`"`]}),(0,I.jsxs)(`div`,{children:[`approval_policy = "`,e.settings.approvalPolicy,`"`]}),(0,I.jsxs)(`div`,{children:[`model_reasoning_effort = "`,e.settings.reasoningEffort,`"`]}),(0,I.jsxs)(`div`,{children:[`web_search = "`,e.settings.webSearch?`live`:`disabled`,`"`]}),(0,I.jsx)(`br`,{}),(0,I.jsx)(`div`,{children:`[features]`}),e.featureFlags.slice(0,4).map(e=>(0,I.jsxs)(`div`,{children:[e.name,` = `,e.enabled?`true`:`false`]},e.name)),(0,I.jsx)(`br`,{}),(0,I.jsx)(`div`,{children:`# active thread`}),(0,I.jsxs)(`div`,{children:[`thread = "`,t,`"`]})]})]})}),tC=1200,nC=e=>e.find(e=>e.status===`running`)?.id??e[0]?.id??null;function rC({cwd:e,terminals:t,onStartShell:n,onSendInput:r,onTerminate:i}){let[a,o]=(0,F.useState)(()=>nC(t)),[s,c]=(0,F.useState)(``),[l,u]=(0,F.useState)(null),[d,f]=(0,F.useState)(null),p=(0,F.useRef)(null),m=(0,F.useRef)(null),h=(0,F.useRef)(a),g=(0,F.useRef)(!0);(0,F.useEffect)(()=>{let e=t.some(e=>e.id===a)?a:nC(t);e!==a&&o(e)},[a,t]);let _=(0,F.useMemo)(()=>t.find(e=>e.id===a)??t.find(e=>e.status===`running`)??t[0]??null,[a,t]),v=(0,F.useMemo)(()=>_?_.log.slice(-tC):[],[_]),y=_?Math.max(0,_.log.length-v.length):0,b=Math.max(t.length-1,0),x=!!(_?.writable&&_.status===`running`),S=(0,F.useCallback)(()=>{let e=m.current;if(!e)return;e.focus();let t=e.value.length;try{e.setSelectionRange(t,t)}catch{}},[]);(0,F.useEffect)(()=>{let e=p.current,t=_?.id??null;if(!e){h.current=t;return}let n=h.current!==t;if(h.current=t,!n&&!g.current)return;let r=window.requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight});return()=>{window.cancelAnimationFrame(r)}},[_?.id,v.length]),(0,F.useEffect)(()=>{if(!x)return;let e=window.requestAnimationFrame(()=>{S()});return()=>{window.cancelAnimationFrame(e)}},[_?.id,x,S]);let C=()=>{let e=p.current;e&&(g.current=e.scrollHeight-e.scrollTop-e.clientHeight<40)},w=async()=>{u(null),f(`start`);try{o(await n()),c(``)}catch(e){u(e instanceof Error?e.message:`Unable to start the project shell.`)}finally{f(null)}},T=async()=>{if(!_||!x||!s.trim())return;let e=s;u(null),f(`send`);try{c(``),await r(_.id,`${e}\n`)}catch(t){c(e),u(t instanceof Error?t.message:`Unable to send terminal input.`)}finally{f(null),typeof window<`u`&&window.requestAnimationFrame(()=>{S()})}},E=async()=>{if(!(!_||!x)){u(null),f(`send`);try{await r(_.id,``)}catch(e){u(e instanceof Error?e.message:`Unable to send interrupt.`)}finally{f(null),typeof window<`u`&&window.requestAnimationFrame(()=>{S()})}}},D=async()=>{if(!(!_||_.status!==`running`)){u(null),f(`stop`);try{await i(_.id)}catch(e){u(e instanceof Error?e.message:`Unable to stop the terminal.`)}finally{f(null)}}};return(0,I.jsxs)(`div`,{className:`terminal-panel`,children:[(0,I.jsxs)(`div`,{className:`terminal-plain-bar`,children:[(0,I.jsxs)(`div`,{className:`terminal-plain-meta`,children:[(0,I.jsx)(`span`,{className:`terminal-plain-title`,children:`Terminal`}),_?(0,I.jsx)(`span`,{className:H(`status-chip`,`terminal-status-chip`,_.status),children:_.status}):null,b>0?(0,I.jsxs)(`span`,{className:`terminal-plain-count`,children:[t.length,` shells`]}):null]}),(0,I.jsxs)(`div`,{className:`terminal-toolbar-actions`,children:[(0,I.jsx)(`button`,{className:`mini-action`,type:`button`,onClick:()=>void w(),children:d===`start`?`Starting…`:`New shell`}),_?(0,I.jsx)(`button`,{className:`mini-action`,disabled:!x||d===`send`,onClick:()=>void E(),type:`button`,children:`Ctrl+C`}):null,_?(0,I.jsx)(`button`,{className:`mini-action danger`,disabled:_.status!==`running`||d===`stop`,onClick:()=>void D(),type:`button`,children:d===`stop`?`Stopping…`:`Stop`}):null]})]}),(0,I.jsx)(`div`,{className:`terminal-project-path`,children:e}),l?(0,I.jsx)(`div`,{className:`terminal-inline-error`,children:l}):null,t.length===0?(0,I.jsxs)(`div`,{className:`terminal-empty-state`,children:[(0,I.jsx)(`div`,{className:`empty-panel`,children:`No project shell yet.`}),(0,I.jsx)(`button`,{className:`mini-action`,type:`button`,onClick:()=>void w(),children:`Open project shell`})]}):null,t.length>0&&_?(0,I.jsxs)(I.Fragment,{children:[y>0?(0,I.jsxs)(`div`,{className:`terminal-log-cap`,children:[`Showing the latest `,v.length,` lines of `,_.log.length]}):null,(0,I.jsxs)(`div`,{className:H(`term`,`terminal-log-plain`,x&&`terminal-log-plain-interactive`),onClick:()=>{x&&S()},onScroll:C,ref:p,children:[v.map((e,t)=>(0,I.jsx)(`div`,{className:H(`terminal-log-row`,t===0&&`t-p`),children:e||` `},`${_.id}:log:${y+t}`)),x?(0,I.jsxs)(`form`,{className:`terminal-log-prompt t-p`,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),T()},children:[(0,I.jsx)(`span`,{className:`terminal-inline-editor-shell`,children:`$`}),(0,I.jsx)(`input`,{"aria-label":`Terminal input`,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,className:`terminal-inline-editor`,enterKeyHint:`send`,onChange:e=>c(e.target.value),onKeyDown:e=>{e.stopPropagation(),(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`c`&&s.length===0&&(e.preventDefault(),E())},ref:m,spellCheck:!1,type:`text`,value:s}),(0,I.jsx)(`button`,{"aria-hidden":`true`,className:`terminal-submit-proxy`,tabIndex:-1,type:`submit`})]}):null]})]}):null]})}function iC(){return iC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iC.apply(null,arguments)}function aC(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var oC=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=dC(e.state,n.from);return r.line?cC(e):r.block?uC(e):!1};function sC(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var cC=sC(gC,0),lC=sC(hC,0),uC=sC((e,t)=>hC(e,t,mC(t)),0);function dC(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var fC=50;function pC(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-fC,r),o=e.sliceDoc(i,i+fC),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*fC?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+fC),d=e.sliceDoc(i-fC,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:/\s/.test(u.charAt(f+t.length))?1:0},close:{pos:i-p-n.length,margin:/\s/.test(d.charAt(m-1))?1:0}}:null}function mC(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function hC(e,t,n=t.selection.ranges){let r=n.map(e=>dC(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>pC(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function gC(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=dC(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var _C=pe.define(),vC=pe.define(),yC=ee.define(),bC=ee.define({combine(e){return f(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),xC=i.define({create(){return BC.empty},update(e,t){let n=t.state.facet(bC),r=t.annotation(_C);if(r){let i=OC.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?kC(o,o.length,n.minDepth,i):FC(o,t.startState.selection),new BC(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(vC);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(ue.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=OC.fromTransaction(t),o=t.annotation(ue.time),s=t.annotation(ue.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new BC(e.done.map(OC.fromJSON),e.undone.map(OC.fromJSON))}});function SC(e={}){return[xC,bC.of(e),u.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?wC:e.inputType==`historyRedo`?TC:null;return n?(e.preventDefault(),n(t)):!1}})]}function CC(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(xC,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var wC=CC(0,!1),TC=CC(1,!1),EC=CC(0,!0),DC=CC(1,!0),OC=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&oe.fromJSON(t.changes),[],t.mapped&&se.fromJSON(t.mapped),t.startSelection&&N.fromJSON(t.startSelection),t.selectionsAfter.map(N.fromJSON))}static fromTransaction(t,n){let r=NC;for(let e of t.startState.facet(yC)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,NC)}static selection(t){return new e(void 0,NC,void 0,void 0,t)}};function kC(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function AC(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function jC(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function MC(e,t){return e.length?t.length?e.concat(t):e:t}var NC=[],PC=200;function FC(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-PC));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),kC(e,e.length-1,1e9,n.setSelAfter(r)))}else return[OC.selection([t])]}function IC(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function LC(e,t){if(!e.length)return e;let n=e.length,r=NC;for(;n;){let i=RC(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[OC.selection(r)]:NC}function RC(e,t,n){let r=MC(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):NC,n);if(!e.changes)return OC.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(a):a;return new OC(i,o.mapEffects(e.effects,t),s,e.startSelection.map(a),r)}var zC=/^(input\.type|delete)($|\.)/,BC=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let s=this.done,c=s[s.length-1];return s=c&&c.changes&&!c.changes.empty&&t.changes&&(!r||zC.test(r))&&(!c.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,AC(c.changes,t.changes))||r==`input.type.compose`)?kC(s,s.length-1,i.minDepth,new OC(t.changes.compose(c.changes),MC(o.mapEffects(t.effects,c.changes),c.effects),c.mapped,c.startSelection,NC)):kC(s,s.length,i.minDepth,t),new e(s,NC,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:NC;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&jC(a[a.length-1],t)?this:new e(FC(this.done,t),this.undone,n,r)}addMapping(t){return new e(LC(this.done,t),LC(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:_C.of({side:e,rest:IC(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?NC:r.slice(0,r.length-1);return i.mapped&&(n=LC(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:_C.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};BC.empty=new BC(NC,NC);var VC=[{key:`Mod-z`,run:wC,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:TC,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:TC,preventDefault:!0},{key:`Mod-u`,run:EC,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:DC,preventDefault:!0}];function HC(e,t){return N.create(e.ranges.map(t),e.mainIndex)}function UC(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function WC({state:e,dispatch:t},n){let r=HC(e.selection,n);return r.eq(e.selection,!0)?!1:(t(UC(e,r)),!0)}function GC(e,t){return N.cursor(t?e.to:e.from)}function KC(e,t){return WC(e,n=>n.empty?e.moveByChar(n,t):GC(n,t))}function qC(e){return e.textDirectionAt(e.state.selection.main.head)==c.LTR}var JC=e=>KC(e,!qC(e)),YC=e=>KC(e,qC(e));function XC(e,t){return WC(e,n=>n.empty?e.moveByGroup(n,t):GC(n,t))}var ZC=e=>XC(e,!qC(e)),QC=e=>XC(e,qC(e));typeof Intl<`u`&&Intl.Segmenter;function $C(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function ew(e,t,n){let r=ce(e).resolveInner(t.head),i=n?d.closedBy:d.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;$C(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?m(e,r.from,1):m(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,N.cursor(s,n?-1:1)}var tw=e=>WC(e,t=>ew(e.state,t,!qC(e))),nw=e=>WC(e,t=>ew(e.state,t,qC(e)));function rw(e,t){return WC(e,n=>{if(!n.empty)return GC(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var iw=e=>rw(e,!1),aw=e=>rw(e,!0);function ow(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(u.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function sw(e,t){let n=ow(e),{state:r}=e,i=HC(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):GC(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=u.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(UC(r,i),{effects:a}),!0}var cw=e=>sw(e,!1),lw=e=>sw(e,!0);function uw(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=N.cursor(r.from+n))}return i}var dw=e=>WC(e,t=>uw(e,t,!0)),fw=e=>WC(e,t=>uw(e,t,!1)),pw=e=>WC(e,t=>uw(e,t,!qC(e))),mw=e=>WC(e,t=>uw(e,t,qC(e))),hw=e=>WC(e,t=>N.cursor(e.lineBlockAt(t.head).from,1)),gw=e=>WC(e,t=>N.cursor(e.lineBlockAt(t.head).to,-1));function _w(e,t,n){let r=!1,i=HC(e.selection,t=>{let i=m(e,t.head,-1)||m(e,t.head,1)||t.head>0&&m(e,t.head-1,1)||t.head<e.doc.length&&m(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?N.range(t.anchor,a):N.cursor(a)});return r?(t(UC(e,i)),!0):!1}var vw=({state:e,dispatch:t})=>_w(e,t,!1);function yw(e,t){let n=HC(e.state.selection,e=>{let n=t(e);return N.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(UC(e.state,n)),!0)}function bw(e,t){return yw(e,n=>e.moveByChar(n,t))}var xw=e=>bw(e,!qC(e)),Sw=e=>bw(e,qC(e));function Cw(e,t){return yw(e,n=>e.moveByGroup(n,t))}var ww=e=>Cw(e,!qC(e)),Tw=e=>Cw(e,qC(e)),Ew=e=>yw(e,t=>ew(e.state,t,!qC(e))),Dw=e=>yw(e,t=>ew(e.state,t,qC(e)));function Ow(e,t){return yw(e,n=>e.moveVertically(n,t))}var kw=e=>Ow(e,!1),Aw=e=>Ow(e,!0);function jw(e,t){return yw(e,n=>e.moveVertically(n,t,ow(e).height))}var Mw=e=>jw(e,!1),Nw=e=>jw(e,!0),Pw=e=>yw(e,t=>uw(e,t,!0)),Fw=e=>yw(e,t=>uw(e,t,!1)),Iw=e=>yw(e,t=>uw(e,t,!qC(e))),Lw=e=>yw(e,t=>uw(e,t,qC(e))),Rw=e=>yw(e,t=>N.cursor(e.lineBlockAt(t.head).from)),zw=e=>yw(e,t=>N.cursor(e.lineBlockAt(t.head).to)),Bw=({state:e,dispatch:t})=>(t(UC(e,{anchor:0})),!0),Vw=({state:e,dispatch:t})=>(t(UC(e,{anchor:e.doc.length})),!0),Hw=({state:e,dispatch:t})=>(t(UC(e,{anchor:e.selection.main.anchor,head:0})),!0),Uw=({state:e,dispatch:t})=>(t(UC(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Ww=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),Gw=({state:e,dispatch:t})=>{let n=uT(e).map(({from:t,to:n})=>N.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:N.create(n),userEvent:`select`})),!0},Kw=({state:e,dispatch:t})=>{let n=HC(e.selection,t=>{let n=ce(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return N.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(UC(e,n)),!0)};function qw(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(UC(n,N.create(i,i.length-1))),!0)}var Jw=e=>qw(e,!1),Yw=e=>qw(e,!0),Xw=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=N.create([n.main]):n.main.empty||(r=N.create([N.cursor(n.main.head)])),r?(t(UC(e,r)),!0):!1};function Zw(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=Qw(e,o,!1)):o>i&&(n=`delete.forward`,o=Qw(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=Qw(e,i,!1),a=Qw(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:N.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?u.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function Qw(e,t,n){if(e instanceof u)for(let r of e.state.facet(u.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var $w=(e,t,n)=>Zw(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=p(s,a.tabSize)%Oe(a)||Oe(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=_(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=_(o.text,c-o.from,!1,!1)+o.from);return c}),eT=e=>$w(e,!1,!0),tT=e=>$w(e,!0,!1),nT=(e,t)=>Zw(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=_(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),rT=e=>nT(e,!1),iT=e=>nT(e,!0),aT=e=>Zw(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),oT=e=>Zw(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),sT=e=>Zw(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),cT=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:h.of([``,``])},range:N.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},lT=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:_(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:_(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:N.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function uT(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function dT(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of uT(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(N.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(N.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:N.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var fT=({state:e,dispatch:t})=>dT(e,t,!1),pT=({state:e,dispatch:t})=>dT(e,t,!0);function mT(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of uT(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var hT=({state:e,dispatch:t})=>mT(e,t,!1),gT=({state:e,dispatch:t})=>mT(e,t,!0),_T=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(uT(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=HC(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function vT(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=ce(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(d.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var yT=xT(!1),bT=xT(!0);function xT(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&vT(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new me(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=y(s,r);for(c??=p(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,x(t,c)];return o&&l.push(x(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:h.of(l)},range:N.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function ST(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:N.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var CT=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new me(e,{overrideIndentation:e=>n[e]??-1}),i=ST(e,(t,i,a)=>{let o=y(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=x(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},wT=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ST(e,(t,n)=>{n.push({from:t.from,insert:e.facet(a)})}),{userEvent:`input.indent`})),!0),TT=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ST(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=p(r,e.tabSize),a=0,o=x(e,Math.max(0,i-Oe(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),ET=e=>(e.setTabFocusMode(),!0),DT=[{key:`Ctrl-b`,run:JC,shift:xw,preventDefault:!0},{key:`Ctrl-f`,run:YC,shift:Sw},{key:`Ctrl-p`,run:iw,shift:kw},{key:`Ctrl-n`,run:aw,shift:Aw},{key:`Ctrl-a`,run:hw,shift:Rw},{key:`Ctrl-e`,run:gw,shift:zw},{key:`Ctrl-d`,run:tT},{key:`Ctrl-h`,run:eT},{key:`Ctrl-k`,run:aT},{key:`Ctrl-Alt-h`,run:rT},{key:`Ctrl-o`,run:cT},{key:`Ctrl-t`,run:lT},{key:`Ctrl-v`,run:lw}],OT=[{key:`ArrowLeft`,run:JC,shift:xw,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:ZC,shift:ww,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:pw,shift:Iw,preventDefault:!0},{key:`ArrowRight`,run:YC,shift:Sw,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:QC,shift:Tw,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:mw,shift:Lw,preventDefault:!0},{key:`ArrowUp`,run:iw,shift:kw,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:Bw,shift:Hw},{mac:`Ctrl-ArrowUp`,run:cw,shift:Mw},{key:`ArrowDown`,run:aw,shift:Aw,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:Vw,shift:Uw},{mac:`Ctrl-ArrowDown`,run:lw,shift:Nw},{key:`PageUp`,run:cw,shift:Mw},{key:`PageDown`,run:lw,shift:Nw},{key:`Home`,run:fw,shift:Fw,preventDefault:!0},{key:`Mod-Home`,run:Bw,shift:Hw},{key:`End`,run:dw,shift:Pw,preventDefault:!0},{key:`Mod-End`,run:Vw,shift:Uw},{key:`Enter`,run:yT,shift:yT},{key:`Mod-a`,run:Ww},{key:`Backspace`,run:eT,shift:eT,preventDefault:!0},{key:`Delete`,run:tT,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:rT,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:iT,preventDefault:!0},{mac:`Mod-Backspace`,run:oT,preventDefault:!0},{mac:`Mod-Delete`,run:sT,preventDefault:!0}].concat(DT.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),kT=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:tw,shift:Ew},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:nw,shift:Dw},{key:`Alt-ArrowUp`,run:fT},{key:`Shift-Alt-ArrowUp`,run:hT},{key:`Alt-ArrowDown`,run:pT},{key:`Shift-Alt-ArrowDown`,run:gT},{key:`Mod-Alt-ArrowUp`,run:Jw},{key:`Mod-Alt-ArrowDown`,run:Yw},{key:`Escape`,run:Xw},{key:`Mod-Enter`,run:bT},{key:`Alt-l`,mac:`Ctrl-l`,run:Gw},{key:`Mod-i`,run:Kw,preventDefault:!0},{key:`Mod-[`,run:TT},{key:`Mod-]`,run:wT},{key:`Mod-Alt-\\`,run:CT},{key:`Shift-Mod-k`,run:_T},{key:`Shift-Mod-\\`,run:vw},{key:`Mod-/`,run:oC},{key:`Alt-A`,run:lC},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:ET}].concat(OT),AT={key:`Tab`,run:wT,shift:TT},jT=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,MT=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(jT(e)):jT,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return n(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=s(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=le(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(MT.prototype[Symbol.iterator]=function(){return this});var NT={from:-1,to:-1,match:/.*/.exec(``)},PT=`gm`+(/x/.unicode==null?``:`u`),FT=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=NT,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new RT(e,t,n,r,i);this.re=new RegExp(t,PT+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=BT(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=BT(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},IT=new WeakMap,LT=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=IT.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return IT.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),IT.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},RT=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=NT,this.matchPos=BT(e,r),this.re=new RegExp(t,PT+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=LT.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=BT(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=LT.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(FT.prototype[Symbol.iterator]=RT.prototype[Symbol.iterator]=function(){return this});function zT(e){try{return new RegExp(e,PT),!0}catch{return!1}}function BT(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var VT=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=we(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,c,l]=i,d=c?+c.slice(1):0,f=s?+s:a.number;if(s&&l){let e=f/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),f=Math.round(t.doc.lines*e)}else s&&o&&(f=f*(o==`-`?-1:1)+a.number);let p=t.doc.line(Math.max(1,Math.min(t.doc.lines,f))),m=N.cursor(p.from+Math.max(0,Math.min(d,p.length)));e.dispatch({effects:[r,u.scrollIntoView(m.from,{y:`center`})],selection:m})}),!0},HT={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},UT=ee.define({combine(e){return f(e,HT,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function WT(e){let t=[XT,YT];return e&&t.push(UT.of(e)),t}var GT=C.mark({class:`cm-selectionMatch`}),KT=C.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function qT(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=D.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=D.Word)}function JT(e,t,n,r){return e(t.sliceDoc(n,n+1))==D.Word&&e(t.sliceDoc(r-1,r))==D.Word}var YT=ye.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(UT),{state:n}=e,r=n.selection;if(r.ranges.length>1)return C.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return C.none;let e=n.wordAt(i.head);if(!e)return C.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return C.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(qT(o,n,i.from,i.to)&&JT(o,n,i.from,i.to)))return C.none}else if(a=n.sliceDoc(i.from,i.to),!a)return C.none}let s=[];for(let r of e.visibleRanges){let e=new MT(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||qT(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(KT.range(r,a)):(r>=i.to||a<=i.from)&&s.push(GT.range(r,a)),s.length>t.maxMatches))return C.none}}return C.set(s)}},{decorations:e=>e.decorations}),XT=u.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),ZT=({state:e,dispatch:t})=>{let{selection:n}=e,r=N.create(n.ranges.map(t=>e.wordAt(t.head)||N.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function QT(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new MT(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new MT(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var $T=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return ZT({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=QT(e,r);return i?(t(e.update({selection:e.selection.addRange(N.range(i.from,i.to),!1),effects:u.scrollIntoView(i.to)})),!0):!1},eE=ee.define({combine(e){return f(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new PE(e),scrollToMatch:e=>u.scrollIntoView(e)})}}),tE=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||zT(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
209
|
-
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new fE(this):new oE(this)}getCursor(e,t=0,n){let r=e.doc?e:Ae.create({doc:e});return n??=r.doc.length,this.regexp?cE(this,r,t,n):iE(this,r,t,n)}},nE=class{constructor(e){this.spec=e}};function rE(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function iE(e,t,n,r){let i;return e.wholeWord&&(i=aE(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=rE(e.test,t,i)),new MT(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function aE(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(lE(i,n-a))!=D.Word||t(uE(i,n-a))!=D.Word)&&(t(uE(i,r-a))!=D.Word||t(lE(i,r-a))!=D.Word))}var oE=class extends nE{constructor(e){super(e)}nextMatch(e,t,n){let r=iE(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=iE(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=iE(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=iE(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=iE(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function sE(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function cE(e,t,n,r){let i;return e.wholeWord&&(i=dE(t.charCategorizer(t.selection.main.head))),e.test&&(i=sE(e.test,t,i)),new FT(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function lE(e,t){return e.slice(_(e,t,!1),t)}function uE(e,t){return e.slice(t,_(e,t))}function dE(e){return(t,n,r)=>!r[0].length||(e(lE(r.input,r.index))!=D.Word||e(uE(r.input,r.index))!=D.Word)&&(e(uE(r.input,r.index+r[0].length))!=D.Word||e(lE(r.input,r.index+r[0].length))!=D.Word)}var fE=class extends nE{nextMatch(e,t,n){let r=cE(this.spec,e,n,e.doc.length).next();return r.done&&(r=cE(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=cE(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=cE(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=cE(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},pE=o.define(),mE=o.define(),hE=i.define({create(e){return new gE(OE(e).create(),null)},update(e,t){for(let n of t.effects)n.is(pE)?e=new gE(n.value.create(),e.panel):n.is(mE)&&(e=new gE(e.query,n.value?DE:null));return e},provide:e=>A.from(e,e=>e.panel)}),gE=class{constructor(e,t){this.query=e,this.panel=t}},_E=C.mark({class:`cm-searchMatch`}),vE=C.mark({class:`cm-searchMatch cm-searchMatch-selected`}),yE=ye.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(hE))}update(e){let t=e.state.field(hE);(t!=e.startState.field(hE)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return C.none;let{view:n}=this,r=new De;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?vE:_E)})}return r.finish()}},{decorations:e=>e.decorations});function bE(e){return t=>{let n=t.state.field(hE,!1);return n&&n.query.spec.valid?e(t,n):jE(t)}}var xE=bE((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=N.single(r.from,r.to),a=e.state.facet(eE);return e.dispatch({selection:i,effects:[RE(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),AE(e),!0}),SE=bE((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=N.single(i.from,i.to),o=e.state.facet(eE);return e.dispatch({selection:a,effects:[RE(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),AE(e),!0}),CE=bE((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:N.create(n.map(e=>N.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),wE=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new MT(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(N.range(t.value.from,t.value.to))}return t(e.update({selection:N.create(a,o),userEvent:`select.search.matches`})),!0},TE=bE((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,d=[];o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),d.push(u.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`)));let f=e.state.changes(s);return o&&(c=N.single(o.from,o.to).map(f),d.push(RE(e,o)),d.push(n.facet(eE).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:`input.replace`}),!0}),EE=bE((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:u.announce.of(r),userEvent:`input.replace.all`}),!0});function DE(e){return e.state.facet(eE).createPanel(e)}function OE(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(eE);return new tE({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function kE(e){let t=v(e,DE);return t&&t.dom.querySelector(`[main-field]`)}function AE(e){let t=kE(e);t&&t==e.root.activeElement&&t.select()}var jE=e=>{let t=e.state.field(hE,!1);if(t&&t.panel){let n=kE(e);if(n&&n!=e.root.activeElement){let r=OE(e.state,t.query.spec);r.valid&&e.dispatch({effects:pE.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[mE.of(!0),t?pE.of(OE(e.state,t.query.spec)):o.appendConfig.of(BE)]});return!0},ME=e=>{let t=e.state.field(hE,!1);if(!t||!t.panel)return!1;let n=v(e,DE);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:mE.of(!1)}),!0},NE=[{key:`Mod-f`,run:jE,scope:`editor search-panel`},{key:`F3`,run:xE,shift:SE,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:xE,shift:SE,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:ME,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:wE},{key:`Mod-Alt-g`,run:VT},{key:`Mod-d`,run:$T,preventDefault:!0}],PE=class{constructor(e){this.view=e;let t=this.query=e.state.field(hE).query.spec;this.commit=this.commit.bind(this),this.searchField=ve(`input`,{value:t.search,placeholder:FE(e,`Find`),"aria-label":FE(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=ve(`input`,{value:t.replace,placeholder:FE(e,`Replace`),"aria-label":FE(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=ve(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=ve(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=ve(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return ve(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=ve(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>xE(e),[FE(e,`next`)]),n(`prev`,()=>SE(e),[FE(e,`previous`)]),n(`select`,()=>CE(e),[FE(e,`all`)]),ve(`label`,null,[this.caseField,FE(e,`match case`)]),ve(`label`,null,[this.reField,FE(e,`regexp`)]),ve(`label`,null,[this.wordField,FE(e,`by word`)]),...e.state.readOnly?[]:[ve(`br`),this.replaceField,n(`replace`,()=>TE(e),[FE(e,`replace`)]),n(`replaceAll`,()=>EE(e),[FE(e,`replace all`)])],ve(`button`,{name:`close`,onclick:()=>ME(e),"aria-label":FE(e,`close`),type:`button`},[`×`])])}commit(){let e=new tE({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:pE.of(e)}))}keydown(e){fe(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?SE:xE)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),TE(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(pE)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(eE).top}};function FE(e,t){return e.state.phrase(t)}var IE=30,LE=/[\s\.,:;?!]/;function RE(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-IE),o=Math.min(i,n+IE),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<IE;e++)if(!LE.test(s[e+1])&&LE.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-IE;e--)if(!LE.test(s[e-1])&&LE.test(s[e])){s=s.slice(0,e);break}}return u.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var zE=u.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),BE=[hE,b.low(yE),zE],VE=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=ce(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(JE(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function HE(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function UE(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=HE(t)+HE(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function WE(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:UE(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function GE(e,t){return n=>{for(let t=ce(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}var KE=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function qE(e){return e.selection.main.from}function JE(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var YE=pe.define();function XE(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:N.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var ZE=new WeakMap;function QE(e){if(!Array.isArray(e))return e;let t=ZE.get(e);return t||ZE.set(e,t=WE(e)),t}var $E=o.define(),eD=o.define(),tD=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let r=n(e,t),i=le(r);this.chars.push(r);let a=e.slice(t,t+i),o=a.toUpperCase();this.folded.push(n(o==a?a.toLowerCase():o,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:r,any:i,precise:a,byWord:o}=this;if(t.length==1){let i=n(e,0),a=le(i),o=a==e.length?0:-100;if(i!=t[0])if(i==r[0])o+=-200;else return null;return this.ret(o,[0,a])}let c=e.indexOf(this.pattern);if(c==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=t.length,u=0;if(c<0){for(let a=0,o=Math.min(e.length,200);a<o&&u<l;){let o=n(e,a);(o==t[u]||o==r[u])&&(i[u++]=a),a+=le(o)}if(u<l)return null}let d=0,f=0,p=!1,m=0,h=-1,g=-1,_=/[a-z]/.test(e),v=!0;for(let i=0,u=Math.min(e.length,200),y=0;i<u&&f<l;){let u=n(e,i);c<0&&(d<l&&u==t[d]&&(a[d++]=i),m<l&&(u==t[m]||u==r[m]?(m==0&&(h=i),g=i+1,m++):m=0));let b,x=u<255?u>=48&&u<=57||u>=97&&u<=122?2:u>=65&&u<=90?1:0:(b=s(u))==b.toLowerCase()?b==b.toUpperCase()?0:2:1;(!i||x==1&&_||y==0&&x!=0)&&(t[f]==u||r[f]==u&&(p=!0)?o[f++]=i:o.length&&(v=!1)),y=x,i+=le(u)}return f==l&&o[0]==0&&v?this.result(-100+(p?-200:0),o,e):m==l&&h==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):c>-1?this.ret(-700-e.length,[c,c+this.pattern.length]):m==l?this.ret(-900-e.length,[h,g]):f==l?this.result(-100+(p?-200:0)+-700+(v?0:-1100),o,e):t.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,r){let i=[],a=0;for(let e of t){let t=e+(this.astral?le(n(r,e)):1);a&&i[a-1]==e?i[a-1]=t:(i[a++]=e,i[a++]=t)}return this.ret(e-r.length,i)}},nD=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},rD=ee.define({combine(e){return f(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:aD,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>iD(e(n),t(n)),optionClass:(e,t)=>n=>iD(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function iD(e,t){return e?t?e+` `+t:e:t}function aD(e,t,n,r,i,a){let o=e.textDirection==c.RTL,s=o,l=!1,u=`top`,d,f,p=t.left-i.left,m=i.right-t.right,h=r.right-r.left,g=r.bottom-r.top;if(s&&p<Math.min(h,m)?s=!1:!s&&m<Math.min(h,p)&&(s=!0),h<=(s?p:m))d=Math.max(i.top,Math.min(n.top,i.bottom-g))-t.top,f=Math.min(400,s?p:m);else{l=!0,f=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=g||e>t.top?d=n.bottom-t.top:(u=`bottom`,d=t.bottom-n.top)}let _=(t.bottom-t.top)/a.offsetHeight,v=(t.right-t.left)/a.offsetWidth;return{style:`${u}: ${d/_}px; max-width: ${f/v}px`,class:`cm-completionInfo-`+(l?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}var oD=o.define();function sD(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function cD(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}var lD=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(rD);this.optionContent=sD(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=cD(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:oD.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(rD).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:eD.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=cD(r.length,i,e.state.facet(rD).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=cD(t.options.length,t.selected,this.view.state.facet(rD).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>_e(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&dD(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(rD).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0))if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function uD(e,t){return n=>new lD(n,e,t)}function dD(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function fD(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function pD(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(rD);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new KE(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new nD(n):new tD(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new KE(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):fD(e.completion)>fD(c)&&(s[s.length-1]=e),c=e.completion}return s}var mD=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,yD(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=pD(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(rD).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,yD(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:OD,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},hD=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(bD,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(rD),i=(r.override||n.languageDataAt(`autocomplete`,qE(n)).map(QE)).map(e=>(this.active.find(t=>t.source==e)||new SD(e,this.active.some(e=>e.state!=0)?1:0)).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(TD));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!gD(i,this.active)||o?a=mD.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new SD(e.source,0):e));for(let e of t.effects)e.is(oD)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?_D:vD}};function gD(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var _D={"aria-autocomplete":`list`},vD={};function yD(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var bD=[];function xD(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(YE);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var SD=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=xD(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is($E))i=new e(i.source,1,n.value);else if(n.is(eD))i=new e(i.source,0);else if(n.is(TD))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(qE(e.state))}},CD=class e extends SD{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=qE(t.state);if(o>a||!r||n&2&&(qE(t.startState)==this.from||o<this.limit))return new SD(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return wD(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new VE(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??qE(t.state)):new SD(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new e(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new SD(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function wD(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):JE(e,!0).test(i)}var TD=o.define({map(e,t){return e.map(e=>e.map(t))}}),ED=i.define({create(){return hD.start()},update(e,t){return e.update(t)},provide:e=>[ie.from(e,e=>e.tooltip),u.contentAttributes.from(e,e=>e.attrs)]});function DD(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(ED).active.find(e=>e.source==t.source);return r instanceof CD?(typeof n==`string`?e.dispatch({...XE(e.state,n,r.from,r.to),annotations:YE.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}var OD=uD(ED,DD);function kD(t,n=`option`){return r=>{let i=r.state.field(ED,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<r.state.facet(rD).interactionDelay)return!1;let a=1,o;n==`page`&&(o=e(r,i.open.tooltip))&&(a=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector(`li`).offsetHeight)-1));let{length:s}=i.open.options,c=i.open.selected>-1?i.open.selected+a*(t?1:-1):t?0:s-1;return c<0?c=n==`page`?0:s-1:c>=s&&(c=n==`page`?s-1:0),r.dispatch({effects:oD.of(c)}),!0}}var AD=e=>{let t=e.state.field(ED,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(rD).interactionDelay?!1:DD(e,t.open.options[t.open.selected])},jD=e=>e.state.field(ED,!1)?(e.dispatch({effects:$E.of(!0)}),!0):!1,MD=e=>{let t=e.state.field(ED,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:eD.of(null)}),!0)},ND=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},PD=50,FD=1e3,ID=ye.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(ED).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(ED),n=e.state.facet(rD);if(!e.selectionSet&&!e.docChanged&&e.startState.field(ED)==t)return;let r=e.transactions.some(e=>{let t=xD(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>PD&&Date.now()-n.time>FD){for(let e of n.context.abortListeners)try{e()}catch(e){_e(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is($E)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(ED);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(rD).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new VE(t,qE(t),e.explicit,this.view),r=new ND(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:eD.of(null)}),_e(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(rD).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(rD),n=this.view.state.field(ED);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=qE(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+(i.active.explicit?0:1)),a=new CD(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(i.done==null){let n=new SD(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:TD.of(e)})}},{eventHandlers:{blur(t){let n=this.view.state.field(ED,!1);if(n&&n.tooltip&&this.view.state.facet(rD).closeOnBlur){let r=n.open&&e(this.view,n.open.tooltip);(!r||!r.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:eD.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:$E.of(!1)}),20),this.composing=0}}}),LD=typeof navigator==`object`&&/Win/.test(navigator.platform),RD=b.highest(u.domEventHandlers({keydown(e,t){let n=t.state.field(ED,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(LD&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&DD(t,r),!1}})),zD=u.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),BD=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},VD=class e{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(t){let n=t.mapPos(this.from,-1,ke.TrackDel),r=t.mapPos(this.to,1,ke.TrackDel);return n==null||r==null?null:new e(this.field,n,r)}},HD=class e{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],i=e.doc.lineAt(t),o=/^\s*/.exec(i.text)[0];for(let i of this.lines){if(n.length){let n=o,s=/^\t*/.exec(i)[0].length;for(let t=0;t<s;t++)n+=e.facet(a);r.push(t+n.length-s),i=n+i.slice(s)}n.push(i),t+=i.length+1}return{text:n,ranges:this.fieldPositions.map(e=>new VD(e.field,r[e.line]+e.from,r[e.line]+e.to))}}static parse(t){let n=[],r=[],i=[],a;for(let e of t.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(e);){let t=a[1]?+a[1]:null,o=a[2]||a[3]||``,s=-1,c=o.replace(/\\[{}]/g,e=>e[1]);for(let e=0;e<n.length;e++)(t==null?c&&n[e].name==c:n[e].seq==t)&&(s=e);if(s<0){let e=0;for(;e<n.length&&(t==null||n[e].seq!=null&&n[e].seq<t);)e++;n.splice(e,0,{seq:t,name:c}),s=e;for(let e of i)e.field>=s&&e.field++}for(let e of i)if(e.line==r.length&&e.from>a.index){let t=a[2]?3+(a[1]||``).length:2;e.from-=t,e.to-=t}i.push(new BD(s,r.length,a.index,a.index+c.length)),e=e.slice(0,a.index)+o+e.slice(a.index+a[0].length)}e=e.replace(/\\([{}])/g,(e,t,n)=>{for(let e of i)e.line==r.length&&e.from>n&&(e.from--,e.to--);return t}),r.push(e)}return new e(r,i)}},UD=C.widget({widget:new class extends l{toDOM(){let e=document.createElement(`span`);return e.className=`cm-snippetFieldPosition`,e}ignoreEvent(){return!1}}}),WD=C.mark({class:`cm-snippetField`}),GD=class e{constructor(e,t){this.ranges=e,this.active=t,this.deco=C.set(e.map(e=>(e.from==e.to?UD:WD).range(e.from,e.to)),!0)}map(t){let n=[];for(let e of this.ranges){let r=e.map(t);if(!r)return null;n.push(r)}return new e(n,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}},KD=o.define({map(e,t){return e&&e.map(t)}}),qD=o.define(),JD=i.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(KD))return n.value;if(n.is(qD)&&e)return new GD(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>u.decorations.from(e,e=>e?e.deco:C.none)});function YD(e,t){return N.create(e.filter(e=>e.field==t).map(e=>N.range(e.from,e.to)))}function XD(e){let t=HD.parse(e);return(e,n,r,i)=>{let{text:a,ranges:s}=t.instantiate(e.state,r),{main:c}=e.state.selection,l={changes:{from:r,to:i==c.from?c.to:i,insert:h.of(a)},scrollIntoView:!0,annotations:n?[YE.of(n),ue.userEvent.of(`input.complete`)]:void 0};if(s.length&&(l.selection=YD(s,0)),s.some(e=>e.field>0)){let t=new GD(s,0),n=l.effects=[KD.of(t)];e.state.field(JD,!1)===void 0&&n.push(o.appendConfig.of([JD,eO,nO,zD]))}e.dispatch(e.state.update(l))}}function ZD(e){return({state:t,dispatch:n})=>{let r=t.field(JD,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,a=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:YD(r.ranges,i),effects:KD.of(a?null:new GD(r.ranges,i)),scrollIntoView:!0})),!0}}var QD=[{key:`Tab`,run:ZD(1),shift:ZD(-1)},{key:`Escape`,run:({state:e,dispatch:t})=>e.field(JD,!1)?(t(e.update({effects:KD.of(null)})),!0):!1}],$D=ee.define({combine(e){return e.length?e[0]:QD}}),eO=b.highest(M.compute([$D],e=>e.facet($D)));function tO(e,t){return{...t,apply:XD(e)}}var nO=u.domEventHandlers({mousedown(e,t){let n=t.state.field(JD,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:YD(n.ranges,i.field),effects:KD.of(n.ranges.some(e=>e.field>i.field)?new GD(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),rO={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},iO=o.define({map(e,t){return t.mapPos(e,-1,ke.TrackAfter)??void 0}}),aO=new class extends S{};aO.startSide=1,aO.endSide=-1;var oO=i.define({create(){return r.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(iO)&&(e=e.update({add:[aO.range(n.value,n.value+1)]}));return e}});function sO(){return[fO,oO]}var cO=`()[]{}<>«»»«[]{}`;function lO(e){for(let t=0;t<16;t+=2)if(cO.charCodeAt(t)==e)return cO.charAt(t+1);return s(e<128?e:e+1)}function uO(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||rO}var dO=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),fO=u.inputHandler.of((e,t,r,i)=>{if((dO?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let a=e.state.selection.main;if(i.length>2||i.length==2&&le(n(i,0))==1||t!=a.from||r!=a.to)return!1;let o=mO(e.state,i);return o?(e.dispatch(o),!0):!1}),pO=[{key:`Backspace`,run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=uO(e,e.selection.main.head).brackets||rO.brackets,i=null,a=e.changeByRange(t=>{if(t.empty){let i=_O(e.doc,t.head);for(let a of r)if(a==i&&gO(e.doc,t.head)==lO(n(a,0)))return{changes:{from:t.head-a.length,to:t.head+a.length},range:N.cursor(t.head-a.length)}}return{range:i=t}});return i||t(e.update(a,{scrollIntoView:!0,userEvent:`delete.backward`})),!i}}];function mO(e,t){let r=uO(e,e.selection.main.head),i=r.brackets||rO.brackets;for(let a of i){let o=lO(n(a,0));if(t==a)return o==a?bO(e,a,i.indexOf(a+a+a)>-1,r):vO(e,a,o,r.before||rO.before);if(t==o&&hO(e,e.selection.main.from))return yO(e,a,o)}return null}function hO(e,t){let n=!1;return e.field(oO).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function gO(e,t){let r=e.sliceString(t,t+2);return r.slice(0,le(n(r,0)))}function _O(e,t){let r=e.sliceString(t-2,t);return le(n(r,0))==r.length?r:r.slice(1)}function vO(e,t,n,r){let i=null,a=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:iO.of(a.to+t.length),range:N.range(a.anchor+t.length,a.head+t.length)};let o=gO(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:iO.of(a.head+t.length),range:N.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function yO(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&gO(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:N.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function bO(e,t,n,r){let i=r.stringPrefixes||rO.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:iO.of(r.to+t.length),range:N.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=gO(e.doc,o),c;if(s==t){if(xO(e,o))return{changes:{insert:t+t,from:o},effects:iO.of(o+t.length),range:N.cursor(o+t.length)};if(hO(e,o)){let r=n&&e.sliceDoc(o,o+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:o,to:o+r.length,insert:r},range:N.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=CO(e,o-2*t.length,i))>-1&&xO(e,c))return{changes:{insert:t+t+t+t,from:o},effects:iO.of(o+t.length),range:N.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=D.Word&&CO(e,o,i)>-1&&!SO(e,o,t,i))return{changes:{insert:t+t,from:o},effects:iO.of(o+t.length),range:N.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function xO(e,t){let n=ce(e).resolveInner(t+1);return n.parent&&n.from==t}function SO(e,t,n,r){let i=ce(e).resolveInner(t,-1),a=r.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function CO(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=D.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=D.Word)return n}return-1}function wO(e={}){return[RD,ED,rD.of(e),ID,EO,zD]}var TO=[{key:`Ctrl-Space`,run:jD},{mac:"Alt-`",run:jD},{mac:`Alt-i`,run:jD},{key:`Escape`,run:MD},{key:`ArrowDown`,run:kD(!0)},{key:`ArrowUp`,run:kD(!1)},{key:`PageDown`,run:kD(!0,`page`)},{key:`PageUp`,run:kD(!1,`page`)},{key:`Enter`,run:AD}],EO=b.highest(M.computeN([rD],e=>e.facet(rD).defaultKeymap?[TO]:[])),DO=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},OO=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(HO).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new De,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=$O(s);if(i)o.add(n,n,C.widget({widget:new KO(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,C.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,kO(f))}};function kO(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new DO(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new DO(r.from,n,r.diagnostic)}),r}function AO(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(HO).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(MO))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function jO(e,t){return e.field(FO,!1)?t:t.concat(o.appendConfig.of(ek))}var MO=o.define(),NO=o.define(),PO=o.define(),FO=i.define({create(){return new OO(C.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=kO(n,e.selected.diagnostic,i)||kO(n,null,i)}!n.size&&i&&t.state.facet(HO).autoPanel&&(i=null),e=new OO(n,i,r)}for(let n of t.effects)if(n.is(MO)){let r=t.state.facet(HO).autoPanel?n.value.length?JO.open:null:e.panel;e=OO.init(n.value,r,t.state)}else n.is(NO)?e=new OO(e.diagnostics,n.value?JO.open:null,e.selected):n.is(PO)&&(e=new OO(e.diagnostics,e.panel,n.value));return e},provide:e=>[A.from(e,e=>e.panel),u.decorations.from(e,e=>e.diagnostics)]}),IO=C.mark({class:`cm-lintRange cm-lintRange-active`});function LO(e,t,n){let{diagnostics:r}=e.state.field(FO),i,a=-1,o=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(HO).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:RO(e,i)}}}:null}function RO(e,t){return ve(`ul`,{class:`cm-tooltip-lint`},t.map(t=>GO(e,t,!1)))}var zO=e=>{let t=e.state.field(FO,!1);(!t||!t.panel)&&e.dispatch({effects:jO(e.state,[NO.of(!0)])});let n=v(e,JO.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},BO=e=>{let t=e.state.field(FO,!1);return!t||!t.panel?!1:(e.dispatch({effects:NO.of(!1)}),!0)},VO=[{key:`Mod-Shift-m`,run:zO,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(FO,!1);if(!t)return!1;let n=e.state.selection.main,r=kO(t.diagnostics,null,n.to+1);return!r&&(r=kO(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],HO=ee.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...f(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:UO,tooltipFilter:UO,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function UO(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function WO(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function GO(e,t,n){let r=n?WO(t.actions):[];return ve(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},ve(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=kO(e.state.field(FO).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),ve(`u`,s.slice(c,c+1)),s.slice(c+1)];return ve(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&ve(`div`,{class:`cm-diagnosticSource`},t.source))}var KO=class extends l{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return ve(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},qO=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=GO(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},JO=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)BO(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=WO(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=kO(this.view.state.field(FO).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=ve(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=ve(`div`,{class:`cm-panel-lint`},this.list,ve(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>BO(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(FO).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(FO),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new qO(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new qO(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=kO(this.view.state.field(FO).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:PO.of(t)})}static open(t){return new e(t)}};function YO(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function XO(e){return YO(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var ZO=u.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:XO(`#d11`)},".cm-lintRange-warning":{backgroundImage:XO(`orange`)},".cm-lintRange-info":{backgroundImage:XO(`#999`)},".cm-lintRange-hint":{backgroundImage:XO(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function QO(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function $O(e){let t=`hint`,n=1;for(let r of e){let e=QO(r.severity);e>n&&(n=e,t=r.severity)}return t}var ek=[FO,u.decorations.compute([FO],e=>{let{selected:t,panel:n}=e.field(FO);return!t||!n||t.from==t.to?C.none:C.set([IO.range(t.from,t.to)])}),be(LO,{hideOn:AO}),ZO],tk=function(e){e===void 0&&(e={});var{crosshairCursor:n=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(pO)),e.defaultKeymap!==!1&&(r=r.concat(kT)),e.searchKeymap!==!1&&(r=r.concat(NE)),e.historyKeymap!==!1&&(r=r.concat(VC)),e.foldKeymap!==!1&&(r=r.concat(Te)),e.completionKeymap!==!1&&(r=r.concat(TO)),e.lintKeymap!==!1&&(r=r.concat(VO));var i=[];return e.lineNumbers!==!1&&i.push(k()),e.highlightActiveLineGutter!==!1&&i.push(Ce()),e.highlightSpecialChars!==!1&&i.push(he()),e.history!==!1&&i.push(SC()),e.foldGutter!==!1&&i.push(ae()),e.drawSelection!==!1&&i.push(w()),e.dropCursor!==!1&&i.push(E()),e.allowMultipleSelections!==!1&&i.push(Ae.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&i.push(Ee()),e.syntaxHighlighting!==!1&&i.push(t(re,{fallback:!0})),e.bracketMatching!==!1&&i.push(de()),e.closeBrackets!==!1&&i.push(sO()),e.autocompletion!==!1&&i.push(wO()),e.rectangularSelection!==!1&&i.push(ne()),n!==!1&&i.push(T()),e.highlightActiveLine!==!1&&i.push(j()),e.highlightSelectionMatches!==!1&&i.push(WT()),e.tabSize&&typeof e.tabSize==`number`&&i.push(a.of(` `.repeat(e.tabSize))),i.concat([M.of(r.flat())]).filter(Boolean)},nk=`#e5c07b`,rk=`#e06c75`,ik=`#56b6c2`,ak=`#ffffff`,ok=`#abb2bf`,sk=`#7d8799`,ck=`#61afef`,lk=`#98c379`,uk=`#d19a66`,dk=`#c678dd`,fk=`#21252b`,pk=`#2c313a`,mk=`#282c34`,hk=`#353a42`,gk=`#3E4451`,_k=`#528bff`,vk=[u.theme({"&":{color:ok,backgroundColor:mk},".cm-content":{caretColor:_k},".cm-cursor, .cm-dropCursor":{borderLeftColor:_k},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:gk},".cm-panels":{backgroundColor:fk,color:ok},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid #457dff`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#6199ff2f`},".cm-activeLine":{backgroundColor:`#6699ff0b`},".cm-selectionMatch":{backgroundColor:`#aafe661a`},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`},".cm-gutters":{backgroundColor:mk,color:sk,border:`none`},".cm-activeLineGutter":{backgroundColor:pk},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:hk},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:hk,borderBottomColor:hk},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:pk,color:ok}}},{dark:!0}),t(Se.define([{tag:g.keyword,color:dk},{tag:[g.name,g.deleted,g.character,g.propertyName,g.macroName],color:rk},{tag:[g.function(g.variableName),g.labelName],color:ck},{tag:[g.color,g.constant(g.name),g.standard(g.name)],color:uk},{tag:[g.definition(g.name),g.separator],color:ok},{tag:[g.typeName,g.className,g.number,g.changed,g.annotation,g.modifier,g.self,g.namespace],color:nk},{tag:[g.operator,g.operatorKeyword,g.url,g.escape,g.regexp,g.link,g.special(g.string)],color:ik},{tag:[g.meta,g.comment],color:sk},{tag:g.strong,fontWeight:`bold`},{tag:g.emphasis,fontStyle:`italic`},{tag:g.strikethrough,textDecoration:`line-through`},{tag:g.link,color:sk,textDecoration:`underline`},{tag:g.heading,fontWeight:`bold`,color:rk},{tag:[g.atom,g.bool,g.special(g.variableName)],color:uk},{tag:[g.processingInstruction,g.string,g.inserted],color:lk},{tag:g.invalid,color:ak}]))],yk=u.theme({"&":{backgroundColor:`#fff`}},{dark:!1}),bk=function(e){e===void 0&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:r=!1,theme:i=`light`,placeholder:a=``,basicSetup:o=!0}=e,s=[];switch(t&&s.unshift(M.of([AT])),o&&(typeof o==`boolean`?s.unshift(tk()):s.unshift(tk(o))),a&&s.unshift(xe(a)),i){case`light`:s.push(yk);break;case`dark`:s.push(vk);break;case`none`:break;default:s.push(i);break}return n===!1&&s.push(u.editable.of(!1)),r&&s.push(Ae.readOnly.of(!0)),[...s]},xk=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)}),Sk=class{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error(`TimeoutLatch callback error:`,e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}},Ck=class{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}},wk=null,Tk=()=>typeof window>`u`?new Ck:(wk||=new Ck,wk),Ek=pe.define(),Dk=200,Ok=[];function kk(e){var{value:t,selection:n,onChange:r,onStatistics:i,onCreateEditor:a,onUpdate:s,extensions:c=Ok,autoFocus:l,theme:d=`light`,height:f=null,minHeight:p=null,maxHeight:m=null,width:h=null,minWidth:g=null,maxWidth:_=null,placeholder:v=``,editable:y=!0,readOnly:b=!1,indentWithTab:x=!0,basicSetup:S=!0,root:C,initialState:w}=e,[T,E]=(0,F.useState)(),[D,O]=(0,F.useState)(),[k,ee]=(0,F.useState)(),te=(0,F.useState)(()=>({current:null}))[0],ne=(0,F.useState)(()=>({current:null}))[0],A=u.theme({"&":{height:f,minHeight:p,maxHeight:m,width:h,minWidth:g,maxWidth:_},"& .cm-scroller":{height:`100% !important`}}),j=[u.updateListener.of(e=>{e.docChanged&&typeof r==`function`&&!e.transactions.some(e=>e.annotation(Ek))&&(te.current?te.current.reset():(te.current=new Sk(()=>{if(ne.current){var e=ne.current;ne.current=null,e()}te.current=null},Dk),Tk().add(te.current)),r(e.state.doc.toString(),e)),i&&i(xk(e))}),A,...bk({theme:d,editable:y,readOnly:b,placeholder:v,indentWithTab:x,basicSetup:S})];return s&&typeof s==`function`&&j.push(u.updateListener.of(s)),j=j.concat(c),(0,F.useLayoutEffect)(()=>{if(T&&!k){var e={doc:t,selection:n,extensions:j},r=w?Ae.fromJSON(w.json,e,w.fields):Ae.create(e);if(ee(r),!D){var i=new u({state:r,parent:T,root:C});O(i),a&&a(i,r)}}return()=>{D&&(ee(void 0),O(void 0))}},[T,k]),(0,F.useEffect)(()=>{e.container&&E(e.container)},[e.container]),(0,F.useEffect)(()=>()=>{D&&(D.destroy(),O(void 0)),te.current&&=(te.current.cancel(),null)},[D]),(0,F.useEffect)(()=>{l&&D&&D.focus()},[l,D]),(0,F.useEffect)(()=>{D&&D.dispatch({effects:o.reconfigure.of(j)})},[d,c,f,p,m,h,g,_,v,y,b,x,S,r,s]),(0,F.useEffect)(()=>{if(t!==void 0){var e=D?D.state.doc.toString():``;if(D&&t!==e){var n=te.current&&!te.current.isDone,r=()=>{D&&t!==D.state.doc.toString()&&D.dispatch({changes:{from:0,to:D.state.doc.toString().length,insert:t||``},annotations:[Ek.of(!0)]})};n?ne.current=r:r()}}},[t,D]),{state:k,setState:ee,view:D,setView:O,container:T,setContainer:E}}var Ak=[`className`,`value`,`selection`,`extensions`,`onChange`,`onStatistics`,`onCreateEditor`,`onUpdate`,`autoFocus`,`theme`,`height`,`minHeight`,`maxHeight`,`width`,`minWidth`,`maxWidth`,`basicSetup`,`placeholder`,`indentWithTab`,`editable`,`readOnly`,`root`,`initialState`],jk=(0,F.forwardRef)((e,t)=>{var{className:n,value:r=``,selection:i,extensions:a=[],onChange:o,onStatistics:s,onCreateEditor:c,onUpdate:l,autoFocus:u,theme:d=`light`,height:f,minHeight:p,maxHeight:m,width:h,minWidth:g,maxWidth:_,basicSetup:v,placeholder:y,indentWithTab:b,editable:x,readOnly:S,root:C,initialState:w}=e,T=aC(e,Ak),E=(0,F.useRef)(null),{state:D,view:O,container:k,setContainer:ee}=kk({root:C,value:r,autoFocus:u,theme:d,height:f,minHeight:p,maxHeight:m,width:h,minWidth:g,maxWidth:_,basicSetup:v,placeholder:y,indentWithTab:b,editable:x,readOnly:S,selection:i,onChange:o,onStatistics:s,onCreateEditor:c,onUpdate:l,extensions:a,initialState:w});(0,F.useImperativeHandle)(t,()=>({editor:E.current,state:D,view:O}),[E,k,D,O]);var te=(0,F.useCallback)(e=>{E.current=e,ee(e)},[ee]);if(typeof r!=`string`)throw Error(`value must be typeof string but got `+typeof r);return(0,I.jsx)(`div`,iC({ref:te,className:(typeof d==`string`?`cm-theme-`+d:`cm-theme`)+(n?` `+n:``)},T))});jk.displayName=`CodeMirror`;var Mk=`modulepreload`,Nk=function(e){return`/`+e},Pk={},Q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Nk(t,n),t in Pk)return;Pk[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Mk,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function $(e){return new ge(te.define(e))}function Fk(e){return Q(()=>import(`./dist-C6K4bU_E.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([0,1,2]))}var Ik=[O.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return Q(()=>import(`./dist-DYBvJnrG.js`).then(e=>e.cpp()),__vite__mapDeps([3,1,2]))}}),O.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return Q(()=>import(`./dist-DYBvJnrG.js`).then(e=>e.cpp()),__vite__mapDeps([3,1,2]))}}),O.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return Fk(`Cassandra`)}}),O.of({name:`CSS`,extensions:[`css`],load(){return Q(()=>import(`./dist-Di_686oq.js`).then(e=>e.i).then(e=>e.css()),__vite__mapDeps([4,1,2]))}}),O.of({name:`Go`,extensions:[`go`],load(){return Q(()=>import(`./dist-DBuCfFb6.js`).then(e=>e.go()),__vite__mapDeps([5,1,2]))}}),O.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return Q(()=>import(`./dist-BU1nwyfe.js`).then(e=>e.html()),__vite__mapDeps([6,4,1,2,7]))}}),O.of({name:`Java`,extensions:[`java`],load(){return Q(()=>import(`./dist-elfU6IUT.js`).then(e=>e.java()),__vite__mapDeps([8,1,2]))}}),O.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return Q(()=>import(`./dist-DLKfnbJq.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([7,1,2]))}}),O.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return Q(()=>import(`./dist-5lEVZR9k.js`).then(e=>e.jinja()),__vite__mapDeps([9,4,1,2,6,7]))}}),O.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return Q(()=>import(`./dist-Cc03jTPl.js`).then(e=>e.json()),__vite__mapDeps([10,1,2]))}}),O.of({name:`JSX`,extensions:[`jsx`],load(){return Q(()=>import(`./dist-DLKfnbJq.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([7,1,2]))}}),O.of({name:`LESS`,extensions:[`less`],load(){return Q(()=>import(`./dist-CQ2y23jC.js`).then(e=>e.less()),__vite__mapDeps([11,4,1,2]))}}),O.of({name:`Liquid`,extensions:[`liquid`],load(){return Q(()=>import(`./dist-C5yratmO.js`).then(e=>e.liquid()),__vite__mapDeps([12,4,1,2,6,7]))}}),O.of({name:`MariaDB SQL`,load(){return Fk(`MariaSQL`)}}),O.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return Q(()=>import(`./dist-DI2cogpO.js`).then(e=>e.markdown()),__vite__mapDeps([13,4,1,2,6,7]))}}),O.of({name:`MS SQL`,load(){return Fk(`MSSQL`)}}),O.of({name:`MySQL`,load(){return Fk(`MySQL`)}}),O.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return Q(()=>import(`./dist-L8N1FWpZ.js`).then(e=>e.php()),__vite__mapDeps([14,4,1,2,6,7]))}}),O.of({name:`PLSQL`,extensions:[`pls`],load(){return Fk(`PLSQL`)}}),O.of({name:`PostgreSQL`,load(){return Fk(`PostgreSQL`)}}),O.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return Q(()=>import(`./dist-Bb5X5pWX.js`).then(e=>e.python()),__vite__mapDeps([15,1,2]))}}),O.of({name:`Rust`,extensions:[`rs`],load(){return Q(()=>import(`./dist-C6S96i9v.js`).then(e=>e.rust()),__vite__mapDeps([16,1,2]))}}),O.of({name:`Sass`,extensions:[`sass`],load(){return Q(()=>import(`./dist-eahr6WYj.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([17,4,1,2]))}}),O.of({name:`SCSS`,extensions:[`scss`],load(){return Q(()=>import(`./dist-eahr6WYj.js`).then(e=>e.sass()),__vite__mapDeps([17,4,1,2]))}}),O.of({name:`SQL`,extensions:[`sql`],load(){return Fk(`StandardSQL`)}}),O.of({name:`SQLite`,load(){return Fk(`SQLite`)}}),O.of({name:`TSX`,extensions:[`tsx`],load(){return Q(()=>import(`./dist-DLKfnbJq.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([7,1,2]))}}),O.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return Q(()=>import(`./dist-DLKfnbJq.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([7,1,2]))}}),O.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return Q(()=>import(`./dist-BSpuB3dZ.js`).then(e=>e.wast()),__vite__mapDeps([18,1,2]))}}),O.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return Q(()=>import(`./dist-DIQDx3Dq.js`).then(e=>e.xml()),__vite__mapDeps([19,1,2]))}}),O.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return Q(()=>import(`./dist-CftiQ_Tf.js`).then(e=>e.yaml()),__vite__mapDeps([20,1,2]))}}),O.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return Q(()=>import(`./apl-Dgw9L7wA.js`).then(e=>$(e.apl)),[])}}),O.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return Q(()=>import(`./asciiarmor-B3T-Ib7X.js`).then(e=>$(e.asciiArmor)),[])}}),O.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return Q(()=>import(`./asn1-C0KgO0Wt.js`).then(e=>$(e.asn1({}))),[])}}),O.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return Q(()=>import(`./asterisk-D7tOY-Ef.js`).then(e=>$(e.asterisk)),[])}}),O.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return Q(()=>import(`./brainfuck-Dr6WXxS2.js`).then(e=>$(e.brainfuck)),[])}}),O.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return Q(()=>import(`./cobol-ng5WMKOY.js`).then(e=>$(e.cobol)),[])}}),O.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return Q(()=>import(`./clike-DQfG49Bz.js`).then(e=>$(e.csharp)),[])}}),O.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return Q(()=>import(`./clojure-DsDsbt3V.js`).then(e=>$(e.clojure)),[])}}),O.of({name:`ClojureScript`,extensions:[`cljs`],load(){return Q(()=>import(`./clojure-DsDsbt3V.js`).then(e=>$(e.clojure)),[])}}),O.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return Q(()=>import(`./css-zrdFFahf.js`).then(e=>$(e.gss)),[])}}),O.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return Q(()=>import(`./cmake-CaoY67QC.js`).then(e=>$(e.cmake)),[])}}),O.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return Q(()=>import(`./coffeescript-L66efR1O.js`).then(e=>$(e.coffeeScript)),[])}}),O.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return Q(()=>import(`./commonlisp-rk__8_Ow.js`).then(e=>$(e.commonLisp)),[])}}),O.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return Q(()=>import(`./cypher-DTKBhe_T.js`).then(e=>$(e.cypher)),[])}}),O.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return Q(()=>import(`./python-_LoDBjEZ.js`).then(e=>$(e.cython)),[])}}),O.of({name:`Crystal`,extensions:[`cr`],load(){return Q(()=>import(`./crystal-C1BeQSjD.js`).then(e=>$(e.crystal)),[])}}),O.of({name:`D`,extensions:[`d`],load(){return Q(()=>import(`./d-CDf89RKe.js`).then(e=>$(e.d)),[])}}),O.of({name:`Dart`,extensions:[`dart`],load(){return Q(()=>import(`./clike-DQfG49Bz.js`).then(e=>$(e.dart)),[])}}),O.of({name:`diff`,extensions:[`diff`,`patch`],load(){return Q(()=>import(`./diff-BY4_GICG.js`).then(e=>$(e.diff)),[])}}),O.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return Q(()=>import(`./dockerfile-BBRxgo6-.js`).then(e=>$(e.dockerFile)),__vite__mapDeps([21,22]))}}),O.of({name:`DTD`,extensions:[`dtd`],load(){return Q(()=>import(`./dtd-BOpcurKR.js`).then(e=>$(e.dtd)),[])}}),O.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return Q(()=>import(`./dylan-DrmRAfMX.js`).then(e=>$(e.dylan)),[])}}),O.of({name:`EBNF`,load(){return Q(()=>import(`./ebnf-DgECi_W8.js`).then(e=>$(e.ebnf)),[])}}),O.of({name:`ECL`,extensions:[`ecl`],load(){return Q(()=>import(`./ecl-CWDhUBvl.js`).then(e=>$(e.ecl)),[])}}),O.of({name:`edn`,extensions:[`edn`],load(){return Q(()=>import(`./clojure-DsDsbt3V.js`).then(e=>$(e.clojure)),[])}}),O.of({name:`Eiffel`,extensions:[`e`],load(){return Q(()=>import(`./eiffel-DBpGy7gs.js`).then(e=>$(e.eiffel)),[])}}),O.of({name:`Elm`,extensions:[`elm`],load(){return Q(()=>import(`./elm-Dj_ZNWRH.js`).then(e=>$(e.elm)),[])}}),O.of({name:`Erlang`,extensions:[`erl`],load(){return Q(()=>import(`./erlang-Br4TQPB7.js`).then(e=>$(e.erlang)),[])}}),O.of({name:`Esper`,load(){return Q(()=>import(`./sql-C_mHN2XB.js`).then(e=>$(e.esper)),[])}}),O.of({name:`Factor`,extensions:[`factor`],load(){return Q(()=>import(`./factor-bi5FmZTz.js`).then(e=>$(e.factor)),__vite__mapDeps([23,22]))}}),O.of({name:`FCL`,load(){return Q(()=>import(`./fcl-Dh6ibuJG.js`).then(e=>$(e.fcl)),[])}}),O.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return Q(()=>import(`./forth-fmpuPpMA.js`).then(e=>$(e.forth)),[])}}),O.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return Q(()=>import(`./fortran-CZwiXuJZ.js`).then(e=>$(e.fortran)),[])}}),O.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return Q(()=>import(`./mllike-DsgO-njf.js`).then(e=>$(e.fSharp)),[])}}),O.of({name:`Gas`,extensions:[`s`],load(){return Q(()=>import(`./gas-DotCoURX.js`).then(e=>$(e.gas)),[])}}),O.of({name:`Gherkin`,extensions:[`feature`],load(){return Q(()=>import(`./gherkin-Bw4mmeRF.js`).then(e=>$(e.gherkin)),[])}}),O.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return Q(()=>import(`./groovy-D7xek06K.js`).then(e=>$(e.groovy)),[])}}),O.of({name:`Haskell`,extensions:[`hs`],load(){return Q(()=>import(`./haskell-D5bv2Ijt.js`).then(e=>$(e.haskell)),[])}}),O.of({name:`Haxe`,extensions:[`hx`],load(){return Q(()=>import(`./haxe-UA0z6FgT.js`).then(e=>$(e.haxe)),[])}}),O.of({name:`HXML`,extensions:[`hxml`],load(){return Q(()=>import(`./haxe-UA0z6FgT.js`).then(e=>$(e.hxml)),[])}}),O.of({name:`HTTP`,load(){return Q(()=>import(`./http-DAkDDIPY.js`).then(e=>$(e.http)),[])}}),O.of({name:`IDL`,extensions:[`pro`],load(){return Q(()=>import(`./idl-DYj57TA2.js`).then(e=>$(e.idl)),[])}}),O.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return Q(()=>import(`./javascript-B9Zm1tmO.js`).then(e=>$(e.jsonld)),[])}}),O.of({name:`Julia`,extensions:[`jl`],load(){return Q(()=>import(`./julia-CpHdnx_N.js`).then(e=>$(e.julia)),[])}}),O.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return Q(()=>import(`./clike-DQfG49Bz.js`).then(e=>$(e.kotlin)),[])}}),O.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return Q(()=>import(`./livescript-DcEJKRZ4.js`).then(e=>$(e.liveScript)),[])}}),O.of({name:`Lua`,extensions:[`lua`],load(){return Q(()=>import(`./lua-s-LPZohT.js`).then(e=>$(e.lua)),[])}}),O.of({name:`mIRC`,extensions:[`mrc`],load(){return Q(()=>import(`./mirc-pTdL1Ym3.js`).then(e=>$(e.mirc)),[])}}),O.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return Q(()=>import(`./mathematica-c8TKcpav.js`).then(e=>$(e.mathematica)),[])}}),O.of({name:`Modelica`,extensions:[`mo`],load(){return Q(()=>import(`./modelica-PhVkZonB.js`).then(e=>$(e.modelica)),[])}}),O.of({name:`MUMPS`,extensions:[`mps`],load(){return Q(()=>import(`./mumps-DhD4kjw9.js`).then(e=>$(e.mumps)),[])}}),O.of({name:`Mbox`,extensions:[`mbox`],load(){return Q(()=>import(`./mbox-CUr7-CiI.js`).then(e=>$(e.mbox)),[])}}),O.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return Q(()=>import(`./nginx-CJc6p_yt.js`).then(e=>$(e.nginx)),[])}}),O.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return Q(()=>import(`./nsis-BHchP6IS.js`).then(e=>$(e.nsis)),__vite__mapDeps([24,22]))}}),O.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return Q(()=>import(`./ntriples-D1v3iWDa.js`).then(e=>$(e.ntriples)),[])}}),O.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return Q(()=>import(`./clike-DQfG49Bz.js`).then(e=>$(e.objectiveC)),[])}}),O.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return Q(()=>import(`./clike-DQfG49Bz.js`).then(e=>$(e.objectiveCpp)),[])}}),O.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return Q(()=>import(`./mllike-DsgO-njf.js`).then(e=>$(e.oCaml)),[])}}),O.of({name:`Octave`,extensions:[`m`],load(){return Q(()=>import(`./octave-D_WvWxqk.js`).then(e=>$(e.octave)),[])}}),O.of({name:`Oz`,extensions:[`oz`],load(){return Q(()=>import(`./oz-CmdX4m3g.js`).then(e=>$(e.oz)),[])}}),O.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return Q(()=>import(`./pascal-hNOkBp6J.js`).then(e=>$(e.pascal)),[])}}),O.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return Q(()=>import(`./perl-NQdG1b_r.js`).then(e=>$(e.perl)),[])}}),O.of({name:`Pig`,extensions:[`pig`],load(){return Q(()=>import(`./pig-CXzedlZV.js`).then(e=>$(e.pig)),[])}}),O.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return Q(()=>import(`./powershell-RXDVpFWf.js`).then(e=>$(e.powerShell)),[])}}),O.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return Q(()=>import(`./properties-BTvtucqR.js`).then(e=>$(e.properties)),[])}}),O.of({name:`ProtoBuf`,extensions:[`proto`],load(){return Q(()=>import(`./protobuf-zHRYyuba.js`).then(e=>$(e.protobuf)),[])}}),O.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return Q(()=>import(`./pug-C39WZDG2.js`).then(e=>$(e.pug)),__vite__mapDeps([25,26]))}}),O.of({name:`Puppet`,extensions:[`pp`],load(){return Q(()=>import(`./puppet-CMNLsBcD.js`).then(e=>$(e.puppet)),[])}}),O.of({name:`Q`,extensions:[`q`],load(){return Q(()=>import(`./q-SLmsw_60.js`).then(e=>$(e.q)),[])}}),O.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return Q(()=>import(`./r-CocOMjw8.js`).then(e=>$(e.r)),[])}}),O.of({name:`RPM Changes`,load(){return Q(()=>import(`./rpm-WgkTpiCm.js`).then(e=>$(e.rpmChanges)),[])}}),O.of({name:`RPM Spec`,extensions:[`spec`],load(){return Q(()=>import(`./rpm-WgkTpiCm.js`).then(e=>$(e.rpmSpec)),[])}}),O.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return Q(()=>import(`./ruby-DquNeiGE.js`).then(e=>$(e.ruby)),[])}}),O.of({name:`SAS`,extensions:[`sas`],load(){return Q(()=>import(`./sas-sJxciv6G.js`).then(e=>$(e.sas)),[])}}),O.of({name:`Scala`,extensions:[`scala`],load(){return Q(()=>import(`./clike-DQfG49Bz.js`).then(e=>$(e.scala)),[])}}),O.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return Q(()=>import(`./scheme-DEjJDX5Z.js`).then(e=>$(e.scheme)),[])}}),O.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return Q(()=>import(`./shell-DhAwSAum.js`).then(e=>$(e.shell)),[])}}),O.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return Q(()=>import(`./sieve-CcW8-k2R.js`).then(e=>$(e.sieve)),[])}}),O.of({name:`Smalltalk`,extensions:[`st`],load(){return Q(()=>import(`./smalltalk-nXkQ5zwM.js`).then(e=>$(e.smalltalk)),[])}}),O.of({name:`Solr`,load(){return Q(()=>import(`./solr-DO54nYOg.js`).then(e=>$(e.solr)),[])}}),O.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return Q(()=>import(`./mllike-DsgO-njf.js`).then(e=>$(e.sml)),[])}}),O.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return Q(()=>import(`./sparql-CxAS_pwk.js`).then(e=>$(e.sparql)),[])}}),O.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return Q(()=>import(`./spreadsheet-DWzAMKF2.js`).then(e=>$(e.spreadsheet)),[])}}),O.of({name:`Squirrel`,extensions:[`nut`],load(){return Q(()=>import(`./clike-DQfG49Bz.js`).then(e=>$(e.squirrel)),[])}}),O.of({name:`Stylus`,extensions:[`styl`],load(){return Q(()=>import(`./stylus-CQ8h_EBd.js`).then(e=>$(e.stylus)),[])}}),O.of({name:`Swift`,extensions:[`swift`],load(){return Q(()=>import(`./swift-D0Eq5raO.js`).then(e=>$(e.swift)),[])}}),O.of({name:`sTeX`,load(){return Q(()=>import(`./stex-BmuQ0Xsx.js`).then(e=>$(e.stex)),[])}}),O.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return Q(()=>import(`./stex-BmuQ0Xsx.js`).then(e=>$(e.stex)),[])}}),O.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return Q(()=>import(`./verilog-B0DGHLZN.js`).then(e=>$(e.verilog)),[])}}),O.of({name:`Tcl`,extensions:[`tcl`],load(){return Q(()=>import(`./tcl-D7utka2n.js`).then(e=>$(e.tcl)),[])}}),O.of({name:`Textile`,extensions:[`textile`],load(){return Q(()=>import(`./textile-XEeoev-k.js`).then(e=>$(e.textile)),[])}}),O.of({name:`TiddlyWiki`,load(){return Q(()=>import(`./tiddlywiki-CecErCuV.js`).then(e=>$(e.tiddlyWiki)),[])}}),O.of({name:`Tiki wiki`,load(){return Q(()=>import(`./tiki-BlL-kki4.js`).then(e=>$(e.tiki)),[])}}),O.of({name:`TOML`,extensions:[`toml`],load(){return Q(()=>import(`./toml-mmtg9INI.js`).then(e=>$(e.toml)),[])}}),O.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return Q(()=>import(`./troff-Crc1ZuaH.js`).then(e=>$(e.troff)),[])}}),O.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return Q(()=>import(`./ttcn-Cri02b1f.js`).then(e=>$(e.ttcn)),[])}}),O.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return Q(()=>import(`./ttcn-cfg--4YiJN4x.js`).then(e=>$(e.ttcnCfg)),[])}}),O.of({name:`Turtle`,extensions:[`ttl`],load(){return Q(()=>import(`./turtle-CUuoUr2N.js`).then(e=>$(e.turtle)),[])}}),O.of({name:`Web IDL`,extensions:[`webidl`],load(){return Q(()=>import(`./webidl-C_bKeJT2.js`).then(e=>$(e.webIDL)),[])}}),O.of({name:`VB.NET`,extensions:[`vb`],load(){return Q(()=>import(`./vb-BrHulZxe.js`).then(e=>$(e.vb)),[])}}),O.of({name:`VBScript`,extensions:[`vbs`],load(){return Q(()=>import(`./vbscript-vyHcteNE.js`).then(e=>$(e.vbScript)),[])}}),O.of({name:`Velocity`,extensions:[`vtl`],load(){return Q(()=>import(`./velocity-DN4o8rq-.js`).then(e=>$(e.velocity)),[])}}),O.of({name:`Verilog`,extensions:[`v`],load(){return Q(()=>import(`./verilog-B0DGHLZN.js`).then(e=>$(e.verilog)),[])}}),O.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return Q(()=>import(`./vhdl-WeAF-qEm.js`).then(e=>$(e.vhdl)),[])}}),O.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return Q(()=>import(`./xquery-CLyH3kVm.js`).then(e=>$(e.xQuery)),[])}}),O.of({name:`Yacas`,extensions:[`ys`],load(){return Q(()=>import(`./yacas-Dq3LuV9B.js`).then(e=>$(e.yacas)),[])}}),O.of({name:`Z80`,extensions:[`z80`],load(){return Q(()=>import(`./z80-Br7weo_y.js`).then(e=>$(e.z80)),[])}}),O.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return Q(()=>import(`./mscgen-ByD0zE8S.js`).then(e=>$(e.mscgen)),[])}}),O.of({name:`Xù`,extensions:[`xu`],load(){return Q(()=>import(`./mscgen-ByD0zE8S.js`).then(e=>$(e.xu)),[])}}),O.of({name:`MsGenny`,extensions:[`msgenny`],load(){return Q(()=>import(`./mscgen-ByD0zE8S.js`).then(e=>$(e.msgenny)),[])}}),O.of({name:`Vue`,extensions:[`vue`],load(){return Q(()=>import(`./dist-Da00El95.js`).then(e=>e.vue()),__vite__mapDeps([27,4,1,2,6,7]))}}),O.of({name:`Angular Template`,load(){return Q(()=>import(`./dist-CtZnR5SU.js`).then(e=>e.angular()),__vite__mapDeps([28,4,1,2,6,7]))}})];function Lk(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o;n.key&&n.debug?.call(n)&&(o=Date.now());let s=e();if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug?.call(n)&&(c=Date.now()),i=t(...s),n.key&&n.debug?.call(n)){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
|
|
209
|
+
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new fE(this):new oE(this)}getCursor(e,t=0,n){let r=e.doc?e:Ae.create({doc:e});return n??=r.doc.length,this.regexp?cE(this,r,t,n):iE(this,r,t,n)}},nE=class{constructor(e){this.spec=e}};function rE(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function iE(e,t,n,r){let i;return e.wholeWord&&(i=aE(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=rE(e.test,t,i)),new MT(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function aE(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(lE(i,n-a))!=D.Word||t(uE(i,n-a))!=D.Word)&&(t(uE(i,r-a))!=D.Word||t(lE(i,r-a))!=D.Word))}var oE=class extends nE{constructor(e){super(e)}nextMatch(e,t,n){let r=iE(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=iE(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=iE(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=iE(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=iE(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function sE(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function cE(e,t,n,r){let i;return e.wholeWord&&(i=dE(t.charCategorizer(t.selection.main.head))),e.test&&(i=sE(e.test,t,i)),new FT(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function lE(e,t){return e.slice(_(e,t,!1),t)}function uE(e,t){return e.slice(t,_(e,t))}function dE(e){return(t,n,r)=>!r[0].length||(e(lE(r.input,r.index))!=D.Word||e(uE(r.input,r.index))!=D.Word)&&(e(uE(r.input,r.index+r[0].length))!=D.Word||e(lE(r.input,r.index+r[0].length))!=D.Word)}var fE=class extends nE{nextMatch(e,t,n){let r=cE(this.spec,e,n,e.doc.length).next();return r.done&&(r=cE(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=cE(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=cE(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=cE(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},pE=o.define(),mE=o.define(),hE=i.define({create(e){return new gE(OE(e).create(),null)},update(e,t){for(let n of t.effects)n.is(pE)?e=new gE(n.value.create(),e.panel):n.is(mE)&&(e=new gE(e.query,n.value?DE:null));return e},provide:e=>A.from(e,e=>e.panel)}),gE=class{constructor(e,t){this.query=e,this.panel=t}},_E=C.mark({class:`cm-searchMatch`}),vE=C.mark({class:`cm-searchMatch cm-searchMatch-selected`}),yE=ye.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(hE))}update(e){let t=e.state.field(hE);(t!=e.startState.field(hE)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return C.none;let{view:n}=this,r=new De;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?vE:_E)})}return r.finish()}},{decorations:e=>e.decorations});function bE(e){return t=>{let n=t.state.field(hE,!1);return n&&n.query.spec.valid?e(t,n):jE(t)}}var xE=bE((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=N.single(r.from,r.to),a=e.state.facet(eE);return e.dispatch({selection:i,effects:[RE(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),AE(e),!0}),SE=bE((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=N.single(i.from,i.to),o=e.state.facet(eE);return e.dispatch({selection:a,effects:[RE(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),AE(e),!0}),CE=bE((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:N.create(n.map(e=>N.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),wE=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new MT(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(N.range(t.value.from,t.value.to))}return t(e.update({selection:N.create(a,o),userEvent:`select.search.matches`})),!0},TE=bE((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,d=[];o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),d.push(u.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`)));let f=e.state.changes(s);return o&&(c=N.single(o.from,o.to).map(f),d.push(RE(e,o)),d.push(n.facet(eE).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:`input.replace`}),!0}),EE=bE((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:u.announce.of(r),userEvent:`input.replace.all`}),!0});function DE(e){return e.state.facet(eE).createPanel(e)}function OE(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(eE);return new tE({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function kE(e){let t=v(e,DE);return t&&t.dom.querySelector(`[main-field]`)}function AE(e){let t=kE(e);t&&t==e.root.activeElement&&t.select()}var jE=e=>{let t=e.state.field(hE,!1);if(t&&t.panel){let n=kE(e);if(n&&n!=e.root.activeElement){let r=OE(e.state,t.query.spec);r.valid&&e.dispatch({effects:pE.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[mE.of(!0),t?pE.of(OE(e.state,t.query.spec)):o.appendConfig.of(BE)]});return!0},ME=e=>{let t=e.state.field(hE,!1);if(!t||!t.panel)return!1;let n=v(e,DE);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:mE.of(!1)}),!0},NE=[{key:`Mod-f`,run:jE,scope:`editor search-panel`},{key:`F3`,run:xE,shift:SE,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:xE,shift:SE,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:ME,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:wE},{key:`Mod-Alt-g`,run:VT},{key:`Mod-d`,run:$T,preventDefault:!0}],PE=class{constructor(e){this.view=e;let t=this.query=e.state.field(hE).query.spec;this.commit=this.commit.bind(this),this.searchField=ve(`input`,{value:t.search,placeholder:FE(e,`Find`),"aria-label":FE(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=ve(`input`,{value:t.replace,placeholder:FE(e,`Replace`),"aria-label":FE(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=ve(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=ve(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=ve(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return ve(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=ve(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>xE(e),[FE(e,`next`)]),n(`prev`,()=>SE(e),[FE(e,`previous`)]),n(`select`,()=>CE(e),[FE(e,`all`)]),ve(`label`,null,[this.caseField,FE(e,`match case`)]),ve(`label`,null,[this.reField,FE(e,`regexp`)]),ve(`label`,null,[this.wordField,FE(e,`by word`)]),...e.state.readOnly?[]:[ve(`br`),this.replaceField,n(`replace`,()=>TE(e),[FE(e,`replace`)]),n(`replaceAll`,()=>EE(e),[FE(e,`replace all`)])],ve(`button`,{name:`close`,onclick:()=>ME(e),"aria-label":FE(e,`close`),type:`button`},[`×`])])}commit(){let e=new tE({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:pE.of(e)}))}keydown(e){fe(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?SE:xE)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),TE(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(pE)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(eE).top}};function FE(e,t){return e.state.phrase(t)}var IE=30,LE=/[\s\.,:;?!]/;function RE(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-IE),o=Math.min(i,n+IE),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<IE;e++)if(!LE.test(s[e+1])&&LE.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-IE;e--)if(!LE.test(s[e-1])&&LE.test(s[e])){s=s.slice(0,e);break}}return u.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var zE=u.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),BE=[hE,b.low(yE),zE],VE=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=ce(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(JE(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function HE(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function UE(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=HE(t)+HE(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function WE(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:UE(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function GE(e,t){return n=>{for(let t=ce(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}var KE=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function qE(e){return e.selection.main.from}function JE(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var YE=pe.define();function XE(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:N.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var ZE=new WeakMap;function QE(e){if(!Array.isArray(e))return e;let t=ZE.get(e);return t||ZE.set(e,t=WE(e)),t}var $E=o.define(),eD=o.define(),tD=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let r=n(e,t),i=le(r);this.chars.push(r);let a=e.slice(t,t+i),o=a.toUpperCase();this.folded.push(n(o==a?a.toLowerCase():o,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:r,any:i,precise:a,byWord:o}=this;if(t.length==1){let i=n(e,0),a=le(i),o=a==e.length?0:-100;if(i!=t[0])if(i==r[0])o+=-200;else return null;return this.ret(o,[0,a])}let c=e.indexOf(this.pattern);if(c==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=t.length,u=0;if(c<0){for(let a=0,o=Math.min(e.length,200);a<o&&u<l;){let o=n(e,a);(o==t[u]||o==r[u])&&(i[u++]=a),a+=le(o)}if(u<l)return null}let d=0,f=0,p=!1,m=0,h=-1,g=-1,_=/[a-z]/.test(e),v=!0;for(let i=0,u=Math.min(e.length,200),y=0;i<u&&f<l;){let u=n(e,i);c<0&&(d<l&&u==t[d]&&(a[d++]=i),m<l&&(u==t[m]||u==r[m]?(m==0&&(h=i),g=i+1,m++):m=0));let b,x=u<255?u>=48&&u<=57||u>=97&&u<=122?2:u>=65&&u<=90?1:0:(b=s(u))==b.toLowerCase()?b==b.toUpperCase()?0:2:1;(!i||x==1&&_||y==0&&x!=0)&&(t[f]==u||r[f]==u&&(p=!0)?o[f++]=i:o.length&&(v=!1)),y=x,i+=le(u)}return f==l&&o[0]==0&&v?this.result(-100+(p?-200:0),o,e):m==l&&h==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):c>-1?this.ret(-700-e.length,[c,c+this.pattern.length]):m==l?this.ret(-900-e.length,[h,g]):f==l?this.result(-100+(p?-200:0)+-700+(v?0:-1100),o,e):t.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,r){let i=[],a=0;for(let e of t){let t=e+(this.astral?le(n(r,e)):1);a&&i[a-1]==e?i[a-1]=t:(i[a++]=e,i[a++]=t)}return this.ret(e-r.length,i)}},nD=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},rD=ee.define({combine(e){return f(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:aD,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>iD(e(n),t(n)),optionClass:(e,t)=>n=>iD(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function iD(e,t){return e?t?e+` `+t:e:t}function aD(e,t,n,r,i,a){let o=e.textDirection==c.RTL,s=o,l=!1,u=`top`,d,f,p=t.left-i.left,m=i.right-t.right,h=r.right-r.left,g=r.bottom-r.top;if(s&&p<Math.min(h,m)?s=!1:!s&&m<Math.min(h,p)&&(s=!0),h<=(s?p:m))d=Math.max(i.top,Math.min(n.top,i.bottom-g))-t.top,f=Math.min(400,s?p:m);else{l=!0,f=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=g||e>t.top?d=n.bottom-t.top:(u=`bottom`,d=t.bottom-n.top)}let _=(t.bottom-t.top)/a.offsetHeight,v=(t.right-t.left)/a.offsetWidth;return{style:`${u}: ${d/_}px; max-width: ${f/v}px`,class:`cm-completionInfo-`+(l?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}var oD=o.define();function sD(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function cD(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}var lD=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(rD);this.optionContent=sD(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=cD(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:oD.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(rD).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:eD.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=cD(r.length,i,e.state.facet(rD).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=cD(t.options.length,t.selected,this.view.state.facet(rD).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>_e(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&dD(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(rD).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0))if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function uD(e,t){return n=>new lD(n,e,t)}function dD(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function fD(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function pD(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(rD);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new KE(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new nD(n):new tD(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new KE(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):fD(e.completion)>fD(c)&&(s[s.length-1]=e),c=e.completion}return s}var mD=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,yD(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=pD(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(rD).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,yD(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:OD,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},hD=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(bD,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(rD),i=(r.override||n.languageDataAt(`autocomplete`,qE(n)).map(QE)).map(e=>(this.active.find(t=>t.source==e)||new SD(e,this.active.some(e=>e.state!=0)?1:0)).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(TD));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!gD(i,this.active)||o?a=mD.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new SD(e.source,0):e));for(let e of t.effects)e.is(oD)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?_D:vD}};function gD(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var _D={"aria-autocomplete":`list`},vD={};function yD(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var bD=[];function xD(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(YE);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var SD=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=xD(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is($E))i=new e(i.source,1,n.value);else if(n.is(eD))i=new e(i.source,0);else if(n.is(TD))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(qE(e.state))}},CD=class e extends SD{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=qE(t.state);if(o>a||!r||n&2&&(qE(t.startState)==this.from||o<this.limit))return new SD(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return wD(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new VE(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??qE(t.state)):new SD(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new e(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new SD(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function wD(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):JE(e,!0).test(i)}var TD=o.define({map(e,t){return e.map(e=>e.map(t))}}),ED=i.define({create(){return hD.start()},update(e,t){return e.update(t)},provide:e=>[ie.from(e,e=>e.tooltip),u.contentAttributes.from(e,e=>e.attrs)]});function DD(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(ED).active.find(e=>e.source==t.source);return r instanceof CD?(typeof n==`string`?e.dispatch({...XE(e.state,n,r.from,r.to),annotations:YE.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}var OD=uD(ED,DD);function kD(t,n=`option`){return r=>{let i=r.state.field(ED,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<r.state.facet(rD).interactionDelay)return!1;let a=1,o;n==`page`&&(o=e(r,i.open.tooltip))&&(a=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector(`li`).offsetHeight)-1));let{length:s}=i.open.options,c=i.open.selected>-1?i.open.selected+a*(t?1:-1):t?0:s-1;return c<0?c=n==`page`?0:s-1:c>=s&&(c=n==`page`?s-1:0),r.dispatch({effects:oD.of(c)}),!0}}var AD=e=>{let t=e.state.field(ED,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(rD).interactionDelay?!1:DD(e,t.open.options[t.open.selected])},jD=e=>e.state.field(ED,!1)?(e.dispatch({effects:$E.of(!0)}),!0):!1,MD=e=>{let t=e.state.field(ED,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:eD.of(null)}),!0)},ND=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},PD=50,FD=1e3,ID=ye.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(ED).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(ED),n=e.state.facet(rD);if(!e.selectionSet&&!e.docChanged&&e.startState.field(ED)==t)return;let r=e.transactions.some(e=>{let t=xD(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>PD&&Date.now()-n.time>FD){for(let e of n.context.abortListeners)try{e()}catch(e){_e(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is($E)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(ED);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(rD).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new VE(t,qE(t),e.explicit,this.view),r=new ND(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:eD.of(null)}),_e(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(rD).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(rD),n=this.view.state.field(ED);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=qE(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+(i.active.explicit?0:1)),a=new CD(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(i.done==null){let n=new SD(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:TD.of(e)})}},{eventHandlers:{blur(t){let n=this.view.state.field(ED,!1);if(n&&n.tooltip&&this.view.state.facet(rD).closeOnBlur){let r=n.open&&e(this.view,n.open.tooltip);(!r||!r.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:eD.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:$E.of(!1)}),20),this.composing=0}}}),LD=typeof navigator==`object`&&/Win/.test(navigator.platform),RD=b.highest(u.domEventHandlers({keydown(e,t){let n=t.state.field(ED,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(LD&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&DD(t,r),!1}})),zD=u.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),BD=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},VD=class e{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(t){let n=t.mapPos(this.from,-1,ke.TrackDel),r=t.mapPos(this.to,1,ke.TrackDel);return n==null||r==null?null:new e(this.field,n,r)}},HD=class e{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],i=e.doc.lineAt(t),o=/^\s*/.exec(i.text)[0];for(let i of this.lines){if(n.length){let n=o,s=/^\t*/.exec(i)[0].length;for(let t=0;t<s;t++)n+=e.facet(a);r.push(t+n.length-s),i=n+i.slice(s)}n.push(i),t+=i.length+1}return{text:n,ranges:this.fieldPositions.map(e=>new VD(e.field,r[e.line]+e.from,r[e.line]+e.to))}}static parse(t){let n=[],r=[],i=[],a;for(let e of t.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(e);){let t=a[1]?+a[1]:null,o=a[2]||a[3]||``,s=-1,c=o.replace(/\\[{}]/g,e=>e[1]);for(let e=0;e<n.length;e++)(t==null?c&&n[e].name==c:n[e].seq==t)&&(s=e);if(s<0){let e=0;for(;e<n.length&&(t==null||n[e].seq!=null&&n[e].seq<t);)e++;n.splice(e,0,{seq:t,name:c}),s=e;for(let e of i)e.field>=s&&e.field++}for(let e of i)if(e.line==r.length&&e.from>a.index){let t=a[2]?3+(a[1]||``).length:2;e.from-=t,e.to-=t}i.push(new BD(s,r.length,a.index,a.index+c.length)),e=e.slice(0,a.index)+o+e.slice(a.index+a[0].length)}e=e.replace(/\\([{}])/g,(e,t,n)=>{for(let e of i)e.line==r.length&&e.from>n&&(e.from--,e.to--);return t}),r.push(e)}return new e(r,i)}},UD=C.widget({widget:new class extends l{toDOM(){let e=document.createElement(`span`);return e.className=`cm-snippetFieldPosition`,e}ignoreEvent(){return!1}}}),WD=C.mark({class:`cm-snippetField`}),GD=class e{constructor(e,t){this.ranges=e,this.active=t,this.deco=C.set(e.map(e=>(e.from==e.to?UD:WD).range(e.from,e.to)),!0)}map(t){let n=[];for(let e of this.ranges){let r=e.map(t);if(!r)return null;n.push(r)}return new e(n,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}},KD=o.define({map(e,t){return e&&e.map(t)}}),qD=o.define(),JD=i.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(KD))return n.value;if(n.is(qD)&&e)return new GD(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>u.decorations.from(e,e=>e?e.deco:C.none)});function YD(e,t){return N.create(e.filter(e=>e.field==t).map(e=>N.range(e.from,e.to)))}function XD(e){let t=HD.parse(e);return(e,n,r,i)=>{let{text:a,ranges:s}=t.instantiate(e.state,r),{main:c}=e.state.selection,l={changes:{from:r,to:i==c.from?c.to:i,insert:h.of(a)},scrollIntoView:!0,annotations:n?[YE.of(n),ue.userEvent.of(`input.complete`)]:void 0};if(s.length&&(l.selection=YD(s,0)),s.some(e=>e.field>0)){let t=new GD(s,0),n=l.effects=[KD.of(t)];e.state.field(JD,!1)===void 0&&n.push(o.appendConfig.of([JD,eO,nO,zD]))}e.dispatch(e.state.update(l))}}function ZD(e){return({state:t,dispatch:n})=>{let r=t.field(JD,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,a=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:YD(r.ranges,i),effects:KD.of(a?null:new GD(r.ranges,i)),scrollIntoView:!0})),!0}}var QD=[{key:`Tab`,run:ZD(1),shift:ZD(-1)},{key:`Escape`,run:({state:e,dispatch:t})=>e.field(JD,!1)?(t(e.update({effects:KD.of(null)})),!0):!1}],$D=ee.define({combine(e){return e.length?e[0]:QD}}),eO=b.highest(M.compute([$D],e=>e.facet($D)));function tO(e,t){return{...t,apply:XD(e)}}var nO=u.domEventHandlers({mousedown(e,t){let n=t.state.field(JD,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:YD(n.ranges,i.field),effects:KD.of(n.ranges.some(e=>e.field>i.field)?new GD(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),rO={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},iO=o.define({map(e,t){return t.mapPos(e,-1,ke.TrackAfter)??void 0}}),aO=new class extends S{};aO.startSide=1,aO.endSide=-1;var oO=i.define({create(){return r.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(iO)&&(e=e.update({add:[aO.range(n.value,n.value+1)]}));return e}});function sO(){return[fO,oO]}var cO=`()[]{}<>«»»«[]{}`;function lO(e){for(let t=0;t<16;t+=2)if(cO.charCodeAt(t)==e)return cO.charAt(t+1);return s(e<128?e:e+1)}function uO(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||rO}var dO=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),fO=u.inputHandler.of((e,t,r,i)=>{if((dO?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let a=e.state.selection.main;if(i.length>2||i.length==2&&le(n(i,0))==1||t!=a.from||r!=a.to)return!1;let o=mO(e.state,i);return o?(e.dispatch(o),!0):!1}),pO=[{key:`Backspace`,run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=uO(e,e.selection.main.head).brackets||rO.brackets,i=null,a=e.changeByRange(t=>{if(t.empty){let i=_O(e.doc,t.head);for(let a of r)if(a==i&&gO(e.doc,t.head)==lO(n(a,0)))return{changes:{from:t.head-a.length,to:t.head+a.length},range:N.cursor(t.head-a.length)}}return{range:i=t}});return i||t(e.update(a,{scrollIntoView:!0,userEvent:`delete.backward`})),!i}}];function mO(e,t){let r=uO(e,e.selection.main.head),i=r.brackets||rO.brackets;for(let a of i){let o=lO(n(a,0));if(t==a)return o==a?bO(e,a,i.indexOf(a+a+a)>-1,r):vO(e,a,o,r.before||rO.before);if(t==o&&hO(e,e.selection.main.from))return yO(e,a,o)}return null}function hO(e,t){let n=!1;return e.field(oO).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function gO(e,t){let r=e.sliceString(t,t+2);return r.slice(0,le(n(r,0)))}function _O(e,t){let r=e.sliceString(t-2,t);return le(n(r,0))==r.length?r:r.slice(1)}function vO(e,t,n,r){let i=null,a=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:iO.of(a.to+t.length),range:N.range(a.anchor+t.length,a.head+t.length)};let o=gO(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:iO.of(a.head+t.length),range:N.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function yO(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&gO(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:N.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function bO(e,t,n,r){let i=r.stringPrefixes||rO.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:iO.of(r.to+t.length),range:N.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=gO(e.doc,o),c;if(s==t){if(xO(e,o))return{changes:{insert:t+t,from:o},effects:iO.of(o+t.length),range:N.cursor(o+t.length)};if(hO(e,o)){let r=n&&e.sliceDoc(o,o+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:o,to:o+r.length,insert:r},range:N.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=CO(e,o-2*t.length,i))>-1&&xO(e,c))return{changes:{insert:t+t+t+t,from:o},effects:iO.of(o+t.length),range:N.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=D.Word&&CO(e,o,i)>-1&&!SO(e,o,t,i))return{changes:{insert:t+t,from:o},effects:iO.of(o+t.length),range:N.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function xO(e,t){let n=ce(e).resolveInner(t+1);return n.parent&&n.from==t}function SO(e,t,n,r){let i=ce(e).resolveInner(t,-1),a=r.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function CO(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=D.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=D.Word)return n}return-1}function wO(e={}){return[RD,ED,rD.of(e),ID,EO,zD]}var TO=[{key:`Ctrl-Space`,run:jD},{mac:"Alt-`",run:jD},{mac:`Alt-i`,run:jD},{key:`Escape`,run:MD},{key:`ArrowDown`,run:kD(!0)},{key:`ArrowUp`,run:kD(!1)},{key:`PageDown`,run:kD(!0,`page`)},{key:`PageUp`,run:kD(!1,`page`)},{key:`Enter`,run:AD}],EO=b.highest(M.computeN([rD],e=>e.facet(rD).defaultKeymap?[TO]:[])),DO=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},OO=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(HO).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new De,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=$O(s);if(i)o.add(n,n,C.widget({widget:new KO(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,C.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,kO(f))}};function kO(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new DO(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new DO(r.from,n,r.diagnostic)}),r}function AO(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(HO).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(MO))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function jO(e,t){return e.field(FO,!1)?t:t.concat(o.appendConfig.of(ek))}var MO=o.define(),NO=o.define(),PO=o.define(),FO=i.define({create(){return new OO(C.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=kO(n,e.selected.diagnostic,i)||kO(n,null,i)}!n.size&&i&&t.state.facet(HO).autoPanel&&(i=null),e=new OO(n,i,r)}for(let n of t.effects)if(n.is(MO)){let r=t.state.facet(HO).autoPanel?n.value.length?JO.open:null:e.panel;e=OO.init(n.value,r,t.state)}else n.is(NO)?e=new OO(e.diagnostics,n.value?JO.open:null,e.selected):n.is(PO)&&(e=new OO(e.diagnostics,e.panel,n.value));return e},provide:e=>[A.from(e,e=>e.panel),u.decorations.from(e,e=>e.diagnostics)]}),IO=C.mark({class:`cm-lintRange cm-lintRange-active`});function LO(e,t,n){let{diagnostics:r}=e.state.field(FO),i,a=-1,o=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(HO).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:RO(e,i)}}}:null}function RO(e,t){return ve(`ul`,{class:`cm-tooltip-lint`},t.map(t=>GO(e,t,!1)))}var zO=e=>{let t=e.state.field(FO,!1);(!t||!t.panel)&&e.dispatch({effects:jO(e.state,[NO.of(!0)])});let n=v(e,JO.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},BO=e=>{let t=e.state.field(FO,!1);return!t||!t.panel?!1:(e.dispatch({effects:NO.of(!1)}),!0)},VO=[{key:`Mod-Shift-m`,run:zO,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(FO,!1);if(!t)return!1;let n=e.state.selection.main,r=kO(t.diagnostics,null,n.to+1);return!r&&(r=kO(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],HO=ee.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...f(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:UO,tooltipFilter:UO,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function UO(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function WO(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function GO(e,t,n){let r=n?WO(t.actions):[];return ve(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},ve(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=kO(e.state.field(FO).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),ve(`u`,s.slice(c,c+1)),s.slice(c+1)];return ve(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&ve(`div`,{class:`cm-diagnosticSource`},t.source))}var KO=class extends l{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return ve(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},qO=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=GO(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},JO=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)BO(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=WO(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=kO(this.view.state.field(FO).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=ve(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=ve(`div`,{class:`cm-panel-lint`},this.list,ve(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>BO(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(FO).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(FO),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new qO(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new qO(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=kO(this.view.state.field(FO).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:PO.of(t)})}static open(t){return new e(t)}};function YO(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function XO(e){return YO(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var ZO=u.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:XO(`#d11`)},".cm-lintRange-warning":{backgroundImage:XO(`orange`)},".cm-lintRange-info":{backgroundImage:XO(`#999`)},".cm-lintRange-hint":{backgroundImage:XO(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function QO(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function $O(e){let t=`hint`,n=1;for(let r of e){let e=QO(r.severity);e>n&&(n=e,t=r.severity)}return t}var ek=[FO,u.decorations.compute([FO],e=>{let{selected:t,panel:n}=e.field(FO);return!t||!n||t.from==t.to?C.none:C.set([IO.range(t.from,t.to)])}),be(LO,{hideOn:AO}),ZO],tk=function(e){e===void 0&&(e={});var{crosshairCursor:n=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(pO)),e.defaultKeymap!==!1&&(r=r.concat(kT)),e.searchKeymap!==!1&&(r=r.concat(NE)),e.historyKeymap!==!1&&(r=r.concat(VC)),e.foldKeymap!==!1&&(r=r.concat(Te)),e.completionKeymap!==!1&&(r=r.concat(TO)),e.lintKeymap!==!1&&(r=r.concat(VO));var i=[];return e.lineNumbers!==!1&&i.push(k()),e.highlightActiveLineGutter!==!1&&i.push(Ce()),e.highlightSpecialChars!==!1&&i.push(he()),e.history!==!1&&i.push(SC()),e.foldGutter!==!1&&i.push(ae()),e.drawSelection!==!1&&i.push(w()),e.dropCursor!==!1&&i.push(E()),e.allowMultipleSelections!==!1&&i.push(Ae.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&i.push(Ee()),e.syntaxHighlighting!==!1&&i.push(t(re,{fallback:!0})),e.bracketMatching!==!1&&i.push(de()),e.closeBrackets!==!1&&i.push(sO()),e.autocompletion!==!1&&i.push(wO()),e.rectangularSelection!==!1&&i.push(ne()),n!==!1&&i.push(T()),e.highlightActiveLine!==!1&&i.push(j()),e.highlightSelectionMatches!==!1&&i.push(WT()),e.tabSize&&typeof e.tabSize==`number`&&i.push(a.of(` `.repeat(e.tabSize))),i.concat([M.of(r.flat())]).filter(Boolean)},nk=`#e5c07b`,rk=`#e06c75`,ik=`#56b6c2`,ak=`#ffffff`,ok=`#abb2bf`,sk=`#7d8799`,ck=`#61afef`,lk=`#98c379`,uk=`#d19a66`,dk=`#c678dd`,fk=`#21252b`,pk=`#2c313a`,mk=`#282c34`,hk=`#353a42`,gk=`#3E4451`,_k=`#528bff`,vk=[u.theme({"&":{color:ok,backgroundColor:mk},".cm-content":{caretColor:_k},".cm-cursor, .cm-dropCursor":{borderLeftColor:_k},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:gk},".cm-panels":{backgroundColor:fk,color:ok},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid #457dff`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#6199ff2f`},".cm-activeLine":{backgroundColor:`#6699ff0b`},".cm-selectionMatch":{backgroundColor:`#aafe661a`},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`},".cm-gutters":{backgroundColor:mk,color:sk,border:`none`},".cm-activeLineGutter":{backgroundColor:pk},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:hk},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:hk,borderBottomColor:hk},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:pk,color:ok}}},{dark:!0}),t(Se.define([{tag:g.keyword,color:dk},{tag:[g.name,g.deleted,g.character,g.propertyName,g.macroName],color:rk},{tag:[g.function(g.variableName),g.labelName],color:ck},{tag:[g.color,g.constant(g.name),g.standard(g.name)],color:uk},{tag:[g.definition(g.name),g.separator],color:ok},{tag:[g.typeName,g.className,g.number,g.changed,g.annotation,g.modifier,g.self,g.namespace],color:nk},{tag:[g.operator,g.operatorKeyword,g.url,g.escape,g.regexp,g.link,g.special(g.string)],color:ik},{tag:[g.meta,g.comment],color:sk},{tag:g.strong,fontWeight:`bold`},{tag:g.emphasis,fontStyle:`italic`},{tag:g.strikethrough,textDecoration:`line-through`},{tag:g.link,color:sk,textDecoration:`underline`},{tag:g.heading,fontWeight:`bold`,color:rk},{tag:[g.atom,g.bool,g.special(g.variableName)],color:uk},{tag:[g.processingInstruction,g.string,g.inserted],color:lk},{tag:g.invalid,color:ak}]))],yk=u.theme({"&":{backgroundColor:`#fff`}},{dark:!1}),bk=function(e){e===void 0&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:r=!1,theme:i=`light`,placeholder:a=``,basicSetup:o=!0}=e,s=[];switch(t&&s.unshift(M.of([AT])),o&&(typeof o==`boolean`?s.unshift(tk()):s.unshift(tk(o))),a&&s.unshift(xe(a)),i){case`light`:s.push(yk);break;case`dark`:s.push(vk);break;case`none`:break;default:s.push(i);break}return n===!1&&s.push(u.editable.of(!1)),r&&s.push(Ae.readOnly.of(!0)),[...s]},xk=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)}),Sk=class{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error(`TimeoutLatch callback error:`,e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}},Ck=class{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}},wk=null,Tk=()=>typeof window>`u`?new Ck:(wk||=new Ck,wk),Ek=pe.define(),Dk=200,Ok=[];function kk(e){var{value:t,selection:n,onChange:r,onStatistics:i,onCreateEditor:a,onUpdate:s,extensions:c=Ok,autoFocus:l,theme:d=`light`,height:f=null,minHeight:p=null,maxHeight:m=null,width:h=null,minWidth:g=null,maxWidth:_=null,placeholder:v=``,editable:y=!0,readOnly:b=!1,indentWithTab:x=!0,basicSetup:S=!0,root:C,initialState:w}=e,[T,E]=(0,F.useState)(),[D,O]=(0,F.useState)(),[k,ee]=(0,F.useState)(),te=(0,F.useState)(()=>({current:null}))[0],ne=(0,F.useState)(()=>({current:null}))[0],A=u.theme({"&":{height:f,minHeight:p,maxHeight:m,width:h,minWidth:g,maxWidth:_},"& .cm-scroller":{height:`100% !important`}}),j=[u.updateListener.of(e=>{e.docChanged&&typeof r==`function`&&!e.transactions.some(e=>e.annotation(Ek))&&(te.current?te.current.reset():(te.current=new Sk(()=>{if(ne.current){var e=ne.current;ne.current=null,e()}te.current=null},Dk),Tk().add(te.current)),r(e.state.doc.toString(),e)),i&&i(xk(e))}),A,...bk({theme:d,editable:y,readOnly:b,placeholder:v,indentWithTab:x,basicSetup:S})];return s&&typeof s==`function`&&j.push(u.updateListener.of(s)),j=j.concat(c),(0,F.useLayoutEffect)(()=>{if(T&&!k){var e={doc:t,selection:n,extensions:j},r=w?Ae.fromJSON(w.json,e,w.fields):Ae.create(e);if(ee(r),!D){var i=new u({state:r,parent:T,root:C});O(i),a&&a(i,r)}}return()=>{D&&(ee(void 0),O(void 0))}},[T,k]),(0,F.useEffect)(()=>{e.container&&E(e.container)},[e.container]),(0,F.useEffect)(()=>()=>{D&&(D.destroy(),O(void 0)),te.current&&=(te.current.cancel(),null)},[D]),(0,F.useEffect)(()=>{l&&D&&D.focus()},[l,D]),(0,F.useEffect)(()=>{D&&D.dispatch({effects:o.reconfigure.of(j)})},[d,c,f,p,m,h,g,_,v,y,b,x,S,r,s]),(0,F.useEffect)(()=>{if(t!==void 0){var e=D?D.state.doc.toString():``;if(D&&t!==e){var n=te.current&&!te.current.isDone,r=()=>{D&&t!==D.state.doc.toString()&&D.dispatch({changes:{from:0,to:D.state.doc.toString().length,insert:t||``},annotations:[Ek.of(!0)]})};n?ne.current=r:r()}}},[t,D]),{state:k,setState:ee,view:D,setView:O,container:T,setContainer:E}}var Ak=[`className`,`value`,`selection`,`extensions`,`onChange`,`onStatistics`,`onCreateEditor`,`onUpdate`,`autoFocus`,`theme`,`height`,`minHeight`,`maxHeight`,`width`,`minWidth`,`maxWidth`,`basicSetup`,`placeholder`,`indentWithTab`,`editable`,`readOnly`,`root`,`initialState`],jk=(0,F.forwardRef)((e,t)=>{var{className:n,value:r=``,selection:i,extensions:a=[],onChange:o,onStatistics:s,onCreateEditor:c,onUpdate:l,autoFocus:u,theme:d=`light`,height:f,minHeight:p,maxHeight:m,width:h,minWidth:g,maxWidth:_,basicSetup:v,placeholder:y,indentWithTab:b,editable:x,readOnly:S,root:C,initialState:w}=e,T=aC(e,Ak),E=(0,F.useRef)(null),{state:D,view:O,container:k,setContainer:ee}=kk({root:C,value:r,autoFocus:u,theme:d,height:f,minHeight:p,maxHeight:m,width:h,minWidth:g,maxWidth:_,basicSetup:v,placeholder:y,indentWithTab:b,editable:x,readOnly:S,selection:i,onChange:o,onStatistics:s,onCreateEditor:c,onUpdate:l,extensions:a,initialState:w});(0,F.useImperativeHandle)(t,()=>({editor:E.current,state:D,view:O}),[E,k,D,O]);var te=(0,F.useCallback)(e=>{E.current=e,ee(e)},[ee]);if(typeof r!=`string`)throw Error(`value must be typeof string but got `+typeof r);return(0,I.jsx)(`div`,iC({ref:te,className:(typeof d==`string`?`cm-theme-`+d:`cm-theme`)+(n?` `+n:``)},T))});jk.displayName=`CodeMirror`;var Mk=`modulepreload`,Nk=function(e){return`/`+e},Pk={},Q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Nk(t,n),t in Pk)return;Pk[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Mk,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function $(e){return new ge(te.define(e))}function Fk(e){return Q(()=>import(`./dist-DR5p3y2B.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([0,1,2]))}var Ik=[O.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return Q(()=>import(`./dist-DYBvJnrG.js`).then(e=>e.cpp()),__vite__mapDeps([3,1,2]))}}),O.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return Q(()=>import(`./dist-DYBvJnrG.js`).then(e=>e.cpp()),__vite__mapDeps([3,1,2]))}}),O.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return Fk(`Cassandra`)}}),O.of({name:`CSS`,extensions:[`css`],load(){return Q(()=>import(`./dist-xy6Nd-hn.js`).then(e=>e.i).then(e=>e.css()),__vite__mapDeps([4,1,2]))}}),O.of({name:`Go`,extensions:[`go`],load(){return Q(()=>import(`./dist-DGl_CjTP.js`).then(e=>e.go()),__vite__mapDeps([5,1,2]))}}),O.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return Q(()=>import(`./dist-wU4D680r.js`).then(e=>e.html()),__vite__mapDeps([6,4,1,2,7]))}}),O.of({name:`Java`,extensions:[`java`],load(){return Q(()=>import(`./dist-elfU6IUT.js`).then(e=>e.java()),__vite__mapDeps([8,1,2]))}}),O.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return Q(()=>import(`./dist-CRPXogT9.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([7,1,2]))}}),O.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return Q(()=>import(`./dist-CUPZ-IZ-.js`).then(e=>e.jinja()),__vite__mapDeps([9,4,1,2,6,7]))}}),O.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return Q(()=>import(`./dist-Cc03jTPl.js`).then(e=>e.json()),__vite__mapDeps([10,1,2]))}}),O.of({name:`JSX`,extensions:[`jsx`],load(){return Q(()=>import(`./dist-CRPXogT9.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([7,1,2]))}}),O.of({name:`LESS`,extensions:[`less`],load(){return Q(()=>import(`./dist-BhphvNZp.js`).then(e=>e.less()),__vite__mapDeps([11,4,1,2]))}}),O.of({name:`Liquid`,extensions:[`liquid`],load(){return Q(()=>import(`./dist-DwkZjLjZ.js`).then(e=>e.liquid()),__vite__mapDeps([12,4,1,2,6,7]))}}),O.of({name:`MariaDB SQL`,load(){return Fk(`MariaSQL`)}}),O.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return Q(()=>import(`./dist-CZX_BxNx.js`).then(e=>e.markdown()),__vite__mapDeps([13,4,1,2,6,7]))}}),O.of({name:`MS SQL`,load(){return Fk(`MSSQL`)}}),O.of({name:`MySQL`,load(){return Fk(`MySQL`)}}),O.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return Q(()=>import(`./dist-D5lJl_QN.js`).then(e=>e.php()),__vite__mapDeps([14,4,1,2,6,7]))}}),O.of({name:`PLSQL`,extensions:[`pls`],load(){return Fk(`PLSQL`)}}),O.of({name:`PostgreSQL`,load(){return Fk(`PostgreSQL`)}}),O.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return Q(()=>import(`./dist-KzqaUjZC.js`).then(e=>e.python()),__vite__mapDeps([15,1,2]))}}),O.of({name:`Rust`,extensions:[`rs`],load(){return Q(()=>import(`./dist-C6S96i9v.js`).then(e=>e.rust()),__vite__mapDeps([16,1,2]))}}),O.of({name:`Sass`,extensions:[`sass`],load(){return Q(()=>import(`./dist-D2GTvids.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([17,4,1,2]))}}),O.of({name:`SCSS`,extensions:[`scss`],load(){return Q(()=>import(`./dist-D2GTvids.js`).then(e=>e.sass()),__vite__mapDeps([17,4,1,2]))}}),O.of({name:`SQL`,extensions:[`sql`],load(){return Fk(`StandardSQL`)}}),O.of({name:`SQLite`,load(){return Fk(`SQLite`)}}),O.of({name:`TSX`,extensions:[`tsx`],load(){return Q(()=>import(`./dist-CRPXogT9.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([7,1,2]))}}),O.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return Q(()=>import(`./dist-CRPXogT9.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([7,1,2]))}}),O.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return Q(()=>import(`./dist-BSpuB3dZ.js`).then(e=>e.wast()),__vite__mapDeps([18,1,2]))}}),O.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return Q(()=>import(`./dist-DIQDx3Dq.js`).then(e=>e.xml()),__vite__mapDeps([19,1,2]))}}),O.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return Q(()=>import(`./dist-CftiQ_Tf.js`).then(e=>e.yaml()),__vite__mapDeps([20,1,2]))}}),O.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return Q(()=>import(`./apl-Dgw9L7wA.js`).then(e=>$(e.apl)),[])}}),O.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return Q(()=>import(`./asciiarmor-B3T-Ib7X.js`).then(e=>$(e.asciiArmor)),[])}}),O.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return Q(()=>import(`./asn1-C0KgO0Wt.js`).then(e=>$(e.asn1({}))),[])}}),O.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return Q(()=>import(`./asterisk-D7tOY-Ef.js`).then(e=>$(e.asterisk)),[])}}),O.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return Q(()=>import(`./brainfuck-Dr6WXxS2.js`).then(e=>$(e.brainfuck)),[])}}),O.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return Q(()=>import(`./cobol-ng5WMKOY.js`).then(e=>$(e.cobol)),[])}}),O.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return Q(()=>import(`./clike-DQfG49Bz.js`).then(e=>$(e.csharp)),[])}}),O.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return Q(()=>import(`./clojure-DsDsbt3V.js`).then(e=>$(e.clojure)),[])}}),O.of({name:`ClojureScript`,extensions:[`cljs`],load(){return Q(()=>import(`./clojure-DsDsbt3V.js`).then(e=>$(e.clojure)),[])}}),O.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return Q(()=>import(`./css-zrdFFahf.js`).then(e=>$(e.gss)),[])}}),O.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return Q(()=>import(`./cmake-CaoY67QC.js`).then(e=>$(e.cmake)),[])}}),O.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return Q(()=>import(`./coffeescript-L66efR1O.js`).then(e=>$(e.coffeeScript)),[])}}),O.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return Q(()=>import(`./commonlisp-rk__8_Ow.js`).then(e=>$(e.commonLisp)),[])}}),O.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return Q(()=>import(`./cypher-DTKBhe_T.js`).then(e=>$(e.cypher)),[])}}),O.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return Q(()=>import(`./python-_LoDBjEZ.js`).then(e=>$(e.cython)),[])}}),O.of({name:`Crystal`,extensions:[`cr`],load(){return Q(()=>import(`./crystal-C1BeQSjD.js`).then(e=>$(e.crystal)),[])}}),O.of({name:`D`,extensions:[`d`],load(){return Q(()=>import(`./d-CDf89RKe.js`).then(e=>$(e.d)),[])}}),O.of({name:`Dart`,extensions:[`dart`],load(){return Q(()=>import(`./clike-DQfG49Bz.js`).then(e=>$(e.dart)),[])}}),O.of({name:`diff`,extensions:[`diff`,`patch`],load(){return Q(()=>import(`./diff-BY4_GICG.js`).then(e=>$(e.diff)),[])}}),O.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return Q(()=>import(`./dockerfile-BBRxgo6-.js`).then(e=>$(e.dockerFile)),__vite__mapDeps([21,22]))}}),O.of({name:`DTD`,extensions:[`dtd`],load(){return Q(()=>import(`./dtd-BOpcurKR.js`).then(e=>$(e.dtd)),[])}}),O.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return Q(()=>import(`./dylan-DrmRAfMX.js`).then(e=>$(e.dylan)),[])}}),O.of({name:`EBNF`,load(){return Q(()=>import(`./ebnf-DgECi_W8.js`).then(e=>$(e.ebnf)),[])}}),O.of({name:`ECL`,extensions:[`ecl`],load(){return Q(()=>import(`./ecl-CWDhUBvl.js`).then(e=>$(e.ecl)),[])}}),O.of({name:`edn`,extensions:[`edn`],load(){return Q(()=>import(`./clojure-DsDsbt3V.js`).then(e=>$(e.clojure)),[])}}),O.of({name:`Eiffel`,extensions:[`e`],load(){return Q(()=>import(`./eiffel-DBpGy7gs.js`).then(e=>$(e.eiffel)),[])}}),O.of({name:`Elm`,extensions:[`elm`],load(){return Q(()=>import(`./elm-Dj_ZNWRH.js`).then(e=>$(e.elm)),[])}}),O.of({name:`Erlang`,extensions:[`erl`],load(){return Q(()=>import(`./erlang-Br4TQPB7.js`).then(e=>$(e.erlang)),[])}}),O.of({name:`Esper`,load(){return Q(()=>import(`./sql-C_mHN2XB.js`).then(e=>$(e.esper)),[])}}),O.of({name:`Factor`,extensions:[`factor`],load(){return Q(()=>import(`./factor-bi5FmZTz.js`).then(e=>$(e.factor)),__vite__mapDeps([23,22]))}}),O.of({name:`FCL`,load(){return Q(()=>import(`./fcl-Dh6ibuJG.js`).then(e=>$(e.fcl)),[])}}),O.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return Q(()=>import(`./forth-fmpuPpMA.js`).then(e=>$(e.forth)),[])}}),O.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return Q(()=>import(`./fortran-CZwiXuJZ.js`).then(e=>$(e.fortran)),[])}}),O.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return Q(()=>import(`./mllike-DsgO-njf.js`).then(e=>$(e.fSharp)),[])}}),O.of({name:`Gas`,extensions:[`s`],load(){return Q(()=>import(`./gas-DotCoURX.js`).then(e=>$(e.gas)),[])}}),O.of({name:`Gherkin`,extensions:[`feature`],load(){return Q(()=>import(`./gherkin-Bw4mmeRF.js`).then(e=>$(e.gherkin)),[])}}),O.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return Q(()=>import(`./groovy-D7xek06K.js`).then(e=>$(e.groovy)),[])}}),O.of({name:`Haskell`,extensions:[`hs`],load(){return Q(()=>import(`./haskell-D5bv2Ijt.js`).then(e=>$(e.haskell)),[])}}),O.of({name:`Haxe`,extensions:[`hx`],load(){return Q(()=>import(`./haxe-UA0z6FgT.js`).then(e=>$(e.haxe)),[])}}),O.of({name:`HXML`,extensions:[`hxml`],load(){return Q(()=>import(`./haxe-UA0z6FgT.js`).then(e=>$(e.hxml)),[])}}),O.of({name:`HTTP`,load(){return Q(()=>import(`./http-DAkDDIPY.js`).then(e=>$(e.http)),[])}}),O.of({name:`IDL`,extensions:[`pro`],load(){return Q(()=>import(`./idl-DYj57TA2.js`).then(e=>$(e.idl)),[])}}),O.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return Q(()=>import(`./javascript-B9Zm1tmO.js`).then(e=>$(e.jsonld)),[])}}),O.of({name:`Julia`,extensions:[`jl`],load(){return Q(()=>import(`./julia-CpHdnx_N.js`).then(e=>$(e.julia)),[])}}),O.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return Q(()=>import(`./clike-DQfG49Bz.js`).then(e=>$(e.kotlin)),[])}}),O.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return Q(()=>import(`./livescript-DcEJKRZ4.js`).then(e=>$(e.liveScript)),[])}}),O.of({name:`Lua`,extensions:[`lua`],load(){return Q(()=>import(`./lua-s-LPZohT.js`).then(e=>$(e.lua)),[])}}),O.of({name:`mIRC`,extensions:[`mrc`],load(){return Q(()=>import(`./mirc-pTdL1Ym3.js`).then(e=>$(e.mirc)),[])}}),O.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return Q(()=>import(`./mathematica-c8TKcpav.js`).then(e=>$(e.mathematica)),[])}}),O.of({name:`Modelica`,extensions:[`mo`],load(){return Q(()=>import(`./modelica-PhVkZonB.js`).then(e=>$(e.modelica)),[])}}),O.of({name:`MUMPS`,extensions:[`mps`],load(){return Q(()=>import(`./mumps-DhD4kjw9.js`).then(e=>$(e.mumps)),[])}}),O.of({name:`Mbox`,extensions:[`mbox`],load(){return Q(()=>import(`./mbox-CUr7-CiI.js`).then(e=>$(e.mbox)),[])}}),O.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return Q(()=>import(`./nginx-CJc6p_yt.js`).then(e=>$(e.nginx)),[])}}),O.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return Q(()=>import(`./nsis-BHchP6IS.js`).then(e=>$(e.nsis)),__vite__mapDeps([24,22]))}}),O.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return Q(()=>import(`./ntriples-D1v3iWDa.js`).then(e=>$(e.ntriples)),[])}}),O.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return Q(()=>import(`./clike-DQfG49Bz.js`).then(e=>$(e.objectiveC)),[])}}),O.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return Q(()=>import(`./clike-DQfG49Bz.js`).then(e=>$(e.objectiveCpp)),[])}}),O.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return Q(()=>import(`./mllike-DsgO-njf.js`).then(e=>$(e.oCaml)),[])}}),O.of({name:`Octave`,extensions:[`m`],load(){return Q(()=>import(`./octave-D_WvWxqk.js`).then(e=>$(e.octave)),[])}}),O.of({name:`Oz`,extensions:[`oz`],load(){return Q(()=>import(`./oz-CmdX4m3g.js`).then(e=>$(e.oz)),[])}}),O.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return Q(()=>import(`./pascal-hNOkBp6J.js`).then(e=>$(e.pascal)),[])}}),O.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return Q(()=>import(`./perl-NQdG1b_r.js`).then(e=>$(e.perl)),[])}}),O.of({name:`Pig`,extensions:[`pig`],load(){return Q(()=>import(`./pig-CXzedlZV.js`).then(e=>$(e.pig)),[])}}),O.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return Q(()=>import(`./powershell-RXDVpFWf.js`).then(e=>$(e.powerShell)),[])}}),O.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return Q(()=>import(`./properties-BTvtucqR.js`).then(e=>$(e.properties)),[])}}),O.of({name:`ProtoBuf`,extensions:[`proto`],load(){return Q(()=>import(`./protobuf-zHRYyuba.js`).then(e=>$(e.protobuf)),[])}}),O.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return Q(()=>import(`./pug-C39WZDG2.js`).then(e=>$(e.pug)),__vite__mapDeps([25,26]))}}),O.of({name:`Puppet`,extensions:[`pp`],load(){return Q(()=>import(`./puppet-CMNLsBcD.js`).then(e=>$(e.puppet)),[])}}),O.of({name:`Q`,extensions:[`q`],load(){return Q(()=>import(`./q-SLmsw_60.js`).then(e=>$(e.q)),[])}}),O.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return Q(()=>import(`./r-CocOMjw8.js`).then(e=>$(e.r)),[])}}),O.of({name:`RPM Changes`,load(){return Q(()=>import(`./rpm-WgkTpiCm.js`).then(e=>$(e.rpmChanges)),[])}}),O.of({name:`RPM Spec`,extensions:[`spec`],load(){return Q(()=>import(`./rpm-WgkTpiCm.js`).then(e=>$(e.rpmSpec)),[])}}),O.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return Q(()=>import(`./ruby-DquNeiGE.js`).then(e=>$(e.ruby)),[])}}),O.of({name:`SAS`,extensions:[`sas`],load(){return Q(()=>import(`./sas-sJxciv6G.js`).then(e=>$(e.sas)),[])}}),O.of({name:`Scala`,extensions:[`scala`],load(){return Q(()=>import(`./clike-DQfG49Bz.js`).then(e=>$(e.scala)),[])}}),O.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return Q(()=>import(`./scheme-DEjJDX5Z.js`).then(e=>$(e.scheme)),[])}}),O.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return Q(()=>import(`./shell-DhAwSAum.js`).then(e=>$(e.shell)),[])}}),O.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return Q(()=>import(`./sieve-CcW8-k2R.js`).then(e=>$(e.sieve)),[])}}),O.of({name:`Smalltalk`,extensions:[`st`],load(){return Q(()=>import(`./smalltalk-nXkQ5zwM.js`).then(e=>$(e.smalltalk)),[])}}),O.of({name:`Solr`,load(){return Q(()=>import(`./solr-DO54nYOg.js`).then(e=>$(e.solr)),[])}}),O.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return Q(()=>import(`./mllike-DsgO-njf.js`).then(e=>$(e.sml)),[])}}),O.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return Q(()=>import(`./sparql-CxAS_pwk.js`).then(e=>$(e.sparql)),[])}}),O.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return Q(()=>import(`./spreadsheet-DWzAMKF2.js`).then(e=>$(e.spreadsheet)),[])}}),O.of({name:`Squirrel`,extensions:[`nut`],load(){return Q(()=>import(`./clike-DQfG49Bz.js`).then(e=>$(e.squirrel)),[])}}),O.of({name:`Stylus`,extensions:[`styl`],load(){return Q(()=>import(`./stylus-CQ8h_EBd.js`).then(e=>$(e.stylus)),[])}}),O.of({name:`Swift`,extensions:[`swift`],load(){return Q(()=>import(`./swift-D0Eq5raO.js`).then(e=>$(e.swift)),[])}}),O.of({name:`sTeX`,load(){return Q(()=>import(`./stex-BmuQ0Xsx.js`).then(e=>$(e.stex)),[])}}),O.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return Q(()=>import(`./stex-BmuQ0Xsx.js`).then(e=>$(e.stex)),[])}}),O.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return Q(()=>import(`./verilog-B0DGHLZN.js`).then(e=>$(e.verilog)),[])}}),O.of({name:`Tcl`,extensions:[`tcl`],load(){return Q(()=>import(`./tcl-D7utka2n.js`).then(e=>$(e.tcl)),[])}}),O.of({name:`Textile`,extensions:[`textile`],load(){return Q(()=>import(`./textile-XEeoev-k.js`).then(e=>$(e.textile)),[])}}),O.of({name:`TiddlyWiki`,load(){return Q(()=>import(`./tiddlywiki-CecErCuV.js`).then(e=>$(e.tiddlyWiki)),[])}}),O.of({name:`Tiki wiki`,load(){return Q(()=>import(`./tiki-BlL-kki4.js`).then(e=>$(e.tiki)),[])}}),O.of({name:`TOML`,extensions:[`toml`],load(){return Q(()=>import(`./toml-mmtg9INI.js`).then(e=>$(e.toml)),[])}}),O.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return Q(()=>import(`./troff-Crc1ZuaH.js`).then(e=>$(e.troff)),[])}}),O.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return Q(()=>import(`./ttcn-Cri02b1f.js`).then(e=>$(e.ttcn)),[])}}),O.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return Q(()=>import(`./ttcn-cfg--4YiJN4x.js`).then(e=>$(e.ttcnCfg)),[])}}),O.of({name:`Turtle`,extensions:[`ttl`],load(){return Q(()=>import(`./turtle-CUuoUr2N.js`).then(e=>$(e.turtle)),[])}}),O.of({name:`Web IDL`,extensions:[`webidl`],load(){return Q(()=>import(`./webidl-C_bKeJT2.js`).then(e=>$(e.webIDL)),[])}}),O.of({name:`VB.NET`,extensions:[`vb`],load(){return Q(()=>import(`./vb-BrHulZxe.js`).then(e=>$(e.vb)),[])}}),O.of({name:`VBScript`,extensions:[`vbs`],load(){return Q(()=>import(`./vbscript-vyHcteNE.js`).then(e=>$(e.vbScript)),[])}}),O.of({name:`Velocity`,extensions:[`vtl`],load(){return Q(()=>import(`./velocity-DN4o8rq-.js`).then(e=>$(e.velocity)),[])}}),O.of({name:`Verilog`,extensions:[`v`],load(){return Q(()=>import(`./verilog-B0DGHLZN.js`).then(e=>$(e.verilog)),[])}}),O.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return Q(()=>import(`./vhdl-WeAF-qEm.js`).then(e=>$(e.vhdl)),[])}}),O.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return Q(()=>import(`./xquery-CLyH3kVm.js`).then(e=>$(e.xQuery)),[])}}),O.of({name:`Yacas`,extensions:[`ys`],load(){return Q(()=>import(`./yacas-Dq3LuV9B.js`).then(e=>$(e.yacas)),[])}}),O.of({name:`Z80`,extensions:[`z80`],load(){return Q(()=>import(`./z80-Br7weo_y.js`).then(e=>$(e.z80)),[])}}),O.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return Q(()=>import(`./mscgen-ByD0zE8S.js`).then(e=>$(e.mscgen)),[])}}),O.of({name:`Xù`,extensions:[`xu`],load(){return Q(()=>import(`./mscgen-ByD0zE8S.js`).then(e=>$(e.xu)),[])}}),O.of({name:`MsGenny`,extensions:[`msgenny`],load(){return Q(()=>import(`./mscgen-ByD0zE8S.js`).then(e=>$(e.msgenny)),[])}}),O.of({name:`Vue`,extensions:[`vue`],load(){return Q(()=>import(`./dist-CsLgvisI.js`).then(e=>e.vue()),__vite__mapDeps([27,4,1,2,6,7]))}}),O.of({name:`Angular Template`,load(){return Q(()=>import(`./dist-BUbVsQdM.js`).then(e=>e.angular()),__vite__mapDeps([28,4,1,2,6,7]))}})];function Lk(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o;n.key&&n.debug?.call(n)&&(o=Date.now());let s=e();if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug?.call(n)&&(c=Date.now()),i=t(...s),n.key&&n.debug?.call(n)){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
|
|
210
210
|
font-size: .6rem;
|
|
211
211
|
font-weight: bold;
|
|
212
|
-
color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i}return o.updateDeps=e=>{r=e},o}function Rk(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var zk=(e,t)=>Math.abs(e-t)<1.01,Bk=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Vk=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Hk=e=>e,Uk=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},Wk=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Vk(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(Vk(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},Gk={passive:!0},Kk=typeof window>`u`?!0:`onscrollend`in window,qk=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=0,a=e.options.useScrollendEvent&&Kk?()=>void 0:Bk(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),o=r=>()=>{let{horizontal:o,isRtl:s}=e.options;i=o?n.scrollLeft*(s&&-1||1):n.scrollTop,a(),t(i,r)},s=o(!0),c=o(!1);n.addEventListener(`scroll`,s,Gk);let l=e.options.useScrollendEvent&&Kk;return l&&n.addEventListener(`scrollend`,c,Gk),()=>{n.removeEventListener(`scroll`,s),l&&n.removeEventListener(`scrollend`,c)}},Jk=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Yk=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;let o=e+t;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:o,behavior:n})},Xk=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{n===void 0&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Hk,rangeExtractor:Uk,onChange:()=>{},measureElement:Jk,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=Lk(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=Lk(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,n,r,i,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a}),{key:!1}),this.getMeasurements=Lk(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a},o)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let s=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let c=this.measurementsCache.slice(0,s),l=Array(a).fill(void 0);for(let e=0;e<s;e++){let t=c[e];t&&(l[t.lane]=e)}for(let i=s;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,u;if(a!==void 0&&this.options.lanes>1){s=a;let e=l[s],r=e===void 0?void 0:c[e];u=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?c[i-1]:this.getFurthestMeasurement(c,i);u=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(i,s)}let d=o.get(e),f=typeof d==`number`?d:this.options.estimateSize(i),p=u+f;c[i]={index:i,start:u,size:f,end:p,key:e,lane:s},l[s]=i}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Lk(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?Qk({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Lk(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{let n=this.measurementsCache[e];if(!n)return;let r=t-(this.itemSizeCache.get(n.key)??n.size);r!==0&&(this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?n.start<this.getScrollOffset()+this.scrollAdjustments:this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this))&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.getVirtualItems=Lk(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length!==0)return Rk(t[Zk(0,t.length-1,e=>Rk(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t);this.scrollState={index:null,align:t,behavior:n,startedAt:this.now(),lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e;this.scrollState={index:null,align:`start`,behavior:t,startedAt:this.now(),lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=e[e.length-1]?.end??0;else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&zk(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.scrollState=null;return}}else this.scrollState.stableFrames=0,n&&(this.scrollState.lastTargetOffset=t,this.scrollState.behavior=`auto`,this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}));this.scheduleScrollReconcile()}},Zk=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function Qk({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){let i=e.length-1,a=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:i};let o=Zk(0,i,a,n),s=o;if(r===1)for(;s<i&&e[s].end<n+t;)s++;else if(r>1){let a=Array(r).fill(0);for(;s<i&&a.some(e=>e<n+t);){let t=e[s];a[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(i,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var $k=typeof document<`u`?F.useLayoutEffect:F.useEffect;function eA({useFlushSync:e=!0,...t}){let n=F.useReducer(()=>({}),{})[1],r={...t,onChange:(r,i)=>{var a;e&&i?(0,Fa.flushSync)(n):n(),(a=t.onChange)==null||a.call(t,r,i)}},[i]=F.useState(()=>new Xk(r));return i.setOptions(r),$k(()=>i._didMount(),[]),$k(()=>i._willUpdate()),i}function tA(e){return eA({observeElementRect:Wk,observeElementOffset:qk,scrollToFn:Yk,...e})}var nA=u.theme({"&":{height:`100%`,color:`var(--file-editor-ink)`,backgroundColor:`var(--file-editor-surface)`},"&.cm-focused":{outline:`none`},".cm-scroller":{overflow:`auto`,fontFamily:`var(--mono)`,lineHeight:`1.72`},".cm-content":{minHeight:`100%`,padding:`14px 0 24px`,caretColor:`var(--file-editor-caret)`},".cm-line":{padding:`0 20px 0 16px`},".cm-gutters":{backgroundColor:`var(--file-editor-gutter)`,color:`var(--file-editor-muted)`,borderRight:`1px solid var(--file-editor-rule)`},".cm-lineNumbers .cm-gutterElement":{padding:`0 12px 0 16px`,minWidth:`42px`},".cm-activeLine":{backgroundColor:`var(--file-editor-active)`},".cm-activeLineGutter":{color:`var(--file-editor-ink)`,backgroundColor:`transparent`},".cm-selectionBackground, &.cm-focused .cm-selectionBackground, .cm-content ::selection":{backgroundColor:`var(--file-editor-selection)`},".cm-cursor, .cm-dropCursor":{borderLeftColor:`var(--file-editor-caret)`},".cm-searchMatch":{backgroundColor:`rgb(255 214 102 / 16%)`,outline:`1px solid rgb(255 214 102 / 18%)`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`rgb(255 214 102 / 26%)`},".cm-tooltip":{border:`1px solid var(--file-editor-rule)`,borderRadius:`10px`,backgroundColor:`rgb(11 15 27 / 98%)`,boxShadow:`0 20px 48px rgb(0 0 0 / 38%)`},".cm-panels":{backgroundColor:`rgb(11 15 27 / 96%)`,borderBottom:`1px solid var(--file-editor-rule)`}},{dark:!0}),rA=Se.define([{tag:g.keyword,color:`#c792ea`},{tag:[g.name,g.deleted,g.character,g.propertyName,g.macroName],color:`#82aaff`},{tag:[g.function(g.variableName),g.labelName],color:`#82aaff`},{tag:[g.color,g.constant(g.name),g.standard(g.name)],color:`#f78c6c`},{tag:[g.definition(g.name),g.separator],color:`#eeffff`},{tag:[g.className,g.typeName],color:`#ffcb6b`},{tag:[g.number,g.changed,g.annotation,g.modifier,g.self,g.namespace],color:`#f78c6c`},{tag:[g.operator,g.operatorKeyword],color:`#89ddff`},{tag:[g.url,g.escape,g.regexp,g.link],color:`#80cbc4`},{tag:[g.meta,g.comment],color:`#637777`,fontStyle:`italic`},{tag:[g.string,g.inserted],color:`#c3e88d`},{tag:[g.invalid],color:`#ff5370`},{tag:[g.bool,g.null],color:`#f78c6c`},{tag:g.heading,color:`#82aaff`,fontWeight:`700`},{tag:g.emphasis,fontStyle:`italic`},{tag:g.strong,fontWeight:`700`},{tag:g.strikethrough,textDecoration:`line-through`}]),iA=(0,F.memo)(function({breadcrumbs:e,currentPath:t,directoryEntries:n,editorPath:r,loading:i,mentionedPaths:a,modifiedByPath:o,onNavigate:s,onOpenEntry:c,parentPath:l,rootPath:u}){let d=(0,F.useRef)(null),f=tA({count:n.length,getScrollElement:()=>d.current,estimateSize:()=>38,overscan:10});return(0,F.useEffect)(()=>{let e=d.current;e&&(e.scrollTop=0)},[t]),(0,I.jsxs)(`div`,{className:`file-explorer-panel`,children:[(0,I.jsxs)(`div`,{className:`panel-head-row`,children:[l?(0,I.jsx)(`button`,{className:`mini-action`,type:`button`,onClick:()=>s(l),children:`← Back`}):null,(0,I.jsxs)(`div`,{className:`panel-hint`,children:[`📁 `,t,` · `,o.size,` modified`]})]}),(0,I.jsx)(`div`,{className:`file-breadcrumbs`,children:e.map(e=>(0,I.jsx)(`button`,{className:H(`file-crumb`,e.path===t&&`active`),type:`button`,onClick:()=>s(e.path),children:e.label},e.path))}),i?(0,I.jsx)(`div`,{className:`empty-panel`,children:`Loading files for this directory…`}):null,!i&&n.length===0?(0,I.jsx)(`div`,{className:`empty-panel`,children:`No direct files or folders found in this directory.`}):null,!i&&n.length>0?(0,I.jsx)(`div`,{className:`file-explorer-scroll`,ref:d,children:(0,I.jsx)(`div`,{className:`file-explorer-list`,role:`presentation`,style:{height:`${f.getTotalSize()}px`},children:f.getVirtualItems().map(e=>{let t=n[e.index];if(!t)return null;let i=t.path.startsWith(`${u}/`)?t.path.slice(u.length+1):t.name,s=o.get(t.name)??o.get(i),l=a.has(t.path);return(0,I.jsxs)(`button`,{className:H(`fi file-explorer-row`,t.kind===`directory`&&`dir`,s===`mod`&&`active`,l&&`mentioned`,r===t.path&&`open`),type:`button`,onClick:()=>void c(t),style:{transform:`translateY(${e.start}px)`},children:[(0,I.jsx)(`span`,{children:t.kind===`directory`?`📁`:`📄`}),(0,I.jsx)(`span`,{className:`fi-n`,children:t.name}),l?(0,I.jsx)(`span`,{className:`fbdg mention`,children:`@`}):null,s?(0,I.jsx)(`span`,{className:H(`fbdg`,s),children:s}):null]},t.id)})})}):null,(0,I.jsxs)(`div`,{className:`panel-meta`,children:[(0,I.jsx)(`div`,{children:`Tap a file to open the full editor. Tap folders to drill in.`}),(0,I.jsxs)(`div`,{children:[`Use `,(0,I.jsx)(`code`,{children:`/mention filename`}),` or type `,(0,I.jsx)(`code`,{children:`@filename`}),` in the composer.`]})]})]})});function aA({activePath:e,breadcrumbs:t,busy:n,entries:r,loading:i,onClose:a,onNavigate:o,onPick:s,parentPath:c}){return(0,I.jsx)(`div`,{className:`project-picker-overlay`,onClick:e=>{e.target===e.currentTarget&&a()},children:(0,I.jsxs)(`div`,{className:`project-picker-modal`,children:[(0,I.jsxs)(`div`,{className:`project-picker-head`,children:[(0,I.jsxs)(`div`,{className:`project-picker-copy`,children:[(0,I.jsx)(`div`,{className:`project-picker-title`,children:`Start New Session`}),(0,I.jsx)(`div`,{className:`project-picker-subtitle`,children:`Pick the project folder to use as this session's working directory.`})]}),(0,I.jsx)(`button`,{"aria-label":`Close project picker`,className:`project-picker-close`,disabled:n,onClick:a,type:`button`,children:`×`})]}),(0,I.jsx)(`div`,{className:`project-picker-breadcrumbs`,children:t.map(t=>(0,I.jsx)(`button`,{className:H(`project-picker-crumb`,t.path===e&&`active`),disabled:n,onClick:()=>o(t.path),type:`button`,children:t.label},t.path))}),(0,I.jsxs)(`div`,{className:`project-picker-toolbar`,children:[c?(0,I.jsx)(`button`,{className:`project-picker-action`,disabled:n,onClick:()=>o(c),type:`button`,children:`← Up`}):(0,I.jsx)(`span`,{className:`project-picker-root`,children:`Root`}),(0,I.jsx)(`button`,{className:`project-picker-start`,disabled:n||i,onClick:()=>s(e),type:`button`,children:n?`Starting…`:`Use This Folder`})]}),(0,I.jsx)(`div`,{className:`project-picker-current`,children:e}),(0,I.jsx)(`div`,{className:`project-picker-list`,children:i?(0,I.jsx)(`div`,{className:`project-picker-empty`,children:`Loading folders…`}):r.length===0?(0,I.jsx)(`div`,{className:`project-picker-empty`,children:`No folders found here.`}):r.map(e=>(0,I.jsxs)(`button`,{className:`project-picker-entry`,disabled:n,onClick:()=>o(e.path),type:`button`,children:[(0,I.jsx)(`span`,{className:`project-picker-entry-icon`,children:`📁`}),(0,I.jsxs)(`span`,{className:`project-picker-entry-copy`,children:[(0,I.jsx)(`span`,{className:`project-picker-entry-name`,children:e.name}),(0,I.jsx)(`span`,{className:`project-picker-entry-path`,children:e.path})]}),(0,I.jsx)(`span`,{className:`project-picker-entry-arrow`,children:`→`})]},e.id))})]})})}function oA({messages:e,onSteer:t,onDelete:n}){return e.length===0?null:(0,I.jsx)(`div`,{className:`queued-messages`,children:(0,I.jsx)(`div`,{className:`queued-messages-inner`,children:e.map(e=>{let r=e.prompt.trim()||[e.images.length>0?`${e.images.length} image`:``,e.files.length>0?`${e.files.length} upload`:``,e.mentions.length>0?`${e.mentions.length} file`:``,e.skills.length>0?`${e.skills.length} skill`:``].filter(Boolean).join(` · `);return(0,I.jsxs)(`div`,{className:`queued-row`,children:[(0,I.jsx)(`span`,{className:`queued-row-icon`,children:`💬`}),(0,I.jsx)(`span`,{className:`queued-row-text`,children:Hd(r||`Queued follow-up`,96)}),(0,I.jsxs)(`div`,{className:`queued-row-actions`,children:[(0,I.jsx)(`button`,{className:`queued-row-steer`,type:`button`,onClick:()=>t(e.id),children:`Steer`}),(0,I.jsx)(`button`,{"aria-label":`Delete queued message`,className:`queued-row-delete`,type:`button`,onClick:()=>n(e.id),children:`×`})]})]},e.id)})})})}var sA=(0,F.memo)(function({value:e,mentions:t,placeholder:n,textareaRef:r,composerMirrorRef:i,onPaste:a,onValueChange:o,onKeyDown:s}){let[c,l]=(0,F.useState)(e),u=(0,F.useMemo)(()=>t.filter(e=>$d(c,e)),[c,t]),d=(0,F.useMemo)(()=>u.length>0?tf(c,u):[],[u,c]),f=(0,F.useCallback)(()=>{if(u.length===0)return;let e=r.current,t=i.current;!e||!t||(t.scrollTop=e.scrollTop,t.scrollLeft=e.scrollLeft)},[u.length,i,r]);(0,F.useEffect)(()=>{let e=r.current;e&&(e.style.height=`auto`,e.style.height=`${Math.max(60,Math.min(e.scrollHeight,140))}px`,f())},[60,c,f,r]);let p=(0,F.useCallback)(e=>{let t=e.target.value;l(t),o(t)},[o]);return(0,I.jsxs)(`div`,{className:`composer-text-shell`,children:[u.length>0?(0,I.jsx)(`div`,{className:`composer-mirror`,ref:i,"aria-hidden":`true`,children:c?d.map((e,t)=>(0,I.jsx)(`span`,{className:H(`composer-segment`,e.mention&&`file`),children:e.text},`${e.text}-${t}`)):null}):null,c?null:(0,I.jsx)(`span`,{className:`composer-placeholder`,children:n}),(0,I.jsx)(`textarea`,{id:`ta`,ref:r,rows:3,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,placeholder:``,spellCheck:!1,value:c,onChange:p,onKeyDown:s,onPaste:a,onScroll:f})]})});function cA({entry:e}){let t=Sf(e.diff);return t.length===0?(0,I.jsx)(`div`,{className:`diff-patch-empty`,children:`Waiting for diff…`}):(0,I.jsx)(`div`,{className:`diff-patch-viewer`,children:t.map(e=>(0,I.jsxs)(`div`,{className:H(`diff-patch-row`,e.kind),children:[(0,I.jsx)(`span`,{className:`diff-patch-num`,children:e.oldLine??``}),(0,I.jsx)(`span`,{className:`diff-patch-num`,children:e.newLine??``}),(0,I.jsx)(`pre`,{className:`diff-patch-text`,children:e.text||` `})]},e.id))})}function lA({backLabel:e=`Back to Chat`,diffEntries:t,findings:n,onBack:r,onSelectEntry:i,selectedEntryId:a}){let o=(0,F.useMemo)(()=>t.find(e=>e.id===a)??t[0]??null,[t,a]),s=(0,F.useMemo)(()=>t.reduce((e,t)=>e+t.additions,0),[t]),c=(0,F.useMemo)(()=>t.reduce((e,t)=>e+t.removals,0),[t]);return(0,I.jsx)(`div`,{id:`review-page`,children:(0,I.jsxs)(`div`,{className:`diff-review-shell page`,children:[(0,I.jsxs)(`div`,{className:`diff-review-page-head`,children:[(0,I.jsxs)(`button`,{className:`file-editor-back`,onClick:r,type:`button`,children:[`← `,e]}),(0,I.jsxs)(`div`,{className:`diff-review-page-copy`,children:[(0,I.jsx)(`div`,{className:`diff-review-page-title`,children:`Patch review`}),(0,I.jsxs)(`div`,{className:`diff-review-page-subtitle`,children:[t.length,` changed file`,t.length===1?``:`s`,` · +`,s,` / -`,c]})]})]}),t.length===0?(0,I.jsx)(`div`,{className:`empty-panel`,children:`No diff items in this thread yet.`}):(0,I.jsxs)(`div`,{className:`diff-review-layout page`,children:[(0,I.jsx)(`div`,{className:`diff-review-sidebar`,children:t.map(e=>(0,I.jsxs)(`button`,{className:H(`diff-review-entry`,o?.id===e.id&&`active`),type:`button`,onClick:()=>i(e.id),children:[(0,I.jsxs)(`div`,{className:`diff-review-entry-top`,children:[(0,I.jsx)(`span`,{className:H(`diff-kind-pill`,e.kind.type===`add`&&`new`,e.kind.type===`delete`&&`del`),children:bf(e.kind)}),(0,I.jsx)(`span`,{className:H(`diff-status`,e.status===`inProgress`&&`live`,e.status===`failed`&&`err`),children:e.status===`inProgress`?`editing`:e.status})]}),(0,I.jsx)(`div`,{className:`diff-review-entry-path`,children:e.path}),(0,I.jsxs)(`div`,{className:`diff-review-entry-meta`,children:[(0,I.jsxs)(`span`,{children:[`+`,e.additions]}),(0,I.jsxs)(`span`,{children:[`-`,e.removals]}),(0,I.jsxs)(`span`,{children:[e.hunks,` hunk`,e.hunks===1?``:`s`]})]})]},e.id))}),o?(0,I.jsxs)(`div`,{className:`diff-review-main`,children:[(0,I.jsxs)(`div`,{className:`diff-focus-head`,children:[(0,I.jsx)(`div`,{className:`diff-focus-title`,children:o.path}),(0,I.jsxs)(`div`,{className:`diff-focus-meta`,children:[(0,I.jsx)(`span`,{className:H(`diff-kind-pill`,o.kind.type===`add`&&`new`,o.kind.type===`delete`&&`del`),children:bf(o.kind)}),(0,I.jsx)(`span`,{className:H(`diff-status`,o.status===`inProgress`&&`live`,o.status===`failed`&&`err`),children:o.status===`inProgress`?`editing`:o.status}),(0,I.jsxs)(`span`,{className:`diff-stat-chip`,children:[`+`,o.additions]}),(0,I.jsxs)(`span`,{className:`diff-stat-chip`,children:[`-`,o.removals]}),(0,I.jsxs)(`span`,{className:`diff-stat-chip`,children:[o.hunks,` hunk`,o.hunks===1?``:`s`]})]})]}),(0,I.jsx)(cA,{entry:o})]}):null]}),n.length>0?(0,I.jsx)(`div`,{className:`review-list`,children:n.map(e=>(0,I.jsxs)(`div`,{className:H(`review-item`,e.severity),children:[(0,I.jsxs)(`div`,{className:`review-header`,children:[(0,I.jsx)(`span`,{children:e.severity}),(0,I.jsx)(`span`,{children:e.file.split(`/`).slice(-2).join(`/`)}),(0,I.jsxs)(`span`,{children:[`:`,e.line]})]}),(0,I.jsx)(`div`,{className:`review-title`,children:e.title}),(0,I.jsx)(`div`,{className:`review-summary`,children:e.summary})]},e.id))}):null]})})}function uA({preview:e,variant:n=`panel`,onBack:r,backLabel:i=`Back`,onSave:a,onDirtyChange:o,providerId:s}){let c=hs(e.path,s),l=(0,F.useRef)(null),[d,f]=(0,F.useState)(e.content),[p,m]=(0,F.useState)(e.content),[h,g]=(0,F.useState)(null),[_,v]=(0,F.useState)(!1),[y,b]=(0,F.useState)(`Plain text`),[x,S]=(0,F.useState)(null),C=d!==p;(0,F.useEffect)(()=>{o?.(C)},[C,o]),(0,F.useEffect)(()=>{f(e.content),m(e.content),g(null),v(!1)},[e.content,e.error,e.loading,e.path]),(0,F.useEffect)(()=>{let t=e.path||e.name,n=O.matchFilename(Ik,t),r=!1;if(S(null),b(n?.name??`Plain text`),n)return n.load().then(e=>{r||S(e.extension)}).catch(()=>{r||S(null)}),()=>{r=!0}},[e.name,e.path]);let w=(0,F.useCallback)(async()=>{if(!(!a||e.loading||e.error||_||!C)){v(!0),g(null);try{await a(e.path,d),m(d)}catch(e){g(e instanceof Error?e.message:`Unable to save this file.`)}finally{v(!1)}}},[d,C,_,a,e.error,e.loading,e.path]),T=(0,F.useMemo)(()=>{let e=[nA,t(rA),M.of([{key:`Mod-s`,preventDefault:!0,run:()=>(w(),!0)}])];return x&&e.push(x),e},[x,w]);(0,F.useEffect)(()=>{let t=l.current;if(!(!t||e.loading||e.error)){if(typeof e.line==`number`&&e.line>0){let n=t.state.doc.line(Math.min(e.line,t.state.doc.lines));t.dispatch({selection:{anchor:n.from},effects:u.scrollIntoView(n.from,{y:`center`})});return}t.scrollDOM.scrollTo({left:0,top:0})}},[e.error,e.line,e.loading,e.path]);let E=(0,F.useCallback)(()=>{r&&(C&&typeof window<`u`&&!window.confirm(`Discard unsaved changes to ${e.name}?`)||r())},[C,r,e.name]),D=_?`Saving…`:C?`Save`:`Saved`,k=h?`Save failed`:_?`Saving`:C?`Unsaved`:`Saved`;return(0,I.jsxs)(`div`,{className:H(`file-editor`,n===`page`&&`page`),children:[(0,I.jsxs)(`div`,{className:`file-editor-head`,children:[n===`page`?(0,I.jsxs)(`button`,{className:`file-editor-back`,onClick:E,type:`button`,children:[`← `,i]}):null,(0,I.jsxs)(`div`,{className:`file-editor-copy`,children:[(0,I.jsx)(`div`,{className:`file-editor-title`,children:e.name}),(0,I.jsx)(`div`,{className:`file-editor-path`,children:e.path})]}),(0,I.jsxs)(`div`,{className:`file-editor-actions`,children:[(0,I.jsxs)(`div`,{className:`file-editor-meta`,children:[(0,I.jsx)(`span`,{className:`file-editor-chip`,children:y}),typeof e.line==`number`&&e.line>0?(0,I.jsxs)(`span`,{className:`file-editor-chip`,children:[`Line `,e.line]}):null,(0,I.jsx)(`span`,{className:H(`file-editor-status`,C&&`dirty`,h&&`error`),children:k})]}),c===`#`?null:(0,I.jsx)(`a`,{className:`file-editor-link`,href:c,rel:`noreferrer noopener`,target:`_blank`,children:`Raw`}),(0,I.jsx)(`button`,{className:`file-editor-save`,disabled:!a||e.loading||!!e.error||_||!C,onClick:()=>void w(),type:`button`,children:D})]})]}),(0,I.jsxs)(`div`,{className:`file-editor-body`,children:[e.loading?(0,I.jsx)(`div`,{className:`file-editor-empty`,children:`Opening file…`}):null,!e.loading&&e.error?(0,I.jsx)(`div`,{className:`file-editor-empty`,children:e.error}):null,!e.loading&&!e.error?(0,I.jsx)(jk,{className:`file-editor-surface`,editable:!!a,extensions:T,height:`100%`,onChange:e=>{f(e),h&&g(null)},onCreateEditor:e=>{l.current=e},value:d}):null]})]})}var dA=`materializedThreadId`,fA=e=>{if(!e||typeof e!=`object`)return null;let t=e[dA];return typeof t==`string`?t:null},pA=(e,t)=>Object.fromEntries((e.questions??[]).map(e=>[e.id,[(t[e.id]??``).trim()].filter(Boolean)])),mA=(0,F.createContext)(null),hA=Sc(),gA=hA.mentionCatalog,_A=18,vA=14,yA=[`Opening workspace`,`Setting environment`,`Initializing modules`,`Starting services`],bA=[`Opening conversation`,`Reattaching thread`,`Loading recent history`,`Syncing transcript`],xA=[...yA,...bA];function SA({name:e,className:t}){let n=H(`chrome-icon`,t);switch(e){case`auto`:return(0,I.jsx)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,I.jsx)(`path`,{d:`m8.1 1.4-1.7 4 2.3.3-1 4.9 3.9-6-2.4-.3 1.5-3Z`})});case`plan`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{d:`M4 3.5v9`}),(0,I.jsx)(`path`,{d:`M4 5h5`}),(0,I.jsx)(`path`,{d:`M4 8h7`}),(0,I.jsx)(`path`,{d:`M4 11h4`}),(0,I.jsx)(`circle`,{cx:`11.5`,cy:`8`,r:`1.5`})]});case`mention`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.3`}),(0,I.jsx)(`path`,{d:`M10.8 10.1a2.3 2.3 0 1 1 .4-4.6v3.6c0 .7.4 1 1 1 .9 0 1.4-.8 1.4-2.1A5.4 5.4 0 1 0 8 13.4`})]});case`attach`:return(0,I.jsx)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,I.jsx)(`path`,{d:`m6 8.5 3.8-3.8a2 2 0 1 1 2.8 2.8L7.9 12.2A3 3 0 0 1 3.6 8l4.3-4.3`})});case`image`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`rect`,{x:`2.5`,y:`3`,width:`11`,height:`10`,rx:`2`}),(0,I.jsx)(`circle`,{cx:`6`,cy:`6.5`,r:`1`}),(0,I.jsx)(`path`,{d:`m4.5 11 2.4-2.4 1.9 1.9 1.4-1.4 1.3 1.9`})]});case`terminal`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`rect`,{x:`2.5`,y:`3`,width:`11`,height:`10`,rx:`2`}),(0,I.jsx)(`path`,{d:`m5.3 6 1.8 1.8-1.8 1.8`}),(0,I.jsx)(`path`,{d:`M8.7 9.8h2.2`})]});case`web`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4.2`}),(0,I.jsx)(`path`,{d:`m10.2 10.2 2.6 2.6`})]});case`review`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{d:`M4.5 2.8h5l2 2v7.4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V3.8a1 1 0 0 1 1-1Z`}),(0,I.jsx)(`path`,{d:`M9.5 2.8v2h2`}),(0,I.jsx)(`path`,{d:`M5.7 8h4.6`}),(0,I.jsx)(`path`,{d:`M5.7 10.3h3.2`})]});case`agents`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`circle`,{cx:`4.2`,cy:`8`,r:`1.5`}),(0,I.jsx)(`circle`,{cx:`11.8`,cy:`5.2`,r:`1.5`}),(0,I.jsx)(`circle`,{cx:`11.8`,cy:`10.8`,r:`1.5`}),(0,I.jsx)(`path`,{d:`M5.5 7.3 10.4 5.8`}),(0,I.jsx)(`path`,{d:`M5.5 8.7 10.4 10.2`})]});case`compact`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{d:`M3.5 5h9`}),(0,I.jsx)(`path`,{d:`M3.5 8h6`}),(0,I.jsx)(`path`,{d:`M3.5 11h9`}),(0,I.jsx)(`path`,{d:`m11 6.3 1.8 1.7L11 9.7`})]});case`editor`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{d:`M4.4 11.6 11.6 4.4`}),(0,I.jsx)(`path`,{d:`m10.4 3.6 2 2`}),(0,I.jsx)(`path`,{d:`M4 12.2 3.6 13l.8-.4 1.4-.3-.8-.8Z`}),(0,I.jsx)(`path`,{d:`M3.5 3.4h5.2`})]});case`send`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{d:`m8 12.7-.1-8.8`}),(0,I.jsx)(`path`,{d:`m5.3 6.1 2.6-2.8 2.8 2.8`})]});case`stop`:return(0,I.jsx)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,I.jsx)(`rect`,{x:`4.6`,y:`4.6`,width:`6.8`,height:`6.8`,rx:`1.2`})});case`branch`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`circle`,{cx:`5`,cy:`4`,r:`1.4`}),(0,I.jsx)(`circle`,{cx:`11`,cy:`12`,r:`1.4`}),(0,I.jsx)(`circle`,{cx:`11`,cy:`4`,r:`1.4`}),(0,I.jsx)(`path`,{d:`M5 5.4v4.1c0 1.4 1.1 2.5 2.5 2.5H9.6`}),(0,I.jsx)(`path`,{d:`M5 5.4c0 1.4 1.1 2.5 2.5 2.5H9.6`})]});case`model`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{d:`m8 2.6 4.4 2.5v5L8 12.6l-4.4-2.5v-5Z`}),(0,I.jsx)(`path`,{d:`m8 2.6 4.4 2.5L8 7.6 3.6 5.1Z`}),(0,I.jsx)(`path`,{d:`M8 7.6v5`})]});case`shield`:return(0,I.jsx)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,I.jsx)(`path`,{d:`M8 2.5 12 4v3.6c0 2.4-1.4 4.2-4 5.9-2.6-1.7-4-3.5-4-5.9V4Z`})})}}var CA=e=>new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:e>=1e5?0:1}).format(e),wA=e=>{if(!e)return`workspace`;let t=e.replace(/\/+$/u,``);return t?t.split(`/`).filter(Boolean).at(-1)??t:`workspace`},TA=e=>e===`/`?`/`:/^[a-z]:[\\/]?$/iu.test(e)?`${e.slice(0,2)}\\`:e.replace(/[\\/]+$/u,``),EA=e=>{let t=e.trim();if(!t)return{root:``,separator:`/`,segments:[]};let n=t.includes(`\\`)?`\\`:`/`,r=TA(t);return/^[a-z]:\\$/iu.test(r)?{root:r,separator:`\\`,segments:[]}:/^[a-z]:/iu.test(r)?{root:`${r.slice(0,2)}\\`,separator:`\\`,segments:r.slice(2).replace(/^[\\/]+/u,``).split(/[\\/]+/u).filter(Boolean)}:r.startsWith(`/`)?{root:`/`,separator:`/`,segments:r.slice(1).split(`/`).filter(Boolean)}:{root:``,separator:n,segments:r.split(/[\\/]+/u).filter(Boolean)}},DA=(e,t,n)=>e===`/`?n.length>0?`/${n.join(`/`)}`:`/`:/^[a-z]:\\$/iu.test(e)?n.length>0?`${e}${n.join(`\\`)}`:e:e?n.length>0?`${e.replace(/[\\/]+$/u,t)}${n.join(t)}`:e:n.join(t),OA=e=>{let{root:t,separator:n,segments:r}=EA(e);return r.length===0?null:DA(t,n,r.slice(0,-1))||t||null},kA=e=>{let{root:t,separator:n,segments:r}=EA(e),i=[];t&&i.push({label:t===`/`?`/`:t.replace(/[\\/]+$/u,``),path:t});let a=[];return r.forEach(e=>{a.push(e),i.push({label:e,path:DA(t,n,a)})}),i.length===0&&i.push({label:e,path:e}),i},AA=(e,t)=>{if(t!==null){if(t<=300)return`5h`;if(t>=1440*7)return`Week`}let n=e.trim().toLowerCase();return n.includes(`week`)?`Week`:n.includes(`5`)?`5h`:e},jA=(e,t)=>{let n=0;for(let r of e)for(let e of r.items)switch(e.type){case`userMessage`:n+=Jd(e,t).length;break;case`agentMessage`:case`plan`:n+=e.text.length;break;case`reasoning`:n+=e.summary.join(`
|
|
212
|
+
color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i}return o.updateDeps=e=>{r=e},o}function Rk(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var zk=(e,t)=>Math.abs(e-t)<1.01,Bk=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Vk=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Hk=e=>e,Uk=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},Wk=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Vk(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(Vk(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},Gk={passive:!0},Kk=typeof window>`u`?!0:`onscrollend`in window,qk=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=0,a=e.options.useScrollendEvent&&Kk?()=>void 0:Bk(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),o=r=>()=>{let{horizontal:o,isRtl:s}=e.options;i=o?n.scrollLeft*(s&&-1||1):n.scrollTop,a(),t(i,r)},s=o(!0),c=o(!1);n.addEventListener(`scroll`,s,Gk);let l=e.options.useScrollendEvent&&Kk;return l&&n.addEventListener(`scrollend`,c,Gk),()=>{n.removeEventListener(`scroll`,s),l&&n.removeEventListener(`scrollend`,c)}},Jk=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Yk=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;let o=e+t;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:o,behavior:n})},Xk=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{n===void 0&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Hk,rangeExtractor:Uk,onChange:()=>{},measureElement:Jk,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=Lk(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=Lk(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,n,r,i,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a}),{key:!1}),this.getMeasurements=Lk(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a},o)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let s=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let c=this.measurementsCache.slice(0,s),l=Array(a).fill(void 0);for(let e=0;e<s;e++){let t=c[e];t&&(l[t.lane]=e)}for(let i=s;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,u;if(a!==void 0&&this.options.lanes>1){s=a;let e=l[s],r=e===void 0?void 0:c[e];u=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?c[i-1]:this.getFurthestMeasurement(c,i);u=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(i,s)}let d=o.get(e),f=typeof d==`number`?d:this.options.estimateSize(i),p=u+f;c[i]={index:i,start:u,size:f,end:p,key:e,lane:s},l[s]=i}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Lk(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?Qk({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Lk(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{let n=this.measurementsCache[e];if(!n)return;let r=t-(this.itemSizeCache.get(n.key)??n.size);r!==0&&(this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?n.start<this.getScrollOffset()+this.scrollAdjustments:this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this))&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.getVirtualItems=Lk(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length!==0)return Rk(t[Zk(0,t.length-1,e=>Rk(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t);this.scrollState={index:null,align:t,behavior:n,startedAt:this.now(),lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e;this.scrollState={index:null,align:`start`,behavior:t,startedAt:this.now(),lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=e[e.length-1]?.end??0;else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&zk(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.scrollState=null;return}}else this.scrollState.stableFrames=0,n&&(this.scrollState.lastTargetOffset=t,this.scrollState.behavior=`auto`,this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}));this.scheduleScrollReconcile()}},Zk=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function Qk({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){let i=e.length-1,a=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:i};let o=Zk(0,i,a,n),s=o;if(r===1)for(;s<i&&e[s].end<n+t;)s++;else if(r>1){let a=Array(r).fill(0);for(;s<i&&a.some(e=>e<n+t);){let t=e[s];a[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(i,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var $k=typeof document<`u`?F.useLayoutEffect:F.useEffect;function eA({useFlushSync:e=!0,...t}){let n=F.useReducer(()=>({}),{})[1],r={...t,onChange:(r,i)=>{var a;e&&i?(0,Fa.flushSync)(n):n(),(a=t.onChange)==null||a.call(t,r,i)}},[i]=F.useState(()=>new Xk(r));return i.setOptions(r),$k(()=>i._didMount(),[]),$k(()=>i._willUpdate()),i}function tA(e){return eA({observeElementRect:Wk,observeElementOffset:qk,scrollToFn:Yk,...e})}var nA=u.theme({"&":{height:`100%`,color:`var(--file-editor-ink)`,backgroundColor:`var(--file-editor-surface)`},"&.cm-focused":{outline:`none`},".cm-scroller":{overflow:`auto`,fontFamily:`var(--mono)`,lineHeight:`1.72`},".cm-content":{minHeight:`100%`,padding:`14px 0 24px`,caretColor:`var(--file-editor-caret)`},".cm-line":{padding:`0 20px 0 16px`},".cm-gutters":{backgroundColor:`var(--file-editor-gutter)`,color:`var(--file-editor-muted)`,borderRight:`1px solid var(--file-editor-rule)`},".cm-lineNumbers .cm-gutterElement":{padding:`0 12px 0 16px`,minWidth:`42px`},".cm-activeLine":{backgroundColor:`var(--file-editor-active)`},".cm-activeLineGutter":{color:`var(--file-editor-ink)`,backgroundColor:`transparent`},".cm-selectionBackground, &.cm-focused .cm-selectionBackground, .cm-content ::selection":{backgroundColor:`var(--file-editor-selection)`},".cm-cursor, .cm-dropCursor":{borderLeftColor:`var(--file-editor-caret)`},".cm-searchMatch":{backgroundColor:`rgb(255 214 102 / 16%)`,outline:`1px solid rgb(255 214 102 / 18%)`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`rgb(255 214 102 / 26%)`},".cm-tooltip":{border:`1px solid var(--file-editor-rule)`,borderRadius:`10px`,backgroundColor:`rgb(11 15 27 / 98%)`,boxShadow:`0 20px 48px rgb(0 0 0 / 38%)`},".cm-panels":{backgroundColor:`rgb(11 15 27 / 96%)`,borderBottom:`1px solid var(--file-editor-rule)`}},{dark:!0}),rA=Se.define([{tag:g.keyword,color:`#c792ea`},{tag:[g.name,g.deleted,g.character,g.propertyName,g.macroName],color:`#82aaff`},{tag:[g.function(g.variableName),g.labelName],color:`#82aaff`},{tag:[g.color,g.constant(g.name),g.standard(g.name)],color:`#f78c6c`},{tag:[g.definition(g.name),g.separator],color:`#eeffff`},{tag:[g.className,g.typeName],color:`#ffcb6b`},{tag:[g.number,g.changed,g.annotation,g.modifier,g.self,g.namespace],color:`#f78c6c`},{tag:[g.operator,g.operatorKeyword],color:`#89ddff`},{tag:[g.url,g.escape,g.regexp,g.link],color:`#80cbc4`},{tag:[g.meta,g.comment],color:`#637777`,fontStyle:`italic`},{tag:[g.string,g.inserted],color:`#c3e88d`},{tag:[g.invalid],color:`#ff5370`},{tag:[g.bool,g.null],color:`#f78c6c`},{tag:g.heading,color:`#82aaff`,fontWeight:`700`},{tag:g.emphasis,fontStyle:`italic`},{tag:g.strong,fontWeight:`700`},{tag:g.strikethrough,textDecoration:`line-through`}]),iA=(0,F.memo)(function({breadcrumbs:e,currentPath:t,directoryEntries:n,editorPath:r,loading:i,mentionedPaths:a,modifiedByPath:o,onNavigate:s,onOpenEntry:c,parentPath:l,rootPath:u}){let d=(0,F.useRef)(null),f=tA({count:n.length,getScrollElement:()=>d.current,estimateSize:()=>38,overscan:10});return(0,F.useEffect)(()=>{let e=d.current;e&&(e.scrollTop=0)},[t]),(0,I.jsxs)(`div`,{className:`file-explorer-panel`,children:[(0,I.jsxs)(`div`,{className:`panel-head-row`,children:[l?(0,I.jsx)(`button`,{className:`mini-action`,type:`button`,onClick:()=>s(l),children:`← Back`}):null,(0,I.jsxs)(`div`,{className:`panel-hint`,children:[`📁 `,t,` · `,o.size,` modified`]})]}),(0,I.jsx)(`div`,{className:`file-breadcrumbs`,children:e.map(e=>(0,I.jsx)(`button`,{className:H(`file-crumb`,e.path===t&&`active`),type:`button`,onClick:()=>s(e.path),children:e.label},e.path))}),i?(0,I.jsx)(`div`,{className:`empty-panel`,children:`Loading files for this directory…`}):null,!i&&n.length===0?(0,I.jsx)(`div`,{className:`empty-panel`,children:`No direct files or folders found in this directory.`}):null,!i&&n.length>0?(0,I.jsx)(`div`,{className:`file-explorer-scroll`,ref:d,children:(0,I.jsx)(`div`,{className:`file-explorer-list`,role:`presentation`,style:{height:`${f.getTotalSize()}px`},children:f.getVirtualItems().map(e=>{let t=n[e.index];if(!t)return null;let i=t.path.startsWith(`${u}/`)?t.path.slice(u.length+1):t.name,s=o.get(t.name)??o.get(i),l=a.has(t.path);return(0,I.jsxs)(`button`,{className:H(`fi file-explorer-row`,t.kind===`directory`&&`dir`,s===`mod`&&`active`,l&&`mentioned`,r===t.path&&`open`),type:`button`,onClick:()=>void c(t),style:{transform:`translateY(${e.start}px)`},children:[(0,I.jsx)(`span`,{children:t.kind===`directory`?`📁`:`📄`}),(0,I.jsx)(`span`,{className:`fi-n`,children:t.name}),l?(0,I.jsx)(`span`,{className:`fbdg mention`,children:`@`}):null,s?(0,I.jsx)(`span`,{className:H(`fbdg`,s),children:s}):null]},t.id)})})}):null,(0,I.jsxs)(`div`,{className:`panel-meta`,children:[(0,I.jsx)(`div`,{children:`Tap a file to open the full editor. Tap folders to drill in.`}),(0,I.jsxs)(`div`,{children:[`Use `,(0,I.jsx)(`code`,{children:`/mention filename`}),` or type `,(0,I.jsx)(`code`,{children:`@filename`}),` in the composer.`]})]})]})});function aA({activePath:e,breadcrumbs:t,busy:n,entries:r,loading:i,onClose:a,onNavigate:o,onPick:s,parentPath:c}){return(0,I.jsx)(`div`,{className:`project-picker-overlay`,onClick:e=>{e.target===e.currentTarget&&a()},children:(0,I.jsxs)(`div`,{className:`project-picker-modal`,children:[(0,I.jsxs)(`div`,{className:`project-picker-head`,children:[(0,I.jsxs)(`div`,{className:`project-picker-copy`,children:[(0,I.jsx)(`div`,{className:`project-picker-title`,children:`Start New Session`}),(0,I.jsx)(`div`,{className:`project-picker-subtitle`,children:`Pick the project folder to use as this session's working directory.`})]}),(0,I.jsx)(`button`,{"aria-label":`Close project picker`,className:`project-picker-close`,disabled:n,onClick:a,type:`button`,children:`×`})]}),(0,I.jsx)(`div`,{className:`project-picker-breadcrumbs`,children:t.map(t=>(0,I.jsx)(`button`,{className:H(`project-picker-crumb`,t.path===e&&`active`),disabled:n,onClick:()=>o(t.path),type:`button`,children:t.label},t.path))}),(0,I.jsxs)(`div`,{className:`project-picker-toolbar`,children:[c?(0,I.jsx)(`button`,{className:`project-picker-action`,disabled:n,onClick:()=>o(c),type:`button`,children:`← Up`}):(0,I.jsx)(`span`,{className:`project-picker-root`,children:`Root`}),(0,I.jsx)(`button`,{className:`project-picker-start`,disabled:n||i,onClick:()=>s(e),type:`button`,children:n?`Starting…`:`Use This Folder`})]}),(0,I.jsx)(`div`,{className:`project-picker-current`,children:e}),(0,I.jsx)(`div`,{className:`project-picker-list`,children:i?(0,I.jsx)(`div`,{className:`project-picker-empty`,children:`Loading folders…`}):r.length===0?(0,I.jsx)(`div`,{className:`project-picker-empty`,children:`No folders found here.`}):r.map(e=>(0,I.jsxs)(`button`,{className:`project-picker-entry`,disabled:n,onClick:()=>o(e.path),type:`button`,children:[(0,I.jsx)(`span`,{className:`project-picker-entry-icon`,children:`📁`}),(0,I.jsxs)(`span`,{className:`project-picker-entry-copy`,children:[(0,I.jsx)(`span`,{className:`project-picker-entry-name`,children:e.name}),(0,I.jsx)(`span`,{className:`project-picker-entry-path`,children:e.path})]}),(0,I.jsx)(`span`,{className:`project-picker-entry-arrow`,children:`→`})]},e.id))})]})})}function oA({messages:e,onSteer:t,onDelete:n}){return e.length===0?null:(0,I.jsx)(`div`,{className:`queued-messages`,children:(0,I.jsx)(`div`,{className:`queued-messages-inner`,children:e.map(e=>{let r=e.prompt.trim()||[e.images.length>0?`${e.images.length} image`:``,e.files.length>0?`${e.files.length} upload`:``,e.mentions.length>0?`${e.mentions.length} file`:``,e.skills.length>0?`${e.skills.length} skill`:``].filter(Boolean).join(` · `);return(0,I.jsxs)(`div`,{className:`queued-row`,children:[(0,I.jsx)(`span`,{className:`queued-row-icon`,children:`💬`}),(0,I.jsx)(`span`,{className:`queued-row-text`,children:Hd(r||`Queued follow-up`,96)}),(0,I.jsxs)(`div`,{className:`queued-row-actions`,children:[(0,I.jsx)(`button`,{className:`queued-row-steer`,type:`button`,onClick:()=>t(e.id),children:`Steer`}),(0,I.jsx)(`button`,{"aria-label":`Delete queued message`,className:`queued-row-delete`,type:`button`,onClick:()=>n(e.id),children:`×`})]})]},e.id)})})})}var sA=(0,F.memo)(function({value:e,mentions:t,placeholder:n,textareaRef:r,composerMirrorRef:i,onPaste:a,onValueChange:o,onKeyDown:s}){let[c,l]=(0,F.useState)(e),u=(0,F.useMemo)(()=>t.filter(e=>$d(c,e)),[c,t]),d=(0,F.useMemo)(()=>u.length>0?tf(c,u):[],[u,c]),f=(0,F.useCallback)(()=>{if(u.length===0)return;let e=r.current,t=i.current;!e||!t||(t.scrollTop=e.scrollTop,t.scrollLeft=e.scrollLeft)},[u.length,i,r]);(0,F.useEffect)(()=>{let e=r.current;e&&(e.style.height=`auto`,e.style.height=`${Math.max(60,Math.min(e.scrollHeight,140))}px`,f())},[60,c,f,r]);let p=(0,F.useCallback)(e=>{let t=e.target.value;l(t),o(t)},[o]);return(0,I.jsxs)(`div`,{className:`composer-text-shell`,children:[u.length>0?(0,I.jsx)(`div`,{className:`composer-mirror`,ref:i,"aria-hidden":`true`,children:c?d.map((e,t)=>(0,I.jsx)(`span`,{className:H(`composer-segment`,e.mention&&`file`),children:e.text},`${e.text}-${t}`)):null}):null,c?null:(0,I.jsx)(`span`,{className:`composer-placeholder`,children:n}),(0,I.jsx)(`textarea`,{id:`ta`,ref:r,rows:3,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,placeholder:``,spellCheck:!1,value:c,onChange:p,onKeyDown:s,onPaste:a,onScroll:f})]})});function cA({entry:e}){let t=Sf(e.diff);return t.length===0?(0,I.jsx)(`div`,{className:`diff-patch-empty`,children:`Waiting for diff…`}):(0,I.jsx)(`div`,{className:`diff-patch-viewer`,children:t.map(e=>(0,I.jsxs)(`div`,{className:H(`diff-patch-row`,e.kind),children:[(0,I.jsx)(`span`,{className:`diff-patch-num`,children:e.oldLine??``}),(0,I.jsx)(`span`,{className:`diff-patch-num`,children:e.newLine??``}),(0,I.jsx)(`pre`,{className:`diff-patch-text`,children:e.text||` `})]},e.id))})}function lA({backLabel:e=`Back to Chat`,diffEntries:t,findings:n,onBack:r,onSelectEntry:i,selectedEntryId:a}){let o=(0,F.useMemo)(()=>t.find(e=>e.id===a)??t[0]??null,[t,a]),s=(0,F.useMemo)(()=>t.reduce((e,t)=>e+t.additions,0),[t]),c=(0,F.useMemo)(()=>t.reduce((e,t)=>e+t.removals,0),[t]);return(0,I.jsx)(`div`,{id:`review-page`,children:(0,I.jsxs)(`div`,{className:`diff-review-shell page`,children:[(0,I.jsxs)(`div`,{className:`diff-review-page-head`,children:[(0,I.jsxs)(`button`,{className:`file-editor-back`,onClick:r,type:`button`,children:[`← `,e]}),(0,I.jsxs)(`div`,{className:`diff-review-page-copy`,children:[(0,I.jsx)(`div`,{className:`diff-review-page-title`,children:`Patch review`}),(0,I.jsxs)(`div`,{className:`diff-review-page-subtitle`,children:[t.length,` changed file`,t.length===1?``:`s`,` · +`,s,` / -`,c]})]})]}),t.length===0?(0,I.jsx)(`div`,{className:`empty-panel`,children:`No diff items in this thread yet.`}):(0,I.jsxs)(`div`,{className:`diff-review-layout page`,children:[(0,I.jsx)(`div`,{className:`diff-review-sidebar`,children:t.map(e=>(0,I.jsxs)(`button`,{className:H(`diff-review-entry`,o?.id===e.id&&`active`),type:`button`,onClick:()=>i(e.id),children:[(0,I.jsxs)(`div`,{className:`diff-review-entry-top`,children:[(0,I.jsx)(`span`,{className:H(`diff-kind-pill`,e.kind.type===`add`&&`new`,e.kind.type===`delete`&&`del`),children:bf(e.kind)}),(0,I.jsx)(`span`,{className:H(`diff-status`,e.status===`inProgress`&&`live`,e.status===`failed`&&`err`),children:e.status===`inProgress`?`editing`:e.status})]}),(0,I.jsx)(`div`,{className:`diff-review-entry-path`,children:e.path}),(0,I.jsxs)(`div`,{className:`diff-review-entry-meta`,children:[(0,I.jsxs)(`span`,{children:[`+`,e.additions]}),(0,I.jsxs)(`span`,{children:[`-`,e.removals]}),(0,I.jsxs)(`span`,{children:[e.hunks,` hunk`,e.hunks===1?``:`s`]})]})]},e.id))}),o?(0,I.jsxs)(`div`,{className:`diff-review-main`,children:[(0,I.jsxs)(`div`,{className:`diff-focus-head`,children:[(0,I.jsx)(`div`,{className:`diff-focus-title`,children:o.path}),(0,I.jsxs)(`div`,{className:`diff-focus-meta`,children:[(0,I.jsx)(`span`,{className:H(`diff-kind-pill`,o.kind.type===`add`&&`new`,o.kind.type===`delete`&&`del`),children:bf(o.kind)}),(0,I.jsx)(`span`,{className:H(`diff-status`,o.status===`inProgress`&&`live`,o.status===`failed`&&`err`),children:o.status===`inProgress`?`editing`:o.status}),(0,I.jsxs)(`span`,{className:`diff-stat-chip`,children:[`+`,o.additions]}),(0,I.jsxs)(`span`,{className:`diff-stat-chip`,children:[`-`,o.removals]}),(0,I.jsxs)(`span`,{className:`diff-stat-chip`,children:[o.hunks,` hunk`,o.hunks===1?``:`s`]})]})]}),(0,I.jsx)(cA,{entry:o})]}):null]}),n.length>0?(0,I.jsx)(`div`,{className:`review-list`,children:n.map(e=>(0,I.jsxs)(`div`,{className:H(`review-item`,e.severity),children:[(0,I.jsxs)(`div`,{className:`review-header`,children:[(0,I.jsx)(`span`,{children:e.severity}),(0,I.jsx)(`span`,{children:e.file.split(`/`).slice(-2).join(`/`)}),(0,I.jsxs)(`span`,{children:[`:`,e.line]})]}),(0,I.jsx)(`div`,{className:`review-title`,children:e.title}),(0,I.jsx)(`div`,{className:`review-summary`,children:e.summary})]},e.id))}):null]})})}function uA({preview:e,variant:n=`panel`,onBack:r,backLabel:i=`Back`,onSave:a,onDirtyChange:o,providerId:s}){let c=hs(e.path,s),l=(0,F.useRef)(null),[d,f]=(0,F.useState)(e.content),[p,m]=(0,F.useState)(e.content),[h,g]=(0,F.useState)(null),[_,v]=(0,F.useState)(!1),[y,b]=(0,F.useState)(`Plain text`),[x,S]=(0,F.useState)(null),C=d!==p;(0,F.useEffect)(()=>{o?.(C)},[C,o]),(0,F.useEffect)(()=>{f(e.content),m(e.content),g(null),v(!1)},[e.content,e.error,e.loading,e.path]),(0,F.useEffect)(()=>{let t=e.path||e.name,n=O.matchFilename(Ik,t),r=!1;if(S(null),b(n?.name??`Plain text`),n)return n.load().then(e=>{r||S(e.extension)}).catch(()=>{r||S(null)}),()=>{r=!0}},[e.name,e.path]);let w=(0,F.useCallback)(async()=>{if(!(!a||e.loading||e.error||_||!C)){v(!0),g(null);try{await a(e.path,d),m(d)}catch(e){g(e instanceof Error?e.message:`Unable to save this file.`)}finally{v(!1)}}},[d,C,_,a,e.error,e.loading,e.path]),T=(0,F.useMemo)(()=>{let e=[nA,t(rA),M.of([{key:`Mod-s`,preventDefault:!0,run:()=>(w(),!0)}])];return x&&e.push(x),e},[x,w]);(0,F.useEffect)(()=>{let t=l.current;if(!(!t||e.loading||e.error)){if(typeof e.line==`number`&&e.line>0){let n=t.state.doc.line(Math.min(e.line,t.state.doc.lines));t.dispatch({selection:{anchor:n.from},effects:u.scrollIntoView(n.from,{y:`center`})});return}t.scrollDOM.scrollTo({left:0,top:0})}},[e.error,e.line,e.loading,e.path]);let E=(0,F.useCallback)(()=>{r&&(C&&typeof window<`u`&&!window.confirm(`Discard unsaved changes to ${e.name}?`)||r())},[C,r,e.name]),D=_?`Saving…`:C?`Save`:`Saved`,k=h?`Save failed`:_?`Saving`:C?`Unsaved`:`Saved`;return(0,I.jsxs)(`div`,{className:H(`file-editor`,n===`page`&&`page`),children:[(0,I.jsxs)(`div`,{className:`file-editor-head`,children:[n===`page`?(0,I.jsxs)(`button`,{className:`file-editor-back`,onClick:E,type:`button`,children:[`← `,i]}):null,(0,I.jsxs)(`div`,{className:`file-editor-copy`,children:[(0,I.jsx)(`div`,{className:`file-editor-title`,children:e.name}),(0,I.jsx)(`div`,{className:`file-editor-path`,children:e.path})]}),(0,I.jsxs)(`div`,{className:`file-editor-actions`,children:[(0,I.jsxs)(`div`,{className:`file-editor-meta`,children:[(0,I.jsx)(`span`,{className:`file-editor-chip`,children:y}),typeof e.line==`number`&&e.line>0?(0,I.jsxs)(`span`,{className:`file-editor-chip`,children:[`Line `,e.line]}):null,(0,I.jsx)(`span`,{className:H(`file-editor-status`,C&&`dirty`,h&&`error`),children:k})]}),c===`#`?null:(0,I.jsx)(`a`,{className:`file-editor-link`,href:c,rel:`noreferrer noopener`,target:`_blank`,children:`Raw`}),(0,I.jsx)(`button`,{className:`file-editor-save`,disabled:!a||e.loading||!!e.error||_||!C,onClick:()=>void w(),type:`button`,children:D})]})]}),(0,I.jsxs)(`div`,{className:`file-editor-body`,children:[e.loading?(0,I.jsx)(`div`,{className:`file-editor-empty`,children:`Opening file…`}):null,!e.loading&&e.error?(0,I.jsx)(`div`,{className:`file-editor-empty`,children:e.error}):null,!e.loading&&!e.error?(0,I.jsx)(jk,{className:`file-editor-surface`,editable:!!a,extensions:T,height:`100%`,onChange:e=>{f(e),h&&g(null)},onCreateEditor:e=>{l.current=e},value:d}):null]})]})}var dA=`materializedThreadId`,fA=`nomadex-composer-drafts`,pA=e=>{if(!e||typeof e!=`object`)return null;let t=e[dA];return typeof t==`string`?t:null},mA=()=>{if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(fA);if(!e)return{};let t=JSON.parse(e);return!t||typeof t!=`object`?{}:Object.fromEntries(Object.entries(t).filter(e=>typeof e[0]==`string`&&typeof e[1]==`string`))}catch{return{}}},hA=e=>{if(!(typeof window>`u`)){if(Object.keys(e).length===0){window.localStorage.removeItem(fA);return}window.localStorage.setItem(fA,JSON.stringify(e))}},gA=(e,t)=>Object.fromEntries((e.questions??[]).map(e=>[e.id,[(t[e.id]??``).trim()].filter(Boolean)])),_A=(0,F.createContext)(null),vA=Sc(),yA=vA.mentionCatalog,bA=18,xA=14,SA=[`Opening workspace`,`Setting environment`,`Initializing modules`,`Starting services`],CA=[`Opening conversation`,`Reattaching thread`,`Loading recent history`,`Syncing transcript`],wA=[...SA,...CA];function TA({name:e,className:t}){let n=H(`chrome-icon`,t);switch(e){case`auto`:return(0,I.jsx)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,I.jsx)(`path`,{d:`m8.1 1.4-1.7 4 2.3.3-1 4.9 3.9-6-2.4-.3 1.5-3Z`})});case`plan`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{d:`M4 3.5v9`}),(0,I.jsx)(`path`,{d:`M4 5h5`}),(0,I.jsx)(`path`,{d:`M4 8h7`}),(0,I.jsx)(`path`,{d:`M4 11h4`}),(0,I.jsx)(`circle`,{cx:`11.5`,cy:`8`,r:`1.5`})]});case`mention`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.3`}),(0,I.jsx)(`path`,{d:`M10.8 10.1a2.3 2.3 0 1 1 .4-4.6v3.6c0 .7.4 1 1 1 .9 0 1.4-.8 1.4-2.1A5.4 5.4 0 1 0 8 13.4`})]});case`attach`:return(0,I.jsx)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,I.jsx)(`path`,{d:`m6 8.5 3.8-3.8a2 2 0 1 1 2.8 2.8L7.9 12.2A3 3 0 0 1 3.6 8l4.3-4.3`})});case`image`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`rect`,{x:`2.5`,y:`3`,width:`11`,height:`10`,rx:`2`}),(0,I.jsx)(`circle`,{cx:`6`,cy:`6.5`,r:`1`}),(0,I.jsx)(`path`,{d:`m4.5 11 2.4-2.4 1.9 1.9 1.4-1.4 1.3 1.9`})]});case`terminal`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`rect`,{x:`2.5`,y:`3`,width:`11`,height:`10`,rx:`2`}),(0,I.jsx)(`path`,{d:`m5.3 6 1.8 1.8-1.8 1.8`}),(0,I.jsx)(`path`,{d:`M8.7 9.8h2.2`})]});case`web`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4.2`}),(0,I.jsx)(`path`,{d:`m10.2 10.2 2.6 2.6`})]});case`review`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{d:`M4.5 2.8h5l2 2v7.4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V3.8a1 1 0 0 1 1-1Z`}),(0,I.jsx)(`path`,{d:`M9.5 2.8v2h2`}),(0,I.jsx)(`path`,{d:`M5.7 8h4.6`}),(0,I.jsx)(`path`,{d:`M5.7 10.3h3.2`})]});case`agents`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`circle`,{cx:`4.2`,cy:`8`,r:`1.5`}),(0,I.jsx)(`circle`,{cx:`11.8`,cy:`5.2`,r:`1.5`}),(0,I.jsx)(`circle`,{cx:`11.8`,cy:`10.8`,r:`1.5`}),(0,I.jsx)(`path`,{d:`M5.5 7.3 10.4 5.8`}),(0,I.jsx)(`path`,{d:`M5.5 8.7 10.4 10.2`})]});case`compact`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{d:`M3.5 5h9`}),(0,I.jsx)(`path`,{d:`M3.5 8h6`}),(0,I.jsx)(`path`,{d:`M3.5 11h9`}),(0,I.jsx)(`path`,{d:`m11 6.3 1.8 1.7L11 9.7`})]});case`editor`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{d:`M4.4 11.6 11.6 4.4`}),(0,I.jsx)(`path`,{d:`m10.4 3.6 2 2`}),(0,I.jsx)(`path`,{d:`M4 12.2 3.6 13l.8-.4 1.4-.3-.8-.8Z`}),(0,I.jsx)(`path`,{d:`M3.5 3.4h5.2`})]});case`send`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{d:`m8 12.7-.1-8.8`}),(0,I.jsx)(`path`,{d:`m5.3 6.1 2.6-2.8 2.8 2.8`})]});case`stop`:return(0,I.jsx)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,I.jsx)(`rect`,{x:`4.6`,y:`4.6`,width:`6.8`,height:`6.8`,rx:`1.2`})});case`branch`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`circle`,{cx:`5`,cy:`4`,r:`1.4`}),(0,I.jsx)(`circle`,{cx:`11`,cy:`12`,r:`1.4`}),(0,I.jsx)(`circle`,{cx:`11`,cy:`4`,r:`1.4`}),(0,I.jsx)(`path`,{d:`M5 5.4v4.1c0 1.4 1.1 2.5 2.5 2.5H9.6`}),(0,I.jsx)(`path`,{d:`M5 5.4c0 1.4 1.1 2.5 2.5 2.5H9.6`})]});case`model`:return(0,I.jsxs)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{d:`m8 2.6 4.4 2.5v5L8 12.6l-4.4-2.5v-5Z`}),(0,I.jsx)(`path`,{d:`m8 2.6 4.4 2.5L8 7.6 3.6 5.1Z`}),(0,I.jsx)(`path`,{d:`M8 7.6v5`})]});case`shield`:return(0,I.jsx)(`svg`,{className:n,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,I.jsx)(`path`,{d:`M8 2.5 12 4v3.6c0 2.4-1.4 4.2-4 5.9-2.6-1.7-4-3.5-4-5.9V4Z`})})}}var EA=e=>new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:e>=1e5?0:1}).format(e),DA=e=>{if(!e)return`workspace`;let t=e.replace(/\/+$/u,``);return t?t.split(`/`).filter(Boolean).at(-1)??t:`workspace`},OA=e=>e===`/`?`/`:/^[a-z]:[\\/]?$/iu.test(e)?`${e.slice(0,2)}\\`:e.replace(/[\\/]+$/u,``),kA=e=>{let t=e.trim();if(!t)return{root:``,separator:`/`,segments:[]};let n=t.includes(`\\`)?`\\`:`/`,r=OA(t);return/^[a-z]:\\$/iu.test(r)?{root:r,separator:`\\`,segments:[]}:/^[a-z]:/iu.test(r)?{root:`${r.slice(0,2)}\\`,separator:`\\`,segments:r.slice(2).replace(/^[\\/]+/u,``).split(/[\\/]+/u).filter(Boolean)}:r.startsWith(`/`)?{root:`/`,separator:`/`,segments:r.slice(1).split(`/`).filter(Boolean)}:{root:``,separator:n,segments:r.split(/[\\/]+/u).filter(Boolean)}},AA=(e,t,n)=>e===`/`?n.length>0?`/${n.join(`/`)}`:`/`:/^[a-z]:\\$/iu.test(e)?n.length>0?`${e}${n.join(`\\`)}`:e:e?n.length>0?`${e.replace(/[\\/]+$/u,t)}${n.join(t)}`:e:n.join(t),jA=e=>{let{root:t,separator:n,segments:r}=kA(e);return r.length===0?null:AA(t,n,r.slice(0,-1))||t||null},MA=e=>{let{root:t,separator:n,segments:r}=kA(e),i=[];t&&i.push({label:t===`/`?`/`:t.replace(/[\\/]+$/u,``),path:t});let a=[];return r.forEach(e=>{a.push(e),i.push({label:e,path:AA(t,n,a)})}),i.length===0&&i.push({label:e,path:e}),i},NA=(e,t)=>{if(t!==null){if(t<=300)return`5h`;if(t>=1440*7)return`Week`}let n=e.trim().toLowerCase();return n.includes(`week`)?`Week`:n.includes(`5`)?`5h`:e},PA=(e,t)=>{let n=0;for(let r of e)for(let e of r.items)switch(e.type){case`userMessage`:n+=Jd(e,t).length;break;case`agentMessage`:case`plan`:n+=e.text.length;break;case`reasoning`:n+=e.summary.join(`
|
|
213
213
|
`).length,n+=e.content.join(`
|
|
214
|
-
`).length;break;case`webSearch`:n+=e.query.length;break;case`collabAgentToolCall`:n+=(e.prompt??``).length;break;default:break}return Math.max(0,Math.round(n/3.7))},MA=async e=>{if(typeof navigator<`u`&&navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),t.remove()},NA=e=>new Promise(t=>{window.setTimeout(t,e)}),PA=()=>new Promise(e=>{window.requestAnimationFrame(()=>{e()})}),FA=(e,t)=>e instanceof Error&&e.message.trim()?e.message:typeof e==`string`&&e.trim()?e:e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`&&e.message.trim()?e.message:t,IA=()=>{let e=(0,F.useContext)(mA);if(!e)throw Error(`Workspace context is missing.`);return e};function LA({children:e}){let[t,n]=(0,F.useState)(Sc()),r=(0,F.useRef)(t),i=(0,F.useRef)(null),a=(0,F.useRef)([]);(0,F.useEffect)(()=>{r.current=t},[t]);let o=(0,F.useCallback)(e=>{n(t=>{let n=structuredClone(t);return e(n),n})},[]);(0,F.useEffect)(()=>{let e=new ud(Sc());i.current=e;let t=e.subscribe(e=>{(0,F.startTransition)(()=>{n(e)})}),o=()=>{let t=r.current.transport;t.mode===`live`&&t.status===`connected`||e.connect().catch(()=>void 0)};o();let s=window.setInterval(()=>{o()},5e3),c=()=>{document.visibilityState===`visible`&&o()};return window.addEventListener(`focus`,o),document.addEventListener(`visibilitychange`,c),()=>{t(),window.clearInterval(s),window.removeEventListener(`focus`,o),document.removeEventListener(`visibilitychange`,c),e.disconnect(),a.current.forEach(e=>window.clearTimeout(e)),a.current=[]}},[]);let s=(0,F.useCallback)(async(e,t,n)=>{let a=r.current,o=i.current,s=!!o&&(n?.preferLive||a.transport.mode===`live`&&a.transport.status===`connected`);if(!o&&n?.preferLive)throw Error(`The workspace runtime is still starting. Try again.`);if(o&&s){let i=n?.preferLive?3:1,a=null;for(let s=0;s<i;s+=1)try{let t=r.current;return(t.transport.mode!==`live`||t.transport.status!==`connected`)&&await o.connect(),await e()}catch(e){if(a=e,s<i-1){await NA(320*(s+1));continue}if(n?.fallbackOnLiveError??!0)return await t();throw e}throw a}return await t()},[]),c=(0,F.useCallback)(async(e,t)=>{let n=kd(`thread`),r=Cc(n,t?.title??`New Session`,e,t?.cwd);return o(e=>{e.threads=jd([r,...e.threads.filter(e=>e.thread.id!==n)])}),n},[o]),l=(0,F.useCallback)(async({threadId:e,mode:t,prompt:n,mentions:i,skills:s,images:c,files:l,settings:u})=>{let d=r.current.threads.find(t=>t.thread.id===e)?.thread.cwd??r.current.directoryCatalogRoot??`.`,f=Ec({threadId:e,prompt:n,mode:t,settings:u,mentions:[...i,...Wd(d,l,u.provider)],skills:s,images:c,steer:null});o(r=>{r.threads=jd(r.threads.map(r=>r.thread.id===e?{...r,thread:{...r.thread,preview:n||r.thread.preview,updatedAt:Math.floor(Date.now()/1e3),status:{type:`active`,activeFlags:[]},turns:[...r.thread.turns,f.turn]},plan:f.plan,review:t===`review`?f.review:r.review,terminals:[...f.terminals,...r.terminals].slice(0,6),tokenUsage:{input:r.tokenUsage.input+Math.max(n.length*2,128),output:r.tokenUsage.output,cached:r.tokenUsage.cached}}:r)),r.streams=[...r.streams.filter(t=>t.threadId!==e),...f.streams]});let p=window.setTimeout(()=>{o(n=>{n.threads=jd(n.threads.map(n=>n.thread.id===e?{...n,thread:{...n.thread,updatedAt:Math.floor(Date.now()/1e3),status:{type:`idle`},turns:n.thread.turns.map(e=>e.id===f.turn.id?{...e,status:`completed`,items:e.items.map(e=>{if(e.type===`commandExecution`)return{...e,status:`completed`,exitCode:0,durationMs:1840};if(e.type===`collabAgentToolCall`){let t=Object.fromEntries(Object.entries(e.agentsStates).map(([e,t])=>[e,{...t,status:`completed`,message:t?.message??`Completed.`}]));return{...e,status:`completed`,agentsStates:t}}return e})}:e)},review:t===`review`?f.review:n.review,terminals:n.terminals.map(e=>f.terminals.some(t=>t.id===e.id)?{...e,status:`idle`,lastEvent:`just now`}:e),tokenUsage:{input:n.tokenUsage.input,output:n.tokenUsage.output+512,cached:n.tokenUsage.cached+96}}:n)),n.streams=n.streams.map(t=>t.threadId===e&&t.turnId===f.turn.id?{...t,visible:t.total}:t)})},2800);return a.current.push(p),e},[o]),u=(0,F.useMemo)(()=>({createThread:async(e,t)=>await s(async()=>await i.current.createThread(e,{cwd:t?.cwd}),async()=>await c(e,t),{preferLive:!0,fallbackOnLiveError:!1}),refreshThreads:async()=>await s(async()=>{await i.current.refreshThreads().catch(()=>void 0)},async()=>void 0,{preferLive:!0,fallbackOnLiveError:!1}),resumeThread:async e=>await s(async()=>{let t=i.current;await t.resumeThread(e).catch(()=>void 0),await t.ensureThreadLoaded(e).catch(()=>void 0)},async()=>void 0,{preferLive:!0,fallbackOnLiveError:!1}),interruptTurn:async e=>await s(async()=>await i.current.interruptTurn(e),async()=>{let t=!1;return o(n=>{n.threads=jd(n.threads.map(r=>{if(r.thread.id!==e)return r;let i=[...r.thread.turns].reverse().find(e=>e.status===`inProgress`);return i?(t=!0,wf(n,e,i.id),{...r,thread:{...r.thread,status:{type:`idle`},turns:r.thread.turns.map(e=>e.id===i.id?{...e,status:`interrupted`}:e)}}):r}))}),t}),sendComposer:async e=>await s(async()=>await i.current.sendComposer(e),async()=>await l(e),{preferLive:!0,fallbackOnLiveError:!1}),applySteer:async e=>await s(async()=>await i.current.applySteer(e),async()=>{let t=!1,n={id:`steer:${e.threadId}:${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,turnId:``,prompt:e.prompt.trim()||`Steer applied`,createdAt:Date.now(),status:`applied`};return o(r=>{r.threads=r.threads.map(r=>{if(r.thread.id!==e.threadId)return r;let i=[...r.thread.turns].reverse().find(e=>e.status===`inProgress`);return i?(t=!0,n.turnId=i.id,{...r,steers:[n,...(r.steers??[]).filter(e=>e.id!==n.id)]}):r})}),t},{preferLive:!0,fallbackOnLiveError:!1}),searchMentions:async(e,t)=>await s(async()=>{await i.current.searchMentions(e,t)},async()=>{o(n=>{let r=t.trim().toLowerCase(),i=`${e.replace(/\/+$/u,``)}/`;n.mentionCatalog=gA.filter(e=>e.path.startsWith(i)).filter(e=>r?`${e.name} ${e.path}`.toLowerCase().includes(r):!0).slice(0,18)})}),loadDirectory:async e=>await s(async()=>{await i.current.loadDirectory(e)},async()=>{o(t=>{t.directoryCatalogRoot=e,t.directoryCatalog=Kd(e)})}),readFile:async e=>await s(async()=>await i.current.readFile(e),async()=>{let t=hs(e,r.current.settings.provider);if(t===`#`)throw Error(`File preview is unavailable for this path.`);let n=await fetch(t);if(!n.ok)throw Error(`Failed to read ${e}`);return await n.text()}),saveFile:async(e,t)=>await s(async()=>{await i.current.writeFile(e,t)},async()=>{throw Error(`Saving files requires a live workspace connection.`)},{preferLive:!0,fallbackOnLiveError:!1}),readGitGraph:async(e,t=80)=>await s(async()=>await i.current.readGitGraph(e,t),async()=>``),readGitStatus:async e=>await s(async()=>await i.current.readGitStatus(e),async()=>``),readWorkspaceCommitPreferences:async e=>await s(async()=>await i.current.readWorkspaceCommitPreferences(e),async()=>{throw Error(`Commit preferences require a live workspace connection.`)},{preferLive:!0,fallbackOnLiveError:!1}),writeWorkspaceCommitPreferences:async(e,t)=>await s(async()=>await i.current.writeWorkspaceCommitPreferences(e,t),async()=>{throw Error(`Commit preferences require a live workspace connection.`)},{preferLive:!0,fallbackOnLiveError:!1}),generateCommitMessage:async({cwd:e,providerId:t})=>await s(async()=>await i.current.generateCommitMessage({cwd:e,providerId:t}),async()=>{throw Error(`Commit drafting requires a live workspace connection.`)},{preferLive:!0,fallbackOnLiveError:!1}),commitWorkingTree:async({cwd:e,message:t})=>await s(async()=>await i.current.commitWorkingTree({cwd:e,message:t}),async()=>{throw Error(`Git commit requires a live workspace connection.`)},{preferLive:!0,fallbackOnLiveError:!1}),checkProviderSetup:async e=>await s(async()=>{await i.current.checkProviderSetup(e)},async()=>{o(t=>{let n=e??t.settings.provider;t.providerSetup[n]={...t.providerSetup[n],status:`error`,summary:`Setup checks require a live workspace connection.`,detail:`Reconnect Nomadex to the host bridge, then check again.`,checkedAt:`just now`}})},{preferLive:!0}),startProviderAuth:async(e,t)=>await s(async()=>{await i.current.startProviderAuth(e,t)},async()=>{o(n=>{let r=e??n.settings.provider;n.providerAuth[r]={...n.providerAuth[r],status:`error`,flow:t??n.providerAuth[r].flow,summary:`Provider sign-in requires a live workspace connection.`,detail:`Reconnect Nomadex to the host bridge, then try again.`,processId:null,updatedAt:`just now`}})},{preferLive:!0}),submitProviderAuthSecret:async(e,t)=>await s(async()=>{await i.current.submitProviderAuthSecret(e,t)},async()=>{o(t=>{let n=e??t.settings.provider;t.providerAuth[n]={...t.providerAuth[n],status:`error`,summary:`Provider sign-in requires a live workspace connection.`,detail:`Reconnect Nomadex to the host bridge, then try again.`,processId:null,updatedAt:`just now`}})},{preferLive:!0}),cancelProviderAuth:async e=>await s(async()=>{await i.current.cancelProviderAuth(e)},async()=>{o(t=>{let n=e??t.settings.provider;t.providerAuth[n]={...t.providerAuth[n],status:`idle`,summary:`No sign-in in progress.`,detail:null,authUrl:null,userCode:null,processId:null,updatedAt:`just now`}})},{preferLive:!0}),switchProviderAccount:async(e,t)=>await s(async()=>{await i.current.switchProviderAccount(e,t)},async()=>{o(n=>{let r=e??n.settings.provider;n.providerAuth[r]={...n.providerAuth[r],status:`error`,flow:t??n.providerAuth[r].flow,summary:`Provider account switching requires a live workspace connection.`,detail:`Reconnect Nomadex to the host bridge, then try again.`,processId:null,updatedAt:`just now`}})},{preferLive:!0}),updateSettings:async e=>await s(async()=>{await i.current.updateSettings(e)},async()=>{e.provider&&Go(e.provider),o(t=>{t.settings={...t.settings,...e},t.lastSavedAt=`just now`})}),toggleFeatureFlag:async e=>await s(async()=>{await i.current.toggleFeatureFlag(e)},async()=>{o(t=>{t.featureFlags=t.featureFlags.map(t=>t.name===e?{...t,enabled:!t.enabled}:t),t.lastSavedAt=`just now`})}),toggleInstalledSkill:async e=>await s(async()=>{await i.current.toggleInstalledSkill(e)},async()=>{o(t=>{t.installedSkills=t.installedSkills.map(t=>t.id===e?{...t,enabled:!t.enabled}:t)})}),installSkill:async e=>await s(async()=>{await i.current.installSkill(e)},async()=>{o(t=>{let n=t.remoteSkills.find(t=>t.id===e);n&&(t.installedSkills=[{...n,path:`/home/allan/.codex/skills/${n.name}/SKILL.md`,enabled:!0,source:`installed`},...t.installedSkills],t.remoteSkills=t.remoteSkills.filter(t=>t.id!==e))})}),toggleMcpAuth:async e=>await s(async()=>{await i.current.toggleMcpAuth(e)},async()=>{o(t=>{t.mcpServers=t.mcpServers.map(t=>t.name===e?{...t,authStatus:t.authStatus===`notLoggedIn`?`oAuth`:t.authStatus}:t)})}),startChatGptLogin:async()=>await s(async()=>await i.current.startChatGptLogin(),async()=>(o(e=>{e.account.loginInProgress=!0,e.account.pendingLoginId=kd(`login`),e.account.loginError=null}),`https://chatgpt.com/`)),completeChatGptLogin:async e=>await s(async()=>{let t=await fetch(Ho(r.current.settings.provider).authCompletePath,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({callbackUrl:e})}),n=await t.json().catch(()=>null);if(!t.ok)throw Error(n?.error??n?.message??`Failed to complete mobile login`);await i.current.refreshAccount()},async()=>{o(e=>{e.account={...e.account,planType:`ChatGPT Pro`,workspace:`mobile relay account`,authMode:`chatgpt`,loggedIn:!0,requiresOpenaiAuth:!1,loginInProgress:!1,pendingLoginId:null,loginError:null}})}),loginWithApiKey:async e=>await s(async()=>{await i.current.loginWithApiKey(e)},async()=>{o(e=>{e.account={...e.account,planType:`API key`,workspace:`API key session`,authMode:`apiKey`,loggedIn:!0,requiresOpenaiAuth:!1,loginInProgress:!1,pendingLoginId:null,loginError:null}})}),logoutAccount:async()=>await s(async()=>{await i.current.logoutAccount()},async()=>{o(e=>{e.account={...e.account,planType:`Signed out`,workspace:`No active account`,authMode:`signedOut`,loggedIn:!1,loginInProgress:!1,pendingLoginId:null,loginError:null,usageWindows:[],rateUsed:0,rateLimit:100,credits:`Sign in to view rate limits`}})}),refreshAccount:async()=>await s(async()=>{await i.current.refreshAccount()},async()=>void 0),cleanTerminals:async e=>await s(async()=>{await i.current.cleanTerminals(e)},async()=>{o(t=>{t.threads=t.threads.map(t=>t.thread.id===e?{...t,terminals:t.terminals.filter(e=>e.status===`running`)}:t)})}),startProjectTerminal:async(e,t)=>await s(async()=>await i.current.startProjectTerminal(e,t),async()=>{throw Error(`Interactive terminals require a live workspace connection.`)},{preferLive:!0,fallbackOnLiveError:!1}),sendTerminalInput:async(e,t,n)=>await s(async()=>{await i.current.sendTerminalInput(t,n)},async()=>{throw Error(`Interactive terminals require a live workspace connection.`)},{preferLive:!0,fallbackOnLiveError:!1}),terminateTerminal:async(e,t)=>await s(async()=>{await i.current.terminateTerminal(t)},async()=>{throw Error(`Interactive terminals require a live workspace connection.`)},{preferLive:!0,fallbackOnLiveError:!1}),resolveApproval:async(e,t)=>await s(async()=>{await i.current.resolveApproval(e,t)},async()=>{o(n=>{n.threads=n.threads.map(n=>({...n,approvals:n.approvals.map(n=>n.id===e?{...n,state:t===`accept`||t===`acceptForSession`?`approved`:`declined`}:n)}))})}),submitQuestion:async(e,t)=>await s(async()=>{await i.current.submitQuestion(e,t)},async()=>{o(n=>{n.threads=n.threads.map(n=>({...n,approvals:n.approvals.map(n=>n.id===e?{...n,state:`submitted`,detail:`${n.detail} · ${Object.values(t).flat().filter(Boolean).join(`, `)}`}:n)}))})}),submitMcp:async(e,t,n)=>await s(async()=>{await i.current.submitMcp(e,t,n)},async()=>{o(n=>{n.threads=n.threads.map(n=>({...n,approvals:n.approvals.map(n=>n.id===e?{...n,state:t===`accept`?`submitted`:`declined`}:n)}))})}),rollbackToTurn:async(e,t)=>await s(async()=>{await i.current.rollbackToTurn(e,t)},async()=>{o(n=>{n.threads=n.threads.map(n=>{if(n.thread.id!==e)return n;let r=n.thread.turns.filter(e=>e.status!==`inProgress`),i=r.findIndex(e=>e.id===t);if(i===-1)return n;let a=new Set(r.slice(i).map(e=>e.id));if(a.size===0)return n;let o=n.thread.turns.filter(e=>!a.has(e.id));return{...n,thread:{...n.thread,turns:o,updatedAt:Math.floor(Date.now()/1e3)},steers:(n.steers??[]).filter(e=>!a.has(e.turnId)),approvals:n.approvals.filter(e=>!e.turnId||!a.has(e.turnId))}})})},{preferLive:!0,fallbackOnLiveError:!1}),forkThread:async e=>{let t=r.current.threads.find(t=>t.thread.id===e),n=kd(`thread`);return o(e=>{let r=t?structuredClone(t):Cc(n,`Forked Session`,e.settings);r.thread.id=n,r.thread.name=t?`Fork of ${Yd(t)}`:`Forked Session`,r.thread.preview=t?.thread.preview??`Forked session`,r.thread.createdAt=Math.floor(Date.now()/1e3),r.thread.updatedAt=Math.floor(Date.now()/1e3),r.thread.status={type:`idle`},r.approvals=[],r.terminals=[],e.threads=jd([r,...e.threads.filter(e=>e.thread.id!==n)])}),n},compactThread:async e=>{o(t=>{t.threads=t.threads.map(t=>{if(t.thread.id!==e)return t;let n=[...t.thread.turns];if(n.length===0)return t;let r=n[n.length-1];return r.items.some(e=>e.type===`contextCompaction`)||(r.items=[...r.items,{type:`contextCompaction`,id:kd(`compact`)}]),{...t,plan:t.plan?{...t.plan,explanation:`Conversation compacted to free context.`}:t.plan,thread:{...t.thread,turns:n}}})})}}),[c,o,l,s]);return(0,I.jsx)(mA.Provider,{value:{snapshot:t,actions:u},children:e})}function RA(){return(0,I.jsx)(zA,{})}function zA(){let{snapshot:e,actions:t}=IA(),n=Na(),r=Ta({select:e=>e.location}),i=zd(r.pathname),a=(0,F.useMemo)(()=>{let e=r.pathname.split(`/`).filter(Boolean);return e[0]!==`threads`||!e[1]||!e[2]||gd(e[2])?null:e[2]},[r.pathname]),o=(0,F.useMemo)(()=>new URLSearchParams(r.search),[r.search]),s=(0,F.useMemo)(()=>{let t=new Map;return e.threads.forEach(e=>{let n=t.get(e.thread.id);(!n||e.thread.updatedAt>=n.thread.updatedAt)&&t.set(e.thread.id,e)}),jd([...t.values()])},[e.threads]),c=(0,F.useMemo)(()=>{let e={};return s.forEach(t=>{e[t.thread.id]=Yd(t)}),e},[s]),l=i.threadId??s[0]?.thread.id??null,u=l?s.find(e=>e.thread.id===l)??null:null,d=u?c[u.thread.id]??Vd(u.thread):`New Session`,f=Id(i.section),[p,m]=(0,F.useState)(()=>Ad()),h=i.section===`editor`?o.get(`path`):null,g=(0,F.useMemo)(()=>{let e=i.section===`editor`?o.get(`line`):null;if(!e)return null;let t=Number(e);return Number.isFinite(t)&&t>0?t:null},[i.section,o]),_=(0,F.useMemo)(()=>{let e=i.section===`editor`?o.get(`from`):null;switch(e){case`ops`:case`review`:case`agents`:case`skills`:case`mcp`:case`settings`:case`chat`:return e;default:return`chat`}},[i.section,o]),v=i.section===`review`?o.get(`diff`):null,y=(0,F.useMemo)(()=>{let e=i.section===`review`?o.get(`from`):null;switch(e){case`ops`:case`agents`:case`skills`:case`mcp`:case`settings`:case`chat`:return e;default:return`chat`}},[i.section,o]),[b,x]=(0,F.useState)(!1),[S,C]=(0,F.useState)(()=>Ad()),[w,T]=(0,F.useState)(!1),[E,D]=(0,F.useState)(f??`files`),[O,k]=(0,F.useState)(!1),[ee,te]=(0,F.useState)(!1),[ne,A]=(0,F.useState)(!1),[j,re]=(0,F.useState)(!1),[ie,ae]=(0,F.useState)(!1),[oe,se]=(0,F.useState)(!1),[M,ce]=(0,F.useState)(hA.directoryCatalogRoot||`.`),[le,ue]=(0,F.useState)(``),[de,fe]=(0,F.useState)(`chat`),[pe,me]=(0,F.useState)(!1),[he,ge]=(0,F.useState)(!1),[_e,ve]=(0,F.useState)(!1),[ye,be]=(0,F.useState)(!1),[xe,Se]=(0,F.useState)(!1),[Ce,we]=(0,F.useState)([]),[Te,N]=(0,F.useState)([]),[Ee,De]=(0,F.useState)([]),[Oe,ke]=(0,F.useState)([]),[Ae,je]=(0,F.useState)(l?[l,...e.threads.slice(1,2).map(e=>e.thread.id)]:[]),[Me,Ne]=(0,F.useState)(``),[Pe,Fe]=(0,F.useState)(null),[Ie,P]=(0,F.useState)(``),[Le,Re]=(0,F.useState)(0),[ze,Be]=(0,F.useState)({}),[Ve,He]=(0,F.useState)([]),[Ue,We]=(0,F.useState)(null),[Ge,Ke]=(0,F.useState)(null),[qe,Je]=(0,F.useState)(null),[Ye,Xe]=(0,F.useState)(!1),[Ze,Qe]=(0,F.useState)(null),[$e,et]=(0,F.useState)({}),[tt,nt]=(0,F.useState)({}),[rt,it]=(0,F.useState)({}),at=(0,F.useRef)(null),ot=(0,F.useRef)(null),[st,ct]=(0,F.useState)(!1),[lt,ut]=(0,F.useState)(null),[dt,ft]=(0,F.useState)(!1),[pt,mt]=(0,F.useState)(null),[ht,gt]=(0,F.useState)(0),[_t,vt]=(0,F.useState)(e.settings.provider),[yt,bt]=(0,F.useState)(null),[xt,St]=(0,F.useState)(``),[Ct,wt]=(0,F.useState)(!1),[Tt,Et]=(0,F.useState)(!1),[Dt,Ot]=(0,F.useState)({top:52,right:12}),[kt,At]=(0,F.useState)(0);(0,F.useEffect)(()=>{!a||!i.threadId||n({to:`/threads/$threadId`,params:{threadId:i.threadId},replace:!0})},[a,n,i.threadId]);let[jt,Mt]=(0,F.useState)(()=>{if(typeof window>`u`)return yd;let e=window.localStorage.getItem(bd);return Dd(e)?e:yd}),Nt=(0,F.useRef)(null),Pt=(0,F.useRef)(null),Ft=(0,F.useRef)(null),It=(0,F.useRef)(null),Lt=(0,F.useRef)(null),Rt=(0,F.useRef)(null),zt=(0,F.useRef)(null),Bt=(0,F.useRef)({}),Vt=(0,F.useRef)({}),Ht=(0,F.useRef)({}),Ut=(0,F.useRef)(null),Wt=(0,F.useRef)(le),Gt=(0,F.useRef)({}),Kt=(0,F.useRef)(!1),qt=(0,F.useRef)(``),Jt=(0,F.useRef)(``),Yt=(0,F.useRef)(null),Xt=(0,F.useRef)(null),Zt=(0,F.useRef)(null),Qt=(0,F.useRef)(!0),$t=(0,F.useRef)({}),en=(0,F.useRef)({}),[tn,nn]=(0,F.useState)({}),[rn,an]=(0,F.useState)(0),[on,sn]=(0,F.useState)(!1),cn=(0,F.useDeferredValue)(le),ln=(0,F.useDeferredValue)(Ie);(0,F.useEffect)(()=>{Wt.current=le},[le]);let[un,dn]=(0,F.useState)(!0);(0,F.useEffect)(()=>()=>{Ut.current!==null&&window.cancelAnimationFrame(Ut.current)},[]),(0,F.useEffect)(()=>{let e=()=>{m(e=>{let t=Ad();return e===t?e:t})};return e(),window.addEventListener(`resize`,e,{passive:!0}),()=>{window.removeEventListener(`resize`,e)}},[]);let fn=(0,F.useCallback)(()=>{let e=Lt.current?.getBoundingClientRect();Ot({top:(e?.bottom??48)+4,right:Math.max(12,window.innerWidth-(e?.right??window.innerWidth-12))})},[]);(0,F.useEffect)(()=>{if(typeof document>`u`)return;let e=Od(jt),t=document.documentElement;t.dataset.uiTheme=e.id,t.style.setProperty(`color-scheme`,e.mode),window.localStorage.setItem(bd,jt),document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,e.themeColor),document.querySelector(`meta[name="color-scheme"]`)?.setAttribute(`content`,e.mode),document.querySelector(`meta[name="apple-mobile-web-app-status-bar-style"]`)?.setAttribute(`content`,e.mode===`light`?`default`:`black-translucent`)},[jt]),(0,F.useLayoutEffect)(()=>{if(!ee)return;let e=()=>{fn()};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[ee,fn]);let pn=(0,F.useMemo)(()=>{let e=new Set(s.map(e=>e.thread.id));return[...new Set(Ae.filter(t=>e.has(t)))].slice(0,6)},[Ae,s]),L=(0,F.useMemo)(()=>Nd(u?.thread.turns??[]),[u?.thread.turns]),mn=(0,F.useMemo)(()=>Math.max(0,L.length-_A),[L.length]),hn=(0,F.useMemo)(()=>{if(!l)return mn;let e=$e[l];if(e==null)return mn;let t=L.length===0?0:Math.max(0,L.length-1);return Math.max(0,Math.min(e,t))},[mn,l,L.length,$e]),gn=(0,F.useMemo)(()=>L.slice(hn),[L,hn]),_n=(0,F.useMemo)(()=>L.map(e=>`${e.id}:${e.status}:${e.items.length}:${e.error?.message??``}`).join(`|`),[L]),vn=[...L].reverse().find(e=>e.status===`inProgress`)??null,yn=(0,F.useMemo)(()=>h?yf(h):null,[h]),bn=(0,F.useMemo)(()=>{if(!yn)return null;let e=u?.thread.cwd?yf(u.thread.cwd).replace(/\/+$/u,``):null;return e&&yn.startsWith(`${e}/`)?yn.slice(e.length+1):null},[u?.thread.cwd,yn]),xn=(0,F.useMemo)(()=>{if(i.section!==`editor`||!yn)return``;let e=new Set([yn,bn].filter(e=>!!e));return L.flatMap(t=>_s(t).filter(t=>e.has(yf(t.path))).map(e=>`${t.id}:${e.itemId}:${e.path}:${e.kind}:${e.status}:${t.status}`)).join(`|`)},[L,yn,bn,i.section]),Sn=l?ze[l]??[]:[],Cn=(0,F.useMemo)(()=>vs(vn),[vn]),wn=(0,F.useMemo)(()=>_s(vn),[vn]),Tn=!w&&S&&i.section!==`editor`&&i.section!==`review`,En=Tn&&!p,Dn=p||b,On=!p&&En,kn=O||ne||j||ie,An=(0,F.useMemo)(()=>u?.approvals.filter(e=>e.state===`pending`).length??0,[u?.approvals]),jn=(0,F.useMemo)(()=>u?.approvals.filter(e=>e.state===`pending`)??[],[u?.approvals]),Mn=Pd(e.settings),Nn=(0,F.useMemo)(()=>{let e=u?.thread.cwd??null;return e?!Ge||!qd(e,Ge)?e:Ge:null},[u?.thread.cwd,Ge]),Pn=(0,F.useMemo)(()=>({...e.settings,collaborationMode:he?`plan`:`default`}),[e.settings,he]);(0,F.useEffect)(()=>{let t=new Set(e.threads.flatMap(e=>e.approvals.filter(e=>e.kind===`question`&&e.state===`pending`).map(e=>e.id)));nt(e=>{let n=Object.entries(e).filter(([e])=>t.has(e));return n.length===Object.keys(e).length?e:Object.fromEntries(n)})},[e.threads]),(0,F.useEffect)(()=>{let t=new Set(e.threads.flatMap(e=>e.approvals.filter(e=>e.kind===`mcp`&&e.state===`pending`).map(e=>e.id)));it(e=>{let n=Object.entries(e).filter(([e])=>t.has(e));return n.length===Object.keys(e).length?e:Object.fromEntries(n)})},[e.threads]);let Fn=(0,F.useMemo)(()=>{let e={Today:[],Yesterday:[],Earlier:[]};return s.forEach(t=>{e[Bd(t.thread.updatedAt)].push(t)}),e},[s]),In=(0,F.useMemo)(()=>e.providers.find(t=>t.id===e.settings.provider)??Ho(e.settings.provider),[e.providers,e.settings.provider]),Ln=(0,F.useMemo)(()=>Zo(In.id,e.models.length>0?e.models:hA.models),[In.id,e.models]),Rn=(0,F.useMemo)(()=>Qo(In.id,e.settings.model,e.models.length>0?e.models:hA.models),[In.id,e.settings.model,e.models]),zn=`${In.displayName} · ${Rn?.displayName??(e.settings.model===`default`?`provider default`:e.settings.model)}`,Bn=(0,F.useMemo)(()=>Od(jt),[jt]),Vn=(0,F.useMemo)(()=>L.flatMap(e=>e.items.filter(e=>e.type===`fileChange`)),[L]),Hn=(0,F.useMemo)(()=>L.flatMap(e=>e.items.flatMap(e=>e.type===`fileChange`?(e.changes.length>0?e.changes:[{path:`Editing files`,kind:{type:`update`,move_path:null},diff:``}]).map((t,n)=>{let r=xf(t.diff);return{id:vf(e.id,n,t.path),itemId:e.id,path:t.path,diff:t.diff,kind:t.kind,status:e.status,additions:r.additions,removals:r.removals,hunks:r.hunks}}):[])).reverse(),[L]),Un=(0,F.useMemo)(()=>s.filter(e=>e.thread.cwd===u?.thread.cwd),[u?.thread.cwd,s]),Wn=(0,F.useMemo)(()=>u?.thread.cwd?.trim()||e.directoryCatalogRoot||null,[u?.thread.cwd,e.directoryCatalogRoot]),Gn=(0,F.useMemo)(()=>Hn.find(e=>e.id===Ze)??Hn[0]??null,[Hn,Ze]);(0,F.useEffect)(()=>{if(!u){vt(e.settings.provider),bt(null),St(``);return}if(!Wn){vt(e.settings.provider),bt(null);return}let n=!1;return St(``),t.readWorkspaceCommitPreferences(Wn).then(e=>{n||(vt(e.provider),bt(e.filePath))}).catch(()=>{n||(vt(e.settings.provider),bt(null))}),()=>{n=!0}},[t,u,Wn,e.settings.provider]),(0,F.useEffect)(()=>{if(!u){ut(null),ft(!1),mt(null);return}let e=Ks({activeThread:u,relatedThreads:Un});if(ut(e),mt(null),E!==`graph`){ft(!1);return}let n=`${u.thread.cwd}:${u.thread.gitInfo?.sha??`workspace`}`,r=Gt.current[n]??``,i=!1;return ft(!0),Promise.allSettled([r?Promise.resolve(r):t.readGitGraph(u.thread.cwd,80),t.readGitStatus(u.thread.cwd)]).then(([t,r])=>{if(i)return;let a=t.status===`fulfilled`?t.value:``,o=r.status===`fulfilled`?r.value:``,s=Ks({activeThread:u,relatedThreads:Un,rawStatus:o}),c=(a.trim().length>0?Gs({activeThread:u,rawLog:a,rawStatus:o}):null)??s??e;a.trim().length>0&&(Gt.current[n]=a),mt(t.status===`rejected`?FA(t.reason,`Unable to read git history.`):null),ut(c)}).finally(()=>{i||ft(!1)}),()=>{i=!0}},[t,u,ht,E,Un]);let Kn=lt?.workingTree??null,qn=!!Kn?.dirty||Vn.some(e=>e.status!==`failed`),Jn=!!Kn?.buckets.some(e=>e.id===`staged`&&e.entries.length>0),Yn=lt?.branchLabel||u?.thread.gitInfo?.branch||`current branch`,Xn=(0,F.useMemo)(()=>{if(!u)return[];if(!Gn)return u.review;let e=yf(Gn.path);return u.review.filter(t=>{let n=yf(t.file);return n===e||n.endsWith(`/${e}`)})},[u,Gn]),Zn=(0,F.useMemo)(()=>e.directoryCatalogRoot===M?e.directoryCatalog.filter(e=>e.kind===`directory`):[],[M,e.directoryCatalog,e.directoryCatalogRoot]),Qn=(0,F.useMemo)(()=>OA(M),[M]),$n=(0,F.useMemo)(()=>kA(M),[M]),er=(0,F.useMemo)(()=>L.flatMap(e=>e.items.filter(e=>e.type===`collabAgentToolCall`)),[L]),tr=(0,F.useMemo)(()=>{for(let e of[...L].reverse())for(let t of[...e.items].reverse())if(t.type===`agentMessage`)return t;return null},[L]),nr=(0,F.useMemo)(()=>{if(Pe===`mention`){let t=Ie.replace(/^@/u,``).trim().toLowerCase(),n=u&&e.directoryCatalogRoot===u.thread.cwd?e.directoryCatalog.filter(e=>t?`${e.name} ${e.path}`.toLowerCase().includes(t):!0):[],r=new Map;return[...n,...e.mentionCatalog].forEach(e=>{r.has(e.path)||r.set(e.path,e)}),[...r.values()].slice(0,24).map(e=>({id:e.id,label:e.name,description:Hd(e.path,92),mode:`mention`,value:e.path}))}return Pe===`skill`?[...e.installedSkills,...e.remoteSkills].map(e=>({id:e.id,label:`$${e.name}`,description:e.description,mode:`skill`,value:e.name})):Td.map(e=>({id:e.cmd,label:e.cmd,description:e.dsc,mode:`slash`,value:e.cmd}))},[u,Pe,Ie,e.directoryCatalog,e.directoryCatalogRoot,e.installedSkills,e.mentionCatalog,e.remoteSkills]),rr=(0,F.useMemo)(()=>{let e=ln.trim().toLowerCase();return e?nr.filter(t=>`${t.label} ${t.description}`.toLowerCase().includes(e)).slice(0,12):nr.slice(0,12)},[ln,nr]);(0,F.useEffect)(()=>{if(!l)return;let e=window.requestAnimationFrame(()=>{je(e=>e.includes(l)?e:[l,...e.filter(e=>e!==l)].slice(0,6))});return()=>{window.cancelAnimationFrame(e)}},[l]),(0,F.useLayoutEffect)(()=>{l&&Yt.current!==l&&(delete $t.current[l],et(e=>{if(!(l in e))return e;let t={...e};return delete t[l],t}),Qt.current=!0,Xt.current=null,Zt.current=null)},[l]);let ir=(0,F.useMemo)(()=>e.transport.mode===`live`&&e.transport.status===`connected`&&!!u&&hf(u,L),[u,L,e.transport.mode,e.transport.status]),ar=(0,F.useMemo)(()=>{if(!i.threadId||e.transport.mode!==`live`)return!1;if(e.transport.status===`connecting`)return!0;if(e.transport.status!==`connected`)return!1;if(!u||u.thread.id!==i.threadId){let t=e.threads.some(e=>e.thread.id===i.threadId);return e.threads.length===0||t}return hf(u,L)},[u,L,i.threadId,e.threads,e.transport.mode,e.transport.status]),or=(0,F.useMemo)(()=>i.threadId===u?.thread.id&&ir,[ir,u?.thread.id,i.threadId]);(0,F.useEffect)(()=>{if(un){if(e.transport.status===`connecting`){Kt.current=!0;return}Kt.current&&(ar||dn(!1))}},[ar,un,e.transport.status]);let sr=(0,F.useCallback)(()=>{an(e=>e+1)},[]),cr=(0,F.useCallback)((e,t,r=`chat`)=>{!e||!t||e===t||(je(n=>{let r=n.map(n=>n===e?t:n);return r.includes(t)||r.unshift(t),[...new Set(r)].slice(0,6)}),Be(n=>{let r=n[e]??[];if(r.length===0)return n;let i={...n};return delete i[e],i[t]=[...r,...i[t]??[]],i}),Bt.current[e]&&(Bt.current[t]=Bt.current[e],delete Bt.current[e]),Vt.current[e]&&(Vt.current[t]=Vt.current[e],delete Vt.current[e]),$t.current[e]&&($t.current[t]=$t.current[e],delete $t.current[e]),Yt.current===e&&(Yt.current=t),Xt.current?.threadId===e&&(Xt.current={...Xt.current,threadId:t}),et(n=>{if(!(e in n))return n;let r={...n};return r[t]=r[e]??r[t]??0,delete r[e],r}),i.threadId===e&&n(r===`chat`?{to:`/threads/$threadId`,params:{threadId:t}}:{to:`/threads/$threadId/$section`,params:{threadId:t,section:hd(r)}}),sr())},[n,sr,i.threadId]),lr=(0,F.useCallback)(async(e,n=`chat`)=>{try{let r=await t.sendComposer(e);return cr(e.threadId,r,n),r}catch(t){let r=fA(t);throw r&&cr(e.threadId,r,n),t}},[t,cr]),ur=(0,F.useCallback)((e,t,n)=>{nt(r=>({...r,[e]:{...r[e]??{},[t]:n}}))},[]),dr=(0,F.useCallback)(async e=>{let n=pA(e,tt[e.id]??{});await t.submitQuestion(e.id,n),nt(t=>{if(!(e.id in t))return t;let n={...t};return delete n[e.id],n})},[t,tt]),fr=(0,F.useCallback)((e,t)=>{it(n=>({...n,[e]:t}))},[]),pr=(0,F.useCallback)(async(e,n)=>{await t.resolveApproval(e.id,n)},[t]),mr=(0,F.useCallback)(async(e,n)=>{await t.submitMcp(e.id,n,rt[e.id]??``),it(t=>{if(!(e.id in t))return t;let n={...t};return delete n[e.id],n})},[t,rt]),hr=(0,F.useCallback)(e=>e.kind===`question`?(0,I.jsx)(YS,{answers:tt[e.id]??{},approval:e,onAnswerChange:(t,n)=>ur(e.id,t,n),onSubmit:()=>void dr(e)},e.id):(0,I.jsx)(US,{approval:e,mcpContentText:rt[e.id]??``,onMcpContentChange:t=>fr(e.id,t),onResolve:t=>void pr(e,t),onSubmitMcp:t=>void mr(e,t)},e.id),[rt,tt,pr,mr,dr,fr,ur]);(0,F.useEffect)(()=>{if(!i.threadId||e.transport.mode!==`live`||e.transport.status!==`connected`||u&&u.thread.id===i.threadId&&!hf(u,L))return;let n=i.threadId,r=0,a=()=>{r+=1,t.resumeThread(n)};a();let o=window.setInterval(()=>{if(r>=5){window.clearInterval(o);return}a()},1200);return()=>{window.clearInterval(o)}},[t,u,L,i.threadId,e.transport.mode,e.transport.status]),(0,F.useEffect)(()=>{if(un||i.threadId||e.transport.mode!==`live`||e.transport.status!==`connected`){sn(!1);return}if(s.length>0){sn(!0);return}let n=!1,r=0,a=0;sn(!1);let o=()=>{a+=1,t.refreshThreads().finally(()=>{if(!n){if(a>=4){sn(!0);return}r=window.setTimeout(o,700)}})};return o(),()=>{n=!0,window.clearTimeout(r)}},[i.threadId,t,un,e.transport.mode,e.transport.status,s.length]),(0,F.useEffect)(()=>{if(i.section!==`review`)return;let e=v&&Hn.some(e=>e.id===v)?v:Hn[0]?.id??null;Qe(t=>t===e?t:e)},[Hn,v,i.section]),(0,F.useEffect)(()=>{if(!Ze||!Hn.some(e=>e.id===Ze)){let e=window.requestAnimationFrame(()=>{Qe(Hn[0]?.id??null)});return()=>{window.cancelAnimationFrame(e)}}},[Hn,Ze]),(0,F.useEffect)(()=>{e.transport.mode===`live`&&e.transport.status!==`connected`||Object.entries(ze).forEach(([t,n])=>{if(n.length===0||Bt.current[t])return;let r=e.threads.find(e=>e.thread.id===t)?.thread.turns.some(e=>e.status===`inProgress`)??!1;if(Vt.current[t]){if(r)return;delete Vt.current[t]}if(r)return;let[i]=n;i&&(Bt.current[t]=!0,Be(e=>{let n=e[t]??[];if(n[0]?.id!==i.id)return e;let r=n.slice(1);if(r.length===0){let n={...e};return delete n[t],n}return{...e,[t]:r}}),lr({threadId:t,mode:i.mode,prompt:i.prompt,mentions:i.mentions,skills:i.skills,images:i.images,files:i.files,settings:Pn}).then(e=>{Vt.current[e]=!0}).catch(e=>{let n=fA(e)??t;Be(e=>({...e,[n]:[i,...e[n]??[]]})),sr()}).finally(()=>{delete Bt.current[t]}))})},[Pn,ze,rn,sr,lr,e.threads,e.transport.mode,e.transport.status]),(0,F.useEffect)(()=>{let e=()=>{typeof document<`u`&&document.visibilityState!==`visible`||sr()},t=()=>{document.visibilityState===`visible`&&sr()};return window.addEventListener(`focus`,e),document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(`focus`,e),document.removeEventListener(`visibilitychange`,t)}},[sr]),(0,F.useLayoutEffect)(()=>{if(i.section===`editor`||i.section===`review`){C(!1);return}if(!p&&w){C(!1);return}if(!f){p||C(!1);return}D(e=>e===f||f===`files`&&e===`graph`?e:f),C(e=>e||!0)},[p,w,i.section,f]),(0,F.useEffect)(()=>{w&&(p||!f)&&T(!1)},[p,w,f]),(0,F.useEffect)(()=>{if(!u||Pe!==`mention`)return;e.directoryCatalogRoot!==u.thread.cwd&&t.loadDirectory(u.thread.cwd);let n=ln.replace(/^@/,``).trim();n&&t.searchMentions(u.thread.cwd,n)},[t,u,ln,Pe,e.directoryCatalogRoot]),(0,F.useEffect)(()=>{let e=u?.thread.cwd;if(!e)return;let t=window.requestAnimationFrame(()=>{Ke(t=>t&&qd(e,t)?t:e),Je(t=>t&&qd(e,t.path)?t:null)});return()=>{window.cancelAnimationFrame(t)}},[u?.thread.cwd]),(0,F.useEffect)(()=>{Nn&&t.loadDirectory(Nn)},[t,Nn]),(0,F.useEffect)(()=>{j&&t.loadDirectory(M)},[t,j,M]),(0,F.useEffect)(()=>{if(i.section!==`editor`||!h||qe?.path===h&&!qe.loading&&qe.error===null)return;let e=h.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??h,n=!1;return t.readFile(h).then(t=>{n||(0,F.startTransition)(()=>{Je({path:h,name:e,content:t,loading:!1,error:null,line:g})})}).catch(t=>{n||Je({path:h,name:e,content:``,loading:!1,error:t instanceof Error?t.message:`Unable to open this file.`,line:g})}),()=>{n=!0}},[t,g,h,qe,i.section]),(0,F.useEffect)(()=>{if(i.section!==`editor`||!h){Jt.current=``,qt.current=``,Xe(!1);return}let e=`${i.section}:${h}`;Jt.current!==e&&(Jt.current=e,qt.current=xn,Xe(!1))},[xn,h,i.section]),(0,F.useEffect)(()=>{if(i.section!==`editor`||!h||!xn||Ye||qe?.path!==h||qe.loading||qt.current===xn)return;qt.current=xn;let e=h.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??h,n=qe.content,r=!1,a=null,o=async i=>{try{let e=await t.readFile(h);if(r)return;if(i&&e===n){a=window.setTimeout(()=>{o(!1)},160);return}(0,F.startTransition)(()=>{Je(t=>t?.path===h?{...t,content:e,loading:!1,error:null,line:g}:t)})}catch(t){if(r)return;Je({path:h,name:e,content:n,loading:!1,error:t instanceof Error?t.message:`Unable to refresh this file.`,line:g})}};return o(!0),()=>{r=!0,a!==null&&window.clearTimeout(a)}},[t,xn,Ye,g,h,qe,i.section]),(0,F.useEffect)(()=>{let t=e.transport.mode===`live`,n=e.streams;if(t){let e=window.requestAnimationFrame(()=>{let e={};for(let t of n){let n=Cf(t);e[t.key]=n}en.current=e,(0,F.startTransition)(()=>{nn(e)})});return()=>{window.cancelAnimationFrame(e)}}let r=window.requestAnimationFrame(()=>{let e=en.current,t=Object.keys(e).length!==n.length,r={};for(let i of n){let n=Cf(i),a=Math.min(e[i.key]??0,n);r[i.key]=a,(e[i.key]??void 0)!==a&&(t=!0)}t&&(en.current=r,(0,F.startTransition)(()=>{nn(r)}))}),i=window.setInterval(()=>{let e=en.current,t={},r=Object.keys(e).length!==n.length;for(let i of n){let n=Cf(i),a=Math.min(e[i.key]??0,n),o=n-a,s=Math.max(1,i.speed,Math.ceil(o/5)),c=a<n?Math.min(n,a+s):a;t[i.key]=c,c!==a&&(r=!0)}r&&(en.current=t,(0,F.startTransition)(()=>{nn(t)}))},24);return()=>{window.cancelAnimationFrame(r),window.clearInterval(i)}},[e.streams,e.transport.mode]);let gr=(0,F.useCallback)(e=>e.scrollHeight-e.scrollTop-e.clientHeight<=72,[]),_r=(0,F.useCallback)((e=l)=>{let t=Nt.current;if(!t||!e)return;let n=gr(t);Qt.current=n,ct(e=>e===!n?e:!n),$t.current[e]={pinned:n,top:t.scrollTop}},[l,gr]),vr=(0,F.useCallback)(()=>{if(!l||hn<=0||or)return;let e=Nt.current;e&&Xt.current?.threadId!==l&&(Xt.current={threadId:l,previousHeight:e.scrollHeight,previousTop:e.scrollTop},et(e=>{let t=e[l]??mn,n=Math.max(0,t-vA);return n===t?(Xt.current=null,e):{...e,[l]:n}}))},[mn,l,hn,or]),yr=(0,F.useCallback)((e=!1)=>{let t=Nt.current;t&&(!e&&!Qt.current||(t.scrollTop=t.scrollHeight,Qt.current=!0,ct(!1),l&&($t.current[l]={pinned:!0,top:t.scrollTop})))},[l]);(0,F.useEffect)(()=>{let e=Nt.current;if(!e||!l||i.section===`editor`||i.section===`review`)return;let t=()=>{let t=gr(e);Qt.current=t,ct(e=>e===!t?e:!t),$t.current[l]={pinned:t,top:e.scrollTop}};t();let n=()=>{t(),e.scrollTop<=48&&vr()};return e.addEventListener(`scroll`,n,{passive:!0}),()=>{t(),e.removeEventListener(`scroll`,n)}},[l,gr,vr,i.section]);let br=(0,F.useCallback)(e=>{let t=null,n=null,r=0,i=()=>{yr(e?.force??!1);let n=Nt.current;if(!n)return;let a=n.scrollHeight-n.scrollTop-n.clientHeight;r+=1,a>2&&r<8&&(t=window.requestAnimationFrame(i))};return t=window.requestAnimationFrame(i),n=e?.extraDelay?window.setTimeout(i,90):null,()=>{t!==null&&window.cancelAnimationFrame(t),n!==null&&window.clearTimeout(n)}},[yr]);(0,F.useLayoutEffect)(()=>{Nt.current&&yr()},[yr,tn,_n]),(0,F.useLayoutEffect)(()=>{if(!l||i.section===`editor`||i.section===`review`)return;let e=Yt.current===l?$t.current[l]:void 0;Qt.current=e?.pinned??!0,ct(!(e?.pinned??!0))},[l,i.section]),(0,F.useLayoutEffect)(()=>{if(!l||i.section===`editor`||i.section===`review`)return;let e=()=>{let e=Nt.current;if(!e)return;let t=Yt.current===l,n=t?$t.current[l]:void 0;if(!t){yr(!0);return}if(!n){Yt.current=null,yr(!0);return}if(n.pinned){Yt.current=null,yr(!0);return}let r=Math.max(0,e.scrollHeight-e.clientHeight);e.scrollTop=Math.min(n.top,r),Yt.current=null,_r(l)};e();let t=window.requestAnimationFrame(e),n=window.setTimeout(e,90);return()=>{window.cancelAnimationFrame(t),window.clearTimeout(n)}},[l,yr,i.section,_r]),(0,F.useLayoutEffect)(()=>{let e=Xt.current;if(!e||e.threadId!==l)return;let t=Nt.current;if(!t)return;let n=t.scrollHeight-e.previousHeight;t.scrollTop=e.previousTop+n,Xt.current=null,_r(l)},[l,gn.length,_r]),(0,F.useEffect)(()=>()=>{i.section===`editor`||i.section===`review`||_r(l)},[l,i.section,_r]),(0,F.useEffect)(()=>{if(!l){ct(!1),Zt.current=null;return}if(or||L.length===0){Zt.current=null;return}let e=`${l}:${L.at(-1)?.id??`empty`}:${L.length}`;if(Zt.current!==e)return Zt.current=e,br({extraDelay:!0,force:!0})},[l,L,or,br]);let xr=(0,F.useCallback)(()=>{br({extraDelay:!0,force:!0})},[br]);(0,F.useEffect)(()=>()=>Ee.forEach(e=>e.url.startsWith(`blob:`)&&URL.revokeObjectURL(e.url)),[Ee]);let R=(0,F.useCallback)((e,t)=>{let n=kd(`toast`);He(r=>[...r,{id:n,message:e,tone:t}]);let r=window.setTimeout(()=>{He(e=>e.filter(e=>e.id!==n)),delete Ht.current[n]},2600);Ht.current[n]=r},[]),Sr=(0,F.useCallback)(()=>{Gt.current={},gt(e=>e+1)},[]),Cr=(0,F.useCallback)(async()=>{Sr(),Qe(null);let e=Nn??Wn;if(e)try{await t.loadDirectory(e)}catch{Wn&&Wn!==e&&(Ke(Wn),await t.loadDirectory(Wn).catch(()=>void 0))}h&&Je({path:h,name:h.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??h,content:``,loading:!0,error:null,line:g})},[t,Nn,Wn,g,h,Sr]),wr=(0,F.useCallback)(async e=>{let n=_t;if(vt(e),u){if(!Wn){vt(n),R(`Open the repository folder first.`,`warn`);return}try{bt((await t.writeWorkspaceCommitPreferences(Wn??u.thread.cwd,{provider:e})).filePath),Sr()}catch(e){vt(n),R(FA(e,`Failed to save the commit provider for this project.`),`err`)}}},[t,u,Wn,_t,R,Sr]),Tr=(0,F.useCallback)(async()=>{if(!(!u||Ct||Tt)){if(!Wn){R(`Open the repository folder first.`,`warn`);return}wt(!0);try{St(await t.generateCommitMessage({cwd:Wn,providerId:_t})),R(`Drafted a commit message.`,`ok`)}catch(e){R(FA(e,`Failed to draft a commit message.`),`err`)}finally{wt(!1)}}},[t,u,Wn,Tt,Ct,_t,R]),Er=(0,F.useCallback)(async()=>{if(!(!u||Ct||Tt)){if(!Wn){R(`Open the repository folder first.`,`warn`);return}if(!xt.trim()){R(`Enter a commit message first.`,`warn`);return}Et(!0);try{let e=await t.commitWorkingTree({cwd:Wn,message:xt});St(``),Sr(),R(e.stagedAll?`Staged all files and created the commit.`:`Created the commit.`,`ok`)}catch(e){R(FA(e,`Failed to create the commit.`),`err`)}finally{Et(!1)}}},[t,u,Wn,Tt,Ct,xt,R,Sr]),Dr=(0,F.useCallback)(e=>{let t=e;window.requestAnimationFrame(()=>{let e=Ft.current;if(!e)return;e.focus();let n=t?.length??e.value.length;try{e.setSelectionRange(n,n)}catch{}})},[]),Or=(0,F.useCallback)(()=>Ft.current?.value??le,[le]),kr=(0,F.useCallback)(e=>{let t=Or(),n=typeof e==`function`?e(t):e;return ue(n),At(e=>e+1),n},[Or]),Ar=(0,F.useCallback)(()=>{ue(``),At(e=>e+1),we([]),N([]),ke([]),De(e=>(e.forEach(e=>e.url.startsWith(`blob:`)&&URL.revokeObjectURL(e.url)),[])),Fe(null),P(``),Re(0)},[]),jr=(0,F.useCallback)((e,t)=>{let n={...t,id:kd(`queue`),mentions:[...t.mentions],skills:[...t.skills],files:[...t.files],images:[...t.images]};Be(t=>({...t,[e]:[...t[e]??[],n]}))},[]),Mr=(0,F.useCallback)((e,t)=>{Be(n=>{let r=n[e]??[],i=r.filter(e=>e.id!==t);if(i.length===r.length)return n;if(i.length===0){let t={...n};return delete t[e],t}return{...n,[e]:i}})},[]),Nr=(0,F.useCallback)((e,t)=>{Be(n=>({...n,[e]:[t,...n[e]??[]]}))},[]),z=(0,F.useCallback)((e,t=`chat`,r)=>{e!==l&&(Yt.current=null,Xt.current=null,Qt.current=!0);let i=()=>{if(t===`chat`){n({to:`/threads/$threadId`,params:{threadId:e}});return}n({to:`/threads/$threadId/$section`,params:{threadId:e,section:hd(t)}})};if(r?.immediate||l===e){i();return}(0,F.startTransition)(i)},[l,n]),Pr=(0,F.useCallback)(e=>{Yt.current=null,Xt.current=null,Zt.current=null,Qt.current=!0,ct(!1),delete $t.current[e],et(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n}),x(!1),z(e,`chat`,{immediate:!0}),e===l&&window.requestAnimationFrame(()=>{br({extraDelay:!0,force:!0})})},[l,z,br]),Fr=(0,F.useCallback)((e,t)=>{if(!l)return;let r=typeof t?.line==`number`&&t.line>0?t.line:null,i=t?.source??`chat`,a=e.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??e;_r(),i===`chat`&&(Yt.current=l),Je(t=>t?.path===e?{...t,loading:!0,error:null,line:r}:{path:e,name:a,content:``,loading:!0,error:null,line:r}),n({to:`/threads/$threadId/$section`,params:{threadId:l,section:hd(`editor`)},search:{path:e,line:r?String(r):void 0,from:i}})},[l,n,_r]),Ir=(0,F.useCallback)(e=>{if(e===`terminal`){be(!0),ve(!0);return}T(!1),D(e),C(!0),x(!1),l&&z(l,Ld(e))},[l,z]),Lr=(0,F.useCallback)(()=>{p||(T(!1),C(!1),x(e=>!e))},[p]),Rr=(0,F.useCallback)((e,t=`chat`)=>{if(!l)return;let r=e??Gn?.id??Hn[0]?.id??null;r&&Qe(r),_r(),t===`chat`&&(Yt.current=l),n({to:`/threads/$threadId/$section`,params:{threadId:l,section:hd(`review`)},search:{diff:r??void 0,from:t}})},[l,Hn,n,_r,Gn]),zr=(0,F.useCallback)(()=>{if(C(!1),l){if(!p){T(!0),window.requestAnimationFrame(()=>{z(l,`chat`,{immediate:!0})});return}z(l,`chat`,{immediate:!0})}},[l,p,z]);(0,F.useEffect)(()=>{i.section===`skills`&&ae(!0)},[i.section]);let Br=(0,F.useCallback)(()=>{ae(!0),x(!1)},[]),Vr=(0,F.useCallback)(()=>{ae(!1),i.section===`skills`&&l&&z(l,`chat`)},[l,z,i.section]),Hr=(0,F.useCallback)(()=>{A(!0),x(!1),te(!1),k(!1)},[]),Ur=(0,F.useCallback)(()=>{A(!1)},[]),Wr=(0,F.useCallback)(async n=>{if(oe)return null;se(!0);try{let e=await t.createThread(Pn,{title:`New Session`,cwd:n});return ce(n),je(t=>[e,...t.filter(t=>t!==e)].slice(0,6)),z(e,`chat`),x(!1),C(p),Ar(),R(`New session — ${n}`,`ok`),e}catch(t){return R(FA(t,e.transport.error??`Failed to start session`),`err`),null}finally{se(!1)}},[t,p,Pn,z,oe,R,Ar,e.transport.error]),Gr=(0,F.useCallback)(()=>{ce(e=>e&&e.trim().length>0?e:u?.thread.cwd??hA.directoryCatalogRoot??`.`),re(!0),x(!1),k(!1)},[u]),Kr=(0,F.useCallback)(async e=>{await Wr(e??M)&&re(!1)},[Wr,M]),qr=(0,F.useCallback)(async()=>{Gr()},[Gr]),Jr=(0,F.useCallback)(async()=>{if(!l){await qr();return}let e=await t.forkThread(l);je(t=>[e,...t.filter(t=>t!==e)].slice(0,6)),z(e,`chat`),R(`/fork — session forked`,`ok`)},[t,l,qr,z,R]),Yr=(0,F.useCallback)(async()=>{l&&(await t.compactThread(l),R(`/compact — transcript summarized`,`ok`))},[t,l,R]),[Xr,Zr]=(0,F.useState)(null),Qr=(0,F.useCallback)(async n=>{if(!l||Xr)return;if(vn){R(`Wait for the current response to finish before rolling back.`,`err`);return}if(!window.confirm(`Roll back from this prompt? This will remove this prompt and every later message, then undo the file changes from those turns.`))return;let r=L.find(e=>e.id===n)?.items.filter(e=>e.type===`userMessage`).map(t=>Jd(t,e.settings.provider)).find(e=>e.trim().length>0)??``;try{Zr(n),await t.rollbackToTurn(l,n),await Cr(),r.trim().length>0&&(fe(`chat`),kr(r),Dr(r)),R(`/rollback — reverted to selected prompt`,`ok`)}catch(e){R(FA(e,`Failed to roll back from the selected prompt.`),`err`)}finally{Zr(e=>e===n?null:e)}},[t,l,vn,L,Dr,R,Xr,Cr,kr,e.settings.provider]),$r=(0,F.useCallback)(async e=>{await t.updateSettings({model:e}),te(!1),R(`Model: ${e}`,``)},[t,R]),ei=(0,F.useCallback)(e=>{Mt(e),A(!1),R(`Theme: ${e}`,``)},[R]),ti=(0,F.useCallback)(async()=>{let e=xd[(xd.indexOf(Mn)+1)%xd.length];await t.updateSettings(Fd(e)),R(`Approval: ${Sd[e]}`,``)},[t,Mn,R]),ni=(0,F.useCallback)(()=>{Fe(null),P(``),Re(0)},[]);(0,F.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`){e.preventDefault(),k(!0),x(!1);return}if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`n`){e.preventDefault(),qr();return}if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`g`){e.preventDefault(),R(`Ctrl+G — opening editor bridge`,``);return}e.key===`Escape`&&(k(!1),te(!1),A(!1),re(!1),We(null),ni())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[ni,qr,R]),(0,F.useEffect)(()=>{let e=e=>{let t=e.target;t&&(t.closest(`#ctxmenu`)||We(null),!t.closest(`#hmodel`)&&!t.closest(`#mpicker`)&&te(!1),!t.closest(`#htheme`)&&!t.closest(`#tpicker`)&&A(!1),!t.closest(`#ta`)&&!t.closest(`#slashpop`)&&ni())};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[ni]);let ri=(0,F.useCallback)(e=>{Dr(kr(t=>t.replace(/(?:^|\s)([@$/][^\s]*)$/,t=>t.replace(/[@$/][^\s]*$/,e))))},[Dr,kr]),ii=(0,F.useCallback)(e=>{we(t=>t.some(t=>t.id===e.id||t.path===e.path)?t:[...t,e]),ni(),Dr(kr(t=>ef(t,e))),R(`/mention — ${Qd(e)} linked`,`ok`)},[ni,Dr,R,kr]),ai=(0,F.useCallback)(n=>{let r=[...e.installedSkills,...e.remoteSkills].find(e=>e.name===n);r&&(r.source===`remote`?(t.installSkill(r.id),R(`Installing $${r.name}`,`ok`)):(N(e=>e.some(e=>e.id===r.id)?e:[...e,{...r,source:`installed`}]),R(`$${r.name} attached`,`ok`)),ni(),Dr(kr(e=>e.replace(/(?:^|\s)\$[^\s]*$/,``))))},[t,ni,Dr,R,kr,e.installedSkills,e.remoteSkills]),oi=(0,F.useMemo)(()=>Ce.filter(e=>$d(cn,e)),[cn,Ce]),si=(0,F.useCallback)(async(e,n=!1)=>{let[r,...i]=e.trim().split(/\s+/),a=i.join(` `);switch(r){case`/new`:await qr();break;case`/fork`:await Jr();break;case`/compact`:await Yr();break;case`/mention`:Fe(`mention`),P(a);break;case`/model`:te(e=>!e);break;case`/permissions`:await ti();break;case`/plan`:ge(!0),R(`Plan mode enabled`,`ok`);break;case`/review`:fe(`review`),Ir(`diff`),n&&l?(await lr({threadId:l,mode:`review`,prompt:a,mentions:oi,skills:Te,files:Oe,images:Ee,settings:Pn},`review`),Ar()):R(`/review ready`,`ok`);break;case`/ps`:Ir(`terminal`);break;case`/diff`:Ir(`diff`);break;case`/skills`:Br();break;case`/mcp`:Ir(`config`),l&&z(l,`mcp`);break;case`/theme`:Hr(),R(`Theme picker opened`,`ok`);break;case`/status`:Ir(`config`),R(`Session diagnostics opened`,`ok`);break;case`/copy`:tr&&(await MA(tr.text),R(`Copied latest response`,`ok`));break;case`/clear`:Ar(),R(`/clear — composer reset`,``);break;case`/experimental`:Ir(`config`);break;case`/init`:kr(`/init Generate AGENTS.md for this repo`),Dr(`/init Generate AGENTS.md for this repo`);break;case`/resume`:case`/feedback`:case`/apps`:case`/exit`:case`/quit`:case`/personality`:R(`${r} queued`,``);break;case`/logout`:await t.logoutAccount(),R(`Signed out of account`,`ok`);break;default:n&&l&&(await lr({threadId:l,mode:de,prompt:e,mentions:oi,skills:Te,files:Oe,images:Ee,settings:Pn}),Ar())}},[t,l,Yr,de,ti,qr,Jr,tr,z,Ir,Hr,Br,R,Ar,lr,Dr,Ee,Oe,oi,Te,kr,Pn]),ci=(0,F.useMemo)(()=>{let e=[{label:`Session`,items:[{icon:`💬`,name:`New Session (/new)`,key:`⌘N`,command:{type:`createSession`}},{icon:`⑂`,name:`Fork Session (/fork)`,key:``,command:{type:`forkSession`}},{icon:`🗜`,name:`Compact Transcript (/compact)`,key:``,command:{type:`compactSession`}},{icon:`🗑`,name:`Clear Composer`,key:``,command:{type:`resetComposer`}}]},{label:`Navigate`,items:[{icon:`📁`,name:`Files Panel`,key:``,command:{type:`openPanel`,tab:`files`}},{icon:`⎇`,name:`Branches Panel`,key:``,command:{type:`openPanel`,tab:`graph`}},{icon:`⬛`,name:`Terminal Dock (/ps)`,key:``,command:{type:`openPanel`,tab:`terminal`}},{icon:`⑂`,name:`Multi-agent Panel`,key:``,command:{type:`openPanel`,tab:`agents`}},{icon:`📋`,name:`Skills Library (/skills)`,key:``,command:{type:`openSkills`}},{icon:`⚙`,name:`Config & Feature Flags`,key:`⌘,`,command:{type:`openPanel`,tab:`config`}}]},{label:`Slash`,items:Td.map(e=>({icon:`/`,name:`${e.cmd} — ${e.dsc}`,key:``,command:{type:`runSlash`,slash:e.cmd}}))},...Ln.length>0?[{label:`Model`,items:Ln.map(e=>({icon:`🤖`,name:e.displayName,key:``,command:{type:`selectModel`,modelId:e.id}}))}]:[]],t=Me.trim().toLowerCase();return t?e.map(e=>({...e,items:e.items.filter(n=>`${n.name} ${e.label}`.toLowerCase().includes(t))})).filter(e=>e.items.length>0):e},[Me,Ln]),li=(0,F.useCallback)(e=>{switch(e.type){case`createSession`:qr();break;case`forkSession`:Jr();break;case`compactSession`:Yr();break;case`openSkills`:Br();break;case`resetComposer`:Ar();break;case`openPanel`:Ir(e.tab);break;case`runSlash`:si(e.slash);break;case`selectModel`:$r(e.modelId);break}},[Yr,qr,Jr,Ir,Br,Ar,si,$r]),ui=(0,F.useCallback)(e=>{De(t=>{let n=t.find(t=>t.id===e);return n?.url.startsWith(`blob:`)&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)})},[]),di=(0,F.useCallback)(e=>{Wt.current=e,Ut.current===null&&(Ut.current=window.requestAnimationFrame(()=>{Ut.current=null;let e=Wt.current;(0,F.startTransition)(()=>{ue(e)});let t=e.match(/(?:^|\s)([@$/])([^\s]*)$/);if(!t){ni();return}let n=t[1],r=t[2]??``;if(n===`/`){Fe(`slash`),P(`/${r}`),Re(0);return}if(n===`@`){Fe(`mention`),P(r),Re(0);return}if(n===`$`){Fe(`skill`),P(r),Re(0);return}ni()}))},[ni]),fi=(0,F.useCallback)(t=>{if(t.mode===`slash`){ri(`${t.value} `),ni();return}if(t.mode===`mention`){let n=e.mentionCatalog.find(e=>e.id===t.id);n&&ii(n);return}ai(t.value)},[ii,ai,ni,ri,e.mentionCatalog]),pi=(0,F.useCallback)(async n=>{let r=n??Ft.current?.value??le,a=r.trim(),o=Ce.filter(e=>$d(r,e)),s={composerValue:r,mentions:[...Ce],skills:[...Te],files:[...Oe],images:[...Ee]};if(!(!a&&o.length===0&&Te.length===0&&Oe.length===0&&Ee.length===0))try{let n=l,r=n?e.threads.some(e=>e.thread.id===n):!1;if((!n||!r)&&(n=await t.createThread(Pn,{title:`New Session`,cwd:M}),je(e=>[n,...e.filter(e=>e!==n)].slice(0,6)),z(n,`chat`)),a.startsWith(`/`)){await si(a,!0);return}let s=de===`review`||i.section===`review`?`review`:`chat`,c=a,u=Ee.length===0;if(vn){jr(n,{mode:s,prompt:c,mentions:o,skills:Te,files:Oe,images:Ee}),Ar(),R(`Message queued`,`ok`);return}u&&(Ar(),await PA()),n=await lr({threadId:n,mode:s,prompt:c,mentions:o,skills:Te,files:Oe,images:Ee,settings:Pn}),u||Ar()}catch(t){s.images.length===0&&!Or().trim()&&(ue(s.composerValue),At(e=>e+1),we(s.mentions),N(s.skills),ke(s.files),Fe(null),P(``),Re(0)),R(FA(t,e.transport.error??`Failed to send message`),`err`)}},[t,l,vn,le,de,jr,Or,z,R,Ar,i.section,si,lr,e.transport.error,e.threads,Ce,Ee,Oe,Te,Pn,M]),mi=(0,F.useCallback)(async e=>{if(Pe&&rr.length>0){if(e.key===`ArrowDown`){e.preventDefault(),Re(e=>Math.min(rr.length-1,e+1));return}if(e.key===`ArrowUp`){e.preventDefault(),Re(e=>Math.max(0,e-1));return}if(e.key===`Tab`||e.key===`Enter`&&!e.shiftKey){e.preventDefault(),fi(rr[Le]);return}if(e.key===`Escape`){ni();return}}if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`g`){e.preventDefault(),R(`Ctrl+G — opening editor bridge`,``);return}e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),await pi(e.currentTarget.value))},[ni,rr,fi,R,Le,Pe,pi]),hi=(0,F.useCallback)((e,t)=>{let n=e.filter(e=>e.type.startsWith(`image/`));if(n.length===0)return 0;let r=Date.now();return De(e=>[...e,...n.map((e,t)=>{let n=e.type.split(`/`)[1]?.replace(/[^a-z0-9]/gi,``).toLowerCase()||`png`;return{id:kd(`image`),name:e.name||`pasted-image-${r}-${t+1}.${n}`,url:URL.createObjectURL(e),size:Ud(e.size),file:e}})]),R(n.length===1?t===`paste`?`Image pasted`:`Image attached`:t===`paste`?`${n.length} images pasted`:`${n.length} images attached`,`ok`),n.length},[R]),gi=(0,F.useCallback)(e=>{let t=Array.from(e.clipboardData.files??[]);hi(t.length>0?t:Array.from(e.clipboardData.items??[]).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>!!e),`paste`)!==0&&e.preventDefault()},[hi]),_i=(0,F.useCallback)(e=>{let t=Array.from(e.target.files??[]);t.length!==0&&(hi(t,`attach`),e.target.value=``)},[hi]),vi=(0,F.useCallback)(e=>{let t=Array.from(e.target.files??[]);t.length!==0&&(ke(e=>[...e,...t.map(e=>({id:kd(`file`),name:e.name,size:Ud(e.size),file:e}))]),e.target.value=``,R(`File attached`,`ok`))},[R]),yi=(0,F.useCallback)(async()=>{if(!l)return;let e=await t.interruptTurn(l);R(e?`Stop requested`:`No active turn to stop`,e?`warn`:``)},[t,l,R]),bi=(0,F.useCallback)(e=>{N(t=>t.filter(t=>t.id!==e))},[]),xi=(0,F.useCallback)(e=>{ke(t=>t.filter(t=>t.id!==e))},[]),Si=(0,F.useCallback)(async e=>{if(!l)return;let n=(ze[l]??[]).find(t=>t.id===e);if(n){if(Mr(l,e),vn){if(await t.applySteer({threadId:l,prompt:n.prompt,mentions:n.mentions,skills:n.skills,files:n.files,images:n.images})){R(`Queued message sent as steer`,`ok`);return}Nr(l,n),R(`No active turn to steer`,`warn`);return}try{await lr({threadId:l,mode:n.mode,prompt:n.prompt,mentions:n.mentions,skills:n.skills,files:n.files,images:n.images,settings:Pn})}catch(e){Nr(fA(e)??l,n)}}},[t,l,vn,Pn,Nr,R,ze,Mr,lr]),Ci=(0,F.useCallback)(e=>{if(pn.length<=1){R(`Cannot close last tab`,``);return}let t=pn.filter(t=>t!==e);je(t),e===l&&t[0]&&z(t[0],`chat`)},[l,z,R,pn]),wi=Pe?q[Pe]:vn?`Queue a follow-up while the agent is still running…`:q.slash,Ti=`${CA((0,F.useMemo)(()=>jA(L,e.settings.provider),[L,e.settings.provider]))} / 200k`,Ei=(0,F.useMemo)(()=>[...e.account.usageWindows].sort((e,t)=>(e.windowDurationMins??2**53-1)-(t.windowDurationMins??2**53-1)).slice(0,2),[e.account.usageWindows]),Di=e.transport.status===`connected`?`Connected`:e.transport.status,Oi=wA(u?.thread.cwd),ki=u?.thread.gitInfo?.branch??`workspace`,Ai=Sd[Mn].toLowerCase(),ji=vn?`Streaming`:`Idle`,Mi=(0,F.useMemo)(()=>u?.terminals.filter(e=>e.source===`shell`)??[],[u?.terminals]),Ni=Mi.length>0,B=(0,F.useCallback)(()=>{!l||!u?.thread.cwd||Ni||t.startProjectTerminal(l,u.thread.cwd).catch(e=>{R(e instanceof Error?e.message:`Unable to start the project shell.`,`err`)})},[t,u?.thread.cwd,l,Ni,R]);(0,F.useEffect)(()=>{if(!(!_e||!ye||xe)){if(typeof window>`u`){Se(!0);return}return at.current=window.requestAnimationFrame(()=>{at.current=null,Se(!0)}),()=>{at.current!==null&&(window.cancelAnimationFrame(at.current),at.current=null)}}},[ye,xe,_e]),(0,F.useEffect)(()=>{if(!(!_e||!xe||!l||!u?.thread.cwd||Ni)){if(typeof window>`u`){B();return}return ot.current=window.requestAnimationFrame(()=>{ot.current=null,B()}),()=>{ot.current!==null&&(window.cancelAnimationFrame(ot.current),ot.current=null)}}},[u?.thread.cwd,l,Ni,B,xe,_e]);let Pi=(0,F.useCallback)(()=>{_e||(be(!0),ve(!0))},[_e]),Fi=(0,F.useCallback)(()=>{typeof window<`u`&&(at.current!==null&&(window.cancelAnimationFrame(at.current),at.current=null),ot.current!==null&&(window.cancelAnimationFrame(ot.current),ot.current=null)),ve(!1)},[]),Ii=(0,F.useCallback)(e=>{MA(e).then(()=>R(`Copied!`,`ok`))},[R]),Li=(0,F.useCallback)((e,t)=>{Fr(e,{line:t,source:`chat`})},[Fr]),Ri=(0,F.useCallback)(e=>{Rr(e)},[Rr]),zi=(0,F.useCallback)(e=>{Fr(e,{source:`chat`})},[Fr]),Bi=(0,F.useCallback)(()=>{si(`/plan`)},[si]),Vi=(0,F.useCallback)(e=>{kr(e),Dr(e)},[Dr,kr]),Hi=(0,F.useCallback)(e=>{si(e)},[si]),Ui=(0,F.useCallback)((e,t)=>{e.preventDefault(),We({x:Math.min(e.clientX,window.innerWidth-172),y:Math.min(e.clientY,window.innerHeight-212),item:t})},[]),Wi=(0,F.useCallback)(()=>{if(l){if(_===`ops`){D(`files`),C(!0),z(l,`ops`);return}z(l,_)}},[l,_,z]),Gi=(0,F.useCallback)(()=>{if(l){if(y===`ops`){D(`files`),C(!0),z(l,`ops`);return}z(l,y)}},[l,z,y]),Ki=(0,F.useMemo)(()=>i.section!==`editor`||!h?null:qe?.path===h?{...qe,line:g}:{path:h,name:h.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??h,content:``,loading:!0,error:null,line:g},[g,h,qe,i.section]),qi=(0,F.useCallback)(async(e,n)=>{await t.saveFile(e,n),Je(t=>t?.path===e?{...t,content:n,loading:!1,error:null}:t),R(`Saved ${e.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??e}`,`ok`)},[t,R]),Ji=_===`ops`?`Back to Files`:`Back to Chat`,Yi=(0,F.useCallback)(async e=>{if(e.kind===`directory`){Ke(e.path),Je(null);return}Fr(e.path,{source:`ops`})},[Fr]),Xi=()=>{if(!u)return(0,I.jsx)(`div`,{className:`empty-panel`,children:`No active thread.`});if(E===`graph`)return lt?(0,I.jsxs)(`div`,{className:`graph-panel-stack`,children:[(0,I.jsx)(WS,{branchLabel:Yn,committing:Tt,dirty:qn,generating:Ct,hasStagedChanges:Jn,message:xt,onCommit:()=>void Er(),onGenerate:()=>void Tr(),onMessageChange:St,onProviderChange:e=>{wr(e)},preferencesPath:yt,providers:e.providers,selectedProviderId:_t,summary:Kn?.summary??`Working tree clean`}),lt.source===`session`?(0,I.jsx)(`div`,{className:`panel-hint`,children:pt?`Showing session-derived history because local git output is unavailable.`:`Showing session-derived history.`}):dt?(0,I.jsx)(`div`,{className:`panel-hint`,children:`Refreshing git history…`}):null,(0,I.jsx)(JS,{model:lt,onOpenThread:Pr})]}):(0,I.jsx)(`div`,{className:`empty-panel`,children:dt?`Loading git history…`:`No repository graph available for this session yet.`});if(E===`files`){let t=new Map,n=u.thread.cwd,r=Nn??n,a=e.directoryCatalogRoot===r?e.directoryCatalog:[],o=new Set(oi.map(e=>e.path)),s=r===n?``:r.slice(n.length).replace(/^\/+/u,``),c=[{label:n.split(`/`).filter(Boolean).pop()??n,path:n},...s.split(`/`).filter(Boolean).reduce((e,t)=>{let r=e.at(-1)?.path??n;return e.push({label:t,path:`${r.replace(/\/+$/u,``)}/${t}`}),e},[])],l=r===n?null:r.slice(0,r.lastIndexOf(`/`))||n;return Vn.forEach(e=>{e.changes.forEach(e=>{t.set(e.path,e.kind.type===`add`?`new`:e.kind.type===`delete`?`del`:`mod`)})}),(0,I.jsx)(iA,{breadcrumbs:c,currentPath:r,directoryEntries:a,editorPath:i.section===`editor`?h:null,loading:e.directoryCatalogRoot!==r,mentionedPaths:o,modifiedByPath:t,onNavigate:e=>{Ke(e),Je(t=>t&&qd(e,t.path)?t:null)},onOpenEntry:Yi,parentPath:l,rootPath:n})}if(E===`diff`){let e=Hn.reduce((e,t)=>e+t.additions,0),t=Hn.reduce((e,t)=>e+t.removals,0);return(0,I.jsxs)(`div`,{className:`diff-review-shell`,children:[(0,I.jsxs)(`div`,{className:`panel-hint`,children:[`Patch review · `,Hn.length,` changed file`,Hn.length===1?``:`s`,` · +`,e,` / -`,t]}),Hn.length===0?(0,I.jsx)(`div`,{className:`empty-panel`,children:`No diff items in this thread yet.`}):null,Hn.length>0?(0,I.jsxs)(`div`,{className:`diff-review-layout`,children:[(0,I.jsx)(`div`,{className:`diff-review-sidebar`,children:Hn.map(e=>(0,I.jsxs)(`button`,{className:H(`diff-review-entry`,Gn?.id===e.id&&`active`),type:`button`,onClick:()=>Qe(e.id),children:[(0,I.jsxs)(`div`,{className:`diff-review-entry-top`,children:[(0,I.jsx)(`span`,{className:H(`diff-kind-pill`,e.kind.type===`add`&&`new`,e.kind.type===`delete`&&`del`),children:bf(e.kind)}),(0,I.jsx)(`span`,{className:H(`diff-status`,e.status===`inProgress`&&`live`,e.status===`failed`&&`err`),children:e.status===`inProgress`?`editing`:e.status})]}),(0,I.jsx)(`div`,{className:`diff-review-entry-path`,children:e.path}),(0,I.jsxs)(`div`,{className:`diff-review-entry-meta`,children:[(0,I.jsxs)(`span`,{children:[`+`,e.additions]}),(0,I.jsxs)(`span`,{children:[`-`,e.removals]}),(0,I.jsxs)(`span`,{children:[e.hunks,` hunk`,e.hunks===1?``:`s`]})]})]},e.id))}),Gn?(0,I.jsxs)(`div`,{className:`diff-review-main`,children:[(0,I.jsxs)(`div`,{className:`diff-focus-head`,children:[(0,I.jsx)(`div`,{className:`diff-focus-title`,children:Gn.path}),(0,I.jsxs)(`div`,{className:`diff-focus-meta`,children:[(0,I.jsx)(`span`,{className:H(`diff-kind-pill`,Gn.kind.type===`add`&&`new`,Gn.kind.type===`delete`&&`del`),children:bf(Gn.kind)}),(0,I.jsx)(`span`,{className:H(`diff-status`,Gn.status===`inProgress`&&`live`,Gn.status===`failed`&&`err`),children:Gn.status===`inProgress`?`editing`:Gn.status}),(0,I.jsxs)(`span`,{className:`diff-stat-chip`,children:[`+`,Gn.additions]}),(0,I.jsxs)(`span`,{className:`diff-stat-chip`,children:[`-`,Gn.removals]}),(0,I.jsxs)(`span`,{className:`diff-stat-chip`,children:[Gn.hunks,` hunk`,Gn.hunks===1?``:`s`]})]})]}),(0,I.jsx)(cA,{entry:Gn})]}):null]}):null,Xn.length>0?(0,I.jsx)(`div`,{className:`review-list`,children:Xn.map(e=>(0,I.jsxs)(`div`,{className:H(`review-item`,e.severity),children:[(0,I.jsxs)(`div`,{className:`review-header`,children:[(0,I.jsx)(`span`,{children:e.severity}),(0,I.jsx)(`span`,{children:e.file.split(`/`).slice(-2).join(`/`)}),(0,I.jsxs)(`span`,{children:[`:`,e.line]})]}),(0,I.jsx)(`div`,{className:`review-title`,children:e.title}),(0,I.jsx)(`div`,{className:`review-summary`,children:e.summary})]},e.id))}):u.review.length>0?(0,I.jsx)(`div`,{className:`empty-panel`,children:`No review findings mapped to the selected file.`}):null,jn.length>0?(0,I.jsx)(`div`,{className:`panel-actions`,children:jn.map(e=>hr(e))}):null]})}if(E===`terminal`)return(0,I.jsx)(`div`,{className:`empty-panel`,children:`Terminal moved to the bottom dock. Use the Shell toggle above the prompt.`});if(E===`agents`){let t=e.threads.filter(e=>e.thread.agentNickname||e.thread.agentRole);return(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`panel-head-row`,children:[(0,I.jsx)(`div`,{className:`panel-hint`,children:`⑂ Multi-agent session`}),(0,I.jsx)(`button`,{className:`abtn yes small`,type:`button`,onClick:()=>R(`spawn_agent("alpha") → started`,`ok`),children:`+ Spawn`})]}),er.length===0&&t.length===0?(0,I.jsx)(`div`,{className:`empty-panel`,children:`No subagent activity in this thread yet.`}):null,er.map(e=>(0,I.jsxs)(`div`,{className:`agc`,children:[(0,I.jsxs)(`div`,{className:`agh`,children:[(0,I.jsx)(`div`,{className:`agdot`}),(0,I.jsxs)(`span`,{className:`agn`,children:[`⑂ `,e.tool]}),(0,I.jsx)(`span`,{className:`ags`,children:e.status})]}),(0,I.jsx)(`div`,{className:`agt`,children:e.prompt??`Subagent activity`}),e.receiverThreadIds.map(t=>{let n=e.agentsStates[t],r=n?.status===`completed`?100:n?.status===`running`?58:18;return(0,I.jsxs)(`div`,{className:`agent-progress`,children:[(0,I.jsxs)(`div`,{className:`agent-progress-header`,children:[(0,I.jsx)(`span`,{children:t.slice(0,12)}),(0,I.jsx)(`span`,{children:n?.status??`pending`})]}),(0,I.jsx)(`div`,{className:`agprog`,children:(0,I.jsx)(`div`,{className:`agbar`,style:{width:`${r}%`}})}),(0,I.jsx)(`div`,{className:`agent-progress-copy`,children:n?.message??`No update yet.`})]},t)})]},e.id)),t.map(e=>(0,I.jsxs)(`div`,{className:`agc`,children:[(0,I.jsxs)(`div`,{className:`agh`,children:[(0,I.jsx)(`div`,{className:`agdot`}),(0,I.jsxs)(`span`,{className:`agn`,children:[`⑂ `,e.thread.agentNickname??c[e.thread.id]??Vd(e.thread)]}),(0,I.jsx)(`span`,{className:`ags`,children:e.thread.status.type})]}),(0,I.jsx)(`div`,{className:`agt`,children:e.thread.agentRole??`Subagent thread`})]},e.thread.id))]})}return(0,I.jsx)(`div`,{children:(0,I.jsx)(eC,{snapshot:e,activeThreadLabel:d,actions:t,activeTheme:jt,onOpenSkills:Br,onOpenTheme:Hr,pushToast:R,selectModel:$r})})},Zi=()=>{if(!Pe)return null;let t=Pe===`mention`&&!!u&&e.directoryCatalogRoot!==(u?.thread.cwd??null),n=Pe===`mention`?t?`Loading files from the current directory…`:`No files found for this query.`:Pe===`skill`?`No skills matched.`:`No commands matched.`;return(0,I.jsx)(`div`,{id:`slashpop`,style:{display:`block`},children:rr.length>0?rr.map((e,t)=>(0,I.jsxs)(`button`,{className:H(`spi`,t===Le&&`sel`),type:`button`,onMouseDown:t=>{t.preventDefault(),fi(e)},children:[(0,I.jsx)(`span`,{className:`sp-cmd`,children:e.label}),(0,I.jsx)(`span`,{className:`sp-dsc`,children:e.description})]},e.id)):(0,I.jsx)(`div`,{className:`sp-empty`,children:n})})},Qi=un&&ar,$i=!un&&ar,ea=!un&&!i.threadId&&e.transport.mode===`live`&&e.transport.status===`connected`&&s.length===0&&!on;return un?(0,I.jsx)(`main`,{className:`workspace-shell connection-loading-shell`,children:(0,I.jsx)(fS,{messages:xA,metaText:Qi?`Restoring ${Hd(d,42)}`:`Connecting to workspace backend`,visibleRangeEnd:Qi?xA.length-1:yA.length-1,visibleRangeStart:Qi?yA.length:0})}):$i?(0,I.jsx)(`main`,{className:`workspace-shell connection-loading-shell`,children:(0,I.jsx)(fS,{messages:[`Opening conversation`,`Reattaching thread`,`Loading recent history`,`Syncing transcript`],metaText:`Restoring ${Hd(d,42)}`})}):ea?(0,I.jsx)(`main`,{className:`workspace-shell connection-loading-shell`,children:(0,I.jsx)(fS,{messages:[`Loading sessions`,`Reading workspace state`,`Syncing sidebar`,`Preparing conversation`],metaText:`Restoring recent workspace sessions`})}):(0,I.jsxs)(`main`,{className:H(`workspace-shell`,kn&&`overlay-open`),children:[(0,I.jsxs)(`header`,{id:`hdr`,children:[(0,I.jsx)(`button`,{className:`hb mbtn`,type:`button`,onClick:Lr,title:`Menu`,children:`☰`}),(0,I.jsxs)(`div`,{className:`logo`,children:[(0,I.jsx)(cS,{alt:``,className:`logo-ico`}),(0,I.jsx)(`span`,{children:`Nomadex`})]}),(0,I.jsx)(`div`,{className:`hsep`}),(0,I.jsx)(`button`,{className:H(`hbadge`,Cd[Mn]),id:`aprbadge`,type:`button`,onClick:()=>void ti(),title:`Cycle approval mode`,children:Sd[Mn]}),(0,I.jsx)(`button`,{className:`hb`,type:`button`,onClick:()=>k(!0),title:`Command palette`,children:`⌘`}),(0,I.jsx)(`button`,{className:`hb`,type:`button`,onClick:()=>Ir(`agents`),title:`Multi-agent panel`,children:`⑂`}),(0,I.jsx)(`button`,{className:`hb`,type:`button`,onClick:()=>Ir(`files`),title:`Files and diff`,children:`📁`}),(0,I.jsx)(`button`,{className:`hb`,type:`button`,onClick:Br,title:`Skills library`,children:`📋`}),(0,I.jsx)(`button`,{className:`hb`,type:`button`,onClick:()=>Ir(`config`),title:`Config and settings`,children:`⚙`}),(0,I.jsxs)(`button`,{className:`htheme`,id:`htheme`,type:`button`,onClick:()=>{te(!1),A(e=>!e)},title:`Theme picker`,children:[(0,I.jsx)(`span`,{className:`theme-dot`}),(0,I.jsx)(`span`,{className:`theme-label`,children:Bn.name}),(0,I.jsx)(`span`,{className:`hmodel-arrow`,children:`▾`})]}),(0,I.jsxs)(`button`,{className:`hmodel`,id:`hmodel`,type:`button`,disabled:Ln.length===0,ref:Lt,onClick:()=>{Ln.length!==0&&(A(!1),te(e=>!e))},title:Ln.length===0?`${In.displayName} uses its own CLI model configuration`:void 0,children:[(0,I.jsx)(`div`,{className:`mdot`}),(0,I.jsx)(`span`,{id:`mlabel`,children:zn}),(0,I.jsx)(`span`,{className:`hmodel-arrow`,children:`▾`})]})]}),(0,I.jsxs)(`div`,{id:`layout`,children:[!p&&b?(0,I.jsx)(`button`,{id:`sbo`,className:`show`,type:`button`,"aria-label":`Close sidebar`,onClick:()=>x(!1)}):null,Dn?(0,I.jsxs)(`aside`,{id:`sb`,className:H(!p&&b&&`open`),children:[(0,I.jsx)(`button`,{className:`snew`,type:`button`,onClick:()=>void qr(),children:`+ New Session`}),(0,I.jsx)(`div`,{className:`shist`,children:[`Today`,`Yesterday`,`Earlier`].map(e=>Fn[e].length>0?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`sgl`,children:e}),Fn[e].map(e=>(0,I.jsxs)(`button`,{className:H(`si`,e.thread.id===l&&`active`),type:`button`,onClick:()=>Pr(e.thread.id),children:[(0,I.jsx)(`span`,{children:e.thread.agentNickname?`⑂`:`💬`}),(0,I.jsx)(`span`,{className:`si-t`,children:c[e.thread.id]??Vd(e.thread)})]},e.thread.id))]},e):null)}),(0,I.jsxs)(`div`,{className:`sbot`,children:[(0,I.jsxs)(`button`,{className:`slink`,type:`button`,onClick:()=>k(!0),children:[(0,I.jsx)(`span`,{children:`⌘`}),(0,I.jsx)(`span`,{children:`Command palette`}),(0,I.jsx)(`span`,{className:`skbd`,children:`⌘K`})]}),(0,I.jsxs)(`button`,{className:`slink`,type:`button`,onClick:()=>void si(`/review`),children:[(0,I.jsx)(`span`,{children:`🔍`}),(0,I.jsx)(`span`,{children:`/review working tree`})]}),(0,I.jsxs)(`button`,{className:`slink`,type:`button`,onClick:()=>void si(`/fork`),children:[(0,I.jsx)(`span`,{children:`⑂`}),(0,I.jsx)(`span`,{children:`/fork session`})]}),(0,I.jsxs)(`button`,{className:`slink`,type:`button`,onClick:()=>void si(`/compact`),children:[(0,I.jsx)(`span`,{children:`🗜`}),(0,I.jsx)(`span`,{children:`/compact transcript`})]}),(0,I.jsxs)(`button`,{className:`slink`,type:`button`,onClick:Br,children:[(0,I.jsx)(`span`,{children:`📋`}),(0,I.jsx)(`span`,{children:`Skills library`})]}),(0,I.jsxs)(`button`,{className:`slink`,type:`button`,onClick:Hr,children:[(0,I.jsx)(`span`,{children:`◐`}),(0,I.jsx)(`span`,{children:`Theme picker`})]}),(0,I.jsxs)(`button`,{className:`slink`,type:`button`,onClick:()=>Vi(`/init Generate AGENTS.md scaffold`),children:[(0,I.jsx)(`span`,{children:`📋`}),(0,I.jsx)(`span`,{children:`/init AGENTS.md`})]}),(0,I.jsxs)(`button`,{className:`slink`,type:`button`,onClick:()=>Ir(`config`),children:[(0,I.jsx)(`span`,{children:`⚙`}),(0,I.jsx)(`span`,{children:`config.toml`})]})]})]}):null,(0,I.jsxs)(`section`,{id:`main`,className:H(On&&`covered`),children:[(0,I.jsxs)(`div`,{id:`tabs`,children:[pn.map(e=>{let t=s.find(t=>t.thread.id===e),n=t?.thread;return!t||!n?null:(0,I.jsxs)(`button`,{className:H(`tab`,e===l&&`active`),"data-i":e,type:`button`,onClick:()=>z(e,`chat`),children:[(0,I.jsx)(`span`,{children:n.agentNickname?`⑂`:`💬`}),(0,I.jsx)(`span`,{children:Hd(c[t.thread.id]??Vd(t.thread),18)}),(0,I.jsx)(`span`,{className:`tab-x`,onClick:t=>{t.stopPropagation(),Ci(e)},children:`×`})]},e)}),(0,I.jsx)(`button`,{className:`tabadd`,type:`button`,onClick:()=>void qr(),title:`New session`,children:`+`})]}),i.section===`editor`?(0,I.jsx)(`div`,{id:`editor-page`,children:Ki?(0,I.jsx)(uA,{backLabel:Ji,onBack:Wi,onDirtyChange:Xe,onSave:qi,preview:Ki,providerId:e.settings.provider,variant:`page`}):(0,I.jsx)(`div`,{className:`empty-panel`,children:`No file selected.`})}):i.section===`review`?(0,I.jsx)(lA,{backLabel:y===`ops`?`Back to Files`:`Back to Chat`,diffEntries:Hn,findings:Xn,onBack:Gi,onSelectEntry:e=>Rr(e,y),selectedEntryId:Ze}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{id:`chat`,ref:Nt,children:[(0,I.jsx)(yS,{activeThread:u,activeThreadLabel:d,activeTurns:gn,existingThreadHistoryPending:or,rollbackPendingTurnId:Xr,onContext:Ui,onCopy:Ii,onEdit:Vi,onFill:Vi,onFork:Jr,onOpenFile:Li,onPlan:Bi,onRollback:Qr,onReview:Ri,onSlash:Hi,providerId:e.settings.provider,streamVisible:tn}),(0,I.jsx)(pd,{overlay:Cn,pendingApprovalsCount:An,queuedCount:Sn.length}),(0,I.jsx)(`div`,{"aria-hidden":`true`,ref:Pt})]}),(0,I.jsxs)(`div`,{id:`ia`,children:[st?(0,I.jsx)(`div`,{className:`chat-jump-row`,children:(0,I.jsx)(`button`,{className:`chat-jump-button`,type:`button`,onClick:xr,children:`↓ Latest`})}):null,Te.length>0||Oe.length>0||Ee.length>0?(0,I.jsxs)(`div`,{id:`ctx-row`,children:[Te.map(e=>(0,I.jsxs)(`div`,{className:`ctag`,children:[(0,I.jsx)(`span`,{children:`📋`}),(0,I.jsxs)(`span`,{children:[`$`,e.name]}),(0,I.jsx)(`button`,{className:`ctx-x`,type:`button`,onClick:()=>bi(e.id),children:`×`})]},e.id)),Oe.map(e=>{let t=mf(e.name);return(0,I.jsxs)(`div`,{className:H(`ctag ctag-file`,`file-tone-${t.tone}`),children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`file-chip-preview`,children:(0,I.jsx)(`span`,{className:`file-chip-ext`,children:t.badge})}),(0,I.jsxs)(`span`,{className:`file-chip-copy`,children:[(0,I.jsx)(`span`,{className:`file-chip-title`,children:t.title}),(0,I.jsx)(`span`,{className:`file-chip-meta`,children:e.size})]}),(0,I.jsx)(`button`,{className:`ctx-x`,type:`button`,onClick:()=>xi(e.id),children:`×`})]},e.id)}),Ee.map(e=>(0,I.jsxs)(`div`,{className:`ctag ctag-image`,children:[(0,I.jsx)(`img`,{alt:e.name,className:`ctag-thumb`,loading:`lazy`,src:e.url}),(0,I.jsx)(`span`,{className:`ctag-label`,children:e.name}),(0,I.jsx)(`button`,{className:`ctx-x`,type:`button`,onClick:()=>ui(e.id),children:`×`})]},e.id))]}):null,Sn.length>0?(0,I.jsx)(oA,{messages:Sn,onDelete:e=>l&&Mr(l,e),onSteer:Si}):null,wn.length>0?(0,I.jsx)(hS,{entries:wn,onOpenFile:zi,title:`Changing`,variant:`live`}):null,jn.length>0?(0,I.jsx)(`div`,{className:`question-request-stack`,children:jn.map(e=>hr(e))}):null,(ye||_e)&&u?(0,I.jsxs)(`div`,{className:H(`workspace-terminal-dock`,!_e&&`hidden`),children:[(0,I.jsxs)(`div`,{className:`workspace-terminal-dock-bar`,children:[(0,I.jsx)(`button`,{className:`workspace-terminal-dock-tab active`,type:`button`,children:`Terminal`}),(0,I.jsx)(`button`,{className:`workspace-terminal-dock-close`,onClick:Fi,type:`button`,children:`Hide`})]}),(0,I.jsx)(`div`,{className:`workspace-terminal-dock-body`,children:xe?(0,I.jsx)(rC,{cwd:u.thread.cwd,onSendInput:(e,n)=>t.sendTerminalInput(u.thread.id,e,n),onStartShell:()=>t.startProjectTerminal(u.thread.id,u.thread.cwd),onTerminate:e=>t.terminateTerminal(u.thread.id,e),terminals:Mi}):(0,I.jsx)(`div`,{className:`workspace-terminal-dock-loading`,children:`Opening terminal`})})]}):null,(0,I.jsxs)(`div`,{id:`ib`,className:H(Sn.length>0&&`queue-open`),children:[(0,I.jsxs)(`div`,{id:`toolbar`,children:[(0,I.jsxs)(`button`,{className:H(`tbtn`,pe&&`on`),type:`button`,onClick:()=>me(e=>!e),children:[(0,I.jsx)(SA,{name:`auto`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Auto`})]}),(0,I.jsxs)(`button`,{className:H(`tbtn`,he&&`on`),type:`button`,onClick:async()=>{ge(!he)},children:[(0,I.jsx)(SA,{name:`plan`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Plan`})]}),(0,I.jsx)(`div`,{className:`tsep2`}),(0,I.jsxs)(`button`,{className:`tbtn`,type:`button`,onClick:()=>{Fe(`mention`),P(``),Re(0),Ft.current?.focus()},children:[(0,I.jsx)(SA,{name:`mention`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Mention`})]}),(0,I.jsxs)(`button`,{className:`tbtn`,type:`button`,onClick:()=>zt.current?.click(),children:[(0,I.jsx)(SA,{name:`attach`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Files`})]}),(0,I.jsxs)(`button`,{className:`tbtn`,type:`button`,onClick:()=>Rt.current?.click(),children:[(0,I.jsx)(SA,{name:`image`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Image`})]}),(0,I.jsxs)(`button`,{className:H(`tbtn`,_e&&`on`),type:`button`,onClick:()=>void(_e?Fi():Pi()),children:[(0,I.jsx)(SA,{name:`terminal`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Shell`})]}),(0,I.jsxs)(`button`,{className:H(`tbtn`,e.settings.webSearch&&`on`),type:`button`,onClick:()=>void t.updateSettings({webSearch:!e.settings.webSearch}),children:[(0,I.jsx)(SA,{name:`web`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Web`})]}),(0,I.jsx)(`div`,{className:`tsep2`}),(0,I.jsxs)(`button`,{className:H(`tbtn`,de===`review`&&`on`),type:`button`,onClick:()=>fe(e=>e===`review`?`chat`:`review`),children:[(0,I.jsx)(SA,{name:`review`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Review`})]}),(0,I.jsxs)(`button`,{className:`tbtn`,type:`button`,onClick:()=>Ir(`agents`),children:[(0,I.jsx)(SA,{name:`agents`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Agents`})]}),(0,I.jsxs)(`button`,{className:`tbtn`,type:`button`,onClick:()=>void Yr(),children:[(0,I.jsx)(SA,{name:`compact`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Trim`})]}),(0,I.jsxs)(`button`,{className:`tbtn`,type:`button`,onClick:()=>R(`Ctrl+G — opening editor bridge`,``),children:[(0,I.jsx)(SA,{name:`editor`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Editor`})]})]}),(0,I.jsxs)(`div`,{id:`irow`,children:[(0,I.jsx)(sA,{composerMirrorRef:It,mentions:Ce,onKeyDown:mi,onPaste:gi,onValueChange:di,placeholder:wi,textareaRef:Ft,value:le},kt),(0,I.jsx)(`button`,{id:`sendbtn`,type:`button`,"aria-label":vn?`Queue message`:`Send message`,onClick:()=>void pi(Ft.current?.value),children:(0,I.jsx)(SA,{name:`send`})}),(0,I.jsx)(`button`,{id:`stopbtn`,style:{display:vn?`flex`:`none`},type:`button`,"aria-label":`Stop current turn`,onClick:()=>void yi(),children:(0,I.jsx)(SA,{name:`stop`})})]}),Zi(),(0,I.jsx)(`div`,{id:`ifooter`,children:(0,I.jsxs)(`div`,{className:`composer-footer-meta`,children:[(0,I.jsx)(`div`,{className:`composer-shortcuts`,children:(0,I.jsx)(`span`,{className:`composer-hint`,children:`Shift+Enter`})}),(0,I.jsxs)(`div`,{className:`composer-usage-metric`,children:[(0,I.jsx)(`span`,{className:`composer-usage-label`,children:`Context`}),(0,I.jsx)(`span`,{id:`tokcount`,children:Ti})]}),(0,I.jsx)(`div`,{className:`composer-limit-list`,children:Ei.map(e=>(0,I.jsxs)(`div`,{className:`composer-limit-chip`,children:[(0,I.jsx)(`span`,{className:`composer-limit-name`,children:AA(e.label,e.windowDurationMins)}),(0,I.jsxs)(`span`,{className:`composer-limit-value`,children:[Math.round(e.usedPercent),`%`]})]},e.id))})]})})]})]})]})]}),p||Tn?(0,I.jsxs)(`aside`,{id:`rp`,className:H(Tn&&`open`),children:[(0,I.jsxs)(`div`,{className:`rph`,children:[(0,I.jsx)(`span`,{className:`rpt`,id:`rp-title`,children:wd[E]}),(0,I.jsx)(`button`,{className:`rpclose`,type:`button`,onClick:zr,children:`×`})]}),(0,I.jsx)(`div`,{className:`rptabs`,id:`rptabs`,children:[`files`,`graph`,`diff`,`agents`,`config`].map(e=>(0,I.jsx)(`button`,{className:H(`rptab`,E===e&&`active`),type:`button`,onClick:()=>{if(e===`diff`){Rr(Gn?.id??Hn[0]?.id,i.section===`ops`?`ops`:`chat`);return}D(e)},children:wd[e]},e))}),(0,I.jsx)(`div`,{className:`rpbody`,id:`rpbody`,children:Tn?Xi():null})]}):null]}),(0,I.jsxs)(`div`,{id:`statusbar`,children:[(0,I.jsxs)(`div`,{className:`sbi sbi-transport`,children:[(0,I.jsx)(`div`,{className:H(`sbd`,Rd(e.transport.status))}),(0,I.jsx)(`span`,{children:Di})]}),(0,I.jsxs)(`div`,{className:`sbi sbi-branch`,children:[(0,I.jsx)(SA,{name:`branch`}),(0,I.jsx)(`span`,{className:`sb-project sb-fulltext`,children:Oi}),(0,I.jsx)(`span`,{className:`sb-divider`,children:`/`}),(0,I.jsx)(`span`,{className:`sb-fulltext`,children:ki})]}),(0,I.jsxs)(`div`,{className:`sbi sbi-model`,id:`sb-model`,children:[(0,I.jsx)(SA,{name:`model`}),(0,I.jsx)(`span`,{children:zn})]}),(0,I.jsxs)(`div`,{className:`sbi sbi-access`,children:[(0,I.jsx)(SA,{name:`shield`}),(0,I.jsx)(`span`,{children:Ai})]}),(0,I.jsx)(`div`,{className:`sbi`,id:`sb-st`,children:ji})]}),ee&&Ln.length>0?(0,I.jsx)(`div`,{id:`mpicker`,style:{display:`block`,top:`${Dt.top}px`,right:`${Dt.right}px`,left:`auto`},children:Ln.map((t,n)=>(0,I.jsxs)(`div`,{className:`mpi`,onClick:()=>void $r(t.id),onKeyDown:()=>void 0,role:`button`,tabIndex:0,children:[(0,I.jsxs)(`div`,{className:`mpi-n`,children:[t.displayName,t.id===e.settings.model?(0,I.jsxs)(I.Fragment,{children:[` `,`✓ `,(0,I.jsx)(`span`,{className:`model-rec`,children:`active`})]}):null]}),(0,I.jsx)(`div`,{className:`mpi-d`,children:t.description}),n<Ln.length-1?(0,I.jsx)(`div`,{className:`mpsep`}):null]},t.id))}):null,ne?(0,I.jsx)($S,{activeTheme:jt,onClose:Ur,onSelect:ei,themes:Ed}):null,j?(0,I.jsx)(aA,{activePath:M,breadcrumbs:$n,busy:oe,entries:Zn,loading:e.directoryCatalogRoot!==M,onClose:()=>re(!1),onNavigate:ce,onPick:e=>{ce(e),Kr(e)},parentPath:Qn}):null,ie?(0,I.jsx)(QS,{actions:t,onClose:Vr,pushToast:R,snapshot:e}):null,O?(0,I.jsx)(`div`,{id:`cmo`,className:`show`,onClick:e=>e.target===e.currentTarget&&k(!1),children:(0,I.jsxs)(`div`,{id:`cmp`,children:[(0,I.jsxs)(`div`,{className:`cmr`,children:[(0,I.jsx)(`span`,{className:`cm-ico`,children:`⌘`}),(0,I.jsx)(`input`,{id:`cminput`,autoFocus:!0,placeholder:`Search commands, slash commands, models…`,value:Me,onChange:e=>Ne(e.target.value),onKeyDown:e=>{if(e.key===`Escape`&&k(!1),e.key===`Enter`){e.preventDefault();let t=ci[0]?.items[0];t&&(k(!1),li(t.command))}}})]}),(0,I.jsx)(`div`,{className:`cmlist`,id:`cmlist`,children:ci.length===0?(0,I.jsx)(`div`,{className:`empty-command`,children:`No results`}):ci.map(e=>(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`cmgl`,children:e.label}),e.items.map(t=>(0,I.jsxs)(`button`,{className:`cmi`,type:`button`,onClick:()=>{k(!1),li(t.command)},children:[(0,I.jsx)(`span`,{children:t.icon}),(0,I.jsx)(`span`,{className:`cmi-nm`,children:t.name}),t.key?(0,I.jsx)(`span`,{className:`cmkbd`,children:t.key}):null]},`${e.label}-${t.name}`))]},e.label))})]})}):null,Ue?(0,I.jsxs)(`div`,{id:`ctxmenu`,className:`show`,style:{left:`${Ue.x}px`,top:`${Ue.y}px`},children:[(0,I.jsx)(`button`,{className:`ctxi`,type:`button`,onClick:()=>{let t=Ue.item;t?.type===`agentMessage`&&MA(t.text).then(()=>R(`Copied`,`ok`)),t?.type===`userMessage`&&MA(Jd(t,e.settings.provider)).then(()=>R(`Copied`,`ok`)),We(null)},children:`📋 Copy message`}),(0,I.jsx)(`button`,{className:`ctxi`,type:`button`,onClick:()=>{let t=Ue.item;t?.type===`agentMessage`&&Vi(t.text),t?.type===`userMessage`&&Vi(Jd(t,e.settings.provider)),We(null)},children:`✏ Edit & resend`}),(0,I.jsx)(`button`,{className:`ctxi`,type:`button`,onClick:()=>{tr&&Vi(tr.text),We(null)},children:`🔄 Regenerate`}),(0,I.jsx)(`div`,{className:`ctxs`}),(0,I.jsx)(`button`,{className:`ctxi`,type:`button`,onClick:()=>{Jr(),We(null)},children:`⑂ /fork from here`}),(0,I.jsx)(`button`,{className:`ctxi`,type:`button`,onClick:()=>{si(`/plan`),We(null)},children:`📋 /plan from here`}),(0,I.jsx)(`button`,{className:`ctxi`,type:`button`,onClick:()=>{Fe(`mention`),P(``),We(null)},children:`📎 /mention file`}),(0,I.jsx)(`div`,{className:`ctxs`}),(0,I.jsx)(`button`,{className:`ctxi danger`,type:`button`,onClick:()=>{R(`Deleted`,``),We(null)},children:`🗑 Delete`})]}):null,(0,I.jsx)(`div`,{id:`toasts`,children:Ve.map(e=>(0,I.jsx)(`div`,{className:H(`toast`,e.tone),children:e.message},e.id))}),(0,I.jsx)(`input`,{ref:zt,className:`hidden-input`,type:`file`,multiple:!0,onChange:vi}),(0,I.jsx)(`input`,{ref:Rt,className:`hidden-input`,type:`file`,accept:`image/*`,multiple:!0,onChange:_i})]})}function BA(){return(0,I.jsx)(LA,{children:(0,I.jsx)(V,{})})}var VA=Qa({component:BA}),HA=Xa({getParentRoute:()=>VA,path:`/`,component:RA}),UA=Xa({getParentRoute:()=>VA,path:`/threads`,component:RA}),WA=Xa({getParentRoute:()=>VA,path:`/thread/$threadId`,component:RA}),GA=Xa({getParentRoute:()=>VA,path:`/threads/$threadId`,component:RA}),KA=Xa({getParentRoute:()=>VA,path:`/threads/$threadId/$section`,component:RA}),qA=go({routeTree:VA.addChildren([HA,UA,WA,GA,KA])}),JA=new Kt({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}}),YA=document.getElementById(`root`);if(!YA)throw Error(`Root element not found.`);(0,bo.createRoot)(YA).render((0,I.jsx)(Xt,{client:JA,children:(0,I.jsx)(yo,{router:qA})}));export{Le as a,tO as i,WE as n,GE as r,VE as t};
|
|
214
|
+
`).length;break;case`webSearch`:n+=e.query.length;break;case`collabAgentToolCall`:n+=(e.prompt??``).length;break;default:break}return Math.max(0,Math.round(n/3.7))},FA=async e=>{if(typeof navigator<`u`&&navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),t.remove()},IA=e=>new Promise(t=>{window.setTimeout(t,e)}),LA=()=>new Promise(e=>{window.requestAnimationFrame(()=>{e()})}),RA=(e,t)=>e instanceof Error&&e.message.trim()?e.message:typeof e==`string`&&e.trim()?e:e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`&&e.message.trim()?e.message:t,zA=()=>{let e=(0,F.useContext)(_A);if(!e)throw Error(`Workspace context is missing.`);return e};function BA({children:e}){let[t,n]=(0,F.useState)(Sc()),r=(0,F.useRef)(t),i=(0,F.useRef)(null),a=(0,F.useRef)([]);(0,F.useEffect)(()=>{r.current=t},[t]);let o=(0,F.useCallback)(e=>{n(t=>{let n=structuredClone(t);return e(n),n})},[]);(0,F.useEffect)(()=>{let e=new ud(Sc());i.current=e;let t=e.subscribe(e=>{(0,F.startTransition)(()=>{n(e)})}),o=()=>{let t=r.current.transport;t.mode===`live`&&t.status===`connected`||e.connect().catch(()=>void 0)};o();let s=window.setInterval(()=>{o()},5e3),c=()=>{document.visibilityState===`visible`&&o()};return window.addEventListener(`focus`,o),document.addEventListener(`visibilitychange`,c),()=>{t(),window.clearInterval(s),window.removeEventListener(`focus`,o),document.removeEventListener(`visibilitychange`,c),e.disconnect(),a.current.forEach(e=>window.clearTimeout(e)),a.current=[]}},[]);let s=(0,F.useCallback)(async(e,t,n)=>{let a=r.current,o=i.current,s=!!o&&(n?.preferLive||a.transport.mode===`live`&&a.transport.status===`connected`);if(!o&&n?.preferLive)throw Error(`The workspace runtime is still starting. Try again.`);if(o&&s){let i=n?.preferLive?3:1,a=null;for(let s=0;s<i;s+=1)try{let t=r.current;return(t.transport.mode!==`live`||t.transport.status!==`connected`)&&await o.connect(),await e()}catch(e){if(a=e,s<i-1){await IA(320*(s+1));continue}if(n?.fallbackOnLiveError??!0)return await t();throw e}throw a}return await t()},[]),c=(0,F.useCallback)(async(e,t)=>{let n=kd(`thread`),r=Cc(n,t?.title??`New Session`,e,t?.cwd);return o(e=>{e.threads=jd([r,...e.threads.filter(e=>e.thread.id!==n)])}),n},[o]),l=(0,F.useCallback)(async({threadId:e,mode:t,prompt:n,mentions:i,skills:s,images:c,files:l,settings:u})=>{let d=r.current.threads.find(t=>t.thread.id===e)?.thread.cwd??r.current.directoryCatalogRoot??`.`,f=Ec({threadId:e,prompt:n,mode:t,settings:u,mentions:[...i,...Wd(d,l,u.provider)],skills:s,images:c,steer:null});o(r=>{r.threads=jd(r.threads.map(r=>r.thread.id===e?{...r,thread:{...r.thread,preview:n||r.thread.preview,updatedAt:Math.floor(Date.now()/1e3),status:{type:`active`,activeFlags:[]},turns:[...r.thread.turns,f.turn]},plan:f.plan,review:t===`review`?f.review:r.review,terminals:[...f.terminals,...r.terminals].slice(0,6),tokenUsage:{input:r.tokenUsage.input+Math.max(n.length*2,128),output:r.tokenUsage.output,cached:r.tokenUsage.cached}}:r)),r.streams=[...r.streams.filter(t=>t.threadId!==e),...f.streams]});let p=window.setTimeout(()=>{o(n=>{n.threads=jd(n.threads.map(n=>n.thread.id===e?{...n,thread:{...n.thread,updatedAt:Math.floor(Date.now()/1e3),status:{type:`idle`},turns:n.thread.turns.map(e=>e.id===f.turn.id?{...e,status:`completed`,items:e.items.map(e=>{if(e.type===`commandExecution`)return{...e,status:`completed`,exitCode:0,durationMs:1840};if(e.type===`collabAgentToolCall`){let t=Object.fromEntries(Object.entries(e.agentsStates).map(([e,t])=>[e,{...t,status:`completed`,message:t?.message??`Completed.`}]));return{...e,status:`completed`,agentsStates:t}}return e})}:e)},review:t===`review`?f.review:n.review,terminals:n.terminals.map(e=>f.terminals.some(t=>t.id===e.id)?{...e,status:`idle`,lastEvent:`just now`}:e),tokenUsage:{input:n.tokenUsage.input,output:n.tokenUsage.output+512,cached:n.tokenUsage.cached+96}}:n)),n.streams=n.streams.map(t=>t.threadId===e&&t.turnId===f.turn.id?{...t,visible:t.total}:t)})},2800);return a.current.push(p),e},[o]),u=(0,F.useMemo)(()=>({createThread:async(e,t)=>await s(async()=>await i.current.createThread(e,{cwd:t?.cwd}),async()=>await c(e,t),{preferLive:!0,fallbackOnLiveError:!1}),refreshThreads:async()=>await s(async()=>{await i.current.refreshThreads().catch(()=>void 0)},async()=>void 0,{preferLive:!0,fallbackOnLiveError:!1}),resumeThread:async e=>await s(async()=>{let t=i.current;await t.resumeThread(e).catch(()=>void 0),await t.ensureThreadLoaded(e).catch(()=>void 0)},async()=>void 0,{preferLive:!0,fallbackOnLiveError:!1}),interruptTurn:async e=>await s(async()=>await i.current.interruptTurn(e),async()=>{let t=!1;return o(n=>{n.threads=jd(n.threads.map(r=>{if(r.thread.id!==e)return r;let i=[...r.thread.turns].reverse().find(e=>e.status===`inProgress`);return i?(t=!0,wf(n,e,i.id),{...r,thread:{...r.thread,status:{type:`idle`},turns:r.thread.turns.map(e=>e.id===i.id?{...e,status:`interrupted`}:e)}}):r}))}),t}),sendComposer:async e=>await s(async()=>await i.current.sendComposer(e),async()=>await l(e),{preferLive:!0,fallbackOnLiveError:!1}),applySteer:async e=>await s(async()=>await i.current.applySteer(e),async()=>{let t=!1,n={id:`steer:${e.threadId}:${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,turnId:``,prompt:e.prompt.trim()||`Steer applied`,createdAt:Date.now(),status:`applied`};return o(r=>{r.threads=r.threads.map(r=>{if(r.thread.id!==e.threadId)return r;let i=[...r.thread.turns].reverse().find(e=>e.status===`inProgress`);return i?(t=!0,n.turnId=i.id,{...r,steers:[n,...(r.steers??[]).filter(e=>e.id!==n.id)]}):r})}),t},{preferLive:!0,fallbackOnLiveError:!1}),searchMentions:async(e,t)=>await s(async()=>{await i.current.searchMentions(e,t)},async()=>{o(n=>{let r=t.trim().toLowerCase(),i=`${e.replace(/\/+$/u,``)}/`;n.mentionCatalog=yA.filter(e=>e.path.startsWith(i)).filter(e=>r?`${e.name} ${e.path}`.toLowerCase().includes(r):!0).slice(0,18)})}),loadDirectory:async e=>await s(async()=>{await i.current.loadDirectory(e)},async()=>{o(t=>{t.directoryCatalogRoot=e,t.directoryCatalog=Kd(e)})}),readFile:async e=>await s(async()=>await i.current.readFile(e),async()=>{let t=hs(e,r.current.settings.provider);if(t===`#`)throw Error(`File preview is unavailable for this path.`);let n=await fetch(t);if(!n.ok)throw Error(`Failed to read ${e}`);return await n.text()}),saveFile:async(e,t)=>await s(async()=>{await i.current.writeFile(e,t)},async()=>{throw Error(`Saving files requires a live workspace connection.`)},{preferLive:!0,fallbackOnLiveError:!1}),readGitGraph:async(e,t=80)=>await s(async()=>await i.current.readGitGraph(e,t),async()=>``),readGitStatus:async e=>await s(async()=>await i.current.readGitStatus(e),async()=>``),readWorkspaceCommitPreferences:async e=>await s(async()=>await i.current.readWorkspaceCommitPreferences(e),async()=>{throw Error(`Commit preferences require a live workspace connection.`)},{preferLive:!0,fallbackOnLiveError:!1}),writeWorkspaceCommitPreferences:async(e,t)=>await s(async()=>await i.current.writeWorkspaceCommitPreferences(e,t),async()=>{throw Error(`Commit preferences require a live workspace connection.`)},{preferLive:!0,fallbackOnLiveError:!1}),generateCommitMessage:async({cwd:e,providerId:t})=>await s(async()=>await i.current.generateCommitMessage({cwd:e,providerId:t}),async()=>{throw Error(`Commit drafting requires a live workspace connection.`)},{preferLive:!0,fallbackOnLiveError:!1}),commitWorkingTree:async({cwd:e,message:t})=>await s(async()=>await i.current.commitWorkingTree({cwd:e,message:t}),async()=>{throw Error(`Git commit requires a live workspace connection.`)},{preferLive:!0,fallbackOnLiveError:!1}),checkProviderSetup:async e=>await s(async()=>{await i.current.checkProviderSetup(e)},async()=>{o(t=>{let n=e??t.settings.provider;t.providerSetup[n]={...t.providerSetup[n],status:`error`,summary:`Setup checks require a live workspace connection.`,detail:`Reconnect Nomadex to the host bridge, then check again.`,checkedAt:`just now`}})},{preferLive:!0}),startProviderAuth:async(e,t)=>await s(async()=>{await i.current.startProviderAuth(e,t)},async()=>{o(n=>{let r=e??n.settings.provider;n.providerAuth[r]={...n.providerAuth[r],status:`error`,flow:t??n.providerAuth[r].flow,summary:`Provider sign-in requires a live workspace connection.`,detail:`Reconnect Nomadex to the host bridge, then try again.`,processId:null,updatedAt:`just now`}})},{preferLive:!0}),submitProviderAuthSecret:async(e,t)=>await s(async()=>{await i.current.submitProviderAuthSecret(e,t)},async()=>{o(t=>{let n=e??t.settings.provider;t.providerAuth[n]={...t.providerAuth[n],status:`error`,summary:`Provider sign-in requires a live workspace connection.`,detail:`Reconnect Nomadex to the host bridge, then try again.`,processId:null,updatedAt:`just now`}})},{preferLive:!0}),cancelProviderAuth:async e=>await s(async()=>{await i.current.cancelProviderAuth(e)},async()=>{o(t=>{let n=e??t.settings.provider;t.providerAuth[n]={...t.providerAuth[n],status:`idle`,summary:`No sign-in in progress.`,detail:null,authUrl:null,userCode:null,processId:null,updatedAt:`just now`}})},{preferLive:!0}),switchProviderAccount:async(e,t)=>await s(async()=>{await i.current.switchProviderAccount(e,t)},async()=>{o(n=>{let r=e??n.settings.provider;n.providerAuth[r]={...n.providerAuth[r],status:`error`,flow:t??n.providerAuth[r].flow,summary:`Provider account switching requires a live workspace connection.`,detail:`Reconnect Nomadex to the host bridge, then try again.`,processId:null,updatedAt:`just now`}})},{preferLive:!0}),updateSettings:async e=>await s(async()=>{await i.current.updateSettings(e)},async()=>{e.provider&&Go(e.provider),o(t=>{t.settings={...t.settings,...e},t.lastSavedAt=`just now`})}),toggleFeatureFlag:async e=>await s(async()=>{await i.current.toggleFeatureFlag(e)},async()=>{o(t=>{t.featureFlags=t.featureFlags.map(t=>t.name===e?{...t,enabled:!t.enabled}:t),t.lastSavedAt=`just now`})}),toggleInstalledSkill:async e=>await s(async()=>{await i.current.toggleInstalledSkill(e)},async()=>{o(t=>{t.installedSkills=t.installedSkills.map(t=>t.id===e?{...t,enabled:!t.enabled}:t)})}),installSkill:async e=>await s(async()=>{await i.current.installSkill(e)},async()=>{o(t=>{let n=t.remoteSkills.find(t=>t.id===e);n&&(t.installedSkills=[{...n,path:`/home/allan/.codex/skills/${n.name}/SKILL.md`,enabled:!0,source:`installed`},...t.installedSkills],t.remoteSkills=t.remoteSkills.filter(t=>t.id!==e))})}),toggleMcpAuth:async e=>await s(async()=>{await i.current.toggleMcpAuth(e)},async()=>{o(t=>{t.mcpServers=t.mcpServers.map(t=>t.name===e?{...t,authStatus:t.authStatus===`notLoggedIn`?`oAuth`:t.authStatus}:t)})}),startChatGptLogin:async()=>await s(async()=>await i.current.startChatGptLogin(),async()=>(o(e=>{e.account.loginInProgress=!0,e.account.pendingLoginId=kd(`login`),e.account.loginError=null}),`https://chatgpt.com/`)),completeChatGptLogin:async e=>await s(async()=>{let t=await fetch(Ho(r.current.settings.provider).authCompletePath,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({callbackUrl:e})}),n=await t.json().catch(()=>null);if(!t.ok)throw Error(n?.error??n?.message??`Failed to complete mobile login`);await i.current.refreshAccount()},async()=>{o(e=>{e.account={...e.account,planType:`ChatGPT Pro`,workspace:`mobile relay account`,authMode:`chatgpt`,loggedIn:!0,requiresOpenaiAuth:!1,loginInProgress:!1,pendingLoginId:null,loginError:null}})}),loginWithApiKey:async e=>await s(async()=>{await i.current.loginWithApiKey(e)},async()=>{o(e=>{e.account={...e.account,planType:`API key`,workspace:`API key session`,authMode:`apiKey`,loggedIn:!0,requiresOpenaiAuth:!1,loginInProgress:!1,pendingLoginId:null,loginError:null}})}),logoutAccount:async()=>await s(async()=>{await i.current.logoutAccount()},async()=>{o(e=>{e.account={...e.account,planType:`Signed out`,workspace:`No active account`,authMode:`signedOut`,loggedIn:!1,loginInProgress:!1,pendingLoginId:null,loginError:null,usageWindows:[],rateUsed:0,rateLimit:100,credits:`Sign in to view rate limits`}})}),refreshAccount:async()=>await s(async()=>{await i.current.refreshAccount()},async()=>void 0),cleanTerminals:async e=>await s(async()=>{await i.current.cleanTerminals(e)},async()=>{o(t=>{t.threads=t.threads.map(t=>t.thread.id===e?{...t,terminals:t.terminals.filter(e=>e.status===`running`)}:t)})}),startProjectTerminal:async(e,t)=>await s(async()=>await i.current.startProjectTerminal(e,t),async()=>{throw Error(`Interactive terminals require a live workspace connection.`)},{preferLive:!0,fallbackOnLiveError:!1}),sendTerminalInput:async(e,t,n)=>await s(async()=>{await i.current.sendTerminalInput(t,n)},async()=>{throw Error(`Interactive terminals require a live workspace connection.`)},{preferLive:!0,fallbackOnLiveError:!1}),terminateTerminal:async(e,t)=>await s(async()=>{await i.current.terminateTerminal(t)},async()=>{throw Error(`Interactive terminals require a live workspace connection.`)},{preferLive:!0,fallbackOnLiveError:!1}),resolveApproval:async(e,t)=>await s(async()=>{await i.current.resolveApproval(e,t)},async()=>{o(n=>{n.threads=n.threads.map(n=>({...n,approvals:n.approvals.map(n=>n.id===e?{...n,state:t===`accept`||t===`acceptForSession`?`approved`:`declined`}:n)}))})}),submitQuestion:async(e,t)=>await s(async()=>{await i.current.submitQuestion(e,t)},async()=>{o(n=>{n.threads=n.threads.map(n=>({...n,approvals:n.approvals.map(n=>n.id===e?{...n,state:`submitted`,detail:`${n.detail} · ${Object.values(t).flat().filter(Boolean).join(`, `)}`}:n)}))})}),submitMcp:async(e,t,n)=>await s(async()=>{await i.current.submitMcp(e,t,n)},async()=>{o(n=>{n.threads=n.threads.map(n=>({...n,approvals:n.approvals.map(n=>n.id===e?{...n,state:t===`accept`?`submitted`:`declined`}:n)}))})}),rollbackToTurn:async(e,t)=>await s(async()=>{await i.current.rollbackToTurn(e,t)},async()=>{o(n=>{n.threads=n.threads.map(n=>{if(n.thread.id!==e)return n;let r=n.thread.turns.filter(e=>e.status!==`inProgress`),i=r.findIndex(e=>e.id===t);if(i===-1)return n;let a=new Set(r.slice(i).map(e=>e.id));if(a.size===0)return n;let o=n.thread.turns.filter(e=>!a.has(e.id));return{...n,thread:{...n.thread,turns:o,updatedAt:Math.floor(Date.now()/1e3)},steers:(n.steers??[]).filter(e=>!a.has(e.turnId)),approvals:n.approvals.filter(e=>!e.turnId||!a.has(e.turnId))}})})},{preferLive:!0,fallbackOnLiveError:!1}),forkThread:async e=>{let t=r.current.threads.find(t=>t.thread.id===e),n=kd(`thread`);return o(e=>{let r=t?structuredClone(t):Cc(n,`Forked Session`,e.settings);r.thread.id=n,r.thread.name=t?`Fork of ${Yd(t)}`:`Forked Session`,r.thread.preview=t?.thread.preview??`Forked session`,r.thread.createdAt=Math.floor(Date.now()/1e3),r.thread.updatedAt=Math.floor(Date.now()/1e3),r.thread.status={type:`idle`},r.approvals=[],r.terminals=[],e.threads=jd([r,...e.threads.filter(e=>e.thread.id!==n)])}),n},compactThread:async e=>{o(t=>{t.threads=t.threads.map(t=>{if(t.thread.id!==e)return t;let n=[...t.thread.turns];if(n.length===0)return t;let r=n[n.length-1];return r.items.some(e=>e.type===`contextCompaction`)||(r.items=[...r.items,{type:`contextCompaction`,id:kd(`compact`)}]),{...t,plan:t.plan?{...t.plan,explanation:`Conversation compacted to free context.`}:t.plan,thread:{...t.thread,turns:n}}})})}}),[c,o,l,s]);return(0,I.jsx)(_A.Provider,{value:{snapshot:t,actions:u},children:e})}function VA(){return(0,I.jsx)(HA,{})}function HA(){let{snapshot:e,actions:t}=zA(),n=Na(),r=Ta({select:e=>e.location}),i=zd(r.pathname),a=(0,F.useMemo)(()=>{let e=r.pathname.split(`/`).filter(Boolean);return e[0]!==`threads`||!e[1]||!e[2]||gd(e[2])?null:e[2]},[r.pathname]),o=(0,F.useMemo)(()=>new URLSearchParams(r.search),[r.search]),s=(0,F.useMemo)(()=>{let t=new Map;return e.threads.forEach(e=>{let n=t.get(e.thread.id);(!n||e.thread.updatedAt>=n.thread.updatedAt)&&t.set(e.thread.id,e)}),jd([...t.values()])},[e.threads]),c=(0,F.useMemo)(()=>{let e={};return s.forEach(t=>{e[t.thread.id]=Yd(t)}),e},[s]),l=i.threadId??s[0]?.thread.id??null,u=l?s.find(e=>e.thread.id===l)??null:null,d=u?c[u.thread.id]??Vd(u.thread):`New Session`,f=Id(i.section),[p,m]=(0,F.useState)(()=>Ad()),h=i.section===`editor`?o.get(`path`):null,g=(0,F.useMemo)(()=>{let e=i.section===`editor`?o.get(`line`):null;if(!e)return null;let t=Number(e);return Number.isFinite(t)&&t>0?t:null},[i.section,o]),_=(0,F.useMemo)(()=>{let e=i.section===`editor`?o.get(`from`):null;switch(e){case`ops`:case`review`:case`agents`:case`skills`:case`mcp`:case`settings`:case`chat`:return e;default:return`chat`}},[i.section,o]),v=i.section===`review`?o.get(`diff`):null,y=(0,F.useMemo)(()=>{let e=i.section===`review`?o.get(`from`):null;switch(e){case`ops`:case`agents`:case`skills`:case`mcp`:case`settings`:case`chat`:return e;default:return`chat`}},[i.section,o]),[b,x]=(0,F.useState)(!1),[S,C]=(0,F.useState)(()=>Ad()),[w,T]=(0,F.useState)(!1),[E,D]=(0,F.useState)(f??`files`),[O,k]=(0,F.useState)(!1),[ee,te]=(0,F.useState)(!1),[ne,A]=(0,F.useState)(!1),[j,re]=(0,F.useState)(!1),[ie,ae]=(0,F.useState)(!1),[oe,se]=(0,F.useState)(!1),[M,ce]=(0,F.useState)(vA.directoryCatalogRoot||`.`),[le,ue]=(0,F.useState)(``),[de,fe]=(0,F.useState)(`chat`),[pe,me]=(0,F.useState)(!1),[he,ge]=(0,F.useState)(!1),[_e,ve]=(0,F.useState)(!1),[ye,be]=(0,F.useState)(!1),[xe,Se]=(0,F.useState)(!1),[Ce,we]=(0,F.useState)([]),[Te,N]=(0,F.useState)([]),[Ee,De]=(0,F.useState)([]),[Oe,ke]=(0,F.useState)([]),[Ae,je]=(0,F.useState)(l?[l,...e.threads.slice(1,2).map(e=>e.thread.id)]:[]),[Me,Ne]=(0,F.useState)(``),[Pe,Fe]=(0,F.useState)(null),[Ie,P]=(0,F.useState)(``),[Le,Re]=(0,F.useState)(0),[ze,Be]=(0,F.useState)({}),[Ve,He]=(0,F.useState)([]),[Ue,We]=(0,F.useState)(null),[Ge,Ke]=(0,F.useState)(null),[qe,Je]=(0,F.useState)(null),[Ye,Xe]=(0,F.useState)(!1),[Ze,Qe]=(0,F.useState)(null),[$e,et]=(0,F.useState)({}),[tt,nt]=(0,F.useState)({}),[rt,it]=(0,F.useState)({}),at=(0,F.useRef)(null),ot=(0,F.useRef)(null),[st,ct]=(0,F.useState)(!1),[lt,ut]=(0,F.useState)(null),[dt,ft]=(0,F.useState)(!1),[pt,mt]=(0,F.useState)(null),[ht,gt]=(0,F.useState)(0),[_t,vt]=(0,F.useState)(e.settings.provider),[yt,bt]=(0,F.useState)(null),[xt,St]=(0,F.useState)(``),[Ct,wt]=(0,F.useState)(!1),[Tt,Et]=(0,F.useState)(!1),[Dt,Ot]=(0,F.useState)({top:52,right:12}),[kt,At]=(0,F.useState)(0);(0,F.useEffect)(()=>{!a||!i.threadId||n({to:`/threads/$threadId`,params:{threadId:i.threadId},replace:!0})},[a,n,i.threadId]);let[jt,Mt]=(0,F.useState)(()=>{if(typeof window>`u`)return yd;let e=window.localStorage.getItem(bd);return Dd(e)?e:yd}),Nt=(0,F.useRef)(null),Pt=(0,F.useRef)(null),Ft=(0,F.useRef)(null),It=(0,F.useRef)(null),Lt=(0,F.useRef)(null),Rt=(0,F.useRef)(null),zt=(0,F.useRef)(null),Bt=(0,F.useRef)({}),Vt=(0,F.useRef)({}),Ht=(0,F.useRef)({}),Ut=(0,F.useRef)(null),Wt=(0,F.useRef)(le),Gt=(0,F.useRef)(!1),Kt=(0,F.useRef)({}),qt=(0,F.useRef)(!1),Jt=(0,F.useRef)(``),Yt=(0,F.useRef)(``),Xt=(0,F.useRef)(null),Zt=(0,F.useRef)(null),Qt=(0,F.useRef)(null),$t=(0,F.useRef)(!0),en=(0,F.useRef)({}),tn=(0,F.useRef)({}),[nn,rn]=(0,F.useState)({}),[an,on]=(0,F.useState)(0),[sn,cn]=(0,F.useState)(!1),ln=(0,F.useDeferredValue)(le),un=(0,F.useDeferredValue)(Ie);(0,F.useEffect)(()=>{Wt.current=le},[le]);let dn=i.threadId??l??`__default__`;(0,F.useEffect)(()=>{let e=mA()[dn]??``;Gt.current=!0,ue(e),At(e=>e+1)},[dn]),(0,F.useEffect)(()=>{if(Gt.current){Gt.current=!1;return}let e=mA();if(le){hA({...e,[dn]:le});return}if(!(dn in e))return;let t={...e};delete t[dn],hA(t)},[le,dn]);let[fn,pn]=(0,F.useState)(!0);(0,F.useEffect)(()=>()=>{Ut.current!==null&&window.cancelAnimationFrame(Ut.current)},[]),(0,F.useEffect)(()=>{let e=()=>{m(e=>{let t=Ad();return e===t?e:t})};return e(),window.addEventListener(`resize`,e,{passive:!0}),()=>{window.removeEventListener(`resize`,e)}},[]);let mn=(0,F.useCallback)(()=>{let e=Lt.current?.getBoundingClientRect();Ot({top:(e?.bottom??48)+4,right:Math.max(12,window.innerWidth-(e?.right??window.innerWidth-12))})},[]);(0,F.useEffect)(()=>{if(typeof document>`u`)return;let e=Od(jt),t=document.documentElement;t.dataset.uiTheme=e.id,t.style.setProperty(`color-scheme`,e.mode),window.localStorage.setItem(bd,jt),document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,e.themeColor),document.querySelector(`meta[name="color-scheme"]`)?.setAttribute(`content`,e.mode),document.querySelector(`meta[name="apple-mobile-web-app-status-bar-style"]`)?.setAttribute(`content`,e.mode===`light`?`default`:`black-translucent`)},[jt]),(0,F.useLayoutEffect)(()=>{if(!ee)return;let e=()=>{mn()};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[ee,mn]);let hn=(0,F.useMemo)(()=>{let e=new Set(s.map(e=>e.thread.id));return[...new Set(Ae.filter(t=>e.has(t)))].slice(0,6)},[Ae,s]),L=(0,F.useMemo)(()=>Nd(u?.thread.turns??[]),[u?.thread.turns]),gn=(0,F.useMemo)(()=>Math.max(0,L.length-bA),[L.length]),_n=(0,F.useMemo)(()=>{if(!l)return gn;let e=$e[l];if(e==null)return gn;let t=L.length===0?0:Math.max(0,L.length-1);return Math.max(0,Math.min(e,t))},[gn,l,L.length,$e]),vn=(0,F.useMemo)(()=>L.slice(_n),[L,_n]),yn=(0,F.useMemo)(()=>L.map(e=>`${e.id}:${e.status}:${e.items.length}:${e.error?.message??``}`).join(`|`),[L]),bn=[...L].reverse().find(e=>e.status===`inProgress`)??null,xn=(0,F.useMemo)(()=>h?yf(h):null,[h]),Sn=(0,F.useMemo)(()=>{if(!xn)return null;let e=u?.thread.cwd?yf(u.thread.cwd).replace(/\/+$/u,``):null;return e&&xn.startsWith(`${e}/`)?xn.slice(e.length+1):null},[u?.thread.cwd,xn]),Cn=(0,F.useMemo)(()=>{if(i.section!==`editor`||!xn)return``;let e=new Set([xn,Sn].filter(e=>!!e));return L.flatMap(t=>_s(t).filter(t=>e.has(yf(t.path))).map(e=>`${t.id}:${e.itemId}:${e.path}:${e.kind}:${e.status}:${t.status}`)).join(`|`)},[L,xn,Sn,i.section]),wn=l?ze[l]??[]:[],Tn=(0,F.useMemo)(()=>vs(bn),[bn]),En=(0,F.useMemo)(()=>_s(bn),[bn]),Dn=!w&&S&&i.section!==`editor`&&i.section!==`review`,On=Dn&&!p,kn=p||b,An=!p&&On,jn=O||ne||j||ie,Mn=(0,F.useMemo)(()=>u?.approvals.filter(e=>e.state===`pending`).length??0,[u?.approvals]),Nn=(0,F.useMemo)(()=>u?.approvals.filter(e=>e.state===`pending`)??[],[u?.approvals]),Pn=Pd(e.settings),Fn=(0,F.useMemo)(()=>{let e=u?.thread.cwd??null;return e?!Ge||!qd(e,Ge)?e:Ge:null},[u?.thread.cwd,Ge]),In=(0,F.useMemo)(()=>({...e.settings,collaborationMode:he?`plan`:`default`}),[e.settings,he]);(0,F.useEffect)(()=>{let t=new Set(e.threads.flatMap(e=>e.approvals.filter(e=>e.kind===`question`&&e.state===`pending`).map(e=>e.id)));nt(e=>{let n=Object.entries(e).filter(([e])=>t.has(e));return n.length===Object.keys(e).length?e:Object.fromEntries(n)})},[e.threads]),(0,F.useEffect)(()=>{let t=new Set(e.threads.flatMap(e=>e.approvals.filter(e=>e.kind===`mcp`&&e.state===`pending`).map(e=>e.id)));it(e=>{let n=Object.entries(e).filter(([e])=>t.has(e));return n.length===Object.keys(e).length?e:Object.fromEntries(n)})},[e.threads]);let Ln=(0,F.useMemo)(()=>{let e={Today:[],Yesterday:[],Earlier:[]};return s.forEach(t=>{e[Bd(t.thread.updatedAt)].push(t)}),e},[s]),Rn=(0,F.useMemo)(()=>e.providers.find(t=>t.id===e.settings.provider)??Ho(e.settings.provider),[e.providers,e.settings.provider]),zn=(0,F.useMemo)(()=>Zo(Rn.id,e.models.length>0?e.models:vA.models),[Rn.id,e.models]),Bn=(0,F.useMemo)(()=>Qo(Rn.id,e.settings.model,e.models.length>0?e.models:vA.models),[Rn.id,e.settings.model,e.models]),Vn=`${Rn.displayName} · ${Bn?.displayName??(e.settings.model===`default`?`provider default`:e.settings.model)}`,Hn=(0,F.useMemo)(()=>Od(jt),[jt]),Un=(0,F.useMemo)(()=>L.flatMap(e=>e.items.filter(e=>e.type===`fileChange`)),[L]),Wn=(0,F.useMemo)(()=>L.flatMap(e=>e.items.flatMap(e=>e.type===`fileChange`?(e.changes.length>0?e.changes:[{path:`Editing files`,kind:{type:`update`,move_path:null},diff:``}]).map((t,n)=>{let r=xf(t.diff);return{id:vf(e.id,n,t.path),itemId:e.id,path:t.path,diff:t.diff,kind:t.kind,status:e.status,additions:r.additions,removals:r.removals,hunks:r.hunks}}):[])).reverse(),[L]),Gn=(0,F.useMemo)(()=>s.filter(e=>e.thread.cwd===u?.thread.cwd),[u?.thread.cwd,s]),Kn=(0,F.useMemo)(()=>u?.thread.cwd?.trim()||e.directoryCatalogRoot||null,[u?.thread.cwd,e.directoryCatalogRoot]),qn=(0,F.useMemo)(()=>Wn.find(e=>e.id===Ze)??Wn[0]??null,[Wn,Ze]);(0,F.useEffect)(()=>{if(!u){vt(e.settings.provider),bt(null),St(``);return}if(!Kn){vt(e.settings.provider),bt(null);return}let n=!1;return St(``),t.readWorkspaceCommitPreferences(Kn).then(e=>{n||(vt(e.provider),bt(e.filePath))}).catch(()=>{n||(vt(e.settings.provider),bt(null))}),()=>{n=!0}},[t,u,Kn,e.settings.provider]),(0,F.useEffect)(()=>{if(!u){ut(null),ft(!1),mt(null);return}let e=Ks({activeThread:u,relatedThreads:Gn});if(ut(e),mt(null),E!==`graph`){ft(!1);return}let n=`${u.thread.cwd}:${u.thread.gitInfo?.sha??`workspace`}`,r=Kt.current[n]??``,i=!1;return ft(!0),Promise.allSettled([r?Promise.resolve(r):t.readGitGraph(u.thread.cwd,80),t.readGitStatus(u.thread.cwd)]).then(([t,r])=>{if(i)return;let a=t.status===`fulfilled`?t.value:``,o=r.status===`fulfilled`?r.value:``,s=Ks({activeThread:u,relatedThreads:Gn,rawStatus:o}),c=(a.trim().length>0?Gs({activeThread:u,rawLog:a,rawStatus:o}):null)??s??e;a.trim().length>0&&(Kt.current[n]=a),mt(t.status===`rejected`?RA(t.reason,`Unable to read git history.`):null),ut(c)}).finally(()=>{i||ft(!1)}),()=>{i=!0}},[t,u,ht,E,Gn]);let Jn=lt?.workingTree??null,Yn=!!Jn?.dirty||Un.some(e=>e.status!==`failed`),Xn=!!Jn?.buckets.some(e=>e.id===`staged`&&e.entries.length>0),Zn=lt?.branchLabel||u?.thread.gitInfo?.branch||`current branch`,Qn=(0,F.useMemo)(()=>{if(!u)return[];if(!qn)return u.review;let e=yf(qn.path);return u.review.filter(t=>{let n=yf(t.file);return n===e||n.endsWith(`/${e}`)})},[u,qn]),$n=(0,F.useMemo)(()=>e.directoryCatalogRoot===M?e.directoryCatalog.filter(e=>e.kind===`directory`):[],[M,e.directoryCatalog,e.directoryCatalogRoot]),er=(0,F.useMemo)(()=>jA(M),[M]),tr=(0,F.useMemo)(()=>MA(M),[M]),nr=(0,F.useMemo)(()=>L.flatMap(e=>e.items.filter(e=>e.type===`collabAgentToolCall`)),[L]),rr=(0,F.useMemo)(()=>{for(let e of[...L].reverse())for(let t of[...e.items].reverse())if(t.type===`agentMessage`)return t;return null},[L]),ir=(0,F.useMemo)(()=>{if(Pe===`mention`){let t=Ie.replace(/^@/u,``).trim().toLowerCase(),n=u&&e.directoryCatalogRoot===u.thread.cwd?e.directoryCatalog.filter(e=>t?`${e.name} ${e.path}`.toLowerCase().includes(t):!0):[],r=new Map;return[...n,...e.mentionCatalog].forEach(e=>{r.has(e.path)||r.set(e.path,e)}),[...r.values()].slice(0,24).map(e=>({id:e.id,label:e.name,description:Hd(e.path,92),mode:`mention`,value:e.path}))}return Pe===`skill`?[...e.installedSkills,...e.remoteSkills].map(e=>({id:e.id,label:`$${e.name}`,description:e.description,mode:`skill`,value:e.name})):Td.map(e=>({id:e.cmd,label:e.cmd,description:e.dsc,mode:`slash`,value:e.cmd}))},[u,Pe,Ie,e.directoryCatalog,e.directoryCatalogRoot,e.installedSkills,e.mentionCatalog,e.remoteSkills]),ar=(0,F.useMemo)(()=>{let e=un.trim().toLowerCase();return e?ir.filter(t=>`${t.label} ${t.description}`.toLowerCase().includes(e)).slice(0,12):ir.slice(0,12)},[un,ir]);(0,F.useEffect)(()=>{if(!l)return;let e=window.requestAnimationFrame(()=>{je(e=>e.includes(l)?e:[l,...e.filter(e=>e!==l)].slice(0,6))});return()=>{window.cancelAnimationFrame(e)}},[l]),(0,F.useLayoutEffect)(()=>{l&&Xt.current!==l&&(delete en.current[l],et(e=>{if(!(l in e))return e;let t={...e};return delete t[l],t}),$t.current=!0,Zt.current=null,Qt.current=null)},[l]);let or=(0,F.useMemo)(()=>e.transport.mode===`live`&&e.transport.status===`connected`&&!!u&&hf(u,L),[u,L,e.transport.mode,e.transport.status]),sr=(0,F.useMemo)(()=>{if(!i.threadId||e.transport.mode!==`live`)return!1;if(e.transport.status===`connecting`)return!0;if(e.transport.status!==`connected`)return!1;if(!u||u.thread.id!==i.threadId){let t=e.threads.some(e=>e.thread.id===i.threadId);return e.threads.length===0||t}return hf(u,L)},[u,L,i.threadId,e.threads,e.transport.mode,e.transport.status]),cr=(0,F.useMemo)(()=>i.threadId===u?.thread.id&&or,[or,u?.thread.id,i.threadId]);(0,F.useEffect)(()=>{if(fn){if(e.transport.status===`connecting`){qt.current=!0;return}qt.current&&(sr||pn(!1))}},[sr,fn,e.transport.status]);let lr=(0,F.useCallback)(()=>{on(e=>e+1)},[]),ur=(0,F.useCallback)((e,t,r=`chat`)=>{!e||!t||e===t||(je(n=>{let r=n.map(n=>n===e?t:n);return r.includes(t)||r.unshift(t),[...new Set(r)].slice(0,6)}),Be(n=>{let r=n[e]??[];if(r.length===0)return n;let i={...n};return delete i[e],i[t]=[...r,...i[t]??[]],i}),Bt.current[e]&&(Bt.current[t]=Bt.current[e],delete Bt.current[e]),Vt.current[e]&&(Vt.current[t]=Vt.current[e],delete Vt.current[e]),en.current[e]&&(en.current[t]=en.current[e],delete en.current[e]),Xt.current===e&&(Xt.current=t),Zt.current?.threadId===e&&(Zt.current={...Zt.current,threadId:t}),et(n=>{if(!(e in n))return n;let r={...n};return r[t]=r[e]??r[t]??0,delete r[e],r}),i.threadId===e&&n(r===`chat`?{to:`/threads/$threadId`,params:{threadId:t}}:{to:`/threads/$threadId/$section`,params:{threadId:t,section:hd(r)}}),lr())},[n,lr,i.threadId]),dr=(0,F.useCallback)(async(e,n=`chat`)=>{try{let r=await t.sendComposer(e);return ur(e.threadId,r,n),r}catch(t){let r=pA(t);throw r&&ur(e.threadId,r,n),t}},[t,ur]),fr=(0,F.useCallback)((e,t,n)=>{nt(r=>({...r,[e]:{...r[e]??{},[t]:n}}))},[]),pr=(0,F.useCallback)(async e=>{let n=gA(e,tt[e.id]??{});await t.submitQuestion(e.id,n),nt(t=>{if(!(e.id in t))return t;let n={...t};return delete n[e.id],n})},[t,tt]),mr=(0,F.useCallback)((e,t)=>{it(n=>({...n,[e]:t}))},[]),hr=(0,F.useCallback)(async(e,n)=>{await t.resolveApproval(e.id,n)},[t]),gr=(0,F.useCallback)(async(e,n)=>{await t.submitMcp(e.id,n,rt[e.id]??``),it(t=>{if(!(e.id in t))return t;let n={...t};return delete n[e.id],n})},[t,rt]),_r=(0,F.useCallback)(e=>e.kind===`question`?(0,I.jsx)(YS,{answers:tt[e.id]??{},approval:e,onAnswerChange:(t,n)=>fr(e.id,t,n),onSubmit:()=>void pr(e)},e.id):(0,I.jsx)(US,{approval:e,mcpContentText:rt[e.id]??``,onMcpContentChange:t=>mr(e.id,t),onResolve:t=>void hr(e,t),onSubmitMcp:t=>void gr(e,t)},e.id),[rt,tt,hr,gr,pr,mr,fr]);(0,F.useEffect)(()=>{if(!i.threadId||e.transport.mode!==`live`||e.transport.status!==`connected`||u&&u.thread.id===i.threadId&&!hf(u,L))return;let n=i.threadId,r=0,a=()=>{r+=1,t.resumeThread(n)};a();let o=window.setInterval(()=>{if(r>=5){window.clearInterval(o);return}a()},1200);return()=>{window.clearInterval(o)}},[t,u,L,i.threadId,e.transport.mode,e.transport.status]),(0,F.useEffect)(()=>{if(fn||i.threadId||e.transport.mode!==`live`||e.transport.status!==`connected`){cn(!1);return}if(s.length>0){cn(!0);return}let n=!1,r=0,a=0;cn(!1);let o=()=>{a+=1,t.refreshThreads().finally(()=>{if(!n){if(a>=4){cn(!0);return}r=window.setTimeout(o,700)}})};return o(),()=>{n=!0,window.clearTimeout(r)}},[i.threadId,t,fn,e.transport.mode,e.transport.status,s.length]),(0,F.useEffect)(()=>{if(i.section!==`review`)return;let e=v&&Wn.some(e=>e.id===v)?v:Wn[0]?.id??null;Qe(t=>t===e?t:e)},[Wn,v,i.section]),(0,F.useEffect)(()=>{if(!Ze||!Wn.some(e=>e.id===Ze)){let e=window.requestAnimationFrame(()=>{Qe(Wn[0]?.id??null)});return()=>{window.cancelAnimationFrame(e)}}},[Wn,Ze]),(0,F.useEffect)(()=>{e.transport.mode===`live`&&e.transport.status!==`connected`||Object.entries(ze).forEach(([t,n])=>{if(n.length===0||Bt.current[t])return;let r=e.threads.find(e=>e.thread.id===t)?.thread.turns.some(e=>e.status===`inProgress`)??!1;if(Vt.current[t]){if(r)return;delete Vt.current[t]}if(r)return;let[i]=n;i&&(Bt.current[t]=!0,Be(e=>{let n=e[t]??[];if(n[0]?.id!==i.id)return e;let r=n.slice(1);if(r.length===0){let n={...e};return delete n[t],n}return{...e,[t]:r}}),dr({threadId:t,mode:i.mode,prompt:i.prompt,mentions:i.mentions,skills:i.skills,images:i.images,files:i.files,settings:In}).then(e=>{Vt.current[e]=!0}).catch(e=>{let n=pA(e)??t;Be(e=>({...e,[n]:[i,...e[n]??[]]})),lr()}).finally(()=>{delete Bt.current[t]}))})},[In,ze,an,lr,dr,e.threads,e.transport.mode,e.transport.status]),(0,F.useEffect)(()=>{let e=()=>{typeof document<`u`&&document.visibilityState!==`visible`||lr()},t=()=>{document.visibilityState===`visible`&&lr()};return window.addEventListener(`focus`,e),document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(`focus`,e),document.removeEventListener(`visibilitychange`,t)}},[lr]),(0,F.useLayoutEffect)(()=>{if(i.section===`editor`||i.section===`review`){C(!1);return}if(!p&&w){C(!1);return}if(!f){p||C(!1);return}D(e=>e===f||f===`files`&&e===`graph`?e:f),C(e=>e||!0)},[p,w,i.section,f]),(0,F.useEffect)(()=>{w&&(p||!f)&&T(!1)},[p,w,f]),(0,F.useEffect)(()=>{if(!u||Pe!==`mention`)return;e.directoryCatalogRoot!==u.thread.cwd&&t.loadDirectory(u.thread.cwd);let n=un.replace(/^@/,``).trim();n&&t.searchMentions(u.thread.cwd,n)},[t,u,un,Pe,e.directoryCatalogRoot]),(0,F.useEffect)(()=>{let e=u?.thread.cwd;if(!e)return;let t=window.requestAnimationFrame(()=>{Ke(t=>t&&qd(e,t)?t:e),Je(t=>t&&qd(e,t.path)?t:null)});return()=>{window.cancelAnimationFrame(t)}},[u?.thread.cwd]),(0,F.useEffect)(()=>{Fn&&t.loadDirectory(Fn)},[t,Fn]),(0,F.useEffect)(()=>{j&&t.loadDirectory(M)},[t,j,M]),(0,F.useEffect)(()=>{if(i.section!==`editor`||!h||qe?.path===h&&!qe.loading&&qe.error===null)return;let e=h.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??h,n=!1;return t.readFile(h).then(t=>{n||(0,F.startTransition)(()=>{Je({path:h,name:e,content:t,loading:!1,error:null,line:g})})}).catch(t=>{n||Je({path:h,name:e,content:``,loading:!1,error:t instanceof Error?t.message:`Unable to open this file.`,line:g})}),()=>{n=!0}},[t,g,h,qe,i.section]),(0,F.useEffect)(()=>{if(i.section!==`editor`||!h){Yt.current=``,Jt.current=``,Xe(!1);return}let e=`${i.section}:${h}`;Yt.current!==e&&(Yt.current=e,Jt.current=Cn,Xe(!1))},[Cn,h,i.section]),(0,F.useEffect)(()=>{if(i.section!==`editor`||!h||!Cn||Ye||qe?.path!==h||qe.loading||Jt.current===Cn)return;Jt.current=Cn;let e=h.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??h,n=qe.content,r=!1,a=null,o=async i=>{try{let e=await t.readFile(h);if(r)return;if(i&&e===n){a=window.setTimeout(()=>{o(!1)},160);return}(0,F.startTransition)(()=>{Je(t=>t?.path===h?{...t,content:e,loading:!1,error:null,line:g}:t)})}catch(t){if(r)return;Je({path:h,name:e,content:n,loading:!1,error:t instanceof Error?t.message:`Unable to refresh this file.`,line:g})}};return o(!0),()=>{r=!0,a!==null&&window.clearTimeout(a)}},[t,Cn,Ye,g,h,qe,i.section]),(0,F.useEffect)(()=>{let t=e.transport.mode===`live`,n=e.streams;if(t){let e=window.requestAnimationFrame(()=>{let e={};for(let t of n){let n=Cf(t);e[t.key]=n}tn.current=e,(0,F.startTransition)(()=>{rn(e)})});return()=>{window.cancelAnimationFrame(e)}}let r=window.requestAnimationFrame(()=>{let e=tn.current,t=Object.keys(e).length!==n.length,r={};for(let i of n){let n=Cf(i),a=Math.min(e[i.key]??0,n);r[i.key]=a,(e[i.key]??void 0)!==a&&(t=!0)}t&&(tn.current=r,(0,F.startTransition)(()=>{rn(r)}))}),i=window.setInterval(()=>{let e=tn.current,t={},r=Object.keys(e).length!==n.length;for(let i of n){let n=Cf(i),a=Math.min(e[i.key]??0,n),o=n-a,s=Math.max(1,i.speed,Math.ceil(o/5)),c=a<n?Math.min(n,a+s):a;t[i.key]=c,c!==a&&(r=!0)}r&&(tn.current=t,(0,F.startTransition)(()=>{rn(t)}))},24);return()=>{window.cancelAnimationFrame(r),window.clearInterval(i)}},[e.streams,e.transport.mode]);let vr=(0,F.useCallback)(e=>e.scrollHeight-e.scrollTop-e.clientHeight<=72,[]),yr=(0,F.useCallback)((e=l)=>{let t=Nt.current;if(!t||!e)return;let n=vr(t);$t.current=n,ct(e=>e===!n?e:!n),en.current[e]={pinned:n,top:t.scrollTop}},[l,vr]),br=(0,F.useCallback)(()=>{if(!l||_n<=0||cr)return;let e=Nt.current;e&&Zt.current?.threadId!==l&&(Zt.current={threadId:l,previousHeight:e.scrollHeight,previousTop:e.scrollTop},et(e=>{let t=e[l]??gn,n=Math.max(0,t-xA);return n===t?(Zt.current=null,e):{...e,[l]:n}}))},[gn,l,_n,cr]),xr=(0,F.useCallback)((e=!1)=>{let t=Nt.current;t&&(!e&&!$t.current||(t.scrollTop=t.scrollHeight,$t.current=!0,ct(!1),l&&(en.current[l]={pinned:!0,top:t.scrollTop})))},[l]);(0,F.useEffect)(()=>{let e=Nt.current;if(!e||!l||i.section===`editor`||i.section===`review`)return;let t=()=>{let t=vr(e);$t.current=t,ct(e=>e===!t?e:!t),en.current[l]={pinned:t,top:e.scrollTop}};t();let n=()=>{t(),e.scrollTop<=48&&br()};return e.addEventListener(`scroll`,n,{passive:!0}),()=>{t(),e.removeEventListener(`scroll`,n)}},[l,vr,br,i.section]);let Sr=(0,F.useCallback)(e=>{let t=null,n=null,r=0,i=()=>{xr(e?.force??!1);let n=Nt.current;if(!n)return;let a=n.scrollHeight-n.scrollTop-n.clientHeight;r+=1,a>2&&r<8&&(t=window.requestAnimationFrame(i))};return t=window.requestAnimationFrame(i),n=e?.extraDelay?window.setTimeout(i,90):null,()=>{t!==null&&window.cancelAnimationFrame(t),n!==null&&window.clearTimeout(n)}},[xr]);(0,F.useLayoutEffect)(()=>{Nt.current&&xr()},[xr,nn,yn]),(0,F.useLayoutEffect)(()=>{if(!l||i.section===`editor`||i.section===`review`)return;let e=Xt.current===l?en.current[l]:void 0;$t.current=e?.pinned??!0,ct(!(e?.pinned??!0))},[l,i.section]),(0,F.useLayoutEffect)(()=>{if(!l||i.section===`editor`||i.section===`review`)return;let e=()=>{let e=Nt.current;if(!e)return;let t=Xt.current===l,n=t?en.current[l]:void 0;if(!t){xr(!0);return}if(!n){Xt.current=null,xr(!0);return}if(n.pinned){Xt.current=null,xr(!0);return}let r=Math.max(0,e.scrollHeight-e.clientHeight);e.scrollTop=Math.min(n.top,r),Xt.current=null,yr(l)};e();let t=window.requestAnimationFrame(e),n=window.setTimeout(e,90);return()=>{window.cancelAnimationFrame(t),window.clearTimeout(n)}},[l,xr,i.section,yr]),(0,F.useLayoutEffect)(()=>{let e=Zt.current;if(!e||e.threadId!==l)return;let t=Nt.current;if(!t)return;let n=t.scrollHeight-e.previousHeight;t.scrollTop=e.previousTop+n,Zt.current=null,yr(l)},[l,vn.length,yr]),(0,F.useEffect)(()=>()=>{i.section===`editor`||i.section===`review`||yr(l)},[l,i.section,yr]),(0,F.useEffect)(()=>{if(!l){ct(!1),Qt.current=null;return}if(cr||L.length===0){Qt.current=null;return}let e=`${l}:${L.at(-1)?.id??`empty`}:${L.length}`;if(Qt.current!==e)return Qt.current=e,Sr({extraDelay:!0,force:!0})},[l,L,cr,Sr]);let Cr=(0,F.useCallback)(()=>{Sr({extraDelay:!0,force:!0})},[Sr]);(0,F.useEffect)(()=>()=>Ee.forEach(e=>e.url.startsWith(`blob:`)&&URL.revokeObjectURL(e.url)),[Ee]);let R=(0,F.useCallback)((e,t)=>{let n=kd(`toast`);He(r=>[...r,{id:n,message:e,tone:t}]);let r=window.setTimeout(()=>{He(e=>e.filter(e=>e.id!==n)),delete Ht.current[n]},2600);Ht.current[n]=r},[]),wr=(0,F.useCallback)(()=>{Kt.current={},gt(e=>e+1)},[]),Tr=(0,F.useCallback)(async()=>{wr(),Qe(null);let e=Fn??Kn;if(e)try{await t.loadDirectory(e)}catch{Kn&&Kn!==e&&(Ke(Kn),await t.loadDirectory(Kn).catch(()=>void 0))}h&&Je({path:h,name:h.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??h,content:``,loading:!0,error:null,line:g})},[t,Fn,Kn,g,h,wr]),Er=(0,F.useCallback)(async e=>{let n=_t;if(vt(e),u){if(!Kn){vt(n),R(`Open the repository folder first.`,`warn`);return}try{bt((await t.writeWorkspaceCommitPreferences(Kn??u.thread.cwd,{provider:e})).filePath),wr()}catch(e){vt(n),R(RA(e,`Failed to save the commit provider for this project.`),`err`)}}},[t,u,Kn,_t,R,wr]),Dr=(0,F.useCallback)(async()=>{if(!(!u||Ct||Tt)){if(!Kn){R(`Open the repository folder first.`,`warn`);return}wt(!0);try{St(await t.generateCommitMessage({cwd:Kn,providerId:_t})),R(`Drafted a commit message.`,`ok`)}catch(e){R(RA(e,`Failed to draft a commit message.`),`err`)}finally{wt(!1)}}},[t,u,Kn,Tt,Ct,_t,R]),Or=(0,F.useCallback)(async()=>{if(!(!u||Ct||Tt)){if(!Kn){R(`Open the repository folder first.`,`warn`);return}if(!xt.trim()){R(`Enter a commit message first.`,`warn`);return}Et(!0);try{let e=await t.commitWorkingTree({cwd:Kn,message:xt});St(``),wr(),R(e.stagedAll?`Staged all files and created the commit.`:`Created the commit.`,`ok`)}catch(e){R(RA(e,`Failed to create the commit.`),`err`)}finally{Et(!1)}}},[t,u,Kn,Tt,Ct,xt,R,wr]),kr=(0,F.useCallback)(e=>{let t=e;window.requestAnimationFrame(()=>{let e=Ft.current;if(!e)return;e.focus();let n=t?.length??e.value.length;try{e.setSelectionRange(n,n)}catch{}})},[]),Ar=(0,F.useCallback)(()=>Ft.current?.value??le,[le]),jr=(0,F.useCallback)(e=>{let t=Ar(),n=typeof e==`function`?e(t):e;return ue(n),At(e=>e+1),n},[Ar]),Mr=(0,F.useCallback)(()=>{ue(``),At(e=>e+1),we([]),N([]),ke([]),De(e=>(e.forEach(e=>e.url.startsWith(`blob:`)&&URL.revokeObjectURL(e.url)),[])),Fe(null),P(``),Re(0)},[]),Nr=(0,F.useCallback)((e,t)=>{let n={...t,id:kd(`queue`),mentions:[...t.mentions],skills:[...t.skills],files:[...t.files],images:[...t.images]};Be(t=>({...t,[e]:[...t[e]??[],n]}))},[]),Pr=(0,F.useCallback)((e,t)=>{Be(n=>{let r=n[e]??[],i=r.filter(e=>e.id!==t);if(i.length===r.length)return n;if(i.length===0){let t={...n};return delete t[e],t}return{...n,[e]:i}})},[]),Fr=(0,F.useCallback)((e,t)=>{Be(n=>({...n,[e]:[t,...n[e]??[]]}))},[]),z=(0,F.useCallback)((e,t=`chat`,r)=>{e!==l&&(Xt.current=null,Zt.current=null,$t.current=!0);let i=()=>{if(t===`chat`){n({to:`/threads/$threadId`,params:{threadId:e}});return}n({to:`/threads/$threadId/$section`,params:{threadId:e,section:hd(t)}})};if(r?.immediate||l===e){i();return}(0,F.startTransition)(i)},[l,n]),Ir=(0,F.useCallback)(e=>{Xt.current=null,Zt.current=null,Qt.current=null,$t.current=!0,ct(!1),delete en.current[e],et(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n}),x(!1),z(e,`chat`,{immediate:!0}),e===l&&window.requestAnimationFrame(()=>{Sr({extraDelay:!0,force:!0})})},[l,z,Sr]),Lr=(0,F.useCallback)((e,t)=>{if(!l)return;let r=typeof t?.line==`number`&&t.line>0?t.line:null,i=t?.source??`chat`,a=e.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??e;yr(),i===`chat`&&(Xt.current=l),Je(t=>t?.path===e?{...t,loading:!0,error:null,line:r}:{path:e,name:a,content:``,loading:!0,error:null,line:r}),n({to:`/threads/$threadId/$section`,params:{threadId:l,section:hd(`editor`)},search:{path:e,line:r?String(r):void 0,from:i}})},[l,n,yr]),Rr=(0,F.useCallback)(e=>{if(e===`terminal`){be(!0),ve(!0);return}T(!1),D(e),C(!0),x(!1),l&&z(l,Ld(e))},[l,z]),zr=(0,F.useCallback)(()=>{p||(T(!1),C(!1),x(e=>!e))},[p]),Br=(0,F.useCallback)((e,t=`chat`)=>{if(!l)return;let r=e??qn?.id??Wn[0]?.id??null;r&&Qe(r),yr(),t===`chat`&&(Xt.current=l),n({to:`/threads/$threadId/$section`,params:{threadId:l,section:hd(`review`)},search:{diff:r??void 0,from:t}})},[l,Wn,n,yr,qn]),Vr=(0,F.useCallback)(()=>{if(C(!1),l){if(!p){T(!0),window.requestAnimationFrame(()=>{z(l,`chat`,{immediate:!0})});return}z(l,`chat`,{immediate:!0})}},[l,p,z]);(0,F.useEffect)(()=>{i.section===`skills`&&ae(!0)},[i.section]);let Hr=(0,F.useCallback)(()=>{ae(!0),x(!1)},[]),Ur=(0,F.useCallback)(()=>{ae(!1),i.section===`skills`&&l&&z(l,`chat`)},[l,z,i.section]),Wr=(0,F.useCallback)(()=>{A(!0),x(!1),te(!1),k(!1)},[]),Gr=(0,F.useCallback)(()=>{A(!1)},[]),Kr=(0,F.useCallback)(async n=>{if(oe)return null;se(!0);try{let e=await t.createThread(In,{title:`New Session`,cwd:n});return ce(n),je(t=>[e,...t.filter(t=>t!==e)].slice(0,6)),z(e,`chat`),x(!1),C(p),Mr(),R(`New session — ${n}`,`ok`),e}catch(t){return R(RA(t,e.transport.error??`Failed to start session`),`err`),null}finally{se(!1)}},[t,p,In,z,oe,R,Mr,e.transport.error]),qr=(0,F.useCallback)(()=>{ce(e=>e&&e.trim().length>0?e:u?.thread.cwd??vA.directoryCatalogRoot??`.`),re(!0),x(!1),k(!1)},[u]),Jr=(0,F.useCallback)(async e=>{await Kr(e??M)&&re(!1)},[Kr,M]),Yr=(0,F.useCallback)(async()=>{qr()},[qr]),Xr=(0,F.useCallback)(async()=>{if(!l){await Yr();return}let e=await t.forkThread(l);je(t=>[e,...t.filter(t=>t!==e)].slice(0,6)),z(e,`chat`),R(`/fork — session forked`,`ok`)},[t,l,Yr,z,R]),Zr=(0,F.useCallback)(async()=>{l&&(await t.compactThread(l),R(`/compact — transcript summarized`,`ok`))},[t,l,R]),[Qr,$r]=(0,F.useState)(null),ei=(0,F.useCallback)(async n=>{if(!l||Qr)return;if(bn){R(`Wait for the current response to finish before rolling back.`,`err`);return}if(!window.confirm(`Roll back from this prompt? This will remove this prompt and every later message, then undo the file changes from those turns.`))return;let r=L.find(e=>e.id===n)?.items.filter(e=>e.type===`userMessage`).map(t=>Jd(t,e.settings.provider)).find(e=>e.trim().length>0)??``;try{$r(n),await t.rollbackToTurn(l,n),await Tr(),r.trim().length>0&&(fe(`chat`),jr(r),kr(r)),R(`/rollback — reverted to selected prompt`,`ok`)}catch(e){R(RA(e,`Failed to roll back from the selected prompt.`),`err`)}finally{$r(e=>e===n?null:e)}},[t,l,bn,L,kr,R,Qr,Tr,jr,e.settings.provider]),ti=(0,F.useCallback)(async e=>{await t.updateSettings({model:e}),te(!1),R(`Model: ${e}`,``)},[t,R]),ni=(0,F.useCallback)(e=>{Mt(e),A(!1),R(`Theme: ${e}`,``)},[R]),ri=(0,F.useCallback)(async()=>{let e=xd[(xd.indexOf(Pn)+1)%xd.length];await t.updateSettings(Fd(e)),R(`Approval: ${Sd[e]}`,``)},[t,Pn,R]),ii=(0,F.useCallback)(()=>{Fe(null),P(``),Re(0)},[]);(0,F.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`){e.preventDefault(),k(!0),x(!1);return}if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`n`){e.preventDefault(),Yr();return}if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`g`){e.preventDefault(),R(`Ctrl+G — opening editor bridge`,``);return}e.key===`Escape`&&(k(!1),te(!1),A(!1),re(!1),We(null),ii())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[ii,Yr,R]),(0,F.useEffect)(()=>{let e=e=>{let t=e.target;t&&(t.closest(`#ctxmenu`)||We(null),!t.closest(`#hmodel`)&&!t.closest(`#mpicker`)&&te(!1),!t.closest(`#htheme`)&&!t.closest(`#tpicker`)&&A(!1),!t.closest(`#ta`)&&!t.closest(`#slashpop`)&&ii())};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[ii]);let ai=(0,F.useCallback)(e=>{kr(jr(t=>t.replace(/(?:^|\s)([@$/][^\s]*)$/,t=>t.replace(/[@$/][^\s]*$/,e))))},[kr,jr]),oi=(0,F.useCallback)(e=>{we(t=>t.some(t=>t.id===e.id||t.path===e.path)?t:[...t,e]),ii(),kr(jr(t=>ef(t,e))),R(`/mention — ${Qd(e)} linked`,`ok`)},[ii,kr,R,jr]),si=(0,F.useCallback)(n=>{let r=[...e.installedSkills,...e.remoteSkills].find(e=>e.name===n);r&&(r.source===`remote`?(t.installSkill(r.id),R(`Installing $${r.name}`,`ok`)):(N(e=>e.some(e=>e.id===r.id)?e:[...e,{...r,source:`installed`}]),R(`$${r.name} attached`,`ok`)),ii(),kr(jr(e=>e.replace(/(?:^|\s)\$[^\s]*$/,``))))},[t,ii,kr,R,jr,e.installedSkills,e.remoteSkills]),ci=(0,F.useMemo)(()=>Ce.filter(e=>$d(ln,e)),[ln,Ce]),li=(0,F.useCallback)(async(e,n=!1)=>{let[r,...i]=e.trim().split(/\s+/),a=i.join(` `);switch(r){case`/new`:await Yr();break;case`/fork`:await Xr();break;case`/compact`:await Zr();break;case`/mention`:Fe(`mention`),P(a);break;case`/model`:te(e=>!e);break;case`/permissions`:await ri();break;case`/plan`:ge(!0),R(`Plan mode enabled`,`ok`);break;case`/review`:fe(`review`),Rr(`diff`),n&&l?(await dr({threadId:l,mode:`review`,prompt:a,mentions:ci,skills:Te,files:Oe,images:Ee,settings:In},`review`),Mr()):R(`/review ready`,`ok`);break;case`/ps`:Rr(`terminal`);break;case`/diff`:Rr(`diff`);break;case`/skills`:Hr();break;case`/mcp`:Rr(`config`),l&&z(l,`mcp`);break;case`/theme`:Wr(),R(`Theme picker opened`,`ok`);break;case`/status`:Rr(`config`),R(`Session diagnostics opened`,`ok`);break;case`/copy`:rr&&(await FA(rr.text),R(`Copied latest response`,`ok`));break;case`/clear`:Mr(),R(`/clear — composer reset`,``);break;case`/experimental`:Rr(`config`);break;case`/init`:jr(`/init Generate AGENTS.md for this repo`),kr(`/init Generate AGENTS.md for this repo`);break;case`/resume`:case`/feedback`:case`/apps`:case`/exit`:case`/quit`:case`/personality`:R(`${r} queued`,``);break;case`/logout`:await t.logoutAccount(),R(`Signed out of account`,`ok`);break;default:n&&l&&(await dr({threadId:l,mode:de,prompt:e,mentions:ci,skills:Te,files:Oe,images:Ee,settings:In}),Mr())}},[t,l,Zr,de,ri,Yr,Xr,rr,z,Rr,Wr,Hr,R,Mr,dr,kr,Ee,Oe,ci,Te,jr,In]),ui=(0,F.useMemo)(()=>{let e=[{label:`Session`,items:[{icon:`💬`,name:`New Session (/new)`,key:`⌘N`,command:{type:`createSession`}},{icon:`⑂`,name:`Fork Session (/fork)`,key:``,command:{type:`forkSession`}},{icon:`🗜`,name:`Compact Transcript (/compact)`,key:``,command:{type:`compactSession`}},{icon:`🗑`,name:`Clear Composer`,key:``,command:{type:`resetComposer`}}]},{label:`Navigate`,items:[{icon:`📁`,name:`Files Panel`,key:``,command:{type:`openPanel`,tab:`files`}},{icon:`⎇`,name:`Branches Panel`,key:``,command:{type:`openPanel`,tab:`graph`}},{icon:`⬛`,name:`Terminal Dock (/ps)`,key:``,command:{type:`openPanel`,tab:`terminal`}},{icon:`⑂`,name:`Multi-agent Panel`,key:``,command:{type:`openPanel`,tab:`agents`}},{icon:`📋`,name:`Skills Library (/skills)`,key:``,command:{type:`openSkills`}},{icon:`⚙`,name:`Config & Feature Flags`,key:`⌘,`,command:{type:`openPanel`,tab:`config`}}]},{label:`Slash`,items:Td.map(e=>({icon:`/`,name:`${e.cmd} — ${e.dsc}`,key:``,command:{type:`runSlash`,slash:e.cmd}}))},...zn.length>0?[{label:`Model`,items:zn.map(e=>({icon:`🤖`,name:e.displayName,key:``,command:{type:`selectModel`,modelId:e.id}}))}]:[]],t=Me.trim().toLowerCase();return t?e.map(e=>({...e,items:e.items.filter(n=>`${n.name} ${e.label}`.toLowerCase().includes(t))})).filter(e=>e.items.length>0):e},[Me,zn]),di=(0,F.useCallback)(e=>{switch(e.type){case`createSession`:Yr();break;case`forkSession`:Xr();break;case`compactSession`:Zr();break;case`openSkills`:Hr();break;case`resetComposer`:Mr();break;case`openPanel`:Rr(e.tab);break;case`runSlash`:li(e.slash);break;case`selectModel`:ti(e.modelId);break}},[Zr,Yr,Xr,Rr,Hr,Mr,li,ti]),fi=(0,F.useCallback)(e=>{De(t=>{let n=t.find(t=>t.id===e);return n?.url.startsWith(`blob:`)&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)})},[]),pi=(0,F.useCallback)(e=>{Wt.current=e,Ut.current===null&&(Ut.current=window.requestAnimationFrame(()=>{Ut.current=null;let e=Wt.current;(0,F.startTransition)(()=>{ue(e)});let t=e.match(/(?:^|\s)([@$/])([^\s]*)$/);if(!t){ii();return}let n=t[1],r=t[2]??``;if(n===`/`){Fe(`slash`),P(`/${r}`),Re(0);return}if(n===`@`){Fe(`mention`),P(r),Re(0);return}if(n===`$`){Fe(`skill`),P(r),Re(0);return}ii()}))},[ii]),mi=(0,F.useCallback)(t=>{if(t.mode===`slash`){ai(`${t.value} `),ii();return}if(t.mode===`mention`){let n=e.mentionCatalog.find(e=>e.id===t.id);n&&oi(n);return}si(t.value)},[oi,si,ii,ai,e.mentionCatalog]),hi=(0,F.useCallback)(async n=>{let r=n??Ft.current?.value??le,a=r.trim(),o=Ce.filter(e=>$d(r,e)),s={composerValue:r,mentions:[...Ce],skills:[...Te],files:[...Oe],images:[...Ee]};if(!(!a&&o.length===0&&Te.length===0&&Oe.length===0&&Ee.length===0))try{let n=l,r=n?e.threads.some(e=>e.thread.id===n):!1;if((!n||!r)&&(n=await t.createThread(In,{title:`New Session`,cwd:M}),je(e=>[n,...e.filter(e=>e!==n)].slice(0,6)),z(n,`chat`)),a.startsWith(`/`)){await li(a,!0);return}let s=de===`review`||i.section===`review`?`review`:`chat`,c=a,u=Ee.length===0;if(bn){Nr(n,{mode:s,prompt:c,mentions:o,skills:Te,files:Oe,images:Ee}),Mr(),R(`Message queued`,`ok`);return}u&&(Mr(),await LA()),n=await dr({threadId:n,mode:s,prompt:c,mentions:o,skills:Te,files:Oe,images:Ee,settings:In}),u||Mr()}catch(t){s.images.length===0&&!Ar().trim()&&(ue(s.composerValue),At(e=>e+1),we(s.mentions),N(s.skills),ke(s.files),Fe(null),P(``),Re(0)),R(RA(t,e.transport.error??`Failed to send message`),`err`)}},[t,l,bn,le,de,Nr,Ar,z,R,Mr,i.section,li,dr,e.transport.error,e.threads,Ce,Ee,Oe,Te,In,M]),gi=(0,F.useCallback)(async e=>{if(Pe&&ar.length>0){if(e.key===`ArrowDown`){e.preventDefault(),Re(e=>Math.min(ar.length-1,e+1));return}if(e.key===`ArrowUp`){e.preventDefault(),Re(e=>Math.max(0,e-1));return}if(e.key===`Tab`||e.key===`Enter`&&!e.shiftKey){e.preventDefault(),mi(ar[Le]);return}if(e.key===`Escape`){ii();return}}if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`g`){e.preventDefault(),R(`Ctrl+G — opening editor bridge`,``);return}e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),await hi(e.currentTarget.value))},[ii,ar,mi,R,Le,Pe,hi]),_i=(0,F.useCallback)((e,t)=>{let n=e.filter(e=>e.type.startsWith(`image/`));if(n.length===0)return 0;let r=Date.now();return De(e=>[...e,...n.map((e,t)=>{let n=e.type.split(`/`)[1]?.replace(/[^a-z0-9]/gi,``).toLowerCase()||`png`;return{id:kd(`image`),name:e.name||`pasted-image-${r}-${t+1}.${n}`,url:URL.createObjectURL(e),size:Ud(e.size),file:e}})]),R(n.length===1?t===`paste`?`Image pasted`:`Image attached`:t===`paste`?`${n.length} images pasted`:`${n.length} images attached`,`ok`),n.length},[R]),vi=(0,F.useCallback)(e=>{let t=Array.from(e.clipboardData.files??[]);_i(t.length>0?t:Array.from(e.clipboardData.items??[]).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>!!e),`paste`)!==0&&e.preventDefault()},[_i]),yi=(0,F.useCallback)(e=>{let t=Array.from(e.target.files??[]);t.length!==0&&(_i(t,`attach`),e.target.value=``)},[_i]),bi=(0,F.useCallback)(e=>{let t=Array.from(e.target.files??[]);t.length!==0&&(ke(e=>[...e,...t.map(e=>({id:kd(`file`),name:e.name,size:Ud(e.size),file:e}))]),e.target.value=``,R(`File attached`,`ok`))},[R]),xi=(0,F.useCallback)(async()=>{if(!l)return;let e=await t.interruptTurn(l);R(e?`Stop requested`:`No active turn to stop`,e?`warn`:``)},[t,l,R]),Si=(0,F.useCallback)(e=>{N(t=>t.filter(t=>t.id!==e))},[]),Ci=(0,F.useCallback)(e=>{ke(t=>t.filter(t=>t.id!==e))},[]),wi=(0,F.useCallback)(async e=>{if(!l)return;let n=(ze[l]??[]).find(t=>t.id===e);if(n){if(Pr(l,e),bn){if(await t.applySteer({threadId:l,prompt:n.prompt,mentions:n.mentions,skills:n.skills,files:n.files,images:n.images})){R(`Queued message sent as steer`,`ok`);return}Fr(l,n),R(`No active turn to steer`,`warn`);return}try{await dr({threadId:l,mode:n.mode,prompt:n.prompt,mentions:n.mentions,skills:n.skills,files:n.files,images:n.images,settings:In})}catch(e){Fr(pA(e)??l,n)}}},[t,l,bn,In,Fr,R,ze,Pr,dr]),Ti=(0,F.useCallback)(e=>{if(hn.length<=1){R(`Cannot close last tab`,``);return}let t=hn.filter(t=>t!==e);je(t),e===l&&t[0]&&z(t[0],`chat`)},[l,z,R,hn]),Ei=Pe?q[Pe]:bn?`Queue a follow-up while the agent is still running…`:q.slash,Di=`${EA((0,F.useMemo)(()=>PA(L,e.settings.provider),[L,e.settings.provider]))} / 200k`,Oi=(0,F.useMemo)(()=>[...e.account.usageWindows].sort((e,t)=>(e.windowDurationMins??2**53-1)-(t.windowDurationMins??2**53-1)).slice(0,2),[e.account.usageWindows]),ki=e.transport.status===`connected`?`Connected`:e.transport.status,Ai=DA(u?.thread.cwd),ji=u?.thread.gitInfo?.branch??`workspace`,Mi=Sd[Pn].toLowerCase(),Ni=bn?`Streaming`:`Idle`,B=(0,F.useMemo)(()=>u?.terminals.filter(e=>e.source===`shell`)??[],[u?.terminals]),Pi=B.length>0,Fi=(0,F.useCallback)(()=>{!l||!u?.thread.cwd||Pi||t.startProjectTerminal(l,u.thread.cwd).catch(e=>{R(e instanceof Error?e.message:`Unable to start the project shell.`,`err`)})},[t,u?.thread.cwd,l,Pi,R]);(0,F.useEffect)(()=>{if(!(!_e||!ye||xe)){if(typeof window>`u`){Se(!0);return}return at.current=window.requestAnimationFrame(()=>{at.current=null,Se(!0)}),()=>{at.current!==null&&(window.cancelAnimationFrame(at.current),at.current=null)}}},[ye,xe,_e]),(0,F.useEffect)(()=>{if(!(!_e||!xe||!l||!u?.thread.cwd||Pi)){if(typeof window>`u`){Fi();return}return ot.current=window.requestAnimationFrame(()=>{ot.current=null,Fi()}),()=>{ot.current!==null&&(window.cancelAnimationFrame(ot.current),ot.current=null)}}},[u?.thread.cwd,l,Pi,Fi,xe,_e]);let Ii=(0,F.useCallback)(()=>{_e||(be(!0),ve(!0))},[_e]),Li=(0,F.useCallback)(()=>{typeof window<`u`&&(at.current!==null&&(window.cancelAnimationFrame(at.current),at.current=null),ot.current!==null&&(window.cancelAnimationFrame(ot.current),ot.current=null)),ve(!1)},[]),Ri=(0,F.useCallback)(e=>{FA(e).then(()=>R(`Copied!`,`ok`))},[R]),zi=(0,F.useCallback)((e,t)=>{Lr(e,{line:t,source:`chat`})},[Lr]),Bi=(0,F.useCallback)(e=>{Br(e)},[Br]),Vi=(0,F.useCallback)(e=>{Lr(e,{source:`chat`})},[Lr]),Hi=(0,F.useCallback)(()=>{li(`/plan`)},[li]),Ui=(0,F.useCallback)(e=>{jr(e),kr(e)},[kr,jr]),Wi=(0,F.useCallback)(e=>{li(e)},[li]),Gi=(0,F.useCallback)((e,t)=>{e.preventDefault(),We({x:Math.min(e.clientX,window.innerWidth-172),y:Math.min(e.clientY,window.innerHeight-212),item:t})},[]),Ki=(0,F.useCallback)(()=>{if(l){if(_===`ops`){D(`files`),C(!0),z(l,`ops`);return}z(l,_)}},[l,_,z]),qi=(0,F.useCallback)(()=>{if(l){if(y===`ops`){D(`files`),C(!0),z(l,`ops`);return}z(l,y)}},[l,z,y]),Ji=(0,F.useMemo)(()=>i.section!==`editor`||!h?null:qe?.path===h?{...qe,line:g}:{path:h,name:h.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??h,content:``,loading:!0,error:null,line:g},[g,h,qe,i.section]),Yi=(0,F.useCallback)(async(e,n)=>{await t.saveFile(e,n),Je(t=>t?.path===e?{...t,content:n,loading:!1,error:null}:t),R(`Saved ${e.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??e}`,`ok`)},[t,R]),Xi=_===`ops`?`Back to Files`:`Back to Chat`,Zi=(0,F.useCallback)(async e=>{if(e.kind===`directory`){Ke(e.path),Je(null);return}Lr(e.path,{source:`ops`})},[Lr]),Qi=()=>{if(!u)return(0,I.jsx)(`div`,{className:`empty-panel`,children:`No active thread.`});if(E===`graph`)return lt?(0,I.jsxs)(`div`,{className:`graph-panel-stack`,children:[(0,I.jsx)(WS,{branchLabel:Zn,committing:Tt,dirty:Yn,generating:Ct,hasStagedChanges:Xn,message:xt,onCommit:()=>void Or(),onGenerate:()=>void Dr(),onMessageChange:St,onProviderChange:e=>{Er(e)},preferencesPath:yt,providers:e.providers,selectedProviderId:_t,summary:Jn?.summary??`Working tree clean`}),lt.source===`session`?(0,I.jsx)(`div`,{className:`panel-hint`,children:pt?`Showing session-derived history because local git output is unavailable.`:`Showing session-derived history.`}):dt?(0,I.jsx)(`div`,{className:`panel-hint`,children:`Refreshing git history…`}):null,(0,I.jsx)(JS,{model:lt,onOpenThread:Ir})]}):(0,I.jsx)(`div`,{className:`empty-panel`,children:dt?`Loading git history…`:`No repository graph available for this session yet.`});if(E===`files`){let t=new Map,n=u.thread.cwd,r=Fn??n,a=e.directoryCatalogRoot===r?e.directoryCatalog:[],o=new Set(ci.map(e=>e.path)),s=r===n?``:r.slice(n.length).replace(/^\/+/u,``),c=[{label:n.split(`/`).filter(Boolean).pop()??n,path:n},...s.split(`/`).filter(Boolean).reduce((e,t)=>{let r=e.at(-1)?.path??n;return e.push({label:t,path:`${r.replace(/\/+$/u,``)}/${t}`}),e},[])],l=r===n?null:r.slice(0,r.lastIndexOf(`/`))||n;return Un.forEach(e=>{e.changes.forEach(e=>{t.set(e.path,e.kind.type===`add`?`new`:e.kind.type===`delete`?`del`:`mod`)})}),(0,I.jsx)(iA,{breadcrumbs:c,currentPath:r,directoryEntries:a,editorPath:i.section===`editor`?h:null,loading:e.directoryCatalogRoot!==r,mentionedPaths:o,modifiedByPath:t,onNavigate:e=>{Ke(e),Je(t=>t&&qd(e,t.path)?t:null)},onOpenEntry:Zi,parentPath:l,rootPath:n})}if(E===`diff`){let e=Wn.reduce((e,t)=>e+t.additions,0),t=Wn.reduce((e,t)=>e+t.removals,0);return(0,I.jsxs)(`div`,{className:`diff-review-shell`,children:[(0,I.jsxs)(`div`,{className:`panel-hint`,children:[`Patch review · `,Wn.length,` changed file`,Wn.length===1?``:`s`,` · +`,e,` / -`,t]}),Wn.length===0?(0,I.jsx)(`div`,{className:`empty-panel`,children:`No diff items in this thread yet.`}):null,Wn.length>0?(0,I.jsxs)(`div`,{className:`diff-review-layout`,children:[(0,I.jsx)(`div`,{className:`diff-review-sidebar`,children:Wn.map(e=>(0,I.jsxs)(`button`,{className:H(`diff-review-entry`,qn?.id===e.id&&`active`),type:`button`,onClick:()=>Qe(e.id),children:[(0,I.jsxs)(`div`,{className:`diff-review-entry-top`,children:[(0,I.jsx)(`span`,{className:H(`diff-kind-pill`,e.kind.type===`add`&&`new`,e.kind.type===`delete`&&`del`),children:bf(e.kind)}),(0,I.jsx)(`span`,{className:H(`diff-status`,e.status===`inProgress`&&`live`,e.status===`failed`&&`err`),children:e.status===`inProgress`?`editing`:e.status})]}),(0,I.jsx)(`div`,{className:`diff-review-entry-path`,children:e.path}),(0,I.jsxs)(`div`,{className:`diff-review-entry-meta`,children:[(0,I.jsxs)(`span`,{children:[`+`,e.additions]}),(0,I.jsxs)(`span`,{children:[`-`,e.removals]}),(0,I.jsxs)(`span`,{children:[e.hunks,` hunk`,e.hunks===1?``:`s`]})]})]},e.id))}),qn?(0,I.jsxs)(`div`,{className:`diff-review-main`,children:[(0,I.jsxs)(`div`,{className:`diff-focus-head`,children:[(0,I.jsx)(`div`,{className:`diff-focus-title`,children:qn.path}),(0,I.jsxs)(`div`,{className:`diff-focus-meta`,children:[(0,I.jsx)(`span`,{className:H(`diff-kind-pill`,qn.kind.type===`add`&&`new`,qn.kind.type===`delete`&&`del`),children:bf(qn.kind)}),(0,I.jsx)(`span`,{className:H(`diff-status`,qn.status===`inProgress`&&`live`,qn.status===`failed`&&`err`),children:qn.status===`inProgress`?`editing`:qn.status}),(0,I.jsxs)(`span`,{className:`diff-stat-chip`,children:[`+`,qn.additions]}),(0,I.jsxs)(`span`,{className:`diff-stat-chip`,children:[`-`,qn.removals]}),(0,I.jsxs)(`span`,{className:`diff-stat-chip`,children:[qn.hunks,` hunk`,qn.hunks===1?``:`s`]})]})]}),(0,I.jsx)(cA,{entry:qn})]}):null]}):null,Qn.length>0?(0,I.jsx)(`div`,{className:`review-list`,children:Qn.map(e=>(0,I.jsxs)(`div`,{className:H(`review-item`,e.severity),children:[(0,I.jsxs)(`div`,{className:`review-header`,children:[(0,I.jsx)(`span`,{children:e.severity}),(0,I.jsx)(`span`,{children:e.file.split(`/`).slice(-2).join(`/`)}),(0,I.jsxs)(`span`,{children:[`:`,e.line]})]}),(0,I.jsx)(`div`,{className:`review-title`,children:e.title}),(0,I.jsx)(`div`,{className:`review-summary`,children:e.summary})]},e.id))}):u.review.length>0?(0,I.jsx)(`div`,{className:`empty-panel`,children:`No review findings mapped to the selected file.`}):null,Nn.length>0?(0,I.jsx)(`div`,{className:`panel-actions`,children:Nn.map(e=>_r(e))}):null]})}if(E===`terminal`)return(0,I.jsx)(`div`,{className:`empty-panel`,children:`Terminal moved to the bottom dock. Use the Shell toggle above the prompt.`});if(E===`agents`){let t=e.threads.filter(e=>e.thread.agentNickname||e.thread.agentRole);return(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`panel-head-row`,children:[(0,I.jsx)(`div`,{className:`panel-hint`,children:`⑂ Multi-agent session`}),(0,I.jsx)(`button`,{className:`abtn yes small`,type:`button`,onClick:()=>R(`spawn_agent("alpha") → started`,`ok`),children:`+ Spawn`})]}),nr.length===0&&t.length===0?(0,I.jsx)(`div`,{className:`empty-panel`,children:`No subagent activity in this thread yet.`}):null,nr.map(e=>(0,I.jsxs)(`div`,{className:`agc`,children:[(0,I.jsxs)(`div`,{className:`agh`,children:[(0,I.jsx)(`div`,{className:`agdot`}),(0,I.jsxs)(`span`,{className:`agn`,children:[`⑂ `,e.tool]}),(0,I.jsx)(`span`,{className:`ags`,children:e.status})]}),(0,I.jsx)(`div`,{className:`agt`,children:e.prompt??`Subagent activity`}),e.receiverThreadIds.map(t=>{let n=e.agentsStates[t],r=n?.status===`completed`?100:n?.status===`running`?58:18;return(0,I.jsxs)(`div`,{className:`agent-progress`,children:[(0,I.jsxs)(`div`,{className:`agent-progress-header`,children:[(0,I.jsx)(`span`,{children:t.slice(0,12)}),(0,I.jsx)(`span`,{children:n?.status??`pending`})]}),(0,I.jsx)(`div`,{className:`agprog`,children:(0,I.jsx)(`div`,{className:`agbar`,style:{width:`${r}%`}})}),(0,I.jsx)(`div`,{className:`agent-progress-copy`,children:n?.message??`No update yet.`})]},t)})]},e.id)),t.map(e=>(0,I.jsxs)(`div`,{className:`agc`,children:[(0,I.jsxs)(`div`,{className:`agh`,children:[(0,I.jsx)(`div`,{className:`agdot`}),(0,I.jsxs)(`span`,{className:`agn`,children:[`⑂ `,e.thread.agentNickname??c[e.thread.id]??Vd(e.thread)]}),(0,I.jsx)(`span`,{className:`ags`,children:e.thread.status.type})]}),(0,I.jsx)(`div`,{className:`agt`,children:e.thread.agentRole??`Subagent thread`})]},e.thread.id))]})}return(0,I.jsx)(`div`,{children:(0,I.jsx)(eC,{snapshot:e,activeThreadLabel:d,actions:t,activeTheme:jt,onOpenSkills:Hr,onOpenTheme:Wr,pushToast:R,selectModel:ti})})},$i=()=>{if(!Pe)return null;let t=Pe===`mention`&&!!u&&e.directoryCatalogRoot!==(u?.thread.cwd??null),n=Pe===`mention`?t?`Loading files from the current directory…`:`No files found for this query.`:Pe===`skill`?`No skills matched.`:`No commands matched.`;return(0,I.jsx)(`div`,{id:`slashpop`,style:{display:`block`},children:ar.length>0?ar.map((e,t)=>(0,I.jsxs)(`button`,{className:H(`spi`,t===Le&&`sel`),type:`button`,onMouseDown:t=>{t.preventDefault(),mi(e)},children:[(0,I.jsx)(`span`,{className:`sp-cmd`,children:e.label}),(0,I.jsx)(`span`,{className:`sp-dsc`,children:e.description})]},e.id)):(0,I.jsx)(`div`,{className:`sp-empty`,children:n})})},ea=fn&&sr,ta=!fn&&sr,na=!fn&&!i.threadId&&e.transport.mode===`live`&&e.transport.status===`connected`&&s.length===0&&!sn;return fn?(0,I.jsx)(`main`,{className:`workspace-shell connection-loading-shell`,children:(0,I.jsx)(fS,{messages:wA,metaText:ea?`Restoring ${Hd(d,42)}`:`Connecting to workspace backend`,visibleRangeEnd:ea?wA.length-1:SA.length-1,visibleRangeStart:ea?SA.length:0})}):ta?(0,I.jsx)(`main`,{className:`workspace-shell connection-loading-shell`,children:(0,I.jsx)(fS,{messages:[`Opening conversation`,`Reattaching thread`,`Loading recent history`,`Syncing transcript`],metaText:`Restoring ${Hd(d,42)}`})}):na?(0,I.jsx)(`main`,{className:`workspace-shell connection-loading-shell`,children:(0,I.jsx)(fS,{messages:[`Loading sessions`,`Reading workspace state`,`Syncing sidebar`,`Preparing conversation`],metaText:`Restoring recent workspace sessions`})}):(0,I.jsxs)(`main`,{className:H(`workspace-shell`,jn&&`overlay-open`),children:[(0,I.jsxs)(`header`,{id:`hdr`,children:[(0,I.jsx)(`button`,{className:`hb mbtn`,type:`button`,onClick:zr,title:`Menu`,children:`☰`}),(0,I.jsxs)(`div`,{className:`logo`,children:[(0,I.jsx)(cS,{alt:``,className:`logo-ico`}),(0,I.jsx)(`span`,{children:`Nomadex`})]}),(0,I.jsx)(`div`,{className:`hsep`}),(0,I.jsx)(`button`,{className:H(`hbadge`,Cd[Pn]),id:`aprbadge`,type:`button`,onClick:()=>void ri(),title:`Cycle approval mode`,children:Sd[Pn]}),(0,I.jsx)(`button`,{className:`hb`,type:`button`,onClick:()=>k(!0),title:`Command palette`,children:`⌘`}),(0,I.jsx)(`button`,{className:`hb`,type:`button`,onClick:()=>Rr(`agents`),title:`Multi-agent panel`,children:`⑂`}),(0,I.jsx)(`button`,{className:`hb`,type:`button`,onClick:()=>Rr(`files`),title:`Files and diff`,children:`📁`}),(0,I.jsx)(`button`,{className:`hb`,type:`button`,onClick:Hr,title:`Skills library`,children:`📋`}),(0,I.jsx)(`button`,{className:`hb`,type:`button`,onClick:()=>Rr(`config`),title:`Config and settings`,children:`⚙`}),(0,I.jsxs)(`button`,{className:`htheme`,id:`htheme`,type:`button`,onClick:()=>{te(!1),A(e=>!e)},title:`Theme picker`,children:[(0,I.jsx)(`span`,{className:`theme-dot`}),(0,I.jsx)(`span`,{className:`theme-label`,children:Hn.name}),(0,I.jsx)(`span`,{className:`hmodel-arrow`,children:`▾`})]}),(0,I.jsxs)(`button`,{className:`hmodel`,id:`hmodel`,type:`button`,disabled:zn.length===0,ref:Lt,onClick:()=>{zn.length!==0&&(A(!1),te(e=>!e))},title:zn.length===0?`${Rn.displayName} uses its own CLI model configuration`:void 0,children:[(0,I.jsx)(`div`,{className:`mdot`}),(0,I.jsx)(`span`,{id:`mlabel`,children:Vn}),(0,I.jsx)(`span`,{className:`hmodel-arrow`,children:`▾`})]})]}),(0,I.jsxs)(`div`,{id:`layout`,children:[!p&&b?(0,I.jsx)(`button`,{id:`sbo`,className:`show`,type:`button`,"aria-label":`Close sidebar`,onClick:()=>x(!1)}):null,kn?(0,I.jsxs)(`aside`,{id:`sb`,className:H(!p&&b&&`open`),children:[(0,I.jsx)(`button`,{className:`snew`,type:`button`,onClick:()=>void Yr(),children:`+ New Session`}),(0,I.jsx)(`div`,{className:`shist`,children:[`Today`,`Yesterday`,`Earlier`].map(e=>Ln[e].length>0?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`sgl`,children:e}),Ln[e].map(e=>(0,I.jsxs)(`button`,{className:H(`si`,e.thread.id===l&&`active`),type:`button`,onClick:()=>Ir(e.thread.id),children:[(0,I.jsx)(`span`,{children:e.thread.agentNickname?`⑂`:`💬`}),(0,I.jsx)(`span`,{className:`si-t`,children:c[e.thread.id]??Vd(e.thread)})]},e.thread.id))]},e):null)}),(0,I.jsxs)(`div`,{className:`sbot`,children:[(0,I.jsxs)(`button`,{className:`slink`,type:`button`,onClick:()=>k(!0),children:[(0,I.jsx)(`span`,{children:`⌘`}),(0,I.jsx)(`span`,{children:`Command palette`}),(0,I.jsx)(`span`,{className:`skbd`,children:`⌘K`})]}),(0,I.jsxs)(`button`,{className:`slink`,type:`button`,onClick:()=>void li(`/review`),children:[(0,I.jsx)(`span`,{children:`🔍`}),(0,I.jsx)(`span`,{children:`/review working tree`})]}),(0,I.jsxs)(`button`,{className:`slink`,type:`button`,onClick:()=>void li(`/fork`),children:[(0,I.jsx)(`span`,{children:`⑂`}),(0,I.jsx)(`span`,{children:`/fork session`})]}),(0,I.jsxs)(`button`,{className:`slink`,type:`button`,onClick:()=>void li(`/compact`),children:[(0,I.jsx)(`span`,{children:`🗜`}),(0,I.jsx)(`span`,{children:`/compact transcript`})]}),(0,I.jsxs)(`button`,{className:`slink`,type:`button`,onClick:Hr,children:[(0,I.jsx)(`span`,{children:`📋`}),(0,I.jsx)(`span`,{children:`Skills library`})]}),(0,I.jsxs)(`button`,{className:`slink`,type:`button`,onClick:Wr,children:[(0,I.jsx)(`span`,{children:`◐`}),(0,I.jsx)(`span`,{children:`Theme picker`})]}),(0,I.jsxs)(`button`,{className:`slink`,type:`button`,onClick:()=>Ui(`/init Generate AGENTS.md scaffold`),children:[(0,I.jsx)(`span`,{children:`📋`}),(0,I.jsx)(`span`,{children:`/init AGENTS.md`})]}),(0,I.jsxs)(`button`,{className:`slink`,type:`button`,onClick:()=>Rr(`config`),children:[(0,I.jsx)(`span`,{children:`⚙`}),(0,I.jsx)(`span`,{children:`config.toml`})]})]})]}):null,(0,I.jsxs)(`section`,{id:`main`,className:H(An&&`covered`),children:[(0,I.jsxs)(`div`,{id:`tabs`,children:[hn.map(e=>{let t=s.find(t=>t.thread.id===e),n=t?.thread;return!t||!n?null:(0,I.jsxs)(`button`,{className:H(`tab`,e===l&&`active`),"data-i":e,type:`button`,onClick:()=>z(e,`chat`),children:[(0,I.jsx)(`span`,{children:n.agentNickname?`⑂`:`💬`}),(0,I.jsx)(`span`,{children:Hd(c[t.thread.id]??Vd(t.thread),18)}),(0,I.jsx)(`span`,{className:`tab-x`,onClick:t=>{t.stopPropagation(),Ti(e)},children:`×`})]},e)}),(0,I.jsx)(`button`,{className:`tabadd`,type:`button`,onClick:()=>void Yr(),title:`New session`,children:`+`})]}),i.section===`editor`?(0,I.jsx)(`div`,{id:`editor-page`,children:Ji?(0,I.jsx)(uA,{backLabel:Xi,onBack:Ki,onDirtyChange:Xe,onSave:Yi,preview:Ji,providerId:e.settings.provider,variant:`page`}):(0,I.jsx)(`div`,{className:`empty-panel`,children:`No file selected.`})}):i.section===`review`?(0,I.jsx)(lA,{backLabel:y===`ops`?`Back to Files`:`Back to Chat`,diffEntries:Wn,findings:Qn,onBack:qi,onSelectEntry:e=>Br(e,y),selectedEntryId:Ze}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{id:`chat`,ref:Nt,children:[(0,I.jsx)(yS,{activeThread:u,activeThreadLabel:d,activeTurns:vn,existingThreadHistoryPending:cr,rollbackPendingTurnId:Qr,onContext:Gi,onCopy:Ri,onEdit:Ui,onFill:Ui,onFork:Xr,onOpenFile:zi,onPlan:Hi,onRollback:ei,onReview:Bi,onSlash:Wi,providerId:e.settings.provider,streamVisible:nn}),(0,I.jsx)(pd,{overlay:Tn,pendingApprovalsCount:Mn,queuedCount:wn.length}),(0,I.jsx)(`div`,{"aria-hidden":`true`,ref:Pt})]}),(0,I.jsxs)(`div`,{id:`ia`,children:[st?(0,I.jsx)(`div`,{className:`chat-jump-row`,children:(0,I.jsx)(`button`,{className:`chat-jump-button`,type:`button`,onClick:Cr,children:`↓ Latest`})}):null,Te.length>0||Oe.length>0||Ee.length>0?(0,I.jsxs)(`div`,{id:`ctx-row`,children:[Te.map(e=>(0,I.jsxs)(`div`,{className:`ctag`,children:[(0,I.jsx)(`span`,{children:`📋`}),(0,I.jsxs)(`span`,{children:[`$`,e.name]}),(0,I.jsx)(`button`,{className:`ctx-x`,type:`button`,onClick:()=>Si(e.id),children:`×`})]},e.id)),Oe.map(e=>{let t=mf(e.name);return(0,I.jsxs)(`div`,{className:H(`ctag ctag-file`,`file-tone-${t.tone}`),children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`file-chip-preview`,children:(0,I.jsx)(`span`,{className:`file-chip-ext`,children:t.badge})}),(0,I.jsxs)(`span`,{className:`file-chip-copy`,children:[(0,I.jsx)(`span`,{className:`file-chip-title`,children:t.title}),(0,I.jsx)(`span`,{className:`file-chip-meta`,children:e.size})]}),(0,I.jsx)(`button`,{className:`ctx-x`,type:`button`,onClick:()=>Ci(e.id),children:`×`})]},e.id)}),Ee.map(e=>(0,I.jsxs)(`div`,{className:`ctag ctag-image`,children:[(0,I.jsx)(`img`,{alt:e.name,className:`ctag-thumb`,loading:`lazy`,src:e.url}),(0,I.jsx)(`span`,{className:`ctag-label`,children:e.name}),(0,I.jsx)(`button`,{className:`ctx-x`,type:`button`,onClick:()=>fi(e.id),children:`×`})]},e.id))]}):null,wn.length>0?(0,I.jsx)(oA,{messages:wn,onDelete:e=>l&&Pr(l,e),onSteer:wi}):null,En.length>0?(0,I.jsx)(hS,{entries:En,onOpenFile:Vi,title:`Changing`,variant:`live`}):null,Nn.length>0?(0,I.jsx)(`div`,{className:`question-request-stack`,children:Nn.map(e=>_r(e))}):null,(ye||_e)&&u?(0,I.jsxs)(`div`,{className:H(`workspace-terminal-dock`,!_e&&`hidden`),children:[(0,I.jsxs)(`div`,{className:`workspace-terminal-dock-bar`,children:[(0,I.jsx)(`button`,{className:`workspace-terminal-dock-tab active`,type:`button`,children:`Terminal`}),(0,I.jsx)(`button`,{className:`workspace-terminal-dock-close`,onClick:Li,type:`button`,children:`Hide`})]}),(0,I.jsx)(`div`,{className:`workspace-terminal-dock-body`,children:xe?(0,I.jsx)(rC,{cwd:u.thread.cwd,onSendInput:(e,n)=>t.sendTerminalInput(u.thread.id,e,n),onStartShell:()=>t.startProjectTerminal(u.thread.id,u.thread.cwd),onTerminate:e=>t.terminateTerminal(u.thread.id,e),terminals:B}):(0,I.jsx)(`div`,{className:`workspace-terminal-dock-loading`,children:`Opening terminal`})})]}):null,(0,I.jsxs)(`div`,{id:`ib`,className:H(wn.length>0&&`queue-open`),children:[(0,I.jsxs)(`div`,{id:`toolbar`,children:[(0,I.jsxs)(`button`,{className:H(`tbtn`,pe&&`on`),type:`button`,onClick:()=>me(e=>!e),children:[(0,I.jsx)(TA,{name:`auto`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Auto`})]}),(0,I.jsxs)(`button`,{className:H(`tbtn`,he&&`on`),type:`button`,onClick:async()=>{ge(!he)},children:[(0,I.jsx)(TA,{name:`plan`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Plan`})]}),(0,I.jsx)(`div`,{className:`tsep2`}),(0,I.jsxs)(`button`,{className:`tbtn`,type:`button`,onClick:()=>{Fe(`mention`),P(``),Re(0),Ft.current?.focus()},children:[(0,I.jsx)(TA,{name:`mention`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Mention`})]}),(0,I.jsxs)(`button`,{className:`tbtn`,type:`button`,onClick:()=>zt.current?.click(),children:[(0,I.jsx)(TA,{name:`attach`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Files`})]}),(0,I.jsxs)(`button`,{className:`tbtn`,type:`button`,onClick:()=>Rt.current?.click(),children:[(0,I.jsx)(TA,{name:`image`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Image`})]}),(0,I.jsxs)(`button`,{className:H(`tbtn`,_e&&`on`),type:`button`,onClick:()=>void(_e?Li():Ii()),children:[(0,I.jsx)(TA,{name:`terminal`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Shell`})]}),(0,I.jsxs)(`button`,{className:H(`tbtn`,e.settings.webSearch&&`on`),type:`button`,onClick:()=>void t.updateSettings({webSearch:!e.settings.webSearch}),children:[(0,I.jsx)(TA,{name:`web`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Web`})]}),(0,I.jsx)(`div`,{className:`tsep2`}),(0,I.jsxs)(`button`,{className:H(`tbtn`,de===`review`&&`on`),type:`button`,onClick:()=>fe(e=>e===`review`?`chat`:`review`),children:[(0,I.jsx)(TA,{name:`review`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Review`})]}),(0,I.jsxs)(`button`,{className:`tbtn`,type:`button`,onClick:()=>Rr(`agents`),children:[(0,I.jsx)(TA,{name:`agents`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Agents`})]}),(0,I.jsxs)(`button`,{className:`tbtn`,type:`button`,onClick:()=>void Zr(),children:[(0,I.jsx)(TA,{name:`compact`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Trim`})]}),(0,I.jsxs)(`button`,{className:`tbtn`,type:`button`,onClick:()=>R(`Ctrl+G — opening editor bridge`,``),children:[(0,I.jsx)(TA,{name:`editor`}),(0,I.jsx)(`span`,{className:`tbtn-label`,children:`Editor`})]})]}),(0,I.jsxs)(`div`,{id:`irow`,children:[(0,I.jsx)(sA,{composerMirrorRef:It,mentions:Ce,onKeyDown:gi,onPaste:vi,onValueChange:pi,placeholder:Ei,textareaRef:Ft,value:le},kt),(0,I.jsx)(`button`,{id:`sendbtn`,type:`button`,"aria-label":bn?`Queue message`:`Send message`,onClick:()=>void hi(Ft.current?.value),children:(0,I.jsx)(TA,{name:`send`})}),(0,I.jsx)(`button`,{id:`stopbtn`,style:{display:bn?`flex`:`none`},type:`button`,"aria-label":`Stop current turn`,onClick:()=>void xi(),children:(0,I.jsx)(TA,{name:`stop`})})]}),$i(),(0,I.jsx)(`div`,{id:`ifooter`,children:(0,I.jsxs)(`div`,{className:`composer-footer-meta`,children:[(0,I.jsx)(`div`,{className:`composer-shortcuts`,children:(0,I.jsx)(`span`,{className:`composer-hint`,children:`Shift+Enter`})}),(0,I.jsxs)(`div`,{className:`composer-usage-metric`,children:[(0,I.jsx)(`span`,{className:`composer-usage-label`,children:`Context`}),(0,I.jsx)(`span`,{id:`tokcount`,children:Di})]}),(0,I.jsx)(`div`,{className:`composer-limit-list`,children:Oi.map(e=>(0,I.jsxs)(`div`,{className:`composer-limit-chip`,children:[(0,I.jsx)(`span`,{className:`composer-limit-name`,children:NA(e.label,e.windowDurationMins)}),(0,I.jsxs)(`span`,{className:`composer-limit-value`,children:[Math.round(e.usedPercent),`%`]})]},e.id))})]})})]})]})]})]}),p||Dn?(0,I.jsxs)(`aside`,{id:`rp`,className:H(Dn&&`open`),children:[(0,I.jsxs)(`div`,{className:`rph`,children:[(0,I.jsx)(`span`,{className:`rpt`,id:`rp-title`,children:wd[E]}),(0,I.jsx)(`button`,{className:`rpclose`,type:`button`,onClick:Vr,children:`×`})]}),(0,I.jsx)(`div`,{className:`rptabs`,id:`rptabs`,children:[`files`,`graph`,`diff`,`agents`,`config`].map(e=>(0,I.jsx)(`button`,{className:H(`rptab`,E===e&&`active`),type:`button`,onClick:()=>{if(e===`diff`){Br(qn?.id??Wn[0]?.id,i.section===`ops`?`ops`:`chat`);return}D(e)},children:wd[e]},e))}),(0,I.jsx)(`div`,{className:`rpbody`,id:`rpbody`,children:Dn?Qi():null})]}):null]}),(0,I.jsxs)(`div`,{id:`statusbar`,children:[(0,I.jsxs)(`div`,{className:`sbi sbi-transport`,children:[(0,I.jsx)(`div`,{className:H(`sbd`,Rd(e.transport.status))}),(0,I.jsx)(`span`,{children:ki})]}),(0,I.jsxs)(`div`,{className:`sbi sbi-branch`,children:[(0,I.jsx)(TA,{name:`branch`}),(0,I.jsx)(`span`,{className:`sb-project sb-fulltext`,children:Ai}),(0,I.jsx)(`span`,{className:`sb-divider`,children:`/`}),(0,I.jsx)(`span`,{className:`sb-fulltext`,children:ji})]}),(0,I.jsxs)(`div`,{className:`sbi sbi-model`,id:`sb-model`,children:[(0,I.jsx)(TA,{name:`model`}),(0,I.jsx)(`span`,{children:Vn})]}),(0,I.jsxs)(`div`,{className:`sbi sbi-access`,children:[(0,I.jsx)(TA,{name:`shield`}),(0,I.jsx)(`span`,{children:Mi})]}),(0,I.jsx)(`div`,{className:`sbi`,id:`sb-st`,children:Ni})]}),ee&&zn.length>0?(0,I.jsx)(`div`,{id:`mpicker`,style:{display:`block`,top:`${Dt.top}px`,right:`${Dt.right}px`,left:`auto`},children:zn.map((t,n)=>(0,I.jsxs)(`div`,{className:`mpi`,onClick:()=>void ti(t.id),onKeyDown:()=>void 0,role:`button`,tabIndex:0,children:[(0,I.jsxs)(`div`,{className:`mpi-n`,children:[t.displayName,t.id===e.settings.model?(0,I.jsxs)(I.Fragment,{children:[` `,`✓ `,(0,I.jsx)(`span`,{className:`model-rec`,children:`active`})]}):null]}),(0,I.jsx)(`div`,{className:`mpi-d`,children:t.description}),n<zn.length-1?(0,I.jsx)(`div`,{className:`mpsep`}):null]},t.id))}):null,ne?(0,I.jsx)($S,{activeTheme:jt,onClose:Gr,onSelect:ni,themes:Ed}):null,j?(0,I.jsx)(aA,{activePath:M,breadcrumbs:tr,busy:oe,entries:$n,loading:e.directoryCatalogRoot!==M,onClose:()=>re(!1),onNavigate:ce,onPick:e=>{ce(e),Jr(e)},parentPath:er}):null,ie?(0,I.jsx)(QS,{actions:t,onClose:Ur,pushToast:R,snapshot:e}):null,O?(0,I.jsx)(`div`,{id:`cmo`,className:`show`,onClick:e=>e.target===e.currentTarget&&k(!1),children:(0,I.jsxs)(`div`,{id:`cmp`,children:[(0,I.jsxs)(`div`,{className:`cmr`,children:[(0,I.jsx)(`span`,{className:`cm-ico`,children:`⌘`}),(0,I.jsx)(`input`,{id:`cminput`,autoFocus:!0,placeholder:`Search commands, slash commands, models…`,value:Me,onChange:e=>Ne(e.target.value),onKeyDown:e=>{if(e.key===`Escape`&&k(!1),e.key===`Enter`){e.preventDefault();let t=ui[0]?.items[0];t&&(k(!1),di(t.command))}}})]}),(0,I.jsx)(`div`,{className:`cmlist`,id:`cmlist`,children:ui.length===0?(0,I.jsx)(`div`,{className:`empty-command`,children:`No results`}):ui.map(e=>(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`cmgl`,children:e.label}),e.items.map(t=>(0,I.jsxs)(`button`,{className:`cmi`,type:`button`,onClick:()=>{k(!1),di(t.command)},children:[(0,I.jsx)(`span`,{children:t.icon}),(0,I.jsx)(`span`,{className:`cmi-nm`,children:t.name}),t.key?(0,I.jsx)(`span`,{className:`cmkbd`,children:t.key}):null]},`${e.label}-${t.name}`))]},e.label))})]})}):null,Ue?(0,I.jsxs)(`div`,{id:`ctxmenu`,className:`show`,style:{left:`${Ue.x}px`,top:`${Ue.y}px`},children:[(0,I.jsx)(`button`,{className:`ctxi`,type:`button`,onClick:()=>{let t=Ue.item;t?.type===`agentMessage`&&FA(t.text).then(()=>R(`Copied`,`ok`)),t?.type===`userMessage`&&FA(Jd(t,e.settings.provider)).then(()=>R(`Copied`,`ok`)),We(null)},children:`📋 Copy message`}),(0,I.jsx)(`button`,{className:`ctxi`,type:`button`,onClick:()=>{let t=Ue.item;t?.type===`agentMessage`&&Ui(t.text),t?.type===`userMessage`&&Ui(Jd(t,e.settings.provider)),We(null)},children:`✏ Edit & resend`}),(0,I.jsx)(`button`,{className:`ctxi`,type:`button`,onClick:()=>{rr&&Ui(rr.text),We(null)},children:`🔄 Regenerate`}),(0,I.jsx)(`div`,{className:`ctxs`}),(0,I.jsx)(`button`,{className:`ctxi`,type:`button`,onClick:()=>{Xr(),We(null)},children:`⑂ /fork from here`}),(0,I.jsx)(`button`,{className:`ctxi`,type:`button`,onClick:()=>{li(`/plan`),We(null)},children:`📋 /plan from here`}),(0,I.jsx)(`button`,{className:`ctxi`,type:`button`,onClick:()=>{Fe(`mention`),P(``),We(null)},children:`📎 /mention file`}),(0,I.jsx)(`div`,{className:`ctxs`}),(0,I.jsx)(`button`,{className:`ctxi danger`,type:`button`,onClick:()=>{R(`Deleted`,``),We(null)},children:`🗑 Delete`})]}):null,(0,I.jsx)(`div`,{id:`toasts`,children:Ve.map(e=>(0,I.jsx)(`div`,{className:H(`toast`,e.tone),children:e.message},e.id))}),(0,I.jsx)(`input`,{ref:zt,className:`hidden-input`,type:`file`,multiple:!0,onChange:bi}),(0,I.jsx)(`input`,{ref:Rt,className:`hidden-input`,type:`file`,accept:`image/*`,multiple:!0,onChange:yi})]})}function UA(){return(0,I.jsx)(BA,{children:(0,I.jsx)(V,{})})}var WA=Qa({component:UA}),GA=Xa({getParentRoute:()=>WA,path:`/`,component:VA}),KA=Xa({getParentRoute:()=>WA,path:`/threads`,component:VA}),qA=Xa({getParentRoute:()=>WA,path:`/thread/$threadId`,component:VA}),JA=Xa({getParentRoute:()=>WA,path:`/threads/$threadId`,component:VA}),YA=Xa({getParentRoute:()=>WA,path:`/threads/$threadId/$section`,component:VA}),XA=go({routeTree:WA.addChildren([GA,KA,qA,JA,YA])}),ZA=new Kt({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}}),QA=document.getElementById(`root`);if(!QA)throw Error(`Root element not found.`);(0,bo.createRoot)(QA).render((0,I.jsx)(Xt,{client:ZA,children:(0,I.jsx)(yo,{router:XA})}));export{Le as a,tO as i,WE as n,GE as r,VE as t};
|