repoburg 1.3.286 → 1.3.288

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TerminalView-BFw1zt_D.js","assets/TerminalView-6GBZ9nXN.css"])))=>i.map(i=>d[i]);
2
- var Wx=Object.defineProperty;var Hx=(t,s,r)=>s in t?Wx(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r;var rt=(t,s,r)=>Hx(t,typeof s!="symbol"?s+"":s,r);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function r(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(l){if(l.ep)return;l.ep=!0;const u=r(l);fetch(l.href,u)}})();function yg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xu={exports:{}},lo={},wu={exports:{}},We={};/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TerminalView-BIN1AVRE.js","assets/TerminalView-6GBZ9nXN.css"])))=>i.map(i=>d[i]);
2
+ var Kx=Object.defineProperty;var qx=(t,s,r)=>s in t?Kx(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r;var it=(t,s,r)=>qx(t,typeof s!="symbol"?s+"":s,r);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function r(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(l){if(l.ep)return;l.ep=!0;const u=r(l);fetch(l.href,u)}})();function xg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Su={exports:{}},lo={},bu={exports:{}},We={};/**
3
3
  * @license React
4
4
  * react.production.min.js
5
5
  *
@@ -7,7 +7,7 @@ var Wx=Object.defineProperty;var Hx=(t,s,r)=>s in t?Wx(t,s,{enumerable:!0,config
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var mh;function Vx(){if(mh)return We;mh=1;var t=Symbol.for("react.element"),s=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),k=Symbol.iterator;function y(E){return E===null||typeof E!="object"?null:(E=k&&E[k]||E["@@iterator"],typeof E=="function"?E:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,_={};function N(E,P,se){this.props=E,this.context=P,this.refs=_,this.updater=se||S}N.prototype.isReactComponent={},N.prototype.setState=function(E,P){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,P,"setState")},N.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function C(){}C.prototype=N.prototype;function R(E,P,se){this.props=E,this.context=P,this.refs=_,this.updater=se||S}var H=R.prototype=new C;H.constructor=R,T(H,N.prototype),H.isPureReactComponent=!0;var M=Array.isArray,D=Object.prototype.hasOwnProperty,K={current:null},G={key:!0,ref:!0,__self:!0,__source:!0};function $(E,P,se){var fe,X={},pe=null,Ne=null;if(P!=null)for(fe in P.ref!==void 0&&(Ne=P.ref),P.key!==void 0&&(pe=""+P.key),P)D.call(P,fe)&&!G.hasOwnProperty(fe)&&(X[fe]=P[fe]);var _e=arguments.length-2;if(_e===1)X.children=se;else if(1<_e){for(var Ae=Array(_e),Ee=0;Ee<_e;Ee++)Ae[Ee]=arguments[Ee+2];X.children=Ae}if(E&&E.defaultProps)for(fe in _e=E.defaultProps,_e)X[fe]===void 0&&(X[fe]=_e[fe]);return{$$typeof:t,type:E,key:pe,ref:Ne,props:X,_owner:K.current}}function te(E,P){return{$$typeof:t,type:E.type,key:P,ref:E.ref,props:E.props,_owner:E._owner}}function he(E){return typeof E=="object"&&E!==null&&E.$$typeof===t}function ue(E){var P={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(se){return P[se]})}var Se=/\/+/g;function q(E,P){return typeof E=="object"&&E!==null&&E.key!=null?ue(""+E.key):P.toString(36)}function we(E,P,se,fe,X){var pe=typeof E;(pe==="undefined"||pe==="boolean")&&(E=null);var Ne=!1;if(E===null)Ne=!0;else switch(pe){case"string":case"number":Ne=!0;break;case"object":switch(E.$$typeof){case t:case s:Ne=!0}}if(Ne)return Ne=E,X=X(Ne),E=fe===""?"."+q(Ne,0):fe,M(X)?(se="",E!=null&&(se=E.replace(Se,"$&/")+"/"),we(X,P,se,"",function(Ee){return Ee})):X!=null&&(he(X)&&(X=te(X,se+(!X.key||Ne&&Ne.key===X.key?"":(""+X.key).replace(Se,"$&/")+"/")+E)),P.push(X)),1;if(Ne=0,fe=fe===""?".":fe+":",M(E))for(var _e=0;_e<E.length;_e++){pe=E[_e];var Ae=fe+q(pe,_e);Ne+=we(pe,P,se,Ae,X)}else if(Ae=y(E),typeof Ae=="function")for(E=Ae.call(E),_e=0;!(pe=E.next()).done;)pe=pe.value,Ae=fe+q(pe,_e++),Ne+=we(pe,P,se,Ae,X);else if(pe==="object")throw P=String(E),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.");return Ne}function Z(E,P,se){if(E==null)return E;var fe=[],X=0;return we(E,fe,"","",function(pe){return P.call(se,pe,X++)}),fe}function oe(E){if(E._status===-1){var P=E._result;P=P(),P.then(function(se){(E._status===0||E._status===-1)&&(E._status=1,E._result=se)},function(se){(E._status===0||E._status===-1)&&(E._status=2,E._result=se)}),E._status===-1&&(E._status=0,E._result=P)}if(E._status===1)return E._result.default;throw E._result}var ae={current:null},z={transition:null},Q={ReactCurrentDispatcher:ae,ReactCurrentBatchConfig:z,ReactCurrentOwner:K};function B(){throw Error("act(...) is not supported in production builds of React.")}return We.Children={map:Z,forEach:function(E,P,se){Z(E,function(){P.apply(this,arguments)},se)},count:function(E){var P=0;return Z(E,function(){P++}),P},toArray:function(E){return Z(E,function(P){return P})||[]},only:function(E){if(!he(E))throw Error("React.Children.only expected to receive a single React element child.");return E}},We.Component=N,We.Fragment=r,We.Profiler=l,We.PureComponent=R,We.StrictMode=o,We.Suspense=g,We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,We.act=B,We.cloneElement=function(E,P,se){if(E==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+E+".");var fe=T({},E.props),X=E.key,pe=E.ref,Ne=E._owner;if(P!=null){if(P.ref!==void 0&&(pe=P.ref,Ne=K.current),P.key!==void 0&&(X=""+P.key),E.type&&E.type.defaultProps)var _e=E.type.defaultProps;for(Ae in P)D.call(P,Ae)&&!G.hasOwnProperty(Ae)&&(fe[Ae]=P[Ae]===void 0&&_e!==void 0?_e[Ae]:P[Ae])}var Ae=arguments.length-2;if(Ae===1)fe.children=se;else if(1<Ae){_e=Array(Ae);for(var Ee=0;Ee<Ae;Ee++)_e[Ee]=arguments[Ee+2];fe.children=_e}return{$$typeof:t,type:E.type,key:X,ref:pe,props:fe,_owner:Ne}},We.createContext=function(E){return E={$$typeof:d,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},E.Provider={$$typeof:u,_context:E},E.Consumer=E},We.createElement=$,We.createFactory=function(E){var P=$.bind(null,E);return P.type=E,P},We.createRef=function(){return{current:null}},We.forwardRef=function(E){return{$$typeof:p,render:E}},We.isValidElement=he,We.lazy=function(E){return{$$typeof:v,_payload:{_status:-1,_result:E},_init:oe}},We.memo=function(E,P){return{$$typeof:m,type:E,compare:P===void 0?null:P}},We.startTransition=function(E){var P=z.transition;z.transition={};try{E()}finally{z.transition=P}},We.unstable_act=B,We.useCallback=function(E,P){return ae.current.useCallback(E,P)},We.useContext=function(E){return ae.current.useContext(E)},We.useDebugValue=function(){},We.useDeferredValue=function(E){return ae.current.useDeferredValue(E)},We.useEffect=function(E,P){return ae.current.useEffect(E,P)},We.useId=function(){return ae.current.useId()},We.useImperativeHandle=function(E,P,se){return ae.current.useImperativeHandle(E,P,se)},We.useInsertionEffect=function(E,P){return ae.current.useInsertionEffect(E,P)},We.useLayoutEffect=function(E,P){return ae.current.useLayoutEffect(E,P)},We.useMemo=function(E,P){return ae.current.useMemo(E,P)},We.useReducer=function(E,P,se){return ae.current.useReducer(E,P,se)},We.useRef=function(E){return ae.current.useRef(E)},We.useState=function(E){return ae.current.useState(E)},We.useSyncExternalStore=function(E,P,se){return ae.current.useSyncExternalStore(E,P,se)},We.useTransition=function(){return ae.current.useTransition()},We.version="18.3.1",We}var gh;function vd(){return gh||(gh=1,wu.exports=Vx()),wu.exports}/**
10
+ */var gh;function Yx(){if(gh)return We;gh=1;var t=Symbol.for("react.element"),s=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),k=Symbol.iterator;function y(M){return M===null||typeof M!="object"?null:(M=k&&M[k]||M["@@iterator"],typeof M=="function"?M:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,_={};function N(M,P,le){this.props=M,this.context=P,this.refs=_,this.updater=le||S}N.prototype.isReactComponent={},N.prototype.setState=function(M,P){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,P,"setState")},N.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function E(){}E.prototype=N.prototype;function j(M,P,le){this.props=M,this.context=P,this.refs=_,this.updater=le||S}var W=j.prototype=new E;W.constructor=j,T(W,N.prototype),W.isPureReactComponent=!0;var A=Array.isArray,D=Object.prototype.hasOwnProperty,G={current:null},V={key:!0,ref:!0,__self:!0,__source:!0};function $(M,P,le){var ge,X={},pe=null,Te=null;if(P!=null)for(ge in P.ref!==void 0&&(Te=P.ref),P.key!==void 0&&(pe=""+P.key),P)D.call(P,ge)&&!V.hasOwnProperty(ge)&&(X[ge]=P[ge]);var se=arguments.length-2;if(se===1)X.children=le;else if(1<se){for(var he=Array(se),Se=0;Se<se;Se++)he[Se]=arguments[Se+2];X.children=he}if(M&&M.defaultProps)for(ge in se=M.defaultProps,se)X[ge]===void 0&&(X[ge]=se[ge]);return{$$typeof:t,type:M,key:pe,ref:Te,props:X,_owner:G.current}}function te(M,P){return{$$typeof:t,type:M.type,key:P,ref:M.ref,props:M.props,_owner:M._owner}}function me(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function de(M){var P={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(le){return P[le]})}var je=/\/+/g;function K(M,P){return typeof M=="object"&&M!==null&&M.key!=null?de(""+M.key):P.toString(36)}function be(M,P,le,ge,X){var pe=typeof M;(pe==="undefined"||pe==="boolean")&&(M=null);var Te=!1;if(M===null)Te=!0;else switch(pe){case"string":case"number":Te=!0;break;case"object":switch(M.$$typeof){case t:case s:Te=!0}}if(Te)return Te=M,X=X(Te),M=ge===""?"."+K(Te,0):ge,A(X)?(le="",M!=null&&(le=M.replace(je,"$&/")+"/"),be(X,P,le,"",function(Se){return Se})):X!=null&&(me(X)&&(X=te(X,le+(!X.key||Te&&Te.key===X.key?"":(""+X.key).replace(je,"$&/")+"/")+M)),P.push(X)),1;if(Te=0,ge=ge===""?".":ge+":",A(M))for(var se=0;se<M.length;se++){pe=M[se];var he=ge+K(pe,se);Te+=be(pe,P,le,he,X)}else if(he=y(M),typeof he=="function")for(M=he.call(M),se=0;!(pe=M.next()).done;)pe=pe.value,he=ge+K(pe,se++),Te+=be(pe,P,le,he,X);else if(pe==="object")throw P=String(M),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.");return Te}function Z(M,P,le){if(M==null)return M;var ge=[],X=0;return be(M,ge,"","",function(pe){return P.call(le,pe,X++)}),ge}function oe(M){if(M._status===-1){var P=M._result;P=P(),P.then(function(le){(M._status===0||M._status===-1)&&(M._status=1,M._result=le)},function(le){(M._status===0||M._status===-1)&&(M._status=2,M._result=le)}),M._status===-1&&(M._status=0,M._result=P)}if(M._status===1)return M._result.default;throw M._result}var ae={current:null},z={transition:null},Q={ReactCurrentDispatcher:ae,ReactCurrentBatchConfig:z,ReactCurrentOwner:G};function q(){throw Error("act(...) is not supported in production builds of React.")}return We.Children={map:Z,forEach:function(M,P,le){Z(M,function(){P.apply(this,arguments)},le)},count:function(M){var P=0;return Z(M,function(){P++}),P},toArray:function(M){return Z(M,function(P){return P})||[]},only:function(M){if(!me(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},We.Component=N,We.Fragment=r,We.Profiler=l,We.PureComponent=j,We.StrictMode=o,We.Suspense=g,We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,We.act=q,We.cloneElement=function(M,P,le){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var ge=T({},M.props),X=M.key,pe=M.ref,Te=M._owner;if(P!=null){if(P.ref!==void 0&&(pe=P.ref,Te=G.current),P.key!==void 0&&(X=""+P.key),M.type&&M.type.defaultProps)var se=M.type.defaultProps;for(he in P)D.call(P,he)&&!V.hasOwnProperty(he)&&(ge[he]=P[he]===void 0&&se!==void 0?se[he]:P[he])}var he=arguments.length-2;if(he===1)ge.children=le;else if(1<he){se=Array(he);for(var Se=0;Se<he;Se++)se[Se]=arguments[Se+2];ge.children=se}return{$$typeof:t,type:M.type,key:X,ref:pe,props:ge,_owner:Te}},We.createContext=function(M){return M={$$typeof:d,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:u,_context:M},M.Consumer=M},We.createElement=$,We.createFactory=function(M){var P=$.bind(null,M);return P.type=M,P},We.createRef=function(){return{current:null}},We.forwardRef=function(M){return{$$typeof:p,render:M}},We.isValidElement=me,We.lazy=function(M){return{$$typeof:v,_payload:{_status:-1,_result:M},_init:oe}},We.memo=function(M,P){return{$$typeof:m,type:M,compare:P===void 0?null:P}},We.startTransition=function(M){var P=z.transition;z.transition={};try{M()}finally{z.transition=P}},We.unstable_act=q,We.useCallback=function(M,P){return ae.current.useCallback(M,P)},We.useContext=function(M){return ae.current.useContext(M)},We.useDebugValue=function(){},We.useDeferredValue=function(M){return ae.current.useDeferredValue(M)},We.useEffect=function(M,P){return ae.current.useEffect(M,P)},We.useId=function(){return ae.current.useId()},We.useImperativeHandle=function(M,P,le){return ae.current.useImperativeHandle(M,P,le)},We.useInsertionEffect=function(M,P){return ae.current.useInsertionEffect(M,P)},We.useLayoutEffect=function(M,P){return ae.current.useLayoutEffect(M,P)},We.useMemo=function(M,P){return ae.current.useMemo(M,P)},We.useReducer=function(M,P,le){return ae.current.useReducer(M,P,le)},We.useRef=function(M){return ae.current.useRef(M)},We.useState=function(M){return ae.current.useState(M)},We.useSyncExternalStore=function(M,P,le){return ae.current.useSyncExternalStore(M,P,le)},We.useTransition=function(){return ae.current.useTransition()},We.version="18.3.1",We}var vh;function xd(){return vh||(vh=1,bu.exports=Yx()),bu.exports}/**
11
11
  * @license React
12
12
  * react-jsx-runtime.production.min.js
13
13
  *
@@ -15,7 +15,7 @@ var Wx=Object.defineProperty;var Hx=(t,s,r)=>s in t?Wx(t,s,{enumerable:!0,config
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
- */var vh;function Gx(){if(vh)return lo;vh=1;var t=vd(),s=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function d(p,g,m){var v,k={},y=null,S=null;m!==void 0&&(y=""+m),g.key!==void 0&&(y=""+g.key),g.ref!==void 0&&(S=g.ref);for(v in g)o.call(g,v)&&!u.hasOwnProperty(v)&&(k[v]=g[v]);if(p&&p.defaultProps)for(v in g=p.defaultProps,g)k[v]===void 0&&(k[v]=g[v]);return{$$typeof:s,type:p,key:y,ref:S,props:k,_owner:l.current}}return lo.Fragment=r,lo.jsx=d,lo.jsxs=d,lo}var yh;function Kx(){return yh||(yh=1,xu.exports=Gx()),xu.exports}var a=Kx(),x=vd();const ot=yg(x);var Ha={},ku={exports:{}},An={},Su={exports:{}},bu={};/**
18
+ */var yh;function Xx(){if(yh)return lo;yh=1;var t=xd(),s=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function d(p,g,m){var v,k={},y=null,S=null;m!==void 0&&(y=""+m),g.key!==void 0&&(y=""+g.key),g.ref!==void 0&&(S=g.ref);for(v in g)o.call(g,v)&&!u.hasOwnProperty(v)&&(k[v]=g[v]);if(p&&p.defaultProps)for(v in g=p.defaultProps,g)k[v]===void 0&&(k[v]=g[v]);return{$$typeof:s,type:p,key:y,ref:S,props:k,_owner:l.current}}return lo.Fragment=r,lo.jsx=d,lo.jsxs=d,lo}var xh;function Qx(){return xh||(xh=1,Su.exports=Xx()),Su.exports}var a=Qx(),x=xd();const lt=xg(x);var Ha={},Tu={exports:{}},An={},Nu={exports:{}},ju={};/**
19
19
  * @license React
20
20
  * scheduler.production.min.js
21
21
  *
@@ -23,7 +23,7 @@ var Wx=Object.defineProperty;var Hx=(t,s,r)=>s in t?Wx(t,s,{enumerable:!0,config
23
23
  *
24
24
  * This source code is licensed under the MIT license found in the
25
25
  * LICENSE file in the root directory of this source tree.
26
- */var xh;function qx(){return xh||(xh=1,(function(t){function s(z,Q){var B=z.length;z.push(Q);e:for(;0<B;){var E=B-1>>>1,P=z[E];if(0<l(P,Q))z[E]=Q,z[B]=P,B=E;else break e}}function r(z){return z.length===0?null:z[0]}function o(z){if(z.length===0)return null;var Q=z[0],B=z.pop();if(B!==Q){z[0]=B;e:for(var E=0,P=z.length,se=P>>>1;E<se;){var fe=2*(E+1)-1,X=z[fe],pe=fe+1,Ne=z[pe];if(0>l(X,B))pe<P&&0>l(Ne,X)?(z[E]=Ne,z[pe]=B,E=pe):(z[E]=X,z[fe]=B,E=fe);else if(pe<P&&0>l(Ne,B))z[E]=Ne,z[pe]=B,E=pe;else break e}}return Q}function l(z,Q){var B=z.sortIndex-Q.sortIndex;return B!==0?B:z.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var d=Date,p=d.now();t.unstable_now=function(){return d.now()-p}}var g=[],m=[],v=1,k=null,y=3,S=!1,T=!1,_=!1,N=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function H(z){for(var Q=r(m);Q!==null;){if(Q.callback===null)o(m);else if(Q.startTime<=z)o(m),Q.sortIndex=Q.expirationTime,s(g,Q);else break;Q=r(m)}}function M(z){if(_=!1,H(z),!T)if(r(g)!==null)T=!0,oe(D);else{var Q=r(m);Q!==null&&ae(M,Q.startTime-z)}}function D(z,Q){T=!1,_&&(_=!1,C($),$=-1),S=!0;var B=y;try{for(H(Q),k=r(g);k!==null&&(!(k.expirationTime>Q)||z&&!ue());){var E=k.callback;if(typeof E=="function"){k.callback=null,y=k.priorityLevel;var P=E(k.expirationTime<=Q);Q=t.unstable_now(),typeof P=="function"?k.callback=P:k===r(g)&&o(g),H(Q)}else o(g);k=r(g)}if(k!==null)var se=!0;else{var fe=r(m);fe!==null&&ae(M,fe.startTime-Q),se=!1}return se}finally{k=null,y=B,S=!1}}var K=!1,G=null,$=-1,te=5,he=-1;function ue(){return!(t.unstable_now()-he<te)}function Se(){if(G!==null){var z=t.unstable_now();he=z;var Q=!0;try{Q=G(!0,z)}finally{Q?q():(K=!1,G=null)}}else K=!1}var q;if(typeof R=="function")q=function(){R(Se)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,Z=we.port2;we.port1.onmessage=Se,q=function(){Z.postMessage(null)}}else q=function(){N(Se,0)};function oe(z){G=z,K||(K=!0,q())}function ae(z,Q){$=N(function(){z(t.unstable_now())},Q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(z){z.callback=null},t.unstable_continueExecution=function(){T||S||(T=!0,oe(D))},t.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_getFirstCallbackNode=function(){return r(g)},t.unstable_next=function(z){switch(y){case 1:case 2:case 3:var Q=3;break;default:Q=y}var B=y;y=Q;try{return z()}finally{y=B}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(z,Q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var B=y;y=z;try{return Q()}finally{y=B}},t.unstable_scheduleCallback=function(z,Q,B){var E=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?E+B:E):B=E,z){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=B+P,z={id:v++,callback:Q,priorityLevel:z,startTime:B,expirationTime:P,sortIndex:-1},B>E?(z.sortIndex=B,s(m,z),r(g)===null&&z===r(m)&&(_?(C($),$=-1):_=!0,ae(M,B-E))):(z.sortIndex=P,s(g,z),T||S||(T=!0,oe(D))),z},t.unstable_shouldYield=ue,t.unstable_wrapCallback=function(z){var Q=y;return function(){var B=y;y=Q;try{return z.apply(this,arguments)}finally{y=B}}}})(bu)),bu}var wh;function Yx(){return wh||(wh=1,Su.exports=qx()),Su.exports}/**
26
+ */var wh;function Zx(){return wh||(wh=1,(function(t){function s(z,Q){var q=z.length;z.push(Q);e:for(;0<q;){var M=q-1>>>1,P=z[M];if(0<l(P,Q))z[M]=Q,z[q]=P,q=M;else break e}}function r(z){return z.length===0?null:z[0]}function o(z){if(z.length===0)return null;var Q=z[0],q=z.pop();if(q!==Q){z[0]=q;e:for(var M=0,P=z.length,le=P>>>1;M<le;){var ge=2*(M+1)-1,X=z[ge],pe=ge+1,Te=z[pe];if(0>l(X,q))pe<P&&0>l(Te,X)?(z[M]=Te,z[pe]=q,M=pe):(z[M]=X,z[ge]=q,M=ge);else if(pe<P&&0>l(Te,q))z[M]=Te,z[pe]=q,M=pe;else break e}}return Q}function l(z,Q){var q=z.sortIndex-Q.sortIndex;return q!==0?q:z.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var d=Date,p=d.now();t.unstable_now=function(){return d.now()-p}}var g=[],m=[],v=1,k=null,y=3,S=!1,T=!1,_=!1,N=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function W(z){for(var Q=r(m);Q!==null;){if(Q.callback===null)o(m);else if(Q.startTime<=z)o(m),Q.sortIndex=Q.expirationTime,s(g,Q);else break;Q=r(m)}}function A(z){if(_=!1,W(z),!T)if(r(g)!==null)T=!0,oe(D);else{var Q=r(m);Q!==null&&ae(A,Q.startTime-z)}}function D(z,Q){T=!1,_&&(_=!1,E($),$=-1),S=!0;var q=y;try{for(W(Q),k=r(g);k!==null&&(!(k.expirationTime>Q)||z&&!de());){var M=k.callback;if(typeof M=="function"){k.callback=null,y=k.priorityLevel;var P=M(k.expirationTime<=Q);Q=t.unstable_now(),typeof P=="function"?k.callback=P:k===r(g)&&o(g),W(Q)}else o(g);k=r(g)}if(k!==null)var le=!0;else{var ge=r(m);ge!==null&&ae(A,ge.startTime-Q),le=!1}return le}finally{k=null,y=q,S=!1}}var G=!1,V=null,$=-1,te=5,me=-1;function de(){return!(t.unstable_now()-me<te)}function je(){if(V!==null){var z=t.unstable_now();me=z;var Q=!0;try{Q=V(!0,z)}finally{Q?K():(G=!1,V=null)}}else G=!1}var K;if(typeof j=="function")K=function(){j(je)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,Z=be.port2;be.port1.onmessage=je,K=function(){Z.postMessage(null)}}else K=function(){N(je,0)};function oe(z){V=z,G||(G=!0,K())}function ae(z,Q){$=N(function(){z(t.unstable_now())},Q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(z){z.callback=null},t.unstable_continueExecution=function(){T||S||(T=!0,oe(D))},t.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_getFirstCallbackNode=function(){return r(g)},t.unstable_next=function(z){switch(y){case 1:case 2:case 3:var Q=3;break;default:Q=y}var q=y;y=Q;try{return z()}finally{y=q}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(z,Q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var q=y;y=z;try{return Q()}finally{y=q}},t.unstable_scheduleCallback=function(z,Q,q){var M=t.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?M+q:M):q=M,z){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=q+P,z={id:v++,callback:Q,priorityLevel:z,startTime:q,expirationTime:P,sortIndex:-1},q>M?(z.sortIndex=q,s(m,z),r(g)===null&&z===r(m)&&(_?(E($),$=-1):_=!0,ae(A,q-M))):(z.sortIndex=P,s(g,z),T||S||(T=!0,oe(D))),z},t.unstable_shouldYield=de,t.unstable_wrapCallback=function(z){var Q=y;return function(){var q=y;y=Q;try{return z.apply(this,arguments)}finally{y=q}}}})(ju)),ju}var kh;function Jx(){return kh||(kh=1,Nu.exports=Zx()),Nu.exports}/**
27
27
  * @license React
28
28
  * react-dom.production.min.js
29
29
  *
@@ -31,421 +31,421 @@ var Wx=Object.defineProperty;var Hx=(t,s,r)=>s in t?Wx(t,s,{enumerable:!0,config
31
31
  *
32
32
  * This source code is licensed under the MIT license found in the
33
33
  * LICENSE file in the root directory of this source tree.
34
- */var kh;function Xx(){if(kh)return An;kh=1;var t=vd(),s=Yx();function r(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,l={};function u(e,n){d(e,n),d(e+"Capture",n)}function d(e,n){for(l[e]=n,e=0;e<n.length;e++)o.add(n[e])}var p=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,m=/^[: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]*$/,v={},k={};function y(e){return g.call(k,e)?!0:g.call(v,e)?!1:m.test(e)?k[e]=!0:(v[e]=!0,!1)}function S(e,n,i,c){if(i!==null&&i.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return c?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function T(e,n,i,c){if(n===null||typeof n>"u"||S(e,n,i,c))return!0;if(c)return!1;if(i!==null)switch(i.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function _(e,n,i,c,f,h,w){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=c,this.attributeNamespace=f,this.mustUseProperty=i,this.propertyName=e,this.type=n,this.sanitizeURL=h,this.removeEmptyString=w}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){N[e]=new _(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];N[n]=new _(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new _(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new _(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){N[e]=new _(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new _(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new _(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new _(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new _(e,5,!1,e.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function R(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(C,R);N[n]=new _(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(C,R);N[n]=new _(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(C,R);N[n]=new _(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new _(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new _(e,1,!1,e.toLowerCase(),null,!0,!0)});function H(e,n,i,c){var f=N.hasOwnProperty(n)?N[n]:null;(f!==null?f.type!==0:c||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(T(n,i,f,c)&&(i=null),c||f===null?y(n)&&(i===null?e.removeAttribute(n):e.setAttribute(n,""+i)):f.mustUseProperty?e[f.propertyName]=i===null?f.type===3?!1:"":i:(n=f.attributeName,c=f.attributeNamespace,i===null?e.removeAttribute(n):(f=f.type,i=f===3||f===4&&i===!0?"":""+i,c?e.setAttributeNS(c,n,i):e.setAttribute(n,i))))}var M=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,D=Symbol.for("react.element"),K=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),te=Symbol.for("react.profiler"),he=Symbol.for("react.provider"),ue=Symbol.for("react.context"),Se=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),we=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),oe=Symbol.for("react.lazy"),ae=Symbol.for("react.offscreen"),z=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var B=Object.assign,E;function P(e){if(E===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);E=n&&n[1]||""}return`
35
- `+E+e}var se=!1;function fe(e,n){if(!e||se)return"";se=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(V){var c=V}Reflect.construct(e,[],n)}else{try{n.call()}catch(V){c=V}e.call(n.prototype)}else{try{throw Error()}catch(V){c=V}e()}}catch(V){if(V&&c&&typeof V.stack=="string"){for(var f=V.stack.split(`
34
+ */var Sh;function e0(){if(Sh)return An;Sh=1;var t=xd(),s=Jx();function r(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,l={};function u(e,n){d(e,n),d(e+"Capture",n)}function d(e,n){for(l[e]=n,e=0;e<n.length;e++)o.add(n[e])}var p=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,m=/^[: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]*$/,v={},k={};function y(e){return g.call(k,e)?!0:g.call(v,e)?!1:m.test(e)?k[e]=!0:(v[e]=!0,!1)}function S(e,n,i,c){if(i!==null&&i.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return c?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function T(e,n,i,c){if(n===null||typeof n>"u"||S(e,n,i,c))return!0;if(c)return!1;if(i!==null)switch(i.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function _(e,n,i,c,f,h,w){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=c,this.attributeNamespace=f,this.mustUseProperty=i,this.propertyName=e,this.type=n,this.sanitizeURL=h,this.removeEmptyString=w}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){N[e]=new _(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];N[n]=new _(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new _(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new _(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){N[e]=new _(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new _(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new _(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new _(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new _(e,5,!1,e.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function j(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(E,j);N[n]=new _(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(E,j);N[n]=new _(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(E,j);N[n]=new _(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new _(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new _(e,1,!1,e.toLowerCase(),null,!0,!0)});function W(e,n,i,c){var f=N.hasOwnProperty(n)?N[n]:null;(f!==null?f.type!==0:c||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(T(n,i,f,c)&&(i=null),c||f===null?y(n)&&(i===null?e.removeAttribute(n):e.setAttribute(n,""+i)):f.mustUseProperty?e[f.propertyName]=i===null?f.type===3?!1:"":i:(n=f.attributeName,c=f.attributeNamespace,i===null?e.removeAttribute(n):(f=f.type,i=f===3||f===4&&i===!0?"":""+i,c?e.setAttributeNS(c,n,i):e.setAttribute(n,i))))}var A=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,D=Symbol.for("react.element"),G=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),te=Symbol.for("react.profiler"),me=Symbol.for("react.provider"),de=Symbol.for("react.context"),je=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),be=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),oe=Symbol.for("react.lazy"),ae=Symbol.for("react.offscreen"),z=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var q=Object.assign,M;function P(e){if(M===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);M=n&&n[1]||""}return`
35
+ `+M+e}var le=!1;function ge(e,n){if(!e||le)return"";le=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(H){var c=H}Reflect.construct(e,[],n)}else{try{n.call()}catch(H){c=H}e.call(n.prototype)}else{try{throw Error()}catch(H){c=H}e()}}catch(H){if(H&&c&&typeof H.stack=="string"){for(var f=H.stack.split(`
36
36
  `),h=c.stack.split(`
37
- `),w=f.length-1,j=h.length-1;1<=w&&0<=j&&f[w]!==h[j];)j--;for(;1<=w&&0<=j;w--,j--)if(f[w]!==h[j]){if(w!==1||j!==1)do if(w--,j--,0>j||f[w]!==h[j]){var L=`
38
- `+f[w].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=w&&0<=j);break}}}finally{se=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?P(e):""}function X(e){switch(e.tag){case 5:return P(e.type);case 16:return P("Lazy");case 13:return P("Suspense");case 19:return P("SuspenseList");case 0:case 2:case 15:return e=fe(e.type,!1),e;case 11:return e=fe(e.type.render,!1),e;case 1:return e=fe(e.type,!0),e;default:return""}}function pe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case G:return"Fragment";case K:return"Portal";case te:return"Profiler";case $:return"StrictMode";case q:return"Suspense";case we:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ue:return(e.displayName||"Context")+".Consumer";case he:return(e._context.displayName||"Context")+".Provider";case Se:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return n=e.displayName||null,n!==null?n:pe(e.type)||"Memo";case oe:n=e._payload,e=e._init;try{return pe(e(n))}catch{}}return null}function Ne(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(n);case 8:return n===$?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function _e(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ae(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ee(e){var n=Ae(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),c=""+e[n];if(!e.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var f=i.get,h=i.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(w){c=""+w,h.call(this,w)}}),Object.defineProperty(e,n,{enumerable:i.enumerable}),{getValue:function(){return c},setValue:function(w){c=""+w},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function at(e){e._valueTracker||(e._valueTracker=Ee(e))}function De(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),c="";return e&&(c=Ae(e)?e.checked?"true":"false":e.value),e=c,e!==i?(n.setValue(e),!0):!1}function lt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function $e(e,n){var i=n.checked;return B({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function en(e,n){var i=n.defaultValue==null?"":n.defaultValue,c=n.checked!=null?n.checked:n.defaultChecked;i=_e(n.value!=null?n.value:i),e._wrapperState={initialChecked:c,initialValue:i,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Fe(e,n){n=n.checked,n!=null&&H(e,"checked",n,!1)}function Ht(e,n){Fe(e,n);var i=_e(n.value),c=n.type;if(i!=null)c==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(c==="submit"||c==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?wt(e,n.type,i):n.hasOwnProperty("defaultValue")&&wt(e,n.type,_e(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function tn(e,n,i){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var c=n.type;if(!(c!=="submit"&&c!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,i||n===e.value||(e.value=n),e.defaultValue=n}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function wt(e,n,i){(n!=="number"||lt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var jt=Array.isArray;function $t(e,n,i,c){if(e=e.options,n){n={};for(var f=0;f<i.length;f++)n["$"+i[f]]=!0;for(i=0;i<e.length;i++)f=n.hasOwnProperty("$"+e[i].value),e[i].selected!==f&&(e[i].selected=f),f&&c&&(e[i].defaultSelected=!0)}else{for(i=""+_e(i),n=null,f=0;f<e.length;f++){if(e[f].value===i){e[f].selected=!0,c&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function Dt(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(r(91));return B({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Y(e,n){var i=n.value;if(i==null){if(i=n.children,n=n.defaultValue,i!=null){if(n!=null)throw Error(r(92));if(jt(i)){if(1<i.length)throw Error(r(93));i=i[0]}n=i}n==null&&(n=""),i=n}e._wrapperState={initialValue:_e(i)}}function me(e,n){var i=_e(n.value),c=_e(n.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),n.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),c!=null&&(e.defaultValue=""+c)}function Ue(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function tt(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function mt(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?tt(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var gt,Ct=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,i,c,f){MSApp.execUnsafeLocalFunction(function(){return e(n,i,c,f)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(gt=gt||document.createElement("div"),gt.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=gt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function an(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}var dt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Mn=["Webkit","ms","Moz","O"];Object.keys(dt).forEach(function(e){Mn.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),dt[n]=dt[e]})});function Dn(e,n,i){return n==null||typeof n=="boolean"||n===""?"":i||typeof n!="number"||n===0||dt.hasOwnProperty(e)&&dt[e]?(""+n).trim():n+"px"}function ps(e,n){e=e.style;for(var i in n)if(n.hasOwnProperty(i)){var c=i.indexOf("--")===0,f=Dn(i,n[i],c);i==="float"&&(i="cssFloat"),c?e.setProperty(i,f):e[i]=f}}var hs=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ts(e,n){if(n){if(hs[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(r(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(r(61))}if(n.style!=null&&typeof n.style!="object")throw Error(r(62))}}function Ln(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";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 gn=null;function ln(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vt=null,vn=null,Xe=null;function Et(e){if(e=Ki(e)){if(typeof Vt!="function")throw Error(r(280));var n=e.stateNode;n&&(n=ia(n),Vt(e.stateNode,e.type,n))}}function ft(e){vn?Xe?Xe.push(e):Xe=[e]:vn=e}function Gt(){if(vn){var e=vn,n=Xe;if(Xe=vn=null,Et(e),n)for(e=0;e<n.length;e++)Et(n[e])}}function vt(e,n){return e(n)}function yt(){}var it=!1;function Kt(e,n,i){if(it)return e(n,i);it=!0;try{return vt(e,n,i)}finally{it=!1,(vn!==null||Xe!==null)&&(yt(),Gt())}}function st(e,n){var i=e.stateNode;if(i===null)return null;var c=ia(i);if(c===null)return null;i=c[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(e=e.type,c=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!c;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(r(231,n,typeof i));return i}var Lt=!1;if(p)try{var A={};Object.defineProperty(A,"passive",{get:function(){Lt=!0}}),window.addEventListener("test",A,A),window.removeEventListener("test",A,A)}catch{Lt=!1}function de(e,n,i,c,f,h,w,j,L){var V=Array.prototype.slice.call(arguments,3);try{n.apply(i,V)}catch(ne){this.onError(ne)}}var ie=!1,ye=null,Le=!1,Ge=null,Oe={onError:function(e){ie=!0,ye=e}};function zt(e,n,i,c,f,h,w,j,L){ie=!1,ye=null,de.apply(Oe,arguments)}function On(e,n,i,c,f,h,w,j,L){if(zt.apply(this,arguments),ie){if(ie){var V=ye;ie=!1,ye=null}else throw Error(r(198));Le||(Le=!0,Ge=V)}}function Be(e){var n=e,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i:null}function yn(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function Cs(e){if(Be(e)!==e)throw Error(r(188))}function Us(e){var n=e.alternate;if(!n){if(n=Be(e),n===null)throw Error(r(188));return n!==e?null:e}for(var i=e,c=n;;){var f=i.return;if(f===null)break;var h=f.alternate;if(h===null){if(c=f.return,c!==null){i=c;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===i)return Cs(f),e;if(h===c)return Cs(f),n;h=h.sibling}throw Error(r(188))}if(i.return!==c.return)i=f,c=h;else{for(var w=!1,j=f.child;j;){if(j===i){w=!0,i=f,c=h;break}if(j===c){w=!0,c=f,i=h;break}j=j.sibling}if(!w){for(j=h.child;j;){if(j===i){w=!0,i=h,c=f;break}if(j===c){w=!0,c=h,i=f;break}j=j.sibling}if(!w)throw Error(r(189))}}if(i.alternate!==c)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?e:n}function Pn(e){return e=Us(e),e!==null?ms(e):null}function ms(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=ms(e);if(n!==null)return n;e=e.sibling}return null}var Qe=s.unstable_scheduleCallback,_t=s.unstable_cancelCallback,gs=s.unstable_shouldYield,Hl=s.unstable_requestPaint,kt=s.unstable_now,vs=s.unstable_getCurrentPriorityLevel,Bs=s.unstable_ImmediatePriority,ys=s.unstable_UserBlockingPriority,Br=s.unstable_NormalPriority,gr=s.unstable_LowPriority,Uo=s.unstable_IdlePriority,vr=null,$n=null;function Wr(e){if($n&&typeof $n.onCommitFiberRoot=="function")try{$n.onCommitFiberRoot(vr,e,void 0,(e.current.flags&128)===128)}catch{}}var xn=Math.clz32?Math.clz32:yr,Hr=Math.log,Ws=Math.LN2;function yr(e){return e>>>=0,e===0?32:31-(Hr(e)/Ws|0)|0}var wn=64,Vr=4194304;function xr(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function wr(e,n){var i=e.pendingLanes;if(i===0)return 0;var c=0,f=e.suspendedLanes,h=e.pingedLanes,w=i&268435455;if(w!==0){var j=w&~f;j!==0?c=xr(j):(h&=w,h!==0&&(c=xr(h)))}else w=i&~f,w!==0?c=xr(w):h!==0&&(c=xr(h));if(c===0)return 0;if(n!==0&&n!==c&&(n&f)===0&&(f=c&-c,h=n&-n,f>=h||f===16&&(h&4194240)!==0))return n;if((c&4)!==0&&(c|=i&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=c;0<n;)i=31-xn(n),f=1<<i,c|=e[i],n&=~f;return c}function Bo(e,n){switch(e){case 1:case 2:case 4:return n+250;case 8:case 16:case 32:case 64: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 n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Wo(e,n){for(var i=e.suspendedLanes,c=e.pingedLanes,f=e.expirationTimes,h=e.pendingLanes;0<h;){var w=31-xn(h),j=1<<w,L=f[w];L===-1?((j&i)===0||(j&c)!==0)&&(f[w]=Bo(j,n)):L<=n&&(e.expiredLanes|=j),h&=~j}}function Ri(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ai(){var e=wn;return wn<<=1,(wn&4194240)===0&&(wn=64),e}function Ii(e){for(var n=[],i=0;31>i;i++)n.push(e);return n}function kr(e,n,i){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-xn(n),e[n]=i}function Ho(e,n){var i=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var c=e.eventTimes;for(e=e.expirationTimes;0<i;){var f=31-xn(i),h=1<<f;n[f]=0,c[f]=-1,e[f]=-1,i&=~h}}function Hs(e,n){var i=e.entangledLanes|=n;for(e=e.entanglements;i;){var c=31-xn(i),f=1<<c;f&n|e[c]&n&&(e[c]|=n),i&=~f}}var Ke=0;function le(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var b,F,J,be,Ce,ze=!1,qe=[],Ze=null,St=null,bt=null,Es=new Map,At=new Map,Vs=[],dy="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 submit".split(" ");function Qd(e,n){switch(e){case"focusin":case"focusout":Ze=null;break;case"dragenter":case"dragleave":St=null;break;case"mouseover":case"mouseout":bt=null;break;case"pointerover":case"pointerout":Es.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":At.delete(n.pointerId)}}function Mi(e,n,i,c,f,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:i,eventSystemFlags:c,nativeEvent:h,targetContainers:[f]},n!==null&&(n=Ki(n),n!==null&&F(n)),e):(e.eventSystemFlags|=c,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function fy(e,n,i,c,f){switch(n){case"focusin":return Ze=Mi(Ze,e,n,i,c,f),!0;case"dragenter":return St=Mi(St,e,n,i,c,f),!0;case"mouseover":return bt=Mi(bt,e,n,i,c,f),!0;case"pointerover":var h=f.pointerId;return Es.set(h,Mi(Es.get(h)||null,e,n,i,c,f)),!0;case"gotpointercapture":return h=f.pointerId,At.set(h,Mi(At.get(h)||null,e,n,i,c,f)),!0}return!1}function Zd(e){var n=Sr(e.target);if(n!==null){var i=Be(n);if(i!==null){if(n=i.tag,n===13){if(n=yn(i),n!==null){e.blockedOn=n,Ce(e.priority,function(){J(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Vo(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=Gl(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var c=new i.constructor(i.type,i);gn=c,i.target.dispatchEvent(c),gn=null}else return n=Ki(i),n!==null&&F(n),e.blockedOn=i,!1;n.shift()}return!0}function Jd(e,n,i){Vo(e)&&i.delete(n)}function py(){ze=!1,Ze!==null&&Vo(Ze)&&(Ze=null),St!==null&&Vo(St)&&(St=null),bt!==null&&Vo(bt)&&(bt=null),Es.forEach(Jd),At.forEach(Jd)}function Di(e,n){e.blockedOn===n&&(e.blockedOn=null,ze||(ze=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,py)))}function Li(e){function n(f){return Di(f,e)}if(0<qe.length){Di(qe[0],e);for(var i=1;i<qe.length;i++){var c=qe[i];c.blockedOn===e&&(c.blockedOn=null)}}for(Ze!==null&&Di(Ze,e),St!==null&&Di(St,e),bt!==null&&Di(bt,e),Es.forEach(n),At.forEach(n),i=0;i<Vs.length;i++)c=Vs[i],c.blockedOn===e&&(c.blockedOn=null);for(;0<Vs.length&&(i=Vs[0],i.blockedOn===null);)Zd(i),i.blockedOn===null&&Vs.shift()}var Gr=M.ReactCurrentBatchConfig,Go=!0;function hy(e,n,i,c){var f=Ke,h=Gr.transition;Gr.transition=null;try{Ke=1,Vl(e,n,i,c)}finally{Ke=f,Gr.transition=h}}function my(e,n,i,c){var f=Ke,h=Gr.transition;Gr.transition=null;try{Ke=4,Vl(e,n,i,c)}finally{Ke=f,Gr.transition=h}}function Vl(e,n,i,c){if(Go){var f=Gl(e,n,i,c);if(f===null)cc(e,n,c,Ko,i),Qd(e,c);else if(fy(f,e,n,i,c))c.stopPropagation();else if(Qd(e,c),n&4&&-1<dy.indexOf(e)){for(;f!==null;){var h=Ki(f);if(h!==null&&b(h),h=Gl(e,n,i,c),h===null&&cc(e,n,c,Ko,i),h===f)break;f=h}f!==null&&c.stopPropagation()}else cc(e,n,c,null,i)}}var Ko=null;function Gl(e,n,i,c){if(Ko=null,e=ln(c),e=Sr(e),e!==null)if(n=Be(e),n===null)e=null;else if(i=n.tag,i===13){if(e=yn(n),e!==null)return e;e=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return Ko=e,null}function ef(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(vs()){case Bs:return 1;case ys:return 4;case Br:case gr:return 16;case Uo:return 536870912;default:return 16}default:return 16}}var Gs=null,Kl=null,qo=null;function tf(){if(qo)return qo;var e,n=Kl,i=n.length,c,f="value"in Gs?Gs.value:Gs.textContent,h=f.length;for(e=0;e<i&&n[e]===f[e];e++);var w=i-e;for(c=1;c<=w&&n[i-c]===f[h-c];c++);return qo=f.slice(e,1<c?1-c:void 0)}function Yo(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Xo(){return!0}function nf(){return!1}function zn(e){function n(i,c,f,h,w){this._reactName=i,this._targetInst=f,this.type=c,this.nativeEvent=h,this.target=w,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(i=e[j],this[j]=i?i(h):h[j]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Xo:nf,this.isPropagationStopped=nf,this}return B(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Xo)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Xo)},persist:function(){},isPersistent:Xo}),n}var Kr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ql=zn(Kr),Oi=B({},Kr,{view:0,detail:0}),gy=zn(Oi),Yl,Xl,Pi,Qo=B({},Oi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zl,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!==Pi&&(Pi&&e.type==="mousemove"?(Yl=e.screenX-Pi.screenX,Xl=e.screenY-Pi.screenY):Xl=Yl=0,Pi=e),Yl)},movementY:function(e){return"movementY"in e?e.movementY:Xl}}),sf=zn(Qo),vy=B({},Qo,{dataTransfer:0}),yy=zn(vy),xy=B({},Oi,{relatedTarget:0}),Ql=zn(xy),wy=B({},Kr,{animationName:0,elapsedTime:0,pseudoElement:0}),ky=zn(wy),Sy=B({},Kr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),by=zn(Sy),Ty=B({},Kr,{data:0}),rf=zn(Ty),Ny={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jy={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"},Cy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ey(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Cy[e])?!!n[e]:!1}function Zl(){return Ey}var _y=B({},Oi,{key:function(e){if(e.key){var n=Ny[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Yo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?jy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zl,charCode:function(e){return e.type==="keypress"?Yo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ry=zn(_y),Ay=B({},Qo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),of=zn(Ay),Iy=B({},Oi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zl}),My=zn(Iy),Dy=B({},Kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ly=zn(Dy),Oy=B({},Qo,{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}),Py=zn(Oy),$y=[9,13,27,32],Jl=p&&"CompositionEvent"in window,$i=null;p&&"documentMode"in document&&($i=document.documentMode);var zy=p&&"TextEvent"in window&&!$i,af=p&&(!Jl||$i&&8<$i&&11>=$i),lf=" ",cf=!1;function uf(e,n){switch(e){case"keyup":return $y.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function df(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var qr=!1;function Fy(e,n){switch(e){case"compositionend":return df(n);case"keypress":return n.which!==32?null:(cf=!0,lf);case"textInput":return e=n.data,e===lf&&cf?null:e;default:return null}}function Uy(e,n){if(qr)return e==="compositionend"||!Jl&&uf(e,n)?(e=tf(),qo=Kl=Gs=null,qr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return af&&n.locale!=="ko"?null:n.data;default:return null}}var By={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 ff(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!By[e.type]:n==="textarea"}function pf(e,n,i,c){ft(c),n=na(n,"onChange"),0<n.length&&(i=new ql("onChange","change",null,i,c),e.push({event:i,listeners:n}))}var zi=null,Fi=null;function Wy(e){Af(e,0)}function Zo(e){var n=Jr(e);if(De(n))return e}function Hy(e,n){if(e==="change")return n}var hf=!1;if(p){var ec;if(p){var tc="oninput"in document;if(!tc){var mf=document.createElement("div");mf.setAttribute("oninput","return;"),tc=typeof mf.oninput=="function"}ec=tc}else ec=!1;hf=ec&&(!document.documentMode||9<document.documentMode)}function gf(){zi&&(zi.detachEvent("onpropertychange",vf),Fi=zi=null)}function vf(e){if(e.propertyName==="value"&&Zo(Fi)){var n=[];pf(n,Fi,e,ln(e)),Kt(Wy,n)}}function Vy(e,n,i){e==="focusin"?(gf(),zi=n,Fi=i,zi.attachEvent("onpropertychange",vf)):e==="focusout"&&gf()}function Gy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zo(Fi)}function Ky(e,n){if(e==="click")return Zo(n)}function qy(e,n){if(e==="input"||e==="change")return Zo(n)}function Yy(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var ns=typeof Object.is=="function"?Object.is:Yy;function Ui(e,n){if(ns(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var i=Object.keys(e),c=Object.keys(n);if(i.length!==c.length)return!1;for(c=0;c<i.length;c++){var f=i[c];if(!g.call(n,f)||!ns(e[f],n[f]))return!1}return!0}function yf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xf(e,n){var i=yf(e);e=0;for(var c;i;){if(i.nodeType===3){if(c=e+i.textContent.length,e<=n&&c>=n)return{node:i,offset:n-e};e=c}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=yf(i)}}function wf(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?wf(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function kf(){for(var e=window,n=lt();n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=lt(e.document)}return n}function nc(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function Xy(e){var n=kf(),i=e.focusedElem,c=e.selectionRange;if(n!==i&&i&&i.ownerDocument&&wf(i.ownerDocument.documentElement,i)){if(c!==null&&nc(i)){if(n=c.start,e=c.end,e===void 0&&(e=n),"selectionStart"in i)i.selectionStart=n,i.selectionEnd=Math.min(e,i.value.length);else if(e=(n=i.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var f=i.textContent.length,h=Math.min(c.start,f);c=c.end===void 0?h:Math.min(c.end,f),!e.extend&&h>c&&(f=c,c=h,h=f),f=xf(i,h);var w=xf(i,c);f&&w&&(e.rangeCount!==1||e.anchorNode!==f.node||e.anchorOffset!==f.offset||e.focusNode!==w.node||e.focusOffset!==w.offset)&&(n=n.createRange(),n.setStart(f.node,f.offset),e.removeAllRanges(),h>c?(e.addRange(n),e.extend(w.node,w.offset)):(n.setEnd(w.node,w.offset),e.addRange(n)))}}for(n=[],e=i;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<n.length;i++)e=n[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Qy=p&&"documentMode"in document&&11>=document.documentMode,Yr=null,sc=null,Bi=null,rc=!1;function Sf(e,n,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;rc||Yr==null||Yr!==lt(c)||(c=Yr,"selectionStart"in c&&nc(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Bi&&Ui(Bi,c)||(Bi=c,c=na(sc,"onSelect"),0<c.length&&(n=new ql("onSelect","select",null,n,i),e.push({event:n,listeners:c}),n.target=Yr)))}function Jo(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var Xr={animationend:Jo("Animation","AnimationEnd"),animationiteration:Jo("Animation","AnimationIteration"),animationstart:Jo("Animation","AnimationStart"),transitionend:Jo("Transition","TransitionEnd")},ic={},bf={};p&&(bf=document.createElement("div").style,"AnimationEvent"in window||(delete Xr.animationend.animation,delete Xr.animationiteration.animation,delete Xr.animationstart.animation),"TransitionEvent"in window||delete Xr.transitionend.transition);function ea(e){if(ic[e])return ic[e];if(!Xr[e])return e;var n=Xr[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in bf)return ic[e]=n[i];return e}var Tf=ea("animationend"),Nf=ea("animationiteration"),jf=ea("animationstart"),Cf=ea("transitionend"),Ef=new Map,_f="abort auxClick 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(" ");function Ks(e,n){Ef.set(e,n),u(n,[e])}for(var oc=0;oc<_f.length;oc++){var ac=_f[oc],Zy=ac.toLowerCase(),Jy=ac[0].toUpperCase()+ac.slice(1);Ks(Zy,"on"+Jy)}Ks(Tf,"onAnimationEnd"),Ks(Nf,"onAnimationIteration"),Ks(jf,"onAnimationStart"),Ks("dblclick","onDoubleClick"),Ks("focusin","onFocus"),Ks("focusout","onBlur"),Ks(Cf,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wi="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(" "),ex=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wi));function Rf(e,n,i){var c=e.type||"unknown-event";e.currentTarget=i,On(c,n,void 0,e),e.currentTarget=null}function Af(e,n){n=(n&4)!==0;for(var i=0;i<e.length;i++){var c=e[i],f=c.event;c=c.listeners;e:{var h=void 0;if(n)for(var w=c.length-1;0<=w;w--){var j=c[w],L=j.instance,V=j.currentTarget;if(j=j.listener,L!==h&&f.isPropagationStopped())break e;Rf(f,j,V),h=L}else for(w=0;w<c.length;w++){if(j=c[w],L=j.instance,V=j.currentTarget,j=j.listener,L!==h&&f.isPropagationStopped())break e;Rf(f,j,V),h=L}}}if(Le)throw e=Ge,Le=!1,Ge=null,e}function pt(e,n){var i=n[mc];i===void 0&&(i=n[mc]=new Set);var c=e+"__bubble";i.has(c)||(If(n,e,2,!1),i.add(c))}function lc(e,n,i){var c=0;n&&(c|=4),If(i,e,c,n)}var ta="_reactListening"+Math.random().toString(36).slice(2);function Hi(e){if(!e[ta]){e[ta]=!0,o.forEach(function(i){i!=="selectionchange"&&(ex.has(i)||lc(i,!1,e),lc(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[ta]||(n[ta]=!0,lc("selectionchange",!1,n))}}function If(e,n,i,c){switch(ef(n)){case 1:var f=hy;break;case 4:f=my;break;default:f=Vl}i=f.bind(null,n,i,e),f=void 0,!Lt||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),c?f!==void 0?e.addEventListener(n,i,{capture:!0,passive:f}):e.addEventListener(n,i,!0):f!==void 0?e.addEventListener(n,i,{passive:f}):e.addEventListener(n,i,!1)}function cc(e,n,i,c,f){var h=c;if((n&1)===0&&(n&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var j=c.stateNode.containerInfo;if(j===f||j.nodeType===8&&j.parentNode===f)break;if(w===4)for(w=c.return;w!==null;){var L=w.tag;if((L===3||L===4)&&(L=w.stateNode.containerInfo,L===f||L.nodeType===8&&L.parentNode===f))return;w=w.return}for(;j!==null;){if(w=Sr(j),w===null)return;if(L=w.tag,L===5||L===6){c=h=w;continue e}j=j.parentNode}}c=c.return}Kt(function(){var V=h,ne=ln(i),re=[];e:{var ee=Ef.get(e);if(ee!==void 0){var ve=ql,ke=e;switch(e){case"keypress":if(Yo(i)===0)break e;case"keydown":case"keyup":ve=Ry;break;case"focusin":ke="focus",ve=Ql;break;case"focusout":ke="blur",ve=Ql;break;case"beforeblur":case"afterblur":ve=Ql;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ve=sf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ve=yy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ve=My;break;case Tf:case Nf:case jf:ve=ky;break;case Cf:ve=Ly;break;case"scroll":ve=gy;break;case"wheel":ve=Py;break;case"copy":case"cut":case"paste":ve=by;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ve=of}var Te=(n&4)!==0,It=!Te&&e==="scroll",U=Te?ee!==null?ee+"Capture":null:ee;Te=[];for(var O=V,W;O!==null;){W=O;var ce=W.stateNode;if(W.tag===5&&ce!==null&&(W=ce,U!==null&&(ce=st(O,U),ce!=null&&Te.push(Vi(O,ce,W)))),It)break;O=O.return}0<Te.length&&(ee=new ve(ee,ke,null,i,ne),re.push({event:ee,listeners:Te}))}}if((n&7)===0){e:{if(ee=e==="mouseover"||e==="pointerover",ve=e==="mouseout"||e==="pointerout",ee&&i!==gn&&(ke=i.relatedTarget||i.fromElement)&&(Sr(ke)||ke[_s]))break e;if((ve||ee)&&(ee=ne.window===ne?ne:(ee=ne.ownerDocument)?ee.defaultView||ee.parentWindow:window,ve?(ke=i.relatedTarget||i.toElement,ve=V,ke=ke?Sr(ke):null,ke!==null&&(It=Be(ke),ke!==It||ke.tag!==5&&ke.tag!==6)&&(ke=null)):(ve=null,ke=V),ve!==ke)){if(Te=sf,ce="onMouseLeave",U="onMouseEnter",O="mouse",(e==="pointerout"||e==="pointerover")&&(Te=of,ce="onPointerLeave",U="onPointerEnter",O="pointer"),It=ve==null?ee:Jr(ve),W=ke==null?ee:Jr(ke),ee=new Te(ce,O+"leave",ve,i,ne),ee.target=It,ee.relatedTarget=W,ce=null,Sr(ne)===V&&(Te=new Te(U,O+"enter",ke,i,ne),Te.target=W,Te.relatedTarget=It,ce=Te),It=ce,ve&&ke)t:{for(Te=ve,U=ke,O=0,W=Te;W;W=Qr(W))O++;for(W=0,ce=U;ce;ce=Qr(ce))W++;for(;0<O-W;)Te=Qr(Te),O--;for(;0<W-O;)U=Qr(U),W--;for(;O--;){if(Te===U||U!==null&&Te===U.alternate)break t;Te=Qr(Te),U=Qr(U)}Te=null}else Te=null;ve!==null&&Mf(re,ee,ve,Te,!1),ke!==null&&It!==null&&Mf(re,It,ke,Te,!0)}}e:{if(ee=V?Jr(V):window,ve=ee.nodeName&&ee.nodeName.toLowerCase(),ve==="select"||ve==="input"&&ee.type==="file")var je=Hy;else if(ff(ee))if(hf)je=qy;else{je=Gy;var Ie=Vy}else(ve=ee.nodeName)&&ve.toLowerCase()==="input"&&(ee.type==="checkbox"||ee.type==="radio")&&(je=Ky);if(je&&(je=je(e,V))){pf(re,je,i,ne);break e}Ie&&Ie(e,ee,V),e==="focusout"&&(Ie=ee._wrapperState)&&Ie.controlled&&ee.type==="number"&&wt(ee,"number",ee.value)}switch(Ie=V?Jr(V):window,e){case"focusin":(ff(Ie)||Ie.contentEditable==="true")&&(Yr=Ie,sc=V,Bi=null);break;case"focusout":Bi=sc=Yr=null;break;case"mousedown":rc=!0;break;case"contextmenu":case"mouseup":case"dragend":rc=!1,Sf(re,i,ne);break;case"selectionchange":if(Qy)break;case"keydown":case"keyup":Sf(re,i,ne)}var Me;if(Jl)e:{switch(e){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else qr?uf(e,i)&&(Pe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Pe="onCompositionStart");Pe&&(af&&i.locale!=="ko"&&(qr||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&qr&&(Me=tf()):(Gs=ne,Kl="value"in Gs?Gs.value:Gs.textContent,qr=!0)),Ie=na(V,Pe),0<Ie.length&&(Pe=new rf(Pe,e,null,i,ne),re.push({event:Pe,listeners:Ie}),Me?Pe.data=Me:(Me=df(i),Me!==null&&(Pe.data=Me)))),(Me=zy?Fy(e,i):Uy(e,i))&&(V=na(V,"onBeforeInput"),0<V.length&&(ne=new rf("onBeforeInput","beforeinput",null,i,ne),re.push({event:ne,listeners:V}),ne.data=Me))}Af(re,n)})}function Vi(e,n,i){return{instance:e,listener:n,currentTarget:i}}function na(e,n){for(var i=n+"Capture",c=[];e!==null;){var f=e,h=f.stateNode;f.tag===5&&h!==null&&(f=h,h=st(e,i),h!=null&&c.unshift(Vi(e,h,f)),h=st(e,n),h!=null&&c.push(Vi(e,h,f))),e=e.return}return c}function Qr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Mf(e,n,i,c,f){for(var h=n._reactName,w=[];i!==null&&i!==c;){var j=i,L=j.alternate,V=j.stateNode;if(L!==null&&L===c)break;j.tag===5&&V!==null&&(j=V,f?(L=st(i,h),L!=null&&w.unshift(Vi(i,L,j))):f||(L=st(i,h),L!=null&&w.push(Vi(i,L,j)))),i=i.return}w.length!==0&&e.push({event:n,listeners:w})}var tx=/\r\n?/g,nx=/\u0000|\uFFFD/g;function Df(e){return(typeof e=="string"?e:""+e).replace(tx,`
39
- `).replace(nx,"")}function sa(e,n,i){if(n=Df(n),Df(e)!==n&&i)throw Error(r(425))}function ra(){}var uc=null,dc=null;function fc(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var pc=typeof setTimeout=="function"?setTimeout:void 0,sx=typeof clearTimeout=="function"?clearTimeout:void 0,Lf=typeof Promise=="function"?Promise:void 0,rx=typeof queueMicrotask=="function"?queueMicrotask:typeof Lf<"u"?function(e){return Lf.resolve(null).then(e).catch(ix)}:pc;function ix(e){setTimeout(function(){throw e})}function hc(e,n){var i=n,c=0;do{var f=i.nextSibling;if(e.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"){if(c===0){e.removeChild(f),Li(n);return}c--}else i!=="$"&&i!=="$?"&&i!=="$!"||c++;i=f}while(i);Li(n)}function qs(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function Of(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(n===0)return e;n--}else i==="/$"&&n++}e=e.previousSibling}return null}var Zr=Math.random().toString(36).slice(2),xs="__reactFiber$"+Zr,Gi="__reactProps$"+Zr,_s="__reactContainer$"+Zr,mc="__reactEvents$"+Zr,ox="__reactListeners$"+Zr,ax="__reactHandles$"+Zr;function Sr(e){var n=e[xs];if(n)return n;for(var i=e.parentNode;i;){if(n=i[_s]||i[xs]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=Of(e);e!==null;){if(i=e[xs])return i;e=Of(e)}return n}e=i,i=e.parentNode}return null}function Ki(e){return e=e[xs]||e[_s],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Jr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function ia(e){return e[Gi]||null}var gc=[],ei=-1;function Ys(e){return{current:e}}function ht(e){0>ei||(e.current=gc[ei],gc[ei]=null,ei--)}function ut(e,n){ei++,gc[ei]=e.current,e.current=n}var Xs={},cn=Ys(Xs),jn=Ys(!1),br=Xs;function ti(e,n){var i=e.type.contextTypes;if(!i)return Xs;var c=e.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===n)return c.__reactInternalMemoizedMaskedChildContext;var f={},h;for(h in i)f[h]=n[h];return c&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=f),f}function Cn(e){return e=e.childContextTypes,e!=null}function oa(){ht(jn),ht(cn)}function Pf(e,n,i){if(cn.current!==Xs)throw Error(r(168));ut(cn,n),ut(jn,i)}function $f(e,n,i){var c=e.stateNode;if(n=n.childContextTypes,typeof c.getChildContext!="function")return i;c=c.getChildContext();for(var f in c)if(!(f in n))throw Error(r(108,Ne(e)||"Unknown",f));return B({},i,c)}function aa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xs,br=cn.current,ut(cn,e),ut(jn,jn.current),!0}function zf(e,n,i){var c=e.stateNode;if(!c)throw Error(r(169));i?(e=$f(e,n,br),c.__reactInternalMemoizedMergedChildContext=e,ht(jn),ht(cn),ut(cn,e)):ht(jn),ut(jn,i)}var Rs=null,la=!1,vc=!1;function Ff(e){Rs===null?Rs=[e]:Rs.push(e)}function lx(e){la=!0,Ff(e)}function Qs(){if(!vc&&Rs!==null){vc=!0;var e=0,n=Ke;try{var i=Rs;for(Ke=1;e<i.length;e++){var c=i[e];do c=c(!0);while(c!==null)}Rs=null,la=!1}catch(f){throw Rs!==null&&(Rs=Rs.slice(e+1)),Qe(Bs,Qs),f}finally{Ke=n,vc=!1}}return null}var ni=[],si=0,ca=null,ua=0,Gn=[],Kn=0,Tr=null,As=1,Is="";function Nr(e,n){ni[si++]=ua,ni[si++]=ca,ca=e,ua=n}function Uf(e,n,i){Gn[Kn++]=As,Gn[Kn++]=Is,Gn[Kn++]=Tr,Tr=e;var c=As;e=Is;var f=32-xn(c)-1;c&=~(1<<f),i+=1;var h=32-xn(n)+f;if(30<h){var w=f-f%5;h=(c&(1<<w)-1).toString(32),c>>=w,f-=w,As=1<<32-xn(n)+f|i<<f|c,Is=h+e}else As=1<<h|i<<f|c,Is=e}function yc(e){e.return!==null&&(Nr(e,1),Uf(e,1,0))}function xc(e){for(;e===ca;)ca=ni[--si],ni[si]=null,ua=ni[--si],ni[si]=null;for(;e===Tr;)Tr=Gn[--Kn],Gn[Kn]=null,Is=Gn[--Kn],Gn[Kn]=null,As=Gn[--Kn],Gn[Kn]=null}var Fn=null,Un=null,xt=!1,ss=null;function Bf(e,n){var i=Qn(5,null,null,0);i.elementType="DELETED",i.stateNode=n,i.return=e,n=e.deletions,n===null?(e.deletions=[i],e.flags|=16):n.push(i)}function Wf(e,n){switch(e.tag){case 5:var i=e.type;return n=n.nodeType!==1||i.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,Fn=e,Un=qs(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Fn=e,Un=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(i=Tr!==null?{id:As,overflow:Is}:null,e.memoizedState={dehydrated:n,treeContext:i,retryLane:1073741824},i=Qn(18,null,null,0),i.stateNode=n,i.return=e,e.child=i,Fn=e,Un=null,!0):!1;default:return!1}}function wc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function kc(e){if(xt){var n=Un;if(n){var i=n;if(!Wf(e,n)){if(wc(e))throw Error(r(418));n=qs(i.nextSibling);var c=Fn;n&&Wf(e,n)?Bf(c,i):(e.flags=e.flags&-4097|2,xt=!1,Fn=e)}}else{if(wc(e))throw Error(r(418));e.flags=e.flags&-4097|2,xt=!1,Fn=e}}}function Hf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Fn=e}function da(e){if(e!==Fn)return!1;if(!xt)return Hf(e),xt=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!fc(e.type,e.memoizedProps)),n&&(n=Un)){if(wc(e))throw Vf(),Error(r(418));for(;n;)Bf(e,n),n=qs(n.nextSibling)}if(Hf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(n===0){Un=qs(e.nextSibling);break e}n--}else i!=="$"&&i!=="$!"&&i!=="$?"||n++}e=e.nextSibling}Un=null}}else Un=Fn?qs(e.stateNode.nextSibling):null;return!0}function Vf(){for(var e=Un;e;)e=qs(e.nextSibling)}function ri(){Un=Fn=null,xt=!1}function Sc(e){ss===null?ss=[e]:ss.push(e)}var cx=M.ReactCurrentBatchConfig;function qi(e,n,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(r(309));var c=i.stateNode}if(!c)throw Error(r(147,e));var f=c,h=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===h?n.ref:(n=function(w){var j=f.refs;w===null?delete j[h]:j[h]=w},n._stringRef=h,n)}if(typeof e!="string")throw Error(r(284));if(!i._owner)throw Error(r(290,e))}return e}function fa(e,n){throw e=Object.prototype.toString.call(n),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function Gf(e){var n=e._init;return n(e._payload)}function Kf(e){function n(U,O){if(e){var W=U.deletions;W===null?(U.deletions=[O],U.flags|=16):W.push(O)}}function i(U,O){if(!e)return null;for(;O!==null;)n(U,O),O=O.sibling;return null}function c(U,O){for(U=new Map;O!==null;)O.key!==null?U.set(O.key,O):U.set(O.index,O),O=O.sibling;return U}function f(U,O){return U=ir(U,O),U.index=0,U.sibling=null,U}function h(U,O,W){return U.index=W,e?(W=U.alternate,W!==null?(W=W.index,W<O?(U.flags|=2,O):W):(U.flags|=2,O)):(U.flags|=1048576,O)}function w(U){return e&&U.alternate===null&&(U.flags|=2),U}function j(U,O,W,ce){return O===null||O.tag!==6?(O=pu(W,U.mode,ce),O.return=U,O):(O=f(O,W),O.return=U,O)}function L(U,O,W,ce){var je=W.type;return je===G?ne(U,O,W.props.children,ce,W.key):O!==null&&(O.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===oe&&Gf(je)===O.type)?(ce=f(O,W.props),ce.ref=qi(U,O,W),ce.return=U,ce):(ce=Oa(W.type,W.key,W.props,null,U.mode,ce),ce.ref=qi(U,O,W),ce.return=U,ce)}function V(U,O,W,ce){return O===null||O.tag!==4||O.stateNode.containerInfo!==W.containerInfo||O.stateNode.implementation!==W.implementation?(O=hu(W,U.mode,ce),O.return=U,O):(O=f(O,W.children||[]),O.return=U,O)}function ne(U,O,W,ce,je){return O===null||O.tag!==7?(O=Mr(W,U.mode,ce,je),O.return=U,O):(O=f(O,W),O.return=U,O)}function re(U,O,W){if(typeof O=="string"&&O!==""||typeof O=="number")return O=pu(""+O,U.mode,W),O.return=U,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case D:return W=Oa(O.type,O.key,O.props,null,U.mode,W),W.ref=qi(U,null,O),W.return=U,W;case K:return O=hu(O,U.mode,W),O.return=U,O;case oe:var ce=O._init;return re(U,ce(O._payload),W)}if(jt(O)||Q(O))return O=Mr(O,U.mode,W,null),O.return=U,O;fa(U,O)}return null}function ee(U,O,W,ce){var je=O!==null?O.key:null;if(typeof W=="string"&&W!==""||typeof W=="number")return je!==null?null:j(U,O,""+W,ce);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case D:return W.key===je?L(U,O,W,ce):null;case K:return W.key===je?V(U,O,W,ce):null;case oe:return je=W._init,ee(U,O,je(W._payload),ce)}if(jt(W)||Q(W))return je!==null?null:ne(U,O,W,ce,null);fa(U,W)}return null}function ve(U,O,W,ce,je){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return U=U.get(W)||null,j(O,U,""+ce,je);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case D:return U=U.get(ce.key===null?W:ce.key)||null,L(O,U,ce,je);case K:return U=U.get(ce.key===null?W:ce.key)||null,V(O,U,ce,je);case oe:var Ie=ce._init;return ve(U,O,W,Ie(ce._payload),je)}if(jt(ce)||Q(ce))return U=U.get(W)||null,ne(O,U,ce,je,null);fa(O,ce)}return null}function ke(U,O,W,ce){for(var je=null,Ie=null,Me=O,Pe=O=0,Xt=null;Me!==null&&Pe<W.length;Pe++){Me.index>Pe?(Xt=Me,Me=null):Xt=Me.sibling;var Je=ee(U,Me,W[Pe],ce);if(Je===null){Me===null&&(Me=Xt);break}e&&Me&&Je.alternate===null&&n(U,Me),O=h(Je,O,Pe),Ie===null?je=Je:Ie.sibling=Je,Ie=Je,Me=Xt}if(Pe===W.length)return i(U,Me),xt&&Nr(U,Pe),je;if(Me===null){for(;Pe<W.length;Pe++)Me=re(U,W[Pe],ce),Me!==null&&(O=h(Me,O,Pe),Ie===null?je=Me:Ie.sibling=Me,Ie=Me);return xt&&Nr(U,Pe),je}for(Me=c(U,Me);Pe<W.length;Pe++)Xt=ve(Me,U,Pe,W[Pe],ce),Xt!==null&&(e&&Xt.alternate!==null&&Me.delete(Xt.key===null?Pe:Xt.key),O=h(Xt,O,Pe),Ie===null?je=Xt:Ie.sibling=Xt,Ie=Xt);return e&&Me.forEach(function(or){return n(U,or)}),xt&&Nr(U,Pe),je}function Te(U,O,W,ce){var je=Q(W);if(typeof je!="function")throw Error(r(150));if(W=je.call(W),W==null)throw Error(r(151));for(var Ie=je=null,Me=O,Pe=O=0,Xt=null,Je=W.next();Me!==null&&!Je.done;Pe++,Je=W.next()){Me.index>Pe?(Xt=Me,Me=null):Xt=Me.sibling;var or=ee(U,Me,Je.value,ce);if(or===null){Me===null&&(Me=Xt);break}e&&Me&&or.alternate===null&&n(U,Me),O=h(or,O,Pe),Ie===null?je=or:Ie.sibling=or,Ie=or,Me=Xt}if(Je.done)return i(U,Me),xt&&Nr(U,Pe),je;if(Me===null){for(;!Je.done;Pe++,Je=W.next())Je=re(U,Je.value,ce),Je!==null&&(O=h(Je,O,Pe),Ie===null?je=Je:Ie.sibling=Je,Ie=Je);return xt&&Nr(U,Pe),je}for(Me=c(U,Me);!Je.done;Pe++,Je=W.next())Je=ve(Me,U,Pe,Je.value,ce),Je!==null&&(e&&Je.alternate!==null&&Me.delete(Je.key===null?Pe:Je.key),O=h(Je,O,Pe),Ie===null?je=Je:Ie.sibling=Je,Ie=Je);return e&&Me.forEach(function(Bx){return n(U,Bx)}),xt&&Nr(U,Pe),je}function It(U,O,W,ce){if(typeof W=="object"&&W!==null&&W.type===G&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case D:e:{for(var je=W.key,Ie=O;Ie!==null;){if(Ie.key===je){if(je=W.type,je===G){if(Ie.tag===7){i(U,Ie.sibling),O=f(Ie,W.props.children),O.return=U,U=O;break e}}else if(Ie.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===oe&&Gf(je)===Ie.type){i(U,Ie.sibling),O=f(Ie,W.props),O.ref=qi(U,Ie,W),O.return=U,U=O;break e}i(U,Ie);break}else n(U,Ie);Ie=Ie.sibling}W.type===G?(O=Mr(W.props.children,U.mode,ce,W.key),O.return=U,U=O):(ce=Oa(W.type,W.key,W.props,null,U.mode,ce),ce.ref=qi(U,O,W),ce.return=U,U=ce)}return w(U);case K:e:{for(Ie=W.key;O!==null;){if(O.key===Ie)if(O.tag===4&&O.stateNode.containerInfo===W.containerInfo&&O.stateNode.implementation===W.implementation){i(U,O.sibling),O=f(O,W.children||[]),O.return=U,U=O;break e}else{i(U,O);break}else n(U,O);O=O.sibling}O=hu(W,U.mode,ce),O.return=U,U=O}return w(U);case oe:return Ie=W._init,It(U,O,Ie(W._payload),ce)}if(jt(W))return ke(U,O,W,ce);if(Q(W))return Te(U,O,W,ce);fa(U,W)}return typeof W=="string"&&W!==""||typeof W=="number"?(W=""+W,O!==null&&O.tag===6?(i(U,O.sibling),O=f(O,W),O.return=U,U=O):(i(U,O),O=pu(W,U.mode,ce),O.return=U,U=O),w(U)):i(U,O)}return It}var ii=Kf(!0),qf=Kf(!1),pa=Ys(null),ha=null,oi=null,bc=null;function Tc(){bc=oi=ha=null}function Nc(e){var n=pa.current;ht(pa),e._currentValue=n}function jc(e,n,i){for(;e!==null;){var c=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,c!==null&&(c.childLanes|=n)):c!==null&&(c.childLanes&n)!==n&&(c.childLanes|=n),e===i)break;e=e.return}}function ai(e,n){ha=e,bc=oi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(En=!0),e.firstContext=null)}function qn(e){var n=e._currentValue;if(bc!==e)if(e={context:e,memoizedValue:n,next:null},oi===null){if(ha===null)throw Error(r(308));oi=e,ha.dependencies={lanes:0,firstContext:e}}else oi=oi.next=e;return n}var jr=null;function Cc(e){jr===null?jr=[e]:jr.push(e)}function Yf(e,n,i,c){var f=n.interleaved;return f===null?(i.next=i,Cc(n)):(i.next=f.next,f.next=i),n.interleaved=i,Ms(e,c)}function Ms(e,n){e.lanes|=n;var i=e.alternate;for(i!==null&&(i.lanes|=n),i=e,e=e.return;e!==null;)e.childLanes|=n,i=e.alternate,i!==null&&(i.childLanes|=n),i=e,e=e.return;return i.tag===3?i.stateNode:null}var Zs=!1;function Ec(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xf(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ds(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Js(e,n,i){var c=e.updateQueue;if(c===null)return null;if(c=c.shared,(Ye&2)!==0){var f=c.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),c.pending=n,Ms(e,i)}return f=c.interleaved,f===null?(n.next=n,Cc(c)):(n.next=f.next,f.next=n),c.interleaved=n,Ms(e,i)}function ma(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194240)!==0)){var c=n.lanes;c&=e.pendingLanes,i|=c,n.lanes=i,Hs(e,i)}}function Qf(e,n){var i=e.updateQueue,c=e.alternate;if(c!==null&&(c=c.updateQueue,i===c)){var f=null,h=null;if(i=i.firstBaseUpdate,i!==null){do{var w={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};h===null?f=h=w:h=h.next=w,i=i.next}while(i!==null);h===null?f=h=n:h=h.next=n}else f=h=n;i={baseState:c.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:c.shared,effects:c.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}function ga(e,n,i,c){var f=e.updateQueue;Zs=!1;var h=f.firstBaseUpdate,w=f.lastBaseUpdate,j=f.shared.pending;if(j!==null){f.shared.pending=null;var L=j,V=L.next;L.next=null,w===null?h=V:w.next=V,w=L;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,j=ne.lastBaseUpdate,j!==w&&(j===null?ne.firstBaseUpdate=V:j.next=V,ne.lastBaseUpdate=L))}if(h!==null){var re=f.baseState;w=0,ne=V=L=null,j=h;do{var ee=j.lane,ve=j.eventTime;if((c&ee)===ee){ne!==null&&(ne=ne.next={eventTime:ve,lane:0,tag:j.tag,payload:j.payload,callback:j.callback,next:null});e:{var ke=e,Te=j;switch(ee=n,ve=i,Te.tag){case 1:if(ke=Te.payload,typeof ke=="function"){re=ke.call(ve,re,ee);break e}re=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Te.payload,ee=typeof ke=="function"?ke.call(ve,re,ee):ke,ee==null)break e;re=B({},re,ee);break e;case 2:Zs=!0}}j.callback!==null&&j.lane!==0&&(e.flags|=64,ee=f.effects,ee===null?f.effects=[j]:ee.push(j))}else ve={eventTime:ve,lane:ee,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ne===null?(V=ne=ve,L=re):ne=ne.next=ve,w|=ee;if(j=j.next,j===null){if(j=f.shared.pending,j===null)break;ee=j,j=ee.next,ee.next=null,f.lastBaseUpdate=ee,f.shared.pending=null}}while(!0);if(ne===null&&(L=re),f.baseState=L,f.firstBaseUpdate=V,f.lastBaseUpdate=ne,n=f.shared.interleaved,n!==null){f=n;do w|=f.lane,f=f.next;while(f!==n)}else h===null&&(f.shared.lanes=0);_r|=w,e.lanes=w,e.memoizedState=re}}function Zf(e,n,i){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var c=e[n],f=c.callback;if(f!==null){if(c.callback=null,c=i,typeof f!="function")throw Error(r(191,f));f.call(c)}}}var Yi={},ws=Ys(Yi),Xi=Ys(Yi),Qi=Ys(Yi);function Cr(e){if(e===Yi)throw Error(r(174));return e}function _c(e,n){switch(ut(Qi,n),ut(Xi,e),ut(ws,Yi),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:mt(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=mt(n,e)}ht(ws),ut(ws,n)}function li(){ht(ws),ht(Xi),ht(Qi)}function Jf(e){Cr(Qi.current);var n=Cr(ws.current),i=mt(n,e.type);n!==i&&(ut(Xi,e),ut(ws,i))}function Rc(e){Xi.current===e&&(ht(ws),ht(Xi))}var Tt=Ys(0);function va(e){for(var n=e;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Ac=[];function Ic(){for(var e=0;e<Ac.length;e++)Ac[e]._workInProgressVersionPrimary=null;Ac.length=0}var ya=M.ReactCurrentDispatcher,Mc=M.ReactCurrentBatchConfig,Er=0,Nt=null,Ft=null,qt=null,xa=!1,Zi=!1,Ji=0,ux=0;function un(){throw Error(r(321))}function Dc(e,n){if(n===null)return!1;for(var i=0;i<n.length&&i<e.length;i++)if(!ns(e[i],n[i]))return!1;return!0}function Lc(e,n,i,c,f,h){if(Er=h,Nt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,ya.current=e===null||e.memoizedState===null?hx:mx,e=i(c,f),Zi){h=0;do{if(Zi=!1,Ji=0,25<=h)throw Error(r(301));h+=1,qt=Ft=null,n.updateQueue=null,ya.current=gx,e=i(c,f)}while(Zi)}if(ya.current=Sa,n=Ft!==null&&Ft.next!==null,Er=0,qt=Ft=Nt=null,xa=!1,n)throw Error(r(300));return e}function Oc(){var e=Ji!==0;return Ji=0,e}function ks(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?Nt.memoizedState=qt=e:qt=qt.next=e,qt}function Yn(){if(Ft===null){var e=Nt.alternate;e=e!==null?e.memoizedState:null}else e=Ft.next;var n=qt===null?Nt.memoizedState:qt.next;if(n!==null)qt=n,Ft=e;else{if(e===null)throw Error(r(310));Ft=e,e={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},qt===null?Nt.memoizedState=qt=e:qt=qt.next=e}return qt}function eo(e,n){return typeof n=="function"?n(e):n}function Pc(e){var n=Yn(),i=n.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var c=Ft,f=c.baseQueue,h=i.pending;if(h!==null){if(f!==null){var w=f.next;f.next=h.next,h.next=w}c.baseQueue=f=h,i.pending=null}if(f!==null){h=f.next,c=c.baseState;var j=w=null,L=null,V=h;do{var ne=V.lane;if((Er&ne)===ne)L!==null&&(L=L.next={lane:0,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),c=V.hasEagerState?V.eagerState:e(c,V.action);else{var re={lane:ne,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null};L===null?(j=L=re,w=c):L=L.next=re,Nt.lanes|=ne,_r|=ne}V=V.next}while(V!==null&&V!==h);L===null?w=c:L.next=j,ns(c,n.memoizedState)||(En=!0),n.memoizedState=c,n.baseState=w,n.baseQueue=L,i.lastRenderedState=c}if(e=i.interleaved,e!==null){f=e;do h=f.lane,Nt.lanes|=h,_r|=h,f=f.next;while(f!==e)}else f===null&&(i.lanes=0);return[n.memoizedState,i.dispatch]}function $c(e){var n=Yn(),i=n.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var c=i.dispatch,f=i.pending,h=n.memoizedState;if(f!==null){i.pending=null;var w=f=f.next;do h=e(h,w.action),w=w.next;while(w!==f);ns(h,n.memoizedState)||(En=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),i.lastRenderedState=h}return[h,c]}function ep(){}function tp(e,n){var i=Nt,c=Yn(),f=n(),h=!ns(c.memoizedState,f);if(h&&(c.memoizedState=f,En=!0),c=c.queue,zc(rp.bind(null,i,c,e),[e]),c.getSnapshot!==n||h||qt!==null&&qt.memoizedState.tag&1){if(i.flags|=2048,to(9,sp.bind(null,i,c,f,n),void 0,null),Yt===null)throw Error(r(349));(Er&30)!==0||np(i,n,f)}return f}function np(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=Nt.updateQueue,n===null?(n={lastEffect:null,stores:null},Nt.updateQueue=n,n.stores=[e]):(i=n.stores,i===null?n.stores=[e]:i.push(e))}function sp(e,n,i,c){n.value=i,n.getSnapshot=c,ip(n)&&op(e)}function rp(e,n,i){return i(function(){ip(n)&&op(e)})}function ip(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!ns(e,i)}catch{return!0}}function op(e){var n=Ms(e,1);n!==null&&as(n,e,1,-1)}function ap(e){var n=ks();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:eo,lastRenderedState:e},n.queue=e,e=e.dispatch=px.bind(null,Nt,e),[n.memoizedState,e]}function to(e,n,i,c){return e={tag:e,create:n,destroy:i,deps:c,next:null},n=Nt.updateQueue,n===null?(n={lastEffect:null,stores:null},Nt.updateQueue=n,n.lastEffect=e.next=e):(i=n.lastEffect,i===null?n.lastEffect=e.next=e:(c=i.next,i.next=e,e.next=c,n.lastEffect=e)),e}function lp(){return Yn().memoizedState}function wa(e,n,i,c){var f=ks();Nt.flags|=e,f.memoizedState=to(1|n,i,void 0,c===void 0?null:c)}function ka(e,n,i,c){var f=Yn();c=c===void 0?null:c;var h=void 0;if(Ft!==null){var w=Ft.memoizedState;if(h=w.destroy,c!==null&&Dc(c,w.deps)){f.memoizedState=to(n,i,h,c);return}}Nt.flags|=e,f.memoizedState=to(1|n,i,h,c)}function cp(e,n){return wa(8390656,8,e,n)}function zc(e,n){return ka(2048,8,e,n)}function up(e,n){return ka(4,2,e,n)}function dp(e,n){return ka(4,4,e,n)}function fp(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function pp(e,n,i){return i=i!=null?i.concat([e]):null,ka(4,4,fp.bind(null,n,e),i)}function Fc(){}function hp(e,n){var i=Yn();n=n===void 0?null:n;var c=i.memoizedState;return c!==null&&n!==null&&Dc(n,c[1])?c[0]:(i.memoizedState=[e,n],e)}function mp(e,n){var i=Yn();n=n===void 0?null:n;var c=i.memoizedState;return c!==null&&n!==null&&Dc(n,c[1])?c[0]:(e=e(),i.memoizedState=[e,n],e)}function gp(e,n,i){return(Er&21)===0?(e.baseState&&(e.baseState=!1,En=!0),e.memoizedState=i):(ns(i,n)||(i=Ai(),Nt.lanes|=i,_r|=i,e.baseState=!0),n)}function dx(e,n){var i=Ke;Ke=i!==0&&4>i?i:4,e(!0);var c=Mc.transition;Mc.transition={};try{e(!1),n()}finally{Ke=i,Mc.transition=c}}function vp(){return Yn().memoizedState}function fx(e,n,i){var c=sr(e);if(i={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null},yp(e))xp(n,i);else if(i=Yf(e,n,i,c),i!==null){var f=Sn();as(i,e,c,f),wp(i,n,c)}}function px(e,n,i){var c=sr(e),f={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null};if(yp(e))xp(n,f);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var w=n.lastRenderedState,j=h(w,i);if(f.hasEagerState=!0,f.eagerState=j,ns(j,w)){var L=n.interleaved;L===null?(f.next=f,Cc(n)):(f.next=L.next,L.next=f),n.interleaved=f;return}}catch{}finally{}i=Yf(e,n,f,c),i!==null&&(f=Sn(),as(i,e,c,f),wp(i,n,c))}}function yp(e){var n=e.alternate;return e===Nt||n!==null&&n===Nt}function xp(e,n){Zi=xa=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function wp(e,n,i){if((i&4194240)!==0){var c=n.lanes;c&=e.pendingLanes,i|=c,n.lanes=i,Hs(e,i)}}var Sa={readContext:qn,useCallback:un,useContext:un,useEffect:un,useImperativeHandle:un,useInsertionEffect:un,useLayoutEffect:un,useMemo:un,useReducer:un,useRef:un,useState:un,useDebugValue:un,useDeferredValue:un,useTransition:un,useMutableSource:un,useSyncExternalStore:un,useId:un,unstable_isNewReconciler:!1},hx={readContext:qn,useCallback:function(e,n){return ks().memoizedState=[e,n===void 0?null:n],e},useContext:qn,useEffect:cp,useImperativeHandle:function(e,n,i){return i=i!=null?i.concat([e]):null,wa(4194308,4,fp.bind(null,n,e),i)},useLayoutEffect:function(e,n){return wa(4194308,4,e,n)},useInsertionEffect:function(e,n){return wa(4,2,e,n)},useMemo:function(e,n){var i=ks();return n=n===void 0?null:n,e=e(),i.memoizedState=[e,n],e},useReducer:function(e,n,i){var c=ks();return n=i!==void 0?i(n):n,c.memoizedState=c.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},c.queue=e,e=e.dispatch=fx.bind(null,Nt,e),[c.memoizedState,e]},useRef:function(e){var n=ks();return e={current:e},n.memoizedState=e},useState:ap,useDebugValue:Fc,useDeferredValue:function(e){return ks().memoizedState=e},useTransition:function(){var e=ap(!1),n=e[0];return e=dx.bind(null,e[1]),ks().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,i){var c=Nt,f=ks();if(xt){if(i===void 0)throw Error(r(407));i=i()}else{if(i=n(),Yt===null)throw Error(r(349));(Er&30)!==0||np(c,n,i)}f.memoizedState=i;var h={value:i,getSnapshot:n};return f.queue=h,cp(rp.bind(null,c,h,e),[e]),c.flags|=2048,to(9,sp.bind(null,c,h,i,n),void 0,null),i},useId:function(){var e=ks(),n=Yt.identifierPrefix;if(xt){var i=Is,c=As;i=(c&~(1<<32-xn(c)-1)).toString(32)+i,n=":"+n+"R"+i,i=Ji++,0<i&&(n+="H"+i.toString(32)),n+=":"}else i=ux++,n=":"+n+"r"+i.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},mx={readContext:qn,useCallback:hp,useContext:qn,useEffect:zc,useImperativeHandle:pp,useInsertionEffect:up,useLayoutEffect:dp,useMemo:mp,useReducer:Pc,useRef:lp,useState:function(){return Pc(eo)},useDebugValue:Fc,useDeferredValue:function(e){var n=Yn();return gp(n,Ft.memoizedState,e)},useTransition:function(){var e=Pc(eo)[0],n=Yn().memoizedState;return[e,n]},useMutableSource:ep,useSyncExternalStore:tp,useId:vp,unstable_isNewReconciler:!1},gx={readContext:qn,useCallback:hp,useContext:qn,useEffect:zc,useImperativeHandle:pp,useInsertionEffect:up,useLayoutEffect:dp,useMemo:mp,useReducer:$c,useRef:lp,useState:function(){return $c(eo)},useDebugValue:Fc,useDeferredValue:function(e){var n=Yn();return Ft===null?n.memoizedState=e:gp(n,Ft.memoizedState,e)},useTransition:function(){var e=$c(eo)[0],n=Yn().memoizedState;return[e,n]},useMutableSource:ep,useSyncExternalStore:tp,useId:vp,unstable_isNewReconciler:!1};function rs(e,n){if(e&&e.defaultProps){n=B({},n),e=e.defaultProps;for(var i in e)n[i]===void 0&&(n[i]=e[i]);return n}return n}function Uc(e,n,i,c){n=e.memoizedState,i=i(c,n),i=i==null?n:B({},n,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var ba={isMounted:function(e){return(e=e._reactInternals)?Be(e)===e:!1},enqueueSetState:function(e,n,i){e=e._reactInternals;var c=Sn(),f=sr(e),h=Ds(c,f);h.payload=n,i!=null&&(h.callback=i),n=Js(e,h,f),n!==null&&(as(n,e,f,c),ma(n,e,f))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var c=Sn(),f=sr(e),h=Ds(c,f);h.tag=1,h.payload=n,i!=null&&(h.callback=i),n=Js(e,h,f),n!==null&&(as(n,e,f,c),ma(n,e,f))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=Sn(),c=sr(e),f=Ds(i,c);f.tag=2,n!=null&&(f.callback=n),n=Js(e,f,c),n!==null&&(as(n,e,c,i),ma(n,e,c))}};function kp(e,n,i,c,f,h,w){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(c,h,w):n.prototype&&n.prototype.isPureReactComponent?!Ui(i,c)||!Ui(f,h):!0}function Sp(e,n,i){var c=!1,f=Xs,h=n.contextType;return typeof h=="object"&&h!==null?h=qn(h):(f=Cn(n)?br:cn.current,c=n.contextTypes,h=(c=c!=null)?ti(e,f):Xs),n=new n(i,h),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=ba,e.stateNode=n,n._reactInternals=e,c&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=f,e.__reactInternalMemoizedMaskedChildContext=h),n}function bp(e,n,i,c){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,c),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,c),n.state!==e&&ba.enqueueReplaceState(n,n.state,null)}function Bc(e,n,i,c){var f=e.stateNode;f.props=i,f.state=e.memoizedState,f.refs={},Ec(e);var h=n.contextType;typeof h=="object"&&h!==null?f.context=qn(h):(h=Cn(n)?br:cn.current,f.context=ti(e,h)),f.state=e.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(Uc(e,n,h,i),f.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(n=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),n!==f.state&&ba.enqueueReplaceState(f,f.state,null),ga(e,i,f,c),f.state=e.memoizedState),typeof f.componentDidMount=="function"&&(e.flags|=4194308)}function ci(e,n){try{var i="",c=n;do i+=X(c),c=c.return;while(c);var f=i}catch(h){f=`
37
+ `),w=f.length-1,C=h.length-1;1<=w&&0<=C&&f[w]!==h[C];)C--;for(;1<=w&&0<=C;w--,C--)if(f[w]!==h[C]){if(w!==1||C!==1)do if(w--,C--,0>C||f[w]!==h[C]){var L=`
38
+ `+f[w].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=w&&0<=C);break}}}finally{le=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?P(e):""}function X(e){switch(e.tag){case 5:return P(e.type);case 16:return P("Lazy");case 13:return P("Suspense");case 19:return P("SuspenseList");case 0:case 2:case 15:return e=ge(e.type,!1),e;case 11:return e=ge(e.type.render,!1),e;case 1:return e=ge(e.type,!0),e;default:return""}}function pe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case G:return"Portal";case te:return"Profiler";case $:return"StrictMode";case K:return"Suspense";case be:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case de:return(e.displayName||"Context")+".Consumer";case me:return(e._context.displayName||"Context")+".Provider";case je:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return n=e.displayName||null,n!==null?n:pe(e.type)||"Memo";case oe:n=e._payload,e=e._init;try{return pe(e(n))}catch{}}return null}function Te(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(n);case 8:return n===$?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function se(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function he(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Se(e){var n=he(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),c=""+e[n];if(!e.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var f=i.get,h=i.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(w){c=""+w,h.call(this,w)}}),Object.defineProperty(e,n,{enumerable:i.enumerable}),{getValue:function(){return c},setValue:function(w){c=""+w},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function He(e){e._valueTracker||(e._valueTracker=Se(e))}function Re(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),c="";return e&&(c=he(e)?e.checked?"true":"false":e.value),e=c,e!==i?(n.setValue(e),!0):!1}function ct(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function $e(e,n){var i=n.checked;return q({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function en(e,n){var i=n.defaultValue==null?"":n.defaultValue,c=n.checked!=null?n.checked:n.defaultChecked;i=se(n.value!=null?n.value:i),e._wrapperState={initialChecked:c,initialValue:i,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Fe(e,n){n=n.checked,n!=null&&W(e,"checked",n,!1)}function Ht(e,n){Fe(e,n);var i=se(n.value),c=n.type;if(i!=null)c==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(c==="submit"||c==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?wt(e,n.type,i):n.hasOwnProperty("defaultValue")&&wt(e,n.type,se(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function tn(e,n,i){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var c=n.type;if(!(c!=="submit"&&c!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,i||n===e.value||(e.value=n),e.defaultValue=n}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function wt(e,n,i){(n!=="number"||ct(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var jt=Array.isArray;function zt(e,n,i,c){if(e=e.options,n){n={};for(var f=0;f<i.length;f++)n["$"+i[f]]=!0;for(i=0;i<e.length;i++)f=n.hasOwnProperty("$"+e[i].value),e[i].selected!==f&&(e[i].selected=f),f&&c&&(e[i].defaultSelected=!0)}else{for(i=""+se(i),n=null,f=0;f<e.length;f++){if(e[f].value===i){e[f].selected=!0,c&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function Dt(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(r(91));return q({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Y(e,n){var i=n.value;if(i==null){if(i=n.children,n=n.defaultValue,i!=null){if(n!=null)throw Error(r(92));if(jt(i)){if(1<i.length)throw Error(r(93));i=i[0]}n=i}n==null&&(n=""),i=n}e._wrapperState={initialValue:se(i)}}function ve(e,n){var i=se(n.value),c=se(n.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),n.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),c!=null&&(e.defaultValue=""+c)}function Ue(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function nt(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function mt(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?nt(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var gt,Ct=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,i,c,f){MSApp.execUnsafeLocalFunction(function(){return e(n,i,c,f)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(gt=gt||document.createElement("div"),gt.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=gt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function an(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}var dt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Mn=["Webkit","ms","Moz","O"];Object.keys(dt).forEach(function(e){Mn.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),dt[n]=dt[e]})});function Dn(e,n,i){return n==null||typeof n=="boolean"||n===""?"":i||typeof n!="number"||n===0||dt.hasOwnProperty(e)&&dt[e]?(""+n).trim():n+"px"}function hs(e,n){e=e.style;for(var i in n)if(n.hasOwnProperty(i)){var c=i.indexOf("--")===0,f=Dn(i,n[i],c);i==="float"&&(i="cssFloat"),c?e.setProperty(i,f):e[i]=f}}var ms=q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ts(e,n){if(n){if(ms[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(r(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(r(61))}if(n.style!=null&&typeof n.style!="object")throw Error(r(62))}}function Ln(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";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 gn=null;function ln(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vt=null,vn=null,Qe=null;function Et(e){if(e=Ki(e)){if(typeof Vt!="function")throw Error(r(280));var n=e.stateNode;n&&(n=ia(n),Vt(e.stateNode,e.type,n))}}function ft(e){vn?Qe?Qe.push(e):Qe=[e]:vn=e}function Gt(){if(vn){var e=vn,n=Qe;if(Qe=vn=null,Et(e),n)for(e=0;e<n.length;e++)Et(n[e])}}function vt(e,n){return e(n)}function yt(){}var at=!1;function Kt(e,n,i){if(at)return e(n,i);at=!0;try{return vt(e,n,i)}finally{at=!1,(vn!==null||Qe!==null)&&(yt(),Gt())}}function rt(e,n){var i=e.stateNode;if(i===null)return null;var c=ia(i);if(c===null)return null;i=c[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(e=e.type,c=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!c;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(r(231,n,typeof i));return i}var Lt=!1;if(p)try{var R={};Object.defineProperty(R,"passive",{get:function(){Lt=!0}}),window.addEventListener("test",R,R),window.removeEventListener("test",R,R)}catch{Lt=!1}function fe(e,n,i,c,f,h,w,C,L){var H=Array.prototype.slice.call(arguments,3);try{n.apply(i,H)}catch(ne){this.onError(ne)}}var ie=!1,we=null,Le=!1,Ke=null,Oe={onError:function(e){ie=!0,we=e}};function Ft(e,n,i,c,f,h,w,C,L){ie=!1,we=null,fe.apply(Oe,arguments)}function On(e,n,i,c,f,h,w,C,L){if(Ft.apply(this,arguments),ie){if(ie){var H=we;ie=!1,we=null}else throw Error(r(198));Le||(Le=!0,Ke=H)}}function Be(e){var n=e,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i:null}function yn(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function Cs(e){if(Be(e)!==e)throw Error(r(188))}function Us(e){var n=e.alternate;if(!n){if(n=Be(e),n===null)throw Error(r(188));return n!==e?null:e}for(var i=e,c=n;;){var f=i.return;if(f===null)break;var h=f.alternate;if(h===null){if(c=f.return,c!==null){i=c;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===i)return Cs(f),e;if(h===c)return Cs(f),n;h=h.sibling}throw Error(r(188))}if(i.return!==c.return)i=f,c=h;else{for(var w=!1,C=f.child;C;){if(C===i){w=!0,i=f,c=h;break}if(C===c){w=!0,c=f,i=h;break}C=C.sibling}if(!w){for(C=h.child;C;){if(C===i){w=!0,i=h,c=f;break}if(C===c){w=!0,c=h,i=f;break}C=C.sibling}if(!w)throw Error(r(189))}}if(i.alternate!==c)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?e:n}function Pn(e){return e=Us(e),e!==null?gs(e):null}function gs(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=gs(e);if(n!==null)return n;e=e.sibling}return null}var Ze=s.unstable_scheduleCallback,_t=s.unstable_cancelCallback,vs=s.unstable_shouldYield,Kl=s.unstable_requestPaint,kt=s.unstable_now,ys=s.unstable_getCurrentPriorityLevel,Bs=s.unstable_ImmediatePriority,xs=s.unstable_UserBlockingPriority,Br=s.unstable_NormalPriority,gr=s.unstable_LowPriority,Uo=s.unstable_IdlePriority,vr=null,$n=null;function Wr(e){if($n&&typeof $n.onCommitFiberRoot=="function")try{$n.onCommitFiberRoot(vr,e,void 0,(e.current.flags&128)===128)}catch{}}var xn=Math.clz32?Math.clz32:yr,Hr=Math.log,Ws=Math.LN2;function yr(e){return e>>>=0,e===0?32:31-(Hr(e)/Ws|0)|0}var wn=64,Vr=4194304;function xr(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function wr(e,n){var i=e.pendingLanes;if(i===0)return 0;var c=0,f=e.suspendedLanes,h=e.pingedLanes,w=i&268435455;if(w!==0){var C=w&~f;C!==0?c=xr(C):(h&=w,h!==0&&(c=xr(h)))}else w=i&~f,w!==0?c=xr(w):h!==0&&(c=xr(h));if(c===0)return 0;if(n!==0&&n!==c&&(n&f)===0&&(f=c&-c,h=n&-n,f>=h||f===16&&(h&4194240)!==0))return n;if((c&4)!==0&&(c|=i&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=c;0<n;)i=31-xn(n),f=1<<i,c|=e[i],n&=~f;return c}function Bo(e,n){switch(e){case 1:case 2:case 4:return n+250;case 8:case 16:case 32:case 64: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 n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Wo(e,n){for(var i=e.suspendedLanes,c=e.pingedLanes,f=e.expirationTimes,h=e.pendingLanes;0<h;){var w=31-xn(h),C=1<<w,L=f[w];L===-1?((C&i)===0||(C&c)!==0)&&(f[w]=Bo(C,n)):L<=n&&(e.expiredLanes|=C),h&=~C}}function Ri(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ai(){var e=wn;return wn<<=1,(wn&4194240)===0&&(wn=64),e}function Ii(e){for(var n=[],i=0;31>i;i++)n.push(e);return n}function kr(e,n,i){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-xn(n),e[n]=i}function Ho(e,n){var i=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var c=e.eventTimes;for(e=e.expirationTimes;0<i;){var f=31-xn(i),h=1<<f;n[f]=0,c[f]=-1,e[f]=-1,i&=~h}}function Hs(e,n){var i=e.entangledLanes|=n;for(e=e.entanglements;i;){var c=31-xn(i),f=1<<c;f&n|e[c]&n&&(e[c]|=n),i&=~f}}var qe=0;function ce(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var b,F,J,Ce,Ae,ze=!1,Ye=[],Je=null,St=null,bt=null,Es=new Map,At=new Map,Vs=[],my="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 submit".split(" ");function Zd(e,n){switch(e){case"focusin":case"focusout":Je=null;break;case"dragenter":case"dragleave":St=null;break;case"mouseover":case"mouseout":bt=null;break;case"pointerover":case"pointerout":Es.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":At.delete(n.pointerId)}}function Mi(e,n,i,c,f,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:i,eventSystemFlags:c,nativeEvent:h,targetContainers:[f]},n!==null&&(n=Ki(n),n!==null&&F(n)),e):(e.eventSystemFlags|=c,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function gy(e,n,i,c,f){switch(n){case"focusin":return Je=Mi(Je,e,n,i,c,f),!0;case"dragenter":return St=Mi(St,e,n,i,c,f),!0;case"mouseover":return bt=Mi(bt,e,n,i,c,f),!0;case"pointerover":var h=f.pointerId;return Es.set(h,Mi(Es.get(h)||null,e,n,i,c,f)),!0;case"gotpointercapture":return h=f.pointerId,At.set(h,Mi(At.get(h)||null,e,n,i,c,f)),!0}return!1}function Jd(e){var n=Sr(e.target);if(n!==null){var i=Be(n);if(i!==null){if(n=i.tag,n===13){if(n=yn(i),n!==null){e.blockedOn=n,Ae(e.priority,function(){J(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Vo(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=Yl(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var c=new i.constructor(i.type,i);gn=c,i.target.dispatchEvent(c),gn=null}else return n=Ki(i),n!==null&&F(n),e.blockedOn=i,!1;n.shift()}return!0}function ef(e,n,i){Vo(e)&&i.delete(n)}function vy(){ze=!1,Je!==null&&Vo(Je)&&(Je=null),St!==null&&Vo(St)&&(St=null),bt!==null&&Vo(bt)&&(bt=null),Es.forEach(ef),At.forEach(ef)}function Di(e,n){e.blockedOn===n&&(e.blockedOn=null,ze||(ze=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,vy)))}function Li(e){function n(f){return Di(f,e)}if(0<Ye.length){Di(Ye[0],e);for(var i=1;i<Ye.length;i++){var c=Ye[i];c.blockedOn===e&&(c.blockedOn=null)}}for(Je!==null&&Di(Je,e),St!==null&&Di(St,e),bt!==null&&Di(bt,e),Es.forEach(n),At.forEach(n),i=0;i<Vs.length;i++)c=Vs[i],c.blockedOn===e&&(c.blockedOn=null);for(;0<Vs.length&&(i=Vs[0],i.blockedOn===null);)Jd(i),i.blockedOn===null&&Vs.shift()}var Gr=A.ReactCurrentBatchConfig,Go=!0;function yy(e,n,i,c){var f=qe,h=Gr.transition;Gr.transition=null;try{qe=1,ql(e,n,i,c)}finally{qe=f,Gr.transition=h}}function xy(e,n,i,c){var f=qe,h=Gr.transition;Gr.transition=null;try{qe=4,ql(e,n,i,c)}finally{qe=f,Gr.transition=h}}function ql(e,n,i,c){if(Go){var f=Yl(e,n,i,c);if(f===null)fc(e,n,c,Ko,i),Zd(e,c);else if(gy(f,e,n,i,c))c.stopPropagation();else if(Zd(e,c),n&4&&-1<my.indexOf(e)){for(;f!==null;){var h=Ki(f);if(h!==null&&b(h),h=Yl(e,n,i,c),h===null&&fc(e,n,c,Ko,i),h===f)break;f=h}f!==null&&c.stopPropagation()}else fc(e,n,c,null,i)}}var Ko=null;function Yl(e,n,i,c){if(Ko=null,e=ln(c),e=Sr(e),e!==null)if(n=Be(e),n===null)e=null;else if(i=n.tag,i===13){if(e=yn(n),e!==null)return e;e=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return Ko=e,null}function tf(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ys()){case Bs:return 1;case xs:return 4;case Br:case gr:return 16;case Uo:return 536870912;default:return 16}default:return 16}}var Gs=null,Xl=null,qo=null;function nf(){if(qo)return qo;var e,n=Xl,i=n.length,c,f="value"in Gs?Gs.value:Gs.textContent,h=f.length;for(e=0;e<i&&n[e]===f[e];e++);var w=i-e;for(c=1;c<=w&&n[i-c]===f[h-c];c++);return qo=f.slice(e,1<c?1-c:void 0)}function Yo(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Xo(){return!0}function sf(){return!1}function zn(e){function n(i,c,f,h,w){this._reactName=i,this._targetInst=f,this.type=c,this.nativeEvent=h,this.target=w,this.currentTarget=null;for(var C in e)e.hasOwnProperty(C)&&(i=e[C],this[C]=i?i(h):h[C]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Xo:sf,this.isPropagationStopped=sf,this}return q(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Xo)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Xo)},persist:function(){},isPersistent:Xo}),n}var Kr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ql=zn(Kr),Oi=q({},Kr,{view:0,detail:0}),wy=zn(Oi),Zl,Jl,Pi,Qo=q({},Oi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tc,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!==Pi&&(Pi&&e.type==="mousemove"?(Zl=e.screenX-Pi.screenX,Jl=e.screenY-Pi.screenY):Jl=Zl=0,Pi=e),Zl)},movementY:function(e){return"movementY"in e?e.movementY:Jl}}),rf=zn(Qo),ky=q({},Qo,{dataTransfer:0}),Sy=zn(ky),by=q({},Oi,{relatedTarget:0}),ec=zn(by),Ty=q({},Kr,{animationName:0,elapsedTime:0,pseudoElement:0}),Ny=zn(Ty),jy=q({},Kr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Cy=zn(jy),Ey=q({},Kr,{data:0}),of=zn(Ey),_y={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ry={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"},Ay={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Iy(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Ay[e])?!!n[e]:!1}function tc(){return Iy}var My=q({},Oi,{key:function(e){if(e.key){var n=_y[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Yo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ry[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tc,charCode:function(e){return e.type==="keypress"?Yo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Dy=zn(My),Ly=q({},Qo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),af=zn(Ly),Oy=q({},Oi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tc}),Py=zn(Oy),$y=q({},Kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),zy=zn($y),Fy=q({},Qo,{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}),Uy=zn(Fy),By=[9,13,27,32],nc=p&&"CompositionEvent"in window,$i=null;p&&"documentMode"in document&&($i=document.documentMode);var Wy=p&&"TextEvent"in window&&!$i,lf=p&&(!nc||$i&&8<$i&&11>=$i),cf=" ",uf=!1;function df(e,n){switch(e){case"keyup":return By.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ff(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var qr=!1;function Hy(e,n){switch(e){case"compositionend":return ff(n);case"keypress":return n.which!==32?null:(uf=!0,cf);case"textInput":return e=n.data,e===cf&&uf?null:e;default:return null}}function Vy(e,n){if(qr)return e==="compositionend"||!nc&&df(e,n)?(e=nf(),qo=Xl=Gs=null,qr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return lf&&n.locale!=="ko"?null:n.data;default:return null}}var Gy={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function pf(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Gy[e.type]:n==="textarea"}function hf(e,n,i,c){ft(c),n=na(n,"onChange"),0<n.length&&(i=new Ql("onChange","change",null,i,c),e.push({event:i,listeners:n}))}var zi=null,Fi=null;function Ky(e){If(e,0)}function Zo(e){var n=Jr(e);if(Re(n))return e}function qy(e,n){if(e==="change")return n}var mf=!1;if(p){var sc;if(p){var rc="oninput"in document;if(!rc){var gf=document.createElement("div");gf.setAttribute("oninput","return;"),rc=typeof gf.oninput=="function"}sc=rc}else sc=!1;mf=sc&&(!document.documentMode||9<document.documentMode)}function vf(){zi&&(zi.detachEvent("onpropertychange",yf),Fi=zi=null)}function yf(e){if(e.propertyName==="value"&&Zo(Fi)){var n=[];hf(n,Fi,e,ln(e)),Kt(Ky,n)}}function Yy(e,n,i){e==="focusin"?(vf(),zi=n,Fi=i,zi.attachEvent("onpropertychange",yf)):e==="focusout"&&vf()}function Xy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zo(Fi)}function Qy(e,n){if(e==="click")return Zo(n)}function Zy(e,n){if(e==="input"||e==="change")return Zo(n)}function Jy(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var ns=typeof Object.is=="function"?Object.is:Jy;function Ui(e,n){if(ns(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var i=Object.keys(e),c=Object.keys(n);if(i.length!==c.length)return!1;for(c=0;c<i.length;c++){var f=i[c];if(!g.call(n,f)||!ns(e[f],n[f]))return!1}return!0}function xf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wf(e,n){var i=xf(e);e=0;for(var c;i;){if(i.nodeType===3){if(c=e+i.textContent.length,e<=n&&c>=n)return{node:i,offset:n-e};e=c}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=xf(i)}}function kf(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?kf(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Sf(){for(var e=window,n=ct();n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=ct(e.document)}return n}function ic(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function ex(e){var n=Sf(),i=e.focusedElem,c=e.selectionRange;if(n!==i&&i&&i.ownerDocument&&kf(i.ownerDocument.documentElement,i)){if(c!==null&&ic(i)){if(n=c.start,e=c.end,e===void 0&&(e=n),"selectionStart"in i)i.selectionStart=n,i.selectionEnd=Math.min(e,i.value.length);else if(e=(n=i.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var f=i.textContent.length,h=Math.min(c.start,f);c=c.end===void 0?h:Math.min(c.end,f),!e.extend&&h>c&&(f=c,c=h,h=f),f=wf(i,h);var w=wf(i,c);f&&w&&(e.rangeCount!==1||e.anchorNode!==f.node||e.anchorOffset!==f.offset||e.focusNode!==w.node||e.focusOffset!==w.offset)&&(n=n.createRange(),n.setStart(f.node,f.offset),e.removeAllRanges(),h>c?(e.addRange(n),e.extend(w.node,w.offset)):(n.setEnd(w.node,w.offset),e.addRange(n)))}}for(n=[],e=i;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<n.length;i++)e=n[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var tx=p&&"documentMode"in document&&11>=document.documentMode,Yr=null,oc=null,Bi=null,ac=!1;function bf(e,n,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;ac||Yr==null||Yr!==ct(c)||(c=Yr,"selectionStart"in c&&ic(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Bi&&Ui(Bi,c)||(Bi=c,c=na(oc,"onSelect"),0<c.length&&(n=new Ql("onSelect","select",null,n,i),e.push({event:n,listeners:c}),n.target=Yr)))}function Jo(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var Xr={animationend:Jo("Animation","AnimationEnd"),animationiteration:Jo("Animation","AnimationIteration"),animationstart:Jo("Animation","AnimationStart"),transitionend:Jo("Transition","TransitionEnd")},lc={},Tf={};p&&(Tf=document.createElement("div").style,"AnimationEvent"in window||(delete Xr.animationend.animation,delete Xr.animationiteration.animation,delete Xr.animationstart.animation),"TransitionEvent"in window||delete Xr.transitionend.transition);function ea(e){if(lc[e])return lc[e];if(!Xr[e])return e;var n=Xr[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in Tf)return lc[e]=n[i];return e}var Nf=ea("animationend"),jf=ea("animationiteration"),Cf=ea("animationstart"),Ef=ea("transitionend"),_f=new Map,Rf="abort auxClick 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(" ");function Ks(e,n){_f.set(e,n),u(n,[e])}for(var cc=0;cc<Rf.length;cc++){var uc=Rf[cc],nx=uc.toLowerCase(),sx=uc[0].toUpperCase()+uc.slice(1);Ks(nx,"on"+sx)}Ks(Nf,"onAnimationEnd"),Ks(jf,"onAnimationIteration"),Ks(Cf,"onAnimationStart"),Ks("dblclick","onDoubleClick"),Ks("focusin","onFocus"),Ks("focusout","onBlur"),Ks(Ef,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wi="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(" "),rx=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wi));function Af(e,n,i){var c=e.type||"unknown-event";e.currentTarget=i,On(c,n,void 0,e),e.currentTarget=null}function If(e,n){n=(n&4)!==0;for(var i=0;i<e.length;i++){var c=e[i],f=c.event;c=c.listeners;e:{var h=void 0;if(n)for(var w=c.length-1;0<=w;w--){var C=c[w],L=C.instance,H=C.currentTarget;if(C=C.listener,L!==h&&f.isPropagationStopped())break e;Af(f,C,H),h=L}else for(w=0;w<c.length;w++){if(C=c[w],L=C.instance,H=C.currentTarget,C=C.listener,L!==h&&f.isPropagationStopped())break e;Af(f,C,H),h=L}}}if(Le)throw e=Ke,Le=!1,Ke=null,e}function pt(e,n){var i=n[yc];i===void 0&&(i=n[yc]=new Set);var c=e+"__bubble";i.has(c)||(Mf(n,e,2,!1),i.add(c))}function dc(e,n,i){var c=0;n&&(c|=4),Mf(i,e,c,n)}var ta="_reactListening"+Math.random().toString(36).slice(2);function Hi(e){if(!e[ta]){e[ta]=!0,o.forEach(function(i){i!=="selectionchange"&&(rx.has(i)||dc(i,!1,e),dc(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[ta]||(n[ta]=!0,dc("selectionchange",!1,n))}}function Mf(e,n,i,c){switch(tf(n)){case 1:var f=yy;break;case 4:f=xy;break;default:f=ql}i=f.bind(null,n,i,e),f=void 0,!Lt||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),c?f!==void 0?e.addEventListener(n,i,{capture:!0,passive:f}):e.addEventListener(n,i,!0):f!==void 0?e.addEventListener(n,i,{passive:f}):e.addEventListener(n,i,!1)}function fc(e,n,i,c,f){var h=c;if((n&1)===0&&(n&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var C=c.stateNode.containerInfo;if(C===f||C.nodeType===8&&C.parentNode===f)break;if(w===4)for(w=c.return;w!==null;){var L=w.tag;if((L===3||L===4)&&(L=w.stateNode.containerInfo,L===f||L.nodeType===8&&L.parentNode===f))return;w=w.return}for(;C!==null;){if(w=Sr(C),w===null)return;if(L=w.tag,L===5||L===6){c=h=w;continue e}C=C.parentNode}}c=c.return}Kt(function(){var H=h,ne=ln(i),re=[];e:{var ee=_f.get(e);if(ee!==void 0){var xe=Ql,Ne=e;switch(e){case"keypress":if(Yo(i)===0)break e;case"keydown":case"keyup":xe=Dy;break;case"focusin":Ne="focus",xe=ec;break;case"focusout":Ne="blur",xe=ec;break;case"beforeblur":case"afterblur":xe=ec;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":xe=rf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":xe=Sy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":xe=Py;break;case Nf:case jf:case Cf:xe=Ny;break;case Ef:xe=zy;break;case"scroll":xe=wy;break;case"wheel":xe=Uy;break;case"copy":case"cut":case"paste":xe=Cy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":xe=af}var Ee=(n&4)!==0,It=!Ee&&e==="scroll",U=Ee?ee!==null?ee+"Capture":null:ee;Ee=[];for(var O=H,B;O!==null;){B=O;var ue=B.stateNode;if(B.tag===5&&ue!==null&&(B=ue,U!==null&&(ue=rt(O,U),ue!=null&&Ee.push(Vi(O,ue,B)))),It)break;O=O.return}0<Ee.length&&(ee=new xe(ee,Ne,null,i,ne),re.push({event:ee,listeners:Ee}))}}if((n&7)===0){e:{if(ee=e==="mouseover"||e==="pointerover",xe=e==="mouseout"||e==="pointerout",ee&&i!==gn&&(Ne=i.relatedTarget||i.fromElement)&&(Sr(Ne)||Ne[_s]))break e;if((xe||ee)&&(ee=ne.window===ne?ne:(ee=ne.ownerDocument)?ee.defaultView||ee.parentWindow:window,xe?(Ne=i.relatedTarget||i.toElement,xe=H,Ne=Ne?Sr(Ne):null,Ne!==null&&(It=Be(Ne),Ne!==It||Ne.tag!==5&&Ne.tag!==6)&&(Ne=null)):(xe=null,Ne=H),xe!==Ne)){if(Ee=rf,ue="onMouseLeave",U="onMouseEnter",O="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=af,ue="onPointerLeave",U="onPointerEnter",O="pointer"),It=xe==null?ee:Jr(xe),B=Ne==null?ee:Jr(Ne),ee=new Ee(ue,O+"leave",xe,i,ne),ee.target=It,ee.relatedTarget=B,ue=null,Sr(ne)===H&&(Ee=new Ee(U,O+"enter",Ne,i,ne),Ee.target=B,Ee.relatedTarget=It,ue=Ee),It=ue,xe&&Ne)t:{for(Ee=xe,U=Ne,O=0,B=Ee;B;B=Qr(B))O++;for(B=0,ue=U;ue;ue=Qr(ue))B++;for(;0<O-B;)Ee=Qr(Ee),O--;for(;0<B-O;)U=Qr(U),B--;for(;O--;){if(Ee===U||U!==null&&Ee===U.alternate)break t;Ee=Qr(Ee),U=Qr(U)}Ee=null}else Ee=null;xe!==null&&Df(re,ee,xe,Ee,!1),Ne!==null&&It!==null&&Df(re,It,Ne,Ee,!0)}}e:{if(ee=H?Jr(H):window,xe=ee.nodeName&&ee.nodeName.toLowerCase(),xe==="select"||xe==="input"&&ee.type==="file")var _e=qy;else if(pf(ee))if(mf)_e=Zy;else{_e=Xy;var Me=Yy}else(xe=ee.nodeName)&&xe.toLowerCase()==="input"&&(ee.type==="checkbox"||ee.type==="radio")&&(_e=Qy);if(_e&&(_e=_e(e,H))){hf(re,_e,i,ne);break e}Me&&Me(e,ee,H),e==="focusout"&&(Me=ee._wrapperState)&&Me.controlled&&ee.type==="number"&&wt(ee,"number",ee.value)}switch(Me=H?Jr(H):window,e){case"focusin":(pf(Me)||Me.contentEditable==="true")&&(Yr=Me,oc=H,Bi=null);break;case"focusout":Bi=oc=Yr=null;break;case"mousedown":ac=!0;break;case"contextmenu":case"mouseup":case"dragend":ac=!1,bf(re,i,ne);break;case"selectionchange":if(tx)break;case"keydown":case"keyup":bf(re,i,ne)}var De;if(nc)e:{switch(e){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else qr?df(e,i)&&(Pe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Pe="onCompositionStart");Pe&&(lf&&i.locale!=="ko"&&(qr||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&qr&&(De=nf()):(Gs=ne,Xl="value"in Gs?Gs.value:Gs.textContent,qr=!0)),Me=na(H,Pe),0<Me.length&&(Pe=new of(Pe,e,null,i,ne),re.push({event:Pe,listeners:Me}),De?Pe.data=De:(De=ff(i),De!==null&&(Pe.data=De)))),(De=Wy?Hy(e,i):Vy(e,i))&&(H=na(H,"onBeforeInput"),0<H.length&&(ne=new of("onBeforeInput","beforeinput",null,i,ne),re.push({event:ne,listeners:H}),ne.data=De))}If(re,n)})}function Vi(e,n,i){return{instance:e,listener:n,currentTarget:i}}function na(e,n){for(var i=n+"Capture",c=[];e!==null;){var f=e,h=f.stateNode;f.tag===5&&h!==null&&(f=h,h=rt(e,i),h!=null&&c.unshift(Vi(e,h,f)),h=rt(e,n),h!=null&&c.push(Vi(e,h,f))),e=e.return}return c}function Qr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Df(e,n,i,c,f){for(var h=n._reactName,w=[];i!==null&&i!==c;){var C=i,L=C.alternate,H=C.stateNode;if(L!==null&&L===c)break;C.tag===5&&H!==null&&(C=H,f?(L=rt(i,h),L!=null&&w.unshift(Vi(i,L,C))):f||(L=rt(i,h),L!=null&&w.push(Vi(i,L,C)))),i=i.return}w.length!==0&&e.push({event:n,listeners:w})}var ix=/\r\n?/g,ox=/\u0000|\uFFFD/g;function Lf(e){return(typeof e=="string"?e:""+e).replace(ix,`
39
+ `).replace(ox,"")}function sa(e,n,i){if(n=Lf(n),Lf(e)!==n&&i)throw Error(r(425))}function ra(){}var pc=null,hc=null;function mc(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var gc=typeof setTimeout=="function"?setTimeout:void 0,ax=typeof clearTimeout=="function"?clearTimeout:void 0,Of=typeof Promise=="function"?Promise:void 0,lx=typeof queueMicrotask=="function"?queueMicrotask:typeof Of<"u"?function(e){return Of.resolve(null).then(e).catch(cx)}:gc;function cx(e){setTimeout(function(){throw e})}function vc(e,n){var i=n,c=0;do{var f=i.nextSibling;if(e.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"){if(c===0){e.removeChild(f),Li(n);return}c--}else i!=="$"&&i!=="$?"&&i!=="$!"||c++;i=f}while(i);Li(n)}function qs(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function Pf(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(n===0)return e;n--}else i==="/$"&&n++}e=e.previousSibling}return null}var Zr=Math.random().toString(36).slice(2),ws="__reactFiber$"+Zr,Gi="__reactProps$"+Zr,_s="__reactContainer$"+Zr,yc="__reactEvents$"+Zr,ux="__reactListeners$"+Zr,dx="__reactHandles$"+Zr;function Sr(e){var n=e[ws];if(n)return n;for(var i=e.parentNode;i;){if(n=i[_s]||i[ws]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=Pf(e);e!==null;){if(i=e[ws])return i;e=Pf(e)}return n}e=i,i=e.parentNode}return null}function Ki(e){return e=e[ws]||e[_s],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Jr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function ia(e){return e[Gi]||null}var xc=[],ei=-1;function Ys(e){return{current:e}}function ht(e){0>ei||(e.current=xc[ei],xc[ei]=null,ei--)}function ut(e,n){ei++,xc[ei]=e.current,e.current=n}var Xs={},cn=Ys(Xs),jn=Ys(!1),br=Xs;function ti(e,n){var i=e.type.contextTypes;if(!i)return Xs;var c=e.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===n)return c.__reactInternalMemoizedMaskedChildContext;var f={},h;for(h in i)f[h]=n[h];return c&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=f),f}function Cn(e){return e=e.childContextTypes,e!=null}function oa(){ht(jn),ht(cn)}function $f(e,n,i){if(cn.current!==Xs)throw Error(r(168));ut(cn,n),ut(jn,i)}function zf(e,n,i){var c=e.stateNode;if(n=n.childContextTypes,typeof c.getChildContext!="function")return i;c=c.getChildContext();for(var f in c)if(!(f in n))throw Error(r(108,Te(e)||"Unknown",f));return q({},i,c)}function aa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xs,br=cn.current,ut(cn,e),ut(jn,jn.current),!0}function Ff(e,n,i){var c=e.stateNode;if(!c)throw Error(r(169));i?(e=zf(e,n,br),c.__reactInternalMemoizedMergedChildContext=e,ht(jn),ht(cn),ut(cn,e)):ht(jn),ut(jn,i)}var Rs=null,la=!1,wc=!1;function Uf(e){Rs===null?Rs=[e]:Rs.push(e)}function fx(e){la=!0,Uf(e)}function Qs(){if(!wc&&Rs!==null){wc=!0;var e=0,n=qe;try{var i=Rs;for(qe=1;e<i.length;e++){var c=i[e];do c=c(!0);while(c!==null)}Rs=null,la=!1}catch(f){throw Rs!==null&&(Rs=Rs.slice(e+1)),Ze(Bs,Qs),f}finally{qe=n,wc=!1}}return null}var ni=[],si=0,ca=null,ua=0,Gn=[],Kn=0,Tr=null,As=1,Is="";function Nr(e,n){ni[si++]=ua,ni[si++]=ca,ca=e,ua=n}function Bf(e,n,i){Gn[Kn++]=As,Gn[Kn++]=Is,Gn[Kn++]=Tr,Tr=e;var c=As;e=Is;var f=32-xn(c)-1;c&=~(1<<f),i+=1;var h=32-xn(n)+f;if(30<h){var w=f-f%5;h=(c&(1<<w)-1).toString(32),c>>=w,f-=w,As=1<<32-xn(n)+f|i<<f|c,Is=h+e}else As=1<<h|i<<f|c,Is=e}function kc(e){e.return!==null&&(Nr(e,1),Bf(e,1,0))}function Sc(e){for(;e===ca;)ca=ni[--si],ni[si]=null,ua=ni[--si],ni[si]=null;for(;e===Tr;)Tr=Gn[--Kn],Gn[Kn]=null,Is=Gn[--Kn],Gn[Kn]=null,As=Gn[--Kn],Gn[Kn]=null}var Fn=null,Un=null,xt=!1,ss=null;function Wf(e,n){var i=Qn(5,null,null,0);i.elementType="DELETED",i.stateNode=n,i.return=e,n=e.deletions,n===null?(e.deletions=[i],e.flags|=16):n.push(i)}function Hf(e,n){switch(e.tag){case 5:var i=e.type;return n=n.nodeType!==1||i.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,Fn=e,Un=qs(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Fn=e,Un=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(i=Tr!==null?{id:As,overflow:Is}:null,e.memoizedState={dehydrated:n,treeContext:i,retryLane:1073741824},i=Qn(18,null,null,0),i.stateNode=n,i.return=e,e.child=i,Fn=e,Un=null,!0):!1;default:return!1}}function bc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Tc(e){if(xt){var n=Un;if(n){var i=n;if(!Hf(e,n)){if(bc(e))throw Error(r(418));n=qs(i.nextSibling);var c=Fn;n&&Hf(e,n)?Wf(c,i):(e.flags=e.flags&-4097|2,xt=!1,Fn=e)}}else{if(bc(e))throw Error(r(418));e.flags=e.flags&-4097|2,xt=!1,Fn=e}}}function Vf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Fn=e}function da(e){if(e!==Fn)return!1;if(!xt)return Vf(e),xt=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!mc(e.type,e.memoizedProps)),n&&(n=Un)){if(bc(e))throw Gf(),Error(r(418));for(;n;)Wf(e,n),n=qs(n.nextSibling)}if(Vf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(n===0){Un=qs(e.nextSibling);break e}n--}else i!=="$"&&i!=="$!"&&i!=="$?"||n++}e=e.nextSibling}Un=null}}else Un=Fn?qs(e.stateNode.nextSibling):null;return!0}function Gf(){for(var e=Un;e;)e=qs(e.nextSibling)}function ri(){Un=Fn=null,xt=!1}function Nc(e){ss===null?ss=[e]:ss.push(e)}var px=A.ReactCurrentBatchConfig;function qi(e,n,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(r(309));var c=i.stateNode}if(!c)throw Error(r(147,e));var f=c,h=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===h?n.ref:(n=function(w){var C=f.refs;w===null?delete C[h]:C[h]=w},n._stringRef=h,n)}if(typeof e!="string")throw Error(r(284));if(!i._owner)throw Error(r(290,e))}return e}function fa(e,n){throw e=Object.prototype.toString.call(n),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function Kf(e){var n=e._init;return n(e._payload)}function qf(e){function n(U,O){if(e){var B=U.deletions;B===null?(U.deletions=[O],U.flags|=16):B.push(O)}}function i(U,O){if(!e)return null;for(;O!==null;)n(U,O),O=O.sibling;return null}function c(U,O){for(U=new Map;O!==null;)O.key!==null?U.set(O.key,O):U.set(O.index,O),O=O.sibling;return U}function f(U,O){return U=ir(U,O),U.index=0,U.sibling=null,U}function h(U,O,B){return U.index=B,e?(B=U.alternate,B!==null?(B=B.index,B<O?(U.flags|=2,O):B):(U.flags|=2,O)):(U.flags|=1048576,O)}function w(U){return e&&U.alternate===null&&(U.flags|=2),U}function C(U,O,B,ue){return O===null||O.tag!==6?(O=gu(B,U.mode,ue),O.return=U,O):(O=f(O,B),O.return=U,O)}function L(U,O,B,ue){var _e=B.type;return _e===V?ne(U,O,B.props.children,ue,B.key):O!==null&&(O.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===oe&&Kf(_e)===O.type)?(ue=f(O,B.props),ue.ref=qi(U,O,B),ue.return=U,ue):(ue=Oa(B.type,B.key,B.props,null,U.mode,ue),ue.ref=qi(U,O,B),ue.return=U,ue)}function H(U,O,B,ue){return O===null||O.tag!==4||O.stateNode.containerInfo!==B.containerInfo||O.stateNode.implementation!==B.implementation?(O=vu(B,U.mode,ue),O.return=U,O):(O=f(O,B.children||[]),O.return=U,O)}function ne(U,O,B,ue,_e){return O===null||O.tag!==7?(O=Mr(B,U.mode,ue,_e),O.return=U,O):(O=f(O,B),O.return=U,O)}function re(U,O,B){if(typeof O=="string"&&O!==""||typeof O=="number")return O=gu(""+O,U.mode,B),O.return=U,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case D:return B=Oa(O.type,O.key,O.props,null,U.mode,B),B.ref=qi(U,null,O),B.return=U,B;case G:return O=vu(O,U.mode,B),O.return=U,O;case oe:var ue=O._init;return re(U,ue(O._payload),B)}if(jt(O)||Q(O))return O=Mr(O,U.mode,B,null),O.return=U,O;fa(U,O)}return null}function ee(U,O,B,ue){var _e=O!==null?O.key:null;if(typeof B=="string"&&B!==""||typeof B=="number")return _e!==null?null:C(U,O,""+B,ue);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case D:return B.key===_e?L(U,O,B,ue):null;case G:return B.key===_e?H(U,O,B,ue):null;case oe:return _e=B._init,ee(U,O,_e(B._payload),ue)}if(jt(B)||Q(B))return _e!==null?null:ne(U,O,B,ue,null);fa(U,B)}return null}function xe(U,O,B,ue,_e){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return U=U.get(B)||null,C(O,U,""+ue,_e);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case D:return U=U.get(ue.key===null?B:ue.key)||null,L(O,U,ue,_e);case G:return U=U.get(ue.key===null?B:ue.key)||null,H(O,U,ue,_e);case oe:var Me=ue._init;return xe(U,O,B,Me(ue._payload),_e)}if(jt(ue)||Q(ue))return U=U.get(B)||null,ne(O,U,ue,_e,null);fa(O,ue)}return null}function Ne(U,O,B,ue){for(var _e=null,Me=null,De=O,Pe=O=0,Xt=null;De!==null&&Pe<B.length;Pe++){De.index>Pe?(Xt=De,De=null):Xt=De.sibling;var et=ee(U,De,B[Pe],ue);if(et===null){De===null&&(De=Xt);break}e&&De&&et.alternate===null&&n(U,De),O=h(et,O,Pe),Me===null?_e=et:Me.sibling=et,Me=et,De=Xt}if(Pe===B.length)return i(U,De),xt&&Nr(U,Pe),_e;if(De===null){for(;Pe<B.length;Pe++)De=re(U,B[Pe],ue),De!==null&&(O=h(De,O,Pe),Me===null?_e=De:Me.sibling=De,Me=De);return xt&&Nr(U,Pe),_e}for(De=c(U,De);Pe<B.length;Pe++)Xt=xe(De,U,Pe,B[Pe],ue),Xt!==null&&(e&&Xt.alternate!==null&&De.delete(Xt.key===null?Pe:Xt.key),O=h(Xt,O,Pe),Me===null?_e=Xt:Me.sibling=Xt,Me=Xt);return e&&De.forEach(function(or){return n(U,or)}),xt&&Nr(U,Pe),_e}function Ee(U,O,B,ue){var _e=Q(B);if(typeof _e!="function")throw Error(r(150));if(B=_e.call(B),B==null)throw Error(r(151));for(var Me=_e=null,De=O,Pe=O=0,Xt=null,et=B.next();De!==null&&!et.done;Pe++,et=B.next()){De.index>Pe?(Xt=De,De=null):Xt=De.sibling;var or=ee(U,De,et.value,ue);if(or===null){De===null&&(De=Xt);break}e&&De&&or.alternate===null&&n(U,De),O=h(or,O,Pe),Me===null?_e=or:Me.sibling=or,Me=or,De=Xt}if(et.done)return i(U,De),xt&&Nr(U,Pe),_e;if(De===null){for(;!et.done;Pe++,et=B.next())et=re(U,et.value,ue),et!==null&&(O=h(et,O,Pe),Me===null?_e=et:Me.sibling=et,Me=et);return xt&&Nr(U,Pe),_e}for(De=c(U,De);!et.done;Pe++,et=B.next())et=xe(De,U,Pe,et.value,ue),et!==null&&(e&&et.alternate!==null&&De.delete(et.key===null?Pe:et.key),O=h(et,O,Pe),Me===null?_e=et:Me.sibling=et,Me=et);return e&&De.forEach(function(Gx){return n(U,Gx)}),xt&&Nr(U,Pe),_e}function It(U,O,B,ue){if(typeof B=="object"&&B!==null&&B.type===V&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case D:e:{for(var _e=B.key,Me=O;Me!==null;){if(Me.key===_e){if(_e=B.type,_e===V){if(Me.tag===7){i(U,Me.sibling),O=f(Me,B.props.children),O.return=U,U=O;break e}}else if(Me.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===oe&&Kf(_e)===Me.type){i(U,Me.sibling),O=f(Me,B.props),O.ref=qi(U,Me,B),O.return=U,U=O;break e}i(U,Me);break}else n(U,Me);Me=Me.sibling}B.type===V?(O=Mr(B.props.children,U.mode,ue,B.key),O.return=U,U=O):(ue=Oa(B.type,B.key,B.props,null,U.mode,ue),ue.ref=qi(U,O,B),ue.return=U,U=ue)}return w(U);case G:e:{for(Me=B.key;O!==null;){if(O.key===Me)if(O.tag===4&&O.stateNode.containerInfo===B.containerInfo&&O.stateNode.implementation===B.implementation){i(U,O.sibling),O=f(O,B.children||[]),O.return=U,U=O;break e}else{i(U,O);break}else n(U,O);O=O.sibling}O=vu(B,U.mode,ue),O.return=U,U=O}return w(U);case oe:return Me=B._init,It(U,O,Me(B._payload),ue)}if(jt(B))return Ne(U,O,B,ue);if(Q(B))return Ee(U,O,B,ue);fa(U,B)}return typeof B=="string"&&B!==""||typeof B=="number"?(B=""+B,O!==null&&O.tag===6?(i(U,O.sibling),O=f(O,B),O.return=U,U=O):(i(U,O),O=gu(B,U.mode,ue),O.return=U,U=O),w(U)):i(U,O)}return It}var ii=qf(!0),Yf=qf(!1),pa=Ys(null),ha=null,oi=null,jc=null;function Cc(){jc=oi=ha=null}function Ec(e){var n=pa.current;ht(pa),e._currentValue=n}function _c(e,n,i){for(;e!==null;){var c=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,c!==null&&(c.childLanes|=n)):c!==null&&(c.childLanes&n)!==n&&(c.childLanes|=n),e===i)break;e=e.return}}function ai(e,n){ha=e,jc=oi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(En=!0),e.firstContext=null)}function qn(e){var n=e._currentValue;if(jc!==e)if(e={context:e,memoizedValue:n,next:null},oi===null){if(ha===null)throw Error(r(308));oi=e,ha.dependencies={lanes:0,firstContext:e}}else oi=oi.next=e;return n}var jr=null;function Rc(e){jr===null?jr=[e]:jr.push(e)}function Xf(e,n,i,c){var f=n.interleaved;return f===null?(i.next=i,Rc(n)):(i.next=f.next,f.next=i),n.interleaved=i,Ms(e,c)}function Ms(e,n){e.lanes|=n;var i=e.alternate;for(i!==null&&(i.lanes|=n),i=e,e=e.return;e!==null;)e.childLanes|=n,i=e.alternate,i!==null&&(i.childLanes|=n),i=e,e=e.return;return i.tag===3?i.stateNode:null}var Zs=!1;function Ac(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Qf(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ds(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Js(e,n,i){var c=e.updateQueue;if(c===null)return null;if(c=c.shared,(Xe&2)!==0){var f=c.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),c.pending=n,Ms(e,i)}return f=c.interleaved,f===null?(n.next=n,Rc(c)):(n.next=f.next,f.next=n),c.interleaved=n,Ms(e,i)}function ma(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194240)!==0)){var c=n.lanes;c&=e.pendingLanes,i|=c,n.lanes=i,Hs(e,i)}}function Zf(e,n){var i=e.updateQueue,c=e.alternate;if(c!==null&&(c=c.updateQueue,i===c)){var f=null,h=null;if(i=i.firstBaseUpdate,i!==null){do{var w={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};h===null?f=h=w:h=h.next=w,i=i.next}while(i!==null);h===null?f=h=n:h=h.next=n}else f=h=n;i={baseState:c.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:c.shared,effects:c.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}function ga(e,n,i,c){var f=e.updateQueue;Zs=!1;var h=f.firstBaseUpdate,w=f.lastBaseUpdate,C=f.shared.pending;if(C!==null){f.shared.pending=null;var L=C,H=L.next;L.next=null,w===null?h=H:w.next=H,w=L;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,C=ne.lastBaseUpdate,C!==w&&(C===null?ne.firstBaseUpdate=H:C.next=H,ne.lastBaseUpdate=L))}if(h!==null){var re=f.baseState;w=0,ne=H=L=null,C=h;do{var ee=C.lane,xe=C.eventTime;if((c&ee)===ee){ne!==null&&(ne=ne.next={eventTime:xe,lane:0,tag:C.tag,payload:C.payload,callback:C.callback,next:null});e:{var Ne=e,Ee=C;switch(ee=n,xe=i,Ee.tag){case 1:if(Ne=Ee.payload,typeof Ne=="function"){re=Ne.call(xe,re,ee);break e}re=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Ee.payload,ee=typeof Ne=="function"?Ne.call(xe,re,ee):Ne,ee==null)break e;re=q({},re,ee);break e;case 2:Zs=!0}}C.callback!==null&&C.lane!==0&&(e.flags|=64,ee=f.effects,ee===null?f.effects=[C]:ee.push(C))}else xe={eventTime:xe,lane:ee,tag:C.tag,payload:C.payload,callback:C.callback,next:null},ne===null?(H=ne=xe,L=re):ne=ne.next=xe,w|=ee;if(C=C.next,C===null){if(C=f.shared.pending,C===null)break;ee=C,C=ee.next,ee.next=null,f.lastBaseUpdate=ee,f.shared.pending=null}}while(!0);if(ne===null&&(L=re),f.baseState=L,f.firstBaseUpdate=H,f.lastBaseUpdate=ne,n=f.shared.interleaved,n!==null){f=n;do w|=f.lane,f=f.next;while(f!==n)}else h===null&&(f.shared.lanes=0);_r|=w,e.lanes=w,e.memoizedState=re}}function Jf(e,n,i){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var c=e[n],f=c.callback;if(f!==null){if(c.callback=null,c=i,typeof f!="function")throw Error(r(191,f));f.call(c)}}}var Yi={},ks=Ys(Yi),Xi=Ys(Yi),Qi=Ys(Yi);function Cr(e){if(e===Yi)throw Error(r(174));return e}function Ic(e,n){switch(ut(Qi,n),ut(Xi,e),ut(ks,Yi),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:mt(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=mt(n,e)}ht(ks),ut(ks,n)}function li(){ht(ks),ht(Xi),ht(Qi)}function ep(e){Cr(Qi.current);var n=Cr(ks.current),i=mt(n,e.type);n!==i&&(ut(Xi,e),ut(ks,i))}function Mc(e){Xi.current===e&&(ht(ks),ht(Xi))}var Tt=Ys(0);function va(e){for(var n=e;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Dc=[];function Lc(){for(var e=0;e<Dc.length;e++)Dc[e]._workInProgressVersionPrimary=null;Dc.length=0}var ya=A.ReactCurrentDispatcher,Oc=A.ReactCurrentBatchConfig,Er=0,Nt=null,Ut=null,qt=null,xa=!1,Zi=!1,Ji=0,hx=0;function un(){throw Error(r(321))}function Pc(e,n){if(n===null)return!1;for(var i=0;i<n.length&&i<e.length;i++)if(!ns(e[i],n[i]))return!1;return!0}function $c(e,n,i,c,f,h){if(Er=h,Nt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,ya.current=e===null||e.memoizedState===null?yx:xx,e=i(c,f),Zi){h=0;do{if(Zi=!1,Ji=0,25<=h)throw Error(r(301));h+=1,qt=Ut=null,n.updateQueue=null,ya.current=wx,e=i(c,f)}while(Zi)}if(ya.current=Sa,n=Ut!==null&&Ut.next!==null,Er=0,qt=Ut=Nt=null,xa=!1,n)throw Error(r(300));return e}function zc(){var e=Ji!==0;return Ji=0,e}function Ss(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?Nt.memoizedState=qt=e:qt=qt.next=e,qt}function Yn(){if(Ut===null){var e=Nt.alternate;e=e!==null?e.memoizedState:null}else e=Ut.next;var n=qt===null?Nt.memoizedState:qt.next;if(n!==null)qt=n,Ut=e;else{if(e===null)throw Error(r(310));Ut=e,e={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},qt===null?Nt.memoizedState=qt=e:qt=qt.next=e}return qt}function eo(e,n){return typeof n=="function"?n(e):n}function Fc(e){var n=Yn(),i=n.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var c=Ut,f=c.baseQueue,h=i.pending;if(h!==null){if(f!==null){var w=f.next;f.next=h.next,h.next=w}c.baseQueue=f=h,i.pending=null}if(f!==null){h=f.next,c=c.baseState;var C=w=null,L=null,H=h;do{var ne=H.lane;if((Er&ne)===ne)L!==null&&(L=L.next={lane:0,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),c=H.hasEagerState?H.eagerState:e(c,H.action);else{var re={lane:ne,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null};L===null?(C=L=re,w=c):L=L.next=re,Nt.lanes|=ne,_r|=ne}H=H.next}while(H!==null&&H!==h);L===null?w=c:L.next=C,ns(c,n.memoizedState)||(En=!0),n.memoizedState=c,n.baseState=w,n.baseQueue=L,i.lastRenderedState=c}if(e=i.interleaved,e!==null){f=e;do h=f.lane,Nt.lanes|=h,_r|=h,f=f.next;while(f!==e)}else f===null&&(i.lanes=0);return[n.memoizedState,i.dispatch]}function Uc(e){var n=Yn(),i=n.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var c=i.dispatch,f=i.pending,h=n.memoizedState;if(f!==null){i.pending=null;var w=f=f.next;do h=e(h,w.action),w=w.next;while(w!==f);ns(h,n.memoizedState)||(En=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),i.lastRenderedState=h}return[h,c]}function tp(){}function np(e,n){var i=Nt,c=Yn(),f=n(),h=!ns(c.memoizedState,f);if(h&&(c.memoizedState=f,En=!0),c=c.queue,Bc(ip.bind(null,i,c,e),[e]),c.getSnapshot!==n||h||qt!==null&&qt.memoizedState.tag&1){if(i.flags|=2048,to(9,rp.bind(null,i,c,f,n),void 0,null),Yt===null)throw Error(r(349));(Er&30)!==0||sp(i,n,f)}return f}function sp(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=Nt.updateQueue,n===null?(n={lastEffect:null,stores:null},Nt.updateQueue=n,n.stores=[e]):(i=n.stores,i===null?n.stores=[e]:i.push(e))}function rp(e,n,i,c){n.value=i,n.getSnapshot=c,op(n)&&ap(e)}function ip(e,n,i){return i(function(){op(n)&&ap(e)})}function op(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!ns(e,i)}catch{return!0}}function ap(e){var n=Ms(e,1);n!==null&&as(n,e,1,-1)}function lp(e){var n=Ss();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:eo,lastRenderedState:e},n.queue=e,e=e.dispatch=vx.bind(null,Nt,e),[n.memoizedState,e]}function to(e,n,i,c){return e={tag:e,create:n,destroy:i,deps:c,next:null},n=Nt.updateQueue,n===null?(n={lastEffect:null,stores:null},Nt.updateQueue=n,n.lastEffect=e.next=e):(i=n.lastEffect,i===null?n.lastEffect=e.next=e:(c=i.next,i.next=e,e.next=c,n.lastEffect=e)),e}function cp(){return Yn().memoizedState}function wa(e,n,i,c){var f=Ss();Nt.flags|=e,f.memoizedState=to(1|n,i,void 0,c===void 0?null:c)}function ka(e,n,i,c){var f=Yn();c=c===void 0?null:c;var h=void 0;if(Ut!==null){var w=Ut.memoizedState;if(h=w.destroy,c!==null&&Pc(c,w.deps)){f.memoizedState=to(n,i,h,c);return}}Nt.flags|=e,f.memoizedState=to(1|n,i,h,c)}function up(e,n){return wa(8390656,8,e,n)}function Bc(e,n){return ka(2048,8,e,n)}function dp(e,n){return ka(4,2,e,n)}function fp(e,n){return ka(4,4,e,n)}function pp(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function hp(e,n,i){return i=i!=null?i.concat([e]):null,ka(4,4,pp.bind(null,n,e),i)}function Wc(){}function mp(e,n){var i=Yn();n=n===void 0?null:n;var c=i.memoizedState;return c!==null&&n!==null&&Pc(n,c[1])?c[0]:(i.memoizedState=[e,n],e)}function gp(e,n){var i=Yn();n=n===void 0?null:n;var c=i.memoizedState;return c!==null&&n!==null&&Pc(n,c[1])?c[0]:(e=e(),i.memoizedState=[e,n],e)}function vp(e,n,i){return(Er&21)===0?(e.baseState&&(e.baseState=!1,En=!0),e.memoizedState=i):(ns(i,n)||(i=Ai(),Nt.lanes|=i,_r|=i,e.baseState=!0),n)}function mx(e,n){var i=qe;qe=i!==0&&4>i?i:4,e(!0);var c=Oc.transition;Oc.transition={};try{e(!1),n()}finally{qe=i,Oc.transition=c}}function yp(){return Yn().memoizedState}function gx(e,n,i){var c=sr(e);if(i={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null},xp(e))wp(n,i);else if(i=Xf(e,n,i,c),i!==null){var f=Sn();as(i,e,c,f),kp(i,n,c)}}function vx(e,n,i){var c=sr(e),f={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null};if(xp(e))wp(n,f);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var w=n.lastRenderedState,C=h(w,i);if(f.hasEagerState=!0,f.eagerState=C,ns(C,w)){var L=n.interleaved;L===null?(f.next=f,Rc(n)):(f.next=L.next,L.next=f),n.interleaved=f;return}}catch{}finally{}i=Xf(e,n,f,c),i!==null&&(f=Sn(),as(i,e,c,f),kp(i,n,c))}}function xp(e){var n=e.alternate;return e===Nt||n!==null&&n===Nt}function wp(e,n){Zi=xa=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function kp(e,n,i){if((i&4194240)!==0){var c=n.lanes;c&=e.pendingLanes,i|=c,n.lanes=i,Hs(e,i)}}var Sa={readContext:qn,useCallback:un,useContext:un,useEffect:un,useImperativeHandle:un,useInsertionEffect:un,useLayoutEffect:un,useMemo:un,useReducer:un,useRef:un,useState:un,useDebugValue:un,useDeferredValue:un,useTransition:un,useMutableSource:un,useSyncExternalStore:un,useId:un,unstable_isNewReconciler:!1},yx={readContext:qn,useCallback:function(e,n){return Ss().memoizedState=[e,n===void 0?null:n],e},useContext:qn,useEffect:up,useImperativeHandle:function(e,n,i){return i=i!=null?i.concat([e]):null,wa(4194308,4,pp.bind(null,n,e),i)},useLayoutEffect:function(e,n){return wa(4194308,4,e,n)},useInsertionEffect:function(e,n){return wa(4,2,e,n)},useMemo:function(e,n){var i=Ss();return n=n===void 0?null:n,e=e(),i.memoizedState=[e,n],e},useReducer:function(e,n,i){var c=Ss();return n=i!==void 0?i(n):n,c.memoizedState=c.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},c.queue=e,e=e.dispatch=gx.bind(null,Nt,e),[c.memoizedState,e]},useRef:function(e){var n=Ss();return e={current:e},n.memoizedState=e},useState:lp,useDebugValue:Wc,useDeferredValue:function(e){return Ss().memoizedState=e},useTransition:function(){var e=lp(!1),n=e[0];return e=mx.bind(null,e[1]),Ss().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,i){var c=Nt,f=Ss();if(xt){if(i===void 0)throw Error(r(407));i=i()}else{if(i=n(),Yt===null)throw Error(r(349));(Er&30)!==0||sp(c,n,i)}f.memoizedState=i;var h={value:i,getSnapshot:n};return f.queue=h,up(ip.bind(null,c,h,e),[e]),c.flags|=2048,to(9,rp.bind(null,c,h,i,n),void 0,null),i},useId:function(){var e=Ss(),n=Yt.identifierPrefix;if(xt){var i=Is,c=As;i=(c&~(1<<32-xn(c)-1)).toString(32)+i,n=":"+n+"R"+i,i=Ji++,0<i&&(n+="H"+i.toString(32)),n+=":"}else i=hx++,n=":"+n+"r"+i.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},xx={readContext:qn,useCallback:mp,useContext:qn,useEffect:Bc,useImperativeHandle:hp,useInsertionEffect:dp,useLayoutEffect:fp,useMemo:gp,useReducer:Fc,useRef:cp,useState:function(){return Fc(eo)},useDebugValue:Wc,useDeferredValue:function(e){var n=Yn();return vp(n,Ut.memoizedState,e)},useTransition:function(){var e=Fc(eo)[0],n=Yn().memoizedState;return[e,n]},useMutableSource:tp,useSyncExternalStore:np,useId:yp,unstable_isNewReconciler:!1},wx={readContext:qn,useCallback:mp,useContext:qn,useEffect:Bc,useImperativeHandle:hp,useInsertionEffect:dp,useLayoutEffect:fp,useMemo:gp,useReducer:Uc,useRef:cp,useState:function(){return Uc(eo)},useDebugValue:Wc,useDeferredValue:function(e){var n=Yn();return Ut===null?n.memoizedState=e:vp(n,Ut.memoizedState,e)},useTransition:function(){var e=Uc(eo)[0],n=Yn().memoizedState;return[e,n]},useMutableSource:tp,useSyncExternalStore:np,useId:yp,unstable_isNewReconciler:!1};function rs(e,n){if(e&&e.defaultProps){n=q({},n),e=e.defaultProps;for(var i in e)n[i]===void 0&&(n[i]=e[i]);return n}return n}function Hc(e,n,i,c){n=e.memoizedState,i=i(c,n),i=i==null?n:q({},n,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var ba={isMounted:function(e){return(e=e._reactInternals)?Be(e)===e:!1},enqueueSetState:function(e,n,i){e=e._reactInternals;var c=Sn(),f=sr(e),h=Ds(c,f);h.payload=n,i!=null&&(h.callback=i),n=Js(e,h,f),n!==null&&(as(n,e,f,c),ma(n,e,f))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var c=Sn(),f=sr(e),h=Ds(c,f);h.tag=1,h.payload=n,i!=null&&(h.callback=i),n=Js(e,h,f),n!==null&&(as(n,e,f,c),ma(n,e,f))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=Sn(),c=sr(e),f=Ds(i,c);f.tag=2,n!=null&&(f.callback=n),n=Js(e,f,c),n!==null&&(as(n,e,c,i),ma(n,e,c))}};function Sp(e,n,i,c,f,h,w){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(c,h,w):n.prototype&&n.prototype.isPureReactComponent?!Ui(i,c)||!Ui(f,h):!0}function bp(e,n,i){var c=!1,f=Xs,h=n.contextType;return typeof h=="object"&&h!==null?h=qn(h):(f=Cn(n)?br:cn.current,c=n.contextTypes,h=(c=c!=null)?ti(e,f):Xs),n=new n(i,h),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=ba,e.stateNode=n,n._reactInternals=e,c&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=f,e.__reactInternalMemoizedMaskedChildContext=h),n}function Tp(e,n,i,c){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,c),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,c),n.state!==e&&ba.enqueueReplaceState(n,n.state,null)}function Vc(e,n,i,c){var f=e.stateNode;f.props=i,f.state=e.memoizedState,f.refs={},Ac(e);var h=n.contextType;typeof h=="object"&&h!==null?f.context=qn(h):(h=Cn(n)?br:cn.current,f.context=ti(e,h)),f.state=e.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(Hc(e,n,h,i),f.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(n=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),n!==f.state&&ba.enqueueReplaceState(f,f.state,null),ga(e,i,f,c),f.state=e.memoizedState),typeof f.componentDidMount=="function"&&(e.flags|=4194308)}function ci(e,n){try{var i="",c=n;do i+=X(c),c=c.return;while(c);var f=i}catch(h){f=`
40
40
  Error generating stack: `+h.message+`
41
- `+h.stack}return{value:e,source:n,stack:f,digest:null}}function Wc(e,n,i){return{value:e,source:null,stack:i??null,digest:n??null}}function Hc(e,n){try{console.error(n.value)}catch(i){setTimeout(function(){throw i})}}var vx=typeof WeakMap=="function"?WeakMap:Map;function Tp(e,n,i){i=Ds(-1,i),i.tag=3,i.payload={element:null};var c=n.value;return i.callback=function(){Ra||(Ra=!0,iu=c),Hc(e,n)},i}function Np(e,n,i){i=Ds(-1,i),i.tag=3;var c=e.type.getDerivedStateFromError;if(typeof c=="function"){var f=n.value;i.payload=function(){return c(f)},i.callback=function(){Hc(e,n)}}var h=e.stateNode;return h!==null&&typeof h.componentDidCatch=="function"&&(i.callback=function(){Hc(e,n),typeof c!="function"&&(tr===null?tr=new Set([this]):tr.add(this));var w=n.stack;this.componentDidCatch(n.value,{componentStack:w!==null?w:""})}),i}function jp(e,n,i){var c=e.pingCache;if(c===null){c=e.pingCache=new vx;var f=new Set;c.set(n,f)}else f=c.get(n),f===void 0&&(f=new Set,c.set(n,f));f.has(i)||(f.add(i),e=Ax.bind(null,e,n,i),n.then(e,e))}function Cp(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function Ep(e,n,i,c,f){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(n=Ds(-1,1),n.tag=2,Js(i,n,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=f,e)}var yx=M.ReactCurrentOwner,En=!1;function kn(e,n,i,c){n.child=e===null?qf(n,null,i,c):ii(n,e.child,i,c)}function _p(e,n,i,c,f){i=i.render;var h=n.ref;return ai(n,f),c=Lc(e,n,i,c,h,f),i=Oc(),e!==null&&!En?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~f,Ls(e,n,f)):(xt&&i&&yc(n),n.flags|=1,kn(e,n,c,f),n.child)}function Rp(e,n,i,c,f){if(e===null){var h=i.type;return typeof h=="function"&&!fu(h)&&h.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(n.tag=15,n.type=h,Ap(e,n,h,c,f)):(e=Oa(i.type,null,c,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,(e.lanes&f)===0){var w=h.memoizedProps;if(i=i.compare,i=i!==null?i:Ui,i(w,c)&&e.ref===n.ref)return Ls(e,n,f)}return n.flags|=1,e=ir(h,c),e.ref=n.ref,e.return=n,n.child=e}function Ap(e,n,i,c,f){if(e!==null){var h=e.memoizedProps;if(Ui(h,c)&&e.ref===n.ref)if(En=!1,n.pendingProps=c=h,(e.lanes&f)!==0)(e.flags&131072)!==0&&(En=!0);else return n.lanes=e.lanes,Ls(e,n,f)}return Vc(e,n,i,c,f)}function Ip(e,n,i){var c=n.pendingProps,f=c.children,h=e!==null?e.memoizedState:null;if(c.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(di,Bn),Bn|=i;else{if((i&1073741824)===0)return e=h!==null?h.baseLanes|i:i,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,ut(di,Bn),Bn|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},c=h!==null?h.baseLanes:i,ut(di,Bn),Bn|=c}else h!==null?(c=h.baseLanes|i,n.memoizedState=null):c=i,ut(di,Bn),Bn|=c;return kn(e,n,f,i),n.child}function Mp(e,n){var i=n.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(n.flags|=512,n.flags|=2097152)}function Vc(e,n,i,c,f){var h=Cn(i)?br:cn.current;return h=ti(n,h),ai(n,f),i=Lc(e,n,i,c,h,f),c=Oc(),e!==null&&!En?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~f,Ls(e,n,f)):(xt&&c&&yc(n),n.flags|=1,kn(e,n,i,f),n.child)}function Dp(e,n,i,c,f){if(Cn(i)){var h=!0;aa(n)}else h=!1;if(ai(n,f),n.stateNode===null)Na(e,n),Sp(n,i,c),Bc(n,i,c,f),c=!0;else if(e===null){var w=n.stateNode,j=n.memoizedProps;w.props=j;var L=w.context,V=i.contextType;typeof V=="object"&&V!==null?V=qn(V):(V=Cn(i)?br:cn.current,V=ti(n,V));var ne=i.getDerivedStateFromProps,re=typeof ne=="function"||typeof w.getSnapshotBeforeUpdate=="function";re||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(j!==c||L!==V)&&bp(n,w,c,V),Zs=!1;var ee=n.memoizedState;w.state=ee,ga(n,c,w,f),L=n.memoizedState,j!==c||ee!==L||jn.current||Zs?(typeof ne=="function"&&(Uc(n,i,ne,c),L=n.memoizedState),(j=Zs||kp(n,i,j,c,ee,L,V))?(re||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(n.flags|=4194308)):(typeof w.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=L),w.props=c,w.state=L,w.context=V,c=j):(typeof w.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{w=n.stateNode,Xf(e,n),j=n.memoizedProps,V=n.type===n.elementType?j:rs(n.type,j),w.props=V,re=n.pendingProps,ee=w.context,L=i.contextType,typeof L=="object"&&L!==null?L=qn(L):(L=Cn(i)?br:cn.current,L=ti(n,L));var ve=i.getDerivedStateFromProps;(ne=typeof ve=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(j!==re||ee!==L)&&bp(n,w,c,L),Zs=!1,ee=n.memoizedState,w.state=ee,ga(n,c,w,f);var ke=n.memoizedState;j!==re||ee!==ke||jn.current||Zs?(typeof ve=="function"&&(Uc(n,i,ve,c),ke=n.memoizedState),(V=Zs||kp(n,i,V,c,ee,ke,L)||!1)?(ne||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(c,ke,L),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(c,ke,L)),typeof w.componentDidUpdate=="function"&&(n.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof w.componentDidUpdate!="function"||j===e.memoizedProps&&ee===e.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&ee===e.memoizedState||(n.flags|=1024),n.memoizedProps=c,n.memoizedState=ke),w.props=c,w.state=ke,w.context=L,c=V):(typeof w.componentDidUpdate!="function"||j===e.memoizedProps&&ee===e.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&ee===e.memoizedState||(n.flags|=1024),c=!1)}return Gc(e,n,i,c,h,f)}function Gc(e,n,i,c,f,h){Mp(e,n);var w=(n.flags&128)!==0;if(!c&&!w)return f&&zf(n,i,!1),Ls(e,n,h);c=n.stateNode,yx.current=n;var j=w&&typeof i.getDerivedStateFromError!="function"?null:c.render();return n.flags|=1,e!==null&&w?(n.child=ii(n,e.child,null,h),n.child=ii(n,null,j,h)):kn(e,n,j,h),n.memoizedState=c.state,f&&zf(n,i,!0),n.child}function Lp(e){var n=e.stateNode;n.pendingContext?Pf(e,n.pendingContext,n.pendingContext!==n.context):n.context&&Pf(e,n.context,!1),_c(e,n.containerInfo)}function Op(e,n,i,c,f){return ri(),Sc(f),n.flags|=256,kn(e,n,i,c),n.child}var Kc={dehydrated:null,treeContext:null,retryLane:0};function qc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Pp(e,n,i){var c=n.pendingProps,f=Tt.current,h=!1,w=(n.flags&128)!==0,j;if((j=w)||(j=e!==null&&e.memoizedState===null?!1:(f&2)!==0),j?(h=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(f|=1),ut(Tt,f&1),e===null)return kc(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(w=c.children,e=c.fallback,h?(c=n.mode,h=n.child,w={mode:"hidden",children:w},(c&1)===0&&h!==null?(h.childLanes=0,h.pendingProps=w):h=Pa(w,c,0,null),e=Mr(e,c,i,null),h.return=n,e.return=n,h.sibling=e,n.child=h,n.child.memoizedState=qc(i),n.memoizedState=Kc,e):Yc(n,w));if(f=e.memoizedState,f!==null&&(j=f.dehydrated,j!==null))return xx(e,n,w,c,j,f,i);if(h){h=c.fallback,w=n.mode,f=e.child,j=f.sibling;var L={mode:"hidden",children:c.children};return(w&1)===0&&n.child!==f?(c=n.child,c.childLanes=0,c.pendingProps=L,n.deletions=null):(c=ir(f,L),c.subtreeFlags=f.subtreeFlags&14680064),j!==null?h=ir(j,h):(h=Mr(h,w,i,null),h.flags|=2),h.return=n,c.return=n,c.sibling=h,n.child=c,c=h,h=n.child,w=e.child.memoizedState,w=w===null?qc(i):{baseLanes:w.baseLanes|i,cachePool:null,transitions:w.transitions},h.memoizedState=w,h.childLanes=e.childLanes&~i,n.memoizedState=Kc,c}return h=e.child,e=h.sibling,c=ir(h,{mode:"visible",children:c.children}),(n.mode&1)===0&&(c.lanes=i),c.return=n,c.sibling=null,e!==null&&(i=n.deletions,i===null?(n.deletions=[e],n.flags|=16):i.push(e)),n.child=c,n.memoizedState=null,c}function Yc(e,n){return n=Pa({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function Ta(e,n,i,c){return c!==null&&Sc(c),ii(n,e.child,null,i),e=Yc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function xx(e,n,i,c,f,h,w){if(i)return n.flags&256?(n.flags&=-257,c=Wc(Error(r(422))),Ta(e,n,w,c)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(h=c.fallback,f=n.mode,c=Pa({mode:"visible",children:c.children},f,0,null),h=Mr(h,f,w,null),h.flags|=2,c.return=n,h.return=n,c.sibling=h,n.child=c,(n.mode&1)!==0&&ii(n,e.child,null,w),n.child.memoizedState=qc(w),n.memoizedState=Kc,h);if((n.mode&1)===0)return Ta(e,n,w,null);if(f.data==="$!"){if(c=f.nextSibling&&f.nextSibling.dataset,c)var j=c.dgst;return c=j,h=Error(r(419)),c=Wc(h,c,void 0),Ta(e,n,w,c)}if(j=(w&e.childLanes)!==0,En||j){if(c=Yt,c!==null){switch(w&-w){case 4:f=2;break;case 16:f=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:f=32;break;case 536870912:f=268435456;break;default:f=0}f=(f&(c.suspendedLanes|w))!==0?0:f,f!==0&&f!==h.retryLane&&(h.retryLane=f,Ms(e,f),as(c,e,f,-1))}return du(),c=Wc(Error(r(421))),Ta(e,n,w,c)}return f.data==="$?"?(n.flags|=128,n.child=e.child,n=Ix.bind(null,e),f._reactRetry=n,null):(e=h.treeContext,Un=qs(f.nextSibling),Fn=n,xt=!0,ss=null,e!==null&&(Gn[Kn++]=As,Gn[Kn++]=Is,Gn[Kn++]=Tr,As=e.id,Is=e.overflow,Tr=n),n=Yc(n,c.children),n.flags|=4096,n)}function $p(e,n,i){e.lanes|=n;var c=e.alternate;c!==null&&(c.lanes|=n),jc(e.return,n,i)}function Xc(e,n,i,c,f){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:c,tail:i,tailMode:f}:(h.isBackwards=n,h.rendering=null,h.renderingStartTime=0,h.last=c,h.tail=i,h.tailMode=f)}function zp(e,n,i){var c=n.pendingProps,f=c.revealOrder,h=c.tail;if(kn(e,n,c.children,i),c=Tt.current,(c&2)!==0)c=c&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$p(e,i,n);else if(e.tag===19)$p(e,i,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}c&=1}if(ut(Tt,c),(n.mode&1)===0)n.memoizedState=null;else switch(f){case"forwards":for(i=n.child,f=null;i!==null;)e=i.alternate,e!==null&&va(e)===null&&(f=i),i=i.sibling;i=f,i===null?(f=n.child,n.child=null):(f=i.sibling,i.sibling=null),Xc(n,!1,f,i,h);break;case"backwards":for(i=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&va(e)===null){n.child=f;break}e=f.sibling,f.sibling=i,i=f,f=e}Xc(n,!0,i,null,h);break;case"together":Xc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Na(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function Ls(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),_r|=n.lanes,(i&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(r(153));if(n.child!==null){for(e=n.child,i=ir(e,e.pendingProps),n.child=i,i.return=n;e.sibling!==null;)e=e.sibling,i=i.sibling=ir(e,e.pendingProps),i.return=n;i.sibling=null}return n.child}function wx(e,n,i){switch(n.tag){case 3:Lp(n),ri();break;case 5:Jf(n);break;case 1:Cn(n.type)&&aa(n);break;case 4:_c(n,n.stateNode.containerInfo);break;case 10:var c=n.type._context,f=n.memoizedProps.value;ut(pa,c._currentValue),c._currentValue=f;break;case 13:if(c=n.memoizedState,c!==null)return c.dehydrated!==null?(ut(Tt,Tt.current&1),n.flags|=128,null):(i&n.child.childLanes)!==0?Pp(e,n,i):(ut(Tt,Tt.current&1),e=Ls(e,n,i),e!==null?e.sibling:null);ut(Tt,Tt.current&1);break;case 19:if(c=(i&n.childLanes)!==0,(e.flags&128)!==0){if(c)return zp(e,n,i);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),ut(Tt,Tt.current),c)break;return null;case 22:case 23:return n.lanes=0,Ip(e,n,i)}return Ls(e,n,i)}var Fp,Qc,Up,Bp;Fp=function(e,n){for(var i=n.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},Qc=function(){},Up=function(e,n,i,c){var f=e.memoizedProps;if(f!==c){e=n.stateNode,Cr(ws.current);var h=null;switch(i){case"input":f=$e(e,f),c=$e(e,c),h=[];break;case"select":f=B({},f,{value:void 0}),c=B({},c,{value:void 0}),h=[];break;case"textarea":f=Dt(e,f),c=Dt(e,c),h=[];break;default:typeof f.onClick!="function"&&typeof c.onClick=="function"&&(e.onclick=ra)}ts(i,c);var w;i=null;for(V in f)if(!c.hasOwnProperty(V)&&f.hasOwnProperty(V)&&f[V]!=null)if(V==="style"){var j=f[V];for(w in j)j.hasOwnProperty(w)&&(i||(i={}),i[w]="")}else V!=="dangerouslySetInnerHTML"&&V!=="children"&&V!=="suppressContentEditableWarning"&&V!=="suppressHydrationWarning"&&V!=="autoFocus"&&(l.hasOwnProperty(V)?h||(h=[]):(h=h||[]).push(V,null));for(V in c){var L=c[V];if(j=f!=null?f[V]:void 0,c.hasOwnProperty(V)&&L!==j&&(L!=null||j!=null))if(V==="style")if(j){for(w in j)!j.hasOwnProperty(w)||L&&L.hasOwnProperty(w)||(i||(i={}),i[w]="");for(w in L)L.hasOwnProperty(w)&&j[w]!==L[w]&&(i||(i={}),i[w]=L[w])}else i||(h||(h=[]),h.push(V,i)),i=L;else V==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,j=j?j.__html:void 0,L!=null&&j!==L&&(h=h||[]).push(V,L)):V==="children"?typeof L!="string"&&typeof L!="number"||(h=h||[]).push(V,""+L):V!=="suppressContentEditableWarning"&&V!=="suppressHydrationWarning"&&(l.hasOwnProperty(V)?(L!=null&&V==="onScroll"&&pt("scroll",e),h||j===L||(h=[])):(h=h||[]).push(V,L))}i&&(h=h||[]).push("style",i);var V=h;(n.updateQueue=V)&&(n.flags|=4)}},Bp=function(e,n,i,c){i!==c&&(n.flags|=4)};function no(e,n){if(!xt)switch(e.tailMode){case"hidden":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:c.sibling=null}}function dn(e){var n=e.alternate!==null&&e.alternate.child===e.child,i=0,c=0;if(n)for(var f=e.child;f!==null;)i|=f.lanes|f.childLanes,c|=f.subtreeFlags&14680064,c|=f.flags&14680064,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)i|=f.lanes|f.childLanes,c|=f.subtreeFlags,c|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=c,e.childLanes=i,n}function kx(e,n,i){var c=n.pendingProps;switch(xc(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dn(n),null;case 1:return Cn(n.type)&&oa(),dn(n),null;case 3:return c=n.stateNode,li(),ht(jn),ht(cn),Ic(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(e===null||e.child===null)&&(da(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,ss!==null&&(lu(ss),ss=null))),Qc(e,n),dn(n),null;case 5:Rc(n);var f=Cr(Qi.current);if(i=n.type,e!==null&&n.stateNode!=null)Up(e,n,i,c,f),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!c){if(n.stateNode===null)throw Error(r(166));return dn(n),null}if(e=Cr(ws.current),da(n)){c=n.stateNode,i=n.type;var h=n.memoizedProps;switch(c[xs]=n,c[Gi]=h,e=(n.mode&1)!==0,i){case"dialog":pt("cancel",c),pt("close",c);break;case"iframe":case"object":case"embed":pt("load",c);break;case"video":case"audio":for(f=0;f<Wi.length;f++)pt(Wi[f],c);break;case"source":pt("error",c);break;case"img":case"image":case"link":pt("error",c),pt("load",c);break;case"details":pt("toggle",c);break;case"input":en(c,h),pt("invalid",c);break;case"select":c._wrapperState={wasMultiple:!!h.multiple},pt("invalid",c);break;case"textarea":Y(c,h),pt("invalid",c)}ts(i,h),f=null;for(var w in h)if(h.hasOwnProperty(w)){var j=h[w];w==="children"?typeof j=="string"?c.textContent!==j&&(h.suppressHydrationWarning!==!0&&sa(c.textContent,j,e),f=["children",j]):typeof j=="number"&&c.textContent!==""+j&&(h.suppressHydrationWarning!==!0&&sa(c.textContent,j,e),f=["children",""+j]):l.hasOwnProperty(w)&&j!=null&&w==="onScroll"&&pt("scroll",c)}switch(i){case"input":at(c),tn(c,h,!0);break;case"textarea":at(c),Ue(c);break;case"select":case"option":break;default:typeof h.onClick=="function"&&(c.onclick=ra)}c=f,n.updateQueue=c,c!==null&&(n.flags|=4)}else{w=f.nodeType===9?f:f.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=tt(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=w.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof c.is=="string"?e=w.createElement(i,{is:c.is}):(e=w.createElement(i),i==="select"&&(w=e,c.multiple?w.multiple=!0:c.size&&(w.size=c.size))):e=w.createElementNS(e,i),e[xs]=n,e[Gi]=c,Fp(e,n,!1,!1),n.stateNode=e;e:{switch(w=Ln(i,c),i){case"dialog":pt("cancel",e),pt("close",e),f=c;break;case"iframe":case"object":case"embed":pt("load",e),f=c;break;case"video":case"audio":for(f=0;f<Wi.length;f++)pt(Wi[f],e);f=c;break;case"source":pt("error",e),f=c;break;case"img":case"image":case"link":pt("error",e),pt("load",e),f=c;break;case"details":pt("toggle",e),f=c;break;case"input":en(e,c),f=$e(e,c),pt("invalid",e);break;case"option":f=c;break;case"select":e._wrapperState={wasMultiple:!!c.multiple},f=B({},c,{value:void 0}),pt("invalid",e);break;case"textarea":Y(e,c),f=Dt(e,c),pt("invalid",e);break;default:f=c}ts(i,f),j=f;for(h in j)if(j.hasOwnProperty(h)){var L=j[h];h==="style"?ps(e,L):h==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,L!=null&&Ct(e,L)):h==="children"?typeof L=="string"?(i!=="textarea"||L!=="")&&an(e,L):typeof L=="number"&&an(e,""+L):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(l.hasOwnProperty(h)?L!=null&&h==="onScroll"&&pt("scroll",e):L!=null&&H(e,h,L,w))}switch(i){case"input":at(e),tn(e,c,!1);break;case"textarea":at(e),Ue(e);break;case"option":c.value!=null&&e.setAttribute("value",""+_e(c.value));break;case"select":e.multiple=!!c.multiple,h=c.value,h!=null?$t(e,!!c.multiple,h,!1):c.defaultValue!=null&&$t(e,!!c.multiple,c.defaultValue,!0);break;default:typeof f.onClick=="function"&&(e.onclick=ra)}switch(i){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}}c&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return dn(n),null;case 6:if(e&&n.stateNode!=null)Bp(e,n,e.memoizedProps,c);else{if(typeof c!="string"&&n.stateNode===null)throw Error(r(166));if(i=Cr(Qi.current),Cr(ws.current),da(n)){if(c=n.stateNode,i=n.memoizedProps,c[xs]=n,(h=c.nodeValue!==i)&&(e=Fn,e!==null))switch(e.tag){case 3:sa(c.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&sa(c.nodeValue,i,(e.mode&1)!==0)}h&&(n.flags|=4)}else c=(i.nodeType===9?i:i.ownerDocument).createTextNode(c),c[xs]=n,n.stateNode=c}return dn(n),null;case 13:if(ht(Tt),c=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(xt&&Un!==null&&(n.mode&1)!==0&&(n.flags&128)===0)Vf(),ri(),n.flags|=98560,h=!1;else if(h=da(n),c!==null&&c.dehydrated!==null){if(e===null){if(!h)throw Error(r(318));if(h=n.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(r(317));h[xs]=n}else ri(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;dn(n),h=!1}else ss!==null&&(lu(ss),ss=null),h=!0;if(!h)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=i,n):(c=c!==null,c!==(e!==null&&e.memoizedState!==null)&&c&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(Tt.current&1)!==0?Ut===0&&(Ut=3):du())),n.updateQueue!==null&&(n.flags|=4),dn(n),null);case 4:return li(),Qc(e,n),e===null&&Hi(n.stateNode.containerInfo),dn(n),null;case 10:return Nc(n.type._context),dn(n),null;case 17:return Cn(n.type)&&oa(),dn(n),null;case 19:if(ht(Tt),h=n.memoizedState,h===null)return dn(n),null;if(c=(n.flags&128)!==0,w=h.rendering,w===null)if(c)no(h,!1);else{if(Ut!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(w=va(e),w!==null){for(n.flags|=128,no(h,!1),c=w.updateQueue,c!==null&&(n.updateQueue=c,n.flags|=4),n.subtreeFlags=0,c=i,i=n.child;i!==null;)h=i,e=c,h.flags&=14680066,w=h.alternate,w===null?(h.childLanes=0,h.lanes=e,h.child=null,h.subtreeFlags=0,h.memoizedProps=null,h.memoizedState=null,h.updateQueue=null,h.dependencies=null,h.stateNode=null):(h.childLanes=w.childLanes,h.lanes=w.lanes,h.child=w.child,h.subtreeFlags=0,h.deletions=null,h.memoizedProps=w.memoizedProps,h.memoizedState=w.memoizedState,h.updateQueue=w.updateQueue,h.type=w.type,e=w.dependencies,h.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return ut(Tt,Tt.current&1|2),n.child}e=e.sibling}h.tail!==null&&kt()>fi&&(n.flags|=128,c=!0,no(h,!1),n.lanes=4194304)}else{if(!c)if(e=va(w),e!==null){if(n.flags|=128,c=!0,i=e.updateQueue,i!==null&&(n.updateQueue=i,n.flags|=4),no(h,!0),h.tail===null&&h.tailMode==="hidden"&&!w.alternate&&!xt)return dn(n),null}else 2*kt()-h.renderingStartTime>fi&&i!==1073741824&&(n.flags|=128,c=!0,no(h,!1),n.lanes=4194304);h.isBackwards?(w.sibling=n.child,n.child=w):(i=h.last,i!==null?i.sibling=w:n.child=w,h.last=w)}return h.tail!==null?(n=h.tail,h.rendering=n,h.tail=n.sibling,h.renderingStartTime=kt(),n.sibling=null,i=Tt.current,ut(Tt,c?i&1|2:i&1),n):(dn(n),null);case 22:case 23:return uu(),c=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==c&&(n.flags|=8192),c&&(n.mode&1)!==0?(Bn&1073741824)!==0&&(dn(n),n.subtreeFlags&6&&(n.flags|=8192)):dn(n),null;case 24:return null;case 25:return null}throw Error(r(156,n.tag))}function Sx(e,n){switch(xc(n),n.tag){case 1:return Cn(n.type)&&oa(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return li(),ht(jn),ht(cn),Ic(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Rc(n),null;case 13:if(ht(Tt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(r(340));ri()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return ht(Tt),null;case 4:return li(),null;case 10:return Nc(n.type._context),null;case 22:case 23:return uu(),null;case 24:return null;default:return null}}var ja=!1,fn=!1,bx=typeof WeakSet=="function"?WeakSet:Set,xe=null;function ui(e,n){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(c){Rt(e,n,c)}else i.current=null}function Zc(e,n,i){try{i()}catch(c){Rt(e,n,c)}}var Wp=!1;function Tx(e,n){if(uc=Go,e=kf(),nc(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var c=i.getSelection&&i.getSelection();if(c&&c.rangeCount!==0){i=c.anchorNode;var f=c.anchorOffset,h=c.focusNode;c=c.focusOffset;try{i.nodeType,h.nodeType}catch{i=null;break e}var w=0,j=-1,L=-1,V=0,ne=0,re=e,ee=null;t:for(;;){for(var ve;re!==i||f!==0&&re.nodeType!==3||(j=w+f),re!==h||c!==0&&re.nodeType!==3||(L=w+c),re.nodeType===3&&(w+=re.nodeValue.length),(ve=re.firstChild)!==null;)ee=re,re=ve;for(;;){if(re===e)break t;if(ee===i&&++V===f&&(j=w),ee===h&&++ne===c&&(L=w),(ve=re.nextSibling)!==null)break;re=ee,ee=re.parentNode}re=ve}i=j===-1||L===-1?null:{start:j,end:L}}else i=null}i=i||{start:0,end:0}}else i=null;for(dc={focusedElem:e,selectionRange:i},Go=!1,xe=n;xe!==null;)if(n=xe,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,xe=e;else for(;xe!==null;){n=xe;try{var ke=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(ke!==null){var Te=ke.memoizedProps,It=ke.memoizedState,U=n.stateNode,O=U.getSnapshotBeforeUpdate(n.elementType===n.type?Te:rs(n.type,Te),It);U.__reactInternalSnapshotBeforeUpdate=O}break;case 3:var W=n.stateNode.containerInfo;W.nodeType===1?W.textContent="":W.nodeType===9&&W.documentElement&&W.removeChild(W.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ce){Rt(n,n.return,ce)}if(e=n.sibling,e!==null){e.return=n.return,xe=e;break}xe=n.return}return ke=Wp,Wp=!1,ke}function so(e,n,i){var c=n.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var f=c=c.next;do{if((f.tag&e)===e){var h=f.destroy;f.destroy=void 0,h!==void 0&&Zc(n,i,h)}f=f.next}while(f!==c)}}function Ca(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var c=i.create;i.destroy=c()}i=i.next}while(i!==n)}}function Jc(e){var n=e.ref;if(n!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof n=="function"?n(e):n.current=e}}function Hp(e){var n=e.alternate;n!==null&&(e.alternate=null,Hp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[xs],delete n[Gi],delete n[mc],delete n[ox],delete n[ax])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Vp(e){return e.tag===5||e.tag===3||e.tag===4}function Gp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vp(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.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function eu(e,n,i){var c=e.tag;if(c===5||c===6)e=e.stateNode,n?i.nodeType===8?i.parentNode.insertBefore(e,n):i.insertBefore(e,n):(i.nodeType===8?(n=i.parentNode,n.insertBefore(e,i)):(n=i,n.appendChild(e)),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=ra));else if(c!==4&&(e=e.child,e!==null))for(eu(e,n,i),e=e.sibling;e!==null;)eu(e,n,i),e=e.sibling}function tu(e,n,i){var c=e.tag;if(c===5||c===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(c!==4&&(e=e.child,e!==null))for(tu(e,n,i),e=e.sibling;e!==null;)tu(e,n,i),e=e.sibling}var nn=null,is=!1;function er(e,n,i){for(i=i.child;i!==null;)Kp(e,n,i),i=i.sibling}function Kp(e,n,i){if($n&&typeof $n.onCommitFiberUnmount=="function")try{$n.onCommitFiberUnmount(vr,i)}catch{}switch(i.tag){case 5:fn||ui(i,n);case 6:var c=nn,f=is;nn=null,er(e,n,i),nn=c,is=f,nn!==null&&(is?(e=nn,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):nn.removeChild(i.stateNode));break;case 18:nn!==null&&(is?(e=nn,i=i.stateNode,e.nodeType===8?hc(e.parentNode,i):e.nodeType===1&&hc(e,i),Li(e)):hc(nn,i.stateNode));break;case 4:c=nn,f=is,nn=i.stateNode.containerInfo,is=!0,er(e,n,i),nn=c,is=f;break;case 0:case 11:case 14:case 15:if(!fn&&(c=i.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){f=c=c.next;do{var h=f,w=h.destroy;h=h.tag,w!==void 0&&((h&2)!==0||(h&4)!==0)&&Zc(i,n,w),f=f.next}while(f!==c)}er(e,n,i);break;case 1:if(!fn&&(ui(i,n),c=i.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=i.memoizedProps,c.state=i.memoizedState,c.componentWillUnmount()}catch(j){Rt(i,n,j)}er(e,n,i);break;case 21:er(e,n,i);break;case 22:i.mode&1?(fn=(c=fn)||i.memoizedState!==null,er(e,n,i),fn=c):er(e,n,i);break;default:er(e,n,i)}}function qp(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new bx),n.forEach(function(c){var f=Mx.bind(null,e,c);i.has(c)||(i.add(c),c.then(f,f))})}}function os(e,n){var i=n.deletions;if(i!==null)for(var c=0;c<i.length;c++){var f=i[c];try{var h=e,w=n,j=w;e:for(;j!==null;){switch(j.tag){case 5:nn=j.stateNode,is=!1;break e;case 3:nn=j.stateNode.containerInfo,is=!0;break e;case 4:nn=j.stateNode.containerInfo,is=!0;break e}j=j.return}if(nn===null)throw Error(r(160));Kp(h,w,f),nn=null,is=!1;var L=f.alternate;L!==null&&(L.return=null),f.return=null}catch(V){Rt(f,n,V)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)Yp(n,e),n=n.sibling}function Yp(e,n){var i=e.alternate,c=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(os(n,e),Ss(e),c&4){try{so(3,e,e.return),Ca(3,e)}catch(Te){Rt(e,e.return,Te)}try{so(5,e,e.return)}catch(Te){Rt(e,e.return,Te)}}break;case 1:os(n,e),Ss(e),c&512&&i!==null&&ui(i,i.return);break;case 5:if(os(n,e),Ss(e),c&512&&i!==null&&ui(i,i.return),e.flags&32){var f=e.stateNode;try{an(f,"")}catch(Te){Rt(e,e.return,Te)}}if(c&4&&(f=e.stateNode,f!=null)){var h=e.memoizedProps,w=i!==null?i.memoizedProps:h,j=e.type,L=e.updateQueue;if(e.updateQueue=null,L!==null)try{j==="input"&&h.type==="radio"&&h.name!=null&&Fe(f,h),Ln(j,w);var V=Ln(j,h);for(w=0;w<L.length;w+=2){var ne=L[w],re=L[w+1];ne==="style"?ps(f,re):ne==="dangerouslySetInnerHTML"?Ct(f,re):ne==="children"?an(f,re):H(f,ne,re,V)}switch(j){case"input":Ht(f,h);break;case"textarea":me(f,h);break;case"select":var ee=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!h.multiple;var ve=h.value;ve!=null?$t(f,!!h.multiple,ve,!1):ee!==!!h.multiple&&(h.defaultValue!=null?$t(f,!!h.multiple,h.defaultValue,!0):$t(f,!!h.multiple,h.multiple?[]:"",!1))}f[Gi]=h}catch(Te){Rt(e,e.return,Te)}}break;case 6:if(os(n,e),Ss(e),c&4){if(e.stateNode===null)throw Error(r(162));f=e.stateNode,h=e.memoizedProps;try{f.nodeValue=h}catch(Te){Rt(e,e.return,Te)}}break;case 3:if(os(n,e),Ss(e),c&4&&i!==null&&i.memoizedState.isDehydrated)try{Li(n.containerInfo)}catch(Te){Rt(e,e.return,Te)}break;case 4:os(n,e),Ss(e);break;case 13:os(n,e),Ss(e),f=e.child,f.flags&8192&&(h=f.memoizedState!==null,f.stateNode.isHidden=h,!h||f.alternate!==null&&f.alternate.memoizedState!==null||(ru=kt())),c&4&&qp(e);break;case 22:if(ne=i!==null&&i.memoizedState!==null,e.mode&1?(fn=(V=fn)||ne,os(n,e),fn=V):os(n,e),Ss(e),c&8192){if(V=e.memoizedState!==null,(e.stateNode.isHidden=V)&&!ne&&(e.mode&1)!==0)for(xe=e,ne=e.child;ne!==null;){for(re=xe=ne;xe!==null;){switch(ee=xe,ve=ee.child,ee.tag){case 0:case 11:case 14:case 15:so(4,ee,ee.return);break;case 1:ui(ee,ee.return);var ke=ee.stateNode;if(typeof ke.componentWillUnmount=="function"){c=ee,i=ee.return;try{n=c,ke.props=n.memoizedProps,ke.state=n.memoizedState,ke.componentWillUnmount()}catch(Te){Rt(c,i,Te)}}break;case 5:ui(ee,ee.return);break;case 22:if(ee.memoizedState!==null){Zp(re);continue}}ve!==null?(ve.return=ee,xe=ve):Zp(re)}ne=ne.sibling}e:for(ne=null,re=e;;){if(re.tag===5){if(ne===null){ne=re;try{f=re.stateNode,V?(h=f.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none"):(j=re.stateNode,L=re.memoizedProps.style,w=L!=null&&L.hasOwnProperty("display")?L.display:null,j.style.display=Dn("display",w))}catch(Te){Rt(e,e.return,Te)}}}else if(re.tag===6){if(ne===null)try{re.stateNode.nodeValue=V?"":re.memoizedProps}catch(Te){Rt(e,e.return,Te)}}else if((re.tag!==22&&re.tag!==23||re.memoizedState===null||re===e)&&re.child!==null){re.child.return=re,re=re.child;continue}if(re===e)break e;for(;re.sibling===null;){if(re.return===null||re.return===e)break e;ne===re&&(ne=null),re=re.return}ne===re&&(ne=null),re.sibling.return=re.return,re=re.sibling}}break;case 19:os(n,e),Ss(e),c&4&&qp(e);break;case 21:break;default:os(n,e),Ss(e)}}function Ss(e){var n=e.flags;if(n&2){try{e:{for(var i=e.return;i!==null;){if(Vp(i)){var c=i;break e}i=i.return}throw Error(r(160))}switch(c.tag){case 5:var f=c.stateNode;c.flags&32&&(an(f,""),c.flags&=-33);var h=Gp(e);tu(e,h,f);break;case 3:case 4:var w=c.stateNode.containerInfo,j=Gp(e);eu(e,j,w);break;default:throw Error(r(161))}}catch(L){Rt(e,e.return,L)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Nx(e,n,i){xe=e,Xp(e)}function Xp(e,n,i){for(var c=(e.mode&1)!==0;xe!==null;){var f=xe,h=f.child;if(f.tag===22&&c){var w=f.memoizedState!==null||ja;if(!w){var j=f.alternate,L=j!==null&&j.memoizedState!==null||fn;j=ja;var V=fn;if(ja=w,(fn=L)&&!V)for(xe=f;xe!==null;)w=xe,L=w.child,w.tag===22&&w.memoizedState!==null?Jp(f):L!==null?(L.return=w,xe=L):Jp(f);for(;h!==null;)xe=h,Xp(h),h=h.sibling;xe=f,ja=j,fn=V}Qp(e)}else(f.subtreeFlags&8772)!==0&&h!==null?(h.return=f,xe=h):Qp(e)}}function Qp(e){for(;xe!==null;){var n=xe;if((n.flags&8772)!==0){var i=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:fn||Ca(5,n);break;case 1:var c=n.stateNode;if(n.flags&4&&!fn)if(i===null)c.componentDidMount();else{var f=n.elementType===n.type?i.memoizedProps:rs(n.type,i.memoizedProps);c.componentDidUpdate(f,i.memoizedState,c.__reactInternalSnapshotBeforeUpdate)}var h=n.updateQueue;h!==null&&Zf(n,h,c);break;case 3:var w=n.updateQueue;if(w!==null){if(i=null,n.child!==null)switch(n.child.tag){case 5:i=n.child.stateNode;break;case 1:i=n.child.stateNode}Zf(n,w,i)}break;case 5:var j=n.stateNode;if(i===null&&n.flags&4){i=j;var L=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":L.autoFocus&&i.focus();break;case"img":L.src&&(i.src=L.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var V=n.alternate;if(V!==null){var ne=V.memoizedState;if(ne!==null){var re=ne.dehydrated;re!==null&&Li(re)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}fn||n.flags&512&&Jc(n)}catch(ee){Rt(n,n.return,ee)}}if(n===e){xe=null;break}if(i=n.sibling,i!==null){i.return=n.return,xe=i;break}xe=n.return}}function Zp(e){for(;xe!==null;){var n=xe;if(n===e){xe=null;break}var i=n.sibling;if(i!==null){i.return=n.return,xe=i;break}xe=n.return}}function Jp(e){for(;xe!==null;){var n=xe;try{switch(n.tag){case 0:case 11:case 15:var i=n.return;try{Ca(4,n)}catch(L){Rt(n,i,L)}break;case 1:var c=n.stateNode;if(typeof c.componentDidMount=="function"){var f=n.return;try{c.componentDidMount()}catch(L){Rt(n,f,L)}}var h=n.return;try{Jc(n)}catch(L){Rt(n,h,L)}break;case 5:var w=n.return;try{Jc(n)}catch(L){Rt(n,w,L)}}}catch(L){Rt(n,n.return,L)}if(n===e){xe=null;break}var j=n.sibling;if(j!==null){j.return=n.return,xe=j;break}xe=n.return}}var jx=Math.ceil,Ea=M.ReactCurrentDispatcher,nu=M.ReactCurrentOwner,Xn=M.ReactCurrentBatchConfig,Ye=0,Yt=null,Ot=null,sn=0,Bn=0,di=Ys(0),Ut=0,ro=null,_r=0,_a=0,su=0,io=null,_n=null,ru=0,fi=1/0,Os=null,Ra=!1,iu=null,tr=null,Aa=!1,nr=null,Ia=0,oo=0,ou=null,Ma=-1,Da=0;function Sn(){return(Ye&6)!==0?kt():Ma!==-1?Ma:Ma=kt()}function sr(e){return(e.mode&1)===0?1:(Ye&2)!==0&&sn!==0?sn&-sn:cx.transition!==null?(Da===0&&(Da=Ai()),Da):(e=Ke,e!==0||(e=window.event,e=e===void 0?16:ef(e.type)),e)}function as(e,n,i,c){if(50<oo)throw oo=0,ou=null,Error(r(185));kr(e,i,c),((Ye&2)===0||e!==Yt)&&(e===Yt&&((Ye&2)===0&&(_a|=i),Ut===4&&rr(e,sn)),Rn(e,c),i===1&&Ye===0&&(n.mode&1)===0&&(fi=kt()+500,la&&Qs()))}function Rn(e,n){var i=e.callbackNode;Wo(e,n);var c=wr(e,e===Yt?sn:0);if(c===0)i!==null&&_t(i),e.callbackNode=null,e.callbackPriority=0;else if(n=c&-c,e.callbackPriority!==n){if(i!=null&&_t(i),n===1)e.tag===0?lx(th.bind(null,e)):Ff(th.bind(null,e)),rx(function(){(Ye&6)===0&&Qs()}),i=null;else{switch(le(c)){case 1:i=Bs;break;case 4:i=ys;break;case 16:i=Br;break;case 536870912:i=Uo;break;default:i=Br}i=ch(i,eh.bind(null,e))}e.callbackPriority=n,e.callbackNode=i}}function eh(e,n){if(Ma=-1,Da=0,(Ye&6)!==0)throw Error(r(327));var i=e.callbackNode;if(pi()&&e.callbackNode!==i)return null;var c=wr(e,e===Yt?sn:0);if(c===0)return null;if((c&30)!==0||(c&e.expiredLanes)!==0||n)n=La(e,c);else{n=c;var f=Ye;Ye|=2;var h=sh();(Yt!==e||sn!==n)&&(Os=null,fi=kt()+500,Ar(e,n));do try{_x();break}catch(j){nh(e,j)}while(!0);Tc(),Ea.current=h,Ye=f,Ot!==null?n=0:(Yt=null,sn=0,n=Ut)}if(n!==0){if(n===2&&(f=Ri(e),f!==0&&(c=f,n=au(e,f))),n===1)throw i=ro,Ar(e,0),rr(e,c),Rn(e,kt()),i;if(n===6)rr(e,c);else{if(f=e.current.alternate,(c&30)===0&&!Cx(f)&&(n=La(e,c),n===2&&(h=Ri(e),h!==0&&(c=h,n=au(e,h))),n===1))throw i=ro,Ar(e,0),rr(e,c),Rn(e,kt()),i;switch(e.finishedWork=f,e.finishedLanes=c,n){case 0:case 1:throw Error(r(345));case 2:Ir(e,_n,Os);break;case 3:if(rr(e,c),(c&130023424)===c&&(n=ru+500-kt(),10<n)){if(wr(e,0)!==0)break;if(f=e.suspendedLanes,(f&c)!==c){Sn(),e.pingedLanes|=e.suspendedLanes&f;break}e.timeoutHandle=pc(Ir.bind(null,e,_n,Os),n);break}Ir(e,_n,Os);break;case 4:if(rr(e,c),(c&4194240)===c)break;for(n=e.eventTimes,f=-1;0<c;){var w=31-xn(c);h=1<<w,w=n[w],w>f&&(f=w),c&=~h}if(c=f,c=kt()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*jx(c/1960))-c,10<c){e.timeoutHandle=pc(Ir.bind(null,e,_n,Os),c);break}Ir(e,_n,Os);break;case 5:Ir(e,_n,Os);break;default:throw Error(r(329))}}}return Rn(e,kt()),e.callbackNode===i?eh.bind(null,e):null}function au(e,n){var i=io;return e.current.memoizedState.isDehydrated&&(Ar(e,n).flags|=256),e=La(e,n),e!==2&&(n=_n,_n=i,n!==null&&lu(n)),e}function lu(e){_n===null?_n=e:_n.push.apply(_n,e)}function Cx(e){for(var n=e;;){if(n.flags&16384){var i=n.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var c=0;c<i.length;c++){var f=i[c],h=f.getSnapshot;f=f.value;try{if(!ns(h(),f))return!1}catch{return!1}}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function rr(e,n){for(n&=~su,n&=~_a,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var i=31-xn(n),c=1<<i;e[i]=-1,n&=~c}}function th(e){if((Ye&6)!==0)throw Error(r(327));pi();var n=wr(e,0);if((n&1)===0)return Rn(e,kt()),null;var i=La(e,n);if(e.tag!==0&&i===2){var c=Ri(e);c!==0&&(n=c,i=au(e,c))}if(i===1)throw i=ro,Ar(e,0),rr(e,n),Rn(e,kt()),i;if(i===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Ir(e,_n,Os),Rn(e,kt()),null}function cu(e,n){var i=Ye;Ye|=1;try{return e(n)}finally{Ye=i,Ye===0&&(fi=kt()+500,la&&Qs())}}function Rr(e){nr!==null&&nr.tag===0&&(Ye&6)===0&&pi();var n=Ye;Ye|=1;var i=Xn.transition,c=Ke;try{if(Xn.transition=null,Ke=1,e)return e()}finally{Ke=c,Xn.transition=i,Ye=n,(Ye&6)===0&&Qs()}}function uu(){Bn=di.current,ht(di)}function Ar(e,n){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,sx(i)),Ot!==null)for(i=Ot.return;i!==null;){var c=i;switch(xc(c),c.tag){case 1:c=c.type.childContextTypes,c!=null&&oa();break;case 3:li(),ht(jn),ht(cn),Ic();break;case 5:Rc(c);break;case 4:li();break;case 13:ht(Tt);break;case 19:ht(Tt);break;case 10:Nc(c.type._context);break;case 22:case 23:uu()}i=i.return}if(Yt=e,Ot=e=ir(e.current,null),sn=Bn=n,Ut=0,ro=null,su=_a=_r=0,_n=io=null,jr!==null){for(n=0;n<jr.length;n++)if(i=jr[n],c=i.interleaved,c!==null){i.interleaved=null;var f=c.next,h=i.pending;if(h!==null){var w=h.next;h.next=f,c.next=w}i.pending=c}jr=null}return e}function nh(e,n){do{var i=Ot;try{if(Tc(),ya.current=Sa,xa){for(var c=Nt.memoizedState;c!==null;){var f=c.queue;f!==null&&(f.pending=null),c=c.next}xa=!1}if(Er=0,qt=Ft=Nt=null,Zi=!1,Ji=0,nu.current=null,i===null||i.return===null){Ut=1,ro=n,Ot=null;break}e:{var h=e,w=i.return,j=i,L=n;if(n=sn,j.flags|=32768,L!==null&&typeof L=="object"&&typeof L.then=="function"){var V=L,ne=j,re=ne.tag;if((ne.mode&1)===0&&(re===0||re===11||re===15)){var ee=ne.alternate;ee?(ne.updateQueue=ee.updateQueue,ne.memoizedState=ee.memoizedState,ne.lanes=ee.lanes):(ne.updateQueue=null,ne.memoizedState=null)}var ve=Cp(w);if(ve!==null){ve.flags&=-257,Ep(ve,w,j,h,n),ve.mode&1&&jp(h,V,n),n=ve,L=V;var ke=n.updateQueue;if(ke===null){var Te=new Set;Te.add(L),n.updateQueue=Te}else ke.add(L);break e}else{if((n&1)===0){jp(h,V,n),du();break e}L=Error(r(426))}}else if(xt&&j.mode&1){var It=Cp(w);if(It!==null){(It.flags&65536)===0&&(It.flags|=256),Ep(It,w,j,h,n),Sc(ci(L,j));break e}}h=L=ci(L,j),Ut!==4&&(Ut=2),io===null?io=[h]:io.push(h),h=w;do{switch(h.tag){case 3:h.flags|=65536,n&=-n,h.lanes|=n;var U=Tp(h,L,n);Qf(h,U);break e;case 1:j=L;var O=h.type,W=h.stateNode;if((h.flags&128)===0&&(typeof O.getDerivedStateFromError=="function"||W!==null&&typeof W.componentDidCatch=="function"&&(tr===null||!tr.has(W)))){h.flags|=65536,n&=-n,h.lanes|=n;var ce=Np(h,j,n);Qf(h,ce);break e}}h=h.return}while(h!==null)}ih(i)}catch(je){n=je,Ot===i&&i!==null&&(Ot=i=i.return);continue}break}while(!0)}function sh(){var e=Ea.current;return Ea.current=Sa,e===null?Sa:e}function du(){(Ut===0||Ut===3||Ut===2)&&(Ut=4),Yt===null||(_r&268435455)===0&&(_a&268435455)===0||rr(Yt,sn)}function La(e,n){var i=Ye;Ye|=2;var c=sh();(Yt!==e||sn!==n)&&(Os=null,Ar(e,n));do try{Ex();break}catch(f){nh(e,f)}while(!0);if(Tc(),Ye=i,Ea.current=c,Ot!==null)throw Error(r(261));return Yt=null,sn=0,Ut}function Ex(){for(;Ot!==null;)rh(Ot)}function _x(){for(;Ot!==null&&!gs();)rh(Ot)}function rh(e){var n=lh(e.alternate,e,Bn);e.memoizedProps=e.pendingProps,n===null?ih(e):Ot=n,nu.current=null}function ih(e){var n=e;do{var i=n.alternate;if(e=n.return,(n.flags&32768)===0){if(i=kx(i,n,Bn),i!==null){Ot=i;return}}else{if(i=Sx(i,n),i!==null){i.flags&=32767,Ot=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ut=6,Ot=null;return}}if(n=n.sibling,n!==null){Ot=n;return}Ot=n=e}while(n!==null);Ut===0&&(Ut=5)}function Ir(e,n,i){var c=Ke,f=Xn.transition;try{Xn.transition=null,Ke=1,Rx(e,n,i,c)}finally{Xn.transition=f,Ke=c}return null}function Rx(e,n,i,c){do pi();while(nr!==null);if((Ye&6)!==0)throw Error(r(327));i=e.finishedWork;var f=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var h=i.lanes|i.childLanes;if(Ho(e,h),e===Yt&&(Ot=Yt=null,sn=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||Aa||(Aa=!0,ch(Br,function(){return pi(),null})),h=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||h){h=Xn.transition,Xn.transition=null;var w=Ke;Ke=1;var j=Ye;Ye|=4,nu.current=null,Tx(e,i),Yp(i,e),Xy(dc),Go=!!uc,dc=uc=null,e.current=i,Nx(i),Hl(),Ye=j,Ke=w,Xn.transition=h}else e.current=i;if(Aa&&(Aa=!1,nr=e,Ia=f),h=e.pendingLanes,h===0&&(tr=null),Wr(i.stateNode),Rn(e,kt()),n!==null)for(c=e.onRecoverableError,i=0;i<n.length;i++)f=n[i],c(f.value,{componentStack:f.stack,digest:f.digest});if(Ra)throw Ra=!1,e=iu,iu=null,e;return(Ia&1)!==0&&e.tag!==0&&pi(),h=e.pendingLanes,(h&1)!==0?e===ou?oo++:(oo=0,ou=e):oo=0,Qs(),null}function pi(){if(nr!==null){var e=le(Ia),n=Xn.transition,i=Ke;try{if(Xn.transition=null,Ke=16>e?16:e,nr===null)var c=!1;else{if(e=nr,nr=null,Ia=0,(Ye&6)!==0)throw Error(r(331));var f=Ye;for(Ye|=4,xe=e.current;xe!==null;){var h=xe,w=h.child;if((xe.flags&16)!==0){var j=h.deletions;if(j!==null){for(var L=0;L<j.length;L++){var V=j[L];for(xe=V;xe!==null;){var ne=xe;switch(ne.tag){case 0:case 11:case 15:so(8,ne,h)}var re=ne.child;if(re!==null)re.return=ne,xe=re;else for(;xe!==null;){ne=xe;var ee=ne.sibling,ve=ne.return;if(Hp(ne),ne===V){xe=null;break}if(ee!==null){ee.return=ve,xe=ee;break}xe=ve}}}var ke=h.alternate;if(ke!==null){var Te=ke.child;if(Te!==null){ke.child=null;do{var It=Te.sibling;Te.sibling=null,Te=It}while(Te!==null)}}xe=h}}if((h.subtreeFlags&2064)!==0&&w!==null)w.return=h,xe=w;else e:for(;xe!==null;){if(h=xe,(h.flags&2048)!==0)switch(h.tag){case 0:case 11:case 15:so(9,h,h.return)}var U=h.sibling;if(U!==null){U.return=h.return,xe=U;break e}xe=h.return}}var O=e.current;for(xe=O;xe!==null;){w=xe;var W=w.child;if((w.subtreeFlags&2064)!==0&&W!==null)W.return=w,xe=W;else e:for(w=O;xe!==null;){if(j=xe,(j.flags&2048)!==0)try{switch(j.tag){case 0:case 11:case 15:Ca(9,j)}}catch(je){Rt(j,j.return,je)}if(j===w){xe=null;break e}var ce=j.sibling;if(ce!==null){ce.return=j.return,xe=ce;break e}xe=j.return}}if(Ye=f,Qs(),$n&&typeof $n.onPostCommitFiberRoot=="function")try{$n.onPostCommitFiberRoot(vr,e)}catch{}c=!0}return c}finally{Ke=i,Xn.transition=n}}return!1}function oh(e,n,i){n=ci(i,n),n=Tp(e,n,1),e=Js(e,n,1),n=Sn(),e!==null&&(kr(e,1,n),Rn(e,n))}function Rt(e,n,i){if(e.tag===3)oh(e,e,i);else for(;n!==null;){if(n.tag===3){oh(n,e,i);break}else if(n.tag===1){var c=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(tr===null||!tr.has(c))){e=ci(i,e),e=Np(n,e,1),n=Js(n,e,1),e=Sn(),n!==null&&(kr(n,1,e),Rn(n,e));break}}n=n.return}}function Ax(e,n,i){var c=e.pingCache;c!==null&&c.delete(n),n=Sn(),e.pingedLanes|=e.suspendedLanes&i,Yt===e&&(sn&i)===i&&(Ut===4||Ut===3&&(sn&130023424)===sn&&500>kt()-ru?Ar(e,0):su|=i),Rn(e,n)}function ah(e,n){n===0&&((e.mode&1)===0?n=1:(n=Vr,Vr<<=1,(Vr&130023424)===0&&(Vr=4194304)));var i=Sn();e=Ms(e,n),e!==null&&(kr(e,n,i),Rn(e,i))}function Ix(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),ah(e,i)}function Mx(e,n){var i=0;switch(e.tag){case 13:var c=e.stateNode,f=e.memoizedState;f!==null&&(i=f.retryLane);break;case 19:c=e.stateNode;break;default:throw Error(r(314))}c!==null&&c.delete(n),ah(e,i)}var lh;lh=function(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps||jn.current)En=!0;else{if((e.lanes&i)===0&&(n.flags&128)===0)return En=!1,wx(e,n,i);En=(e.flags&131072)!==0}else En=!1,xt&&(n.flags&1048576)!==0&&Uf(n,ua,n.index);switch(n.lanes=0,n.tag){case 2:var c=n.type;Na(e,n),e=n.pendingProps;var f=ti(n,cn.current);ai(n,i),f=Lc(null,n,c,e,f,i);var h=Oc();return n.flags|=1,typeof f=="object"&&f!==null&&typeof f.render=="function"&&f.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Cn(c)?(h=!0,aa(n)):h=!1,n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,Ec(n),f.updater=ba,n.stateNode=f,f._reactInternals=n,Bc(n,c,e,i),n=Gc(null,n,c,!0,h,i)):(n.tag=0,xt&&h&&yc(n),kn(null,n,f,i),n=n.child),n;case 16:c=n.elementType;e:{switch(Na(e,n),e=n.pendingProps,f=c._init,c=f(c._payload),n.type=c,f=n.tag=Lx(c),e=rs(c,e),f){case 0:n=Vc(null,n,c,e,i);break e;case 1:n=Dp(null,n,c,e,i);break e;case 11:n=_p(null,n,c,e,i);break e;case 14:n=Rp(null,n,c,rs(c.type,e),i);break e}throw Error(r(306,c,""))}return n;case 0:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:rs(c,f),Vc(e,n,c,f,i);case 1:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:rs(c,f),Dp(e,n,c,f,i);case 3:e:{if(Lp(n),e===null)throw Error(r(387));c=n.pendingProps,h=n.memoizedState,f=h.element,Xf(e,n),ga(n,c,null,i);var w=n.memoizedState;if(c=w.element,h.isDehydrated)if(h={element:c,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){f=ci(Error(r(423)),n),n=Op(e,n,c,i,f);break e}else if(c!==f){f=ci(Error(r(424)),n),n=Op(e,n,c,i,f);break e}else for(Un=qs(n.stateNode.containerInfo.firstChild),Fn=n,xt=!0,ss=null,i=qf(n,null,c,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(ri(),c===f){n=Ls(e,n,i);break e}kn(e,n,c,i)}n=n.child}return n;case 5:return Jf(n),e===null&&kc(n),c=n.type,f=n.pendingProps,h=e!==null?e.memoizedProps:null,w=f.children,fc(c,f)?w=null:h!==null&&fc(c,h)&&(n.flags|=32),Mp(e,n),kn(e,n,w,i),n.child;case 6:return e===null&&kc(n),null;case 13:return Pp(e,n,i);case 4:return _c(n,n.stateNode.containerInfo),c=n.pendingProps,e===null?n.child=ii(n,null,c,i):kn(e,n,c,i),n.child;case 11:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:rs(c,f),_p(e,n,c,f,i);case 7:return kn(e,n,n.pendingProps,i),n.child;case 8:return kn(e,n,n.pendingProps.children,i),n.child;case 12:return kn(e,n,n.pendingProps.children,i),n.child;case 10:e:{if(c=n.type._context,f=n.pendingProps,h=n.memoizedProps,w=f.value,ut(pa,c._currentValue),c._currentValue=w,h!==null)if(ns(h.value,w)){if(h.children===f.children&&!jn.current){n=Ls(e,n,i);break e}}else for(h=n.child,h!==null&&(h.return=n);h!==null;){var j=h.dependencies;if(j!==null){w=h.child;for(var L=j.firstContext;L!==null;){if(L.context===c){if(h.tag===1){L=Ds(-1,i&-i),L.tag=2;var V=h.updateQueue;if(V!==null){V=V.shared;var ne=V.pending;ne===null?L.next=L:(L.next=ne.next,ne.next=L),V.pending=L}}h.lanes|=i,L=h.alternate,L!==null&&(L.lanes|=i),jc(h.return,i,n),j.lanes|=i;break}L=L.next}}else if(h.tag===10)w=h.type===n.type?null:h.child;else if(h.tag===18){if(w=h.return,w===null)throw Error(r(341));w.lanes|=i,j=w.alternate,j!==null&&(j.lanes|=i),jc(w,i,n),w=h.sibling}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===n){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}kn(e,n,f.children,i),n=n.child}return n;case 9:return f=n.type,c=n.pendingProps.children,ai(n,i),f=qn(f),c=c(f),n.flags|=1,kn(e,n,c,i),n.child;case 14:return c=n.type,f=rs(c,n.pendingProps),f=rs(c.type,f),Rp(e,n,c,f,i);case 15:return Ap(e,n,n.type,n.pendingProps,i);case 17:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:rs(c,f),Na(e,n),n.tag=1,Cn(c)?(e=!0,aa(n)):e=!1,ai(n,i),Sp(n,c,f),Bc(n,c,f,i),Gc(null,n,c,!0,e,i);case 19:return zp(e,n,i);case 22:return Ip(e,n,i)}throw Error(r(156,n.tag))};function ch(e,n){return Qe(e,n)}function Dx(e,n,i,c){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(e,n,i,c){return new Dx(e,n,i,c)}function fu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Lx(e){if(typeof e=="function")return fu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Se)return 11;if(e===Z)return 14}return 2}function ir(e,n){var i=e.alternate;return i===null?(i=Qn(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function Oa(e,n,i,c,f,h){var w=2;if(c=e,typeof e=="function")fu(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case G:return Mr(i.children,f,h,n);case $:w=8,f|=8;break;case te:return e=Qn(12,i,n,f|2),e.elementType=te,e.lanes=h,e;case q:return e=Qn(13,i,n,f),e.elementType=q,e.lanes=h,e;case we:return e=Qn(19,i,n,f),e.elementType=we,e.lanes=h,e;case ae:return Pa(i,f,h,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case he:w=10;break e;case ue:w=9;break e;case Se:w=11;break e;case Z:w=14;break e;case oe:w=16,c=null;break e}throw Error(r(130,e==null?e:typeof e,""))}return n=Qn(w,i,n,f),n.elementType=e,n.type=c,n.lanes=h,n}function Mr(e,n,i,c){return e=Qn(7,e,c,n),e.lanes=i,e}function Pa(e,n,i,c){return e=Qn(22,e,c,n),e.elementType=ae,e.lanes=i,e.stateNode={isHidden:!1},e}function pu(e,n,i){return e=Qn(6,e,null,n),e.lanes=i,e}function hu(e,n,i){return n=Qn(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Ox(e,n,i,c,f){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ii(0),this.expirationTimes=Ii(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ii(0),this.identifierPrefix=c,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function mu(e,n,i,c,f,h,w,j,L){return e=new Ox(e,n,i,j,L),n===1?(n=1,h===!0&&(n|=8)):n=0,h=Qn(3,null,null,n),e.current=h,h.stateNode=e,h.memoizedState={element:c,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ec(h),e}function Px(e,n,i){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:K,key:c==null?null:""+c,children:e,containerInfo:n,implementation:i}}function uh(e){if(!e)return Xs;e=e._reactInternals;e:{if(Be(e)!==e||e.tag!==1)throw Error(r(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(Cn(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(r(171))}if(e.tag===1){var i=e.type;if(Cn(i))return $f(e,i,n)}return n}function dh(e,n,i,c,f,h,w,j,L){return e=mu(i,c,!0,e,f,h,w,j,L),e.context=uh(null),i=e.current,c=Sn(),f=sr(i),h=Ds(c,f),h.callback=n??null,Js(i,h,f),e.current.lanes=f,kr(e,f,c),Rn(e,c),e}function $a(e,n,i,c){var f=n.current,h=Sn(),w=sr(f);return i=uh(i),n.context===null?n.context=i:n.pendingContext=i,n=Ds(h,w),n.payload={element:e},c=c===void 0?null:c,c!==null&&(n.callback=c),e=Js(f,n,w),e!==null&&(as(e,f,w,h),ma(e,f,w)),w}function za(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function fh(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<n?i:n}}function gu(e,n){fh(e,n),(e=e.alternate)&&fh(e,n)}function $x(){return null}var ph=typeof reportError=="function"?reportError:function(e){console.error(e)};function vu(e){this._internalRoot=e}Fa.prototype.render=vu.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(r(409));$a(e,n,null,null)},Fa.prototype.unmount=vu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Rr(function(){$a(null,e,null,null)}),n[_s]=null}};function Fa(e){this._internalRoot=e}Fa.prototype.unstable_scheduleHydration=function(e){if(e){var n=be();e={blockedOn:null,target:e,priority:n};for(var i=0;i<Vs.length&&n!==0&&n<Vs[i].priority;i++);Vs.splice(i,0,e),i===0&&Zd(e)}};function yu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ua(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hh(){}function zx(e,n,i,c,f){if(f){if(typeof c=="function"){var h=c;c=function(){var V=za(w);h.call(V)}}var w=dh(n,c,e,0,null,!1,!1,"",hh);return e._reactRootContainer=w,e[_s]=w.current,Hi(e.nodeType===8?e.parentNode:e),Rr(),w}for(;f=e.lastChild;)e.removeChild(f);if(typeof c=="function"){var j=c;c=function(){var V=za(L);j.call(V)}}var L=mu(e,0,!1,null,null,!1,!1,"",hh);return e._reactRootContainer=L,e[_s]=L.current,Hi(e.nodeType===8?e.parentNode:e),Rr(function(){$a(n,L,i,c)}),L}function Ba(e,n,i,c,f){var h=i._reactRootContainer;if(h){var w=h;if(typeof f=="function"){var j=f;f=function(){var L=za(w);j.call(L)}}$a(n,w,e,f)}else w=zx(i,n,e,f,c);return za(w)}b=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var i=xr(n.pendingLanes);i!==0&&(Hs(n,i|1),Rn(n,kt()),(Ye&6)===0&&(fi=kt()+500,Qs()))}break;case 13:Rr(function(){var c=Ms(e,1);if(c!==null){var f=Sn();as(c,e,1,f)}}),gu(e,1)}},F=function(e){if(e.tag===13){var n=Ms(e,134217728);if(n!==null){var i=Sn();as(n,e,134217728,i)}gu(e,134217728)}},J=function(e){if(e.tag===13){var n=sr(e),i=Ms(e,n);if(i!==null){var c=Sn();as(i,e,n,c)}gu(e,n)}},be=function(){return Ke},Ce=function(e,n){var i=Ke;try{return Ke=e,n()}finally{Ke=i}},Vt=function(e,n,i){switch(n){case"input":if(Ht(e,i),n=i.name,i.type==="radio"&&n!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<i.length;n++){var c=i[n];if(c!==e&&c.form===e.form){var f=ia(c);if(!f)throw Error(r(90));De(c),Ht(c,f)}}}break;case"textarea":me(e,i);break;case"select":n=i.value,n!=null&&$t(e,!!i.multiple,n,!1)}},vt=cu,yt=Rr;var Fx={usingClientEntryPoint:!1,Events:[Ki,Jr,ia,ft,Gt,cu]},ao={findFiberByHostInstance:Sr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ux={bundleType:ao.bundleType,version:ao.version,rendererPackageName:ao.rendererPackageName,rendererConfig:ao.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:M.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Pn(e),e===null?null:e.stateNode},findFiberByHostInstance:ao.findFiberByHostInstance||$x,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Wa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wa.isDisabled&&Wa.supportsFiber)try{vr=Wa.inject(Ux),$n=Wa}catch{}}return An.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Fx,An.createPortal=function(e,n){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!yu(n))throw Error(r(200));return Px(e,n,null,i)},An.createRoot=function(e,n){if(!yu(e))throw Error(r(299));var i=!1,c="",f=ph;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onRecoverableError!==void 0&&(f=n.onRecoverableError)),n=mu(e,1,!1,null,null,i,!1,c,f),e[_s]=n.current,Hi(e.nodeType===8?e.parentNode:e),new vu(n)},An.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=Pn(n),e=e===null?null:e.stateNode,e},An.flushSync=function(e){return Rr(e)},An.hydrate=function(e,n,i){if(!Ua(n))throw Error(r(200));return Ba(null,e,n,!0,i)},An.hydrateRoot=function(e,n,i){if(!yu(e))throw Error(r(405));var c=i!=null&&i.hydratedSources||null,f=!1,h="",w=ph;if(i!=null&&(i.unstable_strictMode===!0&&(f=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),n=dh(n,null,e,1,i??null,f,!1,h,w),e[_s]=n.current,Hi(e),c)for(e=0;e<c.length;e++)i=c[e],f=i._getVersion,f=f(i._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[i,f]:n.mutableSourceEagerHydrationData.push(i,f);return new Fa(n)},An.render=function(e,n,i){if(!Ua(n))throw Error(r(200));return Ba(null,e,n,!1,i)},An.unmountComponentAtNode=function(e){if(!Ua(e))throw Error(r(40));return e._reactRootContainer?(Rr(function(){Ba(null,null,e,!1,function(){e._reactRootContainer=null,e[_s]=null})}),!0):!1},An.unstable_batchedUpdates=cu,An.unstable_renderSubtreeIntoContainer=function(e,n,i,c){if(!Ua(i))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Ba(e,n,i,!1,c)},An.version="18.3.1-next-f1338f8080-20240426",An}var Sh;function xg(){if(Sh)return ku.exports;Sh=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(s){console.error(s)}}return t(),ku.exports=Xx(),ku.exports}var bh;function Qx(){if(bh)return Ha;bh=1;var t=xg();return Ha.createRoot=t.createRoot,Ha.hydrateRoot=t.hydrateRoot,Ha}var Zx=Qx();const Jx=yg(Zx),Th=t=>{let s;const r=new Set,o=(m,v)=>{const k=typeof m=="function"?m(s):m;if(!Object.is(k,s)){const y=s;s=v??(typeof k!="object"||k===null)?k:Object.assign({},s,k),r.forEach(S=>S(s,y))}},l=()=>s,p={setState:o,getState:l,getInitialState:()=>g,subscribe:m=>(r.add(m),()=>r.delete(m))},g=s=t(o,l,p);return p},e0=(t=>t?Th(t):Th),t0=t=>t;function n0(t,s=t0){const r=ot.useSyncExternalStore(t.subscribe,ot.useCallback(()=>s(t.getState()),[t,s]),ot.useCallback(()=>s(t.getInitialState()),[t,s]));return ot.useDebugValue(r),r}const s0=t=>{const s=e0(t),r=o=>n0(s,o);return Object.assign(r,s),r},r0=(t=>s0),wg="agentpane:machines",kg="agentpane:active-machine";function i0(t){return/^[a-z][a-z0-9-]{1,30}$/.test(t)}function Sg(t){return`${t}.repoburg.com`}function bg(t){const s=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(t);return s?s[1]:null}function Tg(t,s){try{const r=localStorage.getItem(t);return r==null?s:JSON.parse(r)}catch{return s}}function Ng(t,s){try{localStorage.setItem(t,JSON.stringify(s))}catch{}}function o0(t){const{mahlas:s,hostname:r}=t??{};return typeof s=="string"&&i0(s)&&r===Sg(s)}function jg(){const t=Tg(wg,[]);return Array.isArray(t)?t.filter(o0):[]}function a0(t){const s={mahlas:t,hostname:Sg(t),lastConnectedAt:new Date().toISOString()},r=jg(),o=[s,...r.filter(l=>l.mahlas!==t)];return Ng(wg,o),s}function l0(){const t=Tg(kg,null);return t?jg().find(s=>s.mahlas===t)??null:null}function c0(t){Ng(kg,t)}function u0(){if(typeof window>"u")return;const t=new URLSearchParams(window.location.search).get("host");if(!t)return;const s=bg(t);s&&(a0(s),c0(s))}const Nh="http://localhost:9998",d0=["agent.repoburg.com"];function mn(){if(typeof window>"u")return"";const t=new URLSearchParams(window.location.search),s=t.get("bport");if(s)return`http://localhost:${s}`;const r=t.get("host");if(r)return`https://${r}`;const o=window.location.hostname;if(d0.includes(o))return Nh;if(bg(o))return"";const l=l0();return l?`https://${l.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":Nh}function f0(t){const s=mn();return s?`${s.replace(/^http/,"ws")}${t}`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${t}`}const p0="/api";class yd extends Error{constructor(r,o,l){super(r);rt(this,"status");rt(this,"body");this.name="ApiError",this.status=o,this.body=l}}function Pr(t){var s;if(t instanceof yd){const r=(s=t.body)==null?void 0:s.error;if(typeof r=="string"&&r)return r}return t instanceof Error?t.message:String(t)}async function Mo(t,s,r){const o=await fetch(`${mn()}${p0}${s}`,{method:t,headers:r?{"Content-Type":"application/json"}:void 0,body:r?JSON.stringify(r):void 0});if(!o.ok){let l=`${o.status} ${o.statusText}`,u=null;try{u=await o.json();const d=u==null?void 0:u.error;typeof d=="string"&&d&&(l=`${l} — ${d}`)}catch{}throw new yd(`${t} ${s} failed: ${l}`,o.status,u)}return o.json()}function Wt(t){return Mo("GET",t)}function ct(t,s){return Mo("POST",t,s)}function Rl(t){return Mo("DELETE",t)}function Ns(t,s){return Mo("PATCH",t,s)}function h0(t,s){return Mo("PUT",t,s)}function m0(){return Wt("/sessions")}function co(t){return Wt(`/sessions/${t}`)}function xd(t){return ct("/sessions",t)}function jh(t){return Rl(`/sessions/${t}`)}function Cg(t,s,r,o){return ct(`/sessions/${t}/turns`,{user_prompt:s,...r!=null&&r.length?{attachments:r}:{},...o!=null&&o.originAppId?{origin_app_id:o.originAppId}:{}})}function g0(t){return ct(`/sessions/${t}/cancel`)}function v0(t,s){return ct(`/sessions/${t}/turns/${s}/resume`)}function y0(){return ct("/turns/resume-signed-out")}function x0(t,s){return Ns(`/sessions/${t}`,{title:s})}function Ch(t){return Ns(`/sessions/${t}`,{lifecycle:"finished"})}function Eh(t){return Ns(`/sessions/${t}`,{lifecycle:"working"})}function w0(t,s){return Ns(`/sessions/${t}`,{starred:s})}function _h(t){return Ns(`/sessions/${t}`,{has_unreviewed:0})}function k0(t,s,r,o){const l={model:s,model_reasoning_effort:r};return o!==void 0&&(l.runtime_type=o),Ns(`/sessions/${t}`,l)}function S0(t,s){return Ns(`/sessions/${t}`,{runtime_config:s})}function b0(t,s){return ct(`/sessions/${t}/rewind`,{turn_id:s})}function T0(t){return ct(`/sessions/${t}/restore`,{})}function N0(t,s,r){return ct(`/sessions/${t}/branch`,{turn_id:s,title:r})}function Eg(){return Wt("/workspaces")}function j0(t,s){return ct("/workspaces",{path:t,label:s})}function C0(t){return ct("/workspaces/hide",{path:t})}function E0(){return Wt("/workspaces/picker")}function Rh(t){return Wt(t?`/workspaces/browse?path=${encodeURIComponent(t)}`:"/workspaces/browse")}async function _0(){const t=await fetch(`${mn()}/api/pick-directory`);if(t.status===204)return{cancelled:!0};if(!t.ok)throw new Error(`GET /api/pick-directory failed: ${t.status} ${t.statusText}`);return t.json()}function _g(){return Wt("/folders")}function R0(t,s){return ct("/folders",{workspace_path:t,name:s})}function Ah(t,s){return Ns(`/folders/${t}`,s)}function A0(t){return Rl(`/folders/${t}`)}function I0(t){return ct("/sessions/reorder",{moves:t})}function hr(t){return t.status==="pending"||t.status==="running"}function Rg(t){return!!(t!=null&&t.turns.some(hr))}function Al(t){return t?t.turns.some(hr)||(t.threads??[]).some(s=>(s.turns??[]).some(hr)):!1}const M0="s:",Ku="a:",$r=t=>`${M0}${t}`,To=t=>`${Ku}${t}`;function fr(t){return{kind:t.startsWith(Ku)?"app":"session",id:t.slice(Ku.length)}}function wd(t){return t.activeAppTabId!==null?To(t.activeAppTabId):t.activeSessionId===null?null:$r(t.activeSessionId)}function Ag(t,s,r){const o=[...s.map($r),...r.map(To)],l=new Set(o),u=t.filter(g=>l.has(g)),d=new Set(u),p=o.filter(g=>!d.has(g));return p.length===0&&u.length===t.length?t:[...u,...p]}function D0(t){return t.subscribe((s,r)=>{if(s.openTabs===r.openTabs&&s.openAppTabs===r.openAppTabs)return;const o=Ag(s.tabOrder,s.openTabs,s.openAppTabs);o!==s.tabOrder&&t.setState({tabOrder:o})})}function Ih(t,s,r){const o=t.indexOf(s);return t.slice(o+1).find(r)??t.slice(0,Math.max(o,0)).reverse().find(r)??null}function kd(t,s){const r=d=>!s.has(d),o=wd(t);let{activeSessionId:l,activeAppTabId:u}=t;if(o!==null&&s.has(o)){const d=Ih(t.tabOrder,o,r),p=d===null?null:fr(d);u=(p==null?void 0:p.kind)==="app"?p.id:null,(p==null?void 0:p.kind)==="session"&&(l=p.id)}if(l!==null&&s.has($r(l))){const d=g=>r(g)&&fr(g).kind==="session",p=Ih(t.tabOrder,$r(l),d);l=p===null?null:fr(p).id}return{activeSessionId:l,activeAppTabId:u}}function Ig(t,s){if(t.tabOrder.includes(s))return!1;const{kind:r,id:o}=fr(s);return(r==="app"?t.apps:t.sessions).some(u=>u.id===o)}const Mg=1;function Dg(){let t="";try{t=mn()}catch{}return`agentpane:tabs:${t||window.location.origin}`}function Tu(t){return Array.isArray(t)&&t.every(s=>typeof s=="string")}function Mh(t){return t===null||typeof t=="string"}function L0(t){if(t==null)return null;let s;try{s=JSON.parse(t)}catch{return null}if(typeof s!="object"||s===null)return null;const r=s;return r.v!==Mg||!Tu(r.openTabs)||!Mh(r.activeSessionId)||!Tu(r.openAppTabs)||!Mh(r.activeAppTabId)?null:{openTabs:r.openTabs,activeSessionId:r.activeSessionId,openAppTabs:r.openAppTabs,activeAppTabId:r.activeAppTabId,tabOrder:Tu(r.tabOrder)?r.tabOrder:[]}}const Lg=[()=>window.sessionStorage,()=>window.localStorage];function O0(){const t=Dg();for(const s of Lg)try{const r=L0(s().getItem(t));if(r)return r}catch{}return null}function P0(t){const s=Dg(),r=JSON.stringify({v:Mg,openTabs:t.openTabs,activeSessionId:t.activeSessionId,openAppTabs:t.openAppTabs,activeAppTabId:t.activeAppTabId,tabOrder:t.tabOrder});for(const o of Lg)try{o().setItem(s,r)}catch{}}function $0(t){return t.subscribe((s,r)=>{(s.openTabs!==r.openTabs||s.activeSessionId!==r.activeSessionId||s.openAppTabs!==r.openAppTabs||s.activeAppTabId!==r.activeAppTabId||s.tabOrder!==r.tabOrder)&&P0(s)})}function yo(t){return[...new Set(t)]}function z0(t,s,r,o){const l=v=>r===null||r.has(v),u=yo(((t==null?void 0:t.openTabs)??[]).filter(v=>s.has(v))),d=yo(((t==null?void 0:t.openAppTabs)??[]).filter(l));let p=(t==null?void 0:t.activeSessionId)??null;p!==null&&!s.has(p)&&(p=null),p!==null&&!u.includes(p)&&u.push(p),p??(p=u.at(-1)??null);let g=(t==null?void 0:t.activeAppTabId)??null;g!==null&&!l(g)&&(g=null),g!==null&&!d.includes(g)&&d.push(g),o!==null&&s.has(o)&&(u.includes(o)||u.push(o),p=o,g=null);const m=Ag(yo((t==null?void 0:t.tabOrder)??[]),u,d);return{openTabs:u,activeSessionId:p,openAppTabs:d,activeAppTabId:g,tabOrder:m}}function F0(){const t=new URLSearchParams(window.location.search);return{session:t.get("session"),thread:t.get("thread")}}function U0(){const t=new URL(window.location.href);!t.searchParams.has("session")&&!t.searchParams.has("thread")||(t.searchParams.delete("session"),t.searchParams.delete("thread"),window.history.replaceState(window.history.state,"",t))}let Nu=0;function Dh(t){return t==="sidecar"?"sidecar":"turns"}async function B0(t,s){const r=await Promise.allSettled(t.map(u=>s(u))),o=new Map;let l=null;return r.forEach((u,d)=>{var p;u.status==="fulfilled"?o.set(t[d],u.value):l===null&&(l=((p=u.reason)==null?void 0:p.message)??"Request failed")}),{updated:o,firstError:l}}function W0(t,s){const r={...t.sessionDetails};s.forEach(g=>delete r[g]);const o={...t.backgroundTasks};s.forEach(g=>delete o[g]);const l=Object.fromEntries(Object.entries(t.signedOutTurns).filter(([,g])=>!s.has(g))),u=t.openTabs.filter(g=>!s.has(g)),d=kd(t,new Set([...s].map($r)));let p=t.activeTurnIndex;if(d.activeSessionId!==t.activeSessionId){const g=d.activeSessionId?r[d.activeSessionId]:null;p=g&&g.turns.length>0?g.turns.length-1:0}return{sessions:t.sessions.filter(g=>!s.has(g.id)),sessionDetails:r,backgroundTasks:o,signedOutTurns:l,openTabs:u,...d,activeTurnIndex:p}}function H0(t){const s={...t};return delete s.turns,delete s.threads,delete s.contextUsage,s}function Lh(t,s,r){const o=s().activeSessionId;t(u=>W0(u,r));const l=s().activeSessionId;l&&l!==o&&s().selectSession(l,{keepAppView:!0})}async function Oh(t,s,r,o,l){if(r.length===0)return;t({error:null});const{updated:u,firstError:d}=await B0(r,o);u.size>0&&t(g=>({sessions:g.sessions.map(m=>u.get(m.id)??m)}));const p=r.length-u.size;if(p===0)s().addToast("info",`${r.length} session${r.length===1?"":"s"} ${l}`);else{t({error:d});const g=l[0].toUpperCase()+l.slice(1);s().addToast(p===r.length?"error":"warn",`${g} ${u.size} of ${r.length} — ${p} failed`)}}const V0=(t,s)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,quotedText:null,init:async()=>{const r=F0(),o=O0();try{const l=localStorage.getItem("agentpane:last-model-config");l&&t({lastModelConfig:JSON.parse(l)})}catch{}t({loading:!0,error:null});try{const l=s().loadApps(),[u,d,p]=await Promise.all([m0(),Eg(),_g()]);t({sessions:u,workspaces:d,folders:p,loading:!1}),U0();const g=await l,m=z0(o,new Set(u.map(v=>v.id)),g?new Set(s().apps.map(v=>v.id)):null,r.session);t(v=>{const k=v.activeSessionId!==null||v.activeAppTabId!==null;return{openTabs:yo([...m.openTabs,...v.openTabs]),openAppTabs:yo([...m.openAppTabs,...v.openAppTabs]),tabOrder:m.tabOrder,activeAppTabId:k?v.activeAppTabId:m.activeAppTabId}}),m.activeSessionId&&!s().activeSessionId&&await s().selectSession(m.activeSessionId,{keepAppView:!0}),r.thread&&(t({deepLinkThreadId:r.thread}),s().switchRightTab("threads"))}catch(l){t({loading:!1,error:l.message})}},selectSession:async(r,o)=>{const l=++Nu,u=o!=null&&o.keepAppView?{}:{activeAppTabId:null},d=p=>p.includes(r)?p:[...p,r];if(s().sessionDetails[r]){const p=s().sessionDetails[r];t({activeSessionId:r,activeTurnIndex:p.turns.length>0?p.turns.length-1:0,activeRightTab:Dh(s().activeRightTab),...u,openTabs:d(s().openTabs)}),p.has_unreviewed===1&&(_h(r).catch(()=>{}),t(g=>({sessions:g.sessions.map(m=>m.id===r?{...m,has_unreviewed:0}:m),sessionDetails:{...g.sessionDetails,[r]:{...p,has_unreviewed:0}}})));return}t({loading:!0,error:null});try{const p=await co(r);if(l!==Nu){t(g=>({sessionDetails:{...g.sessionDetails,[r]:p},openTabs:d(g.openTabs),loading:!1}));return}t(g=>({sessionDetails:{...g.sessionDetails,[r]:p},activeSessionId:r,activeTurnIndex:p.turns.length>0?p.turns.length-1:0,activeRightTab:Dh(g.activeRightTab),...u,openTabs:d(g.openTabs),loading:!1})),p.has_unreviewed===1&&(_h(r).catch(()=>{}),t(g=>({sessions:g.sessions.map(m=>m.id===r?{...m,has_unreviewed:0}:m),sessionDetails:{...g.sessionDetails,[r]:{...p,has_unreviewed:0}}})))}catch(p){t(l===Nu?{loading:!1,error:p.message}:{loading:!1})}},closeTab:r=>s().closeTabs([$r(r)]),updateModelConfig:async(r,o,l)=>{const u=s().activeSessionId;if(u){t({error:null});try{const d=await k0(u,r,o,l),p={provider:d.runtime_type,model:d.model??"",reasoning:d.model_reasoning_effort??""};t({lastModelConfig:p}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(p)),t(g=>({sessions:g.sessions.map(m=>m.id===u?d:m),sessionDetails:g.sessionDetails[u]?{...g.sessionDetails,[u]:{...g.sessionDetails[u],model:d.model,model_reasoning_effort:d.model_reasoning_effort,external_thread_id:d.external_thread_id}}:g.sessionDetails})),await s().refreshActiveSession()}catch(d){t({error:d.message}),s().addToast("error",`Failed to update model — ${d.message}`)}}},createSession:async r=>{t({error:null});try{const o=await xd(r);t(u=>({sessions:[o,...u.sessions],showNewSessionDialog:!1}));const l={provider:o.runtime_type,model:o.model??"",reasoning:o.model_reasoning_effort??""};t({lastModelConfig:l}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(l)),await s().selectSession(o.id),s().addLogEntry("INFO",`Session created — ${o.id.slice(0,8)}`),s().addToast("success",`Session created — ${o.title||o.id.slice(0,8)}`)}catch(o){t({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},addSession:r=>{t(o=>({sessions:o.sessions.some(l=>l.id===r.id)?o.sessions:[r,...o.sessions]}))},revealSession:async r=>{let o=s().sessionDetails[r];if(!o){const l=await co(r);t(u=>({sessionDetails:{...u.sessionDetails,[r]:l}})),o=l}s().sessions.some(l=>l.id===r)||s().addSession(H0(o)),await s().selectSession(r)},deleteSession:async r=>{var l;t({error:null});const o=(l=s().sessions.find(u=>u.id===r))==null?void 0:l.title;try{await jh(r),Lh(t,s,new Set([r])),s().addLogEntry("INFO",`Session deleted — ${r.slice(0,8)}`),s().addToast("info",`Session "${o||r.slice(0,8)}" deleted`)}catch(u){t({error:u.message}),s().addToast("error",`Failed to delete session — ${u.message}`)}},renameSession:async(r,o)=>{t({error:null});try{const l=await x0(r,o.trim());t(u=>({sessions:u.sessions.map(d=>d.id===r?l:d),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],title:l.title}}:u.sessionDetails}))}catch(l){t({error:l.message}),s().addToast("error",`Failed to rename session — ${l.message}`)}},markFinished:async r=>{t({error:null});try{const o=await Ch(r);t(l=>({sessions:l.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session marked as finished")}catch(o){t({error:o.message}),s().addToast("error",`Failed to mark as finished — ${o.message}`)}},markFinishedMany:async r=>{await Oh(t,s,r,Ch,"marked as finished")},toggleStar:async r=>{const o=s().sessions.find(l=>l.id===r);if(o){t({error:null});try{const l=await w0(r,o.starred?0:1);t(u=>({sessions:u.sessions.map(d=>d.id===r?l:d),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],starred:l.starred}}:u.sessionDetails}))}catch(l){t({error:l.message}),s().addToast("error",`Failed to star session — ${l.message}`)}}},reopenSession:async r=>{t({error:null});try{const o=await Eh(r);t(l=>({sessions:l.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session reopened")}catch(o){t({error:o.message}),s().addToast("error",`Failed to reopen session — ${o.message}`)}},reopenSessionMany:async r=>{await Oh(t,s,r,Eh,"reopened")},deleteSessionMany:async r=>{if(r.length===0)return;t({error:null});const o=await Promise.allSettled(r.map(d=>jh(d))),l=new Set;if(o.forEach((d,p)=>{d.status==="fulfilled"&&l.add(r[p])}),l.size===0){t({error:"Failed to delete sessions"}),s().addToast("error","Failed to delete sessions");return}Lh(t,s,l),s().addLogEntry("INFO",`${l.size} session${l.size===1?"":"s"} deleted`);const u=r.length-l.size;u===0?s().addToast("info",`${l.size} session${l.size===1?"":"s"} deleted`):(t({error:"One or more sessions failed to delete"}),s().addToast("warn",`Deleted ${l.size} of ${r.length} — ${u} failed`))},submitPrompt:async(r,o)=>{const l=s().activeSessionId;if(l){t({error:null,submittingPrompt:r}),t(u=>{const d=u.sessionDetails[l];return d?{sessionDetails:{...u.sessionDetails,[l]:{...d,is_running:1,status:"running"}},sessions:u.sessions.map(p=>p.id===l?{...p,is_running:1,status:"running"}:p)}:{}});try{const u=await Cg(l,r,o);s().addLogEntry("INFO",`Turn submitted — "${r.slice(0,40)}"`),t(d=>{const p=d.sessionDetails[l];if(!p)return{submittingPrompt:null};const g=p.turns.findIndex(v=>v.id===u.id);if(g>=0)return{submittingPrompt:null,activeTurnIndex:g};const m={...u,items:[]};return{submittingPrompt:null,sessionDetails:{...d.sessionDetails,[l]:{...p,turns:[...p.turns,m]}},activeTurnIndex:p.turns.length}})}catch(u){t({submittingPrompt:null,error:u.message}),s().addLogEntry("ERROR",`Turn failed — ${u.message}`),s().addToast("error",`Failed to send prompt — ${u.message}`),t(d=>{const p=d.sessionDetails[l];if(!p)return{};const g=Al(p)?1:0;return{sessionDetails:{...d.sessionDetails,[l]:{...p,is_running:g,status:g?"running":"active"}},sessions:d.sessions.map(m=>m.id===l?{...m,is_running:g,status:g?"running":"active"}:m)}})}}},cancelTurn:async()=>{const r=s().activeSessionId;if(r)try{await g0(r)}catch(o){t({error:o.message})}},rewindToTurn:async(r,o)=>{t({error:null});try{const l=await b0(r,o),u=await co(r);t(d=>({sessionDetails:{...d.sessionDetails,[r]:u},sessions:d.sessions.map(p=>p.id===r?{...p,external_thread_id:l.external_thread_id,is_running:0,status:"active"}:p),activeTurnIndex:u.turns.length>0?u.turns.length-1:0})),s().addToast("info","Rewound to selected turn")}catch(l){t({error:l.message}),s().addToast("error",`Failed to rewind — ${l.message}`)}},restoreSession:async r=>{t({error:null});try{const o=await T0(r),l=await co(r);t(u=>({sessionDetails:{...u.sessionDetails,[r]:l},sessions:u.sessions.map(d=>d.id===r?{...d,external_thread_id:o.external_thread_id,is_running:0,status:"active"}:d),activeTurnIndex:l.turns.length>0?l.turns.length-1:0})),s().addToast("info","Restored rewound session")}catch(o){t({error:o.message}),s().addToast("error",`Failed to restore — ${o.message}`)}},branchFromTurn:async(r,o,l)=>{t({error:null});try{const u=await N0(r,o,l);t(d=>({sessions:[u,...d.sessions]})),await s().selectSession(u.id),s().addToast("success","Branched from selected turn")}catch(u){t({error:u.message}),s().addToast("error",`Failed to branch — ${u.message}`)}},updateRuntimeConfig:async r=>{const o=s().activeSessionId;if(o){t({error:null});try{const l=await S0(o,JSON.stringify(r));t(u=>({sessions:u.sessions.map(d=>d.id===o?l:d),sessionDetails:u.sessionDetails[o]?{...u.sessionDetails,[o]:{...u.sessionDetails[o],runtime_config:l.runtime_config}}:u.sessionDetails}))}catch(l){t({error:l.message}),s().addToast("error",`Failed to update config — ${l.message}`)}}},refreshActiveSession:async()=>{const r=s().activeSessionId;if(r)try{const o=await co(r);t(l=>({sessionDetails:{...l.sessionDetails,[r]:o},activeTurnIndex:o.turns.length>0?Math.min(l.activeTurnIndex,o.turns.length-1):0,sessions:l.sessions.map(u=>u.id===r?{...u,is_running:o.is_running,status:o.status}:u)}))}catch(o){t({error:o.message})}}});async function Og(t){const{sessions:s}=await Wt(`/claude-sessions?workspace=${encodeURIComponent(t)}`);return s}function G0(t,s){return ct(`/claude-sessions/${encodeURIComponent(t)}/import`,{workspace:s})}const Ph={available:!0,reason:null};let ju=null;const K0=(t,s)=>({workspaces:[],pickerSupport:null,loadPickerSupport:()=>{const r=s().pickerSupport;return r?Promise.resolve(r):(ju??(ju=E0().then(o=>typeof(o==null?void 0:o.available)!="boolean"?Ph:(t({pickerSupport:o}),o)).catch(()=>Ph).finally(()=>{ju=null})),ju)},createWorkspaceAt:async r=>{const o=await j0(r.trim());return t(l=>({workspaces:[...l.workspaces.filter(u=>u.id!==o.id),o]})),o},addWorkspace:async r=>{t({error:null});try{const o=await s().createWorkspaceAt(r);return s().addToast("success",`Workspace added — ${o.path}`),o}catch(o){return s().addToast("error",`Failed to add workspace — ${Pr(o)}`),null}},removeWorkspace:async r=>{t({error:null});try{await C0(r);const o=await Eg();t({workspaces:o}),s().addToast("info","Workspace hidden")}catch(o){s().addToast("error",`Failed to hide workspace — ${o.message}`)}},createSessionInWorkspace:async r=>{t({error:null});try{const o=s().lastModelConfig,l=await xd({cwd:r,runtime_type:(o==null?void 0:o.provider)??"codex",model:o==null?void 0:o.model,model_reasoning_effort:o==null?void 0:o.reasoning});t(u=>({sessions:[l,...u.sessions]})),await s().selectSession(l.id),s().addLogEntry("INFO",`Session created in ${r} — ${l.id.slice(0,8)}`),s().addToast("success",`Session created in ${r.split("/").pop()||r}`)}catch(o){t({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},pickAndAddWorkspace:async()=>{if(!(await s().loadPickerSupport()).available){s().setShowAddWorkspaceDialog(!0);return}try{const o=await _0();if(o.cancelled||!o.path)return;await s().addWorkspace(o.path)}catch(o){s().addToast("error",`Failed to pick directory — ${o.message}`)}},importClaudeSessions:async(r,o)=>{const l=[],u=[];for(const d of[...o].reverse())try{l.unshift(await G0(d,r))}catch(p){u.unshift({id:d,error:Pr(p)})}return l.length>0&&(t(d=>({sessions:[...l,...d.sessions]})),await s().selectSession(l[0].id),s().addLogEntry("INFO",`Imported ${l.length} Claude Code session(s) into ${r}`),s().addToast("success",l.length===1?`Imported — ${l[0].title||"Claude Code session"}`:`Imported ${l.length} Claude Code sessions`)),{imported:l,failed:u}}}),Fs=new Map,Sd=new Map,Il=new Map,bd=new Map,Ml=new Map;function q0(t,s,r=""){Fs.set(t,s),Sd.set(t,r)}function Y0(t){Fs.delete(t),Sd.delete(t)}function Cu(t,s){Il.set(t,s)}function $h(t,s,r){const o=Il.get(t);if(!o)return;const l=Fs.get(o);l&&l({source:"agentpane-host",event:s,payload:r})}function zh(t,s){const r=Il.get(t);if(!r)return;const o=Fs.get(r);o&&o({source:"agentpane-host",event:"background_tasks",payload:{sessionId:t,tasks:s}})}function X0(t,s,r,o,l){if(typeof l=="string"&&l!==Sd.get(t))return;const u=Fs.get(t);u&&u({source:"agentpane-host",event:"tool_call",payload:{callId:s,tool:r,name:r,args:o}})}function Q0(t,s,r,o){const l=Il.get(t);if(!l)return;const u=Fs.get(l);u&&u({source:"agentpane-host",event:"turn:delta",payload:{sessionId:t,turnId:s,itemId:r,delta:o}})}function Z0(t,s){bd.set(t,s)}function J0(t){bd.delete(t)}function ew(t,s){Ml.set(t,s)}function tw(t){Ml.delete(t)}function Pg(t,s={}){const r=Ml.get(t);if(r){r(s);return}const o=Fs.get(t);o&&o({source:"agentpane-host",event:"state_changed",payload:{}})}function nw(){for(const t of new Set([...Fs.keys(),...Ml.keys()]))Pg(t)}function sw(t){var r;const s=Fs.get(t);s&&s({source:"agentpane-host",event:"source:updated",payload:{}}),(r=bd.get(t))==null||r()}const rw=(t,s)=>({wsConnected:!1,backgroundTasks:{},retryStates:{},signedOutTurns:{},setWsConnected:r=>t({wsConnected:r}),onTurnCreated:(r,o)=>{t(l=>{const u=l.sessionDetails[r];return!u||o.thread_id?{}:u.turns.some(d=>d.id===o.id)?{}:{sessionDetails:{...l.sessionDetails,[r]:{...u,turns:[...u.turns,{...o,items:[]}]}}}})},onTurnStarted:(r,o)=>{s().addLogEntry("DEBUG",`turn:started — ${o.slice(0,8)}`),t(l=>{const u=ar(l.sessions,r,()=>({is_running:1,status:"running"})),d=l.sessionDetails[r];if(!d)return{sessions:u};const p=d.turns.findIndex(g=>g.id===o);return{sessionDetails:{...l.sessionDetails,[r]:{...Zn(d,o,g=>({...g,status:"running"})),is_running:1,status:"running"}},sessions:u,activeTurnIndex:l.activeSessionId===r&&p>=0?p:l.activeTurnIndex}})},onItemStarted:(r,o,l)=>{s().addLogEntry("DEBUG",`item:started — ${l.type}`),t(u=>{const d=Fh(l)?Dr(u.retryStates,o):u.retryStates,p=u.sessionDetails[r];return p?{sessionDetails:{...u.sessionDetails,[r]:Zn(p,o,g=>_u(g,l))},retryStates:d}:{retryStates:d}})},onItemUpdated:(r,o,l)=>{t(u=>{const d=u.sessionDetails[r];return d?{sessionDetails:{...u.sessionDetails,[r]:Zn(d,o,p=>_u(p,l))}}:{}})},onItemCompleted:(r,o,l)=>{if(s().addLogEntry("DEBUG",`item:completed — ${l.type}`),l.type==="background_task"&&(l.status==="completed"||l.status==="failed")){const u=l.data||{},d=u.task_type||"unknown",p=u.description||"background task",m=d==="local_agent"?"Subagent":d==="local_bash"?"Monitor":"Task";l.status==="completed"?s().addToast("success",`${m} completed: ${p}`):u.status!=="stopped"&&s().addToast("error",`${m} failed: ${p}`)}t(u=>{const d=Fh(l)?Dr(u.retryStates,o):u.retryStates,p=u.sessionDetails[r];return p?{retryStates:d,sessionDetails:{...u.sessionDetails,[r]:Zn(p,o,g=>{var v,k;let m=_u(g,l);if(l.type==="agent_message"&&((v=l.data)!=null&&v.text)&&(m={...m,agent_response:l.data.text}),l.type==="reasoning"&&((k=l.data)!=null&&k.text)){const y=m.thoughts?m.thoughts+`
42
- `+l.data.text:l.data.text;m={...m,thoughts:y}}return m})}}:{retryStates:d}})},onItemDelta:(r,o,l,u)=>{Q0(r,o,l,u),t(d=>{const p=Dr(d.retryStates,o),g=d.sessionDetails[r];return g?{sessionDetails:{...d.sessionDetails,[r]:Zn(g,o,m=>ow(m,l,u))},retryStates:p}:{retryStates:p}})},onTurnCompleted:(r,o,l,u,d)=>{s().dropSignedOutTurn(o);const p=(l==null?void 0:l.input_tokens)??0,g=(l==null?void 0:l.output_tokens)??0;s().addLogEntry("INFO",`turn:completed — ${p} in / ${g} out`),$h(r,"turn:completed",{turnId:o,response:d??null}),s().refreshApps(),t(m=>{const v=m.sessionDetails[r],k=v?Zn(v,o,N=>({...N,status:"completed",token_usage:l??N.token_usage??null,...d&&!N.agent_response?{agent_response:d}:{}})):null,y=Eu(k),S=y&&k?Va(k):"active",T=ar(m.sessions,r,N=>({is_running:y,status:S,has_unreviewed:u?1:N.has_unreviewed})),_=Dr(m.retryStates,o);return k?{sessionDetails:{...m.sessionDetails,[r]:{...k,is_running:y,status:S,has_unreviewed:u?1:k.has_unreviewed}},sessions:T,retryStates:_}:{sessions:T,retryStates:_}})},onTokenUsageUpdated:(r,o,l)=>{t(u=>{const d=u.sessionDetails[r];return d?{sessionDetails:{...u.sessionDetails,[r]:Zn(d,o,p=>({...p,token_usage:l}))}}:{}})},onContextUsageUpdated:(r,o)=>{t(l=>{const u=l.sessionDetails[r];return u?{sessionDetails:{...l.sessionDetails,[r]:{...u,contextUsage:o}}}:{}})},onTurnFailed:(r,o,l,u)=>{s().dropSignedOutTurn(o),s().addLogEntry("ERROR",`turn:failed — ${l}`),s().addToast("error",`Turn failed — ${l}`),$h(r,"turn:failed",{turnId:o,error:l}),t(d=>{const p=d.sessionDetails[r],g=l.includes("cancelled")||l.includes("aborted"),m=g?"aborted":"failed",v=p?Zn(p,o,_=>({..._,status:m,error:l,...u?{resume_state:u}:{},items:_.items.map(N=>N.status==="in_progress"?{...N,status:"failed"}:N)})):null,k=Eu(v),y=k&&v?Va(v):g?"active":"failed",S=ar(d.sessions,r,()=>({is_running:k,status:y})),T=Dr(d.retryStates,o);return v?{sessionDetails:{...d.sessionDetails,[r]:{...v,is_running:k,status:y}},sessions:S,retryStates:T}:{sessions:S,retryStates:T}})},onTurnCancelled:(r,o)=>{s().dropSignedOutTurn(o),t(l=>{const u=l.sessionDetails[r],d=u?Zn(u,o,k=>({...k,status:"aborted",...k.resume_state==="waiting"||k.resume_state==="resuming"?{resume_state:"cancelled"}:{},items:k.items.map(y=>y.status==="in_progress"?{...y,status:"completed"}:y)})):null,p=Eu(d),g=p&&d?Va(d):"active",m=ar(l.sessions,r,()=>({is_running:p,status:g})),v=Dr(l.retryStates,o);return d?{sessionDetails:{...l.sessionDetails,[r]:{...d,is_running:p,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnInterrupted:(r,o,l)=>{s().addLogEntry("WARN",`turn:interrupted — ${l.reason}${l.detail?` (${l.detail})`:""}`),s().addToast("warn",iw(l.reason)),l.reason==="auth"?t(u=>({signedOutTurns:{...u.signedOutTurns,[o]:r}})):s().dropSignedOutTurn(o),t(u=>{const d=u.sessionDetails[r],p=d?Zn(d,o,k=>({...k,status:"pending",error:null,resume_state:"waiting",interrupt_reason:l.reason,interrupted_at:l.interruptedAt,resume_attempts:l.attempts,resume_at:l.resumeAt??null})):null,g=p?Va(p):"interrupted",m=ar(u.sessions,r,()=>({is_running:1,status:g})),v=Dr(u.retryStates,o);return p?{sessionDetails:{...u.sessionDetails,[r]:{...p,is_running:1,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnResuming:(r,o,l)=>{s().dropSignedOutTurn(o),s().addLogEntry("INFO",`turn:resuming — ${o.slice(0,8)} (attempt ${l})`),t(u=>{const d=ar(u.sessions,r,()=>({is_running:1,status:"running"})),p=u.sessionDetails[r];return p?{sessionDetails:{...u.sessionDetails,[r]:{...Zn(p,o,g=>({...g,status:"running",error:null,resume_state:"resuming",resume_attempts:l})),is_running:1,status:"running"}},sessions:d}:{sessions:d}})},onTurnResumed:(r,o)=>{s().addLogEntry("INFO",`turn:resumed — ${o.slice(0,8)}`),s().addToast("success","Interrupted turn resumed"),t(l=>{const u=l.sessionDetails[r];return u?{sessionDetails:{...l.sessionDetails,[r]:Zn(u,o,d=>({...d,resume_state:"resumed"}))}}:{}})},onTurnRetrying:(r,o,l)=>{s().addLogEntry("WARN",`turn:retrying — ${r.slice(0,8)}/${o.slice(0,8)} attempt ${l.attempt}/${l.maxRetries} (${l.errorStatus??"no response"}${l.error?`, ${l.error}`:""})`),t(u=>({retryStates:{...u.retryStates,[o]:l}}))},onSessionTitle:(r,o)=>{t(l=>({sessions:l.sessions.map(u=>u.id===r?{...u,title:o}:u),sessionDetails:l.sessionDetails[r]?{...l.sessionDetails,[r]:{...l.sessionDetails[r],title:o}}:l.sessionDetails}))},onSessionTouched:r=>{t(o=>{const l=o.sessionDetails[r];return{sessions:ar(o.sessions,r,()=>({user_touched:1})),sessionDetails:l?{...o.sessionDetails,[r]:{...l,user_touched:1}}:o.sessionDetails}})},onSessionUpdated:r=>{const o={...r};delete o.is_running,delete o.status,t(l=>{const u=l.sessionDetails[r.id];return{sessions:ar(l.sessions,r.id,()=>o),sessionDetails:u?{...l.sessionDetails,[r.id]:{...u,...o}}:l.sessionDetails}})},onBackgroundTasksChanged:(r,o)=>{zh(r,o),t(l=>{if(o.length===0&&!l.backgroundTasks[r])return{};const u={...l.backgroundTasks};return o.length>0?u[r]=o:delete u[r],{backgroundTasks:u}})},onSignedOutTurnsSnapshot:r=>t({signedOutTurns:Object.fromEntries(r.map(o=>[o.turnId,o.sessionId]))}),dropSignedOutTurn:r=>{if(!(r in s().signedOutTurns))return;const o={...s().signedOutTurns};delete o[r],t({signedOutTurns:o})},onBackgroundTasksSnapshot:r=>{for(const[l,u]of Object.entries(r))zh(l,u);const o={};for(const[l,u]of Object.entries(r))u.length>0&&(o[l]=u);t({backgroundTasks:o})}});function iw(t){switch(t){case"network":return"Network error — the turn will resume when the connection is back";case"process_exit":return"The agent process stopped — resuming the turn";case"auth":return"Claude is signed out — the turn waits until you sign in again";case"usage_limit":return"Usage limit reached — the turn waits until it is over";default:return"The agent host restarted — resuming the turn"}}function Va(t){const s=[...t.turns,...(t.threads??[]).flatMap(r=>r.turns??[])].filter(hr);return s.length>0&&s.every(r=>r.status==="pending"&&r.resume_state==="waiting")?"interrupted":"running"}function Fh(t){return t.type!=="background_task"&&t.type!=="error"&&t.type!=="interruption"}function Dr(t,s){if(!(s in t))return t;const r={...t};return delete r[s],r}function Eu(t){return t&&(t.turns.some(hr)||(t.threads??[]).some(r=>(r.turns??[]).some(hr)))?1:0}function ar(t,s,r){return t.some(o=>o.id===s)?t.map(o=>o.id===s?{...o,...r(o)}:o):t}function Zn(t,s,r){const o=(t.threads??[]).map(l=>(l.turns??[]).some(u=>u.id===s)?{...l,turns:(l.turns??[]).map(u=>u.id===s?r(u):u)}:l);return{...t,turns:t.turns.map(l=>l.id===s?r(l):l),threads:o}}function $g(t,s){for(let r=t.length-1;r>=0;r--)if(t[r].external_item_id===s)return r;return-1}function _u(t,s){const r=$g(t.items,s.external_item_id);if(r>=0){const o=[...t.items];return o[r]=s,{...t,items:o}}if(s.type==="agent_message"){const o=t.items.filter(l=>!(l.type==="agent_message"&&l.id.startsWith("delta-")));return{...t,items:[...o,s]}}return{...t,items:[...t.items,s]}}function ow(t,s,r){var u;const o=$g(t.items,s);if(o>=0){const d=t.items[o],g=(((u=d.data)==null?void 0:u.text)??"")+r,m=[...t.items];return m[o]={...d,data:{...d.data,text:g}},{...t,items:m,agent_response:g}}const l={id:`delta-${s}`,turn_id:t.id,external_item_id:s,type:"agent_message",data:{text:r},status:"in_progress",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return{...t,items:[...t.items,l],agent_response:r}}function aw(t,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return Wt(`/providers/${t}/models${r}`)}const Uh="curl -fsSL https://repoburg.com/install.sh | bash",lw=2e3,zg="agentpane:daemon-seen";function cw(t=mn()){if(!t)return!1;try{const s=new URL(t);return s.protocol==="http:"&&(s.hostname==="localhost"||s.hostname==="127.0.0.1")}catch{return!1}}async function uw(t=mn()){try{return await fetch(`${t}/health`,{mode:"no-cors",cache:"no-store"}),!0}catch{return!1}}function dw(){try{return localStorage.getItem(zg)==="true"}catch{return!1}}function fw(){try{localStorage.setItem(zg,"true")}catch{}}function pw(t){let s=!1,r=!1,o=!1,l=null;function u(){l!==null&&(clearTimeout(l),l=null)}async function d(){if(s||r)return;u(),r=!0;const m=await uw();if(r=!1,!s){if(m){fw(),g(),t.onReady();return}o||(o=!0,t.onMissing()),l=setTimeout(()=>void d(),lw)}}function p(){document.visibilityState==="visible"&&d()}function g(){s=!0,u(),window.removeEventListener("focus",p),document.removeEventListener("visibilitychange",p)}return window.addEventListener("focus",p),document.addEventListener("visibilitychange",p),d(),g}const qu=160,Yu=480,hw=240,cl=220,mw=300,gw=600,vw=36;function ul(){return typeof window>"u"?gw:Math.max(cl,Math.round(window.innerWidth*.7))}const Bh="agentpane:sidebar-width",Wh="agentpane:right-panel-width",Ru="agentpane:right-panel-collapsed";function Hh(t,s,r,o){try{const l=localStorage.getItem(t);if(l==null)return o;const u=Number(l);return Number.isFinite(u)?Math.min(r,Math.max(s,u)):o}catch{return o}}function yw(t){try{return localStorage.getItem(t)==="true"}catch{return!1}}function Vh(t,s){try{localStorage.setItem(t,String(s))}catch{}}const Gh=200,xw=(t,s)=>({activeRightTab:"turns",eventLog:[],loading:!1,error:null,showNewSessionDialog:!1,showAddWorkspaceDialog:!1,importSessionsWorkspace:null,showRemoteModal:!1,toasts:[],showCommandPalette:!1,lastModelConfig:null,models:[],modelsLoading:!1,showModelSelector:!1,sidebarWidth:Hh(Bh,qu,Yu,hw),rightPanelWidth:Hh(Wh,cl,ul(),mw),rightPanelCollapsed:yw(Ru),deepLinkThreadId:null,vscodeViewOpen:!1,vscodeState:"stopped",vscodeId:null,vscodeToken:null,usageViewOpen:!1,terminalViewOpen:!1,canGoBack:!1,canGoForward:!1,daemonStatus:cw()?"checking":"ready",setActiveTurnIndex:r=>t({activeTurnIndex:r}),switchRightTab:r=>{s().rightPanelCollapsed&&Vh(Ru,!1),t({activeRightTab:r,rightPanelCollapsed:!1})},setShowNewSessionDialog:r=>t({showNewSessionDialog:r}),setShowAddWorkspaceDialog:r=>t({showAddWorkspaceDialog:r}),setImportSessionsWorkspace:r=>t({importSessionsWorkspace:r}),setShowRemoteModal:r=>t({showRemoteModal:r}),setShowCommandPalette:r=>t({showCommandPalette:r}),setShowModelSelector:r=>t({showModelSelector:r}),setDeepLinkThreadId:r=>t({deepLinkThreadId:r}),setSidebarWidth:r=>{const o=Math.min(Yu,Math.max(qu,Math.round(r)));t({sidebarWidth:o});try{localStorage.setItem(Bh,String(o))}catch{}},setRightPanelWidth:r=>{const o=Math.min(ul(),Math.max(cl,Math.round(r)));t({rightPanelWidth:o});try{localStorage.setItem(Wh,String(o))}catch{}},setRightPanelCollapsed:r=>{t({rightPanelCollapsed:r}),Vh(Ru,r)},toggleRightPanel:()=>s().setRightPanelCollapsed(!s().rightPanelCollapsed),toggleVscodeView:()=>{if(s().vscodeViewOpen){t({vscodeViewOpen:!1});return}t({vscodeViewOpen:!0,terminalViewOpen:!1,vscodeState:"starting",vscodeId:null,vscodeToken:null})},setVscodeView:(r,o,l)=>t({vscodeState:r,vscodeId:o,vscodeToken:l}),toggleUsageView:()=>t({usageViewOpen:!s().usageViewOpen,terminalViewOpen:!1}),toggleTerminalView:()=>t(s().terminalViewOpen?{terminalViewOpen:!1}:{terminalViewOpen:!0,vscodeViewOpen:!1,usageViewOpen:!1}),setDaemonStatus:r=>t({daemonStatus:r}),addToast:(r,o,l,u)=>{const d=Math.random().toString(36).slice(2,9);t(p=>({toasts:[...p.toasts,{id:d,type:r,message:o,undoAction:l,undoLabel:u}]}))},removeToast:r=>{t(o=>({toasts:o.toasts.filter(l=>l.id!==r)}))},addLogEntry:(r,o)=>{const l=new Date().toLocaleTimeString("en-GB",{hour12:!1});t(u=>{const d=[...u.eventLog,{time:l,level:r,message:o}];return d.length>Gh&&d.splice(0,d.length-Gh),{eventLog:d}})},loadModels:async(r,o)=>{if(!s().modelsLoading){t({modelsLoading:!0,models:[]});try{const l=await aw(r,o);t({models:l,modelsLoading:!1})}catch{t({modelsLoading:!1})}}}}),ww=(t,s)=>({createThread:async(r,o)=>{try{await ct(`/sessions/${r}/threads`,o),s().addLogEntry("INFO",`Thread created — "${o.message.slice(0,40)}"`)}catch(l){s().addToast("error",`Failed to create thread — ${l.message}`)}},followupThread:async(r,o,l)=>{try{await ct(`/sessions/${r}/threads/${o}/followup`,{message:l}),s().addLogEntry("INFO",`Thread follow-up — "${l.slice(0,40)}"`)}catch(u){s().addToast("error",`Failed to send follow-up — ${u.message}`)}},cancelThreadTurn:async(r,o)=>{try{await ct(`/sessions/${r}/cancel?threadId=${encodeURIComponent(o)}`),s().addLogEntry("INFO","Thread turn cancelled")}catch(l){s().addToast("error",`Failed to cancel thread turn — ${l.message}`)}},resolveThread:async(r,o)=>{try{await Ns(`/sessions/${r}/threads/${o}`,{status:"resolved"})}catch(l){s().addToast("error",`Failed to resolve thread — ${l.message}`)}},reopenThread:async(r,o)=>{try{await Ns(`/sessions/${r}/threads/${o}`,{status:"open"})}catch(l){s().addToast("error",`Failed to reopen thread — ${l.message}`)}},shareThread:async(r,o,l)=>{try{const u=await ct(`/sessions/${r}/threads/${o}/summarize`,{directives:l}),d=`
41
+ `+h.stack}return{value:e,source:n,stack:f,digest:null}}function Gc(e,n,i){return{value:e,source:null,stack:i??null,digest:n??null}}function Kc(e,n){try{console.error(n.value)}catch(i){setTimeout(function(){throw i})}}var kx=typeof WeakMap=="function"?WeakMap:Map;function Np(e,n,i){i=Ds(-1,i),i.tag=3,i.payload={element:null};var c=n.value;return i.callback=function(){Ra||(Ra=!0,lu=c),Kc(e,n)},i}function jp(e,n,i){i=Ds(-1,i),i.tag=3;var c=e.type.getDerivedStateFromError;if(typeof c=="function"){var f=n.value;i.payload=function(){return c(f)},i.callback=function(){Kc(e,n)}}var h=e.stateNode;return h!==null&&typeof h.componentDidCatch=="function"&&(i.callback=function(){Kc(e,n),typeof c!="function"&&(tr===null?tr=new Set([this]):tr.add(this));var w=n.stack;this.componentDidCatch(n.value,{componentStack:w!==null?w:""})}),i}function Cp(e,n,i){var c=e.pingCache;if(c===null){c=e.pingCache=new kx;var f=new Set;c.set(n,f)}else f=c.get(n),f===void 0&&(f=new Set,c.set(n,f));f.has(i)||(f.add(i),e=Lx.bind(null,e,n,i),n.then(e,e))}function Ep(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function _p(e,n,i,c,f){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(n=Ds(-1,1),n.tag=2,Js(i,n,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=f,e)}var Sx=A.ReactCurrentOwner,En=!1;function kn(e,n,i,c){n.child=e===null?Yf(n,null,i,c):ii(n,e.child,i,c)}function Rp(e,n,i,c,f){i=i.render;var h=n.ref;return ai(n,f),c=$c(e,n,i,c,h,f),i=zc(),e!==null&&!En?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~f,Ls(e,n,f)):(xt&&i&&kc(n),n.flags|=1,kn(e,n,c,f),n.child)}function Ap(e,n,i,c,f){if(e===null){var h=i.type;return typeof h=="function"&&!mu(h)&&h.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(n.tag=15,n.type=h,Ip(e,n,h,c,f)):(e=Oa(i.type,null,c,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,(e.lanes&f)===0){var w=h.memoizedProps;if(i=i.compare,i=i!==null?i:Ui,i(w,c)&&e.ref===n.ref)return Ls(e,n,f)}return n.flags|=1,e=ir(h,c),e.ref=n.ref,e.return=n,n.child=e}function Ip(e,n,i,c,f){if(e!==null){var h=e.memoizedProps;if(Ui(h,c)&&e.ref===n.ref)if(En=!1,n.pendingProps=c=h,(e.lanes&f)!==0)(e.flags&131072)!==0&&(En=!0);else return n.lanes=e.lanes,Ls(e,n,f)}return qc(e,n,i,c,f)}function Mp(e,n,i){var c=n.pendingProps,f=c.children,h=e!==null?e.memoizedState:null;if(c.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(di,Bn),Bn|=i;else{if((i&1073741824)===0)return e=h!==null?h.baseLanes|i:i,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,ut(di,Bn),Bn|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},c=h!==null?h.baseLanes:i,ut(di,Bn),Bn|=c}else h!==null?(c=h.baseLanes|i,n.memoizedState=null):c=i,ut(di,Bn),Bn|=c;return kn(e,n,f,i),n.child}function Dp(e,n){var i=n.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(n.flags|=512,n.flags|=2097152)}function qc(e,n,i,c,f){var h=Cn(i)?br:cn.current;return h=ti(n,h),ai(n,f),i=$c(e,n,i,c,h,f),c=zc(),e!==null&&!En?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~f,Ls(e,n,f)):(xt&&c&&kc(n),n.flags|=1,kn(e,n,i,f),n.child)}function Lp(e,n,i,c,f){if(Cn(i)){var h=!0;aa(n)}else h=!1;if(ai(n,f),n.stateNode===null)Na(e,n),bp(n,i,c),Vc(n,i,c,f),c=!0;else if(e===null){var w=n.stateNode,C=n.memoizedProps;w.props=C;var L=w.context,H=i.contextType;typeof H=="object"&&H!==null?H=qn(H):(H=Cn(i)?br:cn.current,H=ti(n,H));var ne=i.getDerivedStateFromProps,re=typeof ne=="function"||typeof w.getSnapshotBeforeUpdate=="function";re||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(C!==c||L!==H)&&Tp(n,w,c,H),Zs=!1;var ee=n.memoizedState;w.state=ee,ga(n,c,w,f),L=n.memoizedState,C!==c||ee!==L||jn.current||Zs?(typeof ne=="function"&&(Hc(n,i,ne,c),L=n.memoizedState),(C=Zs||Sp(n,i,C,c,ee,L,H))?(re||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(n.flags|=4194308)):(typeof w.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=L),w.props=c,w.state=L,w.context=H,c=C):(typeof w.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{w=n.stateNode,Qf(e,n),C=n.memoizedProps,H=n.type===n.elementType?C:rs(n.type,C),w.props=H,re=n.pendingProps,ee=w.context,L=i.contextType,typeof L=="object"&&L!==null?L=qn(L):(L=Cn(i)?br:cn.current,L=ti(n,L));var xe=i.getDerivedStateFromProps;(ne=typeof xe=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(C!==re||ee!==L)&&Tp(n,w,c,L),Zs=!1,ee=n.memoizedState,w.state=ee,ga(n,c,w,f);var Ne=n.memoizedState;C!==re||ee!==Ne||jn.current||Zs?(typeof xe=="function"&&(Hc(n,i,xe,c),Ne=n.memoizedState),(H=Zs||Sp(n,i,H,c,ee,Ne,L)||!1)?(ne||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(c,Ne,L),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(c,Ne,L)),typeof w.componentDidUpdate=="function"&&(n.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof w.componentDidUpdate!="function"||C===e.memoizedProps&&ee===e.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||C===e.memoizedProps&&ee===e.memoizedState||(n.flags|=1024),n.memoizedProps=c,n.memoizedState=Ne),w.props=c,w.state=Ne,w.context=L,c=H):(typeof w.componentDidUpdate!="function"||C===e.memoizedProps&&ee===e.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||C===e.memoizedProps&&ee===e.memoizedState||(n.flags|=1024),c=!1)}return Yc(e,n,i,c,h,f)}function Yc(e,n,i,c,f,h){Dp(e,n);var w=(n.flags&128)!==0;if(!c&&!w)return f&&Ff(n,i,!1),Ls(e,n,h);c=n.stateNode,Sx.current=n;var C=w&&typeof i.getDerivedStateFromError!="function"?null:c.render();return n.flags|=1,e!==null&&w?(n.child=ii(n,e.child,null,h),n.child=ii(n,null,C,h)):kn(e,n,C,h),n.memoizedState=c.state,f&&Ff(n,i,!0),n.child}function Op(e){var n=e.stateNode;n.pendingContext?$f(e,n.pendingContext,n.pendingContext!==n.context):n.context&&$f(e,n.context,!1),Ic(e,n.containerInfo)}function Pp(e,n,i,c,f){return ri(),Nc(f),n.flags|=256,kn(e,n,i,c),n.child}var Xc={dehydrated:null,treeContext:null,retryLane:0};function Qc(e){return{baseLanes:e,cachePool:null,transitions:null}}function $p(e,n,i){var c=n.pendingProps,f=Tt.current,h=!1,w=(n.flags&128)!==0,C;if((C=w)||(C=e!==null&&e.memoizedState===null?!1:(f&2)!==0),C?(h=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(f|=1),ut(Tt,f&1),e===null)return Tc(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(w=c.children,e=c.fallback,h?(c=n.mode,h=n.child,w={mode:"hidden",children:w},(c&1)===0&&h!==null?(h.childLanes=0,h.pendingProps=w):h=Pa(w,c,0,null),e=Mr(e,c,i,null),h.return=n,e.return=n,h.sibling=e,n.child=h,n.child.memoizedState=Qc(i),n.memoizedState=Xc,e):Zc(n,w));if(f=e.memoizedState,f!==null&&(C=f.dehydrated,C!==null))return bx(e,n,w,c,C,f,i);if(h){h=c.fallback,w=n.mode,f=e.child,C=f.sibling;var L={mode:"hidden",children:c.children};return(w&1)===0&&n.child!==f?(c=n.child,c.childLanes=0,c.pendingProps=L,n.deletions=null):(c=ir(f,L),c.subtreeFlags=f.subtreeFlags&14680064),C!==null?h=ir(C,h):(h=Mr(h,w,i,null),h.flags|=2),h.return=n,c.return=n,c.sibling=h,n.child=c,c=h,h=n.child,w=e.child.memoizedState,w=w===null?Qc(i):{baseLanes:w.baseLanes|i,cachePool:null,transitions:w.transitions},h.memoizedState=w,h.childLanes=e.childLanes&~i,n.memoizedState=Xc,c}return h=e.child,e=h.sibling,c=ir(h,{mode:"visible",children:c.children}),(n.mode&1)===0&&(c.lanes=i),c.return=n,c.sibling=null,e!==null&&(i=n.deletions,i===null?(n.deletions=[e],n.flags|=16):i.push(e)),n.child=c,n.memoizedState=null,c}function Zc(e,n){return n=Pa({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function Ta(e,n,i,c){return c!==null&&Nc(c),ii(n,e.child,null,i),e=Zc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function bx(e,n,i,c,f,h,w){if(i)return n.flags&256?(n.flags&=-257,c=Gc(Error(r(422))),Ta(e,n,w,c)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(h=c.fallback,f=n.mode,c=Pa({mode:"visible",children:c.children},f,0,null),h=Mr(h,f,w,null),h.flags|=2,c.return=n,h.return=n,c.sibling=h,n.child=c,(n.mode&1)!==0&&ii(n,e.child,null,w),n.child.memoizedState=Qc(w),n.memoizedState=Xc,h);if((n.mode&1)===0)return Ta(e,n,w,null);if(f.data==="$!"){if(c=f.nextSibling&&f.nextSibling.dataset,c)var C=c.dgst;return c=C,h=Error(r(419)),c=Gc(h,c,void 0),Ta(e,n,w,c)}if(C=(w&e.childLanes)!==0,En||C){if(c=Yt,c!==null){switch(w&-w){case 4:f=2;break;case 16:f=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:f=32;break;case 536870912:f=268435456;break;default:f=0}f=(f&(c.suspendedLanes|w))!==0?0:f,f!==0&&f!==h.retryLane&&(h.retryLane=f,Ms(e,f),as(c,e,f,-1))}return hu(),c=Gc(Error(r(421))),Ta(e,n,w,c)}return f.data==="$?"?(n.flags|=128,n.child=e.child,n=Ox.bind(null,e),f._reactRetry=n,null):(e=h.treeContext,Un=qs(f.nextSibling),Fn=n,xt=!0,ss=null,e!==null&&(Gn[Kn++]=As,Gn[Kn++]=Is,Gn[Kn++]=Tr,As=e.id,Is=e.overflow,Tr=n),n=Zc(n,c.children),n.flags|=4096,n)}function zp(e,n,i){e.lanes|=n;var c=e.alternate;c!==null&&(c.lanes|=n),_c(e.return,n,i)}function Jc(e,n,i,c,f){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:c,tail:i,tailMode:f}:(h.isBackwards=n,h.rendering=null,h.renderingStartTime=0,h.last=c,h.tail=i,h.tailMode=f)}function Fp(e,n,i){var c=n.pendingProps,f=c.revealOrder,h=c.tail;if(kn(e,n,c.children,i),c=Tt.current,(c&2)!==0)c=c&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zp(e,i,n);else if(e.tag===19)zp(e,i,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}c&=1}if(ut(Tt,c),(n.mode&1)===0)n.memoizedState=null;else switch(f){case"forwards":for(i=n.child,f=null;i!==null;)e=i.alternate,e!==null&&va(e)===null&&(f=i),i=i.sibling;i=f,i===null?(f=n.child,n.child=null):(f=i.sibling,i.sibling=null),Jc(n,!1,f,i,h);break;case"backwards":for(i=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&va(e)===null){n.child=f;break}e=f.sibling,f.sibling=i,i=f,f=e}Jc(n,!0,i,null,h);break;case"together":Jc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Na(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function Ls(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),_r|=n.lanes,(i&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(r(153));if(n.child!==null){for(e=n.child,i=ir(e,e.pendingProps),n.child=i,i.return=n;e.sibling!==null;)e=e.sibling,i=i.sibling=ir(e,e.pendingProps),i.return=n;i.sibling=null}return n.child}function Tx(e,n,i){switch(n.tag){case 3:Op(n),ri();break;case 5:ep(n);break;case 1:Cn(n.type)&&aa(n);break;case 4:Ic(n,n.stateNode.containerInfo);break;case 10:var c=n.type._context,f=n.memoizedProps.value;ut(pa,c._currentValue),c._currentValue=f;break;case 13:if(c=n.memoizedState,c!==null)return c.dehydrated!==null?(ut(Tt,Tt.current&1),n.flags|=128,null):(i&n.child.childLanes)!==0?$p(e,n,i):(ut(Tt,Tt.current&1),e=Ls(e,n,i),e!==null?e.sibling:null);ut(Tt,Tt.current&1);break;case 19:if(c=(i&n.childLanes)!==0,(e.flags&128)!==0){if(c)return Fp(e,n,i);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),ut(Tt,Tt.current),c)break;return null;case 22:case 23:return n.lanes=0,Mp(e,n,i)}return Ls(e,n,i)}var Up,eu,Bp,Wp;Up=function(e,n){for(var i=n.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},eu=function(){},Bp=function(e,n,i,c){var f=e.memoizedProps;if(f!==c){e=n.stateNode,Cr(ks.current);var h=null;switch(i){case"input":f=$e(e,f),c=$e(e,c),h=[];break;case"select":f=q({},f,{value:void 0}),c=q({},c,{value:void 0}),h=[];break;case"textarea":f=Dt(e,f),c=Dt(e,c),h=[];break;default:typeof f.onClick!="function"&&typeof c.onClick=="function"&&(e.onclick=ra)}ts(i,c);var w;i=null;for(H in f)if(!c.hasOwnProperty(H)&&f.hasOwnProperty(H)&&f[H]!=null)if(H==="style"){var C=f[H];for(w in C)C.hasOwnProperty(w)&&(i||(i={}),i[w]="")}else H!=="dangerouslySetInnerHTML"&&H!=="children"&&H!=="suppressContentEditableWarning"&&H!=="suppressHydrationWarning"&&H!=="autoFocus"&&(l.hasOwnProperty(H)?h||(h=[]):(h=h||[]).push(H,null));for(H in c){var L=c[H];if(C=f!=null?f[H]:void 0,c.hasOwnProperty(H)&&L!==C&&(L!=null||C!=null))if(H==="style")if(C){for(w in C)!C.hasOwnProperty(w)||L&&L.hasOwnProperty(w)||(i||(i={}),i[w]="");for(w in L)L.hasOwnProperty(w)&&C[w]!==L[w]&&(i||(i={}),i[w]=L[w])}else i||(h||(h=[]),h.push(H,i)),i=L;else H==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,C=C?C.__html:void 0,L!=null&&C!==L&&(h=h||[]).push(H,L)):H==="children"?typeof L!="string"&&typeof L!="number"||(h=h||[]).push(H,""+L):H!=="suppressContentEditableWarning"&&H!=="suppressHydrationWarning"&&(l.hasOwnProperty(H)?(L!=null&&H==="onScroll"&&pt("scroll",e),h||C===L||(h=[])):(h=h||[]).push(H,L))}i&&(h=h||[]).push("style",i);var H=h;(n.updateQueue=H)&&(n.flags|=4)}},Wp=function(e,n,i,c){i!==c&&(n.flags|=4)};function no(e,n){if(!xt)switch(e.tailMode){case"hidden":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:c.sibling=null}}function dn(e){var n=e.alternate!==null&&e.alternate.child===e.child,i=0,c=0;if(n)for(var f=e.child;f!==null;)i|=f.lanes|f.childLanes,c|=f.subtreeFlags&14680064,c|=f.flags&14680064,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)i|=f.lanes|f.childLanes,c|=f.subtreeFlags,c|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=c,e.childLanes=i,n}function Nx(e,n,i){var c=n.pendingProps;switch(Sc(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dn(n),null;case 1:return Cn(n.type)&&oa(),dn(n),null;case 3:return c=n.stateNode,li(),ht(jn),ht(cn),Lc(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(e===null||e.child===null)&&(da(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,ss!==null&&(du(ss),ss=null))),eu(e,n),dn(n),null;case 5:Mc(n);var f=Cr(Qi.current);if(i=n.type,e!==null&&n.stateNode!=null)Bp(e,n,i,c,f),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!c){if(n.stateNode===null)throw Error(r(166));return dn(n),null}if(e=Cr(ks.current),da(n)){c=n.stateNode,i=n.type;var h=n.memoizedProps;switch(c[ws]=n,c[Gi]=h,e=(n.mode&1)!==0,i){case"dialog":pt("cancel",c),pt("close",c);break;case"iframe":case"object":case"embed":pt("load",c);break;case"video":case"audio":for(f=0;f<Wi.length;f++)pt(Wi[f],c);break;case"source":pt("error",c);break;case"img":case"image":case"link":pt("error",c),pt("load",c);break;case"details":pt("toggle",c);break;case"input":en(c,h),pt("invalid",c);break;case"select":c._wrapperState={wasMultiple:!!h.multiple},pt("invalid",c);break;case"textarea":Y(c,h),pt("invalid",c)}ts(i,h),f=null;for(var w in h)if(h.hasOwnProperty(w)){var C=h[w];w==="children"?typeof C=="string"?c.textContent!==C&&(h.suppressHydrationWarning!==!0&&sa(c.textContent,C,e),f=["children",C]):typeof C=="number"&&c.textContent!==""+C&&(h.suppressHydrationWarning!==!0&&sa(c.textContent,C,e),f=["children",""+C]):l.hasOwnProperty(w)&&C!=null&&w==="onScroll"&&pt("scroll",c)}switch(i){case"input":He(c),tn(c,h,!0);break;case"textarea":He(c),Ue(c);break;case"select":case"option":break;default:typeof h.onClick=="function"&&(c.onclick=ra)}c=f,n.updateQueue=c,c!==null&&(n.flags|=4)}else{w=f.nodeType===9?f:f.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=nt(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=w.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof c.is=="string"?e=w.createElement(i,{is:c.is}):(e=w.createElement(i),i==="select"&&(w=e,c.multiple?w.multiple=!0:c.size&&(w.size=c.size))):e=w.createElementNS(e,i),e[ws]=n,e[Gi]=c,Up(e,n,!1,!1),n.stateNode=e;e:{switch(w=Ln(i,c),i){case"dialog":pt("cancel",e),pt("close",e),f=c;break;case"iframe":case"object":case"embed":pt("load",e),f=c;break;case"video":case"audio":for(f=0;f<Wi.length;f++)pt(Wi[f],e);f=c;break;case"source":pt("error",e),f=c;break;case"img":case"image":case"link":pt("error",e),pt("load",e),f=c;break;case"details":pt("toggle",e),f=c;break;case"input":en(e,c),f=$e(e,c),pt("invalid",e);break;case"option":f=c;break;case"select":e._wrapperState={wasMultiple:!!c.multiple},f=q({},c,{value:void 0}),pt("invalid",e);break;case"textarea":Y(e,c),f=Dt(e,c),pt("invalid",e);break;default:f=c}ts(i,f),C=f;for(h in C)if(C.hasOwnProperty(h)){var L=C[h];h==="style"?hs(e,L):h==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,L!=null&&Ct(e,L)):h==="children"?typeof L=="string"?(i!=="textarea"||L!=="")&&an(e,L):typeof L=="number"&&an(e,""+L):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(l.hasOwnProperty(h)?L!=null&&h==="onScroll"&&pt("scroll",e):L!=null&&W(e,h,L,w))}switch(i){case"input":He(e),tn(e,c,!1);break;case"textarea":He(e),Ue(e);break;case"option":c.value!=null&&e.setAttribute("value",""+se(c.value));break;case"select":e.multiple=!!c.multiple,h=c.value,h!=null?zt(e,!!c.multiple,h,!1):c.defaultValue!=null&&zt(e,!!c.multiple,c.defaultValue,!0);break;default:typeof f.onClick=="function"&&(e.onclick=ra)}switch(i){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}}c&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return dn(n),null;case 6:if(e&&n.stateNode!=null)Wp(e,n,e.memoizedProps,c);else{if(typeof c!="string"&&n.stateNode===null)throw Error(r(166));if(i=Cr(Qi.current),Cr(ks.current),da(n)){if(c=n.stateNode,i=n.memoizedProps,c[ws]=n,(h=c.nodeValue!==i)&&(e=Fn,e!==null))switch(e.tag){case 3:sa(c.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&sa(c.nodeValue,i,(e.mode&1)!==0)}h&&(n.flags|=4)}else c=(i.nodeType===9?i:i.ownerDocument).createTextNode(c),c[ws]=n,n.stateNode=c}return dn(n),null;case 13:if(ht(Tt),c=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(xt&&Un!==null&&(n.mode&1)!==0&&(n.flags&128)===0)Gf(),ri(),n.flags|=98560,h=!1;else if(h=da(n),c!==null&&c.dehydrated!==null){if(e===null){if(!h)throw Error(r(318));if(h=n.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(r(317));h[ws]=n}else ri(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;dn(n),h=!1}else ss!==null&&(du(ss),ss=null),h=!0;if(!h)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=i,n):(c=c!==null,c!==(e!==null&&e.memoizedState!==null)&&c&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(Tt.current&1)!==0?Bt===0&&(Bt=3):hu())),n.updateQueue!==null&&(n.flags|=4),dn(n),null);case 4:return li(),eu(e,n),e===null&&Hi(n.stateNode.containerInfo),dn(n),null;case 10:return Ec(n.type._context),dn(n),null;case 17:return Cn(n.type)&&oa(),dn(n),null;case 19:if(ht(Tt),h=n.memoizedState,h===null)return dn(n),null;if(c=(n.flags&128)!==0,w=h.rendering,w===null)if(c)no(h,!1);else{if(Bt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(w=va(e),w!==null){for(n.flags|=128,no(h,!1),c=w.updateQueue,c!==null&&(n.updateQueue=c,n.flags|=4),n.subtreeFlags=0,c=i,i=n.child;i!==null;)h=i,e=c,h.flags&=14680066,w=h.alternate,w===null?(h.childLanes=0,h.lanes=e,h.child=null,h.subtreeFlags=0,h.memoizedProps=null,h.memoizedState=null,h.updateQueue=null,h.dependencies=null,h.stateNode=null):(h.childLanes=w.childLanes,h.lanes=w.lanes,h.child=w.child,h.subtreeFlags=0,h.deletions=null,h.memoizedProps=w.memoizedProps,h.memoizedState=w.memoizedState,h.updateQueue=w.updateQueue,h.type=w.type,e=w.dependencies,h.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return ut(Tt,Tt.current&1|2),n.child}e=e.sibling}h.tail!==null&&kt()>fi&&(n.flags|=128,c=!0,no(h,!1),n.lanes=4194304)}else{if(!c)if(e=va(w),e!==null){if(n.flags|=128,c=!0,i=e.updateQueue,i!==null&&(n.updateQueue=i,n.flags|=4),no(h,!0),h.tail===null&&h.tailMode==="hidden"&&!w.alternate&&!xt)return dn(n),null}else 2*kt()-h.renderingStartTime>fi&&i!==1073741824&&(n.flags|=128,c=!0,no(h,!1),n.lanes=4194304);h.isBackwards?(w.sibling=n.child,n.child=w):(i=h.last,i!==null?i.sibling=w:n.child=w,h.last=w)}return h.tail!==null?(n=h.tail,h.rendering=n,h.tail=n.sibling,h.renderingStartTime=kt(),n.sibling=null,i=Tt.current,ut(Tt,c?i&1|2:i&1),n):(dn(n),null);case 22:case 23:return pu(),c=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==c&&(n.flags|=8192),c&&(n.mode&1)!==0?(Bn&1073741824)!==0&&(dn(n),n.subtreeFlags&6&&(n.flags|=8192)):dn(n),null;case 24:return null;case 25:return null}throw Error(r(156,n.tag))}function jx(e,n){switch(Sc(n),n.tag){case 1:return Cn(n.type)&&oa(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return li(),ht(jn),ht(cn),Lc(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Mc(n),null;case 13:if(ht(Tt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(r(340));ri()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return ht(Tt),null;case 4:return li(),null;case 10:return Ec(n.type._context),null;case 22:case 23:return pu(),null;case 24:return null;default:return null}}var ja=!1,fn=!1,Cx=typeof WeakSet=="function"?WeakSet:Set,ke=null;function ui(e,n){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(c){Rt(e,n,c)}else i.current=null}function tu(e,n,i){try{i()}catch(c){Rt(e,n,c)}}var Hp=!1;function Ex(e,n){if(pc=Go,e=Sf(),ic(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var c=i.getSelection&&i.getSelection();if(c&&c.rangeCount!==0){i=c.anchorNode;var f=c.anchorOffset,h=c.focusNode;c=c.focusOffset;try{i.nodeType,h.nodeType}catch{i=null;break e}var w=0,C=-1,L=-1,H=0,ne=0,re=e,ee=null;t:for(;;){for(var xe;re!==i||f!==0&&re.nodeType!==3||(C=w+f),re!==h||c!==0&&re.nodeType!==3||(L=w+c),re.nodeType===3&&(w+=re.nodeValue.length),(xe=re.firstChild)!==null;)ee=re,re=xe;for(;;){if(re===e)break t;if(ee===i&&++H===f&&(C=w),ee===h&&++ne===c&&(L=w),(xe=re.nextSibling)!==null)break;re=ee,ee=re.parentNode}re=xe}i=C===-1||L===-1?null:{start:C,end:L}}else i=null}i=i||{start:0,end:0}}else i=null;for(hc={focusedElem:e,selectionRange:i},Go=!1,ke=n;ke!==null;)if(n=ke,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,ke=e;else for(;ke!==null;){n=ke;try{var Ne=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var Ee=Ne.memoizedProps,It=Ne.memoizedState,U=n.stateNode,O=U.getSnapshotBeforeUpdate(n.elementType===n.type?Ee:rs(n.type,Ee),It);U.__reactInternalSnapshotBeforeUpdate=O}break;case 3:var B=n.stateNode.containerInfo;B.nodeType===1?B.textContent="":B.nodeType===9&&B.documentElement&&B.removeChild(B.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ue){Rt(n,n.return,ue)}if(e=n.sibling,e!==null){e.return=n.return,ke=e;break}ke=n.return}return Ne=Hp,Hp=!1,Ne}function so(e,n,i){var c=n.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var f=c=c.next;do{if((f.tag&e)===e){var h=f.destroy;f.destroy=void 0,h!==void 0&&tu(n,i,h)}f=f.next}while(f!==c)}}function Ca(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var c=i.create;i.destroy=c()}i=i.next}while(i!==n)}}function nu(e){var n=e.ref;if(n!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof n=="function"?n(e):n.current=e}}function Vp(e){var n=e.alternate;n!==null&&(e.alternate=null,Vp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[ws],delete n[Gi],delete n[yc],delete n[ux],delete n[dx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Gp(e){return e.tag===5||e.tag===3||e.tag===4}function Kp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gp(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.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function su(e,n,i){var c=e.tag;if(c===5||c===6)e=e.stateNode,n?i.nodeType===8?i.parentNode.insertBefore(e,n):i.insertBefore(e,n):(i.nodeType===8?(n=i.parentNode,n.insertBefore(e,i)):(n=i,n.appendChild(e)),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=ra));else if(c!==4&&(e=e.child,e!==null))for(su(e,n,i),e=e.sibling;e!==null;)su(e,n,i),e=e.sibling}function ru(e,n,i){var c=e.tag;if(c===5||c===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(c!==4&&(e=e.child,e!==null))for(ru(e,n,i),e=e.sibling;e!==null;)ru(e,n,i),e=e.sibling}var nn=null,is=!1;function er(e,n,i){for(i=i.child;i!==null;)qp(e,n,i),i=i.sibling}function qp(e,n,i){if($n&&typeof $n.onCommitFiberUnmount=="function")try{$n.onCommitFiberUnmount(vr,i)}catch{}switch(i.tag){case 5:fn||ui(i,n);case 6:var c=nn,f=is;nn=null,er(e,n,i),nn=c,is=f,nn!==null&&(is?(e=nn,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):nn.removeChild(i.stateNode));break;case 18:nn!==null&&(is?(e=nn,i=i.stateNode,e.nodeType===8?vc(e.parentNode,i):e.nodeType===1&&vc(e,i),Li(e)):vc(nn,i.stateNode));break;case 4:c=nn,f=is,nn=i.stateNode.containerInfo,is=!0,er(e,n,i),nn=c,is=f;break;case 0:case 11:case 14:case 15:if(!fn&&(c=i.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){f=c=c.next;do{var h=f,w=h.destroy;h=h.tag,w!==void 0&&((h&2)!==0||(h&4)!==0)&&tu(i,n,w),f=f.next}while(f!==c)}er(e,n,i);break;case 1:if(!fn&&(ui(i,n),c=i.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=i.memoizedProps,c.state=i.memoizedState,c.componentWillUnmount()}catch(C){Rt(i,n,C)}er(e,n,i);break;case 21:er(e,n,i);break;case 22:i.mode&1?(fn=(c=fn)||i.memoizedState!==null,er(e,n,i),fn=c):er(e,n,i);break;default:er(e,n,i)}}function Yp(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Cx),n.forEach(function(c){var f=Px.bind(null,e,c);i.has(c)||(i.add(c),c.then(f,f))})}}function os(e,n){var i=n.deletions;if(i!==null)for(var c=0;c<i.length;c++){var f=i[c];try{var h=e,w=n,C=w;e:for(;C!==null;){switch(C.tag){case 5:nn=C.stateNode,is=!1;break e;case 3:nn=C.stateNode.containerInfo,is=!0;break e;case 4:nn=C.stateNode.containerInfo,is=!0;break e}C=C.return}if(nn===null)throw Error(r(160));qp(h,w,f),nn=null,is=!1;var L=f.alternate;L!==null&&(L.return=null),f.return=null}catch(H){Rt(f,n,H)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)Xp(n,e),n=n.sibling}function Xp(e,n){var i=e.alternate,c=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(os(n,e),bs(e),c&4){try{so(3,e,e.return),Ca(3,e)}catch(Ee){Rt(e,e.return,Ee)}try{so(5,e,e.return)}catch(Ee){Rt(e,e.return,Ee)}}break;case 1:os(n,e),bs(e),c&512&&i!==null&&ui(i,i.return);break;case 5:if(os(n,e),bs(e),c&512&&i!==null&&ui(i,i.return),e.flags&32){var f=e.stateNode;try{an(f,"")}catch(Ee){Rt(e,e.return,Ee)}}if(c&4&&(f=e.stateNode,f!=null)){var h=e.memoizedProps,w=i!==null?i.memoizedProps:h,C=e.type,L=e.updateQueue;if(e.updateQueue=null,L!==null)try{C==="input"&&h.type==="radio"&&h.name!=null&&Fe(f,h),Ln(C,w);var H=Ln(C,h);for(w=0;w<L.length;w+=2){var ne=L[w],re=L[w+1];ne==="style"?hs(f,re):ne==="dangerouslySetInnerHTML"?Ct(f,re):ne==="children"?an(f,re):W(f,ne,re,H)}switch(C){case"input":Ht(f,h);break;case"textarea":ve(f,h);break;case"select":var ee=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!h.multiple;var xe=h.value;xe!=null?zt(f,!!h.multiple,xe,!1):ee!==!!h.multiple&&(h.defaultValue!=null?zt(f,!!h.multiple,h.defaultValue,!0):zt(f,!!h.multiple,h.multiple?[]:"",!1))}f[Gi]=h}catch(Ee){Rt(e,e.return,Ee)}}break;case 6:if(os(n,e),bs(e),c&4){if(e.stateNode===null)throw Error(r(162));f=e.stateNode,h=e.memoizedProps;try{f.nodeValue=h}catch(Ee){Rt(e,e.return,Ee)}}break;case 3:if(os(n,e),bs(e),c&4&&i!==null&&i.memoizedState.isDehydrated)try{Li(n.containerInfo)}catch(Ee){Rt(e,e.return,Ee)}break;case 4:os(n,e),bs(e);break;case 13:os(n,e),bs(e),f=e.child,f.flags&8192&&(h=f.memoizedState!==null,f.stateNode.isHidden=h,!h||f.alternate!==null&&f.alternate.memoizedState!==null||(au=kt())),c&4&&Yp(e);break;case 22:if(ne=i!==null&&i.memoizedState!==null,e.mode&1?(fn=(H=fn)||ne,os(n,e),fn=H):os(n,e),bs(e),c&8192){if(H=e.memoizedState!==null,(e.stateNode.isHidden=H)&&!ne&&(e.mode&1)!==0)for(ke=e,ne=e.child;ne!==null;){for(re=ke=ne;ke!==null;){switch(ee=ke,xe=ee.child,ee.tag){case 0:case 11:case 14:case 15:so(4,ee,ee.return);break;case 1:ui(ee,ee.return);var Ne=ee.stateNode;if(typeof Ne.componentWillUnmount=="function"){c=ee,i=ee.return;try{n=c,Ne.props=n.memoizedProps,Ne.state=n.memoizedState,Ne.componentWillUnmount()}catch(Ee){Rt(c,i,Ee)}}break;case 5:ui(ee,ee.return);break;case 22:if(ee.memoizedState!==null){Jp(re);continue}}xe!==null?(xe.return=ee,ke=xe):Jp(re)}ne=ne.sibling}e:for(ne=null,re=e;;){if(re.tag===5){if(ne===null){ne=re;try{f=re.stateNode,H?(h=f.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none"):(C=re.stateNode,L=re.memoizedProps.style,w=L!=null&&L.hasOwnProperty("display")?L.display:null,C.style.display=Dn("display",w))}catch(Ee){Rt(e,e.return,Ee)}}}else if(re.tag===6){if(ne===null)try{re.stateNode.nodeValue=H?"":re.memoizedProps}catch(Ee){Rt(e,e.return,Ee)}}else if((re.tag!==22&&re.tag!==23||re.memoizedState===null||re===e)&&re.child!==null){re.child.return=re,re=re.child;continue}if(re===e)break e;for(;re.sibling===null;){if(re.return===null||re.return===e)break e;ne===re&&(ne=null),re=re.return}ne===re&&(ne=null),re.sibling.return=re.return,re=re.sibling}}break;case 19:os(n,e),bs(e),c&4&&Yp(e);break;case 21:break;default:os(n,e),bs(e)}}function bs(e){var n=e.flags;if(n&2){try{e:{for(var i=e.return;i!==null;){if(Gp(i)){var c=i;break e}i=i.return}throw Error(r(160))}switch(c.tag){case 5:var f=c.stateNode;c.flags&32&&(an(f,""),c.flags&=-33);var h=Kp(e);ru(e,h,f);break;case 3:case 4:var w=c.stateNode.containerInfo,C=Kp(e);su(e,C,w);break;default:throw Error(r(161))}}catch(L){Rt(e,e.return,L)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function _x(e,n,i){ke=e,Qp(e)}function Qp(e,n,i){for(var c=(e.mode&1)!==0;ke!==null;){var f=ke,h=f.child;if(f.tag===22&&c){var w=f.memoizedState!==null||ja;if(!w){var C=f.alternate,L=C!==null&&C.memoizedState!==null||fn;C=ja;var H=fn;if(ja=w,(fn=L)&&!H)for(ke=f;ke!==null;)w=ke,L=w.child,w.tag===22&&w.memoizedState!==null?eh(f):L!==null?(L.return=w,ke=L):eh(f);for(;h!==null;)ke=h,Qp(h),h=h.sibling;ke=f,ja=C,fn=H}Zp(e)}else(f.subtreeFlags&8772)!==0&&h!==null?(h.return=f,ke=h):Zp(e)}}function Zp(e){for(;ke!==null;){var n=ke;if((n.flags&8772)!==0){var i=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:fn||Ca(5,n);break;case 1:var c=n.stateNode;if(n.flags&4&&!fn)if(i===null)c.componentDidMount();else{var f=n.elementType===n.type?i.memoizedProps:rs(n.type,i.memoizedProps);c.componentDidUpdate(f,i.memoizedState,c.__reactInternalSnapshotBeforeUpdate)}var h=n.updateQueue;h!==null&&Jf(n,h,c);break;case 3:var w=n.updateQueue;if(w!==null){if(i=null,n.child!==null)switch(n.child.tag){case 5:i=n.child.stateNode;break;case 1:i=n.child.stateNode}Jf(n,w,i)}break;case 5:var C=n.stateNode;if(i===null&&n.flags&4){i=C;var L=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":L.autoFocus&&i.focus();break;case"img":L.src&&(i.src=L.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var H=n.alternate;if(H!==null){var ne=H.memoizedState;if(ne!==null){var re=ne.dehydrated;re!==null&&Li(re)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}fn||n.flags&512&&nu(n)}catch(ee){Rt(n,n.return,ee)}}if(n===e){ke=null;break}if(i=n.sibling,i!==null){i.return=n.return,ke=i;break}ke=n.return}}function Jp(e){for(;ke!==null;){var n=ke;if(n===e){ke=null;break}var i=n.sibling;if(i!==null){i.return=n.return,ke=i;break}ke=n.return}}function eh(e){for(;ke!==null;){var n=ke;try{switch(n.tag){case 0:case 11:case 15:var i=n.return;try{Ca(4,n)}catch(L){Rt(n,i,L)}break;case 1:var c=n.stateNode;if(typeof c.componentDidMount=="function"){var f=n.return;try{c.componentDidMount()}catch(L){Rt(n,f,L)}}var h=n.return;try{nu(n)}catch(L){Rt(n,h,L)}break;case 5:var w=n.return;try{nu(n)}catch(L){Rt(n,w,L)}}}catch(L){Rt(n,n.return,L)}if(n===e){ke=null;break}var C=n.sibling;if(C!==null){C.return=n.return,ke=C;break}ke=n.return}}var Rx=Math.ceil,Ea=A.ReactCurrentDispatcher,iu=A.ReactCurrentOwner,Xn=A.ReactCurrentBatchConfig,Xe=0,Yt=null,Ot=null,sn=0,Bn=0,di=Ys(0),Bt=0,ro=null,_r=0,_a=0,ou=0,io=null,_n=null,au=0,fi=1/0,Os=null,Ra=!1,lu=null,tr=null,Aa=!1,nr=null,Ia=0,oo=0,cu=null,Ma=-1,Da=0;function Sn(){return(Xe&6)!==0?kt():Ma!==-1?Ma:Ma=kt()}function sr(e){return(e.mode&1)===0?1:(Xe&2)!==0&&sn!==0?sn&-sn:px.transition!==null?(Da===0&&(Da=Ai()),Da):(e=qe,e!==0||(e=window.event,e=e===void 0?16:tf(e.type)),e)}function as(e,n,i,c){if(50<oo)throw oo=0,cu=null,Error(r(185));kr(e,i,c),((Xe&2)===0||e!==Yt)&&(e===Yt&&((Xe&2)===0&&(_a|=i),Bt===4&&rr(e,sn)),Rn(e,c),i===1&&Xe===0&&(n.mode&1)===0&&(fi=kt()+500,la&&Qs()))}function Rn(e,n){var i=e.callbackNode;Wo(e,n);var c=wr(e,e===Yt?sn:0);if(c===0)i!==null&&_t(i),e.callbackNode=null,e.callbackPriority=0;else if(n=c&-c,e.callbackPriority!==n){if(i!=null&&_t(i),n===1)e.tag===0?fx(nh.bind(null,e)):Uf(nh.bind(null,e)),lx(function(){(Xe&6)===0&&Qs()}),i=null;else{switch(ce(c)){case 1:i=Bs;break;case 4:i=xs;break;case 16:i=Br;break;case 536870912:i=Uo;break;default:i=Br}i=uh(i,th.bind(null,e))}e.callbackPriority=n,e.callbackNode=i}}function th(e,n){if(Ma=-1,Da=0,(Xe&6)!==0)throw Error(r(327));var i=e.callbackNode;if(pi()&&e.callbackNode!==i)return null;var c=wr(e,e===Yt?sn:0);if(c===0)return null;if((c&30)!==0||(c&e.expiredLanes)!==0||n)n=La(e,c);else{n=c;var f=Xe;Xe|=2;var h=rh();(Yt!==e||sn!==n)&&(Os=null,fi=kt()+500,Ar(e,n));do try{Mx();break}catch(C){sh(e,C)}while(!0);Cc(),Ea.current=h,Xe=f,Ot!==null?n=0:(Yt=null,sn=0,n=Bt)}if(n!==0){if(n===2&&(f=Ri(e),f!==0&&(c=f,n=uu(e,f))),n===1)throw i=ro,Ar(e,0),rr(e,c),Rn(e,kt()),i;if(n===6)rr(e,c);else{if(f=e.current.alternate,(c&30)===0&&!Ax(f)&&(n=La(e,c),n===2&&(h=Ri(e),h!==0&&(c=h,n=uu(e,h))),n===1))throw i=ro,Ar(e,0),rr(e,c),Rn(e,kt()),i;switch(e.finishedWork=f,e.finishedLanes=c,n){case 0:case 1:throw Error(r(345));case 2:Ir(e,_n,Os);break;case 3:if(rr(e,c),(c&130023424)===c&&(n=au+500-kt(),10<n)){if(wr(e,0)!==0)break;if(f=e.suspendedLanes,(f&c)!==c){Sn(),e.pingedLanes|=e.suspendedLanes&f;break}e.timeoutHandle=gc(Ir.bind(null,e,_n,Os),n);break}Ir(e,_n,Os);break;case 4:if(rr(e,c),(c&4194240)===c)break;for(n=e.eventTimes,f=-1;0<c;){var w=31-xn(c);h=1<<w,w=n[w],w>f&&(f=w),c&=~h}if(c=f,c=kt()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*Rx(c/1960))-c,10<c){e.timeoutHandle=gc(Ir.bind(null,e,_n,Os),c);break}Ir(e,_n,Os);break;case 5:Ir(e,_n,Os);break;default:throw Error(r(329))}}}return Rn(e,kt()),e.callbackNode===i?th.bind(null,e):null}function uu(e,n){var i=io;return e.current.memoizedState.isDehydrated&&(Ar(e,n).flags|=256),e=La(e,n),e!==2&&(n=_n,_n=i,n!==null&&du(n)),e}function du(e){_n===null?_n=e:_n.push.apply(_n,e)}function Ax(e){for(var n=e;;){if(n.flags&16384){var i=n.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var c=0;c<i.length;c++){var f=i[c],h=f.getSnapshot;f=f.value;try{if(!ns(h(),f))return!1}catch{return!1}}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function rr(e,n){for(n&=~ou,n&=~_a,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var i=31-xn(n),c=1<<i;e[i]=-1,n&=~c}}function nh(e){if((Xe&6)!==0)throw Error(r(327));pi();var n=wr(e,0);if((n&1)===0)return Rn(e,kt()),null;var i=La(e,n);if(e.tag!==0&&i===2){var c=Ri(e);c!==0&&(n=c,i=uu(e,c))}if(i===1)throw i=ro,Ar(e,0),rr(e,n),Rn(e,kt()),i;if(i===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Ir(e,_n,Os),Rn(e,kt()),null}function fu(e,n){var i=Xe;Xe|=1;try{return e(n)}finally{Xe=i,Xe===0&&(fi=kt()+500,la&&Qs())}}function Rr(e){nr!==null&&nr.tag===0&&(Xe&6)===0&&pi();var n=Xe;Xe|=1;var i=Xn.transition,c=qe;try{if(Xn.transition=null,qe=1,e)return e()}finally{qe=c,Xn.transition=i,Xe=n,(Xe&6)===0&&Qs()}}function pu(){Bn=di.current,ht(di)}function Ar(e,n){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,ax(i)),Ot!==null)for(i=Ot.return;i!==null;){var c=i;switch(Sc(c),c.tag){case 1:c=c.type.childContextTypes,c!=null&&oa();break;case 3:li(),ht(jn),ht(cn),Lc();break;case 5:Mc(c);break;case 4:li();break;case 13:ht(Tt);break;case 19:ht(Tt);break;case 10:Ec(c.type._context);break;case 22:case 23:pu()}i=i.return}if(Yt=e,Ot=e=ir(e.current,null),sn=Bn=n,Bt=0,ro=null,ou=_a=_r=0,_n=io=null,jr!==null){for(n=0;n<jr.length;n++)if(i=jr[n],c=i.interleaved,c!==null){i.interleaved=null;var f=c.next,h=i.pending;if(h!==null){var w=h.next;h.next=f,c.next=w}i.pending=c}jr=null}return e}function sh(e,n){do{var i=Ot;try{if(Cc(),ya.current=Sa,xa){for(var c=Nt.memoizedState;c!==null;){var f=c.queue;f!==null&&(f.pending=null),c=c.next}xa=!1}if(Er=0,qt=Ut=Nt=null,Zi=!1,Ji=0,iu.current=null,i===null||i.return===null){Bt=1,ro=n,Ot=null;break}e:{var h=e,w=i.return,C=i,L=n;if(n=sn,C.flags|=32768,L!==null&&typeof L=="object"&&typeof L.then=="function"){var H=L,ne=C,re=ne.tag;if((ne.mode&1)===0&&(re===0||re===11||re===15)){var ee=ne.alternate;ee?(ne.updateQueue=ee.updateQueue,ne.memoizedState=ee.memoizedState,ne.lanes=ee.lanes):(ne.updateQueue=null,ne.memoizedState=null)}var xe=Ep(w);if(xe!==null){xe.flags&=-257,_p(xe,w,C,h,n),xe.mode&1&&Cp(h,H,n),n=xe,L=H;var Ne=n.updateQueue;if(Ne===null){var Ee=new Set;Ee.add(L),n.updateQueue=Ee}else Ne.add(L);break e}else{if((n&1)===0){Cp(h,H,n),hu();break e}L=Error(r(426))}}else if(xt&&C.mode&1){var It=Ep(w);if(It!==null){(It.flags&65536)===0&&(It.flags|=256),_p(It,w,C,h,n),Nc(ci(L,C));break e}}h=L=ci(L,C),Bt!==4&&(Bt=2),io===null?io=[h]:io.push(h),h=w;do{switch(h.tag){case 3:h.flags|=65536,n&=-n,h.lanes|=n;var U=Np(h,L,n);Zf(h,U);break e;case 1:C=L;var O=h.type,B=h.stateNode;if((h.flags&128)===0&&(typeof O.getDerivedStateFromError=="function"||B!==null&&typeof B.componentDidCatch=="function"&&(tr===null||!tr.has(B)))){h.flags|=65536,n&=-n,h.lanes|=n;var ue=jp(h,C,n);Zf(h,ue);break e}}h=h.return}while(h!==null)}oh(i)}catch(_e){n=_e,Ot===i&&i!==null&&(Ot=i=i.return);continue}break}while(!0)}function rh(){var e=Ea.current;return Ea.current=Sa,e===null?Sa:e}function hu(){(Bt===0||Bt===3||Bt===2)&&(Bt=4),Yt===null||(_r&268435455)===0&&(_a&268435455)===0||rr(Yt,sn)}function La(e,n){var i=Xe;Xe|=2;var c=rh();(Yt!==e||sn!==n)&&(Os=null,Ar(e,n));do try{Ix();break}catch(f){sh(e,f)}while(!0);if(Cc(),Xe=i,Ea.current=c,Ot!==null)throw Error(r(261));return Yt=null,sn=0,Bt}function Ix(){for(;Ot!==null;)ih(Ot)}function Mx(){for(;Ot!==null&&!vs();)ih(Ot)}function ih(e){var n=ch(e.alternate,e,Bn);e.memoizedProps=e.pendingProps,n===null?oh(e):Ot=n,iu.current=null}function oh(e){var n=e;do{var i=n.alternate;if(e=n.return,(n.flags&32768)===0){if(i=Nx(i,n,Bn),i!==null){Ot=i;return}}else{if(i=jx(i,n),i!==null){i.flags&=32767,Ot=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Bt=6,Ot=null;return}}if(n=n.sibling,n!==null){Ot=n;return}Ot=n=e}while(n!==null);Bt===0&&(Bt=5)}function Ir(e,n,i){var c=qe,f=Xn.transition;try{Xn.transition=null,qe=1,Dx(e,n,i,c)}finally{Xn.transition=f,qe=c}return null}function Dx(e,n,i,c){do pi();while(nr!==null);if((Xe&6)!==0)throw Error(r(327));i=e.finishedWork;var f=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var h=i.lanes|i.childLanes;if(Ho(e,h),e===Yt&&(Ot=Yt=null,sn=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||Aa||(Aa=!0,uh(Br,function(){return pi(),null})),h=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||h){h=Xn.transition,Xn.transition=null;var w=qe;qe=1;var C=Xe;Xe|=4,iu.current=null,Ex(e,i),Xp(i,e),ex(hc),Go=!!pc,hc=pc=null,e.current=i,_x(i),Kl(),Xe=C,qe=w,Xn.transition=h}else e.current=i;if(Aa&&(Aa=!1,nr=e,Ia=f),h=e.pendingLanes,h===0&&(tr=null),Wr(i.stateNode),Rn(e,kt()),n!==null)for(c=e.onRecoverableError,i=0;i<n.length;i++)f=n[i],c(f.value,{componentStack:f.stack,digest:f.digest});if(Ra)throw Ra=!1,e=lu,lu=null,e;return(Ia&1)!==0&&e.tag!==0&&pi(),h=e.pendingLanes,(h&1)!==0?e===cu?oo++:(oo=0,cu=e):oo=0,Qs(),null}function pi(){if(nr!==null){var e=ce(Ia),n=Xn.transition,i=qe;try{if(Xn.transition=null,qe=16>e?16:e,nr===null)var c=!1;else{if(e=nr,nr=null,Ia=0,(Xe&6)!==0)throw Error(r(331));var f=Xe;for(Xe|=4,ke=e.current;ke!==null;){var h=ke,w=h.child;if((ke.flags&16)!==0){var C=h.deletions;if(C!==null){for(var L=0;L<C.length;L++){var H=C[L];for(ke=H;ke!==null;){var ne=ke;switch(ne.tag){case 0:case 11:case 15:so(8,ne,h)}var re=ne.child;if(re!==null)re.return=ne,ke=re;else for(;ke!==null;){ne=ke;var ee=ne.sibling,xe=ne.return;if(Vp(ne),ne===H){ke=null;break}if(ee!==null){ee.return=xe,ke=ee;break}ke=xe}}}var Ne=h.alternate;if(Ne!==null){var Ee=Ne.child;if(Ee!==null){Ne.child=null;do{var It=Ee.sibling;Ee.sibling=null,Ee=It}while(Ee!==null)}}ke=h}}if((h.subtreeFlags&2064)!==0&&w!==null)w.return=h,ke=w;else e:for(;ke!==null;){if(h=ke,(h.flags&2048)!==0)switch(h.tag){case 0:case 11:case 15:so(9,h,h.return)}var U=h.sibling;if(U!==null){U.return=h.return,ke=U;break e}ke=h.return}}var O=e.current;for(ke=O;ke!==null;){w=ke;var B=w.child;if((w.subtreeFlags&2064)!==0&&B!==null)B.return=w,ke=B;else e:for(w=O;ke!==null;){if(C=ke,(C.flags&2048)!==0)try{switch(C.tag){case 0:case 11:case 15:Ca(9,C)}}catch(_e){Rt(C,C.return,_e)}if(C===w){ke=null;break e}var ue=C.sibling;if(ue!==null){ue.return=C.return,ke=ue;break e}ke=C.return}}if(Xe=f,Qs(),$n&&typeof $n.onPostCommitFiberRoot=="function")try{$n.onPostCommitFiberRoot(vr,e)}catch{}c=!0}return c}finally{qe=i,Xn.transition=n}}return!1}function ah(e,n,i){n=ci(i,n),n=Np(e,n,1),e=Js(e,n,1),n=Sn(),e!==null&&(kr(e,1,n),Rn(e,n))}function Rt(e,n,i){if(e.tag===3)ah(e,e,i);else for(;n!==null;){if(n.tag===3){ah(n,e,i);break}else if(n.tag===1){var c=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(tr===null||!tr.has(c))){e=ci(i,e),e=jp(n,e,1),n=Js(n,e,1),e=Sn(),n!==null&&(kr(n,1,e),Rn(n,e));break}}n=n.return}}function Lx(e,n,i){var c=e.pingCache;c!==null&&c.delete(n),n=Sn(),e.pingedLanes|=e.suspendedLanes&i,Yt===e&&(sn&i)===i&&(Bt===4||Bt===3&&(sn&130023424)===sn&&500>kt()-au?Ar(e,0):ou|=i),Rn(e,n)}function lh(e,n){n===0&&((e.mode&1)===0?n=1:(n=Vr,Vr<<=1,(Vr&130023424)===0&&(Vr=4194304)));var i=Sn();e=Ms(e,n),e!==null&&(kr(e,n,i),Rn(e,i))}function Ox(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),lh(e,i)}function Px(e,n){var i=0;switch(e.tag){case 13:var c=e.stateNode,f=e.memoizedState;f!==null&&(i=f.retryLane);break;case 19:c=e.stateNode;break;default:throw Error(r(314))}c!==null&&c.delete(n),lh(e,i)}var ch;ch=function(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps||jn.current)En=!0;else{if((e.lanes&i)===0&&(n.flags&128)===0)return En=!1,Tx(e,n,i);En=(e.flags&131072)!==0}else En=!1,xt&&(n.flags&1048576)!==0&&Bf(n,ua,n.index);switch(n.lanes=0,n.tag){case 2:var c=n.type;Na(e,n),e=n.pendingProps;var f=ti(n,cn.current);ai(n,i),f=$c(null,n,c,e,f,i);var h=zc();return n.flags|=1,typeof f=="object"&&f!==null&&typeof f.render=="function"&&f.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Cn(c)?(h=!0,aa(n)):h=!1,n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,Ac(n),f.updater=ba,n.stateNode=f,f._reactInternals=n,Vc(n,c,e,i),n=Yc(null,n,c,!0,h,i)):(n.tag=0,xt&&h&&kc(n),kn(null,n,f,i),n=n.child),n;case 16:c=n.elementType;e:{switch(Na(e,n),e=n.pendingProps,f=c._init,c=f(c._payload),n.type=c,f=n.tag=zx(c),e=rs(c,e),f){case 0:n=qc(null,n,c,e,i);break e;case 1:n=Lp(null,n,c,e,i);break e;case 11:n=Rp(null,n,c,e,i);break e;case 14:n=Ap(null,n,c,rs(c.type,e),i);break e}throw Error(r(306,c,""))}return n;case 0:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:rs(c,f),qc(e,n,c,f,i);case 1:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:rs(c,f),Lp(e,n,c,f,i);case 3:e:{if(Op(n),e===null)throw Error(r(387));c=n.pendingProps,h=n.memoizedState,f=h.element,Qf(e,n),ga(n,c,null,i);var w=n.memoizedState;if(c=w.element,h.isDehydrated)if(h={element:c,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){f=ci(Error(r(423)),n),n=Pp(e,n,c,i,f);break e}else if(c!==f){f=ci(Error(r(424)),n),n=Pp(e,n,c,i,f);break e}else for(Un=qs(n.stateNode.containerInfo.firstChild),Fn=n,xt=!0,ss=null,i=Yf(n,null,c,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(ri(),c===f){n=Ls(e,n,i);break e}kn(e,n,c,i)}n=n.child}return n;case 5:return ep(n),e===null&&Tc(n),c=n.type,f=n.pendingProps,h=e!==null?e.memoizedProps:null,w=f.children,mc(c,f)?w=null:h!==null&&mc(c,h)&&(n.flags|=32),Dp(e,n),kn(e,n,w,i),n.child;case 6:return e===null&&Tc(n),null;case 13:return $p(e,n,i);case 4:return Ic(n,n.stateNode.containerInfo),c=n.pendingProps,e===null?n.child=ii(n,null,c,i):kn(e,n,c,i),n.child;case 11:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:rs(c,f),Rp(e,n,c,f,i);case 7:return kn(e,n,n.pendingProps,i),n.child;case 8:return kn(e,n,n.pendingProps.children,i),n.child;case 12:return kn(e,n,n.pendingProps.children,i),n.child;case 10:e:{if(c=n.type._context,f=n.pendingProps,h=n.memoizedProps,w=f.value,ut(pa,c._currentValue),c._currentValue=w,h!==null)if(ns(h.value,w)){if(h.children===f.children&&!jn.current){n=Ls(e,n,i);break e}}else for(h=n.child,h!==null&&(h.return=n);h!==null;){var C=h.dependencies;if(C!==null){w=h.child;for(var L=C.firstContext;L!==null;){if(L.context===c){if(h.tag===1){L=Ds(-1,i&-i),L.tag=2;var H=h.updateQueue;if(H!==null){H=H.shared;var ne=H.pending;ne===null?L.next=L:(L.next=ne.next,ne.next=L),H.pending=L}}h.lanes|=i,L=h.alternate,L!==null&&(L.lanes|=i),_c(h.return,i,n),C.lanes|=i;break}L=L.next}}else if(h.tag===10)w=h.type===n.type?null:h.child;else if(h.tag===18){if(w=h.return,w===null)throw Error(r(341));w.lanes|=i,C=w.alternate,C!==null&&(C.lanes|=i),_c(w,i,n),w=h.sibling}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===n){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}kn(e,n,f.children,i),n=n.child}return n;case 9:return f=n.type,c=n.pendingProps.children,ai(n,i),f=qn(f),c=c(f),n.flags|=1,kn(e,n,c,i),n.child;case 14:return c=n.type,f=rs(c,n.pendingProps),f=rs(c.type,f),Ap(e,n,c,f,i);case 15:return Ip(e,n,n.type,n.pendingProps,i);case 17:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:rs(c,f),Na(e,n),n.tag=1,Cn(c)?(e=!0,aa(n)):e=!1,ai(n,i),bp(n,c,f),Vc(n,c,f,i),Yc(null,n,c,!0,e,i);case 19:return Fp(e,n,i);case 22:return Mp(e,n,i)}throw Error(r(156,n.tag))};function uh(e,n){return Ze(e,n)}function $x(e,n,i,c){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(e,n,i,c){return new $x(e,n,i,c)}function mu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zx(e){if(typeof e=="function")return mu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===je)return 11;if(e===Z)return 14}return 2}function ir(e,n){var i=e.alternate;return i===null?(i=Qn(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function Oa(e,n,i,c,f,h){var w=2;if(c=e,typeof e=="function")mu(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case V:return Mr(i.children,f,h,n);case $:w=8,f|=8;break;case te:return e=Qn(12,i,n,f|2),e.elementType=te,e.lanes=h,e;case K:return e=Qn(13,i,n,f),e.elementType=K,e.lanes=h,e;case be:return e=Qn(19,i,n,f),e.elementType=be,e.lanes=h,e;case ae:return Pa(i,f,h,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case me:w=10;break e;case de:w=9;break e;case je:w=11;break e;case Z:w=14;break e;case oe:w=16,c=null;break e}throw Error(r(130,e==null?e:typeof e,""))}return n=Qn(w,i,n,f),n.elementType=e,n.type=c,n.lanes=h,n}function Mr(e,n,i,c){return e=Qn(7,e,c,n),e.lanes=i,e}function Pa(e,n,i,c){return e=Qn(22,e,c,n),e.elementType=ae,e.lanes=i,e.stateNode={isHidden:!1},e}function gu(e,n,i){return e=Qn(6,e,null,n),e.lanes=i,e}function vu(e,n,i){return n=Qn(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Fx(e,n,i,c,f){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ii(0),this.expirationTimes=Ii(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ii(0),this.identifierPrefix=c,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function yu(e,n,i,c,f,h,w,C,L){return e=new Fx(e,n,i,C,L),n===1?(n=1,h===!0&&(n|=8)):n=0,h=Qn(3,null,null,n),e.current=h,h.stateNode=e,h.memoizedState={element:c,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ac(h),e}function Ux(e,n,i){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:G,key:c==null?null:""+c,children:e,containerInfo:n,implementation:i}}function dh(e){if(!e)return Xs;e=e._reactInternals;e:{if(Be(e)!==e||e.tag!==1)throw Error(r(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(Cn(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(r(171))}if(e.tag===1){var i=e.type;if(Cn(i))return zf(e,i,n)}return n}function fh(e,n,i,c,f,h,w,C,L){return e=yu(i,c,!0,e,f,h,w,C,L),e.context=dh(null),i=e.current,c=Sn(),f=sr(i),h=Ds(c,f),h.callback=n??null,Js(i,h,f),e.current.lanes=f,kr(e,f,c),Rn(e,c),e}function $a(e,n,i,c){var f=n.current,h=Sn(),w=sr(f);return i=dh(i),n.context===null?n.context=i:n.pendingContext=i,n=Ds(h,w),n.payload={element:e},c=c===void 0?null:c,c!==null&&(n.callback=c),e=Js(f,n,w),e!==null&&(as(e,f,w,h),ma(e,f,w)),w}function za(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function ph(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<n?i:n}}function xu(e,n){ph(e,n),(e=e.alternate)&&ph(e,n)}function Bx(){return null}var hh=typeof reportError=="function"?reportError:function(e){console.error(e)};function wu(e){this._internalRoot=e}Fa.prototype.render=wu.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(r(409));$a(e,n,null,null)},Fa.prototype.unmount=wu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Rr(function(){$a(null,e,null,null)}),n[_s]=null}};function Fa(e){this._internalRoot=e}Fa.prototype.unstable_scheduleHydration=function(e){if(e){var n=Ce();e={blockedOn:null,target:e,priority:n};for(var i=0;i<Vs.length&&n!==0&&n<Vs[i].priority;i++);Vs.splice(i,0,e),i===0&&Jd(e)}};function ku(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ua(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function mh(){}function Wx(e,n,i,c,f){if(f){if(typeof c=="function"){var h=c;c=function(){var H=za(w);h.call(H)}}var w=fh(n,c,e,0,null,!1,!1,"",mh);return e._reactRootContainer=w,e[_s]=w.current,Hi(e.nodeType===8?e.parentNode:e),Rr(),w}for(;f=e.lastChild;)e.removeChild(f);if(typeof c=="function"){var C=c;c=function(){var H=za(L);C.call(H)}}var L=yu(e,0,!1,null,null,!1,!1,"",mh);return e._reactRootContainer=L,e[_s]=L.current,Hi(e.nodeType===8?e.parentNode:e),Rr(function(){$a(n,L,i,c)}),L}function Ba(e,n,i,c,f){var h=i._reactRootContainer;if(h){var w=h;if(typeof f=="function"){var C=f;f=function(){var L=za(w);C.call(L)}}$a(n,w,e,f)}else w=Wx(i,n,e,f,c);return za(w)}b=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var i=xr(n.pendingLanes);i!==0&&(Hs(n,i|1),Rn(n,kt()),(Xe&6)===0&&(fi=kt()+500,Qs()))}break;case 13:Rr(function(){var c=Ms(e,1);if(c!==null){var f=Sn();as(c,e,1,f)}}),xu(e,1)}},F=function(e){if(e.tag===13){var n=Ms(e,134217728);if(n!==null){var i=Sn();as(n,e,134217728,i)}xu(e,134217728)}},J=function(e){if(e.tag===13){var n=sr(e),i=Ms(e,n);if(i!==null){var c=Sn();as(i,e,n,c)}xu(e,n)}},Ce=function(){return qe},Ae=function(e,n){var i=qe;try{return qe=e,n()}finally{qe=i}},Vt=function(e,n,i){switch(n){case"input":if(Ht(e,i),n=i.name,i.type==="radio"&&n!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<i.length;n++){var c=i[n];if(c!==e&&c.form===e.form){var f=ia(c);if(!f)throw Error(r(90));Re(c),Ht(c,f)}}}break;case"textarea":ve(e,i);break;case"select":n=i.value,n!=null&&zt(e,!!i.multiple,n,!1)}},vt=fu,yt=Rr;var Hx={usingClientEntryPoint:!1,Events:[Ki,Jr,ia,ft,Gt,fu]},ao={findFiberByHostInstance:Sr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Vx={bundleType:ao.bundleType,version:ao.version,rendererPackageName:ao.rendererPackageName,rendererConfig:ao.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Pn(e),e===null?null:e.stateNode},findFiberByHostInstance:ao.findFiberByHostInstance||Bx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Wa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wa.isDisabled&&Wa.supportsFiber)try{vr=Wa.inject(Vx),$n=Wa}catch{}}return An.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hx,An.createPortal=function(e,n){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ku(n))throw Error(r(200));return Ux(e,n,null,i)},An.createRoot=function(e,n){if(!ku(e))throw Error(r(299));var i=!1,c="",f=hh;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onRecoverableError!==void 0&&(f=n.onRecoverableError)),n=yu(e,1,!1,null,null,i,!1,c,f),e[_s]=n.current,Hi(e.nodeType===8?e.parentNode:e),new wu(n)},An.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=Pn(n),e=e===null?null:e.stateNode,e},An.flushSync=function(e){return Rr(e)},An.hydrate=function(e,n,i){if(!Ua(n))throw Error(r(200));return Ba(null,e,n,!0,i)},An.hydrateRoot=function(e,n,i){if(!ku(e))throw Error(r(405));var c=i!=null&&i.hydratedSources||null,f=!1,h="",w=hh;if(i!=null&&(i.unstable_strictMode===!0&&(f=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),n=fh(n,null,e,1,i??null,f,!1,h,w),e[_s]=n.current,Hi(e),c)for(e=0;e<c.length;e++)i=c[e],f=i._getVersion,f=f(i._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[i,f]:n.mutableSourceEagerHydrationData.push(i,f);return new Fa(n)},An.render=function(e,n,i){if(!Ua(n))throw Error(r(200));return Ba(null,e,n,!1,i)},An.unmountComponentAtNode=function(e){if(!Ua(e))throw Error(r(40));return e._reactRootContainer?(Rr(function(){Ba(null,null,e,!1,function(){e._reactRootContainer=null,e[_s]=null})}),!0):!1},An.unstable_batchedUpdates=fu,An.unstable_renderSubtreeIntoContainer=function(e,n,i,c){if(!Ua(i))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Ba(e,n,i,!1,c)},An.version="18.3.1-next-f1338f8080-20240426",An}var bh;function wg(){if(bh)return Tu.exports;bh=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(s){console.error(s)}}return t(),Tu.exports=e0(),Tu.exports}var Th;function t0(){if(Th)return Ha;Th=1;var t=wg();return Ha.createRoot=t.createRoot,Ha.hydrateRoot=t.hydrateRoot,Ha}var n0=t0();const s0=xg(n0),Nh=t=>{let s;const r=new Set,o=(m,v)=>{const k=typeof m=="function"?m(s):m;if(!Object.is(k,s)){const y=s;s=v??(typeof k!="object"||k===null)?k:Object.assign({},s,k),r.forEach(S=>S(s,y))}},l=()=>s,p={setState:o,getState:l,getInitialState:()=>g,subscribe:m=>(r.add(m),()=>r.delete(m))},g=s=t(o,l,p);return p},r0=(t=>t?Nh(t):Nh),i0=t=>t;function o0(t,s=i0){const r=lt.useSyncExternalStore(t.subscribe,lt.useCallback(()=>s(t.getState()),[t,s]),lt.useCallback(()=>s(t.getInitialState()),[t,s]));return lt.useDebugValue(r),r}const a0=t=>{const s=r0(t),r=o=>o0(s,o);return Object.assign(r,s),r},l0=(t=>a0),kg="agentpane:machines",Sg="agentpane:active-machine";function c0(t){return/^[a-z][a-z0-9-]{1,30}$/.test(t)}function bg(t){return`${t}.repoburg.com`}function Tg(t){const s=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(t);return s?s[1]:null}function Ng(t,s){try{const r=localStorage.getItem(t);return r==null?s:JSON.parse(r)}catch{return s}}function jg(t,s){try{localStorage.setItem(t,JSON.stringify(s))}catch{}}function u0(t){const{mahlas:s,hostname:r}=t??{};return typeof s=="string"&&c0(s)&&r===bg(s)}function Cg(){const t=Ng(kg,[]);return Array.isArray(t)?t.filter(u0):[]}function d0(t){const s={mahlas:t,hostname:bg(t),lastConnectedAt:new Date().toISOString()},r=Cg(),o=[s,...r.filter(l=>l.mahlas!==t)];return jg(kg,o),s}function f0(){const t=Ng(Sg,null);return t?Cg().find(s=>s.mahlas===t)??null:null}function p0(t){jg(Sg,t)}function h0(){if(typeof window>"u")return;const t=new URLSearchParams(window.location.search).get("host");if(!t)return;const s=Tg(t);s&&(d0(s),p0(s))}const jh="http://localhost:9998",m0=["agent.repoburg.com"];function mn(){if(typeof window>"u")return"";const t=new URLSearchParams(window.location.search),s=t.get("bport");if(s)return`http://localhost:${s}`;const r=t.get("host");if(r)return`https://${r}`;const o=window.location.hostname;if(m0.includes(o))return jh;if(Tg(o))return"";const l=f0();return l?`https://${l.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":jh}function g0(t){const s=mn();return s?`${s.replace(/^http/,"ws")}${t}`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${t}`}const v0="/api";class Il extends Error{constructor(r,o,l){super(r);it(this,"status");it(this,"body");this.name="ApiError",this.status=o,this.body=l}}function Pr(t){var s;if(t instanceof Il){const r=(s=t.body)==null?void 0:s.error;if(typeof r=="string"&&r)return r}return t instanceof Error?t.message:String(t)}async function Mo(t,s,r){const o=await fetch(`${mn()}${v0}${s}`,{method:t,headers:r?{"Content-Type":"application/json"}:void 0,body:r?JSON.stringify(r):void 0});if(!o.ok){let l=`${o.status} ${o.statusText}`,u=null;try{u=await o.json();const d=u==null?void 0:u.error;typeof d=="string"&&d&&(l=`${l} — ${d}`)}catch{}throw new Il(`${t} ${s} failed: ${l}`,o.status,u)}return o.json()}function $t(t){return Mo("GET",t)}function ot(t,s){return Mo("POST",t,s)}function Ml(t){return Mo("DELETE",t)}function ds(t,s){return Mo("PATCH",t,s)}function y0(t,s){return Mo("PUT",t,s)}function x0(){return $t("/sessions")}function co(t){return $t(`/sessions/${t}`)}function wd(t){return ot("/sessions",t)}function Ch(t){return Ml(`/sessions/${t}`)}function Eg(t,s,r,o){return ot(`/sessions/${t}/turns`,{user_prompt:s,...r!=null&&r.length?{attachments:r}:{},...o!=null&&o.originAppId?{origin_app_id:o.originAppId}:{}})}function w0(t){return ot(`/sessions/${t}/cancel`)}function k0(t,s){return ot(`/sessions/${t}/turns/${s}/resume`)}function S0(){return ot("/turns/resume-signed-out")}function b0(t,s){return ds(`/sessions/${t}`,{title:s})}function Eh(t){return ds(`/sessions/${t}`,{lifecycle:"finished"})}function _h(t){return ds(`/sessions/${t}`,{lifecycle:"working"})}function T0(t,s){return ds(`/sessions/${t}`,{starred:s})}function Rh(t){return ds(`/sessions/${t}`,{has_unreviewed:0})}function N0(t,s,r,o){const l={model:s,model_reasoning_effort:r};return o!==void 0&&(l.runtime_type=o),ds(`/sessions/${t}`,l)}function j0(t,s){return ds(`/sessions/${t}`,{runtime_config:s})}function C0(t,s){return ot(`/sessions/${t}/rewind`,{turn_id:s})}function E0(t){return ot(`/sessions/${t}/restore`,{})}function _0(t,s,r){return ot(`/sessions/${t}/branch`,{turn_id:s,title:r})}function _g(){return $t("/workspaces")}function R0(t,s){return ot("/workspaces",{path:t,label:s})}function A0(t){return ot("/workspaces/hide",{path:t})}function I0(){return $t("/workspaces/picker")}function Ah(t){return $t(t?`/workspaces/browse?path=${encodeURIComponent(t)}`:"/workspaces/browse")}async function Rg(){const t=await fetch(`${mn()}/api/pick-directory`);if(t.status===204)return{cancelled:!0};if(!t.ok)throw new Error(`GET /api/pick-directory failed: ${t.status} ${t.statusText}`);return t.json()}function Ag(){return $t("/folders")}function M0(t,s){return ot("/folders",{workspace_path:t,name:s})}function Ih(t,s){return ds(`/folders/${t}`,s)}function D0(t){return Ml(`/folders/${t}`)}function L0(t){return ot("/sessions/reorder",{moves:t})}function hr(t){return t.status==="pending"||t.status==="running"}function Ig(t){return!!(t!=null&&t.turns.some(hr))}function Dl(t){return t?t.turns.some(hr)||(t.threads??[]).some(s=>(s.turns??[]).some(hr)):!1}const O0="s:",Yu="a:",$r=t=>`${O0}${t}`,To=t=>`${Yu}${t}`;function fr(t){return{kind:t.startsWith(Yu)?"app":"session",id:t.slice(Yu.length)}}function kd(t){return t.activeAppTabId!==null?To(t.activeAppTabId):t.activeSessionId===null?null:$r(t.activeSessionId)}function Mg(t,s,r){const o=[...s.map($r),...r.map(To)],l=new Set(o),u=t.filter(g=>l.has(g)),d=new Set(u),p=o.filter(g=>!d.has(g));return p.length===0&&u.length===t.length?t:[...u,...p]}function P0(t){return t.subscribe((s,r)=>{if(s.openTabs===r.openTabs&&s.openAppTabs===r.openAppTabs)return;const o=Mg(s.tabOrder,s.openTabs,s.openAppTabs);o!==s.tabOrder&&t.setState({tabOrder:o})})}function Mh(t,s,r){const o=t.indexOf(s);return t.slice(o+1).find(r)??t.slice(0,Math.max(o,0)).reverse().find(r)??null}function Sd(t,s){const r=d=>!s.has(d),o=kd(t);let{activeSessionId:l,activeAppTabId:u}=t;if(o!==null&&s.has(o)){const d=Mh(t.tabOrder,o,r),p=d===null?null:fr(d);u=(p==null?void 0:p.kind)==="app"?p.id:null,(p==null?void 0:p.kind)==="session"&&(l=p.id)}if(l!==null&&s.has($r(l))){const d=g=>r(g)&&fr(g).kind==="session",p=Mh(t.tabOrder,$r(l),d);l=p===null?null:fr(p).id}return{activeSessionId:l,activeAppTabId:u}}function Dg(t,s){if(t.tabOrder.includes(s))return!1;const{kind:r,id:o}=fr(s);return(r==="app"?t.apps:t.sessions).some(u=>u.id===o)}const Lg=1;function Og(){let t="";try{t=mn()}catch{}return`agentpane:tabs:${t||window.location.origin}`}function Cu(t){return Array.isArray(t)&&t.every(s=>typeof s=="string")}function Dh(t){return t===null||typeof t=="string"}function $0(t){if(t==null)return null;let s;try{s=JSON.parse(t)}catch{return null}if(typeof s!="object"||s===null)return null;const r=s;return r.v!==Lg||!Cu(r.openTabs)||!Dh(r.activeSessionId)||!Cu(r.openAppTabs)||!Dh(r.activeAppTabId)?null:{openTabs:r.openTabs,activeSessionId:r.activeSessionId,openAppTabs:r.openAppTabs,activeAppTabId:r.activeAppTabId,tabOrder:Cu(r.tabOrder)?r.tabOrder:[]}}const Pg=[()=>window.sessionStorage,()=>window.localStorage];function z0(){const t=Og();for(const s of Pg)try{const r=$0(s().getItem(t));if(r)return r}catch{}return null}function F0(t){const s=Og(),r=JSON.stringify({v:Lg,openTabs:t.openTabs,activeSessionId:t.activeSessionId,openAppTabs:t.openAppTabs,activeAppTabId:t.activeAppTabId,tabOrder:t.tabOrder});for(const o of Pg)try{o().setItem(s,r)}catch{}}function U0(t){return t.subscribe((s,r)=>{(s.openTabs!==r.openTabs||s.activeSessionId!==r.activeSessionId||s.openAppTabs!==r.openAppTabs||s.activeAppTabId!==r.activeAppTabId||s.tabOrder!==r.tabOrder)&&F0(s)})}function yo(t){return[...new Set(t)]}function B0(t,s,r,o){const l=v=>r===null||r.has(v),u=yo(((t==null?void 0:t.openTabs)??[]).filter(v=>s.has(v))),d=yo(((t==null?void 0:t.openAppTabs)??[]).filter(l));let p=(t==null?void 0:t.activeSessionId)??null;p!==null&&!s.has(p)&&(p=null),p!==null&&!u.includes(p)&&u.push(p),p??(p=u.at(-1)??null);let g=(t==null?void 0:t.activeAppTabId)??null;g!==null&&!l(g)&&(g=null),g!==null&&!d.includes(g)&&d.push(g),o!==null&&s.has(o)&&(u.includes(o)||u.push(o),p=o,g=null);const m=Mg(yo((t==null?void 0:t.tabOrder)??[]),u,d);return{openTabs:u,activeSessionId:p,openAppTabs:d,activeAppTabId:g,tabOrder:m}}function W0(){const t=new URLSearchParams(window.location.search);return{session:t.get("session"),thread:t.get("thread")}}function H0(){const t=new URL(window.location.href);!t.searchParams.has("session")&&!t.searchParams.has("thread")||(t.searchParams.delete("session"),t.searchParams.delete("thread"),window.history.replaceState(window.history.state,"",t))}let Eu=0;function Lh(t){return t==="sidecar"?"sidecar":"turns"}async function V0(t,s){const r=await Promise.allSettled(t.map(u=>s(u))),o=new Map;let l=null;return r.forEach((u,d)=>{var p;u.status==="fulfilled"?o.set(t[d],u.value):l===null&&(l=((p=u.reason)==null?void 0:p.message)??"Request failed")}),{updated:o,firstError:l}}function G0(t,s){const r={...t.sessionDetails};s.forEach(g=>delete r[g]);const o={...t.backgroundTasks};s.forEach(g=>delete o[g]);const l=Object.fromEntries(Object.entries(t.signedOutTurns).filter(([,g])=>!s.has(g))),u=t.openTabs.filter(g=>!s.has(g)),d=Sd(t,new Set([...s].map($r)));let p=t.activeTurnIndex;if(d.activeSessionId!==t.activeSessionId){const g=d.activeSessionId?r[d.activeSessionId]:null;p=g&&g.turns.length>0?g.turns.length-1:0}return{sessions:t.sessions.filter(g=>!s.has(g.id)),sessionDetails:r,backgroundTasks:o,signedOutTurns:l,openTabs:u,...d,activeTurnIndex:p}}function K0(t){const s={...t};return delete s.turns,delete s.threads,delete s.contextUsage,s}function Oh(t,s,r){const o=s().activeSessionId;t(u=>G0(u,r));const l=s().activeSessionId;l&&l!==o&&s().selectSession(l,{keepAppView:!0})}async function Ph(t,s,r,o,l){if(r.length===0)return;t({error:null});const{updated:u,firstError:d}=await V0(r,o);u.size>0&&t(g=>({sessions:g.sessions.map(m=>u.get(m.id)??m)}));const p=r.length-u.size;if(p===0)s().addToast("info",`${r.length} session${r.length===1?"":"s"} ${l}`);else{t({error:d});const g=l[0].toUpperCase()+l.slice(1);s().addToast(p===r.length?"error":"warn",`${g} ${u.size} of ${r.length} — ${p} failed`)}}const q0=(t,s)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,quotedText:null,init:async()=>{const r=W0(),o=z0();try{const l=localStorage.getItem("agentpane:last-model-config");l&&t({lastModelConfig:JSON.parse(l)})}catch{}t({loading:!0,error:null});try{const l=s().loadApps(),[u,d,p]=await Promise.all([x0(),_g(),Ag()]);t({sessions:u,workspaces:d,folders:p,loading:!1}),H0();const g=await l,m=B0(o,new Set(u.map(v=>v.id)),g?new Set(s().apps.map(v=>v.id)):null,r.session);t(v=>{const k=v.activeSessionId!==null||v.activeAppTabId!==null;return{openTabs:yo([...m.openTabs,...v.openTabs]),openAppTabs:yo([...m.openAppTabs,...v.openAppTabs]),tabOrder:m.tabOrder,activeAppTabId:k?v.activeAppTabId:m.activeAppTabId}}),m.activeSessionId&&!s().activeSessionId&&await s().selectSession(m.activeSessionId,{keepAppView:!0}),r.thread&&(t({deepLinkThreadId:r.thread}),s().switchRightTab("threads"))}catch(l){t({loading:!1,error:l.message})}},selectSession:async(r,o)=>{const l=++Eu,u=o!=null&&o.keepAppView?{}:{activeAppTabId:null},d=p=>p.includes(r)?p:[...p,r];if(s().sessionDetails[r]){const p=s().sessionDetails[r];t({activeSessionId:r,activeTurnIndex:p.turns.length>0?p.turns.length-1:0,activeRightTab:Lh(s().activeRightTab),...u,openTabs:d(s().openTabs)}),p.has_unreviewed===1&&(Rh(r).catch(()=>{}),t(g=>({sessions:g.sessions.map(m=>m.id===r?{...m,has_unreviewed:0}:m),sessionDetails:{...g.sessionDetails,[r]:{...p,has_unreviewed:0}}})));return}t({loading:!0,error:null});try{const p=await co(r);if(l!==Eu){t(g=>({sessionDetails:{...g.sessionDetails,[r]:p},openTabs:d(g.openTabs),loading:!1}));return}t(g=>({sessionDetails:{...g.sessionDetails,[r]:p},activeSessionId:r,activeTurnIndex:p.turns.length>0?p.turns.length-1:0,activeRightTab:Lh(g.activeRightTab),...u,openTabs:d(g.openTabs),loading:!1})),p.has_unreviewed===1&&(Rh(r).catch(()=>{}),t(g=>({sessions:g.sessions.map(m=>m.id===r?{...m,has_unreviewed:0}:m),sessionDetails:{...g.sessionDetails,[r]:{...p,has_unreviewed:0}}})))}catch(p){t(l===Eu?{loading:!1,error:p.message}:{loading:!1})}},closeTab:r=>s().closeTabs([$r(r)]),updateModelConfig:async(r,o,l)=>{const u=s().activeSessionId;if(u){t({error:null});try{const d=await N0(u,r,o,l),p={provider:d.runtime_type,model:d.model??"",reasoning:d.model_reasoning_effort??""};t({lastModelConfig:p}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(p)),t(g=>({sessions:g.sessions.map(m=>m.id===u?d:m),sessionDetails:g.sessionDetails[u]?{...g.sessionDetails,[u]:{...g.sessionDetails[u],model:d.model,model_reasoning_effort:d.model_reasoning_effort,external_thread_id:d.external_thread_id}}:g.sessionDetails})),await s().refreshActiveSession()}catch(d){t({error:d.message}),s().addToast("error",`Failed to update model — ${d.message}`)}}},createSession:async r=>{t({error:null});try{const o=await wd(r);t(u=>({sessions:[o,...u.sessions],showNewSessionDialog:!1}));const l={provider:o.runtime_type,model:o.model??"",reasoning:o.model_reasoning_effort??""};t({lastModelConfig:l}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(l)),await s().selectSession(o.id),s().addLogEntry("INFO",`Session created — ${o.id.slice(0,8)}`),s().addToast("success",`Session created — ${o.title||o.id.slice(0,8)}`)}catch(o){t({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},addSession:r=>{t(o=>({sessions:o.sessions.some(l=>l.id===r.id)?o.sessions:[r,...o.sessions]}))},revealSession:async r=>{let o=s().sessionDetails[r];if(!o){const l=await co(r);t(u=>({sessionDetails:{...u.sessionDetails,[r]:l}})),o=l}s().sessions.some(l=>l.id===r)||s().addSession(K0(o)),await s().selectSession(r)},deleteSession:async r=>{var l;t({error:null});const o=(l=s().sessions.find(u=>u.id===r))==null?void 0:l.title;try{await Ch(r),Oh(t,s,new Set([r])),s().addLogEntry("INFO",`Session deleted — ${r.slice(0,8)}`),s().addToast("info",`Session "${o||r.slice(0,8)}" deleted`)}catch(u){t({error:u.message}),s().addToast("error",`Failed to delete session — ${u.message}`)}},renameSession:async(r,o)=>{t({error:null});try{const l=await b0(r,o.trim());t(u=>({sessions:u.sessions.map(d=>d.id===r?l:d),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],title:l.title}}:u.sessionDetails}))}catch(l){t({error:l.message}),s().addToast("error",`Failed to rename session — ${l.message}`)}},markFinished:async r=>{t({error:null});try{const o=await Eh(r);t(l=>({sessions:l.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session marked as finished")}catch(o){t({error:o.message}),s().addToast("error",`Failed to mark as finished — ${o.message}`)}},markFinishedMany:async r=>{await Ph(t,s,r,Eh,"marked as finished")},toggleStar:async r=>{const o=s().sessions.find(l=>l.id===r);if(o){t({error:null});try{const l=await T0(r,o.starred?0:1);t(u=>({sessions:u.sessions.map(d=>d.id===r?l:d),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],starred:l.starred}}:u.sessionDetails}))}catch(l){t({error:l.message}),s().addToast("error",`Failed to star session — ${l.message}`)}}},reopenSession:async r=>{t({error:null});try{const o=await _h(r);t(l=>({sessions:l.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session reopened")}catch(o){t({error:o.message}),s().addToast("error",`Failed to reopen session — ${o.message}`)}},reopenSessionMany:async r=>{await Ph(t,s,r,_h,"reopened")},deleteSessionMany:async r=>{if(r.length===0)return;t({error:null});const o=await Promise.allSettled(r.map(d=>Ch(d))),l=new Set;if(o.forEach((d,p)=>{d.status==="fulfilled"&&l.add(r[p])}),l.size===0){t({error:"Failed to delete sessions"}),s().addToast("error","Failed to delete sessions");return}Oh(t,s,l),s().addLogEntry("INFO",`${l.size} session${l.size===1?"":"s"} deleted`);const u=r.length-l.size;u===0?s().addToast("info",`${l.size} session${l.size===1?"":"s"} deleted`):(t({error:"One or more sessions failed to delete"}),s().addToast("warn",`Deleted ${l.size} of ${r.length} — ${u} failed`))},submitPrompt:async(r,o)=>{const l=s().activeSessionId;if(l){t({error:null,submittingPrompt:r}),t(u=>{const d=u.sessionDetails[l];return d?{sessionDetails:{...u.sessionDetails,[l]:{...d,is_running:1,status:"running"}},sessions:u.sessions.map(p=>p.id===l?{...p,is_running:1,status:"running"}:p)}:{}});try{const u=await Eg(l,r,o);s().addLogEntry("INFO",`Turn submitted — "${r.slice(0,40)}"`),t(d=>{const p=d.sessionDetails[l];if(!p)return{submittingPrompt:null};const g=p.turns.findIndex(v=>v.id===u.id);if(g>=0)return{submittingPrompt:null,activeTurnIndex:g};const m={...u,items:[]};return{submittingPrompt:null,sessionDetails:{...d.sessionDetails,[l]:{...p,turns:[...p.turns,m]}},activeTurnIndex:p.turns.length}})}catch(u){t({submittingPrompt:null,error:u.message}),s().addLogEntry("ERROR",`Turn failed — ${u.message}`),s().addToast("error",`Failed to send prompt — ${u.message}`),t(d=>{const p=d.sessionDetails[l];if(!p)return{};const g=Dl(p)?1:0;return{sessionDetails:{...d.sessionDetails,[l]:{...p,is_running:g,status:g?"running":"active"}},sessions:d.sessions.map(m=>m.id===l?{...m,is_running:g,status:g?"running":"active"}:m)}})}}},cancelTurn:async()=>{const r=s().activeSessionId;if(r)try{await w0(r)}catch(o){t({error:o.message})}},rewindToTurn:async(r,o)=>{t({error:null});try{const l=await C0(r,o),u=await co(r);t(d=>({sessionDetails:{...d.sessionDetails,[r]:u},sessions:d.sessions.map(p=>p.id===r?{...p,external_thread_id:l.external_thread_id,is_running:0,status:"active"}:p),activeTurnIndex:u.turns.length>0?u.turns.length-1:0})),s().addToast("info","Rewound to selected turn")}catch(l){t({error:l.message}),s().addToast("error",`Failed to rewind — ${l.message}`)}},restoreSession:async r=>{t({error:null});try{const o=await E0(r),l=await co(r);t(u=>({sessionDetails:{...u.sessionDetails,[r]:l},sessions:u.sessions.map(d=>d.id===r?{...d,external_thread_id:o.external_thread_id,is_running:0,status:"active"}:d),activeTurnIndex:l.turns.length>0?l.turns.length-1:0})),s().addToast("info","Restored rewound session")}catch(o){t({error:o.message}),s().addToast("error",`Failed to restore — ${o.message}`)}},branchFromTurn:async(r,o,l)=>{t({error:null});try{const u=await _0(r,o,l);t(d=>({sessions:[u,...d.sessions]})),await s().selectSession(u.id),s().addToast("success","Branched from selected turn")}catch(u){t({error:u.message}),s().addToast("error",`Failed to branch — ${u.message}`)}},updateRuntimeConfig:async r=>{const o=s().activeSessionId;if(o){t({error:null});try{const l=await j0(o,JSON.stringify(r));t(u=>({sessions:u.sessions.map(d=>d.id===o?l:d),sessionDetails:u.sessionDetails[o]?{...u.sessionDetails,[o]:{...u.sessionDetails[o],runtime_config:l.runtime_config}}:u.sessionDetails}))}catch(l){t({error:l.message}),s().addToast("error",`Failed to update config — ${l.message}`)}}},refreshActiveSession:async()=>{const r=s().activeSessionId;if(r)try{const o=await co(r);t(l=>({sessionDetails:{...l.sessionDetails,[r]:o},activeTurnIndex:o.turns.length>0?Math.min(l.activeTurnIndex,o.turns.length-1):0,sessions:l.sessions.map(u=>u.id===r?{...u,is_running:o.is_running,status:o.status}:u)}))}catch(o){t({error:o.message})}}});async function $g(t){const{sessions:s}=await $t(`/claude-sessions?workspace=${encodeURIComponent(t)}`);return s}function Y0(t,s){return ot(`/claude-sessions/${encodeURIComponent(t)}/import`,{workspace:s})}const $h={available:!0,reason:null};let _u=null;const X0=(t,s)=>({workspaces:[],pickerSupport:null,loadPickerSupport:()=>{const r=s().pickerSupport;return r?Promise.resolve(r):(_u??(_u=I0().then(o=>typeof(o==null?void 0:o.available)!="boolean"?$h:(t({pickerSupport:o}),o)).catch(()=>$h).finally(()=>{_u=null})),_u)},createWorkspaceAt:async r=>{const o=await R0(r.trim());return t(l=>({workspaces:[...l.workspaces.filter(u=>u.id!==o.id),o]})),o},addWorkspace:async r=>{t({error:null});try{const o=await s().createWorkspaceAt(r);return s().addToast("success",`Workspace added — ${o.path}`),o}catch(o){return s().addToast("error",`Failed to add workspace — ${Pr(o)}`),null}},removeWorkspace:async r=>{t({error:null});try{await A0(r);const o=await _g();t({workspaces:o}),s().addToast("info","Workspace hidden")}catch(o){s().addToast("error",`Failed to hide workspace — ${o.message}`)}},createSessionInWorkspace:async r=>{t({error:null});try{const o=s().lastModelConfig,l=await wd({cwd:r,runtime_type:(o==null?void 0:o.provider)??"codex",model:o==null?void 0:o.model,model_reasoning_effort:o==null?void 0:o.reasoning});t(u=>({sessions:[l,...u.sessions]})),await s().selectSession(l.id),s().addLogEntry("INFO",`Session created in ${r} — ${l.id.slice(0,8)}`),s().addToast("success",`Session created in ${r.split("/").pop()||r}`)}catch(o){t({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},pickAndAddWorkspace:async()=>{if(!(await s().loadPickerSupport()).available){s().setShowAddWorkspaceDialog(!0);return}try{const o=await Rg();if(o.cancelled||!o.path)return;await s().addWorkspace(o.path)}catch(o){s().addToast("error",`Failed to pick directory — ${o.message}`)}},importClaudeSessions:async(r,o)=>{const l=[],u=[];for(const d of[...o].reverse())try{l.unshift(await Y0(d,r))}catch(p){u.unshift({id:d,error:Pr(p)})}return l.length>0&&(t(d=>({sessions:[...l,...d.sessions]})),await s().selectSession(l[0].id),s().addLogEntry("INFO",`Imported ${l.length} Claude Code session(s) into ${r}`),s().addToast("success",l.length===1?`Imported — ${l[0].title||"Claude Code session"}`:`Imported ${l.length} Claude Code sessions`)),{imported:l,failed:u}}}),Fs=new Map,bd=new Map,Ll=new Map,ul=new Set,Td=new Map,Ol=new Map;function Q0(t,s,r=""){Fs.set(t,s),bd.set(t,r)}function Z0(t){Fs.delete(t),bd.delete(t)}function sl(t,s){Ll.set(t,s)}function J0(t,s){s?ul.add(t):ul.delete(t)}function zh(t,s,r){const o=Ll.get(t);if(!o||ul.has(o))return;const l=Fs.get(o);l&&l({source:"agentpane-host",event:s,payload:r})}function Fh(t,s){const r=Ll.get(t);if(!r||ul.has(r))return;const o=Fs.get(r);o&&o({source:"agentpane-host",event:"background_tasks",payload:{sessionId:t,tasks:s}})}function ew(t,s,r,o,l,u=null){if(typeof l=="string"&&l!==bd.get(t))return;const d=Fs.get(t);d&&d({source:"agentpane-host",event:"tool_call",payload:{callId:s,tool:r,name:r,args:o,caller:u}})}function tw(t,s,r,o){const l=Ll.get(t);if(!l)return;const u=Fs.get(l);u&&u({source:"agentpane-host",event:"turn:delta",payload:{sessionId:t,turnId:s,itemId:r,delta:o}})}function nw(t,s){Td.set(t,s)}function sw(t){Td.delete(t)}function rw(t,s){Ol.set(t,s)}function iw(t){Ol.delete(t)}function zg(t,s={}){const r=Ol.get(t);if(r){r(s);return}const o=Fs.get(t);o&&o({source:"agentpane-host",event:"state_changed",payload:{}})}function ow(){for(const t of new Set([...Fs.keys(),...Ol.keys()]))zg(t)}function aw(t){var r;const s=Fs.get(t);s&&s({source:"agentpane-host",event:"source:updated",payload:{}}),(r=Td.get(t))==null||r()}const lw=(t,s)=>({wsConnected:!1,backgroundTasks:{},retryStates:{},signedOutTurns:{},setWsConnected:r=>t({wsConnected:r}),onTurnCreated:(r,o)=>{t(l=>{const u=l.sessionDetails[r];return!u||o.thread_id?{}:u.turns.some(d=>d.id===o.id)?{}:{sessionDetails:{...l.sessionDetails,[r]:{...u,turns:[...u.turns,{...o,items:[]}]}}}})},onTurnStarted:(r,o)=>{s().addLogEntry("DEBUG",`turn:started — ${o.slice(0,8)}`),t(l=>{const u=ar(l.sessions,r,()=>({is_running:1,status:"running"})),d=l.sessionDetails[r];if(!d)return{sessions:u};const p=d.turns.findIndex(g=>g.id===o);return{sessionDetails:{...l.sessionDetails,[r]:{...Zn(d,o,g=>({...g,status:"running"})),is_running:1,status:"running"}},sessions:u,activeTurnIndex:l.activeSessionId===r&&p>=0?p:l.activeTurnIndex}})},onItemStarted:(r,o,l)=>{s().addLogEntry("DEBUG",`item:started — ${l.type}`),t(u=>{const d=Uh(l)?Dr(u.retryStates,o):u.retryStates,p=u.sessionDetails[r];return p?{sessionDetails:{...u.sessionDetails,[r]:Zn(p,o,g=>Au(g,l))},retryStates:d}:{retryStates:d}})},onItemUpdated:(r,o,l)=>{t(u=>{const d=u.sessionDetails[r];return d?{sessionDetails:{...u.sessionDetails,[r]:Zn(d,o,p=>Au(p,l))}}:{}})},onItemCompleted:(r,o,l)=>{if(s().addLogEntry("DEBUG",`item:completed — ${l.type}`),l.type==="background_task"&&(l.status==="completed"||l.status==="failed")){const u=l.data||{},d=u.task_type||"unknown",p=u.description||"background task",m=d==="local_agent"?"Subagent":d==="local_bash"?"Monitor":"Task";l.status==="completed"?s().addToast("success",`${m} completed: ${p}`):u.status!=="stopped"&&s().addToast("error",`${m} failed: ${p}`)}t(u=>{const d=Uh(l)?Dr(u.retryStates,o):u.retryStates,p=u.sessionDetails[r];return p?{retryStates:d,sessionDetails:{...u.sessionDetails,[r]:Zn(p,o,g=>{var v,k;let m=Au(g,l);if(l.type==="agent_message"&&((v=l.data)!=null&&v.text)&&(m={...m,agent_response:l.data.text}),l.type==="reasoning"&&((k=l.data)!=null&&k.text)){const y=m.thoughts?m.thoughts+`
42
+ `+l.data.text:l.data.text;m={...m,thoughts:y}}return m})}}:{retryStates:d}})},onItemDelta:(r,o,l,u)=>{tw(r,o,l,u),t(d=>{const p=Dr(d.retryStates,o),g=d.sessionDetails[r];return g?{sessionDetails:{...d.sessionDetails,[r]:Zn(g,o,m=>uw(m,l,u))},retryStates:p}:{retryStates:p}})},onTurnCompleted:(r,o,l,u,d)=>{s().dropSignedOutTurn(o);const p=(l==null?void 0:l.input_tokens)??0,g=(l==null?void 0:l.output_tokens)??0;s().addLogEntry("INFO",`turn:completed — ${p} in / ${g} out`),zh(r,"turn:completed",{sessionId:r,turnId:o,response:d??null}),s().refreshApps(),t(m=>{const v=m.sessionDetails[r],k=v?Zn(v,o,N=>({...N,status:"completed",token_usage:l??N.token_usage??null,...d&&!N.agent_response?{agent_response:d}:{}})):null,y=Ru(k),S=y&&k?Va(k):"active",T=ar(m.sessions,r,N=>({is_running:y,status:S,has_unreviewed:u?1:N.has_unreviewed})),_=Dr(m.retryStates,o);return k?{sessionDetails:{...m.sessionDetails,[r]:{...k,is_running:y,status:S,has_unreviewed:u?1:k.has_unreviewed}},sessions:T,retryStates:_}:{sessions:T,retryStates:_}})},onTokenUsageUpdated:(r,o,l)=>{t(u=>{const d=u.sessionDetails[r];return d?{sessionDetails:{...u.sessionDetails,[r]:Zn(d,o,p=>({...p,token_usage:l}))}}:{}})},onContextUsageUpdated:(r,o)=>{t(l=>{const u=l.sessionDetails[r];return u?{sessionDetails:{...l.sessionDetails,[r]:{...u,contextUsage:o}}}:{}})},onTurnFailed:(r,o,l,u)=>{s().dropSignedOutTurn(o),s().addLogEntry("ERROR",`turn:failed — ${l}`),s().addToast("error",`Turn failed — ${l}`),zh(r,"turn:failed",{sessionId:r,turnId:o,error:l}),t(d=>{const p=d.sessionDetails[r],g=l.includes("cancelled")||l.includes("aborted"),m=g?"aborted":"failed",v=p?Zn(p,o,_=>({..._,status:m,error:l,...u?{resume_state:u}:{},items:_.items.map(N=>N.status==="in_progress"?{...N,status:"failed"}:N)})):null,k=Ru(v),y=k&&v?Va(v):g?"active":"failed",S=ar(d.sessions,r,()=>({is_running:k,status:y})),T=Dr(d.retryStates,o);return v?{sessionDetails:{...d.sessionDetails,[r]:{...v,is_running:k,status:y}},sessions:S,retryStates:T}:{sessions:S,retryStates:T}})},onTurnCancelled:(r,o)=>{s().dropSignedOutTurn(o),t(l=>{const u=l.sessionDetails[r],d=u?Zn(u,o,k=>({...k,status:"aborted",...k.resume_state==="waiting"||k.resume_state==="resuming"?{resume_state:"cancelled"}:{},items:k.items.map(y=>y.status==="in_progress"?{...y,status:"completed"}:y)})):null,p=Ru(d),g=p&&d?Va(d):"active",m=ar(l.sessions,r,()=>({is_running:p,status:g})),v=Dr(l.retryStates,o);return d?{sessionDetails:{...l.sessionDetails,[r]:{...d,is_running:p,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnInterrupted:(r,o,l)=>{s().addLogEntry("WARN",`turn:interrupted — ${l.reason}${l.detail?` (${l.detail})`:""}`),s().addToast("warn",cw(l.reason)),l.reason==="auth"?t(u=>({signedOutTurns:{...u.signedOutTurns,[o]:r}})):s().dropSignedOutTurn(o),t(u=>{const d=u.sessionDetails[r],p=d?Zn(d,o,k=>({...k,status:"pending",error:null,resume_state:"waiting",interrupt_reason:l.reason,interrupted_at:l.interruptedAt,resume_attempts:l.attempts,resume_at:l.resumeAt??null})):null,g=p?Va(p):"interrupted",m=ar(u.sessions,r,()=>({is_running:1,status:g})),v=Dr(u.retryStates,o);return p?{sessionDetails:{...u.sessionDetails,[r]:{...p,is_running:1,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnResuming:(r,o,l)=>{s().dropSignedOutTurn(o),s().addLogEntry("INFO",`turn:resuming — ${o.slice(0,8)} (attempt ${l})`),t(u=>{const d=ar(u.sessions,r,()=>({is_running:1,status:"running"})),p=u.sessionDetails[r];return p?{sessionDetails:{...u.sessionDetails,[r]:{...Zn(p,o,g=>({...g,status:"running",error:null,resume_state:"resuming",resume_attempts:l})),is_running:1,status:"running"}},sessions:d}:{sessions:d}})},onTurnResumed:(r,o)=>{s().addLogEntry("INFO",`turn:resumed — ${o.slice(0,8)}`),s().addToast("success","Interrupted turn resumed"),t(l=>{const u=l.sessionDetails[r];return u?{sessionDetails:{...l.sessionDetails,[r]:Zn(u,o,d=>({...d,resume_state:"resumed"}))}}:{}})},onTurnRetrying:(r,o,l)=>{s().addLogEntry("WARN",`turn:retrying — ${r.slice(0,8)}/${o.slice(0,8)} attempt ${l.attempt}/${l.maxRetries} (${l.errorStatus??"no response"}${l.error?`, ${l.error}`:""})`),t(u=>({retryStates:{...u.retryStates,[o]:l}}))},onSessionTitle:(r,o)=>{t(l=>({sessions:l.sessions.map(u=>u.id===r?{...u,title:o}:u),sessionDetails:l.sessionDetails[r]?{...l.sessionDetails,[r]:{...l.sessionDetails[r],title:o}}:l.sessionDetails}))},onSessionTouched:r=>{t(o=>{const l=o.sessionDetails[r];return{sessions:ar(o.sessions,r,()=>({user_touched:1})),sessionDetails:l?{...o.sessionDetails,[r]:{...l,user_touched:1}}:o.sessionDetails}})},onSessionUpdated:r=>{const o={...r};delete o.is_running,delete o.status,t(l=>{const u=l.sessionDetails[r.id];return{sessions:ar(l.sessions,r.id,()=>o),sessionDetails:u?{...l.sessionDetails,[r.id]:{...u,...o}}:l.sessionDetails}})},onBackgroundTasksChanged:(r,o)=>{Fh(r,o),t(l=>{if(o.length===0&&!l.backgroundTasks[r])return{};const u={...l.backgroundTasks};return o.length>0?u[r]=o:delete u[r],{backgroundTasks:u}})},onSignedOutTurnsSnapshot:r=>t({signedOutTurns:Object.fromEntries(r.map(o=>[o.turnId,o.sessionId]))}),dropSignedOutTurn:r=>{if(!(r in s().signedOutTurns))return;const o={...s().signedOutTurns};delete o[r],t({signedOutTurns:o})},onBackgroundTasksSnapshot:r=>{for(const[l,u]of Object.entries(r))Fh(l,u);const o={};for(const[l,u]of Object.entries(r))u.length>0&&(o[l]=u);t({backgroundTasks:o})}});function cw(t){switch(t){case"network":return"Network error — the turn will resume when the connection is back";case"process_exit":return"The agent process stopped — resuming the turn";case"auth":return"Claude is signed out — the turn waits until you sign in again";case"usage_limit":return"Usage limit reached — the turn waits until it is over";default:return"The agent host restarted — resuming the turn"}}function Va(t){const s=[...t.turns,...(t.threads??[]).flatMap(r=>r.turns??[])].filter(hr);return s.length>0&&s.every(r=>r.status==="pending"&&r.resume_state==="waiting")?"interrupted":"running"}function Uh(t){return t.type!=="background_task"&&t.type!=="error"&&t.type!=="interruption"}function Dr(t,s){if(!(s in t))return t;const r={...t};return delete r[s],r}function Ru(t){return t&&(t.turns.some(hr)||(t.threads??[]).some(r=>(r.turns??[]).some(hr)))?1:0}function ar(t,s,r){return t.some(o=>o.id===s)?t.map(o=>o.id===s?{...o,...r(o)}:o):t}function Zn(t,s,r){const o=(t.threads??[]).map(l=>(l.turns??[]).some(u=>u.id===s)?{...l,turns:(l.turns??[]).map(u=>u.id===s?r(u):u)}:l);return{...t,turns:t.turns.map(l=>l.id===s?r(l):l),threads:o}}function Fg(t,s){for(let r=t.length-1;r>=0;r--)if(t[r].external_item_id===s)return r;return-1}function Au(t,s){const r=Fg(t.items,s.external_item_id);if(r>=0){const o=[...t.items];return o[r]=s,{...t,items:o}}if(s.type==="agent_message"){const o=t.items.filter(l=>!(l.type==="agent_message"&&l.id.startsWith("delta-")));return{...t,items:[...o,s]}}return{...t,items:[...t.items,s]}}function uw(t,s,r){var u;const o=Fg(t.items,s);if(o>=0){const d=t.items[o],g=(((u=d.data)==null?void 0:u.text)??"")+r,m=[...t.items];return m[o]={...d,data:{...d.data,text:g}},{...t,items:m,agent_response:g}}const l={id:`delta-${s}`,turn_id:t.id,external_item_id:s,type:"agent_message",data:{text:r},status:"in_progress",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return{...t,items:[...t.items,l],agent_response:r}}function Ug(t,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return $t(`/providers/${encodeURIComponent(t)}/models${r}`)}const Bh="curl -fsSL https://repoburg.com/install.sh | bash",dw=2e3,Bg="agentpane:daemon-seen";function fw(t=mn()){if(!t)return!1;try{const s=new URL(t);return s.protocol==="http:"&&(s.hostname==="localhost"||s.hostname==="127.0.0.1")}catch{return!1}}async function pw(t=mn()){try{return await fetch(`${t}/health`,{mode:"no-cors",cache:"no-store"}),!0}catch{return!1}}function hw(){try{return localStorage.getItem(Bg)==="true"}catch{return!1}}function mw(){try{localStorage.setItem(Bg,"true")}catch{}}function gw(t){let s=!1,r=!1,o=!1,l=null;function u(){l!==null&&(clearTimeout(l),l=null)}async function d(){if(s||r)return;u(),r=!0;const m=await pw();if(r=!1,!s){if(m){mw(),g(),t.onReady();return}o||(o=!0,t.onMissing()),l=setTimeout(()=>void d(),dw)}}function p(){document.visibilityState==="visible"&&d()}function g(){s=!0,u(),window.removeEventListener("focus",p),document.removeEventListener("visibilitychange",p)}return window.addEventListener("focus",p),document.addEventListener("visibilitychange",p),d(),g}const Xu=160,Qu=480,vw=240,dl=220,yw=300,xw=600,ww=36;function fl(){return typeof window>"u"?xw:Math.max(dl,Math.round(window.innerWidth*.7))}const Wh="agentpane:sidebar-width",Hh="agentpane:right-panel-width",Iu="agentpane:right-panel-collapsed";function Vh(t,s,r,o){try{const l=localStorage.getItem(t);if(l==null)return o;const u=Number(l);return Number.isFinite(u)?Math.min(r,Math.max(s,u)):o}catch{return o}}function kw(t){try{return localStorage.getItem(t)==="true"}catch{return!1}}function Gh(t,s){try{localStorage.setItem(t,String(s))}catch{}}const Kh=200,Sw=(t,s)=>({activeRightTab:"turns",eventLog:[],loading:!1,error:null,showNewSessionDialog:!1,showAddWorkspaceDialog:!1,importSessionsWorkspace:null,showRemoteModal:!1,toasts:[],showCommandPalette:!1,lastModelConfig:null,models:[],modelsLoading:!1,showModelSelector:!1,sidebarWidth:Vh(Wh,Xu,Qu,vw),rightPanelWidth:Vh(Hh,dl,fl(),yw),rightPanelCollapsed:kw(Iu),deepLinkThreadId:null,vscodeViewOpen:!1,vscodeState:"stopped",vscodeId:null,vscodeToken:null,usageViewOpen:!1,terminalViewOpen:!1,canGoBack:!1,canGoForward:!1,daemonStatus:fw()?"checking":"ready",setActiveTurnIndex:r=>t({activeTurnIndex:r}),switchRightTab:r=>{s().rightPanelCollapsed&&Gh(Iu,!1),t({activeRightTab:r,rightPanelCollapsed:!1})},setShowNewSessionDialog:r=>t({showNewSessionDialog:r}),setShowAddWorkspaceDialog:r=>t({showAddWorkspaceDialog:r}),setImportSessionsWorkspace:r=>t({importSessionsWorkspace:r}),setShowRemoteModal:r=>t({showRemoteModal:r}),setShowCommandPalette:r=>t({showCommandPalette:r}),setShowModelSelector:r=>t({showModelSelector:r}),setDeepLinkThreadId:r=>t({deepLinkThreadId:r}),setSidebarWidth:r=>{const o=Math.min(Qu,Math.max(Xu,Math.round(r)));t({sidebarWidth:o});try{localStorage.setItem(Wh,String(o))}catch{}},setRightPanelWidth:r=>{const o=Math.min(fl(),Math.max(dl,Math.round(r)));t({rightPanelWidth:o});try{localStorage.setItem(Hh,String(o))}catch{}},setRightPanelCollapsed:r=>{t({rightPanelCollapsed:r}),Gh(Iu,r)},toggleRightPanel:()=>s().setRightPanelCollapsed(!s().rightPanelCollapsed),toggleVscodeView:()=>{if(s().vscodeViewOpen){t({vscodeViewOpen:!1});return}t({vscodeViewOpen:!0,terminalViewOpen:!1,vscodeState:"starting",vscodeId:null,vscodeToken:null})},setVscodeView:(r,o,l)=>t({vscodeState:r,vscodeId:o,vscodeToken:l}),toggleUsageView:()=>t({usageViewOpen:!s().usageViewOpen,terminalViewOpen:!1}),toggleTerminalView:()=>t(s().terminalViewOpen?{terminalViewOpen:!1}:{terminalViewOpen:!0,vscodeViewOpen:!1,usageViewOpen:!1}),setDaemonStatus:r=>t({daemonStatus:r}),addToast:(r,o,l,u)=>{const d=Math.random().toString(36).slice(2,9);t(p=>({toasts:[...p.toasts,{id:d,type:r,message:o,undoAction:l,undoLabel:u}]}))},removeToast:r=>{t(o=>({toasts:o.toasts.filter(l=>l.id!==r)}))},addLogEntry:(r,o)=>{const l=new Date().toLocaleTimeString("en-GB",{hour12:!1});t(u=>{const d=[...u.eventLog,{time:l,level:r,message:o}];return d.length>Kh&&d.splice(0,d.length-Kh),{eventLog:d}})},loadModels:async(r,o)=>{if(!s().modelsLoading){t({modelsLoading:!0,models:[]});try{const l=await Ug(r,o);t({models:l,modelsLoading:!1})}catch{t({modelsLoading:!1})}}}}),bw=(t,s)=>({createThread:async(r,o)=>{try{await ot(`/sessions/${r}/threads`,o),s().addLogEntry("INFO",`Thread created — "${o.message.slice(0,40)}"`)}catch(l){s().addToast("error",`Failed to create thread — ${l.message}`)}},followupThread:async(r,o,l)=>{try{await ot(`/sessions/${r}/threads/${o}/followup`,{message:l}),s().addLogEntry("INFO",`Thread follow-up — "${l.slice(0,40)}"`)}catch(u){s().addToast("error",`Failed to send follow-up — ${u.message}`)}},cancelThreadTurn:async(r,o)=>{try{await ot(`/sessions/${r}/cancel?threadId=${encodeURIComponent(o)}`),s().addLogEntry("INFO","Thread turn cancelled")}catch(l){s().addToast("error",`Failed to cancel thread turn — ${l.message}`)}},resolveThread:async(r,o)=>{try{await ds(`/sessions/${r}/threads/${o}`,{status:"resolved"})}catch(l){s().addToast("error",`Failed to resolve thread — ${l.message}`)}},reopenThread:async(r,o)=>{try{await ds(`/sessions/${r}/threads/${o}`,{status:"open"})}catch(l){s().addToast("error",`Failed to reopen thread — ${l.message}`)}},shareThread:async(r,o,l)=>{try{const u=await ot(`/sessions/${r}/threads/${o}/summarize`,{directives:l}),d=`
43
43
  [Shared from a resolved discussion thread — summary of its findings]
44
44
 
45
45
  \`\`\`QUOTE
46
46
  ${u.summary}
47
47
  \`\`\`
48
48
 
49
- `;return t({quotedText:d}),s().addLogEntry("INFO",`Thread shared to main session — "${u.summary.slice(0,40)}"`),s().addToast("success","Thread summary added to your input"),!0}catch(u){return s().addToast("error",`Failed to share thread — ${u.message}`),!1}},deleteThread:async(r,o)=>{try{await Rl(`/sessions/${r}/threads/${o}`)}catch(l){s().addToast("error",`Failed to delete thread — ${l.message}`)}},askSidecar:async(r,o)=>{try{return await ct(`/sessions/${r}/sidecar`,{message:o}),s().addLogEntry("INFO",`Sidecar asked — "${o.slice(0,40)}"`),!0}catch(l){return s().addToast("error",`Failed to ask the sidecar — ${l.message}`),!1}},onThreadCreated:(r,o,l)=>{t(u=>{const d=u.sessionDetails[r];return d?{sessionDetails:{...u.sessionDetails,[r]:{...d,threads:[...d.threads??[],{...o,turns:[{...l,items:[]}]}]}}}:{}})},onThreadFollowup:(r,o,l)=>{t(u=>{const d=u.sessionDetails[r];return d?{sessionDetails:{...u.sessionDetails,[r]:{...d,threads:(d.threads??[]).map(p=>p.id===o?{...p,turns:[...p.turns??[],{...l,items:[]}]}:p)}}}:{}})},onThreadResolved:(r,o,l)=>{t(u=>{const d=u.sessionDetails[r];if(!d)return{};const p=(d.threads??[]).map(g=>g.id===o?{...g,status:l,resolved_at:l==="resolved"?new Date().toISOString():null}:g);return{sessionDetails:{...u.sessionDetails,[r]:{...d,threads:p}}}})},onThreadDeleted:(r,o)=>{t(l=>{const u=l.sessionDetails[r];return u?{sessionDetails:{...l.sessionDetails,[r]:{...u,threads:(u.threads??[]).filter(d=>d.id!==o)}}}:{}})}}),kw=(t,s)=>({folders:[],loadFolders:async()=>{const r=await _g();t({folders:r})},createSidebarFolder:async(r,o)=>{try{const l=await R0(r,o);return t(u=>({folders:[...u.folders,l]})),l}catch(l){return s().addToast("error",`Failed to create folder — ${l.message}`),null}},renameFolder:async(r,o)=>{try{const l=await Ah(r,{name:o});t(u=>({folders:u.folders.map(d=>d.id===r?l:d)}))}catch(l){s().addToast("error",`Failed to rename folder — ${l.message}`)}},deleteFolder:async r=>{const o=s().folders,l=s().sessions;t(u=>({folders:u.folders.filter(d=>d.id!==r),sessions:u.sessions.map(d=>d.folder_id===r?{...d,folder_id:null}:d)}));try{await A0(r)}catch(u){t({folders:o,sessions:l}),s().addToast("error",`Failed to delete folder — ${u.message}`)}},applyMoves:async r=>{if(r.length===0)return;const o=s().sessions,l=new Map(r.map(u=>[u.id,u]));t(u=>({sessions:u.sessions.map(d=>{const p=l.get(d.id);return p?{...d,folder_id:p.folder_id,sort_order:p.sort_order}:d})}));try{await I0(r)}catch(u){t({sessions:o}),s().addToast("error",`Failed to save session order — ${u.message}`)}},reorderFolders:async r=>{const o=s().folders,l=new Map(r.map((u,d)=>[u,d]));t(u=>({folders:u.folders.map(d=>l.has(d.id)?{...d,sort_order:l.get(d.id)}:d)}));try{await Promise.all(r.map((u,d)=>Ah(u,{sort_order:d})))}catch(u){t({folders:o}),s().addToast("error",`Failed to save folder order — ${u.message}`)}}});function Kh(){return Wt("/apps")}function Sw(){return Wt("/apps/root")}function qh(t){return Wt(`/apps/${t}/source`)}function Yh(t,s=""){return Wt(`/apps/${t}/state?workspace=${encodeURIComponent(s)}`)}function Fg(t,s,r=""){return h0(`/apps/${t}/state?workspace=${encodeURIComponent(r)}`,s)}function bw(t){return Rl(`/apps/${t}`)}function Tw(t){return Wt(`/apps/${t}/sessions`)}function Nw(){return Wt("/apps/examples")}function jw(t){return ct(`/apps/examples/${t}/install`,{})}function Cw(t){return ct("/apps",t)}function Ew(t,s){return ct("/apps/import",{id:t,files:s})}function _w(t,s,r){return ct(`/apps/mcp/calls/${t}/result`,{result:s,error:null})}function Rw(t,s){return ct(`/apps/${t}/edit-session`,s)}function Aw(t,s){return ct(`/apps/${t}/files`,s)}async function Iw(t,s){const r=await fetch(`${mn()}/api/apps/${t}/files/${encodeURIComponent(s)}/meta`);if(r.status===404)return null;if(!r.ok)throw new Error(`GET /apps/${t}/files/${s}/meta failed: ${r.status} ${r.statusText}`);return await r.json()}async function Mw(t,s){const r=await fetch(`${mn()}/api/apps/${t}/files/${encodeURIComponent(s)}`);if(!r.ok)throw new Error(`GET /apps/${t}/files/${s} failed: ${r.status} ${r.statusText}`);return r.blob()}const sl=new Set;async function Au(t,s){sl.add(s),await t().loadApps();const r=t().apps.find(o=>o.id===s);t().openAppTab(s),t().addToast("success",`Mini app added: ${(r==null?void 0:r.title)??s}`)}const Xu="agentpane:app-workspaces";function Dw(){try{const t=JSON.parse(localStorage.getItem(Xu)??"{}");return t&&typeof t=="object"?t:{}}catch{return{}}}const Lw=(t,s)=>({apps:[],appsRootPath:null,openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:Dw(),loadApps:async()=>{try{const[r,o]=await Promise.all([Kh(),Sw().catch(()=>null)]);return r.forEach(l=>sl.add(l.id)),t(o?{apps:r,appsRootPath:o.root}:{apps:r}),!0}catch{return!1}},refreshApps:async()=>{try{const r=await Kh();for(const o of r)sl.has(o.id)||(sl.add(o.id),s().addToast("success",`New mini app discovered: ${o.title}`));t({apps:r})}catch{}},openAppTab:r=>{t(o=>({activeAppTabId:r,openAppTabs:o.openAppTabs.includes(r)?o.openAppTabs:[...o.openAppTabs,r]}))},closeAppTab:r=>s().closeTabs([To(r)]),setActiveAppTab:r=>t({activeAppTabId:r}),openAppCatalog:()=>t({appCatalogOpen:!0}),closeAppCatalog:()=>t({appCatalogOpen:!1}),setAppWorkspace:(r,o)=>{t(l=>{const u={...l.appWorkspaces,[r]:o};try{localStorage.setItem(Xu,JSON.stringify(u))}catch{}return{appWorkspaces:u}})},installExampleApp:async r=>{try{return await jw(r),await Au(s,r),!0}catch(o){return s().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async r=>{try{return await Cw(r),await Au(s,r.id),!0}catch(o){return s().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(r,o)=>{try{return await Ew(r,o),await Au(s,r),!0}catch(l){return s().addToast("error",`Failed to import app — ${l.message}`),!1}},startAppEdit:async r=>{try{const o=s().lastModelConfig,l=await Rw(r,{runtime_type:o==null?void 0:o.provider,model:(o==null?void 0:o.model)??null,model_reasoning_effort:(o==null?void 0:o.reasoning)??null});s().sessions.some(u=>u.id===l.id)||t(u=>({sessions:[l,...u.sessions]})),await s().selectSession(l.id),s().addLogEntry("INFO",`App edit session opened for ${r}`)}catch(o){s().addToast("error",`Failed to open app edit session — ${o.message}`)}},toggleAppPin:async r=>{const o=s().apps.find(l=>l.id===r);if(o)try{await Fg(r,{pinned:!o.pinned}),await s().loadApps()}catch(l){s().addToast("error",`Failed to pin app — ${l.message}`)}},deleteApp:async r=>{try{await bw(r);const o=s().activeSessionId;t(u=>{const d={...u.appWorkspaces};delete d[r];try{localStorage.setItem(Xu,JSON.stringify(d))}catch{}return{apps:u.apps.filter(p=>p.id!==r),openAppTabs:u.openAppTabs.filter(p=>p!==r),...kd(u,new Set([To(r)])),appWorkspaces:d}});const l=s().activeSessionId;l&&l!==o&&s().selectSession(l,{keepAppView:!0}),s().addToast("success",`Mini app deleted: ${r}`)}catch(o){s().addToast("error",`Failed to delete app — ${o.message}`)}}}),Ow=(t,s)=>({tabOrder:[],closedTabs:[],moveTab:(r,o)=>{const l=[...s().tabOrder],u=l.indexOf(r),d=l.indexOf(o);u===-1||d===-1||u===d||(l.splice(d,0,...l.splice(u,1)),t({tabOrder:l}))},closeTabs:r=>{const o=s(),l=new Set(r.filter(g=>o.tabOrder.includes(g)));if(l.size===0)return;const u=kd(o,l),d=o.tabOrder.map((g,m)=>({key:g,index:m})).filter(g=>l.has(g.key)).reverse();t({...u,openTabs:o.openTabs.filter(g=>!l.has($r(g))),openAppTabs:o.openAppTabs.filter(g=>!l.has(To(g))),tabOrder:o.tabOrder.filter(g=>!l.has(g)),closedTabs:[...o.closedTabs,...d].slice(-20)});const p=u.activeSessionId;p!==null&&p!==o.activeSessionId&&s().selectSession(p,{keepAppView:!0})},reopenClosedTab:()=>{const r=s(),o=[...r.closedTabs];let l=o.pop();for(;l&&!Ig(r,l.key);)l=o.pop();if(!l){t({closedTabs:[]});return}const u=[...r.tabOrder];u.splice(l.index,0,l.key);const{kind:d,id:p}=fr(l.key);d==="app"?(t({closedTabs:o,tabOrder:u,openAppTabs:[...r.openAppTabs,p]}),s().openAppTab(p)):(t({closedTabs:o,tabOrder:u,openTabs:[...r.openTabs,p]}),s().selectSession(p))}}),Xh=3e3,Hn={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},Vn=[];let dl=0,Td=0,fl=0,Nd=0,pl=0,jd=0,Cd=0;const No=new Map,jo=new Map;let wi=new Map,yi=0,ki=new Map,Iu=!1;function hl(t,s,r){if(Vn.push({t:Date.now(),cat:t,msg:s,ms:r}),Vn.length>Xh){const o=Vn.length-Xh;Vn.splice(0,o),In=Math.max(0,In-o)}}function xi(t,s,r){hl(t,s,r),console.log(`[perf:${t}] ${s}`)}function Ug(t){xi("note",t)}function Bg(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}function Pw(t,s){let r=wi.get(t);r||wi.set(t,r={n:0,bytes:0}),r.n++,r.bytes+=s;let o=No.get(t);o||No.set(t,o={n:0,bytes:0}),o.n++,o.bytes+=s}function $w(){yi++,Cd++}function zw(t){ki.set(t,(ki.get(t)??0)+1),jo.set(t,(jo.get(t)??0)+1)}let rl=0;function Fw(){rl=performance.now()}function Uw(){const t=performance.now(),s=rl?t-rl:null;rl=0,requestAnimationFrame(()=>{if(s===null)return;const r=performance.now()-t+s;r>Hn.keypressMs&&xi("input",`keystroke→paint ${Math.round(r)}ms (keydown→change ${Math.round(s)}ms, change→paint ${Math.round(performance.now()-t)}ms)`)})}const Bw=5e3,Wg=500,Qh=2e3;let In=0,Mu=!1;function Ww(t){return ct("/perf-log",{entries:t}).then(()=>{In+=t.length})}function Hw(){if(Mu||In>=Vn.length)return;const t=Vn.slice(In,In+Wg);t.length!==0&&(Mu=!0,Ww(t).catch(()=>{Vn.length-In>Qh&&(In=Math.max(In,Vn.length-Qh))}).finally(()=>{Mu=!1}))}function Zh(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||In>=Vn.length)return;const t=Vn.slice(In,In+Wg);if(t.length!==0)try{const s=new Blob([JSON.stringify({entries:t})],{type:"application/json"});navigator.sendBeacon(`${mn()}/api/perf-log`,s),In+=t.length}catch{}}function Vw(){let t=0;for(const o of wi.values())t+=o.n;const s=[];if(t>0){const o=[...wi.entries()].sort((l,u)=>u[1].n-l[1].n).map(([l,u])=>`${l}×${u.n}(${Bg(u.bytes)})`).join(", ");s.push(`ws ${t}/s [${o}]`)}yi>0&&s.push(`store ${yi}/s`);const r=[...ki.entries()].sort((o,l)=>l[1]-o[1]).map(([o,l])=>`${o}×${l}`);if(r.length>0&&s.push(`renders ${r.join(" ")}`),s.length>0){const o=s.join(" · ");hl("stat",o);const l=[...ki.values()].some(u=>u>Hn.renderPerSecLog);(t>Hn.wsPerSecLog||yi>Hn.storePerSecLog||l)&&console.log(`[perf:stat] ${o}`)}wi=new Map,yi=0,ki=new Map}function Gw(t){if(t instanceof Element){const s=t.id?`#${t.id}`:"",r=typeof t.className=="string"&&t.className?`.${t.className.trim().split(/\s+/)[0]}`:"";return`${t.tagName.toLowerCase()}${s}${r}`}return t?"window":"unknown"}function Kw(){if(Iu||typeof window>"u")return()=>{};Iu=!0,dl=Date.now();const t=[];let s=performance.now()+250;const r=window.setInterval(()=>{const u=performance.now(),d=u-s;s=u+250,d>Hn.lagMs&&(Td++,fl=Math.max(fl,d),xi("lag",`event loop blocked ${Math.round(d)}ms`))},250);if(t.push(()=>window.clearInterval(r)),typeof window.requestAnimationFrame=="function"){let u=performance.now(),d=0;const p=g=>{const m=g-u;u=g,m>Hn.frameGapMs&&xi("lag",`frame gap ${Math.round(m)}ms`),d=window.requestAnimationFrame(p)};d=window.requestAnimationFrame(p),t.push(()=>window.cancelAnimationFrame(d))}if(typeof PerformanceObserver<"u"){try{const u=new PerformanceObserver(d=>{var p;for(const g of d.getEntries()){const m=g.duration;if(m<Hn.longtaskBufferMs)continue;Nd++,pl=Math.max(pl,m);const v=(p=g.attribution)==null?void 0:p[0],k=(v==null?void 0:v.containerName)||(v==null?void 0:v.name)||"unknown",y=`long task ${Math.round(m)}ms (${k})`;m>=Hn.longtaskLogMs?xi("longtask",y,m):hl("longtask",y,m)}});u.observe({type:"longtask",buffered:!1}),t.push(()=>u.disconnect())}catch{}try{const u=new PerformanceObserver(d=>{for(const p of d.getEntries()){const g=p.duration,m=p.processingStart-p.startTime;jd++;const v=`${p.name} ${Math.round(g)}ms (input delay ${Math.round(m)}ms) on ${Gw(p.target)}`;g>=Hn.eventLogMs?xi("input",v,g):hl("input",v,g)}});u.observe({type:"event",durationThreshold:Hn.eventBufferMs}),t.push(()=>u.disconnect())}catch{}}const o=window.setInterval(Vw,1e3);t.push(()=>window.clearInterval(o)),Ug("perf logger session started");const l=window.setInterval(Hw,Bw);return t.push(()=>window.clearInterval(l)),window.addEventListener("beforeunload",Zh),t.push(()=>window.removeEventListener("beforeunload",Zh)),window.__agentPanePerf={dump:Hg,reset:Vg},()=>{t.forEach(u=>u()),Iu=!1}}function Hg(){const t=[],s=dl?Math.round((Date.now()-dl)/1e3):0;if(t.push("=== agent-pane perf report ==="),t.push(`uptime ${s}s · ${Vn.length} buffered entries`),t.push(`event-loop lag: ${Td} blocks >${Hn.lagMs}ms (max ${Math.round(fl)}ms)`),t.push(`long tasks: ${Nd} ≥${Hn.longtaskBufferMs}ms (max ${Math.round(pl)}ms)`),t.push(`slow input events (≥${Hn.eventBufferMs}ms): ${jd}`),t.push(`store updates: ${Cd} total`),No.size>0){t.push("ws messages by type (top 15):");for(const[r,o]of[...No.entries()].sort((l,u)=>u[1].n-l[1].n).slice(0,15))t.push(` ${r}: ${o.n} msgs, ${Bg(o.bytes)}`)}if(jo.size>0){t.push("render counts by component:");for(const[r,o]of[...jo.entries()].sort((l,u)=>u[1]-l[1]))t.push(` ${r}: ${o}`)}t.push("--- last 200 entries ---");for(const r of Vn.slice(-200))t.push(`${new Date(r.t).toISOString().slice(11,23)} [${r.cat}] ${r.msg}`);return t.join(`
50
- `)}function Vg(){Vn.length=0,In=0,dl=Date.now(),Td=0,fl=0,Nd=0,pl=0,jd=0,Cd=0,No.clear(),jo.clear(),wi=new Map,yi=0,ki=new Map}const Mt={start:Kw,note:Ug,trackWsEvent:Pw,trackStoreUpdate:$w,trackRender:zw,markKeystroke:Fw,markInputChange:Uw,dump:Hg,reset:Vg},I=r0()((...t)=>({...V0(...t),...K0(...t),...rw(...t),...xw(...t),...ww(...t),...kw(...t),...Lw(...t),...Ow(...t)}));typeof window<"u"&&(I.subscribe(()=>Mt.trackStoreUpdate()),D0(I),$0(I));const qw="modulepreload",Yw=function(t){return"/"+t},Jh={},Xw=function(s,r,o){let l=Promise.resolve();if(r&&r.length>0){let d=function(m){return Promise.all(m.map(v=>Promise.resolve(v).then(k=>({status:"fulfilled",value:k}),k=>({status:"rejected",reason:k}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),g=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));l=d(r.map(m=>{if(m=Yw(m),m in Jh)return;Jh[m]=!0;const v=m.endsWith(".css"),k=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${k}`))return;const y=document.createElement("link");if(y.rel=v?"stylesheet":qw,v||(y.as="script"),y.crossOrigin="",y.href=m,g&&y.setAttribute("nonce",g),document.head.appendChild(y),v)return new Promise((S,T)=>{y.addEventListener("load",S),y.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${m}`)))})}))}function u(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return l.then(d=>{for(const p of d||[])p.status==="rejected"&&u(p.reason);return s().catch(u)})};function Qu(t){switch(t){case"claude":return{iconClass:"ic-claude",iconText:"CL"};case"codex":return{iconClass:"ic-codex",iconText:"CX"};case"repoburg":return{iconClass:"ic-repoburg",iconText:"RB"};case"cursor":return{iconClass:"ic-cursor",iconText:"CR"};default:return{iconClass:"ic-codex",iconText:"CX"}}}function Qw(t,s,r=!1,o="working",l=0){if(o==="finished")return"";if(t==="interrupted")return"interrupted";if(s)return"running";if(l>0)return"background";if(r&&t!=="failed")return"queued";switch(t){case"failed":return"error";case"aborted":return"paused";default:return"paused"}}function Zw(t,s,r=!1,o="working",l=0){if(o==="finished")return"Finished";if(t==="interrupted")return"Interrupted";if(s)return"Running";if(l>0)return"Background";if(r&&t!=="failed")return"Review Pending";switch(t){case"failed":return"Failed";case"aborted":return"Aborted";case"active":return"Idle";case"completed":return"Completed";case"running":return"Running";default:return t}}function Dl(t,s=0){const r=t.is_running===1,o=t.lifecycle==="finished",l=Qu(t.runtime_type),u=Qw(t.status,r,t.has_unreviewed===1,t.lifecycle,s),d=Zw(t.status,r,t.has_unreviewed===1,t.lifecycle,s);return{dot:u,label:d,dotTitle:u==="background"?`${s} background task${s===1?"":"s"} running`:d,iconClass:l.iconClass,iconText:l.iconText,isRunning:r,isFinished:o,backgroundTaskCount:s}}function Do(t,s,r=!0){x.useEffect(()=>{if(!r)return;function o(l){t.current&&!t.current.contains(l.target)&&s()}return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[t,s,r])}function Ni(t,s=!0){x.useEffect(()=>{if(!s)return;function r(o){o.key==="Escape"&&t()}return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t,s])}function Ed({status:t,size:s=6,title:r}){return a.jsx("span",{className:`status-dot ${t}`,style:s!==6?{width:s,height:s}:void 0,title:r})}function _d({iconClass:t,iconText:s,size:r=20}){return a.jsx("span",{className:`runtime-icon ${t}`,style:r!==20?{width:r,height:r,fontSize:r*.45}:void 0,children:s})}/**
49
+ `;return t({quotedText:d}),s().addLogEntry("INFO",`Thread shared to main session — "${u.summary.slice(0,40)}"`),s().addToast("success","Thread summary added to your input"),!0}catch(u){return s().addToast("error",`Failed to share thread — ${u.message}`),!1}},deleteThread:async(r,o)=>{try{await Ml(`/sessions/${r}/threads/${o}`)}catch(l){s().addToast("error",`Failed to delete thread — ${l.message}`)}},askSidecar:async(r,o)=>{try{return await ot(`/sessions/${r}/sidecar`,{message:o}),s().addLogEntry("INFO",`Sidecar asked — "${o.slice(0,40)}"`),!0}catch(l){return s().addToast("error",`Failed to ask the sidecar — ${l.message}`),!1}},onThreadCreated:(r,o,l)=>{t(u=>{const d=u.sessionDetails[r];return d?{sessionDetails:{...u.sessionDetails,[r]:{...d,threads:[...d.threads??[],{...o,turns:[{...l,items:[]}]}]}}}:{}})},onThreadFollowup:(r,o,l)=>{t(u=>{const d=u.sessionDetails[r];return d?{sessionDetails:{...u.sessionDetails,[r]:{...d,threads:(d.threads??[]).map(p=>p.id===o?{...p,turns:[...p.turns??[],{...l,items:[]}]}:p)}}}:{}})},onThreadResolved:(r,o,l)=>{t(u=>{const d=u.sessionDetails[r];if(!d)return{};const p=(d.threads??[]).map(g=>g.id===o?{...g,status:l,resolved_at:l==="resolved"?new Date().toISOString():null}:g);return{sessionDetails:{...u.sessionDetails,[r]:{...d,threads:p}}}})},onThreadDeleted:(r,o)=>{t(l=>{const u=l.sessionDetails[r];return u?{sessionDetails:{...l.sessionDetails,[r]:{...u,threads:(u.threads??[]).filter(d=>d.id!==o)}}}:{}})}}),Tw=(t,s)=>({folders:[],loadFolders:async()=>{const r=await Ag();t({folders:r})},createSidebarFolder:async(r,o)=>{try{const l=await M0(r,o);return t(u=>({folders:[...u.folders,l]})),l}catch(l){return s().addToast("error",`Failed to create folder — ${l.message}`),null}},renameFolder:async(r,o)=>{try{const l=await Ih(r,{name:o});t(u=>({folders:u.folders.map(d=>d.id===r?l:d)}))}catch(l){s().addToast("error",`Failed to rename folder — ${l.message}`)}},deleteFolder:async r=>{const o=s().folders,l=s().sessions;t(u=>({folders:u.folders.filter(d=>d.id!==r),sessions:u.sessions.map(d=>d.folder_id===r?{...d,folder_id:null}:d)}));try{await D0(r)}catch(u){t({folders:o,sessions:l}),s().addToast("error",`Failed to delete folder — ${u.message}`)}},applyMoves:async r=>{if(r.length===0)return;const o=s().sessions,l=new Map(r.map(u=>[u.id,u]));t(u=>({sessions:u.sessions.map(d=>{const p=l.get(d.id);return p?{...d,folder_id:p.folder_id,sort_order:p.sort_order}:d})}));try{await L0(r)}catch(u){t({sessions:o}),s().addToast("error",`Failed to save session order — ${u.message}`)}},reorderFolders:async r=>{const o=s().folders,l=new Map(r.map((u,d)=>[u,d]));t(u=>({folders:u.folders.map(d=>l.has(d.id)?{...d,sort_order:l.get(d.id)}:d)}));try{await Promise.all(r.map((u,d)=>Ih(u,{sort_order:d})))}catch(u){t({folders:o}),s().addToast("error",`Failed to save folder order — ${u.message}`)}}});function qh(){return $t("/apps")}function Nw(){return $t("/apps/root")}function Yh(t){return $t(`/apps/${t}/source`)}function Xh(t,s=""){return $t(`/apps/${t}/state?workspace=${encodeURIComponent(s)}`)}function Wg(t,s,r=""){return y0(`/apps/${t}/state?workspace=${encodeURIComponent(r)}`,s)}function jw(t){return Ml(`/apps/${t}`)}function Cw(t){return $t(`/apps/${t}/sessions`)}async function Ew(t,s){try{return await $t(`/apps/${t}/sessions/${encodeURIComponent(s)}`)}catch(r){if(r instanceof Il&&r.status===404)return null;throw r}}function _w(t,s){return ot(`/apps/${t}/sessions/${encodeURIComponent(s)}/cancel`)}function Rw(t,s,r){return ds(`/apps/${t}/sessions/${encodeURIComponent(s)}`,{lifecycle:r})}async function Aw(t,s,r,o){const l=await ot("/apps/mcp/call",{tool:`${t}__${r}`,args:o,workspace:s});if(!l.ok)throw new Error(l.error||`callTool: ${r} failed`);return l.result}function Iw(){return $t("/apps/examples")}function Mw(t){return ot(`/apps/examples/${t}/install`,{})}function Dw(t){return ot("/apps",t)}function Lw(t,s){return ot("/apps/import",{id:t,files:s})}function Ow(t,s,r){return ot(`/apps/mcp/calls/${t}/result`,{result:s,error:null})}function Pw(t,s){return ot(`/apps/${t}/edit-session`,s)}function $w(t,s){return ot(`/apps/${t}/files`,s)}async function zw(t,s){const r=await fetch(`${mn()}/api/apps/${t}/files/${encodeURIComponent(s)}/meta`);if(r.status===404)return null;if(!r.ok)throw new Error(`GET /apps/${t}/files/${s}/meta failed: ${r.status} ${r.statusText}`);return await r.json()}async function Fw(t,s){const r=await fetch(`${mn()}/api/apps/${t}/files/${encodeURIComponent(s)}`);if(!r.ok)throw new Error(`GET /apps/${t}/files/${s} failed: ${r.status} ${r.statusText}`);return r.blob()}const rl=new Set;async function Mu(t,s){rl.add(s),await t().loadApps();const r=t().apps.find(o=>o.id===s);t().openAppTab(s),t().addToast("success",`Mini app added: ${(r==null?void 0:r.title)??s}`)}const Zu="agentpane:app-workspaces";function Uw(){try{const t=JSON.parse(localStorage.getItem(Zu)??"{}");return t&&typeof t=="object"?t:{}}catch{return{}}}const Bw=(t,s)=>({apps:[],appsRootPath:null,openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:Uw(),loadApps:async()=>{try{const[r,o]=await Promise.all([qh(),Nw().catch(()=>null)]);return r.forEach(l=>rl.add(l.id)),t(o?{apps:r,appsRootPath:o.root}:{apps:r}),!0}catch{return!1}},refreshApps:async()=>{try{const r=await qh();for(const o of r)rl.has(o.id)||(rl.add(o.id),s().addToast("success",`New mini app discovered: ${o.title}`));t({apps:r})}catch{}},openAppTab:r=>{t(o=>({activeAppTabId:r,openAppTabs:o.openAppTabs.includes(r)?o.openAppTabs:[...o.openAppTabs,r]}))},closeAppTab:r=>s().closeTabs([To(r)]),setActiveAppTab:r=>t({activeAppTabId:r}),openAppCatalog:()=>t({appCatalogOpen:!0}),closeAppCatalog:()=>t({appCatalogOpen:!1}),setAppWorkspace:(r,o)=>{t(l=>{const u={...l.appWorkspaces,[r]:o};try{localStorage.setItem(Zu,JSON.stringify(u))}catch{}return{appWorkspaces:u}})},installExampleApp:async r=>{try{return await Mw(r),await Mu(s,r),!0}catch(o){return s().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async r=>{try{return await Dw(r),await Mu(s,r.id),!0}catch(o){return s().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(r,o)=>{try{return await Lw(r,o),await Mu(s,r),!0}catch(l){return s().addToast("error",`Failed to import app — ${l.message}`),!1}},startAppEdit:async r=>{try{const o=s().lastModelConfig,l=await Pw(r,{runtime_type:o==null?void 0:o.provider,model:(o==null?void 0:o.model)??null,model_reasoning_effort:(o==null?void 0:o.reasoning)??null});s().sessions.some(u=>u.id===l.id)||t(u=>({sessions:[l,...u.sessions]})),await s().selectSession(l.id),s().addLogEntry("INFO",`App edit session opened for ${r}`)}catch(o){s().addToast("error",`Failed to open app edit session — ${o.message}`)}},toggleAppPin:async r=>{const o=s().apps.find(l=>l.id===r);if(o)try{await Wg(r,{pinned:!o.pinned}),await s().loadApps()}catch(l){s().addToast("error",`Failed to pin app — ${l.message}`)}},deleteApp:async r=>{try{await jw(r);const o=s().activeSessionId;t(u=>{const d={...u.appWorkspaces};delete d[r];try{localStorage.setItem(Zu,JSON.stringify(d))}catch{}return{apps:u.apps.filter(p=>p.id!==r),openAppTabs:u.openAppTabs.filter(p=>p!==r),...Sd(u,new Set([To(r)])),appWorkspaces:d}});const l=s().activeSessionId;l&&l!==o&&s().selectSession(l,{keepAppView:!0}),s().addToast("success",`Mini app deleted: ${r}`)}catch(o){s().addToast("error",`Failed to delete app — ${o.message}`)}}}),Ww=(t,s)=>({tabOrder:[],closedTabs:[],moveTab:(r,o)=>{const l=[...s().tabOrder],u=l.indexOf(r),d=l.indexOf(o);u===-1||d===-1||u===d||(l.splice(d,0,...l.splice(u,1)),t({tabOrder:l}))},closeTabs:r=>{const o=s(),l=new Set(r.filter(g=>o.tabOrder.includes(g)));if(l.size===0)return;const u=Sd(o,l),d=o.tabOrder.map((g,m)=>({key:g,index:m})).filter(g=>l.has(g.key)).reverse();t({...u,openTabs:o.openTabs.filter(g=>!l.has($r(g))),openAppTabs:o.openAppTabs.filter(g=>!l.has(To(g))),tabOrder:o.tabOrder.filter(g=>!l.has(g)),closedTabs:[...o.closedTabs,...d].slice(-20)});const p=u.activeSessionId;p!==null&&p!==o.activeSessionId&&s().selectSession(p,{keepAppView:!0})},reopenClosedTab:()=>{const r=s(),o=[...r.closedTabs];let l=o.pop();for(;l&&!Dg(r,l.key);)l=o.pop();if(!l){t({closedTabs:[]});return}const u=[...r.tabOrder];u.splice(l.index,0,l.key);const{kind:d,id:p}=fr(l.key);d==="app"?(t({closedTabs:o,tabOrder:u,openAppTabs:[...r.openAppTabs,p]}),s().openAppTab(p)):(t({closedTabs:o,tabOrder:u,openTabs:[...r.openTabs,p]}),s().selectSession(p))}}),Qh=3e3,Hn={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},Vn=[];let pl=0,Nd=0,hl=0,jd=0,ml=0,Cd=0,Ed=0;const No=new Map,jo=new Map;let wi=new Map,yi=0,ki=new Map,Du=!1;function gl(t,s,r){if(Vn.push({t:Date.now(),cat:t,msg:s,ms:r}),Vn.length>Qh){const o=Vn.length-Qh;Vn.splice(0,o),In=Math.max(0,In-o)}}function xi(t,s,r){gl(t,s,r),console.log(`[perf:${t}] ${s}`)}function Hg(t){xi("note",t)}function Vg(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}function Hw(t,s){let r=wi.get(t);r||wi.set(t,r={n:0,bytes:0}),r.n++,r.bytes+=s;let o=No.get(t);o||No.set(t,o={n:0,bytes:0}),o.n++,o.bytes+=s}function Vw(){yi++,Ed++}function Gw(t){ki.set(t,(ki.get(t)??0)+1),jo.set(t,(jo.get(t)??0)+1)}let il=0;function Kw(){il=performance.now()}function qw(){const t=performance.now(),s=il?t-il:null;il=0,requestAnimationFrame(()=>{if(s===null)return;const r=performance.now()-t+s;r>Hn.keypressMs&&xi("input",`keystroke→paint ${Math.round(r)}ms (keydown→change ${Math.round(s)}ms, change→paint ${Math.round(performance.now()-t)}ms)`)})}const Yw=5e3,Gg=500,Zh=2e3;let In=0,Lu=!1;function Xw(t){return ot("/perf-log",{entries:t}).then(()=>{In+=t.length})}function Qw(){if(Lu||In>=Vn.length)return;const t=Vn.slice(In,In+Gg);t.length!==0&&(Lu=!0,Xw(t).catch(()=>{Vn.length-In>Zh&&(In=Math.max(In,Vn.length-Zh))}).finally(()=>{Lu=!1}))}function Jh(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||In>=Vn.length)return;const t=Vn.slice(In,In+Gg);if(t.length!==0)try{const s=new Blob([JSON.stringify({entries:t})],{type:"application/json"});navigator.sendBeacon(`${mn()}/api/perf-log`,s),In+=t.length}catch{}}function Zw(){let t=0;for(const o of wi.values())t+=o.n;const s=[];if(t>0){const o=[...wi.entries()].sort((l,u)=>u[1].n-l[1].n).map(([l,u])=>`${l}×${u.n}(${Vg(u.bytes)})`).join(", ");s.push(`ws ${t}/s [${o}]`)}yi>0&&s.push(`store ${yi}/s`);const r=[...ki.entries()].sort((o,l)=>l[1]-o[1]).map(([o,l])=>`${o}×${l}`);if(r.length>0&&s.push(`renders ${r.join(" ")}`),s.length>0){const o=s.join(" · ");gl("stat",o);const l=[...ki.values()].some(u=>u>Hn.renderPerSecLog);(t>Hn.wsPerSecLog||yi>Hn.storePerSecLog||l)&&console.log(`[perf:stat] ${o}`)}wi=new Map,yi=0,ki=new Map}function Jw(t){if(t instanceof Element){const s=t.id?`#${t.id}`:"",r=typeof t.className=="string"&&t.className?`.${t.className.trim().split(/\s+/)[0]}`:"";return`${t.tagName.toLowerCase()}${s}${r}`}return t?"window":"unknown"}function e1(){if(Du||typeof window>"u")return()=>{};Du=!0,pl=Date.now();const t=[];let s=performance.now()+250;const r=window.setInterval(()=>{const u=performance.now(),d=u-s;s=u+250,d>Hn.lagMs&&(Nd++,hl=Math.max(hl,d),xi("lag",`event loop blocked ${Math.round(d)}ms`))},250);if(t.push(()=>window.clearInterval(r)),typeof window.requestAnimationFrame=="function"){let u=performance.now(),d=0;const p=g=>{const m=g-u;u=g,m>Hn.frameGapMs&&xi("lag",`frame gap ${Math.round(m)}ms`),d=window.requestAnimationFrame(p)};d=window.requestAnimationFrame(p),t.push(()=>window.cancelAnimationFrame(d))}if(typeof PerformanceObserver<"u"){try{const u=new PerformanceObserver(d=>{var p;for(const g of d.getEntries()){const m=g.duration;if(m<Hn.longtaskBufferMs)continue;jd++,ml=Math.max(ml,m);const v=(p=g.attribution)==null?void 0:p[0],k=(v==null?void 0:v.containerName)||(v==null?void 0:v.name)||"unknown",y=`long task ${Math.round(m)}ms (${k})`;m>=Hn.longtaskLogMs?xi("longtask",y,m):gl("longtask",y,m)}});u.observe({type:"longtask",buffered:!1}),t.push(()=>u.disconnect())}catch{}try{const u=new PerformanceObserver(d=>{for(const p of d.getEntries()){const g=p.duration,m=p.processingStart-p.startTime;Cd++;const v=`${p.name} ${Math.round(g)}ms (input delay ${Math.round(m)}ms) on ${Jw(p.target)}`;g>=Hn.eventLogMs?xi("input",v,g):gl("input",v,g)}});u.observe({type:"event",durationThreshold:Hn.eventBufferMs}),t.push(()=>u.disconnect())}catch{}}const o=window.setInterval(Zw,1e3);t.push(()=>window.clearInterval(o)),Hg("perf logger session started");const l=window.setInterval(Qw,Yw);return t.push(()=>window.clearInterval(l)),window.addEventListener("beforeunload",Jh),t.push(()=>window.removeEventListener("beforeunload",Jh)),window.__agentPanePerf={dump:Kg,reset:qg},()=>{t.forEach(u=>u()),Du=!1}}function Kg(){const t=[],s=pl?Math.round((Date.now()-pl)/1e3):0;if(t.push("=== agent-pane perf report ==="),t.push(`uptime ${s}s · ${Vn.length} buffered entries`),t.push(`event-loop lag: ${Nd} blocks >${Hn.lagMs}ms (max ${Math.round(hl)}ms)`),t.push(`long tasks: ${jd} ≥${Hn.longtaskBufferMs}ms (max ${Math.round(ml)}ms)`),t.push(`slow input events (≥${Hn.eventBufferMs}ms): ${Cd}`),t.push(`store updates: ${Ed} total`),No.size>0){t.push("ws messages by type (top 15):");for(const[r,o]of[...No.entries()].sort((l,u)=>u[1].n-l[1].n).slice(0,15))t.push(` ${r}: ${o.n} msgs, ${Vg(o.bytes)}`)}if(jo.size>0){t.push("render counts by component:");for(const[r,o]of[...jo.entries()].sort((l,u)=>u[1]-l[1]))t.push(` ${r}: ${o}`)}t.push("--- last 200 entries ---");for(const r of Vn.slice(-200))t.push(`${new Date(r.t).toISOString().slice(11,23)} [${r.cat}] ${r.msg}`);return t.join(`
50
+ `)}function qg(){Vn.length=0,In=0,pl=Date.now(),Nd=0,hl=0,jd=0,ml=0,Cd=0,Ed=0,No.clear(),jo.clear(),wi=new Map,yi=0,ki=new Map}const Mt={start:e1,note:Hg,trackWsEvent:Hw,trackStoreUpdate:Vw,trackRender:Gw,markKeystroke:Kw,markInputChange:qw,dump:Kg,reset:qg},I=l0()((...t)=>({...q0(...t),...X0(...t),...lw(...t),...Sw(...t),...bw(...t),...Tw(...t),...Bw(...t),...Ww(...t)}));typeof window<"u"&&(I.subscribe(()=>Mt.trackStoreUpdate()),P0(I),U0(I));const t1="modulepreload",n1=function(t){return"/"+t},em={},s1=function(s,r,o){let l=Promise.resolve();if(r&&r.length>0){let d=function(m){return Promise.all(m.map(v=>Promise.resolve(v).then(k=>({status:"fulfilled",value:k}),k=>({status:"rejected",reason:k}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),g=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));l=d(r.map(m=>{if(m=n1(m),m in em)return;em[m]=!0;const v=m.endsWith(".css"),k=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${k}`))return;const y=document.createElement("link");if(y.rel=v?"stylesheet":t1,v||(y.as="script"),y.crossOrigin="",y.href=m,g&&y.setAttribute("nonce",g),document.head.appendChild(y),v)return new Promise((S,T)=>{y.addEventListener("load",S),y.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${m}`)))})}))}function u(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return l.then(d=>{for(const p of d||[])p.status==="rejected"&&u(p.reason);return s().catch(u)})};function Ju(t){switch(t){case"claude":return{iconClass:"ic-claude",iconText:"CL"};case"codex":return{iconClass:"ic-codex",iconText:"CX"};case"repoburg":return{iconClass:"ic-repoburg",iconText:"RB"};case"cursor":return{iconClass:"ic-cursor",iconText:"CR"};default:return{iconClass:"ic-codex",iconText:"CX"}}}function r1(t,s,r=!1,o="working",l=0){if(o==="finished")return"";if(t==="interrupted")return"interrupted";if(s)return"running";if(l>0)return"background";if(r&&t!=="failed")return"queued";switch(t){case"failed":return"error";case"aborted":return"paused";default:return"paused"}}function i1(t,s,r=!1,o="working",l=0){if(o==="finished")return"Finished";if(t==="interrupted")return"Interrupted";if(s)return"Running";if(l>0)return"Background";if(r&&t!=="failed")return"Review Pending";switch(t){case"failed":return"Failed";case"aborted":return"Aborted";case"active":return"Idle";case"completed":return"Completed";case"running":return"Running";default:return t}}function Pl(t,s=0){const r=t.is_running===1,o=t.lifecycle==="finished",l=Ju(t.runtime_type),u=r1(t.status,r,t.has_unreviewed===1,t.lifecycle,s),d=i1(t.status,r,t.has_unreviewed===1,t.lifecycle,s);return{dot:u,label:d,dotTitle:u==="background"?`${s} background task${s===1?"":"s"} running`:d,iconClass:l.iconClass,iconText:l.iconText,isRunning:r,isFinished:o,backgroundTaskCount:s}}function Do(t,s,r=!0){x.useEffect(()=>{if(!r)return;function o(l){t.current&&!t.current.contains(l.target)&&s()}return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[t,s,r])}function Ni(t,s=!0){x.useEffect(()=>{if(!s)return;function r(o){o.key==="Escape"&&t()}return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t,s])}function _d({status:t,size:s=6,title:r}){return a.jsx("span",{className:`status-dot ${t}`,style:s!==6?{width:s,height:s}:void 0,title:r})}function Rd({iconClass:t,iconText:s,size:r=20}){return a.jsx("span",{className:`runtime-icon ${t}`,style:r!==20?{width:r,height:r,fontSize:r*.45}:void 0,children:s})}/**
51
51
  * @license lucide-react v0.469.0 - ISC
52
52
  *
53
53
  * This source code is licensed under the ISC license.
54
54
  * See the LICENSE file in the root directory of this source tree.
55
- */const Jw=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gg=(...t)=>t.filter((s,r,o)=>!!s&&s.trim()!==""&&o.indexOf(s)===r).join(" ").trim();/**
55
+ */const o1=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yg=(...t)=>t.filter((s,r,o)=>!!s&&s.trim()!==""&&o.indexOf(s)===r).join(" ").trim();/**
56
56
  * @license lucide-react v0.469.0 - ISC
57
57
  *
58
58
  * This source code is licensed under the ISC license.
59
59
  * See the LICENSE file in the root directory of this source tree.
60
- */var e1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
60
+ */var a1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
61
61
  * @license lucide-react v0.469.0 - ISC
62
62
  *
63
63
  * This source code is licensed under the ISC license.
64
64
  * See the LICENSE file in the root directory of this source tree.
65
- */const Kg=x.forwardRef(({color:t="currentColor",size:s=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:l="",children:u,iconNode:d,...p},g)=>x.createElement("svg",{ref:g,...e1,width:s,height:s,stroke:t,strokeWidth:o?Number(r)*24/Number(s):r,className:Gg("lucide",l),...p},[...d.map(([m,v])=>x.createElement(m,v)),...Array.isArray(u)?u:[u]]));/**
65
+ */const Xg=x.forwardRef(({color:t="currentColor",size:s=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:l="",children:u,iconNode:d,...p},g)=>x.createElement("svg",{ref:g,...a1,width:s,height:s,stroke:t,strokeWidth:o?Number(r)*24/Number(s):r,className:Yg("lucide",l),...p},[...d.map(([m,v])=>x.createElement(m,v)),...Array.isArray(u)?u:[u]]));/**
66
66
  * @license lucide-react v0.469.0 - ISC
67
67
  *
68
68
  * This source code is licensed under the ISC license.
69
69
  * See the LICENSE file in the root directory of this source tree.
70
- */const ge=(t,s)=>{const r=x.forwardRef(({className:o,...l},u)=>x.createElement(Kg,{ref:u,iconNode:s,className:Gg(`lucide-${Jw(t)}`,o),...l}));return r.displayName=`${t}`,r};/**
70
+ */const ye=(t,s)=>{const r=x.forwardRef(({className:o,...l},u)=>x.createElement(Xg,{ref:u,iconNode:s,className:Yg(`lucide-${o1(t)}`,o),...l}));return r.displayName=`${t}`,r};/**
71
71
  * @license lucide-react v0.469.0 - ISC
72
72
  *
73
73
  * This source code is licensed under the ISC license.
74
74
  * See the LICENSE file in the root directory of this source tree.
75
- */const t1=ge("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
75
+ */const l1=ye("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
76
76
  * @license lucide-react v0.469.0 - ISC
77
77
  *
78
78
  * This source code is licensed under the ISC license.
79
79
  * See the LICENSE file in the root directory of this source tree.
80
- */const n1=ge("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
80
+ */const c1=ye("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
81
81
  * @license lucide-react v0.469.0 - ISC
82
82
  *
83
83
  * This source code is licensed under the ISC license.
84
84
  * See the LICENSE file in the root directory of this source tree.
85
- */const qg=ge("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
85
+ */const Qg=ye("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
86
86
  * @license lucide-react v0.469.0 - ISC
87
87
  *
88
88
  * This source code is licensed under the ISC license.
89
89
  * See the LICENSE file in the root directory of this source tree.
90
- */const s1=ge("BotOff",[["path",{d:"M13.67 8H18a2 2 0 0 1 2 2v4.33",key:"7az073"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}],["path",{d:"M8 8H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 1.414-.586",key:"s09a7a"}],["path",{d:"M9 13v2",key:"rq6x2g"}],["path",{d:"M9.67 4H12v2.33",key:"110xot"}]]);/**
90
+ */const u1=ye("BotOff",[["path",{d:"M13.67 8H18a2 2 0 0 1 2 2v4.33",key:"7az073"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}],["path",{d:"M8 8H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 1.414-.586",key:"s09a7a"}],["path",{d:"M9 13v2",key:"rq6x2g"}],["path",{d:"M9.67 4H12v2.33",key:"110xot"}]]);/**
91
91
  * @license lucide-react v0.469.0 - ISC
92
92
  *
93
93
  * This source code is licensed under the ISC license.
94
94
  * See the LICENSE file in the root directory of this source tree.
95
- */const mr=ge("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
95
+ */const mr=ye("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
96
96
  * @license lucide-react v0.469.0 - ISC
97
97
  *
98
98
  * This source code is licensed under the ISC license.
99
99
  * See the LICENSE file in the root directory of this source tree.
100
- */const r1=ge("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
100
+ */const d1=ye("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
101
101
  * @license lucide-react v0.469.0 - ISC
102
102
  *
103
103
  * This source code is licensed under the ISC license.
104
104
  * See the LICENSE file in the root directory of this source tree.
105
- */const Ts=ge("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
105
+ */const Ns=ye("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
106
106
  * @license lucide-react v0.469.0 - ISC
107
107
  *
108
108
  * This source code is licensed under the ISC license.
109
109
  * See the LICENSE file in the root directory of this source tree.
110
- */const Si=ge("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
110
+ */const Si=ye("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
111
111
  * @license lucide-react v0.469.0 - ISC
112
112
  *
113
113
  * This source code is licensed under the ISC license.
114
114
  * See the LICENSE file in the root directory of this source tree.
115
- */const Co=ge("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
115
+ */const Co=ye("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
116
116
  * @license lucide-react v0.469.0 - ISC
117
117
  *
118
118
  * This source code is licensed under the ISC license.
119
119
  * See the LICENSE file in the root directory of this source tree.
120
- */const Ll=ge("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
120
+ */const $l=ye("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
121
121
  * @license lucide-react v0.469.0 - ISC
122
122
  *
123
123
  * This source code is licensed under the ISC license.
124
124
  * See the LICENSE file in the root directory of this source tree.
125
- */const i1=ge("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
125
+ */const f1=ye("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
126
126
  * @license lucide-react v0.469.0 - ISC
127
127
  *
128
128
  * This source code is licensed under the ISC license.
129
129
  * See the LICENSE file in the root directory of this source tree.
130
- */const ml=ge("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
130
+ */const vl=ye("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
131
131
  * @license lucide-react v0.469.0 - ISC
132
132
  *
133
133
  * This source code is licensed under the ISC license.
134
134
  * See the LICENSE file in the root directory of this source tree.
135
- */const o1=ge("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
135
+ */const p1=ye("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
136
136
  * @license lucide-react v0.469.0 - ISC
137
137
  *
138
138
  * This source code is licensed under the ISC license.
139
139
  * See the LICENSE file in the root directory of this source tree.
140
- */const a1=ge("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
140
+ */const h1=ye("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
141
141
  * @license lucide-react v0.469.0 - ISC
142
142
  *
143
143
  * This source code is licensed under the ISC license.
144
144
  * See the LICENSE file in the root directory of this source tree.
145
- */const l1=ge("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
145
+ */const m1=ye("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
146
146
  * @license lucide-react v0.469.0 - ISC
147
147
  *
148
148
  * This source code is licensed under the ISC license.
149
149
  * See the LICENSE file in the root directory of this source tree.
150
- */const Yg=ge("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
150
+ */const Zg=ye("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
151
151
  * @license lucide-react v0.469.0 - ISC
152
152
  *
153
153
  * This source code is licensed under the ISC license.
154
154
  * See the LICENSE file in the root directory of this source tree.
155
- */const em=ge("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
155
+ */const tm=ye("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
156
156
  * @license lucide-react v0.469.0 - ISC
157
157
  *
158
158
  * This source code is licensed under the ISC license.
159
159
  * See the LICENSE file in the root directory of this source tree.
160
- */const Eo=ge("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
160
+ */const Eo=ye("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
161
161
  * @license lucide-react v0.469.0 - ISC
162
162
  *
163
163
  * This source code is licensed under the ISC license.
164
164
  * See the LICENSE file in the root directory of this source tree.
165
- */const c1=ge("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
165
+ */const g1=ye("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
166
166
  * @license lucide-react v0.469.0 - ISC
167
167
  *
168
168
  * This source code is licensed under the ISC license.
169
169
  * See the LICENSE file in the root directory of this source tree.
170
- */const u1=ge("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
170
+ */const v1=ye("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
171
171
  * @license lucide-react v0.469.0 - ISC
172
172
  *
173
173
  * This source code is licensed under the ISC license.
174
174
  * See the LICENSE file in the root directory of this source tree.
175
- */const d1=ge("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
175
+ */const y1=ye("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
176
176
  * @license lucide-react v0.469.0 - ISC
177
177
  *
178
178
  * This source code is licensed under the ISC license.
179
179
  * See the LICENSE file in the root directory of this source tree.
180
- */const Xg=ge("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
180
+ */const Jg=ye("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
181
181
  * @license lucide-react v0.469.0 - ISC
182
182
  *
183
183
  * This source code is licensed under the ISC license.
184
184
  * See the LICENSE file in the root directory of this source tree.
185
- */const f1=ge("FolderGit2",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);/**
185
+ */const x1=ye("FolderGit2",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);/**
186
186
  * @license lucide-react v0.469.0 - ISC
187
187
  *
188
188
  * This source code is licensed under the ISC license.
189
189
  * See the LICENSE file in the root directory of this source tree.
190
- */const p1=ge("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
190
+ */const w1=ye("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
191
191
  * @license lucide-react v0.469.0 - ISC
192
192
  *
193
193
  * This source code is licensed under the ISC license.
194
194
  * See the LICENSE file in the root directory of this source tree.
195
- */const Du=ge("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
195
+ */const Ou=ye("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
196
196
  * @license lucide-react v0.469.0 - ISC
197
197
  *
198
198
  * This source code is licensed under the ISC license.
199
199
  * See the LICENSE file in the root directory of this source tree.
200
- */const gl=ge("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
200
+ */const yl=ye("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
201
201
  * @license lucide-react v0.469.0 - ISC
202
202
  *
203
203
  * This source code is licensed under the ISC license.
204
204
  * See the LICENSE file in the root directory of this source tree.
205
- */const Qg=ge("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
205
+ */const ev=ye("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
206
206
  * @license lucide-react v0.469.0 - ISC
207
207
  *
208
208
  * This source code is licensed under the ISC license.
209
209
  * See the LICENSE file in the root directory of this source tree.
210
- */const Zg=ge("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
210
+ */const tv=ye("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
211
211
  * @license lucide-react v0.469.0 - ISC
212
212
  *
213
213
  * This source code is licensed under the ISC license.
214
214
  * See the LICENSE file in the root directory of this source tree.
215
- */const Jg=ge("Import",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]]);/**
215
+ */const nv=ye("Import",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]]);/**
216
216
  * @license lucide-react v0.469.0 - ISC
217
217
  *
218
218
  * This source code is licensed under the ISC license.
219
219
  * See the LICENSE file in the root directory of this source tree.
220
- */const h1=ge("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
220
+ */const k1=ye("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
221
221
  * @license lucide-react v0.469.0 - ISC
222
222
  *
223
223
  * This source code is licensed under the ISC license.
224
224
  * See the LICENSE file in the root directory of this source tree.
225
- */const m1=ge("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
225
+ */const S1=ye("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
226
226
  * @license lucide-react v0.469.0 - ISC
227
227
  *
228
228
  * This source code is licensed under the ISC license.
229
229
  * See the LICENSE file in the root directory of this source tree.
230
- */const g1=ge("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
230
+ */const b1=ye("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
231
231
  * @license lucide-react v0.469.0 - ISC
232
232
  *
233
233
  * This source code is licensed under the ISC license.
234
234
  * See the LICENSE file in the root directory of this source tree.
235
- */const ev=ge("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
235
+ */const sv=ye("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
236
236
  * @license lucide-react v0.469.0 - ISC
237
237
  *
238
238
  * This source code is licensed under the ISC license.
239
239
  * See the LICENSE file in the root directory of this source tree.
240
- */const v1=ge("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
240
+ */const T1=ye("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
241
241
  * @license lucide-react v0.469.0 - ISC
242
242
  *
243
243
  * This source code is licensed under the ISC license.
244
244
  * See the LICENSE file in the root directory of this source tree.
245
- */const y1=ge("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
245
+ */const N1=ye("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
246
246
  * @license lucide-react v0.469.0 - ISC
247
247
  *
248
248
  * This source code is licensed under the ISC license.
249
249
  * See the LICENSE file in the root directory of this source tree.
250
- */const x1=ge("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
250
+ */const j1=ye("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
251
251
  * @license lucide-react v0.469.0 - ISC
252
252
  *
253
253
  * This source code is licensed under the ISC license.
254
254
  * See the LICENSE file in the root directory of this source tree.
255
- */const w1=ge("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
255
+ */const C1=ye("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
256
256
  * @license lucide-react v0.469.0 - ISC
257
257
  *
258
258
  * This source code is licensed under the ISC license.
259
259
  * See the LICENSE file in the root directory of this source tree.
260
- */const hn=ge("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
260
+ */const hn=ye("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
261
261
  * @license lucide-react v0.469.0 - ISC
262
262
  *
263
263
  * This source code is licensed under the ISC license.
264
264
  * See the LICENSE file in the root directory of this source tree.
265
- */const k1=ge("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
265
+ */const E1=ye("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
266
266
  * @license lucide-react v0.469.0 - ISC
267
267
  *
268
268
  * This source code is licensed under the ISC license.
269
269
  * See the LICENSE file in the root directory of this source tree.
270
- */const S1=ge("MessageSquarePlus",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);/**
270
+ */const _1=ye("MessageSquarePlus",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);/**
271
271
  * @license lucide-react v0.469.0 - ISC
272
272
  *
273
273
  * This source code is licensed under the ISC license.
274
274
  * See the LICENSE file in the root directory of this source tree.
275
- */const tv=ge("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
275
+ */const rv=ye("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
276
276
  * @license lucide-react v0.469.0 - ISC
277
277
  *
278
278
  * This source code is licensed under the ISC license.
279
279
  * See the LICENSE file in the root directory of this source tree.
280
- */const b1=ge("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
280
+ */const R1=ye("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
281
281
  * @license lucide-react v0.469.0 - ISC
282
282
  *
283
283
  * This source code is licensed under the ISC license.
284
284
  * See the LICENSE file in the root directory of this source tree.
285
- */const tm=ge("MonitorSmartphone",[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]]);/**
285
+ */const nm=ye("MonitorSmartphone",[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]]);/**
286
286
  * @license lucide-react v0.469.0 - ISC
287
287
  *
288
288
  * This source code is licensed under the ISC license.
289
289
  * See the LICENSE file in the root directory of this source tree.
290
- */const T1=ge("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
290
+ */const A1=ye("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
291
291
  * @license lucide-react v0.469.0 - ISC
292
292
  *
293
293
  * This source code is licensed under the ISC license.
294
294
  * See the LICENSE file in the root directory of this source tree.
295
- */const N1=ge("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
295
+ */const I1=ye("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
296
296
  * @license lucide-react v0.469.0 - ISC
297
297
  *
298
298
  * This source code is licensed under the ISC license.
299
299
  * See the LICENSE file in the root directory of this source tree.
300
- */const j1=ge("PanelRightOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);/**
300
+ */const M1=ye("PanelRightOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);/**
301
301
  * @license lucide-react v0.469.0 - ISC
302
302
  *
303
303
  * This source code is licensed under the ISC license.
304
304
  * See the LICENSE file in the root directory of this source tree.
305
- */const C1=ge("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
305
+ */const D1=ye("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
306
306
  * @license lucide-react v0.469.0 - ISC
307
307
  *
308
308
  * This source code is licensed under the ISC license.
309
309
  * See the LICENSE file in the root directory of this source tree.
310
- */const E1=ge("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
310
+ */const L1=ye("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
311
311
  * @license lucide-react v0.469.0 - ISC
312
312
  *
313
313
  * This source code is licensed under the ISC license.
314
314
  * See the LICENSE file in the root directory of this source tree.
315
- */const il=ge("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
315
+ */const ol=ye("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
316
316
  * @license lucide-react v0.469.0 - ISC
317
317
  *
318
318
  * This source code is licensed under the ISC license.
319
319
  * See the LICENSE file in the root directory of this source tree.
320
- */const _1=ge("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
320
+ */const O1=ye("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
321
321
  * @license lucide-react v0.469.0 - ISC
322
322
  *
323
323
  * This source code is licensed under the ISC license.
324
324
  * See the LICENSE file in the root directory of this source tree.
325
- */const R1=ge("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
325
+ */const P1=ye("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
326
326
  * @license lucide-react v0.469.0 - ISC
327
327
  *
328
328
  * This source code is licensed under the ISC license.
329
329
  * See the LICENSE file in the root directory of this source tree.
330
- */const dr=ge("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
330
+ */const dr=ye("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
331
331
  * @license lucide-react v0.469.0 - ISC
332
332
  *
333
333
  * This source code is licensed under the ISC license.
334
334
  * See the LICENSE file in the root directory of this source tree.
335
- */const nv=ge("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
335
+ */const iv=ye("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
336
336
  * @license lucide-react v0.469.0 - ISC
337
337
  *
338
338
  * This source code is licensed under the ISC license.
339
339
  * See the LICENSE file in the root directory of this source tree.
340
- */const A1=ge("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
340
+ */const $1=ye("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
341
341
  * @license lucide-react v0.469.0 - ISC
342
342
  *
343
343
  * This source code is licensed under the ISC license.
344
344
  * See the LICENSE file in the root directory of this source tree.
345
- */const I1=ge("Rewind",[["polygon",{points:"11 19 2 12 11 5 11 19",key:"14yba5"}],["polygon",{points:"22 19 13 12 22 5 22 19",key:"1pi1cj"}]]);/**
345
+ */const z1=ye("Rewind",[["polygon",{points:"11 19 2 12 11 5 11 19",key:"14yba5"}],["polygon",{points:"22 19 13 12 22 5 22 19",key:"1pi1cj"}]]);/**
346
346
  * @license lucide-react v0.469.0 - ISC
347
347
  *
348
348
  * This source code is licensed under the ISC license.
349
349
  * See the LICENSE file in the root directory of this source tree.
350
- */const _o=ge("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
350
+ */const _o=ye("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
351
351
  * @license lucide-react v0.469.0 - ISC
352
352
  *
353
353
  * This source code is licensed under the ISC license.
354
354
  * See the LICENSE file in the root directory of this source tree.
355
- */const sv=ge("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
355
+ */const ov=ye("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
356
356
  * @license lucide-react v0.469.0 - ISC
357
357
  *
358
358
  * This source code is licensed under the ISC license.
359
359
  * See the LICENSE file in the root directory of this source tree.
360
- */const rv=ge("SatelliteDish",[["path",{d:"M4 10a7.31 7.31 0 0 0 10 10Z",key:"1fzpp3"}],["path",{d:"m9 15 3-3",key:"88sc13"}],["path",{d:"M17 13a6 6 0 0 0-6-6",key:"15cc6u"}],["path",{d:"M21 13A10 10 0 0 0 11 3",key:"11nf8s"}]]);/**
360
+ */const av=ye("SatelliteDish",[["path",{d:"M4 10a7.31 7.31 0 0 0 10 10Z",key:"1fzpp3"}],["path",{d:"m9 15 3-3",key:"88sc13"}],["path",{d:"M17 13a6 6 0 0 0-6-6",key:"15cc6u"}],["path",{d:"M21 13A10 10 0 0 0 11 3",key:"11nf8s"}]]);/**
361
361
  * @license lucide-react v0.469.0 - ISC
362
362
  *
363
363
  * This source code is licensed under the ISC license.
364
364
  * See the LICENSE file in the root directory of this source tree.
365
- */const M1=ge("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
365
+ */const F1=ye("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
366
366
  * @license lucide-react v0.469.0 - ISC
367
367
  *
368
368
  * This source code is licensed under the ISC license.
369
369
  * See the LICENSE file in the root directory of this source tree.
370
- */const Lo=ge("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
370
+ */const Lo=ye("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
371
371
  * @license lucide-react v0.469.0 - ISC
372
372
  *
373
373
  * This source code is licensed under the ISC license.
374
374
  * See the LICENSE file in the root directory of this source tree.
375
- */const D1=ge("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
375
+ */const U1=ye("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
376
376
  * @license lucide-react v0.469.0 - ISC
377
377
  *
378
378
  * This source code is licensed under the ISC license.
379
379
  * See the LICENSE file in the root directory of this source tree.
380
- */const iv=ge("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/**
380
+ */const lv=ye("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/**
381
381
  * @license lucide-react v0.469.0 - ISC
382
382
  *
383
383
  * This source code is licensed under the ISC license.
384
384
  * See the LICENSE file in the root directory of this source tree.
385
- */const Fr=ge("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
385
+ */const Fr=ye("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
386
386
  * @license lucide-react v0.469.0 - ISC
387
387
  *
388
388
  * This source code is licensed under the ISC license.
389
389
  * See the LICENSE file in the root directory of this source tree.
390
- */const vl=ge("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
390
+ */const xl=ye("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
391
391
  * @license lucide-react v0.469.0 - ISC
392
392
  *
393
393
  * This source code is licensed under the ISC license.
394
394
  * See the LICENSE file in the root directory of this source tree.
395
- */const ov=ge("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
395
+ */const cv=ye("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
396
396
  * @license lucide-react v0.469.0 - ISC
397
397
  *
398
398
  * This source code is licensed under the ISC license.
399
399
  * See the LICENSE file in the root directory of this source tree.
400
- */const us=ge("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
400
+ */const us=ye("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
401
401
  * @license lucide-react v0.469.0 - ISC
402
402
  *
403
403
  * This source code is licensed under the ISC license.
404
404
  * See the LICENSE file in the root directory of this source tree.
405
- */const av=ge("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
405
+ */const uv=ye("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
406
406
  * @license lucide-react v0.469.0 - ISC
407
407
  *
408
408
  * This source code is licensed under the ISC license.
409
409
  * See the LICENSE file in the root directory of this source tree.
410
- */const L1=ge("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
410
+ */const B1=ye("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
411
411
  * @license lucide-react v0.469.0 - ISC
412
412
  *
413
413
  * This source code is licensed under the ISC license.
414
414
  * See the LICENSE file in the root directory of this source tree.
415
- */const O1=ge("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
415
+ */const W1=ye("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
416
416
  * @license lucide-react v0.469.0 - ISC
417
417
  *
418
418
  * This source code is licensed under the ISC license.
419
419
  * See the LICENSE file in the root directory of this source tree.
420
- */const P1=ge("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
420
+ */const H1=ye("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
421
421
  * @license lucide-react v0.469.0 - ISC
422
422
  *
423
423
  * This source code is licensed under the ISC license.
424
424
  * See the LICENSE file in the root directory of this source tree.
425
- */const lv=ge("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
425
+ */const dv=ye("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
426
426
  * @license lucide-react v0.469.0 - ISC
427
427
  *
428
428
  * This source code is licensed under the ISC license.
429
429
  * See the LICENSE file in the root directory of this source tree.
430
- */const $1=ge("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
430
+ */const V1=ye("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
431
431
  * @license lucide-react v0.469.0 - ISC
432
432
  *
433
433
  * This source code is licensed under the ISC license.
434
434
  * See the LICENSE file in the root directory of this source tree.
435
- */const Tn=ge("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
435
+ */const Tn=ye("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
436
436
  * @license lucide-react v0.469.0 - ISC
437
437
  *
438
438
  * This source code is licensed under the ISC license.
439
439
  * See the LICENSE file in the root directory of this source tree.
440
- */const z1=ge("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),F1=new Set(["path","circle","rect","line","ellipse","polyline","polygon"]),U1=new Set("d cx cy r rx ry x y width height x1 x2 y1 y2 points fill".split(" "));function B1(t){return t.filter(([s])=>F1.has(s)).map(([s,r],o)=>[s,{...Object.fromEntries(Object.entries(r).filter(([l])=>U1.has(l))),key:String(o)}])}function ji({iconNode:t,size:s=14,className:r}){const o=x.useMemo(()=>t?B1(t):[],[t]);return o.length===0?a.jsx(ev,{size:s,className:r,"aria-hidden":"true","data-testid":"app-icon-default"}):a.jsx(Kg,{iconNode:o,size:s,className:r,"aria-hidden":"true","data-testid":"app-icon"})}var go=xg();function W1(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];return x.useMemo(()=>o=>{s.forEach(l=>l(o))},s)}const Ol=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ci(t){const s=Object.prototype.toString.call(t);return s==="[object Window]"||s==="[object global]"}function Rd(t){return"nodeType"in t}function Nn(t){var s,r;return t?Ci(t)?t:Rd(t)&&(s=(r=t.ownerDocument)==null?void 0:r.defaultView)!=null?s:window:window}function Ad(t){const{Document:s}=Nn(t);return t instanceof s}function Oo(t){return Ci(t)?!1:t instanceof Nn(t).HTMLElement}function cv(t){return t instanceof Nn(t).SVGElement}function Ei(t){return t?Ci(t)?t.document:Rd(t)?Ad(t)?t:Oo(t)||cv(t)?t.ownerDocument:document:document:document}const ds=Ol?x.useLayoutEffect:x.useEffect;function Pl(t){const s=x.useRef(t);return ds(()=>{s.current=t}),x.useCallback(function(){for(var r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];return s.current==null?void 0:s.current(...o)},[])}function H1(){const t=x.useRef(null),s=x.useCallback((o,l)=>{t.current=setInterval(o,l)},[]),r=x.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[s,r]}function Ro(t,s){s===void 0&&(s=[t]);const r=x.useRef(t);return ds(()=>{r.current!==t&&(r.current=t)},s),r}function Po(t,s){const r=x.useRef();return x.useMemo(()=>{const o=t(r.current);return r.current=o,o},[...s])}function yl(t){const s=Pl(t),r=x.useRef(null),o=x.useCallback(l=>{l!==r.current&&(s==null||s(l,r.current)),r.current=l},[]);return[r,o]}function xl(t){const s=x.useRef();return x.useEffect(()=>{s.current=t},[t]),s.current}let Lu={};function $o(t,s){return x.useMemo(()=>{if(s)return s;const r=Lu[t]==null?0:Lu[t]+1;return Lu[t]=r,t+"-"+r},[t,s])}function uv(t){return function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),l=1;l<r;l++)o[l-1]=arguments[l];return o.reduce((u,d)=>{const p=Object.entries(d);for(const[g,m]of p){const v=u[g];v!=null&&(u[g]=v+t*m)}return u},{...s})}}const bi=uv(1),wl=uv(-1);function V1(t){return"clientX"in t&&"clientY"in t}function $l(t){if(!t)return!1;const{KeyboardEvent:s}=Nn(t.target);return s&&t instanceof s}function G1(t){if(!t)return!1;const{TouchEvent:s}=Nn(t.target);return s&&t instanceof s}function kl(t){if(G1(t)){if(t.touches&&t.touches.length){const{clientX:s,clientY:r}=t.touches[0];return{x:s,y:r}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:s,clientY:r}=t.changedTouches[0];return{x:s,y:r}}}return V1(t)?{x:t.clientX,y:t.clientY}:null}const js=Object.freeze({Translate:{toString(t){if(!t)return;const{x:s,y:r}=t;return"translate3d("+(s?Math.round(s):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:s,scaleY:r}=t;return"scaleX("+s+") scaleY("+r+")"}},Transform:{toString(t){if(t)return[js.Translate.toString(t),js.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:s,duration:r,easing:o}=t;return s+" "+r+"ms "+o}}}),nm="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function K1(t){return t.matches(nm)?t:t.querySelector(nm)}const q1={display:"none"};function Y1(t){let{id:s,value:r}=t;return ot.createElement("div",{id:s,style:q1},r)}function X1(t){let{id:s,announcement:r,ariaLiveType:o="assertive"}=t;const l={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ot.createElement("div",{id:s,style:l,role:"status","aria-live":o,"aria-atomic":!0},r)}function Q1(){const[t,s]=x.useState("");return{announce:x.useCallback(o=>{o!=null&&s(o)},[]),announcement:t}}const dv=x.createContext(null);function Z1(t){const s=x.useContext(dv);x.useEffect(()=>{if(!s)throw new Error("useDndMonitor must be used within a children of <DndContext>");return s(t)},[t,s])}function J1(){const[t]=x.useState(()=>new Set),s=x.useCallback(o=>(t.add(o),()=>t.delete(o)),[t]);return[x.useCallback(o=>{let{type:l,event:u}=o;t.forEach(d=>{var p;return(p=d[l])==null?void 0:p.call(d,u)})},[t]),s]}const ek={draggable:`
440
+ */const G1=ye("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),K1=new Set(["path","circle","rect","line","ellipse","polyline","polygon"]),q1=new Set("d cx cy r rx ry x y width height x1 x2 y1 y2 points fill".split(" "));function Y1(t){return t.filter(([s])=>K1.has(s)).map(([s,r],o)=>[s,{...Object.fromEntries(Object.entries(r).filter(([l])=>q1.has(l))),key:String(o)}])}function ji({iconNode:t,size:s=14,className:r}){const o=x.useMemo(()=>t?Y1(t):[],[t]);return o.length===0?a.jsx(sv,{size:s,className:r,"aria-hidden":"true","data-testid":"app-icon-default"}):a.jsx(Xg,{iconNode:o,size:s,className:r,"aria-hidden":"true","data-testid":"app-icon"})}var go=wg();function X1(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];return x.useMemo(()=>o=>{s.forEach(l=>l(o))},s)}const zl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ci(t){const s=Object.prototype.toString.call(t);return s==="[object Window]"||s==="[object global]"}function Ad(t){return"nodeType"in t}function Nn(t){var s,r;return t?Ci(t)?t:Ad(t)&&(s=(r=t.ownerDocument)==null?void 0:r.defaultView)!=null?s:window:window}function Id(t){const{Document:s}=Nn(t);return t instanceof s}function Oo(t){return Ci(t)?!1:t instanceof Nn(t).HTMLElement}function fv(t){return t instanceof Nn(t).SVGElement}function Ei(t){return t?Ci(t)?t.document:Ad(t)?Id(t)?t:Oo(t)||fv(t)?t.ownerDocument:document:document:document}const fs=zl?x.useLayoutEffect:x.useEffect;function Fl(t){const s=x.useRef(t);return fs(()=>{s.current=t}),x.useCallback(function(){for(var r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];return s.current==null?void 0:s.current(...o)},[])}function Q1(){const t=x.useRef(null),s=x.useCallback((o,l)=>{t.current=setInterval(o,l)},[]),r=x.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[s,r]}function Ro(t,s){s===void 0&&(s=[t]);const r=x.useRef(t);return fs(()=>{r.current!==t&&(r.current=t)},s),r}function Po(t,s){const r=x.useRef();return x.useMemo(()=>{const o=t(r.current);return r.current=o,o},[...s])}function wl(t){const s=Fl(t),r=x.useRef(null),o=x.useCallback(l=>{l!==r.current&&(s==null||s(l,r.current)),r.current=l},[]);return[r,o]}function kl(t){const s=x.useRef();return x.useEffect(()=>{s.current=t},[t]),s.current}let Pu={};function $o(t,s){return x.useMemo(()=>{if(s)return s;const r=Pu[t]==null?0:Pu[t]+1;return Pu[t]=r,t+"-"+r},[t,s])}function pv(t){return function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),l=1;l<r;l++)o[l-1]=arguments[l];return o.reduce((u,d)=>{const p=Object.entries(d);for(const[g,m]of p){const v=u[g];v!=null&&(u[g]=v+t*m)}return u},{...s})}}const bi=pv(1),Sl=pv(-1);function Z1(t){return"clientX"in t&&"clientY"in t}function Ul(t){if(!t)return!1;const{KeyboardEvent:s}=Nn(t.target);return s&&t instanceof s}function J1(t){if(!t)return!1;const{TouchEvent:s}=Nn(t.target);return s&&t instanceof s}function bl(t){if(J1(t)){if(t.touches&&t.touches.length){const{clientX:s,clientY:r}=t.touches[0];return{x:s,y:r}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:s,clientY:r}=t.changedTouches[0];return{x:s,y:r}}}return Z1(t)?{x:t.clientX,y:t.clientY}:null}const js=Object.freeze({Translate:{toString(t){if(!t)return;const{x:s,y:r}=t;return"translate3d("+(s?Math.round(s):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:s,scaleY:r}=t;return"scaleX("+s+") scaleY("+r+")"}},Transform:{toString(t){if(t)return[js.Translate.toString(t),js.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:s,duration:r,easing:o}=t;return s+" "+r+"ms "+o}}}),sm="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ek(t){return t.matches(sm)?t:t.querySelector(sm)}const tk={display:"none"};function nk(t){let{id:s,value:r}=t;return lt.createElement("div",{id:s,style:tk},r)}function sk(t){let{id:s,announcement:r,ariaLiveType:o="assertive"}=t;const l={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return lt.createElement("div",{id:s,style:l,role:"status","aria-live":o,"aria-atomic":!0},r)}function rk(){const[t,s]=x.useState("");return{announce:x.useCallback(o=>{o!=null&&s(o)},[]),announcement:t}}const hv=x.createContext(null);function ik(t){const s=x.useContext(hv);x.useEffect(()=>{if(!s)throw new Error("useDndMonitor must be used within a children of <DndContext>");return s(t)},[t,s])}function ok(){const[t]=x.useState(()=>new Set),s=x.useCallback(o=>(t.add(o),()=>t.delete(o)),[t]);return[x.useCallback(o=>{let{type:l,event:u}=o;t.forEach(d=>{var p;return(p=d[l])==null?void 0:p.call(d,u)})},[t]),s]}const ak={draggable:`
441
441
  To pick up a draggable item, press the space bar.
442
442
  While dragging, use the arrow keys to move the item.
443
443
  Press space again to drop the item in its new position, or press escape to cancel.
444
- `},tk={onDragStart(t){let{active:s}=t;return"Picked up draggable item "+s.id+"."},onDragOver(t){let{active:s,over:r}=t;return r?"Draggable item "+s.id+" was moved over droppable area "+r.id+".":"Draggable item "+s.id+" is no longer over a droppable area."},onDragEnd(t){let{active:s,over:r}=t;return r?"Draggable item "+s.id+" was dropped over droppable area "+r.id:"Draggable item "+s.id+" was dropped."},onDragCancel(t){let{active:s}=t;return"Dragging was cancelled. Draggable item "+s.id+" was dropped."}};function nk(t){let{announcements:s=tk,container:r,hiddenTextDescribedById:o,screenReaderInstructions:l=ek}=t;const{announce:u,announcement:d}=Q1(),p=$o("DndLiveRegion"),[g,m]=x.useState(!1);if(x.useEffect(()=>{m(!0)},[]),Z1(x.useMemo(()=>({onDragStart(k){let{active:y}=k;u(s.onDragStart({active:y}))},onDragMove(k){let{active:y,over:S}=k;s.onDragMove&&u(s.onDragMove({active:y,over:S}))},onDragOver(k){let{active:y,over:S}=k;u(s.onDragOver({active:y,over:S}))},onDragEnd(k){let{active:y,over:S}=k;u(s.onDragEnd({active:y,over:S}))},onDragCancel(k){let{active:y,over:S}=k;u(s.onDragCancel({active:y,over:S}))}}),[u,s])),!g)return null;const v=ot.createElement(ot.Fragment,null,ot.createElement(Y1,{id:o,value:l.draggable}),ot.createElement(X1,{id:p,announcement:d}));return r?go.createPortal(v,r):v}var Bt;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Bt||(Bt={}));function Sl(){}function fv(t,s){return x.useMemo(()=>({sensor:t,options:s??{}}),[t,s])}function pv(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];return x.useMemo(()=>[...s].filter(o=>o!=null),[...s])}const fs=Object.freeze({x:0,y:0});function sk(t,s){return Math.sqrt(Math.pow(t.x-s.x,2)+Math.pow(t.y-s.y,2))}function rk(t,s){const r=kl(t);if(!r)return"0 0";const o={x:(r.x-s.left)/s.width*100,y:(r.y-s.top)/s.height*100};return o.x+"% "+o.y+"%"}function ik(t,s){let{data:{value:r}}=t,{data:{value:o}}=s;return r-o}function ok(t,s){let{data:{value:r}}=t,{data:{value:o}}=s;return o-r}function ak(t,s){if(!t||t.length===0)return null;const[r]=t;return r[s]}function sm(t,s,r){return s===void 0&&(s=t.left),r===void 0&&(r=t.top),{x:s+t.width*.5,y:r+t.height*.5}}const hv=t=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=t;const l=sm(s,s.left,s.top),u=[];for(const d of o){const{id:p}=d,g=r.get(p);if(g){const m=sk(sm(g),l);u.push({id:p,data:{droppableContainer:d,value:m}})}}return u.sort(ik)};function lk(t,s){const r=Math.max(s.top,t.top),o=Math.max(s.left,t.left),l=Math.min(s.left+s.width,t.left+t.width),u=Math.min(s.top+s.height,t.top+t.height),d=l-o,p=u-r;if(o<l&&r<u){const g=s.width*s.height,m=t.width*t.height,v=d*p,k=v/(g+m-v);return Number(k.toFixed(4))}return 0}const ck=t=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=t;const l=[];for(const u of o){const{id:d}=u,p=r.get(d);if(p){const g=lk(p,s);g>0&&l.push({id:d,data:{droppableContainer:u,value:g}})}}return l.sort(ok)};function uk(t,s,r){return{...t,scaleX:s&&r?s.width/r.width:1,scaleY:s&&r?s.height/r.height:1}}function mv(t,s){return t&&s?{x:t.left-s.left,y:t.top-s.top}:fs}function dk(t){return function(r){for(var o=arguments.length,l=new Array(o>1?o-1:0),u=1;u<o;u++)l[u-1]=arguments[u];return l.reduce((d,p)=>({...d,top:d.top+t*p.y,bottom:d.bottom+t*p.y,left:d.left+t*p.x,right:d.right+t*p.x}),{...r})}}const fk=dk(1);function gv(t){if(t.startsWith("matrix3d(")){const s=t.slice(9,-1).split(/, /);return{x:+s[12],y:+s[13],scaleX:+s[0],scaleY:+s[5]}}else if(t.startsWith("matrix(")){const s=t.slice(7,-1).split(/, /);return{x:+s[4],y:+s[5],scaleX:+s[0],scaleY:+s[3]}}return null}function pk(t,s,r){const o=gv(s);if(!o)return t;const{scaleX:l,scaleY:u,x:d,y:p}=o,g=t.left-d-(1-l)*parseFloat(r),m=t.top-p-(1-u)*parseFloat(r.slice(r.indexOf(" ")+1)),v=l?t.width/l:t.width,k=u?t.height/u:t.height;return{width:v,height:k,top:m,right:g+v,bottom:m+k,left:g}}const hk={ignoreTransform:!1};function _i(t,s){s===void 0&&(s=hk);let r=t.getBoundingClientRect();if(s.ignoreTransform){const{transform:m,transformOrigin:v}=Nn(t).getComputedStyle(t);m&&(r=pk(r,m,v))}const{top:o,left:l,width:u,height:d,bottom:p,right:g}=r;return{top:o,left:l,width:u,height:d,bottom:p,right:g}}function rm(t){return _i(t,{ignoreTransform:!0})}function mk(t){const s=t.innerWidth,r=t.innerHeight;return{top:0,left:0,right:s,bottom:r,width:s,height:r}}function gk(t,s){return s===void 0&&(s=Nn(t).getComputedStyle(t)),s.position==="fixed"}function vk(t,s){s===void 0&&(s=Nn(t).getComputedStyle(t));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(l=>{const u=s[l];return typeof u=="string"?r.test(u):!1})}function Id(t,s){const r=[];function o(l){if(s!=null&&r.length>=s||!l)return r;if(Ad(l)&&l.scrollingElement!=null&&!r.includes(l.scrollingElement))return r.push(l.scrollingElement),r;if(!Oo(l)||cv(l)||r.includes(l))return r;const u=Nn(t).getComputedStyle(l);return l!==t&&vk(l,u)&&r.push(l),gk(l,u)?r:o(l.parentNode)}return t?o(t):r}function vv(t){const[s]=Id(t,1);return s??null}function Ou(t){return!Ol||!t?null:Ci(t)?t:Rd(t)?Ad(t)||t===Ei(t).scrollingElement?window:Oo(t)?t:null:null}function yv(t){return Ci(t)?t.scrollX:t.scrollLeft}function xv(t){return Ci(t)?t.scrollY:t.scrollTop}function Zu(t){return{x:yv(t),y:xv(t)}}var Jt;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Jt||(Jt={}));function wv(t){return!Ol||!t?!1:t===document.scrollingElement}function kv(t){const s={x:0,y:0},r=wv(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},o={x:t.scrollWidth-r.width,y:t.scrollHeight-r.height},l=t.scrollTop<=s.y,u=t.scrollLeft<=s.x,d=t.scrollTop>=o.y,p=t.scrollLeft>=o.x;return{isTop:l,isLeft:u,isBottom:d,isRight:p,maxScroll:o,minScroll:s}}const yk={x:.2,y:.2};function xk(t,s,r,o,l){let{top:u,left:d,right:p,bottom:g}=r;o===void 0&&(o=10),l===void 0&&(l=yk);const{isTop:m,isBottom:v,isLeft:k,isRight:y}=kv(t),S={x:0,y:0},T={x:0,y:0},_={height:s.height*l.y,width:s.width*l.x};return!m&&u<=s.top+_.height?(S.y=Jt.Backward,T.y=o*Math.abs((s.top+_.height-u)/_.height)):!v&&g>=s.bottom-_.height&&(S.y=Jt.Forward,T.y=o*Math.abs((s.bottom-_.height-g)/_.height)),!y&&p>=s.right-_.width?(S.x=Jt.Forward,T.x=o*Math.abs((s.right-_.width-p)/_.width)):!k&&d<=s.left+_.width&&(S.x=Jt.Backward,T.x=o*Math.abs((s.left+_.width-d)/_.width)),{direction:S,speed:T}}function wk(t){if(t===document.scrollingElement){const{innerWidth:u,innerHeight:d}=window;return{top:0,left:0,right:u,bottom:d,width:u,height:d}}const{top:s,left:r,right:o,bottom:l}=t.getBoundingClientRect();return{top:s,left:r,right:o,bottom:l,width:t.clientWidth,height:t.clientHeight}}function Sv(t){return t.reduce((s,r)=>bi(s,Zu(r)),fs)}function kk(t){return t.reduce((s,r)=>s+yv(r),0)}function Sk(t){return t.reduce((s,r)=>s+xv(r),0)}function bv(t,s){if(s===void 0&&(s=_i),!t)return;const{top:r,left:o,bottom:l,right:u}=s(t);vv(t)&&(l<=0||u<=0||r>=window.innerHeight||o>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const bk=[["x",["left","right"],kk],["y",["top","bottom"],Sk]];class Md{constructor(s,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=Id(r),l=Sv(o);this.rect={...s},this.width=s.width,this.height=s.height;for(const[u,d,p]of bk)for(const g of d)Object.defineProperty(this,g,{get:()=>{const m=p(o),v=l[u]-m;return this.rect[g]+v},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class xo{constructor(s){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...r)})},this.target=s}add(s,r,o){var l;(l=this.target)==null||l.addEventListener(s,r,o),this.listeners.push([s,r,o])}}function Tk(t){const{EventTarget:s}=Nn(t);return t instanceof s?t:Ei(t)}function Pu(t,s){const r=Math.abs(t.x),o=Math.abs(t.y);return typeof s=="number"?Math.sqrt(r**2+o**2)>s:"x"in s&&"y"in s?r>s.x&&o>s.y:"x"in s?r>s.x:"y"in s?o>s.y:!1}var es;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(es||(es={}));function im(t){t.preventDefault()}function Nk(t){t.stopPropagation()}var et;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(et||(et={}));const Tv={start:[et.Space,et.Enter],cancel:[et.Esc],end:[et.Space,et.Enter,et.Tab]},jk=(t,s)=>{let{currentCoordinates:r}=s;switch(t.code){case et.Right:return{...r,x:r.x+25};case et.Left:return{...r,x:r.x-25};case et.Down:return{...r,y:r.y+25};case et.Up:return{...r,y:r.y-25}}};class Nv{constructor(s){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=s;const{event:{target:r}}=s;this.props=s,this.listeners=new xo(Ei(r)),this.windowListeners=new xo(Nn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(es.Resize,this.handleCancel),this.windowListeners.add(es.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(es.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:s,onStart:r}=this.props,o=s.node.current;o&&bv(o),r(fs)}handleKeyDown(s){if($l(s)){const{active:r,context:o,options:l}=this.props,{keyboardCodes:u=Tv,coordinateGetter:d=jk,scrollBehavior:p="smooth"}=l,{code:g}=s;if(u.end.includes(g)){this.handleEnd(s);return}if(u.cancel.includes(g)){this.handleCancel(s);return}const{collisionRect:m}=o.current,v=m?{x:m.left,y:m.top}:fs;this.referenceCoordinates||(this.referenceCoordinates=v);const k=d(s,{active:r,context:o.current,currentCoordinates:v});if(k){const y=wl(k,v),S={x:0,y:0},{scrollableAncestors:T}=o.current;for(const _ of T){const N=s.code,{isTop:C,isRight:R,isLeft:H,isBottom:M,maxScroll:D,minScroll:K}=kv(_),G=wk(_),$={x:Math.min(N===et.Right?G.right-G.width/2:G.right,Math.max(N===et.Right?G.left:G.left+G.width/2,k.x)),y:Math.min(N===et.Down?G.bottom-G.height/2:G.bottom,Math.max(N===et.Down?G.top:G.top+G.height/2,k.y))},te=N===et.Right&&!R||N===et.Left&&!H,he=N===et.Down&&!M||N===et.Up&&!C;if(te&&$.x!==k.x){const ue=_.scrollLeft+y.x,Se=N===et.Right&&ue<=D.x||N===et.Left&&ue>=K.x;if(Se&&!y.y){_.scrollTo({left:ue,behavior:p});return}Se?S.x=_.scrollLeft-ue:S.x=N===et.Right?_.scrollLeft-D.x:_.scrollLeft-K.x,S.x&&_.scrollBy({left:-S.x,behavior:p});break}else if(he&&$.y!==k.y){const ue=_.scrollTop+y.y,Se=N===et.Down&&ue<=D.y||N===et.Up&&ue>=K.y;if(Se&&!y.x){_.scrollTo({top:ue,behavior:p});return}Se?S.y=_.scrollTop-ue:S.y=N===et.Down?_.scrollTop-D.y:_.scrollTop-K.y,S.y&&_.scrollBy({top:-S.y,behavior:p});break}}this.handleMove(s,bi(wl(k,this.referenceCoordinates),S))}}}handleMove(s,r){const{onMove:o}=this.props;s.preventDefault(),o(r)}handleEnd(s){const{onEnd:r}=this.props;s.preventDefault(),this.detach(),r()}handleCancel(s){const{onCancel:r}=this.props;s.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Nv.activators=[{eventName:"onKeyDown",handler:(t,s,r)=>{let{keyboardCodes:o=Tv,onActivation:l}=s,{active:u}=r;const{code:d}=t.nativeEvent;if(o.start.includes(d)){const p=u.activatorNode.current;return p&&t.target!==p?!1:(t.preventDefault(),l==null||l({event:t.nativeEvent}),!0)}return!1}}];function om(t){return!!(t&&"distance"in t)}function am(t){return!!(t&&"delay"in t)}class Dd{constructor(s,r,o){var l;o===void 0&&(o=Tk(s.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=s,this.events=r;const{event:u}=s,{target:d}=u;this.props=s,this.events=r,this.document=Ei(d),this.documentListeners=new xo(this.document),this.listeners=new xo(o),this.windowListeners=new xo(Nn(d)),this.initialCoordinates=(l=kl(u))!=null?l:fs,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:s,props:{options:{activationConstraint:r,bypassActivationConstraint:o}}}=this;if(this.listeners.add(s.move.name,this.handleMove,{passive:!1}),this.listeners.add(s.end.name,this.handleEnd),s.cancel&&this.listeners.add(s.cancel.name,this.handleCancel),this.windowListeners.add(es.Resize,this.handleCancel),this.windowListeners.add(es.DragStart,im),this.windowListeners.add(es.VisibilityChange,this.handleCancel),this.windowListeners.add(es.ContextMenu,im),this.documentListeners.add(es.Keydown,this.handleKeydown),r){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(am(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(om(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(s,r){const{active:o,onPending:l}=this.props;l(o,s,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:s}=this,{onStart:r}=this.props;s&&(this.activated=!0,this.documentListeners.add(es.Click,Nk,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(es.SelectionChange,this.removeTextSelection),r(s))}handleMove(s){var r;const{activated:o,initialCoordinates:l,props:u}=this,{onMove:d,options:{activationConstraint:p}}=u;if(!l)return;const g=(r=kl(s))!=null?r:fs,m=wl(l,g);if(!o&&p){if(om(p)){if(p.tolerance!=null&&Pu(m,p.tolerance))return this.handleCancel();if(Pu(m,p.distance))return this.handleStart()}if(am(p)&&Pu(m,p.tolerance))return this.handleCancel();this.handlePending(p,m);return}s.cancelable&&s.preventDefault(),d(g)}handleEnd(){const{onAbort:s,onEnd:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleCancel(){const{onAbort:s,onCancel:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleKeydown(s){s.code===et.Esc&&this.handleCancel()}removeTextSelection(){var s;(s=this.document.getSelection())==null||s.removeAllRanges()}}const Ck={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class zl extends Dd{constructor(s){const{event:r}=s,o=Ei(r.target);super(s,Ck,o)}}zl.activators=[{eventName:"onPointerDown",handler:(t,s)=>{let{nativeEvent:r}=t,{onActivation:o}=s;return!r.isPrimary||r.button!==0?!1:(o==null||o({event:r}),!0)}}];const Ek={move:{name:"mousemove"},end:{name:"mouseup"}};var Ju;(function(t){t[t.RightClick=2]="RightClick"})(Ju||(Ju={}));class _k extends Dd{constructor(s){super(s,Ek,Ei(s.event.target))}}_k.activators=[{eventName:"onMouseDown",handler:(t,s)=>{let{nativeEvent:r}=t,{onActivation:o}=s;return r.button===Ju.RightClick?!1:(o==null||o({event:r}),!0)}}];const $u={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Rk extends Dd{constructor(s){super(s,$u)}static setup(){return window.addEventListener($u.move.name,s,{capture:!1,passive:!1}),function(){window.removeEventListener($u.move.name,s)};function s(){}}}Rk.activators=[{eventName:"onTouchStart",handler:(t,s)=>{let{nativeEvent:r}=t,{onActivation:o}=s;const{touches:l}=r;return l.length>1?!1:(o==null||o({event:r}),!0)}}];var wo;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(wo||(wo={}));var bl;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(bl||(bl={}));function Ak(t){let{acceleration:s,activator:r=wo.Pointer,canScroll:o,draggingRect:l,enabled:u,interval:d=5,order:p=bl.TreeOrder,pointerCoordinates:g,scrollableAncestors:m,scrollableAncestorRects:v,delta:k,threshold:y}=t;const S=Mk({delta:k,disabled:!u}),[T,_]=H1(),N=x.useRef({x:0,y:0}),C=x.useRef({x:0,y:0}),R=x.useMemo(()=>{switch(r){case wo.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case wo.DraggableRect:return l}},[r,l,g]),H=x.useRef(null),M=x.useCallback(()=>{const K=H.current;if(!K)return;const G=N.current.x*C.current.x,$=N.current.y*C.current.y;K.scrollBy(G,$)},[]),D=x.useMemo(()=>p===bl.TreeOrder?[...m].reverse():m,[p,m]);x.useEffect(()=>{if(!u||!m.length||!R){_();return}for(const K of D){if((o==null?void 0:o(K))===!1)continue;const G=m.indexOf(K),$=v[G];if(!$)continue;const{direction:te,speed:he}=xk(K,$,R,s,y);for(const ue of["x","y"])S[ue][te[ue]]||(he[ue]=0,te[ue]=0);if(he.x>0||he.y>0){_(),H.current=K,T(M,d),N.current=he,C.current=te;return}}N.current={x:0,y:0},C.current={x:0,y:0},_()},[s,M,o,_,u,d,JSON.stringify(R),JSON.stringify(S),T,m,D,v,JSON.stringify(y)])}const Ik={x:{[Jt.Backward]:!1,[Jt.Forward]:!1},y:{[Jt.Backward]:!1,[Jt.Forward]:!1}};function Mk(t){let{delta:s,disabled:r}=t;const o=xl(s);return Po(l=>{if(r||!o||!l)return Ik;const u={x:Math.sign(s.x-o.x),y:Math.sign(s.y-o.y)};return{x:{[Jt.Backward]:l.x[Jt.Backward]||u.x===-1,[Jt.Forward]:l.x[Jt.Forward]||u.x===1},y:{[Jt.Backward]:l.y[Jt.Backward]||u.y===-1,[Jt.Forward]:l.y[Jt.Forward]||u.y===1}}},[r,s,o])}function Dk(t,s){const r=s!=null?t.get(s):void 0,o=r?r.node.current:null;return Po(l=>{var u;return s==null?null:(u=o??l)!=null?u:null},[o,s])}function Lk(t,s){return x.useMemo(()=>t.reduce((r,o)=>{const{sensor:l}=o,u=l.activators.map(d=>({eventName:d.eventName,handler:s(d.handler,o)}));return[...r,...u]},[]),[t,s])}var Ao;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Ao||(Ao={}));var ed;(function(t){t.Optimized="optimized"})(ed||(ed={}));const lm=new Map;function Ok(t,s){let{dragging:r,dependencies:o,config:l}=s;const[u,d]=x.useState(null),{frequency:p,measure:g,strategy:m}=l,v=x.useRef(t),k=N(),y=Ro(k),S=x.useCallback(function(C){C===void 0&&(C=[]),!y.current&&d(R=>R===null?C:R.concat(C.filter(H=>!R.includes(H))))},[y]),T=x.useRef(null),_=Po(C=>{if(k&&!r)return lm;if(!C||C===lm||v.current!==t||u!=null){const R=new Map;for(let H of t){if(!H)continue;if(u&&u.length>0&&!u.includes(H.id)&&H.rect.current){R.set(H.id,H.rect.current);continue}const M=H.node.current,D=M?new Md(g(M),M):null;H.rect.current=D,D&&R.set(H.id,D)}return R}return C},[t,u,r,k,g]);return x.useEffect(()=>{v.current=t},[t]),x.useEffect(()=>{k||S()},[r,k]),x.useEffect(()=>{u&&u.length>0&&d(null)},[JSON.stringify(u)]),x.useEffect(()=>{k||typeof p!="number"||T.current!==null||(T.current=setTimeout(()=>{S(),T.current=null},p))},[p,k,S,...o]),{droppableRects:_,measureDroppableContainers:S,measuringScheduled:u!=null};function N(){switch(m){case Ao.Always:return!1;case Ao.BeforeDragging:return r;default:return!r}}}function Ld(t,s){return Po(r=>t?r||(typeof s=="function"?s(t):t):null,[s,t])}function Pk(t,s){return Ld(t,s)}function $k(t){let{callback:s,disabled:r}=t;const o=Pl(s),l=x.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,r]);return x.useEffect(()=>()=>l==null?void 0:l.disconnect(),[l]),l}function Fl(t){let{callback:s,disabled:r}=t;const o=Pl(s),l=x.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[r]);return x.useEffect(()=>()=>l==null?void 0:l.disconnect(),[l]),l}function zk(t){return new Md(_i(t),t)}function cm(t,s,r){s===void 0&&(s=zk);const[o,l]=x.useState(null);function u(){l(g=>{if(!t)return null;if(t.isConnected===!1){var m;return(m=g??r)!=null?m:null}const v=s(t);return JSON.stringify(g)===JSON.stringify(v)?g:v})}const d=$k({callback(g){if(t)for(const m of g){const{type:v,target:k}=m;if(v==="childList"&&k instanceof HTMLElement&&k.contains(t)){u();break}}}}),p=Fl({callback:u});return ds(()=>{u(),t?(p==null||p.observe(t),d==null||d.observe(document.body,{childList:!0,subtree:!0})):(p==null||p.disconnect(),d==null||d.disconnect())},[t]),o}function Fk(t){const s=Ld(t);return mv(t,s)}const um=[];function Uk(t){const s=x.useRef(t),r=Po(o=>t?o&&o!==um&&t&&s.current&&t.parentNode===s.current.parentNode?o:Id(t):um,[t]);return x.useEffect(()=>{s.current=t},[t]),r}function Bk(t){const[s,r]=x.useState(null),o=x.useRef(t),l=x.useCallback(u=>{const d=Ou(u.target);d&&r(p=>p?(p.set(d,Zu(d)),new Map(p)):null)},[]);return x.useEffect(()=>{const u=o.current;if(t!==u){d(u);const p=t.map(g=>{const m=Ou(g);return m?(m.addEventListener("scroll",l,{passive:!0}),[m,Zu(m)]):null}).filter(g=>g!=null);r(p.length?new Map(p):null),o.current=t}return()=>{d(t),d(u)};function d(p){p.forEach(g=>{const m=Ou(g);m==null||m.removeEventListener("scroll",l)})}},[l,t]),x.useMemo(()=>t.length?s?Array.from(s.values()).reduce((u,d)=>bi(u,d),fs):Sv(t):fs,[t,s])}function dm(t,s){s===void 0&&(s=[]);const r=x.useRef(null);return x.useEffect(()=>{r.current=null},s),x.useEffect(()=>{const o=t!==fs;o&&!r.current&&(r.current=t),!o&&r.current&&(r.current=null)},[t]),r.current?wl(t,r.current):fs}function Wk(t){x.useEffect(()=>{if(!Ol)return;const s=t.map(r=>{let{sensor:o}=r;return o.setup==null?void 0:o.setup()});return()=>{for(const r of s)r==null||r()}},t.map(s=>{let{sensor:r}=s;return r}))}function Hk(t,s){return x.useMemo(()=>t.reduce((r,o)=>{let{eventName:l,handler:u}=o;return r[l]=d=>{u(d,s)},r},{}),[t,s])}function jv(t){return x.useMemo(()=>t?mk(t):null,[t])}const fm=[];function Vk(t,s){s===void 0&&(s=_i);const[r]=t,o=jv(r?Nn(r):null),[l,u]=x.useState(fm);function d(){u(()=>t.length?t.map(g=>wv(g)?o:new Md(s(g),g)):fm)}const p=Fl({callback:d});return ds(()=>{p==null||p.disconnect(),d(),t.forEach(g=>p==null?void 0:p.observe(g))},[t]),l}function Cv(t){if(!t)return null;if(t.children.length>1)return t;const s=t.children[0];return Oo(s)?s:t}function Gk(t){let{measure:s}=t;const[r,o]=x.useState(null),l=x.useCallback(m=>{for(const{target:v}of m)if(Oo(v)){o(k=>{const y=s(v);return k?{...k,width:y.width,height:y.height}:y});break}},[s]),u=Fl({callback:l}),d=x.useCallback(m=>{const v=Cv(m);u==null||u.disconnect(),v&&(u==null||u.observe(v)),o(v?s(v):null)},[s,u]),[p,g]=yl(d);return x.useMemo(()=>({nodeRef:p,rect:r,setRef:g}),[r,p,g])}const Kk=[{sensor:zl,options:{}},{sensor:Nv,options:{}}],qk={current:{}},ol={draggable:{measure:rm},droppable:{measure:rm,strategy:Ao.WhileDragging,frequency:ed.Optimized},dragOverlay:{measure:_i}};class ko extends Map{get(s){var r;return s!=null&&(r=super.get(s))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(s=>{let{disabled:r}=s;return!r})}getNodeFor(s){var r,o;return(r=(o=this.get(s))==null?void 0:o.node.current)!=null?r:void 0}}const Yk={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ko,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Sl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ol,measureDroppableContainers:Sl,windowRect:null,measuringScheduled:!1},Ev={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Sl,draggableNodes:new Map,over:null,measureDroppableContainers:Sl},zo=x.createContext(Ev),_v=x.createContext(Yk);function Xk(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ko}}}function Qk(t,s){switch(s.type){case Bt.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:s.initialCoordinates,active:s.active}};case Bt.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:s.coordinates.x-t.draggable.initialCoordinates.x,y:s.coordinates.y-t.draggable.initialCoordinates.y}}};case Bt.DragEnd:case Bt.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Bt.RegisterDroppable:{const{element:r}=s,{id:o}=r,l=new ko(t.droppable.containers);return l.set(o,r),{...t,droppable:{...t.droppable,containers:l}}}case Bt.SetDroppableDisabled:{const{id:r,key:o,disabled:l}=s,u=t.droppable.containers.get(r);if(!u||o!==u.key)return t;const d=new ko(t.droppable.containers);return d.set(r,{...u,disabled:l}),{...t,droppable:{...t.droppable,containers:d}}}case Bt.UnregisterDroppable:{const{id:r,key:o}=s,l=t.droppable.containers.get(r);if(!l||o!==l.key)return t;const u=new ko(t.droppable.containers);return u.delete(r),{...t,droppable:{...t.droppable,containers:u}}}default:return t}}function Zk(t){let{disabled:s}=t;const{active:r,activatorEvent:o,draggableNodes:l}=x.useContext(zo),u=xl(o),d=xl(r==null?void 0:r.id);return x.useEffect(()=>{if(!s&&!o&&u&&d!=null){if(!$l(u)||document.activeElement===u.target)return;const p=l.get(d);if(!p)return;const{activatorNode:g,node:m}=p;if(!g.current&&!m.current)return;requestAnimationFrame(()=>{for(const v of[g.current,m.current]){if(!v)continue;const k=K1(v);if(k){k.focus();break}}})}},[o,s,l,d,u]),null}function Rv(t,s){let{transform:r,...o}=s;return t!=null&&t.length?t.reduce((l,u)=>u({transform:l,...o}),r):r}function Jk(t){return x.useMemo(()=>({draggable:{...ol.draggable,...t==null?void 0:t.draggable},droppable:{...ol.droppable,...t==null?void 0:t.droppable},dragOverlay:{...ol.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function eS(t){let{activeNode:s,measure:r,initialRect:o,config:l=!0}=t;const u=x.useRef(!1),{x:d,y:p}=typeof l=="boolean"?{x:l,y:l}:l;ds(()=>{if(!d&&!p||!s){u.current=!1;return}if(u.current||!o)return;const m=s==null?void 0:s.node.current;if(!m||m.isConnected===!1)return;const v=r(m),k=mv(v,o);if(d||(k.x=0),p||(k.y=0),u.current=!0,Math.abs(k.x)>0||Math.abs(k.y)>0){const y=vv(m);y&&y.scrollBy({top:k.y,left:k.x})}},[s,d,p,o,r])}const Ul=x.createContext({...fs,scaleX:1,scaleY:1});var cr;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(cr||(cr={}));const Av=x.memo(function(s){var r,o,l,u;let{id:d,accessibility:p,autoScroll:g=!0,children:m,sensors:v=Kk,collisionDetection:k=ck,measuring:y,modifiers:S,...T}=s;const _=x.useReducer(Qk,void 0,Xk),[N,C]=_,[R,H]=J1(),[M,D]=x.useState(cr.Uninitialized),K=M===cr.Initialized,{draggable:{active:G,nodes:$,translate:te},droppable:{containers:he}}=N,ue=G!=null?$.get(G):null,Se=x.useRef({initial:null,translated:null}),q=x.useMemo(()=>{var Xe;return G!=null?{id:G,data:(Xe=ue==null?void 0:ue.data)!=null?Xe:qk,rect:Se}:null},[G,ue]),we=x.useRef(null),[Z,oe]=x.useState(null),[ae,z]=x.useState(null),Q=Ro(T,Object.values(T)),B=$o("DndDescribedBy",d),E=x.useMemo(()=>he.getEnabled(),[he]),P=Jk(y),{droppableRects:se,measureDroppableContainers:fe,measuringScheduled:X}=Ok(E,{dragging:K,dependencies:[te.x,te.y],config:P.droppable}),pe=Dk($,G),Ne=x.useMemo(()=>ae?kl(ae):null,[ae]),_e=vn(),Ae=Pk(pe,P.draggable.measure);eS({activeNode:G!=null?$.get(G):null,config:_e.layoutShiftCompensation,initialRect:Ae,measure:P.draggable.measure});const Ee=cm(pe,P.draggable.measure,Ae),at=cm(pe?pe.parentElement:null),De=x.useRef({activatorEvent:null,active:null,activeNode:pe,collisionRect:null,collisions:null,droppableRects:se,draggableNodes:$,draggingNode:null,draggingNodeRect:null,droppableContainers:he,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),lt=he.getNodeFor((r=De.current.over)==null?void 0:r.id),$e=Gk({measure:P.dragOverlay.measure}),en=(o=$e.nodeRef.current)!=null?o:pe,Fe=K?(l=$e.rect)!=null?l:Ee:null,Ht=!!($e.nodeRef.current&&$e.rect),tn=Fk(Ht?null:Ee),wt=jv(en?Nn(en):null),jt=Uk(K?lt??pe:null),$t=Vk(jt),Dt=Rv(S,{transform:{x:te.x-tn.x,y:te.y-tn.y,scaleX:1,scaleY:1},activatorEvent:ae,active:q,activeNodeRect:Ee,containerNodeRect:at,draggingNodeRect:Fe,over:De.current.over,overlayNodeRect:$e.rect,scrollableAncestors:jt,scrollableAncestorRects:$t,windowRect:wt}),Y=Ne?bi(Ne,te):null,me=Bk(jt),Ue=dm(me),tt=dm(me,[Ee]),mt=bi(Dt,Ue),gt=Fe?fk(Fe,Dt):null,Ct=q&&gt?k({active:q,collisionRect:gt,droppableRects:se,droppableContainers:E,pointerCoordinates:Y}):null,an=ak(Ct,"id"),[dt,Mn]=x.useState(null),Dn=Ht?Dt:bi(Dt,tt),ps=uk(Dn,(u=dt==null?void 0:dt.rect)!=null?u:null,Ee),hs=x.useRef(null),ts=x.useCallback((Xe,Et)=>{let{sensor:ft,options:Gt}=Et;if(we.current==null)return;const vt=$.get(we.current);if(!vt)return;const yt=Xe.nativeEvent,it=new ft({active:we.current,activeNode:vt,event:yt,options:Gt,context:De,onAbort(st){if(!$.get(st))return;const{onDragAbort:A}=Q.current,de={id:st};A==null||A(de),R({type:"onDragAbort",event:de})},onPending(st,Lt,A,de){if(!$.get(st))return;const{onDragPending:ye}=Q.current,Le={id:st,constraint:Lt,initialCoordinates:A,offset:de};ye==null||ye(Le),R({type:"onDragPending",event:Le})},onStart(st){const Lt=we.current;if(Lt==null)return;const A=$.get(Lt);if(!A)return;const{onDragStart:de}=Q.current,ie={activatorEvent:yt,active:{id:Lt,data:A.data,rect:Se}};go.unstable_batchedUpdates(()=>{de==null||de(ie),D(cr.Initializing),C({type:Bt.DragStart,initialCoordinates:st,active:Lt}),R({type:"onDragStart",event:ie}),oe(hs.current),z(yt)})},onMove(st){C({type:Bt.DragMove,coordinates:st})},onEnd:Kt(Bt.DragEnd),onCancel:Kt(Bt.DragCancel)});hs.current=it;function Kt(st){return async function(){const{active:A,collisions:de,over:ie,scrollAdjustedTranslate:ye}=De.current;let Le=null;if(A&&ye){const{cancelDrop:Ge}=Q.current;Le={activatorEvent:yt,active:A,collisions:de,delta:ye,over:ie},st===Bt.DragEnd&&typeof Ge=="function"&&await Promise.resolve(Ge(Le))&&(st=Bt.DragCancel)}we.current=null,go.unstable_batchedUpdates(()=>{C({type:st}),D(cr.Uninitialized),Mn(null),oe(null),z(null),hs.current=null;const Ge=st===Bt.DragEnd?"onDragEnd":"onDragCancel";if(Le){const Oe=Q.current[Ge];Oe==null||Oe(Le),R({type:Ge,event:Le})}})}}},[$]),Ln=x.useCallback((Xe,Et)=>(ft,Gt)=>{const vt=ft.nativeEvent,yt=$.get(Gt);if(we.current!==null||!yt||vt.dndKit||vt.defaultPrevented)return;const it={active:yt};Xe(ft,Et.options,it)===!0&&(vt.dndKit={capturedBy:Et.sensor},we.current=Gt,ts(ft,Et))},[$,ts]),gn=Lk(v,Ln);Wk(v),ds(()=>{Ee&&M===cr.Initializing&&D(cr.Initialized)},[Ee,M]),x.useEffect(()=>{const{onDragMove:Xe}=Q.current,{active:Et,activatorEvent:ft,collisions:Gt,over:vt}=De.current;if(!Et||!ft)return;const yt={active:Et,activatorEvent:ft,collisions:Gt,delta:{x:mt.x,y:mt.y},over:vt};go.unstable_batchedUpdates(()=>{Xe==null||Xe(yt),R({type:"onDragMove",event:yt})})},[mt.x,mt.y]),x.useEffect(()=>{const{active:Xe,activatorEvent:Et,collisions:ft,droppableContainers:Gt,scrollAdjustedTranslate:vt}=De.current;if(!Xe||we.current==null||!Et||!vt)return;const{onDragOver:yt}=Q.current,it=Gt.get(an),Kt=it&&it.rect.current?{id:it.id,rect:it.rect.current,data:it.data,disabled:it.disabled}:null,st={active:Xe,activatorEvent:Et,collisions:ft,delta:{x:vt.x,y:vt.y},over:Kt};go.unstable_batchedUpdates(()=>{Mn(Kt),yt==null||yt(st),R({type:"onDragOver",event:st})})},[an]),ds(()=>{De.current={activatorEvent:ae,active:q,activeNode:pe,collisionRect:gt,collisions:Ct,droppableRects:se,draggableNodes:$,draggingNode:en,draggingNodeRect:Fe,droppableContainers:he,over:dt,scrollableAncestors:jt,scrollAdjustedTranslate:mt},Se.current={initial:Fe,translated:gt}},[q,pe,Ct,gt,$,en,Fe,se,he,dt,jt,mt]),Ak({..._e,delta:te,draggingRect:gt,pointerCoordinates:Y,scrollableAncestors:jt,scrollableAncestorRects:$t});const ln=x.useMemo(()=>({active:q,activeNode:pe,activeNodeRect:Ee,activatorEvent:ae,collisions:Ct,containerNodeRect:at,dragOverlay:$e,draggableNodes:$,droppableContainers:he,droppableRects:se,over:dt,measureDroppableContainers:fe,scrollableAncestors:jt,scrollableAncestorRects:$t,measuringConfiguration:P,measuringScheduled:X,windowRect:wt}),[q,pe,Ee,ae,Ct,at,$e,$,he,se,dt,fe,jt,$t,P,X,wt]),Vt=x.useMemo(()=>({activatorEvent:ae,activators:gn,active:q,activeNodeRect:Ee,ariaDescribedById:{draggable:B},dispatch:C,draggableNodes:$,over:dt,measureDroppableContainers:fe}),[ae,gn,q,Ee,C,B,$,dt,fe]);return ot.createElement(dv.Provider,{value:H},ot.createElement(zo.Provider,{value:Vt},ot.createElement(_v.Provider,{value:ln},ot.createElement(Ul.Provider,{value:ps},m)),ot.createElement(Zk,{disabled:(p==null?void 0:p.restoreFocus)===!1})),ot.createElement(nk,{...p,hiddenTextDescribedById:B}));function vn(){const Xe=(Z==null?void 0:Z.autoScrollEnabled)===!1,Et=typeof g=="object"?g.enabled===!1:g===!1,ft=K&&!Xe&&!Et;return typeof g=="object"?{...g,enabled:ft}:{enabled:ft}}}),tS=x.createContext(null),pm="button",nS="Draggable";function sS(t){let{id:s,data:r,disabled:o=!1,attributes:l}=t;const u=$o(nS),{activators:d,activatorEvent:p,active:g,activeNodeRect:m,ariaDescribedById:v,draggableNodes:k,over:y}=x.useContext(zo),{role:S=pm,roleDescription:T="draggable",tabIndex:_=0}=l??{},N=(g==null?void 0:g.id)===s,C=x.useContext(N?Ul:tS),[R,H]=yl(),[M,D]=yl(),K=Hk(d,s),G=Ro(r);ds(()=>(k.set(s,{id:s,key:u,node:R,activatorNode:M,data:G}),()=>{const te=k.get(s);te&&te.key===u&&k.delete(s)}),[k,s]);const $=x.useMemo(()=>({role:S,tabIndex:_,"aria-disabled":o,"aria-pressed":N&&S===pm?!0:void 0,"aria-roledescription":T,"aria-describedby":v.draggable}),[o,S,_,N,T,v.draggable]);return{active:g,activatorEvent:p,activeNodeRect:m,attributes:$,isDragging:N,listeners:o?void 0:K,node:R,over:y,setNodeRef:H,setActivatorNodeRef:D,transform:C}}function Iv(){return x.useContext(_v)}const rS="Droppable",iS={timeout:25};function Mv(t){let{data:s,disabled:r=!1,id:o,resizeObserverConfig:l}=t;const u=$o(rS),{active:d,dispatch:p,over:g,measureDroppableContainers:m}=x.useContext(zo),v=x.useRef({disabled:r}),k=x.useRef(!1),y=x.useRef(null),S=x.useRef(null),{disabled:T,updateMeasurementsFor:_,timeout:N}={...iS,...l},C=Ro(_??o),R=x.useCallback(()=>{if(!k.current){k.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{m(Array.isArray(C.current)?C.current:[C.current]),S.current=null},N)},[N]),H=Fl({callback:R,disabled:T||!d}),M=x.useCallback(($,te)=>{H&&(te&&(H.unobserve(te),k.current=!1),$&&H.observe($))},[H]),[D,K]=yl(M),G=Ro(s);return x.useEffect(()=>{!H||!D.current||(H.disconnect(),k.current=!1,H.observe(D.current))},[D,H]),x.useEffect(()=>(p({type:Bt.RegisterDroppable,element:{id:o,key:u,disabled:r,node:D,rect:y,data:G}}),()=>p({type:Bt.UnregisterDroppable,key:u,id:o})),[o]),x.useEffect(()=>{r!==v.current.disabled&&(p({type:Bt.SetDroppableDisabled,id:o,key:u,disabled:r}),v.current.disabled=r)},[o,u,r,p]),{active:d,rect:y,isOver:(g==null?void 0:g.id)===o,node:D,over:g,setNodeRef:K}}function oS(t){let{animation:s,children:r}=t;const[o,l]=x.useState(null),[u,d]=x.useState(null),p=xl(r);return!r&&!o&&p&&l(p),ds(()=>{if(!u)return;const g=o==null?void 0:o.key,m=o==null?void 0:o.props.id;if(g==null||m==null){l(null);return}Promise.resolve(s(m,u)).then(()=>{l(null)})},[s,o,u]),ot.createElement(ot.Fragment,null,r,o?x.cloneElement(o,{ref:d}):null)}const aS={x:0,y:0,scaleX:1,scaleY:1};function lS(t){let{children:s}=t;return ot.createElement(zo.Provider,{value:Ev},ot.createElement(Ul.Provider,{value:aS},s))}const cS={position:"fixed",touchAction:"none"},uS=t=>$l(t)?"transform 250ms ease":void 0,dS=x.forwardRef((t,s)=>{let{as:r,activatorEvent:o,adjustScale:l,children:u,className:d,rect:p,style:g,transform:m,transition:v=uS}=t;if(!p)return null;const k=l?m:{...m,scaleX:1,scaleY:1},y={...cS,width:p.width,height:p.height,top:p.top,left:p.left,transform:js.Transform.toString(k),transformOrigin:l&&o?rk(o,p):void 0,transition:typeof v=="function"?v(o):v,...g};return ot.createElement(r,{className:d,style:y,ref:s},u)}),fS=t=>s=>{let{active:r,dragOverlay:o}=s;const l={},{styles:u,className:d}=t;if(u!=null&&u.active)for(const[p,g]of Object.entries(u.active))g!==void 0&&(l[p]=r.node.style.getPropertyValue(p),r.node.style.setProperty(p,g));if(u!=null&&u.dragOverlay)for(const[p,g]of Object.entries(u.dragOverlay))g!==void 0&&o.node.style.setProperty(p,g);return d!=null&&d.active&&r.node.classList.add(d.active),d!=null&&d.dragOverlay&&o.node.classList.add(d.dragOverlay),function(){for(const[g,m]of Object.entries(l))r.node.style.setProperty(g,m);d!=null&&d.active&&r.node.classList.remove(d.active)}},pS=t=>{let{transform:{initial:s,final:r}}=t;return[{transform:js.Transform.toString(s)},{transform:js.Transform.toString(r)}]},hS={duration:250,easing:"ease",keyframes:pS,sideEffects:fS({styles:{active:{opacity:"0"}}})};function mS(t){let{config:s,draggableNodes:r,droppableContainers:o,measuringConfiguration:l}=t;return Pl((u,d)=>{if(s===null)return;const p=r.get(u);if(!p)return;const g=p.node.current;if(!g)return;const m=Cv(d);if(!m)return;const{transform:v}=Nn(d).getComputedStyle(d),k=gv(v);if(!k)return;const y=typeof s=="function"?s:gS(s);return bv(g,l.draggable.measure),y({active:{id:u,data:p.data,node:g,rect:l.draggable.measure(g)},draggableNodes:r,dragOverlay:{node:d,rect:l.dragOverlay.measure(m)},droppableContainers:o,measuringConfiguration:l,transform:k})})}function gS(t){const{duration:s,easing:r,sideEffects:o,keyframes:l}={...hS,...t};return u=>{let{active:d,dragOverlay:p,transform:g,...m}=u;if(!s)return;const v={x:p.rect.left-d.rect.left,y:p.rect.top-d.rect.top},k={scaleX:g.scaleX!==1?d.rect.width*g.scaleX/p.rect.width:1,scaleY:g.scaleY!==1?d.rect.height*g.scaleY/p.rect.height:1},y={x:g.x-v.x,y:g.y-v.y,...k},S=l({...m,active:d,dragOverlay:p,transform:{initial:g,final:y}}),[T]=S,_=S[S.length-1];if(JSON.stringify(T)===JSON.stringify(_))return;const N=o==null?void 0:o({active:d,dragOverlay:p,...m}),C=p.node.animate(S,{duration:s,easing:r,fill:"forwards"});return new Promise(R=>{C.onfinish=()=>{N==null||N(),R()}})}}let hm=0;function vS(t){return x.useMemo(()=>{if(t!=null)return hm++,hm},[t])}const yS=ot.memo(t=>{let{adjustScale:s=!1,children:r,dropAnimation:o,style:l,transition:u,modifiers:d,wrapperElement:p="div",className:g,zIndex:m=999}=t;const{activatorEvent:v,active:k,activeNodeRect:y,containerNodeRect:S,draggableNodes:T,droppableContainers:_,dragOverlay:N,over:C,measuringConfiguration:R,scrollableAncestors:H,scrollableAncestorRects:M,windowRect:D}=Iv(),K=x.useContext(Ul),G=vS(k==null?void 0:k.id),$=Rv(d,{activatorEvent:v,active:k,activeNodeRect:y,containerNodeRect:S,draggingNodeRect:N.rect,over:C,overlayNodeRect:N.rect,scrollableAncestors:H,scrollableAncestorRects:M,transform:K,windowRect:D}),te=Ld(y),he=mS({config:o,draggableNodes:T,droppableContainers:_,measuringConfiguration:R}),ue=te?N.setRef:void 0;return ot.createElement(lS,null,ot.createElement(oS,{animation:he},k&&G?ot.createElement(dS,{key:G,id:k.id,ref:ue,as:p,activatorEvent:v,adjustScale:s,className:g,transition:u,rect:te,style:{zIndex:m,...l},transform:$},r):null))});function Dv(t,s,r){const o=t.slice();return o.splice(r<0?o.length+r:r,0,o.splice(s,1)[0]),o}function xS(t,s){return t.reduce((r,o,l)=>{const u=s.get(o);return u&&(r[l]=u),r},Array(t.length))}function Ga(t){return t!==null&&t>=0}function wS(t,s){if(t===s)return!0;if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==s[r])return!1;return!0}function kS(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Ka={scaleX:1,scaleY:1},SS=t=>{var s;let{rects:r,activeNodeRect:o,activeIndex:l,overIndex:u,index:d}=t;const p=(s=r[l])!=null?s:o;if(!p)return null;const g=bS(r,d,l);if(d===l){const m=r[u];return m?{x:l<u?m.left+m.width-(p.left+p.width):m.left-p.left,y:0,...Ka}:null}return d>l&&d<=u?{x:-p.width-g,y:0,...Ka}:d<l&&d>=u?{x:p.width+g,y:0,...Ka}:{x:0,y:0,...Ka}};function bS(t,s,r){const o=t[s],l=t[s-1],u=t[s+1];return!o||!l&&!u?0:r<s?l?o.left-(l.left+l.width):u.left-(o.left+o.width):u?u.left-(o.left+o.width):o.left-(l.left+l.width)}const Lv=t=>{let{rects:s,activeIndex:r,overIndex:o,index:l}=t;const u=Dv(s,o,r),d=s[l],p=u[l];return!p||!d?null:{x:p.left-d.left,y:p.top-d.top,scaleX:p.width/d.width,scaleY:p.height/d.height}},qa={scaleX:1,scaleY:1},mm=t=>{var s;let{activeIndex:r,activeNodeRect:o,index:l,rects:u,overIndex:d}=t;const p=(s=u[r])!=null?s:o;if(!p)return null;if(l===r){const m=u[d];return m?{x:0,y:r<d?m.top+m.height-(p.top+p.height):m.top-p.top,...qa}:null}const g=TS(u,l,r);return l>r&&l<=d?{x:0,y:-p.height-g,...qa}:l<r&&l>=d?{x:0,y:p.height+g,...qa}:{x:0,y:0,...qa}};function TS(t,s,r){const o=t[s],l=t[s-1],u=t[s+1];return o?r<s?l?o.top-(l.top+l.height):u?u.top-(o.top+o.height):0:u?u.top-(o.top+o.height):l?o.top-(l.top+l.height):0:0}const Ov="Sortable",Pv=ot.createContext({activeIndex:-1,containerId:Ov,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Lv,disabled:{draggable:!1,droppable:!1}});function td(t){let{children:s,id:r,items:o,strategy:l=Lv,disabled:u=!1}=t;const{active:d,dragOverlay:p,droppableRects:g,over:m,measureDroppableContainers:v}=Iv(),k=$o(Ov,r),y=p.rect!==null,S=x.useMemo(()=>o.map(K=>typeof K=="object"&&"id"in K?K.id:K),[o]),T=d!=null,_=d?S.indexOf(d.id):-1,N=m?S.indexOf(m.id):-1,C=x.useRef(S),R=!wS(S,C.current),H=N!==-1&&_===-1||R,M=kS(u);ds(()=>{R&&T&&v(S)},[R,S,T,v]),x.useEffect(()=>{C.current=S},[S]);const D=x.useMemo(()=>({activeIndex:_,containerId:k,disabled:M,disableTransforms:H,items:S,overIndex:N,useDragOverlay:y,sortedRects:xS(S,g),strategy:l}),[_,k,M.draggable,M.droppable,H,S,N,g,y,l]);return ot.createElement(Pv.Provider,{value:D},s)}const NS=t=>{let{id:s,items:r,activeIndex:o,overIndex:l}=t;return Dv(r,o,l).indexOf(s)},jS=t=>{let{containerId:s,isSorting:r,wasDragging:o,index:l,items:u,newIndex:d,previousItems:p,previousContainerId:g,transition:m}=t;return!m||!o||p!==u&&l===d?!1:r?!0:d!==l&&s===g},CS={duration:200,easing:"ease"},$v="transform",ES=js.Transition.toString({property:$v,duration:0,easing:"linear"}),_S={roleDescription:"sortable"};function RS(t){let{disabled:s,index:r,node:o,rect:l}=t;const[u,d]=x.useState(null),p=x.useRef(r);return ds(()=>{if(!s&&r!==p.current&&o.current){const g=l.current;if(g){const m=_i(o.current,{ignoreTransform:!0}),v={x:g.left-m.left,y:g.top-m.top,scaleX:g.width/m.width,scaleY:g.height/m.height};(v.x||v.y)&&d(v)}}r!==p.current&&(p.current=r)},[s,r,o,l]),x.useEffect(()=>{u&&d(null)},[u]),u}function Od(t){let{animateLayoutChanges:s=jS,attributes:r,disabled:o,data:l,getNewIndex:u=NS,id:d,strategy:p,resizeObserverConfig:g,transition:m=CS}=t;const{items:v,containerId:k,activeIndex:y,disabled:S,disableTransforms:T,sortedRects:_,overIndex:N,useDragOverlay:C,strategy:R}=x.useContext(Pv),H=AS(o,S),M=v.indexOf(d),D=x.useMemo(()=>({sortable:{containerId:k,index:M,items:v},...l}),[k,l,M,v]),K=x.useMemo(()=>v.slice(v.indexOf(d)),[v,d]),{rect:G,node:$,isOver:te,setNodeRef:he}=Mv({id:d,data:D,disabled:H.droppable,resizeObserverConfig:{updateMeasurementsFor:K,...g}}),{active:ue,activatorEvent:Se,activeNodeRect:q,attributes:we,setNodeRef:Z,listeners:oe,isDragging:ae,over:z,setActivatorNodeRef:Q,transform:B}=sS({id:d,data:D,attributes:{..._S,...r},disabled:H.draggable}),E=W1(he,Z),P=!!ue,se=P&&!T&&Ga(y)&&Ga(N),fe=!C&&ae,X=fe&&se?B:null,Ne=se?X??(p??R)({rects:_,activeNodeRect:q,activeIndex:y,overIndex:N,index:M}):null,_e=Ga(y)&&Ga(N)?u({id:d,items:v,activeIndex:y,overIndex:N}):M,Ae=ue==null?void 0:ue.id,Ee=x.useRef({activeId:Ae,items:v,newIndex:_e,containerId:k}),at=v!==Ee.current.items,De=s({active:ue,containerId:k,isDragging:ae,isSorting:P,id:d,index:M,items:v,newIndex:Ee.current.newIndex,previousItems:Ee.current.items,previousContainerId:Ee.current.containerId,transition:m,wasDragging:Ee.current.activeId!=null}),lt=RS({disabled:!De,index:M,node:$,rect:G});return x.useEffect(()=>{P&&Ee.current.newIndex!==_e&&(Ee.current.newIndex=_e),k!==Ee.current.containerId&&(Ee.current.containerId=k),v!==Ee.current.items&&(Ee.current.items=v)},[P,_e,k,v]),x.useEffect(()=>{if(Ae===Ee.current.activeId)return;if(Ae!=null&&Ee.current.activeId==null){Ee.current.activeId=Ae;return}const en=setTimeout(()=>{Ee.current.activeId=Ae},50);return()=>clearTimeout(en)},[Ae]),{active:ue,activeIndex:y,attributes:we,data:D,rect:G,index:M,newIndex:_e,items:v,isOver:te,isSorting:P,isDragging:ae,listeners:oe,node:$,overIndex:N,over:z,setNodeRef:E,setActivatorNodeRef:Q,setDroppableNodeRef:he,setDraggableNodeRef:Z,transform:lt??Ne,transition:$e()};function $e(){if(lt||at&&Ee.current.newIndex===M)return ES;if(!(fe&&!$l(Se)||!m)&&(P||De))return js.Transition.toString({...m,property:$v})}}function AS(t,s){var r,o;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(r=t==null?void 0:t.draggable)!=null?r:s.draggable,droppable:(o=t==null?void 0:t.droppable)!=null?o:s.droppable}}et.Down,et.Right,et.Up,et.Left;function Ya(t){const[s,r]=x.useState(()=>{try{const l=localStorage.getItem(t);if(l==null)return new Set;const u=JSON.parse(l);return Array.isArray(u)?new Set(u.filter(d=>typeof d=="string")):new Set}catch{return new Set}}),o=x.useCallback(l=>{r(u=>{const d=l(new Set(u));try{localStorage.setItem(t,JSON.stringify([...d]))}catch{}return d})},[t]);return[s,o]}function IS(t,s=!1){const[r,o]=x.useState(()=>{try{const u=localStorage.getItem(t);return u==="1"?!0:u==="0"?!1:s}catch{return s}}),l=x.useCallback(u=>{o(u);try{localStorage.setItem(t,u?"1":"0")}catch{}},[t]);return[r,l]}async function Io(t){try{return await navigator.clipboard.writeText(t),!0}catch{try{const s=document.createElement("textarea");s.value=t,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();const r=document.execCommand("copy");return document.body.removeChild(s),r}catch{return!1}}}function MS(t){return t.origin_app_id!=null&&!t.user_touched&&!t.starred}const nd="(no directory)";function pr(t){return t.replaceAll("\\","/").replace(/\/+$/,"")}function sd(t,s){if(!s||!t.cwd)return!1;const r=pr(t.cwd),o=pr(s);return r.startsWith(`${o}/`)}function DS(t,s){const r=new Map;for(const d of s){const p=d.cwd||nd,g=r.get(p)??[];g.push(d),r.set(p,g)}const o=new Set,l=new Set(t.filter(d=>d.deleted===1).map(d=>d.path)),u=[];for(const d of t){if(d.deleted===1){o.add(d.path);continue}o.add(d.path),u.push({path:d.path,label:d.label||d.path.split("/").pop()||d.path,sessions:r.get(d.path)??[],workspace:d})}for(const[d,p]of r)o.has(d)||l.has(d)||u.push({path:d,label:d===nd?"Other":d.split("/").pop()||d,sessions:p,workspace:null});return u}function LS(t,s,r){if(s.length===0)return!1;const o=new Set(t.filter(l=>l.deleted===1).map(l=>l.path));return s.some(l=>!sd(l,r)&&!o.has(l.cwd||nd))}function Tl(t){return[...t].sort((s,r)=>r.sort_order-s.sort_order||(s.created_at<r.created_at?1:-1))}function gm(t,s,r,o){const l=s.map(u=>({folder:u,sessions:t.sessions.filter(d=>d.folder_id===u.id),finishedKey:`folder:${u.id}:finished`,hidden:o.has(u.id)}));return l.push({folder:null,sessions:t.sessions.filter(u=>!(u.folder_id&&r.has(u.folder_id))),finishedKey:`${t.path}:finished`,hidden:!1}),l}function vm(t,s){return{working:Tl(t.sessions.filter(r=>r.lifecycle!=="finished")),finished:Tl(t.sessions.filter(r=>r.lifecycle==="finished")),finishedCollapsed:s.has(t.finishedKey)}}function Xa(t,s){return t.folder_id&&s.has(t.folder_id)?t.folder_id:null}function OS(t){const s=new Set(t.map(o=>o.name));if(!s.has("New Folder"))return"New Folder";let r=2;for(;s.has(`New Folder ${r}`);)r++;return`New Folder ${r}`}function ym({id:t,children:s,className:r}){const{setNodeRef:o,isOver:l}=Mv({id:t});return a.jsx("div",{ref:o,className:`${r??""}${l?" drop-over":""}`,children:s})}function Pd({inputRef:t,value:s,onChange:r,onConfirm:o,onCancel:l}){return a.jsx("input",{ref:t,className:"tree-rename-input",value:s,onChange:u=>r(u.target.value),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),onKeyDown:u=>{u.key==="Enter"&&o(),u.key==="Escape"&&l()},onBlur:o})}function PS({s:t,backgroundTaskCount:s,isActive:r,isSelected:o,originApp:l,renaming:u,renameValue:d,renameRef:p,onRenameValue:g,onRenameConfirm:m,onRenameCancel:v,onSelect:k,onCtxMenu:y,onToggleStar:S}){const{attributes:T,listeners:_,setNodeRef:N,transform:C,transition:R,isDragging:H}=Od({id:`s:${t.id}`}),M=Dl(t,s);return a.jsxs("div",{ref:N,style:{transform:js.Transform.toString(C),transition:R},className:`tree-item ${r?"active":""}${o?" selected":""} ${M.isFinished?"tree-item-finished":""}${H?" dragging":""}${t.starred?" tree-item-starred":""}`,...T,..._,onClick:k,onContextMenu:y,children:[a.jsx(_d,{iconClass:M.iconClass,iconText:M.iconText,size:16}),l&&a.jsx("span",{className:"tree-app-badge",title:"Created by a mini app",children:a.jsx(ji,{iconNode:l.iconNode,size:10})}),u?a.jsx(Pd,{inputRef:p,value:d,onChange:g,onConfirm:m,onCancel:v}):a.jsx("span",{className:"tree-label",children:t.title||t.id.slice(0,8)}),!u&&a.jsx("button",{className:`star-btn${t.starred?" starred":""}`,title:t.starred?"Unstar session":"Star session",onClick:D=>{D.stopPropagation(),S()},onPointerDown:D=>D.stopPropagation(),children:a.jsx(vl,{size:10,fill:t.starred?"currentColor":"none"})}),M.dot&&a.jsx(Ed,{status:M.dot,title:M.dotTitle})]})}function $S({folder:t,count:s,collapsed:r,renaming:o,renameValue:l,renameRef:u,onRenameValue:d,onRenameConfirm:p,onRenameCancel:g,onToggle:m,onCtxMenu:v,children:k}){const{attributes:y,listeners:S,setNodeRef:T,transform:_,transition:N,isDragging:C,over:R}=Od({id:`f:${t.id}`}),H=R!=null&&String(R.id).startsWith("s:");return a.jsxs("div",{ref:T,style:{transform:js.Transform.toString(_),transition:N},className:`tree-folder ${r?"collapsed":""}${C?" dragging":""}`,children:[a.jsx("div",{className:`tree-folder-header${H?" drop-over":""}`,...y,...S,onClick:()=>{o||m()},onContextMenu:v,children:o?a.jsx(Pd,{inputRef:u,value:l,onChange:d,onConfirm:p,onCancel:g}):a.jsxs(a.Fragment,{children:[a.jsx(Si,{size:8,className:"tree-chevron"}),a.jsx(gl,{size:12}),a.jsx("span",{className:"tree-folder-label",children:t.name}),a.jsx("span",{className:"tree-count",children:s})]})}),!r&&a.jsx("div",{className:"tree-folder-children",children:k})]})}function zS(){const t=I(A=>A.sessions),s=I(A=>A.backgroundTasks),r=I(A=>A.workspaces),o=I(A=>A.folders),l=I(A=>A.activeSessionId),u=I(A=>A.selectSession),d=I(A=>A.deleteSession),p=I(A=>A.removeWorkspace),g=I(A=>A.createSessionInWorkspace),m=I(A=>A.pickAndAddWorkspace),v=I(A=>A.setImportSessionsWorkspace),k=I(A=>A.renameSession),y=I(A=>A.markFinished),S=I(A=>A.markFinishedMany),T=I(A=>A.toggleStar),_=I(A=>A.reopenSession),N=I(A=>A.reopenSessionMany),C=I(A=>A.deleteSessionMany),R=I(A=>A.createSidebarFolder),H=I(A=>A.renameFolder),M=I(A=>A.deleteFolder),D=I(A=>A.applyMoves),K=I(A=>A.reorderFolders),G=I(A=>A.apps),$=I(A=>A.appsRootPath),te=I(A=>A.activeAppTabId),he=I(A=>A.openAppTab),ue=I(A=>A.startAppEdit),Se=I(A=>A.toggleAppPin),q=I(A=>A.deleteApp),we=I(A=>A.openAppCatalog),[Z,oe]=Ya("agentpane:sidebar-ws-collapsed"),[ae,z]=Ya("agentpane:sidebar-sub-collapsed"),[Q,B]=Ya("agentpane:sidebar-folders-collapsed"),[E,P]=Ya("agentpane:sidebar-app-edits-collapsed"),[se,fe]=IS("agentpane:sidebar-hide-auto-sessions"),[X,pe]=x.useState(null),[Ne,_e]=x.useState(null),[Ae,Ee]=x.useState(""),[at,De]=x.useState(null),[lt,$e]=x.useState(new Set),[en,Fe]=x.useState(null),Ht=x.useRef(null),tn=x.useRef(null),wt=x.useRef(null),jt=x.useRef(!1),$t=pv(fv(zl,{activationConstraint:{distance:5}}));function Dt(){$e(new Set),Fe(null)}Do(Ht,()=>pe(null),!!X),Ni(()=>{pe(null),Dt()},!!X||lt.size>0),x.useLayoutEffect(()=>{const A=Ht.current;if(!X||!A)return;const de=8,{offsetWidth:ie,offsetHeight:ye}=A,Le=X.x+ie>window.innerWidth-de?Math.max(de,X.x-ie):X.x,Ge=X.y+ye>window.innerHeight-de?Math.max(de,X.y-ye):X.y;A.style.left=`${Le}px`,A.style.top=`${Ge}px`},[X]);const Y=x.useMemo(()=>new Map(t.map(A=>[A.id,A])),[t]),me=x.useMemo(()=>new Map(o.map(A=>[A.id,A])),[o]),Ue=x.useMemo(()=>{const A=new Map;for(const de of[...o].sort((ie,ye)=>ie.sort_order-ye.sort_order)){const ie=A.get(de.workspace_path)??[];ie.push(de),A.set(de.workspace_path,ie)}return A},[o]);function tt(A){oe(de=>{const ie=new Set(de);return ie.has(A)?ie.delete(A):ie.add(A),ie})}function mt(A){z(de=>{const ie=new Set(de);return ie.has(A)?ie.delete(A):ie.add(A),ie})}function gt(A){B(de=>{const ie=new Set(de);return ie.has(A)?ie.delete(A):ie.add(A),ie})}function Ct(){fe(!se),Dt()}function an(A){P(de=>{const ie=new Set(de);return ie.has(A)?ie.delete(A):ie.add(A),ie})}x.useEffect(()=>{Ne&&tn.current&&(tn.current.focus(),tn.current.select())},[Ne]),x.useEffect(()=>{var A,de,ie;jt.current||!l||(jt.current=!0,(ie=(de=(A=wt.current)==null?void 0:A.querySelector(".tree-item.active, .sidebar-app-edit-row.active"))==null?void 0:de.scrollIntoView)==null||ie.call(de,{block:"nearest"}))},[l]);function dt(A,de,ie,ye=""){_e({kind:A,id:de}),Ee(ie||ye)}function Mn(){if(Ne){const A=Ae.trim();A&&(Ne.kind==="session"?k(Ne.id,A):H(Ne.id,A))}_e(null)}function Dn(){_e(null),Ee("")}async function ps(A){const de=OS(Ue.get(A)??[]),ie=await R(A,de);ie&&dt("folder",ie.id,ie.name)}function hs(A){const de=String(A.active.id);if(de.startsWith("s:")){const ie=Y.get(de.slice(2));ie&&De({kind:"session",label:ie.title||ie.id.slice(0,8)})}else if(de.startsWith("f:")){const ie=me.get(de.slice(2));ie&&De({kind:"folder",label:ie.name})}}function ts(A){De(null);const{active:de,over:ie}=A;if(!ie)return;const ye=String(de.id),Le=String(ie.id);if(ye.startsWith("s:")){const Ge=Y.get(ye.slice(2));if(!Ge)return;const Oe=Ge.cwd||"(no directory)",zt=Xa(Ge,me);let On,Be;if(Le.startsWith("f:")){const Qe=me.get(Le.slice(2));if(!Qe)return;On=Qe.workspace_path,Be=Qe.id}else if(Le.startsWith("s:")){const Qe=Y.get(Le.slice(2));if(!Qe)return;On=Qe.cwd||"(no directory)",Be=Xa(Qe,me)}else if(Le.startsWith("c:")){const Qe=Le.slice(2),_t=Qe.lastIndexOf("|");On=Qe.slice(0,_t);const gs=Qe.slice(_t+1);Be=gs==="root"?null:gs}else return;if(On!==Oe)return;const yn=Tl(t.filter(Qe=>(Qe.cwd||"(no directory)")===On&&Xa(Qe,me)===Be)),Cs=yn.filter(Qe=>Qe.id!==Ge.id);let Us=Cs.length;if(Le.startsWith("s:")){const Qe=Cs.findIndex(_t=>_t.id===Le.slice(2));Qe>=0&&(Us=Qe)}const Pn=[...Cs.slice(0,Us),Ge,...Cs.slice(Us)],ms=[];if(Be===zt){if(Pn.length===yn.length&&Pn.every((Qe,_t)=>Qe.id===yn[_t].id))return;Pn.forEach((Qe,_t)=>ms.push({id:Qe.id,folder_id:Be,sort_order:Pn.length-1-_t}))}else{const Qe=Tl(t.filter(_t=>(_t.cwd||"(no directory)")===Oe&&Xa(_t,me)===zt)).filter(_t=>_t.id!==Ge.id);Qe.forEach((_t,gs)=>ms.push({id:_t.id,folder_id:zt,sort_order:Qe.length-1-gs})),Pn.forEach((_t,gs)=>ms.push({id:_t.id,folder_id:Be,sort_order:Pn.length-1-gs}))}D(ms);return}if(ye.startsWith("f:")){if(!Le.startsWith("f:"))return;const Ge=me.get(ye.slice(2)),Oe=me.get(Le.slice(2));if(!Ge||!Oe||Ge.id===Oe.id||Ge.workspace_path!==Oe.workspace_path)return;const zt=(Ue.get(Ge.workspace_path)??[]).map(yn=>yn.id),On=zt.indexOf(Ge.id),Be=zt.indexOf(Oe.id);zt.splice(Be,0,...zt.splice(On,1)),K(zt)}}const Ln=$?t.filter(A=>!sd(A,$)):t,gn=new Set(se?Ln.filter(A=>MS(A)&&A.id!==l).map(A=>A.id):[]),ln=DS(r,gn.size>0?Ln.filter(A=>!gn.has(A.id)):Ln),Vt=x.useMemo(()=>{const A=new Map;if(!$)return A;const de=pr($);for(const ie of t){if(!sd(ie,$))continue;const ye=pr(ie.cwd).slice(de.length+1).split("/")[0],Le=A.get(ye)??[];Le.push(ie),A.set(ye,Le)}return A},[t,$]);function vn(A){return{folder:null,sessions:Vt.get(A)??[],finishedKey:`app:${A}:finished`,hidden:E.has(A)}}const Xe=[],Et=A=>{if(A.hidden)return;const{working:de,finished:ie,finishedCollapsed:ye}=vm(A,ae);Xe.push(...de.map(Le=>Le.id)),ye||Xe.push(...ie.map(Le=>Le.id))};for(const A of ln){if(Z.has(A.path))continue;const de=Ue.get(A.path)??[],ie=new Set(de.map(ye=>ye.id));gm(A,de,ie,Q).forEach(Et)}G.forEach(A=>Et(vn(A.id)));const ft=t.filter(A=>lt.has(A.id)),Gt=ft.filter(A=>A.lifecycle!=="finished").map(A=>A.id),vt=ft.filter(A=>A.lifecycle==="finished").map(A=>A.id);function yt(A,de){if(de.metaKey||de.ctrlKey){de.preventDefault(),Fe(A.id),$e(ie=>{const ye=new Set(ie);return ye.has(A.id)?ye.delete(A.id):ye.add(A.id),ye});return}if(de.shiftKey){de.preventDefault();const ie=en??A.id;Fe(ie);const ye=Xe.indexOf(ie),Le=Xe.indexOf(A.id);if(ye>=0&&Le>=0){const[Ge,Oe]=ye<Le?[ye,Le]:[Le,ye];$e(new Set(Xe.slice(Ge,Oe+1)))}return}Dt(),Fe(A.id),u(A.id)}function it(A,de){de.preventDefault();const ie=lt.has(A.id)&&lt.size>1;lt.has(A.id)||($e(new Set),Fe(A.id)),pe({x:de.clientX,y:de.clientY,type:"session",sessionId:A.id,sessionTitle:A.title,sessionLifecycle:A.lifecycle,sessionExternalId:A.external_thread_id,multi:ie})}function Kt(A){var ie;const de=A.origin_app_id?G.find(ye=>ye.id===A.origin_app_id):null;return a.jsx(PS,{s:A,backgroundTaskCount:((ie=s[A.id])==null?void 0:ie.length)??0,isActive:l===A.id,isSelected:lt.has(A.id),originApp:de??null,renaming:(Ne==null?void 0:Ne.kind)==="session"&&Ne.id===A.id,renameValue:Ae,renameRef:tn,onRenameValue:Ee,onRenameConfirm:Mn,onRenameCancel:Dn,onSelect:ye=>yt(A,ye),onToggleStar:()=>T(A.id),onCtxMenu:ye=>it(A,ye)},A.id)}function st(A){var ie;const de=Dl(A,((ie=s[A.id])==null?void 0:ie.length)??0);return a.jsxs("div",{className:`sidebar-app-edit-row${l===A.id?" active":""}${lt.has(A.id)?" selected":""}${de.isFinished?" tree-item-finished":""}`,title:"App edit session — click to open",onClick:ye=>yt(A,ye),onContextMenu:ye=>it(A,ye),children:[a.jsx(_d,{iconClass:de.iconClass,iconText:de.iconText,size:14}),(Ne==null?void 0:Ne.kind)==="session"&&Ne.id===A.id?a.jsx(Pd,{inputRef:tn,value:Ae,onChange:Ee,onConfirm:Mn,onCancel:Dn}):a.jsx("span",{className:"tree-label",children:A.title||A.id.slice(0,8)}),de.dot&&a.jsx(Ed,{status:de.dot,title:de.dotTitle})]},A.id)}function Lt(A,de="workspace"){const{working:ie,finished:ye,finishedCollapsed:Le}=vm(A,ae),Ge=de==="workspace"?Kt:st,Oe=a.jsxs(a.Fragment,{children:[ie.length===0&&ye.length===0?a.jsx("div",{className:"tree-empty",children:"No sessions"}):ie.map(Ge),ye.length>0&&a.jsxs("div",{className:`tree-subgroup ${Le?"collapsed":""}`,children:[a.jsxs("div",{className:"tree-subgroup-header",onClick:()=>mt(A.finishedKey),children:[a.jsx(Si,{size:8,className:"tree-chevron"}),a.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),a.jsx("span",{className:"tree-subgroup-count",children:ye.length})]}),!Le&&a.jsx("div",{className:"tree-subgroup-items",children:ye.map(Ge)})]})]});if(de==="app")return Oe;const zt=[...ie,...ye].map(On=>`s:${On.id}`);return a.jsx(td,{items:zt,strategy:mm,children:Oe})}return a.jsxs("div",{className:"ide-sidebar",ref:wt,children:[a.jsxs("div",{className:"sidebar-header",children:[a.jsx("span",{className:"sidebar-header-title",children:"Workspaces"}),a.jsxs("div",{className:"sidebar-header-actions",children:[a.jsx("button",{className:`sidebar-add sidebar-filter${se?" active":""}`,title:se?`Show automatic sessions (${gn.size} hidden)`:"Hide automatic sessions — the ones mini apps run on their own. Sessions you message, stop, rewind, rename or star stay visible.","aria-label":se?"Show automatic sessions":"Hide automatic sessions","aria-pressed":se,onClick:Ct,children:se?a.jsx(s1,{size:14}):a.jsx(mr,{size:14})}),a.jsx("button",{className:"sidebar-add",title:"Add workspace",onClick:()=>m(),children:a.jsx(dr,{size:14})})]})]}),a.jsxs(Av,{sensors:$t,collisionDetection:hv,onDragStart:hs,onDragEnd:ts,children:[ln.length===0?a.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):ln.map(A=>{const de=Z.has(A.path),ie=Ue.get(A.path)??[],ye=new Set(ie.map(Oe=>Oe.id)),Le=gm(A,ie,ye,Q),Ge=Le[Le.length-1];return a.jsxs("div",{className:`tree-section ${de?"collapsed":""}`,children:[a.jsxs("div",{className:"tree-section-header",onClick:()=>tt(A.path),onContextMenu:Oe=>{Oe.preventDefault(),pe({x:Oe.clientX,y:Oe.clientY,type:"workspace",path:A.path})},children:[a.jsx(Si,{size:9,className:"tree-chevron"}),a.jsx(gl,{size:14}),a.jsx("span",{className:"tree-section-label",children:A.label}),a.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:Oe=>{Oe.stopPropagation(),g(A.path)},children:a.jsx(dr,{size:11})}),a.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:Oe=>{Oe.stopPropagation(),ps(A.path)},children:a.jsx(Du,{size:11})}),a.jsx("span",{className:"tree-count",children:A.sessions.length})]}),!de&&a.jsxs("div",{className:"tree-children",children:[a.jsx(td,{items:ie.map(Oe=>`f:${Oe.id}`),strategy:mm,children:Le.filter(Oe=>Oe.folder).map(Oe=>a.jsx($S,{folder:Oe.folder,count:Oe.sessions.length,collapsed:Oe.hidden,renaming:(Ne==null?void 0:Ne.kind)==="folder"&&Ne.id===Oe.folder.id,renameValue:Ae,renameRef:tn,onRenameValue:Ee,onRenameConfirm:Mn,onRenameCancel:Dn,onToggle:()=>gt(Oe.folder.id),onCtxMenu:zt=>{zt.preventDefault(),pe({x:zt.clientX,y:zt.clientY,type:"folder",folderId:Oe.folder.id,folderName:Oe.folder.name})},children:a.jsx(ym,{id:`c:${A.path}|${Oe.folder.id}`,children:Lt(Oe)})},Oe.folder.id))}),a.jsx(ym,{id:`c:${A.path}|root`,children:Lt(Ge)})]})]},A.path)}),a.jsx(yS,{children:at&&a.jsxs("div",{className:"drag-overlay",children:[at.kind==="folder"&&a.jsx(gl,{size:12}),a.jsx("span",{children:at.label})]})})]}),a.jsxs("div",{className:"sidebar-apps",children:[a.jsxs("div",{className:"sidebar-header sidebar-apps-header",children:[a.jsx("span",{className:"sidebar-header-title",children:"Apps"}),a.jsx("button",{className:"sidebar-add",title:"Add mini app",onClick:()=>we(),children:a.jsx(dr,{size:14})})]}),G.length===0&&a.jsx("div",{className:"tree-empty",children:"No apps yet"}),G.map(A=>{const de=vn(A.id),ie=de.sessions.length>0&&!de.hidden;return a.jsxs("div",{className:"sidebar-app-block",children:[a.jsxs("div",{className:`sidebar-app-row${te===A.id?" active":""}`,title:A.description??void 0,onClick:()=>he(A.id),onContextMenu:ye=>{ye.preventDefault(),pe({x:ye.clientX,y:ye.clientY,type:"app",appId:A.id,appPinned:A.pinned})},children:[de.sessions.length>0&&a.jsx("button",{className:`sidebar-app-chevron${ie?"":" closed"}`,title:"Edit sessions of this app",onClick:ye=>{ye.stopPropagation(),an(A.id)},children:a.jsx(Si,{size:10,className:"tree-chevron"})}),a.jsx(ji,{iconNode:A.iconNode,size:14,className:"sidebar-app-icon"}),a.jsx("span",{className:"tree-label",children:A.title}),de.sessions.length>0&&a.jsx("span",{className:"sidebar-app-count",children:de.sessions.length}),A.pinned&&a.jsx(vl,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]}),ie&&a.jsx("div",{className:"sidebar-app-edits",children:Lt(de,"app")})]},A.id)})]}),a.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[a.jsx(Du,{size:14}),a.jsx("span",{children:"Add workspace"})]}),X&&a.jsxs("div",{ref:Ht,className:"ctx-menu",style:{position:"fixed",left:X.x,top:X.y,zIndex:500},children:[X.type==="workspace"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{g(X.path),pe(null)},children:[a.jsx(dr,{size:12})," New Session"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ps(X.path),pe(null)},children:[a.jsx(Du,{size:12})," New Folder"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{v(X.path),pe(null)},children:[a.jsx(Jg,{size:12})," Import Claude Code Sessions…"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{p(X.path),pe(null)},children:[a.jsx(us,{size:12})," Hide Workspace"]})]}),X.type==="folder"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{dt("folder",X.folderId,X.folderName??""),pe(null)},children:[a.jsx(il,{size:12})," Rename Folder"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{M(X.folderId),pe(null)},children:[a.jsx(us,{size:12})," Delete Folder"]})]}),X.type==="session"&&!X.multi&&a.jsx(a.Fragment,{children:X.sessionLifecycle!=="finished"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{dt("session",X.sessionId,X.sessionTitle??""),pe(null)},children:[a.jsx(il,{size:12})," Rename"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{y(X.sessionId),pe(null)},children:[a.jsx(ml,{size:12})," Mark as Finished"]}),a.jsxs("div",{className:`ctx-menu-item${X.sessionExternalId?"":" ctx-disabled"}`,title:X.sessionExternalId?void 0:"Session not started",onClick:()=>{X.sessionExternalId&&(Io(X.sessionExternalId),pe(null))},children:[a.jsx(Eo,{size:12})," Copy Session ID"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{d(X.sessionId),pe(null)},children:[a.jsx(us,{size:12})," Delete Session"]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{_(X.sessionId),pe(null)},children:[a.jsx(_o,{size:12})," Reopen"]}),a.jsxs("div",{className:`ctx-menu-item${X.sessionExternalId?"":" ctx-disabled"}`,title:X.sessionExternalId?void 0:"Session not started",onClick:()=>{X.sessionExternalId&&(Io(X.sessionExternalId),pe(null))},children:[a.jsx(Eo,{size:12})," Copy Session ID"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{d(X.sessionId),pe(null)},children:[a.jsx(us,{size:12})," Delete Session"]})]})}),X.type==="session"&&X.multi&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-header",children:[ft.length," sessions selected"]}),Gt.length>0&&a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{S(Gt),pe(null),Dt()},children:[a.jsx(ml,{size:12})," Mark ",Gt.length," as Finished"]}),vt.length>0&&a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{N(vt),pe(null),Dt()},children:[a.jsx(_o,{size:12})," Reopen ",vt.length]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{C([...lt]),pe(null),Dt()},children:[a.jsx(us,{size:12})," Delete ",ft.length," Sessions"]})]}),X.type==="app"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ue(X.appId),pe(null)},children:[a.jsx(il,{size:12})," Edit App"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Se(X.appId),pe(null)},children:[a.jsx(vl,{size:12})," ",X.appPinned?"Unpin":"Pin"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{q(X.appId),pe(null)},children:[a.jsx(us,{size:12})," Delete App"]})]})]})]})}const Qa=4,FS=({transform:t})=>({...t,y:0});function xm({tabKey:t,title:s,active:r,icon:o,badge:l,onSelect:u,onClose:d,onMenu:p}){const{attributes:g,listeners:m,setNodeRef:v,transform:k,transition:y,isDragging:S}=Od({id:t});return a.jsxs("div",{ref:v,style:{transform:js.Translate.toString(k),transition:y},className:`ide-tab ${r?"active":""} ${S?"dragging":""}`,title:s,...g,...m,onClick:u,onMouseDown:T=>{T.button===1&&T.preventDefault()},onAuxClick:T=>{T.button===1&&d()},onContextMenu:T=>{T.preventDefault(),T.stopPropagation(),p(T.clientX,T.clientY)},children:[o,s,l,a.jsx("span",{className:"ide-tab-close",onClick:T=>{T.stopPropagation(),d()},children:a.jsx(Tn,{size:12})})]})}function US({menu:t,tabs:s,onDone:r}){const o=I(k=>k.closeTabs),l=I(k=>k.reopenClosedTab),u=I(k=>k.closedTabs.some(y=>Ig(k,y.key))),d=x.useRef(null),[p,g]=x.useState({left:t.x,top:t.y});Do(d,r,!0),Ni(r,!0),x.useLayoutEffect(()=>{if(!d.current)return;const{width:k,height:y}=d.current.getBoundingClientRect();g({left:Math.max(Qa,Math.min(t.x,window.innerWidth-k-Qa)),top:Math.max(Qa,Math.min(t.y,window.innerHeight-y-Qa))})},[t.x,t.y]);const m=t.key!==null&&s.includes(t.key)?t.key:null,v=(k,y,S=!1)=>a.jsx("div",{role:"menuitem","aria-disabled":S,className:`ctx-menu-item ${S?"ctx-disabled":""}`,onClick:()=>{S||(y(),r())},children:k});return a.jsxs("div",{ref:d,role:"menu",className:"ctx-menu",style:{position:"fixed",...p,zIndex:500},children:[m!==null&&a.jsxs(a.Fragment,{children:[v("Close",()=>o([m])),v("Close Others",()=>o(s.filter(k=>k!==m)),s.length<2),v("Close to the Right",()=>o(s.slice(s.indexOf(m)+1)),s.at(-1)===m),v("Close All",()=>o(s))]}),v("Reopen Closed Tab",l,!u)]})}function BS(){const t=I(D=>D.tabOrder),s=I(D=>D.activeSessionId),r=I(D=>D.sessions),o=I(D=>D.backgroundTasks),l=I(D=>D.selectSession),u=I(D=>D.closeTab),d=I(D=>D.setShowNewSessionDialog),p=I(D=>D.apps),g=I(D=>D.activeAppTabId),m=I(D=>D.openAppTab),v=I(D=>D.closeAppTab),k=I(D=>D.moveTab),[y,S]=x.useState(null),T=x.useRef(null),_=pv(fv(zl,{activationConstraint:{distance:5}})),N=wd({activeSessionId:s,activeAppTabId:g});x.useEffect(()=>{var D,K,G;(G=(K=(D=T.current)==null?void 0:D.querySelector(".ide-tab.active"))==null?void 0:K.scrollIntoView)==null||G.call(K,{block:"nearest",inline:"nearest"})},[N]);const C=t.filter(D=>{const{kind:K,id:G}=fr(D);return K==="app"||r.some($=>$.id===G)}),R=({active:D,over:K})=>{K&&k(String(D.id),String(K.id))},H=D=>{D.preventDefault(),S({x:D.clientX,y:D.clientY,key:null})},M=D=>{var ue;const{kind:K,id:G}=fr(D),$=(Se,q)=>S({x:Se,y:q,key:D});if(K==="app"){const Se=p.find(q=>q.id===G);return a.jsx(xm,{tabKey:D,title:(Se==null?void 0:Se.title)??G,active:g===G,icon:a.jsx(ji,{iconNode:Se==null?void 0:Se.iconNode,size:12,className:"miniapp-tab-icon"}),onSelect:()=>m(G),onClose:()=>v(G),onMenu:$},D)}const te=r.find(Se=>Se.id===G);if(!te)return null;const he=Dl(te,((ue=o[G])==null?void 0:ue.length)??0);return a.jsx(xm,{tabKey:D,title:te.title||G.slice(0,8),active:s===G&&g==null,icon:a.jsx(_d,{iconClass:he.iconClass,iconText:he.iconText,size:14}),badge:he.dot&&a.jsx(Ed,{status:he.dot,title:he.dotTitle}),onSelect:()=>void l(G),onClose:()=>u(G),onMenu:$},D)};return a.jsxs(Av,{sensors:_,collisionDetection:hv,modifiers:[FS],onDragEnd:R,children:[a.jsx(td,{items:C,strategy:SS,children:a.jsxs("div",{ref:T,className:"ide-tabs",onContextMenu:H,onWheel:D=>{D.deltaX===0&&(D.currentTarget.scrollLeft+=D.deltaY)},children:[C.map(M),a.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>d(!0),children:a.jsx(dr,{size:14})})]})}),y&&a.jsx(US,{menu:y,tabs:C,onDone:()=>S(null)})]})}function $d(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ur=$d();function zv(t){Ur=t}var So={exec:()=>null};function nt(t,s=""){let r=typeof t=="string"?t:t.source;const o={replace:(l,u)=>{let d=typeof u=="string"?u:u.source;return d=d.replace(bn.caret,"$1"),r=r.replace(l,d),o},getRegex:()=>new RegExp(r,s)};return o}var bn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},WS=/^(?:[ \t]*(?:\n|$))+/,HS=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,VS=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Fo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,GS=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,zd=/(?:[*+-]|\d{1,9}[.)])/,Fv=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Uv=nt(Fv).replace(/bull/g,zd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),KS=nt(Fv).replace(/bull/g,zd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Fd=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,qS=/^[^\n]+/,Ud=/(?!\s*\])(?:\\.|[^\[\]\\])+/,YS=nt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ud).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),XS=nt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,zd).getRegex(),Bl="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Bd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,QS=nt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Bd).replace("tag",Bl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Bv=nt(Fd).replace("hr",Fo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Bl).getRegex(),ZS=nt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Bv).getRegex(),Wd={blockquote:ZS,code:HS,def:YS,fences:VS,heading:GS,hr:Fo,html:QS,lheading:Uv,list:XS,newline:WS,paragraph:Bv,table:So,text:qS},wm=nt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Fo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Bl).getRegex(),JS={...Wd,lheading:KS,table:wm,paragraph:nt(Fd).replace("hr",Fo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",wm).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Bl).getRegex()},eb={...Wd,html:nt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Bd).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:So,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:nt(Fd).replace("hr",Fo).replace("heading",` *#{1,6} *[^
445
- ]`).replace("lheading",Uv).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},tb=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,nb=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Wv=/^( {2,}|\\)\n(?!\s*$)/,sb=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Wl=/[\p{P}\p{S}]/u,Hd=/[\s\p{P}\p{S}]/u,Hv=/[^\s\p{P}\p{S}]/u,rb=nt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Hd).getRegex(),Vv=/(?!~)[\p{P}\p{S}]/u,ib=/(?!~)[\s\p{P}\p{S}]/u,ob=/(?:[^\s\p{P}\p{S}]|~)/u,ab=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Gv=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,lb=nt(Gv,"u").replace(/punct/g,Wl).getRegex(),cb=nt(Gv,"u").replace(/punct/g,Vv).getRegex(),Kv="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ub=nt(Kv,"gu").replace(/notPunctSpace/g,Hv).replace(/punctSpace/g,Hd).replace(/punct/g,Wl).getRegex(),db=nt(Kv,"gu").replace(/notPunctSpace/g,ob).replace(/punctSpace/g,ib).replace(/punct/g,Vv).getRegex(),fb=nt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Hv).replace(/punctSpace/g,Hd).replace(/punct/g,Wl).getRegex(),pb=nt(/\\(punct)/,"gu").replace(/punct/g,Wl).getRegex(),hb=nt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),mb=nt(Bd).replace("(?:-->|$)","-->").getRegex(),gb=nt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",mb).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Nl=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,vb=nt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Nl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),qv=nt(/^!?\[(label)\]\[(ref)\]/).replace("label",Nl).replace("ref",Ud).getRegex(),Yv=nt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ud).getRegex(),yb=nt("reflink|nolink(?!\\()","g").replace("reflink",qv).replace("nolink",Yv).getRegex(),Vd={_backpedal:So,anyPunctuation:pb,autolink:hb,blockSkip:ab,br:Wv,code:nb,del:So,emStrongLDelim:lb,emStrongRDelimAst:ub,emStrongRDelimUnd:fb,escape:tb,link:vb,nolink:Yv,punctuation:rb,reflink:qv,reflinkSearch:yb,tag:gb,text:sb,url:So},xb={...Vd,link:nt(/^!?\[(label)\]\((.*?)\)/).replace("label",Nl).getRegex(),reflink:nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Nl).getRegex()},rd={...Vd,emStrongRDelimAst:db,emStrongLDelim:cb,url:nt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},wb={...rd,br:nt(Wv).replace("{2,}","*").getRegex(),text:nt(rd.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Za={normal:Wd,gfm:JS,pedantic:eb},uo={normal:Vd,gfm:rd,breaks:wb,pedantic:xb},kb={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},km=t=>kb[t];function bs(t,s){if(s){if(bn.escapeTest.test(t))return t.replace(bn.escapeReplace,km)}else if(bn.escapeTestNoEncode.test(t))return t.replace(bn.escapeReplaceNoEncode,km);return t}function Sm(t){try{t=encodeURI(t).replace(bn.percentDecode,"%")}catch{return null}return t}function bm(t,s){var u;const r=t.replace(bn.findPipe,(d,p,g)=>{let m=!1,v=p;for(;--v>=0&&g[v]==="\\";)m=!m;return m?"|":" |"}),o=r.split(bn.splitPipe);let l=0;if(o[0].trim()||o.shift(),o.length>0&&!((u=o.at(-1))!=null&&u.trim())&&o.pop(),s)if(o.length>s)o.splice(s);else for(;o.length<s;)o.push("");for(;l<o.length;l++)o[l]=o[l].trim().replace(bn.slashPipe,"|");return o}function fo(t,s,r){const o=t.length;if(o===0)return"";let l=0;for(;l<o&&t.charAt(o-l-1)===s;)l++;return t.slice(0,o-l)}function Sb(t,s){if(t.indexOf(s[1])===-1)return-1;let r=0;for(let o=0;o<t.length;o++)if(t[o]==="\\")o++;else if(t[o]===s[0])r++;else if(t[o]===s[1]&&(r--,r<0))return o;return r>0?-2:-1}function Tm(t,s,r,o,l){const u=s.href,d=s.title||null,p=t[1].replace(l.other.outputLinkReplace,"$1");o.state.inLink=!0;const g={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:u,title:d,text:p,tokens:o.inlineTokens(p)};return o.state.inLink=!1,g}function bb(t,s,r){const o=t.match(r.other.indentCodeCompensation);if(o===null)return s;const l=o[1];return s.split(`
444
+ `},lk={onDragStart(t){let{active:s}=t;return"Picked up draggable item "+s.id+"."},onDragOver(t){let{active:s,over:r}=t;return r?"Draggable item "+s.id+" was moved over droppable area "+r.id+".":"Draggable item "+s.id+" is no longer over a droppable area."},onDragEnd(t){let{active:s,over:r}=t;return r?"Draggable item "+s.id+" was dropped over droppable area "+r.id:"Draggable item "+s.id+" was dropped."},onDragCancel(t){let{active:s}=t;return"Dragging was cancelled. Draggable item "+s.id+" was dropped."}};function ck(t){let{announcements:s=lk,container:r,hiddenTextDescribedById:o,screenReaderInstructions:l=ak}=t;const{announce:u,announcement:d}=rk(),p=$o("DndLiveRegion"),[g,m]=x.useState(!1);if(x.useEffect(()=>{m(!0)},[]),ik(x.useMemo(()=>({onDragStart(k){let{active:y}=k;u(s.onDragStart({active:y}))},onDragMove(k){let{active:y,over:S}=k;s.onDragMove&&u(s.onDragMove({active:y,over:S}))},onDragOver(k){let{active:y,over:S}=k;u(s.onDragOver({active:y,over:S}))},onDragEnd(k){let{active:y,over:S}=k;u(s.onDragEnd({active:y,over:S}))},onDragCancel(k){let{active:y,over:S}=k;u(s.onDragCancel({active:y,over:S}))}}),[u,s])),!g)return null;const v=lt.createElement(lt.Fragment,null,lt.createElement(nk,{id:o,value:l.draggable}),lt.createElement(sk,{id:p,announcement:d}));return r?go.createPortal(v,r):v}var Wt;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Wt||(Wt={}));function Tl(){}function mv(t,s){return x.useMemo(()=>({sensor:t,options:s??{}}),[t,s])}function gv(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];return x.useMemo(()=>[...s].filter(o=>o!=null),[...s])}const ps=Object.freeze({x:0,y:0});function uk(t,s){return Math.sqrt(Math.pow(t.x-s.x,2)+Math.pow(t.y-s.y,2))}function dk(t,s){const r=bl(t);if(!r)return"0 0";const o={x:(r.x-s.left)/s.width*100,y:(r.y-s.top)/s.height*100};return o.x+"% "+o.y+"%"}function fk(t,s){let{data:{value:r}}=t,{data:{value:o}}=s;return r-o}function pk(t,s){let{data:{value:r}}=t,{data:{value:o}}=s;return o-r}function hk(t,s){if(!t||t.length===0)return null;const[r]=t;return r[s]}function rm(t,s,r){return s===void 0&&(s=t.left),r===void 0&&(r=t.top),{x:s+t.width*.5,y:r+t.height*.5}}const vv=t=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=t;const l=rm(s,s.left,s.top),u=[];for(const d of o){const{id:p}=d,g=r.get(p);if(g){const m=uk(rm(g),l);u.push({id:p,data:{droppableContainer:d,value:m}})}}return u.sort(fk)};function mk(t,s){const r=Math.max(s.top,t.top),o=Math.max(s.left,t.left),l=Math.min(s.left+s.width,t.left+t.width),u=Math.min(s.top+s.height,t.top+t.height),d=l-o,p=u-r;if(o<l&&r<u){const g=s.width*s.height,m=t.width*t.height,v=d*p,k=v/(g+m-v);return Number(k.toFixed(4))}return 0}const gk=t=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=t;const l=[];for(const u of o){const{id:d}=u,p=r.get(d);if(p){const g=mk(p,s);g>0&&l.push({id:d,data:{droppableContainer:u,value:g}})}}return l.sort(pk)};function vk(t,s,r){return{...t,scaleX:s&&r?s.width/r.width:1,scaleY:s&&r?s.height/r.height:1}}function yv(t,s){return t&&s?{x:t.left-s.left,y:t.top-s.top}:ps}function yk(t){return function(r){for(var o=arguments.length,l=new Array(o>1?o-1:0),u=1;u<o;u++)l[u-1]=arguments[u];return l.reduce((d,p)=>({...d,top:d.top+t*p.y,bottom:d.bottom+t*p.y,left:d.left+t*p.x,right:d.right+t*p.x}),{...r})}}const xk=yk(1);function xv(t){if(t.startsWith("matrix3d(")){const s=t.slice(9,-1).split(/, /);return{x:+s[12],y:+s[13],scaleX:+s[0],scaleY:+s[5]}}else if(t.startsWith("matrix(")){const s=t.slice(7,-1).split(/, /);return{x:+s[4],y:+s[5],scaleX:+s[0],scaleY:+s[3]}}return null}function wk(t,s,r){const o=xv(s);if(!o)return t;const{scaleX:l,scaleY:u,x:d,y:p}=o,g=t.left-d-(1-l)*parseFloat(r),m=t.top-p-(1-u)*parseFloat(r.slice(r.indexOf(" ")+1)),v=l?t.width/l:t.width,k=u?t.height/u:t.height;return{width:v,height:k,top:m,right:g+v,bottom:m+k,left:g}}const kk={ignoreTransform:!1};function _i(t,s){s===void 0&&(s=kk);let r=t.getBoundingClientRect();if(s.ignoreTransform){const{transform:m,transformOrigin:v}=Nn(t).getComputedStyle(t);m&&(r=wk(r,m,v))}const{top:o,left:l,width:u,height:d,bottom:p,right:g}=r;return{top:o,left:l,width:u,height:d,bottom:p,right:g}}function im(t){return _i(t,{ignoreTransform:!0})}function Sk(t){const s=t.innerWidth,r=t.innerHeight;return{top:0,left:0,right:s,bottom:r,width:s,height:r}}function bk(t,s){return s===void 0&&(s=Nn(t).getComputedStyle(t)),s.position==="fixed"}function Tk(t,s){s===void 0&&(s=Nn(t).getComputedStyle(t));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(l=>{const u=s[l];return typeof u=="string"?r.test(u):!1})}function Md(t,s){const r=[];function o(l){if(s!=null&&r.length>=s||!l)return r;if(Id(l)&&l.scrollingElement!=null&&!r.includes(l.scrollingElement))return r.push(l.scrollingElement),r;if(!Oo(l)||fv(l)||r.includes(l))return r;const u=Nn(t).getComputedStyle(l);return l!==t&&Tk(l,u)&&r.push(l),bk(l,u)?r:o(l.parentNode)}return t?o(t):r}function wv(t){const[s]=Md(t,1);return s??null}function $u(t){return!zl||!t?null:Ci(t)?t:Ad(t)?Id(t)||t===Ei(t).scrollingElement?window:Oo(t)?t:null:null}function kv(t){return Ci(t)?t.scrollX:t.scrollLeft}function Sv(t){return Ci(t)?t.scrollY:t.scrollTop}function ed(t){return{x:kv(t),y:Sv(t)}}var Jt;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Jt||(Jt={}));function bv(t){return!zl||!t?!1:t===document.scrollingElement}function Tv(t){const s={x:0,y:0},r=bv(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},o={x:t.scrollWidth-r.width,y:t.scrollHeight-r.height},l=t.scrollTop<=s.y,u=t.scrollLeft<=s.x,d=t.scrollTop>=o.y,p=t.scrollLeft>=o.x;return{isTop:l,isLeft:u,isBottom:d,isRight:p,maxScroll:o,minScroll:s}}const Nk={x:.2,y:.2};function jk(t,s,r,o,l){let{top:u,left:d,right:p,bottom:g}=r;o===void 0&&(o=10),l===void 0&&(l=Nk);const{isTop:m,isBottom:v,isLeft:k,isRight:y}=Tv(t),S={x:0,y:0},T={x:0,y:0},_={height:s.height*l.y,width:s.width*l.x};return!m&&u<=s.top+_.height?(S.y=Jt.Backward,T.y=o*Math.abs((s.top+_.height-u)/_.height)):!v&&g>=s.bottom-_.height&&(S.y=Jt.Forward,T.y=o*Math.abs((s.bottom-_.height-g)/_.height)),!y&&p>=s.right-_.width?(S.x=Jt.Forward,T.x=o*Math.abs((s.right-_.width-p)/_.width)):!k&&d<=s.left+_.width&&(S.x=Jt.Backward,T.x=o*Math.abs((s.left+_.width-d)/_.width)),{direction:S,speed:T}}function Ck(t){if(t===document.scrollingElement){const{innerWidth:u,innerHeight:d}=window;return{top:0,left:0,right:u,bottom:d,width:u,height:d}}const{top:s,left:r,right:o,bottom:l}=t.getBoundingClientRect();return{top:s,left:r,right:o,bottom:l,width:t.clientWidth,height:t.clientHeight}}function Nv(t){return t.reduce((s,r)=>bi(s,ed(r)),ps)}function Ek(t){return t.reduce((s,r)=>s+kv(r),0)}function _k(t){return t.reduce((s,r)=>s+Sv(r),0)}function jv(t,s){if(s===void 0&&(s=_i),!t)return;const{top:r,left:o,bottom:l,right:u}=s(t);wv(t)&&(l<=0||u<=0||r>=window.innerHeight||o>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const Rk=[["x",["left","right"],Ek],["y",["top","bottom"],_k]];class Dd{constructor(s,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=Md(r),l=Nv(o);this.rect={...s},this.width=s.width,this.height=s.height;for(const[u,d,p]of Rk)for(const g of d)Object.defineProperty(this,g,{get:()=>{const m=p(o),v=l[u]-m;return this.rect[g]+v},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class xo{constructor(s){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...r)})},this.target=s}add(s,r,o){var l;(l=this.target)==null||l.addEventListener(s,r,o),this.listeners.push([s,r,o])}}function Ak(t){const{EventTarget:s}=Nn(t);return t instanceof s?t:Ei(t)}function zu(t,s){const r=Math.abs(t.x),o=Math.abs(t.y);return typeof s=="number"?Math.sqrt(r**2+o**2)>s:"x"in s&&"y"in s?r>s.x&&o>s.y:"x"in s?r>s.x:"y"in s?o>s.y:!1}var es;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(es||(es={}));function om(t){t.preventDefault()}function Ik(t){t.stopPropagation()}var tt;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(tt||(tt={}));const Cv={start:[tt.Space,tt.Enter],cancel:[tt.Esc],end:[tt.Space,tt.Enter,tt.Tab]},Mk=(t,s)=>{let{currentCoordinates:r}=s;switch(t.code){case tt.Right:return{...r,x:r.x+25};case tt.Left:return{...r,x:r.x-25};case tt.Down:return{...r,y:r.y+25};case tt.Up:return{...r,y:r.y-25}}};class Ev{constructor(s){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=s;const{event:{target:r}}=s;this.props=s,this.listeners=new xo(Ei(r)),this.windowListeners=new xo(Nn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(es.Resize,this.handleCancel),this.windowListeners.add(es.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(es.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:s,onStart:r}=this.props,o=s.node.current;o&&jv(o),r(ps)}handleKeyDown(s){if(Ul(s)){const{active:r,context:o,options:l}=this.props,{keyboardCodes:u=Cv,coordinateGetter:d=Mk,scrollBehavior:p="smooth"}=l,{code:g}=s;if(u.end.includes(g)){this.handleEnd(s);return}if(u.cancel.includes(g)){this.handleCancel(s);return}const{collisionRect:m}=o.current,v=m?{x:m.left,y:m.top}:ps;this.referenceCoordinates||(this.referenceCoordinates=v);const k=d(s,{active:r,context:o.current,currentCoordinates:v});if(k){const y=Sl(k,v),S={x:0,y:0},{scrollableAncestors:T}=o.current;for(const _ of T){const N=s.code,{isTop:E,isRight:j,isLeft:W,isBottom:A,maxScroll:D,minScroll:G}=Tv(_),V=Ck(_),$={x:Math.min(N===tt.Right?V.right-V.width/2:V.right,Math.max(N===tt.Right?V.left:V.left+V.width/2,k.x)),y:Math.min(N===tt.Down?V.bottom-V.height/2:V.bottom,Math.max(N===tt.Down?V.top:V.top+V.height/2,k.y))},te=N===tt.Right&&!j||N===tt.Left&&!W,me=N===tt.Down&&!A||N===tt.Up&&!E;if(te&&$.x!==k.x){const de=_.scrollLeft+y.x,je=N===tt.Right&&de<=D.x||N===tt.Left&&de>=G.x;if(je&&!y.y){_.scrollTo({left:de,behavior:p});return}je?S.x=_.scrollLeft-de:S.x=N===tt.Right?_.scrollLeft-D.x:_.scrollLeft-G.x,S.x&&_.scrollBy({left:-S.x,behavior:p});break}else if(me&&$.y!==k.y){const de=_.scrollTop+y.y,je=N===tt.Down&&de<=D.y||N===tt.Up&&de>=G.y;if(je&&!y.x){_.scrollTo({top:de,behavior:p});return}je?S.y=_.scrollTop-de:S.y=N===tt.Down?_.scrollTop-D.y:_.scrollTop-G.y,S.y&&_.scrollBy({top:-S.y,behavior:p});break}}this.handleMove(s,bi(Sl(k,this.referenceCoordinates),S))}}}handleMove(s,r){const{onMove:o}=this.props;s.preventDefault(),o(r)}handleEnd(s){const{onEnd:r}=this.props;s.preventDefault(),this.detach(),r()}handleCancel(s){const{onCancel:r}=this.props;s.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Ev.activators=[{eventName:"onKeyDown",handler:(t,s,r)=>{let{keyboardCodes:o=Cv,onActivation:l}=s,{active:u}=r;const{code:d}=t.nativeEvent;if(o.start.includes(d)){const p=u.activatorNode.current;return p&&t.target!==p?!1:(t.preventDefault(),l==null||l({event:t.nativeEvent}),!0)}return!1}}];function am(t){return!!(t&&"distance"in t)}function lm(t){return!!(t&&"delay"in t)}class Ld{constructor(s,r,o){var l;o===void 0&&(o=Ak(s.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=s,this.events=r;const{event:u}=s,{target:d}=u;this.props=s,this.events=r,this.document=Ei(d),this.documentListeners=new xo(this.document),this.listeners=new xo(o),this.windowListeners=new xo(Nn(d)),this.initialCoordinates=(l=bl(u))!=null?l:ps,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:s,props:{options:{activationConstraint:r,bypassActivationConstraint:o}}}=this;if(this.listeners.add(s.move.name,this.handleMove,{passive:!1}),this.listeners.add(s.end.name,this.handleEnd),s.cancel&&this.listeners.add(s.cancel.name,this.handleCancel),this.windowListeners.add(es.Resize,this.handleCancel),this.windowListeners.add(es.DragStart,om),this.windowListeners.add(es.VisibilityChange,this.handleCancel),this.windowListeners.add(es.ContextMenu,om),this.documentListeners.add(es.Keydown,this.handleKeydown),r){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(lm(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(am(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(s,r){const{active:o,onPending:l}=this.props;l(o,s,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:s}=this,{onStart:r}=this.props;s&&(this.activated=!0,this.documentListeners.add(es.Click,Ik,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(es.SelectionChange,this.removeTextSelection),r(s))}handleMove(s){var r;const{activated:o,initialCoordinates:l,props:u}=this,{onMove:d,options:{activationConstraint:p}}=u;if(!l)return;const g=(r=bl(s))!=null?r:ps,m=Sl(l,g);if(!o&&p){if(am(p)){if(p.tolerance!=null&&zu(m,p.tolerance))return this.handleCancel();if(zu(m,p.distance))return this.handleStart()}if(lm(p)&&zu(m,p.tolerance))return this.handleCancel();this.handlePending(p,m);return}s.cancelable&&s.preventDefault(),d(g)}handleEnd(){const{onAbort:s,onEnd:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleCancel(){const{onAbort:s,onCancel:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleKeydown(s){s.code===tt.Esc&&this.handleCancel()}removeTextSelection(){var s;(s=this.document.getSelection())==null||s.removeAllRanges()}}const Dk={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Bl extends Ld{constructor(s){const{event:r}=s,o=Ei(r.target);super(s,Dk,o)}}Bl.activators=[{eventName:"onPointerDown",handler:(t,s)=>{let{nativeEvent:r}=t,{onActivation:o}=s;return!r.isPrimary||r.button!==0?!1:(o==null||o({event:r}),!0)}}];const Lk={move:{name:"mousemove"},end:{name:"mouseup"}};var td;(function(t){t[t.RightClick=2]="RightClick"})(td||(td={}));class Ok extends Ld{constructor(s){super(s,Lk,Ei(s.event.target))}}Ok.activators=[{eventName:"onMouseDown",handler:(t,s)=>{let{nativeEvent:r}=t,{onActivation:o}=s;return r.button===td.RightClick?!1:(o==null||o({event:r}),!0)}}];const Fu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Pk extends Ld{constructor(s){super(s,Fu)}static setup(){return window.addEventListener(Fu.move.name,s,{capture:!1,passive:!1}),function(){window.removeEventListener(Fu.move.name,s)};function s(){}}}Pk.activators=[{eventName:"onTouchStart",handler:(t,s)=>{let{nativeEvent:r}=t,{onActivation:o}=s;const{touches:l}=r;return l.length>1?!1:(o==null||o({event:r}),!0)}}];var wo;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(wo||(wo={}));var Nl;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Nl||(Nl={}));function $k(t){let{acceleration:s,activator:r=wo.Pointer,canScroll:o,draggingRect:l,enabled:u,interval:d=5,order:p=Nl.TreeOrder,pointerCoordinates:g,scrollableAncestors:m,scrollableAncestorRects:v,delta:k,threshold:y}=t;const S=Fk({delta:k,disabled:!u}),[T,_]=Q1(),N=x.useRef({x:0,y:0}),E=x.useRef({x:0,y:0}),j=x.useMemo(()=>{switch(r){case wo.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case wo.DraggableRect:return l}},[r,l,g]),W=x.useRef(null),A=x.useCallback(()=>{const G=W.current;if(!G)return;const V=N.current.x*E.current.x,$=N.current.y*E.current.y;G.scrollBy(V,$)},[]),D=x.useMemo(()=>p===Nl.TreeOrder?[...m].reverse():m,[p,m]);x.useEffect(()=>{if(!u||!m.length||!j){_();return}for(const G of D){if((o==null?void 0:o(G))===!1)continue;const V=m.indexOf(G),$=v[V];if(!$)continue;const{direction:te,speed:me}=jk(G,$,j,s,y);for(const de of["x","y"])S[de][te[de]]||(me[de]=0,te[de]=0);if(me.x>0||me.y>0){_(),W.current=G,T(A,d),N.current=me,E.current=te;return}}N.current={x:0,y:0},E.current={x:0,y:0},_()},[s,A,o,_,u,d,JSON.stringify(j),JSON.stringify(S),T,m,D,v,JSON.stringify(y)])}const zk={x:{[Jt.Backward]:!1,[Jt.Forward]:!1},y:{[Jt.Backward]:!1,[Jt.Forward]:!1}};function Fk(t){let{delta:s,disabled:r}=t;const o=kl(s);return Po(l=>{if(r||!o||!l)return zk;const u={x:Math.sign(s.x-o.x),y:Math.sign(s.y-o.y)};return{x:{[Jt.Backward]:l.x[Jt.Backward]||u.x===-1,[Jt.Forward]:l.x[Jt.Forward]||u.x===1},y:{[Jt.Backward]:l.y[Jt.Backward]||u.y===-1,[Jt.Forward]:l.y[Jt.Forward]||u.y===1}}},[r,s,o])}function Uk(t,s){const r=s!=null?t.get(s):void 0,o=r?r.node.current:null;return Po(l=>{var u;return s==null?null:(u=o??l)!=null?u:null},[o,s])}function Bk(t,s){return x.useMemo(()=>t.reduce((r,o)=>{const{sensor:l}=o,u=l.activators.map(d=>({eventName:d.eventName,handler:s(d.handler,o)}));return[...r,...u]},[]),[t,s])}var Ao;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Ao||(Ao={}));var nd;(function(t){t.Optimized="optimized"})(nd||(nd={}));const cm=new Map;function Wk(t,s){let{dragging:r,dependencies:o,config:l}=s;const[u,d]=x.useState(null),{frequency:p,measure:g,strategy:m}=l,v=x.useRef(t),k=N(),y=Ro(k),S=x.useCallback(function(E){E===void 0&&(E=[]),!y.current&&d(j=>j===null?E:j.concat(E.filter(W=>!j.includes(W))))},[y]),T=x.useRef(null),_=Po(E=>{if(k&&!r)return cm;if(!E||E===cm||v.current!==t||u!=null){const j=new Map;for(let W of t){if(!W)continue;if(u&&u.length>0&&!u.includes(W.id)&&W.rect.current){j.set(W.id,W.rect.current);continue}const A=W.node.current,D=A?new Dd(g(A),A):null;W.rect.current=D,D&&j.set(W.id,D)}return j}return E},[t,u,r,k,g]);return x.useEffect(()=>{v.current=t},[t]),x.useEffect(()=>{k||S()},[r,k]),x.useEffect(()=>{u&&u.length>0&&d(null)},[JSON.stringify(u)]),x.useEffect(()=>{k||typeof p!="number"||T.current!==null||(T.current=setTimeout(()=>{S(),T.current=null},p))},[p,k,S,...o]),{droppableRects:_,measureDroppableContainers:S,measuringScheduled:u!=null};function N(){switch(m){case Ao.Always:return!1;case Ao.BeforeDragging:return r;default:return!r}}}function Od(t,s){return Po(r=>t?r||(typeof s=="function"?s(t):t):null,[s,t])}function Hk(t,s){return Od(t,s)}function Vk(t){let{callback:s,disabled:r}=t;const o=Fl(s),l=x.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,r]);return x.useEffect(()=>()=>l==null?void 0:l.disconnect(),[l]),l}function Wl(t){let{callback:s,disabled:r}=t;const o=Fl(s),l=x.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[r]);return x.useEffect(()=>()=>l==null?void 0:l.disconnect(),[l]),l}function Gk(t){return new Dd(_i(t),t)}function um(t,s,r){s===void 0&&(s=Gk);const[o,l]=x.useState(null);function u(){l(g=>{if(!t)return null;if(t.isConnected===!1){var m;return(m=g??r)!=null?m:null}const v=s(t);return JSON.stringify(g)===JSON.stringify(v)?g:v})}const d=Vk({callback(g){if(t)for(const m of g){const{type:v,target:k}=m;if(v==="childList"&&k instanceof HTMLElement&&k.contains(t)){u();break}}}}),p=Wl({callback:u});return fs(()=>{u(),t?(p==null||p.observe(t),d==null||d.observe(document.body,{childList:!0,subtree:!0})):(p==null||p.disconnect(),d==null||d.disconnect())},[t]),o}function Kk(t){const s=Od(t);return yv(t,s)}const dm=[];function qk(t){const s=x.useRef(t),r=Po(o=>t?o&&o!==dm&&t&&s.current&&t.parentNode===s.current.parentNode?o:Md(t):dm,[t]);return x.useEffect(()=>{s.current=t},[t]),r}function Yk(t){const[s,r]=x.useState(null),o=x.useRef(t),l=x.useCallback(u=>{const d=$u(u.target);d&&r(p=>p?(p.set(d,ed(d)),new Map(p)):null)},[]);return x.useEffect(()=>{const u=o.current;if(t!==u){d(u);const p=t.map(g=>{const m=$u(g);return m?(m.addEventListener("scroll",l,{passive:!0}),[m,ed(m)]):null}).filter(g=>g!=null);r(p.length?new Map(p):null),o.current=t}return()=>{d(t),d(u)};function d(p){p.forEach(g=>{const m=$u(g);m==null||m.removeEventListener("scroll",l)})}},[l,t]),x.useMemo(()=>t.length?s?Array.from(s.values()).reduce((u,d)=>bi(u,d),ps):Nv(t):ps,[t,s])}function fm(t,s){s===void 0&&(s=[]);const r=x.useRef(null);return x.useEffect(()=>{r.current=null},s),x.useEffect(()=>{const o=t!==ps;o&&!r.current&&(r.current=t),!o&&r.current&&(r.current=null)},[t]),r.current?Sl(t,r.current):ps}function Xk(t){x.useEffect(()=>{if(!zl)return;const s=t.map(r=>{let{sensor:o}=r;return o.setup==null?void 0:o.setup()});return()=>{for(const r of s)r==null||r()}},t.map(s=>{let{sensor:r}=s;return r}))}function Qk(t,s){return x.useMemo(()=>t.reduce((r,o)=>{let{eventName:l,handler:u}=o;return r[l]=d=>{u(d,s)},r},{}),[t,s])}function _v(t){return x.useMemo(()=>t?Sk(t):null,[t])}const pm=[];function Zk(t,s){s===void 0&&(s=_i);const[r]=t,o=_v(r?Nn(r):null),[l,u]=x.useState(pm);function d(){u(()=>t.length?t.map(g=>bv(g)?o:new Dd(s(g),g)):pm)}const p=Wl({callback:d});return fs(()=>{p==null||p.disconnect(),d(),t.forEach(g=>p==null?void 0:p.observe(g))},[t]),l}function Rv(t){if(!t)return null;if(t.children.length>1)return t;const s=t.children[0];return Oo(s)?s:t}function Jk(t){let{measure:s}=t;const[r,o]=x.useState(null),l=x.useCallback(m=>{for(const{target:v}of m)if(Oo(v)){o(k=>{const y=s(v);return k?{...k,width:y.width,height:y.height}:y});break}},[s]),u=Wl({callback:l}),d=x.useCallback(m=>{const v=Rv(m);u==null||u.disconnect(),v&&(u==null||u.observe(v)),o(v?s(v):null)},[s,u]),[p,g]=wl(d);return x.useMemo(()=>({nodeRef:p,rect:r,setRef:g}),[r,p,g])}const eS=[{sensor:Bl,options:{}},{sensor:Ev,options:{}}],tS={current:{}},al={draggable:{measure:im},droppable:{measure:im,strategy:Ao.WhileDragging,frequency:nd.Optimized},dragOverlay:{measure:_i}};class ko extends Map{get(s){var r;return s!=null&&(r=super.get(s))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(s=>{let{disabled:r}=s;return!r})}getNodeFor(s){var r,o;return(r=(o=this.get(s))==null?void 0:o.node.current)!=null?r:void 0}}const nS={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ko,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Tl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:al,measureDroppableContainers:Tl,windowRect:null,measuringScheduled:!1},Av={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Tl,draggableNodes:new Map,over:null,measureDroppableContainers:Tl},zo=x.createContext(Av),Iv=x.createContext(nS);function sS(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ko}}}function rS(t,s){switch(s.type){case Wt.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:s.initialCoordinates,active:s.active}};case Wt.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:s.coordinates.x-t.draggable.initialCoordinates.x,y:s.coordinates.y-t.draggable.initialCoordinates.y}}};case Wt.DragEnd:case Wt.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Wt.RegisterDroppable:{const{element:r}=s,{id:o}=r,l=new ko(t.droppable.containers);return l.set(o,r),{...t,droppable:{...t.droppable,containers:l}}}case Wt.SetDroppableDisabled:{const{id:r,key:o,disabled:l}=s,u=t.droppable.containers.get(r);if(!u||o!==u.key)return t;const d=new ko(t.droppable.containers);return d.set(r,{...u,disabled:l}),{...t,droppable:{...t.droppable,containers:d}}}case Wt.UnregisterDroppable:{const{id:r,key:o}=s,l=t.droppable.containers.get(r);if(!l||o!==l.key)return t;const u=new ko(t.droppable.containers);return u.delete(r),{...t,droppable:{...t.droppable,containers:u}}}default:return t}}function iS(t){let{disabled:s}=t;const{active:r,activatorEvent:o,draggableNodes:l}=x.useContext(zo),u=kl(o),d=kl(r==null?void 0:r.id);return x.useEffect(()=>{if(!s&&!o&&u&&d!=null){if(!Ul(u)||document.activeElement===u.target)return;const p=l.get(d);if(!p)return;const{activatorNode:g,node:m}=p;if(!g.current&&!m.current)return;requestAnimationFrame(()=>{for(const v of[g.current,m.current]){if(!v)continue;const k=ek(v);if(k){k.focus();break}}})}},[o,s,l,d,u]),null}function Mv(t,s){let{transform:r,...o}=s;return t!=null&&t.length?t.reduce((l,u)=>u({transform:l,...o}),r):r}function oS(t){return x.useMemo(()=>({draggable:{...al.draggable,...t==null?void 0:t.draggable},droppable:{...al.droppable,...t==null?void 0:t.droppable},dragOverlay:{...al.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function aS(t){let{activeNode:s,measure:r,initialRect:o,config:l=!0}=t;const u=x.useRef(!1),{x:d,y:p}=typeof l=="boolean"?{x:l,y:l}:l;fs(()=>{if(!d&&!p||!s){u.current=!1;return}if(u.current||!o)return;const m=s==null?void 0:s.node.current;if(!m||m.isConnected===!1)return;const v=r(m),k=yv(v,o);if(d||(k.x=0),p||(k.y=0),u.current=!0,Math.abs(k.x)>0||Math.abs(k.y)>0){const y=wv(m);y&&y.scrollBy({top:k.y,left:k.x})}},[s,d,p,o,r])}const Hl=x.createContext({...ps,scaleX:1,scaleY:1});var cr;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(cr||(cr={}));const Dv=x.memo(function(s){var r,o,l,u;let{id:d,accessibility:p,autoScroll:g=!0,children:m,sensors:v=eS,collisionDetection:k=gk,measuring:y,modifiers:S,...T}=s;const _=x.useReducer(rS,void 0,sS),[N,E]=_,[j,W]=ok(),[A,D]=x.useState(cr.Uninitialized),G=A===cr.Initialized,{draggable:{active:V,nodes:$,translate:te},droppable:{containers:me}}=N,de=V!=null?$.get(V):null,je=x.useRef({initial:null,translated:null}),K=x.useMemo(()=>{var Qe;return V!=null?{id:V,data:(Qe=de==null?void 0:de.data)!=null?Qe:tS,rect:je}:null},[V,de]),be=x.useRef(null),[Z,oe]=x.useState(null),[ae,z]=x.useState(null),Q=Ro(T,Object.values(T)),q=$o("DndDescribedBy",d),M=x.useMemo(()=>me.getEnabled(),[me]),P=oS(y),{droppableRects:le,measureDroppableContainers:ge,measuringScheduled:X}=Wk(M,{dragging:G,dependencies:[te.x,te.y],config:P.droppable}),pe=Uk($,V),Te=x.useMemo(()=>ae?bl(ae):null,[ae]),se=vn(),he=Hk(pe,P.draggable.measure);aS({activeNode:V!=null?$.get(V):null,config:se.layoutShiftCompensation,initialRect:he,measure:P.draggable.measure});const Se=um(pe,P.draggable.measure,he),He=um(pe?pe.parentElement:null),Re=x.useRef({activatorEvent:null,active:null,activeNode:pe,collisionRect:null,collisions:null,droppableRects:le,draggableNodes:$,draggingNode:null,draggingNodeRect:null,droppableContainers:me,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ct=me.getNodeFor((r=Re.current.over)==null?void 0:r.id),$e=Jk({measure:P.dragOverlay.measure}),en=(o=$e.nodeRef.current)!=null?o:pe,Fe=G?(l=$e.rect)!=null?l:Se:null,Ht=!!($e.nodeRef.current&&$e.rect),tn=Kk(Ht?null:Se),wt=_v(en?Nn(en):null),jt=qk(G?ct??pe:null),zt=Zk(jt),Dt=Mv(S,{transform:{x:te.x-tn.x,y:te.y-tn.y,scaleX:1,scaleY:1},activatorEvent:ae,active:K,activeNodeRect:Se,containerNodeRect:He,draggingNodeRect:Fe,over:Re.current.over,overlayNodeRect:$e.rect,scrollableAncestors:jt,scrollableAncestorRects:zt,windowRect:wt}),Y=Te?bi(Te,te):null,ve=Yk(jt),Ue=fm(ve),nt=fm(ve,[Se]),mt=bi(Dt,Ue),gt=Fe?xk(Fe,Dt):null,Ct=K&&gt?k({active:K,collisionRect:gt,droppableRects:le,droppableContainers:M,pointerCoordinates:Y}):null,an=hk(Ct,"id"),[dt,Mn]=x.useState(null),Dn=Ht?Dt:bi(Dt,nt),hs=vk(Dn,(u=dt==null?void 0:dt.rect)!=null?u:null,Se),ms=x.useRef(null),ts=x.useCallback((Qe,Et)=>{let{sensor:ft,options:Gt}=Et;if(be.current==null)return;const vt=$.get(be.current);if(!vt)return;const yt=Qe.nativeEvent,at=new ft({active:be.current,activeNode:vt,event:yt,options:Gt,context:Re,onAbort(rt){if(!$.get(rt))return;const{onDragAbort:R}=Q.current,fe={id:rt};R==null||R(fe),j({type:"onDragAbort",event:fe})},onPending(rt,Lt,R,fe){if(!$.get(rt))return;const{onDragPending:we}=Q.current,Le={id:rt,constraint:Lt,initialCoordinates:R,offset:fe};we==null||we(Le),j({type:"onDragPending",event:Le})},onStart(rt){const Lt=be.current;if(Lt==null)return;const R=$.get(Lt);if(!R)return;const{onDragStart:fe}=Q.current,ie={activatorEvent:yt,active:{id:Lt,data:R.data,rect:je}};go.unstable_batchedUpdates(()=>{fe==null||fe(ie),D(cr.Initializing),E({type:Wt.DragStart,initialCoordinates:rt,active:Lt}),j({type:"onDragStart",event:ie}),oe(ms.current),z(yt)})},onMove(rt){E({type:Wt.DragMove,coordinates:rt})},onEnd:Kt(Wt.DragEnd),onCancel:Kt(Wt.DragCancel)});ms.current=at;function Kt(rt){return async function(){const{active:R,collisions:fe,over:ie,scrollAdjustedTranslate:we}=Re.current;let Le=null;if(R&&we){const{cancelDrop:Ke}=Q.current;Le={activatorEvent:yt,active:R,collisions:fe,delta:we,over:ie},rt===Wt.DragEnd&&typeof Ke=="function"&&await Promise.resolve(Ke(Le))&&(rt=Wt.DragCancel)}be.current=null,go.unstable_batchedUpdates(()=>{E({type:rt}),D(cr.Uninitialized),Mn(null),oe(null),z(null),ms.current=null;const Ke=rt===Wt.DragEnd?"onDragEnd":"onDragCancel";if(Le){const Oe=Q.current[Ke];Oe==null||Oe(Le),j({type:Ke,event:Le})}})}}},[$]),Ln=x.useCallback((Qe,Et)=>(ft,Gt)=>{const vt=ft.nativeEvent,yt=$.get(Gt);if(be.current!==null||!yt||vt.dndKit||vt.defaultPrevented)return;const at={active:yt};Qe(ft,Et.options,at)===!0&&(vt.dndKit={capturedBy:Et.sensor},be.current=Gt,ts(ft,Et))},[$,ts]),gn=Bk(v,Ln);Xk(v),fs(()=>{Se&&A===cr.Initializing&&D(cr.Initialized)},[Se,A]),x.useEffect(()=>{const{onDragMove:Qe}=Q.current,{active:Et,activatorEvent:ft,collisions:Gt,over:vt}=Re.current;if(!Et||!ft)return;const yt={active:Et,activatorEvent:ft,collisions:Gt,delta:{x:mt.x,y:mt.y},over:vt};go.unstable_batchedUpdates(()=>{Qe==null||Qe(yt),j({type:"onDragMove",event:yt})})},[mt.x,mt.y]),x.useEffect(()=>{const{active:Qe,activatorEvent:Et,collisions:ft,droppableContainers:Gt,scrollAdjustedTranslate:vt}=Re.current;if(!Qe||be.current==null||!Et||!vt)return;const{onDragOver:yt}=Q.current,at=Gt.get(an),Kt=at&&at.rect.current?{id:at.id,rect:at.rect.current,data:at.data,disabled:at.disabled}:null,rt={active:Qe,activatorEvent:Et,collisions:ft,delta:{x:vt.x,y:vt.y},over:Kt};go.unstable_batchedUpdates(()=>{Mn(Kt),yt==null||yt(rt),j({type:"onDragOver",event:rt})})},[an]),fs(()=>{Re.current={activatorEvent:ae,active:K,activeNode:pe,collisionRect:gt,collisions:Ct,droppableRects:le,draggableNodes:$,draggingNode:en,draggingNodeRect:Fe,droppableContainers:me,over:dt,scrollableAncestors:jt,scrollAdjustedTranslate:mt},je.current={initial:Fe,translated:gt}},[K,pe,Ct,gt,$,en,Fe,le,me,dt,jt,mt]),$k({...se,delta:te,draggingRect:gt,pointerCoordinates:Y,scrollableAncestors:jt,scrollableAncestorRects:zt});const ln=x.useMemo(()=>({active:K,activeNode:pe,activeNodeRect:Se,activatorEvent:ae,collisions:Ct,containerNodeRect:He,dragOverlay:$e,draggableNodes:$,droppableContainers:me,droppableRects:le,over:dt,measureDroppableContainers:ge,scrollableAncestors:jt,scrollableAncestorRects:zt,measuringConfiguration:P,measuringScheduled:X,windowRect:wt}),[K,pe,Se,ae,Ct,He,$e,$,me,le,dt,ge,jt,zt,P,X,wt]),Vt=x.useMemo(()=>({activatorEvent:ae,activators:gn,active:K,activeNodeRect:Se,ariaDescribedById:{draggable:q},dispatch:E,draggableNodes:$,over:dt,measureDroppableContainers:ge}),[ae,gn,K,Se,E,q,$,dt,ge]);return lt.createElement(hv.Provider,{value:W},lt.createElement(zo.Provider,{value:Vt},lt.createElement(Iv.Provider,{value:ln},lt.createElement(Hl.Provider,{value:hs},m)),lt.createElement(iS,{disabled:(p==null?void 0:p.restoreFocus)===!1})),lt.createElement(ck,{...p,hiddenTextDescribedById:q}));function vn(){const Qe=(Z==null?void 0:Z.autoScrollEnabled)===!1,Et=typeof g=="object"?g.enabled===!1:g===!1,ft=G&&!Qe&&!Et;return typeof g=="object"?{...g,enabled:ft}:{enabled:ft}}}),lS=x.createContext(null),hm="button",cS="Draggable";function uS(t){let{id:s,data:r,disabled:o=!1,attributes:l}=t;const u=$o(cS),{activators:d,activatorEvent:p,active:g,activeNodeRect:m,ariaDescribedById:v,draggableNodes:k,over:y}=x.useContext(zo),{role:S=hm,roleDescription:T="draggable",tabIndex:_=0}=l??{},N=(g==null?void 0:g.id)===s,E=x.useContext(N?Hl:lS),[j,W]=wl(),[A,D]=wl(),G=Qk(d,s),V=Ro(r);fs(()=>(k.set(s,{id:s,key:u,node:j,activatorNode:A,data:V}),()=>{const te=k.get(s);te&&te.key===u&&k.delete(s)}),[k,s]);const $=x.useMemo(()=>({role:S,tabIndex:_,"aria-disabled":o,"aria-pressed":N&&S===hm?!0:void 0,"aria-roledescription":T,"aria-describedby":v.draggable}),[o,S,_,N,T,v.draggable]);return{active:g,activatorEvent:p,activeNodeRect:m,attributes:$,isDragging:N,listeners:o?void 0:G,node:j,over:y,setNodeRef:W,setActivatorNodeRef:D,transform:E}}function Lv(){return x.useContext(Iv)}const dS="Droppable",fS={timeout:25};function Ov(t){let{data:s,disabled:r=!1,id:o,resizeObserverConfig:l}=t;const u=$o(dS),{active:d,dispatch:p,over:g,measureDroppableContainers:m}=x.useContext(zo),v=x.useRef({disabled:r}),k=x.useRef(!1),y=x.useRef(null),S=x.useRef(null),{disabled:T,updateMeasurementsFor:_,timeout:N}={...fS,...l},E=Ro(_??o),j=x.useCallback(()=>{if(!k.current){k.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{m(Array.isArray(E.current)?E.current:[E.current]),S.current=null},N)},[N]),W=Wl({callback:j,disabled:T||!d}),A=x.useCallback(($,te)=>{W&&(te&&(W.unobserve(te),k.current=!1),$&&W.observe($))},[W]),[D,G]=wl(A),V=Ro(s);return x.useEffect(()=>{!W||!D.current||(W.disconnect(),k.current=!1,W.observe(D.current))},[D,W]),x.useEffect(()=>(p({type:Wt.RegisterDroppable,element:{id:o,key:u,disabled:r,node:D,rect:y,data:V}}),()=>p({type:Wt.UnregisterDroppable,key:u,id:o})),[o]),x.useEffect(()=>{r!==v.current.disabled&&(p({type:Wt.SetDroppableDisabled,id:o,key:u,disabled:r}),v.current.disabled=r)},[o,u,r,p]),{active:d,rect:y,isOver:(g==null?void 0:g.id)===o,node:D,over:g,setNodeRef:G}}function pS(t){let{animation:s,children:r}=t;const[o,l]=x.useState(null),[u,d]=x.useState(null),p=kl(r);return!r&&!o&&p&&l(p),fs(()=>{if(!u)return;const g=o==null?void 0:o.key,m=o==null?void 0:o.props.id;if(g==null||m==null){l(null);return}Promise.resolve(s(m,u)).then(()=>{l(null)})},[s,o,u]),lt.createElement(lt.Fragment,null,r,o?x.cloneElement(o,{ref:d}):null)}const hS={x:0,y:0,scaleX:1,scaleY:1};function mS(t){let{children:s}=t;return lt.createElement(zo.Provider,{value:Av},lt.createElement(Hl.Provider,{value:hS},s))}const gS={position:"fixed",touchAction:"none"},vS=t=>Ul(t)?"transform 250ms ease":void 0,yS=x.forwardRef((t,s)=>{let{as:r,activatorEvent:o,adjustScale:l,children:u,className:d,rect:p,style:g,transform:m,transition:v=vS}=t;if(!p)return null;const k=l?m:{...m,scaleX:1,scaleY:1},y={...gS,width:p.width,height:p.height,top:p.top,left:p.left,transform:js.Transform.toString(k),transformOrigin:l&&o?dk(o,p):void 0,transition:typeof v=="function"?v(o):v,...g};return lt.createElement(r,{className:d,style:y,ref:s},u)}),xS=t=>s=>{let{active:r,dragOverlay:o}=s;const l={},{styles:u,className:d}=t;if(u!=null&&u.active)for(const[p,g]of Object.entries(u.active))g!==void 0&&(l[p]=r.node.style.getPropertyValue(p),r.node.style.setProperty(p,g));if(u!=null&&u.dragOverlay)for(const[p,g]of Object.entries(u.dragOverlay))g!==void 0&&o.node.style.setProperty(p,g);return d!=null&&d.active&&r.node.classList.add(d.active),d!=null&&d.dragOverlay&&o.node.classList.add(d.dragOverlay),function(){for(const[g,m]of Object.entries(l))r.node.style.setProperty(g,m);d!=null&&d.active&&r.node.classList.remove(d.active)}},wS=t=>{let{transform:{initial:s,final:r}}=t;return[{transform:js.Transform.toString(s)},{transform:js.Transform.toString(r)}]},kS={duration:250,easing:"ease",keyframes:wS,sideEffects:xS({styles:{active:{opacity:"0"}}})};function SS(t){let{config:s,draggableNodes:r,droppableContainers:o,measuringConfiguration:l}=t;return Fl((u,d)=>{if(s===null)return;const p=r.get(u);if(!p)return;const g=p.node.current;if(!g)return;const m=Rv(d);if(!m)return;const{transform:v}=Nn(d).getComputedStyle(d),k=xv(v);if(!k)return;const y=typeof s=="function"?s:bS(s);return jv(g,l.draggable.measure),y({active:{id:u,data:p.data,node:g,rect:l.draggable.measure(g)},draggableNodes:r,dragOverlay:{node:d,rect:l.dragOverlay.measure(m)},droppableContainers:o,measuringConfiguration:l,transform:k})})}function bS(t){const{duration:s,easing:r,sideEffects:o,keyframes:l}={...kS,...t};return u=>{let{active:d,dragOverlay:p,transform:g,...m}=u;if(!s)return;const v={x:p.rect.left-d.rect.left,y:p.rect.top-d.rect.top},k={scaleX:g.scaleX!==1?d.rect.width*g.scaleX/p.rect.width:1,scaleY:g.scaleY!==1?d.rect.height*g.scaleY/p.rect.height:1},y={x:g.x-v.x,y:g.y-v.y,...k},S=l({...m,active:d,dragOverlay:p,transform:{initial:g,final:y}}),[T]=S,_=S[S.length-1];if(JSON.stringify(T)===JSON.stringify(_))return;const N=o==null?void 0:o({active:d,dragOverlay:p,...m}),E=p.node.animate(S,{duration:s,easing:r,fill:"forwards"});return new Promise(j=>{E.onfinish=()=>{N==null||N(),j()}})}}let mm=0;function TS(t){return x.useMemo(()=>{if(t!=null)return mm++,mm},[t])}const NS=lt.memo(t=>{let{adjustScale:s=!1,children:r,dropAnimation:o,style:l,transition:u,modifiers:d,wrapperElement:p="div",className:g,zIndex:m=999}=t;const{activatorEvent:v,active:k,activeNodeRect:y,containerNodeRect:S,draggableNodes:T,droppableContainers:_,dragOverlay:N,over:E,measuringConfiguration:j,scrollableAncestors:W,scrollableAncestorRects:A,windowRect:D}=Lv(),G=x.useContext(Hl),V=TS(k==null?void 0:k.id),$=Mv(d,{activatorEvent:v,active:k,activeNodeRect:y,containerNodeRect:S,draggingNodeRect:N.rect,over:E,overlayNodeRect:N.rect,scrollableAncestors:W,scrollableAncestorRects:A,transform:G,windowRect:D}),te=Od(y),me=SS({config:o,draggableNodes:T,droppableContainers:_,measuringConfiguration:j}),de=te?N.setRef:void 0;return lt.createElement(mS,null,lt.createElement(pS,{animation:me},k&&V?lt.createElement(yS,{key:V,id:k.id,ref:de,as:p,activatorEvent:v,adjustScale:s,className:g,transition:u,rect:te,style:{zIndex:m,...l},transform:$},r):null))});function Pv(t,s,r){const o=t.slice();return o.splice(r<0?o.length+r:r,0,o.splice(s,1)[0]),o}function jS(t,s){return t.reduce((r,o,l)=>{const u=s.get(o);return u&&(r[l]=u),r},Array(t.length))}function Ga(t){return t!==null&&t>=0}function CS(t,s){if(t===s)return!0;if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==s[r])return!1;return!0}function ES(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Ka={scaleX:1,scaleY:1},_S=t=>{var s;let{rects:r,activeNodeRect:o,activeIndex:l,overIndex:u,index:d}=t;const p=(s=r[l])!=null?s:o;if(!p)return null;const g=RS(r,d,l);if(d===l){const m=r[u];return m?{x:l<u?m.left+m.width-(p.left+p.width):m.left-p.left,y:0,...Ka}:null}return d>l&&d<=u?{x:-p.width-g,y:0,...Ka}:d<l&&d>=u?{x:p.width+g,y:0,...Ka}:{x:0,y:0,...Ka}};function RS(t,s,r){const o=t[s],l=t[s-1],u=t[s+1];return!o||!l&&!u?0:r<s?l?o.left-(l.left+l.width):u.left-(o.left+o.width):u?u.left-(o.left+o.width):o.left-(l.left+l.width)}const $v=t=>{let{rects:s,activeIndex:r,overIndex:o,index:l}=t;const u=Pv(s,o,r),d=s[l],p=u[l];return!p||!d?null:{x:p.left-d.left,y:p.top-d.top,scaleX:p.width/d.width,scaleY:p.height/d.height}},qa={scaleX:1,scaleY:1},gm=t=>{var s;let{activeIndex:r,activeNodeRect:o,index:l,rects:u,overIndex:d}=t;const p=(s=u[r])!=null?s:o;if(!p)return null;if(l===r){const m=u[d];return m?{x:0,y:r<d?m.top+m.height-(p.top+p.height):m.top-p.top,...qa}:null}const g=AS(u,l,r);return l>r&&l<=d?{x:0,y:-p.height-g,...qa}:l<r&&l>=d?{x:0,y:p.height+g,...qa}:{x:0,y:0,...qa}};function AS(t,s,r){const o=t[s],l=t[s-1],u=t[s+1];return o?r<s?l?o.top-(l.top+l.height):u?u.top-(o.top+o.height):0:u?u.top-(o.top+o.height):l?o.top-(l.top+l.height):0:0}const zv="Sortable",Fv=lt.createContext({activeIndex:-1,containerId:zv,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:$v,disabled:{draggable:!1,droppable:!1}});function sd(t){let{children:s,id:r,items:o,strategy:l=$v,disabled:u=!1}=t;const{active:d,dragOverlay:p,droppableRects:g,over:m,measureDroppableContainers:v}=Lv(),k=$o(zv,r),y=p.rect!==null,S=x.useMemo(()=>o.map(G=>typeof G=="object"&&"id"in G?G.id:G),[o]),T=d!=null,_=d?S.indexOf(d.id):-1,N=m?S.indexOf(m.id):-1,E=x.useRef(S),j=!CS(S,E.current),W=N!==-1&&_===-1||j,A=ES(u);fs(()=>{j&&T&&v(S)},[j,S,T,v]),x.useEffect(()=>{E.current=S},[S]);const D=x.useMemo(()=>({activeIndex:_,containerId:k,disabled:A,disableTransforms:W,items:S,overIndex:N,useDragOverlay:y,sortedRects:jS(S,g),strategy:l}),[_,k,A.draggable,A.droppable,W,S,N,g,y,l]);return lt.createElement(Fv.Provider,{value:D},s)}const IS=t=>{let{id:s,items:r,activeIndex:o,overIndex:l}=t;return Pv(r,o,l).indexOf(s)},MS=t=>{let{containerId:s,isSorting:r,wasDragging:o,index:l,items:u,newIndex:d,previousItems:p,previousContainerId:g,transition:m}=t;return!m||!o||p!==u&&l===d?!1:r?!0:d!==l&&s===g},DS={duration:200,easing:"ease"},Uv="transform",LS=js.Transition.toString({property:Uv,duration:0,easing:"linear"}),OS={roleDescription:"sortable"};function PS(t){let{disabled:s,index:r,node:o,rect:l}=t;const[u,d]=x.useState(null),p=x.useRef(r);return fs(()=>{if(!s&&r!==p.current&&o.current){const g=l.current;if(g){const m=_i(o.current,{ignoreTransform:!0}),v={x:g.left-m.left,y:g.top-m.top,scaleX:g.width/m.width,scaleY:g.height/m.height};(v.x||v.y)&&d(v)}}r!==p.current&&(p.current=r)},[s,r,o,l]),x.useEffect(()=>{u&&d(null)},[u]),u}function Pd(t){let{animateLayoutChanges:s=MS,attributes:r,disabled:o,data:l,getNewIndex:u=IS,id:d,strategy:p,resizeObserverConfig:g,transition:m=DS}=t;const{items:v,containerId:k,activeIndex:y,disabled:S,disableTransforms:T,sortedRects:_,overIndex:N,useDragOverlay:E,strategy:j}=x.useContext(Fv),W=$S(o,S),A=v.indexOf(d),D=x.useMemo(()=>({sortable:{containerId:k,index:A,items:v},...l}),[k,l,A,v]),G=x.useMemo(()=>v.slice(v.indexOf(d)),[v,d]),{rect:V,node:$,isOver:te,setNodeRef:me}=Ov({id:d,data:D,disabled:W.droppable,resizeObserverConfig:{updateMeasurementsFor:G,...g}}),{active:de,activatorEvent:je,activeNodeRect:K,attributes:be,setNodeRef:Z,listeners:oe,isDragging:ae,over:z,setActivatorNodeRef:Q,transform:q}=uS({id:d,data:D,attributes:{...OS,...r},disabled:W.draggable}),M=X1(me,Z),P=!!de,le=P&&!T&&Ga(y)&&Ga(N),ge=!E&&ae,X=ge&&le?q:null,Te=le?X??(p??j)({rects:_,activeNodeRect:K,activeIndex:y,overIndex:N,index:A}):null,se=Ga(y)&&Ga(N)?u({id:d,items:v,activeIndex:y,overIndex:N}):A,he=de==null?void 0:de.id,Se=x.useRef({activeId:he,items:v,newIndex:se,containerId:k}),He=v!==Se.current.items,Re=s({active:de,containerId:k,isDragging:ae,isSorting:P,id:d,index:A,items:v,newIndex:Se.current.newIndex,previousItems:Se.current.items,previousContainerId:Se.current.containerId,transition:m,wasDragging:Se.current.activeId!=null}),ct=PS({disabled:!Re,index:A,node:$,rect:V});return x.useEffect(()=>{P&&Se.current.newIndex!==se&&(Se.current.newIndex=se),k!==Se.current.containerId&&(Se.current.containerId=k),v!==Se.current.items&&(Se.current.items=v)},[P,se,k,v]),x.useEffect(()=>{if(he===Se.current.activeId)return;if(he!=null&&Se.current.activeId==null){Se.current.activeId=he;return}const en=setTimeout(()=>{Se.current.activeId=he},50);return()=>clearTimeout(en)},[he]),{active:de,activeIndex:y,attributes:be,data:D,rect:V,index:A,newIndex:se,items:v,isOver:te,isSorting:P,isDragging:ae,listeners:oe,node:$,overIndex:N,over:z,setNodeRef:M,setActivatorNodeRef:Q,setDroppableNodeRef:me,setDraggableNodeRef:Z,transform:ct??Te,transition:$e()};function $e(){if(ct||He&&Se.current.newIndex===A)return LS;if(!(ge&&!Ul(je)||!m)&&(P||Re))return js.Transition.toString({...m,property:Uv})}}function $S(t,s){var r,o;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(r=t==null?void 0:t.draggable)!=null?r:s.draggable,droppable:(o=t==null?void 0:t.droppable)!=null?o:s.droppable}}tt.Down,tt.Right,tt.Up,tt.Left;function Ya(t){const[s,r]=x.useState(()=>{try{const l=localStorage.getItem(t);if(l==null)return new Set;const u=JSON.parse(l);return Array.isArray(u)?new Set(u.filter(d=>typeof d=="string")):new Set}catch{return new Set}}),o=x.useCallback(l=>{r(u=>{const d=l(new Set(u));try{localStorage.setItem(t,JSON.stringify([...d]))}catch{}return d})},[t]);return[s,o]}function zS(t,s=!1){const[r,o]=x.useState(()=>{try{const u=localStorage.getItem(t);return u==="1"?!0:u==="0"?!1:s}catch{return s}}),l=x.useCallback(u=>{o(u);try{localStorage.setItem(t,u?"1":"0")}catch{}},[t]);return[r,l]}async function Io(t){try{return await navigator.clipboard.writeText(t),!0}catch{try{const s=document.createElement("textarea");s.value=t,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();const r=document.execCommand("copy");return document.body.removeChild(s),r}catch{return!1}}}function FS(t){return t.origin_app_id!=null&&!t.user_touched&&!t.starred}const rd="(no directory)";function pr(t){return t.replaceAll("\\","/").replace(/\/+$/,"")}function id(t,s){if(!s||!t.cwd)return!1;const r=pr(t.cwd),o=pr(s);return r.startsWith(`${o}/`)}function US(t,s){const r=new Map;for(const d of s){const p=d.cwd||rd,g=r.get(p)??[];g.push(d),r.set(p,g)}const o=new Set,l=new Set(t.filter(d=>d.deleted===1).map(d=>d.path)),u=[];for(const d of t){if(d.deleted===1){o.add(d.path);continue}o.add(d.path),u.push({path:d.path,label:d.label||d.path.split("/").pop()||d.path,sessions:r.get(d.path)??[],workspace:d})}for(const[d,p]of r)o.has(d)||l.has(d)||u.push({path:d,label:d===rd?"Other":d.split("/").pop()||d,sessions:p,workspace:null});return u}function BS(t,s,r){if(s.length===0)return!1;const o=new Set(t.filter(l=>l.deleted===1).map(l=>l.path));return s.some(l=>!id(l,r)&&!o.has(l.cwd||rd))}function jl(t){return[...t].sort((s,r)=>r.sort_order-s.sort_order||(s.created_at<r.created_at?1:-1))}function vm(t,s,r,o){const l=s.map(u=>({folder:u,sessions:t.sessions.filter(d=>d.folder_id===u.id),finishedKey:`folder:${u.id}:finished`,hidden:o.has(u.id)}));return l.push({folder:null,sessions:t.sessions.filter(u=>!(u.folder_id&&r.has(u.folder_id))),finishedKey:`${t.path}:finished`,hidden:!1}),l}function ym(t,s){return{working:jl(t.sessions.filter(r=>r.lifecycle!=="finished")),finished:jl(t.sessions.filter(r=>r.lifecycle==="finished")),finishedCollapsed:s.has(t.finishedKey)}}function Xa(t,s){return t.folder_id&&s.has(t.folder_id)?t.folder_id:null}function WS(t){const s=new Set(t.map(o=>o.name));if(!s.has("New Folder"))return"New Folder";let r=2;for(;s.has(`New Folder ${r}`);)r++;return`New Folder ${r}`}function xm({id:t,children:s,className:r}){const{setNodeRef:o,isOver:l}=Ov({id:t});return a.jsx("div",{ref:o,className:`${r??""}${l?" drop-over":""}`,children:s})}function $d({inputRef:t,value:s,onChange:r,onConfirm:o,onCancel:l}){return a.jsx("input",{ref:t,className:"tree-rename-input",value:s,onChange:u=>r(u.target.value),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),onKeyDown:u=>{u.key==="Enter"&&o(),u.key==="Escape"&&l()},onBlur:o})}function HS({s:t,backgroundTaskCount:s,isActive:r,isSelected:o,originApp:l,renaming:u,renameValue:d,renameRef:p,onRenameValue:g,onRenameConfirm:m,onRenameCancel:v,onSelect:k,onCtxMenu:y,onToggleStar:S}){const{attributes:T,listeners:_,setNodeRef:N,transform:E,transition:j,isDragging:W}=Pd({id:`s:${t.id}`}),A=Pl(t,s);return a.jsxs("div",{ref:N,style:{transform:js.Transform.toString(E),transition:j},className:`tree-item ${r?"active":""}${o?" selected":""} ${A.isFinished?"tree-item-finished":""}${W?" dragging":""}${t.starred?" tree-item-starred":""}`,...T,..._,onClick:k,onContextMenu:y,children:[a.jsx(Rd,{iconClass:A.iconClass,iconText:A.iconText,size:16}),l&&a.jsx("span",{className:"tree-app-badge",title:"Created by a mini app",children:a.jsx(ji,{iconNode:l.iconNode,size:10})}),u?a.jsx($d,{inputRef:p,value:d,onChange:g,onConfirm:m,onCancel:v}):a.jsx("span",{className:"tree-label",children:t.title||t.id.slice(0,8)}),!u&&a.jsx("button",{className:`star-btn${t.starred?" starred":""}`,title:t.starred?"Unstar session":"Star session",onClick:D=>{D.stopPropagation(),S()},onPointerDown:D=>D.stopPropagation(),children:a.jsx(xl,{size:10,fill:t.starred?"currentColor":"none"})}),A.dot&&a.jsx(_d,{status:A.dot,title:A.dotTitle})]})}function VS({folder:t,count:s,collapsed:r,renaming:o,renameValue:l,renameRef:u,onRenameValue:d,onRenameConfirm:p,onRenameCancel:g,onToggle:m,onCtxMenu:v,children:k}){const{attributes:y,listeners:S,setNodeRef:T,transform:_,transition:N,isDragging:E,over:j}=Pd({id:`f:${t.id}`}),W=j!=null&&String(j.id).startsWith("s:");return a.jsxs("div",{ref:T,style:{transform:js.Transform.toString(_),transition:N},className:`tree-folder ${r?"collapsed":""}${E?" dragging":""}`,children:[a.jsx("div",{className:`tree-folder-header${W?" drop-over":""}`,...y,...S,onClick:()=>{o||m()},onContextMenu:v,children:o?a.jsx($d,{inputRef:u,value:l,onChange:d,onConfirm:p,onCancel:g}):a.jsxs(a.Fragment,{children:[a.jsx(Si,{size:8,className:"tree-chevron"}),a.jsx(yl,{size:12}),a.jsx("span",{className:"tree-folder-label",children:t.name}),a.jsx("span",{className:"tree-count",children:s})]})}),!r&&a.jsx("div",{className:"tree-folder-children",children:k})]})}function GS(){const t=I(R=>R.sessions),s=I(R=>R.backgroundTasks),r=I(R=>R.workspaces),o=I(R=>R.folders),l=I(R=>R.activeSessionId),u=I(R=>R.selectSession),d=I(R=>R.deleteSession),p=I(R=>R.removeWorkspace),g=I(R=>R.createSessionInWorkspace),m=I(R=>R.pickAndAddWorkspace),v=I(R=>R.setImportSessionsWorkspace),k=I(R=>R.renameSession),y=I(R=>R.markFinished),S=I(R=>R.markFinishedMany),T=I(R=>R.toggleStar),_=I(R=>R.reopenSession),N=I(R=>R.reopenSessionMany),E=I(R=>R.deleteSessionMany),j=I(R=>R.createSidebarFolder),W=I(R=>R.renameFolder),A=I(R=>R.deleteFolder),D=I(R=>R.applyMoves),G=I(R=>R.reorderFolders),V=I(R=>R.apps),$=I(R=>R.appsRootPath),te=I(R=>R.activeAppTabId),me=I(R=>R.openAppTab),de=I(R=>R.startAppEdit),je=I(R=>R.toggleAppPin),K=I(R=>R.deleteApp),be=I(R=>R.openAppCatalog),[Z,oe]=Ya("agentpane:sidebar-ws-collapsed"),[ae,z]=Ya("agentpane:sidebar-sub-collapsed"),[Q,q]=Ya("agentpane:sidebar-folders-collapsed"),[M,P]=Ya("agentpane:sidebar-app-edits-collapsed"),[le,ge]=zS("agentpane:sidebar-hide-auto-sessions"),[X,pe]=x.useState(null),[Te,se]=x.useState(null),[he,Se]=x.useState(""),[He,Re]=x.useState(null),[ct,$e]=x.useState(new Set),[en,Fe]=x.useState(null),Ht=x.useRef(null),tn=x.useRef(null),wt=x.useRef(null),jt=x.useRef(!1),zt=gv(mv(Bl,{activationConstraint:{distance:5}}));function Dt(){$e(new Set),Fe(null)}Do(Ht,()=>pe(null),!!X),Ni(()=>{pe(null),Dt()},!!X||ct.size>0),x.useLayoutEffect(()=>{const R=Ht.current;if(!X||!R)return;const fe=8,{offsetWidth:ie,offsetHeight:we}=R,Le=X.x+ie>window.innerWidth-fe?Math.max(fe,X.x-ie):X.x,Ke=X.y+we>window.innerHeight-fe?Math.max(fe,X.y-we):X.y;R.style.left=`${Le}px`,R.style.top=`${Ke}px`},[X]);const Y=x.useMemo(()=>new Map(t.map(R=>[R.id,R])),[t]),ve=x.useMemo(()=>new Map(o.map(R=>[R.id,R])),[o]),Ue=x.useMemo(()=>{const R=new Map;for(const fe of[...o].sort((ie,we)=>ie.sort_order-we.sort_order)){const ie=R.get(fe.workspace_path)??[];ie.push(fe),R.set(fe.workspace_path,ie)}return R},[o]);function nt(R){oe(fe=>{const ie=new Set(fe);return ie.has(R)?ie.delete(R):ie.add(R),ie})}function mt(R){z(fe=>{const ie=new Set(fe);return ie.has(R)?ie.delete(R):ie.add(R),ie})}function gt(R){q(fe=>{const ie=new Set(fe);return ie.has(R)?ie.delete(R):ie.add(R),ie})}function Ct(){ge(!le),Dt()}function an(R){P(fe=>{const ie=new Set(fe);return ie.has(R)?ie.delete(R):ie.add(R),ie})}x.useEffect(()=>{Te&&tn.current&&(tn.current.focus(),tn.current.select())},[Te]),x.useEffect(()=>{var R,fe,ie;jt.current||!l||(jt.current=!0,(ie=(fe=(R=wt.current)==null?void 0:R.querySelector(".tree-item.active, .sidebar-app-edit-row.active"))==null?void 0:fe.scrollIntoView)==null||ie.call(fe,{block:"nearest"}))},[l]);function dt(R,fe,ie,we=""){se({kind:R,id:fe}),Se(ie||we)}function Mn(){if(Te){const R=he.trim();R&&(Te.kind==="session"?k(Te.id,R):W(Te.id,R))}se(null)}function Dn(){se(null),Se("")}async function hs(R){const fe=WS(Ue.get(R)??[]),ie=await j(R,fe);ie&&dt("folder",ie.id,ie.name)}function ms(R){const fe=String(R.active.id);if(fe.startsWith("s:")){const ie=Y.get(fe.slice(2));ie&&Re({kind:"session",label:ie.title||ie.id.slice(0,8)})}else if(fe.startsWith("f:")){const ie=ve.get(fe.slice(2));ie&&Re({kind:"folder",label:ie.name})}}function ts(R){Re(null);const{active:fe,over:ie}=R;if(!ie)return;const we=String(fe.id),Le=String(ie.id);if(we.startsWith("s:")){const Ke=Y.get(we.slice(2));if(!Ke)return;const Oe=Ke.cwd||"(no directory)",Ft=Xa(Ke,ve);let On,Be;if(Le.startsWith("f:")){const Ze=ve.get(Le.slice(2));if(!Ze)return;On=Ze.workspace_path,Be=Ze.id}else if(Le.startsWith("s:")){const Ze=Y.get(Le.slice(2));if(!Ze)return;On=Ze.cwd||"(no directory)",Be=Xa(Ze,ve)}else if(Le.startsWith("c:")){const Ze=Le.slice(2),_t=Ze.lastIndexOf("|");On=Ze.slice(0,_t);const vs=Ze.slice(_t+1);Be=vs==="root"?null:vs}else return;if(On!==Oe)return;const yn=jl(t.filter(Ze=>(Ze.cwd||"(no directory)")===On&&Xa(Ze,ve)===Be)),Cs=yn.filter(Ze=>Ze.id!==Ke.id);let Us=Cs.length;if(Le.startsWith("s:")){const Ze=Cs.findIndex(_t=>_t.id===Le.slice(2));Ze>=0&&(Us=Ze)}const Pn=[...Cs.slice(0,Us),Ke,...Cs.slice(Us)],gs=[];if(Be===Ft){if(Pn.length===yn.length&&Pn.every((Ze,_t)=>Ze.id===yn[_t].id))return;Pn.forEach((Ze,_t)=>gs.push({id:Ze.id,folder_id:Be,sort_order:Pn.length-1-_t}))}else{const Ze=jl(t.filter(_t=>(_t.cwd||"(no directory)")===Oe&&Xa(_t,ve)===Ft)).filter(_t=>_t.id!==Ke.id);Ze.forEach((_t,vs)=>gs.push({id:_t.id,folder_id:Ft,sort_order:Ze.length-1-vs})),Pn.forEach((_t,vs)=>gs.push({id:_t.id,folder_id:Be,sort_order:Pn.length-1-vs}))}D(gs);return}if(we.startsWith("f:")){if(!Le.startsWith("f:"))return;const Ke=ve.get(we.slice(2)),Oe=ve.get(Le.slice(2));if(!Ke||!Oe||Ke.id===Oe.id||Ke.workspace_path!==Oe.workspace_path)return;const Ft=(Ue.get(Ke.workspace_path)??[]).map(yn=>yn.id),On=Ft.indexOf(Ke.id),Be=Ft.indexOf(Oe.id);Ft.splice(Be,0,...Ft.splice(On,1)),G(Ft)}}const Ln=$?t.filter(R=>!id(R,$)):t,gn=new Set(le?Ln.filter(R=>FS(R)&&R.id!==l).map(R=>R.id):[]),ln=US(r,gn.size>0?Ln.filter(R=>!gn.has(R.id)):Ln),Vt=x.useMemo(()=>{const R=new Map;if(!$)return R;const fe=pr($);for(const ie of t){if(!id(ie,$))continue;const we=pr(ie.cwd).slice(fe.length+1).split("/")[0],Le=R.get(we)??[];Le.push(ie),R.set(we,Le)}return R},[t,$]);function vn(R){return{folder:null,sessions:Vt.get(R)??[],finishedKey:`app:${R}:finished`,hidden:M.has(R)}}const Qe=[],Et=R=>{if(R.hidden)return;const{working:fe,finished:ie,finishedCollapsed:we}=ym(R,ae);Qe.push(...fe.map(Le=>Le.id)),we||Qe.push(...ie.map(Le=>Le.id))};for(const R of ln){if(Z.has(R.path))continue;const fe=Ue.get(R.path)??[],ie=new Set(fe.map(we=>we.id));vm(R,fe,ie,Q).forEach(Et)}V.forEach(R=>Et(vn(R.id)));const ft=t.filter(R=>ct.has(R.id)),Gt=ft.filter(R=>R.lifecycle!=="finished").map(R=>R.id),vt=ft.filter(R=>R.lifecycle==="finished").map(R=>R.id);function yt(R,fe){if(fe.metaKey||fe.ctrlKey){fe.preventDefault(),Fe(R.id),$e(ie=>{const we=new Set(ie);return we.has(R.id)?we.delete(R.id):we.add(R.id),we});return}if(fe.shiftKey){fe.preventDefault();const ie=en??R.id;Fe(ie);const we=Qe.indexOf(ie),Le=Qe.indexOf(R.id);if(we>=0&&Le>=0){const[Ke,Oe]=we<Le?[we,Le]:[Le,we];$e(new Set(Qe.slice(Ke,Oe+1)))}return}Dt(),Fe(R.id),u(R.id)}function at(R,fe){fe.preventDefault();const ie=ct.has(R.id)&&ct.size>1;ct.has(R.id)||($e(new Set),Fe(R.id)),pe({x:fe.clientX,y:fe.clientY,type:"session",sessionId:R.id,sessionTitle:R.title,sessionLifecycle:R.lifecycle,sessionExternalId:R.external_thread_id,multi:ie})}function Kt(R){var ie;const fe=R.origin_app_id?V.find(we=>we.id===R.origin_app_id):null;return a.jsx(HS,{s:R,backgroundTaskCount:((ie=s[R.id])==null?void 0:ie.length)??0,isActive:l===R.id,isSelected:ct.has(R.id),originApp:fe??null,renaming:(Te==null?void 0:Te.kind)==="session"&&Te.id===R.id,renameValue:he,renameRef:tn,onRenameValue:Se,onRenameConfirm:Mn,onRenameCancel:Dn,onSelect:we=>yt(R,we),onToggleStar:()=>T(R.id),onCtxMenu:we=>at(R,we)},R.id)}function rt(R){var ie;const fe=Pl(R,((ie=s[R.id])==null?void 0:ie.length)??0);return a.jsxs("div",{className:`sidebar-app-edit-row${l===R.id?" active":""}${ct.has(R.id)?" selected":""}${fe.isFinished?" tree-item-finished":""}`,title:"App edit session — click to open",onClick:we=>yt(R,we),onContextMenu:we=>at(R,we),children:[a.jsx(Rd,{iconClass:fe.iconClass,iconText:fe.iconText,size:14}),(Te==null?void 0:Te.kind)==="session"&&Te.id===R.id?a.jsx($d,{inputRef:tn,value:he,onChange:Se,onConfirm:Mn,onCancel:Dn}):a.jsx("span",{className:"tree-label",children:R.title||R.id.slice(0,8)}),fe.dot&&a.jsx(_d,{status:fe.dot,title:fe.dotTitle})]},R.id)}function Lt(R,fe="workspace"){const{working:ie,finished:we,finishedCollapsed:Le}=ym(R,ae),Ke=fe==="workspace"?Kt:rt,Oe=a.jsxs(a.Fragment,{children:[ie.length===0&&we.length===0?a.jsx("div",{className:"tree-empty",children:"No sessions"}):ie.map(Ke),we.length>0&&a.jsxs("div",{className:`tree-subgroup ${Le?"collapsed":""}`,children:[a.jsxs("div",{className:"tree-subgroup-header",onClick:()=>mt(R.finishedKey),children:[a.jsx(Si,{size:8,className:"tree-chevron"}),a.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),a.jsx("span",{className:"tree-subgroup-count",children:we.length})]}),!Le&&a.jsx("div",{className:"tree-subgroup-items",children:we.map(Ke)})]})]});if(fe==="app")return Oe;const Ft=[...ie,...we].map(On=>`s:${On.id}`);return a.jsx(sd,{items:Ft,strategy:gm,children:Oe})}return a.jsxs("div",{className:"ide-sidebar",ref:wt,children:[a.jsxs("div",{className:"sidebar-header",children:[a.jsx("span",{className:"sidebar-header-title",children:"Workspaces"}),a.jsxs("div",{className:"sidebar-header-actions",children:[a.jsx("button",{className:`sidebar-add sidebar-filter${le?" active":""}`,title:le?`Show automatic sessions (${gn.size} hidden)`:"Hide automatic sessions — the ones mini apps run on their own. Sessions you message, stop, rewind, rename or star stay visible.","aria-label":le?"Show automatic sessions":"Hide automatic sessions","aria-pressed":le,onClick:Ct,children:le?a.jsx(u1,{size:14}):a.jsx(mr,{size:14})}),a.jsx("button",{className:"sidebar-add",title:"Add workspace",onClick:()=>m(),children:a.jsx(dr,{size:14})})]})]}),a.jsxs(Dv,{sensors:zt,collisionDetection:vv,onDragStart:ms,onDragEnd:ts,children:[ln.length===0?a.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):ln.map(R=>{const fe=Z.has(R.path),ie=Ue.get(R.path)??[],we=new Set(ie.map(Oe=>Oe.id)),Le=vm(R,ie,we,Q),Ke=Le[Le.length-1];return a.jsxs("div",{className:`tree-section ${fe?"collapsed":""}`,children:[a.jsxs("div",{className:"tree-section-header",onClick:()=>nt(R.path),onContextMenu:Oe=>{Oe.preventDefault(),pe({x:Oe.clientX,y:Oe.clientY,type:"workspace",path:R.path})},children:[a.jsx(Si,{size:9,className:"tree-chevron"}),a.jsx(yl,{size:14}),a.jsx("span",{className:"tree-section-label",children:R.label}),a.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:Oe=>{Oe.stopPropagation(),g(R.path)},children:a.jsx(dr,{size:11})}),a.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:Oe=>{Oe.stopPropagation(),hs(R.path)},children:a.jsx(Ou,{size:11})}),a.jsx("span",{className:"tree-count",children:R.sessions.length})]}),!fe&&a.jsxs("div",{className:"tree-children",children:[a.jsx(sd,{items:ie.map(Oe=>`f:${Oe.id}`),strategy:gm,children:Le.filter(Oe=>Oe.folder).map(Oe=>a.jsx(VS,{folder:Oe.folder,count:Oe.sessions.length,collapsed:Oe.hidden,renaming:(Te==null?void 0:Te.kind)==="folder"&&Te.id===Oe.folder.id,renameValue:he,renameRef:tn,onRenameValue:Se,onRenameConfirm:Mn,onRenameCancel:Dn,onToggle:()=>gt(Oe.folder.id),onCtxMenu:Ft=>{Ft.preventDefault(),pe({x:Ft.clientX,y:Ft.clientY,type:"folder",folderId:Oe.folder.id,folderName:Oe.folder.name})},children:a.jsx(xm,{id:`c:${R.path}|${Oe.folder.id}`,children:Lt(Oe)})},Oe.folder.id))}),a.jsx(xm,{id:`c:${R.path}|root`,children:Lt(Ke)})]})]},R.path)}),a.jsx(NS,{children:He&&a.jsxs("div",{className:"drag-overlay",children:[He.kind==="folder"&&a.jsx(yl,{size:12}),a.jsx("span",{children:He.label})]})})]}),a.jsxs("div",{className:"sidebar-apps",children:[a.jsxs("div",{className:"sidebar-header sidebar-apps-header",children:[a.jsx("span",{className:"sidebar-header-title",children:"Apps"}),a.jsx("button",{className:"sidebar-add",title:"Add mini app",onClick:()=>be(),children:a.jsx(dr,{size:14})})]}),V.length===0&&a.jsx("div",{className:"tree-empty",children:"No apps yet"}),V.map(R=>{const fe=vn(R.id),ie=fe.sessions.length>0&&!fe.hidden;return a.jsxs("div",{className:"sidebar-app-block",children:[a.jsxs("div",{className:`sidebar-app-row${te===R.id?" active":""}`,title:R.description??void 0,onClick:()=>me(R.id),onContextMenu:we=>{we.preventDefault(),pe({x:we.clientX,y:we.clientY,type:"app",appId:R.id,appPinned:R.pinned})},children:[fe.sessions.length>0&&a.jsx("button",{className:`sidebar-app-chevron${ie?"":" closed"}`,title:"Edit sessions of this app",onClick:we=>{we.stopPropagation(),an(R.id)},children:a.jsx(Si,{size:10,className:"tree-chevron"})}),a.jsx(ji,{iconNode:R.iconNode,size:14,className:"sidebar-app-icon"}),a.jsx("span",{className:"tree-label",children:R.title}),fe.sessions.length>0&&a.jsx("span",{className:"sidebar-app-count",children:fe.sessions.length}),R.pinned&&a.jsx(xl,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]}),ie&&a.jsx("div",{className:"sidebar-app-edits",children:Lt(fe,"app")})]},R.id)})]}),a.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[a.jsx(Ou,{size:14}),a.jsx("span",{children:"Add workspace"})]}),X&&a.jsxs("div",{ref:Ht,className:"ctx-menu",style:{position:"fixed",left:X.x,top:X.y,zIndex:500},children:[X.type==="workspace"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{g(X.path),pe(null)},children:[a.jsx(dr,{size:12})," New Session"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{hs(X.path),pe(null)},children:[a.jsx(Ou,{size:12})," New Folder"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{v(X.path),pe(null)},children:[a.jsx(nv,{size:12})," Import Claude Code Sessions…"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{p(X.path),pe(null)},children:[a.jsx(us,{size:12})," Hide Workspace"]})]}),X.type==="folder"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{dt("folder",X.folderId,X.folderName??""),pe(null)},children:[a.jsx(ol,{size:12})," Rename Folder"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{A(X.folderId),pe(null)},children:[a.jsx(us,{size:12})," Delete Folder"]})]}),X.type==="session"&&!X.multi&&a.jsx(a.Fragment,{children:X.sessionLifecycle!=="finished"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{dt("session",X.sessionId,X.sessionTitle??""),pe(null)},children:[a.jsx(ol,{size:12})," Rename"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{y(X.sessionId),pe(null)},children:[a.jsx(vl,{size:12})," Mark as Finished"]}),a.jsxs("div",{className:`ctx-menu-item${X.sessionExternalId?"":" ctx-disabled"}`,title:X.sessionExternalId?void 0:"Session not started",onClick:()=>{X.sessionExternalId&&(Io(X.sessionExternalId),pe(null))},children:[a.jsx(Eo,{size:12})," Copy Session ID"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{d(X.sessionId),pe(null)},children:[a.jsx(us,{size:12})," Delete Session"]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{_(X.sessionId),pe(null)},children:[a.jsx(_o,{size:12})," Reopen"]}),a.jsxs("div",{className:`ctx-menu-item${X.sessionExternalId?"":" ctx-disabled"}`,title:X.sessionExternalId?void 0:"Session not started",onClick:()=>{X.sessionExternalId&&(Io(X.sessionExternalId),pe(null))},children:[a.jsx(Eo,{size:12})," Copy Session ID"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{d(X.sessionId),pe(null)},children:[a.jsx(us,{size:12})," Delete Session"]})]})}),X.type==="session"&&X.multi&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-header",children:[ft.length," sessions selected"]}),Gt.length>0&&a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{S(Gt),pe(null),Dt()},children:[a.jsx(vl,{size:12})," Mark ",Gt.length," as Finished"]}),vt.length>0&&a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{N(vt),pe(null),Dt()},children:[a.jsx(_o,{size:12})," Reopen ",vt.length]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{E([...ct]),pe(null),Dt()},children:[a.jsx(us,{size:12})," Delete ",ft.length," Sessions"]})]}),X.type==="app"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{de(X.appId),pe(null)},children:[a.jsx(ol,{size:12})," Edit App"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{je(X.appId),pe(null)},children:[a.jsx(xl,{size:12})," ",X.appPinned?"Unpin":"Pin"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{K(X.appId),pe(null)},children:[a.jsx(us,{size:12})," Delete App"]})]})]})]})}const Qa=4,KS=({transform:t})=>({...t,y:0});function wm({tabKey:t,title:s,active:r,icon:o,badge:l,onSelect:u,onClose:d,onMenu:p}){const{attributes:g,listeners:m,setNodeRef:v,transform:k,transition:y,isDragging:S}=Pd({id:t});return a.jsxs("div",{ref:v,style:{transform:js.Translate.toString(k),transition:y},className:`ide-tab ${r?"active":""} ${S?"dragging":""}`,title:s,...g,...m,onClick:u,onMouseDown:T=>{T.button===1&&T.preventDefault()},onAuxClick:T=>{T.button===1&&d()},onContextMenu:T=>{T.preventDefault(),T.stopPropagation(),p(T.clientX,T.clientY)},children:[o,s,l,a.jsx("span",{className:"ide-tab-close",onClick:T=>{T.stopPropagation(),d()},children:a.jsx(Tn,{size:12})})]})}function qS({menu:t,tabs:s,onDone:r}){const o=I(k=>k.closeTabs),l=I(k=>k.reopenClosedTab),u=I(k=>k.closedTabs.some(y=>Dg(k,y.key))),d=x.useRef(null),[p,g]=x.useState({left:t.x,top:t.y});Do(d,r,!0),Ni(r,!0),x.useLayoutEffect(()=>{if(!d.current)return;const{width:k,height:y}=d.current.getBoundingClientRect();g({left:Math.max(Qa,Math.min(t.x,window.innerWidth-k-Qa)),top:Math.max(Qa,Math.min(t.y,window.innerHeight-y-Qa))})},[t.x,t.y]);const m=t.key!==null&&s.includes(t.key)?t.key:null,v=(k,y,S=!1)=>a.jsx("div",{role:"menuitem","aria-disabled":S,className:`ctx-menu-item ${S?"ctx-disabled":""}`,onClick:()=>{S||(y(),r())},children:k});return a.jsxs("div",{ref:d,role:"menu",className:"ctx-menu",style:{position:"fixed",...p,zIndex:500},children:[m!==null&&a.jsxs(a.Fragment,{children:[v("Close",()=>o([m])),v("Close Others",()=>o(s.filter(k=>k!==m)),s.length<2),v("Close to the Right",()=>o(s.slice(s.indexOf(m)+1)),s.at(-1)===m),v("Close All",()=>o(s))]}),v("Reopen Closed Tab",l,!u)]})}function YS(){const t=I(D=>D.tabOrder),s=I(D=>D.activeSessionId),r=I(D=>D.sessions),o=I(D=>D.backgroundTasks),l=I(D=>D.selectSession),u=I(D=>D.closeTab),d=I(D=>D.setShowNewSessionDialog),p=I(D=>D.apps),g=I(D=>D.activeAppTabId),m=I(D=>D.openAppTab),v=I(D=>D.closeAppTab),k=I(D=>D.moveTab),[y,S]=x.useState(null),T=x.useRef(null),_=gv(mv(Bl,{activationConstraint:{distance:5}})),N=kd({activeSessionId:s,activeAppTabId:g});x.useEffect(()=>{var D,G,V;(V=(G=(D=T.current)==null?void 0:D.querySelector(".ide-tab.active"))==null?void 0:G.scrollIntoView)==null||V.call(G,{block:"nearest",inline:"nearest"})},[N]);const E=t.filter(D=>{const{kind:G,id:V}=fr(D);return G==="app"||r.some($=>$.id===V)}),j=({active:D,over:G})=>{G&&k(String(D.id),String(G.id))},W=D=>{D.preventDefault(),S({x:D.clientX,y:D.clientY,key:null})},A=D=>{var de;const{kind:G,id:V}=fr(D),$=(je,K)=>S({x:je,y:K,key:D});if(G==="app"){const je=p.find(K=>K.id===V);return a.jsx(wm,{tabKey:D,title:(je==null?void 0:je.title)??V,active:g===V,icon:a.jsx(ji,{iconNode:je==null?void 0:je.iconNode,size:12,className:"miniapp-tab-icon"}),onSelect:()=>m(V),onClose:()=>v(V),onMenu:$},D)}const te=r.find(je=>je.id===V);if(!te)return null;const me=Pl(te,((de=o[V])==null?void 0:de.length)??0);return a.jsx(wm,{tabKey:D,title:te.title||V.slice(0,8),active:s===V&&g==null,icon:a.jsx(Rd,{iconClass:me.iconClass,iconText:me.iconText,size:14}),badge:me.dot&&a.jsx(_d,{status:me.dot,title:me.dotTitle}),onSelect:()=>void l(V),onClose:()=>u(V),onMenu:$},D)};return a.jsxs(Dv,{sensors:_,collisionDetection:vv,modifiers:[KS],onDragEnd:j,children:[a.jsx(sd,{items:E,strategy:_S,children:a.jsxs("div",{ref:T,className:"ide-tabs",onContextMenu:W,onWheel:D=>{D.deltaX===0&&(D.currentTarget.scrollLeft+=D.deltaY)},children:[E.map(A),a.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>d(!0),children:a.jsx(dr,{size:14})})]})}),y&&a.jsx(qS,{menu:y,tabs:E,onDone:()=>S(null)})]})}function zd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ur=zd();function Bv(t){Ur=t}var So={exec:()=>null};function st(t,s=""){let r=typeof t=="string"?t:t.source;const o={replace:(l,u)=>{let d=typeof u=="string"?u:u.source;return d=d.replace(bn.caret,"$1"),r=r.replace(l,d),o},getRegex:()=>new RegExp(r,s)};return o}var bn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},XS=/^(?:[ \t]*(?:\n|$))+/,QS=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ZS=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Fo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,JS=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Fd=/(?:[*+-]|\d{1,9}[.)])/,Wv=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Hv=st(Wv).replace(/bull/g,Fd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),eb=st(Wv).replace(/bull/g,Fd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ud=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,tb=/^[^\n]+/,Bd=/(?!\s*\])(?:\\.|[^\[\]\\])+/,nb=st(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Bd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),sb=st(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Fd).getRegex(),Vl="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Wd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,rb=st("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Wd).replace("tag",Vl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Vv=st(Ud).replace("hr",Fo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Vl).getRegex(),ib=st(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Vv).getRegex(),Hd={blockquote:ib,code:QS,def:nb,fences:ZS,heading:JS,hr:Fo,html:rb,lheading:Hv,list:sb,newline:XS,paragraph:Vv,table:So,text:tb},km=st("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Fo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Vl).getRegex(),ob={...Hd,lheading:eb,table:km,paragraph:st(Ud).replace("hr",Fo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",km).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Vl).getRegex()},ab={...Hd,html:st(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Wd).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:So,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:st(Ud).replace("hr",Fo).replace("heading",` *#{1,6} *[^
445
+ ]`).replace("lheading",Hv).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},lb=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,cb=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Gv=/^( {2,}|\\)\n(?!\s*$)/,ub=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Gl=/[\p{P}\p{S}]/u,Vd=/[\s\p{P}\p{S}]/u,Kv=/[^\s\p{P}\p{S}]/u,db=st(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Vd).getRegex(),qv=/(?!~)[\p{P}\p{S}]/u,fb=/(?!~)[\s\p{P}\p{S}]/u,pb=/(?:[^\s\p{P}\p{S}]|~)/u,hb=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Yv=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,mb=st(Yv,"u").replace(/punct/g,Gl).getRegex(),gb=st(Yv,"u").replace(/punct/g,qv).getRegex(),Xv="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",vb=st(Xv,"gu").replace(/notPunctSpace/g,Kv).replace(/punctSpace/g,Vd).replace(/punct/g,Gl).getRegex(),yb=st(Xv,"gu").replace(/notPunctSpace/g,pb).replace(/punctSpace/g,fb).replace(/punct/g,qv).getRegex(),xb=st("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Kv).replace(/punctSpace/g,Vd).replace(/punct/g,Gl).getRegex(),wb=st(/\\(punct)/,"gu").replace(/punct/g,Gl).getRegex(),kb=st(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Sb=st(Wd).replace("(?:-->|$)","-->").getRegex(),bb=st("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Sb).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Cl=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Tb=st(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Cl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Qv=st(/^!?\[(label)\]\[(ref)\]/).replace("label",Cl).replace("ref",Bd).getRegex(),Zv=st(/^!?\[(ref)\](?:\[\])?/).replace("ref",Bd).getRegex(),Nb=st("reflink|nolink(?!\\()","g").replace("reflink",Qv).replace("nolink",Zv).getRegex(),Gd={_backpedal:So,anyPunctuation:wb,autolink:kb,blockSkip:hb,br:Gv,code:cb,del:So,emStrongLDelim:mb,emStrongRDelimAst:vb,emStrongRDelimUnd:xb,escape:lb,link:Tb,nolink:Zv,punctuation:db,reflink:Qv,reflinkSearch:Nb,tag:bb,text:ub,url:So},jb={...Gd,link:st(/^!?\[(label)\]\((.*?)\)/).replace("label",Cl).getRegex(),reflink:st(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Cl).getRegex()},od={...Gd,emStrongRDelimAst:yb,emStrongLDelim:gb,url:st(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Cb={...od,br:st(Gv).replace("{2,}","*").getRegex(),text:st(od.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Za={normal:Hd,gfm:ob,pedantic:ab},uo={normal:Gd,gfm:od,breaks:Cb,pedantic:jb},Eb={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Sm=t=>Eb[t];function Ts(t,s){if(s){if(bn.escapeTest.test(t))return t.replace(bn.escapeReplace,Sm)}else if(bn.escapeTestNoEncode.test(t))return t.replace(bn.escapeReplaceNoEncode,Sm);return t}function bm(t){try{t=encodeURI(t).replace(bn.percentDecode,"%")}catch{return null}return t}function Tm(t,s){var u;const r=t.replace(bn.findPipe,(d,p,g)=>{let m=!1,v=p;for(;--v>=0&&g[v]==="\\";)m=!m;return m?"|":" |"}),o=r.split(bn.splitPipe);let l=0;if(o[0].trim()||o.shift(),o.length>0&&!((u=o.at(-1))!=null&&u.trim())&&o.pop(),s)if(o.length>s)o.splice(s);else for(;o.length<s;)o.push("");for(;l<o.length;l++)o[l]=o[l].trim().replace(bn.slashPipe,"|");return o}function fo(t,s,r){const o=t.length;if(o===0)return"";let l=0;for(;l<o&&t.charAt(o-l-1)===s;)l++;return t.slice(0,o-l)}function _b(t,s){if(t.indexOf(s[1])===-1)return-1;let r=0;for(let o=0;o<t.length;o++)if(t[o]==="\\")o++;else if(t[o]===s[0])r++;else if(t[o]===s[1]&&(r--,r<0))return o;return r>0?-2:-1}function Nm(t,s,r,o,l){const u=s.href,d=s.title||null,p=t[1].replace(l.other.outputLinkReplace,"$1");o.state.inLink=!0;const g={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:u,title:d,text:p,tokens:o.inlineTokens(p)};return o.state.inLink=!1,g}function Rb(t,s,r){const o=t.match(r.other.indentCodeCompensation);if(o===null)return s;const l=o[1];return s.split(`
446
446
  `).map(u=>{const d=u.match(r.other.beginningSpace);if(d===null)return u;const[p]=d;return p.length>=l.length?u.slice(l.length):u}).join(`
447
- `)}var jl=class{constructor(t){rt(this,"options");rt(this,"rules");rt(this,"lexer");this.options=t||Ur}space(t){const s=this.rules.block.newline.exec(t);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(t){const s=this.rules.block.code.exec(t);if(s){const r=s[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s[0],codeBlockStyle:"indented",text:this.options.pedantic?r:fo(r,`
448
- `)}}}fences(t){const s=this.rules.block.fences.exec(t);if(s){const r=s[0],o=bb(r,s[3]||"",this.rules);return{type:"code",raw:r,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:o}}}heading(t){const s=this.rules.block.heading.exec(t);if(s){let r=s[2].trim();if(this.rules.other.endingHash.test(r)){const o=fo(r,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(r=o.trim())}return{type:"heading",raw:s[0],depth:s[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const s=this.rules.block.hr.exec(t);if(s)return{type:"hr",raw:fo(s[0],`
447
+ `)}var El=class{constructor(t){it(this,"options");it(this,"rules");it(this,"lexer");this.options=t||Ur}space(t){const s=this.rules.block.newline.exec(t);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(t){const s=this.rules.block.code.exec(t);if(s){const r=s[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s[0],codeBlockStyle:"indented",text:this.options.pedantic?r:fo(r,`
448
+ `)}}}fences(t){const s=this.rules.block.fences.exec(t);if(s){const r=s[0],o=Rb(r,s[3]||"",this.rules);return{type:"code",raw:r,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:o}}}heading(t){const s=this.rules.block.heading.exec(t);if(s){let r=s[2].trim();if(this.rules.other.endingHash.test(r)){const o=fo(r,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(r=o.trim())}return{type:"heading",raw:s[0],depth:s[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const s=this.rules.block.hr.exec(t);if(s)return{type:"hr",raw:fo(s[0],`
449
449
  `)}}blockquote(t){const s=this.rules.block.blockquote.exec(t);if(s){let r=fo(s[0],`
450
450
  `).split(`
451
451
  `),o="",l="";const u=[];for(;r.length>0;){let d=!1;const p=[];let g;for(g=0;g<r.length;g++)if(this.rules.other.blockquoteStart.test(r[g]))p.push(r[g]),d=!0;else if(!d)p.push(r[g]);else break;r=r.slice(g);const m=p.join(`
@@ -458,15 +458,15 @@ ${v}`:v;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
458
458
  `+r.join(`
459
459
  `),_=this.list(T);u[u.length-1]=_,o=o.substring(0,o.length-y.raw.length)+_.raw,l=l.substring(0,l.length-S.raw.length)+_.raw,r=T.substring(u.at(-1).raw.length).split(`
460
460
  `);continue}}return{type:"blockquote",raw:o,tokens:u,text:l}}}list(t){let s=this.rules.block.list.exec(t);if(s){let r=s[1].trim();const o=r.length>1,l={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");const u=this.rules.other.listItemRegex(r);let d=!1;for(;t;){let g=!1,m="",v="";if(!(s=u.exec(t))||this.rules.block.hr.test(t))break;m=s[0],t=t.substring(m.length);let k=s[2].split(`
461
- `,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),y=t.split(`
461
+ `,1)[0].replace(this.rules.other.listReplaceTabs,E=>" ".repeat(3*E.length)),y=t.split(`
462
462
  `,1)[0],S=!k.trim(),T=0;if(this.options.pedantic?(T=2,v=k.trimStart()):S?T=s[1].length+1:(T=s[2].search(this.rules.other.nonSpaceChar),T=T>4?1:T,v=k.slice(T),T+=s[1].length),S&&this.rules.other.blankLine.test(y)&&(m+=y+`
463
- `,t=t.substring(y.length+1),g=!0),!g){const C=this.rules.other.nextBulletRegex(T),R=this.rules.other.hrRegex(T),H=this.rules.other.fencesBeginRegex(T),M=this.rules.other.headingBeginRegex(T),D=this.rules.other.htmlBeginRegex(T);for(;t;){const K=t.split(`
464
- `,1)[0];let G;if(y=K,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),G=y):G=y.replace(this.rules.other.tabCharGlobal," "),H.test(y)||M.test(y)||D.test(y)||C.test(y)||R.test(y))break;if(G.search(this.rules.other.nonSpaceChar)>=T||!y.trim())v+=`
465
- `+G.slice(T);else{if(S||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||H.test(k)||M.test(k)||R.test(k))break;v+=`
466
- `+y}!S&&!y.trim()&&(S=!0),m+=K+`
467
- `,t=t.substring(K.length+1),k=G.slice(T)}}l.loose||(d?l.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(d=!0));let _=null,N;this.options.gfm&&(_=this.rules.other.listIsTask.exec(v),_&&(N=_[0]!=="[ ] ",v=v.replace(this.rules.other.listReplaceTask,""))),l.items.push({type:"list_item",raw:m,task:!!_,checked:N,loose:!1,text:v,tokens:[]}),l.raw+=m}const p=l.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;l.raw=l.raw.trimEnd();for(let g=0;g<l.items.length;g++)if(this.lexer.state.top=!1,l.items[g].tokens=this.lexer.blockTokens(l.items[g].text,[]),!l.loose){const m=l.items[g].tokens.filter(k=>k.type==="space"),v=m.length>0&&m.some(k=>this.rules.other.anyLine.test(k.raw));l.loose=v}if(l.loose)for(let g=0;g<l.items.length;g++)l.items[g].loose=!0;return l}}html(t){const s=this.rules.block.html.exec(t);if(s)return{type:"html",block:!0,raw:s[0],pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:s[0]}}def(t){const s=this.rules.block.def.exec(t);if(s){const r=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",l=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:r,raw:s[0],href:o,title:l}}}table(t){var d;const s=this.rules.block.table.exec(t);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;const r=bm(s[1]),o=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=(d=s[3])!=null&&d.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
468
- `):[],u={type:"table",raw:s[0],header:[],align:[],rows:[]};if(r.length===o.length){for(const p of o)this.rules.other.tableAlignRight.test(p)?u.align.push("right"):this.rules.other.tableAlignCenter.test(p)?u.align.push("center"):this.rules.other.tableAlignLeft.test(p)?u.align.push("left"):u.align.push(null);for(let p=0;p<r.length;p++)u.header.push({text:r[p],tokens:this.lexer.inline(r[p]),header:!0,align:u.align[p]});for(const p of l)u.rows.push(bm(p,u.header.length).map((g,m)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:u.align[m]})));return u}}lheading(t){const s=this.rules.block.lheading.exec(t);if(s)return{type:"heading",raw:s[0],depth:s[2].charAt(0)==="="?1:2,text:s[1],tokens:this.lexer.inline(s[1])}}paragraph(t){const s=this.rules.block.paragraph.exec(t);if(s){const r=s[1].charAt(s[1].length-1)===`
469
- `?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const s=this.rules.block.text.exec(t);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(t){const s=this.rules.inline.escape.exec(t);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(t){const s=this.rules.inline.tag.exec(t);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(t){const s=this.rules.inline.link.exec(t);if(s){const r=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const u=fo(r.slice(0,-1),"\\");if((r.length-u.length)%2===0)return}else{const u=Sb(s[2],"()");if(u===-2)return;if(u>-1){const p=(s[0].indexOf("!")===0?5:4)+s[1].length+u;s[2]=s[2].substring(0,u),s[0]=s[0].substring(0,p).trim(),s[3]=""}}let o=s[2],l="";if(this.options.pedantic){const u=this.rules.other.pedanticHrefTitle.exec(o);u&&(o=u[1],l=u[3])}else l=s[3]?s[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?o=o.slice(1):o=o.slice(1,-1)),Tm(s,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:l&&l.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(t,s){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){const o=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),l=s[o.toLowerCase()];if(!l){const u=r[0].charAt(0);return{type:"text",raw:u,text:u}}return Tm(r,l,r[0],this.lexer,this.rules)}}emStrong(t,s,r=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!o||o[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(o[1]||o[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const u=[...o[0]].length-1;let d,p,g=u,m=0;const v=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,s=s.slice(-1*t.length+u);(o=v.exec(s))!=null;){if(d=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!d)continue;if(p=[...d].length,o[3]||o[4]){g+=p;continue}else if((o[5]||o[6])&&u%3&&!((u+p)%3)){m+=p;continue}if(g-=p,g>0)continue;p=Math.min(p,p+g+m);const k=[...o[0]][0].length,y=t.slice(0,u+o.index+k+p);if(Math.min(u,p)%2){const T=y.slice(1,-1);return{type:"em",raw:y,text:T,tokens:this.lexer.inlineTokens(T)}}const S=y.slice(2,-2);return{type:"strong",raw:y,text:S,tokens:this.lexer.inlineTokens(S)}}}}codespan(t){const s=this.rules.inline.code.exec(t);if(s){let r=s[2].replace(this.rules.other.newLineCharGlobal," ");const o=this.rules.other.nonSpaceChar.test(r),l=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return o&&l&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:s[0],text:r}}}br(t){const s=this.rules.inline.br.exec(t);if(s)return{type:"br",raw:s[0]}}del(t){const s=this.rules.inline.del.exec(t);if(s)return{type:"del",raw:s[0],text:s[2],tokens:this.lexer.inlineTokens(s[2])}}autolink(t){const s=this.rules.inline.autolink.exec(t);if(s){let r,o;return s[2]==="@"?(r=s[1],o="mailto:"+r):(r=s[1],o=r),{type:"link",raw:s[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let s;if(s=this.rules.inline.url.exec(t)){let o,l;if(s[2]==="@")o=s[0],l="mailto:"+o;else{let u;do u=s[0],s[0]=((r=this.rules.inline._backpedal.exec(s[0]))==null?void 0:r[0])??"";while(u!==s[0]);o=s[0],s[1]==="www."?l="http://"+s[0]:l=s[0]}return{type:"link",raw:s[0],text:o,href:l,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(t){const s=this.rules.inline.text.exec(t);if(s){const r=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:r}}}},$s=class id{constructor(s){rt(this,"tokens");rt(this,"options");rt(this,"state");rt(this,"tokenizer");rt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||Ur,this.options.tokenizer=this.options.tokenizer||new jl,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={other:bn,block:Za.normal,inline:uo.normal};this.options.pedantic?(r.block=Za.pedantic,r.inline=uo.pedantic):this.options.gfm&&(r.block=Za.gfm,this.options.breaks?r.inline=uo.breaks:r.inline=uo.gfm),this.tokenizer.rules=r}static get rules(){return{block:Za,inline:uo}}static lex(s,r){return new id(r).lex(s)}static lexInline(s,r){return new id(r).inlineTokens(s)}lex(s){s=s.replace(bn.carriageReturn,`
463
+ `,t=t.substring(y.length+1),g=!0),!g){const E=this.rules.other.nextBulletRegex(T),j=this.rules.other.hrRegex(T),W=this.rules.other.fencesBeginRegex(T),A=this.rules.other.headingBeginRegex(T),D=this.rules.other.htmlBeginRegex(T);for(;t;){const G=t.split(`
464
+ `,1)[0];let V;if(y=G,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),V=y):V=y.replace(this.rules.other.tabCharGlobal," "),W.test(y)||A.test(y)||D.test(y)||E.test(y)||j.test(y))break;if(V.search(this.rules.other.nonSpaceChar)>=T||!y.trim())v+=`
465
+ `+V.slice(T);else{if(S||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||W.test(k)||A.test(k)||j.test(k))break;v+=`
466
+ `+y}!S&&!y.trim()&&(S=!0),m+=G+`
467
+ `,t=t.substring(G.length+1),k=V.slice(T)}}l.loose||(d?l.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(d=!0));let _=null,N;this.options.gfm&&(_=this.rules.other.listIsTask.exec(v),_&&(N=_[0]!=="[ ] ",v=v.replace(this.rules.other.listReplaceTask,""))),l.items.push({type:"list_item",raw:m,task:!!_,checked:N,loose:!1,text:v,tokens:[]}),l.raw+=m}const p=l.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;l.raw=l.raw.trimEnd();for(let g=0;g<l.items.length;g++)if(this.lexer.state.top=!1,l.items[g].tokens=this.lexer.blockTokens(l.items[g].text,[]),!l.loose){const m=l.items[g].tokens.filter(k=>k.type==="space"),v=m.length>0&&m.some(k=>this.rules.other.anyLine.test(k.raw));l.loose=v}if(l.loose)for(let g=0;g<l.items.length;g++)l.items[g].loose=!0;return l}}html(t){const s=this.rules.block.html.exec(t);if(s)return{type:"html",block:!0,raw:s[0],pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:s[0]}}def(t){const s=this.rules.block.def.exec(t);if(s){const r=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",l=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:r,raw:s[0],href:o,title:l}}}table(t){var d;const s=this.rules.block.table.exec(t);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;const r=Tm(s[1]),o=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=(d=s[3])!=null&&d.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
468
+ `):[],u={type:"table",raw:s[0],header:[],align:[],rows:[]};if(r.length===o.length){for(const p of o)this.rules.other.tableAlignRight.test(p)?u.align.push("right"):this.rules.other.tableAlignCenter.test(p)?u.align.push("center"):this.rules.other.tableAlignLeft.test(p)?u.align.push("left"):u.align.push(null);for(let p=0;p<r.length;p++)u.header.push({text:r[p],tokens:this.lexer.inline(r[p]),header:!0,align:u.align[p]});for(const p of l)u.rows.push(Tm(p,u.header.length).map((g,m)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:u.align[m]})));return u}}lheading(t){const s=this.rules.block.lheading.exec(t);if(s)return{type:"heading",raw:s[0],depth:s[2].charAt(0)==="="?1:2,text:s[1],tokens:this.lexer.inline(s[1])}}paragraph(t){const s=this.rules.block.paragraph.exec(t);if(s){const r=s[1].charAt(s[1].length-1)===`
469
+ `?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const s=this.rules.block.text.exec(t);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(t){const s=this.rules.inline.escape.exec(t);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(t){const s=this.rules.inline.tag.exec(t);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(t){const s=this.rules.inline.link.exec(t);if(s){const r=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const u=fo(r.slice(0,-1),"\\");if((r.length-u.length)%2===0)return}else{const u=_b(s[2],"()");if(u===-2)return;if(u>-1){const p=(s[0].indexOf("!")===0?5:4)+s[1].length+u;s[2]=s[2].substring(0,u),s[0]=s[0].substring(0,p).trim(),s[3]=""}}let o=s[2],l="";if(this.options.pedantic){const u=this.rules.other.pedanticHrefTitle.exec(o);u&&(o=u[1],l=u[3])}else l=s[3]?s[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?o=o.slice(1):o=o.slice(1,-1)),Nm(s,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:l&&l.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(t,s){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){const o=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),l=s[o.toLowerCase()];if(!l){const u=r[0].charAt(0);return{type:"text",raw:u,text:u}}return Nm(r,l,r[0],this.lexer,this.rules)}}emStrong(t,s,r=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!o||o[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(o[1]||o[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const u=[...o[0]].length-1;let d,p,g=u,m=0;const v=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,s=s.slice(-1*t.length+u);(o=v.exec(s))!=null;){if(d=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!d)continue;if(p=[...d].length,o[3]||o[4]){g+=p;continue}else if((o[5]||o[6])&&u%3&&!((u+p)%3)){m+=p;continue}if(g-=p,g>0)continue;p=Math.min(p,p+g+m);const k=[...o[0]][0].length,y=t.slice(0,u+o.index+k+p);if(Math.min(u,p)%2){const T=y.slice(1,-1);return{type:"em",raw:y,text:T,tokens:this.lexer.inlineTokens(T)}}const S=y.slice(2,-2);return{type:"strong",raw:y,text:S,tokens:this.lexer.inlineTokens(S)}}}}codespan(t){const s=this.rules.inline.code.exec(t);if(s){let r=s[2].replace(this.rules.other.newLineCharGlobal," ");const o=this.rules.other.nonSpaceChar.test(r),l=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return o&&l&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:s[0],text:r}}}br(t){const s=this.rules.inline.br.exec(t);if(s)return{type:"br",raw:s[0]}}del(t){const s=this.rules.inline.del.exec(t);if(s)return{type:"del",raw:s[0],text:s[2],tokens:this.lexer.inlineTokens(s[2])}}autolink(t){const s=this.rules.inline.autolink.exec(t);if(s){let r,o;return s[2]==="@"?(r=s[1],o="mailto:"+r):(r=s[1],o=r),{type:"link",raw:s[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let s;if(s=this.rules.inline.url.exec(t)){let o,l;if(s[2]==="@")o=s[0],l="mailto:"+o;else{let u;do u=s[0],s[0]=((r=this.rules.inline._backpedal.exec(s[0]))==null?void 0:r[0])??"";while(u!==s[0]);o=s[0],s[1]==="www."?l="http://"+s[0]:l=s[0]}return{type:"link",raw:s[0],text:o,href:l,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(t){const s=this.rules.inline.text.exec(t);if(s){const r=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:r}}}},$s=class ad{constructor(s){it(this,"tokens");it(this,"options");it(this,"state");it(this,"tokenizer");it(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||Ur,this.options.tokenizer=this.options.tokenizer||new El,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={other:bn,block:Za.normal,inline:uo.normal};this.options.pedantic?(r.block=Za.pedantic,r.inline=uo.pedantic):this.options.gfm&&(r.block=Za.gfm,this.options.breaks?r.inline=uo.breaks:r.inline=uo.gfm),this.tokenizer.rules=r}static get rules(){return{block:Za,inline:uo}}static lex(s,r){return new ad(r).lex(s)}static lexInline(s,r){return new ad(r).inlineTokens(s)}lex(s){s=s.replace(bn.carriageReturn,`
470
470
  `),this.blockTokens(s,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const o=this.inlineQueue[r];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(s,r=[],o=!1){var l,u,d;for(this.options.pedantic&&(s=s.replace(bn.tabCharGlobal," ").replace(bn.spaceLine,""));s;){let p;if((u=(l=this.options.extensions)==null?void 0:l.block)!=null&&u.some(m=>(p=m.call({lexer:this},s,r))?(s=s.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.space(s)){s=s.substring(p.raw.length);const m=r.at(-1);p.raw.length===1&&m!==void 0?m.raw+=`
471
471
  `:r.push(p);continue}if(p=this.tokenizer.code(s)){s=s.substring(p.raw.length);const m=r.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=`
472
472
  `+p.raw,m.text+=`
@@ -476,16 +476,16 @@ ${v}`:v;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
476
476
  `+p.raw,m.text+=`
477
477
  `+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(p),o=g.length!==s.length,s=s.substring(p.raw.length);continue}if(p=this.tokenizer.text(s)){s=s.substring(p.raw.length);const m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=`
478
478
  `+p.raw,m.text+=`
479
- `+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(p);continue}if(s){const m="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var p,g,m;let o=s,l=null;if(this.tokens.links){const v=Object.keys(this.tokens.links);if(v.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)v.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,l.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(l=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let u=!1,d="";for(;s;){u||(d=""),u=!1;let v;if((g=(p=this.options.extensions)==null?void 0:p.inline)!=null&&g.some(y=>(v=y.call({lexer:this},s,r))?(s=s.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(v.raw.length);const y=r.at(-1);v.type==="text"&&(y==null?void 0:y.type)==="text"?(y.raw+=v.raw,y.text+=v.text):r.push(v);continue}if(v=this.tokenizer.emStrong(s,o,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(s)){s=s.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(s))){s=s.substring(v.raw.length),r.push(v);continue}let k=s;if((m=this.options.extensions)!=null&&m.startInline){let y=1/0;const S=s.slice(1);let T;this.options.extensions.startInline.forEach(_=>{T=_.call({lexer:this},S),typeof T=="number"&&T>=0&&(y=Math.min(y,T))}),y<1/0&&y>=0&&(k=s.substring(0,y+1))}if(v=this.tokenizer.inlineText(k)){s=s.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),u=!0;const y=r.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=v.raw,y.text+=v.text):r.push(v);continue}if(s){const y="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return r}},Cl=class{constructor(t){rt(this,"options");rt(this,"parser");this.options=t||Ur}space(t){return""}code({text:t,lang:s,escaped:r}){var u;const o=(u=(s||"").match(bn.notSpaceStart))==null?void 0:u[0],l=t.replace(bn.endingNewline,"")+`
480
- `;return o?'<pre><code class="language-'+bs(o)+'">'+(r?l:bs(l,!0))+`</code></pre>
481
- `:"<pre><code>"+(r?l:bs(l,!0))+`</code></pre>
479
+ `+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(p);continue}if(s){const m="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var p,g,m;let o=s,l=null;if(this.tokens.links){const v=Object.keys(this.tokens.links);if(v.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)v.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,l.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(l=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let u=!1,d="";for(;s;){u||(d=""),u=!1;let v;if((g=(p=this.options.extensions)==null?void 0:p.inline)!=null&&g.some(y=>(v=y.call({lexer:this},s,r))?(s=s.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(v.raw.length);const y=r.at(-1);v.type==="text"&&(y==null?void 0:y.type)==="text"?(y.raw+=v.raw,y.text+=v.text):r.push(v);continue}if(v=this.tokenizer.emStrong(s,o,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(s)){s=s.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(s))){s=s.substring(v.raw.length),r.push(v);continue}let k=s;if((m=this.options.extensions)!=null&&m.startInline){let y=1/0;const S=s.slice(1);let T;this.options.extensions.startInline.forEach(_=>{T=_.call({lexer:this},S),typeof T=="number"&&T>=0&&(y=Math.min(y,T))}),y<1/0&&y>=0&&(k=s.substring(0,y+1))}if(v=this.tokenizer.inlineText(k)){s=s.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),u=!0;const y=r.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=v.raw,y.text+=v.text):r.push(v);continue}if(s){const y="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return r}},_l=class{constructor(t){it(this,"options");it(this,"parser");this.options=t||Ur}space(t){return""}code({text:t,lang:s,escaped:r}){var u;const o=(u=(s||"").match(bn.notSpaceStart))==null?void 0:u[0],l=t.replace(bn.endingNewline,"")+`
480
+ `;return o?'<pre><code class="language-'+Ts(o)+'">'+(r?l:Ts(l,!0))+`</code></pre>
481
+ `:"<pre><code>"+(r?l:Ts(l,!0))+`</code></pre>
482
482
  `}blockquote({tokens:t}){return`<blockquote>
483
483
  ${this.parser.parse(t)}</blockquote>
484
484
  `}html({text:t}){return t}heading({tokens:t,depth:s}){return`<h${s}>${this.parser.parseInline(t)}</h${s}>
485
485
  `}hr(t){return`<hr>
486
486
  `}list(t){const s=t.ordered,r=t.start;let o="";for(let d=0;d<t.items.length;d++){const p=t.items[d];o+=this.listitem(p)}const l=s?"ol":"ul",u=s&&r!==1?' start="'+r+'"':"";return"<"+l+u+`>
487
487
  `+o+"</"+l+`>
488
- `}listitem(t){var r;let s="";if(t.task){const o=this.checkbox({checked:!!t.checked});t.loose?((r=t.tokens[0])==null?void 0:r.type)==="paragraph"?(t.tokens[0].text=o+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=o+" "+bs(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:o+" ",text:o+" ",escaped:!0}):s+=o+" "}return s+=this.parser.parse(t.tokens,!!t.loose),`<li>${s}</li>
488
+ `}listitem(t){var r;let s="";if(t.task){const o=this.checkbox({checked:!!t.checked});t.loose?((r=t.tokens[0])==null?void 0:r.type)==="paragraph"?(t.tokens[0].text=o+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=o+" "+Ts(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:o+" ",text:o+" ",escaped:!0}):s+=o+" "}return s+=this.parser.parse(t.tokens,!!t.loose),`<li>${s}</li>
489
489
  `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
490
490
  `}table(t){let s="",r="";for(let l=0;l<t.header.length;l++)r+=this.tablecell(t.header[l]);s+=this.tablerow({text:r});let o="";for(let l=0;l<t.rows.length;l++){const u=t.rows[l];r="";for(let d=0;d<u.length;d++)r+=this.tablecell(u[d]);o+=this.tablerow({text:r})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
491
491
  <thead>
@@ -494,30 +494,30 @@ ${this.parser.parse(t)}</blockquote>
494
494
  `}tablerow({text:t}){return`<tr>
495
495
  ${t}</tr>
496
496
  `}tablecell(t){const s=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+s+`</${r}>
497
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${bs(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:s,tokens:r}){const o=this.parser.parseInline(r),l=Sm(t);if(l===null)return o;t=l;let u='<a href="'+t+'"';return s&&(u+=' title="'+bs(s)+'"'),u+=">"+o+"</a>",u}image({href:t,title:s,text:r,tokens:o}){o&&(r=this.parser.parseInline(o,this.parser.textRenderer));const l=Sm(t);if(l===null)return bs(r);t=l;let u=`<img src="${t}" alt="${r}"`;return s&&(u+=` title="${bs(s)}"`),u+=">",u}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:bs(t.text)}},Gd=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},zs=class od{constructor(s){rt(this,"options");rt(this,"renderer");rt(this,"textRenderer");this.options=s||Ur,this.options.renderer=this.options.renderer||new Cl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Gd}static parse(s,r){return new od(r).parse(s)}static parseInline(s,r){return new od(r).parseInline(s)}parse(s,r=!0){var l,u;let o="";for(let d=0;d<s.length;d++){const p=s[d];if((u=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&u[p.type]){const m=p,v=this.options.extensions.renderers[m.type].call({parser:this},m);if(v!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(m.type)){o+=v||"";continue}}const g=p;switch(g.type){case"space":{o+=this.renderer.space(g);continue}case"hr":{o+=this.renderer.hr(g);continue}case"heading":{o+=this.renderer.heading(g);continue}case"code":{o+=this.renderer.code(g);continue}case"table":{o+=this.renderer.table(g);continue}case"blockquote":{o+=this.renderer.blockquote(g);continue}case"list":{o+=this.renderer.list(g);continue}case"html":{o+=this.renderer.html(g);continue}case"paragraph":{o+=this.renderer.paragraph(g);continue}case"text":{let m=g,v=this.renderer.text(m);for(;d+1<s.length&&s[d+1].type==="text";)m=s[++d],v+=`
498
- `+this.renderer.text(m);r?o+=this.renderer.paragraph({type:"paragraph",raw:v,text:v,tokens:[{type:"text",raw:v,text:v,escaped:!0}]}):o+=v;continue}default:{const m='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return o}parseInline(s,r=this.renderer){var l,u;let o="";for(let d=0;d<s.length;d++){const p=s[d];if((u=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&u[p.type]){const m=this.options.extensions.renderers[p.type].call({parser:this},p);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(p.type)){o+=m||"";continue}}const g=p;switch(g.type){case"escape":{o+=r.text(g);break}case"html":{o+=r.html(g);break}case"link":{o+=r.link(g);break}case"image":{o+=r.image(g);break}case"strong":{o+=r.strong(g);break}case"em":{o+=r.em(g);break}case"codespan":{o+=r.codespan(g);break}case"br":{o+=r.br(g);break}case"del":{o+=r.del(g);break}case"text":{o+=r.text(g);break}default:{const m='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return o}},Gu,al=(Gu=class{constructor(t){rt(this,"options");rt(this,"block");this.options=t||Ur}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?$s.lex:$s.lexInline}provideParser(){return this.block?zs.parse:zs.parseInline}},rt(Gu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Gu),Tb=class{constructor(...t){rt(this,"defaults",$d());rt(this,"options",this.setOptions);rt(this,"parse",this.parseMarkdown(!0));rt(this,"parseInline",this.parseMarkdown(!1));rt(this,"Parser",zs);rt(this,"Renderer",Cl);rt(this,"TextRenderer",Gd);rt(this,"Lexer",$s);rt(this,"Tokenizer",jl);rt(this,"Hooks",al);this.use(...t)}walkTokens(t,s){var o,l;let r=[];for(const u of t)switch(r=r.concat(s.call(this,u)),u.type){case"table":{const d=u;for(const p of d.header)r=r.concat(this.walkTokens(p.tokens,s));for(const p of d.rows)for(const g of p)r=r.concat(this.walkTokens(g.tokens,s));break}case"list":{const d=u;r=r.concat(this.walkTokens(d.items,s));break}default:{const d=u;(l=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&l[d.type]?this.defaults.extensions.childTokens[d.type].forEach(p=>{const g=d[p].flat(1/0);r=r.concat(this.walkTokens(g,s))}):d.tokens&&(r=r.concat(this.walkTokens(d.tokens,s)))}}return r}use(...t){const s=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{const o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){const u=s.renderers[l.name];u?s.renderers[l.name]=function(...d){let p=l.renderer.apply(this,d);return p===!1&&(p=u.apply(this,d)),p}:s.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const u=s[l.level];u?u.unshift(l.tokenizer):s[l.level]=[l.tokenizer],l.start&&(l.level==="block"?s.startBlock?s.startBlock.push(l.start):s.startBlock=[l.start]:l.level==="inline"&&(s.startInline?s.startInline.push(l.start):s.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(s.childTokens[l.name]=l.childTokens)}),o.extensions=s),r.renderer){const l=this.defaults.renderer||new Cl(this.defaults);for(const u in r.renderer){if(!(u in l))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;const d=u,p=r.renderer[d],g=l[d];l[d]=(...m)=>{let v=p.apply(l,m);return v===!1&&(v=g.apply(l,m)),v||""}}o.renderer=l}if(r.tokenizer){const l=this.defaults.tokenizer||new jl(this.defaults);for(const u in r.tokenizer){if(!(u in l))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;const d=u,p=r.tokenizer[d],g=l[d];l[d]=(...m)=>{let v=p.apply(l,m);return v===!1&&(v=g.apply(l,m)),v}}o.tokenizer=l}if(r.hooks){const l=this.defaults.hooks||new al;for(const u in r.hooks){if(!(u in l))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;const d=u,p=r.hooks[d],g=l[d];al.passThroughHooks.has(u)?l[d]=m=>{if(this.defaults.async)return Promise.resolve(p.call(l,m)).then(k=>g.call(l,k));const v=p.call(l,m);return g.call(l,v)}:l[d]=(...m)=>{let v=p.apply(l,m);return v===!1&&(v=g.apply(l,m)),v}}o.hooks=l}if(r.walkTokens){const l=this.defaults.walkTokens,u=r.walkTokens;o.walkTokens=function(d){let p=[];return p.push(u.call(this,d)),l&&(p=p.concat(l.call(this,d))),p}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,s){return $s.lex(t,s??this.defaults)}parser(t,s){return zs.parse(t,s??this.defaults)}parseMarkdown(t){return(r,o)=>{const l={...o},u={...this.defaults,...l},d=this.onError(!!u.silent,!!u.async);if(this.defaults.async===!0&&l.async===!1)return d(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));u.hooks&&(u.hooks.options=u,u.hooks.block=t);const p=u.hooks?u.hooks.provideLexer():t?$s.lex:$s.lexInline,g=u.hooks?u.hooks.provideParser():t?zs.parse:zs.parseInline;if(u.async)return Promise.resolve(u.hooks?u.hooks.preprocess(r):r).then(m=>p(m,u)).then(m=>u.hooks?u.hooks.processAllTokens(m):m).then(m=>u.walkTokens?Promise.all(this.walkTokens(m,u.walkTokens)).then(()=>m):m).then(m=>g(m,u)).then(m=>u.hooks?u.hooks.postprocess(m):m).catch(d);try{u.hooks&&(r=u.hooks.preprocess(r));let m=p(r,u);u.hooks&&(m=u.hooks.processAllTokens(m)),u.walkTokens&&this.walkTokens(m,u.walkTokens);let v=g(m,u);return u.hooks&&(v=u.hooks.postprocess(v)),v}catch(m){return d(m)}}}onError(t,s){return r=>{if(r.message+=`
499
- Please report this to https://github.com/markedjs/marked.`,t){const o="<p>An error occurred:</p><pre>"+bs(r.message+"",!0)+"</pre>";return s?Promise.resolve(o):o}if(s)return Promise.reject(r);throw r}}},zr=new Tb;function Ve(t,s){return zr.parse(t,s)}Ve.options=Ve.setOptions=function(t){return zr.setOptions(t),Ve.defaults=zr.defaults,zv(Ve.defaults),Ve};Ve.getDefaults=$d;Ve.defaults=Ur;Ve.use=function(...t){return zr.use(...t),Ve.defaults=zr.defaults,zv(Ve.defaults),Ve};Ve.walkTokens=function(t,s){return zr.walkTokens(t,s)};Ve.parseInline=zr.parseInline;Ve.Parser=zs;Ve.parser=zs.parse;Ve.Renderer=Cl;Ve.TextRenderer=Gd;Ve.Lexer=$s;Ve.lexer=$s.lex;Ve.Tokenizer=jl;Ve.Hooks=al;Ve.parse=Ve;Ve.options;Ve.setOptions;Ve.use;Ve.walkTokens;Ve.parseInline;zs.parse;$s.lex;/*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */function Nm(t,s){(s==null||s>t.length)&&(s=t.length);for(var r=0,o=Array(s);r<s;r++)o[r]=t[r];return o}function Nb(t){if(Array.isArray(t))return t}function jb(t,s){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var o,l,u,d,p=[],g=!0,m=!1;try{if(u=(r=r.call(t)).next,s!==0)for(;!(g=(o=u.call(r)).done)&&(p.push(o.value),p.length!==s);g=!0);}catch(v){m=!0,l=v}finally{try{if(!g&&r.return!=null&&(d=r.return(),Object(d)!==d))return}finally{if(m)throw l}}return p}}function Cb(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
500
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Eb(t,s){return Nb(t)||jb(t,s)||_b(t,s)||Cb()}function _b(t,s){if(t){if(typeof t=="string")return Nm(t,s);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Nm(t,s):void 0}}const Xv=Object.entries,jm=Object.setPrototypeOf,Rb=Object.isFrozen,Ab=Object.getPrototypeOf,Ib=Object.getOwnPropertyDescriptor;let rn=Object.freeze,on=Object.seal,vi=Object.create,Qv=typeof Reflect<"u"&&Reflect,ad=Qv.apply,ld=Qv.construct;rn||(rn=function(s){return s});on||(on=function(s){return s});ad||(ad=function(s,r){for(var o=arguments.length,l=new Array(o>2?o-2:0),u=2;u<o;u++)l[u-2]=arguments[u];return s.apply(r,l)});ld||(ld=function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),l=1;l<r;l++)o[l-1]=arguments[l];return new s(...o)});const hi=Pt(Array.prototype.forEach),Mb=Pt(Array.prototype.lastIndexOf),Cm=Pt(Array.prototype.pop),mi=Pt(Array.prototype.push),Db=Pt(Array.prototype.splice),ur=Array.isArray,vo=Pt(String.prototype.toLowerCase),zu=Pt(String.prototype.toString),Em=Pt(String.prototype.match),po=Pt(String.prototype.replace),_m=Pt(String.prototype.indexOf),Lb=Pt(String.prototype.trim),Ob=Pt(Number.prototype.toString),Pb=Pt(Boolean.prototype.toString),Rm=typeof BigInt>"u"?null:Pt(BigInt.prototype.toString),Am=typeof Symbol>"u"?null:Pt(Symbol.prototype.toString),Zt=Pt(Object.prototype.hasOwnProperty),ho=Pt(Object.prototype.toString),Qt=Pt(RegExp.prototype.test),Lr=$b(TypeError);function Pt(t){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var r=arguments.length,o=new Array(r>1?r-1:0),l=1;l<r;l++)o[l-1]=arguments[l];return ad(t,s,o)}}function $b(t){return function(){for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return ld(t,r)}}function He(t,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:vo;if(jm&&jm(t,null),!ur(s))return t;let o=s.length;for(;o--;){let l=s[o];if(typeof l=="string"){const u=r(l);u!==l&&(Rb(s)||(s[o]=u),l=u)}t[l]=!0}return t}function zb(t){for(let s=0;s<t.length;s++)Zt(t,s)||(t[s]=null);return t}function pn(t){const s=vi(null);for(const o of Xv(t)){var r=Eb(o,2);const l=r[0],u=r[1];Zt(t,l)&&(ur(u)?s[l]=zb(u):u&&typeof u=="object"&&u.constructor===Object?s[l]=pn(u):s[l]=u)}return s}function Fb(t){switch(typeof t){case"string":return t;case"number":return Ob(t);case"boolean":return Pb(t);case"bigint":return Rm?Rm(t):"0";case"symbol":return Am?Am(t):"Symbol()";case"undefined":return ho(t);case"function":case"object":{if(t===null)return ho(t);const s=t,r=ls(s,"toString");if(typeof r=="function"){const o=r(s);return typeof o=="string"?o:ho(o)}return ho(t)}default:return ho(t)}}function ls(t,s){for(;t!==null;){const o=Ib(t,s);if(o){if(o.get)return Pt(o.get);if(typeof o.value=="function")return Pt(o.value)}t=Ab(t)}function r(){return null}return r}function Ub(t){try{return Qt(t,""),!0}catch{return!1}}const Im=rn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Fu=rn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Uu=rn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Bb=rn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Bu=rn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Wb=rn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Mm=rn(["#text"]),Dm=rn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Wu=rn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Lm=rn(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ja=rn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Hb=on(/{{[\w\W]*|^[\w\W]*}}/g),Vb=on(/<%[\w\W]*|^[\w\W]*%>/g),Gb=on(/\${[\w\W]*/g),Kb=on(/^data-[\-\w.\u00B7-\uFFFF]+$/),qb=on(/^aria-[\-\w]+$/),Om=on(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Yb=on(/^(?:\w+script|data):/i),Xb=on(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Qb=on(/^html$/i),Zb=on(/^[a-z][.\w]*(-[.\w]+)+$/i),Pm=on(/<[/\w!]/g),$m=on(/<[/\w]/g),Jb=on(/<\/no(script|embed|frames)/i),eT=on(/\/>/i),Wn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},tT=function(){return typeof window>"u"?null:window},nT=function(s,r){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let o=null;const l="data-tt-policy-suffix";r&&r.hasAttribute(l)&&(o=r.getAttribute(l));const u="dompurify"+(o?"#"+o:"");try{return s.createPolicy(u,{createHTML(d){return d},createScriptURL(d){return d}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},zm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},lr=function(s,r,o,l){return Zt(s,r)&&ur(s[r])?He(l.base?pn(l.base):{},s[r],l.transform):o};function Zv(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tT();const s=le=>Zv(le);if(s.version="3.4.13",s.removed=[],!t||!t.document||t.document.nodeType!==Wn.document||!t.Element)return s.isSupported=!1,s;let r=t.document;const o=r,l=o.currentScript;t.DocumentFragment;const u=t.HTMLTemplateElement,d=t.Node,p=t.Element,g=t.NodeFilter,m=t.NamedNodeMap;m===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const v=t.DOMParser,k=t.trustedTypes,y=p.prototype,S=ls(y,"cloneNode"),T=ls(y,"remove"),_=ls(y,"nextSibling"),N=ls(y,"childNodes"),C=ls(y,"parentNode"),R=ls(y,"shadowRoot"),H=ls(y,"attributes"),M=d&&d.prototype?ls(d.prototype,"nodeType"):null,D=d&&d.prototype?ls(d.prototype,"nodeName"):null,K=d&&d.prototype?ls(d.prototype,"ownerDocument"):null;if(typeof u=="function"){const le=r.createElement("template");le.content&&le.content.ownerDocument&&(r=le.content.ownerDocument)}let G,$="",te,he=!1,ue=0;const Se=function(){if(ue>0)throw Lr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},q=function(b){Se(),ue++;try{return G.createHTML(b)}finally{ue--}},we=function(b){Se(),ue++;try{return G.createScriptURL(b)}finally{ue--}},Z=function(){return he||(te=nT(k,l),he=!0),te},oe=r,ae=oe.implementation,z=oe.createNodeIterator,Q=oe.createDocumentFragment,B=oe.getElementsByTagName,E=o.importNode;let P=zm();s.isSupported=typeof Xv=="function"&&typeof C=="function"&&ae&&ae.createHTMLDocument!==void 0;const se=Hb,fe=Vb,X=Gb,pe=Kb,Ne=qb,_e=Yb,Ae=Xb,Ee=Zb;let at=Om,De=null;const lt=He({},[...Im,...Fu,...Uu,...Bu,...Mm]);let $e=null;const en=He({},[...Dm,...Wu,...Lm,...Ja]);let Fe=Object.seal(vi(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ht=null,tn=null;const wt=Object.seal(vi(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let jt=!0,$t=!0,Dt=!1,Y=!0,me=!1,Ue=!0,tt=!1,mt=!1,gt=null,Ct=null,an=!1,dt=!1,Mn=!1,Dn=!1,ps=!0,hs=!1;const ts="user-content-";let Ln=!0,gn=!1,ln={},Vt=null;const vn=He({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Xe=null;const Et=He({},["audio","video","img","source","image","track"]);let ft=null;const Gt=He({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vt="http://www.w3.org/1998/Math/MathML",yt="http://www.w3.org/2000/svg",it="http://www.w3.org/1999/xhtml";let Kt=it,st=!1,Lt=null;const A=He({},[vt,yt,it],zu),de=rn(["mi","mo","mn","ms","mtext"]);let ie=He({},de);const ye=rn(["annotation-xml"]);let Le=He({},ye);const Ge=He({},["title","style","font","a","script"]);let Oe=null;const zt=["application/xhtml+xml","text/html"],On="text/html";let Be=null,yn=null;const Cs=r.createElement("form"),Us=function(b){return b instanceof RegExp||b instanceof Function},Pn=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(yn&&yn===b)return;(!b||typeof b!="object")&&(b={}),b=pn(b),Oe=zt.indexOf(b.PARSER_MEDIA_TYPE)===-1?On:b.PARSER_MEDIA_TYPE,Be=Oe==="application/xhtml+xml"?zu:vo,De=lr(b,"ALLOWED_TAGS",lt,{transform:Be}),$e=lr(b,"ALLOWED_ATTR",en,{transform:Be}),Lt=lr(b,"ALLOWED_NAMESPACES",A,{transform:zu}),ft=lr(b,"ADD_URI_SAFE_ATTR",Gt,{transform:Be,base:Gt}),Xe=lr(b,"ADD_DATA_URI_TAGS",Et,{transform:Be,base:Et}),Vt=lr(b,"FORBID_CONTENTS",vn,{transform:Be}),Ht=lr(b,"FORBID_TAGS",pn({}),{transform:Be}),tn=lr(b,"FORBID_ATTR",pn({}),{transform:Be}),ln=Zt(b,"USE_PROFILES")?b.USE_PROFILES&&typeof b.USE_PROFILES=="object"?pn(b.USE_PROFILES):b.USE_PROFILES:!1,jt=b.ALLOW_ARIA_ATTR!==!1,$t=b.ALLOW_DATA_ATTR!==!1,Dt=b.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,me=b.SAFE_FOR_TEMPLATES||!1,Ue=b.SAFE_FOR_XML!==!1,tt=b.WHOLE_DOCUMENT||!1,dt=b.RETURN_DOM||!1,Mn=b.RETURN_DOM_FRAGMENT||!1,Dn=b.RETURN_TRUSTED_TYPE||!1,an=b.FORCE_BODY||!1,ps=b.SANITIZE_DOM!==!1,hs=b.SANITIZE_NAMED_PROPS||!1,Ln=b.KEEP_CONTENT!==!1,gn=b.IN_PLACE||!1,at=Ub(b.ALLOWED_URI_REGEXP)?b.ALLOWED_URI_REGEXP:Om,Kt=typeof b.NAMESPACE=="string"?b.NAMESPACE:it,ie=Zt(b,"MATHML_TEXT_INTEGRATION_POINTS")&&b.MATHML_TEXT_INTEGRATION_POINTS&&typeof b.MATHML_TEXT_INTEGRATION_POINTS=="object"?pn(b.MATHML_TEXT_INTEGRATION_POINTS):He({},de),Le=Zt(b,"HTML_INTEGRATION_POINTS")&&b.HTML_INTEGRATION_POINTS&&typeof b.HTML_INTEGRATION_POINTS=="object"?pn(b.HTML_INTEGRATION_POINTS):He({},ye);const F=Zt(b,"CUSTOM_ELEMENT_HANDLING")&&b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING=="object"?pn(b.CUSTOM_ELEMENT_HANDLING):vi(null);if(Fe=vi(null),Zt(F,"tagNameCheck")&&Us(F.tagNameCheck)&&(Fe.tagNameCheck=F.tagNameCheck),Zt(F,"attributeNameCheck")&&Us(F.attributeNameCheck)&&(Fe.attributeNameCheck=F.attributeNameCheck),Zt(F,"allowCustomizedBuiltInElements")&&typeof F.allowCustomizedBuiltInElements=="boolean"&&(Fe.allowCustomizedBuiltInElements=F.allowCustomizedBuiltInElements),on(Fe),me&&($t=!1),Mn&&(dt=!0),ln&&(De=He({},Mm),$e=vi(null),ln.html===!0&&(He(De,Im),He($e,Dm)),ln.svg===!0&&(He(De,Fu),He($e,Wu),He($e,Ja)),ln.svgFilters===!0&&(He(De,Uu),He($e,Wu),He($e,Ja)),ln.mathMl===!0&&(He(De,Bu),He($e,Lm),He($e,Ja))),wt.tagCheck=null,wt.attributeCheck=null,Zt(b,"ADD_TAGS")&&(typeof b.ADD_TAGS=="function"?wt.tagCheck=b.ADD_TAGS:ur(b.ADD_TAGS)&&(De===lt&&(De=pn(De)),He(De,b.ADD_TAGS,Be))),Zt(b,"ADD_ATTR")&&(typeof b.ADD_ATTR=="function"?wt.attributeCheck=b.ADD_ATTR:ur(b.ADD_ATTR)&&($e===en&&($e=pn($e)),He($e,b.ADD_ATTR,Be))),Zt(b,"ADD_URI_SAFE_ATTR")&&ur(b.ADD_URI_SAFE_ATTR)&&He(ft,b.ADD_URI_SAFE_ATTR,Be),Zt(b,"FORBID_CONTENTS")&&ur(b.FORBID_CONTENTS)&&(Vt===vn&&(Vt=pn(Vt)),He(Vt,b.FORBID_CONTENTS,Be)),Zt(b,"ADD_FORBID_CONTENTS")&&ur(b.ADD_FORBID_CONTENTS)&&(Vt===vn&&(Vt=pn(Vt)),He(Vt,b.ADD_FORBID_CONTENTS,Be)),Ln&&(De["#text"]=!0),tt&&He(De,["html","head","body"]),De.table&&(He(De,["tbody"]),delete Ht.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Lr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Lr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const J=G;G=b.TRUSTED_TYPES_POLICY;try{$=q("")}catch(be){throw G=J,be}}else b.TRUSTED_TYPES_POLICY===null?(G=void 0,$=""):(G===void 0&&(G=Z()),G&&typeof $=="string"&&($=q("")));rn&&rn(b),yn=b},ms=He({},[...Fu,...Uu,...Bb]),Qe=He({},[...Bu,...Wb]),_t=function(b,F,J){return F.namespaceURI===it?b==="svg":F.namespaceURI===vt?b==="svg"&&(J==="annotation-xml"||ie[J]):!!ms[b]},gs=function(b,F,J){return F.namespaceURI===it?b==="math":F.namespaceURI===yt?b==="math"&&Le[J]:!!Qe[b]},Hl=function(b,F,J){return F.namespaceURI===yt&&!Le[J]||F.namespaceURI===vt&&!ie[J]?!1:!Qe[b]&&(Ge[b]||!ms[b])},kt=function(b){let F=C(b);(!F||!F.tagName)&&(F={namespaceURI:Kt,tagName:"template"});const J=vo(b.tagName),be=vo(F.tagName);return Lt[b.namespaceURI]?b.namespaceURI===yt?_t(J,F,be):b.namespaceURI===vt?gs(J,F,be):b.namespaceURI===it?Hl(J,F,be):!!(Oe==="application/xhtml+xml"&&Lt[b.namespaceURI]):!1},vs=function(b){mi(s.removed,{element:b});try{C(b).removeChild(b)}catch{if(T(b),!C(b))throw Lr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Bs=function(b){gr(b);const F=N(b);if(F){const be=[];hi(F,Ce=>{mi(be,Ce)}),hi(be,Ce=>{try{T(Ce)}catch{}})}const J=H(b);if(J)for(let be=J.length-1;be>=0;--be){const Ce=J[be],ze=Ce&&Ce.name;if(typeof ze=="string")try{b.removeAttribute(ze)}catch{}}},ys=function(b,F){try{mi(s.removed,{attribute:F.getAttributeNode(b),from:F})}catch{mi(s.removed,{attribute:null,from:F})}if(F.removeAttribute(b),b==="is")if(dt||Mn)try{vs(F)}catch{}else try{F.setAttribute(b,"")}catch{}},Br=function(b){const F=H(b);if(F)for(let J=F.length-1;J>=0;--J){const be=F[J],Ce=be&&be.name;if(!(typeof Ce!="string"||$e[Be(Ce)]))try{b.removeAttribute(Ce)}catch{}}},gr=function(b){const F=[b];for(;F.length>0;){const J=F.pop();(M?M(J):J.nodeType)===Wn.element&&Br(J);const Ce=N(J);if(Ce)for(let ze=Ce.length-1;ze>=0;--ze)F.push(Ce[ze])}},Uo=function(b){if(!Ue)return;const F=[b];for(;F.length>0;){const J=F.pop(),be=M?M(J):J.nodeType;if(be===Wn.processingInstruction||be===Wn.comment&&Qt($m,J.data)){try{T(J)}catch{}continue}if(be===Wn.element){const ze=J,qe=Be(D?D(J):J.nodeName);try{ze.hasAttribute&&ze.hasAttribute("patchsrc")&&ze.removeAttribute("patchsrc"),ze.hasAttribute&&ze.hasAttribute("for")&&qe!=="label"&&qe!=="output"&&ze.removeAttribute("for")}catch{}}const Ce=N(J);if(Ce)for(let ze=Ce.length-1;ze>=0;--ze)F.push(Ce[ze])}},vr=function(b){let F=null,J=null;if(an)b="<remove></remove>"+b;else{const ze=Em(b,/^[\r\n\t ]+/);J=ze&&ze[0]}Oe==="application/xhtml+xml"&&Kt===it&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const be=G?q(b):b;if(Kt===it)try{F=new v().parseFromString(be,Oe)}catch{}if(!F||!F.documentElement){F=ae.createDocument(Kt,"template",null);try{F.documentElement.innerHTML=st?$:be}catch{}}const Ce=F.body||F.documentElement;return b&&J&&Ce.insertBefore(r.createTextNode(J),Ce.childNodes[0]||null),Kt===it?B.call(F,tt?"html":"body")[0]:tt?F.documentElement:Ce},$n=function(b){const F=K?K(b):b.ownerDocument;return z.call(F||b,b,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Wr=function(b){return b=po(b,se," "),b=po(b,fe," "),b=po(b,X," "),b},xn=function(b){var F;b.normalize();const J=K?K(b):b.ownerDocument,be=z.call(J||b,b,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let Ce=be.nextNode();for(;Ce;)Ce.data=Wr(Ce.data),Ce=be.nextNode();const ze=(F=b.querySelectorAll)===null||F===void 0?void 0:F.call(b,"template");ze&&hi(ze,qe=>{Ws(qe.content)&&xn(qe.content)})},Hr=function(b){const F=D?D(b):null;return typeof F!="string"||Be(F)!=="form"?!1:typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||b.attributes!==H(b)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function"||b.nodeType!==M(b)||b.childNodes!==N(b)},Ws=function(b){if(!M||typeof b!="object"||b===null)return!1;try{return M(b)===Wn.documentFragment}catch{return!1}},yr=function(b){if(!M||typeof b!="object"||b===null)return!1;try{return typeof M(b)=="number"}catch{return!1}};function wn(le,b,F){le.length!==0&&hi(le,J=>{J.call(s,b,F,yn)})}const Vr=function(b,F){return!!(Ue&&b.hasChildNodes()&&!yr(b.firstElementChild)&&Qt(Pm,b.textContent)&&Qt(Pm,b.innerHTML)||Ue&&b.namespaceURI===it&&F==="style"&&yr(b.firstElementChild)||b.nodeType===Wn.processingInstruction||Ue&&b.nodeType===Wn.comment&&Qt($m,b.data))},xr=function(b,F,J){if(!Ht[F]&&Ai(F)&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,F)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(F)))return!1;if(Ln&&!Vt[F]){const be=C(b),Ce=N(b);if(Ce&&be){const ze=Ce.length;for(let qe=ze-1;qe>=0;--qe){const Ze=b===J?S(Ce[qe],!0):Ce[qe];be.insertBefore(Ze,_(b))}}}return vs(b),!0},wr=function(b,F,J,be){return b.length===0?F:F===J||F===be?pn(F):F},Bo=function(b,F){if(wn(P.beforeSanitizeElements,b,null),b!==F&&C(b)===null)return gn&&gr(b),!0;if(Hr(b))return vs(b),!0;const J=Be(D?D(b):b.nodeName);if(De=wr(P.uponSanitizeElement,De,lt,gt),wn(P.uponSanitizeElement,b,{tagName:J,allowedTags:De}),b!==F&&C(b)===null)return gn&&gr(b),!0;if(Vr(b,J))return vs(b),!0;if(Ht[J]||!(wt.tagCheck instanceof Function&&wt.tagCheck(J))&&!De[J]){const Ce=xr(b,J,F);return Ce===!1&&wn(P.afterSanitizeElements,b,null),Ce}if((M?M(b):b.nodeType)===Wn.element&&!kt(b)||(J==="noscript"||J==="noembed"||J==="noframes")&&Qt(Jb,b.innerHTML))return vs(b),!0;if(me&&b.nodeType===Wn.text){const Ce=Wr(b.textContent);b.textContent!==Ce&&(mi(s.removed,{element:b.cloneNode()}),b.textContent=Ce)}return wn(P.afterSanitizeElements,b,null),!1},Wo=function(b,F,J){if(tn[F]||Ue&&F==="patchsrc"||Ue&&F==="for"&&b!=="label"&&b!=="output"||ps&&(F==="id"||F==="name")&&(J in r||J in Cs))return!1;const be=$e[F]||wt.attributeCheck instanceof Function&&wt.attributeCheck(F,b);if(!($t&&Qt(pe,F))){if(!(jt&&Qt(Ne,F))){if(be){if(!ft[F]){if(!Qt(at,po(J,Ae,""))){if(!((F==="src"||F==="xlink:href"||F==="href")&&b!=="script"&&_m(J,"data:")===0&&Xe[b])){if(!(Dt&&!Qt(_e,po(J,Ae,"")))){if(J)return!1}}}}}else if(!(Ai(b)&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,b)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(b))&&(Fe.attributeNameCheck instanceof RegExp&&Qt(Fe.attributeNameCheck,F)||Fe.attributeNameCheck instanceof Function&&Fe.attributeNameCheck(F,b))||F==="is"&&Fe.allowCustomizedBuiltInElements&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,J)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(J))))return!1}}return!0},Ri=He({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ai=function(b){return!Ri[vo(b)]&&Qt(Ee,b)},Ii=function(b,F,J,be){if(G&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!J)switch(k.getAttributeType(b,F)){case"TrustedHTML":return q(be);case"TrustedScriptURL":return we(be)}return be},kr=function(b,F,J,be){try{J?b.setAttributeNS(J,F,be):b.setAttribute(F,be),Hr(b)?vs(b):Cm(s.removed)}catch{ys(F,b)}},Ho=function(b){wn(P.beforeSanitizeAttributes,b,null);const F=b.attributes;if(!F||Hr(b))return;$e=wr(P.uponSanitizeAttribute,$e,en,Ct);const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$e,forceKeepAttr:void 0};let be=F.length;const Ce=Be(b.nodeName);for(;be--;){const ze=F[be],qe=ze.name,Ze=ze.namespaceURI,St=ze.value,bt=Be(qe),Es=St;let At=qe==="value"?Es:Lb(Es);if(J.attrName=bt,J.attrValue=At,J.keepAttr=!0,J.forceKeepAttr=void 0,wn(P.uponSanitizeAttribute,b,J),At=J.attrValue,hs&&(bt==="id"||bt==="name")&&_m(At,ts)!==0&&(ys(qe,b),At=ts+At),Ue&&Qt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,At)){ys(qe,b);continue}if(bt==="attributename"&&Em(At,"href")){ys(qe,b);continue}if(!J.forceKeepAttr){if(!J.keepAttr){ys(qe,b);continue}if(!Y&&Qt(eT,At)){ys(qe,b);continue}if(me&&(At=Wr(At)),!Wo(Ce,bt,At)){ys(qe,b);continue}At=Ii(Ce,bt,Ze,At),At!==Es&&kr(b,qe,Ze,At)}}wn(P.afterSanitizeAttributes,b,null)},Hs=function(b){let F=null;const J=$n(b);for(wn(P.beforeSanitizeShadowDOM,b,null);F=J.nextNode();)if(wn(P.uponSanitizeShadowNode,F,null),Bo(F,b),Ho(F),Ws(F.content)&&Hs(F.content),(M?M(F):F.nodeType)===Wn.element){const Ce=R(F);Ws(Ce)&&(Ke(Ce),Hs(Ce))}wn(P.afterSanitizeShadowDOM,b,null)},Ke=function(b){const F=[{node:b,shadow:null}];for(;F.length>0;){const J=F.pop();if(J.shadow){Hs(J.shadow);continue}const be=J.node,ze=(M?M(be):be.nodeType)===Wn.element,qe=N(be);if(qe)for(let Ze=qe.length-1;Ze>=0;--Ze)F.push({node:qe[Ze],shadow:null});if(ze){const Ze=D?D(be):null;if(typeof Ze=="string"&&Be(Ze)==="template"){const St=be.content;Ws(St)&&F.push({node:St,shadow:null})}}if(ze){const Ze=R(be);Ws(Ze)&&F.push({node:null,shadow:Ze},{node:Ze,shadow:null})}}};return s.sanitize=function(le){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F=null,J=null,be=null,Ce=null;if(st=!le,st&&(le="<!-->"),typeof le!="string"&&!yr(le)&&(le=Fb(le),typeof le!="string"))throw Lr("dirty is not a string, aborting");if(!s.isSupported)return le;mt?(De=gt,$e=Ct):Pn(b),(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&(De=pn(De)),P.uponSanitizeAttribute.length>0&&($e=pn($e)),s.removed=[];const ze=gn&&typeof le!="string"&&yr(le);if(ze){Uo(le);const St=D?D(le):le.nodeName;if(typeof St=="string"){const bt=Be(St);if(!De[bt]||Ht[bt])throw Bs(le),Lr("root node is forbidden and cannot be sanitized in-place")}if(Hr(le))throw Bs(le),Lr("root node is clobbered and cannot be sanitized in-place");try{Ke(le)}catch(bt){throw Bs(le),bt}}else if(yr(le))F=vr("<!---->"),J=F.ownerDocument.importNode(le,!0),J.nodeType===Wn.element&&J.nodeName==="BODY"||J.nodeName==="HTML"?F=J:F.appendChild(J),Ke(J);else{if(!dt&&!me&&!tt&&le.indexOf("<")===-1)return G&&Dn?q(le):le;if(F=vr(le),!F)return dt?null:Dn?$:""}F&&an&&vs(F.firstChild);const qe=ze?le:F;try{const St=$n(qe);for(;be=St.nextNode();)Bo(be,qe),Ho(be),Ws(be.content)&&Hs(be.content)}catch(St){throw ze&&(Bs(le),hi(s.removed,bt=>{bt.element&&gr(bt.element)})),St}if(ze)return hi(s.removed,St=>{St.element&&gr(St.element)}),me&&xn(le),le;if(dt){if(me&&xn(F),Mn)for(Ce=Q.call(F.ownerDocument);F.firstChild;)Ce.appendChild(F.firstChild);else Ce=F;return($e.shadowroot||$e.shadowrootmode)&&(Ce=E.call(o,Ce,!0)),Ce}let Ze=tt?F.outerHTML:F.innerHTML;return tt&&De["!doctype"]&&F.ownerDocument&&F.ownerDocument.doctype&&F.ownerDocument.doctype.name&&Qt(Qb,F.ownerDocument.doctype.name)&&(Ze="<!DOCTYPE "+F.ownerDocument.doctype.name+`>
501
- `+Ze),me&&(Ze=Wr(Ze)),G&&Dn?q(Ze):Ze},s.setConfig=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pn(le),mt=!0,gt=De,Ct=$e},s.clearConfig=function(){yn=null,mt=!1,gt=null,Ct=null,G=te,$=""},s.isValidAttribute=function(le,b,F){yn||Pn({});const J=Be(le),be=Be(b);return Wo(J,be,F)},s.addHook=function(le,b){typeof b=="function"&&Zt(P,le)&&mi(P[le],b)},s.removeHook=function(le,b){if(Zt(P,le)){if(b!==void 0){const F=Mb(P[le],b);return F===-1?void 0:Db(P[le],F,1)[0]}return Cm(P[le])}},s.removeHooks=function(le){Zt(P,le)&&(P[le]=[])},s.removeAllHooks=function(){P=zm()},s}var Kd=Zv();const sT=new Set(["command_execution","file_change","mcp_tool_call","web_search"]),rT=100;function Fm(t){return sT.has(t.type)}function iT({items:t,runtimeType:s,turn:r,threads:o=[]}){const[l,u]=x.useState(!1),[d,p]=x.useState(!1);if(t.length===0)return null;const g=t.length,m=d?0:Math.max(0,g-rT),v=m>0?t.slice(m):t;return a.jsxs("div",{className:"tool-calls",children:[a.jsxs("div",{className:"tool-calls-header",onClick:()=>u(k=>!k),children:[a.jsx("span",{className:"tool-calls-icon",children:a.jsx($1,{size:12})}),a.jsxs("span",{className:"tool-calls-summary",children:[g," tool call",g>1?"s":""]}),a.jsx(Co,{size:14,className:"tool-calls-chevron",style:{transform:l?"rotate(90deg)":"none"}})]}),l&&a.jsxs("div",{className:"tool-calls-body",children:[m>0&&a.jsx("div",{className:"render-load-earlier",children:a.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>p(!0),children:["Show ",m," earlier tool call",m>1?"s":""]})}),v.map(k=>a.jsx(Ps,{item:k,runtimeType:s,turn:r,threads:o},k.id))]})]})}Ve.setOptions({breaks:!0,gfm:!0});function oT(t){const s=Ve.parse(t);return Kd.sanitize(s)}function Um(t,s){var l;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let o=0;for(;r.nextNode();){const u=r.currentNode,d=((l=u.textContent)==null?void 0:l.length)??0;if(o+d>s)return{node:u,offset:s-o};o+=d}return null}function aT(t,s,r){const o=document.createTreeWalker(t,NodeFilter.SHOW_TEXT),l=[];for(;o.nextNode();){const u=o.currentNode;if(!u.textContent||u.textContent.trim()==="")continue;const d=document.createRange();d.selectNodeContents(u),!(d.compareBoundaryPoints(Range.START_TO_END,s)<=0)&&(d.compareBoundaryPoints(Range.END_TO_START,s)>=0||l.push(u))}for(const u of l){const d=u.length;let p=0,g=d;if(u===s.startContainer&&(p=Math.min(s.startOffset,d)),u===s.endContainer&&(g=Math.min(s.endOffset,d)),p>=g)continue;g<d&&u.splitText(g);const m=p>0?u.splitText(p):u,v=r(),k=m.parentNode;k&&(k.insertBefore(v,m),v.appendChild(m))}}function lT(t,s){t.querySelectorAll("mark[data-thread-id]").forEach(r=>{const o=r.parentNode;if(!o)return;const l=document.createTextNode(r.textContent||"");o.replaceChild(l,r),o.normalize()});for(const r of s){if(r.start_offset===null||r.end_offset===null)continue;const o=Um(t,r.start_offset),l=Um(t,r.end_offset);if(!o||!l)continue;const u=document.createRange();u.setStart(o.node,o.offset),u.setEnd(l.node,l.offset),aT(t,u,()=>{const d=document.createElement("mark");return d.setAttribute("data-thread-id",r.id),r.status==="resolved"&&d.classList.add("thread-mark-resolved"),d})}}function cT(t){const s=window.getSelection();if(!s||s.rangeCount===0)return null;const r=s.getRangeAt(0);if(r.collapsed||!t.contains(r.commonAncestorContainer))return null;const o=document.createRange();o.setStart(t,0),o.setEnd(r.startContainer,r.startOffset);const l=o.toString().length,u=r.toString();return{start:l,end:l+u.length,text:u}}function uT({itemId:t,turnId:s,sessionId:r,content:o,threads:l}){const u=x.useRef(null),d=x.useRef(null),p=x.useRef(null),g=x.useRef(""),m=x.useRef(0),[v,k]=x.useState(!1),[y,S]=x.useState({x:0,y:0}),[T,_]=x.useState(!1),[N,C]=x.useState({x:0,y:0}),[R,H]=x.useState(""),[M,D]=x.useState(null),[K,G]=x.useState(!1),$=I(B=>B.createThread),te=I(B=>B.switchRightTab),he=I(B=>Al(B.sessionDetails[r])),ue=x.useCallback(async()=>{await Io(o||""),G(!0),setTimeout(()=>G(!1),1500)},[o]),Se=x.useCallback(()=>{var E;if(!M)return;const B=`
497
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ts(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:s,tokens:r}){const o=this.parser.parseInline(r),l=bm(t);if(l===null)return o;t=l;let u='<a href="'+t+'"';return s&&(u+=' title="'+Ts(s)+'"'),u+=">"+o+"</a>",u}image({href:t,title:s,text:r,tokens:o}){o&&(r=this.parser.parseInline(o,this.parser.textRenderer));const l=bm(t);if(l===null)return Ts(r);t=l;let u=`<img src="${t}" alt="${r}"`;return s&&(u+=` title="${Ts(s)}"`),u+=">",u}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ts(t.text)}},Kd=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},zs=class ld{constructor(s){it(this,"options");it(this,"renderer");it(this,"textRenderer");this.options=s||Ur,this.options.renderer=this.options.renderer||new _l,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Kd}static parse(s,r){return new ld(r).parse(s)}static parseInline(s,r){return new ld(r).parseInline(s)}parse(s,r=!0){var l,u;let o="";for(let d=0;d<s.length;d++){const p=s[d];if((u=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&u[p.type]){const m=p,v=this.options.extensions.renderers[m.type].call({parser:this},m);if(v!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(m.type)){o+=v||"";continue}}const g=p;switch(g.type){case"space":{o+=this.renderer.space(g);continue}case"hr":{o+=this.renderer.hr(g);continue}case"heading":{o+=this.renderer.heading(g);continue}case"code":{o+=this.renderer.code(g);continue}case"table":{o+=this.renderer.table(g);continue}case"blockquote":{o+=this.renderer.blockquote(g);continue}case"list":{o+=this.renderer.list(g);continue}case"html":{o+=this.renderer.html(g);continue}case"paragraph":{o+=this.renderer.paragraph(g);continue}case"text":{let m=g,v=this.renderer.text(m);for(;d+1<s.length&&s[d+1].type==="text";)m=s[++d],v+=`
498
+ `+this.renderer.text(m);r?o+=this.renderer.paragraph({type:"paragraph",raw:v,text:v,tokens:[{type:"text",raw:v,text:v,escaped:!0}]}):o+=v;continue}default:{const m='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return o}parseInline(s,r=this.renderer){var l,u;let o="";for(let d=0;d<s.length;d++){const p=s[d];if((u=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&u[p.type]){const m=this.options.extensions.renderers[p.type].call({parser:this},p);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(p.type)){o+=m||"";continue}}const g=p;switch(g.type){case"escape":{o+=r.text(g);break}case"html":{o+=r.html(g);break}case"link":{o+=r.link(g);break}case"image":{o+=r.image(g);break}case"strong":{o+=r.strong(g);break}case"em":{o+=r.em(g);break}case"codespan":{o+=r.codespan(g);break}case"br":{o+=r.br(g);break}case"del":{o+=r.del(g);break}case"text":{o+=r.text(g);break}default:{const m='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return o}},qu,ll=(qu=class{constructor(t){it(this,"options");it(this,"block");this.options=t||Ur}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?$s.lex:$s.lexInline}provideParser(){return this.block?zs.parse:zs.parseInline}},it(qu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),qu),Ab=class{constructor(...t){it(this,"defaults",zd());it(this,"options",this.setOptions);it(this,"parse",this.parseMarkdown(!0));it(this,"parseInline",this.parseMarkdown(!1));it(this,"Parser",zs);it(this,"Renderer",_l);it(this,"TextRenderer",Kd);it(this,"Lexer",$s);it(this,"Tokenizer",El);it(this,"Hooks",ll);this.use(...t)}walkTokens(t,s){var o,l;let r=[];for(const u of t)switch(r=r.concat(s.call(this,u)),u.type){case"table":{const d=u;for(const p of d.header)r=r.concat(this.walkTokens(p.tokens,s));for(const p of d.rows)for(const g of p)r=r.concat(this.walkTokens(g.tokens,s));break}case"list":{const d=u;r=r.concat(this.walkTokens(d.items,s));break}default:{const d=u;(l=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&l[d.type]?this.defaults.extensions.childTokens[d.type].forEach(p=>{const g=d[p].flat(1/0);r=r.concat(this.walkTokens(g,s))}):d.tokens&&(r=r.concat(this.walkTokens(d.tokens,s)))}}return r}use(...t){const s=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{const o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){const u=s.renderers[l.name];u?s.renderers[l.name]=function(...d){let p=l.renderer.apply(this,d);return p===!1&&(p=u.apply(this,d)),p}:s.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const u=s[l.level];u?u.unshift(l.tokenizer):s[l.level]=[l.tokenizer],l.start&&(l.level==="block"?s.startBlock?s.startBlock.push(l.start):s.startBlock=[l.start]:l.level==="inline"&&(s.startInline?s.startInline.push(l.start):s.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(s.childTokens[l.name]=l.childTokens)}),o.extensions=s),r.renderer){const l=this.defaults.renderer||new _l(this.defaults);for(const u in r.renderer){if(!(u in l))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;const d=u,p=r.renderer[d],g=l[d];l[d]=(...m)=>{let v=p.apply(l,m);return v===!1&&(v=g.apply(l,m)),v||""}}o.renderer=l}if(r.tokenizer){const l=this.defaults.tokenizer||new El(this.defaults);for(const u in r.tokenizer){if(!(u in l))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;const d=u,p=r.tokenizer[d],g=l[d];l[d]=(...m)=>{let v=p.apply(l,m);return v===!1&&(v=g.apply(l,m)),v}}o.tokenizer=l}if(r.hooks){const l=this.defaults.hooks||new ll;for(const u in r.hooks){if(!(u in l))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;const d=u,p=r.hooks[d],g=l[d];ll.passThroughHooks.has(u)?l[d]=m=>{if(this.defaults.async)return Promise.resolve(p.call(l,m)).then(k=>g.call(l,k));const v=p.call(l,m);return g.call(l,v)}:l[d]=(...m)=>{let v=p.apply(l,m);return v===!1&&(v=g.apply(l,m)),v}}o.hooks=l}if(r.walkTokens){const l=this.defaults.walkTokens,u=r.walkTokens;o.walkTokens=function(d){let p=[];return p.push(u.call(this,d)),l&&(p=p.concat(l.call(this,d))),p}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,s){return $s.lex(t,s??this.defaults)}parser(t,s){return zs.parse(t,s??this.defaults)}parseMarkdown(t){return(r,o)=>{const l={...o},u={...this.defaults,...l},d=this.onError(!!u.silent,!!u.async);if(this.defaults.async===!0&&l.async===!1)return d(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));u.hooks&&(u.hooks.options=u,u.hooks.block=t);const p=u.hooks?u.hooks.provideLexer():t?$s.lex:$s.lexInline,g=u.hooks?u.hooks.provideParser():t?zs.parse:zs.parseInline;if(u.async)return Promise.resolve(u.hooks?u.hooks.preprocess(r):r).then(m=>p(m,u)).then(m=>u.hooks?u.hooks.processAllTokens(m):m).then(m=>u.walkTokens?Promise.all(this.walkTokens(m,u.walkTokens)).then(()=>m):m).then(m=>g(m,u)).then(m=>u.hooks?u.hooks.postprocess(m):m).catch(d);try{u.hooks&&(r=u.hooks.preprocess(r));let m=p(r,u);u.hooks&&(m=u.hooks.processAllTokens(m)),u.walkTokens&&this.walkTokens(m,u.walkTokens);let v=g(m,u);return u.hooks&&(v=u.hooks.postprocess(v)),v}catch(m){return d(m)}}}onError(t,s){return r=>{if(r.message+=`
499
+ Please report this to https://github.com/markedjs/marked.`,t){const o="<p>An error occurred:</p><pre>"+Ts(r.message+"",!0)+"</pre>";return s?Promise.resolve(o):o}if(s)return Promise.reject(r);throw r}}},zr=new Ab;function Ge(t,s){return zr.parse(t,s)}Ge.options=Ge.setOptions=function(t){return zr.setOptions(t),Ge.defaults=zr.defaults,Bv(Ge.defaults),Ge};Ge.getDefaults=zd;Ge.defaults=Ur;Ge.use=function(...t){return zr.use(...t),Ge.defaults=zr.defaults,Bv(Ge.defaults),Ge};Ge.walkTokens=function(t,s){return zr.walkTokens(t,s)};Ge.parseInline=zr.parseInline;Ge.Parser=zs;Ge.parser=zs.parse;Ge.Renderer=_l;Ge.TextRenderer=Kd;Ge.Lexer=$s;Ge.lexer=$s.lex;Ge.Tokenizer=El;Ge.Hooks=ll;Ge.parse=Ge;Ge.options;Ge.setOptions;Ge.use;Ge.walkTokens;Ge.parseInline;zs.parse;$s.lex;/*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */function jm(t,s){(s==null||s>t.length)&&(s=t.length);for(var r=0,o=Array(s);r<s;r++)o[r]=t[r];return o}function Ib(t){if(Array.isArray(t))return t}function Mb(t,s){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var o,l,u,d,p=[],g=!0,m=!1;try{if(u=(r=r.call(t)).next,s!==0)for(;!(g=(o=u.call(r)).done)&&(p.push(o.value),p.length!==s);g=!0);}catch(v){m=!0,l=v}finally{try{if(!g&&r.return!=null&&(d=r.return(),Object(d)!==d))return}finally{if(m)throw l}}return p}}function Db(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
500
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lb(t,s){return Ib(t)||Mb(t,s)||Ob(t,s)||Db()}function Ob(t,s){if(t){if(typeof t=="string")return jm(t,s);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jm(t,s):void 0}}const Jv=Object.entries,Cm=Object.setPrototypeOf,Pb=Object.isFrozen,$b=Object.getPrototypeOf,zb=Object.getOwnPropertyDescriptor;let rn=Object.freeze,on=Object.seal,vi=Object.create,ey=typeof Reflect<"u"&&Reflect,cd=ey.apply,ud=ey.construct;rn||(rn=function(s){return s});on||(on=function(s){return s});cd||(cd=function(s,r){for(var o=arguments.length,l=new Array(o>2?o-2:0),u=2;u<o;u++)l[u-2]=arguments[u];return s.apply(r,l)});ud||(ud=function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),l=1;l<r;l++)o[l-1]=arguments[l];return new s(...o)});const hi=Pt(Array.prototype.forEach),Fb=Pt(Array.prototype.lastIndexOf),Em=Pt(Array.prototype.pop),mi=Pt(Array.prototype.push),Ub=Pt(Array.prototype.splice),ur=Array.isArray,vo=Pt(String.prototype.toLowerCase),Uu=Pt(String.prototype.toString),_m=Pt(String.prototype.match),po=Pt(String.prototype.replace),Rm=Pt(String.prototype.indexOf),Bb=Pt(String.prototype.trim),Wb=Pt(Number.prototype.toString),Hb=Pt(Boolean.prototype.toString),Am=typeof BigInt>"u"?null:Pt(BigInt.prototype.toString),Im=typeof Symbol>"u"?null:Pt(Symbol.prototype.toString),Zt=Pt(Object.prototype.hasOwnProperty),ho=Pt(Object.prototype.toString),Qt=Pt(RegExp.prototype.test),Lr=Vb(TypeError);function Pt(t){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var r=arguments.length,o=new Array(r>1?r-1:0),l=1;l<r;l++)o[l-1]=arguments[l];return cd(t,s,o)}}function Vb(t){return function(){for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return ud(t,r)}}function Ve(t,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:vo;if(Cm&&Cm(t,null),!ur(s))return t;let o=s.length;for(;o--;){let l=s[o];if(typeof l=="string"){const u=r(l);u!==l&&(Pb(s)||(s[o]=u),l=u)}t[l]=!0}return t}function Gb(t){for(let s=0;s<t.length;s++)Zt(t,s)||(t[s]=null);return t}function pn(t){const s=vi(null);for(const o of Jv(t)){var r=Lb(o,2);const l=r[0],u=r[1];Zt(t,l)&&(ur(u)?s[l]=Gb(u):u&&typeof u=="object"&&u.constructor===Object?s[l]=pn(u):s[l]=u)}return s}function Kb(t){switch(typeof t){case"string":return t;case"number":return Wb(t);case"boolean":return Hb(t);case"bigint":return Am?Am(t):"0";case"symbol":return Im?Im(t):"Symbol()";case"undefined":return ho(t);case"function":case"object":{if(t===null)return ho(t);const s=t,r=ls(s,"toString");if(typeof r=="function"){const o=r(s);return typeof o=="string"?o:ho(o)}return ho(t)}default:return ho(t)}}function ls(t,s){for(;t!==null;){const o=zb(t,s);if(o){if(o.get)return Pt(o.get);if(typeof o.value=="function")return Pt(o.value)}t=$b(t)}function r(){return null}return r}function qb(t){try{return Qt(t,""),!0}catch{return!1}}const Mm=rn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Bu=rn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Wu=rn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Yb=rn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Hu=rn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Xb=rn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Dm=rn(["#text"]),Lm=rn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Vu=rn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Om=rn(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ja=rn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Qb=on(/{{[\w\W]*|^[\w\W]*}}/g),Zb=on(/<%[\w\W]*|^[\w\W]*%>/g),Jb=on(/\${[\w\W]*/g),eT=on(/^data-[\-\w.\u00B7-\uFFFF]+$/),tT=on(/^aria-[\-\w]+$/),Pm=on(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),nT=on(/^(?:\w+script|data):/i),sT=on(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),rT=on(/^html$/i),iT=on(/^[a-z][.\w]*(-[.\w]+)+$/i),$m=on(/<[/\w!]/g),zm=on(/<[/\w]/g),oT=on(/<\/no(script|embed|frames)/i),aT=on(/\/>/i),Wn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},lT=function(){return typeof window>"u"?null:window},cT=function(s,r){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let o=null;const l="data-tt-policy-suffix";r&&r.hasAttribute(l)&&(o=r.getAttribute(l));const u="dompurify"+(o?"#"+o:"");try{return s.createPolicy(u,{createHTML(d){return d},createScriptURL(d){return d}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},Fm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},lr=function(s,r,o,l){return Zt(s,r)&&ur(s[r])?Ve(l.base?pn(l.base):{},s[r],l.transform):o};function ty(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lT();const s=ce=>ty(ce);if(s.version="3.4.13",s.removed=[],!t||!t.document||t.document.nodeType!==Wn.document||!t.Element)return s.isSupported=!1,s;let r=t.document;const o=r,l=o.currentScript;t.DocumentFragment;const u=t.HTMLTemplateElement,d=t.Node,p=t.Element,g=t.NodeFilter,m=t.NamedNodeMap;m===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const v=t.DOMParser,k=t.trustedTypes,y=p.prototype,S=ls(y,"cloneNode"),T=ls(y,"remove"),_=ls(y,"nextSibling"),N=ls(y,"childNodes"),E=ls(y,"parentNode"),j=ls(y,"shadowRoot"),W=ls(y,"attributes"),A=d&&d.prototype?ls(d.prototype,"nodeType"):null,D=d&&d.prototype?ls(d.prototype,"nodeName"):null,G=d&&d.prototype?ls(d.prototype,"ownerDocument"):null;if(typeof u=="function"){const ce=r.createElement("template");ce.content&&ce.content.ownerDocument&&(r=ce.content.ownerDocument)}let V,$="",te,me=!1,de=0;const je=function(){if(de>0)throw Lr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},K=function(b){je(),de++;try{return V.createHTML(b)}finally{de--}},be=function(b){je(),de++;try{return V.createScriptURL(b)}finally{de--}},Z=function(){return me||(te=cT(k,l),me=!0),te},oe=r,ae=oe.implementation,z=oe.createNodeIterator,Q=oe.createDocumentFragment,q=oe.getElementsByTagName,M=o.importNode;let P=Fm();s.isSupported=typeof Jv=="function"&&typeof E=="function"&&ae&&ae.createHTMLDocument!==void 0;const le=Qb,ge=Zb,X=Jb,pe=eT,Te=tT,se=nT,he=sT,Se=iT;let He=Pm,Re=null;const ct=Ve({},[...Mm,...Bu,...Wu,...Hu,...Dm]);let $e=null;const en=Ve({},[...Lm,...Vu,...Om,...Ja]);let Fe=Object.seal(vi(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ht=null,tn=null;const wt=Object.seal(vi(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let jt=!0,zt=!0,Dt=!1,Y=!0,ve=!1,Ue=!0,nt=!1,mt=!1,gt=null,Ct=null,an=!1,dt=!1,Mn=!1,Dn=!1,hs=!0,ms=!1;const ts="user-content-";let Ln=!0,gn=!1,ln={},Vt=null;const vn=Ve({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Qe=null;const Et=Ve({},["audio","video","img","source","image","track"]);let ft=null;const Gt=Ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vt="http://www.w3.org/1998/Math/MathML",yt="http://www.w3.org/2000/svg",at="http://www.w3.org/1999/xhtml";let Kt=at,rt=!1,Lt=null;const R=Ve({},[vt,yt,at],Uu),fe=rn(["mi","mo","mn","ms","mtext"]);let ie=Ve({},fe);const we=rn(["annotation-xml"]);let Le=Ve({},we);const Ke=Ve({},["title","style","font","a","script"]);let Oe=null;const Ft=["application/xhtml+xml","text/html"],On="text/html";let Be=null,yn=null;const Cs=r.createElement("form"),Us=function(b){return b instanceof RegExp||b instanceof Function},Pn=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(yn&&yn===b)return;(!b||typeof b!="object")&&(b={}),b=pn(b),Oe=Ft.indexOf(b.PARSER_MEDIA_TYPE)===-1?On:b.PARSER_MEDIA_TYPE,Be=Oe==="application/xhtml+xml"?Uu:vo,Re=lr(b,"ALLOWED_TAGS",ct,{transform:Be}),$e=lr(b,"ALLOWED_ATTR",en,{transform:Be}),Lt=lr(b,"ALLOWED_NAMESPACES",R,{transform:Uu}),ft=lr(b,"ADD_URI_SAFE_ATTR",Gt,{transform:Be,base:Gt}),Qe=lr(b,"ADD_DATA_URI_TAGS",Et,{transform:Be,base:Et}),Vt=lr(b,"FORBID_CONTENTS",vn,{transform:Be}),Ht=lr(b,"FORBID_TAGS",pn({}),{transform:Be}),tn=lr(b,"FORBID_ATTR",pn({}),{transform:Be}),ln=Zt(b,"USE_PROFILES")?b.USE_PROFILES&&typeof b.USE_PROFILES=="object"?pn(b.USE_PROFILES):b.USE_PROFILES:!1,jt=b.ALLOW_ARIA_ATTR!==!1,zt=b.ALLOW_DATA_ATTR!==!1,Dt=b.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ve=b.SAFE_FOR_TEMPLATES||!1,Ue=b.SAFE_FOR_XML!==!1,nt=b.WHOLE_DOCUMENT||!1,dt=b.RETURN_DOM||!1,Mn=b.RETURN_DOM_FRAGMENT||!1,Dn=b.RETURN_TRUSTED_TYPE||!1,an=b.FORCE_BODY||!1,hs=b.SANITIZE_DOM!==!1,ms=b.SANITIZE_NAMED_PROPS||!1,Ln=b.KEEP_CONTENT!==!1,gn=b.IN_PLACE||!1,He=qb(b.ALLOWED_URI_REGEXP)?b.ALLOWED_URI_REGEXP:Pm,Kt=typeof b.NAMESPACE=="string"?b.NAMESPACE:at,ie=Zt(b,"MATHML_TEXT_INTEGRATION_POINTS")&&b.MATHML_TEXT_INTEGRATION_POINTS&&typeof b.MATHML_TEXT_INTEGRATION_POINTS=="object"?pn(b.MATHML_TEXT_INTEGRATION_POINTS):Ve({},fe),Le=Zt(b,"HTML_INTEGRATION_POINTS")&&b.HTML_INTEGRATION_POINTS&&typeof b.HTML_INTEGRATION_POINTS=="object"?pn(b.HTML_INTEGRATION_POINTS):Ve({},we);const F=Zt(b,"CUSTOM_ELEMENT_HANDLING")&&b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING=="object"?pn(b.CUSTOM_ELEMENT_HANDLING):vi(null);if(Fe=vi(null),Zt(F,"tagNameCheck")&&Us(F.tagNameCheck)&&(Fe.tagNameCheck=F.tagNameCheck),Zt(F,"attributeNameCheck")&&Us(F.attributeNameCheck)&&(Fe.attributeNameCheck=F.attributeNameCheck),Zt(F,"allowCustomizedBuiltInElements")&&typeof F.allowCustomizedBuiltInElements=="boolean"&&(Fe.allowCustomizedBuiltInElements=F.allowCustomizedBuiltInElements),on(Fe),ve&&(zt=!1),Mn&&(dt=!0),ln&&(Re=Ve({},Dm),$e=vi(null),ln.html===!0&&(Ve(Re,Mm),Ve($e,Lm)),ln.svg===!0&&(Ve(Re,Bu),Ve($e,Vu),Ve($e,Ja)),ln.svgFilters===!0&&(Ve(Re,Wu),Ve($e,Vu),Ve($e,Ja)),ln.mathMl===!0&&(Ve(Re,Hu),Ve($e,Om),Ve($e,Ja))),wt.tagCheck=null,wt.attributeCheck=null,Zt(b,"ADD_TAGS")&&(typeof b.ADD_TAGS=="function"?wt.tagCheck=b.ADD_TAGS:ur(b.ADD_TAGS)&&(Re===ct&&(Re=pn(Re)),Ve(Re,b.ADD_TAGS,Be))),Zt(b,"ADD_ATTR")&&(typeof b.ADD_ATTR=="function"?wt.attributeCheck=b.ADD_ATTR:ur(b.ADD_ATTR)&&($e===en&&($e=pn($e)),Ve($e,b.ADD_ATTR,Be))),Zt(b,"ADD_URI_SAFE_ATTR")&&ur(b.ADD_URI_SAFE_ATTR)&&Ve(ft,b.ADD_URI_SAFE_ATTR,Be),Zt(b,"FORBID_CONTENTS")&&ur(b.FORBID_CONTENTS)&&(Vt===vn&&(Vt=pn(Vt)),Ve(Vt,b.FORBID_CONTENTS,Be)),Zt(b,"ADD_FORBID_CONTENTS")&&ur(b.ADD_FORBID_CONTENTS)&&(Vt===vn&&(Vt=pn(Vt)),Ve(Vt,b.ADD_FORBID_CONTENTS,Be)),Ln&&(Re["#text"]=!0),nt&&Ve(Re,["html","head","body"]),Re.table&&(Ve(Re,["tbody"]),delete Ht.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Lr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Lr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const J=V;V=b.TRUSTED_TYPES_POLICY;try{$=K("")}catch(Ce){throw V=J,Ce}}else b.TRUSTED_TYPES_POLICY===null?(V=void 0,$=""):(V===void 0&&(V=Z()),V&&typeof $=="string"&&($=K("")));rn&&rn(b),yn=b},gs=Ve({},[...Bu,...Wu,...Yb]),Ze=Ve({},[...Hu,...Xb]),_t=function(b,F,J){return F.namespaceURI===at?b==="svg":F.namespaceURI===vt?b==="svg"&&(J==="annotation-xml"||ie[J]):!!gs[b]},vs=function(b,F,J){return F.namespaceURI===at?b==="math":F.namespaceURI===yt?b==="math"&&Le[J]:!!Ze[b]},Kl=function(b,F,J){return F.namespaceURI===yt&&!Le[J]||F.namespaceURI===vt&&!ie[J]?!1:!Ze[b]&&(Ke[b]||!gs[b])},kt=function(b){let F=E(b);(!F||!F.tagName)&&(F={namespaceURI:Kt,tagName:"template"});const J=vo(b.tagName),Ce=vo(F.tagName);return Lt[b.namespaceURI]?b.namespaceURI===yt?_t(J,F,Ce):b.namespaceURI===vt?vs(J,F,Ce):b.namespaceURI===at?Kl(J,F,Ce):!!(Oe==="application/xhtml+xml"&&Lt[b.namespaceURI]):!1},ys=function(b){mi(s.removed,{element:b});try{E(b).removeChild(b)}catch{if(T(b),!E(b))throw Lr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Bs=function(b){gr(b);const F=N(b);if(F){const Ce=[];hi(F,Ae=>{mi(Ce,Ae)}),hi(Ce,Ae=>{try{T(Ae)}catch{}})}const J=W(b);if(J)for(let Ce=J.length-1;Ce>=0;--Ce){const Ae=J[Ce],ze=Ae&&Ae.name;if(typeof ze=="string")try{b.removeAttribute(ze)}catch{}}},xs=function(b,F){try{mi(s.removed,{attribute:F.getAttributeNode(b),from:F})}catch{mi(s.removed,{attribute:null,from:F})}if(F.removeAttribute(b),b==="is")if(dt||Mn)try{ys(F)}catch{}else try{F.setAttribute(b,"")}catch{}},Br=function(b){const F=W(b);if(F)for(let J=F.length-1;J>=0;--J){const Ce=F[J],Ae=Ce&&Ce.name;if(!(typeof Ae!="string"||$e[Be(Ae)]))try{b.removeAttribute(Ae)}catch{}}},gr=function(b){const F=[b];for(;F.length>0;){const J=F.pop();(A?A(J):J.nodeType)===Wn.element&&Br(J);const Ae=N(J);if(Ae)for(let ze=Ae.length-1;ze>=0;--ze)F.push(Ae[ze])}},Uo=function(b){if(!Ue)return;const F=[b];for(;F.length>0;){const J=F.pop(),Ce=A?A(J):J.nodeType;if(Ce===Wn.processingInstruction||Ce===Wn.comment&&Qt(zm,J.data)){try{T(J)}catch{}continue}if(Ce===Wn.element){const ze=J,Ye=Be(D?D(J):J.nodeName);try{ze.hasAttribute&&ze.hasAttribute("patchsrc")&&ze.removeAttribute("patchsrc"),ze.hasAttribute&&ze.hasAttribute("for")&&Ye!=="label"&&Ye!=="output"&&ze.removeAttribute("for")}catch{}}const Ae=N(J);if(Ae)for(let ze=Ae.length-1;ze>=0;--ze)F.push(Ae[ze])}},vr=function(b){let F=null,J=null;if(an)b="<remove></remove>"+b;else{const ze=_m(b,/^[\r\n\t ]+/);J=ze&&ze[0]}Oe==="application/xhtml+xml"&&Kt===at&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const Ce=V?K(b):b;if(Kt===at)try{F=new v().parseFromString(Ce,Oe)}catch{}if(!F||!F.documentElement){F=ae.createDocument(Kt,"template",null);try{F.documentElement.innerHTML=rt?$:Ce}catch{}}const Ae=F.body||F.documentElement;return b&&J&&Ae.insertBefore(r.createTextNode(J),Ae.childNodes[0]||null),Kt===at?q.call(F,nt?"html":"body")[0]:nt?F.documentElement:Ae},$n=function(b){const F=G?G(b):b.ownerDocument;return z.call(F||b,b,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Wr=function(b){return b=po(b,le," "),b=po(b,ge," "),b=po(b,X," "),b},xn=function(b){var F;b.normalize();const J=G?G(b):b.ownerDocument,Ce=z.call(J||b,b,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let Ae=Ce.nextNode();for(;Ae;)Ae.data=Wr(Ae.data),Ae=Ce.nextNode();const ze=(F=b.querySelectorAll)===null||F===void 0?void 0:F.call(b,"template");ze&&hi(ze,Ye=>{Ws(Ye.content)&&xn(Ye.content)})},Hr=function(b){const F=D?D(b):null;return typeof F!="string"||Be(F)!=="form"?!1:typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||b.attributes!==W(b)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function"||b.nodeType!==A(b)||b.childNodes!==N(b)},Ws=function(b){if(!A||typeof b!="object"||b===null)return!1;try{return A(b)===Wn.documentFragment}catch{return!1}},yr=function(b){if(!A||typeof b!="object"||b===null)return!1;try{return typeof A(b)=="number"}catch{return!1}};function wn(ce,b,F){ce.length!==0&&hi(ce,J=>{J.call(s,b,F,yn)})}const Vr=function(b,F){return!!(Ue&&b.hasChildNodes()&&!yr(b.firstElementChild)&&Qt($m,b.textContent)&&Qt($m,b.innerHTML)||Ue&&b.namespaceURI===at&&F==="style"&&yr(b.firstElementChild)||b.nodeType===Wn.processingInstruction||Ue&&b.nodeType===Wn.comment&&Qt(zm,b.data))},xr=function(b,F,J){if(!Ht[F]&&Ai(F)&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,F)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(F)))return!1;if(Ln&&!Vt[F]){const Ce=E(b),Ae=N(b);if(Ae&&Ce){const ze=Ae.length;for(let Ye=ze-1;Ye>=0;--Ye){const Je=b===J?S(Ae[Ye],!0):Ae[Ye];Ce.insertBefore(Je,_(b))}}}return ys(b),!0},wr=function(b,F,J,Ce){return b.length===0?F:F===J||F===Ce?pn(F):F},Bo=function(b,F){if(wn(P.beforeSanitizeElements,b,null),b!==F&&E(b)===null)return gn&&gr(b),!0;if(Hr(b))return ys(b),!0;const J=Be(D?D(b):b.nodeName);if(Re=wr(P.uponSanitizeElement,Re,ct,gt),wn(P.uponSanitizeElement,b,{tagName:J,allowedTags:Re}),b!==F&&E(b)===null)return gn&&gr(b),!0;if(Vr(b,J))return ys(b),!0;if(Ht[J]||!(wt.tagCheck instanceof Function&&wt.tagCheck(J))&&!Re[J]){const Ae=xr(b,J,F);return Ae===!1&&wn(P.afterSanitizeElements,b,null),Ae}if((A?A(b):b.nodeType)===Wn.element&&!kt(b)||(J==="noscript"||J==="noembed"||J==="noframes")&&Qt(oT,b.innerHTML))return ys(b),!0;if(ve&&b.nodeType===Wn.text){const Ae=Wr(b.textContent);b.textContent!==Ae&&(mi(s.removed,{element:b.cloneNode()}),b.textContent=Ae)}return wn(P.afterSanitizeElements,b,null),!1},Wo=function(b,F,J){if(tn[F]||Ue&&F==="patchsrc"||Ue&&F==="for"&&b!=="label"&&b!=="output"||hs&&(F==="id"||F==="name")&&(J in r||J in Cs))return!1;const Ce=$e[F]||wt.attributeCheck instanceof Function&&wt.attributeCheck(F,b);if(!(zt&&Qt(pe,F))){if(!(jt&&Qt(Te,F))){if(Ce){if(!ft[F]){if(!Qt(He,po(J,he,""))){if(!((F==="src"||F==="xlink:href"||F==="href")&&b!=="script"&&Rm(J,"data:")===0&&Qe[b])){if(!(Dt&&!Qt(se,po(J,he,"")))){if(J)return!1}}}}}else if(!(Ai(b)&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,b)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(b))&&(Fe.attributeNameCheck instanceof RegExp&&Qt(Fe.attributeNameCheck,F)||Fe.attributeNameCheck instanceof Function&&Fe.attributeNameCheck(F,b))||F==="is"&&Fe.allowCustomizedBuiltInElements&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,J)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(J))))return!1}}return!0},Ri=Ve({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ai=function(b){return!Ri[vo(b)]&&Qt(Se,b)},Ii=function(b,F,J,Ce){if(V&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!J)switch(k.getAttributeType(b,F)){case"TrustedHTML":return K(Ce);case"TrustedScriptURL":return be(Ce)}return Ce},kr=function(b,F,J,Ce){try{J?b.setAttributeNS(J,F,Ce):b.setAttribute(F,Ce),Hr(b)?ys(b):Em(s.removed)}catch{xs(F,b)}},Ho=function(b){wn(P.beforeSanitizeAttributes,b,null);const F=b.attributes;if(!F||Hr(b))return;$e=wr(P.uponSanitizeAttribute,$e,en,Ct);const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$e,forceKeepAttr:void 0};let Ce=F.length;const Ae=Be(b.nodeName);for(;Ce--;){const ze=F[Ce],Ye=ze.name,Je=ze.namespaceURI,St=ze.value,bt=Be(Ye),Es=St;let At=Ye==="value"?Es:Bb(Es);if(J.attrName=bt,J.attrValue=At,J.keepAttr=!0,J.forceKeepAttr=void 0,wn(P.uponSanitizeAttribute,b,J),At=J.attrValue,ms&&(bt==="id"||bt==="name")&&Rm(At,ts)!==0&&(xs(Ye,b),At=ts+At),Ue&&Qt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,At)){xs(Ye,b);continue}if(bt==="attributename"&&_m(At,"href")){xs(Ye,b);continue}if(!J.forceKeepAttr){if(!J.keepAttr){xs(Ye,b);continue}if(!Y&&Qt(aT,At)){xs(Ye,b);continue}if(ve&&(At=Wr(At)),!Wo(Ae,bt,At)){xs(Ye,b);continue}At=Ii(Ae,bt,Je,At),At!==Es&&kr(b,Ye,Je,At)}}wn(P.afterSanitizeAttributes,b,null)},Hs=function(b){let F=null;const J=$n(b);for(wn(P.beforeSanitizeShadowDOM,b,null);F=J.nextNode();)if(wn(P.uponSanitizeShadowNode,F,null),Bo(F,b),Ho(F),Ws(F.content)&&Hs(F.content),(A?A(F):F.nodeType)===Wn.element){const Ae=j(F);Ws(Ae)&&(qe(Ae),Hs(Ae))}wn(P.afterSanitizeShadowDOM,b,null)},qe=function(b){const F=[{node:b,shadow:null}];for(;F.length>0;){const J=F.pop();if(J.shadow){Hs(J.shadow);continue}const Ce=J.node,ze=(A?A(Ce):Ce.nodeType)===Wn.element,Ye=N(Ce);if(Ye)for(let Je=Ye.length-1;Je>=0;--Je)F.push({node:Ye[Je],shadow:null});if(ze){const Je=D?D(Ce):null;if(typeof Je=="string"&&Be(Je)==="template"){const St=Ce.content;Ws(St)&&F.push({node:St,shadow:null})}}if(ze){const Je=j(Ce);Ws(Je)&&F.push({node:null,shadow:Je},{node:Je,shadow:null})}}};return s.sanitize=function(ce){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F=null,J=null,Ce=null,Ae=null;if(rt=!ce,rt&&(ce="<!-->"),typeof ce!="string"&&!yr(ce)&&(ce=Kb(ce),typeof ce!="string"))throw Lr("dirty is not a string, aborting");if(!s.isSupported)return ce;mt?(Re=gt,$e=Ct):Pn(b),(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&(Re=pn(Re)),P.uponSanitizeAttribute.length>0&&($e=pn($e)),s.removed=[];const ze=gn&&typeof ce!="string"&&yr(ce);if(ze){Uo(ce);const St=D?D(ce):ce.nodeName;if(typeof St=="string"){const bt=Be(St);if(!Re[bt]||Ht[bt])throw Bs(ce),Lr("root node is forbidden and cannot be sanitized in-place")}if(Hr(ce))throw Bs(ce),Lr("root node is clobbered and cannot be sanitized in-place");try{qe(ce)}catch(bt){throw Bs(ce),bt}}else if(yr(ce))F=vr("<!---->"),J=F.ownerDocument.importNode(ce,!0),J.nodeType===Wn.element&&J.nodeName==="BODY"||J.nodeName==="HTML"?F=J:F.appendChild(J),qe(J);else{if(!dt&&!ve&&!nt&&ce.indexOf("<")===-1)return V&&Dn?K(ce):ce;if(F=vr(ce),!F)return dt?null:Dn?$:""}F&&an&&ys(F.firstChild);const Ye=ze?ce:F;try{const St=$n(Ye);for(;Ce=St.nextNode();)Bo(Ce,Ye),Ho(Ce),Ws(Ce.content)&&Hs(Ce.content)}catch(St){throw ze&&(Bs(ce),hi(s.removed,bt=>{bt.element&&gr(bt.element)})),St}if(ze)return hi(s.removed,St=>{St.element&&gr(St.element)}),ve&&xn(ce),ce;if(dt){if(ve&&xn(F),Mn)for(Ae=Q.call(F.ownerDocument);F.firstChild;)Ae.appendChild(F.firstChild);else Ae=F;return($e.shadowroot||$e.shadowrootmode)&&(Ae=M.call(o,Ae,!0)),Ae}let Je=nt?F.outerHTML:F.innerHTML;return nt&&Re["!doctype"]&&F.ownerDocument&&F.ownerDocument.doctype&&F.ownerDocument.doctype.name&&Qt(rT,F.ownerDocument.doctype.name)&&(Je="<!DOCTYPE "+F.ownerDocument.doctype.name+`>
501
+ `+Je),ve&&(Je=Wr(Je)),V&&Dn?K(Je):Je},s.setConfig=function(){let ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pn(ce),mt=!0,gt=Re,Ct=$e},s.clearConfig=function(){yn=null,mt=!1,gt=null,Ct=null,V=te,$=""},s.isValidAttribute=function(ce,b,F){yn||Pn({});const J=Be(ce),Ce=Be(b);return Wo(J,Ce,F)},s.addHook=function(ce,b){typeof b=="function"&&Zt(P,ce)&&mi(P[ce],b)},s.removeHook=function(ce,b){if(Zt(P,ce)){if(b!==void 0){const F=Fb(P[ce],b);return F===-1?void 0:Ub(P[ce],F,1)[0]}return Em(P[ce])}},s.removeHooks=function(ce){Zt(P,ce)&&(P[ce]=[])},s.removeAllHooks=function(){P=Fm()},s}var qd=ty();const uT=new Set(["command_execution","file_change","mcp_tool_call","web_search"]),dT=100;function Um(t){return uT.has(t.type)}function fT({items:t,runtimeType:s,turn:r,threads:o=[]}){const[l,u]=x.useState(!1),[d,p]=x.useState(!1);if(t.length===0)return null;const g=t.length,m=d?0:Math.max(0,g-dT),v=m>0?t.slice(m):t;return a.jsxs("div",{className:"tool-calls",children:[a.jsxs("div",{className:"tool-calls-header",onClick:()=>u(k=>!k),children:[a.jsx("span",{className:"tool-calls-icon",children:a.jsx(V1,{size:12})}),a.jsxs("span",{className:"tool-calls-summary",children:[g," tool call",g>1?"s":""]}),a.jsx(Co,{size:14,className:"tool-calls-chevron",style:{transform:l?"rotate(90deg)":"none"}})]}),l&&a.jsxs("div",{className:"tool-calls-body",children:[m>0&&a.jsx("div",{className:"render-load-earlier",children:a.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>p(!0),children:["Show ",m," earlier tool call",m>1?"s":""]})}),v.map(k=>a.jsx(Ps,{item:k,runtimeType:s,turn:r,threads:o},k.id))]})]})}Ge.setOptions({breaks:!0,gfm:!0});function pT(t){const s=Ge.parse(t);return qd.sanitize(s)}function Bm(t,s){var l;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let o=0;for(;r.nextNode();){const u=r.currentNode,d=((l=u.textContent)==null?void 0:l.length)??0;if(o+d>s)return{node:u,offset:s-o};o+=d}return null}function hT(t,s,r){const o=document.createTreeWalker(t,NodeFilter.SHOW_TEXT),l=[];for(;o.nextNode();){const u=o.currentNode;if(!u.textContent||u.textContent.trim()==="")continue;const d=document.createRange();d.selectNodeContents(u),!(d.compareBoundaryPoints(Range.START_TO_END,s)<=0)&&(d.compareBoundaryPoints(Range.END_TO_START,s)>=0||l.push(u))}for(const u of l){const d=u.length;let p=0,g=d;if(u===s.startContainer&&(p=Math.min(s.startOffset,d)),u===s.endContainer&&(g=Math.min(s.endOffset,d)),p>=g)continue;g<d&&u.splitText(g);const m=p>0?u.splitText(p):u,v=r(),k=m.parentNode;k&&(k.insertBefore(v,m),v.appendChild(m))}}function mT(t,s){t.querySelectorAll("mark[data-thread-id]").forEach(r=>{const o=r.parentNode;if(!o)return;const l=document.createTextNode(r.textContent||"");o.replaceChild(l,r),o.normalize()});for(const r of s){if(r.start_offset===null||r.end_offset===null)continue;const o=Bm(t,r.start_offset),l=Bm(t,r.end_offset);if(!o||!l)continue;const u=document.createRange();u.setStart(o.node,o.offset),u.setEnd(l.node,l.offset),hT(t,u,()=>{const d=document.createElement("mark");return d.setAttribute("data-thread-id",r.id),r.status==="resolved"&&d.classList.add("thread-mark-resolved"),d})}}function gT(t){const s=window.getSelection();if(!s||s.rangeCount===0)return null;const r=s.getRangeAt(0);if(r.collapsed||!t.contains(r.commonAncestorContainer))return null;const o=document.createRange();o.setStart(t,0),o.setEnd(r.startContainer,r.startOffset);const l=o.toString().length,u=r.toString();return{start:l,end:l+u.length,text:u}}function vT({itemId:t,turnId:s,sessionId:r,content:o,threads:l}){const u=x.useRef(null),d=x.useRef(null),p=x.useRef(null),g=x.useRef(""),m=x.useRef(0),[v,k]=x.useState(!1),[y,S]=x.useState({x:0,y:0}),[T,_]=x.useState(!1),[N,E]=x.useState({x:0,y:0}),[j,W]=x.useState(""),[A,D]=x.useState(null),[G,V]=x.useState(!1),$=I(q=>q.createThread),te=I(q=>q.switchRightTab),me=I(q=>Dl(q.sessionDetails[r])),de=x.useCallback(async()=>{await Io(o||""),V(!0),setTimeout(()=>V(!1),1500)},[o]),je=x.useCallback(()=>{var M;if(!A)return;const q=`
502
502
  \`\`\`QUOTE
503
- ${M.text}
503
+ ${A.text}
504
504
  \`\`\`
505
505
 
506
- `;I.setState({quotedText:B}),k(!1),D(null),(E=window.getSelection())==null||E.removeAllRanges()},[M]),q=x.useMemo(()=>oT(o||"…"),[o]),we=x.useMemo(()=>l.filter(B=>B.item_id===t),[l,t]);x.useEffect(()=>{u.current&&lT(u.current,we)},[q,we]),x.useEffect(()=>{g.current=R},[R]),x.useEffect(()=>{function B(E){d.current&&!d.current.contains(E.target)&&(k(!1),g.current.trim()||_(!1))}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);const Z=x.useCallback(()=>{k(!1),g.current.trim()||_(!1)},[]),oe=x.useCallback(()=>{const B=u.current;if(!B)return;const E=cT(B);if(E&&E.text.trim().length>0){const P=window.getSelection();if(P&&P.rangeCount>0&&P.anchorNode&&P.focusNode){const fe=P.getRangeAt(0).getBoundingClientRect(),X=28,pe=6,Ne=170;let _e=!1;try{const at=document.createRange();at.setStart(P.focusNode,P.focusOffset),at.setEnd(P.focusNode,P.focusOffset);const De=document.createRange();De.setStart(P.anchorNode,P.anchorOffset),De.setEnd(P.anchorNode,P.anchorOffset),_e=De.compareBoundaryPoints(Range.START_TO_START,at)>0}catch{_e=!1}let Ae=fe.top-X-pe;Ae<8&&(Ae=fe.bottom+pe);let Ee=_e?fe.left-Ne:fe.right;Ee=Math.max(8,Math.min(Ee,window.innerWidth-Ne-8)),S({x:Ee,y:Ae}),k(!0),D(E)}}else k(!1)},[]);x.useEffect(()=>{function B(E){const P=E.target;P&&(P.closest(".selection-actions")||P.closest(".thread-create-popover"))||oe()}return document.addEventListener("mouseup",B),()=>document.removeEventListener("mouseup",B)},[oe]);const ae=x.useCallback(()=>{k(!1),_(!0),C({x:y.x,y:y.y})},[y]);x.useLayoutEffect(()=>{if(!T)return;const B=p.current;if(!B)return;const E=B.offsetWidth,P=B.offsetHeight,se=8;let fe=y.x,X=y.y;fe-E<se&&(fe=E+se),fe>window.innerWidth-se&&(fe=window.innerWidth-se),X<se&&(X=se),X+P>window.innerHeight-se&&(X=window.innerHeight-P-se),C({x:fe,y:X})},[T,y]);const z=x.useCallback(async()=>{var B;he||!M||!R.trim()||(await $(r,{itemId:t,turnId:s,startOffset:M.start,endOffset:M.end,selectedText:M.text,message:R.trim()}),H(""),_(!1),D(null),(B=window.getSelection())==null||B.removeAllRanges(),te("threads"))},[M,R,$,r,t,s,te,he]),Q=x.useCallback(B=>{const E=B.target;if(E.tagName==="MARK"&&E.hasAttribute("data-thread-id")){B.preventDefault(),te("threads");const P=E.getAttribute("data-thread-id");setTimeout(()=>{const se=document.getElementById(`thread-${P}`);se&&(se.scrollIntoView({behavior:"smooth",block:"center"}),se.classList.add("thread-card-highlighted"),setTimeout(()=>se.classList.remove("thread-card-highlighted"),1500))},100)}},[te]);return a.jsxs("div",{className:"copy-text-wrapper",style:{position:"relative"},ref:d,children:[a.jsx("div",{ref:u,dangerouslySetInnerHTML:{__html:q},onMouseDown:Z,onClick:Q}),a.jsx("button",{className:`copy-text-btn${K?" copied":""}`,onClick:ue,title:K?"Copied":"Copy message","aria-label":"Copy message text",children:K?a.jsx(Ts,{size:14}):a.jsx(Eo,{size:14})}),v&&!T&&a.jsxs("div",{className:"selection-actions",style:{left:y.x,top:y.y},children:[!he&&a.jsxs("button",{className:"discuss-button",onClick:ae,title:"Start a discussion about this text",children:[a.jsx(S1,{size:14}),a.jsx("span",{children:"Discuss"})]}),a.jsxs("button",{className:"discuss-button",onClick:Se,title:"Quote this text in your message",children:[a.jsx(nv,{size:14}),a.jsx("span",{children:"Quote"})]})]}),T&&a.jsxs("div",{ref:p,className:"thread-create-popover",style:{left:N.x,top:N.y},children:[a.jsxs("div",{className:"thread-create-header",children:[a.jsxs("span",{className:"thread-create-quote",children:['"',M==null?void 0:M.text.slice(0,80),M&&M.text.length>80?"…":"",'"']}),a.jsx("button",{className:"thread-create-close",onClick:()=>{_(!1),D(null)},children:a.jsx(Tn,{size:14})})]}),a.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:R,onChange:B=>H(B.target.value),autoFocus:!0,rows:2,onKeyDown:B=>{if(B.key==="Enter"&&(B.metaKey||B.ctrlKey)&&(B.preventDefault(),z()),B.key==="Escape")if(g.current.trim()){const E=Date.now();m.current&&E-m.current<400?(m.current=0,_(!1),D(null)):m.current=E}else _(!1),D(null)}}),a.jsxs("div",{className:"thread-create-footer",children:[a.jsx("span",{className:"thread-create-hint",children:"⌘↵ to send · Esc to cancel"}),a.jsxs("button",{className:"thread-create-send",onClick:z,disabled:!R.trim()||he,title:he?"Wait for the running turn to finish first":void 0,children:[a.jsx(Lo,{size:13}),a.jsx("span",{children:"Send"})]})]})]})]})}const Bm=x.memo(uT),El=new Map,Jv=new Set,cd=new Set,Wm=new Map;function ey(){cd.forEach(t=>t())}function ty(t,s){return`${t}:${s}`}function dT(t,s,r,o,l){var g;const u=ty(s,r),d=El.get(t)??new Map,p=new Map(d);((g=p.get(u))==null?void 0:g.answer)===l?p.delete(u):p.set(u,{itemIndex:s,groupIndex:r,question:o,answer:l}),El.set(t,p),ey()}function fT(t){El.delete(t),ey()}function pT(t){Jv.add(t),fT(t)}function hT(t){const s=x.useCallback(r=>(cd.add(r),()=>{cd.delete(r)}),[]);return x.useSyncExternalStore(s,()=>El.get(t)??Wm,()=>Wm)}function mT(t){return[...t].sort((s,r)=>s.itemIndex-r.itemIndex||s.groupIndex-r.groupIndex).map(s=>`> ${s.question}
506
+ `;I.setState({quotedText:q}),k(!1),D(null),(M=window.getSelection())==null||M.removeAllRanges()},[A]),K=x.useMemo(()=>pT(o||"…"),[o]),be=x.useMemo(()=>l.filter(q=>q.item_id===t),[l,t]);x.useEffect(()=>{u.current&&mT(u.current,be)},[K,be]),x.useEffect(()=>{g.current=j},[j]),x.useEffect(()=>{function q(M){d.current&&!d.current.contains(M.target)&&(k(!1),g.current.trim()||_(!1))}return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[]);const Z=x.useCallback(()=>{k(!1),g.current.trim()||_(!1)},[]),oe=x.useCallback(()=>{const q=u.current;if(!q)return;const M=gT(q);if(M&&M.text.trim().length>0){const P=window.getSelection();if(P&&P.rangeCount>0&&P.anchorNode&&P.focusNode){const ge=P.getRangeAt(0).getBoundingClientRect(),X=28,pe=6,Te=170;let se=!1;try{const He=document.createRange();He.setStart(P.focusNode,P.focusOffset),He.setEnd(P.focusNode,P.focusOffset);const Re=document.createRange();Re.setStart(P.anchorNode,P.anchorOffset),Re.setEnd(P.anchorNode,P.anchorOffset),se=Re.compareBoundaryPoints(Range.START_TO_START,He)>0}catch{se=!1}let he=ge.top-X-pe;he<8&&(he=ge.bottom+pe);let Se=se?ge.left-Te:ge.right;Se=Math.max(8,Math.min(Se,window.innerWidth-Te-8)),S({x:Se,y:he}),k(!0),D(M)}}else k(!1)},[]);x.useEffect(()=>{function q(M){const P=M.target;P&&(P.closest(".selection-actions")||P.closest(".thread-create-popover"))||oe()}return document.addEventListener("mouseup",q),()=>document.removeEventListener("mouseup",q)},[oe]);const ae=x.useCallback(()=>{k(!1),_(!0),E({x:y.x,y:y.y})},[y]);x.useLayoutEffect(()=>{if(!T)return;const q=p.current;if(!q)return;const M=q.offsetWidth,P=q.offsetHeight,le=8;let ge=y.x,X=y.y;ge-M<le&&(ge=M+le),ge>window.innerWidth-le&&(ge=window.innerWidth-le),X<le&&(X=le),X+P>window.innerHeight-le&&(X=window.innerHeight-P-le),E({x:ge,y:X})},[T,y]);const z=x.useCallback(async()=>{var q;me||!A||!j.trim()||(await $(r,{itemId:t,turnId:s,startOffset:A.start,endOffset:A.end,selectedText:A.text,message:j.trim()}),W(""),_(!1),D(null),(q=window.getSelection())==null||q.removeAllRanges(),te("threads"))},[A,j,$,r,t,s,te,me]),Q=x.useCallback(q=>{const M=q.target;if(M.tagName==="MARK"&&M.hasAttribute("data-thread-id")){q.preventDefault(),te("threads");const P=M.getAttribute("data-thread-id");setTimeout(()=>{const le=document.getElementById(`thread-${P}`);le&&(le.scrollIntoView({behavior:"smooth",block:"center"}),le.classList.add("thread-card-highlighted"),setTimeout(()=>le.classList.remove("thread-card-highlighted"),1500))},100)}},[te]);return a.jsxs("div",{className:"copy-text-wrapper",style:{position:"relative"},ref:d,children:[a.jsx("div",{ref:u,dangerouslySetInnerHTML:{__html:K},onMouseDown:Z,onClick:Q}),a.jsx("button",{className:`copy-text-btn${G?" copied":""}`,onClick:de,title:G?"Copied":"Copy message","aria-label":"Copy message text",children:G?a.jsx(Ns,{size:14}):a.jsx(Eo,{size:14})}),v&&!T&&a.jsxs("div",{className:"selection-actions",style:{left:y.x,top:y.y},children:[!me&&a.jsxs("button",{className:"discuss-button",onClick:ae,title:"Start a discussion about this text",children:[a.jsx(_1,{size:14}),a.jsx("span",{children:"Discuss"})]}),a.jsxs("button",{className:"discuss-button",onClick:je,title:"Quote this text in your message",children:[a.jsx(iv,{size:14}),a.jsx("span",{children:"Quote"})]})]}),T&&a.jsxs("div",{ref:p,className:"thread-create-popover",style:{left:N.x,top:N.y},children:[a.jsxs("div",{className:"thread-create-header",children:[a.jsxs("span",{className:"thread-create-quote",children:['"',A==null?void 0:A.text.slice(0,80),A&&A.text.length>80?"…":"",'"']}),a.jsx("button",{className:"thread-create-close",onClick:()=>{_(!1),D(null)},children:a.jsx(Tn,{size:14})})]}),a.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:j,onChange:q=>W(q.target.value),autoFocus:!0,rows:2,onKeyDown:q=>{if(q.key==="Enter"&&(q.metaKey||q.ctrlKey)&&(q.preventDefault(),z()),q.key==="Escape")if(g.current.trim()){const M=Date.now();m.current&&M-m.current<400?(m.current=0,_(!1),D(null)):m.current=M}else _(!1),D(null)}}),a.jsxs("div",{className:"thread-create-footer",children:[a.jsx("span",{className:"thread-create-hint",children:"⌘↵ to send · Esc to cancel"}),a.jsxs("button",{className:"thread-create-send",onClick:z,disabled:!j.trim()||me,title:me?"Wait for the running turn to finish first":void 0,children:[a.jsx(Lo,{size:13}),a.jsx("span",{children:"Send"})]})]})]})]})}const Wm=x.memo(vT),Rl=new Map,ny=new Set,dd=new Set,Hm=new Map;function sy(){dd.forEach(t=>t())}function ry(t,s){return`${t}:${s}`}function yT(t,s,r,o,l){var g;const u=ry(s,r),d=Rl.get(t)??new Map,p=new Map(d);((g=p.get(u))==null?void 0:g.answer)===l?p.delete(u):p.set(u,{itemIndex:s,groupIndex:r,question:o,answer:l}),Rl.set(t,p),sy()}function xT(t){Rl.delete(t),sy()}function wT(t){ny.add(t),xT(t)}function kT(t){const s=x.useCallback(r=>(dd.add(r),()=>{dd.delete(r)}),[]);return x.useSyncExternalStore(s,()=>Rl.get(t)??Hm,()=>Hm)}function ST(t){return[...t].sort((s,r)=>s.itemIndex-r.itemIndex||s.groupIndex-r.groupIndex).map(s=>`> ${s.question}
507
507
  ${s.answer}`).join(`
508
508
 
509
- `)}function Hm({item:t,turn:s}){var S;const r=t.data??{},o=x.useMemo(()=>Array.isArray(r.groups)?r.groups.filter(T=>!!T&&Array.isArray(T.selections)&&T.selections.length>0):[],[r.groups]),l=hT(s.id),u=I(T=>s.session_id?T.sessionDetails[s.session_id]:null),d=I(T=>T.activeSessionId),p=s.items.findIndex(T=>T.id===t.id),g=u?((S=u.turns[u.turns.length-1])==null?void 0:S.id)===s.id:!0,m=Jv.has(s.id),v=m||Rg(u)||!g||s.session_id!==d,k=(T,_,N)=>{v||dT(s.id,p,T,_,N)},y=()=>{const T=[...l.values()];if(T.length===0)return;const _=mT(T);pT(s.id),I.getState().submitPrompt(_)};return a.jsxs("div",{className:"render-content ask-user-card",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(o1,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Question"}),m&&a.jsx("span",{className:"turn-header-meta",children:"answered"})]}),o.length>0?a.jsxs("div",{className:"ask-user-groups",children:[o.map((T,_)=>a.jsxs("div",{className:"ask-user-group",children:[T.question&&a.jsx("div",{className:"ask-user-question",children:T.question}),a.jsx("div",{className:"ask-user-options",children:T.selections.map(N=>{var R;const C=((R=l.get(ty(p,_)))==null?void 0:R.answer)===N;return a.jsx("button",{type:"button",className:`ask-user-option ${C?"selected":""}`,disabled:v,onClick:()=>k(_,T.question,N),children:N},N)})})]},_)),v?m&&a.jsx("div",{className:"ask-user-submitted",children:"Answer sent"}):a.jsxs("button",{type:"button",className:"ask-user-send",disabled:l.size===0,onClick:y,children:[a.jsx(Lo,{size:12}),"Send"]})]}):r.question?a.jsx("p",{className:"user-message",children:r.question}):a.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Waiting for user response"})]})}const gT={host_shutdown:"host shutdown",host_restart:"host restart",process_exit:"agent process stopped",network:"network error",auth:"signed out",usage_limit:"usage limit"};function ll(t){return t&&gT[t]||"interrupted"}function _l(t){if(!t)return"";const s=new Date(t);return Number.isNaN(s.getTime())?"":s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function vT(t){switch(t.interrupt_reason){case"network":return"Interrupted — network error. Will resume when the connection is back.";case"auth":return"Interrupted — Claude is signed out. Sign in again from a terminal, then resume.";case"usage_limit":{const s=_l(t.resume_at);return s?`Usage limit reached — resumes at ${s}.`:"Usage limit reached — resume once it is over."}case"process_exit":return"Interrupted — the agent process stopped. Resuming automatically…";case"host_shutdown":return"Interrupted — the agent host shut down. Resuming automatically…";default:return"Interrupted — the agent host restarted. Resuming automatically…"}}function yT(t){return t.items.filter(s=>s.type==="interruption").map(s=>s.data)}function xT({item:t}){const s=t.data,r=_l(s.interrupted_at);let o="";switch(s.outcome){case"waiting":o="waiting to resume";break;case"resuming":o="resuming…";break;case"resumed":o=s.resumed_at?`resumed ${_l(s.resumed_at)}`:"resumed";break;case"cancelled":o="stopped";break;case"unsupported":o="cannot be resumed";break;default:o="not resumed"}return a.jsx("div",{className:"interruption-marker",title:s.detail??void 0,children:a.jsxs("span",{children:["Interrupted",r?` ${r}`:""," (",ll(s.reason),") · ",o]})})}function wT({turn:t,label:s}){const[r,o]=x.useState(!1),l=I(d=>d.addToast),u=()=>{o(!0),v0(t.session_id,t.id).catch(d=>l("error",`Could not resume the turn — ${d.message}`)).finally(()=>o(!1))};return a.jsxs("button",{type:"button",className:"banner-action",onClick:u,disabled:r,children:[a.jsx(sv,{size:12}),s]})}function kT({turn:t}){const s=t.resume_state;if(!s||s==="cancelled"||s==="resumed")return null;const r=t.interrupt_reason,o=yT(t),l=o[o.length-1],u=_l(t.interrupted_at??(l==null?void 0:l.interrupted_at));let d,p=null,g=null;switch(s){case"waiting":{const m=r==="usage_limit"&&!t.resume_at;d=vT(t),p=m?(l==null?void 0:l.detail)??null:null,g=r==="auth"||m?"Resume":"Resume now";break}case"resuming":d=`Interrupted (${ll(r)}) — resuming from where it left off…`;break;case"gave_up":{const m=Math.max(o.length,1);d=`Interrupted ${m===1?"once":`${m} times`} — automatic resume stopped.`,p=t.error&&!t.error.startsWith("Automatic resume stopped")?t.error:null,g="Resume";break}case"skipped":d=`Interrupted${u?` ${u}`:""} (${ll(r)}) — too long ago to resume automatically.`,g="Resume";break;default:d=`Interrupted (${ll(r)}) — this turn cannot be resumed.`,p=t.error}return a.jsxs("div",{className:"interruption-banner","data-state":s,children:[a.jsx("span",{className:"banner-icon",children:r==="network"?a.jsx(lv,{size:12}):a.jsx(Ll,{size:12})}),a.jsxs("span",{className:"banner-text",children:[d,p&&a.jsx("span",{className:"banner-detail",children:p})]}),g&&a.jsx(wT,{turn:t,label:g})]})}function ST({turnId:t}){const s=I(o=>o.retryStates[t]);if(!s)return null;const r=s.errorStatus?`API error ${s.errorStatus}`:"Connection problem";return a.jsxs("div",{className:"retry-banner",children:[a.jsx("span",{className:"banner-icon",children:a.jsx(lv,{size:12})}),a.jsxs("span",{className:"banner-text",children:[r," — retrying (attempt ",s.attempt," of ",s.maxRetries,")…"]})]})}Ve.setOptions({breaks:!0,gfm:!0});const bT=10,TT=100;function NT({attachments:t}){const[s,r]=x.useState(null);return x.useEffect(()=>{if(!s)return;function o(l){l.key==="Escape"&&r(null)}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[s]),!Array.isArray(t)||t.length===0?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"attachment-pills",children:t.map((o,l)=>{const u=o.media_type.startsWith("image/"),d=`data:${o.media_type};base64,${o.data}`;return a.jsxs("span",{className:"attachment-pill",title:o.name,onClick:u?()=>r(d):void 0,style:u?{cursor:"pointer"}:void 0,children:[u?a.jsx("img",{src:d,alt:o.name,className:"attachment-pill-thumb"}):a.jsx(Xg,{size:12,className:"attachment-pill-icon"}),a.jsx("span",{className:"attachment-pill-name",children:o.name})]},l)})}),s&&a.jsx("div",{className:"image-preview-modal",onClick:()=>r(null),children:a.jsxs("div",{className:"image-preview-content",onClick:o=>o.stopPropagation(),children:[a.jsx("img",{src:s,alt:"preview"}),a.jsx("button",{className:"image-preview-close",onClick:()=>r(null),children:a.jsx(Tn,{size:20})})]})})]})}function jT(t){const s=Ve.parse(t);return Kd.sanitize(s)}function Vm(t){var s;return(s=t.data)!=null&&s.text?t.data.text:""}function CT(t){const s=t.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return s?s[1]:t}const Gm='<script>(function(){function report(){var h=Math.max(document.documentElement.scrollHeight,document.body?document.body.scrollHeight:0);if(h>0)parent.postMessage(Math.ceil(h),"*");}window.addEventListener("load",report);new ResizeObserver(report).observe(document.documentElement);report();})();<\/script>';function ET(t){return/<\/body>/i.test(t)?t.replace(/<\/body>/i,`${Gm}</body>`):t+Gm}function _T({html:t}){const[s,r]=x.useState(480),o=x.useRef(null);return x.useEffect(()=>{function l(u){var d;u.source===((d=o.current)==null?void 0:d.contentWindow)&&typeof u.data=="number"&&u.data>0&&r(u.data)}return window.addEventListener("message",l),()=>window.removeEventListener("message",l)},[]),a.jsx("iframe",{ref:o,sandbox:"allow-scripts",srcDoc:ET(t),title:"HTML content",style:{width:"100%",height:`${s}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const Km=1e4;function RT({item:t,runtimeType:s,turn:r,threads:o}){var p,g,m,v,k,y,S,T;const l=t.status==="in_progress",[u,d]=x.useState(!1);switch(t.type){case"agent_message":{const{iconClass:_,iconText:N}=Qu(s??"codex");return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:`turn-header-icon ${_}`,children:N}),a.jsx("span",{className:"turn-header-title",children:"Agent"}),l&&a.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),a.jsx(Bm,{itemId:t.id,turnId:r.id,sessionId:r.session_id,content:Vm(t)||"…",threads:o,runtimeType:s})]})}case"reasoning":return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(r1,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),a.jsx("div",{dangerouslySetInnerHTML:{__html:jT(Vm(t))}})]});case"command_execution":{const _=t.data||{},N=CT(_.command||""),C=_.aggregated_output||"",R=_.exit_code,H=l?"running…":R!==null?`exit ${R}`:"",M=C.length>Km,D=M&&!u?C.slice(0,Km)+`
510
- … (truncated, click to expand)`:C;return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(ov,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Command"}),H&&a.jsx("span",{className:"turn-header-meta",children:H})]}),a.jsx("pre",{className:"cmd-block",children:a.jsx("code",{children:N})}),C&&a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:"cmd-output",children:a.jsx("code",{children:D})}),M&&a.jsx("button",{className:"cmd-output-toggle",onClick:()=>d(K=>!K),children:u?"Show less":`Show full output (${(C.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const _=(p=t.data)==null?void 0:p.changes,N=Array.isArray(_)?_:[],C=`${N.length} file${N.length!==1?"s":""}`;return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(d1,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"File Changes"}),a.jsx("span",{className:"turn-header-meta",children:C})]}),a.jsx("div",{className:"file-change-list",children:N.map((R,H)=>{const M=R.kind==="add"?"A":R.kind==="delete"?"D":"M",D=R.kind==="add"?"fc-add":R.kind==="delete"?"fc-del":"fc-mod";return a.jsxs("div",{className:"file-change",children:[a.jsx("span",{className:`fc-status ${D}`,children:M}),a.jsx("span",{className:"fc-name",children:R.path})]},H)})})]})}case"mcp_tool_call":{const _=t.data||{},N=_.tool||"mcp";if(N==="Agent"){const $=_.arguments,te=($==null?void 0:$.description)||($==null?void 0:$.prompt)||"Subagent",he=t.status==="failed",ue=l?"running…":he?"failed":"done";return a.jsxs("div",{className:"agent-call-card",children:[a.jsx("span",{className:"agent-call-icon",children:a.jsx(mr,{size:14})}),a.jsx("span",{className:"agent-call-desc",children:te}),a.jsx("span",{className:`agent-call-status ${l?"running":he?"failed":"done"}`,children:ue})]})}const C=_.server||"",R=_.arguments,H=_.result,M=_.error,D=t.status==="failed"||!!M,K=l?"running…":D?"failed":"done",G=((g=H==null?void 0:H.content)==null?void 0:g.filter($=>$.type==="text").map($=>$.text))??[];return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(R1,{size:14})}),a.jsxs("span",{className:"turn-header-title",children:["MCP: ",N]}),C&&a.jsx("span",{className:"turn-header-meta",children:C}),a.jsx("span",{className:"turn-header-meta",style:D?{color:"var(--red)"}:void 0,children:K})]}),R&&Object.keys(R).length>0&&a.jsx("div",{className:"mcp-args",children:Object.entries(R).map(([$,te])=>a.jsxs("div",{className:"mcp-arg",children:[a.jsx("span",{className:"mcp-arg-key",children:$}),$==="code"?a.jsx("pre",{className:"cmd-block",children:a.jsx("code",{children:String(te)})}):a.jsx("span",{className:"mcp-arg-value",children:typeof te=="string"?te:JSON.stringify(te,null,2)})]},$))}),G.length>0&&G.map(($,te)=>a.jsx("pre",{className:"cmd-output",children:a.jsx("code",{children:$})},te)),M&&a.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:a.jsx("code",{children:M})})]})}case"web_search":{const _=((m=t.data)==null?void 0:m.query)||"";return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(M1,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Web Search"})]}),a.jsx("p",{className:"user-message",children:_})]})}case"todo_list":{const _=((v=t.data)==null?void 0:v.items)||[];return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(x1,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),a.jsx("ul",{className:"todo-list",children:_.map((N,C)=>a.jsxs("li",{className:N.completed?"todo-done":"todo-pending",children:[N.completed?a.jsx(Ts,{size:14}):a.jsx(Fr,{size:14})," ",N.text]},C))})]})}case"ask_user":return a.jsx(Hm,{item:t,turn:r});case"final_result":{const _=t.data??{},N=_.text||"",C=_.html||null,R=Array.isArray(_.groups)?_.groups.filter(D=>!!D&&Array.isArray(D.selections)&&D.selections.length>0):[],{iconClass:H,iconText:M}=Qu(s??"codex");return a.jsxs(a.Fragment,{children:[(N||C)&&a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:`turn-header-icon ${H}`,children:M}),a.jsx("span",{className:"turn-header-title",children:"Agent"})]}),N&&a.jsx(Bm,{itemId:t.id,turnId:r.id,sessionId:r.session_id,content:N,threads:o,runtimeType:s}),C&&a.jsx(_T,{html:C})]}),R.length>0&&a.jsx(Hm,{item:t,turn:r})]})}case"background_task":{const _=t.data||{},N=_.task_type||"unknown",C=_.subagent_type||null,R=_.description||"",H=_.status||"running",M=_.last_tool_name||null,D=_.token_count||null,K=N==="local_agent",G=N==="local_bash",$=K?mr:G?rv:Yg,te=K?`Subagent${C?`: ${C}`:""}`:G?"Monitor":"Background Task",he=H==="running"?"running…":H==="completed"?"done":H==="failed"?"failed":H==="stopped"?"stopped":H,ue=t.status==="failed"||H==="failed";return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx($,{size:14})}),a.jsx("span",{className:"turn-header-title",children:te}),a.jsx("span",{className:"turn-header-meta",style:ue?{color:"var(--red)"}:void 0,children:he})]}),R&&a.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:R}),M&&l&&a.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",M,D!=null&&` · ${D.toLocaleString()} tokens`]}),a.jsx("div",{className:"cmd-output",style:{color:"var(--text-muted)",fontSize:"11px"},children:"Output available in Tasks panel — click the status bar indicator or the Tasks tab."})]})}case"context_compaction":{const _=((k=t.data)==null?void 0:k.trigger)??"auto",N=((y=t.data)==null?void 0:y.pre_tokens)??0,C=((S=t.data)==null?void 0:S.post_tokens)??0,R=N>0?Math.round((1-C/N)*100):0,H=_==="manual"?"Context compacted (/compact)":"Context auto-compacted";return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(b1,{size:14})}),a.jsx("span",{className:"turn-header-title",children:H})]}),a.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[N.toLocaleString()," → ",C.toLocaleString()," tokens (",R,"% reduction)"]})]})}case"interruption":return a.jsx(xT,{item:t});case"error":{const _=((T=t.data)==null?void 0:T.message)||"Unknown error";return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--red)",color:"#fff"},children:a.jsx(Ll,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Error"})]}),a.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:a.jsx("code",{children:_})})]})}default:return null}}const Ps=x.memo(RT,(t,s)=>t.item===s.item&&t.runtimeType===s.runtimeType&&t.threads===s.threads&&t.turn.id===s.turn.id);function AT({turn:t,runtimeType:s,threads:r=[]}){Mt.trackRender("TurnContent");const[o,l]=x.useState(!1),[u,d]=x.useState(!1),[p,g]=x.useState(!1);x.useEffect(()=>{const q=t.items.some(we=>we.type==="background_task"&&we.status==="in_progress");t.status==="running"||t.status==="pending"?l(!0):t.status==="completed"&&!q&&l(!1)},[t.status,t.items]);let m=-1;for(let q=t.items.length-1;q>=0;q--)if(t.items[q].type==="agent_message"){m=q;break}const v=m>=0,k=v?t.items.slice(0,m):t.items,y=t.items.some(q=>q.type==="final_result"||q.type==="ask_user"),S=!v&&t.status==="completed"&&t.agent_response&&!y?{id:`response-${t.id}`,turn_id:t.id,external_item_id:`response-${t.id}`,type:"agent_message",data:{text:t.agent_response},status:"completed",created_at:t.created_at,updated_at:t.updated_at}:null,T=k.filter(q=>{var we;return!(q.type==="reasoning"&&(!((we=q.data)!=null&&we.text)||q.data.text===""))}),_=t.items.some(q=>{var we;return q.type==="interruption"&&((we=q.data)==null?void 0:we.reason)==="auth"}),N=t.items.some(q=>{var we;return q.type==="interruption"&&((we=q.data)==null?void 0:we.reason)==="usage_limit"}),C=T.filter(q=>{var we,Z;return!(q.type==="background_task"||q.type==="ask_user"||q.type==="final_result"||_&&q.type==="error"&&((we=q.data)==null?void 0:we.error)==="authentication_failed"||N&&q.type==="error"&&((Z=q.data)==null?void 0:Z.error)==="rate_limit")}),R=u?0:Math.max(0,C.length-TT),H=R>0?C.slice(R):C,M=[];let D=null;for(const q of H)q.type==="agent_message"?(D&&M.push(D),D={agentMessage:q,toolItems:[],otherItems:[]}):q.type==="interruption"||q.type==="error"?(D&&M.push(D),M.push({agentMessage:null,toolItems:[],otherItems:[q]}),D=null):(D||(D={agentMessage:null,toolItems:[],otherItems:[]}),Fm(q)?D.toolItems.push(q):D.otherItems.push(q));D&&M.push(D);const K=t.items.filter(q=>q.type==="background_task"),G=p?0:Math.max(0,K.length-bT),$=G>0?K.slice(G):K,te=C.filter(q=>Fm(q)).length,he=te>0||C.length>0&&(t.status==="running"||t.status==="pending"),ue=t.status==="pending"&&t.resume_state==="waiting",Se=t.resume_state==="gave_up"||t.resume_state==="skipped"||t.resume_state==="unsupported";return a.jsxs("div",{className:"turn-group",children:[a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),a.jsx("span",{className:"turn-header-title",children:"You"})]}),a.jsx("p",{className:"user-message",children:t.user_prompt}),Array.isArray(t.attachments)&&t.attachments.length>0&&a.jsx(NT,{attachments:t.attachments})]}),he&&a.jsxs("div",{className:"tool-calls",children:[a.jsxs("div",{className:"tool-calls-header",onClick:()=>l(q=>!q),children:[a.jsx("span",{className:"tool-calls-icon",children:a.jsx(g1,{size:12})}),a.jsx("span",{className:"tool-calls-summary",children:te>0?`${te} tool call${te>1?"s":""}`:ue?"interrupted":"thinking…"}),a.jsx(Co,{size:14,className:"tool-calls-chevron",style:{transform:o?"rotate(90deg)":"none"}})]}),o&&a.jsxs("div",{className:"tool-calls-body",children:[R>0&&a.jsx("div",{className:"render-load-earlier",children:a.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>d(!0),children:["Show ",R," earlier step",R>1?"s":""]})}),M.map((q,we)=>a.jsxs("div",{className:"intermediate-segment",children:[q.agentMessage&&a.jsx(Ps,{item:q.agentMessage,runtimeType:s,turn:t,threads:r}),q.otherItems.map(Z=>a.jsx(Ps,{item:Z,runtimeType:s,turn:t,threads:r},Z.id)),q.toolItems.length>0&&a.jsx(iT,{items:q.toolItems,runtimeType:s,turn:t,threads:r})]},we))]})]}),G>0&&a.jsx("div",{className:"render-load-earlier",children:a.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>g(!0),children:["Show ",G," earlier background task",G>1?"s":""]})}),$.map(q=>a.jsx(Ps,{item:q,runtimeType:s,turn:t,threads:r},`task-${q.id}`)),v&&a.jsx(Ps,{item:t.items[m],runtimeType:s,turn:t,threads:r},t.items[m].id),S&&a.jsx(Ps,{item:S,runtimeType:s,turn:t,threads:r},S.id),v&&t.items.slice(m+1).filter(q=>q.type!=="ask_user"&&q.type!=="background_task"&&q.type!=="final_result").map(q=>a.jsx(Ps,{item:q,runtimeType:s,turn:t,threads:r},q.id)),t.items.filter(q=>q.type==="final_result").map(q=>a.jsx(Ps,{item:q,runtimeType:s,turn:t,threads:r},`final-${q.id}`)),t.items.filter(q=>q.type==="ask_user").map(q=>a.jsx(Ps,{item:q,runtimeType:s,turn:t,threads:r},`ask-${q.id}`)),t.items.length===0&&!t.error&&(t.status==="pending"||t.status==="running")&&a.jsx("div",{className:"render-content",children:a.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:t.status==="running"?"Agent is thinking…":"Waiting to start…"})}),t.error&&!Se&&a.jsx("div",{className:"render-content",children:a.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:a.jsx("code",{children:t.error})})}),t.status==="running"&&a.jsx(ST,{turnId:t.id}),a.jsx(kT,{turn:t}),t.status==="aborted"&&a.jsxs("div",{className:"aborted-banner",children:[a.jsx("span",{className:"banner-icon",children:a.jsx(Fr,{size:12})}),a.jsx("span",{className:"banner-text",children:"Turn stopped — work generated so far is kept."})]})]})}const IT=x.memo(AT),MT=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘K":"Ctrl+K";function DT(){const t=I(N=>N.workspaces),s=I(N=>N.loadPickerSupport),r=I(N=>N.pickAndAddWorkspace),o=I(N=>N.createSessionInWorkspace),l=I(N=>N.setImportSessionsWorkspace);x.useEffect(()=>{s()},[s]);const u=t.filter(N=>N.deleted===0),[d,p]=x.useState(null),g=u.find(N=>N.path===d)??u[u.length-1]??null,m=(g==null?void 0:g.path)??null,[v,k]=x.useState(null);x.useEffect(()=>{if(!m)return;let N=!1;return Og(m).then(C=>{N||k({path:m,count:C.length})}).catch(()=>{}),()=>{N=!0}},[m]);const y=v&&v.path===m?v.count:0,[S,T]=x.useState(!1);async function _(N){T(!0);try{await o(N)}finally{T(!1)}}return a.jsx("div",{className:"render-scroll welcome-scroll",children:a.jsxs("main",{className:"welcome","aria-labelledby":"welcome-title",children:[a.jsx("h1",{className:"welcome-title",id:"welcome-title",children:"Welcome to Repoburg"}),a.jsx("p",{className:"welcome-lead",children:"Run Claude Code and Codex agents on your projects, side by side. Each session works in a workspace: one of your project folders."}),a.jsxs("ol",{className:"welcome-steps",children:[a.jsxs("li",{className:`welcome-step${g?" done":" current"}`,children:[a.jsx("span",{className:"welcome-step-mark","aria-hidden":"true",children:g?a.jsx(Ts,{size:13}):"1"}),a.jsxs("div",{className:"welcome-step-body",children:[a.jsx("h2",{className:"welcome-step-title",children:"Add a workspace"}),g?a.jsx("p",{className:"welcome-step-text",children:a.jsx("code",{title:g.path,children:g.path})}):a.jsxs("button",{className:"dialog-btn-create welcome-primary",onClick:()=>void r(),children:[a.jsx(p1,{size:14})," Open folder…"]})]})]}),a.jsxs("li",{className:`welcome-step${g?" current":" upcoming"}`,children:[a.jsx("span",{className:"welcome-step-mark","aria-hidden":"true",children:"2"}),a.jsxs("div",{className:"welcome-step-body",children:[a.jsx("h2",{className:"welcome-step-title",children:"Start your first session"}),g&&m?a.jsxs(a.Fragment,{children:[u.length>1&&a.jsxs("label",{className:"welcome-step-text welcome-target",children:["In",a.jsx("select",{className:"dialog-input dialog-select",value:m,onChange:N=>p(N.target.value),children:u.map(N=>a.jsx("option",{value:N.path,children:N.label||N.path},N.id))})]}),a.jsxs("div",{className:"welcome-actions",children:[a.jsxs("button",{className:"dialog-btn-create welcome-primary",disabled:S,onClick:()=>void _(m),children:[a.jsx(dr,{size:14})," New session"]}),y>0&&a.jsxs("button",{className:"dialog-btn-cancel",onClick:()=>l(m),children:[a.jsx(Jg,{size:14})," Import ",y," Claude Code"," ",y===1?"session":"sessions"]})]}),y>0&&a.jsxs("p",{className:"welcome-step-text",children:["Sessions you started with ",a.jsx("code",{children:"claude"})," in this folder continue right where they left off."]})]}):a.jsx("p",{className:"welcome-step-text",children:"Then start an agent session in it."})]})]})]}),a.jsxs("p",{className:"welcome-tip",children:["Later: right-click a workspace to import its Claude Code sessions, and press ",a.jsx("kbd",{children:MT})," for the command palette."]})]})})}const LT=[],el=50;function OT(){Mt.trackRender("RenderArea");const t=I(S=>S.activeSessionId),s=I(S=>S.activeSessionId?S.sessionDetails[S.activeSessionId]:null),r=I(S=>S.submittingPrompt),o=I(S=>S.loading),l=I(S=>!S.activeSessionId&&!LS(S.workspaces,S.sessions,S.appsRootPath)),u=(s==null?void 0:s.turns)??[],d=(s==null?void 0:s.threads)??LT,p=x.useRef(null),[g,m]=x.useState(el);x.useEffect(()=>{m(el)},[t]);const v=u.filter(S=>!S.thread_id),k=Math.max(0,v.length-g),y=v.slice(k);return x.useEffect(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)},[t,u.length]),o&&!s?a.jsx("div",{className:"render-scroll",children:a.jsxs("div",{className:"skeleton-bars",children:[a.jsx("div",{className:"skeleton-bar"}),a.jsx("div",{className:"skeleton-bar"}),a.jsx("div",{className:"skeleton-bar"}),a.jsx("div",{className:"skeleton-bar"}),a.jsx("div",{className:"skeleton-bar"})]})}):s?a.jsxs("div",{className:"render-scroll",ref:p,children:[r&&a.jsx("div",{className:"turn-block",children:a.jsxs("div",{className:"turn-group",children:[a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),a.jsx("span",{className:"turn-header-title",children:"You"})]}),a.jsx("p",{className:"user-message",children:r})]}),a.jsx("div",{className:"render-content",children:a.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Sending…"})})]})}),u.length===0&&!r&&a.jsx("div",{className:"empty-state",children:"No turns yet. Send a message below to start."}),k>0&&a.jsx("div",{className:"render-load-earlier",children:a.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>m(S=>S+el),children:["Show ",Math.min(el,k)," earlier turns (",k," hidden)"]})}),y.map((S,T)=>a.jsx("div",{id:`turn-${k+T}`,className:"turn-block",children:a.jsx(IT,{turn:S,runtimeType:s.runtime_type,threads:d})},S.id))]}):l?a.jsx(DT,{}):a.jsx("div",{className:"render-scroll",children:a.jsx("div",{className:"empty-state",children:"No session selected"})})}const PT=x.memo(OT),$T=[{id:"model",label:"/model",hint:"Change model",capability:"dynamicModels"},{id:"sandbox",label:"/sandbox",hint:"Sandbox mode",capability:"sandbox",subPopup:"sandbox"},{id:"websearch",label:"/websearch",hint:"Web search mode",capability:"webSearch",subPopup:"websearch"},{id:"network",label:"/network",hint:"Network access",capability:"networkAccess",subPopup:"network"},{id:"skills",label:"/skills",hint:"Browse skills",capability:"skills"},{id:"plugins",label:"/plugins",hint:"Browse plugins",capability:"plugins"},{id:"mcp",label:"/mcp",hint:"Browse MCP servers",capability:"mcpServers"}];function zT(t){return t.map(s=>({id:s.name,label:`/${s.name}`,hint:s.description,capability:null,insertAsText:!0}))}function FT(t,s,r=[]){const o=[...$T,...zT(r)],l=new Set;return o.filter(u=>!(l.has(u.label)||(l.add(u.label),u.capability&&!s[u.capability])||t&&!u.label.toLowerCase().includes(t.toLowerCase())))}function UT({commands:t,selectedIndex:s,onSelect:r,onHover:o}){return a.jsxs("div",{className:"slash-popup",children:[a.jsx("div",{className:"slash-popup-header",children:"Commands"}),t.length===0&&a.jsx("div",{className:"slash-popup-empty",children:"No matching commands"}),t.map((l,u)=>a.jsxs("div",{className:`slash-popup-item ${u===s?"selected":""}`,onMouseEnter:()=>o(u),onClick:()=>r(l),children:[a.jsx("span",{className:"slash-popup-label",children:l.label}),a.jsx("span",{className:"slash-popup-hint",children:l.hint})]},l.id))]})}function Hu({title:t,options:s,currentValue:r,onSelect:o,onClose:l}){return a.jsxs("div",{className:"slash-popup",children:[a.jsxs("div",{className:"slash-popup-header",children:[a.jsx("button",{className:"slash-popup-back",onClick:l,children:"← Back"}),a.jsx("span",{children:t})]}),s.map(u=>a.jsxs("div",{className:`slash-popup-item ${u.value===r?"selected":""}`,onClick:()=>o(u.value),children:[a.jsxs("div",{className:"slash-popup-item-main",children:[a.jsx("span",{className:"slash-popup-label",children:u.label}),u.description&&a.jsx("span",{className:"slash-popup-hint",children:u.description})]}),u.value===r&&a.jsx("span",{className:"slash-popup-check",children:"✓"})]},u.value))]})}function BT(t){return Wt("/skills")}function WT({filter:t,onSelect:s,onClose:r}){const[o,l]=x.useState([]),[u,d]=x.useState(!0),[p,g]=x.useState(0),m=x.useRef(null);x.useEffect(()=>{BT().then(l).catch(()=>l([])).finally(()=>d(!1))},[]);const v=o.filter(k=>k.name.toLowerCase().includes(t.toLowerCase())||k.description.toLowerCase().includes(t.toLowerCase()));return x.useEffect(()=>{g(0)},[t]),x.useEffect(()=>{function k(y){y.key==="ArrowDown"?(y.preventDefault(),g(S=>Math.min(S+1,v.length-1))):y.key==="ArrowUp"?(y.preventDefault(),g(S=>Math.max(S-1,0))):y.key==="Enter"?(y.preventDefault(),v[p]&&s(v[p])):y.key==="Escape"&&(y.preventDefault(),r())}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[v,p,s,r]),a.jsxs("div",{className:"slash-popup",ref:m,children:[a.jsxs("div",{className:"slash-popup-header",children:[a.jsx("button",{className:"slash-popup-back",onClick:r,children:"← Back"}),a.jsx("span",{children:"Skills"})]}),u&&a.jsx("div",{className:"slash-popup-empty",children:"Loading skills…"}),!u&&v.length===0&&a.jsx("div",{className:"slash-popup-empty",children:"No matching skills"}),v.map((k,y)=>a.jsxs("div",{className:`slash-popup-item ${y===p?"selected":""}`,onMouseEnter:()=>g(y),onClick:()=>s(k),children:[a.jsxs("div",{className:"slash-popup-item-main",children:[a.jsx("span",{className:"slash-popup-label",children:k.name}),k.description&&a.jsx("span",{className:"slash-popup-hint",children:k.description})]}),!!k.metadata.isSystem&&a.jsx("span",{className:"slash-popup-hint",children:"system"})]},k.id))]})}function HT(){return Wt("/providers")}function VT(t,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return Wt(`/providers/${t}/commands${r}`)}const GT={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function KT(t){const[s,r]=x.useState([]),[o,l]=x.useState(!0);x.useEffect(()=>{HT().then(r).catch(()=>r([])).finally(()=>l(!1))},[]);const u=s.find(d=>d.id===t)??null;return{provider:u,capabilities:(u==null?void 0:u.capabilities)??GT,loading:o}}const gi=32,Vu=200;function qm(t){if(!t)return{};try{return JSON.parse(t)}catch{return{}}}function Ym(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}let Xm=0;function qT(){return Xm+=1,`att-${Date.now()}-${Xm}`}function YT(){Mt.trackRender("CommandInputBar");const[t,s]=x.useState(""),r=x.useRef(null),o=x.useRef(gi),l=x.useRef(null),{submitPrompt:u,cancelTurn:d,updateRuntimeConfig:p,setShowModelSelector:g}=I(),m=I(Y=>Y.activeSessionId),v=I(Y=>Y.activeSessionId?Y.sessionDetails[Y.activeSessionId]:null),k=I(Y=>Y.quotedText),y=Rg(v),S=!!(v!=null&&v.turns.some(Y=>Y.status==="pending"&&Y.resume_state==="waiting")),T=!m,{capabilities:_}=KT(v==null?void 0:v.runtime_type),N=(v==null?void 0:v.runtime_type)??null,C=_.imageAttachments,[R,H]=x.useState([]),[M,D]=x.useState(!1),[K,G]=x.useState(null),[$,te]=x.useState([]);x.useEffect(()=>{if(!N){te([]);return}let Y=!1;return VT(N,(v==null?void 0:v.cwd)??void 0).then(me=>{Y||te(me)}).catch(()=>{Y||te([])}),()=>{Y=!0}},[N,v==null?void 0:v.cwd]);const[he,ue]=x.useState(!1),[Se,q]=x.useState(""),[we,Z]=x.useState(0),[oe,ae]=x.useState(void 0),[z,Q]=x.useState(!1),[B,E]=x.useState(""),[P,se]=x.useState([]),fe=he?FT(Se,_,$):[];x.useEffect(()=>{k!==null&&(s(Y=>Y+k),setTimeout(()=>{if(r.current){De(),r.current.focus();const Y=r.current.value.length;r.current.setSelectionRange(Y,Y)}},0),I.setState({quotedText:null}))},[k]),x.useEffect(()=>{if(!y)return;function Y(me){me.key==="Escape"&&(me.preventDefault(),d())}return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[y,d]),x.useEffect(()=>{ue(!1),ae(void 0),Q(!1),se([]),H(Y=>{for(const me of Y)me.previewUrl&&URL.revokeObjectURL(me.previewUrl);return[]})},[m]),x.useEffect(()=>{if(!K)return;function Y(me){me.key==="Escape"&&(me.preventDefault(),G(null))}return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[K]);const X=x.useCallback(Y=>{if(!Y)return;const me=Array.from(Y);for(const Ue of me){const tt=new FileReader;tt.onload=()=>{const gt=tt.result.split(",")[1]??"",Ct=Ue.type.startsWith("image/")?URL.createObjectURL(Ue):void 0;H(an=>[...an,{id:qT(),name:Ue.name,media_type:Ue.type||"application/octet-stream",data:gt,previewUrl:Ct,size:Ue.size}])},tt.readAsDataURL(Ue)}},[]),pe=x.useCallback(Y=>{H(me=>{const Ue=me.find(tt=>tt.id===Y);return Ue!=null&&Ue.previewUrl&&URL.revokeObjectURL(Ue.previewUrl),me.filter(tt=>tt.id!==Y)})},[]),Ne=x.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation(),!(!C||y)&&D(!0)},[C,y]),_e=x.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation(),D(!1)},[]),Ae=x.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation(),D(!1),!(!C||y)&&X(Y.dataTransfer.files)},[C,y,X]),Ee=x.useCallback(Y=>{var tt;if(!C)return;const me=(tt=Y.clipboardData)==null?void 0:tt.items;if(!me)return;const Ue=[];for(let mt=0;mt<me.length;mt++){const gt=me[mt];if(gt.type.startsWith("image/")){const Ct=gt.getAsFile();Ct&&Ue.push(Ct)}}Ue.length>0&&(Y.preventDefault(),X(Ue))},[C,X]);function at(Y){const me=r.current;me&&(me.style.height=`${Y}px`,o.current=Y)}function De(){const Y=r.current;if(Y){if(Y.scrollHeight>Y.clientHeight){const me=Math.min(Y.scrollHeight,Vu);me!==o.current&&at(me);return}o.current>gi&&(Y.style.height="auto",at(Math.min(Y.scrollHeight,Vu)))}}function lt(){const Y=t.trim();if(!Y||y)return;let me=Y;P.length>0&&(me=`${P.map(mt=>`$${mt.name}`).join(" ")}
509
+ `)}function Vm({item:t,turn:s}){var S;const r=t.data??{},o=x.useMemo(()=>Array.isArray(r.groups)?r.groups.filter(T=>!!T&&Array.isArray(T.selections)&&T.selections.length>0):[],[r.groups]),l=kT(s.id),u=I(T=>s.session_id?T.sessionDetails[s.session_id]:null),d=I(T=>T.activeSessionId),p=s.items.findIndex(T=>T.id===t.id),g=u?((S=u.turns[u.turns.length-1])==null?void 0:S.id)===s.id:!0,m=ny.has(s.id),v=m||Ig(u)||!g||s.session_id!==d,k=(T,_,N)=>{v||yT(s.id,p,T,_,N)},y=()=>{const T=[...l.values()];if(T.length===0)return;const _=ST(T);wT(s.id),I.getState().submitPrompt(_)};return a.jsxs("div",{className:"render-content ask-user-card",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(p1,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Question"}),m&&a.jsx("span",{className:"turn-header-meta",children:"answered"})]}),o.length>0?a.jsxs("div",{className:"ask-user-groups",children:[o.map((T,_)=>a.jsxs("div",{className:"ask-user-group",children:[T.question&&a.jsx("div",{className:"ask-user-question",children:T.question}),a.jsx("div",{className:"ask-user-options",children:T.selections.map(N=>{var j;const E=((j=l.get(ry(p,_)))==null?void 0:j.answer)===N;return a.jsx("button",{type:"button",className:`ask-user-option ${E?"selected":""}`,disabled:v,onClick:()=>k(_,T.question,N),children:N},N)})})]},_)),v?m&&a.jsx("div",{className:"ask-user-submitted",children:"Answer sent"}):a.jsxs("button",{type:"button",className:"ask-user-send",disabled:l.size===0,onClick:y,children:[a.jsx(Lo,{size:12}),"Send"]})]}):r.question?a.jsx("p",{className:"user-message",children:r.question}):a.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Waiting for user response"})]})}const bT={host_shutdown:"host shutdown",host_restart:"host restart",process_exit:"agent process stopped",network:"network error",auth:"signed out",usage_limit:"usage limit"};function cl(t){return t&&bT[t]||"interrupted"}function Al(t){if(!t)return"";const s=new Date(t);return Number.isNaN(s.getTime())?"":s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function TT(t){switch(t.interrupt_reason){case"network":return"Interrupted — network error. Will resume when the connection is back.";case"auth":return"Interrupted — Claude is signed out. Sign in again from a terminal, then resume.";case"usage_limit":{const s=Al(t.resume_at);return s?`Usage limit reached — resumes at ${s}.`:"Usage limit reached — resume once it is over."}case"process_exit":return"Interrupted — the agent process stopped. Resuming automatically…";case"host_shutdown":return"Interrupted — the agent host shut down. Resuming automatically…";default:return"Interrupted — the agent host restarted. Resuming automatically…"}}function NT(t){return t.items.filter(s=>s.type==="interruption").map(s=>s.data)}function jT({item:t}){const s=t.data,r=Al(s.interrupted_at);let o="";switch(s.outcome){case"waiting":o="waiting to resume";break;case"resuming":o="resuming…";break;case"resumed":o=s.resumed_at?`resumed ${Al(s.resumed_at)}`:"resumed";break;case"cancelled":o="stopped";break;case"unsupported":o="cannot be resumed";break;default:o="not resumed"}return a.jsx("div",{className:"interruption-marker",title:s.detail??void 0,children:a.jsxs("span",{children:["Interrupted",r?` ${r}`:""," (",cl(s.reason),") · ",o]})})}function CT({turn:t,label:s}){const[r,o]=x.useState(!1),l=I(d=>d.addToast),u=()=>{o(!0),k0(t.session_id,t.id).catch(d=>l("error",`Could not resume the turn — ${d.message}`)).finally(()=>o(!1))};return a.jsxs("button",{type:"button",className:"banner-action",onClick:u,disabled:r,children:[a.jsx(ov,{size:12}),s]})}function ET({turn:t}){const s=t.resume_state;if(!s||s==="cancelled"||s==="resumed")return null;const r=t.interrupt_reason,o=NT(t),l=o[o.length-1],u=Al(t.interrupted_at??(l==null?void 0:l.interrupted_at));let d,p=null,g=null;switch(s){case"waiting":{const m=r==="usage_limit"&&!t.resume_at;d=TT(t),p=m?(l==null?void 0:l.detail)??null:null,g=r==="auth"||m?"Resume":"Resume now";break}case"resuming":d=`Interrupted (${cl(r)}) — resuming from where it left off…`;break;case"gave_up":{const m=Math.max(o.length,1);d=`Interrupted ${m===1?"once":`${m} times`} — automatic resume stopped.`,p=t.error&&!t.error.startsWith("Automatic resume stopped")?t.error:null,g="Resume";break}case"skipped":d=`Interrupted${u?` ${u}`:""} (${cl(r)}) — too long ago to resume automatically.`,g="Resume";break;default:d=`Interrupted (${cl(r)}) — this turn cannot be resumed.`,p=t.error}return a.jsxs("div",{className:"interruption-banner","data-state":s,children:[a.jsx("span",{className:"banner-icon",children:r==="network"?a.jsx(dv,{size:12}):a.jsx($l,{size:12})}),a.jsxs("span",{className:"banner-text",children:[d,p&&a.jsx("span",{className:"banner-detail",children:p})]}),g&&a.jsx(CT,{turn:t,label:g})]})}function _T({turnId:t}){const s=I(o=>o.retryStates[t]);if(!s)return null;const r=s.errorStatus?`API error ${s.errorStatus}`:"Connection problem";return a.jsxs("div",{className:"retry-banner",children:[a.jsx("span",{className:"banner-icon",children:a.jsx(dv,{size:12})}),a.jsxs("span",{className:"banner-text",children:[r," — retrying (attempt ",s.attempt," of ",s.maxRetries,")…"]})]})}Ge.setOptions({breaks:!0,gfm:!0});const RT=10,AT=100;function IT({attachments:t}){const[s,r]=x.useState(null);return x.useEffect(()=>{if(!s)return;function o(l){l.key==="Escape"&&r(null)}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[s]),!Array.isArray(t)||t.length===0?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"attachment-pills",children:t.map((o,l)=>{const u=o.media_type.startsWith("image/"),d=`data:${o.media_type};base64,${o.data}`;return a.jsxs("span",{className:"attachment-pill",title:o.name,onClick:u?()=>r(d):void 0,style:u?{cursor:"pointer"}:void 0,children:[u?a.jsx("img",{src:d,alt:o.name,className:"attachment-pill-thumb"}):a.jsx(Jg,{size:12,className:"attachment-pill-icon"}),a.jsx("span",{className:"attachment-pill-name",children:o.name})]},l)})}),s&&a.jsx("div",{className:"image-preview-modal",onClick:()=>r(null),children:a.jsxs("div",{className:"image-preview-content",onClick:o=>o.stopPropagation(),children:[a.jsx("img",{src:s,alt:"preview"}),a.jsx("button",{className:"image-preview-close",onClick:()=>r(null),children:a.jsx(Tn,{size:20})})]})})]})}function MT(t){const s=Ge.parse(t);return qd.sanitize(s)}function Gm(t){var s;return(s=t.data)!=null&&s.text?t.data.text:""}function DT(t){const s=t.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return s?s[1]:t}const Km='<script>(function(){function report(){var h=Math.max(document.documentElement.scrollHeight,document.body?document.body.scrollHeight:0);if(h>0)parent.postMessage(Math.ceil(h),"*");}window.addEventListener("load",report);new ResizeObserver(report).observe(document.documentElement);report();})();<\/script>';function LT(t){return/<\/body>/i.test(t)?t.replace(/<\/body>/i,`${Km}</body>`):t+Km}function OT({html:t}){const[s,r]=x.useState(480),o=x.useRef(null);return x.useEffect(()=>{function l(u){var d;u.source===((d=o.current)==null?void 0:d.contentWindow)&&typeof u.data=="number"&&u.data>0&&r(u.data)}return window.addEventListener("message",l),()=>window.removeEventListener("message",l)},[]),a.jsx("iframe",{ref:o,sandbox:"allow-scripts",srcDoc:LT(t),title:"HTML content",style:{width:"100%",height:`${s}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const qm=1e4;function PT({item:t,runtimeType:s,turn:r,threads:o}){var p,g,m,v,k,y,S,T;const l=t.status==="in_progress",[u,d]=x.useState(!1);switch(t.type){case"agent_message":{const{iconClass:_,iconText:N}=Ju(s??"codex");return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:`turn-header-icon ${_}`,children:N}),a.jsx("span",{className:"turn-header-title",children:"Agent"}),l&&a.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),a.jsx(Wm,{itemId:t.id,turnId:r.id,sessionId:r.session_id,content:Gm(t)||"…",threads:o,runtimeType:s})]})}case"reasoning":return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(d1,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),a.jsx("div",{dangerouslySetInnerHTML:{__html:MT(Gm(t))}})]});case"command_execution":{const _=t.data||{},N=DT(_.command||""),E=_.aggregated_output||"",j=_.exit_code,W=l?"running…":j!==null?`exit ${j}`:"",A=E.length>qm,D=A&&!u?E.slice(0,qm)+`
510
+ … (truncated, click to expand)`:E;return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(cv,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Command"}),W&&a.jsx("span",{className:"turn-header-meta",children:W})]}),a.jsx("pre",{className:"cmd-block",children:a.jsx("code",{children:N})}),E&&a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:"cmd-output",children:a.jsx("code",{children:D})}),A&&a.jsx("button",{className:"cmd-output-toggle",onClick:()=>d(G=>!G),children:u?"Show less":`Show full output (${(E.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const _=(p=t.data)==null?void 0:p.changes,N=Array.isArray(_)?_:[],E=`${N.length} file${N.length!==1?"s":""}`;return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(y1,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"File Changes"}),a.jsx("span",{className:"turn-header-meta",children:E})]}),a.jsx("div",{className:"file-change-list",children:N.map((j,W)=>{const A=j.kind==="add"?"A":j.kind==="delete"?"D":"M",D=j.kind==="add"?"fc-add":j.kind==="delete"?"fc-del":"fc-mod";return a.jsxs("div",{className:"file-change",children:[a.jsx("span",{className:`fc-status ${D}`,children:A}),a.jsx("span",{className:"fc-name",children:j.path})]},W)})})]})}case"mcp_tool_call":{const _=t.data||{},N=_.tool||"mcp";if(N==="Agent"){const $=_.arguments,te=($==null?void 0:$.description)||($==null?void 0:$.prompt)||"Subagent",me=t.status==="failed",de=l?"running…":me?"failed":"done";return a.jsxs("div",{className:"agent-call-card",children:[a.jsx("span",{className:"agent-call-icon",children:a.jsx(mr,{size:14})}),a.jsx("span",{className:"agent-call-desc",children:te}),a.jsx("span",{className:`agent-call-status ${l?"running":me?"failed":"done"}`,children:de})]})}const E=_.server||"",j=_.arguments,W=_.result,A=_.error,D=t.status==="failed"||!!A,G=l?"running…":D?"failed":"done",V=((g=W==null?void 0:W.content)==null?void 0:g.filter($=>$.type==="text").map($=>$.text))??[];return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(P1,{size:14})}),a.jsxs("span",{className:"turn-header-title",children:["MCP: ",N]}),E&&a.jsx("span",{className:"turn-header-meta",children:E}),a.jsx("span",{className:"turn-header-meta",style:D?{color:"var(--red)"}:void 0,children:G})]}),j&&Object.keys(j).length>0&&a.jsx("div",{className:"mcp-args",children:Object.entries(j).map(([$,te])=>a.jsxs("div",{className:"mcp-arg",children:[a.jsx("span",{className:"mcp-arg-key",children:$}),$==="code"?a.jsx("pre",{className:"cmd-block",children:a.jsx("code",{children:String(te)})}):a.jsx("span",{className:"mcp-arg-value",children:typeof te=="string"?te:JSON.stringify(te,null,2)})]},$))}),V.length>0&&V.map(($,te)=>a.jsx("pre",{className:"cmd-output",children:a.jsx("code",{children:$})},te)),A&&a.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:a.jsx("code",{children:A})})]})}case"web_search":{const _=((m=t.data)==null?void 0:m.query)||"";return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(F1,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Web Search"})]}),a.jsx("p",{className:"user-message",children:_})]})}case"todo_list":{const _=((v=t.data)==null?void 0:v.items)||[];return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(j1,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),a.jsx("ul",{className:"todo-list",children:_.map((N,E)=>a.jsxs("li",{className:N.completed?"todo-done":"todo-pending",children:[N.completed?a.jsx(Ns,{size:14}):a.jsx(Fr,{size:14})," ",N.text]},E))})]})}case"ask_user":return a.jsx(Vm,{item:t,turn:r});case"final_result":{const _=t.data??{},N=_.text||"",E=_.html||null,j=Array.isArray(_.groups)?_.groups.filter(D=>!!D&&Array.isArray(D.selections)&&D.selections.length>0):[],{iconClass:W,iconText:A}=Ju(s??"codex");return a.jsxs(a.Fragment,{children:[(N||E)&&a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:`turn-header-icon ${W}`,children:A}),a.jsx("span",{className:"turn-header-title",children:"Agent"})]}),N&&a.jsx(Wm,{itemId:t.id,turnId:r.id,sessionId:r.session_id,content:N,threads:o,runtimeType:s}),E&&a.jsx(OT,{html:E})]}),j.length>0&&a.jsx(Vm,{item:t,turn:r})]})}case"background_task":{const _=t.data||{},N=_.task_type||"unknown",E=_.subagent_type||null,j=_.description||"",W=_.status||"running",A=_.last_tool_name||null,D=_.token_count||null,G=N==="local_agent",V=N==="local_bash",$=G?mr:V?av:Zg,te=G?`Subagent${E?`: ${E}`:""}`:V?"Monitor":"Background Task",me=W==="running"?"running…":W==="completed"?"done":W==="failed"?"failed":W==="stopped"?"stopped":W,de=t.status==="failed"||W==="failed";return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx($,{size:14})}),a.jsx("span",{className:"turn-header-title",children:te}),a.jsx("span",{className:"turn-header-meta",style:de?{color:"var(--red)"}:void 0,children:me})]}),j&&a.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:j}),A&&l&&a.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",A,D!=null&&` · ${D.toLocaleString()} tokens`]}),a.jsx("div",{className:"cmd-output",style:{color:"var(--text-muted)",fontSize:"11px"},children:"Output available in Tasks panel — click the status bar indicator or the Tasks tab."})]})}case"context_compaction":{const _=((k=t.data)==null?void 0:k.trigger)??"auto",N=((y=t.data)==null?void 0:y.pre_tokens)??0,E=((S=t.data)==null?void 0:S.post_tokens)??0,j=N>0?Math.round((1-E/N)*100):0,W=_==="manual"?"Context compacted (/compact)":"Context auto-compacted";return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(R1,{size:14})}),a.jsx("span",{className:"turn-header-title",children:W})]}),a.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[N.toLocaleString()," → ",E.toLocaleString()," tokens (",j,"% reduction)"]})]})}case"interruption":return a.jsx(jT,{item:t});case"error":{const _=((T=t.data)==null?void 0:T.message)||"Unknown error";return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--red)",color:"#fff"},children:a.jsx($l,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Error"})]}),a.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:a.jsx("code",{children:_})})]})}default:return null}}const Ps=x.memo(PT,(t,s)=>t.item===s.item&&t.runtimeType===s.runtimeType&&t.threads===s.threads&&t.turn.id===s.turn.id);function $T({turn:t,runtimeType:s,threads:r=[]}){Mt.trackRender("TurnContent");const[o,l]=x.useState(!1),[u,d]=x.useState(!1),[p,g]=x.useState(!1);x.useEffect(()=>{const K=t.items.some(be=>be.type==="background_task"&&be.status==="in_progress");t.status==="running"||t.status==="pending"?l(!0):t.status==="completed"&&!K&&l(!1)},[t.status,t.items]);let m=-1;for(let K=t.items.length-1;K>=0;K--)if(t.items[K].type==="agent_message"){m=K;break}const v=m>=0,k=v?t.items.slice(0,m):t.items,y=t.items.some(K=>K.type==="final_result"||K.type==="ask_user"),S=!v&&t.status==="completed"&&t.agent_response&&!y?{id:`response-${t.id}`,turn_id:t.id,external_item_id:`response-${t.id}`,type:"agent_message",data:{text:t.agent_response},status:"completed",created_at:t.created_at,updated_at:t.updated_at}:null,T=k.filter(K=>{var be;return!(K.type==="reasoning"&&(!((be=K.data)!=null&&be.text)||K.data.text===""))}),_=t.items.some(K=>{var be;return K.type==="interruption"&&((be=K.data)==null?void 0:be.reason)==="auth"}),N=t.items.some(K=>{var be;return K.type==="interruption"&&((be=K.data)==null?void 0:be.reason)==="usage_limit"}),E=T.filter(K=>{var be,Z;return!(K.type==="background_task"||K.type==="ask_user"||K.type==="final_result"||_&&K.type==="error"&&((be=K.data)==null?void 0:be.error)==="authentication_failed"||N&&K.type==="error"&&((Z=K.data)==null?void 0:Z.error)==="rate_limit")}),j=u?0:Math.max(0,E.length-AT),W=j>0?E.slice(j):E,A=[];let D=null;for(const K of W)K.type==="agent_message"?(D&&A.push(D),D={agentMessage:K,toolItems:[],otherItems:[]}):K.type==="interruption"||K.type==="error"?(D&&A.push(D),A.push({agentMessage:null,toolItems:[],otherItems:[K]}),D=null):(D||(D={agentMessage:null,toolItems:[],otherItems:[]}),Um(K)?D.toolItems.push(K):D.otherItems.push(K));D&&A.push(D);const G=t.items.filter(K=>K.type==="background_task"),V=p?0:Math.max(0,G.length-RT),$=V>0?G.slice(V):G,te=E.filter(K=>Um(K)).length,me=te>0||E.length>0&&(t.status==="running"||t.status==="pending"),de=t.status==="pending"&&t.resume_state==="waiting",je=t.resume_state==="gave_up"||t.resume_state==="skipped"||t.resume_state==="unsupported";return a.jsxs("div",{className:"turn-group",children:[a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),a.jsx("span",{className:"turn-header-title",children:"You"})]}),a.jsx("p",{className:"user-message",children:t.user_prompt}),Array.isArray(t.attachments)&&t.attachments.length>0&&a.jsx(IT,{attachments:t.attachments})]}),me&&a.jsxs("div",{className:"tool-calls",children:[a.jsxs("div",{className:"tool-calls-header",onClick:()=>l(K=>!K),children:[a.jsx("span",{className:"tool-calls-icon",children:a.jsx(b1,{size:12})}),a.jsx("span",{className:"tool-calls-summary",children:te>0?`${te} tool call${te>1?"s":""}`:de?"interrupted":"thinking…"}),a.jsx(Co,{size:14,className:"tool-calls-chevron",style:{transform:o?"rotate(90deg)":"none"}})]}),o&&a.jsxs("div",{className:"tool-calls-body",children:[j>0&&a.jsx("div",{className:"render-load-earlier",children:a.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>d(!0),children:["Show ",j," earlier step",j>1?"s":""]})}),A.map((K,be)=>a.jsxs("div",{className:"intermediate-segment",children:[K.agentMessage&&a.jsx(Ps,{item:K.agentMessage,runtimeType:s,turn:t,threads:r}),K.otherItems.map(Z=>a.jsx(Ps,{item:Z,runtimeType:s,turn:t,threads:r},Z.id)),K.toolItems.length>0&&a.jsx(fT,{items:K.toolItems,runtimeType:s,turn:t,threads:r})]},be))]})]}),V>0&&a.jsx("div",{className:"render-load-earlier",children:a.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>g(!0),children:["Show ",V," earlier background task",V>1?"s":""]})}),$.map(K=>a.jsx(Ps,{item:K,runtimeType:s,turn:t,threads:r},`task-${K.id}`)),v&&a.jsx(Ps,{item:t.items[m],runtimeType:s,turn:t,threads:r},t.items[m].id),S&&a.jsx(Ps,{item:S,runtimeType:s,turn:t,threads:r},S.id),v&&t.items.slice(m+1).filter(K=>K.type!=="ask_user"&&K.type!=="background_task"&&K.type!=="final_result").map(K=>a.jsx(Ps,{item:K,runtimeType:s,turn:t,threads:r},K.id)),t.items.filter(K=>K.type==="final_result").map(K=>a.jsx(Ps,{item:K,runtimeType:s,turn:t,threads:r},`final-${K.id}`)),t.items.filter(K=>K.type==="ask_user").map(K=>a.jsx(Ps,{item:K,runtimeType:s,turn:t,threads:r},`ask-${K.id}`)),t.items.length===0&&!t.error&&(t.status==="pending"||t.status==="running")&&a.jsx("div",{className:"render-content",children:a.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:t.status==="running"?"Agent is thinking…":"Waiting to start…"})}),t.error&&!je&&a.jsx("div",{className:"render-content",children:a.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:a.jsx("code",{children:t.error})})}),t.status==="running"&&a.jsx(_T,{turnId:t.id}),a.jsx(ET,{turn:t}),t.status==="aborted"&&a.jsxs("div",{className:"aborted-banner",children:[a.jsx("span",{className:"banner-icon",children:a.jsx(Fr,{size:12})}),a.jsx("span",{className:"banner-text",children:"Turn stopped — work generated so far is kept."})]})]})}const zT=x.memo($T),FT=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘K":"Ctrl+K";function UT(){const t=I(N=>N.workspaces),s=I(N=>N.loadPickerSupport),r=I(N=>N.pickAndAddWorkspace),o=I(N=>N.createSessionInWorkspace),l=I(N=>N.setImportSessionsWorkspace);x.useEffect(()=>{s()},[s]);const u=t.filter(N=>N.deleted===0),[d,p]=x.useState(null),g=u.find(N=>N.path===d)??u[u.length-1]??null,m=(g==null?void 0:g.path)??null,[v,k]=x.useState(null);x.useEffect(()=>{if(!m)return;let N=!1;return $g(m).then(E=>{N||k({path:m,count:E.length})}).catch(()=>{}),()=>{N=!0}},[m]);const y=v&&v.path===m?v.count:0,[S,T]=x.useState(!1);async function _(N){T(!0);try{await o(N)}finally{T(!1)}}return a.jsx("div",{className:"render-scroll welcome-scroll",children:a.jsxs("main",{className:"welcome","aria-labelledby":"welcome-title",children:[a.jsx("h1",{className:"welcome-title",id:"welcome-title",children:"Welcome to Repoburg"}),a.jsx("p",{className:"welcome-lead",children:"Run Claude Code and Codex agents on your projects, side by side. Each session works in a workspace: one of your project folders."}),a.jsxs("ol",{className:"welcome-steps",children:[a.jsxs("li",{className:`welcome-step${g?" done":" current"}`,children:[a.jsx("span",{className:"welcome-step-mark","aria-hidden":"true",children:g?a.jsx(Ns,{size:13}):"1"}),a.jsxs("div",{className:"welcome-step-body",children:[a.jsx("h2",{className:"welcome-step-title",children:"Add a workspace"}),g?a.jsx("p",{className:"welcome-step-text",children:a.jsx("code",{title:g.path,children:g.path})}):a.jsxs("button",{className:"dialog-btn-create welcome-primary",onClick:()=>void r(),children:[a.jsx(w1,{size:14})," Open folder…"]})]})]}),a.jsxs("li",{className:`welcome-step${g?" current":" upcoming"}`,children:[a.jsx("span",{className:"welcome-step-mark","aria-hidden":"true",children:"2"}),a.jsxs("div",{className:"welcome-step-body",children:[a.jsx("h2",{className:"welcome-step-title",children:"Start your first session"}),g&&m?a.jsxs(a.Fragment,{children:[u.length>1&&a.jsxs("label",{className:"welcome-step-text welcome-target",children:["In",a.jsx("select",{className:"dialog-input dialog-select",value:m,onChange:N=>p(N.target.value),children:u.map(N=>a.jsx("option",{value:N.path,children:N.label||N.path},N.id))})]}),a.jsxs("div",{className:"welcome-actions",children:[a.jsxs("button",{className:"dialog-btn-create welcome-primary",disabled:S,onClick:()=>void _(m),children:[a.jsx(dr,{size:14})," New session"]}),y>0&&a.jsxs("button",{className:"dialog-btn-cancel",onClick:()=>l(m),children:[a.jsx(nv,{size:14})," Import ",y," Claude Code"," ",y===1?"session":"sessions"]})]}),y>0&&a.jsxs("p",{className:"welcome-step-text",children:["Sessions you started with ",a.jsx("code",{children:"claude"})," in this folder continue right where they left off."]})]}):a.jsx("p",{className:"welcome-step-text",children:"Then start an agent session in it."})]})]})]}),a.jsxs("p",{className:"welcome-tip",children:["Later: right-click a workspace to import its Claude Code sessions, and press ",a.jsx("kbd",{children:FT})," for the command palette."]})]})})}const BT=[],el=50;function WT(){Mt.trackRender("RenderArea");const t=I(S=>S.activeSessionId),s=I(S=>S.activeSessionId?S.sessionDetails[S.activeSessionId]:null),r=I(S=>S.submittingPrompt),o=I(S=>S.loading),l=I(S=>!S.activeSessionId&&!BS(S.workspaces,S.sessions,S.appsRootPath)),u=(s==null?void 0:s.turns)??[],d=(s==null?void 0:s.threads)??BT,p=x.useRef(null),[g,m]=x.useState(el);x.useEffect(()=>{m(el)},[t]);const v=u.filter(S=>!S.thread_id),k=Math.max(0,v.length-g),y=v.slice(k);return x.useEffect(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)},[t,u.length]),o&&!s?a.jsx("div",{className:"render-scroll",children:a.jsxs("div",{className:"skeleton-bars",children:[a.jsx("div",{className:"skeleton-bar"}),a.jsx("div",{className:"skeleton-bar"}),a.jsx("div",{className:"skeleton-bar"}),a.jsx("div",{className:"skeleton-bar"}),a.jsx("div",{className:"skeleton-bar"})]})}):s?a.jsxs("div",{className:"render-scroll",ref:p,children:[r&&a.jsx("div",{className:"turn-block",children:a.jsxs("div",{className:"turn-group",children:[a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),a.jsx("span",{className:"turn-header-title",children:"You"})]}),a.jsx("p",{className:"user-message",children:r})]}),a.jsx("div",{className:"render-content",children:a.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Sending…"})})]})}),u.length===0&&!r&&a.jsx("div",{className:"empty-state",children:"No turns yet. Send a message below to start."}),k>0&&a.jsx("div",{className:"render-load-earlier",children:a.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>m(S=>S+el),children:["Show ",Math.min(el,k)," earlier turns (",k," hidden)"]})}),y.map((S,T)=>a.jsx("div",{id:`turn-${k+T}`,className:"turn-block",children:a.jsx(zT,{turn:S,runtimeType:s.runtime_type,threads:d})},S.id))]}):l?a.jsx(UT,{}):a.jsx("div",{className:"render-scroll",children:a.jsx("div",{className:"empty-state",children:"No session selected"})})}const HT=x.memo(WT),VT=[{id:"model",label:"/model",hint:"Change model",capability:"dynamicModels"},{id:"sandbox",label:"/sandbox",hint:"Sandbox mode",capability:"sandbox",subPopup:"sandbox"},{id:"websearch",label:"/websearch",hint:"Web search mode",capability:"webSearch",subPopup:"websearch"},{id:"network",label:"/network",hint:"Network access",capability:"networkAccess",subPopup:"network"},{id:"skills",label:"/skills",hint:"Browse skills",capability:"skills"},{id:"plugins",label:"/plugins",hint:"Browse plugins",capability:"plugins"},{id:"mcp",label:"/mcp",hint:"Browse MCP servers",capability:"mcpServers"}];function GT(t){return t.map(s=>({id:s.name,label:`/${s.name}`,hint:s.description,capability:null,insertAsText:!0}))}function KT(t,s,r=[]){const o=[...VT,...GT(r)],l=new Set;return o.filter(u=>!(l.has(u.label)||(l.add(u.label),u.capability&&!s[u.capability])||t&&!u.label.toLowerCase().includes(t.toLowerCase())))}function qT({commands:t,selectedIndex:s,onSelect:r,onHover:o}){return a.jsxs("div",{className:"slash-popup",children:[a.jsx("div",{className:"slash-popup-header",children:"Commands"}),t.length===0&&a.jsx("div",{className:"slash-popup-empty",children:"No matching commands"}),t.map((l,u)=>a.jsxs("div",{className:`slash-popup-item ${u===s?"selected":""}`,onMouseEnter:()=>o(u),onClick:()=>r(l),children:[a.jsx("span",{className:"slash-popup-label",children:l.label}),a.jsx("span",{className:"slash-popup-hint",children:l.hint})]},l.id))]})}function Gu({title:t,options:s,currentValue:r,onSelect:o,onClose:l}){return a.jsxs("div",{className:"slash-popup",children:[a.jsxs("div",{className:"slash-popup-header",children:[a.jsx("button",{className:"slash-popup-back",onClick:l,children:"← Back"}),a.jsx("span",{children:t})]}),s.map(u=>a.jsxs("div",{className:`slash-popup-item ${u.value===r?"selected":""}`,onClick:()=>o(u.value),children:[a.jsxs("div",{className:"slash-popup-item-main",children:[a.jsx("span",{className:"slash-popup-label",children:u.label}),u.description&&a.jsx("span",{className:"slash-popup-hint",children:u.description})]}),u.value===r&&a.jsx("span",{className:"slash-popup-check",children:"✓"})]},u.value))]})}function YT(t){return $t("/skills")}function XT({filter:t,onSelect:s,onClose:r}){const[o,l]=x.useState([]),[u,d]=x.useState(!0),[p,g]=x.useState(0),m=x.useRef(null);x.useEffect(()=>{YT().then(l).catch(()=>l([])).finally(()=>d(!1))},[]);const v=o.filter(k=>k.name.toLowerCase().includes(t.toLowerCase())||k.description.toLowerCase().includes(t.toLowerCase()));return x.useEffect(()=>{g(0)},[t]),x.useEffect(()=>{function k(y){y.key==="ArrowDown"?(y.preventDefault(),g(S=>Math.min(S+1,v.length-1))):y.key==="ArrowUp"?(y.preventDefault(),g(S=>Math.max(S-1,0))):y.key==="Enter"?(y.preventDefault(),v[p]&&s(v[p])):y.key==="Escape"&&(y.preventDefault(),r())}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[v,p,s,r]),a.jsxs("div",{className:"slash-popup",ref:m,children:[a.jsxs("div",{className:"slash-popup-header",children:[a.jsx("button",{className:"slash-popup-back",onClick:r,children:"← Back"}),a.jsx("span",{children:"Skills"})]}),u&&a.jsx("div",{className:"slash-popup-empty",children:"Loading skills…"}),!u&&v.length===0&&a.jsx("div",{className:"slash-popup-empty",children:"No matching skills"}),v.map((k,y)=>a.jsxs("div",{className:`slash-popup-item ${y===p?"selected":""}`,onMouseEnter:()=>g(y),onClick:()=>s(k),children:[a.jsxs("div",{className:"slash-popup-item-main",children:[a.jsx("span",{className:"slash-popup-label",children:k.name}),k.description&&a.jsx("span",{className:"slash-popup-hint",children:k.description})]}),!!k.metadata.isSystem&&a.jsx("span",{className:"slash-popup-hint",children:"system"})]},k.id))]})}function iy(){return $t("/providers")}function QT(t,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return $t(`/providers/${t}/commands${r}`)}const ZT={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function JT(t){const[s,r]=x.useState([]),[o,l]=x.useState(!0);x.useEffect(()=>{iy().then(r).catch(()=>r([])).finally(()=>l(!1))},[]);const u=s.find(d=>d.id===t)??null;return{provider:u,capabilities:(u==null?void 0:u.capabilities)??ZT,loading:o}}const gi=32,Ku=200;function Ym(t){if(!t)return{};try{return JSON.parse(t)}catch{return{}}}function Xm(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}let Qm=0;function eN(){return Qm+=1,`att-${Date.now()}-${Qm}`}function tN(){Mt.trackRender("CommandInputBar");const[t,s]=x.useState(""),r=x.useRef(null),o=x.useRef(gi),l=x.useRef(null),{submitPrompt:u,cancelTurn:d,updateRuntimeConfig:p,setShowModelSelector:g}=I(),m=I(Y=>Y.activeSessionId),v=I(Y=>Y.activeSessionId?Y.sessionDetails[Y.activeSessionId]:null),k=I(Y=>Y.quotedText),y=Ig(v),S=!!(v!=null&&v.turns.some(Y=>Y.status==="pending"&&Y.resume_state==="waiting")),T=!m,{capabilities:_}=JT(v==null?void 0:v.runtime_type),N=(v==null?void 0:v.runtime_type)??null,E=_.imageAttachments,[j,W]=x.useState([]),[A,D]=x.useState(!1),[G,V]=x.useState(null),[$,te]=x.useState([]);x.useEffect(()=>{if(!N){te([]);return}let Y=!1;return QT(N,(v==null?void 0:v.cwd)??void 0).then(ve=>{Y||te(ve)}).catch(()=>{Y||te([])}),()=>{Y=!0}},[N,v==null?void 0:v.cwd]);const[me,de]=x.useState(!1),[je,K]=x.useState(""),[be,Z]=x.useState(0),[oe,ae]=x.useState(void 0),[z,Q]=x.useState(!1),[q,M]=x.useState(""),[P,le]=x.useState([]),ge=me?KT(je,_,$):[];x.useEffect(()=>{k!==null&&(s(Y=>Y+k),setTimeout(()=>{if(r.current){Re(),r.current.focus();const Y=r.current.value.length;r.current.setSelectionRange(Y,Y)}},0),I.setState({quotedText:null}))},[k]),x.useEffect(()=>{if(!y)return;function Y(ve){ve.key==="Escape"&&(ve.preventDefault(),d())}return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[y,d]),x.useEffect(()=>{de(!1),ae(void 0),Q(!1),le([]),W(Y=>{for(const ve of Y)ve.previewUrl&&URL.revokeObjectURL(ve.previewUrl);return[]})},[m]),x.useEffect(()=>{if(!G)return;function Y(ve){ve.key==="Escape"&&(ve.preventDefault(),V(null))}return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[G]);const X=x.useCallback(Y=>{if(!Y)return;const ve=Array.from(Y);for(const Ue of ve){const nt=new FileReader;nt.onload=()=>{const gt=nt.result.split(",")[1]??"",Ct=Ue.type.startsWith("image/")?URL.createObjectURL(Ue):void 0;W(an=>[...an,{id:eN(),name:Ue.name,media_type:Ue.type||"application/octet-stream",data:gt,previewUrl:Ct,size:Ue.size}])},nt.readAsDataURL(Ue)}},[]),pe=x.useCallback(Y=>{W(ve=>{const Ue=ve.find(nt=>nt.id===Y);return Ue!=null&&Ue.previewUrl&&URL.revokeObjectURL(Ue.previewUrl),ve.filter(nt=>nt.id!==Y)})},[]),Te=x.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation(),!(!E||y)&&D(!0)},[E,y]),se=x.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation(),D(!1)},[]),he=x.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation(),D(!1),!(!E||y)&&X(Y.dataTransfer.files)},[E,y,X]),Se=x.useCallback(Y=>{var nt;if(!E)return;const ve=(nt=Y.clipboardData)==null?void 0:nt.items;if(!ve)return;const Ue=[];for(let mt=0;mt<ve.length;mt++){const gt=ve[mt];if(gt.type.startsWith("image/")){const Ct=gt.getAsFile();Ct&&Ue.push(Ct)}}Ue.length>0&&(Y.preventDefault(),X(Ue))},[E,X]);function He(Y){const ve=r.current;ve&&(ve.style.height=`${Y}px`,o.current=Y)}function Re(){const Y=r.current;if(Y){if(Y.scrollHeight>Y.clientHeight){const ve=Math.min(Y.scrollHeight,Ku);ve!==o.current&&He(ve);return}o.current>gi&&(Y.style.height="auto",He(Math.min(Y.scrollHeight,Ku)))}}function ct(){const Y=t.trim();if(!Y||y)return;let ve=Y;P.length>0&&(ve=`${P.map(mt=>`$${mt.name}`).join(" ")}
511
511
 
512
- ${Y}`);const Ue=R.map(({id:tt,previewUrl:mt,size:gt,...Ct})=>Ct);s(""),se([]),at(gi),ue(!1),ae(void 0),Q(!1);for(const tt of R)tt.previewUrl&&URL.revokeObjectURL(tt.previewUrl);H([]),u(me,Ue.length>0?Ue:void 0)}function $e(Y){if(Y.insertAsText){const me=`/${Y.id} `;s(me),ue(!1),ae(void 0),requestAnimationFrame(()=>{if(r.current){r.current.focus();const Ue=me.length;r.current.setSelectionRange(Ue,Ue),De()}});return}Y.subPopup?ae(Y.subPopup):Y.id==="skills"?(Q(!0),E(""),ue(!1),s("")):Y.id==="model"?(g(!0),ue(!1),s("")):(ue(!1),s(""))}function en(Y){se(me=>[...me,Y]),Q(!1),s(""),at(gi)}function Fe(Y){const me=qm(v==null?void 0:v.runtime_config);oe==="sandbox"?me.sandboxMode=Y:oe==="websearch"?me.webSearchMode=Y:oe==="network"&&(me.networkAccessEnabled=Y==="true"),p(me),ae(void 0),ue(!1),s(""),at(gi)}function Ht(Y){if(Mt.markKeystroke(),he&&!oe){if(Y.key==="ArrowDown"){Y.preventDefault(),Z(me=>Math.min(me+1,fe.length-1));return}if(Y.key==="ArrowUp"){Y.preventDefault(),Z(me=>Math.max(me-1,0));return}if(Y.key==="Enter"){Y.preventDefault(),fe[we]&&$e(fe[we]);return}if(Y.key==="Escape"){Y.preventDefault(),ue(!1),s("");return}}if(oe&&Y.key==="Escape"){Y.preventDefault(),ae(void 0);return}if(Y.key==="Enter"&&(Y.metaKey||Y.ctrlKey)&&!y){Y.preventDefault(),lt();return}Y.key==="Escape"&&y&&(Y.preventDefault(),d())}function tn(Y){Mt.markInputChange();const me=Y.target.value;s(me),De(),me.startsWith("/")&&!me.includes(" ")&&!y?(ue(!0),q(me.slice(1)),Z(0)):(ue(!1),ae(void 0)),me.startsWith("$")&&!y?(Q(!0),E(me.slice(1))):me.startsWith("$")||Q(!1)}const wt=qm(v==null?void 0:v.runtime_config),jt=[{value:"read-only",label:"Read Only",description:"Agent can only read files"},{value:"workspace-write",label:"Workspace Write",description:"Agent can read and write in workspace"},{value:"danger-full-access",label:"Danger Full Access",description:"Agent has unrestricted access"}],$t=[{value:"disabled",label:"Disabled",description:"No web search"},{value:"cached",label:"Cached",description:"Use cached search results"},{value:"live",label:"Live",description:"Perform live web searches"}],Dt=[{value:"false",label:"Disabled",description:"No network access"},{value:"true",label:"Enabled",description:"Allow network access in sandbox"}];return a.jsxs("div",{className:`cmd-bar${M?" drag-over":""}`,onDragOver:Ne,onDragLeave:_e,onDrop:Ae,children:[he&&!oe&&a.jsx(UT,{commands:fe,selectedIndex:we,onSelect:$e,onHover:Z}),he&&oe==="sandbox"&&a.jsx(Hu,{title:"Sandbox Mode",options:jt,currentValue:wt.sandboxMode,onSelect:Fe,onClose:()=>ae(void 0)}),he&&oe==="websearch"&&a.jsx(Hu,{title:"Web Search",options:$t,currentValue:wt.webSearchMode,onSelect:Fe,onClose:()=>ae(void 0)}),he&&oe==="network"&&a.jsx(Hu,{title:"Network Access",options:Dt,currentValue:wt.networkAccessEnabled===!0?"true":"false",onSelect:Fe,onClose:()=>ae(void 0)}),z&&a.jsx(WT,{filter:B,onSelect:en,onClose:()=>{Q(!1),s("")}}),P.length>0&&a.jsx("div",{className:"skill-badges",children:P.map(Y=>a.jsxs("span",{className:"skill-badge",children:["$",Y.name,a.jsx("button",{className:"skill-badge-remove",onClick:()=>se(me=>me.filter(Ue=>Ue.id!==Y.id)),children:"×"})]},Y.id))}),R.length>0&&a.jsx("div",{className:"attachment-preview-area",children:R.map(Y=>a.jsxs("div",{className:"attachment-chip",title:Y.name,children:[Y.previewUrl?a.jsx("img",{src:Y.previewUrl,alt:Y.name,className:"attachment-thumb",onClick:()=>G(Y),style:{cursor:"pointer"}}):a.jsx(Xg,{size:20,className:"attachment-file-icon"}),a.jsxs("div",{className:"attachment-info",children:[a.jsx("span",{className:"attachment-name",children:Y.name}),a.jsx("span",{className:"attachment-size",children:Ym(Y.size)})]}),a.jsx("button",{className:"attachment-remove",onClick:()=>pe(Y.id),title:"Remove attachment",children:a.jsx(Tn,{size:14})})]},Y.id))}),C&&!y&&!T&&a.jsx("input",{ref:l,type:"file",multiple:!0,accept:"image/*,application/pdf,text/*,.ts,.js,.tsx,.jsx,.py,.go,.rs,.java,.c,.cpp,.h,.css,.html,.xml,.yml,.yaml,.toml,.ini,.sh,.sql",style:{display:"none"},onChange:Y=>{X(Y.target.files),Y.target.value=""}}),a.jsxs("div",{className:"cmd-input-row",children:[C&&!y&&!T&&a.jsx("button",{className:"attachment-clip-btn",onClick:()=>{var Y;return(Y=l.current)==null?void 0:Y.click()},title:"Attach files",disabled:y,children:a.jsx(E1,{size:16})}),a.jsx("textarea",{ref:r,className:"cmd-textarea",placeholder:T?"Select or create a session…":S?"Interrupted — waiting to resume…":y?"Agent is running…":"Type a message… Use / for commands",autoComplete:"off",value:t,disabled:y||T,rows:1,style:{minHeight:gi,maxHeight:Vu},onChange:tn,onKeyDown:Ht,onPaste:Ee}),y?a.jsx("button",{className:"cmd-stop-btn",onClick:()=>d(),title:"Stop (Esc)",children:a.jsx(Fr,{size:15})}):a.jsx("button",{className:"cmd-send-btn",onClick:lt,disabled:!t.trim()||T,title:"Send (⌘↵)",children:a.jsx(qg,{size:16})})]}),K&&a.jsx("div",{className:"image-preview-modal",onClick:()=>G(null),children:a.jsxs("div",{className:"image-preview-content",onClick:Y=>Y.stopPropagation(),children:[a.jsx("img",{src:K.previewUrl,alt:K.name}),a.jsxs("div",{className:"image-preview-info",children:[a.jsx("span",{children:K.name}),a.jsx("span",{children:Ym(K.size)})]}),a.jsx("button",{className:"image-preview-close",onClick:()=>G(null),children:a.jsx(Tn,{size:20})})]})})]})}function XT(){const t=I(N=>N.activeSessionId),s=I(N=>N.activeSessionId?N.sessionDetails[N.activeSessionId]:null),r=I(N=>N.activeTurnIndex),o=I(N=>N.setActiveTurnIndex),l=I(N=>N.rewindToTurn),u=I(N=>N.restoreSession),d=I(N=>N.branchFromTurn),p=(s==null?void 0:s.turns)??[],g=Al(s),m=!!(s!=null&&s.rewound_at_turn_id),v=(s==null?void 0:s.runtime_type)==="repoburg",k=v?"Rewind to this turn? Runtime history after this point is PERMANENTLY deleted and cannot be restored.":"Rewind to this turn? Hidden turns can be restored later.",[y,S]=x.useState(null),T=x.useRef(null);if(Do(T,()=>S(null),!!y),Ni(()=>S(null),!!y),p.length===0)return a.jsx("div",{className:"empty-state",children:"No turns yet"});function _(N){o(N),requestAnimationFrame(()=>{var C;(C=document.getElementById(`turn-${N}`))==null||C.scrollIntoView({behavior:"smooth",block:"start"})})}return a.jsxs("div",{className:"right-section",children:[a.jsx("div",{className:"right-section-title",children:"Conversation"}),p.map((N,C)=>{const R=C===r,H=N.user_prompt.length>50?N.user_prompt.slice(0,50)+"…":N.user_prompt,M=N.status==="running"||N.status==="pending";return a.jsx("div",{children:a.jsxs("div",{className:`turn-item ${R?"active":""}`,onClick:()=>_(C),onContextMenu:D=>{D.preventDefault(),S({x:D.clientX,y:D.clientY,turnId:N.id,turnIndex:C,isLast:C===p.length-1,isSlashCommand:N.user_prompt.trimStart().startsWith("/")})},children:[a.jsx("span",{className:"turn-item-icon",style:{background:"var(--amber)",color:"#fff"},children:a.jsx(P1,{size:12})}),a.jsx("span",{className:"turn-item-label",children:H}),M&&a.jsx("span",{className:"turn-item-status",children:N.status==="pending"&&N.resume_state==="waiting"?"interrupted":"running…"})]})},N.id)}),y&&a.jsxs("div",{ref:T,className:"ctx-menu",style:{position:"fixed",left:y.x,top:y.y,zIndex:500},children:[a.jsxs("div",{className:`ctx-menu-item ${y.isLast||g||y.isSlashCommand?"ctx-disabled":""}`,onClick:()=>{y.isLast||g||y.isSlashCommand||(window.confirm(k)&&l(t,y.turnId),S(null))},children:[a.jsx(I1,{size:12})," Rewind to Here",y.isSlashCommand?" (slash command)":""]}),m&&!v&&a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{u(t),S(null)},children:[a.jsx(_o,{size:12})," Restore Rewind"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{d(t,y.turnId),S(null)},children:[a.jsx(Zg,{size:12})," Branch from Here"]})]})]})}function qd(t){return(t??[]).filter(s=>s.task_type!=="local_agent").length}const Qm=2e4;function QT(t){const s=[];return t.forEach((r,o)=>{var l;for(const u of r.items)if(u.type==="background_task"){if((((l=u.data)==null?void 0:l.task_type)||"unknown")==="local_agent")continue;s.push({item:u,turnIndex:o,turnPrompt:r.user_prompt})}}),s}function ZT({entry:t}){const{item:s,turnIndex:r,turnPrompt:o}=t,l=s.data||{},u=l.task_type||"unknown",d=l.subagent_type||null,p=l.description||"",g=l.summary||null,m=l.last_tool_name||null,v=l.token_count||null,k=l.output||"",y=s.status==="in_progress",S=l.status||"running",T=!y&&S==="running"?"stopped":S,_=u==="local_agent",N=u==="local_bash",C=_?mr:N?rv:Yg,R=_?`Subagent${d?`: ${d}`:""}`:N?"Monitor":"Background Task",H=T==="running"?"running…":T==="completed"?"done":T==="failed"?"failed":T==="stopped"?"stopped":T,M=T==="failed"||s.status==="failed"&&T!=="stopped",[D,K]=x.useState(y),[G,$]=x.useState(!1),te=x.useRef(null);x.useEffect(()=>{y&&K(!0)},[y]),x.useEffect(()=>{D&&y&&te.current&&(te.current.scrollTop=te.current.scrollHeight)},[D,y,k]);const he=k.length>Qm,ue=he&&!G?k.slice(0,Qm)+`
513
- … (truncated, click to expand)`:k,Se=y?null:T==="completed"?a.jsx(Ts,{size:12}):M?a.jsx(Ll,{size:12}):a.jsx(Fr,{size:12});return a.jsxs("div",{className:`task-card ${y?"task-running":""} ${M?"task-failed":""}`,children:[a.jsxs("div",{className:"task-card-header",onClick:()=>K(q=>!q),style:{cursor:"pointer"},children:[a.jsx("span",{className:"task-card-icon",children:a.jsx(C,{size:14})}),a.jsx("span",{className:"task-card-type",children:R}),a.jsxs("span",{className:`task-card-status ${M?"task-status-failed":y?"task-status-running":"task-status-done"}`,children:[Se," ",H]}),a.jsx(Co,{size:14,className:"task-card-chevron",style:{transform:D?"rotate(90deg)":"none",marginLeft:"auto"}})]}),p&&a.jsx("div",{className:"task-card-desc",children:p}),y&&m&&a.jsxs("div",{className:"task-card-meta",children:["last tool: ",m,v!=null&&` · ${v.toLocaleString()} tokens`]}),D&&a.jsxs("div",{className:"task-card-body",children:[k?a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:"cmd-output task-output",ref:te,children:a.jsx("code",{children:ue})}),he&&a.jsx("button",{className:"cmd-output-toggle",onClick:()=>$(q=>!q),children:G?"Show less":`Show full output (${(k.length/1024).toFixed(0)}KB)`})]}):g?a.jsx("pre",{className:"cmd-output task-output",children:a.jsx("code",{children:g})}):y?a.jsx("div",{className:"task-card-placeholder",children:"Waiting for output…"}):a.jsx("div",{className:"task-card-placeholder",children:"No output captured."}),a.jsxs("div",{className:"task-card-context",title:o,children:["from turn ",r+1,": ",o.length>60?o.slice(0,60)+"…":o]})]})]})}const JT=x.memo(ZT);function eN(){const t=I(d=>d.activeSessionId?d.sessionDetails[d.activeSessionId]:null),s=I(d=>d.activeSessionId?d.backgroundTasks[d.activeSessionId]:void 0),r=(t==null?void 0:t.turns)??[],o=QT(r),l=[...o].sort((d,p)=>{const g=d.item.status==="in_progress",m=p.item.status==="in_progress";return g&&!m?-1:!g&&m?1:p.turnIndex-d.turnIndex}),u=qd(s);return o.length===0?a.jsx("div",{className:"empty-state",children:"No background tasks yet"}):a.jsxs("div",{className:"right-section",children:[a.jsxs("div",{className:"right-section-title",children:["Background Tasks (",o.length,")",u>0&&a.jsxs("span",{className:"task-count-badge",style:{color:"var(--amber)"},children:[" ",u," running"]})]}),l.map(d=>a.jsx(JT,{entry:d},d.item.id))]})}const tN=x.memo(eN),nN="Your job is to answer questions about this session:",Zm="Understand the user's question below, read the session file given above, and answer.",sN=new Set(["claude"]);function rN(t){return sN.has(t)}function Yd(t){return t.kind==="sidecar"}function iN(t){const s=(t??[]).filter(Yd);return s.length?s[s.length-1]:null}function oN(t){if(!t.startsWith(nN))return t;const s=t.indexOf(Zm);return s<0?t:t.slice(s+Zm.length).replace(/^\n+/,"")}function aN({thread:t,onClose:s}){const{activeSessionId:r,resolveThread:o,shareThread:l}=I(),[u,d]=x.useState(""),[p,g]=x.useState(!1),[m,v]=x.useState(!1);async function k(){if(!r||p)return;g(!0),await l(r,t.id,u)?s():g(!1)}async function y(){!r||m||(v(!0),await o(r,t.id),s())}const S=p||m;return a.jsx("div",{className:"dialog-overlay",onClick:S?void 0:s,children:a.jsxs("div",{className:"dialog",onClick:T=>T.stopPropagation(),children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",children:"Resolve thread"}),a.jsx("button",{className:"dialog-close",onClick:s,disabled:S,children:a.jsx(Tn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[a.jsx("div",{className:"dialog-hint",children:"Share this thread's findings with the main session? The discussion will be summarized and the summary is added to your input as a quote."}),a.jsxs("label",{className:"dialog-label",children:["Summarization directives (optional)",a.jsx("textarea",{className:"dialog-input share-directives-input",placeholder:"e.g. focus on the performance findings, keep file paths",value:u,onChange:T=>d(T.target.value),rows:3,disabled:S,autoFocus:!0})]})]}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:s,disabled:S,children:"Cancel"}),a.jsxs("button",{className:"dialog-btn-cancel",onClick:y,disabled:S,title:"Resolve without sharing",children:[m?a.jsx(hn,{size:13,className:"spin"}):a.jsx(ml,{size:13}),"Resolve only"]}),a.jsxs("button",{className:"dialog-btn-create",onClick:k,disabled:S,children:[p?a.jsx(hn,{size:13,className:"spin"}):a.jsx(D1,{size:13}),p?"Summarizing…":"Share & Resolve"]})]})]})})}const Jm=[];Ve.setOptions({breaks:!0,gfm:!0});function lN(t){const s=Ve.parse(t);return Kd.sanitize(s)}function cN(t){var s,r,o;if(t.type==="agent_message"||t.type==="final_result"){const l=(s=t.data)==null?void 0:s.text;return typeof l=="string"&&l?l:null}if(t.type==="ask_user"){const l=Array.isArray((r=t.data)==null?void 0:r.groups)?t.data.groups:[],u=[(o=t.data)==null?void 0:o.question,...l.map(d=>d.question)].filter(d=>typeof d=="string"&&!!d);return u.length?u.join(`
512
+ ${Y}`);const Ue=j.map(({id:nt,previewUrl:mt,size:gt,...Ct})=>Ct);s(""),le([]),He(gi),de(!1),ae(void 0),Q(!1);for(const nt of j)nt.previewUrl&&URL.revokeObjectURL(nt.previewUrl);W([]),u(ve,Ue.length>0?Ue:void 0)}function $e(Y){if(Y.insertAsText){const ve=`/${Y.id} `;s(ve),de(!1),ae(void 0),requestAnimationFrame(()=>{if(r.current){r.current.focus();const Ue=ve.length;r.current.setSelectionRange(Ue,Ue),Re()}});return}Y.subPopup?ae(Y.subPopup):Y.id==="skills"?(Q(!0),M(""),de(!1),s("")):Y.id==="model"?(g(!0),de(!1),s("")):(de(!1),s(""))}function en(Y){le(ve=>[...ve,Y]),Q(!1),s(""),He(gi)}function Fe(Y){const ve=Ym(v==null?void 0:v.runtime_config);oe==="sandbox"?ve.sandboxMode=Y:oe==="websearch"?ve.webSearchMode=Y:oe==="network"&&(ve.networkAccessEnabled=Y==="true"),p(ve),ae(void 0),de(!1),s(""),He(gi)}function Ht(Y){if(Mt.markKeystroke(),me&&!oe){if(Y.key==="ArrowDown"){Y.preventDefault(),Z(ve=>Math.min(ve+1,ge.length-1));return}if(Y.key==="ArrowUp"){Y.preventDefault(),Z(ve=>Math.max(ve-1,0));return}if(Y.key==="Enter"){Y.preventDefault(),ge[be]&&$e(ge[be]);return}if(Y.key==="Escape"){Y.preventDefault(),de(!1),s("");return}}if(oe&&Y.key==="Escape"){Y.preventDefault(),ae(void 0);return}if(Y.key==="Enter"&&(Y.metaKey||Y.ctrlKey)&&!y){Y.preventDefault(),ct();return}Y.key==="Escape"&&y&&(Y.preventDefault(),d())}function tn(Y){Mt.markInputChange();const ve=Y.target.value;s(ve),Re(),ve.startsWith("/")&&!ve.includes(" ")&&!y?(de(!0),K(ve.slice(1)),Z(0)):(de(!1),ae(void 0)),ve.startsWith("$")&&!y?(Q(!0),M(ve.slice(1))):ve.startsWith("$")||Q(!1)}const wt=Ym(v==null?void 0:v.runtime_config),jt=[{value:"read-only",label:"Read Only",description:"Agent can only read files"},{value:"workspace-write",label:"Workspace Write",description:"Agent can read and write in workspace"},{value:"danger-full-access",label:"Danger Full Access",description:"Agent has unrestricted access"}],zt=[{value:"disabled",label:"Disabled",description:"No web search"},{value:"cached",label:"Cached",description:"Use cached search results"},{value:"live",label:"Live",description:"Perform live web searches"}],Dt=[{value:"false",label:"Disabled",description:"No network access"},{value:"true",label:"Enabled",description:"Allow network access in sandbox"}];return a.jsxs("div",{className:`cmd-bar${A?" drag-over":""}`,onDragOver:Te,onDragLeave:se,onDrop:he,children:[me&&!oe&&a.jsx(qT,{commands:ge,selectedIndex:be,onSelect:$e,onHover:Z}),me&&oe==="sandbox"&&a.jsx(Gu,{title:"Sandbox Mode",options:jt,currentValue:wt.sandboxMode,onSelect:Fe,onClose:()=>ae(void 0)}),me&&oe==="websearch"&&a.jsx(Gu,{title:"Web Search",options:zt,currentValue:wt.webSearchMode,onSelect:Fe,onClose:()=>ae(void 0)}),me&&oe==="network"&&a.jsx(Gu,{title:"Network Access",options:Dt,currentValue:wt.networkAccessEnabled===!0?"true":"false",onSelect:Fe,onClose:()=>ae(void 0)}),z&&a.jsx(XT,{filter:q,onSelect:en,onClose:()=>{Q(!1),s("")}}),P.length>0&&a.jsx("div",{className:"skill-badges",children:P.map(Y=>a.jsxs("span",{className:"skill-badge",children:["$",Y.name,a.jsx("button",{className:"skill-badge-remove",onClick:()=>le(ve=>ve.filter(Ue=>Ue.id!==Y.id)),children:"×"})]},Y.id))}),j.length>0&&a.jsx("div",{className:"attachment-preview-area",children:j.map(Y=>a.jsxs("div",{className:"attachment-chip",title:Y.name,children:[Y.previewUrl?a.jsx("img",{src:Y.previewUrl,alt:Y.name,className:"attachment-thumb",onClick:()=>V(Y),style:{cursor:"pointer"}}):a.jsx(Jg,{size:20,className:"attachment-file-icon"}),a.jsxs("div",{className:"attachment-info",children:[a.jsx("span",{className:"attachment-name",children:Y.name}),a.jsx("span",{className:"attachment-size",children:Xm(Y.size)})]}),a.jsx("button",{className:"attachment-remove",onClick:()=>pe(Y.id),title:"Remove attachment",children:a.jsx(Tn,{size:14})})]},Y.id))}),E&&!y&&!T&&a.jsx("input",{ref:l,type:"file",multiple:!0,accept:"image/*,application/pdf,text/*,.ts,.js,.tsx,.jsx,.py,.go,.rs,.java,.c,.cpp,.h,.css,.html,.xml,.yml,.yaml,.toml,.ini,.sh,.sql",style:{display:"none"},onChange:Y=>{X(Y.target.files),Y.target.value=""}}),a.jsxs("div",{className:"cmd-input-row",children:[E&&!y&&!T&&a.jsx("button",{className:"attachment-clip-btn",onClick:()=>{var Y;return(Y=l.current)==null?void 0:Y.click()},title:"Attach files",disabled:y,children:a.jsx(L1,{size:16})}),a.jsx("textarea",{ref:r,className:"cmd-textarea",placeholder:T?"Select or create a session…":S?"Interrupted — waiting to resume…":y?"Agent is running…":"Type a message… Use / for commands",autoComplete:"off",value:t,disabled:y||T,rows:1,style:{minHeight:gi,maxHeight:Ku},onChange:tn,onKeyDown:Ht,onPaste:Se}),y?a.jsx("button",{className:"cmd-stop-btn",onClick:()=>d(),title:"Stop (Esc)",children:a.jsx(Fr,{size:15})}):a.jsx("button",{className:"cmd-send-btn",onClick:ct,disabled:!t.trim()||T,title:"Send (⌘↵)",children:a.jsx(Qg,{size:16})})]}),G&&a.jsx("div",{className:"image-preview-modal",onClick:()=>V(null),children:a.jsxs("div",{className:"image-preview-content",onClick:Y=>Y.stopPropagation(),children:[a.jsx("img",{src:G.previewUrl,alt:G.name}),a.jsxs("div",{className:"image-preview-info",children:[a.jsx("span",{children:G.name}),a.jsx("span",{children:Xm(G.size)})]}),a.jsx("button",{className:"image-preview-close",onClick:()=>V(null),children:a.jsx(Tn,{size:20})})]})})]})}function nN(){const t=I(N=>N.activeSessionId),s=I(N=>N.activeSessionId?N.sessionDetails[N.activeSessionId]:null),r=I(N=>N.activeTurnIndex),o=I(N=>N.setActiveTurnIndex),l=I(N=>N.rewindToTurn),u=I(N=>N.restoreSession),d=I(N=>N.branchFromTurn),p=(s==null?void 0:s.turns)??[],g=Dl(s),m=!!(s!=null&&s.rewound_at_turn_id),v=(s==null?void 0:s.runtime_type)==="repoburg",k=v?"Rewind to this turn? Runtime history after this point is PERMANENTLY deleted and cannot be restored.":"Rewind to this turn? Hidden turns can be restored later.",[y,S]=x.useState(null),T=x.useRef(null);if(Do(T,()=>S(null),!!y),Ni(()=>S(null),!!y),p.length===0)return a.jsx("div",{className:"empty-state",children:"No turns yet"});function _(N){o(N),requestAnimationFrame(()=>{var E;(E=document.getElementById(`turn-${N}`))==null||E.scrollIntoView({behavior:"smooth",block:"start"})})}return a.jsxs("div",{className:"right-section",children:[a.jsx("div",{className:"right-section-title",children:"Conversation"}),p.map((N,E)=>{const j=E===r,W=N.user_prompt.length>50?N.user_prompt.slice(0,50)+"…":N.user_prompt,A=N.status==="running"||N.status==="pending";return a.jsx("div",{children:a.jsxs("div",{className:`turn-item ${j?"active":""}`,onClick:()=>_(E),onContextMenu:D=>{D.preventDefault(),S({x:D.clientX,y:D.clientY,turnId:N.id,turnIndex:E,isLast:E===p.length-1,isSlashCommand:N.user_prompt.trimStart().startsWith("/")})},children:[a.jsx("span",{className:"turn-item-icon",style:{background:"var(--amber)",color:"#fff"},children:a.jsx(H1,{size:12})}),a.jsx("span",{className:"turn-item-label",children:W}),A&&a.jsx("span",{className:"turn-item-status",children:N.status==="pending"&&N.resume_state==="waiting"?"interrupted":"running…"})]})},N.id)}),y&&a.jsxs("div",{ref:T,className:"ctx-menu",style:{position:"fixed",left:y.x,top:y.y,zIndex:500},children:[a.jsxs("div",{className:`ctx-menu-item ${y.isLast||g||y.isSlashCommand?"ctx-disabled":""}`,onClick:()=>{y.isLast||g||y.isSlashCommand||(window.confirm(k)&&l(t,y.turnId),S(null))},children:[a.jsx(z1,{size:12})," Rewind to Here",y.isSlashCommand?" (slash command)":""]}),m&&!v&&a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{u(t),S(null)},children:[a.jsx(_o,{size:12})," Restore Rewind"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{d(t,y.turnId),S(null)},children:[a.jsx(tv,{size:12})," Branch from Here"]})]})]})}function Yd(t){return(t??[]).filter(s=>s.task_type!=="local_agent").length}const Zm=2e4;function sN(t){const s=[];return t.forEach((r,o)=>{var l;for(const u of r.items)if(u.type==="background_task"){if((((l=u.data)==null?void 0:l.task_type)||"unknown")==="local_agent")continue;s.push({item:u,turnIndex:o,turnPrompt:r.user_prompt})}}),s}function rN({entry:t}){const{item:s,turnIndex:r,turnPrompt:o}=t,l=s.data||{},u=l.task_type||"unknown",d=l.subagent_type||null,p=l.description||"",g=l.summary||null,m=l.last_tool_name||null,v=l.token_count||null,k=l.output||"",y=s.status==="in_progress",S=l.status||"running",T=!y&&S==="running"?"stopped":S,_=u==="local_agent",N=u==="local_bash",E=_?mr:N?av:Zg,j=_?`Subagent${d?`: ${d}`:""}`:N?"Monitor":"Background Task",W=T==="running"?"running…":T==="completed"?"done":T==="failed"?"failed":T==="stopped"?"stopped":T,A=T==="failed"||s.status==="failed"&&T!=="stopped",[D,G]=x.useState(y),[V,$]=x.useState(!1),te=x.useRef(null);x.useEffect(()=>{y&&G(!0)},[y]),x.useEffect(()=>{D&&y&&te.current&&(te.current.scrollTop=te.current.scrollHeight)},[D,y,k]);const me=k.length>Zm,de=me&&!V?k.slice(0,Zm)+`
513
+ … (truncated, click to expand)`:k,je=y?null:T==="completed"?a.jsx(Ns,{size:12}):A?a.jsx($l,{size:12}):a.jsx(Fr,{size:12});return a.jsxs("div",{className:`task-card ${y?"task-running":""} ${A?"task-failed":""}`,children:[a.jsxs("div",{className:"task-card-header",onClick:()=>G(K=>!K),style:{cursor:"pointer"},children:[a.jsx("span",{className:"task-card-icon",children:a.jsx(E,{size:14})}),a.jsx("span",{className:"task-card-type",children:j}),a.jsxs("span",{className:`task-card-status ${A?"task-status-failed":y?"task-status-running":"task-status-done"}`,children:[je," ",W]}),a.jsx(Co,{size:14,className:"task-card-chevron",style:{transform:D?"rotate(90deg)":"none",marginLeft:"auto"}})]}),p&&a.jsx("div",{className:"task-card-desc",children:p}),y&&m&&a.jsxs("div",{className:"task-card-meta",children:["last tool: ",m,v!=null&&` · ${v.toLocaleString()} tokens`]}),D&&a.jsxs("div",{className:"task-card-body",children:[k?a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:"cmd-output task-output",ref:te,children:a.jsx("code",{children:de})}),me&&a.jsx("button",{className:"cmd-output-toggle",onClick:()=>$(K=>!K),children:V?"Show less":`Show full output (${(k.length/1024).toFixed(0)}KB)`})]}):g?a.jsx("pre",{className:"cmd-output task-output",children:a.jsx("code",{children:g})}):y?a.jsx("div",{className:"task-card-placeholder",children:"Waiting for output…"}):a.jsx("div",{className:"task-card-placeholder",children:"No output captured."}),a.jsxs("div",{className:"task-card-context",title:o,children:["from turn ",r+1,": ",o.length>60?o.slice(0,60)+"…":o]})]})]})}const iN=x.memo(rN);function oN(){const t=I(d=>d.activeSessionId?d.sessionDetails[d.activeSessionId]:null),s=I(d=>d.activeSessionId?d.backgroundTasks[d.activeSessionId]:void 0),r=(t==null?void 0:t.turns)??[],o=sN(r),l=[...o].sort((d,p)=>{const g=d.item.status==="in_progress",m=p.item.status==="in_progress";return g&&!m?-1:!g&&m?1:p.turnIndex-d.turnIndex}),u=Yd(s);return o.length===0?a.jsx("div",{className:"empty-state",children:"No background tasks yet"}):a.jsxs("div",{className:"right-section",children:[a.jsxs("div",{className:"right-section-title",children:["Background Tasks (",o.length,")",u>0&&a.jsxs("span",{className:"task-count-badge",style:{color:"var(--amber)"},children:[" ",u," running"]})]}),l.map(d=>a.jsx(iN,{entry:d},d.item.id))]})}const aN=x.memo(oN),lN="Your job is to answer questions about this session:",Jm="Understand the user's question below, read the session file given above, and answer.",cN=new Set(["claude"]);function uN(t){return cN.has(t)}function Xd(t){return t.kind==="sidecar"}function dN(t){const s=(t??[]).filter(Xd);return s.length?s[s.length-1]:null}function fN(t){if(!t.startsWith(lN))return t;const s=t.indexOf(Jm);return s<0?t:t.slice(s+Jm.length).replace(/^\n+/,"")}function pN({thread:t,onClose:s}){const{activeSessionId:r,resolveThread:o,shareThread:l}=I(),[u,d]=x.useState(""),[p,g]=x.useState(!1),[m,v]=x.useState(!1);async function k(){if(!r||p)return;g(!0),await l(r,t.id,u)?s():g(!1)}async function y(){!r||m||(v(!0),await o(r,t.id),s())}const S=p||m;return a.jsx("div",{className:"dialog-overlay",onClick:S?void 0:s,children:a.jsxs("div",{className:"dialog",onClick:T=>T.stopPropagation(),children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",children:"Resolve thread"}),a.jsx("button",{className:"dialog-close",onClick:s,disabled:S,children:a.jsx(Tn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[a.jsx("div",{className:"dialog-hint",children:"Share this thread's findings with the main session? The discussion will be summarized and the summary is added to your input as a quote."}),a.jsxs("label",{className:"dialog-label",children:["Summarization directives (optional)",a.jsx("textarea",{className:"dialog-input share-directives-input",placeholder:"e.g. focus on the performance findings, keep file paths",value:u,onChange:T=>d(T.target.value),rows:3,disabled:S,autoFocus:!0})]})]}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:s,disabled:S,children:"Cancel"}),a.jsxs("button",{className:"dialog-btn-cancel",onClick:y,disabled:S,title:"Resolve without sharing",children:[m?a.jsx(hn,{size:13,className:"spin"}):a.jsx(vl,{size:13}),"Resolve only"]}),a.jsxs("button",{className:"dialog-btn-create",onClick:k,disabled:S,children:[p?a.jsx(hn,{size:13,className:"spin"}):a.jsx(U1,{size:13}),p?"Summarizing…":"Share & Resolve"]})]})]})})}const eg=[];Ge.setOptions({breaks:!0,gfm:!0});function hN(t){const s=Ge.parse(t);return qd.sanitize(s)}function mN(t){var s,r,o;if(t.type==="agent_message"||t.type==="final_result"){const l=(s=t.data)==null?void 0:s.text;return typeof l=="string"&&l?l:null}if(t.type==="ask_user"){const l=Array.isArray((r=t.data)==null?void 0:r.groups)?t.data.groups:[],u=[(o=t.data)==null?void 0:o.question,...l.map(d=>d.question)].filter(d=>typeof d=="string"&&!!d);return u.length?u.join(`
514
514
 
515
- `):null}return null}function uN(t){const s=t.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return s?s[1]:t}function ny({turn:t,formatPrompt:s=uN}){const r=s(t.user_prompt),o=t.items.map(cN).filter(l=>l!==null);return o.length===0&&t.status==="completed"&&t.agent_response&&o.push(t.agent_response),a.jsxs("div",{className:"thread-card-turn",children:[a.jsx("div",{className:"thread-card-user-message",children:r}),o.map((l,u)=>a.jsx("div",{className:"thread-card-ai-response",dangerouslySetInnerHTML:{__html:lN(l)}},u)),o.length===0&&(t.status==="pending"||t.status==="running")&&a.jsx("div",{className:"thread-card-pending",children:t.status==="running"?"AI is responding…":"Waiting…"}),t.status==="failed"&&a.jsx("div",{className:"thread-card-pending",children:t.error||"Turn failed"})]})}function dN({thread:t,threadTurns:s,onStop:r,onResolve:o,onReopen:l,onDelete:u,onFollowup:d,onLocate:p}){var q,we,Z;const[g,m]=x.useState(""),[v,k]=x.useState(!0),y=x.useRef(null),S=x.useRef(null),[T,_]=x.useState(!1),[N,C]=x.useState({x:0,y:0}),[R,H]=x.useState(""),M=s.some(hr),D=28,K=120,G=x.useRef(D);x.useEffect(()=>{const oe=S.current;oe&&(oe.scrollTop=oe.scrollHeight)},[s.length,v]);function $(oe){const ae=y.current;ae&&(ae.style.height=`${oe}px`,G.current=oe)}function te(){const oe=y.current;if(oe){if(oe.scrollHeight>oe.clientHeight){const ae=Math.min(oe.scrollHeight,K);ae!==G.current&&$(ae);return}G.current>D&&(oe.style.height="auto",$(Math.min(oe.scrollHeight,K)))}}const he=x.useCallback(()=>{_(!1)},[]),ue=x.useCallback(()=>{const oe=S.current;if(!oe)return;const ae=window.getSelection();if(!ae||ae.rangeCount===0||ae.isCollapsed){_(!1);return}const z=ae.getRangeAt(0);if(!oe.contains(z.commonAncestorContainer)){_(!1);return}const Q=z.commonAncestorContainer.nodeType===Node.TEXT_NODE?z.commonAncestorContainer.parentElement:z.commonAncestorContainer;if(!(Q!=null&&Q.closest(".thread-card-ai-response"))){_(!1);return}const B=ae.toString();if(!B.trim()){_(!1);return}const E=z.getBoundingClientRect(),P=28,se=6,fe=170;let X=!1;if(ae.anchorNode&&ae.focusNode)try{const _e=document.createRange();_e.setStart(ae.focusNode,ae.focusOffset),_e.setEnd(ae.focusNode,ae.focusOffset);const Ae=document.createRange();Ae.setStart(ae.anchorNode,ae.anchorOffset),Ae.setEnd(ae.anchorNode,ae.anchorOffset),X=Ae.compareBoundaryPoints(Range.START_TO_START,_e)>0}catch{X=!1}let pe=E.top-P-se;pe<8&&(pe=E.bottom+se);let Ne=X?E.left-fe:E.right;Ne=Math.max(8,Math.min(Ne,window.innerWidth-fe-8)),C({x:Ne,y:pe}),H(B),_(!0)},[]);x.useEffect(()=>{function oe(ae){const z=ae.target;z&&z.closest(".selection-actions")||ue()}return document.addEventListener("mouseup",oe),()=>document.removeEventListener("mouseup",oe)},[ue]);const Se=x.useCallback(()=>{var ae;const oe=`
515
+ `):null}return null}function gN(t){const s=t.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return s?s[1]:t}function oy({turn:t,formatPrompt:s=gN}){const r=s(t.user_prompt),o=t.items.map(mN).filter(l=>l!==null);return o.length===0&&t.status==="completed"&&t.agent_response&&o.push(t.agent_response),a.jsxs("div",{className:"thread-card-turn",children:[a.jsx("div",{className:"thread-card-user-message",children:r}),o.map((l,u)=>a.jsx("div",{className:"thread-card-ai-response",dangerouslySetInnerHTML:{__html:hN(l)}},u)),o.length===0&&(t.status==="pending"||t.status==="running")&&a.jsx("div",{className:"thread-card-pending",children:t.status==="running"?"AI is responding…":"Waiting…"}),t.status==="failed"&&a.jsx("div",{className:"thread-card-pending",children:t.error||"Turn failed"})]})}function vN({thread:t,threadTurns:s,onStop:r,onResolve:o,onReopen:l,onDelete:u,onFollowup:d,onLocate:p}){var K,be,Z;const[g,m]=x.useState(""),[v,k]=x.useState(!0),y=x.useRef(null),S=x.useRef(null),[T,_]=x.useState(!1),[N,E]=x.useState({x:0,y:0}),[j,W]=x.useState(""),A=s.some(hr),D=28,G=120,V=x.useRef(D);x.useEffect(()=>{const oe=S.current;oe&&(oe.scrollTop=oe.scrollHeight)},[s.length,v]);function $(oe){const ae=y.current;ae&&(ae.style.height=`${oe}px`,V.current=oe)}function te(){const oe=y.current;if(oe){if(oe.scrollHeight>oe.clientHeight){const ae=Math.min(oe.scrollHeight,G);ae!==V.current&&$(ae);return}V.current>D&&(oe.style.height="auto",$(Math.min(oe.scrollHeight,G)))}}const me=x.useCallback(()=>{_(!1)},[]),de=x.useCallback(()=>{const oe=S.current;if(!oe)return;const ae=window.getSelection();if(!ae||ae.rangeCount===0||ae.isCollapsed){_(!1);return}const z=ae.getRangeAt(0);if(!oe.contains(z.commonAncestorContainer)){_(!1);return}const Q=z.commonAncestorContainer.nodeType===Node.TEXT_NODE?z.commonAncestorContainer.parentElement:z.commonAncestorContainer;if(!(Q!=null&&Q.closest(".thread-card-ai-response"))){_(!1);return}const q=ae.toString();if(!q.trim()){_(!1);return}const M=z.getBoundingClientRect(),P=28,le=6,ge=170;let X=!1;if(ae.anchorNode&&ae.focusNode)try{const se=document.createRange();se.setStart(ae.focusNode,ae.focusOffset),se.setEnd(ae.focusNode,ae.focusOffset);const he=document.createRange();he.setStart(ae.anchorNode,ae.anchorOffset),he.setEnd(ae.anchorNode,ae.anchorOffset),X=he.compareBoundaryPoints(Range.START_TO_START,se)>0}catch{X=!1}let pe=M.top-P-le;pe<8&&(pe=M.bottom+le);let Te=X?M.left-ge:M.right;Te=Math.max(8,Math.min(Te,window.innerWidth-ge-8)),E({x:Te,y:pe}),W(q),_(!0)},[]);x.useEffect(()=>{function oe(ae){const z=ae.target;z&&z.closest(".selection-actions")||de()}return document.addEventListener("mouseup",oe),()=>document.removeEventListener("mouseup",oe)},[de]);const je=x.useCallback(()=>{var ae;const oe=`
516
516
  \`\`\`QUOTE
517
- ${R}
517
+ ${j}
518
518
  \`\`\`
519
519
 
520
- `;m(z=>z+oe),_(!1),H(""),(ae=window.getSelection())==null||ae.removeAllRanges(),setTimeout(()=>{if(y.current){te(),y.current.focus();const z=y.current.value.length;y.current.setSelectionRange(z,z)}},0)},[R]);return a.jsxs("div",{className:`thread-card ${t.status==="resolved"?"thread-resolved":""}`,id:`thread-${t.id}`,children:[a.jsxs("div",{className:"thread-card-header",onClick:()=>k(oe=>!oe),children:[a.jsx("div",{className:"thread-card-quote",children:t.selected_text===null?((Z=(we=(q=t.turns)==null?void 0:q[0])==null?void 0:we.user_prompt)==null?void 0:Z.slice(0,100))||"Quick question":`“${t.selected_text.slice(0,100)}${t.selected_text.length>100?"…":""}”`}),a.jsxs("div",{className:"thread-card-header-right",children:[t.selected_text!==null&&a.jsx("button",{className:"thread-locate-btn",onClick:oe=>{oe.stopPropagation(),p()},title:"Scroll to text",children:a.jsx(T1,{size:12})}),a.jsx("span",{className:`thread-status-badge ${t.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:t.status==="open"?"Open":"Resolved"})]})]}),v&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"thread-card-conversation",ref:S,onMouseDown:he,children:[s.map(oe=>a.jsx(ny,{turn:oe},oe.id)),s.length===0&&a.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),T&&a.jsx("div",{className:"selection-actions",style:{left:N.x,top:N.y},children:a.jsxs("button",{className:"discuss-button",onClick:Se,title:"Quote this text in your follow-up",children:[a.jsx(nv,{size:14}),a.jsx("span",{children:"Quote"})]})}),t.status==="open"&&a.jsxs("div",{className:"thread-card-followup",children:[a.jsx("textarea",{ref:y,className:"thread-card-followup-input",placeholder:M?"Agent is running…":"Type a follow-up…",value:g,onChange:oe=>{Mt.markInputChange(),m(oe.target.value),te()},disabled:M,rows:1,style:{minHeight:D,maxHeight:K},onKeyDown:oe=>{Mt.markKeystroke(),oe.key==="Enter"&&(oe.metaKey||oe.ctrlKey)&&!M&&g.trim()&&(oe.preventDefault(),d(g.trim()),m(""),$(D))}}),a.jsx("button",{className:"thread-card-followup-send",disabled:M||!g.trim(),onClick:()=>{d(g.trim()),m("")},children:a.jsx(Lo,{size:13})}),M&&a.jsx("button",{className:"thread-card-followup-stop",onClick:r,title:"Stop this thread's turn (Esc)",children:a.jsx(Fr,{size:13})})]}),a.jsxs("div",{className:"thread-card-actions",children:[t.status==="open"?a.jsxs("button",{className:"thread-action-btn",onClick:o,title:"Resolve thread",children:[a.jsx(ml,{size:13})," Resolve"]}):a.jsxs("button",{className:"thread-action-btn",onClick:l,title:"Reopen thread",children:[a.jsx(_o,{size:13})," Reopen"]}),a.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:u,title:"Delete thread",children:[a.jsx(us,{size:13})," Delete"]})]})]})]})}function fN(){Mt.trackRender("ThreadsPanel");const t=I(C=>C.activeSessionId),s=I(C=>{var R;return C.activeSessionId?((R=C.sessionDetails[C.activeSessionId])==null?void 0:R.threads)??Jm:Jm}),r=x.useMemo(()=>s.filter(C=>!Yd(C)),[s]),o=I(C=>C.followupThread),l=I(C=>C.cancelThreadTurn),u=I(C=>C.reopenThread),d=I(C=>C.deleteThread),p=I(C=>C.deepLinkThreadId),g=I(C=>C.setDeepLinkThreadId),[m,v]=x.useState("open"),[k,y]=x.useState(null);x.useEffect(()=>{if(!p)return;const C=p;g(null),v(H=>r.some(M=>M.id===C&&M.status==="open")?H:"all");const R=setTimeout(()=>{const H=document.getElementById(`thread-${C}`);H&&(H.scrollIntoView({behavior:"smooth",block:"center"}),H.classList.add("thread-card-highlighted"),setTimeout(()=>H.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(R)},[p,g,r]);const S=r.filter(C=>m==="open"?C.status==="open":m==="resolved"?C.status==="resolved":!0),T=r.filter(C=>C.status==="open").length,_=r.filter(C=>C.status==="resolved").length;function N(C){setTimeout(()=>{const R=document.querySelector(`mark[data-thread-id="${C}"]`);R&&(R.scrollIntoView({behavior:"smooth",block:"center"}),R.classList.add("thread-mark-flash"),setTimeout(()=>R.classList.remove("thread-mark-flash"),1500))},50)}return t?r.length===0?a.jsxs("div",{className:"empty-state",children:[a.jsx(tv,{size:24,style:{opacity:.3,marginBottom:8}}),a.jsx("div",{children:"No threads yet."}),a.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"Select text in an agent response to start a discussion."})]}):a.jsxs("div",{children:[a.jsxs("div",{className:"thread-filter-tabs",children:[a.jsxs("button",{className:`thread-filter-tab ${m==="open"?"active":""}`,onClick:()=>v("open"),children:["Open (",T,")"]}),a.jsxs("button",{className:`thread-filter-tab ${m==="resolved"?"active":""}`,onClick:()=>v("resolved"),children:["Resolved (",_,")"]}),a.jsxs("button",{className:`thread-filter-tab ${m==="all"?"active":""}`,onClick:()=>v("all"),children:["All (",r.length,")"]})]}),S.length===0?a.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",m," threads."]}):S.map(C=>a.jsx(dN,{thread:C,threadTurns:C.turns??[],onStop:()=>l(t,C.id),onResolve:()=>y(C),onReopen:()=>u(t,C.id),onDelete:()=>d(t,C.id),onFollowup:R=>o(t,C.id,R),onLocate:()=>N(C.id)},C.id)),k&&a.jsx(aN,{thread:k,onClose:()=>y(null)})]}):a.jsx("div",{className:"empty-state",children:"No session selected"})}function pN(){const t=I(d=>d.apps),s=I(d=>d.activeAppTabId),r=I(d=>d.openAppTab),o=I(d=>d.startAppEdit),l=I(d=>d.toggleAppPin),u=I(d=>d.deleteApp);return t.length===0?a.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No mini apps yet. Add one with the + button in the sidebar Apps section."}):a.jsx("div",{className:"apps-panel",children:t.map(d=>a.jsxs("div",{className:`apps-panel-row${s===d.id?" active":""}`,onClick:()=>r(d.id),title:d.description??void 0,children:[a.jsx(ji,{iconNode:d.iconNode,size:14,className:"sidebar-app-icon"}),a.jsxs("div",{className:"apps-panel-info",children:[a.jsx("span",{className:"apps-panel-title",children:d.title}),d.description&&a.jsx("span",{className:"apps-panel-desc",children:d.description})]}),a.jsx("button",{className:"apps-panel-action",title:"Edit app with the agent",onClick:p=>{p.stopPropagation(),o(d.id)},children:a.jsx(il,{size:12})}),a.jsx("button",{className:`apps-panel-action${d.pinned?" pinned":""}`,title:d.pinned?"Unpin app":"Pin app (sorts first)",onClick:p=>{p.stopPropagation(),l(d.id)},children:a.jsx(vl,{size:12,fill:d.pinned?"currentColor":"none"})}),a.jsx("button",{className:"apps-panel-action apps-panel-danger",title:"Delete app",onClick:p=>{p.stopPropagation(),u(d.id)},children:a.jsx(us,{size:12})})]},d.id))})}const hN=24;function mN(){Mt.trackRender("SidecarPanel");const t=I(C=>C.activeSessionId),s=I(C=>{var R;return C.activeSessionId?(R=C.sessionDetails[C.activeSessionId])==null?void 0:R.runtime_type:void 0}),r=I(C=>{var R;return C.activeSessionId?iN((R=C.sessionDetails[C.activeSessionId])==null?void 0:R.threads):null}),o=I(C=>C.askSidecar),l=I(C=>C.cancelThreadTurn),u=I(C=>C.deleteThread),[d,p]=x.useState(""),[g,m]=x.useState(!1),v=x.useRef(null),k=x.useRef(!0),y=(r==null?void 0:r.turns)??[],S=y[y.length-1],T=y.some(hr);if(x.useEffect(()=>{k.current=!0},[t,y.length]),x.useEffect(()=>{const C=v.current;C&&k.current&&(C.scrollTop=C.scrollHeight)},[t,y.length,S==null?void 0:S.items.length,S==null?void 0:S.status]),!t||!s)return a.jsx("div",{className:"empty-state",children:"No session selected"});if(!rN(s))return a.jsxs("div",{className:"empty-state",children:[a.jsx(mr,{size:24,style:{opacity:.3,marginBottom:8}}),a.jsxs("div",{children:["The sidecar is not available for ",s," sessions yet."]})]});const _=!T&&!g&&d.trim().length>0;async function N(){if(!t||!_)return;m(!0);const C=await o(t,d.trim());m(!1),C&&p("")}return a.jsxs("div",{className:"sidecar-panel",children:[a.jsx("div",{ref:v,className:"sidecar-conversation",onScroll:C=>{const R=C.currentTarget;k.current=R.scrollHeight-R.scrollTop-R.clientHeight<=hN},children:y.length===0?a.jsxs("div",{className:"empty-state",children:[a.jsx(mr,{size:24,style:{opacity:.3,marginBottom:8}}),a.jsx("div",{children:"Ask about this session."}),a.jsx("div",{className:"sidecar-hint",children:"Where does it stand? Is it stuck? When will it finish? What is done and what is left?"})]}):y.map(C=>a.jsx(ny,{turn:C,formatPrompt:oN},C.id))}),a.jsxs("div",{className:"sidecar-footer",children:[a.jsxs("div",{className:"thread-card-followup",children:[a.jsx("textarea",{className:"thread-card-followup-input","aria-label":"Ask the sidecar",placeholder:T?"Sidecar is answering…":"Ask about this session… (⌘/Ctrl+Enter)",value:d,rows:2,disabled:T,onChange:C=>{Mt.markInputChange(),p(C.target.value)},onKeyDown:C=>{Mt.markKeystroke(),C.key==="Enter"&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),N())}}),T&&r?a.jsx("button",{className:"thread-card-followup-stop",title:"Stop the answer","aria-label":"Stop the answer",onClick:()=>l(t,r.id),children:a.jsx(Fr,{size:13})}):a.jsx("button",{className:"thread-card-followup-send",title:"Ask","aria-label":"Ask",disabled:!_,onClick:()=>void N(),children:a.jsx(Lo,{size:13})})]}),r&&a.jsx("div",{className:"thread-card-actions",children:a.jsxs("button",{className:"thread-action-btn thread-action-danger",title:"Clear the sidecar conversation",disabled:T,onClick:()=>u(t,r.id),children:[a.jsx(us,{size:13})," Clear"]})})]})]})}function gN(){var g;Mt.trackRender("RightPanel");const t=I(m=>m.activeRightTab),s=I(m=>m.switchRightTab),r=I(m=>m.rightPanelCollapsed),o=I(m=>m.toggleRightPanel),l=I(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),u=I(m=>m.activeSessionId?qd(m.backgroundTasks[m.activeSessionId]):0),d=((g=l==null?void 0:l.threads)==null?void 0:g.filter(m=>m.status==="open"&&!Yd(m)).length)??0,p=[{id:"turns",label:"Turns",icon:y1},{id:"sidecar",label:"Sidecar",icon:mr},{id:"tasks",label:"Tasks",icon:v1,badge:u||void 0},{id:"threads",label:"Threads",icon:tv,badge:d||void 0},{id:"apps",label:"Apps",icon:ev}];return r?a.jsxs("div",{className:"ide-right collapsed",children:[a.jsx("button",{type:"button",className:"right-icon-btn",title:"Expand panel","aria-label":"Expand panel","aria-expanded":!1,onClick:o,children:a.jsx(j1,{size:15})}),a.jsx("div",{className:"right-rail-divider"}),p.map(m=>{const v=m.icon,k=m.badge?`${m.label} (${m.badge})`:m.label;return a.jsxs("button",{type:"button",className:`right-icon-btn right-rail-tab ${t===m.id?"active":""}`,title:k,"aria-label":k,onClick:()=>s(m.id),children:[a.jsx(v,{size:15}),m.badge?a.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id)})]}):a.jsxs("div",{className:"ide-right",children:[a.jsxs("div",{className:"right-header",children:[a.jsx("div",{className:"right-tabs",children:p.map(m=>a.jsxs("div",{className:`right-tab ${t===m.id?"active":""}`,onClick:()=>s(m.id),children:[m.label,m.badge?a.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id))}),a.jsx("button",{type:"button",className:"right-icon-btn right-collapse-btn",title:"Collapse panel","aria-label":"Collapse panel","aria-expanded":!0,onClick:o,children:a.jsx(N1,{size:14})})]}),a.jsxs("div",{className:"right-content",children:[t==="turns"&&a.jsx(XT,{}),t==="sidecar"&&a.jsx(mN,{}),t==="tasks"&&a.jsx(tN,{}),t==="threads"&&a.jsx(fN,{}),t==="apps"&&a.jsx(pN,{})]})]})}const Re={low:{effort:"low",label:"Low"},medium:{effort:"medium",label:"Medium"},high:{effort:"high",label:"High"},xhigh:{effort:"xhigh",label:"Extra High"},max:{effort:"max",label:"Max"},ultra:{effort:"ultra",label:"Ultra"}},ud=[{id:"codex",label:"Codex",available:!0,models:[{slug:"gpt-5.6-sol",displayName:"GPT-5.6-Sol",description:"Flagship — complex, open-ended work",defaultReasoning:"low",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max,Re.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max,Re.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh]}]},{id:"claude",label:"Claude",available:!0,models:[{slug:"claude-sonnet-5-5",displayName:"Claude Sonnet 5.5",description:"Best combination of speed and intelligence",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high]}]}];function vN(t){return ud.find(s=>s.id===t)}function Xd(t){const s=vN(t);return(s==null?void 0:s.models)??[]}function sy(t,s){return Xd(t).find(r=>r.slug===s)}function dd(t,s){var r;return((r=sy(t,s))==null?void 0:r.reasoningLevels)??[]}function fd(t,s){var r;return(r=sy(t,s))==null?void 0:r.defaultReasoning}function yN(){const{activeSessionId:t,sessions:s,updateModelConfig:r}=I(),o=I(Z=>Z.showModelSelector),l=I(Z=>Z.setShowModelSelector),u=s.find(Z=>Z.id===t),d=I(Z=>Z.models),p=I(Z=>Z.modelsLoading),g=I(Z=>Z.loadModels),[m,v]=x.useState(!1),k=x.useRef(null);if(Do(k,()=>v(!1),m),Ni(()=>v(!1),m),x.useEffect(()=>{o&&(v(!0),l(!1))},[o,l]),x.useEffect(()=>{u!=null&&u.runtime_type&&g(u.runtime_type,u.cwd??void 0)},[u==null?void 0:u.runtime_type,u==null?void 0:u.cwd,g]),!u)return null;const y=u.runtime_type,S=u.model??"",T=u.model_reasoning_effort??"",_=d.length>0?d:[],N=Xd(y),R=[..._.length>0?_:N];if(S&&!R.some(Z=>Z.slug===S)){const Z=N[0];R.unshift({slug:S,displayName:S,description:"Custom model",defaultReasoning:(Z==null?void 0:Z.defaultReasoning)??"medium",reasoningLevels:(Z==null?void 0:Z.reasoningLevels)??[]})}function H(Z){return R.find(oe=>oe.slug===Z)}function M(Z){var oe;return _.length>0?((oe=H(Z))==null?void 0:oe.reasoningLevels)??[]:dd(y,Z)}function D(Z){var oe;return _.length>0?(oe=H(Z))==null?void 0:oe.defaultReasoning:fd(y,Z)}const K=ud.find(Z=>Z.id===y),G=H(S),$=S?M(S):[],te=(K==null?void 0:K.label)??y,he=(G==null?void 0:G.displayName)??(S||"Default"),ue=$.find(Z=>Z.effort===T),Se=(ue==null?void 0:ue.label)??(T||"Default");function q(Z){var Q;const oe=M(Z),z=oe.some(B=>B.effort===T)?T:D(Z)??((Q=oe[0])==null?void 0:Q.effort)??"";r(Z,z),v(!1)}function we(Z){r(S,Z),v(!1)}return a.jsxs("div",{className:"model-selector",ref:k,children:[a.jsxs("button",{className:"model-selector-btn",onClick:()=>v(!m),title:"Change model and thinking level",children:[a.jsx("span",{className:"model-selector-provider",children:te}),a.jsx("span",{className:"model-selector-sep",children:"›"}),a.jsx("span",{className:"model-selector-model",children:he}),Se!=="Default"&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"model-selector-sep",children:"›"}),a.jsx("span",{className:"model-selector-reasoning",children:Se})]}),a.jsx(Si,{size:12,className:"model-selector-chevron"})]}),m&&a.jsxs("div",{className:"model-selector-popover",children:[a.jsxs("div",{className:"model-selector-column",children:[a.jsx("div",{className:"model-selector-col-header",children:"Provider"}),ud.map(Z=>a.jsxs("div",{className:`model-selector-item ${Z.id===y?"selected":""} ${Z.available?"":"disabled"}`,onClick:()=>{if(Z.available){if(Z.id===y){v(!1);return}r("","",Z.id)}},children:[a.jsx("span",{children:Z.label}),!Z.available&&a.jsxs("span",{className:"model-selector-coming-soon",children:[a.jsx(k1,{size:10})," Soon"]}),Z.id===y&&a.jsx(Ts,{size:12})]},Z.id))]}),a.jsxs("div",{className:"model-selector-column",children:[a.jsx("div",{className:"model-selector-col-header",children:"Model"}),p&&a.jsx("div",{className:"model-selector-empty",children:"Loading models…"}),!p&&R.length===0&&a.jsx("div",{className:"model-selector-empty",children:"No models available"}),R.map(Z=>a.jsxs("div",{className:`model-selector-item ${Z.slug===S?"selected":""}`,onClick:()=>q(Z.slug),children:[a.jsxs("div",{className:"model-selector-item-main",children:[a.jsx("span",{className:"model-selector-item-name",children:Z.displayName}),a.jsx("span",{className:"model-selector-item-desc",children:Z.description})]}),Z.slug===S&&a.jsx(Ts,{size:12})]},Z.slug))]}),a.jsxs("div",{className:"model-selector-column",children:[a.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),$.length===0&&a.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),$.map(Z=>a.jsxs("div",{className:`model-selector-item ${Z.effort===T?"selected":""}`,onClick:()=>we(Z.effort),children:[a.jsx("span",{children:Z.label}),Z.effort===T&&a.jsx(Ts,{size:12})]},Z.effort))]})]})]})}function mo(t){return t>=1e6?`${(t/1e6).toFixed(t%1e6===0?0:1)}M`:t>=1e3?`${Math.round(t/1e3)}K`:String(t)}function eg(){const t=I(r=>r.canGoBack),s=I(r=>r.canGoForward);return a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"sb-item sb-btn",title:"Back","aria-label":"Back",disabled:!t,onClick:()=>window.history.back(),children:a.jsx(t1,{size:14})}),a.jsx("button",{className:"sb-item sb-btn",title:"Forward","aria-label":"Forward",disabled:!s,onClick:()=>window.history.forward(),children:a.jsx(n1,{size:14})})]})}function tg(){const t=I(s=>s.setShowRemoteModal);return a.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>t(!0),children:[a.jsx(z1,{size:14})," Repoburg"]})}function ng(){const t=I(r=>r.usageViewOpen),s=I(r=>r.toggleUsageView);return a.jsxs("button",{className:`sb-item sb-btn${t?" sb-item-active":""}`,title:t?"Back to the agent view":"Usage Center",onClick:s,children:[a.jsx(Qg,{size:14})," Usage"]})}function sg(){const t=I(r=>r.vscodeViewOpen),s=I(r=>r.toggleVscodeView);return a.jsxs("button",{className:`sb-item sb-btn${t?" sb-item-active":""}`,title:t?"Back to the agent view":"Open VS Code",onClick:s,children:[a.jsx(l1,{size:14})," Code"]})}function rg(){const t=I(r=>r.terminalViewOpen),s=I(r=>r.toggleTerminalView);return a.jsxs("button",{className:`sb-item sb-btn${t?" sb-item-active":""}`,title:t?"Back to the agent view":"Open a terminal",onClick:s,children:[a.jsx(iv,{size:14})," Terminal"]})}function xN(){Mt.trackRender("StatusBar");const t=I(v=>v.activeSessionId),s=I(v=>t?v.sessions.find(k=>k.id===t)??null:null),r=I(v=>t?v.sessionDetails[t]??null:null),o=I(v=>t?v.backgroundTasks[t]:void 0),l=I(v=>v.wsConnected),u=I(v=>v.switchRightTab),d=(r==null?void 0:r.contextUsage)??null;if(!s)return a.jsxs("div",{className:"ide-statusbar",children:[a.jsx(eg,{}),a.jsx(tg,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(sg,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(rg,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(ng,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx("div",{className:"sb-item",title:l?"WebSocket connected":"WebSocket disconnected",children:l?"Live":"Offline"}),a.jsx("div",{className:"sb-spacer"}),a.jsxs("div",{className:"sb-item",children:[a.jsx(em,{size:14})," K"]})]});const p=o??[],g=Dl(s,p.length),m=qd(p);return a.jsxs("div",{className:"ide-statusbar",children:[a.jsx(eg,{}),a.jsx(tg,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(sg,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(rg,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(ng,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(yN,{}),m>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"sb-divider",children:"|"}),a.jsxs("div",{className:"sb-item",style:{color:"var(--amber)",cursor:"pointer"},title:`${m} Monitor task${m>1?"s":""} running — click to view`,onClick:()=>u("tasks"),children:[a.jsx(ov,{size:14})," ",m]})]}),a.jsx("div",{className:"sb-spacer"}),a.jsx("div",{className:"sb-item",title:l?"WebSocket connected":"WebSocket disconnected",children:l?"Live":"Offline"}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx("div",{className:"sb-item",style:g.dot==="background"?{color:"var(--purple)"}:s.status==="failed"?{color:"var(--red)"}:void 0,title:g.dot==="background"?g.dotTitle:void 0,children:g.label}),d&&a.jsx(wN,{usage:d}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsxs("div",{className:"sb-item",children:[a.jsx(em,{size:14})," K"]})]})}function wN({usage:t}){const s=t.percentage>=85?"var(--red)":t.percentage>=60?"var(--amber)":"var(--green)",r=`${mo(t.totalTokens)} / ${mo(t.contextWindow)} tokens`+(t.autoCompactThreshold?` · auto-compacts at ${mo(t.autoCompactThreshold)}`:"");return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx("div",{className:"sb-context",title:r,children:a.jsxs("span",{className:"sb-context-text",style:{color:s},children:[Math.round(t.percentage),"% / ",mo(t.totalTokens)," / ",mo(t.contextWindow)]})})]})}function ig(t){return Wt(`/vscode-web/status?folder=${encodeURIComponent(t??"")}`)}function kN(t){return ct("/vscode-web/start",{folder:t})}function SN(t){return ct("/vscode-web/heartbeat",{id:t})}const bN=1e3,TN=5*6e4;function og({children:t}){const s=I(r=>r.toggleVscodeView);return a.jsxs("div",{className:"vscode-view vscode-view--loading",children:[t,a.jsx("button",{className:"dialog-close vscode-view-close",title:"Close VS Code view","aria-label":"Close VS Code view",onClick:s,children:a.jsx(Tn,{size:16})})]})}function NN(){const t=I(T=>T.vscodeState),s=I(T=>T.vscodeId),r=I(T=>T.vscodeToken),o=I(T=>T.setVscodeView),l=I(T=>{var N;const _=T.activeSessionId?T.sessions.find(C=>C.id===T.activeSessionId):null;return _!=null&&_.cwd?_.cwd:((N=T.workspaces.find(C=>C.deleted===0))==null?void 0:N.path)??null}),[u,d]=x.useState(!1),[p,g]=x.useState(0),m=x.useRef(null),v=mn(),k=v===""||v===window.location.origin,y=`${v}/vscode/${s??""}/?tkn=${r??""}${l?`&folder=${encodeURIComponent(l)}`:""}`;x.useEffect(()=>{let T=!1;function _(){m.current&&(clearInterval(m.current),m.current=null)}async function N(){try{let R=await ig(l);if((R.state==="stopped"||R.state==="error")&&(R=await kN(l)),T||(o(R.state,R.id,R.token),R.state==="running"||R.state==="error"))return;m.current=setInterval(async()=>{const H=await ig(l);T||(o(H.state,H.id,H.token),(H.state==="running"||H.state==="error"||H.state==="stopped")&&_())},bN)}catch{T||o("error",null,null)}}N();const C=setInterval(()=>{const R=I.getState().vscodeId;R&&SN(R).catch(()=>{})},TN);return()=>{T=!0,_(),clearInterval(C)}},[p,l,o]);function S(){d(!1),o("starting",null,null),g(T=>T+1)}return t!=="running"||!r||!s?a.jsx(og,{children:t==="error"?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"VS Code could not start."}),a.jsxs("button",{className:"dialog-btn-cancel",onClick:S,children:[a.jsx(_o,{size:14})," Retry"]})]}):a.jsxs("span",{className:"vscode-view-hint",children:[a.jsx(hn,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):k?a.jsxs("div",{className:"vscode-view",children:[!u&&a.jsxs("div",{className:"vscode-view-overlay",children:[a.jsx(hn,{size:16,className:"spin"})," Loading VS Code…"]}),a.jsx("iframe",{src:y,title:"VS Code",className:"vscode-view-frame",onLoad:()=>d(!0)},s)]}):a.jsxs(og,{children:[a.jsx("span",{children:"VS Code cannot be embedded on this host — serve-web allows same-origin frames only."}),a.jsxs("button",{className:"dialog-btn-cancel",onClick:()=>window.open(y,"_blank","noopener"),children:[a.jsx(u1,{size:14})," Open VS Code in a new tab"]})]})}function ag(t,s){const r=new URLSearchParams;t&&r.set("since",t),s&&r.set("until",s);const o=r.toString();return Wt(`/usage/summary${o?`?${o}`:""}`)}const ry="agentpane:usage-budget";function cs(t){return t>=1e6?`${(t/1e6).toFixed(t%1e6===0?0:1)}M`:t>=1e3?`${Math.round(t/1e3)}K`:String(t)}function Or(t){return`$${t>=100?t.toFixed(0):t>=1?t.toFixed(2):t.toFixed(4).replace(/0+$/,"").replace(/\.$/,"")}`}function jN(t,s=new Date){if(t==="all")return{since:null,until:null};const r=new Date(s);return t==="today"?r.setHours(0,0,0,0):r.setDate(r.getDate()-(t==="7d"?7:30)),{since:r.toISOString(),until:null}}function CN(t=new Date){return new Date(t.getFullYear(),t.getMonth(),1).toISOString()}function EN(){try{const t=Number(localStorage.getItem(ry));return Number.isFinite(t)&&t>0?t:0}catch{return 0}}function _N(t){try{localStorage.setItem(ry,String(t))}catch{}}const RN={claude:"Claude",codex:"Codex",repoburg:"Repoburg"};function tl({label:t,value:s,sub:r,tone:o}){return a.jsxs("div",{className:"usage-kpi",children:[a.jsx("div",{className:"usage-kpi-label",children:t}),a.jsx("div",{className:"usage-kpi-value",style:o?{color:o}:void 0,children:s}),r&&a.jsx("div",{className:"usage-kpi-sub",children:r})]})}function AN({day:t,max:s}){const r=o=>s>0?o/s*100:0;return a.jsxs("div",{className:"usage-day",title:`${t.date} · ${cs(t.input_tokens)} input · ${cs(t.cached_input_tokens)} cached · ${cs(t.output_tokens)} output · ${Or(t.cost_usd)}`,children:[a.jsxs("div",{className:"usage-day-bar",children:[a.jsx("div",{className:"usage-seg usage-seg-output",style:{height:`${r(t.output_tokens)}%`}}),a.jsx("div",{className:"usage-seg usage-seg-cached",style:{height:`${r(t.cached_input_tokens+t.cache_write_input_tokens)}%`}}),a.jsx("div",{className:"usage-seg usage-seg-input",style:{height:`${r(t.input_tokens)}%`}})]}),a.jsx("div",{className:"usage-day-label",children:t.date.slice(5)})]})}function IN(){const t=I(R=>R.toggleUsageView),[s,r]=x.useState("30d"),[o,l]=x.useState(null),[u,d]=x.useState(null),[p,g]=x.useState(EN),[m,v]=x.useState(null),[k,y]=x.useState(!1),S=x.useCallback(async()=>{y(!0),v(null);try{const{since:R,until:H}=jN(s),[M,D]=await Promise.all([ag(R,H),ag(CN(),null)]);l(M),d(D.totals.cost_usd)}catch(R){v(R.message)}finally{y(!1)}},[s]);x.useEffect(()=>{S()},[S]);const T=o==null?void 0:o.totals,_=p>0&&u!==null?p-u:null,N=x.useMemo(()=>Math.max(0,...((o==null?void 0:o.daily)??[]).map(R=>R.input_tokens+R.cached_input_tokens+R.output_tokens)),[o]),C=R=>{const H=Number(R.replace(",",".")),M=Number.isFinite(H)&&H>0?H:0;g(M),_N(M)};return a.jsxs("div",{className:"usage-view",children:[a.jsxs("div",{className:"usage-header",children:[a.jsxs("div",{className:"usage-title",children:[a.jsx(Qg,{size:18})," Usage Center"]}),a.jsxs("div",{className:"usage-controls",children:[["today","7d","30d","all"].map(R=>a.jsx("button",{className:`usage-range-btn${s===R?" usage-range-btn-active":""}`,onClick:()=>r(R),children:R==="today"?"Today":R==="7d"?"7 days":R==="30d"?"30 days":"All"},R)),a.jsx("button",{className:"usage-range-btn",onClick:()=>void S(),title:"Refresh",children:a.jsx(A1,{size:13,className:k?"spin":void 0})}),a.jsx("button",{className:"dialog-close",title:"Close usage view","aria-label":"Close usage view",onClick:t,children:a.jsx(Tn,{size:16})})]})]}),m&&a.jsxs("div",{className:"usage-error",children:["Could not load usage data: ",m]}),!o&&!m&&a.jsx("div",{className:"usage-empty",children:"Loading…"}),o&&T&&a.jsxs("div",{className:"usage-body",children:[a.jsxs("div",{className:"usage-kpis",children:[a.jsx(tl,{label:"Spend",value:Or(T.cost_usd),sub:T.unpriced_models.length>0?"excluding unpriced models":void 0}),a.jsx(tl,{label:"Remaining (monthly)",value:_===null?"—":_>=0?Or(_):Or(0),sub:p>0&&u!==null?`this month ${Or(u)} / budget ${Or(p)}`:"no budget set",tone:_!==null&&_<0?"var(--red)":void 0}),a.jsx(tl,{label:"Tokens",value:cs(T.input_tokens+T.cached_input_tokens+T.cache_write_input_tokens+T.output_tokens),sub:`input ${cs(T.input_tokens)} · cached ${cs(T.cached_input_tokens)} · write ${cs(T.cache_write_input_tokens)} · output ${cs(T.output_tokens)}`}),a.jsx(tl,{label:"Calls",value:String(T.calls),sub:T.errors>0?`${T.errors} failed`:void 0,tone:T.errors>0?"var(--amber)":void 0})]}),a.jsxs("div",{className:"usage-budget",children:[a.jsx("label",{htmlFor:"usage-budget-input",children:"Monthly budget (USD)"}),a.jsx("input",{id:"usage-budget-input",type:"number",min:"0",step:"1",defaultValue:p>0?p:"",placeholder:"e.g. 50",onBlur:R=>C(R.target.value)}),p>0&&u!==null&&a.jsx("div",{className:"usage-budget-bar",children:a.jsx("div",{className:"usage-budget-fill",style:{width:`${Math.min(100,u/p*100)}%`,background:u>=p?"var(--red)":void 0}})})]}),T.unpriced_models.length>0&&a.jsxs("div",{className:"usage-note",children:["Unpriced models: ",T.unpriced_models.join(", ")]}),a.jsxs("div",{className:"usage-chart",children:[a.jsx("div",{className:"usage-section-title",children:"Daily usage"}),o.daily.length===0?a.jsx("div",{className:"usage-empty",children:"No usage in this range."}):a.jsx("div",{className:"usage-days",children:o.daily.map(R=>a.jsx(AN,{day:R,max:N},R.date))}),a.jsxs("div",{className:"usage-legend",children:[a.jsxs("span",{children:[a.jsx("span",{className:"usage-dot usage-seg-input"})," input"]}),a.jsxs("span",{children:[a.jsx("span",{className:"usage-dot usage-seg-cached"})," cached"]}),a.jsxs("span",{children:[a.jsx("span",{className:"usage-dot usage-seg-output"})," output"]})]})]}),a.jsxs("div",{className:"usage-table-wrap",children:[a.jsx("div",{className:"usage-section-title",children:"By model"}),a.jsxs("table",{className:"usage-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Runtime"}),a.jsx("th",{children:"Provider"}),a.jsx("th",{children:"Model"}),a.jsx("th",{children:"Effort"}),a.jsx("th",{children:"Calls"}),a.jsx("th",{children:"Input"}),a.jsx("th",{children:"Cached"}),a.jsx("th",{children:"Output"}),a.jsx("th",{children:"Cost"})]})}),a.jsxs("tbody",{children:[o.by_model.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:9,className:"usage-empty",children:"No usage records yet."})}),o.by_model.map(R=>a.jsxs("tr",{children:[a.jsx("td",{children:RN[R.runtime_type]??R.runtime_type}),a.jsx("td",{children:R.provider??"—"}),a.jsx("td",{title:R.model,children:R.model}),a.jsx("td",{children:R.reasoning_effort??"default"}),a.jsxs("td",{children:[R.calls,R.errors>0&&a.jsxs("span",{className:"usage-err",children:[" (",R.errors," failed)"]})]}),a.jsx("td",{children:cs(R.input_tokens)}),a.jsx("td",{children:cs(R.cached_input_tokens+R.cache_write_input_tokens)}),a.jsx("td",{children:cs(R.output_tokens)}),a.jsx("td",{children:R.cost_usd===null?a.jsx("span",{className:"usage-unpriced",children:"unknown"}):Or(R.cost_usd)})]},`${R.runtime_type}|${R.provider??""}|${R.model}|${R.reasoning_effort??""}`))]})]})]})]})]})}const lg="claude auth login";function MN(){const t=I(p=>Object.keys(p.signedOutTurns).length),s=I(p=>p.terminalViewOpen),r=I(p=>p.toggleTerminalView),o=I(p=>p.addToast),[l,u]=x.useState(!1);if(t===0)return null;const d=()=>{u(!0),y0().catch(p=>o("error",`Could not resume the turns — ${Pr(p)}`)).finally(()=>u(!1))};return a.jsxs("div",{className:"signed-out-band",role:"status",children:[a.jsx("span",{className:"banner-icon",children:a.jsx(m1,{size:12})}),a.jsxs("span",{className:"banner-text",children:["Claude is signed out — ",t===1?"1 turn is":`${t} turns are`," waiting. Run"," ",a.jsx("code",{children:lg})," in a terminal, then resume."]}),a.jsxs("button",{type:"button",className:"banner-action",onClick:()=>void Io(lg),children:[a.jsx(Eo,{size:12}),"Copy"]}),!s&&a.jsxs("button",{type:"button",className:"banner-action",onClick:r,children:[a.jsx(iv,{size:12}),"Open terminal"]}),a.jsxs("button",{type:"button",className:"banner-action",onClick:d,disabled:l,children:[a.jsx(sv,{size:12}),t===1?"Resume turn":"Resume turns"]})]})}const cg=/^[a-f0-9]{64}\.(?:png|jpg|gif|webp)$/,DN=/^(?:https?:\/\/[^/?#]+)?\/api\/apps\/([^/?#]+)\/files\/([^/?#]+)$/i,LN={png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function iy(){return mn()||window.location.origin}function oy(t,s){let r=s;if(r&&typeof r=="object"){const d=r;r=typeof d.id=="string"?d.id:d.url}if(typeof r!="string")return null;const o=r.trim();if(cg.test(o))return o;const l=DN.exec(o);if(!l)return null;let u;try{u=decodeURIComponent(l[1])}catch{return null}return u===t&&cg.test(l[2])?l[2]:null}function ug(t){return/^https?:\/\//i.test(t.url)?t:{...t,url:`${iy()}${t.url}`}}function ON(t){return LN[t.slice(t.lastIndexOf(".")+1)]??"application/octet-stream"}function ay(t){return new Promise((s,r)=>{const o=new FileReader;o.onload=()=>{const l=String(o.result??"");s(l.slice(l.indexOf(",")+1))},o.onerror=()=>r(o.error??new Error("Could not read the file")),o.readAsDataURL(t)})}function PN(t,s){const r=/^data:([^;,]*)(?:;[^;,]*)*;base64,/i.exec(t);return r?{type:s||r[1]||void 0,data:t.slice(r[0].length)}:{type:s,data:t}}async function ly(t){if(t instanceof Blob){const s=t.name;return{name:typeof s=="string"&&s?s:void 0,type:t.type||void 0,data:await ay(t)}}if(t&&typeof t=="object"&&typeof t.data=="string"){const s=t;return{name:typeof s.name=="string"&&s.name?s.name:void 0,type:typeof s.type=="string"&&s.type?s.type:void 0,data:s.data}}return null}async function $N(t){const s=await ly(t);if(!s)throw new Error("uploadFile: expected a Blob/File or { name, type, data }");return s}async function zN(t,s,r){if(s==null)return[];if(!Array.isArray(s))throw new Error("submitTurn: attachments must be an array");const o=[];for(let l=0;l<s.length;l++){const u=s[l],d=await ly(u);if(d){const{type:m,data:v}=PN(d.data,d.type);if(!m)throw new Error(`submitTurn: attachment ${l+1} has no type`);o.push({name:d.name??`attachment-${l+1}`,media_type:m,data:v});continue}const p=oy(t,u);if(!p)throw new Error(`submitTurn: attachment ${l+1} is not a file of this app`);const g=await r(p);o.push({name:p,media_type:ON(p),data:await ay(g)})}return o}const FN=`function (config) {
520
+ `;m(z=>z+oe),_(!1),W(""),(ae=window.getSelection())==null||ae.removeAllRanges(),setTimeout(()=>{if(y.current){te(),y.current.focus();const z=y.current.value.length;y.current.setSelectionRange(z,z)}},0)},[j]);return a.jsxs("div",{className:`thread-card ${t.status==="resolved"?"thread-resolved":""}`,id:`thread-${t.id}`,children:[a.jsxs("div",{className:"thread-card-header",onClick:()=>k(oe=>!oe),children:[a.jsx("div",{className:"thread-card-quote",children:t.selected_text===null?((Z=(be=(K=t.turns)==null?void 0:K[0])==null?void 0:be.user_prompt)==null?void 0:Z.slice(0,100))||"Quick question":`“${t.selected_text.slice(0,100)}${t.selected_text.length>100?"…":""}”`}),a.jsxs("div",{className:"thread-card-header-right",children:[t.selected_text!==null&&a.jsx("button",{className:"thread-locate-btn",onClick:oe=>{oe.stopPropagation(),p()},title:"Scroll to text",children:a.jsx(A1,{size:12})}),a.jsx("span",{className:`thread-status-badge ${t.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:t.status==="open"?"Open":"Resolved"})]})]}),v&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"thread-card-conversation",ref:S,onMouseDown:me,children:[s.map(oe=>a.jsx(oy,{turn:oe},oe.id)),s.length===0&&a.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),T&&a.jsx("div",{className:"selection-actions",style:{left:N.x,top:N.y},children:a.jsxs("button",{className:"discuss-button",onClick:je,title:"Quote this text in your follow-up",children:[a.jsx(iv,{size:14}),a.jsx("span",{children:"Quote"})]})}),t.status==="open"&&a.jsxs("div",{className:"thread-card-followup",children:[a.jsx("textarea",{ref:y,className:"thread-card-followup-input",placeholder:A?"Agent is running…":"Type a follow-up…",value:g,onChange:oe=>{Mt.markInputChange(),m(oe.target.value),te()},disabled:A,rows:1,style:{minHeight:D,maxHeight:G},onKeyDown:oe=>{Mt.markKeystroke(),oe.key==="Enter"&&(oe.metaKey||oe.ctrlKey)&&!A&&g.trim()&&(oe.preventDefault(),d(g.trim()),m(""),$(D))}}),a.jsx("button",{className:"thread-card-followup-send",disabled:A||!g.trim(),onClick:()=>{d(g.trim()),m("")},children:a.jsx(Lo,{size:13})}),A&&a.jsx("button",{className:"thread-card-followup-stop",onClick:r,title:"Stop this thread's turn (Esc)",children:a.jsx(Fr,{size:13})})]}),a.jsxs("div",{className:"thread-card-actions",children:[t.status==="open"?a.jsxs("button",{className:"thread-action-btn",onClick:o,title:"Resolve thread",children:[a.jsx(vl,{size:13})," Resolve"]}):a.jsxs("button",{className:"thread-action-btn",onClick:l,title:"Reopen thread",children:[a.jsx(_o,{size:13})," Reopen"]}),a.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:u,title:"Delete thread",children:[a.jsx(us,{size:13})," Delete"]})]})]})]})}function yN(){Mt.trackRender("ThreadsPanel");const t=I(E=>E.activeSessionId),s=I(E=>{var j;return E.activeSessionId?((j=E.sessionDetails[E.activeSessionId])==null?void 0:j.threads)??eg:eg}),r=x.useMemo(()=>s.filter(E=>!Xd(E)),[s]),o=I(E=>E.followupThread),l=I(E=>E.cancelThreadTurn),u=I(E=>E.reopenThread),d=I(E=>E.deleteThread),p=I(E=>E.deepLinkThreadId),g=I(E=>E.setDeepLinkThreadId),[m,v]=x.useState("open"),[k,y]=x.useState(null);x.useEffect(()=>{if(!p)return;const E=p;g(null),v(W=>r.some(A=>A.id===E&&A.status==="open")?W:"all");const j=setTimeout(()=>{const W=document.getElementById(`thread-${E}`);W&&(W.scrollIntoView({behavior:"smooth",block:"center"}),W.classList.add("thread-card-highlighted"),setTimeout(()=>W.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(j)},[p,g,r]);const S=r.filter(E=>m==="open"?E.status==="open":m==="resolved"?E.status==="resolved":!0),T=r.filter(E=>E.status==="open").length,_=r.filter(E=>E.status==="resolved").length;function N(E){setTimeout(()=>{const j=document.querySelector(`mark[data-thread-id="${E}"]`);j&&(j.scrollIntoView({behavior:"smooth",block:"center"}),j.classList.add("thread-mark-flash"),setTimeout(()=>j.classList.remove("thread-mark-flash"),1500))},50)}return t?r.length===0?a.jsxs("div",{className:"empty-state",children:[a.jsx(rv,{size:24,style:{opacity:.3,marginBottom:8}}),a.jsx("div",{children:"No threads yet."}),a.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"Select text in an agent response to start a discussion."})]}):a.jsxs("div",{children:[a.jsxs("div",{className:"thread-filter-tabs",children:[a.jsxs("button",{className:`thread-filter-tab ${m==="open"?"active":""}`,onClick:()=>v("open"),children:["Open (",T,")"]}),a.jsxs("button",{className:`thread-filter-tab ${m==="resolved"?"active":""}`,onClick:()=>v("resolved"),children:["Resolved (",_,")"]}),a.jsxs("button",{className:`thread-filter-tab ${m==="all"?"active":""}`,onClick:()=>v("all"),children:["All (",r.length,")"]})]}),S.length===0?a.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",m," threads."]}):S.map(E=>a.jsx(vN,{thread:E,threadTurns:E.turns??[],onStop:()=>l(t,E.id),onResolve:()=>y(E),onReopen:()=>u(t,E.id),onDelete:()=>d(t,E.id),onFollowup:j=>o(t,E.id,j),onLocate:()=>N(E.id)},E.id)),k&&a.jsx(pN,{thread:k,onClose:()=>y(null)})]}):a.jsx("div",{className:"empty-state",children:"No session selected"})}function xN(){const t=I(d=>d.apps),s=I(d=>d.activeAppTabId),r=I(d=>d.openAppTab),o=I(d=>d.startAppEdit),l=I(d=>d.toggleAppPin),u=I(d=>d.deleteApp);return t.length===0?a.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No mini apps yet. Add one with the + button in the sidebar Apps section."}):a.jsx("div",{className:"apps-panel",children:t.map(d=>a.jsxs("div",{className:`apps-panel-row${s===d.id?" active":""}`,onClick:()=>r(d.id),title:d.description??void 0,children:[a.jsx(ji,{iconNode:d.iconNode,size:14,className:"sidebar-app-icon"}),a.jsxs("div",{className:"apps-panel-info",children:[a.jsx("span",{className:"apps-panel-title",children:d.title}),d.description&&a.jsx("span",{className:"apps-panel-desc",children:d.description})]}),a.jsx("button",{className:"apps-panel-action",title:"Edit app with the agent",onClick:p=>{p.stopPropagation(),o(d.id)},children:a.jsx(ol,{size:12})}),a.jsx("button",{className:`apps-panel-action${d.pinned?" pinned":""}`,title:d.pinned?"Unpin app":"Pin app (sorts first)",onClick:p=>{p.stopPropagation(),l(d.id)},children:a.jsx(xl,{size:12,fill:d.pinned?"currentColor":"none"})}),a.jsx("button",{className:"apps-panel-action apps-panel-danger",title:"Delete app",onClick:p=>{p.stopPropagation(),u(d.id)},children:a.jsx(us,{size:12})})]},d.id))})}const wN=24;function kN(){Mt.trackRender("SidecarPanel");const t=I(E=>E.activeSessionId),s=I(E=>{var j;return E.activeSessionId?(j=E.sessionDetails[E.activeSessionId])==null?void 0:j.runtime_type:void 0}),r=I(E=>{var j;return E.activeSessionId?dN((j=E.sessionDetails[E.activeSessionId])==null?void 0:j.threads):null}),o=I(E=>E.askSidecar),l=I(E=>E.cancelThreadTurn),u=I(E=>E.deleteThread),[d,p]=x.useState(""),[g,m]=x.useState(!1),v=x.useRef(null),k=x.useRef(!0),y=(r==null?void 0:r.turns)??[],S=y[y.length-1],T=y.some(hr);if(x.useEffect(()=>{k.current=!0},[t,y.length]),x.useEffect(()=>{const E=v.current;E&&k.current&&(E.scrollTop=E.scrollHeight)},[t,y.length,S==null?void 0:S.items.length,S==null?void 0:S.status]),!t||!s)return a.jsx("div",{className:"empty-state",children:"No session selected"});if(!uN(s))return a.jsxs("div",{className:"empty-state",children:[a.jsx(mr,{size:24,style:{opacity:.3,marginBottom:8}}),a.jsxs("div",{children:["The sidecar is not available for ",s," sessions yet."]})]});const _=!T&&!g&&d.trim().length>0;async function N(){if(!t||!_)return;m(!0);const E=await o(t,d.trim());m(!1),E&&p("")}return a.jsxs("div",{className:"sidecar-panel",children:[a.jsx("div",{ref:v,className:"sidecar-conversation",onScroll:E=>{const j=E.currentTarget;k.current=j.scrollHeight-j.scrollTop-j.clientHeight<=wN},children:y.length===0?a.jsxs("div",{className:"empty-state",children:[a.jsx(mr,{size:24,style:{opacity:.3,marginBottom:8}}),a.jsx("div",{children:"Ask about this session."}),a.jsx("div",{className:"sidecar-hint",children:"Where does it stand? Is it stuck? When will it finish? What is done and what is left?"})]}):y.map(E=>a.jsx(oy,{turn:E,formatPrompt:fN},E.id))}),a.jsxs("div",{className:"sidecar-footer",children:[a.jsxs("div",{className:"thread-card-followup",children:[a.jsx("textarea",{className:"thread-card-followup-input","aria-label":"Ask the sidecar",placeholder:T?"Sidecar is answering…":"Ask about this session… (⌘/Ctrl+Enter)",value:d,rows:2,disabled:T,onChange:E=>{Mt.markInputChange(),p(E.target.value)},onKeyDown:E=>{Mt.markKeystroke(),E.key==="Enter"&&(E.metaKey||E.ctrlKey)&&(E.preventDefault(),N())}}),T&&r?a.jsx("button",{className:"thread-card-followup-stop",title:"Stop the answer","aria-label":"Stop the answer",onClick:()=>l(t,r.id),children:a.jsx(Fr,{size:13})}):a.jsx("button",{className:"thread-card-followup-send",title:"Ask","aria-label":"Ask",disabled:!_,onClick:()=>void N(),children:a.jsx(Lo,{size:13})})]}),r&&a.jsx("div",{className:"thread-card-actions",children:a.jsxs("button",{className:"thread-action-btn thread-action-danger",title:"Clear the sidecar conversation",disabled:T,onClick:()=>u(t,r.id),children:[a.jsx(us,{size:13})," Clear"]})})]})]})}function SN(){var g;Mt.trackRender("RightPanel");const t=I(m=>m.activeRightTab),s=I(m=>m.switchRightTab),r=I(m=>m.rightPanelCollapsed),o=I(m=>m.toggleRightPanel),l=I(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),u=I(m=>m.activeSessionId?Yd(m.backgroundTasks[m.activeSessionId]):0),d=((g=l==null?void 0:l.threads)==null?void 0:g.filter(m=>m.status==="open"&&!Xd(m)).length)??0,p=[{id:"turns",label:"Turns",icon:N1},{id:"sidecar",label:"Sidecar",icon:mr},{id:"tasks",label:"Tasks",icon:T1,badge:u||void 0},{id:"threads",label:"Threads",icon:rv,badge:d||void 0},{id:"apps",label:"Apps",icon:sv}];return r?a.jsxs("div",{className:"ide-right collapsed",children:[a.jsx("button",{type:"button",className:"right-icon-btn",title:"Expand panel","aria-label":"Expand panel","aria-expanded":!1,onClick:o,children:a.jsx(M1,{size:15})}),a.jsx("div",{className:"right-rail-divider"}),p.map(m=>{const v=m.icon,k=m.badge?`${m.label} (${m.badge})`:m.label;return a.jsxs("button",{type:"button",className:`right-icon-btn right-rail-tab ${t===m.id?"active":""}`,title:k,"aria-label":k,onClick:()=>s(m.id),children:[a.jsx(v,{size:15}),m.badge?a.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id)})]}):a.jsxs("div",{className:"ide-right",children:[a.jsxs("div",{className:"right-header",children:[a.jsx("div",{className:"right-tabs",children:p.map(m=>a.jsxs("div",{className:`right-tab ${t===m.id?"active":""}`,onClick:()=>s(m.id),children:[m.label,m.badge?a.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id))}),a.jsx("button",{type:"button",className:"right-icon-btn right-collapse-btn",title:"Collapse panel","aria-label":"Collapse panel","aria-expanded":!0,onClick:o,children:a.jsx(I1,{size:14})})]}),a.jsxs("div",{className:"right-content",children:[t==="turns"&&a.jsx(nN,{}),t==="sidecar"&&a.jsx(kN,{}),t==="tasks"&&a.jsx(aN,{}),t==="threads"&&a.jsx(yN,{}),t==="apps"&&a.jsx(xN,{})]})]})}const Ie={low:{effort:"low",label:"Low"},medium:{effort:"medium",label:"Medium"},high:{effort:"high",label:"High"},xhigh:{effort:"xhigh",label:"Extra High"},max:{effort:"max",label:"Max"},ultra:{effort:"ultra",label:"Ultra"}},fd=[{id:"codex",label:"Codex",available:!0,models:[{slug:"gpt-5.6-sol",displayName:"GPT-5.6-Sol",description:"Flagship — complex, open-ended work",defaultReasoning:"low",reasoningLevels:[Ie.low,Ie.medium,Ie.high,Ie.xhigh,Ie.max,Ie.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[Ie.low,Ie.medium,Ie.high,Ie.xhigh,Ie.max,Ie.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[Ie.low,Ie.medium,Ie.high,Ie.xhigh,Ie.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[Ie.low,Ie.medium,Ie.high,Ie.xhigh]}]},{id:"claude",label:"Claude",available:!0,models:[{slug:"claude-sonnet-5-5",displayName:"Claude Sonnet 5.5",description:"Best combination of speed and intelligence",defaultReasoning:"medium",reasoningLevels:[Ie.low,Ie.medium,Ie.high,Ie.xhigh,Ie.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[Ie.low,Ie.medium,Ie.high,Ie.xhigh,Ie.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[Ie.low,Ie.medium,Ie.high,Ie.xhigh,Ie.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[Ie.low,Ie.medium,Ie.high,Ie.xhigh,Ie.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ie.low,Ie.medium,Ie.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[Ie.low,Ie.medium,Ie.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ie.low,Ie.medium,Ie.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ie.low,Ie.medium,Ie.high]}]}];function bN(t){return fd.find(s=>s.id===t)}function Qd(t){const s=bN(t);return(s==null?void 0:s.models)??[]}function ay(t,s){return Qd(t).find(r=>r.slug===s)}function pd(t,s){var r;return((r=ay(t,s))==null?void 0:r.reasoningLevels)??[]}function hd(t,s){var r;return(r=ay(t,s))==null?void 0:r.defaultReasoning}function TN(){const{activeSessionId:t,sessions:s,updateModelConfig:r}=I(),o=I(Z=>Z.showModelSelector),l=I(Z=>Z.setShowModelSelector),u=s.find(Z=>Z.id===t),d=I(Z=>Z.models),p=I(Z=>Z.modelsLoading),g=I(Z=>Z.loadModels),[m,v]=x.useState(!1),k=x.useRef(null);if(Do(k,()=>v(!1),m),Ni(()=>v(!1),m),x.useEffect(()=>{o&&(v(!0),l(!1))},[o,l]),x.useEffect(()=>{u!=null&&u.runtime_type&&g(u.runtime_type,u.cwd??void 0)},[u==null?void 0:u.runtime_type,u==null?void 0:u.cwd,g]),!u)return null;const y=u.runtime_type,S=u.model??"",T=u.model_reasoning_effort??"",_=d.length>0?d:[],N=Qd(y),j=[..._.length>0?_:N];if(S&&!j.some(Z=>Z.slug===S)){const Z=N[0];j.unshift({slug:S,displayName:S,description:"Custom model",defaultReasoning:(Z==null?void 0:Z.defaultReasoning)??"medium",reasoningLevels:(Z==null?void 0:Z.reasoningLevels)??[]})}function W(Z){return j.find(oe=>oe.slug===Z)}function A(Z){var oe;return _.length>0?((oe=W(Z))==null?void 0:oe.reasoningLevels)??[]:pd(y,Z)}function D(Z){var oe;return _.length>0?(oe=W(Z))==null?void 0:oe.defaultReasoning:hd(y,Z)}const G=fd.find(Z=>Z.id===y),V=W(S),$=S?A(S):[],te=(G==null?void 0:G.label)??y,me=(V==null?void 0:V.displayName)??(S||"Default"),de=$.find(Z=>Z.effort===T),je=(de==null?void 0:de.label)??(T||"Default");function K(Z){var Q;const oe=A(Z),z=oe.some(q=>q.effort===T)?T:D(Z)??((Q=oe[0])==null?void 0:Q.effort)??"";r(Z,z),v(!1)}function be(Z){r(S,Z),v(!1)}return a.jsxs("div",{className:"model-selector",ref:k,children:[a.jsxs("button",{className:"model-selector-btn",onClick:()=>v(!m),title:"Change model and thinking level",children:[a.jsx("span",{className:"model-selector-provider",children:te}),a.jsx("span",{className:"model-selector-sep",children:"›"}),a.jsx("span",{className:"model-selector-model",children:me}),je!=="Default"&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"model-selector-sep",children:"›"}),a.jsx("span",{className:"model-selector-reasoning",children:je})]}),a.jsx(Si,{size:12,className:"model-selector-chevron"})]}),m&&a.jsxs("div",{className:"model-selector-popover",children:[a.jsxs("div",{className:"model-selector-column",children:[a.jsx("div",{className:"model-selector-col-header",children:"Provider"}),fd.map(Z=>a.jsxs("div",{className:`model-selector-item ${Z.id===y?"selected":""} ${Z.available?"":"disabled"}`,onClick:()=>{if(Z.available){if(Z.id===y){v(!1);return}r("","",Z.id)}},children:[a.jsx("span",{children:Z.label}),!Z.available&&a.jsxs("span",{className:"model-selector-coming-soon",children:[a.jsx(E1,{size:10})," Soon"]}),Z.id===y&&a.jsx(Ns,{size:12})]},Z.id))]}),a.jsxs("div",{className:"model-selector-column",children:[a.jsx("div",{className:"model-selector-col-header",children:"Model"}),p&&a.jsx("div",{className:"model-selector-empty",children:"Loading models…"}),!p&&j.length===0&&a.jsx("div",{className:"model-selector-empty",children:"No models available"}),j.map(Z=>a.jsxs("div",{className:`model-selector-item ${Z.slug===S?"selected":""}`,onClick:()=>K(Z.slug),children:[a.jsxs("div",{className:"model-selector-item-main",children:[a.jsx("span",{className:"model-selector-item-name",children:Z.displayName}),a.jsx("span",{className:"model-selector-item-desc",children:Z.description})]}),Z.slug===S&&a.jsx(Ns,{size:12})]},Z.slug))]}),a.jsxs("div",{className:"model-selector-column",children:[a.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),$.length===0&&a.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),$.map(Z=>a.jsxs("div",{className:`model-selector-item ${Z.effort===T?"selected":""}`,onClick:()=>be(Z.effort),children:[a.jsx("span",{children:Z.label}),Z.effort===T&&a.jsx(Ns,{size:12})]},Z.effort))]})]})]})}function mo(t){return t>=1e6?`${(t/1e6).toFixed(t%1e6===0?0:1)}M`:t>=1e3?`${Math.round(t/1e3)}K`:String(t)}function tg(){const t=I(r=>r.canGoBack),s=I(r=>r.canGoForward);return a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"sb-item sb-btn",title:"Back","aria-label":"Back",disabled:!t,onClick:()=>window.history.back(),children:a.jsx(l1,{size:14})}),a.jsx("button",{className:"sb-item sb-btn",title:"Forward","aria-label":"Forward",disabled:!s,onClick:()=>window.history.forward(),children:a.jsx(c1,{size:14})})]})}function ng(){const t=I(s=>s.setShowRemoteModal);return a.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>t(!0),children:[a.jsx(G1,{size:14})," Repoburg"]})}function sg(){const t=I(r=>r.usageViewOpen),s=I(r=>r.toggleUsageView);return a.jsxs("button",{className:`sb-item sb-btn${t?" sb-item-active":""}`,title:t?"Back to the agent view":"Usage Center",onClick:s,children:[a.jsx(ev,{size:14})," Usage"]})}function rg(){const t=I(r=>r.vscodeViewOpen),s=I(r=>r.toggleVscodeView);return a.jsxs("button",{className:`sb-item sb-btn${t?" sb-item-active":""}`,title:t?"Back to the agent view":"Open VS Code",onClick:s,children:[a.jsx(m1,{size:14})," Code"]})}function ig(){const t=I(r=>r.terminalViewOpen),s=I(r=>r.toggleTerminalView);return a.jsxs("button",{className:`sb-item sb-btn${t?" sb-item-active":""}`,title:t?"Back to the agent view":"Open a terminal",onClick:s,children:[a.jsx(lv,{size:14})," Terminal"]})}function NN(){Mt.trackRender("StatusBar");const t=I(v=>v.activeSessionId),s=I(v=>t?v.sessions.find(k=>k.id===t)??null:null),r=I(v=>t?v.sessionDetails[t]??null:null),o=I(v=>t?v.backgroundTasks[t]:void 0),l=I(v=>v.wsConnected),u=I(v=>v.switchRightTab),d=(r==null?void 0:r.contextUsage)??null;if(!s)return a.jsxs("div",{className:"ide-statusbar",children:[a.jsx(tg,{}),a.jsx(ng,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(rg,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(ig,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(sg,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx("div",{className:"sb-item",title:l?"WebSocket connected":"WebSocket disconnected",children:l?"Live":"Offline"}),a.jsx("div",{className:"sb-spacer"}),a.jsxs("div",{className:"sb-item",children:[a.jsx(tm,{size:14})," K"]})]});const p=o??[],g=Pl(s,p.length),m=Yd(p);return a.jsxs("div",{className:"ide-statusbar",children:[a.jsx(tg,{}),a.jsx(ng,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(rg,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(ig,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(sg,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(TN,{}),m>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"sb-divider",children:"|"}),a.jsxs("div",{className:"sb-item",style:{color:"var(--amber)",cursor:"pointer"},title:`${m} Monitor task${m>1?"s":""} running — click to view`,onClick:()=>u("tasks"),children:[a.jsx(cv,{size:14})," ",m]})]}),a.jsx("div",{className:"sb-spacer"}),a.jsx("div",{className:"sb-item",title:l?"WebSocket connected":"WebSocket disconnected",children:l?"Live":"Offline"}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx("div",{className:"sb-item",style:g.dot==="background"?{color:"var(--purple)"}:s.status==="failed"?{color:"var(--red)"}:void 0,title:g.dot==="background"?g.dotTitle:void 0,children:g.label}),d&&a.jsx(jN,{usage:d}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsxs("div",{className:"sb-item",children:[a.jsx(tm,{size:14})," K"]})]})}function jN({usage:t}){const s=t.percentage>=85?"var(--red)":t.percentage>=60?"var(--amber)":"var(--green)",r=`${mo(t.totalTokens)} / ${mo(t.contextWindow)} tokens`+(t.autoCompactThreshold?` · auto-compacts at ${mo(t.autoCompactThreshold)}`:"");return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx("div",{className:"sb-context",title:r,children:a.jsxs("span",{className:"sb-context-text",style:{color:s},children:[Math.round(t.percentage),"% / ",mo(t.totalTokens)," / ",mo(t.contextWindow)]})})]})}function og(t){return $t(`/vscode-web/status?folder=${encodeURIComponent(t??"")}`)}function CN(t){return ot("/vscode-web/start",{folder:t})}function EN(t){return ot("/vscode-web/heartbeat",{id:t})}const _N=1e3,RN=5*6e4;function ag({children:t}){const s=I(r=>r.toggleVscodeView);return a.jsxs("div",{className:"vscode-view vscode-view--loading",children:[t,a.jsx("button",{className:"dialog-close vscode-view-close",title:"Close VS Code view","aria-label":"Close VS Code view",onClick:s,children:a.jsx(Tn,{size:16})})]})}function AN(){const t=I(T=>T.vscodeState),s=I(T=>T.vscodeId),r=I(T=>T.vscodeToken),o=I(T=>T.setVscodeView),l=I(T=>{var N;const _=T.activeSessionId?T.sessions.find(E=>E.id===T.activeSessionId):null;return _!=null&&_.cwd?_.cwd:((N=T.workspaces.find(E=>E.deleted===0))==null?void 0:N.path)??null}),[u,d]=x.useState(!1),[p,g]=x.useState(0),m=x.useRef(null),v=mn(),k=v===""||v===window.location.origin,y=`${v}/vscode/${s??""}/?tkn=${r??""}${l?`&folder=${encodeURIComponent(l)}`:""}`;x.useEffect(()=>{let T=!1;function _(){m.current&&(clearInterval(m.current),m.current=null)}async function N(){try{let j=await og(l);if((j.state==="stopped"||j.state==="error")&&(j=await CN(l)),T||(o(j.state,j.id,j.token),j.state==="running"||j.state==="error"))return;m.current=setInterval(async()=>{const W=await og(l);T||(o(W.state,W.id,W.token),(W.state==="running"||W.state==="error"||W.state==="stopped")&&_())},_N)}catch{T||o("error",null,null)}}N();const E=setInterval(()=>{const j=I.getState().vscodeId;j&&EN(j).catch(()=>{})},RN);return()=>{T=!0,_(),clearInterval(E)}},[p,l,o]);function S(){d(!1),o("starting",null,null),g(T=>T+1)}return t!=="running"||!r||!s?a.jsx(ag,{children:t==="error"?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"VS Code could not start."}),a.jsxs("button",{className:"dialog-btn-cancel",onClick:S,children:[a.jsx(_o,{size:14})," Retry"]})]}):a.jsxs("span",{className:"vscode-view-hint",children:[a.jsx(hn,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):k?a.jsxs("div",{className:"vscode-view",children:[!u&&a.jsxs("div",{className:"vscode-view-overlay",children:[a.jsx(hn,{size:16,className:"spin"})," Loading VS Code…"]}),a.jsx("iframe",{src:y,title:"VS Code",className:"vscode-view-frame",onLoad:()=>d(!0)},s)]}):a.jsxs(ag,{children:[a.jsx("span",{children:"VS Code cannot be embedded on this host — serve-web allows same-origin frames only."}),a.jsxs("button",{className:"dialog-btn-cancel",onClick:()=>window.open(y,"_blank","noopener"),children:[a.jsx(v1,{size:14})," Open VS Code in a new tab"]})]})}function lg(t,s){const r=new URLSearchParams;t&&r.set("since",t),s&&r.set("until",s);const o=r.toString();return $t(`/usage/summary${o?`?${o}`:""}`)}const ly="agentpane:usage-budget";function cs(t){return t>=1e6?`${(t/1e6).toFixed(t%1e6===0?0:1)}M`:t>=1e3?`${Math.round(t/1e3)}K`:String(t)}function Or(t){return`$${t>=100?t.toFixed(0):t>=1?t.toFixed(2):t.toFixed(4).replace(/0+$/,"").replace(/\.$/,"")}`}function IN(t,s=new Date){if(t==="all")return{since:null,until:null};const r=new Date(s);return t==="today"?r.setHours(0,0,0,0):r.setDate(r.getDate()-(t==="7d"?7:30)),{since:r.toISOString(),until:null}}function MN(t=new Date){return new Date(t.getFullYear(),t.getMonth(),1).toISOString()}function DN(){try{const t=Number(localStorage.getItem(ly));return Number.isFinite(t)&&t>0?t:0}catch{return 0}}function LN(t){try{localStorage.setItem(ly,String(t))}catch{}}const ON={claude:"Claude",codex:"Codex",repoburg:"Repoburg"};function tl({label:t,value:s,sub:r,tone:o}){return a.jsxs("div",{className:"usage-kpi",children:[a.jsx("div",{className:"usage-kpi-label",children:t}),a.jsx("div",{className:"usage-kpi-value",style:o?{color:o}:void 0,children:s}),r&&a.jsx("div",{className:"usage-kpi-sub",children:r})]})}function PN({day:t,max:s}){const r=o=>s>0?o/s*100:0;return a.jsxs("div",{className:"usage-day",title:`${t.date} · ${cs(t.input_tokens)} input · ${cs(t.cached_input_tokens)} cached · ${cs(t.output_tokens)} output · ${Or(t.cost_usd)}`,children:[a.jsxs("div",{className:"usage-day-bar",children:[a.jsx("div",{className:"usage-seg usage-seg-output",style:{height:`${r(t.output_tokens)}%`}}),a.jsx("div",{className:"usage-seg usage-seg-cached",style:{height:`${r(t.cached_input_tokens+t.cache_write_input_tokens)}%`}}),a.jsx("div",{className:"usage-seg usage-seg-input",style:{height:`${r(t.input_tokens)}%`}})]}),a.jsx("div",{className:"usage-day-label",children:t.date.slice(5)})]})}function $N(){const t=I(j=>j.toggleUsageView),[s,r]=x.useState("30d"),[o,l]=x.useState(null),[u,d]=x.useState(null),[p,g]=x.useState(DN),[m,v]=x.useState(null),[k,y]=x.useState(!1),S=x.useCallback(async()=>{y(!0),v(null);try{const{since:j,until:W}=IN(s),[A,D]=await Promise.all([lg(j,W),lg(MN(),null)]);l(A),d(D.totals.cost_usd)}catch(j){v(j.message)}finally{y(!1)}},[s]);x.useEffect(()=>{S()},[S]);const T=o==null?void 0:o.totals,_=p>0&&u!==null?p-u:null,N=x.useMemo(()=>Math.max(0,...((o==null?void 0:o.daily)??[]).map(j=>j.input_tokens+j.cached_input_tokens+j.output_tokens)),[o]),E=j=>{const W=Number(j.replace(",",".")),A=Number.isFinite(W)&&W>0?W:0;g(A),LN(A)};return a.jsxs("div",{className:"usage-view",children:[a.jsxs("div",{className:"usage-header",children:[a.jsxs("div",{className:"usage-title",children:[a.jsx(ev,{size:18})," Usage Center"]}),a.jsxs("div",{className:"usage-controls",children:[["today","7d","30d","all"].map(j=>a.jsx("button",{className:`usage-range-btn${s===j?" usage-range-btn-active":""}`,onClick:()=>r(j),children:j==="today"?"Today":j==="7d"?"7 days":j==="30d"?"30 days":"All"},j)),a.jsx("button",{className:"usage-range-btn",onClick:()=>void S(),title:"Refresh",children:a.jsx($1,{size:13,className:k?"spin":void 0})}),a.jsx("button",{className:"dialog-close",title:"Close usage view","aria-label":"Close usage view",onClick:t,children:a.jsx(Tn,{size:16})})]})]}),m&&a.jsxs("div",{className:"usage-error",children:["Could not load usage data: ",m]}),!o&&!m&&a.jsx("div",{className:"usage-empty",children:"Loading…"}),o&&T&&a.jsxs("div",{className:"usage-body",children:[a.jsxs("div",{className:"usage-kpis",children:[a.jsx(tl,{label:"Spend",value:Or(T.cost_usd),sub:T.unpriced_models.length>0?"excluding unpriced models":void 0}),a.jsx(tl,{label:"Remaining (monthly)",value:_===null?"—":_>=0?Or(_):Or(0),sub:p>0&&u!==null?`this month ${Or(u)} / budget ${Or(p)}`:"no budget set",tone:_!==null&&_<0?"var(--red)":void 0}),a.jsx(tl,{label:"Tokens",value:cs(T.input_tokens+T.cached_input_tokens+T.cache_write_input_tokens+T.output_tokens),sub:`input ${cs(T.input_tokens)} · cached ${cs(T.cached_input_tokens)} · write ${cs(T.cache_write_input_tokens)} · output ${cs(T.output_tokens)}`}),a.jsx(tl,{label:"Calls",value:String(T.calls),sub:T.errors>0?`${T.errors} failed`:void 0,tone:T.errors>0?"var(--amber)":void 0})]}),a.jsxs("div",{className:"usage-budget",children:[a.jsx("label",{htmlFor:"usage-budget-input",children:"Monthly budget (USD)"}),a.jsx("input",{id:"usage-budget-input",type:"number",min:"0",step:"1",defaultValue:p>0?p:"",placeholder:"e.g. 50",onBlur:j=>E(j.target.value)}),p>0&&u!==null&&a.jsx("div",{className:"usage-budget-bar",children:a.jsx("div",{className:"usage-budget-fill",style:{width:`${Math.min(100,u/p*100)}%`,background:u>=p?"var(--red)":void 0}})})]}),T.unpriced_models.length>0&&a.jsxs("div",{className:"usage-note",children:["Unpriced models: ",T.unpriced_models.join(", ")]}),a.jsxs("div",{className:"usage-chart",children:[a.jsx("div",{className:"usage-section-title",children:"Daily usage"}),o.daily.length===0?a.jsx("div",{className:"usage-empty",children:"No usage in this range."}):a.jsx("div",{className:"usage-days",children:o.daily.map(j=>a.jsx(PN,{day:j,max:N},j.date))}),a.jsxs("div",{className:"usage-legend",children:[a.jsxs("span",{children:[a.jsx("span",{className:"usage-dot usage-seg-input"})," input"]}),a.jsxs("span",{children:[a.jsx("span",{className:"usage-dot usage-seg-cached"})," cached"]}),a.jsxs("span",{children:[a.jsx("span",{className:"usage-dot usage-seg-output"})," output"]})]})]}),a.jsxs("div",{className:"usage-table-wrap",children:[a.jsx("div",{className:"usage-section-title",children:"By model"}),a.jsxs("table",{className:"usage-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Runtime"}),a.jsx("th",{children:"Provider"}),a.jsx("th",{children:"Model"}),a.jsx("th",{children:"Effort"}),a.jsx("th",{children:"Calls"}),a.jsx("th",{children:"Input"}),a.jsx("th",{children:"Cached"}),a.jsx("th",{children:"Output"}),a.jsx("th",{children:"Cost"})]})}),a.jsxs("tbody",{children:[o.by_model.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:9,className:"usage-empty",children:"No usage records yet."})}),o.by_model.map(j=>a.jsxs("tr",{children:[a.jsx("td",{children:ON[j.runtime_type]??j.runtime_type}),a.jsx("td",{children:j.provider??"—"}),a.jsx("td",{title:j.model,children:j.model}),a.jsx("td",{children:j.reasoning_effort??"default"}),a.jsxs("td",{children:[j.calls,j.errors>0&&a.jsxs("span",{className:"usage-err",children:[" (",j.errors," failed)"]})]}),a.jsx("td",{children:cs(j.input_tokens)}),a.jsx("td",{children:cs(j.cached_input_tokens+j.cache_write_input_tokens)}),a.jsx("td",{children:cs(j.output_tokens)}),a.jsx("td",{children:j.cost_usd===null?a.jsx("span",{className:"usage-unpriced",children:"unknown"}):Or(j.cost_usd)})]},`${j.runtime_type}|${j.provider??""}|${j.model}|${j.reasoning_effort??""}`))]})]})]})]})]})}const cg="claude auth login";function zN(){const t=I(p=>Object.keys(p.signedOutTurns).length),s=I(p=>p.terminalViewOpen),r=I(p=>p.toggleTerminalView),o=I(p=>p.addToast),[l,u]=x.useState(!1);if(t===0)return null;const d=()=>{u(!0),S0().catch(p=>o("error",`Could not resume the turns — ${Pr(p)}`)).finally(()=>u(!1))};return a.jsxs("div",{className:"signed-out-band",role:"status",children:[a.jsx("span",{className:"banner-icon",children:a.jsx(S1,{size:12})}),a.jsxs("span",{className:"banner-text",children:["Claude is signed out — ",t===1?"1 turn is":`${t} turns are`," waiting. Run"," ",a.jsx("code",{children:cg})," in a terminal, then resume."]}),a.jsxs("button",{type:"button",className:"banner-action",onClick:()=>void Io(cg),children:[a.jsx(Eo,{size:12}),"Copy"]}),!s&&a.jsxs("button",{type:"button",className:"banner-action",onClick:r,children:[a.jsx(lv,{size:12}),"Open terminal"]}),a.jsxs("button",{type:"button",className:"banner-action",onClick:d,disabled:l,children:[a.jsx(ov,{size:12}),t===1?"Resume turn":"Resume turns"]})]})}const ug=/^[a-f0-9]{64}\.(?:png|jpg|gif|webp)$/,FN=/^(?:https?:\/\/[^/?#]+)?\/api\/apps\/([^/?#]+)\/files\/([^/?#]+)$/i,UN={png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function cy(){return mn()||window.location.origin}function uy(t,s){let r=s;if(r&&typeof r=="object"){const d=r;r=typeof d.id=="string"?d.id:d.url}if(typeof r!="string")return null;const o=r.trim();if(ug.test(o))return o;const l=FN.exec(o);if(!l)return null;let u;try{u=decodeURIComponent(l[1])}catch{return null}return u===t&&ug.test(l[2])?l[2]:null}function dg(t){return/^https?:\/\//i.test(t.url)?t:{...t,url:`${cy()}${t.url}`}}function BN(t){return UN[t.slice(t.lastIndexOf(".")+1)]??"application/octet-stream"}function dy(t){return new Promise((s,r)=>{const o=new FileReader;o.onload=()=>{const l=String(o.result??"");s(l.slice(l.indexOf(",")+1))},o.onerror=()=>r(o.error??new Error("Could not read the file")),o.readAsDataURL(t)})}function WN(t,s){const r=/^data:([^;,]*)(?:;[^;,]*)*;base64,/i.exec(t);return r?{type:s||r[1]||void 0,data:t.slice(r[0].length)}:{type:s,data:t}}async function fy(t){if(t instanceof Blob){const s=t.name;return{name:typeof s=="string"&&s?s:void 0,type:t.type||void 0,data:await dy(t)}}if(t&&typeof t=="object"&&typeof t.data=="string"){const s=t;return{name:typeof s.name=="string"&&s.name?s.name:void 0,type:typeof s.type=="string"&&s.type?s.type:void 0,data:s.data}}return null}async function HN(t){const s=await fy(t);if(!s)throw new Error("uploadFile: expected a Blob/File or { name, type, data }");return s}async function VN(t,s,r){if(s==null)return[];if(!Array.isArray(s))throw new Error("submitTurn: attachments must be an array");const o=[];for(let l=0;l<s.length;l++){const u=s[l],d=await fy(u);if(d){const{type:m,data:v}=WN(d.data,d.type);if(!m)throw new Error(`submitTurn: attachment ${l+1} has no type`);o.push({name:d.name??`attachment-${l+1}`,media_type:m,data:v});continue}const p=uy(t,u);if(!p)throw new Error(`submitTurn: attachment ${l+1} is not a file of this app`);const g=await r(p);o.push({name:p,media_type:BN(p),data:await dy(g)})}return o}const GN=`function (config) {
521
521
  var nextId = 1;
522
522
  var pending = new Map();
523
523
  var listeners = [];
@@ -617,6 +617,13 @@ ${R}
617
617
  if (opts && opts.attachments != null) params.attachments = opts.attachments;
618
618
  return call('submitTurn', params);
619
619
  },
620
+ getSession: function (sessionId) { return call('getSession', { sessionId: sessionId }); },
621
+ cancelTurn: function (sessionId) { return call('cancelTurn', { sessionId: sessionId }); },
622
+ setSessionLifecycle: function (sessionId, lifecycle) { return call('setSessionLifecycle', { sessionId: sessionId, lifecycle: lifecycle }); },
623
+ callTool: function (tool, args) { return call('callTool', { tool: tool, args: args }); },
624
+ listProviders: function () { return call('listProviders'); },
625
+ listModels: function (runtime, cwd) { return call('listModels', { runtime: runtime, cwd: cwd }); },
626
+ pickDirectory: function () { return call('pickDirectory'); },
620
627
  onTurnCompleted: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:completed' || event === 'turn:failed') cb(event, payload); }); },
621
628
  onTurnDelta: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:delta' && payload) cb(payload); }); },
622
629
  onToolCall: function (cb) { listeners.push(function (event, payload) { if (event === 'tool_call' && payload) cb(payload); }); },
@@ -652,9 +659,9 @@ ${R}
652
659
  stack: (r && r.stack) || '', line: 0, col: 0
653
660
  }, '*');
654
661
  });
655
- }`;function UN(t){return`(${FN})(${JSON.stringify(t)});`}function dg(t){return t.replace(/<\/script/gi,"<\\/script")}function BN(t,s){const r=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(r,"gi");let l=-1,u;for(;(u=o.exec(t))!==null;)l=u.index;return l}function fg(t,s,r){const o=BN(t,s);return o===-1?t+r:t.slice(0,o)+r+t.slice(o)}function WN(t,s,r){let o=t;const l=`<script>${dg(s)}<\/script>`;if(/<\/head>/i.test(o)?o=fg(o,"</head>",l):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${l}</head>`):o=`${l}${o}`,r){const u=`<script>${dg(r)}<\/script>`;o=fg(o,"</body>",u)}return o}function HN(){const t=globalThis.crypto;return t&&typeof t.randomUUID=="function"?`tab-${t.randomUUID()}`:`tab-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function VN(t){var r;if(!(t instanceof yd)||t.status!==409)return null;const s=(r=t.body)==null?void 0:r.state;return s&&typeof s=="object"?s:null}function GN({appId:t,workspace:s=""}){const r=x.useRef(null),o=x.useRef({pinned:!1,data:null}),[l,u]=x.useState(null),[d,p]=x.useState(null),[g,m]=x.useState([]);x.useEffect(()=>{let S=!0;const T=HN(),_=C=>{const R=o.current.version;typeof C.version=="number"&&typeof R=="number"&&C.version<R||(o.current=C)};q0(t,C=>{var R,H;return(H=(R=r.current)==null?void 0:R.contentWindow)==null?void 0:H.postMessage(C,"*")},s);const N=async C=>{var G,$,te,he,ue,Se,q,we,Z,oe,ae,z,Q;if(C.source!==((G=r.current)==null?void 0:G.contentWindow))return;const R=C.data;if(!R||R.source!=="agentpane-app")return;if(R.report==="error"){const B={message:String(R.message??"Unknown error"),stack:String(R.stack??"")};m(E=>{const P=E[E.length-1];return P&&P.message===B.message?E:[...E,B].slice(-20)});return}if(typeof R.method!="string")return;let H=!0,M,D,K=null;try{switch(R.method){case"getApp":M={id:t};break;case"getState":try{const B=await Yh(t,s);_(B),M=B}catch{M=o.current}break;case"setState":{const B=(($=R.params)==null?void 0:$.data)??null,E=(te=R.params)==null?void 0:te.ifVersion,P={data:B,writer:T};typeof E=="number"&&(P.ifVersion=E);try{const se=await Fg(t,P,s);_(se),M=se}catch(se){if(K=VN(se),!K)throw se;_(K);const fe=se.body;throw new Error(typeof(fe==null?void 0:fe.error)=="string"?fe.error:"App state changed since that version")}break}case"createSession":{const B=R.params??{},E=await xd({title:typeof B.title=="string"?B.title:void 0,runtime_type:typeof B.runtime_type=="string"?B.runtime_type:void 0,model:typeof B.model=="string"?B.model:void 0,model_reasoning_effort:typeof B.model_reasoning_effort=="string"?B.model_reasoning_effort:void 0,cwd:typeof B.cwd=="string"?B.cwd:void 0,origin_app_id:t});Cu(E.id,t),I.getState().addSession(E),M=E;break}case"submitTurn":{const B=String(((he=R.params)==null?void 0:he.sessionId)??""),E=String(((ue=R.params)==null?void 0:ue.prompt)??""),P=await zN(t,(Se=R.params)==null?void 0:Se.attachments,fe=>Mw(t,fe)),se=await Cg(B,E,P.length?P:void 0,{originAppId:t});Cu(B,t),M=se;break}case"resolveToolCall":{const B=String(((q=R.params)==null?void 0:q.callId)??""),E=(we=R.params)==null?void 0:we.result;await _w(B,E),M={ok:!0};break}case"openSession":{if(I.getState().activeAppTabId!==t)throw new Error("openSession: the app is not on screen — call it from a click in the app");const B=typeof((Z=R.params)==null?void 0:Z.sessionId)=="string"?R.params.sessionId.trim():"";if(!B)throw new Error("openSession: sessionId is required");try{await I.getState().revealSession(B)}catch(E){throw new Error(`openSession: ${E instanceof Error?E.message:String(E)}`)}M={ok:!0};break}case"uploadFile":{const B=await $N((oe=R.params)==null?void 0:oe.file);try{M=ug(await Aw(t,B))}catch(E){throw new Error(`uploadFile: ${E instanceof Error?E.message:String(E)}`)}break}case"getFile":{const B=oy(t,(ae=R.params)==null?void 0:ae.ref),E=B?await Iw(t,B):null;M=E?ug(E):null;break}default:throw new Error(`Unknown bridge method: ${R.method}`)}}catch(B){H=!1,D=B instanceof Error?B.message:String(B)}(Q=(z=r.current)==null?void 0:z.contentWindow)==null||Q.postMessage(K?{source:"agentpane-host",id:R.id,ok:H,error:D,code:"conflict",state:K}:{source:"agentpane-host",id:R.id,ok:H,result:M,error:D},"*")};return window.addEventListener("message",N),ew(t,C=>{var R,H;typeof C.workspace=="string"&&C.workspace!==s||C.writer!==T&&((H=(R=r.current)==null?void 0:R.contentWindow)==null||H.postMessage({source:"agentpane-host",event:"state_changed",payload:typeof C.version=="number"?{version:C.version}:{}},"*"))}),Z0(t,()=>{qh(t).then(C=>{S&&(u(C),m([]))}).catch(()=>{})}),(async()=>{try{const[C,R,H]=await Promise.all([qh(t),Yh(t,s),Tw(t).catch(()=>[])]);if(!S)return;o.current=R,H.forEach(M=>Cu(M.id,t)),u(C)}catch(C){S&&p(C instanceof Error?C.message:String(C))}})(),()=>{S=!1,Y0(t),J0(t),tw(t),window.removeEventListener("message",N)}},[t,s]);const v=x.useMemo(()=>l?WN(l.html,UN({appId:t,apiOrigin:iy()}),l.js):"",[l,t]);if(d)return a.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",d]});if(!v)return a.jsx("div",{className:"empty-state",style:{padding:"24px"},children:"Loading mini app…"});const k=(l==null?void 0:l.diagnostics)??[],y=k.some(S=>S.severity==="error");return a.jsxs("div",{className:"miniapp-runtime",children:[k.length>0&&a.jsxs("div",{className:`miniapp-diagnostics${y?"":" miniapp-diagnostics-warn"}`,"data-testid":"miniapp-diagnostics",children:[a.jsx("div",{className:"miniapp-diagnostics-title",children:y?`Compile errors in ${(l==null?void 0:l.sourceFile)??"the app logic"} — the pane serves the last code that parsed:`:"Warnings — the app runs, but fix these:"}),k.map((S,T)=>a.jsxs("div",{className:"miniapp-diag",children:[S.file,":",S.line,":",S.column," — ",S.message]},T))]}),a.jsx("iframe",{ref:r,className:"miniapp-frame",sandbox:"allow-scripts allow-popups allow-popups-to-escape-sandbox",allow:"loopback-network; local-network; local-network-access",title:`Mini app: ${t}`,srcDoc:v}),g.length>0&&a.jsx("div",{className:"miniapp-rt-errors","data-testid":"miniapp-rt-errors",children:g.map((S,T)=>a.jsxs("div",{className:"miniapp-rt-error",children:[a.jsx("div",{className:"miniapp-rt-error-message",children:S.message}),S.stack&&a.jsx("pre",{className:"miniapp-rt-error-stack",children:S.stack})]},T))})]})}function KN({appId:t,active:s}){const r=I(y=>y.apps),o=I(y=>y.workspaces),l=I(y=>y.appWorkspaces),u=I(y=>y.setAppWorkspace),d=I(y=>y.setActiveAppTab),p=I(y=>y.startAppEdit),g=r.find(y=>y.id===t),m=l[t]??"",v=o.filter(y=>y.deleted!==1),k=m!==""&&!v.some(y=>y.path===m)?m:null;return a.jsxs("div",{className:`miniapp-view ${s?"":"miniapp-view-hidden"}`,children:[a.jsxs("div",{className:"miniapp-header",children:[a.jsx(ji,{iconNode:g==null?void 0:g.iconNode,size:14,className:"miniapp-header-icon"}),a.jsx("span",{className:"miniapp-header-title",children:(g==null?void 0:g.title)??t}),a.jsxs("select",{className:"miniapp-workspace-select",title:"Workspace this app instance is bound to (state and pinning are scoped per workspace)",value:m,onChange:y=>u(t,y.target.value),children:[a.jsx("option",{value:"",children:"All workspaces (global)"}),v.map(y=>a.jsx("option",{value:y.path,children:y.label||y.path.split("/").pop()||y.path},y.path)),k&&a.jsx("option",{value:k,children:`${k} (unknown workspace)`})]}),a.jsxs("button",{className:"miniapp-header-btn",title:"Edit this app with the agent (opens an edit session on the app folder)",onClick:()=>void p(t),children:[a.jsx(_1,{size:13}),"Edit"]}),a.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>d(null),children:a.jsx(Tn,{size:14})})]}),a.jsx("div",{className:"miniapp-body",children:a.jsx(GN,{appId:t,workspace:m},`${t}:${m}`)})]})}function qN({side:t,minWidth:s,maxWidth:r,getWidth:o,setWidth:l}){const[u,d]=x.useState(!1),p=x.useRef(0),g=x.useRef(0),m=x.useCallback(y=>{const S=y.clientX-p.current,T=t==="left"?g.current+S:g.current-S,_=Math.min(r,Math.max(s,T));l(_)},[t,s,r,l]),v=x.useCallback(()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",v),document.body.classList.remove("is-resizing"),d(!1)},[m]);return{onPointerDown:x.useCallback(y=>{var S,T;y.preventDefault(),y.stopPropagation();try{(T=(S=y.currentTarget)==null?void 0:S.setPointerCapture)==null||T.call(S,y.pointerId)}catch{}p.current=y.clientX,g.current=o(),d(!0),document.body.classList.add("is-resizing"),window.addEventListener("pointermove",m),window.addEventListener("pointerup",v)},[o,m,v]),dragging:u}}function pg({side:t,minWidth:s,maxWidth:r,getWidth:o,setWidth:l}){const{onPointerDown:u,dragging:d}=qN({side:t,minWidth:s,maxWidth:r,getWidth:o,setWidth:l});return a.jsx("div",{className:`resize-handle ${t}${d?" dragging":""}`,onPointerDown:u,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${t} panel`,"data-resizing":d?"":void 0})}const YN=x.lazy(()=>Xw(()=>import("./TerminalView-BFw1zt_D.js"),__vite__mapDeps([0,1])));function XN(){Mt.trackRender("IdeWorkspace");const t=I(S=>S.sidebarWidth),s=I(S=>S.rightPanelWidth),r=I(S=>S.setSidebarWidth),o=I(S=>S.setRightPanelWidth),l=I(S=>S.rightPanelCollapsed),u=I(S=>S.vscodeViewOpen),d=I(S=>S.usageViewOpen),p=I(S=>S.terminalViewOpen),[g,m]=x.useState(!1);p&&!g&&m(!0);const v=I(S=>S.activeAppTabId),k=I(S=>S.openAppTabs);x.useEffect(()=>{const S=()=>{const T=ul(),{rightPanelWidth:_,setRightPanelWidth:N}=I.getState();_>T&&N(T)};return window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const y=l?`${t}px 6px 1fr ${vw}px`:`${t}px 6px 1fr 6px ${s}px`;return a.jsxs("div",{className:"ide-root",children:[a.jsx(MN,{}),a.jsxs("div",{className:`ide-layout ${u||d||p?"ide-hidden":""}`,style:{gridTemplateColumns:y},children:[a.jsx(zS,{}),a.jsx(pg,{side:"left",minWidth:qu,maxWidth:Yu,getWidth:()=>I.getState().sidebarWidth,setWidth:r}),a.jsxs("div",{className:"ide-center",children:[a.jsx(BS,{}),a.jsxs("div",{className:"ide-render",children:[k.map(S=>a.jsx(KN,{appId:S,active:v===S},S)),v==null&&a.jsx(PT,{})]}),a.jsx(YT,{})]}),!l&&a.jsx(pg,{side:"right",minWidth:cl,maxWidth:ul(),getWidth:()=>I.getState().rightPanelWidth,setWidth:o}),a.jsx(gN,{})]}),u&&a.jsx(NN,{}),d&&a.jsx(IN,{}),g&&a.jsx(x.Suspense,{fallback:null,children:a.jsx(YN,{visible:p})}),a.jsx(xN,{})]})}function QN(){const{showNewSessionDialog:t,setShowNewSessionDialog:s,createSession:r,lastModelConfig:o}=I(),l=(o==null?void 0:o.provider)??"codex",u=(o==null?void 0:o.model)??"",d=(o==null?void 0:o.reasoning)??"",[p,g]=x.useState(""),[m,v]=x.useState(u),[k,y]=x.useState(d),[S,T]=x.useState("");if(!t)return null;const _=Xd(l),N=m?dd(l,m):[];function C(){r({title:p.trim()||void 0,model:m||void 0,model_reasoning_effort:k||void 0,cwd:S.trim()||void 0,runtime_type:l}),g(""),T("")}function R(M){M.key==="Escape"&&s(!1)}function H(M){var G;v(M);const D=dd(l,M);D.some($=>$.effort===k)||y(fd(l,M)??((G=D[0])==null?void 0:G.effort)??"")}return a.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:a.jsxs("div",{className:"dialog",onClick:M=>M.stopPropagation(),onKeyDown:R,children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",children:"New Session"}),a.jsx("button",{className:"dialog-close",onClick:()=>s(!1),children:a.jsx(Tn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[a.jsxs("label",{className:"dialog-label",children:["Title (optional)",a.jsx("input",{className:"dialog-input",type:"text",value:p,onChange:M=>g(M.target.value),placeholder:"e.g. refactor auth module",autoFocus:!0})]}),a.jsxs("label",{className:"dialog-label",children:["Model",a.jsxs("select",{className:"dialog-input dialog-select",value:m,onChange:M=>H(M.target.value),children:[a.jsx("option",{value:"",children:"Default (Codex picks)"}),_.map(M=>a.jsxs("option",{value:M.slug,children:[M.displayName," — ",M.description]},M.slug))]})]}),N.length>0&&a.jsxs("label",{className:"dialog-label",children:["Thinking Level",a.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:M=>y(M.target.value),children:[a.jsxs("option",{value:"",children:["Default (",fd(l,m),")"]}),N.map(M=>a.jsx("option",{value:M.effort,children:M.label},M.effort))]})]}),a.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",a.jsx("input",{className:"dialog-input",type:"text",value:S,onChange:M=>T(M.target.value),placeholder:"e.g. /Users/me/projects/my-app"})]})]}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:()=>s(!1),children:"Cancel"}),a.jsx("button",{className:"dialog-btn-create",onClick:C,children:"Create"})]})]})})}function ZN(t,s){const r=s!==""&&(t===s||t.startsWith(`${s}/`)),o=[r?{label:"~",path:s}:{label:"/",path:"/"}],l=t.slice(r?s.length:0);let u=o[0].path;for(const d of l.split("/").filter(Boolean))u=u==="/"?`/${d}`:`${u}/${d}`,o.push({label:d,path:u});return o}function JN(t){const s=t.filter(l=>l.deleted===0).at(-1);if(!s)return;const r=pr(s.path),o=r.lastIndexOf("/");return o>0?r.slice(0,o):void 0}function ej(){return I(s=>s.showAddWorkspaceDialog)?a.jsx(tj,{}):null}function tj(){var G;const t=I($=>$.setShowAddWorkspaceDialog),s=I($=>$.workspaces),r=I($=>$.createWorkspaceAt),o=I($=>$.addToast),[l,u]=x.useState(null),[d,p]=x.useState(!0),[g,m]=x.useState(null),[v,k]=x.useState(!1),y=x.useRef(0),[S]=x.useState(()=>JN(I.getState().workspaces)),T=x.useRef(null),_=x.useCallback(()=>{v||t(!1)},[v,t]);Ni(_);const N=x.useCallback(async($,te=!1)=>{const he=++y.current;p(!0);let ue=null,Se=null;try{ue=await Rh($)}catch(q){if(Se=Pr(q),te&&$)try{ue=await Rh(),Se=null}catch(we){Se=Pr(we)}}he===y.current&&(ue&&u(ue),m(Se),p(!1))},[]);x.useEffect(()=>{N(S,!0)},[N,S]);const C=l==null?void 0:l.path;x.useEffect(()=>{T.current&&(T.current.scrollTop=0)},[C]);const R=new Set(s.filter($=>$.deleted===0).map($=>pr($.path)));async function H($){if(!v){k(!0),m(null);try{const te=await r($);t(!1),o("success",`Workspace added — ${te.path}`)}catch(te){m(Pr(te)),k(!1)}}}const M=l?ZN(l.path,l.home):[],D=((G=M.at(-1))==null?void 0:G.label)??"",K=l!==null&&R.has(pr(l.path));return a.jsx("div",{className:"dialog-overlay",onClick:_,children:a.jsxs("div",{className:"dialog folder-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"folder-dialog-title",onClick:$=>$.stopPropagation(),children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",id:"folder-dialog-title",children:"Add workspace"}),a.jsx("button",{className:"dialog-close",onClick:_,"aria-label":"Close",disabled:v,children:a.jsx(Tn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[a.jsxs("p",{className:"dialog-hint",children:["Choose a project folder",l&&a.jsxs(a.Fragment,{children:[" ","on ",a.jsx("strong",{children:l.hostname})]}),"."]}),a.jsxs("div",{className:"folder-nav",children:[a.jsx("button",{className:"folder-up",onClick:()=>(l==null?void 0:l.parent)&&void N(l.parent),disabled:!(l!=null&&l.parent),"aria-label":"Parent folder",title:"Parent folder",children:a.jsx(qg,{size:14})}),a.jsx("nav",{className:"folder-crumbs","aria-label":"Folder path",children:M.map(($,te)=>a.jsxs(x.Fragment,{children:[te>0&&a.jsx(Co,{size:12,className:"folder-crumb-sep","aria-hidden":"true"}),te===M.length-1?a.jsx("span",{className:"folder-crumb current","aria-current":"location",title:$.path,children:$.label}):a.jsx("button",{className:"folder-crumb",onClick:()=>void N($.path),title:$.path,children:$.label})]},$.path))}),d&&l&&a.jsx(hn,{size:14,className:"spin folder-spinner","aria-label":"Loading"})]}),a.jsx("ul",{ref:T,className:`folder-list${d&&l?" loading":""}`,"aria-label":"Folders",children:l?l.folders.length===0?a.jsx("li",{className:"folder-empty",children:"No folders here."}):l.folders.map($=>a.jsxs("li",{className:"folder-item",children:[a.jsxs("button",{className:"folder-row",onClick:()=>void N($.path),title:$.path,"aria-label":$.git?`${$.name} (git repository)`:$.name,children:[$.git?a.jsx(f1,{size:15,className:"folder-icon git","aria-hidden":"true"}):a.jsx(gl,{size:15,className:"folder-icon","aria-hidden":"true"}),a.jsx("span",{className:"folder-name",children:$.name}),a.jsx(Co,{size:13,className:"folder-chevron","aria-hidden":"true"})]}),R.has(pr($.path))?a.jsx("span",{className:"folder-tag",children:"Added"}):a.jsx("button",{className:"folder-add",onClick:()=>void H($.path),disabled:v,"aria-label":`Add ${$.name}`,children:"Add"})]},$.path)):d&&a.jsxs("li",{className:"folder-empty",role:"status",children:[a.jsx(hn,{size:14,className:"spin"})," Loading folders…"]})}),(l==null?void 0:l.truncated)&&a.jsxs("p",{className:"folder-note",children:["Showing the first ",l.folders.length," folders."]}),g&&a.jsx("p",{className:"folder-error",role:"alert",children:g})]}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:_,disabled:v,children:"Cancel"}),a.jsx("button",{className:"dialog-btn-create",onClick:()=>l&&void H(l.path),disabled:!l||d||v||K,children:v?"Adding…":K?"Already added":`Add “${D}”`})]})]})})}const pd=6e4,hd=60*pd,nl=24*hd;function nj(t,s=Date.now()){const r=Date.parse(t);if(Number.isNaN(r))return"";const o=Math.max(0,s-r);return o<pd?"just now":o<hd?`${Math.floor(o/pd)} min ago`:o<nl?`${Math.floor(o/hd)} h ago`:o<2*nl?"yesterday":o<7*nl?`${Math.floor(o/nl)} days ago`:new Date(r).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}function sj(){const t=I(s=>s.importSessionsWorkspace);return t?a.jsx(rj,{workspace:t},t):null}function rj({workspace:t}){const s=I(M=>M.setImportSessionsWorkspace),r=I(M=>M.importClaudeSessions),[o,l]=x.useState(null),[u,d]=x.useState(null),[p,g]=x.useState(new Set),[m,v]=x.useState(!1),[k,y]=x.useState(new Map),S=x.useCallback(()=>{m||s(null)},[m,s]);Ni(S),x.useEffect(()=>{let M=!1;return Og(t).then(D=>{M||l(D)}).catch(D=>{M||d(Pr(D))}),()=>{M=!0}},[t]);function T(M){g(D=>{const K=new Set(D);return K.has(M)?K.delete(M):K.add(M),K})}const _=o??[],N=_.length>0&&_.every(M=>p.has(M.session_id));async function C(){const M=_.filter($=>p.has($.session_id)).map($=>$.session_id);if(M.length===0)return;v(!0);const{imported:D,failed:K}=await r(t,M);if(v(!1),K.length===0){s(null);return}const G=new Set(D.map($=>$.import_source_id));l($=>($??[]).filter(te=>!G.has(te.session_id))),g(new Set(K.map($=>$.id))),y(new Map(K.map($=>[$.id,$.error])))}const R=t.split("/").pop()||t,H=p.size;return a.jsx("div",{className:"dialog-overlay",onClick:S,children:a.jsxs("div",{className:"dialog import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"import-dialog-title",onClick:M=>M.stopPropagation(),children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",id:"import-dialog-title",children:"Import Claude Code sessions"}),a.jsx("button",{className:"dialog-close",onClick:S,"aria-label":"Close",disabled:m,children:a.jsx(Tn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[a.jsxs("p",{className:"dialog-hint",children:["Sessions you started with ",a.jsx("code",{children:"claude"})," in ",a.jsx("strong",{title:t,children:R}),", in a terminal or an IDE. An imported session keeps its history and continues the same Claude conversation."]}),u?a.jsxs("p",{className:"import-error",role:"alert",children:["Could not list the sessions — ",u]}):o===null?a.jsxs("div",{className:"import-loading",role:"status",children:[a.jsx(hn,{size:14,className:"spin"})," Looking for sessions…"]}):o.length===0?a.jsxs("div",{className:"import-empty",children:["No Claude Code sessions to import here. Sessions you start with ",a.jsx("code",{children:"claude"})," in this folder will show up here."]}):a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"import-select-all",children:[a.jsx("input",{type:"checkbox",checked:N,disabled:m,onChange:()=>g(N?new Set:new Set(_.map(M=>M.session_id)))}),"Select all (",o.length,")"]}),a.jsx("ul",{className:"import-list",children:o.map(M=>{const D=k.get(M.session_id);return a.jsx("li",{children:a.jsxs("label",{className:`import-row${p.has(M.session_id)?" selected":""}`,children:[a.jsx("input",{type:"checkbox",checked:p.has(M.session_id),disabled:m,onChange:()=>T(M.session_id)}),a.jsxs("span",{className:"import-row-main",children:[a.jsx("span",{className:"import-row-title",title:M.title,children:M.title}),a.jsxs("span",{className:"import-row-meta",children:[a.jsx("span",{title:new Date(M.last_modified).toLocaleString(),children:nj(M.last_modified)}),M.git_branch&&a.jsxs("span",{className:"import-row-branch",title:"Git branch",children:[a.jsx(Zg,{size:10})," ",M.git_branch]})]}),M.recently_active&&a.jsxs("span",{className:"import-row-warn",children:[a.jsx(av,{size:11})," Active in the last few minutes. If it is still open in a terminal, close it there first: both would write to the same session."]}),D&&a.jsx("span",{className:"import-row-error",role:"alert",children:D})]})]})},M.session_id)})})]})]}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:S,disabled:m,children:"Cancel"}),a.jsx("button",{className:"dialog-btn-create",onClick:()=>void C(),disabled:H===0||m,children:m?a.jsxs(a.Fragment,{children:[a.jsx(hn,{size:12,className:"spin"})," Importing…"]}):H>1?`Import ${H} sessions`:"Import"})]})]})})}const ij=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,oj=512*1024;function aj(t){const s=t.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(s)?s:""}function lj(){const{appCatalogOpen:t,closeAppCatalog:s,apps:r,installExampleApp:o,createSkeletonApp:l,importAppFolder:u}=I(),[d,p]=x.useState("examples"),[g,m]=x.useState(null),[v,k]=x.useState(null),[y,S]=x.useState(!1),[T,_]=x.useState(""),[N,C]=x.useState(""),[R,H]=x.useState(""),[M,D]=x.useState(""),[K,G]=x.useState(null),[$,te]=x.useState(""),he=x.useRef(null);if(x.useEffect(()=>{t&&(m(null),Nw().then(m).catch(()=>m([])))},[t]),x.useEffect(()=>{he.current&&(he.current.webkitdirectory=!0)},[d]),!t)return null;const ue=new Set(r.map(z=>z.id));async function Se(z){k(z);try{await o(z)&&s()}finally{k(null)}}async function q(){if(y)return;const z=T.trim(),Q=N.trim();if(!(!z||!Q)){S(!0);try{await l({id:z,title:Q,description:R.trim()||void 0,icon:M.trim()||void 0})&&(_(""),C(""),H(""),D(""),s())}finally{S(!1)}}}async function we(z){const Q=Array.from(z.target.files??[]),B={};let E="";for(const P of Q){const fe=(P.webkitRelativePath??"").split("/");!E&&fe.length>1&&(E=fe[0]);const X=fe[fe.length-1];if(!(!X||!ij.test(X))&&!(P.size>oj))try{B[X]=await P.text()}catch{}}G(Object.keys(B).length>0?B:null),te(aj(E))}async function Z(){if(!(y||!K||!$.trim())){S(!0);try{await u($.trim(),K)&&(G(null),te(""),s())}finally{S(!1)}}}function oe(z){z.key==="Escape"&&s()}const ae=[{key:"examples",label:"Examples"},{key:"new",label:"New App"},{key:"upload",label:"Upload"}];return a.jsx("div",{className:"dialog-overlay",onClick:s,children:a.jsxs("div",{className:"dialog app-catalog",onClick:z=>z.stopPropagation(),onKeyDown:oe,children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",children:"Add Mini App"}),a.jsx("button",{className:"dialog-close",onClick:s,children:"✕"})]}),a.jsx("div",{className:"catalog-tabs",children:ae.map(z=>a.jsx("button",{className:`catalog-tab${d===z.key?" active":""}`,onClick:()=>p(z.key),children:z.label},z.key))}),a.jsxs("div",{className:"dialog-body catalog-body",children:[d==="examples"&&a.jsx("div",{className:"catalog-examples",children:g===null?a.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"Loading examples…"}):g.length===0?a.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"No example apps available."}):g.map(z=>{const Q=ue.has(z.id);return a.jsxs("div",{className:"example-row",children:[a.jsx(ji,{iconNode:z.iconNode,size:14,className:"sidebar-app-icon"}),a.jsxs("div",{className:"example-info",children:[a.jsx("span",{className:"example-title",children:z.title}),z.description&&a.jsx("span",{className:"example-desc",children:z.description})]}),a.jsx("button",{className:"example-install",disabled:Q||v===z.id,onClick:()=>Se(z.id),title:Q?"Already installed":"Install this example",children:Q?"Installed":v===z.id?"Installing…":"Install"})]},z.id)})}),d==="new"&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"dialog-label",children:["App id (folder name)",a.jsx("input",{className:"dialog-input",type:"text",value:T,onChange:z=>_(z.target.value),placeholder:"e.g. todo-list",autoFocus:!0})]}),a.jsxs("label",{className:"dialog-label",children:["Title",a.jsx("input",{className:"dialog-input",type:"text",value:N,onChange:z=>C(z.target.value),placeholder:"e.g. Todo List"})]}),a.jsxs("label",{className:"dialog-label",children:["Description (optional)",a.jsx("input",{className:"dialog-input",type:"text",value:R,onChange:z=>H(z.target.value),placeholder:"What does this app do?"})]}),a.jsxs("label",{className:"dialog-label",children:[a.jsxs("span",{children:["Icon (optional, a"," ",a.jsx("a",{href:"https://lucide.dev/icons",target:"_blank",rel:"noreferrer",children:"Lucide icon"})," ","name)"]}),a.jsx("input",{className:"dialog-input",type:"text",value:M,onChange:z=>D(z.target.value),placeholder:"e.g. notebook-pen",spellCheck:!1,autoCapitalize:"off"})]}),a.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!T.trim()||!N.trim(),onClick:q,children:[a.jsx(dr,{size:13})," Create App"]})]}),d==="upload"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"catalog-upload-hint",children:"Select an app folder from disk. Text files only (manifest.json, index.html, app.ts (or legacy app.js), …). A missing manifest.json is generated from the folder name."}),a.jsx("input",{ref:he,type:"file",multiple:!0,onChange:we}),K&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"dialog-label",children:["App id",a.jsx("input",{className:"dialog-input",type:"text",value:$,onChange:z=>te(z.target.value)})]}),a.jsxs("div",{className:"catalog-upload-summary",children:[Object.keys(K).length," file(s):"," ",Object.keys(K).slice(0,6).join(", "),Object.keys(K).length>6?", …":""]})]}),a.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!K||!$.trim(),onClick:Z,children:[a.jsx(O1,{size:13})," Import App"]})]})]}),a.jsx("div",{className:"dialog-footer",children:a.jsx("button",{className:"dialog-btn-cancel",onClick:s,children:"Close"})})]})})}function cj(){const t=I(k=>k.showCommandPalette),s=I(k=>k.setShowCommandPalette),r=I(),[o,l]=x.useState(""),[u,d]=x.useState(0),p=x.useRef(null),g=x.useMemo(()=>{const k=r.activeSessionId?r.sessionDetails[r.activeSessionId]:null,y=Al(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:dr,action:()=>r.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:us,action:()=>{r.activeSessionId&&r.deleteSession(r.activeSessionId)},available:!!r.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:Lo,action:()=>{const S=document.querySelector(".cmd-input");S==null||S.focus()},available:!!r.activeSessionId&&!y},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:Fr,action:()=>r.cancelTurn(),available:y},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:w1,action:()=>r.switchRightTab("turns"),available:!!r.activeSessionId},{id:"tab-sidecar",label:"Ask Sidecar",hint:"Ask about this session — status, blockers, what is left",icon:mr,action:()=>r.switchRightTab("sidecar"),available:!!r.activeSessionId},{id:"toggle-right-panel",label:"Toggle Right Panel",hint:r.rightPanelCollapsed?"Expand the right panel":"Collapse the right panel to its icon rail",icon:C1,action:()=>r.toggleRightPanel(),available:!0},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:Tn,action:()=>{r.activeSessionId&&r.closeTab(r.activeSessionId)},available:!!r.activeSessionId}]},[r]),m=x.useMemo(()=>{const k=o.toLowerCase().trim(),y=g.filter(S=>S.available);return k?y.filter(S=>S.label.toLowerCase().includes(k)||S.hint.toLowerCase().includes(k)):y},[g,o]);x.useEffect(()=>{t&&(l(""),d(0),setTimeout(()=>{var k;return(k=p.current)==null?void 0:k.focus()},50))},[t]);function v(k){if(k.key==="ArrowDown")k.preventDefault(),d(y=>Math.min(y+1,m.length-1));else if(k.key==="ArrowUp")k.preventDefault(),d(y=>Math.max(y-1,0));else if(k.key==="Enter"){k.preventDefault();const y=m[u];y&&(y.action(),s(!1))}else k.key==="Escape"&&s(!1)}return t?a.jsx("div",{className:"palette-overlay",onClick:()=>s(!1),children:a.jsxs("div",{className:"palette",onClick:k=>k.stopPropagation(),children:[a.jsxs("div",{className:"palette-search",children:[a.jsx("input",{ref:p,type:"text",placeholder:"Type a command…",value:o,onChange:k=>{l(k.target.value),d(0)},onKeyDown:v}),a.jsx("span",{className:"palette-esc",children:"ESC"})]}),m.length===0?a.jsx("div",{className:"palette-empty",children:"No matching commands"}):a.jsx("div",{className:"palette-list",children:m.map((k,y)=>{const S=k.icon;return a.jsxs("div",{className:`palette-item ${y===u?"selected":""}`,onClick:()=>{k.action(),s(!1)},onMouseEnter:()=>d(y),children:[a.jsx("span",{className:"palette-item-icon",children:a.jsx(S,{size:16})}),a.jsx("span",{className:"palette-item-label",children:k.label}),a.jsx("span",{className:"palette-item-hint",children:k.hint}),y===u&&a.jsx(c1,{size:12,className:"palette-item-enter"})]},k.id)})}),a.jsxs("div",{className:"palette-footer",children:[a.jsxs("span",{className:"palette-footer-hint",children:[a.jsx("span",{className:"kbd",children:"↑"}),a.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),a.jsxs("span",{className:"palette-footer-hint",children:[a.jsx("span",{className:"kbd",children:"↵"})," Select"]}),a.jsxs("span",{className:"palette-footer-hint",children:[a.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const hg=/^[a-z][a-z0-9-]{1,30}$/,uj=2e3;function dj(){const{showRemoteModal:t,setShowRemoteModal:s,selectSession:r}=I(),[o,l]=x.useState(null),[u,d]=x.useState(null),[p,g]=x.useState(!1),[m,v]=x.useState(!1),[k,y]=x.useState(!1),[S,T]=x.useState(!1),[_,N]=x.useState("main"),[C,R]=x.useState(""),[H,M]=x.useState(!1),[D,K]=x.useState(null),G=x.useRef(null);Do(G,()=>T(!1),S);const $=m||k,te=x.useCallback(async()=>{g(!0),d(null);try{const z=await fetch(`${mn()}/remote/status`,{headers:{Accept:"application/json"}});if(!z.ok)throw new Error(`status ${z.status}`);l(await z.json())}catch{l(null),d("Machine management is only available from this machine's local pane.")}finally{g(!1)}},[]);x.useEffect(()=>{t&&(N("main"),K(null),te())},[t,te]);const he=D!==null&&D.state==="running";if(x.useEffect(()=>{if(!he)return;const z=setInterval(async()=>{try{const Q=await fetch(`${mn()}/remote/enable`,{headers:{Accept:"application/json"}});Q.ok&&K(await Q.json())}catch{}},uj);return()=>clearInterval(z)},[he]),!t)return null;const ue=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function Se(z){z.key==="Escape"&&s(!1)}async function q(z){if(hg.test(z)){M(!0);try{const Q=await fetch(`${mn()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:z})});if(!Q.ok)throw new Error(`enable ${Q.status}`);K(await Q.json()),N("setup")}catch{d("Could not start the setup — check the daemon logs.")}finally{M(!1)}}}function we(){D!=null&&D.troubleshootingSessionId&&(r(D.troubleshootingSessionId),s(!1))}async function Z(){v(!0);try{await fetch(`${mn()}/remote/disable`,{method:"POST"}),await te()}catch{d("Could not stop the tunnel service — check the service logs.")}finally{v(!1)}}async function oe(){if(T(!1),!!window.confirm(`Remove the tunnel completely?
662
+ }`;function KN(t){return`(${GN})(${JSON.stringify(t)});`}function fg(t){return t.replace(/<\/script/gi,"<\\/script")}function qN(t,s){const r=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(r,"gi");let l=-1,u;for(;(u=o.exec(t))!==null;)l=u.index;return l}function pg(t,s,r){const o=qN(t,s);return o===-1?t+r:t.slice(0,o)+r+t.slice(o)}function YN(t,s,r){let o=t;const l=`<script>${fg(s)}<\/script>`;if(/<\/head>/i.test(o)?o=pg(o,"</head>",l):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${l}</head>`):o=`${l}${o}`,r){const u=`<script>${fg(r)}<\/script>`;o=pg(o,"</body>",u)}return o}function XN(){const t=globalThis.crypto;return t&&typeof t.randomUUID=="function"?`tab-${t.randomUUID()}`:`tab-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function QN(t){var r;if(!(t instanceof Il)||t.status!==409)return null;const s=(r=t.body)==null?void 0:r.state;return s&&typeof s=="object"?s:null}function ZN({appId:t,workspace:s=""}){const r=x.useRef(null),o=x.useRef({pinned:!1,data:null}),[l,u]=x.useState(null),[d,p]=x.useState(null),[g,m]=x.useState([]);x.useEffect(()=>{let S=!0;const T=XN(),_=E=>{const j=o.current.version;typeof E.version=="number"&&typeof j=="number"&&E.version<j||(o.current=E)};Q0(t,E=>{var j,W;return(W=(j=r.current)==null?void 0:j.contentWindow)==null?void 0:W.postMessage(E,"*")},s);const N=async E=>{var V,$,te,me,de,je,K,be,Z,oe,ae,z,Q,q,M,P,le,ge,X,pe,Te;if(E.source!==((V=r.current)==null?void 0:V.contentWindow))return;const j=E.data;if(!j||j.source!=="agentpane-app")return;if(j.report==="error"){const se={message:String(j.message??"Unknown error"),stack:String(j.stack??"")};m(he=>{const Se=he[he.length-1];return Se&&Se.message===se.message?he:[...he,se].slice(-20)});return}if(typeof j.method!="string")return;let W=!0,A,D,G=null;try{switch(j.method){case"getApp":A={id:t,workspace:s};break;case"getState":try{const se=await Xh(t,s);_(se),A=se}catch{A=o.current}break;case"setState":{const se=(($=j.params)==null?void 0:$.data)??null,he=(te=j.params)==null?void 0:te.ifVersion,Se={data:se,writer:T};typeof he=="number"&&(Se.ifVersion=he);try{const He=await Wg(t,Se,s);_(He),A=He}catch(He){if(G=QN(He),!G)throw He;_(G);const Re=He.body;throw new Error(typeof(Re==null?void 0:Re.error)=="string"?Re.error:"App state changed since that version")}break}case"createSession":{const se=j.params??{},he=await wd({title:typeof se.title=="string"?se.title:void 0,runtime_type:typeof se.runtime_type=="string"?se.runtime_type:void 0,model:typeof se.model=="string"?se.model:void 0,model_reasoning_effort:typeof se.model_reasoning_effort=="string"?se.model_reasoning_effort:void 0,cwd:typeof se.cwd=="string"?se.cwd:void 0,origin_app_id:t,origin_app_workspace:s});sl(he.id,t),I.getState().addSession(he),A=he;break}case"submitTurn":{const se=String(((me=j.params)==null?void 0:me.sessionId)??""),he=String(((de=j.params)==null?void 0:de.prompt)??""),Se=await VN(t,(je=j.params)==null?void 0:je.attachments,Re=>Fw(t,Re)),He=await Eg(se,he,Se.length?Se:void 0,{originAppId:t});sl(se,t),A=He;break}case"getSession":{A=await Ew(t,String(((K=j.params)==null?void 0:K.sessionId)??""));break}case"cancelTurn":{A=await _w(t,String(((be=j.params)==null?void 0:be.sessionId)??""));break}case"setSessionLifecycle":{A=await Rw(t,String(((Z=j.params)==null?void 0:Z.sessionId)??""),String(((oe=j.params)==null?void 0:oe.lifecycle)??""));break}case"callTool":{const se=(ae=j.params)==null?void 0:ae.args;A=await Aw(t,s,String(((z=j.params)==null?void 0:z.tool)??""),se&&typeof se=="object"?se:{});break}case"listProviders":{A=await iy();break}case"listModels":{const se=typeof((Q=j.params)==null?void 0:Q.runtime)=="string"?j.params.runtime.trim():"";if(!se)throw new Error("listModels: runtime is required");const he=(q=j.params)==null?void 0:q.cwd;A=await Ug(se,typeof he=="string"&&he?he:void 0);break}case"pickDirectory":{if(I.getState().activeAppTabId!==t)throw new Error("pickDirectory: the app is not on screen — call it from a click in the app");A=await Rg();break}case"resolveToolCall":{const se=String(((M=j.params)==null?void 0:M.callId)??""),he=(P=j.params)==null?void 0:P.result;await Ow(se,he),A={ok:!0};break}case"openSession":{if(I.getState().activeAppTabId!==t)throw new Error("openSession: the app is not on screen — call it from a click in the app");const se=typeof((le=j.params)==null?void 0:le.sessionId)=="string"?j.params.sessionId.trim():"";if(!se)throw new Error("openSession: sessionId is required");try{await I.getState().revealSession(se)}catch(he){throw new Error(`openSession: ${he instanceof Error?he.message:String(he)}`)}A={ok:!0};break}case"uploadFile":{const se=await HN((ge=j.params)==null?void 0:ge.file);try{A=dg(await $w(t,se))}catch(he){throw new Error(`uploadFile: ${he instanceof Error?he.message:String(he)}`)}break}case"getFile":{const se=uy(t,(X=j.params)==null?void 0:X.ref),he=se?await zw(t,se):null;A=he?dg(he):null;break}default:throw new Error(`Unknown bridge method: ${j.method}`)}}catch(se){W=!1,D=se instanceof Error?se.message:String(se)}(Te=(pe=r.current)==null?void 0:pe.contentWindow)==null||Te.postMessage(G?{source:"agentpane-host",id:j.id,ok:W,error:D,code:"conflict",state:G}:{source:"agentpane-host",id:j.id,ok:W,result:A,error:D},"*")};return window.addEventListener("message",N),rw(t,E=>{var j,W;typeof E.workspace=="string"&&E.workspace!==s||E.writer!==T&&((W=(j=r.current)==null?void 0:j.contentWindow)==null||W.postMessage({source:"agentpane-host",event:"state_changed",payload:typeof E.version=="number"?{version:E.version}:{}},"*"))}),nw(t,()=>{Yh(t).then(E=>{S&&(u(E),m([]))}).catch(()=>{})}),(async()=>{try{const[E,j,W]=await Promise.all([Yh(t),Xh(t,s),Cw(t).catch(()=>[])]);if(!S)return;o.current=j,W.forEach(A=>sl(A.id,t)),u(E)}catch(E){S&&p(E instanceof Error?E.message:String(E))}})(),()=>{S=!1,Z0(t),sw(t),iw(t),window.removeEventListener("message",N)}},[t,s]),x.useEffect(()=>{l&&J0(t,l.manifest.headlessSessions===!0)},[t,l]);const v=x.useMemo(()=>l?YN(l.html,KN({appId:t,apiOrigin:cy()}),l.js):"",[l,t]);if(d)return a.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",d]});if(!v)return a.jsx("div",{className:"empty-state",style:{padding:"24px"},children:"Loading mini app…"});const k=(l==null?void 0:l.diagnostics)??[],y=k.some(S=>S.severity==="error");return a.jsxs("div",{className:"miniapp-runtime",children:[k.length>0&&a.jsxs("div",{className:`miniapp-diagnostics${y?"":" miniapp-diagnostics-warn"}`,"data-testid":"miniapp-diagnostics",children:[a.jsx("div",{className:"miniapp-diagnostics-title",children:y?`Compile errors in ${(l==null?void 0:l.sourceFile)??"the app logic"} — the pane serves the last code that parsed:`:"Warnings — the app runs, but fix these:"}),k.map((S,T)=>a.jsxs("div",{className:"miniapp-diag",children:[S.file,":",S.line,":",S.column," — ",S.message]},T))]}),a.jsx("iframe",{ref:r,className:"miniapp-frame",sandbox:"allow-scripts allow-popups allow-popups-to-escape-sandbox",allow:"loopback-network; local-network; local-network-access",title:`Mini app: ${t}`,srcDoc:v}),g.length>0&&a.jsx("div",{className:"miniapp-rt-errors","data-testid":"miniapp-rt-errors",children:g.map((S,T)=>a.jsxs("div",{className:"miniapp-rt-error",children:[a.jsx("div",{className:"miniapp-rt-error-message",children:S.message}),S.stack&&a.jsx("pre",{className:"miniapp-rt-error-stack",children:S.stack})]},T))})]})}function JN({appId:t,active:s}){const r=I(y=>y.apps),o=I(y=>y.workspaces),l=I(y=>y.appWorkspaces),u=I(y=>y.setAppWorkspace),d=I(y=>y.setActiveAppTab),p=I(y=>y.startAppEdit),g=r.find(y=>y.id===t),m=l[t]??"",v=o.filter(y=>y.deleted!==1),k=m!==""&&!v.some(y=>y.path===m)?m:null;return a.jsxs("div",{className:`miniapp-view ${s?"":"miniapp-view-hidden"}`,children:[a.jsxs("div",{className:"miniapp-header",children:[a.jsx(ji,{iconNode:g==null?void 0:g.iconNode,size:14,className:"miniapp-header-icon"}),a.jsx("span",{className:"miniapp-header-title",children:(g==null?void 0:g.title)??t}),a.jsxs("select",{className:"miniapp-workspace-select",title:"Workspace this app instance is bound to (state and pinning are scoped per workspace)",value:m,onChange:y=>u(t,y.target.value),children:[a.jsx("option",{value:"",children:"All workspaces (global)"}),v.map(y=>a.jsx("option",{value:y.path,children:y.label||y.path.split("/").pop()||y.path},y.path)),k&&a.jsx("option",{value:k,children:`${k} (unknown workspace)`})]}),a.jsxs("button",{className:"miniapp-header-btn",title:"Edit this app with the agent (opens an edit session on the app folder)",onClick:()=>void p(t),children:[a.jsx(O1,{size:13}),"Edit"]}),a.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>d(null),children:a.jsx(Tn,{size:14})})]}),a.jsx("div",{className:"miniapp-body",children:a.jsx(ZN,{appId:t,workspace:m},`${t}:${m}`)})]})}function ej({side:t,minWidth:s,maxWidth:r,getWidth:o,setWidth:l}){const[u,d]=x.useState(!1),p=x.useRef(0),g=x.useRef(0),m=x.useCallback(y=>{const S=y.clientX-p.current,T=t==="left"?g.current+S:g.current-S,_=Math.min(r,Math.max(s,T));l(_)},[t,s,r,l]),v=x.useCallback(()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",v),document.body.classList.remove("is-resizing"),d(!1)},[m]);return{onPointerDown:x.useCallback(y=>{var S,T;y.preventDefault(),y.stopPropagation();try{(T=(S=y.currentTarget)==null?void 0:S.setPointerCapture)==null||T.call(S,y.pointerId)}catch{}p.current=y.clientX,g.current=o(),d(!0),document.body.classList.add("is-resizing"),window.addEventListener("pointermove",m),window.addEventListener("pointerup",v)},[o,m,v]),dragging:u}}function hg({side:t,minWidth:s,maxWidth:r,getWidth:o,setWidth:l}){const{onPointerDown:u,dragging:d}=ej({side:t,minWidth:s,maxWidth:r,getWidth:o,setWidth:l});return a.jsx("div",{className:`resize-handle ${t}${d?" dragging":""}`,onPointerDown:u,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${t} panel`,"data-resizing":d?"":void 0})}const tj=x.lazy(()=>s1(()=>import("./TerminalView-BIN1AVRE.js"),__vite__mapDeps([0,1])));function nj(){Mt.trackRender("IdeWorkspace");const t=I(S=>S.sidebarWidth),s=I(S=>S.rightPanelWidth),r=I(S=>S.setSidebarWidth),o=I(S=>S.setRightPanelWidth),l=I(S=>S.rightPanelCollapsed),u=I(S=>S.vscodeViewOpen),d=I(S=>S.usageViewOpen),p=I(S=>S.terminalViewOpen),[g,m]=x.useState(!1);p&&!g&&m(!0);const v=I(S=>S.activeAppTabId),k=I(S=>S.openAppTabs);x.useEffect(()=>{const S=()=>{const T=fl(),{rightPanelWidth:_,setRightPanelWidth:N}=I.getState();_>T&&N(T)};return window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const y=l?`${t}px 6px 1fr ${ww}px`:`${t}px 6px 1fr 6px ${s}px`;return a.jsxs("div",{className:"ide-root",children:[a.jsx(zN,{}),a.jsxs("div",{className:`ide-layout ${u||d||p?"ide-hidden":""}`,style:{gridTemplateColumns:y},children:[a.jsx(GS,{}),a.jsx(hg,{side:"left",minWidth:Xu,maxWidth:Qu,getWidth:()=>I.getState().sidebarWidth,setWidth:r}),a.jsxs("div",{className:"ide-center",children:[a.jsx(YS,{}),a.jsxs("div",{className:"ide-render",children:[k.map(S=>a.jsx(JN,{appId:S,active:v===S},S)),v==null&&a.jsx(HT,{})]}),a.jsx(tN,{})]}),!l&&a.jsx(hg,{side:"right",minWidth:dl,maxWidth:fl(),getWidth:()=>I.getState().rightPanelWidth,setWidth:o}),a.jsx(SN,{})]}),u&&a.jsx(AN,{}),d&&a.jsx($N,{}),g&&a.jsx(x.Suspense,{fallback:null,children:a.jsx(tj,{visible:p})}),a.jsx(NN,{})]})}function sj(){const{showNewSessionDialog:t,setShowNewSessionDialog:s,createSession:r,lastModelConfig:o}=I(),l=(o==null?void 0:o.provider)??"codex",u=(o==null?void 0:o.model)??"",d=(o==null?void 0:o.reasoning)??"",[p,g]=x.useState(""),[m,v]=x.useState(u),[k,y]=x.useState(d),[S,T]=x.useState("");if(!t)return null;const _=Qd(l),N=m?pd(l,m):[];function E(){r({title:p.trim()||void 0,model:m||void 0,model_reasoning_effort:k||void 0,cwd:S.trim()||void 0,runtime_type:l}),g(""),T("")}function j(A){A.key==="Escape"&&s(!1)}function W(A){var V;v(A);const D=pd(l,A);D.some($=>$.effort===k)||y(hd(l,A)??((V=D[0])==null?void 0:V.effort)??"")}return a.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:a.jsxs("div",{className:"dialog",onClick:A=>A.stopPropagation(),onKeyDown:j,children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",children:"New Session"}),a.jsx("button",{className:"dialog-close",onClick:()=>s(!1),children:a.jsx(Tn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[a.jsxs("label",{className:"dialog-label",children:["Title (optional)",a.jsx("input",{className:"dialog-input",type:"text",value:p,onChange:A=>g(A.target.value),placeholder:"e.g. refactor auth module",autoFocus:!0})]}),a.jsxs("label",{className:"dialog-label",children:["Model",a.jsxs("select",{className:"dialog-input dialog-select",value:m,onChange:A=>W(A.target.value),children:[a.jsx("option",{value:"",children:"Default (Codex picks)"}),_.map(A=>a.jsxs("option",{value:A.slug,children:[A.displayName," — ",A.description]},A.slug))]})]}),N.length>0&&a.jsxs("label",{className:"dialog-label",children:["Thinking Level",a.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:A=>y(A.target.value),children:[a.jsxs("option",{value:"",children:["Default (",hd(l,m),")"]}),N.map(A=>a.jsx("option",{value:A.effort,children:A.label},A.effort))]})]}),a.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",a.jsx("input",{className:"dialog-input",type:"text",value:S,onChange:A=>T(A.target.value),placeholder:"e.g. /Users/me/projects/my-app"})]})]}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:()=>s(!1),children:"Cancel"}),a.jsx("button",{className:"dialog-btn-create",onClick:E,children:"Create"})]})]})})}function rj(t,s){const r=s!==""&&(t===s||t.startsWith(`${s}/`)),o=[r?{label:"~",path:s}:{label:"/",path:"/"}],l=t.slice(r?s.length:0);let u=o[0].path;for(const d of l.split("/").filter(Boolean))u=u==="/"?`/${d}`:`${u}/${d}`,o.push({label:d,path:u});return o}function ij(t){const s=t.filter(l=>l.deleted===0).at(-1);if(!s)return;const r=pr(s.path),o=r.lastIndexOf("/");return o>0?r.slice(0,o):void 0}function oj(){return I(s=>s.showAddWorkspaceDialog)?a.jsx(aj,{}):null}function aj(){var V;const t=I($=>$.setShowAddWorkspaceDialog),s=I($=>$.workspaces),r=I($=>$.createWorkspaceAt),o=I($=>$.addToast),[l,u]=x.useState(null),[d,p]=x.useState(!0),[g,m]=x.useState(null),[v,k]=x.useState(!1),y=x.useRef(0),[S]=x.useState(()=>ij(I.getState().workspaces)),T=x.useRef(null),_=x.useCallback(()=>{v||t(!1)},[v,t]);Ni(_);const N=x.useCallback(async($,te=!1)=>{const me=++y.current;p(!0);let de=null,je=null;try{de=await Ah($)}catch(K){if(je=Pr(K),te&&$)try{de=await Ah(),je=null}catch(be){je=Pr(be)}}me===y.current&&(de&&u(de),m(je),p(!1))},[]);x.useEffect(()=>{N(S,!0)},[N,S]);const E=l==null?void 0:l.path;x.useEffect(()=>{T.current&&(T.current.scrollTop=0)},[E]);const j=new Set(s.filter($=>$.deleted===0).map($=>pr($.path)));async function W($){if(!v){k(!0),m(null);try{const te=await r($);t(!1),o("success",`Workspace added — ${te.path}`)}catch(te){m(Pr(te)),k(!1)}}}const A=l?rj(l.path,l.home):[],D=((V=A.at(-1))==null?void 0:V.label)??"",G=l!==null&&j.has(pr(l.path));return a.jsx("div",{className:"dialog-overlay",onClick:_,children:a.jsxs("div",{className:"dialog folder-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"folder-dialog-title",onClick:$=>$.stopPropagation(),children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",id:"folder-dialog-title",children:"Add workspace"}),a.jsx("button",{className:"dialog-close",onClick:_,"aria-label":"Close",disabled:v,children:a.jsx(Tn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[a.jsxs("p",{className:"dialog-hint",children:["Choose a project folder",l&&a.jsxs(a.Fragment,{children:[" ","on ",a.jsx("strong",{children:l.hostname})]}),"."]}),a.jsxs("div",{className:"folder-nav",children:[a.jsx("button",{className:"folder-up",onClick:()=>(l==null?void 0:l.parent)&&void N(l.parent),disabled:!(l!=null&&l.parent),"aria-label":"Parent folder",title:"Parent folder",children:a.jsx(Qg,{size:14})}),a.jsx("nav",{className:"folder-crumbs","aria-label":"Folder path",children:A.map(($,te)=>a.jsxs(x.Fragment,{children:[te>0&&a.jsx(Co,{size:12,className:"folder-crumb-sep","aria-hidden":"true"}),te===A.length-1?a.jsx("span",{className:"folder-crumb current","aria-current":"location",title:$.path,children:$.label}):a.jsx("button",{className:"folder-crumb",onClick:()=>void N($.path),title:$.path,children:$.label})]},$.path))}),d&&l&&a.jsx(hn,{size:14,className:"spin folder-spinner","aria-label":"Loading"})]}),a.jsx("ul",{ref:T,className:`folder-list${d&&l?" loading":""}`,"aria-label":"Folders",children:l?l.folders.length===0?a.jsx("li",{className:"folder-empty",children:"No folders here."}):l.folders.map($=>a.jsxs("li",{className:"folder-item",children:[a.jsxs("button",{className:"folder-row",onClick:()=>void N($.path),title:$.path,"aria-label":$.git?`${$.name} (git repository)`:$.name,children:[$.git?a.jsx(x1,{size:15,className:"folder-icon git","aria-hidden":"true"}):a.jsx(yl,{size:15,className:"folder-icon","aria-hidden":"true"}),a.jsx("span",{className:"folder-name",children:$.name}),a.jsx(Co,{size:13,className:"folder-chevron","aria-hidden":"true"})]}),j.has(pr($.path))?a.jsx("span",{className:"folder-tag",children:"Added"}):a.jsx("button",{className:"folder-add",onClick:()=>void W($.path),disabled:v,"aria-label":`Add ${$.name}`,children:"Add"})]},$.path)):d&&a.jsxs("li",{className:"folder-empty",role:"status",children:[a.jsx(hn,{size:14,className:"spin"})," Loading folders…"]})}),(l==null?void 0:l.truncated)&&a.jsxs("p",{className:"folder-note",children:["Showing the first ",l.folders.length," folders."]}),g&&a.jsx("p",{className:"folder-error",role:"alert",children:g})]}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:_,disabled:v,children:"Cancel"}),a.jsx("button",{className:"dialog-btn-create",onClick:()=>l&&void W(l.path),disabled:!l||d||v||G,children:v?"Adding…":G?"Already added":`Add “${D}”`})]})]})})}const md=6e4,gd=60*md,nl=24*gd;function lj(t,s=Date.now()){const r=Date.parse(t);if(Number.isNaN(r))return"";const o=Math.max(0,s-r);return o<md?"just now":o<gd?`${Math.floor(o/md)} min ago`:o<nl?`${Math.floor(o/gd)} h ago`:o<2*nl?"yesterday":o<7*nl?`${Math.floor(o/nl)} days ago`:new Date(r).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}function cj(){const t=I(s=>s.importSessionsWorkspace);return t?a.jsx(uj,{workspace:t},t):null}function uj({workspace:t}){const s=I(A=>A.setImportSessionsWorkspace),r=I(A=>A.importClaudeSessions),[o,l]=x.useState(null),[u,d]=x.useState(null),[p,g]=x.useState(new Set),[m,v]=x.useState(!1),[k,y]=x.useState(new Map),S=x.useCallback(()=>{m||s(null)},[m,s]);Ni(S),x.useEffect(()=>{let A=!1;return $g(t).then(D=>{A||l(D)}).catch(D=>{A||d(Pr(D))}),()=>{A=!0}},[t]);function T(A){g(D=>{const G=new Set(D);return G.has(A)?G.delete(A):G.add(A),G})}const _=o??[],N=_.length>0&&_.every(A=>p.has(A.session_id));async function E(){const A=_.filter($=>p.has($.session_id)).map($=>$.session_id);if(A.length===0)return;v(!0);const{imported:D,failed:G}=await r(t,A);if(v(!1),G.length===0){s(null);return}const V=new Set(D.map($=>$.import_source_id));l($=>($??[]).filter(te=>!V.has(te.session_id))),g(new Set(G.map($=>$.id))),y(new Map(G.map($=>[$.id,$.error])))}const j=t.split("/").pop()||t,W=p.size;return a.jsx("div",{className:"dialog-overlay",onClick:S,children:a.jsxs("div",{className:"dialog import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"import-dialog-title",onClick:A=>A.stopPropagation(),children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",id:"import-dialog-title",children:"Import Claude Code sessions"}),a.jsx("button",{className:"dialog-close",onClick:S,"aria-label":"Close",disabled:m,children:a.jsx(Tn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[a.jsxs("p",{className:"dialog-hint",children:["Sessions you started with ",a.jsx("code",{children:"claude"})," in ",a.jsx("strong",{title:t,children:j}),", in a terminal or an IDE. An imported session keeps its history and continues the same Claude conversation."]}),u?a.jsxs("p",{className:"import-error",role:"alert",children:["Could not list the sessions — ",u]}):o===null?a.jsxs("div",{className:"import-loading",role:"status",children:[a.jsx(hn,{size:14,className:"spin"})," Looking for sessions…"]}):o.length===0?a.jsxs("div",{className:"import-empty",children:["No Claude Code sessions to import here. Sessions you start with ",a.jsx("code",{children:"claude"})," in this folder will show up here."]}):a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"import-select-all",children:[a.jsx("input",{type:"checkbox",checked:N,disabled:m,onChange:()=>g(N?new Set:new Set(_.map(A=>A.session_id)))}),"Select all (",o.length,")"]}),a.jsx("ul",{className:"import-list",children:o.map(A=>{const D=k.get(A.session_id);return a.jsx("li",{children:a.jsxs("label",{className:`import-row${p.has(A.session_id)?" selected":""}`,children:[a.jsx("input",{type:"checkbox",checked:p.has(A.session_id),disabled:m,onChange:()=>T(A.session_id)}),a.jsxs("span",{className:"import-row-main",children:[a.jsx("span",{className:"import-row-title",title:A.title,children:A.title}),a.jsxs("span",{className:"import-row-meta",children:[a.jsx("span",{title:new Date(A.last_modified).toLocaleString(),children:lj(A.last_modified)}),A.git_branch&&a.jsxs("span",{className:"import-row-branch",title:"Git branch",children:[a.jsx(tv,{size:10})," ",A.git_branch]})]}),A.recently_active&&a.jsxs("span",{className:"import-row-warn",children:[a.jsx(uv,{size:11})," Active in the last few minutes. If it is still open in a terminal, close it there first: both would write to the same session."]}),D&&a.jsx("span",{className:"import-row-error",role:"alert",children:D})]})]})},A.session_id)})})]})]}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:S,disabled:m,children:"Cancel"}),a.jsx("button",{className:"dialog-btn-create",onClick:()=>void E(),disabled:W===0||m,children:m?a.jsxs(a.Fragment,{children:[a.jsx(hn,{size:12,className:"spin"})," Importing…"]}):W>1?`Import ${W} sessions`:"Import"})]})]})})}const dj=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,fj=512*1024;function pj(t){const s=t.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(s)?s:""}function hj(){const{appCatalogOpen:t,closeAppCatalog:s,apps:r,installExampleApp:o,createSkeletonApp:l,importAppFolder:u}=I(),[d,p]=x.useState("examples"),[g,m]=x.useState(null),[v,k]=x.useState(null),[y,S]=x.useState(!1),[T,_]=x.useState(""),[N,E]=x.useState(""),[j,W]=x.useState(""),[A,D]=x.useState(""),[G,V]=x.useState(null),[$,te]=x.useState(""),me=x.useRef(null);if(x.useEffect(()=>{t&&(m(null),Iw().then(m).catch(()=>m([])))},[t]),x.useEffect(()=>{me.current&&(me.current.webkitdirectory=!0)},[d]),!t)return null;const de=new Set(r.map(z=>z.id));async function je(z){k(z);try{await o(z)&&s()}finally{k(null)}}async function K(){if(y)return;const z=T.trim(),Q=N.trim();if(!(!z||!Q)){S(!0);try{await l({id:z,title:Q,description:j.trim()||void 0,icon:A.trim()||void 0})&&(_(""),E(""),W(""),D(""),s())}finally{S(!1)}}}async function be(z){const Q=Array.from(z.target.files??[]),q={};let M="";for(const P of Q){const ge=(P.webkitRelativePath??"").split("/");!M&&ge.length>1&&(M=ge[0]);const X=ge[ge.length-1];if(!(!X||!dj.test(X))&&!(P.size>fj))try{q[X]=await P.text()}catch{}}V(Object.keys(q).length>0?q:null),te(pj(M))}async function Z(){if(!(y||!G||!$.trim())){S(!0);try{await u($.trim(),G)&&(V(null),te(""),s())}finally{S(!1)}}}function oe(z){z.key==="Escape"&&s()}const ae=[{key:"examples",label:"Examples"},{key:"new",label:"New App"},{key:"upload",label:"Upload"}];return a.jsx("div",{className:"dialog-overlay",onClick:s,children:a.jsxs("div",{className:"dialog app-catalog",onClick:z=>z.stopPropagation(),onKeyDown:oe,children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",children:"Add Mini App"}),a.jsx("button",{className:"dialog-close",onClick:s,children:"✕"})]}),a.jsx("div",{className:"catalog-tabs",children:ae.map(z=>a.jsx("button",{className:`catalog-tab${d===z.key?" active":""}`,onClick:()=>p(z.key),children:z.label},z.key))}),a.jsxs("div",{className:"dialog-body catalog-body",children:[d==="examples"&&a.jsx("div",{className:"catalog-examples",children:g===null?a.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"Loading examples…"}):g.length===0?a.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"No example apps available."}):g.map(z=>{const Q=de.has(z.id);return a.jsxs("div",{className:"example-row",children:[a.jsx(ji,{iconNode:z.iconNode,size:14,className:"sidebar-app-icon"}),a.jsxs("div",{className:"example-info",children:[a.jsx("span",{className:"example-title",children:z.title}),z.description&&a.jsx("span",{className:"example-desc",children:z.description})]}),a.jsx("button",{className:"example-install",disabled:Q||v===z.id,onClick:()=>je(z.id),title:Q?"Already installed":"Install this example",children:Q?"Installed":v===z.id?"Installing…":"Install"})]},z.id)})}),d==="new"&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"dialog-label",children:["App id (folder name)",a.jsx("input",{className:"dialog-input",type:"text",value:T,onChange:z=>_(z.target.value),placeholder:"e.g. todo-list",autoFocus:!0})]}),a.jsxs("label",{className:"dialog-label",children:["Title",a.jsx("input",{className:"dialog-input",type:"text",value:N,onChange:z=>E(z.target.value),placeholder:"e.g. Todo List"})]}),a.jsxs("label",{className:"dialog-label",children:["Description (optional)",a.jsx("input",{className:"dialog-input",type:"text",value:j,onChange:z=>W(z.target.value),placeholder:"What does this app do?"})]}),a.jsxs("label",{className:"dialog-label",children:[a.jsxs("span",{children:["Icon (optional, a"," ",a.jsx("a",{href:"https://lucide.dev/icons",target:"_blank",rel:"noreferrer",children:"Lucide icon"})," ","name)"]}),a.jsx("input",{className:"dialog-input",type:"text",value:A,onChange:z=>D(z.target.value),placeholder:"e.g. notebook-pen",spellCheck:!1,autoCapitalize:"off"})]}),a.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!T.trim()||!N.trim(),onClick:K,children:[a.jsx(dr,{size:13})," Create App"]})]}),d==="upload"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"catalog-upload-hint",children:"Select an app folder from disk. Text files only (manifest.json, index.html, app.ts (or legacy app.js), …). A missing manifest.json is generated from the folder name."}),a.jsx("input",{ref:me,type:"file",multiple:!0,onChange:be}),G&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"dialog-label",children:["App id",a.jsx("input",{className:"dialog-input",type:"text",value:$,onChange:z=>te(z.target.value)})]}),a.jsxs("div",{className:"catalog-upload-summary",children:[Object.keys(G).length," file(s):"," ",Object.keys(G).slice(0,6).join(", "),Object.keys(G).length>6?", …":""]})]}),a.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!G||!$.trim(),onClick:Z,children:[a.jsx(W1,{size:13})," Import App"]})]})]}),a.jsx("div",{className:"dialog-footer",children:a.jsx("button",{className:"dialog-btn-cancel",onClick:s,children:"Close"})})]})})}function mj(){const t=I(k=>k.showCommandPalette),s=I(k=>k.setShowCommandPalette),r=I(),[o,l]=x.useState(""),[u,d]=x.useState(0),p=x.useRef(null),g=x.useMemo(()=>{const k=r.activeSessionId?r.sessionDetails[r.activeSessionId]:null,y=Dl(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:dr,action:()=>r.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:us,action:()=>{r.activeSessionId&&r.deleteSession(r.activeSessionId)},available:!!r.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:Lo,action:()=>{const S=document.querySelector(".cmd-input");S==null||S.focus()},available:!!r.activeSessionId&&!y},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:Fr,action:()=>r.cancelTurn(),available:y},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:C1,action:()=>r.switchRightTab("turns"),available:!!r.activeSessionId},{id:"tab-sidecar",label:"Ask Sidecar",hint:"Ask about this session — status, blockers, what is left",icon:mr,action:()=>r.switchRightTab("sidecar"),available:!!r.activeSessionId},{id:"toggle-right-panel",label:"Toggle Right Panel",hint:r.rightPanelCollapsed?"Expand the right panel":"Collapse the right panel to its icon rail",icon:D1,action:()=>r.toggleRightPanel(),available:!0},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:Tn,action:()=>{r.activeSessionId&&r.closeTab(r.activeSessionId)},available:!!r.activeSessionId}]},[r]),m=x.useMemo(()=>{const k=o.toLowerCase().trim(),y=g.filter(S=>S.available);return k?y.filter(S=>S.label.toLowerCase().includes(k)||S.hint.toLowerCase().includes(k)):y},[g,o]);x.useEffect(()=>{t&&(l(""),d(0),setTimeout(()=>{var k;return(k=p.current)==null?void 0:k.focus()},50))},[t]);function v(k){if(k.key==="ArrowDown")k.preventDefault(),d(y=>Math.min(y+1,m.length-1));else if(k.key==="ArrowUp")k.preventDefault(),d(y=>Math.max(y-1,0));else if(k.key==="Enter"){k.preventDefault();const y=m[u];y&&(y.action(),s(!1))}else k.key==="Escape"&&s(!1)}return t?a.jsx("div",{className:"palette-overlay",onClick:()=>s(!1),children:a.jsxs("div",{className:"palette",onClick:k=>k.stopPropagation(),children:[a.jsxs("div",{className:"palette-search",children:[a.jsx("input",{ref:p,type:"text",placeholder:"Type a command…",value:o,onChange:k=>{l(k.target.value),d(0)},onKeyDown:v}),a.jsx("span",{className:"palette-esc",children:"ESC"})]}),m.length===0?a.jsx("div",{className:"palette-empty",children:"No matching commands"}):a.jsx("div",{className:"palette-list",children:m.map((k,y)=>{const S=k.icon;return a.jsxs("div",{className:`palette-item ${y===u?"selected":""}`,onClick:()=>{k.action(),s(!1)},onMouseEnter:()=>d(y),children:[a.jsx("span",{className:"palette-item-icon",children:a.jsx(S,{size:16})}),a.jsx("span",{className:"palette-item-label",children:k.label}),a.jsx("span",{className:"palette-item-hint",children:k.hint}),y===u&&a.jsx(g1,{size:12,className:"palette-item-enter"})]},k.id)})}),a.jsxs("div",{className:"palette-footer",children:[a.jsxs("span",{className:"palette-footer-hint",children:[a.jsx("span",{className:"kbd",children:"↑"}),a.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),a.jsxs("span",{className:"palette-footer-hint",children:[a.jsx("span",{className:"kbd",children:"↵"})," Select"]}),a.jsxs("span",{className:"palette-footer-hint",children:[a.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const mg=/^[a-z][a-z0-9-]{1,30}$/,gj=2e3;function vj(){const{showRemoteModal:t,setShowRemoteModal:s,selectSession:r}=I(),[o,l]=x.useState(null),[u,d]=x.useState(null),[p,g]=x.useState(!1),[m,v]=x.useState(!1),[k,y]=x.useState(!1),[S,T]=x.useState(!1),[_,N]=x.useState("main"),[E,j]=x.useState(""),[W,A]=x.useState(!1),[D,G]=x.useState(null),V=x.useRef(null);Do(V,()=>T(!1),S);const $=m||k,te=x.useCallback(async()=>{g(!0),d(null);try{const z=await fetch(`${mn()}/remote/status`,{headers:{Accept:"application/json"}});if(!z.ok)throw new Error(`status ${z.status}`);l(await z.json())}catch{l(null),d("Machine management is only available from this machine's local pane.")}finally{g(!1)}},[]);x.useEffect(()=>{t&&(N("main"),G(null),te())},[t,te]);const me=D!==null&&D.state==="running";if(x.useEffect(()=>{if(!me)return;const z=setInterval(async()=>{try{const Q=await fetch(`${mn()}/remote/enable`,{headers:{Accept:"application/json"}});Q.ok&&G(await Q.json())}catch{}},gj);return()=>clearInterval(z)},[me]),!t)return null;const de=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function je(z){z.key==="Escape"&&s(!1)}async function K(z){if(mg.test(z)){A(!0);try{const Q=await fetch(`${mn()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:z})});if(!Q.ok)throw new Error(`enable ${Q.status}`);G(await Q.json()),N("setup")}catch{d("Could not start the setup — check the daemon logs.")}finally{A(!1)}}}function be(){D!=null&&D.troubleshootingSessionId&&(r(D.troubleshootingSessionId),s(!1))}async function Z(){v(!0);try{await fetch(`${mn()}/remote/disable`,{method:"POST"}),await te()}catch{d("Could not stop the tunnel service — check the service logs.")}finally{v(!1)}}async function oe(){if(T(!1),!!window.confirm(`Remove the tunnel completely?
656
663
 
657
664
  This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
658
665
 
659
- This cannot be undone.`)){y(!0);try{const Q=await fetch(`${mn()}/remote/uninstall`,{method:"DELETE"});if(!Q.ok)throw new Error(`uninstall ${Q.status}`);await te()}catch{d("Could not remove the tunnel — check the daemon logs.")}finally{y(!1)}}}function ae(){if(!D)return a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"dialog-label",children:["Machine name (mahlas)",a.jsx("input",{className:"dialog-input",value:C,onChange:E=>R(E.target.value.toLowerCase()),placeholder:"my-macbook",autoFocus:!0})]}),a.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The machine will be reachable at https://<name>.repoburg.com"}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:()=>N("main"),children:"Back"}),a.jsxs("button",{className:"dialog-btn-create",disabled:!hg.test(C)||H,onClick:()=>void q(C),children:[H?a.jsx(hn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const z=["detect","provision","install","verify","ready"],Q=z.indexOf(D.step),B=D.state==="ready";return a.jsxs(a.Fragment,{children:[D.state==="running"&&a.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[a.jsx(hn,{size:14,className:"spin"})," Setting up the remote tunnel…"]}),D.state==="ready"&&a.jsxs("div",{className:"dialog-label",style:{color:"var(--green)",display:"flex",alignItems:"center",gap:6},children:[a.jsx(Ts,{size:14})," Setup complete — you can close this window."]}),D.state==="ready"&&D.hostname&&a.jsxs("div",{className:"dialog-label",children:["This machine is accessible at"," ",a.jsx("a",{href:`https://${D.hostname}`,target:"_blank",rel:"noreferrer",children:D.hostname})]}),a.jsx("ol",{className:"dialog-label",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:z.map((E,P)=>{const se=B||Q>-1&&P<Q,fe=!B&&P===Q&&D.state==="running";return a.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:se||fe?1:.4,color:se?"var(--green)":void 0},children:[se?a.jsx(Ts,{size:13}):fe?a.jsx(hn,{size:13,className:"spin"}):a.jsx(a1,{size:9,style:{marginLeft:2,marginRight:2}}),E]},E)})}),D.logs.length>0&&a.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:D.logs.slice(-3).map(E=>E.message).join(`
660
- `)}),D.state==="troubleshooting"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:"Setup failed — a troubleshooting session is open and the agent is working on the fix in the background."}),a.jsx("div",{className:"dialog-footer",children:a.jsx("button",{className:"dialog-btn-create",onClick:we,children:"Open troubleshooting session"})})]}),D.state==="failed"&&a.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",D.error]}),a.jsx("div",{className:"dialog-footer",children:a.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void te(),children:"Refresh status"})})]})}return a.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:a.jsxs("div",{className:"dialog",onClick:z=>z.stopPropagation(),onKeyDown:Se,children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",children:"Remote Access"}),a.jsx("button",{className:"dialog-close",onClick:()=>s(!1),children:a.jsx(Tn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[p&&a.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[a.jsx(hn,{size:14,className:"spin"})," Loading machine status…"]}),u&&a.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:u}),_==="setup"?ae():a.jsxs(a.Fragment,{children:[ue&&(o==null?void 0:o.tunnel.hostname)&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"dialog-label",children:["This machine is reachable at"," ",a.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})]}),a.jsxs("div",{style:{position:"relative",display:"flex",marginTop:8},children:[a.jsxs("button",{className:"dialog-btn-cancel",style:{flex:1,borderTopRightRadius:0,borderBottomRightRadius:0},onClick:()=>void Z(),disabled:$,children:[m?a.jsx(hn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Stop tunnel connection"]}),a.jsx("button",{className:"dialog-btn-cancel",style:{width:30,borderLeft:"none",borderTopLeftRadius:0,borderBottomLeftRadius:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:()=>T(z=>!z),disabled:$,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":S,children:k?a.jsx(hn,{size:14,className:"spin"}):a.jsx(Si,{size:14})}),S&&a.jsx("div",{ref:G,className:"ctx-menu",role:"menu",style:{position:"absolute",right:0,top:"calc(100% + 4px)",zIndex:10},children:a.jsxs("div",{className:"ctx-menu-item ctx-danger",role:"menuitem",onClick:()=>void oe(),children:[a.jsx(us,{size:12})," Remove tunnel"]})})]})]}),!ue&&a.jsx(a.Fragment,{children:o!=null&&o.tunnel.provisioned&&o.tunnel.mahlas&&o.tunnel.hostname?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"dialog-label",children:["Tunnel exists as"," ",a.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})," ","but the connection is stopped."]}),a.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>void q(o.tunnel.mahlas),disabled:H,children:[H?a.jsx(hn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):a.jsx(tm,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Resume tunnel connection"]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>N("setup"),children:[a.jsx(tm,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Make this machine remote"]}),a.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The daemon sets everything up and shows the progress here."})]})})]})]})]})})}const fj={success:i1,error:Ll,info:h1,warn:av},pj=4e3;function hj({toast:t}){const s=I(d=>d.removeToast),r=fj[t.type],o=x.useRef(null);x.useEffect(()=>{function d(){o.current=setTimeout(()=>s(t.id),pj)}return d(),()=>{o.current&&clearTimeout(o.current)}},[t.id,s]);function l(){o.current&&(clearTimeout(o.current),o.current=null)}function u(){o.current=setTimeout(()=>s(t.id),2e3)}return a.jsxs("div",{className:`toast toast-${t.type}`,onMouseEnter:l,onMouseLeave:u,children:[a.jsx(r,{size:16}),a.jsx("span",{className:"toast-message",children:t.message}),t.undoAction&&a.jsxs("button",{className:"toast-undo",onClick:()=>{var d;(d=t.undoAction)==null||d.call(t),s(t.id)},children:[a.jsx(L1,{size:12})," ",t.undoLabel||"Undo"]}),a.jsx("button",{className:"toast-close",onClick:()=>s(t.id),children:a.jsx(Tn,{size:14})})]})}function mj(){const t=I(s=>s.toasts);return t.length===0?null:a.jsx("div",{className:"toast-container",children:t.map(s=>a.jsx(hj,{toast:s},s.id))})}function gj(){const[t]=x.useState(dw),[s,r]=x.useState(!1),[o,l]=x.useState(!1),u=x.useRef(void 0);x.useEffect(()=>()=>clearTimeout(u.current),[]);async function d(){await Io(Uh)&&(r(!0),l(!0),clearTimeout(u.current),u.current=setTimeout(()=>r(!1),1500))}return a.jsxs("main",{className:"daemon-download",children:[a.jsx("h1",{className:"daemon-download-title",children:"Repoburg"}),t&&a.jsx("p",{className:"daemon-download-text",children:"Open the Repoburg app to continue."}),a.jsxs("div",{className:"daemon-download-install",children:[t&&a.jsx("p",{className:"daemon-download-label",children:"Not installed? Run this in Terminal:"}),a.jsxs("div",{className:"daemon-download-cmd",onCopy:()=>l(!0),children:[a.jsx("span",{className:"daemon-download-prompt","aria-hidden":"true",children:"$"}),a.jsx("code",{children:Uh}),a.jsx("button",{type:"button",className:`daemon-download-copy${s?" copied":""}`,onClick:()=>void d(),"aria-label":"Copy the install command",title:s?"Copied":"Copy",children:s?a.jsx(Ts,{size:15}):a.jsx(Eo,{size:15})})]}),!t&&a.jsx("p",{className:"daemon-download-meta",children:"Apple Silicon · macOS 13+"})]}),o&&a.jsx("p",{className:"daemon-download-hint",children:"Paste it into Terminal and press Return. Repoburg installs and opens in your menu bar."}),(t||o)&&a.jsxs("p",{className:"daemon-download-waiting",role:"status",children:[a.jsx(hn,{size:13,className:"spin"}),"Waiting for Repoburg to start…"]})]})}let Jn=null,Ti=null,bo=1e3;const vj=1e4;function md(){Jn&&(Jn.readyState===WebSocket.OPEN||Jn.readyState===WebSocket.CONNECTING)||(Jn=new WebSocket(f0("/ws")),Jn.onopen=()=>{const t=bo>1e3;if(bo=1e3,I.getState().setWsConnected(!0),I.getState().addLogEntry("INFO","WebSocket connected"),t){nw();const s=I.getState();s.activeSessionId&&(s.refreshActiveSession(),s.addToast("info","WebSocket reconnected — session state reconciled"))}},Jn.onclose=()=>{I.getState().setWsConnected(!1),I.getState().addLogEntry("WARN","WebSocket disconnected"),I.getState().addToast("warn","WebSocket disconnected — reconnecting…"),xj()},Jn.onerror=()=>{},Jn.onmessage=t=>{try{const s=JSON.parse(t.data);Mt.trackWsEvent(typeof s.event=="string"?s.event:"unknown",typeof t.data=="string"?t.data.length:0);const r=wj[s.event];r&&r(s.data)}catch{}})}function yj(){Ti&&(clearTimeout(Ti),Ti=null),Jn&&(Jn.onclose=null,Jn.close(),Jn=null),I.getState().setWsConnected(!1)}function xj(){Ti||(Ti=window.setTimeout(()=>{Ti=null,md()},bo),bo=Math.min(bo*2,vj))}const wj={"turn:created":t=>{const s=t;I.getState().onTurnCreated(s.sessionId,s.turn)},"turn:started":t=>{const s=t;Mt.note(`turn:started — ${s.turnId.slice(0,8)}`),I.getState().onTurnStarted(s.sessionId,s.turnId)},"item:started":t=>{const s=t;I.getState().onItemStarted(s.sessionId,s.turnId,s.item)},"item:updated":t=>{const s=t;I.getState().onItemUpdated(s.sessionId,s.turnId,s.item)},"item:completed":t=>{const s=t;I.getState().onItemCompleted(s.sessionId,s.turnId,s.item)},"item:delta":t=>{const s=t;I.getState().onItemDelta(s.sessionId,s.turnId,s.itemId,s.delta)},"turn:completed":t=>{const s=t;Mt.note(`turn:completed — ${s.turnId.slice(0,8)}`),I.getState().onTurnCompleted(s.sessionId,s.turnId,s.usage,s.hasUnreviewed,s.response??void 0)},"turn:tokenUsage":t=>{const s=t;I.getState().onTokenUsageUpdated(s.sessionId,s.turnId,s.usage)},"turn:contextUsage":t=>{const s=t,r={totalTokens:s.totalTokens,contextWindow:s.contextWindow,percentage:s.percentage,...s.autoCompactThreshold?{autoCompactThreshold:s.autoCompactThreshold}:{}};I.getState().onContextUsageUpdated(s.sessionId,r)},"turn:failed":t=>{const s=t;I.getState().onTurnFailed(s.sessionId,s.turnId,s.error,s.resumeState)},"turn:interrupted":t=>{const s=t;Mt.note(`turn:interrupted — ${s.turnId.slice(0,8)} (${s.reason})`),I.getState().onTurnInterrupted(s.sessionId,s.turnId,{reason:s.reason,interruptedAt:s.interruptedAt,attempts:s.attempts,detail:s.detail??null,resumeAt:s.resumeAt??null})},"turn:resuming":t=>{const s=t;I.getState().onTurnResuming(s.sessionId,s.turnId,s.attempt)},"turn:resumed":t=>{const s=t;I.getState().onTurnResumed(s.sessionId,s.turnId)},"turn:retrying":t=>{const s=t;I.getState().onTurnRetrying(s.sessionId,s.turnId,{attempt:s.attempt,maxRetries:s.maxRetries,retryDelayMs:s.retryDelayMs,errorStatus:s.errorStatus??null,error:s.error??null})},"turn:cancelled":t=>{const s=t;I.getState().onTurnCancelled(s.sessionId,s.turnId)},"session:title":t=>{const s=t;I.getState().onSessionTitle(s.sessionId,s.title)},"session:touched":t=>{const s=t;I.getState().onSessionTouched(s.sessionId)},"session:updated":t=>{const s=t;I.getState().onSessionUpdated(s.session)},background_tasks:t=>{const s=t;Mt.note(`background_tasks — ${s.tasks.length} live (${s.tasks.map(r=>r.task_type).join(", ")||"none"})`),I.getState().onBackgroundTasksChanged(s.sessionId,s.tasks)},"background_tasks:snapshot":t=>{const s=t;I.getState().onBackgroundTasksSnapshot(s.sessions??{})},"signed_out_turns:snapshot":t=>{const s=t;I.getState().onSignedOutTurnsSnapshot(s.turns??[])},"thread:created":t=>{const s=t;I.getState().onThreadCreated(s.sessionId,s.thread,s.turn)},"thread:followup":t=>{const s=t;I.getState().onThreadFollowup(s.sessionId,s.threadId,s.turn)},"thread:resolved":t=>{const s=t;I.getState().onThreadResolved(s.sessionId,s.threadId,s.status)},"thread:deleted":t=>{const s=t;I.getState().onThreadDeleted(s.sessionId,s.threadId)},"app:tool_call":t=>{const s=t;X0(s.appId,s.callId,s.tool,s.args??{},s.workspace)},"app:source:updated":t=>{sw(t.appId),I.getState().refreshApps()},"app:state_changed":t=>{const{appId:s,...r}=t;Pg(s,r)}};function kj(){const t=I(s=>s.init);return x.useEffect(()=>{u0();function s(){t(),md()}const{daemonStatus:r,setDaemonStatus:o}=I.getState();let l=null;r==="ready"?s():l=pw({onMissing:()=>o("missing"),onReady:()=>{o("ready"),s()}});function u(){if(document.visibilityState!=="visible")return;const d=I.getState(),p=d.activeSessionId;if(!p)return;const g=d.sessionDetails[p];d.wsConnected||md(),g&&g.is_running===1&&(d.refreshActiveSession(),d.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",u),()=>{l==null||l(),yj(),document.removeEventListener("visibilitychange",u)}},[t]),null}const cy="agentpaneView";function gd(t){return{tab:wd(t),vscode:t.vscodeViewOpen,usage:t.usageViewOpen,terminal:t.terminalViewOpen}}function uy(t,s){return t.tab===s.tab&&t.vscode===s.vscode&&t.usage===s.usage&&t.terminal===s.terminal}function mg(t){return t.tab===null&&!t.vscode&&!t.usage&&!t.terminal}function gg(t,s){return s.tab!==null&&!t.tabOrder.includes(s.tab)?!1:!uy(s,gd(t))}function vg(t){const s=t==null?void 0:t[cy];return typeof(s==null?void 0:s.index)!="number"?null:{...s,view:{...s.view,terminal:!!s.view.terminal}}}function Sj(t,s){t.getState().vscodeViewOpen!==s.vscode&&t.getState().toggleVscodeView(),t.getState().usageViewOpen!==s.usage&&t.getState().toggleUsageView(),t.getState().terminalViewOpen!==s.terminal&&t.getState().toggleTerminalView();const r=t.getState();if(s.tab===null)return;const{kind:o,id:l}=fr(s.tab);o==="app"?r.openAppTab(l):r.activeSessionId===l?r.setActiveAppTab(null):r.selectSession(l)}function bj(t){let s=vg(window.history.state)??{index:0,newest:0,view:gd(t.getState())},r=s.newest,o=!1;const l=new Map([[s.index,s.view]]),u=y=>{const S=t.getState();for(let T=s.index+y;T>=0&&T<=r;T+=y){const _=l.get(T);if(!_||gg(S,_))return!0}return!1},d=()=>{const y=u(-1),S=u(1),T=t.getState();(T.canGoBack!==y||T.canGoForward!==S)&&t.setState({canGoBack:y,canGoForward:S})},p=()=>({[cy]:{...s,newest:r}}),g=()=>{window.history.replaceState({...window.history.state,...p()},"")},m=y=>{if(l.set(s.index,s.view),mg(s.view))s={...s,view:y},g();else{s={index:s.index+1,newest:s.index+1,view:y},r=s.index;for(const S of l.keys())S>r&&l.delete(S);window.history.pushState(p(),"")}l.set(s.index,y)},v=y=>{const S=vg(y.state);if(!S)return;l.set(S.index,S.view),r=Math.max(r,S.index);const T=t.getState(),_=Math.sign(S.index-s.index);if(_!==0&&!gg(T,S.view)){const N=S.index+_;window.history.go(N<0||N>r?s.index-S.index:_);return}s=S,g(),o=!0;try{Sj(t,S.view)}finally{o=!1}d()};g(),d(),window.addEventListener("popstate",v);const k=t.subscribe((y,S)=>{const T=y.activeSessionId!==S.activeSessionId||y.activeAppTabId!==S.activeAppTabId||y.vscodeViewOpen!==S.vscodeViewOpen||y.usageViewOpen!==S.usageViewOpen||y.terminalViewOpen!==S.terminalViewOpen;if(!(!T&&y.tabOrder===S.tabOrder)){if(T&&!o){const _=gd(y);!mg(_)&&!uy(_,s.view)&&m(_)}d()}});return()=>{k(),window.removeEventListener("popstate",v)}}function Tj(){const t=I(u=>u.loading),s=I(u=>u.error),r=I(u=>u.sessions),o=I(u=>u.daemonStatus),l=I(u=>u.setShowCommandPalette);return x.useEffect(()=>Mt.start(),[]),x.useEffect(()=>bj(I),[]),x.useEffect(()=>{function u(d){(d.metaKey||d.ctrlKey)&&d.key==="k"&&(d.preventDefault(),l(!0))}return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[l]),a.jsxs(a.Fragment,{children:[a.jsx(kj,{}),o==="missing"?a.jsx(gj,{}):o==="checking"||t&&r.length===0?a.jsx("div",{className:"empty-state",children:"Loading sessions…"}):s&&r.length===0?a.jsxs("div",{className:"empty-state",children:["Error: ",s]}):a.jsxs(a.Fragment,{children:[a.jsx(XN,{}),a.jsx(QN,{}),a.jsx(ej,{}),a.jsx(sj,{}),a.jsx(lj,{}),a.jsx(dj,{}),a.jsx(cj,{}),a.jsx(mj,{})]})]})}Jx.createRoot(document.getElementById("root")).render(a.jsx(ot.StrictMode,{children:a.jsx(Tj,{})}));export{_o as R,Tn as X,f0 as b,ge as c,a as j,x as r,I as u};
666
+ This cannot be undone.`)){y(!0);try{const Q=await fetch(`${mn()}/remote/uninstall`,{method:"DELETE"});if(!Q.ok)throw new Error(`uninstall ${Q.status}`);await te()}catch{d("Could not remove the tunnel — check the daemon logs.")}finally{y(!1)}}}function ae(){if(!D)return a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"dialog-label",children:["Machine name (mahlas)",a.jsx("input",{className:"dialog-input",value:E,onChange:M=>j(M.target.value.toLowerCase()),placeholder:"my-macbook",autoFocus:!0})]}),a.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The machine will be reachable at https://<name>.repoburg.com"}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:()=>N("main"),children:"Back"}),a.jsxs("button",{className:"dialog-btn-create",disabled:!mg.test(E)||W,onClick:()=>void K(E),children:[W?a.jsx(hn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const z=["detect","provision","install","verify","ready"],Q=z.indexOf(D.step),q=D.state==="ready";return a.jsxs(a.Fragment,{children:[D.state==="running"&&a.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[a.jsx(hn,{size:14,className:"spin"})," Setting up the remote tunnel…"]}),D.state==="ready"&&a.jsxs("div",{className:"dialog-label",style:{color:"var(--green)",display:"flex",alignItems:"center",gap:6},children:[a.jsx(Ns,{size:14})," Setup complete — you can close this window."]}),D.state==="ready"&&D.hostname&&a.jsxs("div",{className:"dialog-label",children:["This machine is accessible at"," ",a.jsx("a",{href:`https://${D.hostname}`,target:"_blank",rel:"noreferrer",children:D.hostname})]}),a.jsx("ol",{className:"dialog-label",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:z.map((M,P)=>{const le=q||Q>-1&&P<Q,ge=!q&&P===Q&&D.state==="running";return a.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:le||ge?1:.4,color:le?"var(--green)":void 0},children:[le?a.jsx(Ns,{size:13}):ge?a.jsx(hn,{size:13,className:"spin"}):a.jsx(h1,{size:9,style:{marginLeft:2,marginRight:2}}),M]},M)})}),D.logs.length>0&&a.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:D.logs.slice(-3).map(M=>M.message).join(`
667
+ `)}),D.state==="troubleshooting"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:"Setup failed — a troubleshooting session is open and the agent is working on the fix in the background."}),a.jsx("div",{className:"dialog-footer",children:a.jsx("button",{className:"dialog-btn-create",onClick:be,children:"Open troubleshooting session"})})]}),D.state==="failed"&&a.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",D.error]}),a.jsx("div",{className:"dialog-footer",children:a.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void te(),children:"Refresh status"})})]})}return a.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:a.jsxs("div",{className:"dialog",onClick:z=>z.stopPropagation(),onKeyDown:je,children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",children:"Remote Access"}),a.jsx("button",{className:"dialog-close",onClick:()=>s(!1),children:a.jsx(Tn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[p&&a.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[a.jsx(hn,{size:14,className:"spin"})," Loading machine status…"]}),u&&a.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:u}),_==="setup"?ae():a.jsxs(a.Fragment,{children:[de&&(o==null?void 0:o.tunnel.hostname)&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"dialog-label",children:["This machine is reachable at"," ",a.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})]}),a.jsxs("div",{style:{position:"relative",display:"flex",marginTop:8},children:[a.jsxs("button",{className:"dialog-btn-cancel",style:{flex:1,borderTopRightRadius:0,borderBottomRightRadius:0},onClick:()=>void Z(),disabled:$,children:[m?a.jsx(hn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Stop tunnel connection"]}),a.jsx("button",{className:"dialog-btn-cancel",style:{width:30,borderLeft:"none",borderTopLeftRadius:0,borderBottomLeftRadius:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:()=>T(z=>!z),disabled:$,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":S,children:k?a.jsx(hn,{size:14,className:"spin"}):a.jsx(Si,{size:14})}),S&&a.jsx("div",{ref:V,className:"ctx-menu",role:"menu",style:{position:"absolute",right:0,top:"calc(100% + 4px)",zIndex:10},children:a.jsxs("div",{className:"ctx-menu-item ctx-danger",role:"menuitem",onClick:()=>void oe(),children:[a.jsx(us,{size:12})," Remove tunnel"]})})]})]}),!de&&a.jsx(a.Fragment,{children:o!=null&&o.tunnel.provisioned&&o.tunnel.mahlas&&o.tunnel.hostname?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"dialog-label",children:["Tunnel exists as"," ",a.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})," ","but the connection is stopped."]}),a.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>void K(o.tunnel.mahlas),disabled:W,children:[W?a.jsx(hn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):a.jsx(nm,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Resume tunnel connection"]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>N("setup"),children:[a.jsx(nm,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Make this machine remote"]}),a.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The daemon sets everything up and shows the progress here."})]})})]})]})]})})}const yj={success:f1,error:$l,info:k1,warn:uv},xj=4e3;function wj({toast:t}){const s=I(d=>d.removeToast),r=yj[t.type],o=x.useRef(null);x.useEffect(()=>{function d(){o.current=setTimeout(()=>s(t.id),xj)}return d(),()=>{o.current&&clearTimeout(o.current)}},[t.id,s]);function l(){o.current&&(clearTimeout(o.current),o.current=null)}function u(){o.current=setTimeout(()=>s(t.id),2e3)}return a.jsxs("div",{className:`toast toast-${t.type}`,onMouseEnter:l,onMouseLeave:u,children:[a.jsx(r,{size:16}),a.jsx("span",{className:"toast-message",children:t.message}),t.undoAction&&a.jsxs("button",{className:"toast-undo",onClick:()=>{var d;(d=t.undoAction)==null||d.call(t),s(t.id)},children:[a.jsx(B1,{size:12})," ",t.undoLabel||"Undo"]}),a.jsx("button",{className:"toast-close",onClick:()=>s(t.id),children:a.jsx(Tn,{size:14})})]})}function kj(){const t=I(s=>s.toasts);return t.length===0?null:a.jsx("div",{className:"toast-container",children:t.map(s=>a.jsx(wj,{toast:s},s.id))})}function Sj(){const[t]=x.useState(hw),[s,r]=x.useState(!1),[o,l]=x.useState(!1),u=x.useRef(void 0);x.useEffect(()=>()=>clearTimeout(u.current),[]);async function d(){await Io(Bh)&&(r(!0),l(!0),clearTimeout(u.current),u.current=setTimeout(()=>r(!1),1500))}return a.jsxs("main",{className:"daemon-download",children:[a.jsx("h1",{className:"daemon-download-title",children:"Repoburg"}),t&&a.jsx("p",{className:"daemon-download-text",children:"Open the Repoburg app to continue."}),a.jsxs("div",{className:"daemon-download-install",children:[t&&a.jsx("p",{className:"daemon-download-label",children:"Not installed? Run this in Terminal:"}),a.jsxs("div",{className:"daemon-download-cmd",onCopy:()=>l(!0),children:[a.jsx("span",{className:"daemon-download-prompt","aria-hidden":"true",children:"$"}),a.jsx("code",{children:Bh}),a.jsx("button",{type:"button",className:`daemon-download-copy${s?" copied":""}`,onClick:()=>void d(),"aria-label":"Copy the install command",title:s?"Copied":"Copy",children:s?a.jsx(Ns,{size:15}):a.jsx(Eo,{size:15})})]}),!t&&a.jsx("p",{className:"daemon-download-meta",children:"Apple Silicon · macOS 13+"})]}),o&&a.jsx("p",{className:"daemon-download-hint",children:"Paste it into Terminal and press Return. Repoburg installs and opens in your menu bar."}),(t||o)&&a.jsxs("p",{className:"daemon-download-waiting",role:"status",children:[a.jsx(hn,{size:13,className:"spin"}),"Waiting for Repoburg to start…"]})]})}let Jn=null,Ti=null,bo=1e3;const bj=1e4;function vd(){Jn&&(Jn.readyState===WebSocket.OPEN||Jn.readyState===WebSocket.CONNECTING)||(Jn=new WebSocket(g0("/ws")),Jn.onopen=()=>{const t=bo>1e3;if(bo=1e3,I.getState().setWsConnected(!0),I.getState().addLogEntry("INFO","WebSocket connected"),t){ow();const s=I.getState();s.activeSessionId&&(s.refreshActiveSession(),s.addToast("info","WebSocket reconnected — session state reconciled"))}},Jn.onclose=()=>{I.getState().setWsConnected(!1),I.getState().addLogEntry("WARN","WebSocket disconnected"),I.getState().addToast("warn","WebSocket disconnected — reconnecting…"),Nj()},Jn.onerror=()=>{},Jn.onmessage=t=>{try{const s=JSON.parse(t.data);Mt.trackWsEvent(typeof s.event=="string"?s.event:"unknown",typeof t.data=="string"?t.data.length:0);const r=jj[s.event];r&&r(s.data)}catch{}})}function Tj(){Ti&&(clearTimeout(Ti),Ti=null),Jn&&(Jn.onclose=null,Jn.close(),Jn=null),I.getState().setWsConnected(!1)}function Nj(){Ti||(Ti=window.setTimeout(()=>{Ti=null,vd()},bo),bo=Math.min(bo*2,bj))}const jj={"turn:created":t=>{const s=t;I.getState().onTurnCreated(s.sessionId,s.turn)},"turn:started":t=>{const s=t;Mt.note(`turn:started — ${s.turnId.slice(0,8)}`),I.getState().onTurnStarted(s.sessionId,s.turnId)},"item:started":t=>{const s=t;I.getState().onItemStarted(s.sessionId,s.turnId,s.item)},"item:updated":t=>{const s=t;I.getState().onItemUpdated(s.sessionId,s.turnId,s.item)},"item:completed":t=>{const s=t;I.getState().onItemCompleted(s.sessionId,s.turnId,s.item)},"item:delta":t=>{const s=t;I.getState().onItemDelta(s.sessionId,s.turnId,s.itemId,s.delta)},"turn:completed":t=>{const s=t;Mt.note(`turn:completed — ${s.turnId.slice(0,8)}`),I.getState().onTurnCompleted(s.sessionId,s.turnId,s.usage,s.hasUnreviewed,s.response??void 0)},"turn:tokenUsage":t=>{const s=t;I.getState().onTokenUsageUpdated(s.sessionId,s.turnId,s.usage)},"turn:contextUsage":t=>{const s=t,r={totalTokens:s.totalTokens,contextWindow:s.contextWindow,percentage:s.percentage,...s.autoCompactThreshold?{autoCompactThreshold:s.autoCompactThreshold}:{}};I.getState().onContextUsageUpdated(s.sessionId,r)},"turn:failed":t=>{const s=t;I.getState().onTurnFailed(s.sessionId,s.turnId,s.error,s.resumeState)},"turn:interrupted":t=>{const s=t;Mt.note(`turn:interrupted — ${s.turnId.slice(0,8)} (${s.reason})`),I.getState().onTurnInterrupted(s.sessionId,s.turnId,{reason:s.reason,interruptedAt:s.interruptedAt,attempts:s.attempts,detail:s.detail??null,resumeAt:s.resumeAt??null})},"turn:resuming":t=>{const s=t;I.getState().onTurnResuming(s.sessionId,s.turnId,s.attempt)},"turn:resumed":t=>{const s=t;I.getState().onTurnResumed(s.sessionId,s.turnId)},"turn:retrying":t=>{const s=t;I.getState().onTurnRetrying(s.sessionId,s.turnId,{attempt:s.attempt,maxRetries:s.maxRetries,retryDelayMs:s.retryDelayMs,errorStatus:s.errorStatus??null,error:s.error??null})},"turn:cancelled":t=>{const s=t;I.getState().onTurnCancelled(s.sessionId,s.turnId)},"session:title":t=>{const s=t;I.getState().onSessionTitle(s.sessionId,s.title)},"session:touched":t=>{const s=t;I.getState().onSessionTouched(s.sessionId)},"session:created":t=>{const{session:s}=t;s.origin_app_id&&sl(s.id,s.origin_app_id),I.getState().addSession(s)},"session:updated":t=>{const s=t;I.getState().onSessionUpdated(s.session)},background_tasks:t=>{const s=t;Mt.note(`background_tasks — ${s.tasks.length} live (${s.tasks.map(r=>r.task_type).join(", ")||"none"})`),I.getState().onBackgroundTasksChanged(s.sessionId,s.tasks)},"background_tasks:snapshot":t=>{const s=t;I.getState().onBackgroundTasksSnapshot(s.sessions??{})},"signed_out_turns:snapshot":t=>{const s=t;I.getState().onSignedOutTurnsSnapshot(s.turns??[])},"thread:created":t=>{const s=t;I.getState().onThreadCreated(s.sessionId,s.thread,s.turn)},"thread:followup":t=>{const s=t;I.getState().onThreadFollowup(s.sessionId,s.threadId,s.turn)},"thread:resolved":t=>{const s=t;I.getState().onThreadResolved(s.sessionId,s.threadId,s.status)},"thread:deleted":t=>{const s=t;I.getState().onThreadDeleted(s.sessionId,s.threadId)},"app:tool_call":t=>{const s=t;ew(s.appId,s.callId,s.tool,s.args??{},s.workspace,s.caller)},"app:source:updated":t=>{aw(t.appId),I.getState().refreshApps()},"app:state_changed":t=>{const{appId:s,...r}=t;zg(s,r)}};function Cj(){const t=I(s=>s.init);return x.useEffect(()=>{h0();function s(){t(),vd()}const{daemonStatus:r,setDaemonStatus:o}=I.getState();let l=null;r==="ready"?s():l=gw({onMissing:()=>o("missing"),onReady:()=>{o("ready"),s()}});function u(){if(document.visibilityState!=="visible")return;const d=I.getState(),p=d.activeSessionId;if(!p)return;const g=d.sessionDetails[p];d.wsConnected||vd(),g&&g.is_running===1&&(d.refreshActiveSession(),d.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",u),()=>{l==null||l(),Tj(),document.removeEventListener("visibilitychange",u)}},[t]),null}const py="agentpaneView";function yd(t){return{tab:kd(t),vscode:t.vscodeViewOpen,usage:t.usageViewOpen,terminal:t.terminalViewOpen}}function hy(t,s){return t.tab===s.tab&&t.vscode===s.vscode&&t.usage===s.usage&&t.terminal===s.terminal}function gg(t){return t.tab===null&&!t.vscode&&!t.usage&&!t.terminal}function vg(t,s){return s.tab!==null&&!t.tabOrder.includes(s.tab)?!1:!hy(s,yd(t))}function yg(t){const s=t==null?void 0:t[py];return typeof(s==null?void 0:s.index)!="number"?null:{...s,view:{...s.view,terminal:!!s.view.terminal}}}function Ej(t,s){t.getState().vscodeViewOpen!==s.vscode&&t.getState().toggleVscodeView(),t.getState().usageViewOpen!==s.usage&&t.getState().toggleUsageView(),t.getState().terminalViewOpen!==s.terminal&&t.getState().toggleTerminalView();const r=t.getState();if(s.tab===null)return;const{kind:o,id:l}=fr(s.tab);o==="app"?r.openAppTab(l):r.activeSessionId===l?r.setActiveAppTab(null):r.selectSession(l)}function _j(t){let s=yg(window.history.state)??{index:0,newest:0,view:yd(t.getState())},r=s.newest,o=!1;const l=new Map([[s.index,s.view]]),u=y=>{const S=t.getState();for(let T=s.index+y;T>=0&&T<=r;T+=y){const _=l.get(T);if(!_||vg(S,_))return!0}return!1},d=()=>{const y=u(-1),S=u(1),T=t.getState();(T.canGoBack!==y||T.canGoForward!==S)&&t.setState({canGoBack:y,canGoForward:S})},p=()=>({[py]:{...s,newest:r}}),g=()=>{window.history.replaceState({...window.history.state,...p()},"")},m=y=>{if(l.set(s.index,s.view),gg(s.view))s={...s,view:y},g();else{s={index:s.index+1,newest:s.index+1,view:y},r=s.index;for(const S of l.keys())S>r&&l.delete(S);window.history.pushState(p(),"")}l.set(s.index,y)},v=y=>{const S=yg(y.state);if(!S)return;l.set(S.index,S.view),r=Math.max(r,S.index);const T=t.getState(),_=Math.sign(S.index-s.index);if(_!==0&&!vg(T,S.view)){const N=S.index+_;window.history.go(N<0||N>r?s.index-S.index:_);return}s=S,g(),o=!0;try{Ej(t,S.view)}finally{o=!1}d()};g(),d(),window.addEventListener("popstate",v);const k=t.subscribe((y,S)=>{const T=y.activeSessionId!==S.activeSessionId||y.activeAppTabId!==S.activeAppTabId||y.vscodeViewOpen!==S.vscodeViewOpen||y.usageViewOpen!==S.usageViewOpen||y.terminalViewOpen!==S.terminalViewOpen;if(!(!T&&y.tabOrder===S.tabOrder)){if(T&&!o){const _=yd(y);!gg(_)&&!hy(_,s.view)&&m(_)}d()}});return()=>{k(),window.removeEventListener("popstate",v)}}function Rj(){const t=I(u=>u.loading),s=I(u=>u.error),r=I(u=>u.sessions),o=I(u=>u.daemonStatus),l=I(u=>u.setShowCommandPalette);return x.useEffect(()=>Mt.start(),[]),x.useEffect(()=>_j(I),[]),x.useEffect(()=>{function u(d){(d.metaKey||d.ctrlKey)&&d.key==="k"&&(d.preventDefault(),l(!0))}return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[l]),a.jsxs(a.Fragment,{children:[a.jsx(Cj,{}),o==="missing"?a.jsx(Sj,{}):o==="checking"||t&&r.length===0?a.jsx("div",{className:"empty-state",children:"Loading sessions…"}):s&&r.length===0?a.jsxs("div",{className:"empty-state",children:["Error: ",s]}):a.jsxs(a.Fragment,{children:[a.jsx(nj,{}),a.jsx(sj,{}),a.jsx(oj,{}),a.jsx(cj,{}),a.jsx(hj,{}),a.jsx(vj,{}),a.jsx(mj,{}),a.jsx(kj,{})]})]})}s0.createRoot(document.getElementById("root")).render(a.jsx(lt.StrictMode,{children:a.jsx(Rj,{})}));export{_o as R,Tn as X,g0 as b,ye as c,a as j,x as r,I as u};