vibe-replay 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/viewer.html +75 -70
- package/dist/index.js +1546 -611
- package/package.json +1 -1
package/assets/viewer.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
6
6
|
<title>vibe-replay</title>
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
8
|
-
<script type="module" crossorigin>(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const m of u)if(m.type==="childList")for(const p of m.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function i(u){const m={};return u.integrity&&(m.integrity=u.integrity),u.referrerPolicy&&(m.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?m.credentials="include":u.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(u){if(u.ep)return;u.ep=!0;const m=i(u);fetch(u.href,m)}})();function
|
|
8
|
+
<script type="module" crossorigin>(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const m of u)if(m.type==="childList")for(const p of m.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function i(u){const m={};return u.integrity&&(m.integrity=u.integrity),u.referrerPolicy&&(m.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?m.credentials="include":u.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(u){if(u.ep)return;u.ep=!0;const m=i(u);fetch(u.href,m)}})();function Rh(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Qc={exports:{}},Ls={};/**
|
|
9
9
|
* @license React
|
|
10
10
|
* react-jsx-runtime.production.js
|
|
11
11
|
*
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the MIT license found in the
|
|
15
15
|
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/var
|
|
16
|
+
*/var Gp;function Lb(){if(Gp)return Ls;Gp=1;var l=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(o,u,m){var p=null;if(m!==void 0&&(p=""+m),u.key!==void 0&&(p=""+u.key),"key"in u){m={};for(var g in u)g!=="key"&&(m[g]=u[g])}else m=u;return u=m.ref,{$$typeof:l,type:o,key:p,ref:u!==void 0?u:null,props:m}}return Ls.Fragment=r,Ls.jsx=i,Ls.jsxs=i,Ls}var qp;function zb(){return qp||(qp=1,Qc.exports=Lb()),Qc.exports}var n=zb(),Xc={exports:{}},Ce={};/**
|
|
17
17
|
* @license React
|
|
18
18
|
* react.production.js
|
|
19
19
|
*
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*
|
|
22
22
|
* This source code is licensed under the MIT license found in the
|
|
23
23
|
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/var
|
|
24
|
+
*/var Yp;function Bb(){if(Yp)return Ce;Yp=1;var l=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),p=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),C=Symbol.iterator;function j(T){return T===null||typeof T!="object"?null:(T=C&&T[C]||T["@@iterator"],typeof T=="function"?T:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,k={};function E(T,_,V){this.props=T,this.context=_,this.refs=k,this.updater=V||w}E.prototype.isReactComponent={},E.prototype.setState=function(T,_){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,_,"setState")},E.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function M(){}M.prototype=E.prototype;function A(T,_,V){this.props=T,this.context=_,this.refs=k,this.updater=V||w}var R=A.prototype=new M;R.constructor=A,S(R,E.prototype),R.isPureReactComponent=!0;var O=Array.isArray;function $(){}var H={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function ae(T,_,V){var J=V.ref;return{$$typeof:l,type:T,key:_,ref:J!==void 0?J:null,props:V}}function ue(T,_){return ae(T.type,_,T.props)}function oe(T){return typeof T=="object"&&T!==null&&T.$$typeof===l}function te(T){var _={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(V){return _[V]})}var xe=/\/+/g;function de(T,_){return typeof T=="object"&&T!==null&&T.key!=null?te(""+T.key):_.toString(36)}function pe(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then($,$):(T.status="pending",T.then(function(_){T.status==="pending"&&(T.status="fulfilled",T.value=_)},function(_){T.status==="pending"&&(T.status="rejected",T.reason=_)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function U(T,_,V,J,P){var he=typeof T;(he==="undefined"||he==="boolean")&&(T=null);var G=!1;if(T===null)G=!0;else switch(he){case"bigint":case"string":case"number":G=!0;break;case"object":switch(T.$$typeof){case l:case r:G=!0;break;case h:return G=T._init,U(G(T._payload),_,V,J,P)}}if(G)return P=P(T),G=J===""?"."+de(T,0):J,O(P)?(V="",G!=null&&(V=G.replace(xe,"$&/")+"/"),U(P,_,V,"",function(be){return be})):P!=null&&(oe(P)&&(P=ue(P,V+(P.key==null||T&&T.key===P.key?"":(""+P.key).replace(xe,"$&/")+"/")+G)),_.push(P)),1;G=0;var F=J===""?".":J+":";if(O(T))for(var me=0;me<T.length;me++)J=T[me],he=F+de(J,me),G+=U(J,_,V,he,P);else if(me=j(T),typeof me=="function")for(T=me.call(T),me=0;!(J=T.next()).done;)J=J.value,he=F+de(J,me++),G+=U(J,_,V,he,P);else if(he==="object"){if(typeof T.then=="function")return U(pe(T),_,V,J,P);throw _=String(T),Error("Objects are not valid as a React child (found: "+(_==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":_)+"). If you meant to render a collection of children, use an array instead.")}return G}function z(T,_,V){if(T==null)return T;var J=[],P=0;return U(T,J,"","",function(he){return _.call(V,he,P++)}),J}function Q(T){if(T._status===-1){var _=T._result;_=_(),_.then(function(V){(T._status===0||T._status===-1)&&(T._status=1,T._result=V)},function(V){(T._status===0||T._status===-1)&&(T._status=2,T._result=V)}),T._status===-1&&(T._status=0,T._result=_)}if(T._status===1)return T._result.default;throw T._result}var ne=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var _=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(_))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},W={map:z,forEach:function(T,_,V){z(T,function(){_.apply(this,arguments)},V)},count:function(T){var _=0;return z(T,function(){_++}),_},toArray:function(T){return z(T,function(_){return _})||[]},only:function(T){if(!oe(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return Ce.Activity=v,Ce.Children=W,Ce.Component=E,Ce.Fragment=i,Ce.Profiler=u,Ce.PureComponent=A,Ce.StrictMode=o,Ce.Suspense=f,Ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,Ce.__COMPILER_RUNTIME={__proto__:null,c:function(T){return H.H.useMemoCache(T)}},Ce.cache=function(T){return function(){return T.apply(null,arguments)}},Ce.cacheSignal=function(){return null},Ce.cloneElement=function(T,_,V){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var J=S({},T.props),P=T.key;if(_!=null)for(he in _.key!==void 0&&(P=""+_.key),_)!K.call(_,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&_.ref===void 0||(J[he]=_[he]);var he=arguments.length-2;if(he===1)J.children=V;else if(1<he){for(var G=Array(he),F=0;F<he;F++)G[F]=arguments[F+2];J.children=G}return ae(T.type,P,J)},Ce.createContext=function(T){return T={$$typeof:p,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:m,_context:T},T},Ce.createElement=function(T,_,V){var J,P={},he=null;if(_!=null)for(J in _.key!==void 0&&(he=""+_.key),_)K.call(_,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(P[J]=_[J]);var G=arguments.length-2;if(G===1)P.children=V;else if(1<G){for(var F=Array(G),me=0;me<G;me++)F[me]=arguments[me+2];P.children=F}if(T&&T.defaultProps)for(J in G=T.defaultProps,G)P[J]===void 0&&(P[J]=G[J]);return ae(T,he,P)},Ce.createRef=function(){return{current:null}},Ce.forwardRef=function(T){return{$$typeof:g,render:T}},Ce.isValidElement=oe,Ce.lazy=function(T){return{$$typeof:h,_payload:{_status:-1,_result:T},_init:Q}},Ce.memo=function(T,_){return{$$typeof:x,type:T,compare:_===void 0?null:_}},Ce.startTransition=function(T){var _=H.T,V={};H.T=V;try{var J=T(),P=H.S;P!==null&&P(V,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then($,ne)}catch(he){ne(he)}finally{_!==null&&V.types!==null&&(_.types=V.types),H.T=_}},Ce.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},Ce.use=function(T){return H.H.use(T)},Ce.useActionState=function(T,_,V){return H.H.useActionState(T,_,V)},Ce.useCallback=function(T,_){return H.H.useCallback(T,_)},Ce.useContext=function(T){return H.H.useContext(T)},Ce.useDebugValue=function(){},Ce.useDeferredValue=function(T,_){return H.H.useDeferredValue(T,_)},Ce.useEffect=function(T,_){return H.H.useEffect(T,_)},Ce.useEffectEvent=function(T){return H.H.useEffectEvent(T)},Ce.useId=function(){return H.H.useId()},Ce.useImperativeHandle=function(T,_,V){return H.H.useImperativeHandle(T,_,V)},Ce.useInsertionEffect=function(T,_){return H.H.useInsertionEffect(T,_)},Ce.useLayoutEffect=function(T,_){return H.H.useLayoutEffect(T,_)},Ce.useMemo=function(T,_){return H.H.useMemo(T,_)},Ce.useOptimistic=function(T,_){return H.H.useOptimistic(T,_)},Ce.useReducer=function(T,_,V){return H.H.useReducer(T,_,V)},Ce.useRef=function(T){return H.H.useRef(T)},Ce.useState=function(T){return H.H.useState(T)},Ce.useSyncExternalStore=function(T,_,V){return H.H.useSyncExternalStore(T,_,V)},Ce.useTransition=function(){return H.H.useTransition()},Ce.version="19.2.4",Ce}var Fp;function Eu(){return Fp||(Fp=1,Xc.exports=Bb()),Xc.exports}var y=Eu();const $b=Rh(y);var Ic={exports:{}},zs={},Jc={exports:{}},Kc={};/**
|
|
25
25
|
* @license React
|
|
26
26
|
* scheduler.production.js
|
|
27
27
|
*
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
*
|
|
30
30
|
* This source code is licensed under the MIT license found in the
|
|
31
31
|
* LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/var
|
|
32
|
+
*/var Zp;function Ub(){return Zp||(Zp=1,(function(l){function r(U,z){var Q=U.length;U.push(z);e:for(;0<Q;){var ne=Q-1>>>1,W=U[ne];if(0<u(W,z))U[ne]=z,U[Q]=W,Q=ne;else break e}}function i(U){return U.length===0?null:U[0]}function o(U){if(U.length===0)return null;var z=U[0],Q=U.pop();if(Q!==z){U[0]=Q;e:for(var ne=0,W=U.length,T=W>>>1;ne<T;){var _=2*(ne+1)-1,V=U[_],J=_+1,P=U[J];if(0>u(V,Q))J<W&&0>u(P,V)?(U[ne]=P,U[J]=Q,ne=J):(U[ne]=V,U[_]=Q,ne=_);else if(J<W&&0>u(P,Q))U[ne]=P,U[J]=Q,ne=J;else break e}}return z}function u(U,z){var Q=U.sortIndex-z.sortIndex;return Q!==0?Q:U.id-z.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;l.unstable_now=function(){return m.now()}}else{var p=Date,g=p.now();l.unstable_now=function(){return p.now()-g}}var f=[],x=[],h=1,v=null,C=3,j=!1,w=!1,S=!1,k=!1,E=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function R(U){for(var z=i(x);z!==null;){if(z.callback===null)o(x);else if(z.startTime<=U)o(x),z.sortIndex=z.expirationTime,r(f,z);else break;z=i(x)}}function O(U){if(S=!1,R(U),!w)if(i(f)!==null)w=!0,$||($=!0,te());else{var z=i(x);z!==null&&pe(O,z.startTime-U)}}var $=!1,H=-1,K=5,ae=-1;function ue(){return k?!0:!(l.unstable_now()-ae<K)}function oe(){if(k=!1,$){var U=l.unstable_now();ae=U;var z=!0;try{e:{w=!1,S&&(S=!1,M(H),H=-1),j=!0;var Q=C;try{t:{for(R(U),v=i(f);v!==null&&!(v.expirationTime>U&&ue());){var ne=v.callback;if(typeof ne=="function"){v.callback=null,C=v.priorityLevel;var W=ne(v.expirationTime<=U);if(U=l.unstable_now(),typeof W=="function"){v.callback=W,R(U),z=!0;break t}v===i(f)&&o(f),R(U)}else o(f);v=i(f)}if(v!==null)z=!0;else{var T=i(x);T!==null&&pe(O,T.startTime-U),z=!1}}break e}finally{v=null,C=Q,j=!1}z=void 0}}finally{z?te():$=!1}}}var te;if(typeof A=="function")te=function(){A(oe)};else if(typeof MessageChannel<"u"){var xe=new MessageChannel,de=xe.port2;xe.port1.onmessage=oe,te=function(){de.postMessage(null)}}else te=function(){E(oe,0)};function pe(U,z){H=E(function(){U(l.unstable_now())},z)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(U){U.callback=null},l.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<U?Math.floor(1e3/U):5},l.unstable_getCurrentPriorityLevel=function(){return C},l.unstable_next=function(U){switch(C){case 1:case 2:case 3:var z=3;break;default:z=C}var Q=C;C=z;try{return U()}finally{C=Q}},l.unstable_requestPaint=function(){k=!0},l.unstable_runWithPriority=function(U,z){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var Q=C;C=U;try{return z()}finally{C=Q}},l.unstable_scheduleCallback=function(U,z,Q){var ne=l.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?ne+Q:ne):Q=ne,U){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=Q+W,U={id:h++,callback:z,priorityLevel:U,startTime:Q,expirationTime:W,sortIndex:-1},Q>ne?(U.sortIndex=Q,r(x,U),i(f)===null&&U===i(x)&&(S?(M(H),H=-1):S=!0,pe(O,Q-ne))):(U.sortIndex=W,r(f,U),w||j||(w=!0,$||($=!0,te()))),U},l.unstable_shouldYield=ue,l.unstable_wrapCallback=function(U){var z=C;return function(){var Q=C;C=z;try{return U.apply(this,arguments)}finally{C=Q}}}})(Kc)),Kc}var Vp;function Hb(){return Vp||(Vp=1,Jc.exports=Ub()),Jc.exports}var Pc={exports:{}},zt={};/**
|
|
33
33
|
* @license React
|
|
34
34
|
* react-dom.production.js
|
|
35
35
|
*
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
*
|
|
38
38
|
* This source code is licensed under the MIT license found in the
|
|
39
39
|
* LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/var
|
|
40
|
+
*/var Qp;function Gb(){if(Qp)return zt;Qp=1;var l=Eu();function r(f){var x="https://react.dev/errors/"+f;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)x+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+f+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var o={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},u=Symbol.for("react.portal");function m(f,x,h){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:v==null?null:""+v,children:f,containerInfo:x,implementation:h}}var p=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(f,x){if(f==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,zt.createPortal=function(f,x){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(r(299));return m(f,x,null,h)},zt.flushSync=function(f){var x=p.T,h=o.p;try{if(p.T=null,o.p=2,f)return f()}finally{p.T=x,o.p=h,o.d.f()}},zt.preconnect=function(f,x){typeof f=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,o.d.C(f,x))},zt.prefetchDNS=function(f){typeof f=="string"&&o.d.D(f)},zt.preinit=function(f,x){if(typeof f=="string"&&x&&typeof x.as=="string"){var h=x.as,v=g(h,x.crossOrigin),C=typeof x.integrity=="string"?x.integrity:void 0,j=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;h==="style"?o.d.S(f,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:v,integrity:C,fetchPriority:j}):h==="script"&&o.d.X(f,{crossOrigin:v,integrity:C,fetchPriority:j,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},zt.preinitModule=function(f,x){if(typeof f=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var h=g(x.as,x.crossOrigin);o.d.M(f,{crossOrigin:h,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&o.d.M(f)},zt.preload=function(f,x){if(typeof f=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var h=x.as,v=g(h,x.crossOrigin);o.d.L(f,h,{crossOrigin:v,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},zt.preloadModule=function(f,x){if(typeof f=="string")if(x){var h=g(x.as,x.crossOrigin);o.d.m(f,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:h,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else o.d.m(f)},zt.requestFormReset=function(f){o.d.r(f)},zt.unstable_batchedUpdates=function(f,x){return f(x)},zt.useFormState=function(f,x,h){return p.H.useFormState(f,x,h)},zt.useFormStatus=function(){return p.H.useHostTransitionStatus()},zt.version="19.2.4",zt}var Xp;function Mh(){if(Xp)return Pc.exports;Xp=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(r){console.error(r)}}return l(),Pc.exports=Gb(),Pc.exports}/**
|
|
41
41
|
* @license React
|
|
42
42
|
* react-dom-client.production.js
|
|
43
43
|
*
|
|
@@ -45,69 +45,72 @@
|
|
|
45
45
|
*
|
|
46
46
|
* This source code is licensed under the MIT license found in the
|
|
47
47
|
* LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/var
|
|
49
|
-
at`)?" (<anonymous>)":-1<
|
|
50
|
-
`+
|
|
51
|
-
`),Y=
|
|
52
|
-
`);for(c=s=0;s<
|
|
53
|
-
`+
|
|
48
|
+
*/var Ip;function qb(){if(Ip)return zs;Ip=1;var l=Hb(),r=Eu(),i=Mh();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function p(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(m(e)!==e)throw Error(o(188))}function x(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(o(188));return t!==e?null:e}for(var a=e,s=t;;){var c=a.return;if(c===null)break;var d=c.alternate;if(d===null){if(s=c.return,s!==null){a=s;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===a)return f(c),e;if(d===s)return f(c),t;d=d.sibling}throw Error(o(188))}if(a.return!==s.return)a=c,s=d;else{for(var b=!1,N=c.child;N;){if(N===a){b=!0,a=c,s=d;break}if(N===s){b=!0,s=c,a=d;break}N=N.sibling}if(!b){for(N=d.child;N;){if(N===a){b=!0,a=d,s=c;break}if(N===s){b=!0,s=d,a=c;break}N=N.sibling}if(!b)throw Error(o(189))}}if(a.alternate!==s)throw Error(o(190))}if(a.tag!==3)throw Error(o(188));return a.stateNode.current===a?e:t}function h(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=h(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,C=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),ue=Symbol.for("react.memo_cache_sentinel"),oe=Symbol.iterator;function te(e){return e===null||typeof e!="object"?null:(e=oe&&e[oe]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Symbol.for("react.client.reference");function de(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===xe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case E:return"Profiler";case k:return"StrictMode";case O:return"Suspense";case $:return"SuspenseList";case ae:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case A:return e.displayName||"Context";case M:return(e._context.displayName||"Context")+".Consumer";case R:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return t=e.displayName||null,t!==null?t:de(e.type)||"Memo";case K:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}var pe=Array.isArray,U=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},ne=[],W=-1;function T(e){return{current:e}}function _(e){0>W||(e.current=ne[W],ne[W]=null,W--)}function V(e,t){W++,ne[W]=e.current,e.current=t}var J=T(null),P=T(null),he=T(null),G=T(null);function F(e,t){switch(V(he,t),V(P,e),V(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}_(J),V(J,e)}function me(){_(J),_(P),_(he)}function be(e){e.memoizedState!==null&&V(G,e);var t=J.current,a=dp(t,e.type);t!==a&&(V(P,e),V(J,a))}function Qe(e){P.current===e&&(_(J),_(P)),G.current===e&&(_(G),Ms._currentValue=Q)}var lt,Ct;function Fe(e){if(lt===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);lt=t&&t[1]||"",Ct=-1<a.stack.indexOf(`
|
|
49
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
50
|
+
`+lt+e+Ct}var it=!1;function Bt(e,t){if(!e||it)return"";it=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(X){var Z=X}Reflect.construct(e,[],se)}else{try{se.call()}catch(X){Z=X}e.call(se.prototype)}}else{try{throw Error()}catch(X){Z=X}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(X){if(X&&Z&&typeof X.stack=="string")return[X.stack,Z.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=s.DetermineComponentFrameRoot(),b=d[0],N=d[1];if(b&&N){var D=b.split(`
|
|
51
|
+
`),Y=N.split(`
|
|
52
|
+
`);for(c=s=0;s<D.length&&!D[s].includes("DetermineComponentFrameRoot");)s++;for(;c<Y.length&&!Y[c].includes("DetermineComponentFrameRoot");)c++;if(s===D.length||c===Y.length)for(s=D.length-1,c=Y.length-1;1<=s&&0<=c&&D[s]!==Y[c];)c--;for(;1<=s&&0<=c;s--,c--)if(D[s]!==Y[c]){if(s!==1||c!==1)do if(s--,c--,0>c||D[s]!==Y[c]){var ee=`
|
|
53
|
+
`+D[s].replace(" at new "," at ");return e.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",e.displayName)),ee}while(1<=s&&0<=c);break}}}finally{it=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Fe(a):""}function kn(e,t){switch(e.tag){case 26:case 27:case 5:return Fe(e.type);case 16:return Fe("Lazy");case 13:return e.child!==t&&t!==null?Fe("Suspense Fallback"):Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 15:return Bt(e.type,!1);case 11:return Bt(e.type.render,!1);case 1:return Bt(e.type,!0);case 31:return Fe("Activity");default:return""}}function qt(e){try{var t="",a=null;do t+=kn(e,a),a=e,e=e.return;while(e);return t}catch(s){return`
|
|
54
54
|
Error generating stack: `+s.message+`
|
|
55
|
-
`+s.stack}}var pt=Object.prototype.hasOwnProperty,Lt=l.unstable_scheduleCallback,zt=l.unstable_cancelCallback,Bt=l.unstable_shouldYield,mn=l.unstable_requestPaint,$e=l.unstable_now,Tn=l.unstable_getCurrentPriorityLevel,fn=l.unstable_ImmediatePriority,St=l.unstable_UserBlockingPriority,G=l.unstable_NormalPriority,je=l.unstable_LowPriority,Ee=l.unstable_IdlePriority,J=l.log,K=l.unstable_setDisableYieldValue,ue=null,ge=null;function ye(e){if(typeof J=="function"&&K(e),ge&&typeof ge.setStrictMode=="function")try{ge.setStrictMode(ue,e)}catch{}}var Re=Math.clz32?Math.clz32:it,tt=Math.log,qe=Math.LN2;function it(e){return e>>>=0,e===0?32:31-(tt(e)/qe|0)|0}var kt=256,Zt=262144,Xt=4194304;function yn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ya(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var c=0,d=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var w=s&134217727;return w!==0?(s=w&~d,s!==0?c=yn(s):(h&=w,h!==0?c=yn(h):n||(n=w&~e,n!==0&&(c=yn(n))))):(w=s&~d,w!==0?c=yn(w):h!==0?c=yn(h):n||(n=s&~e,n!==0&&(c=yn(n)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,n=t&-t,d>=n||d===32&&(n&4194048)!==0)?t:c}function Vn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Us(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $u(){var e=Xt;return Xt<<=1,(Xt&62914560)===0&&(Xt=4194304),e}function Ci(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ol(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dx(e,t,n,s,c,d){var h=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var w=e.entanglements,R=e.expirationTimes,Y=e.hiddenUpdates;for(n=h&~n;0<n;){var ne=31-Re(n),re=1<<ne;w[ne]=0,R[ne]=-1;var X=Y[ne];if(X!==null)for(Y[ne]=null,ne=0;ne<X.length;ne++){var Q=X[ne];Q!==null&&(Q.lane&=-536870913)}n&=~re}s!==0&&Hu(e,s,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(h&~t))}function Hu(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Re(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function Gu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Re(n),c=1<<s;c&t|e[s]&t&&(e[s]|=t),n&=~c}}function qu(e,t){var n=t&-t;return n=(n&42)!==0?1:Ti(n),(n&(e.suspendedLanes|t))!==0?0:n}function Ti(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ai(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Yu(){var e=L.p;return e!==0?e:(e=window.event,e===void 0?32:Ap(e.type))}function Fu(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var In=Math.random().toString(36).slice(2),Et="__reactFiber$"+In,Ut="__reactProps$"+In,qa="__reactContainer$"+In,Ri="__reactEvents$"+In,mx="__reactListeners$"+In,fx="__reactHandles$"+In,Zu="__reactResources$"+In,Dl="__reactMarker$"+In;function Mi(e){delete e[Et],delete e[Ut],delete e[Ri],delete e[mx],delete e[fx]}function Ya(e){var t=e[Et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[qa]||n[Et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fp(e);e!==null;){if(n=e[Et])return n;e=fp(e)}return t}e=n,n=e.parentNode}return null}function Fa(e){if(e=e[Et]||e[qa]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ll(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Za(e){var t=e[Zu];return t||(t=e[Zu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function wt(e){e[Dl]=!0}var Xu=new Set,Qu={};function va(e,t){Xa(e,t),Xa(e+"Capture",t)}function Xa(e,t){for(Qu[e]=t,e=0;e<t.length;e++)Xu.add(t[e])}var px=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Vu={},Iu={};function hx(e){return pt.call(Iu,e)?!0:pt.call(Vu,e)?!1:px.test(e)?Iu[e]=!0:(Vu[e]=!0,!1)}function $s(e,t,n){if(hx(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Hs(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function An(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}function tn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ju(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function xx(e,t,n){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,d=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(h){n=""+h,d.call(this,h)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(h){n=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _i(e){if(!e._valueTracker){var t=Ju(e)?"checked":"value";e._valueTracker=xx(e,t,""+e[t])}}function Ku(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Ju(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Gs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var gx=/[\n"\\]/g;function nn(e){return e.replace(gx,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Oi(e,t,n,s,c,d,h,w){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+tn(t)):e.value!==""+tn(t)&&(e.value=""+tn(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Di(e,h,tn(t)):n!=null?Di(e,h,tn(n)):s!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+tn(w):e.removeAttribute("name")}function Pu(e,t,n,s,c,d,h,w){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||n!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){_i(e);return}n=n!=null?""+tn(n):"",t=t!=null?""+tn(t):n,w||t===e.value||(e.value=t),e.defaultValue=t}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=w?e.checked:!!s,e.defaultChecked=!!s,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),_i(e)}function Di(e,t,n){t==="number"&&Gs(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Qa(e,t,n,s){if(e=e.options,t){t={};for(var c=0;c<n.length;c++)t["$"+n[c]]=!0;for(n=0;n<e.length;n++)c=t.hasOwnProperty("$"+e[n].value),e[n].selected!==c&&(e[n].selected=c),c&&s&&(e[n].defaultSelected=!0)}else{for(n=""+tn(n),t=null,c=0;c<e.length;c++){if(e[c].value===n){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Wu(e,t,n){if(t!=null&&(t=""+tn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+tn(n):""}function ed(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(o(92));if(pe(s)){if(1<s.length)throw Error(o(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=tn(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),_i(e)}function Va(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var bx=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function td(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||bx.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function nd(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var c in t)s=t[c],t.hasOwnProperty(c)&&n[c]!==s&&td(e,c,s)}else for(var d in t)t.hasOwnProperty(d)&&td(e,d,t[d])}function Li(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yx=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),vx=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function qs(e){return vx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Rn(){}var zi=null;function Bi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ia=null,Ja=null;function ad(e){var t=Fa(e);if(t&&(e=t.stateNode)){var n=e[Ut]||null;e:switch(e=t.stateNode,t.type){case"input":if(Oi(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+nn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var c=s[Ut]||null;if(!c)throw Error(o(90));Oi(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&Ku(s)}break e;case"textarea":Wu(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Qa(e,!!n.multiple,t,!1)}}}var Ui=!1;function ld(e,t,n){if(Ui)return e(t,n);Ui=!0;try{var s=e(t);return s}finally{if(Ui=!1,(Ia!==null||Ja!==null)&&(Ar(),Ia&&(t=Ia,e=Ja,Ja=Ia=null,ad(t),e)))for(t=0;t<e.length;t++)ad(e[t])}}function zl(e,t){var n=e.stateNode;if(n===null)return null;var s=n[Ut]||null;if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(o(231,t,typeof n));return n}var Mn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$i=!1;if(Mn)try{var Bl={};Object.defineProperty(Bl,"passive",{get:function(){$i=!0}}),window.addEventListener("test",Bl,Bl),window.removeEventListener("test",Bl,Bl)}catch{$i=!1}var Jn=null,Hi=null,Ys=null;function sd(){if(Ys)return Ys;var e,t=Hi,n=t.length,s,c="value"in Jn?Jn.value:Jn.textContent,d=c.length;for(e=0;e<n&&t[e]===c[e];e++);var h=n-e;for(s=1;s<=h&&t[n-s]===c[d-s];s++);return Ys=c.slice(e,1<s?1-s:void 0)}function Fs(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Zs(){return!0}function rd(){return!1}function $t(e){function t(n,s,c,d,h){this._reactName=n,this._targetInst=c,this.type=s,this.nativeEvent=d,this.target=h,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(n=e[w],this[w]=n?n(d):d[w]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Zs:rd,this.isPropagationStopped=rd,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Zs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Zs)},persist:function(){},isPersistent:Zs}),t}var ja={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xs=$t(ja),Ul=j({},ja,{view:0,detail:0}),jx=$t(Ul),Gi,qi,$l,Qs=j({},Ul,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fi,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!==$l&&($l&&e.type==="mousemove"?(Gi=e.screenX-$l.screenX,qi=e.screenY-$l.screenY):qi=Gi=0,$l=e),Gi)},movementY:function(e){return"movementY"in e?e.movementY:qi}}),id=$t(Qs),wx=j({},Qs,{dataTransfer:0}),Nx=$t(wx),Sx=j({},Ul,{relatedTarget:0}),Yi=$t(Sx),kx=j({},ja,{animationName:0,elapsedTime:0,pseudoElement:0}),Ex=$t(kx),Cx=j({},ja,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Tx=$t(Cx),Ax=j({},ja,{data:0}),od=$t(Ax),Rx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Mx={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"},_x={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ox(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_x[e])?!!t[e]:!1}function Fi(){return Ox}var Dx=j({},Ul,{key:function(e){if(e.key){var t=Rx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Mx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fi,charCode:function(e){return e.type==="keypress"?Fs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Lx=$t(Dx),zx=j({},Qs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cd=$t(zx),Bx=j({},Ul,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fi}),Ux=$t(Bx),$x=j({},ja,{propertyName:0,elapsedTime:0,pseudoElement:0}),Hx=$t($x),Gx=j({},Qs,{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}),qx=$t(Gx),Yx=j({},ja,{newState:0,oldState:0}),Fx=$t(Yx),Zx=[9,13,27,32],Zi=Mn&&"CompositionEvent"in window,Hl=null;Mn&&"documentMode"in document&&(Hl=document.documentMode);var Xx=Mn&&"TextEvent"in window&&!Hl,ud=Mn&&(!Zi||Hl&&8<Hl&&11>=Hl),dd=" ",md=!1;function fd(e,t){switch(e){case"keyup":return Zx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ka=!1;function Qx(e,t){switch(e){case"compositionend":return pd(t);case"keypress":return t.which!==32?null:(md=!0,dd);case"textInput":return e=t.data,e===dd&&md?null:e;default:return null}}function Vx(e,t){if(Ka)return e==="compositionend"||!Zi&&fd(e,t)?(e=sd(),Ys=Hi=Jn=null,Ka=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return ud&&t.locale!=="ko"?null:t.data;default:return null}}var Ix={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 hd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ix[e.type]:t==="textarea"}function xd(e,t,n,s){Ia?Ja?Ja.push(s):Ja=[s]:Ia=s,t=zr(t,"onChange"),0<t.length&&(n=new Xs("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Gl=null,ql=null;function Jx(e){Wf(e,0)}function Vs(e){var t=Ll(e);if(Ku(t))return e}function gd(e,t){if(e==="change")return t}var bd=!1;if(Mn){var Xi;if(Mn){var Qi="oninput"in document;if(!Qi){var yd=document.createElement("div");yd.setAttribute("oninput","return;"),Qi=typeof yd.oninput=="function"}Xi=Qi}else Xi=!1;bd=Xi&&(!document.documentMode||9<document.documentMode)}function vd(){Gl&&(Gl.detachEvent("onpropertychange",jd),ql=Gl=null)}function jd(e){if(e.propertyName==="value"&&Vs(ql)){var t=[];xd(t,ql,e,Bi(e)),ld(Jx,t)}}function Kx(e,t,n){e==="focusin"?(vd(),Gl=t,ql=n,Gl.attachEvent("onpropertychange",jd)):e==="focusout"&&vd()}function Px(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vs(ql)}function Wx(e,t){if(e==="click")return Vs(t)}function eg(e,t){if(e==="input"||e==="change")return Vs(t)}function tg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qt=typeof Object.is=="function"?Object.is:tg;function Yl(e,t){if(Qt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var c=n[s];if(!pt.call(t,c)||!Qt(e[c],t[c]))return!1}return!0}function wd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Nd(e,t){var n=wd(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=wd(n)}}function Sd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Gs(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Gs(e.document)}return t}function Vi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var ng=Mn&&"documentMode"in document&&11>=document.documentMode,Pa=null,Ii=null,Fl=null,Ji=!1;function Ed(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ji||Pa==null||Pa!==Gs(s)||(s=Pa,"selectionStart"in s&&Vi(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Fl&&Yl(Fl,s)||(Fl=s,s=zr(Ii,"onSelect"),0<s.length&&(t=new Xs("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Pa)))}function wa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Wa={animationend:wa("Animation","AnimationEnd"),animationiteration:wa("Animation","AnimationIteration"),animationstart:wa("Animation","AnimationStart"),transitionrun:wa("Transition","TransitionRun"),transitionstart:wa("Transition","TransitionStart"),transitioncancel:wa("Transition","TransitionCancel"),transitionend:wa("Transition","TransitionEnd")},Ki={},Cd={};Mn&&(Cd=document.createElement("div").style,"AnimationEvent"in window||(delete Wa.animationend.animation,delete Wa.animationiteration.animation,delete Wa.animationstart.animation),"TransitionEvent"in window||delete Wa.transitionend.transition);function Na(e){if(Ki[e])return Ki[e];if(!Wa[e])return e;var t=Wa[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Cd)return Ki[e]=t[n];return e}var Td=Na("animationend"),Ad=Na("animationiteration"),Rd=Na("animationstart"),ag=Na("transitionrun"),lg=Na("transitionstart"),sg=Na("transitioncancel"),Md=Na("transitionend"),_d=new Map,Pi="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Pi.push("scrollEnd");function pn(e,t){_d.set(e,t),va(t,[e])}var Is=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},an=[],el=0,Wi=0;function Js(){for(var e=el,t=Wi=el=0;t<e;){var n=an[t];an[t++]=null;var s=an[t];an[t++]=null;var c=an[t];an[t++]=null;var d=an[t];if(an[t++]=null,s!==null&&c!==null){var h=s.pending;h===null?c.next=c:(c.next=h.next,h.next=c),s.pending=c}d!==0&&Od(n,c,d)}}function Ks(e,t,n,s){an[el++]=e,an[el++]=t,an[el++]=n,an[el++]=s,Wi|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function eo(e,t,n,s){return Ks(e,t,n,s),Ps(e)}function Sa(e,t){return Ks(e,null,null,t),Ps(e)}function Od(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var c=!1,d=e.return;d!==null;)d.childLanes|=n,s=d.alternate,s!==null&&(s.childLanes|=n),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-Re(n),e=d.hiddenUpdates,s=e[c],s===null?e[c]=[t]:s.push(t),t.lane=n|536870912),d):null}function Ps(e){if(50<ms)throw ms=0,uc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var tl={};function rg(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vt(e,t,n,s){return new rg(e,t,n,s)}function to(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _n(e,t){var n=e.alternate;return n===null?(n=Vt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Dd(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ws(e,t,n,s,c,d){var h=0;if(s=e,typeof e=="function")to(e)&&(h=1);else if(typeof e=="string")h=db(e,n,W.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case me:return e=Vt(31,n,t,c),e.elementType=me,e.lanes=d,e;case S:return ka(n.children,c,d,t);case k:h=8,c|=24;break;case E:return e=Vt(12,n,t,c|2),e.elementType=E,e.lanes=d,e;case z:return e=Vt(13,n,t,c),e.elementType=z,e.lanes=d,e;case B:return e=Vt(19,n,t,c),e.elementType=B,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:h=10;break e;case M:h=9;break e;case _:h=11;break e;case F:h=14;break e;case ee:h=16,s=null;break e}h=29,n=Error(o(130,e===null?"null":typeof e,"")),s=null}return t=Vt(h,n,t,c),t.elementType=e,t.type=s,t.lanes=d,t}function ka(e,t,n,s){return e=Vt(7,e,s,t),e.lanes=n,e}function no(e,t,n){return e=Vt(6,e,null,t),e.lanes=n,e}function Ld(e){var t=Vt(18,null,null,0);return t.stateNode=e,t}function ao(e,t,n){return t=Vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var zd=new WeakMap;function ln(e,t){if(typeof e=="object"&&e!==null){var n=zd.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Ue(t)},zd.set(e,t),t)}return{value:e,source:t,stack:Ue(t)}}var nl=[],al=0,er=null,Zl=0,sn=[],rn=0,Kn=null,vn=1,jn="";function On(e,t){nl[al++]=Zl,nl[al++]=er,er=e,Zl=t}function Bd(e,t,n){sn[rn++]=vn,sn[rn++]=jn,sn[rn++]=Kn,Kn=e;var s=vn;e=jn;var c=32-Re(s)-1;s&=~(1<<c),n+=1;var d=32-Re(t)+c;if(30<d){var h=c-c%5;d=(s&(1<<h)-1).toString(32),s>>=h,c-=h,vn=1<<32-Re(t)+c|n<<c|s,jn=d+e}else vn=1<<d|n<<c|s,jn=e}function lo(e){e.return!==null&&(On(e,1),Bd(e,1,0))}function so(e){for(;e===er;)er=nl[--al],nl[al]=null,Zl=nl[--al],nl[al]=null;for(;e===Kn;)Kn=sn[--rn],sn[rn]=null,jn=sn[--rn],sn[rn]=null,vn=sn[--rn],sn[rn]=null}function Ud(e,t){sn[rn++]=vn,sn[rn++]=jn,sn[rn++]=Kn,vn=t.id,jn=t.overflow,Kn=e}var Ct=null,nt=null,Be=!1,Pn=null,on=!1,ro=Error(o(519));function Wn(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Xl(ln(t,e)),ro}function $d(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[Et]=e,t[Ut]=s,n){case"dialog":De("cancel",t),De("close",t);break;case"iframe":case"object":case"embed":De("load",t);break;case"video":case"audio":for(n=0;n<ps.length;n++)De(ps[n],t);break;case"source":De("error",t);break;case"img":case"image":case"link":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"input":De("invalid",t),Pu(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":De("invalid",t);break;case"textarea":De("invalid",t),ed(t,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||ap(t.textContent,n)?(s.popover!=null&&(De("beforetoggle",t),De("toggle",t)),s.onScroll!=null&&De("scroll",t),s.onScrollEnd!=null&&De("scrollend",t),s.onClick!=null&&(t.onclick=Rn),t=!0):t=!1,t||Wn(e,!0)}function Hd(e){for(Ct=e.return;Ct;)switch(Ct.tag){case 5:case 31:case 13:on=!1;return;case 27:case 3:on=!0;return;default:Ct=Ct.return}}function ll(e){if(e!==Ct)return!1;if(!Be)return Hd(e),Be=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||kc(e.type,e.memoizedProps)),n=!n),n&&nt&&Wn(e),Hd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));nt=mp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));nt=mp(e)}else t===27?(t=nt,fa(e.type)?(e=Rc,Rc=null,nt=e):nt=t):nt=Ct?un(e.stateNode.nextSibling):null;return!0}function Ea(){nt=Ct=null,Be=!1}function io(){var e=Pn;return e!==null&&(Yt===null?Yt=e:Yt.push.apply(Yt,e),Pn=null),e}function Xl(e){Pn===null?Pn=[e]:Pn.push(e)}var oo=C(null),Ca=null,Dn=null;function ea(e,t,n){Z(oo,t._currentValue),t._currentValue=n}function Ln(e){e._currentValue=oo.current,O(oo)}function co(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function uo(e,t,n,s){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var h=c.child;d=d.firstContext;e:for(;d!==null;){var w=d;d=c;for(var R=0;R<t.length;R++)if(w.context===t[R]){d.lanes|=n,w=d.alternate,w!==null&&(w.lanes|=n),co(d.return,n,e),s||(h=null);break e}d=w.next}}else if(c.tag===18){if(h=c.return,h===null)throw Error(o(341));h.lanes|=n,d=h.alternate,d!==null&&(d.lanes|=n),co(h,n,e),h=null}else h=c.child;if(h!==null)h.return=c;else for(h=c;h!==null;){if(h===e){h=null;break}if(c=h.sibling,c!==null){c.return=h.return,h=c;break}h=h.return}c=h}}function sl(e,t,n,s){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var h=c.alternate;if(h===null)throw Error(o(387));if(h=h.memoizedProps,h!==null){var w=c.type;Qt(c.pendingProps.value,h.value)||(e!==null?e.push(w):e=[w])}}else if(c===xe.current){if(h=c.alternate,h===null)throw Error(o(387));h.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ys):e=[ys])}c=c.return}e!==null&&uo(t,e,n,s),t.flags|=262144}function tr(e){for(e=e.firstContext;e!==null;){if(!Qt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ta(e){Ca=e,Dn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Tt(e){return Gd(Ca,e)}function nr(e,t){return Ca===null&&Ta(e),Gd(e,t)}function Gd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Dn===null){if(e===null)throw Error(o(308));Dn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Dn=Dn.next=t;return n}var ig=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},og=l.unstable_scheduleCallback,cg=l.unstable_NormalPriority,ht={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mo(){return{controller:new ig,data:new Map,refCount:0}}function Ql(e){e.refCount--,e.refCount===0&&og(cg,function(){e.controller.abort()})}var Vl=null,fo=0,rl=0,il=null;function ug(e,t){if(Vl===null){var n=Vl=[];fo=0,rl=xc(),il={status:"pending",value:void 0,then:function(s){n.push(s)}}}return fo++,t.then(qd,qd),t}function qd(){if(--fo===0&&Vl!==null){il!==null&&(il.status="fulfilled");var e=Vl;Vl=null,rl=0,il=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function dg(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(c){n.push(c)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var c=0;c<n.length;c++)(0,n[c])(t)},function(c){for(s.status="rejected",s.reason=c,c=0;c<n.length;c++)(0,n[c])(void 0)}),s}var Yd=H.S;H.S=function(e,t){Cf=$e(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ug(e,t),Yd!==null&&Yd(e,t)};var Aa=C(null);function po(){var e=Aa.current;return e!==null?e:et.pooledCache}function ar(e,t){t===null?Z(Aa,Aa.current):Z(Aa,t.pool)}function Fd(){var e=po();return e===null?null:{parent:ht._currentValue,pool:e}}var ol=Error(o(460)),ho=Error(o(474)),lr=Error(o(542)),sr={then:function(){}};function Zd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Xd(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Rn,Rn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Vd(e),e;default:if(typeof t.status=="string")t.then(Rn,Rn);else{if(e=et,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=s}},function(s){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Vd(e),e}throw Ma=t,ol}}function Ra(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ma=n,ol):n}}var Ma=null;function Qd(){if(Ma===null)throw Error(o(459));var e=Ma;return Ma=null,e}function Vd(e){if(e===ol||e===lr)throw Error(o(483))}var cl=null,Il=0;function rr(e){var t=Il;return Il+=1,cl===null&&(cl=[]),Xd(cl,e,t)}function Jl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ir(e,t){throw t.$$typeof===T?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Id(e){function t(U,D){if(e){var q=U.deletions;q===null?(U.deletions=[D],U.flags|=16):q.push(D)}}function n(U,D){if(!e)return null;for(;D!==null;)t(U,D),D=D.sibling;return null}function s(U){for(var D=new Map;U!==null;)U.key!==null?D.set(U.key,U):D.set(U.index,U),U=U.sibling;return D}function c(U,D){return U=_n(U,D),U.index=0,U.sibling=null,U}function d(U,D,q){return U.index=q,e?(q=U.alternate,q!==null?(q=q.index,q<D?(U.flags|=67108866,D):q):(U.flags|=67108866,D)):(U.flags|=1048576,D)}function h(U){return e&&U.alternate===null&&(U.flags|=67108866),U}function w(U,D,q,le){return D===null||D.tag!==6?(D=no(q,U.mode,le),D.return=U,D):(D=c(D,q),D.return=U,D)}function R(U,D,q,le){var ve=q.type;return ve===S?ne(U,D,q.props.children,le,q.key):D!==null&&(D.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===ee&&Ra(ve)===D.type)?(D=c(D,q.props),Jl(D,q),D.return=U,D):(D=Ws(q.type,q.key,q.props,null,U.mode,le),Jl(D,q),D.return=U,D)}function Y(U,D,q,le){return D===null||D.tag!==4||D.stateNode.containerInfo!==q.containerInfo||D.stateNode.implementation!==q.implementation?(D=ao(q,U.mode,le),D.return=U,D):(D=c(D,q.children||[]),D.return=U,D)}function ne(U,D,q,le,ve){return D===null||D.tag!==7?(D=ka(q,U.mode,le,ve),D.return=U,D):(D=c(D,q),D.return=U,D)}function re(U,D,q){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=no(""+D,U.mode,q),D.return=U,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case v:return q=Ws(D.type,D.key,D.props,null,U.mode,q),Jl(q,D),q.return=U,q;case N:return D=ao(D,U.mode,q),D.return=U,D;case ee:return D=Ra(D),re(U,D,q)}if(pe(D)||P(D))return D=ka(D,U.mode,q,null),D.return=U,D;if(typeof D.then=="function")return re(U,rr(D),q);if(D.$$typeof===A)return re(U,nr(U,D),q);ir(U,D)}return null}function X(U,D,q,le){var ve=D!==null?D.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return ve!==null?null:w(U,D,""+q,le);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case v:return q.key===ve?R(U,D,q,le):null;case N:return q.key===ve?Y(U,D,q,le):null;case ee:return q=Ra(q),X(U,D,q,le)}if(pe(q)||P(q))return ve!==null?null:ne(U,D,q,le,null);if(typeof q.then=="function")return X(U,D,rr(q),le);if(q.$$typeof===A)return X(U,D,nr(U,q),le);ir(U,q)}return null}function Q(U,D,q,le,ve){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return U=U.get(q)||null,w(D,U,""+le,ve);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case v:return U=U.get(le.key===null?q:le.key)||null,R(D,U,le,ve);case N:return U=U.get(le.key===null?q:le.key)||null,Y(D,U,le,ve);case ee:return le=Ra(le),Q(U,D,q,le,ve)}if(pe(le)||P(le))return U=U.get(q)||null,ne(D,U,le,ve,null);if(typeof le.then=="function")return Q(U,D,q,rr(le),ve);if(le.$$typeof===A)return Q(U,D,q,nr(D,le),ve);ir(D,le)}return null}function he(U,D,q,le){for(var ve=null,Ye=null,be=D,Te=D=0,ze=null;be!==null&&Te<q.length;Te++){be.index>Te?(ze=be,be=null):ze=be.sibling;var Fe=X(U,be,q[Te],le);if(Fe===null){be===null&&(be=ze);break}e&&be&&Fe.alternate===null&&t(U,be),D=d(Fe,D,Te),Ye===null?ve=Fe:Ye.sibling=Fe,Ye=Fe,be=ze}if(Te===q.length)return n(U,be),Be&&On(U,Te),ve;if(be===null){for(;Te<q.length;Te++)be=re(U,q[Te],le),be!==null&&(D=d(be,D,Te),Ye===null?ve=be:Ye.sibling=be,Ye=be);return Be&&On(U,Te),ve}for(be=s(be);Te<q.length;Te++)ze=Q(be,U,Te,q[Te],le),ze!==null&&(e&&ze.alternate!==null&&be.delete(ze.key===null?Te:ze.key),D=d(ze,D,Te),Ye===null?ve=ze:Ye.sibling=ze,Ye=ze);return e&&be.forEach(function(ba){return t(U,ba)}),Be&&On(U,Te),ve}function we(U,D,q,le){if(q==null)throw Error(o(151));for(var ve=null,Ye=null,be=D,Te=D=0,ze=null,Fe=q.next();be!==null&&!Fe.done;Te++,Fe=q.next()){be.index>Te?(ze=be,be=null):ze=be.sibling;var ba=X(U,be,Fe.value,le);if(ba===null){be===null&&(be=ze);break}e&&be&&ba.alternate===null&&t(U,be),D=d(ba,D,Te),Ye===null?ve=ba:Ye.sibling=ba,Ye=ba,be=ze}if(Fe.done)return n(U,be),Be&&On(U,Te),ve;if(be===null){for(;!Fe.done;Te++,Fe=q.next())Fe=re(U,Fe.value,le),Fe!==null&&(D=d(Fe,D,Te),Ye===null?ve=Fe:Ye.sibling=Fe,Ye=Fe);return Be&&On(U,Te),ve}for(be=s(be);!Fe.done;Te++,Fe=q.next())Fe=Q(be,U,Te,Fe.value,le),Fe!==null&&(e&&Fe.alternate!==null&&be.delete(Fe.key===null?Te:Fe.key),D=d(Fe,D,Te),Ye===null?ve=Fe:Ye.sibling=Fe,Ye=Fe);return e&&be.forEach(function(wb){return t(U,wb)}),Be&&On(U,Te),ve}function We(U,D,q,le){if(typeof q=="object"&&q!==null&&q.type===S&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case v:e:{for(var ve=q.key;D!==null;){if(D.key===ve){if(ve=q.type,ve===S){if(D.tag===7){n(U,D.sibling),le=c(D,q.props.children),le.return=U,U=le;break e}}else if(D.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===ee&&Ra(ve)===D.type){n(U,D.sibling),le=c(D,q.props),Jl(le,q),le.return=U,U=le;break e}n(U,D);break}else t(U,D);D=D.sibling}q.type===S?(le=ka(q.props.children,U.mode,le,q.key),le.return=U,U=le):(le=Ws(q.type,q.key,q.props,null,U.mode,le),Jl(le,q),le.return=U,U=le)}return h(U);case N:e:{for(ve=q.key;D!==null;){if(D.key===ve)if(D.tag===4&&D.stateNode.containerInfo===q.containerInfo&&D.stateNode.implementation===q.implementation){n(U,D.sibling),le=c(D,q.children||[]),le.return=U,U=le;break e}else{n(U,D);break}else t(U,D);D=D.sibling}le=ao(q,U.mode,le),le.return=U,U=le}return h(U);case ee:return q=Ra(q),We(U,D,q,le)}if(pe(q))return he(U,D,q,le);if(P(q)){if(ve=P(q),typeof ve!="function")throw Error(o(150));return q=ve.call(q),we(U,D,q,le)}if(typeof q.then=="function")return We(U,D,rr(q),le);if(q.$$typeof===A)return We(U,D,nr(U,q),le);ir(U,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,D!==null&&D.tag===6?(n(U,D.sibling),le=c(D,q),le.return=U,U=le):(n(U,D),le=no(q,U.mode,le),le.return=U,U=le),h(U)):n(U,D)}return function(U,D,q,le){try{Il=0;var ve=We(U,D,q,le);return cl=null,ve}catch(be){if(be===ol||be===lr)throw be;var Ye=Vt(29,be,null,U.mode);return Ye.lanes=le,Ye.return=U,Ye}finally{}}}var _a=Id(!0),Jd=Id(!1),ta=!1;function xo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function go(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function na(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function aa(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Xe&2)!==0){var c=s.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),s.pending=t,t=Ps(e),Od(e,null,n),t}return Ks(e,s,t,n),Ps(e)}function Kl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Gu(e,n)}}function bo(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var c=null,d=null;if(n=n.firstBaseUpdate,n!==null){do{var h={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};d===null?c=d=h:d=d.next=h,n=n.next}while(n!==null);d===null?c=d=t:d=d.next=t}else c=d=t;n={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var yo=!1;function Pl(){if(yo){var e=il;if(e!==null)throw e}}function Wl(e,t,n,s){yo=!1;var c=e.updateQueue;ta=!1;var d=c.firstBaseUpdate,h=c.lastBaseUpdate,w=c.shared.pending;if(w!==null){c.shared.pending=null;var R=w,Y=R.next;R.next=null,h===null?d=Y:h.next=Y,h=R;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,w=ne.lastBaseUpdate,w!==h&&(w===null?ne.firstBaseUpdate=Y:w.next=Y,ne.lastBaseUpdate=R))}if(d!==null){var re=c.baseState;h=0,ne=Y=R=null,w=d;do{var X=w.lane&-536870913,Q=X!==w.lane;if(Q?(Le&X)===X:(s&X)===X){X!==0&&X===rl&&(yo=!0),ne!==null&&(ne=ne.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var he=e,we=w;X=t;var We=n;switch(we.tag){case 1:if(he=we.payload,typeof he=="function"){re=he.call(We,re,X);break e}re=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=we.payload,X=typeof he=="function"?he.call(We,re,X):he,X==null)break e;re=j({},re,X);break e;case 2:ta=!0}}X=w.callback,X!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=c.callbacks,Q===null?c.callbacks=[X]:Q.push(X))}else Q={lane:X,tag:w.tag,payload:w.payload,callback:w.callback,next:null},ne===null?(Y=ne=Q,R=re):ne=ne.next=Q,h|=X;if(w=w.next,w===null){if(w=c.shared.pending,w===null)break;Q=w,w=Q.next,Q.next=null,c.lastBaseUpdate=Q,c.shared.pending=null}}while(!0);ne===null&&(R=re),c.baseState=R,c.firstBaseUpdate=Y,c.lastBaseUpdate=ne,d===null&&(c.shared.lanes=0),oa|=h,e.lanes=h,e.memoizedState=re}}function Kd(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Pd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Kd(n[e],t)}var ul=C(null),or=C(0);function Wd(e,t){e=Fn,Z(or,e),Z(ul,t),Fn=e|t.baseLanes}function vo(){Z(or,Fn),Z(ul,ul.current)}function jo(){Fn=or.current,O(ul),O(or)}var It=C(null),cn=null;function la(e){var t=e.alternate;Z(mt,mt.current&1),Z(It,e),cn===null&&(t===null||ul.current!==null||t.memoizedState!==null)&&(cn=e)}function wo(e){Z(mt,mt.current),Z(It,e),cn===null&&(cn=e)}function em(e){e.tag===22?(Z(mt,mt.current),Z(It,e),cn===null&&(cn=e)):sa()}function sa(){Z(mt,mt.current),Z(It,It.current)}function Jt(e){O(It),cn===e&&(cn=null),O(mt)}var mt=C(0);function cr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Tc(n)||Ac(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var zn=0,Ce=null,Ke=null,xt=null,ur=!1,dl=!1,Oa=!1,dr=0,es=0,ml=null,mg=0;function ot(){throw Error(o(321))}function No(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Qt(e[n],t[n]))return!1;return!0}function So(e,t,n,s,c,d){return zn=d,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,H.H=e===null||e.memoizedState===null?Bm:$o,Oa=!1,d=n(s,c),Oa=!1,dl&&(d=nm(t,n,s,c)),tm(e),d}function tm(e){H.H=as;var t=Ke!==null&&Ke.next!==null;if(zn=0,xt=Ke=Ce=null,ur=!1,es=0,ml=null,t)throw Error(o(300));e===null||gt||(e=e.dependencies,e!==null&&tr(e)&&(gt=!0))}function nm(e,t,n,s){Ce=e;var c=0;do{if(dl&&(ml=null),es=0,dl=!1,25<=c)throw Error(o(301));if(c+=1,xt=Ke=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}H.H=Um,d=t(n,s)}while(dl);return d}function fg(){var e=H.H,t=e.useState()[0];return t=typeof t.then=="function"?ts(t):t,e=e.useState()[0],(Ke!==null?Ke.memoizedState:null)!==e&&(Ce.flags|=1024),t}function ko(){var e=dr!==0;return dr=0,e}function Eo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Co(e){if(ur){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ur=!1}zn=0,xt=Ke=Ce=null,dl=!1,es=dr=0,ml=null}function _t(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?Ce.memoizedState=xt=e:xt=xt.next=e,xt}function ft(){if(Ke===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=Ke.next;var t=xt===null?Ce.memoizedState:xt.next;if(t!==null)xt=t,Ke=e;else{if(e===null)throw Ce.alternate===null?Error(o(467)):Error(o(310));Ke=e,e={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},xt===null?Ce.memoizedState=xt=e:xt=xt.next=e}return xt}function mr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ts(e){var t=es;return es+=1,ml===null&&(ml=[]),e=Xd(ml,e,t),t=Ce,(xt===null?t.memoizedState:xt.next)===null&&(t=t.alternate,H.H=t===null||t.memoizedState===null?Bm:$o),e}function fr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ts(e);if(e.$$typeof===A)return Tt(e)}throw Error(o(438,String(e)))}function To(e){var t=null,n=Ce.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=Ce.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=mr(),Ce.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=$;return t.index++,n}function Bn(e,t){return typeof t=="function"?t(e):t}function pr(e){var t=ft();return Ao(t,Ke,e)}function Ao(e,t,n){var s=e.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=n;var c=e.baseQueue,d=s.pending;if(d!==null){if(c!==null){var h=c.next;c.next=d.next,d.next=h}t.baseQueue=c=d,s.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var w=h=null,R=null,Y=t,ne=!1;do{var re=Y.lane&-536870913;if(re!==Y.lane?(Le&re)===re:(zn&re)===re){var X=Y.revertLane;if(X===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),re===rl&&(ne=!0);else if((zn&X)===X){Y=Y.next,X===rl&&(ne=!0);continue}else re={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},R===null?(w=R=re,h=d):R=R.next=re,Ce.lanes|=X,oa|=X;re=Y.action,Oa&&n(d,re),d=Y.hasEagerState?Y.eagerState:n(d,re)}else X={lane:re,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},R===null?(w=R=X,h=d):R=R.next=X,Ce.lanes|=re,oa|=re;Y=Y.next}while(Y!==null&&Y!==t);if(R===null?h=d:R.next=w,!Qt(d,e.memoizedState)&&(gt=!0,ne&&(n=il,n!==null)))throw n;e.memoizedState=d,e.baseState=h,e.baseQueue=R,s.lastRenderedState=d}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Ro(e){var t=ft(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var s=n.dispatch,c=n.pending,d=t.memoizedState;if(c!==null){n.pending=null;var h=c=c.next;do d=e(d,h.action),h=h.next;while(h!==c);Qt(d,t.memoizedState)||(gt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),n.lastRenderedState=d}return[d,s]}function am(e,t,n){var s=Ce,c=ft(),d=Be;if(d){if(n===void 0)throw Error(o(407));n=n()}else n=t();var h=!Qt((Ke||c).memoizedState,n);if(h&&(c.memoizedState=n,gt=!0),c=c.queue,Oo(rm.bind(null,s,c,e),[e]),c.getSnapshot!==t||h||xt!==null&&xt.memoizedState.tag&1){if(s.flags|=2048,fl(9,{destroy:void 0},sm.bind(null,s,c,n,t),null),et===null)throw Error(o(349));d||(zn&127)!==0||lm(s,t,n)}return n}function lm(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ce.updateQueue,t===null?(t=mr(),Ce.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function sm(e,t,n,s){t.value=n,t.getSnapshot=s,im(t)&&om(e)}function rm(e,t,n){return n(function(){im(t)&&om(e)})}function im(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Qt(e,n)}catch{return!0}}function om(e){var t=Sa(e,2);t!==null&&Ft(t,e,2)}function Mo(e){var t=_t();if(typeof e=="function"){var n=e;if(e=n(),Oa){ye(!0);try{n()}finally{ye(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bn,lastRenderedState:e},t}function cm(e,t,n,s){return e.baseState=n,Ao(e,Ke,typeof s=="function"?s:Bn)}function pg(e,t,n,s,c){if(gr(e))throw Error(o(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){d.listeners.push(h)}};H.T!==null?n(!0):d.isTransition=!1,s(d),n=t.pending,n===null?(d.next=t.pending=d,um(t,d)):(d.next=n.next,t.pending=n.next=d)}}function um(e,t){var n=t.action,s=t.payload,c=e.state;if(t.isTransition){var d=H.T,h={};H.T=h;try{var w=n(c,s),R=H.S;R!==null&&R(h,w),dm(e,t,w)}catch(Y){_o(e,t,Y)}finally{d!==null&&h.types!==null&&(d.types=h.types),H.T=d}}else try{d=n(c,s),dm(e,t,d)}catch(Y){_o(e,t,Y)}}function dm(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){mm(e,t,s)},function(s){return _o(e,t,s)}):mm(e,t,n)}function mm(e,t,n){t.status="fulfilled",t.value=n,fm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,um(e,n)))}function _o(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,fm(t),t=t.next;while(t!==s)}e.action=null}function fm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function pm(e,t){return t}function hm(e,t){if(Be){var n=et.formState;if(n!==null){e:{var s=Ce;if(Be){if(nt){t:{for(var c=nt,d=on;c.nodeType!==8;){if(!d){c=null;break t}if(c=un(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){nt=un(c.nextSibling),s=c.data==="F!";break e}}Wn(s)}s=!1}s&&(t=n[0])}}return n=_t(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pm,lastRenderedState:t},n.queue=s,n=Dm.bind(null,Ce,s),s.dispatch=n,s=Mo(!1),d=Uo.bind(null,Ce,!1,s.queue),s=_t(),c={state:t,dispatch:null,action:e,pending:null},s.queue=c,n=pg.bind(null,Ce,c,d,n),c.dispatch=n,s.memoizedState=e,[t,n,!1]}function xm(e){var t=ft();return gm(t,Ke,e)}function gm(e,t,n){if(t=Ao(e,t,pm)[0],e=pr(Bn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=ts(t)}catch(h){throw h===ol?lr:h}else s=t;t=ft();var c=t.queue,d=c.dispatch;return n!==t.memoizedState&&(Ce.flags|=2048,fl(9,{destroy:void 0},hg.bind(null,c,n),null)),[s,d,e]}function hg(e,t){e.action=t}function bm(e){var t=ft(),n=Ke;if(n!==null)return gm(t,n,e);ft(),t=t.memoizedState,n=ft();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function fl(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=Ce.updateQueue,t===null&&(t=mr(),Ce.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function ym(){return ft().memoizedState}function hr(e,t,n,s){var c=_t();Ce.flags|=e,c.memoizedState=fl(1|t,{destroy:void 0},n,s===void 0?null:s)}function xr(e,t,n,s){var c=ft();s=s===void 0?null:s;var d=c.memoizedState.inst;Ke!==null&&s!==null&&No(s,Ke.memoizedState.deps)?c.memoizedState=fl(t,d,n,s):(Ce.flags|=e,c.memoizedState=fl(1|t,d,n,s))}function vm(e,t){hr(8390656,8,e,t)}function Oo(e,t){xr(2048,8,e,t)}function xg(e){Ce.flags|=4;var t=Ce.updateQueue;if(t===null)t=mr(),Ce.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function jm(e){var t=ft().memoizedState;return xg({ref:t,nextImpl:e}),function(){if((Xe&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function wm(e,t){return xr(4,2,e,t)}function Nm(e,t){return xr(4,4,e,t)}function Sm(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function km(e,t,n){n=n!=null?n.concat([e]):null,xr(4,4,Sm.bind(null,t,e),n)}function Do(){}function Em(e,t){var n=ft();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&No(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Cm(e,t){var n=ft();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&No(t,s[1]))return s[0];if(s=e(),Oa){ye(!0);try{e()}finally{ye(!1)}}return n.memoizedState=[s,t],s}function Lo(e,t,n){return n===void 0||(zn&1073741824)!==0&&(Le&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Af(),Ce.lanes|=e,oa|=e,n)}function Tm(e,t,n,s){return Qt(n,t)?n:ul.current!==null?(e=Lo(e,n,s),Qt(e,t)||(gt=!0),e):(zn&42)===0||(zn&1073741824)!==0&&(Le&261930)===0?(gt=!0,e.memoizedState=n):(e=Af(),Ce.lanes|=e,oa|=e,t)}function Am(e,t,n,s,c){var d=L.p;L.p=d!==0&&8>d?d:8;var h=H.T,w={};H.T=w,Uo(e,!1,t,n);try{var R=c(),Y=H.S;if(Y!==null&&Y(w,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var ne=dg(R,s);ns(e,t,ne,Wt(e))}else ns(e,t,s,Wt(e))}catch(re){ns(e,t,{then:function(){},status:"rejected",reason:re},Wt())}finally{L.p=d,h!==null&&w.types!==null&&(h.types=w.types),H.T=h}}function gg(){}function zo(e,t,n,s){if(e.tag!==5)throw Error(o(476));var c=Rm(e).queue;Am(e,c,t,te,n===null?gg:function(){return Mm(e),n(s)})}function Rm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bn,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Mm(e){var t=Rm(e);t.next===null&&(t=e.alternate.memoizedState),ns(e,t.next.queue,{},Wt())}function Bo(){return Tt(ys)}function _m(){return ft().memoizedState}function Om(){return ft().memoizedState}function bg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Wt();e=na(n);var s=aa(t,e,n);s!==null&&(Ft(s,t,n),Kl(s,t,n)),t={cache:mo()},e.payload=t;return}t=t.return}}function yg(e,t,n){var s=Wt();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},gr(e)?Lm(t,n):(n=eo(e,t,n,s),n!==null&&(Ft(n,e,s),zm(n,t,s)))}function Dm(e,t,n){var s=Wt();ns(e,t,n,s)}function ns(e,t,n,s){var c={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(gr(e))Lm(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var h=t.lastRenderedState,w=d(h,n);if(c.hasEagerState=!0,c.eagerState=w,Qt(w,h))return Ks(e,t,c,0),et===null&&Js(),!1}catch{}finally{}if(n=eo(e,t,c,s),n!==null)return Ft(n,e,s),zm(n,t,s),!0}return!1}function Uo(e,t,n,s){if(s={lane:2,revertLane:xc(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},gr(e)){if(t)throw Error(o(479))}else t=eo(e,n,s,2),t!==null&&Ft(t,e,2)}function gr(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function Lm(e,t){dl=ur=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zm(e,t,n){if((n&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Gu(e,n)}}var as={readContext:Tt,use:fr,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};as.useEffectEvent=ot;var Bm={readContext:Tt,use:fr,useCallback:function(e,t){return _t().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:vm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,hr(4194308,4,Sm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return hr(4194308,4,e,t)},useInsertionEffect:function(e,t){hr(4,2,e,t)},useMemo:function(e,t){var n=_t();t=t===void 0?null:t;var s=e();if(Oa){ye(!0);try{e()}finally{ye(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=_t();if(n!==void 0){var c=n(t);if(Oa){ye(!0);try{n(t)}finally{ye(!1)}}}else c=t;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=yg.bind(null,Ce,e),[s.memoizedState,e]},useRef:function(e){var t=_t();return e={current:e},t.memoizedState=e},useState:function(e){e=Mo(e);var t=e.queue,n=Dm.bind(null,Ce,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Do,useDeferredValue:function(e,t){var n=_t();return Lo(n,e,t)},useTransition:function(){var e=Mo(!1);return e=Am.bind(null,Ce,e.queue,!0,!1),_t().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=Ce,c=_t();if(Be){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),et===null)throw Error(o(349));(Le&127)!==0||lm(s,t,n)}c.memoizedState=n;var d={value:n,getSnapshot:t};return c.queue=d,vm(rm.bind(null,s,d,e),[e]),s.flags|=2048,fl(9,{destroy:void 0},sm.bind(null,s,d,n,t),null),n},useId:function(){var e=_t(),t=et.identifierPrefix;if(Be){var n=jn,s=vn;n=(s&~(1<<32-Re(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=dr++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=mg++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Bo,useFormState:hm,useActionState:hm,useOptimistic:function(e){var t=_t();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Uo.bind(null,Ce,!0,n),n.dispatch=t,[e,t]},useMemoCache:To,useCacheRefresh:function(){return _t().memoizedState=bg.bind(null,Ce)},useEffectEvent:function(e){var t=_t(),n={impl:e};return t.memoizedState=n,function(){if((Xe&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},$o={readContext:Tt,use:fr,useCallback:Em,useContext:Tt,useEffect:Oo,useImperativeHandle:km,useInsertionEffect:wm,useLayoutEffect:Nm,useMemo:Cm,useReducer:pr,useRef:ym,useState:function(){return pr(Bn)},useDebugValue:Do,useDeferredValue:function(e,t){var n=ft();return Tm(n,Ke.memoizedState,e,t)},useTransition:function(){var e=pr(Bn)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:ts(e),t]},useSyncExternalStore:am,useId:_m,useHostTransitionStatus:Bo,useFormState:xm,useActionState:xm,useOptimistic:function(e,t){var n=ft();return cm(n,Ke,e,t)},useMemoCache:To,useCacheRefresh:Om};$o.useEffectEvent=jm;var Um={readContext:Tt,use:fr,useCallback:Em,useContext:Tt,useEffect:Oo,useImperativeHandle:km,useInsertionEffect:wm,useLayoutEffect:Nm,useMemo:Cm,useReducer:Ro,useRef:ym,useState:function(){return Ro(Bn)},useDebugValue:Do,useDeferredValue:function(e,t){var n=ft();return Ke===null?Lo(n,e,t):Tm(n,Ke.memoizedState,e,t)},useTransition:function(){var e=Ro(Bn)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:ts(e),t]},useSyncExternalStore:am,useId:_m,useHostTransitionStatus:Bo,useFormState:bm,useActionState:bm,useOptimistic:function(e,t){var n=ft();return Ke!==null?cm(n,Ke,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:To,useCacheRefresh:Om};Um.useEffectEvent=jm;function Ho(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Go={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Wt(),c=na(s);c.payload=t,n!=null&&(c.callback=n),t=aa(e,c,s),t!==null&&(Ft(t,e,s),Kl(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Wt(),c=na(s);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=aa(e,c,s),t!==null&&(Ft(t,e,s),Kl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Wt(),s=na(n);s.tag=2,t!=null&&(s.callback=t),t=aa(e,s,n),t!==null&&(Ft(t,e,n),Kl(t,e,n))}};function $m(e,t,n,s,c,d,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,d,h):t.prototype&&t.prototype.isPureReactComponent?!Yl(n,s)||!Yl(c,d):!0}function Hm(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Go.enqueueReplaceState(t,t.state,null)}function Da(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}if(e=e.defaultProps){n===t&&(n=j({},n));for(var c in e)n[c]===void 0&&(n[c]=e[c])}return n}function Gm(e){Is(e)}function qm(e){console.error(e)}function Ym(e){Is(e)}function br(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Fm(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function qo(e,t,n){return n=na(n),n.tag=3,n.payload={element:null},n.callback=function(){br(e,t)},n}function Zm(e){return e=na(e),e.tag=3,e}function Xm(e,t,n,s){var c=n.type.getDerivedStateFromError;if(typeof c=="function"){var d=s.value;e.payload=function(){return c(d)},e.callback=function(){Fm(t,n,s)}}var h=n.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){Fm(t,n,s),typeof c!="function"&&(ca===null?ca=new Set([this]):ca.add(this));var w=s.stack;this.componentDidCatch(s.value,{componentStack:w!==null?w:""})})}function vg(e,t,n,s,c){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&sl(t,n,c,!0),n=It.current,n!==null){switch(n.tag){case 31:case 13:return cn===null?Rr():n.alternate===null&&ct===0&&(ct=3),n.flags&=-257,n.flags|=65536,n.lanes=c,s===sr?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),fc(e,s,c)),!1;case 22:return n.flags|=65536,s===sr?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),fc(e,s,c)),!1}throw Error(o(435,n.tag))}return fc(e,s,c),Rr(),!1}if(Be)return t=It.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,s!==ro&&(e=Error(o(422),{cause:s}),Xl(ln(e,n)))):(s!==ro&&(t=Error(o(423),{cause:s}),Xl(ln(t,n))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=ln(s,n),c=qo(e.stateNode,s,c),bo(e,c),ct!==4&&(ct=2)),!1;var d=Error(o(520),{cause:s});if(d=ln(d,n),ds===null?ds=[d]:ds.push(d),ct!==4&&(ct=2),t===null)return!0;s=ln(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=c&-c,n.lanes|=e,e=qo(n.stateNode,s,e),bo(n,e),!1;case 1:if(t=n.type,d=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(ca===null||!ca.has(d))))return n.flags|=65536,c&=-c,n.lanes|=c,c=Zm(c),Xm(c,e,n,s),bo(n,c),!1}n=n.return}while(n!==null);return!1}var Yo=Error(o(461)),gt=!1;function At(e,t,n,s){t.child=e===null?Jd(t,null,n,s):_a(t,e.child,n,s)}function Qm(e,t,n,s,c){n=n.render;var d=t.ref;if("ref"in s){var h={};for(var w in s)w!=="ref"&&(h[w]=s[w])}else h=s;return Ta(t),s=So(e,t,n,h,d,c),w=ko(),e!==null&&!gt?(Eo(e,t,c),Un(e,t,c)):(Be&&w&&lo(t),t.flags|=1,At(e,t,s,c),t.child)}function Vm(e,t,n,s,c){if(e===null){var d=n.type;return typeof d=="function"&&!to(d)&&d.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=d,Im(e,t,d,s,c)):(e=Ws(n.type,null,s,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Ko(e,c)){var h=d.memoizedProps;if(n=n.compare,n=n!==null?n:Yl,n(h,s)&&e.ref===t.ref)return Un(e,t,c)}return t.flags|=1,e=_n(d,s),e.ref=t.ref,e.return=t,t.child=e}function Im(e,t,n,s,c){if(e!==null){var d=e.memoizedProps;if(Yl(d,s)&&e.ref===t.ref)if(gt=!1,t.pendingProps=s=d,Ko(e,c))(e.flags&131072)!==0&&(gt=!0);else return t.lanes=e.lanes,Un(e,t,c)}return Fo(e,t,n,s,c)}function Jm(e,t,n,s){var c=s.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|n:n,e!==null){for(s=t.child=e.child,c=0;s!==null;)c=c|s.lanes|s.childLanes,s=s.sibling;s=c&~d}else s=0,t.child=null;return Km(e,t,d,n,s)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ar(t,d!==null?d.cachePool:null),d!==null?Wd(t,d):vo(),em(t);else return s=t.lanes=536870912,Km(e,t,d!==null?d.baseLanes|n:n,n,s)}else d!==null?(ar(t,d.cachePool),Wd(t,d),sa(),t.memoizedState=null):(e!==null&&ar(t,null),vo(),sa());return At(e,t,c,n),t.child}function ls(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Km(e,t,n,s,c){var d=po();return d=d===null?null:{parent:ht._currentValue,pool:d},t.memoizedState={baseLanes:n,cachePool:d},e!==null&&ar(t,null),vo(),em(t),e!==null&&sl(e,t,s,!0),t.childLanes=c,null}function yr(e,t){return t=jr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Pm(e,t,n){return _a(t,e.child,null,n),e=yr(t,t.pendingProps),e.flags|=2,Jt(t),t.memoizedState=null,e}function jg(e,t,n){var s=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Be){if(s.mode==="hidden")return e=yr(t,s),t.lanes=536870912,ls(null,e);if(wo(t),(e=nt)?(e=dp(e,on),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Kn!==null?{id:vn,overflow:jn}:null,retryLane:536870912,hydrationErrors:null},n=Ld(e),n.return=t,t.child=n,Ct=t,nt=null)):e=null,e===null)throw Wn(t);return t.lanes=536870912,null}return yr(t,s)}var d=e.memoizedState;if(d!==null){var h=d.dehydrated;if(wo(t),c)if(t.flags&256)t.flags&=-257,t=Pm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(gt||sl(e,t,n,!1),c=(n&e.childLanes)!==0,gt||c){if(s=et,s!==null&&(h=qu(s,n),h!==0&&h!==d.retryLane))throw d.retryLane=h,Sa(e,h),Ft(s,e,h),Yo;Rr(),t=Pm(e,t,n)}else e=d.treeContext,nt=un(h.nextSibling),Ct=t,Be=!0,Pn=null,on=!1,e!==null&&Ud(t,e),t=yr(t,s),t.flags|=4096;return t}return e=_n(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function vr(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Fo(e,t,n,s,c){return Ta(t),n=So(e,t,n,s,void 0,c),s=ko(),e!==null&&!gt?(Eo(e,t,c),Un(e,t,c)):(Be&&s&&lo(t),t.flags|=1,At(e,t,n,c),t.child)}function Wm(e,t,n,s,c,d){return Ta(t),t.updateQueue=null,n=nm(t,s,n,c),tm(e),s=ko(),e!==null&&!gt?(Eo(e,t,d),Un(e,t,d)):(Be&&s&&lo(t),t.flags|=1,At(e,t,n,d),t.child)}function ef(e,t,n,s,c){if(Ta(t),t.stateNode===null){var d=tl,h=n.contextType;typeof h=="object"&&h!==null&&(d=Tt(h)),d=new n(s,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Go,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=s,d.state=t.memoizedState,d.refs={},xo(t),h=n.contextType,d.context=typeof h=="object"&&h!==null?Tt(h):tl,d.state=t.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(Ho(t,n,h,s),d.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(h=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),h!==d.state&&Go.enqueueReplaceState(d,d.state,null),Wl(t,s,d,c),Pl(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){d=t.stateNode;var w=t.memoizedProps,R=Da(n,w);d.props=R;var Y=d.context,ne=n.contextType;h=tl,typeof ne=="object"&&ne!==null&&(h=Tt(ne));var re=n.getDerivedStateFromProps;ne=typeof re=="function"||typeof d.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,ne||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(w||Y!==h)&&Hm(t,d,s,h),ta=!1;var X=t.memoizedState;d.state=X,Wl(t,s,d,c),Pl(),Y=t.memoizedState,w||X!==Y||ta?(typeof re=="function"&&(Ho(t,n,re,s),Y=t.memoizedState),(R=ta||$m(t,n,R,s,X,Y,h))?(ne||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=Y),d.props=s,d.state=Y,d.context=h,s=R):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{d=t.stateNode,go(e,t),h=t.memoizedProps,ne=Da(n,h),d.props=ne,re=t.pendingProps,X=d.context,Y=n.contextType,R=tl,typeof Y=="object"&&Y!==null&&(R=Tt(Y)),w=n.getDerivedStateFromProps,(Y=typeof w=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(h!==re||X!==R)&&Hm(t,d,s,R),ta=!1,X=t.memoizedState,d.state=X,Wl(t,s,d,c),Pl();var Q=t.memoizedState;h!==re||X!==Q||ta||e!==null&&e.dependencies!==null&&tr(e.dependencies)?(typeof w=="function"&&(Ho(t,n,w,s),Q=t.memoizedState),(ne=ta||$m(t,n,ne,s,X,Q,R)||e!==null&&e.dependencies!==null&&tr(e.dependencies))?(Y||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(s,Q,R),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(s,Q,R)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||h===e.memoizedProps&&X===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&X===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=Q),d.props=s,d.state=Q,d.context=R,s=ne):(typeof d.componentDidUpdate!="function"||h===e.memoizedProps&&X===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&X===e.memoizedState||(t.flags|=1024),s=!1)}return d=s,vr(e,t),s=(t.flags&128)!==0,d||s?(d=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&s?(t.child=_a(t,e.child,null,c),t.child=_a(t,null,n,c)):At(e,t,n,c),t.memoizedState=d.state,e=t.child):e=Un(e,t,c),e}function tf(e,t,n,s){return Ea(),t.flags|=256,At(e,t,n,s),t.child}var Zo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xo(e){return{baseLanes:e,cachePool:Fd()}}function Qo(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Pt),e}function nf(e,t,n){var s=t.pendingProps,c=!1,d=(t.flags&128)!==0,h;if((h=d)||(h=e!==null&&e.memoizedState===null?!1:(mt.current&2)!==0),h&&(c=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Be){if(c?la(t):sa(),(e=nt)?(e=dp(e,on),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Kn!==null?{id:vn,overflow:jn}:null,retryLane:536870912,hydrationErrors:null},n=Ld(e),n.return=t,t.child=n,Ct=t,nt=null)):e=null,e===null)throw Wn(t);return Ac(e)?t.lanes=32:t.lanes=536870912,null}var w=s.children;return s=s.fallback,c?(sa(),c=t.mode,w=jr({mode:"hidden",children:w},c),s=ka(s,c,n,null),w.return=t,s.return=t,w.sibling=s,t.child=w,s=t.child,s.memoizedState=Xo(n),s.childLanes=Qo(e,h,n),t.memoizedState=Zo,ls(null,s)):(la(t),Vo(t,w))}var R=e.memoizedState;if(R!==null&&(w=R.dehydrated,w!==null)){if(d)t.flags&256?(la(t),t.flags&=-257,t=Io(e,t,n)):t.memoizedState!==null?(sa(),t.child=e.child,t.flags|=128,t=null):(sa(),w=s.fallback,c=t.mode,s=jr({mode:"visible",children:s.children},c),w=ka(w,c,n,null),w.flags|=2,s.return=t,w.return=t,s.sibling=w,t.child=s,_a(t,e.child,null,n),s=t.child,s.memoizedState=Xo(n),s.childLanes=Qo(e,h,n),t.memoizedState=Zo,t=ls(null,s));else if(la(t),Ac(w)){if(h=w.nextSibling&&w.nextSibling.dataset,h)var Y=h.dgst;h=Y,s=Error(o(419)),s.stack="",s.digest=h,Xl({value:s,source:null,stack:null}),t=Io(e,t,n)}else if(gt||sl(e,t,n,!1),h=(n&e.childLanes)!==0,gt||h){if(h=et,h!==null&&(s=qu(h,n),s!==0&&s!==R.retryLane))throw R.retryLane=s,Sa(e,s),Ft(h,e,s),Yo;Tc(w)||Rr(),t=Io(e,t,n)}else Tc(w)?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,nt=un(w.nextSibling),Ct=t,Be=!0,Pn=null,on=!1,e!==null&&Ud(t,e),t=Vo(t,s.children),t.flags|=4096);return t}return c?(sa(),w=s.fallback,c=t.mode,R=e.child,Y=R.sibling,s=_n(R,{mode:"hidden",children:s.children}),s.subtreeFlags=R.subtreeFlags&65011712,Y!==null?w=_n(Y,w):(w=ka(w,c,n,null),w.flags|=2),w.return=t,s.return=t,s.sibling=w,t.child=s,ls(null,s),s=t.child,w=e.child.memoizedState,w===null?w=Xo(n):(c=w.cachePool,c!==null?(R=ht._currentValue,c=c.parent!==R?{parent:R,pool:R}:c):c=Fd(),w={baseLanes:w.baseLanes|n,cachePool:c}),s.memoizedState=w,s.childLanes=Qo(e,h,n),t.memoizedState=Zo,ls(e.child,s)):(la(t),n=e.child,e=n.sibling,n=_n(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=n,t.memoizedState=null,n)}function Vo(e,t){return t=jr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function jr(e,t){return e=Vt(22,e,null,t),e.lanes=0,e}function Io(e,t,n){return _a(t,e.child,null,n),e=Vo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function af(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),co(e.return,t,n)}function Jo(e,t,n,s,c,d){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:c,treeForkCount:d}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=s,h.tail=n,h.tailMode=c,h.treeForkCount=d)}function lf(e,t,n){var s=t.pendingProps,c=s.revealOrder,d=s.tail;s=s.children;var h=mt.current,w=(h&2)!==0;if(w?(h=h&1|2,t.flags|=128):h&=1,Z(mt,h),At(e,t,s,n),s=Be?Zl:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&af(e,n,t);else if(e.tag===19)af(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(n=t.child,c=null;n!==null;)e=n.alternate,e!==null&&cr(e)===null&&(c=n),n=n.sibling;n=c,n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null),Jo(t,!1,c,n,d,s);break;case"backwards":case"unstable_legacy-backwards":for(n=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&cr(e)===null){t.child=c;break}e=c.sibling,c.sibling=n,n=c,c=e}Jo(t,!0,n,null,d,s);break;case"together":Jo(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Un(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),oa|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(sl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=_n(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=_n(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ko(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&tr(e)))}function wg(e,t,n){switch(t.tag){case 3:Me(t,t.stateNode.containerInfo),ea(t,ht,e.memoizedState.cache),Ea();break;case 27:case 5:_e(t);break;case 4:Me(t,t.stateNode.containerInfo);break;case 10:ea(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,wo(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(la(t),t.flags|=128,null):(n&t.child.childLanes)!==0?nf(e,t,n):(la(t),e=Un(e,t,n),e!==null?e.sibling:null);la(t);break;case 19:var c=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||(sl(e,t,n,!1),s=(n&t.childLanes)!==0),c){if(s)return lf(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Z(mt,mt.current),s)break;return null;case 22:return t.lanes=0,Jm(e,t,n,t.pendingProps);case 24:ea(t,ht,e.memoizedState.cache)}return Un(e,t,n)}function sf(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)gt=!0;else{if(!Ko(e,n)&&(t.flags&128)===0)return gt=!1,wg(e,t,n);gt=(e.flags&131072)!==0}else gt=!1,Be&&(t.flags&1048576)!==0&&Bd(t,Zl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Ra(t.elementType),t.type=e,typeof e=="function")to(e)?(s=Da(e,s),t.tag=1,t=ef(null,t,e,s,n)):(t.tag=0,t=Fo(null,t,e,s,n));else{if(e!=null){var c=e.$$typeof;if(c===_){t.tag=11,t=Qm(null,t,e,s,n);break e}else if(c===F){t.tag=14,t=Vm(null,t,e,s,n);break e}}throw t=ce(e)||e,Error(o(306,t,""))}}return t;case 0:return Fo(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,c=Da(s,t.pendingProps),ef(e,t,s,c,n);case 3:e:{if(Me(t,t.stateNode.containerInfo),e===null)throw Error(o(387));s=t.pendingProps;var d=t.memoizedState;c=d.element,go(e,t),Wl(t,s,null,n);var h=t.memoizedState;if(s=h.cache,ea(t,ht,s),s!==d.cache&&uo(t,[ht],n,!0),Pl(),s=h.element,d.isDehydrated)if(d={element:s,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=tf(e,t,s,n);break e}else if(s!==c){c=ln(Error(o(424)),t),Xl(c),t=tf(e,t,s,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(nt=un(e.firstChild),Ct=t,Be=!0,Pn=null,on=!0,n=Jd(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ea(),s===c){t=Un(e,t,n);break e}At(e,t,s,n)}t=t.child}return t;case 26:return vr(e,t),e===null?(n=gp(t.type,null,t.pendingProps,null))?t.memoizedState=n:Be||(n=t.type,e=t.pendingProps,s=Br(fe.current).createElement(n),s[Et]=t,s[Ut]=e,Rt(s,n,e),wt(s),t.stateNode=s):t.memoizedState=gp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _e(t),e===null&&Be&&(s=t.stateNode=pp(t.type,t.pendingProps,fe.current),Ct=t,on=!0,c=nt,fa(t.type)?(Rc=c,nt=un(s.firstChild)):nt=c),At(e,t,t.pendingProps.children,n),vr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Be&&((c=s=nt)&&(s=Pg(s,t.type,t.pendingProps,on),s!==null?(t.stateNode=s,Ct=t,nt=un(s.firstChild),on=!1,c=!0):c=!1),c||Wn(t)),_e(t),c=t.type,d=t.pendingProps,h=e!==null?e.memoizedProps:null,s=d.children,kc(c,d)?s=null:h!==null&&kc(c,h)&&(t.flags|=32),t.memoizedState!==null&&(c=So(e,t,fg,null,null,n),ys._currentValue=c),vr(e,t),At(e,t,s,n),t.child;case 6:return e===null&&Be&&((e=n=nt)&&(n=Wg(n,t.pendingProps,on),n!==null?(t.stateNode=n,Ct=t,nt=null,e=!0):e=!1),e||Wn(t)),null;case 13:return nf(e,t,n);case 4:return Me(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=_a(t,null,s,n):At(e,t,s,n),t.child;case 11:return Qm(e,t,t.type,t.pendingProps,n);case 7:return At(e,t,t.pendingProps,n),t.child;case 8:return At(e,t,t.pendingProps.children,n),t.child;case 12:return At(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,ea(t,t.type,s.value),At(e,t,s.children,n),t.child;case 9:return c=t.type._context,s=t.pendingProps.children,Ta(t),c=Tt(c),s=s(c),t.flags|=1,At(e,t,s,n),t.child;case 14:return Vm(e,t,t.type,t.pendingProps,n);case 15:return Im(e,t,t.type,t.pendingProps,n);case 19:return lf(e,t,n);case 31:return jg(e,t,n);case 22:return Jm(e,t,n,t.pendingProps);case 24:return Ta(t),s=Tt(ht),e===null?(c=po(),c===null&&(c=et,d=mo(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=n),c=d),t.memoizedState={parent:s,cache:c},xo(t),ea(t,ht,c)):((e.lanes&n)!==0&&(go(e,t),Wl(t,null,null,n),Pl()),c=e.memoizedState,d=t.memoizedState,c.parent!==s?(c={parent:s,cache:s},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),ea(t,ht,s)):(s=d.cache,ea(t,ht,s),s!==c.cache&&uo(t,[ht],n,!0))),At(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function $n(e){e.flags|=4}function Po(e,t,n,s,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Of())e.flags|=8192;else throw Ma=sr,ho}else e.flags&=-16777217}function rf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!wp(t))if(Of())e.flags|=8192;else throw Ma=sr,ho}function wr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?$u():536870912,e.lanes|=t,gl|=t)}function ss(e,t){if(!Be)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function at(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var c=e.child;c!==null;)n|=c.lanes|c.childLanes,s|=c.subtreeFlags&65011712,s|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)n|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Ng(e,t,n){var s=t.pendingProps;switch(so(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return at(t),null;case 1:return at(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ln(ht),Ae(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ll(t)?$n(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,io())),at(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?($n(t),d!==null?(at(t),rf(t,d)):(at(t),Po(t,c,null,s,n))):d?d!==e.memoizedState?($n(t),at(t),rf(t,d)):(at(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&$n(t),at(t),Po(t,c,e,s,n)),null;case 27:if(Ge(t),n=fe.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&$n(t);else{if(!s){if(t.stateNode===null)throw Error(o(166));return at(t),null}e=W.current,ll(t)?$d(t):(e=pp(c,s,n),t.stateNode=e,$n(t))}return at(t),null;case 5:if(Ge(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&$n(t);else{if(!s){if(t.stateNode===null)throw Error(o(166));return at(t),null}if(d=W.current,ll(t))$d(t);else{var h=Br(fe.current);switch(d){case 1:d=h.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=h.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=h.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof s.is=="string"?h.createElement("select",{is:s.is}):h.createElement("select"),s.multiple?d.multiple=!0:s.size&&(d.size=s.size);break;default:d=typeof s.is=="string"?h.createElement(c,{is:s.is}):h.createElement(c)}}d[Et]=t,d[Ut]=s;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)d.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=d;e:switch(Rt(d,c,s),c){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&$n(t)}}return at(t),Po(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&$n(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(o(166));if(e=fe.current,ll(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,c=Ct,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[Et]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||ap(e.nodeValue,n)),e||Wn(t,!0)}else e=Br(e).createTextNode(s),e[Et]=t,t.stateNode=e}return at(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=ll(t),n!==null){if(e===null){if(!s)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Et]=t}else Ea(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),e=!1}else n=io(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Jt(t),t):(Jt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return at(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=ll(t),s!==null&&s.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[Et]=t}else Ea(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),c=!1}else c=io(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Jt(t),t):(Jt(t),null)}return Jt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==c&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),wr(t,t.updateQueue),at(t),null);case 4:return Ae(),e===null&&vc(t.stateNode.containerInfo),at(t),null;case 10:return Ln(t.type),at(t),null;case 19:if(O(mt),s=t.memoizedState,s===null)return at(t),null;if(c=(t.flags&128)!==0,d=s.rendering,d===null)if(c)ss(s,!1);else{if(ct!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=cr(e),d!==null){for(t.flags|=128,ss(s,!1),e=d.updateQueue,t.updateQueue=e,wr(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Dd(n,e),n=n.sibling;return Z(mt,mt.current&1|2),Be&&On(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&$e()>Cr&&(t.flags|=128,c=!0,ss(s,!1),t.lanes=4194304)}else{if(!c)if(e=cr(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,wr(t,e),ss(s,!0),s.tail===null&&s.tailMode==="hidden"&&!d.alternate&&!Be)return at(t),null}else 2*$e()-s.renderingStartTime>Cr&&n!==536870912&&(t.flags|=128,c=!0,ss(s,!1),t.lanes=4194304);s.isBackwards?(d.sibling=t.child,t.child=d):(e=s.last,e!==null?e.sibling=d:t.child=d,s.last=d)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=$e(),e.sibling=null,n=mt.current,Z(mt,c?n&1|2:n&1),Be&&On(t,s.treeForkCount),e):(at(t),null);case 22:case 23:return Jt(t),jo(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(n&536870912)!==0&&(t.flags&128)===0&&(at(t),t.subtreeFlags&6&&(t.flags|=8192)):at(t),n=t.updateQueue,n!==null&&wr(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&O(Aa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ln(ht),at(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Sg(e,t){switch(so(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ln(ht),Ae(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ge(t),null;case 31:if(t.memoizedState!==null){if(Jt(t),t.alternate===null)throw Error(o(340));Ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return O(mt),null;case 4:return Ae(),null;case 10:return Ln(t.type),null;case 22:case 23:return Jt(t),jo(),e!==null&&O(Aa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ln(ht),null;case 25:return null;default:return null}}function of(e,t){switch(so(t),t.tag){case 3:Ln(ht),Ae();break;case 26:case 27:case 5:Ge(t);break;case 4:Ae();break;case 31:t.memoizedState!==null&&Jt(t);break;case 13:Jt(t);break;case 19:O(mt);break;case 10:Ln(t.type);break;case 22:case 23:Jt(t),jo(),e!==null&&O(Aa);break;case 24:Ln(ht)}}function rs(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var c=s.next;n=c;do{if((n.tag&e)===e){s=void 0;var d=n.create,h=n.inst;s=d(),h.destroy=s}n=n.next}while(n!==c)}}catch(w){Je(t,t.return,w)}}function ra(e,t,n){try{var s=t.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var d=c.next;s=d;do{if((s.tag&e)===e){var h=s.inst,w=h.destroy;if(w!==void 0){h.destroy=void 0,c=t;var R=n,Y=w;try{Y()}catch(ne){Je(c,R,ne)}}}s=s.next}while(s!==d)}}catch(ne){Je(t,t.return,ne)}}function cf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Pd(t,n)}catch(s){Je(e,e.return,s)}}}function uf(e,t,n){n.props=Da(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){Je(e,t,s)}}function is(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(c){Je(e,t,c)}}function wn(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(c){Je(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(c){Je(e,t,c)}else n.current=null}function df(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(c){Je(e,e.return,c)}}function Wo(e,t,n){try{var s=e.stateNode;Xg(s,e.type,n,t),s[Ut]=t}catch(c){Je(e,e.return,c)}}function mf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&fa(e.type)||e.tag===4}function ec(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||mf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&fa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function tc(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Rn));else if(s!==4&&(s===27&&fa(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(tc(e,t,n),e=e.sibling;e!==null;)tc(e,t,n),e=e.sibling}function Nr(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&fa(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Nr(e,t,n),e=e.sibling;e!==null;)Nr(e,t,n),e=e.sibling}function ff(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Rt(t,s,n),t[Et]=e,t[Ut]=n}catch(d){Je(e,e.return,d)}}var Hn=!1,bt=!1,nc=!1,pf=typeof WeakSet=="function"?WeakSet:Set,Nt=null;function kg(e,t){if(e=e.containerInfo,Nc=Fr,e=kd(e),Vi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var c=s.anchorOffset,d=s.focusNode;s=s.focusOffset;try{n.nodeType,d.nodeType}catch{n=null;break e}var h=0,w=-1,R=-1,Y=0,ne=0,re=e,X=null;t:for(;;){for(var Q;re!==n||c!==0&&re.nodeType!==3||(w=h+c),re!==d||s!==0&&re.nodeType!==3||(R=h+s),re.nodeType===3&&(h+=re.nodeValue.length),(Q=re.firstChild)!==null;)X=re,re=Q;for(;;){if(re===e)break t;if(X===n&&++Y===c&&(w=h),X===d&&++ne===s&&(R=h),(Q=re.nextSibling)!==null)break;re=X,X=re.parentNode}re=Q}n=w===-1||R===-1?null:{start:w,end:R}}else n=null}n=n||{start:0,end:0}}else n=null;for(Sc={focusedElem:e,selectionRange:n},Fr=!1,Nt=t;Nt!==null;)if(t=Nt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Nt=e;else for(;Nt!==null;){switch(t=Nt,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)c=e[n],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,n=t,c=d.memoizedProps,d=d.memoizedState,s=n.stateNode;try{var he=Da(n.type,c);e=s.getSnapshotBeforeUpdate(he,d),s.__reactInternalSnapshotBeforeUpdate=e}catch(we){Je(n,n.return,we)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Cc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Cc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Nt=e;break}Nt=t.return}}function hf(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:qn(e,n),s&4&&rs(5,n);break;case 1:if(qn(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(h){Je(n,n.return,h)}else{var c=Da(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Je(n,n.return,h)}}s&64&&cf(n),s&512&&is(n,n.return);break;case 3:if(qn(e,n),s&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Pd(e,t)}catch(h){Je(n,n.return,h)}}break;case 27:t===null&&s&4&&ff(n);case 26:case 5:qn(e,n),t===null&&s&4&&df(n),s&512&&is(n,n.return);break;case 12:qn(e,n);break;case 31:qn(e,n),s&4&&bf(e,n);break;case 13:qn(e,n),s&4&&yf(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Dg.bind(null,n),eb(e,n))));break;case 22:if(s=n.memoizedState!==null||Hn,!s){t=t!==null&&t.memoizedState!==null||bt,c=Hn;var d=bt;Hn=s,(bt=t)&&!d?Yn(e,n,(n.subtreeFlags&8772)!==0):qn(e,n),Hn=c,bt=d}break;case 30:break;default:qn(e,n)}}function xf(e){var t=e.alternate;t!==null&&(e.alternate=null,xf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Mi(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var st=null,Ht=!1;function Gn(e,t,n){for(n=n.child;n!==null;)gf(e,t,n),n=n.sibling}function gf(e,t,n){if(ge&&typeof ge.onCommitFiberUnmount=="function")try{ge.onCommitFiberUnmount(ue,n)}catch{}switch(n.tag){case 26:bt||wn(n,t),Gn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:bt||wn(n,t);var s=st,c=Ht;fa(n.type)&&(st=n.stateNode,Ht=!1),Gn(e,t,n),xs(n.stateNode),st=s,Ht=c;break;case 5:bt||wn(n,t);case 6:if(s=st,c=Ht,st=null,Gn(e,t,n),st=s,Ht=c,st!==null)if(Ht)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(n.stateNode)}catch(d){Je(n,t,d)}else try{st.removeChild(n.stateNode)}catch(d){Je(n,t,d)}break;case 18:st!==null&&(Ht?(e=st,cp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),kl(e)):cp(st,n.stateNode));break;case 4:s=st,c=Ht,st=n.stateNode.containerInfo,Ht=!0,Gn(e,t,n),st=s,Ht=c;break;case 0:case 11:case 14:case 15:ra(2,n,t),bt||ra(4,n,t),Gn(e,t,n);break;case 1:bt||(wn(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&uf(n,t,s)),Gn(e,t,n);break;case 21:Gn(e,t,n);break;case 22:bt=(s=bt)||n.memoizedState!==null,Gn(e,t,n),bt=s;break;default:Gn(e,t,n)}}function bf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{kl(e)}catch(n){Je(t,t.return,n)}}}function yf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{kl(e)}catch(n){Je(t,t.return,n)}}function Eg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new pf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new pf),t;default:throw Error(o(435,e.tag))}}function Sr(e,t){var n=Eg(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var c=Lg.bind(null,e,s);s.then(c,c)}})}function Gt(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var c=n[s],d=e,h=t,w=h;e:for(;w!==null;){switch(w.tag){case 27:if(fa(w.type)){st=w.stateNode,Ht=!1;break e}break;case 5:st=w.stateNode,Ht=!1;break e;case 3:case 4:st=w.stateNode.containerInfo,Ht=!0;break e}w=w.return}if(st===null)throw Error(o(160));gf(d,h,c),st=null,Ht=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vf(t,e),t=t.sibling}var hn=null;function vf(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Gt(t,e),qt(e),s&4&&(ra(3,e,e.return),rs(3,e),ra(5,e,e.return));break;case 1:Gt(t,e),qt(e),s&512&&(bt||n===null||wn(n,n.return)),s&64&&Hn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var c=hn;if(Gt(t,e),qt(e),s&512&&(bt||n===null||wn(n,n.return)),s&4){var d=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,c=c.ownerDocument||c;t:switch(s){case"title":d=c.getElementsByTagName("title")[0],(!d||d[Dl]||d[Et]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(s),c.head.insertBefore(d,c.querySelector("head > title"))),Rt(d,s,n),d[Et]=e,wt(d),s=d;break e;case"link":var h=vp("link","href",c).get(s+(n.href||""));if(h){for(var w=0;w<h.length;w++)if(d=h[w],d.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&d.getAttribute("rel")===(n.rel==null?null:n.rel)&&d.getAttribute("title")===(n.title==null?null:n.title)&&d.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){h.splice(w,1);break t}}d=c.createElement(s),Rt(d,s,n),c.head.appendChild(d);break;case"meta":if(h=vp("meta","content",c).get(s+(n.content||""))){for(w=0;w<h.length;w++)if(d=h[w],d.getAttribute("content")===(n.content==null?null:""+n.content)&&d.getAttribute("name")===(n.name==null?null:n.name)&&d.getAttribute("property")===(n.property==null?null:n.property)&&d.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&d.getAttribute("charset")===(n.charSet==null?null:n.charSet)){h.splice(w,1);break t}}d=c.createElement(s),Rt(d,s,n),c.head.appendChild(d);break;default:throw Error(o(468,s))}d[Et]=e,wt(d),s=d}e.stateNode=s}else jp(c,e.type,e.stateNode);else e.stateNode=yp(c,s,e.memoizedProps);else d!==s?(d===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):d.count--,s===null?jp(c,e.type,e.stateNode):yp(c,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Wo(e,e.memoizedProps,n.memoizedProps)}break;case 27:Gt(t,e),qt(e),s&512&&(bt||n===null||wn(n,n.return)),n!==null&&s&4&&Wo(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Gt(t,e),qt(e),s&512&&(bt||n===null||wn(n,n.return)),e.flags&32){c=e.stateNode;try{Va(c,"")}catch(he){Je(e,e.return,he)}}s&4&&e.stateNode!=null&&(c=e.memoizedProps,Wo(e,c,n!==null?n.memoizedProps:c)),s&1024&&(nc=!0);break;case 6:if(Gt(t,e),qt(e),s&4){if(e.stateNode===null)throw Error(o(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(he){Je(e,e.return,he)}}break;case 3:if(Hr=null,c=hn,hn=Ur(t.containerInfo),Gt(t,e),hn=c,qt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{kl(t.containerInfo)}catch(he){Je(e,e.return,he)}nc&&(nc=!1,jf(e));break;case 4:s=hn,hn=Ur(e.stateNode.containerInfo),Gt(t,e),qt(e),hn=s;break;case 12:Gt(t,e),qt(e);break;case 31:Gt(t,e),qt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Sr(e,s)));break;case 13:Gt(t,e),qt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Er=$e()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Sr(e,s)));break;case 22:c=e.memoizedState!==null;var R=n!==null&&n.memoizedState!==null,Y=Hn,ne=bt;if(Hn=Y||c,bt=ne||R,Gt(t,e),bt=ne,Hn=Y,qt(e),s&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(n===null||R||Hn||bt||La(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){R=n=t;try{if(d=R.stateNode,c)h=d.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{w=R.stateNode;var re=R.memoizedProps.style,X=re!=null&&re.hasOwnProperty("display")?re.display:null;w.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(he){Je(R,R.return,he)}}}else if(t.tag===6){if(n===null){R=t;try{R.stateNode.nodeValue=c?"":R.memoizedProps}catch(he){Je(R,R.return,he)}}}else if(t.tag===18){if(n===null){R=t;try{var Q=R.stateNode;c?up(Q,!0):up(R.stateNode,!1)}catch(he){Je(R,R.return,he)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,Sr(e,n))));break;case 19:Gt(t,e),qt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Sr(e,s)));break;case 30:break;case 21:break;default:Gt(t,e),qt(e)}}function qt(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(mf(s)){n=s;break}s=s.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var c=n.stateNode,d=ec(e);Nr(e,d,c);break;case 5:var h=n.stateNode;n.flags&32&&(Va(h,""),n.flags&=-33);var w=ec(e);Nr(e,w,h);break;case 3:case 4:var R=n.stateNode.containerInfo,Y=ec(e);tc(e,Y,R);break;default:throw Error(o(161))}}catch(ne){Je(e,e.return,ne)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function jf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;jf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function qn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)hf(e,t.alternate,t),t=t.sibling}function La(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ra(4,t,t.return),La(t);break;case 1:wn(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&uf(t,t.return,n),La(t);break;case 27:xs(t.stateNode);case 26:case 5:wn(t,t.return),La(t);break;case 22:t.memoizedState===null&&La(t);break;case 30:La(t);break;default:La(t)}e=e.sibling}}function Yn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,c=e,d=t,h=d.flags;switch(d.tag){case 0:case 11:case 15:Yn(c,d,n),rs(4,d);break;case 1:if(Yn(c,d,n),s=d,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(Y){Je(s,s.return,Y)}if(s=d,c=s.updateQueue,c!==null){var w=s.stateNode;try{var R=c.shared.hiddenCallbacks;if(R!==null)for(c.shared.hiddenCallbacks=null,c=0;c<R.length;c++)Kd(R[c],w)}catch(Y){Je(s,s.return,Y)}}n&&h&64&&cf(d),is(d,d.return);break;case 27:ff(d);case 26:case 5:Yn(c,d,n),n&&s===null&&h&4&&df(d),is(d,d.return);break;case 12:Yn(c,d,n);break;case 31:Yn(c,d,n),n&&h&4&&bf(c,d);break;case 13:Yn(c,d,n),n&&h&4&&yf(c,d);break;case 22:d.memoizedState===null&&Yn(c,d,n),is(d,d.return);break;case 30:break;default:Yn(c,d,n)}t=t.sibling}}function ac(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ql(n))}function lc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ql(e))}function xn(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wf(e,t,n,s),t=t.sibling}function wf(e,t,n,s){var c=t.flags;switch(t.tag){case 0:case 11:case 15:xn(e,t,n,s),c&2048&&rs(9,t);break;case 1:xn(e,t,n,s);break;case 3:xn(e,t,n,s),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ql(e)));break;case 12:if(c&2048){xn(e,t,n,s),e=t.stateNode;try{var d=t.memoizedProps,h=d.id,w=d.onPostCommit;typeof w=="function"&&w(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){Je(t,t.return,R)}}else xn(e,t,n,s);break;case 31:xn(e,t,n,s);break;case 13:xn(e,t,n,s);break;case 23:break;case 22:d=t.stateNode,h=t.alternate,t.memoizedState!==null?d._visibility&2?xn(e,t,n,s):os(e,t):d._visibility&2?xn(e,t,n,s):(d._visibility|=2,pl(e,t,n,s,(t.subtreeFlags&10256)!==0||!1)),c&2048&&ac(h,t);break;case 24:xn(e,t,n,s),c&2048&&lc(t.alternate,t);break;default:xn(e,t,n,s)}}function pl(e,t,n,s,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,h=t,w=n,R=s,Y=h.flags;switch(h.tag){case 0:case 11:case 15:pl(d,h,w,R,c),rs(8,h);break;case 23:break;case 22:var ne=h.stateNode;h.memoizedState!==null?ne._visibility&2?pl(d,h,w,R,c):os(d,h):(ne._visibility|=2,pl(d,h,w,R,c)),c&&Y&2048&&ac(h.alternate,h);break;case 24:pl(d,h,w,R,c),c&&Y&2048&&lc(h.alternate,h);break;default:pl(d,h,w,R,c)}t=t.sibling}}function os(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,c=s.flags;switch(s.tag){case 22:os(n,s),c&2048&&ac(s.alternate,s);break;case 24:os(n,s),c&2048&&lc(s.alternate,s);break;default:os(n,s)}t=t.sibling}}var cs=8192;function hl(e,t,n){if(e.subtreeFlags&cs)for(e=e.child;e!==null;)Nf(e,t,n),e=e.sibling}function Nf(e,t,n){switch(e.tag){case 26:hl(e,t,n),e.flags&cs&&e.memoizedState!==null&&mb(n,hn,e.memoizedState,e.memoizedProps);break;case 5:hl(e,t,n);break;case 3:case 4:var s=hn;hn=Ur(e.stateNode.containerInfo),hl(e,t,n),hn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=cs,cs=16777216,hl(e,t,n),cs=s):hl(e,t,n));break;default:hl(e,t,n)}}function Sf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function us(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Nt=s,Ef(s,e)}Sf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)kf(e),e=e.sibling}function kf(e){switch(e.tag){case 0:case 11:case 15:us(e),e.flags&2048&&ra(9,e,e.return);break;case 3:us(e);break;case 12:us(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,kr(e)):us(e);break;default:us(e)}}function kr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Nt=s,Ef(s,e)}Sf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ra(8,t,t.return),kr(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,kr(t));break;default:kr(t)}e=e.sibling}}function Ef(e,t){for(;Nt!==null;){var n=Nt;switch(n.tag){case 0:case 11:case 15:ra(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Ql(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,Nt=s;else e:for(n=e;Nt!==null;){s=Nt;var c=s.sibling,d=s.return;if(xf(s),s===n){Nt=null;break e}if(c!==null){c.return=d,Nt=c;break e}Nt=d}}}var Cg={getCacheForType:function(e){var t=Tt(ht),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Tt(ht).controller.signal}},Tg=typeof WeakMap=="function"?WeakMap:Map,Xe=0,et=null,Oe=null,Le=0,Ie=0,Kt=null,ia=!1,xl=!1,sc=!1,Fn=0,ct=0,oa=0,za=0,rc=0,Pt=0,gl=0,ds=null,Yt=null,ic=!1,Er=0,Cf=0,Cr=1/0,Tr=null,ca=null,yt=0,ua=null,bl=null,Zn=0,oc=0,cc=null,Tf=null,ms=0,uc=null;function Wt(){return(Xe&2)!==0&&Le!==0?Le&-Le:H.T!==null?xc():Yu()}function Af(){if(Pt===0)if((Le&536870912)===0||Be){var e=Zt;Zt<<=1,(Zt&3932160)===0&&(Zt=262144),Pt=e}else Pt=536870912;return e=It.current,e!==null&&(e.flags|=32),Pt}function Ft(e,t,n){(e===et&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)&&(yl(e,0),da(e,Le,Pt,!1)),Ol(e,n),((Xe&2)===0||e!==et)&&(e===et&&((Xe&2)===0&&(za|=n),ct===4&&da(e,Le,Pt,!1)),Nn(e))}function Rf(e,t,n){if((Xe&6)!==0)throw Error(o(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Vn(e,t),c=s?Mg(e,t):mc(e,t,!0),d=s;do{if(c===0){xl&&!s&&da(e,t,0,!1);break}else{if(n=e.current.alternate,d&&!Ag(n)){c=mc(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var w=e;c=ds;var R=w.current.memoizedState.isDehydrated;if(R&&(yl(w,h).flags|=256),h=mc(w,h,!1),h!==2){if(sc&&!R){w.errorRecoveryDisabledLanes|=d,za|=d,c=4;break e}d=Yt,Yt=c,d!==null&&(Yt===null?Yt=d:Yt.push.apply(Yt,d))}c=h}if(d=!1,c!==2)continue}}if(c===1){yl(e,0),da(e,t,0,!0);break}e:{switch(s=e,d=c,d){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:da(s,t,Pt,!ia);break e;case 2:Yt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=Er+300-$e(),10<c)){if(da(s,t,Pt,!ia),ya(s,0,!0)!==0)break e;Zn=t,s.timeoutHandle=ip(Mf.bind(null,s,n,Yt,Tr,ic,t,Pt,za,gl,ia,d,"Throttled",-0,0),c);break e}Mf(s,n,Yt,Tr,ic,t,Pt,za,gl,ia,d,null,-0,0)}}break}while(!0);Nn(e)}function Mf(e,t,n,s,c,d,h,w,R,Y,ne,re,X,Q){if(e.timeoutHandle=-1,re=t.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Rn},Nf(t,d,re);var he=(d&62914560)===d?Er-$e():(d&4194048)===d?Cf-$e():0;if(he=fb(re,he),he!==null){Zn=d,e.cancelPendingCommit=he($f.bind(null,e,t,d,n,s,c,h,w,R,ne,re,null,X,Q)),da(e,d,h,!Y);return}}$f(e,t,d,n,s,c,h,w,R)}function Ag(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var s=0;s<n.length;s++){var c=n[s],d=c.getSnapshot;c=c.value;try{if(!Qt(d(),c))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function da(e,t,n,s){t&=~rc,t&=~za,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var c=t;0<c;){var d=31-Re(c),h=1<<d;s[d]=-1,c&=~h}n!==0&&Hu(e,n,t)}function Ar(){return(Xe&6)===0?(fs(0),!1):!0}function dc(){if(Oe!==null){if(Ie===0)var e=Oe.return;else e=Oe,Dn=Ca=null,Co(e),cl=null,Il=0,e=Oe;for(;e!==null;)of(e.alternate,e),e=e.return;Oe=null}}function yl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Ig(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Zn=0,dc(),et=e,Oe=n=_n(e.current,null),Le=t,Ie=0,Kt=null,ia=!1,xl=Vn(e,t),sc=!1,gl=Pt=rc=za=oa=ct=0,Yt=ds=null,ic=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var c=31-Re(s),d=1<<c;t|=e[c],s&=~d}return Fn=t,Js(),n}function _f(e,t){Ce=null,H.H=as,t===ol||t===lr?(t=Qd(),Ie=3):t===ho?(t=Qd(),Ie=4):Ie=t===Yo?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Kt=t,Oe===null&&(ct=1,br(e,ln(t,e.current)))}function Of(){var e=It.current;return e===null?!0:(Le&4194048)===Le?cn===null:(Le&62914560)===Le||(Le&536870912)!==0?e===cn:!1}function Df(){var e=H.H;return H.H=as,e===null?as:e}function Lf(){var e=H.A;return H.A=Cg,e}function Rr(){ct=4,ia||(Le&4194048)!==Le&&It.current!==null||(xl=!0),(oa&134217727)===0&&(za&134217727)===0||et===null||da(et,Le,Pt,!1)}function mc(e,t,n){var s=Xe;Xe|=2;var c=Df(),d=Lf();(et!==e||Le!==t)&&(Tr=null,yl(e,t)),t=!1;var h=ct;e:do try{if(Ie!==0&&Oe!==null){var w=Oe,R=Kt;switch(Ie){case 8:dc(),h=6;break e;case 3:case 2:case 9:case 6:It.current===null&&(t=!0);var Y=Ie;if(Ie=0,Kt=null,vl(e,w,R,Y),n&&xl){h=0;break e}break;default:Y=Ie,Ie=0,Kt=null,vl(e,w,R,Y)}}Rg(),h=ct;break}catch(ne){_f(e,ne)}while(!0);return t&&e.shellSuspendCounter++,Dn=Ca=null,Xe=s,H.H=c,H.A=d,Oe===null&&(et=null,Le=0,Js()),h}function Rg(){for(;Oe!==null;)zf(Oe)}function Mg(e,t){var n=Xe;Xe|=2;var s=Df(),c=Lf();et!==e||Le!==t?(Tr=null,Cr=$e()+500,yl(e,t)):xl=Vn(e,t);e:do try{if(Ie!==0&&Oe!==null){t=Oe;var d=Kt;t:switch(Ie){case 1:Ie=0,Kt=null,vl(e,t,d,1);break;case 2:case 9:if(Zd(d)){Ie=0,Kt=null,Bf(t);break}t=function(){Ie!==2&&Ie!==9||et!==e||(Ie=7),Nn(e)},d.then(t,t);break e;case 3:Ie=7;break e;case 4:Ie=5;break e;case 7:Zd(d)?(Ie=0,Kt=null,Bf(t)):(Ie=0,Kt=null,vl(e,t,d,7));break;case 5:var h=null;switch(Oe.tag){case 26:h=Oe.memoizedState;case 5:case 27:var w=Oe;if(h?wp(h):w.stateNode.complete){Ie=0,Kt=null;var R=w.sibling;if(R!==null)Oe=R;else{var Y=w.return;Y!==null?(Oe=Y,Mr(Y)):Oe=null}break t}}Ie=0,Kt=null,vl(e,t,d,5);break;case 6:Ie=0,Kt=null,vl(e,t,d,6);break;case 8:dc(),ct=6;break e;default:throw Error(o(462))}}_g();break}catch(ne){_f(e,ne)}while(!0);return Dn=Ca=null,H.H=s,H.A=c,Xe=n,Oe!==null?0:(et=null,Le=0,Js(),ct)}function _g(){for(;Oe!==null&&!Bt();)zf(Oe)}function zf(e){var t=sf(e.alternate,e,Fn);e.memoizedProps=e.pendingProps,t===null?Mr(e):Oe=t}function Bf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Wm(n,t,t.pendingProps,t.type,void 0,Le);break;case 11:t=Wm(n,t,t.pendingProps,t.type.render,t.ref,Le);break;case 5:Co(t);default:of(n,t),t=Oe=Dd(t,Fn),t=sf(n,t,Fn)}e.memoizedProps=e.pendingProps,t===null?Mr(e):Oe=t}function vl(e,t,n,s){Dn=Ca=null,Co(t),cl=null,Il=0;var c=t.return;try{if(vg(e,c,t,n,Le)){ct=1,br(e,ln(n,e.current)),Oe=null;return}}catch(d){if(c!==null)throw Oe=c,d;ct=1,br(e,ln(n,e.current)),Oe=null;return}t.flags&32768?(Be||s===1?e=!0:xl||(Le&536870912)!==0?e=!1:(ia=e=!0,(s===2||s===9||s===3||s===6)&&(s=It.current,s!==null&&s.tag===13&&(s.flags|=16384))),Uf(t,e)):Mr(t)}function Mr(e){var t=e;do{if((t.flags&32768)!==0){Uf(t,ia);return}e=t.return;var n=Ng(t.alternate,t,Fn);if(n!==null){Oe=n;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);ct===0&&(ct=5)}function Uf(e,t){do{var n=Sg(e.alternate,e);if(n!==null){n.flags&=32767,Oe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Oe=e;return}Oe=e=n}while(e!==null);ct=6,Oe=null}function $f(e,t,n,s,c,d,h,w,R){e.cancelPendingCommit=null;do _r();while(yt!==0);if((Xe&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(d=t.lanes|t.childLanes,d|=Wi,dx(e,n,d,h,w,R),e===et&&(Oe=et=null,Le=0),bl=t,ua=e,Zn=n,oc=d,cc=c,Tf=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,zg(G,function(){return Ff(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=H.T,H.T=null,c=L.p,L.p=2,h=Xe,Xe|=4;try{kg(e,t,n)}finally{Xe=h,L.p=c,H.T=s}}yt=1,Hf(),Gf(),qf()}}function Hf(){if(yt===1){yt=0;var e=ua,t=bl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=H.T,H.T=null;var s=L.p;L.p=2;var c=Xe;Xe|=4;try{vf(t,e);var d=Sc,h=kd(e.containerInfo),w=d.focusedElem,R=d.selectionRange;if(h!==w&&w&&w.ownerDocument&&Sd(w.ownerDocument.documentElement,w)){if(R!==null&&Vi(w)){var Y=R.start,ne=R.end;if(ne===void 0&&(ne=Y),"selectionStart"in w)w.selectionStart=Y,w.selectionEnd=Math.min(ne,w.value.length);else{var re=w.ownerDocument||document,X=re&&re.defaultView||window;if(X.getSelection){var Q=X.getSelection(),he=w.textContent.length,we=Math.min(R.start,he),We=R.end===void 0?we:Math.min(R.end,he);!Q.extend&&we>We&&(h=We,We=we,we=h);var U=Nd(w,we),D=Nd(w,We);if(U&&D&&(Q.rangeCount!==1||Q.anchorNode!==U.node||Q.anchorOffset!==U.offset||Q.focusNode!==D.node||Q.focusOffset!==D.offset)){var q=re.createRange();q.setStart(U.node,U.offset),Q.removeAllRanges(),we>We?(Q.addRange(q),Q.extend(D.node,D.offset)):(q.setEnd(D.node,D.offset),Q.addRange(q))}}}}for(re=[],Q=w;Q=Q.parentNode;)Q.nodeType===1&&re.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<re.length;w++){var le=re[w];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Fr=!!Nc,Sc=Nc=null}finally{Xe=c,L.p=s,H.T=n}}e.current=t,yt=2}}function Gf(){if(yt===2){yt=0;var e=ua,t=bl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=H.T,H.T=null;var s=L.p;L.p=2;var c=Xe;Xe|=4;try{hf(e,t.alternate,t)}finally{Xe=c,L.p=s,H.T=n}}yt=3}}function qf(){if(yt===4||yt===3){yt=0,mn();var e=ua,t=bl,n=Zn,s=Tf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?yt=5:(yt=0,bl=ua=null,Yf(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(ca=null),Ai(n),t=t.stateNode,ge&&typeof ge.onCommitFiberRoot=="function")try{ge.onCommitFiberRoot(ue,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=H.T,c=L.p,L.p=2,H.T=null;try{for(var d=e.onRecoverableError,h=0;h<s.length;h++){var w=s[h];d(w.value,{componentStack:w.stack})}}finally{H.T=t,L.p=c}}(Zn&3)!==0&&_r(),Nn(e),c=e.pendingLanes,(n&261930)!==0&&(c&42)!==0?e===uc?ms++:(ms=0,uc=e):ms=0,fs(0)}}function Yf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ql(t)))}function _r(){return Hf(),Gf(),qf(),Ff()}function Ff(){if(yt!==5)return!1;var e=ua,t=oc;oc=0;var n=Ai(Zn),s=H.T,c=L.p;try{L.p=32>n?32:n,H.T=null,n=cc,cc=null;var d=ua,h=Zn;if(yt=0,bl=ua=null,Zn=0,(Xe&6)!==0)throw Error(o(331));var w=Xe;if(Xe|=4,kf(d.current),wf(d,d.current,h,n),Xe=w,fs(0,!1),ge&&typeof ge.onPostCommitFiberRoot=="function")try{ge.onPostCommitFiberRoot(ue,d)}catch{}return!0}finally{L.p=c,H.T=s,Yf(e,t)}}function Zf(e,t,n){t=ln(n,t),t=qo(e.stateNode,t,2),e=aa(e,t,2),e!==null&&(Ol(e,2),Nn(e))}function Je(e,t,n){if(e.tag===3)Zf(e,e,n);else for(;t!==null;){if(t.tag===3){Zf(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ca===null||!ca.has(s))){e=ln(n,e),n=Zm(2),s=aa(t,n,2),s!==null&&(Xm(n,s,t,e),Ol(s,2),Nn(s));break}}t=t.return}}function fc(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new Tg;var c=new Set;s.set(t,c)}else c=s.get(t),c===void 0&&(c=new Set,s.set(t,c));c.has(n)||(sc=!0,c.add(n),e=Og.bind(null,e,t,n),t.then(e,e))}function Og(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,et===e&&(Le&n)===n&&(ct===4||ct===3&&(Le&62914560)===Le&&300>$e()-Er?(Xe&2)===0&&yl(e,0):rc|=n,gl===Le&&(gl=0)),Nn(e)}function Xf(e,t){t===0&&(t=$u()),e=Sa(e,t),e!==null&&(Ol(e,t),Nn(e))}function Dg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xf(e,n)}function Lg(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(n=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(o(314))}s!==null&&s.delete(t),Xf(e,n)}function zg(e,t){return Lt(e,t)}var Or=null,jl=null,pc=!1,Dr=!1,hc=!1,ma=0;function Nn(e){e!==jl&&e.next===null&&(jl===null?Or=jl=e:jl=jl.next=e),Dr=!0,pc||(pc=!0,Ug())}function fs(e,t){if(!hc&&Dr){hc=!0;do for(var n=!1,s=Or;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var d=0;else{var h=s.suspendedLanes,w=s.pingedLanes;d=(1<<31-Re(42|e)+1)-1,d&=c&~(h&~w),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(n=!0,Jf(s,d))}else d=Le,d=ya(s,s===et?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||Vn(s,d)||(n=!0,Jf(s,d));s=s.next}while(n);hc=!1}}function Bg(){Qf()}function Qf(){Dr=pc=!1;var e=0;ma!==0&&Vg()&&(e=ma);for(var t=$e(),n=null,s=Or;s!==null;){var c=s.next,d=Vf(s,t);d===0?(s.next=null,n===null?Or=c:n.next=c,c===null&&(jl=n)):(n=s,(e!==0||(d&3)!==0)&&(Dr=!0)),s=c}yt!==0&&yt!==5||fs(e),ma!==0&&(ma=0)}function Vf(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var h=31-Re(d),w=1<<h,R=c[h];R===-1?((w&n)===0||(w&s)!==0)&&(c[h]=Us(w,t)):R<=t&&(e.expiredLanes|=w),d&=~w}if(t=et,n=Le,n=ya(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&zt(s),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Vn(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&zt(s),Ai(n)){case 2:case 8:n=St;break;case 32:n=G;break;case 268435456:n=Ee;break;default:n=G}return s=If.bind(null,e),n=Lt(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&zt(s),e.callbackPriority=2,e.callbackNode=null,2}function If(e,t){if(yt!==0&&yt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(_r()&&e.callbackNode!==n)return null;var s=Le;return s=ya(e,e===et?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Rf(e,s,t),Vf(e,$e()),e.callbackNode!=null&&e.callbackNode===n?If.bind(null,e):null)}function Jf(e,t){if(_r())return null;Rf(e,t,!0)}function Ug(){Jg(function(){(Xe&6)!==0?Lt(fn,Bg):Qf()})}function xc(){if(ma===0){var e=rl;e===0&&(e=kt,kt<<=1,(kt&261888)===0&&(kt=256)),ma=e}return ma}function Kf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:qs(""+e)}function Pf(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function $g(e,t,n,s,c){if(t==="submit"&&n&&n.stateNode===c){var d=Kf((c[Ut]||null).action),h=s.submitter;h&&(t=(t=h[Ut]||null)?Kf(t.formAction):h.getAttribute("formAction"),t!==null&&(d=t,h=null));var w=new Xs("action","action",null,s,c);e.push({event:w,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ma!==0){var R=h?Pf(c,h):new FormData(c);zo(n,{pending:!0,data:R,method:c.method,action:d},null,R)}}else typeof d=="function"&&(w.preventDefault(),R=h?Pf(c,h):new FormData(c),zo(n,{pending:!0,data:R,method:c.method,action:d},d,R))},currentTarget:c}]})}}for(var gc=0;gc<Pi.length;gc++){var bc=Pi[gc],Hg=bc.toLowerCase(),Gg=bc[0].toUpperCase()+bc.slice(1);pn(Hg,"on"+Gg)}pn(Td,"onAnimationEnd"),pn(Ad,"onAnimationIteration"),pn(Rd,"onAnimationStart"),pn("dblclick","onDoubleClick"),pn("focusin","onFocus"),pn("focusout","onBlur"),pn(ag,"onTransitionRun"),pn(lg,"onTransitionStart"),pn(sg,"onTransitionCancel"),pn(Md,"onTransitionEnd"),Xa("onMouseEnter",["mouseout","mouseover"]),Xa("onMouseLeave",["mouseout","mouseover"]),Xa("onPointerEnter",["pointerout","pointerover"]),Xa("onPointerLeave",["pointerout","pointerover"]),va("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),va("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),va("onBeforeInput",["compositionend","keypress","textInput","paste"]),va("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),va("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),va("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ps="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),qg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ps));function Wf(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],c=s.event;s=s.listeners;e:{var d=void 0;if(t)for(var h=s.length-1;0<=h;h--){var w=s[h],R=w.instance,Y=w.currentTarget;if(w=w.listener,R!==d&&c.isPropagationStopped())break e;d=w,c.currentTarget=Y;try{d(c)}catch(ne){Is(ne)}c.currentTarget=null,d=R}else for(h=0;h<s.length;h++){if(w=s[h],R=w.instance,Y=w.currentTarget,w=w.listener,R!==d&&c.isPropagationStopped())break e;d=w,c.currentTarget=Y;try{d(c)}catch(ne){Is(ne)}c.currentTarget=null,d=R}}}}function De(e,t){var n=t[Ri];n===void 0&&(n=t[Ri]=new Set);var s=e+"__bubble";n.has(s)||(ep(t,e,2,!1),n.add(s))}function yc(e,t,n){var s=0;t&&(s|=4),ep(n,e,s,t)}var Lr="_reactListening"+Math.random().toString(36).slice(2);function vc(e){if(!e[Lr]){e[Lr]=!0,Xu.forEach(function(n){n!=="selectionchange"&&(qg.has(n)||yc(n,!1,e),yc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Lr]||(t[Lr]=!0,yc("selectionchange",!1,t))}}function ep(e,t,n,s){switch(Ap(t)){case 2:var c=xb;break;case 8:c=gb;break;default:c=Lc}n=c.bind(null,t,n,e),c=void 0,!$i||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(t,n,{capture:!0,passive:c}):e.addEventListener(t,n,!0):c!==void 0?e.addEventListener(t,n,{passive:c}):e.addEventListener(t,n,!1)}function jc(e,t,n,s,c){var d=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var h=s.tag;if(h===3||h===4){var w=s.stateNode.containerInfo;if(w===c)break;if(h===4)for(h=s.return;h!==null;){var R=h.tag;if((R===3||R===4)&&h.stateNode.containerInfo===c)return;h=h.return}for(;w!==null;){if(h=Ya(w),h===null)return;if(R=h.tag,R===5||R===6||R===26||R===27){s=d=h;continue e}w=w.parentNode}}s=s.return}ld(function(){var Y=d,ne=Bi(n),re=[];e:{var X=_d.get(e);if(X!==void 0){var Q=Xs,he=e;switch(e){case"keypress":if(Fs(n)===0)break e;case"keydown":case"keyup":Q=Lx;break;case"focusin":he="focus",Q=Yi;break;case"focusout":he="blur",Q=Yi;break;case"beforeblur":case"afterblur":Q=Yi;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=id;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=Nx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=Ux;break;case Td:case Ad:case Rd:Q=Ex;break;case Md:Q=Hx;break;case"scroll":case"scrollend":Q=jx;break;case"wheel":Q=qx;break;case"copy":case"cut":case"paste":Q=Tx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=cd;break;case"toggle":case"beforetoggle":Q=Fx}var we=(t&4)!==0,We=!we&&(e==="scroll"||e==="scrollend"),U=we?X!==null?X+"Capture":null:X;we=[];for(var D=Y,q;D!==null;){var le=D;if(q=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||q===null||U===null||(le=zl(D,U),le!=null&&we.push(hs(D,le,q))),We)break;D=D.return}0<we.length&&(X=new Q(X,he,null,n,ne),re.push({event:X,listeners:we}))}}if((t&7)===0){e:{if(X=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",X&&n!==zi&&(he=n.relatedTarget||n.fromElement)&&(Ya(he)||he[qa]))break e;if((Q||X)&&(X=ne.window===ne?ne:(X=ne.ownerDocument)?X.defaultView||X.parentWindow:window,Q?(he=n.relatedTarget||n.toElement,Q=Y,he=he?Ya(he):null,he!==null&&(We=m(he),we=he.tag,he!==We||we!==5&&we!==27&&we!==6)&&(he=null)):(Q=null,he=Y),Q!==he)){if(we=id,le="onMouseLeave",U="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(we=cd,le="onPointerLeave",U="onPointerEnter",D="pointer"),We=Q==null?X:Ll(Q),q=he==null?X:Ll(he),X=new we(le,D+"leave",Q,n,ne),X.target=We,X.relatedTarget=q,le=null,Ya(ne)===Y&&(we=new we(U,D+"enter",he,n,ne),we.target=q,we.relatedTarget=We,le=we),We=le,Q&&he)t:{for(we=Yg,U=Q,D=he,q=0,le=U;le;le=we(le))q++;le=0;for(var ve=D;ve;ve=we(ve))le++;for(;0<q-le;)U=we(U),q--;for(;0<le-q;)D=we(D),le--;for(;q--;){if(U===D||D!==null&&U===D.alternate){we=U;break t}U=we(U),D=we(D)}we=null}else we=null;Q!==null&&tp(re,X,Q,we,!1),he!==null&&We!==null&&tp(re,We,he,we,!0)}}e:{if(X=Y?Ll(Y):window,Q=X.nodeName&&X.nodeName.toLowerCase(),Q==="select"||Q==="input"&&X.type==="file")var Ye=gd;else if(hd(X))if(bd)Ye=eg;else{Ye=Px;var be=Kx}else Q=X.nodeName,!Q||Q.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?Y&&Li(Y.elementType)&&(Ye=gd):Ye=Wx;if(Ye&&(Ye=Ye(e,Y))){xd(re,Ye,n,ne);break e}be&&be(e,X,Y),e==="focusout"&&Y&&X.type==="number"&&Y.memoizedProps.value!=null&&Di(X,"number",X.value)}switch(be=Y?Ll(Y):window,e){case"focusin":(hd(be)||be.contentEditable==="true")&&(Pa=be,Ii=Y,Fl=null);break;case"focusout":Fl=Ii=Pa=null;break;case"mousedown":Ji=!0;break;case"contextmenu":case"mouseup":case"dragend":Ji=!1,Ed(re,n,ne);break;case"selectionchange":if(ng)break;case"keydown":case"keyup":Ed(re,n,ne)}var Te;if(Zi)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Ka?fd(e,n)&&(ze="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ze="onCompositionStart");ze&&(ud&&n.locale!=="ko"&&(Ka||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Ka&&(Te=sd()):(Jn=ne,Hi="value"in Jn?Jn.value:Jn.textContent,Ka=!0)),be=zr(Y,ze),0<be.length&&(ze=new od(ze,e,null,n,ne),re.push({event:ze,listeners:be}),Te?ze.data=Te:(Te=pd(n),Te!==null&&(ze.data=Te)))),(Te=Xx?Qx(e,n):Vx(e,n))&&(ze=zr(Y,"onBeforeInput"),0<ze.length&&(be=new od("onBeforeInput","beforeinput",null,n,ne),re.push({event:be,listeners:ze}),be.data=Te)),$g(re,e,Y,n,ne)}Wf(re,t)})}function hs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function zr(e,t){for(var n=t+"Capture",s=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=zl(e,n),c!=null&&s.unshift(hs(e,c,d)),c=zl(e,t),c!=null&&s.push(hs(e,c,d))),e.tag===3)return s;e=e.return}return[]}function Yg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function tp(e,t,n,s,c){for(var d=t._reactName,h=[];n!==null&&n!==s;){var w=n,R=w.alternate,Y=w.stateNode;if(w=w.tag,R!==null&&R===s)break;w!==5&&w!==26&&w!==27||Y===null||(R=Y,c?(Y=zl(n,d),Y!=null&&h.unshift(hs(n,Y,R))):c||(Y=zl(n,d),Y!=null&&h.push(hs(n,Y,R)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var Fg=/\r\n?/g,Zg=/\u0000|\uFFFD/g;function np(e){return(typeof e=="string"?e:""+e).replace(Fg,`
|
|
56
|
-
`).replace(Zg,"")}function ap(e,t){return t=np(t),np(e)===t}function Pe(e,t,n,s,c,d){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Va(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Va(e,""+s);break;case"className":Hs(e,"class",s);break;case"tabIndex":Hs(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Hs(e,n,s);break;case"style":nd(e,s,d);break;case"data":if(t!=="object"){Hs(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=qs(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(n==="formAction"?(t!=="input"&&Pe(e,t,"name",c.name,c,null),Pe(e,t,"formEncType",c.formEncType,c,null),Pe(e,t,"formMethod",c.formMethod,c,null),Pe(e,t,"formTarget",c.formTarget,c,null)):(Pe(e,t,"encType",c.encType,c,null),Pe(e,t,"method",c.method,c,null),Pe(e,t,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=qs(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=Rn);break;case"onScroll":s!=null&&De("scroll",e);break;case"onScrollEnd":s!=null&&De("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(o(61));if(n=s.__html,n!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=qs(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":De("beforetoggle",e),De("toggle",e),$s(e,"popover",s);break;case"xlinkActuate":An(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":An(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":An(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":An(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":An(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":An(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":An(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":An(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":An(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":$s(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=yx.get(n)||n,$s(e,n,s))}}function wc(e,t,n,s,c,d){switch(n){case"style":nd(e,s,d);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(o(61));if(n=s.__html,n!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"children":typeof s=="string"?Va(e,s):(typeof s=="number"||typeof s=="bigint")&&Va(e,""+s);break;case"onScroll":s!=null&&De("scroll",e);break;case"onScrollEnd":s!=null&&De("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Rn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qu.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(c=n.endsWith("Capture"),t=n.slice(2,c?n.length-7:void 0),d=e[Ut]||null,d=d!=null?d[n]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof s=="function")){typeof d!="function"&&d!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,c);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):$s(e,n,s)}}}function Rt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var s=!1,c=!1,d;for(d in n)if(n.hasOwnProperty(d)){var h=n[d];if(h!=null)switch(d){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Pe(e,t,d,h,n,null)}}c&&Pe(e,t,"srcSet",n.srcSet,n,null),s&&Pe(e,t,"src",n.src,n,null);return;case"input":De("invalid",e);var w=d=h=c=null,R=null,Y=null;for(s in n)if(n.hasOwnProperty(s)){var ne=n[s];if(ne!=null)switch(s){case"name":c=ne;break;case"type":h=ne;break;case"checked":R=ne;break;case"defaultChecked":Y=ne;break;case"value":d=ne;break;case"defaultValue":w=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(o(137,t));break;default:Pe(e,t,s,ne,n,null)}}Pu(e,d,w,R,Y,h,c,!1);return;case"select":De("invalid",e),s=h=d=null;for(c in n)if(n.hasOwnProperty(c)&&(w=n[c],w!=null))switch(c){case"value":d=w;break;case"defaultValue":h=w;break;case"multiple":s=w;default:Pe(e,t,c,w,n,null)}t=d,n=h,e.multiple=!!s,t!=null?Qa(e,!!s,t,!1):n!=null&&Qa(e,!!s,n,!0);return;case"textarea":De("invalid",e),d=c=s=null;for(h in n)if(n.hasOwnProperty(h)&&(w=n[h],w!=null))switch(h){case"value":s=w;break;case"defaultValue":c=w;break;case"children":d=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(o(91));break;default:Pe(e,t,h,w,n,null)}ed(e,s,c,d);return;case"option":for(R in n)if(n.hasOwnProperty(R)&&(s=n[R],s!=null))switch(R){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Pe(e,t,R,s,n,null)}return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(s=0;s<ps.length;s++)De(ps[s],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in n)if(n.hasOwnProperty(Y)&&(s=n[Y],s!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Pe(e,t,Y,s,n,null)}return;default:if(Li(t)){for(ne in n)n.hasOwnProperty(ne)&&(s=n[ne],s!==void 0&&wc(e,t,ne,s,n,void 0));return}}for(w in n)n.hasOwnProperty(w)&&(s=n[w],s!=null&&Pe(e,t,w,s,n,null))}function Xg(e,t,n,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,h=null,w=null,R=null,Y=null,ne=null;for(Q in n){var re=n[Q];if(n.hasOwnProperty(Q)&&re!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":R=re;default:s.hasOwnProperty(Q)||Pe(e,t,Q,null,s,re)}}for(var X in s){var Q=s[X];if(re=n[X],s.hasOwnProperty(X)&&(Q!=null||re!=null))switch(X){case"type":d=Q;break;case"name":c=Q;break;case"checked":Y=Q;break;case"defaultChecked":ne=Q;break;case"value":h=Q;break;case"defaultValue":w=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(o(137,t));break;default:Q!==re&&Pe(e,t,X,Q,s,re)}}Oi(e,h,w,R,Y,ne,d,c);return;case"select":Q=h=w=X=null;for(d in n)if(R=n[d],n.hasOwnProperty(d)&&R!=null)switch(d){case"value":break;case"multiple":Q=R;default:s.hasOwnProperty(d)||Pe(e,t,d,null,s,R)}for(c in s)if(d=s[c],R=n[c],s.hasOwnProperty(c)&&(d!=null||R!=null))switch(c){case"value":X=d;break;case"defaultValue":w=d;break;case"multiple":h=d;default:d!==R&&Pe(e,t,c,d,s,R)}t=w,n=h,s=Q,X!=null?Qa(e,!!n,X,!1):!!s!=!!n&&(t!=null?Qa(e,!!n,t,!0):Qa(e,!!n,n?[]:"",!1));return;case"textarea":Q=X=null;for(w in n)if(c=n[w],n.hasOwnProperty(w)&&c!=null&&!s.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Pe(e,t,w,null,s,c)}for(h in s)if(c=s[h],d=n[h],s.hasOwnProperty(h)&&(c!=null||d!=null))switch(h){case"value":X=c;break;case"defaultValue":Q=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==d&&Pe(e,t,h,c,s,d)}Wu(e,X,Q);return;case"option":for(var he in n)if(X=n[he],n.hasOwnProperty(he)&&X!=null&&!s.hasOwnProperty(he))switch(he){case"selected":e.selected=!1;break;default:Pe(e,t,he,null,s,X)}for(R in s)if(X=s[R],Q=n[R],s.hasOwnProperty(R)&&X!==Q&&(X!=null||Q!=null))switch(R){case"selected":e.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:Pe(e,t,R,X,s,Q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var we in n)X=n[we],n.hasOwnProperty(we)&&X!=null&&!s.hasOwnProperty(we)&&Pe(e,t,we,null,s,X);for(Y in s)if(X=s[Y],Q=n[Y],s.hasOwnProperty(Y)&&X!==Q&&(X!=null||Q!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(o(137,t));break;default:Pe(e,t,Y,X,s,Q)}return;default:if(Li(t)){for(var We in n)X=n[We],n.hasOwnProperty(We)&&X!==void 0&&!s.hasOwnProperty(We)&&wc(e,t,We,void 0,s,X);for(ne in s)X=s[ne],Q=n[ne],!s.hasOwnProperty(ne)||X===Q||X===void 0&&Q===void 0||wc(e,t,ne,X,s,Q);return}}for(var U in n)X=n[U],n.hasOwnProperty(U)&&X!=null&&!s.hasOwnProperty(U)&&Pe(e,t,U,null,s,X);for(re in s)X=s[re],Q=n[re],!s.hasOwnProperty(re)||X===Q||X==null&&Q==null||Pe(e,t,re,X,s,Q)}function lp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Qg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var c=n[s],d=c.transferSize,h=c.initiatorType,w=c.duration;if(d&&w&&lp(h)){for(h=0,w=c.responseEnd,s+=1;s<n.length;s++){var R=n[s],Y=R.startTime;if(Y>w)break;var ne=R.transferSize,re=R.initiatorType;ne&&lp(re)&&(R=R.responseEnd,h+=ne*(R<w?1:(w-Y)/(R-Y)))}if(--s,t+=8*(d+h)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Nc=null,Sc=null;function Br(e){return e.nodeType===9?e:e.ownerDocument}function sp(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function rp(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function kc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ec=null;function Vg(){var e=window.event;return e&&e.type==="popstate"?e===Ec?!1:(Ec=e,!0):(Ec=null,!1)}var ip=typeof setTimeout=="function"?setTimeout:void 0,Ig=typeof clearTimeout=="function"?clearTimeout:void 0,op=typeof Promise=="function"?Promise:void 0,Jg=typeof queueMicrotask=="function"?queueMicrotask:typeof op<"u"?function(e){return op.resolve(null).then(e).catch(Kg)}:ip;function Kg(e){setTimeout(function(){throw e})}function fa(e){return e==="head"}function cp(e,t){var n=t,s=0;do{var c=n.nextSibling;if(e.removeChild(n),c&&c.nodeType===8)if(n=c.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(c),kl(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")xs(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,xs(n);for(var d=n.firstChild;d;){var h=d.nextSibling,w=d.nodeName;d[Dl]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&d.rel.toLowerCase()==="stylesheet"||n.removeChild(d),d=h}}else n==="body"&&xs(e.ownerDocument.body);n=c}while(n);kl(t)}function up(e,t){var n=e;e=0;do{var s=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=s}while(n)}function Cc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Cc(n),Mi(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Pg(e,t,n,s){for(;e.nodeType===1;){var c=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Dl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=un(e.nextSibling),e===null)break}return null}function Wg(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=un(e.nextSibling),e===null))return null;return e}function dp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=un(e.nextSibling),e===null))return null;return e}function Tc(e){return e.data==="$?"||e.data==="$~"}function Ac(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function eb(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function un(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Rc=null;function mp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return un(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function fp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function pp(e,t,n){switch(t=Br(n),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function xs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mi(e)}var dn=new Map,hp=new Set;function Ur(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Xn=L.d;L.d={f:tb,r:nb,D:ab,C:lb,L:sb,m:rb,X:ob,S:ib,M:cb};function tb(){var e=Xn.f(),t=Ar();return e||t}function nb(e){var t=Fa(e);t!==null&&t.tag===5&&t.type==="form"?Mm(t):Xn.r(e)}var wl=typeof document>"u"?null:document;function xp(e,t,n){var s=wl;if(s&&typeof t=="string"&&t){var c=nn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof n=="string"&&(c+='[crossorigin="'+n+'"]'),hp.has(c)||(hp.add(c),e={rel:e,crossOrigin:n,href:t},s.querySelector(c)===null&&(t=s.createElement("link"),Rt(t,"link",e),wt(t),s.head.appendChild(t)))}}function ab(e){Xn.D(e),xp("dns-prefetch",e,null)}function lb(e,t){Xn.C(e,t),xp("preconnect",e,t)}function sb(e,t,n){Xn.L(e,t,n);var s=wl;if(s&&e&&t){var c='link[rel="preload"][as="'+nn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(c+='[imagesrcset="'+nn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(c+='[imagesizes="'+nn(n.imageSizes)+'"]')):c+='[href="'+nn(e)+'"]';var d=c;switch(t){case"style":d=Nl(e);break;case"script":d=Sl(e)}dn.has(d)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),dn.set(d,e),s.querySelector(c)!==null||t==="style"&&s.querySelector(gs(d))||t==="script"&&s.querySelector(bs(d))||(t=s.createElement("link"),Rt(t,"link",e),wt(t),s.head.appendChild(t)))}}function rb(e,t){Xn.m(e,t);var n=wl;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+nn(s)+'"][href="'+nn(e)+'"]',d=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Sl(e)}if(!dn.has(d)&&(e=j({rel:"modulepreload",href:e},t),dn.set(d,e),n.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(bs(d)))return}s=n.createElement("link"),Rt(s,"link",e),wt(s),n.head.appendChild(s)}}}function ib(e,t,n){Xn.S(e,t,n);var s=wl;if(s&&e){var c=Za(s).hoistableStyles,d=Nl(e);t=t||"default";var h=c.get(d);if(!h){var w={loading:0,preload:null};if(h=s.querySelector(gs(d)))w.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=dn.get(d))&&Mc(e,n);var R=h=s.createElement("link");wt(R),Rt(R,"link",e),R._p=new Promise(function(Y,ne){R.onload=Y,R.onerror=ne}),R.addEventListener("load",function(){w.loading|=1}),R.addEventListener("error",function(){w.loading|=2}),w.loading|=4,$r(h,t,s)}h={type:"stylesheet",instance:h,count:1,state:w},c.set(d,h)}}}function ob(e,t){Xn.X(e,t);var n=wl;if(n&&e){var s=Za(n).hoistableScripts,c=Sl(e),d=s.get(c);d||(d=n.querySelector(bs(c)),d||(e=j({src:e,async:!0},t),(t=dn.get(c))&&_c(e,t),d=n.createElement("script"),wt(d),Rt(d,"link",e),n.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function cb(e,t){Xn.M(e,t);var n=wl;if(n&&e){var s=Za(n).hoistableScripts,c=Sl(e),d=s.get(c);d||(d=n.querySelector(bs(c)),d||(e=j({src:e,async:!0,type:"module"},t),(t=dn.get(c))&&_c(e,t),d=n.createElement("script"),wt(d),Rt(d,"link",e),n.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function gp(e,t,n,s){var c=(c=fe.current)?Ur(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Nl(n.href),n=Za(c).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Nl(n.href);var d=Za(c).hoistableStyles,h=d.get(e);if(h||(c=c.ownerDocument||c,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,h),(d=c.querySelector(gs(e)))&&!d._p&&(h.instance=d,h.state.loading=5),dn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},dn.set(e,n),d||ub(c,e,n,h.state))),t&&s===null)throw Error(o(528,""));return h}if(t&&s!==null)throw Error(o(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Sl(n),n=Za(c).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Nl(e){return'href="'+nn(e)+'"'}function gs(e){return'link[rel="stylesheet"]['+e+"]"}function bp(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function ub(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Rt(t,"link",n),wt(t),e.head.appendChild(t))}function Sl(e){return'[src="'+nn(e)+'"]'}function bs(e){return"script[async]"+e}function yp(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+nn(n.href)+'"]');if(s)return t.instance=s,wt(s),s;var c=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),wt(s),Rt(s,"style",c),$r(s,n.precedence,e),t.instance=s;case"stylesheet":c=Nl(n.href);var d=e.querySelector(gs(c));if(d)return t.state.loading|=4,t.instance=d,wt(d),d;s=bp(n),(c=dn.get(c))&&Mc(s,c),d=(e.ownerDocument||e).createElement("link"),wt(d);var h=d;return h._p=new Promise(function(w,R){h.onload=w,h.onerror=R}),Rt(d,"link",s),t.state.loading|=4,$r(d,n.precedence,e),t.instance=d;case"script":return d=Sl(n.src),(c=e.querySelector(bs(d)))?(t.instance=c,wt(c),c):(s=n,(c=dn.get(d))&&(s=j({},n),_c(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),wt(c),Rt(c,"link",s),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,$r(s,n.precedence,e));return t.instance}function $r(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,d=c,h=0;h<s.length;h++){var w=s[h];if(w.dataset.precedence===t)d=w;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Mc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function _c(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Hr=null;function vp(e,t,n){if(Hr===null){var s=new Map,c=Hr=new Map;c.set(n,s)}else c=Hr,s=c.get(n),s||(s=new Map,c.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),c=0;c<n.length;c++){var d=n[c];if(!(d[Dl]||d[Et]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var h=d.getAttribute(t)||"";h=e+h;var w=s.get(h);w?w.push(d):s.set(h,[d])}}return s}function jp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function db(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function wp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function mb(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var c=Nl(s.href),d=t.querySelector(gs(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Gr.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=d,wt(d);return}d=t.ownerDocument||t,s=bp(s),(c=dn.get(c))&&Mc(s,c),d=d.createElement("link"),wt(d);var h=d;h._p=new Promise(function(w,R){h.onload=w,h.onerror=R}),Rt(d,"link",s),n.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Gr.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Oc=0;function fb(e,t){return e.stylesheets&&e.count===0&&Yr(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&Yr(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Oc===0&&(Oc=62500*Qg());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Yr(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Oc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(c)}}:null}function Gr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var qr=null;function Yr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,qr=new Map,t.forEach(pb,e),qr=null,Gr.call(e))}function pb(e,t){if(!(t.state.loading&4)){var n=qr.get(e);if(n)var s=n.get(null);else{n=new Map,qr.set(e,n);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var h=c[d];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(n.set(h.dataset.precedence,h),s=h)}s&&n.set(null,s)}c=t.instance,h=c.getAttribute("data-precedence"),d=n.get(h)||s,d===s&&n.set(null,c),n.set(h,c),this.count++,s=Gr.bind(this),c.addEventListener("load",s),c.addEventListener("error",s),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var ys={$$typeof:A,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function hb(e,t,n,s,c,d,h,w,R){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ci(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ci(0),this.hiddenUpdates=Ci(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function Np(e,t,n,s,c,d,h,w,R,Y,ne,re){return e=new hb(e,t,n,h,R,Y,ne,re,w),t=1,d===!0&&(t|=24),d=Vt(3,null,null,t),e.current=d,d.stateNode=e,t=mo(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:s,isDehydrated:n,cache:t},xo(d),e}function Sp(e){return e?(e=tl,e):tl}function kp(e,t,n,s,c,d){c=Sp(c),s.context===null?s.context=c:s.pendingContext=c,s=na(t),s.payload={element:n},d=d===void 0?null:d,d!==null&&(s.callback=d),n=aa(e,s,t),n!==null&&(Ft(n,e,t),Kl(n,e,t))}function Ep(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Dc(e,t){Ep(e,t),(e=e.alternate)&&Ep(e,t)}function Cp(e){if(e.tag===13||e.tag===31){var t=Sa(e,67108864);t!==null&&Ft(t,e,67108864),Dc(e,67108864)}}function Tp(e){if(e.tag===13||e.tag===31){var t=Wt();t=Ti(t);var n=Sa(e,t);n!==null&&Ft(n,e,t),Dc(e,t)}}var Fr=!0;function xb(e,t,n,s){var c=H.T;H.T=null;var d=L.p;try{L.p=2,Lc(e,t,n,s)}finally{L.p=d,H.T=c}}function gb(e,t,n,s){var c=H.T;H.T=null;var d=L.p;try{L.p=8,Lc(e,t,n,s)}finally{L.p=d,H.T=c}}function Lc(e,t,n,s){if(Fr){var c=zc(s);if(c===null)jc(e,t,s,Zr,n),Rp(e,s);else if(yb(c,e,t,n,s))s.stopPropagation();else if(Rp(e,s),t&4&&-1<bb.indexOf(e)){for(;c!==null;){var d=Fa(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var h=yn(d.pendingLanes);if(h!==0){var w=d;for(w.pendingLanes|=2,w.entangledLanes|=2;h;){var R=1<<31-Re(h);w.entanglements[1]|=R,h&=~R}Nn(d),(Xe&6)===0&&(Cr=$e()+500,fs(0))}}break;case 31:case 13:w=Sa(d,2),w!==null&&Ft(w,d,2),Ar(),Dc(d,2)}if(d=zc(s),d===null&&jc(e,t,s,Zr,n),d===c)break;c=d}c!==null&&s.stopPropagation()}else jc(e,t,s,null,n)}}function zc(e){return e=Bi(e),Bc(e)}var Zr=null;function Bc(e){if(Zr=null,e=Ya(e),e!==null){var t=m(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=p(t),e!==null)return e;e=null}else if(n===31){if(e=x(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Zr=e,null}function Ap(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Tn()){case fn:return 2;case St:return 8;case G:case je:return 32;case Ee:return 268435456;default:return 32}default:return 32}}var Uc=!1,pa=null,ha=null,xa=null,vs=new Map,js=new Map,ga=[],bb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Rp(e,t){switch(e){case"focusin":case"focusout":pa=null;break;case"dragenter":case"dragleave":ha=null;break;case"mouseover":case"mouseout":xa=null;break;case"pointerover":case"pointerout":vs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":js.delete(t.pointerId)}}function ws(e,t,n,s,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:d,targetContainers:[c]},t!==null&&(t=Fa(t),t!==null&&Cp(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function yb(e,t,n,s,c){switch(t){case"focusin":return pa=ws(pa,e,t,n,s,c),!0;case"dragenter":return ha=ws(ha,e,t,n,s,c),!0;case"mouseover":return xa=ws(xa,e,t,n,s,c),!0;case"pointerover":var d=c.pointerId;return vs.set(d,ws(vs.get(d)||null,e,t,n,s,c)),!0;case"gotpointercapture":return d=c.pointerId,js.set(d,ws(js.get(d)||null,e,t,n,s,c)),!0}return!1}function Mp(e){var t=Ya(e.target);if(t!==null){var n=m(t);if(n!==null){if(t=n.tag,t===13){if(t=p(n),t!==null){e.blockedOn=t,Fu(e.priority,function(){Tp(n)});return}}else if(t===31){if(t=x(n),t!==null){e.blockedOn=t,Fu(e.priority,function(){Tp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Xr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=zc(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);zi=s,n.target.dispatchEvent(s),zi=null}else return t=Fa(n),t!==null&&Cp(t),e.blockedOn=n,!1;t.shift()}return!0}function _p(e,t,n){Xr(e)&&n.delete(t)}function vb(){Uc=!1,pa!==null&&Xr(pa)&&(pa=null),ha!==null&&Xr(ha)&&(ha=null),xa!==null&&Xr(xa)&&(xa=null),vs.forEach(_p),js.forEach(_p)}function Qr(e,t){e.blockedOn===t&&(e.blockedOn=null,Uc||(Uc=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,vb)))}var Vr=null;function Op(e){Vr!==e&&(Vr=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Vr===e&&(Vr=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],c=e[t+2];if(typeof s!="function"){if(Bc(s||n)===null)continue;break}var d=Fa(n);d!==null&&(e.splice(t,3),t-=3,zo(d,{pending:!0,data:c,method:n.method,action:s},s,c))}}))}function kl(e){function t(R){return Qr(R,e)}pa!==null&&Qr(pa,e),ha!==null&&Qr(ha,e),xa!==null&&Qr(xa,e),vs.forEach(t),js.forEach(t);for(var n=0;n<ga.length;n++){var s=ga[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<ga.length&&(n=ga[0],n.blockedOn===null);)Mp(n),n.blockedOn===null&&ga.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var c=n[s],d=n[s+1],h=c[Ut]||null;if(typeof d=="function")h||Op(n);else if(h){var w=null;if(d&&d.hasAttribute("formAction")){if(c=d,h=d[Ut]||null)w=h.formAction;else if(Bc(c)!==null)continue}else w=h.action;typeof w=="function"?n[s+1]=w:(n.splice(s,3),s-=3),Op(n)}}}function Dp(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(h){return c=h})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),s||setTimeout(n,20)}function n(){if(!s&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function $c(e){this._internalRoot=e}Ir.prototype.render=$c.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,s=Wt();kp(n,s,e,t,null,null)},Ir.prototype.unmount=$c.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;kp(e.current,2,null,e,null,null),Ar(),t[qa]=null}};function Ir(e){this._internalRoot=e}Ir.prototype.unstable_scheduleHydration=function(e){if(e){var t=Yu();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ga.length&&t!==0&&t<ga[n].priority;n++);ga.splice(n,0,e),n===0&&Mp(e)}};var Lp=r.version;if(Lp!=="19.2.4")throw Error(o(527,Lp,"19.2.4"));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var jb={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jr.isDisabled&&Jr.supportsFiber)try{ue=Jr.inject(jb),ge=Jr}catch{}}return Ss.createRoot=function(e,t){if(!u(e))throw Error(o(299));var n=!1,s="",c=Gm,d=qm,h=Ym;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=Np(e,1,!1,null,null,n,s,null,c,d,h,Dp),e[qa]=t.current,vc(e),new $c(t)},Ss.hydrateRoot=function(e,t,n){if(!u(e))throw Error(o(299));var s=!1,c="",d=Gm,h=qm,w=Ym,R=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(w=n.onRecoverableError),n.formState!==void 0&&(R=n.formState)),t=Np(e,1,!0,t,n??null,s,c,R,d,h,w,Dp),t.context=Sp(null),n=t.current,s=Wt(),s=Ti(s),c=na(s),c.callback=null,aa(n,c,s),n=s,t.current.lanes=n,Ol(t,n),Nn(t),e[qa]=t.current,vc(e),new Ir(t)},Ss.version="19.2.4",Ss}var Zp;function _b(){if(Zp)return qc.exports;Zp=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(r){console.error(r)}}return l(),qc.exports=Mb(),qc.exports}var Ob=_b();const Db=wh(Ob),Lb=300*1e3;function Al(l){if(!l||typeof l!="object")return null;const r=l;return Array.isArray(r.sessions)?{sessions:r.sessions,cachedAt:typeof r.cachedAt=="string"?r.cachedAt:void 0}:null}function ai(l,r=Lb){if(!l)return!1;const i=Date.now()-new Date(l).getTime();return Number.isFinite(i)&&i>=0&&i<r}function li(l){if(!l)return"just now";const r=Date.now()-new Date(l).getTime();if(!Number.isFinite(r)||r<0)return"just now";const i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function Nh(l,r=Date.now()){if(!l)return"";const i=r-new Date(l).getTime();if(!Number.isFinite(i)||i<0)return"0m";const o=Math.floor(i/6e4);if(o<60)return`${o}m`;const u=Math.floor(o/60);return u<24?`${u}h`:`${Math.floor(u/24)}d`}function si(l){return new Date(l).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}function Sh(l){return l?`$${l.toFixed(2)}`:""}function wu(l){if(!l)return"";const r=l.match(/claude-(\d+)-(\d+)-(opus|sonnet|haiku)(?:-\d{8})?/i);if(r)return`${r[3].charAt(0).toUpperCase()+r[3].slice(1).toLowerCase()} ${r[1]}.${r[2]}`;const i=l.match(/claude-(?:(opus|sonnet|haiku)-)?((?:\d+)(?:[.-](?!\d{8})\d+)*)(?:-\d{8})?(?:-(opus|sonnet|haiku))?(?:$|\b)/i);if(i){const u=(i[1]||i[3]||"").toLowerCase(),m=i[2].replace(/-/g,"."),p=u.charAt(0).toUpperCase()+u.slice(1);return p?`${p} ${m}`:`Claude ${m}`}const o=l.split(/[-/]/);return o.length>1?o.slice(0,2).join("-"):l}function ri(l){const r=Math.round(l/1024);return r>=1024?`${(r/1024).toFixed(1)}MB`:`${r}KB`}function Ml(l){const r=Date.now()-new Date(l).getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const u=Math.floor(o/24);return u<30?`${u}d ago`:si(l)}function $a(l){const r=ku(l);if(r)return r;const i=l.replace(/\/$/,"").split("/");return i[i.length-1]||l}const Nu=120;function vt(l){return(l||"").replace(/\s+/g," ").trim().slice(0,Nu)}function zb(l){return l.startsWith("[Request interrupted by user")||l.startsWith("<command-name>")||l.startsWith("<command-message>")||l.startsWith("<local-command-caveat>")||l.startsWith("<local-command-stdout>")||l.startsWith("<task-notification>")||l.startsWith("<bash-input>")||l.startsWith("<bash-stdout>")}function Bb(l){return l.split(`
|
|
55
|
+
`+s.stack}}var Cn=Object.prototype.hasOwnProperty,ze=l.unstable_scheduleCallback,ot=l.unstable_cancelCallback,jt=l.unstable_shouldYield,st=l.unstable_requestPaint,Ze=l.unstable_now,I=l.unstable_getCurrentPriorityLevel,we=l.unstable_ImmediatePriority,ve=l.unstable_UserBlockingPriority,ce=l.unstable_NormalPriority,fe=l.unstable_LowPriority,_e=l.unstable_IdlePriority,Se=l.log,Be=l.unstable_setDisableYieldValue,et=null,Oe=null;function Ue(e){if(typeof Se=="function"&&Be(e),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(et,e)}catch{}}var tt=Math.clz32?Math.clz32:rn,Yt=Math.log,Ft=Math.LN2;function rn(e){return e>>>=0,e===0?32:31-(Yt(e)/Ft|0)|0}var Ln=256,zn=262144,$t=4194304;function ie(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ke(e,t,a){var s=e.pendingLanes;if(s===0)return 0;var c=0,d=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var N=s&134217727;return N!==0?(s=N&~d,s!==0?c=ie(s):(b&=N,b!==0?c=ie(b):a||(a=N&~e,a!==0&&(c=ie(a))))):(N=s&~d,N!==0?c=ie(N):b!==0?c=ie(b):a||(a=s&~e,a!==0&&(c=ie(a)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,a=t&-t,d>=a||d===32&&(a&4194048)!==0)?t:c}function He(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function wt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Nt(){var e=$t;return $t<<=1,($t&62914560)===0&&($t=4194304),e}function on(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Tt(e,t,a,s,c,d){var b=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var N=e.entanglements,D=e.expirationTimes,Y=e.hiddenUpdates;for(a=b&~a;0<a;){var ee=31-tt(a),se=1<<ee;N[ee]=0,D[ee]=-1;var Z=Y[ee];if(Z!==null)for(Y[ee]=null,ee=0;ee<Z.length;ee++){var X=Z[ee];X!==null&&(X.lane&=-536870913)}a&=~se}s!==0&&Pa(e,s,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(b&~t))}function Pa(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-tt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|a&261930}function Zl(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var s=31-tt(a),c=1<<s;c&t|e[s]&t&&(e[s]|=t),a&=~c}}function Wa(e,t){var a=t&-t;return a=(a&42)!==0?1:Li(a),(a&(e.suspendedLanes|t))!==0?0:a}function Li(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function zi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xu(){var e=z.p;return e!==0?e:(e=window.event,e===void 0?32:Op(e.type))}function Iu(e,t){var a=z.p;try{return z.p=e,t()}finally{z.p=a}}var la=Math.random().toString(36).slice(2),Mt="__reactFiber$"+la,Zt="__reactProps$"+la,el="__reactContainer$"+la,Bi="__reactEvents$"+la,Sx="__reactListeners$"+la,kx="__reactHandles$"+la,Ju="__reactResources$"+la,Vl="__reactMarker$"+la;function $i(e){delete e[Mt],delete e[Zt],delete e[Bi],delete e[Sx],delete e[kx]}function tl(e){var t=e[Mt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[el]||a[Mt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=bp(e);e!==null;){if(a=e[Mt])return a;e=bp(e)}return t}e=a,a=e.parentNode}return null}function nl(e){if(e=e[Mt]||e[el]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ql(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function al(e){var t=e[Ju];return t||(t=e[Ju]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Et(e){e[Vl]=!0}var Ku=new Set,Pu={};function Ra(e,t){ll(e,t),ll(e+"Capture",t)}function ll(e,t){for(Pu[e]=t,e=0;e<t.length;e++)Ku.add(t[e])}var Cx=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Wu={},ed={};function Tx(e){return Cn.call(ed,e)?!0:Cn.call(Wu,e)?!1:Cx.test(e)?ed[e]=!0:(Wu[e]=!0,!1)}function Ks(e,t,a){if(Tx(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Ps(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Bn(e,t,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+s)}}function cn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function td(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ex(e,t,a){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,d=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(b){a=""+b,d.call(this,b)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(b){a=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ui(e){if(!e._valueTracker){var t=td(e)?"checked":"value";e._valueTracker=Ex(e,t,""+e[t])}}function nd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),s="";return e&&(s=td(e)?e.checked?"true":"false":e.value),e=s,e!==a?(t.setValue(e),!0):!1}function Ws(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ax=/[\n"\\]/g;function un(e){return e.replace(Ax,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Hi(e,t,a,s,c,d,b,N){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+cn(t)):e.value!==""+cn(t)&&(e.value=""+cn(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?Gi(e,b,cn(t)):a!=null?Gi(e,b,cn(a)):s!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+cn(N):e.removeAttribute("name")}function ad(e,t,a,s,c,d,b,N){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){Ui(e);return}a=a!=null?""+cn(a):"",t=t!=null?""+cn(t):a,N||t===e.value||(e.value=t),e.defaultValue=t}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=N?e.checked:!!s,e.defaultChecked=!!s,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),Ui(e)}function Gi(e,t,a){t==="number"&&Ws(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function sl(e,t,a,s){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&s&&(e[a].defaultSelected=!0)}else{for(a=""+cn(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function ld(e,t,a){if(t!=null&&(t=""+cn(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+cn(a):""}function sd(e,t,a,s){if(t==null){if(s!=null){if(a!=null)throw Error(o(92));if(pe(s)){if(1<s.length)throw Error(o(93));s=s[0]}a=s}a==null&&(a=""),t=a}a=cn(t),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s),Ui(e)}function rl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Rx=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function rd(e,t,a){var s=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,a):typeof a!="number"||a===0||Rx.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function id(e,t,a){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var c in t)s=t[c],t.hasOwnProperty(c)&&a[c]!==s&&rd(e,c,s)}else for(var d in t)t.hasOwnProperty(d)&&rd(e,d,t[d])}function qi(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Mx=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Dx=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function er(e){return Dx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function $n(){}var Yi=null;function Fi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var il=null,ol=null;function od(e){var t=nl(e);if(t&&(e=t.stateNode)){var a=e[Zt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Hi(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+un(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var s=a[t];if(s!==e&&s.form===e.form){var c=s[Zt]||null;if(!c)throw Error(o(90));Hi(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)s=a[t],s.form===e.form&&nd(s)}break e;case"textarea":ld(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&sl(e,!!a.multiple,t,!1)}}}var Zi=!1;function cd(e,t,a){if(Zi)return e(t,a);Zi=!0;try{var s=e(t);return s}finally{if(Zi=!1,(il!==null||ol!==null)&&(Gr(),il&&(t=il,e=ol,ol=il=null,od(t),e)))for(t=0;t<e.length;t++)od(e[t])}}function Xl(e,t){var a=e.stateNode;if(a===null)return null;var s=a[Zt]||null;if(s===null)return null;a=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(o(231,t,typeof a));return a}var Un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vi=!1;if(Un)try{var Il={};Object.defineProperty(Il,"passive",{get:function(){Vi=!0}}),window.addEventListener("test",Il,Il),window.removeEventListener("test",Il,Il)}catch{Vi=!1}var sa=null,Qi=null,tr=null;function ud(){if(tr)return tr;var e,t=Qi,a=t.length,s,c="value"in sa?sa.value:sa.textContent,d=c.length;for(e=0;e<a&&t[e]===c[e];e++);var b=a-e;for(s=1;s<=b&&t[a-s]===c[d-s];s++);return tr=c.slice(e,1<s?1-s:void 0)}function nr(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ar(){return!0}function dd(){return!1}function Vt(e){function t(a,s,c,d,b){this._reactName=a,this._targetInst=c,this.type=s,this.nativeEvent=d,this.target=b,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(a=e[N],this[N]=a?a(d):d[N]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?ar:dd,this.isPropagationStopped=dd,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ar)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ar)},persist:function(){},isPersistent:ar}),t}var Ma={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lr=Vt(Ma),Jl=v({},Ma,{view:0,detail:0}),_x=Vt(Jl),Xi,Ii,Kl,sr=v({},Jl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ki,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!==Kl&&(Kl&&e.type==="mousemove"?(Xi=e.screenX-Kl.screenX,Ii=e.screenY-Kl.screenY):Ii=Xi=0,Kl=e),Xi)},movementY:function(e){return"movementY"in e?e.movementY:Ii}}),md=Vt(sr),Ox=v({},sr,{dataTransfer:0}),Lx=Vt(Ox),zx=v({},Jl,{relatedTarget:0}),Ji=Vt(zx),Bx=v({},Ma,{animationName:0,elapsedTime:0,pseudoElement:0}),$x=Vt(Bx),Ux=v({},Ma,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Hx=Vt(Ux),Gx=v({},Ma,{data:0}),fd=Vt(Gx),qx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yx={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"},Fx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fx[e])?!!t[e]:!1}function Ki(){return Zx}var Vx=v({},Jl,{key:function(e){if(e.key){var t=qx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=nr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Yx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ki,charCode:function(e){return e.type==="keypress"?nr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?nr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Qx=Vt(Vx),Xx=v({},sr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pd=Vt(Xx),Ix=v({},Jl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ki}),Jx=Vt(Ix),Kx=v({},Ma,{propertyName:0,elapsedTime:0,pseudoElement:0}),Px=Vt(Kx),Wx=v({},sr,{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}),eg=Vt(Wx),tg=v({},Ma,{newState:0,oldState:0}),ng=Vt(tg),ag=[9,13,27,32],Pi=Un&&"CompositionEvent"in window,Pl=null;Un&&"documentMode"in document&&(Pl=document.documentMode);var lg=Un&&"TextEvent"in window&&!Pl,hd=Un&&(!Pi||Pl&&8<Pl&&11>=Pl),xd=" ",gd=!1;function bd(e,t){switch(e){case"keyup":return ag.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cl=!1;function sg(e,t){switch(e){case"compositionend":return yd(t);case"keypress":return t.which!==32?null:(gd=!0,xd);case"textInput":return e=t.data,e===xd&&gd?null:e;default:return null}}function rg(e,t){if(cl)return e==="compositionend"||!Pi&&bd(e,t)?(e=ud(),tr=Qi=sa=null,cl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return hd&&t.locale!=="ko"?null:t.data;default:return null}}var ig={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 vd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ig[e.type]:t==="textarea"}function jd(e,t,a,s){il?ol?ol.push(s):ol=[s]:il=s,t=Xr(t,"onChange"),0<t.length&&(a=new lr("onChange","change",null,a,s),e.push({event:a,listeners:t}))}var Wl=null,es=null;function og(e){lp(e,0)}function rr(e){var t=Ql(e);if(nd(t))return e}function wd(e,t){if(e==="change")return t}var Nd=!1;if(Un){var Wi;if(Un){var eo="oninput"in document;if(!eo){var Sd=document.createElement("div");Sd.setAttribute("oninput","return;"),eo=typeof Sd.oninput=="function"}Wi=eo}else Wi=!1;Nd=Wi&&(!document.documentMode||9<document.documentMode)}function kd(){Wl&&(Wl.detachEvent("onpropertychange",Cd),es=Wl=null)}function Cd(e){if(e.propertyName==="value"&&rr(es)){var t=[];jd(t,es,e,Fi(e)),cd(og,t)}}function cg(e,t,a){e==="focusin"?(kd(),Wl=t,es=a,Wl.attachEvent("onpropertychange",Cd)):e==="focusout"&&kd()}function ug(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return rr(es)}function dg(e,t){if(e==="click")return rr(t)}function mg(e,t){if(e==="input"||e==="change")return rr(t)}function fg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:fg;function ts(e,t){if(Pt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),s=Object.keys(t);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var c=a[s];if(!Cn.call(t,c)||!Pt(e[c],t[c]))return!1}return!0}function Td(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ed(e,t){var a=Td(e);e=0;for(var s;a;){if(a.nodeType===3){if(s=e+a.textContent.length,e<=t&&s>=t)return{node:a,offset:t-e};e=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Td(a)}}function Ad(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ad(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ws(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Ws(e.document)}return t}function to(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var pg=Un&&"documentMode"in document&&11>=document.documentMode,ul=null,no=null,ns=null,ao=!1;function Md(e,t,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ao||ul==null||ul!==Ws(s)||(s=ul,"selectionStart"in s&&to(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ns&&ts(ns,s)||(ns=s,s=Xr(no,"onSelect"),0<s.length&&(t=new lr("onSelect","select",null,t,a),e.push({event:t,listeners:s}),t.target=ul)))}function Da(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var dl={animationend:Da("Animation","AnimationEnd"),animationiteration:Da("Animation","AnimationIteration"),animationstart:Da("Animation","AnimationStart"),transitionrun:Da("Transition","TransitionRun"),transitionstart:Da("Transition","TransitionStart"),transitioncancel:Da("Transition","TransitionCancel"),transitionend:Da("Transition","TransitionEnd")},lo={},Dd={};Un&&(Dd=document.createElement("div").style,"AnimationEvent"in window||(delete dl.animationend.animation,delete dl.animationiteration.animation,delete dl.animationstart.animation),"TransitionEvent"in window||delete dl.transitionend.transition);function _a(e){if(lo[e])return lo[e];if(!dl[e])return e;var t=dl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Dd)return lo[e]=t[a];return e}var _d=_a("animationend"),Od=_a("animationiteration"),Ld=_a("animationstart"),hg=_a("transitionrun"),xg=_a("transitionstart"),gg=_a("transitioncancel"),zd=_a("transitionend"),Bd=new Map,so="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");so.push("scrollEnd");function vn(e,t){Bd.set(e,t),Ra(t,[e])}var ir=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},dn=[],ml=0,ro=0;function or(){for(var e=ml,t=ro=ml=0;t<e;){var a=dn[t];dn[t++]=null;var s=dn[t];dn[t++]=null;var c=dn[t];dn[t++]=null;var d=dn[t];if(dn[t++]=null,s!==null&&c!==null){var b=s.pending;b===null?c.next=c:(c.next=b.next,b.next=c),s.pending=c}d!==0&&$d(a,c,d)}}function cr(e,t,a,s){dn[ml++]=e,dn[ml++]=t,dn[ml++]=a,dn[ml++]=s,ro|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function io(e,t,a,s){return cr(e,t,a,s),ur(e)}function Oa(e,t){return cr(e,null,null,t),ur(e)}function $d(e,t,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var c=!1,d=e.return;d!==null;)d.childLanes|=a,s=d.alternate,s!==null&&(s.childLanes|=a),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-tt(a),e=d.hiddenUpdates,s=e[c],s===null?e[c]=[t]:s.push(t),t.lane=a|536870912),d):null}function ur(e){if(50<Ss)throw Ss=0,gc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var fl={};function bg(e,t,a,s){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wt(e,t,a,s){return new bg(e,t,a,s)}function oo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hn(e,t){var a=e.alternate;return a===null?(a=Wt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Ud(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function dr(e,t,a,s,c,d){var b=0;if(s=e,typeof e=="function")oo(e)&&(b=1);else if(typeof e=="string")b=Nb(e,a,J.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ae:return e=Wt(31,a,t,c),e.elementType=ae,e.lanes=d,e;case S:return La(a.children,c,d,t);case k:b=8,c|=24;break;case E:return e=Wt(12,a,t,c|2),e.elementType=E,e.lanes=d,e;case O:return e=Wt(13,a,t,c),e.elementType=O,e.lanes=d,e;case $:return e=Wt(19,a,t,c),e.elementType=$,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:b=10;break e;case M:b=9;break e;case R:b=11;break e;case H:b=14;break e;case K:b=16,s=null;break e}b=29,a=Error(o(130,e===null?"null":typeof e,"")),s=null}return t=Wt(b,a,t,c),t.elementType=e,t.type=s,t.lanes=d,t}function La(e,t,a,s){return e=Wt(7,e,s,t),e.lanes=a,e}function co(e,t,a){return e=Wt(6,e,null,t),e.lanes=a,e}function Hd(e){var t=Wt(18,null,null,0);return t.stateNode=e,t}function uo(e,t,a){return t=Wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Gd=new WeakMap;function mn(e,t){if(typeof e=="object"&&e!==null){var a=Gd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:qt(t)},Gd.set(e,t),t)}return{value:e,source:t,stack:qt(t)}}var pl=[],hl=0,mr=null,as=0,fn=[],pn=0,ra=null,Tn=1,En="";function Gn(e,t){pl[hl++]=as,pl[hl++]=mr,mr=e,as=t}function qd(e,t,a){fn[pn++]=Tn,fn[pn++]=En,fn[pn++]=ra,ra=e;var s=Tn;e=En;var c=32-tt(s)-1;s&=~(1<<c),a+=1;var d=32-tt(t)+c;if(30<d){var b=c-c%5;d=(s&(1<<b)-1).toString(32),s>>=b,c-=b,Tn=1<<32-tt(t)+c|a<<c|s,En=d+e}else Tn=1<<d|a<<c|s,En=e}function mo(e){e.return!==null&&(Gn(e,1),qd(e,1,0))}function fo(e){for(;e===mr;)mr=pl[--hl],pl[hl]=null,as=pl[--hl],pl[hl]=null;for(;e===ra;)ra=fn[--pn],fn[pn]=null,En=fn[--pn],fn[pn]=null,Tn=fn[--pn],fn[pn]=null}function Yd(e,t){fn[pn++]=Tn,fn[pn++]=En,fn[pn++]=ra,Tn=t.id,En=t.overflow,ra=e}var Dt=null,nt=null,Le=!1,ia=null,hn=!1,po=Error(o(519));function oa(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ls(mn(t,e)),po}function Fd(e){var t=e.stateNode,a=e.type,s=e.memoizedProps;switch(t[Mt]=e,t[Zt]=s,a){case"dialog":Re("cancel",t),Re("close",t);break;case"iframe":case"object":case"embed":Re("load",t);break;case"video":case"audio":for(a=0;a<Cs.length;a++)Re(Cs[a],t);break;case"source":Re("error",t);break;case"img":case"image":case"link":Re("error",t),Re("load",t);break;case"details":Re("toggle",t);break;case"input":Re("invalid",t),ad(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Re("invalid",t);break;case"textarea":Re("invalid",t),sd(t,s.value,s.defaultValue,s.children)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||s.suppressHydrationWarning===!0||op(t.textContent,a)?(s.popover!=null&&(Re("beforetoggle",t),Re("toggle",t)),s.onScroll!=null&&Re("scroll",t),s.onScrollEnd!=null&&Re("scrollend",t),s.onClick!=null&&(t.onclick=$n),t=!0):t=!1,t||oa(e,!0)}function Zd(e){for(Dt=e.return;Dt;)switch(Dt.tag){case 5:case 31:case 13:hn=!1;return;case 27:case 3:hn=!0;return;default:Dt=Dt.return}}function xl(e){if(e!==Dt)return!1;if(!Le)return Zd(e),Le=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Dc(e.type,e.memoizedProps)),a=!a),a&&nt&&oa(e),Zd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));nt=gp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));nt=gp(e)}else t===27?(t=nt,wa(e.type)?(e=Bc,Bc=null,nt=e):nt=t):nt=Dt?gn(e.stateNode.nextSibling):null;return!0}function za(){nt=Dt=null,Le=!1}function ho(){var e=ia;return e!==null&&(Jt===null?Jt=e:Jt.push.apply(Jt,e),ia=null),e}function ls(e){ia===null?ia=[e]:ia.push(e)}var xo=T(null),Ba=null,qn=null;function ca(e,t,a){V(xo,t._currentValue),t._currentValue=a}function Yn(e){e._currentValue=xo.current,_(xo)}function go(e,t,a){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===a)break;e=e.return}}function bo(e,t,a,s){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var b=c.child;d=d.firstContext;e:for(;d!==null;){var N=d;d=c;for(var D=0;D<t.length;D++)if(N.context===t[D]){d.lanes|=a,N=d.alternate,N!==null&&(N.lanes|=a),go(d.return,a,e),s||(b=null);break e}d=N.next}}else if(c.tag===18){if(b=c.return,b===null)throw Error(o(341));b.lanes|=a,d=b.alternate,d!==null&&(d.lanes|=a),go(b,a,e),b=null}else b=c.child;if(b!==null)b.return=c;else for(b=c;b!==null;){if(b===e){b=null;break}if(c=b.sibling,c!==null){c.return=b.return,b=c;break}b=b.return}c=b}}function gl(e,t,a,s){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var b=c.alternate;if(b===null)throw Error(o(387));if(b=b.memoizedProps,b!==null){var N=c.type;Pt(c.pendingProps.value,b.value)||(e!==null?e.push(N):e=[N])}}else if(c===G.current){if(b=c.alternate,b===null)throw Error(o(387));b.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Ms):e=[Ms])}c=c.return}e!==null&&bo(t,e,a,s),t.flags|=262144}function fr(e){for(e=e.firstContext;e!==null;){if(!Pt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $a(e){Ba=e,qn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function _t(e){return Vd(Ba,e)}function pr(e,t){return Ba===null&&$a(e),Vd(e,t)}function Vd(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},qn===null){if(e===null)throw Error(o(308));qn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qn=qn.next=t;return a}var yg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},vg=l.unstable_scheduleCallback,jg=l.unstable_NormalPriority,xt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yo(){return{controller:new yg,data:new Map,refCount:0}}function ss(e){e.refCount--,e.refCount===0&&vg(jg,function(){e.controller.abort()})}var rs=null,vo=0,bl=0,yl=null;function wg(e,t){if(rs===null){var a=rs=[];vo=0,bl=Nc(),yl={status:"pending",value:void 0,then:function(s){a.push(s)}}}return vo++,t.then(Qd,Qd),t}function Qd(){if(--vo===0&&rs!==null){yl!==null&&(yl.status="fulfilled");var e=rs;rs=null,bl=0,yl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ng(e,t){var a=[],s={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(s.status="rejected",s.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),s}var Xd=U.S;U.S=function(e,t){Df=Ze(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&wg(e,t),Xd!==null&&Xd(e,t)};var Ua=T(null);function jo(){var e=Ua.current;return e!==null?e:We.pooledCache}function hr(e,t){t===null?V(Ua,Ua.current):V(Ua,t.pool)}function Id(){var e=jo();return e===null?null:{parent:xt._currentValue,pool:e}}var vl=Error(o(460)),wo=Error(o(474)),xr=Error(o(542)),gr={then:function(){}};function Jd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Kd(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then($n,$n),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Wd(e),e;default:if(typeof t.status=="string")t.then($n,$n);else{if(e=We,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=s}},function(s){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Wd(e),e}throw Ga=t,vl}}function Ha(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ga=a,vl):a}}var Ga=null;function Pd(){if(Ga===null)throw Error(o(459));var e=Ga;return Ga=null,e}function Wd(e){if(e===vl||e===xr)throw Error(o(483))}var jl=null,is=0;function br(e){var t=is;return is+=1,jl===null&&(jl=[]),Kd(jl,e,t)}function os(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function yr(e,t){throw t.$$typeof===C?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function em(e){function t(B,L){if(e){var q=B.deletions;q===null?(B.deletions=[L],B.flags|=16):q.push(L)}}function a(B,L){if(!e)return null;for(;L!==null;)t(B,L),L=L.sibling;return null}function s(B){for(var L=new Map;B!==null;)B.key!==null?L.set(B.key,B):L.set(B.index,B),B=B.sibling;return L}function c(B,L){return B=Hn(B,L),B.index=0,B.sibling=null,B}function d(B,L,q){return B.index=q,e?(q=B.alternate,q!==null?(q=q.index,q<L?(B.flags|=67108866,L):q):(B.flags|=67108866,L)):(B.flags|=1048576,L)}function b(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function N(B,L,q,le){return L===null||L.tag!==6?(L=co(q,B.mode,le),L.return=B,L):(L=c(L,q),L.return=B,L)}function D(B,L,q,le){var je=q.type;return je===S?ee(B,L,q.props.children,le,q.key):L!==null&&(L.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&Ha(je)===L.type)?(L=c(L,q.props),os(L,q),L.return=B,L):(L=dr(q.type,q.key,q.props,null,B.mode,le),os(L,q),L.return=B,L)}function Y(B,L,q,le){return L===null||L.tag!==4||L.stateNode.containerInfo!==q.containerInfo||L.stateNode.implementation!==q.implementation?(L=uo(q,B.mode,le),L.return=B,L):(L=c(L,q.children||[]),L.return=B,L)}function ee(B,L,q,le,je){return L===null||L.tag!==7?(L=La(q,B.mode,le,je),L.return=B,L):(L=c(L,q),L.return=B,L)}function se(B,L,q){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=co(""+L,B.mode,q),L.return=B,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case j:return q=dr(L.type,L.key,L.props,null,B.mode,q),os(q,L),q.return=B,q;case w:return L=uo(L,B.mode,q),L.return=B,L;case K:return L=Ha(L),se(B,L,q)}if(pe(L)||te(L))return L=La(L,B.mode,q,null),L.return=B,L;if(typeof L.then=="function")return se(B,br(L),q);if(L.$$typeof===A)return se(B,pr(B,L),q);yr(B,L)}return null}function Z(B,L,q,le){var je=L!==null?L.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return je!==null?null:N(B,L,""+q,le);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case j:return q.key===je?D(B,L,q,le):null;case w:return q.key===je?Y(B,L,q,le):null;case K:return q=Ha(q),Z(B,L,q,le)}if(pe(q)||te(q))return je!==null?null:ee(B,L,q,le,null);if(typeof q.then=="function")return Z(B,L,br(q),le);if(q.$$typeof===A)return Z(B,L,pr(B,q),le);yr(B,q)}return null}function X(B,L,q,le,je){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return B=B.get(q)||null,N(L,B,""+le,je);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case j:return B=B.get(le.key===null?q:le.key)||null,D(L,B,le,je);case w:return B=B.get(le.key===null?q:le.key)||null,Y(L,B,le,je);case K:return le=Ha(le),X(B,L,q,le,je)}if(pe(le)||te(le))return B=B.get(q)||null,ee(L,B,le,je,null);if(typeof le.then=="function")return X(B,L,q,br(le),je);if(le.$$typeof===A)return X(B,L,q,pr(L,le),je);yr(L,le)}return null}function ge(B,L,q,le){for(var je=null,Ge=null,ye=L,Ee=L=0,De=null;ye!==null&&Ee<q.length;Ee++){ye.index>Ee?(De=ye,ye=null):De=ye.sibling;var qe=Z(B,ye,q[Ee],le);if(qe===null){ye===null&&(ye=De);break}e&&ye&&qe.alternate===null&&t(B,ye),L=d(qe,L,Ee),Ge===null?je=qe:Ge.sibling=qe,Ge=qe,ye=De}if(Ee===q.length)return a(B,ye),Le&&Gn(B,Ee),je;if(ye===null){for(;Ee<q.length;Ee++)ye=se(B,q[Ee],le),ye!==null&&(L=d(ye,L,Ee),Ge===null?je=ye:Ge.sibling=ye,Ge=ye);return Le&&Gn(B,Ee),je}for(ye=s(ye);Ee<q.length;Ee++)De=X(ye,B,Ee,q[Ee],le),De!==null&&(e&&De.alternate!==null&&ye.delete(De.key===null?Ee:De.key),L=d(De,L,Ee),Ge===null?je=De:Ge.sibling=De,Ge=De);return e&&ye.forEach(function(Ta){return t(B,Ta)}),Le&&Gn(B,Ee),je}function Ne(B,L,q,le){if(q==null)throw Error(o(151));for(var je=null,Ge=null,ye=L,Ee=L=0,De=null,qe=q.next();ye!==null&&!qe.done;Ee++,qe=q.next()){ye.index>Ee?(De=ye,ye=null):De=ye.sibling;var Ta=Z(B,ye,qe.value,le);if(Ta===null){ye===null&&(ye=De);break}e&&ye&&Ta.alternate===null&&t(B,ye),L=d(Ta,L,Ee),Ge===null?je=Ta:Ge.sibling=Ta,Ge=Ta,ye=De}if(qe.done)return a(B,ye),Le&&Gn(B,Ee),je;if(ye===null){for(;!qe.done;Ee++,qe=q.next())qe=se(B,qe.value,le),qe!==null&&(L=d(qe,L,Ee),Ge===null?je=qe:Ge.sibling=qe,Ge=qe);return Le&&Gn(B,Ee),je}for(ye=s(ye);!qe.done;Ee++,qe=q.next())qe=X(ye,B,Ee,qe.value,le),qe!==null&&(e&&qe.alternate!==null&&ye.delete(qe.key===null?Ee:qe.key),L=d(qe,L,Ee),Ge===null?je=qe:Ge.sibling=qe,Ge=qe);return e&&ye.forEach(function(Ob){return t(B,Ob)}),Le&&Gn(B,Ee),je}function Pe(B,L,q,le){if(typeof q=="object"&&q!==null&&q.type===S&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case j:e:{for(var je=q.key;L!==null;){if(L.key===je){if(je=q.type,je===S){if(L.tag===7){a(B,L.sibling),le=c(L,q.props.children),le.return=B,B=le;break e}}else if(L.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&Ha(je)===L.type){a(B,L.sibling),le=c(L,q.props),os(le,q),le.return=B,B=le;break e}a(B,L);break}else t(B,L);L=L.sibling}q.type===S?(le=La(q.props.children,B.mode,le,q.key),le.return=B,B=le):(le=dr(q.type,q.key,q.props,null,B.mode,le),os(le,q),le.return=B,B=le)}return b(B);case w:e:{for(je=q.key;L!==null;){if(L.key===je)if(L.tag===4&&L.stateNode.containerInfo===q.containerInfo&&L.stateNode.implementation===q.implementation){a(B,L.sibling),le=c(L,q.children||[]),le.return=B,B=le;break e}else{a(B,L);break}else t(B,L);L=L.sibling}le=uo(q,B.mode,le),le.return=B,B=le}return b(B);case K:return q=Ha(q),Pe(B,L,q,le)}if(pe(q))return ge(B,L,q,le);if(te(q)){if(je=te(q),typeof je!="function")throw Error(o(150));return q=je.call(q),Ne(B,L,q,le)}if(typeof q.then=="function")return Pe(B,L,br(q),le);if(q.$$typeof===A)return Pe(B,L,pr(B,q),le);yr(B,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,L!==null&&L.tag===6?(a(B,L.sibling),le=c(L,q),le.return=B,B=le):(a(B,L),le=co(q,B.mode,le),le.return=B,B=le),b(B)):a(B,L)}return function(B,L,q,le){try{is=0;var je=Pe(B,L,q,le);return jl=null,je}catch(ye){if(ye===vl||ye===xr)throw ye;var Ge=Wt(29,ye,null,B.mode);return Ge.lanes=le,Ge.return=B,Ge}finally{}}}var qa=em(!0),tm=em(!1),ua=!1;function No(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function So(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function da(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ma(e,t,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ve&2)!==0){var c=s.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),s.pending=t,t=ur(e),$d(e,null,a),t}return cr(e,s,t,a),ur(e)}function cs(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,Zl(e,a)}}function ko(e,t){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var c=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?c=d=b:d=d.next=b,a=a.next}while(a!==null);d===null?c=d=t:d=d.next=t}else c=d=t;a={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Co=!1;function us(){if(Co){var e=yl;if(e!==null)throw e}}function ds(e,t,a,s){Co=!1;var c=e.updateQueue;ua=!1;var d=c.firstBaseUpdate,b=c.lastBaseUpdate,N=c.shared.pending;if(N!==null){c.shared.pending=null;var D=N,Y=D.next;D.next=null,b===null?d=Y:b.next=Y,b=D;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,N=ee.lastBaseUpdate,N!==b&&(N===null?ee.firstBaseUpdate=Y:N.next=Y,ee.lastBaseUpdate=D))}if(d!==null){var se=c.baseState;b=0,ee=Y=D=null,N=d;do{var Z=N.lane&-536870913,X=Z!==N.lane;if(X?(Me&Z)===Z:(s&Z)===Z){Z!==0&&Z===bl&&(Co=!0),ee!==null&&(ee=ee.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ge=e,Ne=N;Z=t;var Pe=a;switch(Ne.tag){case 1:if(ge=Ne.payload,typeof ge=="function"){se=ge.call(Pe,se,Z);break e}se=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Ne.payload,Z=typeof ge=="function"?ge.call(Pe,se,Z):ge,Z==null)break e;se=v({},se,Z);break e;case 2:ua=!0}}Z=N.callback,Z!==null&&(e.flags|=64,X&&(e.flags|=8192),X=c.callbacks,X===null?c.callbacks=[Z]:X.push(Z))}else X={lane:Z,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ee===null?(Y=ee=X,D=se):ee=ee.next=X,b|=Z;if(N=N.next,N===null){if(N=c.shared.pending,N===null)break;X=N,N=X.next,X.next=null,c.lastBaseUpdate=X,c.shared.pending=null}}while(!0);ee===null&&(D=se),c.baseState=D,c.firstBaseUpdate=Y,c.lastBaseUpdate=ee,d===null&&(c.shared.lanes=0),ga|=b,e.lanes=b,e.memoizedState=se}}function nm(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function am(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)nm(a[e],t)}var wl=T(null),vr=T(0);function lm(e,t){e=Pn,V(vr,e),V(wl,t),Pn=e|t.baseLanes}function To(){V(vr,Pn),V(wl,wl.current)}function Eo(){Pn=vr.current,_(wl),_(vr)}var en=T(null),xn=null;function fa(e){var t=e.alternate;V(mt,mt.current&1),V(en,e),xn===null&&(t===null||wl.current!==null||t.memoizedState!==null)&&(xn=e)}function Ao(e){V(mt,mt.current),V(en,e),xn===null&&(xn=e)}function sm(e){e.tag===22?(V(mt,mt.current),V(en,e),xn===null&&(xn=e)):pa()}function pa(){V(mt,mt.current),V(en,en.current)}function tn(e){_(en),xn===e&&(xn=null),_(mt)}var mt=T(0);function jr(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Lc(a)||zc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Fn=0,Te=null,Je=null,gt=null,wr=!1,Nl=!1,Ya=!1,Nr=0,ms=0,Sl=null,Sg=0;function ct(){throw Error(o(321))}function Ro(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Pt(e[a],t[a]))return!1;return!0}function Mo(e,t,a,s,c,d){return Fn=d,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?qm:Vo,Ya=!1,d=a(s,c),Ya=!1,Nl&&(d=im(t,a,s,c)),rm(e),d}function rm(e){U.H=hs;var t=Je!==null&&Je.next!==null;if(Fn=0,gt=Je=Te=null,wr=!1,ms=0,Sl=null,t)throw Error(o(300));e===null||bt||(e=e.dependencies,e!==null&&fr(e)&&(bt=!0))}function im(e,t,a,s){Te=e;var c=0;do{if(Nl&&(Sl=null),ms=0,Nl=!1,25<=c)throw Error(o(301));if(c+=1,gt=Je=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}U.H=Ym,d=t(a,s)}while(Nl);return d}function kg(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?fs(t):t,e=e.useState()[0],(Je!==null?Je.memoizedState:null)!==e&&(Te.flags|=1024),t}function Do(){var e=Nr!==0;return Nr=0,e}function _o(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Oo(e){if(wr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}wr=!1}Fn=0,gt=Je=Te=null,Nl=!1,ms=Nr=0,Sl=null}function Ut(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gt===null?Te.memoizedState=gt=e:gt=gt.next=e,gt}function ft(){if(Je===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Je.next;var t=gt===null?Te.memoizedState:gt.next;if(t!==null)gt=t,Je=e;else{if(e===null)throw Te.alternate===null?Error(o(467)):Error(o(310));Je=e,e={memoizedState:Je.memoizedState,baseState:Je.baseState,baseQueue:Je.baseQueue,queue:Je.queue,next:null},gt===null?Te.memoizedState=gt=e:gt=gt.next=e}return gt}function Sr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fs(e){var t=ms;return ms+=1,Sl===null&&(Sl=[]),e=Kd(Sl,e,t),t=Te,(gt===null?t.memoizedState:gt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?qm:Vo),e}function kr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return fs(e);if(e.$$typeof===A)return _t(e)}throw Error(o(438,String(e)))}function Lo(e){var t=null,a=Te.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var s=Te.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Sr(),Te.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),s=0;s<e;s++)a[s]=ue;return t.index++,a}function Zn(e,t){return typeof t=="function"?t(e):t}function Cr(e){var t=ft();return zo(t,Je,e)}function zo(e,t,a){var s=e.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=a;var c=e.baseQueue,d=s.pending;if(d!==null){if(c!==null){var b=c.next;c.next=d.next,d.next=b}t.baseQueue=c=d,s.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var N=b=null,D=null,Y=t,ee=!1;do{var se=Y.lane&-536870913;if(se!==Y.lane?(Me&se)===se:(Fn&se)===se){var Z=Y.revertLane;if(Z===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),se===bl&&(ee=!0);else if((Fn&Z)===Z){Y=Y.next,Z===bl&&(ee=!0);continue}else se={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},D===null?(N=D=se,b=d):D=D.next=se,Te.lanes|=Z,ga|=Z;se=Y.action,Ya&&a(d,se),d=Y.hasEagerState?Y.eagerState:a(d,se)}else Z={lane:se,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},D===null?(N=D=Z,b=d):D=D.next=Z,Te.lanes|=se,ga|=se;Y=Y.next}while(Y!==null&&Y!==t);if(D===null?b=d:D.next=N,!Pt(d,e.memoizedState)&&(bt=!0,ee&&(a=yl,a!==null)))throw a;e.memoizedState=d,e.baseState=b,e.baseQueue=D,s.lastRenderedState=d}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Bo(e){var t=ft(),a=t.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=e;var s=a.dispatch,c=a.pending,d=t.memoizedState;if(c!==null){a.pending=null;var b=c=c.next;do d=e(d,b.action),b=b.next;while(b!==c);Pt(d,t.memoizedState)||(bt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),a.lastRenderedState=d}return[d,s]}function om(e,t,a){var s=Te,c=ft(),d=Le;if(d){if(a===void 0)throw Error(o(407));a=a()}else a=t();var b=!Pt((Je||c).memoizedState,a);if(b&&(c.memoizedState=a,bt=!0),c=c.queue,Ho(dm.bind(null,s,c,e),[e]),c.getSnapshot!==t||b||gt!==null&>.memoizedState.tag&1){if(s.flags|=2048,kl(9,{destroy:void 0},um.bind(null,s,c,a,t),null),We===null)throw Error(o(349));d||(Fn&127)!==0||cm(s,t,a)}return a}function cm(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Te.updateQueue,t===null?(t=Sr(),Te.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function um(e,t,a,s){t.value=a,t.getSnapshot=s,mm(t)&&fm(e)}function dm(e,t,a){return a(function(){mm(t)&&fm(e)})}function mm(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Pt(e,a)}catch{return!0}}function fm(e){var t=Oa(e,2);t!==null&&Kt(t,e,2)}function $o(e){var t=Ut();if(typeof e=="function"){var a=e;if(e=a(),Ya){Ue(!0);try{a()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:e},t}function pm(e,t,a,s){return e.baseState=a,zo(e,Je,typeof s=="function"?s:Zn)}function Cg(e,t,a,s,c){if(Ar(e))throw Error(o(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){d.listeners.push(b)}};U.T!==null?a(!0):d.isTransition=!1,s(d),a=t.pending,a===null?(d.next=t.pending=d,hm(t,d)):(d.next=a.next,t.pending=a.next=d)}}function hm(e,t){var a=t.action,s=t.payload,c=e.state;if(t.isTransition){var d=U.T,b={};U.T=b;try{var N=a(c,s),D=U.S;D!==null&&D(b,N),xm(e,t,N)}catch(Y){Uo(e,t,Y)}finally{d!==null&&b.types!==null&&(d.types=b.types),U.T=d}}else try{d=a(c,s),xm(e,t,d)}catch(Y){Uo(e,t,Y)}}function xm(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){gm(e,t,s)},function(s){return Uo(e,t,s)}):gm(e,t,a)}function gm(e,t,a){t.status="fulfilled",t.value=a,bm(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,hm(e,a)))}function Uo(e,t,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=a,bm(t),t=t.next;while(t!==s)}e.action=null}function bm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ym(e,t){return t}function vm(e,t){if(Le){var a=We.formState;if(a!==null){e:{var s=Te;if(Le){if(nt){t:{for(var c=nt,d=hn;c.nodeType!==8;){if(!d){c=null;break t}if(c=gn(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){nt=gn(c.nextSibling),s=c.data==="F!";break e}}oa(s)}s=!1}s&&(t=a[0])}}return a=Ut(),a.memoizedState=a.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ym,lastRenderedState:t},a.queue=s,a=Um.bind(null,Te,s),s.dispatch=a,s=$o(!1),d=Zo.bind(null,Te,!1,s.queue),s=Ut(),c={state:t,dispatch:null,action:e,pending:null},s.queue=c,a=Cg.bind(null,Te,c,d,a),c.dispatch=a,s.memoizedState=e,[t,a,!1]}function jm(e){var t=ft();return wm(t,Je,e)}function wm(e,t,a){if(t=zo(e,t,ym)[0],e=Cr(Zn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=fs(t)}catch(b){throw b===vl?xr:b}else s=t;t=ft();var c=t.queue,d=c.dispatch;return a!==t.memoizedState&&(Te.flags|=2048,kl(9,{destroy:void 0},Tg.bind(null,c,a),null)),[s,d,e]}function Tg(e,t){e.action=t}function Nm(e){var t=ft(),a=Je;if(a!==null)return wm(t,a,e);ft(),t=t.memoizedState,a=ft();var s=a.queue.dispatch;return a.memoizedState=e,[t,s,!1]}function kl(e,t,a,s){return e={tag:e,create:a,deps:s,inst:t,next:null},t=Te.updateQueue,t===null&&(t=Sr(),Te.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(s=a.next,a.next=e,e.next=s,t.lastEffect=e),e}function Sm(){return ft().memoizedState}function Tr(e,t,a,s){var c=Ut();Te.flags|=e,c.memoizedState=kl(1|t,{destroy:void 0},a,s===void 0?null:s)}function Er(e,t,a,s){var c=ft();s=s===void 0?null:s;var d=c.memoizedState.inst;Je!==null&&s!==null&&Ro(s,Je.memoizedState.deps)?c.memoizedState=kl(t,d,a,s):(Te.flags|=e,c.memoizedState=kl(1|t,d,a,s))}function km(e,t){Tr(8390656,8,e,t)}function Ho(e,t){Er(2048,8,e,t)}function Eg(e){Te.flags|=4;var t=Te.updateQueue;if(t===null)t=Sr(),Te.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Cm(e){var t=ft().memoizedState;return Eg({ref:t,nextImpl:e}),function(){if((Ve&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Tm(e,t){return Er(4,2,e,t)}function Em(e,t){return Er(4,4,e,t)}function Am(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Rm(e,t,a){a=a!=null?a.concat([e]):null,Er(4,4,Am.bind(null,t,e),a)}function Go(){}function Mm(e,t){var a=ft();t=t===void 0?null:t;var s=a.memoizedState;return t!==null&&Ro(t,s[1])?s[0]:(a.memoizedState=[e,t],e)}function Dm(e,t){var a=ft();t=t===void 0?null:t;var s=a.memoizedState;if(t!==null&&Ro(t,s[1]))return s[0];if(s=e(),Ya){Ue(!0);try{e()}finally{Ue(!1)}}return a.memoizedState=[s,t],s}function qo(e,t,a){return a===void 0||(Fn&1073741824)!==0&&(Me&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Of(),Te.lanes|=e,ga|=e,a)}function _m(e,t,a,s){return Pt(a,t)?a:wl.current!==null?(e=qo(e,a,s),Pt(e,t)||(bt=!0),e):(Fn&42)===0||(Fn&1073741824)!==0&&(Me&261930)===0?(bt=!0,e.memoizedState=a):(e=Of(),Te.lanes|=e,ga|=e,t)}function Om(e,t,a,s,c){var d=z.p;z.p=d!==0&&8>d?d:8;var b=U.T,N={};U.T=N,Zo(e,!1,t,a);try{var D=c(),Y=U.S;if(Y!==null&&Y(N,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var ee=Ng(D,s);ps(e,t,ee,ln(e))}else ps(e,t,s,ln(e))}catch(se){ps(e,t,{then:function(){},status:"rejected",reason:se},ln())}finally{z.p=d,b!==null&&N.types!==null&&(b.types=N.types),U.T=b}}function Ag(){}function Yo(e,t,a,s){if(e.tag!==5)throw Error(o(476));var c=Lm(e).queue;Om(e,c,t,Q,a===null?Ag:function(){return zm(e),a(s)})}function Lm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:Q},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function zm(e){var t=Lm(e);t.next===null&&(t=e.alternate.memoizedState),ps(e,t.next.queue,{},ln())}function Fo(){return _t(Ms)}function Bm(){return ft().memoizedState}function $m(){return ft().memoizedState}function Rg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=ln();e=da(a);var s=ma(t,e,a);s!==null&&(Kt(s,t,a),cs(s,t,a)),t={cache:yo()},e.payload=t;return}t=t.return}}function Mg(e,t,a){var s=ln();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ar(e)?Hm(t,a):(a=io(e,t,a,s),a!==null&&(Kt(a,e,s),Gm(a,t,s)))}function Um(e,t,a){var s=ln();ps(e,t,a,s)}function ps(e,t,a,s){var c={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ar(e))Hm(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var b=t.lastRenderedState,N=d(b,a);if(c.hasEagerState=!0,c.eagerState=N,Pt(N,b))return cr(e,t,c,0),We===null&&or(),!1}catch{}finally{}if(a=io(e,t,c,s),a!==null)return Kt(a,e,s),Gm(a,t,s),!0}return!1}function Zo(e,t,a,s){if(s={lane:2,revertLane:Nc(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ar(e)){if(t)throw Error(o(479))}else t=io(e,a,s,2),t!==null&&Kt(t,e,2)}function Ar(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function Hm(e,t){Nl=wr=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Gm(e,t,a){if((a&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,Zl(e,a)}}var hs={readContext:_t,use:kr,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useLayoutEffect:ct,useInsertionEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useSyncExternalStore:ct,useId:ct,useHostTransitionStatus:ct,useFormState:ct,useActionState:ct,useOptimistic:ct,useMemoCache:ct,useCacheRefresh:ct};hs.useEffectEvent=ct;var qm={readContext:_t,use:kr,useCallback:function(e,t){return Ut().memoizedState=[e,t===void 0?null:t],e},useContext:_t,useEffect:km,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Tr(4194308,4,Am.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Tr(4194308,4,e,t)},useInsertionEffect:function(e,t){Tr(4,2,e,t)},useMemo:function(e,t){var a=Ut();t=t===void 0?null:t;var s=e();if(Ya){Ue(!0);try{e()}finally{Ue(!1)}}return a.memoizedState=[s,t],s},useReducer:function(e,t,a){var s=Ut();if(a!==void 0){var c=a(t);if(Ya){Ue(!0);try{a(t)}finally{Ue(!1)}}}else c=t;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=Mg.bind(null,Te,e),[s.memoizedState,e]},useRef:function(e){var t=Ut();return e={current:e},t.memoizedState=e},useState:function(e){e=$o(e);var t=e.queue,a=Um.bind(null,Te,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Go,useDeferredValue:function(e,t){var a=Ut();return qo(a,e,t)},useTransition:function(){var e=$o(!1);return e=Om.bind(null,Te,e.queue,!0,!1),Ut().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var s=Te,c=Ut();if(Le){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),We===null)throw Error(o(349));(Me&127)!==0||cm(s,t,a)}c.memoizedState=a;var d={value:a,getSnapshot:t};return c.queue=d,km(dm.bind(null,s,d,e),[e]),s.flags|=2048,kl(9,{destroy:void 0},um.bind(null,s,d,a,t),null),a},useId:function(){var e=Ut(),t=We.identifierPrefix;if(Le){var a=En,s=Tn;a=(s&~(1<<32-tt(s)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Nr++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Sg++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Fo,useFormState:vm,useActionState:vm,useOptimistic:function(e){var t=Ut();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Zo.bind(null,Te,!0,a),a.dispatch=t,[e,t]},useMemoCache:Lo,useCacheRefresh:function(){return Ut().memoizedState=Rg.bind(null,Te)},useEffectEvent:function(e){var t=Ut(),a={impl:e};return t.memoizedState=a,function(){if((Ve&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}},Vo={readContext:_t,use:kr,useCallback:Mm,useContext:_t,useEffect:Ho,useImperativeHandle:Rm,useInsertionEffect:Tm,useLayoutEffect:Em,useMemo:Dm,useReducer:Cr,useRef:Sm,useState:function(){return Cr(Zn)},useDebugValue:Go,useDeferredValue:function(e,t){var a=ft();return _m(a,Je.memoizedState,e,t)},useTransition:function(){var e=Cr(Zn)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:fs(e),t]},useSyncExternalStore:om,useId:Bm,useHostTransitionStatus:Fo,useFormState:jm,useActionState:jm,useOptimistic:function(e,t){var a=ft();return pm(a,Je,e,t)},useMemoCache:Lo,useCacheRefresh:$m};Vo.useEffectEvent=Cm;var Ym={readContext:_t,use:kr,useCallback:Mm,useContext:_t,useEffect:Ho,useImperativeHandle:Rm,useInsertionEffect:Tm,useLayoutEffect:Em,useMemo:Dm,useReducer:Bo,useRef:Sm,useState:function(){return Bo(Zn)},useDebugValue:Go,useDeferredValue:function(e,t){var a=ft();return Je===null?qo(a,e,t):_m(a,Je.memoizedState,e,t)},useTransition:function(){var e=Bo(Zn)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:fs(e),t]},useSyncExternalStore:om,useId:Bm,useHostTransitionStatus:Fo,useFormState:Nm,useActionState:Nm,useOptimistic:function(e,t){var a=ft();return Je!==null?pm(a,Je,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Lo,useCacheRefresh:$m};Ym.useEffectEvent=Cm;function Qo(e,t,a,s){t=e.memoizedState,a=a(s,t),a=a==null?t:v({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Xo={enqueueSetState:function(e,t,a){e=e._reactInternals;var s=ln(),c=da(s);c.payload=t,a!=null&&(c.callback=a),t=ma(e,c,s),t!==null&&(Kt(t,e,s),cs(t,e,s))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var s=ln(),c=da(s);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=ma(e,c,s),t!==null&&(Kt(t,e,s),cs(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=ln(),s=da(a);s.tag=2,t!=null&&(s.callback=t),t=ma(e,s,a),t!==null&&(Kt(t,e,a),cs(t,e,a))}};function Fm(e,t,a,s,c,d,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,d,b):t.prototype&&t.prototype.isPureReactComponent?!ts(a,s)||!ts(c,d):!0}function Zm(e,t,a,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,s),t.state!==e&&Xo.enqueueReplaceState(t,t.state,null)}function Fa(e,t){var a=t;if("ref"in t){a={};for(var s in t)s!=="ref"&&(a[s]=t[s])}if(e=e.defaultProps){a===t&&(a=v({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function Vm(e){ir(e)}function Qm(e){console.error(e)}function Xm(e){ir(e)}function Rr(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Im(e,t,a){try{var s=e.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Io(e,t,a){return a=da(a),a.tag=3,a.payload={element:null},a.callback=function(){Rr(e,t)},a}function Jm(e){return e=da(e),e.tag=3,e}function Km(e,t,a,s){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var d=s.value;e.payload=function(){return c(d)},e.callback=function(){Im(t,a,s)}}var b=a.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Im(t,a,s),typeof c!="function"&&(ba===null?ba=new Set([this]):ba.add(this));var N=s.stack;this.componentDidCatch(s.value,{componentStack:N!==null?N:""})})}function Dg(e,t,a,s,c){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=a.alternate,t!==null&&gl(t,a,c,!0),a=en.current,a!==null){switch(a.tag){case 31:case 13:return xn===null?qr():a.alternate===null&&ut===0&&(ut=3),a.flags&=-257,a.flags|=65536,a.lanes=c,s===gr?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([s]):t.add(s),vc(e,s,c)),!1;case 22:return a.flags|=65536,s===gr?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([s]):a.add(s)),vc(e,s,c)),!1}throw Error(o(435,a.tag))}return vc(e,s,c),qr(),!1}if(Le)return t=en.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,s!==po&&(e=Error(o(422),{cause:s}),ls(mn(e,a)))):(s!==po&&(t=Error(o(423),{cause:s}),ls(mn(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=mn(s,a),c=Io(e.stateNode,s,c),ko(e,c),ut!==4&&(ut=2)),!1;var d=Error(o(520),{cause:s});if(d=mn(d,a),Ns===null?Ns=[d]:Ns.push(d),ut!==4&&(ut=2),t===null)return!0;s=mn(s,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=Io(a.stateNode,s,e),ko(a,e),!1;case 1:if(t=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(ba===null||!ba.has(d))))return a.flags|=65536,c&=-c,a.lanes|=c,c=Jm(c),Km(c,e,a,s),ko(a,c),!1}a=a.return}while(a!==null);return!1}var Jo=Error(o(461)),bt=!1;function Ot(e,t,a,s){t.child=e===null?tm(t,null,a,s):qa(t,e.child,a,s)}function Pm(e,t,a,s,c){a=a.render;var d=t.ref;if("ref"in s){var b={};for(var N in s)N!=="ref"&&(b[N]=s[N])}else b=s;return $a(t),s=Mo(e,t,a,b,d,c),N=Do(),e!==null&&!bt?(_o(e,t,c),Vn(e,t,c)):(Le&&N&&mo(t),t.flags|=1,Ot(e,t,s,c),t.child)}function Wm(e,t,a,s,c){if(e===null){var d=a.type;return typeof d=="function"&&!oo(d)&&d.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=d,ef(e,t,d,s,c)):(e=dr(a.type,null,s,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!lc(e,c)){var b=d.memoizedProps;if(a=a.compare,a=a!==null?a:ts,a(b,s)&&e.ref===t.ref)return Vn(e,t,c)}return t.flags|=1,e=Hn(d,s),e.ref=t.ref,e.return=t,t.child=e}function ef(e,t,a,s,c){if(e!==null){var d=e.memoizedProps;if(ts(d,s)&&e.ref===t.ref)if(bt=!1,t.pendingProps=s=d,lc(e,c))(e.flags&131072)!==0&&(bt=!0);else return t.lanes=e.lanes,Vn(e,t,c)}return Ko(e,t,a,s,c)}function tf(e,t,a,s){var c=s.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|a:a,e!==null){for(s=t.child=e.child,c=0;s!==null;)c=c|s.lanes|s.childLanes,s=s.sibling;s=c&~d}else s=0,t.child=null;return nf(e,t,d,a,s)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&hr(t,d!==null?d.cachePool:null),d!==null?lm(t,d):To(),sm(t);else return s=t.lanes=536870912,nf(e,t,d!==null?d.baseLanes|a:a,a,s)}else d!==null?(hr(t,d.cachePool),lm(t,d),pa(),t.memoizedState=null):(e!==null&&hr(t,null),To(),pa());return Ot(e,t,c,a),t.child}function xs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function nf(e,t,a,s,c){var d=jo();return d=d===null?null:{parent:xt._currentValue,pool:d},t.memoizedState={baseLanes:a,cachePool:d},e!==null&&hr(t,null),To(),sm(t),e!==null&&gl(e,t,s,!0),t.childLanes=c,null}function Mr(e,t){return t=_r({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function af(e,t,a){return qa(t,e.child,null,a),e=Mr(t,t.pendingProps),e.flags|=2,tn(t),t.memoizedState=null,e}function _g(e,t,a){var s=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(s.mode==="hidden")return e=Mr(t,s),t.lanes=536870912,xs(null,e);if(Ao(t),(e=nt)?(e=xp(e,hn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ra!==null?{id:Tn,overflow:En}:null,retryLane:536870912,hydrationErrors:null},a=Hd(e),a.return=t,t.child=a,Dt=t,nt=null)):e=null,e===null)throw oa(t);return t.lanes=536870912,null}return Mr(t,s)}var d=e.memoizedState;if(d!==null){var b=d.dehydrated;if(Ao(t),c)if(t.flags&256)t.flags&=-257,t=af(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(bt||gl(e,t,a,!1),c=(a&e.childLanes)!==0,bt||c){if(s=We,s!==null&&(b=Wa(s,a),b!==0&&b!==d.retryLane))throw d.retryLane=b,Oa(e,b),Kt(s,e,b),Jo;qr(),t=af(e,t,a)}else e=d.treeContext,nt=gn(b.nextSibling),Dt=t,Le=!0,ia=null,hn=!1,e!==null&&Yd(t,e),t=Mr(t,s),t.flags|=4096;return t}return e=Hn(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Dr(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(o(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Ko(e,t,a,s,c){return $a(t),a=Mo(e,t,a,s,void 0,c),s=Do(),e!==null&&!bt?(_o(e,t,c),Vn(e,t,c)):(Le&&s&&mo(t),t.flags|=1,Ot(e,t,a,c),t.child)}function lf(e,t,a,s,c,d){return $a(t),t.updateQueue=null,a=im(t,s,a,c),rm(e),s=Do(),e!==null&&!bt?(_o(e,t,d),Vn(e,t,d)):(Le&&s&&mo(t),t.flags|=1,Ot(e,t,a,d),t.child)}function sf(e,t,a,s,c){if($a(t),t.stateNode===null){var d=fl,b=a.contextType;typeof b=="object"&&b!==null&&(d=_t(b)),d=new a(s,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Xo,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=s,d.state=t.memoizedState,d.refs={},No(t),b=a.contextType,d.context=typeof b=="object"&&b!==null?_t(b):fl,d.state=t.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(Qo(t,a,b,s),d.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(b=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),b!==d.state&&Xo.enqueueReplaceState(d,d.state,null),ds(t,s,d,c),us(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){d=t.stateNode;var N=t.memoizedProps,D=Fa(a,N);d.props=D;var Y=d.context,ee=a.contextType;b=fl,typeof ee=="object"&&ee!==null&&(b=_t(ee));var se=a.getDerivedStateFromProps;ee=typeof se=="function"||typeof d.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,ee||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(N||Y!==b)&&Zm(t,d,s,b),ua=!1;var Z=t.memoizedState;d.state=Z,ds(t,s,d,c),us(),Y=t.memoizedState,N||Z!==Y||ua?(typeof se=="function"&&(Qo(t,a,se,s),Y=t.memoizedState),(D=ua||Fm(t,a,D,s,Z,Y,b))?(ee||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=Y),d.props=s,d.state=Y,d.context=b,s=D):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{d=t.stateNode,So(e,t),b=t.memoizedProps,ee=Fa(a,b),d.props=ee,se=t.pendingProps,Z=d.context,Y=a.contextType,D=fl,typeof Y=="object"&&Y!==null&&(D=_t(Y)),N=a.getDerivedStateFromProps,(Y=typeof N=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b!==se||Z!==D)&&Zm(t,d,s,D),ua=!1,Z=t.memoizedState,d.state=Z,ds(t,s,d,c),us();var X=t.memoizedState;b!==se||Z!==X||ua||e!==null&&e.dependencies!==null&&fr(e.dependencies)?(typeof N=="function"&&(Qo(t,a,N,s),X=t.memoizedState),(ee=ua||Fm(t,a,ee,s,Z,X,D)||e!==null&&e.dependencies!==null&&fr(e.dependencies))?(Y||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(s,X,D),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(s,X,D)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=X),d.props=s,d.state=X,d.context=D,s=ee):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),s=!1)}return d=s,Dr(e,t),s=(t.flags&128)!==0,d||s?(d=t.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&s?(t.child=qa(t,e.child,null,c),t.child=qa(t,null,a,c)):Ot(e,t,a,c),t.memoizedState=d.state,e=t.child):e=Vn(e,t,c),e}function rf(e,t,a,s){return za(),t.flags|=256,Ot(e,t,a,s),t.child}var Po={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wo(e){return{baseLanes:e,cachePool:Id()}}function ec(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=an),e}function of(e,t,a){var s=t.pendingProps,c=!1,d=(t.flags&128)!==0,b;if((b=d)||(b=e!==null&&e.memoizedState===null?!1:(mt.current&2)!==0),b&&(c=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(c?fa(t):pa(),(e=nt)?(e=xp(e,hn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ra!==null?{id:Tn,overflow:En}:null,retryLane:536870912,hydrationErrors:null},a=Hd(e),a.return=t,t.child=a,Dt=t,nt=null)):e=null,e===null)throw oa(t);return zc(e)?t.lanes=32:t.lanes=536870912,null}var N=s.children;return s=s.fallback,c?(pa(),c=t.mode,N=_r({mode:"hidden",children:N},c),s=La(s,c,a,null),N.return=t,s.return=t,N.sibling=s,t.child=N,s=t.child,s.memoizedState=Wo(a),s.childLanes=ec(e,b,a),t.memoizedState=Po,xs(null,s)):(fa(t),tc(t,N))}var D=e.memoizedState;if(D!==null&&(N=D.dehydrated,N!==null)){if(d)t.flags&256?(fa(t),t.flags&=-257,t=nc(e,t,a)):t.memoizedState!==null?(pa(),t.child=e.child,t.flags|=128,t=null):(pa(),N=s.fallback,c=t.mode,s=_r({mode:"visible",children:s.children},c),N=La(N,c,a,null),N.flags|=2,s.return=t,N.return=t,s.sibling=N,t.child=s,qa(t,e.child,null,a),s=t.child,s.memoizedState=Wo(a),s.childLanes=ec(e,b,a),t.memoizedState=Po,t=xs(null,s));else if(fa(t),zc(N)){if(b=N.nextSibling&&N.nextSibling.dataset,b)var Y=b.dgst;b=Y,s=Error(o(419)),s.stack="",s.digest=b,ls({value:s,source:null,stack:null}),t=nc(e,t,a)}else if(bt||gl(e,t,a,!1),b=(a&e.childLanes)!==0,bt||b){if(b=We,b!==null&&(s=Wa(b,a),s!==0&&s!==D.retryLane))throw D.retryLane=s,Oa(e,s),Kt(b,e,s),Jo;Lc(N)||qr(),t=nc(e,t,a)}else Lc(N)?(t.flags|=192,t.child=e.child,t=null):(e=D.treeContext,nt=gn(N.nextSibling),Dt=t,Le=!0,ia=null,hn=!1,e!==null&&Yd(t,e),t=tc(t,s.children),t.flags|=4096);return t}return c?(pa(),N=s.fallback,c=t.mode,D=e.child,Y=D.sibling,s=Hn(D,{mode:"hidden",children:s.children}),s.subtreeFlags=D.subtreeFlags&65011712,Y!==null?N=Hn(Y,N):(N=La(N,c,a,null),N.flags|=2),N.return=t,s.return=t,s.sibling=N,t.child=s,xs(null,s),s=t.child,N=e.child.memoizedState,N===null?N=Wo(a):(c=N.cachePool,c!==null?(D=xt._currentValue,c=c.parent!==D?{parent:D,pool:D}:c):c=Id(),N={baseLanes:N.baseLanes|a,cachePool:c}),s.memoizedState=N,s.childLanes=ec(e,b,a),t.memoizedState=Po,xs(e.child,s)):(fa(t),a=e.child,e=a.sibling,a=Hn(a,{mode:"visible",children:s.children}),a.return=t,a.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=a,t.memoizedState=null,a)}function tc(e,t){return t=_r({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function _r(e,t){return e=Wt(22,e,null,t),e.lanes=0,e}function nc(e,t,a){return qa(t,e.child,null,a),e=tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cf(e,t,a){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),go(e.return,t,a)}function ac(e,t,a,s,c,d){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:c,treeForkCount:d}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=s,b.tail=a,b.tailMode=c,b.treeForkCount=d)}function uf(e,t,a){var s=t.pendingProps,c=s.revealOrder,d=s.tail;s=s.children;var b=mt.current,N=(b&2)!==0;if(N?(b=b&1|2,t.flags|=128):b&=1,V(mt,b),Ot(e,t,s,a),s=Le?as:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cf(e,a,t);else if(e.tag===19)cf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&jr(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),ac(t,!1,c,a,d,s);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&jr(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}ac(t,!0,a,null,d,s);break;case"together":ac(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Vn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),ga|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(gl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,a=Hn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Hn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function lc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&fr(e)))}function Og(e,t,a){switch(t.tag){case 3:F(t,t.stateNode.containerInfo),ca(t,xt,e.memoizedState.cache),za();break;case 27:case 5:be(t);break;case 4:F(t,t.stateNode.containerInfo);break;case 10:ca(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ao(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(fa(t),t.flags|=128,null):(a&t.child.childLanes)!==0?of(e,t,a):(fa(t),e=Vn(e,t,a),e!==null?e.sibling:null);fa(t);break;case 19:var c=(e.flags&128)!==0;if(s=(a&t.childLanes)!==0,s||(gl(e,t,a,!1),s=(a&t.childLanes)!==0),c){if(s)return uf(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),V(mt,mt.current),s)break;return null;case 22:return t.lanes=0,tf(e,t,a,t.pendingProps);case 24:ca(t,xt,e.memoizedState.cache)}return Vn(e,t,a)}function df(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)bt=!0;else{if(!lc(e,a)&&(t.flags&128)===0)return bt=!1,Og(e,t,a);bt=(e.flags&131072)!==0}else bt=!1,Le&&(t.flags&1048576)!==0&&qd(t,as,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Ha(t.elementType),t.type=e,typeof e=="function")oo(e)?(s=Fa(e,s),t.tag=1,t=sf(null,t,e,s,a)):(t.tag=0,t=Ko(null,t,e,s,a));else{if(e!=null){var c=e.$$typeof;if(c===R){t.tag=11,t=Pm(null,t,e,s,a);break e}else if(c===H){t.tag=14,t=Wm(null,t,e,s,a);break e}}throw t=de(e)||e,Error(o(306,t,""))}}return t;case 0:return Ko(e,t,t.type,t.pendingProps,a);case 1:return s=t.type,c=Fa(s,t.pendingProps),sf(e,t,s,c,a);case 3:e:{if(F(t,t.stateNode.containerInfo),e===null)throw Error(o(387));s=t.pendingProps;var d=t.memoizedState;c=d.element,So(e,t),ds(t,s,null,a);var b=t.memoizedState;if(s=b.cache,ca(t,xt,s),s!==d.cache&&bo(t,[xt],a,!0),us(),s=b.element,d.isDehydrated)if(d={element:s,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=rf(e,t,s,a);break e}else if(s!==c){c=mn(Error(o(424)),t),ls(c),t=rf(e,t,s,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(nt=gn(e.firstChild),Dt=t,Le=!0,ia=null,hn=!0,a=tm(t,null,s,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(za(),s===c){t=Vn(e,t,a);break e}Ot(e,t,s,a)}t=t.child}return t;case 26:return Dr(e,t),e===null?(a=wp(t.type,null,t.pendingProps,null))?t.memoizedState=a:Le||(a=t.type,e=t.pendingProps,s=Ir(he.current).createElement(a),s[Mt]=t,s[Zt]=e,Lt(s,a,e),Et(s),t.stateNode=s):t.memoizedState=wp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return be(t),e===null&&Le&&(s=t.stateNode=yp(t.type,t.pendingProps,he.current),Dt=t,hn=!0,c=nt,wa(t.type)?(Bc=c,nt=gn(s.firstChild)):nt=c),Ot(e,t,t.pendingProps.children,a),Dr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((c=s=nt)&&(s=ub(s,t.type,t.pendingProps,hn),s!==null?(t.stateNode=s,Dt=t,nt=gn(s.firstChild),hn=!1,c=!0):c=!1),c||oa(t)),be(t),c=t.type,d=t.pendingProps,b=e!==null?e.memoizedProps:null,s=d.children,Dc(c,d)?s=null:b!==null&&Dc(c,b)&&(t.flags|=32),t.memoizedState!==null&&(c=Mo(e,t,kg,null,null,a),Ms._currentValue=c),Dr(e,t),Ot(e,t,s,a),t.child;case 6:return e===null&&Le&&((e=a=nt)&&(a=db(a,t.pendingProps,hn),a!==null?(t.stateNode=a,Dt=t,nt=null,e=!0):e=!1),e||oa(t)),null;case 13:return of(e,t,a);case 4:return F(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=qa(t,null,s,a):Ot(e,t,s,a),t.child;case 11:return Pm(e,t,t.type,t.pendingProps,a);case 7:return Ot(e,t,t.pendingProps,a),t.child;case 8:return Ot(e,t,t.pendingProps.children,a),t.child;case 12:return Ot(e,t,t.pendingProps.children,a),t.child;case 10:return s=t.pendingProps,ca(t,t.type,s.value),Ot(e,t,s.children,a),t.child;case 9:return c=t.type._context,s=t.pendingProps.children,$a(t),c=_t(c),s=s(c),t.flags|=1,Ot(e,t,s,a),t.child;case 14:return Wm(e,t,t.type,t.pendingProps,a);case 15:return ef(e,t,t.type,t.pendingProps,a);case 19:return uf(e,t,a);case 31:return _g(e,t,a);case 22:return tf(e,t,a,t.pendingProps);case 24:return $a(t),s=_t(xt),e===null?(c=jo(),c===null&&(c=We,d=yo(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=a),c=d),t.memoizedState={parent:s,cache:c},No(t),ca(t,xt,c)):((e.lanes&a)!==0&&(So(e,t),ds(t,null,null,a),us()),c=e.memoizedState,d=t.memoizedState,c.parent!==s?(c={parent:s,cache:s},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),ca(t,xt,s)):(s=d.cache,ca(t,xt,s),s!==c.cache&&bo(t,[xt],a,!0))),Ot(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Qn(e){e.flags|=4}function sc(e,t,a,s,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if($f())e.flags|=8192;else throw Ga=gr,wo}else e.flags&=-16777217}function mf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Tp(t))if($f())e.flags|=8192;else throw Ga=gr,wo}function Or(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Nt():536870912,e.lanes|=t,Al|=t)}function gs(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function at(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags&65011712,s|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=a,t}function Lg(e,t,a){var s=t.pendingProps;switch(fo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return at(t),null;case 1:return at(t),null;case 3:return a=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Yn(xt),me(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(xl(t)?Qn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ho())),at(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(Qn(t),d!==null?(at(t),mf(t,d)):(at(t),sc(t,c,null,s,a))):d?d!==e.memoizedState?(Qn(t),at(t),mf(t,d)):(at(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Qn(t),at(t),sc(t,c,e,s,a)),null;case 27:if(Qe(t),a=he.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Qn(t);else{if(!s){if(t.stateNode===null)throw Error(o(166));return at(t),null}e=J.current,xl(t)?Fd(t):(e=yp(c,s,a),t.stateNode=e,Qn(t))}return at(t),null;case 5:if(Qe(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Qn(t);else{if(!s){if(t.stateNode===null)throw Error(o(166));return at(t),null}if(d=J.current,xl(t))Fd(t);else{var b=Ir(he.current);switch(d){case 1:d=b.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=b.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=b.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof s.is=="string"?b.createElement("select",{is:s.is}):b.createElement("select"),s.multiple?d.multiple=!0:s.size&&(d.size=s.size);break;default:d=typeof s.is=="string"?b.createElement(c,{is:s.is}):b.createElement(c)}}d[Mt]=t,d[Zt]=s;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)d.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=d;e:switch(Lt(d,c,s),c){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Qn(t)}}return at(t),sc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Qn(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(o(166));if(e=he.current,xl(t)){if(e=t.stateNode,a=t.memoizedProps,s=null,c=Dt,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[Mt]=t,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||op(e.nodeValue,a)),e||oa(t,!0)}else e=Ir(e).createTextNode(s),e[Mt]=t,t.stateNode=e}return at(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(s=xl(t),a!==null){if(e===null){if(!s)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Mt]=t}else za(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),e=!1}else a=ho(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(tn(t),t):(tn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return at(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=xl(t),s!==null&&s.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[Mt]=t}else za(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),c=!1}else c=ho(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(tn(t),t):(tn(t),null)}return tn(t),(t.flags&128)!==0?(t.lanes=a,t):(a=s!==null,e=e!==null&&e.memoizedState!==null,a&&(s=t.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==c&&(s.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Or(t,t.updateQueue),at(t),null);case 4:return me(),e===null&&Tc(t.stateNode.containerInfo),at(t),null;case 10:return Yn(t.type),at(t),null;case 19:if(_(mt),s=t.memoizedState,s===null)return at(t),null;if(c=(t.flags&128)!==0,d=s.rendering,d===null)if(c)gs(s,!1);else{if(ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=jr(e),d!==null){for(t.flags|=128,gs(s,!1),e=d.updateQueue,t.updateQueue=e,Or(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Ud(a,e),a=a.sibling;return V(mt,mt.current&1|2),Le&&Gn(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Ze()>Ur&&(t.flags|=128,c=!0,gs(s,!1),t.lanes=4194304)}else{if(!c)if(e=jr(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Or(t,e),gs(s,!0),s.tail===null&&s.tailMode==="hidden"&&!d.alternate&&!Le)return at(t),null}else 2*Ze()-s.renderingStartTime>Ur&&a!==536870912&&(t.flags|=128,c=!0,gs(s,!1),t.lanes=4194304);s.isBackwards?(d.sibling=t.child,t.child=d):(e=s.last,e!==null?e.sibling=d:t.child=d,s.last=d)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Ze(),e.sibling=null,a=mt.current,V(mt,c?a&1|2:a&1),Le&&Gn(t,s.treeForkCount),e):(at(t),null);case 22:case 23:return tn(t),Eo(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(a&536870912)!==0&&(t.flags&128)===0&&(at(t),t.subtreeFlags&6&&(t.flags|=8192)):at(t),a=t.updateQueue,a!==null&&Or(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==a&&(t.flags|=2048),e!==null&&_(Ua),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Yn(xt),at(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function zg(e,t){switch(fo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yn(xt),me(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Qe(t),null;case 31:if(t.memoizedState!==null){if(tn(t),t.alternate===null)throw Error(o(340));za()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(tn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));za()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _(mt),null;case 4:return me(),null;case 10:return Yn(t.type),null;case 22:case 23:return tn(t),Eo(),e!==null&&_(Ua),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yn(xt),null;case 25:return null;default:return null}}function ff(e,t){switch(fo(t),t.tag){case 3:Yn(xt),me();break;case 26:case 27:case 5:Qe(t);break;case 4:me();break;case 31:t.memoizedState!==null&&tn(t);break;case 13:tn(t);break;case 19:_(mt);break;case 10:Yn(t.type);break;case 22:case 23:tn(t),Eo(),e!==null&&_(Ua);break;case 24:Yn(xt)}}function bs(e,t){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var c=s.next;a=c;do{if((a.tag&e)===e){s=void 0;var d=a.create,b=a.inst;s=d(),b.destroy=s}a=a.next}while(a!==c)}}catch(N){Ie(t,t.return,N)}}function ha(e,t,a){try{var s=t.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var d=c.next;s=d;do{if((s.tag&e)===e){var b=s.inst,N=b.destroy;if(N!==void 0){b.destroy=void 0,c=t;var D=a,Y=N;try{Y()}catch(ee){Ie(c,D,ee)}}}s=s.next}while(s!==d)}}catch(ee){Ie(t,t.return,ee)}}function pf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{am(t,a)}catch(s){Ie(e,e.return,s)}}}function hf(e,t,a){a.props=Fa(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){Ie(e,t,s)}}function ys(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(c){Ie(e,t,c)}}function An(e,t){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(c){Ie(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){Ie(e,t,c)}else a.current=null}function xf(e){var t=e.type,a=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(c){Ie(e,e.return,c)}}function rc(e,t,a){try{var s=e.stateNode;lb(s,e.type,a,t),s[Zt]=t}catch(c){Ie(e,e.return,c)}}function gf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wa(e.type)||e.tag===4}function ic(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&wa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function oc(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=$n));else if(s!==4&&(s===27&&wa(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(oc(e,t,a),e=e.sibling;e!==null;)oc(e,t,a),e=e.sibling}function Lr(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(s!==4&&(s===27&&wa(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Lr(e,t,a),e=e.sibling;e!==null;)Lr(e,t,a),e=e.sibling}function bf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Lt(t,s,a),t[Mt]=e,t[Zt]=a}catch(d){Ie(e,e.return,d)}}var Xn=!1,yt=!1,cc=!1,yf=typeof WeakSet=="function"?WeakSet:Set,At=null;function Bg(e,t){if(e=e.containerInfo,Rc=ni,e=Rd(e),to(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var c=s.anchorOffset,d=s.focusNode;s=s.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var b=0,N=-1,D=-1,Y=0,ee=0,se=e,Z=null;t:for(;;){for(var X;se!==a||c!==0&&se.nodeType!==3||(N=b+c),se!==d||s!==0&&se.nodeType!==3||(D=b+s),se.nodeType===3&&(b+=se.nodeValue.length),(X=se.firstChild)!==null;)Z=se,se=X;for(;;){if(se===e)break t;if(Z===a&&++Y===c&&(N=b),Z===d&&++ee===s&&(D=b),(X=se.nextSibling)!==null)break;se=Z,Z=se.parentNode}se=X}a=N===-1||D===-1?null:{start:N,end:D}}else a=null}a=a||{start:0,end:0}}else a=null;for(Mc={focusedElem:e,selectionRange:a},ni=!1,At=t;At!==null;)if(t=At,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,At=e;else for(;At!==null;){switch(t=At,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)c=e[a],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,a=t,c=d.memoizedProps,d=d.memoizedState,s=a.stateNode;try{var ge=Fa(a.type,c);e=s.getSnapshotBeforeUpdate(ge,d),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ne){Ie(a,a.return,Ne)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Oc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Oc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,At=e;break}At=t.return}}function vf(e,t,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:Jn(e,a),s&4&&bs(5,a);break;case 1:if(Jn(e,a),s&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(b){Ie(a,a.return,b)}else{var c=Fa(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Ie(a,a.return,b)}}s&64&&pf(a),s&512&&ys(a,a.return);break;case 3:if(Jn(e,a),s&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{am(e,t)}catch(b){Ie(a,a.return,b)}}break;case 27:t===null&&s&4&&bf(a);case 26:case 5:Jn(e,a),t===null&&s&4&&xf(a),s&512&&ys(a,a.return);break;case 12:Jn(e,a);break;case 31:Jn(e,a),s&4&&Nf(e,a);break;case 13:Jn(e,a),s&4&&Sf(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Vg.bind(null,a),mb(e,a))));break;case 22:if(s=a.memoizedState!==null||Xn,!s){t=t!==null&&t.memoizedState!==null||yt,c=Xn;var d=yt;Xn=s,(yt=t)&&!d?Kn(e,a,(a.subtreeFlags&8772)!==0):Jn(e,a),Xn=c,yt=d}break;case 30:break;default:Jn(e,a)}}function jf(e){var t=e.alternate;t!==null&&(e.alternate=null,jf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&$i(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rt=null,Qt=!1;function In(e,t,a){for(a=a.child;a!==null;)wf(e,t,a),a=a.sibling}function wf(e,t,a){if(Oe&&typeof Oe.onCommitFiberUnmount=="function")try{Oe.onCommitFiberUnmount(et,a)}catch{}switch(a.tag){case 26:yt||An(a,t),In(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:yt||An(a,t);var s=rt,c=Qt;wa(a.type)&&(rt=a.stateNode,Qt=!1),In(e,t,a),Es(a.stateNode),rt=s,Qt=c;break;case 5:yt||An(a,t);case 6:if(s=rt,c=Qt,rt=null,In(e,t,a),rt=s,Qt=c,rt!==null)if(Qt)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(a.stateNode)}catch(d){Ie(a,t,d)}else try{rt.removeChild(a.stateNode)}catch(d){Ie(a,t,d)}break;case 18:rt!==null&&(Qt?(e=rt,pp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Bl(e)):pp(rt,a.stateNode));break;case 4:s=rt,c=Qt,rt=a.stateNode.containerInfo,Qt=!0,In(e,t,a),rt=s,Qt=c;break;case 0:case 11:case 14:case 15:ha(2,a,t),yt||ha(4,a,t),In(e,t,a);break;case 1:yt||(An(a,t),s=a.stateNode,typeof s.componentWillUnmount=="function"&&hf(a,t,s)),In(e,t,a);break;case 21:In(e,t,a);break;case 22:yt=(s=yt)||a.memoizedState!==null,In(e,t,a),yt=s;break;default:In(e,t,a)}}function Nf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Bl(e)}catch(a){Ie(t,t.return,a)}}}function Sf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Bl(e)}catch(a){Ie(t,t.return,a)}}function $g(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new yf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new yf),t;default:throw Error(o(435,e.tag))}}function zr(e,t){var a=$g(e);t.forEach(function(s){if(!a.has(s)){a.add(s);var c=Qg.bind(null,e,s);s.then(c,c)}})}function Xt(e,t){var a=t.deletions;if(a!==null)for(var s=0;s<a.length;s++){var c=a[s],d=e,b=t,N=b;e:for(;N!==null;){switch(N.tag){case 27:if(wa(N.type)){rt=N.stateNode,Qt=!1;break e}break;case 5:rt=N.stateNode,Qt=!1;break e;case 3:case 4:rt=N.stateNode.containerInfo,Qt=!0;break e}N=N.return}if(rt===null)throw Error(o(160));wf(d,b,c),rt=null,Qt=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)kf(t,e),t=t.sibling}var jn=null;function kf(e,t){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Xt(t,e),It(e),s&4&&(ha(3,e,e.return),bs(3,e),ha(5,e,e.return));break;case 1:Xt(t,e),It(e),s&512&&(yt||a===null||An(a,a.return)),s&64&&Xn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var c=jn;if(Xt(t,e),It(e),s&512&&(yt||a===null||An(a,a.return)),s&4){var d=a!==null?a.memoizedState:null;if(s=e.memoizedState,a===null)if(s===null)if(e.stateNode===null){e:{s=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(s){case"title":d=c.getElementsByTagName("title")[0],(!d||d[Vl]||d[Mt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(s),c.head.insertBefore(d,c.querySelector("head > title"))),Lt(d,s,a),d[Mt]=e,Et(d),s=d;break e;case"link":var b=kp("link","href",c).get(s+(a.href||""));if(b){for(var N=0;N<b.length;N++)if(d=b[N],d.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&d.getAttribute("rel")===(a.rel==null?null:a.rel)&&d.getAttribute("title")===(a.title==null?null:a.title)&&d.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){b.splice(N,1);break t}}d=c.createElement(s),Lt(d,s,a),c.head.appendChild(d);break;case"meta":if(b=kp("meta","content",c).get(s+(a.content||""))){for(N=0;N<b.length;N++)if(d=b[N],d.getAttribute("content")===(a.content==null?null:""+a.content)&&d.getAttribute("name")===(a.name==null?null:a.name)&&d.getAttribute("property")===(a.property==null?null:a.property)&&d.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&d.getAttribute("charset")===(a.charSet==null?null:a.charSet)){b.splice(N,1);break t}}d=c.createElement(s),Lt(d,s,a),c.head.appendChild(d);break;default:throw Error(o(468,s))}d[Mt]=e,Et(d),s=d}e.stateNode=s}else Cp(c,e.type,e.stateNode);else e.stateNode=Sp(c,s,e.memoizedProps);else d!==s?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,s===null?Cp(c,e.type,e.stateNode):Sp(c,s,e.memoizedProps)):s===null&&e.stateNode!==null&&rc(e,e.memoizedProps,a.memoizedProps)}break;case 27:Xt(t,e),It(e),s&512&&(yt||a===null||An(a,a.return)),a!==null&&s&4&&rc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Xt(t,e),It(e),s&512&&(yt||a===null||An(a,a.return)),e.flags&32){c=e.stateNode;try{rl(c,"")}catch(ge){Ie(e,e.return,ge)}}s&4&&e.stateNode!=null&&(c=e.memoizedProps,rc(e,c,a!==null?a.memoizedProps:c)),s&1024&&(cc=!0);break;case 6:if(Xt(t,e),It(e),s&4){if(e.stateNode===null)throw Error(o(162));s=e.memoizedProps,a=e.stateNode;try{a.nodeValue=s}catch(ge){Ie(e,e.return,ge)}}break;case 3:if(Pr=null,c=jn,jn=Jr(t.containerInfo),Xt(t,e),jn=c,It(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{Bl(t.containerInfo)}catch(ge){Ie(e,e.return,ge)}cc&&(cc=!1,Cf(e));break;case 4:s=jn,jn=Jr(e.stateNode.containerInfo),Xt(t,e),It(e),jn=s;break;case 12:Xt(t,e),It(e);break;case 31:Xt(t,e),It(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,zr(e,s)));break;case 13:Xt(t,e),It(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&($r=Ze()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,zr(e,s)));break;case 22:c=e.memoizedState!==null;var D=a!==null&&a.memoizedState!==null,Y=Xn,ee=yt;if(Xn=Y||c,yt=ee||D,Xt(t,e),yt=ee,Xn=Y,It(e),s&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||D||Xn||yt||Za(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){D=a=t;try{if(d=D.stateNode,c)b=d.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{N=D.stateNode;var se=D.memoizedProps.style,Z=se!=null&&se.hasOwnProperty("display")?se.display:null;N.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(ge){Ie(D,D.return,ge)}}}else if(t.tag===6){if(a===null){D=t;try{D.stateNode.nodeValue=c?"":D.memoizedProps}catch(ge){Ie(D,D.return,ge)}}}else if(t.tag===18){if(a===null){D=t;try{var X=D.stateNode;c?hp(X,!0):hp(D.stateNode,!1)}catch(ge){Ie(D,D.return,ge)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,zr(e,a))));break;case 19:Xt(t,e),It(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,zr(e,s)));break;case 30:break;case 21:break;default:Xt(t,e),It(e)}}function It(e){var t=e.flags;if(t&2){try{for(var a,s=e.return;s!==null;){if(gf(s)){a=s;break}s=s.return}if(a==null)throw Error(o(160));switch(a.tag){case 27:var c=a.stateNode,d=ic(e);Lr(e,d,c);break;case 5:var b=a.stateNode;a.flags&32&&(rl(b,""),a.flags&=-33);var N=ic(e);Lr(e,N,b);break;case 3:case 4:var D=a.stateNode.containerInfo,Y=ic(e);oc(e,Y,D);break;default:throw Error(o(161))}}catch(ee){Ie(e,e.return,ee)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Cf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Jn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)vf(e,t.alternate,t),t=t.sibling}function Za(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ha(4,t,t.return),Za(t);break;case 1:An(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&hf(t,t.return,a),Za(t);break;case 27:Es(t.stateNode);case 26:case 5:An(t,t.return),Za(t);break;case 22:t.memoizedState===null&&Za(t);break;case 30:Za(t);break;default:Za(t)}e=e.sibling}}function Kn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,c=e,d=t,b=d.flags;switch(d.tag){case 0:case 11:case 15:Kn(c,d,a),bs(4,d);break;case 1:if(Kn(c,d,a),s=d,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(Y){Ie(s,s.return,Y)}if(s=d,c=s.updateQueue,c!==null){var N=s.stateNode;try{var D=c.shared.hiddenCallbacks;if(D!==null)for(c.shared.hiddenCallbacks=null,c=0;c<D.length;c++)nm(D[c],N)}catch(Y){Ie(s,s.return,Y)}}a&&b&64&&pf(d),ys(d,d.return);break;case 27:bf(d);case 26:case 5:Kn(c,d,a),a&&s===null&&b&4&&xf(d),ys(d,d.return);break;case 12:Kn(c,d,a);break;case 31:Kn(c,d,a),a&&b&4&&Nf(c,d);break;case 13:Kn(c,d,a),a&&b&4&&Sf(c,d);break;case 22:d.memoizedState===null&&Kn(c,d,a),ys(d,d.return);break;case 30:break;default:Kn(c,d,a)}t=t.sibling}}function uc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&ss(a))}function dc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ss(e))}function wn(e,t,a,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tf(e,t,a,s),t=t.sibling}function Tf(e,t,a,s){var c=t.flags;switch(t.tag){case 0:case 11:case 15:wn(e,t,a,s),c&2048&&bs(9,t);break;case 1:wn(e,t,a,s);break;case 3:wn(e,t,a,s),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ss(e)));break;case 12:if(c&2048){wn(e,t,a,s),e=t.stateNode;try{var d=t.memoizedProps,b=d.id,N=d.onPostCommit;typeof N=="function"&&N(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){Ie(t,t.return,D)}}else wn(e,t,a,s);break;case 31:wn(e,t,a,s);break;case 13:wn(e,t,a,s);break;case 23:break;case 22:d=t.stateNode,b=t.alternate,t.memoizedState!==null?d._visibility&2?wn(e,t,a,s):vs(e,t):d._visibility&2?wn(e,t,a,s):(d._visibility|=2,Cl(e,t,a,s,(t.subtreeFlags&10256)!==0||!1)),c&2048&&uc(b,t);break;case 24:wn(e,t,a,s),c&2048&&dc(t.alternate,t);break;default:wn(e,t,a,s)}}function Cl(e,t,a,s,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,b=t,N=a,D=s,Y=b.flags;switch(b.tag){case 0:case 11:case 15:Cl(d,b,N,D,c),bs(8,b);break;case 23:break;case 22:var ee=b.stateNode;b.memoizedState!==null?ee._visibility&2?Cl(d,b,N,D,c):vs(d,b):(ee._visibility|=2,Cl(d,b,N,D,c)),c&&Y&2048&&uc(b.alternate,b);break;case 24:Cl(d,b,N,D,c),c&&Y&2048&&dc(b.alternate,b);break;default:Cl(d,b,N,D,c)}t=t.sibling}}function vs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,s=t,c=s.flags;switch(s.tag){case 22:vs(a,s),c&2048&&uc(s.alternate,s);break;case 24:vs(a,s),c&2048&&dc(s.alternate,s);break;default:vs(a,s)}t=t.sibling}}var js=8192;function Tl(e,t,a){if(e.subtreeFlags&js)for(e=e.child;e!==null;)Ef(e,t,a),e=e.sibling}function Ef(e,t,a){switch(e.tag){case 26:Tl(e,t,a),e.flags&js&&e.memoizedState!==null&&Sb(a,jn,e.memoizedState,e.memoizedProps);break;case 5:Tl(e,t,a);break;case 3:case 4:var s=jn;jn=Jr(e.stateNode.containerInfo),Tl(e,t,a),jn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=js,js=16777216,Tl(e,t,a),js=s):Tl(e,t,a));break;default:Tl(e,t,a)}}function Af(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ws(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];At=s,Mf(s,e)}Af(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Rf(e),e=e.sibling}function Rf(e){switch(e.tag){case 0:case 11:case 15:ws(e),e.flags&2048&&ha(9,e,e.return);break;case 3:ws(e);break;case 12:ws(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Br(e)):ws(e);break;default:ws(e)}}function Br(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];At=s,Mf(s,e)}Af(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ha(8,t,t.return),Br(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Br(t));break;default:Br(t)}e=e.sibling}}function Mf(e,t){for(;At!==null;){var a=At;switch(a.tag){case 0:case 11:case 15:ha(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:ss(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,At=s;else e:for(a=e;At!==null;){s=At;var c=s.sibling,d=s.return;if(jf(s),s===a){At=null;break e}if(c!==null){c.return=d,At=c;break e}At=d}}}var Ug={getCacheForType:function(e){var t=_t(xt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return _t(xt).controller.signal}},Hg=typeof WeakMap=="function"?WeakMap:Map,Ve=0,We=null,Ae=null,Me=0,Xe=0,nn=null,xa=!1,El=!1,mc=!1,Pn=0,ut=0,ga=0,Va=0,fc=0,an=0,Al=0,Ns=null,Jt=null,pc=!1,$r=0,Df=0,Ur=1/0,Hr=null,ba=null,St=0,ya=null,Rl=null,Wn=0,hc=0,xc=null,_f=null,Ss=0,gc=null;function ln(){return(Ve&2)!==0&&Me!==0?Me&-Me:U.T!==null?Nc():Xu()}function Of(){if(an===0)if((Me&536870912)===0||Le){var e=zn;zn<<=1,(zn&3932160)===0&&(zn=262144),an=e}else an=536870912;return e=en.current,e!==null&&(e.flags|=32),an}function Kt(e,t,a){(e===We&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)&&(Ml(e,0),va(e,Me,an,!1)),Rt(e,a),((Ve&2)===0||e!==We)&&(e===We&&((Ve&2)===0&&(Va|=a),ut===4&&va(e,Me,an,!1)),Rn(e))}function Lf(e,t,a){if((Ve&6)!==0)throw Error(o(327));var s=!a&&(t&127)===0&&(t&e.expiredLanes)===0||He(e,t),c=s?Yg(e,t):yc(e,t,!0),d=s;do{if(c===0){El&&!s&&va(e,t,0,!1);break}else{if(a=e.current.alternate,d&&!Gg(a)){c=yc(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var N=e;c=Ns;var D=N.current.memoizedState.isDehydrated;if(D&&(Ml(N,b).flags|=256),b=yc(N,b,!1),b!==2){if(mc&&!D){N.errorRecoveryDisabledLanes|=d,Va|=d,c=4;break e}d=Jt,Jt=c,d!==null&&(Jt===null?Jt=d:Jt.push.apply(Jt,d))}c=b}if(d=!1,c!==2)continue}}if(c===1){Ml(e,0),va(e,t,0,!0);break}e:{switch(s=e,d=c,d){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:va(s,t,an,!xa);break e;case 2:Jt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=$r+300-Ze(),10<c)){if(va(s,t,an,!xa),ke(s,0,!0)!==0)break e;Wn=t,s.timeoutHandle=mp(zf.bind(null,s,a,Jt,Hr,pc,t,an,Va,Al,xa,d,"Throttled",-0,0),c);break e}zf(s,a,Jt,Hr,pc,t,an,Va,Al,xa,d,null,-0,0)}}break}while(!0);Rn(e)}function zf(e,t,a,s,c,d,b,N,D,Y,ee,se,Z,X){if(e.timeoutHandle=-1,se=t.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$n},Ef(t,d,se);var ge=(d&62914560)===d?$r-Ze():(d&4194048)===d?Df-Ze():0;if(ge=kb(se,ge),ge!==null){Wn=d,e.cancelPendingCommit=ge(Ff.bind(null,e,t,d,a,s,c,b,N,D,ee,se,null,Z,X)),va(e,d,b,!Y);return}}Ff(e,t,d,a,s,c,b,N,D)}function Gg(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var s=0;s<a.length;s++){var c=a[s],d=c.getSnapshot;c=c.value;try{if(!Pt(d(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function va(e,t,a,s){t&=~fc,t&=~Va,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var c=t;0<c;){var d=31-tt(c),b=1<<d;s[d]=-1,c&=~b}a!==0&&Pa(e,a,t)}function Gr(){return(Ve&6)===0?(ks(0),!1):!0}function bc(){if(Ae!==null){if(Xe===0)var e=Ae.return;else e=Ae,qn=Ba=null,Oo(e),jl=null,is=0,e=Ae;for(;e!==null;)ff(e.alternate,e),e=e.return;Ae=null}}function Ml(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,ib(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Wn=0,bc(),We=e,Ae=a=Hn(e.current,null),Me=t,Xe=0,nn=null,xa=!1,El=He(e,t),mc=!1,Al=an=fc=Va=ga=ut=0,Jt=Ns=null,pc=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var c=31-tt(s),d=1<<c;t|=e[c],s&=~d}return Pn=t,or(),a}function Bf(e,t){Te=null,U.H=hs,t===vl||t===xr?(t=Pd(),Xe=3):t===wo?(t=Pd(),Xe=4):Xe=t===Jo?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,nn=t,Ae===null&&(ut=1,Rr(e,mn(t,e.current)))}function $f(){var e=en.current;return e===null?!0:(Me&4194048)===Me?xn===null:(Me&62914560)===Me||(Me&536870912)!==0?e===xn:!1}function Uf(){var e=U.H;return U.H=hs,e===null?hs:e}function Hf(){var e=U.A;return U.A=Ug,e}function qr(){ut=4,xa||(Me&4194048)!==Me&&en.current!==null||(El=!0),(ga&134217727)===0&&(Va&134217727)===0||We===null||va(We,Me,an,!1)}function yc(e,t,a){var s=Ve;Ve|=2;var c=Uf(),d=Hf();(We!==e||Me!==t)&&(Hr=null,Ml(e,t)),t=!1;var b=ut;e:do try{if(Xe!==0&&Ae!==null){var N=Ae,D=nn;switch(Xe){case 8:bc(),b=6;break e;case 3:case 2:case 9:case 6:en.current===null&&(t=!0);var Y=Xe;if(Xe=0,nn=null,Dl(e,N,D,Y),a&&El){b=0;break e}break;default:Y=Xe,Xe=0,nn=null,Dl(e,N,D,Y)}}qg(),b=ut;break}catch(ee){Bf(e,ee)}while(!0);return t&&e.shellSuspendCounter++,qn=Ba=null,Ve=s,U.H=c,U.A=d,Ae===null&&(We=null,Me=0,or()),b}function qg(){for(;Ae!==null;)Gf(Ae)}function Yg(e,t){var a=Ve;Ve|=2;var s=Uf(),c=Hf();We!==e||Me!==t?(Hr=null,Ur=Ze()+500,Ml(e,t)):El=He(e,t);e:do try{if(Xe!==0&&Ae!==null){t=Ae;var d=nn;t:switch(Xe){case 1:Xe=0,nn=null,Dl(e,t,d,1);break;case 2:case 9:if(Jd(d)){Xe=0,nn=null,qf(t);break}t=function(){Xe!==2&&Xe!==9||We!==e||(Xe=7),Rn(e)},d.then(t,t);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:Jd(d)?(Xe=0,nn=null,qf(t)):(Xe=0,nn=null,Dl(e,t,d,7));break;case 5:var b=null;switch(Ae.tag){case 26:b=Ae.memoizedState;case 5:case 27:var N=Ae;if(b?Tp(b):N.stateNode.complete){Xe=0,nn=null;var D=N.sibling;if(D!==null)Ae=D;else{var Y=N.return;Y!==null?(Ae=Y,Yr(Y)):Ae=null}break t}}Xe=0,nn=null,Dl(e,t,d,5);break;case 6:Xe=0,nn=null,Dl(e,t,d,6);break;case 8:bc(),ut=6;break e;default:throw Error(o(462))}}Fg();break}catch(ee){Bf(e,ee)}while(!0);return qn=Ba=null,U.H=s,U.A=c,Ve=a,Ae!==null?0:(We=null,Me=0,or(),ut)}function Fg(){for(;Ae!==null&&!jt();)Gf(Ae)}function Gf(e){var t=df(e.alternate,e,Pn);e.memoizedProps=e.pendingProps,t===null?Yr(e):Ae=t}function qf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=lf(a,t,t.pendingProps,t.type,void 0,Me);break;case 11:t=lf(a,t,t.pendingProps,t.type.render,t.ref,Me);break;case 5:Oo(t);default:ff(a,t),t=Ae=Ud(t,Pn),t=df(a,t,Pn)}e.memoizedProps=e.pendingProps,t===null?Yr(e):Ae=t}function Dl(e,t,a,s){qn=Ba=null,Oo(t),jl=null,is=0;var c=t.return;try{if(Dg(e,c,t,a,Me)){ut=1,Rr(e,mn(a,e.current)),Ae=null;return}}catch(d){if(c!==null)throw Ae=c,d;ut=1,Rr(e,mn(a,e.current)),Ae=null;return}t.flags&32768?(Le||s===1?e=!0:El||(Me&536870912)!==0?e=!1:(xa=e=!0,(s===2||s===9||s===3||s===6)&&(s=en.current,s!==null&&s.tag===13&&(s.flags|=16384))),Yf(t,e)):Yr(t)}function Yr(e){var t=e;do{if((t.flags&32768)!==0){Yf(t,xa);return}e=t.return;var a=Lg(t.alternate,t,Pn);if(a!==null){Ae=a;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);ut===0&&(ut=5)}function Yf(e,t){do{var a=zg(e.alternate,e);if(a!==null){a.flags&=32767,Ae=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ae=e;return}Ae=e=a}while(e!==null);ut=6,Ae=null}function Ff(e,t,a,s,c,d,b,N,D){e.cancelPendingCommit=null;do Fr();while(St!==0);if((Ve&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(d=t.lanes|t.childLanes,d|=ro,Tt(e,a,d,b,N,D),e===We&&(Ae=We=null,Me=0),Rl=t,ya=e,Wn=a,hc=d,xc=c,_f=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Xg(ce,function(){return If(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=U.T,U.T=null,c=z.p,z.p=2,b=Ve,Ve|=4;try{Bg(e,t,a)}finally{Ve=b,z.p=c,U.T=s}}St=1,Zf(),Vf(),Qf()}}function Zf(){if(St===1){St=0;var e=ya,t=Rl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=U.T,U.T=null;var s=z.p;z.p=2;var c=Ve;Ve|=4;try{kf(t,e);var d=Mc,b=Rd(e.containerInfo),N=d.focusedElem,D=d.selectionRange;if(b!==N&&N&&N.ownerDocument&&Ad(N.ownerDocument.documentElement,N)){if(D!==null&&to(N)){var Y=D.start,ee=D.end;if(ee===void 0&&(ee=Y),"selectionStart"in N)N.selectionStart=Y,N.selectionEnd=Math.min(ee,N.value.length);else{var se=N.ownerDocument||document,Z=se&&se.defaultView||window;if(Z.getSelection){var X=Z.getSelection(),ge=N.textContent.length,Ne=Math.min(D.start,ge),Pe=D.end===void 0?Ne:Math.min(D.end,ge);!X.extend&&Ne>Pe&&(b=Pe,Pe=Ne,Ne=b);var B=Ed(N,Ne),L=Ed(N,Pe);if(B&&L&&(X.rangeCount!==1||X.anchorNode!==B.node||X.anchorOffset!==B.offset||X.focusNode!==L.node||X.focusOffset!==L.offset)){var q=se.createRange();q.setStart(B.node,B.offset),X.removeAllRanges(),Ne>Pe?(X.addRange(q),X.extend(L.node,L.offset)):(q.setEnd(L.node,L.offset),X.addRange(q))}}}}for(se=[],X=N;X=X.parentNode;)X.nodeType===1&&se.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<se.length;N++){var le=se[N];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}ni=!!Rc,Mc=Rc=null}finally{Ve=c,z.p=s,U.T=a}}e.current=t,St=2}}function Vf(){if(St===2){St=0;var e=ya,t=Rl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=U.T,U.T=null;var s=z.p;z.p=2;var c=Ve;Ve|=4;try{vf(e,t.alternate,t)}finally{Ve=c,z.p=s,U.T=a}}St=3}}function Qf(){if(St===4||St===3){St=0,st();var e=ya,t=Rl,a=Wn,s=_f;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?St=5:(St=0,Rl=ya=null,Xf(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(ba=null),zi(a),t=t.stateNode,Oe&&typeof Oe.onCommitFiberRoot=="function")try{Oe.onCommitFiberRoot(et,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=U.T,c=z.p,z.p=2,U.T=null;try{for(var d=e.onRecoverableError,b=0;b<s.length;b++){var N=s[b];d(N.value,{componentStack:N.stack})}}finally{U.T=t,z.p=c}}(Wn&3)!==0&&Fr(),Rn(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===gc?Ss++:(Ss=0,gc=e):Ss=0,ks(0)}}function Xf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ss(t)))}function Fr(){return Zf(),Vf(),Qf(),If()}function If(){if(St!==5)return!1;var e=ya,t=hc;hc=0;var a=zi(Wn),s=U.T,c=z.p;try{z.p=32>a?32:a,U.T=null,a=xc,xc=null;var d=ya,b=Wn;if(St=0,Rl=ya=null,Wn=0,(Ve&6)!==0)throw Error(o(331));var N=Ve;if(Ve|=4,Rf(d.current),Tf(d,d.current,b,a),Ve=N,ks(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot=="function")try{Oe.onPostCommitFiberRoot(et,d)}catch{}return!0}finally{z.p=c,U.T=s,Xf(e,t)}}function Jf(e,t,a){t=mn(a,t),t=Io(e.stateNode,t,2),e=ma(e,t,2),e!==null&&(Rt(e,2),Rn(e))}function Ie(e,t,a){if(e.tag===3)Jf(e,e,a);else for(;t!==null;){if(t.tag===3){Jf(t,e,a);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ba===null||!ba.has(s))){e=mn(a,e),a=Jm(2),s=ma(t,a,2),s!==null&&(Km(a,s,t,e),Rt(s,2),Rn(s));break}}t=t.return}}function vc(e,t,a){var s=e.pingCache;if(s===null){s=e.pingCache=new Hg;var c=new Set;s.set(t,c)}else c=s.get(t),c===void 0&&(c=new Set,s.set(t,c));c.has(a)||(mc=!0,c.add(a),e=Zg.bind(null,e,t,a),t.then(e,e))}function Zg(e,t,a){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,We===e&&(Me&a)===a&&(ut===4||ut===3&&(Me&62914560)===Me&&300>Ze()-$r?(Ve&2)===0&&Ml(e,0):fc|=a,Al===Me&&(Al=0)),Rn(e)}function Kf(e,t){t===0&&(t=Nt()),e=Oa(e,t),e!==null&&(Rt(e,t),Rn(e))}function Vg(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Kf(e,a)}function Qg(e,t){var a=0;switch(e.tag){case 31:case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(o(314))}s!==null&&s.delete(t),Kf(e,a)}function Xg(e,t){return ze(e,t)}var Zr=null,_l=null,jc=!1,Vr=!1,wc=!1,ja=0;function Rn(e){e!==_l&&e.next===null&&(_l===null?Zr=_l=e:_l=_l.next=e),Vr=!0,jc||(jc=!0,Jg())}function ks(e,t){if(!wc&&Vr){wc=!0;do for(var a=!1,s=Zr;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var d=0;else{var b=s.suspendedLanes,N=s.pingedLanes;d=(1<<31-tt(42|e)+1)-1,d&=c&~(b&~N),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,tp(s,d))}else d=Me,d=ke(s,s===We?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||He(s,d)||(a=!0,tp(s,d));s=s.next}while(a);wc=!1}}function Ig(){Pf()}function Pf(){Vr=jc=!1;var e=0;ja!==0&&rb()&&(e=ja);for(var t=Ze(),a=null,s=Zr;s!==null;){var c=s.next,d=Wf(s,t);d===0?(s.next=null,a===null?Zr=c:a.next=c,c===null&&(_l=a)):(a=s,(e!==0||(d&3)!==0)&&(Vr=!0)),s=c}St!==0&&St!==5||ks(e),ja!==0&&(ja=0)}function Wf(e,t){for(var a=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var b=31-tt(d),N=1<<b,D=c[b];D===-1?((N&a)===0||(N&s)!==0)&&(c[b]=wt(N,t)):D<=t&&(e.expiredLanes|=N),d&=~N}if(t=We,a=Me,a=ke(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===t&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&ot(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||He(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(s!==null&&ot(s),zi(a)){case 2:case 8:a=ve;break;case 32:a=ce;break;case 268435456:a=_e;break;default:a=ce}return s=ep.bind(null,e),a=ze(a,s),e.callbackPriority=t,e.callbackNode=a,t}return s!==null&&s!==null&&ot(s),e.callbackPriority=2,e.callbackNode=null,2}function ep(e,t){if(St!==0&&St!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Fr()&&e.callbackNode!==a)return null;var s=Me;return s=ke(e,e===We?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Lf(e,s,t),Wf(e,Ze()),e.callbackNode!=null&&e.callbackNode===a?ep.bind(null,e):null)}function tp(e,t){if(Fr())return null;Lf(e,t,!0)}function Jg(){ob(function(){(Ve&6)!==0?ze(we,Ig):Pf()})}function Nc(){if(ja===0){var e=bl;e===0&&(e=Ln,Ln<<=1,(Ln&261888)===0&&(Ln=256)),ja=e}return ja}function np(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:er(""+e)}function ap(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Kg(e,t,a,s,c){if(t==="submit"&&a&&a.stateNode===c){var d=np((c[Zt]||null).action),b=s.submitter;b&&(t=(t=b[Zt]||null)?np(t.formAction):b.getAttribute("formAction"),t!==null&&(d=t,b=null));var N=new lr("action","action",null,s,c);e.push({event:N,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ja!==0){var D=b?ap(c,b):new FormData(c);Yo(a,{pending:!0,data:D,method:c.method,action:d},null,D)}}else typeof d=="function"&&(N.preventDefault(),D=b?ap(c,b):new FormData(c),Yo(a,{pending:!0,data:D,method:c.method,action:d},d,D))},currentTarget:c}]})}}for(var Sc=0;Sc<so.length;Sc++){var kc=so[Sc],Pg=kc.toLowerCase(),Wg=kc[0].toUpperCase()+kc.slice(1);vn(Pg,"on"+Wg)}vn(_d,"onAnimationEnd"),vn(Od,"onAnimationIteration"),vn(Ld,"onAnimationStart"),vn("dblclick","onDoubleClick"),vn("focusin","onFocus"),vn("focusout","onBlur"),vn(hg,"onTransitionRun"),vn(xg,"onTransitionStart"),vn(gg,"onTransitionCancel"),vn(zd,"onTransitionEnd"),ll("onMouseEnter",["mouseout","mouseover"]),ll("onMouseLeave",["mouseout","mouseover"]),ll("onPointerEnter",["pointerout","pointerover"]),ll("onPointerLeave",["pointerout","pointerover"]),Ra("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ra("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ra("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ra("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ra("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ra("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cs="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(" "),eb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Cs));function lp(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],c=s.event;s=s.listeners;e:{var d=void 0;if(t)for(var b=s.length-1;0<=b;b--){var N=s[b],D=N.instance,Y=N.currentTarget;if(N=N.listener,D!==d&&c.isPropagationStopped())break e;d=N,c.currentTarget=Y;try{d(c)}catch(ee){ir(ee)}c.currentTarget=null,d=D}else for(b=0;b<s.length;b++){if(N=s[b],D=N.instance,Y=N.currentTarget,N=N.listener,D!==d&&c.isPropagationStopped())break e;d=N,c.currentTarget=Y;try{d(c)}catch(ee){ir(ee)}c.currentTarget=null,d=D}}}}function Re(e,t){var a=t[Bi];a===void 0&&(a=t[Bi]=new Set);var s=e+"__bubble";a.has(s)||(sp(t,e,2,!1),a.add(s))}function Cc(e,t,a){var s=0;t&&(s|=4),sp(a,e,s,t)}var Qr="_reactListening"+Math.random().toString(36).slice(2);function Tc(e){if(!e[Qr]){e[Qr]=!0,Ku.forEach(function(a){a!=="selectionchange"&&(eb.has(a)||Cc(a,!1,e),Cc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qr]||(t[Qr]=!0,Cc("selectionchange",!1,t))}}function sp(e,t,a,s){switch(Op(t)){case 2:var c=Eb;break;case 8:c=Ab;break;default:c=qc}a=c.bind(null,t,a,e),c=void 0,!Vi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function Ec(e,t,a,s,c){var d=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var b=s.tag;if(b===3||b===4){var N=s.stateNode.containerInfo;if(N===c)break;if(b===4)for(b=s.return;b!==null;){var D=b.tag;if((D===3||D===4)&&b.stateNode.containerInfo===c)return;b=b.return}for(;N!==null;){if(b=tl(N),b===null)return;if(D=b.tag,D===5||D===6||D===26||D===27){s=d=b;continue e}N=N.parentNode}}s=s.return}cd(function(){var Y=d,ee=Fi(a),se=[];e:{var Z=Bd.get(e);if(Z!==void 0){var X=lr,ge=e;switch(e){case"keypress":if(nr(a)===0)break e;case"keydown":case"keyup":X=Qx;break;case"focusin":ge="focus",X=Ji;break;case"focusout":ge="blur",X=Ji;break;case"beforeblur":case"afterblur":X=Ji;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":X=md;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=Lx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=Jx;break;case _d:case Od:case Ld:X=$x;break;case zd:X=Px;break;case"scroll":case"scrollend":X=_x;break;case"wheel":X=eg;break;case"copy":case"cut":case"paste":X=Hx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=pd;break;case"toggle":case"beforetoggle":X=ng}var Ne=(t&4)!==0,Pe=!Ne&&(e==="scroll"||e==="scrollend"),B=Ne?Z!==null?Z+"Capture":null:Z;Ne=[];for(var L=Y,q;L!==null;){var le=L;if(q=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||q===null||B===null||(le=Xl(L,B),le!=null&&Ne.push(Ts(L,le,q))),Pe)break;L=L.return}0<Ne.length&&(Z=new X(Z,ge,null,a,ee),se.push({event:Z,listeners:Ne}))}}if((t&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",X=e==="mouseout"||e==="pointerout",Z&&a!==Yi&&(ge=a.relatedTarget||a.fromElement)&&(tl(ge)||ge[el]))break e;if((X||Z)&&(Z=ee.window===ee?ee:(Z=ee.ownerDocument)?Z.defaultView||Z.parentWindow:window,X?(ge=a.relatedTarget||a.toElement,X=Y,ge=ge?tl(ge):null,ge!==null&&(Pe=m(ge),Ne=ge.tag,ge!==Pe||Ne!==5&&Ne!==27&&Ne!==6)&&(ge=null)):(X=null,ge=Y),X!==ge)){if(Ne=md,le="onMouseLeave",B="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=pd,le="onPointerLeave",B="onPointerEnter",L="pointer"),Pe=X==null?Z:Ql(X),q=ge==null?Z:Ql(ge),Z=new Ne(le,L+"leave",X,a,ee),Z.target=Pe,Z.relatedTarget=q,le=null,tl(ee)===Y&&(Ne=new Ne(B,L+"enter",ge,a,ee),Ne.target=q,Ne.relatedTarget=Pe,le=Ne),Pe=le,X&&ge)t:{for(Ne=tb,B=X,L=ge,q=0,le=B;le;le=Ne(le))q++;le=0;for(var je=L;je;je=Ne(je))le++;for(;0<q-le;)B=Ne(B),q--;for(;0<le-q;)L=Ne(L),le--;for(;q--;){if(B===L||L!==null&&B===L.alternate){Ne=B;break t}B=Ne(B),L=Ne(L)}Ne=null}else Ne=null;X!==null&&rp(se,Z,X,Ne,!1),ge!==null&&Pe!==null&&rp(se,Pe,ge,Ne,!0)}}e:{if(Z=Y?Ql(Y):window,X=Z.nodeName&&Z.nodeName.toLowerCase(),X==="select"||X==="input"&&Z.type==="file")var Ge=wd;else if(vd(Z))if(Nd)Ge=mg;else{Ge=ug;var ye=cg}else X=Z.nodeName,!X||X.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?Y&&qi(Y.elementType)&&(Ge=wd):Ge=dg;if(Ge&&(Ge=Ge(e,Y))){jd(se,Ge,a,ee);break e}ye&&ye(e,Z,Y),e==="focusout"&&Y&&Z.type==="number"&&Y.memoizedProps.value!=null&&Gi(Z,"number",Z.value)}switch(ye=Y?Ql(Y):window,e){case"focusin":(vd(ye)||ye.contentEditable==="true")&&(ul=ye,no=Y,ns=null);break;case"focusout":ns=no=ul=null;break;case"mousedown":ao=!0;break;case"contextmenu":case"mouseup":case"dragend":ao=!1,Md(se,a,ee);break;case"selectionchange":if(pg)break;case"keydown":case"keyup":Md(se,a,ee)}var Ee;if(Pi)e:{switch(e){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else cl?bd(e,a)&&(De="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(De="onCompositionStart");De&&(hd&&a.locale!=="ko"&&(cl||De!=="onCompositionStart"?De==="onCompositionEnd"&&cl&&(Ee=ud()):(sa=ee,Qi="value"in sa?sa.value:sa.textContent,cl=!0)),ye=Xr(Y,De),0<ye.length&&(De=new fd(De,e,null,a,ee),se.push({event:De,listeners:ye}),Ee?De.data=Ee:(Ee=yd(a),Ee!==null&&(De.data=Ee)))),(Ee=lg?sg(e,a):rg(e,a))&&(De=Xr(Y,"onBeforeInput"),0<De.length&&(ye=new fd("onBeforeInput","beforeinput",null,a,ee),se.push({event:ye,listeners:De}),ye.data=Ee)),Kg(se,e,Y,a,ee)}lp(se,t)})}function Ts(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Xr(e,t){for(var a=t+"Capture",s=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=Xl(e,a),c!=null&&s.unshift(Ts(e,c,d)),c=Xl(e,t),c!=null&&s.push(Ts(e,c,d))),e.tag===3)return s;e=e.return}return[]}function tb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function rp(e,t,a,s,c){for(var d=t._reactName,b=[];a!==null&&a!==s;){var N=a,D=N.alternate,Y=N.stateNode;if(N=N.tag,D!==null&&D===s)break;N!==5&&N!==26&&N!==27||Y===null||(D=Y,c?(Y=Xl(a,d),Y!=null&&b.unshift(Ts(a,Y,D))):c||(Y=Xl(a,d),Y!=null&&b.push(Ts(a,Y,D)))),a=a.return}b.length!==0&&e.push({event:t,listeners:b})}var nb=/\r\n?/g,ab=/\u0000|\uFFFD/g;function ip(e){return(typeof e=="string"?e:""+e).replace(nb,`
|
|
56
|
+
`).replace(ab,"")}function op(e,t){return t=ip(t),ip(e)===t}function Ke(e,t,a,s,c,d){switch(a){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||rl(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&rl(e,""+s);break;case"className":Ps(e,"class",s);break;case"tabIndex":Ps(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Ps(e,a,s);break;case"style":id(e,s,d);break;case"data":if(t!=="object"){Ps(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=er(""+s),e.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(a==="formAction"?(t!=="input"&&Ke(e,t,"name",c.name,c,null),Ke(e,t,"formEncType",c.formEncType,c,null),Ke(e,t,"formMethod",c.formMethod,c,null),Ke(e,t,"formTarget",c.formTarget,c,null)):(Ke(e,t,"encType",c.encType,c,null),Ke(e,t,"method",c.method,c,null),Ke(e,t,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=er(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=$n);break;case"onScroll":s!=null&&Re("scroll",e);break;case"onScrollEnd":s!=null&&Re("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(o(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}a=er(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""+s):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":s===!0?e.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,s):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(a,s):e.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(a):e.setAttribute(a,s);break;case"popover":Re("beforetoggle",e),Re("toggle",e),Ks(e,"popover",s);break;case"xlinkActuate":Bn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Bn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Bn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Bn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Bn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Bn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Ks(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Mx.get(a)||a,Ks(e,a,s))}}function Ac(e,t,a,s,c,d){switch(a){case"style":id(e,s,d);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(o(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"children":typeof s=="string"?rl(e,s):(typeof s=="number"||typeof s=="bigint")&&rl(e,""+s);break;case"onScroll":s!=null&&Re("scroll",e);break;case"onScrollEnd":s!=null&&Re("scrollend",e);break;case"onClick":s!=null&&(e.onclick=$n);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pu.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),d=e[Zt]||null,d=d!=null?d[a]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof s=="function")){typeof d!="function"&&d!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,s,c);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):Ks(e,a,s)}}}function Lt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",e),Re("load",e);var s=!1,c=!1,d;for(d in a)if(a.hasOwnProperty(d)){var b=a[d];if(b!=null)switch(d){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ke(e,t,d,b,a,null)}}c&&Ke(e,t,"srcSet",a.srcSet,a,null),s&&Ke(e,t,"src",a.src,a,null);return;case"input":Re("invalid",e);var N=d=b=c=null,D=null,Y=null;for(s in a)if(a.hasOwnProperty(s)){var ee=a[s];if(ee!=null)switch(s){case"name":c=ee;break;case"type":b=ee;break;case"checked":D=ee;break;case"defaultChecked":Y=ee;break;case"value":d=ee;break;case"defaultValue":N=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(o(137,t));break;default:Ke(e,t,s,ee,a,null)}}ad(e,d,N,D,Y,b,c,!1);return;case"select":Re("invalid",e),s=b=d=null;for(c in a)if(a.hasOwnProperty(c)&&(N=a[c],N!=null))switch(c){case"value":d=N;break;case"defaultValue":b=N;break;case"multiple":s=N;default:Ke(e,t,c,N,a,null)}t=d,a=b,e.multiple=!!s,t!=null?sl(e,!!s,t,!1):a!=null&&sl(e,!!s,a,!0);return;case"textarea":Re("invalid",e),d=c=s=null;for(b in a)if(a.hasOwnProperty(b)&&(N=a[b],N!=null))switch(b){case"value":s=N;break;case"defaultValue":c=N;break;case"children":d=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(o(91));break;default:Ke(e,t,b,N,a,null)}sd(e,s,c,d);return;case"option":for(D in a)if(a.hasOwnProperty(D)&&(s=a[D],s!=null))switch(D){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Ke(e,t,D,s,a,null)}return;case"dialog":Re("beforetoggle",e),Re("toggle",e),Re("cancel",e),Re("close",e);break;case"iframe":case"object":Re("load",e);break;case"video":case"audio":for(s=0;s<Cs.length;s++)Re(Cs[s],e);break;case"image":Re("error",e),Re("load",e);break;case"details":Re("toggle",e);break;case"embed":case"source":case"link":Re("error",e),Re("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in a)if(a.hasOwnProperty(Y)&&(s=a[Y],s!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ke(e,t,Y,s,a,null)}return;default:if(qi(t)){for(ee in a)a.hasOwnProperty(ee)&&(s=a[ee],s!==void 0&&Ac(e,t,ee,s,a,void 0));return}}for(N in a)a.hasOwnProperty(N)&&(s=a[N],s!=null&&Ke(e,t,N,s,a,null))}function lb(e,t,a,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,b=null,N=null,D=null,Y=null,ee=null;for(X in a){var se=a[X];if(a.hasOwnProperty(X)&&se!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":D=se;default:s.hasOwnProperty(X)||Ke(e,t,X,null,s,se)}}for(var Z in s){var X=s[Z];if(se=a[Z],s.hasOwnProperty(Z)&&(X!=null||se!=null))switch(Z){case"type":d=X;break;case"name":c=X;break;case"checked":Y=X;break;case"defaultChecked":ee=X;break;case"value":b=X;break;case"defaultValue":N=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(o(137,t));break;default:X!==se&&Ke(e,t,Z,X,s,se)}}Hi(e,b,N,D,Y,ee,d,c);return;case"select":X=b=N=Z=null;for(d in a)if(D=a[d],a.hasOwnProperty(d)&&D!=null)switch(d){case"value":break;case"multiple":X=D;default:s.hasOwnProperty(d)||Ke(e,t,d,null,s,D)}for(c in s)if(d=s[c],D=a[c],s.hasOwnProperty(c)&&(d!=null||D!=null))switch(c){case"value":Z=d;break;case"defaultValue":N=d;break;case"multiple":b=d;default:d!==D&&Ke(e,t,c,d,s,D)}t=N,a=b,s=X,Z!=null?sl(e,!!a,Z,!1):!!s!=!!a&&(t!=null?sl(e,!!a,t,!0):sl(e,!!a,a?[]:"",!1));return;case"textarea":X=Z=null;for(N in a)if(c=a[N],a.hasOwnProperty(N)&&c!=null&&!s.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Ke(e,t,N,null,s,c)}for(b in s)if(c=s[b],d=a[b],s.hasOwnProperty(b)&&(c!=null||d!=null))switch(b){case"value":Z=c;break;case"defaultValue":X=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==d&&Ke(e,t,b,c,s,d)}ld(e,Z,X);return;case"option":for(var ge in a)if(Z=a[ge],a.hasOwnProperty(ge)&&Z!=null&&!s.hasOwnProperty(ge))switch(ge){case"selected":e.selected=!1;break;default:Ke(e,t,ge,null,s,Z)}for(D in s)if(Z=s[D],X=a[D],s.hasOwnProperty(D)&&Z!==X&&(Z!=null||X!=null))switch(D){case"selected":e.selected=Z&&typeof Z!="function"&&typeof Z!="symbol";break;default:Ke(e,t,D,Z,s,X)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ne in a)Z=a[Ne],a.hasOwnProperty(Ne)&&Z!=null&&!s.hasOwnProperty(Ne)&&Ke(e,t,Ne,null,s,Z);for(Y in s)if(Z=s[Y],X=a[Y],s.hasOwnProperty(Y)&&Z!==X&&(Z!=null||X!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(o(137,t));break;default:Ke(e,t,Y,Z,s,X)}return;default:if(qi(t)){for(var Pe in a)Z=a[Pe],a.hasOwnProperty(Pe)&&Z!==void 0&&!s.hasOwnProperty(Pe)&&Ac(e,t,Pe,void 0,s,Z);for(ee in s)Z=s[ee],X=a[ee],!s.hasOwnProperty(ee)||Z===X||Z===void 0&&X===void 0||Ac(e,t,ee,Z,s,X);return}}for(var B in a)Z=a[B],a.hasOwnProperty(B)&&Z!=null&&!s.hasOwnProperty(B)&&Ke(e,t,B,null,s,Z);for(se in s)Z=s[se],X=a[se],!s.hasOwnProperty(se)||Z===X||Z==null&&X==null||Ke(e,t,se,Z,s,X)}function cp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function sb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),s=0;s<a.length;s++){var c=a[s],d=c.transferSize,b=c.initiatorType,N=c.duration;if(d&&N&&cp(b)){for(b=0,N=c.responseEnd,s+=1;s<a.length;s++){var D=a[s],Y=D.startTime;if(Y>N)break;var ee=D.transferSize,se=D.initiatorType;ee&&cp(se)&&(D=D.responseEnd,b+=ee*(D<N?1:(N-Y)/(D-Y)))}if(--s,t+=8*(d+b)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Rc=null,Mc=null;function Ir(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Dc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var _c=null;function rb(){var e=window.event;return e&&e.type==="popstate"?e===_c?!1:(_c=e,!0):(_c=null,!1)}var mp=typeof setTimeout=="function"?setTimeout:void 0,ib=typeof clearTimeout=="function"?clearTimeout:void 0,fp=typeof Promise=="function"?Promise:void 0,ob=typeof queueMicrotask=="function"?queueMicrotask:typeof fp<"u"?function(e){return fp.resolve(null).then(e).catch(cb)}:mp;function cb(e){setTimeout(function(){throw e})}function wa(e){return e==="head"}function pp(e,t){var a=t,s=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(s===0){e.removeChild(c),Bl(t);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")Es(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Es(a);for(var d=a.firstChild;d;){var b=d.nextSibling,N=d.nodeName;d[Vl]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&d.rel.toLowerCase()==="stylesheet"||a.removeChild(d),d=b}}else a==="body"&&Es(e.ownerDocument.body);a=c}while(a);Bl(t)}function hp(e,t){var a=e;e=0;do{var s=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),s&&s.nodeType===8)if(a=s.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=s}while(a)}function Oc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Oc(a),$i(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function ub(e,t,a,s){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Vl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=gn(e.nextSibling),e===null)break}return null}function db(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=gn(e.nextSibling),e===null))return null;return e}function xp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=gn(e.nextSibling),e===null))return null;return e}function Lc(e){return e.data==="$?"||e.data==="$~"}function zc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function mb(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var s=function(){t(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function gn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Bc=null;function gp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return gn(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function bp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function yp(e,t,a){switch(t=Ir(a),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Es(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);$i(e)}var bn=new Map,vp=new Set;function Jr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ea=z.d;z.d={f:fb,r:pb,D:hb,C:xb,L:gb,m:bb,X:vb,S:yb,M:jb};function fb(){var e=ea.f(),t=Gr();return e||t}function pb(e){var t=nl(e);t!==null&&t.tag===5&&t.type==="form"?zm(t):ea.r(e)}var Ol=typeof document>"u"?null:document;function jp(e,t,a){var s=Ol;if(s&&typeof t=="string"&&t){var c=un(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),vp.has(c)||(vp.add(c),e={rel:e,crossOrigin:a,href:t},s.querySelector(c)===null&&(t=s.createElement("link"),Lt(t,"link",e),Et(t),s.head.appendChild(t)))}}function hb(e){ea.D(e),jp("dns-prefetch",e,null)}function xb(e,t){ea.C(e,t),jp("preconnect",e,t)}function gb(e,t,a){ea.L(e,t,a);var s=Ol;if(s&&e&&t){var c='link[rel="preload"][as="'+un(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+un(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+un(a.imageSizes)+'"]')):c+='[href="'+un(e)+'"]';var d=c;switch(t){case"style":d=Ll(e);break;case"script":d=zl(e)}bn.has(d)||(e=v({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),bn.set(d,e),s.querySelector(c)!==null||t==="style"&&s.querySelector(As(d))||t==="script"&&s.querySelector(Rs(d))||(t=s.createElement("link"),Lt(t,"link",e),Et(t),s.head.appendChild(t)))}}function bb(e,t){ea.m(e,t);var a=Ol;if(a&&e){var s=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+un(s)+'"][href="'+un(e)+'"]',d=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=zl(e)}if(!bn.has(d)&&(e=v({rel:"modulepreload",href:e},t),bn.set(d,e),a.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Rs(d)))return}s=a.createElement("link"),Lt(s,"link",e),Et(s),a.head.appendChild(s)}}}function yb(e,t,a){ea.S(e,t,a);var s=Ol;if(s&&e){var c=al(s).hoistableStyles,d=Ll(e);t=t||"default";var b=c.get(d);if(!b){var N={loading:0,preload:null};if(b=s.querySelector(As(d)))N.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},a),(a=bn.get(d))&&$c(e,a);var D=b=s.createElement("link");Et(D),Lt(D,"link",e),D._p=new Promise(function(Y,ee){D.onload=Y,D.onerror=ee}),D.addEventListener("load",function(){N.loading|=1}),D.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Kr(b,t,s)}b={type:"stylesheet",instance:b,count:1,state:N},c.set(d,b)}}}function vb(e,t){ea.X(e,t);var a=Ol;if(a&&e){var s=al(a).hoistableScripts,c=zl(e),d=s.get(c);d||(d=a.querySelector(Rs(c)),d||(e=v({src:e,async:!0},t),(t=bn.get(c))&&Uc(e,t),d=a.createElement("script"),Et(d),Lt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function jb(e,t){ea.M(e,t);var a=Ol;if(a&&e){var s=al(a).hoistableScripts,c=zl(e),d=s.get(c);d||(d=a.querySelector(Rs(c)),d||(e=v({src:e,async:!0,type:"module"},t),(t=bn.get(c))&&Uc(e,t),d=a.createElement("script"),Et(d),Lt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function wp(e,t,a,s){var c=(c=he.current)?Jr(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Ll(a.href),a=al(c).hoistableStyles,s=a.get(t),s||(s={type:"style",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Ll(a.href);var d=al(c).hoistableStyles,b=d.get(e);if(b||(c=c.ownerDocument||c,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,b),(d=c.querySelector(As(e)))&&!d._p&&(b.instance=d,b.state.loading=5),bn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},bn.set(e,a),d||wb(c,e,a,b.state))),t&&s===null)throw Error(o(528,""));return b}if(t&&s!==null)throw Error(o(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=zl(a),a=al(c).hoistableScripts,s=a.get(t),s||(s={type:"script",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Ll(e){return'href="'+un(e)+'"'}function As(e){return'link[rel="stylesheet"]['+e+"]"}function Np(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function wb(e,t,a,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Lt(t,"link",a),Et(t),e.head.appendChild(t))}function zl(e){return'[src="'+un(e)+'"]'}function Rs(e){return"script[async]"+e}function Sp(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+un(a.href)+'"]');if(s)return t.instance=s,Et(s),s;var c=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Et(s),Lt(s,"style",c),Kr(s,a.precedence,e),t.instance=s;case"stylesheet":c=Ll(a.href);var d=e.querySelector(As(c));if(d)return t.state.loading|=4,t.instance=d,Et(d),d;s=Np(a),(c=bn.get(c))&&$c(s,c),d=(e.ownerDocument||e).createElement("link"),Et(d);var b=d;return b._p=new Promise(function(N,D){b.onload=N,b.onerror=D}),Lt(d,"link",s),t.state.loading|=4,Kr(d,a.precedence,e),t.instance=d;case"script":return d=zl(a.src),(c=e.querySelector(Rs(d)))?(t.instance=c,Et(c),c):(s=a,(c=bn.get(d))&&(s=v({},a),Uc(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),Et(c),Lt(c,"link",s),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Kr(s,a.precedence,e));return t.instance}function Kr(e,t,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,d=c,b=0;b<s.length;b++){var N=s[b];if(N.dataset.precedence===t)d=N;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function $c(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Uc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Pr=null;function kp(e,t,a){if(Pr===null){var s=new Map,c=Pr=new Map;c.set(a,s)}else c=Pr,s=c.get(a),s||(s=new Map,c.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var d=a[c];if(!(d[Vl]||d[Mt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var b=d.getAttribute(t)||"";b=e+b;var N=s.get(b);N?N.push(d):s.set(b,[d])}}return s}function Cp(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Nb(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Tp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Sb(e,t,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=Ll(s.href),d=t.querySelector(As(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Wr.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=d,Et(d);return}d=t.ownerDocument||t,s=Np(s),(c=bn.get(c))&&$c(s,c),d=d.createElement("link"),Et(d);var b=d;b._p=new Promise(function(N,D){b.onload=N,b.onerror=D}),Lt(d,"link",s),a.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Wr.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Hc=0;function kb(e,t){return e.stylesheets&&e.count===0&&ti(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var s=setTimeout(function(){if(e.stylesheets&&ti(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Hc===0&&(Hc=62500*sb());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ti(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Hc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(c)}}:null}function Wr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ti(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ei=null;function ti(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ei=new Map,t.forEach(Cb,e),ei=null,Wr.call(e))}function Cb(e,t){if(!(t.state.loading&4)){var a=ei.get(e);if(a)var s=a.get(null);else{a=new Map,ei.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var b=c[d];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(a.set(b.dataset.precedence,b),s=b)}s&&a.set(null,s)}c=t.instance,b=c.getAttribute("data-precedence"),d=a.get(b)||s,d===s&&a.set(null,c),a.set(b,c),this.count++,s=Wr.bind(this),c.addEventListener("load",s),c.addEventListener("error",s),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var Ms={$$typeof:A,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function Tb(e,t,a,s,c,d,b,N,D){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=on(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=on(0),this.hiddenUpdates=on(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Ep(e,t,a,s,c,d,b,N,D,Y,ee,se){return e=new Tb(e,t,a,b,D,Y,ee,se,N),t=1,d===!0&&(t|=24),d=Wt(3,null,null,t),e.current=d,d.stateNode=e,t=yo(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:s,isDehydrated:a,cache:t},No(d),e}function Ap(e){return e?(e=fl,e):fl}function Rp(e,t,a,s,c,d){c=Ap(c),s.context===null?s.context=c:s.pendingContext=c,s=da(t),s.payload={element:a},d=d===void 0?null:d,d!==null&&(s.callback=d),a=ma(e,s,t),a!==null&&(Kt(a,e,t),cs(a,e,t))}function Mp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Gc(e,t){Mp(e,t),(e=e.alternate)&&Mp(e,t)}function Dp(e){if(e.tag===13||e.tag===31){var t=Oa(e,67108864);t!==null&&Kt(t,e,67108864),Gc(e,67108864)}}function _p(e){if(e.tag===13||e.tag===31){var t=ln();t=Li(t);var a=Oa(e,t);a!==null&&Kt(a,e,t),Gc(e,t)}}var ni=!0;function Eb(e,t,a,s){var c=U.T;U.T=null;var d=z.p;try{z.p=2,qc(e,t,a,s)}finally{z.p=d,U.T=c}}function Ab(e,t,a,s){var c=U.T;U.T=null;var d=z.p;try{z.p=8,qc(e,t,a,s)}finally{z.p=d,U.T=c}}function qc(e,t,a,s){if(ni){var c=Yc(s);if(c===null)Ec(e,t,s,ai,a),Lp(e,s);else if(Mb(c,e,t,a,s))s.stopPropagation();else if(Lp(e,s),t&4&&-1<Rb.indexOf(e)){for(;c!==null;){var d=nl(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var b=ie(d.pendingLanes);if(b!==0){var N=d;for(N.pendingLanes|=2,N.entangledLanes|=2;b;){var D=1<<31-tt(b);N.entanglements[1]|=D,b&=~D}Rn(d),(Ve&6)===0&&(Ur=Ze()+500,ks(0))}}break;case 31:case 13:N=Oa(d,2),N!==null&&Kt(N,d,2),Gr(),Gc(d,2)}if(d=Yc(s),d===null&&Ec(e,t,s,ai,a),d===c)break;c=d}c!==null&&s.stopPropagation()}else Ec(e,t,s,null,a)}}function Yc(e){return e=Fi(e),Fc(e)}var ai=null;function Fc(e){if(ai=null,e=tl(e),e!==null){var t=m(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=p(t),e!==null)return e;e=null}else if(a===31){if(e=g(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ai=e,null}function Op(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(I()){case we:return 2;case ve:return 8;case ce:case fe:return 32;case _e:return 268435456;default:return 32}default:return 32}}var Zc=!1,Na=null,Sa=null,ka=null,Ds=new Map,_s=new Map,Ca=[],Rb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Lp(e,t){switch(e){case"focusin":case"focusout":Na=null;break;case"dragenter":case"dragleave":Sa=null;break;case"mouseover":case"mouseout":ka=null;break;case"pointerover":case"pointerout":Ds.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_s.delete(t.pointerId)}}function Os(e,t,a,s,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:a,eventSystemFlags:s,nativeEvent:d,targetContainers:[c]},t!==null&&(t=nl(t),t!==null&&Dp(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Mb(e,t,a,s,c){switch(t){case"focusin":return Na=Os(Na,e,t,a,s,c),!0;case"dragenter":return Sa=Os(Sa,e,t,a,s,c),!0;case"mouseover":return ka=Os(ka,e,t,a,s,c),!0;case"pointerover":var d=c.pointerId;return Ds.set(d,Os(Ds.get(d)||null,e,t,a,s,c)),!0;case"gotpointercapture":return d=c.pointerId,_s.set(d,Os(_s.get(d)||null,e,t,a,s,c)),!0}return!1}function zp(e){var t=tl(e.target);if(t!==null){var a=m(t);if(a!==null){if(t=a.tag,t===13){if(t=p(a),t!==null){e.blockedOn=t,Iu(e.priority,function(){_p(a)});return}}else if(t===31){if(t=g(a),t!==null){e.blockedOn=t,Iu(e.priority,function(){_p(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function li(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Yc(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);Yi=s,a.target.dispatchEvent(s),Yi=null}else return t=nl(a),t!==null&&Dp(t),e.blockedOn=a,!1;t.shift()}return!0}function Bp(e,t,a){li(e)&&a.delete(t)}function Db(){Zc=!1,Na!==null&&li(Na)&&(Na=null),Sa!==null&&li(Sa)&&(Sa=null),ka!==null&&li(ka)&&(ka=null),Ds.forEach(Bp),_s.forEach(Bp)}function si(e,t){e.blockedOn===t&&(e.blockedOn=null,Zc||(Zc=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,Db)))}var ri=null;function $p(e){ri!==e&&(ri=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){ri===e&&(ri=null);for(var t=0;t<e.length;t+=3){var a=e[t],s=e[t+1],c=e[t+2];if(typeof s!="function"){if(Fc(s||a)===null)continue;break}var d=nl(a);d!==null&&(e.splice(t,3),t-=3,Yo(d,{pending:!0,data:c,method:a.method,action:s},s,c))}}))}function Bl(e){function t(D){return si(D,e)}Na!==null&&si(Na,e),Sa!==null&&si(Sa,e),ka!==null&&si(ka,e),Ds.forEach(t),_s.forEach(t);for(var a=0;a<Ca.length;a++){var s=Ca[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Ca.length&&(a=Ca[0],a.blockedOn===null);)zp(a),a.blockedOn===null&&Ca.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var c=a[s],d=a[s+1],b=c[Zt]||null;if(typeof d=="function")b||$p(a);else if(b){var N=null;if(d&&d.hasAttribute("formAction")){if(c=d,b=d[Zt]||null)N=b.formAction;else if(Fc(c)!==null)continue}else N=b.action;typeof N=="function"?a[s+1]=N:(a.splice(s,3),s-=3),$p(a)}}}function Up(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(b){return c=b})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),s||setTimeout(a,20)}function a(){if(!s&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Vc(e){this._internalRoot=e}ii.prototype.render=Vc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var a=t.current,s=ln();Rp(a,s,e,t,null,null)},ii.prototype.unmount=Vc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Rp(e.current,2,null,e,null,null),Gr(),t[el]=null}};function ii(e){this._internalRoot=e}ii.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xu();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Ca.length&&t!==0&&t<Ca[a].priority;a++);Ca.splice(a,0,e),a===0&&zp(e)}};var Hp=r.version;if(Hp!=="19.2.4")throw Error(o(527,Hp,"19.2.4"));z.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=x(t),e=e!==null?h(e):null,e=e===null?null:e.stateNode,e};var _b={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var oi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oi.isDisabled&&oi.supportsFiber)try{et=oi.inject(_b),Oe=oi}catch{}}return zs.createRoot=function(e,t){if(!u(e))throw Error(o(299));var a=!1,s="",c=Vm,d=Qm,b=Xm;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=Ep(e,1,!1,null,null,a,s,null,c,d,b,Up),e[el]=t.current,Tc(e),new Vc(t)},zs.hydrateRoot=function(e,t,a){if(!u(e))throw Error(o(299));var s=!1,c="",d=Vm,b=Qm,N=Xm,D=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(N=a.onRecoverableError),a.formState!==void 0&&(D=a.formState)),t=Ep(e,1,!0,t,a??null,s,c,D,d,b,N,Up),t.context=Ap(null),a=t.current,s=ln(),s=Li(s),c=da(s),c.callback=null,ma(a,c,s),a=s,t.current.lanes=a,Rt(t,a),Rn(t),e[el]=t.current,Tc(e),new ii(t)},zs.version="19.2.4",zs}var Jp;function Yb(){if(Jp)return Ic.exports;Jp=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(r){console.error(r)}}return l(),Ic.exports=qb(),Ic.exports}var Fb=Yb();const Zb=Rh(Fb);function Au(l,r,i=!0){y.useEffect(()=>{if(!i)return;const o=u=>{l.current&&!l.current.contains(u.target)&&r()};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[i,r,l])}const du=300*1e3;function Aa(l){if(!l||typeof l!="object")return null;const r=l;return Array.isArray(r.sessions)?{sessions:r.sessions,cachedAt:typeof r.cachedAt=="string"?r.cachedAt:void 0}:null}function Xs(l,r=du){if(!l)return!1;const i=Date.now()-new Date(l).getTime();return Number.isFinite(i)&&i>=0&&i<r}function pi(l){if(!l)return"just now";const r=Date.now()-new Date(l).getTime();if(!Number.isFinite(r)||r<0)return"just now";const i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function Ru(l,r=Date.now()){if(!l)return"";const i=r-new Date(l).getTime();if(!Number.isFinite(i)||i<0)return"0m";const o=Math.floor(i/6e4);if(o<60)return`${o}m`;const u=Math.floor(o/60);return u<24?`${u}h`:`${Math.floor(u/24)}d`}function hi(l){return new Date(l).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}function Dh(l){return l?`$${l.toFixed(2)}`:""}function Ci(l){if(!l)return"";const r=l.match(/claude-(\d+)-(\d+)-(opus|sonnet|haiku)(?:-\d{8})?/i);if(r)return`${r[3].charAt(0).toUpperCase()+r[3].slice(1).toLowerCase()} ${r[1]}.${r[2]}`;const i=l.match(/claude-(?:(opus|sonnet|haiku)-)?((?:\d+)(?:[.-](?!\d{8})\d+)*)(?:-\d{8})?(?:-(opus|sonnet|haiku))?(?:$|\b)/i);if(i){const u=(i[1]||i[3]||"").toLowerCase(),m=i[2].replace(/-/g,"."),p=u.charAt(0).toUpperCase()+u.slice(1);return p?`${p} ${m}`:`Claude ${m}`}const o=l.split(/[-/]/);return o.length>1?o.slice(0,2).join("-"):l}function Mu(l){if(l===0)return"0m";const r=Math.floor(l/6e4);if(r<60)return`${r}m`;const i=Math.floor(r/60),o=r%60;if(i<24)return o>0?`${i}h ${o}m`:`${i}h`;const u=Math.floor(i/24),m=i%24;return m>0?`${u}d ${m}h`:`${u}d`}function xi(l){const r=Math.round(l/1024);return r>=1024?`${(r/1024).toFixed(1)}MB`:`${r}KB`}function ql(l){const r=Date.now()-new Date(l).getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const u=Math.floor(o/24);return u<30?`${u}d ago`:hi(l)}function na(l){const r=Ou(l);if(r)return r;const i=l.replace(/\/$/,"").split("/");return i[i.length-1]||l}const Du=120;function kt(l){return(l||"").replace(/\s+/g," ").trim().slice(0,Du)}function Vb(l){return l.startsWith("[Request interrupted by user")||l.startsWith("<command-name>")||l.startsWith("<command-message>")||l.startsWith("<local-command-caveat>")||l.startsWith("<local-command-stdout>")||l.startsWith("<task-notification>")||l.startsWith("<bash-input>")||l.startsWith("<bash-stdout>")}function Qb(l){return l.split(`
|
|
57
57
|
`).filter(o=>{const u=o.trim();return u?!(/^Last login:/i.test(u)||/^(?:➜|❯)\s+/.test(u)||/^github(?:\.com|\.rbx\.com)?$/i.test(u)||/^[✓✔]/.test(u)||/^-\s+(?:Active account|Git operations protocol|Token|Token scopes):/i.test(u)||/^(?:credential|init|user|filter|alias|core|remote|branch)\.[^=]+=/i.test(u)||/^branch\.[^.]+\./i.test(u)):!0}).join(`
|
|
58
|
-
`).trim()}function
|
|
58
|
+
`).trim()}function Xb(l){const i=[...l.split(`
|
|
59
59
|
`)],o=/^\S.*\[\d{1,2}:\d{2}\s?(?:AM|PM)\]$/i.test(i[0]||"");return o&&i.shift(),o&&/^(?:hello|hi)\b/i.test((i[0]||"").trim())&&i.shift(),i.join(`
|
|
60
|
-
`).trim()}function
|
|
61
|
-
`).map(
|
|
62
|
-
`),className:"shrink-0"}),a.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer truncate hidden sm:inline",children:F})]}),a.jsxs("button",{onClick:()=>o(P=>!P),className:`flex items-center gap-1.5 text-xs font-mono tabular-nums shrink-0 hover:text-terminal-text transition-colors ${x}`,children:[j," session",j!==1?"s":"",a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:`transition-transform duration-200 ${i?"rotate-180":""}`,children:a.jsx("path",{d:"M3 4.5l3 3 3-3"})})]})]}),a.jsxs("div",{className:"flex items-center gap-4 flex-wrap text-xs font-mono",children:[a.jsxs("span",{className:"text-terminal-blue tabular-nums",children:[jt(T),a.jsx("span",{className:"text-terminal-dimmer ml-1 text-[10px]",children:"duration"})]}),v>0&&a.jsxs("span",{className:"text-terminal-orange tabular-nums",children:["$",v.toFixed(2),a.jsx("span",{className:"text-terminal-dimmer ml-1 text-[10px]",children:"cost"})]}),a.jsxs("span",{className:"text-terminal-green tabular-nums",children:[Xc(N),a.jsx("span",{className:"text-terminal-dimmer ml-1 text-[10px]",children:"prompts"})]}),a.jsxs("span",{className:"text-terminal-text tabular-nums",children:[Xc(S),a.jsx("span",{className:"text-terminal-dimmer ml-1 text-[10px]",children:"tools"})]}),k>0&&a.jsxs("span",{className:"text-terminal-purple tabular-nums",children:[Xc(k),a.jsx("span",{className:"text-terminal-dimmer ml-1 text-[10px]",children:"edits"})]}),a.jsxs("span",{className:"text-terminal-dimmer text-[10px] tabular-nums hidden lg:inline",children:["avg ",jt(M),"/session"]}),a.jsx("div",{className:"flex-1 flex justify-end",children:a.jsx("div",{className:"flex items-end gap-px h-3.5",children:(()=>{const P=new Date,de=new Date(P);de.setDate(de.getDate()-29);const ce=[],pe=new Date(de);for(;pe<=P;){const L=pe.toISOString().slice(0,10);ce.push({day:L,count:A[L]||0}),pe.setDate(pe.getDate()+1)}const H=Math.max(...ce.map(L=>L.count),1);return ce.map(L=>a.jsx("div",{title:`${L.day}: ${L.count}`,className:`w-1 rounded-sm ${L.count>0?f:"bg-terminal-surface-2"}`,style:{height:L.count>0?`${Math.max(15,L.count/H*100)}%`:"2px",opacity:L.count>0?.35+L.count/H*.65:.15}},L.day))})()})})]}),i&&g&&a.jsxs("div",{className:"mt-3 pt-3 border-t border-terminal-border-subtle space-y-3",children:[g.branches.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5",children:["Branches (",g.branches.length,")"]}),a.jsx("div",{className:"space-y-0.5 max-h-32 overflow-y-auto",children:g.branches.slice(0,15).map(P=>a.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[a.jsx("span",{className:"font-mono text-terminal-purple truncate",children:P.branch}),a.jsxs("span",{className:"text-terminal-dimmer tabular-nums shrink-0",children:[P.sessionIds.length,"x"]}),P.prLinks?.map(de=>a.jsxs("a",{href:de.prUrl,target:"_blank",rel:"noopener noreferrer",className:"text-terminal-blue hover:underline shrink-0",children:["#",de.prNumber]},de.prUrl))]},P.branch))})]}),g.hotFiles.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5",children:"Most modified files"}),a.jsx("div",{className:"space-y-0.5 max-h-28 overflow-y-auto",children:g.hotFiles.slice(0,10).map(P=>a.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[a.jsx("span",{className:"font-mono text-terminal-dim truncate flex-1",children:P.file}),a.jsxs("span",{className:"text-terminal-dimmer tabular-nums shrink-0",children:[P.editCount,"x / ",P.sessionCount,"s"]})]},P.file))})]}),me,I,g.memory&&g.memory.memoryFiles.length>0&&a.jsxs("div",{children:[a.jsxs("button",{onClick:()=>m(P=>!P),className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5 flex items-center gap-1 hover:text-terminal-dim transition-colors",children:[a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:`transition-transform duration-200 ${u?"rotate-90":""}`,children:a.jsx("path",{d:"M4.5 2l4 4-4 4"})}),"Memory (",g.memory.memoryFiles.length," files)"]}),u&&a.jsx("div",{className:"space-y-1.5 max-h-48 overflow-y-auto",children:g.memory.memoryFiles.map(P=>a.jsxs("div",{className:"bg-terminal-surface-2 rounded-lg px-3 py-2 text-xs",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:"font-mono text-terminal-text font-medium",children:P.name}),P.type&&a.jsx("span",{className:"px-1.5 py-0.5 rounded bg-terminal-surface text-terminal-dimmer text-[10px]",children:P.type})]}),P.description&&a.jsx("div",{className:"text-terminal-dim text-[11px] mb-1",children:P.description}),a.jsx("div",{className:"font-mono text-terminal-dimmer whitespace-pre-wrap line-clamp-3 text-[11px] leading-relaxed",children:P.content})]},P.name))})]})]}),i&&b&&a.jsxs("div",{className:"mt-3 pt-3 border-t border-terminal-border-subtle space-y-3",children:[b.topProjects.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5",children:"Top projects"}),a.jsx("div",{className:"space-y-1",children:b.topProjects.slice(0,8).map(P=>{const de=P.project.split("/").pop()||P.project;return a.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[a.jsx("span",{className:"font-mono text-terminal-text truncate flex-1",title:P.project,children:de}),a.jsxs("span",{className:"text-terminal-dimmer tabular-nums shrink-0",children:[P.sessions,"s"]}),P.durationMs>0&&a.jsx("span",{className:"text-terminal-blue tabular-nums shrink-0",children:jt(P.durationMs)}),a.jsxs("span",{className:"text-terminal-green tabular-nums shrink-0",children:[P.prompts,"p"]}),P.edits>0&&a.jsxs("span",{className:"text-terminal-purple tabular-nums shrink-0",children:[P.edits,"e"]}),P.prCount>0&&a.jsxs("span",{className:"text-terminal-blue tabular-nums shrink-0",children:[P.prCount,"pr"]}),P.cost>0&&a.jsxs("span",{className:"text-terminal-orange tabular-nums shrink-0",children:["$",P.cost.toFixed(2)]})]},P.project)})})]}),me,I]})]})}function Xc(l){return l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:String(l)}function Yb(l){if(l===0)return"0m";const r=Math.floor(l/6e4);if(r<60)return`${r}m`;const i=Math.floor(r/60),o=r%60;if(i<24)return o>0?`${i}h ${o}m`:`${i}h`;const u=Math.floor(i/24),m=i%24;return m>0?`${u}d ${m}h`:`${u}d`}function Fb(){const[l,r]=y.useState([]),[i,o]=y.useState([]),[u,m]=y.useState(!0),[p,x]=y.useState(!0),[f,g]=y.useState(!0),[b,j]=y.useState(null),[T,v]=y.useState(null),[N,S]=y.useState(null),k=y.useRef(!1),E=y.useMemo(()=>l.some(A=>A.provider==="cursor"),[l]),M=y.useCallback(async()=>{m(!0),x(!0),g(!0),j(null);try{const[A,_]=await Promise.all([fetch("/api/sources/cached").then($=>$.ok?$.json():null).catch(()=>null),fetch("/api/sessions/cached").then($=>$.ok?$.json():null).catch(()=>null)]),z=Al(A),B=Al(_);z?.sessions.length&&r(z.sessions),B?.sessions.length&&o(B.sessions),(z?.sessions.length||B?.sessions.length)&&m(!1);const F=ai(z?.cachedAt),ee=ai(B?.cachedAt),me=[];F&&x(!1),ee&&g(!1),F||me.push(new Promise($=>{v(0);const I=new EventSource("/api/sources/stream");I.onmessage=P=>{try{const de=JSON.parse(P.data);de.type==="progress"?v(de.scanned):de.type==="complete"?(r(de.sessions),v(null),I.close(),$()):de.type==="error"&&(z?.sessions.length||j(de.message||"Failed to load sessions"),v(null),I.close(),$())}catch{}},I.onerror=()=>{I.close(),v(null),fetch("/api/sources").then(P=>{if(!P.ok)throw new Error("Failed to load sources");return P.json()}).then(P=>r(P.sessions)).catch(P=>{z?.sessions.length||j(P instanceof Error?P.message:"Failed to load sessions")}).finally(()=>$())}}).finally(()=>x(!1))),ee||me.push(fetch("/api/sessions").then($=>{if(!$.ok)throw new Error("Failed to load replays");return $.json()}).then($=>o($)).catch($=>{B?.sessions.length||j($ instanceof Error?$.message:"Failed to load replays")}).finally(()=>g(!1))),me.length>0&&await Promise.allSettled(me)}catch(A){j(A instanceof Error?A.message:"Failed to load data")}finally{m(!1)}},[]);return y.useEffect(()=>{M()},[M]),y.useEffect(()=>{if(!p&&!E&&!k.current)return;let A=!1,_;const z=async()=>{const F=await fetch("/api/sources/cached").then(me=>me.ok?me.json():null).catch(()=>null),ee=Al(F);!A&&ee?.sessions.length&&r(ee.sessions)},B=async()=>{const F=await fetch("/api/sources/enrichment-status").then(ee=>ee.ok?ee.json():null).catch(()=>null);!F||A||(S(F),F.running?(k.current=!0,await z()):k.current&&(k.current=!1,await z()))};return B(),_=window.setInterval(()=>{B()},2500),()=>{A=!0,_&&window.clearInterval(_)}},[E,p]),{sources:l,setSources:r,replays:i,loading:u,loadingSources:p,loadingReplays:f,error:b,scanProgress:T,enrichmentStatus:N}}function Zb(l,r){let i=0,o=0,u=0;const m=new Map(l.map(E=>[E.slug,E]));for(const E of l)i+=E.promptCount??(E.prompts?.length||(E.firstPrompt?1:0)),o+=E.toolCallCount??0;for(const E of r){const M=m.get(E.slug),A=E.stats.toolCalls||0;M?M.toolCallCount==null?o+=A:A>M.toolCallCount&&(o+=A-M.toolCallCount):(i+=E.stats.userPrompts||0,o+=A),u+=E.stats.durationMs||0}const p=new Map;for(const E of l)p.set(E.provider,(p.get(E.provider)||0)+1);const x={"claude-code":"Claude Code",cursor:"Cursor"},f=[...p.entries()].map(([E,M])=>({provider:E,count:M,label:x[E]||E})).sort((E,M)=>M.count-E.count),g=new Set;for(const E of l)g.add(E.project);for(const E of r)g.add(E.project);const b=new Date,j=864e5,T=[];for(let E=29;E>=0;E--){const M=new Date(b.getTime()-E*j);M.setHours(0,0,0,0);const A=new Date(M.getTime()+j),_=M.toISOString().slice(0,10),z=M.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"});let B=0,F=0;for(const ee of l){const me=new Date(ee.timestamp);me>=M&&me<A&&(ee.provider==="cursor"?F++:B++)}T.push({date:_,label:z,claude:B,cursor:F})}const v=l.length,N=r.length,S=l.filter(E=>E.existingReplay).length,k=v>0?S/v*100:0;return{totalSessions:v,totalReplays:N,totalPrompts:i,totalToolCalls:o,totalDuration:u,providerBreakdown:f,projectCount:g.size,activityByDay:T,recentSources:[...l].sort((E,M)=>M.timestamp.localeCompare(E.timestamp)).slice(0,5),recentReplays:[...r].sort((E,M)=>M.startTime.localeCompare(E.startTime)).slice(0,5),publishedCount:r.filter(E=>E.gist?.gistId).length,replayConversionPct:k}}function Kr({label:l,value:r,sub:i,color:o="green",icon:u}){const m={green:"text-terminal-green",blue:"text-terminal-blue",orange:"text-terminal-orange",purple:"text-terminal-purple"},p={green:"bg-terminal-green/10",blue:"bg-terminal-blue/10",orange:"bg-terminal-orange/10",purple:"bg-terminal-purple/10"},x={green:"from-terminal-green/20 to-terminal-blue/10",blue:"from-terminal-blue/20 to-terminal-cyan/10",orange:"from-terminal-orange/20 to-terminal-red/10",purple:"from-terminal-purple/20 to-terminal-blue/10"};return a.jsxs("div",{className:"premium-card bg-terminal-surface rounded-xl p-5 shadow-layer-sm hover:bg-terminal-surface-hover transition-all duration-300 hover-lift group",children:[a.jsxs("div",{className:"flex items-start justify-between relative z-10",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("p",{className:"text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest opacity-80 group-hover:opacity-100 transition-opacity",children:l}),a.jsx("p",{className:`text-3xl font-mono font-bold tabular-nums tracking-tight ${m[o]}`,children:r}),i&&a.jsxs("p",{className:"text-[11px] font-mono text-terminal-dimmer flex items-center gap-1.5",children:[a.jsx("span",{className:`w-1 h-1 rounded-full ${m[o]} opacity-50`}),i]})]}),a.jsx("div",{className:`w-11 h-11 rounded-xl flex items-center justify-center ${p[o]} border border-white/5 shadow-inner transition-transform duration-300 group-hover:scale-110 group-hover:rotate-3`,children:u})]}),a.jsx("div",{className:`absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-500 bg-gradient-to-br ${x[o]} blur-2xl -z-10 pointer-events-none`})]})}function Xb(){return a.jsx("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm space-y-3",children:a.jsxs("div",{className:"flex justify-between",children:[a.jsxs("div",{className:"space-y-2 flex-1",children:[a.jsx("div",{className:"h-3 w-20 skeleton opacity-40"}),a.jsx("div",{className:"h-8 w-24 skeleton opacity-60"}),a.jsx("div",{className:"h-3 w-32 skeleton opacity-30"})]}),a.jsx("div",{className:"w-11 h-11 rounded-xl skeleton opacity-20"})]})})}function Qb(){return a.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm animate-pulse",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("div",{className:"h-3 w-28 skeleton rounded"}),a.jsx("div",{className:"h-3 w-14 skeleton rounded opacity-40"})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:Array.from({length:5},(l,r)=>a.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 rounded-lg bg-terminal-bg",children:[a.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[a.jsx("div",{className:"h-3.5 w-24 max-w-[70%] skeleton rounded"}),a.jsx("div",{className:"h-3 w-36 max-w-full skeleton rounded opacity-40"})]}),a.jsx("div",{className:"h-3 w-10 shrink-0 skeleton rounded opacity-30"})]},r))}),a.jsx("div",{className:"h-9 mt-2 rounded-lg bg-terminal-surface-2 skeleton opacity-20"})]})}function Vb({data:l}){const r=Math.max(...l.map(u=>u.claude+u.cursor),1),i=l.some(u=>u.claude>0||u.cursor>0),o=y.useMemo(()=>{const u=[];let m=-1;for(let p=0;p<l.length;p++){const x=new Date(l[p].date),f=x.getMonth();f!==m?(u.push({index:p,label:x.toLocaleDateString("en-US",{month:"short",day:"numeric"})}),m=f):x.getDay()===1&&p>0&&u.push({index:p,label:`${x.getDate()}`})}return u},[l]);return i?a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsx("div",{className:"flex-1 flex items-stretch gap-px min-h-0",children:l.map(u=>{const m=u.claude+u.cursor,p=Math.max(m/r*100,m>0?4:0),x=m>0?u.claude/m*100:0,f=u.date===new Date().toISOString().slice(0,10);return a.jsxs("div",{className:"flex-1 flex flex-col justify-end h-full group relative",title:`${u.label}: ${u.claude} Claude, ${u.cursor} Cursor`,children:[a.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 hidden group-hover:block z-10",children:a.jsxs("div",{className:"bg-terminal-surface-2 border border-terminal-border-subtle rounded-lg px-2.5 py-1.5 shadow-layer-md whitespace-nowrap",children:[a.jsx("div",{className:"text-[10px] font-mono text-terminal-dim",children:u.label}),u.claude>0&&a.jsxs("div",{className:"text-[10px] font-mono text-terminal-orange",children:[u.claude," Claude"]}),u.cursor>0&&a.jsxs("div",{className:"text-[10px] font-mono text-terminal-blue",children:[u.cursor," Cursor"]})]})}),a.jsx("div",{className:`rounded-sm transition-all duration-200 ${f?"ring-1 ring-terminal-orange/30":""} ${m>0?"hover:opacity-80":""}`,style:{height:`${p}%`,minHeight:m>0?"4px":"0",background:m>0?`linear-gradient(to top, var(--orange) ${x}%, var(--blue) ${x}%)`:"transparent",opacity:m>0?.8:.05,boxShadow:m>0?`0 0 10px ${u.claude>u.cursor?"var(--orange-subtle)":"var(--blue-subtle)"}`:"none"}})]},u.date)})}),a.jsx("div",{className:"flex items-center mt-1.5 relative h-4",children:o.map(u=>a.jsx("span",{className:"absolute text-[9px] font-mono text-terminal-dimmer",style:{left:`${u.index/l.length*100}%`},children:u.label},u.index))})]}):a.jsx("div",{className:"flex items-center justify-center h-full text-terminal-dimmer text-xs font-mono",children:"No activity in the last 30 days"})}function Ib({breakdown:l}){const r=l.reduce((o,u)=>o+u.count,0),i={"claude-code":{bar:"bg-terminal-orange",text:"text-terminal-orange"},cursor:{bar:"bg-terminal-blue",text:"text-terminal-blue"}};return l.length===0?a.jsx("div",{className:"text-terminal-dimmer text-xs font-mono",children:"No provider data"}):a.jsx("div",{className:"space-y-3",children:l.map(o=>{const u=r>0?o.count/r*100:0,m=i[o.provider]||{bar:"bg-terminal-dim",text:"text-terminal-dim"};return a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:`text-xs font-sans font-medium ${m.text}`,children:o.label}),a.jsxs("span",{className:"text-xs font-mono text-terminal-dim tabular-nums",children:[o.count," (",Math.round(u),"%)"]})]}),a.jsx("div",{className:"h-1.5 rounded-full bg-terminal-surface-2 overflow-hidden",children:a.jsx("div",{className:`h-full rounded-full ${m.bar} transition-all duration-500`,style:{width:`${u}%`,opacity:.7}})})]},o.provider)})})}function Oh({provider:l}){return a.jsx("span",{className:`text-[10px] font-sans font-medium px-1.5 py-0.5 rounded-full uppercase tracking-wider ${Ch(l)}`,children:Eh(l)})}function Jb({sessions:l,isLoading:r,onViewAll:i,onGenerate:o,onViewReplay:u,onSessionClick:m,generatingSlug:p,generateErrorSlug:x}){return l.length===0?a.jsx("div",{className:"text-center py-6 text-terminal-dimmer text-xs font-mono",children:r?"Loading sessions...":"No sessions found. Start a coding session with Claude Code or Cursor."}):a.jsxs("div",{className:"space-y-1",children:[l.map(f=>{const g=!!f.existingReplay,b=p===f.slug,j=x===f.slug;return a.jsxs("div",{onClick:()=>m(f),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-terminal-surface-hover transition-colors duration-200 cursor-pointer",children:[a.jsx(Oh,{provider:f.provider}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-sans text-terminal-text truncate",children:Su(f)}),a.jsx("p",{className:"text-[11px] font-mono text-terminal-dimmer truncate",children:$a(f.project)})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsx("span",{className:"text-[11px] font-mono text-terminal-dimmer tabular-nums",children:Ml(f.timestamp)}),g?a.jsxs("button",{onClick:T=>{T.stopPropagation(),u(f.existingReplay)},className:"h-6 px-2.5 text-[11px] font-sans font-semibold rounded-md bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis transition-all duration-200 flex items-center gap-1",children:[a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",children:a.jsx("polygon",{points:"4 2 14 8 4 14"})}),"View"]}):a.jsx("button",{onClick:T=>{T.stopPropagation(),o(f)},disabled:b,className:`h-6 px-2.5 text-[11px] font-sans font-semibold rounded-md transition-all duration-200 disabled:opacity-50 flex items-center gap-1 ${j?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis"}`,children:b?a.jsx("span",{className:"animate-pulse",children:"..."}):j?"Failed":a.jsxs(a.Fragment,{children:[a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"M8 2v12M2 8h12"})}),"Generate"]})})]})]},`${f.provider}-${f.slug}`)}),a.jsx("button",{onClick:i,className:"w-full py-2 mt-1 text-xs font-sans font-semibold rounded-lg bg-terminal-surface-2 text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:"View all sessions →"})]})}function Kb({replays:l,isLoading:r,onViewAll:i,onOpen:o}){return l.length===0?a.jsx("div",{className:"text-center py-6 text-terminal-dimmer text-xs font-mono",children:r?"Loading replays...":"No replays yet. Generate one from the Sessions tab."}):a.jsxs("div",{className:"space-y-1",children:[l.map(u=>a.jsxs("button",{onClick:()=>o(u.slug),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-terminal-surface-hover transition-colors duration-200 text-left group",children:[a.jsx(Oh,{provider:u.provider}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-sans text-terminal-text truncate group-hover:text-terminal-green transition-colors",children:ru(u)}),a.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[a.jsxs("span",{className:"text-[11px] font-mono text-terminal-dimmer",children:[u.stats.userPrompts," prompts"]}),a.jsx("span",{className:"text-terminal-border text-[10px]",children:"·"}),a.jsxs("span",{className:"text-[11px] font-mono text-terminal-dimmer",children:[u.stats.toolCalls," tools"]}),u.stats.durationMs&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-terminal-border text-[10px]",children:"·"}),a.jsx("span",{className:"text-[11px] font-mono text-terminal-dimmer",children:jt(u.stats.durationMs)})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.gist?.gistId&&a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple",children:"published"}),a.jsx("span",{className:"text-[11px] font-mono text-terminal-dimmer tabular-nums",children:Ml(u.startTime)})]})]},u.slug)),a.jsx("button",{onClick:i,className:"w-full py-2 mt-1 text-xs font-sans font-semibold rounded-lg bg-terminal-surface-2 text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:"View all replays →"})]})}const Qp=[{name:"claude",label:"Claude Code",purpose:"AI feedback via headless mode"},{name:"cursor",label:"Cursor CLI",purpose:"AI feedback via AI Studio"},{name:"opencode",label:"OpenCode",purpose:"AI feedback via headless mode"}];function Pb(){const[l,r]=y.useState(()=>Qp.map(i=>({...i,installed:!1,detail:"checking...",loading:!0})));return y.useEffect(()=>{let i=!1;for(const o of Qp)fetch(`/api/system-checks?tool=${encodeURIComponent(o.name)}`).then(u=>u.ok?u.json():null).then(u=>{if(i)return;const m=u?.checks?.find(p=>p.name===o.name)||u?.checks?.[0];if(!m){r(p=>p.map(x=>x.name===o.name?{...x,installed:!1,detail:"check failed",loading:!1}:x));return}r(p=>p.map(x=>x.name===o.name?{...x,installed:!!m.installed,version:m.version,detail:m.detail,loading:!1}:x))}).catch(()=>{i||r(u=>u.map(m=>m.name===o.name?{...m,installed:!1,detail:"check failed",loading:!1}:m))});return()=>{i=!0}},[]),a.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm",children:[a.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-3",children:"System"}),a.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2",children:l.map(i=>a.jsxs("div",{className:"flex items-start gap-2.5 px-3 py-2.5 rounded-lg bg-terminal-bg",children:[a.jsx("div",{className:`w-2 h-2 mt-1 rounded-full shrink-0 ${i.loading?"bg-terminal-blue animate-pulse":i.installed?"bg-terminal-green":"bg-terminal-dim opacity-40"}`}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("span",{className:`text-xs font-sans font-medium ${i.loading?"text-terminal-dim":i.installed?"text-terminal-text":"text-terminal-dimmer"}`,children:i.label}),a.jsx("p",{className:"text-[10px] font-mono text-terminal-dimmer truncate",children:i.purpose}),i.loading?a.jsx("p",{className:"text-[10px] font-mono text-terminal-blue truncate animate-pulse",children:"checking..."}):i.installed?a.jsx("p",{className:"text-[10px] font-mono text-terminal-green truncate",children:i.detail||i.version||"ready"}):a.jsx("p",{className:"text-[10px] font-mono text-terminal-orange truncate",children:i.detail||"not found"})]})]},i.name))})]})}const bi=({c:l,children:r})=>a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:l,children:r}),Wb=()=>a.jsx(bi,{c:"text-terminal-green",children:a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),e0=()=>a.jsx(bi,{c:"text-terminal-blue",children:a.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),t0=()=>a.jsxs(bi,{c:"text-terminal-green",children:[a.jsx("polyline",{points:"4 17 10 11 4 5"}),a.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]}),n0=()=>a.jsx(bi,{c:"text-terminal-orange",children:a.jsx("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"})});function a0({onNavigate:l}){const{sources:r,setSources:i,replays:o,loading:u,loadingSources:m,loadingReplays:p,error:x}=Fb(),f=y.useMemo(()=>Zb(r,o),[r,o]),{scanStatus:g,userInsights:b}=zs(),[j,T]=y.useState(null),[v,N]=y.useState(null),[S,k]=y.useState(null),E=S?r.find($=>$.slug===S)??null:null,M=!b&&(m||!!g?.running||r.length>0),A=$=>{lt({view:null,session:$})},_=async $=>{T($.slug),N(null);try{const I=Su($),P=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:$.provider,filePaths:$.filePaths,toolPaths:$.toolPaths,title:vt(I)||void 0,sessionSlug:$.slug,sessionProject:$.project})}),de=await P.json();if(!P.ok)throw new Error(de.error||"Generation failed");lt({view:null,session:de.slug})}catch(I){console.error("Generate error:",I),N($.slug),setTimeout(()=>N(P=>P===$.slug?null:P),2e3)}finally{T(null)}},z=async($,I)=>{k(null),T($.slug),N(null);try{const P=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:$.provider,filePaths:$.filePaths,toolPaths:$.toolPaths,title:vt(I)||void 0,sessionSlug:$.slug,sessionProject:$.project})}),de=await P.json();if(!P.ok)throw new Error(de.error||"Generation failed");lt({view:null,session:de.slug})}catch(P){console.error("Generate error:",P),N($.slug),setTimeout(()=>N(de=>de===$.slug?null:de),2e3)}finally{T(null)}},B=async($,I)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent($)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:I})})).ok)throw new Error("Failed to update title");i(de=>de.map(ce=>ce.slug===$&&ce.replay?{...ce,replay:{...ce.replay,title:I||void 0}}:ce))},F=async $=>{try{if(!(await fetch(`/api/sessions/${encodeURIComponent($)}`,{method:"DELETE"})).ok)return;i(P=>P.map(de=>de.slug===$?{...de,replay:void 0,existingReplay:null}:de))}catch{}};if(u&&!r.length&&!o.length)return a.jsxs("div",{className:"flex-1 overflow-auto p-4 md:p-8 space-y-8 animate-in fade-in duration-500",children:[a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[...Array(4)].map(($,I)=>a.jsx(Xb,{},I))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[a.jsx("div",{className:"bg-terminal-surface rounded-xl p-6 h-[300px] skeleton opacity-10"}),a.jsx("div",{className:"bg-terminal-surface rounded-xl p-6 h-[400px] skeleton opacity-10"})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"bg-terminal-surface rounded-xl p-6 h-[250px] skeleton opacity-10"}),a.jsx("div",{className:"bg-terminal-surface rounded-xl p-6 h-[350px] skeleton opacity-10"})]})]})]});if(x&&r.length===0&&o.length===0)return a.jsx("div",{className:"flex-1 flex items-center justify-center",children:a.jsx("div",{className:"text-center space-y-2",children:a.jsx("div",{className:"text-terminal-red font-mono text-sm",children:x})})});const me=r.every($=>$.promptCount!=null)?`across ${f.projectCount} projects`:`${r.filter($=>$.promptCount!=null).length} of ${r.length} scanned`;return a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[a.jsx(Kr,{label:"Sessions",value:f.totalSessions.toLocaleString(),sub:`${f.projectCount} project${f.projectCount!==1?"s":""}`,color:"green",icon:a.jsx(Wb,{})}),a.jsx(Kr,{label:"Replays",value:f.totalReplays.toLocaleString(),sub:f.publishedCount>0?`${f.publishedCount} published`:void 0,color:"blue",icon:a.jsx(e0,{})}),a.jsx(Kr,{label:"Turns",value:f.totalPrompts.toLocaleString(),sub:me,color:"green",icon:a.jsx(t0,{})}),a.jsx(Kr,{label:"Tool Calls",value:f.totalToolCalls.toLocaleString(),sub:me,color:"orange",icon:a.jsx(n0,{})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-3",children:[a.jsxs("div",{className:"lg:col-span-2 bg-terminal-surface rounded-xl p-4 shadow-layer-sm",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Activity"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-2 h-2 rounded-sm bg-terminal-orange opacity-70"}),a.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:"Claude"})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-2 h-2 rounded-sm bg-terminal-blue opacity-70"}),a.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:"Cursor"})]})]})]}),a.jsx("div",{className:"h-32",children:a.jsx(Vb,{data:f.activityByDay})})]}),a.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm space-y-4",children:[a.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Summary"}),a.jsx(Ib,{breakdown:f.providerBreakdown})]})]}),M?a.jsx(Qb,{}):b&&b.topProjects.length>1?a.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Recent Projects"}),a.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:[b.topProjects.length," total"]})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:[...b.topProjects].sort(($,I)=>(I.lastActivity||"").localeCompare($.lastActivity||"")).slice(0,5).map($=>{const I=$.project.split("/").pop()||$.project;return a.jsxs("button",{onClick:()=>{l("sessions"),setTimeout(()=>{lt({tab:"sessions",project:$.project})},50)},className:"flex items-center justify-between gap-2 px-3 py-2.5 rounded-lg bg-terminal-bg hover:bg-terminal-surface-hover transition-colors text-left group",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("span",{className:"text-xs font-sans font-medium text-terminal-text truncate block group-hover:text-terminal-green transition-colors",children:I}),a.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:[$.sessions," session",$.sessions>1?"s":""," · ",$.prompts," prompts",$.durationMs>0&&` · ${Yb($.durationMs)}`]})]}),$.cost>0&&a.jsxs("span",{className:"text-xs font-mono text-terminal-orange tabular-nums shrink-0",children:["$",$.cost.toFixed(2)]})]},$.project)})}),b.topProjects.length>5&&a.jsx("button",{onClick:()=>l("projects"),className:"w-full py-2 mt-2 text-xs font-sans font-semibold rounded-lg bg-terminal-surface-2 text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:"View all projects →"})]}):null,a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[a.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Recent Sessions"}),a.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:[f.totalSessions," total"]})]}),a.jsx(Jb,{sessions:f.recentSources,isLoading:m,onViewAll:()=>l("sessions"),onGenerate:_,onViewReplay:A,onSessionClick:$=>k($.slug),generatingSlug:j,generateErrorSlug:v})]}),a.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Recent Replays"}),a.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:[f.totalReplays," total"]})]}),a.jsx(Kb,{replays:f.recentReplays,isLoading:p,onViewAll:()=>l("replays"),onOpen:A})]})]}),a.jsx(Pb,{})]}),E&&a.jsx(Bh,{session:E,onClose:()=>k(null),onGenerate:z,onViewReplay:$=>lt({view:null,session:$}),onArchive:$=>{fetch(`/api/archive/${$}`,{method:"POST"}).catch(()=>{}),k(null)},onTitleSave:B,onDeleteReplay:F,isGenerating:j===E.slug,isArchived:!1})]})}function l0({sessionsPerDay:l}){const r=y.useMemo(()=>{const o=new Date,u=new Date(o);u.setDate(u.getDate()-29);const m=[],p=new Date(u);for(;p<=o;){const x=p.toISOString().slice(0,10);m.push(l[x]||0),p.setDate(p.getDate()+1)}return m},[l]),i=Math.max(...r,1);return a.jsx("div",{className:"flex items-end gap-px h-4",children:r.map((o,u)=>a.jsx("div",{className:`w-1 rounded-sm ${o>0?"bg-terminal-green":"bg-terminal-surface-2"}`,style:{height:o>0?`${Math.max(20,o/i*100)}%`:"2px",opacity:o>0?.4+o/i*.6:.2}},u))})}function Qc(l){return l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:String(l)}function s0(l){if(!l)return"";const r=Date.now()-new Date(l).getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const u=Math.floor(o/24);return u<30?`${u}d ago`:`${Math.floor(u/30)}mo ago`}function r0({onNavigate:l}){const{userInsights:r,scanStatus:i}=zs(),[o,u]=y.useState("lastActivity"),m=y.useMemo(()=>{if(!r)return[];const f=[...r.topProjects];switch(o){case"lastActivity":f.sort((g,b)=>(b.lastActivity||"").localeCompare(g.lastActivity||""));break;case"sessions":f.sort((g,b)=>b.sessions-g.sessions);break;case"cost":f.sort((g,b)=>b.cost-g.cost);break;case"duration":f.sort((g,b)=>b.durationMs-g.durationMs);break}return f},[r,o]),p=i?.running&&i.total>0;if(!r&&!p)return a.jsx("div",{className:"flex-1 flex items-center justify-center",children:a.jsxs("div",{className:"text-center space-y-2 text-terminal-dimmer text-sm font-mono",children:[a.jsx("p",{children:"No scan data available yet."}),a.jsx("p",{className:"text-xs",children:"Projects will appear once the background scan completes."})]})});if(!r&&p)return a.jsx("div",{className:"flex-1 flex items-center justify-center",children:a.jsxs("div",{className:"flex items-center gap-2 text-terminal-dim text-sm font-mono",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse"}),"Analyzing sessions... ",i.scanned,"/",i.total]})});const x=f=>{l("sessions"),setTimeout(()=>{lt({tab:"sessions",project:f})},50)};return a.jsx("div",{className:"flex-1 overflow-y-auto",children:a.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{children:a.jsxs("h2",{className:"text-sm font-sans font-semibold text-terminal-text",children:["All Projects",a.jsxs("span",{className:"ml-2 text-terminal-dimmer font-normal",children:["(",m.length,")"]})]})}),a.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-sans",children:[a.jsx("span",{className:"text-terminal-dimmer mr-1",children:"Sort:"}),[["lastActivity","Recent"],["sessions","Sessions"],["cost","Cost"],["duration","Duration"]].map(([f,g])=>a.jsx("button",{onClick:()=>u(f),className:`px-2 py-1 rounded-md transition-colors ${o===f?"bg-terminal-green-subtle text-terminal-green":"text-terminal-dim hover:text-terminal-text"}`,children:g},f))]})]}),p&&a.jsxs("div",{className:"flex items-center gap-2 px-1",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse"}),a.jsxs("span",{className:"text-xs font-mono text-terminal-dim",children:["Analyzing... ",i.scanned,"/",i.total]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:m.map(f=>{const g=f.project.split("/").pop()||f.project;return a.jsxs("button",{onClick:()=>x(f.project),className:"text-left bg-terminal-surface rounded-xl p-4 shadow-layer-sm hover:bg-terminal-surface-hover transition-all duration-200 group border-l-2 border-terminal-green/40 hover:border-terminal-green",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2 mb-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-sm font-sans font-medium text-terminal-text truncate group-hover:text-terminal-green transition-colors",children:g}),a.jsx("div",{className:"text-[10px] font-mono text-terminal-dimmer truncate mt-0.5",children:f.project})]}),f.lastActivity&&a.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer shrink-0",children:s0(f.lastActivity)})]}),a.jsxs("div",{className:"flex items-center gap-3 text-xs font-mono flex-wrap mb-3",children:[a.jsxs("span",{className:"text-terminal-text tabular-nums",children:[f.sessions," ",a.jsxs("span",{className:"text-terminal-dimmer",children:["session",f.sessions!==1?"s":""]})]}),f.durationMs>0&&a.jsx("span",{className:"text-terminal-blue tabular-nums",children:jt(f.durationMs)}),f.cost>0&&a.jsxs("span",{className:"text-terminal-orange tabular-nums",children:["$",f.cost.toFixed(2)]}),a.jsxs("span",{className:"text-terminal-green tabular-nums",children:[Qc(f.prompts)," ",a.jsx("span",{className:"text-terminal-dimmer",children:"prompts"})]})]}),a.jsxs("div",{className:"flex items-center gap-3 text-[10px] font-mono text-terminal-dimmer flex-wrap mb-2",children:[f.toolCalls>0&&a.jsxs("span",{children:[Qc(f.toolCalls)," tools"]}),f.edits>0&&a.jsxs("span",{children:[Qc(f.edits)," edits"]}),f.branchCount>0&&a.jsxs("span",{children:[f.branchCount," branch",f.branchCount!==1?"es":""]}),f.prCount>0&&a.jsxs("span",{children:[f.prCount," PR",f.prCount!==1?"s":""]}),f.memoryFileCount>0&&a.jsxs("span",{children:[f.memoryFileCount," memory file",f.memoryFileCount!==1?"s":""]})]}),a.jsx(l0,{sessionsPerDay:f.sessionsPerDay})]},f.project)})})]})})}function oi(){return new URLSearchParams(window.location.search).get("project")||dt}function ci(){return new URLSearchParams(window.location.search).get("q")||""}function ui(){return new URLSearchParams(window.location.search).get("archived")==="true"}const i0=()=>a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[a.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),a.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),a.jsx("circle",{cx:"8",cy:"13",r:"1.5"})]});function Eu({provider:l}){return a.jsx("span",{className:`text-[10px] font-sans font-medium px-1.5 py-0.5 rounded-full uppercase tracking-wider ${Ch(l)}`,children:Eh(l)})}function o0({slug:l,title:r,fallbackTitle:i,onSave:o}){const u=vt(r||i||l),[m,p]=y.useState(!1),[x,f]=y.useState(u),[g,b]=y.useState(!1),j=y.useRef(null);y.useEffect(()=>{f(u)},[u]),y.useEffect(()=>{m&&j.current?.focus()},[m]);const T=async()=>{if(!g){b(!0);try{await o(l,vt(x))}finally{b(!1),p(!1)}}};return m?a.jsxs("div",{className:"min-w-0",children:[a.jsx("form",{onSubmit:v=>{v.preventDefault(),T()},className:"flex items-center gap-1.5 min-w-0",children:a.jsx("input",{ref:j,value:x,onChange:v=>f(v.target.value),onBlur:T,onKeyDown:v=>{v.key==="Escape"&&(f(u),p(!1))},className:"bg-terminal-surface-2 rounded px-2 py-0.5 text-sm font-sans text-terminal-text w-full outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-green/50 transition-shadow duration-200",placeholder:u,maxLength:Nu,disabled:g})}),a.jsxs("div",{className:"text-[11px] font-mono text-terminal-dimmer truncate mt-0.5",children:["slug: ",a.jsx("span",{className:"text-terminal-dim",children:l})]})]}):a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("button",{onClick:()=>p(!0),className:"group flex items-center gap-1 min-w-0 max-w-full text-left",title:"Click to edit title",children:[a.jsx("span",{className:"text-sm font-sans font-medium text-terminal-text truncate",children:u||l}),a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"shrink-0 text-terminal-dim opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx("path",{d:"M11.5 1.5l3 3-9 9H2.5v-3l9-9z"})})]}),a.jsxs("div",{className:"text-[11px] font-mono text-terminal-dimmer truncate mt-0.5",children:["slug: ",a.jsx("span",{className:"text-terminal-dim",children:l})]})]})}function c0({onArchive:l,isArchived:r}){const[i,o]=y.useState(!1),u=y.useRef(null);return y.useEffect(()=>{if(!i)return;const m=p=>{u.current&&!u.current.contains(p.target)&&o(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[i]),a.jsxs("div",{className:"relative",ref:u,children:[a.jsx("button",{onClick:m=>{m.stopPropagation(),o(p=>!p)},className:"h-7 w-7 flex items-center justify-center rounded-md bg-terminal-surface-2 text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200",title:"More actions",children:a.jsx(i0,{})}),i&&a.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[140px] rounded-lg bg-terminal-surface-2 border border-terminal-border shadow-layer-md py-1",children:a.jsxs("button",{onClick:m=>{m.stopPropagation(),l(),o(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs font-sans text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:[a.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:a.jsx("path",{d:"M2 4h12v2H2zM3 6v7h10V6M6.5 8h3"})}),r?"Unarchive":"Archive"]})})]})}let Pr=null,ks=null;function Dh(){return Pr?Promise.resolve(Pr):ks||(ks=fetch("/api/scan/results").then(l=>l.ok?l.json():null).then(l=>{const r=l?.results??null;return Pr=r,setTimeout(()=>{Pr=null,ks=null},3e4),r}).catch(()=>null),ks)}function ou(l,r,i){const o=[],u=new Set,m=[r?.firstPrompt,...l.prompts||[]];r?.firstPrompt||m.push(l.firstPrompt);for(const x of m){const f=_l(x||"");!f||u.has(f)||(u.add(f),o.push(f))}const p=_l(i||"");return o.length>1&&p&&o[0]===p&&o.shift(),o.length>1&&/^(?:and|but|or|so|then)\b/i.test(o[0]||"")&&o.shift(),o}function Lh(l){return l&&l!=="main"&&l!=="master"?l:void 0}function zh(l,r){return l==="jsonl"?"bg-terminal-orange-subtle text-terminal-orange":l==="global-state"?"bg-terminal-blue-subtle text-terminal-blue":l==="sqlite"||r?"bg-terminal-green-subtle text-terminal-green":"bg-terminal-surface-2 text-terminal-dimmer"}function Bh({session:l,scanData:r=null,onClose:i,onGenerate:o,onViewReplay:u,onArchive:m,onTitleSave:p,onDeleteReplay:x,isGenerating:f,isArchived:g}){const[b,j]=y.useState(r),T=Su(l),v=su(l,b),[N,S]=y.useState(l.replay?.title||v),[k,E]=y.useState(!1),M=y.useRef(null);y.useEffect(()=>{const L=te=>{te.key==="Escape"&&i()};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[i]),y.useEffect(()=>{const L=M.current;L&&(L.focus(),L.setSelectionRange(L.value.length,L.value.length))},[]),y.useEffect(()=>{j(r)},[r]),y.useEffect(()=>{if(r)return;let L=!1;return Dh().then(te=>{if(L||!te)return;const oe=te.find(ae=>ae.slug===l.slug);oe&&j(oe)}),()=>{L=!0}},[r,l.slug]),y.useEffect(()=>{S(L=>{const te=vt(L),oe=vt(v),ae=vt(l.replay?.title);return!te||te===ae||te===l.slug||oe&&te===vt(T)?l.replay?.title||v:L})},[T,v,l.replay?.title,l.slug]);const A=Lh(b?.gitBranch||l.gitBranch),_=b?.model||l.model,z=ou(l,b,v),B=b?.dataQualityNotes||[],F=b?.promptCount??l.promptCount,ee=b?.toolCallCount??l.toolCallCount,me=b?.editCount??l.editCountEst,$=b?.durationMs??l.durationMsEst,I=b?.costEstimate??l.replay?.stats?.costEstimate,P=b?.tokenUsage?b.tokenUsage.inputTokens+b.tokenUsage.outputTokens:void 0,de=b?.startTime||l.timestamp,ce=async()=>{if(!l.replay||k)return;const L=vt(N);if(L!==vt(l.replay.title||v)){E(!0);try{await p(l.slug,L)}finally{E(!1)}}},pe=()=>{o(l,N)};return a.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[a.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-md animate-in fade-in duration-300",onClick:i}),a.jsxs("div",{className:"relative max-w-4xl w-full bg-terminal-bg border border-terminal-border-subtle rounded-2xl shadow-layer-xl animate-in zoom-in-95 fade-in duration-200 flex flex-col max-h-[88vh]",onClick:L=>L.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between px-7 pt-5 pb-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Eu,{provider:l.provider}),_&&a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-surface-2 text-terminal-dimmer",children:wu(_)}),b?.dataSource&&a.jsx("span",{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full ${zh(b.dataSource,l.hasSqlite)}`,children:iu(l.hasSqlite,b.dataSource)}),b?.entrypoint&&a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-surface-2 text-terminal-dimmer",children:b.entrypoint}),b?.permissionMode==="bypassPermissions"&&a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange",children:"trust mode"}),b?.skillsUsed?.map(L=>a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-blue-500/10 text-blue-400",children:L},L)),b?.mcpServersUsed?.map(L=>a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-purple-500/10 text-purple-400",children:L},L)),l.replay?.replayOutdated&&a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange",children:"outdated replay"})]}),a.jsx("button",{onClick:i,className:"h-7 w-7 flex items-center justify-center rounded-md text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:a.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-7 space-y-5 pb-5",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2 px-1",children:[a.jsx("span",{className:"text-xs font-sans uppercase tracking-widest text-terminal-dimmer",children:"Title"}),a.jsx("span",{className:"text-xs font-mono text-terminal-dimmer",children:l.slug})]}),a.jsx("form",{onSubmit:L=>{L.preventDefault(),l.replay?ce():pe()},children:a.jsx("textarea",{ref:M,value:N,onChange:L=>S(L.target.value.replace(/\n/g,"")),onBlur:()=>{l.replay&&ce()},onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),l.replay?ce():pe())},rows:2,className:"w-full bg-terminal-surface rounded-xl px-5 py-4 text-lg font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-green/40 transition-shadow duration-200 resize-none leading-relaxed",placeholder:v,maxLength:Nu})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[a.jsxs("div",{className:"bg-terminal-surface rounded-xl px-5 py-4 space-y-2.5",children:[a.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-1",children:"Session Info"}),a.jsx(ut,{label:"Project",value:$a(l.project),title:l.project}),A&&a.jsx(ut,{label:"Branch",value:A}),b?.gitBranches&&b.gitBranches.length>1&&a.jsx(ut,{label:"Branches",value:b.gitBranches.join(", ")}),b?.skillsUsed&&b.skillsUsed.length>0&&a.jsx(ut,{label:"Skills",value:b.skillsUsed.join(", ")}),b?.mcpServersUsed&&b.mcpServersUsed.length>0&&a.jsx(ut,{label:"MCP Servers",value:b.mcpServersUsed.join(", ")}),a.jsx(ut,{label:"Started",value:`${si(de)} (${Ml(de)})`}),b?.endTime&&a.jsx(ut,{label:"Ended",value:si(b.endTime)}),!!$&&a.jsx(ut,{label:"Duration",value:`~${jt($)}`}),a.jsx(ut,{label:"Size",value:ri(l.fileSize)}),a.jsx(ut,{label:"Lines",value:l.lineCount.toLocaleString()}),l.filePaths.length>1&&a.jsx(ut,{label:"Parts",value:`${l.filePaths.length} files`}),a.jsx(ut,{label:"Data",value:iu(l.hasSqlite,b?.dataSource)})]}),a.jsxs("div",{className:"bg-terminal-surface rounded-xl px-5 py-4 space-y-2.5",children:[a.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-1",children:"Stats"}),!!F&&a.jsx(ut,{label:"Prompts",value:String(F)}),!!ee&&a.jsx(ut,{label:"Tools",value:String(ee)}),!!me&&a.jsx(ut,{label:"Edits",value:b?String(me):`~${me}`}),I!=null&&I>0&&a.jsx(ut,{label:"Cost",value:Sh(I)}),P!=null&&a.jsx(ut,{label:"Tokens",value:P.toLocaleString(),title:b?.tokenUsage?`In: ${b.tokenUsage.inputTokens.toLocaleString()} / Out: ${b.tokenUsage.outputTokens.toLocaleString()} / Cache write: ${b.tokenUsage.cacheCreationTokens.toLocaleString()} / Cache read: ${b.tokenUsage.cacheReadTokens.toLocaleString()}`:void 0}),b!=null&&b.subAgentCount>0&&a.jsx(ut,{label:"Agents",value:`${b.subAgentCount} sub-agents`}),b!=null&&b.compactionCount>0&&a.jsx(ut,{label:"Compacts",value:String(b.compactionCount)}),b!=null&&b.apiErrorCount>0&&a.jsx(ut,{label:"Errors",value:`${b.apiErrorCount} API errors`}),l.hasPR&&!b?.prLinks?.length&&a.jsx(ut,{label:"PR",value:"Yes"}),b?.prLinks?.map(L=>a.jsx(ut,{label:"PR",value:`#${L.prNumber} (${L.prRepository})`},L.prNumber))]})]}),B.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2",children:"Data Quality"}),a.jsx("div",{className:"bg-terminal-surface rounded-xl px-4 py-3 space-y-1.5",children:B.map(L=>a.jsxs("div",{className:"flex gap-2 items-start text-xs font-mono text-terminal-dim",children:[a.jsx("span",{className:"text-terminal-orange shrink-0 mt-px",children:"!"}),a.jsx("span",{children:L})]},L))})]}),b?.filesModified&&b.filesModified.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2",children:["Files Modified (",b.filesModified.length,")"]}),a.jsxs("div",{className:"max-h-[120px] overflow-y-auto bg-terminal-surface rounded-xl px-4 py-2.5 space-y-1",children:[b.filesModified.slice(0,20).map(L=>a.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs font-mono",children:[a.jsx("span",{className:"text-terminal-dim truncate",children:L.file}),a.jsxs("span",{className:"text-terminal-dimmer shrink-0 tabular-nums",children:[L.count,"x"]})]},L.file)),b.filesModified.length>20&&a.jsxs("div",{className:"text-xs font-mono text-terminal-dimmer",children:["+",b.filesModified.length-20," more files"]})]})]}),z.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2",children:"Prompts"}),a.jsx("div",{className:"max-h-[180px] overflow-y-auto space-y-1.5 pr-1",children:z.map((L,te)=>a.jsxs("div",{className:"flex gap-2 items-start",children:[a.jsx("span",{className:"text-xs text-terminal-green shrink-0 mt-px select-none",children:">"}),a.jsx("p",{className:"text-sm text-terminal-dim line-clamp-2 leading-relaxed",children:L})]},te))})]}),l.replay&&a.jsxs("div",{className:"border-t border-terminal-border-subtle pt-4",children:[a.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2",children:"Replay"}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.replay.replaySize!=null&&a.jsx("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dim",children:ri(l.replay.replaySize)}),l.replay.generatorVersion&&a.jsxs("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dimmer",children:["v",l.replay.generatorVersion]}),!!l.replay.annotationCount&&a.jsxs("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dim",children:[l.replay.annotationCount," annotations"]}),(l.replay.cloud||l.replay.gist)&&a.jsx("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-terminal-green-subtle text-terminal-green",children:l.replay.cloud?"Cloud":"Gist"})]})]}),l.expiresInDays!=null&&l.expiresInDays<=7&&a.jsxs("div",{className:`rounded-lg px-4 py-2.5 text-sm font-mono ${l.expiresInDays<=2?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-orange-subtle text-terminal-orange"}`,children:[l.expiresInDays===0?"Transcript expires today":`Transcript expires in ${l.expiresInDays} day${l.expiresInDays!==1?"s":""}`," — generate a replay to preserve it."]})]}),a.jsxs("div",{className:"flex items-center justify-between px-7 py-4 border-t border-terminal-border-subtle",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:()=>{m(l.slug),i()},className:"h-9 px-3 text-xs font-sans rounded-lg text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors flex items-center gap-1.5",children:[a.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:a.jsx("path",{d:"M2 4h12v2H2zM3 6v7h10V6M6.5 8h3"})}),g?"Unarchive":"Archive"]}),l.replay&&a.jsxs("button",{onClick:()=>{x(l.slug),i()},className:"h-9 px-3 text-xs font-sans rounded-lg text-terminal-red/70 hover:text-terminal-red hover:bg-terminal-red-subtle transition-colors flex items-center gap-1.5",children:[a.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:a.jsx("path",{d:"M3 4h10M5.5 4V3h5v1M6 7v4M10 7v4M4.5 4l.5 9h6l.5-9"})}),"Delete replay"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[l.replay&&a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>o(l,N),disabled:f,className:"h-11 px-5 text-sm font-sans font-semibold rounded-xl bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200 flex items-center gap-2 disabled:opacity-50",children:f?a.jsx("span",{className:"animate-pulse",children:"Regenerating..."}):a.jsxs(a.Fragment,{children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),a.jsx("path",{d:"M21 3v5h-5"}),a.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),a.jsx("path",{d:"M8 16H3v5"})]}),"Regenerate"]})}),a.jsxs("button",{onClick:()=>u(l.existingReplay),className:"h-11 px-6 text-sm font-sans font-bold rounded-xl bg-terminal-green text-terminal-bg hover:brightness-110 transition-all duration-200 flex items-center gap-2",children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:a.jsx("path",{d:"M5 3l8 5-8 5V3z"})}),"View Replay"]})]}),!l.replay&&a.jsx("button",{onClick:pe,disabled:f,className:"h-12 px-8 text-sm font-sans font-bold rounded-xl bg-terminal-green text-terminal-bg hover:brightness-110 transition-all duration-200 flex items-center gap-2 shadow-lg shadow-terminal-green/20 disabled:opacity-50",children:f?a.jsx("span",{className:"animate-pulse",children:"Generating..."}):a.jsxs(a.Fragment,{children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"M8 2v12M2 8h12"})}),"Generate Replay"]})})]})]})]})]})}function ut({label:l,value:r,title:i}){return a.jsxs("div",{className:"flex items-baseline gap-2 min-w-0",children:[a.jsx("span",{className:"text-[11px] font-sans text-terminal-dimmer uppercase tracking-wider shrink-0 w-[68px]",children:l}),a.jsx("span",{className:"text-sm font-mono text-terminal-dim truncate",title:i||r,children:r})]})}function Uh({summary:l,onOpen:r,onShare:i,onTitleSave:o,onDelete:u,onRegenerate:m,onArchive:p,isDeleting:x,isRegenerating:f,isArchived:g}){const[b,j]=y.useState(!1),[T,v]=y.useState(!1),N=y.useRef(null);return y.useEffect(()=>{if(!T)return;const S=k=>{N.current&&!N.current.contains(k.target)&&(v(!1),j(!1))};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[T]),a.jsxs("div",{onClick:r,className:`bg-terminal-surface rounded-xl px-5 py-5 hover:bg-terminal-surface-hover transition-all duration-300 ease-material space-y-3.5 shadow-layer-sm cursor-pointer hover-lift ${g?"opacity-50":""}`,children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsx("div",{className:"flex-1 flex items-center gap-2 min-w-0",children:o?a.jsx("div",{className:"flex-1 min-w-0",onClick:S=>S.stopPropagation(),children:a.jsx(o0,{slug:l.slug,title:l.title,fallbackTitle:ru(l),onSave:o})}):a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:"text-sm font-sans font-medium text-terminal-text truncate block",children:ru(l)}),a.jsxs("div",{className:"text-[11px] font-mono text-terminal-dimmer truncate mt-0.5",children:["slug: ",a.jsx("span",{className:"text-terminal-dim",children:l.slug})]})]})}),a.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[l.replayOutdated&&a.jsxs("span",{className:"h-6 px-2 text-[10px] font-mono rounded-md bg-terminal-orange-subtle text-terminal-orange flex items-center gap-1",title:`Generated with v${l.generatorVersion||"?"} — regenerate to update`,children:[a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[a.jsx("path",{d:"M2.5 8a5.5 5.5 0 019.3-4M13.5 8a5.5 5.5 0 01-9.3 4"}),a.jsx("path",{d:"M12.5 1v3h-3M3.5 15v-3h3"})]}),"outdated"]}),l.gist?.outdated&&a.jsx("button",{onClick:S=>{S.stopPropagation(),i?.()},className:"h-7 w-7 flex items-center justify-center rounded-md bg-terminal-orange-subtle text-terminal-orange hover:bg-terminal-orange-emphasis transition-all duration-200 ease-material shrink-0",title:"Gist out of sync — click to update",children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:a.jsx("path",{d:"M8 1a1 1 0 0 1 1 1v5.5a1 1 0 0 1-2 0V2a1 1 0 0 1 1-1zM8 11a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 8 11z"})})}),i&&a.jsxs("button",{onClick:S=>{S.stopPropagation(),i()},className:`h-7 px-2.5 text-xs font-sans font-semibold rounded-md transition-all duration-200 ease-material flex items-center justify-center gap-1.5 shrink-0 ${l.cloud||l.gist?"bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis":"bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-purple-emphasis"}`,title:l.cloud||l.gist?"Already shared — view or update":"Share & Export",children:[l.cloud||l.gist?a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"})}):a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:a.jsx("path",{d:"M8 2v8M5 5l3-3 3 3M3 11v2h10v-2"})}),l.cloud||l.gist?"Shared":"Share"]}),m&&a.jsxs("button",{onClick:S=>{S.stopPropagation(),m()},disabled:f,className:"h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200 ease-material flex items-center justify-center gap-1.5 shrink-0 disabled:opacity-50",title:"Redo",children:[f?a.jsx("span",{className:"animate-pulse",children:"..."}):a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),a.jsx("path",{d:"M21 3v5h-5"}),a.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),a.jsx("path",{d:"M8 16H3v5"})]}),"Redo"]}),a.jsxs("button",{onClick:r,className:"h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis transition-all duration-200 ease-material flex items-center justify-center gap-1 shrink-0",children:[a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",children:a.jsx("polygon",{points:"4 2 14 8 4 14"})}),"View"]}),(u||p)&&a.jsxs("div",{className:"relative",ref:N,children:[a.jsx("button",{onClick:S=>{S.stopPropagation(),v(k=>!k),j(!1)},className:"h-7 w-7 flex items-center justify-center rounded-md bg-terminal-surface-2 text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200",title:"More actions",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[a.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),a.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),a.jsx("circle",{cx:"8",cy:"13",r:"1.5"})]})}),T&&a.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[140px] rounded-lg bg-terminal-surface-2 border border-terminal-border shadow-layer-md py-1",children:[p&&a.jsxs("button",{onClick:S=>{S.stopPropagation(),p(),v(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs font-sans text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:[a.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:a.jsx("path",{d:"M2 4h12v2H2zM3 6v7h10V6M6.5 8h3"})}),g?"Unarchive":"Archive"]}),u&&a.jsxs(a.Fragment,{children:[p&&a.jsx("div",{className:"mx-2 my-1 border-t border-terminal-border"}),b?a.jsxs("div",{className:"flex items-center gap-1 px-2 py-1",children:[a.jsx("button",{onClick:S=>{S.stopPropagation(),u(),j(!1),v(!1)},className:"h-6 px-2 text-xs font-sans rounded bg-terminal-red-subtle text-terminal-red hover:bg-terminal-red-emphasis transition-colors duration-200",children:"Confirm"}),a.jsx("button",{onClick:()=>j(!1),className:"h-6 px-2 text-xs font-sans rounded text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"})]}):a.jsxs("button",{onClick:()=>j(!0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs font-sans text-terminal-red hover:bg-terminal-red-subtle transition-colors",children:[a.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:a.jsx("path",{d:"M3 4h10M5.5 4V3a1 1 0 011-1h3a1 1 0 011 1v1M6.5 7v4M9.5 7v4M4.5 4l.5 9a1 1 0 001 1h4a1 1 0 001-1l.5-9"})}),"Delete"]})]})]})]})]})]}),(l.messages||(l.firstMessage?[l.firstMessage]:[])).map(S=>_l(S||"")).filter(S=>S.length>0).map((S,k)=>a.jsxs("div",{className:"flex gap-2 items-start",children:[a.jsx("span",{className:"text-xs text-terminal-green shrink-0 mt-px select-none",children:">"}),a.jsx("p",{className:"text-sm text-terminal-dim line-clamp-1 leading-relaxed",children:S})]},k)),a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",children:[l.stats.userPrompts," prompts"]}),a.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-orange-subtle text-terminal-orange",children:[l.stats.toolCalls," tools"]}),l.stats.durationMs&&a.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",children:jt(l.stats.durationMs)}),l.stats.costEstimate&&a.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-green-subtle text-terminal-green",children:Sh(l.stats.costEstimate)}),l.hasAnnotations&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-blue-subtle text-terminal-blue",children:[l.annotationCount," annotation",l.annotationCount!==1?"s":""]}),l.replaySize!=null&&l.replaySize>0&&a.jsx("span",{className:`inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md ${l.replaySize>10*1024*1024?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-surface-2 text-terminal-dimmer"}`,title:l.replaySize>10*1024*1024?"Exceeds share limit (10MB)":void 0,children:ri(l.replaySize)})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-terminal-dimmer flex-wrap",children:[a.jsx(Eu,{provider:l.provider}),a.jsx("span",{children:l.project}),a.jsx("span",{className:"text-terminal-border",children:"·"}),a.jsx("span",{children:si(l.startTime)}),l.model&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-terminal-border",children:"·"}),a.jsx("span",{children:l.model})]})]})]})}function Vp(){const[l,r]=y.useState(!1),[i,o]=y.useState(null),[u,m]=y.useState(null),p=async()=>{r(!0),m(null),o(null);try{const x=await fetch("/api/regenerate-all",{method:"POST"}),f=await x.json();if(!x.ok)throw new Error(f.error||"Failed");o({regenerated:f.regenerated,total:f.total}),setTimeout(()=>window.location.reload(),1500)}catch(x){m(x instanceof Error?x.message:"Failed to regenerate")}finally{r(!1)}};return a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{onClick:p,disabled:l,className:"px-3 py-1.5 text-xs font-mono rounded-lg bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover border border-terminal-border-subtle transition-colors duration-200 disabled:opacity-40",children:l?"Regenerating...":"Regenerate All"}),i&&a.jsxs("span",{className:"text-xs font-mono text-terminal-green",children:[i.regenerated,"/",i.total," regenerated"]}),u&&a.jsx("span",{className:"text-xs font-mono text-terminal-red",children:u})]})}const dt="__all__";function u0(){const[l,r]=y.useState([]),[i,o]=y.useState({}),[u,m]=y.useState(null),[p,x]=y.useState(!0),[f,g]=y.useState(null),[b,j]=y.useState(!1),[T,v]=y.useState(null),[N,S]=y.useState(null),[k,E]=y.useState(null),[M,A]=y.useState(()=>Date.now()),[_,z]=y.useState(oi()),[B,F]=y.useState(ci()),[ee,me]=y.useState(ui());y.useEffect(()=>{const G=()=>{z(oi()),F(ci()),me(ui())};return window.addEventListener("popstate",G),()=>window.removeEventListener("popstate",G)},[]);const $=G=>{z(G),lt({project:G===dt?null:G})},I=G=>{F(G),lt({q:G||null},{replace:!0})},P=()=>{const G=!ee;me(G),lt({archived:G?"true":null})},{scanStatus:de,userInsights:ce,projectInsightsCache:pe,fetchProjectInsights:H}=zs();y.useEffect(()=>{_!==dt&&H(_)},[_,H]);const L=_!==dt?pe.get(_):void 0,[te,oe]=y.useState(null),[ae,C]=y.useState(null),[O,Z]=y.useState(null),W=y.useRef(!1),[V,fe]=y.useState(new Set),[xe,Me]=y.useState(null),Ae=l.some(G=>G.provider==="cursor"),_e=O?l.find(G=>G.slug===O)??null:null,Ge=y.useCallback(async G=>{x(!0),g(null),S(null),j(!1),v(null);const je=await fetch("/api/archived").then(ge=>ge.ok?ge.json():{slugs:[]}).catch(()=>({slugs:[]}));fe(new Set(je.slugs));let Ee=!1;const J=await fetch("/api/sources/cached").then(ge=>ge.ok?ge.json():null).catch(()=>null),K=Al(J),ue=!G?.forceRefresh&&ai(K?.cachedAt);if(K&&K.sessions.length>0&&(Ee=!0,r(K.sessions),E(K.cachedAt??null),v(ue?null:K.cachedAt??null),x(!1),j(!ue)),ue){j(!1),x(!1);return}try{const ge=await fetch("/api/sources");if(!ge.ok)throw new Error("Failed to load sessions");const ye=await ge.json();r(ye.sessions),ye.cleanupPeriodDays!=null&&m(ye.cleanupPeriodDays),E(new Date().toISOString()),v(null)}catch(ge){Ee?S("Failed to refresh latest sessions. Showing cached data."):g(Ds(ge)||"Failed to load sessions")}finally{j(!1),x(!1)}},[]),se=async G=>{const je=V.has(G);fe(Ee=>{const J=new Set(Ee);return je?J.delete(G):J.add(G),J});try{if(!(await fetch(`/api/archive/${G}`,{method:je?"DELETE":"POST"})).ok)throw new Error("Archive toggle failed")}catch(Ee){console.error("Archive toggle failed:",Ds(Ee)),fe(J=>{const K=new Set(J);return je?K.add(G):K.delete(G),K})}};y.useEffect(()=>{Ge()},[Ge]),y.useEffect(()=>{if(l.length===0)return;let G=!1;const je=async()=>{const J=await Dh();G||!J||o(Object.fromEntries(J.filter(K=>K.slug).map(K=>[K.slug,K])))};je();const Ee=window.setInterval(()=>{je()},de?.running?5e3:3e4);return()=>{G=!0,window.clearInterval(Ee)}},[de?.running,l.length]),y.useEffect(()=>{if(!p&&!Ae&&!W.current)return;let G=!1,je;const Ee=async()=>{const K=await fetch("/api/sources/cached").then(ge=>ge.ok?ge.json():null).catch(()=>null),ue=Al(K);!G&&ue?.sessions.length&&r(ue.sessions)},J=async()=>{const K=await fetch("/api/sources/enrichment-status").then(ue=>ue.ok?ue.json():null).catch(()=>null);!K||G||(Me(K),K.running?(W.current=!0,await Ee()):W.current&&(W.current=!1,await Ee()))};return J(),je=window.setInterval(()=>{J()},2500),()=>{G=!0,je&&window.clearInterval(je)}},[Ae,p]),y.useEffect(()=>{const G=window.setInterval(()=>A(Date.now()),3e4);return()=>window.clearInterval(G)},[]);const Ne=async(G,je)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(G)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:je})})).ok)throw new Error("Failed to update title");r(J=>J.map(K=>K.slug===G&&K.replay?{...K,replay:{...K.replay,title:je||void 0}}:K))},Se=async(G,je)=>{Z(null),oe(G.slug),C(null);try{const Ee=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:G.provider,filePaths:G.filePaths,toolPaths:G.toolPaths,title:vt(je)||void 0,sessionSlug:G.slug,sessionProject:G.project})}),J=await Ee.json();if(!Ee.ok)throw new Error(J.error||"Generation failed");lt({view:null,session:J.slug})}catch(Ee){C(Ds(Ee))}finally{oe(null)}},Qe=async G=>{try{if(!(await fetch(`/api/sessions/${encodeURIComponent(G)}`,{method:"DELETE"})).ok)return;r(Ee=>Ee.map(J=>J.slug===G?{...J,replay:void 0,existingReplay:null}:J))}catch{}},rt=l.filter(G=>V.has(G.slug)).length,Ve=ee?l:l.filter(G=>!V.has(G.slug)),Ue=new Map;for(const G of Ve)Ue.has(G.project)||Ue.set(G.project,[]),Ue.get(G.project)?.push(G);const pt=[...Ue.entries()].sort((G,je)=>{const Ee=G[1][0]?.timestamp||"";return(je[1][0]?.timestamp||"").localeCompare(Ee)}),Lt=Th(pt.map(([G])=>G)),zt=_===dt?Ve:Ue.get(_)||[],Bt=B?zt.filter(G=>G.slug.toLowerCase().includes(B.toLowerCase())||G.firstPrompt.toLowerCase().includes(B.toLowerCase())||(G.title||"").toLowerCase().includes(B.toLowerCase())||(G.gitBranch||"").toLowerCase().includes(B.toLowerCase())):zt,mn=k?Nh(k,M):null,$e=p&&l.length===0,Tn=7,fn=l.filter(G=>G.expiresInDays!=null&&G.expiresInDays<=Tn&&!V.has(G.slug)),St=fn.reduce((G,je)=>Math.min(G,je.expiresInDays??1/0),1/0);return f&&l.length===0?a.jsx("div",{className:"flex-1 flex items-center justify-center",children:a.jsxs("div",{className:"text-center space-y-3",children:[a.jsx("div",{className:"text-terminal-red font-mono text-sm",children:f}),a.jsx("button",{onClick:()=>void Ge({forceRefresh:!0}),className:"px-3 py-1.5 text-xs font-mono rounded-md bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200",children:"Retry"})]})}):l.length===0&&!$e?a.jsx("div",{className:"flex-1 flex items-center justify-center",children:a.jsxs("div",{className:"text-center space-y-2",children:[a.jsx("div",{className:"text-terminal-dim font-mono text-sm",children:"No AI sessions found"}),a.jsx("div",{className:"text-terminal-dimmer font-mono text-xs",children:"Start a coding session with Claude Code or Cursor, then come back here"})]})}):a.jsxs("div",{className:"flex flex-1 min-h-0",children:[a.jsxs("div",{className:"hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20",children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold",children:"Projects"}),mn&&a.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:mn})]}),a.jsx("button",{onClick:()=>{Ge({forceRefresh:!0})},className:"p-1.5 rounded-md text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200",title:"Refresh",children:a.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[a.jsx("path",{d:"M2.5 8a5.5 5.5 0 019.3-4M13.5 8a5.5 5.5 0 01-9.3 4"}),a.jsx("path",{d:"M12.5 1v3h-3M3.5 15v-3h3"})]})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:[a.jsxs("button",{onClick:()=>$(dt),className:`w-full text-left px-3 py-2.5 text-xs font-sans rounded-lg transition-all duration-200 ease-material flex items-center justify-between ${_===dt?"bg-terminal-green-subtle text-terminal-green shadow-layer-sm":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface"}`,children:[a.jsx("span",{className:"font-medium",children:"All projects"}),a.jsx("span",{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${_===dt?"bg-terminal-green-emphasis text-terminal-green":"bg-terminal-surface text-terminal-dimmer"}`,children:l.length})]}),a.jsx("div",{className:"h-px bg-terminal-border-subtle mx-2 my-1.5"}),pt.map(([G,je])=>{const Ee=je.filter(ye=>ye.existingReplay).length,J=_===G,K=Lt.get(G)||$a(G),ue=je[0]?.projectExists!==!1,ge=je.some(ye=>ye.isGitRepo||ye.gitBranch);return a.jsxs("button",{onClick:()=>$(G),title:G,className:`w-full text-left px-3 py-2.5 rounded-lg transition-all duration-200 ease-material group ${J?"bg-terminal-green-subtle shadow-layer-sm":"hover:bg-terminal-surface"} ${ue?"":"opacity-50"}`,children:[a.jsxs("div",{className:"flex items-center justify-between gap-1.5",children:[a.jsxs("span",{className:`text-xs font-sans truncate flex items-center gap-1.5 ${J?"text-terminal-green font-medium":ue?"text-terminal-text group-hover:text-terminal-text":"text-terminal-dim"}`,children:[ge&&a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",className:`shrink-0 ${J?"opacity-70":"opacity-40"}`,children:a.jsx("path",{fillRule:"evenodd",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),K]}),a.jsx("span",{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs shrink-0 ${J?"bg-terminal-green-emphasis text-terminal-green":"bg-terminal-surface text-terminal-dimmer"}`,children:je.length})]}),a.jsxs("div",{className:"flex items-center gap-2 mt-1 ml-0.5",children:[a.jsx("span",{className:`text-xs font-mono truncate ${J?"text-terminal-dim":"text-terminal-dimmer"}`,children:Ml(je[0]?.timestamp||"")}),Ee>0&&a.jsxs("span",{className:`text-xs font-mono ${J?"text-terminal-green":"text-terminal-dimmer"}`,children:[Ee," ",Ee===1?"replay":"replays"]})]})]},G)})]})]}),a.jsxs("div",{className:"flex-1 flex flex-col min-h-0 min-w-0",children:[a.jsx("div",{className:"md:hidden px-3 pt-3",children:a.jsxs("select",{value:_,onChange:G=>$(G.target.value),className:"w-full bg-terminal-surface rounded-lg px-3 py-2.5 text-sm font-sans text-terminal-text outline-none shadow-layer-sm",children:[a.jsxs("option",{value:dt,children:["All projects (",l.length,")"]}),pt.map(([G,je])=>a.jsxs("option",{value:G,children:[Lt.get(G)||$a(G)," (",je.length,")"]},G))]})}),a.jsxs("div",{className:"px-4 pt-4 pb-2 space-y-3 shrink-0",children:[a.jsx("div",{className:"hidden md:block",children:L&&_!==dt?a.jsx(ii,{insights:L,variant:"project"}):ce&&_===dt?a.jsx(ii,{insights:ce,variant:"all"}):a.jsx(_h,{})}),a.jsxs("div",{className:"flex gap-2 items-center",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-terminal-dim",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[a.jsx("circle",{cx:"7",cy:"7",r:"5"}),a.jsx("path",{d:"M11 11l3.5 3.5"})]}),a.jsx("input",{value:B,onChange:G=>I(G.target.value),placeholder:"Filter by branch, title, prompt...",className:"w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm"})]}),rt>0&&a.jsx("button",{onClick:P,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${ee?"bg-terminal-orange-subtle text-terminal-orange":"bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,title:ee?"Hide archived":`View all (${rt} archived)`,children:ee?"Active":"View all"})]})]}),($e||b||T)&&a.jsx("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue shrink-0 shadow-layer-sm",children:$e?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),a.jsx("span",{children:"FETCHING SESSIONS..."})]}):b?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),a.jsx("span",{children:"SCANNING LATEST SESSIONS..."}),T&&a.jsxs("span",{className:"text-terminal-dim",children:["Showing stale cache (",li(T),")"]})]}):T?a.jsxs("span",{children:["Showing stale cache (",li(T),")"]}):null}),xe?.running&&xe.total>0&&a.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue shrink-0 shadow-layer-sm",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),a.jsxs("span",{children:["BACKFILLING CURSOR STATS... ",xe.processed,"/",xe.total]})]}),de?.running&&a.jsx("div",{className:"mx-4 mb-2 shrink-0",children:a.jsx(Mh,{status:de})}),N&&a.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 bg-terminal-orange-subtle rounded-lg px-3 py-2.5 text-xs font-mono text-terminal-orange shrink-0 shadow-layer-sm",children:[a.jsx("span",{children:N}),a.jsx("button",{onClick:()=>S(null),className:"ml-auto text-terminal-orange/60 hover:text-terminal-orange transition-colors",children:"×"})]}),ae&&a.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 bg-terminal-red-subtle rounded-lg px-3 py-2.5 text-xs font-mono text-terminal-red shrink-0 shadow-layer-sm",children:[a.jsx("span",{children:ae}),a.jsx("button",{onClick:()=>C(null),className:"ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors",children:"×"})]}),fn.length>0&&a.jsxs("div",{className:"mx-4 mb-2 flex items-start gap-2.5 bg-terminal-orange-subtle rounded-lg px-4 py-3 shrink-0 shadow-layer-sm",children:[a.jsx("span",{className:"text-terminal-orange text-base leading-none mt-0.5",children:"⚠"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"text-xs font-sans font-semibold text-terminal-orange",children:[fn.length," session",fn.length!==1?"s":""," expiring",St===0?" today":St===1?" tomorrow":` within ${St} days`]}),a.jsxs("div",{className:"text-[11px] font-mono text-terminal-orange/70 mt-0.5",children:["Claude Code auto-deletes transcripts after"," ",u!=null?`${u} days`:"the configured period",". Generate replays to preserve them."]})]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto",children:$e?a.jsx("div",{className:"text-center py-12 text-terminal-dim font-mono text-sm",children:"Fetching sessions..."}):Bt.length===0?a.jsx("div",{className:"text-center py-12 text-terminal-dim font-mono text-sm",children:B?"No sessions match your filter":"No sessions in this project"}):a.jsx("div",{className:"space-y-2.5 px-4 py-3",children:Bt.map(G=>{const je=i[G.slug];if(G.replay){const kt=V.has(G.slug),Zt=su(G,je),Xt=ou(G,je,Zt);return a.jsx(Uh,{summary:{...G.replay,title:Zt,firstMessage:Xt[0]||je?.firstPrompt||G.replay.firstMessage,messages:Xt.length>0?Xt.slice(0,2):je?.firstPrompt?[je.firstPrompt]:G.replay.messages,model:je?.model||G.replay.model},onOpen:()=>lt({view:null,session:G.existingReplay}),onShare:()=>lt({view:null,session:G.existingReplay,v:"export"}),onTitleSave:Ne,onRegenerate:()=>Z(G.slug),isRegenerating:te===G.slug,onDelete:()=>Qe(G.slug),onArchive:()=>se(G.slug),isArchived:kt},`${G.provider}-${G.slug}`)}const Ee=su(G,je),J=ou(G,je,Ee),K=Lh(je?.gitBranch||G.gitBranch),ue=je?.promptCount??G.promptCount,ge=je?.toolCallCount??G.toolCallCount,ye=je?.durationMs??G.durationMsEst,Re=je?.editCount??G.editCountEst,tt=je?.model||G.model,qe=iu(G.hasSqlite,je?.dataSource),it=V.has(G.slug);return a.jsxs("div",{onClick:()=>Z(G.slug),className:`bg-terminal-surface rounded-xl px-5 py-4 hover:bg-terminal-surface-hover transition-all duration-300 ease-material space-y-2.5 shadow-layer-sm cursor-pointer hover-lift ${it?"opacity-50":""}`,children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0 space-y-0.5",children:[a.jsx("span",{className:"text-sm font-mono text-terminal-text truncate block",children:Ee}),a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsxs("div",{className:"text-[11px] font-mono text-terminal-dimmer truncate",children:["slug: ",a.jsx("span",{className:"text-terminal-dim",children:G.slug})]}),K&&a.jsxs("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded bg-terminal-surface-2 text-terminal-dim shrink-0 inline-flex items-center gap-0.5",children:[a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[a.jsx("circle",{cx:"5",cy:"4",r:"2"}),a.jsx("circle",{cx:"11",cy:"12",r:"2"}),a.jsx("path",{d:"M5 6v4c0 1.1.9 2 2 2h2"})]}),K]})]})]}),a.jsxs("div",{className:"flex flex-col items-end gap-1 shrink-0",children:[a.jsx("span",{className:"text-xs font-mono text-terminal-dimmer",children:Ml(G.timestamp)}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("button",{onClick:kt=>{kt.stopPropagation(),Z(G.slug)},disabled:te===G.slug,className:"h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200 ease-material flex items-center justify-center gap-1 disabled:opacity-50",children:te===G.slug?a.jsx("span",{className:"animate-pulse",children:"Generating..."}):a.jsxs(a.Fragment,{children:[a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"M8 2v12M2 8h12"})}),"Generate"]})}),a.jsx(c0,{onArchive:()=>se(G.slug),isArchived:it})]})]})]}),J.map((kt,Zt)=>a.jsxs("div",{className:"flex gap-2 items-start",children:[a.jsx("span",{className:"text-xs text-terminal-green shrink-0 mt-px select-none",children:">"}),a.jsx("p",{className:"text-sm text-terminal-dim line-clamp-1 leading-relaxed",children:kt})]},Zt)),(G.promptCount||ge||ye||Re||G.hasPR||G.expiresInDays!=null&&G.expiresInDays<=Tn)&&a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[!!ue&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",children:[ue," prompts"]}),!!ge&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-orange-subtle text-terminal-orange",children:[ge," tools"]}),!!ye&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",title:"Estimated active duration",children:["~",jt(ye)]}),!!Re&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",title:"Estimated file edits",children:["~",Re," edits"]}),G.hasPR&&a.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-purple-subtle text-terminal-purple",title:"Session produced a PR",children:"PR"}),G.expiresInDays!=null&&G.expiresInDays<=Tn&&a.jsx("span",{className:`inline-flex items-center gap-1 text-xs font-mono px-1.5 py-0.5 rounded-md ${G.expiresInDays<=2?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-orange-subtle text-terminal-orange"}`,title:`Session transcript will be cleaned up by Claude Code in ${G.expiresInDays===0?"< 1 day":`${G.expiresInDays} day${G.expiresInDays!==1?"s":""}`}. Generate a replay to preserve it.`,children:G.expiresInDays===0?"expires today":`expires in ${G.expiresInDays}d`})]}),a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx(Eu,{provider:G.provider}),_===dt&&a.jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",title:G.project,children:Lt.get(G.project)||$a(G.project)}),tt&&a.jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:wu(tt)}),a.jsx("span",{className:"text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:ri(G.fileSize)}),G.filePaths.length>1&&a.jsxs("span",{className:"text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:[G.filePaths.length," parts"]}),(G.hasSqlite||je?.dataSource)&&a.jsx("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded-md ${zh(je?.dataSource,G.hasSqlite)}`,title:qe,children:qe})]})]},`${G.provider}-${G.slug}`)})})}),_e&&a.jsx(Bh,{session:_e,scanData:i[_e.slug]||null,onClose:()=>Z(null),onGenerate:Se,onViewReplay:G=>lt({view:null,session:G}),onArchive:G=>{se(G)},onTitleSave:Ne,onDeleteReplay:Qe,isGenerating:te===_e.slug,isArchived:V.has(_e.slug)})]})]})}function d0(){const[l,r]=y.useState([]),[i,o]=y.useState(!0),[u,m]=y.useState(!1),[p,x]=y.useState(!1),[f,g]=y.useState(null),[b,j]=y.useState(null),[T,v]=y.useState(()=>Date.now()),[N,S]=y.useState(new Set),[k,E]=y.useState(null),[M,A]=y.useState(null),[_,z]=y.useState(ci()),[B,F]=y.useState(oi()),[ee,me]=y.useState(ui()),{scanStatus:$,userInsights:I,projectInsightsCache:P,fetchProjectInsights:de}=zs();y.useEffect(()=>{B!==dt&&de(B)},[B,de]);const ce=B!==dt?P.get(B):void 0;y.useEffect(()=>{const se=()=>{F(oi()),z(ci()),me(ui())};return window.addEventListener("popstate",se),()=>window.removeEventListener("popstate",se)},[]);const pe=se=>{F(se),lt({project:se===dt?null:se})},H=se=>{z(se),lt({q:se||null},{replace:!0})},L=()=>{const se=!ee;me(se),lt({archived:se?"true":null})};y.useEffect(()=>{let se=!0;return(async()=>{o(!0),x(!1),g(null);const Se=await fetch("/api/archived").then(pt=>pt.ok?pt.json():{slugs:[]}).catch(()=>({slugs:[]}));se&&S(new Set(Se.slugs));let Qe=!1;const rt=await fetch("/api/sessions/cached").then(pt=>pt.ok?pt.json():null).catch(()=>null),Ve=Al(rt),Ue=ai(Ve?.cachedAt);if(se&&Ve&&(Qe=!0,r(Ve.sessions),m(!0),j(Ve.cachedAt??null),(Ve.sessions.length>0||Ue)&&(g(Ue?null:Ve.cachedAt??null),o(!1),x(!Ue))),Ue){se&&(x(!1),o(!1));return}try{const pt=await fetch("/api/sessions");if(!pt.ok)throw new Error("Failed to load sessions");const Lt=await pt.json();if(!se)return;r(Lt),m(!0),j(new Date().toISOString()),g(null)}catch{if(!se)return;Qe||m(!1)}finally{se&&(x(!1),o(!1))}})(),()=>{se=!1}},[]),y.useEffect(()=>{const se=window.setInterval(()=>v(Date.now()),3e4);return()=>window.clearInterval(se)},[]);const te=async se=>{const Ne=N.has(se);S(Se=>{const Qe=new Set(Se);return Ne?Qe.delete(se):Qe.add(se),Qe});try{if(!(await fetch(`/api/archive/${se}`,{method:Ne?"DELETE":"POST"})).ok)throw new Error("Archive toggle failed")}catch(Se){console.error("Archive toggle failed:",Ds(Se)),S(Qe=>{const rt=new Set(Qe);return Ne?rt.add(se):rt.delete(se),rt})}},oe=async(se,Ne)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(se)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:Ne})})).ok)throw new Error("Failed to update title");r(Qe=>Qe.map(rt=>rt.slug===se?{...rt,title:Ne||void 0}:rt))},ae=se=>{lt({view:null,session:se})},C=async se=>{E(null);try{const Ne=await fetch(`/api/sessions/${encodeURIComponent(se)}`,{method:"DELETE"});if(!Ne.ok){const Se=await Ne.json().catch(()=>({}));E(Se.error||"Failed to delete session");return}r(Se=>Se.filter(Qe=>Qe.slug!==se))}catch{E("Failed to delete session")}},O=async se=>{A(se.slug);try{const Ne=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:se.provider,sessionSlug:se.slug,sessionProject:se.project,sessionId:se.sessionId||void 0,title:se.title||void 0})}),Se=await Ne.json();if(!Ne.ok)throw new Error(Se.error||"Regeneration failed");lt({view:null,session:Se.slug})}catch(Ne){console.error("Regenerate error:",Ds(Ne))}finally{A(null)}},Z=l.filter(se=>N.has(se.slug)).length,W=ee?l:l.filter(se=>!N.has(se.slug)),V=new Map;for(const se of W)V.has(se.project)||V.set(se.project,[]),V.get(se.project)?.push(se);const fe=[...V.entries()].sort((se,Ne)=>{const Se=se[1][0]?.startTime||"";return(Ne[1][0]?.startTime||"").localeCompare(Se)}),xe=Th(fe.map(([se])=>se)),Me=B===dt?W:V.get(B)||[],Ae=_?Me.filter(se=>(se.title||"").toLowerCase().includes(_.toLowerCase())||se.slug.toLowerCase().includes(_.toLowerCase())||se.project.toLowerCase().includes(_.toLowerCase())||se.provider.toLowerCase().includes(_.toLowerCase())||(se.firstMessage||"").toLowerCase().includes(_.toLowerCase())):Me,_e=b?Nh(b,T):null,Ge=i&&l.length===0;return!Ge&&(!u||l.length===0)?a.jsx("div",{className:"flex-1 overflow-auto",children:a.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-6 space-y-6",children:[a.jsx(Vp,{}),u&&l.length===0&&a.jsxs("div",{className:"text-center py-12 space-y-2",children:[a.jsx("div",{className:"text-terminal-dim font-mono text-sm",children:"No replays yet"}),a.jsx("div",{className:"text-terminal-dimmer font-mono text-xs",children:"Go to the Sessions tab to generate your first replay"})]}),!u&&a.jsx("div",{className:"text-center py-8 space-y-2",children:a.jsxs("div",{className:"text-terminal-dimmer font-mono text-xs",children:["Or run ",a.jsx("span",{className:"text-terminal-green",children:"npx vibe-replay"})," to create a replay from your AI coding sessions"]})})]})}):a.jsxs("div",{className:"flex flex-1 min-h-0",children:[a.jsxs("div",{className:"hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20",children:[a.jsx("div",{className:"flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold",children:"Projects"}),_e&&a.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:_e})]})}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:[a.jsxs("button",{onClick:()=>pe(dt),className:`w-full text-left px-3 py-2.5 text-xs font-mono rounded-lg transition-all duration-200 ease-material flex items-center justify-between ${B===dt?"bg-terminal-green-subtle text-terminal-green shadow-layer-sm":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface"}`,children:[a.jsx("span",{className:"font-medium",children:"All replays"}),a.jsx("span",{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${B===dt?"bg-terminal-green-emphasis text-terminal-green":"bg-terminal-surface text-terminal-dimmer"}`,children:W.length})]}),a.jsx("div",{className:"h-px bg-terminal-border-subtle mx-2 my-1.5"}),fe.map(([se,Ne])=>{const Se=B===se,Qe=xe.get(se)||$a(se),rt=Ne.filter(Ve=>Ve.gist?.gistId).length;return a.jsxs("button",{onClick:()=>pe(se),title:se,className:`w-full text-left px-3 py-2.5 rounded-lg transition-all duration-200 ease-material group ${Se?"bg-terminal-green-subtle shadow-layer-sm":"hover:bg-terminal-surface"}`,children:[a.jsxs("div",{className:"flex items-center justify-between gap-1.5",children:[a.jsx("span",{className:`text-xs font-mono truncate ${Se?"text-terminal-green font-medium":"text-terminal-text group-hover:text-terminal-text"}`,children:Qe}),a.jsx("span",{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs shrink-0 ${Se?"bg-terminal-green-emphasis text-terminal-green":"bg-terminal-surface text-terminal-dimmer"}`,children:Ne.length})]}),a.jsxs("div",{className:"flex items-center gap-2 mt-1 ml-0.5",children:[a.jsx("span",{className:`text-xs font-mono truncate ${Se?"text-terminal-dim":"text-terminal-dimmer"}`,children:Ml(Ne[0]?.startTime||"")}),rt>0&&a.jsxs("span",{className:`text-xs font-mono ${Se?"text-terminal-purple":"text-terminal-dimmer"}`,children:[rt," published"]})]})]},se)})]})]}),a.jsxs("div",{className:"flex-1 flex flex-col min-h-0 min-w-0",children:[a.jsx("div",{className:"md:hidden px-3 pt-3",children:a.jsxs("select",{value:B,onChange:se=>pe(se.target.value),className:"w-full bg-terminal-surface rounded-lg px-3 py-2.5 text-sm font-mono text-terminal-text outline-none shadow-layer-sm",children:[a.jsxs("option",{value:dt,children:["All replays (",W.length,")"]}),fe.map(([se,Ne])=>a.jsxs("option",{value:se,children:[xe.get(se)||$a(se)," (",Ne.length,")"]},se))]})}),a.jsxs("div",{className:"px-4 pt-4 pb-2 space-y-3 shrink-0",children:[a.jsx("div",{className:"hidden md:block",children:ce&&B!==dt?a.jsx(ii,{insights:ce,variant:"project"}):I&&B===dt?a.jsx(ii,{insights:I,variant:"all"}):a.jsx(_h,{})}),a.jsxs("div",{className:"hidden md:flex items-center gap-2",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-terminal-dim",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[a.jsx("circle",{cx:"7",cy:"7",r:"5"}),a.jsx("path",{d:"M11 11l3.5 3.5"})]}),a.jsx("input",{value:_,onChange:se=>H(se.target.value),placeholder:"Filter replays...",className:"w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm"})]}),Z>0&&a.jsx("button",{onClick:L,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${ee?"bg-terminal-orange-subtle text-terminal-orange":"bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,title:ee?"Hide archived":`View all (${Z} archived)`,children:ee?"Active":"View all"}),a.jsx(Vp,{})]}),a.jsxs("div",{className:"md:hidden flex gap-2 items-center",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-terminal-dim",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[a.jsx("circle",{cx:"7",cy:"7",r:"5"}),a.jsx("path",{d:"M11 11l3.5 3.5"})]}),a.jsx("input",{value:_,onChange:se=>H(se.target.value),placeholder:"Filter replays...",className:"w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm"})]}),Z>0&&a.jsx("button",{onClick:L,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${ee?"bg-terminal-orange-subtle text-terminal-orange":"bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,title:ee?"Hide archived":`View all (${Z} archived)`,children:ee?"Active":"View all"})]})]}),(Ge||p||f)&&a.jsx("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue shrink-0 shadow-layer-sm",children:Ge?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),a.jsx("span",{children:"FETCHING REPLAYS..."})]}):p?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),a.jsx("span",{children:"SCANNING LATEST REPLAYS..."}),f&&a.jsxs("span",{className:"text-terminal-dim",children:["Showing stale cache (",li(f),")"]})]}):f?a.jsxs("span",{children:["Showing stale cache (",li(f),")"]}):null}),k&&a.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 bg-terminal-red-subtle rounded-lg px-3 py-2.5 text-xs font-mono text-terminal-red shrink-0 shadow-layer-sm",children:[a.jsx("span",{children:k}),a.jsx("button",{onClick:()=>E(null),className:"ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors",children:"×"})]}),$?.running&&a.jsx("div",{className:"mx-4 mb-2 shrink-0",children:a.jsx(Mh,{status:$})}),a.jsx("div",{className:"flex-1 overflow-y-auto",children:Ge?a.jsx("div",{className:"text-center py-12 text-terminal-dim font-mono text-sm",children:"Fetching replays..."}):Ae.length===0?a.jsx("div",{className:"text-center py-12 text-terminal-dim font-mono text-sm",children:_?"No replays match your filter":"No replays in this project"}):a.jsx("div",{className:"space-y-2.5 px-4 py-3",children:Ae.map(se=>{const Ne=N.has(se.slug);return a.jsx(Uh,{summary:se,onOpen:()=>ae(se.slug),onShare:()=>lt({view:null,session:se.slug,v:"export"}),onTitleSave:oe,onDelete:()=>C(se.slug),onRegenerate:()=>O(se),onArchive:()=>te(se.slug),isRegenerating:M===se.slug,isArchived:Ne},se.slug)})})})]})]})}function m0(){const{scanStatus:l}=zs();return!l?.running||!l.total?null:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse"}),a.jsxs("span",{className:"text-xs font-mono text-terminal-dim tabular-nums",children:["Scanning ",l.scanned,"/",l.total]})]})}function f0(){const l=!!window.__VIBE_REPLAY_EDITOR__,r=y.useCallback(()=>{const x=new URLSearchParams(window.location.search).get("tab");return x==="home"||x==="sessions"||x==="replays"||x==="projects"?x:l?"home":"replays"},[l]),[i,o]=y.useState(r());y.useEffect(()=>{const p=()=>o(r());return window.addEventListener("popstate",p),()=>window.removeEventListener("popstate",p)},[r]);const u=p=>{o(p),lt({tab:p,project:null,q:null,archived:null})},m=(p,x)=>a.jsx("button",{onClick:()=>u(p),className:`px-5 py-2 text-xs font-sans font-semibold rounded-lg transition-all duration-200 ease-material ${i===p?"bg-terminal-green-subtle text-terminal-green shadow-layer-sm":"text-terminal-dim hover:text-terminal-text"}`,children:x},p);return a.jsx(qb,{children:a.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[l&&a.jsxs("div",{className:"shrink-0 px-5 py-3 border-b border-terminal-border-subtle bg-terminal-surface/30 flex items-center justify-between",children:[a.jsxs("div",{className:"inline-flex items-center rounded-xl bg-terminal-surface p-0.5 shadow-layer-sm",children:[m("home","Home"),m("sessions","Sessions"),m("replays","Replays"),m("projects","Projects")]}),a.jsx(m0,{})]}),i==="home"&&l?a.jsx(a0,{onNavigate:u}):i==="projects"&&l?a.jsx(r0,{onNavigate:u}):i==="sessions"&&l?a.jsx(u0,{}):a.jsx(d0,{})]})})}function p0(l,r,i,o){const u=new Date().toISOString(),m={id:crypto.randomUUID(),sceneIndex:r,body:i,author:"anonymous",createdAt:u,updatedAt:u,resolved:!1};return[...l,m]}function h0(l,r,i){return l.map(o=>o.id===r?{...o,body:i,updatedAt:new Date().toISOString()}:o)}function x0(l,r){return l.filter(i=>i.id!==r)}function g0(l){return new Set(l.map(r=>r.sceneIndex))}function b0(l){const r=new Map;for(const i of l)r.set(i.sceneIndex,(r.get(i.sceneIndex)||0)+1);return r}function y0(l,r){return JSON.stringify(l)!==JSON.stringify(r)}function Ip(l){return l.type==="tool-call"&&!l.diff&&!l.bashOutput}function $h(l,r){const i=l[r];if(!Ip(i))return r;const o=i.toolName;let u=r;for(;u+1<l.length&&Ip(l[u+1])&&l[u+1].toolName===o;)u++;return u}function Es(l,r){return(()=>{switch(l.type){case"user-prompt":return 1200;case"thinking":return 600;case"text-response":{const o=l.content.length;return Math.max(800,Math.min(o/40,5)*600)}case"tool-call":return l.diff?1200:l.bashOutput?900:400;case"compaction-summary":return 800;case"context-injection":return 600;default:return 800}})()/r}function Rl(l){return l==="user-prompt"||l==="compaction-summary"||l==="context-injection"}function v0(l){const r=[];for(let i=0;i<l.length;i++)l[i].type==="user-prompt"&&r.push(i);return r}function j0(l,r){return l.find(i=>i>r)}function w0(l,r){for(let i=l.length-1;i>=0;i--)if(l[i]<r)return l[i]}function Vc(l,r,i){let o=r+1;if(o>=l.length)return-1;if(i.promptsOnly){for(;o<l.length&&!Rl(l[o].type);)o++;return o>=l.length?-1:o}if(i.compactAssistant&&!Rl(l[o].type)){let m=o;for(;m+1<l.length&&!Rl(l[m+1].type);)m++;return m}return $h(l,o)}function Jp(l,r,i){let o=Math.max(0,r-1);if(r<=0)return 0;if(i.promptsOnly){for(;o>0&&!Rl(l[o].type);)o--;return o}if(i.compactAssistant){if(!Rl(l[r].type)){let p=r;for(;p>0&&!Rl(l[p-1].type);)p--;return Math.max(0,p-1)}return Math.max(0,r-1)}const u=l[o];if(u.type==="tool-call"&&!u.diff&&!u.bashOutput){const m=u.toolName;for(;o>0&&l[o-1].type==="tool-call"&&!l[o-1].diff&&!l[o-1].bashOutput&&l[o-1].toolName===m;)o--}return o}const N0="vibe-replay-annotations-";function Wr(l){return N0+l}function Sn(l){const r=new URLSearchParams(window.location.search).get("session");if(!r)return l;const i=l.includes("?")?"&":"?";return`${l}${i}slug=${encodeURIComponent(r)}`}function S0(l,r="embedded"){const i=l.meta.sessionId,o=r==="editor",u=!!window.__VIBE_REPLAY_DATA__||o,[m,p]=y.useState(()=>{const O=l.annotations??[];if(o)return O;try{const Z=localStorage.getItem(Wr(i));if(Z){const W=JSON.parse(Z);if(W.length>0||O.length===0)return W}}catch{}return O}),[x,f]=y.useState(()=>l.annotations??[]),g=y0(m,x),b=y.useRef(null);y.useEffect(()=>{if(o)return b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{fetch(Sn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)}).then(()=>{f(m)}).catch(()=>{})},1e3),()=>{b.current&&clearTimeout(b.current)};try{localStorage.setItem(Wr(i),JSON.stringify(m))}catch{}},[m,i,o]);const j=y.useMemo(()=>g0(m),[m]),T=y.useMemo(()=>b0(m),[m]),v=y.useCallback((O,Z)=>{p(W=>p0(W,O,Z))},[]),N=y.useCallback((O,Z)=>{p(W=>h0(W,O,Z))},[]),S=y.useCallback(O=>{p(Z=>x0(Z,O))},[]),k=y.useCallback(()=>{if(o)return;const O={...l,annotations:m},W=`window.__VIBE_REPLAY_DATA__ = ${JSON.stringify(O).replace(/<\//g,"<\\/")};`,V=document.getElementById("vibe-replay-data");if(V){const xe=V.textContent;V.textContent=W;const Me=`<!DOCTYPE html>
|
|
63
|
-
|
|
64
|
-
${document.documentElement.outerHTML}`;document.head.removeChild(xe),fe(Me)}function fe(xe){const Me=new Blob([xe],{type:"text/html"}),Ae=URL.createObjectURL(Me),_e=document.createElement("a");_e.href=Ae,_e.download=`${l.meta.slug||"replay"}.html`,document.body.appendChild(_e),_e.click(),document.body.removeChild(_e),URL.revokeObjectURL(Ae)}f(m);try{localStorage.removeItem(Wr(i))}catch{}},[l,m,i,o]),E=y.useCallback(()=>{const O={...l,annotations:m},Z=JSON.stringify(O,null,2),W=new Blob([Z],{type:"application/json"}),V=URL.createObjectURL(W),fe=document.createElement("a");fe.href=V,fe.download="replay.json",document.body.appendChild(fe),fe.click(),document.body.removeChild(fe),URL.revokeObjectURL(V),f(m);try{localStorage.removeItem(Wr(i))}catch{}},[l,m,i]),[M,A]=y.useState(!1),_=o?async()=>{A(!0);try{await fetch(Sn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});const O=await fetch(Sn("/api/publish/gist"),{method:"POST"}),Z=await O.json();if(!O.ok)throw new Error(Z.error||`Server error: ${O.status}`);return f(m),Z}finally{A(!1)}}:null,[z,B]=y.useState([]),[F,ee]=y.useState(null),[me,$]=y.useState(!1),I=y.useRef(null),P=y.useMemo(()=>F&&z.find(O=>O.name===F)||null,[F,z]);y.useEffect(()=>{o&&fetch(Sn("/api/feedback/detect")).then(O=>O.json()).then(O=>{if(!O.available)return;const Z=Array.isArray(O.tools)?O.tools:O.tool?[O.tool]:[];B(Z);const W=O.defaultTool?.name||O.tool?.name||Z[0]?.name||null;ee(W)}).catch(()=>{})},[o]);const de=o&&F?async()=>{const O=new AbortController;I.current=O,$(!0);try{await fetch(Sn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m),signal:O.signal});const Z=await fetch(Sn("/api/feedback/generate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:F}),signal:O.signal}),W=await Z.json();if(!Z.ok)throw new Error(W.error||"AI Coach failed");return p(W.annotations),f(W.annotations),{score:W.score,itemCount:W.itemCount}}finally{I.current=null,$(!1)}}:null,ce=o?O=>{ee(O)}:null,pe=o?()=>{I.current&&I.current.abort()}:null,[H,L]=y.useState(!1),te=o?async()=>{L(!0);try{await fetch(Sn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});const O=await fetch(Sn("/api/export/html"),{method:"POST"}),Z=await O.json();if(!O.ok)throw new Error(Z.error||`Export failed: ${O.status}`);const{path:W}=Z;return f(m),W}finally{L(!1)}}:null,[oe,ae]=y.useState(!1);return{annotations:m,annotatedScenes:j,annotationCounts:T,add:v,update:N,remove:S,hasUnsaved:g,canSaveHtml:u,downloadHtml:k,downloadJson:E,publishGist:_,exportHtml:te,exportGithub:o?async()=>{ae(!0);try{await fetch(Sn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});const O=await fetch(Sn("/api/export/github"),{method:"POST"}),Z=await O.json();if(!O.ok)throw new Error(Z.error||`Export failed: ${O.status}`);return f(m),Z}finally{ae(!1)}}:null,gistPublishing:M,htmlExporting:H,githubExporting:oe,aiCoachTool:P,aiCoachTools:z,aiCoachToolName:F,setAiCoachToolName:ce,runAiCoach:de,cancelAiCoach:pe,aiCoachRunning:me}}const Kp={version:1,overlays:[]};function Cs(l){const r=new URLSearchParams(window.location.search).get("session");if(!r)return l;const i=l.includes("?")?"&":"?";return`${l}${i}slug=${encodeURIComponent(r)}`}function k0(l,r="embedded"){const i=r==="editor",[o,u]=y.useState(Kp),[m,p]=y.useState(new Set),[x,f]=y.useState(!1),[g,b]=y.useState([]),[j,T]=y.useState(null),[v,N]=y.useState(!1),[S,k]=y.useState(!1),E=y.useRef(null),M=y.useRef(null),A=y.useRef(!1);y.useEffect(()=>{i&&fetch(Cs("/api/overlays")).then(oe=>oe.json()).then(oe=>{oe&&Array.isArray(oe.overlays)&&u(oe)}).catch(()=>{}).finally(()=>{A.current=!0})},[i]),y.useEffect(()=>{i&&fetch(Cs("/api/feedback/detect")).then(oe=>oe.json()).then(oe=>{if(!oe.available)return;const ae=Array.isArray(oe.tools)?oe.tools:oe.tool?[oe.tool]:[];b(ae);const C=oe.defaultTool?.name||oe.tool?.name||ae[0]?.name||null;T(C)}).catch(()=>{})},[i]),y.useEffect(()=>{if(!(!i||!A.current))return M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{fetch(Cs("/api/overlays"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}).catch(()=>{})},1e3),()=>{M.current&&clearTimeout(M.current)}},[o,i]);const _=y.useCallback(oe=>{const ae=l.scenes[oe];if(!ae||ae.type!=="user-prompt"&&ae.type!=="text-response")return null;if(x||m.has(oe))return ae.content;const C=o.overlays.filter(Z=>Z.sceneIndex===oe);return C.length===0?ae.content:C.reduce((Z,W)=>Z.updatedAt>W.updatedAt?Z:W).modifiedValue},[l.scenes,o,m,x]),z=y.useMemo(()=>{if(o.overlays.length===0||x)return l;const oe=new Map;for(const C of o.overlays){const O=oe.get(C.sceneIndex);O?O.push(C):oe.set(C.sceneIndex,[C])}const ae=new Map;for(const[C,O]of oe){const Z=O.reduce((W,V)=>W.updatedAt>V.updatedAt?W:V);ae.set(C,Z.modifiedValue)}return ae.size===0?l:{...l,scenes:l.scenes.map((C,O)=>{if(m.has(O))return C;const Z=ae.get(O);return Z&&(C.type==="user-prompt"||C.type==="text-response")?{...C,content:Z}:C})}},[l,o,m,x]),B=y.useCallback(oe=>o.overlays.some(ae=>ae.sceneIndex===oe),[o]),F=y.useCallback(oe=>o.overlays.filter(ae=>ae.sceneIndex===oe),[o]),ee=y.useCallback(oe=>{u(oe)},[]),me=y.useCallback(oe=>{u(ae=>({...ae,overlays:ae.overlays.filter(C=>C.id!==oe)}))},[]),$=y.useCallback(oe=>{u(ae=>({...ae,overlays:ae.overlays.filter(C=>C.sceneIndex!==oe)}))},[]),I=y.useCallback(()=>{u(Kp)},[]),P=y.useCallback((oe,ae)=>{u(C=>({...C,overlays:C.overlays.map(O=>O.id===oe?{...O,modifiedValue:ae,source:{type:"manual"},updatedAt:new Date().toISOString()}:O)}))},[]),de=y.useCallback(oe=>{p(ae=>{const C=new Set(ae);return C.has(oe)?C.delete(oe):C.add(oe),C})},[]),ce=y.useCallback(()=>{f(oe=>!oe)},[]),pe=y.useMemo(()=>i?oe=>T(oe):null,[i]),H=y.useMemo(()=>i?()=>{E.current&&E.current.abort()}:null,[i]),L=y.useMemo(()=>i&&j?async oe=>{const ae=new AbortController;E.current=ae,N(!0);try{const C=await fetch(Cs("/api/studio/translate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:j,targetLang:oe.targetLang,sourceLang:oe.sourceLang}),signal:ae.signal}),O=await C.json();if(!C.ok)throw new Error(O.error||"Translation failed");return O.overlays&&u(O.overlays),O.stats}finally{E.current=null,N(!1)}}:null,[i,j]),te=y.useMemo(()=>i&&j?async oe=>{const ae=new AbortController;E.current=ae,k(!0);try{const C=await fetch(Cs("/api/studio/tone"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:j,style:oe.style}),signal:ae.signal}),O=await C.json();if(!C.ok)throw new Error(O.error||"Tone adjustment failed");return O.overlays&&u(O.overlays),O.stats}finally{E.current=null,k(!1)}}:null,[i,j]);return{overlays:o,effectiveSession:z,getEffectiveContent:_,hasOverlay:B,getOverlays:F,overlayCount:o.overlays.length,setOverlays:ee,revertOverlay:me,revertSceneOverlays:$,revertAll:I,updateOverlay:P,showOriginal:m,toggleOriginal:de,showAllOriginals:x,toggleAllOriginals:ce,studioTools:g,studioToolName:j,setStudioToolName:pe,studioToolsAvailable:g.length>0,translating:v,toningDown:S,cancelStudio:H,runTranslate:L,runTone:te}}function E0(l){const r=l;if(!r)return!1;const i=r.tagName;if(i==="INPUT"||i==="TEXTAREA"||i==="SELECT"||r.isContentEditable)return!0;const o=r.getAttribute("role");return o==="textbox"||o==="combobox"}function C0(l,r,i=!0){const[o,u]=y.useState("idle"),[m,p]=y.useState(-1),[x,f]=y.useState(1),[g,b]=y.useState(0),j=y.useRef(null),T=y.useRef(o),v=y.useRef(m),N=y.useRef(x),S=y.useRef(r);T.current=o,v.current=m,N.current=x,S.current=r;const k=y.useMemo(()=>v0(l),[l]),E=y.useCallback(()=>{j.current&&(clearTimeout(j.current),j.current=null)},[]),M=y.useCallback(()=>{if(T.current!=="playing")return;const $=Vc(l,v.current,S.current);if($===-1){u("ended"),p(l.length-1),b(l.length);return}p($),b($+1);const I=Es(l[$],N.current);j.current=setTimeout(M,I)},[l]),A=y.useCallback(()=>{l.length!==0&&(T.current==="ended"&&(p(-1),b(0)),u("playing"),setTimeout(()=>{if(v.current<0){const $=$h(l,0);p($),b($+1);const I=Es(l[$],N.current);j.current=setTimeout(M,I)}else{const $=l[v.current];if($){const I=Es($,N.current)/2;j.current=setTimeout(M,I)}}},50))},[l,M]),_=y.useCallback(()=>{E(),u("paused")},[E]),z=y.useCallback(()=>{T.current==="playing"?_():A()},[A,_]),B=y.useCallback($=>{E();const I=Math.max(0,Math.min($,l.length-1));if(p(I),b(I+1),T.current==="playing"){const P=Es(l[I],N.current);j.current=setTimeout(M,P)}(T.current==="ended"||T.current==="idle")&&u("paused")},[l,E,M]),F=y.useCallback(()=>{const $=j0(k,v.current);$!==void 0&&B($)},[k,B]),ee=y.useCallback(()=>{const $=w0(k,v.current);$!==void 0&&B($)},[k,B]),me=y.useCallback($=>{if(f($),T.current==="playing"){E();const I=l[v.current];if(I){const P=Es(I,$);j.current=setTimeout(M,P)}}},[l,E,M]);return y.useEffect(()=>E,[E]),y.useEffect(()=>{if(!i)return;const $=I=>{if(!E0(I.target))if(I.key===" "||I.key==="k")I.preventDefault(),z();else if(I.key==="ArrowDown"||I.key==="j"){T.current==="playing"&&_(),I.preventDefault();const P=Vc(l,v.current,S.current);P!==-1&&B(P)}else if(I.key==="ArrowUp"||I.key==="k"){T.current==="playing"&&_(),I.preventDefault();const P=Jp(l,v.current,S.current);B(P)}else I.key==="ArrowLeft"||I.key==="h"?(I.preventDefault(),window.dispatchEvent(new CustomEvent("vibe:toggle-expand",{detail:{action:"collapse"}}))):I.key==="Escape"?T.current==="playing"&&(I.preventDefault(),_()):I.key==="ArrowRight"||I.key==="l"?(I.preventDefault(),window.dispatchEvent(new CustomEvent("vibe:toggle-expand",{detail:{action:"expand"}}))):I.key==="n"?(I.preventDefault(),F()):I.key==="p"?(I.preventDefault(),ee()):I.key==="Home"?(I.preventDefault(),B(0)):(I.key==="End"||I.key==="e")&&(I.preventDefault(),B(l.length-1))};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[i,z,B,F,ee,l,_]),{state:o,currentIndex:m,visibleCount:g,speed:x,play:A,pause:_,togglePlayPause:z,seekTo:B,changeSpeed:me,jumpToNextUserPrompt:F,jumpToPrevUserPrompt:ee,userPromptIndices:k,totalScenes:l.length,computeNextIndex:y.useCallback($=>Vc(l,$,r),[l,r]),computePrevIndex:y.useCallback($=>Jp(l,$,r),[l,r])}}function T0(l){switch(l.displayMode){case"all":return{hideThinking:!1,collapseAllTools:!1,promptsOnly:!1,compactAssistant:!1};case"compact":return{hideThinking:!0,collapseAllTools:!0,promptsOnly:!1,compactAssistant:!0};case"custom":return{hideThinking:l.hideThinking,collapseAllTools:l.collapseAllTools,promptsOnly:l.promptsOnly,compactAssistant:!1}}}const cu="vibe-replay-view-prefs",Ic={displayMode:"compact",hideThinking:!1,collapseAllTools:!1,promptsOnly:!1};function A0(){try{const l=localStorage.getItem(cu);if(l){const r=JSON.parse(l);return r.displayMode?{...Ic,...r}:{...Ic,...r,displayMode:"compact"}}}catch{}return Ic}function R0(){const[l,r]=y.useState(A0),i=y.useCallback((u,m)=>{r(p=>{const x={...p,[u]:m};return localStorage.setItem(cu,JSON.stringify(x)),x})},[]),o=y.useCallback(u=>{r(m=>{const p=m[u];if(typeof p!="boolean")return m;const x={...m,[u]:!p};return localStorage.setItem(cu,JSON.stringify(x)),x})},[]);return{prefs:l,updatePref:i,togglePref:o}}function Pp({size:l=14}){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"})})}function M0({className:l=""}){return a.jsxs("svg",{className:`animate-spin h-3.5 w-3.5 ${l}`,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}function _0({toolName:l}){return l==="claude"?a.jsxs("div",{className:"mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1",children:[a.jsxs("p",{children:["Runs"," ",a.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"claude -p"})," ","locally with your prompt piped to stdin. Uses your existing auth and token quota."]}),a.jsxs("p",{className:"text-terminal-dimmer",children:["Auth issues? Run"," ",a.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"claude"})," ","in your terminal to re-login."]})]}):l==="agent"?a.jsxs("div",{className:"mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1",children:[a.jsxs("p",{children:["Runs"," ",a.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"agent -p"})," ","locally with your prompt piped to stdin. Uses your Cursor subscription or API key."]}),a.jsxs("p",{className:"text-terminal-dimmer",children:["Auth issues? Check Cursor IDE settings or run"," ",a.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"agent"})," ","in your terminal."]})]}):l==="opencode"?a.jsxs("div",{className:"mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1",children:[a.jsxs("p",{children:["Runs"," ",a.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"opencode run"})," ","locally with your prompt piped to stdin. Uses your existing OpenCode configuration."]}),a.jsxs("p",{className:"text-terminal-dimmer",children:["Not working? Run"," ",a.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"opencode"})," ","in your terminal to verify setup."]})]}):a.jsxs("p",{className:"mt-2 text-xs font-mono text-terminal-dim leading-relaxed",children:["Runs ",a.jsx("span",{className:"text-terminal-text font-medium",children:l})," locally on your machine using your existing auth."]})}const O0=["English","Chinese (Simplified)","Chinese (Traditional)","Japanese","Korean","Spanish","French","German","Portuguese","Russian"],D0=[{value:"professional",label:"Professional"},{value:"neutral",label:"Neutral"},{value:"friendly",label:"Friendly"}];function L0({annotationActions:l,overlayActions:r}){const{studioTools:i,studioToolName:o,setStudioToolName:u,studioToolsAvailable:m,translating:p,toningDown:x,cancelStudio:f,runTranslate:g,runTone:b,overlayCount:j,revertAll:T}=r,{runAiCoach:v,aiCoachRunning:N,cancelAiCoach:S,aiCoachTools:k,aiCoachToolName:E,setAiCoachToolName:M}=l,A=!!v,_=l.annotations.some(V=>V.author==="vibe-feedback"),[z,B]=y.useState("English"),[F,ee]=y.useState("professional"),[me,$]=y.useState(null),[I,P]=y.useState(null),[de,ce]=y.useState(null),[pe,H]=y.useState(null),L=N||p||x,te=i.length>0?i:k,oe=o||E,ae=y.useCallback(async()=>{if(v){$(null),H(null);try{const V=await v();$({type:"success",text:`Score ${V.score}/10 — ${V.itemCount} comment(s)`})}catch(V){if(V instanceof DOMException&&V.name==="AbortError")return;$({type:"error",text:V instanceof Error?V.message:"AI Coach failed"})}}},[v]),C=y.useCallback(async()=>{if(g){P(null),H(null);try{const V=await g({targetLang:z});P({type:"success",text:`${V.translated} message(s) translated, ${V.skipped} unchanged`})}catch(V){if(V instanceof DOMException&&V.name==="AbortError")return;P({type:"error",text:V instanceof Error?V.message:"Translation failed"})}}},[g,z]),O=y.useCallback(async()=>{if(b){ce(null),H(null);try{const V=await b({style:F});ce({type:"success",text:`${V.adjusted} prompt(s) adjusted, ${V.skipped} unchanged`})}catch(V){if(V instanceof DOMException&&V.name==="AbortError")return;ce({type:"error",text:V instanceof Error?V.message:"Tone adjustment failed"})}}},[b,F]),Z=V=>r.overlays.overlays.some(fe=>fe.source.type===V),W=V=>{if(V==="coach"&&_){H("coach");return}if(V==="translate"&&Z("translate")){H("translate");return}if(V==="tone"&&Z("tone")){H("tone");return}V==="coach"?ae():V==="translate"?C():O()};return!m&&k.length===0?a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"px-4 py-2.5 border-b border-terminal-border-subtle flex items-center gap-2",children:[a.jsx(Pp,{size:12}),a.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest",children:"AI Studio"})]}),a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6 py-8 text-center",children:[a.jsx("div",{className:"w-10 h-10 rounded-xl bg-terminal-surface flex items-center justify-center mb-3",children:a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-terminal-dim",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),a.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),a.jsx("div",{className:"text-sm font-sans font-semibold text-terminal-text mb-1",children:"No AI tools detected"}),a.jsx("p",{className:"text-xs font-mono text-terminal-dim mb-4 leading-relaxed",children:"AI Studio requires a local CLI tool. Install one of the following:"}),a.jsx("div",{className:"w-full space-y-2 text-left",children:[{name:"Claude Code",cmd:"npm install -g @anthropic-ai/claude-code",rec:!0},{name:"Cursor CLI",cmd:'Bundled with Cursor IDE (run as "agent")'},{name:"OpenCode",cmd:"go install github.com/opencode-ai/opencode@latest"}].map(V=>a.jsxs("div",{className:"px-3 py-2 rounded-lg bg-terminal-surface border border-terminal-border-subtle",children:[a.jsxs("div",{className:"text-xs font-sans font-medium text-terminal-text flex items-center gap-1.5",children:[V.name,V.rec&&a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-green-subtle text-terminal-green",children:"recommended"})]}),a.jsx("div",{className:"text-xs font-mono text-terminal-dim mt-0.5 break-all",children:V.cmd})]},V.name))}),a.jsxs("p",{className:"mt-4 text-xs font-mono text-terminal-dimmer leading-relaxed text-center",children:["AI Studio runs the CLI tool in headless mode,"," ",a.jsx("span",{className:"text-terminal-green font-medium",children:"locally"})," on your machine."]})]})]}):a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"px-4 py-2.5 border-b border-terminal-border-subtle flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Pp,{size:12}),a.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest",children:"AI Studio"})]}),j>0&&a.jsxs("button",{onClick:T,className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-red-subtle hover:text-terminal-red transition-colors",children:["Revert All (",j,")"]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a.jsxs("div",{className:"px-4 py-3 border-b border-terminal-border-subtle bg-terminal-surface/30",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono text-terminal-dim",children:"Tool"}),te.length>1&&u?a.jsx("select",{value:oe||"",onChange:V=>{u(V.target.value),M&&M(V.target.value)},className:"bg-terminal-surface border border-terminal-border rounded-lg px-2 py-0.5 text-xs font-mono text-terminal-text outline-none cursor-pointer hover:border-terminal-purple/30 transition-colors",children:te.map(V=>a.jsx("option",{value:V.name,children:V.name},V.name))}):a.jsx("span",{className:"text-xs font-mono font-medium text-terminal-text px-2 py-0.5 rounded-lg bg-terminal-surface border border-terminal-border",children:oe})]}),a.jsx(_0,{toolName:oe})]}),a.jsxs("div",{className:"p-4 space-y-3",children:[A&&a.jsx(Jc,{title:"AI Coach",preview:a.jsxs("div",{className:"mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden",children:[a.jsx("div",{className:"px-3 py-2.5 border-b border-terminal-border-subtle",children:a.jsx("div",{className:"text-xs font-mono text-terminal-green leading-relaxed",children:"Fix the login bug users reported"})}),a.jsxs("div",{className:"px-3 py-2 flex items-start gap-2",children:[a.jsx("span",{className:"text-xs shrink-0",children:"💬"}),a.jsx("span",{className:"text-xs font-mono text-terminal-blue leading-relaxed",children:"Be specific — which file? what error?"})]}),a.jsxs("div",{className:"px-3 py-2 border-t border-terminal-border-subtle flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-mono font-semibold text-terminal-orange",children:"6/10"}),a.jsxs("span",{className:"text-xs font-mono text-terminal-dimmer",children:["·"," 4 comments added inline"]})]})]}),description:"Score your prompting technique and get inline coaching comments.",running:N,disabled:L,status:me,buttonLabel:_?"Re-run Coach":"Run Coach",runningLabel:"Analyzing...",onRun:()=>W("coach"),onCancel:S||void 0,showRerunConfirm:pe==="coach",rerunWarning:"Existing AI feedback will be replaced.",onConfirmRerun:()=>void ae(),onCancelRerun:()=>H(null)}),g&&a.jsx(Jc,{title:"Translate",preview:a.jsxs("div",{className:"mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden",children:[a.jsxs("div",{className:"px-3 py-2.5 space-y-1",children:[a.jsx("div",{className:"text-xs font-mono text-terminal-dim line-through opacity-60",children:"这个bug怎么修?"}),a.jsx("div",{className:"text-xs font-mono text-terminal-green",children:"How to fix this bug?"})]}),a.jsxs("div",{className:"px-3 py-2.5 border-t border-terminal-border-subtle space-y-1",children:[a.jsx("div",{className:"text-xs font-mono text-terminal-dim line-through opacity-60",children:"已写入。以后用中文问我..."}),a.jsx("div",{className:"text-xs font-mono text-terminal-blue",children:"Done. Ask me in Chinese..."})]})]}),description:"Translate all prompts and responses for sharing with international teams.",running:p,disabled:L,status:I,buttonLabel:Z("translate")?"Re-translate":"Translate All",runningLabel:"Translating...",onRun:()=>W("translate"),onCancel:f||void 0,showRerunConfirm:pe==="translate",rerunWarning:"Existing translations will be replaced.",onConfirmRerun:()=>void C(),onCancelRerun:()=>H(null),config:a.jsxs("div",{className:"flex items-center gap-2 mt-2.5",children:[a.jsx("span",{className:"text-xs font-mono text-terminal-dim shrink-0",children:"Target"}),a.jsx("select",{value:z,onChange:V=>B(V.target.value),disabled:L,className:"flex-1 bg-terminal-surface border border-terminal-border rounded px-2 py-1 text-xs font-mono text-terminal-text outline-none disabled:opacity-50",children:O0.map(V=>a.jsx("option",{value:V,children:V},V))})]})}),b&&a.jsx(Jc,{title:"Soften Tone",preview:a.jsxs("div",{className:"mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden",children:[a.jsxs("div",{className:"px-3 py-2.5 space-y-1",children:[a.jsx("div",{className:"text-xs font-mono text-terminal-red line-through opacity-60",children:"this code is mass garbage, mass delete it"}),a.jsx("div",{className:"text-xs font-mono text-terminal-green",children:"Let's refactor this module for clarity"})]}),a.jsxs("div",{className:"px-3 py-2.5 border-t border-terminal-border-subtle space-y-1",children:[a.jsx("div",{className:"text-xs font-mono text-terminal-red line-through opacity-60",children:"are you stupid? I said fix the auth"}),a.jsx("div",{className:"text-xs font-mono text-terminal-green",children:"The auth issue is still present, could you revisit?"})]})]}),description:"Rewrite harsh or blunt prompts into professional, constructive language.",running:x,disabled:L,status:de,buttonLabel:Z("tone")?"Re-adjust":"Soften All",runningLabel:"Adjusting...",onRun:()=>W("tone"),onCancel:f||void 0,showRerunConfirm:pe==="tone",rerunWarning:"Existing tone adjustments will be replaced.",onConfirmRerun:()=>void O(),onCancelRerun:()=>H(null),config:a.jsxs("div",{className:"flex items-center gap-2 mt-2.5",children:[a.jsx("span",{className:"text-xs font-mono text-terminal-dim shrink-0",children:"Style"}),a.jsx("select",{value:F,onChange:V=>ee(V.target.value),disabled:L,className:"flex-1 bg-terminal-surface border border-terminal-border rounded px-2 py-1 text-xs font-mono text-terminal-text outline-none disabled:opacity-50",children:D0.map(V=>a.jsx("option",{value:V.value,children:V.label},V.value))})]})})]})]})]})}function Jc({title:l,preview:r,description:i,running:o,disabled:u,status:m,buttonLabel:p,runningLabel:x,onRun:f,onCancel:g,showRerunConfirm:b,rerunWarning:j,onConfirmRerun:T,onCancelRerun:v,config:N}){return a.jsxs("div",{className:"rounded-xl border border-terminal-border-subtle bg-terminal-surface/30 overflow-hidden",children:[a.jsxs("div",{className:"px-4 py-3",children:[a.jsx("div",{className:"text-sm font-sans font-semibold text-terminal-text",children:l}),r,i&&a.jsx("div",{className:"text-xs font-mono text-terminal-dim mt-2 leading-relaxed",children:i}),N,a.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[a.jsx("button",{onClick:f,disabled:u,className:"px-3.5 py-1.5 text-xs font-mono rounded-lg bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-purple-emphasis transition-colors disabled:opacity-40 flex items-center gap-1.5",children:o?a.jsxs(a.Fragment,{children:[a.jsx(M0,{className:"text-terminal-purple"}),x]}):p}),o&&g&&a.jsx("button",{onClick:g,className:"text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"})]})]}),b&&!o&&a.jsx("div",{className:"px-4 pb-3",children:a.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[a.jsx("span",{className:"text-terminal-orange flex-1",children:j}),a.jsx("button",{onClick:v,className:"text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"}),a.jsx("button",{onClick:T,className:"text-terminal-purple hover:text-terminal-text transition-colors font-medium",children:"Continue"})]})}),m&&a.jsx("div",{className:`px-4 pb-3 text-xs font-mono ${m.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:m.text})]})}function z0({open:l,onClose:r,annotationActions:i,overlayActions:o}){return y.useEffect(()=>{if(!l)return;const u=m=>{m.key==="Escape"&&(m.preventDefault(),r())};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[l,r]),a.jsxs("div",{className:`fixed inset-0 z-30 hidden md:block transition-opacity duration-300 ${l?"opacity-100":"opacity-0 pointer-events-none"}`,children:[a.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:r}),a.jsxs("div",{className:`absolute top-0 right-0 bottom-0 w-96 bg-terminal-bg border-l border-terminal-border-subtle shadow-layer-xl flex flex-col transition-transform duration-300 ease-material-decel ${l?"translate-x-0":"translate-x-full"}`,onClick:u=>u.stopPropagation(),children:[a.jsx("button",{onClick:r,className:"absolute top-2 right-2 z-10 p-1 text-terminal-dim hover:text-terminal-text transition-colors",title:"Close AI Studio",children:"✕"}),a.jsx(L0,{annotationActions:i,overlayActions:o})]})]})}function Cu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ga=Cu();function Hh(l){Ga=l}var Ua={exec:()=>null};function He(l,r=""){let i=typeof l=="string"?l:l.source,o={replace:(u,m)=>{let p=typeof m=="string"?m:m.source;return p=p.replace(Dt.caret,"$1"),i=i.replace(u,p),o},getRegex:()=>new RegExp(i,r)};return o}var B0=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Dt={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,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ 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,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}#`),htmlBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}>`)},U0=/^(?:[ \t]*(?:\n|$))+/,$0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,H0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Bs=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,G0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Tu=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Gh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,qh=He(Gh).replace(/bull/g,Tu).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(),q0=He(Gh).replace(/bull/g,Tu).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(),Au=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Y0=/^[^\n]+/,Ru=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,F0=He(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ru).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Z0=He(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Tu).getRegex(),yi="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",Mu=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,X0=He("^ {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",Mu).replace("tag",yi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Yh=He(Au).replace("hr",Bs).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[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yi).getRegex(),Q0=He(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Yh).getRegex(),_u={blockquote:Q0,code:$0,def:F0,fences:H0,heading:G0,hr:Bs,html:X0,lheading:qh,list:Z0,newline:U0,paragraph:Yh,table:Ua,text:Y0},Wp=He("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Bs).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[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yi).getRegex(),V0={..._u,lheading:q0,table:Wp,paragraph:He(Au).replace("hr",Bs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Wp).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yi).getRegex()},I0={..._u,html:He(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Mu).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:Ua,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:He(Au).replace("hr",Bs).replace("heading",` *#{1,6} *[^
|
|
65
|
-
]`).replace("lheading",qh).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},J0=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,K0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Fh=/^( {2,}|\\)\n(?!\s*$)/,P0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,vi=/[\p{P}\p{S}]/u,Ou=/[\s\p{P}\p{S}]/u,Zh=/[^\s\p{P}\p{S}]/u,W0=He(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ou).getRegex(),Xh=/(?!~)[\p{P}\p{S}]/u,ey=/(?!~)[\s\p{P}\p{S}]/u,ty=/(?:[^\s\p{P}\p{S}]|~)/u,Qh=/(?![*_])[\p{P}\p{S}]/u,ny=/(?![*_])[\s\p{P}\p{S}]/u,ay=/(?:[^\s\p{P}\p{S}]|[*_])/u,ly=He(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",B0?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Vh=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,sy=He(Vh,"u").replace(/punct/g,vi).getRegex(),ry=He(Vh,"u").replace(/punct/g,Xh).getRegex(),Ih="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",iy=He(Ih,"gu").replace(/notPunctSpace/g,Zh).replace(/punctSpace/g,Ou).replace(/punct/g,vi).getRegex(),oy=He(Ih,"gu").replace(/notPunctSpace/g,ty).replace(/punctSpace/g,ey).replace(/punct/g,Xh).getRegex(),cy=He("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Zh).replace(/punctSpace/g,Ou).replace(/punct/g,vi).getRegex(),uy=He(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Qh).getRegex(),dy="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",my=He(dy,"gu").replace(/notPunctSpace/g,ay).replace(/punctSpace/g,ny).replace(/punct/g,Qh).getRegex(),fy=He(/\\(punct)/,"gu").replace(/punct/g,vi).getRegex(),py=He(/^<(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(),hy=He(Mu).replace("(?:-->|$)","-->").getRegex(),xy=He("^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",hy).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),di=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,gy=He(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",di).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Jh=He(/^!?\[(label)\]\[(ref)\]/).replace("label",di).replace("ref",Ru).getRegex(),Kh=He(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ru).getRegex(),by=He("reflink|nolink(?!\\()","g").replace("reflink",Jh).replace("nolink",Kh).getRegex(),eh=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Du={_backpedal:Ua,anyPunctuation:fy,autolink:py,blockSkip:ly,br:Fh,code:K0,del:Ua,delLDelim:Ua,delRDelim:Ua,emStrongLDelim:sy,emStrongRDelimAst:iy,emStrongRDelimUnd:cy,escape:J0,link:gy,nolink:Kh,punctuation:W0,reflink:Jh,reflinkSearch:by,tag:xy,text:P0,url:Ua},yy={...Du,link:He(/^!?\[(label)\]\((.*?)\)/).replace("label",di).getRegex(),reflink:He(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",di).getRegex()},uu={...Du,emStrongRDelimAst:oy,emStrongLDelim:ry,delLDelim:uy,delRDelim:my,url:He(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",eh).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\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:He(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",eh).getRegex()},vy={...uu,br:He(Fh).replace("{2,}","*").getRegex(),text:He(uu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ei={normal:_u,gfm:V0,pedantic:I0},Ts={normal:Du,gfm:uu,breaks:vy,pedantic:yy},jy={"&":"&","<":"<",">":">",'"':""","'":"'"},th=l=>jy[l];function kn(l,r){if(r){if(Dt.escapeTest.test(l))return l.replace(Dt.escapeReplace,th)}else if(Dt.escapeTestNoEncode.test(l))return l.replace(Dt.escapeReplaceNoEncode,th);return l}function nh(l){try{l=encodeURI(l).replace(Dt.percentDecode,"%")}catch{return null}return l}function ah(l,r){let i=l.replace(Dt.findPipe,(m,p,x)=>{let f=!1,g=p;for(;--g>=0&&x[g]==="\\";)f=!f;return f?"|":" |"}),o=i.split(Dt.splitPipe),u=0;if(o[0].trim()||o.shift(),o.length>0&&!o.at(-1)?.trim()&&o.pop(),r)if(o.length>r)o.splice(r);else for(;o.length<r;)o.push("");for(;u<o.length;u++)o[u]=o[u].trim().replace(Dt.slashPipe,"|");return o}function As(l,r,i){let o=l.length;if(o===0)return"";let u=0;for(;u<o&&l.charAt(o-u-1)===r;)u++;return l.slice(0,o-u)}function wy(l,r){if(l.indexOf(r[1])===-1)return-1;let i=0;for(let o=0;o<l.length;o++)if(l[o]==="\\")o++;else if(l[o]===r[0])i++;else if(l[o]===r[1]&&(i--,i<0))return o;return i>0?-2:-1}function Ny(l,r=0){let i=r,o="";for(let u of l)if(u===" "){let m=4-i%4;o+=" ".repeat(m),i+=m}else o+=u,i++;return o}function lh(l,r,i,o,u){let m=r.href,p=r.title||null,x=l[1].replace(u.other.outputLinkReplace,"$1");o.state.inLink=!0;let f={type:l[0].charAt(0)==="!"?"image":"link",raw:i,href:m,title:p,text:x,tokens:o.inlineTokens(x)};return o.state.inLink=!1,f}function Sy(l,r,i){let o=l.match(i.other.indentCodeCompensation);if(o===null)return r;let u=o[1];return r.split(`
|
|
66
|
-
|
|
67
|
-
`)}var mi=class{options;rules;lexer;constructor(l){this.options=l||Ga}space(l){let r=this.rules.block.newline.exec(l);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(l){let r=this.rules.block.code.exec(l);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:As(i,`
|
|
68
|
-
`)}}}
|
|
69
|
-
`)
|
|
60
|
+
`).trim()}function Kp(l){const r=l.trim();return/^\[Previous conversation summary\]:/i.test(r)||/^Summary:\s*1\.\s*Primary Request and Intent:/i.test(r)||/^and merge infrastructure was built for human-paced output/i.test(r)}function Yl(l){if(Vb(l)||Kp(l))return"";const r=/Last login:|Logged in to github\.com|Git operations protocol:|(?:➜|❯)\s+/i.test(l);let i=Xb(Qb(l));return/<attached_files>|<code_selection\b/i.test(i)||(i=i.replace(/<\/?[a-z][^>]*>/gi,""),i=i.replace(/^\s*\d+\|\s*/gm,""),i=i.replace(/Caveat:\s*The messages below were generated by the user while running local commands\.[^.]*/g,""),i=i.replace(/DO NOT respond to these messages[^.]*/g,""),i=i.replace(/!\[AI Session:[^\]]*]\([^)]+\)/gi,""),i=i.replace(/###\s*AI Coding Session[^\n]*/gi,""),i=i.replace(/\d+\s+prompts?,\s+\d+\s+tools?,[^\n]*/gi,""),i=i.replace(/^\/\w+\s*/g,""),i=i.replace(/\s+/g," ").trim(),!i||Kp(i))||r&&/^[a-z0-9._:-]{1,12}$/i.test(i)?"":i}function _h(l){const r=l.title?kt(Yl(l.title)):"";if(r)return r;const i=[...l.prompts||[],l.firstPrompt];for(const o of i){const u=kt(Yl(o||""));if(u)return u}return l.slug}function _u(l){const r=_h(l);if(l.replay?.title){const i=kt(l.replay.title);if(i)return i}return r}function mu(l,r){const i=_h(l),o=kt(l.replay?.title),u=kt(Yl(r?.title||""));return u||(i&&i!==l.slug?i:o||i)}function fu(l){const r=kt(l.title);if(r)return r;const i=kt(l.firstMessage);if(i)return i;const o=kt(l.messages?.[0]);return o||l.slug}function ht(l,r={}){const i=new URL(window.location.href),o=["tab","project","q","archived"];if(i.searchParams.get("view")==="dashboard"||!i.searchParams.has("session")&&!i.searchParams.has("gist")&&!i.searchParams.has("url")){const g={};o.forEach(f=>{const x=i.searchParams.get(f);x&&(g[f]=x)}),Object.keys(g).length>0?sessionStorage.setItem("vibe_dashboard_state",JSON.stringify(g)):sessionStorage.removeItem("vibe_dashboard_state")}if(l.session&&(o.forEach(g=>{l[g]===void 0&&i.searchParams.delete(g)}),l.view===void 0&&i.searchParams.delete("view")),l.view==="dashboard"||l.session===null&&!l.view){const g=sessionStorage.getItem("vibe_dashboard_state");if(g)try{const f=JSON.parse(g);Object.entries(f).forEach(([x,h])=>{l[x]===void 0&&!i.searchParams.has(x)&&i.searchParams.set(x,h)})}catch(f){console.error("Failed to restore dashboard state",f)}i.searchParams.delete("v"),i.searchParams.delete("s")}for(const[g,f]of Object.entries(l))f===null?i.searchParams.delete(g):i.searchParams.set(g,f);const p=i.toString()!==window.location.href;r.replace?window.history.replaceState({},"",i.toString()):window.history.pushState({},"",i.toString()),!r.replace&&p&&window.dispatchEvent(new PopStateEvent("popstate"))}const Ib={"claude-code":"bg-terminal-orange-subtle text-terminal-orange",cursor:"bg-terminal-blue-subtle text-terminal-blue"};function Oh(l){return l==="claude-code"?"Claude":l==="cursor"?"Cursor":l}function Lh(l){return Ib[l]||"bg-terminal-surface text-terminal-dim"}async function zh(l,r,i){const o=r.has(l);i(u=>{const m=new Set(u);return o?m.delete(l):m.add(l),m});try{if(!(await fetch(`/api/archive/${l}`,{method:o?"DELETE":"POST"})).ok)throw new Error("Archive toggle failed")}catch(u){console.error("Archive toggle failed:",gi(u)),i(m=>{const p=new Set(m);return o?p.add(l):p.delete(l),p})}}function gi(l){return l instanceof Error?l.message:typeof l=="string"?l:"Unknown error"}function Jb(l){const r=Ou(l);if(r)return r;const i=26;if(l.length<=i)return l;const o=l.split("/");if(o.length<=2)return l;const u=o[0],m=o.slice(-2).join("/"),p=`${u}/…/${m}`;if(p.length<=i)return p;const g=o[o.length-1];return`${u}/…/${g}`}function Bh(l){const r=new Map;for(const i of l)r.set(i,Ou(i)||Jb(i));return r}function pu(l,r){return r==="sqlite"?l?"SQLite + JSONL supplement":"SQLite":r==="global-state"?"Cursor global state":r==="jsonl"?l?"JSONL fallback":"JSONL transcript":l?"SQLite + JSONL":"JSONL"}function Ou(l){const r=l.replace(/\/$/,"");return r?r==="(globalStorage)"?"Cursor Global Storage":r==="~"?"Home":/\/\.cursor\/projects\/.+\/terminals$/.test(r)?"Cursor Terminals":/\/\.cursor\/extensions\//.test(r)?"Cursor Extension":null:null}const pt="__all__";function Pp(){return new URLSearchParams(window.location.search).get("project")||pt}function Wp(){return new URLSearchParams(window.location.search).get("q")||""}function eh(){return new URLSearchParams(window.location.search).get("archived")==="true"}function $h(){const[l,r]=y.useState(Pp),[i,o]=y.useState(Wp),[u,m]=y.useState(eh);return y.useEffect(()=>{const x=()=>{r(Pp()),o(Wp()),m(eh())};return window.addEventListener("popstate",x),()=>window.removeEventListener("popstate",x)},[]),{selectedProject:l,filter:i,showArchived:u,handleProjectChange:x=>{r(x),ht({project:x===pt?null:x})},handleFilterChange:x=>{o(x),ht({q:x||null},{replace:!0})},handleToggleArchived:()=>{const x=!u;m(x),ht({archived:x?"true":null})}}}function Kb(l,r=450){const[i,o]=y.useState(l),u=y.useRef(l);return y.useEffect(()=>{const m=u.current,p=l-m;if(Math.abs(p)<1){u.current=l,o(l);return}let g=0;const f=performance.now(),x=h=>{const v=Math.min(1,(h-f)/r),C=1-(1-v)**3,j=m+p*C;u.current=j,o(j),v<1?g=requestAnimationFrame(x):(u.current=l,o(l))};return g=requestAnimationFrame(x),()=>cancelAnimationFrame(g)},[l,r]),i}function yn({value:l,durationMs:r,formatter:i=o=>Math.round(o).toLocaleString()}){const o=Kb(l,r);return n.jsx(n.Fragment,{children:i(o)})}var Pb=Mh();function Uh(l){const r=[...l.dataSourceInfo?.notes||[]];return l.provider==="cursor"&&(l.dataSource==="sqlite"||l.dataSource==="global-state")&&r.unshift("Some Cursor metrics are best-effort estimates and may be incomplete."),l.stats.tokenUsage||r.push("Token and cost metrics may be unavailable."),[...new Set(r)]}function Wb(l){const r=Uh(l);return{duration:r.find(i=>/duration/i.test(i)),tokens:r.find(i=>/token|cost|model attribution/i.test(i)),turnStats:r.find(i=>/per-turn|turn stats|turn metrics/i.test(i))}}function Ea({title:l,className:r=""}){const[i,o]=y.useState(!1),[u,m]=y.useState(!1),[p,g]=y.useState(null),f=y.useRef(null),x=l.split(`
|
|
61
|
+
`).map(v=>v.trim()).filter(Boolean),h=i||u;return y.useEffect(()=>{if(!h)return;const v=()=>{const C=f.current?.getBoundingClientRect();if(!C)return;const j=288,w=16,S=56+x.length*20,k=Math.min(Math.max(C.left+C.width/2-j/2,w),window.innerWidth-j-w),E=C.bottom+8,M=E+S>window.innerHeight-w?Math.max(w,C.top-S-8):E;g({left:k,top:M})};return v(),window.addEventListener("resize",v),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",v),window.removeEventListener("scroll",v,!0)}},[h,x.length]),y.useEffect(()=>{if(!i)return;const v=j=>{f.current?.contains(j.target)||o(!1)},C=j=>{j.key==="Escape"&&o(!1)};return window.addEventListener("pointerdown",v),window.addEventListener("keydown",C),()=>{window.removeEventListener("pointerdown",v),window.removeEventListener("keydown",C)}},[i]),n.jsxs("span",{ref:f,className:`inline-flex ${r}`,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),children:[n.jsx("button",{type:"button","aria-expanded":i,"aria-label":"Show data quality details",className:"inline-flex h-4 min-w-4 items-center justify-center rounded-full border border-terminal-orange/40 bg-terminal-orange/10 px-1 text-[10px] font-sans font-bold leading-none text-terminal-orange transition-colors hover:border-terminal-orange/70 hover:bg-terminal-orange/15 focus:outline-none focus:ring-2 focus:ring-terminal-orange/30",onClick:()=>o(v=>!v),onFocus:()=>m(!0),onBlur:()=>m(!1),children:"!"}),h&&p?Pb.createPortal(n.jsxs("div",{className:"pointer-events-none fixed z-[120] w-72 max-w-[calc(100vw-2rem)] rounded-xl border border-terminal-border-subtle bg-terminal-surface-2 px-3 py-2.5 text-left shadow-layer-xl",style:p,children:[n.jsx("div",{className:"mb-1 text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-orange",children:"Data Quality"}),n.jsx("div",{className:"space-y-1",children:x.map(v=>n.jsx("div",{className:"text-[11px] font-mono leading-relaxed text-terminal-dim",children:v},v))})]}),document.body):null]})}function Ul({label:l,value:r,color:i}){const o=typeof r=="number";return n.jsxs("div",{className:"bg-terminal-surface rounded-xl px-3 py-3 shadow-layer-sm",children:[n.jsx("div",{className:`text-xl font-bold ${o?"tabular-nums":"truncate w-full"} ${i}`,title:typeof r=="string"?r:void 0,children:r}),n.jsx("div",{className:"text-terminal-dimmer text-[10px] font-sans font-medium uppercase tracking-widest mt-0.5",children:l})]})}function Ht(l){return l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:l.toString()}function vt(l){if(!l)return"";const r=Math.floor(l/1e3);if(r<60)return`${r}s`;const i=Math.floor(r/60);return i<60?`${i}m ${r%60}s`:`${Math.floor(i/60)}h ${i%60}m`}const Hh=y.createContext(null);function Fl(){const l=y.useContext(Hh);if(!l)throw new Error("useScanInsightsContext must be used within ScanInsightsProvider");return l}function e0({children:l}){const[r,i]=y.useState(null),[o,u]=y.useState(null),[m]=y.useState(()=>new Map),p=y.useRef(!1),[,g]=y.useState(0),[f,x]=y.useState(!1),h=y.useRef(!1);y.useEffect(()=>{let j=!1,w;const S=()=>{j||fetch("/api/scan/start",{method:"POST"}).catch(()=>{})};return(async()=>{try{const E=await fetch("/api/scan/status");if(!E.ok||j)return;const M=await E.json();if(i(M),M.running)return;if(!M.hasCachedResults||!Xs(M.cachedAt,du)){S();return}const A=Date.now()-new Date(M.cachedAt).getTime(),R=Math.max(1e3,du-A);w=window.setTimeout(S,R)}catch{S()}})(),()=>{j=!0,w&&window.clearTimeout(w)}},[]),y.useEffect(()=>{let j=!1;const w=async()=>{try{const E=await fetch("/api/scan/status");if(!E.ok||j)return null;const M=await E.json();return i(M),M}catch{return null}},S=async()=>{x(!0);try{const E=await fetch("/api/insights");if(E.ok){const M=await E.json();M.type==="user"&&!j&&u(M.insights)}}catch{}finally{j||x(!1)}};w().then(E=>{E?.hasInsights&&!h.current&&(h.current=!0,S())});const k=setInterval(async()=>{const E=await w();!E||j||(E.hasInsights&&!h.current&&(h.current=!0,S()),!E.running&&E.finishedAt&&(E.resultCount>0&&(p.current=!0,S(),g(M=>(queueMicrotask(()=>{p.current=!1}),M+1))),clearInterval(k)))},2e3);return()=>{j=!0,clearInterval(k)}},[]);const v=y.useCallback(j=>{m.has(j)&&!p.current||(x(!0),fetch(`/api/insights?project=${encodeURIComponent(j)}`).then(w=>w.ok?w.json():null).then(w=>{w?.type==="project"&&(m.set(j,w.insights),g(S=>S+1))}).catch(()=>{}).finally(()=>x(!1)))},[m]),C=y.useMemo(()=>({scanStatus:r,userInsights:o,projectInsightsCache:m,fetchProjectInsights:v,loading:f}),[r,o,m,v,f]);return n.jsx(Hh.Provider,{value:C,children:l})}function Gh(){return n.jsxs("div",{className:"border-b border-terminal-border-subtle pb-3 animate-pulse",children:[n.jsxs("div",{className:"flex items-center justify-between gap-3 mb-2",children:[n.jsxs("div",{className:"flex items-baseline gap-3 min-w-0",children:[n.jsx("div",{className:"h-5 w-36 skeleton rounded"}),n.jsx("div",{className:"h-3 w-24 skeleton rounded opacity-40"})]}),n.jsx("div",{className:"h-3.5 w-24 skeleton rounded opacity-40"})]}),n.jsxs("div",{className:"flex items-center gap-5",children:[[16,14,10,12].map((l,r)=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"h-3.5 skeleton rounded",style:{width:`${l*4}px`}}),n.jsx("div",{className:"h-2.5 w-10 skeleton rounded opacity-40"})]},r)),n.jsx("div",{className:"flex-1"}),n.jsx("div",{className:"flex items-end gap-px h-4",children:Array.from({length:30},(l,r)=>n.jsx("div",{className:"w-1 rounded-sm skeleton",style:{height:`${Math.max(2,Math.random()*16)}px`,opacity:.15}},r))})]})]})}function bi({insights:l,variant:r}){const[i,o]=y.useState(!1),[u,m]=y.useState(!1),p=r==="project",g=p?"text-terminal-green":"text-terminal-purple",f=p?"bg-terminal-green":"bg-terminal-purple",x=p?l:null,h=p?null:l,v=x?.sessionCount??h?.totalSessions??0,C=x?.totalDurationMs??h?.totalDurationMs??0,j=x?.totalCost??h?.totalCost??0,w=x?.totalPrompts??h?.totalPrompts??0,S=x?.totalToolCalls??h?.totalToolCalls??0,k=x?.totalEdits??h?.totalEdits??0,E=x?.models??h?.models??{},M=x?.avgSessionDurationMs??h?.avgSessionDurationMs??0,A=x?.sessionsPerDay??h?.sessionsPerDay??{},R=x?.dataQuality?.notes??h?.dataQuality?.notes??[],O=x?.timeRange??h?.timeRange,$=x?x.project.split("/").pop()||x.project:"All Projects",H=x?x.project:`${h?.totalProjects??0} projects`;if(v===0)return null;const K=Object.entries(E).sort(([,te],[,xe])=>xe-te),ae=K.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5",children:"Models"}),n.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:K.map(([te,xe])=>n.jsxs("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",title:te,children:[Ci(te)," ",n.jsxs("span",{className:"text-terminal-dimmer",children:[xe,"x"]})]},te))})]}),ue={month:"short",day:"numeric",year:"numeric"},oe=O&&n.jsxs("div",{className:"text-xs font-mono text-terminal-dimmer",children:["Active"," ",n.jsx("span",{className:"text-terminal-dim",children:new Date(O.first).toLocaleDateString("en-US",ue)})," — ",n.jsx("span",{className:"text-terminal-dim",children:new Date(O.last).toLocaleDateString("en-US",ue)})]});return n.jsxs("div",{className:"border-b border-terminal-border-subtle pb-3",children:[n.jsxs("div",{className:"flex items-center justify-between gap-3 mb-1.5",children:[n.jsxs("div",{className:"flex items-baseline gap-2 min-w-0",children:[n.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${f} shrink-0 self-center`}),n.jsx("h2",{className:"text-base font-sans font-semibold text-terminal-text truncate",children:$}),R.length>0&&n.jsx(Ea,{title:R.join(`
|
|
62
|
+
`),className:"shrink-0"}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer truncate hidden sm:inline",children:H})]}),n.jsxs("button",{onClick:()=>o(te=>!te),className:`flex items-center gap-1.5 text-xs font-mono tabular-nums shrink-0 hover:text-terminal-text transition-colors ${g}`,children:[v," session",v!==1?"s":"",n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:`transition-transform duration-200 ${i?"rotate-180":""}`,children:n.jsx("path",{d:"M3 4.5l3 3 3-3"})})]})]}),n.jsxs("div",{className:"flex items-center gap-4 flex-wrap text-xs font-mono",children:[n.jsxs("span",{className:"text-terminal-blue tabular-nums",children:[vt(C),n.jsx("span",{className:"text-terminal-dimmer ml-1 text-[10px]",children:"duration"})]}),j>0&&n.jsxs("span",{className:"text-terminal-orange tabular-nums",children:["$",j.toFixed(2),n.jsx("span",{className:"text-terminal-dimmer ml-1 text-[10px]",children:"cost"})]}),n.jsxs("span",{className:"text-terminal-green tabular-nums",children:[Wc(w),n.jsx("span",{className:"text-terminal-dimmer ml-1 text-[10px]",children:"prompts"})]}),n.jsxs("span",{className:"text-terminal-text tabular-nums",children:[Wc(S),n.jsx("span",{className:"text-terminal-dimmer ml-1 text-[10px]",children:"tools"})]}),k>0&&n.jsxs("span",{className:"text-terminal-purple tabular-nums",children:[Wc(k),n.jsx("span",{className:"text-terminal-dimmer ml-1 text-[10px]",children:"edits"})]}),n.jsxs("span",{className:"text-terminal-dimmer text-[10px] tabular-nums hidden lg:inline",children:["avg ",vt(M),"/session"]}),n.jsx("div",{className:"flex-1 flex justify-end",children:n.jsx("div",{className:"flex items-end gap-px h-3.5",children:(()=>{const te=new Date,xe=new Date(te);xe.setDate(xe.getDate()-29);const de=[],pe=new Date(xe);for(;pe<=te;){const z=pe.toISOString().slice(0,10);de.push({day:z,count:A[z]||0}),pe.setDate(pe.getDate()+1)}const U=Math.max(...de.map(z=>z.count),1);return de.map(z=>n.jsx("div",{title:`${z.day}: ${z.count}`,className:`w-1 rounded-sm ${z.count>0?f:"bg-terminal-surface-2"}`,style:{height:z.count>0?`${Math.max(15,z.count/U*100)}%`:"2px",opacity:z.count>0?.35+z.count/U*.65:.15}},z.day))})()})})]}),i&&x&&n.jsxs("div",{className:"mt-3 pt-3 border-t border-terminal-border-subtle space-y-3",children:[x.branches.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5",children:["Branches (",x.branches.length,")"]}),n.jsx("div",{className:"space-y-0.5 max-h-32 overflow-y-auto",children:x.branches.slice(0,15).map(te=>n.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[n.jsx("span",{className:"font-mono text-terminal-purple truncate",children:te.branch}),n.jsxs("span",{className:"text-terminal-dimmer tabular-nums shrink-0",children:[te.sessionIds.length,"x"]}),te.prLinks?.map(xe=>n.jsxs("a",{href:xe.prUrl,target:"_blank",rel:"noopener noreferrer",className:"text-terminal-blue hover:underline shrink-0",children:["#",xe.prNumber]},xe.prUrl))]},te.branch))})]}),x.hotFiles.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5",children:"Most modified files"}),n.jsx("div",{className:"space-y-0.5 max-h-28 overflow-y-auto",children:x.hotFiles.slice(0,10).map(te=>n.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[n.jsx("span",{className:"font-mono text-terminal-dim truncate flex-1",children:te.file}),n.jsxs("span",{className:"text-terminal-dimmer tabular-nums shrink-0",children:[te.editCount,"x / ",te.sessionCount,"s"]})]},te.file))})]}),ae,oe,x.memory&&x.memory.memoryFiles.length>0&&n.jsxs("div",{children:[n.jsxs("button",{onClick:()=>m(te=>!te),className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5 flex items-center gap-1 hover:text-terminal-dim transition-colors",children:[n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:`transition-transform duration-200 ${u?"rotate-90":""}`,children:n.jsx("path",{d:"M4.5 2l4 4-4 4"})}),"Memory (",x.memory.memoryFiles.length," files)"]}),u&&n.jsx("div",{className:"space-y-1.5 max-h-48 overflow-y-auto",children:x.memory.memoryFiles.map(te=>n.jsxs("div",{className:"bg-terminal-surface-2 rounded-lg px-3 py-2 text-xs",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("span",{className:"font-mono text-terminal-text font-medium",children:te.name}),te.type&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-terminal-surface text-terminal-dimmer text-[10px]",children:te.type})]}),te.description&&n.jsx("div",{className:"text-terminal-dim text-[11px] mb-1",children:te.description}),n.jsx("div",{className:"font-mono text-terminal-dimmer whitespace-pre-wrap line-clamp-3 text-[11px] leading-relaxed",children:te.content})]},te.name))})]})]}),i&&h&&n.jsxs("div",{className:"mt-3 pt-3 border-t border-terminal-border-subtle space-y-3",children:[h.topProjects.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5",children:"Top projects"}),n.jsx("div",{className:"space-y-1",children:h.topProjects.slice(0,8).map(te=>{const xe=te.project.split("/").pop()||te.project;return n.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[n.jsx("span",{className:"font-mono text-terminal-text truncate flex-1",title:te.project,children:xe}),n.jsxs("span",{className:"text-terminal-dimmer tabular-nums shrink-0",children:[te.sessions,"s"]}),te.durationMs>0&&n.jsx("span",{className:"text-terminal-blue tabular-nums shrink-0",children:vt(te.durationMs)}),n.jsxs("span",{className:"text-terminal-green tabular-nums shrink-0",children:[te.prompts,"p"]}),te.edits>0&&n.jsxs("span",{className:"text-terminal-purple tabular-nums shrink-0",children:[te.edits,"e"]}),te.prCount>0&&n.jsxs("span",{className:"text-terminal-blue tabular-nums shrink-0",children:[te.prCount,"pr"]}),te.cost>0&&n.jsxs("span",{className:"text-terminal-orange tabular-nums shrink-0",children:["$",te.cost.toFixed(2)]})]},te.project)})})]}),ae,oe]})]})}function Wc(l){return l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:String(l)}const aa=864e5,t0=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],n0=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Ia(l){return l.toISOString().slice(0,10)}function a0(l){return l==="7d"?7:l==="30d"?30:l==="90d"?90:0}function qh(l,r){if(r==="all")return l;const i=a0(r),o=new Date;o.setHours(0,0,0,0),o.setDate(o.getDate()-i);const u=Ia(o),m={};for(const[p,g]of Object.entries(l))p>=u&&(m[p]=g);return m}function l0(l,r,i){if(i==="all")return{sessions:r.totalSessions,replays:r.totalReplays,durationMs:r.totalDurationMs,cost:r.totalCost,prompts:r.totalPrompts,edits:r.totalEdits,toolCalls:r.totalToolCalls,projects:r.totalProjects};const o=qh(l,i),u=Object.values(o).reduce((p,g)=>p+g,0),m=r.totalSessions>0?u/r.totalSessions:0;return{sessions:u,replays:Math.round(r.totalReplays*m),durationMs:Math.round(r.totalDurationMs*m),cost:r.totalCost*m,prompts:Math.round(r.totalPrompts*m),edits:Math.round(r.totalEdits*m),toolCalls:Math.round(r.totalToolCalls*m),projects:r.totalProjects}}function s0(l){const r=new Date;r.setHours(0,0,0,0);let i=0;const o=new Date(r);for(;;){const h=Ia(o);if(l[h]&&l[h]>0)i++,o.setDate(o.getDate()-1);else if(i===0){o.setDate(o.getDate()-1);const v=Ia(o);if(l[v]&&l[v]>0)i++,o.setDate(o.getDate()-1);else break}else break}const u=Object.keys(l).filter(h=>l[h]>0).sort();let m=0,p,g,f=0,x="";for(let h=0;h<u.length;h++)if(h===0)f=1,x=u[h];else{const v=new Date(u[h-1]);(new Date(u[h]).getTime()-v.getTime())/aa===1?f++:(f>m&&(m=f,p=x,g=u[h-1]),f=1,x=u[h])}return f>m&&(m=f,p=x,g=u[u.length-1]),{current:i,longest:m,longestStart:p,longestEnd:g}}function r0(l){const r=[0,0,0,0,0,0,0];for(const[i,o]of Object.entries(l))if(o>0){const u=new Date(`${i}T00:00:00`);r[u.getDay()]+=o}return r.map((i,o)=>({day:n0[o],shortDay:t0[o],count:i}))}function i0(l,r){const i=[],o=new Date;o.setHours(0,0,0,0);const u=o.getDay(),m=u===0?6:u-1,p=new Date(o.getTime()-m*aa);for(let g=r-1;g>=0;g--){const f=new Date(p.getTime()-g*7*aa);let x=0;for(let v=0;v<7;v++){const C=new Date(f.getTime()+v*aa),j=Ia(C);x+=l[j]||0}const h=f.toLocaleDateString("en-US",{month:"short",day:"numeric"});i.push({weekLabel:h,sessions:x,startDate:Ia(f)})}return i}function o0(l){let r=0,i="";for(const[o,u]of Object.entries(l))u>r&&(r=u,i=o);return r>0?{date:i,count:r}:null}function Yh(l){return l===0?"$0":l<.01?"<$0.01":l<1?`$${l.toFixed(2)}`:l<100?`$${l.toFixed(2)}`:`$${Math.round(l)}`}function $l(l){return l>=1e4?`${(l/1e3).toFixed(1)}k`:l.toLocaleString()}function c0(l){const r=l?.filter(Boolean)||[],i=r.filter(u=>/duration estimates|timing data|duration/i.test(u)),o=r.filter(u=>/token snapshots|token and cost|cost totals/i.test(u));return{overall:r.length>0?r.join(`
|
|
63
|
+
`):void 0,duration:i.length>0?["Coding time is approximate for Cursor sessions.",...i].join(`
|
|
64
|
+
`):void 0,cost:o.length>0?["Spend is a lower bound for Cursor sessions, not the full total.",...o].join(`
|
|
65
|
+
`):void 0}}function u0(l){return[...new Set(l.split(",").map(r=>r.trim()).filter(Boolean))]}function d0(l){return l==="7d"?"Last 7 Days":l==="30d"?"Last 30 Days":l==="90d"?"Last 90 Days":"All Time"}function Fh({sessionsPerDay:l,weeks:r=52,showLegend:i=!0}){const{weekColumns:o,monthByWeek:u,maxVal:m}=y.useMemo(()=>{const g=new Date;g.setHours(0,0,0,0);const f=g.getDay(),x=new Date(g.getTime()+(6-f)*aa),h=r*7,v=new Date(x.getTime()-(h-1)*aa);let C=0;const j=[],w=new Map;let S=-1;for(let k=0;k<h;k++){const E=new Date(v.getTime()+k*aa),M=Ia(E),A=l[M]||0,R=Math.floor(k/7);A>C&&(C=A),j[R]||(j[R]=[]),j[R].push({date:M,count:A});const O=E.getMonth();O!==S&&(w.set(R,E.toLocaleDateString("en-US",{month:"short"})),S=O)}return{weekColumns:j,monthByWeek:w,maxVal:C}},[l,r]),p=g=>{if(g===0)return{cls:"bg-terminal-border/20 dark:bg-terminal-surface-2"};const f=m<=1?1:g/m;return{cls:"bg-terminal-green",style:{opacity:f<=.25?.4:f<=.5?.6:f<=.75?.8:1}}};return n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-end gap-[3px]",children:[n.jsx("div",{className:"shrink-0 w-7"}),n.jsx("div",{className:"flex-1 flex gap-[3px] min-w-0",children:o.map((g,f)=>n.jsx("div",{className:"flex-1 min-w-0 overflow-visible",children:u.has(f)&&n.jsx("span",{className:"text-[9px] font-mono text-terminal-dimmer whitespace-nowrap",children:u.get(f)})},f))})]}),n.jsxs("div",{className:"flex gap-[3px]",children:[n.jsx("div",{className:"shrink-0 w-7 flex flex-col gap-[3px]",children:["","Mon","","Wed","","Fri",""].map((g,f)=>n.jsx("div",{className:"flex-1 flex items-center text-[9px] font-mono text-terminal-dimmer leading-none",children:g},f))}),n.jsx("div",{className:"flex-1 flex gap-[3px] min-w-0",children:o.map((g,f)=>n.jsx("div",{className:"flex-1 flex flex-col gap-[3px] min-w-0",children:g.map(x=>{const h=p(x.count);return n.jsx("div",{className:`aspect-square rounded-sm ${h.cls} hover:ring-1 hover:ring-terminal-text/30`,style:h.style,title:`${x.date}: ${x.count} session${x.count!==1?"s":""}`},x.date)})},f))})]}),i&&n.jsxs("div",{className:"flex items-center justify-end gap-1.5 pt-1",children:[n.jsx("span",{className:"text-[9px] font-mono text-terminal-dimmer",children:"Less"}),n.jsx("div",{className:"w-[10px] h-[10px] rounded-sm bg-terminal-border/20 dark:bg-terminal-surface-2"}),n.jsx("div",{className:"w-[10px] h-[10px] rounded-sm bg-terminal-green",style:{opacity:.4}}),n.jsx("div",{className:"w-[10px] h-[10px] rounded-sm bg-terminal-green",style:{opacity:.6}}),n.jsx("div",{className:"w-[10px] h-[10px] rounded-sm bg-terminal-green",style:{opacity:.8}}),n.jsx("div",{className:"w-[10px] h-[10px] rounded-sm bg-terminal-green"}),n.jsx("span",{className:"text-[9px] font-mono text-terminal-dimmer",children:"More"})]})]})}function m0({sessionsPerDay:l}){const r=y.useMemo(()=>{const o=new Date;o.setHours(0,0,0,0);const u=28,m=[];let p=0;for(let g=u-1;g>=0;g--){const f=new Date(o.getTime()-g*aa),x=Ia(f),h=l[x]||0;h>p&&(p=h),m.push({key:x,count:h})}return{cells:m,max:p}},[l]),i=o=>{if(o===0)return{className:"bg-terminal-border/20 dark:bg-white/5"};const u=r.max<=1?1:o/r.max;return{className:"bg-terminal-green",style:{opacity:u<=.33?.45:u<=.66?.7:.9}}};return n.jsx("div",{className:"flex gap-[3px] flex-wrap",children:r.cells.map(o=>{const u=i(o.count);return n.jsx("div",{className:`w-[10px] h-[10px] rounded-[2px] ${u.className}`,style:u.style},o.key)})})}function f0({stats:l,streak:r,bestDay:i,sessionsPerDay:o,range:u,providers:m,dataQualityNotes:p}){const g=y.useRef(null),f=y.useMemo(()=>{const v=Object.entries(m);if(v.length===0)return"";v.sort((j,w)=>w[1]-j[1]);const C={"claude-code":"Claude Code",cursor:"Cursor"};return v.map(([j])=>C[j]||j).join(" + ")},[m]),x=y.useMemo(()=>c0(p),[p]),h=({label:v,title:C})=>n.jsxs("div",{className:"mt-0.5 flex items-center gap-1",children:[n.jsx("div",{className:"text-[10px] font-sans font-medium text-terminal-dim uppercase tracking-wider",children:v}),C?n.jsx(Ea,{title:C,className:"shrink-0"}):null]});return n.jsxs("div",{ref:g,className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-terminal-surface via-terminal-bg to-terminal-surface border border-terminal-border p-6 md:p-8 shadow-layer-xl",children:[n.jsx("div",{className:"absolute -top-20 -right-20 w-64 h-64 bg-terminal-green/5 rounded-full blur-3xl pointer-events-none"}),n.jsx("div",{className:"absolute -bottom-20 -left-20 w-48 h-48 bg-terminal-blue/5 rounded-full blur-3xl pointer-events-none"}),n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-sm font-sans font-bold bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent",children:"vibe-replay"}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer px-2 py-0.5 rounded-full bg-terminal-surface-2",children:d0(u)}),x.overall?n.jsx(Ea,{title:x.overall,className:"shrink-0"}):null]}),f&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dim",children:f})]}),n.jsxs("div",{className:"grid grid-cols-4 gap-x-6 gap-y-5 mb-6",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-green tabular-nums",children:n.jsx(yn,{durationMs:500,value:l.sessions,formatter:$l})}),n.jsx(h,{label:"sessions"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-blue tabular-nums",children:n.jsx(yn,{durationMs:500,value:l.replays,formatter:$l})}),n.jsx(h,{label:"replays"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-green tabular-nums",children:n.jsx(yn,{durationMs:500,value:l.prompts,formatter:$l})}),n.jsx(h,{label:"turns"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-orange tabular-nums",children:n.jsx(yn,{durationMs:500,value:l.toolCalls,formatter:$l})}),n.jsx(h,{label:"tool calls"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-text tabular-nums",children:n.jsx(yn,{durationMs:500,value:l.durationMs,formatter:v=>Mu(v)})}),n.jsx(h,{label:"coding",title:x.duration})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-orange tabular-nums",children:n.jsx(yn,{durationMs:500,value:l.cost,formatter:v=>Yh(v)})}),n.jsx(h,{label:"spent",title:x.cost})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-blue tabular-nums",children:n.jsx(yn,{durationMs:500,value:l.edits,formatter:$l})}),n.jsx(h,{label:"file edits"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-purple tabular-nums",children:n.jsx(yn,{durationMs:500,value:l.projects,formatter:v=>Math.round(v).toString()})}),n.jsx(h,{label:"projects"})]})]}),n.jsx("div",{className:"mb-4",children:n.jsx(m0,{sessionsPerDay:o})}),n.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-terminal-border/30",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[r.current>0&&n.jsxs("span",{className:"text-xs font-mono text-terminal-dim",children:[r.current," day streak"]}),i&&i.count>0&&n.jsxs("span",{className:"text-xs font-mono text-terminal-dim",children:["Most active: ",i.day]})]}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:"vibe-replay.com"})]})]})]})}function Bs({icon:l,label:r,value:i,sub:o}){return n.jsx("div",{className:"bg-terminal-surface rounded-xl px-4 py-3.5 shadow-layer-sm hover:bg-terminal-surface-hover transition-colors group",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("span",{className:"text-lg leading-none mt-0.5",children:l}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest",children:r}),n.jsx("div",{className:"text-lg font-mono font-bold text-terminal-text mt-0.5",children:i}),o&&n.jsx("div",{className:"text-[10px] font-mono text-terminal-dimmer mt-0.5",children:o})]})]})})}function p0({data:l}){const r=Math.max(...l.map(x=>x.sessions),1);if(!l.some(x=>x.sessions>0))return n.jsx("div",{className:"flex items-center justify-center h-full text-terminal-dimmer text-xs font-mono",children:"No activity to show"});const o=l.slice(-4),u=l.slice(-8,-4),m=o.reduce((x,h)=>x+h.sessions,0)/Math.max(o.length,1),p=u.reduce((x,h)=>x+h.sessions,0)/Math.max(u.length,1),g=m>p,f=Math.abs(m-p)<.5;return n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"flex items-end gap-1.5 h-28",children:l.map(x=>{const h=Math.max(x.sessions/r*100,x.sessions>0?6:0);return n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-end h-full group relative",children:[n.jsx("div",{className:"absolute bottom-full mb-1 hidden group-hover:block z-10",children:n.jsxs("div",{className:"bg-terminal-surface-2 border border-terminal-border-subtle rounded-lg px-2 py-1 shadow-layer-md whitespace-nowrap",children:[n.jsx("div",{className:"text-[10px] font-mono text-terminal-dim",children:x.weekLabel}),n.jsxs("div",{className:"text-[10px] font-mono text-terminal-green font-bold",children:[x.sessions," session",x.sessions!==1?"s":""]})]})}),n.jsx("div",{className:"w-full rounded-md bg-terminal-green hover:opacity-90 transition-all",style:{height:`${h}%`,minHeight:x.sessions>0?"4px":"0",opacity:x.sessions>0?.7:0}})]},x.startDate)})}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"flex gap-1.5 overflow-hidden",children:l.filter((x,h)=>h%2===0).map(x=>n.jsx("span",{className:"text-[9px] font-mono text-terminal-dimmer",children:x.weekLabel},x.startDate))}),!f&&n.jsxs("span",{className:`text-[10px] font-mono font-bold ${g?"text-terminal-green":"text-terminal-orange"}`,children:[g?"↑":"↓"," ",g?"Trending up":"Slowing down"]})]})]})}function h0({data:l}){const r=Math.max(...l.map(i=>i.count),1);return n.jsx("div",{className:"space-y-2",children:l.map(i=>{const o=r>0?i.count/r*100:0;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-mono text-terminal-dim w-7 text-right shrink-0",children:i.shortDay}),n.jsx("div",{className:"flex-1 h-4 rounded bg-terminal-surface-2 overflow-hidden",children:n.jsx("div",{className:"h-full rounded bg-terminal-green transition-all duration-500",style:{width:`${Math.max(o,i.count>0?3:0)}%`,opacity:.65}})}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dim w-6 text-right tabular-nums shrink-0",children:i.count})]},i.day)})})}function x0({projects:l}){if(l.length===0)return n.jsx("div",{className:"text-terminal-dimmer text-xs font-mono py-4 text-center",children:"No project data"});const r=Math.max(...l.map(i=>i.sessions),1);return n.jsx("div",{className:"space-y-2",children:l.slice(0,8).map(i=>{const o=na(i.project),u=i.sessions/r*100;return n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs font-sans font-medium text-terminal-text truncate max-w-[60%]",children:o}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dim tabular-nums",children:[i.sessions," session",i.sessions!==1?"s":"",i.cost>0&&` · ${Yh(i.cost)}`]})]}),n.jsx("div",{className:"h-1.5 rounded-full bg-terminal-surface-2 overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-terminal-green to-terminal-blue transition-all duration-500",style:{width:`${Math.max(u,3)}%`,opacity:.65}})})]},i.project)})})}function g0({models:l}){const r=y.useMemo(()=>(()=>{const u=new Map;for(const[m,p]of Object.entries(l))for(const g of u0(m)){const f=Ci(g);u.set(f,(u.get(f)??0)+p)}return[...u.entries()].map(([m,p])=>({model:m,count:p})).sort((m,p)=>p.count-m.count)})(),[l]),i=r.reduce((u,m)=>u+m.count,0);if(r.length===0)return n.jsx("div",{className:"text-terminal-dimmer text-xs font-mono py-4 text-center",children:"No model data"});const o=["bg-terminal-green","bg-terminal-blue","bg-terminal-orange","bg-terminal-purple","bg-terminal-red","bg-terminal-dim"];return n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"h-3 rounded-full bg-terminal-surface-2 overflow-hidden flex",children:r.map((u,m)=>n.jsx("div",{className:`h-full ${o[m%o.length]} transition-all duration-500`,style:{width:`${u.count/i*100}%`,opacity:.7}},u.model))}),n.jsx("div",{className:"grid grid-cols-2 gap-2",children:r.map((u,m)=>n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`w-2.5 h-2.5 rounded-sm ${o[m%o.length]} shrink-0`,style:{opacity:.7}}),n.jsx("span",{className:"text-[11px] font-mono text-terminal-dim truncate",children:u.model}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums ml-auto shrink-0",children:u.count})]},u.model))})]})}function b0({providers:l}){const r=y.useMemo(()=>Object.entries(l).map(([u,m])=>({provider:u,label:u==="claude-code"?"Claude Code":u==="cursor"?"Cursor":u,count:m})).sort((u,m)=>m.count-u.count),[l]),i=r.reduce((u,m)=>u+m.count,0);if(r.length===0)return null;const o={"claude-code":"bg-terminal-orange",cursor:"bg-terminal-blue"};return n.jsx("div",{className:"space-y-3",children:r.map(u=>{const m=i>0?u.count/i*100:0;return n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs font-sans font-medium text-terminal-text",children:u.label}),n.jsxs("span",{className:"text-xs font-mono text-terminal-dim tabular-nums",children:[u.count," (",Math.round(m),"%)"]})]}),n.jsx("div",{className:"h-2 rounded-full bg-terminal-surface-2 overflow-hidden",children:n.jsx("div",{className:`h-full rounded-full ${o[u.provider]||"bg-terminal-dim"} transition-all duration-500`,style:{width:`${m}%`,opacity:.7}})})]},u.provider)})})}function Zh(){return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6 py-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"h-6 w-32 skeleton rounded"}),n.jsx("div",{className:"flex gap-1",children:Array.from({length:4},(l,r)=>n.jsx("div",{className:"h-7 w-10 skeleton rounded-md"},r))})]}),n.jsxs("div",{className:"rounded-2xl bg-terminal-surface border border-terminal-border/30 p-6 space-y-5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"h-4 w-20 skeleton rounded"}),n.jsx("div",{className:"h-5 w-12 skeleton rounded-md"})]}),n.jsx("div",{className:"h-3 w-28 skeleton rounded"})]}),n.jsx("div",{className:"grid grid-cols-4 gap-6",children:Array.from({length:8},(l,r)=>n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:"h-7 skeleton rounded",style:{width:`${45+r*13%40}%`}}),n.jsx("div",{className:"h-3 w-16 skeleton rounded"})]},r))}),n.jsx("div",{className:"h-2.5 w-full skeleton rounded"}),n.jsxs("div",{className:"flex justify-between",children:[n.jsx("div",{className:"h-3 w-40 skeleton rounded"}),n.jsx("div",{className:"h-3 w-24 skeleton rounded"})]})]}),n.jsxs("div",{className:"rounded-xl bg-terminal-surface p-5 shadow-layer-sm space-y-4",children:[n.jsx("div",{className:"h-3 w-16 skeleton rounded"}),n.jsx("div",{className:"space-y-1.5",children:Array.from({length:3},(l,r)=>n.jsx("div",{className:"h-3 skeleton rounded"},r))})]}),n.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:Array.from({length:4},(l,r)=>n.jsxs("div",{className:"rounded-xl bg-terminal-surface p-4 shadow-layer-sm space-y-2.5",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"h-5 w-5 skeleton rounded"}),n.jsx("div",{className:"h-3 w-20 skeleton rounded"})]}),n.jsx("div",{className:"h-6 w-24 skeleton rounded"}),n.jsx("div",{className:"h-2.5 w-16 skeleton rounded"})]},r))}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Array.from({length:2},(l,r)=>n.jsxs("div",{className:"rounded-xl bg-terminal-surface p-5 shadow-layer-sm space-y-4",children:[n.jsx("div",{className:"h-3 w-24 skeleton rounded"}),n.jsx("div",{className:"space-y-2",children:Array.from({length:5},(i,o)=>n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"h-3 w-8 skeleton rounded shrink-0"}),n.jsx("div",{className:"h-5 skeleton rounded",style:{width:`${25+(o*17+r*31)%60}%`}})]},o))})]},r))})]})})}function y0({scanStatus:l,hasCachedInsights:r}){const i=l?.phase==="discovering"?"Finding sessions across providers and restoring the latest local data.":l?.total?`Refreshing ${l.scanned}/${l.total} sessions in the background.`:"Preparing your latest session insights.";return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6 py-8 space-y-4",children:[n.jsxs("div",{className:"rounded-xl border border-terminal-purple/20 bg-terminal-surface px-4 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm font-sans text-terminal-text",children:[n.jsx("span",{className:"w-2 h-2 rounded-full bg-terminal-purple animate-pulse"}),n.jsx("span",{children:r?"Refreshing cached insights":"Loading your insights"})]}),n.jsx("p",{className:"mt-1 text-xs font-mono text-terminal-dim",children:i})]}),n.jsx(Zh,{})]})})}function v0(){const[l,r]=y.useState(null),i=y.useCallback((o,u)=>{let m=0,p=0,g=0;const f=new Map(o.map(h=>[h.slug,h]));for(const h of o)m+=h.promptCount??(h.prompts?.length||(h.firstPrompt?1:0)),p+=h.toolCallCount??0;for(const h of u){const v=f.get(h.slug),C=h.stats.toolCalls||0;v?v.toolCallCount==null?p+=C:C>v.toolCallCount&&(p+=C-v.toolCallCount):(m+=h.stats.userPrompts||0,p+=C),g+=h.stats.durationMs||0}const x=new Set;for(const h of o)x.add(h.project);for(const h of u)x.add(h.project);r({sessions:o.length,replays:u.length,prompts:m,toolCalls:p,duration:g,projects:x.size})},[]);return y.useEffect(()=>{Promise.all([fetch("/api/sources/cached").then(o=>o.ok?o.json():null).catch(()=>null),fetch("/api/sessions/cached").then(o=>o.ok?o.json():null).catch(()=>null)]).then(([o,u])=>{const m=Aa(o)?.sessions||[],p=Aa(u)?.sessions||[];(m.length>0||p.length>0)&&i(m,p)})},[i]),l}function j0(){const{userInsights:l,loading:r,scanStatus:i}=Fl(),o=v0(),[u,m]=y.useState("all"),p=i?.running&&!l,{stats:g,streak:f,dayOfWeek:x,bestDay:h,peak:v,weeklyTrend:C,activeDays:j,firstSessionDate:w}=y.useMemo(()=>{if(!l)return{stats:{sessions:0,replays:0,durationMs:0,cost:0,prompts:0,edits:0,toolCalls:0,projects:0},streak:{current:0,longest:0},dayOfWeek:[],bestDay:null,peak:null,weeklyTrend:[],activeDays:0,firstSessionDate:null};const H=l.sessionsPerDay||{},K=qh(H,u),ae={...l,totalReplays:o?.replays??0},ue=l0(K,ae,u),oe=s0(H),te=r0(K),xe=[...te].sort((Q,ne)=>ne.count-Q.count)[0]||null,de=o0(K),pe=i0(H,12),U=Object.values(K).filter(Q=>Q>0).length,z=l.timeRange?.first||null;return{stats:ue,streak:oe,dayOfWeek:te,bestDay:xe,peak:de,weeklyTrend:pe,activeDays:U,firstSessionDate:z}},[l,u,o]);if(!l&&(r||p||i?.phase==="discovering"))return n.jsx(y0,{scanStatus:i,hasCachedInsights:!!i?.hasCachedResults});if(!l)return n.jsx(Zh,{});const S=j>0?(g.sessions/j).toFixed(1):"0",k=g.sessions>0?Math.round(g.prompts/g.sessions):0,E=w?Math.floor((Date.now()-new Date(w).getTime())/aa):0,M=o?.sessions??l.totalSessions,A=Math.max(0,M-l.totalSessions),R=!!(i?.running&&i?.hasCachedResults),O=i?.cachedAt?Ru(i.cachedAt):"",$=i?.total&&i.total>0?`${Math.min(i.scanned,i.total)}/${i.total}`:void 0;return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6 py-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h1",{className:"text-lg font-sans font-bold text-terminal-text",children:"Your Insights"}),n.jsx("div",{className:"flex items-center gap-0.5 p-0.5 rounded-lg bg-terminal-surface",children:["7d","30d","90d","all"].map(H=>n.jsx("button",{onClick:()=>m(H),className:`px-3 py-1.5 text-[11px] font-mono rounded-md transition-all ${u===H?"bg-terminal-green-subtle text-terminal-green font-bold":"text-terminal-dim hover:text-terminal-text"}`,children:H==="all"?"All":H},H))})]}),R&&n.jsx("div",{className:"rounded-xl border border-terminal-blue/30 bg-terminal-blue/10 px-4 py-3",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"mt-0.5 h-2 w-2 shrink-0 rounded-full bg-terminal-blue"}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("div",{className:"text-xs font-sans font-semibold text-terminal-text",children:"Showing cached insights snapshot while the background refresh runs"}),n.jsxs("div",{className:"text-xs font-mono text-terminal-dim",children:[O?`Snapshot from ${O} ago.`:"Using the latest cached scan."," ",$?`Refreshing ${$} sessions now.`:"Refreshing now."]}),A>0&&n.jsxs("div",{className:"text-xs font-mono text-terminal-dim",children:["Insights currently cover ",l.totalSessions," scanned sessions;"," ",A," additional session",A===1?"":"s"," will appear after the refresh completes."]})]})]})}),n.jsx(f0,{stats:g,streak:f,bestDay:h,sessionsPerDay:l.sessionsPerDay||{},range:u,providers:l.providers||{},dataQualityNotes:l.dataQuality?.notes}),n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Activity"}),u!=="all"&&n.jsx("span",{className:"text-[9px] font-mono text-terminal-dimmer",children:"Last 52 weeks"})]}),n.jsx(Fh,{sessionsPerDay:l.sessionsPerDay||{}})]}),n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[n.jsx(Bs,{icon:"🔥",label:"Current Streak",value:`${f.current} day${f.current!==1?"s":""}`,sub:f.longest>f.current?`Best: ${f.longest} days`:f.current>0?"Personal best!":void 0}),n.jsx(Bs,{icon:"⚡",label:"Avg / Active Day",value:`${S} sessions`,sub:`${j} active day${j!==1?"s":""}`}),n.jsx(Bs,{icon:"💬",label:"Avg / Session",value:`${k} prompts`,sub:g.sessions>0?`~${Mu(g.durationMs/g.sessions)} each`:void 0}),v?n.jsx(Bs,{icon:"🏆",label:"Peak Day",value:`${v.count} sessions`,sub:new Date(`${v.date}T00:00:00`).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}):n.jsx(Bs,{icon:"📅",label:"Vibe Coding Since",value:E>0?`${E} days`:"Today",sub:w?new Date(w).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):void 0})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4",children:"Weekly Trend"}),n.jsx(p0,{data:C})]}),n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4",children:"Day of Week"}),n.jsx(h0,{data:x})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4",children:"Top Projects"}),n.jsx(x0,{projects:(l.topProjects||[]).map(H=>({project:H.project,sessions:H.sessions,cost:H.cost,prompts:H.prompts,durationMs:H.durationMs,edits:H.edits}))})]}),n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm space-y-5",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4",children:"Models"}),n.jsx(g0,{models:l.models||{}})]}),Object.keys(l.providers||{}).length>1&&n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4",children:"Providers"}),n.jsx(b0,{providers:l.providers||{}})]})]})]}),E>0&&n.jsx("div",{className:"text-center py-4",children:n.jsxs("span",{className:"text-[11px] font-mono text-terminal-dimmer",children:["You've been vibe coding for ",E," day",E!==1?"s":""," ·"," ",vt(g.durationMs)," total · ",$l(g.toolCalls)," tool calls"]})})]})})}function w0(){const[l,r]=y.useState([]),[i,o]=y.useState([]),[u,m]=y.useState(!0),[p,g]=y.useState(!0),[f,x]=y.useState(!0),[h,v]=y.useState(null),[,C]=y.useState(null),[,j]=y.useState(null),w=y.useRef(!1),S=y.useRef(void 0),k=y.useMemo(()=>l.some(M=>M.provider==="cursor"),[l]),E=y.useCallback(async()=>{m(!0),g(!0),x(!0),v(null);try{const[M,A]=await Promise.all([fetch("/api/sources/cached").then(ae=>ae.ok?ae.json():null).catch(()=>null),fetch("/api/sessions/cached").then(ae=>ae.ok?ae.json():null).catch(()=>null)]),R=Aa(M),O=Aa(A);R?.sessions.length&&r(R.sessions),O?.sessions.length&&o(O.sessions),(R?.sessions.length||O?.sessions.length)&&m(!1);const $=Xs(R?.cachedAt),H=Xs(O?.cachedAt),K=[];$&&g(!1),H&&x(!1),$||K.push(new Promise(ae=>{C(0);const ue=new EventSource("/api/sources/stream");ue.onmessage=oe=>{try{const te=JSON.parse(oe.data);te.type==="progress"?C(te.scanned):te.type==="complete"?(r(te.sessions),C(null),ue.close(),ae()):te.type==="error"&&(R?.sessions.length||v(te.message||"Failed to load sessions"),C(null),ue.close(),ae())}catch{}},ue.onerror=()=>{ue.close(),C(null),fetch("/api/sources").then(oe=>{if(!oe.ok)throw new Error("Failed to load sources");return oe.json()}).then(oe=>r(oe.sessions)).catch(oe=>{R?.sessions.length||v(oe instanceof Error?oe.message:"Failed to load sessions")}).finally(()=>ae())}}).finally(()=>g(!1))),H||K.push(fetch("/api/sessions").then(ae=>{if(!ae.ok)throw new Error("Failed to load replays");return ae.json()}).then(ae=>o(ae)).catch(ae=>{O?.sessions.length||v(ae instanceof Error?ae.message:"Failed to load replays")}).finally(()=>x(!1))),K.length>0&&await Promise.allSettled(K)}catch(M){v(M instanceof Error?M.message:"Failed to load data")}finally{m(!1)}},[]);return y.useEffect(()=>{E()},[E]),y.useEffect(()=>{if(!p&&!k&&!w.current)return;let M=!1,A;const R=async()=>{const $=await fetch("/api/sources/cached").then(K=>K.ok?K.json():null).catch(()=>null),H=Aa($);!M&&H?.sessions.length&&H.cachedAt!==S.current&&(S.current=H.cachedAt,r(H.sessions))},O=async()=>{const $=await fetch("/api/sources/enrichment-status").then(H=>H.ok?H.json():null).catch(()=>null);!$||M||(j($),$.running?(w.current=!0,await R()):w.current&&(w.current=!1,await R()))};return O(),A=window.setInterval(()=>{O()},2500),()=>{M=!0,A&&window.clearInterval(A)}},[k,p]),{sources:l,setSources:r,replays:i,loading:u,loadingSources:p,loadingReplays:f,error:h}}function N0(l,r){let i=0,o=0,u=0;const m=new Map(l.map(S=>[S.slug,S]));for(const S of l)i+=S.promptCount??(S.prompts?.length||(S.firstPrompt?1:0)),o+=S.toolCallCount??0;for(const S of r){const k=m.get(S.slug),E=S.stats.toolCalls||0;k?k.toolCallCount==null?o+=E:E>k.toolCallCount&&(o+=E-k.toolCallCount):(i+=S.stats.userPrompts||0,o+=E),u+=S.stats.durationMs||0}const p=new Map;for(const S of l)p.set(S.provider,(p.get(S.provider)||0)+1);const g={"claude-code":"Claude Code",cursor:"Cursor"},f=[...p.entries()].map(([S,k])=>({provider:S,count:k,label:g[S]||S})).sort((S,k)=>k.count-S.count),x=new Set;for(const S of l)x.add(S.project);for(const S of r)x.add(S.project);const h={};for(const S of l){const k=S.timestamp?.slice(0,10);k&&(h[k]=(h[k]||0)+1)}const v=l.length,C=r.length,j=l.filter(S=>S.existingReplay).length,w=v>0?j/v*100:0;return{totalSessions:v,totalReplays:C,totalPrompts:i,totalToolCalls:o,totalDuration:u,providerBreakdown:f,projectCount:x.size,sessionsPerDay:h,recentSources:[...l].sort((S,k)=>k.timestamp.localeCompare(S.timestamp)).slice(0,5),recentReplays:[...r].sort((S,k)=>k.startTime.localeCompare(S.startTime)).slice(0,5),publishedCount:r.filter(S=>S.gist?.gistId).length,replayConversionPct:w}}function S0(){return n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("div",{className:"h-3 w-28 skeleton rounded"}),n.jsx("div",{className:"h-3 w-14 skeleton rounded"})]}),n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:Array.from({length:5},(l,r)=>n.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-3 rounded-lg bg-terminal-bg",children:[n.jsxs("div",{className:"min-w-0 flex-1 space-y-2.5",children:[n.jsx("div",{className:"h-3.5 skeleton rounded",style:{width:`${50+r*17%30}%`}}),n.jsx("div",{className:"h-3 skeleton rounded",style:{width:`${60+r*23%25}%`}})]}),n.jsx("div",{className:"h-4 w-14 shrink-0 skeleton rounded"})]},r))}),n.jsx("div",{className:"h-8 mt-2 rounded-lg skeleton"})]})}function Vh({provider:l}){return n.jsx("span",{className:`text-[10px] font-sans font-medium px-1.5 py-0.5 rounded-full uppercase tracking-wider ${Lh(l)}`,children:Oh(l)})}function k0({sessions:l,isLoading:r,onViewAll:i,onGenerate:o,onViewReplay:u,onSessionClick:m,generatingSlug:p,generateErrorSlug:g}){return l.length===0?n.jsx("div",{className:"text-center py-6 text-terminal-dimmer text-xs font-mono",children:r?"Loading sessions...":"No sessions found. Start a coding session with Claude Code or Cursor."}):n.jsxs("div",{className:"space-y-1 flex-1 flex flex-col",children:[l.map(f=>{const x=!!f.existingReplay,h=p===f.slug,v=g===f.slug;return n.jsxs("div",{onClick:()=>m(f),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-terminal-surface-hover transition-colors duration-200 cursor-pointer",children:[n.jsx(Vh,{provider:f.provider}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-sm font-sans text-terminal-text truncate",children:_u(f)}),n.jsx("p",{className:"text-[11px] font-mono text-terminal-dimmer truncate",children:na(f.project)})]}),n.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n.jsx("span",{className:"text-[11px] font-mono text-terminal-dimmer tabular-nums",children:ql(f.timestamp)}),x?n.jsxs("button",{onClick:C=>{C.stopPropagation(),u(f.existingReplay)},className:"h-7 px-3 text-xs font-sans font-semibold rounded-md bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis transition-all duration-200 flex items-center gap-1",children:[n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("polygon",{points:"4 2 14 8 4 14"})}),"View"]}):n.jsx("button",{onClick:C=>{C.stopPropagation(),o(f)},disabled:h,className:`h-7 px-3 text-xs font-sans font-semibold rounded-md transition-all duration-200 disabled:opacity-50 flex items-center gap-1 ${v?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis"}`,children:h?n.jsx("span",{className:"animate-pulse",children:"..."}):v?"Failed":n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M8 2v12M2 8h12"})}),"Generate"]})})]})]},`${f.provider}-${f.slug}`)}),n.jsx("button",{onClick:i,className:"w-full py-2 mt-auto text-xs font-sans font-semibold rounded-lg bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200",children:"View all sessions →"})]})}function C0({replays:l,isLoading:r,onViewAll:i,onOpen:o}){return l.length===0?n.jsx("div",{className:"text-center py-6 text-terminal-dimmer text-xs font-mono",children:r?"Loading replays...":"No replays yet. Generate one from the Sessions tab."}):n.jsxs("div",{className:"space-y-1 flex-1 flex flex-col",children:[l.map(u=>n.jsxs("button",{onClick:()=>o(u.slug),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-terminal-surface-hover transition-colors duration-200 text-left group",children:[n.jsx(Vh,{provider:u.provider}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-sm font-sans text-terminal-text truncate group-hover:text-terminal-green transition-colors",children:fu(u)}),n.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[n.jsxs("span",{className:"text-[11px] font-mono text-terminal-dimmer",children:[u.stats.userPrompts," prompts"]}),n.jsx("span",{className:"text-terminal-border text-[10px]",children:"·"}),n.jsxs("span",{className:"text-[11px] font-mono text-terminal-dimmer",children:[u.stats.toolCalls," tools"]}),u.stats.durationMs&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-terminal-border text-[10px]",children:"·"}),n.jsx("span",{className:"text-[11px] font-mono text-terminal-dimmer",children:vt(u.stats.durationMs)})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.gist?.gistId&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple",children:"published"}),n.jsx("span",{className:"text-[11px] font-mono text-terminal-dimmer tabular-nums",children:ql(u.startTime)})]})]},u.slug)),n.jsx("button",{onClick:i,className:"w-full py-2 mt-auto text-xs font-sans font-semibold rounded-lg bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200",children:"View all replays →"})]})}const th=[{name:"claude",label:"Claude Code",purpose:"AI feedback via headless mode"},{name:"cursor",label:"Cursor CLI",purpose:"AI feedback via AI Studio"},{name:"opencode",label:"OpenCode",purpose:"AI feedback via headless mode"}];function T0(){const[l,r]=y.useState(()=>th.map(i=>({...i,installed:!1,detail:"checking...",loading:!0})));return y.useEffect(()=>{let i=!1;for(const o of th)fetch(`/api/system-checks?tool=${encodeURIComponent(o.name)}`).then(u=>u.ok?u.json():null).then(u=>{if(i)return;const m=u?.checks?.find(p=>p.name===o.name)||u?.checks?.[0];if(!m){r(p=>p.map(g=>g.name===o.name?{...g,installed:!1,detail:"check failed",loading:!1}:g));return}r(p=>p.map(g=>g.name===o.name?{...g,installed:!!m.installed,version:m.version,detail:m.detail,loading:!1}:g))}).catch(()=>{i||r(u=>u.map(m=>m.name===o.name?{...m,installed:!1,detail:"check failed",loading:!1}:m))});return()=>{i=!0}},[]),n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-3",children:"System"}),n.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2",children:l.map(i=>n.jsxs("div",{className:"flex items-start gap-2.5 px-3 py-2.5 rounded-lg bg-terminal-bg",children:[n.jsx("div",{className:`w-2 h-2 mt-1 rounded-full shrink-0 ${i.loading?"bg-terminal-blue animate-pulse":i.installed?"bg-terminal-green":"bg-terminal-dim opacity-40"}`}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("span",{className:`text-xs font-sans font-medium ${i.loading?"text-terminal-dim":i.installed?"text-terminal-text":"text-terminal-dimmer"}`,children:i.label}),n.jsx("p",{className:"text-[10px] font-mono text-terminal-dimmer truncate",children:i.purpose}),i.loading?n.jsx("p",{className:"text-[10px] font-mono text-terminal-blue truncate animate-pulse",children:"checking..."}):i.installed?n.jsx("p",{className:"text-[10px] font-mono text-terminal-green truncate",children:i.detail||i.version||"ready"}):n.jsx("p",{className:"text-[10px] font-mono text-terminal-orange truncate",children:i.detail||"not found"})]})]},i.name))})]})}function E0({onNavigate:l}){const{sources:r,setSources:i,replays:o,loading:u,loadingSources:m,loadingReplays:p,error:g}=w0(),f=y.useMemo(()=>N0(r,o),[r,o]),{scanStatus:x,userInsights:h}=Fl(),[v,C]=y.useState(null),[j,w]=y.useState(null),[S,k]=y.useState(null),[E,M]=y.useState("idle"),[A,R]=y.useState(null),[O,$]=y.useState(null),[H,K]=y.useState(0),ae=y.useRef(null),ue=y.useRef(null),oe=S?r.find(G=>G.slug===S)??null:null,te=!h&&(m||!!x?.running||r.length>0),xe=Math.max(f.projectCount,h?.totalProjects??0),de=h?.totalPrompts??f.totalPrompts,pe=h?.totalToolCalls??f.totalToolCalls,U=f.providerBreakdown.length>0?f.providerBreakdown:Object.entries(h?.providers||{}).map(([G,F])=>({provider:G,count:F,label:G==="claude-code"?"Claude Code":G==="cursor"?"Cursor":G})).sort((G,F)=>F.count-G.count),z=Object.keys(f.sessionsPerDay).length>0?f.sessionsPerDay:h?.sessionsPerDay??{},Q=G=>{ht({view:null,session:G})},ne=async G=>{C(G.slug),w(null);try{const F=_u(G),me=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:G.provider,filePaths:G.filePaths,toolPaths:G.toolPaths,title:kt(F)||void 0,sessionSlug:G.slug,sessionProject:G.project})}),be=await me.json();if(!me.ok)throw new Error(be.error||"Generation failed");ht({view:null,session:be.slug})}catch(F){console.error("Generate error:",F),w(G.slug),setTimeout(()=>w(me=>me===G.slug?null:me),2e3)}finally{C(null)}},W=async(G,F)=>{k(null),C(G.slug),w(null);try{const me=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:G.provider,filePaths:G.filePaths,toolPaths:G.toolPaths,title:kt(F)||void 0,sessionSlug:G.slug,sessionProject:G.project})}),be=await me.json();if(!me.ok)throw new Error(be.error||"Generation failed");ht({view:null,session:be.slug})}catch(me){console.error("Generate error:",me),w(G.slug),setTimeout(()=>w(be=>be===G.slug?null:be),2e3)}finally{C(null)}},T=async(G,F)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(G)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:F})})).ok)throw new Error("Failed to update title");i(be=>be.map(Qe=>Qe.slug===G&&Qe.replay?{...Qe,replay:{...Qe.replay,title:F||void 0}}:Qe))},_=async G=>{try{if(!(await fetch(`/api/sessions/${encodeURIComponent(G)}`,{method:"DELETE"})).ok)return;i(me=>me.map(be=>be.slug===G?{...be,replay:void 0,existingReplay:null}:be))}catch{}},V=async()=>{M("syncing"),R(null);try{const G=await fetch("/api/insights/sync",{method:"POST"}),F=await G.json();if(G.status===401){M("needsLogin"),R(null);return}!G.ok||F.error?(M("error"),R(F.error||"Sync failed"),setTimeout(()=>{M(me=>me==="error"?"idle":me),R(null)},4e3)):(M("done"),R(F.message||`Synced ${F.synced??0} insights`),$(Date.now()))}catch{M("error"),R("Network error"),setTimeout(()=>{M(G=>G==="error"?"idle":G),R(null)},4e3)}},J=()=>{V()},P=async()=>{M("awaitingLogin"),R("Waiting for sign in...");try{const G=await fetch("/api/auth/login",{method:"POST"}),F=await G.json().catch(()=>null);G.ok&&F?.url&&window.open(F.url,"_blank")}catch{}ae.current&&clearInterval(ae.current),ue.current&&clearTimeout(ue.current),ae.current=setInterval(async()=>{try{(await(await fetch("/api/auth/get-session")).json())?.session&&(ae.current&&(clearInterval(ae.current),ae.current=null),ue.current&&(clearTimeout(ue.current),ue.current=null),window.dispatchEvent(new Event("vibe-auth-change")),V())}catch{}},2e3),ue.current=setTimeout(()=>{ae.current&&(clearInterval(ae.current),ae.current=null),M("idle"),R(null)},180*1e3)};y.useEffect(()=>()=>{ae.current&&clearInterval(ae.current),ue.current&&clearTimeout(ue.current)},[]),y.useEffect(()=>{if(!O)return;const G=setInterval(()=>K(F=>F+1),3e4);return()=>clearInterval(G)},[O]);const he=(()=>{if(!O)return null;const G=Date.now()-O;if(G<6e4)return"just now";const F=Math.floor(G/6e4);return F<60?`${F}m ago`:`${Math.floor(F/60)}h ago`})();return u&&!r.length&&!o.length?n.jsx("div",{className:"flex-1 overflow-auto animate-in fade-in duration-500",children:n.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-6",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm space-y-4",children:[n.jsx("div",{className:"grid grid-cols-4 gap-6",children:Array.from({length:4},(G,F)=>n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:"h-8 w-20 skeleton rounded"}),n.jsx("div",{className:"h-3 w-14 skeleton rounded"})]},F))}),n.jsx("div",{className:"space-y-1.5 pt-2",children:Array.from({length:3},(G,F)=>n.jsx("div",{className:"h-3 skeleton rounded"},F))}),n.jsx("div",{className:"h-9 skeleton rounded"})]}),n.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:Array.from({length:2},(G,F)=>n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"h-3 w-28 skeleton rounded"}),n.jsx("div",{className:"h-3 w-14 skeleton rounded"})]}),Array.from({length:5},(me,be)=>n.jsxs("div",{className:"flex items-center gap-3 px-1 py-1",children:[n.jsx("div",{className:"h-5 w-14 skeleton rounded-full shrink-0"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx("div",{className:"h-3.5 skeleton rounded",style:{width:`${55+be*19%35}%`}}),n.jsx("div",{className:"h-2.5 w-20 skeleton rounded"})]}),n.jsx("div",{className:"h-3 w-12 skeleton rounded shrink-0"})]},be)),n.jsx("div",{className:"h-8 skeleton rounded"})]},F))})]})}):g&&r.length===0&&o.length===0?n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx("div",{className:"text-center space-y-2",children:n.jsx("div",{className:"text-terminal-red font-mono text-sm",children:g})})}):n.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-6",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm",children:[n.jsxs("div",{className:"flex items-start justify-between mb-4",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-x-6 gap-y-1 flex-1 min-w-0",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-mono font-bold text-terminal-green tabular-nums",children:n.jsx(yn,{value:f.totalSessions})}),n.jsx("div",{className:"text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5",children:"sessions"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-mono font-bold text-terminal-blue tabular-nums",children:n.jsx(yn,{value:f.totalReplays})}),n.jsx("div",{className:"text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5",children:"replays"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-mono font-bold text-terminal-green tabular-nums",children:n.jsx(yn,{value:de})}),n.jsx("div",{className:"text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5",children:"turns"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-mono font-bold text-terminal-orange tabular-nums",children:n.jsx(yn,{value:pe})}),n.jsx("div",{className:"text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5",children:"tool calls"})]})]}),n.jsx("div",{className:"flex flex-col items-end gap-1 shrink-0",children:U.map(G=>n.jsxs("div",{className:`flex items-center gap-1.5 px-2 py-0.5 rounded-md ${G.provider==="claude-code"?"bg-terminal-orange/8":G.provider==="cursor"?"bg-terminal-blue/8":"bg-terminal-dim/8"}`,children:[n.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${G.provider==="claude-code"?"bg-terminal-orange":G.provider==="cursor"?"bg-terminal-blue":"bg-terminal-dim"}`}),n.jsx("span",{className:`text-[10px] font-mono tabular-nums ${G.provider==="claude-code"?"text-terminal-orange/80":G.provider==="cursor"?"text-terminal-blue/80":"text-terminal-dim"}`,children:G.label}),n.jsx("span",{className:`text-[10px] font-mono font-bold tabular-nums ${G.provider==="claude-code"?"text-terminal-orange":G.provider==="cursor"?"text-terminal-blue":"text-terminal-dim"}`,children:G.count})]},G.provider))})]}),n.jsx(Fh,{sessionsPerDay:z,weeks:52}),n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsx("button",{onClick:()=>l("insights"),className:"flex-1 py-2.5 text-xs font-sans font-semibold rounded-lg bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis transition-all duration-200",children:"View personal insights →"}),n.jsx("button",{onClick:J,disabled:E==="syncing"||E==="awaitingLogin",className:`py-2.5 px-4 text-xs font-sans font-semibold rounded-lg border transition-all duration-200 disabled:opacity-50 disabled:cursor-wait shrink-0 ${E==="done"?"bg-terminal-green/8 text-terminal-green border-terminal-green/20":E==="error"?"bg-red-400/8 text-red-400 border-red-400/20":"bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover border-terminal-border"}`,title:A||void 0,children:E==="syncing"?"Syncing...":E==="done"&&he?`✓ Synced ${he}`:E==="error"?"Sync failed":E==="awaitingLogin"?"Waiting...":"↑ Sync to cloud"}),n.jsx("a",{href:"https://vibe-replay.com/insights/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center w-9 h-9 rounded-lg text-terminal-dim hover:text-terminal-green hover:bg-terminal-surface-hover transition-colors shrink-0",title:"View insights on vibe-replay.com",children:n.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})})})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3 items-stretch",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Recent Sessions"}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:[f.totalSessions," total"]})]}),n.jsx("div",{className:"flex-1 flex flex-col justify-between",children:n.jsx(k0,{sessions:f.recentSources,isLoading:m,onViewAll:()=>l("sessions"),onGenerate:ne,onViewReplay:Q,onSessionClick:G=>k(G.slug),generatingSlug:v,generateErrorSlug:j})})]}),n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Recent Replays"}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:[f.totalReplays," total"]})]}),n.jsx("div",{className:"flex-1 flex flex-col justify-between",children:n.jsx(C0,{replays:f.recentReplays,isLoading:p,onViewAll:()=>l("replays"),onOpen:Q})})]})]}),te?n.jsx(S0,{}):h&&h.topProjects.length>1?n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Recent Projects"}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:[xe," total"]})]}),n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:[...h.topProjects].sort((G,F)=>(F.lastActivity||"").localeCompare(G.lastActivity||"")).slice(0,5).map(G=>{const F=na(G.project);return n.jsxs("button",{onClick:()=>{l("sessions"),setTimeout(()=>{ht({tab:"sessions",project:G.project})},50)},className:"flex items-center justify-between gap-2 px-3 py-2.5 rounded-lg bg-terminal-bg hover:bg-terminal-surface-hover transition-colors text-left group",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("span",{className:"text-xs font-sans font-medium text-terminal-text truncate block group-hover:text-terminal-green transition-colors",children:F}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:[G.sessions," session",G.sessions>1?"s":""," · ",G.prompts," prompts",G.durationMs>0&&` · ${Mu(G.durationMs)}`]})]}),G.cost>0&&n.jsxs("span",{className:"text-xs font-mono text-terminal-orange tabular-nums shrink-0",children:["$",G.cost.toFixed(2)]})]},G.project)})}),h.topProjects.length>5&&n.jsx("button",{onClick:()=>l("projects"),className:"w-full py-2 mt-2 text-xs font-sans font-semibold rounded-lg bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200",children:"View all projects →"})]}):null,n.jsx(T0,{})]}),oe&&n.jsx(Jh,{session:oe,onClose:()=>k(null),onGenerate:W,onViewReplay:G=>ht({view:null,session:G}),onArchive:G=>{fetch(`/api/archive/${G}`,{method:"POST"}).catch(()=>{}),k(null)},onTitleSave:T,onDeleteReplay:_,isGenerating:v===oe.slug,isArchived:!1}),(E==="needsLogin"||E==="awaitingLogin")&&n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:G=>{G.target===G.currentTarget&&E==="needsLogin"&&M("idle")},children:n.jsxs("div",{className:"relative bg-terminal-surface border border-terminal-border rounded-2xl shadow-2xl max-w-md w-full mx-4 p-6",children:[E==="needsLogin"&&n.jsx("button",{onClick:()=>M("idle"),className:"absolute top-3 right-3 w-7 h-7 flex items-center justify-center rounded-md text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors cursor-pointer",children:"×"}),E==="needsLogin"?n.jsxs(n.Fragment,{children:[n.jsx("h3",{className:"text-base font-bold text-terminal-text mb-1",children:"Sync Insights to the Cloud"}),n.jsx("p",{className:"text-xs text-terminal-dim mb-5",children:"Sign in with GitHub to unlock your online dashboard."}),n.jsxs("div",{className:"space-y-3 mb-6",children:[n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("span",{className:"shrink-0 w-7 h-7 rounded-full bg-terminal-green/10 flex items-center justify-center text-xs font-bold font-mono text-terminal-green",children:"1"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-semibold text-terminal-text",children:"Cross-machine dashboard"}),n.jsx("p",{className:"text-[11px] text-terminal-dim mt-0.5",children:"See all your sessions, costs, and streaks in one place — from any browser."})]})]}),n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("span",{className:"shrink-0 w-7 h-7 rounded-full bg-terminal-orange/10 flex items-center justify-center text-xs font-bold font-mono text-terminal-orange",children:"2"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-semibold text-terminal-text",children:"Cost tracking & trends"}),n.jsx("p",{className:"text-[11px] text-terminal-dim mt-0.5",children:"Track spending by model, spot weekly patterns, and monitor project breakdowns."})]})]}),n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("span",{className:"shrink-0 w-7 h-7 rounded-full bg-terminal-blue/10 flex items-center justify-center text-xs font-bold font-mono text-terminal-blue",children:"3"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-semibold text-terminal-text",children:"Share your coding card"}),n.jsx("p",{className:"text-[11px] text-terminal-dim mt-0.5",children:"Activity heatmaps, streak badges, and project stats — shareable at a glance."})]})]})]}),n.jsxs("button",{onClick:P,className:"w-full inline-flex items-center justify-center gap-2 h-10 rounded-lg bg-[#24292f] hover:bg-[#32383f] text-white text-sm font-semibold transition-colors cursor-pointer border border-white/10",children:[n.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})}),"Sign in with GitHub"]}),n.jsx("p",{className:"text-[10px] text-terminal-dim text-center mt-3",children:"We'll auto-sync your insights right after sign in."})]}):n.jsxs("div",{className:"text-center py-4",children:[n.jsx("div",{className:"text-2xl mb-3 animate-pulse",children:"↑"}),n.jsx("h3",{className:"text-base font-bold text-terminal-text mb-1",children:"Waiting for sign in..."}),n.jsx("p",{className:"text-xs text-terminal-dim",children:"Complete GitHub sign in in the browser tab. We'll auto-sync once you're in."})]})]})})]})}function A0({sessionsPerDay:l}){const r=y.useMemo(()=>{const o=new Date,u=new Date(o);u.setDate(u.getDate()-29);const m=[],p=new Date(u);for(;p<=o;){const g=p.toISOString().slice(0,10);m.push(l[g]||0),p.setDate(p.getDate()+1)}return m},[l]),i=Math.max(...r,1);return n.jsx("div",{className:"flex items-end gap-px h-4",children:r.map((o,u)=>n.jsx("div",{className:`w-1 rounded-sm ${o>0?"bg-terminal-green":"bg-terminal-surface-2"}`,style:{height:o>0?`${Math.max(20,o/i*100)}%`:"2px",opacity:o>0?.4+o/i*.6:.2}},u))})}function eu(l){return l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:String(l)}function R0(l){if(!l)return"";const r=Date.now()-new Date(l).getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const u=Math.floor(o/24);return u<30?`${u}d ago`:`${Math.floor(u/30)}mo ago`}function M0({onNavigate:l}){const{userInsights:r,scanStatus:i}=Fl(),[o,u]=y.useState("lastActivity"),m=y.useMemo(()=>{if(!r)return[];const f=[...r.topProjects];switch(o){case"lastActivity":f.sort((x,h)=>(h.lastActivity||"").localeCompare(x.lastActivity||""));break;case"sessions":f.sort((x,h)=>h.sessions-x.sessions);break;case"cost":f.sort((x,h)=>h.cost-x.cost);break;case"duration":f.sort((x,h)=>h.durationMs-x.durationMs);break}return f},[r,o]),p=i?.running&&i.total>0;if(!r&&!p)return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center space-y-2 text-terminal-dimmer text-sm font-mono",children:[n.jsx("p",{children:"No scan data available yet."}),n.jsx("p",{className:"text-xs",children:"Projects will appear once the background scan completes."})]})});if(!r&&p)return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"flex items-center gap-2 text-terminal-dim text-sm font-mono",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse"}),"Analyzing sessions... ",i.scanned,"/",i.total]})});const g=f=>{l("sessions"),setTimeout(()=>{ht({tab:"sessions",project:f})},50)};return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{children:n.jsxs("h2",{className:"text-sm font-sans font-semibold text-terminal-text",children:["All Projects",n.jsxs("span",{className:"ml-2 text-terminal-dimmer font-normal",children:["(",m.length,")"]})]})}),n.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-sans",children:[n.jsx("span",{className:"text-terminal-dimmer mr-1",children:"Sort:"}),[["lastActivity","Recent"],["sessions","Sessions"],["cost","Cost"],["duration","Duration"]].map(([f,x])=>n.jsx("button",{onClick:()=>u(f),className:`px-2 py-1 rounded-md transition-colors ${o===f?"bg-terminal-green-subtle text-terminal-green":"text-terminal-dim hover:text-terminal-text"}`,children:x},f))]})]}),p&&n.jsxs("div",{className:"flex items-center gap-2 px-1",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse"}),n.jsxs("span",{className:"text-xs font-mono text-terminal-dim",children:["Analyzing... ",i.scanned,"/",i.total]})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:m.map(f=>{const x=f.project.split("/").pop()||f.project;return n.jsxs("button",{onClick:()=>g(f.project),className:"text-left bg-terminal-surface rounded-xl p-4 shadow-layer-sm hover:bg-terminal-surface-hover transition-all duration-200 group border-l-2 border-terminal-green/40 hover:border-terminal-green",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2 mb-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-sm font-sans font-medium text-terminal-text truncate group-hover:text-terminal-green transition-colors",children:x}),n.jsx("div",{className:"text-[10px] font-mono text-terminal-dimmer truncate mt-0.5",children:f.project})]}),f.lastActivity&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer shrink-0",children:R0(f.lastActivity)})]}),n.jsxs("div",{className:"flex items-center gap-3 text-xs font-mono flex-wrap mb-3",children:[n.jsxs("span",{className:"text-terminal-text tabular-nums",children:[f.sessions," ",n.jsxs("span",{className:"text-terminal-dimmer",children:["session",f.sessions!==1?"s":""]})]}),f.durationMs>0&&n.jsx("span",{className:"text-terminal-blue tabular-nums",children:vt(f.durationMs)}),f.cost>0&&n.jsxs("span",{className:"text-terminal-orange tabular-nums",children:["$",f.cost.toFixed(2)]}),n.jsxs("span",{className:"text-terminal-green tabular-nums",children:[eu(f.prompts)," ",n.jsx("span",{className:"text-terminal-dimmer",children:"prompts"})]})]}),n.jsxs("div",{className:"flex items-center gap-3 text-[10px] font-mono text-terminal-dimmer flex-wrap mb-2",children:[f.toolCalls>0&&n.jsxs("span",{children:[eu(f.toolCalls)," tools"]}),f.edits>0&&n.jsxs("span",{children:[eu(f.edits)," edits"]}),f.branchCount>0&&n.jsxs("span",{children:[f.branchCount," branch",f.branchCount!==1?"es":""]}),f.prCount>0&&n.jsxs("span",{children:[f.prCount," PR",f.prCount!==1?"s":""]}),f.memoryFileCount>0&&n.jsxs("span",{children:[f.memoryFileCount," memory file",f.memoryFileCount!==1?"s":""]})]}),n.jsx(A0,{sessionsPerDay:f.sessionsPerDay})]},f.project)})})]})})}const D0=()=>n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[n.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),n.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),n.jsx("circle",{cx:"8",cy:"13",r:"1.5"})]});function Lu({provider:l}){return n.jsx("span",{className:`text-[10px] font-sans font-medium px-1.5 py-0.5 rounded-full uppercase tracking-wider ${Lh(l)}`,children:Oh(l)})}function _0({slug:l,title:r,fallbackTitle:i,onSave:o}){const u=kt(r||i||l),[m,p]=y.useState(!1),[g,f]=y.useState(u),[x,h]=y.useState(!1),v=y.useRef(null);y.useEffect(()=>{f(u)},[u]),y.useEffect(()=>{m&&v.current?.focus()},[m]);const C=async()=>{if(!x){h(!0);try{await o(l,kt(g))}finally{h(!1),p(!1)}}};return m?n.jsxs("div",{className:"min-w-0",children:[n.jsx("form",{onSubmit:j=>{j.preventDefault(),C()},className:"flex items-center gap-1.5 min-w-0",children:n.jsx("input",{ref:v,value:g,onChange:j=>f(j.target.value),onBlur:C,onKeyDown:j=>{j.key==="Escape"&&(f(u),p(!1))},className:"bg-terminal-surface-2 rounded px-2 py-0.5 text-sm font-sans text-terminal-text w-full outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-green/50 transition-shadow duration-200",placeholder:u,maxLength:Du,disabled:x})}),n.jsxs("div",{className:"text-[11px] font-mono text-terminal-dimmer truncate mt-0.5",children:["slug: ",n.jsx("span",{className:"text-terminal-dim",children:l})]})]}):n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("button",{onClick:()=>p(!0),className:"group flex items-center gap-1 min-w-0 max-w-full text-left",title:"Click to edit title",children:[n.jsx("span",{className:"text-sm font-sans font-medium text-terminal-text truncate",children:u||l}),n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"shrink-0 text-terminal-dim opacity-0 group-hover:opacity-100 transition-opacity",children:n.jsx("path",{d:"M11.5 1.5l3 3-9 9H2.5v-3l9-9z"})})]}),n.jsxs("div",{className:"text-[11px] font-mono text-terminal-dimmer truncate mt-0.5",children:["slug: ",n.jsx("span",{className:"text-terminal-dim",children:l})]})]})}function O0({onArchive:l,isArchived:r}){const[i,o]=y.useState(!1),u=y.useRef(null),m=y.useCallback(()=>o(!1),[]);return Au(u,m,i),n.jsxs("div",{className:"relative",ref:u,children:[n.jsx("button",{onClick:p=>{p.stopPropagation(),o(g=>!g)},className:"h-7 w-7 flex items-center justify-center rounded-md bg-terminal-surface-2 text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200",title:"More actions",children:n.jsx(D0,{})}),i&&n.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[140px] rounded-lg bg-terminal-surface-2 border border-terminal-border shadow-layer-md py-1",children:n.jsxs("button",{onClick:p=>{p.stopPropagation(),l(),o(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs font-sans text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M2 4h12v2H2zM3 6v7h10V6M6.5 8h3"})}),r?"Unarchive":"Archive"]})})]})}let ci=null,$s=null;function Qh(){return ci?Promise.resolve(ci):$s||($s=fetch("/api/scan/results").then(l=>l.ok?l.json():null).then(l=>{const r=l?.results??null;return ci=r,setTimeout(()=>{ci=null,$s=null},3e4),r}).catch(()=>null),$s)}function hu(l,r,i){const o=[],u=new Set,m=[r?.firstPrompt,...l.prompts||[]];r?.firstPrompt||m.push(l.firstPrompt);for(const g of m){const f=Yl(g||"");!f||u.has(f)||(u.add(f),o.push(f))}const p=Yl(i||"");return o.length>1&&p&&o[0]===p&&o.shift(),o.length>1&&/^(?:and|but|or|so|then)\b/i.test(o[0]||"")&&o.shift(),o}function Xh(l){return l&&l!=="main"&&l!=="master"?l:void 0}function Ih(l,r){return l==="jsonl"?"bg-terminal-orange-subtle text-terminal-orange":l==="global-state"?"bg-terminal-blue-subtle text-terminal-blue":l==="sqlite"||r?"bg-terminal-green-subtle text-terminal-green":"bg-terminal-surface-2 text-terminal-dimmer"}function Jh({session:l,scanData:r=null,onClose:i,onGenerate:o,onViewReplay:u,onArchive:m,onTitleSave:p,onDeleteReplay:g,isGenerating:f,isArchived:x}){const[h,v]=y.useState(r),C=_u(l),j=mu(l,h),[w,S]=y.useState(l.replay?.title||j),[k,E]=y.useState(!1),M=y.useRef(null);y.useEffect(()=>{const z=Q=>{Q.key==="Escape"&&i()};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[i]),y.useEffect(()=>{const z=M.current;z&&(z.focus(),z.setSelectionRange(z.value.length,z.value.length))},[]),y.useEffect(()=>{v(r)},[r]),y.useEffect(()=>{if(r)return;let z=!1;return Qh().then(Q=>{if(z||!Q)return;const ne=Q.find(W=>W.slug===l.slug);ne&&v(ne)}),()=>{z=!0}},[r,l.slug]),y.useEffect(()=>{S(z=>{const Q=kt(z),ne=kt(j),W=kt(l.replay?.title);return!Q||Q===W||Q===l.slug||ne&&Q===kt(C)?l.replay?.title||j:z})},[C,j,l.replay?.title,l.slug]);const A=Xh(h?.gitBranch||l.gitBranch),R=h?.model||l.model,O=hu(l,h,j),$=h?.dataQualityNotes||[],H=h?.promptCount??l.promptCount,K=h?.toolCallCount??l.toolCallCount,ae=h?.editCount??l.editCountEst,ue=h?.durationMs??l.durationMsEst,oe=h?.costEstimate??l.replay?.stats?.costEstimate,te=h?.tokenUsage?h.tokenUsage.inputTokens+h.tokenUsage.outputTokens:void 0,xe=h?.startTime||l.timestamp,de=async()=>{if(!l.replay||k)return;const z=kt(w);if(z!==kt(l.replay.title||j)){E(!0);try{await p(l.slug,z)}finally{E(!1)}}},pe=()=>{o(l,w)};return n.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[n.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-md animate-in fade-in duration-300",onClick:i}),n.jsxs("div",{className:"relative max-w-4xl w-full bg-terminal-bg border border-terminal-border-subtle rounded-2xl shadow-layer-xl animate-in zoom-in-95 fade-in duration-200 flex flex-col max-h-[88vh]",onClick:z=>z.stopPropagation(),children:[n.jsxs("div",{className:"flex items-center justify-between px-7 pt-5 pb-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Lu,{provider:l.provider}),R&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-surface-2 text-terminal-dimmer",children:Ci(R)}),h?.dataSource&&n.jsx("span",{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full ${Ih(h.dataSource,l.hasSqlite)}`,children:pu(l.hasSqlite,h.dataSource)}),h?.entrypoint&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-surface-2 text-terminal-dimmer",children:h.entrypoint}),h?.permissionMode==="bypassPermissions"&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange",children:"trust mode"}),h?.skillsUsed?.map(z=>n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-blue-500/10 text-blue-400",children:z},z)),h?.mcpServersUsed?.map(z=>n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-purple-500/10 text-purple-400",children:z},z)),l.replay?.replayOutdated&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange",children:"outdated replay"})]}),n.jsx("button",{onClick:i,className:"h-7 w-7 flex items-center justify-center rounded-md text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto px-7 space-y-5 pb-5",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-2 px-1",children:[n.jsx("span",{className:"text-xs font-sans uppercase tracking-widest text-terminal-dimmer",children:"Title"}),n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer",children:l.slug})]}),n.jsx("form",{onSubmit:z=>{z.preventDefault(),l.replay?de():pe()},children:n.jsx("textarea",{ref:M,value:w,onChange:z=>S(z.target.value.replace(/\n/g,"")),onBlur:()=>{l.replay&&de()},onKeyDown:z=>{z.key==="Enter"&&(z.preventDefault(),l.replay?de():pe())},rows:2,className:"w-full bg-terminal-surface rounded-xl px-5 py-4 text-lg font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-green/40 transition-shadow duration-200 resize-none leading-relaxed",placeholder:j,maxLength:Du})})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl px-5 py-4 space-y-2.5",children:[n.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-1",children:"Session Info"}),n.jsx(dt,{label:"Project",value:na(l.project),title:l.project}),A&&n.jsx(dt,{label:"Branch",value:A}),h?.gitBranches&&h.gitBranches.length>1&&n.jsx(dt,{label:"Branches",value:h.gitBranches.join(", ")}),h?.skillsUsed&&h.skillsUsed.length>0&&n.jsx(dt,{label:"Skills",value:h.skillsUsed.join(", ")}),h?.mcpServersUsed&&h.mcpServersUsed.length>0&&n.jsx(dt,{label:"MCP Servers",value:h.mcpServersUsed.join(", ")}),n.jsx(dt,{label:"Started",value:`${hi(xe)} (${ql(xe)})`}),h?.endTime&&n.jsx(dt,{label:"Ended",value:hi(h.endTime)}),!!ue&&n.jsx(dt,{label:"Duration",value:`~${vt(ue)}`}),n.jsx(dt,{label:"Size",value:xi(l.fileSize)}),n.jsx(dt,{label:"Lines",value:l.lineCount.toLocaleString()}),l.filePaths.length>1&&n.jsx(dt,{label:"Parts",value:`${l.filePaths.length} files`}),n.jsx(dt,{label:"Data",value:pu(l.hasSqlite,h?.dataSource)})]}),n.jsxs("div",{className:"bg-terminal-surface rounded-xl px-5 py-4 space-y-2.5",children:[n.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-1",children:"Stats"}),!!H&&n.jsx(dt,{label:"Prompts",value:String(H)}),!!K&&n.jsx(dt,{label:"Tools",value:String(K)}),!!ae&&n.jsx(dt,{label:"Edits",value:h?String(ae):`~${ae}`}),oe!=null&&oe>0&&n.jsx(dt,{label:"Cost",value:Dh(oe)}),te!=null&&n.jsx(dt,{label:"Tokens",value:te.toLocaleString(),title:h?.tokenUsage?`In: ${h.tokenUsage.inputTokens.toLocaleString()} / Out: ${h.tokenUsage.outputTokens.toLocaleString()} / Cache write: ${h.tokenUsage.cacheCreationTokens.toLocaleString()} / Cache read: ${h.tokenUsage.cacheReadTokens.toLocaleString()}`:void 0}),h!=null&&h.subAgentCount>0&&n.jsx(dt,{label:"Agents",value:`${h.subAgentCount} sub-agents`}),h!=null&&h.compactionCount>0&&n.jsx(dt,{label:"Compacts",value:String(h.compactionCount)}),h!=null&&h.apiErrorCount>0&&n.jsx(dt,{label:"Errors",value:`${h.apiErrorCount} API errors`}),l.hasPR&&!h?.prLinks?.length&&n.jsx(dt,{label:"PR",value:"Yes"}),h?.prLinks?.map(z=>n.jsx(dt,{label:"PR",value:`#${z.prNumber} (${z.prRepository})`},z.prNumber))]})]}),$.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2",children:"Data Quality"}),n.jsx("div",{className:"bg-terminal-surface rounded-xl px-4 py-3 space-y-1.5",children:$.map(z=>n.jsxs("div",{className:"flex gap-2 items-start text-xs font-mono text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-orange shrink-0 mt-px",children:"!"}),n.jsx("span",{children:z})]},z))})]}),h?.filesModified&&h.filesModified.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2",children:["Files Modified (",h.filesModified.length,")"]}),n.jsxs("div",{className:"max-h-[120px] overflow-y-auto bg-terminal-surface rounded-xl px-4 py-2.5 space-y-1",children:[h.filesModified.slice(0,20).map(z=>n.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs font-mono",children:[n.jsx("span",{className:"text-terminal-dim truncate",children:z.file}),n.jsxs("span",{className:"text-terminal-dimmer shrink-0 tabular-nums",children:[z.count,"x"]})]},z.file)),h.filesModified.length>20&&n.jsxs("div",{className:"text-xs font-mono text-terminal-dimmer",children:["+",h.filesModified.length-20," more files"]})]})]}),O.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2",children:"Prompts"}),n.jsx("div",{className:"max-h-[180px] overflow-y-auto space-y-1.5 pr-1",children:O.map((z,Q)=>n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsx("span",{className:"text-xs text-terminal-green shrink-0 mt-px select-none",children:">"}),n.jsx("p",{className:"text-sm text-terminal-dim line-clamp-2 leading-relaxed",children:z})]},Q))})]}),l.replay&&n.jsxs("div",{className:"border-t border-terminal-border-subtle pt-4",children:[n.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2",children:"Replay"}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.replay.replaySize!=null&&n.jsx("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dim",children:xi(l.replay.replaySize)}),l.replay.generatorVersion&&n.jsxs("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dimmer",children:["v",l.replay.generatorVersion]}),!!l.replay.annotationCount&&n.jsxs("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dim",children:[l.replay.annotationCount," annotations"]}),(l.replay.cloud||l.replay.gist)&&n.jsx("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-terminal-green-subtle text-terminal-green",children:l.replay.cloud?"Cloud":"Gist"})]})]}),l.expiresInDays!=null&&l.expiresInDays<=7&&n.jsxs("div",{className:`rounded-lg px-4 py-2.5 text-sm font-mono ${l.expiresInDays<=2?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-orange-subtle text-terminal-orange"}`,children:[l.expiresInDays===0?"Transcript expires today":`Transcript expires in ${l.expiresInDays} day${l.expiresInDays!==1?"s":""}`," — generate a replay to preserve it."]})]}),n.jsxs("div",{className:"flex items-center justify-between px-7 py-4 border-t border-terminal-border-subtle",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>{m(l.slug),i()},className:"h-9 px-3 text-xs font-sans rounded-lg text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors flex items-center gap-1.5",children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M2 4h12v2H2zM3 6v7h10V6M6.5 8h3"})}),x?"Unarchive":"Archive"]}),l.replay&&n.jsxs("button",{onClick:()=>{g(l.slug),i()},className:"h-9 px-3 text-xs font-sans rounded-lg text-terminal-red/70 hover:text-terminal-red hover:bg-terminal-red-subtle transition-colors flex items-center gap-1.5",children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M3 4h10M5.5 4V3h5v1M6 7v4M10 7v4M4.5 4l.5 9h6l.5-9"})}),"Delete replay"]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[l.replay&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>o(l,w),disabled:f,className:"h-11 px-5 text-sm font-sans font-semibold rounded-xl bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200 flex items-center gap-2 disabled:opacity-50",children:f?n.jsx("span",{className:"animate-pulse",children:"Regenerating..."}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),n.jsx("path",{d:"M21 3v5h-5"}),n.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),n.jsx("path",{d:"M8 16H3v5"})]}),"Regenerate"]})}),n.jsxs("button",{onClick:()=>u(l.existingReplay),className:"h-11 px-6 text-sm font-sans font-bold rounded-xl bg-terminal-green text-terminal-bg hover:brightness-110 transition-all duration-200 flex items-center gap-2",children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M5 3l8 5-8 5V3z"})}),"View Replay"]})]}),!l.replay&&n.jsx("button",{onClick:pe,disabled:f,className:"h-12 px-8 text-sm font-sans font-bold rounded-xl bg-terminal-green text-terminal-bg hover:brightness-110 transition-all duration-200 flex items-center gap-2 shadow-lg shadow-terminal-green/20 disabled:opacity-50",children:f?n.jsx("span",{className:"animate-pulse",children:"Generating..."}):n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M8 2v12M2 8h12"})}),"Generate Replay"]})})]})]})]})]})}function dt({label:l,value:r,title:i}){return n.jsxs("div",{className:"flex items-baseline gap-2 min-w-0",children:[n.jsx("span",{className:"text-[11px] font-sans text-terminal-dimmer uppercase tracking-wider shrink-0 w-[68px]",children:l}),n.jsx("span",{className:"text-sm font-mono text-terminal-dim truncate",title:i||r,children:r})]})}function Kh({summary:l,onOpen:r,onShare:i,onTitleSave:o,onDelete:u,onRegenerate:m,onArchive:p,isDeleting:g,isRegenerating:f,isArchived:x}){const[h,v]=y.useState(!1),[C,j]=y.useState(!1),w=y.useRef(null),S=y.useCallback(()=>{j(!1),v(!1)},[]);return Au(w,S,C),n.jsxs("div",{onClick:r,className:`bg-terminal-surface rounded-xl px-5 py-5 hover:bg-terminal-surface-hover transition-all duration-300 ease-material space-y-3.5 shadow-layer-sm cursor-pointer hover-lift ${x?"opacity-50":""}`,children:[n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsx("div",{className:"flex-1 flex items-center gap-2 min-w-0",children:o?n.jsx("div",{className:"flex-1 min-w-0",onClick:k=>k.stopPropagation(),children:n.jsx(_0,{slug:l.slug,title:l.title,fallbackTitle:fu(l),onSave:o})}):n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("span",{className:"text-sm font-sans font-medium text-terminal-text truncate block",children:fu(l)}),n.jsxs("div",{className:"text-[11px] font-mono text-terminal-dimmer truncate mt-0.5",children:["slug: ",n.jsx("span",{className:"text-terminal-dim",children:l.slug})]})]})}),n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[l.replayOutdated&&n.jsxs("span",{className:"h-6 px-2 text-[10px] font-mono rounded-md bg-terminal-orange-subtle text-terminal-orange flex items-center gap-1",title:`Generated with v${l.generatorVersion||"?"} — regenerate to update`,children:[n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[n.jsx("path",{d:"M2.5 8a5.5 5.5 0 019.3-4M13.5 8a5.5 5.5 0 01-9.3 4"}),n.jsx("path",{d:"M12.5 1v3h-3M3.5 15v-3h3"})]}),"outdated"]}),l.gist?.outdated&&n.jsx("button",{onClick:k=>{k.stopPropagation(),i?.()},className:"h-7 w-7 flex items-center justify-center rounded-md bg-terminal-orange-subtle text-terminal-orange hover:bg-terminal-orange-emphasis transition-all duration-200 ease-material shrink-0",title:"Gist out of sync — click to update",children:n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("path",{d:"M8 1a1 1 0 0 1 1 1v5.5a1 1 0 0 1-2 0V2a1 1 0 0 1 1-1zM8 11a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 8 11z"})})}),i&&n.jsxs("button",{onClick:k=>{k.stopPropagation(),i()},className:`h-7 px-2.5 text-xs font-sans font-semibold rounded-md transition-all duration-200 ease-material flex items-center justify-center gap-1.5 shrink-0 ${l.cloud||l.gist?"bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis":"bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-purple-emphasis"}`,title:l.cloud||l.gist?"Already shared — view or update":"Share & Export",children:[l.cloud||l.gist?n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"})}):n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M8 2v8M5 5l3-3 3 3M3 11v2h10v-2"})}),l.cloud||l.gist?"Shared":"Share"]}),m&&n.jsxs("button",{onClick:k=>{k.stopPropagation(),m()},disabled:f,className:"h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200 ease-material flex items-center justify-center gap-1.5 shrink-0 disabled:opacity-50",title:"Redo",children:[f?n.jsx("span",{className:"animate-pulse",children:"..."}):n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),n.jsx("path",{d:"M21 3v5h-5"}),n.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),n.jsx("path",{d:"M8 16H3v5"})]}),"Redo"]}),n.jsxs("button",{onClick:r,className:"h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis transition-all duration-200 ease-material flex items-center justify-center gap-1 shrink-0",children:[n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("polygon",{points:"4 2 14 8 4 14"})}),"View"]}),(u||p)&&n.jsxs("div",{className:"relative",ref:w,children:[n.jsx("button",{onClick:k=>{k.stopPropagation(),j(E=>!E),v(!1)},className:"h-7 w-7 flex items-center justify-center rounded-md bg-terminal-surface-2 text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200",title:"More actions",children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[n.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),n.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),n.jsx("circle",{cx:"8",cy:"13",r:"1.5"})]})}),C&&n.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[140px] rounded-lg bg-terminal-surface-2 border border-terminal-border shadow-layer-md py-1",children:[p&&n.jsxs("button",{onClick:k=>{k.stopPropagation(),p(),j(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs font-sans text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M2 4h12v2H2zM3 6v7h10V6M6.5 8h3"})}),x?"Unarchive":"Archive"]}),u&&n.jsxs(n.Fragment,{children:[p&&n.jsx("div",{className:"mx-2 my-1 border-t border-terminal-border"}),h?n.jsxs("div",{className:"flex items-center gap-1 px-2 py-1",children:[n.jsx("button",{onClick:k=>{k.stopPropagation(),u(),v(!1),j(!1)},className:"h-6 px-2 text-xs font-sans rounded bg-terminal-red-subtle text-terminal-red hover:bg-terminal-red-emphasis transition-colors duration-200",children:"Confirm"}),n.jsx("button",{onClick:()=>v(!1),className:"h-6 px-2 text-xs font-sans rounded text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"})]}):n.jsxs("button",{onClick:()=>v(!0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs font-sans text-terminal-red hover:bg-terminal-red-subtle transition-colors",children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M3 4h10M5.5 4V3a1 1 0 011-1h3a1 1 0 011 1v1M6.5 7v4M9.5 7v4M4.5 4l.5 9a1 1 0 001 1h4a1 1 0 001-1l.5-9"})}),"Delete"]})]})]})]})]})]}),(l.messages||(l.firstMessage?[l.firstMessage]:[])).map(k=>Yl(k||"")).filter(k=>k.length>0).map((k,E)=>n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsx("span",{className:"text-xs text-terminal-green shrink-0 mt-px select-none",children:">"}),n.jsx("p",{className:"text-sm text-terminal-dim line-clamp-1 leading-relaxed",children:k})]},E)),n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",children:[l.stats.userPrompts," prompts"]}),n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-orange-subtle text-terminal-orange",children:[l.stats.toolCalls," tools"]}),l.stats.durationMs&&n.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",children:vt(l.stats.durationMs)}),l.stats.costEstimate&&n.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-green-subtle text-terminal-green",children:Dh(l.stats.costEstimate)}),l.hasAnnotations&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-blue-subtle text-terminal-blue",children:[l.annotationCount," annotation",l.annotationCount!==1?"s":""]}),l.replaySize!=null&&l.replaySize>0&&n.jsx("span",{className:`inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md ${l.replaySize>10*1024*1024?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-surface-2 text-terminal-dimmer"}`,title:l.replaySize>10*1024*1024?"Exceeds share limit (10MB)":void 0,children:xi(l.replaySize)})]}),n.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-terminal-dimmer flex-wrap",children:[n.jsx(Lu,{provider:l.provider}),n.jsx("span",{children:l.project}),n.jsx("span",{className:"text-terminal-border",children:"·"}),n.jsx("span",{children:hi(l.startTime)}),l.model&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-terminal-border",children:"·"}),n.jsx("span",{children:l.model})]})]})]})}function nh(){const[l,r]=y.useState(!1),[i,o]=y.useState(null),[u,m]=y.useState(null),p=async()=>{r(!0),m(null),o(null);try{const g=await fetch("/api/regenerate-all",{method:"POST"}),f=await g.json();if(!g.ok)throw new Error(f.error||"Failed");o({regenerated:f.regenerated,total:f.total}),setTimeout(()=>window.location.reload(),1500)}catch(g){m(g instanceof Error?g.message:"Failed to regenerate")}finally{r(!1)}};return n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:p,disabled:l,className:"px-3 py-1.5 text-xs font-mono rounded-lg bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover border border-terminal-border-subtle transition-colors duration-200 disabled:opacity-40",children:l?"Regenerating...":"Regenerate All"}),i&&n.jsxs("span",{className:"text-xs font-mono text-terminal-green",children:[i.regenerated,"/",i.total," regenerated"]}),u&&n.jsx("span",{className:"text-xs font-mono text-terminal-red",children:u})]})}function L0(){const[l,r]=y.useState([]),[i,o]=y.useState({}),[u,m]=y.useState(null),[p,g]=y.useState(!0),[f,x]=y.useState(null),[h,v]=y.useState(!1),[C,j]=y.useState(null),[w,S]=y.useState(null),[k,E]=y.useState(null),[M,A]=y.useState(()=>Date.now()),{selectedProject:R,filter:O,showArchived:$,handleProjectChange:H,handleFilterChange:K,handleToggleArchived:ae}=$h(),{scanStatus:ue,userInsights:oe,projectInsightsCache:te,fetchProjectInsights:xe}=Fl();y.useEffect(()=>{R!==pt&&xe(R)},[R,xe]);const de=R!==pt?te.get(R):void 0,[pe,U]=y.useState(null),[z,Q]=y.useState(null),[ne,W]=y.useState(null),T=y.useRef(!1),[_,V]=y.useState(new Set),[J,P]=y.useState(null),he=l.some(I=>I.provider==="cursor"),G=ne?l.find(I=>I.slug===ne)??null:null,F=y.useCallback(async I=>{g(!0),x(null),S(null),v(!1),j(null);const we=await fetch("/api/archived").then(Se=>Se.ok?Se.json():{slugs:[]}).catch(()=>({slugs:[]}));V(new Set(we.slugs));let ve=!1;const ce=await fetch("/api/sources/cached").then(Se=>Se.ok?Se.json():null).catch(()=>null),fe=Aa(ce),_e=!I?.forceRefresh&&Xs(fe?.cachedAt);if(fe&&fe.sessions.length>0&&(ve=!0,r(fe.sessions),E(fe.cachedAt??null),j(_e?null:fe.cachedAt??null),g(!1),v(!_e)),_e){v(!1),g(!1);return}try{const Se=await fetch("/api/sources");if(!Se.ok)throw new Error("Failed to load sessions");const Be=await Se.json();r(Be.sessions),Be.cleanupPeriodDays!=null&&m(Be.cleanupPeriodDays),E(new Date().toISOString()),j(null)}catch(Se){ve?S("Failed to refresh latest sessions. Showing cached data."):x(gi(Se)||"Failed to load sessions")}finally{v(!1),g(!1)}},[]),me=I=>zh(I,_,V);y.useEffect(()=>{F()},[F]),y.useEffect(()=>{if(l.length===0)return;let I=!1;const we=async()=>{const ce=await Qh();I||!ce||o(Object.fromEntries(ce.filter(fe=>fe.slug).map(fe=>[fe.slug,fe])))};we();const ve=window.setInterval(()=>{we()},ue?.running?5e3:3e4);return()=>{I=!0,window.clearInterval(ve)}},[ue?.running,l.length]),y.useEffect(()=>{if(!p&&!he&&!T.current)return;let I=!1,we;const ve=async()=>{const fe=await fetch("/api/sources/cached").then(Se=>Se.ok?Se.json():null).catch(()=>null),_e=Aa(fe);!I&&_e?.sessions.length&&r(_e.sessions)},ce=async()=>{const fe=await fetch("/api/sources/enrichment-status").then(_e=>_e.ok?_e.json():null).catch(()=>null);!fe||I||(P(fe),fe.running?(T.current=!0,await ve()):T.current&&(T.current=!1,await ve()))};return ce(),we=window.setInterval(()=>{ce()},2500),()=>{I=!0,we&&window.clearInterval(we)}},[he,p]),y.useEffect(()=>{const I=window.setInterval(()=>A(Date.now()),3e4);return()=>window.clearInterval(I)},[]);const be=async(I,we)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(I)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:we})})).ok)throw new Error("Failed to update title");r(ce=>ce.map(fe=>fe.slug===I&&fe.replay?{...fe,replay:{...fe.replay,title:we||void 0}}:fe))},Qe=async(I,we)=>{W(null),U(I.slug),Q(null);try{const ve=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:I.provider,filePaths:I.filePaths,toolPaths:I.toolPaths,title:kt(we)||void 0,sessionSlug:I.slug,sessionProject:I.project})}),ce=await ve.json();if(!ve.ok)throw new Error(ce.error||"Generation failed");ht({view:null,session:ce.slug})}catch(ve){Q(gi(ve))}finally{U(null)}},lt=async I=>{try{if(!(await fetch(`/api/sessions/${encodeURIComponent(I)}`,{method:"DELETE"})).ok)return;r(ve=>ve.map(ce=>ce.slug===I?{...ce,replay:void 0,existingReplay:null}:ce))}catch{}},Ct=l.filter(I=>_.has(I.slug)).length,Fe=$?l:l.filter(I=>!_.has(I.slug)),it=new Map;for(const I of Fe)it.has(I.project)||it.set(I.project,[]),it.get(I.project)?.push(I);const Bt=[...it.entries()].sort((I,we)=>{const ve=I[1][0]?.timestamp||"";return(we[1][0]?.timestamp||"").localeCompare(ve)}),kn=Bh(Bt.map(([I])=>I)),qt=R===pt?Fe:it.get(R)||[],Cn=O?qt.filter(I=>I.slug.toLowerCase().includes(O.toLowerCase())||I.firstPrompt.toLowerCase().includes(O.toLowerCase())||(I.title||"").toLowerCase().includes(O.toLowerCase())||(I.gitBranch||"").toLowerCase().includes(O.toLowerCase())):qt,ze=k?Ru(k,M):null,ot=p&&l.length===0,jt=7,st=l.filter(I=>I.expiresInDays!=null&&I.expiresInDays<=jt&&!_.has(I.slug)),Ze=st.reduce((I,we)=>Math.min(I,we.expiresInDays??1/0),1/0);return f&&l.length===0?n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center space-y-3",children:[n.jsx("div",{className:"text-terminal-red font-mono text-sm",children:f}),n.jsx("button",{onClick:()=>void F({forceRefresh:!0}),className:"px-3 py-1.5 text-xs font-mono rounded-md bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200",children:"Retry"})]})}):l.length===0&&!ot?n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center space-y-2",children:[n.jsx("div",{className:"text-terminal-dim font-mono text-sm",children:"No AI sessions found"}),n.jsx("div",{className:"text-terminal-dimmer font-mono text-xs",children:"Start a coding session with Claude Code or Cursor, then come back here"})]})}):n.jsxs("div",{className:"flex flex-1 min-h-0",children:[n.jsxs("div",{className:"hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold",children:"Projects"}),ze&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:ze})]}),n.jsx("button",{onClick:()=>{F({forceRefresh:!0})},className:"p-1.5 rounded-md text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200",title:"Refresh",children:n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[n.jsx("path",{d:"M2.5 8a5.5 5.5 0 019.3-4M13.5 8a5.5 5.5 0 01-9.3 4"}),n.jsx("path",{d:"M12.5 1v3h-3M3.5 15v-3h3"})]})})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:[n.jsxs("button",{onClick:()=>H(pt),className:`w-full text-left px-3 py-2.5 text-xs font-sans rounded-lg transition-all duration-200 ease-material flex items-center justify-between ${R===pt?"bg-terminal-green-subtle text-terminal-green shadow-layer-sm":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface"}`,children:[n.jsx("span",{className:"font-medium",children:"All projects"}),n.jsx("span",{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${R===pt?"bg-terminal-green-emphasis text-terminal-green":"bg-terminal-surface text-terminal-dimmer"}`,children:l.length})]}),n.jsx("div",{className:"h-px bg-terminal-border-subtle mx-2 my-1.5"}),Bt.map(([I,we])=>{const ve=we.filter(Be=>Be.existingReplay).length,ce=R===I,fe=kn.get(I)||na(I),_e=we[0]?.projectExists!==!1,Se=we.some(Be=>Be.isGitRepo||Be.gitBranch);return n.jsxs("button",{onClick:()=>H(I),title:I,className:`w-full text-left px-3 py-2.5 rounded-lg transition-all duration-200 ease-material group ${ce?"bg-terminal-green-subtle shadow-layer-sm":"hover:bg-terminal-surface"} ${_e?"":"opacity-50"}`,children:[n.jsxs("div",{className:"flex items-center justify-between gap-1.5",children:[n.jsxs("span",{className:`text-xs font-sans truncate flex items-center gap-1.5 ${ce?"text-terminal-green font-medium":_e?"text-terminal-text group-hover:text-terminal-text":"text-terminal-dim"}`,children:[Se&&n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",className:`shrink-0 ${ce?"opacity-70":"opacity-40"}`,children:n.jsx("path",{fillRule:"evenodd",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),fe]}),n.jsx("span",{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs shrink-0 ${ce?"bg-terminal-green-emphasis text-terminal-green":"bg-terminal-surface text-terminal-dimmer"}`,children:we.length})]}),n.jsxs("div",{className:"flex items-center gap-2 mt-1 ml-0.5",children:[n.jsx("span",{className:`text-xs font-mono truncate ${ce?"text-terminal-dim":"text-terminal-dimmer"}`,children:ql(we[0]?.timestamp||"")}),ve>0&&n.jsxs("span",{className:`text-xs font-mono ${ce?"text-terminal-green":"text-terminal-dimmer"}`,children:[ve," ",ve===1?"replay":"replays"]})]})]},I)})]})]}),n.jsxs("div",{className:"flex-1 flex flex-col min-h-0 min-w-0",children:[n.jsx("div",{className:"md:hidden px-3 pt-3",children:n.jsxs("select",{value:R,onChange:I=>H(I.target.value),className:"w-full bg-terminal-surface rounded-lg px-3 py-2.5 text-sm font-sans text-terminal-text outline-none shadow-layer-sm",children:[n.jsxs("option",{value:pt,children:["All projects (",l.length,")"]}),Bt.map(([I,we])=>n.jsxs("option",{value:I,children:[kn.get(I)||na(I)," (",we.length,")"]},I))]})}),n.jsxs("div",{className:"px-4 pt-4 pb-2 space-y-3 shrink-0",children:[n.jsx("div",{className:"hidden md:block",children:de&&R!==pt?n.jsx(bi,{insights:de,variant:"project"}):oe&&R===pt?n.jsx(bi,{insights:oe,variant:"all"}):n.jsx(Gh,{})}),n.jsxs("div",{className:"flex gap-2 items-center",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-terminal-dim",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[n.jsx("circle",{cx:"7",cy:"7",r:"5"}),n.jsx("path",{d:"M11 11l3.5 3.5"})]}),n.jsx("input",{value:O,onChange:I=>K(I.target.value),placeholder:"Filter by branch, title, prompt...",className:"w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm"})]}),Ct>0&&n.jsx("button",{onClick:ae,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${$?"bg-terminal-orange-subtle text-terminal-orange":"bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,title:$?"Hide archived":`View all (${Ct} archived)`,children:$?"Active":"View all"})]})]}),(ot||h||C)&&n.jsx("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue shrink-0 shadow-layer-sm",children:ot?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),n.jsx("span",{children:"FETCHING SESSIONS..."})]}):h?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),n.jsx("span",{children:"SCANNING LATEST SESSIONS..."}),C&&n.jsxs("span",{className:"text-terminal-dim",children:["Showing stale cache (",pi(C),")"]})]}):C?n.jsxs("span",{children:["Showing stale cache (",pi(C),")"]}):null}),J?.running&&J.total>0&&n.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue shrink-0 shadow-layer-sm",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),n.jsxs("span",{children:["BACKFILLING CURSOR STATS... ",J.processed,"/",J.total]})]}),w&&n.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 bg-terminal-orange-subtle rounded-lg px-3 py-2.5 text-xs font-mono text-terminal-orange shrink-0 shadow-layer-sm",children:[n.jsx("span",{children:w}),n.jsx("button",{onClick:()=>S(null),className:"ml-auto text-terminal-orange/60 hover:text-terminal-orange transition-colors",children:"×"})]}),z&&n.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 bg-terminal-red-subtle rounded-lg px-3 py-2.5 text-xs font-mono text-terminal-red shrink-0 shadow-layer-sm",children:[n.jsx("span",{children:z}),n.jsx("button",{onClick:()=>Q(null),className:"ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors",children:"×"})]}),st.length>0&&n.jsxs("div",{className:"mx-4 mb-2 flex items-start gap-2.5 bg-terminal-orange-subtle rounded-lg px-4 py-3 shrink-0 shadow-layer-sm",children:[n.jsx("span",{className:"text-terminal-orange text-base leading-none mt-0.5",children:"⚠"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"text-xs font-sans font-semibold text-terminal-orange",children:[st.length," session",st.length!==1?"s":""," expiring",Ze===0?" today":Ze===1?" tomorrow":` within ${Ze} days`]}),n.jsxs("div",{className:"text-[11px] font-mono text-terminal-orange/70 mt-0.5",children:["Claude Code auto-deletes transcripts after"," ",u!=null?`${u} days`:"the configured period",". Generate replays to preserve them."]})]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto",children:ot?n.jsx("div",{className:"text-center py-12 text-terminal-dim font-mono text-sm",children:"Fetching sessions..."}):Cn.length===0?n.jsx("div",{className:"text-center py-12 text-terminal-dim font-mono text-sm",children:O?"No sessions match your filter":"No sessions in this project"}):n.jsx("div",{className:"space-y-2.5 px-4 py-3",children:Cn.map(I=>{const we=i[I.slug];if(I.replay){const Yt=_.has(I.slug),Ft=mu(I,we),rn=hu(I,we,Ft);return n.jsx(Kh,{summary:{...I.replay,title:Ft,firstMessage:rn[0]||we?.firstPrompt||I.replay.firstMessage,messages:rn.length>0?rn.slice(0,2):we?.firstPrompt?[we.firstPrompt]:I.replay.messages,model:we?.model||I.replay.model},onOpen:()=>ht({view:null,session:I.existingReplay}),onShare:()=>ht({view:null,session:I.existingReplay,v:"export"}),onTitleSave:be,onRegenerate:()=>W(I.slug),isRegenerating:pe===I.slug,onDelete:()=>lt(I.slug),onArchive:()=>me(I.slug),isArchived:Yt},`${I.provider}-${I.slug}`)}const ve=mu(I,we),ce=hu(I,we,ve),fe=Xh(we?.gitBranch||I.gitBranch),_e=we?.promptCount??I.promptCount,Se=we?.toolCallCount??I.toolCallCount,Be=we?.durationMs??I.durationMsEst,et=we?.editCount??I.editCountEst,Oe=we?.model||I.model,Ue=pu(I.hasSqlite,we?.dataSource),tt=_.has(I.slug);return n.jsxs("div",{onClick:()=>W(I.slug),className:`bg-terminal-surface rounded-xl px-5 py-4 hover:bg-terminal-surface-hover transition-all duration-300 ease-material space-y-2.5 shadow-layer-sm cursor-pointer hover-lift ${tt?"opacity-50":""}`,children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0 space-y-0.5",children:[n.jsx("span",{className:"text-sm font-mono text-terminal-text truncate block",children:ve}),n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsxs("div",{className:"text-[11px] font-mono text-terminal-dimmer truncate",children:["slug: ",n.jsx("span",{className:"text-terminal-dim",children:I.slug})]}),fe&&n.jsxs("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded bg-terminal-surface-2 text-terminal-dim shrink-0 inline-flex items-center gap-0.5",children:[n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[n.jsx("circle",{cx:"5",cy:"4",r:"2"}),n.jsx("circle",{cx:"11",cy:"12",r:"2"}),n.jsx("path",{d:"M5 6v4c0 1.1.9 2 2 2h2"})]}),fe]})]})]}),n.jsxs("div",{className:"flex flex-col items-end gap-1 shrink-0",children:[n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer",children:ql(I.timestamp)}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("button",{onClick:Yt=>{Yt.stopPropagation(),W(I.slug)},disabled:pe===I.slug,className:"h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200 ease-material flex items-center justify-center gap-1 disabled:opacity-50",children:pe===I.slug?n.jsx("span",{className:"animate-pulse",children:"Generating..."}):n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M8 2v12M2 8h12"})}),"Generate"]})}),n.jsx(O0,{onArchive:()=>me(I.slug),isArchived:tt})]})]})]}),ce.map((Yt,Ft)=>n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsx("span",{className:"text-xs text-terminal-green shrink-0 mt-px select-none",children:">"}),n.jsx("p",{className:"text-sm text-terminal-dim line-clamp-1 leading-relaxed",children:Yt})]},Ft)),(I.promptCount||Se||Be||et||I.hasPR||I.expiresInDays!=null&&I.expiresInDays<=jt)&&n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[!!_e&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",children:[_e," prompts"]}),!!Se&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-orange-subtle text-terminal-orange",children:[Se," tools"]}),!!Be&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",title:"Estimated active duration",children:["~",vt(Be)]}),!!et&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",title:"Estimated file edits",children:["~",et," edits"]}),I.hasPR&&n.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-purple-subtle text-terminal-purple",title:"Session produced a PR",children:"PR"}),I.expiresInDays!=null&&I.expiresInDays<=jt&&n.jsx("span",{className:`inline-flex items-center gap-1 text-xs font-mono px-1.5 py-0.5 rounded-md ${I.expiresInDays<=2?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-orange-subtle text-terminal-orange"}`,title:`Session transcript will be cleaned up by Claude Code in ${I.expiresInDays===0?"< 1 day":`${I.expiresInDays} day${I.expiresInDays!==1?"s":""}`}. Generate a replay to preserve it.`,children:I.expiresInDays===0?"expires today":`expires in ${I.expiresInDays}d`})]}),n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[n.jsx(Lu,{provider:I.provider}),R===pt&&n.jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",title:I.project,children:kn.get(I.project)||na(I.project)}),Oe&&n.jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:Ci(Oe)}),n.jsx("span",{className:"text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:xi(I.fileSize)}),I.filePaths.length>1&&n.jsxs("span",{className:"text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:[I.filePaths.length," parts"]}),(I.hasSqlite||we?.dataSource)&&n.jsx("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded-md ${Ih(we?.dataSource,I.hasSqlite)}`,title:Ue,children:Ue})]})]},`${I.provider}-${I.slug}`)})})}),G&&n.jsx(Jh,{session:G,scanData:i[G.slug]||null,onClose:()=>W(null),onGenerate:Qe,onViewReplay:I=>ht({view:null,session:I}),onArchive:I=>{me(I)},onTitleSave:be,onDeleteReplay:lt,isGenerating:pe===G.slug,isArchived:_.has(G.slug)})]})]})}function z0(){const[l,r]=y.useState([]),[i,o]=y.useState(!0),[u,m]=y.useState(!1),[p,g]=y.useState(!1),[f,x]=y.useState(null),[h,v]=y.useState(null),[C,j]=y.useState(()=>Date.now()),[w,S]=y.useState(new Set),[k,E]=y.useState(null),[M,A]=y.useState(null),{selectedProject:R,filter:O,showArchived:$,handleProjectChange:H,handleFilterChange:K,handleToggleArchived:ae}=$h(),{userInsights:ue,projectInsightsCache:oe,fetchProjectInsights:te}=Fl();y.useEffect(()=>{R!==pt&&te(R)},[R,te]);const xe=R!==pt?oe.get(R):void 0;y.useEffect(()=>{let F=!0;return(async()=>{o(!0),g(!1),x(null);const be=await fetch("/api/archived").then(it=>it.ok?it.json():{slugs:[]}).catch(()=>({slugs:[]}));F&&S(new Set(be.slugs));let Qe=!1;const lt=await fetch("/api/sessions/cached").then(it=>it.ok?it.json():null).catch(()=>null),Ct=Aa(lt),Fe=Xs(Ct?.cachedAt);if(F&&Ct&&(Qe=!0,r(Ct.sessions),m(!0),v(Ct.cachedAt??null),(Ct.sessions.length>0||Fe)&&(x(Fe?null:Ct.cachedAt??null),o(!1),g(!Fe))),Fe){F&&(g(!1),o(!1));return}try{const it=await fetch("/api/sessions");if(!it.ok)throw new Error("Failed to load sessions");const Bt=await it.json();if(!F)return;r(Bt),m(!0),v(new Date().toISOString()),x(null)}catch{if(!F)return;Qe||m(!1)}finally{F&&(g(!1),o(!1))}})(),()=>{F=!1}},[]),y.useEffect(()=>{const F=window.setInterval(()=>j(Date.now()),3e4);return()=>window.clearInterval(F)},[]);const de=F=>zh(F,w,S),pe=async(F,me)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(F)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:me})})).ok)throw new Error("Failed to update title");r(Qe=>Qe.map(lt=>lt.slug===F?{...lt,title:me||void 0}:lt))},U=F=>{ht({view:null,session:F})},z=async F=>{E(null);try{const me=await fetch(`/api/sessions/${encodeURIComponent(F)}`,{method:"DELETE"});if(!me.ok){const be=await me.json().catch(()=>({}));E(be.error||"Failed to delete session");return}r(be=>be.filter(Qe=>Qe.slug!==F))}catch{E("Failed to delete session")}},Q=async F=>{A(F.slug);try{const me=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:F.provider,sessionSlug:F.slug,sessionProject:F.project,sessionId:F.sessionId||void 0,title:F.title||void 0})}),be=await me.json();if(!me.ok)throw new Error(be.error||"Regeneration failed");ht({view:null,session:be.slug})}catch(me){console.error("Regenerate error:",gi(me))}finally{A(null)}},ne=l.filter(F=>w.has(F.slug)).length,W=$?l:l.filter(F=>!w.has(F.slug)),T=new Map;for(const F of W)T.has(F.project)||T.set(F.project,[]),T.get(F.project)?.push(F);const _=[...T.entries()].sort((F,me)=>{const be=F[1][0]?.startTime||"";return(me[1][0]?.startTime||"").localeCompare(be)}),V=Bh(_.map(([F])=>F)),J=R===pt?W:T.get(R)||[],P=O?J.filter(F=>(F.title||"").toLowerCase().includes(O.toLowerCase())||F.slug.toLowerCase().includes(O.toLowerCase())||F.project.toLowerCase().includes(O.toLowerCase())||F.provider.toLowerCase().includes(O.toLowerCase())||(F.firstMessage||"").toLowerCase().includes(O.toLowerCase())):J,he=h?Ru(h,C):null,G=i&&l.length===0;return!G&&(!u||l.length===0)?n.jsx("div",{className:"flex-1 overflow-auto",children:n.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-6 space-y-6",children:[n.jsx(nh,{}),u&&l.length===0&&n.jsxs("div",{className:"text-center py-12 space-y-2",children:[n.jsx("div",{className:"text-terminal-dim font-mono text-sm",children:"No replays yet"}),n.jsx("div",{className:"text-terminal-dimmer font-mono text-xs",children:"Go to the Sessions tab to generate your first replay"})]}),!u&&n.jsx("div",{className:"text-center py-8 space-y-2",children:n.jsxs("div",{className:"text-terminal-dimmer font-mono text-xs",children:["Or run ",n.jsx("span",{className:"text-terminal-green",children:"npx vibe-replay"})," to create a replay from your AI coding sessions"]})})]})}):n.jsxs("div",{className:"flex flex-1 min-h-0",children:[n.jsxs("div",{className:"hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20",children:[n.jsx("div",{className:"flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold",children:"Projects"}),he&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:he})]})}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:[n.jsxs("button",{onClick:()=>H(pt),className:`w-full text-left px-3 py-2.5 text-xs font-mono rounded-lg transition-all duration-200 ease-material flex items-center justify-between ${R===pt?"bg-terminal-green-subtle text-terminal-green shadow-layer-sm":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface"}`,children:[n.jsx("span",{className:"font-medium",children:"All replays"}),n.jsx("span",{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${R===pt?"bg-terminal-green-emphasis text-terminal-green":"bg-terminal-surface text-terminal-dimmer"}`,children:W.length})]}),n.jsx("div",{className:"h-px bg-terminal-border-subtle mx-2 my-1.5"}),_.map(([F,me])=>{const be=R===F,Qe=V.get(F)||na(F),lt=me.filter(Ct=>Ct.gist?.gistId).length;return n.jsxs("button",{onClick:()=>H(F),title:F,className:`w-full text-left px-3 py-2.5 rounded-lg transition-all duration-200 ease-material group ${be?"bg-terminal-green-subtle shadow-layer-sm":"hover:bg-terminal-surface"}`,children:[n.jsxs("div",{className:"flex items-center justify-between gap-1.5",children:[n.jsx("span",{className:`text-xs font-mono truncate ${be?"text-terminal-green font-medium":"text-terminal-text group-hover:text-terminal-text"}`,children:Qe}),n.jsx("span",{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs shrink-0 ${be?"bg-terminal-green-emphasis text-terminal-green":"bg-terminal-surface text-terminal-dimmer"}`,children:me.length})]}),n.jsxs("div",{className:"flex items-center gap-2 mt-1 ml-0.5",children:[n.jsx("span",{className:`text-xs font-mono truncate ${be?"text-terminal-dim":"text-terminal-dimmer"}`,children:ql(me[0]?.startTime||"")}),lt>0&&n.jsxs("span",{className:`text-xs font-mono ${be?"text-terminal-purple":"text-terminal-dimmer"}`,children:[lt," published"]})]})]},F)})]})]}),n.jsxs("div",{className:"flex-1 flex flex-col min-h-0 min-w-0",children:[n.jsx("div",{className:"md:hidden px-3 pt-3",children:n.jsxs("select",{value:R,onChange:F=>H(F.target.value),className:"w-full bg-terminal-surface rounded-lg px-3 py-2.5 text-sm font-mono text-terminal-text outline-none shadow-layer-sm",children:[n.jsxs("option",{value:pt,children:["All replays (",W.length,")"]}),_.map(([F,me])=>n.jsxs("option",{value:F,children:[V.get(F)||na(F)," (",me.length,")"]},F))]})}),n.jsxs("div",{className:"px-4 pt-4 pb-2 space-y-3 shrink-0",children:[n.jsx("div",{className:"hidden md:block",children:xe&&R!==pt?n.jsx(bi,{insights:xe,variant:"project"}):ue&&R===pt?n.jsx(bi,{insights:ue,variant:"all"}):n.jsx(Gh,{})}),n.jsxs("div",{className:"hidden md:flex items-center gap-2",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-terminal-dim",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[n.jsx("circle",{cx:"7",cy:"7",r:"5"}),n.jsx("path",{d:"M11 11l3.5 3.5"})]}),n.jsx("input",{value:O,onChange:F=>K(F.target.value),placeholder:"Filter replays...",className:"w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm"})]}),ne>0&&n.jsx("button",{onClick:ae,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${$?"bg-terminal-orange-subtle text-terminal-orange":"bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,title:$?"Hide archived":`View all (${ne} archived)`,children:$?"Active":"View all"}),n.jsx(nh,{})]}),n.jsxs("div",{className:"md:hidden flex gap-2 items-center",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-terminal-dim",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[n.jsx("circle",{cx:"7",cy:"7",r:"5"}),n.jsx("path",{d:"M11 11l3.5 3.5"})]}),n.jsx("input",{value:O,onChange:F=>K(F.target.value),placeholder:"Filter replays...",className:"w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm"})]}),ne>0&&n.jsx("button",{onClick:ae,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${$?"bg-terminal-orange-subtle text-terminal-orange":"bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,title:$?"Hide archived":`View all (${ne} archived)`,children:$?"Active":"View all"})]})]}),(G||p||f)&&n.jsx("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue shrink-0 shadow-layer-sm",children:G?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),n.jsx("span",{children:"FETCHING REPLAYS..."})]}):p?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),n.jsx("span",{children:"SCANNING LATEST REPLAYS..."}),f&&n.jsxs("span",{className:"text-terminal-dim",children:["Showing stale cache (",pi(f),")"]})]}):f?n.jsxs("span",{children:["Showing stale cache (",pi(f),")"]}):null}),k&&n.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 bg-terminal-red-subtle rounded-lg px-3 py-2.5 text-xs font-mono text-terminal-red shrink-0 shadow-layer-sm",children:[n.jsx("span",{children:k}),n.jsx("button",{onClick:()=>E(null),className:"ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors",children:"×"})]}),n.jsx("div",{className:"flex-1 overflow-y-auto",children:G?n.jsx("div",{className:"text-center py-12 text-terminal-dim font-mono text-sm",children:"Fetching replays..."}):P.length===0?n.jsx("div",{className:"text-center py-12 text-terminal-dim font-mono text-sm",children:O?"No replays match your filter":"No replays in this project"}):n.jsx("div",{className:"space-y-2.5 px-4 py-3",children:P.map(F=>{const me=w.has(F.slug);return n.jsx(Kh,{summary:F,onOpen:()=>U(F.slug),onShare:()=>ht({view:null,session:F.slug,v:"export"}),onTitleSave:pe,onDelete:()=>z(F.slug),onRegenerate:()=>Q(F),onArchive:()=>de(F.slug),isRegenerating:M===F.slug,isArchived:me},F.slug)})})})]})]})}function B0(){const{scanStatus:l}=Fl(),r=!!l?.running,[i,o]=y.useState(!1),[u,m]=y.useState(!1),p=y.useRef(l);l&&(p.current=l);const g=p.current;if(y.useEffect(()=>{if(r)m(!1),o(!0);else if(i){m(!0);const h=setTimeout(()=>{o(!1),m(!1)},300);return()=>clearTimeout(h)}},[r,i]),!i||!g)return null;const f=g.phase==="discovering"?"Discovering sessions...":g.total>0?`Scanning ${g.scanned}/${g.total}`:"Preparing scan...",x=g.total>0?Math.round(g.scanned/g.total*100):0;return n.jsxs("div",{className:`fixed bottom-4 right-4 z-50 flex items-center gap-2.5 rounded-lg px-3.5 py-2.5 text-xs font-mono bg-terminal-surface border border-terminal-border shadow-layer-md transition-all duration-300 ${u?"opacity-0 translate-y-2":"opacity-100 translate-y-0 animate-in fade-in slide-in-from-bottom-2 duration-300"}`,children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse shrink-0"}),n.jsx("span",{className:"text-terminal-dim",children:f}),g.total>0&&n.jsx("div",{className:"w-16 h-1 rounded-full bg-terminal-surface-2 overflow-hidden",children:n.jsx("div",{className:"h-full bg-terminal-purple rounded-full transition-all duration-300",style:{width:`${x}%`}})})]})}function $0({headerLeft:l,headerRight:r}){const i=!!window.__VIBE_REPLAY_EDITOR__,o=y.useCallback(()=>{const x=new URLSearchParams(window.location.search).get("tab");return x==="home"||x==="sessions"||x==="replays"||x==="projects"||x==="insights"?x:i?"home":"replays"},[i]),[u,m]=y.useState(o());y.useEffect(()=>{const f=()=>m(o());return window.addEventListener("popstate",f),()=>window.removeEventListener("popstate",f)},[o]);const p=f=>{m(f),ht({tab:f,project:null,q:null,archived:null})},g=(f,x)=>n.jsx("button",{onClick:()=>p(f),className:`px-3.5 py-1.5 text-xs font-sans font-semibold rounded-lg transition-all duration-200 ease-material ${u===f?"bg-terminal-green-subtle text-terminal-green shadow-layer-sm":"text-terminal-dim hover:text-terminal-text"}`,children:x},f);return n.jsxs(e0,{children:[n.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[i&&n.jsxs("div",{className:"shrink-0 px-5 py-2 border-b border-terminal-border-subtle glass-effect z-40 safe-top flex items-center gap-4",children:[l,n.jsxs("div",{className:"inline-flex items-center rounded-xl bg-terminal-surface p-0.5 shadow-layer-sm shrink-0",children:[g("home","Home"),g("sessions","Sessions"),g("replays","Replays"),g("projects","Projects"),g("insights","Insights")]}),n.jsx("div",{className:"flex-1"}),r]}),u==="home"&&i?n.jsx(E0,{onNavigate:p}):u==="insights"&&i?n.jsx(j0,{}):u==="projects"&&i?n.jsx(M0,{onNavigate:p}):u==="sessions"&&i?n.jsx(L0,{}):n.jsx(z0,{})]}),n.jsx(B0,{})]})}function U0(l,r,i,o){const u=new Date().toISOString(),m={id:crypto.randomUUID(),sceneIndex:r,body:i,author:"anonymous",createdAt:u,updatedAt:u,resolved:!1};return[...l,m]}function H0(l,r,i){return l.map(o=>o.id===r?{...o,body:i,updatedAt:new Date().toISOString()}:o)}function G0(l,r){return l.filter(i=>i.id!==r)}function q0(l){return new Set(l.map(r=>r.sceneIndex))}function Y0(l){const r=new Map;for(const i of l)r.set(i.sceneIndex,(r.get(i.sceneIndex)||0)+1);return r}function F0(l,r){return JSON.stringify(l)!==JSON.stringify(r)}function ah(l){return l.type==="tool-call"&&!l.diff&&!l.bashOutput}function Ph(l,r){const i=l[r];if(!ah(i))return r;const o=i.toolName;let u=r;for(;u+1<l.length&&ah(l[u+1])&&l[u+1].toolName===o;)u++;return u}function Us(l,r){return(()=>{switch(l.type){case"user-prompt":return 1200;case"thinking":return 600;case"text-response":{const o=l.content.length;return Math.max(800,Math.min(o/40,5)*600)}case"tool-call":return l.diff?1200:l.bashOutput?900:400;case"compaction-summary":return 800;case"context-injection":return 600;default:return 800}})()/r}function Gl(l){return l==="user-prompt"||l==="compaction-summary"||l==="context-injection"}function Z0(l){const r=[];for(let i=0;i<l.length;i++)l[i].type==="user-prompt"&&r.push(i);return r}function V0(l,r){return l.find(i=>i>r)}function Q0(l,r){for(let i=l.length-1;i>=0;i--)if(l[i]<r)return l[i]}function tu(l,r,i){let o=r+1;if(o>=l.length)return-1;if(i.promptsOnly){for(;o<l.length&&!Gl(l[o].type);)o++;return o>=l.length?-1:o}if(i.compactAssistant&&!Gl(l[o].type)){let m=o;for(;m+1<l.length&&!Gl(l[m+1].type);)m++;return m}return Ph(l,o)}function lh(l,r,i){let o=Math.max(0,r-1);if(r<=0)return 0;if(i.promptsOnly){for(;o>0&&!Gl(l[o].type);)o--;return o}if(i.compactAssistant){if(!Gl(l[r].type)){let p=r;for(;p>0&&!Gl(l[p-1].type);)p--;return Math.max(0,p-1)}return Math.max(0,r-1)}const u=l[o];if(u.type==="tool-call"&&!u.diff&&!u.bashOutput){const m=u.toolName;for(;o>0&&l[o-1].type==="tool-call"&&!l[o-1].diff&&!l[o-1].bashOutput&&l[o-1].toolName===m;)o--}return o}const X0="vibe-replay-annotations-";function ui(l){return X0+l}function Mn(l){const r=new URLSearchParams(window.location.search).get("session");if(!r)return l;const i=l.includes("?")?"&":"?";return`${l}${i}slug=${encodeURIComponent(r)}`}function I0(l,r="embedded"){const i=l.meta.sessionId,o=r==="editor",u=!!window.__VIBE_REPLAY_DATA__||o,[m,p]=y.useState(()=>{const _=l.annotations??[];if(o)return _;try{const V=localStorage.getItem(ui(i));if(V){const J=JSON.parse(V);if(J.length>0||_.length===0)return J}}catch{}return _}),[g,f]=y.useState(()=>l.annotations??[]),x=F0(m,g),h=y.useRef(null);y.useEffect(()=>{if(o)return h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{fetch(Mn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)}).then(()=>{f(m)}).catch(()=>{})},1e3),()=>{h.current&&clearTimeout(h.current)};try{localStorage.setItem(ui(i),JSON.stringify(m))}catch{}},[m,i,o]);const v=y.useMemo(()=>q0(m),[m]),C=y.useMemo(()=>Y0(m),[m]),j=y.useCallback((_,V)=>{p(J=>U0(J,_,V))},[]),w=y.useCallback((_,V)=>{p(J=>H0(J,_,V))},[]),S=y.useCallback(_=>{p(V=>G0(V,_))},[]),k=y.useCallback(()=>{if(o)return;const _={...l,annotations:m},J=`window.__VIBE_REPLAY_DATA__ = ${JSON.stringify(_).replace(/<\//g,"<\\/")};`,P=document.getElementById("vibe-replay-data");if(P){const G=P.textContent;P.textContent=J;const F=`<!DOCTYPE html>
|
|
66
|
+
${document.documentElement.outerHTML}`;P.textContent=G,he(F)}else{const G=document.createElement("script");G.id="vibe-replay-data",G.textContent=J,document.head.appendChild(G);const F=`<!DOCTYPE html>
|
|
67
|
+
${document.documentElement.outerHTML}`;document.head.removeChild(G),he(F)}function he(G){const F=new Blob([G],{type:"text/html"}),me=URL.createObjectURL(F),be=document.createElement("a");be.href=me,be.download=`${l.meta.slug||"replay"}.html`,document.body.appendChild(be),be.click(),document.body.removeChild(be),URL.revokeObjectURL(me)}f(m);try{localStorage.removeItem(ui(i))}catch{}},[l,m,i,o]),E=y.useCallback(()=>{const _={...l,annotations:m},V=JSON.stringify(_,null,2),J=new Blob([V],{type:"application/json"}),P=URL.createObjectURL(J),he=document.createElement("a");he.href=P,he.download="replay.json",document.body.appendChild(he),he.click(),document.body.removeChild(he),URL.revokeObjectURL(P),f(m);try{localStorage.removeItem(ui(i))}catch{}},[l,m,i]),[M,A]=y.useState(!1),R=o?async()=>{A(!0);try{await fetch(Mn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});const _=await fetch(Mn("/api/publish/gist"),{method:"POST"}),V=await _.json();if(!_.ok)throw new Error(V.error||`Server error: ${_.status}`);return f(m),V}finally{A(!1)}}:null,[O,$]=y.useState([]),[H,K]=y.useState(null),[ae,ue]=y.useState(!1),oe=y.useRef(null),te=y.useMemo(()=>H&&O.find(_=>_.name===H)||null,[H,O]);y.useEffect(()=>{o&&fetch(Mn("/api/feedback/detect")).then(_=>_.json()).then(_=>{if(!_.available)return;const V=Array.isArray(_.tools)?_.tools:_.tool?[_.tool]:[];$(V);const J=_.defaultTool?.name||_.tool?.name||V[0]?.name||null;K(J)}).catch(()=>{})},[o]);const xe=o&&H?async()=>{const _=new AbortController;oe.current=_,ue(!0);try{await fetch(Mn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m),signal:_.signal});const V=await fetch(Mn("/api/feedback/generate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:H}),signal:_.signal}),J=await V.json();if(!V.ok)throw new Error(J.error||"AI Coach failed");return p(J.annotations),f(J.annotations),{score:J.score,itemCount:J.itemCount}}finally{oe.current=null,ue(!1)}}:null,de=o?_=>{K(_)}:null,pe=o?()=>{oe.current&&oe.current.abort()}:null,[U,z]=y.useState(!1),Q=o?async()=>{z(!0);try{await fetch(Mn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});const _=await fetch(Mn("/api/export/html"),{method:"POST"}),V=await _.json();if(!_.ok)throw new Error(V.error||`Export failed: ${_.status}`);const{path:J}=V;return f(m),J}finally{z(!1)}}:null,[ne,W]=y.useState(!1);return{annotations:m,annotatedScenes:v,annotationCounts:C,add:j,update:w,remove:S,hasUnsaved:x,canSaveHtml:u,downloadHtml:k,downloadJson:E,publishGist:R,exportHtml:Q,exportGithub:o?async()=>{W(!0);try{await fetch(Mn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});const _=await fetch(Mn("/api/export/github"),{method:"POST"}),V=await _.json();if(!_.ok)throw new Error(V.error||`Export failed: ${_.status}`);return f(m),V}finally{W(!1)}}:null,gistPublishing:M,htmlExporting:U,githubExporting:ne,aiCoachTool:te,aiCoachTools:O,aiCoachToolName:H,setAiCoachToolName:de,runAiCoach:xe,cancelAiCoach:pe,aiCoachRunning:ae}}const sh={version:1,overlays:[]};function Hs(l){const r=new URLSearchParams(window.location.search).get("session");if(!r)return l;const i=l.includes("?")?"&":"?";return`${l}${i}slug=${encodeURIComponent(r)}`}function J0(l,r="embedded"){const i=r==="editor",[o,u]=y.useState(sh),[m,p]=y.useState(new Set),[g,f]=y.useState(!1),[x,h]=y.useState([]),[v,C]=y.useState(null),[j,w]=y.useState(!1),[S,k]=y.useState(!1),E=y.useRef(null),M=y.useRef(null),A=y.useRef(!1);y.useEffect(()=>{i&&fetch(Hs("/api/overlays")).then(ne=>ne.json()).then(ne=>{ne&&Array.isArray(ne.overlays)&&u(ne)}).catch(()=>{}).finally(()=>{A.current=!0})},[i]),y.useEffect(()=>()=>{E.current&&E.current.abort()},[]),y.useEffect(()=>{i&&fetch(Hs("/api/feedback/detect")).then(ne=>ne.json()).then(ne=>{if(!ne.available)return;const W=Array.isArray(ne.tools)?ne.tools:ne.tool?[ne.tool]:[];h(W);const T=ne.defaultTool?.name||ne.tool?.name||W[0]?.name||null;C(T)}).catch(()=>{})},[i]),y.useEffect(()=>{if(!(!i||!A.current))return M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{fetch(Hs("/api/overlays"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}).catch(()=>{})},1e3),()=>{M.current&&clearTimeout(M.current)}},[o,i]);const R=y.useCallback(ne=>{const W=l.scenes[ne];if(!W||W.type!=="user-prompt"&&W.type!=="text-response")return null;if(g||m.has(ne))return W.content;const T=o.overlays.filter(V=>V.sceneIndex===ne);return T.length===0?W.content:T.reduce((V,J)=>V.updatedAt>J.updatedAt?V:J).modifiedValue},[l.scenes,o,m,g]),O=y.useMemo(()=>{if(o.overlays.length===0||g)return l;const ne=new Map;for(const T of o.overlays){const _=ne.get(T.sceneIndex);_?_.push(T):ne.set(T.sceneIndex,[T])}const W=new Map;for(const[T,_]of ne){const V=_.reduce((J,P)=>J.updatedAt>P.updatedAt?J:P);W.set(T,V.modifiedValue)}return W.size===0?l:{...l,scenes:l.scenes.map((T,_)=>{if(m.has(_))return T;const V=W.get(_);return V&&(T.type==="user-prompt"||T.type==="text-response")?{...T,content:V}:T})}},[l,o,m,g]),$=y.useCallback(ne=>o.overlays.some(W=>W.sceneIndex===ne),[o]),H=y.useCallback(ne=>o.overlays.filter(W=>W.sceneIndex===ne),[o]),K=y.useCallback(ne=>{u(ne)},[]),ae=y.useCallback(ne=>{u(W=>({...W,overlays:W.overlays.filter(T=>T.id!==ne)}))},[]),ue=y.useCallback(ne=>{u(W=>({...W,overlays:W.overlays.filter(T=>T.sceneIndex!==ne)}))},[]),oe=y.useCallback(()=>{u(sh)},[]),te=y.useCallback((ne,W)=>{u(T=>({...T,overlays:T.overlays.map(_=>_.id===ne?{..._,modifiedValue:W,source:{type:"manual"},updatedAt:new Date().toISOString()}:_)}))},[]),xe=y.useCallback(ne=>{p(W=>{const T=new Set(W);return T.has(ne)?T.delete(ne):T.add(ne),T})},[]),de=y.useCallback(()=>{f(ne=>!ne)},[]),pe=y.useMemo(()=>i?ne=>C(ne):null,[i]),U=y.useMemo(()=>i?()=>{E.current&&E.current.abort()}:null,[i]),z=y.useMemo(()=>i&&v?async ne=>{const W=new AbortController;E.current=W,w(!0);try{const T=await fetch(Hs("/api/studio/translate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:v,targetLang:ne.targetLang,sourceLang:ne.sourceLang}),signal:W.signal}),_=await T.json();if(!T.ok)throw new Error(_.error||"Translation failed");return _.overlays&&u(_.overlays),_.stats}finally{E.current=null,w(!1)}}:null,[i,v]),Q=y.useMemo(()=>i&&v?async ne=>{const W=new AbortController;E.current=W,k(!0);try{const T=await fetch(Hs("/api/studio/tone"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:v,style:ne.style}),signal:W.signal}),_=await T.json();if(!T.ok)throw new Error(_.error||"Tone adjustment failed");return _.overlays&&u(_.overlays),_.stats}finally{E.current=null,k(!1)}}:null,[i,v]);return{overlays:o,effectiveSession:O,getEffectiveContent:R,hasOverlay:$,getOverlays:H,overlayCount:o.overlays.length,setOverlays:K,revertOverlay:ae,revertSceneOverlays:ue,revertAll:oe,updateOverlay:te,showOriginal:m,toggleOriginal:xe,showAllOriginals:g,toggleAllOriginals:de,studioTools:x,studioToolName:v,setStudioToolName:pe,studioToolsAvailable:x.length>0,translating:j,toningDown:S,cancelStudio:U,runTranslate:z,runTone:Q}}function K0(l){const r=l;if(!r)return!1;const i=r.tagName;if(i==="INPUT"||i==="TEXTAREA"||i==="SELECT"||r.isContentEditable)return!0;const o=r.getAttribute("role");return o==="textbox"||o==="combobox"}function P0(l,r,i=!0){const[o,u]=y.useState("idle"),[m,p]=y.useState(-1),[g,f]=y.useState(1),[x,h]=y.useState(0),v=y.useRef(null),C=y.useRef(o),j=y.useRef(m),w=y.useRef(g),S=y.useRef(r);C.current=o,j.current=m,w.current=g,S.current=r;const k=y.useMemo(()=>Z0(l),[l]),E=y.useCallback(()=>{v.current&&(clearTimeout(v.current),v.current=null)},[]),M=y.useCallback(()=>{if(C.current!=="playing")return;const ue=tu(l,j.current,S.current);if(ue===-1){u("ended"),p(l.length-1),h(l.length);return}p(ue),h(ue+1);const oe=Us(l[ue],w.current);v.current=setTimeout(M,oe)},[l]),A=y.useCallback(()=>{l.length!==0&&(C.current==="ended"&&(p(-1),h(0)),u("playing"),setTimeout(()=>{if(j.current<0){const ue=Ph(l,0);p(ue),h(ue+1);const oe=Us(l[ue],w.current);v.current=setTimeout(M,oe)}else{const ue=l[j.current];if(ue){const oe=Us(ue,w.current)/2;v.current=setTimeout(M,oe)}}},50))},[l,M]),R=y.useCallback(()=>{E(),u("paused")},[E]),O=y.useCallback(()=>{C.current==="playing"?R():A()},[A,R]),$=y.useCallback(ue=>{E();const oe=Math.max(0,Math.min(ue,l.length-1));if(p(oe),h(oe+1),C.current==="playing"){const te=Us(l[oe],w.current);v.current=setTimeout(M,te)}(C.current==="ended"||C.current==="idle")&&u("paused")},[l,E,M]),H=y.useCallback(()=>{const ue=V0(k,j.current);ue!==void 0&&$(ue)},[k,$]),K=y.useCallback(()=>{const ue=Q0(k,j.current);ue!==void 0&&$(ue)},[k,$]),ae=y.useCallback(ue=>{if(f(ue),C.current==="playing"){E();const oe=l[j.current];if(oe){const te=Us(oe,ue);v.current=setTimeout(M,te)}}},[l,E,M]);return y.useEffect(()=>E,[E]),y.useEffect(()=>{if(!i)return;const ue=oe=>{if(!K0(oe.target))if(oe.key===" "||oe.key==="k")oe.preventDefault(),O();else if(oe.key==="ArrowDown"||oe.key==="j"){C.current==="playing"&&R(),oe.preventDefault();const te=tu(l,j.current,S.current);te!==-1&&$(te)}else if(oe.key==="ArrowUp"||oe.key==="k"){C.current==="playing"&&R(),oe.preventDefault();const te=lh(l,j.current,S.current);$(te)}else oe.key==="ArrowLeft"||oe.key==="h"?(oe.preventDefault(),window.dispatchEvent(new CustomEvent("vibe:toggle-expand",{detail:{action:"collapse"}}))):oe.key==="Escape"?C.current==="playing"&&(oe.preventDefault(),R()):oe.key==="ArrowRight"||oe.key==="l"?(oe.preventDefault(),window.dispatchEvent(new CustomEvent("vibe:toggle-expand",{detail:{action:"expand"}}))):oe.key==="n"?(oe.preventDefault(),H()):oe.key==="p"?(oe.preventDefault(),K()):oe.key==="Home"?(oe.preventDefault(),$(0)):(oe.key==="End"||oe.key==="e")&&(oe.preventDefault(),$(l.length-1))};return window.addEventListener("keydown",ue),()=>window.removeEventListener("keydown",ue)},[i,O,$,H,K,l,R]),{state:o,currentIndex:m,visibleCount:x,speed:g,play:A,pause:R,togglePlayPause:O,seekTo:$,changeSpeed:ae,jumpToNextUserPrompt:H,jumpToPrevUserPrompt:K,userPromptIndices:k,totalScenes:l.length,computeNextIndex:y.useCallback(ue=>tu(l,ue,r),[l,r]),computePrevIndex:y.useCallback(ue=>lh(l,ue,r),[l,r])}}function W0(l){switch(l.displayMode){case"all":return{hideThinking:!1,collapseAllTools:!1,promptsOnly:!1,compactAssistant:!1};case"compact":return{hideThinking:!0,collapseAllTools:!0,promptsOnly:!1,compactAssistant:!0};case"custom":return{hideThinking:l.hideThinking,collapseAllTools:l.collapseAllTools,promptsOnly:l.promptsOnly,compactAssistant:!1}}}const xu="vibe-replay-view-prefs",nu={displayMode:"compact",hideThinking:!1,collapseAllTools:!1,promptsOnly:!1};function ey(){try{const l=localStorage.getItem(xu);if(l){const r=JSON.parse(l);return r.displayMode?{...nu,...r}:{...nu,...r,displayMode:"compact"}}}catch{}return nu}function ty(){const[l,r]=y.useState(ey),i=y.useCallback((u,m)=>{r(p=>{const g={...p,[u]:m};return localStorage.setItem(xu,JSON.stringify(g)),g})},[]),o=y.useCallback(u=>{r(m=>{const p=m[u];if(typeof p!="boolean")return m;const g={...m,[u]:!p};return localStorage.setItem(xu,JSON.stringify(g)),g})},[]);return{prefs:l,updatePref:i,togglePref:o}}function rh({size:l=14}){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"})})}function ny({className:l=""}){return n.jsxs("svg",{className:`animate-spin h-3.5 w-3.5 ${l}`,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}function ay({toolName:l}){return l==="claude"?n.jsxs("div",{className:"mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1",children:[n.jsxs("p",{children:["Runs"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"claude -p"})," ","locally with your prompt piped to stdin. Uses your existing auth and token quota."]}),n.jsxs("p",{className:"text-terminal-dimmer",children:["Auth issues? Run"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"claude"})," ","in your terminal to re-login."]})]}):l==="agent"?n.jsxs("div",{className:"mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1",children:[n.jsxs("p",{children:["Runs"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"agent -p"})," ","locally with your prompt piped to stdin. Uses your Cursor subscription or API key."]}),n.jsxs("p",{className:"text-terminal-dimmer",children:["Auth issues? Check Cursor IDE settings or run"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"agent"})," ","in your terminal."]})]}):l==="opencode"?n.jsxs("div",{className:"mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1",children:[n.jsxs("p",{children:["Runs"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"opencode run"})," ","locally with your prompt piped to stdin. Uses your existing OpenCode configuration."]}),n.jsxs("p",{className:"text-terminal-dimmer",children:["Not working? Run"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"opencode"})," ","in your terminal to verify setup."]})]}):n.jsxs("p",{className:"mt-2 text-xs font-mono text-terminal-dim leading-relaxed",children:["Runs ",n.jsx("span",{className:"text-terminal-text font-medium",children:l})," locally on your machine using your existing auth."]})}const ly=["English","Chinese (Simplified)","Chinese (Traditional)","Japanese","Korean","Spanish","French","German","Portuguese","Russian"],sy=[{value:"professional",label:"Professional"},{value:"neutral",label:"Neutral"},{value:"friendly",label:"Friendly"}];function ry({annotationActions:l,overlayActions:r}){const{studioTools:i,studioToolName:o,setStudioToolName:u,studioToolsAvailable:m,translating:p,toningDown:g,cancelStudio:f,runTranslate:x,runTone:h,overlayCount:v,revertAll:C}=r,{runAiCoach:j,aiCoachRunning:w,cancelAiCoach:S,aiCoachTools:k,aiCoachToolName:E,setAiCoachToolName:M}=l,A=!!j,R=l.annotations.some(P=>P.author==="vibe-feedback"),[O,$]=y.useState("English"),[H,K]=y.useState("professional"),[ae,ue]=y.useState(null),[oe,te]=y.useState(null),[xe,de]=y.useState(null),[pe,U]=y.useState(null),z=w||p||g,Q=i.length>0?i:k,ne=o||E,W=y.useCallback(async()=>{if(j){ue(null),U(null);try{const P=await j();ue({type:"success",text:`Score ${P.score}/10 — ${P.itemCount} comment(s)`})}catch(P){if(P instanceof DOMException&&P.name==="AbortError")return;ue({type:"error",text:P instanceof Error?P.message:"AI Coach failed"})}}},[j]),T=y.useCallback(async()=>{if(x){te(null),U(null);try{const P=await x({targetLang:O});te({type:"success",text:`${P.translated} message(s) translated, ${P.skipped} unchanged`})}catch(P){if(P instanceof DOMException&&P.name==="AbortError")return;te({type:"error",text:P instanceof Error?P.message:"Translation failed"})}}},[x,O]),_=y.useCallback(async()=>{if(h){de(null),U(null);try{const P=await h({style:H});de({type:"success",text:`${P.adjusted} prompt(s) adjusted, ${P.skipped} unchanged`})}catch(P){if(P instanceof DOMException&&P.name==="AbortError")return;de({type:"error",text:P instanceof Error?P.message:"Tone adjustment failed"})}}},[h,H]),V=P=>r.overlays.overlays.some(he=>he.source.type===P),J=P=>{if(P==="coach"&&R){U("coach");return}if(P==="translate"&&V("translate")){U("translate");return}if(P==="tone"&&V("tone")){U("tone");return}P==="coach"?W():P==="translate"?T():_()};return!m&&k.length===0?n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"px-4 py-2.5 border-b border-terminal-border-subtle flex items-center gap-2",children:[n.jsx(rh,{size:12}),n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest",children:"AI Studio"})]}),n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6 py-8 text-center",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-terminal-surface flex items-center justify-center mb-3",children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-terminal-dim",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),n.jsx("div",{className:"text-sm font-sans font-semibold text-terminal-text mb-1",children:"No AI tools detected"}),n.jsx("p",{className:"text-xs font-mono text-terminal-dim mb-4 leading-relaxed",children:"AI Studio requires a local CLI tool. Install one of the following:"}),n.jsx("div",{className:"w-full space-y-2 text-left",children:[{name:"Claude Code",cmd:"npm install -g @anthropic-ai/claude-code",rec:!0},{name:"Cursor CLI",cmd:'Bundled with Cursor IDE (run as "agent")'},{name:"OpenCode",cmd:"go install github.com/opencode-ai/opencode@latest"}].map(P=>n.jsxs("div",{className:"px-3 py-2 rounded-lg bg-terminal-surface border border-terminal-border-subtle",children:[n.jsxs("div",{className:"text-xs font-sans font-medium text-terminal-text flex items-center gap-1.5",children:[P.name,P.rec&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-green-subtle text-terminal-green",children:"recommended"})]}),n.jsx("div",{className:"text-xs font-mono text-terminal-dim mt-0.5 break-all",children:P.cmd})]},P.name))}),n.jsxs("p",{className:"mt-4 text-xs font-mono text-terminal-dimmer leading-relaxed text-center",children:["AI Studio runs the CLI tool in headless mode,"," ",n.jsx("span",{className:"text-terminal-green font-medium",children:"locally"})," on your machine."]})]})]}):n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"px-4 py-2.5 border-b border-terminal-border-subtle flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(rh,{size:12}),n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest",children:"AI Studio"})]}),v>0&&n.jsxs("button",{onClick:C,className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-red-subtle hover:text-terminal-red transition-colors",children:["Revert All (",v,")"]})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n.jsxs("div",{className:"px-4 py-3 border-b border-terminal-border-subtle bg-terminal-surface/30",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs font-mono text-terminal-dim",children:"Tool"}),Q.length>1&&u?n.jsx("select",{value:ne||"",onChange:P=>{u(P.target.value),M&&M(P.target.value)},className:"bg-terminal-surface border border-terminal-border rounded-lg px-2 py-0.5 text-xs font-mono text-terminal-text outline-none cursor-pointer hover:border-terminal-purple/30 transition-colors",children:Q.map(P=>n.jsx("option",{value:P.name,children:P.name},P.name))}):n.jsx("span",{className:"text-xs font-mono font-medium text-terminal-text px-2 py-0.5 rounded-lg bg-terminal-surface border border-terminal-border",children:ne})]}),n.jsx(ay,{toolName:ne})]}),n.jsxs("div",{className:"p-4 space-y-3",children:[A&&n.jsx(au,{title:"AI Coach",preview:n.jsxs("div",{className:"mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden",children:[n.jsx("div",{className:"px-3 py-2.5 border-b border-terminal-border-subtle",children:n.jsx("div",{className:"text-xs font-mono text-terminal-green leading-relaxed",children:"Fix the login bug users reported"})}),n.jsxs("div",{className:"px-3 py-2 flex items-start gap-2",children:[n.jsx("span",{className:"text-xs shrink-0",children:"💬"}),n.jsx("span",{className:"text-xs font-mono text-terminal-blue leading-relaxed",children:"Be specific — which file? what error?"})]}),n.jsxs("div",{className:"px-3 py-2 border-t border-terminal-border-subtle flex items-center gap-2",children:[n.jsx("span",{className:"text-xs font-mono font-semibold text-terminal-orange",children:"6/10"}),n.jsxs("span",{className:"text-xs font-mono text-terminal-dimmer",children:["·"," 4 comments added inline"]})]})]}),description:"Score your prompting technique and get inline coaching comments.",running:w,disabled:z,status:ae,buttonLabel:R?"Re-run Coach":"Run Coach",runningLabel:"Analyzing...",onRun:()=>J("coach"),onCancel:S||void 0,showRerunConfirm:pe==="coach",rerunWarning:"Existing AI feedback will be replaced.",onConfirmRerun:()=>void W(),onCancelRerun:()=>U(null)}),x&&n.jsx(au,{title:"Translate",preview:n.jsxs("div",{className:"mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden",children:[n.jsxs("div",{className:"px-3 py-2.5 space-y-1",children:[n.jsx("div",{className:"text-xs font-mono text-terminal-dim line-through opacity-60",children:"这个bug怎么修?"}),n.jsx("div",{className:"text-xs font-mono text-terminal-green",children:"How to fix this bug?"})]}),n.jsxs("div",{className:"px-3 py-2.5 border-t border-terminal-border-subtle space-y-1",children:[n.jsx("div",{className:"text-xs font-mono text-terminal-dim line-through opacity-60",children:"已写入。以后用中文问我..."}),n.jsx("div",{className:"text-xs font-mono text-terminal-blue",children:"Done. Ask me in Chinese..."})]})]}),description:"Translate all prompts and responses for sharing with international teams.",running:p,disabled:z,status:oe,buttonLabel:V("translate")?"Re-translate":"Translate All",runningLabel:"Translating...",onRun:()=>J("translate"),onCancel:f||void 0,showRerunConfirm:pe==="translate",rerunWarning:"Existing translations will be replaced.",onConfirmRerun:()=>void T(),onCancelRerun:()=>U(null),config:n.jsxs("div",{className:"flex items-center gap-2 mt-2.5",children:[n.jsx("span",{className:"text-xs font-mono text-terminal-dim shrink-0",children:"Target"}),n.jsx("select",{value:O,onChange:P=>$(P.target.value),disabled:z,className:"flex-1 bg-terminal-surface border border-terminal-border rounded px-2 py-1 text-xs font-mono text-terminal-text outline-none disabled:opacity-50",children:ly.map(P=>n.jsx("option",{value:P,children:P},P))})]})}),h&&n.jsx(au,{title:"Soften Tone",preview:n.jsxs("div",{className:"mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden",children:[n.jsxs("div",{className:"px-3 py-2.5 space-y-1",children:[n.jsx("div",{className:"text-xs font-mono text-terminal-red line-through opacity-60",children:"this code is mass garbage, mass delete it"}),n.jsx("div",{className:"text-xs font-mono text-terminal-green",children:"Let's refactor this module for clarity"})]}),n.jsxs("div",{className:"px-3 py-2.5 border-t border-terminal-border-subtle space-y-1",children:[n.jsx("div",{className:"text-xs font-mono text-terminal-red line-through opacity-60",children:"are you stupid? I said fix the auth"}),n.jsx("div",{className:"text-xs font-mono text-terminal-green",children:"The auth issue is still present, could you revisit?"})]})]}),description:"Rewrite harsh or blunt prompts into professional, constructive language.",running:g,disabled:z,status:xe,buttonLabel:V("tone")?"Re-adjust":"Soften All",runningLabel:"Adjusting...",onRun:()=>J("tone"),onCancel:f||void 0,showRerunConfirm:pe==="tone",rerunWarning:"Existing tone adjustments will be replaced.",onConfirmRerun:()=>void _(),onCancelRerun:()=>U(null),config:n.jsxs("div",{className:"flex items-center gap-2 mt-2.5",children:[n.jsx("span",{className:"text-xs font-mono text-terminal-dim shrink-0",children:"Style"}),n.jsx("select",{value:H,onChange:P=>K(P.target.value),disabled:z,className:"flex-1 bg-terminal-surface border border-terminal-border rounded px-2 py-1 text-xs font-mono text-terminal-text outline-none disabled:opacity-50",children:sy.map(P=>n.jsx("option",{value:P.value,children:P.label},P.value))})]})})]})]})]})}function au({title:l,preview:r,description:i,running:o,disabled:u,status:m,buttonLabel:p,runningLabel:g,onRun:f,onCancel:x,showRerunConfirm:h,rerunWarning:v,onConfirmRerun:C,onCancelRerun:j,config:w}){return n.jsxs("div",{className:"rounded-xl border border-terminal-border-subtle bg-terminal-surface/30 overflow-hidden",children:[n.jsxs("div",{className:"px-4 py-3",children:[n.jsx("div",{className:"text-sm font-sans font-semibold text-terminal-text",children:l}),r,i&&n.jsx("div",{className:"text-xs font-mono text-terminal-dim mt-2 leading-relaxed",children:i}),w,n.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[n.jsx("button",{onClick:f,disabled:u,className:"px-3.5 py-1.5 text-xs font-mono rounded-lg bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-purple-emphasis transition-colors disabled:opacity-40 flex items-center gap-1.5",children:o?n.jsxs(n.Fragment,{children:[n.jsx(ny,{className:"text-terminal-purple"}),g]}):p}),o&&x&&n.jsx("button",{onClick:x,className:"text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"})]})]}),h&&!o&&n.jsx("div",{className:"px-4 pb-3",children:n.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[n.jsx("span",{className:"text-terminal-orange flex-1",children:v}),n.jsx("button",{onClick:j,className:"text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"}),n.jsx("button",{onClick:C,className:"text-terminal-purple hover:text-terminal-text transition-colors font-medium",children:"Continue"})]})}),m&&n.jsx("div",{className:`px-4 pb-3 text-xs font-mono ${m.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:m.text})]})}function iy({open:l,onClose:r,annotationActions:i,overlayActions:o}){return y.useEffect(()=>{if(!l)return;const u=m=>{m.key==="Escape"&&(m.preventDefault(),r())};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[l,r]),n.jsxs("div",{className:`fixed inset-0 z-50 hidden md:block transition-opacity duration-300 ${l?"opacity-100":"opacity-0 pointer-events-none"}`,children:[n.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:r}),n.jsxs("div",{className:`absolute top-0 right-0 bottom-0 w-96 bg-terminal-bg border-l border-terminal-border-subtle shadow-layer-xl flex flex-col transition-transform duration-300 ease-material-decel ${l?"translate-x-0":"translate-x-full"}`,onClick:u=>u.stopPropagation(),children:[n.jsx("button",{onClick:r,className:"absolute top-2 right-2 z-10 p-1 text-terminal-dim hover:text-terminal-text transition-colors",title:"Close AI Studio",children:"✕"}),n.jsx(ry,{annotationActions:i,overlayActions:o})]})]})}function zu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ka=zu();function Wh(l){Ka=l}var Xa={exec:()=>null};function $e(l,r=""){let i=typeof l=="string"?l:l.source,o={replace:(u,m)=>{let p=typeof m=="string"?m:m.source;return p=p.replace(Gt.caret,"$1"),i=i.replace(u,p),o},getRegex:()=>new RegExp(i,r)};return o}var oy=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Gt={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,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ 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,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}#`),htmlBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}>`)},cy=/^(?:[ \t]*(?:\n|$))+/,uy=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,dy=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Js=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,my=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bu=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ex=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,tx=$e(ex).replace(/bull/g,Bu).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(),fy=$e(ex).replace(/bull/g,Bu).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(),$u=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,py=/^[^\n]+/,Uu=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,hy=$e(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Uu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),xy=$e(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Bu).getRegex(),Ti="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",Hu=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,gy=$e("^ {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",Hu).replace("tag",Ti).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),nx=$e($u).replace("hr",Js).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[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ti).getRegex(),by=$e(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",nx).getRegex(),Gu={blockquote:by,code:uy,def:hy,fences:dy,heading:my,hr:Js,html:gy,lheading:tx,list:xy,newline:cy,paragraph:nx,table:Xa,text:py},ih=$e("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Js).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[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ti).getRegex(),yy={...Gu,lheading:fy,table:ih,paragraph:$e($u).replace("hr",Js).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ih).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ti).getRegex()},vy={...Gu,html:$e(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Hu).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:Xa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$e($u).replace("hr",Js).replace("heading",` *#{1,6} *[^
|
|
68
|
+
]`).replace("lheading",tx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},jy=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,wy=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ax=/^( {2,}|\\)\n(?!\s*$)/,Ny=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ei=/[\p{P}\p{S}]/u,qu=/[\s\p{P}\p{S}]/u,lx=/[^\s\p{P}\p{S}]/u,Sy=$e(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,qu).getRegex(),sx=/(?!~)[\p{P}\p{S}]/u,ky=/(?!~)[\s\p{P}\p{S}]/u,Cy=/(?:[^\s\p{P}\p{S}]|~)/u,rx=/(?![*_])[\p{P}\p{S}]/u,Ty=/(?![*_])[\s\p{P}\p{S}]/u,Ey=/(?:[^\s\p{P}\p{S}]|[*_])/u,Ay=$e(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",oy?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ix=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ry=$e(ix,"u").replace(/punct/g,Ei).getRegex(),My=$e(ix,"u").replace(/punct/g,sx).getRegex(),ox="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Dy=$e(ox,"gu").replace(/notPunctSpace/g,lx).replace(/punctSpace/g,qu).replace(/punct/g,Ei).getRegex(),_y=$e(ox,"gu").replace(/notPunctSpace/g,Cy).replace(/punctSpace/g,ky).replace(/punct/g,sx).getRegex(),Oy=$e("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,lx).replace(/punctSpace/g,qu).replace(/punct/g,Ei).getRegex(),Ly=$e(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,rx).getRegex(),zy="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",By=$e(zy,"gu").replace(/notPunctSpace/g,Ey).replace(/punctSpace/g,Ty).replace(/punct/g,rx).getRegex(),$y=$e(/\\(punct)/,"gu").replace(/punct/g,Ei).getRegex(),Uy=$e(/^<(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(),Hy=$e(Hu).replace("(?:-->|$)","-->").getRegex(),Gy=$e("^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",Hy).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),yi=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,qy=$e(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",yi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),cx=$e(/^!?\[(label)\]\[(ref)\]/).replace("label",yi).replace("ref",Uu).getRegex(),ux=$e(/^!?\[(ref)\](?:\[\])?/).replace("ref",Uu).getRegex(),Yy=$e("reflink|nolink(?!\\()","g").replace("reflink",cx).replace("nolink",ux).getRegex(),oh=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Yu={_backpedal:Xa,anyPunctuation:$y,autolink:Uy,blockSkip:Ay,br:ax,code:wy,del:Xa,delLDelim:Xa,delRDelim:Xa,emStrongLDelim:Ry,emStrongRDelimAst:Dy,emStrongRDelimUnd:Oy,escape:jy,link:qy,nolink:ux,punctuation:Sy,reflink:cx,reflinkSearch:Yy,tag:Gy,text:Ny,url:Xa},Fy={...Yu,link:$e(/^!?\[(label)\]\((.*?)\)/).replace("label",yi).getRegex(),reflink:$e(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",yi).getRegex()},gu={...Yu,emStrongRDelimAst:_y,emStrongLDelim:My,delLDelim:Ly,delRDelim:By,url:$e(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",oh).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\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:$e(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",oh).getRegex()},Zy={...gu,br:$e(ax).replace("{2,}","*").getRegex(),text:$e(gu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},di={normal:Gu,gfm:yy,pedantic:vy},Gs={normal:Yu,gfm:gu,breaks:Zy,pedantic:Fy},Vy={"&":"&","<":"<",">":">",'"':""","'":"'"},ch=l=>Vy[l];function Dn(l,r){if(r){if(Gt.escapeTest.test(l))return l.replace(Gt.escapeReplace,ch)}else if(Gt.escapeTestNoEncode.test(l))return l.replace(Gt.escapeReplaceNoEncode,ch);return l}function uh(l){try{l=encodeURI(l).replace(Gt.percentDecode,"%")}catch{return null}return l}function dh(l,r){let i=l.replace(Gt.findPipe,(m,p,g)=>{let f=!1,x=p;for(;--x>=0&&g[x]==="\\";)f=!f;return f?"|":" |"}),o=i.split(Gt.splitPipe),u=0;if(o[0].trim()||o.shift(),o.length>0&&!o.at(-1)?.trim()&&o.pop(),r)if(o.length>r)o.splice(r);else for(;o.length<r;)o.push("");for(;u<o.length;u++)o[u]=o[u].trim().replace(Gt.slashPipe,"|");return o}function qs(l,r,i){let o=l.length;if(o===0)return"";let u=0;for(;u<o&&l.charAt(o-u-1)===r;)u++;return l.slice(0,o-u)}function Qy(l,r){if(l.indexOf(r[1])===-1)return-1;let i=0;for(let o=0;o<l.length;o++)if(l[o]==="\\")o++;else if(l[o]===r[0])i++;else if(l[o]===r[1]&&(i--,i<0))return o;return i>0?-2:-1}function Xy(l,r=0){let i=r,o="";for(let u of l)if(u===" "){let m=4-i%4;o+=" ".repeat(m),i+=m}else o+=u,i++;return o}function mh(l,r,i,o,u){let m=r.href,p=r.title||null,g=l[1].replace(u.other.outputLinkReplace,"$1");o.state.inLink=!0;let f={type:l[0].charAt(0)==="!"?"image":"link",raw:i,href:m,title:p,text:g,tokens:o.inlineTokens(g)};return o.state.inLink=!1,f}function Iy(l,r,i){let o=l.match(i.other.indentCodeCompensation);if(o===null)return r;let u=o[1];return r.split(`
|
|
69
|
+
`).map(m=>{let p=m.match(i.other.beginningSpace);if(p===null)return m;let[g]=p;return g.length>=u.length?m.slice(u.length):m}).join(`
|
|
70
|
+
`)}var vi=class{options;rules;lexer;constructor(l){this.options=l||Ka}space(l){let r=this.rules.block.newline.exec(l);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(l){let r=this.rules.block.code.exec(l);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:qs(i,`
|
|
71
|
+
`)}}}fences(l){let r=this.rules.block.fences.exec(l);if(r){let i=r[0],o=Iy(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(l){let r=this.rules.block.heading.exec(l);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let o=qs(i,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(i=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(l){let r=this.rules.block.hr.exec(l);if(r)return{type:"hr",raw:qs(r[0],`
|
|
72
|
+
`)}}blockquote(l){let r=this.rules.block.blockquote.exec(l);if(r){let i=qs(r[0],`
|
|
70
73
|
`).split(`
|
|
71
|
-
`),o="",u="",m=[];for(;i.length>0;){let p=!1,
|
|
72
|
-
`),
|
|
74
|
+
`),o="",u="",m=[];for(;i.length>0;){let p=!1,g=[],f;for(f=0;f<i.length;f++)if(this.rules.other.blockquoteStart.test(i[f]))g.push(i[f]),p=!0;else if(!p)g.push(i[f]);else break;i=i.slice(f);let x=g.join(`
|
|
75
|
+
`),h=x.replace(this.rules.other.blockquoteSetextReplace,`
|
|
73
76
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
74
|
-
${
|
|
75
|
-
${
|
|
77
|
+
${x}`:x,u=u?`${u}
|
|
78
|
+
${h}`:h;let v=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,m,!0),this.lexer.state.top=v,i.length===0)break;let C=m.at(-1);if(C?.type==="code")break;if(C?.type==="blockquote"){let j=C,w=j.raw+`
|
|
76
79
|
`+i.join(`
|
|
77
|
-
`),S=this.blockquote(
|
|
80
|
+
`),S=this.blockquote(w);m[m.length-1]=S,o=o.substring(0,o.length-j.raw.length)+S.raw,u=u.substring(0,u.length-j.text.length)+S.text;break}else if(C?.type==="list"){let j=C,w=j.raw+`
|
|
78
81
|
`+i.join(`
|
|
79
|
-
`),S=this.list(
|
|
80
|
-
`);continue}}return{type:"blockquote",raw:o,tokens:m,text:u}}}list(l){let r=this.rules.block.list.exec(l);if(r){let i=r[1].trim(),o=i.length>1,u={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let m=this.rules.other.listItemRegex(i),p=!1;for(;l;){let f=!1,
|
|
81
|
-
`,1)[0],r[1].length),
|
|
82
|
-
`,1)[0],v
|
|
83
|
-
`,l=l.substring(
|
|
84
|
-
`,1)[0]
|
|
85
|
-
|
|
86
|
-
`+
|
|
87
|
-
`,l=l.substring(
|
|
88
|
-
`):[],m={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===o.length){for(let p of o)this.rules.other.tableAlignRight.test(p)?m.align.push("right"):this.rules.other.tableAlignCenter.test(p)?m.align.push("center"):this.rules.other.tableAlignLeft.test(p)?m.align.push("left"):m.align.push(null);for(let p=0;p<i.length;p++)m.header.push({text:i[p],tokens:this.lexer.inline(i[p]),header:!0,align:m.align[p]});for(let p of u)m.rows.push(
|
|
89
|
-
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(l){let r=this.rules.block.text.exec(l);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(l){let r=this.rules.inline.escape.exec(l);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(l){let r=this.rules.inline.tag.exec(l);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(l){let r=this.rules.inline.link.exec(l);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let m=
|
|
90
|
-
`),this.blockTokens(r,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let o=this.inlineQueue[i];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(r,i=[],o=!1){for(this.options.pedantic&&(r=r.replace(
|
|
82
|
+
`),S=this.list(w);m[m.length-1]=S,o=o.substring(0,o.length-C.raw.length)+S.raw,u=u.substring(0,u.length-j.raw.length)+S.raw,i=w.substring(m.at(-1).raw.length).split(`
|
|
83
|
+
`);continue}}return{type:"blockquote",raw:o,tokens:m,text:u}}}list(l){let r=this.rules.block.list.exec(l);if(r){let i=r[1].trim(),o=i.length>1,u={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let m=this.rules.other.listItemRegex(i),p=!1;for(;l;){let f=!1,x="",h="";if(!(r=m.exec(l))||this.rules.block.hr.test(l))break;x=r[0],l=l.substring(x.length);let v=Xy(r[2].split(`
|
|
84
|
+
`,1)[0],r[1].length),C=l.split(`
|
|
85
|
+
`,1)[0],j=!v.trim(),w=0;if(this.options.pedantic?(w=2,h=v.trimStart()):j?w=r[1].length+1:(w=v.search(this.rules.other.nonSpaceChar),w=w>4?1:w,h=v.slice(w),w+=r[1].length),j&&this.rules.other.blankLine.test(C)&&(x+=C+`
|
|
86
|
+
`,l=l.substring(C.length+1),f=!0),!f){let S=this.rules.other.nextBulletRegex(w),k=this.rules.other.hrRegex(w),E=this.rules.other.fencesBeginRegex(w),M=this.rules.other.headingBeginRegex(w),A=this.rules.other.htmlBeginRegex(w),R=this.rules.other.blockquoteBeginRegex(w);for(;l;){let O=l.split(`
|
|
87
|
+
`,1)[0],$;if(C=O,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),$=C):$=C.replace(this.rules.other.tabCharGlobal," "),E.test(C)||M.test(C)||A.test(C)||R.test(C)||S.test(C)||k.test(C))break;if($.search(this.rules.other.nonSpaceChar)>=w||!C.trim())h+=`
|
|
88
|
+
`+$.slice(w);else{if(j||v.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||E.test(v)||M.test(v)||k.test(v))break;h+=`
|
|
89
|
+
`+C}j=!C.trim(),x+=O+`
|
|
90
|
+
`,l=l.substring(O.length+1),v=$.slice(w)}}u.loose||(p?u.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(p=!0)),u.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),u.raw+=x}let g=u.items.at(-1);if(g)g.raw=g.raw.trimEnd(),g.text=g.text.trimEnd();else return;u.raw=u.raw.trimEnd();for(let f of u.items){if(this.lexer.state.top=!1,f.tokens=this.lexer.blockTokens(f.text,[]),f.task){if(f.text=f.text.replace(this.rules.other.listReplaceTask,""),f.tokens[0]?.type==="text"||f.tokens[0]?.type==="paragraph"){f.tokens[0].raw=f.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),f.tokens[0].text=f.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}}let x=this.rules.other.listTaskCheckbox.exec(f.raw);if(x){let h={type:"checkbox",raw:x[0]+" ",checked:x[0]!=="[ ]"};f.checked=h.checked,u.loose?f.tokens[0]&&["paragraph","text"].includes(f.tokens[0].type)&&"tokens"in f.tokens[0]&&f.tokens[0].tokens?(f.tokens[0].raw=h.raw+f.tokens[0].raw,f.tokens[0].text=h.raw+f.tokens[0].text,f.tokens[0].tokens.unshift(h)):f.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):f.tokens.unshift(h)}}if(!u.loose){let x=f.tokens.filter(v=>v.type==="space"),h=x.length>0&&x.some(v=>this.rules.other.anyLine.test(v.raw));u.loose=h}}if(u.loose)for(let f of u.items){f.loose=!0;for(let x of f.tokens)x.type==="text"&&(x.type="paragraph")}return u}}html(l){let r=this.rules.block.html.exec(l);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(l){let r=this.rules.block.def.exec(l);if(r){let i=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",u=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:o,title:u}}}table(l){let r=this.rules.block.table.exec(l);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=dh(r[1]),o=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),u=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
91
|
+
`):[],m={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===o.length){for(let p of o)this.rules.other.tableAlignRight.test(p)?m.align.push("right"):this.rules.other.tableAlignCenter.test(p)?m.align.push("center"):this.rules.other.tableAlignLeft.test(p)?m.align.push("left"):m.align.push(null);for(let p=0;p<i.length;p++)m.header.push({text:i[p],tokens:this.lexer.inline(i[p]),header:!0,align:m.align[p]});for(let p of u)m.rows.push(dh(p,m.header.length).map((g,f)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:m.align[f]})));return m}}lheading(l){let r=this.rules.block.lheading.exec(l);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(l){let r=this.rules.block.paragraph.exec(l);if(r){let i=r[1].charAt(r[1].length-1)===`
|
|
92
|
+
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(l){let r=this.rules.block.text.exec(l);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(l){let r=this.rules.inline.escape.exec(l);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(l){let r=this.rules.inline.tag.exec(l);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(l){let r=this.rules.inline.link.exec(l);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let m=qs(i.slice(0,-1),"\\");if((i.length-m.length)%2===0)return}else{let m=Qy(r[2],"()");if(m===-2)return;if(m>-1){let p=(r[0].indexOf("!")===0?5:4)+r[1].length+m;r[2]=r[2].substring(0,m),r[0]=r[0].substring(0,p).trim(),r[3]=""}}let o=r[2],u="";if(this.options.pedantic){let m=this.rules.other.pedanticHrefTitle.exec(o);m&&(o=m[1],u=m[3])}else u=r[3]?r[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?o=o.slice(1):o=o.slice(1,-1)),mh(r,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:u&&u.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(l,r){let i;if((i=this.rules.inline.reflink.exec(l))||(i=this.rules.inline.nolink.exec(l))){let o=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),u=r[o.toLowerCase()];if(!u){let m=i[0].charAt(0);return{type:"text",raw:m,text:m}}return mh(i,u,i[0],this.lexer,this.rules)}}emStrong(l,r,i=""){let o=this.rules.inline.emStrongLDelim.exec(l);if(!(!o||o[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[2])||!i||this.rules.inline.punctuation.exec(i))){let u=[...o[0]].length-1,m,p,g=u,f=0,x=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,r=r.slice(-1*l.length+u);(o=x.exec(r))!=null;){if(m=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!m)continue;if(p=[...m].length,o[3]||o[4]){g+=p;continue}else if((o[5]||o[6])&&u%3&&!((u+p)%3)){f+=p;continue}if(g-=p,g>0)continue;p=Math.min(p,p+g+f);let h=[...o[0]][0].length,v=l.slice(0,u+o.index+h+p);if(Math.min(u,p)%2){let j=v.slice(1,-1);return{type:"em",raw:v,text:j,tokens:this.lexer.inlineTokens(j)}}let C=v.slice(2,-2);return{type:"strong",raw:v,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(l){let r=this.rules.inline.code.exec(l);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(i),u=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return o&&u&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(l){let r=this.rules.inline.br.exec(l);if(r)return{type:"br",raw:r[0]}}del(l,r,i=""){let o=this.rules.inline.delLDelim.exec(l);if(o&&(!o[1]||!i||this.rules.inline.punctuation.exec(i))){let u=[...o[0]].length-1,m,p,g=u,f=this.rules.inline.delRDelim;for(f.lastIndex=0,r=r.slice(-1*l.length+u);(o=f.exec(r))!=null;){if(m=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!m||(p=[...m].length,p!==u))continue;if(o[3]||o[4]){g+=p;continue}if(g-=p,g>0)continue;p=Math.min(p,p+g);let x=[...o[0]][0].length,h=l.slice(0,u+o.index+x+p),v=h.slice(u,-u);return{type:"del",raw:h,text:v,tokens:this.lexer.inlineTokens(v)}}}}autolink(l){let r=this.rules.inline.autolink.exec(l);if(r){let i,o;return r[2]==="@"?(i=r[1],o="mailto:"+i):(i=r[1],o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(l){let r;if(r=this.rules.inline.url.exec(l)){let i,o;if(r[2]==="@")i=r[0],o="mailto:"+i;else{let u;do u=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(u!==r[0]);i=r[0],r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(l){let r=this.rules.inline.text.exec(l);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},Nn=class bu{tokens;options;state;inlineQueue;tokenizer;constructor(r){this.tokens=[],this.tokens.links=Object.create(null),this.options=r||Ka,this.options.tokenizer=this.options.tokenizer||new vi,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let i={other:Gt,block:di.normal,inline:Gs.normal};this.options.pedantic?(i.block=di.pedantic,i.inline=Gs.pedantic):this.options.gfm&&(i.block=di.gfm,this.options.breaks?i.inline=Gs.breaks:i.inline=Gs.gfm),this.tokenizer.rules=i}static get rules(){return{block:di,inline:Gs}}static lex(r,i){return new bu(i).lex(r)}static lexInline(r,i){return new bu(i).inlineTokens(r)}lex(r){r=r.replace(Gt.carriageReturn,`
|
|
93
|
+
`),this.blockTokens(r,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let o=this.inlineQueue[i];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(r,i=[],o=!1){for(this.options.pedantic&&(r=r.replace(Gt.tabCharGlobal," ").replace(Gt.spaceLine,""));r;){let u;if(this.options.extensions?.block?.some(p=>(u=p.call({lexer:this},r,i))?(r=r.substring(u.raw.length),i.push(u),!0):!1))continue;if(u=this.tokenizer.space(r)){r=r.substring(u.raw.length);let p=i.at(-1);u.raw.length===1&&p!==void 0?p.raw+=`
|
|
91
94
|
`:i.push(u);continue}if(u=this.tokenizer.code(r)){r=r.substring(u.raw.length);let p=i.at(-1);p?.type==="paragraph"||p?.type==="text"?(p.raw+=(p.raw.endsWith(`
|
|
92
95
|
`)?"":`
|
|
93
96
|
`)+u.raw,p.text+=`
|
|
94
97
|
`+u.text,this.inlineQueue.at(-1).src=p.text):i.push(u);continue}if(u=this.tokenizer.fences(r)){r=r.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.heading(r)){r=r.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.hr(r)){r=r.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.blockquote(r)){r=r.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.list(r)){r=r.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.html(r)){r=r.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.def(r)){r=r.substring(u.raw.length);let p=i.at(-1);p?.type==="paragraph"||p?.type==="text"?(p.raw+=(p.raw.endsWith(`
|
|
95
98
|
`)?"":`
|
|
96
99
|
`)+u.raw,p.text+=`
|
|
97
|
-
`+u.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[u.tag]||(this.tokens.links[u.tag]={href:u.href,title:u.title},i.push(u));continue}if(u=this.tokenizer.table(r)){r=r.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.lheading(r)){r=r.substring(u.raw.length),i.push(u);continue}let m=r;if(this.options.extensions?.startBlock){let p=1/0,
|
|
100
|
+
`+u.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[u.tag]||(this.tokens.links[u.tag]={href:u.href,title:u.title},i.push(u));continue}if(u=this.tokenizer.table(r)){r=r.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.lheading(r)){r=r.substring(u.raw.length),i.push(u);continue}let m=r;if(this.options.extensions?.startBlock){let p=1/0,g=r.slice(1),f;this.options.extensions.startBlock.forEach(x=>{f=x.call({lexer:this},g),typeof f=="number"&&f>=0&&(p=Math.min(p,f))}),p<1/0&&p>=0&&(m=r.substring(0,p+1))}if(this.state.top&&(u=this.tokenizer.paragraph(m))){let p=i.at(-1);o&&p?.type==="paragraph"?(p.raw+=(p.raw.endsWith(`
|
|
98
101
|
`)?"":`
|
|
99
102
|
`)+u.raw,p.text+=`
|
|
100
103
|
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):i.push(u),o=m.length!==r.length,r=r.substring(u.raw.length);continue}if(u=this.tokenizer.text(r)){r=r.substring(u.raw.length);let p=i.at(-1);p?.type==="text"?(p.raw+=(p.raw.endsWith(`
|
|
101
104
|
`)?"":`
|
|
102
105
|
`)+u.raw,p.text+=`
|
|
103
|
-
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):i.push(u);continue}if(r){let p="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return this.state.top=!0,i}inline(r,i=[]){return this.inlineQueue.push({src:r,tokens:i}),i}inlineTokens(r,i=[]){let o=r,u=null;if(this.tokens.links){let f=Object.keys(this.tokens.links);if(f.length>0)for(;(u=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)f.includes(u[0].slice(u[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,u.index)+"["+"a".repeat(u[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(u=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,u.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let m;for(;(u=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)m=u[2]?u[2].length:0,o=o.slice(0,u.index+m)+"["+"a".repeat(u[0].length-m-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);o=this.options.hooks?.emStrongMask?.call({lexer:this},o)??o;let p=!1,
|
|
104
|
-
`;return o?'<pre><code class="language-'+
|
|
105
|
-
`:"<pre><code>"+(i?u:
|
|
106
|
+
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):i.push(u);continue}if(r){let p="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return this.state.top=!0,i}inline(r,i=[]){return this.inlineQueue.push({src:r,tokens:i}),i}inlineTokens(r,i=[]){let o=r,u=null;if(this.tokens.links){let f=Object.keys(this.tokens.links);if(f.length>0)for(;(u=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)f.includes(u[0].slice(u[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,u.index)+"["+"a".repeat(u[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(u=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,u.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let m;for(;(u=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)m=u[2]?u[2].length:0,o=o.slice(0,u.index+m)+"["+"a".repeat(u[0].length-m-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);o=this.options.hooks?.emStrongMask?.call({lexer:this},o)??o;let p=!1,g="";for(;r;){p||(g=""),p=!1;let f;if(this.options.extensions?.inline?.some(h=>(f=h.call({lexer:this},r,i))?(r=r.substring(f.raw.length),i.push(f),!0):!1))continue;if(f=this.tokenizer.escape(r)){r=r.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.tag(r)){r=r.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.link(r)){r=r.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.reflink(r,this.tokens.links)){r=r.substring(f.raw.length);let h=i.at(-1);f.type==="text"&&h?.type==="text"?(h.raw+=f.raw,h.text+=f.text):i.push(f);continue}if(f=this.tokenizer.emStrong(r,o,g)){r=r.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.codespan(r)){r=r.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.br(r)){r=r.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.del(r,o,g)){r=r.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.autolink(r)){r=r.substring(f.raw.length),i.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(r))){r=r.substring(f.raw.length),i.push(f);continue}let x=r;if(this.options.extensions?.startInline){let h=1/0,v=r.slice(1),C;this.options.extensions.startInline.forEach(j=>{C=j.call({lexer:this},v),typeof C=="number"&&C>=0&&(h=Math.min(h,C))}),h<1/0&&h>=0&&(x=r.substring(0,h+1))}if(f=this.tokenizer.inlineText(x)){r=r.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(g=f.raw.slice(-1)),p=!0;let h=i.at(-1);h?.type==="text"?(h.raw+=f.raw,h.text+=f.text):i.push(f);continue}if(r){let h="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return i}},ji=class{options;parser;constructor(l){this.options=l||Ka}space(l){return""}code({text:l,lang:r,escaped:i}){let o=(r||"").match(Gt.notSpaceStart)?.[0],u=l.replace(Gt.endingNewline,"")+`
|
|
107
|
+
`;return o?'<pre><code class="language-'+Dn(o)+'">'+(i?u:Dn(u,!0))+`</code></pre>
|
|
108
|
+
`:"<pre><code>"+(i?u:Dn(u,!0))+`</code></pre>
|
|
106
109
|
`}blockquote({tokens:l}){return`<blockquote>
|
|
107
110
|
${this.parser.parse(l)}</blockquote>
|
|
108
111
|
`}html({text:l}){return l}def(l){return""}heading({tokens:l,depth:r}){return`<h${r}>${this.parser.parseInline(l)}</h${r}>
|
|
109
112
|
`}hr(l){return`<hr>
|
|
110
|
-
`}list(l){let r=l.ordered,i=l.start,o="";for(let p=0;p<l.items.length;p++){let
|
|
113
|
+
`}list(l){let r=l.ordered,i=l.start,o="";for(let p=0;p<l.items.length;p++){let g=l.items[p];o+=this.listitem(g)}let u=r?"ol":"ul",m=r&&i!==1?' start="'+i+'"':"";return"<"+u+m+`>
|
|
111
114
|
`+o+"</"+u+`>
|
|
112
115
|
`}listitem(l){return`<li>${this.parser.parse(l.tokens)}</li>
|
|
113
116
|
`}checkbox({checked:l}){return"<input "+(l?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:l}){return`<p>${this.parser.parseInline(l)}</p>
|
|
@@ -118,19 +121,19 @@ ${this.parser.parse(l)}</blockquote>
|
|
|
118
121
|
`}tablerow({text:l}){return`<tr>
|
|
119
122
|
${l}</tr>
|
|
120
123
|
`}tablecell(l){let r=this.parser.parseInline(l.tokens),i=l.header?"th":"td";return(l.align?`<${i} align="${l.align}">`:`<${i}>`)+r+`</${i}>
|
|
121
|
-
`}strong({tokens:l}){return`<strong>${this.parser.parseInline(l)}</strong>`}em({tokens:l}){return`<em>${this.parser.parseInline(l)}</em>`}codespan({text:l}){return`<code>${
|
|
122
|
-
Please report this to https://github.com/markedjs/marked.`,l){let o="<p>An error occurred:</p><pre>"+
|
|
124
|
+
`}strong({tokens:l}){return`<strong>${this.parser.parseInline(l)}</strong>`}em({tokens:l}){return`<em>${this.parser.parseInline(l)}</em>`}codespan({text:l}){return`<code>${Dn(l,!0)}</code>`}br(l){return"<br>"}del({tokens:l}){return`<del>${this.parser.parseInline(l)}</del>`}link({href:l,title:r,tokens:i}){let o=this.parser.parseInline(i),u=uh(l);if(u===null)return o;l=u;let m='<a href="'+l+'"';return r&&(m+=' title="'+Dn(r)+'"'),m+=">"+o+"</a>",m}image({href:l,title:r,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));let u=uh(l);if(u===null)return Dn(i);l=u;let m=`<img src="${l}" alt="${Dn(i)}"`;return r&&(m+=` title="${Dn(r)}"`),m+=">",m}text(l){return"tokens"in l&&l.tokens?this.parser.parseInline(l.tokens):"escaped"in l&&l.escaped?l.text:Dn(l.text)}},Fu=class{strong({text:l}){return l}em({text:l}){return l}codespan({text:l}){return l}del({text:l}){return l}html({text:l}){return l}text({text:l}){return l}link({text:l}){return""+l}image({text:l}){return""+l}br(){return""}checkbox({raw:l}){return l}},Sn=class yu{options;renderer;textRenderer;constructor(r){this.options=r||Ka,this.options.renderer=this.options.renderer||new ji,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Fu}static parse(r,i){return new yu(i).parse(r)}static parseInline(r,i){return new yu(i).parseInline(r)}parse(r){let i="";for(let o=0;o<r.length;o++){let u=r[o];if(this.options.extensions?.renderers?.[u.type]){let p=u,g=this.options.extensions.renderers[p.type].call({parser:this},p);if(g!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(p.type)){i+=g||"";continue}}let m=u;switch(m.type){case"space":{i+=this.renderer.space(m);break}case"hr":{i+=this.renderer.hr(m);break}case"heading":{i+=this.renderer.heading(m);break}case"code":{i+=this.renderer.code(m);break}case"table":{i+=this.renderer.table(m);break}case"blockquote":{i+=this.renderer.blockquote(m);break}case"list":{i+=this.renderer.list(m);break}case"checkbox":{i+=this.renderer.checkbox(m);break}case"html":{i+=this.renderer.html(m);break}case"def":{i+=this.renderer.def(m);break}case"paragraph":{i+=this.renderer.paragraph(m);break}case"text":{i+=this.renderer.text(m);break}default:{let p='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return i}parseInline(r,i=this.renderer){let o="";for(let u=0;u<r.length;u++){let m=r[u];if(this.options.extensions?.renderers?.[m.type]){let g=this.options.extensions.renderers[m.type].call({parser:this},m);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){o+=g||"";continue}}let p=m;switch(p.type){case"escape":{o+=i.text(p);break}case"html":{o+=i.html(p);break}case"link":{o+=i.link(p);break}case"image":{o+=i.image(p);break}case"checkbox":{o+=i.checkbox(p);break}case"strong":{o+=i.strong(p);break}case"em":{o+=i.em(p);break}case"codespan":{o+=i.codespan(p);break}case"br":{o+=i.br(p);break}case"del":{o+=i.del(p);break}case"text":{o+=i.text(p);break}default:{let g='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return o}},Vs=class{options;block;constructor(l){this.options=l||Ka}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(l){return l}postprocess(l){return l}processAllTokens(l){return l}emStrongMask(l){return l}provideLexer(){return this.block?Nn.lex:Nn.lexInline}provideParser(){return this.block?Sn.parse:Sn.parseInline}},Jy=class{defaults=zu();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Sn;Renderer=ji;TextRenderer=Fu;Lexer=Nn;Tokenizer=vi;Hooks=Vs;constructor(...l){this.use(...l)}walkTokens(l,r){let i=[];for(let o of l)switch(i=i.concat(r.call(this,o)),o.type){case"table":{let u=o;for(let m of u.header)i=i.concat(this.walkTokens(m.tokens,r));for(let m of u.rows)for(let p of m)i=i.concat(this.walkTokens(p.tokens,r));break}case"list":{let u=o;i=i.concat(this.walkTokens(u.items,r));break}default:{let u=o;this.defaults.extensions?.childTokens?.[u.type]?this.defaults.extensions.childTokens[u.type].forEach(m=>{let p=u[m].flat(1/0);i=i.concat(this.walkTokens(p,r))}):u.tokens&&(i=i.concat(this.walkTokens(u.tokens,r)))}}return i}use(...l){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return l.forEach(i=>{let o={...i};if(o.async=this.defaults.async||o.async||!1,i.extensions&&(i.extensions.forEach(u=>{if(!u.name)throw new Error("extension name required");if("renderer"in u){let m=r.renderers[u.name];m?r.renderers[u.name]=function(...p){let g=u.renderer.apply(this,p);return g===!1&&(g=m.apply(this,p)),g}:r.renderers[u.name]=u.renderer}if("tokenizer"in u){if(!u.level||u.level!=="block"&&u.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let m=r[u.level];m?m.unshift(u.tokenizer):r[u.level]=[u.tokenizer],u.start&&(u.level==="block"?r.startBlock?r.startBlock.push(u.start):r.startBlock=[u.start]:u.level==="inline"&&(r.startInline?r.startInline.push(u.start):r.startInline=[u.start]))}"childTokens"in u&&u.childTokens&&(r.childTokens[u.name]=u.childTokens)}),o.extensions=r),i.renderer){let u=this.defaults.renderer||new ji(this.defaults);for(let m in i.renderer){if(!(m in u))throw new Error(`renderer '${m}' does not exist`);if(["options","parser"].includes(m))continue;let p=m,g=i.renderer[p],f=u[p];u[p]=(...x)=>{let h=g.apply(u,x);return h===!1&&(h=f.apply(u,x)),h||""}}o.renderer=u}if(i.tokenizer){let u=this.defaults.tokenizer||new vi(this.defaults);for(let m in i.tokenizer){if(!(m in u))throw new Error(`tokenizer '${m}' does not exist`);if(["options","rules","lexer"].includes(m))continue;let p=m,g=i.tokenizer[p],f=u[p];u[p]=(...x)=>{let h=g.apply(u,x);return h===!1&&(h=f.apply(u,x)),h}}o.tokenizer=u}if(i.hooks){let u=this.defaults.hooks||new Vs;for(let m in i.hooks){if(!(m in u))throw new Error(`hook '${m}' does not exist`);if(["options","block"].includes(m))continue;let p=m,g=i.hooks[p],f=u[p];Vs.passThroughHooks.has(m)?u[p]=x=>{if(this.defaults.async&&Vs.passThroughHooksRespectAsync.has(m))return(async()=>{let v=await g.call(u,x);return f.call(u,v)})();let h=g.call(u,x);return f.call(u,h)}:u[p]=(...x)=>{if(this.defaults.async)return(async()=>{let v=await g.apply(u,x);return v===!1&&(v=await f.apply(u,x)),v})();let h=g.apply(u,x);return h===!1&&(h=f.apply(u,x)),h}}o.hooks=u}if(i.walkTokens){let u=this.defaults.walkTokens,m=i.walkTokens;o.walkTokens=function(p){let g=[];return g.push(m.call(this,p)),u&&(g=g.concat(u.call(this,p))),g}}this.defaults={...this.defaults,...o}}),this}setOptions(l){return this.defaults={...this.defaults,...l},this}lexer(l,r){return Nn.lex(l,r??this.defaults)}parser(l,r){return Sn.parse(l,r??this.defaults)}parseMarkdown(l){return(r,i)=>{let o={...i},u={...this.defaults,...o},m=this.onError(!!u.silent,!!u.async);if(this.defaults.async===!0&&o.async===!1)return m(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 m(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return m(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(u.hooks&&(u.hooks.options=u,u.hooks.block=l),u.async)return(async()=>{let p=u.hooks?await u.hooks.preprocess(r):r,g=await(u.hooks?await u.hooks.provideLexer():l?Nn.lex:Nn.lexInline)(p,u),f=u.hooks?await u.hooks.processAllTokens(g):g;u.walkTokens&&await Promise.all(this.walkTokens(f,u.walkTokens));let x=await(u.hooks?await u.hooks.provideParser():l?Sn.parse:Sn.parseInline)(f,u);return u.hooks?await u.hooks.postprocess(x):x})().catch(m);try{u.hooks&&(r=u.hooks.preprocess(r));let p=(u.hooks?u.hooks.provideLexer():l?Nn.lex:Nn.lexInline)(r,u);u.hooks&&(p=u.hooks.processAllTokens(p)),u.walkTokens&&this.walkTokens(p,u.walkTokens);let g=(u.hooks?u.hooks.provideParser():l?Sn.parse:Sn.parseInline)(p,u);return u.hooks&&(g=u.hooks.postprocess(g)),g}catch(p){return m(p)}}}onError(l,r){return i=>{if(i.message+=`
|
|
125
|
+
Please report this to https://github.com/markedjs/marked.`,l){let o="<p>An error occurred:</p><pre>"+Dn(i.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},Ja=new Jy;function Ye(l,r){return Ja.parse(l,r)}Ye.options=Ye.setOptions=function(l){return Ja.setOptions(l),Ye.defaults=Ja.defaults,Wh(Ye.defaults),Ye};Ye.getDefaults=zu;Ye.defaults=Ka;Ye.use=function(...l){return Ja.use(...l),Ye.defaults=Ja.defaults,Wh(Ye.defaults),Ye};Ye.walkTokens=function(l,r){return Ja.walkTokens(l,r)};Ye.parseInline=Ja.parseInline;Ye.Parser=Sn;Ye.parser=Sn.parse;Ye.Renderer=ji;Ye.TextRenderer=Fu;Ye.Lexer=Nn;Ye.lexer=Nn.lex;Ye.Tokenizer=vi;Ye.Hooks=Vs;Ye.parse=Ye;Ye.options;Ye.setOptions;Ye.use;Ye.walkTokens;Ye.parseInline;Sn.parse;Nn.lex;const Ky=new Set(["script","iframe","object","embed","style","link","meta"]),Py=new Set(["script","iframe","object","embed","link","meta"]);function Zu(l){const r=new DOMParser().parseFromString(l,"text/html");return Vu(r.body,Ky),r.body.innerHTML}function Wy(l){const i=new DOMParser().parseFromString(l,"image/svg+xml").documentElement;return i.tagName==="parsererror"||i.querySelector("parsererror")?"":(Vu(i,Py),new XMLSerializer().serializeToString(i))}function Vu(l,r){const i=[];for(const o of l.childNodes)if(o.nodeType===Node.ELEMENT_NODE){const u=o,m=u.tagName.toLowerCase();if(r.has(m)){i.push(o);continue}for(const p of Array.from(u.attributes)){p.name.toLowerCase().startsWith("on")&&u.removeAttribute(p.name);const g=p.value.trim().toLowerCase();(g.startsWith("javascript:")||g.startsWith("data:text/html"))&&u.removeAttribute(p.name)}Vu(o,r)}for(const o of i)l.removeChild(o)}Ye.setOptions({breaks:!0,gfm:!0});function dx(l){switch(l.type){case"user-prompt":return{label:"You",text:(l.content.split(`
|
|
123
126
|
`).find(i=>i.trim())||"").slice(0,100)};case"compaction-summary":return{label:"Compaction",text:l.content.slice(0,80)};case"context-injection":return{label:"Injection",text:l.content.slice(0,80)};case"thinking":return{label:"Thinking",text:l.content.slice(0,80)};case"text-response":return{label:"Response",text:(l.content.split(`
|
|
124
|
-
`).find(i=>i.trim())||"").slice(0,100)};case"tool-call":return{label:l.toolName,text:l.diff?.filePath||l.bashOutput?.command||Object.values(l.input).filter(r=>typeof r=="string").join(", ").slice(0,80)||""}}}function Wh(l){switch(l.type){case"user-prompt":return"text-terminal-green";case"compaction-summary":return"text-terminal-dim";case"context-injection":return"text-blue-400";case"thinking":return"text-terminal-purple";case"text-response":return"text-terminal-blue";case"tool-call":return"text-terminal-orange"}}function ex({actions:l,scenes:r,currentIndex:i,onSeek:o,addingForScene:u,onClearAddingTarget:m,readOnly:p=!1}){const{annotations:x,add:f,update:g,remove:b}=l,[j,T]=y.useState(null),[v,N]=y.useState(""),[S,k]=y.useState(null),[E,M]=y.useState(""),A=y.useRef(null),_=y.useRef(null),z=y.useRef(null),B=y.useRef(null),F=u??j;y.useEffect(()=>{u!==null&&(N(""),T(null),setTimeout(()=>{B.current?.scrollIntoView({behavior:"smooth",block:"nearest"}),A.current?.focus()},50))},[u]),y.useEffect(()=>{F!==null&&A.current&&A.current.focus()},[F]),y.useEffect(()=>{S&&_.current&&_.current.focus()},[S]);const ee=y.useMemo(()=>[...x].sort((ce,pe)=>ce.sceneIndex-pe.sceneIndex),[x]);y.useEffect(()=>{if(!z.current||F!==null)return;const ce=z.current.querySelectorAll("[data-annotation-scene]");let pe=null,H=1/0;ce.forEach(L=>{const te=Number(L.getAttribute("data-annotation-scene")),oe=Math.abs(te-i);oe<H&&(H=oe,pe=L)}),pe&&H<=3&&pe.scrollIntoView({behavior:"smooth",block:"nearest"})},[i,F]);const me=y.useCallback(()=>{T(null),N(""),m()},[m]),$=y.useCallback(()=>{!v.trim()||F===null||(f(F,v.trim()),N(""),T(null),m())},[f,F,v,m]),I=y.useCallback(()=>{!S||!E.trim()||(g(S,E.trim()),k(null),M(""))},[S,E,g]),P=F!==null&&r[F]?Ph(r[F]):null,de=F!==null&&r[F]?Wh(r[F]):"";return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-terminal-border-subtle",children:[a.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest",children:"Comments"}),a.jsxs("div",{className:"flex items-center gap-2",children:[p&&a.jsx("span",{className:"text-xs font-mono text-terminal-dimmer uppercase px-1.5 py-0.5 rounded bg-terminal-surface",children:"Read-only"}),a.jsx("span",{className:"text-xs font-mono text-terminal-dim",children:x.length})]})]}),a.jsxs("div",{ref:z,className:"flex-1 overflow-y-auto",children:[ee.length===0&&F===null&&a.jsxs("div",{className:"px-3 py-8 text-center",children:[a.jsx("div",{className:"text-terminal-dim text-xs font-mono mb-2",children:"No comments yet"}),!p&&a.jsx("div",{className:"text-terminal-dimmer text-xs font-mono",children:"Hover over any message and click the comment icon to add one"})]}),ee.map(ce=>a.jsx(Ay,{annotation:ce,scene:r[ce.sceneIndex],isCurrent:ce.sceneIndex===i,isEditing:!p&&S===ce.id,editBody:S===ce.id?E:"",editTextareaRef:S===ce.id?_:void 0,onSeek:()=>o(ce.sceneIndex),onStartEdit:()=>{k(ce.id),M(ce.body)},onCancelEdit:()=>{k(null),M("")},onSaveEdit:I,onEditBodyChange:M,onDelete:()=>b(ce.id),readOnly:p},ce.id)),!p&&F!==null&&a.jsxs("div",{ref:B,className:"px-3 py-2.5 border-b border-terminal-border-subtle bg-terminal-blue-subtle",children:[P&&a.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[a.jsx("span",{className:`text-xs font-mono font-semibold uppercase ${de}`,children:P.label}),a.jsx("span",{className:"text-xs font-mono text-terminal-dim truncate",children:P.text})]}),a.jsx("textarea",{ref:A,value:v,onChange:ce=>N(ce.target.value),onKeyDown:ce=>{ce.key==="Enter"&&(ce.metaKey||ce.ctrlKey)&&(ce.preventDefault(),$()),ce.key==="Escape"&&me()},placeholder:"Add a comment... (Markdown supported)",className:"w-full bg-terminal-surface rounded px-2 py-1.5 text-xs font-mono text-terminal-text placeholder-terminal-dimmer resize-none focus:outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-blue/40 transition-shadow duration-200",rows:3}),a.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[a.jsxs("span",{className:"text-xs font-mono text-terminal-dimmer",children:["⌘","+Enter to save"]}),a.jsxs("div",{className:"flex gap-1.5",children:[a.jsx("button",{onClick:me,className:"px-2 py-1 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"}),a.jsx("button",{onClick:$,disabled:!v.trim(),className:"px-2 py-1 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue rounded hover:bg-terminal-blue-emphasis transition-colors disabled:opacity-40",children:"Comment"})]})]})]})]})]})}const Ay=y.memo(function({annotation:r,scene:i,isCurrent:o,isEditing:u,editBody:m,editTextareaRef:p,onSeek:x,onStartEdit:f,onCancelEdit:g,onSaveEdit:b,onEditBodyChange:j,onDelete:T,readOnly:v=!1}){const[N,S]=y.useState(!1),k=i?Ph(i):null,E=i?Wh(i):"text-terminal-dim",M=y.useMemo(()=>{try{return new Date(r.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return""}},[r.createdAt]),A=r.author==="vibe-feedback";return a.jsxs("div",{"data-annotation-scene":r.sceneIndex,className:`px-3 py-2 border-b border-terminal-border-subtle transition-colors ${A?o?"bg-terminal-purple/10 border-l-2 border-l-terminal-purple":"bg-terminal-purple/[0.03] hover:bg-terminal-purple/[0.06]":o?"bg-terminal-blue/10 border-l-2 border-l-terminal-blue":"hover:bg-terminal-surface/50"}`,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),children:[A&&a.jsx("div",{className:"flex items-center gap-1.5 mb-1",children:a.jsx("span",{className:"text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-purple px-2 py-0.5 rounded-full bg-terminal-purple-subtle",children:"AI Coach"})}),a.jsxs("button",{onClick:x,className:"flex items-center gap-1.5 mb-1 w-full text-left group/ref",children:[k&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:`text-xs font-mono font-semibold uppercase shrink-0 ${E}`,children:k.label}),a.jsx("span",{className:"text-xs font-mono text-terminal-dim truncate group-hover/ref:text-terminal-text transition-colors",children:k.text})]}),!k&&a.jsxs("span",{className:"text-xs font-mono text-terminal-dim",children:["Step ",r.sceneIndex+1]})]}),a.jsxs("div",{className:"flex items-start gap-1",children:[a.jsx("div",{className:"flex-1 min-w-0",children:u?a.jsxs("div",{children:[a.jsx("textarea",{ref:p,value:m,onChange:_=>j(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),b()),_.key==="Escape"&&g()},className:"w-full bg-terminal-surface rounded px-2 py-1.5 text-xs font-mono text-terminal-text resize-none focus:outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-blue/40 transition-shadow duration-200",rows:3}),a.jsxs("div",{className:"flex justify-end gap-1.5 mt-1",children:[a.jsx("button",{onClick:g,className:"px-2 py-0.5 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"}),a.jsx("button",{onClick:b,className:"px-2 py-0.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue rounded hover:bg-terminal-blue-emphasis transition-colors",children:"Save"})]})]}):a.jsx("div",{className:"prose-terminal text-xs text-terminal-text leading-relaxed",dangerouslySetInnerHTML:{__html:zu(Ze.parse(r.body))}})}),!v&&N&&!u&&a.jsxs("div",{className:"flex gap-0.5 shrink-0 pt-0.5",children:[a.jsx("button",{onClick:f,className:"p-0.5 text-xs text-terminal-dim hover:text-terminal-blue transition-colors",title:"Edit",children:"✎"}),a.jsx("button",{onClick:T,className:"p-0.5 text-xs text-terminal-dim hover:text-terminal-red transition-colors",title:"Delete",children:"✕"})]})]}),a.jsx("div",{className:"text-xs font-mono text-terminal-dimmer mt-1",children:M})]})});function Ry({open:l,onClose:r,actions:i,scenes:o,currentIndex:u,onSeek:m,addingForScene:p,onClearAddingTarget:x,readOnly:f}){return y.useEffect(()=>{if(!l)return;const g=b=>{b.key==="Escape"&&(b.preventDefault(),r())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[l,r]),a.jsxs("div",{className:`fixed inset-0 z-30 hidden md:block transition-opacity duration-300 ${l?"opacity-100":"opacity-0 pointer-events-none"}`,children:[a.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:r}),a.jsxs("div",{className:`absolute top-0 right-0 bottom-0 w-80 bg-terminal-bg border-l border-terminal-border-subtle shadow-layer-xl flex flex-col transition-transform duration-300 ease-material-decel ${l?"translate-x-0":"translate-x-full"}`,onClick:g=>g.stopPropagation(),children:[a.jsx("button",{onClick:r,className:"absolute top-2 right-2 z-10 p-1 text-terminal-dim hover:text-terminal-text transition-colors",title:"Close comments",children:"✕"}),a.jsx(ex,{actions:i,scenes:o,currentIndex:u,onSeek:m,addingForScene:p,onClearAddingTarget:x,readOnly:f})]})]})}const My=[1,5,10];function _y({state:l,speed:r,currentIndex:i,totalScenes:o,userPromptCount:u,currentTurn:m,onTogglePlayPause:p,onChangeSpeed:x,onPrevPrompt:f,onNextPrompt:g,onOpenSearch:b,onOpenOutline:j,onShowHelp:T}){const v=l==="playing",N=v?"⏸":"▶",S=v?"Pause":"Play",[k,E]=y.useState(null),M=y.useCallback(B=>{E(B),setTimeout(()=>E(null),300)},[]),A=B=>k===B?"scale-105":"",_="px-2.5 py-1.5 text-xs font-sans rounded-lg transition-all duration-200 ease-material",z="w-10 h-10 flex items-center justify-center rounded-lg transition-all duration-200 ease-material";return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex md:hidden items-center justify-between px-3 py-1.5",children:[a.jsx("button",{onClick:()=>{M("play"),p()},className:`${z} bg-terminal-green-subtle text-terminal-green ${A("play")}`,title:"Play/Pause",children:a.jsx("span",{className:"text-base",children:N})}),a.jsx("button",{onClick:()=>{M("prev"),f()},className:`${z} bg-terminal-surface text-terminal-text ${A("prev")}`,title:"Previous turn",children:a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M15 18l-6-6 6-6"})})}),a.jsxs("span",{className:"text-xs font-mono text-terminal-text tabular-nums font-medium",children:[m," / ",u]}),a.jsx("button",{onClick:()=>{M("next"),g()},className:`${z} bg-terminal-surface text-terminal-text ${A("next")}`,title:"Next turn",children:a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M9 18l6-6-6-6"})})}),a.jsx("button",{onClick:()=>{M("search"),b()},className:`${z} bg-terminal-surface text-terminal-text ${A("search")}`,title:"Search",children:a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"11",cy:"11",r:"8"}),a.jsx("path",{d:"m21 21-4.35-4.35"})]})}),j&&a.jsx("button",{onClick:()=>{M("outline"),j()},className:`${z} bg-terminal-surface border border-terminal-border text-terminal-text ${A("outline")}`,title:"Outline",children:"☰"})]}),a.jsxs("div",{className:"hidden md:flex items-center justify-between px-5 py-2.5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:()=>{M("play"),p()},className:`${_} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis font-medium ${A("play")}`,title:"Play/Pause (Space)",children:[a.jsx("span",{children:N}),a.jsx("span",{className:"ml-1.5",children:S})]}),a.jsx("div",{className:"flex items-center rounded-lg bg-terminal-surface overflow-hidden",children:My.map(B=>a.jsxs("button",{onClick:()=>{M(`speed-${B}`),x(B)},className:`px-2.5 py-1.5 text-xs font-mono transition-all duration-200 ease-material ${r===B?"bg-terminal-green-subtle text-terminal-green font-medium":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"} ${A(`speed-${B}`)}`,children:[B,"x"]},B))}),a.jsxs("div",{className:"flex items-center",children:[a.jsx("button",{onClick:()=>{M("prev"),f()},className:`${_} text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover ${A("prev")}`,title:"Previous turn (p)",children:"‹"}),a.jsxs("span",{className:"px-1.5 py-1.5 text-xs font-sans text-terminal-dim tabular-nums flex items-center gap-1",children:[a.jsx("span",{className:"font-mono",children:m}),a.jsx("span",{children:"/"}),a.jsx("span",{className:"font-mono",children:u})]}),a.jsx("button",{onClick:()=>{M("next"),g()},className:`${_} text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover ${A("next")}`,title:"Next turn (n)",children:"›"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:()=>{M("search"),b()},className:`h-8 flex-grow flex items-center gap-3 px-3 rounded-lg bg-terminal-surface/20 border border-terminal-border-subtle hover:border-terminal-blue/40 hover:bg-terminal-blue-subtle/20 group/search transition-all duration-200 max-w-sm ${A("search")}`,title:"Search (/ or Cmd+K)",children:[a.jsx("span",{className:"text-sm opacity-70 group-hover/search:opacity-100 transition-opacity",children:"🔍"}),a.jsx("span",{className:"text-[11px] font-sans font-medium text-terminal-dim group-hover/search:text-terminal-blue transition-colors",children:"Type / to search"}),a.jsx("div",{className:"flex items-center gap-1 ml-1 opacity-40 group-hover/search:opacity-80 transition-opacity",children:a.jsx("span",{className:"px-1 py-0.5 rounded bg-terminal-surface border border-terminal-border/50 text-[9px] font-mono font-bold text-terminal-text",children:"/"})})]}),T&&a.jsxs("button",{onClick:()=>{M("help"),T()},className:`flex items-center gap-2.5 px-3 py-1.5 rounded-lg text-terminal-dimmer hover:text-terminal-text hover:bg-terminal-surface-hover group/help transition-all duration-200 ${A("help")}`,title:"Keyboard Shortcuts (?)",children:[a.jsx("div",{className:"flex items-center justify-center w-5 h-5 rounded border border-terminal-border-subtle/50 bg-terminal-surface group-hover/help:border-terminal-text group-hover/help:text-terminal-bg group-hover/help:bg-terminal-text transition-all duration-200",children:a.jsx("span",{className:"text-[11px] font-mono font-black",children:"?"})}),a.jsx("span",{className:"hidden lg:inline text-[10px] font-sans font-bold uppercase tracking-widest opacity-60 group-hover/help:opacity-100",children:"Press ? for help"})]}),a.jsxs("div",{className:"flex items-center gap-2 md:gap-3 text-xs text-terminal-dim font-mono shrink-0",children:[l==="paused"&&a.jsx("span",{className:"text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-orange",children:"Paused"}),a.jsxs("span",{className:"tabular-nums",children:[Math.max(0,i+1)," / ",o]})]})]})]})]})}function Oy(l){if(!l.startsWith("mcp__"))return null;const r=l.split("__");return r.length<3?null:{server:r[1],tool:r.slice(2).join("__")}}function pi(l){const r=Oy(l);return r?`${r.server} · ${r.tool}`:l}const sh=3,hi=y.memo(function({content:r,isActive:i}){const[o,u]=y.useState(!1),m=r.split(`
|
|
125
|
-
`),p=m.length>
|
|
126
|
-
`):r;return
|
|
127
|
-
`));var i=[],o=l.split(/(\n|\r\n)/);o[o.length-1]||o.pop();for(var u=0;u<o.length;u++){var m=o[u];u%2&&!r.newlineIsToken?i[i.length-1]+=m:i.push(m)}return i};
|
|
127
|
+
`).find(i=>i.trim())||"").slice(0,100)};case"tool-call":return{label:l.toolName,text:l.diff?.filePath||l.bashOutput?.command||Object.values(l.input).filter(r=>typeof r=="string").join(", ").slice(0,80)||""}}}function mx(l){switch(l.type){case"user-prompt":return"text-terminal-green";case"compaction-summary":return"text-terminal-dim";case"context-injection":return"text-blue-400";case"thinking":return"text-terminal-purple";case"text-response":return"text-terminal-blue";case"tool-call":return"text-terminal-orange"}}function fx({actions:l,scenes:r,currentIndex:i,onSeek:o,addingForScene:u,onClearAddingTarget:m,readOnly:p=!1}){const{annotations:g,add:f,update:x,remove:h}=l,[v,C]=y.useState(null),[j,w]=y.useState(""),[S,k]=y.useState(null),[E,M]=y.useState(""),A=y.useRef(null),R=y.useRef(null),O=y.useRef(null),$=y.useRef(null),H=u??v;y.useEffect(()=>{u!==null&&(w(""),C(null),setTimeout(()=>{$.current?.scrollIntoView({behavior:"smooth",block:"nearest"}),A.current?.focus()},50))},[u]),y.useEffect(()=>{H!==null&&A.current&&A.current.focus()},[H]),y.useEffect(()=>{S&&R.current&&R.current.focus()},[S]);const K=y.useMemo(()=>[...g].sort((de,pe)=>de.sceneIndex-pe.sceneIndex),[g]);y.useEffect(()=>{if(!O.current||H!==null)return;const de=O.current.querySelectorAll("[data-annotation-scene]");let pe=null,U=1/0;de.forEach(z=>{const Q=Number(z.getAttribute("data-annotation-scene")),ne=Math.abs(Q-i);ne<U&&(U=ne,pe=z)}),pe&&U<=3&&pe.scrollIntoView({behavior:"smooth",block:"nearest"})},[i,H]);const ae=y.useCallback(()=>{C(null),w(""),m()},[m]),ue=y.useCallback(()=>{!j.trim()||H===null||(f(H,j.trim()),w(""),C(null),m())},[f,H,j,m]),oe=y.useCallback(()=>{!S||!E.trim()||(x(S,E.trim()),k(null),M(""))},[S,E,x]),te=H!==null&&r[H]?dx(r[H]):null,xe=H!==null&&r[H]?mx(r[H]):"";return n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-terminal-border-subtle",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest",children:"Comments"}),n.jsxs("div",{className:"flex items-center gap-2",children:[p&&n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer uppercase px-1.5 py-0.5 rounded bg-terminal-surface",children:"Read-only"}),n.jsx("span",{className:"text-xs font-mono text-terminal-dim",children:g.length})]})]}),n.jsxs("div",{ref:O,className:"flex-1 overflow-y-auto",children:[K.length===0&&H===null&&n.jsxs("div",{className:"px-3 py-8 text-center",children:[n.jsx("div",{className:"text-terminal-dim text-xs font-mono mb-2",children:"No comments yet"}),!p&&n.jsx("div",{className:"text-terminal-dimmer text-xs font-mono",children:"Hover over any message and click the comment icon to add one"})]}),K.map(de=>n.jsx(ev,{annotation:de,scene:r[de.sceneIndex],isCurrent:de.sceneIndex===i,isEditing:!p&&S===de.id,editBody:S===de.id?E:"",editTextareaRef:S===de.id?R:void 0,onSeek:()=>o(de.sceneIndex),onStartEdit:()=>{k(de.id),M(de.body)},onCancelEdit:()=>{k(null),M("")},onSaveEdit:oe,onEditBodyChange:M,onDelete:()=>h(de.id),readOnly:p},de.id)),!p&&H!==null&&n.jsxs("div",{ref:$,className:"px-3 py-2.5 border-b border-terminal-border-subtle bg-terminal-blue-subtle",children:[te&&n.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[n.jsx("span",{className:`text-xs font-mono font-semibold uppercase ${xe}`,children:te.label}),n.jsx("span",{className:"text-xs font-mono text-terminal-dim truncate",children:te.text})]}),n.jsx("textarea",{ref:A,value:j,onChange:de=>w(de.target.value),onKeyDown:de=>{de.key==="Enter"&&(de.metaKey||de.ctrlKey)&&(de.preventDefault(),ue()),de.key==="Escape"&&ae()},placeholder:"Add a comment... (Markdown supported)",className:"w-full bg-terminal-surface rounded px-2 py-1.5 text-xs font-mono text-terminal-text placeholder-terminal-dimmer resize-none focus:outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-blue/40 transition-shadow duration-200",rows:3}),n.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[n.jsxs("span",{className:"text-xs font-mono text-terminal-dimmer",children:["⌘","+Enter to save"]}),n.jsxs("div",{className:"flex gap-1.5",children:[n.jsx("button",{onClick:ae,className:"px-2 py-1 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"}),n.jsx("button",{onClick:ue,disabled:!j.trim(),className:"px-2 py-1 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue rounded hover:bg-terminal-blue-emphasis transition-colors disabled:opacity-40",children:"Comment"})]})]})]})]})]})}const ev=y.memo(function({annotation:r,scene:i,isCurrent:o,isEditing:u,editBody:m,editTextareaRef:p,onSeek:g,onStartEdit:f,onCancelEdit:x,onSaveEdit:h,onEditBodyChange:v,onDelete:C,readOnly:j=!1}){const[w,S]=y.useState(!1),k=i?dx(i):null,E=i?mx(i):"text-terminal-dim",M=y.useMemo(()=>{try{return new Date(r.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return""}},[r.createdAt]),A=r.author==="vibe-feedback";return n.jsxs("div",{"data-annotation-scene":r.sceneIndex,className:`px-3 py-2 border-b border-terminal-border-subtle transition-colors ${A?o?"bg-terminal-purple/10 border-l-2 border-l-terminal-purple":"bg-terminal-purple/[0.03] hover:bg-terminal-purple/[0.06]":o?"bg-terminal-blue/10 border-l-2 border-l-terminal-blue":"hover:bg-terminal-surface/50"}`,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),children:[A&&n.jsx("div",{className:"flex items-center gap-1.5 mb-1",children:n.jsx("span",{className:"text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-purple px-2 py-0.5 rounded-full bg-terminal-purple-subtle",children:"AI Coach"})}),n.jsxs("button",{onClick:g,className:"flex items-center gap-1.5 mb-1 w-full text-left group/ref",children:[k&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:`text-xs font-mono font-semibold uppercase shrink-0 ${E}`,children:k.label}),n.jsx("span",{className:"text-xs font-mono text-terminal-dim truncate group-hover/ref:text-terminal-text transition-colors",children:k.text})]}),!k&&n.jsxs("span",{className:"text-xs font-mono text-terminal-dim",children:["Step ",r.sceneIndex+1]})]}),n.jsxs("div",{className:"flex items-start gap-1",children:[n.jsx("div",{className:"flex-1 min-w-0",children:u?n.jsxs("div",{children:[n.jsx("textarea",{ref:p,value:m,onChange:R=>v(R.target.value),onKeyDown:R=>{R.key==="Enter"&&(R.metaKey||R.ctrlKey)&&(R.preventDefault(),h()),R.key==="Escape"&&x()},className:"w-full bg-terminal-surface rounded px-2 py-1.5 text-xs font-mono text-terminal-text resize-none focus:outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-blue/40 transition-shadow duration-200",rows:3}),n.jsxs("div",{className:"flex justify-end gap-1.5 mt-1",children:[n.jsx("button",{onClick:x,className:"px-2 py-0.5 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"}),n.jsx("button",{onClick:h,className:"px-2 py-0.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue rounded hover:bg-terminal-blue-emphasis transition-colors",children:"Save"})]})]}):n.jsx("div",{className:"prose-terminal text-xs text-terminal-text leading-relaxed",dangerouslySetInnerHTML:{__html:Zu(Ye.parse(r.body))}})}),!j&&w&&!u&&n.jsxs("div",{className:"flex gap-0.5 shrink-0 pt-0.5",children:[n.jsx("button",{onClick:f,className:"p-0.5 text-xs text-terminal-dim hover:text-terminal-blue transition-colors",title:"Edit",children:"✎"}),n.jsx("button",{onClick:C,className:"p-0.5 text-xs text-terminal-dim hover:text-terminal-red transition-colors",title:"Delete",children:"✕"})]})]}),n.jsx("div",{className:"text-xs font-mono text-terminal-dimmer mt-1",children:M})]})});function tv({open:l,onClose:r,actions:i,scenes:o,currentIndex:u,onSeek:m,addingForScene:p,onClearAddingTarget:g,readOnly:f}){return y.useEffect(()=>{if(!l)return;const x=h=>{h.key==="Escape"&&(h.preventDefault(),r())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[l,r]),n.jsxs("div",{className:`fixed inset-0 z-50 hidden md:block transition-opacity duration-300 ${l?"opacity-100":"opacity-0 pointer-events-none"}`,children:[n.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:r}),n.jsxs("div",{className:`absolute top-0 right-0 bottom-0 w-80 bg-terminal-bg border-l border-terminal-border-subtle shadow-layer-xl flex flex-col transition-transform duration-300 ease-material-decel ${l?"translate-x-0":"translate-x-full"}`,onClick:x=>x.stopPropagation(),children:[n.jsx("button",{onClick:r,className:"absolute top-2 right-2 z-10 p-1 text-terminal-dim hover:text-terminal-text transition-colors",title:"Close comments",children:"✕"}),n.jsx(fx,{actions:i,scenes:o,currentIndex:u,onSeek:m,addingForScene:p,onClearAddingTarget:g,readOnly:f})]})]})}const nv=[1,5,10];function av({state:l,speed:r,currentIndex:i,totalScenes:o,userPromptCount:u,currentTurn:m,onTogglePlayPause:p,onChangeSpeed:g,onPrevPrompt:f,onNextPrompt:x,onOpenSearch:h,onOpenOutline:v,onShowHelp:C}){const j=l==="playing",w=j?"⏸":"▶",S=j?"Pause":"Play",[k,E]=y.useState(null),M=y.useCallback($=>{E($),setTimeout(()=>E(null),300)},[]),A=$=>k===$?"scale-105":"",R="px-2.5 py-1.5 text-xs font-sans rounded-lg transition-all duration-200 ease-material",O="w-10 h-10 flex items-center justify-center rounded-lg transition-all duration-200 ease-material";return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex md:hidden items-center justify-between px-3 py-1.5",children:[n.jsx("button",{onClick:()=>{M("play"),p()},className:`${O} bg-terminal-green-subtle text-terminal-green ${A("play")}`,title:"Play/Pause",children:n.jsx("span",{className:"text-base",children:w})}),n.jsx("button",{onClick:()=>{M("prev"),f()},className:`${O} bg-terminal-surface text-terminal-text ${A("prev")}`,title:"Previous turn",children:n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M15 18l-6-6 6-6"})})}),n.jsxs("span",{className:"text-xs font-mono text-terminal-text tabular-nums font-medium",children:[m," / ",u]}),n.jsx("button",{onClick:()=>{M("next"),x()},className:`${O} bg-terminal-surface text-terminal-text ${A("next")}`,title:"Next turn",children:n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M9 18l6-6-6-6"})})}),n.jsx("button",{onClick:()=>{M("search"),h()},className:`${O} bg-terminal-surface text-terminal-text ${A("search")}`,title:"Search",children:n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"11",cy:"11",r:"8"}),n.jsx("path",{d:"m21 21-4.35-4.35"})]})}),v&&n.jsx("button",{onClick:()=>{M("outline"),v()},className:`${O} bg-terminal-surface border border-terminal-border text-terminal-text ${A("outline")}`,title:"Outline",children:"☰"})]}),n.jsxs("div",{className:"hidden md:flex items-center justify-between px-5 py-2.5",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>{M("play"),p()},className:`${R} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis font-medium ${A("play")}`,title:"Play/Pause (Space)",children:[n.jsx("span",{children:w}),n.jsx("span",{className:"ml-1.5",children:S})]}),n.jsx("div",{className:"flex items-center rounded-lg bg-terminal-surface overflow-hidden",children:nv.map($=>n.jsxs("button",{onClick:()=>{M(`speed-${$}`),g($)},className:`px-2.5 py-1.5 text-xs font-mono transition-all duration-200 ease-material ${r===$?"bg-terminal-green-subtle text-terminal-green font-medium":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"} ${A(`speed-${$}`)}`,children:[$,"x"]},$))}),n.jsxs("div",{className:"flex items-center",children:[n.jsx("button",{onClick:()=>{M("prev"),f()},className:`${R} text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover ${A("prev")}`,title:"Previous turn (p)",children:"‹"}),n.jsxs("span",{className:"px-1.5 py-1.5 text-xs font-sans text-terminal-dim tabular-nums flex items-center gap-1",children:[n.jsx("span",{className:"font-mono",children:m}),n.jsx("span",{children:"/"}),n.jsx("span",{className:"font-mono",children:u})]}),n.jsx("button",{onClick:()=>{M("next"),x()},className:`${R} text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover ${A("next")}`,title:"Next turn (n)",children:"›"})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>{M("search"),h()},className:`h-8 flex-grow flex items-center gap-3 px-3 rounded-lg bg-terminal-surface/20 border border-terminal-border-subtle hover:border-terminal-blue/40 hover:bg-terminal-blue-subtle/20 group/search transition-all duration-200 max-w-sm ${A("search")}`,title:"Search (/ or Cmd+K)",children:[n.jsx("span",{className:"text-sm opacity-70 group-hover/search:opacity-100 transition-opacity",children:"🔍"}),n.jsx("span",{className:"text-[11px] font-sans font-medium text-terminal-dim group-hover/search:text-terminal-blue transition-colors",children:"Type / to search"}),n.jsx("div",{className:"flex items-center gap-1 ml-1 opacity-40 group-hover/search:opacity-80 transition-opacity",children:n.jsx("span",{className:"px-1 py-0.5 rounded bg-terminal-surface border border-terminal-border/50 text-[9px] font-mono font-bold text-terminal-text",children:"/"})})]}),C&&n.jsxs("button",{onClick:()=>{M("help"),C()},className:`flex items-center gap-2.5 px-3 py-1.5 rounded-lg text-terminal-dimmer hover:text-terminal-text hover:bg-terminal-surface-hover group/help transition-all duration-200 ${A("help")}`,title:"Keyboard Shortcuts (?)",children:[n.jsx("div",{className:"flex items-center justify-center w-5 h-5 rounded border border-terminal-border-subtle/50 bg-terminal-surface group-hover/help:border-terminal-text group-hover/help:text-terminal-bg group-hover/help:bg-terminal-text transition-all duration-200",children:n.jsx("span",{className:"text-[11px] font-mono font-black",children:"?"})}),n.jsx("span",{className:"hidden lg:inline text-[10px] font-sans font-bold uppercase tracking-widest opacity-60 group-hover/help:opacity-100",children:"Press ? for help"})]}),n.jsxs("div",{className:"flex items-center gap-2 md:gap-3 text-xs text-terminal-dim font-mono shrink-0",children:[l==="paused"&&n.jsx("span",{className:"text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-orange",children:"Paused"}),n.jsxs("span",{className:"tabular-nums",children:[Math.max(0,i+1)," / ",o]})]})]})]})]})}function lv(l){if(!l.startsWith("mcp__"))return null;const r=l.split("__");return r.length<3?null:{server:r[1],tool:r.slice(2).join("__")}}function wi(l){const r=lv(l);return r?`${r.server} · ${r.tool}`:l}const fh=3,Ni=y.memo(function({content:r,isActive:i}){const[o,u]=y.useState(!1),m=r.split(`
|
|
128
|
+
`),p=m.length>fh;y.useEffect(()=>{if(!i)return;const f=x=>{const h=x.detail;h.action==="expand"?u(!0):h.action==="collapse"&&u(!1)};return window.addEventListener("vibe:toggle-expand",f),()=>window.removeEventListener("vibe:toggle-expand",f)},[i]);const g=p&&!o?m.slice(0,fh).join(`
|
|
129
|
+
`):r;return n.jsxs("div",{children:[n.jsxs("div",{className:`text-xs font-mono text-terminal-dimmer whitespace-pre-wrap leading-relaxed ${p&&!o?"max-h-[4.5em] overflow-hidden relative":""}`,children:[g,p&&!o&&n.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-8 bg-gradient-to-t from-terminal-surface to-transparent pointer-events-none"})]}),p&&n.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),u(!o)},className:"mt-1 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors cursor-pointer",children:o?"Show less":`Show full summary (${m.length} lines)`})]})}),ph=600,px=y.memo(function({content:r,isActive:i}){const o=r.length>ph,[u,m]=y.useState(!1),p=o&&!u?`${r.slice(0,ph)}...`:r,g=y.useMemo(()=>Zu(Ye.parse(p)),[p]);return n.jsxs("div",{children:[n.jsxs("div",{className:`prose-terminal text-sm text-terminal-text ${i?"typing-cursor":""} ${o&&!u?"max-h-[200px] overflow-hidden relative":""}`,children:[n.jsx("div",{dangerouslySetInnerHTML:{__html:g}}),o&&!u&&n.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-terminal-bg to-transparent"})]}),o&&n.jsx("button",{onClick:()=>m(!u),className:"mt-1 text-xs font-mono text-terminal-blue hover:text-terminal-text transition-colors",children:u?"Show less":`Show more (${r.length} chars)`})]})}),sv=y.memo(function({content:r,isActive:i}){const[o,u]=y.useState(!1);return n.jsxs("div",{className:"ml-6",children:[n.jsxs("button",{onClick:()=>u(!o),className:"flex items-center gap-2 text-xs text-terminal-dim hover:text-terminal-text transition-colors duration-200 ease-material font-mono",children:[n.jsx("span",{className:`transition-transform ${o?"rotate-90":""}`,children:"▶"}),n.jsx("span",{className:i?"animate-pulse":"",children:"Thinking..."}),n.jsxs("span",{className:"text-terminal-purple",children:["(",r.length," chars)"]})]}),o&&n.jsx("div",{className:"mt-2 pl-5 text-xs text-terminal-dim font-mono whitespace-pre-wrap break-words border-l-2 border-terminal-purple/30 max-h-[300px] overflow-y-auto",children:r})]})}),rv=y.memo(function({command:r,stdout:i,isActive:o,durationMs:u}){const[m,p]=y.useState(!0),g=i.trim().length>0;return n.jsxs("div",{className:"bg-terminal-surface rounded-xl overflow-hidden shadow-layer-sm",children:[n.jsxs("button",{onClick:()=>g&&p(!m),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-terminal-surface-hover transition-colors duration-200 ease-material text-left",children:[n.jsx("span",{className:"text-xs font-mono font-bold text-terminal-orange",children:"$"}),n.jsx("span",{className:"text-xs font-mono text-terminal-text truncate flex-1",children:r}),u&&n.jsx("span",{className:"text-[10px] text-terminal-dimmer font-mono shrink-0",title:`Execution: ${vt(u)}`,children:vt(u)}),g&&n.jsx("span",{className:`text-xs text-terminal-dim transition-transform ${m?"rotate-90":""}`,children:"▶"})]}),m&&g&&n.jsx("div",{className:"px-3 py-2 max-h-[300px] overflow-y-auto",children:n.jsx("pre",{className:"text-xs font-mono text-terminal-dim whitespace-pre-wrap break-words",children:i})})]})});function On(){}On.prototype={diff:function(r,i){var o,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},m=u.callback;typeof u=="function"&&(m=u,u={});var p=this;function g(R){return R=p.postProcess(R,u),m?(setTimeout(function(){m(R)},0),!0):R}r=this.castInput(r,u),i=this.castInput(i,u),r=this.removeEmpty(this.tokenize(r,u)),i=this.removeEmpty(this.tokenize(i,u));var f=i.length,x=r.length,h=1,v=f+x;u.maxEditLength!=null&&(v=Math.min(v,u.maxEditLength));var C=(o=u.timeout)!==null&&o!==void 0?o:1/0,j=Date.now()+C,w=[{oldPos:-1,lastComponent:void 0}],S=this.extractCommon(w[0],i,r,0,u);if(w[0].oldPos+1>=x&&S+1>=f)return g(hh(p,w[0].lastComponent,i,r,p.useLongestToken));var k=-1/0,E=1/0;function M(){for(var R=Math.max(k,-h);R<=Math.min(E,h);R+=2){var O=void 0,$=w[R-1],H=w[R+1];$&&(w[R-1]=void 0);var K=!1;if(H){var ae=H.oldPos-R;K=H&&0<=ae&&ae<f}var ue=$&&$.oldPos+1<x;if(!K&&!ue){w[R]=void 0;continue}if(!ue||K&&$.oldPos<H.oldPos?O=p.addToPath(H,!0,!1,0,u):O=p.addToPath($,!1,!0,1,u),S=p.extractCommon(O,i,r,R,u),O.oldPos+1>=x&&S+1>=f)return g(hh(p,O.lastComponent,i,r,p.useLongestToken));w[R]=O,O.oldPos+1>=x&&(E=Math.min(E,R-1)),S+1>=f&&(k=Math.max(k,R+1))}h++}if(m)(function R(){setTimeout(function(){if(h>v||Date.now()>j)return m();M()||R()},0)})();else for(;h<=v&&Date.now()<=j;){var A=M();if(A)return A}},addToPath:function(r,i,o,u,m){var p=r.lastComponent;return p&&!m.oneChangePerToken&&p.added===i&&p.removed===o?{oldPos:r.oldPos+u,lastComponent:{count:p.count+1,added:i,removed:o,previousComponent:p.previousComponent}}:{oldPos:r.oldPos+u,lastComponent:{count:1,added:i,removed:o,previousComponent:p}}},extractCommon:function(r,i,o,u,m){for(var p=i.length,g=o.length,f=r.oldPos,x=f-u,h=0;x+1<p&&f+1<g&&this.equals(o[f+1],i[x+1],m);)x++,f++,h++,m.oneChangePerToken&&(r.lastComponent={count:1,previousComponent:r.lastComponent,added:!1,removed:!1});return h&&!m.oneChangePerToken&&(r.lastComponent={count:h,previousComponent:r.lastComponent,added:!1,removed:!1}),r.oldPos=f,x},equals:function(r,i,o){return o.comparator?o.comparator(r,i):r===i||o.ignoreCase&&r.toLowerCase()===i.toLowerCase()},removeEmpty:function(r){for(var i=[],o=0;o<r.length;o++)r[o]&&i.push(r[o]);return i},castInput:function(r){return r},tokenize:function(r){return Array.from(r)},join:function(r){return r.join("")},postProcess:function(r){return r}};function hh(l,r,i,o,u){for(var m=[],p;r;)m.push(r),p=r.previousComponent,delete r.previousComponent,r=p;m.reverse();for(var g=0,f=m.length,x=0,h=0;g<f;g++){var v=m[g];if(v.removed)v.value=l.join(o.slice(h,h+v.count)),h+=v.count;else{if(!v.added&&u){var C=i.slice(x,x+v.count);C=C.map(function(j,w){var S=o[h+w];return S.length>j.length?S:j}),v.value=l.join(C)}else v.value=l.join(i.slice(x,x+v.count));x+=v.count,v.added||(h+=v.count)}}return m}function xh(l,r){var i;for(i=0;i<l.length&&i<r.length;i++)if(l[i]!=r[i])return l.slice(0,i);return l.slice(0,i)}function gh(l,r){var i;if(!l||!r||l[l.length-1]!=r[r.length-1])return"";for(i=0;i<l.length&&i<r.length;i++)if(l[l.length-(i+1)]!=r[r.length-(i+1)])return l.slice(-i);return l.slice(-i)}function vu(l,r,i){if(l.slice(0,r.length)!=r)throw Error("string ".concat(JSON.stringify(l)," doesn't start with prefix ").concat(JSON.stringify(r),"; this is a bug"));return i+l.slice(r.length)}function ju(l,r,i){if(!r)return l+i;if(l.slice(-r.length)!=r)throw Error("string ".concat(JSON.stringify(l)," doesn't end with suffix ").concat(JSON.stringify(r),"; this is a bug"));return l.slice(0,-r.length)+i}function Ys(l,r){return vu(l,r,"")}function mi(l,r){return ju(l,r,"")}function bh(l,r){return r.slice(0,iv(l,r))}function iv(l,r){var i=0;l.length>r.length&&(i=l.length-r.length);var o=r.length;l.length<r.length&&(o=l.length);var u=Array(o),m=0;u[0]=0;for(var p=1;p<o;p++){for(r[p]==r[m]?u[p]=u[m]:u[p]=m;m>0&&r[p]!=r[m];)m=u[m];r[p]==r[m]&&m++}m=0;for(var g=i;g<l.length;g++){for(;m>0&&l[g]!=r[m];)m=u[m];l[g]==r[m]&&m++}return m}var Si="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",ov=new RegExp("[".concat(Si,"]+|\\s+|[^").concat(Si,"]"),"ug"),Ai=new On;Ai.equals=function(l,r,i){return i.ignoreCase&&(l=l.toLowerCase(),r=r.toLowerCase()),l.trim()===r.trim()};Ai.tokenize=function(l){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i;if(r.intlSegmenter){if(r.intlSegmenter.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');i=Array.from(r.intlSegmenter.segment(l),function(m){return m.segment})}else i=l.match(ov)||[];var o=[],u=null;return i.forEach(function(m){/\s/.test(m)?u==null?o.push(m):o.push(o.pop()+m):/\s/.test(u)?o[o.length-1]==u?o.push(o.pop()+m):o.push(u+m):o.push(m),u=m}),o};Ai.join=function(l){return l.map(function(r,i){return i==0?r:r.replace(/^\s+/,"")}).join("")};Ai.postProcess=function(l,r){if(!l||r.oneChangePerToken)return l;var i=null,o=null,u=null;return l.forEach(function(m){m.added?o=m:m.removed?u=m:((o||u)&&yh(i,u,o,m),i=m,o=null,u=null)}),(o||u)&&yh(i,u,o,null),l};function yh(l,r,i,o){if(r&&i){var u=r.value.match(/^\s*/)[0],m=r.value.match(/\s*$/)[0],p=i.value.match(/^\s*/)[0],g=i.value.match(/\s*$/)[0];if(l){var f=xh(u,p);l.value=ju(l.value,p,f),r.value=Ys(r.value,f),i.value=Ys(i.value,f)}if(o){var x=gh(m,g);o.value=vu(o.value,g,x),r.value=mi(r.value,x),i.value=mi(i.value,x)}}else if(i)l&&(i.value=i.value.replace(/^\s*/,"")),o&&(o.value=o.value.replace(/^\s*/,""));else if(l&&o){var h=o.value.match(/^\s*/)[0],v=r.value.match(/^\s*/)[0],C=r.value.match(/\s*$/)[0],j=xh(h,v);r.value=Ys(r.value,j);var w=gh(Ys(h,j),C);r.value=mi(r.value,w),o.value=vu(o.value,h,w),l.value=ju(l.value,h,h.slice(0,h.length-w.length))}else if(o){var S=o.value.match(/^\s*/)[0],k=r.value.match(/\s*$/)[0],E=bh(k,S);r.value=mi(r.value,E)}else if(l){var M=l.value.match(/\s*$/)[0],A=r.value.match(/^\s*/)[0],R=bh(M,A);r.value=Ys(r.value,R)}}var cv=new On;cv.tokenize=function(l){var r=new RegExp("(\\r?\\n)|[".concat(Si,"]+|[^\\S\\n\\r]+|[^").concat(Si,"]"),"ug");return l.match(r)||[]};var Ri=new On;Ri.tokenize=function(l,r){r.stripTrailingCr&&(l=l.replace(/\r\n/g,`
|
|
130
|
+
`));var i=[],o=l.split(/(\n|\r\n)/);o[o.length-1]||o.pop();for(var u=0;u<o.length;u++){var m=o[u];u%2&&!r.newlineIsToken?i[i.length-1]+=m:i.push(m)}return i};Ri.equals=function(l,r,i){return i.ignoreWhitespace?((!i.newlineIsToken||!l.includes(`
|
|
128
131
|
`))&&(l=l.trim()),(!i.newlineIsToken||!r.includes(`
|
|
129
132
|
`))&&(r=r.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(l.endsWith(`
|
|
130
133
|
`)&&(l=l.slice(0,-1)),r.endsWith(`
|
|
131
|
-
`)&&(r=r.slice(0,-1))),Cn.prototype.equals.call(this,l,r,i)};function $y(l,r,i){return wi.diff(l,r,i)}var Hy=new Cn;Hy.tokenize=function(l){return l.split(/(\S.+?[.!?])(?=\s+|$)/)};var Gy=new Cn;Gy.tokenize=function(l){return l.split(/([{}:;,]|\s+)/)};function hu(l){"@babel/helpers - typeof";return hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},hu(l)}var Ls=new Cn;Ls.useLongestToken=!0;Ls.tokenize=wi.tokenize;Ls.castInput=function(l,r){var i=r.undefinedReplacement,o=r.stringifyReplacer,u=o===void 0?function(m,p){return typeof p>"u"?i:p}:o;return typeof l=="string"?l:JSON.stringify(xu(l,null,null,u),u," ")};Ls.equals=function(l,r,i){return Cn.prototype.equals.call(Ls,l.replace(/,([\r\n])/g,"$1"),r.replace(/,([\r\n])/g,"$1"),i)};function xu(l,r,i,o,u){r=r||[],i=i||[],o&&(l=o(u,l));var m;for(m=0;m<r.length;m+=1)if(r[m]===l)return i[m];var p;if(Object.prototype.toString.call(l)==="[object Array]"){for(r.push(l),p=new Array(l.length),i.push(p),m=0;m<l.length;m+=1)p[m]=xu(l[m],r,i,o,u);return r.pop(),i.pop(),p}if(l&&l.toJSON&&(l=l.toJSON()),hu(l)==="object"&&l!==null){r.push(l),p={},i.push(p);var x=[],f;for(f in l)Object.prototype.hasOwnProperty.call(l,f)&&x.push(f);for(x.sort(),m=0;m<x.length;m+=1)f=x[m],p[f]=xu(l[f],r,i,o,f);r.pop(),i.pop()}else p=l;return p}var gu=new Cn;gu.tokenize=function(l){return l.slice()};gu.join=gu.removeEmpty=function(l){return l};function nx(l){var r,i,o="";if(typeof l=="string"||typeof l=="number")o+=l;else if(typeof l=="object")if(Array.isArray(l)){var u=l.length;for(r=0;r<u;r++)l[r]&&(i=nx(l[r]))&&(o&&(o+=" "),o+=i)}else for(i in l)l[i]&&(o&&(o+=" "),o+=i);return o}function ax(){for(var l,r,i=0,o="",u=arguments.length;i<u;i++)(l=arguments[i])&&(r=nx(l))&&(o&&(o+=" "),o+=r);return o}var qy=Object.create,Ni=Object.defineProperty,Yy=Object.defineProperties,Fy=Object.getOwnPropertyDescriptor,Zy=Object.getOwnPropertyDescriptors,lx=Object.getOwnPropertyNames,gi=Object.getOwnPropertySymbols,Xy=Object.getPrototypeOf,Uu=Object.prototype.hasOwnProperty,sx=Object.prototype.propertyIsEnumerable,mh=(l,r,i)=>r in l?Ni(l,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):l[r]=i,En=(l,r)=>{for(var i in r||(r={}))Uu.call(r,i)&&mh(l,i,r[i]);if(gi)for(var i of gi(r))sx.call(r,i)&&mh(l,i,r[i]);return l},Si=(l,r)=>Yy(l,Zy(r)),rx=(l,r)=>{var i={};for(var o in l)Uu.call(l,o)&&r.indexOf(o)<0&&(i[o]=l[o]);if(l!=null&&gi)for(var o of gi(l))r.indexOf(o)<0&&sx.call(l,o)&&(i[o]=l[o]);return i},Qy=(l,r)=>function(){return r||(0,l[lx(l)[0]])((r={exports:{}}).exports,r),r.exports},Vy=(l,r)=>{for(var i in r)Ni(l,i,{get:r[i],enumerable:!0})},Iy=(l,r,i,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of lx(r))!Uu.call(l,u)&&u!==i&&Ni(l,u,{get:()=>r[u],enumerable:!(o=Fy(r,u))||o.enumerable});return l},Jy=(l,r,i)=>(i=l!=null?qy(Xy(l)):{},Iy(!l||!l.__esModule?Ni(i,"default",{value:l,enumerable:!0}):i,l)),Ky=Qy({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(l,r){var i=(function(){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,u=0,m={},p={util:{encode:function N(S){return S instanceof x?new x(S.type,N(S.content),S.alias):Array.isArray(S)?S.map(N):S.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(N){return Object.prototype.toString.call(N).slice(8,-1)},objId:function(N){return N.__id||Object.defineProperty(N,"__id",{value:++u}),N.__id},clone:function N(S,k){k=k||{};var E,M;switch(p.util.type(S)){case"Object":if(M=p.util.objId(S),k[M])return k[M];E={},k[M]=E;for(var A in S)S.hasOwnProperty(A)&&(E[A]=N(S[A],k));return E;case"Array":return M=p.util.objId(S),k[M]?k[M]:(E=[],k[M]=E,S.forEach(function(_,z){E[z]=N(_,k)}),E);default:return S}},getLanguage:function(N){for(;N;){var S=o.exec(N.className);if(S)return S[1].toLowerCase();N=N.parentElement}return"none"},setLanguage:function(N,S){N.className=N.className.replace(RegExp(o,"gi"),""),N.classList.add("language-"+S)},isActive:function(N,S,k){for(var E="no-"+S;N;){var M=N.classList;if(M.contains(S))return!0;if(M.contains(E))return!1;N=N.parentElement}return!!k}},languages:{plain:m,plaintext:m,text:m,txt:m,extend:function(N,S){var k=p.util.clone(p.languages[N]);for(var E in S)k[E]=S[E];return k},insertBefore:function(N,S,k,E){E=E||p.languages;var M=E[N],A={};for(var _ in M)if(M.hasOwnProperty(_)){if(_==S)for(var z in k)k.hasOwnProperty(z)&&(A[z]=k[z]);k.hasOwnProperty(_)||(A[_]=M[_])}var B=E[N];return E[N]=A,p.languages.DFS(p.languages,function(F,ee){ee===B&&F!=N&&(this[F]=A)}),A},DFS:function N(S,k,E,M){M=M||{};var A=p.util.objId;for(var _ in S)if(S.hasOwnProperty(_)){k.call(S,_,S[_],E||_);var z=S[_],B=p.util.type(z);B==="Object"&&!M[A(z)]?(M[A(z)]=!0,N(z,k,null,M)):B==="Array"&&!M[A(z)]&&(M[A(z)]=!0,N(z,k,_,M))}}},plugins:{},highlight:function(N,S,k){var E={code:N,grammar:S,language:k};if(p.hooks.run("before-tokenize",E),!E.grammar)throw new Error('The language "'+E.language+'" has no grammar.');return E.tokens=p.tokenize(E.code,E.grammar),p.hooks.run("after-tokenize",E),x.stringify(p.util.encode(E.tokens),E.language)},tokenize:function(N,S){var k=S.rest;if(k){for(var E in k)S[E]=k[E];delete S.rest}var M=new b;return j(M,M.head,N),g(N,M,S,M.head,0),v(M)},hooks:{all:{},add:function(N,S){var k=p.hooks.all;k[N]=k[N]||[],k[N].push(S)},run:function(N,S){var k=p.hooks.all[N];if(!(!k||!k.length))for(var E=0,M;M=k[E++];)M(S)}},Token:x};function x(N,S,k,E){this.type=N,this.content=S,this.alias=k,this.length=(E||"").length|0}x.stringify=function N(S,k){if(typeof S=="string")return S;if(Array.isArray(S)){var E="";return S.forEach(function(B){E+=N(B,k)}),E}var M={type:S.type,content:N(S.content,k),tag:"span",classes:["token",S.type],attributes:{},language:k},A=S.alias;A&&(Array.isArray(A)?Array.prototype.push.apply(M.classes,A):M.classes.push(A)),p.hooks.run("wrap",M);var _="";for(var z in M.attributes)_+=" "+z+'="'+(M.attributes[z]||"").replace(/"/g,""")+'"';return"<"+M.tag+' class="'+M.classes.join(" ")+'"'+_+">"+M.content+"</"+M.tag+">"};function f(N,S,k,E){N.lastIndex=S;var M=N.exec(k);if(M&&E&&M[1]){var A=M[1].length;M.index+=A,M[0]=M[0].slice(A)}return M}function g(N,S,k,E,M,A){for(var _ in k)if(!(!k.hasOwnProperty(_)||!k[_])){var z=k[_];z=Array.isArray(z)?z:[z];for(var B=0;B<z.length;++B){if(A&&A.cause==_+","+B)return;var F=z[B],ee=F.inside,me=!!F.lookbehind,$=!!F.greedy,I=F.alias;if($&&!F.pattern.global){var P=F.pattern.toString().match(/[imsuy]*$/)[0];F.pattern=RegExp(F.pattern.source,P+"g")}for(var de=F.pattern||F,ce=E.next,pe=M;ce!==S.tail&&!(A&&pe>=A.reach);pe+=ce.value.length,ce=ce.next){var H=ce.value;if(S.length>N.length)return;if(!(H instanceof x)){var L=1,te;if($){if(te=f(de,pe,N,me),!te||te.index>=N.length)break;var O=te.index,oe=te.index+te[0].length,ae=pe;for(ae+=ce.value.length;O>=ae;)ce=ce.next,ae+=ce.value.length;if(ae-=ce.value.length,pe=ae,ce.value instanceof x)continue;for(var C=ce;C!==S.tail&&(ae<oe||typeof C.value=="string");C=C.next)L++,ae+=C.value.length;L--,H=N.slice(pe,ae),te.index-=pe}else if(te=f(de,0,H,me),!te)continue;var O=te.index,Z=te[0],W=H.slice(0,O),V=H.slice(O+Z.length),fe=pe+H.length;A&&fe>A.reach&&(A.reach=fe);var xe=ce.prev;W&&(xe=j(S,xe,W),pe+=W.length),T(S,xe,L);var Me=new x(_,ee?p.tokenize(Z,ee):Z,I,Z);if(ce=j(S,xe,Me),V&&j(S,ce,V),L>1){var Ae={cause:_+","+B,reach:fe};g(N,S,k,ce.prev,pe,Ae),A&&Ae.reach>A.reach&&(A.reach=Ae.reach)}}}}}}function b(){var N={value:null,prev:null,next:null},S={value:null,prev:N,next:null};N.next=S,this.head=N,this.tail=S,this.length=0}function j(N,S,k){var E=S.next,M={value:k,prev:S,next:E};return S.next=M,E.prev=M,N.length++,M}function T(N,S,k){for(var E=S.next,M=0;M<k&&E!==N.tail;M++)E=E.next;S.next=E,E.prev=S,N.length-=M}function v(N){for(var S=[],k=N.head.next;k!==N.tail;)S.push(k.value),k=k.next;return S}return p})();r.exports=i,i.default=i}}),ie=Jy(Ky());ie.languages.markup={comment:{pattern:/\x3C!--(?:(?!\x3C!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|\x3C!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},ie.languages.markup.tag.inside["attr-value"].inside.entity=ie.languages.markup.entity,ie.languages.markup.doctype.inside["internal-subset"].inside=ie.languages.markup,ie.hooks.add("wrap",function(l){l.type==="entity"&&(l.attributes.title=l.content.replace(/&/,"&"))}),Object.defineProperty(ie.languages.markup.tag,"addInlined",{value:function(l,o){var i={},i=(i["language-"+o]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:ie.languages[o]},i.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}}),o=(i["language-"+o]={pattern:/[\s\S]+/,inside:ie.languages[o]},{});o[l]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return l}),"i"),lookbehind:!0,greedy:!0,inside:i},ie.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(ie.languages.markup.tag,"addAttribute",{value:function(l,r){ie.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+l+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[r,"language-"+r],inside:ie.languages[r]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),ie.languages.html=ie.languages.markup,ie.languages.mathml=ie.languages.markup,ie.languages.svg=ie.languages.markup,ie.languages.xml=ie.languages.extend("markup",{}),ie.languages.ssml=ie.languages.xml,ie.languages.atom=ie.languages.xml,ie.languages.rss=ie.languages.xml,(function(l){var r={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},i=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,o="(?:[^\\\\-]|"+i.source+")",o=RegExp(o+"-"+o),u={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};l.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:i,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":r,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:i}},"special-escape":r,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":u}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:i,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":u}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(ie),ie.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},ie.languages.javascript=ie.languages.extend("clike",{"class-name":[ie.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),ie.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,ie.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:ie.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:ie.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:ie.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:ie.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:ie.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),ie.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:ie.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),ie.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),ie.languages.markup&&(ie.languages.markup.tag.addInlined("script","javascript"),ie.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),ie.languages.js=ie.languages.javascript,ie.languages.actionscript=ie.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),ie.languages.actionscript["class-name"].alias="function",delete ie.languages.actionscript.parameter,delete ie.languages.actionscript["literal-property"],ie.languages.markup&&ie.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:ie.languages.markup}}),(function(l){var r=/#(?!\{).+/,i={pattern:/#\{[^}]+\}/,alias:"variable"};l.languages.coffeescript=l.languages.extend("javascript",{comment:r,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:i}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),l.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:r,interpolation:i}}}),l.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:l.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:i}}]}),l.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete l.languages.coffeescript["template-string"],l.languages.coffee=l.languages.coffeescript})(ie),(function(l){var r=l.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(r,"addSupport",{value:function(i,o){(i=typeof i=="string"?[i]:i).forEach(function(u){var m=function(j){j.inside||(j.inside={}),j.inside.rest=o},p="doc-comment";if(x=l.languages[u]){var x,f=x[p];if((f=f||(x=l.languages.insertBefore(u,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[p])instanceof RegExp&&(f=x[p]={pattern:f}),Array.isArray(f))for(var g=0,b=f.length;g<b;g++)f[g]instanceof RegExp&&(f[g]={pattern:f[g]}),m(f[g]);else m(f)}})}}),r.addSupport(["java","javascript","php"],r)})(ie),(function(l){var r=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,r=(l.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+r.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+r.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+r.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+r.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:r,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},l.languages.css.atrule.inside.rest=l.languages.css,l.languages.markup);r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(ie),(function(l){var r=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,r=(l.languages.css.selector={pattern:l.languages.css.selector.pattern,lookbehind:!0,inside:r={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+r.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[r,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},l.languages.css.atrule.inside["selector-function-argument"].inside=r,l.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),i={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};l.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:i,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:i})})(ie),(function(l){var r=/[*&][^\s[\]{},]+/,i=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,o="(?:"+i.source+"(?:[ ]+"+r.source+")?|"+r.source+"(?:[ ]+"+i.source+")?)",u=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),m=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function p(x,f){f=(f||"").replace(/m/g,"")+"m";var g=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return o}).replace(/<<value>>/g,function(){return x});return RegExp(g,f)}l.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return o})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return o}).replace(/<<key>>/g,function(){return"(?:"+u+"|"+m+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:p(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:p(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:p(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:p(m),lookbehind:!0,greedy:!0},number:{pattern:p(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:i,important:r,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},l.languages.yml=l.languages.yaml})(ie),(function(l){var r=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function i(g){return g=g.replace(/<inner>/g,function(){return r}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+g+")")}var o=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,u=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return o}),m=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,p=(l.languages.markdown=l.languages.extend("markup",{}),l.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:l.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+u+m+"(?:"+u+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+u+m+")(?:"+u+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(o),inside:l.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+u+")"+m+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+u+"$"),inside:{"table-header":{pattern:RegExp(o),alias:"important",inside:l.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:i(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:i(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:i(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:i(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(g){["url","bold","italic","strike","code-snippet"].forEach(function(b){g!==b&&(l.languages.markdown[g].inside.content.inside[b]=l.languages.markdown[b])})}),l.hooks.add("after-tokenize",function(g){g.language!=="markdown"&&g.language!=="md"||(function b(j){if(j&&typeof j!="string")for(var T=0,v=j.length;T<v;T++){var N,S=j[T];S.type!=="code"?b(S.content):(N=S.content[1],S=S.content[3],N&&S&&N.type==="code-language"&&S.type==="code-block"&&typeof N.content=="string"&&(N=N.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),N="language-"+(N=(/[a-z][\w-]*/i.exec(N)||[""])[0].toLowerCase()),S.alias?typeof S.alias=="string"?S.alias=[S.alias,N]:S.alias.push(N):S.alias=[N]))}})(g.tokens)}),l.hooks.add("wrap",function(g){if(g.type==="code-block"){for(var b="",j=0,T=g.classes.length;j<T;j++){var v=g.classes[j],v=/language-(.+)/.exec(v);if(v){b=v[1];break}}var N,S=l.languages[b];S?g.content=l.highlight((function(k){return k=k.replace(p,""),k=k.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(E,M){var A;return(M=M.toLowerCase())[0]==="#"?(A=M[1]==="x"?parseInt(M.slice(2),16):Number(M.slice(1)),f(A)):x[M]||E})})(g.content),S,b):b&&b!=="none"&&l.plugins.autoloader&&(N="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),g.attributes.id=N,l.plugins.autoloader.loadLanguages(b,function(){var k=document.getElementById(N);k&&(k.innerHTML=l.highlight(k.textContent,l.languages[b],b))}))}}),RegExp(l.languages.markup.tag.pattern.source,"gi")),x={amp:"&",lt:"<",gt:">",quot:'"'},f=String.fromCodePoint||String.fromCharCode;l.languages.md=l.languages.markdown})(ie),ie.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:ie.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},ie.hooks.add("after-tokenize",function(l){if(l.language==="graphql")for(var r=l.tokens.filter(function(N){return typeof N!="string"&&N.type!=="comment"&&N.type!=="scalar"}),i=0;i<r.length;){var o=r[i++];if(o.type==="keyword"&&o.content==="mutation"){var u=[];if(j(["definition-mutation","punctuation"])&&b(1).content==="("){i+=2;var m=T(/^\($/,/^\)$/);if(m===-1)continue;for(;i<m;i++){var p=b(0);p.type==="variable"&&(v(p,"variable-input"),u.push(p.content))}i=m+1}if(j(["punctuation","property-query"])&&b(0).content==="{"&&(i++,v(b(0),"property-mutation"),0<u.length)){var x=T(/^\{$/,/^\}$/);if(x!==-1)for(var f=i;f<x;f++){var g=r[f];g.type==="variable"&&0<=u.indexOf(g.content)&&v(g,"variable-input")}}}}function b(N){return r[i+N]}function j(N,S){S=S||0;for(var k=0;k<N.length;k++){var E=b(k+S);if(!E||E.type!==N[k])return}return 1}function T(N,S){for(var k=1,E=i;E<r.length;E++){var M=r[E],A=M.content;if(M.type==="punctuation"&&typeof A=="string"){if(N.test(A))k++;else if(S.test(A)&&--k===0)return E}}return-1}function v(N,S){var k=N.alias;k?Array.isArray(k)||(N.alias=k=[k]):N.alias=k=[],k.push(S)}}),ie.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(l){var r=l.languages.javascript["template-string"],i=r.pattern.source,o=r.inside.interpolation,u=o.inside["interpolation-punctuation"],m=o.pattern.source;function p(j,T){if(l.languages[j])return{pattern:RegExp("((?:"+T+")\\s*)"+i),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:j}}}}function x(j,T,v){return j={code:j,grammar:T,language:v},l.hooks.run("before-tokenize",j),j.tokens=l.tokenize(j.code,j.grammar),l.hooks.run("after-tokenize",j),j.tokens}function f(j,T,v){var k=l.tokenize(j,{interpolation:{pattern:RegExp(m),lookbehind:!0}}),N=0,S={},k=x(k.map(function(M){if(typeof M=="string")return M;for(var A,_,M=M.content;j.indexOf((_=N++,A="___"+v.toUpperCase()+"_"+_+"___"))!==-1;);return S[A]=M,A}).join(""),T,v),E=Object.keys(S);return N=0,(function M(A){for(var _=0;_<A.length;_++){if(N>=E.length)return;var z,B,F,ee,me,$,I,P=A[_];typeof P=="string"||typeof P.content=="string"?(z=E[N],(I=($=typeof P=="string"?P:P.content).indexOf(z))!==-1&&(++N,B=$.substring(0,I),me=S[z],F=void 0,(ee={})["interpolation-punctuation"]=u,(ee=l.tokenize(me,ee)).length===3&&((F=[1,1]).push.apply(F,x(ee[1],l.languages.javascript,"javascript")),ee.splice.apply(ee,F)),F=new l.Token("interpolation",ee,o.alias,me),ee=$.substring(I+z.length),me=[],B&&me.push(B),me.push(F),ee&&(M($=[ee]),me.push.apply(me,$)),typeof P=="string"?(A.splice.apply(A,[_,1].concat(me)),_+=me.length-1):P.content=me)):(I=P.content,Array.isArray(I)?M(I):M([I]))}})(k),new l.Token(v,k,"language-"+v,j)}l.languages.javascript["template-string"]=[p("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),p("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),p("svg",/\bsvg/.source),p("markdown",/\b(?:markdown|md)/.source),p("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),p("sql",/\bsql/.source),r].filter(Boolean);var g={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function b(j){return typeof j=="string"?j:Array.isArray(j)?j.map(b).join(""):b(j.content)}l.hooks.add("after-tokenize",function(j){j.language in g&&(function T(v){for(var N=0,S=v.length;N<S;N++){var k,E,M,A=v[N];typeof A!="string"&&(k=A.content,Array.isArray(k)?A.type==="template-string"?(A=k[1],k.length===3&&typeof A!="string"&&A.type==="embedded-code"&&(E=b(A),A=A.alias,A=Array.isArray(A)?A[0]:A,M=l.languages[A])&&(k[1]=f(E,M,A))):T(k):typeof k!="string"&&T([k]))}})(j.tokens)})})(ie),(function(l){l.languages.typescript=l.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),l.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete l.languages.typescript.parameter,delete l.languages.typescript["literal-property"];var r=l.languages.extend("typescript",{});delete r["class-name"],l.languages.typescript["class-name"].inside=r,l.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:r}}}}),l.languages.ts=l.languages.typescript})(ie),(function(l){var r=l.languages.javascript,i=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,o="(@(?:arg|argument|param|property)\\s+(?:"+i+"\\s+)?)";l.languages.jsdoc=l.languages.extend("javadoclike",{parameter:{pattern:RegExp(o+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),l.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(o+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:r,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return i})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+i),lookbehind:!0,inside:{string:r.string,number:r.number,boolean:r.boolean,keyword:l.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:r,alias:"language-javascript"}}}}),l.languages.javadoclike.addSupport("javascript",l.languages.jsdoc)})(ie),(function(l){l.languages.flow=l.languages.extend("javascript",{}),l.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),l.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete l.languages.flow.parameter,l.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(l.languages.flow.keyword)||(l.languages.flow.keyword=[l.languages.flow.keyword]),l.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(ie),ie.languages.n4js=ie.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),ie.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),ie.languages.n4jsd=ie.languages.n4js,(function(l){function r(p,x){return RegExp(p.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),x)}l.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+l.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),l.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+l.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),l.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),l.languages.insertBefore("javascript","keyword",{imports:{pattern:r(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:l.languages.javascript},exports:{pattern:r(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:l.languages.javascript}}),l.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),l.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),l.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:r(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var i=["function","function-variable","method","method-variable","property-access"],o=0;o<i.length;o++){var m=i[o],u=l.languages.javascript[m],m=(u=l.util.type(u)==="RegExp"?l.languages.javascript[m]={pattern:u}:u).inside||{};(u.inside=m)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(ie),(function(l){var r=l.util.clone(l.languages.javascript),i=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,o=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,u=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function m(f,g){return f=f.replace(/<S>/g,function(){return i}).replace(/<BRACES>/g,function(){return o}).replace(/<SPREAD>/g,function(){return u}),RegExp(f,g)}u=m(u).source,l.languages.jsx=l.languages.extend("markup",r),l.languages.jsx.tag.pattern=m(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),l.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,l.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,l.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,l.languages.jsx.tag.inside.comment=r.comment,l.languages.insertBefore("inside","attr-name",{spread:{pattern:m(/<SPREAD>/.source),inside:l.languages.jsx}},l.languages.jsx.tag),l.languages.insertBefore("inside","special-attr",{script:{pattern:m(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:l.languages.jsx}}},l.languages.jsx.tag);function p(f){for(var g=[],b=0;b<f.length;b++){var j=f[b],T=!1;typeof j!="string"&&(j.type==="tag"&&j.content[0]&&j.content[0].type==="tag"?j.content[0].content[0].content==="</"?0<g.length&&g[g.length-1].tagName===x(j.content[0].content[1])&&g.pop():j.content[j.content.length-1].content!=="/>"&&g.push({tagName:x(j.content[0].content[1]),openedBraces:0}):0<g.length&&j.type==="punctuation"&&j.content==="{"?g[g.length-1].openedBraces++:0<g.length&&0<g[g.length-1].openedBraces&&j.type==="punctuation"&&j.content==="}"?g[g.length-1].openedBraces--:T=!0),(T||typeof j=="string")&&0<g.length&&g[g.length-1].openedBraces===0&&(T=x(j),b<f.length-1&&(typeof f[b+1]=="string"||f[b+1].type==="plain-text")&&(T+=x(f[b+1]),f.splice(b+1,1)),0<b&&(typeof f[b-1]=="string"||f[b-1].type==="plain-text")&&(T=x(f[b-1])+T,f.splice(b-1,1),b--),f[b]=new l.Token("plain-text",T,null,T)),j.content&&typeof j.content!="string"&&p(j.content)}}var x=function(f){return f?typeof f=="string"?f:typeof f.content=="string"?f.content:f.content.map(x).join(""):""};l.hooks.add("after-tokenize",function(f){f.language!=="jsx"&&f.language!=="tsx"||p(f.tokens)})})(ie),(function(l){var r=l.util.clone(l.languages.typescript),r=(l.languages.tsx=l.languages.extend("jsx",r),delete l.languages.tsx.parameter,delete l.languages.tsx["literal-property"],l.languages.tsx.tag);r.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+r.pattern.source+")",r.pattern.flags),r.lookbehind=!0})(ie),ie.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},ie.languages.swift["string-literal"].forEach(function(l){l.inside.interpolation.inside=ie.languages.swift}),(function(l){l.languages.kotlin=l.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete l.languages.kotlin["class-name"];var r={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:l.languages.kotlin}};l.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:r},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:r},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete l.languages.kotlin.string,l.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),l.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),l.languages.kt=l.languages.kotlin,l.languages.kts=l.languages.kotlin})(ie),ie.languages.c=ie.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),ie.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),ie.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},ie.languages.c.string],char:ie.languages.c.char,comment:ie.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:ie.languages.c}}}}),ie.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete ie.languages.c.boolean,ie.languages.objectivec=ie.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete ie.languages.objectivec["class-name"],ie.languages.objc=ie.languages.objectivec,ie.languages.reason=ie.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),ie.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete ie.languages.reason.function,(function(l){for(var r=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,i=0;i<2;i++)r=r.replace(/<self>/g,function(){return r});r=r.replace(/<self>/g,function(){return/[^\s\S]/.source}),l.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+r),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},l.languages.rust["closure-params"].inside.rest=l.languages.rust,l.languages.rust.attribute.inside.string=l.languages.rust.string})(ie),ie.languages.go=ie.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),ie.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete ie.languages.go["class-name"],(function(l){var r=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,i=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return r.source});l.languages.cpp=l.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return r.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:r,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),l.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return i})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),l.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:l.languages.cpp}}}}),l.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),l.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:l.languages.extend("cpp",{})}}),l.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},l.languages.cpp["base-clause"])})(ie),ie.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},ie.languages.python["string-interpolation"].inside.interpolation.inside.rest=ie.languages.python,ie.languages.py=ie.languages.python,ie.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},ie.languages.webmanifest=ie.languages.json;var bu={};Vy(bu,{dracula:()=>Wy,duotoneDark:()=>tv,duotoneLight:()=>av,github:()=>sv,gruvboxMaterialDark:()=>Dv,gruvboxMaterialLight:()=>zv,jettwaveDark:()=>Ev,jettwaveLight:()=>Tv,nightOwl:()=>iv,nightOwlLight:()=>cv,oceanicNext:()=>dv,okaidia:()=>fv,oneDark:()=>Rv,oneLight:()=>_v,palenight:()=>hv,shadesOfPurple:()=>gv,synthwave84:()=>yv,ultramin:()=>jv,vsDark:()=>ix,vsLight:()=>Sv});var Py={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},Wy=Py,ev={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},tv=ev,nv={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},av=nv,lv={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},sv=lv,rv={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},iv=rv,ov={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},cv=ov,en={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},uv={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:en.keyword}},{types:["attr-value"],style:{color:en.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:en.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:en.primitive}},{types:["boolean"],style:{color:en.boolean}},{types:["tag"],style:{color:en.tag}},{types:["string"],style:{color:en.string}},{types:["punctuation"],style:{color:en.string}},{types:["selector","char","builtin","inserted"],style:{color:en.char}},{types:["function"],style:{color:en.function}},{types:["operator","entity","url","variable"],style:{color:en.variable}},{types:["keyword"],style:{color:en.keyword}},{types:["atrule","class-name"],style:{color:en.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},dv=uv,mv={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},fv=mv,pv={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},hv=pv,xv={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},gv=xv,bv={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},yv=bv,vv={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},jv=vv,wv={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},ix=wv,Nv={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},Sv=Nv,kv={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Ev=kv,Cv={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Tv=Cv,Av={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},Rv=Av,Mv={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},_v=Mv,Ov={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},Dv=Ov,Lv={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},zv=Lv,Bv=l=>y.useCallback(r=>{var i=r,{className:o,style:u,line:m}=i,p=rx(i,["className","style","line"]);const x=Si(En({},p),{className:ax("token-line",o)});return typeof l=="object"&&"plain"in l&&(x.style=l.plain),typeof u=="object"&&(x.style=En(En({},x.style||{}),u)),x},[l]),Uv=l=>{const r=y.useCallback(({types:i,empty:o})=>{if(l!=null){{if(i.length===1&&i[0]==="plain")return o!=null?{display:"inline-block"}:void 0;if(i.length===1&&o!=null)return l[i[0]]}return Object.assign(o!=null?{display:"inline-block"}:{},...i.map(u=>l[u]))}},[l]);return y.useCallback(i=>{var o=i,{token:u,className:m,style:p}=o,x=rx(o,["token","className","style"]);const f=Si(En({},x),{className:ax("token",...u.types,m),children:u.content,style:r(u)});return p!=null&&(f.style=En(En({},f.style||{}),p)),f},[r])},$v=/\r\n|\r|\n/,fh=l=>{l.length===0?l.push({types:["plain"],content:`
|
|
134
|
+
`)&&(r=r.slice(0,-1))),On.prototype.equals.call(this,l,r,i)};function uv(l,r,i){return Ri.diff(l,r,i)}var dv=new On;dv.tokenize=function(l){return l.split(/(\S.+?[.!?])(?=\s+|$)/)};var mv=new On;mv.tokenize=function(l){return l.split(/([{}:;,]|\s+)/)};function wu(l){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},wu(l)}var Is=new On;Is.useLongestToken=!0;Is.tokenize=Ri.tokenize;Is.castInput=function(l,r){var i=r.undefinedReplacement,o=r.stringifyReplacer,u=o===void 0?function(m,p){return typeof p>"u"?i:p}:o;return typeof l=="string"?l:JSON.stringify(Nu(l,null,null,u),u," ")};Is.equals=function(l,r,i){return On.prototype.equals.call(Is,l.replace(/,([\r\n])/g,"$1"),r.replace(/,([\r\n])/g,"$1"),i)};function Nu(l,r,i,o,u){r=r||[],i=i||[],o&&(l=o(u,l));var m;for(m=0;m<r.length;m+=1)if(r[m]===l)return i[m];var p;if(Object.prototype.toString.call(l)==="[object Array]"){for(r.push(l),p=new Array(l.length),i.push(p),m=0;m<l.length;m+=1)p[m]=Nu(l[m],r,i,o,u);return r.pop(),i.pop(),p}if(l&&l.toJSON&&(l=l.toJSON()),wu(l)==="object"&&l!==null){r.push(l),p={},i.push(p);var g=[],f;for(f in l)Object.prototype.hasOwnProperty.call(l,f)&&g.push(f);for(g.sort(),m=0;m<g.length;m+=1)f=g[m],p[f]=Nu(l[f],r,i,o,f);r.pop(),i.pop()}else p=l;return p}var Su=new On;Su.tokenize=function(l){return l.slice()};Su.join=Su.removeEmpty=function(l){return l};function hx(l){var r,i,o="";if(typeof l=="string"||typeof l=="number")o+=l;else if(typeof l=="object")if(Array.isArray(l)){var u=l.length;for(r=0;r<u;r++)l[r]&&(i=hx(l[r]))&&(o&&(o+=" "),o+=i)}else for(i in l)l[i]&&(o&&(o+=" "),o+=i);return o}function xx(){for(var l,r,i=0,o="",u=arguments.length;i<u;i++)(l=arguments[i])&&(r=hx(l))&&(o&&(o+=" "),o+=r);return o}var fv=Object.create,Mi=Object.defineProperty,pv=Object.defineProperties,hv=Object.getOwnPropertyDescriptor,xv=Object.getOwnPropertyDescriptors,gx=Object.getOwnPropertyNames,ki=Object.getOwnPropertySymbols,gv=Object.getPrototypeOf,Qu=Object.prototype.hasOwnProperty,bx=Object.prototype.propertyIsEnumerable,vh=(l,r,i)=>r in l?Mi(l,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):l[r]=i,_n=(l,r)=>{for(var i in r||(r={}))Qu.call(r,i)&&vh(l,i,r[i]);if(ki)for(var i of ki(r))bx.call(r,i)&&vh(l,i,r[i]);return l},Di=(l,r)=>pv(l,xv(r)),yx=(l,r)=>{var i={};for(var o in l)Qu.call(l,o)&&r.indexOf(o)<0&&(i[o]=l[o]);if(l!=null&&ki)for(var o of ki(l))r.indexOf(o)<0&&bx.call(l,o)&&(i[o]=l[o]);return i},bv=(l,r)=>function(){return r||(0,l[gx(l)[0]])((r={exports:{}}).exports,r),r.exports},yv=(l,r)=>{for(var i in r)Mi(l,i,{get:r[i],enumerable:!0})},vv=(l,r,i,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of gx(r))!Qu.call(l,u)&&u!==i&&Mi(l,u,{get:()=>r[u],enumerable:!(o=hv(r,u))||o.enumerable});return l},jv=(l,r,i)=>(i=l!=null?fv(gv(l)):{},vv(!l||!l.__esModule?Mi(i,"default",{value:l,enumerable:!0}):i,l)),wv=bv({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(l,r){var i=(function(){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,u=0,m={},p={util:{encode:function w(S){return S instanceof g?new g(S.type,w(S.content),S.alias):Array.isArray(S)?S.map(w):S.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(w){return Object.prototype.toString.call(w).slice(8,-1)},objId:function(w){return w.__id||Object.defineProperty(w,"__id",{value:++u}),w.__id},clone:function w(S,k){k=k||{};var E,M;switch(p.util.type(S)){case"Object":if(M=p.util.objId(S),k[M])return k[M];E={},k[M]=E;for(var A in S)S.hasOwnProperty(A)&&(E[A]=w(S[A],k));return E;case"Array":return M=p.util.objId(S),k[M]?k[M]:(E=[],k[M]=E,S.forEach(function(R,O){E[O]=w(R,k)}),E);default:return S}},getLanguage:function(w){for(;w;){var S=o.exec(w.className);if(S)return S[1].toLowerCase();w=w.parentElement}return"none"},setLanguage:function(w,S){w.className=w.className.replace(RegExp(o,"gi"),""),w.classList.add("language-"+S)},isActive:function(w,S,k){for(var E="no-"+S;w;){var M=w.classList;if(M.contains(S))return!0;if(M.contains(E))return!1;w=w.parentElement}return!!k}},languages:{plain:m,plaintext:m,text:m,txt:m,extend:function(w,S){var k=p.util.clone(p.languages[w]);for(var E in S)k[E]=S[E];return k},insertBefore:function(w,S,k,E){E=E||p.languages;var M=E[w],A={};for(var R in M)if(M.hasOwnProperty(R)){if(R==S)for(var O in k)k.hasOwnProperty(O)&&(A[O]=k[O]);k.hasOwnProperty(R)||(A[R]=M[R])}var $=E[w];return E[w]=A,p.languages.DFS(p.languages,function(H,K){K===$&&H!=w&&(this[H]=A)}),A},DFS:function w(S,k,E,M){M=M||{};var A=p.util.objId;for(var R in S)if(S.hasOwnProperty(R)){k.call(S,R,S[R],E||R);var O=S[R],$=p.util.type(O);$==="Object"&&!M[A(O)]?(M[A(O)]=!0,w(O,k,null,M)):$==="Array"&&!M[A(O)]&&(M[A(O)]=!0,w(O,k,R,M))}}},plugins:{},highlight:function(w,S,k){var E={code:w,grammar:S,language:k};if(p.hooks.run("before-tokenize",E),!E.grammar)throw new Error('The language "'+E.language+'" has no grammar.');return E.tokens=p.tokenize(E.code,E.grammar),p.hooks.run("after-tokenize",E),g.stringify(p.util.encode(E.tokens),E.language)},tokenize:function(w,S){var k=S.rest;if(k){for(var E in k)S[E]=k[E];delete S.rest}var M=new h;return v(M,M.head,w),x(w,M,S,M.head,0),j(M)},hooks:{all:{},add:function(w,S){var k=p.hooks.all;k[w]=k[w]||[],k[w].push(S)},run:function(w,S){var k=p.hooks.all[w];if(!(!k||!k.length))for(var E=0,M;M=k[E++];)M(S)}},Token:g};function g(w,S,k,E){this.type=w,this.content=S,this.alias=k,this.length=(E||"").length|0}g.stringify=function w(S,k){if(typeof S=="string")return S;if(Array.isArray(S)){var E="";return S.forEach(function($){E+=w($,k)}),E}var M={type:S.type,content:w(S.content,k),tag:"span",classes:["token",S.type],attributes:{},language:k},A=S.alias;A&&(Array.isArray(A)?Array.prototype.push.apply(M.classes,A):M.classes.push(A)),p.hooks.run("wrap",M);var R="";for(var O in M.attributes)R+=" "+O+'="'+(M.attributes[O]||"").replace(/"/g,""")+'"';return"<"+M.tag+' class="'+M.classes.join(" ")+'"'+R+">"+M.content+"</"+M.tag+">"};function f(w,S,k,E){w.lastIndex=S;var M=w.exec(k);if(M&&E&&M[1]){var A=M[1].length;M.index+=A,M[0]=M[0].slice(A)}return M}function x(w,S,k,E,M,A){for(var R in k)if(!(!k.hasOwnProperty(R)||!k[R])){var O=k[R];O=Array.isArray(O)?O:[O];for(var $=0;$<O.length;++$){if(A&&A.cause==R+","+$)return;var H=O[$],K=H.inside,ae=!!H.lookbehind,ue=!!H.greedy,oe=H.alias;if(ue&&!H.pattern.global){var te=H.pattern.toString().match(/[imsuy]*$/)[0];H.pattern=RegExp(H.pattern.source,te+"g")}for(var xe=H.pattern||H,de=E.next,pe=M;de!==S.tail&&!(A&&pe>=A.reach);pe+=de.value.length,de=de.next){var U=de.value;if(S.length>w.length)return;if(!(U instanceof g)){var z=1,Q;if(ue){if(Q=f(xe,pe,w,ae),!Q||Q.index>=w.length)break;var _=Q.index,ne=Q.index+Q[0].length,W=pe;for(W+=de.value.length;_>=W;)de=de.next,W+=de.value.length;if(W-=de.value.length,pe=W,de.value instanceof g)continue;for(var T=de;T!==S.tail&&(W<ne||typeof T.value=="string");T=T.next)z++,W+=T.value.length;z--,U=w.slice(pe,W),Q.index-=pe}else if(Q=f(xe,0,U,ae),!Q)continue;var _=Q.index,V=Q[0],J=U.slice(0,_),P=U.slice(_+V.length),he=pe+U.length;A&&he>A.reach&&(A.reach=he);var G=de.prev;J&&(G=v(S,G,J),pe+=J.length),C(S,G,z);var F=new g(R,K?p.tokenize(V,K):V,oe,V);if(de=v(S,G,F),P&&v(S,de,P),z>1){var me={cause:R+","+$,reach:he};x(w,S,k,de.prev,pe,me),A&&me.reach>A.reach&&(A.reach=me.reach)}}}}}}function h(){var w={value:null,prev:null,next:null},S={value:null,prev:w,next:null};w.next=S,this.head=w,this.tail=S,this.length=0}function v(w,S,k){var E=S.next,M={value:k,prev:S,next:E};return S.next=M,E.prev=M,w.length++,M}function C(w,S,k){for(var E=S.next,M=0;M<k&&E!==w.tail;M++)E=E.next;S.next=E,E.prev=S,w.length-=M}function j(w){for(var S=[],k=w.head.next;k!==w.tail;)S.push(k.value),k=k.next;return S}return p})();r.exports=i,i.default=i}}),re=jv(wv());re.languages.markup={comment:{pattern:/\x3C!--(?:(?!\x3C!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|\x3C!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},re.languages.markup.tag.inside["attr-value"].inside.entity=re.languages.markup.entity,re.languages.markup.doctype.inside["internal-subset"].inside=re.languages.markup,re.hooks.add("wrap",function(l){l.type==="entity"&&(l.attributes.title=l.content.replace(/&/,"&"))}),Object.defineProperty(re.languages.markup.tag,"addInlined",{value:function(l,o){var i={},i=(i["language-"+o]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:re.languages[o]},i.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}}),o=(i["language-"+o]={pattern:/[\s\S]+/,inside:re.languages[o]},{});o[l]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return l}),"i"),lookbehind:!0,greedy:!0,inside:i},re.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(re.languages.markup.tag,"addAttribute",{value:function(l,r){re.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+l+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[r,"language-"+r],inside:re.languages[r]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),re.languages.html=re.languages.markup,re.languages.mathml=re.languages.markup,re.languages.svg=re.languages.markup,re.languages.xml=re.languages.extend("markup",{}),re.languages.ssml=re.languages.xml,re.languages.atom=re.languages.xml,re.languages.rss=re.languages.xml,(function(l){var r={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},i=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,o="(?:[^\\\\-]|"+i.source+")",o=RegExp(o+"-"+o),u={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};l.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:i,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":r,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:i}},"special-escape":r,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":u}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:i,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":u}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(re),re.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},re.languages.javascript=re.languages.extend("clike",{"class-name":[re.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),re.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,re.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:re.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:re.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:re.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:re.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:re.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),re.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:re.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),re.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),re.languages.markup&&(re.languages.markup.tag.addInlined("script","javascript"),re.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),re.languages.js=re.languages.javascript,re.languages.actionscript=re.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),re.languages.actionscript["class-name"].alias="function",delete re.languages.actionscript.parameter,delete re.languages.actionscript["literal-property"],re.languages.markup&&re.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:re.languages.markup}}),(function(l){var r=/#(?!\{).+/,i={pattern:/#\{[^}]+\}/,alias:"variable"};l.languages.coffeescript=l.languages.extend("javascript",{comment:r,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:i}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),l.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:r,interpolation:i}}}),l.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:l.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:i}}]}),l.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete l.languages.coffeescript["template-string"],l.languages.coffee=l.languages.coffeescript})(re),(function(l){var r=l.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(r,"addSupport",{value:function(i,o){(i=typeof i=="string"?[i]:i).forEach(function(u){var m=function(v){v.inside||(v.inside={}),v.inside.rest=o},p="doc-comment";if(g=l.languages[u]){var g,f=g[p];if((f=f||(g=l.languages.insertBefore(u,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[p])instanceof RegExp&&(f=g[p]={pattern:f}),Array.isArray(f))for(var x=0,h=f.length;x<h;x++)f[x]instanceof RegExp&&(f[x]={pattern:f[x]}),m(f[x]);else m(f)}})}}),r.addSupport(["java","javascript","php"],r)})(re),(function(l){var r=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,r=(l.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+r.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+r.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+r.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+r.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:r,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},l.languages.css.atrule.inside.rest=l.languages.css,l.languages.markup);r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(re),(function(l){var r=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,r=(l.languages.css.selector={pattern:l.languages.css.selector.pattern,lookbehind:!0,inside:r={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+r.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[r,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},l.languages.css.atrule.inside["selector-function-argument"].inside=r,l.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),i={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};l.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:i,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:i})})(re),(function(l){var r=/[*&][^\s[\]{},]+/,i=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,o="(?:"+i.source+"(?:[ ]+"+r.source+")?|"+r.source+"(?:[ ]+"+i.source+")?)",u=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),m=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function p(g,f){f=(f||"").replace(/m/g,"")+"m";var x=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return o}).replace(/<<value>>/g,function(){return g});return RegExp(x,f)}l.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return o})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return o}).replace(/<<key>>/g,function(){return"(?:"+u+"|"+m+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:p(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:p(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:p(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:p(m),lookbehind:!0,greedy:!0},number:{pattern:p(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:i,important:r,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},l.languages.yml=l.languages.yaml})(re),(function(l){var r=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function i(x){return x=x.replace(/<inner>/g,function(){return r}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+x+")")}var o=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,u=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return o}),m=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,p=(l.languages.markdown=l.languages.extend("markup",{}),l.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:l.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+u+m+"(?:"+u+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+u+m+")(?:"+u+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(o),inside:l.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+u+")"+m+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+u+"$"),inside:{"table-header":{pattern:RegExp(o),alias:"important",inside:l.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:i(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:i(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:i(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:i(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(x){["url","bold","italic","strike","code-snippet"].forEach(function(h){x!==h&&(l.languages.markdown[x].inside.content.inside[h]=l.languages.markdown[h])})}),l.hooks.add("after-tokenize",function(x){x.language!=="markdown"&&x.language!=="md"||(function h(v){if(v&&typeof v!="string")for(var C=0,j=v.length;C<j;C++){var w,S=v[C];S.type!=="code"?h(S.content):(w=S.content[1],S=S.content[3],w&&S&&w.type==="code-language"&&S.type==="code-block"&&typeof w.content=="string"&&(w=w.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),w="language-"+(w=(/[a-z][\w-]*/i.exec(w)||[""])[0].toLowerCase()),S.alias?typeof S.alias=="string"?S.alias=[S.alias,w]:S.alias.push(w):S.alias=[w]))}})(x.tokens)}),l.hooks.add("wrap",function(x){if(x.type==="code-block"){for(var h="",v=0,C=x.classes.length;v<C;v++){var j=x.classes[v],j=/language-(.+)/.exec(j);if(j){h=j[1];break}}var w,S=l.languages[h];S?x.content=l.highlight((function(k){return k=k.replace(p,""),k=k.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(E,M){var A;return(M=M.toLowerCase())[0]==="#"?(A=M[1]==="x"?parseInt(M.slice(2),16):Number(M.slice(1)),f(A)):g[M]||E})})(x.content),S,h):h&&h!=="none"&&l.plugins.autoloader&&(w="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),x.attributes.id=w,l.plugins.autoloader.loadLanguages(h,function(){var k=document.getElementById(w);k&&(k.innerHTML=l.highlight(k.textContent,l.languages[h],h))}))}}),RegExp(l.languages.markup.tag.pattern.source,"gi")),g={amp:"&",lt:"<",gt:">",quot:'"'},f=String.fromCodePoint||String.fromCharCode;l.languages.md=l.languages.markdown})(re),re.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:re.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},re.hooks.add("after-tokenize",function(l){if(l.language==="graphql")for(var r=l.tokens.filter(function(w){return typeof w!="string"&&w.type!=="comment"&&w.type!=="scalar"}),i=0;i<r.length;){var o=r[i++];if(o.type==="keyword"&&o.content==="mutation"){var u=[];if(v(["definition-mutation","punctuation"])&&h(1).content==="("){i+=2;var m=C(/^\($/,/^\)$/);if(m===-1)continue;for(;i<m;i++){var p=h(0);p.type==="variable"&&(j(p,"variable-input"),u.push(p.content))}i=m+1}if(v(["punctuation","property-query"])&&h(0).content==="{"&&(i++,j(h(0),"property-mutation"),0<u.length)){var g=C(/^\{$/,/^\}$/);if(g!==-1)for(var f=i;f<g;f++){var x=r[f];x.type==="variable"&&0<=u.indexOf(x.content)&&j(x,"variable-input")}}}}function h(w){return r[i+w]}function v(w,S){S=S||0;for(var k=0;k<w.length;k++){var E=h(k+S);if(!E||E.type!==w[k])return}return 1}function C(w,S){for(var k=1,E=i;E<r.length;E++){var M=r[E],A=M.content;if(M.type==="punctuation"&&typeof A=="string"){if(w.test(A))k++;else if(S.test(A)&&--k===0)return E}}return-1}function j(w,S){var k=w.alias;k?Array.isArray(k)||(w.alias=k=[k]):w.alias=k=[],k.push(S)}}),re.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(l){var r=l.languages.javascript["template-string"],i=r.pattern.source,o=r.inside.interpolation,u=o.inside["interpolation-punctuation"],m=o.pattern.source;function p(v,C){if(l.languages[v])return{pattern:RegExp("((?:"+C+")\\s*)"+i),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:v}}}}function g(v,C,j){return v={code:v,grammar:C,language:j},l.hooks.run("before-tokenize",v),v.tokens=l.tokenize(v.code,v.grammar),l.hooks.run("after-tokenize",v),v.tokens}function f(v,C,j){var k=l.tokenize(v,{interpolation:{pattern:RegExp(m),lookbehind:!0}}),w=0,S={},k=g(k.map(function(M){if(typeof M=="string")return M;for(var A,R,M=M.content;v.indexOf((R=w++,A="___"+j.toUpperCase()+"_"+R+"___"))!==-1;);return S[A]=M,A}).join(""),C,j),E=Object.keys(S);return w=0,(function M(A){for(var R=0;R<A.length;R++){if(w>=E.length)return;var O,$,H,K,ae,ue,oe,te=A[R];typeof te=="string"||typeof te.content=="string"?(O=E[w],(oe=(ue=typeof te=="string"?te:te.content).indexOf(O))!==-1&&(++w,$=ue.substring(0,oe),ae=S[O],H=void 0,(K={})["interpolation-punctuation"]=u,(K=l.tokenize(ae,K)).length===3&&((H=[1,1]).push.apply(H,g(K[1],l.languages.javascript,"javascript")),K.splice.apply(K,H)),H=new l.Token("interpolation",K,o.alias,ae),K=ue.substring(oe+O.length),ae=[],$&&ae.push($),ae.push(H),K&&(M(ue=[K]),ae.push.apply(ae,ue)),typeof te=="string"?(A.splice.apply(A,[R,1].concat(ae)),R+=ae.length-1):te.content=ae)):(oe=te.content,Array.isArray(oe)?M(oe):M([oe]))}})(k),new l.Token(j,k,"language-"+j,v)}l.languages.javascript["template-string"]=[p("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),p("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),p("svg",/\bsvg/.source),p("markdown",/\b(?:markdown|md)/.source),p("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),p("sql",/\bsql/.source),r].filter(Boolean);var x={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function h(v){return typeof v=="string"?v:Array.isArray(v)?v.map(h).join(""):h(v.content)}l.hooks.add("after-tokenize",function(v){v.language in x&&(function C(j){for(var w=0,S=j.length;w<S;w++){var k,E,M,A=j[w];typeof A!="string"&&(k=A.content,Array.isArray(k)?A.type==="template-string"?(A=k[1],k.length===3&&typeof A!="string"&&A.type==="embedded-code"&&(E=h(A),A=A.alias,A=Array.isArray(A)?A[0]:A,M=l.languages[A])&&(k[1]=f(E,M,A))):C(k):typeof k!="string"&&C([k]))}})(v.tokens)})})(re),(function(l){l.languages.typescript=l.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),l.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete l.languages.typescript.parameter,delete l.languages.typescript["literal-property"];var r=l.languages.extend("typescript",{});delete r["class-name"],l.languages.typescript["class-name"].inside=r,l.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:r}}}}),l.languages.ts=l.languages.typescript})(re),(function(l){var r=l.languages.javascript,i=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,o="(@(?:arg|argument|param|property)\\s+(?:"+i+"\\s+)?)";l.languages.jsdoc=l.languages.extend("javadoclike",{parameter:{pattern:RegExp(o+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),l.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(o+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:r,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return i})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+i),lookbehind:!0,inside:{string:r.string,number:r.number,boolean:r.boolean,keyword:l.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:r,alias:"language-javascript"}}}}),l.languages.javadoclike.addSupport("javascript",l.languages.jsdoc)})(re),(function(l){l.languages.flow=l.languages.extend("javascript",{}),l.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),l.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete l.languages.flow.parameter,l.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(l.languages.flow.keyword)||(l.languages.flow.keyword=[l.languages.flow.keyword]),l.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(re),re.languages.n4js=re.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),re.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),re.languages.n4jsd=re.languages.n4js,(function(l){function r(p,g){return RegExp(p.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),g)}l.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+l.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),l.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+l.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),l.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),l.languages.insertBefore("javascript","keyword",{imports:{pattern:r(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:l.languages.javascript},exports:{pattern:r(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:l.languages.javascript}}),l.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),l.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),l.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:r(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var i=["function","function-variable","method","method-variable","property-access"],o=0;o<i.length;o++){var m=i[o],u=l.languages.javascript[m],m=(u=l.util.type(u)==="RegExp"?l.languages.javascript[m]={pattern:u}:u).inside||{};(u.inside=m)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(re),(function(l){var r=l.util.clone(l.languages.javascript),i=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,o=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,u=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function m(f,x){return f=f.replace(/<S>/g,function(){return i}).replace(/<BRACES>/g,function(){return o}).replace(/<SPREAD>/g,function(){return u}),RegExp(f,x)}u=m(u).source,l.languages.jsx=l.languages.extend("markup",r),l.languages.jsx.tag.pattern=m(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),l.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,l.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,l.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,l.languages.jsx.tag.inside.comment=r.comment,l.languages.insertBefore("inside","attr-name",{spread:{pattern:m(/<SPREAD>/.source),inside:l.languages.jsx}},l.languages.jsx.tag),l.languages.insertBefore("inside","special-attr",{script:{pattern:m(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:l.languages.jsx}}},l.languages.jsx.tag);function p(f){for(var x=[],h=0;h<f.length;h++){var v=f[h],C=!1;typeof v!="string"&&(v.type==="tag"&&v.content[0]&&v.content[0].type==="tag"?v.content[0].content[0].content==="</"?0<x.length&&x[x.length-1].tagName===g(v.content[0].content[1])&&x.pop():v.content[v.content.length-1].content!=="/>"&&x.push({tagName:g(v.content[0].content[1]),openedBraces:0}):0<x.length&&v.type==="punctuation"&&v.content==="{"?x[x.length-1].openedBraces++:0<x.length&&0<x[x.length-1].openedBraces&&v.type==="punctuation"&&v.content==="}"?x[x.length-1].openedBraces--:C=!0),(C||typeof v=="string")&&0<x.length&&x[x.length-1].openedBraces===0&&(C=g(v),h<f.length-1&&(typeof f[h+1]=="string"||f[h+1].type==="plain-text")&&(C+=g(f[h+1]),f.splice(h+1,1)),0<h&&(typeof f[h-1]=="string"||f[h-1].type==="plain-text")&&(C=g(f[h-1])+C,f.splice(h-1,1),h--),f[h]=new l.Token("plain-text",C,null,C)),v.content&&typeof v.content!="string"&&p(v.content)}}var g=function(f){return f?typeof f=="string"?f:typeof f.content=="string"?f.content:f.content.map(g).join(""):""};l.hooks.add("after-tokenize",function(f){f.language!=="jsx"&&f.language!=="tsx"||p(f.tokens)})})(re),(function(l){var r=l.util.clone(l.languages.typescript),r=(l.languages.tsx=l.languages.extend("jsx",r),delete l.languages.tsx.parameter,delete l.languages.tsx["literal-property"],l.languages.tsx.tag);r.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+r.pattern.source+")",r.pattern.flags),r.lookbehind=!0})(re),re.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},re.languages.swift["string-literal"].forEach(function(l){l.inside.interpolation.inside=re.languages.swift}),(function(l){l.languages.kotlin=l.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete l.languages.kotlin["class-name"];var r={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:l.languages.kotlin}};l.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:r},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:r},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete l.languages.kotlin.string,l.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),l.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),l.languages.kt=l.languages.kotlin,l.languages.kts=l.languages.kotlin})(re),re.languages.c=re.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),re.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),re.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},re.languages.c.string],char:re.languages.c.char,comment:re.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:re.languages.c}}}}),re.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete re.languages.c.boolean,re.languages.objectivec=re.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete re.languages.objectivec["class-name"],re.languages.objc=re.languages.objectivec,re.languages.reason=re.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),re.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete re.languages.reason.function,(function(l){for(var r=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,i=0;i<2;i++)r=r.replace(/<self>/g,function(){return r});r=r.replace(/<self>/g,function(){return/[^\s\S]/.source}),l.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+r),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},l.languages.rust["closure-params"].inside.rest=l.languages.rust,l.languages.rust.attribute.inside.string=l.languages.rust.string})(re),re.languages.go=re.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),re.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete re.languages.go["class-name"],(function(l){var r=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,i=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return r.source});l.languages.cpp=l.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return r.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:r,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),l.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return i})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),l.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:l.languages.cpp}}}}),l.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),l.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:l.languages.extend("cpp",{})}}),l.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},l.languages.cpp["base-clause"])})(re),re.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},re.languages.python["string-interpolation"].inside.interpolation.inside.rest=re.languages.python,re.languages.py=re.languages.python,re.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},re.languages.webmanifest=re.languages.json;var ku={};yv(ku,{dracula:()=>Sv,duotoneDark:()=>Cv,duotoneLight:()=>Ev,github:()=>Rv,gruvboxMaterialDark:()=>s1,gruvboxMaterialLight:()=>i1,jettwaveDark:()=>Kv,jettwaveLight:()=>Wv,nightOwl:()=>Dv,nightOwlLight:()=>Ov,oceanicNext:()=>zv,okaidia:()=>$v,oneDark:()=>t1,oneLight:()=>a1,palenight:()=>Hv,shadesOfPurple:()=>qv,synthwave84:()=>Fv,ultramin:()=>Vv,vsDark:()=>vx,vsLight:()=>Iv});var Nv={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},Sv=Nv,kv={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},Cv=kv,Tv={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},Ev=Tv,Av={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},Rv=Av,Mv={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},Dv=Mv,_v={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},Ov=_v,sn={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},Lv={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:sn.keyword}},{types:["attr-value"],style:{color:sn.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:sn.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:sn.primitive}},{types:["boolean"],style:{color:sn.boolean}},{types:["tag"],style:{color:sn.tag}},{types:["string"],style:{color:sn.string}},{types:["punctuation"],style:{color:sn.string}},{types:["selector","char","builtin","inserted"],style:{color:sn.char}},{types:["function"],style:{color:sn.function}},{types:["operator","entity","url","variable"],style:{color:sn.variable}},{types:["keyword"],style:{color:sn.keyword}},{types:["atrule","class-name"],style:{color:sn.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},zv=Lv,Bv={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},$v=Bv,Uv={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},Hv=Uv,Gv={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},qv=Gv,Yv={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},Fv=Yv,Zv={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},Vv=Zv,Qv={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},vx=Qv,Xv={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},Iv=Xv,Jv={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Kv=Jv,Pv={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Wv=Pv,e1={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},t1=e1,n1={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},a1=n1,l1={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},s1=l1,r1={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},i1=r1,o1=l=>y.useCallback(r=>{var i=r,{className:o,style:u,line:m}=i,p=yx(i,["className","style","line"]);const g=Di(_n({},p),{className:xx("token-line",o)});return typeof l=="object"&&"plain"in l&&(g.style=l.plain),typeof u=="object"&&(g.style=_n(_n({},g.style||{}),u)),g},[l]),c1=l=>{const r=y.useCallback(({types:i,empty:o})=>{if(l!=null){{if(i.length===1&&i[0]==="plain")return o!=null?{display:"inline-block"}:void 0;if(i.length===1&&o!=null)return l[i[0]]}return Object.assign(o!=null?{display:"inline-block"}:{},...i.map(u=>l[u]))}},[l]);return y.useCallback(i=>{var o=i,{token:u,className:m,style:p}=o,g=yx(o,["token","className","style"]);const f=Di(_n({},g),{className:xx("token",...u.types,m),children:u.content,style:r(u)});return p!=null&&(f.style=_n(_n({},f.style||{}),p)),f},[r])},u1=/\r\n|\r|\n/,jh=l=>{l.length===0?l.push({types:["plain"],content:`
|
|
132
135
|
`,empty:!0}):l.length===1&&l[0].content===""&&(l[0].content=`
|
|
133
|
-
`,l[0].empty=!0)},
|
|
136
|
+
`,l[0].empty=!0)},wh=(l,r)=>{const i=l.length;return i>0&&l[i-1]===r?l:l.concat(r)},d1=l=>{const r=[[]],i=[l],o=[0],u=[l.length];let m=0,p=0,g=[];const f=[g];for(;p>-1;){for(;(m=o[p]++)<u[p];){let x,h=r[p];const C=i[p][m];if(typeof C=="string"?(h=p>0?h:["plain"],x=C):(h=wh(h,C.type),C.alias&&(h=wh(h,C.alias)),x=C.content),typeof x!="string"){p++,r.push(h),i.push(x),o.push(0),u.push(x.length);continue}const j=x.split(u1),w=j.length;g.push({types:h,content:j[0]});for(let S=1;S<w;S++)jh(g),f.push(g=[]),g.push({types:h,content:j[S]})}p--,r.pop(),i.pop(),o.pop(),u.pop()}return jh(g),f},Nh=d1,m1=({prism:l,code:r,grammar:i,language:o})=>y.useMemo(()=>{if(i==null)return Nh([r]);const u={code:r,grammar:i,language:o,tokens:[]};return l.hooks.run("before-tokenize",u),u.tokens=l.tokenize(r,i),l.hooks.run("after-tokenize",u),Nh(u.tokens)},[r,i,o,l]),f1=(l,r)=>{const{plain:i}=l,o=l.styles.reduce((u,m)=>{const{languages:p,style:g}=m;return p&&!p.includes(r)||m.types.forEach(f=>{const x=_n(_n({},u[f]),g);u[f]=x}),u},{});return o.root=i,o.plain=Di(_n({},i),{backgroundColor:void 0}),o},p1=f1,h1=({children:l,language:r,code:i,theme:o,prism:u})=>{const m=r.toLowerCase(),p=p1(o,m),g=o1(p),f=c1(p),x=u.languages[m],h=m1({prism:u,language:m,code:i,grammar:x});return l({tokens:h,className:`prism-code language-${m}`,style:p!=null?p.root:{},getLineProps:g,getTokenProps:f})},x1=l=>y.createElement(h1,Di(_n({},l),{prism:l.prism||re,theme:l.theme||vx,code:l.code,language:l.language}));/*! Bundled license information:
|
|
134
137
|
|
|
135
138
|
prismjs/prism.js:
|
|
136
139
|
(**
|
|
@@ -141,22 +144,24 @@ prismjs/prism.js:
|
|
|
141
144
|
* @namespace
|
|
142
145
|
* @public
|
|
143
146
|
*)
|
|
144
|
-
*/const
|
|
145
|
-
`).map(u=>({type:"add",content:u}));const i
|
|
146
|
-
`),p=u.added?"add":u.removed?"remove":"context";for(const
|
|
147
|
-
`),language:
|
|
148
|
-
`),[r]),f=
|
|
149
|
-
`);return
|
|
150
|
-
...`})]}),f&&a.jsxs("button",{onClick:()=>m(b=>!b),className:"mt-1 text-xs font-mono text-terminal-dim hover:text-terminal-green transition-colors duration-200 ease-material flex items-center gap-1.5",children:[o&&a.jsx("span",{className:"text-secondary-text font-bold opacity-70",children:u?"[←]":"[→]"}),a.jsx("span",{children:u?"Show less":`Show more (${x.length} lines)`})]}),i&&i.length>0&&a.jsx("div",{className:"flex gap-2 mt-2 flex-wrap",children:i.map((b,j)=>a.jsx("img",{src:b,alt:`Attachment ${j+1}`,className:"max-w-[300px] max-h-[200px] rounded-md object-contain"},j))})]})});function Os(l){if(!l)return"";try{return new Date(l).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return""}}function s1({scenes:l,visibleCount:r,currentIndex:i,effectivePrefs:o,focusIndex:u,annotatedScenes:m,annotationCounts:p,onComment:x,onSeek:f,state:g,overlayActions:b,turnStats:j}){const T=y.useMemo(()=>{const k=[];let E=null,M=0;for(let A=0;A<l.length;A++){const _=l[A];if(_.type==="user-prompt"||_.type==="compaction-summary"||_.type==="context-injection"){E&&E.scenes.length>0&&k.push(E);const z=_.type==="compaction-summary"?"compaction":_.type==="context-injection"?"context-injection":"user";z==="user"&&M++,k.push({type:z,timestamp:_.timestamp,scenes:[{scene:_,index:A}],turnNumber:z==="user"?M:void 0}),E=null}else(!E||E.type!=="assistant")&&(E&&E.scenes.length>0&&k.push(E),E={type:"assistant",timestamp:_.timestamp,scenes:[],turnNumber:M>0?M:void 0}),E.scenes.push({scene:_,index:A})}return E&&E.scenes.length>0&&k.push(E),k},[l]),v=y.useMemo(()=>o.promptsOnly?T.filter(k=>(k.type==="user"||k.type==="compaction")&&k.scenes[0].index<r):T.filter(k=>k.scenes[0].index<r),[T,r,o.promptsOnly]),N=y.useMemo(()=>{for(let k=v.length-1;k>=0;k--)if(v[k].scenes.some(E=>E.index<=i))return k;return v.length-1},[v,i]),S=y.useMemo(()=>{const k=new Map;for(let E=1;E<v.length;E++){const M=v[E];if(M.type!=="user")continue;let A;for(let z=E-1;z>=0;z--){const B=v[z],F=B.scenes[B.scenes.length-1];if(F?.scene.timestamp){A=F.scene.timestamp;break}if(B.timestamp){A=B.timestamp;break}}if(!A||!M.timestamp)continue;const _=new Date(M.timestamp).getTime()-new Date(A).getTime();_>12e4&&k.set(E,_)}return k},[v]);return a.jsxs("div",{className:"max-w-4xl mx-auto space-y-5 pb-6",children:[v.map((k,E)=>a.jsxs(i1,{forceRender:E>=N-15&&E<=N+5,children:[S.has(E)&&a.jsx(r1,{gapMs:S.get(E)}),a.jsx(o1,{group:k,currentIndex:i,visibleCount:r,effectivePrefs:o,focusIndex:u,annotatedScenes:m,annotationCounts:p,onComment:x,overlayActions:b,turnStats:j})]},E)),g==="paused"&&r<l.length&&a.jsx("div",{className:"pt-4 pb-12 flex items-center justify-center animate-in fade-in slide-in-from-bottom-2 duration-700 ease-out select-none",children:a.jsxs("div",{className:"group/pause relative flex items-center gap-8 px-4 py-2 bg-transparent backdrop-blur-sm",children:[a.jsx("div",{className:"absolute inset-0 bg-terminal-orange/5 opacity-0 group-hover/pause:opacity-100 transition-opacity duration-700 blur-2xl -z-10"}),a.jsxs("div",{className:"flex items-center gap-2.5 pr-8 border-r border-terminal-border/20",children:[a.jsxs("div",{className:"relative flex h-2 w-2",children:[a.jsx("div",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-orange opacity-40"}),a.jsx("div",{className:"relative inline-flex rounded-full h-2 w-2 bg-terminal-orange/80 shadow-[0_0_8px_rgba(251,146,60,0.5)]"})]}),a.jsx("span",{className:"text-[10px] font-sans font-black text-terminal-orange uppercase tracking-[.25em] drop-shadow-sm",children:"Paused"})]}),a.jsxs("div",{className:"flex items-center gap-8",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded bg-terminal-surface-hover/80 border border-terminal-border-subtle/50 text-terminal-text shadow-sm",children:a.jsx("span",{className:"text-[11px] font-mono font-bold",children:"↓"})}),a.jsx("span",{className:"text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest opacity-80",children:"Explore"})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded bg-terminal-surface-hover/80 border border-terminal-border-subtle/50 text-terminal-text shadow-sm",children:a.jsx("span",{className:"text-[9px] font-mono font-black tracking-tight",children:"SPACE"})}),a.jsx("span",{className:"text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest opacity-80",children:"Resume"})]})]})]})}),r>=l.length&&a.jsxs("div",{className:"pt-12 pb-24 flex flex-col items-center justify-center animate-in fade-in zoom-in-95 duration-1000 ease-out select-none",children:[a.jsx("div",{className:"h-px w-8 bg-terminal-border-subtle mb-6"}),a.jsxs("div",{className:"flex flex-col items-center gap-1",children:[a.jsx("div",{className:"text-[10px] font-mono font-bold text-terminal-dimmer uppercase tracking-[0.3em]",children:"the end"}),a.jsx("div",{className:"text-[9px] font-mono text-terminal-border uppercase tracking-widest mt-1",children:"session replay complete"})]}),a.jsxs("div",{className:"mt-8 flex flex-col items-center gap-6",children:[a.jsxs("button",{onClick:()=>f?.(0),className:"group flex items-center gap-2.5 px-3.5 py-1.5 rounded-full bg-terminal-surface/30 border border-terminal-border-subtle text-terminal-dimmer hover:text-terminal-green hover:border-terminal-green/30 hover:bg-terminal-green/5 transition-all duration-300",children:[a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-transform duration-300 group-hover:-translate-y-0.5",children:a.jsx("path",{d:"m18 15-6-6-6 6"})}),a.jsx("span",{className:"text-[10px] font-mono font-bold uppercase tracking-widest transition-colors",children:"Back to Top"}),a.jsxs("span",{className:"text-[9px] font-mono font-bold opacity-0 group-hover:opacity-60 transition-opacity",children:[" ","[Home]"]})]}),a.jsxs("div",{className:"flex items-center gap-3 opacity-20",children:[a.jsx("div",{className:"w-1 h-1 rounded-full bg-terminal-green"}),a.jsx("div",{className:"w-1 h-1 rounded-full bg-terminal-blue"}),a.jsx("div",{className:"w-1 h-1 rounded-full bg-terminal-orange"})]})]})]})]})}function r1({gapMs:l}){const r=l>=36e5?`${Math.floor(l/36e5)}h ${Math.floor(l%36e5/6e4)}m later`:`${Math.floor(l/6e4)}m later`;return a.jsxs("div",{className:"flex items-center gap-3 py-1 px-4",children:[a.jsx("div",{className:"flex-1 h-px bg-terminal-border-subtle"}),a.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer whitespace-nowrap",children:r}),a.jsx("div",{className:"flex-1 h-px bg-terminal-border-subtle"})]})}const i1=y.memo(function({children:r,forceRender:i}){const o=y.useRef(null),[u,m]=y.useState(!1),p=y.useRef(0);y.useEffect(()=>{const f=o.current;if(!f)return;const g=new IntersectionObserver(([b])=>{m(b.isIntersecting),b.isIntersecting&&f.offsetHeight>0&&(p.current=f.offsetHeight)},{rootMargin:"800px 0px"});return g.observe(f),()=>g.disconnect()},[]);const x=u||i;return y.useEffect(()=>{x&&o.current&&o.current.offsetHeight>0&&(p.current=o.current.offsetHeight)}),a.jsx("div",{ref:o,style:!x&&p.current>0?{minHeight:p.current}:void 0,children:x?r:null})}),o1=y.memo(function({group:r,currentIndex:i,visibleCount:o,effectivePrefs:u,focusIndex:m,annotatedScenes:p,annotationCounts:x,onComment:f,overlayActions:g,turnStats:b}){const[j,T]=y.useState(!1),v=y.useMemo(()=>r.scenes.filter(z=>z.index<o),[r.scenes,o]),N=v.some(({index:z})=>z===i),S=typeof m=="number"&&v.some(({index:z})=>z===m),k=v[0]?.index;if(v.length===0)return null;const E=r.type==="user"&&x?.get(k)||0,M=r.type==="user"&&f&&(E>0||j)?a.jsxs("button",{onClick:z=>{z.stopPropagation(),f(k)},className:`absolute right-0 top-3 z-10 flex items-center gap-1 px-1.5 py-1 rounded-md text-xs font-mono transition-all duration-150 ${E>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover:opacity-100"}`,title:E>0?`${E} comment${E>1?"s":""}`:"Add comment",children:["💬",E>0&&a.jsx("span",{children:E})]}):null;if(r.type==="user")return a.jsxs("div",{id:`scene-${k}`,"data-scene-index":k,className:`group relative rounded-2xl px-5 py-4 transition-all duration-200 ease-material ml-4 md:ml-12 border ${S?"scene-nav-focused bg-terminal-green-emphasis border-terminal-green shadow-layer-lg":N?"bg-terminal-green-subtle border-terminal-green/30 shadow-layer-sm":"bg-terminal-surface border-terminal-border-subtle shadow-sm"}`,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),children:[M,a.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[a.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-green uppercase tracking-widest",children:"You"}),r.timestamp&&a.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:Os(r.timestamp)}),a.jsx("div",{className:"flex-1"}),S?a.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-green text-terminal-bg",children:"Jump Target"}):N&&a.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-green-subtle text-terminal-green border border-terminal-green/20",children:"Focused"}),r.turnNumber!==void 0&&a.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer font-bold",children:["#",String(r.turnNumber).padStart(2,"0")]})]}),a.jsx("div",{className:"text-left",children:v.map(({scene:z,index:B})=>{const F=g?.getOverlays(B)??[],ee=g?.getEffectiveContent(B),me=g?.showOriginal.has(B);return a.jsxs("div",{className:"scene-enter",children:[a.jsx(ki,{scene:z,isActive:B===i,collapseTools:u.collapseAllTools,effectiveContent:ee??void 0}),F.length>0&&a.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[F.map($=>a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple",children:$.source.type==="translate"?"Translated":$.source.type==="tone"?"Softened":"Modified"},$.id)),a.jsx("button",{onClick:()=>g?.toggleOriginal(B),className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:me?"Show modified":"Show original"}),a.jsx("button",{onClick:()=>g?.revertSceneOverlays(B),className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-red transition-colors",children:"Revert"})]})]},B)})})]});if(r.type==="compaction"){const z=v[0]?.scene;return!z||z.type!=="compaction-summary"?null:a.jsxs("div",{id:`scene-${k}`,"data-scene-index":k,className:`group relative rounded-xl px-5 py-3.5 transition-all duration-200 ease-material ${S?"scene-nav-focused bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm":N?"bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm":"bg-terminal-surface/50"}`,children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-dim uppercase tracking-widest",children:"Context Compaction"}),r.timestamp&&a.jsx("span",{className:"text-xs font-mono text-terminal-dimmer",children:Os(r.timestamp)})]}),a.jsx(hi,{content:z.content,isActive:k===i})]})}if(r.type==="context-injection"){const z=v[0]?.scene;if(!z||z.type!=="context-injection")return null;const B=z.injectionType||"system",F=B.startsWith("skill:")?`Skill: ${B.slice(6)}`:B.startsWith("command:")?`Command: ${B.slice(8)}`:B==="image"?"Image Injection":B==="local-command"?"Local Command":"System Context";return a.jsxs("div",{id:`scene-${k}`,"data-scene-index":k,className:`group relative rounded-xl px-5 py-3.5 transition-all duration-200 ease-material ${S?"scene-nav-focused bg-terminal-surface border-l-2 border-blue-500/60 shadow-layer-sm":N?"bg-terminal-surface border-l-2 border-blue-500/40 shadow-layer-sm":"bg-terminal-surface/50"}`,children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("span",{className:"text-[10px] font-sans font-semibold text-blue-400/80 uppercase tracking-widest",children:F}),r.timestamp&&a.jsx("span",{className:"text-xs font-mono text-terminal-dimmer",children:Os(r.timestamp)})]}),a.jsx(hi,{content:z.content,isActive:k===i})]})}const A=u.hideThinking?v.filter(z=>z.scene.type!=="thinking"):v;if(A.length===0)return null;const _=u.hideThinking?r.scenes.filter(z=>z.scene.type!=="thinking"):r.scenes;return u.compactAssistant?a.jsx(c1,{allScenes:_,filteredScenes:A,firstIndex:k,currentIndex:i,groupHasCurrent:N,groupHasFocusedTarget:S,timestamp:r.timestamp,annotationCounts:x,onComment:f,overlayActions:g,turnDurationMs:r.turnNumber?b?.[r.turnNumber-1]?.durationMs:void 0}):a.jsxs("div",{id:`scene-${k}`,"data-scene-index":k,className:`relative rounded-xl px-5 py-4 transition-all duration-200 ease-material ${S?"scene-nav-focused bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-lg":N?"bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-sm":"bg-terminal-surface shadow-layer-sm"}`,children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-blue uppercase tracking-widest",children:"Assistant"}),r.timestamp&&a.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:Os(r.timestamp)}),a.jsx("div",{className:"flex-1"}),S?a.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-emphasis text-terminal-blue",children:"Jump Target"}):N&&a.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue",children:"Focused"}),r.turnNumber!==void 0&&a.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer font-bold",children:["#",String(r.turnNumber).padStart(2,"0")]})]}),a.jsx("div",{className:"space-y-2",children:a.jsx(u1,{scenes:A,currentIndex:i,collapseTools:u.collapseAllTools,annotationCounts:x,onComment:f,overlayActions:g})})]})});function c1({allScenes:l,filteredScenes:r,firstIndex:i,currentIndex:o,groupHasCurrent:u,groupHasFocusedTarget:m,timestamp:p,annotationCounts:x,onComment:f,overlayActions:g,turnDurationMs:b}){const[j,T]=y.useState(!1);y.useEffect(()=>{const A=_=>{if(!u)return;const z=_.detail;z.action==="expand"?T(!0):z.action==="collapse"&&T(!1)};return window.addEventListener("vibe:toggle-expand",A),()=>window.removeEventListener("vibe:toggle-expand",A)},[u]);const v=y.useMemo(()=>{const A={},_=new Set;let z=0,B=0,F=0,ee=0;const me=[];for(const{scene:de}of l)if(de.type==="tool-call"){F++,de.toolName==="Agent"&&de.subAgent&&(ee++,me.includes(de.subAgent.agentType)||me.push(de.subAgent.agentType));const ce=pi(de.toolName);if(A[ce]=(A[ce]||0)+1,de.toolName==="Bash"&&de.input?.command){const pe=de.input.command.trim().split(/[\s|;&]/)[0];pe&&_.add(pe)}}else de.type==="text-response"?z++:de.type==="thinking"&&B++;let $;const I=l[0]?.scene.timestamp,P=l[l.length-1]?.scene.timestamp;if(I&&P){const de=Date.parse(P)-Date.parse(I);de>0&&($=de)}return{totalTools:F,toolBreakdown:A,responses:z,thinking:B,bashCommands:[..._],subAgentCalls:ee,subAgentTypes:me,turnDurationMs:$}},[l]),N=y.useMemo(()=>{for(let A=l.length-1;A>=0;A--)if(l[A].scene.type==="text-response")return l[A];return null},[l]),S=y.useMemo(()=>{const A=["Read","Write","Edit","Bash","Glob","Grep","Agent"],_=Object.entries(v.toolBreakdown);return _.sort((z,B)=>{const F=A.indexOf(z[0]),ee=A.indexOf(B[0]),me=F>=0?F:100,$=ee>=0?ee:100;return me-$}),_},[v.toolBreakdown]),k=y.useMemo(()=>x?l.reduce((A,{index:_})=>A+(x.get(_)||0),0):0,[l,x]),[E,M]=y.useState(!1);return a.jsxs("div",{id:`scene-${i}`,"data-scene-index":i,className:`group relative rounded-xl px-5 py-4 transition-all duration-200 ease-material ${m?"scene-nav-focused bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-lg":u?"bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-sm":"bg-terminal-surface shadow-layer-sm"}`,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:[f&&(k>0||E)&&!j&&a.jsxs("button",{onClick:A=>{A.stopPropagation(),f(i)},className:`absolute right-3 top-3 z-10 flex items-center gap-1 px-1.5 py-1 rounded-md text-xs font-mono transition-all duration-150 ${k>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover:opacity-100"}`,title:k>0?`${k} comment${k>1?"s":""}`:"Add comment",children:["💬",k>0&&a.jsx("span",{children:k})]}),a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-blue uppercase tracking-widest",children:"Assistant"}),p&&a.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:Os(p)}),(b||v.turnDurationMs)&&a.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:["· ",jt(b??v.turnDurationMs)]}),a.jsx("div",{className:"flex-1"}),m?a.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-emphasis text-terminal-blue",children:"Jump Target"}):u&&a.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue",children:"Focused"})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mb-3 text-[11px] font-mono",children:[v.responses>0&&a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue",children:[v.responses," response",v.responses>1?"s":""]}),v.totalTools>0&&a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange",children:[v.totalTools," tool",v.totalTools>1?"s":""]}),v.subAgentCalls>0&&a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-500/20 text-green-300",children:[v.subAgentCalls," agent",v.subAgentCalls>1?"s":"",v.subAgentTypes.length>0&&a.jsxs("span",{className:"opacity-70 text-[10px]",children:["(",v.subAgentTypes.join(", "),")"]})]}),v.thinking>0&&a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-purple-subtle text-terminal-purple",children:[v.thinking," thinking"]}),S.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-terminal-border mx-0.5",children:"|"}),S.map(([A,_])=>a.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-terminal-surface-hover text-terminal-dim",children:[a.jsx("span",{className:"text-terminal-orange",children:A}),A==="Bash"&&v.bashCommands.length>0&&a.jsxs("span",{className:"text-terminal-dimmer",children:["(",v.bashCommands.slice(0,4).join(", "),v.bashCommands.length>4?", ...":"",")"]}),a.jsx("span",{children:_})]},A))]})]}),N&&!j&&a.jsx("div",{className:"mb-2",children:a.jsx(tx,{content:g?.getEffectiveContent(N.index)??N.scene.content,isActive:N.index===o})}),j&&a.jsx("div",{className:"space-y-2 mb-2",children:r.map(({scene:A,index:_})=>{const z=x?.get(_)||0,B=A.type==="text-response"?g?.getEffectiveContent(_)??void 0:void 0;return a.jsxs("div",{"data-scene-index":_,className:`group/scene relative scene-enter ${f?"pr-7":""}`,children:[a.jsx(ki,{scene:A,isActive:_===o,collapseTools:!1,effectiveContent:B}),f&&a.jsxs("button",{onClick:F=>{F.stopPropagation(),f(_)},className:`absolute right-0 top-1 z-10 flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-xs font-mono transition-all duration-150 ${z>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover/scene:opacity-100"}`,title:z>0?`${z} comment${z>1?"s":""}`:"Add comment",children:["💬",z>0&&a.jsx("span",{children:z})]})]},_)})}),a.jsxs("button",{onClick:()=>T(!j),className:"text-xs font-mono text-terminal-dim hover:text-terminal-blue transition-colors flex items-center gap-1.5",children:[u&&a.jsx("span",{className:"text-secondary-text font-bold opacity-70",children:j?"[←]":"[→]"}),a.jsx("span",{children:j?"Collapse":"Show all details"})]})]})}function u1({scenes:l,currentIndex:r,collapseTools:i,annotationCounts:o,onComment:u,overlayActions:m}){const p=[];let x=[];for(const f of l){const g=x[x.length-1];g&&g.scene.type==="tool-call"&&f.scene.type==="tool-call"&&g.scene.toolName===f.scene.toolName&&!f.scene.diff&&!f.scene.bashOutput&&!g.scene.diff&&!g.scene.bashOutput?x.push(f):(x.length>0&&p.push(x),x=[f])}return x.length>0&&p.push(x),a.jsx(a.Fragment,{children:p.map(f=>{if(f.length<=1){const{scene:b,index:j}=f[0],T=o?.get(j)||0,v=b.type==="text-response"?m?.getEffectiveContent(j):void 0,N=b.type==="text-response"?m?.getOverlays(j)??[]:[];return a.jsxs("div",{"data-scene-index":j,className:`group/scene relative scene-enter ${u?"pr-7":""}`,children:[a.jsx(ki,{scene:b,isActive:j===r,collapseTools:i,effectiveContent:v??void 0}),N.length>0&&a.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[N.map(S=>a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple",children:S.source.type==="translate"?"Translated":S.source.type==="tone"?"Softened":"Modified"},S.id)),a.jsx("button",{onClick:()=>m?.toggleOriginal(j),className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:m?.showOriginal.has(j)?"Show modified":"Show original"}),a.jsx("button",{onClick:()=>m?.revertSceneOverlays(j),className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-red transition-colors",children:"Revert"})]}),u&&a.jsxs("button",{onClick:S=>{S.stopPropagation(),u(j)},className:`absolute right-0 top-1 z-10 flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-xs font-mono transition-all duration-150 ${T>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover/scene:opacity-100"}`,title:T>0?`${T} comment${T>1?"s":""}`:"Add comment",children:["💬",T>0&&a.jsx("span",{children:T})]})]},j)}const g=f[0].scene.toolName;return a.jsx(d1,{batch:f,toolName:g,currentIndex:r,collapseTools:i,annotationCounts:o,onComment:u},f[0].index)})})}function d1({batch:l,toolName:r,currentIndex:i,collapseTools:o,annotationCounts:u,onComment:m}){const[p,x]=y.useState(!1),f=u?l.reduce((b,{index:j})=>b+(u.get(j)||0),0):0,g=l.map(({scene:b})=>b.type==="tool-call"?m1(b.toolName,b.input):"");return a.jsxs("div",{"data-scene-index":l[0].index,className:`group/batch relative ${m?"pr-7":""}`,children:[a.jsxs("button",{onClick:()=>x(!p),className:"w-full flex items-center gap-2 px-3.5 py-2.5 text-xs font-mono text-terminal-dim rounded-xl bg-terminal-surface hover:bg-terminal-surface-hover transition-all duration-200 ease-material cursor-pointer text-left shadow-layer-sm",children:[a.jsx("span",{className:`transition-transform text-xs ${p?"rotate-90":""}`,children:"▶"}),a.jsx("span",{className:"text-terminal-orange font-semibold",children:r}),a.jsxs("span",{className:"text-terminal-dimmer",children:[l.length," call",l.length>1?"s":""]}),!p&&a.jsxs("span",{className:"truncate text-terminal-dimmer ml-1",children:[g.filter(Boolean).slice(0,3).join(", "),g.filter(Boolean).length>3&&"..."]})]}),m&&!p&&a.jsxs("button",{onClick:b=>{b.stopPropagation(),m(l[0].index)},className:`absolute right-0 top-1 z-10 flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-xs font-mono transition-all duration-150 ${f>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover/batch:opacity-100"}`,title:f>0?`${f} comment${f>1?"s":""}`:"Add comment",children:["💬",f>0&&a.jsx("span",{children:f})]}),p&&a.jsx("div",{className:"mt-1 ml-4 space-y-2 pl-4",children:l.map(({scene:b,index:j})=>{const T=u?.get(j)||0;return a.jsxs("div",{"data-scene-index":j,className:`group/scene relative scene-enter ${m?"pr-7":""}`,children:[a.jsx(ki,{scene:b,isActive:j===i,collapseTools:o}),m&&a.jsxs("button",{onClick:v=>{v.stopPropagation(),m(j)},className:`absolute right-0 top-1 z-10 flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-xs font-mono transition-all duration-150 ${T>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover/scene:opacity-100"}`,title:T>0?`${T} comment${T>1?"s":""}`:"Add comment",children:["💬",T>0&&a.jsx("span",{children:T})]})]},j)})})]})}function m1(l,r){switch(l){case"Read":return r.file_path||"";case"Glob":return r.pattern||"";case"Grep":return r.pattern||"";case"Agent":return r.description||"";default:return""}}const ki=y.memo(function({scene:r,isActive:i,collapseTools:o,effectiveContent:u}){switch(r.type){case"user-prompt":return a.jsx(l1,{content:u??r.content,images:r.images,isActive:i});case"compaction-summary":return a.jsx(hi,{content:r.content,isActive:i});case"context-injection":return a.jsx(hi,{content:r.content,isActive:i});case"thinking":return a.jsx(Dy,{content:r.content,isActive:i});case"text-response":return a.jsxs(a.Fragment,{children:[a.jsx(tx,{content:u??r.content,isActive:i}),r.isTruncated&&a.jsx("div",{className:"mt-1 text-[10px] font-mono text-terminal-orange/70 italic",children:"Response truncated (max_tokens reached)"})]});case"tool-call":return a.jsx(e1,{scene:r,isActive:i,forceCollapse:o})}}),f1=8;function Ba(l){const r=new URLSearchParams(window.location.search).get("session");if(!r)return l;const i=l.includes("?")?"&":"?";return`${l}${i}slug=${encodeURIComponent(r)}`}function xh({title:l,color:r}){return a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx("span",{className:`text-[10px] font-sans font-semibold uppercase tracking-widest ${r}`,children:l}),a.jsx("div",{className:"flex-1 h-px bg-terminal-border-subtle"})]})}function Wc({text:l,label:r}){const[i,o]=y.useState(!1);return a.jsx("button",{onClick:async()=>{await navigator.clipboard.writeText(l),o(!0),setTimeout(()=>o(!1),2e3)},className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors px-1.5 py-0.5 rounded bg-terminal-surface hover:bg-terminal-surface-hover border border-terminal-border-subtle",title:"Copy to clipboard",children:i?"Copied!":r||"Copy"})}function ni(l){try{const r=Date.now()-new Date(l).getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}catch{return""}}function Qn(l,r=!1){const i=r?Math.round(l*.75):l;if(i<1024)return`${i} B`;const o=i/1024;return o<1024?`${o.toFixed(1)} KB`:`${(o/1024).toFixed(1)} MB`}function eu({label:l,path:r}){return a.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono text-terminal-dim",children:[a.jsx("span",{className:"text-terminal-dimmer w-8 shrink-0",children:l}),a.jsx("span",{className:"text-terminal-text truncate",children:r})]})}function p1({actions:l,viewerMode:r,readOnly:i,session:o}){const{hasUnsaved:u,canSaveHtml:m,downloadHtml:p,downloadJson:x,publishGist:f,exportHtml:g,exportGithub:b,htmlExporting:j,githubExporting:T}=l,v=r==="editor",[N,S]=y.useState(null),[k,E]=y.useState(null),[M,A]=y.useState(null),[_,z]=y.useState(null),[B,F]=y.useState(!1),[ee,me]=y.useState(null),[$,I]=y.useState(!1),[P,de]=y.useState(null),[ce,pe]=y.useState("preview"),[H,L]=y.useState("unlisted"),[te,oe]=y.useState(!1),[ae,C]=y.useState(!1),[O,Z]=y.useState(null),[W,V]=y.useState(null),[fe,xe]=y.useState(null),[Me,Ae]=y.useState(null),_e=y.useRef(null),Ge=y.useRef(null),se=y.useRef(null),Ne=y.useRef(null),Se="https://vibe-replay.com",Qe=v?"":Se,rt=y.useMemo(()=>{if(v)return"";try{return new URL(Se).origin}catch{return""}},[v]),Ve=y.useCallback((J,K={})=>{const ue=`${Qe}${J}`;return fetch(ue,{...K,...v?{}:{credentials:"include"}})},[Qe,v]);y.useEffect(()=>()=>{_e.current&&(clearInterval(_e.current),_e.current=null),Ge.current&&(clearTimeout(Ge.current),Ge.current=null),se.current&&(clearTimeout(se.current),se.current=null),Ne.current&&(window.removeEventListener("message",Ne.current),Ne.current=null)},[]);const Ue=y.useMemo(()=>o?new TextEncoder().encode(JSON.stringify(o)).byteLength:0,[o]),pt=10*1024*1024,Lt=10*1024*1024,zt=Ue>pt,Bt=Ue>Lt,mn=y.useCallback(()=>{v&&Ve("/api/auth/get-session").then(J=>J.json()).then(J=>{const K=!!J?.session;A(K),K&&Ve("/api/cloud-replays").then(ue=>ue.json()).then(ue=>{xe(ue.storage?.used??null),Ae(ue.storage?.limit??null),o&&fetch(Ba("/api/cloud-info")).then(ge=>ge.json()).then(ge=>{const ye=ge?.cloud?.id,Re=ye?(ue.replays||[]).find(qe=>qe.id===ye):null,tt=Re||(ue.replays||[]).find(qe=>qe.storageType==="r2"&&qe.title===(o.meta.title||o.meta.slug));if(tt){const qe={id:tt.id,url:`${Se}/r/${tt.id}`,expiresAt:tt.expiresAt||"",visibility:tt.visibility};V(qe),tt.visibility&&L(tt.visibility),Re||fetch(Ba("/api/cloud-info"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)}).catch(()=>{})}}).catch(()=>{})}).catch(()=>{})}).catch(()=>A(!1))},[v,Ve]);y.useEffect(()=>{v&&(f&&(mn(),F(!0),fetch(Ba("/api/gist-info")).then(J=>J.json()).then(J=>{J.gist&&z(J.gist)}).catch(()=>{}).finally(()=>F(!1))),b&&fetch(Ba("/api/export/github/status")).then(J=>J.json()).then(J=>{J.exists&&me({svgContent:J.svgContent,markdown:J.markdown,svgPath:J.svgPath,mdPath:J.mdPath,gifContent:J.gifContent??null,gifPath:J.gifPath??null,gifGeneratedAt:J.gifGeneratedAt,svgGeneratedAt:J.svgGeneratedAt,mdGeneratedAt:J.mdGeneratedAt,replayUrl:J.replayUrl})}).catch(()=>{}))},[v,f,b,Ve,mn]),y.useEffect(()=>{if(!v)return;const J=()=>mn();return window.addEventListener("vibe-auth-change",J),()=>window.removeEventListener("vibe-auth-change",J)},[v,mn]);const $e=y.useCallback(async()=>{if(o){oe(!0),E(null);try{const J=JSON.stringify(o),K=o.meta.title||o.meta.slug,ue=`${K.replace(/[^a-zA-Z0-9_-]/g,"-").replace(/-+/g,"-").slice(0,60)}.json`,ge=_?`/api/gists/${_.gistId}`:"/api/gists",ye=await Ve(ge,{method:_?"PATCH":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:ue,content:J,description:`vibe-replay: ${K}`,public:!0})});if(!ye.ok){const qe=(await ye.json().catch(()=>({}))).error||"Gist publish failed";if(ye.status===401)throw A(!1),new Error(qe);if(_&&(ye.status===404||qe.includes("not found"))){z(null),fetch(Ba("/api/gist-info"),{method:"DELETE"}).catch(()=>{}),E({type:"error",text:"Gist was deleted on GitHub. Click again to create a new one."});return}throw new Error(qe)}const Re=await ye.json();z({gistId:Re.gistId,gistUrl:Re.gistUrl,viewerUrl:Re.viewerUrl,updatedAt:new Date().toISOString()}),E({type:"success",text:"Published!"})}catch(J){E({type:"error",text:J instanceof Error?J.message:String(J)})}finally{oe(!1)}}},[o,_,Ve]),Tn=y.useCallback(async()=>{if(o){C(!0),Z(null);try{const J=W?.id,K=await Ve("/api/cloud-replays",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({replay:o,visibility:H})});if(!K.ok){const ye=await K.json().catch(()=>({}));throw K.status===401&&A(!1),new Error(ye.error||"Upload failed")}const ue=await K.json();J&&J!==ue.id&&await Ve(`/api/cloud-replays/${J}`,{method:"DELETE"}).catch(()=>{}),V(ue),Z({type:"success",text:J?"Updated!":"Shared!"}),fetch(Ba("/api/cloud-info"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...ue,visibility:H})}).catch(()=>{});const ge=await Ve("/api/cloud-replays").catch(()=>null);if(ge){const ye=await ge.json().catch(()=>null);ye?.storage&&(xe(ye.storage.used??null),Ae(ye.storage.limit??null))}}catch(J){Z({type:"error",text:J instanceof Error?J.message:String(J)})}finally{C(!1)}}},[o,H,W,Ve]),fn=y.useCallback(async()=>{if(W?.id){C(!0),Z(null);try{const J=await Ve(`/api/cloud-replays/${W.id}`,{method:"DELETE"});if(!J.ok){const K=await J.json().catch(()=>({}));throw new Error(K.error||"Delete failed")}V(null),Z({type:"success",text:"Removed from cloud"}),fetch(Ba("/api/cloud-info"),{method:"DELETE"}).catch(()=>{}),Ve("/api/cloud-replays").then(K=>K.json()).then(K=>{xe(K.storage?.used??null),Ae(K.storage?.limit??null)}).catch(()=>{})}catch(J){Z({type:"error",text:J instanceof Error?J.message:String(J)})}finally{C(!1)}}},[W,Ve]),St=y.useCallback(async()=>{if(b){de(null),I(!0);try{const J=await b();await navigator.clipboard.writeText(J.markdown),me({svgContent:J.svgContent,markdown:J.markdown,svgPath:J.svgPath,mdPath:J.mdPath,gifContent:J.gifContent??null,gifPath:J.gifPath??null,gifGeneratedAt:J.gifGeneratedAt,svgGeneratedAt:J.svgGeneratedAt,mdGeneratedAt:J.mdGeneratedAt,replayUrl:J.replayUrl,warnings:J.warnings})}catch(J){de(J instanceof Error?J.message:String(J))}finally{I(!1)}}},[b]),G=y.useMemo(()=>{if(!ee?.markdown)return"";const J=ee.markdown.replace(/\[?!\[[^\]]*\]\([^)]*\.(?:svg|gif)\)\]?(?:\([^)]*\))?\n*/g,"");return zu(Ze.parse(J))},[ee?.markdown]),je=y.useMemo(()=>ee?.svgContent?Ty(ee.svgContent):"",[ee?.svgContent]);if(i)return a.jsx("div",{className:"p-6 text-center text-xs font-mono text-terminal-dim",children:"Export is not available in read-only mode"});const Ee="px-4 py-2 text-xs font-mono rounded-lg transition-colors text-center disabled:opacity-50 shrink-0";return a.jsx("div",{className:"flex-1 overflow-y-auto",children:a.jsx("div",{className:"p-6 max-w-3xl mx-auto",children:a.jsxs("div",{children:[o&&a.jsxs("div",{className:"flex items-center gap-2.5 mb-5",children:[a.jsx("h2",{className:"text-sm font-mono font-semibold text-terminal-text truncate",children:o.meta.title||o.meta.slug}),o.meta.provider&&a.jsx("span",{className:"shrink-0 text-[10px] font-mono text-terminal-dimmer px-1.5 py-0.5 rounded bg-terminal-surface border border-terminal-border-subtle",children:o.meta.provider})]}),u&&a.jsx("div",{className:"text-xs font-mono text-terminal-orange text-center mb-5 px-3 py-2 rounded-lg bg-terminal-orange-subtle border border-terminal-orange/20",children:"You have unsaved annotation changes"}),v&&a.jsxs("div",{id:"share",className:"mb-12",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx(xh,{title:"Share",color:"text-terminal-purple"}),Ue>0&&a.jsxs("span",{className:`text-[11px] font-mono px-2 py-0.5 rounded-md ${Ue>Lt?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-surface-2 text-terminal-dimmer"}`,children:[Qn(Ue)," replay"]})]}),M===!1?a.jsx("div",{className:"bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden",children:a.jsxs("div",{className:"p-6",children:[a.jsx("h3",{className:"text-lg font-sans font-semibold text-terminal-text mb-5",children:"Share your session — free"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-6",children:[a.jsxs("div",{className:"rounded-xl bg-terminal-bg border border-terminal-border-subtle p-5",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx("span",{className:"text-xs font-sans font-bold text-terminal-purple",children:"Cloud Share"}),a.jsx("span",{className:"text-[10px] font-mono font-semibold px-2 py-0.5 rounded-md bg-terminal-purple-subtle text-terminal-purple",children:"Private"})]}),a.jsxs("ul",{className:"space-y-2.5 text-sm font-sans text-terminal-dim",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"20 MB free storage"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"7-day shareable link"]})]})]}),a.jsxs("div",{className:"rounded-xl bg-terminal-bg border border-terminal-border-subtle p-5",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx("span",{className:"text-xs font-sans font-bold text-terminal-dim",children:"GitHub Gist"}),a.jsx("span",{className:"text-[10px] font-mono font-semibold px-2 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:"Public"})]}),a.jsxs("ul",{className:"space-y-2.5 text-sm font-sans text-terminal-dim",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"No storage limit"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"Permanent — never expires"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"Great for portfolios"]})]})]})]}),a.jsxs("button",{type:"button",onClick:async()=>{if(_e.current&&(clearInterval(_e.current),_e.current=null),Ge.current&&(clearTimeout(Ge.current),Ge.current=null),se.current&&(clearTimeout(se.current),se.current=null),Ne.current&&(window.removeEventListener("message",Ne.current),Ne.current=null),v){try{const K=await fetch("/api/auth/login",{method:"POST"}),ue=await K.json().catch(()=>null);K.ok&&ue?.url&&window.open(ue.url,"_blank")}catch{}_e.current=setInterval(async()=>{try{(await(await fetch("/api/auth/get-session")).json())?.session&&(_e.current&&(clearInterval(_e.current),_e.current=null),Ge.current&&(clearTimeout(Ge.current),Ge.current=null),A(!0),window.dispatchEvent(new Event("vibe-auth-change")))}catch{}},2e3),Ge.current=setTimeout(()=>{_e.current&&(clearInterval(_e.current),_e.current=null),Ge.current=null},300*1e3);return}window.open(`${Se}/auth/login?callback=/auth/success`,"_blank");const J=K=>{K.origin===rt&&K.data?.type==="vibe-replay-auth"&&K.data.user&&(window.removeEventListener("message",J),Ne.current=null,se.current&&(clearTimeout(se.current),se.current=null),A(!0),window.dispatchEvent(new Event("vibe-auth-change")))};Ne.current=J,window.addEventListener("message",J),se.current=setTimeout(()=>{window.removeEventListener("message",J),se.current=null,Ne.current===J&&(Ne.current=null)},300*1e3)},className:"group inline-flex items-center gap-2.5 px-6 py-3 rounded-xl bg-terminal-green-subtle hover:bg-terminal-green-emphasis text-terminal-green text-sm font-sans font-semibold transition-all duration-200 ease-material shadow-layer-sm hover:shadow-layer-md hover:-translate-y-0.5",children:[a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"currentColor",className:"transition-transform group-hover:scale-110",children:a.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),"Sign in with GitHub"]})]})}):M===!0?a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden p-5 flex flex-col",children:[a.jsx("div",{className:"flex items-center gap-2 mb-3",children:a.jsx("span",{className:"text-sm font-mono font-semibold text-terminal-purple",children:"Cloud Share"})}),a.jsx("div",{className:"flex items-center h-7 rounded-md overflow-hidden bg-terminal-bg mb-3",children:[{value:"private",label:"Private",icon:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})},{value:"unlisted",label:"Link only",icon:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),a.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})},{value:"public",label:"Public",icon:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),a.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}].map(({value:J,label:K,icon:ue})=>a.jsxs("button",{onClick:()=>L(J),className:`h-full flex-1 px-2.5 text-[11px] font-mono transition-colors flex items-center justify-center gap-1.5 whitespace-nowrap ${H===J?"bg-terminal-purple-subtle text-terminal-purple":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,children:[ue,K]},J))}),fe!=null&&Me!=null&&a.jsxs("div",{className:"mb-3",children:[a.jsxs("div",{className:"flex items-center justify-between text-[10px] font-mono text-terminal-dimmer mb-1.5",children:[a.jsxs("span",{children:[Qn(fe)," used"]}),a.jsxs("span",{children:[Qn(Me)," total"]})]}),(()=>{const J=fe/Me*100,K=!W&&Ue>0,ue=K?Ue/Me*100:0,ge=K&&fe+Ue>Me;return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-2 rounded-full bg-terminal-surface-hover overflow-hidden",children:a.jsxs("div",{className:"h-full flex",children:[fe>0&&a.jsx("div",{className:"h-full bg-terminal-purple transition-all",style:{width:`${Math.max(J,1)}%`}}),K&&a.jsx("div",{className:`h-full transition-all ${ge?"bg-terminal-orange":"bg-terminal-green"}`,style:{width:`${Math.max(Math.min(ue,100-J),1)}%`}})]})}),K&&a.jsxs("div",{className:"flex items-center gap-3 mt-1.5 text-[10px] font-mono text-terminal-dimmer",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-sm bg-terminal-purple"}),Qn(fe)," used"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:`w-1.5 h-1.5 rounded-sm ${ge?"bg-terminal-orange":"bg-terminal-green"}`}),"+",Qn(Ue)," this upload"]})]})]})})()]}),a.jsxs("p",{className:"text-[10px] font-mono text-terminal-dimmer flex items-center gap-1.5 mb-1",children:[a.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-terminal-orange",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]}),"Free tier links expire after 7 days"]}),zt&&a.jsxs("p",{className:"text-[11px] font-mono text-terminal-orange mt-1.5 flex items-center gap-1",children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",children:a.jsx("path",{d:"M8 1a1 1 0 0 1 1 1v5.5a1 1 0 0 1-2 0V2a1 1 0 0 1 1-1zM8 11a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 8 11z"})}),"Replay is ",Qn(Ue)," — exceeds 10MB limit"]}),W&&a.jsxs("div",{className:"mt-4 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono font-semibold text-terminal-green px-2 py-0.5 rounded-full bg-terminal-green-subtle",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green"}),"Shared"]}),a.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:["expires ",new Date(`${W.expiresAt}Z`).toLocaleDateString()]})]}),a.jsxs("div",{className:"flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle",children:[a.jsx("a",{href:`${Se}/r/${W.id}`,target:"_blank",rel:"noopener noreferrer",className:"flex-1 text-xs font-mono text-terminal-purple hover:text-terminal-text transition-colors truncate",children:`${Se}/r/${W.id}`}),a.jsx(Wc,{text:`${Se}/r/${W.id}`})]})]}),a.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[a.jsx("button",{onClick:Tn,disabled:ae||zt,className:`${Ee} ${zt?"bg-terminal-surface-2 text-terminal-dimmer border border-terminal-border cursor-not-allowed":W?"bg-terminal-surface-hover text-terminal-purple hover:bg-terminal-purple-subtle border border-terminal-border":"bg-terminal-purple-subtle text-terminal-purple hover:bg-[rgba(168,85,247,0.25)] border border-[rgba(168,85,247,0.2)]"}`,children:ae?"Uploading...":zt?"Too large":W?"Update":"Share to Cloud"}),W&&a.jsx("button",{onClick:fn,disabled:ae,className:`${Ee} bg-terminal-surface-hover text-terminal-red hover:bg-terminal-red-subtle border border-terminal-border`,children:"Delete"}),O&&a.jsx("span",{className:`text-[11px] font-mono ${O.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:O.text})]})]}),v&&a.jsxs("div",{className:"bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden p-5 flex flex-col",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx("span",{className:"text-sm font-mono font-semibold text-terminal-dim",children:"GitHub Gist"}),a.jsx("span",{className:"text-[10px] font-mono font-semibold px-2 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:"Public"})]}),a.jsxs("ul",{className:"space-y-1.5 text-xs font-sans text-terminal-dim mb-auto",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"Hosted on GitHub forever"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"Doesn't use your storage"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-terminal-orange shrink-0",children:"!"}),"Visible to everyone on the internet"]})]}),Bt&&a.jsxs("p",{className:"text-[11px] font-mono text-terminal-red mt-1.5 flex items-center gap-1",children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",children:a.jsx("path",{d:"M8 1a1 1 0 0 1 1 1v5.5a1 1 0 0 1-2 0V2a1 1 0 0 1 1-1zM8 11a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 8 11z"})}),"Replay is ",Qn(Ue)," — exceeds 10MB limit"]}),_&&a.jsxs("div",{className:"mt-4 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono font-semibold text-terminal-green px-2 py-0.5 rounded-full bg-terminal-green-subtle",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green"}),"Published"]}),a.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:ni(_.updatedAt)})]}),a.jsxs("div",{className:"flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle",children:[a.jsx("a",{href:_.viewerUrl,target:"_blank",rel:"noopener noreferrer",className:"flex-1 text-xs font-mono text-terminal-blue hover:text-terminal-text transition-colors truncate",children:_.viewerUrl}),a.jsx(Wc,{text:_.viewerUrl})]})]}),B&&!_&&a.jsx("div",{className:"mt-4 text-[11px] font-mono text-terminal-dimmer animate-pulse",children:"Checking..."}),a.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[a.jsx("button",{onClick:$e,disabled:te||Bt,className:`${Ee} ${Bt?"bg-terminal-surface-2 text-terminal-dimmer border border-terminal-border cursor-not-allowed":"bg-terminal-surface-hover text-terminal-dim hover:bg-terminal-surface-2 border border-terminal-border"}`,children:te?"Publishing...":Bt?"Too large":_?"Update Gist":"Publish to Gist"}),k&&a.jsx("span",{className:`text-[11px] font-mono ${k.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:k.text}),_&&a.jsx("a",{href:_.gistUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[11px] font-mono text-terminal-blue hover:text-terminal-text transition-colors",children:"Open on GitHub"})]})]})]}):a.jsx("div",{className:"text-[11px] font-mono text-terminal-dimmer animate-pulse p-2",children:"Checking login status..."})]}),a.jsxs("div",{id:"export",children:[a.jsx(xh,{title:"Export",color:"text-terminal-green"}),a.jsxs("div",{className:"space-y-4",children:[v&&b&&a.jsxs(a.Fragment,{children:[ee?.gifContent&&a.jsxs("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden",children:[a.jsxs("div",{className:"px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-green",children:"Animated GIF"}),a.jsx("p",{className:"text-[10px] font-mono text-terminal-dim mt-0.5",children:"Works everywhere: GitHub PRs, issues, READMEs, Slack, Discord. Shows up to 8 turns."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[ee.gifGeneratedAt&&a.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:ni(ee.gifGeneratedAt)}),a.jsx("button",{onClick:St,disabled:$||T,className:"text-[11px] font-mono text-terminal-dim hover:text-terminal-green transition-colors px-1.5 py-0.5 rounded bg-terminal-bg hover:bg-terminal-surface-hover border border-terminal-border-subtle",title:"Regenerate all exports",children:$||T?a.jsx("span",{className:"animate-pulse",children:"..."}):a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),a.jsx("path",{d:"M21 3v5h-5"}),a.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),a.jsx("path",{d:"M8 16H3v5"})]})})]})]}),a.jsx("div",{className:"bg-terminal-bg p-2 flex justify-center border-y border-terminal-border-subtle",children:a.jsx("img",{src:`data:image/gif;base64,${ee.gifContent}`,alt:"Session preview GIF",className:"w-full h-auto block"})}),a.jsxs("div",{className:"px-5 py-3 space-y-1.5 border-t border-terminal-border-subtle",children:[ee.gifPath&&a.jsx(eu,{label:"File",path:`${ee.gifPath} (${Qn(ee.gifContent?.length??0,!0)})`}),a.jsxs("p",{className:"text-[10px] font-mono text-terminal-dimmer leading-relaxed pt-1",children:["Usage:"," ",a.jsx("span",{className:"text-terminal-text",children:""})]})]})]}),ee?.svgContent&&a.jsxs("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden",children:[a.jsxs("div",{className:"px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-orange",children:"Animated SVG"}),a.jsxs("p",{className:"text-[10px] font-mono text-terminal-dim mt-0.5",children:["Embed in READMEs, PRs, or anywhere that renders SVG. Shows up to"," ",f1," turns."]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[ee.svgGeneratedAt&&a.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:ni(ee.svgGeneratedAt)}),a.jsx("button",{onClick:St,disabled:$||T,className:"text-[11px] font-mono text-terminal-dim hover:text-terminal-orange transition-colors px-1.5 py-0.5 rounded bg-terminal-bg hover:bg-terminal-surface-hover border border-terminal-border-subtle",title:"Regenerate all exports",children:$||T?a.jsx("span",{className:"animate-pulse",children:"..."}):a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),a.jsx("path",{d:"M21 3v5h-5"}),a.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),a.jsx("path",{d:"M8 16H3v5"})]})})]})]}),a.jsx("div",{className:"bg-terminal-bg p-2 border-y border-terminal-border-subtle [&>svg]:w-full [&>svg]:h-auto [&>svg]:block",dangerouslySetInnerHTML:{__html:je}}),a.jsxs("div",{className:"px-5 py-3 space-y-1.5 border-t border-terminal-border-subtle",children:[a.jsx(eu,{label:"File",path:`${ee.svgPath} (${Qn(ee.svgContent?.length??0)})`}),ee.replayUrl&&a.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono text-terminal-dim",children:[a.jsx("span",{className:"text-terminal-dimmer w-8 shrink-0",children:"Link"}),a.jsx("a",{href:ee.replayUrl,target:"_blank",rel:"noopener noreferrer",className:"text-terminal-blue hover:text-terminal-text transition-colors truncate",children:ee.replayUrl})]}),a.jsxs("p",{className:"text-[10px] font-mono text-terminal-dimmer leading-relaxed pt-1",children:["Usage:"," ",a.jsx("span",{className:"text-terminal-text",children:""})]})]})]}),ee?.markdown&&a.jsxs("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden",children:[a.jsxs("div",{className:"px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-orange",children:"Markdown Summary"}),a.jsx("p",{className:"text-[10px] font-mono text-terminal-dim mt-0.5",children:"Paste into GitHub PRs, issues, or README files."})]}),ee.mdGeneratedAt&&a.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer self-start mt-0.5",children:ni(ee.mdGeneratedAt)})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Wc,{text:ee.markdown,label:"Copy MD"}),a.jsxs("div",{className:"flex items-center h-6 rounded-md overflow-hidden bg-terminal-bg border border-terminal-border-subtle",children:[a.jsx("button",{onClick:()=>pe("preview"),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${ce==="preview"?"bg-terminal-orange-subtle text-terminal-orange":"text-terminal-dim hover:text-terminal-text"}`,children:"Preview"}),a.jsx("button",{onClick:()=>pe("source"),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${ce==="source"?"bg-terminal-orange-subtle text-terminal-orange":"text-terminal-dim hover:text-terminal-text"}`,children:"Source"})]})]})]}),a.jsx("div",{className:"p-4",children:ce==="preview"?a.jsx("div",{className:"prose-terminal text-xs leading-relaxed bg-terminal-bg rounded-lg border border-terminal-border-subtle p-4 overflow-x-auto",dangerouslySetInnerHTML:{__html:G}}):a.jsx("pre",{className:"bg-terminal-bg rounded-lg border border-terminal-border-subtle p-3 text-[11px] font-mono text-terminal-dim leading-relaxed overflow-x-auto max-h-72 overflow-y-auto whitespace-pre-wrap",children:ee.markdown})}),a.jsx("div",{className:"px-5 py-3 space-y-1.5 border-t border-terminal-border-subtle",children:a.jsx(eu,{label:"File",path:ee.mdPath})}),ee.warnings&&ee.warnings.length>0&&a.jsxs("div",{className:"mx-5 mb-4 text-[11px] font-mono text-terminal-orange px-3 py-2 rounded-lg bg-terminal-orange-subtle/50 border border-terminal-orange/10",children:[a.jsx("div",{className:"font-semibold mb-1",children:"Security warnings"}),ee.warnings.map((J,K)=>a.jsx("div",{className:"text-terminal-dim",children:J},K))]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{onClick:St,disabled:$||T,className:`${Ee} ${ee?"bg-terminal-surface-hover text-terminal-orange hover:bg-terminal-orange-subtle border border-terminal-border":"bg-terminal-orange-subtle text-terminal-orange hover:bg-terminal-orange-emphasis border border-terminal-orange/20"}`,children:$||T?"Generating...":ee?"Regenerate GIF + SVG + Markdown":"Generate GIF + SVG + Markdown"}),P&&a.jsx("span",{className:"text-[11px] font-mono text-terminal-red",children:P}),!ee&&a.jsx("span",{className:"text-[11px] font-mono text-terminal-dim",children:"For GitHub PRs, READMEs, websites, email, Slack, and more. Shows up to 8 turns."})]})]}),v&&g&&a.jsxs("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5",children:[a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-green mb-1",children:"HTML Replay"}),a.jsx("p",{className:"text-[11px] font-mono text-terminal-dim leading-relaxed",children:"Self-contained HTML file with zero external requests. Includes all scenes, metadata, and annotations. Share via email, Slack, or host on any static server."})]}),a.jsx("button",{onClick:async()=>{S(null);try{const J=await g();S({type:"success",text:J})}catch(J){S({type:"error",text:J instanceof Error?J.message:String(J)})}},disabled:j,className:`${Ee} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis border border-terminal-green/20`,children:j?"Exporting...":"Export HTML"})]}),N&&a.jsx("div",{className:`mt-3 text-[11px] font-mono ${N.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:N.type==="success"?a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green shrink-0"}),"Saved to ",N.text]}):N.text})]}),!v&&m&&a.jsx("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-green mb-1",children:"Save HTML"}),a.jsx("p",{className:"text-[11px] font-mono text-terminal-dim leading-relaxed",children:"Download a self-contained HTML replay file with your comments included."})]}),a.jsx("button",{onClick:p,className:`${Ee} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis border border-terminal-green/20`,children:"Download HTML"})]})}),a.jsx("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-blue mb-1",children:"JSON Data"}),a.jsx("p",{className:"text-[11px] font-mono text-terminal-dim leading-relaxed",children:"Raw replay data including all scenes, metadata, and annotations. Useful for backup, re-import, or programmatic analysis."})]}),a.jsx("button",{onClick:x,className:`${Ee} bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis border border-terminal-blue/20`,children:"Download JSON"})]})})]})]})]})})})}const h1=[{title:"Playback",items:[{key:"Space",label:"Play / Pause"},{key:"↑ / ↓",label:"Step Back / Forward"},{key:"Home",label:"Reset to Start"},{key:"End / e",label:"Jump to End"}]},{title:"Navigation",items:[{key:"n / p",label:"Next / Prev Turn"},{key:"← / →",label:"Collapse / Expand Item"}]},{title:"Global",items:[{key:"?",label:"Show Keyboard Shortcuts"},{key:"⌘ K",label:"Open Search"},{key:"Esc",label:"Close Modal / Search"}]}];function x1({open:l,onClose:r}){const i=y.useCallback(o=>{(o.key==="Escape"||o.key==="?")&&r()},[r]);return y.useEffect(()=>{if(l)return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[l,i]),l?a.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4 bg-black/60 backdrop-blur-md animate-in fade-in duration-300",onClick:r,children:a.jsxs("div",{className:"w-full max-w-lg bg-terminal-bg border border-terminal-border-subtle rounded-2xl shadow-layer-xl overflow-hidden animate-in zoom-in-95 duration-200",onClick:o=>o.stopPropagation(),children:[a.jsxs("div",{className:"px-6 py-5 border-b border-terminal-border-subtle flex items-center justify-between",children:[a.jsx("h2",{className:"text-sm font-sans font-bold uppercase tracking-[0.2em] text-terminal-text",children:"Keyboard Shortcuts"}),a.jsx("button",{onClick:r,className:"text-terminal-dimmer hover:text-terminal-red transition-colors",children:a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsx("div",{className:"px-6 py-4 grid grid-cols-1 gap-8",children:h1.map(o=>a.jsxs("div",{className:"space-y-3.5",children:[a.jsx("h3",{className:"text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-[0.15em] pl-1",children:o.title}),a.jsx("div",{className:"grid grid-cols-1 gap-2.5",children:o.items.map(u=>a.jsxs("div",{className:"flex items-center justify-between group",children:[a.jsx("span",{className:"text-xs font-sans font-medium text-terminal-dim group-hover:text-terminal-text transition-colors",children:u.label}),a.jsx("kbd",{className:"min-w-[40px] px-2 py-1 flex items-center justify-center text-[11px] font-mono font-bold text-terminal-text bg-terminal-surface border border-terminal-border-subtle rounded-lg shadow-layer-sm",children:u.key})]},u.key))})]},o.title))}),a.jsx("div",{className:"px-6 py-4 bg-terminal-surface/30 border-t border-terminal-border-subtle",children:a.jsxs("p",{className:"text-[10px] font-sans font-medium text-terminal-dimmer text-center uppercase tracking-wider",children:["Press ",a.jsx("span",{className:"text-terminal-text font-mono font-bold",children:"?"})," to toggle this menu anytime"]})})]})}):null}function g1(l){return l==="claude-code"?"Claude Code":l==="cursor"?"Cursor":l}function b1({session:l,onStart:r,onViewInsights:i}){const{meta:o,scenes:u}=l,m=y.useMemo(()=>{const v=u.find(z=>z.type==="user-prompt");if(!v||v.type!=="user-prompt")return null;const N=v.content,S={};let k=0,E=0,M="",A=0;for(const z of u){if(z.type==="user-prompt"){if(A++,A>1)break;continue}if(A===1)if(z.type==="tool-call"){E++;const B=z.toolName.replace(/^mcp__.*__/,"");S[B]=(S[B]||0)+1}else z.type==="text-response"&&(k++,M=z.content)}const _=Object.entries(S).sort((z,B)=>B[1]-z[1]);return{prompt:N,responses:k,totalTools:E,toolEntries:_,lastResponse:M}},[u]),p=y.useMemo(()=>{const v=new Set;for(const N of u)N.type==="tool-call"&&N.diff&&v.add(N.diff.filePath);return v.size},[u]),x=jt(o.stats.durationMs),f=o.title||o.project,g=g1(o.provider),b=y.useMemo(()=>{const v=[];if(x&&v.push({value:x,label:"Duration",color:"text-terminal-text"}),v.push({value:String(o.stats.userPrompts),label:"Turns",color:"text-terminal-green"}),p>0&&v.push({value:String(p),label:"Files",color:"text-terminal-blue"}),o.stats.costEstimate!==void 0){const N=o.stats.costEstimate;v.push({value:`$${N<.01?N.toFixed(4):N.toFixed(2)}`,label:"Cost",color:"text-terminal-orange"})}return v.length<3&&o.stats.toolCalls>0&&v.push({value:String(o.stats.toolCalls),label:"Tool Calls",color:"text-terminal-orange"}),v},[x,p,o.stats]),j=y.useRef(!1),T=y.useRef(0);return y.useEffect(()=>{const v=k=>{j.current||k.deltaY>0&&(j.current=!0,r(!1))},N=k=>{T.current=k.touches[0].clientY},S=k=>{if(j.current)return;T.current-k.touches[0].clientY>15&&(j.current=!0,r(!1))};return window.addEventListener("wheel",v,{passive:!0}),window.addEventListener("touchstart",N,{passive:!0}),window.addEventListener("touchmove",S,{passive:!0}),()=>{window.removeEventListener("wheel",v),window.removeEventListener("touchstart",N),window.removeEventListener("touchmove",S)}},[r]),y.useEffect(()=>{const v=N=>{(N.key===" "||N.key==="Enter"||N.key==="ArrowDown"||N.key==="ArrowRight")&&(N.preventDefault(),r())};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[r]),a.jsxs("div",{className:"flex-1 flex flex-col items-center overflow-y-auto relative",children:[a.jsxs("div",{className:"absolute inset-0 pointer-events-none",children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-terminal-green-subtle via-transparent to-transparent"}),a.jsx("div",{className:"absolute inset-0 bg-dot-grid"})]}),a.jsx("div",{className:"flex-1 min-h-4 md:min-h-0"}),a.jsxs("div",{className:"max-w-2xl w-full px-6 md:px-8 pt-4 md:pt-0 text-center space-y-5 md:space-y-7 z-10 shrink-0",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl md:text-5xl font-sans font-bold text-terminal-text leading-[1.15] tracking-tight",children:f}),a.jsxs("p",{className:"text-sm font-sans text-terminal-dim",children:["A ",g," session replay by ",a.jsx("a",{href:"https://vibe-replay.com",target:"_blank",rel:"noopener noreferrer",className:"font-bold bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent hover:opacity-80 transition-opacity",children:"vibe-replay"})]}),(o.gitBranch||o.model)&&a.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-2",children:[o.gitBranch&&a.jsx("span",{className:"text-[11px] font-mono text-terminal-purple px-2 py-0.5 rounded-full bg-terminal-purple/10 border border-terminal-purple/20",title:o.gitBranches?o.gitBranches.join(" → "):o.gitBranch,children:o.gitBranches&&o.gitBranches.length>1?`${o.gitBranches[0]} → ${o.gitBranch}`:o.gitBranch}),o.model&&a.jsx("span",{className:"text-[11px] font-mono text-terminal-dim px-2 py-0.5 rounded-full bg-terminal-surface border border-terminal-border-subtle",children:o.model}),o.permissionMode==="bypassPermissions"&&a.jsx("span",{className:"text-[11px] font-mono text-terminal-orange px-2 py-0.5 rounded-full bg-terminal-orange/10 border border-terminal-orange/20",children:"dangerous mode"})]})]}),m&&a.jsxs("button",{type:"button",onClick:()=>r(),className:"w-full text-left appearance-none bg-transparent border-none p-0 cursor-pointer space-y-3",children:[a.jsxs("div",{className:"rounded-2xl px-5 py-4 ml-4 md:ml-12 bg-terminal-green-subtle border border-terminal-green/30 shadow-layer-sm hover:bg-terminal-green-emphasis transition-all duration-200 ease-material",children:[a.jsx("div",{className:"flex items-center gap-2 mb-2.5",children:a.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-green uppercase tracking-widest",children:"You"})}),a.jsx("div",{className:"text-terminal-green font-mono text-sm whitespace-pre-wrap break-words line-clamp-3",children:m.prompt})]}),a.jsxs("div",{className:"rounded-xl px-5 py-4 bg-terminal-surface shadow-layer-sm",children:[a.jsx("div",{className:"flex items-center gap-2 mb-2.5",children:a.jsx("span",{className:"text-[10px] font-sans font-semibold text-secondary-text uppercase tracking-widest",children:"Assistant"})}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mb-3 text-[11px] font-mono",children:[m.responses>0&&a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue",children:[m.responses," response",m.responses>1?"s":""]}),m.totalTools>0&&a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange",children:[m.totalTools," tool",m.totalTools>1?"s":""]}),m.toolEntries.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-terminal-border mx-0.5",children:"|"}),m.toolEntries.map(([v,N])=>a.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-terminal-surface-hover text-terminal-dim",children:[a.jsx("span",{className:"text-terminal-orange",children:v}),a.jsx("span",{children:N})]},v))]})]}),m.lastResponse&&a.jsx("div",{className:"text-sm font-mono text-terminal-dim whitespace-pre-wrap break-words line-clamp-2 leading-relaxed",children:m.lastResponse})]}),o.stats.userPrompts>1&&a.jsx("div",{className:"text-center",children:a.jsxs("span",{className:"text-[11px] font-sans text-terminal-dimmer",children:["and ",o.stats.userPrompts-1," more turn",o.stats.userPrompts-1!==1?"s":""," ","→"]})})]}),a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 sm:gap-3 max-w-lg mx-auto",children:b.map(v=>a.jsxs("div",{className:"bg-terminal-surface rounded-lg sm:rounded-xl px-2.5 py-2 sm:px-3 sm:py-3 shadow-layer-sm",children:[a.jsx("div",{className:`text-base sm:text-xl font-bold font-mono tabular-nums ${v.color}`,children:v.value}),a.jsx("div",{className:"text-[9px] sm:text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-medium",children:v.label})]},v.label))}),a.jsxs("div",{className:"hidden md:flex items-center justify-center gap-3 flex-wrap",children:[a.jsxs("button",{type:"button",onClick:()=>r(),className:"group inline-flex items-center gap-3 px-10 py-4 rounded-xl bg-terminal-green-subtle hover:bg-terminal-green-emphasis transition-all duration-200 ease-material shadow-layer-md hover:shadow-layer-lg hover:-translate-y-0.5 landing-pulse",children:[a.jsx("span",{className:"text-xl text-terminal-green group-hover:scale-110 transition-transform duration-200",children:"▶"}),a.jsx("span",{className:"text-base font-sans font-semibold text-terminal-green tracking-wide",children:"Watch Replay"})]}),i&&a.jsxs("button",{type:"button",onClick:i,className:"group inline-flex items-center gap-2 px-6 py-4 rounded-xl bg-terminal-surface hover:bg-terminal-surface-hover transition-all duration-200 ease-material shadow-layer-sm hover:shadow-layer-md border border-terminal-border/40 hover:border-terminal-border",children:[a.jsxs("svg",{"aria-hidden":"true",className:"w-4 h-4 text-terminal-blue group-hover:scale-110 transition-transform duration-200",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"18",x2:"18",y1:"20",y2:"10"}),a.jsx("line",{x1:"12",x2:"12",y1:"20",y2:"4"}),a.jsx("line",{x1:"6",x2:"6",y1:"20",y2:"14"})]}),a.jsx("span",{className:"text-sm font-sans font-semibold text-terminal-dim group-hover:text-terminal-text tracking-wide",children:"View Insights"})]})]}),a.jsx("div",{className:"h-24 md:hidden"})]}),a.jsxs("button",{type:"button",onClick:()=>r(!1),className:"hidden md:flex mt-8 md:mt-10 mb-6 z-10 shrink-0 flex-col items-center gap-2 group cursor-pointer",children:[a.jsx("span",{className:"text-xs font-sans font-medium text-terminal-dim group-hover:text-terminal-text transition-colors",children:"or scroll down"}),a.jsx("svg",{"aria-hidden":"true",className:"w-6 h-6 text-terminal-green animate-bounce group-hover:scale-110 transition-transform",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M6 9l6 6 6-6"})})]}),a.jsx("div",{className:"flex-1 min-h-0"}),a.jsx("div",{className:"md:hidden fixed bottom-0 left-0 right-0 z-50 bg-terminal-bg border-t border-terminal-border-subtle safe-bottom",children:a.jsxs("div",{className:"flex items-center gap-3 mx-6 my-4",children:[a.jsxs("button",{type:"button",onClick:()=>r(),className:"flex-[2] inline-flex items-center justify-center gap-2.5 py-3.5 rounded-xl bg-terminal-green text-terminal-bg font-semibold shadow-lg shadow-terminal-green/20 transition-all",children:[a.jsx("span",{className:"text-base",children:"▶"}),a.jsx("span",{className:"text-sm font-sans",children:"Watch Replay"})]}),i&&a.jsxs("button",{type:"button",onClick:i,className:"flex-1 inline-flex items-center justify-center gap-2 py-3.5 rounded-xl bg-terminal-surface border border-terminal-border-subtle hover:border-terminal-border transition-all",children:[a.jsxs("svg",{"aria-hidden":"true",className:"w-3.5 h-3.5 text-terminal-blue",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"18",x2:"18",y1:"20",y2:"10"}),a.jsx("line",{x1:"12",x2:"12",y1:"20",y2:"4"}),a.jsx("line",{x1:"6",x2:"6",y1:"20",y2:"14"})]}),a.jsx("span",{className:"text-sm font-sans font-medium text-terminal-dim",children:"Insights"})]})]})})]})}function gh({scenes:l,currentIndex:r,onSeek:i,overlayActions:o,turnStats:u}){const m=y.useMemo(()=>{const x=[];let f=null,g=0;return l.forEach((b,j)=>{if(b.type==="user-prompt"){f&&(f.endIndex=j-1,x.push(f)),g++;const v=o?.getEffectiveContent(j)??b.content;f={kind:"turn",turnNumber:g,promptIndex:j,prompt:v.replace(/\n/g," ").slice(0,120),toolCalls:0,toolNames:[],thinkingBlocks:0,textBlocks:0,subAgentCalls:0,endIndex:j}}else b.type==="compaction-summary"||b.type==="context-injection"?(f&&(f.endIndex=j-1,x.push(f),f=null),x.push({kind:b.type==="context-injection"?"injection":"compaction",promptIndex:j,preview:b.content.replace(/\n/g," ").slice(0,80)})):f&&(f.endIndex=j,b.type==="tool-call"?(f.toolCalls++,b.toolName==="Agent"&&b.subAgent&&f.subAgentCalls++,f.toolNames.includes(b.toolName)||f.toolNames.push(b.toolName)):b.type==="thinking"?f.thinkingBlocks++:b.type==="text-response"&&f.textBlocks++)}),f&&x.push(f),x},[l,o?.getEffectiveContent]),p=y.useMemo(()=>{for(let x=m.length-1;x>=0;x--)if(r>=m[x].promptIndex)return x;return-1},[m,r]);return a.jsx("div",{className:"flex flex-col gap-1 p-3.5 overflow-y-auto",children:m.map((x,f)=>{const g=f===p,b=f<p;if(x.kind==="compaction"||x.kind==="injection"){const j=x.kind==="injection"?"System context":"Context compacted",T=x.kind==="injection"?"⚡":"⟳";return a.jsx("button",{onClick:()=>i(x.promptIndex),className:`text-left px-3 py-2 rounded-lg transition-all duration-200 ease-material ${g?"bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm":"hover:bg-terminal-surface-hover text-terminal-dimmer hover:text-terminal-dim"}`,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-mono text-terminal-dimmer shrink-0",children:T}),a.jsx("span",{className:"text-xs font-mono text-terminal-dimmer italic truncate",children:j})]})},`c-${x.promptIndex}`)}return a.jsxs("button",{onClick:()=>i(x.promptIndex),className:`group text-left px-3 py-2.5 rounded-xl transition-all duration-200 ease-material ${g?"bg-terminal-green-subtle border-l-2 border-terminal-green shadow-layer-sm":b?"hover:bg-terminal-surface-hover text-terminal-dim hover:text-terminal-text":"hover:bg-terminal-surface-hover"}`,children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:`text-xs font-mono font-semibold shrink-0 mt-px tabular-nums ${g?"text-terminal-green":"text-terminal-dim"}`,children:String(x.turnNumber).padStart(2,"0")}),a.jsx("span",{className:"text-sm font-mono leading-snug line-clamp-2 text-terminal-text",children:x.prompt})]}),a.jsxs("div",{className:"flex items-center gap-2 mt-1.5 ml-6 flex-wrap",children:[x.toolCalls>0&&a.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-px rounded-full bg-terminal-orange-subtle text-terminal-orange",children:[x.toolCalls," tool",x.toolCalls>1?"s":""]}),x.subAgentCalls>0&&a.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-px rounded-full bg-green-500/20 text-green-300",children:[x.subAgentCalls," agent",x.subAgentCalls>1?"s":""]}),x.textBlocks>0&&a.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-px rounded-full bg-terminal-blue-subtle text-terminal-blue",children:[x.textBlocks," resp"]}),x.thinkingBlocks>0&&a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-px rounded-full bg-terminal-purple-subtle text-terminal-purple",children:"think"}),(()=>{const j=u?.[x.turnNumber-1];return j?.durationMs?a.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:jt(j.durationMs)}):null})()]}),g&&x.toolNames.length>0&&a.jsx("div",{className:"mt-1.5 ml-6 text-xs font-mono text-terminal-dim truncate",children:x.toolNames.join(", ")})]},`t-${x.promptIndex}`)})})}function y1(l){switch(l.type){case"user-prompt":return l.content;case"compaction-summary":return l.content;case"context-injection":return l.content;case"thinking":return l.content;case"text-response":return l.content;case"tool-call":return[l.toolName,JSON.stringify(l.input),l.result||"",l.bashOutput?.command||"",l.bashOutput?.stdout||""].join(" ");default:return""}}function v1(l,r){const i=l.toLowerCase().indexOf(r.toLowerCase());if(i===-1)return l.slice(0,120);const o=Math.max(0,i-40),u=Math.min(l.length,i+r.length+60);return(o>0?"...":"")+l.slice(o,u)+(u<l.length?"...":"")}const j1={"user-prompt":"User","compaction-summary":"Compaction","context-injection":"Injection",thinking:"Thinking","text-response":"Response","tool-call":"Tool"},w1={"user-prompt":"text-terminal-green","compaction-summary":"text-terminal-dim","context-injection":"text-blue-400",thinking:"text-terminal-purple","text-response":"text-terminal-blue","tool-call":"text-terminal-orange"};function N1({scenes:l,open:r,onClose:i,onSeek:o}){const[u,m]=y.useState(""),[p,x]=y.useState(0),f=y.useRef(null),g=y.useRef(null);y.useEffect(()=>{r&&(m(""),x(0),setTimeout(()=>f.current?.focus(),50))},[r]);const b=y.useMemo(()=>{if(u.length<2)return[];const v=u.toLowerCase(),N=[];for(let S=0;S<l.length;S++){const k=l[S],E=y1(k);if(E.toLowerCase().includes(v)&&N.push({sceneIndex:S,type:k.type,snippet:v1(E,u),toolName:k.type==="tool-call"?k.toolName:void 0}),N.length>=50)break}return N},[l,u]);y.useEffect(()=>x(0),[]),y.useEffect(()=>{if(!g.current)return;g.current.children[p]?.scrollIntoView({block:"nearest"})},[p]);const j=y.useCallback(v=>{const N=b[v];N&&(o(N.sceneIndex),i())},[b,o,i]),T=y.useCallback(v=>{v.key==="ArrowDown"?(v.preventDefault(),x(N=>Math.min(N+1,b.length-1))):v.key==="ArrowUp"?(v.preventDefault(),x(N=>Math.max(N-1,0))):v.key==="Enter"?(v.preventDefault(),j(p)):v.key==="Escape"&&i()},[b.length,p,j,i]);return r?a.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[8vh] sm:pt-[15vh]",onClick:i,children:[a.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),a.jsxs("div",{className:"relative w-full max-w-xl mx-3 sm:mx-0 bg-terminal-bg border border-terminal-border-subtle rounded-2xl shadow-layer-xl overflow-hidden",onClick:v=>v.stopPropagation(),onKeyDown:T,children:[a.jsxs("div",{className:"flex items-center gap-3 px-5 py-3.5 border-b border-terminal-border-subtle",children:[a.jsx("span",{className:"text-terminal-dim text-sm",children:"🔍"}),a.jsx("input",{ref:f,type:"text",value:u,onChange:v=>m(v.target.value),placeholder:"Search scenes...",className:"flex-1 bg-transparent text-sm font-sans font-medium text-terminal-text placeholder-terminal-dim outline-none"}),a.jsx("kbd",{className:"text-[10px] font-mono text-terminal-dimmer bg-terminal-surface px-2 py-0.5 rounded-md",children:"ESC"})]}),a.jsx("div",{ref:g,className:"max-h-[50vh] overflow-y-auto",children:u.length<2?a.jsx("div",{className:"px-4 py-8 text-center text-xs font-sans font-medium text-terminal-dim",children:"Type at least 2 characters to search"}):b.length===0?a.jsxs("div",{className:"px-4 py-8 text-center text-xs font-sans font-medium text-terminal-dim",children:['No results for "',u,'"']}):b.map((v,N)=>a.jsxs("button",{onClick:()=>j(N),className:`w-full text-left px-4 py-2.5 flex items-start gap-3 transition-colors ${N===p?"bg-terminal-green/10":"hover:bg-terminal-surface/50"}`,children:[a.jsx("span",{className:`text-[10px] font-sans font-bold uppercase shrink-0 mt-0.5 tracking-wider ${w1[v.type]||"text-terminal-dim"}`,children:v.toolName||j1[v.type]||v.type}),a.jsx("span",{className:"text-xs font-mono text-terminal-text line-clamp-2 break-words",children:S1(v.snippet,u)}),a.jsxs("span",{className:"text-xs font-mono text-terminal-dimmer shrink-0 mt-0.5",children:["#",v.sceneIndex]})]},v.sceneIndex))}),b.length>0&&a.jsxs("div",{className:"px-4 py-2 border-t border-terminal-border-subtle text-[10px] font-sans font-bold uppercase tracking-wider text-terminal-dimmer flex gap-4",children:[a.jsxs("span",{children:[b.length," result",b.length!==1?"s":""]}),a.jsx("span",{children:"↑↓ navigate"}),a.jsx("span",{children:"↵ select"})]})]})]}):null}function S1(l,r){if(!r)return l;const i=[],o=l.toLowerCase(),u=r.toLowerCase();let m=0,p=o.indexOf(u);for(;p!==-1;)p>m&&i.push(l.slice(m,p)),i.push(a.jsx("mark",{className:"bg-terminal-green/30 text-terminal-green rounded-sm px-0.5",children:l.slice(p,p+r.length)},p)),m=p+r.length,p=o.indexOf(u,m);return m<l.length&&i.push(l.slice(m)),i}function k1(l){const r=l.toLowerCase();return/\b(test|jest|vitest|pytest|cargo\s+test|mocha|spec)\b/.test(r)?"test":/\b(build|compile|tsc|webpack|vite\s+build|rollup)\b/.test(r)?"build":r.trimStart().startsWith("git ")?"git":/\b(lint|biome|eslint|prettier|format)\b/.test(r)?"lint":"other"}function E1(l){return l?{sqlite:"SQLite (store.db)","global-state":"SQLite (global state.vscdb)",jsonl:"JSONL transcript","jsonl+tools":"JSONL + agent-tools"}[l]||l:"unknown"}function ox(l,r){if(!l)return;if(!r||r.length<=1)return[l];const i=[...r],o=i.lastIndexOf(l);return o>=0&&o!==i.length-1&&(i.splice(o,1),i.push(l)),i}function C1(l,r){const i=ox(l,r);if(i)return i.length>1?`${i[0]} → ${i[i.length-1]}`:i[0]}function T1(l,r){return ox(l,r)?.join(" → ")}function cx(l){const[r,i]=y.useState(null),o=y.useRef(null),u=y.useCallback(p=>{const x=o.current;if(!x||l<=1)return;const f=x.getBoundingClientRect(),g=(p.clientX-f.left)/f.width,b=Math.round(g*(l-1));i(Math.max(0,Math.min(l-1,b)))},[l]),m=y.useCallback(()=>i(null),[]);return{hovered:r,ref:o,onMouseMove:u,onMouseLeave:m}}function A1({session:l}){const{meta:r,scenes:i}=l,o=y.useMemo(()=>Ah(r),[r]),u=y.useMemo(()=>Gb(r),[r]),m=y.useMemo(()=>{const f=[];let g=0,b=0;const j=new Map,T=L=>{let te=j.get(L);return te||(te={path:L,editCount:0,readCount:0,linesAdded:0,linesRemoved:0,turnEdits:new Map},j.set(L,te)),te},v=new Map,N=new Map;let S=0,k=0,E=0,M=0,A=0,_=0;const z=[],B=()=>{if(f.length>0){const L=f[f.length-1];L.toolCount=g,L.errorCount=b}};for(let L=0;L<i.length;L++){const te=i[L];switch(te.type){case"user-prompt":{B(),g=0,b=0,E+=te.content.length;const oe=te.content.split(`
|
|
151
|
-
`).find(
|
|
152
|
-
`).length:0,
|
|
153
|
-
`).length:0;
|
|
154
|
-
`).length:0,
|
|
155
|
-
`).length:0;
|
|
156
|
-
`),className:"shrink-0"}),r.gitBranch&&a.jsx("span",{className:"shrink-0 text-[10px] font-mono text-terminal-purple px-1.5 py-0.5 rounded bg-terminal-purple/10 border border-terminal-purple/20",title:T1(r.gitBranch,r.gitBranches),children:C1(r.gitBranch,r.gitBranches)}),r.permissionMode==="bypassPermissions"&&a.jsx("span",{className:"shrink-0 text-[10px] font-mono text-terminal-orange px-1.5 py-0.5 rounded bg-terminal-orange/10 border border-terminal-orange/20",children:"dangerous mode"})]}),o.length>0&&a.jsxs("div",{className:"rounded border border-terminal-orange/40 bg-terminal-orange/10 px-3 py-2",children:[a.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-orange uppercase tracking-widest mb-1",children:"Data Quality"}),a.jsx("div",{className:"space-y-0.5",children:o.slice(0,4).map(f=>a.jsx("div",{className:"text-xs font-mono text-terminal-dim",children:f},f))})]}),(r.dataSource||r.dataSourceInfo)&&a.jsxs("div",{className:"rounded border border-terminal-border-subtle bg-terminal-surface/40 px-3 py-2",children:[a.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Data Source"}),a.jsx("div",{className:"text-xs font-mono text-terminal-text",children:E1(r.dataSourceInfo?.primary||r.dataSource)}),r.dataSourceInfo?.sources&&r.dataSourceInfo.sources.length>0&&a.jsx("div",{className:"mt-1 space-y-0.5",children:r.dataSourceInfo.sources.map(f=>a.jsxs("div",{className:"text-xs font-mono text-terminal-dim truncate",title:f,children:[a.jsx("span",{className:"text-terminal-green",children:"source:"})," ",f]},f))}),r.dataSourceInfo?.supplements&&r.dataSourceInfo.supplements.length>0&&a.jsx("div",{className:"mt-1 space-y-0.5",children:r.dataSourceInfo.supplements.map(f=>a.jsxs("div",{className:"text-xs font-mono text-terminal-dim truncate",title:f,children:[a.jsx("span",{className:"text-terminal-purple",children:"supplement:"})," ",f]},f))})]}),r.provider==="cursor"&&r.cursorSidecars&&(r.cursorSidecars.requestContextCount||r.cursorSidecars.checkpointCount||r.cursorSidecars.hasWorkspaceRules)&&a.jsxs("div",{className:"rounded border border-terminal-border-subtle bg-terminal-surface/40 px-3 py-2",children:[a.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Cursor Sidecars"}),a.jsxs("div",{className:"space-y-0.5 text-xs font-mono text-terminal-dim",children:[r.cursorSidecars.requestContextCount?a.jsxs("div",{children:[a.jsx("span",{className:"text-terminal-green",children:"request context:"})," ",r.cursorSidecars.requestContextCount," sidecar",r.cursorSidecars.requestContextCount===1?"":"s"]}):null,r.cursorSidecars.hasWorkspaceRules?a.jsxs("div",{children:[a.jsx("span",{className:"text-terminal-purple",children:"workspace rules:"})," included"]}):null,r.cursorSidecars.checkpointCount?a.jsxs("div",{children:[a.jsx("span",{className:"text-terminal-orange",children:"checkpoint state:"})," ",r.cursorSidecars.checkpointCount," entr",r.cursorSidecars.checkpointCount===1?"y":"ies"]}):null]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-3",children:"Overview"}),a.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[a.jsx(Cl,{label:"Turns",value:m.userPrompts,color:"text-terminal-green"}),a.jsx(Cl,{label:"Tool Calls",value:m.toolCalls,color:"text-terminal-orange"}),a.jsx(Cl,{label:"Files Modified",value:m.editedFiles.length,color:"text-terminal-blue"}),a.jsx(Cl,{label:"Scenes",value:m.totalScenes,color:"text-terminal-text"})]}),m.totalDelegatedTools>0&&a.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs font-mono text-terminal-dim bg-green-500/5 border border-green-500/15 rounded-lg px-3 py-2",children:[a.jsxs("span",{className:"text-green-300",children:["+",m.totalDelegatedTools," tools delegated"]}),a.jsxs("span",{className:"text-terminal-dimmer",children:["to ",m.subAgents.length," sub-agent",m.subAgents.length>1?"s":""]}),m.totalDelegatedTokens>0&&a.jsxs("span",{className:"text-terminal-dimmer",children:["(",m.totalDelegatedTokens>1e6?`${(m.totalDelegatedTokens/1e6).toFixed(1)}M`:`${(m.totalDelegatedTokens/1e3).toFixed(0)}K`," ","tokens, context-free)"]})]}),a.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 mt-3 text-xs font-mono text-terminal-dim",children:[r.model&&a.jsxs("div",{children:["Model: ",a.jsx("span",{className:"text-terminal-text font-semibold",children:r.model})]}),(m.durationMs||u.duration)&&a.jsxs("div",{children:["Duration:"," ",a.jsx("span",{className:"text-terminal-text",children:m.durationMs?jt(m.durationMs):"unavailable"}),u.duration&&a.jsx(El,{title:u.duration,className:"ml-1"})]}),m.costEstimate!==void 0&&a.jsxs("div",{children:["Cost:"," ",a.jsxs("span",{className:"text-terminal-green",children:["$",m.costEstimate<.01?m.costEstimate.toFixed(4):m.costEstimate.toFixed(2)]}),a.jsx("span",{className:"text-terminal-dimmer",children:" (est.)"}),u.tokens&&a.jsx(El,{title:u.tokens,className:"ml-1"})]}),m.tokenUsage?a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:["In:"," ",a.jsx("span",{className:"text-terminal-blue",children:Ot(m.tokenUsage.inputTokens)})," / ","Out:"," ",a.jsx("span",{className:"text-terminal-green",children:Ot(m.tokenUsage.outputTokens)})]}),a.jsxs("div",{children:["Cache:"," ",a.jsx("span",{className:"text-terminal-purple",children:Ot(m.tokenUsage.cacheReadTokens)})," ","read /"," ",a.jsx("span",{className:"text-terminal-orange",children:Ot(m.tokenUsage.cacheCreationTokens)})," ","created"]})]}):u.tokens&&a.jsxs("div",{children:["Tokens: ",a.jsx("span",{className:"text-terminal-text",children:"unavailable"}),a.jsx(El,{title:u.tokens,className:"ml-1"})]}),!p&&u.turnStats&&a.jsxs("div",{children:["Turn Stats: ",a.jsx("span",{className:"text-terminal-text",children:"limited"}),a.jsx(El,{title:u.turnStats,className:"ml-1"})]})]})]}),p&&a.jsxs("div",{className:"space-y-5",children:[a.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest",children:"Per-Turn Metrics"}),a.jsx(M1,{turnStats:r.stats.turnStats,costEstimate:r.stats.costEstimate,turnLabels:x}),a.jsx(O1,{turnStats:r.stats.turnStats,turnLabels:x}),m.turns.length>=2&&a.jsx(z1,{turns:m.turns,turnLabels:x}),r.stats.turnStats.some(f=>f.durationMs)&&a.jsx(D1,{turnStats:r.stats.turnStats,turnLabels:x})]}),r.tokenUsageByModel&&Object.keys(r.tokenUsageByModel).length>1&&a.jsx(L1,{tokenUsageByModel:r.tokenUsageByModel}),r.apiErrors&&r.apiErrors.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"API Issues"}),a.jsx("div",{className:"text-xs font-mono text-terminal-dim space-y-1",children:(()=>{const f=r.apiErrors,g=Math.max(0,...f.map(v=>v.retryAttempt||0)),b=f.some(v=>v.errorType==="overloaded_error"||v.statusCode===529),j=f.some(v=>v.errorType==="rate_limit_error"||v.statusCode===429),T=[];return b&&T.push("API was overloaded"),j&&T.push("hit rate limits"),T.length===0&&T.push("API errors occurred"),a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"text-terminal-text",children:[T.join(" and ")," ",a.jsxs("span",{className:"text-terminal-red",children:[f.length," times"]})," during this session",g>1&&a.jsxs(a.Fragment,{children:[", with up to"," ",a.jsxs("span",{className:"text-terminal-orange",children:[g," retries"]})," in a row"]}),"."]}),a.jsx("div",{className:"text-terminal-dimmer",children:g>0?"Cursor automatically retried some of these errors.":"These errors were observed in local Cursor metadata."})]})})()})]}),r.trackedFiles&&r.trackedFiles.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["Files Tracked (",r.trackedFiles.length,")"]}),a.jsx("div",{className:"space-y-0.5 max-h-[200px] overflow-y-auto",children:r.trackedFiles.map(f=>a.jsx("div",{className:"text-[10px] font-mono text-terminal-dim truncate px-2 py-0.5 rounded hover:bg-terminal-surface-hover",title:f,children:f},f))})]}),r.contextFiles&&r.contextFiles.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["Context Files (inferred, ",r.contextFiles.length,")"]}),a.jsx("div",{className:"space-y-0.5 max-h-[200px] overflow-y-auto",children:r.contextFiles.map(f=>a.jsx("div",{className:"text-[10px] font-mono text-terminal-dim truncate px-2 py-0.5 rounded hover:bg-terminal-surface-hover",title:f,children:f},f))})]}),r.prLinks&&r.prLinks.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Pull Requests"}),a.jsx("div",{className:"space-y-1",children:r.prLinks.map(f=>a.jsxs("a",{href:f.prUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-xs font-mono text-terminal-blue hover:underline px-2 py-1 rounded hover:bg-terminal-surface-hover transition-colors",children:[a.jsxs("span",{className:"text-terminal-green",children:["#",f.prNumber]}),f.prRepository&&a.jsx("span",{className:"text-terminal-dimmer truncate",children:f.prRepository})]},f.prUrl))})]}),m.turns.length>0&&a.jsx(U1,{turns:m.turns,turnStats:r.stats.turnStats}),a.jsx(B1,{editedFiles:m.editedFiles,turns:m.turns}),(m.editedFiles.length>0||m.readOnlyFiles.length>0)&&a.jsx(H1,{editedFiles:m.editedFiles,readOnlyFiles:m.readOnlyFiles}),m.bashCats.length>1&&a.jsxs("div",{children:[a.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["Bash Commands",m.totalBashErrors>0&&a.jsxs("span",{className:"text-terminal-red ml-2 normal-case tracking-normal",children:[m.totalBashErrors," error",m.totalBashErrors!==1?"s":""]})]}),a.jsx("div",{className:"flex flex-wrap gap-2",children:m.bashCats.map(([f,g])=>a.jsxs("span",{className:"text-xs font-mono text-terminal-dim bg-terminal-surface rounded px-2 py-1",children:[f," ",a.jsx("span",{className:"text-terminal-text tabular-nums",children:g})]},f))})]}),m.topTools.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Top Tools"}),a.jsx("div",{className:"space-y-1.5",children:m.topTools.map(([f,g])=>a.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[a.jsx("span",{className:"text-terminal-text shrink-0 w-24 text-right truncate",title:f,children:f}),a.jsx("div",{className:"flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full bg-terminal-orange",style:{width:`${g/m.topTools[0][1]*100}%`}})}),a.jsx("span",{className:"text-terminal-dim shrink-0 w-6 text-right tabular-nums",children:g})]},f))})]}),m.subAgents.length>0&&a.jsx(R1,{subAgents:m.subAgents}),m.totalTools>0&&a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Activity Distribution"}),a.jsx("div",{className:"space-y-1.5",children:[["Read/Search",m.activityDist.read,"--blue"],["Write/Edit",m.activityDist.write,"--green"],["Execute",m.activityDist.execute,"--purple"],["Other",m.activityDist.other,"--dim"]].filter(([,f])=>f>0).map(([f,g,b])=>a.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[a.jsx("span",{className:"text-terminal-text shrink-0 w-24 text-right",children:f}),a.jsx("div",{className:"flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${g/m.totalTools*100}%`,backgroundColor:`var(${b})`}})}),a.jsxs("span",{className:"text-terminal-dim shrink-0 w-16 text-right tabular-nums",children:[g," (",Math.round(g/m.totalTools*100),"%)"]})]},f))})]})]})})}const bh={Explore:"bg-blue-500/20 text-blue-300 border-blue-500/30",Plan:"bg-purple-500/20 text-purple-300 border-purple-500/30",Shell:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30","general-purpose":"bg-green-500/20 text-green-300 border-green-500/30","claude-code-guide":"bg-amber-500/20 text-amber-300 border-amber-500/30"};function R1({subAgents:l}){const r=new Map;let i=0,o=0;for(const m of l){const p=r.get(m.agentType)||{count:0,toolCalls:0,totalTokens:0};p.count++,p.toolCalls+=m.toolCalls,p.totalTokens+=m.totalTokens,r.set(m.agentType,p),i+=m.toolCalls,o+=m.totalTokens}const u=[...r.entries()].sort((m,p)=>p[1].count-m[1].count);return a.jsxs("div",{children:[a.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["Sub-Agents (",l.length,")"]}),a.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:u.map(([m,p])=>{const x=bh[m]||"bg-gray-500/20 text-gray-300 border-gray-500/30";return a.jsxs("span",{className:`text-[11px] px-2 py-1 rounded border font-mono ${x}`,children:[m," ",a.jsxs("span",{className:"opacity-70",children:["x",p.count," (",p.toolCalls," tools)"]})]},m)})}),a.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs font-mono text-terminal-dim",children:[a.jsxs("div",{children:["Delegated tools: ",a.jsx("span",{className:"text-terminal-text",children:i})]}),o>0&&a.jsxs("div",{children:["Delegated tokens:"," ",a.jsx("span",{className:"text-terminal-text",children:o>1e6?`${(o/1e6).toFixed(1)}M`:o>1e3?`${(o/1e3).toFixed(0)}K`:o}),a.jsx("span",{className:"text-terminal-dimmer",children:" (context-free)"})]})]}),a.jsxs("div",{className:"mt-2 space-y-1",children:[l.slice(0,20).map((m,p)=>a.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-mono text-terminal-dim px-2 py-1 rounded bg-terminal-surface",children:[a.jsx("span",{className:`px-1 py-0.5 rounded border text-[9px] ${bh[m.agentType]||"bg-gray-500/20 text-gray-300 border-gray-500/30"}`,children:m.agentType}),a.jsx("span",{className:"truncate flex-1 text-terminal-text/70",children:m.description||"(no description)"}),a.jsxs("span",{className:"shrink-0",children:[m.toolCalls," tools"]}),m.totalTokens>0&&a.jsxs("span",{className:"shrink-0 text-terminal-dimmer",children:[m.totalTokens>1e3?`${(m.totalTokens/1e3).toFixed(0)}K`:m.totalTokens," ","tok"]})]},p)),l.length>20&&a.jsxs("div",{className:"text-[10px] text-terminal-dimmer font-mono px-2",children:["... and ",l.length-20," more"]})]})]})}function Ei({children:l,visible:r,x:i}){if(!r)return null;const o=i>.7;return a.jsx("div",{className:"absolute top-1 pointer-events-none z-10",style:{left:o?void 0:`${i*100}%`,right:o?`${(1-i)*100}%`:void 0},children:a.jsx("div",{className:`bg-terminal-surface border border-terminal-border-subtle rounded px-2 py-1 text-[10px] font-mono text-terminal-text shadow-md whitespace-nowrap ${o?"text-right":""}`,children:l})})}function M1({turnStats:l,costEstimate:r,turnLabels:i}){const o=[];let u=0;for(const S of l)u+=S.tokenUsage?.outputTokens||0,o.push(u);const m=o.length,{hovered:p,ref:x,onMouseMove:f,onMouseLeave:g}=cx(m);if(u===0)return null;const b=o[o.length-1],j=60,T=100,v=o.map((S,k)=>{const E=m===1?T/2:k/(m-1)*T,M=j-S/b*(j-6)-3;return`${E},${M}`}),N=p!==null?m===1?.5:p/(m-1):0;return a.jsxs("div",{children:[a.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:["Token Burn",r?" & Cost":""]}),a.jsxs("div",{className:"relative",children:[a.jsxs("svg",{ref:x,viewBox:`0 0 ${T} ${j}`,preserveAspectRatio:"none",className:"w-full h-20",onMouseMove:f,onMouseLeave:g,children:[a.jsx("polygon",{points:`0,${j} ${v.join(" ")} ${T},${j}`,style:{fill:"var(--green-subtle)"}}),a.jsx("polyline",{points:v.join(" "),fill:"none",style:{stroke:"var(--green)"},strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),p!==null&&a.jsx("line",{x1:N*T,y1:"0",x2:N*T,y2:j,stroke:"var(--dim)",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke",opacity:"0.5"})]}),a.jsx(Ei,{visible:p!==null,x:N,children:p!==null&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"text-terminal-green",children:["Turn ",p+1]}),i?.[p]&&a.jsx("div",{className:"text-terminal-dim truncate max-w-[200px]",children:i[p]}),a.jsxs("div",{children:["cumulative: ",Ot(o[p])," tokens"]}),l[p]?.tokenUsage&&a.jsxs("div",{className:"text-terminal-dimmer",children:["this turn: +",Ot(l[p].tokenUsage.outputTokens)," out"]})]})})]}),a.jsxs("div",{className:"flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5",children:[a.jsx("span",{children:"Turn 1"}),a.jsxs("span",{children:[Ot(b)," tokens",r?` ($${r<1?r.toFixed(2):r.toFixed(0)})`:""]}),a.jsxs("span",{children:["Turn ",m]})]}),l.some(S=>S.tokenUsage?.cacheReadTokens)&&a.jsx(_1,{turnStats:l})]})}function _1({turnStats:l}){const r=l.map(p=>{const x=p.tokenUsage;if(!x)return 0;const f=(x.cacheReadTokens||0)+(x.inputTokens||0);return f>0?x.cacheReadTokens/f:0}),i=24,o=100,u=r.map((p,x)=>{const f=r.length===1?o/2:x/(r.length-1)*o,g=i-p*(i-4)-2;return`${f},${g}`}),m=r.reduce((p,x)=>p+x,0)/r.length;return a.jsxs("div",{className:"mt-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest",children:"Cache Hit Rate"}),a.jsxs("span",{className:"text-[10px] font-mono text-terminal-purple",children:["avg ",Math.round(m*100),"%"]})]}),a.jsx("svg",{viewBox:`0 0 ${o} ${i}`,preserveAspectRatio:"none",className:"w-full h-6",children:a.jsx("polyline",{points:u.join(" "),fill:"none",style:{stroke:"var(--purple)"},strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})})]})}function O1({turnStats:l,turnLabels:r}){const i=l.map(S=>S.contextTokens||0),o=i.length,{hovered:u,ref:m,onMouseMove:p,onMouseLeave:x}=cx(o);if(!i.some(S=>S>0))return null;const f=Math.max(...i),g=f,b=60,j=100,T=i.map((S,k)=>{const E=o===1?j/2:k/(o-1)*j,M=b-S/g*(b-6)-3;return`${E},${M}`}),v=[];for(let S=0;S<i.length-1;S++){const k=i[S],E=i[S+1];k>0&&E>0&&E<k*.5&&v.push(S)}const N=u!==null?o===1?.5:u/(o-1):0;return a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Context Window Usage"}),a.jsxs("div",{className:"relative",children:[a.jsxs("svg",{ref:m,viewBox:`0 0 ${j} ${b}`,preserveAspectRatio:"none",className:"w-full h-20",onMouseMove:p,onMouseLeave:x,children:[a.jsx("polygon",{points:`0,${b} ${T.join(" ")} ${j},${b}`,style:{fill:"var(--cyan-subtle)"}}),a.jsx("polyline",{points:T.join(" "),fill:"none",style:{stroke:"var(--cyan)"},strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),v.map(S=>{const k=o===1?j/2:S/(o-1)*j;return a.jsx("line",{x1:k,y1:"0",x2:k,y2:b,style:{stroke:"var(--red)"},strokeWidth:"1",strokeDasharray:"2,1",vectorEffect:"non-scaling-stroke",opacity:"0.6"},S)}),u!==null&&a.jsx("line",{x1:N*j,y1:"0",x2:N*j,y2:b,stroke:"var(--dim)",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke",opacity:"0.5"})]}),a.jsx(Ei,{visible:u!==null,x:N,children:u!==null&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"text-terminal-cyan",children:["Turn ",u+1]}),r?.[u]&&a.jsx("div",{className:"text-terminal-dim truncate max-w-[200px]",children:r[u]}),a.jsxs("div",{children:[Ot(i[u])," tokens"]})]})})]}),a.jsxs("div",{className:"flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5",children:[a.jsx("span",{children:"Turn 1"}),a.jsxs("span",{children:["peak ",Ot(f)]}),a.jsxs("span",{children:["Turn ",o]})]}),v.length>0&&a.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[a.jsx("span",{className:"inline-block w-3 border-t border-dashed",style:{borderColor:"var(--red)"}}),a.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:[v.length," compaction",v.length!==1?"s":""]})]})]})}function D1({turnStats:l,turnLabels:r}){const i=l.map(x=>x.durationMs||0),o=Math.max(...i,1),u=i.some(x=>x>0),[m,p]=y.useState(null);return u?a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Turn Duration"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"flex items-end gap-px h-16",onMouseLeave:()=>p(null),children:i.map((x,f)=>{const g=x>0?Math.max(x/o*100,4):0;return a.jsx("div",{className:"flex-1 rounded-t-sm cursor-default",style:{height:`${g}%`,backgroundColor:x>0?"var(--blue)":"var(--surface)",opacity:m===f?1:x>0?.5+x/o*.5:.2},onMouseEnter:()=>p(f)},f)})}),a.jsx(Ei,{visible:m!==null,x:m!==null?i.length===1?.5:m/(i.length-1):0,children:m!==null&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"text-terminal-blue",children:["Turn ",m+1]}),r?.[m]&&a.jsx("div",{className:"text-terminal-dim truncate max-w-[200px]",children:r[m]}),a.jsx("div",{children:i[m]>0?jt(i[m]):"no data"})]})})]}),a.jsxs("div",{className:"flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5",children:[a.jsx("span",{children:"Turn 1"}),a.jsxs("span",{children:["max ",jt(o)]}),a.jsxs("span",{children:["Turn ",i.length]})]})]}):null}function L1({tokenUsageByModel:l}){const r=Object.entries(l).sort((u,m)=>m[1].outputTokens-u[1].outputTokens),i=r.reduce((u,[,m])=>u+m.outputTokens,0);if(i===0)return null;const o=["--green","--blue","--purple","--orange","--red"];return a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Model Breakdown"}),a.jsx("div",{className:"flex h-3 rounded-full overflow-hidden gap-px",children:r.map(([u,m],p)=>{const x=m.outputTokens/i*100;return a.jsx("div",{style:{width:`${x}%`,minWidth:x>2?void 0:"3px",backgroundColor:`var(${o[p%o.length]})`,opacity:.7},title:`${u}: ${Ot(m.outputTokens)} output tokens`},u)})}),a.jsx("div",{className:"flex flex-wrap gap-3 mt-1.5",children:r.map(([u,m],p)=>a.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-mono text-terminal-dimmer",children:[a.jsx("div",{className:"w-2 h-2 rounded-sm",style:{backgroundColor:`var(${o[p%o.length]})`,opacity:.7}}),a.jsxs("span",{children:[u," ",Ot(m.outputTokens)," (",Math.round(m.outputTokens/i*100),"%)"]})]},u))})]})}function z1({turns:l,turnLabels:r}){const i=l.map(p=>p.toolCount),o=Math.max(...i,1),[u,m]=y.useState(null);return l.length<2?null:a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Tool Calls per Turn"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"flex items-end gap-px h-16",onMouseLeave:()=>m(null),children:i.map((p,x)=>{const f=p>0?Math.max(p/o*100,4):0;return a.jsx("div",{className:"flex-1 rounded-t-sm cursor-default",style:{height:`${f}%`,backgroundColor:p>0?"var(--orange)":"var(--surface)",opacity:u===x?1:p>0?.5+p/o*.5:.2},onMouseEnter:()=>m(x)},x)})}),a.jsx(Ei,{visible:u!==null,x:u!==null?i.length===1?.5:u/(i.length-1):0,children:u!==null&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"text-terminal-orange",children:["Turn ",u+1]}),r?.[u]&&a.jsx("div",{className:"text-terminal-dim truncate max-w-[200px]",children:r[u]}),a.jsxs("div",{children:[i[u]," tool calls"]})]})})]}),a.jsxs("div",{className:"flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5",children:[a.jsx("span",{children:"Turn 1"}),a.jsxs("span",{children:["max ",o]}),a.jsxs("span",{children:["Turn ",i.length]})]})]})}function B1({editedFiles:l,turns:r}){if(r.length<3||l.length<1)return null;const i=l.slice(0,8),o=60,u=r.map(f=>f.index),m=u.length>o,p=m?u.slice(-o):u;let x=1;for(const f of i)for(const g of p){const b=f.turnEdits.get(g)||0;b>x&&(x=b)}return a.jsxs("div",{children:[a.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["File Activity Heatmap",m&&a.jsxs("span",{className:"normal-case tracking-normal font-normal ml-2",children:["(last ",o," of ",u.length," turns)"]})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("div",{className:"grid gap-px text-[10px] font-mono",style:{gridTemplateColumns:`minmax(80px, 120px) repeat(${p.length}, minmax(16px, 1fr))`},children:[a.jsx("div",{className:"text-terminal-dimmer px-1 py-0.5"}),p.map(f=>a.jsx("div",{className:"text-terminal-dimmer text-center py-0.5 text-[9px]",children:f},f)),i.map(f=>{const g=f.path.split("/").pop()||f.path;return[a.jsx("div",{className:"text-terminal-dim truncate px-1 py-0.5",title:f.path,children:g},`label-${f.path}`),...p.map(b=>{const j=f.turnEdits.get(b)||0,T=j===0?0:Math.round(20+Math.log1p(j)/Math.log1p(x)*60);return a.jsx("div",{className:"rounded-sm",style:{backgroundColor:j===0?"transparent":`color-mix(in srgb, var(--orange) ${T}%, transparent)`,minHeight:14},title:j>0?`${g} — Turn ${b}: ${j} edit${j!==1?"s":""}`:void 0},`${f.path}-${b}`)})]})]})})]})}const tu=20;function U1({turns:l,turnStats:r}){const[i,o]=y.useState(!1),{rows:u,compactionAfter:m}=y.useMemo(()=>{const v=Math.max(...l.map(A=>A.toolCount),1),N=Math.max(...r?.map(A=>A.durationMs||0)||[0],1),S=Math.max(...r?.map(A=>A.contextTokens||0)||[0],1),k=Math.max(...r?.map(A=>A.tokenUsage?.outputTokens||0)||[0],1),E=new Set;if(r)for(let A=0;A<r.length-1;A++){const _=r[A]?.contextTokens||0,z=r[A+1]?.contextTokens||0;_>0&&z>0&&z<_*.5&&E.add(A)}return{rows:l.map((A,_)=>{const z=r?.[_];return{...A,durationMs:z?.durationMs,contextTokens:z?.contextTokens,outputTokens:z?.tokenUsage?.outputTokens,toolRatio:A.toolCount/v,durationRatio:(z?.durationMs||0)/N,contextRatio:(z?.contextTokens||0)/S,outputRatio:(z?.tokenUsage?.outputTokens||0)/k}}),compactionAfter:E}},[l,r]),p=r&&r.length>0,x=p&&r.some(v=>v.durationMs),f=p&&r.some(v=>v.contextTokens),g=p&&r.some(v=>v.tokenUsage),b=3+(x?1:0)+(f?1:0)+(g?1:0),j=u.length>tu,T=j&&!i?u.slice(0,tu):u;return a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Per-Turn Breakdown"}),a.jsx("div",{className:"overflow-x-auto rounded border border-terminal-border-subtle",children:a.jsxs("table",{className:"w-full text-[11px] font-mono border-collapse",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"text-terminal-dimmer text-left",children:[a.jsx("th",{className:"px-2 py-1.5 font-semibold w-7",children:"#"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold",children:"Prompt"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Tools"}),x&&a.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-16",children:"Duration"}),f&&a.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-16",children:"Context"}),g&&a.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Output"})]})}),a.jsx("tbody",{children:T.map((v,N)=>a.jsx($1,{row:v,hasDuration:!!x,hasContext:!!f,hasTokens:!!g,colCount:b,showCompaction:m.has(N)},v.sceneIndex))}),j&&a.jsx("tfoot",{children:a.jsx("tr",{children:a.jsx("td",{colSpan:b,children:a.jsx("button",{type:"button",className:"w-full py-1.5 text-[11px] font-mono text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",onClick:()=>o(!i),children:i?"▴ Collapse":`▾ Show all ${u.length} turns (${u.length-tu} more)`})})})})]})})]})}function $1({row:l,hasDuration:r,hasContext:i,hasTokens:o,colCount:u,showCompaction:m}){return a.jsxs(a.Fragment,{children:[a.jsxs("tr",{className:"border-t border-terminal-border-subtle hover:bg-terminal-surface-hover transition-colors",children:[a.jsx("td",{className:"px-2 py-1 text-terminal-green tabular-nums",children:String(l.index).padStart(2,"0")}),a.jsx("td",{className:"px-2 py-1 text-terminal-text max-w-0",children:a.jsxs("div",{className:"truncate",title:l.text,children:[l.text,l.errorCount>0&&a.jsxs("span",{className:"text-terminal-red ml-1.5",children:[l.errorCount," err"]})]})}),a.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:a.jsx(Tl,{value:l.toolCount,ratio:l.toolRatio,color:"--orange"})}),r&&a.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:a.jsx(Tl,{value:l.durationMs?jt(l.durationMs):"—",ratio:l.durationRatio,color:"--blue"})}),i&&a.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:a.jsx(Tl,{value:l.contextTokens?Ot(l.contextTokens):"—",ratio:l.contextRatio,color:"--cyan"})}),o&&a.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:a.jsx(Tl,{value:l.outputTokens?Ot(l.outputTokens):"—",ratio:l.outputRatio,color:"--green"})})]}),m&&a.jsx("tr",{children:a.jsx("td",{colSpan:u,className:"px-0 py-0",children:a.jsxs("div",{className:"flex items-center gap-2 px-2 py-0.5 bg-terminal-red/5",children:[a.jsx("div",{className:"flex-1 border-t border-dashed border-terminal-red/40"}),a.jsx("span",{className:"text-[10px] font-mono text-terminal-red/70 shrink-0",children:"context compacted"}),a.jsx("div",{className:"flex-1 border-t border-dashed border-terminal-red/40"})]})})})]})}function Tl({value:l,ratio:r,color:i}){return a.jsx("span",{className:"inline-block w-full px-1 py-0.5 rounded-sm text-terminal-text",style:{backgroundColor:r>0?`color-mix(in srgb, var(${i}) ${Math.round(r*40)}%, transparent)`:void 0},children:l})}const nu=20;function H1({editedFiles:l,readOnlyFiles:r}){const[i,o]=y.useState(!1),u=y.useMemo(()=>[...l,...r],[l,r]),m=y.useMemo(()=>Math.max(...u.map(v=>v.editCount),1),[u]),p=y.useMemo(()=>Math.max(...u.map(v=>v.readCount),1),[u]),x=y.useMemo(()=>Math.max(...u.map(v=>v.linesAdded+v.linesRemoved),1),[u]),f=u.some(v=>v.linesAdded>0||v.linesRemoved>0),g=u.some(v=>v.turnEdits.size>0),b=u.length>nu,j=b&&!i?u.slice(0,nu):u,T=3+(f?1:0)+(g?1:0);return a.jsxs("div",{children:[a.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["File Impact",a.jsxs("span",{className:"normal-case tracking-normal ml-1.5",children:["(",l.length," modified",r.length>0&&`, ${r.length} read-only`,")"]})]}),a.jsx("div",{className:"overflow-x-auto rounded border border-terminal-border-subtle",children:a.jsxs("table",{className:"w-full text-[11px] font-mono border-collapse",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"text-terminal-dimmer text-left",children:[a.jsx("th",{className:"px-2 py-1.5 font-semibold",children:"File"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Edits"}),a.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Reads"}),f&&a.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-20",children:"+/−"}),g&&a.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Turns"})]})}),a.jsx("tbody",{children:j.map(v=>{const N=v.path.split("/").pop()||v.path,S=v.editCount>0;return a.jsxs("tr",{className:"border-t border-terminal-border-subtle hover:bg-terminal-surface-hover transition-colors",children:[a.jsx("td",{className:"px-2 py-1 max-w-0",children:a.jsxs("div",{className:`truncate ${S?"text-terminal-text":"text-terminal-dimmer"}`,title:v.path,children:[N,v.editCount>=10&&a.jsx("span",{className:"text-terminal-red ml-1",title:`${v.editCount} edits — high churn file`,children:"⚠"}),a.jsx("span",{className:"text-terminal-dimmer ml-1",children:v.path.slice(0,v.path.length-N.length-1)})]})}),a.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:v.editCount>0?a.jsx(Tl,{value:v.editCount,ratio:v.editCount/m,color:"--orange"}):a.jsx("span",{className:"text-terminal-dimmer",children:"—"})}),a.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:v.readCount>0?a.jsx(Tl,{value:v.readCount,ratio:v.readCount/p,color:"--blue"}):a.jsx("span",{className:"text-terminal-dimmer",children:"—"})}),f&&a.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:v.linesAdded>0||v.linesRemoved>0?a.jsxs("span",{className:"inline-block w-full px-1 py-0.5 rounded-sm",style:{backgroundColor:`color-mix(in srgb, var(--green) ${Math.round((v.linesAdded+v.linesRemoved)/x*30)}%, transparent)`},children:[a.jsxs("span",{className:"text-terminal-green",children:["+",v.linesAdded]}),a.jsx("span",{className:"text-terminal-dimmer",children:"/"}),a.jsxs("span",{className:"text-terminal-red",children:["−",v.linesRemoved]})]}):a.jsx("span",{className:"text-terminal-dimmer",children:"—"})}),g&&a.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:v.turnEdits.size>0?a.jsx("span",{className:"text-terminal-dim",children:v.turnEdits.size}):a.jsx("span",{className:"text-terminal-dimmer",children:"—"})})]},v.path)})}),b&&a.jsx("tfoot",{children:a.jsx("tr",{children:a.jsx("td",{colSpan:T,children:a.jsx("button",{type:"button",className:"w-full py-1.5 text-[11px] font-mono text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",onClick:()=>o(!i),children:i?"▴ Collapse":`▾ Show all ${u.length} files (${u.length-nu} more)`})})})})]})})]})}function G1(l){switch(l){case"user-prompt":return"#3fb950";case"compaction-summary":return"#666666";case"context-injection":return"#4488cc";case"thinking":return"#b392f0";case"text-response":return"#79b8ff";case"tool-call":return"#d29922"}}function q1({scenes:l,currentIndex:r,onSeek:i,annotatedScenes:o}){const u=y.useMemo(()=>{if(l.length<=200)return l.map((T,v)=>({startIndex:v,endIndex:v,type:T.type}));const b=l.length/200,j=[];for(let T=0;T<200;T++){const v=Math.floor(T*b),N=Math.floor((T+1)*b)-1,S={"user-prompt":4,"compaction-summary":1,"context-injection":1,"tool-call":3,"text-response":2,thinking:1};let k=l[v].type,E=S[k];for(let M=v+1;M<=N&&M<l.length;M++){const A=S[l[M].type];A>E&&(k=l[M].type,E=A)}j.push({startIndex:v,endIndex:N,type:k})}return j},[l]),m=l.length>0?(r+1)/l.length*100:0,p=y.useRef(null),x=y.useCallback(g=>{const b=p.current;if(!b)return;const j=b.getBoundingClientRect(),T=g.clientX-j.left,v=Math.max(0,Math.min(1,T/j.width)),N=Math.floor(v*l.length);i(N)},[l.length,i]),f=y.useMemo(()=>{if(!o||o.size===0)return[];const g=[];return o.forEach(b=>{b>=0&&b<l.length&&g.push((b+.5)/l.length*100)}),g},[o,l.length]);return l.length===0?null:a.jsxs("div",{className:"px-4 pt-3 pb-1 cursor-pointer",onClick:x,children:[f.length>0&&a.jsx("div",{className:"relative h-2 mb-0.5",children:f.map((g,b)=>a.jsx("div",{className:"absolute w-1.5 h-1.5 rounded-full bg-terminal-blue shadow-layer-sm",style:{left:`${g}%`,top:"50%",transform:"translate(-50%, -50%)"}},b))}),a.jsxs("div",{ref:p,className:"relative flex h-2 rounded-full overflow-hidden bg-terminal-surface-2",children:[u.map((g,b)=>a.jsx("div",{className:"flex-1 transition-opacity duration-150",style:{backgroundColor:G1(g.type),opacity:g.startIndex<=r?1:.15}},b)),a.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-white shadow-layer-sm transition-[left] duration-150 ease-material",style:{left:`${m}%`}})]})]})}const Y1=[{key:"replay",label:"Replay"},{key:"summary",label:"Insights"},{key:"export",label:"Share & Export"}],ux="vr-insights-seen";function F1(){try{return localStorage.getItem(ux)==="1"}catch{return!1}}function Z1(){try{localStorage.setItem(ux,"1")}catch{}}function X1({activeView:l,onChangeView:r,className:i="",rightContent:o,hiddenTabs:u}){const[m,p]=y.useState(()=>F1()||l==="summary"),x=y.useCallback(f=>{f==="summary"&&!m&&(Z1(),p(!0)),r(f)},[r,m]);return a.jsxs("div",{className:`flex items-center justify-between border-b border-terminal-border-subtle bg-terminal-bg shrink-0 overflow-x-auto ${i}`,children:[a.jsx("div",{className:"flex bg-terminal-surface/30",children:Y1.filter(f=>!u?.includes(f.key)).map(({key:f,label:g})=>a.jsxs("button",{onClick:()=>x(f),className:`relative px-4 py-2 text-[11px] font-sans font-semibold uppercase tracking-widest transition-colors ${l===f?"text-terminal-green border-b-2 border-terminal-green bg-terminal-surface/50":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,children:[g,f==="summary"&&!m&&l!=="summary"&&a.jsxs("span",{className:"absolute top-1.5 right-1 flex h-2 w-2",children:[a.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-green opacity-75"}),a.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-terminal-green"})]})]},f))}),o&&a.jsx("div",{className:"pr-4 py-1.5 flex items-center",children:o})]})}function Q1(l){l.classList.remove("jump-target-flash"),l.offsetWidth,l.classList.add("jump-target-flash"),window.setTimeout(()=>{l.classList.remove("jump-target-flash")},900)}function V1({session:l,viewPrefs:r,viewerMode:i="embedded",activeView:o,setActiveView:u,returnToLandingRef:m}){const p=i==="readonly",[x,f]=y.useState(!1);y.useEffect(()=>{if(m)return m.current=()=>{f(!1),mn(!1);const K=new URL(window.location.href);K.searchParams.has("s")&&(K.searchParams.delete("s"),window.history.replaceState({},"",K.toString()))},()=>{m.current=null}},[m]);const[g,b]=y.useState(void 0),[j,T]=y.useState(0),[v,N]=y.useState(!1),[S,k]=y.useState(!1),[E,M]=y.useState(null),[A,_]=y.useState(!0),z=S0(l,i),B=k0(l,i),{effectiveSession:F}=B,{annotations:ee}=z,me=T0(r),{state:$,currentIndex:I,visibleCount:P,speed:de,play:ce,pause:pe,togglePlayPause:H,seekTo:L,changeSpeed:te,totalScenes:oe,userPromptIndices:ae,computeNextIndex:C}=C0(l.scenes,me,x),O=y.useRef(null),[Z,W]=y.useState("outline"),[V,fe]=y.useState(!1),[xe,Me]=y.useState(!1),[Ae,_e]=y.useState(!1),Ge=y.useRef(null),se=y.useRef(null),Ne=y.useRef(!1),[Se,Qe]=y.useState(!1);y.useEffect(()=>{const K=ue=>{(ue.metaKey||ue.ctrlKey)&&ue.key==="k"?(ue.preventDefault(),fe(ge=>!ge)):ue.key==="/"?ue.target instanceof HTMLInputElement||ue.target instanceof HTMLTextAreaElement||(ue.preventDefault(),fe(!0)):ue.key==="?"?Qe(ge=>!ge):ue.key==="Escape"&&(Se?Qe(!1):V&&fe(!1))};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},[V,Se]);const rt=ae.filter(K=>K<=I).length||0,Ve=ae.length,Ue=y.useMemo(()=>{const K=new URLSearchParams(window.location.search).get("s");if(K!==null){const ue=Number(K);if(Number.isFinite(ue)&&ue>=0&&ue<l.scenes.length)return ue}return ae.length>=2?ae[1]:Math.min(15,l.scenes.length-1)},[ae,l.scenes.length]),pt=y.useCallback((K=!0)=>{f(!0),K?setTimeout(ce,300):setTimeout(()=>L(Ue),100)},[ce,L,Ue]),Lt=y.useCallback(()=>u("summary"),[u]),zt=y.useRef(r.displayMode);y.useEffect(()=>{zt.current!==r.displayMode&&(zt.current=r.displayMode,x||(f(!0),setTimeout(()=>L(Ue),100)))},[r.displayMode,x,L,Ue]);const[Bt,mn]=y.useState(()=>new URLSearchParams(window.location.search).get("s")!==null);y.useEffect(()=>{!x&&o!=="replay"&&!Bt&&(f(!0),setTimeout(()=>L(Ue),100))},[o,x,Ue,L,Bt]);const $e=y.useCallback(K=>{const ue=Math.max(0,Math.min(K,l.scenes.length-1));pe(),Ge.current=ue,T(ge=>ge+1),b(ue),se.current&&clearTimeout(se.current),se.current=setTimeout(()=>b(void 0),2500),L(ue)},[pe,L,l.scenes.length]);y.useEffect(()=>{!x&&Bt&&(f(!0),setTimeout(()=>$e(Ue),100))},[x,Bt,Ue,$e]);const Tn=y.useCallback(()=>{const K=ae.find(ue=>ue>I);K!==void 0&&$e(K)},[ae,I,$e]),fn=y.useCallback(()=>{const K=[...ae].reverse().find(ue=>ue<I);K!==void 0&&$e(K)},[ae,I,$e]),St=y.useRef(!1);y.useEffect(()=>{$==="playing"&&_e(!1)},[$]),y.useEffect(()=>{if(!O.current||I<0||Ge.current!==null)return;if(Ne.current){Ne.current=!1;return}const K=O.current;St.current=!0;const ue=ye=>{const Re=l.scenes;if(ye<0||ye>=Re.length)return ye;const tt=it=>it==="user-prompt"||it==="compaction-summary"||it==="context-injection";if(tt(Re[ye].type))return ye;let qe=ye;for(;qe>0&&!tt(Re[qe-1].type);)qe--;return qe},ge=ye=>{const Re=K.querySelector(`[data-scene-index="${ye}"]`);if(Re)return Re;const tt=ue(ye);return K.querySelector(`[data-scene-index="${tt}"]`)};requestAnimationFrame(()=>{const ye=ge(I);if(ye)if($==="playing")ye.scrollIntoView({behavior:"smooth",block:"center"});else{const Re=K.getBoundingClientRect(),it=ye.getBoundingClientRect().top-Re.top+K.scrollTop-Re.height*.3;K.scrollTo({top:Math.max(0,it),behavior:"smooth"})}else $==="playing"&&K.scrollTo({top:K.scrollHeight,behavior:"smooth"});setTimeout(()=>{St.current=!1},400)})},[I,$,l.scenes]),y.useEffect(()=>{const K=O.current;if(!K)return;const ue=()=>{St.current||(_e(!0),$==="playing"&&pe())};return K.addEventListener("wheel",ue,{passive:!0}),K.addEventListener("touchmove",ue,{passive:!0}),()=>{K.removeEventListener("wheel",ue),K.removeEventListener("touchmove",ue)}},[$,pe]),y.useEffect(()=>{const K=O.current;if(!K)return;let ue=!1;const ge=()=>{if($!=="paused"||ue||I>=l.scenes.length-1||St.current||Ge.current!==null)return;if(K.scrollHeight-K.scrollTop-K.clientHeight<80){ue=!0,Ne.current=!0;const kt=C(I);kt!==-1&&L(kt),setTimeout(()=>{ue=!1},150)}},ye=it=>{it.deltaY>0&&ge()};let Re=0;const tt=it=>{Re=it.touches[0].clientY},qe=it=>{Re-it.changedTouches[0].clientY>20&&ge()};return K.addEventListener("scroll",ge,{passive:!0}),K.addEventListener("wheel",ye,{passive:!0}),K.addEventListener("touchstart",tt,{passive:!0}),K.addEventListener("touchend",qe,{passive:!0}),()=>{K.removeEventListener("scroll",ge),K.removeEventListener("wheel",ye),K.removeEventListener("touchstart",tt),K.removeEventListener("touchend",qe)}},[$,I,l.scenes.length,L,C]),y.useEffect(()=>{const K=Ge.current,ue=O.current;if(K===null||!ue||I!==K)return;let ge=!1,ye=0;const Re=qe=>{const it=ue.querySelector(`[data-scene-index="${qe}"]`);if(it)return it;const kt=Array.from(ue.querySelectorAll("[data-scene-index]"));let Zt=null,Xt=1/0;for(const yn of kt){const ya=yn.getAttribute("data-scene-index");if(!ya)continue;const Vn=parseInt(ya,10);if(Vn<=qe){const Us=qe-Vn;Us<Xt&&(Xt=Us,Zt=yn)}}return Zt},tt=()=>{if(ge)return;const qe=Re(K);if(qe){St.current=!0;const it=ue.getBoundingClientRect(),Xt=qe.getBoundingClientRect().top-it.top+ue.scrollTop-it.height*.3;ue.scrollTo({top:Math.max(0,Xt),behavior:"smooth"}),Q1(qe),setTimeout(()=>{St.current=!1},450),Ge.current=null;return}ye+=1,ye<30?setTimeout(tt,80):Ge.current=null};return requestAnimationFrame(tt),()=>{ge=!0}},[I]),y.useEffect(()=>()=>{se.current&&clearTimeout(se.current)},[]);const G=y.useRef(null);y.useEffect(()=>{if(I<0||!x)return;G.current&&clearTimeout(G.current);const K=$==="playing"?500:0;return G.current=setTimeout(()=>{const ue=new URL(window.location.href);ue.searchParams.set("s",String(I)),window.history.replaceState({},"",ue.toString())},K),()=>{G.current&&clearTimeout(G.current)}},[I,$,x]);const je=i==="editor",Ee=y.useMemo(()=>ee.some(K=>K.author==="vibe-feedback"),[ee]);if(!x&&o==="replay")return a.jsx(b1,{session:F,onStart:pt,onViewInsights:Lt});const{meta:J}=l;return a.jsxs("div",{className:"flex flex-1 min-h-0 relative",children:[a.jsxs("div",{className:"flex flex-col flex-1 min-h-0 min-w-0",children:[a.jsx(X1,{activeView:o,onChangeView:u,hiddenTabs:p?["export"]:void 0,rightContent:o==="replay"?a.jsxs("div",{className:"flex items-center gap-3",children:[B.overlayCount>0&&a.jsxs("button",{onClick:()=>B.toggleAllOriginals(),className:"hidden md:flex items-center gap-2 text-xs font-mono text-terminal-dim",title:B.showAllOriginals?"Showing originals — click to show modified":"Showing modified — click to show originals",children:[a.jsx("span",{children:B.showAllOriginals?"Original":"Modified"}),a.jsx("span",{className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors duration-200 ${B.showAllOriginals?"bg-terminal-surface border border-terminal-border":"bg-terminal-purple brightness-75"}`,children:a.jsx("span",{className:`inline-block h-3.5 w-3.5 rounded-full bg-white shadow-sm transition-transform duration-200 ${B.showAllOriginals?"translate-x-[3px]":"translate-x-[17px]"}`})})]}),a.jsxs("button",{onClick:()=>N(!0),className:"hidden md:flex items-center gap-1.5 text-xs font-mono font-semibold text-terminal-text hover:text-terminal-green transition-colors",title:"Open comments",children:[a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-terminal-dim",children:a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),a.jsx("span",{children:"Comments"}),z.annotations.length>0&&a.jsx("span",{className:"ml-0.5 px-1 py-0.5 rounded bg-terminal-black text-[10px] text-terminal-text border border-terminal-border tabular-nums leading-none",children:z.annotations.length})]}),a.jsxs("button",{onClick:()=>N(!0),className:"md:hidden flex items-center gap-1 text-terminal-dim hover:text-terminal-text transition-colors",title:"Comments",children:[a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),z.annotations.length>0&&a.jsx("span",{className:"px-1 py-0.5 rounded bg-terminal-black text-[10px] text-terminal-text border border-terminal-border tabular-nums leading-none",children:z.annotations.length})]}),je&&a.jsxs("button",{onClick:()=>k(!0),className:"hidden md:flex pl-2 pr-3 py-1 text-[11px] font-mono rounded bg-[rgba(168,85,247,0.1)] hover:bg-[rgba(168,85,247,0.2)] border border-[rgba(168,85,247,0.3)] hover:border-[rgba(168,85,247,0.5)] text-terminal-purple transition-all items-center gap-1.5 relative overflow-hidden group shadow-sm",children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/5 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-1000"}),a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-[#c084fc]",children:a.jsx("path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"})}),a.jsx("span",{className:"font-semibold tracking-wide",children:"AI Studio"}),(Ee||B.overlayCount>0)&&a.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[a.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-purple opacity-75"}),a.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-terminal-purple"})]})]})]}):void 0}),a.jsxs("div",{className:"flex flex-1 min-h-0 min-w-0 w-full",children:[o==="replay"&&a.jsxs("div",{className:"flex flex-1 min-h-0 min-w-0 w-full relative",children:[A&&a.jsxs("div",{className:"hidden md:flex w-64 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-bg shadow-layer-sm",children:[a.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[a.jsxs("div",{className:"px-3 py-2 border-b border-terminal-border-subtle flex items-center justify-between group/side",children:[a.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest",children:"Outline"}),a.jsx("button",{onClick:()=>_(!1),className:"p-1 rounded hover:bg-terminal-surface text-terminal-dimmer hover:text-terminal-text transition-colors",title:"Hide Sidebar",children:a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),a.jsx("line",{x1:"9",x2:"9",y1:"3",y2:"21"})]})})]}),a.jsx(gh,{scenes:l.scenes,currentIndex:I,onSeek:$e,overlayActions:B,turnStats:l.meta.stats.turnStats})]}),a.jsxs("div",{className:"shrink-0 border-t border-terminal-border-subtle overflow-y-auto max-h-[35%]",children:[a.jsx("div",{className:"px-3 py-2 border-b border-terminal-border-subtle",children:a.jsx("button",{onClick:()=>u("summary"),className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest hover:text-terminal-green transition-colors",title:"Open Insights view",children:"Stats"})}),a.jsxs("div",{className:"p-3",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx(Cl,{label:"Turns",value:J.stats.userPrompts,color:"text-terminal-green"}),a.jsx(Cl,{label:"Tools",value:J.stats.toolCalls,color:"text-terminal-orange"})]}),a.jsxs("div",{className:"mt-2 text-xs font-mono text-terminal-dim space-y-0.5",children:[J.model&&a.jsx("div",{children:a.jsx("span",{className:"text-terminal-text",children:J.model})}),J.stats.durationMs&&a.jsxs("div",{children:[jt(J.stats.durationMs),J.stats.costEstimate!==void 0&&a.jsxs("span",{children:[" / ",a.jsxs("span",{className:"text-terminal-green",children:["$",J.stats.costEstimate<.01?J.stats.costEstimate.toFixed(4):J.stats.costEstimate.toFixed(2)]})]})]}),J.stats.tokenUsage&&a.jsxs("div",{children:[Ot(J.stats.tokenUsage.inputTokens)," in /"," ",Ot(J.stats.tokenUsage.outputTokens)," out"]})]})]})]})]}),a.jsxs("div",{className:"flex flex-col flex-1 min-h-0 min-w-0 relative",children:[!A&&a.jsx("button",{onClick:()=>_(!0),className:"absolute left-0 top-1/2 -translate-y-1/2 z-20 group/expand px-1.5 py-4 bg-terminal-surface/80 backdrop-blur-md border border-l-0 border-terminal-border-subtle rounded-r-xl text-terminal-dim hover:text-terminal-green transition-all shadow-layer-md animate-in slide-in-from-left-2 duration-300",title:"Show Sidebar",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"9 18 15 12 9 6"})})}),a.jsx("div",{ref:O,className:"flex-1 overflow-y-auto overflow-x-hidden px-5 py-5 pb-10 overscroll-contain",children:a.jsx(s1,{scenes:l.scenes,visibleCount:P,currentIndex:I,effectivePrefs:me,focusIndex:g,annotatedScenes:z.annotatedScenes,annotationCounts:z.annotationCounts,onSeek:$e,state:$,overlayActions:B,turnStats:l.meta.stats.turnStats,onComment:p?void 0:K=>{N(!0),M(K)}})}),a.jsx(N1,{scenes:F.scenes,open:V,onClose:()=>fe(!1),onSeek:K=>{$e(K),fe(!1)}})]})]}),o==="summary"&&a.jsx(A1,{session:F}),o==="export"&&a.jsx(p1,{actions:z,viewerMode:i,readOnly:p,session:F})]}),o==="replay"&&a.jsxs("div",{className:"shrink-0 border-t border-terminal-border-subtle bg-terminal-surface/80 backdrop-blur-md sticky bottom-0 safe-bottom shadow-layer-lg",children:[a.jsx(q1,{scenes:l.scenes,currentIndex:I,onSeek:$e,annotatedScenes:z.annotatedScenes}),a.jsx(_y,{state:$,speed:de,currentIndex:I,totalScenes:oe,userPromptCount:Ve,currentTurn:rt,onTogglePlayPause:H,onChangeSpeed:te,onPrevPrompt:fn,onNextPrompt:Tn,onOpenSearch:()=>fe(!0),onOpenOutline:()=>Me(!0),onShowHelp:()=>Qe(!0)})]})]}),a.jsx(Ry,{open:v,onClose:()=>N(!1),actions:z,scenes:F.scenes,currentIndex:I,onSeek:$e,addingForScene:E,onClearAddingTarget:()=>M(null),readOnly:p}),a.jsx(z0,{open:S,onClose:()=>k(!1),annotationActions:z,overlayActions:B}),a.jsxs("div",{className:`fixed inset-0 z-40 md:hidden transition-opacity duration-300 ${xe?"opacity-100":"opacity-0 pointer-events-none"}`,onClick:()=>Me(!1),children:[a.jsx("div",{className:"absolute inset-0 bg-black/40"}),a.jsxs("div",{className:`absolute bottom-0 left-0 right-0 h-[65vh] bg-terminal-bg border-t border-terminal-border-subtle rounded-t-2xl flex flex-col transition-transform duration-300 ease-material-decel safe-bottom shadow-layer-xl ${xe?"translate-y-0":"translate-y-full"}`,onClick:K=>K.stopPropagation(),children:[a.jsx("div",{className:"flex justify-center py-2.5 shrink-0",children:a.jsx("div",{className:"w-10 h-1 rounded-full bg-terminal-border"})}),a.jsxs("div",{className:"flex border-b border-terminal-border-subtle shrink-0",children:[a.jsx("button",{onClick:()=>W("outline"),className:`flex-1 px-3 py-2.5 text-[10px] font-sans font-semibold uppercase tracking-widest transition-colors ${Z==="outline"?"text-terminal-green border-b-2 border-terminal-green":"text-terminal-dim hover:text-terminal-text"}`,children:"Outline"}),a.jsxs("button",{onClick:()=>W("comments"),className:`flex-1 px-3 py-2.5 text-[10px] font-sans font-semibold uppercase tracking-widest transition-colors ${Z==="comments"?"text-terminal-green border-b-2 border-terminal-green":"text-terminal-dim hover:text-terminal-text"}`,children:["Comments",z.annotations.length>0&&a.jsxs("span",{className:"ml-1.5 text-terminal-dimmer",children:["(",z.annotations.length,")"]})]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain",children:Z==="outline"?a.jsx(gh,{scenes:l.scenes,currentIndex:I,onSeek:K=>{$e(K),Me(!1)},overlayActions:B,turnStats:l.meta.stats.turnStats}):a.jsx(ex,{actions:z,scenes:F.scenes,currentIndex:I,onSeek:K=>{$e(K)},addingForScene:E,onClearAddingTarget:()=>M(null),readOnly:p})})]})]}),a.jsx(x1,{open:Se,onClose:()=>Qe(!1)})]})}function I1(){const[l,r]=y.useState({status:"loading"}),i=y.useCallback(()=>{r({status:"loading"}),K1().then(o=>{r(o==="dashboard"?{status:"dashboard"}:{status:"ready",session:o.session,mode:o.mode,gistOwner:o.gistOwner})},o=>r({status:"error",message:String(o.message||o)}))},[]);return y.useEffect(()=>{i();const o=()=>i();return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[i]),l}function J1(){return!!window.__VIBE_REPLAY_EDITOR__}async function K1(){if(window.__VIBE_REPLAY_DATA__)return{session:window.__VIBE_REPLAY_DATA__,mode:"embedded"};const l=new URLSearchParams(window.location.search),r=l.get("cloud");if(r){if(!/^[a-zA-Z0-9_-]{10,16}$/.test(r))throw new Error("Invalid cloud replay ID");const p=await fetch(`https://vibe-replay.com/api/cloud-replays/${r}`,{credentials:"include"});if(!p.ok)throw p.status===404?new Error("Replay not found"):p.status===410?new Error("This replay has expired"):new Error(`Failed to load replay: ${p.status}`);const x=await p.json();if(x.redirect&&x.gistId){const{rawUrl:f}=await yh(x.gistId);return{session:await au(f),mode:"readonly"}}return{session:x,mode:"readonly"}}const i=l.get("gist");if(i){if(!/^[a-f0-9]{20,40}$/.test(i))throw new Error("Invalid gist ID");const{rawUrl:m,owner:p}=await yh(i),x=await au(m);return fetch(`https://vibe-replay.com/api/cloud-replays/view-gist/${i}`,{method:"POST"}).catch(()=>{}),{session:x,mode:"readonly",gistOwner:p}}if(J1()){if(l.get("view")==="dashboard")return"dashboard";const m=l.get("session");if(m){const p=await fetch(`/api/session?slug=${encodeURIComponent(m)}`);if(!p.ok)throw new Error(`Session not found: ${m}`);return{session:await p.json(),mode:"editor"}}return"dashboard"}const o=l.get("url");if(o)return{session:await au(o),mode:"readonly"};const u=l.get("file");if(u){const m=await fetch(u);if(!m.ok)throw new Error(`Failed to load file: ${m.status}`);return{session:await m.json(),mode:"embedded"}}return"dashboard"}async function au(l){const r=await fetch(l);if(!r.ok)throw new Error(`Failed to fetch: ${r.status} ${r.statusText}`);const i=await r.text();if(i.trimStart().startsWith("{"))return JSON.parse(i);throw new Error("URL must point to a vibe-replay JSON replay file")}async function yh(l){const r=await fetch(`https://api.github.com/gists/${l}`);if(!r.ok)throw new Error(`Gist not found: ${r.status}`);const i=await r.json(),o=i.files,u=Object.values(o).find(p=>p.filename.endsWith(".json"));if(!u)throw new Error("No JSON file found in gist");const m=i.owner?.login;return{rawUrl:u.raw_url,owner:m}}function P1(){const[l,r]=y.useState(()=>{const u=new URLSearchParams(window.location.search).get("theme");if(u==="light"||u==="dark")return u;const m=localStorage.getItem("vibe-replay-theme");return m==="light"||m==="dark"?m:"dark"});y.useEffect(()=>{const o=document.documentElement;o.classList.add("theme-transition"),o.classList.toggle("dark",l==="dark"),o.classList.toggle("light",l==="light"),localStorage.setItem("vibe-replay-theme",l);const u=setTimeout(()=>o.classList.remove("theme-transition"),300);return()=>clearTimeout(u)},[l]);const i=y.useCallback(()=>{r(o=>o==="dark"?"light":"dark")},[]);return{theme:l,toggleTheme:i}}function vh(){const r=new URLSearchParams(window.location.search).get("v");return r==="summary"||r==="export"?r:"replay"}const Ms="https://vibe-replay.com";function jh({isEditor:l}){const[r,i]=y.useState(null),[o,u]=y.useState(!1),m=y.useRef(null),p=y.useRef(null),x=y.useRef(null);return y.useEffect(()=>{const f=l?"/api/auth/get-session":`${Ms}/api/auth/get-session`;let g="";if(!l)try{g=new URL(Ms).origin}catch{g=""}const b=l?{}:{credentials:"include"},j=()=>{fetch(f,b).then(v=>v.json()).then(v=>{v?.session?i({authenticated:!0,user:v.user||null}):i({authenticated:!1,user:null})}).catch(()=>i({authenticated:!1,user:null}))};j();const T=v=>{!l&&v.origin===g&&v.data?.type==="vibe-replay-auth"&&v.data.user&&(i({authenticated:!0,user:v.data.user}),window.dispatchEvent(new Event("vibe-auth-change")))};return window.addEventListener("message",T),window.addEventListener("focus",j),()=>{p.current&&(clearInterval(p.current),p.current=null),x.current&&(clearTimeout(x.current),x.current=null),window.removeEventListener("message",T),window.removeEventListener("focus",j)}},[l]),y.useEffect(()=>{if(!o)return;const f=g=>{m.current&&!m.current.contains(g.target)&&u(!1)};return document.addEventListener("click",f),()=>document.removeEventListener("click",f)},[o]),r?r.authenticated?a.jsxs("div",{className:"relative",ref:m,children:[a.jsx("button",{type:"button",onClick:()=>u(!o),className:"flex items-center justify-center w-7 h-7 rounded-full ring-2 ring-terminal-border/40 hover:ring-terminal-green/60 transition-all cursor-pointer overflow-hidden",children:r.user?.image?a.jsx("img",{src:r.user.image,alt:"",className:"w-full h-full rounded-full object-cover"}):a.jsx("span",{className:"text-[10px] text-terminal-dim",children:"?"})}),o&&a.jsxs("div",{className:"absolute right-0 top-full mt-2 min-w-[140px] bg-terminal-surface border border-terminal-border rounded-lg shadow-lg py-1 z-50",children:[a.jsx("div",{className:"px-3 py-2 text-[11px] text-terminal-dim border-b border-terminal-border truncate font-mono",children:r.user?.name||"logged in"}),a.jsx("button",{type:"button",onClick:async()=>{const f=l?"/api/auth/sign-out":`${Ms}/api/auth/sign-out`;await fetch(f,{method:"POST",...l?{}:{credentials:"include"}}),window.location.reload()},className:"w-full text-left px-3 py-2 text-xs text-terminal-dim hover:text-red-400 hover:bg-terminal-surface-hover transition-colors cursor-pointer font-mono",children:"Logout"})]})]}):a.jsxs("button",{type:"button",onClick:async()=>{if(l)try{const b=await fetch("/api/auth/login",{method:"POST"}),j=await b.json().catch(()=>null);b.ok&&j?.url&&window.open(j.url,"_blank")}catch{}else window.open(`${Ms}/auth/login?callback=/auth/success`,"_blank");p.current&&(clearInterval(p.current),p.current=null),x.current&&(clearTimeout(x.current),x.current=null);const f=l?"/api/auth/get-session":`${Ms}/api/auth/get-session`,g=l?{}:{credentials:"include"};p.current=setInterval(async()=>{try{const j=await(await fetch(f,g)).json();j?.session&&(p.current&&(clearInterval(p.current),p.current=null),x.current&&(clearTimeout(x.current),x.current=null),i({authenticated:!0,user:j.user||null}),window.dispatchEvent(new Event("vibe-auth-change")))}catch{}},2e3),x.current=setTimeout(()=>{p.current&&(clearInterval(p.current),p.current=null),x.current=null},300*1e3)},className:"inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md bg-[#24292f] hover:bg-[#32383f] text-white text-xs font-medium transition-colors cursor-pointer border border-white/10",children:[a.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})}),"Sign in"]}):null}function lu(){const[l,r]=y.useState(null);return y.useEffect(()=>{window.__VIBE_REPLAY_EDITOR__&&fetch("https://api.github.com/repos/tuo-lei/vibe-replay").then(i=>i.json()).then(i=>{i.stargazers_count!=null&&r(i.stargazers_count)}).catch(()=>{})},[]),a.jsxs("a",{href:"https://github.com/tuo-lei/vibe-replay",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center h-7 rounded-md border border-terminal-border text-xs font-medium text-terminal-text/70 hover:text-terminal-text hover:border-terminal-text/30 transition-colors",children:[a.jsxs("span",{className:"inline-flex items-center gap-1 px-2",children:[a.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"currentColor",children:a.jsx("path",{d:"M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25z"})}),"Star"]}),l!=null&&a.jsx("span",{className:"inline-flex items-center px-2 h-full border-l border-terminal-border",children:l})]})}function W1(){const l=I1(),{theme:r,toggleTheme:i}=P1(),{prefs:o,updatePref:u,togglePref:m}=R0(),p=l.status==="ready"?l.session:null,x=l.status==="ready"?l.mode:"embedded",f=l.status==="ready"?l.gistOwner:void 0,g=x==="editor",[b,j]=y.useState(vh()),T=y.useRef(null);y.useEffect(()=>{const B=()=>j(vh());return window.addEventListener("popstate",B),()=>window.removeEventListener("popstate",B)},[]);const v=B=>{j(B),lt({v:B==="replay"?null:B})},N=y.useMemo(()=>p?.scenes.some(B=>B.type==="thinking")??!1,[p]),[S,k]=y.useState(!1);y.useEffect(()=>{if(!S)return;const B=F=>{F.key==="Escape"&&k(!1)};return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[S]);const[E,M]=y.useState(!1),A=y.useRef(null);if(y.useEffect(()=>{o.displayMode!=="custom"&&M(!1)},[o.displayMode]),y.useEffect(()=>{if(!E)return;const B=F=>{A.current&&!A.current.contains(F.target)&&M(!1)};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[E]),l.status==="loading")return a.jsx("div",{className:"h-screen bg-terminal-bg flex items-center justify-center",children:a.jsxs("div",{className:"text-center space-y-2",children:[a.jsx("div",{className:"text-terminal-green font-sans font-bold text-sm animate-pulse",children:"LOADING SESSION..."}),a.jsx("div",{className:"text-terminal-dimmer font-mono text-xs",children:"Preparing replay data"})]})});if(l.status==="error")return a.jsx("div",{className:"h-screen bg-terminal-bg flex items-center justify-center",children:a.jsxs("div",{className:"text-center space-y-2",children:[a.jsx("div",{className:"text-terminal-red font-mono text-sm",children:l.message}),a.jsx("div",{className:"text-terminal-dim font-mono text-xs",children:"Use ?gist=<id> or ?url=<replay-json-url> or embed via CLI"})]})});if(l.status==="dashboard")return a.jsxs("div",{className:"h-screen bg-terminal-bg flex flex-col overflow-hidden",children:[a.jsxs("header",{className:"border-b border-terminal-border-subtle px-5 py-2.5 flex items-center justify-between shrink-0 glass-effect z-40 safe-top",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{onClick:()=>lt({view:null,session:null}),className:"text-sm font-sans font-bold bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent hover:opacity-80 transition-opacity",children:"vibe-replay"}),a.jsxs("span",{className:"instant-tooltip inline-flex items-center gap-1.5 text-[10px] font-sans font-bold px-2.5 py-1 rounded-full bg-terminal-green/10 text-terminal-green uppercase tracking-wider border border-terminal-green/20",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green animate-pulse"}),"Local",a.jsx("span",{className:"instant-tooltip-text",children:`Viewer ${window.location.host}
|
|
157
|
-
|
|
158
|
-
Cloud https://vibe-replay.com`})]})
|
|
159
|
-
<style rel="stylesheet" crossorigin>*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--font-sans);font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{scrollbar-width:thin;scrollbar-color:var(--border) var(--bg)}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:var(--bg)}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}.tabular-nums{font-variant-numeric:tabular-nums}.pointer-events-none{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.bottom-0{bottom:0}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-3{left:.75rem}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3{top:.75rem}.top-full{top:100%}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[60\]{z-index:60}.\!m-0{margin:0!important}.mx-0\.5{margin-left:.125rem;margin-right:.125rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-1\.5{margin-top:.375rem;margin-bottom:.375rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-auto{margin-bottom:auto}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.mt-px{margin-top:1px}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[250px\]{height:250px}.h-\[300px\]{height:300px}.h-\[350px\]{height:350px}.h-\[400px\]{height:400px}.h-\[65vh\]{height:65vh}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-28{max-height:7rem}.max-h-32{max-height:8rem}.max-h-40{max-height:10rem}.max-h-48{max-height:12rem}.max-h-60{max-height:15rem}.max-h-72{max-height:18rem}.max-h-\[100px\]{max-height:100px}.max-h-\[120px\]{max-height:120px}.max-h-\[180px\]{max-height:180px}.max-h-\[200px\]{max-height:200px}.max-h-\[300px\]{max-height:300px}.max-h-\[35\%\]{max-height:35%}.max-h-\[4\.5em\]{max-height:4.5em}.max-h-\[400px\]{max-height:400px}.max-h-\[50vh\]{max-height:50vh}.max-h-\[88vh\]{max-height:88vh}.min-h-0{min-height:0px}.min-h-4{min-height:1rem}.min-h-screen{min-height:100vh}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[68px\]{width:68px}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-4{min-width:1rem}.min-w-\[140px\]{min-width:140px}.min-w-\[40px\]{min-width:40px}.max-w-0{max-width:0px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-6xl{max-width:72rem}.max-w-\[120px\]{max-width:120px}.max-w-\[180px\]{max-width:180px}.max-w-\[200px\]{max-width:200px}.max-w-\[300px\]{max-width:300px}.max-w-\[400px\]{max-width:400px}.max-w-\[70\%\]{max-width:70%}.max-w-\[calc\(100vw-2rem\)\]{max-width:calc(100vw - 2rem)}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-\[2\]{flex:2}.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[17px\]{--tw-translate-x: 17px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[3px\]{--tw-translate-x: 3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-px{gap:1px}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-2\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.625rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-3\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.875rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.875rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.self-start{align-self:flex-start}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overscroll-contain{overscroll-behavior:contain}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-b-2xl{border-bottom-right-radius:1rem;border-bottom-left-radius:1rem}.rounded-r-xl{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.rounded-t-sm{border-top-left-radius:.125rem;border-top-right-radius:.125rem}.border{border-width:1px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\[rgba\(168\,85\,247\,0\.2\)\]{border-color:#a855f733}.border-\[rgba\(168\,85\,247\,0\.3\)\]{border-color:#a855f74d}.border-amber-500\/30{border-color:#f59e0b4d}.border-blue-500\/20{border-color:#3b82f633}.border-blue-500\/30{border-color:#3b82f64d}.border-blue-500\/40{border-color:#3b82f666}.border-blue-500\/60{border-color:#3b82f699}.border-cyan-500\/30{border-color:#06b6d44d}.border-gray-500\/30{border-color:#6b72804d}.border-green-500\/15{border-color:#22c55e26}.border-green-500\/30{border-color:#22c55e4d}.border-orange-500\/20{border-color:#f9731633}.border-purple-500\/20{border-color:#a855f733}.border-purple-500\/30{border-color:#a855f74d}.border-terminal-blue{border-color:var(--blue)}.border-terminal-border{border-color:var(--border)}.border-terminal-border-subtle{border-color:var(--border-subtle)}.border-terminal-dim{border-color:var(--dim)}.border-terminal-green{border-color:var(--green)}.border-white\/10{border-color:#ffffff1a}.border-white\/5{border-color:#ffffff0d}.border-l-terminal-blue{border-left-color:var(--blue)}.border-l-terminal-purple{border-left-color:var(--purple)}.\!bg-transparent{background-color:transparent!important}.bg-\[\#24292f\]{--tw-bg-opacity: 1;background-color:rgb(36 41 47 / var(--tw-bg-opacity, 1))}.bg-\[rgba\(168\,85\,247\,0\.1\)\]{background-color:#a855f71a}.bg-amber-500\/20{background-color:#f59e0b33}.bg-black\/30{background-color:#0000004d}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/20{background-color:#3b82f633}.bg-cyan-500\/20{background-color:#06b6d433}.bg-gray-500\/20{background-color:#6b728033}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-500\/20{background-color:#22c55e33}.bg-green-500\/5{background-color:#22c55e0d}.bg-purple-500\/10{background-color:#a855f71a}.bg-purple-500\/20{background-color:#a855f733}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-terminal-bg{background-color:var(--bg)}.bg-terminal-blue{background-color:var(--blue)}.bg-terminal-blue-emphasis{background-color:var(--blue-emphasis)}.bg-terminal-blue-subtle{background-color:var(--blue-subtle)}.bg-terminal-border{background-color:var(--border)}.bg-terminal-border-subtle{background-color:var(--border-subtle)}.bg-terminal-dim{background-color:var(--dim)}.bg-terminal-green{background-color:var(--green)}.bg-terminal-green-emphasis{background-color:var(--green-emphasis)}.bg-terminal-green-subtle{background-color:var(--green-subtle)}.bg-terminal-orange{background-color:var(--orange)}.bg-terminal-orange-subtle{background-color:var(--orange-subtle)}.bg-terminal-purple{background-color:var(--purple)}.bg-terminal-purple-subtle{background-color:var(--purple-subtle)}.bg-terminal-red-subtle{background-color:var(--red-subtle)}.bg-terminal-surface{background-color:var(--surface)}.bg-terminal-surface-2{background-color:var(--surface-2)}.bg-terminal-surface-hover{background-color:var(--surface-hover)}.bg-terminal-surface-inset{background-color:var(--surface-inset)}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-terminal-bg{--tw-gradient-from: var(--bg) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-terminal-green{--tw-gradient-from: var(--green) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-terminal-green-subtle{--tw-gradient-from: var(--green-subtle) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-terminal-surface{--tw-gradient-from: var(--surface) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-transparent{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), transparent var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-white\/5{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(255 255 255 / .05) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-terminal-blue{--tw-gradient-to: var(--blue) var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-px{padding-top:1px;padding-bottom:1px}.pb-1{padding-bottom:.25rem}.pb-10{padding-bottom:2.5rem}.pb-12{padding-bottom:3rem}.pb-2{padding-bottom:.5rem}.pb-24{padding-bottom:6rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pr-7{padding-right:1.75rem}.pr-8{padding-right:2rem}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-12{padding-top:3rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-\[8vh\]{padding-top:8vh}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:var(--font-sans)}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[9px\]{font-size:9px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.normal-case{text-transform:none}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-5{line-height:1.25rem}.leading-\[1\.15\]{line-height:1.15}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.tracking-\[\.25em\]{letter-spacing:.25em}.tracking-\[0\.15em\]{letter-spacing:.15em}.tracking-\[0\.2em\]{letter-spacing:.2em}.tracking-\[0\.3em\]{letter-spacing:.3em}.tracking-normal{letter-spacing:0em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-\[\#c084fc\]{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-400\/80{color:#60a5facc}.text-cyan-300{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-400\/40{color:#c084fc66}.text-purple-400\/60{color:#c084fc99}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-terminal-bg{color:var(--bg)}.text-terminal-blue{color:var(--blue)}.text-terminal-border{color:var(--border)}.text-terminal-dim{color:var(--dim)}.text-terminal-dimmer{color:var(--dimmer)}.text-terminal-green{color:var(--green)}.text-terminal-orange{color:var(--orange)}.text-terminal-purple{color:var(--purple)}.text-terminal-red{color:var(--red)}.text-terminal-text{color:var(--text)}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.placeholder-terminal-dim::-moz-placeholder{color:var(--dim)}.placeholder-terminal-dim::placeholder{color:var(--dim)}.placeholder-terminal-dimmer::-moz-placeholder{color:var(--dimmer)}.placeholder-terminal-dimmer::placeholder{color:var(--dimmer)}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-100{opacity:1}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.shadow-\[0_0_8px_rgba\(251\,146\,60\,0\.5\)\]{--tw-shadow: 0 0 8px rgba(251,146,60,.5);--tw-shadow-colored: 0 0 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-layer-lg{--tw-shadow: var(--shadow-lg);--tw-shadow-colored: var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-layer-md{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-layer-sm{--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-layer-xl{--tw-shadow: var(--shadow-xl);--tw-shadow-colored: var(--shadow-xl);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-terminal-border-subtle{--tw-ring-color: var(--border-subtle)}.ring-transparent{--tw-ring-color: transparent}.blur-2xl{--tw-blur: blur(40px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-75{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-sm{--tw-drop-shadow: drop-shadow(0 1px 1px rgb(0 0 0 / .05));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[left\]{transition-property:left;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-material{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-material-decel,.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}html,body{overflow-x:hidden;max-width:100vw}:root{--font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif}:root,.dark{--bg: #0d1117;--surface: #161b22;--surface-hover: #21262d;--surface-2: #1c2129;--surface-inset: #010409;--border: #30363d;--border-subtle: rgba(48, 54, 61, .5);--text: #c9d1d9;--dim: #8b949e;--dimmer: #7d8590;--green: #3fb950;--green-subtle: rgba(63, 185, 80, .15);--green-emphasis: rgba(63, 185, 80, .25);--blue: #79b8ff;--blue-subtle: rgba(121, 184, 255, .15);--blue-emphasis: rgba(121, 184, 255, .25);--orange: #d29922;--orange-subtle: rgba(210, 153, 34, .15);--orange-emphasis: rgba(210, 153, 34, .25);--red: #f85149;--red-subtle: rgba(248, 81, 73, .15);--red-emphasis: rgba(248, 81, 73, .25);--purple: #b392f0;--purple-subtle: rgba(179, 146, 240, .15);--purple-emphasis: rgba(179, 146, 240, .25);--cyan: #56d4dd;--cyan-subtle: rgba(86, 212, 221, .15);--shadow-color: 215 28% 4%;--shadow-sm: 0 1px 2px hsl(var(--shadow-color) / .5);--shadow-md: 0 1px 2px hsl(var(--shadow-color) / .4), 0 4px 8px hsl(var(--shadow-color) / .3);--shadow-lg: 0 1px 3px hsl(var(--shadow-color) / .4), 0 4px 8px hsl(var(--shadow-color) / .3), 0 12px 24px hsl(var(--shadow-color) / .25);--shadow-xl: 0 2px 4px hsl(var(--shadow-color) / .4), 0 8px 16px hsl(var(--shadow-color) / .3), 0 24px 48px hsl(var(--shadow-color) / .25);--surface-subtle-glass: rgba(13, 17, 23, .7)}.light{--bg: #ffffff;--surface: #f6f8fa;--surface-hover: #e6edf3;--surface-2: #ebeef1;--surface-inset: #f0f2f5;--border: #d0d7de;--border-subtle: rgba(208, 215, 222, .5);--text: #24292f;--dim: #57606a;--dimmer: #697078;--green: #1a7f37;--green-subtle: rgba(26, 127, 55, .1);--green-emphasis: rgba(26, 127, 55, .2);--blue: #0969da;--blue-subtle: rgba(9, 105, 218, .1);--blue-emphasis: rgba(9, 105, 218, .2);--orange: #9a6700;--orange-subtle: rgba(154, 103, 0, .1);--orange-emphasis: rgba(154, 103, 0, .2);--red: #cf222e;--red-subtle: rgba(207, 34, 46, .1);--red-emphasis: rgba(207, 34, 46, .2);--purple: #8250df;--purple-subtle: rgba(130, 80, 223, .1);--purple-emphasis: rgba(130, 80, 223, .2);--cyan: #0e7c86;--cyan-subtle: rgba(14, 124, 134, .1);--shadow-color: 220 10% 50%;--shadow-sm: 0 1px 2px hsl(var(--shadow-color) / .1);--shadow-md: 0 1px 2px hsl(var(--shadow-color) / .08), 0 4px 8px hsl(var(--shadow-color) / .06);--shadow-lg: 0 1px 3px hsl(var(--shadow-color) / .08), 0 4px 8px hsl(var(--shadow-color) / .06), 0 12px 24px hsl(var(--shadow-color) / .05);--shadow-xl: 0 2px 4px hsl(var(--shadow-color) / .08), 0 8px 16px hsl(var(--shadow-color) / .06), 0 24px 48px hsl(var(--shadow-color) / .05);--surface-subtle-glass: rgba(255, 255, 255, .75)}html.theme-transition,html.theme-transition *,html.theme-transition *:before,html.theme-transition *:after{transition:background-color .25s ease,border-color .25s ease,color .25s ease}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}button,[role=button]{-webkit-tap-highlight-color:transparent}:focus:not(:focus-visible){outline:none}:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:4px}@supports (padding: env(safe-area-inset-top)){.safe-top{padding-top:max(env(safe-area-inset-top),1.25rem)}.safe-bottom{padding-bottom:env(safe-area-inset-bottom)}}@keyframes blink{0%,to{opacity:1}50%{opacity:0}}.typing-cursor:after{content:"█";animation:blink 1s step-end infinite;color:var(--green)}@keyframes fade-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.scene-enter{animation:fade-in .3s cubic-bezier(.4,0,.2,1)}@keyframes pulse-border{0%,to{border-color:#d299224d}50%{border-color:#d2992299}}.pause-overlay{animation:pulse-border 2s ease-in-out infinite}@keyframes jump-target-flash{0%{box-shadow:0 0 #3fb95000;outline-color:#3fb95000}30%{box-shadow:0 0 0 3px #3fb95040;outline-color:#3fb95099}to{box-shadow:0 0 #3fb95000;outline-color:#3fb95000}}.jump-target-flash{outline:1px solid transparent;animation:jump-target-flash .85s ease-out}@keyframes nav-focus-pulse{0%,to{transform:translateY(0)}50%{transform:translateY(-1px)}}.scene-nav-focused{animation:nav-focus-pulse .9s ease-in-out 2}@keyframes landing-glow{0%,to{box-shadow:0 0 #3fb95000}50%{box-shadow:0 0 20px 2px #3fb95026}}.landing-pulse{animation:landing-glow 2.5s ease-in-out infinite}.instant-tooltip{position:relative}.instant-tooltip .instant-tooltip-text{visibility:hidden;opacity:0;position:absolute;left:50%;top:100%;transform:translate(-50%);margin-top:6px;padding:4px 8px;border-radius:6px;background:var(--surface);border:1px solid var(--border-subtle);box-shadow:var(--shadow-md);color:var(--text);font:11px / 1.4 var(--font-sans),monospace;text-transform:none;letter-spacing:normal;white-space:pre-line;pointer-events:none;z-index:50;transition:opacity .08s ease}.instant-tooltip:hover .instant-tooltip-text{visibility:visible;opacity:1}.hover-lift{transition:transform .25s cubic-bezier(.175,.885,.32,1.275),box-shadow .25s cubic-bezier(.175,.885,.32,1.275),background-color .2s ease}.hover-lift:hover{transform:translateY(-2px);box-shadow:var(--shadow-lg)}.glass-effect{backdrop-filter:blur(12px) saturate(180%);-webkit-backdrop-filter:blur(12px) saturate(180%);background-color:var(--surface-subtle-glass)}.premium-card{position:relative}.premium-card:before{content:"";position:absolute;inset:0;padding:1px;border-radius:inherit;background:linear-gradient(135deg,var(--green-subtle),var(--blue-subtle));-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none;opacity:.5}@keyframes shimmer{0%{background-position:-1000px 0}to{background-position:1000px 0}}.skeleton{background:linear-gradient(90deg,var(--surface-2) 25%,var(--surface-hover) 50%,var(--surface-2) 75%);background-size:1000px 100%;animation:shimmer 2s infinite linear;border-radius:4px}.bg-dot-grid{background-image:radial-gradient(circle,var(--text) 1px,transparent 1px);background-size:24px 24px;opacity:.03}.minimap-item{transition:background-color .2s cubic-bezier(.4,0,.2,1),border-color .2s cubic-bezier(.4,0,.2,1)}.prose-terminal{line-height:1.6}.prose-terminal p{margin:.5em 0}.prose-terminal code{background:var(--surface);padding:.15em .4em;border-radius:4px;font-size:.9em}.prose-terminal pre{background:var(--surface);padding:.75em 1em;border-radius:6px;overflow-x:auto;margin:.5em 0}.prose-terminal pre code{background:none;padding:0}.prose-terminal ul,.prose-terminal ol{padding-left:1.5em;margin:.5em 0}.prose-terminal li{margin:.25em 0}.prose-terminal h1,.prose-terminal h2,.prose-terminal h3{margin:.75em 0 .5em;font-weight:600}.prose-terminal blockquote{border-left:3px solid var(--border);padding-left:1em;color:var(--dim);margin:.5em 0}.prose-terminal a{color:var(--blue);text-decoration:underline}.prose-terminal table{border-collapse:collapse;margin:.5em 0}.prose-terminal th,.prose-terminal td{border:1px solid var(--border);padding:.4em .8em}.placeholder\:text-terminal-dimmer::-moz-placeholder{color:var(--dimmer)}.placeholder\:text-terminal-dimmer::placeholder{color:var(--dimmer)}.hover\:-translate-y-0\.5:hover{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-\[rgba\(168\,85\,247\,0\.5\)\]:hover{border-color:#a855f780}.hover\:border-terminal-border:hover{border-color:var(--border)}.hover\:border-terminal-green:hover{border-color:var(--green)}.hover\:bg-\[\#32383f\]:hover{--tw-bg-opacity: 1;background-color:rgb(50 56 63 / var(--tw-bg-opacity, 1))}.hover\:bg-\[rgba\(168\,85\,247\,0\.2\)\]:hover{background-color:#a855f733}.hover\:bg-\[rgba\(168\,85\,247\,0\.25\)\]:hover{background-color:#a855f740}.hover\:bg-terminal-blue-emphasis:hover{background-color:var(--blue-emphasis)}.hover\:bg-terminal-blue-subtle:hover{background-color:var(--blue-subtle)}.hover\:bg-terminal-green-emphasis:hover{background-color:var(--green-emphasis)}.hover\:bg-terminal-orange-emphasis:hover{background-color:var(--orange-emphasis)}.hover\:bg-terminal-orange-subtle:hover{background-color:var(--orange-subtle)}.hover\:bg-terminal-purple-emphasis:hover{background-color:var(--purple-emphasis)}.hover\:bg-terminal-purple-subtle:hover{background-color:var(--purple-subtle)}.hover\:bg-terminal-red-emphasis:hover{background-color:var(--red-emphasis)}.hover\:bg-terminal-red-subtle:hover{background-color:var(--red-subtle)}.hover\:bg-terminal-surface:hover{background-color:var(--surface)}.hover\:bg-terminal-surface-2:hover{background-color:var(--surface-2)}.hover\:bg-terminal-surface-hover:hover{background-color:var(--surface-hover)}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-terminal-blue:hover{color:var(--blue)}.hover\:text-terminal-dim:hover{color:var(--dim)}.hover\:text-terminal-green:hover{color:var(--green)}.hover\:text-terminal-orange:hover{color:var(--orange)}.hover\:text-terminal-red:hover{color:var(--red)}.hover\:text-terminal-text:hover{color:var(--text)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:shadow-layer-lg:hover{--tw-shadow: var(--shadow-lg);--tw-shadow-colored: var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-layer-md:hover{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:focus-within .group-focus-within\:opacity-100{opacity:1}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:-translate-y-0\.5{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:rotate-3{--tw-rotate: 3deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group\/help:hover .group-hover\/help\:border-terminal-text{border-color:var(--text)}.group\/help:hover .group-hover\/help\:bg-terminal-text{background-color:var(--text)}.group\/help:hover .group-hover\/help\:text-terminal-bg{color:var(--bg)}.group\/ref:hover .group-hover\/ref\:text-terminal-text{color:var(--text)}.group\/search:hover .group-hover\/search\:text-terminal-blue{color:var(--blue)}.group:hover .group-hover\:text-terminal-green{color:var(--green)}.group:hover .group-hover\:text-terminal-text{color:var(--text)}.group\/batch:hover .group-hover\/batch\:opacity-100,.group\/help:hover .group-hover\/help\:opacity-100,.group\/pause:hover .group-hover\/pause\:opacity-100,.group\/scene:hover .group-hover\/scene\:opacity-100,.group\/search:hover .group-hover\/search\:opacity-100{opacity:1}.group\/search:hover .group-hover\/search\:opacity-80{opacity:.8}.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-60{opacity:.6}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-red-900\/30:is(.dark *){background-color:#7f1d1d4d}@media(min-width:640px){.sm\:mx-0{margin-left:0;margin-right:0}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:gap-3{gap:.75rem}.sm\:rounded-xl{border-radius:.75rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:py-3{padding-top:.75rem;padding-bottom:.75rem}.sm\:pt-\[15vh\]{padding-top:15vh}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-\[10px\]{font-size:10px}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media(min-width:768px){.md\:ml-12{margin-left:3rem}.md\:mt-10{margin-top:2.5rem}.md\:block{display:block}.md\:inline{display:inline}.md\:flex{display:flex}.md\:hidden{display:none}.md\:min-h-0{min-height:0px}.md\:max-w-\[300px\]{max-width:300px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:gap-2{gap:.5rem}.md\:gap-3{gap:.75rem}.md\:space-y-7>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.75rem * var(--tw-space-y-reverse))}.md\:p-8{padding:2rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:py-3{padding-top:.75rem;padding-bottom:.75rem}.md\:pt-0{padding-top:0}.md\:text-5xl{font-size:3rem;line-height:1}}@media(min-width:1024px){.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:inline{display:inline}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&\>svg\]\:block>svg{display:block}.\[\&\>svg\]\:h-auto>svg{height:auto}.\[\&\>svg\]\:w-full>svg{width:100%}</style>
|
|
147
|
+
*/const g1=l=>{const r=new MutationObserver(l);return r.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},b1=()=>document.documentElement.classList.contains("dark");function y1(l,r){if(!l&&r)return r.split(`
|
|
148
|
+
`).map(u=>({type:"add",content:u}));const i=uv(l,r),o=[];for(const u of i){const m=u.value.replace(/\n$/,"").split(`
|
|
149
|
+
`),p=u.added?"add":u.removed?"remove":"context";for(const g of m)o.push({type:p,content:g})}return o}function v1(l){const r=l.split(".").pop()?.toLowerCase()||"";return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",rs:"rust",go:"go",rb:"ruby",java:"java",css:"css",html:"html",json:"json",md:"markdown",yaml:"yaml",yml:"yaml",toml:"toml",sh:"bash",zsh:"bash",bash:"bash"}[r]||"text"}const j1=y.memo(function({toolName:r,filePath:i,oldContent:o,newContent:u,isActive:m}){const p=y.useMemo(()=>y1(o,u),[o,u]),g=v1(i),f=y.useSyncExternalStore(g1,b1),x=!o,h=r==="Delete"&&!u;return n.jsxs("div",{className:"bg-terminal-surface rounded-xl overflow-hidden shadow-layer-sm",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-terminal-surface",children:[n.jsx("span",{className:"text-xs font-mono font-bold text-terminal-orange",children:r}),n.jsx("span",{className:"text-xs font-mono text-terminal-blue truncate",children:i}),x&&n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-terminal-green/20 text-terminal-green",children:"new"}),h&&n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-terminal-red/20 text-terminal-red",children:"deleted"})]}),n.jsx("div",{className:"overflow-x-auto max-h-[400px] overflow-y-auto",children:n.jsx(x1,{theme:f?ku.nightOwl:ku.nightOwlLight,code:p.map(v=>v.content).join(`
|
|
150
|
+
`),language:g,children:({tokens:v,getLineProps:C,getTokenProps:j})=>n.jsx("pre",{className:"text-xs font-mono !bg-transparent !m-0 p-0",children:v.map((w,S)=>{const k=p[S];if(!k)return null;const E=k.type==="add"?"bg-green-100 dark:bg-green-900/30":k.type==="remove"?"bg-red-100 dark:bg-red-900/30":"",M=k.type==="add"?"+":k.type==="remove"?"-":" ",A=k.type==="add"?"text-terminal-green":k.type==="remove"?"text-terminal-red":"text-terminal-dim";return n.jsxs("div",{...C({line:w}),className:`flex ${E} px-3 leading-5`,children:[n.jsx("span",{className:`select-none w-4 shrink-0 ${A}`,children:M}),n.jsx("span",{children:w.map((R,O)=>n.jsx("span",{...j({token:R})},O))})]},S)})})})})]})});function lu({ms:l}){if(!l)return null;const r=vt(l);return r?n.jsx("span",{className:"text-[10px] text-terminal-dimmer font-mono shrink-0",title:`Tool execution: ${r}`,children:r}):null}function su(l){if(l.startsWith("mcp__"))return"🔌";switch(l){case"Read":return"📄";case"Write":return"✏️";case"Edit":return"✂️";case"Delete":return"🗑️";case"Bash":return"$";case"Glob":return"🔍";case"Grep":return"🔎";case"Agent":return"🤖";default:return"⚙️"}}const w1={Explore:"bg-blue-500/20 text-blue-300 border-blue-500/30",Plan:"bg-purple-500/20 text-purple-300 border-purple-500/30",Shell:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30","general-purpose":"bg-green-500/20 text-green-300 border-green-500/30","claude-code-guide":"bg-amber-500/20 text-amber-300 border-amber-500/30"};function Cu({type:l}){const r=w1[l]||"bg-gray-500/20 text-gray-300 border-gray-500/30";return n.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded border font-mono ${r}`,children:l})}function N1({subAgent:l}){const[r,i]=y.useState(!1),o=l.tokenUsage?l.tokenUsage.inputTokens+l.tokenUsage.outputTokens+l.tokenUsage.cacheCreationTokens+l.tokenUsage.cacheReadTokens:0;return n.jsxs("div",{className:"border-t border-terminal-border-subtle",children:[n.jsxs("div",{className:"px-3 py-2 bg-terminal-surface-hover/50",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx(Cu,{type:l.agentType}),l.model&&n.jsx("span",{className:"text-[10px] text-terminal-dim font-mono",children:l.model}),n.jsx("span",{className:"text-[10px] text-terminal-dim",children:"|"}),n.jsxs("span",{className:"text-[10px] text-terminal-dim font-mono",children:[l.toolCalls," tools"]}),l.thinkingBlocks>0&&n.jsxs("span",{className:"text-[10px] text-terminal-dim font-mono",children:[l.thinkingBlocks," thinking"]}),l.textResponses>0&&n.jsxs("span",{className:"text-[10px] text-terminal-dim font-mono",children:[l.textResponses," responses"]}),o>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-[10px] text-terminal-dim",children:"|"}),n.jsxs("span",{className:"text-[10px] text-terminal-dim font-mono",children:[o>1e6?`${(o/1e6).toFixed(1)}M`:o>1e3?`${(o/1e3).toFixed(0)}K`:o," ","tokens"]})]})]}),l.description&&n.jsx("div",{className:"text-[11px] text-terminal-text/70 mt-1 italic",children:l.description})]}),l.scenes.length>0&&n.jsxs("div",{className:"border-t border-terminal-border-subtle",children:[n.jsxs("button",{onClick:()=>i(!r),className:"w-full px-3 py-1.5 text-left text-[11px] text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:[n.jsx("span",{className:`inline-block transition-transform mr-1 ${r?"rotate-90":""}`,children:"▶"}),r?"Hide":"Show"," agent conversation (",l.scenes.length," scenes)"]}),r&&n.jsx("div",{className:"px-3 pb-2 space-y-1 max-h-[400px] overflow-y-auto",children:l.scenes.map((u,m)=>n.jsx(S1,{scene:u},m))})]})]})}function S1({scene:l}){const[r,i]=y.useState(!1);if(l.type==="thinking")return n.jsxs("div",{className:"text-[10px] font-mono text-purple-400/60 pl-2 border-l-2 border-purple-500/20 py-0.5",children:[n.jsx("span",{className:"text-purple-400/40 mr-1",children:"[thinking]"}),(l.content||"").slice(0,120),(l.content||"").length>120?"...":""]});if(l.type==="text-response")return n.jsxs("div",{className:"text-[10px] font-mono text-terminal-text/80 pl-2 border-l-2 border-blue-500/20 py-0.5",children:[(l.content||"").slice(0,200),(l.content||"").length>200?"...":""]});if(l.type==="tool-call"){const o=l;return n.jsxs("div",{className:"pl-2 border-l-2 border-orange-500/20 py-0.5",children:[n.jsxs("button",{onClick:()=>i(!r),className:"flex items-center gap-1 text-[10px] font-mono w-full text-left hover:bg-terminal-surface-hover/30 rounded px-1",children:[n.jsx("span",{className:"text-terminal-orange font-bold",children:wi(o.toolName)}),n.jsx("span",{className:"text-terminal-dim truncate flex-1",children:Tu(o.toolName,o.input)}),o.isError&&n.jsx("span",{className:"text-red-400 text-[9px]",children:"ERR"})]}),r&&o.result&&n.jsx("pre",{className:"text-[9px] text-terminal-dim font-mono whitespace-pre-wrap break-words max-h-[100px] overflow-y-auto mt-0.5 px-1 bg-terminal-bg/50 rounded",children:o.result.slice(0,500)})]})}return null}const k1=y.memo(function({scene:r,isActive:i,forceCollapse:o}){const[u,m]=y.useState(!1);return o?n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 text-xs font-mono text-terminal-dim",children:[n.jsx("span",{children:su(r.toolName)}),n.jsx("span",{className:"text-terminal-orange font-bold",children:wi(r.toolName)}),n.jsx("span",{className:"truncate",children:Tu(r.toolName,r.input)}),r.subAgent&&n.jsx(Cu,{type:r.subAgent.agentType}),n.jsx(lu,{ms:r.durationMs})]}):r.bashOutput?n.jsx(rv,{command:r.bashOutput.command,stdout:r.bashOutput.stdout,isActive:i,durationMs:r.durationMs}):r.diff?n.jsx(j1,{toolName:r.toolName,filePath:r.diff.filePath,oldContent:r.diff.oldContent,newContent:r.diff.newContent,isActive:i}):r.toolName==="Agent"&&r.subAgent?n.jsx("div",{children:n.jsxs("div",{className:"bg-terminal-surface rounded-xl overflow-hidden shadow-layer-sm",children:[n.jsxs("button",{onClick:()=>m(!u),className:"w-full flex items-center gap-2 px-3 py-2 bg-terminal-surface hover:bg-terminal-surface-hover transition-colors duration-200 ease-material text-left",children:[n.jsx("span",{className:"text-xs font-mono",children:su("Agent")}),n.jsx("span",{className:"text-xs font-mono font-bold text-terminal-orange",children:"Agent"}),n.jsx(Cu,{type:r.subAgent.agentType}),n.jsx("span",{className:"text-xs text-terminal-dim font-mono truncate flex-1",children:r.subAgent.description||r.input.description||""}),n.jsxs("span",{className:"text-[10px] text-terminal-dim font-mono",children:[r.subAgent.toolCalls," tools"]}),n.jsx(lu,{ms:r.durationMs}),n.jsx("span",{className:`text-xs text-terminal-dim transition-transform ${u?"rotate-90":""}`,children:"▶"})]}),u&&n.jsx(N1,{subAgent:r.subAgent})]})}):n.jsx("div",{children:n.jsxs("div",{className:"bg-terminal-surface rounded-xl overflow-hidden shadow-layer-sm",children:[n.jsxs("button",{onClick:()=>m(!u),className:"w-full flex items-center gap-2 px-3 py-2 bg-terminal-surface hover:bg-terminal-surface-hover transition-colors duration-200 ease-material text-left",children:[n.jsx("span",{className:"text-xs font-mono",children:su(r.toolName)}),n.jsx("span",{className:"text-xs font-mono font-bold text-terminal-orange",children:wi(r.toolName)}),n.jsx("span",{className:"text-xs text-terminal-dim font-mono truncate flex-1",children:Tu(r.toolName,r.input)}),n.jsx(lu,{ms:r.durationMs}),n.jsx("span",{className:`text-xs text-terminal-dim transition-transform ${u?"rotate-90":""}`,children:"▶"})]}),u&&n.jsxs("div",{className:"border-t border-terminal-border-subtle",children:[n.jsxs("div",{className:"px-3 py-2",children:[n.jsx("div",{className:"text-xs text-terminal-dim font-mono mb-1",children:"Input:"}),n.jsx("pre",{className:"text-xs text-terminal-text font-mono whitespace-pre-wrap break-words max-h-[200px] overflow-y-auto",children:JSON.stringify(r.input,null,2)})]}),r.result&&n.jsxs("div",{className:"px-3 py-2 border-t border-terminal-border-subtle",children:[n.jsx("div",{className:"text-xs text-terminal-dim font-mono mb-1",children:"Result:"}),n.jsx("pre",{className:"text-xs text-terminal-text font-mono whitespace-pre-wrap break-words max-h-[200px] overflow-y-auto",children:r.result})]}),r.images&&r.images.length>0&&n.jsx("div",{className:"px-3 py-2 border-t border-terminal-border-subtle",children:n.jsx("div",{className:"flex gap-2 flex-wrap",children:r.images.map((p,g)=>n.jsx("img",{src:p,alt:`Screenshot ${g+1}`,className:"max-w-[400px] max-h-[300px] rounded-md object-contain"},g))})})]})]})})});function Tu(l,r){switch(l){case"Read":return r.file_path||"";case"Glob":return r.pattern||"";case"Grep":return`/${r.pattern||""}/ ${r.path||""}`;case"Agent":return r.description||"";case"Write":return r.file_path||"";case"Edit":return r.file_path||"";case"WebSearch":return r.query||"";case"WebFetch":return r.url||"";default:return Object.values(r).filter(i=>typeof i=="string").join(" ").slice(0,80)}}const C1={lines:8,chars:900},T1={lines:4,chars:280};function E1(){return typeof window<"u"&&window.innerWidth<768?T1:C1}const A1=y.memo(function({content:r,images:i,isActive:o}){const[u,m]=y.useState(!1),[p]=y.useState(E1);y.useEffect(()=>{const h=v=>{if(!o)return;const C=v.detail;C.action==="expand"?m(!0):C.action==="collapse"&&m(!1)};return window.addEventListener("vibe:toggle-expand",h),()=>window.removeEventListener("vibe:toggle-expand",h)},[o]);const g=y.useMemo(()=>r.split(`
|
|
151
|
+
`),[r]),f=g.length>p.lines||r.length>p.chars,x=y.useMemo(()=>{if(!f||u)return r;const h=g.slice(0,p.lines).join(`
|
|
152
|
+
`);return h.length>p.chars?h.slice(0,p.chars):h},[r,u,f,g,p]);return n.jsxs("div",{children:[n.jsxs("div",{className:`text-terminal-green font-mono text-sm whitespace-pre-wrap break-words ${o?"typing-cursor":""}`,children:[x,f&&!u&&n.jsx("span",{className:"text-terminal-dim",children:`
|
|
153
|
+
...`})]}),f&&n.jsxs("button",{onClick:()=>m(h=>!h),className:"mt-1 text-xs font-mono text-terminal-dim hover:text-terminal-green transition-colors duration-200 ease-material flex items-center gap-1.5",children:[o&&n.jsx("span",{className:"text-secondary-text font-bold opacity-70",children:u?"[←]":"[→]"}),n.jsx("span",{children:u?"Show less":`Show more (${g.length} lines)`})]}),i&&i.length>0&&n.jsx("div",{className:"flex gap-2 mt-2 flex-wrap",children:i.map((h,v)=>n.jsx("img",{src:h,alt:`Attachment ${v+1}`,className:"max-w-[300px] max-h-[200px] rounded-md object-contain"},v))})]})});function Qs(l){if(!l)return"";try{return new Date(l).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return""}}function R1({scenes:l,visibleCount:r,currentIndex:i,effectivePrefs:o,focusIndex:u,annotatedScenes:m,annotationCounts:p,onComment:g,onSeek:f,state:x,overlayActions:h,turnStats:v}){const C=y.useMemo(()=>{const k=[];let E=null,M=0;for(let A=0;A<l.length;A++){const R=l[A];if(R.type==="user-prompt"||R.type==="compaction-summary"||R.type==="context-injection"){E&&E.scenes.length>0&&k.push(E);const O=R.type==="compaction-summary"?"compaction":R.type==="context-injection"?"context-injection":"user";O==="user"&&M++,k.push({type:O,timestamp:R.timestamp,scenes:[{scene:R,index:A}],turnNumber:O==="user"?M:void 0}),E=null}else(!E||E.type!=="assistant")&&(E&&E.scenes.length>0&&k.push(E),E={type:"assistant",timestamp:R.timestamp,scenes:[],turnNumber:M>0?M:void 0}),E.scenes.push({scene:R,index:A})}return E&&E.scenes.length>0&&k.push(E),k},[l]),j=y.useMemo(()=>o.promptsOnly?C.filter(k=>(k.type==="user"||k.type==="compaction")&&k.scenes[0].index<r):C.filter(k=>k.scenes[0].index<r),[C,r,o.promptsOnly]),w=y.useMemo(()=>{for(let k=j.length-1;k>=0;k--)if(j[k].scenes.some(E=>E.index<=i))return k;return j.length-1},[j,i]),S=y.useMemo(()=>{const k=new Map;for(let E=1;E<j.length;E++){const M=j[E];if(M.type!=="user")continue;let A;for(let O=E-1;O>=0;O--){const $=j[O],H=$.scenes[$.scenes.length-1];if(H?.scene.timestamp){A=H.scene.timestamp;break}if($.timestamp){A=$.timestamp;break}}if(!A||!M.timestamp)continue;const R=new Date(M.timestamp).getTime()-new Date(A).getTime();R>12e4&&k.set(E,R)}return k},[j]);return n.jsxs("div",{className:"max-w-4xl mx-auto space-y-5 pb-6",children:[j.map((k,E)=>n.jsxs(D1,{forceRender:E>=w-15&&E<=w+5,children:[S.has(E)&&n.jsx(M1,{gapMs:S.get(E)}),n.jsx(_1,{group:k,currentIndex:i,visibleCount:r,effectivePrefs:o,focusIndex:u,annotatedScenes:m,annotationCounts:p,onComment:g,overlayActions:h,turnStats:v})]},E)),x==="paused"&&r<l.length&&n.jsx("div",{className:"pt-4 pb-12 flex items-center justify-center animate-in fade-in slide-in-from-bottom-2 duration-700 ease-out select-none",children:n.jsxs("div",{className:"group/pause relative flex items-center gap-8 px-4 py-2 bg-transparent backdrop-blur-sm",children:[n.jsx("div",{className:"absolute inset-0 bg-terminal-orange/5 opacity-0 group-hover/pause:opacity-100 transition-opacity duration-700 blur-2xl -z-10"}),n.jsxs("div",{className:"flex items-center gap-2.5 pr-8 border-r border-terminal-border/20",children:[n.jsxs("div",{className:"relative flex h-2 w-2",children:[n.jsx("div",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-orange opacity-40"}),n.jsx("div",{className:"relative inline-flex rounded-full h-2 w-2 bg-terminal-orange/80 shadow-[0_0_8px_rgba(251,146,60,0.5)]"})]}),n.jsx("span",{className:"text-[10px] font-sans font-black text-terminal-orange uppercase tracking-[.25em] drop-shadow-sm",children:"Paused"})]}),n.jsxs("div",{className:"flex items-center gap-8",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded bg-terminal-surface-hover/80 border border-terminal-border-subtle/50 text-terminal-text shadow-sm",children:n.jsx("span",{className:"text-[11px] font-mono font-bold",children:"↓"})}),n.jsx("span",{className:"text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest opacity-80",children:"Explore"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded bg-terminal-surface-hover/80 border border-terminal-border-subtle/50 text-terminal-text shadow-sm",children:n.jsx("span",{className:"text-[9px] font-mono font-black tracking-tight",children:"SPACE"})}),n.jsx("span",{className:"text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest opacity-80",children:"Resume"})]})]})]})}),r>=l.length&&n.jsxs("div",{className:"pt-12 pb-24 flex flex-col items-center justify-center animate-in fade-in zoom-in-95 duration-1000 ease-out select-none",children:[n.jsx("div",{className:"h-px w-8 bg-terminal-border-subtle mb-6"}),n.jsxs("div",{className:"flex flex-col items-center gap-1",children:[n.jsx("div",{className:"text-[10px] font-mono font-bold text-terminal-dimmer uppercase tracking-[0.3em]",children:"the end"}),n.jsx("div",{className:"text-[9px] font-mono text-terminal-border uppercase tracking-widest mt-1",children:"session replay complete"})]}),n.jsxs("div",{className:"mt-8 flex flex-col items-center gap-6",children:[n.jsxs("button",{onClick:()=>f?.(0),className:"group flex items-center gap-2.5 px-3.5 py-1.5 rounded-full bg-terminal-surface/30 border border-terminal-border-subtle text-terminal-dimmer hover:text-terminal-green hover:border-terminal-green/30 hover:bg-terminal-green/5 transition-all duration-300",children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-transform duration-300 group-hover:-translate-y-0.5",children:n.jsx("path",{d:"m18 15-6-6-6 6"})}),n.jsx("span",{className:"text-[10px] font-mono font-bold uppercase tracking-widest transition-colors",children:"Back to Top"}),n.jsxs("span",{className:"text-[9px] font-mono font-bold opacity-0 group-hover:opacity-60 transition-opacity",children:[" ","[Home]"]})]}),n.jsxs("div",{className:"flex items-center gap-3 opacity-20",children:[n.jsx("div",{className:"w-1 h-1 rounded-full bg-terminal-green"}),n.jsx("div",{className:"w-1 h-1 rounded-full bg-terminal-blue"}),n.jsx("div",{className:"w-1 h-1 rounded-full bg-terminal-orange"})]})]})]})]})}function M1({gapMs:l}){const r=l>=36e5?`${Math.floor(l/36e5)}h ${Math.floor(l%36e5/6e4)}m later`:`${Math.floor(l/6e4)}m later`;return n.jsxs("div",{className:"flex items-center gap-3 py-1 px-4",children:[n.jsx("div",{className:"flex-1 h-px bg-terminal-border-subtle"}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer whitespace-nowrap",children:r}),n.jsx("div",{className:"flex-1 h-px bg-terminal-border-subtle"})]})}const D1=y.memo(function({children:r,forceRender:i}){const o=y.useRef(null),[u,m]=y.useState(!1),p=y.useRef(0);y.useEffect(()=>{const f=o.current;if(!f)return;const x=new IntersectionObserver(([h])=>{m(h.isIntersecting),h.isIntersecting&&f.offsetHeight>0&&(p.current=f.offsetHeight)},{rootMargin:"800px 0px"});return x.observe(f),()=>x.disconnect()},[]);const g=u||i;return y.useEffect(()=>{g&&o.current&&o.current.offsetHeight>0&&(p.current=o.current.offsetHeight)}),n.jsx("div",{ref:o,style:!g&&p.current>0?{minHeight:p.current}:void 0,children:g?r:null})}),_1=y.memo(function({group:r,currentIndex:i,visibleCount:o,effectivePrefs:u,focusIndex:m,annotatedScenes:p,annotationCounts:g,onComment:f,overlayActions:x,turnStats:h}){const[v,C]=y.useState(!1),j=y.useMemo(()=>r.scenes.filter(O=>O.index<o),[r.scenes,o]),w=j.some(({index:O})=>O===i),S=typeof m=="number"&&j.some(({index:O})=>O===m),k=j[0]?.index;if(j.length===0)return null;const E=r.type==="user"&&g?.get(k)||0,M=r.type==="user"&&f&&(E>0||v)?n.jsxs("button",{onClick:O=>{O.stopPropagation(),f(k)},className:`absolute right-0 top-3 z-10 flex items-center gap-1 px-1.5 py-1 rounded-md text-xs font-mono transition-all duration-150 ${E>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover:opacity-100"}`,title:E>0?`${E} comment${E>1?"s":""}`:"Add comment",children:["💬",E>0&&n.jsx("span",{children:E})]}):null;if(r.type==="user")return n.jsxs("div",{id:`scene-${k}`,"data-scene-index":k,className:`group relative rounded-2xl px-5 py-4 transition-all duration-200 ease-material ml-4 md:ml-12 border ${S?"scene-nav-focused bg-terminal-green-emphasis border-terminal-green shadow-layer-lg":w?"bg-terminal-green-subtle border-terminal-green/30 shadow-layer-sm":"bg-terminal-surface border-terminal-border-subtle shadow-sm"}`,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:[M,n.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-green uppercase tracking-widest",children:"You"}),r.timestamp&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:Qs(r.timestamp)}),n.jsx("div",{className:"flex-1"}),S?n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-green text-terminal-bg",children:"Jump Target"}):w&&n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-green-subtle text-terminal-green border border-terminal-green/20",children:"Focused"}),r.turnNumber!==void 0&&n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer font-bold",children:["#",String(r.turnNumber).padStart(2,"0")]})]}),n.jsx("div",{className:"text-left",children:j.map(({scene:O,index:$})=>{const H=x?.getOverlays($)??[],K=x?.getEffectiveContent($),ae=x?.showOriginal.has($);return n.jsxs("div",{className:"scene-enter",children:[n.jsx(_i,{scene:O,isActive:$===i,collapseTools:u.collapseAllTools,effectiveContent:K??void 0}),H.length>0&&n.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[H.map(ue=>n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple",children:ue.source.type==="translate"?"Translated":ue.source.type==="tone"?"Softened":"Modified"},ue.id)),n.jsx("button",{onClick:()=>x?.toggleOriginal($),className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:ae?"Show modified":"Show original"}),n.jsx("button",{onClick:()=>x?.revertSceneOverlays($),className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-red transition-colors",children:"Revert"})]})]},$)})})]});if(r.type==="compaction"){const O=j[0]?.scene;return!O||O.type!=="compaction-summary"?null:n.jsxs("div",{id:`scene-${k}`,"data-scene-index":k,className:`group relative rounded-xl px-5 py-3.5 transition-all duration-200 ease-material ${S?"scene-nav-focused bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm":w?"bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm":"bg-terminal-surface/50"}`,children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-dim uppercase tracking-widest",children:"Context Compaction"}),r.timestamp&&n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer",children:Qs(r.timestamp)})]}),n.jsx(Ni,{content:O.content,isActive:k===i})]})}if(r.type==="context-injection"){const O=j[0]?.scene;if(!O||O.type!=="context-injection")return null;const $=O.injectionType||"system",H=$.startsWith("skill:")?`Skill: ${$.slice(6)}`:$.startsWith("command:")?`Command: ${$.slice(8)}`:$==="image"?"Image Injection":$==="local-command"?"Local Command":"System Context";return n.jsxs("div",{id:`scene-${k}`,"data-scene-index":k,className:`group relative rounded-xl px-5 py-3.5 transition-all duration-200 ease-material ${S?"scene-nav-focused bg-terminal-surface border-l-2 border-blue-500/60 shadow-layer-sm":w?"bg-terminal-surface border-l-2 border-blue-500/40 shadow-layer-sm":"bg-terminal-surface/50"}`,children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-blue-400/80 uppercase tracking-widest",children:H}),r.timestamp&&n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer",children:Qs(r.timestamp)})]}),n.jsx(Ni,{content:O.content,isActive:k===i})]})}const A=u.hideThinking?j.filter(O=>O.scene.type!=="thinking"):j;if(A.length===0)return null;const R=u.hideThinking?r.scenes.filter(O=>O.scene.type!=="thinking"):r.scenes;return u.compactAssistant?n.jsx(O1,{allScenes:R,filteredScenes:A,firstIndex:k,currentIndex:i,groupHasCurrent:w,groupHasFocusedTarget:S,timestamp:r.timestamp,annotationCounts:g,onComment:f,overlayActions:x,turnDurationMs:r.turnNumber?h?.[r.turnNumber-1]?.durationMs:void 0}):n.jsxs("div",{id:`scene-${k}`,"data-scene-index":k,className:`relative rounded-xl px-5 py-4 transition-all duration-200 ease-material ${S?"scene-nav-focused bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-lg":w?"bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-sm":"bg-terminal-surface shadow-layer-sm"}`,children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-blue uppercase tracking-widest",children:"Assistant"}),r.timestamp&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:Qs(r.timestamp)}),n.jsx("div",{className:"flex-1"}),S?n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-emphasis text-terminal-blue",children:"Jump Target"}):w&&n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue",children:"Focused"}),r.turnNumber!==void 0&&n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer font-bold",children:["#",String(r.turnNumber).padStart(2,"0")]})]}),n.jsx("div",{className:"space-y-2",children:n.jsx(L1,{scenes:A,currentIndex:i,collapseTools:u.collapseAllTools,annotationCounts:g,onComment:f,overlayActions:x})})]})});function O1({allScenes:l,filteredScenes:r,firstIndex:i,currentIndex:o,groupHasCurrent:u,groupHasFocusedTarget:m,timestamp:p,annotationCounts:g,onComment:f,overlayActions:x,turnDurationMs:h}){const[v,C]=y.useState(!1);y.useEffect(()=>{const A=R=>{if(!u)return;const O=R.detail;O.action==="expand"?C(!0):O.action==="collapse"&&C(!1)};return window.addEventListener("vibe:toggle-expand",A),()=>window.removeEventListener("vibe:toggle-expand",A)},[u]);const j=y.useMemo(()=>{const A={},R=new Set;let O=0,$=0,H=0,K=0;const ae=[];for(const{scene:xe}of l)if(xe.type==="tool-call"){H++,xe.toolName==="Agent"&&xe.subAgent&&(K++,ae.includes(xe.subAgent.agentType)||ae.push(xe.subAgent.agentType));const de=wi(xe.toolName);if(A[de]=(A[de]||0)+1,xe.toolName==="Bash"&&xe.input?.command){const pe=xe.input.command.trim().split(/[\s|;&]/)[0];pe&&R.add(pe)}}else xe.type==="text-response"?O++:xe.type==="thinking"&&$++;let ue;const oe=l[0]?.scene.timestamp,te=l[l.length-1]?.scene.timestamp;if(oe&&te){const xe=Date.parse(te)-Date.parse(oe);xe>0&&(ue=xe)}return{totalTools:H,toolBreakdown:A,responses:O,thinking:$,bashCommands:[...R],subAgentCalls:K,subAgentTypes:ae,turnDurationMs:ue}},[l]),w=y.useMemo(()=>{for(let A=l.length-1;A>=0;A--)if(l[A].scene.type==="text-response")return l[A];return null},[l]),S=y.useMemo(()=>{const A=["Read","Write","Edit","Bash","Glob","Grep","Agent"],R=Object.entries(j.toolBreakdown);return R.sort((O,$)=>{const H=A.indexOf(O[0]),K=A.indexOf($[0]),ae=H>=0?H:100,ue=K>=0?K:100;return ae-ue}),R},[j.toolBreakdown]),k=y.useMemo(()=>g?l.reduce((A,{index:R})=>A+(g.get(R)||0),0):0,[l,g]),[E,M]=y.useState(!1);return n.jsxs("div",{id:`scene-${i}`,"data-scene-index":i,className:`group relative rounded-xl px-5 py-4 transition-all duration-200 ease-material ${m?"scene-nav-focused bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-lg":u?"bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-sm":"bg-terminal-surface shadow-layer-sm"}`,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:[f&&(k>0||E)&&!v&&n.jsxs("button",{onClick:A=>{A.stopPropagation(),f(i)},className:`absolute right-3 top-3 z-10 flex items-center gap-1 px-1.5 py-1 rounded-md text-xs font-mono transition-all duration-150 ${k>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover:opacity-100"}`,title:k>0?`${k} comment${k>1?"s":""}`:"Add comment",children:["💬",k>0&&n.jsx("span",{children:k})]}),n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-blue uppercase tracking-widest",children:"Assistant"}),p&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:Qs(p)}),(h||j.turnDurationMs)&&n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:["· ",vt(h??j.turnDurationMs)]}),n.jsx("div",{className:"flex-1"}),m?n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-emphasis text-terminal-blue",children:"Jump Target"}):u&&n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue",children:"Focused"})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mb-3 text-[11px] font-mono",children:[j.responses>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue",children:[j.responses," response",j.responses>1?"s":""]}),j.totalTools>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange",children:[j.totalTools," tool",j.totalTools>1?"s":""]}),j.subAgentCalls>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-500/20 text-green-300",children:[j.subAgentCalls," agent",j.subAgentCalls>1?"s":"",j.subAgentTypes.length>0&&n.jsxs("span",{className:"opacity-70 text-[10px]",children:["(",j.subAgentTypes.join(", "),")"]})]}),j.thinking>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-purple-subtle text-terminal-purple",children:[j.thinking," thinking"]}),S.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-terminal-border mx-0.5",children:"|"}),S.map(([A,R])=>n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-terminal-surface-hover text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-orange",children:A}),A==="Bash"&&j.bashCommands.length>0&&n.jsxs("span",{className:"text-terminal-dimmer",children:["(",j.bashCommands.slice(0,4).join(", "),j.bashCommands.length>4?", ...":"",")"]}),n.jsx("span",{children:R})]},A))]})]}),w&&!v&&n.jsx("div",{className:"mb-2",children:n.jsx(px,{content:x?.getEffectiveContent(w.index)??w.scene.content,isActive:w.index===o})}),v&&n.jsx("div",{className:"space-y-2 mb-2",children:r.map(({scene:A,index:R})=>{const O=g?.get(R)||0,$=A.type==="text-response"?x?.getEffectiveContent(R)??void 0:void 0;return n.jsxs("div",{"data-scene-index":R,className:`group/scene relative scene-enter ${f?"pr-7":""}`,children:[n.jsx(_i,{scene:A,isActive:R===o,collapseTools:!1,effectiveContent:$}),f&&n.jsxs("button",{onClick:H=>{H.stopPropagation(),f(R)},className:`absolute right-0 top-1 z-10 flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-xs font-mono transition-all duration-150 ${O>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover/scene:opacity-100"}`,title:O>0?`${O} comment${O>1?"s":""}`:"Add comment",children:["💬",O>0&&n.jsx("span",{children:O})]})]},R)})}),n.jsxs("button",{onClick:()=>C(!v),className:"text-xs font-mono text-terminal-dim hover:text-terminal-blue transition-colors flex items-center gap-1.5",children:[u&&n.jsx("span",{className:"text-secondary-text font-bold opacity-70",children:v?"[←]":"[→]"}),n.jsx("span",{children:v?"Collapse":"Show all details"})]})]})}function L1({scenes:l,currentIndex:r,collapseTools:i,annotationCounts:o,onComment:u,overlayActions:m}){const p=[];let g=[];for(const f of l){const x=g[g.length-1];x&&x.scene.type==="tool-call"&&f.scene.type==="tool-call"&&x.scene.toolName===f.scene.toolName&&!f.scene.diff&&!f.scene.bashOutput&&!x.scene.diff&&!x.scene.bashOutput?g.push(f):(g.length>0&&p.push(g),g=[f])}return g.length>0&&p.push(g),n.jsx(n.Fragment,{children:p.map(f=>{if(f.length<=1){const{scene:h,index:v}=f[0],C=o?.get(v)||0,j=h.type==="text-response"?m?.getEffectiveContent(v):void 0,w=h.type==="text-response"?m?.getOverlays(v)??[]:[];return n.jsxs("div",{"data-scene-index":v,className:`group/scene relative scene-enter ${u?"pr-7":""}`,children:[n.jsx(_i,{scene:h,isActive:v===r,collapseTools:i,effectiveContent:j??void 0}),w.length>0&&n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[w.map(S=>n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple",children:S.source.type==="translate"?"Translated":S.source.type==="tone"?"Softened":"Modified"},S.id)),n.jsx("button",{onClick:()=>m?.toggleOriginal(v),className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:m?.showOriginal.has(v)?"Show modified":"Show original"}),n.jsx("button",{onClick:()=>m?.revertSceneOverlays(v),className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-red transition-colors",children:"Revert"})]}),u&&n.jsxs("button",{onClick:S=>{S.stopPropagation(),u(v)},className:`absolute right-0 top-1 z-10 flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-xs font-mono transition-all duration-150 ${C>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover/scene:opacity-100"}`,title:C>0?`${C} comment${C>1?"s":""}`:"Add comment",children:["💬",C>0&&n.jsx("span",{children:C})]})]},v)}const x=f[0].scene.toolName;return n.jsx(z1,{batch:f,toolName:x,currentIndex:r,collapseTools:i,annotationCounts:o,onComment:u},f[0].index)})})}function z1({batch:l,toolName:r,currentIndex:i,collapseTools:o,annotationCounts:u,onComment:m}){const[p,g]=y.useState(!1),f=u?l.reduce((h,{index:v})=>h+(u.get(v)||0),0):0,x=l.map(({scene:h})=>h.type==="tool-call"?B1(h.toolName,h.input):"");return n.jsxs("div",{"data-scene-index":l[0].index,className:`group/batch relative ${m?"pr-7":""}`,children:[n.jsxs("button",{onClick:()=>g(!p),className:"w-full flex items-center gap-2 px-3.5 py-2.5 text-xs font-mono text-terminal-dim rounded-xl bg-terminal-surface hover:bg-terminal-surface-hover transition-all duration-200 ease-material cursor-pointer text-left shadow-layer-sm",children:[n.jsx("span",{className:`transition-transform text-xs ${p?"rotate-90":""}`,children:"▶"}),n.jsx("span",{className:"text-terminal-orange font-semibold",children:r}),n.jsxs("span",{className:"text-terminal-dimmer",children:[l.length," call",l.length>1?"s":""]}),!p&&n.jsxs("span",{className:"truncate text-terminal-dimmer ml-1",children:[x.filter(Boolean).slice(0,3).join(", "),x.filter(Boolean).length>3&&"..."]})]}),m&&!p&&n.jsxs("button",{onClick:h=>{h.stopPropagation(),m(l[0].index)},className:`absolute right-0 top-1 z-10 flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-xs font-mono transition-all duration-150 ${f>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover/batch:opacity-100"}`,title:f>0?`${f} comment${f>1?"s":""}`:"Add comment",children:["💬",f>0&&n.jsx("span",{children:f})]}),p&&n.jsx("div",{className:"mt-1 ml-4 space-y-2 pl-4",children:l.map(({scene:h,index:v})=>{const C=u?.get(v)||0;return n.jsxs("div",{"data-scene-index":v,className:`group/scene relative scene-enter ${m?"pr-7":""}`,children:[n.jsx(_i,{scene:h,isActive:v===i,collapseTools:o}),m&&n.jsxs("button",{onClick:j=>{j.stopPropagation(),m(v)},className:`absolute right-0 top-1 z-10 flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-xs font-mono transition-all duration-150 ${C>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover/scene:opacity-100"}`,title:C>0?`${C} comment${C>1?"s":""}`:"Add comment",children:["💬",C>0&&n.jsx("span",{children:C})]})]},v)})})]})}function B1(l,r){switch(l){case"Read":return r.file_path||"";case"Glob":return r.pattern||"";case"Grep":return r.pattern||"";case"Agent":return r.description||"";default:return""}}const _i=y.memo(function({scene:r,isActive:i,collapseTools:o,effectiveContent:u}){switch(r.type){case"user-prompt":return n.jsx(A1,{content:u??r.content,images:r.images,isActive:i});case"compaction-summary":return n.jsx(Ni,{content:r.content,isActive:i});case"context-injection":return n.jsx(Ni,{content:r.content,isActive:i});case"thinking":return n.jsx(sv,{content:r.content,isActive:i});case"text-response":return n.jsxs(n.Fragment,{children:[n.jsx(px,{content:u??r.content,isActive:i}),r.isTruncated&&n.jsx("div",{className:"mt-1 text-[10px] font-mono text-terminal-orange/70 italic",children:"Response truncated (max_tokens reached)"})]});case"tool-call":return n.jsx(k1,{scene:r,isActive:i,forceCollapse:o})}}),$1=8;function Qa(l){const r=new URLSearchParams(window.location.search).get("session");if(!r)return l;const i=l.includes("?")?"&":"?";return`${l}${i}slug=${encodeURIComponent(r)}`}function Sh({title:l,color:r}){return n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n.jsx("span",{className:`text-[10px] font-sans font-semibold uppercase tracking-widest ${r}`,children:l}),n.jsx("div",{className:"flex-1 h-px bg-terminal-border-subtle"})]})}function Fs({text:l,label:r}){const[i,o]=y.useState(!1);return n.jsx("button",{onClick:async()=>{await navigator.clipboard.writeText(l),o(!0),setTimeout(()=>o(!1),2e3)},className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors px-1.5 py-0.5 rounded bg-terminal-surface hover:bg-terminal-surface-hover border border-terminal-border-subtle",title:"Copy to clipboard",children:i?"Copied!":r||"Copy"})}function fi(l){try{const r=Date.now()-new Date(l).getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}catch{return""}}function ta(l,r=!1){const i=r?Math.round(l*.75):l;if(i<1024)return`${i} B`;const o=i/1024;return o<1024?`${o.toFixed(1)} KB`:`${(o/1024).toFixed(1)} MB`}function ru({label:l,path:r}){return n.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-dimmer w-8 shrink-0",children:l}),n.jsx("span",{className:"text-terminal-text truncate",children:r})]})}function U1({actions:l,viewerMode:r,readOnly:i,session:o}){const{hasUnsaved:u,canSaveHtml:m,downloadHtml:p,downloadJson:g,publishGist:f,exportHtml:x,exportGithub:h,htmlExporting:v,githubExporting:C}=l,j=r==="editor",[w,S]=y.useState(null),[k,E]=y.useState(null),[M,A]=y.useState(null),[R,O]=y.useState(null),[$,H]=y.useState(!1),[K,ae]=y.useState(null),[ue,oe]=y.useState(!1),[te,xe]=y.useState(null),[de,pe]=y.useState("preview"),[U,z]=y.useState("unlisted"),[Q,ne]=y.useState(!1),[W,T]=y.useState(!1),[_,V]=y.useState(null),[J,P]=y.useState(null),[he,G]=y.useState(null),[F,me]=y.useState(null),[be,Qe]=y.useState(null),[lt,Ct]=y.useState(null),[Fe,it]=y.useState(null),[Bt,kn]=y.useState(null),[qt,Cn]=y.useState(null),ze=y.useRef(null),ot=y.useRef(null),jt=y.useRef(null),st=y.useRef(null),Ze="https://vibe-replay.com",I=j?"":Ze,we=y.useMemo(()=>{if(j)return"";try{return new URL(Ze).origin}catch{return""}},[j]),ve=y.useCallback((ie,ke={})=>{const He=`${I}${ie}`;return fetch(He,{...ke,...j?{}:{credentials:"include"}})},[I,j]);y.useEffect(()=>()=>{ze.current&&(clearInterval(ze.current),ze.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),jt.current&&(clearTimeout(jt.current),jt.current=null),st.current&&(window.removeEventListener("message",st.current),st.current=null)},[]);const ce=y.useMemo(()=>o?new TextEncoder().encode(JSON.stringify(o)).byteLength:0,[o]),fe=10*1024*1024,_e=10*1024*1024,Se=ce>fe,Be=ce>_e,et=y.useCallback(()=>{j&&ve("/api/auth/get-session").then(ie=>ie.json()).then(ie=>{const ke=!!ie?.session;A(ke),ke&&ve("/api/cloud-replays").then(He=>He.json()).then(He=>{G(He.storage?.used??null),me(He.storage?.limit??null),o&&fetch(Qa("/api/cloud-info")).then(wt=>wt.json()).then(wt=>{const Nt=wt?.cloud?.id,on=Nt?(He.replays||[]).find(Tt=>Tt.id===Nt):null,Rt=on||(He.replays||[]).find(Tt=>Tt.storageType==="r2"&&Tt.title===(o.meta.title||o.meta.slug));if(Rt){const Tt={id:Rt.id,url:`${Ze}/r/${Rt.id}`,expiresAt:Rt.expiresAt||"",visibility:Rt.visibility};P(Tt),Rt.visibility&&z(Rt.visibility),on||fetch(Qa("/api/cloud-info"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Tt)}).catch(()=>{})}}).catch(()=>{})}).catch(()=>{})}).catch(()=>A(!1))},[j,ve]);y.useEffect(()=>{j&&(f&&(et(),H(!0),fetch(Qa("/api/gist-info")).then(ie=>ie.json()).then(ie=>{ie.gist&&O(ie.gist)}).catch(()=>{}).finally(()=>H(!1))),h&&fetch(Qa("/api/export/github/status")).then(ie=>ie.json()).then(ie=>{ie.exists&&ae({svgContent:ie.svgContent,markdown:ie.markdown,svgPath:ie.svgPath,mdPath:ie.mdPath,gifContent:ie.gifContent??null,gifPath:ie.gifPath??null,gifGeneratedAt:ie.gifGeneratedAt,svgGeneratedAt:ie.svgGeneratedAt,mdGeneratedAt:ie.mdGeneratedAt,replayUrl:ie.replayUrl})}).catch(()=>{}))},[j,f,h,ve,et]),y.useEffect(()=>{if(!j)return;const ie=()=>et();return window.addEventListener("vibe-auth-change",ie),()=>window.removeEventListener("vibe-auth-change",ie)},[j,et]);const Oe=y.useCallback(async()=>{if(o){ne(!0),E(null);try{const ie=JSON.stringify(o),ke=o.meta.title||o.meta.slug,He=`${ke.replace(/[^a-zA-Z0-9_-]/g,"-").replace(/-+/g,"-").slice(0,60)}.json`,wt=R?`/api/gists/${R.gistId}`:"/api/gists",Nt=await ve(wt,{method:R?"PATCH":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:He,content:ie,description:`vibe-replay: ${ke}`,public:!0})});if(!Nt.ok){const Tt=(await Nt.json().catch(()=>({}))).error||"Gist publish failed";if(Nt.status===401)throw A(!1),new Error(Tt);if(R&&(Nt.status===404||Tt.includes("not found"))){O(null),fetch(Qa("/api/gist-info"),{method:"DELETE"}).catch(()=>{}),E({type:"error",text:"Gist was deleted on GitHub. Click again to create a new one."});return}throw new Error(Tt)}const on=await Nt.json();O({gistId:on.gistId,gistUrl:on.gistUrl,viewerUrl:on.viewerUrl,updatedAt:new Date().toISOString()}),E({type:"success",text:"Published!"})}catch(ie){E({type:"error",text:ie instanceof Error?ie.message:String(ie)})}finally{ne(!1)}}},[o,R,ve]),Ue=y.useCallback(async()=>{if(o){T(!0),V(null);try{const ie=J?.id,ke=await ve("/api/cloud-replays",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({replay:o,visibility:U})});if(!ke.ok){const Nt=await ke.json().catch(()=>({}));throw ke.status===401&&A(!1),new Error(Nt.error||"Upload failed")}const He=await ke.json();ie&&ie!==He.id&&await ve(`/api/cloud-replays/${ie}`,{method:"DELETE"}).catch(()=>{}),P(He),V({type:"success",text:ie?"Updated!":"Shared!"}),fetch(Qa("/api/cloud-info"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...He,visibility:U})}).catch(()=>{});const wt=await ve("/api/cloud-replays").catch(()=>null);if(wt){const Nt=await wt.json().catch(()=>null);Nt?.storage&&(G(Nt.storage.used??null),me(Nt.storage.limit??null))}}catch(ie){V({type:"error",text:ie instanceof Error?ie.message:String(ie)})}finally{T(!1)}}},[o,U,J,ve]),tt=y.useCallback(async()=>{if(J?.id){T(!0),V(null);try{const ie=await ve(`/api/cloud-replays/${J.id}`,{method:"DELETE"});if(!ie.ok){const ke=await ie.json().catch(()=>({}));throw new Error(ke.error||"Delete failed")}P(null),V({type:"success",text:"Removed from cloud"}),fetch(Qa("/api/cloud-info"),{method:"DELETE"}).catch(()=>{}),ve("/api/cloud-replays").then(ke=>ke.json()).then(ke=>{G(ke.storage?.used??null),me(ke.storage?.limit??null)}).catch(()=>{})}catch(ie){V({type:"error",text:ie instanceof Error?ie.message:String(ie)})}finally{T(!1)}}},[J,ve]),Yt=y.useCallback(()=>{ve("/api/cloud-replays").then(ie=>ie.json()).then(ie=>{G(ie.storage?.used??null),me(ie.storage?.limit??null)}).catch(()=>{})},[ve]),Ft=y.useCallback(async ie=>{const ke=ie==="gif"?K?.gifContent:K?.svgContent;if(!ke)return;const He=ie==="gif"?kn:Cn;it(ie),He(null);try{const wt=ie==="svg"?btoa(Array.from(new TextEncoder().encode(ke),Wa=>String.fromCharCode(Wa)).join("")):ke,Nt=ie==="gif"?"image/gif":"image/svg+xml",on=`session-preview.${ie}`,Rt=ie==="gif"?be:lt,Tt=await ve("/api/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:wt,contentType:Nt,filename:on,parentReplayId:J?.id||null,visibility:U})});if(!Tt.ok){const Wa=await Tt.json().catch(()=>({}));throw Tt.status===401&&A(!1),new Error(Wa.error||"Upload failed")}const Pa=await Tt.json();Rt&&await ve(`/api/files/${Rt.id}`,{method:"DELETE"}).catch(()=>{});const Zl={id:Pa.id,url:Pa.url};ie==="gif"?Qe(Zl):Ct(Zl),He({type:"success",text:"Shared!"}),navigator.clipboard.writeText(Pa.url).catch(()=>{}),Yt()}catch(wt){He({type:"error",text:wt instanceof Error?wt.message:String(wt)})}finally{it(null)}},[K,be,lt,J,U,ve,Yt]),rn=y.useCallback(async()=>{if(h){xe(null),oe(!0);try{const ie=await h();await navigator.clipboard.writeText(ie.markdown),ae({svgContent:ie.svgContent,markdown:ie.markdown,svgPath:ie.svgPath,mdPath:ie.mdPath,gifContent:ie.gifContent??null,gifPath:ie.gifPath??null,gifGeneratedAt:ie.gifGeneratedAt,svgGeneratedAt:ie.svgGeneratedAt,mdGeneratedAt:ie.mdGeneratedAt,replayUrl:ie.replayUrl,warnings:ie.warnings})}catch(ie){xe(ie instanceof Error?ie.message:String(ie))}finally{oe(!1)}}},[h]),Ln=y.useMemo(()=>{if(!K?.markdown)return"";const ie=K.markdown.replace(/\[?!\[[^\]]*\]\([^)]*\.(?:svg|gif)\)\]?(?:\([^)]*\))?\n*/g,"");return Zu(Ye.parse(ie))},[K?.markdown]),zn=y.useMemo(()=>K?.svgContent?Wy(K.svgContent):"",[K?.svgContent]);if(i)return n.jsx("div",{className:"p-6 text-center text-xs font-mono text-terminal-dim",children:"Export is not available in read-only mode"});const $t="px-4 py-2 text-xs font-mono rounded-lg transition-colors text-center disabled:opacity-50 shrink-0";return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"p-6 max-w-3xl mx-auto",children:n.jsxs("div",{children:[o&&n.jsxs("div",{className:"flex items-center gap-2.5 mb-5",children:[n.jsx("h2",{className:"text-sm font-mono font-semibold text-terminal-text truncate",children:o.meta.title||o.meta.slug}),o.meta.provider&&n.jsx("span",{className:"shrink-0 text-[10px] font-mono text-terminal-dimmer px-1.5 py-0.5 rounded bg-terminal-surface border border-terminal-border-subtle",children:o.meta.provider})]}),u&&n.jsx("div",{className:"text-xs font-mono text-terminal-orange text-center mb-5 px-3 py-2 rounded-lg bg-terminal-orange-subtle border border-terminal-orange/20",children:"You have unsaved annotation changes"}),j&&n.jsxs("div",{id:"share",className:"mb-12",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx(Sh,{title:"Share",color:"text-terminal-purple"}),ce>0&&n.jsxs("span",{className:`text-[11px] font-mono px-2 py-0.5 rounded-md ${ce>_e?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-surface-2 text-terminal-dimmer"}`,children:[ta(ce)," replay"]})]}),M===!1?n.jsx("div",{className:"bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden",children:n.jsxs("div",{className:"p-6",children:[n.jsx("h3",{className:"text-lg font-sans font-semibold text-terminal-text mb-5",children:"Share your session — free"}),n.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-6",children:[n.jsxs("div",{className:"rounded-xl bg-terminal-bg border border-terminal-border-subtle p-5",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx("span",{className:"text-xs font-sans font-bold text-terminal-purple",children:"Cloud Share"}),n.jsx("span",{className:"text-[10px] font-mono font-semibold px-2 py-0.5 rounded-md bg-terminal-purple-subtle text-terminal-purple",children:"Private"})]}),n.jsxs("ul",{className:"space-y-2.5 text-sm font-sans text-terminal-dim",children:[n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"20 MB free storage"]}),n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"7-day shareable link"]})]})]}),n.jsxs("div",{className:"rounded-xl bg-terminal-bg border border-terminal-border-subtle p-5",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx("span",{className:"text-xs font-sans font-bold text-terminal-dim",children:"GitHub Gist"}),n.jsx("span",{className:"text-[10px] font-mono font-semibold px-2 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:"Public"})]}),n.jsxs("ul",{className:"space-y-2.5 text-sm font-sans text-terminal-dim",children:[n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"No storage limit"]}),n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"Permanent — never expires"]}),n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"Great for portfolios"]})]})]})]}),n.jsxs("button",{type:"button",onClick:async()=>{if(ze.current&&(clearInterval(ze.current),ze.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),jt.current&&(clearTimeout(jt.current),jt.current=null),st.current&&(window.removeEventListener("message",st.current),st.current=null),j){try{const ke=await fetch("/api/auth/login",{method:"POST"}),He=await ke.json().catch(()=>null);ke.ok&&He?.url&&window.open(He.url,"_blank")}catch{}ze.current=setInterval(async()=>{try{(await(await fetch("/api/auth/get-session")).json())?.session&&(ze.current&&(clearInterval(ze.current),ze.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),A(!0),window.dispatchEvent(new Event("vibe-auth-change")))}catch{}},2e3),ot.current=setTimeout(()=>{ze.current&&(clearInterval(ze.current),ze.current=null),ot.current=null},300*1e3);return}window.open(`${Ze}/auth/login?callback=/auth/success`,"_blank");const ie=ke=>{ke.origin===we&&ke.data?.type==="vibe-replay-auth"&&ke.data.user&&(window.removeEventListener("message",ie),st.current=null,jt.current&&(clearTimeout(jt.current),jt.current=null),A(!0),window.dispatchEvent(new Event("vibe-auth-change")))};st.current=ie,window.addEventListener("message",ie),jt.current=setTimeout(()=>{window.removeEventListener("message",ie),jt.current=null,st.current===ie&&(st.current=null)},300*1e3)},className:"group inline-flex items-center gap-2.5 px-6 py-3 rounded-xl bg-terminal-green-subtle hover:bg-terminal-green-emphasis text-terminal-green text-sm font-sans font-semibold transition-all duration-200 ease-material shadow-layer-sm hover:shadow-layer-md hover:-translate-y-0.5",children:[n.jsx("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"currentColor",className:"transition-transform group-hover:scale-110",children:n.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),"Sign in with GitHub"]})]})}):M===!0?n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden p-5 flex flex-col",children:[n.jsx("div",{className:"flex items-center gap-2 mb-3",children:n.jsx("span",{className:"text-sm font-mono font-semibold text-terminal-purple",children:"Cloud Share"})}),n.jsx("div",{className:"flex items-center h-7 rounded-md overflow-hidden bg-terminal-bg mb-3",children:[{value:"private",label:"Private",icon:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})},{value:"unlisted",label:"Link only",icon:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),n.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})},{value:"public",label:"Public",icon:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),n.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}].map(({value:ie,label:ke,icon:He})=>n.jsxs("button",{onClick:()=>z(ie),className:`h-full flex-1 px-2.5 text-[11px] font-mono transition-colors flex items-center justify-center gap-1.5 whitespace-nowrap ${U===ie?"bg-terminal-purple-subtle text-terminal-purple":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,children:[He,ke]},ie))}),he!=null&&F!=null&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"flex items-center justify-between text-[10px] font-mono text-terminal-dimmer mb-1.5",children:[n.jsxs("span",{children:[ta(he)," used"]}),n.jsxs("span",{children:[ta(F)," total"]})]}),(()=>{const ie=he/F*100,ke=!J&&ce>0,He=ke?ce/F*100:0,wt=ke&&he+ce>F;return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"h-2 rounded-full bg-terminal-surface-hover overflow-hidden",children:n.jsxs("div",{className:"h-full flex",children:[he>0&&n.jsx("div",{className:"h-full bg-terminal-purple transition-all",style:{width:`${Math.max(ie,1)}%`}}),ke&&n.jsx("div",{className:`h-full transition-all ${wt?"bg-terminal-orange":"bg-terminal-green"}`,style:{width:`${Math.max(Math.min(He,100-ie),1)}%`}})]})}),ke&&n.jsxs("div",{className:"flex items-center gap-3 mt-1.5 text-[10px] font-mono text-terminal-dimmer",children:[n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-sm bg-terminal-purple"}),ta(he)," used"]}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("span",{className:`w-1.5 h-1.5 rounded-sm ${wt?"bg-terminal-orange":"bg-terminal-green"}`}),"+",ta(ce)," this upload"]})]})]})})()]}),n.jsxs("p",{className:"text-[10px] font-mono text-terminal-dimmer flex items-center gap-1.5 mb-1",children:[n.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-terminal-orange",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("polyline",{points:"12 6 12 12 16 14"})]}),"Free tier links expire after 7 days"]}),Se&&n.jsxs("p",{className:"text-[11px] font-mono text-terminal-orange mt-1.5 flex items-center gap-1",children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("path",{d:"M8 1a1 1 0 0 1 1 1v5.5a1 1 0 0 1-2 0V2a1 1 0 0 1 1-1zM8 11a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 8 11z"})}),"Replay is ",ta(ce)," — exceeds 10MB limit"]}),J&&n.jsxs("div",{className:"mt-4 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono font-semibold text-terminal-green px-2 py-0.5 rounded-full bg-terminal-green-subtle",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green"}),"Shared"]}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:["expires ",new Date(`${J.expiresAt}Z`).toLocaleDateString()]})]}),n.jsxs("div",{className:"flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle",children:[n.jsx("a",{href:`${Ze}/r/${J.id}`,target:"_blank",rel:"noopener noreferrer",className:"flex-1 text-xs font-mono text-terminal-purple hover:text-terminal-text transition-colors truncate",children:`${Ze}/r/${J.id}`}),n.jsx(Fs,{text:`${Ze}/r/${J.id}`})]})]}),n.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[n.jsx("button",{onClick:Ue,disabled:W||Se,className:`${$t} ${Se?"bg-terminal-surface-2 text-terminal-dimmer border border-terminal-border cursor-not-allowed":J?"bg-terminal-surface-hover text-terminal-purple hover:bg-terminal-purple-subtle border border-terminal-border":"bg-terminal-purple-subtle text-terminal-purple hover:bg-[rgba(168,85,247,0.25)] border border-[rgba(168,85,247,0.2)]"}`,children:W?"Uploading...":Se?"Too large":J?"Update":"Share to Cloud"}),J&&n.jsx("button",{onClick:tt,disabled:W,className:`${$t} bg-terminal-surface-hover text-terminal-red hover:bg-terminal-red-subtle border border-terminal-border`,children:"Delete"}),_&&n.jsx("span",{className:`text-[11px] font-mono ${_.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:_.text})]})]}),j&&n.jsxs("div",{className:"bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden p-5 flex flex-col",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx("span",{className:"text-sm font-mono font-semibold text-terminal-dim",children:"GitHub Gist"}),n.jsx("span",{className:"text-[10px] font-mono font-semibold px-2 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:"Public"})]}),n.jsxs("ul",{className:"space-y-1.5 text-xs font-sans text-terminal-dim mb-auto",children:[n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"Hosted on GitHub forever"]}),n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"Doesn't use your storage"]}),n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-orange shrink-0",children:"!"}),"Visible to everyone on the internet"]})]}),Be&&n.jsxs("p",{className:"text-[11px] font-mono text-terminal-red mt-1.5 flex items-center gap-1",children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("path",{d:"M8 1a1 1 0 0 1 1 1v5.5a1 1 0 0 1-2 0V2a1 1 0 0 1 1-1zM8 11a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 8 11z"})}),"Replay is ",ta(ce)," — exceeds 10MB limit"]}),R&&n.jsxs("div",{className:"mt-4 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono font-semibold text-terminal-green px-2 py-0.5 rounded-full bg-terminal-green-subtle",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green"}),"Published"]}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:fi(R.updatedAt)})]}),n.jsxs("div",{className:"flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle",children:[n.jsx("a",{href:R.viewerUrl,target:"_blank",rel:"noopener noreferrer",className:"flex-1 text-xs font-mono text-terminal-blue hover:text-terminal-text transition-colors truncate",children:R.viewerUrl}),n.jsx(Fs,{text:R.viewerUrl})]})]}),$&&!R&&n.jsx("div",{className:"mt-4 text-[11px] font-mono text-terminal-dimmer animate-pulse",children:"Checking..."}),n.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[n.jsx("button",{onClick:Oe,disabled:Q||Be,className:`${$t} ${Be?"bg-terminal-surface-2 text-terminal-dimmer border border-terminal-border cursor-not-allowed":"bg-terminal-surface-hover text-terminal-dim hover:bg-terminal-surface-2 border border-terminal-border"}`,children:Q?"Publishing...":Be?"Too large":R?"Update Gist":"Publish to Gist"}),k&&n.jsx("span",{className:`text-[11px] font-mono ${k.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:k.text}),R&&n.jsx("a",{href:R.gistUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[11px] font-mono text-terminal-blue hover:text-terminal-text transition-colors",children:"Open on GitHub"})]})]})]}):n.jsx("div",{className:"text-[11px] font-mono text-terminal-dimmer animate-pulse p-2",children:"Checking login status..."})]}),n.jsxs("div",{id:"export",children:[n.jsx(Sh,{title:"Export",color:"text-terminal-green"}),n.jsxs("div",{className:"space-y-4",children:[j&&h&&n.jsxs(n.Fragment,{children:[K?.gifContent&&n.jsxs("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-green",children:"Animated GIF"}),n.jsx("p",{className:"text-[10px] font-mono text-terminal-dim mt-0.5",children:"Works everywhere: GitHub PRs, issues, READMEs, Slack, Discord. Shows up to 8 turns."})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[K.gifGeneratedAt&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:fi(K.gifGeneratedAt)}),n.jsx("button",{onClick:rn,disabled:ue||C,className:"text-[11px] font-mono text-terminal-dim hover:text-terminal-green transition-colors px-1.5 py-0.5 rounded bg-terminal-bg hover:bg-terminal-surface-hover border border-terminal-border-subtle",title:"Regenerate all exports",children:ue||C?n.jsx("span",{className:"animate-pulse",children:"..."}):n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),n.jsx("path",{d:"M21 3v5h-5"}),n.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),n.jsx("path",{d:"M8 16H3v5"})]})})]})]}),n.jsx("div",{className:"bg-terminal-bg p-2 flex justify-center border-y border-terminal-border-subtle",children:n.jsx("img",{src:`data:image/gif;base64,${K.gifContent}`,alt:"Session preview GIF",className:"w-full h-auto block"})}),n.jsxs("div",{className:"px-5 py-3 space-y-2 border-t border-terminal-border-subtle",children:[K.gifPath&&n.jsx(ru,{label:"File",path:`${K.gifPath} (${ta(K.gifContent?.length??0,!0)})`}),be?n.jsxs("div",{className:"flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono font-semibold text-terminal-green px-1.5 py-0.5 rounded-full bg-terminal-green-subtle shrink-0",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green"}),"Shared"]}),n.jsx("span",{className:"flex-1 text-xs font-mono text-terminal-purple truncate",children:be.url}),n.jsx(Fs,{text:be.url})]}):n.jsxs("p",{className:"text-[10px] font-mono text-terminal-dimmer leading-relaxed",children:["Usage:"," ",n.jsx("span",{className:"text-terminal-text",children:""})]}),M&&n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{onClick:()=>Ft("gif"),disabled:Fe==="gif",className:"text-[11px] font-mono px-3 py-1.5 rounded-lg transition-colors bg-terminal-purple-subtle text-terminal-purple hover:bg-[rgba(168,85,247,0.25)] border border-[rgba(168,85,247,0.2)]",children:Fe==="gif"?"Uploading...":be?"Update link":"Share to Cloud"}),Bt&&Fe===null&&n.jsx("span",{className:`text-[10px] font-mono ${Bt.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:Bt.text})]})]})]}),K?.svgContent&&n.jsxs("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-orange",children:"Animated SVG"}),n.jsxs("p",{className:"text-[10px] font-mono text-terminal-dim mt-0.5",children:["Embed in READMEs, PRs, or anywhere that renders SVG. Shows up to"," ",$1," turns."]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[K.svgGeneratedAt&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:fi(K.svgGeneratedAt)}),n.jsx("button",{onClick:rn,disabled:ue||C,className:"text-[11px] font-mono text-terminal-dim hover:text-terminal-orange transition-colors px-1.5 py-0.5 rounded bg-terminal-bg hover:bg-terminal-surface-hover border border-terminal-border-subtle",title:"Regenerate all exports",children:ue||C?n.jsx("span",{className:"animate-pulse",children:"..."}):n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),n.jsx("path",{d:"M21 3v5h-5"}),n.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),n.jsx("path",{d:"M8 16H3v5"})]})})]})]}),n.jsx("div",{className:"bg-terminal-bg p-2 border-y border-terminal-border-subtle [&>svg]:w-full [&>svg]:h-auto [&>svg]:block",dangerouslySetInnerHTML:{__html:zn}}),n.jsxs("div",{className:"px-5 py-3 space-y-2 border-t border-terminal-border-subtle",children:[n.jsx(ru,{label:"File",path:`${K.svgPath} (${ta(K.svgContent?.length??0)})`}),K.replayUrl&&n.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-dimmer w-8 shrink-0",children:"Link"}),n.jsx("a",{href:K.replayUrl,target:"_blank",rel:"noopener noreferrer",className:"text-terminal-blue hover:text-terminal-text transition-colors truncate",children:K.replayUrl})]}),lt?n.jsxs("div",{className:"flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono font-semibold text-terminal-green px-1.5 py-0.5 rounded-full bg-terminal-green-subtle shrink-0",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green"}),"Shared"]}),n.jsx("span",{className:"flex-1 text-xs font-mono text-terminal-purple truncate",children:lt.url}),n.jsx(Fs,{text:lt.url})]}):n.jsxs("p",{className:"text-[10px] font-mono text-terminal-dimmer leading-relaxed",children:["Usage:"," ",n.jsx("span",{className:"text-terminal-text",children:""})]}),M&&n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{onClick:()=>Ft("svg"),disabled:Fe==="svg",className:"text-[11px] font-mono px-3 py-1.5 rounded-lg transition-colors bg-terminal-purple-subtle text-terminal-purple hover:bg-[rgba(168,85,247,0.25)] border border-[rgba(168,85,247,0.2)]",children:Fe==="svg"?"Uploading...":lt?"Update link":"Share to Cloud"}),qt&&Fe===null&&n.jsx("span",{className:`text-[10px] font-mono ${qt.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:qt.text})]})]})]}),K?.markdown&&n.jsxs("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-orange",children:"Markdown Summary"}),n.jsx("p",{className:"text-[10px] font-mono text-terminal-dim mt-0.5",children:"Paste into GitHub PRs, issues, or README files."})]}),K.mdGeneratedAt&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer self-start mt-0.5",children:fi(K.mdGeneratedAt)})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Fs,{text:K.markdown,label:"Copy MD"}),n.jsxs("div",{className:"flex items-center h-6 rounded-md overflow-hidden bg-terminal-bg border border-terminal-border-subtle",children:[n.jsx("button",{onClick:()=>pe("preview"),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${de==="preview"?"bg-terminal-orange-subtle text-terminal-orange":"text-terminal-dim hover:text-terminal-text"}`,children:"Preview"}),n.jsx("button",{onClick:()=>pe("source"),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${de==="source"?"bg-terminal-orange-subtle text-terminal-orange":"text-terminal-dim hover:text-terminal-text"}`,children:"Source"})]})]})]}),n.jsx("div",{className:"p-4",children:de==="preview"?n.jsx("div",{className:"prose-terminal text-xs leading-relaxed bg-terminal-bg rounded-lg border border-terminal-border-subtle p-4 overflow-x-auto",dangerouslySetInnerHTML:{__html:Ln}}):n.jsx("pre",{className:"bg-terminal-bg rounded-lg border border-terminal-border-subtle p-3 text-[11px] font-mono text-terminal-dim leading-relaxed overflow-x-auto max-h-72 overflow-y-auto whitespace-pre-wrap",children:K.markdown})}),n.jsx("div",{className:"px-5 py-3 space-y-1.5 border-t border-terminal-border-subtle",children:n.jsx(ru,{label:"File",path:K.mdPath})}),K.warnings&&K.warnings.length>0&&n.jsxs("div",{className:"mx-5 mb-4 text-[11px] font-mono text-terminal-orange px-3 py-2 rounded-lg bg-terminal-orange-subtle/50 border border-terminal-orange/10",children:[n.jsx("div",{className:"font-semibold mb-1",children:"Security warnings"}),K.warnings.map((ie,ke)=>n.jsx("div",{className:"text-terminal-dim",children:ie},ke))]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:rn,disabled:ue||C,className:`${$t} ${K?"bg-terminal-surface-hover text-terminal-orange hover:bg-terminal-orange-subtle border border-terminal-border":"bg-terminal-orange-subtle text-terminal-orange hover:bg-terminal-orange-emphasis border border-terminal-orange/20"}`,children:ue||C?"Generating...":K?"Regenerate GIF + SVG + Markdown":"Generate GIF + SVG + Markdown"}),te&&n.jsx("span",{className:"text-[11px] font-mono text-terminal-red",children:te}),!K&&n.jsx("span",{className:"text-[11px] font-mono text-terminal-dim",children:"For GitHub PRs, READMEs, websites, email, Slack, and more. Shows up to 8 turns."})]})]}),j&&x&&n.jsxs("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5",children:[n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-green mb-1",children:"HTML Replay"}),n.jsx("p",{className:"text-[11px] font-mono text-terminal-dim leading-relaxed",children:"Self-contained HTML file with zero external requests. Includes all scenes, metadata, and annotations. Share via email, Slack, or host on any static server."})]}),n.jsx("button",{onClick:async()=>{S(null);try{const ie=await x();S({type:"success",text:ie})}catch(ie){S({type:"error",text:ie instanceof Error?ie.message:String(ie)})}},disabled:v,className:`${$t} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis border border-terminal-green/20`,children:v?"Exporting...":"Export HTML"})]}),w&&n.jsx("div",{className:`mt-3 text-[11px] font-mono ${w.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:w.type==="success"?n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green shrink-0"}),"Saved to ",w.text]}):w.text})]}),!j&&m&&n.jsx("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-green mb-1",children:"Save HTML"}),n.jsx("p",{className:"text-[11px] font-mono text-terminal-dim leading-relaxed",children:"Download a self-contained HTML replay file with your comments included."})]}),n.jsx("button",{onClick:p,className:`${$t} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis border border-terminal-green/20`,children:"Download HTML"})]})}),n.jsx("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-blue mb-1",children:"JSON Data"}),n.jsx("p",{className:"text-[11px] font-mono text-terminal-dim leading-relaxed",children:"Raw replay data including all scenes, metadata, and annotations. Useful for backup, re-import, or programmatic analysis."})]}),n.jsx("button",{onClick:g,className:`${$t} bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis border border-terminal-blue/20`,children:"Download JSON"})]})})]})]})]})})})}const H1=[{title:"Playback",items:[{key:"Space",label:"Play / Pause"},{key:"↑ / ↓",label:"Step Back / Forward"},{key:"Home",label:"Reset to Start"},{key:"End / e",label:"Jump to End"}]},{title:"Navigation",items:[{key:"n / p",label:"Next / Prev Turn"},{key:"← / →",label:"Collapse / Expand Item"}]},{title:"Global",items:[{key:"?",label:"Show Keyboard Shortcuts"},{key:"⌘ K",label:"Open Search"},{key:"Esc",label:"Close Modal / Search"}]}];function G1({open:l,onClose:r}){const i=y.useCallback(o=>{(o.key==="Escape"||o.key==="?")&&r()},[r]);return y.useEffect(()=>{if(l)return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[l,i]),l?n.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4 bg-black/60 backdrop-blur-md animate-in fade-in duration-300",onClick:r,role:"dialog","aria-label":"Keyboard shortcuts","aria-modal":"true",children:n.jsxs("div",{className:"w-full max-w-lg bg-terminal-bg border border-terminal-border-subtle rounded-2xl shadow-layer-xl overflow-hidden animate-in zoom-in-95 duration-200",onClick:o=>o.stopPropagation(),children:[n.jsxs("div",{className:"px-6 py-5 border-b border-terminal-border-subtle flex items-center justify-between",children:[n.jsx("h2",{className:"text-sm font-sans font-bold uppercase tracking-[0.2em] text-terminal-text",children:"Keyboard Shortcuts"}),n.jsx("button",{onClick:r,className:"text-terminal-dimmer hover:text-terminal-red transition-colors",children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsx("div",{className:"px-6 py-4 grid grid-cols-1 gap-8",children:H1.map(o=>n.jsxs("div",{className:"space-y-3.5",children:[n.jsx("h3",{className:"text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-[0.15em] pl-1",children:o.title}),n.jsx("div",{className:"grid grid-cols-1 gap-2.5",children:o.items.map(u=>n.jsxs("div",{className:"flex items-center justify-between group",children:[n.jsx("span",{className:"text-xs font-sans font-medium text-terminal-dim group-hover:text-terminal-text transition-colors",children:u.label}),n.jsx("kbd",{className:"min-w-[40px] px-2 py-1 flex items-center justify-center text-[11px] font-mono font-bold text-terminal-text bg-terminal-surface border border-terminal-border-subtle rounded-lg shadow-layer-sm",children:u.key})]},u.key))})]},o.title))}),n.jsx("div",{className:"px-6 py-4 bg-terminal-surface/30 border-t border-terminal-border-subtle",children:n.jsxs("p",{className:"text-[10px] font-sans font-medium text-terminal-dimmer text-center uppercase tracking-wider",children:["Press ",n.jsx("span",{className:"text-terminal-text font-mono font-bold",children:"?"})," to toggle this menu anytime"]})})]})}):null}function q1(l){return l==="claude-code"?"Claude Code":l==="cursor"?"Cursor":l}function Y1({session:l,onStart:r,onViewInsights:i}){const{meta:o,scenes:u}=l,m=y.useMemo(()=>{const j=u.find(O=>O.type==="user-prompt");if(!j||j.type!=="user-prompt")return null;const w=j.content,S={};let k=0,E=0,M="",A=0;for(const O of u){if(O.type==="user-prompt"){if(A++,A>1)break;continue}if(A===1)if(O.type==="tool-call"){E++;const $=O.toolName.replace(/^mcp__.*__/,"");S[$]=(S[$]||0)+1}else O.type==="text-response"&&(k++,M=O.content)}const R=Object.entries(S).sort((O,$)=>$[1]-O[1]);return{prompt:w,responses:k,totalTools:E,toolEntries:R,lastResponse:M}},[u]),p=y.useMemo(()=>{const j=new Set;for(const w of u)w.type==="tool-call"&&w.diff&&j.add(w.diff.filePath);return j.size},[u]),g=vt(o.stats.durationMs),f=o.title||o.project,x=q1(o.provider),h=y.useMemo(()=>{const j=[];if(g&&j.push({value:g,label:"Duration",color:"text-terminal-text"}),j.push({value:String(o.stats.userPrompts),label:"Turns",color:"text-terminal-green"}),p>0&&j.push({value:String(p),label:"Files",color:"text-terminal-blue"}),o.stats.costEstimate!==void 0){const w=o.stats.costEstimate;j.push({value:`$${w<.01?w.toFixed(4):w.toFixed(2)}`,label:"Cost",color:"text-terminal-orange"})}return j.length<3&&o.stats.toolCalls>0&&j.push({value:String(o.stats.toolCalls),label:"Tool Calls",color:"text-terminal-orange"}),j},[g,p,o.stats]),v=y.useRef(!1),C=y.useRef(0);return y.useEffect(()=>{const j=k=>{v.current||k.deltaY>0&&(v.current=!0,r(!1))},w=k=>{C.current=k.touches[0].clientY},S=k=>{if(v.current)return;C.current-k.touches[0].clientY>15&&(v.current=!0,r(!1))};return window.addEventListener("wheel",j,{passive:!0}),window.addEventListener("touchstart",w,{passive:!0}),window.addEventListener("touchmove",S,{passive:!0}),()=>{window.removeEventListener("wheel",j),window.removeEventListener("touchstart",w),window.removeEventListener("touchmove",S)}},[r]),y.useEffect(()=>{const j=w=>{(w.key===" "||w.key==="Enter"||w.key==="ArrowDown"||w.key==="ArrowRight")&&(w.preventDefault(),r())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[r]),n.jsxs("div",{className:"flex-1 flex flex-col items-center overflow-y-auto relative",children:[n.jsxs("div",{className:"absolute inset-0 pointer-events-none",children:[n.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-terminal-green-subtle via-transparent to-transparent"}),n.jsx("div",{className:"absolute inset-0 bg-dot-grid"})]}),n.jsx("div",{className:"flex-1 min-h-4 md:min-h-0"}),n.jsxs("div",{className:"max-w-2xl w-full px-6 md:px-8 pt-4 md:pt-0 text-center space-y-5 md:space-y-7 z-10 shrink-0",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("h2",{className:"text-3xl sm:text-4xl md:text-5xl font-sans font-bold text-terminal-text leading-[1.15] tracking-tight",children:f}),n.jsxs("p",{className:"text-sm font-sans text-terminal-dim",children:["A ",x," session replay by ",n.jsx("a",{href:"https://vibe-replay.com",target:"_blank",rel:"noopener noreferrer",className:"font-bold bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent hover:opacity-80 transition-opacity",children:"vibe-replay"})]}),(o.gitBranch||o.model)&&n.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-2",children:[o.gitBranch&&n.jsx("span",{className:"text-[11px] font-mono text-terminal-purple px-2 py-0.5 rounded-full bg-terminal-purple/10 border border-terminal-purple/20",title:o.gitBranches?o.gitBranches.join(" → "):o.gitBranch,children:o.gitBranches&&o.gitBranches.length>1?`${o.gitBranches[0]} → ${o.gitBranch}`:o.gitBranch}),o.model&&n.jsx("span",{className:"text-[11px] font-mono text-terminal-dim px-2 py-0.5 rounded-full bg-terminal-surface border border-terminal-border-subtle",children:o.model}),o.permissionMode==="bypassPermissions"&&n.jsx("span",{className:"text-[11px] font-mono text-terminal-orange px-2 py-0.5 rounded-full bg-terminal-orange/10 border border-terminal-orange/20",children:"dangerous mode"})]})]}),m&&n.jsxs("button",{type:"button",onClick:()=>r(),className:"w-full text-left appearance-none bg-transparent border-none p-0 cursor-pointer space-y-3",children:[n.jsxs("div",{className:"rounded-2xl px-5 py-4 ml-4 md:ml-12 bg-terminal-green-subtle border border-terminal-green/30 shadow-layer-sm hover:bg-terminal-green-emphasis transition-all duration-200 ease-material",children:[n.jsx("div",{className:"flex items-center gap-2 mb-2.5",children:n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-green uppercase tracking-widest",children:"You"})}),n.jsx("div",{className:"text-terminal-green font-mono text-sm whitespace-pre-wrap break-words line-clamp-3",children:m.prompt})]}),n.jsxs("div",{className:"rounded-xl px-5 py-4 bg-terminal-surface shadow-layer-sm",children:[n.jsx("div",{className:"flex items-center gap-2 mb-2.5",children:n.jsx("span",{className:"text-[10px] font-sans font-semibold text-secondary-text uppercase tracking-widest",children:"Assistant"})}),n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mb-3 text-[11px] font-mono",children:[m.responses>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue",children:[m.responses," response",m.responses>1?"s":""]}),m.totalTools>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange",children:[m.totalTools," tool",m.totalTools>1?"s":""]}),m.toolEntries.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-terminal-border mx-0.5",children:"|"}),m.toolEntries.map(([j,w])=>n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-terminal-surface-hover text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-orange",children:j}),n.jsx("span",{children:w})]},j))]})]}),m.lastResponse&&n.jsx("div",{className:"text-sm font-mono text-terminal-dim whitespace-pre-wrap break-words line-clamp-2 leading-relaxed",children:m.lastResponse})]}),o.stats.userPrompts>1&&n.jsx("div",{className:"text-center",children:n.jsxs("span",{className:"text-[11px] font-sans text-terminal-dimmer",children:["and ",o.stats.userPrompts-1," more turn",o.stats.userPrompts-1!==1?"s":""," ","→"]})})]}),n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 sm:gap-3 max-w-lg mx-auto",children:h.map(j=>n.jsxs("div",{className:"bg-terminal-surface rounded-lg sm:rounded-xl px-2.5 py-2 sm:px-3 sm:py-3 shadow-layer-sm",children:[n.jsx("div",{className:`text-base sm:text-xl font-bold font-mono tabular-nums ${j.color}`,children:j.value}),n.jsx("div",{className:"text-[9px] sm:text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-medium",children:j.label})]},j.label))}),n.jsxs("div",{className:"hidden md:flex items-center justify-center gap-3 flex-wrap",children:[n.jsxs("button",{type:"button",onClick:()=>r(),className:"group inline-flex items-center gap-3 px-10 py-4 rounded-xl bg-terminal-green-subtle hover:bg-terminal-green-emphasis transition-all duration-200 ease-material shadow-layer-md hover:shadow-layer-lg hover:-translate-y-0.5 landing-pulse",children:[n.jsx("span",{className:"text-xl text-terminal-green group-hover:scale-110 transition-transform duration-200",children:"▶"}),n.jsx("span",{className:"text-base font-sans font-semibold text-terminal-green tracking-wide",children:"Watch Replay"})]}),i&&n.jsxs("button",{type:"button",onClick:i,className:"group inline-flex items-center gap-2 px-6 py-4 rounded-xl bg-terminal-surface hover:bg-terminal-surface-hover transition-all duration-200 ease-material shadow-layer-sm hover:shadow-layer-md border border-terminal-border/40 hover:border-terminal-border",children:[n.jsxs("svg",{"aria-hidden":"true",className:"w-4 h-4 text-terminal-blue group-hover:scale-110 transition-transform duration-200",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",x2:"18",y1:"20",y2:"10"}),n.jsx("line",{x1:"12",x2:"12",y1:"20",y2:"4"}),n.jsx("line",{x1:"6",x2:"6",y1:"20",y2:"14"})]}),n.jsx("span",{className:"text-sm font-sans font-semibold text-terminal-dim group-hover:text-terminal-text tracking-wide",children:"View Insights"})]})]}),n.jsx("div",{className:"h-24 md:hidden"})]}),n.jsxs("button",{type:"button",onClick:()=>r(!1),className:"hidden md:flex mt-8 md:mt-10 mb-6 z-10 shrink-0 flex-col items-center gap-2 group cursor-pointer",children:[n.jsx("span",{className:"text-xs font-sans font-medium text-terminal-dim group-hover:text-terminal-text transition-colors",children:"or scroll down"}),n.jsx("svg",{"aria-hidden":"true",className:"w-6 h-6 text-terminal-green animate-bounce group-hover:scale-110 transition-transform",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M6 9l6 6 6-6"})})]}),n.jsx("div",{className:"flex-1 min-h-0"}),n.jsx("div",{className:"md:hidden fixed bottom-0 left-0 right-0 z-50 bg-terminal-bg border-t border-terminal-border-subtle safe-bottom",children:n.jsxs("div",{className:"flex items-center gap-3 mx-6 my-4",children:[n.jsxs("button",{type:"button",onClick:()=>r(),className:"flex-[2] inline-flex items-center justify-center gap-2.5 py-3.5 rounded-xl bg-terminal-green text-terminal-bg font-semibold shadow-lg shadow-terminal-green/20 transition-all",children:[n.jsx("span",{className:"text-base",children:"▶"}),n.jsx("span",{className:"text-sm font-sans",children:"Watch Replay"})]}),i&&n.jsxs("button",{type:"button",onClick:i,className:"flex-1 inline-flex items-center justify-center gap-2 py-3.5 rounded-xl bg-terminal-surface border border-terminal-border-subtle hover:border-terminal-border transition-all",children:[n.jsxs("svg",{"aria-hidden":"true",className:"w-3.5 h-3.5 text-terminal-blue",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",x2:"18",y1:"20",y2:"10"}),n.jsx("line",{x1:"12",x2:"12",y1:"20",y2:"4"}),n.jsx("line",{x1:"6",x2:"6",y1:"20",y2:"14"})]}),n.jsx("span",{className:"text-sm font-sans font-medium text-terminal-dim",children:"Insights"})]})]})})]})}function kh({scenes:l,currentIndex:r,onSeek:i,overlayActions:o,turnStats:u}){const m=y.useMemo(()=>{const g=[];let f=null,x=0;return l.forEach((h,v)=>{if(h.type==="user-prompt"){f&&(f.endIndex=v-1,g.push(f)),x++;const j=o?.getEffectiveContent(v)??h.content;f={kind:"turn",turnNumber:x,promptIndex:v,prompt:j.replace(/\n/g," ").slice(0,120),toolCalls:0,toolNames:[],thinkingBlocks:0,textBlocks:0,subAgentCalls:0,endIndex:v}}else h.type==="compaction-summary"||h.type==="context-injection"?(f&&(f.endIndex=v-1,g.push(f),f=null),g.push({kind:h.type==="context-injection"?"injection":"compaction",promptIndex:v,preview:h.content.replace(/\n/g," ").slice(0,80)})):f&&(f.endIndex=v,h.type==="tool-call"?(f.toolCalls++,h.toolName==="Agent"&&h.subAgent&&f.subAgentCalls++,f.toolNames.includes(h.toolName)||f.toolNames.push(h.toolName)):h.type==="thinking"?f.thinkingBlocks++:h.type==="text-response"&&f.textBlocks++)}),f&&g.push(f),g},[l,o?.getEffectiveContent]),p=y.useMemo(()=>{for(let g=m.length-1;g>=0;g--)if(r>=m[g].promptIndex)return g;return-1},[m,r]);return n.jsx("div",{className:"flex flex-col gap-1 p-3.5 overflow-y-auto",children:m.map((g,f)=>{const x=f===p,h=f<p;if(g.kind==="compaction"||g.kind==="injection"){const v=g.kind==="injection"?"System context":"Context compacted",C=g.kind==="injection"?"⚡":"⟳";return n.jsx("button",{onClick:()=>i(g.promptIndex),className:`text-left px-3 py-2 rounded-lg transition-all duration-200 ease-material ${x?"bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm":"hover:bg-terminal-surface-hover text-terminal-dimmer hover:text-terminal-dim"}`,children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer shrink-0",children:C}),n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer italic truncate",children:v})]})},`c-${g.promptIndex}`)}return n.jsxs("button",{onClick:()=>i(g.promptIndex),className:`group text-left px-3 py-2.5 rounded-xl transition-all duration-200 ease-material ${x?"bg-terminal-green-subtle border-l-2 border-terminal-green shadow-layer-sm":h?"hover:bg-terminal-surface-hover text-terminal-dim hover:text-terminal-text":"hover:bg-terminal-surface-hover"}`,children:[n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx("span",{className:`text-xs font-mono font-semibold shrink-0 mt-px tabular-nums ${x?"text-terminal-green":"text-terminal-dim"}`,children:String(g.turnNumber).padStart(2,"0")}),n.jsx("span",{className:"text-sm font-mono leading-snug line-clamp-2 text-terminal-text",children:g.prompt})]}),n.jsxs("div",{className:"flex items-center gap-2 mt-1.5 ml-6 flex-wrap",children:[g.toolCalls>0&&n.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-px rounded-full bg-terminal-orange-subtle text-terminal-orange",children:[g.toolCalls," tool",g.toolCalls>1?"s":""]}),g.subAgentCalls>0&&n.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-px rounded-full bg-green-500/20 text-green-300",children:[g.subAgentCalls," agent",g.subAgentCalls>1?"s":""]}),g.textBlocks>0&&n.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-px rounded-full bg-terminal-blue-subtle text-terminal-blue",children:[g.textBlocks," resp"]}),g.thinkingBlocks>0&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-px rounded-full bg-terminal-purple-subtle text-terminal-purple",children:"think"}),(()=>{const v=u?.[g.turnNumber-1];return v?.durationMs?n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:vt(v.durationMs)}):null})()]}),x&&g.toolNames.length>0&&n.jsx("div",{className:"mt-1.5 ml-6 text-xs font-mono text-terminal-dim truncate",children:g.toolNames.join(", ")})]},`t-${g.promptIndex}`)})})}function F1(l){switch(l.type){case"user-prompt":return l.content;case"compaction-summary":return l.content;case"context-injection":return l.content;case"thinking":return l.content;case"text-response":return l.content;case"tool-call":return[l.toolName,JSON.stringify(l.input),l.result||"",l.bashOutput?.command||"",l.bashOutput?.stdout||""].join(" ");default:return""}}function Z1(l,r){const i=l.toLowerCase().indexOf(r.toLowerCase());if(i===-1)return l.slice(0,120);const o=Math.max(0,i-40),u=Math.min(l.length,i+r.length+60);return(o>0?"...":"")+l.slice(o,u)+(u<l.length?"...":"")}const V1={"user-prompt":"User","compaction-summary":"Compaction","context-injection":"Injection",thinking:"Thinking","text-response":"Response","tool-call":"Tool"},Q1={"user-prompt":"text-terminal-green","compaction-summary":"text-terminal-dim","context-injection":"text-blue-400",thinking:"text-terminal-purple","text-response":"text-terminal-blue","tool-call":"text-terminal-orange"};function X1({scenes:l,open:r,onClose:i,onSeek:o}){const[u,m]=y.useState(""),[p,g]=y.useState(0),f=y.useRef(null),x=y.useRef(null);y.useEffect(()=>{r&&(m(""),g(0),setTimeout(()=>f.current?.focus(),50))},[r]);const h=y.useMemo(()=>{if(u.length<2)return[];const j=u.toLowerCase(),w=[];for(let S=0;S<l.length;S++){const k=l[S],E=F1(k);if(E.toLowerCase().includes(j)&&w.push({sceneIndex:S,type:k.type,snippet:Z1(E,u),toolName:k.type==="tool-call"?k.toolName:void 0}),w.length>=50)break}return w},[l,u]);y.useEffect(()=>{if(!x.current)return;x.current.children[p]?.scrollIntoView({block:"nearest"})},[p]);const v=y.useCallback(j=>{const w=h[j];w&&(o(w.sceneIndex),i())},[h,o,i]),C=y.useCallback(j=>{j.key==="ArrowDown"?(j.preventDefault(),g(w=>Math.min(w+1,h.length-1))):j.key==="ArrowUp"?(j.preventDefault(),g(w=>Math.max(w-1,0))):j.key==="Enter"?(j.preventDefault(),v(p)):j.key==="Escape"&&i()},[h.length,p,v,i]);return r?n.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[8vh] sm:pt-[15vh]",onClick:i,role:"dialog","aria-label":"Search scenes","aria-modal":"true",children:[n.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),n.jsxs("div",{className:"relative w-full max-w-xl mx-3 sm:mx-0 bg-terminal-bg border border-terminal-border-subtle rounded-2xl shadow-layer-xl overflow-hidden",onClick:j=>j.stopPropagation(),onKeyDown:C,children:[n.jsxs("div",{className:"flex items-center gap-3 px-5 py-3.5 border-b border-terminal-border-subtle",children:[n.jsx("span",{className:"text-terminal-dim text-sm",children:"🔍"}),n.jsx("input",{ref:f,type:"text",value:u,onChange:j=>{m(j.target.value),g(0)},placeholder:"Search scenes...","aria-label":"Search scenes",className:"flex-1 bg-transparent text-sm font-sans font-medium text-terminal-text placeholder-terminal-dim outline-none"}),n.jsx("kbd",{className:"text-[10px] font-mono text-terminal-dimmer bg-terminal-surface px-2 py-0.5 rounded-md",children:"ESC"})]}),n.jsx("div",{ref:x,className:"max-h-[50vh] overflow-y-auto",children:u.length<2?n.jsx("div",{className:"px-4 py-8 text-center text-xs font-sans font-medium text-terminal-dim",children:"Type at least 2 characters to search"}):h.length===0?n.jsxs("div",{className:"px-4 py-8 text-center text-xs font-sans font-medium text-terminal-dim",children:['No results for "',u,'"']}):h.map((j,w)=>n.jsxs("button",{onClick:()=>v(w),className:`w-full text-left px-4 py-2.5 flex items-start gap-3 transition-colors ${w===p?"bg-terminal-green/10":"hover:bg-terminal-surface/50"}`,children:[n.jsx("span",{className:`text-[10px] font-sans font-bold uppercase shrink-0 mt-0.5 tracking-wider ${Q1[j.type]||"text-terminal-dim"}`,children:j.toolName||V1[j.type]||j.type}),n.jsx("span",{className:"text-xs font-mono text-terminal-text line-clamp-2 break-words",children:I1(j.snippet,u)}),n.jsxs("span",{className:"text-xs font-mono text-terminal-dimmer shrink-0 mt-0.5",children:["#",j.sceneIndex]})]},j.sceneIndex))}),h.length>0&&n.jsxs("div",{className:"px-4 py-2 border-t border-terminal-border-subtle text-[10px] font-sans font-bold uppercase tracking-wider text-terminal-dimmer flex gap-4",children:[n.jsxs("span",{children:[h.length," result",h.length!==1?"s":""]}),n.jsx("span",{children:"↑↓ navigate"}),n.jsx("span",{children:"↵ select"})]})]})]}):null}function I1(l,r){if(!r)return l;const i=[],o=l.toLowerCase(),u=r.toLowerCase();let m=0,p=o.indexOf(u);for(;p!==-1;)p>m&&i.push(l.slice(m,p)),i.push(n.jsx("mark",{className:"bg-terminal-green/30 text-terminal-green rounded-sm px-0.5",children:l.slice(p,p+r.length)},p)),m=p+r.length,p=o.indexOf(u,m);return m<l.length&&i.push(l.slice(m)),i}function J1(l){const r=l.toLowerCase();return/\b(test|jest|vitest|pytest|cargo\s+test|mocha|spec)\b/.test(r)?"test":/\b(build|compile|tsc|webpack|vite\s+build|rollup)\b/.test(r)?"build":r.trimStart().startsWith("git ")?"git":/\b(lint|biome|eslint|prettier|format)\b/.test(r)?"lint":"other"}function K1(l){return l?{sqlite:"SQLite (store.db)","global-state":"SQLite (global state.vscdb)",jsonl:"JSONL transcript","jsonl+tools":"JSONL + agent-tools"}[l]||l:"unknown"}function jx(l,r){if(!l)return;if(!r||r.length<=1)return[l];const i=[...r],o=i.lastIndexOf(l);return o>=0&&o!==i.length-1&&(i.splice(o,1),i.push(l)),i}function P1(l,r){const i=jx(l,r);if(i)return i.length>1?`${i[0]} → ${i[i.length-1]}`:i[0]}function W1(l,r){return jx(l,r)?.join(" → ")}function wx(l){const[r,i]=y.useState(null),o=y.useRef(null),u=y.useCallback(p=>{const g=o.current;if(!g||l<=1)return;const f=g.getBoundingClientRect(),x=(p.clientX-f.left)/f.width,h=Math.round(x*(l-1));i(Math.max(0,Math.min(l-1,h)))},[l]),m=y.useCallback(()=>i(null),[]);return{hovered:r,ref:o,onMouseMove:u,onMouseLeave:m}}function ej({session:l}){const{meta:r,scenes:i}=l,o=y.useMemo(()=>Uh(r),[r]),u=y.useMemo(()=>Wb(r),[r]),m=y.useMemo(()=>{const f=[];let x=0,h=0;const v=new Map,C=z=>{let Q=v.get(z);return Q||(Q={path:z,editCount:0,readCount:0,linesAdded:0,linesRemoved:0,turnEdits:new Map},v.set(z,Q)),Q},j=new Map,w=new Map;let S=0,k=0,E=0,M=0,A=0,R=0;const O=[],$=()=>{if(f.length>0){const z=f[f.length-1];z.toolCount=x,z.errorCount=h}};for(let z=0;z<i.length;z++){const Q=i[z];switch(Q.type){case"user-prompt":{$(),x=0,h=0,E+=Q.content.length;const ne=Q.content.split(`
|
|
154
|
+
`).find(W=>W.trim())||"";f.push({index:f.length+1,text:ne.slice(0,120),sceneIndex:z,toolCount:0,errorCount:0});break}case"thinking":S+=Q.content.length;break;case"text-response":k+=Q.content.length;break;case"tool-call":{x++;const ne=Q.toolName;if(j.set(ne,(j.get(ne)||0)+1),ne==="Read"){const W=Q.input?.file_path;W&&C(W).readCount++}else if(ne==="Edit"||ne==="Write"){if(Q.diff){const W=C(Q.diff.filePath);W.editCount++;const T=f.length;W.turnEdits.set(T,(W.turnEdits.get(T)||0)+1);const _=Q.diff.oldContent?Q.diff.oldContent.split(`
|
|
155
|
+
`).length:0,V=Q.diff.newContent?Q.diff.newContent.split(`
|
|
156
|
+
`).length:0;W.linesAdded+=Math.max(0,V-_),W.linesRemoved+=Math.max(0,_-V)}}else if(ne==="Agent"&&Q.subAgent){const W=Q.subAgent,T=W.tokenUsage,_=T?T.inputTokens+T.outputTokens+T.cacheCreationTokens+T.cacheReadTokens:0;A+=W.toolCalls,R+=_,O.push({agentType:W.agentType,description:W.description,toolCalls:W.toolCalls,thinkingBlocks:W.thinkingBlocks,textResponses:W.textResponses,totalTokens:_,model:W.model,sceneCount:W.scenes.length});for(const V of W.scenes)if(V.type==="tool-call"&&V.diff){const J=C(V.diff.filePath);J.editCount++;const P=f.length;J.turnEdits.set(P,(J.turnEdits.get(P)||0)+1);const he=V.diff.oldContent?V.diff.oldContent.split(`
|
|
157
|
+
`).length:0,G=V.diff.newContent?V.diff.newContent.split(`
|
|
158
|
+
`).length:0;J.linesAdded+=Math.max(0,G-he),J.linesRemoved+=Math.max(0,he-G)}}else if(ne==="Bash"){if(Q.bashOutput){const W=J1(Q.bashOutput.command);w.set(W,(w.get(W)||0)+1)}if(Q.isError)h++,M++;else if(!("isError"in Q)){const W=Q.result?.slice(0,500).toLowerCase()||"";/\b(error|fail|exception|errno)\b/.test(W)&&(h++,M++)}}break}}}$();const H=[...v.values()],K=H.filter(z=>z.editCount>0).sort((z,Q)=>Q.editCount-z.editCount),ae=H.filter(z=>z.editCount===0&&z.readCount>0).sort((z,Q)=>Q.readCount-z.readCount),ue=[...j.entries()].sort((z,Q)=>Q[1]-z[1]).slice(0,8),oe=[...w.entries()].sort((z,Q)=>Q[1]-z[1]),te=[...j.values()].reduce((z,Q)=>z+Q,0),xe=(j.get("Read")||0)+(j.get("Grep")||0)+(j.get("Glob")||0),de=(j.get("Edit")||0)+(j.get("Write")||0),pe=j.get("Bash")||0,U={read:xe,write:de,execute:pe,other:te-xe-de-pe};return{totalScenes:i.length,userPrompts:r.stats.userPrompts,toolCalls:r.stats.toolCalls,thinkingChars:S,responseChars:k,promptChars:E,durationMs:r.stats.durationMs,tokenUsage:r.stats.tokenUsage,costEstimate:r.stats.costEstimate,turns:f,editedFiles:K,readOnlyFiles:ae,topTools:ue,bashCats:oe,activityDist:U,totalTools:te,totalBashErrors:M,subAgents:O,totalDelegatedTools:A,totalDelegatedTokens:R}},[i,r]),p=r.stats.turnStats&&r.stats.turnStats.length>1,g=y.useMemo(()=>m.turns.map(f=>f.text.slice(0,60)+(f.text.length>60?"…":"")),[m.turns]);return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"p-6 space-y-6 max-w-4xl mx-auto",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("h2",{className:"text-sm font-mono font-semibold text-terminal-text truncate",children:r.title||r.slug}),r.provider&&n.jsx("span",{className:"shrink-0 text-[10px] font-mono text-terminal-dimmer px-1.5 py-0.5 rounded bg-terminal-surface border border-terminal-border-subtle",children:r.provider}),o.length>0&&n.jsx(Ea,{title:o.join(`
|
|
159
|
+
`),className:"shrink-0"}),r.gitBranch&&n.jsx("span",{className:"shrink-0 text-[10px] font-mono text-terminal-purple px-1.5 py-0.5 rounded bg-terminal-purple/10 border border-terminal-purple/20",title:W1(r.gitBranch,r.gitBranches),children:P1(r.gitBranch,r.gitBranches)}),r.permissionMode==="bypassPermissions"&&n.jsx("span",{className:"shrink-0 text-[10px] font-mono text-terminal-orange px-1.5 py-0.5 rounded bg-terminal-orange/10 border border-terminal-orange/20",children:"dangerous mode"})]}),o.length>0&&n.jsxs("div",{className:"rounded border border-terminal-orange/40 bg-terminal-orange/10 px-3 py-2",children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-orange uppercase tracking-widest mb-1",children:"Data Quality"}),n.jsx("div",{className:"space-y-0.5",children:o.slice(0,4).map(f=>n.jsx("div",{className:"text-xs font-mono text-terminal-dim",children:f},f))})]}),(r.dataSource||r.dataSourceInfo)&&n.jsxs("div",{className:"rounded border border-terminal-border-subtle bg-terminal-surface/40 px-3 py-2",children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Data Source"}),n.jsx("div",{className:"text-xs font-mono text-terminal-text",children:K1(r.dataSourceInfo?.primary||r.dataSource)}),r.dataSourceInfo?.sources&&r.dataSourceInfo.sources.length>0&&n.jsx("div",{className:"mt-1 space-y-0.5",children:r.dataSourceInfo.sources.map(f=>n.jsxs("div",{className:"text-xs font-mono text-terminal-dim truncate",title:f,children:[n.jsx("span",{className:"text-terminal-green",children:"source:"})," ",f]},f))}),r.dataSourceInfo?.supplements&&r.dataSourceInfo.supplements.length>0&&n.jsx("div",{className:"mt-1 space-y-0.5",children:r.dataSourceInfo.supplements.map(f=>n.jsxs("div",{className:"text-xs font-mono text-terminal-dim truncate",title:f,children:[n.jsx("span",{className:"text-terminal-purple",children:"supplement:"})," ",f]},f))})]}),r.provider==="cursor"&&r.cursorSidecars&&(r.cursorSidecars.requestContextCount||r.cursorSidecars.checkpointCount||r.cursorSidecars.hasWorkspaceRules)&&n.jsxs("div",{className:"rounded border border-terminal-border-subtle bg-terminal-surface/40 px-3 py-2",children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Cursor Sidecars"}),n.jsxs("div",{className:"space-y-0.5 text-xs font-mono text-terminal-dim",children:[r.cursorSidecars.requestContextCount?n.jsxs("div",{children:[n.jsx("span",{className:"text-terminal-green",children:"request context:"})," ",r.cursorSidecars.requestContextCount," sidecar",r.cursorSidecars.requestContextCount===1?"":"s"]}):null,r.cursorSidecars.hasWorkspaceRules?n.jsxs("div",{children:[n.jsx("span",{className:"text-terminal-purple",children:"workspace rules:"})," included"]}):null,r.cursorSidecars.checkpointCount?n.jsxs("div",{children:[n.jsx("span",{className:"text-terminal-orange",children:"checkpoint state:"})," ",r.cursorSidecars.checkpointCount," entr",r.cursorSidecars.checkpointCount===1?"y":"ies"]}):null]})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-3",children:"Overview"}),n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[n.jsx(Ul,{label:"Turns",value:m.userPrompts,color:"text-terminal-green"}),n.jsx(Ul,{label:"Tool Calls",value:m.toolCalls,color:"text-terminal-orange"}),n.jsx(Ul,{label:"Files Modified",value:m.editedFiles.length,color:"text-terminal-blue"}),n.jsx(Ul,{label:"Scenes",value:m.totalScenes,color:"text-terminal-text"})]}),m.totalDelegatedTools>0&&n.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs font-mono text-terminal-dim bg-green-500/5 border border-green-500/15 rounded-lg px-3 py-2",children:[n.jsxs("span",{className:"text-green-300",children:["+",m.totalDelegatedTools," tools delegated"]}),n.jsxs("span",{className:"text-terminal-dimmer",children:["to ",m.subAgents.length," sub-agent",m.subAgents.length>1?"s":""]}),m.totalDelegatedTokens>0&&n.jsxs("span",{className:"text-terminal-dimmer",children:["(",m.totalDelegatedTokens>1e6?`${(m.totalDelegatedTokens/1e6).toFixed(1)}M`:`${(m.totalDelegatedTokens/1e3).toFixed(0)}K`," ","tokens, context-free)"]})]}),n.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 mt-3 text-xs font-mono text-terminal-dim",children:[r.model&&n.jsxs("div",{children:["Model: ",n.jsx("span",{className:"text-terminal-text font-semibold",children:r.model})]}),(m.durationMs||u.duration)&&n.jsxs("div",{children:["Duration:"," ",n.jsx("span",{className:"text-terminal-text",children:m.durationMs?vt(m.durationMs):"unavailable"}),u.duration&&n.jsx(Ea,{title:u.duration,className:"ml-1"})]}),m.costEstimate!==void 0&&n.jsxs("div",{children:["Cost:"," ",n.jsxs("span",{className:"text-terminal-green",children:["$",m.costEstimate<.01?m.costEstimate.toFixed(4):m.costEstimate.toFixed(2)]}),n.jsx("span",{className:"text-terminal-dimmer",children:" (est.)"}),u.tokens&&n.jsx(Ea,{title:u.tokens,className:"ml-1"})]}),m.tokenUsage?n.jsxs(n.Fragment,{children:[n.jsxs("div",{children:["In:"," ",n.jsx("span",{className:"text-terminal-blue",children:Ht(m.tokenUsage.inputTokens)})," / ","Out:"," ",n.jsx("span",{className:"text-terminal-green",children:Ht(m.tokenUsage.outputTokens)})]}),n.jsxs("div",{children:["Cache:"," ",n.jsx("span",{className:"text-terminal-purple",children:Ht(m.tokenUsage.cacheReadTokens)})," ","read /"," ",n.jsx("span",{className:"text-terminal-orange",children:Ht(m.tokenUsage.cacheCreationTokens)})," ","created"]})]}):u.tokens&&n.jsxs("div",{children:["Tokens: ",n.jsx("span",{className:"text-terminal-text",children:"unavailable"}),n.jsx(Ea,{title:u.tokens,className:"ml-1"})]}),!p&&u.turnStats&&n.jsxs("div",{children:["Turn Stats: ",n.jsx("span",{className:"text-terminal-text",children:"limited"}),n.jsx(Ea,{title:u.turnStats,className:"ml-1"})]})]})]}),p&&n.jsxs("div",{className:"space-y-5",children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest",children:"Per-Turn Metrics"}),n.jsx(nj,{turnStats:r.stats.turnStats,costEstimate:r.stats.costEstimate,turnLabels:g}),n.jsx(lj,{turnStats:r.stats.turnStats,turnLabels:g}),m.turns.length>=2&&n.jsx(ij,{turns:m.turns,turnLabels:g}),r.stats.turnStats.some(f=>f.durationMs)&&n.jsx(sj,{turnStats:r.stats.turnStats,turnLabels:g})]}),r.tokenUsageByModel&&Object.keys(r.tokenUsageByModel).length>1&&n.jsx(rj,{tokenUsageByModel:r.tokenUsageByModel}),r.apiErrors&&r.apiErrors.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"API Issues"}),n.jsx("div",{className:"text-xs font-mono text-terminal-dim space-y-1",children:(()=>{const f=r.apiErrors,x=Math.max(0,...f.map(j=>j.retryAttempt||0)),h=f.some(j=>j.errorType==="overloaded_error"||j.statusCode===529),v=f.some(j=>j.errorType==="rate_limit_error"||j.statusCode===429),C=[];return h&&C.push("API was overloaded"),v&&C.push("hit rate limits"),C.length===0&&C.push("API errors occurred"),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-terminal-text",children:[C.join(" and ")," ",n.jsxs("span",{className:"text-terminal-red",children:[f.length," times"]})," during this session",x>1&&n.jsxs(n.Fragment,{children:[", with up to"," ",n.jsxs("span",{className:"text-terminal-orange",children:[x," retries"]})," in a row"]}),"."]}),n.jsx("div",{className:"text-terminal-dimmer",children:x>0?"Cursor automatically retried some of these errors.":"These errors were observed in local Cursor metadata."})]})})()})]}),r.trackedFiles&&r.trackedFiles.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["Files Tracked (",r.trackedFiles.length,")"]}),n.jsx("div",{className:"space-y-0.5 max-h-[200px] overflow-y-auto",children:r.trackedFiles.map(f=>n.jsx("div",{className:"text-[10px] font-mono text-terminal-dim truncate px-2 py-0.5 rounded hover:bg-terminal-surface-hover",title:f,children:f},f))})]}),r.contextFiles&&r.contextFiles.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["Context Files (inferred, ",r.contextFiles.length,")"]}),n.jsx("div",{className:"space-y-0.5 max-h-[200px] overflow-y-auto",children:r.contextFiles.map(f=>n.jsx("div",{className:"text-[10px] font-mono text-terminal-dim truncate px-2 py-0.5 rounded hover:bg-terminal-surface-hover",title:f,children:f},f))})]}),r.prLinks&&r.prLinks.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Pull Requests"}),n.jsx("div",{className:"space-y-1",children:r.prLinks.map(f=>n.jsxs("a",{href:f.prUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-xs font-mono text-terminal-blue hover:underline px-2 py-1 rounded hover:bg-terminal-surface-hover transition-colors",children:[n.jsxs("span",{className:"text-terminal-green",children:["#",f.prNumber]}),f.prRepository&&n.jsx("span",{className:"text-terminal-dimmer truncate",children:f.prRepository})]},f.prUrl))})]}),m.turns.length>0&&n.jsx(cj,{turns:m.turns,turnStats:r.stats.turnStats}),n.jsx(oj,{editedFiles:m.editedFiles,turns:m.turns}),(m.editedFiles.length>0||m.readOnlyFiles.length>0)&&n.jsx(dj,{editedFiles:m.editedFiles,readOnlyFiles:m.readOnlyFiles}),m.bashCats.length>1&&n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["Bash Commands",m.totalBashErrors>0&&n.jsxs("span",{className:"text-terminal-red ml-2 normal-case tracking-normal",children:[m.totalBashErrors," error",m.totalBashErrors!==1?"s":""]})]}),n.jsx("div",{className:"flex flex-wrap gap-2",children:m.bashCats.map(([f,x])=>n.jsxs("span",{className:"text-xs font-mono text-terminal-dim bg-terminal-surface rounded px-2 py-1",children:[f," ",n.jsx("span",{className:"text-terminal-text tabular-nums",children:x})]},f))})]}),m.topTools.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Top Tools"}),n.jsx("div",{className:"space-y-1.5",children:m.topTools.map(([f,x])=>n.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[n.jsx("span",{className:"text-terminal-text shrink-0 w-24 text-right truncate",title:f,children:f}),n.jsx("div",{className:"flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-terminal-orange",style:{width:`${x/m.topTools[0][1]*100}%`}})}),n.jsx("span",{className:"text-terminal-dim shrink-0 w-6 text-right tabular-nums",children:x})]},f))})]}),m.subAgents.length>0&&n.jsx(tj,{subAgents:m.subAgents}),m.totalTools>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Activity Distribution"}),n.jsx("div",{className:"space-y-1.5",children:[["Read/Search",m.activityDist.read,"--blue"],["Write/Edit",m.activityDist.write,"--green"],["Execute",m.activityDist.execute,"--purple"],["Other",m.activityDist.other,"--dim"]].filter(([,f])=>f>0).map(([f,x,h])=>n.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[n.jsx("span",{className:"text-terminal-text shrink-0 w-24 text-right",children:f}),n.jsx("div",{className:"flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full",style:{width:`${x/m.totalTools*100}%`,backgroundColor:`var(${h})`}})}),n.jsxs("span",{className:"text-terminal-dim shrink-0 w-16 text-right tabular-nums",children:[x," (",Math.round(x/m.totalTools*100),"%)"]})]},f))})]})]})})}const Ch={Explore:"bg-blue-500/20 text-blue-300 border-blue-500/30",Plan:"bg-purple-500/20 text-purple-300 border-purple-500/30",Shell:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30","general-purpose":"bg-green-500/20 text-green-300 border-green-500/30","claude-code-guide":"bg-amber-500/20 text-amber-300 border-amber-500/30"};function tj({subAgents:l}){const r=new Map;let i=0,o=0;for(const m of l){const p=r.get(m.agentType)||{count:0,toolCalls:0,totalTokens:0};p.count++,p.toolCalls+=m.toolCalls,p.totalTokens+=m.totalTokens,r.set(m.agentType,p),i+=m.toolCalls,o+=m.totalTokens}const u=[...r.entries()].sort((m,p)=>p[1].count-m[1].count);return n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["Sub-Agents (",l.length,")"]}),n.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:u.map(([m,p])=>{const g=Ch[m]||"bg-gray-500/20 text-gray-300 border-gray-500/30";return n.jsxs("span",{className:`text-[11px] px-2 py-1 rounded border font-mono ${g}`,children:[m," ",n.jsxs("span",{className:"opacity-70",children:["x",p.count," (",p.toolCalls," tools)"]})]},m)})}),n.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs font-mono text-terminal-dim",children:[n.jsxs("div",{children:["Delegated tools: ",n.jsx("span",{className:"text-terminal-text",children:i})]}),o>0&&n.jsxs("div",{children:["Delegated tokens:"," ",n.jsx("span",{className:"text-terminal-text",children:o>1e6?`${(o/1e6).toFixed(1)}M`:o>1e3?`${(o/1e3).toFixed(0)}K`:o}),n.jsx("span",{className:"text-terminal-dimmer",children:" (context-free)"})]})]}),n.jsxs("div",{className:"mt-2 space-y-1",children:[l.slice(0,20).map((m,p)=>n.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-mono text-terminal-dim px-2 py-1 rounded bg-terminal-surface",children:[n.jsx("span",{className:`px-1 py-0.5 rounded border text-[9px] ${Ch[m.agentType]||"bg-gray-500/20 text-gray-300 border-gray-500/30"}`,children:m.agentType}),n.jsx("span",{className:"truncate flex-1 text-terminal-text/70",children:m.description||"(no description)"}),n.jsxs("span",{className:"shrink-0",children:[m.toolCalls," tools"]}),m.totalTokens>0&&n.jsxs("span",{className:"shrink-0 text-terminal-dimmer",children:[m.totalTokens>1e3?`${(m.totalTokens/1e3).toFixed(0)}K`:m.totalTokens," ","tok"]})]},p)),l.length>20&&n.jsxs("div",{className:"text-[10px] text-terminal-dimmer font-mono px-2",children:["... and ",l.length-20," more"]})]})]})}function Oi({children:l,visible:r,x:i}){if(!r)return null;const o=i>.7;return n.jsx("div",{className:"absolute top-1 pointer-events-none z-10",style:{left:o?void 0:`${i*100}%`,right:o?`${(1-i)*100}%`:void 0},children:n.jsx("div",{className:`bg-terminal-surface border border-terminal-border-subtle rounded px-2 py-1 text-[10px] font-mono text-terminal-text shadow-md whitespace-nowrap ${o?"text-right":""}`,children:l})})}function nj({turnStats:l,costEstimate:r,turnLabels:i}){const o=[];let u=0;for(const S of l)u+=S.tokenUsage?.outputTokens||0,o.push(u);const m=o.length,{hovered:p,ref:g,onMouseMove:f,onMouseLeave:x}=wx(m);if(u===0)return null;const h=o[o.length-1],v=60,C=100,j=o.map((S,k)=>{const E=m===1?C/2:k/(m-1)*C,M=v-S/h*(v-6)-3;return`${E},${M}`}),w=p!==null?m===1?.5:p/(m-1):0;return n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:["Token Burn",r?" & Cost":""]}),n.jsxs("div",{className:"relative",children:[n.jsxs("svg",{ref:g,viewBox:`0 0 ${C} ${v}`,preserveAspectRatio:"none",className:"w-full h-20",onMouseMove:f,onMouseLeave:x,children:[n.jsx("polygon",{points:`0,${v} ${j.join(" ")} ${C},${v}`,style:{fill:"var(--green-subtle)"}}),n.jsx("polyline",{points:j.join(" "),fill:"none",style:{stroke:"var(--green)"},strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),p!==null&&n.jsx("line",{x1:w*C,y1:"0",x2:w*C,y2:v,stroke:"var(--dim)",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke",opacity:"0.5"})]}),n.jsx(Oi,{visible:p!==null,x:w,children:p!==null&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-terminal-green",children:["Turn ",p+1]}),i?.[p]&&n.jsx("div",{className:"text-terminal-dim truncate max-w-[200px]",children:i[p]}),n.jsxs("div",{children:["cumulative: ",Ht(o[p])," tokens"]}),l[p]?.tokenUsage&&n.jsxs("div",{className:"text-terminal-dimmer",children:["this turn: +",Ht(l[p].tokenUsage.outputTokens)," out"]})]})})]}),n.jsxs("div",{className:"flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5",children:[n.jsx("span",{children:"Turn 1"}),n.jsxs("span",{children:[Ht(h)," tokens",r?` ($${r<1?r.toFixed(2):r.toFixed(0)})`:""]}),n.jsxs("span",{children:["Turn ",m]})]}),l.some(S=>S.tokenUsage?.cacheReadTokens)&&n.jsx(aj,{turnStats:l})]})}function aj({turnStats:l}){const r=l.map(p=>{const g=p.tokenUsage;if(!g)return 0;const f=(g.cacheReadTokens||0)+(g.inputTokens||0);return f>0?g.cacheReadTokens/f:0}),i=24,o=100,u=r.map((p,g)=>{const f=r.length===1?o/2:g/(r.length-1)*o,x=i-p*(i-4)-2;return`${f},${x}`}),m=r.reduce((p,g)=>p+g,0)/r.length;return n.jsxs("div",{className:"mt-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest",children:"Cache Hit Rate"}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-purple",children:["avg ",Math.round(m*100),"%"]})]}),n.jsx("svg",{viewBox:`0 0 ${o} ${i}`,preserveAspectRatio:"none",className:"w-full h-6",children:n.jsx("polyline",{points:u.join(" "),fill:"none",style:{stroke:"var(--purple)"},strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})})]})}function lj({turnStats:l,turnLabels:r}){const i=l.map(S=>S.contextTokens||0),o=i.length,{hovered:u,ref:m,onMouseMove:p,onMouseLeave:g}=wx(o);if(!i.some(S=>S>0))return null;const f=Math.max(...i),x=f,h=60,v=100,C=i.map((S,k)=>{const E=o===1?v/2:k/(o-1)*v,M=h-S/x*(h-6)-3;return`${E},${M}`}),j=[];for(let S=0;S<i.length-1;S++){const k=i[S],E=i[S+1];k>0&&E>0&&E<k*.5&&j.push(S)}const w=u!==null?o===1?.5:u/(o-1):0;return n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Context Window Usage"}),n.jsxs("div",{className:"relative",children:[n.jsxs("svg",{ref:m,viewBox:`0 0 ${v} ${h}`,preserveAspectRatio:"none",className:"w-full h-20",onMouseMove:p,onMouseLeave:g,children:[n.jsx("polygon",{points:`0,${h} ${C.join(" ")} ${v},${h}`,style:{fill:"var(--cyan-subtle)"}}),n.jsx("polyline",{points:C.join(" "),fill:"none",style:{stroke:"var(--cyan)"},strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),j.map(S=>{const k=o===1?v/2:S/(o-1)*v;return n.jsx("line",{x1:k,y1:"0",x2:k,y2:h,style:{stroke:"var(--red)"},strokeWidth:"1",strokeDasharray:"2,1",vectorEffect:"non-scaling-stroke",opacity:"0.6"},S)}),u!==null&&n.jsx("line",{x1:w*v,y1:"0",x2:w*v,y2:h,stroke:"var(--dim)",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke",opacity:"0.5"})]}),n.jsx(Oi,{visible:u!==null,x:w,children:u!==null&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-terminal-cyan",children:["Turn ",u+1]}),r?.[u]&&n.jsx("div",{className:"text-terminal-dim truncate max-w-[200px]",children:r[u]}),n.jsxs("div",{children:[Ht(i[u])," tokens"]})]})})]}),n.jsxs("div",{className:"flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5",children:[n.jsx("span",{children:"Turn 1"}),n.jsxs("span",{children:["peak ",Ht(f)]}),n.jsxs("span",{children:["Turn ",o]})]}),j.length>0&&n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx("span",{className:"inline-block w-3 border-t border-dashed",style:{borderColor:"var(--red)"}}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:[j.length," compaction",j.length!==1?"s":""]})]})]})}function sj({turnStats:l,turnLabels:r}){const i=l.map(g=>g.durationMs||0),o=Math.max(...i,1),u=i.some(g=>g>0),[m,p]=y.useState(null);return u?n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Turn Duration"}),n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"flex items-end gap-px h-16",onMouseLeave:()=>p(null),children:i.map((g,f)=>{const x=g>0?Math.max(g/o*100,4):0;return n.jsx("div",{className:"flex-1 rounded-t-sm cursor-default",style:{height:`${x}%`,backgroundColor:g>0?"var(--blue)":"var(--surface)",opacity:m===f?1:g>0?.5+g/o*.5:.2},onMouseEnter:()=>p(f)},f)})}),n.jsx(Oi,{visible:m!==null,x:m!==null?i.length===1?.5:m/(i.length-1):0,children:m!==null&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-terminal-blue",children:["Turn ",m+1]}),r?.[m]&&n.jsx("div",{className:"text-terminal-dim truncate max-w-[200px]",children:r[m]}),n.jsx("div",{children:i[m]>0?vt(i[m]):"no data"})]})})]}),n.jsxs("div",{className:"flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5",children:[n.jsx("span",{children:"Turn 1"}),n.jsxs("span",{children:["max ",vt(o)]}),n.jsxs("span",{children:["Turn ",i.length]})]})]}):null}function rj({tokenUsageByModel:l}){const r=Object.entries(l).sort((u,m)=>m[1].outputTokens-u[1].outputTokens),i=r.reduce((u,[,m])=>u+m.outputTokens,0);if(i===0)return null;const o=["--green","--blue","--purple","--orange","--red"];return n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Model Breakdown"}),n.jsx("div",{className:"flex h-3 rounded-full overflow-hidden gap-px",children:r.map(([u,m],p)=>{const g=m.outputTokens/i*100;return n.jsx("div",{style:{width:`${g}%`,minWidth:g>2?void 0:"3px",backgroundColor:`var(${o[p%o.length]})`,opacity:.7},title:`${u}: ${Ht(m.outputTokens)} output tokens`},u)})}),n.jsx("div",{className:"flex flex-wrap gap-3 mt-1.5",children:r.map(([u,m],p)=>n.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-mono text-terminal-dimmer",children:[n.jsx("div",{className:"w-2 h-2 rounded-sm",style:{backgroundColor:`var(${o[p%o.length]})`,opacity:.7}}),n.jsxs("span",{children:[u," ",Ht(m.outputTokens)," (",Math.round(m.outputTokens/i*100),"%)"]})]},u))})]})}function ij({turns:l,turnLabels:r}){const i=l.map(p=>p.toolCount),o=Math.max(...i,1),[u,m]=y.useState(null);return l.length<2?null:n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Tool Calls per Turn"}),n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"flex items-end gap-px h-16",onMouseLeave:()=>m(null),children:i.map((p,g)=>{const f=p>0?Math.max(p/o*100,4):0;return n.jsx("div",{className:"flex-1 rounded-t-sm cursor-default",style:{height:`${f}%`,backgroundColor:p>0?"var(--orange)":"var(--surface)",opacity:u===g?1:p>0?.5+p/o*.5:.2},onMouseEnter:()=>m(g)},g)})}),n.jsx(Oi,{visible:u!==null,x:u!==null?i.length===1?.5:u/(i.length-1):0,children:u!==null&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-terminal-orange",children:["Turn ",u+1]}),r?.[u]&&n.jsx("div",{className:"text-terminal-dim truncate max-w-[200px]",children:r[u]}),n.jsxs("div",{children:[i[u]," tool calls"]})]})})]}),n.jsxs("div",{className:"flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5",children:[n.jsx("span",{children:"Turn 1"}),n.jsxs("span",{children:["max ",o]}),n.jsxs("span",{children:["Turn ",i.length]})]})]})}function oj({editedFiles:l,turns:r}){if(r.length<3||l.length<1)return null;const i=l.slice(0,8),o=60,u=r.map(f=>f.index),m=u.length>o,p=m?u.slice(-o):u;let g=1;for(const f of i)for(const x of p){const h=f.turnEdits.get(x)||0;h>g&&(g=h)}return n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["File Activity Heatmap",m&&n.jsxs("span",{className:"normal-case tracking-normal font-normal ml-2",children:["(last ",o," of ",u.length," turns)"]})]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("div",{className:"grid gap-px text-[10px] font-mono",style:{gridTemplateColumns:`minmax(80px, 120px) repeat(${p.length}, minmax(16px, 1fr))`},children:[n.jsx("div",{className:"text-terminal-dimmer px-1 py-0.5"}),p.map(f=>n.jsx("div",{className:"text-terminal-dimmer text-center py-0.5 text-[9px]",children:f},f)),i.map(f=>{const x=f.path.split("/").pop()||f.path;return[n.jsx("div",{className:"text-terminal-dim truncate px-1 py-0.5",title:f.path,children:x},`label-${f.path}`),...p.map(h=>{const v=f.turnEdits.get(h)||0,C=v===0?0:Math.round(20+Math.log1p(v)/Math.log1p(g)*60);return n.jsx("div",{className:"rounded-sm",style:{backgroundColor:v===0?"transparent":`color-mix(in srgb, var(--orange) ${C}%, transparent)`,minHeight:14},title:v>0?`${x} — Turn ${h}: ${v} edit${v!==1?"s":""}`:void 0},`${f.path}-${h}`)})]})]})})]})}const iu=20;function cj({turns:l,turnStats:r}){const[i,o]=y.useState(!1),{rows:u,compactionAfter:m}=y.useMemo(()=>{const j=Math.max(...l.map(A=>A.toolCount),1),w=Math.max(...r?.map(A=>A.durationMs||0)||[0],1),S=Math.max(...r?.map(A=>A.contextTokens||0)||[0],1),k=Math.max(...r?.map(A=>A.tokenUsage?.outputTokens||0)||[0],1),E=new Set;if(r)for(let A=0;A<r.length-1;A++){const R=r[A]?.contextTokens||0,O=r[A+1]?.contextTokens||0;R>0&&O>0&&O<R*.5&&E.add(A)}return{rows:l.map((A,R)=>{const O=r?.[R];return{...A,durationMs:O?.durationMs,contextTokens:O?.contextTokens,outputTokens:O?.tokenUsage?.outputTokens,toolRatio:A.toolCount/j,durationRatio:(O?.durationMs||0)/w,contextRatio:(O?.contextTokens||0)/S,outputRatio:(O?.tokenUsage?.outputTokens||0)/k}}),compactionAfter:E}},[l,r]),p=r&&r.length>0,g=p&&r.some(j=>j.durationMs),f=p&&r.some(j=>j.contextTokens),x=p&&r.some(j=>j.tokenUsage),h=3+(g?1:0)+(f?1:0)+(x?1:0),v=u.length>iu,C=v&&!i?u.slice(0,iu):u;return n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Per-Turn Breakdown"}),n.jsx("div",{className:"overflow-x-auto rounded border border-terminal-border-subtle",children:n.jsxs("table",{className:"w-full text-[11px] font-mono border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"text-terminal-dimmer text-left",children:[n.jsx("th",{className:"px-2 py-1.5 font-semibold w-7",children:"#"}),n.jsx("th",{className:"px-2 py-1.5 font-semibold",children:"Prompt"}),n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Tools"}),g&&n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-16",children:"Duration"}),f&&n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-16",children:"Context"}),x&&n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Output"})]})}),n.jsx("tbody",{children:C.map((j,w)=>n.jsx(uj,{row:j,hasDuration:!!g,hasContext:!!f,hasTokens:!!x,colCount:h,showCompaction:m.has(w)},j.sceneIndex))}),v&&n.jsx("tfoot",{children:n.jsx("tr",{children:n.jsx("td",{colSpan:h,children:n.jsx("button",{type:"button",className:"w-full py-1.5 text-[11px] font-mono text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",onClick:()=>o(!i),children:i?"▴ Collapse":`▾ Show all ${u.length} turns (${u.length-iu} more)`})})})})]})})]})}function uj({row:l,hasDuration:r,hasContext:i,hasTokens:o,colCount:u,showCompaction:m}){return n.jsxs(n.Fragment,{children:[n.jsxs("tr",{className:"border-t border-terminal-border-subtle hover:bg-terminal-surface-hover transition-colors",children:[n.jsx("td",{className:"px-2 py-1 text-terminal-green tabular-nums",children:String(l.index).padStart(2,"0")}),n.jsx("td",{className:"px-2 py-1 text-terminal-text max-w-0",children:n.jsxs("div",{className:"truncate",title:l.text,children:[l.text,l.errorCount>0&&n.jsxs("span",{className:"text-terminal-red ml-1.5",children:[l.errorCount," err"]})]})}),n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:n.jsx(Hl,{value:l.toolCount,ratio:l.toolRatio,color:"--orange"})}),r&&n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:n.jsx(Hl,{value:l.durationMs?vt(l.durationMs):"—",ratio:l.durationRatio,color:"--blue"})}),i&&n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:n.jsx(Hl,{value:l.contextTokens?Ht(l.contextTokens):"—",ratio:l.contextRatio,color:"--cyan"})}),o&&n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:n.jsx(Hl,{value:l.outputTokens?Ht(l.outputTokens):"—",ratio:l.outputRatio,color:"--green"})})]}),m&&n.jsx("tr",{children:n.jsx("td",{colSpan:u,className:"px-0 py-0",children:n.jsxs("div",{className:"flex items-center gap-2 px-2 py-0.5 bg-terminal-red/5",children:[n.jsx("div",{className:"flex-1 border-t border-dashed border-terminal-red/40"}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-red/70 shrink-0",children:"context compacted"}),n.jsx("div",{className:"flex-1 border-t border-dashed border-terminal-red/40"})]})})})]})}function Hl({value:l,ratio:r,color:i}){return n.jsx("span",{className:"inline-block w-full px-1 py-0.5 rounded-sm text-terminal-text",style:{backgroundColor:r>0?`color-mix(in srgb, var(${i}) ${Math.round(r*40)}%, transparent)`:void 0},children:l})}const ou=20;function dj({editedFiles:l,readOnlyFiles:r}){const[i,o]=y.useState(!1),u=y.useMemo(()=>[...l,...r],[l,r]),m=y.useMemo(()=>Math.max(...u.map(j=>j.editCount),1),[u]),p=y.useMemo(()=>Math.max(...u.map(j=>j.readCount),1),[u]),g=y.useMemo(()=>Math.max(...u.map(j=>j.linesAdded+j.linesRemoved),1),[u]),f=u.some(j=>j.linesAdded>0||j.linesRemoved>0),x=u.some(j=>j.turnEdits.size>0),h=u.length>ou,v=h&&!i?u.slice(0,ou):u,C=3+(f?1:0)+(x?1:0);return n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["File Impact",n.jsxs("span",{className:"normal-case tracking-normal ml-1.5",children:["(",l.length," modified",r.length>0&&`, ${r.length} read-only`,")"]})]}),n.jsx("div",{className:"overflow-x-auto rounded border border-terminal-border-subtle",children:n.jsxs("table",{className:"w-full text-[11px] font-mono border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"text-terminal-dimmer text-left",children:[n.jsx("th",{className:"px-2 py-1.5 font-semibold",children:"File"}),n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Edits"}),n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Reads"}),f&&n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-20",children:"+/−"}),x&&n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Turns"})]})}),n.jsx("tbody",{children:v.map(j=>{const w=j.path.split("/").pop()||j.path,S=j.editCount>0;return n.jsxs("tr",{className:"border-t border-terminal-border-subtle hover:bg-terminal-surface-hover transition-colors",children:[n.jsx("td",{className:"px-2 py-1 max-w-0",children:n.jsxs("div",{className:`truncate ${S?"text-terminal-text":"text-terminal-dimmer"}`,title:j.path,children:[w,j.editCount>=10&&n.jsx("span",{className:"text-terminal-red ml-1",title:`${j.editCount} edits — high churn file`,children:"⚠"}),n.jsx("span",{className:"text-terminal-dimmer ml-1",children:j.path.slice(0,j.path.length-w.length-1)})]})}),n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:j.editCount>0?n.jsx(Hl,{value:j.editCount,ratio:j.editCount/m,color:"--orange"}):n.jsx("span",{className:"text-terminal-dimmer",children:"—"})}),n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:j.readCount>0?n.jsx(Hl,{value:j.readCount,ratio:j.readCount/p,color:"--blue"}):n.jsx("span",{className:"text-terminal-dimmer",children:"—"})}),f&&n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:j.linesAdded>0||j.linesRemoved>0?n.jsxs("span",{className:"inline-block w-full px-1 py-0.5 rounded-sm",style:{backgroundColor:`color-mix(in srgb, var(--green) ${Math.round((j.linesAdded+j.linesRemoved)/g*30)}%, transparent)`},children:[n.jsxs("span",{className:"text-terminal-green",children:["+",j.linesAdded]}),n.jsx("span",{className:"text-terminal-dimmer",children:"/"}),n.jsxs("span",{className:"text-terminal-red",children:["−",j.linesRemoved]})]}):n.jsx("span",{className:"text-terminal-dimmer",children:"—"})}),x&&n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:j.turnEdits.size>0?n.jsx("span",{className:"text-terminal-dim",children:j.turnEdits.size}):n.jsx("span",{className:"text-terminal-dimmer",children:"—"})})]},j.path)})}),h&&n.jsx("tfoot",{children:n.jsx("tr",{children:n.jsx("td",{colSpan:C,children:n.jsx("button",{type:"button",className:"w-full py-1.5 text-[11px] font-mono text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",onClick:()=>o(!i),children:i?"▴ Collapse":`▾ Show all ${u.length} files (${u.length-ou} more)`})})})})]})})]})}function mj(l){switch(l){case"user-prompt":return"#3fb950";case"compaction-summary":return"#666666";case"context-injection":return"#4488cc";case"thinking":return"#b392f0";case"text-response":return"#79b8ff";case"tool-call":return"#d29922"}}function fj({scenes:l,currentIndex:r,onSeek:i,annotatedScenes:o}){const u=y.useMemo(()=>{if(l.length<=200)return l.map((j,w)=>({startIndex:w,endIndex:w,type:j.type}));const v=l.length/200,C=[];for(let j=0;j<200;j++){const w=Math.floor(j*v),S=Math.floor((j+1)*v)-1,k={"user-prompt":4,"compaction-summary":1,"context-injection":1,"tool-call":3,"text-response":2,thinking:1};let E=l[w].type,M=k[E];for(let A=w+1;A<=S&&A<l.length;A++){const R=k[l[A].type];R>M&&(E=l[A].type,M=R)}C.push({startIndex:w,endIndex:S,type:E})}return C},[l]),m=l.length>0?(r+1)/l.length*100:0,p=y.useRef(null),g=y.useCallback(h=>{const v=p.current;if(!v)return;const C=v.getBoundingClientRect(),j=h.clientX-C.left,w=Math.max(0,Math.min(1,j/C.width)),S=Math.floor(w*l.length);i(S)},[l.length,i]),f=y.useMemo(()=>{if(!o||o.size===0)return[];const h=[];return o.forEach(v=>{v>=0&&v<l.length&&h.push((v+.5)/l.length*100)}),h},[o,l.length]),x=y.useCallback(h=>{h.key==="ArrowRight"||h.key==="ArrowUp"?(h.preventDefault(),i(Math.min(r+1,l.length-1))):h.key==="ArrowLeft"||h.key==="ArrowDown"?(h.preventDefault(),i(Math.max(r-1,0))):h.key==="Home"?(h.preventDefault(),i(0)):h.key==="End"&&(h.preventDefault(),i(l.length-1))},[r,l.length,i]);return l.length===0?null:n.jsxs("div",{className:"px-4 pt-3 pb-1 cursor-pointer",onClick:g,onKeyDown:x,role:"slider","aria-label":"Scene timeline","aria-valuemin":0,"aria-valuemax":l.length-1,"aria-valuenow":r,tabIndex:0,children:[f.length>0&&n.jsx("div",{className:"relative h-2 mb-0.5",children:f.map((h,v)=>n.jsx("div",{className:"absolute w-1.5 h-1.5 rounded-full bg-terminal-blue shadow-layer-sm",style:{left:`${h}%`,top:"50%",transform:"translate(-50%, -50%)"}},v))}),n.jsxs("div",{ref:p,className:"relative flex h-2 rounded-full overflow-hidden bg-terminal-surface-2",children:[u.map((h,v)=>n.jsx("div",{className:"flex-1 transition-opacity duration-150",style:{backgroundColor:mj(h.type),opacity:h.startIndex<=r?1:.15}},v)),n.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-white shadow-layer-sm transition-[left] duration-150 ease-material",style:{left:`${m}%`}})]})]})}const pj=[{key:"replay",label:"Replay"},{key:"summary",label:"Insights"},{key:"export",label:"Share & Export"}],Nx="vr-insights-seen";function hj(){try{return localStorage.getItem(Nx)==="1"}catch{return!1}}function xj(){try{localStorage.setItem(Nx,"1")}catch{}}function gj({activeView:l,onChangeView:r,className:i="",rightContent:o,hiddenTabs:u}){const[m,p]=y.useState(()=>hj()||l==="summary"),g=y.useCallback(f=>{f==="summary"&&!m&&(xj(),p(!0)),r(f)},[r,m]);return n.jsxs("div",{className:`flex items-center justify-between border-b border-terminal-border-subtle bg-terminal-bg shrink-0 overflow-x-auto ${i}`,children:[n.jsx("div",{className:"flex bg-terminal-surface/30",children:pj.filter(f=>!u?.includes(f.key)).map(({key:f,label:x})=>n.jsxs("button",{onClick:()=>g(f),className:`relative px-4 py-2 text-[11px] font-sans font-semibold uppercase tracking-widest transition-colors ${l===f?"text-terminal-green border-b-2 border-terminal-green bg-terminal-surface/50":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,children:[x,f==="summary"&&!m&&l!=="summary"&&n.jsxs("span",{className:"absolute top-1.5 right-1 flex h-2 w-2",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-green opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-terminal-green"})]})]},f))}),o&&n.jsx("div",{className:"pr-4 py-1.5 flex items-center",children:o})]})}function bj(l){l.classList.remove("jump-target-flash"),l.offsetWidth,l.classList.add("jump-target-flash"),window.setTimeout(()=>{l.classList.remove("jump-target-flash")},900)}function yj({session:l,viewPrefs:r,viewerMode:i="embedded",activeView:o,setActiveView:u,returnToLandingRef:m}){const p=i==="readonly",[g,f]=y.useState(!1);y.useEffect(()=>{if(m)return m.current=()=>{f(!1),Cn(!1);const ce=new URL(window.location.href);ce.searchParams.has("s")&&(ce.searchParams.delete("s"),window.history.replaceState({},"",ce.toString()))},()=>{m.current=null}},[m]);const[x,h]=y.useState(void 0),[v,C]=y.useState(!1),[j,w]=y.useState(!1),[S,k]=y.useState(null),[E,M]=y.useState(!0),A=I0(l,i),R=J0(l,i),{effectiveSession:O}=R,{annotations:$}=A,H=W0(r),{state:K,currentIndex:ae,visibleCount:ue,speed:oe,play:te,pause:xe,togglePlayPause:de,seekTo:pe,changeSpeed:U,totalScenes:z,userPromptIndices:Q,computeNextIndex:ne}=P0(l.scenes,H,g),W=y.useRef(null),[T,_]=y.useState("outline"),[V,J]=y.useState(!1),[P,he]=y.useState(!1),G=y.useRef(null),F=y.useRef(null),me=y.useRef(!1),[be,Qe]=y.useState(!1);y.useEffect(()=>{const ce=fe=>{(fe.metaKey||fe.ctrlKey)&&fe.key==="k"?(fe.preventDefault(),J(_e=>!_e)):fe.key==="/"?fe.target instanceof HTMLInputElement||fe.target instanceof HTMLTextAreaElement||(fe.preventDefault(),J(!0)):fe.key==="?"?Qe(_e=>!_e):fe.key==="Escape"&&(be?Qe(!1):V&&J(!1))};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[V,be]);const lt=Q.filter(ce=>ce<=ae).length||0,Ct=Q.length,Fe=y.useMemo(()=>{const ce=new URLSearchParams(window.location.search).get("s");if(ce!==null){const fe=Number(ce);if(Number.isFinite(fe)&&fe>=0&&fe<l.scenes.length)return fe}return Q.length>=2?Q[1]:Math.min(15,l.scenes.length-1)},[Q,l.scenes.length]),it=y.useCallback((ce=!0)=>{f(!0),ce?setTimeout(te,300):setTimeout(()=>pe(Fe),100)},[te,pe,Fe]),Bt=y.useCallback(()=>u("summary"),[u]),kn=y.useRef(r.displayMode);y.useEffect(()=>{kn.current!==r.displayMode&&(kn.current=r.displayMode,g||(f(!0),setTimeout(()=>pe(Fe),100)))},[r.displayMode,g,pe,Fe]);const[qt,Cn]=y.useState(()=>new URLSearchParams(window.location.search).get("s")!==null);y.useEffect(()=>{!g&&o!=="replay"&&!qt&&(f(!0),setTimeout(()=>pe(Fe),100))},[o,g,Fe,pe,qt]);const ze=y.useCallback(ce=>{const fe=Math.max(0,Math.min(ce,l.scenes.length-1));xe(),G.current=fe,h(fe),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>h(void 0),2500),pe(fe)},[xe,pe,l.scenes.length]);y.useEffect(()=>{!g&&qt&&(f(!0),setTimeout(()=>ze(Fe),100))},[g,qt,Fe,ze]);const ot=y.useCallback(()=>{const ce=Q.find(fe=>fe>ae);ce!==void 0&&ze(ce)},[Q,ae,ze]),jt=y.useCallback(()=>{const ce=[...Q].reverse().find(fe=>fe<ae);ce!==void 0&&ze(ce)},[Q,ae,ze]),st=y.useRef(!1);y.useEffect(()=>{if(!W.current||ae<0||G.current!==null)return;if(me.current){me.current=!1;return}const ce=W.current;st.current=!0;const fe=Se=>{const Be=l.scenes;if(Se<0||Se>=Be.length)return Se;const et=Ue=>Ue==="user-prompt"||Ue==="compaction-summary"||Ue==="context-injection";if(et(Be[Se].type))return Se;let Oe=Se;for(;Oe>0&&!et(Be[Oe-1].type);)Oe--;return Oe},_e=Se=>{const Be=ce.querySelector(`[data-scene-index="${Se}"]`);if(Be)return Be;const et=fe(Se);return ce.querySelector(`[data-scene-index="${et}"]`)};requestAnimationFrame(()=>{const Se=_e(ae);if(Se)if(K==="playing")Se.scrollIntoView({behavior:"smooth",block:"center"});else{const Be=ce.getBoundingClientRect(),Ue=Se.getBoundingClientRect().top-Be.top+ce.scrollTop-Be.height*.3;ce.scrollTo({top:Math.max(0,Ue),behavior:"smooth"})}else K==="playing"&&ce.scrollTo({top:ce.scrollHeight,behavior:"smooth"});setTimeout(()=>{st.current=!1},400)})},[ae,K,l.scenes]),y.useEffect(()=>{const ce=W.current;if(!ce)return;const fe=()=>{st.current||K==="playing"&&xe()};return ce.addEventListener("wheel",fe,{passive:!0}),ce.addEventListener("touchmove",fe,{passive:!0}),()=>{ce.removeEventListener("wheel",fe),ce.removeEventListener("touchmove",fe)}},[K,xe]),y.useEffect(()=>{const ce=W.current;if(!ce)return;let fe=!1;const _e=()=>{if(K!=="paused"||fe||ae>=l.scenes.length-1||st.current||G.current!==null)return;if(ce.scrollHeight-ce.scrollTop-ce.clientHeight<80){fe=!0,me.current=!0;const tt=ne(ae);tt!==-1&&pe(tt),setTimeout(()=>{fe=!1},150)}},Se=Ue=>{Ue.deltaY>0&&_e()};let Be=0;const et=Ue=>{Be=Ue.touches[0].clientY},Oe=Ue=>{Be-Ue.changedTouches[0].clientY>20&&_e()};return ce.addEventListener("scroll",_e,{passive:!0}),ce.addEventListener("wheel",Se,{passive:!0}),ce.addEventListener("touchstart",et,{passive:!0}),ce.addEventListener("touchend",Oe,{passive:!0}),()=>{ce.removeEventListener("scroll",_e),ce.removeEventListener("wheel",Se),ce.removeEventListener("touchstart",et),ce.removeEventListener("touchend",Oe)}},[K,ae,l.scenes.length,pe,ne]),y.useEffect(()=>{const ce=G.current,fe=W.current;if(ce===null||!fe||ae!==ce)return;let _e=!1,Se=0;const Be=Oe=>{const Ue=fe.querySelector(`[data-scene-index="${Oe}"]`);if(Ue)return Ue;const tt=Array.from(fe.querySelectorAll("[data-scene-index]"));let Yt=null,Ft=1/0;for(const rn of tt){const Ln=rn.getAttribute("data-scene-index");if(!Ln)continue;const zn=parseInt(Ln,10);if(zn<=Oe){const $t=Oe-zn;$t<Ft&&(Ft=$t,Yt=rn)}}return Yt},et=()=>{if(_e)return;const Oe=Be(ce);if(Oe){st.current=!0;const Ue=fe.getBoundingClientRect(),Ft=Oe.getBoundingClientRect().top-Ue.top+fe.scrollTop-Ue.height*.3;fe.scrollTo({top:Math.max(0,Ft),behavior:"smooth"}),bj(Oe),setTimeout(()=>{st.current=!1},450),G.current=null;return}Se+=1,Se<30?setTimeout(et,80):G.current=null};return requestAnimationFrame(et),()=>{_e=!0}},[ae]),y.useEffect(()=>()=>{F.current&&clearTimeout(F.current)},[]);const Ze=y.useRef(null);y.useEffect(()=>{if(ae<0||!g)return;Ze.current&&clearTimeout(Ze.current);const ce=K==="playing"?500:0;return Ze.current=setTimeout(()=>{const fe=new URL(window.location.href);fe.searchParams.set("s",String(ae)),window.history.replaceState({},"",fe.toString())},ce),()=>{Ze.current&&clearTimeout(Ze.current)}},[ae,K,g]);const I=i==="editor",we=y.useMemo(()=>$.some(ce=>ce.author==="vibe-feedback"),[$]);if(!g&&o==="replay")return n.jsx(Y1,{session:O,onStart:it,onViewInsights:Bt});const{meta:ve}=l;return n.jsxs("div",{className:"flex flex-1 min-h-0 relative",children:[n.jsxs("div",{className:"flex flex-col flex-1 min-h-0 min-w-0",children:[n.jsx(gj,{activeView:o,onChangeView:u,hiddenTabs:p?["export"]:void 0,rightContent:o==="replay"?n.jsxs("div",{className:"flex items-center gap-3",children:[R.overlayCount>0&&n.jsxs("button",{onClick:()=>R.toggleAllOriginals(),className:"hidden md:flex items-center gap-2 text-xs font-mono text-terminal-dim",title:R.showAllOriginals?"Showing originals — click to show modified":"Showing modified — click to show originals",children:[n.jsx("span",{children:R.showAllOriginals?"Original":"Modified"}),n.jsx("span",{className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors duration-200 ${R.showAllOriginals?"bg-terminal-surface border border-terminal-border":"bg-terminal-purple brightness-75"}`,children:n.jsx("span",{className:`inline-block h-3.5 w-3.5 rounded-full bg-white shadow-sm transition-transform duration-200 ${R.showAllOriginals?"translate-x-[3px]":"translate-x-[17px]"}`})})]}),n.jsxs("button",{onClick:()=>C(!0),className:"hidden md:flex items-center gap-1.5 text-xs font-mono font-semibold text-terminal-text hover:text-terminal-green transition-colors",title:"Open comments",children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-terminal-dim",children:n.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),n.jsx("span",{children:"Comments"}),A.annotations.length>0&&n.jsx("span",{className:"ml-0.5 px-1 py-0.5 rounded bg-terminal-black text-[10px] text-terminal-text border border-terminal-border tabular-nums leading-none",children:A.annotations.length})]}),n.jsxs("button",{onClick:()=>C(!0),className:"md:hidden flex items-center gap-1 text-terminal-dim hover:text-terminal-text transition-colors",title:"Comments",children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),A.annotations.length>0&&n.jsx("span",{className:"px-1 py-0.5 rounded bg-terminal-black text-[10px] text-terminal-text border border-terminal-border tabular-nums leading-none",children:A.annotations.length})]}),I&&n.jsxs("button",{onClick:()=>w(!0),className:"hidden md:flex pl-2 pr-3 py-1 text-[11px] font-mono rounded bg-[rgba(168,85,247,0.1)] hover:bg-[rgba(168,85,247,0.2)] border border-[rgba(168,85,247,0.3)] hover:border-[rgba(168,85,247,0.5)] text-terminal-purple transition-all items-center gap-1.5 relative overflow-hidden group shadow-sm",children:[n.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/5 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-1000"}),n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-[#c084fc]",children:n.jsx("path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"})}),n.jsx("span",{className:"font-semibold tracking-wide",children:"AI Studio"}),(we||R.overlayCount>0)&&n.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-purple opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-terminal-purple"})]})]})]}):void 0}),n.jsxs("div",{className:"flex flex-1 min-h-0 min-w-0 w-full",children:[o==="replay"&&n.jsxs("div",{className:"flex flex-1 min-h-0 min-w-0 w-full relative",children:[E&&n.jsxs("div",{className:"hidden md:flex w-64 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-bg shadow-layer-sm",children:[n.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[n.jsxs("div",{className:"px-3 py-2 border-b border-terminal-border-subtle flex items-center justify-between group/side",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest",children:"Outline"}),n.jsx("button",{onClick:()=>M(!1),className:"p-1 rounded hover:bg-terminal-surface text-terminal-dimmer hover:text-terminal-text transition-colors",title:"Hide Sidebar",children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),n.jsx("line",{x1:"9",x2:"9",y1:"3",y2:"21"})]})})]}),n.jsx(kh,{scenes:l.scenes,currentIndex:ae,onSeek:ze,overlayActions:R,turnStats:l.meta.stats.turnStats})]}),n.jsxs("div",{className:"shrink-0 border-t border-terminal-border-subtle overflow-y-auto max-h-[35%]",children:[n.jsx("div",{className:"px-3 py-2 border-b border-terminal-border-subtle",children:n.jsx("button",{onClick:()=>u("summary"),className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest hover:text-terminal-green transition-colors",title:"Open Insights view",children:"Stats"})}),n.jsxs("div",{className:"p-3",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[n.jsx(Ul,{label:"Turns",value:ve.stats.userPrompts,color:"text-terminal-green"}),n.jsx(Ul,{label:"Tools",value:ve.stats.toolCalls,color:"text-terminal-orange"})]}),n.jsxs("div",{className:"mt-2 text-xs font-mono text-terminal-dim space-y-0.5",children:[ve.model&&n.jsx("div",{children:n.jsx("span",{className:"text-terminal-text",children:ve.model})}),ve.stats.durationMs&&n.jsxs("div",{children:[vt(ve.stats.durationMs),ve.stats.costEstimate!==void 0&&n.jsxs("span",{children:[" / ",n.jsxs("span",{className:"text-terminal-green",children:["$",ve.stats.costEstimate<.01?ve.stats.costEstimate.toFixed(4):ve.stats.costEstimate.toFixed(2)]})]})]}),ve.stats.tokenUsage&&n.jsxs("div",{children:[Ht(ve.stats.tokenUsage.inputTokens)," in /"," ",Ht(ve.stats.tokenUsage.outputTokens)," out"]})]})]})]})]}),n.jsxs("div",{className:"flex flex-col flex-1 min-h-0 min-w-0 relative",children:[!E&&n.jsx("button",{onClick:()=>M(!0),className:"absolute left-0 top-1/2 -translate-y-1/2 z-20 group/expand px-1.5 py-4 bg-terminal-surface/80 backdrop-blur-md border border-l-0 border-terminal-border-subtle rounded-r-xl text-terminal-dim hover:text-terminal-green transition-all shadow-layer-md animate-in slide-in-from-left-2 duration-300",title:"Show Sidebar",children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}),n.jsx("div",{ref:W,className:"flex-1 overflow-y-auto overflow-x-hidden px-5 py-5 pb-10 overscroll-contain",children:n.jsx(R1,{scenes:l.scenes,visibleCount:ue,currentIndex:ae,effectivePrefs:H,focusIndex:x,annotatedScenes:A.annotatedScenes,annotationCounts:A.annotationCounts,onSeek:ze,state:K,overlayActions:R,turnStats:l.meta.stats.turnStats,onComment:p?void 0:ce=>{C(!0),k(ce)}})}),n.jsx(X1,{scenes:O.scenes,open:V,onClose:()=>J(!1),onSeek:ce=>{ze(ce),J(!1)}})]})]}),o==="summary"&&n.jsx(ej,{session:O}),o==="export"&&n.jsx(U1,{actions:A,viewerMode:i,readOnly:p,session:O})]}),o==="replay"&&n.jsxs("div",{className:"shrink-0 border-t border-terminal-border-subtle bg-terminal-surface/80 backdrop-blur-md sticky bottom-0 safe-bottom shadow-layer-lg",children:[n.jsx(fj,{scenes:l.scenes,currentIndex:ae,onSeek:ze,annotatedScenes:A.annotatedScenes}),n.jsx(av,{state:K,speed:oe,currentIndex:ae,totalScenes:z,userPromptCount:Ct,currentTurn:lt,onTogglePlayPause:de,onChangeSpeed:U,onPrevPrompt:jt,onNextPrompt:ot,onOpenSearch:()=>J(!0),onOpenOutline:()=>he(!0),onShowHelp:()=>Qe(!0)})]})]}),n.jsx(tv,{open:v,onClose:()=>C(!1),actions:A,scenes:O.scenes,currentIndex:ae,onSeek:ze,addingForScene:S,onClearAddingTarget:()=>k(null),readOnly:p}),n.jsx(iy,{open:j,onClose:()=>w(!1),annotationActions:A,overlayActions:R}),n.jsxs("div",{className:`fixed inset-0 z-40 md:hidden transition-opacity duration-300 ${P?"opacity-100":"opacity-0 pointer-events-none"}`,onClick:()=>he(!1),children:[n.jsx("div",{className:"absolute inset-0 bg-black/40"}),n.jsxs("div",{className:`absolute bottom-0 left-0 right-0 h-[65vh] bg-terminal-bg border-t border-terminal-border-subtle rounded-t-2xl flex flex-col transition-transform duration-300 ease-material-decel safe-bottom shadow-layer-xl ${P?"translate-y-0":"translate-y-full"}`,onClick:ce=>ce.stopPropagation(),children:[n.jsx("div",{className:"flex justify-center py-2.5 shrink-0",children:n.jsx("div",{className:"w-10 h-1 rounded-full bg-terminal-border"})}),n.jsxs("div",{className:"flex border-b border-terminal-border-subtle shrink-0",children:[n.jsx("button",{onClick:()=>_("outline"),className:`flex-1 px-3 py-2.5 text-[10px] font-sans font-semibold uppercase tracking-widest transition-colors ${T==="outline"?"text-terminal-green border-b-2 border-terminal-green":"text-terminal-dim hover:text-terminal-text"}`,children:"Outline"}),n.jsxs("button",{onClick:()=>_("comments"),className:`flex-1 px-3 py-2.5 text-[10px] font-sans font-semibold uppercase tracking-widest transition-colors ${T==="comments"?"text-terminal-green border-b-2 border-terminal-green":"text-terminal-dim hover:text-terminal-text"}`,children:["Comments",A.annotations.length>0&&n.jsxs("span",{className:"ml-1.5 text-terminal-dimmer",children:["(",A.annotations.length,")"]})]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain",children:T==="outline"?n.jsx(kh,{scenes:l.scenes,currentIndex:ae,onSeek:ce=>{ze(ce),he(!1)},overlayActions:R,turnStats:l.meta.stats.turnStats}):n.jsx(fx,{actions:A,scenes:O.scenes,currentIndex:ae,onSeek:ce=>{ze(ce)},addingForScene:S,onClearAddingTarget:()=>k(null),readOnly:p})})]})]}),n.jsx(G1,{open:be,onClose:()=>Qe(!1)})]})}function vj(){const[l,r]=y.useState({status:"loading"}),i=y.useCallback(()=>{r({status:"loading"}),wj().then(o=>{r(o==="dashboard"?{status:"dashboard"}:{status:"ready",session:o.session,mode:o.mode,gistOwner:o.gistOwner})},o=>r({status:"error",message:String(o.message||o)}))},[]);return y.useEffect(()=>{i();const o=()=>i();return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[i]),l}function jj(){return!!window.__VIBE_REPLAY_EDITOR__}async function wj(){if(window.__VIBE_REPLAY_DATA__)return{session:window.__VIBE_REPLAY_DATA__,mode:"embedded"};const l=new URLSearchParams(window.location.search),r=l.get("cloud");if(r){if(!/^[a-zA-Z0-9_-]{10,16}$/.test(r))throw new Error("Invalid cloud replay ID");const p=await fetch(`https://vibe-replay.com/api/cloud-replays/${r}`,{credentials:"include"});if(!p.ok)throw p.status===404?new Error("Replay not found"):p.status===410?new Error("This replay has expired"):new Error(`Failed to load replay: ${p.status}`);const g=await p.json();if(g.redirect&&g.gistId){const{rawUrl:f}=await Th(g.gistId);return{session:await cu(f),mode:"readonly"}}return{session:g,mode:"readonly"}}const i=l.get("gist");if(i){if(!/^[a-f0-9]{20,40}$/.test(i))throw new Error("Invalid gist ID");const{rawUrl:m,owner:p}=await Th(i),g=await cu(m);return fetch(`https://vibe-replay.com/api/cloud-replays/view-gist/${i}`,{method:"POST"}).catch(()=>{}),{session:g,mode:"readonly",gistOwner:p}}if(jj()){if(l.get("view")==="dashboard")return"dashboard";const m=l.get("session");if(m){const p=await fetch(`/api/session?slug=${encodeURIComponent(m)}`);if(!p.ok)throw new Error(`Session not found: ${m}`);return{session:await p.json(),mode:"editor"}}return"dashboard"}const o=l.get("url");if(o)return{session:await cu(o),mode:"readonly"};const u=l.get("file");if(u){const m=await fetch(u);if(!m.ok)throw new Error(`Failed to load file: ${m.status}`);return{session:await m.json(),mode:"embedded"}}return"dashboard"}async function cu(l){const r=await fetch(l);if(!r.ok)throw new Error(`Failed to fetch: ${r.status} ${r.statusText}`);const i=await r.text();if(i.trimStart().startsWith("{"))return JSON.parse(i);throw new Error("URL must point to a vibe-replay JSON replay file")}async function Th(l){const r=await fetch(`https://api.github.com/gists/${l}`);if(!r.ok)throw new Error(`Gist not found: ${r.status}`);const i=await r.json(),o=i.files,u=Object.values(o).find(p=>p.filename.endsWith(".json"));if(!u)throw new Error("No JSON file found in gist");const m=i.owner?.login;return{rawUrl:u.raw_url,owner:m}}function Nj(){const[l,r]=y.useState(()=>{const u=new URLSearchParams(window.location.search).get("theme");if(u==="light"||u==="dark")return u;const m=localStorage.getItem("vibe-replay-theme");return m==="light"||m==="dark"?m:"dark"});y.useEffect(()=>{const o=document.documentElement;o.classList.add("theme-transition"),o.classList.toggle("dark",l==="dark"),o.classList.toggle("light",l==="light"),localStorage.setItem("vibe-replay-theme",l);const u=setTimeout(()=>o.classList.remove("theme-transition"),300);return()=>clearTimeout(u)},[l]);const i=y.useCallback(()=>{r(o=>o==="dark"?"light":"dark")},[]);return{theme:l,toggleTheme:i}}function Eh(){const r=new URLSearchParams(window.location.search).get("v");return r==="summary"||r==="export"?r:"replay"}const Zs="https://vibe-replay.com";function Ah({isEditor:l}){const[r,i]=y.useState(null),[o,u]=y.useState(!1),m=y.useRef(null),p=y.useRef(null),g=y.useRef(null);return y.useEffect(()=>{const f=l?"/api/auth/get-session":`${Zs}/api/auth/get-session`;let x="";if(!l)try{x=new URL(Zs).origin}catch{x=""}const h=l?{}:{credentials:"include"},v=()=>{fetch(f,h).then(j=>j.json()).then(j=>{j?.session?i({authenticated:!0,user:j.user||null}):i({authenticated:!1,user:null})}).catch(()=>i({authenticated:!1,user:null}))};v();const C=j=>{!l&&j.origin===x&&j.data?.type==="vibe-replay-auth"&&j.data.user&&(i({authenticated:!0,user:j.data.user}),window.dispatchEvent(new Event("vibe-auth-change")))};return window.addEventListener("message",C),window.addEventListener("focus",v),()=>{p.current&&(clearInterval(p.current),p.current=null),g.current&&(clearTimeout(g.current),g.current=null),window.removeEventListener("message",C),window.removeEventListener("focus",v)}},[l]),y.useEffect(()=>{if(!o)return;const f=x=>{m.current&&!m.current.contains(x.target)&&u(!1)};return document.addEventListener("click",f),()=>document.removeEventListener("click",f)},[o]),r?r.authenticated?n.jsxs("div",{className:"relative",ref:m,children:[n.jsx("button",{type:"button",onClick:()=>u(!o),className:"flex items-center justify-center w-7 h-7 rounded-full ring-2 ring-terminal-border/40 hover:ring-terminal-green/60 transition-all cursor-pointer overflow-hidden",children:r.user?.image?n.jsx("img",{src:r.user.image,alt:"",className:"w-full h-full rounded-full object-cover"}):n.jsx("span",{className:"text-[10px] text-terminal-dim",children:"?"})}),o&&n.jsxs("div",{className:"absolute right-0 top-full mt-2 min-w-[140px] bg-terminal-surface border border-terminal-border rounded-lg shadow-lg py-1 z-50",children:[n.jsx("div",{className:"px-3 py-2 text-[11px] text-terminal-dim border-b border-terminal-border truncate font-mono",children:r.user?.name||"logged in"}),n.jsx("button",{type:"button",onClick:async()=>{const f=l?"/api/auth/sign-out":`${Zs}/api/auth/sign-out`;await fetch(f,{method:"POST",...l?{}:{credentials:"include"}}),window.location.reload()},className:"w-full text-left px-3 py-2 text-xs text-terminal-dim hover:text-red-400 hover:bg-terminal-surface-hover transition-colors cursor-pointer font-mono",children:"Logout"})]})]}):n.jsxs("button",{type:"button",onClick:async()=>{if(l)try{const h=await fetch("/api/auth/login",{method:"POST"}),v=await h.json().catch(()=>null);h.ok&&v?.url&&window.open(v.url,"_blank")}catch{}else window.open(`${Zs}/auth/login?callback=/auth/success`,"_blank");p.current&&(clearInterval(p.current),p.current=null),g.current&&(clearTimeout(g.current),g.current=null);const f=l?"/api/auth/get-session":`${Zs}/api/auth/get-session`,x=l?{}:{credentials:"include"};p.current=setInterval(async()=>{try{const v=await(await fetch(f,x)).json();v?.session&&(p.current&&(clearInterval(p.current),p.current=null),g.current&&(clearTimeout(g.current),g.current=null),i({authenticated:!0,user:v.user||null}),window.dispatchEvent(new Event("vibe-auth-change")))}catch{}},2e3),g.current=setTimeout(()=>{p.current&&(clearInterval(p.current),p.current=null),g.current=null},300*1e3)},className:"inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md bg-[#24292f] hover:bg-[#32383f] text-white text-xs font-medium transition-colors cursor-pointer border border-white/10",children:[n.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})}),"Sign in"]}):null}function uu(){const[l,r]=y.useState(null);return y.useEffect(()=>{window.__VIBE_REPLAY_EDITOR__&&fetch("https://api.github.com/repos/tuo-lei/vibe-replay").then(i=>i.json()).then(i=>{i.stargazers_count!=null&&r(i.stargazers_count)}).catch(()=>{})},[]),n.jsxs("a",{href:"https://github.com/tuo-lei/vibe-replay",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center h-7 rounded-md border border-terminal-border text-xs font-medium text-terminal-text/70 hover:text-terminal-text hover:border-terminal-text/30 transition-colors",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 px-2",children:[n.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("path",{d:"M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25z"})}),"Star"]}),l!=null&&n.jsx("span",{className:"inline-flex items-center px-2 h-full border-l border-terminal-border",children:l})]})}function Sj(){const l=vj(),{theme:r,toggleTheme:i}=Nj(),{prefs:o,updatePref:u,togglePref:m}=ty(),p=l.status==="ready"?l.session:null,g=l.status==="ready"?l.mode:"embedded",f=l.status==="ready"?l.gistOwner:void 0,x=g==="editor",[h,v]=y.useState(Eh()),C=y.useRef(null);y.useEffect(()=>{const $=()=>v(Eh());return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[]);const j=$=>{v($),ht({v:$==="replay"?null:$})},w=y.useMemo(()=>p?.scenes.some($=>$.type==="thinking")??!1,[p]),[S,k]=y.useState(!1);y.useEffect(()=>{if(!S)return;const $=H=>{H.key==="Escape"&&k(!1)};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[S]);const[E,M]=y.useState(!1),A=y.useRef(null);y.useEffect(()=>{o.displayMode!=="custom"&&M(!1)},[o.displayMode]);const R=y.useCallback(()=>M(!1),[]);if(Au(A,R,E),l.status==="loading")return n.jsx("div",{className:"h-screen bg-terminal-bg flex items-center justify-center",children:n.jsxs("div",{className:"text-center space-y-2",children:[n.jsx("div",{className:"text-terminal-green font-sans font-bold text-sm animate-pulse",children:"LOADING SESSION..."}),n.jsx("div",{className:"text-terminal-dimmer font-mono text-xs",children:"Preparing replay data"})]})});if(l.status==="error")return n.jsx("div",{className:"h-screen bg-terminal-bg flex items-center justify-center",children:n.jsxs("div",{className:"text-center space-y-2",children:[n.jsx("div",{className:"text-terminal-red font-mono text-sm",children:l.message}),n.jsx("div",{className:"text-terminal-dim font-mono text-xs",children:"Use ?gist=<id> or ?url=<replay-json-url> or embed via CLI"})]})});if(l.status==="dashboard")return n.jsx("div",{className:"h-screen bg-terminal-bg flex flex-col overflow-hidden",children:n.jsx($0,{headerLeft:n.jsxs("div",{className:"flex items-center gap-2.5 shrink-0",children:[n.jsx("button",{onClick:()=>ht({view:null,session:null}),className:"text-sm font-sans font-bold bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent hover:opacity-80 transition-opacity",children:"vibe-replay"}),n.jsxs("span",{className:"instant-tooltip inline-flex items-center gap-1 text-[9px] font-sans font-bold px-2 py-0.5 rounded-full bg-terminal-green/10 text-terminal-green uppercase tracking-wider border border-terminal-green/20",children:[n.jsx("span",{className:"w-1 h-1 rounded-full bg-terminal-green animate-pulse"}),"Local",n.jsx("span",{className:"instant-tooltip-text",children:`v0.1.5
|
|
160
|
+
Viewer ${window.location.host}
|
|
161
|
+
Cloud https://vibe-replay.com`})]})]}),headerRight:n.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n.jsx(uu,{}),n.jsx("button",{onClick:i,className:"w-7 h-7 flex items-center justify-center rounded-md bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover text-sm transition-colors",children:r==="dark"?"☾":"☀"}),n.jsx(Ah,{isEditor:!0})]})})});const{meta:O}=p;return n.jsxs("div",{className:"h-screen bg-terminal-bg flex flex-col overflow-hidden",children:[n.jsxs("header",{className:"relative z-40 border-b border-terminal-border-subtle px-5 py-2 flex items-center gap-4 shrink-0 glass-effect safe-top",children:[n.jsxs("div",{className:"flex items-center gap-2.5 shrink-0",children:[x?n.jsx("button",{onClick:()=>ht({view:"dashboard",session:null}),className:"text-sm font-sans font-bold shrink-0 hover:opacity-80 transition-opacity bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent",children:"vibe-replay"}):n.jsx("a",{href:"https://vibe-replay.com",target:"_blank",rel:"noopener noreferrer",className:"text-sm font-sans font-bold shrink-0 hover:opacity-80 transition-opacity bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent",children:"vibe-replay"}),x&&n.jsxs("span",{className:"instant-tooltip inline-flex items-center gap-1 text-[9px] font-sans font-bold px-2 py-0.5 rounded-full bg-terminal-green/10 text-terminal-green uppercase tracking-wider border border-terminal-green/20",children:[n.jsx("span",{className:"w-1 h-1 rounded-full bg-terminal-green animate-pulse"}),"Local",n.jsx("span",{className:"instant-tooltip-text",children:`v0.1.5
|
|
162
|
+
Viewer ${window.location.host}
|
|
163
|
+
Cloud https://vibe-replay.com`})]})]}),x&&n.jsx("nav",{className:"hidden md:inline-flex items-center rounded-xl bg-terminal-surface p-0.5 shadow-layer-sm shrink-0",children:["home","sessions","replays","projects","insights"].map($=>n.jsx("button",{onClick:()=>ht({view:"dashboard",session:null,tab:$}),className:"px-3.5 py-1.5 text-xs font-sans font-semibold rounded-lg text-terminal-dim hover:text-terminal-text transition-all duration-200 ease-material",children:$.charAt(0).toUpperCase()+$.slice(1)},$))}),O.title&&n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("span",{className:"text-terminal-border/40 text-sm select-none hidden md:inline",children:"|"}),n.jsx("button",{type:"button",onClick:()=>{C.current?.(),j("replay")},className:"text-terminal-text text-xs font-sans font-medium truncate max-w-[180px] md:max-w-[300px] hover:text-terminal-green transition-colors",title:"Back to landing page",children:O.title}),f&&n.jsxs("div",{className:"hidden sm:flex items-center gap-1.5 text-xs font-mono text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-border",children:"·"}),n.jsx("span",{className:"text-terminal-dimmer",children:"shared by"}),n.jsxs("a",{href:`https://github.com/${f}`,target:"_blank",rel:"noopener noreferrer",className:"text-terminal-dim hover:text-terminal-text transition-colors",children:["@",f]})]})]}),n.jsx("div",{className:"flex-1"}),n.jsxs("div",{className:"flex items-center gap-1.5 md:gap-2 shrink-0",children:[n.jsxs("div",{ref:A,className:"hidden md:flex items-center gap-1.5",children:[n.jsxs("div",{className:"relative flex items-center",children:[n.jsxs("div",{className:"flex items-center h-7 rounded-md overflow-hidden bg-terminal-surface",children:[n.jsx("button",{onClick:()=>u("displayMode","all"),className:`h-full px-2.5 text-xs font-mono transition-colors ${o.displayMode==="all"?"bg-terminal-green-subtle text-terminal-green":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,children:"All"}),n.jsx("button",{onClick:()=>u("displayMode","compact"),className:`h-full px-2.5 text-xs font-mono transition-colors ${o.displayMode==="compact"?"bg-terminal-green-subtle text-terminal-green":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,children:"Compact"}),n.jsx("button",{onClick:()=>{u("displayMode","custom"),M($=>o.displayMode==="custom"?!$:!0)},className:`h-full px-2.5 text-xs font-mono transition-colors ${o.displayMode==="custom"?"bg-terminal-green-subtle text-terminal-green":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,children:"Custom"})]}),E&&o.displayMode==="custom"&&n.jsxs("div",{className:"absolute right-0 top-full mt-2 w-40 bg-terminal-surface border border-terminal-border-subtle rounded-xl shadow-layer-xl z-50 py-1.5 backdrop-blur-md",children:[n.jsxs("button",{onClick:()=>m("promptsOnly"),className:"w-full text-left px-3 py-1.5 text-xs font-mono text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface/50 transition-colors flex items-center gap-2",children:[n.jsx("span",{className:`w-3.5 h-3.5 rounded flex items-center justify-center text-[10px] ${o.promptsOnly?"bg-terminal-green-subtle text-terminal-green":"bg-terminal-bg"}`,children:o.promptsOnly?"✓":""}),"Prompts Only"]}),n.jsxs("button",{onClick:()=>m("collapseAllTools"),className:"w-full text-left px-3 py-1.5 text-xs font-mono text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface/50 transition-colors flex items-center gap-2",children:[n.jsx("span",{className:`w-3.5 h-3.5 rounded flex items-center justify-center text-[10px] ${o.collapseAllTools?"bg-terminal-orange-subtle text-terminal-orange":"bg-terminal-bg"}`,children:o.collapseAllTools?"✓":""}),"Tools Collapsed"]}),w&&n.jsxs("button",{onClick:()=>m("hideThinking"),className:"w-full text-left px-3 py-1.5 text-xs font-mono text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface/50 transition-colors flex items-center gap-2",children:[n.jsx("span",{className:`w-3.5 h-3.5 rounded flex items-center justify-center text-[10px] ${o.hideThinking?"bg-terminal-purple-subtle text-terminal-purple":"bg-terminal-bg"}`,children:o.hideThinking?"✓":""}),"Thinking Hidden"]})]})]}),n.jsx(uu,{}),n.jsx("button",{onClick:i,className:"h-7 w-7 flex items-center justify-center rounded-md bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover text-xs transition-colors",title:r==="dark"?"Light mode":"Dark mode",children:r==="dark"?"☾":"☀"}),x&&n.jsx(Ah,{isEditor:x})]}),n.jsx("button",{onClick:()=>k($=>!$),className:"md:hidden h-7 w-7 flex items-center justify-center rounded-md bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors","aria-label":"Menu",children:S?n.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}):n.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})})})]}),S&&n.jsx("div",{className:"md:hidden absolute top-full left-0 right-0 z-50 bg-terminal-bg shadow-layer-xl rounded-b-2xl border-b border-terminal-border-subtle",children:n.jsxs("div",{className:"px-5 py-4 space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[11px] font-sans font-medium text-terminal-dim",children:"Display"}),n.jsx("div",{className:"flex items-center h-8 rounded-lg overflow-hidden bg-terminal-surface",children:["all","compact","custom"].map($=>n.jsx("button",{onClick:()=>{u("displayMode",$),$!=="custom"&&k(!1)},className:`h-full px-3.5 text-xs font-mono capitalize transition-colors ${o.displayMode===$?"bg-terminal-green-subtle text-terminal-green":"text-terminal-dim hover:text-terminal-text"}`,children:$},$))})]}),o.displayMode==="custom"&&n.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.jsx("button",{onClick:()=>m("promptsOnly"),className:`px-3 py-1.5 text-xs font-mono rounded-lg border transition-colors ${o.promptsOnly?"bg-terminal-green-subtle text-terminal-green border-terminal-green/30":"text-terminal-dim border-terminal-border-subtle"}`,children:"Prompts Only"}),n.jsx("button",{onClick:()=>m("collapseAllTools"),className:`px-3 py-1.5 text-xs font-mono rounded-lg border transition-colors ${o.collapseAllTools?"bg-terminal-orange-subtle text-terminal-orange border-terminal-orange/30":"text-terminal-dim border-terminal-border-subtle"}`,children:"Tools Collapsed"}),w&&n.jsx("button",{onClick:()=>m("hideThinking"),className:`px-3 py-1.5 text-xs font-mono rounded-lg border transition-colors ${o.hideThinking?"bg-terminal-purple-subtle text-terminal-purple border-terminal-purple/30":"text-terminal-dim border-terminal-border-subtle"}`,children:"Thinking Hidden"})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[11px] font-sans font-medium text-terminal-dim",children:"Theme"}),n.jsxs("button",{onClick:()=>{i(),k(!1)},className:"h-8 px-3.5 flex items-center gap-2 rounded-lg bg-terminal-surface text-terminal-dim text-xs font-mono transition-colors",children:[r==="dark"?"☾":"☀",n.jsx("span",{children:r==="dark"?"Light":"Dark"})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[11px] font-sans font-medium text-terminal-dim",children:"GitHub"}),n.jsx(uu,{})]})]})})]}),S&&n.jsx("div",{className:"md:hidden fixed inset-0 z-30 bg-black/30",onClick:()=>k(!1)}),n.jsx(yj,{session:p,viewPrefs:o,viewerMode:g,activeView:h,setActiveView:j,returnToLandingRef:C})]})}Zb.createRoot(document.getElementById("root")).render(n.jsx($b.StrictMode,{children:n.jsx(Sj,{})}));</script>
|
|
164
|
+
<style rel="stylesheet" crossorigin>*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--font-sans);font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{scrollbar-width:thin;scrollbar-color:var(--border) var(--bg)}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:var(--bg)}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}.tabular-nums{font-variant-numeric:tabular-nums}.pointer-events-none{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.-bottom-20{bottom:-5rem}.-left-20{left:-5rem}.-right-20{right:-5rem}.-top-20{top:-5rem}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.bottom-full{bottom:100%}.left-0{left:0}.left-3{left:.75rem}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3{top:.75rem}.top-full{top:100%}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[120\]{z-index:120}.z-\[60\]{z-index:60}.\!m-0{margin:0!important}.mx-0\.5{margin-left:.125rem;margin-right:.125rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-1\.5{margin-top:.375rem;margin-bottom:.375rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-auto{margin-bottom:auto}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-28{height:7rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[10px\]{height:10px}.h-\[65vh\]{height:65vh}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-28{max-height:7rem}.max-h-32{max-height:8rem}.max-h-40{max-height:10rem}.max-h-48{max-height:12rem}.max-h-60{max-height:15rem}.max-h-72{max-height:18rem}.max-h-\[100px\]{max-height:100px}.max-h-\[120px\]{max-height:120px}.max-h-\[180px\]{max-height:180px}.max-h-\[200px\]{max-height:200px}.max-h-\[300px\]{max-height:300px}.max-h-\[35\%\]{max-height:35%}.max-h-\[4\.5em\]{max-height:4.5em}.max-h-\[400px\]{max-height:400px}.max-h-\[50vh\]{max-height:50vh}.max-h-\[88vh\]{max-height:88vh}.min-h-0{min-height:0px}.min-h-4{min-height:1rem}.min-h-screen{min-height:100vh}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[10px\]{width:10px}.w-\[68px\]{width:68px}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-4{min-width:1rem}.min-w-\[140px\]{min-width:140px}.min-w-\[40px\]{min-width:40px}.max-w-0{max-width:0px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-6xl{max-width:72rem}.max-w-\[120px\]{max-width:120px}.max-w-\[180px\]{max-width:180px}.max-w-\[200px\]{max-width:200px}.max-w-\[300px\]{max-width:300px}.max-w-\[400px\]{max-width:400px}.max-w-\[60\%\]{max-width:60%}.max-w-\[calc\(100vw-2rem\)\]{max-width:calc(100vw - 2rem)}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-\[2\]{flex:2}.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[17px\]{--tw-translate-x: 17px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[3px\]{--tw-translate-x: 3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-2{--tw-translate-y: .5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-\[3px\]{gap:3px}.gap-px{gap:1px}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-y-1{row-gap:.25rem}.gap-y-5{row-gap:1.25rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-2\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.625rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-3\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.875rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.875rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.self-start{align-self:flex-start}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overscroll-contain{overscroll-behavior:contain}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-b-2xl{border-bottom-right-radius:1rem;border-bottom-left-radius:1rem}.rounded-r-xl{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.rounded-t-sm{border-top-left-radius:.125rem;border-top-right-radius:.125rem}.border{border-width:1px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\[rgba\(168\,85\,247\,0\.2\)\]{border-color:#a855f733}.border-\[rgba\(168\,85\,247\,0\.3\)\]{border-color:#a855f74d}.border-amber-500\/30{border-color:#f59e0b4d}.border-blue-500\/20{border-color:#3b82f633}.border-blue-500\/30{border-color:#3b82f64d}.border-blue-500\/40{border-color:#3b82f666}.border-blue-500\/60{border-color:#3b82f699}.border-cyan-500\/30{border-color:#06b6d44d}.border-gray-500\/30{border-color:#6b72804d}.border-green-500\/15{border-color:#22c55e26}.border-green-500\/30{border-color:#22c55e4d}.border-orange-500\/20{border-color:#f9731633}.border-purple-500\/20{border-color:#a855f733}.border-purple-500\/30{border-color:#a855f74d}.border-red-400\/20{border-color:#f8717133}.border-terminal-blue{border-color:var(--blue)}.border-terminal-border{border-color:var(--border)}.border-terminal-border-subtle{border-color:var(--border-subtle)}.border-terminal-dim{border-color:var(--dim)}.border-terminal-green{border-color:var(--green)}.border-white\/10{border-color:#ffffff1a}.border-l-terminal-blue{border-left-color:var(--blue)}.border-l-terminal-purple{border-left-color:var(--purple)}.\!bg-transparent{background-color:transparent!important}.bg-\[\#24292f\]{--tw-bg-opacity: 1;background-color:rgb(36 41 47 / var(--tw-bg-opacity, 1))}.bg-\[rgba\(168\,85\,247\,0\.1\)\]{background-color:#a855f71a}.bg-amber-500\/20{background-color:#f59e0b33}.bg-black\/30{background-color:#0000004d}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/20{background-color:#3b82f633}.bg-cyan-500\/20{background-color:#06b6d433}.bg-gray-500\/20{background-color:#6b728033}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-500\/20{background-color:#22c55e33}.bg-green-500\/5{background-color:#22c55e0d}.bg-purple-500\/10{background-color:#a855f71a}.bg-purple-500\/20{background-color:#a855f733}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-terminal-bg{background-color:var(--bg)}.bg-terminal-blue{background-color:var(--blue)}.bg-terminal-blue-emphasis{background-color:var(--blue-emphasis)}.bg-terminal-blue-subtle{background-color:var(--blue-subtle)}.bg-terminal-border{background-color:var(--border)}.bg-terminal-border-subtle{background-color:var(--border-subtle)}.bg-terminal-dim{background-color:var(--dim)}.bg-terminal-green{background-color:var(--green)}.bg-terminal-green-emphasis{background-color:var(--green-emphasis)}.bg-terminal-green-subtle{background-color:var(--green-subtle)}.bg-terminal-orange{background-color:var(--orange)}.bg-terminal-orange-subtle{background-color:var(--orange-subtle)}.bg-terminal-purple{background-color:var(--purple)}.bg-terminal-purple-subtle{background-color:var(--purple-subtle)}.bg-terminal-red{background-color:var(--red)}.bg-terminal-red-subtle{background-color:var(--red-subtle)}.bg-terminal-surface{background-color:var(--surface)}.bg-terminal-surface-2{background-color:var(--surface-2)}.bg-terminal-surface-hover{background-color:var(--surface-hover)}.bg-terminal-surface-inset{background-color:var(--surface-inset)}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-terminal-bg{--tw-gradient-from: var(--bg) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-terminal-green{--tw-gradient-from: var(--green) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-terminal-green-subtle{--tw-gradient-from: var(--green-subtle) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-terminal-surface{--tw-gradient-from: var(--surface) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-terminal-bg{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--bg) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-transparent{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), transparent var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-white\/5{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(255 255 255 / .05) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-terminal-blue{--tw-gradient-to: var(--blue) var(--tw-gradient-to-position)}.to-terminal-surface{--tw-gradient-to: var(--surface) var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-px{padding-top:1px;padding-bottom:1px}.pb-1{padding-bottom:.25rem}.pb-10{padding-bottom:2.5rem}.pb-12{padding-bottom:3rem}.pb-2{padding-bottom:.5rem}.pb-24{padding-bottom:6rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pr-7{padding-right:1.75rem}.pr-8{padding-right:2rem}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-12{padding-top:3rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-\[8vh\]{padding-top:8vh}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[9px\]{font-size:9px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.normal-case{text-transform:none}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-5{line-height:1.25rem}.leading-\[1\.15\]{line-height:1.15}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.tracking-\[\.25em\]{letter-spacing:.25em}.tracking-\[0\.15em\]{letter-spacing:.15em}.tracking-\[0\.2em\]{letter-spacing:.2em}.tracking-\[0\.3em\]{letter-spacing:.3em}.tracking-normal{letter-spacing:0em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-\[\#c084fc\]{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-400\/80{color:#60a5facc}.text-cyan-300{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-400\/40{color:#c084fc66}.text-purple-400\/60{color:#c084fc99}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-terminal-bg{color:var(--bg)}.text-terminal-blue{color:var(--blue)}.text-terminal-border{color:var(--border)}.text-terminal-dim{color:var(--dim)}.text-terminal-dimmer{color:var(--dimmer)}.text-terminal-green{color:var(--green)}.text-terminal-orange{color:var(--orange)}.text-terminal-purple{color:var(--purple)}.text-terminal-red{color:var(--red)}.text-terminal-text{color:var(--text)}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.placeholder-terminal-dim::-moz-placeholder{color:var(--dim)}.placeholder-terminal-dim::placeholder{color:var(--dim)}.placeholder-terminal-dimmer::-moz-placeholder{color:var(--dimmer)}.placeholder-terminal-dimmer::placeholder{color:var(--dimmer)}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(251\,146\,60\,0\.5\)\]{--tw-shadow: 0 0 8px rgba(251,146,60,.5);--tw-shadow-colored: 0 0 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-layer-lg{--tw-shadow: var(--shadow-lg);--tw-shadow-colored: var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-layer-md{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-layer-sm{--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-layer-xl{--tw-shadow: var(--shadow-xl);--tw-shadow-colored: var(--shadow-xl);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-terminal-border-subtle{--tw-ring-color: var(--border-subtle)}.ring-transparent{--tw-ring-color: transparent}.blur-2xl{--tw-blur: blur(40px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-75{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-sm{--tw-drop-shadow: drop-shadow(0 1px 1px rgb(0 0 0 / .05));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[left\]{transition-property:left;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-material{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-material-decel,.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}html,body{overflow-x:hidden;max-width:100vw}:root{--font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif}:root,.dark{--bg: #0d1117;--surface: #161b22;--surface-hover: #21262d;--surface-2: #1c2129;--surface-inset: #010409;--border: #30363d;--border-subtle: rgba(48, 54, 61, .5);--text: #c9d1d9;--dim: #8b949e;--dimmer: #7d8590;--green: #3fb950;--green-subtle: rgba(63, 185, 80, .15);--green-emphasis: rgba(63, 185, 80, .25);--blue: #79b8ff;--blue-subtle: rgba(121, 184, 255, .15);--blue-emphasis: rgba(121, 184, 255, .25);--orange: #d29922;--orange-subtle: rgba(210, 153, 34, .15);--orange-emphasis: rgba(210, 153, 34, .25);--red: #f85149;--red-subtle: rgba(248, 81, 73, .15);--red-emphasis: rgba(248, 81, 73, .25);--purple: #b392f0;--purple-subtle: rgba(179, 146, 240, .15);--purple-emphasis: rgba(179, 146, 240, .25);--cyan: #56d4dd;--cyan-subtle: rgba(86, 212, 221, .15);--shadow-color: 215 28% 4%;--shadow-sm: 0 1px 2px hsl(var(--shadow-color) / .5);--shadow-md: 0 1px 2px hsl(var(--shadow-color) / .4), 0 4px 8px hsl(var(--shadow-color) / .3);--shadow-lg: 0 1px 3px hsl(var(--shadow-color) / .4), 0 4px 8px hsl(var(--shadow-color) / .3), 0 12px 24px hsl(var(--shadow-color) / .25);--shadow-xl: 0 2px 4px hsl(var(--shadow-color) / .4), 0 8px 16px hsl(var(--shadow-color) / .3), 0 24px 48px hsl(var(--shadow-color) / .25);--surface-subtle-glass: rgba(13, 17, 23, .7)}.light{--bg: #ffffff;--surface: #f6f8fa;--surface-hover: #e6edf3;--surface-2: #ebeef1;--surface-inset: #f0f2f5;--border: #d0d7de;--border-subtle: rgba(208, 215, 222, .5);--text: #24292f;--dim: #57606a;--dimmer: #697078;--green: #1a7f37;--green-subtle: rgba(26, 127, 55, .1);--green-emphasis: rgba(26, 127, 55, .2);--blue: #0969da;--blue-subtle: rgba(9, 105, 218, .1);--blue-emphasis: rgba(9, 105, 218, .2);--orange: #9a6700;--orange-subtle: rgba(154, 103, 0, .1);--orange-emphasis: rgba(154, 103, 0, .2);--red: #cf222e;--red-subtle: rgba(207, 34, 46, .1);--red-emphasis: rgba(207, 34, 46, .2);--purple: #8250df;--purple-subtle: rgba(130, 80, 223, .1);--purple-emphasis: rgba(130, 80, 223, .2);--cyan: #0e7c86;--cyan-subtle: rgba(14, 124, 134, .1);--shadow-color: 220 10% 50%;--shadow-sm: 0 1px 2px hsl(var(--shadow-color) / .1);--shadow-md: 0 1px 2px hsl(var(--shadow-color) / .08), 0 4px 8px hsl(var(--shadow-color) / .06);--shadow-lg: 0 1px 3px hsl(var(--shadow-color) / .08), 0 4px 8px hsl(var(--shadow-color) / .06), 0 12px 24px hsl(var(--shadow-color) / .05);--shadow-xl: 0 2px 4px hsl(var(--shadow-color) / .08), 0 8px 16px hsl(var(--shadow-color) / .06), 0 24px 48px hsl(var(--shadow-color) / .05);--surface-subtle-glass: rgba(255, 255, 255, .75)}html.theme-transition,html.theme-transition *,html.theme-transition *:before,html.theme-transition *:after{transition:background-color .25s ease,border-color .25s ease,color .25s ease}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}button,[role=button]{-webkit-tap-highlight-color:transparent}:focus:not(:focus-visible){outline:none}:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:4px}@supports (padding: env(safe-area-inset-top)){.safe-top{padding-top:max(env(safe-area-inset-top),1.25rem)}.safe-bottom{padding-bottom:env(safe-area-inset-bottom)}}@keyframes blink{0%,to{opacity:1}50%{opacity:0}}.typing-cursor:after{content:"█";animation:blink 1s step-end infinite;color:var(--green)}@keyframes fade-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.scene-enter{animation:fade-in .3s cubic-bezier(.4,0,.2,1)}@keyframes pulse-border{0%,to{border-color:#d299224d}50%{border-color:#d2992299}}.pause-overlay{animation:pulse-border 2s ease-in-out infinite}@keyframes jump-target-flash{0%{box-shadow:0 0 #3fb95000;outline-color:#3fb95000}30%{box-shadow:0 0 0 3px #3fb95040;outline-color:#3fb95099}to{box-shadow:0 0 #3fb95000;outline-color:#3fb95000}}.jump-target-flash{outline:1px solid transparent;animation:jump-target-flash .85s ease-out}@keyframes nav-focus-pulse{0%,to{transform:translateY(0)}50%{transform:translateY(-1px)}}.scene-nav-focused{animation:nav-focus-pulse .9s ease-in-out 2}@keyframes landing-glow{0%,to{box-shadow:0 0 #3fb95000}50%{box-shadow:0 0 20px 2px #3fb95026}}.landing-pulse{animation:landing-glow 2.5s ease-in-out infinite}.instant-tooltip{position:relative}.instant-tooltip .instant-tooltip-text{visibility:hidden;opacity:0;position:absolute;left:50%;top:100%;transform:translate(-50%);margin-top:6px;padding:4px 8px;border-radius:6px;background:var(--surface);border:1px solid var(--border-subtle);box-shadow:var(--shadow-md);color:var(--text);font:11px / 1.4 var(--font-sans),monospace;text-transform:none;letter-spacing:normal;white-space:pre-line;pointer-events:none;z-index:50;transition:opacity .08s ease}.instant-tooltip:hover .instant-tooltip-text{visibility:visible;opacity:1}.hover-lift{transition:transform .25s cubic-bezier(.175,.885,.32,1.275),box-shadow .25s cubic-bezier(.175,.885,.32,1.275),background-color .2s ease}.hover-lift:hover{transform:translateY(-2px);box-shadow:var(--shadow-lg)}.glass-effect{backdrop-filter:blur(12px) saturate(180%);-webkit-backdrop-filter:blur(12px) saturate(180%);background-color:var(--surface-subtle-glass)}.premium-card{position:relative}.premium-card:before{content:"";position:absolute;inset:0;padding:1px;border-radius:inherit;background:linear-gradient(135deg,var(--green-subtle),var(--blue-subtle));-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none;opacity:.5}@keyframes shimmer{0%{background-position:-1000px 0}to{background-position:1000px 0}}.skeleton{background:linear-gradient(90deg,var(--surface-2) 25%,var(--surface-hover) 50%,var(--surface-2) 75%);background-size:1000px 100%;animation:shimmer 2s infinite linear;border-radius:4px}.bg-dot-grid{background-image:radial-gradient(circle,var(--text) 1px,transparent 1px);background-size:24px 24px;opacity:.03}.minimap-item{transition:background-color .2s cubic-bezier(.4,0,.2,1),border-color .2s cubic-bezier(.4,0,.2,1)}.prose-terminal{line-height:1.6}.prose-terminal p{margin:.5em 0}.prose-terminal code{background:var(--surface);padding:.15em .4em;border-radius:4px;font-size:.9em}.prose-terminal pre{background:var(--surface);padding:.75em 1em;border-radius:6px;overflow-x:auto;margin:.5em 0}.prose-terminal pre code{background:none;padding:0}.prose-terminal ul,.prose-terminal ol{padding-left:1.5em;margin:.5em 0}.prose-terminal li{margin:.25em 0}.prose-terminal h1,.prose-terminal h2,.prose-terminal h3{margin:.75em 0 .5em;font-weight:600}.prose-terminal blockquote{border-left:3px solid var(--border);padding-left:1em;color:var(--dim);margin:.5em 0}.prose-terminal a{color:var(--blue);text-decoration:underline}.prose-terminal table{border-collapse:collapse;margin:.5em 0}.prose-terminal th,.prose-terminal td{border:1px solid var(--border);padding:.4em .8em}.placeholder\:text-terminal-dimmer::-moz-placeholder{color:var(--dimmer)}.placeholder\:text-terminal-dimmer::placeholder{color:var(--dimmer)}.hover\:-translate-y-0\.5:hover{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-\[rgba\(168\,85\,247\,0\.5\)\]:hover{border-color:#a855f780}.hover\:border-terminal-border:hover{border-color:var(--border)}.hover\:border-terminal-green:hover{border-color:var(--green)}.hover\:bg-\[\#32383f\]:hover{--tw-bg-opacity: 1;background-color:rgb(50 56 63 / var(--tw-bg-opacity, 1))}.hover\:bg-\[rgba\(168\,85\,247\,0\.2\)\]:hover{background-color:#a855f733}.hover\:bg-\[rgba\(168\,85\,247\,0\.25\)\]:hover{background-color:#a855f740}.hover\:bg-terminal-blue-emphasis:hover{background-color:var(--blue-emphasis)}.hover\:bg-terminal-blue-subtle:hover{background-color:var(--blue-subtle)}.hover\:bg-terminal-green-emphasis:hover{background-color:var(--green-emphasis)}.hover\:bg-terminal-orange-emphasis:hover{background-color:var(--orange-emphasis)}.hover\:bg-terminal-orange-subtle:hover{background-color:var(--orange-subtle)}.hover\:bg-terminal-purple-emphasis:hover{background-color:var(--purple-emphasis)}.hover\:bg-terminal-purple-subtle:hover{background-color:var(--purple-subtle)}.hover\:bg-terminal-red-emphasis:hover{background-color:var(--red-emphasis)}.hover\:bg-terminal-red-subtle:hover{background-color:var(--red-subtle)}.hover\:bg-terminal-surface:hover{background-color:var(--surface)}.hover\:bg-terminal-surface-2:hover{background-color:var(--surface-2)}.hover\:bg-terminal-surface-hover:hover{background-color:var(--surface-hover)}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-terminal-blue:hover{color:var(--blue)}.hover\:text-terminal-dim:hover{color:var(--dim)}.hover\:text-terminal-green:hover{color:var(--green)}.hover\:text-terminal-orange:hover{color:var(--orange)}.hover\:text-terminal-red:hover{color:var(--red)}.hover\:text-terminal-text:hover{color:var(--text)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-layer-lg:hover{--tw-shadow: var(--shadow-lg);--tw-shadow-colored: var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-layer-md:hover{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:ring-1:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.disabled\:cursor-wait:disabled{cursor:wait}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:-translate-y-0\.5{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group\/help:hover .group-hover\/help\:border-terminal-text{border-color:var(--text)}.group\/help:hover .group-hover\/help\:bg-terminal-text{background-color:var(--text)}.group\/help:hover .group-hover\/help\:text-terminal-bg{color:var(--bg)}.group\/ref:hover .group-hover\/ref\:text-terminal-text{color:var(--text)}.group\/search:hover .group-hover\/search\:text-terminal-blue{color:var(--blue)}.group:hover .group-hover\:text-terminal-green{color:var(--green)}.group:hover .group-hover\:text-terminal-text{color:var(--text)}.group\/batch:hover .group-hover\/batch\:opacity-100,.group\/help:hover .group-hover\/help\:opacity-100,.group\/pause:hover .group-hover\/pause\:opacity-100,.group\/scene:hover .group-hover\/scene\:opacity-100,.group\/search:hover .group-hover\/search\:opacity-100{opacity:1}.group\/search:hover .group-hover\/search\:opacity-80{opacity:.8}.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-60{opacity:.6}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-red-900\/30:is(.dark *){background-color:#7f1d1d4d}.dark\:bg-terminal-surface-2:is(.dark *){background-color:var(--surface-2)}.dark\:bg-white\/5:is(.dark *){background-color:#ffffff0d}@media(min-width:640px){.sm\:mx-0{margin-left:0;margin-right:0}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:gap-3{gap:.75rem}.sm\:rounded-xl{border-radius:.75rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:py-3{padding-top:.75rem;padding-bottom:.75rem}.sm\:pt-\[15vh\]{padding-top:15vh}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-\[10px\]{font-size:10px}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media(min-width:768px){.md\:ml-12{margin-left:3rem}.md\:mt-10{margin-top:2.5rem}.md\:block{display:block}.md\:inline{display:inline}.md\:flex{display:flex}.md\:inline-flex{display:inline-flex}.md\:hidden{display:none}.md\:min-h-0{min-height:0px}.md\:max-w-\[300px\]{max-width:300px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:gap-2{gap:.5rem}.md\:gap-3{gap:.75rem}.md\:space-y-7>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.75rem * var(--tw-space-y-reverse))}.md\:p-8{padding:2rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:pt-0{padding-top:0}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-5xl{font-size:3rem;line-height:1}}@media(min-width:1024px){.lg\:inline{display:inline}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&\>svg\]\:block>svg{display:block}.\[\&\>svg\]\:h-auto>svg{height:auto}.\[\&\>svg\]\:w-full>svg{width:100%}</style>
|
|
160
165
|
</head>
|
|
161
166
|
<body class="bg-terminal-bg text-terminal-text min-h-screen">
|
|
162
167
|
<div id="root"></div>
|