vibe-replay 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/viewer.html +101 -155
- package/dist/index.js +1971 -629
- package/package.json +21 -21
package/assets/viewer.html
CHANGED
|
@@ -5,163 +5,109 @@
|
|
|
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 Dh(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Qc={exports:{}},Ls={};/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/var qp;function Bb(){if(qp)return Ls;qp=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 Fp;function $b(){return Fp||(Fp=1,Qc.exports=Bb()),Qc.exports}var n=$b(),Xc={exports:{}},Ce={};/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* @license React
|
|
26
|
-
*
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
* LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/var Vp;function Gb(){return Vp||(Vp=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 Qp;function qb(){return Qp||(Qp=1,Jc.exports=Gb()),Jc.exports}var Pc={exports:{}},zt={};/**
|
|
33
|
-
* @license React
|
|
34
|
-
* react-dom.production.js
|
|
35
|
-
*
|
|
36
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
37
|
-
*
|
|
38
|
-
* This source code is licensed under the MIT license found in the
|
|
39
|
-
* LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/var Xp;function Fb(){if(Xp)return zt;Xp=1;var l=Au();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 Ip;function _h(){if(Ip)return Pc.exports;Ip=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=Fb(),Pc.exports}/**
|
|
41
|
-
* @license React
|
|
42
|
-
* react-dom-client.production.js
|
|
43
|
-
*
|
|
44
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
-
*
|
|
46
|
-
* This source code is licensed under the MIT license found in the
|
|
47
|
-
* LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/var Jp;function Yb(){if(Jp)return zs;Jp=1;var l=qb(),r=Au(),i=_h();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 Y(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)?dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dp(t),e=mp(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=mp(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 Ye(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
|
-
`),F=N.split(`
|
|
52
|
-
`);for(c=s=0;s<D.length&&!D[s].includes("DetermineComponentFrameRoot");)s++;for(;c<F.length&&!F[c].includes("DetermineComponentFrameRoot");)c++;if(s===D.length||c===F.length)for(s=D.length-1,c=F.length-1;1<=s&&0<=c&&D[s]!==F[c];)c--;for(;1<=s&&0<=c;s--,c--)if(D[s]!==F[c]){if(s!==1||c!==1)do if(s--,c--,0>c||D[s]!==F[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:"")?Ye(a):""}function kn(e,t){switch(e.tag){case 26:case 27:case 5:return Ye(e.type);case 16:return Ye("Lazy");case 13:return e.child!==t&&t!==null?Ye("Suspense Fallback"):Ye("Suspense");case 19:return Ye("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 Ye("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
|
-
Error generating stack: `+s.message+`
|
|
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,Ft=Math.log,Yt=Math.LN2;function rn(e){return e>>>=0,e===0?32:31-(Ft(e)/Yt|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,F=e.hiddenUpdates;for(a=b&~a;0<a;){var ee=31-tt(a),se=1<<ee;N[ee]=0,D[ee]=-1;var Z=F[ee];if(Z!==null)for(F[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 Iu(){var e=z.p;return e!==0?e:(e=window.event,e===void 0?32:Lp(e.type))}function Ju(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,Cx="__reactListeners$"+la,Tx="__reactHandles$"+la,Ku="__reactResources$"+la,Vl="__reactMarker$"+la;function $i(e){delete e[Mt],delete e[Zt],delete e[Bi],delete e[Cx],delete e[Tx]}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=yp(e);e!==null;){if(a=e[Mt])return a;e=yp(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[Ku];return t||(t=e[Ku]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Et(e){e[Vl]=!0}var Pu=new Set,Wu={};function Ra(e,t){ll(e,t),ll(e+"Capture",t)}function ll(e,t){for(Wu[e]=t,e=0;e<t.length;e++)Pu.add(t[e])}var Ex=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]*$"),ed={},td={};function Ax(e){return Cn.call(td,e)?!0:Cn.call(ed,e)?!1:Ex.test(e)?td[e]=!0:(ed[e]=!0,!1)}function Ks(e,t,a){if(Ax(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 nd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Rx(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=nd(e)?"checked":"value";e._valueTracker=Rx(e,t,""+e[t])}}function ad(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),s="";return e&&(s=nd(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 Mx=/[\n"\\]/g;function un(e){return e.replace(Mx,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 ld(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 sd(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 rd(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 Dx=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 id(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||Dx.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function od(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&&id(e,c,s)}else for(var d in t)t.hasOwnProperty(d)&&id(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 _x=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"]]),Ox=/^[\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 Ox.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function $n(){}var Fi=null;function Yi(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 cd(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&&ad(s)}break e;case"textarea":sd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&sl(e,!!a.multiple,t,!1)}}}var Zi=!1;function ud(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,cd(t),e)))for(t=0;t<e.length;t++)cd(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 dd(){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 md(){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:md,this.isPropagationStopped=md,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}),Lx=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}}),fd=Vt(sr),zx=v({},sr,{dataTransfer:0}),Bx=Vt(zx),$x=v({},Jl,{relatedTarget:0}),Ji=Vt($x),Ux=v({},Ma,{animationName:0,elapsedTime:0,pseudoElement:0}),Hx=Vt(Ux),Gx=v({},Ma,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qx=Vt(Gx),Fx=v({},Ma,{data:0}),pd=Vt(Fx),Yx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zx={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"},Vx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vx[e])?!!t[e]:!1}function Ki(){return Qx}var Xx=v({},Jl,{key:function(e){if(e.key){var t=Yx[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"?Zx[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}}),Ix=Vt(Xx),Jx=v({},sr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hd=Vt(Jx),Kx=v({},Jl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ki}),Px=Vt(Kx),Wx=v({},Ma,{propertyName:0,elapsedTime:0,pseudoElement:0}),eg=Vt(Wx),tg=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}),ng=Vt(tg),ag=v({},Ma,{newState:0,oldState:0}),lg=Vt(ag),sg=[9,13,27,32],Pi=Un&&"CompositionEvent"in window,Pl=null;Un&&"documentMode"in document&&(Pl=document.documentMode);var rg=Un&&"TextEvent"in window&&!Pl,xd=Un&&(!Pi||Pl&&8<Pl&&11>=Pl),gd=" ",bd=!1;function yd(e,t){switch(e){case"keyup":return sg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cl=!1;function ig(e,t){switch(e){case"compositionend":return vd(t);case"keypress":return t.which!==32?null:(bd=!0,gd);case"textInput":return e=t.data,e===gd&&bd?null:e;default:return null}}function og(e,t){if(cl)return e==="compositionend"||!Pi&&yd(e,t)?(e=dd(),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 xd&&t.locale!=="ko"?null:t.data;default:return null}}var cg={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 jd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!cg[e.type]:t==="textarea"}function wd(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 ug(e){sp(e,0)}function rr(e){var t=Ql(e);if(ad(t))return e}function Nd(e,t){if(e==="change")return t}var Sd=!1;if(Un){var Wi;if(Un){var eo="oninput"in document;if(!eo){var kd=document.createElement("div");kd.setAttribute("oninput","return;"),eo=typeof kd.oninput=="function"}Wi=eo}else Wi=!1;Sd=Wi&&(!document.documentMode||9<document.documentMode)}function Cd(){Wl&&(Wl.detachEvent("onpropertychange",Td),es=Wl=null)}function Td(e){if(e.propertyName==="value"&&rr(es)){var t=[];wd(t,es,e,Yi(e)),ud(ug,t)}}function dg(e,t,a){e==="focusin"?(Cd(),Wl=t,es=a,Wl.attachEvent("onpropertychange",Td)):e==="focusout"&&Cd()}function mg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return rr(es)}function fg(e,t){if(e==="click")return rr(t)}function pg(e,t){if(e==="input"||e==="change")return rr(t)}function hg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:hg;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 Ed(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ad(e,t){var a=Ed(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=Ed(a)}}function Rd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Rd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Md(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 xg=Un&&"documentMode"in document&&11>=document.documentMode,ul=null,no=null,ns=null,ao=!1;function Dd(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={},_d={};Un&&(_d=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 _d)return lo[e]=t[a];return e}var Od=_a("animationend"),Ld=_a("animationiteration"),zd=_a("animationstart"),gg=_a("transitionrun"),bg=_a("transitionstart"),yg=_a("transitioncancel"),Bd=_a("transitionend"),$d=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){$d.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&&Ud(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 Ud(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 vg(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 vg(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 Hd(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=kb(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 Gd(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 qd=new WeakMap;function mn(e,t){if(typeof e=="object"&&e!==null){var a=qd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:qt(t)},qd.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 Fd(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),Fd(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 Zd(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),ld(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),rd(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||cp(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 Vd(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 Vd(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),Vd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));nt=bp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));nt=bp(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 Fn(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 Qd(Ba,e)}function pr(e,t){return Ba===null&&$a(e),Qd(e,t)}function Qd(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 jg=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()})}},wg=l.unstable_scheduleCallback,Ng=l.unstable_NormalPriority,xt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yo(){return{controller:new jg,data:new Map,refCount:0}}function ss(e){e.refCount--,e.refCount===0&&wg(Ng,function(){e.controller.abort()})}var rs=null,vo=0,bl=0,yl=null;function Sg(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(Xd,Xd),t}function Xd(){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 kg(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 Id=U.S;U.S=function(e,t){_f=Ze(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Sg(e,t),Id!==null&&Id(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 Jd(){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 Kd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Pd(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,em(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,em(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 Wd(){if(Ga===null)throw Error(o(459));var e=Ga;return Ga=null,e}function em(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=[]),Pd(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 tm(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 F(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?F(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,F(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(zb){return t(B,zb)}),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=tm(!0),nm=tm(!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),Ud(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,F=D.next;D.next=null,b===null?d=F:b.next=F,b=D;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,N=ee.lastBaseUpdate,N!==b&&(N===null?ee.firstBaseUpdate=F:N.next=F,ee.lastBaseUpdate=D))}if(d!==null){var se=c.baseState;b=0,ee=F=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?(F=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=F,c.lastBaseUpdate=ee,d===null&&(c.shared.lanes=0),ga|=b,e.lanes=b,e.memoizedState=se}}function am(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function lm(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)am(a[e],t)}var wl=T(null),vr=T(0);function sm(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 rm(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 Yn=0,Te=null,Je=null,gt=null,wr=!1,Nl=!1,Fa=!1,Nr=0,ms=0,Sl=null,Cg=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 Yn=d,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?Fm:Vo,Fa=!1,d=a(s,c),Fa=!1,Nl&&(d=om(t,a,s,c)),im(e),d}function im(e){U.H=hs;var t=Je!==null&&Je.next!==null;if(Yn=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 om(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 Tg(){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}Yn=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=Pd(Sl,e,t),t=Te,(gt===null?t.memoizedState:gt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?Fm: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,F=t,ee=!1;do{var se=F.lane&-536870913;if(se!==F.lane?(Me&se)===se:(Yn&se)===se){var Z=F.revertLane;if(Z===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),se===bl&&(ee=!0);else if((Yn&Z)===Z){F=F.next,Z===bl&&(ee=!0);continue}else se={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(N=D=se,b=d):D=D.next=se,Te.lanes|=Z,ga|=Z;se=F.action,Fa&&a(d,se),d=F.hasEagerState?F.eagerState:a(d,se)}else Z={lane:se,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(N=D=Z,b=d):D=D.next=Z,Te.lanes|=se,ga|=se;F=F.next}while(F!==null&&F!==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 cm(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(mm.bind(null,s,c,e),[e]),c.getSnapshot!==t||b||gt!==null&>.memoizedState.tag&1){if(s.flags|=2048,kl(9,{destroy:void 0},dm.bind(null,s,c,a,t),null),We===null)throw Error(o(349));d||(Yn&127)!==0||um(s,t,a)}return a}function um(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 dm(e,t,a,s){t.value=a,t.getSnapshot=s,fm(t)&&pm(e)}function mm(e,t,a){return a(function(){fm(t)&&pm(e)})}function fm(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Pt(e,a)}catch{return!0}}function pm(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(),Fa){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 hm(e,t,a,s){return e.baseState=a,zo(e,Je,typeof s=="function"?s:Zn)}function Eg(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,xm(t,d)):(d.next=a.next,t.pending=a.next=d)}}function xm(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),gm(e,t,N)}catch(F){Uo(e,t,F)}finally{d!==null&&b.types!==null&&(d.types=b.types),U.T=d}}else try{d=a(c,s),gm(e,t,d)}catch(F){Uo(e,t,F)}}function gm(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){bm(e,t,s)},function(s){return Uo(e,t,s)}):bm(e,t,a)}function bm(e,t,a){t.status="fulfilled",t.value=a,ym(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,xm(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,ym(t),t=t.next;while(t!==s)}e.action=null}function ym(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function vm(e,t){return t}function jm(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:vm,lastRenderedState:t},a.queue=s,a=Hm.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=Eg.bind(null,Te,c,d,a),c.dispatch=a,s.memoizedState=e,[t,a,!1]}function wm(e){var t=ft();return Nm(t,Je,e)}function Nm(e,t,a){if(t=zo(e,t,vm)[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},Ag.bind(null,c,a),null)),[s,d,e]}function Ag(e,t){e.action=t}function Sm(e){var t=ft(),a=Je;if(a!==null)return Nm(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 km(){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 Cm(e,t){Tr(8390656,8,e,t)}function Ho(e,t){Er(2048,8,e,t)}function Rg(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 Tm(e){var t=ft().memoizedState;return Rg({ref:t,nextImpl:e}),function(){if((Ve&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Em(e,t){return Er(4,2,e,t)}function Am(e,t){return Er(4,4,e,t)}function Rm(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 Mm(e,t,a){a=a!=null?a.concat([e]):null,Er(4,4,Rm.bind(null,t,e),a)}function Go(){}function Dm(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 _m(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(),Fa){Ue(!0);try{e()}finally{Ue(!1)}}return a.memoizedState=[s,t],s}function qo(e,t,a){return a===void 0||(Yn&1073741824)!==0&&(Me&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Lf(),Te.lanes|=e,ga|=e,a)}function Om(e,t,a,s){return Pt(a,t)?a:wl.current!==null?(e=qo(e,a,s),Pt(e,t)||(bt=!0),e):(Yn&42)===0||(Yn&1073741824)!==0&&(Me&261930)===0?(bt=!0,e.memoizedState=a):(e=Lf(),Te.lanes|=e,ga|=e,t)}function Lm(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(),F=U.S;if(F!==null&&F(N,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var ee=kg(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 Mg(){}function Fo(e,t,a,s){if(e.tag!==5)throw Error(o(476));var c=zm(e).queue;Lm(e,c,t,Q,a===null?Mg:function(){return Bm(e),a(s)})}function zm(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 Bm(e){var t=zm(e);t.next===null&&(t=e.alternate.memoizedState),ps(e,t.next.queue,{},ln())}function Yo(){return _t(Ms)}function $m(){return ft().memoizedState}function Um(){return ft().memoizedState}function Dg(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 _g(e,t,a){var s=ln();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ar(e)?Gm(t,a):(a=io(e,t,a,s),a!==null&&(Kt(a,e,s),qm(a,t,s)))}function Hm(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))Gm(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),qm(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 Gm(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 qm(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 Fm={readContext:_t,use:kr,useCallback:function(e,t){return Ut().memoizedState=[e,t===void 0?null:t],e},useContext:_t,useEffect:Cm,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Tr(4194308,4,Rm.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(Fa){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(Fa){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=_g.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=Hm.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=Lm.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||um(s,t,a)}c.memoizedState=a;var d={value:a,getSnapshot:t};return c.queue=d,Cm(mm.bind(null,s,d,e),[e]),s.flags|=2048,kl(9,{destroy:void 0},dm.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=Cg++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Yo,useFormState:jm,useActionState:jm,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=Dg.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:Dm,useContext:_t,useEffect:Ho,useImperativeHandle:Mm,useInsertionEffect:Em,useLayoutEffect:Am,useMemo:_m,useReducer:Cr,useRef:km,useState:function(){return Cr(Zn)},useDebugValue:Go,useDeferredValue:function(e,t){var a=ft();return Om(a,Je.memoizedState,e,t)},useTransition:function(){var e=Cr(Zn)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:fs(e),t]},useSyncExternalStore:cm,useId:$m,useHostTransitionStatus:Yo,useFormState:wm,useActionState:wm,useOptimistic:function(e,t){var a=ft();return hm(a,Je,e,t)},useMemoCache:Lo,useCacheRefresh:Um};Vo.useEffectEvent=Tm;var Ym={readContext:_t,use:kr,useCallback:Dm,useContext:_t,useEffect:Ho,useImperativeHandle:Mm,useInsertionEffect:Em,useLayoutEffect:Am,useMemo:_m,useReducer:Bo,useRef:km,useState:function(){return Bo(Zn)},useDebugValue:Go,useDeferredValue:function(e,t){var a=ft();return Je===null?qo(a,e,t):Om(a,Je.memoizedState,e,t)},useTransition:function(){var e=Bo(Zn)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:fs(e),t]},useSyncExternalStore:cm,useId:$m,useHostTransitionStatus:Yo,useFormState:Sm,useActionState:Sm,useOptimistic:function(e,t){var a=ft();return Je!==null?hm(a,Je,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Lo,useCacheRefresh:Um};Ym.useEffectEvent=Tm;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 Zm(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 Vm(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 Ya(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 Qm(e){ir(e)}function Xm(e){console.error(e)}function Im(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 Jm(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 Km(e){return e=da(e),e.tag=3,e}function Pm(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(){Jm(t,a,s)}}var b=a.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Jm(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 Og(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=Km(c),Pm(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?nm(t,null,a,s):qa(t,e.child,a,s)}function Wm(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 ef(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,tf(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 tf(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 nf(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 af(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?sm(t,d):To(),rm(t);else return s=t.lanes=536870912,af(e,t,d!==null?d.baseLanes|a:a,a,s)}else d!==null?(hr(t,d.cachePool),sm(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 af(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(),rm(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 lf(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 Lg(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=gp(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=Gd(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=lf(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=lf(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 sf(e,t,a,s,c,d){return $a(t),t.updateQueue=null,a=om(t,s,a,c),im(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 rf(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=Ya(a,N);d.props=D;var F=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||F!==b)&&Vm(t,d,s,b),ua=!1;var Z=t.memoizedState;d.state=Z,ds(t,s,d,c),us(),F=t.memoizedState,N||Z!==F||ua?(typeof se=="function"&&(Qo(t,a,se,s),F=t.memoizedState),(D=ua||Zm(t,a,D,s,Z,F,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=F),d.props=s,d.state=F,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=Ya(a,b),d.props=ee,se=t.pendingProps,Z=d.context,F=a.contextType,D=fl,typeof F=="object"&&F!==null&&(D=_t(F)),N=a.getDerivedStateFromProps,(F=typeof N=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b!==se||Z!==D)&&Vm(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||Zm(t,a,ee,s,Z,X,D)||e!==null&&e.dependencies!==null&&fr(e.dependencies))?(F||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 of(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:Jd()}}function ec(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=an),e}function cf(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=gp(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=Gd(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 F=b.dgst;b=F,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,F=D.sibling,s=Hn(D,{mode:"hidden",children:s.children}),s.subtreeFlags=D.subtreeFlags&65011712,F!==null?N=Hn(F,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=Jd(),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 uf(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 df(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&&uf(e,a,t);else if(e.tag===19)uf(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 zg(e,t,a){switch(t.tag){case 3:Y(t,t.stateNode.containerInfo),ca(t,xt,e.memoizedState.cache),za();break;case 27:case 5:be(t);break;case 4:Y(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?cf(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 df(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,nf(e,t,a,t.pendingProps);case 24:ca(t,xt,e.memoizedState.cache)}return Vn(e,t,a)}function mf(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,zg(e,t,a);bt=(e.flags&131072)!==0}else bt=!1,Le&&(t.flags&1048576)!==0&&Fd(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=Ya(e,s),t.tag=1,t=rf(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=Wm(null,t,e,s,a);break e}else if(c===H){t.tag=14,t=ef(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=Ya(s,t.pendingProps),rf(e,t,s,c,a);case 3:e:{if(Y(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=of(e,t,s,a);break e}else if(s!==c){c=mn(Error(o(424)),t),ls(c),t=of(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=nm(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=Np(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=Np(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return be(t),e===null&&Le&&(s=t.stateNode=vp(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=mb(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,Tg,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=fb(a,t.pendingProps,hn),a!==null?(t.stateNode=a,Dt=t,nt=null,e=!0):e=!1),e||oa(t)),null;case 13:return cf(e,t,a);case 4:return Y(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 Wm(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 ef(e,t,t.type,t.pendingProps,a);case 15:return tf(e,t,t.type,t.pendingProps,a);case 19:return df(e,t,a);case 31:return Lg(e,t,a);case 22:return nf(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(Uf())e.flags|=8192;else throw Ga=gr,wo}else e.flags&=-16777217}function ff(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ep(t))if(Uf())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 Bg(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),Fn(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),ff(t,d)):(at(t),sc(t,c,null,s,a))):d?d!==e.memoizedState?(Qn(t),at(t),ff(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)?Zd(t):(e=vp(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))Zd(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||cp(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 Fn(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;)Hd(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),Fn(xt),at(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function $g(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 Fn(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 Fn(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 Fn(xt),null;case 25:return null;default:return null}}function pf(e,t){switch(fo(t),t.tag){case 3:Fn(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:Fn(t.type);break;case 22:case 23:tn(t),Eo(),e!==null&&_(Ua);break;case 24:Fn(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,F=N;try{F()}catch(ee){Ie(c,D,ee)}}}s=s.next}while(s!==d)}}catch(ee){Ie(t,t.return,ee)}}function hf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{lm(t,a)}catch(s){Ie(e,e.return,s)}}}function xf(e,t,a){a.props=Ya(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 gf(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;rb(s,e.type,a,t),s[Zt]=t}catch(c){Ie(e,e.return,c)}}function bf(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||bf(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 yf(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,vf=typeof WeakSet=="function"?WeakSet:Set,At=null;function Ug(e,t){if(e=e.containerInfo,Rc=ni,e=Md(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,F=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&&++F===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=Ya(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 jf(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=Ya(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Ie(a,a.return,b)}}s&64&&hf(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{lm(e,t)}catch(b){Ie(a,a.return,b)}}break;case 27:t===null&&s&4&&yf(a);case 26:case 5:Jn(e,a),t===null&&s&4&&gf(a),s&512&&ys(a,a.return);break;case 12:Jn(e,a);break;case 31:Jn(e,a),s&4&&Sf(e,a);break;case 13:Jn(e,a),s&4&&kf(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Xg.bind(null,a),pb(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 wf(e){var t=e.alternate;t!==null&&(e.alternate=null,wf(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;)Nf(e,t,a),a=a.sibling}function Nf(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,hp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Bl(e)):hp(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"&&xf(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 Sf(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 kf(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 Hg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new vf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new vf),t;default:throw Error(o(435,e.tag))}}function zr(e,t){var a=Hg(e);t.forEach(function(s){if(!a.has(s)){a.add(s);var c=Ig.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));Nf(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;)Cf(t,e),t=t.sibling}var jn=null;function Cf(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=Cp("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=Cp("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 Tp(c,e.type,e.stateNode);else e.stateNode=kp(c,s,e.memoizedProps);else d!==s?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,s===null?Tp(c,e.type,e.stateNode):kp(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,Tf(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,F=Xn,ee=yt;if(Xn=F||c,yt=ee||D,Xt(t,e),yt=ee,Xn=F,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?xp(X,!0):xp(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(bf(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,F=ic(e);oc(e,F,D);break;default:throw Error(o(161))}}catch(ee){Ie(e,e.return,ee)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Tf(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;)jf(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"&&xf(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(F){Ie(s,s.return,F)}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++)am(D[c],N)}catch(F){Ie(s,s.return,F)}}a&&b&64&&hf(d),ys(d,d.return);break;case 27:yf(d);case 26:case 5:Kn(c,d,a),a&&s===null&&b&4&&gf(d),ys(d,d.return);break;case 12:Kn(c,d,a);break;case 31:Kn(c,d,a),a&&b&4&&Sf(c,d);break;case 13:Kn(c,d,a),a&&b&4&&kf(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;)Ef(e,t,a,s),t=t.sibling}function Ef(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,F=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&&F&2048&&uc(b.alternate,b);break;case 24:Cl(d,b,N,D,c),c&&F&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;)Af(e,t,a),e=e.sibling}function Af(e,t,a){switch(e.tag){case 26:Tl(e,t,a),e.flags&js&&e.memoizedState!==null&&Cb(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 Rf(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,Df(s,e)}Rf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Mf(e),e=e.sibling}function Mf(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,Df(s,e)}Rf(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 Df(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(wf(s),s===a){At=null;break e}if(c!==null){c.return=d,At=c;break e}At=d}}}var Gg={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}},qg=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,_f=0,Ur=1/0,Hr=null,ba=null,St=0,ya=null,Rl=null,Wn=0,hc=0,xc=null,Of=null,Ss=0,gc=null;function ln(){return(Ve&2)!==0&&Me!==0?Me&-Me:U.T!==null?Nc():Iu()}function Lf(){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 zf(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?Zg(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&&!Fg(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=fp(Bf.bind(null,s,a,Jt,Hr,pc,t,an,Va,Al,xa,d,"Throttled",-0,0),c);break e}Bf(s,a,Jt,Hr,pc,t,an,Va,Al,xa,d,null,-0,0)}}break}while(!0);Rn(e)}function Bf(e,t,a,s,c,d,b,N,D,F,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},Af(t,d,se);var ge=(d&62914560)===d?$r-Ze():(d&4194048)===d?_f-Ze():0;if(ge=Tb(se,ge),ge!==null){Wn=d,e.cancelPendingCommit=ge(Zf.bind(null,e,t,d,a,s,c,b,N,D,ee,se,null,Z,X)),va(e,d,b,!F);return}}Zf(e,t,d,a,s,c,b,N,D)}function Fg(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;)pf(e.alternate,e),e=e.return;Ae=null}}function Ml(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,cb(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 $f(e,t){Te=null,U.H=hs,t===vl||t===xr?(t=Wd(),Xe=3):t===wo?(t=Wd(),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 Uf(){var e=en.current;return e===null?!0:(Me&4194048)===Me?xn===null:(Me&62914560)===Me||(Me&536870912)!==0?e===xn:!1}function Hf(){var e=U.H;return U.H=hs,e===null?hs:e}function Gf(){var e=U.A;return U.A=Gg,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=Hf(),d=Gf();(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 F=Xe;if(Xe=0,nn=null,Dl(e,N,D,F),a&&El){b=0;break e}break;default:F=Xe,Xe=0,nn=null,Dl(e,N,D,F)}}Yg(),b=ut;break}catch(ee){$f(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 Yg(){for(;Ae!==null;)qf(Ae)}function Zg(e,t){var a=Ve;Ve|=2;var s=Hf(),c=Gf();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(Kd(d)){Xe=0,nn=null,Ff(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:Kd(d)?(Xe=0,nn=null,Ff(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?Ep(b):N.stateNode.complete){Xe=0,nn=null;var D=N.sibling;if(D!==null)Ae=D;else{var F=N.return;F!==null?(Ae=F,Fr(F)):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))}}Vg();break}catch(ee){$f(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 Vg(){for(;Ae!==null&&!jt();)qf(Ae)}function qf(e){var t=mf(e.alternate,e,Pn);e.memoizedProps=e.pendingProps,t===null?Fr(e):Ae=t}function Ff(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=sf(a,t,t.pendingProps,t.type,void 0,Me);break;case 11:t=sf(a,t,t.pendingProps,t.type.render,t.ref,Me);break;case 5:Oo(t);default:pf(a,t),t=Ae=Hd(t,Pn),t=mf(a,t,Pn)}e.memoizedProps=e.pendingProps,t===null?Fr(e):Ae=t}function Dl(e,t,a,s){qn=Ba=null,Oo(t),jl=null,is=0;var c=t.return;try{if(Og(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)):Fr(t)}function Fr(e){var t=e;do{if((t.flags&32768)!==0){Yf(t,xa);return}e=t.return;var a=Bg(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=$g(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 Zf(e,t,a,s,c,d,b,N,D){e.cancelPendingCommit=null;do Yr();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,Of=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Jg(ce,function(){return Jf(),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{Ug(e,t,a)}finally{Ve=b,z.p=c,U.T=s}}St=1,Vf(),Qf(),Xf()}}function Vf(){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{Cf(t,e);var d=Mc,b=Md(e.containerInfo),N=d.focusedElem,D=d.selectionRange;if(b!==N&&N&&N.ownerDocument&&Rd(N.ownerDocument.documentElement,N)){if(D!==null&&to(N)){var F=D.start,ee=D.end;if(ee===void 0&&(ee=F),"selectionStart"in N)N.selectionStart=F,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=Ad(N,Ne),L=Ad(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 Qf(){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{jf(e,t.alternate,t)}finally{Ve=c,z.p=s,U.T=a}}St=3}}function Xf(){if(St===4||St===3){St=0,st();var e=ya,t=Rl,a=Wn,s=Of;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?St=5:(St=0,Rl=ya=null,If(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&&Yr(),Rn(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===gc?Ss++:(Ss=0,gc=e):Ss=0,ks(0)}}function If(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ss(t)))}function Yr(){return Vf(),Qf(),Xf(),Jf()}function Jf(){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,Mf(d.current),Ef(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,If(e,t)}}function Kf(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)Kf(e,e,a);else for(;t!==null;){if(t.tag===3){Kf(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=Km(2),s=ma(t,a,2),s!==null&&(Pm(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 qg;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=Qg.bind(null,e,t,a),t.then(e,e))}function Qg(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 Pf(e,t){t===0&&(t=Nt()),e=Oa(e,t),e!==null&&(Rt(e,t),Rn(e))}function Xg(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Pf(e,a)}function Ig(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),Pf(e,a)}function Jg(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,Pg())}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,np(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,np(s,d));s=s.next}while(a);wc=!1}}function Kg(){Wf()}function Wf(){Vr=jc=!1;var e=0;ja!==0&&ob()&&(e=ja);for(var t=Ze(),a=null,s=Zr;s!==null;){var c=s.next,d=ep(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 ep(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=tp.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 tp(e,t){if(St!==0&&St!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Yr()&&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:(zf(e,s,t),ep(e,Ze()),e.callbackNode!=null&&e.callbackNode===a?tp.bind(null,e):null)}function np(e,t){if(Yr())return null;zf(e,t,!0)}function Pg(){ub(function(){(Ve&6)!==0?ze(we,Kg):Wf()})}function Nc(){if(ja===0){var e=bl;e===0&&(e=Ln,Ln<<=1,(Ln&261888)===0&&(Ln=256)),ja=e}return ja}function ap(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:er(""+e)}function lp(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 Wg(e,t,a,s,c){if(t==="submit"&&a&&a.stateNode===c){var d=ap((c[Zt]||null).action),b=s.submitter;b&&(t=(t=b[Zt]||null)?ap(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?lp(c,b):new FormData(c);Fo(a,{pending:!0,data:D,method:c.method,action:d},null,D)}}else typeof d=="function"&&(N.preventDefault(),D=b?lp(c,b):new FormData(c),Fo(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],eb=kc.toLowerCase(),tb=kc[0].toUpperCase()+kc.slice(1);vn(eb,"on"+tb)}vn(Od,"onAnimationEnd"),vn(Ld,"onAnimationIteration"),vn(zd,"onAnimationStart"),vn("dblclick","onDoubleClick"),vn("focusin","onFocus"),vn("focusout","onBlur"),vn(gg,"onTransitionRun"),vn(bg,"onTransitionStart"),vn(yg,"onTransitionCancel"),vn(Bd,"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(" "),nb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Cs));function sp(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,F=N.currentTarget;if(N=N.listener,D!==d&&c.isPropagationStopped())break e;d=N,c.currentTarget=F;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,F=N.currentTarget,N=N.listener,D!==d&&c.isPropagationStopped())break e;d=N,c.currentTarget=F;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)||(rp(t,e,2,!1),a.add(s))}function Cc(e,t,a){var s=0;t&&(s|=4),rp(a,e,s,t)}var Qr="_reactListening"+Math.random().toString(36).slice(2);function Tc(e){if(!e[Qr]){e[Qr]=!0,Pu.forEach(function(a){a!=="selectionchange"&&(nb.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 rp(e,t,a,s){switch(Lp(t)){case 2:var c=Rb;break;case 8:c=Mb;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}ud(function(){var F=d,ee=Yi(a),se=[];e:{var Z=$d.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=Ix;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=fd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=Bx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=Px;break;case Od:case Ld:case zd:X=Hx;break;case Bd:X=eg;break;case"scroll":case"scrollend":X=Lx;break;case"wheel":X=ng;break;case"copy":case"cut":case"paste":X=qx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=hd;break;case"toggle":case"beforetoggle":X=lg}var Ne=(t&4)!==0,Pe=!Ne&&(e==="scroll"||e==="scrollend"),B=Ne?Z!==null?Z+"Capture":null:Z;Ne=[];for(var L=F,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!==Fi&&(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=F,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=F),X!==ge)){if(Ne=fd,le="onMouseLeave",B="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=hd,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)===F&&(Ne=new Ne(B,L+"enter",ge,a,ee),Ne.target=q,Ne.relatedTarget=Pe,le=Ne),Pe=le,X&&ge)t:{for(Ne=ab,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&&ip(se,Z,X,Ne,!1),ge!==null&&Pe!==null&&ip(se,Pe,ge,Ne,!0)}}e:{if(Z=F?Ql(F):window,X=Z.nodeName&&Z.nodeName.toLowerCase(),X==="select"||X==="input"&&Z.type==="file")var Ge=Nd;else if(jd(Z))if(Sd)Ge=pg;else{Ge=mg;var ye=dg}else X=Z.nodeName,!X||X.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?F&&qi(F.elementType)&&(Ge=Nd):Ge=fg;if(Ge&&(Ge=Ge(e,F))){wd(se,Ge,a,ee);break e}ye&&ye(e,Z,F),e==="focusout"&&F&&Z.type==="number"&&F.memoizedProps.value!=null&&Gi(Z,"number",Z.value)}switch(ye=F?Ql(F):window,e){case"focusin":(jd(ye)||ye.contentEditable==="true")&&(ul=ye,no=F,ns=null);break;case"focusout":ns=no=ul=null;break;case"mousedown":ao=!0;break;case"contextmenu":case"mouseup":case"dragend":ao=!1,Dd(se,a,ee);break;case"selectionchange":if(xg)break;case"keydown":case"keyup":Dd(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?yd(e,a)&&(De="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(De="onCompositionStart");De&&(xd&&a.locale!=="ko"&&(cl||De!=="onCompositionStart"?De==="onCompositionEnd"&&cl&&(Ee=dd()):(sa=ee,Qi="value"in sa?sa.value:sa.textContent,cl=!0)),ye=Xr(F,De),0<ye.length&&(De=new pd(De,e,null,a,ee),se.push({event:De,listeners:ye}),Ee?De.data=Ee:(Ee=vd(a),Ee!==null&&(De.data=Ee)))),(Ee=rg?ig(e,a):og(e,a))&&(De=Xr(F,"onBeforeInput"),0<De.length&&(ye=new pd("onBeforeInput","beforeinput",null,a,ee),se.push({event:ye,listeners:De}),ye.data=Ee)),Wg(se,e,F,a,ee)}sp(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 ab(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ip(e,t,a,s,c){for(var d=t._reactName,b=[];a!==null&&a!==s;){var N=a,D=N.alternate,F=N.stateNode;if(N=N.tag,D!==null&&D===s)break;N!==5&&N!==26&&N!==27||F===null||(D=F,c?(F=Xl(a,d),F!=null&&b.unshift(Ts(a,F,D))):c||(F=Xl(a,d),F!=null&&b.push(Ts(a,F,D)))),a=a.return}b.length!==0&&e.push({event:t,listeners:b})}var lb=/\r\n?/g,sb=/\u0000|\uFFFD/g;function op(e){return(typeof e=="string"?e:""+e).replace(lb,`
|
|
56
|
-
`).replace(sb,"")}function cp(e,t){return t=op(t),op(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":od(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=_x.get(a)||a,Ks(e,a,s))}}function Ac(e,t,a,s,c,d){switch(a){case"style":od(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(!Wu.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,F=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":F=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)}}ld(e,d,N,D,F,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)}rd(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(F in a)if(a.hasOwnProperty(F)&&(s=a[F],s!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ke(e,t,F,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 rb(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,F=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":F=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,F,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)}sd(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(F in s)if(Z=s[F],X=a[F],s.hasOwnProperty(F)&&Z!==X&&(Z!=null||X!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(o(137,t));break;default:Ke(e,t,F,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 up(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ib(){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&&up(b)){for(b=0,N=c.responseEnd,s+=1;s<a.length;s++){var D=a[s],F=D.startTime;if(F>N)break;var ee=D.transferSize,se=D.initiatorType;ee&&up(se)&&(D=D.responseEnd,b+=ee*(D<N?1:(N-F)/(D-F)))}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 dp(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 mp(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 ob(){var e=window.event;return e&&e.type==="popstate"?e===_c?!1:(_c=e,!0):(_c=null,!1)}var fp=typeof setTimeout=="function"?setTimeout:void 0,cb=typeof clearTimeout=="function"?clearTimeout:void 0,pp=typeof Promise=="function"?Promise:void 0,ub=typeof queueMicrotask=="function"?queueMicrotask:typeof pp<"u"?function(e){return pp.resolve(null).then(e).catch(db)}:fp;function db(e){setTimeout(function(){throw e})}function wa(e){return e==="head"}function hp(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 xp(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 mb(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 fb(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 gp(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 pb(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 bp(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 yp(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 vp(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,jp=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:hb,r:xb,D:gb,C:bb,L:yb,m:vb,X:wb,S:jb,M:Nb};function hb(){var e=ea.f(),t=Gr();return e||t}function xb(e){var t=nl(e);t!==null&&t.tag===5&&t.type==="form"?Bm(t):ea.r(e)}var Ol=typeof document>"u"?null:document;function wp(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+'"]'),jp.has(c)||(jp.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 gb(e){ea.D(e),wp("dns-prefetch",e,null)}function bb(e,t){ea.C(e,t),wp("preconnect",e,t)}function yb(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 vb(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 jb(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(F,ee){D.onload=F,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 wb(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 Nb(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 Np(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||Sb(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 Sp(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function Sb(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 kp(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=Sp(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 Cp(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 Tp(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function kb(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 Ep(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Cb(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=Sp(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 Tb(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*ib());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(Eb,e),ei=null,Wr.call(e))}function Eb(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 Ab(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 Ap(e,t,a,s,c,d,b,N,D,F,ee,se){return e=new Ab(e,t,a,b,D,F,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 Rp(e){return e?(e=fl,e):fl}function Mp(e,t,a,s,c,d){c=Rp(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 Dp(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){Dp(e,t),(e=e.alternate)&&Dp(e,t)}function _p(e){if(e.tag===13||e.tag===31){var t=Oa(e,67108864);t!==null&&Kt(t,e,67108864),Gc(e,67108864)}}function Op(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 Rb(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 Mb(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=Fc(s);if(c===null)Ec(e,t,s,ai,a),zp(e,s);else if(_b(c,e,t,a,s))s.stopPropagation();else if(zp(e,s),t&4&&-1<Db.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=Fc(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 Fc(e){return e=Yi(e),Yc(e)}var ai=null;function Yc(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 Lp(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=[],Db="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 zp(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&&_p(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function _b(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 Bp(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,Ju(e.priority,function(){Op(a)});return}}else if(t===31){if(t=g(a),t!==null){e.blockedOn=t,Ju(e.priority,function(){Op(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=Fc(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);Fi=s,a.target.dispatchEvent(s),Fi=null}else return t=nl(a),t!==null&&_p(t),e.blockedOn=a,!1;t.shift()}return!0}function $p(e,t,a){li(e)&&a.delete(t)}function Ob(){Zc=!1,Na!==null&&li(Na)&&(Na=null),Sa!==null&&li(Sa)&&(Sa=null),ka!==null&&li(ka)&&(ka=null),Ds.forEach($p),_s.forEach($p)}function si(e,t){e.blockedOn===t&&(e.blockedOn=null,Zc||(Zc=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,Ob)))}var ri=null;function Up(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(Yc(s||a)===null)continue;break}var d=nl(a);d!==null&&(e.splice(t,3),t-=3,Fo(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);)Bp(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||Up(a);else if(b){var N=null;if(d&&d.hasAttribute("formAction")){if(c=d,b=d[Zt]||null)N=b.formAction;else if(Yc(c)!==null)continue}else N=b.action;typeof N=="function"?a[s+1]=N:(a.splice(s,3),s-=3),Up(a)}}}function Hp(){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();Mp(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;Mp(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=Iu();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&&Bp(e)}};var Gp=r.version;if(Gp!=="19.2.4")throw Error(o(527,Gp,"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 Lb={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(Lb),Oe=oi}catch{}}return zs.createRoot=function(e,t){if(!u(e))throw Error(o(299));var a=!1,s="",c=Qm,d=Xm,b=Im;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=Ap(e,1,!1,null,null,a,s,null,c,d,b,Hp),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=Qm,b=Xm,N=Im,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=Ap(e,1,!0,t,a??null,s,c,D,d,b,N,Hp),t.context=Rp(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 Kp;function Zb(){if(Kp)return Ic.exports;Kp=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=Yb(),Ic.exports}var Vb=Zb();const Qb=Dh(Vb);function Ru(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 mu=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=mu){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 Mu(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 Oh(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 Du(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=Lu(l);if(r)return r;const i=l.replace(/\/$/,"").split("/");return i[i.length-1]||l}const _u=120;function kt(l){return(l||"").replace(/\s+/g," ").trim().slice(0,_u)}function Xb(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 Ib(l){return l.split(`
|
|
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 Jb(l){const i=[...l.split(`
|
|
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 Pp(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 Fl(l){if(Xb(l)||Pp(l))return"";const r=/Last login:|Logged in to github\.com|Git operations protocol:|(?:➜|❯)\s+/i.test(l);let i=Jb(Ib(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||Pp(i))||r&&/^[a-z0-9._:-]{1,12}$/i.test(i)?"":i}function Lh(l){const r=l.title?kt(Fl(l.title)):"";if(r)return r;const i=[...l.prompts||[],l.firstPrompt];for(const o of i){const u=kt(Fl(o||""));if(u)return u}return l.slug}function Ou(l){const r=Lh(l);if(l.replay?.title){const i=kt(l.replay.title);if(i)return i}return r}function fu(l,r){const i=Lh(l),o=kt(l.replay?.title),u=kt(Fl(r?.title||""));return u||(i&&i!==l.slug?i:o||i)}function pu(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 Kb={"claude-code":"bg-terminal-orange-subtle text-terminal-orange",cursor:"bg-terminal-blue-subtle text-terminal-blue"};function zh(l){return l==="claude-code"?"Claude":l==="cursor"?"Cursor":l}function Bh(l){return Kb[l]||"bg-terminal-surface text-terminal-dim"}async function $h(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 Pb(l){const r=Lu(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 Uh(l){const r=new Map;for(const i of l)r.set(i,Lu(i)||Pb(i));return r}function hu(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 Lu(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 Wp(){return new URLSearchParams(window.location.search).get("project")||pt}function eh(){return new URLSearchParams(window.location.search).get("q")||""}function th(){return new URLSearchParams(window.location.search).get("archived")==="true"}function Hh(){const[l,r]=y.useState(Wp),[i,o]=y.useState(eh),[u,m]=y.useState(th);return y.useEffect(()=>{const x=()=>{r(Wp()),o(eh()),m(th())};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 Wb(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=Wb(l,r);return n.jsx(n.Fragment,{children:i(o)})}var e0=_h();function Gh(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 t0(l){const r=Gh(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?e0.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 qh=y.createContext(null);function Yl(){const l=y.useContext(qh);if(!l)throw new Error("useScanInsightsContext must be used within ScanInsightsProvider");return l}function n0({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,mu)){S();return}const A=Date.now()-new Date(M.cachedAt).getTime(),R=Math.max(1e3,mu-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(qh.Provider,{value:C,children:l})}function Fh(){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,a0=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],l0=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Ia(l){return l.toISOString().slice(0,10)}function s0(l){return l==="7d"?7:l==="30d"?30:l==="90d"?90:0}function Yh(l,r){if(r==="all")return l;const i=s0(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 r0(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=Yh(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 i0(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 o0(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:l0[o],shortDay:a0[o],count:i}))}function c0(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 u0(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 Zh(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 nh(l){return l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${Math.floor(l/1e3)}k`:l.toString()}function d0(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 m0(l){return[...new Set(l.split(",").map(r=>r.trim()).filter(Boolean))]}function f0(l){return l==="7d"?"Last 7 Days":l==="30d"?"Last 30 Days":l==="90d"?"Last 90 Days":"All Time"}function Vh({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 p0({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 h0({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(()=>d0(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:f0(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=>Du(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=>Zh(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(p0,{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 eu(l){if(l<1e3)return"<1s";const r=Math.round(l/1e3);if(r<60)return`${r}s`;const i=Math.floor(r/60),o=r%60;if(i<60)return o>0?`${i}m ${o}s`:`${i}m`;const u=Math.floor(i/60),m=i%60;return m>0?`${u}h ${m}m`:`${u}h`}function x0({histogram:l}){const r=Math.max(...l.buckets.map(i=>i.pct),1);return n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"flex items-end gap-2 h-32",children:l.buckets.map(i=>{const o=Math.max(i.pct/r*100,i.count>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:i.label}),n.jsxs("div",{className:"text-[10px] font-mono text-terminal-green font-bold",children:[i.count," turn",i.count!==1?"s":""," (",i.pct,"%)"]})]})}),i.pct>0&&n.jsxs("div",{className:"text-[9px] font-mono text-terminal-dimmer tabular-nums mb-1",children:[i.pct>=10?Math.round(i.pct):i.pct.toFixed(1),"%"]}),n.jsx("div",{className:"w-full rounded-md bg-terminal-green hover:opacity-90 transition-all",style:{height:`${o}%`,minHeight:i.count>0?"4px":"0",opacity:i.count>0?.7:.1}})]},i.label)})}),n.jsx("div",{className:"flex gap-2",children:l.buckets.map(i=>n.jsx("div",{className:"flex-1 text-center text-[9px] font-mono text-terminal-dimmer",children:i.label},i.label))}),n.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-terminal-border/20",children:[n.jsxs("div",{className:"flex items-center gap-3 text-[10px] font-mono text-terminal-dim",children:[n.jsxs("span",{children:["P50"," ",n.jsx("span",{className:"text-terminal-text font-bold",children:eu(l.percentiles.p50Ms)})]}),n.jsx("span",{className:"text-terminal-dimmer",children:"·"}),n.jsxs("span",{children:["P75"," ",n.jsx("span",{className:"text-terminal-text font-bold",children:eu(l.percentiles.p75Ms)})]}),n.jsx("span",{className:"text-terminal-dimmer",children:"·"}),n.jsxs("span",{children:["P90"," ",n.jsx("span",{className:"text-terminal-text font-bold",children:eu(l.percentiles.p90Ms)})]})]}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:[l.totalTurns.toLocaleString()," turns"]})]})]})}const g0=[{key:"cacheRead",label:"Cache Read",color:"bg-terminal-purple"},{key:"cacheCreation",label:"Cache Write",color:"bg-terminal-orange"},{key:"output",label:"Output",color:"bg-terminal-green"},{key:"input",label:"Input",color:"bg-terminal-blue"}];function b0({breakdown:l}){const r=l.input+l.output+l.cacheRead+l.cacheCreation;if(r===0)return null;const i=g0.map(o=>({...o,value:l[o.key],pct:l[o.key]/r*100})).filter(o=>o.value>0);return n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"h-4 rounded-full bg-terminal-surface-2 overflow-hidden flex",children:i.map(o=>n.jsx("div",{className:`h-full ${o.color} transition-all duration-500`,style:{width:`${o.pct}%`,opacity:.7}},o.key))}),n.jsx("div",{className:"space-y-2",children:i.map(o=>n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`w-2.5 h-2.5 rounded-sm ${o.color}`,style:{opacity:.7}}),n.jsx("span",{className:"text-[11px] font-mono text-terminal-dim",children:o.label})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-[11px] font-mono text-terminal-text tabular-nums",children:nh(o.value)}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums w-10 text-right",children:o.pct<.1?"<0.1%":o.pct<1?`${o.pct.toFixed(1)}%`:`${Math.round(o.pct)}%`})]})]},o.key))}),n.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-terminal-border/20",children:[n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:"Total"}),n.jsx("span",{className:"text-[11px] font-mono text-terminal-text font-bold tabular-nums",children:nh(r)})]})]})}function y0({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 v0({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 j0({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&&` · ${Zh(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 w0({models:l}){const r=y.useMemo(()=>(()=>{const u=new Map;for(const[m,p]of Object.entries(l))for(const g of m0(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 N0({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 Qh(){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 S0({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(Qh,{})]})})}function k0(){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 C0(){const{userInsights:l,loading:r,scanStatus:i}=Yl(),o=k0(),[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=Yh(H,u),ae={...l,totalReplays:o?.replays??0},ue=r0(K,ae,u),oe=i0(H),te=o0(K),xe=[...te].sort((Q,ne)=>ne.count-Q.count)[0]||null,de=u0(K),pe=c0(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(S0,{scanStatus:i,hasCachedInsights:!!i?.hasCachedResults});if(!l)return n.jsx(Qh,{});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?Mu(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(h0,{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(Vh,{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?`~${Du(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})]}),(l.turnDurationHistogram||l.tokenBreakdown)&&n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[l.turnDurationHistogram&&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:"Turn Duration Distribution"}),n.jsx(x0,{histogram:l.turnDurationHistogram})]}),l.tokenBreakdown&&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:"Token Usage"}),n.jsx(b0,{breakdown:l.tokenBreakdown})]})]}),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(y0,{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(v0,{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(j0,{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(w0,{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(N0,{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 T0(){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 E0(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 A0(){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 Xh({provider:l}){return n.jsx("span",{className:`text-[10px] font-sans font-medium px-1.5 py-0.5 rounded-full uppercase tracking-wider ${Bh(l)}`,children:zh(l)})}function R0({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(Xh,{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:Ou(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 M0({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(Xh,{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:pu(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 ah=[{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 D0(){const[l,r]=y.useState(()=>ah.map(i=>({...i,installed:!1,detail:"checking...",loading:!0})));return y.useEffect(()=>{let i=!1;for(const o of ah)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 _0({onNavigate:l}){const{sources:r,setSources:i,replays:o,loading:u,loadingSources:m,loadingReplays:p,error:g}=T0(),f=y.useMemo(()=>E0(r,o),[r,o]),{scanStatus:x,userInsights:h}=Yl(),[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,Y])=>({provider:G,count:Y,label:G==="claude-code"?"Claude Code":G==="cursor"?"Cursor":G})).sort((G,Y)=>Y.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 Y=Ou(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(Y)||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(Y){console.error("Generate error:",Y),w(G.slug),setTimeout(()=>w(me=>me===G.slug?null:me),2e3)}finally{C(null)}},W=async(G,Y)=>{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(Y)||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,Y)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(G)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:Y})})).ok)throw new Error("Failed to update title");i(be=>be.map(Qe=>Qe.slug===G&&Qe.replay?{...Qe,replay:{...Qe.replay,title:Y||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"}),Y=await G.json();if(G.status===401){M("needsLogin"),R(null);return}!G.ok||Y.error?(M("error"),R(Y.error||"Sync failed"),setTimeout(()=>{M(me=>me==="error"?"idle":me),R(null)},4e3)):(M("done"),R(Y.message||`Synced ${Y.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"}),Y=await G.json().catch(()=>null);G.ok&&Y?.url&&window.open(Y.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(Y=>Y+1),3e4);return()=>clearInterval(G)},[O]);const he=(()=>{if(!O)return null;const G=Date.now()-O;if(G<6e4)return"just now";const Y=Math.floor(G/6e4);return Y<60?`${Y}m ago`:`${Math.floor(Y/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,Y)=>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"})]},Y))}),n.jsx("div",{className:"space-y-1.5 pt-2",children:Array.from({length:3},(G,Y)=>n.jsx("div",{className:"h-3 skeleton rounded"},Y))}),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,Y)=>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"})]},Y))})]})}):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(Vh,{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(R0,{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(M0,{replays:f.recentReplays,isLoading:p,onViewAll:()=>l("replays"),onOpen:Q})})]})]}),te?n.jsx(A0,{}):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,Y)=>(Y.lastActivity||"").localeCompare(G.lastActivity||"")).slice(0,5).map(G=>{const Y=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:Y}),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&&` · ${Du(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(D0,{})]}),oe&&n.jsx(Ph,{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 O0({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 tu(l){return l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:String(l)}function L0(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 z0({onNavigate:l}){const{userInsights:r,scanStatus:i}=Yl(),[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:L0(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:[tu(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:[tu(f.toolCalls)," tools"]}),f.edits>0&&n.jsxs("span",{children:[tu(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(O0,{sessionsPerDay:f.sessionsPerDay})]},f.project)})})]})})}const B0=()=>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 zu({provider:l}){return n.jsx("span",{className:`text-[10px] font-sans font-medium px-1.5 py-0.5 rounded-full uppercase tracking-wider ${Bh(l)}`,children:zh(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:_u,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 U0({onArchive:l,isArchived:r}){const[i,o]=y.useState(!1),u=y.useRef(null),m=y.useCallback(()=>o(!1),[]);return Ru(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(B0,{})}),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 Ih(){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 xu(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=Fl(g||"");!f||u.has(f)||(u.add(f),o.push(f))}const p=Fl(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 Jh(l){return l&&l!=="main"&&l!=="master"?l:void 0}function Kh(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 Ph({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=Ou(l),j=fu(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 Ih().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=Jh(h?.gitBranch||l.gitBranch),R=h?.model||l.model,O=xu(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(zu,{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 ${Kh(h.dataSource,l.hasSqlite)}`,children:hu(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:_u})})]}),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:hu(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:Oh(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 Wh({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 Ru(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:pu(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:pu(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=>Fl(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:Oh(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(zu,{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 lh(){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 H0(){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}=Hh(),{scanStatus:ue,userInsights:oe,projectInsightsCache:te,fetchProjectInsights:xe}=Yl();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,Y=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=>$h(I,_,V);y.useEffect(()=>{Y()},[Y]),y.useEffect(()=>{if(l.length===0)return;let I=!1;const we=async()=>{const ce=await Ih();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,Ye=$?l:l.filter(I=>!_.has(I.slug)),it=new Map;for(const I of Ye)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=Uh(Bt.map(([I])=>I)),qt=R===pt?Ye: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?Mu(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 Y({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:()=>{Y({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(Fh,{})}),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 Ft=_.has(I.slug),Yt=fu(I,we),rn=xu(I,we,Yt);return n.jsx(Wh,{summary:{...I.replay,title:Yt,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:Ft},`${I.provider}-${I.slug}`)}const ve=fu(I,we),ce=xu(I,we,ve),fe=Jh(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=hu(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:Ft=>{Ft.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(U0,{onArchive:()=>me(I.slug),isArchived:tt})]})]})]}),ce.map((Ft,Yt)=>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:Ft})]},Yt)),(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(zu,{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 ${Kh(we?.dataSource,I.hasSqlite)}`,title:Ue,children:Ue})]})]},`${I.provider}-${I.slug}`)})})}),G&&n.jsx(Ph,{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 G0(){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}=Hh(),{userInsights:ue,projectInsightsCache:oe,fetchProjectInsights:te}=Yl();y.useEffect(()=>{R!==pt&&te(R)},[R,te]);const xe=R!==pt?oe.get(R):void 0;y.useEffect(()=>{let Y=!0;return(async()=>{o(!0),g(!1),x(null);const be=await fetch("/api/archived").then(it=>it.ok?it.json():{slugs:[]}).catch(()=>({slugs:[]}));Y&&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),Ye=Xs(Ct?.cachedAt);if(Y&&Ct&&(Qe=!0,r(Ct.sessions),m(!0),v(Ct.cachedAt??null),(Ct.sessions.length>0||Ye)&&(x(Ye?null:Ct.cachedAt??null),o(!1),g(!Ye))),Ye){Y&&(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(!Y)return;r(Bt),m(!0),v(new Date().toISOString()),x(null)}catch{if(!Y)return;Qe||m(!1)}finally{Y&&(g(!1),o(!1))}})(),()=>{Y=!1}},[]),y.useEffect(()=>{const Y=window.setInterval(()=>j(Date.now()),3e4);return()=>window.clearInterval(Y)},[]);const de=Y=>$h(Y,w,S),pe=async(Y,me)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(Y)}`,{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===Y?{...lt,title:me||void 0}:lt))},U=Y=>{ht({view:null,session:Y})},z=async Y=>{E(null);try{const me=await fetch(`/api/sessions/${encodeURIComponent(Y)}`,{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!==Y))}catch{E("Failed to delete session")}},Q=async Y=>{A(Y.slug);try{const me=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:Y.provider,sessionSlug:Y.slug,sessionProject:Y.project,sessionId:Y.sessionId||void 0,title:Y.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(Y=>w.has(Y.slug)).length,W=$?l:l.filter(Y=>!w.has(Y.slug)),T=new Map;for(const Y of W)T.has(Y.project)||T.set(Y.project,[]),T.get(Y.project)?.push(Y);const _=[...T.entries()].sort((Y,me)=>{const be=Y[1][0]?.startTime||"";return(me[1][0]?.startTime||"").localeCompare(be)}),V=Uh(_.map(([Y])=>Y)),J=R===pt?W:T.get(R)||[],P=O?J.filter(Y=>(Y.title||"").toLowerCase().includes(O.toLowerCase())||Y.slug.toLowerCase().includes(O.toLowerCase())||Y.project.toLowerCase().includes(O.toLowerCase())||Y.provider.toLowerCase().includes(O.toLowerCase())||(Y.firstMessage||"").toLowerCase().includes(O.toLowerCase())):J,he=h?Mu(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(lh,{}),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(([Y,me])=>{const be=R===Y,Qe=V.get(Y)||na(Y),lt=me.filter(Ct=>Ct.gist?.gistId).length;return n.jsxs("button",{onClick:()=>H(Y),title:Y,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"]})]})]},Y)})]})]}),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:Y=>H(Y.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(([Y,me])=>n.jsxs("option",{value:Y,children:[V.get(Y)||na(Y)," (",me.length,")"]},Y))]})}),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(Fh,{})}),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:Y=>K(Y.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(lh,{})]}),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:Y=>K(Y.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(Y=>{const me=w.has(Y.slug);return n.jsx(Wh,{summary:Y,onOpen:()=>U(Y.slug),onShare:()=>ht({view:null,session:Y.slug,v:"export"}),onTitleSave:pe,onDelete:()=>z(Y.slug),onRegenerate:()=>Q(Y),onArchive:()=>de(Y.slug),isRegenerating:M===Y.slug,isArchived:me},Y.slug)})})})]})]})}function q0(){const{scanStatus:l}=Yl(),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 F0({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(n0,{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(_0,{onNavigate:p}):u==="insights"&&i?n.jsx(C0,{}):u==="projects"&&i?n.jsx(z0,{onNavigate:p}):u==="sessions"&&i?n.jsx(H0,{}):n.jsx(G0,{})]}),n.jsx(q0,{})]})}function Y0(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 Z0(l,r,i){return l.map(o=>o.id===r?{...o,body:i,updatedAt:new Date().toISOString()}:o)}function V0(l,r){return l.filter(i=>i.id!==r)}function Q0(l){return new Set(l.map(r=>r.sceneIndex))}function X0(l){const r=new Map;for(const i of l)r.set(i.sceneIndex,(r.get(i.sceneIndex)||0)+1);return r}function I0(l,r){return JSON.stringify(l)!==JSON.stringify(r)}function sh(l){return l.type==="tool-call"&&!l.diff&&!l.bashOutput}function ex(l,r){const i=l[r];if(!sh(i))return r;const o=i.toolName;let u=r;for(;u+1<l.length&&sh(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 J0(l){const r=[];for(let i=0;i<l.length;i++)l[i].type==="user-prompt"&&r.push(i);return r}function K0(l,r){return l.find(i=>i>r)}function P0(l,r){for(let i=l.length-1;i>=0;i--)if(l[i]<r)return l[i]}function nu(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 ex(l,o)}function rh(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 W0="vibe-replay-annotations-";function ui(l){return W0+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 ey(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=I0(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(()=>X0(m),[m]),j=y.useCallback((_,V)=>{p(J=>Y0(J,_,V))},[]),w=y.useCallback((_,V)=>{p(J=>Z0(J,_,V))},[]),S=y.useCallback(_=>{p(V=>V0(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 Y=`<!DOCTYPE html>
|
|
66
|
-
${document.documentElement.outerHTML}`;P.textContent=G,he(Y)}else{const G=document.createElement("script");G.id="vibe-replay-data",G.textContent=J,document.head.appendChild(G);const Y=`<!DOCTYPE html>
|
|
67
|
-
${document.documentElement.outerHTML}`;document.head.removeChild(G),he(Y)}function he(G){const Y=new Blob([G],{type:"text/html"}),me=URL.createObjectURL(Y),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 ih={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 ty(l,r="embedded"){const i=r==="editor",[o,u]=y.useState(ih),[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(ih)},[]),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 ny(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 ay(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(()=>J0(l),[l]),E=y.useCallback(()=>{v.current&&(clearTimeout(v.current),v.current=null)},[]),M=y.useCallback(()=>{if(C.current!=="playing")return;const ue=nu(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=ex(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=K0(k,j.current);ue!==void 0&&$(ue)},[k,$]),K=y.useCallback(()=>{const ue=P0(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(!ny(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=nu(l,j.current,S.current);te!==-1&&$(te)}else if(oe.key==="ArrowUp"||oe.key==="k"){C.current==="playing"&&R(),oe.preventDefault();const te=rh(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=>nu(l,ue,r),[l,r]),computePrevIndex:y.useCallback(ue=>rh(l,ue,r),[l,r])}}function ly(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 gu="vibe-replay-view-prefs",au={displayMode:"compact",hideThinking:!1,collapseAllTools:!1,promptsOnly:!1};function sy(){try{const l=localStorage.getItem(gu);if(l){const r=JSON.parse(l);return r.displayMode?{...au,...r}:{...au,...r,displayMode:"compact"}}}catch{}return au}function ry(){const[l,r]=y.useState(sy),i=y.useCallback((u,m)=>{r(p=>{const g={...p,[u]:m};return localStorage.setItem(gu,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(gu,JSON.stringify(g)),g})},[]);return{prefs:l,updatePref:i,togglePref:o}}function oh({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 iy({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 oy({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 cy=["English","Chinese (Simplified)","Chinese (Traditional)","Japanese","Korean","Spanish","French","German","Portuguese","Russian"],uy=[{value:"professional",label:"Professional"},{value:"neutral",label:"Neutral"},{value:"friendly",label:"Friendly"}];function dy({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(oh,{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(oh,{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(oy,{toolName:ne})]}),n.jsxs("div",{className:"p-4 space-y-3",children:[A&&n.jsx(lu,{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(lu,{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:cy.map(P=>n.jsx("option",{value:P,children:P},P))})]})}),h&&n.jsx(lu,{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:uy.map(P=>n.jsx("option",{value:P.value,children:P.label},P.value))})]})})]})]})]})}function lu({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(iy,{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 my({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(dy,{annotationActions:i,overlayActions:o})]})]})}function Bu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ka=Bu();function tx(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 fy=(()=>{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)}}>`)},py=/^(?:[ \t]*(?:\n|$))+/,hy=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xy=/^ {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+|$)/,gy=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,$u=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,nx=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ax=$e(nx).replace(/bull/g,$u).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(),by=$e(nx).replace(/bull/g,$u).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(),Uu=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,yy=/^[^\n]+/,Hu=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,vy=$e(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Hu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),jy=$e(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,$u).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",Gu=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,wy=$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",Gu).replace("tag",Ti).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),lx=$e(Uu).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(),Ny=$e(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",lx).getRegex(),qu={blockquote:Ny,code:hy,def:vy,fences:xy,heading:gy,hr:Js,html:wy,lheading:ax,list:jy,newline:py,paragraph:lx,table:Xa,text:yy},ch=$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(),Sy={...qu,lheading:by,table:ch,paragraph:$e(Uu).replace("hr",Js).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ch).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()},ky={...qu,html:$e(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Gu).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(Uu).replace("hr",Js).replace("heading",` *#{1,6} *[^
|
|
68
|
-
]`).replace("lheading",ax).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Cy=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ty=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,sx=/^( {2,}|\\)\n(?!\s*$)/,Ey=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ei=/[\p{P}\p{S}]/u,Fu=/[\s\p{P}\p{S}]/u,rx=/[^\s\p{P}\p{S}]/u,Ay=$e(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Fu).getRegex(),ix=/(?!~)[\p{P}\p{S}]/u,Ry=/(?!~)[\s\p{P}\p{S}]/u,My=/(?:[^\s\p{P}\p{S}]|~)/u,ox=/(?![*_])[\p{P}\p{S}]/u,Dy=/(?![*_])[\s\p{P}\p{S}]/u,_y=/(?:[^\s\p{P}\p{S}]|[*_])/u,Oy=$e(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",fy?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),cx=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ly=$e(cx,"u").replace(/punct/g,Ei).getRegex(),zy=$e(cx,"u").replace(/punct/g,ix).getRegex(),ux="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",By=$e(ux,"gu").replace(/notPunctSpace/g,rx).replace(/punctSpace/g,Fu).replace(/punct/g,Ei).getRegex(),$y=$e(ux,"gu").replace(/notPunctSpace/g,My).replace(/punctSpace/g,Ry).replace(/punct/g,ix).getRegex(),Uy=$e("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,rx).replace(/punctSpace/g,Fu).replace(/punct/g,Ei).getRegex(),Hy=$e(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ox).getRegex(),Gy="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",qy=$e(Gy,"gu").replace(/notPunctSpace/g,_y).replace(/punctSpace/g,Dy).replace(/punct/g,ox).getRegex(),Fy=$e(/\\(punct)/,"gu").replace(/punct/g,Ei).getRegex(),Yy=$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(),Zy=$e(Gu).replace("(?:-->|$)","-->").getRegex(),Vy=$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",Zy).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(),dx=$e(/^!?\[(label)\]\[(ref)\]/).replace("label",yi).replace("ref",Hu).getRegex(),mx=$e(/^!?\[(ref)\](?:\[\])?/).replace("ref",Hu).getRegex(),Xy=$e("reflink|nolink(?!\\()","g").replace("reflink",dx).replace("nolink",mx).getRegex(),uh=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Yu={_backpedal:Xa,anyPunctuation:Fy,autolink:Yy,blockSkip:Oy,br:sx,code:Ty,del:Xa,delLDelim:Xa,delRDelim:Xa,emStrongLDelim:Ly,emStrongRDelimAst:By,emStrongRDelimUnd:Uy,escape:Cy,link:Qy,nolink:mx,punctuation:Ay,reflink:dx,reflinkSearch:Xy,tag:Vy,text:Ey,url:Xa},Iy={...Yu,link:$e(/^!?\[(label)\]\((.*?)\)/).replace("label",yi).getRegex(),reflink:$e(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",yi).getRegex()},bu={...Yu,emStrongRDelimAst:$y,emStrongLDelim:zy,delLDelim:Hy,delRDelim:qy,url:$e(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",uh).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",uh).getRegex()},Jy={...bu,br:$e(sx).replace("{2,}","*").getRegex(),text:$e(bu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},di={normal:qu,gfm:Sy,pedantic:ky},Gs={normal:Yu,gfm:bu,breaks:Jy,pedantic:Iy},Ky={"&":"&","<":"<",">":">",'"':""","'":"'"},dh=l=>Ky[l];function Dn(l,r){if(r){if(Gt.escapeTest.test(l))return l.replace(Gt.escapeReplace,dh)}else if(Gt.escapeTestNoEncode.test(l))return l.replace(Gt.escapeReplaceNoEncode,dh);return l}function mh(l){try{l=encodeURI(l).replace(Gt.percentDecode,"%")}catch{return null}return l}function fh(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 Py(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 Wy(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 ph(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 ev(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=ev(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],`
|
|
8
|
+
<script type="module" crossorigin>var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ee(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var F=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},I={map:ee,forEach:function(e,t,n){ee(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ee(e,function(){t++}),t},toArray:function(e){return ee(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=I,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.4`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),m=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function ee(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ee(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var P=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function L(e){return{current:e}}function R(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function z(e,t){re++,ne[re]=e.current,e.current=t}var ie=L(null),ae=L(null),oe=L(null),se=L(null);function ce(e,t){switch(z(oe,t),z(ae,e),z(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}R(ie),z(ie,e)}function le(){R(ie),R(ae),R(oe)}function ue(e){e.memoizedState!==null&&z(se,e);var t=ie.current,n=Hd(t,e.type);t!==n&&(z(ae,e),z(ie,n))}function de(e){ae.current===e&&(R(ie),R(ae)),se.current===e&&(R(se),Qf._currentValue=te)}var fe,pe;function me(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,pe=-1<e.stack.indexOf(`
|
|
9
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
10
|
+
`+fe+e+pe}var he=!1;function ge(e,t){if(!e||he)return``;he=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
11
|
+
`),l=s.split(`
|
|
12
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
13
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{he=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?me(n):``}function _e(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me(`Lazy`);case 13:return e.child!==t&&t!==null?me(`Suspense Fallback`):me(`Suspense`);case 19:return me(`SuspenseList`);case 0:case 15:return ge(e.type,!1);case 11:return ge(e.type.render,!1);case 1:return ge(e.type,!0);case 31:return me(`Activity`);default:return``}}function ve(e){try{var t=``,n=null;do t+=_e(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
14
|
+
Error generating stack: `+e.message+`
|
|
15
|
+
`+e.stack}}var ye=Object.prototype.hasOwnProperty,be=t.unstable_scheduleCallback,xe=t.unstable_cancelCallback,Se=t.unstable_shouldYield,Ce=t.unstable_requestPaint,B=t.unstable_now,we=t.unstable_getCurrentPriorityLevel,Te=t.unstable_ImmediatePriority,Ee=t.unstable_UserBlockingPriority,V=t.unstable_NormalPriority,De=t.unstable_LowPriority,Oe=t.unstable_IdlePriority,ke=t.log,Ae=t.unstable_setDisableYieldValue,je=null,Me=null;function Ne(e){if(typeof ke==`function`&&Ae(e),Me&&typeof Me.setStrictMode==`function`)try{Me.setStrictMode(je,e)}catch{}}var H=Math.clz32?Math.clz32:Ie,Pe=Math.log,Fe=Math.LN2;function Ie(e){return e>>>=0,e===0?32:31-(Pe(e)/Fe|0)|0}var Le=256,U=262144,Re=4194304;function ze(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 Be(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ze(n))):i=ze(o):i=ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ze(n))):i=ze(o)):i=ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ve(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function He(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 Ue(){var e=Re;return Re<<=1,!(Re&62914560)&&(Re=4194304),e}function We(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ge(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ke(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-H(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-H(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Je(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-H(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ye(e,t){var n=t&-t;return n=n&42?1:Xe(n),(n&(e.suspendedLanes|t))===0?n:0}function Xe(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 Ze(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Qe(){var e=I.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function $e(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var et=Math.random().toString(36).slice(2),tt=`__reactFiber$`+et,nt=`__reactProps$`+et,rt=`__reactContainer$`+et,it=`__reactEvents$`+et,at=`__reactListeners$`+et,ot=`__reactHandles$`+et,st=`__reactResources$`+et,ct=`__reactMarker$`+et;function lt(e){delete e[tt],delete e[nt],delete e[it],delete e[at],delete e[ot]}function ut(e){var t=e[tt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[rt]||n[tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[tt])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function dt(e){if(e=e[tt]||e[rt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function pt(e){var t=e[st];return t||=e[st]={hoistableStyles:new Map,hoistableScripts:new Map},t}function mt(e){e[ct]=!0}var ht=new Set,gt={};function _t(e,t){vt(e,t),vt(e+`Capture`,t)}function vt(e,t){for(gt[e]=t,e=0;e<t.length;e++)ht.add(t[e])}var yt=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]*$`),bt={},xt={};function St(e){return ye.call(xt,e)?!0:ye.call(bt,e)?!1:yt.test(e)?xt[e]=!0:(bt[e]=!0,!1)}function Ct(e,t,n){if(St(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function wt(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 Tt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Et(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Dt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ot(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kt(e){if(!e._valueTracker){var t=Dt(e)?`checked`:`value`;e._valueTracker=Ot(e,t,``+e[t])}}function At(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Dt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function jt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Mt=/[\n"\\]/g;function Nt(e){return e.replace(Mt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Pt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Et(t)):e.value!==``+Et(t)&&(e.value=``+Et(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):It(e,o,Et(n)):It(e,o,Et(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Et(s):e.removeAttribute(`name`)}function Ft(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){kt(e);return}n=n==null?``:``+Et(n),t=t==null?n:``+Et(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),kt(e)}function It(e,t,n){t===`number`&&jt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Lt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Et(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Rt(e,t,n){if(t!=null&&(t=``+Et(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Et(n)}function zt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(P(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Et(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),kt(e)}function Bt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Vt=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 Ht(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Vt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ut(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Ht(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Ht(e,o,t[o])}function Wt(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 Gt=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`]]),Kt=/^[\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 qt(e){return Kt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Jt(){}var Yt=null;function Xt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zt=null,Qt=null;function $t(e){var t=dt(e);if(t&&(e=t.stateNode)){var n=e[nt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Pt(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="`+Nt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[nt]||null;if(!a)throw Error(i(90));Pt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&At(r)}break a;case`textarea`:Rt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Lt(e,!!n.multiple,t,!1)}}}var en=!1;function tn(e,t,n){if(en)return e(t,n);en=!0;try{return e(t)}finally{if(en=!1,(Zt!==null||Qt!==null)&&(vu(),Zt&&(t=Zt,e=Qt,Qt=Zt=null,$t(t),e)))for(t=0;t<e.length;t++)$t(e[t])}}function nn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[nt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var rn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),an=!1;if(rn)try{var on={};Object.defineProperty(on,`passive`,{get:function(){an=!0}}),window.addEventListener(`test`,on,on),window.removeEventListener(`test`,on,on)}catch{an=!1}var sn=null,cn=null,ln=null;function un(){if(ln)return ln;var e,t=cn,n=t.length,r,i=`value`in sn?sn.value:sn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return ln=i.slice(e,1<r?1-r:void 0)}function dn(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 fn(){return!0}function pn(){return!1}function mn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?fn:pn,this.isPropagationStopped=pn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=fn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=fn)},persist:function(){},isPersistent:fn}),t}var hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gn=mn(hn),_n=h({},hn,{view:0,detail:0}),vn=mn(_n),yn,bn,xn,Sn=h({},_n,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nn,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!==xn&&(xn&&e.type===`mousemove`?(yn=e.screenX-xn.screenX,bn=e.screenY-xn.screenY):bn=yn=0,xn=e),yn)},movementY:function(e){return`movementY`in e?e.movementY:bn}}),Cn=mn(Sn),wn=mn(h({},Sn,{dataTransfer:0})),Tn=mn(h({},_n,{relatedTarget:0})),En=mn(h({},hn,{animationName:0,elapsedTime:0,pseudoElement:0})),Dn=mn(h({},hn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),On=mn(h({},hn,{data:0})),kn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},An={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`},jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Mn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jn[e])?!!t[e]:!1}function Nn(){return Mn}var Pn=mn(h({},_n,{key:function(e){if(e.key){var t=kn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=dn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?An[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nn,charCode:function(e){return e.type===`keypress`?dn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?dn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Fn=mn(h({},Sn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),In=mn(h({},_n,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nn})),Ln=mn(h({},hn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=mn(h({},Sn,{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})),zn=mn(h({},hn,{newState:0,oldState:0})),Bn=[9,13,27,32],Vn=rn&&`CompositionEvent`in window,Hn=null;rn&&`documentMode`in document&&(Hn=document.documentMode);var Un=rn&&`TextEvent`in window&&!Hn,Wn=rn&&(!Vn||Hn&&8<Hn&&11>=Hn),Gn=` `,Kn=!1;function qn(e,t){switch(e){case`keyup`:return Bn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Jn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Yn=!1;function Xn(e,t){switch(e){case`compositionend`:return Jn(t);case`keypress`:return t.which===32?(Kn=!0,Gn):null;case`textInput`:return e=t.data,e===Gn&&Kn?null:e;default:return null}}function Zn(e,t){if(Yn)return e===`compositionend`||!Vn&&qn(e,t)?(e=un(),ln=cn=sn=null,Yn=!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 Wn&&t.locale!==`ko`?null:t.data;default:return null}}var Qn={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 $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Qn[e.type]:t===`textarea`}function er(e,t,n,r){Zt?Qt?Qt.push(r):Qt=[r]:Zt=r,t=Td(t,`onChange`),0<t.length&&(n=new gn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var tr=null,nr=null;function rr(e){vd(e,0)}function ir(e){if(At(ft(e)))return e}function ar(e,t){if(e===`change`)return t}var or=!1;if(rn){var sr;if(rn){var cr=`oninput`in document;if(!cr){var lr=document.createElement(`div`);lr.setAttribute(`oninput`,`return;`),cr=typeof lr.oninput==`function`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){tr&&(tr.detachEvent(`onpropertychange`,dr),nr=tr=null)}function dr(e){if(e.propertyName===`value`&&ir(nr)){var t=[];er(t,nr,e,Xt(e)),tn(rr,t)}}function fr(e,t,n){e===`focusin`?(ur(),tr=t,nr=n,tr.attachEvent(`onpropertychange`,dr)):e===`focusout`&&ur()}function pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ir(nr)}function mr(e,t){if(e===`click`)return ir(t)}function hr(e,t){if(e===`input`||e===`change`)return ir(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==`function`?Object.is:gr;function vr(e,t){if(_r(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ye.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=yr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=yr(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=jt(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=jt(e.document)}return t}function Cr(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 wr=rn&&`documentMode`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==jt(r)||(r=Tr,`selectionStart`in r&&Cr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Dr&&vr(Dr,r)||(Dr=r,r=Td(Er,`onSelect`),0<r.length&&(t=new gn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var jr={animationend:Ar(`Animation`,`AnimationEnd`),animationiteration:Ar(`Animation`,`AnimationIteration`),animationstart:Ar(`Animation`,`AnimationStart`),transitionrun:Ar(`Transition`,`TransitionRun`),transitionstart:Ar(`Transition`,`TransitionStart`),transitioncancel:Ar(`Transition`,`TransitionCancel`),transitionend:Ar(`Transition`,`TransitionEnd`)},Mr={},Nr={};rn&&(Nr=document.createElement(`div`).style,`AnimationEvent`in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),`TransitionEvent`in window||delete jr.transitionend.transition);function Pr(e){if(Mr[e])return Mr[e];if(!jr[e])return e;var t=jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Fr=Pr(`animationend`),Ir=Pr(`animationiteration`),Lr=Pr(`animationstart`),Rr=Pr(`transitionrun`),zr=Pr(`transitionstart`),Br=Pr(`transitioncancel`),W=Pr(`transitionend`),Vr=new Map,Hr=`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(` `);Hr.push(`scrollEnd`);function Ur(e,t){Vr.set(e,t),_t(t,[e])}var Wr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Gr=[],Kr=0,qr=0;function Jr(){for(var e=Kr,t=qr=Kr=0;t<e;){var n=Gr[t];Gr[t++]=null;var r=Gr[t];Gr[t++]=null;var i=Gr[t];Gr[t++]=null;var a=Gr[t];if(Gr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Qr(n,i,a)}}function Yr(e,t,n,r){Gr[Kr++]=e,Gr[Kr++]=t,Gr[Kr++]=n,Gr[Kr++]=r,qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Xr(e,t,n,r){return Yr(e,t,n,r),$r(e)}function Zr(e,t){return Yr(e,null,null,t),$r(e)}function Qr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-H(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function $r(e){if(50<lu)throw lu=0,uu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ei={};function ti(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ni(e,t,n,r){return new ti(e,t,n,r)}function ri(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ii(e,t){var n=e.alternate;return n===null?(n=ni(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 ai(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 oi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ri(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,ie.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ni(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return si(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ni(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ni(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ni(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function si(e,t,n,r){return e=ni(7,e,r,t),e.lanes=n,e}function ci(e,t,n){return e=ni(6,e,null,t),e.lanes=n,e}function li(e){var t=ni(18,null,null,0);return t.stateNode=e,t}function ui(e,t,n){return t=ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var di=new WeakMap;function fi(e,t){if(typeof e==`object`&&e){var n=di.get(e);return n===void 0?(t={value:e,source:t,stack:ve(t)},di.set(e,t),t):n}return{value:e,source:t,stack:ve(t)}}var pi=[],mi=0,hi=null,gi=0,_i=[],vi=0,yi=null,bi=1,xi=``;function Si(e,t){pi[mi++]=gi,pi[mi++]=hi,hi=e,gi=t}function Ci(e,t,n){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,yi=e;var r=bi;e=xi;var i=32-H(r)-1;r&=~(1<<i),n+=1;var a=32-H(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,bi=1<<32-H(t)+i|n<<i|r,xi=a+e}else bi=1<<a|n<<i|r,xi=e}function wi(e){e.return!==null&&(Si(e,1),Ci(e,1,0))}function Ti(e){for(;e===hi;)hi=pi[--mi],pi[mi]=null,gi=pi[--mi],pi[mi]=null;for(;e===yi;)yi=_i[--vi],_i[vi]=null,xi=_i[--vi],_i[vi]=null,bi=_i[--vi],_i[vi]=null}function Ei(e,t){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,bi=t.id,xi=t.overflow,yi=e}var Di=null,Oi=null,G=!1,ki=null,Ai=!1,ji=Error(i(519));function Mi(e){throw Ri(fi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ji}function Ni(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[tt]=e,t[nt]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)$(gd[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),Ft(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),zt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||jd(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=Jt),t=!0):t=!1,t||Mi(e,!0)}function Pi(e){for(Di=e.return;Di;)switch(Di.tag){case 5:case 31:case 13:Ai=!1;return;case 27:case 3:Ai=!0;return;default:Di=Di.return}}function Fi(e){if(e!==Di)return!1;if(!G)return Pi(e),G=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&Oi&&Mi(e),Pi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=uf(e)}else t===27?(t=Oi,Zd(e.type)?(e=lf,lf=null,Oi=e):Oi=t):Oi=Di?cf(e.stateNode.nextSibling):null;return!0}function Ii(){Oi=Di=null,G=!1}function Li(){var e=ki;return e!==null&&(Yl===null?Yl=e:Yl.push.apply(Yl,e),ki=null),e}function Ri(e){ki===null?ki=[e]:ki.push(e)}var zi=L(null),Bi=null,Vi=null;function Hi(e,t,n){z(zi,t._currentValue),t._currentValue=n}function Ui(e){e._currentValue=zi.current,R(zi)}function Wi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Gi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Wi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Wi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ki(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;_r(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===se.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Gi(t,e,n,r),t.flags|=262144}function qi(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ji(e){Bi=e,Vi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yi(e){return Zi(Bi,e)}function Xi(e,t){return Bi===null&&Ji(e),Zi(e,t)}function Zi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Vi===null){if(e===null)throw Error(i(308));Vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Vi=Vi.next=t;return n}var Qi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},$i=t.unstable_scheduleCallback,ea=t.unstable_NormalPriority,ta={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function na(){return{controller:new Qi,data:new Map,refCount:0}}function ra(e){e.refCount--,e.refCount===0&&$i(ea,function(){e.controller.abort()})}var ia=null,aa=0,oa=0,sa=null;function ca(e,t){if(ia===null){var n=ia=[];aa=0,oa=ud(),sa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return aa++,t.then(la,la),t}function la(){if(--aa===0&&ia!==null){sa!==null&&(sa.status=`fulfilled`);var e=ia;ia=null,oa=0,sa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var da=F.S;F.S=function(e,t){Ql=B(),typeof t==`object`&&t&&typeof t.then==`function`&&ca(e,t),da!==null&&da(e,t)};var fa=L(null);function K(){var e=fa.current;return e===null?Fl.pooledCache:e}function pa(e,t){t===null?z(fa,fa.current):z(fa,t.pool)}function ma(){var e=K();return e===null?null:{parent:ta._currentValue,pool:e}}var ha=Error(i(460)),ga=Error(i(474)),_a=Error(i(542)),va={then:function(){}};function ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ba(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Jt,Jt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,wa(e),e;default:if(typeof t.status==`string`)t.then(Jt,Jt);else{if(e=Fl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,wa(e),e}throw Sa=t,ha}}function xa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Sa=e,ha):e}}var Sa=null;function Ca(){if(Sa===null)throw Error(i(459));var e=Sa;return Sa=null,e}function wa(e){if(e===ha||e===_a)throw Error(i(483))}var Ta=null,Ea=0;function Da(e){var t=Ea;return Ea+=1,Ta===null&&(Ta=[]),ba(Ta,e,t)}function Oa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ka(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Aa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ii(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ci(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&xa(i)===t.type)?(t=a(t,n.props),Oa(t,n),t.return=e,t):(t=oi(n.type,n.key,n.props,null,e.mode,r),Oa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ui(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=si(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ci(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=oi(t.type,t.key,t.props,null,e.mode,n),Oa(n,t),n.return=e,n;case v:return t=ui(t,e.mode,n),t.return=e,t;case O:return t=xa(t),f(e,t,n)}if(P(t)||M(t))return t=si(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Da(t),n);if(t.$$typeof===C)return f(e,Xi(e,t),n);ka(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=xa(n),p(e,t,n,r)}if(P(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Da(n),r);if(n.$$typeof===C)return p(e,t,Xi(e,n),r);ka(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=xa(r),m(e,t,n,r,i)}if(P(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Da(r),i);if(r.$$typeof===C)return m(e,t,n,Xi(t,r),i);ka(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),G&&Si(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return G&&Si(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),G&&Si(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),G&&Si(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return G&&Si(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),G&&Si(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&xa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Oa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=oi(o.type,o.key,o.props,null,e.mode,c),Oa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=ui(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=xa(o),b(e,r,o,c)}if(P(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Da(o),c);if(o.$$typeof===C)return b(e,r,Xi(e,o),c);ka(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ea=0;var i=b(e,t,n,r);return Ta=null,i}catch(t){if(t===ha||t===_a)throw t;var a=ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ja=Aa(!0),Ma=Aa(!1),Na=!1;function Pa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fa(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 Ia(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function La(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,X&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=$r(e),Qr(e,null,n),t}return Yr(e,r,t,n),$r(e)}function Ra(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Je(e,n)}}function za(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ba=!1;function Va(){if(Ba){var e=sa;if(e!==null)throw e}}function Ha(e,t,n,r){Ba=!1;var i=e.updateQueue;Na=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Q&f)===f:(r&f)===f){f!==0&&f===oa&&(Ba=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Na=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ul|=o,e.lanes=o,e.memoizedState=d}}function Ua(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Wa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ua(n[e],t)}var Ga=L(null),Ka=L(0);function qa(e,t){e=Vl,z(Ka,e),z(Ga,t),Vl=e|t.baseLanes}function Ja(){z(Ka,Vl),z(Ga,Ga.current)}function Ya(){Vl=Ka.current,R(Ga),R(Ka)}var Xa=L(null),Za=null;function Qa(e){var t=e.alternate;z(ro,ro.current&1),z(Xa,e),Za===null&&(t===null||Ga.current!==null||t.memoizedState!==null)&&(Za=e)}function $a(e){z(ro,ro.current),z(Xa,e),Za===null&&(Za=e)}function eo(e){e.tag===22?(z(ro,ro.current),z(Xa,e),Za===null&&(Za=e)):to(e)}function to(){z(ro,ro.current),z(Xa,Xa.current)}function no(e){R(Xa),Za===e&&(Za=null),R(ro)}var ro=L(0);function io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ao=0,q=null,J=null,oo=null,so=!1,co=!1,lo=!1,uo=0,fo=0,po=null,mo=0;function ho(){throw Error(i(321))}function go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function _o(e,t,n,r,i,a){return ao=a,q=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?Ns:Ps,lo=!1,a=n(r,i),lo=!1,co&&(a=yo(t,n,r,i)),vo(e),a}function vo(e){F.H=Ms;var t=J!==null&&J.next!==null;if(ao=0,oo=J=q=null,so=!1,fo=0,po=null,t)throw Error(i(300));e===null||Zs||(e=e.dependencies,e!==null&&qi(e)&&(Zs=!0))}function yo(e,t,n,r){q=e;var a=0;do{if(co&&(po=null),fo=0,co=!1,25<=a)throw Error(i(301));if(a+=1,oo=J=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=Fs,o=t(n,r)}while(co);return o}function bo(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?Eo(t):t,e=e.useState()[0],(J===null?null:J.memoizedState)!==e&&(q.flags|=1024),t}function xo(){var e=uo!==0;return uo=0,e}function Y(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function So(e){if(so){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}so=!1}ao=0,oo=J=q=null,co=!1,fo=uo=0,po=null}function Co(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return oo===null?q.memoizedState=oo=e:oo=oo.next=e,oo}function wo(){if(J===null){var e=q.alternate;e=e===null?null:e.memoizedState}else e=J.next;var t=oo===null?q.memoizedState:oo.next;if(t!==null)oo=t,J=e;else{if(e===null)throw q.alternate===null?Error(i(467)):Error(i(310));J=e,e={memoizedState:J.memoizedState,baseState:J.baseState,baseQueue:J.baseQueue,queue:J.queue,next:null},oo===null?q.memoizedState=oo=e:oo=oo.next=e}return oo}function To(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Eo(e){var t=fo;return fo+=1,po===null&&(po=[]),e=ba(po,e,t),t=q,(oo===null?t.memoizedState:oo.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?Ns:Ps),e}function Do(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Eo(e);if(e.$$typeof===C)return Yi(e)}throw Error(i(438,String(e)))}function Oo(e){var t=null,n=q.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=q.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=To(),q.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function ko(e,t){return typeof t==`function`?t(e):t}function Ao(e){return jo(wo(),J,e)}function jo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(ao&f)===f:(Q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===oa&&(d=!0);else if((ao&p)===p){u=u.next,p===oa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,q.lanes|=p,Ul|=p;f=u.action,lo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,q.lanes|=f,Ul|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!_r(o,e.memoizedState)&&(Zs=!0,d&&(n=sa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Mo(e){var t=wo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);_r(o,t.memoizedState)||(Zs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function No(e,t,n){var r=q,a=wo(),o=G;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!_r((J||a).memoizedState,n);if(s&&(a.memoizedState=n,Zs=!0),a=a.queue,is(Io.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||oo!==null&&oo.memoizedState.tag&1){if(r.flags|=2048,$o(9,{destroy:void 0},Fo.bind(null,r,a,n,t),null),Fl===null)throw Error(i(349));o||ao&127||Po(r,t,n)}return n}function Po(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=q.updateQueue,t===null?(t=To(),q.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Fo(e,t,n,r){t.value=n,t.getSnapshot=r,Lo(t)&&Ro(e)}function Io(e,t,n){return n(function(){Lo(t)&&Ro(e)})}function Lo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Ro(e){var t=Zr(e,2);t!==null&&pu(t,e,2)}function zo(e){var t=Co();if(typeof e==`function`){var n=e;if(e=n(),lo){Ne(!0);try{n()}finally{Ne(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:e},t}function Bo(e,t,n,r){return e.baseState=n,jo(e,J,typeof r==`function`?r:ko)}function Vo(e,t,n,r,a){if(ks(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ho(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ho(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Uo(e,t,s)}catch(n){Go(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Uo(e,t,a)}catch(n){Go(e,t,n)}}function Uo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Wo(e,t,n)},function(n){return Go(e,t,n)}):Wo(e,t,n)}function Wo(e,t,n){t.status=`fulfilled`,t.value=n,Ko(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ho(e,n)))}function Go(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ko(t),t=t.next;while(t!==r)}e.action=null}function Ko(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qo(e,t){return t}function Jo(e,t){if(G){var n=Fl.formState;if(n!==null){a:{var r=q;if(G){if(Oi){b:{for(var i=Oi,a=Ai;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Oi=cf(i.nextSibling),r=i.data===`F!`;break a}}Mi(r)}r=!1}r&&(t=n[0])}}return n=Co(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qo,lastRenderedState:t},n.queue=r,n=Es.bind(null,q,r),r.dispatch=n,r=zo(!1),a=Os.bind(null,q,!1,r.queue),r=Co(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Vo.bind(null,q,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Yo(e){return Xo(wo(),J,e)}function Xo(e,t,n){if(t=jo(e,t,qo)[0],e=Ao(ko)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Eo(t)}catch(e){throw e===ha?_a:e}else r=t;t=wo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(q.flags|=2048,$o(9,{destroy:void 0},Zo.bind(null,i,n),null)),[r,a,e]}function Zo(e,t){e.action=t}function Qo(e){var t=wo(),n=J;if(n!==null)return Xo(t,n,e);wo(),t=t.memoizedState,n=wo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function $o(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=q.updateQueue,t===null&&(t=To(),q.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function es(){return wo().memoizedState}function ts(e,t,n,r){var i=Co();q.flags|=e,i.memoizedState=$o(1|t,{destroy:void 0},n,r===void 0?null:r)}function ns(e,t,n,r){var i=wo();r=r===void 0?null:r;var a=i.memoizedState.inst;J!==null&&r!==null&&go(r,J.memoizedState.deps)?i.memoizedState=$o(t,a,n,r):(q.flags|=e,i.memoizedState=$o(1|t,a,n,r))}function rs(e,t){ts(8390656,8,e,t)}function is(e,t){ns(2048,8,e,t)}function as(e){q.flags|=4;var t=q.updateQueue;if(t===null)t=To(),q.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function os(e){var t=wo().memoizedState;return as({ref:t,nextImpl:e}),function(){if(X&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ss(e,t){return ns(4,2,e,t)}function cs(e,t){return ns(4,4,e,t)}function ls(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 us(e,t,n){n=n==null?null:n.concat([e]),ns(4,4,ls.bind(null,t,e),n)}function ds(){}function fs(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ps(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&go(t,r[1]))return r[0];if(r=e(),lo){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r}function ms(e,t,n){return n===void 0||ao&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),q.lanes|=e,Ul|=e,n)}function hs(e,t,n,r){return _r(n,t)?n:Ga.current===null?!(ao&42)||ao&1073741824&&!(Q&261930)?(Zs=!0,e.memoizedState=n):(e=fu(),q.lanes|=e,Ul|=e,t):(e=ms(e,n,r),_r(e,t)||(Zs=!0),e)}function gs(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};F.T=s,Os(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ds(e,t,ua(c,r),du(e)):Ds(e,t,r,du(e))}catch(n){Ds(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function _s(){}function vs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ys(e).queue;gs(e,a,t,te,n===null?_s:function(){return bs(e),n(r)})}function ys(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:ko,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bs(e){var t=ys(e);t.next===null&&(t=e.alternate.memoizedState),Ds(e,t.next.queue,{},du())}function xs(){return Yi(Qf)}function Ss(){return wo().memoizedState}function Cs(){return wo().memoizedState}function ws(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=du();e=Ia(n);var r=La(t,e,n);r!==null&&(pu(r,t,n),Ra(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function Ts(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ks(e)?As(t,n):(n=Xr(e,t,n,r),n!==null&&(pu(n,e,r),js(n,t,r)))}function Es(e,t,n){Ds(e,t,n,du())}function Ds(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ks(e))As(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,_r(s,o))return Yr(e,t,i,0),Fl===null&&Jr(),!1}catch{}if(n=Xr(e,t,i,r),n!==null)return pu(n,e,r),js(n,t,r),!0}return!1}function Os(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ks(e)){if(t)throw Error(i(479))}else t=Xr(e,n,r,2),t!==null&&pu(t,e,2)}function ks(e){var t=e.alternate;return e===q||t!==null&&t===q}function As(e,t){co=so=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function js(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Je(e,n)}}var Ms={readContext:Yi,use:Do,useCallback:ho,useContext:ho,useEffect:ho,useImperativeHandle:ho,useLayoutEffect:ho,useInsertionEffect:ho,useMemo:ho,useReducer:ho,useRef:ho,useState:ho,useDebugValue:ho,useDeferredValue:ho,useTransition:ho,useSyncExternalStore:ho,useId:ho,useHostTransitionStatus:ho,useFormState:ho,useActionState:ho,useOptimistic:ho,useMemoCache:ho,useCacheRefresh:ho};Ms.useEffectEvent=ho;var Ns={readContext:Yi,use:Do,useCallback:function(e,t){return Co().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:rs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ts(4194308,4,ls.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ts(4194308,4,e,t)},useInsertionEffect:function(e,t){ts(4,2,e,t)},useMemo:function(e,t){var n=Co();t=t===void 0?null:t;var r=e();if(lo){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Co();if(n!==void 0){var i=n(t);if(lo){Ne(!0);try{n(t)}finally{Ne(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ts.bind(null,q,e),[r.memoizedState,e]},useRef:function(e){var t=Co();return e={current:e},t.memoizedState=e},useState:function(e){e=zo(e);var t=e.queue,n=Es.bind(null,q,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ds,useDeferredValue:function(e,t){return ms(Co(),e,t)},useTransition:function(){var e=zo(!1);return e=gs.bind(null,q,e.queue,!0,!1),Co().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=q,a=Co();if(G){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Fl===null)throw Error(i(349));Q&127||Po(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,rs(Io.bind(null,r,o,e),[e]),r.flags|=2048,$o(9,{destroy:void 0},Fo.bind(null,r,o,n,t),null),n},useId:function(){var e=Co(),t=Fl.identifierPrefix;if(G){var n=xi,r=bi;n=(r&~(1<<32-H(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=uo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=mo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:xs,useFormState:Jo,useActionState:Jo,useOptimistic:function(e){var t=Co();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Os.bind(null,q,!0,n),n.dispatch=t,[e,t]},useMemoCache:Oo,useCacheRefresh:function(){return Co().memoizedState=ws.bind(null,q)},useEffectEvent:function(e){var t=Co(),n={impl:e};return t.memoizedState=n,function(){if(X&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ps={readContext:Yi,use:Do,useCallback:fs,useContext:Yi,useEffect:is,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Ao,useRef:es,useState:function(){return Ao(ko)},useDebugValue:ds,useDeferredValue:function(e,t){return hs(wo(),J.memoizedState,e,t)},useTransition:function(){var e=Ao(ko)[0],t=wo().memoizedState;return[typeof e==`boolean`?e:Eo(e),t]},useSyncExternalStore:No,useId:Ss,useHostTransitionStatus:xs,useFormState:Yo,useActionState:Yo,useOptimistic:function(e,t){return Bo(wo(),J,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};Ps.useEffectEvent=os;var Fs={readContext:Yi,use:Do,useCallback:fs,useContext:Yi,useEffect:is,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Mo,useRef:es,useState:function(){return Mo(ko)},useDebugValue:ds,useDeferredValue:function(e,t){var n=wo();return J===null?ms(n,e,t):hs(n,J.memoizedState,e,t)},useTransition:function(){var e=Mo(ko)[0],t=wo().memoizedState;return[typeof e==`boolean`?e:Eo(e),t]},useSyncExternalStore:No,useId:Ss,useHostTransitionStatus:xs,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){var n=wo();return J===null?(n.baseState=e,[e,n.queue.dispatch]):Bo(n,J,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};Fs.useEffectEvent=os;function Is(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ls={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),i=Ia(r);i.payload=t,n!=null&&(i.callback=n),t=La(e,i,r),t!==null&&(pu(t,e,r),Ra(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),i=Ia(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=La(e,i,r),t!==null&&(pu(t,e,r),Ra(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=Ia(n);r.tag=2,t!=null&&(r.callback=t),t=La(e,r,n),t!==null&&(pu(t,e,n),Ra(t,e,n))}};function Rs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!vr(n,r)||!vr(i,a):!0}function zs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ls.enqueueReplaceState(t,t.state,null)}function Bs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Vs(e){Wr(e)}function Hs(e){console.error(e)}function Us(e){Wr(e)}function Ws(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Gs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ks(e,t,n){return n=Ia(n),n.tag=3,n.payload={element:null},n.callback=function(){Ws(e,t)},n}function qs(e){return e=Ia(e),e.tag=3,e}function Js(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Gs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Gs(t,n,r),typeof i!=`function`&&(tu===null?tu=new Set([this]):tu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ys(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ki(t,n,a,!0),n=Xa.current,n!==null){switch(n.tag){case 31:case 13:return Za===null?Tu():n.alternate===null&&Hl===0&&(Hl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===va?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,a)),!1;case 22:return n.flags|=65536,r===va?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Wu(e,r,a)),!1}throw Error(i(435,n.tag))}return Wu(e,r,a),Tu(),!1}if(G)return t=Xa.current,t===null?(r!==ji&&(t=Error(i(423),{cause:r}),Ri(fi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=fi(r,n),a=Ks(e.stateNode,r,a),za(e,a),Hl!==4&&(Hl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ji&&(e=Error(i(422),{cause:r}),Ri(fi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=fi(o,n),Jl===null?Jl=[o]:Jl.push(o),Hl!==4&&(Hl=2),t===null)return!0;r=fi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ks(n.stateNode,r,e),za(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(tu===null||!tu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=qs(a),Js(a,e,n,r),za(n,a),!1}n=n.return}while(n!==null);return!1}var Xs=Error(i(461)),Zs=!1;function Qs(e,t,n,r){t.child=e===null?Ma(t,null,n,r):ja(t,e.child,n,r)}function $s(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ji(t),r=_o(e,t,n,o,a,i),s=xo(),e!==null&&!Zs?(Y(e,t,i),Cc(e,t,i)):(G&&s&&wi(t),t.flags|=1,Qs(e,t,r,i),t.child)}function ec(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ri(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,tc(e,t,a,r,i)):(e=oi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!wc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?vr:n,n(o,r)&&e.ref===t.ref)return Cc(e,t,i)}return t.flags|=1,e=ii(a,r),e.ref=t.ref,e.return=t,t.child=e}function tc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(vr(a,r)&&e.ref===t.ref)if(Zs=!1,t.pendingProps=r=a,wc(e,i))e.flags&131072&&(Zs=!0);else return t.lanes=e.lanes,Cc(e,t,i)}return lc(e,t,n,r,i)}function nc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return ic(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&pa(t,a===null?null:a.cachePool),a===null?Ja():qa(t,a),eo(t);else return r=t.lanes=536870912,ic(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&pa(t,null),Ja(),to(t)):(pa(t,a.cachePool),qa(t,a),to(t),t.memoizedState=null);return Qs(e,t,i,n),t.child}function rc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ic(e,t,n,r,i){var a=K();return a=a===null?null:{parent:ta._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&pa(t,null),Ja(),eo(t),e!==null&&Ki(e,t,r,!0),t.childLanes=i,null}function ac(e,t){return t=vc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function oc(e,t,n){return ja(t,e.child,null,n),e=ac(t,t.pendingProps),e.flags|=2,no(t),t.memoizedState=null,e}function sc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(G){if(r.mode===`hidden`)return e=ac(t,r),t.lanes=536870912,rc(null,e);if($a(t),(e=Oi)?(e=rf(e,Ai),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Mi(t);return t.lanes=536870912,null}return ac(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if($a(t),a)if(t.flags&256)t.flags&=-257,t=oc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Zs||Ki(e,t,n,!1),a=(n&e.childLanes)!==0,Zs||a){if(r=Fl,r!==null&&(s=Ye(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Zr(e,s),pu(r,e,s),Xs;Tu(),t=oc(e,t,n)}else e=o.treeContext,Oi=cf(s.nextSibling),Di=t,G=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=ac(t,r),t.flags|=4096;return t}return e=ii(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function cc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function lc(e,t,n,r,i){return Ji(t),n=_o(e,t,n,r,void 0,i),r=xo(),e!==null&&!Zs?(Y(e,t,i),Cc(e,t,i)):(G&&r&&wi(t),t.flags|=1,Qs(e,t,n,i),t.child)}function uc(e,t,n,r,i,a){return Ji(t),t.updateQueue=null,n=yo(t,r,n,i),vo(e),r=xo(),e!==null&&!Zs?(Y(e,t,a),Cc(e,t,a)):(G&&r&&wi(t),t.flags|=1,Qs(e,t,n,a),t.child)}function dc(e,t,n,r,i){if(Ji(t),t.stateNode===null){var a=ei,o=n.contextType;typeof o==`object`&&o&&(a=Yi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ls,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Pa(t),o=n.contextType,a.context=typeof o==`object`&&o?Yi(o):ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Is(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ls.enqueueReplaceState(a,a.state,null),Ha(t,r,a,i),Va(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Bs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ei,typeof u==`object`&&u&&(o=Yi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&zs(t,a,r,o),Na=!1;var f=t.memoizedState;a.state=f,Ha(t,r,a,i),Va(),l=t.memoizedState,s||f!==l||Na?(typeof d==`function`&&(Is(t,n,d,r),l=t.memoizedState),(c=Na||Rs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Fa(e,t),o=t.memoizedProps,u=Bs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ei,typeof l==`object`&&l&&(c=Yi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&zs(t,a,r,c),Na=!1,f=t.memoizedState,a.state=f,Ha(t,r,a,i),Va();var p=t.memoizedState;o!==d||f!==p||Na||e!==null&&e.dependencies!==null&&qi(e.dependencies)?(typeof s==`function`&&(Is(t,n,s,r),p=t.memoizedState),(u=Na||Rs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&qi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,cc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=ja(t,e.child,null,i),t.child=ja(t,null,n,i)):Qs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Cc(e,t,i),e}function fc(e,t,n,r){return Ii(),t.flags|=256,Qs(e,t,n,r),t.child}var pc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mc(e){return{baseLanes:e,cachePool:ma()}}function hc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Kl),e}function gc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(ro.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(G){if(a?Qa(t):to(t),(e=Oi)?(e=rf(e,Ai),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Mi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(to(t),a=t.mode,c=vc({mode:`hidden`,children:c},a),r=si(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=mc(n),r.childLanes=hc(e,s,n),t.memoizedState=pc,rc(null,r)):(Qa(t),_c(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Qa(t),t.flags&=-257,t=yc(e,t,n)):t.memoizedState===null?(to(t),c=r.fallback,a=t.mode,r=vc({mode:`visible`,children:r.children},a),c=si(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,ja(t,e.child,null,n),r=t.child,r.memoizedState=mc(n),r.childLanes=hc(e,s,n),t.memoizedState=pc,t=rc(null,r)):(to(t),t.child=e.child,t.flags|=128,t=null);else if(Qa(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ri({value:r,source:null,stack:null}),t=yc(e,t,n)}else if(Zs||Ki(e,t,n,!1),s=(n&e.childLanes)!==0,Zs||s){if(s=Fl,s!==null&&(r=Ye(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Zr(e,r),pu(s,e,r),Xs;af(c)||Tu(),t=yc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Oi=cf(c.nextSibling),Di=t,G=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=_c(t,r.children),t.flags|=4096);return t}return a?(to(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ii(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=si(c,a,n,null),c.flags|=2):c=ii(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,rc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=mc(n):(a=c.cachePool,a===null?a=ma():(l=ta._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=hc(e,s,n),t.memoizedState=pc,rc(e.child,r)):(Qa(t),n=e.child,e=n.sibling,n=ii(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function _c(e,t){return t=vc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function vc(e,t){return e=ni(22,e,null,t),e.lanes=0,e}function yc(e,t,n){return ja(t,e.child,null,n),e=_c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wi(e.return,t,n)}function xc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Sc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ro.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,z(ro,o),Qs(e,t,r,n),r=G?gi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bc(e,n,t);else if(e.tag===19)bc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&io(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),xc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}xc(t,!0,n,null,a,r);break;case`together`:xc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Cc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ki(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ii(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function wc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&qi(e))):!0}function Tc(e,t,n){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),Hi(t,ta,e.memoizedState.cache),Ii();break;case 27:case 5:ue(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:Hi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,$a(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Qa(t),e=Cc(e,t,n),e===null?null:e.sibling):gc(e,t,n):(Qa(t),t.flags|=128,null);Qa(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ki(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Sc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),z(ro,ro.current),r)break;return null;case 22:return t.lanes=0,nc(e,t,n,t.pendingProps);case 24:Hi(t,ta,e.memoizedState.cache)}return Cc(e,t,n)}function Ec(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Zs=!0;else{if(!wc(e,n)&&!(t.flags&128))return Zs=!1,Tc(e,t,n);Zs=!!(e.flags&131072)}else Zs=!1,G&&t.flags&1048576&&Ci(t,gi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=xa(t.elementType),t.type=e,typeof e==`function`)ri(e)?(r=Bs(e,r),t.tag=1,t=dc(null,t,e,r,n)):(t.tag=0,t=lc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=$s(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=ec(null,t,e,r,n);break a}}throw t=ee(e)||e,Error(i(306,t,``))}}return t;case 0:return lc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Bs(r,t.pendingProps),dc(e,t,r,a,n);case 3:a:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Fa(e,t),Ha(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Hi(t,ta,r),r!==o.cache&&Gi(t,[ta],n,!0),Va(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=fc(e,t,r,n);break a}else if(r!==a){a=fi(Error(i(424)),t),Ri(a),t=fc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Oi=cf(e.firstChild),Di=t,G=!0,ki=null,Ai=!0,n=Ma(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ii(),r===a){t=Cc(e,t,n);break a}Qs(e,t,r,n)}t=t.child}return t;case 26:return cc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:G||(n=t.type,e=t.pendingProps,r=Bd(oe.current).createElement(n),r[tt]=t,r[nt]=e,Pd(r,n,e),mt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ue(t),e===null&&G&&(r=t.stateNode=ff(t.type,t.pendingProps,oe.current),Di=t,Ai=!0,a=Oi,Zd(t.type)?(lf=a,Oi=cf(r.firstChild)):Oi=a),Qs(e,t,t.pendingProps.children,n),cc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&G&&((a=r=Oi)&&(r=tf(r,t.type,t.pendingProps,Ai),r===null?a=!1:(t.stateNode=r,Di=t,Oi=cf(r.firstChild),Ai=!1,a=!0)),a||Mi(t)),ue(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=_o(e,t,bo,null,null,n),Qf._currentValue=a),cc(e,t),Qs(e,t,r,n),t.child;case 6:return e===null&&G&&((e=n=Oi)&&(n=nf(n,t.pendingProps,Ai),n===null?e=!1:(t.stateNode=n,Di=t,Oi=null,e=!0)),e||Mi(t)),null;case 13:return gc(e,t,n);case 4:return ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ja(t,null,r,n):Qs(e,t,r,n),t.child;case 11:return $s(e,t,t.type,t.pendingProps,n);case 7:return Qs(e,t,t.pendingProps,n),t.child;case 8:return Qs(e,t,t.pendingProps.children,n),t.child;case 12:return Qs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Hi(t,t.type,r.value),Qs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ji(t),a=Yi(a),r=r(a),t.flags|=1,Qs(e,t,r,n),t.child;case 14:return ec(e,t,t.type,t.pendingProps,n);case 15:return tc(e,t,t.type,t.pendingProps,n);case 19:return Sc(e,t,n);case 31:return sc(e,t,n);case 22:return nc(e,t,n,t.pendingProps);case 24:return Ji(t),r=Yi(ta),e===null?(a=K(),a===null&&(a=Fl,o=na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Pa(t),Hi(t,ta,a)):((e.lanes&n)!==0&&(Fa(e,t),Ha(t,null,null,n),Va()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Hi(t,ta,r),r!==a.cache&&Gi(t,[ta],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Hi(t,ta,r))),Qs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Dc(e){e.flags|=4}function Oc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Su())e.flags|=8192;else throw Sa=va,ga}else e.flags&=-16777217}function kc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Su())e.flags|=8192;else throw Sa=va,ga}function Ac(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ue(),e.lanes|=t,ql|=t)}function jc(e,t){if(!G)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Mc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Nc(e,t,n){var r=t.pendingProps;switch(Ti(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mc(t),null;case 1:return Mc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ui(ta),le(),n.pendingContext&&=(n.context=n.pendingContext,null),(e===null||e.child===null)&&(Fi(t)?Dc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li())),Mc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Dc(t),o===null?(Mc(t),Oc(t,a,null,r,n)):(Mc(t),kc(t,o))):o?o===e.memoizedState?(Mc(t),t.flags&=-16777217):(Dc(t),Mc(t),kc(t,o)):(e=e.memoizedProps,e!==r&&Dc(t),Mc(t),Oc(t,a,e,r,n)),null;case 27:if(de(t),n=oe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}e=ie.current,Fi(t)?Ni(t,e):(e=ff(a,r,n),t.stateNode=e,Dc(t))}return Mc(t),null;case 5:if(de(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}if(o=ie.current,Fi(t))Ni(t,o);else{var s=Bd(oe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[tt]=t,o[nt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Dc(t)}}return Mc(t),Oc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=oe.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Di,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Mi(t,!0)}else e=Bd(e).createTextNode(r),e[tt]=t,t.stateNode=e}return Mc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Fi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[tt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),e=!1}else n=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(no(t),t):(no(t),null);if(t.flags&128)throw Error(i(558))}return Mc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Fi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[tt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),a=!1}else a=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(no(t),t):(no(t),null)}return no(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ac(t,t.updateQueue),Mc(t),null);case 4:return le(),e===null&&xd(t.stateNode.containerInfo),Mc(t),null;case 10:return Ui(t.type),Mc(t),null;case 19:if(R(ro),r=t.memoizedState,r===null)return Mc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)jc(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=io(e),o!==null){for(t.flags|=128,jc(r,!1),e=o.updateQueue,t.updateQueue=e,Ac(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ai(n,e),n=n.sibling;return z(ro,ro.current&1|2),G&&Si(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&B()>$l&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304)}else{if(!a)if(e=io(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ac(t,e),jc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!G)return Mc(t),null}else 2*B()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Mc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=B(),e.sibling=null,n=ro.current,z(ro,a?n&1|2:n&1),G&&Si(t,r.treeForkCount),e);case 22:case 23:return no(t),Ya(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Mc(t),t.subtreeFlags&6&&(t.flags|=8192)):Mc(t),n=t.updateQueue,n!==null&&Ac(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&R(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(ta),Mc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Pc(e,t){switch(Ti(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ta),le(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(no(t),t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(no(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return R(ro),null;case 4:return le(),null;case 10:return Ui(t.type),null;case 22:case 23:return no(t),Ya(),e!==null&&R(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ui(ta),null;case 25:return null;default:return null}}function Fc(e,t){switch(Ti(t),t.tag){case 3:Ui(ta),le();break;case 26:case 27:case 5:de(t);break;case 4:le();break;case 31:t.memoizedState!==null&&no(t);break;case 13:no(t);break;case 19:R(ro);break;case 10:Ui(t.type);break;case 22:case 23:no(t),Ya(),e!==null&&R(fa);break;case 24:Ui(ta)}}function Ic(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Uu(t,t.return,e)}}function Lc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function Rc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Wa(t,n)}catch(t){Uu(e,e.return,t)}}}function zc(e,t,n){n.props=Bs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function Bc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Uu(e,t,n)}}function Vc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Uu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Uu(e,t,n)}else n.current=null}function Hc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Uu(e,e.return,t)}}function Uc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[nt]=t}catch(t){Uu(e,e.return,t)}}function Wc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Gc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Wc(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&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Jt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[tt]=e,t[nt]=n}catch(t){Uu(e,e.return,t)}}var Yc=!1,Xc=!1,Zc=!1,Qc=typeof WeakSet==`function`?WeakSet:Set,$c=null;function el(e,t){if(e=e.containerInfo,Rd=sp,e=Sr(e),Cr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,$c=t;$c!==null;)if(t=$c,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,$c=e;else for(;$c!==null;){switch(t=$c,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Bs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Uu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,$c=e;break}$c=t.return}}function tl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:gl(e,n),r&4&&Ic(5,n);break;case 1:if(gl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=Bs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}r&64&&Rc(n),r&512&&Bc(n,n.return);break;case 3:if(gl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Wa(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&Jc(n);case 26:case 5:gl(e,n),t===null&&r&4&&Hc(n),r&512&&Bc(n,n.return);break;case 12:gl(e,n);break;case 31:gl(e,n),r&4&&sl(e,n);break;case 13:gl(e,n),r&4&&cl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Yc,!r){t=t!==null&&t.memoizedState!==null||Xc,i=Yc;var a=Xc;Yc=r,(Xc=t)&&!a?vl(e,n,(n.subtreeFlags&8772)!=0):gl(e,n),Yc=i,Xc=a}break;case 30:break;default:gl(e,n)}}function nl(e){var t=e.alternate;t!==null&&(e.alternate=null,nl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&<(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 rl=null,il=!1;function al(e,t,n){for(n=n.child;n!==null;)ol(e,t,n),n=n.sibling}function ol(e,t,n){if(Me&&typeof Me.onCommitFiberUnmount==`function`)try{Me.onCommitFiberUnmount(je,n)}catch{}switch(n.tag){case 26:Xc||Vc(n,t),al(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Xc||Vc(n,t);var r=rl,i=il;Zd(n.type)&&(rl=n.stateNode,il=!1),al(e,t,n),pf(n.stateNode),rl=r,il=i;break;case 5:Xc||Vc(n,t);case 6:if(r=rl,i=il,rl=null,al(e,t,n),rl=r,il=i,rl!==null)if(il)try{(rl.nodeType===9?rl.body:rl.nodeName===`HTML`?rl.ownerDocument.body:rl).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{rl.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}break;case 18:rl!==null&&(il?(e=rl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(rl,n.stateNode));break;case 4:r=rl,i=il,rl=n.stateNode.containerInfo,il=!0,al(e,t,n),rl=r,il=i;break;case 0:case 11:case 14:case 15:Lc(2,n,t),Xc||Lc(4,n,t),al(e,t,n);break;case 1:Xc||(Vc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&zc(n,t,r)),al(e,t,n);break;case 21:al(e,t,n);break;case 22:Xc=(r=Xc)||n.memoizedState!==null,al(e,t,n),Xc=r;break;default:al(e,t,n)}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Uu(t,t.return,e)}}}function cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Uu(t,t.return,e)}}function ll(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qc),t;default:throw Error(i(435,e.tag))}}function ul(e,t){var n=ll(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function dl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){rl=c.stateNode,il=!1;break a}break;case 5:rl=c.stateNode,il=!1;break a;case 3:case 4:rl=c.stateNode.containerInfo,il=!0;break a}c=c.return}if(rl===null)throw Error(i(160));ol(o,s,a),rl=null,il=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)pl(t,e),t=t.sibling}var fl=null;function pl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dl(t,e),ml(e),r&4&&(Lc(3,e,e.return),Ic(3,e),Lc(5,e,e.return));break;case 1:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&64&&Yc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=fl;if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ct]||o[tt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[tt]=e,mt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[tt]=e,mt(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Uc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),n!==null&&r&4&&Uc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),e.flags&32){a=e.stateNode;try{Bt(a,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Uc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Zc=!0);break;case 6:if(dl(t,e),ml(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Uu(e,e.return,t)}}break;case 3:if(Bf=null,a=fl,fl=gf(t.containerInfo),dl(t,e),fl=a,ml(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Uu(e,e.return,t)}Zc&&(Zc=!1,hl(e));break;case 4:r=fl,fl=gf(e.stateNode.containerInfo),dl(t,e),ml(e),fl=r;break;case 12:dl(t,e),ml(e);break;case 31:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 13:dl(t,e),ml(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zl=B()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Yc,d=Xc;if(Yc=u||a,Xc=d||l,dl(t,e),Xc=d,Yc=u,ml(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Yc||Xc||_l(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Uu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Uu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Uu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ul(e,n))));break;case 19:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 30:break;case 21:break;default:dl(t,e),ml(e)}}function ml(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Wc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;qc(e,Gc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Bt(o,``),n.flags&=-33),qc(e,Gc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Kc(e,Gc(e),s);break;default:throw Error(i(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;hl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function gl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)tl(e,t.alternate,t),t=t.sibling}function _l(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Lc(4,t,t.return),_l(t);break;case 1:Vc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&zc(t,t.return,n),_l(t);break;case 27:pf(t.stateNode);case 26:case 5:Vc(t,t.return),_l(t);break;case 22:t.memoizedState===null&&_l(t);break;case 30:_l(t);break;default:_l(t)}e=e.sibling}}function vl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:vl(i,a,n),Ic(4,a);break;case 1:if(vl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Uu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ua(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&Rc(a),Bc(a,a.return);break;case 27:Jc(a);case 26:case 5:vl(i,a,n),n&&r===null&&o&4&&Hc(a),Bc(a,a.return);break;case 12:vl(i,a,n);break;case 31:vl(i,a,n),n&&o&4&&sl(i,a);break;case 13:vl(i,a,n),n&&o&4&&cl(i,a);break;case 22:a.memoizedState===null&&vl(i,a,n),Bc(a,a.return);break;case 30:break;default:vl(i,a,n)}t=t.sibling}}function yl(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&&ra(n))}function bl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e))}function xl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sl(e,t,n,r),t=t.sibling}function Sl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:xl(e,t,n,r),i&2048&&Ic(9,t);break;case 1:xl(e,t,n,r);break;case 3:xl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e)));break;case 12:if(i&2048){xl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Uu(t,t.return,e)}}else xl(e,t,n,r);break;case 31:xl(e,t,n,r);break;case 13:xl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?xl(e,t,n,r):(a._visibility|=2,Cl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?xl(e,t,n,r):wl(e,t),i&2048&&yl(o,t);break;case 24:xl(e,t,n,r),i&2048&&bl(t.alternate,t);break;default:xl(e,t,n,r)}}function Cl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Cl(a,o,s,c,i),Ic(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Cl(a,o,s,c,i)):u._visibility&2?Cl(a,o,s,c,i):wl(a,o),i&&l&2048&&yl(o.alternate,o);break;case 24:Cl(a,o,s,c,i),i&&l&2048&&bl(o.alternate,o);break;default:Cl(a,o,s,c,i)}t=t.sibling}}function wl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:wl(n,r),i&2048&&yl(r.alternate,r);break;case 24:wl(n,r),i&2048&&bl(r.alternate,r);break;default:wl(n,r)}t=t.sibling}}var Tl=8192;function El(e,t,n){if(e.subtreeFlags&Tl)for(e=e.child;e!==null;)Dl(e,t,n),e=e.sibling}function Dl(e,t,n){switch(e.tag){case 26:El(e,t,n),e.flags&Tl&&e.memoizedState!==null&&Gf(n,fl,e.memoizedState,e.memoizedProps);break;case 5:El(e,t,n);break;case 3:case 4:var r=fl;fl=gf(e.stateNode.containerInfo),El(e,t,n),fl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Tl,Tl=16777216,El(e,t,n),Tl=r):El(e,t,n));break;default:El(e,t,n)}}function Ol(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 kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Al(e),e=e.sibling}function Al(e){switch(e.tag){case 0:case 11:case 15:kl(e),e.flags&2048&&Lc(9,e,e.return);break;case 3:kl(e);break;case 12:kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,jl(e)):kl(e);break;default:kl(e)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Lc(8,t,t.return),jl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,jl(t));break;default:jl(t)}e=e.sibling}}function Ml(e,t){for(;$c!==null;){var n=$c;switch(n.tag){case 0:case 11:case 15:Lc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,$c=r;else a:for(n=e;$c!==null;){r=$c;var i=r.sibling,a=r.return;if(nl(r),r===n){$c=null;break a}if(i!==null){i.return=a,$c=i;break a}$c=a}}}var Nl={getCacheForType:function(e){var t=Yi(ta),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Yi(ta).controller.signal}},Pl=typeof WeakMap==`function`?WeakMap:Map,X=0,Fl=null,Z=null,Q=0,Il=0,Ll=null,Rl=!1,zl=!1,Bl=!1,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=null,Yl=null,Xl=!1,Zl=0,Ql=0,$l=1/0,eu=null,tu=null,nu=0,ru=null,iu=null,au=0,ou=0,su=null,cu=null,lu=0,uu=null;function du(){return X&2&&Q!==0?Q&-Q:F.T===null?Qe():ud()}function fu(){if(Kl===0)if(!(Q&536870912)||G){var e=U;U<<=1,!(U&3932160)&&(U=262144),Kl=e}else Kl=536870912;return e=Xa.current,e!==null&&(e.flags|=32),Kl}function pu(e,t,n){(e===Fl&&(Il===2||Il===9)||e.cancelPendingCommit!==null)&&(bu(e,0),_u(e,Q,Kl,!1)),Ge(e,n),(!(X&2)||e!==Fl)&&(e===Fl&&(!(X&2)&&(Wl|=n),Hl===4&&_u(e,Q,Kl,!1)),nd(e))}function mu(e,t,n){if(X&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ve(e,t),a=r?Ou(e,t):Eu(e,t,!0),o=r;do{if(a===0){zl&&!r&&_u(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!gu(n)){a=Eu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Jl;var l=c.current.memoizedState.isDehydrated;if(l&&(bu(c,s).flags|=256),s=Eu(c,s,!1),s!==2){if(Bl&&!l){c.errorRecoveryDisabledLanes|=o,Wl|=o,a=4;break a}o=Yl,Yl=a,o!==null&&(Yl===null?Yl=o:Yl.push.apply(Yl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){bu(e,0),_u(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:_u(r,t,Kl,!Rl);break a;case 2:Yl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Zl+300-B(),10<a)){if(_u(r,t,Kl,!Rl),Be(r,0,!0)!==0)break a;au=t,r.timeoutHandle=Kd(hu.bind(null,r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,`Throttled`,-0,0),a);break a}hu(r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,null,-0,0)}}break}while(1);nd(e)}function hu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jt},Dl(t,a,d);var m=(a&62914560)===a?Zl-B():(a&4194048)===a?Ql-B():0;if(m=qf(d,m),m!==null){au=a,e.cancelPendingCommit=m(Fu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),_u(e,a,o,!l);return}}Fu(e,t,a,n,r,i,o,s,c)}function gu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!_r(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _u(e,t,n,r){t&=~Gl,t&=~Wl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-H(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&qe(e,n,t)}function vu(){return X&6?!0:(rd(0,!1),!1)}function yu(){if(Z!==null){if(Il===0)var e=Z.return;else e=Z,Vi=Bi=null,So(e),Ta=null,Ea=0,e=Z;for(;e!==null;)Fc(e.alternate,e),e=e.return;Z=null}}function bu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),au=0,yu(),Fl=e,Z=n=ii(e.current,null),Q=t,Il=0,Ll=null,Rl=!1,zl=Ve(e,t),Bl=!1,ql=Kl=Gl=Wl=Ul=Hl=0,Yl=Jl=null,Xl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-H(r),a=1<<i;t|=e[i],r&=~a}return Vl=t,Jr(),n}function xu(e,t){q=null,F.H=Ms,t===ha||t===_a?(t=Ca(),Il=3):t===ga?(t=Ca(),Il=4):Il=t===Xs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ll=t,Z===null&&(Hl=1,Ws(e,fi(t,e.current)))}function Su(){var e=Xa.current;return e===null?!0:(Q&4194048)===Q?Za===null:(Q&62914560)===Q||Q&536870912?e===Za:!1}function Cu(){var e=F.H;return F.H=Ms,e===null?Ms:e}function wu(){var e=F.A;return F.A=Nl,e}function Tu(){Hl=4,Rl||(Q&4194048)!==Q&&Xa.current!==null||(zl=!0),!(Ul&134217727)&&!(Wl&134217727)||Fl===null||_u(Fl,Q,Kl,!1)}function Eu(e,t,n){var r=X;X|=2;var i=Cu(),a=wu();(Fl!==e||Q!==t)&&(eu=null,bu(e,t)),t=!1;var o=Hl;a:do try{if(Il!==0&&Z!==null){var s=Z,c=Ll;switch(Il){case 8:yu(),o=6;break a;case 3:case 2:case 9:case 6:Xa.current===null&&(t=!0);var l=Il;if(Il=0,Ll=null,Mu(e,s,c,l),n&&zl){o=0;break a}break;default:l=Il,Il=0,Ll=null,Mu(e,s,c,l)}}Du(),o=Hl;break}catch(t){xu(e,t)}while(1);return t&&e.shellSuspendCounter++,Vi=Bi=null,X=r,F.H=i,F.A=a,Z===null&&(Fl=null,Q=0,Jr()),o}function Du(){for(;Z!==null;)Au(Z)}function Ou(e,t){var n=X;X|=2;var r=Cu(),a=wu();Fl!==e||Q!==t?(eu=null,$l=B()+500,bu(e,t)):zl=Ve(e,t);a:do try{if(Il!==0&&Z!==null){t=Z;var o=Ll;b:switch(Il){case 1:Il=0,Ll=null,Mu(e,t,o,1);break;case 2:case 9:if(ya(o)){Il=0,Ll=null,ju(t);break}t=function(){Il!==2&&Il!==9||Fl!==e||(Il=7),nd(e)},o.then(t,t);break a;case 3:Il=7;break a;case 4:Il=5;break a;case 7:ya(o)?(Il=0,Ll=null,ju(t)):(Il=0,Ll=null,Mu(e,t,o,7));break;case 5:var s=null;switch(Z.tag){case 26:s=Z.memoizedState;case 5:case 27:var c=Z;if(s?Wf(s):c.stateNode.complete){Il=0,Ll=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,Nu(u))}break b}}Il=0,Ll=null,Mu(e,t,o,5);break;case 6:Il=0,Ll=null,Mu(e,t,o,6);break;case 8:yu(),Hl=6;break a;default:throw Error(i(462))}}ku();break}catch(t){xu(e,t)}while(1);return Vi=Bi=null,F.H=r,F.A=a,X=n,Z===null?(Fl=null,Q=0,Jr(),Hl):0}function ku(){for(;Z!==null&&!Se();)Au(Z)}function Au(e){var t=Ec(e.alternate,e,Vl);e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=uc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=uc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:So(t);default:Fc(n,t),t=Z=ai(t,Vl),t=Ec(n,t,Vl)}e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function Mu(e,t,n,r){Vi=Bi=null,So(t),Ta=null,Ea=0;var i=t.return;try{if(Ys(e,i,t,n,Q)){Hl=1,Ws(e,fi(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;Hl=1,Ws(e,fi(n,e.current)),Z=null;return}t.flags&32768?(G||r===1?e=!0:zl||Q&536870912?e=!1:(Rl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Xa.current,r!==null&&r.tag===13&&(r.flags|=16384))),Pu(t,e)):Nu(t)}function Nu(e){var t=e;do{if(t.flags&32768){Pu(t,Rl);return}e=t.return;var n=Nc(t.alternate,t,Vl);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);Hl===0&&(Hl=5)}function Pu(e,t){do{var n=Pc(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);Hl=6,Z=null}function Fu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(nu!==0);if(X&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=qr,Ke(e,n,o,s,c,l),e===Fl&&(Z=Fl=null,Q=0),iu=t,ru=e,au=n,ou=o,su=a,cu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(V,function(){return Vu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=F.T,F.T=null,a=I.p,I.p=2,s=X,X|=4;try{el(e,t,n)}finally{X=s,I.p=a,F.T=r}}nu=1,Iu(),Lu(),Ru()}}function Iu(){if(nu===1){nu=0;var e=ru,t=iu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=X;X|=4;try{pl(t,e);var a=zd,o=Sr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&xr(s.ownerDocument.documentElement,s)){if(c!==null&&Cr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=br(s,h),v=br(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{X=i,I.p=r,F.T=n}}e.current=t,nu=2}}function Lu(){if(nu===2){nu=0;var e=ru,t=iu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=X;X|=4;try{tl(e,t.alternate,t)}finally{X=i,I.p=r,F.T=n}}nu=3}}function Ru(){if(nu===4||nu===3){nu=0,Ce();var e=ru,t=iu,n=au,r=cu;t.subtreeFlags&10256||t.flags&10256?nu=5:(nu=0,iu=ru=null,zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(tu=null),Ze(n),t=t.stateNode,Me&&typeof Me.onCommitFiberRoot==`function`)try{Me.onCommitFiberRoot(je,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=F.T,i=I.p,I.p=2,F.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{F.T=t,I.p=i}}au&3&&Bu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===uu?lu++:(lu=0,uu=e):lu=0,rd(0,!1)}}function zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ra(t)))}function Bu(){return Iu(),Lu(),Ru(),Vu()}function Vu(){if(nu!==5)return!1;var e=ru,t=ou;ou=0;var n=Ze(au),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,X&6)throw Error(i(331));var c=X;if(X|=4,Al(o.current),Sl(o,o.current,s,n),X=c,rd(0,!1),Me&&typeof Me.onPostCommitFiberRoot==`function`)try{Me.onPostCommitFiberRoot(je,o)}catch{}return!0}finally{I.p=a,F.T=r,zu(e,t)}}function Hu(e,t,n){t=fi(n,t),t=Ks(e.stateNode,t,2),e=La(e,t,2),e!==null&&(Ge(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(tu===null||!tu.has(r))){e=fi(n,e),n=qs(2),r=La(t,n,2),r!==null&&(Js(n,r,t,e),Ge(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Bl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Fl===e&&(Q&n)===n&&(Hl===4||Hl===3&&(Q&62914560)===Q&&300>B()-Zl?!(X&2)&&bu(e,0):Gl|=n,ql===Q&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=Ue()),e=Zr(e,t),e!==null&&(Ge(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return be(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-H(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Q,a=Be(r,r===Fl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ve(r,a)||(n=!0,cd(r,a));r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=B(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}nu!==0&&nu!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-H(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=He(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Fl,n=Q,n=Be(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Il===2||Il===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&xe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ve(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&xe(r),Ze(n)){case 2:case 8:n=Ee;break;case 32:n=V;break;case 268435456:n=Oe;break;default:n=V}return r=sd.bind(null,e),n=be(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&xe(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(nu!==0&&nu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bu()&&e.callbackNode!==n)return null;var r=Q;return r=Be(e,e===Fl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mu(e,r,t),od(e,B()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Bu())return null;mu(e,t,!0)}function ld(){Yd(function(){X&6?be(Te,id):ad()})}function ud(){if(td===0){var e=oa;e===0&&(e=Le,Le<<=1,!(Le&261888)&&(Le=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:qt(``+e)}function fd(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 pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[nt]||null).action),o=r.submitter;o&&(t=(t=o[nt]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new gn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);vs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),vs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Hr.length;md++){var hd=Hr[md];Ur(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Ur(Fr,`onAnimationEnd`),Ur(Ir,`onAnimationIteration`),Ur(Lr,`onAnimationStart`),Ur(`dblclick`,`onDoubleClick`),Ur(`focusin`,`onFocus`),Ur(`focusout`,`onBlur`),Ur(Rr,`onTransitionRun`),Ur(zr,`onTransitionStart`),Ur(Br,`onTransitionCancel`),Ur(W,`onTransitionEnd`),vt(`onMouseEnter`,[`mouseout`,`mouseover`]),vt(`onMouseLeave`,[`mouseout`,`mouseover`]),vt(`onPointerEnter`,[`pointerout`,`pointerover`]),vt(`onPointerLeave`,[`pointerout`,`pointerover`]),_t(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),_t(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),_t(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),_t(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),_t(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),_t(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`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(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Wr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Wr(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[it];n===void 0&&(n=t[it]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,ht.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!an||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Cd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ut(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}tn(function(){var r=a,i=Xt(n),s=[];a:{var c=Vr.get(e);if(c!==void 0){var l=gn,u=e;switch(e){case`keypress`:if(dn(n)===0)break a;case`keydown`:case`keyup`:l=Pn;break;case`focusin`:u=`focus`,l=Tn;break;case`focusout`:u=`blur`,l=Tn;break;case`beforeblur`:case`afterblur`:l=Tn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Cn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=In;break;case Fr:case Ir:case Lr:l=En;break;case W:l=Ln;break;case`scroll`:case`scrollend`:l=vn;break;case`wheel`:l=Rn;break;case`copy`:case`cut`:case`paste`:l=Dn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Fn;break;case`toggle`:case`beforetoggle`:l=zn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=nn(m,p),g!=null&&d.push(wd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Yt&&(u=n.relatedTarget||n.fromElement)&&(ut(u)||u[rt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ut(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Cn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Fn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ft(l),h=u==null?c:ft(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ut(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ed,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Dd(s,c,l,d,!1),u!==null&&f!==null&&Dd(s,f,u,d,!0)}}a:{if(c=r?ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ar;else if($n(c))if(or)v=hr;else{v=pr;var y=fr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Wt(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){er(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&It(c,`number`,c.value)}switch(y=r?ft(r):window,e){case`focusin`:($n(y)||y.contentEditable===`true`)&&(Tr=y,Er=r,Dr=null);break;case`focusout`:Dr=Er=Tr=null;break;case`mousedown`:Or=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Or=!1,kr(s,n,i);break;case`selectionchange`:if(wr)break;case`keydown`:case`keyup`:kr(s,n,i)}var b;if(Vn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Yn?qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Wn&&n.locale!==`ko`&&(Yn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Yn&&(b=un()):(sn=i,cn=`value`in sn?sn.value:sn.textContent,Yn=!0)),y=Td(r,x),0<y.length&&(x=new On(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Jn(n),b!==null&&(x.data=b)))),(b=Un?Xn(e,n):Zn(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new On(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),pd(s,e,r,n,i)}vd(s,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=nn(e,n),i!=null&&r.unshift(wd(e,i,a)),i=nn(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=nn(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=nn(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
|
|
16
|
+
`).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Bt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Bt(e,``+r);break;case`className`:wt(e,`class`,r);break;case`tabIndex`:wt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:wt(e,n,r);break;case`style`:Ut(e,r,o);break;case`data`:if(t!==`object`){wt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=qt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,a.name,a,null),Md(e,t,`formEncType`,a.formEncType,a,null),Md(e,t,`formMethod`,a.formMethod,a,null),Md(e,t,`formTarget`,a.formTarget,a,null)):(Md(e,t,`encType`,a.encType,a,null),Md(e,t,`method`,a.method,a,null),Md(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Jt);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=qt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Ct(e,`popover`,r);break;case`xlinkActuate`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ct(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Gt.get(n)||n,Ct(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Ut(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Bt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Bt(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Jt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!gt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[nt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ct(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,o,s,n,null)}}a&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Md(e,t,r,d,n,null)}}Ft(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Md(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Lt(e,!!r,n,!0):Lt(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Md(e,t,s,c,n,null)}zt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Md(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)$(gd[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,u,r,n,null)}return;default:if(Wt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Md(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Md(e,t,p,m,r,f)}}Pt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Md(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Md(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Lt(e,!!n,n?[]:``,!1):Lt(e,!!n,t,!0)):Lt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Md(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Md(e,t,s,a,r,o)}Rt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Md(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Md(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Md(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Md(e,t,u,p,r,m)}return;default:if(Wt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(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 Hd(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 Ud(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 Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(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`:ef(n),lt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(r){if(!e[ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}}else if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(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 lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(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 ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);lt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=I.d;I.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=vu();return e||t}function yf(e){var t=dt(e);t!==null&&t.tag===5&&t.type===`form`?bs(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Nt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),mt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Nt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Nt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Nt(n.imageSizes)+`"]`)):i+=`[href="`+Nt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),mt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Nt(r)+`"][href="`+Nt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),mt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=pt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);mt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=pt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),mt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=pt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),mt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=oe.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=pt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=pt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.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},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=pt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+Nt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),mt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Nt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Nt(n.href)+`"]`);if(r)return t.instance=r,mt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),mt(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,mt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),mt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,mt(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),mt(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ct]||a[tt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(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 Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,mt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),mt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=We(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=We(0),this.hiddenUpdates=We(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ni(3,null,null,t),e.current=a,a.stateNode=e,t=na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Pa(a),e}function tp(e){return e?(e=ei,e):ei}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ia(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=La(e,r,t),n!==null&&(pu(n,e,t),Ra(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=Zr(e,67108864);t!==null&&pu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=du();t=Xe(t);var n=Zr(e,t);n!==null&&pu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,up(e,t,n,r)}finally{I.p=a,F.T=i}}function lp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,up(e,t,n,r)}finally{I.p=a,F.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-H(o);s.entanglements[1]|=c,o&=~c}nd(a),!(X&6)&&($l=B()+500,rd(0,!1))}}break;case 31:case 13:s=Zr(a,2),s!==null&&pu(s,a,2),vu(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=Xt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=ut(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(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(we()){case Te:return 2;case Ee:return 8;case V:case De:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=dt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=ut(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,$e(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,$e(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Yt=r,n.target.dispatchEvent(r),Yt=null}else return t=dt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=dt(n);a!==null&&(e.splice(t,3),t-=3,vs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[nt]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[nt]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,du(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),vu(),t[rt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.4`)throw Error(i(527,Lp,`19.2.4`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{je=zp.inject(Rp),Me=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Vs,s=Hs,c=Us;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[rt]=t.current,xd(e),new Fp(t)}})),g=c(o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()}))(),1),_=c(u(),1);function v(e,t,n=!0){(0,_.useEffect)(()=>{if(!n)return;let r=n=>{e.current&&!e.current.contains(n.target)&&t()};return document.addEventListener(`mousedown`,r),()=>document.removeEventListener(`mousedown`,r)},[n,t,e])}const y=300*1e3;function b(e){if(!e||typeof e!=`object`)return null;let t=e;return Array.isArray(t.sessions)?{sessions:t.sessions,cachedAt:typeof t.cachedAt==`string`?t.cachedAt:void 0}:null}function x(e,t=y){if(!e)return!1;let n=Date.now()-new Date(e).getTime();return Number.isFinite(n)&&n>=0&&n<t}function S(e){if(!e)return`just now`;let t=Date.now()-new Date(e).getTime();if(!Number.isFinite(t)||t<0)return`just now`;let n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function C(e,t=Date.now()){if(!e)return``;let n=t-new Date(e).getTime();if(!Number.isFinite(n)||n<0)return`0m`;let r=Math.floor(n/6e4);if(r<60)return`${r}m`;let i=Math.floor(r/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function w(e){return new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}function T(e){return e?`$${e.toFixed(2)}`:``}function E(e){if(!e)return``;let t=e.match(/claude-(\d+)-(\d+)-(opus|sonnet|haiku)(?:-\d{8})?/i);if(t)return`${t[3].charAt(0).toUpperCase()+t[3].slice(1).toLowerCase()} ${t[1]}.${t[2]}`;let n=e.match(/claude-(?:(opus|sonnet|haiku)-)?((?:\d+)(?:[.-](?!\d{8})\d+)*)(?:-\d{8})?(?:-(opus|sonnet|haiku))?(?:$|\b)/i);if(n){let e=(n[1]||n[3]||``).toLowerCase(),t=n[2].replace(/-/g,`.`),r=e.charAt(0).toUpperCase()+e.slice(1);return r?`${r} ${t}`:`Claude ${t}`}let r=e.split(/[-/]/);return r.length>1?r.slice(0,2).join(`-`):e}function D(e){if(e===0)return`0m`;let t=Math.floor(e/6e4);if(t<60)return`${t}m`;let n=Math.floor(t/60),r=t%60;if(n<24)return r>0?`${n}h ${r}m`:`${n}h`;let i=Math.floor(n/24),a=n%24;return a>0?`${i}d ${a}h`:`${i}d`}function O(e){let t=Math.round(e/1024);return t>=1024?`${(t/1024).toFixed(1)}MB`:`${t}KB`}function k(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let i=Math.floor(r/24);return i<30?`${i}d ago`:w(e)}function A(e){let t=xe(e);if(t)return t;let n=e.replace(/\/$/,``).split(`/`);return n[n.length-1]||e}function j(e){return(e||``).replace(/\s+/g,` `).trim().slice(0,120)}function M(e){return e.startsWith(`[Request interrupted by user`)||e.startsWith(`<command-name>`)||e.startsWith(`<command-message>`)||e.startsWith(`<local-command-caveat>`)||e.startsWith(`<local-command-stdout>`)||e.startsWith(`<task-notification>`)||e.startsWith(`<bash-input>`)||e.startsWith(`<bash-stdout>`)}function N(e){return e.split(`
|
|
17
|
+
`).filter(e=>{let t=e.trim();return t?!(/^Last login:/i.test(t)||/^(?:➜|❯)\s+/.test(t)||/^github(?:\.com|\.rbx\.com)?$/i.test(t)||/^[✓✔]/.test(t)||/^-\s+(?:Active account|Git operations protocol|Token|Token scopes):/i.test(t)||/^(?:credential|init|user|filter|alias|core|remote|branch)\.[^=]+=/i.test(t)||/^branch\.[^.]+\./i.test(t)):!0}).join(`
|
|
18
|
+
`).trim()}function ee(e){let t=[...e.split(`
|
|
19
|
+
`)],n=/^\S.*\[\d{1,2}:\d{2}\s?(?:AM|PM)\]$/i.test(t[0]||``);return n&&t.shift(),n&&/^(?:hello|hi)\b/i.test((t[0]||``).trim())&&t.shift(),t.join(`
|
|
20
|
+
`).trim()}function P(e){let t=e.trim();return/^\[Previous conversation summary\]:/i.test(t)||/^Summary:\s*1\.\s*Primary Request and Intent:/i.test(t)||/^and merge infrastructure was built for human-paced output/i.test(t)}function F(e){if(M(e)||P(e))return``;let t=/Last login:|Logged in to github\.com|Git operations protocol:|(?:➜|❯)\s+/i.test(e),n=ee(N(e));return/<attached_files>|<code_selection\b/i.test(n)||(n=n.replace(/<\/?[a-z][^>]*>/gi,``),n=n.replace(/^\s*\d+\|\s*/gm,``),n=n.replace(/Caveat:\s*The messages below were generated by the user while running local commands\.[^.]*/g,``),n=n.replace(/DO NOT respond to these messages[^.]*/g,``),n=n.replace(/!\[AI Session:[^\]]*]\([^)]+\)/gi,``),n=n.replace(/###\s*AI Coding Session[^\n]*/gi,``),n=n.replace(/\d+\s+prompts?,\s+\d+\s+tools?,[^\n]*/gi,``),n=n.replace(/^\/\w+\s*/g,``),n=n.replace(/\s+/g,` `).trim(),!n||P(n))||t&&/^[a-z0-9._:-]{1,12}$/i.test(n)?``:n}function I(e){let t=e.title?j(F(e.title)):``;if(t)return t;let n=[...e.prompts||[],e.firstPrompt];for(let e of n){let t=j(F(e||``));if(t)return t}return e.slug}function te(e){let t=I(e);if(e.replay?.title){let t=j(e.replay.title);if(t)return t}return t}function ne(e,t){let n=I(e),r=j(e.replay?.title);return j(F(t?.title||``))||(n&&n!==e.slug?n:r||n)}function re(e){return j(e.title)||j(e.firstMessage)||j(e.messages?.[0])||e.slug}function L(e,t={}){let n=new URL(window.location.href),r=[`tab`,`project`,`q`,`archived`];if(n.searchParams.get(`view`)===`dashboard`||!n.searchParams.has(`session`)&&!n.searchParams.has(`gist`)&&!n.searchParams.has(`url`)){let e={};r.forEach(t=>{let r=n.searchParams.get(t);r&&(e[t]=r)}),Object.keys(e).length>0?sessionStorage.setItem(`vibe_dashboard_state`,JSON.stringify(e)):sessionStorage.removeItem(`vibe_dashboard_state`)}if(e.session&&(r.forEach(t=>{e[t]===void 0&&n.searchParams.delete(t)}),e.view===void 0&&n.searchParams.delete(`view`)),e.view===`dashboard`||e.session===null&&!e.view){let t=sessionStorage.getItem(`vibe_dashboard_state`);if(t)try{let r=JSON.parse(t);Object.entries(r).forEach(([t,r])=>{e[t]===void 0&&!n.searchParams.has(t)&&n.searchParams.set(t,r)})}catch(e){console.error(`Failed to restore dashboard state`,e)}n.searchParams.delete(`v`),n.searchParams.delete(`s`)}for(let[t,r]of Object.entries(e))r===null?n.searchParams.delete(t):n.searchParams.set(t,r);let i=n.toString()!==window.location.href;t.replace?window.history.replaceState({},``,n.toString()):window.history.pushState({},``,n.toString()),!t.replace&&i&&window.dispatchEvent(new PopStateEvent(`popstate`))}const R={"claude-code":`bg-terminal-orange-subtle text-terminal-orange`,"claude-desktop":`bg-terminal-orange-subtle text-terminal-orange`,"claude-cowork":`bg-terminal-orange-subtle text-terminal-orange`,cursor:`bg-terminal-blue-subtle text-terminal-blue`};var z={"claude-code":`Claude`,"claude-desktop":`Desktop`,"claude-cowork":`Cowork`,cursor:`Cursor`},ie={"claude-code":`Claude Code`,"claude-desktop":`Claude Desktop`,"claude-cowork":`Claude Cowork`,cursor:`Cursor`},ae={"claude-code":`bg-terminal-orange`,"claude-desktop":`bg-terminal-orange`,"claude-cowork":`bg-terminal-orange`,cursor:`bg-terminal-blue`},oe={"claude-code":`orange`,"claude-desktop":`orange`,"claude-cowork":`orange`,cursor:`blue`};function se(e){return oe[e]||`dim`}function ce(e){return z[e]||e}function le(e){return R[e]||`bg-terminal-surface text-terminal-dim`}function ue(e){return ie[e]||e}function de(e){return ae[e]||`bg-terminal-dim`}async function fe(e,t,n){let r=t.has(e);n(t=>{let n=new Set(t);return r?n.delete(e):n.add(e),n});try{if(!(await fetch(`/api/archive/${e}`,{method:r?`DELETE`:`POST`})).ok)throw Error(`Archive toggle failed`)}catch(t){console.error(`Archive toggle failed:`,pe(t)),n(t=>{let n=new Set(t);return r?n.add(e):n.delete(e),n})}}function pe(e){return e instanceof Error?e.message:typeof e==`string`?e:`Unknown error`}function me(e){let t=xe(e);if(t)return t;if(e.length<=26)return e;let n=e.split(`/`);if(n.length<=2)return e;let r=n[0],i=`${r}/\u2026/${n.slice(-2).join(`/`)}`;return i.length<=26?i:`${r}/\u2026/${n[n.length-1]}`}function he(e){let t=new Map;for(let n of e)t.set(n,xe(n)||me(n));return t}function ge(e,t){return t===`sqlite`?e?`SQLite + JSONL supplement`:`SQLite`:t===`global-state`?`Cursor global state`:t===`jsonl`?e?`JSONL fallback`:`JSONL transcript`:t===`jsonl+tools`?e?`JSONL + agent-tools fallback`:`JSONL + agent-tools`:e?`SQLite + JSONL`:`JSONL`}var _e=/^(.+?)\/\.claude\/worktrees\/[^/]+(?:\/.*)?$/;function ve(e){let t=e.replace(/\/$/,``).match(_e);return t?t[1]:null}function ye(e){return ve(e)??e}function be(e){let t=new Map;for(let n of e){let e=ye(n.project),r=t.get(e);if(r){r.sessions+=n.sessions,r.cost+=n.cost,r.prompts+=n.prompts,r.durationMs+=n.durationMs,r.toolCalls+=n.toolCalls,r.edits+=n.edits,r.branchCount+=n.branchCount,r.prCount+=n.prCount,r.memoryFileCount=Math.max(r.memoryFileCount,n.memoryFileCount),(n.lastActivity||``)>(r.lastActivity||``)&&(r.lastActivity=n.lastActivity);for(let[e,t]of Object.entries(n.sessionsPerDay))r.sessionsPerDay[e]=(r.sessionsPerDay[e]||0)+t}else t.set(e,{...n,project:e,sessionsPerDay:{...n.sessionsPerDay}})}return[...t.values()]}function xe(e){let t=e.replace(/\/$/,``);return t?t===`(globalStorage)`?`Cursor Global Storage`:t===`~`?`Home`:/\/\.cursor\/projects\/.+\/terminals$/.test(t)?`Cursor Terminals`:/\/\.cursor\/extensions\//.test(t)?`Cursor Extension`:null:null}const Se=`__all__`;function Ce(){return new URLSearchParams(window.location.search).get(`project`)||`__all__`}function B(){return new URLSearchParams(window.location.search).get(`q`)||``}function we(){return new URLSearchParams(window.location.search).get(`archived`)===`true`}function Te(){let[e,t]=(0,_.useState)(Ce),[n,r]=(0,_.useState)(B),[i,a]=(0,_.useState)(we);return(0,_.useEffect)(()=>{let e=()=>{t(Ce()),r(B()),a(we())};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),{selectedProject:e,filter:n,showArchived:i,handleProjectChange:e=>{t(e),L({project:e===`__all__`?null:e})},handleFilterChange:e=>{r(e),L({q:e||null},{replace:!0})},handleToggleArchived:()=>{let e=!i;a(e),L({archived:e?`true`:null})}}}var Ee=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),V=c(o(((e,t)=>{t.exports=Ee()}))(),1);function De(e,t=450){let[n,r]=(0,_.useState)(e),i=(0,_.useRef)(e);return(0,_.useEffect)(()=>{let n=i.current,a=e-n;if(Math.abs(a)<1){i.current=e,r(e);return}let o=0,s=performance.now(),c=l=>{let u=Math.min(1,(l-s)/t),d=n+a*(1-(1-u)**3);i.current=d,r(d),u<1?o=requestAnimationFrame(c):(i.current=e,r(e))};return o=requestAnimationFrame(c),()=>cancelAnimationFrame(o)},[e,t]),n}function Oe({value:e,durationMs:t,formatter:n=e=>Math.round(e).toLocaleString()}){return(0,V.jsx)(V.Fragment,{children:n(De(e,t))})}function ke(e){if(e==null||e===``)return;let t=e instanceof Date?e:new Date(e);if(!Number.isNaN(t.getTime()))return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}var Ae=m();function je(e){let t=[...e.dataSourceInfo?.notes||[]];return e.provider===`cursor`&&(e.dataSource===`sqlite`||e.dataSource===`global-state`)&&t.unshift(`Some Cursor metrics are best-effort estimates and may be incomplete.`),e.stats.tokenUsage||t.push(`Token and cost metrics may be unavailable.`),[...new Set(t)]}function Me(e){let t=je(e);return{duration:t.find(e=>/duration/i.test(e)),tokens:t.find(e=>/token|cost|model attribution/i.test(e)),turnStats:t.find(e=>/per-turn|turn stats|turn metrics/i.test(e))}}function Ne({title:e,className:t=``}){let[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(null),c=(0,_.useRef)(null),l=e.split(`
|
|
21
|
+
`).map(e=>e.trim()).filter(Boolean),u=n||i;return(0,_.useEffect)(()=>{if(!u)return;let e=()=>{let e=c.current?.getBoundingClientRect();if(!e)return;let t=56+l.length*20,n=Math.min(Math.max(e.left+e.width/2-288/2,16),window.innerWidth-288-16),r=e.bottom+8;s({left:n,top:r+t>window.innerHeight-16?Math.max(16,e.top-t-8):r})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[u,l.length]),(0,_.useEffect)(()=>{if(!n)return;let e=e=>{c.current?.contains(e.target)||r(!1)},t=e=>{e.key===`Escape`&&r(!1)};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,t)}},[n]),(0,V.jsxs)(`span`,{ref:c,className:`inline-flex ${t}`,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,V.jsx)(`button`,{type:`button`,"aria-expanded":n,"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:()=>r(e=>!e),onFocus:()=>a(!0),onBlur:()=>a(!1),children:`!`}),u&&o?(0,Ae.createPortal)((0,V.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:o,children:[(0,V.jsx)(`div`,{className:`mb-1 text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-orange`,children:`Data Quality`}),(0,V.jsx)(`div`,{className:`space-y-1`,children:l.map(e=>(0,V.jsx)(`div`,{className:`text-[11px] font-mono leading-relaxed text-terminal-dim`,children:e},e))})]}),document.body):null]})}function H(e,t,n=`${t}s`){return e===1?t:n}function Pe(e,t=`short`){if(!e)return``;let n=Date.now()-new Date(e).getTime(),r=Math.floor(n/6e4);if(t===`long`){if(r<1)return`just now`;if(r<60)return`${r}m ago`;let e=Math.floor(r/60);if(e<24)return`${e}h ago`;let t=Math.floor(e/24);return t<30?`${t}d ago`:`${Math.floor(t/30)}mo ago`}if(r<1)return`now`;if(r<60)return`${r}m`;let i=Math.floor(r/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}var Fe={sqlite:`SQLite (store.db)`,"global-state":`SQLite (global state.vscdb)`,jsonl:`JSONL transcript`,"jsonl+tools":`JSONL + agent-tools`};function Ie(e){return e?Fe[e]||e:`unknown`}function Le({label:e,value:t,color:n}){return(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl px-3 py-3 shadow-layer-sm`,children:[(0,V.jsx)(`div`,{className:`text-xl font-bold ${typeof t==`number`?`tabular-nums`:`truncate w-full`} ${n}`,title:typeof t==`string`?t:void 0,children:t}),(0,V.jsx)(`div`,{className:`text-terminal-dimmer text-[10px] font-sans font-medium uppercase tracking-widest mt-0.5`,children:e})]})}function U(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function Re(e){if(!e)return``;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function ze(e){return!e||e<1?``:e<1e3?`${Math.round(e)}ms`:e<1e4?`${(e/1e3).toFixed(1)}s`:Re(e)}function Be(e){return!e||e<1?``:e<1e3?`${e}`:e<1e4?`${(e/1e3).toFixed(1)}K`:e<1e6?`${Math.round(e/1e3)}K`:`${(e/1e6).toFixed(1)}M`}var Ve=(0,_.createContext)(null);function He(){let e=(0,_.useContext)(Ve);if(!e)throw Error(`useScanInsightsContext must be used within ScanInsightsProvider`);return e}function Ue({children:e}){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a]=(0,_.useState)(()=>new Map),o=(0,_.useRef)(!1),[,s]=(0,_.useState)(0),[c,l]=(0,_.useState)(!1),u=(0,_.useRef)(!1);(0,_.useEffect)(()=>{let e=!1,t,r=()=>{e||fetch(`/api/scan/start`,{method:`POST`}).catch(()=>{})};return(async()=>{try{let i=await fetch(`/api/scan/status`);if(!i.ok||e)return;let a=await i.json();if(n(a),a.running)return;if(!a.hasCachedResults||!x(a.cachedAt,3e5)){r();return}let o=Date.now()-new Date(a.cachedAt).getTime(),s=Math.max(1e3,y-o);t=window.setTimeout(r,s)}catch{r()}})(),()=>{e=!0,t&&window.clearTimeout(t)}},[]),(0,_.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await fetch(`/api/scan/status`);if(!t.ok||e)return null;let r=await t.json();return n(r),r}catch{return null}},r=async()=>{l(!0);try{let t=await fetch(`/api/insights`);if(t.ok){let n=await t.json();n.type===`user`&&!e&&i(n.insights)}}catch{}finally{e||l(!1)}};t().then(e=>{e?.hasInsights&&!u.current&&(u.current=!0,r())});let a=setInterval(async()=>{let n=await t();!n||e||(n.hasInsights&&!u.current&&(u.current=!0,r()),!n.running&&n.finishedAt&&(n.resultCount>0&&(o.current=!0,r(),s(e=>(queueMicrotask(()=>{o.current=!1}),e+1))),clearInterval(a)))},2e3);return()=>{e=!0,clearInterval(a)}},[]);let d=(0,_.useCallback)(e=>{a.has(e)&&!o.current||(l(!0),fetch(`/api/insights?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(t=>{t?.type===`project`&&(a.set(e,t.insights),s(e=>e+1))}).catch(()=>{}).finally(()=>l(!1)))},[a]),f=(0,_.useMemo)(()=>({scanStatus:t,userInsights:r,projectInsightsCache:a,fetchProjectInsights:d,loading:c}),[t,r,a,d,c]);return(0,V.jsx)(Ve.Provider,{value:f,children:e})}function We(){return(0,V.jsxs)(`div`,{className:`border-b border-terminal-border-subtle pb-3 animate-pulse`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-baseline gap-3 min-w-0`,children:[(0,V.jsx)(`div`,{className:`h-5 w-36 skeleton rounded`}),(0,V.jsx)(`div`,{className:`h-3 w-24 skeleton rounded opacity-40`})]}),(0,V.jsx)(`div`,{className:`h-3.5 w-24 skeleton rounded opacity-40`})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-5`,children:[[16,14,10,12].map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(`div`,{className:`h-3.5 skeleton rounded`,style:{width:`${e*4}px`}}),(0,V.jsx)(`div`,{className:`h-2.5 w-10 skeleton rounded opacity-40`})]},t)),(0,V.jsx)(`div`,{className:`flex-1`}),(0,V.jsx)(`div`,{className:`flex items-end gap-px h-4`,children:Array.from({length:30},(e,t)=>(0,V.jsx)(`div`,{className:`w-1 rounded-sm skeleton`,style:{height:`${Math.max(2,Math.random()*16)}px`,opacity:.15}},t))})]})]})}function Ge({insights:e,variant:t}){let[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(!1),o=t===`project`,s=o?`text-terminal-green`:`text-terminal-purple`,c=o?`bg-terminal-green`:`bg-terminal-purple`,l=o?e:null,u=o?null:e,d=l?.sessionCount??u?.totalSessions??0,f=l?.totalDurationMs??u?.totalDurationMs??0,p=l?.totalCost??u?.totalCost??0,m=l?.totalPrompts??u?.totalPrompts??0,h=l?.totalToolCalls??u?.totalToolCalls??0,g=l?.totalEdits??u?.totalEdits??0,v=l?.models??u?.models??{},y=l?.avgSessionDurationMs??u?.avgSessionDurationMs??0,b=l?.sessionsPerDay??u?.sessionsPerDay??{},x=l?.dataQuality?.notes??u?.dataQuality?.notes??[],S=l?.timeRange??u?.timeRange,C=l?l.project.split(`/`).pop()||l.project:`All Projects`,w=l?l.project:`${u?.totalProjects??0} projects`,T=u?.topProjects,D=(0,_.useMemo)(()=>T?[...be(T)].sort((e,t)=>t.sessions-e.sessions).slice(0,8):[],[T]);if(d===0)return null;let O=Object.entries(v).sort(([,e],[,t])=>t-e),k=O.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5`,children:`Models`}),(0,V.jsx)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:O.map(([e,t])=>(0,V.jsxs)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim`,title:e,children:[E(e),` `,(0,V.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[t,`x`]})]},e))})]}),A={month:`short`,day:`numeric`,year:`numeric`},j=S&&(0,V.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dimmer`,children:[`Active`,` `,(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:new Date(S.first).toLocaleDateString(`en-US`,A)}),` — `,(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:new Date(S.last).toLocaleDateString(`en-US`,A)})]});return(0,V.jsxs)(`div`,{className:`border-b border-terminal-border-subtle pb-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-1.5`,children:[(0,V.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ${c} shrink-0 self-center`}),(0,V.jsx)(`h2`,{className:`text-base font-sans font-semibold text-terminal-text truncate`,children:C}),x.length>0&&(0,V.jsx)(Ne,{title:x.join(`
|
|
22
|
+
`),className:`shrink-0`}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer truncate hidden sm:inline`,children:w})]}),(0,V.jsxs)(`button`,{onClick:()=>r(e=>!e),className:`flex items-center gap-1.5 text-xs font-mono tabular-nums shrink-0 hover:text-terminal-text transition-colors ${s}`,children:[d,` session`,d===1?``:`s`,(0,V.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 12 12`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,className:`transition-transform duration-200 ${n?`rotate-180`:``}`,children:(0,V.jsx)(`path`,{d:`M3 4.5l3 3 3-3`})})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-4 flex-wrap text-xs font-mono`,children:[(0,V.jsxs)(`span`,{className:`text-terminal-blue tabular-nums`,children:[Re(f),(0,V.jsx)(`span`,{className:`text-terminal-dimmer ml-1 text-[10px]`,children:`duration`})]}),p>0&&(0,V.jsxs)(`span`,{className:`text-terminal-orange tabular-nums`,children:[`$`,p.toFixed(2),(0,V.jsx)(`span`,{className:`text-terminal-dimmer ml-1 text-[10px]`,children:`cost`})]}),(0,V.jsxs)(`span`,{className:`text-terminal-green tabular-nums`,children:[Ke(m),(0,V.jsx)(`span`,{className:`text-terminal-dimmer ml-1 text-[10px]`,children:`prompts`})]}),(0,V.jsxs)(`span`,{className:`text-terminal-text tabular-nums`,children:[Ke(h),(0,V.jsx)(`span`,{className:`text-terminal-dimmer ml-1 text-[10px]`,children:`tools`})]}),g>0&&(0,V.jsxs)(`span`,{className:`text-terminal-purple tabular-nums`,children:[Ke(g),(0,V.jsx)(`span`,{className:`text-terminal-dimmer ml-1 text-[10px]`,children:`edits`})]}),(0,V.jsxs)(`span`,{className:`text-terminal-dimmer text-[10px] tabular-nums hidden lg:inline`,children:[`avg `,Re(y),`/session`]}),(0,V.jsx)(`div`,{className:`flex-1 flex justify-end`,children:(0,V.jsx)(`div`,{className:`flex items-end gap-px h-3.5`,children:(()=>{let e=new Date,t=new Date(e);t.setDate(t.getDate()-29);let n=[],r=new Date(t);for(;r<=e;){let e=ke(r);n.push({day:e,count:b[e]||0}),r.setDate(r.getDate()+1)}let i=Math.max(...n.map(e=>e.count),1);return n.map(e=>(0,V.jsx)(`div`,{title:`${e.day}: ${e.count}`,className:`w-1 rounded-sm ${e.count>0?c:`bg-terminal-surface-2`}`,style:{height:e.count>0?`${Math.max(15,e.count/i*100)}%`:`2px`,opacity:e.count>0?.35+e.count/i*.65:.15}},e.day))})()})})]}),n&&l&&(0,V.jsxs)(`div`,{className:`mt-3 pt-3 border-t border-terminal-border-subtle space-y-3`,children:[l.branches.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5`,children:[`Branches (`,l.branches.length,`)`]}),(0,V.jsx)(`div`,{className:`space-y-0.5 max-h-32 overflow-y-auto`,children:l.branches.slice(0,15).map(e=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,V.jsx)(`span`,{className:`font-mono text-terminal-purple truncate`,children:e.branch}),(0,V.jsxs)(`span`,{className:`text-terminal-dimmer tabular-nums shrink-0`,children:[e.sessionIds.length,`x`]}),e.prLinks?.map(e=>(0,V.jsxs)(`a`,{href:e.prUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-terminal-blue hover:underline shrink-0`,children:[`#`,e.prNumber]},e.prUrl))]},e.branch))})]}),l.hotFiles.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5`,children:`Most modified files`}),(0,V.jsx)(`div`,{className:`space-y-0.5 max-h-28 overflow-y-auto`,children:l.hotFiles.slice(0,10).map(e=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,V.jsx)(`span`,{className:`font-mono text-terminal-dim truncate flex-1`,children:e.file}),(0,V.jsxs)(`span`,{className:`text-terminal-dimmer tabular-nums shrink-0`,children:[e.editCount,`x / `,e.sessionCount,`s`]})]},e.file))})]}),k,j,l.memory&&l.memory.memoryFiles.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`button`,{onClick:()=>a(e=>!e),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:[(0,V.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-90`:``}`,children:(0,V.jsx)(`path`,{d:`M4.5 2l4 4-4 4`})}),`Memory (`,l.memory.memoryFiles.length,` files)`]}),i&&(0,V.jsx)(`div`,{className:`space-y-1.5 max-h-48 overflow-y-auto`,children:l.memory.memoryFiles.map(e=>(0,V.jsxs)(`div`,{className:`bg-terminal-surface-2 rounded-lg px-3 py-2 text-xs`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,V.jsx)(`span`,{className:`font-mono text-terminal-text font-medium`,children:e.name}),e.type&&(0,V.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-terminal-surface text-terminal-dimmer text-[10px]`,children:e.type})]}),e.description&&(0,V.jsx)(`div`,{className:`text-terminal-dim text-[11px] mb-1`,children:e.description}),(0,V.jsx)(`div`,{className:`font-mono text-terminal-dimmer whitespace-pre-wrap line-clamp-3 text-[11px] leading-relaxed`,children:e.content})]},e.name))})]})]}),n&&u&&(0,V.jsxs)(`div`,{className:`mt-3 pt-3 border-t border-terminal-border-subtle space-y-3`,children:[u.topProjects.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5`,children:`Top projects`}),(0,V.jsx)(`div`,{className:`space-y-1`,children:D.map(e=>{let t=e.project.split(`/`).pop()||e.project;return(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,V.jsx)(`span`,{className:`font-mono text-terminal-text truncate flex-1`,title:e.project,children:t}),(0,V.jsxs)(`span`,{className:`text-terminal-dimmer tabular-nums shrink-0`,children:[e.sessions,`s`]}),e.durationMs>0&&(0,V.jsx)(`span`,{className:`text-terminal-blue tabular-nums shrink-0`,children:Re(e.durationMs)}),(0,V.jsxs)(`span`,{className:`text-terminal-green tabular-nums shrink-0`,children:[e.prompts,`p`]}),e.edits>0&&(0,V.jsxs)(`span`,{className:`text-terminal-purple tabular-nums shrink-0`,children:[e.edits,`e`]}),e.prCount>0&&(0,V.jsxs)(`span`,{className:`text-terminal-blue tabular-nums shrink-0`,children:[e.prCount,`pr`]}),e.cost>0&&(0,V.jsxs)(`span`,{className:`text-terminal-orange tabular-nums shrink-0`,children:[`$`,e.cost.toFixed(2)]})]},e.project)})})]}),k,j]})]})}function Ke(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}var qe=864e5,Je=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],Ye=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function Xe(e){return ke(e)}function Ze(e){return e===`7d`?7:e===`30d`?30:e===`90d`?90:0}function Qe(e,t){if(t===`all`)return e;let n=Ze(t),r=new Date;r.setHours(0,0,0,0),r.setDate(r.getDate()-n);let i=Xe(r),a={};for(let[t,n]of Object.entries(e))t>=i&&(a[t]=n);return a}function $e(e,t,n){if(n===`all`)return{sessions:t.totalSessions,replays:t.totalReplays,durationMs:t.totalDurationMs,cost:t.totalCost,prompts:t.totalPrompts,edits:t.totalEdits,toolCalls:t.totalToolCalls,projects:t.totalProjects};let r=Qe(e,n),i=Object.values(r).reduce((e,t)=>e+t,0),a=t.totalSessions>0?i/t.totalSessions:0;return{sessions:i,replays:Math.round(t.totalReplays*a),durationMs:Math.round(t.totalDurationMs*a),cost:t.totalCost*a,prompts:Math.round(t.totalPrompts*a),edits:Math.round(t.totalEdits*a),toolCalls:Math.round(t.totalToolCalls*a),projects:t.totalProjects}}function et(e){let t=new Date;t.setHours(0,0,0,0);let n=0,r=new Date(t);for(;;){let t=Xe(r);if(e[t]&&e[t]>0)n++,r.setDate(r.getDate()-1);else if(n===0){r.setDate(r.getDate()-1);let t=Xe(r);if(e[t]&&e[t]>0)n++,r.setDate(r.getDate()-1);else break}else break}let i=Object.keys(e).filter(t=>e[t]>0).sort(),a=0,o,s,c=0,l=``;for(let e=0;e<i.length;e++)if(e===0)c=1,l=i[e];else{let t=new Date(i[e-1]);(new Date(i[e]).getTime()-t.getTime())/qe===1?c++:(c>a&&(a=c,o=l,s=i[e-1]),c=1,l=i[e])}return c>a&&(a=c,o=l,s=i[i.length-1]),{current:n,longest:a,longestStart:o,longestEnd:s}}function tt(e){let t=[0,0,0,0,0,0,0];for(let[n,r]of Object.entries(e))if(r>0){let e=new Date(`${n}T00:00:00`);t[e.getDay()]+=r}return t.map((e,t)=>({day:Ye[t],shortDay:Je[t],count:e}))}function nt(e,t){let n=[],r=new Date;r.setHours(0,0,0,0);let i=r.getDay(),a=i===0?6:i-1,o=new Date(r.getTime()-a*qe);for(let r=t-1;r>=0;r--){let t=new Date(o.getTime()-r*7*qe),i=0;for(let n=0;n<7;n++){let r=Xe(new Date(t.getTime()+n*qe));i+=e[r]||0}let a=t.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`});n.push({weekLabel:a,sessions:i,startDate:Xe(t)})}return n}function rt(e){let t=0,n=``;for(let[r,i]of Object.entries(e))i>t&&(t=i,n=r);return t>0?{date:n,count:t}:null}function it(e){return e===0?`$0`:e<.01?`<$0.01`:e<1||e<100?`$${e.toFixed(2)}`:`$${Math.round(e)}`}function at(e){return e>=1e4?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function ot(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.floor(e/1e3)}k`:e.toString()}function st(e){let t=e?.filter(Boolean)||[],n=t.filter(e=>/duration estimates|timing data|duration/i.test(e)),r=t.filter(e=>/token snapshots|token and cost|cost totals/i.test(e));return{overall:t.length>0?t.join(`
|
|
23
|
+
`):void 0,duration:n.length>0?[`Coding time is approximate for Cursor sessions.`,...n].join(`
|
|
24
|
+
`):void 0,cost:r.length>0?[`Spend is a lower bound for Cursor sessions, not the full total.`,...r].join(`
|
|
25
|
+
`):void 0}}function ct(e){return[...new Set(e.split(`,`).map(e=>e.trim()).filter(Boolean))]}function lt(e){return e===`7d`?`Last 7 Days`:e===`30d`?`Last 30 Days`:e===`90d`?`Last 90 Days`:`All Time`}function ut({sessionsPerDay:e,weeks:t=52,showLegend:n=!0}){let{weekColumns:r,monthByWeek:i,maxVal:a}=(0,_.useMemo)(()=>{let n=new Date;n.setHours(0,0,0,0);let r=n.getDay(),i=new Date(n.getTime()+(6-r)*qe),a=t*7,o=new Date(i.getTime()-(a-1)*qe),s=0,c=[],l=new Map,u=-1;for(let t=0;t<a;t++){let n=new Date(o.getTime()+t*qe),r=Xe(n),i=e[r]||0,a=Math.floor(t/7);i>s&&(s=i),c[a]||(c[a]=[]),c[a].push({date:r,count:i});let d=n.getMonth();d!==u&&(l.set(a,n.toLocaleDateString(`en-US`,{month:`short`})),u=d)}return{weekColumns:c,monthByWeek:l,maxVal:s}},[e,t]),o=e=>{if(e===0)return{cls:`bg-terminal-border/20 dark:bg-terminal-surface-2`};let t=a<=1?1:e/a;return{cls:`bg-terminal-green`,style:{opacity:t<=.25?.4:t<=.5?.6:t<=.75?.8:1}}};return(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-end gap-[3px]`,children:[(0,V.jsx)(`div`,{className:`shrink-0 w-7`}),(0,V.jsx)(`div`,{className:`flex-1 flex gap-[3px] min-w-0`,children:r.map((e,t)=>(0,V.jsx)(`div`,{className:`flex-1 min-w-0 overflow-visible`,children:i.has(t)&&(0,V.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer whitespace-nowrap`,children:i.get(t)})},t))})]}),(0,V.jsxs)(`div`,{className:`flex gap-[3px]`,children:[(0,V.jsx)(`div`,{className:`shrink-0 w-7 flex flex-col gap-[3px]`,children:[``,`Mon`,``,`Wed`,``,`Fri`,``].map((e,t)=>(0,V.jsx)(`div`,{className:`flex-1 flex items-center text-[9px] font-mono text-terminal-dimmer leading-none`,children:e},t))}),(0,V.jsx)(`div`,{className:`flex-1 flex gap-[3px] min-w-0`,children:r.map((e,t)=>(0,V.jsx)(`div`,{className:`flex-1 flex flex-col gap-[3px] min-w-0`,children:e.map(e=>{let t=o(e.count);return(0,V.jsx)(`div`,{className:`aspect-square rounded-sm ${t.cls} hover:ring-1 hover:ring-terminal-text/30`,style:t.style,title:`${e.date}: ${e.count} session${e.count===1?``:`s`}`},e.date)})},t))})]}),n&&(0,V.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5 pt-1`,children:[(0,V.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer`,children:`Less`}),(0,V.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-sm bg-terminal-border/20 dark:bg-terminal-surface-2`}),(0,V.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-sm bg-terminal-green`,style:{opacity:.4}}),(0,V.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-sm bg-terminal-green`,style:{opacity:.6}}),(0,V.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-sm bg-terminal-green`,style:{opacity:.8}}),(0,V.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-sm bg-terminal-green`}),(0,V.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer`,children:`More`})]})]})}function dt({sessionsPerDay:e}){let t=(0,_.useMemo)(()=>{let t=new Date;t.setHours(0,0,0,0);let n=[],r=0;for(let i=27;i>=0;i--){let a=Xe(new Date(t.getTime()-i*qe)),o=e[a]||0;o>r&&(r=o),n.push({key:a,count:o})}return{cells:n,max:r}},[e]),n=e=>{if(e===0)return{className:`bg-terminal-border/20 dark:bg-white/5`};let n=t.max<=1?1:e/t.max;return{className:`bg-terminal-green`,style:{opacity:n<=.33?.45:n<=.66?.7:.9}}};return(0,V.jsx)(`div`,{className:`flex gap-[3px] flex-wrap`,children:t.cells.map(e=>{let t=n(e.count);return(0,V.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-[2px] ${t.className}`,style:t.style},e.key)})})}function ft({stats:e,streak:t,bestDay:n,sessionsPerDay:r,range:i,providers:a,dataQualityNotes:o}){let s=(0,_.useRef)(null),c=(0,_.useMemo)(()=>{let e=Object.entries(a);return e.length===0?``:(e.sort((e,t)=>t[1]-e[1]),e.map(([e])=>ue(e)).join(` + `))},[a]),l=(0,_.useMemo)(()=>st(o),[o]),u=({label:e,title:t})=>(0,V.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1`,children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-medium text-terminal-dim uppercase tracking-wider`,children:e}),t?(0,V.jsx)(Ne,{title:t,className:`shrink-0`}):null]});return(0,V.jsxs)(`div`,{ref:s,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:[(0,V.jsx)(`div`,{className:`absolute -top-20 -right-20 w-64 h-64 bg-terminal-green/5 rounded-full blur-3xl pointer-events-none`}),(0,V.jsx)(`div`,{className:`absolute -bottom-20 -left-20 w-48 h-48 bg-terminal-blue/5 rounded-full blur-3xl pointer-events-none`}),(0,V.jsxs)(`div`,{className:`relative z-10`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.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`}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer px-2 py-0.5 rounded-full bg-terminal-surface-2`,children:lt(i)}),l.overall?(0,V.jsx)(Ne,{title:l.overall,className:`shrink-0`}):null]}),c&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dim`,children:c})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-4 gap-x-6 gap-y-5 mb-6`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,V.jsx)(Oe,{durationMs:500,value:e.sessions,formatter:at})}),(0,V.jsx)(u,{label:`sessions`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-blue tabular-nums`,children:(0,V.jsx)(Oe,{durationMs:500,value:e.replays,formatter:at})}),(0,V.jsx)(u,{label:`replays`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,V.jsx)(Oe,{durationMs:500,value:e.prompts,formatter:at})}),(0,V.jsx)(u,{label:`turns`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-orange tabular-nums`,children:(0,V.jsx)(Oe,{durationMs:500,value:e.toolCalls,formatter:at})}),(0,V.jsx)(u,{label:`tool calls`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-text tabular-nums`,children:(0,V.jsx)(Oe,{durationMs:500,value:e.durationMs,formatter:e=>D(e)})}),(0,V.jsx)(u,{label:`coding`,title:l.duration})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-orange tabular-nums`,children:(0,V.jsx)(Oe,{durationMs:500,value:e.cost,formatter:e=>it(e)})}),(0,V.jsx)(u,{label:`spent`,title:l.cost})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-blue tabular-nums`,children:(0,V.jsx)(Oe,{durationMs:500,value:e.edits,formatter:at})}),(0,V.jsx)(u,{label:`file edits`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-purple tabular-nums`,children:(0,V.jsx)(Oe,{durationMs:500,value:e.projects,formatter:e=>Math.round(e).toString()})}),(0,V.jsx)(u,{label:`projects`})]})]}),(0,V.jsx)(`div`,{className:`mb-4`,children:(0,V.jsx)(dt,{sessionsPerDay:r})}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between pt-4 border-t border-terminal-border/30`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-4`,children:[t.current>0&&(0,V.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dim`,children:[t.current,` day streak`]}),n&&n.count>0&&(0,V.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dim`,children:[`Most active: `,n.day]})]}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`vibe-replay.com`})]})]})]})}function pt({icon:e,label:t,value:n,sub:r}){return(0,V.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:(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(`span`,{className:`text-lg leading-none mt-0.5`,children:e}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest`,children:t}),(0,V.jsx)(`div`,{className:`text-lg font-mono font-bold text-terminal-text mt-0.5`,children:n}),r&&(0,V.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dimmer mt-0.5`,children:r})]})]})})}function mt(e){if(e<1e3)return`<1s`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;if(n<60)return r>0?`${n}m ${r}s`:`${n}m`;let i=Math.floor(n/60),a=n%60;return a>0?`${i}h ${a}m`:`${i}h`}function ht({histogram:e}){let t=Math.max(...e.buckets.map(e=>e.pct),1);return(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`div`,{className:`flex items-end gap-2 h-32`,children:e.buckets.map(e=>{let n=Math.max(e.pct/t*100,e.count>0?6:0);return(0,V.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-end h-full group relative`,children:[(0,V.jsx)(`div`,{className:`absolute bottom-full mb-1 hidden group-hover:block z-10`,children:(0,V.jsxs)(`div`,{className:`bg-terminal-surface-2 border border-terminal-border-subtle rounded-lg px-2 py-1 shadow-layer-md whitespace-nowrap`,children:[(0,V.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dim`,children:e.label}),(0,V.jsxs)(`div`,{className:`text-[10px] font-mono text-terminal-green font-bold`,children:[e.count,` turn`,e.count===1?``:`s`,` (`,e.pct,`%)`]})]})}),e.pct>0&&(0,V.jsxs)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer tabular-nums mb-1`,children:[e.pct>=10?Math.round(e.pct):e.pct.toFixed(1),`%`]}),(0,V.jsx)(`div`,{className:`w-full rounded-md bg-terminal-green hover:opacity-90 transition-all`,style:{height:`${n}%`,minHeight:e.count>0?`4px`:`0`,opacity:e.count>0?.7:.1}})]},e.label)})}),(0,V.jsx)(`div`,{className:`flex gap-2`,children:e.buckets.map(e=>(0,V.jsx)(`div`,{className:`flex-1 text-center text-[9px] font-mono text-terminal-dimmer`,children:e.label},e.label))}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between pt-2 border-t border-terminal-border/20`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] font-mono text-terminal-dim`,children:[(0,V.jsxs)(`span`,{children:[`P50`,` `,(0,V.jsx)(`span`,{className:`text-terminal-text font-bold`,children:mt(e.percentiles.p50Ms)})]}),(0,V.jsx)(`span`,{className:`text-terminal-dimmer`,children:`·`}),(0,V.jsxs)(`span`,{children:[`P75`,` `,(0,V.jsx)(`span`,{className:`text-terminal-text font-bold`,children:mt(e.percentiles.p75Ms)})]}),(0,V.jsx)(`span`,{className:`text-terminal-dimmer`,children:`·`}),(0,V.jsxs)(`span`,{children:[`P90`,` `,(0,V.jsx)(`span`,{className:`text-terminal-text font-bold`,children:mt(e.percentiles.p90Ms)})]})]}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[e.totalTurns.toLocaleString(),` turns`]})]})]})}var gt=[{key:`cacheRead`,label:`Cache Read`,color:`bg-terminal-purple`},{key:`cacheCreation`,label:`Cache Write`,color:`bg-terminal-orange`},{key:`output`,label:`Output`,color:`bg-terminal-green`},{key:`input`,label:`Input`,color:`bg-terminal-blue`}];function _t({breakdown:e}){let t=e.input+e.output+e.cacheRead+e.cacheCreation;if(t===0)return null;let n=gt.map(n=>({...n,value:e[n.key],pct:e[n.key]/t*100})).filter(e=>e.value>0);return(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)(`div`,{className:`h-4 rounded-full bg-terminal-surface-2 overflow-hidden flex`,children:n.map(e=>(0,V.jsx)(`div`,{className:`h-full ${e.color} transition-all duration-500`,style:{width:`${e.pct}%`,opacity:.7}},e.key))}),(0,V.jsx)(`div`,{className:`space-y-2`,children:n.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-sm ${e.color}`,style:{opacity:.7}}),(0,V.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dim`,children:e.label})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-text tabular-nums`,children:ot(e.value)}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums w-10 text-right`,children:e.pct<.1?`<0.1%`:e.pct<1?`${e.pct.toFixed(1)}%`:`${Math.round(e.pct)}%`})]})]},e.key))}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between pt-2 border-t border-terminal-border/20`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`Total`}),(0,V.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-text font-bold tabular-nums`,children:ot(t)})]})]})}function vt({data:e}){let t=Math.max(...e.map(e=>e.sessions),1);if(!e.some(e=>e.sessions>0))return(0,V.jsx)(`div`,{className:`flex items-center justify-center h-full text-terminal-dimmer text-xs font-mono`,children:`No activity to show`});let n=e.slice(-4),r=e.slice(-8,-4),i=n.reduce((e,t)=>e+t.sessions,0)/Math.max(n.length,1),a=r.reduce((e,t)=>e+t.sessions,0)/Math.max(r.length,1),o=i>a,s=Math.abs(i-a)<.5;return(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`div`,{className:`flex items-end gap-1.5 h-28`,children:e.map(e=>{let n=Math.max(e.sessions/t*100,e.sessions>0?6:0);return(0,V.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-end h-full group relative`,children:[(0,V.jsx)(`div`,{className:`absolute bottom-full mb-1 hidden group-hover:block z-10`,children:(0,V.jsxs)(`div`,{className:`bg-terminal-surface-2 border border-terminal-border-subtle rounded-lg px-2 py-1 shadow-layer-md whitespace-nowrap`,children:[(0,V.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dim`,children:e.weekLabel}),(0,V.jsxs)(`div`,{className:`text-[10px] font-mono text-terminal-green font-bold`,children:[e.sessions,` session`,e.sessions===1?``:`s`]})]})}),(0,V.jsx)(`div`,{className:`w-full rounded-md bg-terminal-green hover:opacity-90 transition-all`,style:{height:`${n}%`,minHeight:e.sessions>0?`4px`:`0`,opacity:e.sessions>0?.7:0}})]},e.startDate)})}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`div`,{className:`flex gap-1.5 overflow-hidden`,children:e.filter((e,t)=>t%2==0).map(e=>(0,V.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer`,children:e.weekLabel},e.startDate))}),!s&&(0,V.jsxs)(`span`,{className:`text-[10px] font-mono font-bold ${o?`text-terminal-green`:`text-terminal-orange`}`,children:[o?`↑`:`↓`,` `,o?`Trending up`:`Slowing down`]})]})]})}function yt({data:e}){let t=Math.max(...e.map(e=>e.count),1);return(0,V.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>{let n=t>0?e.count/t*100:0;return(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dim w-7 text-right shrink-0`,children:e.shortDay}),(0,V.jsx)(`div`,{className:`flex-1 h-4 rounded bg-terminal-surface-2 overflow-hidden`,children:(0,V.jsx)(`div`,{className:`h-full rounded bg-terminal-green transition-all duration-500`,style:{width:`${Math.max(n,e.count>0?3:0)}%`,opacity:.65}})}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dim w-6 text-right tabular-nums shrink-0`,children:e.count})]},e.day)})})}function bt({projects:e}){if(e.length===0)return(0,V.jsx)(`div`,{className:`text-terminal-dimmer text-xs font-mono py-4 text-center`,children:`No project data`});let t=Math.max(...e.map(e=>e.sessions),1);return(0,V.jsx)(`div`,{className:`space-y-2`,children:e.slice(0,8).map(e=>{let n=A(e.project),r=e.sessions/t*100;return(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-text truncate max-w-[60%]`,children:n}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dim tabular-nums`,children:[e.sessions,` session`,e.sessions===1?``:`s`,e.cost>0&&` · ${it(e.cost)}`]})]}),(0,V.jsx)(`div`,{className:`h-1.5 rounded-full bg-terminal-surface-2 overflow-hidden`,children:(0,V.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(r,3)}%`,opacity:.65}})})]},e.project)})})}function xt({models:e}){let t=(0,_.useMemo)(()=>(()=>{let t=new Map;for(let[n,r]of Object.entries(e))for(let e of ct(n)){let n=E(e);t.set(n,(t.get(n)??0)+r)}return[...t.entries()].map(([e,t])=>({model:e,count:t})).sort((e,t)=>t.count-e.count)})(),[e]),n=t.reduce((e,t)=>e+t.count,0);if(t.length===0)return(0,V.jsx)(`div`,{className:`text-terminal-dimmer text-xs font-mono py-4 text-center`,children:`No model data`});let r=[`bg-terminal-green`,`bg-terminal-blue`,`bg-terminal-orange`,`bg-terminal-purple`,`bg-terminal-red`,`bg-terminal-dim`];return(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`div`,{className:`h-3 rounded-full bg-terminal-surface-2 overflow-hidden flex`,children:t.map((e,t)=>(0,V.jsx)(`div`,{className:`h-full ${r[t%r.length]} transition-all duration-500`,style:{width:`${e.count/n*100}%`,opacity:.7}},e.model))}),(0,V.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:t.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-sm ${r[t%r.length]} shrink-0`,style:{opacity:.7}}),(0,V.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dim truncate`,children:e.model}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums ml-auto shrink-0`,children:e.count})]},e.model))})]})}function St({providers:e}){let t=(0,_.useMemo)(()=>Object.entries(e).map(([e,t])=>({provider:e,label:ue(e),count:t})).sort((e,t)=>t.count-e.count),[e]),n=t.reduce((e,t)=>e+t.count,0);return t.length===0?null:(0,V.jsx)(`div`,{className:`space-y-3`,children:t.map(e=>{let t=n>0?e.count/n*100:0;return(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-text`,children:e.label}),(0,V.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dim tabular-nums`,children:[e.count,` (`,Math.round(t),`%)`]})]}),(0,V.jsx)(`div`,{className:`h-2 rounded-full bg-terminal-surface-2 overflow-hidden`,children:(0,V.jsx)(`div`,{className:`h-full rounded-full ${de(e.provider)} transition-all duration-500`,style:{width:`${t}%`,opacity:.7}})})]},e.provider)})})}function Ct(){return(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,V.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 md:px-6 py-6 space-y-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`div`,{className:`h-6 w-32 skeleton rounded`}),(0,V.jsx)(`div`,{className:`flex gap-1`,children:Array.from({length:4},(e,t)=>(0,V.jsx)(`div`,{className:`h-7 w-10 skeleton rounded-md`},t))})]}),(0,V.jsxs)(`div`,{className:`rounded-2xl bg-terminal-surface border border-terminal-border/30 p-6 space-y-5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`div`,{className:`h-4 w-20 skeleton rounded`}),(0,V.jsx)(`div`,{className:`h-5 w-12 skeleton rounded-md`})]}),(0,V.jsx)(`div`,{className:`h-3 w-28 skeleton rounded`})]}),(0,V.jsx)(`div`,{className:`grid grid-cols-4 gap-6`,children:Array.from({length:8},(e,t)=>(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`div`,{className:`h-7 skeleton rounded`,style:{width:`${45+t*13%40}%`}}),(0,V.jsx)(`div`,{className:`h-3 w-16 skeleton rounded`})]},t))}),(0,V.jsx)(`div`,{className:`h-2.5 w-full skeleton rounded`}),(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[(0,V.jsx)(`div`,{className:`h-3 w-40 skeleton rounded`}),(0,V.jsx)(`div`,{className:`h-3 w-24 skeleton rounded`})]})]}),(0,V.jsxs)(`div`,{className:`rounded-xl bg-terminal-surface p-5 shadow-layer-sm space-y-4`,children:[(0,V.jsx)(`div`,{className:`h-3 w-16 skeleton rounded`}),(0,V.jsx)(`div`,{className:`space-y-1.5`,children:Array.from({length:3},(e,t)=>(0,V.jsx)(`div`,{className:`h-3 skeleton rounded`},t))})]}),(0,V.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:Array.from({length:4},(e,t)=>(0,V.jsxs)(`div`,{className:`rounded-xl bg-terminal-surface p-4 shadow-layer-sm space-y-2.5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`h-5 w-5 skeleton rounded`}),(0,V.jsx)(`div`,{className:`h-3 w-20 skeleton rounded`})]}),(0,V.jsx)(`div`,{className:`h-6 w-24 skeleton rounded`}),(0,V.jsx)(`div`,{className:`h-2.5 w-16 skeleton rounded`})]},t))}),(0,V.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:Array.from({length:2},(e,t)=>(0,V.jsxs)(`div`,{className:`rounded-xl bg-terminal-surface p-5 shadow-layer-sm space-y-4`,children:[(0,V.jsx)(`div`,{className:`h-3 w-24 skeleton rounded`}),(0,V.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:5},(e,n)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`h-3 w-8 skeleton rounded shrink-0`}),(0,V.jsx)(`div`,{className:`h-5 skeleton rounded`,style:{width:`${25+(n*17+t*31)%60}%`}})]},n))})]},t))})]})})}function wt({scanStatus:e,hasCachedInsights:t}){let n=e?.phase===`discovering`?`Finding sessions across providers and restoring the latest local data.`:e?.total?`Refreshing ${e.scanned}/${e.total} sessions in the background.`:`Preparing your latest session insights.`;return(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,V.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 md:px-6 py-8 space-y-4`,children:[(0,V.jsxs)(`div`,{className:`rounded-xl border border-terminal-purple/20 bg-terminal-surface px-4 py-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-sans text-terminal-text`,children:[(0,V.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-terminal-purple animate-pulse`}),(0,V.jsx)(`span`,{children:t?`Refreshing cached insights`:`Loading your insights`})]}),(0,V.jsx)(`p`,{className:`mt-1 text-xs font-mono text-terminal-dim`,children:n})]}),(0,V.jsx)(Ct,{})]})})}function Tt(){let[e,t]=(0,_.useState)(null),n=(0,_.useCallback)((e,n)=>{let r=0,i=0,a=0,o=new Map(e.map(e=>[e.slug,e]));for(let t of e)r+=t.promptCount??(t.prompts?.length||(t.firstPrompt?1:0)),i+=t.toolCallCount??0;for(let e of n){let t=o.get(e.slug),n=e.stats.toolCalls||0;t?t.toolCallCount==null?i+=n:n>t.toolCallCount&&(i+=n-t.toolCallCount):(r+=e.stats.userPrompts||0,i+=n),a+=e.stats.durationMs||0}let s=new Set;for(let t of e)s.add(t.project);for(let e of n)s.add(e.project);t({sessions:e.length,replays:n.length,prompts:r,toolCalls:i,duration:a,projects:s.size})},[]);return(0,_.useEffect)(()=>{Promise.all([fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null),fetch(`/api/sessions/cached`).then(e=>e.ok?e.json():null).catch(()=>null)]).then(([e,t])=>{let r=b(e)?.sessions||[],i=b(t)?.sessions||[];(r.length>0||i.length>0)&&n(r,i)})},[n]),e}function Et(){let{userInsights:e,loading:t,scanStatus:n}=He(),r=Tt(),[i,a]=(0,_.useState)(`all`),o=n?.running&&!e,{stats:s,streak:c,dayOfWeek:l,bestDay:u,peak:d,weeklyTrend:f,activeDays:p,firstSessionDate:m}=(0,_.useMemo)(()=>{if(!e)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};let t=e.sessionsPerDay||{},n=Qe(t,i),a=$e(n,{...e,totalReplays:r?.replays??0},i),o=et(t),s=tt(n);return{stats:a,streak:o,dayOfWeek:s,bestDay:[...s].sort((e,t)=>t.count-e.count)[0]||null,peak:rt(n),weeklyTrend:nt(t,12),activeDays:Object.values(n).filter(e=>e>0).length,firstSessionDate:e.timeRange?.first||null}},[e,i,r]),h=(0,_.useMemo)(()=>be(e?.topProjects||[]),[e?.topProjects]);if(!e&&(t||o||n?.phase===`discovering`))return(0,V.jsx)(wt,{scanStatus:n,hasCachedInsights:!!n?.hasCachedResults});if(!e)return(0,V.jsx)(Ct,{});let g=p>0?(s.sessions/p).toFixed(1):`0`,v=s.sessions>0?Math.round(s.prompts/s.sessions):0,y=m?Math.floor((Date.now()-new Date(m).getTime())/qe):0,b=r?.sessions??e.totalSessions,x=Math.max(0,b-e.totalSessions),S=!!(n?.running&&n?.hasCachedResults),w=n?.cachedAt?C(n.cachedAt):``,T=n?.total&&n.total>0?`${Math.min(n.scanned,n.total)}/${n.total}`:void 0;return(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,V.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 md:px-6 py-6 space-y-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`h1`,{className:`text-lg font-sans font-bold text-terminal-text`,children:`Your Insights`}),(0,V.jsx)(`div`,{className:`flex items-center gap-0.5 p-0.5 rounded-lg bg-terminal-surface`,children:[`7d`,`30d`,`90d`,`all`].map(e=>(0,V.jsx)(`button`,{onClick:()=>a(e),className:`px-3 py-1.5 text-[11px] font-mono rounded-md transition-all ${i===e?`bg-terminal-green-subtle text-terminal-green font-bold`:`text-terminal-dim hover:text-terminal-text`}`,children:e===`all`?`All`:e},e))})]}),S&&(0,V.jsx)(`div`,{className:`rounded-xl border border-terminal-blue/30 bg-terminal-blue/10 px-4 py-3`,children:(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(`div`,{className:`mt-0.5 h-2 w-2 shrink-0 rounded-full bg-terminal-blue`}),(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`div`,{className:`text-xs font-sans font-semibold text-terminal-text`,children:`Showing cached insights snapshot while the background refresh runs`}),(0,V.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dim`,children:[w?`Snapshot from ${w} ago.`:`Using the latest cached scan.`,` `,T?`Refreshing ${T} sessions now.`:`Refreshing now.`]}),x>0&&(0,V.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dim`,children:[`Insights currently cover `,e.totalSessions,` scanned sessions;`,` `,x,` additional session`,x===1?``:`s`,` will appear after the refresh completes.`]})]})]})}),(0,V.jsx)(ft,{stats:s,streak:c,bestDay:u,sessionsPerDay:e.sessionsPerDay||{},range:i,providers:e.providers||{},dataQualityNotes:e.dataQuality?.notes}),(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:`Activity`}),i!==`all`&&(0,V.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer`,children:`Last 52 weeks`})]}),(0,V.jsx)(ut,{sessionsPerDay:e.sessionsPerDay||{}})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:[(0,V.jsx)(pt,{icon:`🔥`,label:`Current Streak`,value:`${c.current} day${c.current===1?``:`s`}`,sub:c.longest>c.current?`Best: ${c.longest} days`:c.current>0?`Personal best!`:void 0}),(0,V.jsx)(pt,{icon:`⚡`,label:`Avg / Active Day`,value:`${g} sessions`,sub:`${p} active day${p===1?``:`s`}`}),(0,V.jsx)(pt,{icon:`💬`,label:`Avg / Session`,value:`${v} prompts`,sub:s.sessions>0?`~${D(s.durationMs/s.sessions)} each`:void 0}),d?(0,V.jsx)(pt,{icon:`🏆`,label:`Peak Day`,value:`${d.count} sessions`,sub:new Date(`${d.date}T00:00:00`).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})}):(0,V.jsx)(pt,{icon:`📅`,label:`Vibe Coding Since`,value:y>0?`${y} days`:`Today`,sub:m?new Date(m).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}):void 0})]}),(e.turnDurationHistogram||e.tokenBreakdown)&&(0,V.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[e.turnDurationHistogram&&(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4`,children:`Turn Duration Distribution`}),(0,V.jsx)(ht,{histogram:e.turnDurationHistogram})]}),e.tokenBreakdown&&(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4`,children:`Token Usage`}),(0,V.jsx)(_t,{breakdown:e.tokenBreakdown})]})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4`,children:`Weekly Trend`}),(0,V.jsx)(vt,{data:f})]}),(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4`,children:`Day of Week`}),(0,V.jsx)(yt,{data:l})]})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4`,children:`Top Projects`}),(0,V.jsx)(bt,{projects:h.map(e=>({project:e.project,sessions:e.sessions,cost:e.cost,prompts:e.prompts,durationMs:e.durationMs,edits:e.edits}))})]}),(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm space-y-5`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4`,children:`Models`}),(0,V.jsx)(xt,{models:e.models||{}})]}),Object.keys(e.providers||{}).length>1&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4`,children:`Providers`}),(0,V.jsx)(St,{providers:e.providers||{}})]})]})]}),y>0&&(0,V.jsx)(`div`,{className:`text-center py-4`,children:(0,V.jsxs)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer`,children:[`You've been vibe coding for `,y,` day`,y===1?``:`s`,` ·`,` `,Re(s.durationMs),` total · `,at(s.toolCalls),` tool calls`]})})]})})}function Dt(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(!0),[c,l]=(0,_.useState)(!0),[u,d]=(0,_.useState)(null),[,f]=(0,_.useState)(null),[,p]=(0,_.useState)(null),m=(0,_.useRef)(!1),h=(0,_.useRef)(void 0),g=(0,_.useMemo)(()=>e.some(e=>e.provider===`cursor`),[e]),v=(0,_.useCallback)(async()=>{a(!0),s(!0),l(!0),d(null);try{let[e,n]=await Promise.all([fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null),fetch(`/api/sessions/cached`).then(e=>e.ok?e.json():null).catch(()=>null)]),i=b(e),o=b(n);i?.sessions.length&&t(i.sessions),o?.sessions.length&&r(o.sessions),(i?.sessions.length||o?.sessions.length)&&a(!1);let c=x(i?.cachedAt),u=x(o?.cachedAt),p=[];c&&s(!1),u&&l(!1),c||p.push(new Promise(e=>{f(0);let n=new EventSource(`/api/sources/stream`);n.onmessage=r=>{try{let a=JSON.parse(r.data);a.type===`progress`?f(a.scanned):a.type===`complete`?(t(a.sessions),f(null),n.close(),e()):a.type===`error`&&(i?.sessions.length||d(a.message||`Failed to load sessions`),f(null),n.close(),e())}catch{}},n.onerror=()=>{n.close(),f(null),fetch(`/api/sources`).then(e=>{if(!e.ok)throw Error(`Failed to load sources`);return e.json()}).then(e=>t(e.sessions)).catch(e=>{i?.sessions.length||d(e instanceof Error?e.message:`Failed to load sessions`)}).finally(()=>e())}}).finally(()=>s(!1))),u||p.push(fetch(`/api/sessions`).then(e=>{if(!e.ok)throw Error(`Failed to load replays`);return e.json()}).then(e=>r(e)).catch(e=>{o?.sessions.length||d(e instanceof Error?e.message:`Failed to load replays`)}).finally(()=>l(!1))),p.length>0&&await Promise.allSettled(p)}catch(e){d(e instanceof Error?e.message:`Failed to load data`)}finally{a(!1)}},[]);return(0,_.useEffect)(()=>{v()},[v]),(0,_.useEffect)(()=>{if(!o&&!g&&!m.current)return;let e=!1,n,r=async()=>{let n=b(await fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null));!e&&n?.sessions.length&&n.cachedAt!==h.current&&(h.current=n.cachedAt,t(n.sessions))},i=async()=>{let t=await fetch(`/api/sources/enrichment-status`).then(e=>e.ok?e.json():null).catch(()=>null);!t||e||(p(t),t.running?(m.current=!0,await r()):m.current&&(m.current=!1,await r()))};return i(),n=window.setInterval(()=>{i()},2500),()=>{e=!0,n&&window.clearInterval(n)}},[g,o]),{sources:e,setSources:t,replays:n,loading:i,loadingSources:o,loadingReplays:c,error:u}}function Ot(e,t){let n=0,r=0,i=0,a=new Map(e.map(e=>[e.slug,e]));for(let t of e)n+=t.promptCount??(t.prompts?.length||(t.firstPrompt?1:0)),r+=t.toolCallCount??0;for(let e of t){let t=a.get(e.slug),o=e.stats.toolCalls||0;t?t.toolCallCount==null?r+=o:o>t.toolCallCount&&(r+=o-t.toolCallCount):(n+=e.stats.userPrompts||0,r+=o),i+=e.stats.durationMs||0}let o=new Map;for(let t of e)o.set(t.provider,(o.get(t.provider)||0)+1);let s=[...o.entries()].map(([e,t])=>({provider:e,count:t,label:ue(e)})).sort((e,t)=>t.count-e.count),c=new Set;for(let t of e)c.add(t.project);for(let e of t)c.add(e.project);let l={};for(let t of e){let e=ke(t.timestamp);e&&(l[e]=(l[e]||0)+1)}let u=e.length,d=t.length,f=e.filter(e=>e.existingReplay).length,p=u>0?f/u*100:0;return{totalSessions:u,totalReplays:d,totalPrompts:n,totalToolCalls:r,totalDuration:i,providerBreakdown:s,projectCount:c.size,sessionsPerDay:l,recentSources:[...e].sort((e,t)=>t.timestamp.localeCompare(e.timestamp)).slice(0,5),recentReplays:[...t].sort((e,t)=>t.startTime.localeCompare(e.startTime)).slice(0,5),publishedCount:t.filter(e=>e.gist?.gistId).length,replayConversionPct:p}}function kt(){return(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,V.jsx)(`div`,{className:`h-3 w-28 skeleton rounded`}),(0,V.jsx)(`div`,{className:`h-3 w-14 skeleton rounded`})]}),(0,V.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2`,children:Array.from({length:5},(e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-3 rounded-lg bg-terminal-bg`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2.5`,children:[(0,V.jsx)(`div`,{className:`h-3.5 skeleton rounded`,style:{width:`${50+t*17%30}%`}}),(0,V.jsx)(`div`,{className:`h-3 skeleton rounded`,style:{width:`${60+t*23%25}%`}})]}),(0,V.jsx)(`div`,{className:`h-4 w-14 shrink-0 skeleton rounded`})]},t))}),(0,V.jsx)(`div`,{className:`h-8 mt-2 rounded-lg skeleton`})]})}function At({provider:e}){return(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-medium px-1.5 py-0.5 rounded-full uppercase tracking-wider ${le(e)}`,children:ce(e)})}function jt({sessions:e,isLoading:t,onViewAll:n,onGenerate:r,onViewReplay:i,onSessionClick:a,generatingSlug:o,generateErrorSlug:s}){return e.length===0?(0,V.jsx)(`div`,{className:`text-center py-6 text-terminal-dimmer text-xs font-mono`,children:t?`Loading sessions...`:`No sessions found. Start a coding session with Claude Code or Cursor.`}):(0,V.jsxs)(`div`,{className:`space-y-1 flex-1 flex flex-col`,children:[e.map(e=>{let t=!!e.existingReplay,n=o===e.slug,c=s===e.slug;return(0,V.jsxs)(`div`,{onClick:()=>a(e),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:[(0,V.jsx)(At,{provider:e.provider}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`p`,{className:`text-sm font-sans text-terminal-text truncate`,children:te(e)}),(0,V.jsx)(`p`,{className:`text-[11px] font-mono text-terminal-dimmer truncate`,children:A(e.project)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,V.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer tabular-nums`,children:k(e.timestamp)}),t?(0,V.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),i(e.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:[(0,V.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,V.jsx)(`polygon`,{points:`4 2 14 8 4 14`})}),`View`]}):(0,V.jsx)(`button`,{onClick:t=>{t.stopPropagation(),r(e)},disabled:n,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 ${c?`bg-terminal-red-subtle text-terminal-red`:`bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis`}`,children:n?(0,V.jsx)(`span`,{className:`animate-pulse`,children:`...`}):c?`Failed`:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,V.jsx)(`path`,{d:`M8 2v12M2 8h12`})}),`Generate`]})})]})]},`${e.provider}-${e.slug}`)}),(0,V.jsx)(`button`,{onClick:n,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 Mt({replays:e,isLoading:t,onViewAll:n,onOpen:r}){return e.length===0?(0,V.jsx)(`div`,{className:`text-center py-6 text-terminal-dimmer text-xs font-mono`,children:t?`Loading replays...`:`No replays yet. Generate one from the Sessions tab.`}):(0,V.jsxs)(`div`,{className:`space-y-1 flex-1 flex flex-col`,children:[e.map(e=>(0,V.jsxs)(`button`,{onClick:()=>r(e.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:[(0,V.jsx)(At,{provider:e.provider}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`p`,{className:`text-sm font-sans text-terminal-text truncate group-hover:text-terminal-green transition-colors`,children:re(e)}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-0.5`,children:[(0,V.jsxs)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer`,children:[e.stats.userPrompts,` prompts`]}),(0,V.jsx)(`span`,{className:`text-terminal-border text-[10px]`,children:`·`}),(0,V.jsxs)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer`,children:[e.stats.toolCalls,` tools`]}),e.stats.durationMs&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-terminal-border text-[10px]`,children:`·`}),(0,V.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer`,children:Re(e.stats.durationMs)})]})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[e.gist?.gistId&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple`,children:`published`}),(0,V.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer tabular-nums`,children:k(e.startTime)})]})]},e.slug)),(0,V.jsx)(`button`,{onClick:n,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 →`})]})}var Nt=[{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 Pt(){let[e,t]=(0,_.useState)(()=>Nt.map(e=>({...e,installed:!1,detail:`checking...`,loading:!0})));return(0,_.useEffect)(()=>{let e=!1;for(let n of Nt)fetch(`/api/system-checks?tool=${encodeURIComponent(n.name)}`).then(e=>e.ok?e.json():null).then(r=>{if(e)return;let i=r?.checks?.find(e=>e.name===n.name)||r?.checks?.[0];if(!i){t(e=>e.map(e=>e.name===n.name?{...e,installed:!1,detail:`check failed`,loading:!1}:e));return}t(e=>e.map(e=>e.name===n.name?{...e,installed:!!i.installed,version:i.version,detail:i.detail,loading:!1}:e))}).catch(()=>{e||t(e=>e.map(e=>e.name===n.name?{...e,installed:!1,detail:`check failed`,loading:!1}:e))});return()=>{e=!0}},[]),(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-3`,children:`System`}),(0,V.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-2`,children:e.map(e=>(0,V.jsxs)(`div`,{className:`flex items-start gap-2.5 px-3 py-2.5 rounded-lg bg-terminal-bg`,children:[(0,V.jsx)(`div`,{className:`w-2 h-2 mt-1 rounded-full shrink-0 ${e.loading?`bg-terminal-blue animate-pulse`:e.installed?`bg-terminal-green`:`bg-terminal-dim opacity-40`}`}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`span`,{className:`text-xs font-sans font-medium ${e.loading?`text-terminal-dim`:e.installed?`text-terminal-text`:`text-terminal-dimmer`}`,children:e.label}),(0,V.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-dimmer truncate`,children:e.purpose}),e.loading?(0,V.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-blue truncate animate-pulse`,children:`checking...`}):e.installed?(0,V.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-green truncate`,children:e.detail||e.version||`ready`}):(0,V.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-orange truncate`,children:e.detail||`not found`})]})]},e.name))})]})}function Ft({onNavigate:e}){let{sources:t,setSources:n,replays:r,loading:i,loadingSources:a,loadingReplays:o,error:s}=Dt(),c=(0,_.useMemo)(()=>Ot(t,r),[t,r]),{scanStatus:l,userInsights:u}=He(),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(null),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(`idle`),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)(0),E=(0,_.useRef)(null),O=(0,_.useRef)(null),k=h?t.find(e=>e.slug===h)??null:null,M=!u&&(a||!!l?.running||t.length>0),N=(0,_.useMemo)(()=>u?be(u.topProjects):[],[u]),ee=Math.max(c.projectCount,u?.totalProjects??0),P=u?.totalPrompts??c.totalPrompts,F=u?.totalToolCalls??c.totalToolCalls,I=c.providerBreakdown.length>0?c.providerBreakdown:Object.entries(u?.providers||{}).map(([e,t])=>({provider:e,count:t,label:ue(e)})).sort((e,t)=>t.count-e.count),ne=Object.keys(c.sessionsPerDay).length>0?c.sessionsPerDay:u?.sessionsPerDay??{},re=e=>{L({view:null,session:e})},R=async e=>{f(e.slug),m(null);try{let t=te(e),n=await fetch(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,filePaths:e.filePaths,toolPaths:e.toolPaths,title:j(t)||void 0,sessionSlug:e.slug,sessionProject:e.project})}),r=await n.json();if(!n.ok)throw Error(r.error||`Generation failed`);L({view:null,session:r.slug})}catch(t){console.error(`Generate error:`,t),m(e.slug),setTimeout(()=>m(t=>t===e.slug?null:t),2e3)}finally{f(null)}},z=async(e,t)=>{g(null),f(e.slug),m(null);try{let n=await fetch(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,filePaths:e.filePaths,toolPaths:e.toolPaths,title:j(t)||void 0,sessionSlug:e.slug,sessionProject:e.project})}),r=await n.json();if(!n.ok)throw Error(r.error||`Generation failed`);L({view:null,session:r.slug})}catch(t){console.error(`Generate error:`,t),m(e.slug),setTimeout(()=>m(t=>t===e.slug?null:t),2e3)}finally{f(null)}},ie=async(e,t)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:t})})).ok)throw Error(`Failed to update title`);n(n=>n.map(n=>n.slug===e&&n.replay?{...n,replay:{...n.replay,title:t||void 0}}:n))},ae=async e=>{try{if(!(await fetch(`/api/sessions/${encodeURIComponent(e)}`,{method:`DELETE`})).ok)return;n(t=>t.map(t=>t.slug===e?{...t,replay:void 0,existingReplay:null}:t))}catch{}},oe=async()=>{y(`syncing`),x(null);try{let e=await fetch(`/api/insights/sync`,{method:`POST`}),t=await e.json();if(e.status===401){y(`needsLogin`),x(null);return}!e.ok||t.error?(y(`error`),x(t.error||`Sync failed`),setTimeout(()=>{y(e=>e===`error`?`idle`:e),x(null)},4e3)):(y(`done`),x(t.message||`Synced ${t.synced??0} insights`),C(Date.now()))}catch{y(`error`),x(`Network error`),setTimeout(()=>{y(e=>e===`error`?`idle`:e),x(null)},4e3)}},ce=()=>{oe()},le=async()=>{y(`awaitingLogin`),x(`Waiting for sign in...`);try{let e=await fetch(`/api/auth/login`,{method:`POST`}),t=await e.json().catch(()=>null);e.ok&&t?.url&&window.open(t.url,`_blank`)}catch{}E.current&&clearInterval(E.current),O.current&&clearTimeout(O.current),E.current=setInterval(async()=>{try{(await(await fetch(`/api/auth/get-session`)).json())?.session&&(E.current&&=(clearInterval(E.current),null),O.current&&=(clearTimeout(O.current),null),window.dispatchEvent(new Event(`vibe-auth-change`)),oe())}catch{}},2e3),O.current=setTimeout(()=>{E.current&&=(clearInterval(E.current),null),y(`idle`),x(null)},180*1e3)};(0,_.useEffect)(()=>()=>{E.current&&clearInterval(E.current),O.current&&clearTimeout(O.current)},[]),(0,_.useEffect)(()=>{if(!S)return;let e=setInterval(()=>T(e=>e+1),3e4);return()=>clearInterval(e)},[S]);let de=(()=>{if(!S)return null;let e=Date.now()-S;if(e<6e4)return`just now`;let t=Math.floor(e/6e4);return t<60?`${t}m ago`:`${Math.floor(t/60)}h ago`})();return i&&!t.length&&!r.length?(0,V.jsx)(`div`,{className:`flex-1 overflow-auto animate-in fade-in duration-500`,children:(0,V.jsxs)(`div`,{className:`max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-6`,children:[(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm space-y-4`,children:[(0,V.jsx)(`div`,{className:`grid grid-cols-4 gap-6`,children:Array.from({length:4},(e,t)=>(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`div`,{className:`h-8 w-20 skeleton rounded`}),(0,V.jsx)(`div`,{className:`h-3 w-14 skeleton rounded`})]},t))}),(0,V.jsx)(`div`,{className:`space-y-1.5 pt-2`,children:Array.from({length:3},(e,t)=>(0,V.jsx)(`div`,{className:`h-3 skeleton rounded`},t))}),(0,V.jsx)(`div`,{className:`h-9 skeleton rounded`})]}),(0,V.jsx)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-3`,children:Array.from({length:2},(e,t)=>(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm space-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`div`,{className:`h-3 w-28 skeleton rounded`}),(0,V.jsx)(`div`,{className:`h-3 w-14 skeleton rounded`})]}),Array.from({length:5},(e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-3 px-1 py-1`,children:[(0,V.jsx)(`div`,{className:`h-5 w-14 skeleton rounded-full shrink-0`}),(0,V.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,V.jsx)(`div`,{className:`h-3.5 skeleton rounded`,style:{width:`${55+t*19%35}%`}}),(0,V.jsx)(`div`,{className:`h-2.5 w-20 skeleton rounded`})]}),(0,V.jsx)(`div`,{className:`h-3 w-12 skeleton rounded shrink-0`})]},t)),(0,V.jsx)(`div`,{className:`h-8 skeleton rounded`})]},t))})]})}):s&&t.length===0&&r.length===0?(0,V.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,V.jsx)(`div`,{className:`text-center space-y-2`,children:(0,V.jsx)(`div`,{className:`text-terminal-red font-mono text-sm`,children:s})})}):(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,V.jsxs)(`div`,{className:`max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-6`,children:[(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between mb-4`,children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-4 gap-x-6 gap-y-1 flex-1 min-w-0`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,V.jsx)(Oe,{value:c.totalSessions})}),(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5`,children:`sessions`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl font-mono font-bold text-terminal-blue tabular-nums`,children:(0,V.jsx)(Oe,{value:c.totalReplays})}),(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5`,children:`replays`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,V.jsx)(Oe,{value:P})}),(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5`,children:`turns`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl font-mono font-bold text-terminal-orange tabular-nums`,children:(0,V.jsx)(Oe,{value:F})}),(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5`,children:`tool calls`})]})]}),(0,V.jsx)(`div`,{className:`flex flex-col items-end gap-1 shrink-0`,children:I.map(e=>{let t={orange:{bg:`bg-terminal-orange/8`,dot:`bg-terminal-orange`,label:`text-terminal-orange/80`,value:`text-terminal-orange`},blue:{bg:`bg-terminal-blue/8`,dot:`bg-terminal-blue`,label:`text-terminal-blue/80`,value:`text-terminal-blue`},dim:{bg:`bg-terminal-dim/8`,dot:`bg-terminal-dim`,label:`text-terminal-dim`,value:`text-terminal-dim`}}[se(e.provider)];return(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-0.5 rounded-md ${t.bg}`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ${t.dot}`}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono tabular-nums ${t.label}`,children:e.label}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono font-bold tabular-nums ${t.value}`,children:e.count})]},e.provider)})})]}),(0,V.jsx)(ut,{sessionsPerDay:ne,weeks:52}),(0,V.jsxs)(`div`,{className:`flex gap-2 mt-3`,children:[(0,V.jsx)(`button`,{onClick:()=>e(`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 →`}),(0,V.jsx)(`button`,{onClick:ce,disabled:v===`syncing`||v===`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 ${v===`done`?`bg-terminal-green/8 text-terminal-green border-terminal-green/20`:v===`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:b||void 0,children:v===`syncing`?`Syncing...`:v===`done`&&de?`\u2713 Synced ${de}`:v===`error`?`Sync failed`:v===`awaitingLogin`?`Waiting...`:`↑ Sync to cloud`}),(0,V.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:(0,V.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,strokeWidth:2,children:(0,V.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`})})})]})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-3 items-stretch`,children:[(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:`Recent Sessions`}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:[c.totalSessions,` total`]})]}),(0,V.jsx)(`div`,{className:`flex-1 flex flex-col justify-between`,children:(0,V.jsx)(jt,{sessions:c.recentSources,isLoading:a,onViewAll:()=>e(`sessions`),onGenerate:R,onViewReplay:re,onSessionClick:e=>g(e.slug),generatingSlug:d,generateErrorSlug:p})})]}),(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:`Recent Replays`}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:[c.totalReplays,` total`]})]}),(0,V.jsx)(`div`,{className:`flex-1 flex flex-col justify-between`,children:(0,V.jsx)(Mt,{replays:c.recentReplays,isLoading:o,onViewAll:()=>e(`replays`),onOpen:re})})]})]}),M?(0,V.jsx)(kt,{}):u&&N.length>1?(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:`Recent Projects`}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:[ee,` total`]})]}),(0,V.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2`,children:[...N].sort((e,t)=>(t.lastActivity||``).localeCompare(e.lastActivity||``)).slice(0,5).map(t=>(0,V.jsxs)(`button`,{onClick:()=>{e(`sessions`),setTimeout(()=>{L({tab:`sessions`,project:t.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:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-text truncate block group-hover:text-terminal-green transition-colors`,children:A(t.project)}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[t.sessions,` session`,t.sessions>1?`s`:``,` · `,t.prompts,` prompts`,t.durationMs>0&&` · ${D(t.durationMs)}`]})]}),t.cost>0&&(0,V.jsxs)(`span`,{className:`text-xs font-mono text-terminal-orange tabular-nums shrink-0`,children:[`$`,t.cost.toFixed(2)]})]},t.project))}),N.length>5&&(0,V.jsx)(`button`,{onClick:()=>e(`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,(0,V.jsx)(Pt,{})]}),k&&(0,V.jsx)(Wn,{session:k,onClose:()=>g(null),onGenerate:z,onViewReplay:e=>L({view:null,session:e}),onArchive:e=>{fetch(`/api/archive/${e}`,{method:`POST`}).catch(()=>{}),g(null)},onTitleSave:ie,onDeleteReplay:ae,isGenerating:d===k.slug,isArchived:!1}),(v===`needsLogin`||v===`awaitingLogin`)&&(0,V.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:e=>{e.target===e.currentTarget&&v===`needsLogin`&&y(`idle`)},children:(0,V.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:[v===`needsLogin`&&(0,V.jsx)(`button`,{onClick:()=>y(`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:`×`}),v===`needsLogin`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h3`,{className:`text-base font-bold text-terminal-text mb-1`,children:`Sync Insights to the Cloud`}),(0,V.jsx)(`p`,{className:`text-xs text-terminal-dim mb-5`,children:`Sign in with GitHub to unlock your online dashboard.`}),(0,V.jsxs)(`div`,{className:`space-y-3 mb-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.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`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-sm font-semibold text-terminal-text`,children:`Cross-machine dashboard`}),(0,V.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.`})]})]}),(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.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`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-sm font-semibold text-terminal-text`,children:`Cost tracking & trends`}),(0,V.jsx)(`p`,{className:`text-[11px] text-terminal-dim mt-0.5`,children:`Track spending by model, spot weekly patterns, and monitor project breakdowns.`})]})]}),(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.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`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-sm font-semibold text-terminal-text`,children:`Share your coding card`}),(0,V.jsx)(`p`,{className:`text-[11px] text-terminal-dim mt-0.5`,children:`Activity heatmaps, streak badges, and project stats — shareable at a glance.`})]})]})]}),(0,V.jsxs)(`button`,{onClick:le,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:[(0,V.jsx)(`svg`,{className:`w-5 h-5`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,V.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`]}),(0,V.jsx)(`p`,{className:`text-[10px] text-terminal-dim text-center mt-3`,children:`We'll auto-sync your insights right after sign in.`})]}):(0,V.jsxs)(`div`,{className:`text-center py-4`,children:[(0,V.jsx)(`div`,{className:`text-2xl mb-3 animate-pulse`,children:`↑`}),(0,V.jsx)(`h3`,{className:`text-base font-bold text-terminal-text mb-1`,children:`Waiting for sign in...`}),(0,V.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.`})]})]})})]})}var It=null,Lt=null,Rt=0,zt=4e3;function Bt(){let[e,t]=(0,_.useState)(It??[]),[n,r]=(0,_.useState)(It===null&&Lt===null),[i,a]=(0,_.useState)(It===null?Lt:null);return(0,_.useEffect)(()=>{let e=!1,n=null;async function i(){let n=await fetch(`/api/scan/results`);if(!n.ok)throw Error(`HTTP ${n.status}`);It=(await n.json()).results??[],Rt=It.length,Lt=null,e||(t(It),a(null))}async function o(){try{let e=await fetch(`/api/scan/status`);return e.ok?await e.json():null}catch{return null}}async function s(){let t=!1;try{let e=await o();t=e?.running===!0;let n=e?.resultCount??0;(It===null||n!==Rt)&&await i()}catch(t){let n=t instanceof Error?t.message:`Failed to load`;Lt=n,!e&&It===null&&a(n)}finally{e||r(!1),!e&&t&&(n=setTimeout(s,zt))}}return s(),()=>{e=!0,n&&clearTimeout(n)}},[]),{sessions:e,loading:n,error:i}}function Vt(e){let t=Math.log2(e.promptCount+1),n=Math.log2(e.toolCallCount+1)*.4,r=Math.min(8,Math.log2(e.editCount+1)),i=Math.min(4,Math.log2((e.filesModified?.length??0)+1)),a=e.subAgentCount>0?3:0,o=(e.prLinks?.length??0)>0?8:0,s=e.durationMs&&e.durationMs>1800*1e3?4:0,c=Ht(e)?-10:0,l=t+n+r+i+a+o+s+c;return Math.max(0,Math.min(100,l*4))}function Ht(e){let t=e.firstPrompt??``;return!!(/^This is an automated run of a scheduled task/i.test(t)||e.entrypoint===`claude-desktop`&&/scheduled|automated/i.test(t.slice(0,200)))}function Ut(e){return e?new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`}):``}function Wt(e){return e?new Date(e).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!1}):``}function Gt(e){if(!e||e<0)return``;if(e<6e4)return`${Math.round(e/1e3)}s`;if(e<36e5)return`${Math.round(e/6e4)}m`;let t=Math.floor(e/36e5),n=Math.round(e%36e5/6e4);return n>0?`${t}h ${n}m`:`${t}h`}function Kt(e){return j(F(e.title||``))||j(F(e.firstPrompt||``))||e.slug}function qt(e){return e.durationMs==null?!0:(e.dataQualityNotes||[]).some(e=>/duration is inferred|duration.*estimated|missing duration/i.test(e))}function Jt(e){let t=[ce(e.provider)],n=e.dataSource?ge(!1,e.dataSource):``;return n&&t.push(n),qt(e)&&t.push(`estimated time`),t}function Yt(e){window.dispatchEvent(new CustomEvent(`vibe-open-session`,{detail:{slug:e}}))}function Xt(e){switch(e){case`1d`:return`the last 24 hours`;case`7d`:return`the last 7 days`;case`30d`:return`the last 30 days`;case`all`:return`this scan`}}var Zt=[{bg:`bg-terminal-green/20`,border:`border-terminal-green`,text:`text-terminal-green`,solid:`#22c55e`},{bg:`bg-terminal-blue/20`,border:`border-terminal-blue`,text:`text-terminal-blue`,solid:`#3b82f6`},{bg:`bg-terminal-purple/20`,border:`border-terminal-purple`,text:`text-terminal-purple`,solid:`#a855f7`},{bg:`bg-terminal-orange/20`,border:`border-terminal-orange`,text:`text-terminal-orange`,solid:`#f97316`},{bg:`bg-terminal-cyan/20`,border:`border-terminal-cyan`,text:`text-terminal-cyan`,solid:`#56d4dd`}];function Qt(e){return Zt[e%Zt.length]}function $t(e,t={}){let n=new Map;for(let r of e){let e=t.collapseWorktrees?ye(r.project):r.project;n.has(e)||n.set(e,[]),n.get(e).push(r)}let r=[],i=0;for(let[e,t]of n){let n=[...t].sort((e,t)=>{let n=e.startTime?new Date(e.startTime).getTime():0;return(t.startTime?new Date(t.startTime).getTime():0)-n}),a=0,o=0,s=0;for(let e of n)if(a+=e.durationMs??0,o+=e.costEstimate??0,e.startTime){let t=vn(new Date(e.startTime).getTime(),e);t>s&&(s=t)}r.push({project:e,sessions:n,totalDurationMs:a,totalCost:o,lastActivity:s>0?new Date(s).toISOString():n[0]?.startTime,colorIdx:i++})}return r.sort((e,t)=>(t.lastActivity??``).localeCompare(e.lastActivity??``))}var en=4,tn=5,nn=10,rn=72,an=40,on=14,sn=12,cn=6,ln=8,un=140,dn=1100;function fn(e){return e>=60?.24:.16}function pn(e,t){let n=e.replace(`#`,``);return`rgba(${parseInt(n.slice(0,2),16)}, ${parseInt(n.slice(2,4),16)}, ${parseInt(n.slice(4,6),16)}, ${t})`}function mn(e){return e>=60?.95:.78}function hn(e){return ln+Math.sqrt(Math.max(0,Math.min(100,e))/100)*(un-ln)}function gn(e){return nn+Math.max(0,Math.min(100,e))/100*(rn-nn)}function _n(e,t=!1){let n=[...e].sort((e,t)=>e.startMs-t.startMs||t.score-e.score),r=[],i=new Map,a=0,o=t?1/0:tn;for(let e of n){let t=-1;for(let n=0;n<r.length;n++)if(e.startMs>=r[n]){t=n;break}if(t===-1){if(r.length>=o){a++;continue}t=r.length,r.push(e.endMs)}else r[t]=e.endMs;i.set(e.original.sessionId,t)}return{laneAssignments:i,laneCount:r.length,dropped:a}}function vn(e,t){if(t.durationMs!=null)return e+t.durationMs;if(t.endTime){let n=new Date(t.endTime).getTime()-e;return e+Math.min(n,720*60*1e3)}return e+6e4}function yn(e,t,n,r=!1,i=new Set){let a=[],o=1/0,s=-1/0;for(let t of e)for(let e of t.sessions){if(!e.startTime)continue;let n=new Date(e.startTime).getTime(),r=vn(n,e);a.push({session:e,startMs:n,endMs:r,group:t}),n<o&&(o=n),r>s&&(s=r)}if(!Number.isFinite(o)||!Number.isFinite(s)||s<=o)return{projects:[],ticks:[],minMs:0,maxMs:0,totalSessions:0,hiddenAutomatedCount:0};let c,l;if(t!=null&&n!=null)c=t,l=n;else{let e=(s-o)*.01;c=o-e,l=s+e}let u=l-c,d=u/dn,f=new Map,p=0;for(let e of a){if(e.endMs<c||e.startMs>l)continue;if(!r&&Ht(e.session)){p++;continue}let t=f.get(e.group);t?t.push(e):f.set(e.group,[e])}let m=[],h=0;for(let t of e){let e=f.get(t);if(!e||e.length===0)continue;let n=e.map(({session:e,startMs:t,endMs:n})=>{let r=Vt(e),i=hn(r)*d,a=Math.max(n,t+i),o=a>l;return{startMs:o?Math.min(t,l-i):t,endMs:o?l:a,realStartMs:t,realEndMs:n,score:r,original:e,rightAnchored:o}}),{laneAssignments:r,laneCount:a,dropped:o}=_n(n,i.has(t.project)),s=[];for(let e of n){let t=r.get(e.original.sessionId);if(t==null)continue;let n=(e.realStartMs-c)/u*100,i=(e.realEndMs-c)/u*100,a=Math.max(0,n),o=Math.max(0,i-a),l=hn(e.score),d=o/100*dn,f=Math.max(d,l),p=f>0?Math.min(1,d/f):1;s.push({session:e.original,leftPct:a,widthPct:o,lane:t,score:e.score,minWidthPx:l,heightPx:gn(e.score),fillAlpha:fn(e.score),opacity:mn(e.score),realDurationFraction:p,rightAnchored:e.rightAnchored})}if(s.length>0){s.sort((e,t)=>e.leftPct-t.leftPct||t.score-e.score);let e=Array.from({length:a},()=>nn);for(let t of s)t.heightPx>e[t.lane]&&(e[t.lane]=t.heightPx);let n=[],r=4;for(let t of e)n.push(r),r+=t+en;let i=r+4,c=Math.max(i,an),l=c-i;if(l>0)for(let e=0;e<n.length;e++)n[e]+=l;m.push({project:t.project,sessions:s,laneCount:a,laneHeightsPx:e,laneTopsPx:n,totalRowHeightPx:c,hiddenInLanesCount:o,colorIdx:t.colorIdx,lastActivity:t.lastActivity}),h+=s.length}}m.sort((e,t)=>(t.lastActivity??``).localeCompare(e.lastActivity??``));let g=[];for(let e=0;e<=7;e++){let t=c+u*e/7,n=new Date(t),r=e/7*100,i=u/864e5,a;a=i>60?n.toLocaleDateString(`en-US`,{month:`short`,year:`2-digit`}):i>2?n.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`}):n.toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!1}),g.push({leftPct:r,label:a})}return{projects:m,ticks:g,minMs:o,maxMs:s,totalSessions:h,hiddenAutomatedCount:p}}var bn=[{value:`1d`,label:`1D`,days:1},{value:`7d`,label:`7D`,days:7},{value:`30d`,label:`30D`,days:30},{value:`all`,label:`All`}];function xn(e){let t=bn.find(t=>t.value===e);if(!t||t.days==null)return{};let n=Date.now();return{start:n-t.days*864e5,end:n}}function Sn({groups:e}){let[t,n]=(0,_.useState)(`7d`),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(new Set),l=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},{start:u,end:d}=(0,_.useMemo)(()=>xn(t),[t]),{projects:f,ticks:p,totalSessions:m,hiddenAutomatedCount:h}=(0,_.useMemo)(()=>yn(e,u,d,r,s),[e,u,d,r,s]),g=(0,_.useMemo)(()=>{let e=0;for(let t of f)for(let n of t.sessions)qt(n.session)&&e++;return e},[f]);return(0,V.jsxs)(`div`,{className:`space-y-4 p-4 select-none`,children:[(0,V.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`,children:[(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text`,children:`Work Timeline`}),(0,V.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dimmer`,children:[m,` `,H(m,`session`),` · rows are projects · bar position and width show active time`,g>0?` · ${g} estimated`:``]})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 text-[10px] font-mono`,children:[h>0&&!r&&(0,V.jsxs)(`button`,{onClick:()=>i(!0),className:`text-terminal-dimmer hover:text-terminal-text transition-colors`,title:`Scheduled / automated sessions are hidden by default`,children:[`+ `,h,` automated hidden ▸`]}),r&&(0,V.jsx)(`button`,{onClick:()=>i(!1),className:`text-terminal-purple hover:underline`,children:`hide automated`}),(0,V.jsx)(`div`,{className:`inline-flex items-center rounded-xl bg-terminal-surface p-0.5 shadow-layer-sm`,children:bn.map(e=>(0,V.jsx)(`button`,{onClick:()=>n(e.value),className:`rounded-lg px-2.5 py-1 text-xs font-sans font-semibold transition-all duration-200 ease-material ${t===e.value?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text`}`,children:e.label},e.value))})]})]}),f.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-40 gap-2 text-terminal-dimmer text-sm font-mono`,children:[(0,V.jsxs)(`div`,{children:[`No sessions in `,Xt(t),`.`]}),t!==`all`&&(0,V.jsx)(`button`,{onClick:()=>n(`all`),className:`text-terminal-green hover:underline text-xs`,children:`Show all sessions →`})]}):(0,V.jsx)(`div`,{className:`overflow-x-auto rounded-2xl bg-terminal-bg/35 p-3 shadow-inner`,children:(0,V.jsxs)(`div`,{className:`min-w-[760px]`,children:[(0,V.jsx)(`div`,{className:`flex`,style:{paddingLeft:140},children:(0,V.jsxs)(`div`,{className:`relative flex-1 h-6`,children:[p.map((e,t)=>(0,V.jsxs)(`div`,{className:`absolute flex flex-col items-center`,style:{left:`${e.leftPct}%`,transform:`translateX(-50%)`},children:[(0,V.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer whitespace-nowrap`,children:e.label}),(0,V.jsx)(`div`,{className:`w-px h-1.5 bg-terminal-border/20 mt-0.5`})]},t)),(0,V.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-terminal-border/25 to-transparent`})]})}),(0,V.jsx)(`div`,{className:`space-y-1.5`,children:f.map(e=>{let t=Qt(e.colorIdx),n=e.totalRowHeightPx,r=t.solid;return(0,V.jsxs)(`div`,{className:`flex items-stretch rounded-xl group`,children:[(0,V.jsxs)(`div`,{className:`flex flex-col justify-center shrink-0 py-1 pr-3 overflow-hidden`,style:{width:140,height:n},children:[(0,V.jsx)(`div`,{className:`text-xs font-sans font-medium truncate ${t.text}`,children:A(e.project)}),(0,V.jsxs)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer truncate`,children:[e.sessions.length,` `,H(e.sessions.length,`session`),e.hiddenInLanesCount>0&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>l(e.project),className:`ml-1 text-terminal-orange hover:underline cursor-pointer`,title:`Show the ${e.hiddenInLanesCount} session(s) hidden by the lane cap`,children:[`· +`,e.hiddenInLanesCount,` hidden ▸`]}),s.has(e.project)&&(0,V.jsx)(`button`,{type:`button`,onClick:()=>l(e.project),className:`ml-1 text-terminal-purple hover:underline cursor-pointer`,title:`Restore the lane cap`,children:`· collapse`})]})]}),(0,V.jsxs)(`div`,{className:`relative flex-1 overflow-hidden rounded-xl bg-terminal-surface/45 shadow-layer-sm transition-colors group-hover:bg-terminal-surface-hover/70`,style:{height:n},children:[p.map((e,t)=>(0,V.jsx)(`div`,{className:`absolute top-0 bottom-0 w-px bg-terminal-border/[0.06]`,style:{left:`${e.leftPct}%`}},t)),e.sessions.map(n=>{let i=Ht(n.session),a=e.laneTopsPx[n.lane]+(e.laneHeightsPx[n.lane]-n.heightPx),s=i?.4:n.opacity,c=Math.max(1,Math.floor((n.heightPx-cn)/sn)),l=!n.rightAnchored&&n.realDurationFraction<.85;return(0,V.jsxs)(`button`,{type:`button`,className:`absolute overflow-hidden rounded-md text-left shadow-layer-sm transition-all duration-200 ease-material hover:z-10 hover:shadow-layer-md`,style:{...n.rightAnchored?{right:0,width:`${n.minWidthPx}px`}:{left:`${n.leftPct}%`,width:`max(${n.widthPct}%, ${n.minWidthPx}px)`},top:a,height:n.heightPx,opacity:s,zIndex:i?1:2,backgroundColor:pn(r,n.fillAlpha)},"aria-label":`Open ${Kt(n.session)}`,onClick:()=>Yt(n.session.slug),onMouseEnter:e=>{o({session:n.session,x:e.clientX,y:e.clientY})},onMouseLeave:()=>o(null),children:[n.heightPx>=on&&(0,V.jsx)(`span`,{className:`pointer-events-none block min-w-0 px-1.5 text-[10px] font-mono leading-tight ${t.text} ${c===1?`truncate leading-[18px]`:`overflow-hidden pt-1`}`,style:c===1?void 0:{display:`-webkit-box`,WebkitBoxOrient:`vertical`,WebkitLineClamp:c},children:Kt(n.session)}),l&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`pointer-events-none absolute bottom-0 left-0 h-[2px] rounded-r-full bg-white/85`,style:{width:`${n.realDurationFraction*100}%`},title:`actual duration`}),(0,V.jsx)(`span`,{className:`pointer-events-none absolute bottom-0 h-[6px] w-[2px] bg-white/90`,style:{left:`calc(${n.realDurationFraction*100}% - 2px)`}})]})]},n.session.sessionId)})]})]},e.project)})})]})}),a&&(0,V.jsxs)(`div`,{className:`fixed pointer-events-none w-80 rounded-xl border border-terminal-border bg-terminal-surface p-3 text-xs font-mono shadow-layer-xl`,style:{zIndex:1e3,left:Math.min(a.x+12,window.innerWidth-336),top:Math.max(8,Math.min(a.y-8,window.innerHeight-200))},children:[(0,V.jsx)(`div`,{className:`text-terminal-text font-medium mb-1.5 break-words leading-snug`,children:Kt(a.session)}),(0,V.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-1`,children:Jt(a.session).map(e=>(0,V.jsx)(`span`,{className:`rounded-md bg-terminal-surface-2 px-1.5 py-0.5 text-[10px] text-terminal-dim`,children:e},e))}),(0,V.jsxs)(`div`,{className:`text-terminal-dimmer space-y-0.5`,children:[a.session.startTime&&(()=>{let e=new Date(a.session.startTime).getTime(),t=vn(e,a.session),n=a.session.startTime,r=new Date(t).toISOString(),i=Ut(n)===Ut(r);return(0,V.jsxs)(`div`,{children:[Ut(n),` `,Wt(n),t!==e&&(0,V.jsxs)(`span`,{children:[` → `,i?``:`${Ut(r)} `,Wt(r)]})]})})(),a.session.durationMs&&(0,V.jsx)(`div`,{className:`text-terminal-blue`,children:Gt(a.session.durationMs)}),(0,V.jsxs)(`div`,{children:[a.session.promptCount,`p · `,a.session.editCount,` `,H(a.session.editCount,`edit`),` · `,a.session.toolCallCount,` `,H(a.session.toolCallCount,`tool`)]}),a.session.gitBranch&&(0,V.jsx)(`div`,{className:`text-terminal-purple`,children:a.session.gitBranch}),(a.session.costEstimate??0)>0&&(0,V.jsxs)(`div`,{className:`text-terminal-orange`,children:[`$`,a.session.costEstimate.toFixed(3)]})]})]})]})}function Cn(e,t){let n=t.replace(/\/$/,``);return n&&e.startsWith(`${n}/`)?e.slice(n.length+1):e.split(`/`).slice(-3).join(`/`)}function wn(e){let t=[];for(let n of e){let e=new Map;for(let t of n.sessions)for(let r of t.filesModified){let i=r.file;e.has(i)||e.set(i,[]),e.get(i).push({session:t,editCount:r.count,colorIdx:n.colorIdx})}let r=[];for(let[t,i]of e){let e=[...new Map(i.map(e=>[e.session.sessionId,e])).values()],a=e.reduce((e,t)=>e+t.editCount,0);e.length<2&&a<3||r.push({file:t,displayName:Cn(t,n.project),sessions:e.sort((e,t)=>t.editCount-e.editCount),totalEdits:a})}r.length!==0&&(r.sort((e,t)=>t.totalEdits-e.totalEdits||t.sessions.length-e.sessions.length),t.push({project:n.project,colorIdx:n.colorIdx,files:r,totalEdits:r.reduce((e,t)=>e+t.totalEdits,0),totalSessions:r.reduce((e,t)=>e+t.sessions.length,0)}))}return t.sort((e,t)=>t.totalEdits-e.totalEdits||t.totalSessions-e.totalSessions)}function Tn({groups:e,hideProjectList:t}){let n=(0,_.useMemo)(()=>wn(e),[e]),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(null);if((0,_.useEffect)(()=>{if(n.length===0){i(null),o(null);return}(!r||!n.some(e=>e.project===r))&&(i(n[0].project),o(null))},[n,r]),n.length===0)return(0,V.jsxs)(`div`,{className:`p-8 text-center space-y-2`,children:[(0,V.jsx)(`div`,{className:`text-terminal-dimmer text-sm font-mono`,children:`No hot files found.`}),(0,V.jsx)(`div`,{className:`text-terminal-dimmer/60 text-xs font-mono`,children:`Cursor sessions without file edits are still shown in List and Timeline.`})]});let s=n.find(e=>e.project===r)??n[0],c=a?s.files.find(e=>e.file===a):null;return(0,V.jsxs)(`div`,{className:`flex h-full min-w-0 flex-col gap-4 p-4 lg:flex-row`,children:[!t&&(0,V.jsxs)(`div`,{className:`w-full shrink-0 space-y-2 overflow-y-auto lg:w-64`,children:[(0,V.jsxs)(`div`,{className:`px-1`,children:[(0,V.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text`,children:`Hot Files`}),(0,V.jsxs)(`div`,{className:`mt-0.5 text-[10px] font-mono text-terminal-dimmer`,children:[n.length,` `,H(n.length,`project`),` with hot files`]})]}),n.map(e=>(0,V.jsxs)(`button`,{onClick:()=>{i(e.project),o(null)},className:`w-full rounded-lg border px-3 py-2.5 text-left transition-all duration-200 ease-material ${s.project===e.project?`border-transparent bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`border-transparent bg-terminal-bg/35 text-terminal-text shadow-layer-sm hover:bg-terminal-surface-hover hover:shadow-layer-md`}`,children:[(0,V.jsx)(`div`,{className:`truncate text-xs font-sans font-semibold`,children:A(e.project)}),(0,V.jsx)(`div`,{className:`mt-0.5 truncate text-[10px] font-mono text-terminal-dimmer`,children:e.project}),(0,V.jsxs)(`div`,{className:`mt-1 text-[10px] font-mono text-terminal-dimmer`,children:[e.files.length,` `,H(e.files.length,`file`),` ·`,` `,e.totalEdits.toLocaleString(),` `,H(e.totalEdits,`edit`)]})]},e.project))]}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-4`,children:[(0,V.jsxs)(`div`,{className:`relative overflow-hidden rounded-2xl bg-terminal-bg/35 p-4 shadow-inner`,children:[(0,V.jsx)(`div`,{className:`pointer-events-none absolute -right-12 -top-12 h-28 w-28 rounded-full bg-terminal-green/5 blur-2xl`}),(0,V.jsxs)(`div`,{className:`relative`,children:[(0,V.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text`,children:A(s.project)}),(0,V.jsx)(`div`,{className:`mt-0.5 truncate text-xs font-mono text-terminal-dimmer`,children:s.project}),(0,V.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-[10px] font-mono text-terminal-dimmer`,children:[(0,V.jsxs)(`span`,{className:`rounded-md bg-terminal-green-subtle px-1.5 py-0.5 text-terminal-green`,children:[s.files.length,` `,H(s.files.length,`hot file`)]}),(0,V.jsxs)(`span`,{children:[s.totalEdits.toLocaleString(),` `,H(s.totalEdits,`edit`)]}),(0,V.jsxs)(`span`,{children:[s.totalSessions.toLocaleString(),` `,H(s.totalSessions,`session`)]})]})]})]}),(0,V.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[minmax(0,1fr)_22rem]`,children:[(0,V.jsx)(`div`,{className:`min-w-0 grid grid-cols-1 gap-2 xl:grid-cols-2 self-start`,children:s.files.map(e=>{let t=a===e.file;return(0,V.jsxs)(`button`,{onClick:()=>o(t?null:e.file),className:`w-full rounded-xl px-3 py-2.5 text-left transition-all duration-200 ease-material ${t?`bg-terminal-green-subtle text-terminal-green shadow-layer-md`:`bg-terminal-bg/40 text-terminal-text shadow-layer-sm hover:bg-terminal-surface-hover hover:shadow-layer-md`}`,children:[(0,V.jsx)(`div`,{className:`truncate text-xs font-mono`,children:e.displayName.split(`/`).pop()}),(0,V.jsx)(`div`,{className:`mt-0.5 truncate text-[10px] font-mono text-terminal-dimmer`,children:e.displayName}),(0,V.jsxs)(`div`,{className:`mt-1 text-[10px] font-mono text-terminal-dimmer`,children:[e.totalEdits.toLocaleString(),` `,H(e.totalEdits,`edit`),` ·`,` `,e.sessions.length,` `,H(e.sessions.length,`session`)]})]},e.file)})}),(0,V.jsx)(`div`,{className:`lg:sticky lg:top-3 lg:self-start lg:max-h-[calc(100vh-7rem)] lg:overflow-y-auto`,children:c?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`rounded-2xl bg-terminal-surface p-4 shadow-layer-sm`,children:[(0,V.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text truncate`,children:c.displayName.split(`/`).pop()}),(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-dimmer mt-0.5 break-all`,children:c.file}),(0,V.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dimmer mt-1`,children:[c.totalEdits.toLocaleString(),` `,H(c.totalEdits,`edit`),` `,`across `,c.sessions.length,` `,H(c.sessions.length,`session`)]})]}),(0,V.jsx)(`div`,{className:`space-y-2`,children:c.sessions.map(e=>(0,V.jsxs)(`button`,{type:`button`,onClick:()=>Yt(e.session.slug),className:`flex w-full flex-col gap-2 rounded-xl bg-terminal-bg/45 p-3 text-left shadow-layer-sm transition-all duration-200 ease-material hover:bg-terminal-surface-hover hover:shadow-layer-md sm:flex-row sm:items-start sm:gap-3`,children:[(0,V.jsx)(`div`,{className:`hidden w-2 h-2 rounded-full mt-1.5 shrink-0 sm:block`,style:{backgroundColor:Qt(e.colorIdx).solid}}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-xs font-sans font-medium text-terminal-text truncate`,children:Kt(e.session)}),(0,V.jsxs)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-0.5`,children:[A(e.session.project),` · `,Ut(e.session.startTime)]})]}),(0,V.jsxs)(`div`,{className:`shrink-0 text-xs font-mono text-terminal-orange`,children:[e.editCount,` `,H(e.editCount,`edit`)]})]},e.session.sessionId))})]}):(0,V.jsx)(`div`,{className:`flex h-40 items-center justify-center rounded-2xl bg-terminal-bg/35 text-terminal-dimmer text-xs font-mono p-4 text-center`,children:`Select a file to see the sessions that modified it`})})]})]})]})}function En({view:e,projectFilter:t}){let{sessions:n,loading:r,error:i}=Bt(),a=(0,_.useMemo)(()=>t?n.filter(e=>ye(e.project)===t):n,[n,t]),o=(0,_.useMemo)(()=>$t(a,{collapseWorktrees:!0}),[a]),s=(0,_.useMemo)(()=>{let e=new Map;for(let t of a){let n=ce(t.provider);e.set(n,(e.get(n)||0)+1)}return[...e.entries()].sort((e,t)=>t[1]-e[1]).slice(0,3).map(([e,t])=>`${e} ${t}`).join(` · `)},[a]),c=(0,_.useMemo)(()=>a.filter(e=>qt(e)).length,[a]),l=(0,_.useMemo)(()=>{let e=0,t=0,n=0;for(let r of a)e+=r.durationMs??0,t+=r.costEstimate??0,n+=r.editCount;return{durationMs:e,cost:t,edits:n}},[a]);return r?(0,V.jsxs)(`div`,{className:`relative overflow-hidden rounded-2xl bg-gradient-to-br from-terminal-surface via-terminal-bg to-terminal-surface p-4 shadow-layer-xl`,children:[(0,V.jsx)(`div`,{className:`pointer-events-none absolute -right-24 -top-24 h-64 w-64 rounded-full bg-terminal-green/5 blur-3xl`}),(0,V.jsxs)(`div`,{className:`relative space-y-4 animate-pulse`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,V.jsx)(`div`,{className:`h-3 w-20 rounded bg-terminal-surface-2`}),(0,V.jsx)(`div`,{className:`h-3 w-24 rounded bg-terminal-surface-2 opacity-70`}),(0,V.jsx)(`div`,{className:`h-3 w-32 rounded bg-terminal-surface-2 opacity-50`})]}),(0,V.jsx)(`div`,{className:`rounded-2xl bg-terminal-bg/35 p-3 shadow-inner`,children:(0,V.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:5},(e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`div`,{className:`h-8 w-32 rounded bg-terminal-surface-2 opacity-60`}),(0,V.jsx)(`div`,{className:`h-9 flex-1 rounded-xl bg-terminal-surface/60 shadow-layer-sm`})]},t))})})]})]}):i?(0,V.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,V.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,V.jsxs)(`div`,{className:`text-terminal-dimmer text-sm font-mono`,children:[`Failed to load: `,i]}),(0,V.jsx)(`div`,{className:`text-terminal-dimmer/60 text-xs font-mono`,children:`Make sure the vibe-replay editor server is running.`})]})}):(0,V.jsxs)(`div`,{className:`relative flex min-w-0 flex-col overflow-hidden rounded-2xl bg-gradient-to-br from-terminal-surface via-terminal-bg to-terminal-surface shadow-layer-xl`,children:[(0,V.jsx)(`div`,{className:`pointer-events-none absolute -right-24 -top-24 h-64 w-64 rounded-full bg-terminal-green/5 blur-3xl`}),(0,V.jsx)(`div`,{className:`pointer-events-none absolute -bottom-24 -left-24 h-56 w-56 rounded-full bg-terminal-blue/5 blur-3xl`}),!t&&(0,V.jsxs)(`div`,{className:`relative z-10 flex shrink-0 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-3 text-[10px] font-mono text-terminal-dimmer md:px-6`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`span`,{className:`text-terminal-text`,children:a.length}),` `,H(a.length,`session`)]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`span`,{className:`text-terminal-text`,children:o.length}),` `,H(o.length,`project`)]}),s&&(0,V.jsx)(`span`,{children:(0,V.jsx)(`span`,{className:`text-terminal-purple`,children:s})}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`span`,{className:`text-terminal-blue`,children:Gt(l.durationMs)}),` total time`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsxs)(`span`,{className:`text-terminal-orange`,children:[`$`,l.cost.toFixed(2)]}),` total cost`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`span`,{className:`text-terminal-green`,children:l.edits.toLocaleString()}),` `,H(l.edits,`edit`)]}),c>0&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`span`,{className:`text-terminal-dimmer`,children:c}),` estimated timing`]})]}),(0,V.jsxs)(`div`,{className:`relative z-10 min-w-0 flex-1 overflow-y-auto overflow-x-hidden`,children:[e===`timeline`&&(0,V.jsx)(Sn,{groups:o}),e===`files`&&(0,V.jsx)(Tn,{groups:o,hideProjectList:!!t})]})]})}var Dn=[{id:`overview`,label:`Overview`},{id:`timeline`,label:`Timeline`},{id:`files`,label:`Hot Files`}];function On({sessionsPerDay:e,size:t=`sm`}){let{data:n,max:r}=(0,_.useMemo)(()=>{let t=new Date,n=new Date(t);n.setDate(n.getDate()-29);let r=[],i=1,a=new Date(n);for(;a<=t;){let t=e[ke(a)]||0;r.push(t),t>i&&(i=t),a.setDate(a.getDate()+1)}return{data:r,max:i}},[e]);return(0,V.jsx)(`div`,{className:`flex items-end gap-px ${t===`md`?`h-8`:`h-4`}`,children:n.map((e,t)=>(0,V.jsx)(`div`,{className:`w-1 rounded-sm ${e>0?`bg-terminal-green`:`bg-terminal-surface-2`}`,style:{height:e>0?`${Math.max(20,e/r*100)}%`:`2px`,opacity:e>0?.4+e/r*.6:.2}},t))})}function kn({projects:e,selected:t,onSelect:n}){let r=e.reduce((e,t)=>e+t.sessions,0);return(0,V.jsxs)(`div`,{className:`hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20`,children:[(0,V.jsx)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle`,children:(0,V.jsx)(`span`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold`,children:`Projects`})}),(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-2 space-y-0.5`,children:[(0,V.jsxs)(`button`,{onClick:()=>n(Se),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 ${t===`__all__`?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface`}`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:`All projects`}),(0,V.jsx)(`span`,{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${t===`__all__`?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer`}`,children:r})]}),(0,V.jsx)(`div`,{className:`h-px bg-terminal-border-subtle mx-2 my-1.5`}),e.map(e=>{let r=t===e.project,i=A(e.project);return(0,V.jsxs)(`button`,{onClick:()=>n(e.project),title:e.project,className:`w-full text-left px-3 py-2.5 rounded-lg transition-all duration-200 ease-material group ${r?`bg-terminal-green-subtle shadow-layer-sm`:`hover:bg-terminal-surface`}`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-1.5`,children:[(0,V.jsx)(`span`,{className:`text-xs font-sans truncate ${r?`text-terminal-green font-medium`:`text-terminal-text`}`,children:i}),(0,V.jsx)(`span`,{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs shrink-0 ${r?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer`}`,children:e.sessions})]}),e.lastActivity&&(0,V.jsx)(`div`,{className:`mt-1 ml-0.5 text-xs font-mono truncate ${r?`text-terminal-dim`:`text-terminal-dimmer`}`,children:Pe(e.lastActivity,`long`)})]},e.project)})]})]})}function An({project:e,insight:t,onOpenSessions:n}){let r=A(e);return(0,V.jsxs)(`div`,{className:`hover-lift relative overflow-hidden rounded-2xl bg-gradient-to-br from-terminal-surface via-terminal-surface to-terminal-bg/70 p-5 shadow-layer-md`,children:[(0,V.jsx)(`span`,{className:`absolute inset-y-3 left-0 w-0.5 rounded-r-full bg-gradient-to-b from-terminal-green to-terminal-blue opacity-60`}),(0,V.jsx)(`span`,{className:`pointer-events-none absolute -right-10 -top-12 h-32 w-32 rounded-full bg-terminal-green/5 blur-2xl`}),(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-base font-sans font-semibold text-terminal-text truncate`,children:r}),(0,V.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dimmer truncate mt-0.5`,children:e})]}),t.lastActivity&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer shrink-0`,children:Pe(t.lastActivity,`long`)})]}),(0,V.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 sm:grid-cols-4 gap-3 text-xs font-mono`,children:[(0,V.jsx)(jn,{label:H(t.sessions,`session`),value:t.sessions.toString(),tone:`text`}),t.durationMs>0&&(0,V.jsx)(jn,{label:`active time`,value:Re(t.durationMs),tone:`blue`}),t.cost>0&&(0,V.jsx)(jn,{label:`cost`,value:`$${t.cost.toFixed(2)}`,tone:`orange`}),(0,V.jsx)(jn,{label:H(t.prompts,`prompt`),value:U(t.prompts),tone:`green`})]}),(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 text-[10px] font-mono text-terminal-dimmer flex-wrap`,children:[t.toolCalls>0&&(0,V.jsxs)(`span`,{children:[U(t.toolCalls),` `,H(t.toolCalls,`tool`)]}),t.edits>0&&(0,V.jsxs)(`span`,{children:[U(t.edits),` `,H(t.edits,`edit`)]}),t.branchCount>0&&(0,V.jsxs)(`span`,{children:[t.branchCount,` `,H(t.branchCount,`branch`,`branches`)]}),t.prCount>0&&(0,V.jsxs)(`span`,{children:[t.prCount,` `,H(t.prCount,`PR`)]}),t.memoryFileCount>0&&(0,V.jsxs)(`span`,{children:[t.memoryFileCount,` `,H(t.memoryFileCount,`memory file`)]})]}),(0,V.jsxs)(`div`,{className:`mt-4`,children:[(0,V.jsx)(On,{sessionsPerDay:t.sessionsPerDay,size:`md`}),(0,V.jsx)(`div`,{className:`mt-1 text-[10px] font-mono text-terminal-dimmer`,children:`last 30 days`})]}),(0,V.jsx)(`button`,{onClick:n,className:`mt-4 inline-flex items-center gap-1.5 rounded-lg bg-terminal-green-subtle px-3 py-1.5 text-xs font-sans font-semibold text-terminal-green hover:bg-terminal-green-emphasis transition-colors`,children:`View all sessions →`})]})}function jn({label:e,value:t,tone:n}){let r={text:`text-terminal-text`,blue:`text-terminal-blue`,orange:`text-terminal-orange`,green:`text-terminal-green`}[n];return(0,V.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg/40 p-2.5`,children:[(0,V.jsx)(`div`,{className:`text-sm font-sans font-semibold tabular-nums ${r}`,children:t}),(0,V.jsx)(`div`,{className:`mt-0.5 text-[10px] font-mono text-terminal-dimmer`,children:e})]})}function Mn({projects:e,onProjectClick:t}){return(0,V.jsx)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-3`,children:e.map(e=>{let n=A(e.project);return(0,V.jsxs)(`button`,{onClick:()=>t(e.project),className:`hover-lift group relative overflow-hidden rounded-xl bg-gradient-to-br from-terminal-surface via-terminal-surface to-terminal-bg/70 p-4 text-left shadow-layer-sm transition-all duration-200 ease-material hover:bg-terminal-surface-hover`,children:[(0,V.jsx)(`span`,{className:`absolute inset-y-3 left-0 w-0.5 rounded-r-full bg-gradient-to-b from-terminal-green to-terminal-blue opacity-50 transition-opacity group-hover:opacity-100`}),(0,V.jsx)(`span`,{className:`pointer-events-none absolute -right-10 -top-12 h-28 w-28 rounded-full bg-terminal-green/5 blur-2xl opacity-0 transition-opacity group-hover:opacity-100`}),(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-2 mb-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-sm font-sans font-medium text-terminal-text truncate group-hover:text-terminal-green transition-colors`,children:n}),(0,V.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dimmer truncate mt-0.5`,children:e.project})]}),e.lastActivity&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer shrink-0`,children:Pe(e.lastActivity,`long`)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 text-xs font-mono flex-wrap mb-3`,children:[(0,V.jsxs)(`span`,{className:`text-terminal-text tabular-nums`,children:[e.sessions,` `,(0,V.jsx)(`span`,{className:`text-terminal-dimmer`,children:H(e.sessions,`session`)})]}),e.durationMs>0&&(0,V.jsx)(`span`,{className:`text-terminal-blue tabular-nums`,children:Re(e.durationMs)}),e.cost>0&&(0,V.jsxs)(`span`,{className:`text-terminal-orange tabular-nums`,children:[`$`,e.cost.toFixed(2)]}),(0,V.jsxs)(`span`,{className:`text-terminal-green tabular-nums`,children:[U(e.prompts),` `,(0,V.jsx)(`span`,{className:`text-terminal-dimmer`,children:H(e.prompts,`prompt`)})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] font-mono text-terminal-dimmer flex-wrap mb-2`,children:[e.toolCalls>0&&(0,V.jsxs)(`span`,{children:[U(e.toolCalls),` `,H(e.toolCalls,`tool`)]}),e.edits>0&&(0,V.jsxs)(`span`,{children:[U(e.edits),` `,H(e.edits,`edit`)]}),e.branchCount>0&&(0,V.jsxs)(`span`,{children:[e.branchCount,` `,H(e.branchCount,`branch`,`branches`)]}),e.prCount>0&&(0,V.jsxs)(`span`,{children:[e.prCount,` `,H(e.prCount,`PR`)]}),e.memoryFileCount>0&&(0,V.jsxs)(`span`,{children:[e.memoryFileCount,` `,e.memoryFileCount===1?`Claude memory`:`Claude memories`]})]}),(0,V.jsx)(On,{sessionsPerDay:e.sessionsPerDay})]},e.project)})})}function Nn({onNavigate:e}){let{userInsights:t,scanStatus:n}=He(),[r,i]=(0,_.useState)(Se),[a,o]=(0,_.useState)(`overview`),s=(0,_.useMemo)(()=>{if(!t)return[];let e=be(t.topProjects);return e.sort((e,t)=>(t.lastActivity||``).localeCompare(e.lastActivity||``)),e},[t]),c=r===`__all__`?null:s.find(e=>e.project===r)??null,l=n?.running&&n.total>0;if(!t&&!l)return(0,V.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,V.jsxs)(`div`,{className:`text-center space-y-2 text-terminal-dimmer text-sm font-mono`,children:[(0,V.jsx)(`p`,{children:`No scan data available yet.`}),(0,V.jsx)(`p`,{className:`text-xs`,children:`Projects will appear once the background scan completes.`})]})});if(!t&&l)return(0,V.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-terminal-dim text-sm font-mono`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse`}),`Analyzing sessions... `,n.scanned,`/`,n.total]})});let u=t=>{e(`sessions`),setTimeout(()=>L({tab:`sessions`,project:t}),50)},d=s.map(e=>({project:e.project,sessions:e.sessions,lastActivity:e.lastActivity})),f=r!==Se,p=f?Dn.filter(e=>e.id!==`timeline`):Dn,m=p.some(e=>e.id===a)?a:`overview`,h=f?r:void 0;return(0,V.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,V.jsx)(kn,{projects:d,selected:r,onSelect:e=>{i(e),o(`overview`)}}),(0,V.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-0 min-w-0 overflow-y-auto`,children:[(0,V.jsx)(`div`,{className:`md:hidden px-3 pt-3`,children:(0,V.jsxs)(`select`,{"aria-label":`Select project`,value:r,onChange:e=>{i(e.target.value),o(`overview`)},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:[(0,V.jsxs)(`option`,{value:Se,children:[`All projects (`,s.length,`)`]}),s.map(e=>(0,V.jsxs)(`option`,{value:e.project,children:[A(e.project),` (`,e.sessions,`)`]},e.project))]})}),(0,V.jsxs)(`div`,{className:`px-4 md:px-6 pt-5 pb-3 flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`h2`,{className:`text-sm font-sans font-semibold text-terminal-text truncate`,children:[r===`__all__`?`All Projects`:A(r),r===`__all__`&&(0,V.jsxs)(`span`,{className:`ml-2 text-terminal-dimmer font-normal`,children:[`(`,s.length,`)`]})]}),l&&(0,V.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5 text-[10px] font-mono text-terminal-dim`,children:[(0,V.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-terminal-purple animate-pulse`}),`Analyzing... `,n.scanned,`/`,n.total]})]}),(0,V.jsx)(`div`,{className:`inline-flex w-fit items-center rounded-xl bg-terminal-surface/80 p-0.5 shadow-layer-sm backdrop-blur-sm`,children:p.map(e=>(0,V.jsx)(`button`,{onClick:()=>o(e.id),className:`rounded-lg px-3.5 py-1.5 text-xs font-sans font-semibold transition-all duration-200 ease-material ${m===e.id?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text`}`,children:e.label},e.id))})]}),(0,V.jsxs)(`div`,{className:`px-4 md:px-6 pb-6 space-y-4`,children:[m===`overview`&&r===`__all__`&&(0,V.jsx)(Mn,{projects:s,onProjectClick:i}),m===`overview`&&c&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(An,{project:r,insight:c,onOpenSessions:()=>u(r)}),(0,V.jsx)(En,{view:`timeline`,projectFilter:h})]}),m===`timeline`&&(0,V.jsx)(En,{view:`timeline`,projectFilter:h}),m===`files`&&(0,V.jsx)(En,{view:`files`,projectFilter:h})]})]})]})}var Pn=()=>(0,V.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`currentColor`,children:[(0,V.jsx)(`circle`,{cx:`8`,cy:`3`,r:`1.5`}),(0,V.jsx)(`circle`,{cx:`8`,cy:`8`,r:`1.5`}),(0,V.jsx)(`circle`,{cx:`8`,cy:`13`,r:`1.5`})]});function Fn({provider:e}){return(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-medium px-1.5 py-0.5 rounded-full uppercase tracking-wider ${le(e)}`,children:ce(e)})}function In({slug:e,title:t,fallbackTitle:n,onSave:r}){let i=j(t||n||e),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(i),[l,u]=(0,_.useState)(!1),d=(0,_.useRef)(null);(0,_.useEffect)(()=>{c(i)},[i]),(0,_.useEffect)(()=>{a&&d.current?.focus()},[a]);let f=async()=>{if(!l){u(!0);try{await r(e,j(s))}finally{u(!1),o(!1)}}};return a?(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),f()},className:`flex items-center gap-1.5 min-w-0`,children:(0,V.jsx)(`input`,{ref:d,value:s,onChange:e=>c(e.target.value),onBlur:f,onKeyDown:e=>{e.key===`Escape`&&(c(i),o(!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:i,maxLength:120,disabled:l})}),(0,V.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer truncate mt-0.5`,children:[`slug: `,(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:e})]})]}):(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsxs)(`button`,{onClick:()=>o(!0),className:`group flex items-center gap-1 min-w-0 max-w-full text-left`,title:`Click to edit title`,children:[(0,V.jsx)(`span`,{className:`text-sm font-sans font-medium text-terminal-text truncate`,children:i||e}),(0,V.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:(0,V.jsx)(`path`,{d:`M11.5 1.5l3 3-9 9H2.5v-3l9-9z`})})]}),(0,V.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer truncate mt-0.5`,children:[`slug: `,(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:e})]})]})}function Ln({onArchive:e,isArchived:t}){let[n,r]=(0,_.useState)(!1),i=(0,_.useRef)(null);return v(i,(0,_.useCallback)(()=>r(!1),[]),n),(0,V.jsxs)(`div`,{className:`relative`,ref:i,children:[(0,V.jsx)(`button`,{onClick:e=>{e.stopPropagation(),r(e=>!e)},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:(0,V.jsx)(Pn,{})}),n&&(0,V.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:(0,V.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),e(),r(!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:[(0,V.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,V.jsx)(`path`,{d:`M2 4h12v2H2zM3 6v7h10V6M6.5 8h3`})}),t?`Unarchive`:`Archive`]})})]})}var Rn=null,zn=null;function Bn(){return Rn?Promise.resolve(Rn):zn||(zn=fetch(`/api/scan/results`).then(e=>e.ok?e.json():null).then(e=>{let t=e?.results??null;return Rn=t,setTimeout(()=>{Rn=null,zn=null},3e4),t}).catch(()=>null),zn)}function Vn(e,t,n){let r=[],i=new Set,a=[t?.firstPrompt,...e.prompts||[]];t?.firstPrompt||a.push(e.firstPrompt);for(let e of a){let t=F(e||``);!t||i.has(t)||(i.add(t),r.push(t))}let o=F(n||``);return r.length>1&&o&&r[0]===o&&r.shift(),r.length>1&&/^(?:and|but|or|so|then)\b/i.test(r[0]||``)&&r.shift(),r}function Hn(e){return e&&e!==`main`&&e!==`master`?e:void 0}function Un(e,t){return e===`jsonl`?`bg-terminal-orange-subtle text-terminal-orange`:e===`global-state`?`bg-terminal-blue-subtle text-terminal-blue`:e===`sqlite`||t?`bg-terminal-green-subtle text-terminal-green`:`bg-terminal-surface-2 text-terminal-dimmer`}function Wn({session:e,scanData:t=null,onClose:n,onGenerate:r,onViewReplay:i,onArchive:a,onTitleSave:o,onDeleteReplay:s,isGenerating:c,isArchived:l}){let[u,d]=(0,_.useState)(t),f=te(e),p=ne(e,u),[m,h]=(0,_.useState)(e.replay?.title||p),[g,v]=(0,_.useState)(!1),y=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n]),(0,_.useEffect)(()=>{let e=y.current;e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length))},[]),(0,_.useEffect)(()=>{d(t)},[t]),(0,_.useEffect)(()=>{if(t)return;let n=!1;return Bn().then(t=>{if(n||!t)return;let r=t.find(t=>t.slug===e.slug);r&&d(r)}),()=>{n=!0}},[t,e.slug]),(0,_.useEffect)(()=>{h(t=>{let n=j(t),r=j(p),i=j(e.replay?.title);return!n||n===i||n===e.slug||r&&n===j(f)?e.replay?.title||p:t})},[f,p,e.replay?.title,e.slug]);let b=Hn(u?.gitBranch||e.gitBranch),x=u?.model||e.model,S=Vn(e,u,p),C=u?.dataQualityNotes||[],D=u?.promptCount??e.promptCount,M=u?.toolCallCount??e.toolCallCount,N=u?.editCount??e.editCountEst,ee=u?.durationMs??e.durationMsEst,P=u?.costEstimate??e.replay?.stats?.costEstimate,F=u?.tokenUsage?u.tokenUsage.inputTokens+u.tokenUsage.outputTokens:void 0,I=u?.startTime||e.timestamp,re=async()=>{if(!e.replay||g)return;let t=j(m);if(t!==j(e.replay.title||p)){v(!0);try{await o(e.slug,t)}finally{v(!1)}}},L=()=>{r(e,m)};return(0,V.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,children:[(0,V.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-md animate-in fade-in duration-300`,onClick:n}),(0,V.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:e=>e.stopPropagation(),children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between px-7 pt-5 pb-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(Fn,{provider:e.provider}),x&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-surface-2 text-terminal-dimmer`,children:E(x)}),u?.dataSource&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full ${Un(u.dataSource,e.hasSqlite)}`,children:ge(e.hasSqlite,u.dataSource)}),u?.entrypoint&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-surface-2 text-terminal-dimmer`,children:u.entrypoint}),u?.permissionMode===`bypassPermissions`&&(0,V.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`}),u?.skillsUsed?.map(e=>(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-blue-500/10 text-blue-400`,children:e},e)),u?.mcpServersUsed?.map(e=>(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-purple-500/10 text-purple-400`,children:e},e)),e.replay?.replayOutdated&&(0,V.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`})]}),(0,V.jsx)(`button`,{onClick:n,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:(0,V.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,V.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`})})})]}),(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-7 space-y-5 pb-5`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-2 px-1`,children:[(0,V.jsx)(`span`,{className:`text-xs font-sans uppercase tracking-widest text-terminal-dimmer`,children:`Title`}),(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:e.slug})]}),(0,V.jsx)(`form`,{onSubmit:t=>{t.preventDefault(),e.replay?re():L()},children:(0,V.jsx)(`textarea`,{ref:y,value:m,onChange:e=>h(e.target.value.replace(/\n/g,``)),onBlur:()=>{e.replay&&re()},onKeyDown:t=>{t.key===`Enter`&&(t.preventDefault(),e.replay?re():L())},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:p,maxLength:120})})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-5`,children:[(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl px-5 py-4 space-y-2.5`,children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-1`,children:`Session Info`}),(0,V.jsx)(Gn,{label:`Project`,value:A(e.project),title:e.project}),b&&(0,V.jsx)(Gn,{label:`Branch`,value:b}),u?.gitBranches&&u.gitBranches.length>1&&(0,V.jsx)(Gn,{label:`Branches`,value:u.gitBranches.join(`, `)}),u?.skillsUsed&&u.skillsUsed.length>0&&(0,V.jsx)(Gn,{label:`Skills`,value:u.skillsUsed.join(`, `)}),u?.mcpServersUsed&&u.mcpServersUsed.length>0&&(0,V.jsx)(Gn,{label:`MCP Servers`,value:u.mcpServersUsed.join(`, `)}),(0,V.jsx)(Gn,{label:`Started`,value:`${w(I)} (${k(I)})`}),u?.endTime&&(0,V.jsx)(Gn,{label:`Ended`,value:w(u.endTime)}),!!ee&&(0,V.jsx)(Gn,{label:`Duration`,value:`~${Re(ee)}`}),(0,V.jsx)(Gn,{label:`Size`,value:O(e.fileSize)}),(0,V.jsx)(Gn,{label:`Lines`,value:e.lineCount.toLocaleString()}),e.filePaths.length>1&&(0,V.jsx)(Gn,{label:`Parts`,value:`${e.filePaths.length} files`}),(0,V.jsx)(Gn,{label:`Data`,value:ge(e.hasSqlite,u?.dataSource)})]}),(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl px-5 py-4 space-y-2.5`,children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-1`,children:`Stats`}),!!D&&(0,V.jsx)(Gn,{label:`Prompts`,value:String(D)}),!!M&&(0,V.jsx)(Gn,{label:`Tools`,value:String(M)}),!!N&&(0,V.jsx)(Gn,{label:`Edits`,value:u?String(N):`~${N}`}),P!=null&&P>0&&(0,V.jsx)(Gn,{label:`Cost`,value:T(P)}),F!=null&&(0,V.jsx)(Gn,{label:`Tokens`,value:F.toLocaleString(),title:u?.tokenUsage?`In: ${u.tokenUsage.inputTokens.toLocaleString()} / Out: ${u.tokenUsage.outputTokens.toLocaleString()} / Cache write: ${u.tokenUsage.cacheCreationTokens.toLocaleString()} / Cache read: ${u.tokenUsage.cacheReadTokens.toLocaleString()}`:void 0}),u!=null&&u.subAgentCount>0&&(0,V.jsx)(Gn,{label:`Agents`,value:`${u.subAgentCount} sub-agents`}),u!=null&&u.compactionCount>0&&(0,V.jsx)(Gn,{label:`Compacts`,value:String(u.compactionCount)}),u!=null&&u.apiErrorCount>0&&(0,V.jsx)(Gn,{label:`Errors`,value:`${u.apiErrorCount} API errors`}),e.hasPR&&!u?.prLinks?.length&&(0,V.jsx)(Gn,{label:`PR`,value:`Yes`}),u?.prLinks?.map(e=>(0,V.jsx)(Gn,{label:`PR`,value:`#${e.prNumber} (${e.prRepository})`},e.prNumber))]})]}),C.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2`,children:`Data Quality`}),(0,V.jsx)(`div`,{className:`bg-terminal-surface rounded-xl px-4 py-3 space-y-1.5`,children:C.map(e=>(0,V.jsxs)(`div`,{className:`flex gap-2 items-start text-xs font-mono text-terminal-dim`,children:[(0,V.jsx)(`span`,{className:`text-terminal-orange shrink-0 mt-px`,children:`!`}),(0,V.jsx)(`span`,{children:e})]},e))})]}),u?.filesModified&&u.filesModified.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2`,children:[`Files Modified (`,u.filesModified.length,`)`]}),(0,V.jsxs)(`div`,{className:`max-h-[120px] overflow-y-auto bg-terminal-surface rounded-xl px-4 py-2.5 space-y-1`,children:[u.filesModified.slice(0,20).map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs font-mono`,children:[(0,V.jsx)(`span`,{className:`text-terminal-dim truncate`,children:e.file}),(0,V.jsxs)(`span`,{className:`text-terminal-dimmer shrink-0 tabular-nums`,children:[e.count,`x`]})]},e.file)),u.filesModified.length>20&&(0,V.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dimmer`,children:[`+`,u.filesModified.length-20,` more files`]})]})]}),S.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2`,children:`Prompts`}),(0,V.jsx)(`div`,{className:`max-h-[180px] overflow-y-auto space-y-1.5 pr-1`,children:S.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex gap-2 items-start`,children:[(0,V.jsx)(`span`,{className:`text-xs text-terminal-green shrink-0 mt-px select-none`,children:`>`}),(0,V.jsx)(`p`,{className:`text-sm text-terminal-dim line-clamp-2 leading-relaxed`,children:e})]},t))})]}),e.replay&&(0,V.jsxs)(`div`,{className:`border-t border-terminal-border-subtle pt-4`,children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2`,children:`Replay`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[e.replay.replaySize!=null&&(0,V.jsx)(`span`,{className:`text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dim`,children:O(e.replay.replaySize)}),e.replay.generatorVersion&&(0,V.jsxs)(`span`,{className:`text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dimmer`,children:[`v`,e.replay.generatorVersion]}),!!e.replay.annotationCount&&(0,V.jsxs)(`span`,{className:`text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dim`,children:[e.replay.annotationCount,` annotations`]}),(e.replay.cloud||e.replay.gist)&&(0,V.jsx)(`span`,{className:`text-xs font-mono px-2 py-1 rounded-md bg-terminal-green-subtle text-terminal-green`,children:e.replay.cloud?`Cloud`:`Gist`})]})]}),e.expiresInDays!=null&&e.expiresInDays<=7&&(0,V.jsxs)(`div`,{className:`rounded-lg px-4 py-2.5 text-sm font-mono ${e.expiresInDays<=2?`bg-terminal-red-subtle text-terminal-red`:`bg-terminal-orange-subtle text-terminal-orange`}`,children:[e.expiresInDays===0?`Transcript expires today`:`Transcript expires in ${e.expiresInDays} day${e.expiresInDays===1?``:`s`}`,` — generate a replay to preserve it.`]})]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between px-7 py-4 border-t border-terminal-border-subtle`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(`button`,{onClick:()=>{a(e.slug),n()},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:[(0,V.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,V.jsx)(`path`,{d:`M2 4h12v2H2zM3 6v7h10V6M6.5 8h3`})}),l?`Unarchive`:`Archive`]}),e.replay&&(0,V.jsxs)(`button`,{onClick:()=>{s(e.slug),n()},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:[(0,V.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,V.jsx)(`path`,{d:`M3 4h10M5.5 4V3h5v1M6 7v4M10 7v4M4.5 4l.5 9h6l.5-9`})}),`Delete replay`]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.replay&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{onClick:()=>r(e,m),disabled:c,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:c?(0,V.jsx)(`span`,{className:`animate-pulse`,children:`Regenerating...`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,V.jsx)(`path`,{d:`M21 3v5h-5`}),(0,V.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,V.jsx)(`path`,{d:`M8 16H3v5`})]}),`Regenerate`]})}),(0,V.jsxs)(`button`,{onClick:()=>i(e.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:[(0,V.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,V.jsx)(`path`,{d:`M5 3l8 5-8 5V3z`})}),`View Replay`]})]}),!e.replay&&(0,V.jsx)(`button`,{onClick:L,disabled:c,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:c?(0,V.jsx)(`span`,{className:`animate-pulse`,children:`Generating...`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,V.jsx)(`path`,{d:`M8 2v12M2 8h12`})}),`Generate Replay`]})})]})]})]})]})}function Gn({label:e,value:t,title:n}){return(0,V.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,V.jsx)(`span`,{className:`text-[11px] font-sans text-terminal-dimmer uppercase tracking-wider shrink-0 w-[68px]`,children:e}),(0,V.jsx)(`span`,{className:`text-sm font-mono text-terminal-dim truncate`,title:n||t,children:t})]})}function Kn({summary:e,onOpen:t,onShare:n,onTitleSave:r,onDelete:i,onRegenerate:a,onArchive:o,isDeleting:s,isRegenerating:c,isArchived:l}){let[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(!1),m=(0,_.useRef)(null);v(m,(0,_.useCallback)(()=>{p(!1),d(!1)},[]),f);let h=ye(e.project),g=h!==e.project;return(0,V.jsxs)(`div`,{onClick:t,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 ${l?`opacity-50`:``}`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,V.jsx)(`div`,{className:`flex-1 flex items-center gap-2 min-w-0`,children:r?(0,V.jsx)(`div`,{className:`flex-1 min-w-0`,onClick:e=>e.stopPropagation(),children:(0,V.jsx)(In,{slug:e.slug,title:e.title,fallbackTitle:re(e),onSave:r})}):(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`span`,{className:`text-sm font-sans font-medium text-terminal-text truncate block`,children:re(e)}),(0,V.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer truncate mt-0.5`,children:[`slug: `,(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:e.slug})]})]})}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[e.replayOutdated&&(0,V.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${e.generatorVersion||`?`} — regenerate to update`,children:[(0,V.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,V.jsx)(`path`,{d:`M2.5 8a5.5 5.5 0 019.3-4M13.5 8a5.5 5.5 0 01-9.3 4`}),(0,V.jsx)(`path`,{d:`M12.5 1v3h-3M3.5 15v-3h3`})]}),`outdated`]}),e.gist?.outdated&&(0,V.jsx)(`button`,{onClick:e=>{e.stopPropagation(),n?.()},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:(0,V.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,V.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`})})}),n&&(0,V.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),n()},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 ${e.cloud||e.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:e.cloud||e.gist?`Already shared — view or update`:`Share & Export`,children:[e.cloud||e.gist?(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,V.jsx)(`path`,{d:`M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z`})}):(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,V.jsx)(`path`,{d:`M8 2v8M5 5l3-3 3 3M3 11v2h10v-2`})}),e.cloud||e.gist?`Shared`:`Share`]}),a&&(0,V.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),a()},disabled:c,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:[c?(0,V.jsx)(`span`,{className:`animate-pulse`,children:`...`}):(0,V.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,V.jsx)(`path`,{d:`M21 3v5h-5`}),(0,V.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,V.jsx)(`path`,{d:`M8 16H3v5`})]}),`Redo`]}),(0,V.jsxs)(`button`,{onClick:t,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:[(0,V.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,V.jsx)(`polygon`,{points:`4 2 14 8 4 14`})}),`View`]}),(i||o)&&(0,V.jsxs)(`div`,{className:`relative`,ref:m,children:[(0,V.jsx)(`button`,{onClick:e=>{e.stopPropagation(),p(e=>!e),d(!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:(0,V.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`currentColor`,children:[(0,V.jsx)(`circle`,{cx:`8`,cy:`3`,r:`1.5`}),(0,V.jsx)(`circle`,{cx:`8`,cy:`8`,r:`1.5`}),(0,V.jsx)(`circle`,{cx:`8`,cy:`13`,r:`1.5`})]})}),f&&(0,V.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:[o&&(0,V.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),o(),p(!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:[(0,V.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,V.jsx)(`path`,{d:`M2 4h12v2H2zM3 6v7h10V6M6.5 8h3`})}),l?`Unarchive`:`Archive`]}),i&&(0,V.jsxs)(V.Fragment,{children:[o&&(0,V.jsx)(`div`,{className:`mx-2 my-1 border-t border-terminal-border`}),u?(0,V.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1`,children:[(0,V.jsx)(`button`,{onClick:e=>{e.stopPropagation(),i(),d(!1),p(!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`}),(0,V.jsx)(`button`,{onClick:()=>d(!1),className:`h-6 px-2 text-xs font-sans rounded text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`})]}):(0,V.jsxs)(`button`,{onClick:()=>d(!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:[(0,V.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,V.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`]})]})]})]})]})]}),(e.messages||(e.firstMessage?[e.firstMessage]:[])).map(e=>F(e||``)).filter(e=>e.length>0).map((e,t)=>(0,V.jsxs)(`div`,{className:`flex gap-2 items-start`,children:[(0,V.jsx)(`span`,{className:`text-xs text-terminal-green shrink-0 mt-px select-none`,children:`>`}),(0,V.jsx)(`p`,{className:`text-sm text-terminal-dim line-clamp-1 leading-relaxed`,children:e})]},t)),(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,V.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.stats.userPrompts,` prompts`]}),(0,V.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:[e.stats.toolCalls,` tools`]}),e.stats.durationMs&&(0,V.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:Re(e.stats.durationMs)}),e.stats.costEstimate&&(0,V.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:T(e.stats.costEstimate)}),e.hasAnnotations&&(0,V.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:[e.annotationCount,` annotation`,e.annotationCount===1?``:`s`]}),e.replaySize!=null&&e.replaySize>0&&(0,V.jsx)(`span`,{className:`inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md ${e.replaySize>10*1024*1024?`bg-terminal-red-subtle text-terminal-red`:`bg-terminal-surface-2 text-terminal-dimmer`}`,title:e.replaySize>10*1024*1024?`Exceeds share limit (10MB)`:void 0,children:O(e.replaySize)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono text-terminal-dimmer flex-wrap`,children:[(0,V.jsx)(Fn,{provider:e.provider}),(0,V.jsx)(`span`,{title:g?e.project:void 0,children:h}),g&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple uppercase tracking-wider`,title:`Agent worktree: ${e.project}`,children:`worktree`}),(0,V.jsx)(`span`,{className:`text-terminal-border`,children:`·`}),(0,V.jsx)(`span`,{children:w(e.startTime)}),e.model&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-terminal-border`,children:`·`}),(0,V.jsx)(`span`,{children:e.model})]})]})]})}function qn(){let[e,t]=(0,_.useState)(!1),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(null);return(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`button`,{onClick:async()=>{t(!0),a(null),r(null);try{let e=await fetch(`/api/regenerate-all`,{method:`POST`}),t=await e.json();if(!e.ok)throw Error(t.error||`Failed`);r({regenerated:t.regenerated,total:t.total}),setTimeout(()=>window.location.reload(),1500)}catch(e){a(e instanceof Error?e.message:`Failed to regenerate`)}finally{t(!1)}},disabled:e,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:e?`Regenerating...`:`Regenerate All`}),n&&(0,V.jsxs)(`span`,{className:`text-xs font-mono text-terminal-green`,children:[n.regenerated,`/`,n.total,` regenerated`]}),i&&(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-red`,children:i})]})}function Jn(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)({}),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!0),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(null),[g,v]=(0,_.useState)(null),[y,w]=(0,_.useState)(()=>Date.now()),{selectedProject:T,filter:D,showArchived:M,handleProjectChange:N,handleFilterChange:ee,handleToggleArchived:P}=Te(),{scanStatus:F,userInsights:I,projectInsightsCache:te,fetchProjectInsights:re}=He(),R=ye(T);(0,_.useEffect)(()=>{R!==`__all__`&&re(R)},[R,re]);let z=R===`__all__`?void 0:te.get(R),[ie,ae]=(0,_.useState)(null),[oe,se]=(0,_.useState)(null),[ce,le]=(0,_.useState)(null);(0,_.useEffect)(()=>{(()=>{let e=new URLSearchParams(window.location.search).get(`selected`);if(!e)return;le(e);let t=new URL(window.location.href);t.searchParams.delete(`selected`),window.history.replaceState(null,``,t)})();let e=e=>{let t=e.detail?.slug;if(!t)return;le(t);let n=new URL(window.location.href);n.searchParams.delete(`selected`),window.history.replaceState(null,``,n)};return window.addEventListener(`vibe-open-session`,e),()=>window.removeEventListener(`vibe-open-session`,e)},[]);let ue=(0,_.useRef)(!1),[de,me]=(0,_.useState)(new Set),[_e,ve]=(0,_.useState)(null),be=e.some(e=>e.provider===`cursor`),xe=ce?e.find(e=>e.slug===ce)??null:null,Ce=(0,_.useCallback)(async e=>{s(!0),l(null),h(null),d(!1),p(null);let n=await fetch(`/api/archived`).then(e=>e.ok?e.json():{slugs:[]}).catch(()=>({slugs:[]}));me(new Set(n.slugs));let r=!1,i=b(await fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null)),o=!e?.forceRefresh&&x(i?.cachedAt);if(i&&i.sessions.length>0&&(r=!0,t(i.sessions),v(i.cachedAt??null),p(o?null:i.cachedAt??null),s(!1),d(!o)),o){d(!1),s(!1);return}try{let e=await fetch(`/api/sources`);if(!e.ok)throw Error(`Failed to load sessions`);let n=await e.json();t(n.sessions),n.cleanupPeriodDays!=null&&a(n.cleanupPeriodDays),v(new Date().toISOString()),p(null)}catch(e){r?h(`Failed to refresh latest sessions. Showing cached data.`):l(pe(e)||`Failed to load sessions`)}finally{d(!1),s(!1)}},[]),B=e=>fe(e,de,me);(0,_.useEffect)(()=>{Ce()},[Ce]),(0,_.useEffect)(()=>{if(e.length===0)return;let t=!1,n=async()=>{let e=await Bn();t||!e||r(Object.fromEntries(e.filter(e=>e.slug).map(e=>[e.slug,e])))};n();let i=window.setInterval(()=>{n()},F?.running?5e3:3e4);return()=>{t=!0,window.clearInterval(i)}},[F?.running,e.length]),(0,_.useEffect)(()=>{if(!o&&!be&&!ue.current)return;let e=!1,n,r=async()=>{let n=b(await fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null));!e&&n?.sessions.length&&t(n.sessions)},i=async()=>{let t=await fetch(`/api/sources/enrichment-status`).then(e=>e.ok?e.json():null).catch(()=>null);!t||e||(ve(t),t.running?(ue.current=!0,await r()):ue.current&&(ue.current=!1,await r()))};return i(),n=window.setInterval(()=>{i()},2500),()=>{e=!0,n&&window.clearInterval(n)}},[be,o]),(0,_.useEffect)(()=>{let e=window.setInterval(()=>w(Date.now()),3e4);return()=>window.clearInterval(e)},[]);let we=async(e,n)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:n})})).ok)throw Error(`Failed to update title`);t(t=>t.map(t=>t.slug===e&&t.replay?{...t,replay:{...t.replay,title:n||void 0}}:t))},Ee=async(e,t)=>{le(null),ae(e.slug),se(null);try{let n=await fetch(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,filePaths:e.filePaths,toolPaths:e.toolPaths,title:j(t)||void 0,sessionSlug:e.slug,sessionProject:e.project})}),r=await n.json();if(!n.ok)throw Error(r.error||`Generation failed`);L({view:null,session:r.slug})}catch(e){se(pe(e))}finally{ae(null)}},De=async e=>{try{if(!(await fetch(`/api/sessions/${encodeURIComponent(e)}`,{method:`DELETE`})).ok)return;t(t=>t.map(t=>t.slug===e?{...t,replay:void 0,existingReplay:null}:t))}catch{}},Oe=e.filter(e=>de.has(e.slug)).length,ke=M?e:e.filter(e=>!de.has(e.slug)),Ae=new Map;for(let e of ke){let t=ye(e.project);Ae.has(t)||Ae.set(t,[]),Ae.get(t)?.push(e)}let je=[...Ae.entries()].sort((e,t)=>{let n=e[1][0]?.timestamp||``;return(t[1][0]?.timestamp||``).localeCompare(n)}),Me=he(je.map(([e])=>e)),Ne=R===`__all__`?ke:Ae.get(R)||[],H=D?Ne.filter(e=>e.slug.toLowerCase().includes(D.toLowerCase())||e.firstPrompt.toLowerCase().includes(D.toLowerCase())||(e.title||``).toLowerCase().includes(D.toLowerCase())||(e.gitBranch||``).toLowerCase().includes(D.toLowerCase())):Ne,Pe=g?C(g,y):null,Fe=o&&e.length===0,Ie=e.filter(e=>e.expiresInDays!=null&&e.expiresInDays<=7&&!de.has(e.slug)),Le=Ie.reduce((e,t)=>Math.min(e,t.expiresInDays??1/0),1/0);return c&&e.length===0?(0,V.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,V.jsxs)(`div`,{className:`text-center space-y-3`,children:[(0,V.jsx)(`div`,{className:`text-terminal-red font-mono text-sm`,children:c}),(0,V.jsx)(`button`,{onClick:()=>void Ce({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`})]})}):e.length===0&&!Fe?(0,V.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,V.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,V.jsx)(`div`,{className:`text-terminal-dim font-mono text-sm`,children:`No AI sessions found`}),(0,V.jsx)(`div`,{className:`text-terminal-dimmer font-mono text-xs`,children:`Start a coding session with Claude Code or Cursor, then come back here`})]})}):(0,V.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,V.jsxs)(`div`,{className:`hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold`,children:`Projects`}),Pe&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:Pe})]}),(0,V.jsx)(`button`,{onClick:()=>{Ce({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:(0,V.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:[(0,V.jsx)(`path`,{d:`M2.5 8a5.5 5.5 0 019.3-4M13.5 8a5.5 5.5 0 01-9.3 4`}),(0,V.jsx)(`path`,{d:`M12.5 1v3h-3M3.5 15v-3h3`})]})})]}),(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-2 space-y-0.5`,children:[(0,V.jsxs)(`button`,{onClick:()=>N(Se),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 ${T===`__all__`?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface`}`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:`All projects`}),(0,V.jsx)(`span`,{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${T===`__all__`?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer`}`,children:e.length})]}),(0,V.jsx)(`div`,{className:`h-px bg-terminal-border-subtle mx-2 my-1.5`}),je.map(([e,t])=>{let n=t.filter(e=>e.existingReplay).length,r=R===e,i=Me.get(e)||A(e),a=t.some(e=>e.projectExists!==!1),o=t.some(e=>e.isGitRepo||e.gitBranch);return(0,V.jsxs)(`button`,{onClick:()=>N(e),title:e,className:`w-full text-left px-3 py-2.5 rounded-lg transition-all duration-200 ease-material group ${r?`bg-terminal-green-subtle shadow-layer-sm`:`hover:bg-terminal-surface`} ${a?``:`opacity-50`}`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-1.5`,children:[(0,V.jsxs)(`span`,{className:`text-xs font-sans truncate flex items-center gap-1.5 ${r?`text-terminal-green font-medium`:a?`text-terminal-text group-hover:text-terminal-text`:`text-terminal-dim`}`,children:[o&&(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`shrink-0 ${r?`opacity-70`:`opacity-40`}`,children:(0,V.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`})}),i]}),(0,V.jsx)(`span`,{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs shrink-0 ${r?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer`}`,children:t.length})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-1 ml-0.5`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono truncate ${r?`text-terminal-dim`:`text-terminal-dimmer`}`,children:k(t[0]?.timestamp||``)}),n>0&&(0,V.jsxs)(`span`,{className:`text-xs font-mono ${r?`text-terminal-green`:`text-terminal-dimmer`}`,children:[n,` `,n===1?`replay`:`replays`]})]})]},e)})]})]}),(0,V.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-0 min-w-0`,children:[(0,V.jsx)(`div`,{className:`md:hidden px-3 pt-3`,children:(0,V.jsxs)(`select`,{value:T,onChange:e=>N(e.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:[(0,V.jsxs)(`option`,{value:Se,children:[`All projects (`,e.length,`)`]}),je.map(([e,t])=>(0,V.jsxs)(`option`,{value:e,children:[Me.get(e)||A(e),` (`,t.length,`)`]},e))]})}),(0,V.jsxs)(`div`,{className:`px-4 pt-4 pb-2 space-y-3 shrink-0`,children:[(0,V.jsx)(`div`,{className:`hidden md:block`,children:z&&T!==`__all__`?(0,V.jsx)(Ge,{insights:z,variant:`project`}):I&&T===`__all__`?(0,V.jsx)(Ge,{insights:I,variant:`all`}):(0,V.jsx)(We,{})}),(0,V.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[(0,V.jsxs)(`div`,{className:`relative flex-1`,children:[(0,V.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:[(0,V.jsx)(`circle`,{cx:`7`,cy:`7`,r:`5`}),(0,V.jsx)(`path`,{d:`M11 11l3.5 3.5`})]}),(0,V.jsx)(`input`,{value:D,onChange:e=>ee(e.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`})]}),Oe>0&&(0,V.jsx)(`button`,{onClick:P,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${M?`bg-terminal-orange-subtle text-terminal-orange`:`bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,title:M?`Hide archived`:`View all (${Oe} archived)`,children:M?`Active`:`View all`})]})]}),(Fe||u||f)&&(0,V.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:Fe?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,V.jsx)(`span`,{children:`FETCHING SESSIONS...`})]}):u?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,V.jsx)(`span`,{children:`SCANNING LATEST SESSIONS...`}),f&&(0,V.jsxs)(`span`,{className:`text-terminal-dim`,children:[`Showing stale cache (`,S(f),`)`]})]}):f?(0,V.jsxs)(`span`,{children:[`Showing stale cache (`,S(f),`)`]}):null}),_e?.running&&_e.total>0&&(0,V.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:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,V.jsxs)(`span`,{children:[`BACKFILLING CURSOR STATS... `,_e.processed,`/`,_e.total]})]}),m&&(0,V.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:[(0,V.jsx)(`span`,{children:m}),(0,V.jsx)(`button`,{onClick:()=>h(null),className:`ml-auto text-terminal-orange/60 hover:text-terminal-orange transition-colors`,children:`×`})]}),oe&&(0,V.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:[(0,V.jsx)(`span`,{children:oe}),(0,V.jsx)(`button`,{onClick:()=>se(null),className:`ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors`,children:`×`})]}),Ie.length>0&&(0,V.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:[(0,V.jsx)(`span`,{className:`text-terminal-orange text-base leading-none mt-0.5`,children:`⚠`}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsxs)(`div`,{className:`text-xs font-sans font-semibold text-terminal-orange`,children:[Ie.length,` session`,Ie.length===1?``:`s`,` expiring`,Le===0?` today`:Le===1?` tomorrow`:` within ${Le} days`]}),(0,V.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-orange/70 mt-0.5`,children:[`Claude Code auto-deletes transcripts after`,` `,i==null?`the configured period`:`${i} days`,`. Generate replays to preserve them.`]})]})]}),(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:Fe?(0,V.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:`Fetching sessions...`}):H.length===0?(0,V.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:D?`No sessions match your filter`:`No sessions in this project`}):(0,V.jsx)(`div`,{className:`space-y-2.5 px-4 py-3`,children:H.map(e=>{let t=n[e.slug];if(e.replay){let n=de.has(e.slug),r=ne(e,t),i=Vn(e,t,r);return(0,V.jsx)(Kn,{summary:{...e.replay,title:r,firstMessage:i[0]||t?.firstPrompt||e.replay.firstMessage,messages:i.length>0?i.slice(0,2):t?.firstPrompt?[t.firstPrompt]:e.replay.messages,model:t?.model||e.replay.model},onOpen:()=>L({view:null,session:e.existingReplay}),onShare:()=>L({view:null,session:e.existingReplay,v:`export`}),onTitleSave:we,onRegenerate:()=>le(e.slug),isRegenerating:ie===e.slug,onDelete:()=>De(e.slug),onArchive:()=>B(e.slug),isArchived:n},`${e.provider}-${e.slug}`)}let r=ne(e,t),i=Vn(e,t,r),a=Hn(t?.gitBranch||e.gitBranch),o=ye(e.project),s=o!==e.project,c=t?.promptCount??e.promptCount,l=t?.toolCallCount??e.toolCallCount,u=t?.durationMs??e.durationMsEst,d=t?.editCount??e.editCountEst,f=t?.model||e.model,p=ge(e.hasSqlite,t?.dataSource),m=de.has(e.slug);return(0,V.jsxs)(`div`,{onClick:()=>le(e.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 ${m?`opacity-50`:``}`,children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,V.jsx)(`span`,{className:`text-sm font-mono text-terminal-text truncate block`,children:r}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,V.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer truncate`,children:[`slug: `,(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:e.slug})]}),a&&(0,V.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:[(0,V.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,V.jsx)(`circle`,{cx:`5`,cy:`4`,r:`2`}),(0,V.jsx)(`circle`,{cx:`11`,cy:`12`,r:`2`}),(0,V.jsx)(`path`,{d:`M5 6v4c0 1.1.9 2 2 2h2`})]}),a]}),s&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple shrink-0 uppercase tracking-wider`,title:`Agent worktree: ${e.project}`,children:`worktree`})]})]}),(0,V.jsxs)(`div`,{className:`flex flex-col items-end gap-1 shrink-0`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:k(e.timestamp)}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(`button`,{onClick:t=>{t.stopPropagation(),le(e.slug)},disabled:ie===e.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:ie===e.slug?(0,V.jsx)(`span`,{className:`animate-pulse`,children:`Generating...`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,V.jsx)(`path`,{d:`M8 2v12M2 8h12`})}),`Generate`]})}),(0,V.jsx)(Ln,{onArchive:()=>B(e.slug),isArchived:m})]})]})]}),i.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex gap-2 items-start`,children:[(0,V.jsx)(`span`,{className:`text-xs text-terminal-green shrink-0 mt-px select-none`,children:`>`}),(0,V.jsx)(`p`,{className:`text-sm text-terminal-dim line-clamp-1 leading-relaxed`,children:e})]},t)),(e.promptCount||l||u||d||e.hasPR||e.expiresInDays!=null&&e.expiresInDays<=7)&&(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[!!c&&(0,V.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:[c,` prompts`]}),!!l&&(0,V.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,` tools`]}),!!u&&(0,V.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:[`~`,Re(u)]}),!!d&&(0,V.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:[`~`,d,` edits`]}),e.hasPR&&(0,V.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`}),e.expiresInDays!=null&&e.expiresInDays<=7&&(0,V.jsx)(`span`,{className:`inline-flex items-center gap-1 text-xs font-mono px-1.5 py-0.5 rounded-md ${e.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 ${e.expiresInDays===0?`< 1 day`:`${e.expiresInDays} day${e.expiresInDays===1?``:`s`}`}. Generate a replay to preserve it.`,children:e.expiresInDays===0?`expires today`:`expires in ${e.expiresInDays}d`})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,V.jsx)(Fn,{provider:e.provider}),T===`__all__`&&(0,V.jsx)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim`,title:e.project,children:Me.get(o)||Me.get(e.project)||A(o)}),f&&(0,V.jsx)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer`,children:E(f)}),(0,V.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:O(e.fileSize)}),e.filePaths.length>1&&(0,V.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:[e.filePaths.length,` parts`]}),(e.hasSqlite||t?.dataSource)&&(0,V.jsx)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded-md ${Un(t?.dataSource,e.hasSqlite)}`,title:p,children:p})]})]},`${e.provider}-${e.slug}`)})})}),xe&&(0,V.jsx)(Wn,{session:xe,scanData:n[xe.slug]||null,onClose:()=>le(null),onGenerate:Ee,onViewReplay:e=>L({view:null,session:e}),onArchive:e=>{B(e)},onTitleSave:we,onDeleteReplay:De,isGenerating:ie===xe.slug,isArchived:de.has(xe.slug)})]})]})}function Yn(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(()=>Date.now()),[m,h]=(0,_.useState)(new Set),[g,v]=(0,_.useState)(null),[y,w]=(0,_.useState)(null),{selectedProject:T,filter:E,showArchived:D,handleProjectChange:O,handleFilterChange:j,handleToggleArchived:M}=Te(),{userInsights:N,projectInsightsCache:ee,fetchProjectInsights:P}=He(),F=ye(T);(0,_.useEffect)(()=>{F!==`__all__`&&P(F)},[F,P]);let I=F===`__all__`?void 0:ee.get(F);(0,_.useEffect)(()=>{let e=!0;return(async()=>{r(!0),s(!1),l(null);let n=await fetch(`/api/archived`).then(e=>e.ok?e.json():{slugs:[]}).catch(()=>({slugs:[]}));e&&h(new Set(n.slugs));let i=!1,o=b(await fetch(`/api/sessions/cached`).then(e=>e.ok?e.json():null).catch(()=>null)),c=x(o?.cachedAt);if(e&&o&&(i=!0,t(o.sessions),a(!0),d(o.cachedAt??null),(o.sessions.length>0||c)&&(l(c?null:o.cachedAt??null),r(!1),s(!c))),c){e&&(s(!1),r(!1));return}try{let n=await fetch(`/api/sessions`);if(!n.ok)throw Error(`Failed to load sessions`);let r=await n.json();if(!e)return;t(r),a(!0),d(new Date().toISOString()),l(null)}catch{if(!e)return;i||a(!1)}finally{e&&(s(!1),r(!1))}})(),()=>{e=!1}},[]),(0,_.useEffect)(()=>{let e=window.setInterval(()=>p(Date.now()),3e4);return()=>window.clearInterval(e)},[]);let te=e=>fe(e,m,h),ne=async(e,n)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:n})})).ok)throw Error(`Failed to update title`);t(t=>t.map(t=>t.slug===e?{...t,title:n||void 0}:t))},re=e=>{L({view:null,session:e})},R=async e=>{v(null);try{let n=await fetch(`/api/sessions/${encodeURIComponent(e)}`,{method:`DELETE`});if(!n.ok){v((await n.json().catch(()=>({}))).error||`Failed to delete session`);return}t(t=>t.filter(t=>t.slug!==e))}catch{v(`Failed to delete session`)}},z=async e=>{w(e.slug);try{let t=await fetch(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,sessionSlug:e.slug,sessionProject:e.project,sessionId:e.sessionId||void 0,title:e.title||void 0})}),n=await t.json();if(!t.ok)throw Error(n.error||`Regeneration failed`);L({view:null,session:n.slug})}catch(e){console.error(`Regenerate error:`,pe(e))}finally{w(null)}},ie=e.filter(e=>m.has(e.slug)).length,ae=D?e:e.filter(e=>!m.has(e.slug)),oe=new Map;for(let e of ae){let t=ye(e.project);oe.has(t)||oe.set(t,[]),oe.get(t)?.push(e)}let se=[...oe.entries()].sort((e,t)=>{let n=e[1][0]?.startTime||``;return(t[1][0]?.startTime||``).localeCompare(n)}),ce=he(se.map(([e])=>e)),le=F===`__all__`?ae:oe.get(F)||[],ue=E?le.filter(e=>(e.title||``).toLowerCase().includes(E.toLowerCase())||e.slug.toLowerCase().includes(E.toLowerCase())||e.project.toLowerCase().includes(E.toLowerCase())||e.provider.toLowerCase().includes(E.toLowerCase())||(e.firstMessage||``).toLowerCase().includes(E.toLowerCase())):le,de=u?C(u,f):null,me=n&&e.length===0;return!me&&(!i||e.length===0)?(0,V.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,V.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 py-6 space-y-6`,children:[(0,V.jsx)(qn,{}),i&&e.length===0&&(0,V.jsxs)(`div`,{className:`text-center py-12 space-y-2`,children:[(0,V.jsx)(`div`,{className:`text-terminal-dim font-mono text-sm`,children:`No replays yet`}),(0,V.jsx)(`div`,{className:`text-terminal-dimmer font-mono text-xs`,children:`Go to the Sessions tab to generate your first replay`})]}),!i&&(0,V.jsx)(`div`,{className:`text-center py-8 space-y-2`,children:(0,V.jsxs)(`div`,{className:`text-terminal-dimmer font-mono text-xs`,children:[`Or run `,(0,V.jsx)(`span`,{className:`text-terminal-green`,children:`npx vibe-replay`}),` to create a replay from your AI coding sessions`]})})]})}):(0,V.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,V.jsxs)(`div`,{className:`hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20`,children:[(0,V.jsx)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle`,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold`,children:`Projects`}),de&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:de})]})}),(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-2 space-y-0.5`,children:[(0,V.jsxs)(`button`,{onClick:()=>O(Se),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 ${T===`__all__`?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface`}`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:`All replays`}),(0,V.jsx)(`span`,{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${T===`__all__`?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer`}`,children:ae.length})]}),(0,V.jsx)(`div`,{className:`h-px bg-terminal-border-subtle mx-2 my-1.5`}),se.map(([e,t])=>{let n=F===e,r=ce.get(e)||A(e),i=t.filter(e=>e.gist?.gistId).length;return(0,V.jsxs)(`button`,{onClick:()=>O(e),title:e,className:`w-full text-left px-3 py-2.5 rounded-lg transition-all duration-200 ease-material group ${n?`bg-terminal-green-subtle shadow-layer-sm`:`hover:bg-terminal-surface`}`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-1.5`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono truncate ${n?`text-terminal-green font-medium`:`text-terminal-text group-hover:text-terminal-text`}`,children:r}),(0,V.jsx)(`span`,{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs shrink-0 ${n?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer`}`,children:t.length})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-1 ml-0.5`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono truncate ${n?`text-terminal-dim`:`text-terminal-dimmer`}`,children:k(t[0]?.startTime||``)}),i>0&&(0,V.jsxs)(`span`,{className:`text-xs font-mono ${n?`text-terminal-purple`:`text-terminal-dimmer`}`,children:[i,` published`]})]})]},e)})]})]}),(0,V.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-0 min-w-0`,children:[(0,V.jsx)(`div`,{className:`md:hidden px-3 pt-3`,children:(0,V.jsxs)(`select`,{value:T,onChange:e=>O(e.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:[(0,V.jsxs)(`option`,{value:Se,children:[`All replays (`,ae.length,`)`]}),se.map(([e,t])=>(0,V.jsxs)(`option`,{value:e,children:[ce.get(e)||A(e),` (`,t.length,`)`]},e))]})}),(0,V.jsxs)(`div`,{className:`px-4 pt-4 pb-2 space-y-3 shrink-0`,children:[(0,V.jsx)(`div`,{className:`hidden md:block`,children:I&&T!==`__all__`?(0,V.jsx)(Ge,{insights:I,variant:`project`}):N&&T===`__all__`?(0,V.jsx)(Ge,{insights:N,variant:`all`}):(0,V.jsx)(We,{})}),(0,V.jsxs)(`div`,{className:`hidden md:flex items-center gap-2`,children:[(0,V.jsxs)(`div`,{className:`relative flex-1`,children:[(0,V.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:[(0,V.jsx)(`circle`,{cx:`7`,cy:`7`,r:`5`}),(0,V.jsx)(`path`,{d:`M11 11l3.5 3.5`})]}),(0,V.jsx)(`input`,{value:E,onChange:e=>j(e.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`})]}),ie>0&&(0,V.jsx)(`button`,{onClick:M,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${D?`bg-terminal-orange-subtle text-terminal-orange`:`bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,title:D?`Hide archived`:`View all (${ie} archived)`,children:D?`Active`:`View all`}),(0,V.jsx)(qn,{})]}),(0,V.jsxs)(`div`,{className:`md:hidden flex gap-2 items-center`,children:[(0,V.jsxs)(`div`,{className:`relative flex-1`,children:[(0,V.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:[(0,V.jsx)(`circle`,{cx:`7`,cy:`7`,r:`5`}),(0,V.jsx)(`path`,{d:`M11 11l3.5 3.5`})]}),(0,V.jsx)(`input`,{value:E,onChange:e=>j(e.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`})]}),ie>0&&(0,V.jsx)(`button`,{onClick:M,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${D?`bg-terminal-orange-subtle text-terminal-orange`:`bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,title:D?`Hide archived`:`View all (${ie} archived)`,children:D?`Active`:`View all`})]})]}),(me||o||c)&&(0,V.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:me?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,V.jsx)(`span`,{children:`FETCHING REPLAYS...`})]}):o?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,V.jsx)(`span`,{children:`SCANNING LATEST REPLAYS...`}),c&&(0,V.jsxs)(`span`,{className:`text-terminal-dim`,children:[`Showing stale cache (`,S(c),`)`]})]}):c?(0,V.jsxs)(`span`,{children:[`Showing stale cache (`,S(c),`)`]}):null}),g&&(0,V.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:[(0,V.jsx)(`span`,{children:g}),(0,V.jsx)(`button`,{onClick:()=>v(null),className:`ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors`,children:`×`})]}),(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:me?(0,V.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:`Fetching replays...`}):ue.length===0?(0,V.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:E?`No replays match your filter`:`No replays in this project`}):(0,V.jsx)(`div`,{className:`space-y-2.5 px-4 py-3`,children:ue.map(e=>{let t=m.has(e.slug);return(0,V.jsx)(Kn,{summary:e,onOpen:()=>re(e.slug),onShare:()=>L({view:null,session:e.slug,v:`export`}),onTitleSave:ne,onDelete:()=>R(e.slug),onRegenerate:()=>z(e),onArchive:()=>te(e.slug),isRegenerating:y===e.slug,isArchived:t},e.slug)})})})]})]})}function Xn(){let{scanStatus:e}=He(),t=!!e?.running,[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(!1),o=(0,_.useRef)(e);e&&(o.current=e);let s=o.current;if((0,_.useEffect)(()=>{if(t)a(!1),r(!0);else if(n){a(!0);let e=setTimeout(()=>{r(!1),a(!1)},300);return()=>clearTimeout(e)}},[t,n]),!n||!s)return null;let c=s.phase===`discovering`?`Discovering sessions...`:s.total>0?`Scanning ${s.scanned}/${s.total}`:`Preparing scan...`,l=s.total>0?Math.round(s.scanned/s.total*100):0;return(0,V.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 ${i?`opacity-0 translate-y-2`:`opacity-100 translate-y-0 animate-in fade-in slide-in-from-bottom-2 duration-300`}`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse shrink-0`}),(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:c}),s.total>0&&(0,V.jsx)(`div`,{className:`w-16 h-1 rounded-full bg-terminal-surface-2 overflow-hidden`,children:(0,V.jsx)(`div`,{className:`h-full bg-terminal-purple rounded-full transition-all duration-300`,style:{width:`${l}%`}})})]})}function Zn({headerLeft:e,headerRight:t}){let n=!!window.__VIBE_REPLAY_EDITOR__,r=(0,_.useCallback)(()=>{let e=new URLSearchParams(window.location.search).get(`tab`);return e===`home`||e===`sessions`||e===`replays`||e===`projects`||e===`insights`?e:n?`home`:`replays`},[n]),[i,a]=(0,_.useState)(r());(0,_.useEffect)(()=>{let e=()=>a(r());return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[r]),(0,_.useEffect)(()=>{let e=e=>{let t=e.detail?.slug;t&&(a(`sessions`),L({tab:`sessions`,selected:t,project:null,q:null,archived:null}))};return window.addEventListener(`vibe-open-session`,e),()=>window.removeEventListener(`vibe-open-session`,e)},[]);let o=e=>{a(e),L({tab:e,project:null,q:null,archived:null})},s=(e,t)=>(0,V.jsx)(`button`,{onClick:()=>o(e),className:`px-3.5 py-1.5 text-xs font-sans font-semibold rounded-lg transition-all duration-200 ease-material ${i===e?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text`}`,children:t},e);return(0,V.jsxs)(Ue,{children:[(0,V.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-0`,children:[n&&(0,V.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:[e,(0,V.jsxs)(`div`,{className:`inline-flex items-center rounded-xl bg-terminal-surface p-0.5 shadow-layer-sm shrink-0`,children:[s(`home`,`Home`),s(`sessions`,`Sessions`),s(`replays`,`Replays`),s(`projects`,`Projects`),s(`insights`,`Insights`)]}),(0,V.jsx)(`div`,{className:`flex-1`}),t]}),i===`home`&&n?(0,V.jsx)(Ft,{onNavigate:o}):i===`insights`&&n?(0,V.jsx)(Et,{}):i===`projects`&&n?(0,V.jsx)(Nn,{onNavigate:o}):i===`sessions`&&n?(0,V.jsx)(Jn,{}):(0,V.jsx)(Yn,{})]}),(0,V.jsx)(Xn,{})]})}function Qn(e,t,n,r){let i=new Date().toISOString(),a={id:r??crypto.randomUUID(),sceneIndex:t,body:n,author:`anonymous`,createdAt:i,updatedAt:i,resolved:!1};return[...e,a]}function $n(e,t,n){return e.map(e=>e.id===t?{...e,body:n,updatedAt:new Date().toISOString()}:e)}function er(e,t){return e.filter(e=>e.id!==t)}function tr(e){return new Set(e.map(e=>e.sceneIndex))}function nr(e){let t=new Map;for(let n of e)t.set(n.sceneIndex,(t.get(n.sceneIndex)||0)+1);return t}function rr(e,t){return JSON.stringify(e)!==JSON.stringify(t)}function ir(e){return e.map(e=>{let t=e.contextTokens||0,n=e.tokenUsage?.cacheReadTokens||0,r=e.tokenUsage?.cacheCreationTokens||0,i=e.tokenUsage?.inputTokens||0,a=n+r+i,o=!!e.tokenUsage&&t>0&&a>0;if(!o)return{cacheRead:0,uncached:0,cacheCreate:0,total:0,rawCr:n,rawSum:a,hasData:o};let s=t/a;return{cacheRead:n*s,uncached:i*s,cacheCreate:r*s,total:t,rawCr:n,rawSum:a,hasData:o}})}function ar(e){let t=0,n=0;for(let r of e)t+=r.rawCr,n+=r.rawSum;return n>0?t/n*100:0}function or(e){return e.rawSum>0?e.rawCr/e.rawSum*100:0}function sr(e){return e.type===`tool-call`&&!e.diff&&!e.bashOutput}function cr(e,t){let n=e[t];if(!sr(n))return t;let r=n.toolName,i=t;for(;i+1<e.length&&sr(e[i+1])&&e[i+1].toolName===r;)i++;return i}function lr(e,t){return(()=>{switch(e.type){case`user-prompt`:return 1200;case`thinking`:return 600;case`text-response`:{let t=e.content.length;return Math.max(800,Math.min(t/40,5)*600)}case`tool-call`:return e.diff?1200:e.bashOutput?900:400;case`compaction-summary`:return 800;case`context-injection`:return 600;default:return 800}})()/t}function ur(e){return e===`user-prompt`||e===`compaction-summary`||e===`context-injection`}function dr(e){let t=[];for(let n=0;n<e.length;n++)e[n].type===`user-prompt`&&t.push(n);return t}function fr(e,t){return e.find(e=>e>t)}function pr(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]<t)return e[n]}function mr(e,t,n){let r=t+1;if(r>=e.length)return-1;if(n.promptsOnly){for(;r<e.length&&!ur(e[r].type);)r++;return r>=e.length?-1:r}if(n.compactAssistant&&!ur(e[r].type)){let t=r;for(;t+1<e.length&&!ur(e[t+1].type);)t++;return t}return cr(e,r)}function hr(e,t,n){let r=Math.max(0,t-1);if(t<=0)return 0;if(n.promptsOnly){for(;r>0&&!ur(e[r].type);)r--;return r}if(n.compactAssistant){if(!ur(e[t].type)){let n=t;for(;n>0&&!ur(e[n-1].type);)n--;return Math.max(0,n-1)}return Math.max(0,t-1)}let i=e[r];if(i.type===`tool-call`&&!i.diff&&!i.bashOutput){let t=i.toolName;for(;r>0&&e[r-1].type===`tool-call`&&!e[r-1].diff&&!e[r-1].bashOutput&&e[r-1].toolName===t;)r--}return r}function gr(e){let t=new URLSearchParams(window.location.search).get(`session`);return t?`${e}${e.includes(`?`)?`&`:`?`}slug=${encodeURIComponent(t)}`:e}var _r=`vibe-replay-annotations-`;function vr(e){return _r+e}function yr(e,t=`embedded`){let n=e.meta.sessionId,r=t===`editor`,i=!!window.__VIBE_REPLAY_DATA__||r,[a,o]=(0,_.useState)(()=>{let t=e.annotations??[];if(r)return t;try{let e=localStorage.getItem(vr(n));if(e){let n=JSON.parse(e);if(n.length>0||t.length===0)return n}}catch{}return t}),[s,c]=(0,_.useState)(()=>e.annotations??[]),l=rr(a,s),u=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(r)return u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{fetch(gr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)}).then(e=>{e.ok&&c(a)}).catch(()=>{})},1e3),()=>{u.current&&clearTimeout(u.current)};try{localStorage.setItem(vr(n),JSON.stringify(a))}catch{}},[a,n,r]);let d=(0,_.useMemo)(()=>tr(a),[a]),f=(0,_.useMemo)(()=>nr(a),[a]),p=(0,_.useCallback)((e,t)=>{o(n=>Qn(n,e,t))},[]),m=(0,_.useCallback)((e,t)=>{o(n=>$n(n,e,t))},[]),h=(0,_.useCallback)(e=>{o(t=>er(t,e))},[]),g=(0,_.useCallback)(()=>{if(r)return;let t={...e,annotations:a},i=`window.__VIBE_REPLAY_DATA__ = ${JSON.stringify(t).replace(/<\//g,`<\\/`)};`,o=document.getElementById(`vibe-replay-data`);if(o){let e=o.textContent;o.textContent=i;let t=`<!DOCTYPE html>\n${document.documentElement.outerHTML}`;o.textContent=e,s(t)}else{let e=document.createElement(`script`);e.id=`vibe-replay-data`,e.textContent=i,document.head.appendChild(e);let t=`<!DOCTYPE html>\n${document.documentElement.outerHTML}`;document.head.removeChild(e),s(t)}function s(t){let n=new Blob([t],{type:`text/html`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${e.meta.slug||`replay`}.html`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}c(a);try{localStorage.removeItem(vr(n))}catch{}},[e,a,n,r]),v=(0,_.useCallback)(()=>{let t={...e,annotations:a},r=JSON.stringify(t,null,2),i=new Blob([r],{type:`application/json`}),o=URL.createObjectURL(i),s=document.createElement(`a`);s.href=o,s.download=`replay.json`,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(o),c(a);try{localStorage.removeItem(vr(n))}catch{}},[e,a,n]),[y,b]=(0,_.useState)(!1),x=r?async()=>{b(!0);try{await fetch(gr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});let e=await fetch(gr(`/api/publish/gist`),{method:`POST`}),t=await e.json();if(!e.ok)throw Error(t.error||`Server error: ${e.status}`);return c(a),t}finally{b(!1)}}:null,[S,C]=(0,_.useState)([]),[w,T]=(0,_.useState)(null),[E,D]=(0,_.useState)(!1),O=(0,_.useRef)(null),k=(0,_.useMemo)(()=>w&&S.find(e=>e.name===w)||null,[w,S]);(0,_.useEffect)(()=>{r&&fetch(gr(`/api/feedback/detect`)).then(e=>e.json()).then(e=>{if(!e.available)return;let t=Array.isArray(e.tools)?e.tools:e.tool?[e.tool]:[];C(t),T(e.defaultTool?.name||e.tool?.name||t[0]?.name||null)}).catch(()=>{})},[r]);let A=r&&w?async()=>{let e=new AbortController;O.current=e,D(!0);try{await fetch(gr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a),signal:e.signal});let t=await fetch(gr(`/api/feedback/generate`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({toolName:w}),signal:e.signal}),n=await t.json();if(!t.ok)throw Error(n.error||`AI Coach failed`);return o(n.annotations),c(n.annotations),{score:n.score,itemCount:n.itemCount}}finally{O.current=null,D(!1)}}:null,j=r?e=>{T(e)}:null,M=r?()=>{O.current&&O.current.abort()}:null,[N,ee]=(0,_.useState)(!1),P=r?async()=>{ee(!0);try{await fetch(gr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});let e=await fetch(gr(`/api/export/html`),{method:`POST`}),t=await e.json();if(!e.ok)throw Error(t.error||`Export failed: ${e.status}`);let{path:n}=t;return c(a),n}finally{ee(!1)}}:null,[F,I]=(0,_.useState)(!1);return{annotations:a,annotatedScenes:d,annotationCounts:f,add:p,update:m,remove:h,hasUnsaved:l,canSaveHtml:i,downloadHtml:g,downloadJson:v,publishGist:x,exportHtml:P,exportGithub:r?async()=>{I(!0);try{await fetch(gr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});let e=await fetch(gr(`/api/export/github`),{method:`POST`}),t=await e.json();if(!e.ok)throw Error(t.error||`Export failed: ${e.status}`);return c(a),t}finally{I(!1)}}:null,gistPublishing:y,htmlExporting:N,githubExporting:F,aiCoachTool:k,aiCoachTools:S,aiCoachToolName:w,setAiCoachToolName:j,runAiCoach:A,cancelAiCoach:M,aiCoachRunning:E}}var br={version:1,overlays:[]};function xr(e,t=`embedded`){let n=t===`editor`,[r,i]=(0,_.useState)(br),[a,o]=(0,_.useState)(new Set),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)([]),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(!1),v=(0,_.useRef)(null),y=(0,_.useRef)(null),b=(0,_.useRef)(!1);(0,_.useEffect)(()=>{n&&fetch(gr(`/api/overlays`)).then(e=>e.json()).then(e=>{e&&Array.isArray(e.overlays)&&i(e)}).catch(()=>{}).finally(()=>{b.current=!0})},[n]),(0,_.useEffect)(()=>()=>{v.current&&v.current.abort()},[]),(0,_.useEffect)(()=>{n&&fetch(gr(`/api/feedback/detect`)).then(e=>e.json()).then(e=>{if(!e.available)return;let t=Array.isArray(e.tools)?e.tools:e.tool?[e.tool]:[];u(t),f(e.defaultTool?.name||e.tool?.name||t[0]?.name||null)}).catch(()=>{})},[n]),(0,_.useEffect)(()=>{if(!(!n||!b.current))return y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{fetch(gr(`/api/overlays`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)}).catch(()=>{})},1e3),()=>{y.current&&clearTimeout(y.current)}},[r,n]);let x=(0,_.useCallback)(t=>{let n=e.scenes[t];if(!n||n.type!==`user-prompt`&&n.type!==`text-response`)return null;if(s||a.has(t))return n.content;let i=r.overlays.filter(e=>e.sceneIndex===t);return i.length===0?n.content:i.reduce((e,t)=>e.updatedAt>t.updatedAt?e:t).modifiedValue},[e.scenes,r,a,s]),S=(0,_.useMemo)(()=>{if(r.overlays.length===0||s)return e;let t=new Map;for(let e of r.overlays){let n=t.get(e.sceneIndex);n?n.push(e):t.set(e.sceneIndex,[e])}let n=new Map;for(let[e,r]of t){let t=r.reduce((e,t)=>e.updatedAt>t.updatedAt?e:t);n.set(e,t.modifiedValue)}return n.size===0?e:{...e,scenes:e.scenes.map((e,t)=>{if(a.has(t))return e;let r=n.get(t);return r&&(e.type===`user-prompt`||e.type===`text-response`)?{...e,content:r}:e})}},[e,r,a,s]),C=(0,_.useCallback)(e=>r.overlays.some(t=>t.sceneIndex===e),[r]),w=(0,_.useCallback)(e=>r.overlays.filter(t=>t.sceneIndex===e),[r]),T=(0,_.useCallback)(e=>{i(e)},[]),E=(0,_.useCallback)(e=>{i(t=>({...t,overlays:t.overlays.filter(t=>t.id!==e)}))},[]),D=(0,_.useCallback)(e=>{i(t=>({...t,overlays:t.overlays.filter(t=>t.sceneIndex!==e)}))},[]),O=(0,_.useCallback)(()=>{i(br)},[]),k=(0,_.useCallback)((e,t)=>{i(n=>({...n,overlays:n.overlays.map(n=>n.id===e?{...n,modifiedValue:t,source:{type:`manual`},updatedAt:new Date().toISOString()}:n)}))},[]),A=(0,_.useCallback)(e=>{o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),j=(0,_.useCallback)(()=>{c(e=>!e)},[]),M=(0,_.useMemo)(()=>n?e=>f(e):null,[n]),N=(0,_.useMemo)(()=>n?()=>{v.current&&v.current.abort()}:null,[n]),ee=(0,_.useMemo)(()=>n&&d?async e=>{let t=new AbortController;v.current=t,m(!0);try{let n=await fetch(gr(`/api/studio/translate`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({toolName:d,targetLang:e.targetLang,sourceLang:e.sourceLang}),signal:t.signal}),r=await n.json();if(!n.ok)throw Error(r.error||`Translation failed`);return r.overlays&&i(r.overlays),r.stats}finally{v.current=null,m(!1)}}:null,[n,d]),P=(0,_.useMemo)(()=>n&&d?async e=>{let t=new AbortController;v.current=t,g(!0);try{let n=await fetch(gr(`/api/studio/tone`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({toolName:d,style:e.style}),signal:t.signal}),r=await n.json();if(!n.ok)throw Error(r.error||`Tone adjustment failed`);return r.overlays&&i(r.overlays),r.stats}finally{v.current=null,g(!1)}}:null,[n,d]);return{overlays:r,effectiveSession:S,getEffectiveContent:x,hasOverlay:C,getOverlays:w,overlayCount:r.overlays.length,setOverlays:T,revertOverlay:E,revertSceneOverlays:D,revertAll:O,updateOverlay:k,showOriginal:a,toggleOriginal:A,showAllOriginals:s,toggleAllOriginals:j,studioTools:l,studioToolName:d,setStudioToolName:M,studioToolsAvailable:l.length>0,translating:p,toningDown:h,cancelStudio:N,runTranslate:ee,runTone:P}}function Sr(e){let t=e;if(!t)return!1;let n=t.tagName;if(n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t.isContentEditable)return!0;let r=t.getAttribute(`role`);return r===`textbox`||r===`combobox`}function Cr(e,t,n=!0){let[r,i]=(0,_.useState)(`idle`),[a,o]=(0,_.useState)(-1),[s,c]=(0,_.useState)(1),[l,u]=(0,_.useState)(0),d=(0,_.useRef)(null),f=(0,_.useRef)(r),p=(0,_.useRef)(a),m=(0,_.useRef)(s),h=(0,_.useRef)(t);f.current=r,p.current=a,m.current=s,h.current=t;let g=(0,_.useMemo)(()=>dr(e),[e]),v=(0,_.useCallback)(()=>{d.current&&=(clearTimeout(d.current),null)},[]),y=(0,_.useCallback)(()=>{if(f.current!==`playing`)return;let t=mr(e,p.current,h.current);if(t===-1){i(`ended`),o(e.length-1),u(e.length);return}o(t),u(t+1);let n=lr(e[t],m.current);d.current=setTimeout(y,n)},[e]),b=(0,_.useCallback)(()=>{e.length!==0&&(v(),f.current===`ended`&&(o(-1),u(0)),i(`playing`),d.current=setTimeout(()=>{if(f.current===`playing`)if(p.current<0){let t=cr(e,0);o(t),u(t+1);let n=lr(e[t],m.current);d.current=setTimeout(y,n)}else{let t=e[p.current];if(t){let e=lr(t,m.current)/2;d.current=setTimeout(y,e)}}},50))},[e,y,v]),x=(0,_.useCallback)(()=>{v(),i(`paused`)},[v]),S=(0,_.useCallback)(()=>{f.current===`playing`?x():b()},[b,x]),C=(0,_.useCallback)(t=>{v();let n=Math.max(0,Math.min(t,e.length-1));if(o(n),u(n+1),f.current===`playing`){let t=lr(e[n],m.current);d.current=setTimeout(y,t)}(f.current===`ended`||f.current===`idle`)&&i(`paused`)},[e,v,y]),w=(0,_.useCallback)(()=>{let e=fr(g,p.current);e!==void 0&&C(e)},[g,C]),T=(0,_.useCallback)(()=>{let e=pr(g,p.current);e!==void 0&&C(e)},[g,C]),E=(0,_.useCallback)(t=>{if(c(t),f.current===`playing`){v();let n=e[p.current];if(n){let e=lr(n,t);d.current=setTimeout(y,e)}}},[e,v,y]);return(0,_.useEffect)(()=>v,[v]),(0,_.useEffect)(()=>{if(!n)return;let t=t=>{if(!Sr(t.target))if(t.key===` `)t.preventDefault(),S();else if(t.key===`ArrowDown`||t.key===`j`){f.current===`playing`&&x(),t.preventDefault();let n=mr(e,p.current,h.current);n!==-1&&C(n)}else t.key===`ArrowUp`||t.key===`k`?(f.current===`playing`&&x(),t.preventDefault(),C(hr(e,p.current,h.current))):t.key===`ArrowLeft`||t.key===`h`?(t.preventDefault(),window.dispatchEvent(new CustomEvent(`vibe:toggle-expand`,{detail:{action:`collapse`}}))):t.key===`Escape`?f.current===`playing`&&(t.preventDefault(),x()):t.key===`ArrowRight`||t.key===`l`?(t.preventDefault(),window.dispatchEvent(new CustomEvent(`vibe:toggle-expand`,{detail:{action:`expand`}}))):t.key===`n`?(t.preventDefault(),w()):t.key===`p`?(t.preventDefault(),T()):t.key===`Home`?(t.preventDefault(),C(0)):(t.key===`End`||t.key===`e`)&&(t.preventDefault(),C(e.length-1))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[n,S,C,w,T,e,x]),{state:r,currentIndex:a,visibleCount:l,speed:s,play:b,pause:x,togglePlayPause:S,seekTo:C,changeSpeed:E,jumpToNextUserPrompt:w,jumpToPrevUserPrompt:T,userPromptIndices:g,totalScenes:e.length,computeNextIndex:(0,_.useCallback)(n=>mr(e,n,t),[e,t]),computePrevIndex:(0,_.useCallback)(n=>hr(e,n,t),[e,t])}}function wr(e){switch(e.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:e.hideThinking,collapseAllTools:e.collapseAllTools,promptsOnly:e.promptsOnly,compactAssistant:!1}}}var Tr=`vibe-replay-view-prefs`,Er={displayMode:`compact`,hideThinking:!1,collapseAllTools:!1,promptsOnly:!1};function Dr(){try{let e=localStorage.getItem(Tr);if(e){let t=JSON.parse(e);return t.displayMode?{...Er,...t}:{...Er,...t,displayMode:`compact`}}}catch{}return Er}function Or(){let[e,t]=(0,_.useState)(Dr);return{prefs:e,updatePref:(0,_.useCallback)((e,n)=>{t(t=>{let r={...t,[e]:n};return localStorage.setItem(Tr,JSON.stringify(r)),r})},[]),togglePref:(0,_.useCallback)(e=>{t(t=>{let n=t[e];if(typeof n!=`boolean`)return t;let r={...t,[e]:!n};return localStorage.setItem(Tr,JSON.stringify(r)),r})},[])}}function kr({size:e=14}){return(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,V.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 Ar({className:e=``}){return(0,V.jsxs)(`svg`,{className:`animate-spin h-3.5 w-3.5 ${e}`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,V.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,V.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 jr({toolName:e}){return e===`claude`?(0,V.jsxs)(`div`,{className:`mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1`,children:[(0,V.jsxs)(`p`,{children:[`Runs`,` `,(0,V.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.`]}),(0,V.jsxs)(`p`,{className:`text-terminal-dimmer`,children:[`Auth issues? Run`,` `,(0,V.jsx)(`code`,{className:`px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text`,children:`claude`}),` `,`in your terminal to re-login.`]})]}):e===`agent`?(0,V.jsxs)(`div`,{className:`mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1`,children:[(0,V.jsxs)(`p`,{children:[`Runs`,` `,(0,V.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.`]}),(0,V.jsxs)(`p`,{className:`text-terminal-dimmer`,children:[`Auth issues? Check Cursor IDE settings or run`,` `,(0,V.jsx)(`code`,{className:`px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text`,children:`agent`}),` `,`in your terminal.`]})]}):e===`opencode`?(0,V.jsxs)(`div`,{className:`mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1`,children:[(0,V.jsxs)(`p`,{children:[`Runs`,` `,(0,V.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.`]}),(0,V.jsxs)(`p`,{className:`text-terminal-dimmer`,children:[`Not working? Run`,` `,(0,V.jsx)(`code`,{className:`px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text`,children:`opencode`}),` `,`in your terminal to verify setup.`]})]}):(0,V.jsxs)(`p`,{className:`mt-2 text-xs font-mono text-terminal-dim leading-relaxed`,children:[`Runs `,(0,V.jsx)(`span`,{className:`text-terminal-text font-medium`,children:e}),` locally on your machine using your existing auth.`]})}var Mr=[`English`,`Chinese (Simplified)`,`Chinese (Traditional)`,`Japanese`,`Korean`,`Spanish`,`French`,`German`,`Portuguese`,`Russian`],Nr=[{value:`professional`,label:`Professional`},{value:`neutral`,label:`Neutral`},{value:`friendly`,label:`Friendly`}];function Pr({annotationActions:e,overlayActions:t}){let{studioTools:n,studioToolName:r,setStudioToolName:i,studioToolsAvailable:a,translating:o,toningDown:s,cancelStudio:c,runTranslate:l,runTone:u,overlayCount:d,revertAll:f}=t,{runAiCoach:p,aiCoachRunning:m,cancelAiCoach:h,aiCoachTools:g,aiCoachToolName:v,setAiCoachToolName:y}=e,b=!!p,x=e.annotations.some(e=>e.author===`vibe-feedback`),[S,C]=(0,_.useState)(`English`),[w,T]=(0,_.useState)(`professional`),[E,D]=(0,_.useState)(null),[O,k]=(0,_.useState)(null),[A,j]=(0,_.useState)(null),[M,N]=(0,_.useState)(null),ee=m||o||s,P=n.length>0?n:g,F=r||v,I=(0,_.useCallback)(async()=>{if(p){D(null),N(null);try{let e=await p();D({type:`success`,text:`Score ${e.score}/10 \u2014 ${e.itemCount} comment(s)`})}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;D({type:`error`,text:e instanceof Error?e.message:`AI Coach failed`})}}},[p]),te=(0,_.useCallback)(async()=>{if(l){k(null),N(null);try{let e=await l({targetLang:S});k({type:`success`,text:`${e.translated} message(s) translated, ${e.skipped} unchanged`})}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;k({type:`error`,text:e instanceof Error?e.message:`Translation failed`})}}},[l,S]),ne=(0,_.useCallback)(async()=>{if(u){j(null),N(null);try{let e=await u({style:w});j({type:`success`,text:`${e.adjusted} prompt(s) adjusted, ${e.skipped} unchanged`})}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;j({type:`error`,text:e instanceof Error?e.message:`Tone adjustment failed`})}}},[u,w]),re=e=>t.overlays.overlays.some(t=>t.source.type===e),L=e=>{if(e===`coach`&&x){N(`coach`);return}if(e===`translate`&&re(`translate`)){N(`translate`);return}if(e===`tone`&&re(`tone`)){N(`tone`);return}e===`coach`?I():e===`translate`?te():ne()};return!a&&g.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,V.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-terminal-border-subtle flex items-center gap-2`,children:[(0,V.jsx)(kr,{size:12}),(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest`,children:`AI Studio`})]}),(0,V.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center px-6 py-8 text-center`,children:[(0,V.jsx)(`div`,{className:`w-10 h-10 rounded-xl bg-terminal-surface flex items-center justify-center mb-3`,children:(0,V.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:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,V.jsx)(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`}),(0,V.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`})]})}),(0,V.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text mb-1`,children:`No AI tools detected`}),(0,V.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:`}),(0,V.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(e=>(0,V.jsxs)(`div`,{className:`px-3 py-2 rounded-lg bg-terminal-surface border border-terminal-border-subtle`,children:[(0,V.jsxs)(`div`,{className:`text-xs font-sans font-medium text-terminal-text flex items-center gap-1.5`,children:[e.name,e.rec&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-green-subtle text-terminal-green`,children:`recommended`})]}),(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim mt-0.5 break-all`,children:e.cmd})]},e.name))}),(0,V.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,`,` `,(0,V.jsx)(`span`,{className:`text-terminal-green font-medium`,children:`locally`}),` on your machine.`]})]})]}):(0,V.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,V.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-terminal-border-subtle flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(kr,{size:12}),(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest`,children:`AI Studio`})]}),d>0&&(0,V.jsxs)(`button`,{onClick:f,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 (`,d,`)`]})]}),(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,V.jsxs)(`div`,{className:`px-4 py-3 border-b border-terminal-border-subtle bg-terminal-surface/30`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim`,children:`Tool`}),P.length>1&&i?(0,V.jsx)(`select`,{value:F||``,onChange:e=>{i(e.target.value),y&&y(e.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:P.map(e=>(0,V.jsx)(`option`,{value:e.name,children:e.name},e.name))}):(0,V.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:F})]}),(0,V.jsx)(jr,{toolName:F})]}),(0,V.jsxs)(`div`,{className:`p-4 space-y-3`,children:[b&&(0,V.jsx)(Fr,{title:`AI Coach`,preview:(0,V.jsxs)(`div`,{className:`mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden`,children:[(0,V.jsx)(`div`,{className:`px-3 py-2.5 border-b border-terminal-border-subtle`,children:(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-green leading-relaxed`,children:`Fix the login bug users reported`})}),(0,V.jsxs)(`div`,{className:`px-3 py-2 flex items-start gap-2`,children:[(0,V.jsx)(`span`,{className:`text-xs shrink-0`,children:`💬`}),(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-blue leading-relaxed`,children:`Be specific — which file? what error?`})]}),(0,V.jsxs)(`div`,{className:`px-3 py-2 border-t border-terminal-border-subtle flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono font-semibold text-terminal-orange`,children:`6/10`}),(0,V.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:m,disabled:ee,status:E,buttonLabel:x?`Re-run Coach`:`Run Coach`,runningLabel:`Analyzing...`,onRun:()=>L(`coach`),onCancel:h||void 0,showRerunConfirm:M===`coach`,rerunWarning:`Existing AI feedback will be replaced.`,onConfirmRerun:()=>void I(),onCancelRerun:()=>N(null)}),l&&(0,V.jsx)(Fr,{title:`Translate`,preview:(0,V.jsxs)(`div`,{className:`mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`px-3 py-2.5 space-y-1`,children:[(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim line-through opacity-60`,children:`这个bug怎么修?`}),(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-green`,children:`How to fix this bug?`})]}),(0,V.jsxs)(`div`,{className:`px-3 py-2.5 border-t border-terminal-border-subtle space-y-1`,children:[(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim line-through opacity-60`,children:`已写入。以后用中文问我...`}),(0,V.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:o,disabled:ee,status:O,buttonLabel:re(`translate`)?`Re-translate`:`Translate All`,runningLabel:`Translating...`,onRun:()=>L(`translate`),onCancel:c||void 0,showRerunConfirm:M===`translate`,rerunWarning:`Existing translations will be replaced.`,onConfirmRerun:()=>void te(),onCancelRerun:()=>N(null),config:(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-2.5`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim shrink-0`,children:`Target`}),(0,V.jsx)(`select`,{value:S,onChange:e=>C(e.target.value),disabled:ee,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:Mr.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))})]})}),u&&(0,V.jsx)(Fr,{title:`Soften Tone`,preview:(0,V.jsxs)(`div`,{className:`mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`px-3 py-2.5 space-y-1`,children:[(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-red line-through opacity-60`,children:`this code is mass garbage, mass delete it`}),(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-green`,children:`Let's refactor this module for clarity`})]}),(0,V.jsxs)(`div`,{className:`px-3 py-2.5 border-t border-terminal-border-subtle space-y-1`,children:[(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-red line-through opacity-60`,children:`are you stupid? I said fix the auth`}),(0,V.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:s,disabled:ee,status:A,buttonLabel:re(`tone`)?`Re-adjust`:`Soften All`,runningLabel:`Adjusting...`,onRun:()=>L(`tone`),onCancel:c||void 0,showRerunConfirm:M===`tone`,rerunWarning:`Existing tone adjustments will be replaced.`,onConfirmRerun:()=>void ne(),onCancelRerun:()=>N(null),config:(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-2.5`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim shrink-0`,children:`Style`}),(0,V.jsx)(`select`,{value:w,onChange:e=>T(e.target.value),disabled:ee,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:Nr.map(e=>(0,V.jsx)(`option`,{value:e.value,children:e.label},e.value))})]})})]})]})]})}function Fr({title:e,preview:t,description:n,running:r,disabled:i,status:a,buttonLabel:o,runningLabel:s,onRun:c,onCancel:l,showRerunConfirm:u,rerunWarning:d,onConfirmRerun:f,onCancelRerun:p,config:m}){return(0,V.jsxs)(`div`,{className:`rounded-xl border border-terminal-border-subtle bg-terminal-surface/30 overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,V.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text`,children:e}),t,n&&(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim mt-2 leading-relaxed`,children:n}),m,(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-3`,children:[(0,V.jsx)(`button`,{onClick:c,disabled:i,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:r?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Ar,{className:`text-terminal-purple`}),s]}):o}),r&&l&&(0,V.jsx)(`button`,{onClick:l,className:`text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`})]})]}),u&&!r&&(0,V.jsx)(`div`,{className:`px-4 pb-3`,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono`,children:[(0,V.jsx)(`span`,{className:`text-terminal-orange flex-1`,children:d}),(0,V.jsx)(`button`,{onClick:p,className:`text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`}),(0,V.jsx)(`button`,{onClick:f,className:`text-terminal-purple hover:text-terminal-text transition-colors font-medium`,children:`Continue`})]})}),a&&(0,V.jsx)(`div`,{className:`px-4 pb-3 text-xs font-mono ${a.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:a.text})]})}function Ir({open:e,onClose:t,annotationActions:n,overlayActions:r}){return(0,_.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&(e.preventDefault(),t())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),(0,V.jsxs)(`div`,{className:`fixed inset-0 z-50 hidden md:block transition-opacity duration-300 ${e?`opacity-100`:`opacity-0 pointer-events-none`}`,children:[(0,V.jsx)(`div`,{className:`absolute inset-0 bg-black/30`,onClick:t}),(0,V.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 ${e?`translate-x-0`:`translate-x-full`}`,onClick:e=>e.stopPropagation(),children:[(0,V.jsx)(`button`,{onClick:t,className:`absolute top-2 right-2 z-10 p-1 text-terminal-dim hover:text-terminal-text transition-colors`,title:`Close AI Studio`,children:`✕`}),(0,V.jsx)(Pr,{annotationActions:n,overlayActions:r})]})]})}function Lr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Rr=Lr();function zr(e){Rr=e}var Br={exec:()=>null};function W(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Hr.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Vr=(()=>{try{return!0}catch{return!1}})(),Hr={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:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Ur=/^(?:[ \t]*(?:\n|$))+/,Wr=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Gr=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Kr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,qr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Jr=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Yr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xr=W(Yr).replace(/bull/g,Jr).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(),Zr=W(Yr).replace(/bull/g,Jr).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(),Qr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$r=/^[^\n]+/,ei=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ti=W(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,ei).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ni=W(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Jr).getRegex(),ri=`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`,ii=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,ai=W(`^ {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`,ii).replace(`tag`,ri).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oi=W(Qr).replace(`hr`,Kr).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`,ri).getRegex(),si={blockquote:W(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,oi).getRegex(),code:Wr,def:ti,fences:Gr,heading:qr,hr:Kr,html:ai,lheading:Xr,list:ni,newline:Ur,paragraph:oi,table:Br,text:$r},ci=W(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Kr).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`,ri).getRegex(),li={...si,lheading:Zr,table:ci,paragraph:W(Qr).replace(`hr`,Kr).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,ci).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`,ri).getRegex()},ui={...si,html:W(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,ii).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:Br,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:W(Qr).replace(`hr`,Kr).replace(`heading`,` *#{1,6} *[^
|
|
26
|
+
]`).replace(`lheading`,Xr).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},di=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fi=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pi=/^( {2,}|\\)\n(?!\s*$)/,mi=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,hi=/[\p{P}\p{S}]/u,gi=/[\s\p{P}\p{S}]/u,_i=/[^\s\p{P}\p{S}]/u,vi=W(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,gi).getRegex(),yi=/(?!~)[\p{P}\p{S}]/u,bi=/(?!~)[\s\p{P}\p{S}]/u,xi=/(?:[^\s\p{P}\p{S}]|~)/u,Si=/(?![*_])[\p{P}\p{S}]/u,Ci=/(?![*_])[\s\p{P}\p{S}]/u,wi=/(?:[^\s\p{P}\p{S}]|[*_])/u,Ti=W(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Vr?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Ei=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Di=W(Ei,`u`).replace(/punct/g,hi).getRegex(),Oi=W(Ei,`u`).replace(/punct/g,yi).getRegex(),G=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,ki=W(G,`gu`).replace(/notPunctSpace/g,_i).replace(/punctSpace/g,gi).replace(/punct/g,hi).getRegex(),Ai=W(G,`gu`).replace(/notPunctSpace/g,xi).replace(/punctSpace/g,bi).replace(/punct/g,yi).getRegex(),ji=W(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,_i).replace(/punctSpace/g,gi).replace(/punct/g,hi).getRegex(),Mi=W(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,Si).getRegex(),Ni=W(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,wi).replace(/punctSpace/g,Ci).replace(/punct/g,Si).getRegex(),Pi=W(/\\(punct)/,`gu`).replace(/punct/g,hi).getRegex(),Fi=W(/^<(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(),Ii=W(ii).replace(`(?:-->|$)`,`-->`).getRegex(),Li=W(`^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`,Ii).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ri=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,zi=W(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,Ri).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Bi=W(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Ri).replace(`ref`,ei).getRegex(),Vi=W(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,ei).getRegex(),Hi=W(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Bi).replace(`nolink`,Vi).getRegex(),Ui=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Wi={_backpedal:Br,anyPunctuation:Pi,autolink:Fi,blockSkip:Ti,br:pi,code:fi,del:Br,delLDelim:Br,delRDelim:Br,emStrongLDelim:Di,emStrongRDelimAst:ki,emStrongRDelimUnd:ji,escape:di,link:zi,nolink:Vi,punctuation:vi,reflink:Bi,reflinkSearch:Hi,tag:Li,text:mi,url:Br},Gi={...Wi,link:W(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Ri).getRegex(),reflink:W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Ri).getRegex()},Ki={...Wi,emStrongRDelimAst:Ai,emStrongLDelim:Oi,delLDelim:Mi,delRDelim:Ni,url:W(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Ui).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:W(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Ui).getRegex()},qi={...Ki,br:W(pi).replace(`{2,}`,`*`).getRegex(),text:W(Ki.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Ji={normal:si,gfm:li,pedantic:ui},Yi={normal:Wi,gfm:Ki,breaks:qi,pedantic:Gi},Xi={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Zi=e=>Xi[e];function Qi(e,t){if(t){if(Hr.escapeTest.test(e))return e.replace(Hr.escapeReplace,Zi)}else if(Hr.escapeTestNoEncode.test(e))return e.replace(Hr.escapeReplaceNoEncode,Zi);return e}function $i(e){try{e=encodeURI(e).replace(Hr.percentDecode,`%`)}catch{return null}return e}function ea(e,t){let n=e.replace(Hr.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Hr.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(Hr.slashPipe,`|`);return n}function ta(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function na(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function ra(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function ia(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function aa(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
27
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
28
|
+
`)}var oa=class{options;rules;lexer;constructor(e){this.options=e||Rr}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:ta(e,`
|
|
29
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=aa(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=ta(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:ta(t[0],`
|
|
30
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=ta(t[0],`
|
|
73
31
|
`).split(`
|
|
74
|
-
`),
|
|
75
|
-
`),
|
|
76
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2
|
|
77
|
-
${
|
|
78
|
-
${
|
|
79
|
-
`+
|
|
80
|
-
`),
|
|
81
|
-
`+
|
|
82
|
-
`),
|
|
83
|
-
`);continue}}return{type
|
|
84
|
-
`,1)[0],
|
|
85
|
-
`,1)[0],
|
|
86
|
-
`,
|
|
87
|
-
`,1)[0]
|
|
88
|
-
|
|
89
|
-
`+
|
|
90
|
-
`,
|
|
91
|
-
`):[],
|
|
92
|
-
`?
|
|
93
|
-
`),this.blockTokens(
|
|
94
|
-
`:
|
|
95
|
-
`)
|
|
96
|
-
`)+
|
|
97
|
-
`+
|
|
98
|
-
`)
|
|
99
|
-
`)+
|
|
100
|
-
`+
|
|
101
|
-
`)
|
|
102
|
-
`)+
|
|
103
|
-
`+
|
|
104
|
-
`)
|
|
105
|
-
`)+
|
|
106
|
-
`+
|
|
107
|
-
`;return
|
|
108
|
-
|
|
109
|
-
`}blockquote({tokens:
|
|
110
|
-
${this.parser.parse(
|
|
111
|
-
`}html({text:
|
|
112
|
-
`}hr(
|
|
113
|
-
`}list(
|
|
114
|
-
`+
|
|
115
|
-
`}listitem(
|
|
116
|
-
`}checkbox({checked:
|
|
117
|
-
`}table(
|
|
32
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
33
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
34
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
35
|
+
${s}`:s,r=r?`${r}
|
|
36
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
37
|
+
`+e.join(`
|
|
38
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
39
|
+
`+e.join(`
|
|
40
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
41
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=ra(t[2].split(`
|
|
42
|
+
`,1)[0],t[1].length),l=e.split(`
|
|
43
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
44
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
45
|
+
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
46
|
+
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
47
|
+
`+l}u=!l.trim(),r+=p+`
|
|
48
|
+
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=ea(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
49
|
+
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(ea(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
50
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=ta(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=na(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),ia(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return ia(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},sa=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Rr,this.options.tokenizer=this.options.tokenizer||new oa,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 t={other:Hr,block:Ji.normal,inline:Yi.normal};this.options.pedantic?(t.block=Ji.pedantic,t.inline=Yi.pedantic):this.options.gfm&&(t.block=Ji.gfm,this.options.breaks?t.inline=Yi.breaks:t.inline=Yi.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ji,inline:Yi}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Hr.carriageReturn,`
|
|
51
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(Hr.tabCharGlobal,` `).replace(Hr.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
52
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
53
|
+
`)?``:`
|
|
54
|
+
`)+r.raw,n.text+=`
|
|
55
|
+
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
56
|
+
`)?``:`
|
|
57
|
+
`)+r.raw,n.text+=`
|
|
58
|
+
`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
|
|
59
|
+
`)?``:`
|
|
60
|
+
`)+r.raw,a.text+=`
|
|
61
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
62
|
+
`)?``:`
|
|
63
|
+
`)+r.raw,n.text+=`
|
|
64
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},ca=class{options;parser;constructor(e){this.options=e||Rr}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Hr.notSpaceStart)?.[0],i=e.replace(Hr.endingNewline,``)+`
|
|
65
|
+
`;return r?`<pre><code class="language-`+Qi(r)+`">`+(n?i:Qi(i,!0))+`</code></pre>
|
|
66
|
+
`:`<pre><code>`+(n?i:Qi(i,!0))+`</code></pre>
|
|
67
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
68
|
+
${this.parser.parse(e)}</blockquote>
|
|
69
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
70
|
+
`}hr(e){return`<hr>
|
|
71
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
72
|
+
`+r+`</`+i+`>
|
|
73
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
74
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
75
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
118
76
|
<thead>
|
|
119
|
-
`+
|
|
120
|
-
`+
|
|
121
|
-
`}tablerow({text:
|
|
122
|
-
${
|
|
123
|
-
`}tablecell(
|
|
124
|
-
`}strong({tokens:
|
|
125
|
-
Please report this to https://github.com/markedjs/marked.`,
|
|
126
|
-
`).find(
|
|
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 px(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 hx({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]?fx(r[H]):null,xe=H!==null&&r[H]?px(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(sv,{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 sv=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?fx(i):null,E=i?px(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:Vu(Fe.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 rv({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(hx,{actions:i,scenes:o,currentIndex:u,onSeek:m,addingForScene:p,onClearAddingTarget:g,readOnly:f})]})]})}const iv=[1,5,10];function ov({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:iv.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 cv(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=cv(l);return r?`${r.server} · ${r.tool}`:l}const hh=3,Ni=y.memo(function({content:r,isActive:i}){const[o,u]=y.useState(!1),m=r.split(`
|
|
128
|
-
`),
|
|
129
|
-
`):
|
|
130
|
-
`));var
|
|
131
|
-
`))&&(
|
|
132
|
-
`))&&(
|
|
133
|
-
`)&&(
|
|
134
|
-
`)&&(r=r.slice(0,-1))),On.prototype.equals.call(this,l,r,i)};function hv(l,r,i){return Ri.diff(l,r,i)}var xv=new On;xv.tokenize=function(l){return l.split(/(\S.+?[.!?])(?=\s+|$)/)};var gv=new On;gv.tokenize=function(l){return l.split(/([{}:;,]|\s+)/)};function Nu(l){"@babel/helpers - typeof";return Nu=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},Nu(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(Su(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 Su(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]=Su(l[m],r,i,o,u);return r.pop(),i.pop(),p}if(l&&l.toJSON&&(l=l.toJSON()),Nu(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]=Su(l[f],r,i,o,f);r.pop(),i.pop()}else p=l;return p}var ku=new On;ku.tokenize=function(l){return l.slice()};ku.join=ku.removeEmpty=function(l){return l};function gx(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=gx(l[r]))&&(o&&(o+=" "),o+=i)}else for(i in l)l[i]&&(o&&(o+=" "),o+=i);return o}function bx(){for(var l,r,i=0,o="",u=arguments.length;i<u;i++)(l=arguments[i])&&(r=gx(l))&&(o&&(o+=" "),o+=r);return o}var bv=Object.create,Mi=Object.defineProperty,yv=Object.defineProperties,vv=Object.getOwnPropertyDescriptor,jv=Object.getOwnPropertyDescriptors,yx=Object.getOwnPropertyNames,ki=Object.getOwnPropertySymbols,wv=Object.getPrototypeOf,Xu=Object.prototype.hasOwnProperty,vx=Object.prototype.propertyIsEnumerable,wh=(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={}))Xu.call(r,i)&&wh(l,i,r[i]);if(ki)for(var i of ki(r))vx.call(r,i)&&wh(l,i,r[i]);return l},Di=(l,r)=>yv(l,jv(r)),jx=(l,r)=>{var i={};for(var o in l)Xu.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&&vx.call(l,o)&&(i[o]=l[o]);return i},Nv=(l,r)=>function(){return r||(0,l[yx(l)[0]])((r={exports:{}}).exports,r),r.exports},Sv=(l,r)=>{for(var i in r)Mi(l,i,{get:r[i],enumerable:!0})},kv=(l,r,i,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of yx(r))!Xu.call(l,u)&&u!==i&&Mi(l,u,{get:()=>r[u],enumerable:!(o=vv(r,u))||o.enumerable});return l},Cv=(l,r,i)=>(i=l!=null?bv(wv(l)):{},kv(!l||!l.__esModule?Mi(i,"default",{value:l,enumerable:!0}):i,l)),Tv=Nv({"../../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 Y=new g(R,K?p.tokenize(V,K):V,oe,V);if(de=v(S,G,Y),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=Cv(Tv());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 Cu={};Sv(Cu,{dracula:()=>Av,duotoneDark:()=>Mv,duotoneLight:()=>_v,github:()=>Lv,gruvboxMaterialDark:()=>u1,gruvboxMaterialLight:()=>m1,jettwaveDark:()=>n1,jettwaveLight:()=>l1,nightOwl:()=>Bv,nightOwlLight:()=>Uv,oceanicNext:()=>Gv,okaidia:()=>Fv,oneDark:()=>r1,oneLight:()=>o1,palenight:()=>Zv,shadesOfPurple:()=>Qv,synthwave84:()=>Iv,ultramin:()=>Kv,vsDark:()=>wx,vsLight:()=>e1});var Ev={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)"}}]},Av=Ev,Rv={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"}}]},Mv=Rv,Dv={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"}}]},_v=Dv,Ov={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"}}]},Lv=Ov,zv={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)"}}]},Bv=zv,$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)"}}]},Uv=$v,sn={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},Hv={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}}]},Gv=Hv,qv={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=qv,Yv={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)"}}]},Zv=Yv,Vv={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=Vv,Xv={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"}}]},Iv=Xv,Jv={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)"}}]},Kv=Jv,Pv={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)"}}]},wx=Pv,Wv={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)"}}]},e1=Wv,t1={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"}}]},n1=t1,a1={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"}}]},l1=a1,s1={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%)"}}]},r1=s1,i1={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%)"}}]},o1=i1,c1={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"}}]},u1=c1,d1={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"}}]},m1=d1,f1=l=>y.useCallback(r=>{var i=r,{className:o,style:u,line:m}=i,p=jx(i,["className","style","line"]);const g=Di(_n({},p),{className:bx("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]),p1=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=jx(o,["token","className","style"]);const f=Di(_n({},g),{className:bx("token",...u.types,m),children:u.content,style:r(u)});return p!=null&&(f.style=_n(_n({},f.style||{}),p)),f},[r])},h1=/\r\n|\r|\n/,Nh=l=>{l.length===0?l.push({types:["plain"],content:`
|
|
135
|
-
`,empty:!0}):
|
|
136
|
-
`,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
(**
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
* @license MIT <https://opensource.org/licenses/MIT>
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
`).map(u=>({type:"add",content:u}));const i=hv(l,r),o=[];for(const u of i){const m=u.value.replace(/\n$/,"").split(`
|
|
149
|
-
`),
|
|
150
|
-
`),
|
|
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
|
-
|
|
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 L1({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(B1,{forceRender:E>=w-15&&E<=w+5,children:[S.has(E)&&n.jsx(z1,{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 z1({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 B1=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(U1,{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(H1,{scenes:A,currentIndex:i,collapseTools:u.collapseAllTools,annotationCounts:g,onComment:f,overlayActions:x})})]})});function U1({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(xx,{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 H1({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(G1,{batch:f,toolName:x,currentIndex:r,collapseTools:i,annotationCounts:o,onComment:u},f[0].index)})})}function G1({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"?q1(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 q1(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(O1,{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(uv,{content:r.content,isActive:i});case"text-response":return n.jsxs(n.Fragment,{children:[n.jsx(xx,{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(R1,{scene:r,isActive:i,forceCollapse:o})}}),F1=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 Ch({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 Ys({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 iu({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 Y1({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),[Y,me]=y.useState(null),[be,Qe]=y.useState(null),[lt,Ct]=y.useState(null),[Ye,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]),Ft=y.useCallback(()=>{ve("/api/cloud-replays").then(ie=>ie.json()).then(ie=>{G(ie.storage?.used??null),me(ie.storage?.limit??null)}).catch(()=>{})},[ve]),Yt=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(()=>{}),Ft()}catch(wt){He({type:"error",text:wt instanceof Error?wt.message:String(wt)})}finally{it(null)}},[K,be,lt,J,U,ve,Ft]),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 Vu(Fe.parse(ie))},[K?.markdown]),zn=y.useMemo(()=>K?.svgContent?lv(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(Ch,{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&&Y!=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(Y)," total"]})]}),(()=>{const ie=he/Y*100,ke=!J&&ce>0,He=ke?ce/Y*100:0,wt=ke&&he+ce>Y;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(Ys,{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(Ys,{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(Ch,{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(iu,{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(Ys,{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:()=>Yt("gif"),disabled:Ye==="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:Ye==="gif"?"Uploading...":be?"Update link":"Share to Cloud"}),Bt&&Ye===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"," ",F1," 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(iu,{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(Ys,{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:()=>Yt("svg"),disabled:Ye==="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:Ye==="svg"?"Uploading...":lt?"Update link":"Share to Cloud"}),qt&&Ye===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(Ys,{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(iu,{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 Z1=[{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 V1({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:Z1.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 X1({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 Th({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 I1(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 J1(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 K1={"user-prompt":"User","compaction-summary":"Compaction","context-injection":"Injection",thinking:"Thinking","text-response":"Response","tool-call":"Tool"},P1={"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 W1({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=I1(k);if(E.toLowerCase().includes(j)&&w.push({sceneIndex:S,type:k.type,snippet:J1(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 ${P1[j.type]||"text-terminal-dim"}`,children:j.toolName||K1[j.type]||j.type}),n.jsx("span",{className:"text-xs font-mono text-terminal-text line-clamp-2 break-words",children:ej(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 ej(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 tj(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 nj(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 Nx(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 aj(l,r){const i=Nx(l,r);if(i)return i.length>1?`${i[0]} → ${i[i.length-1]}`:i[0]}function lj(l,r){return Nx(l,r)?.join(" → ")}function Sx(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 sj({session:l}){const{meta:r,scenes:i}=l,o=y.useMemo(()=>Gh(r),[r]),u=y.useMemo(()=>t0(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=tj(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:lj(r.gitBranch,r.gitBranches),children:aj(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:nj(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(ij,{turnStats:r.stats.turnStats,costEstimate:r.stats.costEstimate,turnLabels:g}),n.jsx(cj,{turnStats:r.stats.turnStats,turnLabels:g}),m.turns.length>=2&&n.jsx(mj,{turns:m.turns,turnLabels:g}),r.stats.turnStats.some(f=>f.durationMs)&&n.jsx(uj,{turnStats:r.stats.turnStats,turnLabels:g})]}),r.tokenUsageByModel&&Object.keys(r.tokenUsageByModel).length>1&&n.jsx(dj,{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(pj,{turns:m.turns,turnStats:r.stats.turnStats}),n.jsx(fj,{editedFiles:m.editedFiles,turns:m.turns}),(m.editedFiles.length>0||m.readOnlyFiles.length>0)&&n.jsx(xj,{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(rj,{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 Eh={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 rj({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=Eh[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] ${Eh[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 ij({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}=Sx(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(oj,{turnStats:l})]})}function oj({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 cj({turnStats:l,turnLabels:r}){const i=l.map(S=>S.contextTokens||0),o=i.length,{hovered:u,ref:m,onMouseMove:p,onMouseLeave:g}=Sx(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 uj({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 dj({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 mj({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 fj({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 ou=20;function pj({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>ou,C=v&&!i?u.slice(0,ou):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(hj,{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-ou} more)`})})})})]})})]})}function hj({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 cu=20;function xj({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>cu,v=h&&!i?u.slice(0,cu):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-cu} more)`})})})})]})})]})}function gj(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 bj({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:gj(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 yj=[{key:"replay",label:"Replay"},{key:"summary",label:"Insights"},{key:"export",label:"Share & Export"}],kx="vr-insights-seen";function vj(){try{return localStorage.getItem(kx)==="1"}catch{return!1}}function jj(){try{localStorage.setItem(kx,"1")}catch{}}function wj({activeView:l,onChangeView:r,className:i="",rightContent:o,hiddenTabs:u}){const[m,p]=y.useState(()=>vj()||l==="summary"),g=y.useCallback(f=>{f==="summary"&&!m&&(jj(),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:yj.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 Nj(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 Sj({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=ey(l,i),R=ty(l,i),{effectiveSession:O}=R,{annotations:$}=A,H=ly(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}=ay(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),Y=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,Ye=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(Ye),100)},[te,pe,Ye]),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(Ye),100)))},[r.displayMode,g,pe,Ye]);const[qt,Cn]=y.useState(()=>new URLSearchParams(window.location.search).get("s")!==null);y.useEffect(()=>{!g&&o!=="replay"&&!qt&&(f(!0),setTimeout(()=>pe(Ye),100))},[o,g,Ye,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),Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>h(void 0),2500),pe(fe)},[xe,pe,l.scenes.length]);y.useEffect(()=>{!g&&qt&&(f(!0),setTimeout(()=>ze(Ye),100))},[g,qt,Ye,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 Ft=null,Yt=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<Yt&&(Yt=$t,Ft=rn)}}return Ft},et=()=>{if(_e)return;const Oe=Be(ce);if(Oe){st.current=!0;const Ue=fe.getBoundingClientRect(),Yt=Oe.getBoundingClientRect().top-Ue.top+fe.scrollTop-Ue.height*.3;fe.scrollTo({top:Math.max(0,Yt),behavior:"smooth"}),Nj(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(()=>()=>{Y.current&&clearTimeout(Y.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(X1,{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(wj,{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(Th,{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(L1,{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(W1,{scenes:O.scenes,open:V,onClose:()=>J(!1),onSeek:ce=>{ze(ce),J(!1)}})]})]}),o==="summary"&&n.jsx(sj,{session:O}),o==="export"&&n.jsx(Y1,{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(bj,{scenes:l.scenes,currentIndex:ae,onSeek:ze,annotatedScenes:A.annotatedScenes}),n.jsx(ov,{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(rv,{open:v,onClose:()=>C(!1),actions:A,scenes:O.scenes,currentIndex:ae,onSeek:ze,addingForScene:S,onClearAddingTarget:()=>k(null),readOnly:p}),n.jsx(my,{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(Th,{scenes:l.scenes,currentIndex:ae,onSeek:ce=>{ze(ce),he(!1)},overlayActions:R,turnStats:l.meta.stats.turnStats}):n.jsx(hx,{actions:A,scenes:O.scenes,currentIndex:ae,onSeek:ce=>{ze(ce)},addingForScene:S,onClearAddingTarget:()=>k(null),readOnly:p})})]})]}),n.jsx(V1,{open:be,onClose:()=>Qe(!1)})]})}function kj(){const[l,r]=y.useState({status:"loading"}),i=y.useCallback(()=>{r({status:"loading"}),Tj().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 Cj(){return!!window.__VIBE_REPLAY_EDITOR__}async function Tj(){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 Ah(g.gistId);return{session:await uu(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 Ah(i),g=await uu(m);return fetch(`https://vibe-replay.com/api/cloud-replays/view-gist/${i}`,{method:"POST"}).catch(()=>{}),{session:g,mode:"readonly",gistOwner:p}}if(Cj()){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 uu(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 uu(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 Ah(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 Ej(){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 Rh(){const r=new URLSearchParams(window.location.search).get("v");return r==="summary"||r==="export"?r:"replay"}const Zs="https://vibe-replay.com";function Mh({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 du(){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 Aj(){const l=kj(),{theme:r,toggleTheme:i}=Ej(),{prefs:o,updatePref:u,togglePref:m}=ry(),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(Rh()),C=y.useRef(null);y.useEffect(()=>{const $=()=>v(Rh());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(Ru(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(F0,{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.6
|
|
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(du,{}),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(Mh,{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.6
|
|
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(du,{}),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(Mh,{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(du,{})]})]})})]}),S&&n.jsx("div",{className:"md:hidden fixed inset-0 z-30 bg-black/30",onClick:()=>k(!1)}),n.jsx(Sj,{session:p,viewPrefs:o,viewerMode:g,activeView:h,setActiveView:j,returnToLandingRef:C})]})}Qb.createRoot(document.getElementById("root")).render(n.jsx(Hb.StrictMode,{children:n.jsx(Aj,{})}));</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-32{height:8rem}.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>
|
|
77
|
+
`+t+`</thead>
|
|
78
|
+
`+r+`</table>
|
|
79
|
+
`}tablerow({text:e}){return`<tr>
|
|
80
|
+
${e}</tr>
|
|
81
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
82
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Qi(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=$i(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+Qi(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=$i(e);if(i===null)return Qi(n);e=i;let a=`<img src="${e}" alt="${Qi(n)}"`;return t&&(a+=` title="${Qi(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Qi(e.text)}},la=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},ua=class e{options;renderer;textRenderer;constructor(e){this.options=e||Rr,this.options.renderer=this.options.renderer||new ca,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new la}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},da=class{options;block;constructor(e){this.options=e||Rr}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?sa.lex:sa.lexInline}provideParser(){return this.block?ua.parse:ua.parseInline}},fa=new class{defaults=Lr();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ua;Renderer=ca;TextRenderer=la;Lexer=sa;Tokenizer=oa;Hooks=da;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ca(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new oa(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new da;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];da.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&da.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return sa.lex(e,t??this.defaults)}parser(e,t){return ua.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(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 t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?sa.lex:sa.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?ua.parse:ua.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?sa.lex:sa.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?ua.parse:ua.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
83
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Qi(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function K(e,t){return fa.parse(e,t)}K.options=K.setOptions=function(e){return fa.setOptions(e),K.defaults=fa.defaults,zr(K.defaults),K},K.getDefaults=Lr,K.defaults=Rr,K.use=function(...e){return fa.use(...e),K.defaults=fa.defaults,zr(K.defaults),K},K.walkTokens=function(e,t){return fa.walkTokens(e,t)},K.parseInline=fa.parseInline,K.Parser=ua,K.parser=ua.parse,K.Renderer=ca,K.TextRenderer=la,K.Lexer=sa,K.lexer=sa.lex,K.Tokenizer=oa,K.Hooks=da,K.parse=K,K.options,K.setOptions,K.use,K.walkTokens,K.parseInline,ua.parse,sa.lex;var pa=new Set([`script`,`iframe`,`object`,`embed`,`style`,`link`,`meta`]),ma=new Set([`script`,`iframe`,`object`,`embed`,`link`,`meta`]);function ha(e){let t=new DOMParser().parseFromString(e,`text/html`);return _a(t.body,pa),t.body.innerHTML}function ga(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`).documentElement;return t.tagName===`parsererror`||t.querySelector(`parsererror`)?``:(_a(t,ma),new XMLSerializer().serializeToString(t))}function _a(e,t){let n=[];for(let r of e.childNodes)if(r.nodeType===Node.ELEMENT_NODE){let e=r,i=e.tagName.toLowerCase();if(t.has(i)){n.push(r);continue}for(let t of Array.from(e.attributes)){t.name.toLowerCase().startsWith(`on`)&&e.removeAttribute(t.name);let n=t.value.trim().toLowerCase();(n.startsWith(`javascript:`)||n.startsWith(`data:text/html`))&&e.removeAttribute(t.name)}_a(r,t)}for(let t of n)e.removeChild(t)}K.setOptions({breaks:!0,gfm:!0});function va(e){switch(e.type){case`user-prompt`:return{label:`You`,text:(e.content.split(`
|
|
84
|
+
`).find(e=>e.trim())||``).slice(0,100)};case`compaction-summary`:return{label:`Compaction`,text:e.content.slice(0,80)};case`context-injection`:return{label:`Injection`,text:e.content.slice(0,80)};case`thinking`:return{label:`Thinking`,text:e.content.slice(0,80)};case`text-response`:return{label:`Response`,text:(e.content.split(`
|
|
85
|
+
`).find(e=>e.trim())||``).slice(0,100)};case`tool-call`:return{label:e.toolName,text:e.diff?.filePath||e.bashOutput?.command||Object.values(e.input).filter(e=>typeof e==`string`).join(`, `).slice(0,80)||``}}}function ya(e){switch(e.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 ba({actions:e,scenes:t,currentIndex:n,onSeek:r,addingForScene:i,onClearAddingTarget:a,readOnly:o=!1}){let{annotations:s,add:c,update:l,remove:u}=e,[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(``),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(``),b=(0,_.useRef)(null),x=(0,_.useRef)(null),S=(0,_.useRef)(null),C=(0,_.useRef)(null),w=i??d;(0,_.useEffect)(()=>{i!==null&&(m(``),f(null),setTimeout(()=>{C.current?.scrollIntoView({behavior:`smooth`,block:`nearest`}),b.current?.focus()},50))},[i]),(0,_.useEffect)(()=>{w!==null&&b.current&&b.current.focus()},[w]),(0,_.useEffect)(()=>{h&&x.current&&x.current.focus()},[h]);let T=(0,_.useMemo)(()=>[...s].sort((e,t)=>e.sceneIndex-t.sceneIndex),[s]);(0,_.useEffect)(()=>{if(!S.current||w!==null)return;let e=S.current.querySelectorAll(`[data-annotation-scene]`),t=null,r=1/0;e.forEach(e=>{let i=Number(e.getAttribute(`data-annotation-scene`)),a=Math.abs(i-n);a<r&&(r=a,t=e)}),t&&r<=3&&t.scrollIntoView({behavior:`smooth`,block:`nearest`})},[n,w]);let E=(0,_.useCallback)(()=>{f(null),m(``),a()},[a]),D=(0,_.useCallback)(()=>{!p.trim()||w===null||(c(w,p.trim()),m(``),f(null),a())},[c,w,p,a]),O=(0,_.useCallback)(()=>{!h||!v.trim()||(l(h,v.trim()),g(null),y(``))},[h,v,l]),k=w!==null&&t[w]?va(t[w]):null,A=w!==null&&t[w]?ya(t[w]):``;return(0,V.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-terminal-border-subtle`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest`,children:`Comments`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o&&(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer uppercase px-1.5 py-0.5 rounded bg-terminal-surface`,children:`Read-only`}),(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim`,children:s.length})]})]}),(0,V.jsxs)(`div`,{ref:S,className:`flex-1 overflow-y-auto`,children:[T.length===0&&w===null&&(0,V.jsxs)(`div`,{className:`px-3 py-8 text-center`,children:[(0,V.jsx)(`div`,{className:`text-terminal-dim text-xs font-mono mb-2`,children:`No comments yet`}),!o&&(0,V.jsx)(`div`,{className:`text-terminal-dimmer text-xs font-mono`,children:`Hover over any message and click the comment icon to add one`})]}),T.map(e=>(0,V.jsx)(xa,{annotation:e,scene:t[e.sceneIndex],isCurrent:e.sceneIndex===n,isEditing:!o&&h===e.id,editBody:h===e.id?v:``,editTextareaRef:h===e.id?x:void 0,onSeek:()=>r(e.sceneIndex),onStartEdit:()=>{g(e.id),y(e.body)},onCancelEdit:()=>{g(null),y(``)},onSaveEdit:O,onEditBodyChange:y,onDelete:()=>u(e.id),readOnly:o},e.id)),!o&&w!==null&&(0,V.jsxs)(`div`,{ref:C,className:`px-3 py-2.5 border-b border-terminal-border-subtle bg-terminal-blue-subtle`,children:[k&&(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 mb-2`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono font-semibold uppercase ${A}`,children:k.label}),(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim truncate`,children:k.text})]}),(0,V.jsx)(`textarea`,{ref:b,value:p,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),D()),e.key===`Escape`&&E()},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}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between mt-1.5`,children:[(0,V.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:[`⌘`,`+Enter to save`]}),(0,V.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,V.jsx)(`button`,{onClick:E,className:`px-2 py-1 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`}),(0,V.jsx)(`button`,{onClick:D,disabled:!p.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`})]})]})]})]})]})}var xa=(0,_.memo)(function({annotation:e,scene:t,isCurrent:n,isEditing:r,editBody:i,editTextareaRef:a,onSeek:o,onStartEdit:s,onCancelEdit:c,onSaveEdit:l,onEditBodyChange:u,onDelete:d,readOnly:f=!1}){let[p,m]=(0,_.useState)(!1),h=t?va(t):null,g=t?ya(t):`text-terminal-dim`,v=(0,_.useMemo)(()=>{try{return new Date(e.createdAt).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}catch{return``}},[e.createdAt]),y=e.author===`vibe-feedback`;return(0,V.jsxs)(`div`,{"data-annotation-scene":e.sceneIndex,className:`px-3 py-2 border-b border-terminal-border-subtle transition-colors ${y?n?`bg-terminal-purple/10 border-l-2 border-l-terminal-purple`:`bg-terminal-purple/[0.03] hover:bg-terminal-purple/[0.06]`:n?`bg-terminal-blue/10 border-l-2 border-l-terminal-blue`:`hover:bg-terminal-surface/50`}`,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),children:[y&&(0,V.jsx)(`div`,{className:`flex items-center gap-1.5 mb-1`,children:(0,V.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`})}),(0,V.jsxs)(`button`,{onClick:o,className:`flex items-center gap-1.5 mb-1 w-full text-left group/ref`,children:[h&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-xs font-mono font-semibold uppercase shrink-0 ${g}`,children:h.label}),(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim truncate group-hover/ref:text-terminal-text transition-colors`,children:h.text})]}),!h&&(0,V.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dim`,children:[`Step `,e.sceneIndex+1]})]}),(0,V.jsxs)(`div`,{className:`flex items-start gap-1`,children:[(0,V.jsx)(`div`,{className:`flex-1 min-w-0`,children:r?(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`textarea`,{ref:a,value:i,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),l()),e.key===`Escape`&&c()},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}),(0,V.jsxs)(`div`,{className:`flex justify-end gap-1.5 mt-1`,children:[(0,V.jsx)(`button`,{onClick:c,className:`px-2 py-0.5 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`}),(0,V.jsx)(`button`,{onClick:l,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`})]})]}):(0,V.jsx)(`div`,{className:`prose-terminal text-xs text-terminal-text leading-relaxed`,dangerouslySetInnerHTML:{__html:ha(K.parse(e.body))}})}),!f&&p&&!r&&(0,V.jsxs)(`div`,{className:`flex gap-0.5 shrink-0 pt-0.5`,children:[(0,V.jsx)(`button`,{onClick:s,className:`p-0.5 text-xs text-terminal-dim hover:text-terminal-blue transition-colors`,title:`Edit`,children:`✎`}),(0,V.jsx)(`button`,{onClick:d,className:`p-0.5 text-xs text-terminal-dim hover:text-terminal-red transition-colors`,title:`Delete`,children:`✕`})]})]}),(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-dimmer mt-1`,children:v})]})});function Sa({open:e,onClose:t,actions:n,scenes:r,currentIndex:i,onSeek:a,addingForScene:o,onClearAddingTarget:s,readOnly:c}){return(0,_.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&(e.preventDefault(),t())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),(0,V.jsxs)(`div`,{className:`fixed inset-0 z-50 hidden md:block transition-opacity duration-300 ${e?`opacity-100`:`opacity-0 pointer-events-none`}`,children:[(0,V.jsx)(`div`,{className:`absolute inset-0 bg-black/30`,onClick:t}),(0,V.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 ${e?`translate-x-0`:`translate-x-full`}`,onClick:e=>e.stopPropagation(),children:[(0,V.jsx)(`button`,{onClick:t,className:`absolute top-2 right-2 z-10 p-1 text-terminal-dim hover:text-terminal-text transition-colors`,title:`Close comments`,children:`✕`}),(0,V.jsx)(ba,{actions:n,scenes:r,currentIndex:i,onSeek:a,addingForScene:o,onClearAddingTarget:s,readOnly:c})]})]})}var Ca=[1,5,10];function wa({state:e,speed:t,currentIndex:n,totalScenes:r,userPromptCount:i,currentTurn:a,onTogglePlayPause:o,onChangeSpeed:s,onPrevPrompt:c,onNextPrompt:l,onOpenSearch:u,onOpenOutline:d,onShowHelp:f}){let p=e===`playing`,m=p?`⏸`:`▶`,h=p?`Pause`:`Play`,[g,v]=(0,_.useState)(null),y=(0,_.useCallback)(e=>{v(e),setTimeout(()=>v(null),300)},[]),b=e=>g===e?`scale-105`:``,x=`px-2.5 py-1.5 text-xs font-sans rounded-lg transition-all duration-200 ease-material`,S=`w-10 h-10 flex items-center justify-center rounded-lg transition-all duration-200 ease-material`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`flex md:hidden items-center justify-between px-3 py-1.5`,children:[(0,V.jsx)(`button`,{onClick:()=>{y(`play`),o()},className:`${S} bg-terminal-green-subtle text-terminal-green ${b(`play`)}`,title:`Play/Pause`,children:(0,V.jsx)(`span`,{className:`text-base`,children:m})}),(0,V.jsx)(`button`,{onClick:()=>{y(`prev`),c()},className:`${S} bg-terminal-surface text-terminal-text ${b(`prev`)}`,title:`Previous turn`,children:(0,V.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,V.jsx)(`path`,{d:`M15 18l-6-6 6-6`})})}),(0,V.jsxs)(`span`,{className:`text-xs font-mono text-terminal-text tabular-nums font-medium`,children:[a,` / `,i]}),(0,V.jsx)(`button`,{onClick:()=>{y(`next`),l()},className:`${S} bg-terminal-surface text-terminal-text ${b(`next`)}`,title:`Next turn`,children:(0,V.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,V.jsx)(`path`,{d:`M9 18l6-6-6-6`})})}),(0,V.jsx)(`button`,{onClick:()=>{y(`search`),u()},className:`${S} bg-terminal-surface text-terminal-text ${b(`search`)}`,title:`Search`,children:(0,V.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,V.jsx)(`path`,{d:`m21 21-4.35-4.35`})]})}),d&&(0,V.jsx)(`button`,{onClick:()=>{y(`outline`),d()},className:`${S} bg-terminal-surface border border-terminal-border text-terminal-text ${b(`outline`)}`,title:`Outline`,children:`☰`})]}),(0,V.jsxs)(`div`,{className:`hidden md:flex items-center justify-between px-5 py-2.5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(`button`,{onClick:()=>{y(`play`),o()},className:`${x} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis font-medium ${b(`play`)}`,title:`Play/Pause (Space)`,children:[(0,V.jsx)(`span`,{children:m}),(0,V.jsx)(`span`,{className:`ml-1.5`,children:h})]}),(0,V.jsx)(`div`,{className:`flex items-center rounded-lg bg-terminal-surface overflow-hidden`,children:Ca.map(e=>(0,V.jsxs)(`button`,{onClick:()=>{y(`speed-${e}`),s(e)},className:`px-2.5 py-1.5 text-xs font-mono transition-all duration-200 ease-material ${t===e?`bg-terminal-green-subtle text-terminal-green font-medium`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`} ${b(`speed-${e}`)}`,children:[e,`x`]},e))}),(0,V.jsxs)(`div`,{className:`flex items-center`,children:[(0,V.jsx)(`button`,{onClick:()=>{y(`prev`),c()},className:`${x} text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover ${b(`prev`)}`,title:`Previous turn (p)`,children:`‹`}),(0,V.jsxs)(`span`,{className:`px-1.5 py-1.5 text-xs font-sans text-terminal-dim tabular-nums flex items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`font-mono`,children:a}),(0,V.jsx)(`span`,{children:`/`}),(0,V.jsx)(`span`,{className:`font-mono`,children:i})]}),(0,V.jsx)(`button`,{onClick:()=>{y(`next`),l()},className:`${x} text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover ${b(`next`)}`,title:`Next turn (n)`,children:`›`})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(`button`,{onClick:()=>{y(`search`),u()},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 ${b(`search`)}`,title:`Search (/ or Cmd+K)`,children:[(0,V.jsx)(`span`,{className:`text-sm opacity-70 group-hover/search:opacity-100 transition-opacity`,children:`🔍`}),(0,V.jsx)(`span`,{className:`text-[11px] font-sans font-medium text-terminal-dim group-hover/search:text-terminal-blue transition-colors`,children:`Type / to search`}),(0,V.jsx)(`div`,{className:`flex items-center gap-1 ml-1 opacity-40 group-hover/search:opacity-80 transition-opacity`,children:(0,V.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:`/`})})]}),f&&(0,V.jsxs)(`button`,{onClick:()=>{y(`help`),f()},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 ${b(`help`)}`,title:`Keyboard Shortcuts (?)`,children:[(0,V.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:(0,V.jsx)(`span`,{className:`text-[11px] font-mono font-black`,children:`?`})}),(0,V.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`})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 md:gap-3 text-xs text-terminal-dim font-mono shrink-0`,children:[e===`paused`&&(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-orange`,children:`Paused`}),(0,V.jsxs)(`span`,{className:`tabular-nums`,children:[Math.max(0,n+1),` / `,r]})]})]})]})]})}function Ta(e){if(!e.startsWith(`mcp__`))return null;let t=e.split(`__`);return t.length<3?null:{server:t[1],tool:t.slice(2).join(`__`)}}function Ea(e){let t=Ta(e);return t?`${t.server} · ${t.tool}`:e}var Da=3,Oa=(0,_.memo)(function({content:e,isActive:t}){let[n,r]=(0,_.useState)(!1),i=e.split(`
|
|
86
|
+
`),a=i.length>Da;(0,_.useEffect)(()=>{if(!t)return;let e=e=>{let t=e.detail;t.action===`expand`?r(!0):t.action===`collapse`&&r(!1)};return window.addEventListener(`vibe:toggle-expand`,e),()=>window.removeEventListener(`vibe:toggle-expand`,e)},[t]);let o=a&&!n?i.slice(0,Da).join(`
|
|
87
|
+
`):e;return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dimmer whitespace-pre-wrap leading-relaxed ${a&&!n?`max-h-[4.5em] overflow-hidden relative`:``}`,children:[o,a&&!n&&(0,V.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-8 bg-gradient-to-t from-terminal-surface to-transparent pointer-events-none`})]}),a&&(0,V.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),r(!n)},className:`mt-1 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors cursor-pointer`,children:n?`Show less`:`Show full summary (${i.length} lines)`})]})}),ka=600,Aa=(0,_.memo)(function({content:e,isActive:t}){let n=e.length>ka,[r,i]=(0,_.useState)(!1),a=n&&!r?`${e.slice(0,ka)}...`:e,o=(0,_.useMemo)(()=>ha(K.parse(a)),[a]);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`prose-terminal text-sm text-terminal-text ${t?`typing-cursor`:``} ${n&&!r?`max-h-[200px] overflow-hidden relative`:``}`,children:[(0,V.jsx)(`div`,{dangerouslySetInnerHTML:{__html:o}}),n&&!r&&(0,V.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-terminal-bg to-transparent`})]}),n&&(0,V.jsx)(`button`,{onClick:()=>i(!r),className:`mt-1 text-xs font-mono text-terminal-blue hover:text-terminal-text transition-colors`,children:r?`Show less`:`Show more (${e.length} chars)`})]})}),ja=(0,_.memo)(function({content:e,isActive:t,tokens:n}){let[r,i]=(0,_.useState)(!1),a=Be(n);return(0,V.jsxs)(`div`,{className:`ml-6`,children:[(0,V.jsxs)(`button`,{onClick:()=>i(!r),className:`flex items-center gap-2 text-xs text-terminal-dim hover:text-terminal-text transition-colors duration-200 ease-material font-mono`,children:[(0,V.jsx)(`span`,{className:`transition-transform ${r?`rotate-90`:``}`,children:`▶`}),(0,V.jsx)(`span`,{className:`text-terminal-purple ${t?`animate-pulse`:``}`,children:`Thinking`}),a?(0,V.jsxs)(`span`,{className:`text-terminal-purple/70 text-[10px]`,title:`Approximate thinking tokens (chars/4)`,children:[`~`,a,` tok`]}):(0,V.jsxs)(`span`,{className:`text-terminal-purple/70 text-[10px]`,children:[e.length,` chars`]})]}),r&&(0,V.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:e})]})});function Ma(){return(0,V.jsx)(`span`,{className:`text-[10px] font-mono font-bold px-1.5 py-0.5 rounded bg-red-500/20 text-red-400 border border-red-500/30 shrink-0`,title:`This tool call returned an error`,children:`ERROR`})}var Na=(0,_.memo)(function({command:e,stdout:t,isActive:n,durationMs:r,resultTokens:i,isError:a}){let[o,s]=(0,_.useState)(!0),c=t.trim().length>0,l=Be(i),u=ze(r);return(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl overflow-hidden shadow-layer-sm ${a?`ring-1 ring-red-500/40 border-l-2 border-l-red-500`:``}`,children:[(0,V.jsxs)(`button`,{onClick:()=>c&&s(!o),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 ${a?`bg-red-500/5`:``}`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono font-bold ${a?`text-red-400`:`text-terminal-orange`}`,children:`$`}),(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-text truncate flex-1`,children:e}),a&&(0,V.jsx)(Ma,{}),l&&(0,V.jsxs)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`~${l} tokens added to context`,children:[`~`,l,` tok`]}),u&&(0,V.jsx)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`Execution: ${u}`,children:u}),c&&(0,V.jsx)(`span`,{className:`text-xs text-terminal-dim transition-transform ${o?`rotate-90`:``}`,children:`▶`})]}),o&&c&&(0,V.jsx)(`div`,{className:`px-3 py-2 max-h-[300px] overflow-y-auto`,children:(0,V.jsx)(`pre`,{className:`text-xs font-mono text-terminal-dim whitespace-pre-wrap break-words`,children:t})})]})});function Pa(){}Pa.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={});var i=this;function a(e){return e=i.postProcess(e,n),r?(setTimeout(function(){r(e)},0),!0):e}e=this.castInput(e,n),t=this.castInput(t,n),e=this.removeEmpty(this.tokenize(e,n)),t=this.removeEmpty(this.tokenize(t,n));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength!=null&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0,n);if(f[0].oldPos+1>=s&&p+1>=o)return a(Fa(i,f[0].lastComponent,t,e,i.useLongestToken));var m=-1/0,h=1/0;function g(){for(var r=Math.max(m,-c);r<=Math.min(h,c);r+=2){var l=void 0,u=f[r-1],d=f[r+1];u&&(f[r-1]=void 0);var g=!1;if(d){var _=d.oldPos-r;g=d&&0<=_&&_<o}var v=u&&u.oldPos+1<s;if(!g&&!v){f[r]=void 0;continue}if(l=!v||g&&u.oldPos<d.oldPos?i.addToPath(d,!0,!1,0,n):i.addToPath(u,!1,!0,1,n),p=i.extractCommon(l,t,e,r,n),l.oldPos+1>=s&&p+1>=o)return a(Fa(i,l.lastComponent,t,e,i.useLongestToken));f[r]=l,l.oldPos+1>=s&&(h=Math.min(h,r-1)),p+1>=o&&(m=Math.max(m,r+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r,i){var a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}},extractCommon:function(e,t,n,r,i){for(var a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c},equals:function(e,t,n){return n.comparator?n.comparator(e,t):e===t||n.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return Array.from(e)},join:function(e){return e.join(``)},postProcess:function(e){return e}};function Fa(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(d.removed)d.value=e.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}}return a}new Pa;function Ia(e,t){var n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function La(e,t){var n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function Ra(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function za(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function Ba(e,t){return Ra(e,t,``)}function Va(e,t){return za(e,t,``)}function Ha(e,t){return t.slice(0,Ua(e,t))}function Ua(e,t){var n=0;e.length>t.length&&(n=e.length-t.length);var r=t.length;e.length<t.length&&(r=e.length);var i=Array(r),a=0;i[0]=0;for(var o=1;o<r;o++){for(t[o]==t[a]?i[o]=i[a]:i[o]=a;a>0&&t[o]!=t[a];)a=i[a];t[o]==t[a]&&a++}a=0;for(var s=n;s<e.length;s++){for(;a>0&&e[s]!=t[a];)a=i[a];e[s]==t[a]&&a++}return a}var Wa=`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}`,Ga=RegExp(`[${Wa}]+|\\s+|[^${Wa}]`,`ug`),Ka=new Pa;Ka.equals=function(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()},Ka.tokenize=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n;if(t.intlSegmenter){if(t.intlSegmenter.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=Array.from(t.intlSegmenter.segment(e),function(e){return e.segment})}else n=e.match(Ga)||[];var r=[],i=null;return n.forEach(function(e){/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r},Ka.join=function(e){return e.map(function(e,t){return t==0?e:e.replace(/^\s+/,``)}).join(``)},Ka.postProcess=function(e,t){if(!e||t.oneChangePerToken)return e;var n=null,r=null,i=null;return e.forEach(function(e){e.added?r=e:e.removed?i=e:((r||i)&&qa(n,i,r,e),n=e,r=null,i=null)}),(r||i)&&qa(n,i,r,null),e};function qa(e,t,n,r){if(t&&n){var i=t.value.match(/^\s*/)[0],a=t.value.match(/\s*$/)[0],o=n.value.match(/^\s*/)[0],s=n.value.match(/\s*$/)[0];if(e){var c=Ia(i,o);e.value=za(e.value,o,c),t.value=Ba(t.value,c),n.value=Ba(n.value,c)}if(r){var l=La(a,s);r.value=Ra(r.value,s,l),t.value=Va(t.value,l),n.value=Va(n.value,l)}}else if(n)e&&(n.value=n.value.replace(/^\s*/,``)),r&&(r.value=r.value.replace(/^\s*/,``));else if(e&&r){var u=r.value.match(/^\s*/)[0],d=t.value.match(/^\s*/)[0],f=t.value.match(/\s*$/)[0],p=Ia(u,d);t.value=Ba(t.value,p);var m=La(Ba(u,p),f);t.value=Va(t.value,m),r.value=Ra(r.value,u,m),e.value=za(e.value,u,u.slice(0,u.length-m.length))}else if(r){var h=r.value.match(/^\s*/)[0],g=t.value.match(/\s*$/)[0],_=Ha(g,h);t.value=Va(t.value,_)}else if(e){var v=e.value.match(/\s*$/)[0],y=t.value.match(/^\s*/)[0],b=Ha(v,y);t.value=Ba(t.value,b)}}var Ja=new Pa;Ja.tokenize=function(e){var t=RegExp(`(\\r?\\n)|[${Wa}]+|[^\\S\\n\\r]+|[^${Wa}]`,`ug`);return e.match(t)||[]};var Ya=new Pa;Ya.tokenize=function(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
88
|
+
`));var n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var i=0;i<r.length;i++){var a=r[i];i%2&&!t.newlineIsToken?n[n.length-1]+=a:n.push(a)}return n},Ya.equals=function(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
89
|
+
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
90
|
+
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
91
|
+
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
92
|
+
`)&&(t=t.slice(0,-1))),Pa.prototype.equals.call(this,e,t,n)};function Xa(e,t,n){return Ya.diff(e,t,n)}var Za=new Pa;Za.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Qa=new Pa;Qa.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function $a(e){"@babel/helpers - typeof";return $a=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},$a(e)}var eo=new Pa;eo.useLongestToken=!0,eo.tokenize=Ya.tokenize,eo.castInput=function(e,t){var n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(e,t){return t===void 0?n:t}:r;return typeof e==`string`?e:JSON.stringify(to(e,null,null,i),i,` `)},eo.equals=function(e,t,n){return Pa.prototype.equals.call(eo,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)};function to(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i,e));var a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];var o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=to(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),$a(e)===`object`&&e!==null){t.push(e),o={},n.push(o);var s=[],c;for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],o[c]=to(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var no=new Pa;no.tokenize=function(e){return e.slice()},no.join=no.removeEmpty=function(e){return e};function ro(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ro(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function io(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ro(e))&&(r&&(r+=` `),r+=t);return r}var ao=io,q=Object.create,J=Object.defineProperty,oo=Object.defineProperties,so=Object.getOwnPropertyDescriptor,co=Object.getOwnPropertyDescriptors,lo=Object.getOwnPropertyNames,uo=Object.getOwnPropertySymbols,fo=Object.getPrototypeOf,po=Object.prototype.hasOwnProperty,mo=Object.prototype.propertyIsEnumerable,ho=(e,t,n)=>t in e?J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,go=(e,t)=>{for(var n in t||={})po.call(t,n)&&ho(e,n,t[n]);if(uo)for(var n of uo(t))mo.call(t,n)&&ho(e,n,t[n]);return e},_o=(e,t)=>oo(e,co(t)),vo=(e,t)=>{var n={};for(var r in e)po.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&uo)for(var r of uo(e))t.indexOf(r)<0&&mo.call(e,r)&&(n[r]=e[r]);return n},yo=(e,t)=>function(){return t||(0,e[lo(e)[0]])((t={exports:{}}).exports,t),t.exports},bo=(e,t)=>{for(var n in t)J(e,n,{get:t[n],enumerable:!0})},xo=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of lo(t))!po.call(e,i)&&i!==n&&J(e,i,{get:()=>t[i],enumerable:!(r=so(t,i))||r.enumerable});return e},Y=((e,t,n)=>(n=e==null?{}:q(fo(e)),xo(t||!e||!e.__esModule?J(n,`default`,{value:e,enumerable:!0}):n,e)))(yo({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,`&`).replace(/</g,`<`).replace(/\u00a0/g,` `)},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,`__id`,{value:++t}),e.__id},clone:function e(t,n){n||={};var i,a;switch(r.util.type(t)){case`Object`:if(a=r.util.objId(t),n[a])return n[a];for(var o in i={},n[a]=i,t)t.hasOwnProperty(o)&&(i[o]=e(t[o],n));return i;case`Array`:return a=r.util.objId(t),n[a]?n[a]:(i=[],n[a]=i,t.forEach(function(t,r){i[r]=e(t,n)}),i);default:return t}},getLanguage:function(t){for(;t;){var n=e.exec(t.className);if(n)return n[1].toLowerCase();t=t.parentElement}return`none`},setLanguage:function(t,n){t.className=t.className.replace(RegExp(e,`gi`),``),t.classList.add(`language-`+n)},isActive:function(e,t,n){for(var r=`no-`+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:n,plaintext:n,text:n,txt:n,extend:function(e,t){var n=r.util.clone(r.languages[e]);for(var i in t)n[i]=t[i];return n},insertBefore:function(e,t,n,i){i||=r.languages;var a=i[e],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==t)for(var c in n)n.hasOwnProperty(c)&&(o[c]=n[c]);n.hasOwnProperty(s)||(o[s]=a[s])}var l=i[e];return i[e]=o,r.languages.DFS(r.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,i,a){a||={};var o=r.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],i||s);var c=t[s],l=r.util.type(c);l===`Object`&&!a[o(c)]?(a[o(c)]=!0,e(c,n,null,a)):l===`Array`&&!a[o(c)]&&(a[o(c)]=!0,e(c,n,s,a))}}},plugins:{},highlight:function(e,t,n){var a={code:e,grammar:t,language:n};if(r.hooks.run(`before-tokenize`,a),!a.grammar)throw Error(`The language "`+a.language+`" has no grammar.`);return a.tokens=r.tokenize(a.code,a.grammar),r.hooks.run(`after-tokenize`,a),i.stringify(r.util.encode(a.tokens),a.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new s;return c(i,i.head,e),o(e,i,t,i.head,0),u(i)},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(!(!n||!n.length))for(var i=0,a;a=n[i++];)a(t)}},Token:i};function i(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}i.stringify=function e(t,n){if(typeof t==`string`)return t;if(Array.isArray(t)){var i=``;return t.forEach(function(t){i+=e(t,n)}),i}var a={type:t.type,content:e(t.content,n),tag:`span`,classes:[`token`,t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(a.classes,o):a.classes.push(o)),r.hooks.run(`wrap`,a);var s=``;for(var c in a.attributes)s+=` `+c+`="`+(a.attributes[c]||``).replace(/"/g,`"`)+`"`;return`<`+a.tag+` class="`+a.classes.join(` `)+`"`+s+`>`+a.content+`</`+a.tag+`>`};function a(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function o(e,t,n,s,u,d){for(var f in n)if(!(!n.hasOwnProperty(f)||!n[f])){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+`,`+m)return;var h=p[m],g=h.inside,_=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var b=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,b+`g`)}for(var x=h.pattern||h,S=s.next,C=u;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var w=S.value;if(t.length>e.length)return;if(!(w instanceof i)){var T=1,E;if(v){if(E=a(x,C,e,_),!E||E.index>=e.length)break;var D=E.index,O=E.index+E[0].length,k=C;for(k+=S.value.length;D>=k;)S=S.next,k+=S.value.length;if(k-=S.value.length,C=k,S.value instanceof i)continue;for(var A=S;A!==t.tail&&(k<O||typeof A.value==`string`);A=A.next)T++,k+=A.value.length;T--,w=e.slice(C,k),E.index-=C}else if(E=a(x,0,w,_),!E)continue;var D=E.index,j=E[0],M=w.slice(0,D),N=w.slice(D+j.length),ee=C+w.length;d&&ee>d.reach&&(d.reach=ee);var P=S.prev;M&&(P=c(t,P,M),C+=M.length),l(t,P,T);var F=new i(f,g?r.tokenize(j,g):j,y,j);if(S=c(t,P,F),N&&c(t,S,N),T>1){var I={cause:f+`,`+m,reach:ee};o(e,t,n,S.prev,C,I),d&&I.reach>d.reach&&(d.reach=I.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function l(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function u(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}return r}();t.exports=n,n.default=n}})());Y.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]},Y.languages.markup.tag.inside[`attr-value`].inside.entity=Y.languages.markup.entity,Y.languages.markup.doctype.inside[`internal-subset`].inside=Y.languages.markup,Y.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&/,`&`))}),Object.defineProperty(Y.languages.markup.tag,`addInlined`,{value:function(e,t){var n={},n=(n[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Y.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),t=(n[`language-`+t]={pattern:/[\s\S]+/,inside:Y.languages[t]},{});t[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:n},Y.languages.insertBefore(`markup`,`cdata`,t)}}),Object.defineProperty(Y.languages.markup.tag,`addAttribute`,{value:function(e,t){Y.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:Y.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),Y.languages.html=Y.languages.markup,Y.languages.mathml=Y.languages.markup,Y.languages.svg=Y.languages.markup,Y.languages.xml=Y.languages.extend(`markup`,{}),Y.languages.ssml=Y.languages.xml,Y.languages.atom=Y.languages.xml,Y.languages.rss=Y.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:`escape`},n=/\\(?: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]|.)/,r=`(?:[^\\\\-]|`+n.source+`)`,r=RegExp(r+`-`+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:`variable`};e.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:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:`operator`}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:`class-name`},escape:n}},"special-escape":t,"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":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:`function`},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:`punctuation`,inside:{"group-name":i}},{pattern:/\)/,alias:`punctuation`}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:`number`},alternation:{pattern:/\|/,alias:`keyword`}}}(Y),Y.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:/[{}[\];(),.:]/},Y.languages.javascript=Y.languages.extend(`clike`,{"class-name":[Y.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$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Y.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Y.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:Y.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:Y.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Y.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Y.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:Y.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Y.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:Y.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`}}),Y.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),Y.languages.markup&&(Y.languages.markup.tag.addInlined(`script`,`javascript`),Y.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)`,`javascript`)),Y.languages.js=Y.languages.javascript,Y.languages.actionscript=Y.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:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),Y.languages.actionscript[`class-name`].alias=`function`,delete Y.languages.actionscript.parameter,delete Y.languages.actionscript[`literal-property`],Y.languages.markup&&Y.languages.insertBefore(`actionscript`,`string`,{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:Y.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:`variable`};e.languages.coffeescript=e.languages.extend(`javascript`,{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],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`}}),e.languages.insertBefore(`coffeescript`,`comment`,{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:`comment`},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:`regex`,inside:{comment:t,interpolation:n}}}),e.languages.insertBefore(`coffeescript`,`string`,{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:`punctuation`},script:{pattern:/[\s\S]+/,alias:`language-javascript`,inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:`string`},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:`string`,inside:{interpolation:n}}]}),e.languages.insertBefore(`coffeescript`,`keyword`,{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript[`template-string`],e.languages.coffee=e.languages.coffeescript}(Y),function(e){var t=e.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(t,`addSupport`,{value:function(t,n){(t=typeof t==`string`?[t]:t).forEach(function(t){var r=function(e){e.inside||={},e.inside.rest=n},i=`doc-comment`;if(a=e.languages[t]){var a,o=a[i];if((o||=(a=e.languages.insertBefore(t,`comment`,{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:`comment`}}))[i])instanceof RegExp&&(o=a[i]={pattern:o}),Array.isArray(o))for(var s=0,c=o.length;s<c;s++)o[s]instanceof RegExp&&(o[s]={pattern:o[s]}),r(o[s]);else r(o)}})}}),t.addSupport([`java`,`javascript`,`php`],t)}(Y),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),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\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,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:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined(`style`,`css`),t.tag.addAttribute(`style`,`css`))}(Y),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.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":[t,{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:/[(),]/}},e.languages.css.atrule.inside[`selector-function-argument`].inside=t,e.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}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.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:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(Y),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r=`(?:`+n.source+`(?:[ ]+`+t.source+`)?|`+t.source+`(?:[ ]+`+n.source+`)?)`,i=`(?:[^\\s\\x00-\\x08\\x0e-\\x1f!"#%&'*,\\-:>?@[\\]\`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \\t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*`.replace(/<PLAIN>/g,function(){return`[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]`}),a=`"(?:[^"\\\\\\r\\n]|\\\\.)*"|'(?:[^'\\\\\\r\\n]|\\\\.)*'`;function o(e,t){t=(t||``).replace(/m/g,``)+`m`;var n=`([:\\-,[{]\\s*(?:\\s<<prop>>[ \\t]+)?)(?:<<value>>)(?=[ \\t]*(?:$|,|\\]|\\}|(?:[\\r\\n]\\s*)?#))`.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return e});return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<<prop>>[ \\t]+)?[|>])[ \\t]*(?:((?:\\r?\\n|\\r)[ \\t]+)\\S[^\\r\\n]*(?:\\2[^\\r\\n]+)*)`.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:`string`},comment:/#.*/,key:{pattern:RegExp(`((?:^|[:\\-,[{\\r\\n?])[ \\t]*(?:<<prop>>[ \\t]+)?)<<key>>(?=\\s*:\\s)`.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return`(?:`+i+`|`+a+`)`})),lookbehind:!0,greedy:!0,alias:`atrule`},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:`important`},datetime:{pattern:o(`\\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*)?)?`),lookbehind:!0,alias:`number`},boolean:{pattern:o(`false|true`,`i`),lookbehind:!0,alias:`important`},null:{pattern:o(`null|~`,`i`),lookbehind:!0,alias:`important`},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(`[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)`,`i`),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Y),function(e){var t=`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`;function n(e){return e=e.replace(/<inner>/g,function(){return t}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var r="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",i=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return r}),a=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`,o=(e.languages.markdown=e.languages.extend(`markup`,{}),e.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:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+i+a+`(?:`+i+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+i+a+`)(?:`+i+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+i+`)`+a+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+i+`$`),inside:{"table-header":{pattern:RegExp(r),alias:`important`,inside:e.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:n(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(`(~~?)(?:(?!~)<inner>)+\\2`),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:n(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),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(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){e.language!==`markdown`&&e.language!==`md`||function e(t){if(t&&typeof t!=`string`)for(var n=0,r=t.length;n<r;n++){var i,a=t[n];a.type===`code`?(i=a.content[1],a=a.content[3],i&&a&&i.type===`code-language`&&a.type===`code-block`&&typeof i.content==`string`&&(i=i.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`),i=`language-`+(i=(/[a-z][\w-]*/i.exec(i)||[``])[0].toLowerCase()),a.alias?typeof a.alias==`string`?a.alias=[a.alias,i]:a.alias.push(i):a.alias=[i])):e(a.content)}}(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],a=/language-(.+)/.exec(a);if(a){n=a[1];break}}var l,u=e.languages[n];u?t.content=e.highlight(function(e){return e=e.replace(o,``),e=e.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(e,t){var n;return(t=t.toLowerCase())[0]===`#`?(n=t[1]===`x`?parseInt(t.slice(2),16):Number(t.slice(1)),c(n)):s[t]||e})}(t.content),u,n):n&&n!==`none`&&e.plugins.autoloader&&(l=`md-`+new Date().valueOf()+`-`+Math.floor(0x2386f26fc10000*Math.random()),t.attributes.id=l,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(l);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}),RegExp(e.languages.markup.tag.pattern.source,`gi`)),s={amp:`&`,lt:`<`,gt:`>`,quot:`"`},c=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Y),Y.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:Y.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+/},Y.hooks.add(`after-tokenize`,function(e){if(e.language===`graphql`)for(var t=e.tokens.filter(function(e){return typeof e!=`string`&&e.type!==`comment`&&e.type!==`scalar`}),n=0;n<t.length;){var r=t[n++];if(r.type===`keyword`&&r.content===`mutation`){var i=[];if(d([`definition-mutation`,`punctuation`])&&u(1).content===`(`){n+=2;var a=f(/^\($/,/^\)$/);if(a===-1)continue;for(;n<a;n++){var o=u(0);o.type===`variable`&&(p(o,`variable-input`),i.push(o.content))}n=a+1}if(d([`punctuation`,`property-query`])&&u(0).content===`{`&&(n++,p(u(0),`property-mutation`),0<i.length)){var s=f(/^\{$/,/^\}$/);if(s!==-1)for(var c=n;c<s;c++){var l=t[c];l.type===`variable`&&0<=i.indexOf(l.content)&&p(l,`variable-input`)}}}}function u(e){return t[n+e]}function d(e,t){t||=0;for(var n=0;n<e.length;n++){var r=u(n+t);if(!r||r.type!==e[n])return}return 1}function f(e,r){for(var i=1,a=n;a<t.length;a++){var o=t[a],s=o.content;if(o.type===`punctuation`&&typeof s==`string`){if(e.test(s))i++;else if(r.test(s)&&--i===0)return a}}return-1}function p(e,t){var n=e.alias;n?Array.isArray(n)||(e.alias=n=[n]):e.alias=n=[],n.push(t)}}),Y.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(e){var t=e.languages.javascript[`template-string`],n=t.pattern.source,r=t.inside.interpolation,i=r.inside[`interpolation-punctuation`],a=r.pattern.source;function o(t,r){if(e.languages[t])return{pattern:RegExp(`((?:`+r+`)\\s*)`+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function s(t,n,r){return t={code:t,grammar:n,language:r},e.hooks.run(`before-tokenize`,t),t.tokens=e.tokenize(t.code,t.grammar),e.hooks.run(`after-tokenize`,t),t.tokens}function c(t,n,o){var c=e.tokenize(t,{interpolation:{pattern:RegExp(a),lookbehind:!0}}),l=0,u={},c=s(c.map(function(e){if(typeof e==`string`)return e;for(var n,r,e=e.content;t.indexOf((r=l++,n=`___`+o.toUpperCase()+`_`+r+`___`))!==-1;);return u[n]=e,n}).join(``),n,o),d=Object.keys(u);return l=0,function t(n){for(var a=0;a<n.length;a++){if(l>=d.length)return;var o,c,f,p,m,h,g,_=n[a];typeof _==`string`||typeof _.content==`string`?(o=d[l],(g=(h=typeof _==`string`?_:_.content).indexOf(o))!==-1&&(++l,c=h.substring(0,g),m=u[o],f=void 0,(p={})[`interpolation-punctuation`]=i,(p=e.tokenize(m,p)).length===3&&((f=[1,1]).push.apply(f,s(p[1],e.languages.javascript,`javascript`)),p.splice.apply(p,f)),f=new e.Token(`interpolation`,p,r.alias,m),p=h.substring(g+o.length),m=[],c&&m.push(c),m.push(f),p&&(t(h=[p]),m.push.apply(m,h)),typeof _==`string`?(n.splice.apply(n,[a,1].concat(m)),a+=m.length-1):_.content=m)):(g=_.content,t(Array.isArray(g)?g:[g]))}}(c),new e.Token(o,c,`language-`+o,t)}e.languages.javascript[`template-string`]=[o(`css`,`\\b(?:styled(?:\\([^)]*\\))?(?:\\s*\\.\\s*\\w+(?:\\([^)]*\\))*)*|css(?:\\s*\\.\\s*(?:global|resolve))?|createGlobalStyle|keyframes)`),o(`html`,`\\bhtml|\\.\\s*(?:inner|outer)HTML\\s*\\+?=`),o(`svg`,`\\bsvg`),o(`markdown`,`\\b(?:markdown|md)`),o(`graphql`,`\\b(?:gql|graphql(?:\\s*\\.\\s*experimental)?)`),o(`sql`,`\\bsql`),t].filter(Boolean);var l={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function u(e){return typeof e==`string`?e:Array.isArray(e)?e.map(u).join(``):u(e.content)}e.hooks.add(`after-tokenize`,function(t){t.language in l&&function t(n){for(var r=0,i=n.length;r<i;r++){var a,o,s,l=n[r];typeof l!=`string`&&(a=l.content,Array.isArray(a)?l.type===`template-string`?(l=a[1],a.length===3&&typeof l!=`string`&&l.type===`embedded-code`&&(o=u(l),l=l.alias,l=Array.isArray(l)?l[0]:l,s=e.languages[l])&&(a[1]=c(o,s,l))):t(a):typeof a!=`string`&&t([a]))}}(t.tokens)})}(Y),function(e){e.languages.typescript=e.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/}),e.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 e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.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:t}}}}),e.languages.ts=e.languages.typescript}(Y),function(e){var t=e.languages.javascript,n=`\\{(?:[^{}]|\\{(?:[^{}]|\\{[^{}]*\\})*\\})+\\}`,r=`(@(?:arg|argument|param|property)\\s+(?:`+n+`\\s+)?)`;e.languages.jsdoc=e.languages.extend(`javadoclike`,{parameter:{pattern:RegExp(r+`(?:(?!\\s)[$\\w\\xA0-\\uFFFF.])+(?=\\s|$)`),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore(`jsdoc`,`keyword`,{"optional-parameter":{pattern:RegExp(r+`\\[(?:(?!\\s)[$\\w\\xA0-\\uFFFF.])+(?:=[^[\\]]+)?\\](?=\\s|$)`),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,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*)*`.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp(`(@[a-z]+\\s+)`+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.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:t,alias:`language-javascript`}}}}),e.languages.javadoclike.addSupport(`javascript`,e.languages.jsdoc)}(Y),function(e){e.languages.flow=e.languages.extend(`javascript`,{}),e.languages.insertBefore(`flow`,`keyword`,{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:`class-name`}]}),e.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 e.languages.flow.parameter,e.languages.insertBefore(`flow`,`operator`,{"flow-punctuation":{pattern:/\{\||\|\}/,alias:`punctuation`}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.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})}(Y),Y.languages.n4js=Y.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/}),Y.languages.insertBefore(`n4js`,`constant`,{annotation:{pattern:/@+\w+/,alias:`operator`}}),Y.languages.n4jsd=Y.languages.n4js,function(e){function t(e,t){return RegExp(e.replace(/<ID>/g,function(){return`(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*`}),t)}e.languages.insertBefore(`javascript`,`function-variable`,{"method-variable":{pattern:RegExp(`(\\.\\s*)`+e.languages.javascript[`function-variable`].pattern.source),lookbehind:!0,alias:[`function-variable`,`method`,`function`,`property-access`]}}),e.languages.insertBefore(`javascript`,`function`,{method:{pattern:RegExp(`(\\.\\s*)`+e.languages.javascript.function.source),lookbehind:!0,alias:[`function`,`property-access`]}}),e.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`}]}),e.languages.insertBefore(`javascript`,`keyword`,{imports:{pattern:t(`(\\bimport\\b\\s*)(?:<ID>(?:\\s*,\\s*(?:\\*\\s*as\\s+<ID>|\\{[^{}]*\\}))?|\\*\\s*as\\s+<ID>|\\{[^{}]*\\})(?=\\s*\\bfrom\\b)`),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(`(\\bexport\\b\\s*)(?:\\*(?:\\s*as\\s+<ID>)?(?=\\s*\\bfrom\\b)|\\{[^{}]*\\})`),lookbehind:!0,inside:e.languages.javascript}}),e.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`}),e.languages.insertBefore(`javascript`,`operator`,{spread:{pattern:/\.{3}/,alias:`operator`},arrow:{pattern:/=>/,alias:`operator`}}),e.languages.insertBefore(`javascript`,`punctuation`,{"property-access":{pattern:t(`(\\.\\s*)#?<ID>`),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 n=[`function`,`function-variable`,`method`,`method-variable`,`property-access`],r=0;r<n.length;r++){var i=n[r],a=e.languages.javascript[i],i=(a=e.util.type(a)===`RegExp`?e.languages.javascript[i]={pattern:a}:a).inside||{};(a.inside=i)[`maybe-class-name`]=/^[A-Z][\s\S]*/}}(Y),function(e){var t=e.util.clone(e.languages.javascript),n=`(?:\\s|\\/\\/.*(?!.)|\\/\\*(?:[^*]|\\*(?!\\/))\\*\\/)`,r=`(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})`,i=`(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})`;function a(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(e,t)}i=a(i).source,e.languages.jsx=e.languages.extend(`markup`,t),e.languages.jsx.tag.pattern=a(`<\\/?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[\\s\\S]|[^\\\\"])*"|'(?:\\\\[\\s\\S]|[^\\\\'])*'|[^\\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\\/?)?>`),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside[`attr-value`].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside[`class-name`]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore(`inside`,`attr-name`,{spread:{pattern:a(`<SPREAD>`),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore(`inside`,`special-attr`,{script:{pattern:a(`=<BRACES>`),alias:`language-javascript`,inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:`punctuation`},rest:e.languages.jsx}}},e.languages.jsx.tag);function o(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],a=!1;typeof i!=`string`&&(i.type===`tag`&&i.content[0]&&i.content[0].type===`tag`?i.content[0].content[0].content===`</`?0<n.length&&n[n.length-1].tagName===s(i.content[0].content[1])&&n.pop():i.content[i.content.length-1].content!==`/>`&&n.push({tagName:s(i.content[0].content[1]),openedBraces:0}):0<n.length&&i.type===`punctuation`&&i.content===`{`?n[n.length-1].openedBraces++:0<n.length&&0<n[n.length-1].openedBraces&&i.type===`punctuation`&&i.content===`}`?n[n.length-1].openedBraces--:a=!0),(a||typeof i==`string`)&&0<n.length&&n[n.length-1].openedBraces===0&&(a=s(i),r<t.length-1&&(typeof t[r+1]==`string`||t[r+1].type===`plain-text`)&&(a+=s(t[r+1]),t.splice(r+1,1)),0<r&&(typeof t[r-1]==`string`||t[r-1].type===`plain-text`)&&(a=s(t[r-1])+a,t.splice(r-1,1),r--),t[r]=new e.Token(`plain-text`,a,null,a)),i.content&&typeof i.content!=`string`&&o(i.content)}}var s=function(e){return e?typeof e==`string`?e:typeof e.content==`string`?e.content:e.content.map(s).join(``):``};e.hooks.add(`after-tokenize`,function(e){e.language!==`jsx`&&e.language!==`tsx`||o(e.tokens)})}(Y),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend(`jsx`,t),delete e.languages.tsx.parameter,delete e.languages.tsx[`literal-property`],e.languages.tsx.tag);t.pattern=RegExp(`(^|[^\\w$]|(?=<\\/))(?:`+t.pattern.source+`)`,t.pattern.flags),t.lookbehind=!0}(Y),Y.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(`(^|[^"#])(?:"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^(])|[^\\\\\\r\\n"])*"|"""(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|[^(])|[^\\\\"]|"(?!""))*""")(?!["#])`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:`punctuation`},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(`(^|[^"#])(#+)(?:"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^#])|[^\\\\\\r\\n])*?"|"""(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|[^#])|[^\\\\])*?""")\\2`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:`punctuation`},string:/[\s\S]+/}}],directive:{pattern:RegExp(`#(?:(?:elseif|if)\\b(?:[ ]*(?:![ \\t]*)?(?:\\b\\w+\\b(?:[ \\t]*\\((?:[^()]|\\([^()]*\\))*\\))?|\\((?:[^()]|\\([^()]*\\))*\\))(?:[ \\t]*(?:&&|\\|\\|))?)+|(?:else|endif)\\b)`),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:/[{}[\]();,.:\\]/},Y.languages.swift[`string-literal`].forEach(function(e){e.inside.interpolation.inside=Y.languages.swift}),function(e){e.languages.kotlin=e.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 e.languages.kotlin[`class-name`];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:`punctuation`},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore(`kotlin`,`string`,{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:`multiline`,inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:`singleline`,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore(`kotlin`,`keyword`,{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:`builtin`}}),e.languages.insertBefore(`kotlin`,`function`,{label:{pattern:/\b\w+@|@\w+\b/,alias:`symbol`}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(Y),Y.languages.c=Y.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|[?:~]|[-+*/%&|^!=<>]=?/}),Y.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Y.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},Y.languages.c.string],char:Y.languages.c.char,comment:Y.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:Y.languages.c}}}}),Y.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 Y.languages.c.boolean,Y.languages.objectivec=Y.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 Y.languages.objectivec[`class-name`],Y.languages.objc=Y.languages.objectivec,Y.languages.reason=Y.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/}),Y.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 Y.languages.reason.function,function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),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:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Y),Y.languages.go=Y.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/}),Y.languages.insertBefore(`go`,`string`,{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Y.languages.go[`class-name`],function(e){var t=/\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/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.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:t,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/}),e.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),e.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:e.languages.cpp}}}}),e.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),e.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend(`cpp`,{})}}),e.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp[`base-clause`])}(Y),Y.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:/[{}[\];(),.:]/},Y.languages.python[`string-interpolation`].inside.interpolation.inside.rest=Y.languages.python,Y.languages.py=Y.languages.python,Y.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`}},Y.languages.webmanifest=Y.languages.json;var So={};bo(So,{dracula:()=>Co,duotoneDark:()=>wo,duotoneLight:()=>To,github:()=>Eo,gruvboxMaterialDark:()=>Ho,gruvboxMaterialLight:()=>Uo,jettwaveDark:()=>Ro,jettwaveLight:()=>zo,nightOwl:()=>Do,nightOwlLight:()=>Oo,oceanicNext:()=>Ao,okaidia:()=>jo,oneDark:()=>Bo,oneLight:()=>Vo,palenight:()=>Mo,shadesOfPurple:()=>No,synthwave84:()=>Po,ultramin:()=>Fo,vsDark:()=>Io,vsLight:()=>Lo});var Co={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)`}}]},wo={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`}}]},To={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`}}]},Eo={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`}}]},Do={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)`}}]},Oo={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)`}}]},ko={char:`#D8DEE9`,comment:`#999999`,keyword:`#c5a5c5`,primitive:`#5a9bcf`,string:`#8dc891`,variable:`#d7deea`,boolean:`#ff8b50`,punctuation:`#5FB3B3`,tag:`#fc929e`,function:`#79b6f2`,className:`#FAC863`,method:`#6699CC`,operator:`#fc929e`},Ao={plain:{backgroundColor:`#282c34`,color:`#ffffff`},styles:[{types:[`attr-name`],style:{color:ko.keyword}},{types:[`attr-value`],style:{color:ko.string}},{types:[`comment`,`block-comment`,`prolog`,`doctype`,`cdata`,`shebang`],style:{color:ko.comment}},{types:[`property`,`number`,`function-name`,`constant`,`symbol`,`deleted`],style:{color:ko.primitive}},{types:[`boolean`],style:{color:ko.boolean}},{types:[`tag`],style:{color:ko.tag}},{types:[`string`],style:{color:ko.string}},{types:[`punctuation`],style:{color:ko.string}},{types:[`selector`,`char`,`builtin`,`inserted`],style:{color:ko.char}},{types:[`function`],style:{color:ko.function}},{types:[`operator`,`entity`,`url`,`variable`],style:{color:ko.variable}},{types:[`keyword`],style:{color:ko.keyword}},{types:[`atrule`,`class-name`],style:{color:ko.className}},{types:[`important`],style:{fontWeight:`400`}},{types:[`bold`],style:{fontWeight:`bold`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`namespace`],style:{opacity:.7}}]},jo={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`}}]},Mo={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)`}}]},No={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)`}}]},Po={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`}}]},Fo={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)`}}]},Io={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)`}}]},Lo={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)`}}]},Ro={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`}}]},zo={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`}}]},Bo={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%)`}}]},Vo={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%)`}}]},Ho={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`}}]},Uo={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`}}]},Wo=e=>(0,_.useCallback)(t=>{var n=t,{className:r,style:i,line:a}=n;let o=_o(go({},vo(n,[`className`,`style`,`line`])),{className:ao(`token-line`,r)});return typeof e==`object`&&`plain`in e&&(o.style=e.plain),typeof i==`object`&&(o.style=go(go({},o.style||{}),i)),o},[e]),Go=e=>{let t=(0,_.useCallback)(({types:t,empty:n})=>{if(e!=null)return t.length===1&&t[0]===`plain`?n==null?void 0:{display:`inline-block`}:t.length===1&&n!=null?e[t[0]]:Object.assign(n==null?{}:{display:`inline-block`},...t.map(t=>e[t]))},[e]);return(0,_.useCallback)(e=>{var n=e,{token:r,className:i,style:a}=n;let o=_o(go({},vo(n,[`token`,`className`,`style`])),{className:ao(`token`,...r.types,i),children:r.content,style:t(r)});return a!=null&&(o.style=go(go({},o.style||{}),a)),o},[t])},Ko=/\r\n|\r|\n/,qo=e=>{e.length===0?e.push({types:[`plain`],content:`
|
|
93
|
+
`,empty:!0}):e.length===1&&e[0].content===``&&(e[0].content=`
|
|
94
|
+
`,e[0].empty=!0)},Jo=(e,t)=>{let n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},Yo=e=>{let t=[[]],n=[e],r=[0],i=[e.length],a=0,o=0,s=[],c=[s];for(;o>-1;){for(;(a=r[o]++)<i[o];){let e,l=t[o],u=n[o][a];if(typeof u==`string`?(l=o>0?l:[`plain`],e=u):(l=Jo(l,u.type),u.alias&&(l=Jo(l,u.alias)),e=u.content),typeof e!=`string`){o++,t.push(l),n.push(e),r.push(0),i.push(e.length);continue}let d=e.split(Ko),f=d.length;s.push({types:l,content:d[0]});for(let e=1;e<f;e++)qo(s),c.push(s=[]),s.push({types:l,content:d[e]})}o--,t.pop(),n.pop(),r.pop(),i.pop()}return qo(s),c},Xo=({prism:e,code:t,grammar:n,language:r})=>(0,_.useMemo)(()=>{if(n==null)return Yo([t]);let i={code:t,grammar:n,language:r,tokens:[]};return e.hooks.run(`before-tokenize`,i),i.tokens=e.tokenize(t,n),e.hooks.run(`after-tokenize`,i),Yo(i.tokens)},[t,n,r,e]),Zo=(e,t)=>{let{plain:n}=e,r=e.styles.reduce((e,n)=>{let{languages:r,style:i}=n;return r&&!r.includes(t)||n.types.forEach(t=>{e[t]=go(go({},e[t]),i)}),e},{});return r.root=n,r.plain=_o(go({},n),{backgroundColor:void 0}),r},Qo=({children:e,language:t,code:n,theme:r,prism:i})=>{let a=t.toLowerCase(),o=Zo(r,a),s=Wo(o),c=Go(o),l=i.languages[a];return e({tokens:Xo({prism:i,language:a,code:n,grammar:l}),className:`prism-code language-${a}`,style:o==null?{}:o.root,getLineProps:s,getTokenProps:c})},$o=e=>(0,_.createElement)(Qo,_o(go({},e),{prism:e.prism||Y,theme:e.theme||Io,code:e.code,language:e.language})),es=e=>{let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},ts=()=>document.documentElement.classList.contains(`dark`);function ns(e,t){if(!e&&t)return t.split(`
|
|
95
|
+
`).map(e=>({type:`add`,content:e}));let n=Xa(e,t),r=[];for(let e of n){let t=e.value.replace(/\n$/,``).split(`
|
|
96
|
+
`),n=e.added?`add`:e.removed?`remove`:`context`;for(let e of t)r.push({type:n,content:e})}return r}function rs(e){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`}[e.split(`.`).pop()?.toLowerCase()||``]||`text`}var is=(0,_.memo)(function({toolName:e,filePath:t,oldContent:n,newContent:r,isActive:i,isError:a}){let o=(0,_.useMemo)(()=>ns(n,r),[n,r]),s=rs(t),c=(0,_.useSyncExternalStore)(es,ts);return(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl overflow-hidden shadow-layer-sm ${a?`ring-1 ring-red-500/40 border-l-2 border-l-red-500`:``}`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 bg-terminal-surface ${a?`bg-red-500/5`:``}`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono font-bold ${a?`text-red-400`:`text-terminal-orange`}`,children:e}),(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-blue truncate flex-1`,children:t}),a&&(0,V.jsx)(Ma,{}),!n&&(0,V.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded bg-terminal-green/20 text-terminal-green`,children:`new`}),e===`Delete`&&!r&&(0,V.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded bg-terminal-red/20 text-terminal-red`,children:`deleted`})]}),(0,V.jsx)(`div`,{className:`overflow-x-auto max-h-[400px] overflow-y-auto`,children:(0,V.jsx)($o,{theme:c?So.nightOwl:So.nightOwlLight,code:o.map(e=>e.content).join(`
|
|
97
|
+
`),language:s,children:({tokens:e,getLineProps:t,getTokenProps:n})=>(0,V.jsx)(`pre`,{className:`text-xs font-mono !bg-transparent !m-0 p-0`,children:e.map((e,r)=>{let i=o[r];if(!i)return null;let a=i.type===`add`?`bg-green-100 dark:bg-green-900/30`:i.type===`remove`?`bg-red-100 dark:bg-red-900/30`:``,s=i.type===`add`?`+`:i.type===`remove`?`-`:` `,c=i.type===`add`?`text-terminal-green`:i.type===`remove`?`text-terminal-red`:`text-terminal-dim`;return(0,V.jsxs)(`div`,{...t({line:e}),className:`flex ${a} px-3 leading-5`,children:[(0,V.jsx)(`span`,{className:`select-none w-4 shrink-0 ${c}`,children:s}),(0,V.jsx)(`span`,{children:e.map((e,t)=>(0,V.jsx)(`span`,{...n({token:e})},t))})]},r)})})})})]})}),as=`▶`;function os({ms:e}){let t=ze(e);return t?(0,V.jsx)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`Tool execution: ${t}`,children:t}):null}function ss({tokens:e}){let t=Be(e);return t?(0,V.jsxs)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`~${t} tokens added to context (heuristic estimate)`,children:[`~`,t,` tok`]}):null}function cs(e){return e.tokenUsage?e.tokenUsage.inputTokens+e.tokenUsage.outputTokens+e.tokenUsage.cacheCreationTokens+e.tokenUsage.cacheReadTokens:0}function ls(e){let t=0;for(let n of e.scenes)n.type===`tool-call`&&n.toolName!==`Agent`&&n.durationMs&&(t+=n.durationMs);return t}function us(e){if(e.startsWith(`mcp__`))return`🔌`;switch(e){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`⚙️`}}var ds={Explore:`blue`,Plan:`purple`,Shell:`blue`,"general-purpose":`green`,"claude-code-guide":`orange`};function fs(e){return ds[e]||`purple`}var ps={blue:{text:`text-terminal-blue`,bgSubtle:`bg-terminal-blue-subtle`,borderL:`border-terminal-blue`,pill:`bg-terminal-blue-emphasis text-terminal-blue`},purple:{text:`text-terminal-purple`,bgSubtle:`bg-terminal-purple-subtle`,borderL:`border-terminal-purple`,pill:`bg-terminal-purple-emphasis text-terminal-purple`},green:{text:`text-terminal-green`,bgSubtle:`bg-terminal-green-subtle`,borderL:`border-terminal-green`,pill:`bg-terminal-green-emphasis text-terminal-green`},orange:{text:`text-terminal-orange`,bgSubtle:`bg-terminal-orange-subtle`,borderL:`border-terminal-orange`,pill:`bg-terminal-orange-emphasis text-terminal-orange`}};function ms({type:e}){let t=ps[fs(e)];return(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full ${t.pill}`,children:e})}function hs({theme:e}){return(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold uppercase tracking-widest ${ps[e].text}`,children:`Subagent`})}function gs({subAgent:e}){return(0,V.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[e.prompt&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-dim mb-1.5`,children:`Prompt`}),(0,V.jsx)(`div`,{className:`text-[11px] text-terminal-text/85 font-mono whitespace-pre-wrap break-words max-h-[120px] overflow-y-auto rounded-md bg-terminal-surface-inset px-3 py-2`,children:e.prompt})]}),e.scenes.length>0&&(0,V.jsx)(vs,{scenes:e.scenes})]})}var _s=20;function vs({scenes:e}){let[t,n]=(0,_.useState)(!1),r=e.length>_s,i=r&&!t?e.slice(0,_s):e,a=e.length-i.length;return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5`,children:[(0,V.jsxs)(`span`,{className:`text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-dim`,children:[`Trace · `,e.length,` `,e.length===1?`scene`:`scenes`]}),r&&(0,V.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),n(e=>!e)},className:`text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors`,children:t?`Show first 20`:`Show all (+${a})`})]}),(0,V.jsx)(`div`,{className:`space-y-1 max-h-[500px] overflow-y-auto rounded-md bg-terminal-surface-inset px-3 py-2`,children:i.map((e,t)=>(0,V.jsx)(ys,{scene:e},t))})]})}function ys({scene:e}){let[t,n]=(0,_.useState)(!1);if(e.type===`thinking`){let t=Be(e.tokens);return(0,V.jsxs)(`div`,{className:`text-[10px] font-mono text-purple-400/80 pl-2 border-l-2 border-purple-500/30 py-0.5`,children:[(0,V.jsx)(`span`,{className:`text-purple-400/70 font-bold mr-1`,children:`[thinking]`}),t&&(0,V.jsxs)(`span`,{className:`text-purple-400/70 mr-1`,title:`Approximate thinking tokens`,children:[`~`,t,` tok`]}),(0,V.jsxs)(`span`,{className:`text-purple-400/70`,children:[(e.content||``).slice(0,120),(e.content||``).length>120?`...`:``]})]})}if(e.type===`text-response`)return(0,V.jsxs)(`div`,{className:`text-[10px] font-mono text-terminal-text/80 pl-2 border-l-2 border-blue-500/30 py-0.5`,children:[(e.content||``).slice(0,200),(e.content||``).length>200?`...`:``]});if(e.type===`tool-call`){let r=e;return(0,V.jsxs)(`div`,{className:`pl-2 border-l-2 py-0.5 ${r.isError?`border-l-red-500 bg-red-500/5`:`border-l-orange-500/30`}`,children:[(0,V.jsxs)(`button`,{onClick:()=>n(!t),className:`flex items-center gap-1 text-[10px] font-mono w-full text-left hover:bg-terminal-surface-hover/30 rounded px-1`,children:[(0,V.jsx)(`span`,{className:`font-bold ${r.isError?`text-red-400`:`text-terminal-orange`}`,children:Ea(r.toolName)}),(0,V.jsx)(`span`,{className:`text-terminal-dim truncate flex-1`,children:Ss(r.toolName,r.input)}),r.isError&&(0,V.jsx)(Ma,{}),(0,V.jsx)(ss,{tokens:r.resultTokens}),(0,V.jsx)(os,{ms:r.durationMs})]}),t&&r.result&&(0,V.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:r.result.slice(0,500)})]})}return null}var bs=(0,_.memo)(function({scene:e,isActive:t,forceCollapse:n}){let[r,i]=(0,_.useState)(!1);if(n)return(0,V.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1 text-xs font-mono text-terminal-dim ${e.isError?`border-l-2 border-l-red-500 bg-red-500/5`:``}`,children:[(0,V.jsx)(`span`,{children:us(e.toolName)}),(0,V.jsx)(`span`,{className:`font-bold ${e.isError?`text-red-400`:`text-terminal-orange`}`,children:Ea(e.toolName)}),(0,V.jsx)(`span`,{className:`truncate flex-1`,children:Ss(e.toolName,e.input)}),e.subAgent&&(0,V.jsx)(ms,{type:e.subAgent.agentType}),e.isError&&(0,V.jsx)(Ma,{}),(0,V.jsx)(ss,{tokens:e.resultTokens}),(0,V.jsx)(os,{ms:e.durationMs})]});if(e.bashOutput)return(0,V.jsx)(Na,{command:e.bashOutput.command,stdout:e.bashOutput.stdout,isActive:t,durationMs:e.durationMs,resultTokens:e.resultTokens,isError:e.isError});if(e.diff)return(0,V.jsx)(is,{toolName:e.toolName,filePath:e.diff.filePath,oldContent:e.diff.oldContent,newContent:e.diff.newContent,isActive:t,isError:e.isError});if(e.toolName===`Agent`&&e.subAgent){let t=e.subAgent,n=fs(t.agentType),a=ps[n],o=cs(t),s=ls(t),c=t.description||e.input.description||``;return(0,V.jsxs)(`div`,{className:`relative rounded-xl px-5 py-4 border-l-2 ${a.borderL} ${a.bgSubtle} shadow-layer-sm transition-all duration-200 ease-material`,children:[(0,V.jsxs)(`button`,{onClick:()=>i(!r),className:`w-full text-left`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap mb-1.5`,children:[(0,V.jsx)(hs,{theme:n}),(0,V.jsx)(ms,{type:t.agentType}),t.model&&(0,V.jsx)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono`,children:t.model}),(0,V.jsx)(`span`,{className:`flex-1`}),(0,V.jsxs)(`span`,{className:`text-[10px] text-terminal-dim font-mono`,children:[t.toolCalls,` tools`]}),t.thinkingBlocks>0&&(0,V.jsxs)(`span`,{className:`text-[10px] text-terminal-dim font-mono`,children:[t.thinkingBlocks,` thinking`]}),o>0&&(0,V.jsxs)(`span`,{className:`text-[10px] font-mono font-semibold ${a.text}`,title:`Total tokens billed for this subagent (input + output + cache)`,children:[Be(o),` tok`]}),s>0&&(0,V.jsx)(os,{ms:s}),(0,V.jsx)(`span`,{className:`text-xs text-terminal-dim transition-transform ${r?`rotate-90`:``}`,children:as})]}),c&&(0,V.jsx)(`div`,{className:`text-sm text-terminal-text font-sans font-medium leading-snug`,children:c})]}),r&&(0,V.jsx)(gs,{subAgent:t})]})}let a=e.isError?`ring-1 ring-red-500/40 border-l-2 border-l-red-500`:``,o=e.isError?`bg-red-500/5`:``;return(0,V.jsx)(`div`,{children:(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl overflow-hidden shadow-layer-sm ${a}`,children:[(0,V.jsxs)(`button`,{onClick:()=>i(!r),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 ${o||`bg-terminal-surface`}`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono`,children:us(e.toolName)}),(0,V.jsx)(`span`,{className:`text-xs font-mono font-bold ${e.isError?`text-red-400`:`text-terminal-orange`}`,children:Ea(e.toolName)}),(0,V.jsx)(`span`,{className:`text-xs text-terminal-dim font-mono truncate flex-1`,children:Ss(e.toolName,e.input)}),e.isError&&(0,V.jsx)(Ma,{}),(0,V.jsx)(ss,{tokens:e.resultTokens}),(0,V.jsx)(os,{ms:e.durationMs}),(0,V.jsx)(`span`,{className:`text-xs text-terminal-dim transition-transform ${r?`rotate-90`:``}`,children:as})]}),r&&(0,V.jsxs)(`div`,{className:`border-t border-terminal-border-subtle`,children:[(0,V.jsxs)(`div`,{className:`px-3 py-2`,children:[(0,V.jsx)(`div`,{className:`text-xs text-terminal-dim font-mono mb-1`,children:`Input:`}),(0,V.jsx)(`pre`,{className:`text-xs text-terminal-text font-mono whitespace-pre-wrap break-words max-h-[200px] overflow-y-auto`,children:JSON.stringify(e.input,null,2)})]}),e.result&&(0,V.jsxs)(`div`,{className:`px-3 py-2 border-t border-terminal-border-subtle`,children:[(0,V.jsx)(`div`,{className:`text-xs text-terminal-dim font-mono mb-1`,children:`Result:`}),(0,V.jsx)(`pre`,{className:`text-xs text-terminal-text font-mono whitespace-pre-wrap break-words max-h-[200px] overflow-y-auto`,children:e.result})]}),e.images&&e.images.length>0&&(0,V.jsx)(`div`,{className:`px-3 py-2 border-t border-terminal-border-subtle`,children:(0,V.jsx)(`div`,{className:`flex gap-2 flex-wrap`,children:e.images.map((e,t)=>(0,V.jsx)(`img`,{src:e,alt:`Screenshot ${t+1}`,className:`max-w-[400px] max-h-[300px] rounded-md object-contain`},t))})})]})]})})}),xs=200;function Ss(e,t){switch(e){case`Read`:case`Write`:case`Edit`:case`MultiEdit`:return t.file_path||``;case`NotebookEdit`:return t.notebook_path||``;case`Glob`:return t.pattern||``;case`Grep`:return`/${t.pattern||``}/ ${t.path||``}`.trim();case`Bash`:{let e=(t.command||t.description||``).replace(/\s+/g,` `).trim();return e.length>xs?`${e.slice(0,xs)}…`:e}case`BashOutput`:return t.bash_id||``;case`Agent`:case`Task`:{let e=t.description||``,n=t.subagent_type;return n?`${n} — ${e}`:e}case`TodoWrite`:{let e=Array.isArray(t.todos)?t.todos:[];if(e.length===0)return``;let n=e.find(e=>e?.status===`in_progress`);return n?.content?`${e.length} todos · ${n.content}`:`${e.length} todos`}case`WebSearch`:return t.query||``;case`WebFetch`:return t.url||``;case`SlashCommand`:return t.command||``;case`ExitPlanMode`:return(t.plan||``).slice(0,80);default:return Cs(t)}}function Cs(e){for(let t of[`url`,`path`,`file_path`,`query`,`name`,`id`]){let n=e[t];if(typeof n==`string`&&n)return n.slice(0,80)}return Object.values(e).filter(e=>typeof e==`string`).join(` `).slice(0,80)}var ws={lines:8,chars:900},Ts={lines:4,chars:280};function Es(){return typeof window<`u`&&window.innerWidth<768?Ts:ws}var Ds=(0,_.memo)(function({content:e,images:t,isActive:n}){let[r,i]=(0,_.useState)(!1),[a]=(0,_.useState)(Es);(0,_.useEffect)(()=>{let e=e=>{if(!n)return;let t=e.detail;t.action===`expand`?i(!0):t.action===`collapse`&&i(!1)};return window.addEventListener(`vibe:toggle-expand`,e),()=>window.removeEventListener(`vibe:toggle-expand`,e)},[n]);let o=(0,_.useMemo)(()=>e.split(`
|
|
98
|
+
`),[e]),s=o.length>a.lines||e.length>a.chars,c=(0,_.useMemo)(()=>{if(!s||r)return e;let t=o.slice(0,a.lines).join(`
|
|
99
|
+
`);return t.length>a.chars?t.slice(0,a.chars):t},[e,r,s,o,a]);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-terminal-green font-mono text-sm whitespace-pre-wrap break-words ${n?`typing-cursor`:``}`,children:[c,s&&!r&&(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:`
|
|
100
|
+
...`})]}),s&&(0,V.jsxs)(`button`,{onClick:()=>i(e=>!e),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:[n&&(0,V.jsx)(`span`,{className:`text-secondary-text font-bold opacity-70`,children:r?`[←]`:`[→]`}),(0,V.jsx)(`span`,{children:r?`Show less`:`Show more (${o.length} lines)`})]}),t&&t.length>0&&(0,V.jsx)(`div`,{className:`flex gap-2 mt-2 flex-wrap`,children:t.map((e,t)=>(0,V.jsx)(`img`,{src:e,alt:`Attachment ${t+1}`,className:`max-w-[300px] max-h-[200px] rounded-md object-contain`},t))})]})});function Os(e){if(!e)return``;try{return new Date(e).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}catch{return``}}function ks({scenes:e,visibleCount:t,currentIndex:n,effectivePrefs:r,focusIndex:i,annotatedScenes:a,annotationCounts:o,onComment:s,onSeek:c,state:l,overlayActions:u,turnStats:d}){let f=(0,_.useMemo)(()=>{let t=[],n=null,r=0;for(let i=0;i<e.length;i++){let a=e[i];if(a.type===`user-prompt`||a.type===`compaction-summary`||a.type===`context-injection`){n&&n.scenes.length>0&&t.push(n);let e=a.type===`compaction-summary`?`compaction`:a.type===`context-injection`?`context-injection`:`user`;e===`user`&&r++,t.push({type:e,timestamp:a.timestamp,scenes:[{scene:a,index:i}],turnNumber:e===`user`?r:void 0}),n=null}else (!n||n.type!==`assistant`)&&(n&&n.scenes.length>0&&t.push(n),n={type:`assistant`,timestamp:a.timestamp,scenes:[],turnNumber:r>0?r:void 0}),n.scenes.push({scene:a,index:i})}return n&&n.scenes.length>0&&t.push(n),t},[e]),p=(0,_.useMemo)(()=>r.promptsOnly?f.filter(e=>(e.type===`user`||e.type===`compaction`)&&e.scenes[0].index<t):f.filter(e=>e.scenes[0].index<t),[f,t,r.promptsOnly]),m=(0,_.useMemo)(()=>{for(let e=p.length-1;e>=0;e--)if(p[e].scenes.some(e=>e.index<=n))return e;return p.length-1},[p,n]),h=(0,_.useMemo)(()=>{let e=new Map;for(let t=1;t<p.length;t++){let n=p[t];if(n.type!==`user`)continue;let r;for(let e=t-1;e>=0;e--){let t=p[e],n=t.scenes[t.scenes.length-1];if(n?.scene.timestamp){r=n.scene.timestamp;break}if(t.timestamp){r=t.timestamp;break}}if(!r||!n.timestamp)continue;let i=new Date(n.timestamp).getTime()-new Date(r).getTime();i>12e4&&e.set(t,i)}return e},[p]);return(0,V.jsxs)(`div`,{className:`max-w-4xl mx-auto space-y-5 pb-6`,children:[p.map((e,c)=>(0,V.jsxs)(js,{forceRender:c>=m-15&&c<=m+5,children:[h.has(c)&&(0,V.jsx)(As,{gapMs:h.get(c)}),(0,V.jsx)(Ms,{group:e,currentIndex:n,visibleCount:t,effectivePrefs:r,focusIndex:i,annotatedScenes:a,annotationCounts:o,onComment:s,overlayActions:u,turnStats:d})]},c)),l===`paused`&&t<e.length&&(0,V.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:(0,V.jsxs)(`div`,{className:`group/pause relative flex items-center gap-8 px-4 py-2 bg-transparent backdrop-blur-sm`,children:[(0,V.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`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 pr-8 border-r border-terminal-border/20`,children:[(0,V.jsxs)(`div`,{className:`relative flex h-2 w-2`,children:[(0,V.jsx)(`div`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-orange opacity-40`}),(0,V.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)]`})]}),(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-black text-terminal-orange uppercase tracking-[.25em] drop-shadow-sm`,children:`Paused`})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-8`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.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:(0,V.jsx)(`span`,{className:`text-[11px] font-mono font-bold`,children:`↓`})}),(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest opacity-80`,children:`Explore`})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.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:(0,V.jsx)(`span`,{className:`text-[9px] font-mono font-black tracking-tight`,children:`SPACE`})}),(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest opacity-80`,children:`Resume`})]})]})]})}),t>=e.length&&(0,V.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:[(0,V.jsx)(`div`,{className:`h-px w-8 bg-terminal-border-subtle mb-6`}),(0,V.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,V.jsx)(`div`,{className:`text-[10px] font-mono font-bold text-terminal-dimmer uppercase tracking-[0.3em]`,children:`the end`}),(0,V.jsx)(`div`,{className:`text-[9px] font-mono text-terminal-border uppercase tracking-widest mt-1`,children:`session replay complete`})]}),(0,V.jsxs)(`div`,{className:`mt-8 flex flex-col items-center gap-6`,children:[(0,V.jsxs)(`button`,{onClick:()=>c?.(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:[(0,V.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:(0,V.jsx)(`path`,{d:`m18 15-6-6-6 6`})}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono font-bold uppercase tracking-widest transition-colors`,children:`Back to Top`}),(0,V.jsxs)(`span`,{className:`text-[9px] font-mono font-bold opacity-0 group-hover:opacity-60 transition-opacity`,children:[` `,`[Home]`]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 opacity-20`,children:[(0,V.jsx)(`div`,{className:`w-1 h-1 rounded-full bg-terminal-green`}),(0,V.jsx)(`div`,{className:`w-1 h-1 rounded-full bg-terminal-blue`}),(0,V.jsx)(`div`,{className:`w-1 h-1 rounded-full bg-terminal-orange`})]})]})]})]})}function As({gapMs:e}){let t=e>=36e5?`${Math.floor(e/36e5)}h ${Math.floor(e%36e5/6e4)}m later`:`${Math.floor(e/6e4)}m later`;return(0,V.jsxs)(`div`,{className:`flex items-center gap-3 py-1 px-4`,children:[(0,V.jsx)(`div`,{className:`flex-1 h-px bg-terminal-border-subtle`}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer whitespace-nowrap`,children:t}),(0,V.jsx)(`div`,{className:`flex-1 h-px bg-terminal-border-subtle`})]})}var js=(0,_.memo)(function({children:e,forceRender:t}){let n=(0,_.useRef)(null),[r,i]=(0,_.useState)(!1),a=(0,_.useRef)(0);(0,_.useEffect)(()=>{let e=n.current;if(!e)return;let t=new IntersectionObserver(([t])=>{i(t.isIntersecting),t.isIntersecting&&e.offsetHeight>0&&(a.current=e.offsetHeight)},{rootMargin:`800px 0px`});return t.observe(e),()=>t.disconnect()},[]);let o=r||t;return(0,_.useEffect)(()=>{o&&n.current&&n.current.offsetHeight>0&&(a.current=n.current.offsetHeight)}),(0,V.jsx)(`div`,{ref:n,style:!o&&a.current>0?{minHeight:a.current}:void 0,children:o?e:null})}),Ms=(0,_.memo)(function({group:e,currentIndex:t,visibleCount:n,effectivePrefs:r,focusIndex:i,annotatedScenes:a,annotationCounts:o,onComment:s,overlayActions:c,turnStats:l}){let[u,d]=(0,_.useState)(!1),f=(0,_.useMemo)(()=>{if(!l?.length)return 2e5;let e=Math.max(...l.map(e=>e.contextTokens||0)),t=0;for(let e=0;e<l.length-1;e++){let n=l[e]?.contextTokens||0,r=l[e+1]?.contextTokens||0;n>0&&r>0&&r<n*.5&&n>t&&(t=n)}return t>0?t>2e5?1e6:2e5:e>2e5?1e6:2e5},[l]),p=(0,_.useMemo)(()=>e.scenes.filter(e=>e.index<n),[e.scenes,n]),m=p.some(({index:e})=>e===t),h=typeof i==`number`&&p.some(({index:e})=>e===i),g=p[0]?.index;if(p.length===0)return null;let v=e.type===`user`&&o?.get(g)||0,y=e.type===`user`&&s&&(v>0||u)?(0,V.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),s(g)},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 ${v>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:v>0?`${v} comment${v>1?`s`:``}`:`Add comment`,children:[`💬`,v>0&&(0,V.jsx)(`span`,{children:v})]}):null;if(e.type===`user`)return(0,V.jsxs)(`div`,{id:`scene-${g}`,"data-scene-index":g,className:`group relative rounded-2xl px-5 py-4 transition-all duration-200 ease-material ml-4 md:ml-12 border ${h?`scene-nav-focused bg-terminal-green-emphasis border-terminal-green shadow-layer-lg`:m?`bg-terminal-green-subtle border-terminal-green/30 shadow-layer-sm`:`bg-terminal-surface border-terminal-border-subtle shadow-sm`}`,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:[y,(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-2.5`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-green uppercase tracking-widest`,children:`You`}),e.timestamp&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:Os(e.timestamp)}),(0,V.jsx)(`div`,{className:`flex-1`}),h?(0,V.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`}):m&&(0,V.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`}),e.turnNumber!==void 0&&(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer font-bold`,children:[`#`,String(e.turnNumber).padStart(2,`0`)]})]}),e.turnNumber!==void 0&&l&&(()=>{let t=l[e.turnNumber-1];if(!t?.contextTokens)return null;let n=Math.min(t.contextTokens/f*100,100),r=t.contextTokens/f,i=r>=.85?`bg-terminal-red`:r>=.7?`bg-terminal-orange`:r>=.5?`bg-yellow-400`:`bg-terminal-green`,a=r>=.85?`text-terminal-red`:r>=.7?`text-terminal-orange`:`text-terminal-dim`;return(0,V.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden`,children:(0,V.jsx)(`div`,{className:`h-full rounded-full ${i} transition-all duration-300`,style:{width:`${n}%`}})}),(0,V.jsxs)(`span`,{className:`text-[9px] font-mono tabular-nums ${a}`,children:[U(t.contextTokens),(0,V.jsx)(`span`,{className:`text-terminal-dimmer ml-1`,children:`context window`})]})]})})(),(0,V.jsx)(`div`,{className:`text-left`,children:p.map(({scene:e,index:n})=>{let i=c?.getOverlays(n)??[],a=c?.getEffectiveContent(n),o=c?.showOriginal.has(n);return(0,V.jsxs)(`div`,{className:`scene-enter`,children:[(0,V.jsx)(Ls,{scene:e,isActive:n===t,collapseTools:r.collapseAllTools,effectiveContent:a??void 0}),i.length>0&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5`,children:[i.map(e=>(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple`,children:e.source.type===`translate`?`Translated`:e.source.type===`tone`?`Softened`:`Modified`},e.id)),(0,V.jsx)(`button`,{onClick:()=>c?.toggleOriginal(n),className:`text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors`,children:o?`Show modified`:`Show original`}),(0,V.jsx)(`button`,{onClick:()=>c?.revertSceneOverlays(n),className:`text-[10px] font-mono text-terminal-dim hover:text-terminal-red transition-colors`,children:`Revert`})]})]},n)})})]});if(e.type===`compaction`){let n=p[0]?.scene;if(!n||n.type!==`compaction-summary`)return null;let r=(()=>{if(!l||l.length<2||e.turnNumber===void 0)return;let t=e.turnNumber-1,n=Math.max(0,t-2),r=Math.min(l.length-1,t+2);for(let e=n;e<r;e++){let t=l[e]?.contextTokens||0,n=l[e+1]?.contextTokens||0;if(t>0&&n>0&&n<t*.5)return{before:t,after:n,freed:t-n}}})();return(0,V.jsxs)(`div`,{id:`scene-${g}`,"data-scene-index":g,className:`group relative rounded-xl px-5 py-3.5 transition-all duration-200 ease-material ${h?`scene-nav-focused bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm`:m?`bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm`:`bg-terminal-surface/50`}`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-dim uppercase tracking-widest`,children:`Context Compaction`}),e.timestamp&&(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:Os(e.timestamp)}),r&&(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-green`,children:[U(r.before),` → `,U(r.after),(0,V.jsxs)(`span`,{className:`text-terminal-green/70 ml-1`,children:[`(-`,U(r.freed),` freed)`]})]})]}),(0,V.jsx)(Oa,{content:n.content,isActive:g===t})]})}if(e.type===`context-injection`){let n=p[0]?.scene;if(!n||n.type!==`context-injection`)return null;let r=n.injectionType||`system`,i=r.startsWith(`skill:`)?`Skill: ${r.slice(6)}`:r.startsWith(`command:`)?`Command: ${r.slice(8)}`:r===`image`?`Image Injection`:r===`local-command`?`Local Command`:`System Context`;return(0,V.jsxs)(`div`,{id:`scene-${g}`,"data-scene-index":g,className:`group relative rounded-xl px-5 py-3.5 transition-all duration-200 ease-material ${h?`scene-nav-focused bg-terminal-surface border-l-2 border-blue-500/60 shadow-layer-sm`:m?`bg-terminal-surface border-l-2 border-blue-500/40 shadow-layer-sm`:`bg-terminal-surface/50`}`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-blue-400/80 uppercase tracking-widest`,children:i}),e.timestamp&&(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:Os(e.timestamp)})]}),(0,V.jsx)(Oa,{content:n.content,isActive:g===t})]})}let b=r.hideThinking?p.filter(e=>e.scene.type!==`thinking`):p;if(b.length===0)return null;let x=r.hideThinking?e.scenes.filter(e=>e.scene.type!==`thinking`):e.scenes;return r.compactAssistant?(0,V.jsx)(Ns,{allScenes:x,filteredScenes:b,firstIndex:g,currentIndex:t,groupHasCurrent:m,groupHasFocusedTarget:h,timestamp:e.timestamp,annotationCounts:o,onComment:s,overlayActions:c,turnDurationMs:e.turnNumber?l?.[e.turnNumber-1]?.durationMs:void 0}):(0,V.jsxs)(`div`,{id:`scene-${g}`,"data-scene-index":g,className:`relative rounded-xl px-5 py-4 transition-all duration-200 ease-material ${h?`scene-nav-focused bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-lg`:m?`bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-sm`:`bg-terminal-surface shadow-layer-sm`}`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-blue uppercase tracking-widest`,children:`Assistant`}),e.timestamp&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:Os(e.timestamp)}),(0,V.jsx)(`div`,{className:`flex-1`}),h?(0,V.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`}):m&&(0,V.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`}),e.turnNumber!==void 0&&(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer font-bold`,children:[`#`,String(e.turnNumber).padStart(2,`0`)]})]}),(0,V.jsx)(`div`,{className:`space-y-2`,children:(0,V.jsx)(Ps,{scenes:b,currentIndex:t,collapseTools:r.collapseAllTools,annotationCounts:o,onComment:s,overlayActions:c})})]})});function Ns({allScenes:e,filteredScenes:t,firstIndex:n,currentIndex:r,groupHasCurrent:i,groupHasFocusedTarget:a,timestamp:o,annotationCounts:s,onComment:c,overlayActions:l,turnDurationMs:u}){let[d,f]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=e=>{if(!i)return;let t=e.detail;t.action===`expand`?f(!0):t.action===`collapse`&&f(!1)};return window.addEventListener(`vibe:toggle-expand`,e),()=>window.removeEventListener(`vibe:toggle-expand`,e)},[i]);let p=(0,_.useMemo)(()=>{let t={},n=new Set,r=0,i=0,a=0,o=0,s=[];for(let{scene:c}of e)if(c.type===`tool-call`){a++,c.toolName===`Agent`&&c.subAgent&&(o++,s.includes(c.subAgent.agentType)||s.push(c.subAgent.agentType));let e=Ea(c.toolName);if(t[e]=(t[e]||0)+1,c.toolName===`Bash`&&c.input?.command){let e=c.input.command.trim().split(/[\s|;&]/)[0];e&&n.add(e)}}else c.type===`text-response`?r++:c.type===`thinking`&&i++;let c,l=e[0]?.scene.timestamp,u=e[e.length-1]?.scene.timestamp;if(l&&u){let e=Date.parse(u)-Date.parse(l);e>0&&(c=e)}return{totalTools:a,toolBreakdown:t,responses:r,thinking:i,bashCommands:[...n],subAgentCalls:o,subAgentTypes:s,turnDurationMs:c}},[e]),m=(0,_.useMemo)(()=>{for(let t=e.length-1;t>=0;t--)if(e[t].scene.type===`text-response`)return e[t];return null},[e]),h=(0,_.useMemo)(()=>{let e=[`Read`,`Write`,`Edit`,`MultiEdit`,`Delete`,`Bash`,`Glob`,`Grep`,`SemanticSearch`,`Browser`,`Agent`],t=t=>{let n=e.indexOf(t);return n>=0?n:100},n=Object.entries(p.toolBreakdown);return n.sort((e,n)=>{let r=t(e[0])-t(n[0]);if(r!==0)return r;let i=n[1]-e[1];return i===0?e[0].localeCompare(n[0]):i}),n},[p.toolBreakdown]),g=(0,_.useMemo)(()=>s?e.reduce((e,{index:t})=>e+(s.get(t)||0),0):0,[e,s]),[v,y]=(0,_.useState)(!1);return(0,V.jsxs)(`div`,{id:`scene-${n}`,"data-scene-index":n,className:`group relative rounded-xl px-5 py-4 transition-all duration-200 ease-material ${a?`scene-nav-focused bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-lg`:i?`bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-sm`:`bg-terminal-surface shadow-layer-sm`}`,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[c&&(g>0||v)&&!d&&(0,V.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),c(n)},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 ${g>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:g>0?`${g} comment${g>1?`s`:``}`:`Add comment`,children:[`💬`,g>0&&(0,V.jsx)(`span`,{children:g})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-blue uppercase tracking-widest`,children:`Assistant`}),o&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:Os(o)}),(u||p.turnDurationMs)&&(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[`· `,Re(u??p.turnDurationMs)]}),(0,V.jsx)(`div`,{className:`flex-1`}),a?(0,V.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`}):i&&(0,V.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`})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mb-3 text-[11px] font-mono`,children:[p.responses>0&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue`,children:[p.responses,` response`,p.responses>1?`s`:``]}),p.totalTools>0&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange`,children:[p.totalTools,` tool`,p.totalTools>1?`s`:``]}),p.subAgentCalls>0&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-500/20 text-green-300`,children:[p.subAgentCalls,` agent`,p.subAgentCalls>1?`s`:``,p.subAgentTypes.length>0&&(0,V.jsxs)(`span`,{className:`opacity-70 text-[10px]`,children:[`(`,p.subAgentTypes.join(`, `),`)`]})]}),p.thinking>0&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-purple-subtle text-terminal-purple`,children:[p.thinking,` thinking`]}),h.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-terminal-border mx-0.5`,children:`|`}),h.map(([e,t])=>(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-terminal-surface-hover text-terminal-dim`,children:[(0,V.jsx)(`span`,{className:`text-terminal-orange`,children:e}),e===`Bash`&&p.bashCommands.length>0&&(0,V.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[`(`,p.bashCommands.slice(0,4).join(`, `),p.bashCommands.length>4?`, ...`:``,`)`]}),(0,V.jsx)(`span`,{children:t})]},e))]})]}),m&&!d&&(0,V.jsx)(`div`,{className:`mb-2`,children:(0,V.jsx)(Aa,{content:l?.getEffectiveContent(m.index)??m.scene.content,isActive:m.index===r})}),d&&(0,V.jsx)(`div`,{className:`space-y-2 mb-2`,children:t.map(({scene:e,index:t})=>{let n=s?.get(t)||0,i=e.type===`text-response`?l?.getEffectiveContent(t)??void 0:void 0;return(0,V.jsxs)(`div`,{"data-scene-index":t,className:`group/scene relative scene-enter ${c?`pr-7`:``}`,children:[(0,V.jsx)(Ls,{scene:e,isActive:t===r,collapseTools:!1,effectiveContent:i}),c&&(0,V.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),c(t)},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 ${n>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:n>0?`${n} comment${n>1?`s`:``}`:`Add comment`,children:[`💬`,n>0&&(0,V.jsx)(`span`,{children:n})]})]},t)})}),(0,V.jsxs)(`button`,{onClick:()=>f(!d),className:`text-xs font-mono text-terminal-dim hover:text-terminal-blue transition-colors flex items-center gap-1.5`,children:[i&&(0,V.jsx)(`span`,{className:`text-secondary-text font-bold opacity-70`,children:d?`[←]`:`[→]`}),(0,V.jsx)(`span`,{children:d?`Collapse`:`Show all details`})]})]})}function Ps({scenes:e,currentIndex:t,collapseTools:n,annotationCounts:r,onComment:i,overlayActions:a}){let o=[],s=[];for(let t of e){let e=s[s.length-1];e&&e.scene.type===`tool-call`&&t.scene.type===`tool-call`&&e.scene.toolName===t.scene.toolName&&!t.scene.diff&&!t.scene.bashOutput&&!e.scene.diff&&!e.scene.bashOutput?s.push(t):(s.length>0&&o.push(s),s=[t])}return s.length>0&&o.push(s),(0,V.jsx)(V.Fragment,{children:o.map(e=>{if(e.length<=1){let{scene:o,index:s}=e[0],c=r?.get(s)||0,l=o.type===`text-response`?a?.getEffectiveContent(s):void 0,u=o.type===`text-response`?a?.getOverlays(s)??[]:[];return(0,V.jsxs)(`div`,{"data-scene-index":s,className:`group/scene relative scene-enter ${i?`pr-7`:``}`,children:[(0,V.jsx)(Ls,{scene:o,isActive:s===t,collapseTools:n,effectiveContent:l??void 0}),u.length>0&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-1`,children:[u.map(e=>(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple`,children:e.source.type===`translate`?`Translated`:e.source.type===`tone`?`Softened`:`Modified`},e.id)),(0,V.jsx)(`button`,{onClick:()=>a?.toggleOriginal(s),className:`text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors`,children:a?.showOriginal.has(s)?`Show modified`:`Show original`}),(0,V.jsx)(`button`,{onClick:()=>a?.revertSceneOverlays(s),className:`text-[10px] font-mono text-terminal-dim hover:text-terminal-red transition-colors`,children:`Revert`})]}),i&&(0,V.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),i(s)},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&&(0,V.jsx)(`span`,{children:c})]})]},s)}let o=e[0].scene.toolName;return(0,V.jsx)(Fs,{batch:e,toolName:o,currentIndex:t,collapseTools:n,annotationCounts:r,onComment:i},e[0].index)})})}function Fs({batch:e,toolName:t,currentIndex:n,collapseTools:r,annotationCounts:i,onComment:a}){let[o,s]=(0,_.useState)(!1),c=i?e.reduce((e,{index:t})=>e+(i.get(t)||0),0):0,l=e.map(({scene:e})=>e.type===`tool-call`?Is(e.toolName,e.input):``),u=0,d=0;for(let{scene:t}of e)t.type===`tool-call`&&(t.resultTokens&&(u+=t.resultTokens),t.durationMs&&(d+=t.durationMs));let f=Be(u),p=ze(d);return(0,V.jsxs)(`div`,{"data-scene-index":e[0].index,className:`group/batch relative ${a?`pr-7`:``}`,children:[(0,V.jsxs)(`button`,{onClick:()=>s(!o),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:[(0,V.jsx)(`span`,{className:`transition-transform text-xs ${o?`rotate-90`:``}`,children:`▶`}),(0,V.jsx)(`span`,{className:`text-terminal-orange font-semibold`,children:t}),(0,V.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[e.length,` call`,e.length>1?`s`:``]}),!o&&(0,V.jsxs)(`span`,{className:`truncate text-terminal-dimmer ml-1 flex-1`,children:[l.filter(Boolean).slice(0,3).join(`, `),l.filter(Boolean).length>3&&`...`]}),!o&&f&&(0,V.jsxs)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`~${f} tokens added to context across ${e.length} call${e.length>1?`s`:``}`,children:[`~`,f,` tok`]}),!o&&p&&(0,V.jsx)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`Combined tool execution: ${p}`,children:p})]}),a&&!o&&(0,V.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),a(e[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 ${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/batch:opacity-100`}`,title:c>0?`${c} comment${c>1?`s`:``}`:`Add comment`,children:[`💬`,c>0&&(0,V.jsx)(`span`,{children:c})]}),o&&(0,V.jsx)(`div`,{className:`mt-1 ml-4 space-y-2 pl-4`,children:e.map(({scene:e,index:t})=>{let o=i?.get(t)||0;return(0,V.jsxs)(`div`,{"data-scene-index":t,className:`group/scene relative scene-enter ${a?`pr-7`:``}`,children:[(0,V.jsx)(Ls,{scene:e,isActive:t===n,collapseTools:r}),a&&(0,V.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),a(t)},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&&(0,V.jsx)(`span`,{children:o})]})]},t)})})]})}function Is(e,t){switch(e){case`Read`:return t.file_path||``;case`Glob`:return t.pattern||``;case`Grep`:return t.pattern||``;case`Agent`:return t.description||``;default:return``}}var Ls=(0,_.memo)(function({scene:e,isActive:t,collapseTools:n,effectiveContent:r}){switch(e.type){case`user-prompt`:return(0,V.jsx)(Ds,{content:r??e.content,images:e.images,isActive:t});case`compaction-summary`:return(0,V.jsx)(Oa,{content:e.content,isActive:t});case`context-injection`:return(0,V.jsx)(Oa,{content:e.content,isActive:t});case`thinking`:return(0,V.jsx)(ja,{content:e.content,isActive:t,tokens:e.tokens});case`text-response`:return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Aa,{content:r??e.content,isActive:t}),e.isTruncated&&(0,V.jsx)(`div`,{className:`mt-1 text-[10px] font-mono text-terminal-orange/70 italic`,children:`Response truncated (max_tokens reached)`})]});case`tool-call`:return(0,V.jsx)(bs,{scene:e,isActive:t,forceCollapse:n})}}),Rs=8;function zs({title:e,color:t}){return(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold uppercase tracking-widest ${t}`,children:e}),(0,V.jsx)(`div`,{className:`flex-1 h-px bg-terminal-border-subtle`})]})}function Bs({text:e,label:t}){let[n,r]=(0,_.useState)(!1);return(0,V.jsx)(`button`,{onClick:async()=>{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!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:n?`Copied!`:t||`Copy`})}function Vs(e){try{let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}catch{return``}}function Hs(e,t=!1){let n=t?Math.round(e*.75):e;if(n<1024)return`${n} B`;let r=n/1024;return r<1024?`${r.toFixed(1)} KB`:`${(r/1024).toFixed(1)} MB`}function Us({label:e,path:t}){return(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-mono text-terminal-dim`,children:[(0,V.jsx)(`span`,{className:`text-terminal-dimmer w-8 shrink-0`,children:e}),(0,V.jsx)(`span`,{className:`text-terminal-text truncate`,children:t})]})}function Ws({actions:e,viewerMode:t,readOnly:n,session:r}){let{hasUnsaved:i,canSaveHtml:a,downloadHtml:o,downloadJson:s,publishGist:c,exportHtml:l,exportGithub:u,htmlExporting:d,githubExporting:f}=e,p=t===`editor`,[m,h]=(0,_.useState)(null),[g,v]=(0,_.useState)(null),[y,b]=(0,_.useState)(null),[x,S]=(0,_.useState)(null),[C,w]=(0,_.useState)(!1),[T,E]=(0,_.useState)(null),[D,O]=(0,_.useState)(!1),[k,A]=(0,_.useState)(null),[j,M]=(0,_.useState)(`preview`),[N,ee]=(0,_.useState)(`unlisted`),[P,F]=(0,_.useState)(!1),[I,te]=(0,_.useState)(!1),[ne,re]=(0,_.useState)(null),[L,R]=(0,_.useState)(null),[z,ie]=(0,_.useState)(null),[ae,oe]=(0,_.useState)(null),[se,ce]=(0,_.useState)(null),[le,ue]=(0,_.useState)(null),[de,fe]=(0,_.useState)(null),[pe,me]=(0,_.useState)(null),[he,ge]=(0,_.useState)(null),_e=(0,_.useRef)(null),ve=(0,_.useRef)(null),ye=(0,_.useRef)(null),be=(0,_.useRef)(null),xe=`https://vibe-replay.com`,Se=p?``:xe,Ce=(0,_.useMemo)(()=>{if(p)return``;try{return new URL(xe).origin}catch{return``}},[p,xe]),B=(0,_.useCallback)((e,t={})=>{let n=`${Se}${e}`;return fetch(n,{...t,...p?{}:{credentials:`include`}})},[Se,p]);(0,_.useEffect)(()=>()=>{_e.current&&=(clearInterval(_e.current),null),ve.current&&=(clearTimeout(ve.current),null),ye.current&&=(clearTimeout(ye.current),null),be.current&&=(window.removeEventListener(`message`,be.current),null)},[]);let we=(0,_.useMemo)(()=>r?new TextEncoder().encode(JSON.stringify(r)).byteLength:0,[r]),Te=10*1024*1024,Ee=we>10485760,De=we>Te,Oe=(0,_.useCallback)(()=>{p&&B(`/api/auth/get-session`).then(e=>e.json()).then(e=>{let t=!!e?.session;b(t),t&&B(`/api/cloud-replays`).then(e=>e.json()).then(e=>{ie(e.storage?.used??null),oe(e.storage?.limit??null),r&&fetch(gr(`/api/cloud-info`)).then(e=>e.json()).then(t=>{let n=t?.cloud?.id,i=n?(e.replays||[]).find(e=>e.id===n):null,a=i||(e.replays||[]).find(e=>e.storageType===`r2`&&e.title===(r.meta.title||r.meta.slug));if(a){let e={id:a.id,url:`${xe}/r/${a.id}`,expiresAt:a.expiresAt||``,visibility:a.visibility};R(e),a.visibility&&ee(a.visibility),i||fetch(gr(`/api/cloud-info`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}).catch(()=>{})}}).catch(()=>{})}).catch(()=>{})}).catch(()=>b(!1))},[p,B]);(0,_.useEffect)(()=>{p&&(c&&(Oe(),w(!0),fetch(gr(`/api/gist-info`)).then(e=>e.json()).then(e=>{e.gist&&S(e.gist)}).catch(()=>{}).finally(()=>w(!1))),u&&fetch(gr(`/api/export/github/status`)).then(e=>e.json()).then(e=>{e.exists&&E({svgContent:e.svgContent,markdown:e.markdown,svgPath:e.svgPath,mdPath:e.mdPath,gifContent:e.gifContent??null,gifPath:e.gifPath??null,gifGeneratedAt:e.gifGeneratedAt,svgGeneratedAt:e.svgGeneratedAt,mdGeneratedAt:e.mdGeneratedAt,replayUrl:e.replayUrl})}).catch(()=>{}))},[p,c,u,B,Oe]),(0,_.useEffect)(()=>{if(!p)return;let e=()=>Oe();return window.addEventListener(`vibe-auth-change`,e),()=>window.removeEventListener(`vibe-auth-change`,e)},[p,Oe]);let ke=(0,_.useCallback)(async()=>{if(r){F(!0),v(null);try{let e=JSON.stringify(r),t=r.meta.title||r.meta.slug,n=`${t.replace(/[^a-zA-Z0-9_-]/g,`-`).replace(/-+/g,`-`).slice(0,60)}.json`,i=await B(x?`/api/gists/${x.gistId}`:`/api/gists`,{method:x?`PATCH`:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filename:n,content:e,description:`vibe-replay: ${t}`,public:!0})});if(!i.ok){let e=(await i.json().catch(()=>({}))).error||`Gist publish failed`;if(i.status===401)throw b(!1),Error(e);if(x&&(i.status===404||e.includes(`not found`))){S(null),fetch(gr(`/api/gist-info`),{method:`DELETE`}).catch(()=>{}),v({type:`error`,text:`Gist was deleted on GitHub. Click again to create a new one.`});return}throw Error(e)}let a=await i.json();S({gistId:a.gistId,gistUrl:a.gistUrl,viewerUrl:a.viewerUrl,updatedAt:new Date().toISOString()}),v({type:`success`,text:`Published!`})}catch(e){v({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{F(!1)}}},[r,x,B]),Ae=(0,_.useCallback)(async()=>{if(r){te(!0),re(null);try{let e=L?.id,t=await B(`/api/cloud-replays`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({replay:r,visibility:N})});if(!t.ok){let e=await t.json().catch(()=>({}));throw t.status===401&&b(!1),Error(e.error||`Upload failed`)}let n=await t.json();e&&e!==n.id&&await B(`/api/cloud-replays/${e}`,{method:`DELETE`}).catch(()=>{}),R(n),re({type:`success`,text:e?`Updated!`:`Shared!`}),fetch(gr(`/api/cloud-info`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...n,visibility:N})}).catch(()=>{});let i=await B(`/api/cloud-replays`).catch(()=>null);if(i){let e=await i.json().catch(()=>null);e?.storage&&(ie(e.storage.used??null),oe(e.storage.limit??null))}}catch(e){re({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{te(!1)}}},[r,N,L,B]),je=(0,_.useCallback)(async()=>{if(L?.id){te(!0),re(null);try{let e=await B(`/api/cloud-replays/${L.id}`,{method:`DELETE`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||`Delete failed`)}R(null),re({type:`success`,text:`Removed from cloud`}),fetch(gr(`/api/cloud-info`),{method:`DELETE`}).catch(()=>{}),B(`/api/cloud-replays`).then(e=>e.json()).then(e=>{ie(e.storage?.used??null),oe(e.storage?.limit??null)}).catch(()=>{})}catch(e){re({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{te(!1)}}},[L,B]),Me=(0,_.useCallback)(()=>{B(`/api/cloud-replays`).then(e=>e.json()).then(e=>{ie(e.storage?.used??null),oe(e.storage?.limit??null)}).catch(()=>{})},[B]),Ne=(0,_.useCallback)(async e=>{let t=e===`gif`?T?.gifContent:T?.svgContent;if(!t)return;let n=e===`gif`?me:ge;fe(e),n(null);try{let r=e===`svg`?btoa(Array.from(new TextEncoder().encode(t),e=>String.fromCharCode(e)).join(``)):t,i=e===`gif`?`image/gif`:`image/svg+xml`,a=`session-preview.${e}`,o=e===`gif`?se:le,s=await B(`/api/files`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:r,contentType:i,filename:a,parentReplayId:L?.id||null,visibility:N})});if(!s.ok){let e=await s.json().catch(()=>({}));throw s.status===401&&b(!1),Error(e.error||`Upload failed`)}let c=await s.json();o&&await B(`/api/files/${o.id}`,{method:`DELETE`}).catch(()=>{});let l={id:c.id,url:c.url};e===`gif`?ce(l):ue(l),n({type:`success`,text:`Shared!`}),navigator.clipboard.writeText(c.url).catch(()=>{}),Me()}catch(e){n({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{fe(null)}},[T,se,le,L,N,B,Me]),H=(0,_.useCallback)(async()=>{if(u){A(null),O(!0);try{let e=await u();await navigator.clipboard.writeText(e.markdown),E({svgContent:e.svgContent,markdown:e.markdown,svgPath:e.svgPath,mdPath:e.mdPath,gifContent:e.gifContent??null,gifPath:e.gifPath??null,gifGeneratedAt:e.gifGeneratedAt,svgGeneratedAt:e.svgGeneratedAt,mdGeneratedAt:e.mdGeneratedAt,replayUrl:e.replayUrl,warnings:e.warnings})}catch(e){A(e instanceof Error?e.message:String(e))}finally{O(!1)}}},[u]),Pe=(0,_.useMemo)(()=>{if(!T?.markdown)return``;let e=T.markdown.replace(/\[?!\[[^\]]*\]\([^)]*\.(?:svg|gif)\)\]?(?:\([^)]*\))?\n*/g,``);return ha(K.parse(e))},[T?.markdown]),Fe=(0,_.useMemo)(()=>T?.svgContent?ga(T.svgContent):``,[T?.svgContent]);if(n)return(0,V.jsx)(`div`,{className:`p-6 text-center text-xs font-mono text-terminal-dim`,children:`Export is not available in read-only mode`});let Ie=`px-4 py-2 text-xs font-mono rounded-lg transition-colors text-center disabled:opacity-50 shrink-0`;return(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,V.jsx)(`div`,{className:`p-6 max-w-3xl mx-auto`,children:(0,V.jsxs)(`div`,{children:[r&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 mb-5`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-mono font-semibold text-terminal-text truncate`,children:r.meta.title||r.meta.slug}),r.meta.provider&&(0,V.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.meta.provider})]}),i&&(0,V.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`}),p&&(0,V.jsxs)(`div`,{id:`share`,className:`mb-12`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,V.jsx)(zs,{title:`Share`,color:`text-terminal-purple`}),we>0&&(0,V.jsxs)(`span`,{className:`text-[11px] font-mono px-2 py-0.5 rounded-md ${we>Te?`bg-terminal-red-subtle text-terminal-red`:`bg-terminal-surface-2 text-terminal-dimmer`}`,children:[Hs(we),` replay`]})]}),y===!1?(0,V.jsx)(`div`,{className:`bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden`,children:(0,V.jsxs)(`div`,{className:`p-6`,children:[(0,V.jsx)(`h3`,{className:`text-lg font-sans font-semibold text-terminal-text mb-5`,children:`Share your session — free`}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 mb-6`,children:[(0,V.jsxs)(`div`,{className:`rounded-xl bg-terminal-bg border border-terminal-border-subtle p-5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,V.jsx)(`span`,{className:`text-xs font-sans font-bold text-terminal-purple`,children:`Cloud Share`}),(0,V.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`})]}),(0,V.jsxs)(`ul`,{className:`space-y-2.5 text-sm font-sans text-terminal-dim`,children:[(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`20 MB free storage`]}),(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`7-day shareable link`]})]})]}),(0,V.jsxs)(`div`,{className:`rounded-xl bg-terminal-bg border border-terminal-border-subtle p-5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,V.jsx)(`span`,{className:`text-xs font-sans font-bold text-terminal-dim`,children:`GitHub Gist`}),(0,V.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`})]}),(0,V.jsxs)(`ul`,{className:`space-y-2.5 text-sm font-sans text-terminal-dim`,children:[(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`No storage limit`]}),(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`Permanent — never expires`]}),(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`Great for portfolios`]})]})]})]}),(0,V.jsxs)(`button`,{type:`button`,onClick:async()=>{if(_e.current&&=(clearInterval(_e.current),null),ve.current&&=(clearTimeout(ve.current),null),ye.current&&=(clearTimeout(ye.current),null),be.current&&=(window.removeEventListener(`message`,be.current),null),p){try{let e=await fetch(`/api/auth/login`,{method:`POST`}),t=await e.json().catch(()=>null);e.ok&&t?.url&&window.open(t.url,`_blank`)}catch{}_e.current=setInterval(async()=>{try{(await(await fetch(`/api/auth/get-session`)).json())?.session&&(_e.current&&=(clearInterval(_e.current),null),ve.current&&=(clearTimeout(ve.current),null),b(!0),window.dispatchEvent(new Event(`vibe-auth-change`)))}catch{}},2e3),ve.current=setTimeout(()=>{_e.current&&=(clearInterval(_e.current),null),ve.current=null},300*1e3);return}window.open(`${xe}/auth/login?callback=/auth/success`,`_blank`);let e=t=>{t.origin===Ce&&t.data?.type===`vibe-replay-auth`&&t.data.user&&(window.removeEventListener(`message`,e),be.current=null,ye.current&&=(clearTimeout(ye.current),null),b(!0),window.dispatchEvent(new Event(`vibe-auth-change`)))};be.current=e,window.addEventListener(`message`,e),ye.current=setTimeout(()=>{window.removeEventListener(`message`,e),ye.current=null,be.current===e&&(be.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:[(0,V.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`transition-transform group-hover:scale-110`,children:(0,V.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`]})]})}):y===!0?(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden p-5 flex flex-col`,children:[(0,V.jsx)(`div`,{className:`flex items-center gap-2 mb-3`,children:(0,V.jsx)(`span`,{className:`text-sm font-mono font-semibold text-terminal-purple`,children:`Cloud Share`})}),(0,V.jsx)(`div`,{className:`flex items-center h-7 rounded-md overflow-hidden bg-terminal-bg mb-3`,children:[{value:`private`,label:`Private`,icon:(0,V.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`}),(0,V.jsx)(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`})]})},{value:`unlisted`,label:`Link only`,icon:(0,V.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.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`}),(0,V.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:(0,V.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,V.jsx)(`line`,{x1:`2`,y1:`12`,x2:`22`,y2:`12`}),(0,V.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:e,label:t,icon:n})=>(0,V.jsxs)(`button`,{onClick:()=>ee(e),className:`h-full flex-1 px-2.5 text-[11px] font-mono transition-colors flex items-center justify-center gap-1.5 whitespace-nowrap ${N===e?`bg-terminal-purple-subtle text-terminal-purple`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,children:[n,t]},e))}),z!=null&&ae!=null&&(0,V.jsxs)(`div`,{className:`mb-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] font-mono text-terminal-dimmer mb-1.5`,children:[(0,V.jsxs)(`span`,{children:[Hs(z),` used`]}),(0,V.jsxs)(`span`,{children:[Hs(ae),` total`]})]}),(()=>{let e=z/ae*100,t=!L&&we>0,n=t?we/ae*100:0,r=t&&z+we>ae;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`h-2 rounded-full bg-terminal-surface-hover overflow-hidden`,children:(0,V.jsxs)(`div`,{className:`h-full flex`,children:[z>0&&(0,V.jsx)(`div`,{className:`h-full bg-terminal-purple transition-all`,style:{width:`${Math.max(e,1)}%`}}),t&&(0,V.jsx)(`div`,{className:`h-full transition-all ${r?`bg-terminal-orange`:`bg-terminal-green`}`,style:{width:`${Math.max(Math.min(n,100-e),1)}%`}})]})}),t&&(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mt-1.5 text-[10px] font-mono text-terminal-dimmer`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-sm bg-terminal-purple`}),Hs(z),` used`]}),(0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-sm ${r?`bg-terminal-orange`:`bg-terminal-green`}`}),`+`,Hs(we),` this upload`]})]})]})})()]}),(0,V.jsxs)(`p`,{className:`text-[10px] font-mono text-terminal-dimmer flex items-center gap-1.5 mb-1`,children:[(0,V.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:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,V.jsx)(`polyline`,{points:`12 6 12 12 16 14`})]}),`Free tier links expire after 7 days`]}),Ee&&(0,V.jsxs)(`p`,{className:`text-[11px] font-mono text-terminal-orange mt-1.5 flex items-center gap-1`,children:[(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,V.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 `,Hs(we),` — exceeds 10MB limit`]}),L&&(0,V.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.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:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green`}),`Shared`]}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[`expires `,new Date(`${L.expiresAt}Z`).toLocaleDateString()]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle`,children:[(0,V.jsx)(`a`,{href:`${xe}/r/${L.id}`,target:`_blank`,rel:`noopener noreferrer`,className:`flex-1 text-xs font-mono text-terminal-purple hover:text-terminal-text transition-colors truncate`,children:`${xe}/r/${L.id}`}),(0,V.jsx)(Bs,{text:`${xe}/r/${L.id}`})]})]}),(0,V.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,V.jsx)(`button`,{onClick:Ae,disabled:I||Ee,className:`${Ie} ${Ee?`bg-terminal-surface-2 text-terminal-dimmer border border-terminal-border cursor-not-allowed`:L?`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:I?`Uploading...`:Ee?`Too large`:L?`Update`:`Share to Cloud`}),L&&(0,V.jsx)(`button`,{onClick:je,disabled:I,className:`${Ie} bg-terminal-surface-hover text-terminal-red hover:bg-terminal-red-subtle border border-terminal-border`,children:`Delete`}),ne&&(0,V.jsx)(`span`,{className:`text-[11px] font-mono ${ne.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:ne.text})]})]}),p&&(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden p-5 flex flex-col`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,V.jsx)(`span`,{className:`text-sm font-mono font-semibold text-terminal-dim`,children:`GitHub Gist`}),(0,V.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`})]}),(0,V.jsxs)(`ul`,{className:`space-y-1.5 text-xs font-sans text-terminal-dim mb-auto`,children:[(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`Hosted on GitHub forever`]}),(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`Doesn't use your storage`]}),(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-terminal-orange shrink-0`,children:`!`}),`Visible to everyone on the internet`]})]}),De&&(0,V.jsxs)(`p`,{className:`text-[11px] font-mono text-terminal-red mt-1.5 flex items-center gap-1`,children:[(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,V.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 `,Hs(we),` — exceeds 10MB limit`]}),x&&(0,V.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.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:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green`}),`Published`]}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:Vs(x.updatedAt)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle`,children:[(0,V.jsx)(`a`,{href:x.viewerUrl,target:`_blank`,rel:`noopener noreferrer`,className:`flex-1 text-xs font-mono text-terminal-blue hover:text-terminal-text transition-colors truncate`,children:x.viewerUrl}),(0,V.jsx)(Bs,{text:x.viewerUrl})]})]}),C&&!x&&(0,V.jsx)(`div`,{className:`mt-4 text-[11px] font-mono text-terminal-dimmer animate-pulse`,children:`Checking...`}),(0,V.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,V.jsx)(`button`,{onClick:ke,disabled:P||De,className:`${Ie} ${De?`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:P?`Publishing...`:De?`Too large`:x?`Update Gist`:`Publish to Gist`}),g&&(0,V.jsx)(`span`,{className:`text-[11px] font-mono ${g.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:g.text}),x&&(0,V.jsx)(`a`,{href:x.gistUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-[11px] font-mono text-terminal-blue hover:text-terminal-text transition-colors`,children:`Open on GitHub`})]})]})]}):(0,V.jsx)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer animate-pulse p-2`,children:`Checking login status...`})]}),(0,V.jsxs)(`div`,{id:`export`,children:[(0,V.jsx)(zs,{title:`Export`,color:`text-terminal-green`}),(0,V.jsxs)(`div`,{className:`space-y-4`,children:[p&&u&&(0,V.jsxs)(V.Fragment,{children:[T?.gifContent&&(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-green`,children:`Animated GIF`}),(0,V.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.`})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[T.gifGeneratedAt&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:Vs(T.gifGeneratedAt)}),(0,V.jsx)(`button`,{onClick:H,disabled:D||f,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:D||f?(0,V.jsx)(`span`,{className:`animate-pulse`,children:`...`}):(0,V.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,V.jsx)(`path`,{d:`M21 3v5h-5`}),(0,V.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,V.jsx)(`path`,{d:`M8 16H3v5`})]})})]})]}),(0,V.jsx)(`div`,{className:`bg-terminal-bg p-2 flex justify-center border-y border-terminal-border-subtle`,children:(0,V.jsx)(`img`,{src:`data:image/gif;base64,${T.gifContent}`,alt:`Session preview GIF`,className:`w-full h-auto block`})}),(0,V.jsxs)(`div`,{className:`px-5 py-3 space-y-2 border-t border-terminal-border-subtle`,children:[T.gifPath&&(0,V.jsx)(Us,{label:`File`,path:`${T.gifPath} (${Hs(T.gifContent?.length??0,!0)})`}),se?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle`,children:[(0,V.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:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green`}),`Shared`]}),(0,V.jsx)(`span`,{className:`flex-1 text-xs font-mono text-terminal-purple truncate`,children:se.url}),(0,V.jsx)(Bs,{text:se.url})]}):(0,V.jsxs)(`p`,{className:`text-[10px] font-mono text-terminal-dimmer leading-relaxed`,children:[`Usage:`,` `,(0,V.jsx)(`span`,{className:`text-terminal-text`,children:``})]}),y&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`button`,{onClick:()=>Ne(`gif`),disabled:de===`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:de===`gif`?`Uploading...`:se?`Update link`:`Share to Cloud`}),pe&&de===null&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono ${pe.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:pe.text})]})]})]}),T?.svgContent&&(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-orange`,children:`Animated SVG`}),(0,V.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`,` `,Rs,` turns.`]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[T.svgGeneratedAt&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:Vs(T.svgGeneratedAt)}),(0,V.jsx)(`button`,{onClick:H,disabled:D||f,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:D||f?(0,V.jsx)(`span`,{className:`animate-pulse`,children:`...`}):(0,V.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,V.jsx)(`path`,{d:`M21 3v5h-5`}),(0,V.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,V.jsx)(`path`,{d:`M8 16H3v5`})]})})]})]}),(0,V.jsx)(`div`,{className:`bg-terminal-bg p-2 border-y border-terminal-border-subtle [&>svg]:w-full [&>svg]:h-auto [&>svg]:block`,dangerouslySetInnerHTML:{__html:Fe}}),(0,V.jsxs)(`div`,{className:`px-5 py-3 space-y-2 border-t border-terminal-border-subtle`,children:[(0,V.jsx)(Us,{label:`File`,path:`${T.svgPath} (${Hs(T.svgContent?.length??0)})`}),T.replayUrl&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-mono text-terminal-dim`,children:[(0,V.jsx)(`span`,{className:`text-terminal-dimmer w-8 shrink-0`,children:`Link`}),(0,V.jsx)(`a`,{href:T.replayUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-terminal-blue hover:text-terminal-text transition-colors truncate`,children:T.replayUrl})]}),le?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle`,children:[(0,V.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:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green`}),`Shared`]}),(0,V.jsx)(`span`,{className:`flex-1 text-xs font-mono text-terminal-purple truncate`,children:le.url}),(0,V.jsx)(Bs,{text:le.url})]}):(0,V.jsxs)(`p`,{className:`text-[10px] font-mono text-terminal-dimmer leading-relaxed`,children:[`Usage:`,` `,(0,V.jsx)(`span`,{className:`text-terminal-text`,children:``})]}),y&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`button`,{onClick:()=>Ne(`svg`),disabled:de===`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:de===`svg`?`Uploading...`:le?`Update link`:`Share to Cloud`}),he&&de===null&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono ${he.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:he.text})]})]})]}),T?.markdown&&(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-orange`,children:`Markdown Summary`}),(0,V.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-dim mt-0.5`,children:`Paste into GitHub PRs, issues, or README files.`})]}),T.mdGeneratedAt&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer self-start mt-0.5`,children:Vs(T.mdGeneratedAt)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(Bs,{text:T.markdown,label:`Copy MD`}),(0,V.jsxs)(`div`,{className:`flex items-center h-6 rounded-md overflow-hidden bg-terminal-bg border border-terminal-border-subtle`,children:[(0,V.jsx)(`button`,{onClick:()=>M(`preview`),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${j===`preview`?`bg-terminal-orange-subtle text-terminal-orange`:`text-terminal-dim hover:text-terminal-text`}`,children:`Preview`}),(0,V.jsx)(`button`,{onClick:()=>M(`source`),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${j===`source`?`bg-terminal-orange-subtle text-terminal-orange`:`text-terminal-dim hover:text-terminal-text`}`,children:`Source`})]})]})]}),(0,V.jsx)(`div`,{className:`p-4`,children:j===`preview`?(0,V.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:Pe}}):(0,V.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:T.markdown})}),(0,V.jsx)(`div`,{className:`px-5 py-3 space-y-1.5 border-t border-terminal-border-subtle`,children:(0,V.jsx)(Us,{label:`File`,path:T.mdPath})}),T.warnings&&T.warnings.length>0&&(0,V.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:[(0,V.jsx)(`div`,{className:`font-semibold mb-1`,children:`Security warnings`}),T.warnings.map((e,t)=>(0,V.jsx)(`div`,{className:`text-terminal-dim`,children:e},t))]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`button`,{onClick:H,disabled:D||f,className:`${Ie} ${T?`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:D||f?`Generating...`:T?`Regenerate GIF + SVG + Markdown`:`Generate GIF + SVG + Markdown`}),k&&(0,V.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-red`,children:k}),!T&&(0,V.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.`})]})]}),p&&l&&(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5`,children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-green mb-1`,children:`HTML Replay`}),(0,V.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.`})]}),(0,V.jsx)(`button`,{onClick:async()=>{h(null);try{h({type:`success`,text:await l()})}catch(e){h({type:`error`,text:e instanceof Error?e.message:String(e)})}},disabled:d,className:`${Ie} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis border border-terminal-green/20`,children:d?`Exporting...`:`Export HTML`})]}),m&&(0,V.jsx)(`div`,{className:`mt-3 text-[11px] font-mono ${m.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:m.type===`success`?(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green shrink-0`}),`Saved to `,m.text]}):m.text})]}),!p&&a&&(0,V.jsx)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5`,children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-green mb-1`,children:`Save HTML`}),(0,V.jsx)(`p`,{className:`text-[11px] font-mono text-terminal-dim leading-relaxed`,children:`Download a self-contained HTML replay file with your comments included.`})]}),(0,V.jsx)(`button`,{onClick:o,className:`${Ie} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis border border-terminal-green/20`,children:`Download HTML`})]})}),(0,V.jsx)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5`,children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-blue mb-1`,children:`JSON Data`}),(0,V.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.`})]}),(0,V.jsx)(`button`,{onClick:s,className:`${Ie} bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis border border-terminal-blue/20`,children:`Download JSON`})]})})]})]})]})})})}var Gs=[{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 Ks({open:e,onClose:t}){let n=(0,_.useCallback)(e=>{(e.key===`Escape`||e.key===`?`)&&t()},[t]);return(0,_.useEffect)(()=>{if(e)return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,n]),e?(0,V.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:t,role:`dialog`,"aria-label":`Keyboard shortcuts`,"aria-modal":`true`,children:(0,V.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:e=>e.stopPropagation(),children:[(0,V.jsxs)(`div`,{className:`px-6 py-5 border-b border-terminal-border-subtle flex items-center justify-between`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-sans font-bold uppercase tracking-[0.2em] text-terminal-text`,children:`Keyboard Shortcuts`}),(0,V.jsx)(`button`,{onClick:t,className:`text-terminal-dimmer hover:text-terminal-red transition-colors`,children:(0,V.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:[(0,V.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,V.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),(0,V.jsx)(`div`,{className:`px-6 py-4 grid grid-cols-1 gap-8`,children:Gs.map(e=>(0,V.jsxs)(`div`,{className:`space-y-3.5`,children:[(0,V.jsx)(`h3`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-[0.15em] pl-1`,children:e.title}),(0,V.jsx)(`div`,{className:`grid grid-cols-1 gap-2.5`,children:e.items.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between group`,children:[(0,V.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-dim group-hover:text-terminal-text transition-colors`,children:e.label}),(0,V.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:e.key})]},e.key))})]},e.title))}),(0,V.jsx)(`div`,{className:`px-6 py-4 bg-terminal-surface/30 border-t border-terminal-border-subtle`,children:(0,V.jsxs)(`p`,{className:`text-[10px] font-sans font-medium text-terminal-dimmer text-center uppercase tracking-wider`,children:[`Press `,(0,V.jsx)(`span`,{className:`text-terminal-text font-mono font-bold`,children:`?`}),` to toggle this menu anytime`]})})]})}):null}var qs=ue;function Js({session:e,onStart:t,onViewInsights:n}){let{meta:r,scenes:i}=e,a=(0,_.useMemo)(()=>{let e=i.find(e=>e.type===`user-prompt`);if(!e||e.type!==`user-prompt`)return null;let t=e.content,n={},r=0,a=0,o=``,s=0;for(let e of i){if(e.type===`user-prompt`){if(s++,s>1)break;continue}if(s===1)if(e.type===`tool-call`){a++;let t=e.toolName.replace(/^mcp__.*__/,``);n[t]=(n[t]||0)+1}else e.type===`text-response`&&(r++,o=e.content)}let c=Object.entries(n).sort((e,t)=>t[1]-e[1]);return{prompt:t,responses:r,totalTools:a,toolEntries:c,lastResponse:o}},[i]),o=(0,_.useMemo)(()=>{let e=new Set;for(let t of i)t.type===`tool-call`&&t.diff&&e.add(t.diff.filePath);return e.size},[i]),s=Re(r.stats.durationMs),c=ye(r.project),l=r.title||c,u=qs(r.provider),d=(0,_.useMemo)(()=>{let e=[];if(s&&e.push({value:s,label:`Duration`,color:`text-terminal-text`}),e.push({value:String(r.stats.userPrompts),label:`Turns`,color:`text-terminal-green`}),o>0&&e.push({value:String(o),label:`Files`,color:`text-terminal-blue`}),r.stats.costEstimate!==void 0){let t=r.stats.costEstimate;e.push({value:`$${t<.01?t.toFixed(4):t.toFixed(2)}`,label:`Cost`,color:`text-terminal-orange`})}return e.length<3&&r.stats.toolCalls>0&&e.push({value:String(r.stats.toolCalls),label:`Tool Calls`,color:`text-terminal-orange`}),e},[s,o,r.stats]),f=(0,_.useRef)(!1),p=(0,_.useRef)(0);return(0,_.useEffect)(()=>{let e=e=>{f.current||e.deltaY>0&&(f.current=!0,t(!1))},n=e=>{p.current=e.touches[0].clientY},r=e=>{f.current||p.current-e.touches[0].clientY>15&&(f.current=!0,t(!1))};return window.addEventListener(`wheel`,e,{passive:!0}),window.addEventListener(`touchstart`,n,{passive:!0}),window.addEventListener(`touchmove`,r,{passive:!0}),()=>{window.removeEventListener(`wheel`,e),window.removeEventListener(`touchstart`,n),window.removeEventListener(`touchmove`,r)}},[t]),(0,_.useEffect)(()=>{let e=e=>{(e.key===` `||e.key===`Enter`||e.key===`ArrowDown`||e.key===`ArrowRight`)&&(e.preventDefault(),t())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]),(0,V.jsxs)(`div`,{className:`flex-1 flex flex-col items-center overflow-y-auto relative`,children:[(0,V.jsxs)(`div`,{className:`absolute inset-0 pointer-events-none`,children:[(0,V.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-b from-terminal-green-subtle via-transparent to-transparent`}),(0,V.jsx)(`div`,{className:`absolute inset-0 bg-dot-grid`})]}),(0,V.jsx)(`div`,{className:`flex-1 min-h-4 md:min-h-0`}),(0,V.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:[(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h2`,{className:`text-3xl sm:text-4xl md:text-5xl font-sans font-bold text-terminal-text leading-[1.15] tracking-tight`,children:l}),(0,V.jsxs)(`p`,{className:`text-sm font-sans text-terminal-dim`,children:[`A `,u,` session replay by `,(0,V.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`})]}),(r.gitBranch||r.model)&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap mt-2`,children:[r.gitBranch&&(0,V.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:r.gitBranches?r.gitBranches.join(` → `):r.gitBranch,children:r.gitBranches&&r.gitBranches.length>1?`${r.gitBranches[0]} → ${r.gitBranch}`:r.gitBranch}),r.model&&(0,V.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:r.model}),r.permissionMode===`bypassPermissions`&&(0,V.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`})]})]}),a&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(),className:`w-full text-left appearance-none bg-transparent border-none p-0 cursor-pointer space-y-3`,children:[(0,V.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:[(0,V.jsx)(`div`,{className:`flex items-center gap-2 mb-2.5`,children:(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-green uppercase tracking-widest`,children:`You`})}),(0,V.jsx)(`div`,{className:`text-terminal-green font-mono text-sm whitespace-pre-wrap break-words line-clamp-3`,children:a.prompt})]}),(0,V.jsxs)(`div`,{className:`rounded-xl px-5 py-4 bg-terminal-surface shadow-layer-sm`,children:[(0,V.jsx)(`div`,{className:`flex items-center gap-2 mb-2.5`,children:(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-secondary-text uppercase tracking-widest`,children:`Assistant`})}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mb-3 text-[11px] font-mono`,children:[a.responses>0&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue`,children:[a.responses,` response`,a.responses>1?`s`:``]}),a.totalTools>0&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange`,children:[a.totalTools,` tool`,a.totalTools>1?`s`:``]}),a.toolEntries.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-terminal-border mx-0.5`,children:`|`}),a.toolEntries.map(([e,t])=>(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-terminal-surface-hover text-terminal-dim`,children:[(0,V.jsx)(`span`,{className:`text-terminal-orange`,children:e}),(0,V.jsx)(`span`,{children:t})]},e))]})]}),a.lastResponse&&(0,V.jsx)(`div`,{className:`text-sm font-mono text-terminal-dim whitespace-pre-wrap break-words line-clamp-2 leading-relaxed`,children:a.lastResponse})]}),r.stats.userPrompts>1&&(0,V.jsx)(`div`,{className:`text-center`,children:(0,V.jsxs)(`span`,{className:`text-[11px] font-sans text-terminal-dimmer`,children:[`and `,r.stats.userPrompts-1,` more turn`,r.stats.userPrompts-1==1?``:`s`,` `,`→`]})})]}),(0,V.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-2 sm:gap-3 max-w-lg mx-auto`,children:d.map(e=>(0,V.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:[(0,V.jsx)(`div`,{className:`text-base sm:text-xl font-bold font-mono tabular-nums ${e.color}`,children:e.value}),(0,V.jsx)(`div`,{className:`text-[9px] sm:text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-medium`,children:e.label})]},e.label))}),(0,V.jsxs)(`div`,{className:`hidden md:flex items-center justify-center gap-3 flex-wrap`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(),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:[(0,V.jsx)(`span`,{className:`text-xl text-terminal-green group-hover:scale-110 transition-transform duration-200`,children:`▶`}),(0,V.jsx)(`span`,{className:`text-base font-sans font-semibold text-terminal-green tracking-wide`,children:`Watch Replay`})]}),n&&(0,V.jsxs)(`button`,{type:`button`,onClick:n,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:[(0,V.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:[(0,V.jsx)(`line`,{x1:`18`,x2:`18`,y1:`20`,y2:`10`}),(0,V.jsx)(`line`,{x1:`12`,x2:`12`,y1:`20`,y2:`4`}),(0,V.jsx)(`line`,{x1:`6`,x2:`6`,y1:`20`,y2:`14`})]}),(0,V.jsx)(`span`,{className:`text-sm font-sans font-semibold text-terminal-dim group-hover:text-terminal-text tracking-wide`,children:`View Insights`})]})]}),(0,V.jsx)(`div`,{className:`h-24 md:hidden`})]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(!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:[(0,V.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-dim group-hover:text-terminal-text transition-colors`,children:`or scroll down`}),(0,V.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:(0,V.jsx)(`path`,{d:`M6 9l6 6 6-6`})})]}),(0,V.jsx)(`div`,{className:`flex-1 min-h-0`}),(0,V.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:(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mx-6 my-4`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(),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:[(0,V.jsx)(`span`,{className:`text-base`,children:`▶`}),(0,V.jsx)(`span`,{className:`text-sm font-sans`,children:`Watch Replay`})]}),n&&(0,V.jsxs)(`button`,{type:`button`,onClick:n,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:[(0,V.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:[(0,V.jsx)(`line`,{x1:`18`,x2:`18`,y1:`20`,y2:`10`}),(0,V.jsx)(`line`,{x1:`12`,x2:`12`,y1:`20`,y2:`4`}),(0,V.jsx)(`line`,{x1:`6`,x2:`6`,y1:`20`,y2:`14`})]}),(0,V.jsx)(`span`,{className:`text-sm font-sans font-medium text-terminal-dim`,children:`Insights`})]})]})})]})}function Ys({scenes:e,currentIndex:t,onSeek:n,overlayActions:r,turnStats:i}){let a=(0,_.useMemo)(()=>{let t=[],n=null,i=0;return e.forEach((e,a)=>{if(e.type===`user-prompt`){n&&(n.endIndex=a-1,t.push(n)),i++;let o=r?.getEffectiveContent(a)??e.content;n={kind:`turn`,turnNumber:i,promptIndex:a,prompt:o.replace(/\n/g,` `).slice(0,120),toolCalls:0,toolNames:[],thinkingBlocks:0,textBlocks:0,subAgentCalls:0,endIndex:a}}else e.type===`compaction-summary`||e.type===`context-injection`?(n&&=(n.endIndex=a-1,t.push(n),null),t.push({kind:e.type===`context-injection`?`injection`:`compaction`,promptIndex:a,preview:e.content.replace(/\n/g,` `).slice(0,80)})):n&&(n.endIndex=a,e.type===`tool-call`?(n.toolCalls++,e.toolName===`Agent`&&e.subAgent&&n.subAgentCalls++,n.toolNames.includes(e.toolName)||n.toolNames.push(e.toolName)):e.type===`thinking`?n.thinkingBlocks++:e.type===`text-response`&&n.textBlocks++)}),n&&t.push(n),t},[e,r?.getEffectiveContent]),o=(0,_.useMemo)(()=>{for(let e=a.length-1;e>=0;e--)if(t>=a[e].promptIndex)return e;return-1},[a,t]);return(0,V.jsx)(`div`,{className:`flex flex-col gap-1 p-3.5 overflow-y-auto`,children:a.map((e,t)=>{let r=t===o,a=t<o;if(e.kind!==`turn`){let t=e.kind===`injection`?`System context`:`Context compacted`,i=e.kind===`injection`?`⚡`:`⟳`;return(0,V.jsx)(`button`,{onClick:()=>n(e.promptIndex),className:`text-left px-3 py-2 rounded-lg transition-all duration-200 ease-material ${r?`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:(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer shrink-0`,children:i}),(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer italic truncate`,children:t})]})},`c-${e.promptIndex}`)}return(0,V.jsxs)(`button`,{onClick:()=>n(e.promptIndex),className:`group text-left px-3 py-2.5 rounded-xl transition-all duration-200 ease-material ${r?`bg-terminal-green-subtle border-l-2 border-terminal-green shadow-layer-sm`:a?`hover:bg-terminal-surface-hover text-terminal-dim hover:text-terminal-text`:`hover:bg-terminal-surface-hover`}`,children:[(0,V.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono font-semibold shrink-0 mt-px tabular-nums ${r?`text-terminal-green`:`text-terminal-dim`}`,children:String(e.turnNumber).padStart(2,`0`)}),(0,V.jsx)(`span`,{className:`text-sm font-mono leading-snug line-clamp-2 text-terminal-text`,children:e.prompt})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5 ml-6 flex-wrap`,children:[e.toolCalls>0&&(0,V.jsxs)(`span`,{className:`text-[10px] font-mono px-1.5 py-px rounded-full bg-terminal-orange-subtle text-terminal-orange`,children:[e.toolCalls,` tool`,e.toolCalls>1?`s`:``]}),e.subAgentCalls>0&&(0,V.jsxs)(`span`,{className:`text-[10px] font-mono px-1.5 py-px rounded-full bg-green-500/20 text-green-300`,children:[e.subAgentCalls,` agent`,e.subAgentCalls>1?`s`:``]}),e.textBlocks>0&&(0,V.jsxs)(`span`,{className:`text-[10px] font-mono px-1.5 py-px rounded-full bg-terminal-blue-subtle text-terminal-blue`,children:[e.textBlocks,` resp`]}),e.thinkingBlocks>0&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-px rounded-full bg-terminal-purple-subtle text-terminal-purple`,children:`think`}),(()=>{let t=i?.[e.turnNumber-1];return t?.durationMs?(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:Re(t.durationMs)}):null})()]}),r&&e.toolNames.length>0&&(0,V.jsx)(`div`,{className:`mt-1.5 ml-6 text-xs font-mono text-terminal-dim truncate`,children:e.toolNames.join(`, `)})]},`t-${e.promptIndex}`)})})}function Xs(e){switch(e.type){case`user-prompt`:return e.content;case`compaction-summary`:return e.content;case`context-injection`:return e.content;case`thinking`:return e.content;case`text-response`:return e.content;case`tool-call`:return[e.toolName,JSON.stringify(e.input),e.result||``,e.bashOutput?.command||``,e.bashOutput?.stdout||``].join(` `);default:return``}}function Zs(e,t){let n=e.toLowerCase().indexOf(t.toLowerCase());if(n===-1)return e.slice(0,120);let r=Math.max(0,n-40),i=Math.min(e.length,n+t.length+60);return(r>0?`...`:``)+e.slice(r,i)+(i<e.length?`...`:``)}var Qs={"user-prompt":`User`,"compaction-summary":`Compaction`,"context-injection":`Injection`,thinking:`Thinking`,"text-response":`Response`,"tool-call":`Tool`},$s={"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 ec({scenes:e,open:t,onClose:n,onSeek:r}){let[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(0),c=(0,_.useRef)(null),l=(0,_.useRef)(null);(0,_.useEffect)(()=>{t&&(a(``),s(0),setTimeout(()=>c.current?.focus(),50))},[t]);let u=(0,_.useMemo)(()=>{if(i.length<2)return[];let t=i.toLowerCase(),n=[];for(let r=0;r<e.length;r++){let a=e[r],o=Xs(a);if(o.toLowerCase().includes(t)&&n.push({sceneIndex:r,type:a.type,snippet:Zs(o,i),toolName:a.type===`tool-call`?a.toolName:void 0}),n.length>=50)break}return n},[e,i]);(0,_.useEffect)(()=>{l.current&&l.current.children[o]?.scrollIntoView({block:`nearest`})},[o]);let d=(0,_.useCallback)(e=>{let t=u[e];t&&(r(t.sceneIndex),n())},[u,r,n]),f=(0,_.useCallback)(e=>{e.key===`ArrowDown`?(e.preventDefault(),s(e=>Math.min(e+1,u.length-1))):e.key===`ArrowUp`?(e.preventDefault(),s(e=>Math.max(e-1,0))):e.key===`Enter`?(e.preventDefault(),d(o)):e.key===`Escape`&&n()},[u.length,o,d,n]);return t?(0,V.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[8vh] sm:pt-[15vh]`,onClick:n,role:`dialog`,"aria-label":`Search scenes`,"aria-modal":`true`,children:[(0,V.jsx)(`div`,{className:`absolute inset-0 bg-black/50 backdrop-blur-sm`}),(0,V.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:e=>e.stopPropagation(),onKeyDown:f,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-3.5 border-b border-terminal-border-subtle`,children:[(0,V.jsx)(`span`,{className:`text-terminal-dim text-sm`,children:`🔍`}),(0,V.jsx)(`input`,{ref:c,type:`text`,value:i,onChange:e=>{a(e.target.value),s(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`}),(0,V.jsx)(`kbd`,{className:`text-[10px] font-mono text-terminal-dimmer bg-terminal-surface px-2 py-0.5 rounded-md`,children:`ESC`})]}),(0,V.jsx)(`div`,{ref:l,className:`max-h-[50vh] overflow-y-auto`,children:i.length<2?(0,V.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`}):u.length===0?(0,V.jsxs)(`div`,{className:`px-4 py-8 text-center text-xs font-sans font-medium text-terminal-dim`,children:[`No results for "`,i,`"`]}):u.map((e,t)=>(0,V.jsxs)(`button`,{onClick:()=>d(t),className:`w-full text-left px-4 py-2.5 flex items-start gap-3 transition-colors ${t===o?`bg-terminal-green/10`:`hover:bg-terminal-surface/50`}`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-bold uppercase shrink-0 mt-0.5 tracking-wider ${$s[e.type]||`text-terminal-dim`}`,children:e.toolName||Qs[e.type]||e.type}),(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-text line-clamp-2 break-words`,children:tc(e.snippet,i)}),(0,V.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dimmer shrink-0 mt-0.5`,children:[`#`,e.sceneIndex]})]},e.sceneIndex))}),u.length>0&&(0,V.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:[(0,V.jsxs)(`span`,{children:[u.length,` result`,u.length===1?``:`s`]}),(0,V.jsx)(`span`,{children:`↑↓ navigate`}),(0,V.jsx)(`span`,{children:`↵ select`})]})]})]}):null}function tc(e,t){if(!t)return e;let n=[],r=e.toLowerCase(),i=t.toLowerCase(),a=0,o=r.indexOf(i);for(;o!==-1;)o>a&&n.push(e.slice(a,o)),n.push((0,V.jsx)(`mark`,{className:`bg-terminal-green/30 text-terminal-green rounded-sm px-0.5`,children:e.slice(o,o+t.length)},o)),a=o+t.length,o=r.indexOf(i,a);return a<e.length&&n.push(e.slice(a)),n}function nc(e){let t=e.toLowerCase();return/\b(test|jest|vitest|pytest|cargo\s+test|mocha|spec)\b/.test(t)?`test`:/\b(build|compile|tsc|webpack|vite\s+build|rollup)\b/.test(t)?`build`:t.trimStart().startsWith(`git `)?`git`:/\b(lint|biome|eslint|prettier|format)\b/.test(t)?`lint`:`other`}function rc(e,t){if(!e)return;if(!t||t.length<=1)return[e];let n=[...t],r=n.lastIndexOf(e);return r>=0&&r!==n.length-1&&(n.splice(r,1),n.push(e)),n}function ic(e,t){let n=rc(e,t);if(n)return n.length>1?`${n[0]} → ${n[n.length-1]}`:n[0]}function ac(e,t){return rc(e,t)?.join(` → `)}function oc(e){let[t,n]=(0,_.useState)(null),r=(0,_.useRef)(null);return{hovered:t,ref:r,onMouseMove:(0,_.useCallback)(t=>{let i=r.current;if(!i||e<=1)return;let a=i.getBoundingClientRect(),o=(t.clientX-a.left)/a.width,s=Math.round(o*(e-1));n(Math.max(0,Math.min(e-1,s)))},[e]),onMouseLeave:(0,_.useCallback)(()=>n(null),[])}}function sc({session:e}){let{meta:t,scenes:n}=e,r=(0,_.useMemo)(()=>je(t),[t]),i=(0,_.useMemo)(()=>Me(t),[t]),a=(0,_.useMemo)(()=>{let e=[],r=0,i=0,a=new Map,o=e=>{let t=a.get(e);return t||(t={path:e,editCount:0,readCount:0,linesAdded:0,linesRemoved:0,turnEdits:new Map},a.set(e,t)),t},s=new Map,c=new Map,l=0,u=0,d=0,f=0,p=0,m=0,h=[],g=()=>{if(e.length>0){let t=e[e.length-1];t.toolCount=r,t.errorCount=i}};for(let t=0;t<n.length;t++){let a=n[t];switch(a.type){case`user-prompt`:{g(),r=0,i=0,d+=a.content.length;let n=a.content.split(`
|
|
101
|
+
`).find(e=>e.trim())||``;e.push({index:e.length+1,text:n.slice(0,120),sceneIndex:t,toolCount:0,errorCount:0});break}case`thinking`:l+=a.content.length;break;case`text-response`:u+=a.content.length;break;case`tool-call`:{r++;let t=a.toolName;if(s.set(t,(s.get(t)||0)+1),t===`Read`){let e=a.input?.file_path;e&&o(e).readCount++}else if(t===`Edit`||t===`Write`){if(a.diff){let t=o(a.diff.filePath);t.editCount++;let n=e.length;t.turnEdits.set(n,(t.turnEdits.get(n)||0)+1);let r=a.diff.oldContent?a.diff.oldContent.split(`
|
|
102
|
+
`).length:0,i=a.diff.newContent?a.diff.newContent.split(`
|
|
103
|
+
`).length:0;t.linesAdded+=Math.max(0,i-r),t.linesRemoved+=Math.max(0,r-i)}}else if(t===`Agent`&&a.subAgent){let t=a.subAgent,n=t.tokenUsage,r=n?n.inputTokens+n.outputTokens+n.cacheCreationTokens+n.cacheReadTokens:0;p+=t.toolCalls,m+=r,h.push({agentType:t.agentType,description:t.description,toolCalls:t.toolCalls,thinkingBlocks:t.thinkingBlocks,textResponses:t.textResponses,totalTokens:r,model:t.model,sceneCount:t.scenes.length});for(let n of t.scenes)if(n.type===`tool-call`&&n.diff){let t=o(n.diff.filePath);t.editCount++;let r=e.length;t.turnEdits.set(r,(t.turnEdits.get(r)||0)+1);let i=n.diff.oldContent?n.diff.oldContent.split(`
|
|
104
|
+
`).length:0,a=n.diff.newContent?n.diff.newContent.split(`
|
|
105
|
+
`).length:0;t.linesAdded+=Math.max(0,a-i),t.linesRemoved+=Math.max(0,i-a)}}else if(t===`Bash`){if(a.bashOutput){let e=nc(a.bashOutput.command);c.set(e,(c.get(e)||0)+1)}if(a.isError)i++,f++;else if(!(`isError`in a)){let e=a.result?.slice(0,500).toLowerCase()||``;/\b(error|fail|exception|errno)\b/.test(e)&&(i++,f++)}}break}}}g();let _=[...a.values()],v=_.filter(e=>e.editCount>0).sort((e,t)=>t.editCount-e.editCount),y=_.filter(e=>e.editCount===0&&e.readCount>0).sort((e,t)=>t.readCount-e.readCount),b=[...s.entries()].sort((e,t)=>t[1]-e[1]).slice(0,8),x=[...c.entries()].sort((e,t)=>t[1]-e[1]),S=[...s.values()].reduce((e,t)=>e+t,0),C=(s.get(`Read`)||0)+(s.get(`Grep`)||0)+(s.get(`Glob`)||0),w=(s.get(`Edit`)||0)+(s.get(`Write`)||0),T=s.get(`Bash`)||0,E={read:C,write:w,execute:T,other:S-C-w-T};return{totalScenes:n.length,userPrompts:t.stats.userPrompts,toolCalls:t.stats.toolCalls,thinkingChars:l,responseChars:u,promptChars:d,durationMs:t.stats.durationMs,tokenUsage:t.stats.tokenUsage,costEstimate:t.stats.costEstimate,turns:e,editedFiles:v,readOnlyFiles:y,topTools:b,bashCats:x,activityDist:E,totalTools:S,totalBashErrors:f,subAgents:h,totalDelegatedTools:p,totalDelegatedTokens:m}},[n,t]),o=t.stats.turnStats&&t.stats.turnStats.length>1,s=(0,_.useMemo)(()=>a.turns.map(e=>e.text.slice(0,60)+(e.text.length>60?`…`:``)),[a.turns]);return(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,V.jsxs)(`div`,{className:`p-6 space-y-6 max-w-4xl mx-auto`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-mono font-semibold text-terminal-text truncate`,children:t.title||t.slug}),t.provider&&(0,V.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:t.provider}),r.length>0&&(0,V.jsx)(Ne,{title:r.join(`
|
|
106
|
+
`),className:`shrink-0`}),t.gitBranch&&(0,V.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:ac(t.gitBranch,t.gitBranches),children:ic(t.gitBranch,t.gitBranches)}),t.permissionMode===`bypassPermissions`&&(0,V.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`})]}),r.length>0&&(0,V.jsxs)(`div`,{className:`rounded border border-terminal-orange/40 bg-terminal-orange/10 px-3 py-2`,children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-orange uppercase tracking-widest mb-1`,children:`Data Quality`}),(0,V.jsx)(`div`,{className:`space-y-0.5`,children:r.slice(0,4).map(e=>(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim`,children:e},e))})]}),(t.dataSource||t.dataSourceInfo)&&(0,V.jsxs)(`div`,{className:`rounded border border-terminal-border-subtle bg-terminal-surface/40 px-3 py-2`,children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1`,children:`Data Source`}),(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-text`,children:Ie(t.dataSourceInfo?.primary||t.dataSource)}),t.dataSourceInfo?.sources&&t.dataSourceInfo.sources.length>0&&(0,V.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:t.dataSourceInfo.sources.map(e=>(0,V.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dim truncate`,title:e,children:[(0,V.jsx)(`span`,{className:`text-terminal-green`,children:`source:`}),` `,e]},e))}),t.dataSourceInfo?.supplements&&t.dataSourceInfo.supplements.length>0&&(0,V.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:t.dataSourceInfo.supplements.map(e=>(0,V.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dim truncate`,title:e,children:[(0,V.jsx)(`span`,{className:`text-terminal-purple`,children:`supplement:`}),` `,e]},e))})]}),t.provider===`cursor`&&t.cursorSidecars&&(t.cursorSidecars.requestContextCount||t.cursorSidecars.checkpointCount||t.cursorSidecars.hasWorkspaceRules)&&(0,V.jsxs)(`div`,{className:`rounded border border-terminal-border-subtle bg-terminal-surface/40 px-3 py-2`,children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1`,children:`Cursor Sidecars`}),(0,V.jsxs)(`div`,{className:`space-y-0.5 text-xs font-mono text-terminal-dim`,children:[t.cursorSidecars.requestContextCount?(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-terminal-green`,children:`request context:`}),` `,t.cursorSidecars.requestContextCount,` sidecar`,t.cursorSidecars.requestContextCount===1?``:`s`]}):null,t.cursorSidecars.hasWorkspaceRules?(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-terminal-purple`,children:`workspace rules:`}),` included`]}):null,t.cursorSidecars.checkpointCount?(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-terminal-orange`,children:`checkpoint state:`}),` `,t.cursorSidecars.checkpointCount,` entr`,t.cursorSidecars.checkpointCount===1?`y`:`ies`]}):null]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-3`,children:`Overview`}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3`,children:[(0,V.jsx)(Le,{label:`Turns`,value:a.userPrompts,color:`text-terminal-green`}),(0,V.jsx)(Le,{label:`Tool Calls`,value:a.toolCalls,color:`text-terminal-orange`}),(0,V.jsx)(Le,{label:`Files Modified`,value:a.editedFiles.length,color:`text-terminal-blue`}),(0,V.jsx)(Le,{label:`Scenes`,value:a.totalScenes,color:`text-terminal-text`})]}),a.totalDelegatedTools>0&&(0,V.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:[(0,V.jsxs)(`span`,{className:`text-green-300`,children:[`+`,a.totalDelegatedTools,` tools delegated`]}),(0,V.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[`to `,a.subAgents.length,` sub-agent`,a.subAgents.length>1?`s`:``]}),a.totalDelegatedTokens>0&&(0,V.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[`(`,a.totalDelegatedTokens>1e6?`${(a.totalDelegatedTokens/1e6).toFixed(1)}M`:`${(a.totalDelegatedTokens/1e3).toFixed(0)}K`,` `,`tokens, context-free)`]})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 mt-3 text-xs font-mono text-terminal-dim`,children:[t.model&&(0,V.jsxs)(`div`,{children:[`Model: `,(0,V.jsx)(`span`,{className:`text-terminal-text font-semibold`,children:t.model})]}),(a.durationMs||i.duration)&&(0,V.jsxs)(`div`,{children:[`Duration:`,` `,(0,V.jsx)(`span`,{className:`text-terminal-text`,children:a.durationMs?Re(a.durationMs):`unavailable`}),i.duration&&(0,V.jsx)(Ne,{title:i.duration,className:`ml-1`})]}),a.costEstimate!==void 0&&(0,V.jsxs)(`div`,{children:[`Cost:`,` `,(0,V.jsxs)(`span`,{className:`text-terminal-green`,children:[`$`,a.costEstimate<.01?a.costEstimate.toFixed(4):a.costEstimate.toFixed(2)]}),(0,V.jsx)(`span`,{className:`text-terminal-dimmer`,children:` (est.)`}),i.tokens&&(0,V.jsx)(Ne,{title:i.tokens,className:`ml-1`})]}),a.tokenUsage?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{children:[`In:`,` `,(0,V.jsx)(`span`,{className:`text-terminal-blue`,children:U(a.tokenUsage.inputTokens)}),` / `,`Out:`,` `,(0,V.jsx)(`span`,{className:`text-terminal-green`,children:U(a.tokenUsage.outputTokens)})]}),(0,V.jsxs)(`div`,{children:[`Cache:`,` `,(0,V.jsx)(`span`,{className:`text-terminal-purple`,children:U(a.tokenUsage.cacheReadTokens)}),` `,`read /`,` `,(0,V.jsx)(`span`,{className:`text-terminal-orange`,children:U(a.tokenUsage.cacheCreationTokens)}),` `,`created`]})]}):i.tokens&&(0,V.jsxs)(`div`,{children:[`Tokens: `,(0,V.jsx)(`span`,{className:`text-terminal-text`,children:`unavailable`}),(0,V.jsx)(Ne,{title:i.tokens,className:`ml-1`})]}),!o&&i.turnStats&&(0,V.jsxs)(`div`,{children:[`Turn Stats: `,(0,V.jsx)(`span`,{className:`text-terminal-text`,children:`limited`}),(0,V.jsx)(Ne,{title:i.turnStats,className:`ml-1`})]})]})]}),o&&(0,V.jsxs)(`div`,{className:`space-y-5`,children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest`,children:`Per-Turn Metrics`}),(0,V.jsx)(dc,{turnStats:t.stats.turnStats,costEstimate:t.stats.costEstimate,turnLabels:s}),(0,V.jsx)(pc,{turnStats:t.stats.turnStats,turnLabels:s}),a.turns.length>=2&&(0,V.jsx)(gc,{turns:a.turns,turnLabels:s}),t.stats.turnStats.some(e=>e.durationMs)&&(0,V.jsx)(mc,{turnStats:t.stats.turnStats,turnLabels:s})]}),t.tokenUsageByModel&&Object.keys(t.tokenUsageByModel).length>1&&(0,V.jsx)(hc,{tokenUsageByModel:t.tokenUsageByModel}),t.apiErrors&&t.apiErrors.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:`API Issues`}),(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim space-y-1`,children:(()=>{let e=t.apiErrors,n=Math.max(0,...e.map(e=>e.retryAttempt||0)),r=e.some(e=>e.errorType===`overloaded_error`||e.statusCode===529),i=e.some(e=>e.errorType===`rate_limit_error`||e.statusCode===429),a=[];return r&&a.push(`API was overloaded`),i&&a.push(`hit rate limits`),a.length===0&&a.push(`API errors occurred`),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`text-terminal-text`,children:[a.join(` and `),` `,(0,V.jsxs)(`span`,{className:`text-terminal-red`,children:[e.length,` times`]}),` during this session`,n>1&&(0,V.jsxs)(V.Fragment,{children:[`, with up to`,` `,(0,V.jsxs)(`span`,{className:`text-terminal-orange`,children:[n,` retries`]}),` in a row`]}),`.`]}),(0,V.jsx)(`div`,{className:`text-terminal-dimmer`,children:n>0?t.provider===`cursor`?`Cursor automatically retried some of these errors.`:`The provider retried some of these errors before continuing.`:t.provider===`cursor`?`These errors were observed in local Cursor metadata.`:`These errors were observed in session telemetry.`})]})})()})]}),t.trackedFiles&&t.trackedFiles.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:[`Files Tracked (`,t.trackedFiles.length,`)`]}),(0,V.jsx)(`div`,{className:`space-y-0.5 max-h-[200px] overflow-y-auto`,children:t.trackedFiles.map(e=>(0,V.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dim truncate px-2 py-0.5 rounded hover:bg-terminal-surface-hover`,title:e,children:e},e))})]}),t.contextFiles&&t.contextFiles.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:[`Context Files (inferred, `,t.contextFiles.length,`)`]}),(0,V.jsx)(`div`,{className:`space-y-0.5 max-h-[200px] overflow-y-auto`,children:t.contextFiles.map(e=>(0,V.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dim truncate px-2 py-0.5 rounded hover:bg-terminal-surface-hover`,title:e,children:e},e))})]}),t.prLinks&&t.prLinks.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:`Pull Requests`}),(0,V.jsx)(`div`,{className:`space-y-1`,children:t.prLinks.map(e=>(0,V.jsxs)(`a`,{href:e.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:[(0,V.jsxs)(`span`,{className:`text-terminal-green`,children:[`#`,e.prNumber]}),e.prRepository&&(0,V.jsx)(`span`,{className:`text-terminal-dimmer truncate`,children:e.prRepository})]},e.prUrl))})]}),a.turns.length>0&&(0,V.jsx)(yc,{turns:a.turns,turnStats:t.stats.turnStats}),(0,V.jsx)(_c,{editedFiles:a.editedFiles,turns:a.turns}),(a.editedFiles.length>0||a.readOnlyFiles.length>0)&&(0,V.jsx)(Cc,{editedFiles:a.editedFiles,readOnlyFiles:a.readOnlyFiles}),a.bashCats.length>1&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:[`Bash Commands`,a.totalBashErrors>0&&(0,V.jsxs)(`span`,{className:`text-terminal-red ml-2 normal-case tracking-normal`,children:[a.totalBashErrors,` error`,a.totalBashErrors===1?``:`s`]})]}),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:a.bashCats.map(([e,t])=>(0,V.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dim bg-terminal-surface rounded px-2 py-1`,children:[e,` `,(0,V.jsx)(`span`,{className:`text-terminal-text tabular-nums`,children:t})]},e))})]}),a.topTools.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:[`Top Tools`,(0,V.jsxs)(`span`,{className:`text-terminal-dimmer ml-2 normal-case tracking-normal font-mono`,children:[a.totalTools,` total`]})]}),(0,V.jsx)(`div`,{className:`space-y-1.5`,children:a.topTools.map(([e,t])=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono`,children:[(0,V.jsx)(`span`,{className:`text-terminal-text shrink-0 w-24 text-right truncate`,title:e,children:e}),(0,V.jsx)(`div`,{className:`flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden`,children:(0,V.jsx)(`div`,{className:`h-full rounded-full bg-terminal-orange`,style:{width:`${t/a.topTools[0][1]*100}%`}})}),(0,V.jsxs)(`span`,{className:`text-terminal-dim shrink-0 w-16 text-right tabular-nums`,children:[t,` `,(0,V.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[`(`,Math.round(t/a.totalTools*100),`%)`]})]})]},e))})]}),a.subAgents.length>0&&(0,V.jsx)(lc,{subAgents:a.subAgents}),a.totalTools>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:`Activity Distribution`}),(0,V.jsx)(`div`,{className:`space-y-1.5`,children:[[`Read/Search`,a.activityDist.read,`--blue`],[`Write/Edit`,a.activityDist.write,`--green`],[`Execute`,a.activityDist.execute,`--purple`],[`Other`,a.activityDist.other,`--dim`]].filter(([,e])=>e>0).map(([e,t,n])=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono`,children:[(0,V.jsx)(`span`,{className:`text-terminal-text shrink-0 w-24 text-right`,children:e}),(0,V.jsx)(`div`,{className:`flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden`,children:(0,V.jsx)(`div`,{className:`h-full rounded-full`,style:{width:`${t/a.totalTools*100}%`,backgroundColor:`var(${n})`}})}),(0,V.jsxs)(`span`,{className:`text-terminal-dim shrink-0 w-16 text-right tabular-nums`,children:[t,` (`,Math.round(t/a.totalTools*100),`%)`]})]},e))})]})]})})}var cc={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 lc({subAgents:e}){let t=new Map,n=0,r=0;for(let i of e){let e=t.get(i.agentType)||{count:0,toolCalls:0,totalTokens:0};e.count++,e.toolCalls+=i.toolCalls,e.totalTokens+=i.totalTokens,t.set(i.agentType,e),n+=i.toolCalls,r+=i.totalTokens}let i=[...t.entries()].sort((e,t)=>t[1].count-e[1].count);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:[`Sub-Agents (`,e.length,`)`]}),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-2 mb-3`,children:i.map(([e,t])=>(0,V.jsxs)(`span`,{className:`text-[11px] px-2 py-1 rounded border font-mono ${cc[e]||`bg-gray-500/20 text-gray-300 border-gray-500/30`}`,children:[e,` `,(0,V.jsxs)(`span`,{className:`opacity-70`,children:[`x`,t.count,` (`,t.toolCalls,` tools)`]})]},e))}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs font-mono text-terminal-dim`,children:[(0,V.jsxs)(`div`,{children:[`Delegated tools: `,(0,V.jsx)(`span`,{className:`text-terminal-text`,children:n})]}),r>0&&(0,V.jsxs)(`div`,{children:[`Delegated tokens:`,` `,(0,V.jsx)(`span`,{className:`text-terminal-text`,children:r>1e6?`${(r/1e6).toFixed(1)}M`:r>1e3?`${(r/1e3).toFixed(0)}K`:r}),(0,V.jsx)(`span`,{className:`text-terminal-dimmer`,children:` (context-free)`})]})]}),(0,V.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[e.slice(0,20).map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] font-mono text-terminal-dim px-2 py-1 rounded bg-terminal-surface`,children:[(0,V.jsx)(`span`,{className:`px-1 py-0.5 rounded border text-[9px] ${cc[e.agentType]||`bg-gray-500/20 text-gray-300 border-gray-500/30`}`,children:e.agentType}),(0,V.jsx)(`span`,{className:`truncate flex-1 text-terminal-text/70`,children:e.description||`(no description)`}),(0,V.jsxs)(`span`,{className:`shrink-0`,children:[e.toolCalls,` tools`]}),e.totalTokens>0&&(0,V.jsxs)(`span`,{className:`shrink-0 text-terminal-dimmer`,children:[e.totalTokens>1e3?`${(e.totalTokens/1e3).toFixed(0)}K`:e.totalTokens,` `,`tok`]})]},t)),e.length>20&&(0,V.jsxs)(`div`,{className:`text-[10px] text-terminal-dimmer font-mono px-2`,children:[`... and `,e.length-20,` more`]})]})]})}function uc({children:e,visible:t,x:n}){if(!t)return null;let r=n>.7;return(0,V.jsx)(`div`,{className:`absolute top-1 pointer-events-none z-10`,style:{left:r?void 0:`${n*100}%`,right:r?`${(1-n)*100}%`:void 0},children:(0,V.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 ${r?`text-right`:``}`,children:e})})}function dc({turnStats:e,costEstimate:t,turnLabels:n}){let r=[],i=0;for(let t of e)i+=t.tokenUsage?.outputTokens||0,r.push(i);let a=r.length,{hovered:o,ref:s,onMouseMove:c,onMouseLeave:l}=oc(a);if(i===0)return null;let u=r[r.length-1],d=r.map((e,t)=>`${a===1?100/2:t/(a-1)*100},${60-e/u*54-3}`),f=o===null?0:a===1?.5:o/(a-1);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1`,children:[`Token Burn`,t?` & Cost`:``]}),(0,V.jsxs)(`div`,{className:`relative`,children:[(0,V.jsxs)(`svg`,{ref:s,viewBox:`0 0 100 60`,preserveAspectRatio:`none`,className:`w-full h-20`,onMouseMove:c,onMouseLeave:l,children:[(0,V.jsx)(`polygon`,{points:`0,60 ${d.join(` `)} 100,60`,style:{fill:`var(--green-subtle)`}}),(0,V.jsx)(`polyline`,{points:d.join(` `),fill:`none`,style:{stroke:`var(--green)`},strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`}),o!==null&&(0,V.jsx)(`line`,{x1:f*100,y1:`0`,x2:f*100,y2:60,stroke:`var(--dim)`,strokeWidth:`0.5`,vectorEffect:`non-scaling-stroke`,opacity:`0.5`})]}),(0,V.jsx)(uc,{visible:o!==null,x:f,children:o!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`text-terminal-green`,children:[`Turn `,o+1]}),n?.[o]&&(0,V.jsx)(`div`,{className:`text-terminal-dim truncate max-w-[200px]`,children:n[o]}),(0,V.jsxs)(`div`,{children:[`cumulative: `,U(r[o]),` tokens`]}),e[o]?.tokenUsage&&(0,V.jsxs)(`div`,{className:`text-terminal-dimmer`,children:[`this turn: +`,U(e[o].tokenUsage.outputTokens),` out`]})]})})]}),(0,V.jsxs)(`div`,{className:`flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5`,children:[(0,V.jsx)(`span`,{children:`Turn 1`}),(0,V.jsxs)(`span`,{children:[U(u),` tokens`,t?` ($${t<1?t.toFixed(2):t.toFixed(0)})`:``]}),(0,V.jsxs)(`span`,{children:[`Turn `,a]})]}),e.some(e=>e.tokenUsage?.cacheReadTokens)&&(0,V.jsx)(fc,{turnStats:e})]})}function fc({turnStats:e}){let t=ir(e),n=t.map(e=>or(e)/100),r=ar(t)/100,i=n.map((e,t)=>`${n.length===1?100/2:t/(n.length-1)*100},${24-e*20-2}`);return(0,V.jsxs)(`div`,{className:`mt-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest`,children:`Cache Hit Rate`}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-purple`,children:[`avg `,Math.round(r*100),`%`]})]}),(0,V.jsx)(`svg`,{viewBox:`0 0 100 24`,preserveAspectRatio:`none`,className:`w-full h-6`,children:(0,V.jsx)(`polyline`,{points:i.join(` `),fill:`none`,style:{stroke:`var(--purple)`},strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`})})]})}function pc({turnStats:e,turnLabels:t}){let n=e.map(e=>e.contextTokens||0),r=n.length,{hovered:i,ref:a,onMouseMove:o,onMouseLeave:s}=oc(r);if(!n.some(e=>e>0))return null;let c=Math.max(...n),l=e.some(e=>e.tokenUsage),u=ir(e),d=0;for(let e=0;e<n.length-1;e++)n[e]>0&&n[e+1]>0&&n[e+1]<n[e]*.5&&(d=Math.max(d,n[e]));let f=d>2e5||c>2e5?1e6:2e5,p=f>c?f:c,m=e=>60-e/p*54-3,h=e=>r===1?100/2:e/(r-1)*100,g=n.map((e,t)=>`${h(t)},${m(e)}`),_=null;if(l){let e=u.map((e,t)=>`${h(t)},${m(e.cacheRead)}`),t=u.map((e,t)=>`${h(t)},${m(e.cacheRead+e.uncached)}`),n=u.map((e,t)=>`${h(t)},${m(e.total)}`);_={cacheRead:`0,60 ${e.join(` `)} 100,60`,uncached:`${e.join(` `)} ${[...t].toReversed().join(` `)}`,total:`0,60 ${n.join(` `)} 100,60`}}let v=[];if(l){let e=r>1?100/(r-1)/2:100/2;for(let t=0;t<u.length;t++){if(u[t].hasData)continue;let r=n[t];if(r<=0)continue;let i=h(t),a=m(r),o=Math.max(0,i-e),s=Math.min(100,i+e);v.push(`${o},60 ${o},${a} ${s},${a} ${s},60`)}}let y=v.length>0,b=[];for(let e=0;e<n.length-1;e++){let t=n[e],r=n[e+1];t>0&&r>0&&r<t*.5&&b.push(e)}let x=ar(u),S=u.reduce((e,t)=>e+t.rawSum,0),C=i===null?0:r===1?.5:i/(r-1),w=f?m(f):void 0,T=i===null?0:or(u[i]);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1 flex items-center gap-2`,children:[(0,V.jsx)(`span`,{children:`Context Window Usage`}),(0,V.jsxs)(`span`,{className:`font-mono text-terminal-cyan`,children:[`peak `,U(c)]})]}),(0,V.jsxs)(`div`,{className:`relative`,children:[(0,V.jsxs)(`svg`,{ref:a,viewBox:`0 0 100 60`,preserveAspectRatio:`none`,className:`w-full h-20`,onMouseMove:o,onMouseLeave:s,children:[w!==void 0&&(0,V.jsx)(`line`,{x1:`0`,y1:w,x2:100,y2:w,style:{stroke:`var(--dim)`},strokeWidth:`0.5`,strokeDasharray:`3,2`,vectorEffect:`non-scaling-stroke`,opacity:`0.4`}),_?(0,V.jsxs)(V.Fragment,{children:[v.map((e,t)=>(0,V.jsx)(`polygon`,{points:e,style:{fill:`var(--cyan-subtle)`},opacity:`0.6`},`nd-${t}`)),(0,V.jsx)(`polygon`,{points:_.total,style:{fill:`var(--orange-subtle)`}}),(0,V.jsx)(`polygon`,{points:_.uncached,style:{fill:`var(--purple-subtle)`}}),(0,V.jsx)(`polygon`,{points:_.cacheRead,style:{fill:`var(--green-subtle)`}})]}):(0,V.jsx)(`polygon`,{points:`0,60 ${g.join(` `)} 100,60`,style:{fill:`var(--cyan-subtle)`}}),(0,V.jsx)(`polyline`,{points:g.join(` `),fill:`none`,style:{stroke:_?`var(--orange)`:`var(--cyan)`},strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`}),b.map(e=>{let t=h(e);return(0,V.jsx)(`line`,{x1:t,y1:`0`,x2:t,y2:60,style:{stroke:`var(--red)`},strokeWidth:`1`,strokeDasharray:`2,1`,vectorEffect:`non-scaling-stroke`,opacity:`0.6`},e)}),i!==null&&(0,V.jsx)(`line`,{x1:C*100,y1:`0`,x2:C*100,y2:60,stroke:`var(--dim)`,strokeWidth:`0.5`,vectorEffect:`non-scaling-stroke`,opacity:`0.5`})]}),(0,V.jsx)(uc,{visible:i!==null,x:C,children:i!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`text-terminal-cyan`,children:[`Turn `,i+1]}),t?.[i]&&(0,V.jsx)(`div`,{className:`text-terminal-dim truncate max-w-[200px]`,children:t[i]}),(0,V.jsxs)(`div`,{children:[U(n[i]),` tokens`]}),l&&u[i].rawSum>0&&(0,V.jsxs)(`div`,{className:`mt-0.5 border-t border-terminal-border-subtle pt-0.5 space-y-px`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--green)`}}),(0,V.jsxs)(`span`,{children:[`cache read `,U(u[i].rawCr)]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--purple)`}}),(0,V.jsxs)(`span`,{children:[`uncached`,` `,U(u[i].rawSum-u[i].rawCr-(e[i].tokenUsage?.cacheCreationTokens||0))]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--orange)`}}),(0,V.jsxs)(`span`,{children:[`cache write `,U(e[i].tokenUsage?.cacheCreationTokens||0)]})]}),(0,V.jsxs)(`div`,{className:`text-terminal-dim`,children:[T.toFixed(0),`% cache hit`]})]})]})})]}),(0,V.jsxs)(`div`,{className:`flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5`,children:[(0,V.jsx)(`span`,{children:`Turn 1`}),(0,V.jsx)(`span`,{children:f?`limit ${U(f)}`:`peak ${U(c)}`}),(0,V.jsxs)(`span`,{children:[`Turn `,r]})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-0.5 mt-1`,children:[b.length>0&&(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`inline-block w-3 border-t border-dashed`,style:{borderColor:`var(--red)`}}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[b.length,` compaction`,b.length===1?``:`s`]})]}),l&&S>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--green)`}}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`cache read`})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--purple)`}}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`uncached`})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--orange)`}}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`cache write`})]}),y&&(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--cyan-subtle)`,opacity:.6}}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`no breakdown`})]}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-cyan`,children:[x.toFixed(0),`% cache hit`]})]})]})]})}function mc({turnStats:e,turnLabels:t}){let n=e.map(e=>e.durationMs||0),r=Math.max(...n,1),i=n.some(e=>e>0),[a,o]=(0,_.useState)(null);return i?(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1`,children:`Turn Duration`}),(0,V.jsxs)(`div`,{className:`relative`,children:[(0,V.jsx)(`div`,{className:`flex items-end gap-px h-16`,onMouseLeave:()=>o(null),children:n.map((e,t)=>(0,V.jsx)(`div`,{className:`flex-1 rounded-t-sm cursor-default`,style:{height:`${e>0?Math.max(e/r*100,4):0}%`,backgroundColor:e>0?`var(--blue)`:`var(--surface)`,opacity:a===t?1:e>0?.5+e/r*.5:.2},onMouseEnter:()=>o(t)},t))}),(0,V.jsx)(uc,{visible:a!==null,x:a===null?0:n.length===1?.5:a/(n.length-1),children:a!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`text-terminal-blue`,children:[`Turn `,a+1]}),t?.[a]&&(0,V.jsx)(`div`,{className:`text-terminal-dim truncate max-w-[200px]`,children:t[a]}),(0,V.jsx)(`div`,{children:n[a]>0?Re(n[a]):`no data`})]})})]}),(0,V.jsxs)(`div`,{className:`flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5`,children:[(0,V.jsx)(`span`,{children:`Turn 1`}),(0,V.jsxs)(`span`,{children:[`max `,Re(r)]}),(0,V.jsxs)(`span`,{children:[`Turn `,n.length]})]})]}):null}function hc({tokenUsageByModel:e}){let t=Object.entries(e).sort((e,t)=>t[1].outputTokens-e[1].outputTokens),n=t.reduce((e,[,t])=>e+t.outputTokens,0);if(n===0)return null;let r=[`--green`,`--blue`,`--purple`,`--orange`,`--red`];return(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:`Model Breakdown`}),(0,V.jsx)(`div`,{className:`flex h-3 rounded-full overflow-hidden gap-px`,children:t.map(([e,t],i)=>{let a=t.outputTokens/n*100;return(0,V.jsx)(`div`,{style:{width:`${a}%`,minWidth:a>2?void 0:`3px`,backgroundColor:`var(${r[i%r.length]})`,opacity:.7},title:`${e}: ${U(t.outputTokens)} output tokens`},e)})}),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-3 mt-1.5`,children:t.map(([e,t],i)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] font-mono text-terminal-dimmer`,children:[(0,V.jsx)(`div`,{className:`w-2 h-2 rounded-sm`,style:{backgroundColor:`var(${r[i%r.length]})`,opacity:.7}}),(0,V.jsxs)(`span`,{children:[e,` `,U(t.outputTokens),` (`,Math.round(t.outputTokens/n*100),`%)`]})]},e))})]})}function gc({turns:e,turnLabels:t}){let n=e.map(e=>e.toolCount),r=Math.max(...n,1),[i,a]=(0,_.useState)(null);return e.length<2?null:(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1`,children:`Tool Calls per Turn`}),(0,V.jsxs)(`div`,{className:`relative`,children:[(0,V.jsx)(`div`,{className:`flex items-end gap-px h-16`,onMouseLeave:()=>a(null),children:n.map((e,t)=>(0,V.jsx)(`div`,{className:`flex-1 rounded-t-sm cursor-default`,style:{height:`${e>0?Math.max(e/r*100,4):0}%`,backgroundColor:e>0?`var(--orange)`:`var(--surface)`,opacity:i===t?1:e>0?.5+e/r*.5:.2},onMouseEnter:()=>a(t)},t))}),(0,V.jsx)(uc,{visible:i!==null,x:i===null?0:n.length===1?.5:i/(n.length-1),children:i!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`text-terminal-orange`,children:[`Turn `,i+1]}),t?.[i]&&(0,V.jsx)(`div`,{className:`text-terminal-dim truncate max-w-[200px]`,children:t[i]}),(0,V.jsxs)(`div`,{children:[n[i],` tool calls`]})]})})]}),(0,V.jsxs)(`div`,{className:`flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5`,children:[(0,V.jsx)(`span`,{children:`Turn 1`}),(0,V.jsxs)(`span`,{children:[`max `,r]}),(0,V.jsxs)(`span`,{children:[`Turn `,n.length]})]})]})}function _c({editedFiles:e,turns:t}){if(t.length<3||e.length<1)return null;let n=e.slice(0,8),r=t.map(e=>e.index),i=r.length>60,a=i?r.slice(-60):r,o=1;for(let e of n)for(let t of a){let n=e.turnEdits.get(t)||0;n>o&&(o=n)}return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:[`File Activity Heatmap`,i&&(0,V.jsxs)(`span`,{className:`normal-case tracking-normal font-normal ml-2`,children:[`(last `,60,` of `,r.length,` turns)`]})]}),(0,V.jsx)(`div`,{className:`overflow-x-auto`,children:(0,V.jsxs)(`div`,{className:`grid gap-px text-[10px] font-mono`,style:{gridTemplateColumns:`minmax(80px, 120px) repeat(${a.length}, minmax(16px, 1fr))`},children:[(0,V.jsx)(`div`,{className:`text-terminal-dimmer px-1 py-0.5`}),a.map(e=>(0,V.jsx)(`div`,{className:`text-terminal-dimmer text-center py-0.5 text-[9px]`,children:e},e)),n.map(e=>{let t=e.path.split(`/`).pop()||e.path;return[(0,V.jsx)(`div`,{className:`text-terminal-dim truncate px-1 py-0.5`,title:e.path,children:t},`label-${e.path}`),...a.map(n=>{let r=e.turnEdits.get(n)||0,i=r===0?0:Math.round(20+Math.log1p(r)/Math.log1p(o)*60);return(0,V.jsx)(`div`,{className:`rounded-sm`,style:{backgroundColor:r===0?`transparent`:`color-mix(in srgb, var(--orange) ${i}%, transparent)`,minHeight:14},title:r>0?`${t} — Turn ${n}: ${r} edit${r===1?``:`s`}`:void 0},`${e.path}-${n}`)})]})]})})]})}var vc=20;function yc({turns:e,turnStats:t}){let[n,r]=(0,_.useState)(!1),{rows:i,compactionAfter:a}=(0,_.useMemo)(()=>{let n=Math.max(...e.map(e=>e.toolCount),1),r=Math.max(...t?.map(e=>e.durationMs||0)||[0],1),i=Math.max(...t?.map(e=>e.contextTokens||0)||[0],1),a=Math.max(...t?.map(e=>e.tokenUsage?.outputTokens||0)||[0],1),o=new Set;if(t)for(let e=0;e<t.length-1;e++){let n=t[e]?.contextTokens||0,r=t[e+1]?.contextTokens||0;n>0&&r>0&&r<n*.5&&o.add(e)}return{rows:e.map((e,o)=>{let s=t?.[o];return{...e,durationMs:s?.durationMs,contextTokens:s?.contextTokens,outputTokens:s?.tokenUsage?.outputTokens,toolRatio:e.toolCount/n,durationRatio:(s?.durationMs||0)/r,contextRatio:(s?.contextTokens||0)/i,outputRatio:(s?.tokenUsage?.outputTokens||0)/a}}),compactionAfter:o}},[e,t]),o=t&&t.length>0,s=o&&t.some(e=>e.durationMs),c=o&&t.some(e=>e.contextTokens),l=o&&t.some(e=>e.tokenUsage),u=3+(s?1:0)+(c?1:0)+(l?1:0),d=i.length>vc,f=d&&!n?i.slice(0,vc):i;return(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:`Per-Turn Breakdown`}),(0,V.jsx)(`div`,{className:`overflow-x-auto rounded border border-terminal-border-subtle`,children:(0,V.jsxs)(`table`,{className:`w-full text-[11px] font-mono border-collapse`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{className:`text-terminal-dimmer text-left`,children:[(0,V.jsx)(`th`,{className:`px-2 py-1.5 font-semibold w-7`,children:`#`}),(0,V.jsx)(`th`,{className:`px-2 py-1.5 font-semibold`,children:`Prompt`}),(0,V.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-14`,children:`Tools`}),s&&(0,V.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-16`,children:`Duration`}),c&&(0,V.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-16`,children:`Context`}),l&&(0,V.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-14`,children:`Output`})]})}),(0,V.jsx)(`tbody`,{children:f.map((e,t)=>(0,V.jsx)(bc,{row:e,hasDuration:!!s,hasContext:!!c,hasTokens:!!l,colCount:u,showCompaction:a.has(t)},e.sceneIndex))}),d&&(0,V.jsx)(`tfoot`,{children:(0,V.jsx)(`tr`,{children:(0,V.jsx)(`td`,{colSpan:u,children:(0,V.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:()=>r(!n),children:n?`▴ Collapse`:`▾ Show all ${i.length} turns (${i.length-vc} more)`})})})})]})})]})}function bc({row:e,hasDuration:t,hasContext:n,hasTokens:r,colCount:i,showCompaction:a}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`tr`,{className:`border-t border-terminal-border-subtle hover:bg-terminal-surface-hover transition-colors`,children:[(0,V.jsx)(`td`,{className:`px-2 py-1 text-terminal-green tabular-nums`,children:String(e.index).padStart(2,`0`)}),(0,V.jsx)(`td`,{className:`px-2 py-1 text-terminal-text max-w-0`,children:(0,V.jsxs)(`div`,{className:`truncate`,title:e.text,children:[e.text,e.errorCount>0&&(0,V.jsxs)(`span`,{className:`text-terminal-red ml-1.5`,children:[e.errorCount,` err`]})]})}),(0,V.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:(0,V.jsx)(xc,{value:e.toolCount,ratio:e.toolRatio,color:`--orange`})}),t&&(0,V.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:(0,V.jsx)(xc,{value:e.durationMs?Re(e.durationMs):`—`,ratio:e.durationRatio,color:`--blue`})}),n&&(0,V.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:(0,V.jsx)(xc,{value:e.contextTokens?U(e.contextTokens):`—`,ratio:e.contextRatio,color:`--cyan`})}),r&&(0,V.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:(0,V.jsx)(xc,{value:e.outputTokens?U(e.outputTokens):`—`,ratio:e.outputRatio,color:`--green`})})]}),a&&(0,V.jsx)(`tr`,{children:(0,V.jsx)(`td`,{colSpan:i,className:`px-0 py-0`,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-0.5 bg-terminal-red/5`,children:[(0,V.jsx)(`div`,{className:`flex-1 border-t border-dashed border-terminal-red/40`}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-red/70 shrink-0`,children:`context compacted`}),(0,V.jsx)(`div`,{className:`flex-1 border-t border-dashed border-terminal-red/40`})]})})})]})}function xc({value:e,ratio:t,color:n}){return(0,V.jsx)(`span`,{className:`inline-block w-full px-1 py-0.5 rounded-sm text-terminal-text`,style:{backgroundColor:t>0?`color-mix(in srgb, var(${n}) ${Math.round(t*40)}%, transparent)`:void 0},children:e})}var Sc=20;function Cc({editedFiles:e,readOnlyFiles:t}){let[n,r]=(0,_.useState)(!1),i=(0,_.useMemo)(()=>[...e,...t],[e,t]),a=(0,_.useMemo)(()=>Math.max(...i.map(e=>e.editCount),1),[i]),o=(0,_.useMemo)(()=>Math.max(...i.map(e=>e.readCount),1),[i]),s=(0,_.useMemo)(()=>Math.max(...i.map(e=>e.linesAdded+e.linesRemoved),1),[i]),c=i.some(e=>e.linesAdded>0||e.linesRemoved>0),l=i.some(e=>e.turnEdits.size>0),u=i.length>Sc,d=u&&!n?i.slice(0,Sc):i,f=3+(c?1:0)+(l?1:0);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:[`File Impact`,(0,V.jsxs)(`span`,{className:`normal-case tracking-normal ml-1.5`,children:[`(`,e.length,` modified`,t.length>0&&`, ${t.length} read-only`,`)`]})]}),(0,V.jsx)(`div`,{className:`overflow-x-auto rounded border border-terminal-border-subtle`,children:(0,V.jsxs)(`table`,{className:`w-full text-[11px] font-mono border-collapse`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{className:`text-terminal-dimmer text-left`,children:[(0,V.jsx)(`th`,{className:`px-2 py-1.5 font-semibold`,children:`File`}),(0,V.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-14`,children:`Edits`}),(0,V.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-14`,children:`Reads`}),c&&(0,V.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-20`,children:`+/−`}),l&&(0,V.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-14`,children:`Turns`})]})}),(0,V.jsx)(`tbody`,{children:d.map(e=>{let t=e.path.split(`/`).pop()||e.path;return(0,V.jsxs)(`tr`,{className:`border-t border-terminal-border-subtle hover:bg-terminal-surface-hover transition-colors`,children:[(0,V.jsx)(`td`,{className:`px-2 py-1 max-w-0`,children:(0,V.jsxs)(`div`,{className:`truncate ${e.editCount>0?`text-terminal-text`:`text-terminal-dimmer`}`,title:e.path,children:[t,e.editCount>=10&&(0,V.jsx)(`span`,{className:`text-terminal-red ml-1`,title:`${e.editCount} edits — high churn file`,children:`⚠`}),(0,V.jsx)(`span`,{className:`text-terminal-dimmer ml-1`,children:e.path.slice(0,e.path.length-t.length-1)})]})}),(0,V.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:e.editCount>0?(0,V.jsx)(xc,{value:e.editCount,ratio:e.editCount/a,color:`--orange`}):(0,V.jsx)(`span`,{className:`text-terminal-dimmer`,children:`—`})}),(0,V.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:e.readCount>0?(0,V.jsx)(xc,{value:e.readCount,ratio:e.readCount/o,color:`--blue`}):(0,V.jsx)(`span`,{className:`text-terminal-dimmer`,children:`—`})}),c&&(0,V.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:e.linesAdded>0||e.linesRemoved>0?(0,V.jsxs)(`span`,{className:`inline-block w-full px-1 py-0.5 rounded-sm`,style:{backgroundColor:`color-mix(in srgb, var(--green) ${Math.round((e.linesAdded+e.linesRemoved)/s*30)}%, transparent)`},children:[(0,V.jsxs)(`span`,{className:`text-terminal-green`,children:[`+`,e.linesAdded]}),(0,V.jsx)(`span`,{className:`text-terminal-dimmer`,children:`/`}),(0,V.jsxs)(`span`,{className:`text-terminal-red`,children:[`−`,e.linesRemoved]})]}):(0,V.jsx)(`span`,{className:`text-terminal-dimmer`,children:`—`})}),l&&(0,V.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:e.turnEdits.size>0?(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:e.turnEdits.size}):(0,V.jsx)(`span`,{className:`text-terminal-dimmer`,children:`—`})})]},e.path)})}),u&&(0,V.jsx)(`tfoot`,{children:(0,V.jsx)(`tr`,{children:(0,V.jsx)(`td`,{colSpan:f,children:(0,V.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:()=>r(!n),children:n?`▴ Collapse`:`▾ Show all ${i.length} files (${i.length-Sc} more)`})})})})]})})]})}function wc(e){switch(e){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 Tc({scenes:e,currentIndex:t,onSeek:n,annotatedScenes:r}){let i=(0,_.useMemo)(()=>{if(e.length<=200)return e.map((e,t)=>({startIndex:t,endIndex:t,type:e.type}));let t=e.length/200,n=[];for(let r=0;r<200;r++){let i=Math.floor(r*t),a=Math.floor((r+1)*t)-1,o={"user-prompt":4,"compaction-summary":1,"context-injection":1,"tool-call":3,"text-response":2,thinking:1},s=e[i].type,c=o[s];for(let t=i+1;t<=a&&t<e.length;t++){let n=o[e[t].type];n>c&&(s=e[t].type,c=n)}n.push({startIndex:i,endIndex:a,type:s})}return n},[e]),a=e.length>0?(t+1)/e.length*100:0,o=(0,_.useRef)(null),s=(0,_.useCallback)(t=>{let r=o.current;if(!r)return;let i=r.getBoundingClientRect(),a=t.clientX-i.left,s=Math.max(0,Math.min(1,a/i.width));n(Math.floor(s*e.length))},[e.length,n]),c=(0,_.useMemo)(()=>{if(!r||r.size===0)return[];let t=[];return r.forEach(n=>{n>=0&&n<e.length&&t.push((n+.5)/e.length*100)}),t},[r,e.length]),l=(0,_.useMemo)(()=>{let t=[];for(let n=0;n<e.length;n++)e[n].type===`compaction-summary`&&t.push((n+.5)/e.length*100);return t},[e]),u=(0,_.useCallback)(r=>{r.key===`ArrowRight`||r.key===`ArrowUp`?(r.preventDefault(),n(Math.min(t+1,e.length-1))):r.key===`ArrowLeft`||r.key===`ArrowDown`?(r.preventDefault(),n(Math.max(t-1,0))):r.key===`Home`?(r.preventDefault(),n(0)):r.key===`End`&&(r.preventDefault(),n(e.length-1))},[t,e.length,n]);return e.length===0?null:(0,V.jsxs)(`div`,{className:`px-4 pt-3 pb-1 cursor-pointer`,onClick:s,onKeyDown:u,role:`slider`,"aria-label":`Scene timeline`,"aria-valuemin":0,"aria-valuemax":e.length-1,"aria-valuenow":t,tabIndex:0,children:[(c.length>0||l.length>0)&&(0,V.jsxs)(`div`,{className:`relative h-2 mb-0.5`,children:[c.map((e,t)=>(0,V.jsx)(`div`,{className:`absolute w-1.5 h-1.5 rounded-full bg-terminal-blue shadow-layer-sm`,style:{left:`${e}%`,top:`50%`,transform:`translate(-50%, -50%)`}},`a-${t}`)),l.map((e,t)=>(0,V.jsx)(`div`,{role:`img`,"aria-label":`Compaction`,title:`Compaction`,className:`absolute w-1.5 h-1.5 rounded-sm bg-terminal-red shadow-layer-sm`,style:{left:`${e}%`,top:`50%`,transform:`translate(-50%, -50%) rotate(45deg)`}},`c-${t}`))]}),(0,V.jsxs)(`div`,{ref:o,className:`relative flex h-2 rounded-full overflow-hidden bg-terminal-surface-2`,children:[i.map((e,n)=>(0,V.jsx)(`div`,{className:`flex-1 transition-opacity duration-150`,style:{backgroundColor:wc(e.type),opacity:e.startIndex<=t?1:.15}},n)),l.map((e,t)=>(0,V.jsx)(`div`,{className:`absolute top-0 bottom-0 w-px bg-terminal-red/60`,style:{left:`${e}%`}},`cl-${t}`)),(0,V.jsx)(`div`,{className:`absolute top-0 bottom-0 w-0.5 bg-white shadow-layer-sm transition-[left] duration-150 ease-material`,style:{left:`${a}%`}})]})]})}var Ec=[{key:`replay`,label:`Replay`},{key:`summary`,label:`Insights`},{key:`export`,label:`Share & Export`}],Dc=`vr-insights-seen`;function Oc(){try{return localStorage.getItem(Dc)===`1`}catch{return!1}}function kc(){try{localStorage.setItem(Dc,`1`)}catch{}}function Ac({activeView:e,onChangeView:t,className:n=``,rightContent:r,hiddenTabs:i}){let[a,o]=(0,_.useState)(()=>Oc()||e===`summary`),s=(0,_.useCallback)(e=>{e===`summary`&&!a&&(kc(),o(!0)),t(e)},[t,a]);return(0,V.jsxs)(`div`,{className:`flex items-center justify-between border-b border-terminal-border-subtle bg-terminal-bg shrink-0 overflow-x-auto ${n}`,children:[(0,V.jsx)(`div`,{className:`flex bg-terminal-surface/30`,children:Ec.filter(e=>!i?.includes(e.key)).map(({key:t,label:n})=>(0,V.jsxs)(`button`,{onClick:()=>s(t),className:`relative px-4 py-2 text-[11px] font-sans font-semibold uppercase tracking-widest transition-colors ${e===t?`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:[n,t===`summary`&&!a&&e!==`summary`&&(0,V.jsxs)(`span`,{className:`absolute top-1.5 right-1 flex h-2 w-2`,children:[(0,V.jsx)(`span`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-green opacity-75`}),(0,V.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-green`})]})]},t))}),r&&(0,V.jsx)(`div`,{className:`pr-4 py-1.5 flex items-center`,children:r})]})}function jc(e){e.classList.remove(`jump-target-flash`),e.offsetWidth,e.classList.add(`jump-target-flash`),window.setTimeout(()=>{e.classList.remove(`jump-target-flash`)},900)}function Mc({session:e,viewPrefs:t,viewerMode:n=`embedded`,activeView:r,setActiveView:i,returnToLandingRef:a}){let o=n===`readonly`,[s,c]=(0,_.useState)(!1);(0,_.useEffect)(()=>{if(a)return a.current=()=>{c(!1),ge(!1);let e=new URL(window.location.href);e.searchParams.has(`s`)&&(e.searchParams.delete(`s`),window.history.replaceState({},``,e.toString()))},()=>{a.current=null}},[a]);let[l,u]=(0,_.useState)(void 0),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(!0),b=yr(e,n),x=xr(e,n),{effectiveSession:S}=x,{annotations:C}=b,w=wr(t),{state:T,currentIndex:E,visibleCount:D,speed:O,play:k,pause:A,togglePlayPause:j,seekTo:M,changeSpeed:N,totalScenes:ee,userPromptIndices:P,computeNextIndex:F}=Cr(e.scenes,w,s),I=(0,_.useRef)(null),[te,ne]=(0,_.useState)(`outline`),[re,L]=(0,_.useState)(!1),[R,z]=(0,_.useState)(!1),ie=(0,_.useRef)(null),ae=(0,_.useRef)(null),oe=(0,_.useRef)(!1),[se,ce]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`?(e.preventDefault(),L(e=>!e)):e.key===`/`?e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||(e.preventDefault(),L(!0)):e.key===`?`?ce(e=>!e):e.key===`Escape`&&(se?ce(!1):re&&L(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[re,se]);let le=P.filter(e=>e<=E).length||0,ue=P.length,de=(0,_.useMemo)(()=>{let t=new URLSearchParams(window.location.search).get(`s`);if(t!==null){let n=Number(t);if(Number.isFinite(n)&&n>=0&&n<e.scenes.length)return n}return P.length>=2?P[1]:Math.min(15,e.scenes.length-1)},[P,e.scenes.length]),fe=(0,_.useCallback)((e=!0)=>{c(!0),e?setTimeout(k,300):setTimeout(()=>M(de),100)},[k,M,de]),pe=(0,_.useCallback)(()=>i(`summary`),[i]),me=(0,_.useRef)(t.displayMode);(0,_.useEffect)(()=>{me.current!==t.displayMode&&(me.current=t.displayMode,s||(c(!0),setTimeout(()=>M(de),100)))},[t.displayMode,s,M,de]);let[he,ge]=(0,_.useState)(()=>new URLSearchParams(window.location.search).get(`s`)!==null);(0,_.useEffect)(()=>{!s&&r!==`replay`&&!he&&(c(!0),setTimeout(()=>M(de),100))},[r,s,de,M,he]);let _e=(0,_.useCallback)(t=>{let n=Math.max(0,Math.min(t,e.scenes.length-1));A(),ie.current=n,u(n),ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>u(void 0),2500),M(n)},[A,M,e.scenes.length]);(0,_.useEffect)(()=>{!s&&he&&(c(!0),setTimeout(()=>_e(de),100))},[s,he,de,_e]);let ve=(0,_.useCallback)(()=>{let e=P.find(e=>e>E);e!==void 0&&_e(e)},[P,E,_e]),ye=(0,_.useCallback)(()=>{let e=[...P].toReversed().find(e=>e<E);e!==void 0&&_e(e)},[P,E,_e]),be=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(!I.current||E<0||ie.current!==null)return;if(oe.current){oe.current=!1;return}let t=I.current;be.current=!0;let n=t=>{let n=e.scenes;if(t<0||t>=n.length)return t;let r=e=>e===`user-prompt`||e===`compaction-summary`||e===`context-injection`;if(r(n[t].type))return t;let i=t;for(;i>0&&!r(n[i-1].type);)i--;return i},r=e=>{let r=t.querySelector(`[data-scene-index="${e}"]`);if(r)return r;let i=n(e);return t.querySelector(`[data-scene-index="${i}"]`)};requestAnimationFrame(()=>{let e=r(E);if(e)if(T===`playing`)e.scrollIntoView({behavior:`smooth`,block:`center`});else{let n=t.getBoundingClientRect(),r=e.getBoundingClientRect().top-n.top+t.scrollTop-n.height*.3;t.scrollTo({top:Math.max(0,r),behavior:`smooth`})}else T===`playing`&&t.scrollTo({top:t.scrollHeight,behavior:`smooth`});setTimeout(()=>{be.current=!1},400)})},[E,T,e.scenes]),(0,_.useEffect)(()=>{let e=I.current;if(!e)return;let t=()=>{be.current||T===`playing`&&A()};return e.addEventListener(`wheel`,t,{passive:!0}),e.addEventListener(`touchmove`,t,{passive:!0}),()=>{e.removeEventListener(`wheel`,t),e.removeEventListener(`touchmove`,t)}},[T,A]),(0,_.useEffect)(()=>{let t=I.current;if(!t)return;let n=!1,r=()=>{if(!(T!==`paused`||n)&&!(E>=e.scenes.length-1)&&!(be.current||ie.current!==null)&&t.scrollHeight-t.scrollTop-t.clientHeight<80){n=!0,oe.current=!0;let e=F(E);e!==-1&&M(e),setTimeout(()=>{n=!1},150)}},i=e=>{e.deltaY>0&&r()},a=0,o=e=>{a=e.touches[0].clientY},s=e=>{a-e.changedTouches[0].clientY>20&&r()};return t.addEventListener(`scroll`,r,{passive:!0}),t.addEventListener(`wheel`,i,{passive:!0}),t.addEventListener(`touchstart`,o,{passive:!0}),t.addEventListener(`touchend`,s,{passive:!0}),()=>{t.removeEventListener(`scroll`,r),t.removeEventListener(`wheel`,i),t.removeEventListener(`touchstart`,o),t.removeEventListener(`touchend`,s)}},[T,E,e.scenes.length,M,F]),(0,_.useEffect)(()=>{let e=ie.current,t=I.current;if(e===null||!t||E!==e)return;let n=!1,r=0,i=e=>{let n=t.querySelector(`[data-scene-index="${e}"]`);if(n)return n;let r=Array.from(t.querySelectorAll(`[data-scene-index]`)),i=null,a=1/0;for(let t of r){let n=t.getAttribute(`data-scene-index`);if(!n)continue;let r=parseInt(n,10);if(r<=e){let n=e-r;n<a&&(a=n,i=t)}}return i},a=()=>{if(n)return;let o=i(e);if(o){be.current=!0;let e=t.getBoundingClientRect(),n=o.getBoundingClientRect().top-e.top+t.scrollTop-e.height*.3;t.scrollTo({top:Math.max(0,n),behavior:`smooth`}),jc(o),setTimeout(()=>{be.current=!1},450),ie.current=null;return}r+=1,r<30?setTimeout(a,80):ie.current=null};return requestAnimationFrame(a),()=>{n=!0}},[E]),(0,_.useEffect)(()=>()=>{ae.current&&clearTimeout(ae.current)},[]);let xe=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(E<0||!s)return;xe.current&&clearTimeout(xe.current);let e=T===`playing`?500:0;return xe.current=setTimeout(()=>{let e=new URL(window.location.href);e.searchParams.set(`s`,String(E)),window.history.replaceState({},``,e.toString())},e),()=>{xe.current&&clearTimeout(xe.current)}},[E,T,s]);let Se=n===`editor`,Ce=(0,_.useMemo)(()=>C.some(e=>e.author===`vibe-feedback`),[C]);if(!s&&r===`replay`)return(0,V.jsx)(Js,{session:S,onStart:fe,onViewInsights:pe});let{meta:B}=e;return(0,V.jsxs)(`div`,{className:`flex flex-1 min-h-0 relative`,children:[(0,V.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 min-w-0`,children:[(0,V.jsx)(Ac,{activeView:r,onChangeView:i,hiddenTabs:o?[`export`]:void 0,rightContent:r===`replay`?(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[x.overlayCount>0&&(0,V.jsxs)(`button`,{onClick:()=>x.toggleAllOriginals(),className:`hidden md:flex items-center gap-2 text-xs font-mono text-terminal-dim`,title:x.showAllOriginals?`Showing originals — click to show modified`:`Showing modified — click to show originals`,children:[(0,V.jsx)(`span`,{children:x.showAllOriginals?`Original`:`Modified`}),(0,V.jsx)(`span`,{className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors duration-200 ${x.showAllOriginals?`bg-terminal-surface border border-terminal-border`:`bg-terminal-purple brightness-75`}`,children:(0,V.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-white shadow-sm transition-transform duration-200 ${x.showAllOriginals?`translate-x-[3px]`:`translate-x-[17px]`}`})})]}),(0,V.jsxs)(`button`,{onClick:()=>f(!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:[(0,V.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:(0,V.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`})}),(0,V.jsx)(`span`,{children:`Comments`}),b.annotations.length>0&&(0,V.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:b.annotations.length})]}),(0,V.jsxs)(`button`,{onClick:()=>f(!0),className:`md:hidden flex items-center gap-1 text-terminal-dim hover:text-terminal-text transition-colors`,title:`Comments`,children:[(0,V.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:(0,V.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`})}),b.annotations.length>0&&(0,V.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:b.annotations.length})]}),Se&&(0,V.jsxs)(`button`,{onClick:()=>m(!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:[(0,V.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`}),(0,V.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:(0,V.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`})}),(0,V.jsx)(`span`,{className:`font-semibold tracking-wide`,children:`AI Studio`}),(Ce||x.overlayCount>0)&&(0,V.jsxs)(`span`,{className:`relative flex h-1.5 w-1.5`,children:[(0,V.jsx)(`span`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-purple opacity-75`}),(0,V.jsx)(`span`,{className:`relative inline-flex rounded-full h-1.5 w-1.5 bg-terminal-purple`})]})]})]}):void 0}),(0,V.jsxs)(`div`,{className:`flex flex-1 min-h-0 min-w-0 w-full`,children:[r===`replay`&&(0,V.jsxs)(`div`,{className:`flex flex-1 min-h-0 min-w-0 w-full relative`,children:[v&&(0,V.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:[(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto min-h-0`,children:[(0,V.jsxs)(`div`,{className:`px-3 py-2 border-b border-terminal-border-subtle flex items-center justify-between group/side`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest`,children:`Outline`}),(0,V.jsx)(`button`,{onClick:()=>y(!1),className:`p-1 rounded hover:bg-terminal-surface text-terminal-dimmer hover:text-terminal-text transition-colors`,title:`Hide Sidebar`,children:(0,V.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:[(0,V.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}),(0,V.jsx)(`line`,{x1:`9`,x2:`9`,y1:`3`,y2:`21`})]})})]}),(0,V.jsx)(Ys,{scenes:e.scenes,currentIndex:E,onSeek:_e,overlayActions:x,turnStats:e.meta.stats.turnStats})]}),(0,V.jsxs)(`div`,{className:`shrink-0 border-t border-terminal-border-subtle overflow-y-auto max-h-[35%]`,children:[(0,V.jsx)(`div`,{className:`px-3 py-2 border-b border-terminal-border-subtle`,children:(0,V.jsx)(`button`,{onClick:()=>i(`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`})}),(0,V.jsxs)(`div`,{className:`p-3`,children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,V.jsx)(Le,{label:`Turns`,value:B.stats.userPrompts,color:`text-terminal-green`}),(0,V.jsx)(Le,{label:`Tools`,value:B.stats.toolCalls,color:`text-terminal-orange`})]}),(0,V.jsxs)(`div`,{className:`mt-2 text-xs font-mono text-terminal-dim space-y-0.5`,children:[B.model&&(0,V.jsx)(`div`,{children:(0,V.jsx)(`span`,{className:`text-terminal-text`,children:B.model})}),B.stats.durationMs&&(0,V.jsxs)(`div`,{children:[Re(B.stats.durationMs),B.stats.costEstimate!==void 0&&(0,V.jsxs)(`span`,{children:[` / `,(0,V.jsxs)(`span`,{className:`text-terminal-green`,children:[`$`,B.stats.costEstimate<.01?B.stats.costEstimate.toFixed(4):B.stats.costEstimate.toFixed(2)]})]})]}),B.stats.tokenUsage&&(0,V.jsxs)(`div`,{children:[U(B.stats.tokenUsage.inputTokens),` in /`,` `,U(B.stats.tokenUsage.outputTokens),` out`]}),(()=>{if(!B.stats.turnStats?.length)return null;let e=Math.max(...B.stats.turnStats.map(e=>e.contextTokens||0));return e<=0?null:(0,V.jsxs)(`div`,{className:`text-terminal-dim mt-0.5`,children:[`peak ctx: `,(0,V.jsx)(`span`,{className:`text-terminal-cyan`,children:U(e)})]})})()]})]})]})]}),(0,V.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 min-w-0 relative`,children:[!v&&(0,V.jsx)(`button`,{onClick:()=>y(!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:(0,V.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:(0,V.jsx)(`polyline`,{points:`9 18 15 12 9 6`})})}),(0,V.jsx)(`div`,{ref:I,className:`flex-1 overflow-y-auto overflow-x-hidden px-5 py-5 pb-10 overscroll-contain`,children:(0,V.jsx)(ks,{scenes:e.scenes,visibleCount:D,currentIndex:E,effectivePrefs:w,focusIndex:l,annotatedScenes:b.annotatedScenes,annotationCounts:b.annotationCounts,onSeek:_e,state:T,overlayActions:x,turnStats:e.meta.stats.turnStats,onComment:o?void 0:e=>{f(!0),g(e)}})}),(0,V.jsx)(ec,{scenes:S.scenes,open:re,onClose:()=>L(!1),onSeek:e=>{_e(e),L(!1)}})]})]}),r===`summary`&&(0,V.jsx)(sc,{session:S}),r===`export`&&(0,V.jsx)(Ws,{actions:b,viewerMode:n,readOnly:o,session:S})]}),r===`replay`&&(0,V.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:[(0,V.jsx)(Tc,{scenes:e.scenes,currentIndex:E,onSeek:_e,annotatedScenes:b.annotatedScenes}),(0,V.jsx)(wa,{state:T,speed:O,currentIndex:E,totalScenes:ee,userPromptCount:ue,currentTurn:le,onTogglePlayPause:j,onChangeSpeed:N,onPrevPrompt:ye,onNextPrompt:ve,onOpenSearch:()=>L(!0),onOpenOutline:()=>z(!0),onShowHelp:()=>ce(!0)})]})]}),(0,V.jsx)(Sa,{open:d,onClose:()=>f(!1),actions:b,scenes:S.scenes,currentIndex:E,onSeek:_e,addingForScene:h,onClearAddingTarget:()=>g(null),readOnly:o}),(0,V.jsx)(Ir,{open:p,onClose:()=>m(!1),annotationActions:b,overlayActions:x}),(0,V.jsxs)(`div`,{className:`fixed inset-0 z-40 md:hidden transition-opacity duration-300 ${R?`opacity-100`:`opacity-0 pointer-events-none`}`,onClick:()=>z(!1),children:[(0,V.jsx)(`div`,{className:`absolute inset-0 bg-black/40`}),(0,V.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 ${R?`translate-y-0`:`translate-y-full`}`,onClick:e=>e.stopPropagation(),children:[(0,V.jsx)(`div`,{className:`flex justify-center py-2.5 shrink-0`,children:(0,V.jsx)(`div`,{className:`w-10 h-1 rounded-full bg-terminal-border`})}),(0,V.jsxs)(`div`,{className:`flex border-b border-terminal-border-subtle shrink-0`,children:[(0,V.jsx)(`button`,{onClick:()=>ne(`outline`),className:`flex-1 px-3 py-2.5 text-[10px] font-sans font-semibold uppercase tracking-widest transition-colors ${te===`outline`?`text-terminal-green border-b-2 border-terminal-green`:`text-terminal-dim hover:text-terminal-text`}`,children:`Outline`}),(0,V.jsxs)(`button`,{onClick:()=>ne(`comments`),className:`flex-1 px-3 py-2.5 text-[10px] font-sans font-semibold uppercase tracking-widest transition-colors ${te===`comments`?`text-terminal-green border-b-2 border-terminal-green`:`text-terminal-dim hover:text-terminal-text`}`,children:[`Comments`,b.annotations.length>0&&(0,V.jsxs)(`span`,{className:`ml-1.5 text-terminal-dimmer`,children:[`(`,b.annotations.length,`)`]})]})]}),(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain`,children:te===`outline`?(0,V.jsx)(Ys,{scenes:e.scenes,currentIndex:E,onSeek:e=>{_e(e),z(!1)},overlayActions:x,turnStats:e.meta.stats.turnStats}):(0,V.jsx)(ba,{actions:b,scenes:S.scenes,currentIndex:E,onSeek:e=>{_e(e)},addingForScene:h,onClearAddingTarget:()=>g(null),readOnly:o})})]})]}),(0,V.jsx)(Ks,{open:se,onClose:()=>ce(!1)})]})}function Nc(){let[e,t]=(0,_.useState)({status:`loading`}),n=(0,_.useCallback)(()=>{t({status:`loading`}),Fc().then(e=>{t(e===`dashboard`?{status:`dashboard`}:{status:`ready`,session:e.session,mode:e.mode,gistOwner:e.gistOwner})},e=>t({status:`error`,message:String(e.message||e)}))},[]);return(0,_.useEffect)(()=>{n();let e=()=>n();return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[n]),e}function Pc(){return!!window.__VIBE_REPLAY_EDITOR__}async function Fc(){if(window.__VIBE_REPLAY_DATA__)return{session:window.__VIBE_REPLAY_DATA__,mode:`embedded`};let e=new URLSearchParams(window.location.search),t=e.get(`cloud`);if(t){if(!/^[a-zA-Z0-9_-]{10,16}$/.test(t))throw Error(`Invalid cloud replay ID`);let e=await fetch(`https://vibe-replay.com/api/cloud-replays/${t}`,{credentials:`include`});if(!e.ok)throw e.status===404?Error(`Replay not found`):e.status===410?Error(`This replay has expired`):Error(`Failed to load replay: ${e.status}`);let n=await e.json();if(n.redirect&&n.gistId){let{rawUrl:e}=await Lc(n.gistId);return{session:await Ic(e),mode:`readonly`}}return{session:n,mode:`readonly`}}let n=e.get(`gist`);if(n){if(!/^[a-f0-9]{20,40}$/.test(n))throw Error(`Invalid gist ID`);let{rawUrl:e,owner:t}=await Lc(n),r=await Ic(e);return fetch(`https://vibe-replay.com/api/cloud-replays/view-gist/${n}`,{method:`POST`}).catch(()=>{}),{session:r,mode:`readonly`,gistOwner:t}}if(Pc()){if(e.get(`view`)===`dashboard`)return`dashboard`;let t=e.get(`session`);if(t){let e=await fetch(`/api/session?slug=${encodeURIComponent(t)}`);if(!e.ok)throw Error(`Session not found: ${t}`);return{session:await e.json(),mode:`editor`}}return`dashboard`}let r=e.get(`url`);if(r)return{session:await Ic(r),mode:`readonly`};let i=e.get(`file`);if(i){let e=await fetch(i);if(!e.ok)throw Error(`Failed to load file: ${e.status}`);return{session:await e.json(),mode:`embedded`}}return`dashboard`}async function Ic(e){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch: ${t.status} ${t.statusText}`);let n=await t.text();if(n.trimStart().startsWith(`{`))return JSON.parse(n);throw Error(`URL must point to a vibe-replay JSON replay file`)}async function Lc(e){let t=await fetch(`https://api.github.com/gists/${e}`);if(!t.ok)throw Error(`Gist not found: ${t.status}`);let n=await t.json(),r=n.files,i=Object.values(r).find(e=>e.filename.endsWith(`.json`));if(!i)throw Error(`No JSON file found in gist`);let a=n.owner?.login;return{rawUrl:i.raw_url,owner:a}}function Rc(){let[e,t]=(0,_.useState)(()=>{let e=new URLSearchParams(window.location.search).get(`theme`);if(e===`light`||e===`dark`)return e;let t=localStorage.getItem(`vibe-replay-theme`);return t===`light`||t===`dark`?t:`dark`});return(0,_.useEffect)(()=>{let t=document.documentElement;t.classList.add(`theme-transition`),t.classList.toggle(`dark`,e===`dark`),t.classList.toggle(`light`,e===`light`),localStorage.setItem(`vibe-replay-theme`,e);let n=setTimeout(()=>t.classList.remove(`theme-transition`),300);return()=>clearTimeout(n)},[e]),{theme:e,toggleTheme:(0,_.useCallback)(()=>{t(e=>e===`dark`?`light`:`dark`)},[])}}function zc(){let e=new URLSearchParams(window.location.search).get(`v`);return e===`summary`||e===`export`?e:`replay`}var Bc=`https://vibe-replay.com`;function Vc({isEditor:e}){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!1),a=(0,_.useRef)(null),o=(0,_.useRef)(null),s=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let t=e?`/api/auth/get-session`:`${Bc}/api/auth/get-session`,r=``;if(!e)try{r=new URL(Bc).origin}catch{r=``}let i=e?{}:{credentials:`include`},a=()=>{fetch(t,i).then(e=>e.json()).then(e=>{e?.session?n({authenticated:!0,user:e.user||null}):n({authenticated:!1,user:null})}).catch(()=>n({authenticated:!1,user:null}))};a();let c=t=>{!e&&t.origin===r&&t.data?.type===`vibe-replay-auth`&&t.data.user&&(n({authenticated:!0,user:t.data.user}),window.dispatchEvent(new Event(`vibe-auth-change`)))};return window.addEventListener(`message`,c),window.addEventListener(`focus`,a),()=>{o.current&&=(clearInterval(o.current),null),s.current&&=(clearTimeout(s.current),null),window.removeEventListener(`message`,c),window.removeEventListener(`focus`,a)}},[e]),(0,_.useEffect)(()=>{if(!r)return;let e=e=>{a.current&&!a.current.contains(e.target)&&i(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[r]),t?t.authenticated?(0,V.jsxs)(`div`,{className:`relative`,ref:a,children:[(0,V.jsx)(`button`,{type:`button`,onClick:()=>i(!r),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:t.user?.image?(0,V.jsx)(`img`,{src:t.user.image,alt:``,className:`w-full h-full rounded-full object-cover`}):(0,V.jsx)(`span`,{className:`text-[10px] text-terminal-dim`,children:`?`})}),r&&(0,V.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:[(0,V.jsx)(`div`,{className:`px-3 py-2 text-[11px] text-terminal-dim border-b border-terminal-border truncate font-mono`,children:t.user?.name||`logged in`}),(0,V.jsx)(`button`,{type:`button`,onClick:async()=>{let t=e?`/api/auth/sign-out`:`${Bc}/api/auth/sign-out`;await fetch(t,{method:`POST`,...e?{}:{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`})]})]}):(0,V.jsxs)(`button`,{type:`button`,onClick:async()=>{if(e)try{let e=await fetch(`/api/auth/login`,{method:`POST`}),t=await e.json().catch(()=>null);e.ok&&t?.url&&window.open(t.url,`_blank`)}catch{}else window.open(`${Bc}/auth/login?callback=/auth/success`,`_blank`);o.current&&=(clearInterval(o.current),null),s.current&&=(clearTimeout(s.current),null);let t=e?`/api/auth/get-session`:`${Bc}/api/auth/get-session`,r=e?{}:{credentials:`include`};o.current=setInterval(async()=>{try{let e=await(await fetch(t,r)).json();e?.session&&(o.current&&=(clearInterval(o.current),null),s.current&&=(clearTimeout(s.current),null),n({authenticated:!0,user:e.user||null}),window.dispatchEvent(new Event(`vibe-auth-change`)))}catch{}},2e3),s.current=setTimeout(()=>{o.current&&=(clearInterval(o.current),null),s.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:[(0,V.jsx)(`svg`,{className:`w-3.5 h-3.5`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,V.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 Hc(){let[e,t]=(0,_.useState)(null);return(0,_.useEffect)(()=>{window.__VIBE_REPLAY_EDITOR__&&fetch(`https://api.github.com/repos/tuo-lei/vibe-replay`).then(e=>e.json()).then(e=>{e.stargazers_count!=null&&t(e.stargazers_count)}).catch(()=>{})},[]),(0,V.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:[(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2`,children:[(0,V.jsx)(`svg`,{className:`w-3.5 h-3.5`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,V.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`]}),e!=null&&(0,V.jsx)(`span`,{className:`inline-flex items-center px-2 h-full border-l border-terminal-border`,children:e})]})}function Uc(){let e=Nc(),{theme:t,toggleTheme:n}=Rc(),{prefs:r,updatePref:i,togglePref:a}=Or(),o=e.status===`ready`?e.session:null,s=e.status===`ready`?e.mode:`embedded`,c=e.status===`ready`?e.gistOwner:void 0,l=s===`editor`,[u,d]=(0,_.useState)(zc()),f=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=()=>d(zc());return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let p=e=>{d(e),L({v:e===`replay`?null:e})},m=(0,_.useMemo)(()=>o?.scenes.some(e=>e.type===`thinking`)??!1,[o]),[h,g]=(0,_.useState)(!1);(0,_.useEffect)(()=>{if(!h)return;let e=e=>{e.key===`Escape`&&g(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let[y,b]=(0,_.useState)(!1),x=(0,_.useRef)(null);if((0,_.useEffect)(()=>{r.displayMode!==`custom`&&b(!1)},[r.displayMode]),v(x,(0,_.useCallback)(()=>b(!1),[]),y),e.status===`loading`)return(0,V.jsx)(`div`,{className:`h-screen bg-terminal-bg flex items-center justify-center`,children:(0,V.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,V.jsx)(`div`,{className:`text-terminal-green font-sans font-bold text-sm animate-pulse`,children:`LOADING SESSION...`}),(0,V.jsx)(`div`,{className:`text-terminal-dimmer font-mono text-xs`,children:`Preparing replay data`})]})});if(e.status===`error`)return(0,V.jsx)(`div`,{className:`h-screen bg-terminal-bg flex items-center justify-center`,children:(0,V.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,V.jsx)(`div`,{className:`text-terminal-red font-mono text-sm`,children:e.message}),(0,V.jsx)(`div`,{className:`text-terminal-dim font-mono text-xs`,children:`Use ?gist=<id> or ?url=<replay-json-url> or embed via CLI`})]})});if(e.status===`dashboard`)return(0,V.jsx)(`div`,{className:`h-screen bg-terminal-bg flex flex-col overflow-hidden`,children:(0,V.jsx)(Zn,{headerLeft:(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 shrink-0`,children:[(0,V.jsx)(`button`,{onClick:()=>L({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`}),(0,V.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:[(0,V.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-terminal-green animate-pulse`}),`Local`,(0,V.jsx)(`span`,{className:`instant-tooltip-text`,children:`v0.1.8\nViewer ${window.location.host}
|
|
107
|
+
Cloud https://vibe-replay.com`})]})]}),headerRight:(0,V.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,V.jsx)(Hc,{}),(0,V.jsx)(`button`,{onClick:n,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:t===`dark`?`☾`:`☀`}),(0,V.jsx)(Vc,{isEditor:!0})]})})});let{meta:S}=o;return(0,V.jsxs)(`div`,{className:`h-screen bg-terminal-bg flex flex-col overflow-hidden`,children:[(0,V.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:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 shrink-0`,children:[l?(0,V.jsx)(`button`,{onClick:()=>L({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`}):(0,V.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`}),l&&(0,V.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:[(0,V.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-terminal-green animate-pulse`}),`Local`,(0,V.jsx)(`span`,{className:`instant-tooltip-text`,children:`v0.1.8\nViewer ${window.location.host}
|
|
108
|
+
Cloud https://vibe-replay.com`})]})]}),l&&(0,V.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(e=>(0,V.jsx)(`button`,{onClick:()=>L({view:`dashboard`,session:null,tab:e}),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:e.charAt(0).toUpperCase()+e.slice(1)},e))}),S.title&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,V.jsx)(`span`,{className:`text-terminal-border/40 text-sm select-none hidden md:inline`,children:`|`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>{f.current?.(),p(`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:S.title}),c&&(0,V.jsxs)(`div`,{className:`hidden sm:flex items-center gap-1.5 text-xs font-mono text-terminal-dim`,children:[(0,V.jsx)(`span`,{className:`text-terminal-border`,children:`·`}),(0,V.jsx)(`span`,{className:`text-terminal-dimmer`,children:`shared by`}),(0,V.jsxs)(`a`,{href:`https://github.com/${c}`,target:`_blank`,rel:`noopener noreferrer`,className:`text-terminal-dim hover:text-terminal-text transition-colors`,children:[`@`,c]})]})]}),(0,V.jsx)(`div`,{className:`flex-1`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 md:gap-2 shrink-0`,children:[(0,V.jsxs)(`div`,{ref:x,className:`hidden md:flex items-center gap-1.5`,children:[(0,V.jsxs)(`div`,{className:`relative flex items-center`,children:[(0,V.jsxs)(`div`,{className:`flex items-center h-7 rounded-md overflow-hidden bg-terminal-surface`,children:[(0,V.jsx)(`button`,{onClick:()=>i(`displayMode`,`all`),className:`h-full px-2.5 text-xs font-mono transition-colors ${r.displayMode===`all`?`bg-terminal-green-subtle text-terminal-green`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,children:`All`}),(0,V.jsx)(`button`,{onClick:()=>i(`displayMode`,`compact`),className:`h-full px-2.5 text-xs font-mono transition-colors ${r.displayMode===`compact`?`bg-terminal-green-subtle text-terminal-green`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,children:`Compact`}),(0,V.jsx)(`button`,{onClick:()=>{i(`displayMode`,`custom`),b(e=>r.displayMode===`custom`?!e:!0)},className:`h-full px-2.5 text-xs font-mono transition-colors ${r.displayMode===`custom`?`bg-terminal-green-subtle text-terminal-green`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,children:`Custom`})]}),y&&r.displayMode===`custom`&&(0,V.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:[(0,V.jsxs)(`button`,{onClick:()=>a(`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:[(0,V.jsx)(`span`,{className:`w-3.5 h-3.5 rounded flex items-center justify-center text-[10px] ${r.promptsOnly?`bg-terminal-green-subtle text-terminal-green`:`bg-terminal-bg`}`,children:r.promptsOnly?`✓`:``}),`Prompts Only`]}),(0,V.jsxs)(`button`,{onClick:()=>a(`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:[(0,V.jsx)(`span`,{className:`w-3.5 h-3.5 rounded flex items-center justify-center text-[10px] ${r.collapseAllTools?`bg-terminal-orange-subtle text-terminal-orange`:`bg-terminal-bg`}`,children:r.collapseAllTools?`✓`:``}),`Tools Collapsed`]}),m&&(0,V.jsxs)(`button`,{onClick:()=>a(`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:[(0,V.jsx)(`span`,{className:`w-3.5 h-3.5 rounded flex items-center justify-center text-[10px] ${r.hideThinking?`bg-terminal-purple-subtle text-terminal-purple`:`bg-terminal-bg`}`,children:r.hideThinking?`✓`:``}),`Thinking Hidden`]})]})]}),(0,V.jsx)(Hc,{}),(0,V.jsx)(`button`,{onClick:n,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:t===`dark`?`Light mode`:`Dark mode`,children:t===`dark`?`☾`:`☀`}),l&&(0,V.jsx)(Vc,{isEditor:l})]}),(0,V.jsx)(`button`,{onClick:()=>g(e=>!e),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:h?(0,V.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,strokeWidth:`2`,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 18L18 6M6 6l12 12`})}):(0,V.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,strokeWidth:`2`,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5`})})})]}),h&&(0,V.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:(0,V.jsxs)(`div`,{className:`px-5 py-4 space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`span`,{className:`text-[11px] font-sans font-medium text-terminal-dim`,children:`Display`}),(0,V.jsx)(`div`,{className:`flex items-center h-8 rounded-lg overflow-hidden bg-terminal-surface`,children:[`all`,`compact`,`custom`].map(e=>(0,V.jsx)(`button`,{onClick:()=>{i(`displayMode`,e),e!==`custom`&&g(!1)},className:`h-full px-3.5 text-xs font-mono capitalize transition-colors ${r.displayMode===e?`bg-terminal-green-subtle text-terminal-green`:`text-terminal-dim hover:text-terminal-text`}`,children:e},e))})]}),r.displayMode===`custom`&&(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsx)(`button`,{onClick:()=>a(`promptsOnly`),className:`px-3 py-1.5 text-xs font-mono rounded-lg border transition-colors ${r.promptsOnly?`bg-terminal-green-subtle text-terminal-green border-terminal-green/30`:`text-terminal-dim border-terminal-border-subtle`}`,children:`Prompts Only`}),(0,V.jsx)(`button`,{onClick:()=>a(`collapseAllTools`),className:`px-3 py-1.5 text-xs font-mono rounded-lg border transition-colors ${r.collapseAllTools?`bg-terminal-orange-subtle text-terminal-orange border-terminal-orange/30`:`text-terminal-dim border-terminal-border-subtle`}`,children:`Tools Collapsed`}),m&&(0,V.jsx)(`button`,{onClick:()=>a(`hideThinking`),className:`px-3 py-1.5 text-xs font-mono rounded-lg border transition-colors ${r.hideThinking?`bg-terminal-purple-subtle text-terminal-purple border-terminal-purple/30`:`text-terminal-dim border-terminal-border-subtle`}`,children:`Thinking Hidden`})]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`span`,{className:`text-[11px] font-sans font-medium text-terminal-dim`,children:`Theme`}),(0,V.jsxs)(`button`,{onClick:()=>{n(),g(!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:[t===`dark`?`☾`:`☀`,(0,V.jsx)(`span`,{children:t===`dark`?`Light`:`Dark`})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`span`,{className:`text-[11px] font-sans font-medium text-terminal-dim`,children:`GitHub`}),(0,V.jsx)(Hc,{})]})]})})]}),h&&(0,V.jsx)(`div`,{className:`md:hidden fixed inset-0 z-30 bg-black/30`,onClick:()=>g(!1)}),(0,V.jsx)(Mc,{session:o,viewPrefs:r,viewerMode:s,activeView:u,setActiveView:p,returnToLandingRef:f})]})}g.createRoot(document.getElementById(`root`)).render((0,V.jsx)(_.StrictMode,{children:(0,V.jsx)(Uc,{})}));</script>
|
|
109
|
+
<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:#3b82f680;--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:#3b82f680;--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:0 solid #e5e7eb}:before,:after{--tw-content:""}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--font-sans);font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}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;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family: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:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-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{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder{opacity:1;color:#9ca3af}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{vertical-align:middle;display:block}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}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.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}.inset-y-3{top:.75rem;bottom:.75rem}.-bottom-20{bottom:-5rem}.-bottom-24{bottom:-6rem}.-left-20{left:-5rem}.-left-24{left:-6rem}.-right-10{right:-2.5rem}.-right-12{right:-3rem}.-right-20{right:-5rem}.-right-24{right:-6rem}.-top-12{top:-3rem}.-top-20{top:-5rem}.-top-24{top:-6rem}.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{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.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}.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-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-56{height:14rem}.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-\[2px\]{height:2px}.h-\[65vh\]{height:65vh}.h-\[6px\]{height:6px}.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-\[500px\]{max-height:500px}.max-h-\[50vh\]{max-height:50vh}.max-h-\[88vh\]{max-height:88vh}.min-h-0{min-height:0}.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-56{width:14rem}.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-\[2px\]{width:2px}.w-\[68px\]{width:68px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0}.min-w-4{min-width:1rem}.min-w-\[140px\]{min-width:140px}.min-w-\[40px\]{min-width:40px}.min-w-\[760px\]{min-width:760px}.max-w-0{max-width:0}.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}.flex-\[2\]{flex:2}.shrink-0{flex-shrink:0}.flex-grow,.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)) skewX(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)) skewX(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)) skewX(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)) skewX(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)) skewX(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)) skewX(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)) skewX(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)) skewX(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)) skewX(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)) skewX(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)) skewX(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)) skewX(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)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}.animate-bounce{animation:1s infinite bounce}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}.animate-ping{animation:1s cubic-bezier(0,0,.2,1) infinite ping}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:2s cubic-bezier(.4,0,.6,1) infinite pulse}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:1s linear infinite spin}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.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-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-y-0\.5{row-gap:.125rem}.gap-y-1{row-gap:.25rem}.gap-y-2{row-gap:.5rem}.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))}.space-y-px>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1px * 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{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.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-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.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:0}.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\/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-purple-500\/30{border-color:#a855f74d}.border-red-400\/20{border-color:#f8717133}.border-red-500\/30{border-color:#ef44444d}.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-terminal-orange{border-color:var(--orange)}.border-terminal-purple{border-color:var(--purple)}.border-transparent{border-color:#0000}.border-white\/10{border-color:#ffffff1a}.border-l-orange-500\/30{border-left-color:#f973164d}.border-l-red-500{--tw-border-opacity:1;border-left-color:rgb(239 68 68/var(--tw-border-opacity,1))}.border-l-terminal-blue{border-left-color:var(--blue)}.border-l-terminal-purple{border-left-color:var(--purple)}.\!bg-transparent{background-color:#0000!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-red-500\/20{background-color:#ef444433}.bg-red-500\/5{background-color:#ef44440d}.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-emphasis{background-color:var(--orange-emphasis)}.bg-terminal-orange-subtle{background-color:var(--orange-subtle)}.bg-terminal-purple{background-color:var(--purple)}.bg-terminal-purple-emphasis{background-color:var(--purple-emphasis)}.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:#0000}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-white\/85{background-color:#ffffffd9}.bg-white\/90{background-color:#ffffffe6}.bg-yellow-400{--tw-bg-opacity:1;background-color:rgb(250 204 21/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:#fff0 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:#fff0 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:#fff0 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:#fff0 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:#0000 var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from), var(--tw-gradient-to)}.via-terminal-bg{--tw-gradient-to:#fff0 var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from), var(--bg) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-terminal-surface{--tw-gradient-to:#fff0 var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from), var(--surface) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-transparent{--tw-gradient-to:#0000 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:#fff0 var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from), #ffffff0d 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-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.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-\[18px\]{line-height:18px}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.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:0}.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\/70{color:#c084fcb3}.text-purple-400\/80{color:#c084fccc}.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:#0000}.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::placeholder{color:var(--dim)}.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 #00000040;--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 #fb923c80;--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 #0000000d;--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 #0000001a, 0 4px 6px -4px #0000001a;--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 #0000001a, 0 2px 4px -2px #0000001a;--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 #0000000d;--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-offset:2px;outline:2px solid #0000}.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-red-500\/40{--tw-ring-color:#ef444466}.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 #0000000d);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);-webkit-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-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);-webkit-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-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,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\[left\]{transition-property:left;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-shadow{transition-property:box-shadow;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-property:transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.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{max-width:100vw;overflow-x:hidden}: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:#30363d80;--text:#c9d1d9;--dim:#8b949e;--dimmer:#7d8590;--green:#3fb950;--green-subtle:#3fb95026;--green-emphasis:#3fb95040;--blue:#79b8ff;--blue-subtle:#79b8ff26;--blue-emphasis:#79b8ff40;--orange:#d29922;--orange-subtle:#d2992226;--orange-emphasis:#d2992240;--red:#f85149;--red-subtle:#f8514926;--red-emphasis:#f8514940;--purple:#b392f0;--purple-subtle:#b392f026;--purple-emphasis:#b392f040;--cyan:#56d4dd;--cyan-subtle:#56d4dd26;--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:#0d1117b3}.light{--bg:#fff;--surface:#f6f8fa;--surface-hover:#e6edf3;--surface-2:#ebeef1;--surface-inset:#f0f2f5;--border:#d0d7de;--border-subtle:#d0d7de80;--text:#24292f;--dim:#57606a;--dimmer:#697078;--green:#1a7f37;--green-subtle:#1a7f371a;--green-emphasis:#1a7f3733;--blue:#0969da;--blue-subtle:#0969da1a;--blue-emphasis:#0969da33;--orange:#9a6700;--orange-subtle:#9a67001a;--orange-emphasis:#9a670033;--red:#cf222e;--red-subtle:#cf222e1a;--red-emphasis:#cf222e33;--purple:#8250df;--purple-subtle:#8250df1a;--purple-emphasis:#8250df33;--cyan:#0e7c86;--cyan-subtle:#0e7c861a;--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:#ffffffbf}html.theme-transition,html.theme-transition *,html.theme-transition :before,html.theme-transition :after{transition:background-color .25s,border-color .25s,color .25s}@media (prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!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:"█";color:var(--green);animation:1s step-end infinite blink}@keyframes fade-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.scene-enter{animation:.3s cubic-bezier(.4,0,.2,1) fade-in}@keyframes pulse-border{0%,to{border-color:#d299224d}50%{border-color:#d2992299}}.pause-overlay{animation:2s ease-in-out infinite pulse-border}@keyframes jump-target-flash{0%{outline-color:#3fb95000;box-shadow:0 0 #3fb95000}30%{outline-color:#3fb95099;box-shadow:0 0 0 3px #3fb95040}to{outline-color:#3fb95000;box-shadow:0 0 #3fb95000}}.jump-target-flash{outline:1px solid #0000;animation:.85s ease-out jump-target-flash}@keyframes nav-focus-pulse{0%,to{transform:translateY(0)}50%{transform:translateY(-1px)}}.scene-nav-focused{animation:.9s ease-in-out 2 nav-focus-pulse}@keyframes landing-glow{0%,to{box-shadow:0 0 #3fb95000}50%{box-shadow:0 0 20px 2px #3fb95026}}.landing-pulse{animation:2.5s ease-in-out infinite landing-glow}.instant-tooltip{position:relative}.instant-tooltip .instant-tooltip-text{visibility:hidden;opacity:0;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;border-radius:6px;margin-top:6px;padding:4px 8px;transition:opacity 80ms;position:absolute;top:100%;left:50%;transform:translate(-50%)}.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}.hover-lift:hover{box-shadow:var(--shadow-lg);transform:translateY(-2px)}.glass-effect{-webkit-backdrop-filter:blur(12px)saturate(180%);background-color:var(--surface-subtle-glass)}.premium-card{position:relative}.premium-card:before{content:"";border-radius:inherit;background:linear-gradient(135deg, var(--green-subtle), var(--blue-subtle));-webkit-mask-composite:xor;pointer-events:none;opacity:.5;padding:1px;position:absolute;inset:0;-webkit-mask-image:linear-gradient(#fff 0 0),linear-gradient(#fff 0 0);mask-image:linear-gradient(#fff 0 0),linear-gradient(#fff 0 0);-webkit-mask-position:0 0,0 0;mask-position:0 0,0 0;-webkit-mask-size:auto,auto;mask-size:auto,auto;-webkit-mask-repeat:repeat,repeat;mask-repeat:repeat,repeat;-webkit-mask-clip:content-box,border-box;mask-clip:content-box,border-box;-webkit-mask-origin:content-box,border-box;mask-origin:content-box,border-box;-webkit-mask-composite:xor;mask-composite:exclude;-webkit-mask-source-type:auto,auto;mask-mode:match-source,match-source}@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%;border-radius:4px;animation:2s linear infinite shimmer}.bg-dot-grid{background-image:radial-gradient(circle, var(--text) 1px, transparent 1px);opacity:.03;background-size:24px 24px}.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);border-radius:4px;padding:.15em .4em;font-size:.9em}.prose-terminal pre{background:var(--surface);border-radius:6px;margin:.5em 0;padding:.75em 1em;overflow-x:auto}.prose-terminal pre code{background:0 0;padding:0}.prose-terminal ul,.prose-terminal ol{margin:.5em 0;padding-left:1.5em}.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);color:var(--dim);margin:.5em 0;padding-left:1em}.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::placeholder{color:var(--dimmer)}.hover\:z-10:hover{z-index:10}.hover\:-translate-y-0\.5:hover{--tw-translate-y:-.125rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(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\: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-offset:2px;outline:2px solid #0000}.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)) skewX(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)) skewX(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)) skewX(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\:block{display:block}.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\:flex-row{flex-direction:row}.sm\:items-start{align-items:flex-start}.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:0}.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\:sticky{position:sticky}.lg\:top-3{top:.75rem}.lg\:inline{display:inline}.lg\:max-h-\[calc\(100vh-7rem\)\]{max-height:calc(100vh - 7rem)}.lg\:w-64{width:16rem}.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))}.lg\:grid-cols-\[minmax\(0\,1fr\)_22rem\]{grid-template-columns:minmax(0,1fr) 22rem}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:justify-between{justify-content:space-between}.lg\:self-start{align-self:flex-start}.lg\:overflow-y-auto{overflow-y:auto}}@media (min-width:1280px){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1536px){.\32 xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}.\[\&\>svg\]\:block>svg{display:block}.\[\&\>svg\]\:h-auto>svg{height:auto}.\[\&\>svg\]\:w-full>svg{width:100%}
|
|
110
|
+
/*$vite$:1*/</style>
|
|
165
111
|
</head>
|
|
166
112
|
<body class="bg-terminal-bg text-terminal-text min-h-screen">
|
|
167
113
|
<div id="root"></div>
|