vibe-replay 0.2.3 → 0.2.4

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.
@@ -5,30 +5,30 @@
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>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 ee=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function te(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 j(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,j(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=j(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+A(a,u++),c+=j(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return j(te(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 M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(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 N=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)},P={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(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=P,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:ne}},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,N)}catch(e){N(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&&A(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&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(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,A(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`),ee=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function te(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?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?M(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var ne=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ie=[],ae=-1;function F(e){return{current:e}}function oe(e){0>ae||(e.current=ie[ae],ie[ae]=null,ae--)}function I(e,t){ae++,ie[ae]=e.current,e.current=t}var se=F(null),ce=F(null),L=F(null),R=F(null);function le(e,t){switch(I(L,t),I(ce,e),I(se,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}}oe(se),I(se,e)}function ue(){oe(se),oe(ce),oe(L)}function de(e){e.memoizedState!==null&&I(R,e);var t=se.current,n=Hd(t,e.type);t!==n&&(I(ce,e),I(se,n))}function fe(e){ce.current===e&&(oe(se),oe(ce)),R.current===e&&(oe(R),Qf._currentValue=re)}var pe,me;function he(e){if(pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||``,me=-1<e.stack.indexOf(`
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,L={pending:!1,data:null,method:null,action:null},te=[],ne=-1;function R(e){return{current:e}}function z(e){0>ne||(e.current=te[ne],te[ne]=null,ne--)}function B(e,t){ne++,te[ne]=e.current,e.current=t}var re=R(null),ie=R(null),ae=R(null),oe=R(null);function se(e,t){switch(B(ae,t),B(ie,e),B(re,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}}z(re),B(re,e)}function V(){z(re),z(ie),z(ae)}function ce(e){e.memoizedState!==null&&B(oe,e);var t=re.current,n=Hd(t,e.type);t!==n&&(B(ie,e),B(re,n))}function le(e){ie.current===e&&(z(re),z(ie)),oe.current===e&&(z(oe),Qf._currentValue=L)}var ue,de;function fe(e){if(ue===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ue=t&&t[1]||``,de=-1<e.stack.indexOf(`
9
9
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
10
- `+pe+e+me}var ge=!1;function _e(e,t){if(!e||ge)return``;ge=!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(`
10
+ `+ue+e+de}var pe=!1;function me(e,t){if(!e||pe)return``;pe=!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
11
  `),l=s.split(`
12
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{ge=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?he(n):``}function ve(e,t){switch(e.tag){case 26:case 27:case 5:return he(e.type);case 16:return he(`Lazy`);case 13:return e.child!==t&&t!==null?he(`Suspense Fallback`):he(`Suspense`);case 19:return he(`SuspenseList`);case 0:case 15:return _e(e.type,!1);case 11:return _e(e.type.render,!1);case 1:return _e(e.type,!0);case 31:return he(`Activity`);default:return``}}function ye(e){try{var t=``,n=null;do t+=ve(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
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{pe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?fe(n):``}function he(e,t){switch(e.tag){case 26:case 27:case 5:return fe(e.type);case 16:return fe(`Lazy`);case 13:return e.child!==t&&t!==null?fe(`Suspense Fallback`):fe(`Suspense`);case 19:return fe(`SuspenseList`);case 0:case 15:return me(e.type,!1);case 11:return me(e.type.render,!1);case 1:return me(e.type,!0);case 31:return fe(`Activity`);default:return``}}function ge(e){try{var t=``,n=null;do t+=he(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
14
14
  Error generating stack: `+e.message+`
15
- `+e.stack}}var z=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,De=t.unstable_NormalPriority,Oe=t.unstable_LowPriority,ke=t.unstable_IdlePriority,Ae=t.log,je=t.unstable_setDisableYieldValue,Me=null,Ne=null;function Pe(e){if(typeof Ae==`function`&&je(e),Ne&&typeof Ne.setStrictMode==`function`)try{Ne.setStrictMode(Me,e)}catch{}}var Fe=Math.clz32?Math.clz32:Le,Ie=Math.log,V=Math.LN2;function Le(e){return e>>>=0,e===0?32:31-(Ie(e)/V|0)|0}var Re=256,ze=262144,Be=4194304;function Ve(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 He(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=Ve(n))):i=Ve(o):i=Ve(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ve(n))):i=Ve(o)):i=Ve(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 Ue(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function We(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 Ge(){var e=Be;return Be<<=1,!(Be&62914560)&&(Be=4194304),e}function Ke(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Je(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-Fe(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&&Ye(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ye(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Fe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Xe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Fe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ze(e,t){var n=t&-t;return n=n&42?1:H(n),(n&(e.suspendedLanes|t))===0?n:0}function H(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 Qe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function $e(){var e=P.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function et(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var tt=Math.random().toString(36).slice(2),U=`__reactFiber$`+tt,W=`__reactProps$`+tt,nt=`__reactContainer$`+tt,rt=`__reactEvents$`+tt,it=`__reactListeners$`+tt,at=`__reactHandles$`+tt,ot=`__reactResources$`+tt,st=`__reactMarker$`+tt;function ct(e){delete e[U],delete e[W],delete e[rt],delete e[it],delete e[at]}function lt(e){var t=e[U];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nt]||n[U]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[U])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function ut(e){if(e=e[U]||e[nt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function dt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ft(e){var t=e[ot];return t||=e[ot]={hoistableStyles:new Map,hoistableScripts:new Map},t}function pt(e){e[st]=!0}var mt=new Set,ht={};function gt(e,t){_t(e,t),_t(e+`Capture`,t)}function _t(e,t){for(ht[e]=t,e=0;e<t.length;e++)mt.add(t[e])}var vt=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]*$`),yt={},bt={};function xt(e){return z.call(bt,e)?!0:z.call(yt,e)?!1:vt.test(e)?bt[e]=!0:(yt[e]=!0,!1)}function St(e,t,n){if(xt(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 Ct(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 wt(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 Tt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Et(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Dt(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 Ot(e){if(!e._valueTracker){var t=Et(e)?`checked`:`value`;e._valueTracker=Dt(e,t,``+e[t])}}function kt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Et(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function At(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 jt=/[\n"\\]/g;function Mt(e){return e.replace(jt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Nt(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=``+Tt(t)):e.value!==``+Tt(t)&&(e.value=``+Tt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ft(e,o,Tt(n)):Ft(e,o,Tt(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=``+Tt(s):e.removeAttribute(`name`)}function Pt(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)){Ot(e);return}n=n==null?``:``+Tt(n),t=t==null?n:``+Tt(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),Ot(e)}function Ft(e,t,n){t===`number`&&At(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function It(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=``+Tt(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 Lt(e,t,n){if(t!=null&&(t=``+Tt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Tt(n)}function Rt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Tt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ot(e)}function zt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Bt=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 Vt(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||Bt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ht(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&&Vt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Vt(e,o,t[o])}function Ut(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 Wt=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`]]),Gt=/^[\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 Kt(e){return Gt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function qt(){}var Jt=null;function Yt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xt=null,Zt=null;function Qt(e){var t=ut(e);if(t&&(e=t.stateNode)){var n=e[W]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Nt(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="`+Mt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[W]||null;if(!a)throw Error(i(90));Nt(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&&kt(r)}break a;case`textarea`:Lt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&It(e,!!n.multiple,t,!1)}}}var $t=!1;function en(e,t,n){if($t)return e(t,n);$t=!0;try{return e(t)}finally{if($t=!1,(Xt!==null||Zt!==null)&&(vu(),Xt&&(t=Xt,e=Zt,Zt=Xt=null,Qt(t),e)))for(t=0;t<e.length;t++)Qt(e[t])}}function tn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[W]||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 nn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),rn=!1;if(nn)try{var an={};Object.defineProperty(an,`passive`,{get:function(){rn=!0}}),window.addEventListener(`test`,an,an),window.removeEventListener(`test`,an,an)}catch{rn=!1}var on=null,sn=null,cn=null;function ln(){if(cn)return cn;var e,t=sn,n=t.length,r,i=`value`in on?on.value:on.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 cn=i.slice(e,1<r?1-r:void 0)}function un(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 dn(){return!0}function fn(){return!1}function pn(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)?dn:fn,this.isPropagationStopped=fn,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=dn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=dn)},persist:function(){},isPersistent:dn}),t}var mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hn=pn(mn),gn=h({},mn,{view:0,detail:0}),_n=pn(gn),vn,yn,bn,xn=h({},gn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mn,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!==bn&&(bn&&e.type===`mousemove`?(vn=e.screenX-bn.screenX,yn=e.screenY-bn.screenY):yn=vn=0,bn=e),vn)},movementY:function(e){return`movementY`in e?e.movementY:yn}}),Sn=pn(xn),Cn=pn(h({},xn,{dataTransfer:0})),wn=pn(h({},gn,{relatedTarget:0})),Tn=pn(h({},mn,{animationName:0,elapsedTime:0,pseudoElement:0})),En=pn(h({},mn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Dn=pn(h({},mn,{data:0})),On={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},kn={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`},An={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function jn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=An[e])?!!t[e]:!1}function Mn(){return jn}var Nn=pn(h({},gn,{key:function(e){if(e.key){var t=On[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=un(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?kn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mn,charCode:function(e){return e.type===`keypress`?un(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?un(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Pn=pn(h({},xn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Fn=pn(h({},gn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mn})),In=pn(h({},mn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Ln=pn(h({},xn,{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})),Rn=pn(h({},mn,{newState:0,oldState:0})),zn=[9,13,27,32],Bn=nn&&`CompositionEvent`in window,Vn=null;nn&&`documentMode`in document&&(Vn=document.documentMode);var Hn=nn&&`TextEvent`in window&&!Vn,Un=nn&&(!Bn||Vn&&8<Vn&&11>=Vn),Wn=` `,Gn=!1;function Kn(e,t){switch(e){case`keyup`:return zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Jn=!1;function Yn(e,t){switch(e){case`compositionend`:return qn(t);case`keypress`:return t.which===32?(Gn=!0,Wn):null;case`textInput`:return e=t.data,e===Wn&&Gn?null:e;default:return null}}function Xn(e,t){if(Jn)return e===`compositionend`||!Bn&&Kn(e,t)?(e=ln(),cn=sn=on=null,Jn=!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 Un&&t.locale!==`ko`?null:t.data;default:return null}}var Zn={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 Qn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Zn[e.type]:t===`textarea`}function $n(e,t,n,r){Xt?Zt?Zt.push(r):Zt=[r]:Xt=r,t=Td(t,`onChange`),0<t.length&&(n=new hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var er=null,tr=null;function nr(e){vd(e,0)}function rr(e){if(kt(dt(e)))return e}function ir(e,t){if(e===`change`)return t}var ar=!1;if(nn){var or;if(nn){var sr=`oninput`in document;if(!sr){var cr=document.createElement(`div`);cr.setAttribute(`oninput`,`return;`),sr=typeof cr.oninput==`function`}or=sr}else or=!1;ar=or&&(!document.documentMode||9<document.documentMode)}function lr(){er&&(er.detachEvent(`onpropertychange`,ur),tr=er=null)}function ur(e){if(e.propertyName===`value`&&rr(tr)){var t=[];$n(t,tr,e,Yt(e)),en(nr,t)}}function dr(e,t,n){e===`focusin`?(lr(),er=t,tr=n,er.attachEvent(`onpropertychange`,ur)):e===`focusout`&&lr()}function fr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return rr(tr)}function pr(e,t){if(e===`click`)return rr(t)}function mr(e,t){if(e===`input`||e===`change`)return rr(t)}function hr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var gr=typeof Object.is==`function`?Object.is:hr;function _r(e,t){if(gr(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(!z.call(t,i)||!gr(e[i],t[i]))return!1}return!0}function vr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yr(e,t){var n=vr(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=vr(n)}}function br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=At(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=At(e.document)}return t}function Sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Cr=nn&&`documentMode`in document&&11>=document.documentMode,wr=null,Tr=null,Er=null,Dr=!1;function Or(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dr||wr==null||wr!==At(r)||(r=wr,`selectionStart`in r&&Sr(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}),Er&&_r(Er,r)||(Er=r,r=Td(Tr,`onSelect`),0<r.length&&(t=new hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=wr)))}function kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ar={animationend:kr(`Animation`,`AnimationEnd`),animationiteration:kr(`Animation`,`AnimationIteration`),animationstart:kr(`Animation`,`AnimationStart`),transitionrun:kr(`Transition`,`TransitionRun`),transitionstart:kr(`Transition`,`TransitionStart`),transitioncancel:kr(`Transition`,`TransitionCancel`),transitionend:kr(`Transition`,`TransitionEnd`)},jr={},Mr={};nn&&(Mr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),`TransitionEvent`in window||delete Ar.transitionend.transition);function Nr(e){if(jr[e])return jr[e];if(!Ar[e])return e;var t=Ar[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Mr)return jr[e]=t[n];return e}var Pr=Nr(`animationend`),Fr=Nr(`animationiteration`),Ir=Nr(`animationstart`),Lr=Nr(`transitionrun`),Rr=Nr(`transitionstart`),zr=Nr(`transitioncancel`),Br=Nr(`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),gt(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-Fe(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,se.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 G(e,t){if(typeof e==`object`&&e){var n=di.get(e);return n===void 0?(t={value:e,source:t,stack:ye(t)},di.set(e,t),t):n}return{value:e,source:t,stack:ye(t)}}var fi=[],pi=0,mi=null,hi=0,gi=[],_i=0,vi=null,yi=1,bi=``;function xi(e,t){fi[pi++]=hi,fi[pi++]=mi,mi=e,hi=t}function Si(e,t,n){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,vi=e;var r=yi;e=bi;var i=32-Fe(r)-1;r&=~(1<<i),n+=1;var a=32-Fe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,yi=1<<32-Fe(t)+i|n<<i|r,bi=a+e}else yi=1<<a|n<<i|r,bi=e}function Ci(e){e.return!==null&&(xi(e,1),Si(e,1,0))}function wi(e){for(;e===mi;)mi=fi[--pi],fi[pi]=null,hi=fi[--pi],fi[pi]=null;for(;e===vi;)vi=gi[--_i],gi[_i]=null,bi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null}function Ti(e,t){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,yi=t.id,bi=t.overflow,vi=e}var Ei=null,Di=null,K=!1,Oi=null,ki=!1,Ai=Error(i(519));function ji(e){throw Li(G(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ai}function Mi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[U]=e,t[W]=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),Pt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Rt(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=qt),t=!0):t=!1,t||ji(e,!0)}function Ni(e){for(Ei=e.return;Ei;)switch(Ei.tag){case 5:case 31:case 13:ki=!1;return;case 27:case 3:ki=!0;return;default:Ei=Ei.return}}function Pi(e){if(e!==Ei)return!1;if(!K)return Ni(e),K=!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&&Di&&ji(e),Ni(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Di=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Di=uf(e)}else t===27?(t=Di,Zd(e.type)?(e=lf,lf=null,Di=e):Di=t):Di=Ei?cf(e.stateNode.nextSibling):null;return!0}function Fi(){Di=Ei=null,K=!1}function Ii(){var e=Oi;return e!==null&&(Yl===null?Yl=e:Yl.push.apply(Yl,e),Oi=null),e}function Li(e){Oi===null?Oi=[e]:Oi.push(e)}var Ri=F(null),zi=null,Bi=null;function Vi(e,t,n){I(Ri,t._currentValue),t._currentValue=n}function Hi(e){e._currentValue=Ri.current,oe(Ri)}function Ui(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 Wi(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),Ui(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),Ui(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 Gi(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;gr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===R.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&&Wi(t,e,n,r),t.flags|=262144}function Ki(e){for(e=e.firstContext;e!==null;){if(!gr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function qi(e){zi=e,Bi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ji(e){return Xi(zi,e)}function Yi(e,t){return zi===null&&qi(e),Xi(e,t)}function Xi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Bi===null){if(e===null)throw Error(i(308));Bi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Bi=Bi.next=t;return n}var Zi=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()})}},Qi=t.unstable_scheduleCallback,$i=t.unstable_NormalPriority,ea={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ta(){return{controller:new Zi,data:new Map,refCount:0}}function na(e){e.refCount--,e.refCount===0&&Qi($i,function(){e.controller.abort()})}var ra=null,ia=0,aa=0,oa=null;function sa(e,t){if(ra===null){var n=ra=[];ia=0,aa=ud(),oa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ia++,t.then(ca,ca),t}function ca(){if(--ia===0&&ra!==null){oa!==null&&(oa.status=`fulfilled`);var e=ra;ra=null,aa=0,oa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function la(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 ua=N.S;N.S=function(e,t){Ql=B(),typeof t==`object`&&t&&typeof t.then==`function`&&sa(e,t),ua!==null&&ua(e,t)};var da=F(null);function fa(){var e=da.current;return e===null?Fl.pooledCache:e}function pa(e,t){t===null?I(da,da.current):I(da,t.pool)}function ma(){var e=fa();return e===null?null:{parent:ea._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(qt,qt),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(qt,qt);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(ne(t)||te(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,Yi(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(ne(n)||te(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,Yi(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(ne(r)||te(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,Yi(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),K&&xi(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 K&&xi(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)}),K&&xi(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),K&&xi(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 K&&xi(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)}),K&&xi(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(ne(o))return h(e,r,o,c);if(te(o)){if(l=te(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,Yi(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,Pl&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 q(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,Xe(e,n)}}function Ra(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 za=!1;function Ba(){if(za){var e=oa;if(e!==null)throw e}}function Va(e,t,n,r){za=!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===aa&&(za=!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 Ha(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ua(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ha(n[e],t)}var Wa=F(null),Ga=F(0);function Ka(e,t){e=Vl,I(Ga,e),I(Wa,t),Vl=e|t.baseLanes}function qa(){I(Ga,Vl),I(Wa,Wa.current)}function Ja(){Vl=Ga.current,oe(Wa),oe(Ga)}var Ya=F(null),Xa=null;function Za(e){var t=e.alternate;I(no,no.current&1),I(Ya,e),Xa===null&&(t===null||Wa.current!==null||t.memoizedState!==null)&&(Xa=e)}function Qa(e){I(no,no.current),I(Ya,e),Xa===null&&(Xa=e)}function $a(e){e.tag===22?(I(no,no.current),I(Ya,e),Xa===null&&(Xa=e)):eo(e)}function eo(){I(no,no.current),I(Ya,Ya.current)}function to(e){oe(Ya),Xa===e&&(Xa=null),oe(no)}var no=F(0);function ro(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 io=0,J=null,ao=null,Y=null,oo=!1,so=!1,co=!1,lo=0,uo=0,fo=null,po=0;function mo(){throw Error(i(321))}function ho(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!gr(e[n],t[n]))return!1;return!0}function go(e,t,n,r,i,a){return io=a,J=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Ms:Ns,co=!1,a=n(r,i),co=!1,so&&(a=vo(t,n,r,i)),_o(e),a}function _o(e){N.H=js;var t=ao!==null&&ao.next!==null;if(io=0,Y=ao=J=null,oo=!1,uo=0,fo=null,t)throw Error(i(300));e===null||Xs||(e=e.dependencies,e!==null&&Ki(e)&&(Xs=!0))}function vo(e,t,n,r){J=e;var a=0;do{if(so&&(fo=null),uo=0,so=!1,25<=a)throw Error(i(301));if(a+=1,Y=ao=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Ps,o=t(n,r)}while(so);return o}function yo(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Eo(t):t,e=e.useState()[0],(ao===null?null:ao.memoizedState)!==e&&(J.flags|=1024),t}function bo(){var e=lo!==0;return lo=0,e}function xo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function So(e){if(oo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}oo=!1}io=0,Y=ao=J=null,so=!1,uo=lo=0,fo=null}function Co(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Y===null?J.memoizedState=Y=e:Y=Y.next=e,Y}function wo(){if(ao===null){var e=J.alternate;e=e===null?null:e.memoizedState}else e=ao.next;var t=Y===null?J.memoizedState:Y.next;if(t!==null)Y=t,ao=e;else{if(e===null)throw J.alternate===null?Error(i(467)):Error(i(310));ao=e,e={memoizedState:ao.memoizedState,baseState:ao.baseState,baseQueue:ao.baseQueue,queue:ao.queue,next:null},Y===null?J.memoizedState=Y=e:Y=Y.next=e}return Y}function To(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Eo(e){var t=uo;return uo+=1,fo===null&&(fo=[]),e=ba(fo,e,t),t=J,(Y===null?t.memoizedState:Y.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Ms:Ns),e}function Do(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Eo(e);if(e.$$typeof===C)return Ji(e)}throw Error(i(438,String(e)))}function Oo(e){var t=null,n=J.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=J.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(),J.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]=ee;return t.index++,n}function ko(e,t){return typeof t==`function`?t(e):t}function Ao(e){return jo(wo(),ao,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?(io&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===aa&&(d=!0);else if((io&p)===p){u=u.next,p===aa&&(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,J.lanes|=p,Ul|=p;f=u.action,co&&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,J.lanes|=f,Ul|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!gr(o,e.memoizedState)&&(Xs=!0,d&&(n=oa,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);gr(o,t.memoizedState)||(Xs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function No(e,t,n){var r=J,a=wo(),o=K;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!gr((ao||a).memoizedState,n);if(s&&(a.memoizedState=n,Xs=!0),a=a.queue,rs(Io.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||Y!==null&&Y.memoizedState.tag&1){if(r.flags|=2048,Qo(9,{destroy:void 0},Fo.bind(null,r,a,n,t),null),Fl===null)throw Error(i(349));o||io&127||Po(r,t,n)}return n}function Po(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=J.updateQueue,t===null?(t=To(),J.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!gr(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(),co){Pe(!0);try{n()}finally{Pe(!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,ao,typeof r==`function`?r:ko)}function Vo(e,t,n,r,a){if(Os(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)}};N.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=N.T,o={};N.T=o;try{var s=n(i,r),c=N.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),N.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(K){var n=Fl.formState;if(n!==null){a:{var r=J;if(K){if(Di){b:{for(var i=Di,a=ki;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){Di=cf(i.nextSibling),r=i.data===`F!`;break a}}ji(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=Ts.bind(null,J,r),r.dispatch=n,r=zo(!1),a=Ds.bind(null,J,!1,r.queue),r=Co(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Vo.bind(null,J,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function X(e){return Yo(wo(),ao,e)}function Yo(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&&(J.flags|=2048,Qo(9,{destroy:void 0},Xo.bind(null,i,n),null)),[r,a,e]}function Xo(e,t){e.action=t}function Zo(e){var t=wo(),n=ao;if(n!==null)return Yo(t,n,e);wo(),t=t.memoizedState,n=wo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Qo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=J.updateQueue,t===null&&(t=To(),J.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 $o(){return wo().memoizedState}function es(e,t,n,r){var i=Co();J.flags|=e,i.memoizedState=Qo(1|t,{destroy:void 0},n,r===void 0?null:r)}function ts(e,t,n,r){var i=wo();r=r===void 0?null:r;var a=i.memoizedState.inst;ao!==null&&r!==null&&ho(r,ao.memoizedState.deps)?i.memoizedState=Qo(t,a,n,r):(J.flags|=e,i.memoizedState=Qo(1|t,a,n,r))}function ns(e,t){es(8390656,8,e,t)}function rs(e,t){ts(2048,8,e,t)}function is(e){J.flags|=4;var t=J.updateQueue;if(t===null)t=To(),J.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function as(e){var t=wo().memoizedState;return is({ref:t,nextImpl:e}),function(){if(Pl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function os(e,t){return ts(4,2,e,t)}function ss(e,t){return ts(4,4,e,t)}function cs(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 ls(e,t,n){n=n==null?null:n.concat([e]),ts(4,4,cs.bind(null,t,e),n)}function us(){}function ds(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ho(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function fs(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ho(t,r[1]))return r[0];if(r=e(),co){Pe(!0);try{e()}finally{Pe(!1)}}return n.memoizedState=[r,t],r}function ps(e,t,n){return n===void 0||io&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),J.lanes|=e,Ul|=e,n)}function ms(e,t,n,r){return gr(n,t)?n:Wa.current===null?!(io&42)||io&1073741824&&!(Q&261930)?(Xs=!0,e.memoizedState=n):(e=fu(),J.lanes|=e,Ul|=e,t):(e=ps(e,n,r),gr(e,t)||(Xs=!0),e)}function hs(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,Ds(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Es(e,t,la(c,r),du(e)):Es(e,t,r,du(e))}catch(n){Es(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function gs(){}function _s(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=vs(e).queue;hs(e,a,t,re,n===null?gs:function(){return ys(e),n(r)})}function vs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:re},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 ys(e){var t=vs(e);t.next===null&&(t=e.alternate.memoizedState),Es(e,t.next.queue,{},du())}function bs(){return Ji(Qf)}function xs(){return wo().memoizedState}function Ss(){return wo().memoizedState}function Cs(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),q(r,t,n)),t={cache:ta()},e.payload=t;return}t=t.return}}function ws(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Os(e)?ks(t,n):(n=Xr(e,t,n,r),n!==null&&(pu(n,e,r),As(n,t,r)))}function Ts(e,t,n){Es(e,t,n,du())}function Es(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Os(e))ks(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,gr(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),As(n,t,r),!0}return!1}function Ds(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Os(e)){if(t)throw Error(i(479))}else t=Xr(e,n,r,2),t!==null&&pu(t,e,2)}function Os(e){var t=e.alternate;return e===J||t!==null&&t===J}function ks(e,t){so=oo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function As(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}var js={readContext:Ji,use:Do,useCallback:mo,useContext:mo,useEffect:mo,useImperativeHandle:mo,useLayoutEffect:mo,useInsertionEffect:mo,useMemo:mo,useReducer:mo,useRef:mo,useState:mo,useDebugValue:mo,useDeferredValue:mo,useTransition:mo,useSyncExternalStore:mo,useId:mo,useHostTransitionStatus:mo,useFormState:mo,useActionState:mo,useOptimistic:mo,useMemoCache:mo,useCacheRefresh:mo};js.useEffectEvent=mo;var Ms={readContext:Ji,use:Do,useCallback:function(e,t){return Co().memoizedState=[e,t===void 0?null:t],e},useContext:Ji,useEffect:ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),es(4194308,4,cs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return es(4194308,4,e,t)},useInsertionEffect:function(e,t){es(4,2,e,t)},useMemo:function(e,t){var n=Co();t=t===void 0?null:t;var r=e();if(co){Pe(!0);try{e()}finally{Pe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Co();if(n!==void 0){var i=n(t);if(co){Pe(!0);try{n(t)}finally{Pe(!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=ws.bind(null,J,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=Ts.bind(null,J,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:us,useDeferredValue:function(e,t){return ps(Co(),e,t)},useTransition:function(){var e=zo(!1);return e=hs.bind(null,J,e.queue,!0,!1),Co().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=J,a=Co();if(K){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,ns(Io.bind(null,r,o,e),[e]),r.flags|=2048,Qo(9,{destroy:void 0},Fo.bind(null,r,o,n,t),null),n},useId:function(){var e=Co(),t=Fl.identifierPrefix;if(K){var n=bi,r=yi;n=(r&~(1<<32-Fe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=lo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=po++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:bs,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=Ds.bind(null,J,!0,n),n.dispatch=t,[e,t]},useMemoCache:Oo,useCacheRefresh:function(){return Co().memoizedState=Cs.bind(null,J)},useEffectEvent:function(e){var t=Co(),n={impl:e};return t.memoizedState=n,function(){if(Pl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ns={readContext:Ji,use:Do,useCallback:ds,useContext:Ji,useEffect:rs,useImperativeHandle:ls,useInsertionEffect:os,useLayoutEffect:ss,useMemo:fs,useReducer:Ao,useRef:$o,useState:function(){return Ao(ko)},useDebugValue:us,useDeferredValue:function(e,t){return ms(wo(),ao.memoizedState,e,t)},useTransition:function(){var e=Ao(ko)[0],t=wo().memoizedState;return[typeof e==`boolean`?e:Eo(e),t]},useSyncExternalStore:No,useId:xs,useHostTransitionStatus:bs,useFormState:X,useActionState:X,useOptimistic:function(e,t){return Bo(wo(),ao,e,t)},useMemoCache:Oo,useCacheRefresh:Ss};Ns.useEffectEvent=as;var Ps={readContext:Ji,use:Do,useCallback:ds,useContext:Ji,useEffect:rs,useImperativeHandle:ls,useInsertionEffect:os,useLayoutEffect:ss,useMemo:fs,useReducer:Mo,useRef:$o,useState:function(){return Mo(ko)},useDebugValue:us,useDeferredValue:function(e,t){var n=wo();return ao===null?ps(n,e,t):ms(n,ao.memoizedState,e,t)},useTransition:function(){var e=Mo(ko)[0],t=wo().memoizedState;return[typeof e==`boolean`?e:Eo(e),t]},useSyncExternalStore:No,useId:xs,useHostTransitionStatus:bs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){var n=wo();return ao===null?(n.baseState=e,[e,n.queue.dispatch]):Bo(n,ao,e,t)},useMemoCache:Oo,useCacheRefresh:Ss};Ps.useEffectEvent=as;function Fs(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 Is={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),q(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),q(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),q(t,e,n))}};function Ls(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!_r(n,r)||!_r(i,a):!0}function Rs(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&&Is.enqueueReplaceState(t,t.state,null)}function zs(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 Bs(e){Wr(e)}function Vs(e){console.error(e)}function Hs(e){Wr(e)}function Us(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ws(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 Gs(e,t,n){return n=Ia(n),n.tag=3,n.payload={element:null},n.callback=function(){Us(e,t)},n}function Ks(e){return e=Ia(e),e.tag=3,e}function qs(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(){Ws(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ws(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 Js(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Gi(t,n,a,!0),n=Ya.current,n!==null){switch(n.tag){case 31:case 13:return Xa===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(K)return t=Ya.current,t===null?(r!==Ai&&(t=Error(i(423),{cause:r}),Li(G(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=G(r,n),a=Gs(e.stateNode,r,a),Ra(e,a),Hl!==4&&(Hl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ai&&(e=Error(i(422),{cause:r}),Li(G(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=G(o,n),Jl===null?Jl=[o]:Jl.push(o),Hl!==4&&(Hl=2),t===null)return!0;r=G(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Gs(n.stateNode,r,e),Ra(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=Ks(a),qs(a,e,n,r),Ra(n,a),!1}n=n.return}while(n!==null);return!1}var Ys=Error(i(461)),Xs=!1;function Zs(e,t,n,r){t.child=e===null?Ma(t,null,n,r):ja(t,e.child,n,r)}function Qs(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 qi(t),r=go(e,t,n,o,a,i),s=bo(),e!==null&&!Xs?(xo(e,t,i),Sc(e,t,i)):(K&&s&&Ci(t),t.flags|=1,Zs(e,t,r,i),t.child)}function $s(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,ec(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,!Cc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?_r:n,n(o,r)&&e.ref===t.ref)return Sc(e,t,i)}return t.flags|=1,e=ii(a,r),e.ref=t.ref,e.return=t,t.child=e}function ec(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(_r(a,r)&&e.ref===t.ref)if(Xs=!1,t.pendingProps=r=a,Cc(e,i))e.flags&131072&&(Xs=!0);else return t.lanes=e.lanes,Sc(e,t,i)}return cc(e,t,n,r,i)}function tc(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 rc(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?qa():Ka(t,a),$a(t);else return r=t.lanes=536870912,rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&pa(t,null),qa(),eo(t)):(pa(t,a.cachePool),Ka(t,a),eo(t),t.memoizedState=null);return Zs(e,t,i,n),t.child}function nc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rc(e,t,n,r,i){var a=fa();return a=a===null?null:{parent:ea._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&pa(t,null),qa(),$a(t),e!==null&&Gi(e,t,r,!0),t.childLanes=i,null}function ic(e,t){return t=_c({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ac(e,t,n){return ja(t,e.child,null,n),e=ic(t,t.pendingProps),e.flags|=2,to(t),t.memoizedState=null,e}function oc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(K){if(r.mode===`hidden`)return e=ic(t,r),t.lanes=536870912,nc(null,e);if(Qa(t),(e=Di)?(e=rf(e,ki),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Ei=t,Di=null)):e=null,e===null)throw ji(t);return t.lanes=536870912,null}return ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Qa(t),a)if(t.flags&256)t.flags&=-257,t=ac(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Xs||Gi(e,t,n,!1),a=(n&e.childLanes)!==0,Xs||a){if(r=Fl,r!==null&&(s=Ze(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Zr(e,s),pu(r,e,s),Ys;Tu(),t=ac(e,t,n)}else e=o.treeContext,Di=cf(s.nextSibling),Ei=t,K=!0,Oi=null,ki=!1,e!==null&&Ti(t,e),t=ic(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 sc(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 cc(e,t,n,r,i){return qi(t),n=go(e,t,n,r,void 0,i),r=bo(),e!==null&&!Xs?(xo(e,t,i),Sc(e,t,i)):(K&&r&&Ci(t),t.flags|=1,Zs(e,t,n,i),t.child)}function lc(e,t,n,r,i,a){return qi(t),t.updateQueue=null,n=vo(t,r,n,i),_o(e),r=bo(),e!==null&&!Xs?(xo(e,t,a),Sc(e,t,a)):(K&&r&&Ci(t),t.flags|=1,Zs(e,t,n,a),t.child)}function uc(e,t,n,r,i){if(qi(t),t.stateNode===null){var a=ei,o=n.contextType;typeof o==`object`&&o&&(a=Ji(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Is,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?Ji(o):ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Fs(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&&Is.enqueueReplaceState(a,a.state,null),Va(t,r,a,i),Ba(),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=zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ei,typeof u==`object`&&u&&(o=Ji(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)&&Rs(t,a,r,o),Na=!1;var f=t.memoizedState;a.state=f,Va(t,r,a,i),Ba(),l=t.memoizedState,s||f!==l||Na?(typeof d==`function`&&(Fs(t,n,d,r),l=t.memoizedState),(c=Na||Ls(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=zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ei,typeof l==`object`&&l&&(c=Ji(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)&&Rs(t,a,r,c),Na=!1,f=t.memoizedState,a.state=f,Va(t,r,a,i),Ba();var p=t.memoizedState;o!==d||f!==p||Na||e!==null&&e.dependencies!==null&&Ki(e.dependencies)?(typeof s==`function`&&(Fs(t,n,s,r),p=t.memoizedState),(u=Na||Ls(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ki(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,sc(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)):Zs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Sc(e,t,i),e}function dc(e,t,n,r){return Fi(),t.flags|=256,Zs(e,t,n,r),t.child}var fc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pc(e){return{baseLanes:e,cachePool:ma()}}function mc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Kl),e}function hc(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:(no.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(K){if(a?Za(t):eo(t),(e=Di)?(e=rf(e,ki),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Ei=t,Di=null)):e=null,e===null)throw ji(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(eo(t),a=t.mode,c=_c({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=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(null,r)):(Za(t),gc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Za(t),t.flags&=-257,t=vc(e,t,n)):t.memoizedState===null?(eo(t),c=r.fallback,a=t.mode,r=_c({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=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,t=nc(null,r)):(eo(t),t.child=e.child,t.flags|=128,t=null);else if(Za(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,Li({value:r,source:null,stack:null}),t=vc(e,t,n)}else if(Xs||Gi(e,t,n,!1),s=(n&e.childLanes)!==0,Xs||s){if(s=Fl,s!==null&&(r=Ze(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Zr(e,r),pu(s,e,r),Ys;af(c)||Tu(),t=vc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Di=cf(c.nextSibling),Ei=t,K=!0,Oi=null,ki=!1,e!==null&&Ti(t,e),t=gc(t,r.children),t.flags|=4096);return t}return a?(eo(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,nc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=pc(n):(a=c.cachePool,a===null?a=ma():(l=ea._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(e.child,r)):(Za(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 gc(e,t){return t=_c({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function _c(e,t){return e=ni(22,e,null,t),e.lanes=0,e}function vc(e,t,n){return ja(t,e.child,null,n),e=gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ui(e.return,t,n)}function bc(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 xc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=no.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,I(no,o),Zs(e,t,r,n),r=K?hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yc(e,n,t);else if(e.tag===19)yc(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&&ro(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),bc(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&&ro(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}bc(t,!0,n,null,a,r);break;case`together`:bc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Sc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Gi(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 Cc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Ki(e))):!0}function wc(e,t,n){switch(t.tag){case 3:le(t,t.stateNode.containerInfo),Vi(t,ea,e.memoizedState.cache),Fi();break;case 27:case 5:de(t);break;case 4:le(t,t.stateNode.containerInfo);break;case 10:Vi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Qa(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Za(t),e=Sc(e,t,n),e===null?null:e.sibling):hc(e,t,n):(Za(t),t.flags|=128,null);Za(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Gi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return xc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),I(no,no.current),r)break;return null;case 22:return t.lanes=0,tc(e,t,n,t.pendingProps);case 24:Vi(t,ea,e.memoizedState.cache)}return Sc(e,t,n)}function Tc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Xs=!0;else{if(!Cc(e,n)&&!(t.flags&128))return Xs=!1,wc(e,t,n);Xs=!!(e.flags&131072)}else Xs=!1,K&&t.flags&1048576&&Si(t,hi,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=zs(e,r),t.tag=1,t=uc(null,t,e,r,n)):(t.tag=0,t=cc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=Qs(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=$s(null,t,e,r,n);break a}}throw t=M(e)||e,Error(i(306,t,``))}}return t;case 0:return cc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=zs(r,t.pendingProps),uc(e,t,r,a,n);case 3:a:{if(le(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Fa(e,t),Va(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Vi(t,ea,r),r!==o.cache&&Wi(t,[ea],n,!0),Ba(),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=dc(e,t,r,n);break a}else if(r!==a){a=G(Error(i(424)),t),Li(a),t=dc(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(Di=cf(e.firstChild),Ei=t,K=!0,Oi=null,ki=!0,n=Ma(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Fi(),r===a){t=Sc(e,t,n);break a}Zs(e,t,r,n)}t=t.child}return t;case 26:return sc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:K||(n=t.type,e=t.pendingProps,r=Bd(L.current).createElement(n),r[U]=t,r[W]=e,Pd(r,n,e),pt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return de(t),e===null&&K&&(r=t.stateNode=ff(t.type,t.pendingProps,L.current),Ei=t,ki=!0,a=Di,Zd(t.type)?(lf=a,Di=cf(r.firstChild)):Di=a),Zs(e,t,t.pendingProps.children,n),sc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&K&&((a=r=Di)&&(r=tf(r,t.type,t.pendingProps,ki),r===null?a=!1:(t.stateNode=r,Ei=t,Di=cf(r.firstChild),ki=!1,a=!0)),a||ji(t)),de(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=go(e,t,yo,null,null,n),Qf._currentValue=a),sc(e,t),Zs(e,t,r,n),t.child;case 6:return e===null&&K&&((e=n=Di)&&(n=nf(n,t.pendingProps,ki),n===null?e=!1:(t.stateNode=n,Ei=t,Di=null,e=!0)),e||ji(t)),null;case 13:return hc(e,t,n);case 4:return le(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ja(t,null,r,n):Zs(e,t,r,n),t.child;case 11:return Qs(e,t,t.type,t.pendingProps,n);case 7:return Zs(e,t,t.pendingProps,n),t.child;case 8:return Zs(e,t,t.pendingProps.children,n),t.child;case 12:return Zs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Vi(t,t.type,r.value),Zs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,qi(t),a=Ji(a),r=r(a),t.flags|=1,Zs(e,t,r,n),t.child;case 14:return $s(e,t,t.type,t.pendingProps,n);case 15:return ec(e,t,t.type,t.pendingProps,n);case 19:return xc(e,t,n);case 31:return oc(e,t,n);case 22:return tc(e,t,n,t.pendingProps);case 24:return qi(t),r=Ji(ea),e===null?(a=fa(),a===null&&(a=Fl,o=ta(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Pa(t),Vi(t,ea,a)):((e.lanes&n)!==0&&(Fa(e,t),Va(t,null,null,n),Ba()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Vi(t,ea,r),r!==a.cache&&Wi(t,[ea],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Vi(t,ea,r))),Zs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ec(e){e.flags|=4}function Dc(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 Oc(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 kc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ge(),e.lanes|=t,ql|=t)}function Ac(e,t){if(!K)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 jc(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 Mc(e,t,n){var r=t.pendingProps;switch(wi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jc(t),null;case 1:return jc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Hi(ea),ue(),n.pendingContext&&=(n.context=n.pendingContext,null),(e===null||e.child===null)&&(Pi(t)?Ec(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ii())),jc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ec(t),o===null?(jc(t),Dc(t,a,null,r,n)):(jc(t),Oc(t,o))):o?o===e.memoizedState?(jc(t),t.flags&=-16777217):(Ec(t),jc(t),Oc(t,o)):(e=e.memoizedProps,e!==r&&Ec(t),jc(t),Dc(t,a,e,r,n)),null;case 27:if(fe(t),n=L.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}e=se.current,Pi(t)?Mi(t,e):(e=ff(a,r,n),t.stateNode=e,Ec(t))}return jc(t),null;case 5:if(fe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}if(o=se.current,Pi(t))Mi(t,o);else{var s=Bd(L.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[U]=t,o[W]=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&&Ec(t)}}return jc(t),Dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=L.current,Pi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ei,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[U]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||ji(t,!0)}else e=Bd(e).createTextNode(r),e[U]=t,t.stateNode=e}return jc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Pi(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[U]=t}else Fi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),e=!1}else n=Ii(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(to(t),t):(to(t),null);if(t.flags&128)throw Error(i(558))}return jc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Pi(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[U]=t}else Fi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),a=!1}else a=Ii(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(to(t),t):(to(t),null)}return to(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),kc(t,t.updateQueue),jc(t),null);case 4:return ue(),e===null&&xd(t.stateNode.containerInfo),jc(t),null;case 10:return Hi(t.type),jc(t),null;case 19:if(oe(no),r=t.memoizedState,r===null)return jc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Ac(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ro(e),o!==null){for(t.flags|=128,Ac(r,!1),e=o.updateQueue,t.updateQueue=e,kc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ai(n,e),n=n.sibling;return I(no,no.current&1|2),K&&xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&B()>$l&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304)}else{if(!a)if(e=ro(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,kc(t,e),Ac(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!K)return jc(t),null}else 2*B()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,a=!0,Ac(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?(jc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=B(),e.sibling=null,n=no.current,I(no,a?n&1|2:n&1),K&&xi(t,r.treeForkCount),e);case 22:case 23:return to(t),Ja(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(jc(t),t.subtreeFlags&6&&(t.flags|=8192)):jc(t),n=t.updateQueue,n!==null&&kc(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&&oe(da),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Hi(ea),jc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Nc(e,t){switch(wi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hi(ea),ue(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fe(t),null;case 31:if(t.memoizedState!==null){if(to(t),t.alternate===null)throw Error(i(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(to(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return oe(no),null;case 4:return ue(),null;case 10:return Hi(t.type),null;case 22:case 23:return to(t),Ja(),e!==null&&oe(da),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Hi(ea),null;case 25:return null;default:return null}}function Pc(e,t){switch(wi(t),t.tag){case 3:Hi(ea),ue();break;case 26:case 27:case 5:fe(t);break;case 4:ue();break;case 31:t.memoizedState!==null&&to(t);break;case 13:to(t);break;case 19:oe(no);break;case 10:Hi(t.type);break;case 22:case 23:to(t),Ja(),e!==null&&oe(da);break;case 24:Hi(ea)}}function Fc(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 Ic(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 Lc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ua(t,n)}catch(t){Uu(e,e.return,t)}}}function Rc(e,t,n){n.props=zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function zc(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 Bc(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 Vc(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 Hc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[W]=t}catch(t){Uu(e,e.return,t)}}function Uc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(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 Gc(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=qt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Kc(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(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(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[U]=e,t[W]=n}catch(t){Uu(e,e.return,t)}}var Jc=!1,Yc=!1,Xc=!1,Zc=typeof WeakSet==`function`?WeakSet:Set,Qc=null;function $c(e,t){if(e=e.containerInfo,Rd=sp,e=xr(e),Sr(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,Qc=t;Qc!==null;)if(t=Qc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Qc=e;else for(;Qc!==null;){switch(t=Qc,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=zs(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,Qc=e;break}Qc=t.return}}function el(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:hl(e,n),r&4&&Fc(5,n);break;case 1:if(hl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}r&64&&Lc(n),r&512&&zc(n,n.return);break;case 3:if(hl(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{Ua(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&qc(n);case 26:case 5:hl(e,n),t===null&&r&4&&Vc(n),r&512&&zc(n,n.return);break;case 12:hl(e,n);break;case 31:hl(e,n),r&4&&ol(e,n);break;case 13:hl(e,n),r&4&&sl(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||Jc,!r){t=t!==null&&t.memoizedState!==null||Yc,i=Jc;var a=Yc;Jc=r,(Yc=t)&&!a?_l(e,n,(n.subtreeFlags&8772)!=0):hl(e,n),Jc=i,Yc=a}break;case 30:break;default:hl(e,n)}}function tl(e){var t=e.alternate;t!==null&&(e.alternate=null,tl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ct(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 nl=null,rl=!1;function il(e,t,n){for(n=n.child;n!==null;)al(e,t,n),n=n.sibling}function al(e,t,n){if(Ne&&typeof Ne.onCommitFiberUnmount==`function`)try{Ne.onCommitFiberUnmount(Me,n)}catch{}switch(n.tag){case 26:Yc||Bc(n,t),il(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Yc||Bc(n,t);var r=nl,i=rl;Zd(n.type)&&(nl=n.stateNode,rl=!1),il(e,t,n),pf(n.stateNode),nl=r,rl=i;break;case 5:Yc||Bc(n,t);case 6:if(r=nl,i=rl,nl=null,il(e,t,n),nl=r,rl=i,nl!==null)if(rl)try{(nl.nodeType===9?nl.body:nl.nodeName===`HTML`?nl.ownerDocument.body:nl).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{nl.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}break;case 18:nl!==null&&(rl?(e=nl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(nl,n.stateNode));break;case 4:r=nl,i=rl,nl=n.stateNode.containerInfo,rl=!0,il(e,t,n),nl=r,rl=i;break;case 0:case 11:case 14:case 15:Ic(2,n,t),Yc||Ic(4,n,t),il(e,t,n);break;case 1:Yc||(Bc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Rc(n,t,r)),il(e,t,n);break;case 21:il(e,t,n);break;case 22:Yc=(r=Yc)||n.memoizedState!==null,il(e,t,n),Yc=r;break;default:il(e,t,n)}}function ol(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 sl(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 cl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zc),t;default:throw Error(i(435,e.tag))}}function ll(e,t){var n=cl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function ul(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)){nl=c.stateNode,rl=!1;break a}break;case 5:nl=c.stateNode,rl=!1;break a;case 3:case 4:nl=c.stateNode.containerInfo,rl=!0;break a}c=c.return}if(nl===null)throw Error(i(160));al(o,s,a),nl=null,rl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fl(t,e),t=t.sibling}var dl=null;function fl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ul(t,e),pl(e),r&4&&(Ic(3,e,e.return),Fc(3,e),Ic(5,e,e.return));break;case 1:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),r&64&&Jc&&(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=dl;if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(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[st]||o[U]||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[U]=e,pt(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[U]=e,pt(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&&Hc(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:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),n!==null&&r&4&&Hc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),e.flags&32){a=e.stateNode;try{zt(a,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Hc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Xc=!0);break;case 6:if(ul(t,e),pl(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=dl,dl=gf(t.containerInfo),ul(t,e),dl=a,pl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Uu(e,e.return,t)}Xc&&(Xc=!1,ml(e));break;case 4:r=dl,dl=gf(e.stateNode.containerInfo),ul(t,e),pl(e),dl=r;break;case 12:ul(t,e),pl(e);break;case 31:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 13:ul(t,e),pl(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,ll(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Jc,d=Yc;if(Jc=u||a,Yc=d||l,ul(t,e),Yc=d,Jc=u,pl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Jc||Yc||gl(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,ll(e,n))));break;case 19:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 30:break;case 21:break;default:ul(t,e),pl(e)}}function pl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Uc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Kc(e,Wc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(zt(o,``),n.flags&=-33),Kc(e,Wc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Gc(e,Wc(e),s);break;default:throw Error(i(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ml(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ml(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function hl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)el(e,t.alternate,t),t=t.sibling}function gl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ic(4,t,t.return),gl(t);break;case 1:Bc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Rc(t,t.return,n),gl(t);break;case 27:pf(t.stateNode);case 26:case 5:Bc(t,t.return),gl(t);break;case 22:t.memoizedState===null&&gl(t);break;case 30:gl(t);break;default:gl(t)}e=e.sibling}}function _l(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:_l(i,a,n),Fc(4,a);break;case 1:if(_l(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++)Ha(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&Lc(a),zc(a,a.return);break;case 27:qc(a);case 26:case 5:_l(i,a,n),n&&r===null&&o&4&&Vc(a),zc(a,a.return);break;case 12:_l(i,a,n);break;case 31:_l(i,a,n),n&&o&4&&ol(i,a);break;case 13:_l(i,a,n),n&&o&4&&sl(i,a);break;case 22:a.memoizedState===null&&_l(i,a,n),zc(a,a.return);break;case 30:break;default:_l(i,a,n)}t=t.sibling}}function vl(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&&na(n))}function yl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&na(e))}function bl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xl(e,t,n,r),t=t.sibling}function xl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:bl(e,t,n,r),i&2048&&Fc(9,t);break;case 1:bl(e,t,n,r);break;case 3:bl(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&&na(e)));break;case 12:if(i&2048){bl(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 bl(e,t,n,r);break;case 31:bl(e,t,n,r);break;case 13:bl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?bl(e,t,n,r):(a._visibility|=2,Sl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?bl(e,t,n,r):Cl(e,t),i&2048&&vl(o,t);break;case 24:bl(e,t,n,r),i&2048&&yl(t.alternate,t);break;default:bl(e,t,n,r)}}function Sl(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:Sl(a,o,s,c,i),Fc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Sl(a,o,s,c,i)):u._visibility&2?Sl(a,o,s,c,i):Cl(a,o),i&&l&2048&&vl(o.alternate,o);break;case 24:Sl(a,o,s,c,i),i&&l&2048&&yl(o.alternate,o);break;default:Sl(a,o,s,c,i)}t=t.sibling}}function Cl(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:Cl(n,r),i&2048&&vl(r.alternate,r);break;case 24:Cl(n,r),i&2048&&yl(r.alternate,r);break;default:Cl(n,r)}t=t.sibling}}var wl=8192;function Tl(e,t,n){if(e.subtreeFlags&wl)for(e=e.child;e!==null;)El(e,t,n),e=e.sibling}function El(e,t,n){switch(e.tag){case 26:Tl(e,t,n),e.flags&wl&&e.memoizedState!==null&&Gf(n,dl,e.memoizedState,e.memoizedProps);break;case 5:Tl(e,t,n);break;case 3:case 4:var r=dl;dl=gf(e.stateNode.containerInfo),Tl(e,t,n),dl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=wl,wl=16777216,Tl(e,t,n),wl=r):Tl(e,t,n));break;default:Tl(e,t,n)}}function Dl(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 Ol(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)kl(e),e=e.sibling}function kl(e){switch(e.tag){case 0:case 11:case 15:Ol(e),e.flags&2048&&Ic(9,e,e.return);break;case 3:Ol(e);break;case 12:Ol(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Al(e)):Ol(e);break;default:Ol(e)}}function Al(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ic(8,t,t.return),Al(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Al(t));break;default:Al(t)}e=e.sibling}}function jl(e,t){for(;Qc!==null;){var n=Qc;switch(n.tag){case 0:case 11:case 15:Ic(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:na(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Qc=r;else a:for(n=e;Qc!==null;){r=Qc;var i=r.sibling,a=r.return;if(tl(r),r===n){Qc=null;break a}if(i!==null){i.return=a,Qc=i;break a}Qc=a}}}var Ml={getCacheForType:function(e){var t=Ji(ea),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ji(ea).controller.signal}},Nl=typeof WeakMap==`function`?WeakMap:Map,Pl=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 Pl&2&&Q!==0?Q&-Q:N.T===null?$e():ud()}function fu(){if(Kl===0)if(!(Q&536870912)||K){var e=ze;ze<<=1,!(ze&3932160)&&(ze=262144),Kl=e}else Kl=536870912;return e=Ya.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)),qe(e,n),(!(Pl&2)||e!==Fl)&&(e===Fl&&(!(Pl&2)&&(Wl|=n),Hl===4&&_u(e,Q,Kl,!1)),nd(e))}function mu(e,t,n){if(Pl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ue(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),He(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:qt},El(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(!gr(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-Fe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ye(e,n,t)}function vu(){return Pl&6?!0:(rd(0,!1),!1)}function yu(){if(Z!==null){if(Il===0)var e=Z.return;else e=Z,Bi=zi=null,So(e),Ta=null,Ea=0,e=Z;for(;e!==null;)Pc(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=Ue(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-Fe(r),a=1<<i;t|=e[i],r&=~a}return Vl=t,Jr(),n}function xu(e,t){J=null,N.H=js,t===ha||t===_a?(t=Ca(),Il=3):t===ga?(t=Ca(),Il=4):Il=t===Ys?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ll=t,Z===null&&(Hl=1,Us(e,G(t,e.current)))}function Su(){var e=Ya.current;return e===null?!0:(Q&4194048)===Q?Xa===null:(Q&62914560)===Q||Q&536870912?e===Xa:!1}function Cu(){var e=N.H;return N.H=js,e===null?js:e}function wu(){var e=N.A;return N.A=Ml,e}function Tu(){Hl=4,Rl||(Q&4194048)!==Q&&Ya.current!==null||(zl=!0),!(Ul&134217727)&&!(Wl&134217727)||Fl===null||_u(Fl,Q,Kl,!1)}function Eu(e,t,n){var r=Pl;Pl|=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:Ya.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++,Bi=zi=null,Pl=r,N.H=i,N.A=a,Z===null&&(Fl=null,Q=0,Jr()),o}function Du(){for(;Z!==null;)Au(Z)}function Ou(e,t){var n=Pl;Pl|=2;var r=Cu(),a=wu();Fl!==e||Q!==t?(eu=null,$l=B()+500,bu(e,t)):zl=Ue(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 Bi=zi=null,N.H=r,N.A=a,Pl=n,Z===null?(Fl=null,Q=0,Jr(),Hl):0}function ku(){for(;Z!==null&&!Se();)Au(Z)}function Au(e){var t=Tc(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=lc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=lc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:So(t);default:Pc(n,t),t=Z=ai(t,Vl),t=Tc(n,t,Vl)}e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function Mu(e,t,n,r){Bi=zi=null,So(t),Ta=null,Ea=0;var i=t.return;try{if(Js(e,i,t,n,Q)){Hl=1,Us(e,G(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;Hl=1,Us(e,G(n,e.current)),Z=null;return}t.flags&32768?(K||r===1?e=!0:zl||Q&536870912?e=!1:(Rl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ya.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=Mc(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=Nc(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(Pl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=qr,Je(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(De,function(){return Vu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=Pl,Pl|=4;try{$c(e,t,n)}finally{Pl=s,P.p=a,N.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=N.T,N.T=null;var r=P.p;P.p=2;var i=Pl;Pl|=4;try{fl(t,e);var a=zd,o=xr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&br(s.ownerDocument.documentElement,s)){if(c!==null&&Sr(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 _=yr(s,h),v=yr(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{Pl=i,P.p=r,N.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=N.T,N.T=null;var r=P.p;P.p=2;var i=Pl;Pl|=4;try{el(e,t.alternate,t)}finally{Pl=i,P.p=r,N.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),Qe(n),t=t.stateNode,Ne&&typeof Ne.onCommitFiberRoot==`function`)try{Ne.onCommitFiberRoot(Me,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.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{N.T=t,P.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,na(t)))}function Bu(){return Iu(),Lu(),Ru(),Vu()}function Vu(){if(nu!==5)return!1;var e=ru,t=ou;ou=0;var n=Qe(au),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,Pl&6)throw Error(i(331));var c=Pl;if(Pl|=4,kl(o.current),xl(o,o.current,s,n),Pl=c,rd(0,!1),Ne&&typeof Ne.onPostCommitFiberRoot==`function`)try{Ne.onPostCommitFiberRoot(Me,o)}catch{}return!0}finally{P.p=a,N.T=r,zu(e,t)}}function Hu(e,t,n){t=G(n,t),t=Gs(e.stateNode,t,2),e=La(e,t,2),e!==null&&(qe(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=G(n,e),n=Ks(2),r=La(t,n,2),r!==null&&(qs(n,r,t,e),qe(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Nl;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?!(Pl&2)&&bu(e,0):Gl|=n,ql===Q&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=Ge()),e=Zr(e,t),e!==null&&(qe(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-Fe(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=He(r,r===Fl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ue(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-Fe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=We(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Fl,n=Q,n=He(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)||Ue(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&xe(r),Qe(n)){case 2:case 8:n=Ee;break;case 32:n=De;break;case 268435456:n=ke;break;default:n=De}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=He(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(){Pl&6?be(Te,id):ad()})}function ud(){if(td===0){var e=aa;e===0&&(e=Re,Re<<=1,!(Re&261888)&&(Re=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Kt(``+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[W]||null).action),o=r.submitter;o&&(t=(t=o[W]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new hn(`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);_s(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),_s(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(Pr,`onAnimationEnd`),Ur(Fr,`onAnimationIteration`),Ur(Ir,`onAnimationStart`),Ur(`dblclick`,`onDoubleClick`),Ur(`focusin`,`onFocus`),Ur(`focusout`,`onBlur`),Ur(Lr,`onTransitionRun`),Ur(Rr,`onTransitionStart`),Ur(zr,`onTransitionCancel`),Ur(Br,`onTransitionEnd`),_t(`onMouseEnter`,[`mouseout`,`mouseover`]),_t(`onMouseLeave`,[`mouseout`,`mouseover`]),_t(`onPointerEnter`,[`pointerout`,`pointerover`]),_t(`onPointerLeave`,[`pointerout`,`pointerover`]),gt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),gt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),gt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),gt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),gt(`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[rt];n===void 0&&(n=t[rt]=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,mt.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,!rn||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=lt(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}en(function(){var r=a,i=Yt(n),s=[];a:{var c=Vr.get(e);if(c!==void 0){var l=hn,u=e;switch(e){case`keypress`:if(un(n)===0)break a;case`keydown`:case`keyup`:l=Nn;break;case`focusin`:u=`focus`,l=wn;break;case`focusout`:u=`blur`,l=wn;break;case`beforeblur`:case`afterblur`:l=wn;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=Sn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Cn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Fn;break;case Pr:case Fr:case Ir:l=Tn;break;case Br:l=In;break;case`scroll`:case`scrollend`:l=_n;break;case`wheel`:l=Ln;break;case`copy`:case`cut`:case`paste`:l=En;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Pn;break;case`toggle`:case`beforetoggle`:l=Rn}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=tn(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!==Jt&&(u=n.relatedTarget||n.fromElement)&&(lt(u)||u[nt]))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?lt(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=Sn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Pn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:dt(l),h=u==null?c:dt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,lt(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?dt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ir;else if(Qn(c))if(ar)v=mr;else{v=fr;var y=dr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Ut(r.elementType)&&(v=ir):v=pr;if(v&&=v(e,r)){$n(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ft(c,`number`,c.value)}switch(y=r?dt(r):window,e){case`focusin`:(Qn(y)||y.contentEditable===`true`)&&(wr=y,Tr=r,Er=null);break;case`focusout`:Er=Tr=wr=null;break;case`mousedown`:Dr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Dr=!1,Or(s,n,i);break;case`selectionchange`:if(Cr)break;case`keydown`:case`keyup`:Or(s,n,i)}var b;if(Bn)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 Jn?Kn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Un&&n.locale!==`ko`&&(Jn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Jn&&(b=ln()):(on=i,sn=`value`in on?on.value:on.textContent,Jn=!0)),y=Td(r,x),0<y.length&&(x=new Dn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=qn(n),b!==null&&(x.data=b)))),(b=Hn?Yn(e,n):Xn(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new Dn(`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=tn(e,n),i!=null&&r.unshift(wd(e,i,a)),i=tn(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=tn(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=tn(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===``||zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&zt(e,``+r);break;case`className`:Ct(e,`class`,r);break;case`tabIndex`:Ct(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ct(e,n,r);break;case`style`:Ht(e,r,o);break;case`data`:if(t!==`object`){Ct(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=Kt(``+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=Kt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=qt);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=Kt(``+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),St(e,`popover`,r);break;case`xlinkActuate`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:St(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=Wt.get(n)||n,St(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Ht(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`?zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&zt(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=qt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ht.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[W]||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,``):St(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)}}Pt(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&&It(e,!!r,n,!0):It(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)}Rt(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(Ut(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)}}Nt(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?It(e,!!n,n?[]:``,!1):It(e,!!n,t,!0)):It(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)}Lt(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(Ut(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[st]||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),ct(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[st])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]);ct(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=P.d;P.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=ut(e);t!==null&&t.tag===5&&t.type===`form`?ys(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=Mt(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),pt(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="`+Mt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Mt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Mt(n.imageSizes)+`"]`)):i+=`[href="`+Mt(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),pt(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="`+Mt(r)+`"][href="`+Mt(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),pt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=ft(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`);pt(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=ft(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`),pt(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=ft(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`),pt(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=L.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=ft(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=ft(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=ft(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="`+Mt(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),pt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Mt(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~="`+Mt(n.href)+`"]`);if(r)return t.instance=r,pt(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`),pt(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,pt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),pt(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,pt(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),pt(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[st]||a[U]||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,pt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),pt(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:re,_currentValue2:re,_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=Ke(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ke(0),this.hiddenUpdates=Ke(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=ta(),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),q(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=H(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=N.T;N.T=null;var a=P.p;try{P.p=2,up(e,t,n,r)}finally{P.p=a,N.T=i}}function lp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,up(e,t,n,r)}finally{P.p=a,N.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=ut(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ve(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Fe(o);s.entanglements[1]|=c,o&=~c}nd(a),!(Pl&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=Yt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=lt(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 De:case Oe:return 32;case ke: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=ut(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=lt(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,et(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,et(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);Jt=r,n.target.dispatchEvent(r),Jt=null}else return t=ut(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=ut(n);a!==null&&(e.splice(t,3),t-=3,_s(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[W]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[W]||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[nt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=$e();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`));P.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:N,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Me=zp.inject(Rp),Ne=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Bs,s=Vs,c=Hs;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[nt]=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])}function y(e,t){try{return e.getItem(t)}catch{return null}}function b(e,t,n){try{e.setItem(t,n)}catch{}}function x(e,t){try{e.removeItem(t)}catch{}}const S=300*1e3;function C(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 w(e,t=S){if(!e)return!1;let n=Date.now()-new Date(e).getTime();return Number.isFinite(n)&&n>=0&&n<t}function T(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 E(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 D(e){return new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}function O(e){return e?`$${e.toFixed(2)}`:``}function k(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 ee(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 A(e){let t=Math.round(e/1024);return t>=1024?`${(t/1024).toFixed(1)}MB`:`${t}KB`}function te(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`:D(e)}function j(e){let t=Ae(e);if(t)return t;let n=e.replace(/\/$/,``).split(`/`);return n[n.length-1]||e}function M(e){return(e||``).replace(/\s+/g,` `).trim().slice(0,120)}function ne(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(`
15
+ `+e.stack}}var _e=Object.prototype.hasOwnProperty,ve=t.unstable_scheduleCallback,ye=t.unstable_cancelCallback,be=t.unstable_shouldYield,xe=t.unstable_requestPaint,H=t.unstable_now,Se=t.unstable_getCurrentPriorityLevel,Ce=t.unstable_ImmediatePriority,we=t.unstable_UserBlockingPriority,Te=t.unstable_NormalPriority,Ee=t.unstable_LowPriority,De=t.unstable_IdlePriority,Oe=t.log,ke=t.unstable_setDisableYieldValue,Ae=null,je=null;function Me(e){if(typeof Oe==`function`&&ke(e),je&&typeof je.setStrictMode==`function`)try{je.setStrictMode(Ae,e)}catch{}}var Ne=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,Re=262144,ze=4194304;function Be(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 U(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=Be(n))):i=Be(o):i=Be(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Be(n))):i=Be(o)):i=Be(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=ze;return ze<<=1,!(ze&62914560)&&(ze=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-Ne(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-Ne(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-Ne(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,W=`__reactProps$`+et,nt=`__reactContainer$`+et,rt=`__reactEvents$`+et,it=`__reactListeners$`+et,at=`__reactHandles$`+et,G=`__reactResources$`+et,ot=`__reactMarker$`+et;function st(e){delete e[tt],delete e[W],delete e[rt],delete e[it],delete e[at]}function ct(e){var t=e[tt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nt]||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 lt(e){if(e=e[tt]||e[nt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ut(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function dt(e){var t=e[G];return t||=e[G]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ft(e){e[ot]=!0}var pt=new Set,mt={};function ht(e,t){gt(e,t),gt(e+`Capture`,t)}function gt(e,t){for(mt[e]=t,e=0;e<t.length;e++)pt.add(t[e])}var _t=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]*$`),vt={},yt={};function bt(e){return _e.call(yt,e)?!0:_e.call(vt,e)?!1:_t.test(e)?yt[e]=!0:(vt[e]=!0,!1)}function xt(e,t,n){if(bt(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 St(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 Ct(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 wt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Tt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Et(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 Dt(e){if(!e._valueTracker){var t=Tt(e)?`checked`:`value`;e._valueTracker=Et(e,t,``+e[t])}}function Ot(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Tt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function kt(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 At=/[\n"\\]/g;function jt(e){return e.replace(At,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Mt(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=``+wt(t)):e.value!==``+wt(t)&&(e.value=``+wt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Pt(e,o,wt(n)):Pt(e,o,wt(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=``+wt(s):e.removeAttribute(`name`)}function Nt(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)){Dt(e);return}n=n==null?``:``+wt(n),t=t==null?n:``+wt(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),Dt(e)}function Pt(e,t,n){t===`number`&&kt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ft(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=``+wt(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 It(e,t,n){if(t!=null&&(t=``+wt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+wt(n)}function Lt(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=wt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Dt(e)}function Rt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zt=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 Bt(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||zt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Vt(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&&Bt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Bt(e,o,t[o])}function Ht(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 Ut=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`]]),Wt=/^[\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 Gt(e){return Wt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Kt(){}var qt=null;function Jt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yt=null,Xt=null;function Zt(e){var t=lt(e);if(t&&(e=t.stateNode)){var n=e[W]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Mt(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="`+jt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[W]||null;if(!a)throw Error(i(90));Mt(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&&Ot(r)}break a;case`textarea`:It(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ft(e,!!n.multiple,t,!1)}}}var Qt=!1;function $t(e,t,n){if(Qt)return e(t,n);Qt=!0;try{return e(t)}finally{if(Qt=!1,(Yt!==null||Xt!==null)&&(vu(),Yt&&(t=Yt,e=Xt,Xt=Yt=null,Zt(t),e)))for(t=0;t<e.length;t++)Zt(e[t])}}function en(e,t){var n=e.stateNode;if(n===null)return null;var r=n[W]||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 tn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),nn=!1;if(tn)try{var rn={};Object.defineProperty(rn,`passive`,{get:function(){nn=!0}}),window.addEventListener(`test`,rn,rn),window.removeEventListener(`test`,rn,rn)}catch{nn=!1}var an=null,on=null,sn=null;function cn(){if(sn)return sn;var e,t=on,n=t.length,r,i=`value`in an?an.value:an.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 sn=i.slice(e,1<r?1-r:void 0)}function ln(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 un(){return!0}function dn(){return!1}function fn(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)?un:dn,this.isPropagationStopped=dn,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=un)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=un)},persist:function(){},isPersistent:un}),t}var pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mn=fn(pn),hn=h({},pn,{view:0,detail:0}),gn=fn(hn),_n,vn,yn,bn=h({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jn,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!==yn&&(yn&&e.type===`mousemove`?(_n=e.screenX-yn.screenX,vn=e.screenY-yn.screenY):vn=_n=0,yn=e),_n)},movementY:function(e){return`movementY`in e?e.movementY:vn}}),xn=fn(bn),Sn=fn(h({},bn,{dataTransfer:0})),Cn=fn(h({},hn,{relatedTarget:0})),wn=fn(h({},pn,{animationName:0,elapsedTime:0,pseudoElement:0})),Tn=fn(h({},pn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),En=fn(h({},pn,{data:0})),Dn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},On={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`},kn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function An(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=kn[e])?!!t[e]:!1}function jn(){return An}var Mn=fn(h({},hn,{key:function(e){if(e.key){var t=Dn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?On[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jn,charCode:function(e){return e.type===`keypress`?ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Nn=fn(h({},bn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Pn=fn(h({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jn})),Fn=fn(h({},pn,{propertyName:0,elapsedTime:0,pseudoElement:0})),In=fn(h({},bn,{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})),Ln=fn(h({},pn,{newState:0,oldState:0})),Rn=[9,13,27,32],zn=tn&&`CompositionEvent`in window,Bn=null;tn&&`documentMode`in document&&(Bn=document.documentMode);var Vn=tn&&`TextEvent`in window&&!Bn,Hn=tn&&(!zn||Bn&&8<Bn&&11>=Bn),Un=` `,Wn=!1;function Gn(e,t){switch(e){case`keyup`:return Rn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Kn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var qn=!1;function Jn(e,t){switch(e){case`compositionend`:return Kn(t);case`keypress`:return t.which===32?(Wn=!0,Un):null;case`textInput`:return e=t.data,e===Un&&Wn?null:e;default:return null}}function Yn(e,t){if(qn)return e===`compositionend`||!zn&&Gn(e,t)?(e=cn(),sn=on=an=null,qn=!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 Hn&&t.locale!==`ko`?null:t.data;default:return null}}var Xn={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 Zn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Xn[e.type]:t===`textarea`}function Qn(e,t,n,r){Yt?Xt?Xt.push(r):Xt=[r]:Yt=r,t=Td(t,`onChange`),0<t.length&&(n=new mn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var $n=null,er=null;function tr(e){vd(e,0)}function nr(e){if(Ot(ut(e)))return e}function rr(e,t){if(e===`change`)return t}var ir=!1;if(tn){var ar;if(tn){var or=`oninput`in document;if(!or){var sr=document.createElement(`div`);sr.setAttribute(`oninput`,`return;`),or=typeof sr.oninput==`function`}ar=or}else ar=!1;ir=ar&&(!document.documentMode||9<document.documentMode)}function cr(){$n&&($n.detachEvent(`onpropertychange`,lr),er=$n=null)}function lr(e){if(e.propertyName===`value`&&nr(er)){var t=[];Qn(t,er,e,Jt(e)),$t(tr,t)}}function ur(e,t,n){e===`focusin`?(cr(),$n=t,er=n,$n.attachEvent(`onpropertychange`,lr)):e===`focusout`&&cr()}function dr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return nr(er)}function fr(e,t){if(e===`click`)return nr(t)}function pr(e,t){if(e===`input`||e===`change`)return nr(t)}function mr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var hr=typeof Object.is==`function`?Object.is:mr;function gr(e,t){if(hr(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(!_e.call(t,i)||!hr(e[i],t[i]))return!1}return!0}function _r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vr(e,t){var n=_r(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=_r(n)}}function yr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function br(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=kt(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=kt(e.document)}return t}function xr(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 Sr=tn&&`documentMode`in document&&11>=document.documentMode,Cr=null,wr=null,Tr=null,Er=!1;function Dr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Er||Cr==null||Cr!==kt(r)||(r=Cr,`selectionStart`in r&&xr(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}),Tr&&gr(Tr,r)||(Tr=r,r=Td(wr,`onSelect`),0<r.length&&(t=new mn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Cr)))}function Or(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var kr={animationend:Or(`Animation`,`AnimationEnd`),animationiteration:Or(`Animation`,`AnimationIteration`),animationstart:Or(`Animation`,`AnimationStart`),transitionrun:Or(`Transition`,`TransitionRun`),transitionstart:Or(`Transition`,`TransitionStart`),transitioncancel:Or(`Transition`,`TransitionCancel`),transitionend:Or(`Transition`,`TransitionEnd`)},Ar={},jr={};tn&&(jr=document.createElement(`div`).style,`AnimationEvent`in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),`TransitionEvent`in window||delete kr.transitionend.transition);function Mr(e){if(Ar[e])return Ar[e];if(!kr[e])return e;var t=kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in jr)return Ar[e]=t[n];return e}var Nr=Mr(`animationend`),Pr=Mr(`animationiteration`),Fr=Mr(`animationstart`),Ir=Mr(`transitionrun`),Lr=Mr(`transitionstart`),Rr=Mr(`transitioncancel`),zr=Mr(`transitionend`),Br=new Map,Vr=`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(` `);Vr.push(`scrollEnd`);function Hr(e,t){Br.set(e,t),ht(t,[e])}var Ur=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)},Wr=[],Gr=0,Kr=0;function qr(){for(var e=Gr,t=Kr=Gr=0;t<e;){var n=Wr[t];Wr[t++]=null;var r=Wr[t];Wr[t++]=null;var i=Wr[t];Wr[t++]=null;var a=Wr[t];if(Wr[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&&Zr(n,i,a)}}function Jr(e,t,n,r){Wr[Gr++]=e,Wr[Gr++]=t,Wr[Gr++]=n,Wr[Gr++]=r,Kr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Yr(e,t,n,r){return Jr(e,t,n,r),Qr(e)}function Xr(e,t){return Jr(e,null,null,t),Qr(e)}function Zr(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-Ne(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Qr(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 $r={};function ei(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 ti(e,t,n,r){return new ei(e,t,n,r)}function ni(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ri(e,t){var n=e.alternate;return n===null?(n=ti(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 ii(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 ai(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ni(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,re.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ti(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return oi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ti(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ti(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ti(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=ti(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function oi(e,t,n,r){return e=ti(7,e,r,t),e.lanes=n,e}function si(e,t,n){return e=ti(6,e,null,t),e.lanes=n,e}function ci(e){var t=ti(18,null,null,0);return t.stateNode=e,t}function li(e,t,n){return t=ti(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ui=new WeakMap;function di(e,t){if(typeof e==`object`&&e){var n=ui.get(e);return n===void 0?(t={value:e,source:t,stack:ge(t)},ui.set(e,t),t):n}return{value:e,source:t,stack:ge(t)}}var fi=[],pi=0,mi=null,hi=0,gi=[],_i=0,vi=null,yi=1,bi=``;function xi(e,t){fi[pi++]=hi,fi[pi++]=mi,mi=e,hi=t}function Si(e,t,n){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,vi=e;var r=yi;e=bi;var i=32-Ne(r)-1;r&=~(1<<i),n+=1;var a=32-Ne(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,yi=1<<32-Ne(t)+i|n<<i|r,bi=a+e}else yi=1<<a|n<<i|r,bi=e}function Ci(e){e.return!==null&&(xi(e,1),Si(e,1,0))}function wi(e){for(;e===mi;)mi=fi[--pi],fi[pi]=null,hi=fi[--pi],fi[pi]=null;for(;e===vi;)vi=gi[--_i],gi[_i]=null,bi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null}function Ti(e,t){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,yi=t.id,bi=t.overflow,vi=e}var Ei=null,Di=null,K=!1,Oi=null,ki=!1,Ai=Error(i(519));function ji(e){throw Ii(di(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ai}function Mi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[tt]=e,t[W]=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),Nt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Lt(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=Kt),t=!0):t=!1,t||ji(e,!0)}function q(e){for(Ei=e.return;Ei;)switch(Ei.tag){case 5:case 31:case 13:ki=!1;return;case 27:case 3:ki=!0;return;default:Ei=Ei.return}}function Ni(e){if(e!==Ei)return!1;if(!K)return q(e),K=!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&&Di&&ji(e),q(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Di=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Di=uf(e)}else t===27?(t=Di,Zd(e.type)?(e=lf,lf=null,Di=e):Di=t):Di=Ei?cf(e.stateNode.nextSibling):null;return!0}function Pi(){Di=Ei=null,K=!1}function Fi(){var e=Oi;return e!==null&&(Yl===null?Yl=e:Yl.push.apply(Yl,e),Oi=null),e}function Ii(e){Oi===null?Oi=[e]:Oi.push(e)}var Li=R(null),Ri=null,zi=null;function Bi(e,t,n){B(Li,t._currentValue),t._currentValue=n}function Vi(e){e._currentValue=Li.current,z(Li)}function Hi(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 Ui(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),Hi(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),Hi(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 Wi(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;hr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===oe.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&&Ui(t,e,n,r),t.flags|=262144}function Gi(e){for(e=e.firstContext;e!==null;){if(!hr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ki(e){Ri=e,zi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function qi(e){return Yi(Ri,e)}function Ji(e,t){return Ri===null&&Ki(e),Yi(e,t)}function Yi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},zi===null){if(e===null)throw Error(i(308));zi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else zi=zi.next=t;return n}var Xi=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()})}},Zi=t.unstable_scheduleCallback,Qi=t.unstable_NormalPriority,$i={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ea(){return{controller:new Xi,data:new Map,refCount:0}}function ta(e){e.refCount--,e.refCount===0&&Zi(Qi,function(){e.controller.abort()})}var na=null,ra=0,ia=0,aa=null;function oa(e,t){if(na===null){var n=na=[];ra=0,ia=ud(),aa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ra++,t.then(sa,sa),t}function sa(){if(--ra===0&&na!==null){aa!==null&&(aa.status=`fulfilled`);var e=na;na=null,ia=0,aa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ca(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 la=F.S;F.S=function(e,t){Ql=H(),typeof t==`object`&&t&&typeof t.then==`function`&&oa(e,t),la!==null&&la(e,t)};var ua=R(null);function da(){var e=ua.current;return e===null?Fl.pooledCache:e}function fa(e,t){t===null?B(ua,ua.current):B(ua,t.pool)}function pa(){var e=da();return e===null?null:{parent:$i._currentValue,pool:e}}var ma=Error(i(460)),ha=Error(i(474)),ga=Error(i(542)),_a={then:function(){}};function va(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ya(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Kt,Kt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ca(e),e;default:if(typeof t.status==`string`)t.then(Kt,Kt);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,Ca(e),e}throw xa=t,ma}}function ba(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(xa=e,ma):e}}var xa=null;function Sa(){if(xa===null)throw Error(i(459));var e=xa;return xa=null,e}function Ca(e){if(e===ma||e===ga)throw Error(i(483))}var wa=null,Ta=0;function Ea(e){var t=Ta;return Ta+=1,wa===null&&(wa=[]),ya(wa,e,t)}function Da(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Oa(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 ka(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=ri(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=si(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&&ba(i)===t.type)?(t=a(t,n.props),Da(t,n),t.return=e,t):(t=ai(n.type,n.key,n.props,null,e.mode,r),Da(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=li(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=oi(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=si(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ai(t.type,t.key,t.props,null,e.mode,n),Da(n,t),n.return=e,n;case v:return t=li(t,e.mode,n),t.return=e,t;case O:return t=ba(t),f(e,t,n)}if(P(t)||M(t))return t=oi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ea(t),n);if(t.$$typeof===C)return f(e,Ji(e,t),n);Oa(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=ba(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,Ea(n),r);if(n.$$typeof===C)return p(e,t,Ji(e,n),r);Oa(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=ba(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,Ea(r),i);if(r.$$typeof===C)return m(e,t,n,Ji(t,r),i);Oa(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),K&&xi(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 K&&xi(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)}),K&&xi(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),K&&xi(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 K&&xi(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)}),K&&xi(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&&ba(l)===r.type){n(e,r.sibling),c=a(r,o.props),Da(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=oi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ai(o.type,o.key,o.props,null,e.mode,c),Da(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=li(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=ba(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,Ea(o),c);if(o.$$typeof===C)return b(e,r,Ji(e,o),c);Oa(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=si(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ta=0;var i=b(e,t,n,r);return wa=null,i}catch(t){if(t===ma||t===ga)throw t;var a=ti(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Aa=ka(!0),ja=ka(!1),Ma=!1;function Na(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pa(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 Fa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ia(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Pl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Qr(e),Zr(e,null,n),t}return Jr(e,r,t,n),Qr(e)}function La(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 Ra(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 za=!1;function Ba(){if(za){var e=aa;if(e!==null)throw e}}function Va(e,t,n,r){za=!1;var i=e.updateQueue;Ma=!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===ia&&(za=!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:Ma=!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 Ha(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ua(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ha(n[e],t)}var Wa=R(null),Ga=R(0);function Ka(e,t){e=Vl,B(Ga,e),B(Wa,t),Vl=e|t.baseLanes}function qa(){B(Ga,Vl),B(Wa,Wa.current)}function Ja(){Vl=Ga.current,z(Wa),z(Ga)}var Ya=R(null),Xa=null;function Za(e){var t=e.alternate;B(no,no.current&1),B(Ya,e),Xa===null&&(t===null||Wa.current!==null||t.memoizedState!==null)&&(Xa=e)}function Qa(e){B(no,no.current),B(Ya,e),Xa===null&&(Xa=e)}function $a(e){e.tag===22?(B(no,no.current),B(Ya,e),Xa===null&&(Xa=e)):eo(e)}function eo(){B(no,no.current),B(Ya,Ya.current)}function to(e){z(Ya),Xa===e&&(Xa=null),z(no)}var no=R(0);function ro(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 io=0,J=null,Y=null,ao=null,oo=!1,so=!1,co=!1,lo=0,uo=0,fo=null,po=0;function mo(){throw Error(i(321))}function ho(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!hr(e[n],t[n]))return!1;return!0}function go(e,t,n,r,i,a){return io=a,J=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?Ms:Ns,co=!1,a=n(r,i),co=!1,so&&(a=vo(t,n,r,i)),_o(e),a}function _o(e){F.H=js;var t=Y!==null&&Y.next!==null;if(io=0,ao=Y=J=null,oo=!1,uo=0,fo=null,t)throw Error(i(300));e===null||Xs||(e=e.dependencies,e!==null&&Gi(e)&&(Xs=!0))}function vo(e,t,n,r){J=e;var a=0;do{if(so&&(fo=null),uo=0,so=!1,25<=a)throw Error(i(301));if(a+=1,ao=Y=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=Ps,o=t(n,r)}while(so);return o}function yo(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?Eo(t):t,e=e.useState()[0],(Y===null?null:Y.memoizedState)!==e&&(J.flags|=1024),t}function bo(){var e=lo!==0;return lo=0,e}function xo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function So(e){if(oo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}oo=!1}io=0,ao=Y=J=null,so=!1,uo=lo=0,fo=null}function Co(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ao===null?J.memoizedState=ao=e:ao=ao.next=e,ao}function wo(){if(Y===null){var e=J.alternate;e=e===null?null:e.memoizedState}else e=Y.next;var t=ao===null?J.memoizedState:ao.next;if(t!==null)ao=t,Y=e;else{if(e===null)throw J.alternate===null?Error(i(467)):Error(i(310));Y=e,e={memoizedState:Y.memoizedState,baseState:Y.baseState,baseQueue:Y.baseQueue,queue:Y.queue,next:null},ao===null?J.memoizedState=ao=e:ao=ao.next=e}return ao}function To(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Eo(e){var t=uo;return uo+=1,fo===null&&(fo=[]),e=ya(fo,e,t),t=J,(ao===null?t.memoizedState:ao.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?Ms:Ns),e}function Do(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Eo(e);if(e.$$typeof===C)return qi(e)}throw Error(i(438,String(e)))}function Oo(e){var t=null,n=J.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=J.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(),J.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(),Y,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?(io&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===ia&&(d=!0);else if((io&p)===p){u=u.next,p===ia&&(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,J.lanes|=p,Ul|=p;f=u.action,co&&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,J.lanes|=f,Ul|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!hr(o,e.memoizedState)&&(Xs=!0,d&&(n=aa,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);hr(o,t.memoizedState)||(Xs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function No(e,t,n){var r=J,a=wo(),o=K;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!hr((Y||a).memoizedState,n);if(s&&(a.memoizedState=n,Xs=!0),a=a.queue,is(Io.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||ao!==null&&ao.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||io&127||Po(r,t,n)}return n}function Po(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=J.updateQueue,t===null?(t=To(),J.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!hr(e,n)}catch{return!0}}function Ro(e){var t=Xr(e,2);t!==null&&pu(t,e,2)}function zo(e){var t=Co();if(typeof e==`function`){var n=e;if(e=n(),co){Me(!0);try{n()}finally{Me(!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,Y,typeof r==`function`?r:ko)}function Vo(e,t,n,r,a){if(Os(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(K){var n=Fl.formState;if(n!==null){a:{var r=J;if(K){if(Di){b:{for(var i=Di,a=ki;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){Di=cf(i.nextSibling),r=i.data===`F!`;break a}}ji(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,J,r),r.dispatch=n,r=zo(!1),a=Ds.bind(null,J,!1,r.queue),r=Co(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Vo.bind(null,J,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Yo(e){return Xo(wo(),Y,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===ma?ga:e}else r=t;t=wo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(J.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=Y;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=J.updateQueue,t===null&&(t=To(),J.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();J.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;Y!==null&&r!==null&&ho(r,Y.memoizedState.deps)?i.memoizedState=$o(t,a,n,r):(J.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){J.flags|=4;var t=J.updateQueue;if(t===null)t=To(),J.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(Pl&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&&ho(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&&ho(t,r[1]))return r[0];if(r=e(),co){Me(!0);try{e()}finally{Me(!1)}}return n.memoizedState=[r,t],r}function ms(e,t,n){return n===void 0||io&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),J.lanes|=e,Ul|=e,n)}function hs(e,t,n,r){return hr(n,t)?n:Wa.current===null?!(io&42)||io&1073741824&&!(Q&261930)?(Xs=!0,e.memoizedState=n):(e=fu(),J.lanes|=e,Ul|=e,t):(e=ms(e,n,r),hr(e,t)||(Xs=!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,Ds(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?X(e,t,ca(c,r),du(e)):X(e,t,r,du(e))}catch(n){X(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,L,n===null?_s:function(){return bs(e),n(r)})}function ys(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:L},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),X(e,t.next.queue,{},du())}function xs(){return qi(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=Fa(n);var r=Ia(t,e,n);r!==null&&(pu(r,t,n),La(r,t,n)),t={cache:ea()},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},Os(e)?ks(t,n):(n=Yr(e,t,n,r),n!==null&&(pu(n,e,r),As(n,t,r)))}function Es(e,t,n){X(e,t,n,du())}function X(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Os(e))ks(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,hr(s,o))return Jr(e,t,i,0),Fl===null&&qr(),!1}catch{}if(n=Yr(e,t,i,r),n!==null)return pu(n,e,r),As(n,t,r),!0}return!1}function Ds(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Os(e)){if(t)throw Error(i(479))}else t=Yr(e,n,r,2),t!==null&&pu(t,e,2)}function Os(e){var t=e.alternate;return e===J||t!==null&&t===J}function ks(e,t){so=oo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function As(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Je(e,n)}}var js={readContext:qi,use:Do,useCallback:mo,useContext:mo,useEffect:mo,useImperativeHandle:mo,useLayoutEffect:mo,useInsertionEffect:mo,useMemo:mo,useReducer:mo,useRef:mo,useState:mo,useDebugValue:mo,useDeferredValue:mo,useTransition:mo,useSyncExternalStore:mo,useId:mo,useHostTransitionStatus:mo,useFormState:mo,useActionState:mo,useOptimistic:mo,useMemoCache:mo,useCacheRefresh:mo};js.useEffectEvent=mo;var Ms={readContext:qi,use:Do,useCallback:function(e,t){return Co().memoizedState=[e,t===void 0?null:t],e},useContext:qi,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(co){Me(!0);try{e()}finally{Me(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Co();if(n!==void 0){var i=n(t);if(co){Me(!0);try{n(t)}finally{Me(!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,J,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,J,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,J,e.queue,!0,!1),Co().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=J,a=Co();if(K){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(K){var n=bi,r=yi;n=(r&~(1<<32-Ne(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=lo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=po++,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=Ds.bind(null,J,!0,n),n.dispatch=t,[e,t]},useMemoCache:Oo,useCacheRefresh:function(){return Co().memoizedState=ws.bind(null,J)},useEffectEvent:function(e){var t=Co(),n={impl:e};return t.memoizedState=n,function(){if(Pl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ns={readContext:qi,use:Do,useCallback:fs,useContext:qi,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(),Y.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(),Y,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};Ns.useEffectEvent=os;var Ps={readContext:qi,use:Do,useCallback:fs,useContext:qi,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 Y===null?ms(n,e,t):hs(n,Y.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 Y===null?(n.baseState=e,[e,n.queue.dispatch]):Bo(n,Y,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};Ps.useEffectEvent=os;function Fs(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 Is={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),i=Fa(r);i.payload=t,n!=null&&(i.callback=n),t=Ia(e,i,r),t!==null&&(pu(t,e,r),La(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),i=Fa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ia(e,i,r),t!==null&&(pu(t,e,r),La(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=Fa(n);r.tag=2,t!=null&&(r.callback=t),t=Ia(e,r,n),t!==null&&(pu(t,e,n),La(t,e,n))}};function Ls(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?!gr(n,r)||!gr(i,a):!0}function Rs(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&&Is.enqueueReplaceState(t,t.state,null)}function zs(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 Bs(e){Ur(e)}function Vs(e){console.error(e)}function Hs(e){Ur(e)}function Us(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ws(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 Gs(e,t,n){return n=Fa(n),n.tag=3,n.payload={element:null},n.callback=function(){Us(e,t)},n}function Ks(e){return e=Fa(e),e.tag=3,e}function qs(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(){Ws(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ws(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 Js(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Wi(t,n,a,!0),n=Ya.current,n!==null){switch(n.tag){case 31:case 13:return Xa===null?Tu():n.alternate===null&&Hl===0&&(Hl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===_a?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===_a?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(K)return t=Ya.current,t===null?(r!==Ai&&(t=Error(i(423),{cause:r}),Ii(di(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=di(r,n),a=Gs(e.stateNode,r,a),Ra(e,a),Hl!==4&&(Hl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ai&&(e=Error(i(422),{cause:r}),Ii(di(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=di(o,n),Jl===null?Jl=[o]:Jl.push(o),Hl!==4&&(Hl=2),t===null)return!0;r=di(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Gs(n.stateNode,r,e),Ra(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=Ks(a),qs(a,e,n,r),Ra(n,a),!1}n=n.return}while(n!==null);return!1}var Ys=Error(i(461)),Xs=!1;function Zs(e,t,n,r){t.child=e===null?ja(t,null,n,r):Aa(t,e.child,n,r)}function Qs(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 Ki(t),r=go(e,t,n,o,a,i),s=bo(),e!==null&&!Xs?(xo(e,t,i),Sc(e,t,i)):(K&&s&&Ci(t),t.flags|=1,Zs(e,t,r,i),t.child)}function $s(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ni(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ec(e,t,a,r,i)):(e=ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Cc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?gr:n,n(o,r)&&e.ref===t.ref)return Sc(e,t,i)}return t.flags|=1,e=ri(a,r),e.ref=t.ref,e.return=t,t.child=e}function ec(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(gr(a,r)&&e.ref===t.ref)if(Xs=!1,t.pendingProps=r=a,Cc(e,i))e.flags&131072&&(Xs=!0);else return t.lanes=e.lanes,Sc(e,t,i)}return cc(e,t,n,r,i)}function tc(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 rc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&fa(t,a===null?null:a.cachePool),a===null?qa():Ka(t,a),$a(t);else return r=t.lanes=536870912,rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&fa(t,null),qa(),eo(t)):(fa(t,a.cachePool),Ka(t,a),eo(t),t.memoizedState=null);return Zs(e,t,i,n),t.child}function nc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rc(e,t,n,r,i){var a=da();return a=a===null?null:{parent:$i._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&fa(t,null),qa(),$a(t),e!==null&&Wi(e,t,r,!0),t.childLanes=i,null}function ic(e,t){return t=_c({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ac(e,t,n){return Aa(t,e.child,null,n),e=ic(t,t.pendingProps),e.flags|=2,to(t),t.memoizedState=null,e}function oc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(K){if(r.mode===`hidden`)return e=ic(t,r),t.lanes=536870912,nc(null,e);if(Qa(t),(e=Di)?(e=rf(e,ki),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ei=t,Di=null)):e=null,e===null)throw ji(t);return t.lanes=536870912,null}return ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Qa(t),a)if(t.flags&256)t.flags&=-257,t=ac(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Xs||Wi(e,t,n,!1),a=(n&e.childLanes)!==0,Xs||a){if(r=Fl,r!==null&&(s=Ye(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Xr(e,s),pu(r,e,s),Ys;Tu(),t=ac(e,t,n)}else e=o.treeContext,Di=cf(s.nextSibling),Ei=t,K=!0,Oi=null,ki=!1,e!==null&&Ti(t,e),t=ic(t,r),t.flags|=4096;return t}return e=ri(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function sc(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 cc(e,t,n,r,i){return Ki(t),n=go(e,t,n,r,void 0,i),r=bo(),e!==null&&!Xs?(xo(e,t,i),Sc(e,t,i)):(K&&r&&Ci(t),t.flags|=1,Zs(e,t,n,i),t.child)}function lc(e,t,n,r,i,a){return Ki(t),t.updateQueue=null,n=vo(t,r,n,i),_o(e),r=bo(),e!==null&&!Xs?(xo(e,t,a),Sc(e,t,a)):(K&&r&&Ci(t),t.flags|=1,Zs(e,t,n,a),t.child)}function uc(e,t,n,r,i){if(Ki(t),t.stateNode===null){var a=$r,o=n.contextType;typeof o==`object`&&o&&(a=qi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Is,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Na(t),o=n.contextType,a.context=typeof o==`object`&&o?qi(o):$r,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Fs(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&&Is.enqueueReplaceState(a,a.state,null),Va(t,r,a,i),Ba(),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=zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=$r,typeof u==`object`&&u&&(o=qi(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)&&Rs(t,a,r,o),Ma=!1;var f=t.memoizedState;a.state=f,Va(t,r,a,i),Ba(),l=t.memoizedState,s||f!==l||Ma?(typeof d==`function`&&(Fs(t,n,d,r),l=t.memoizedState),(c=Ma||Ls(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,Pa(e,t),o=t.memoizedProps,u=zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=$r,typeof l==`object`&&l&&(c=qi(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)&&Rs(t,a,r,c),Ma=!1,f=t.memoizedState,a.state=f,Va(t,r,a,i),Ba();var p=t.memoizedState;o!==d||f!==p||Ma||e!==null&&e.dependencies!==null&&Gi(e.dependencies)?(typeof s==`function`&&(Fs(t,n,s,r),p=t.memoizedState),(u=Ma||Ls(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Gi(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,sc(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=Aa(t,e.child,null,i),t.child=Aa(t,null,n,i)):Zs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Sc(e,t,i),e}function dc(e,t,n,r){return Pi(),t.flags|=256,Zs(e,t,n,r),t.child}var fc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pc(e){return{baseLanes:e,cachePool:pa()}}function mc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Kl),e}function hc(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:(no.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(K){if(a?Za(t):eo(t),(e=Di)?(e=rf(e,ki),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ei=t,Di=null)):e=null,e===null)throw ji(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(eo(t),a=t.mode,c=_c({mode:`hidden`,children:c},a),r=oi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(null,r)):(Za(t),gc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Za(t),t.flags&=-257,t=vc(e,t,n)):t.memoizedState===null?(eo(t),c=r.fallback,a=t.mode,r=_c({mode:`visible`,children:r.children},a),c=oi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Aa(t,e.child,null,n),r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,t=nc(null,r)):(eo(t),t.child=e.child,t.flags|=128,t=null);else if(Za(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,Ii({value:r,source:null,stack:null}),t=vc(e,t,n)}else if(Xs||Wi(e,t,n,!1),s=(n&e.childLanes)!==0,Xs||s){if(s=Fl,s!==null&&(r=Ye(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Xr(e,r),pu(s,e,r),Ys;af(c)||Tu(),t=vc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Di=cf(c.nextSibling),Ei=t,K=!0,Oi=null,ki=!1,e!==null&&Ti(t,e),t=gc(t,r.children),t.flags|=4096);return t}return a?(eo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ri(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=oi(c,a,n,null),c.flags|=2):c=ri(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,nc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=pc(n):(a=c.cachePool,a===null?a=pa():(l=$i._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(e.child,r)):(Za(t),n=e.child,e=n.sibling,n=ri(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 gc(e,t){return t=_c({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function _c(e,t){return e=ti(22,e,null,t),e.lanes=0,e}function vc(e,t,n){return Aa(t,e.child,null,n),e=gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Hi(e.return,t,n)}function bc(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 xc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=no.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,B(no,o),Zs(e,t,r,n),r=K?hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yc(e,n,t);else if(e.tag===19)yc(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&&ro(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),bc(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&&ro(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}bc(t,!0,n,null,a,r);break;case`together`:bc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Sc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Wi(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=ri(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ri(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Gi(e))):!0}function wc(e,t,n){switch(t.tag){case 3:se(t,t.stateNode.containerInfo),Bi(t,$i,e.memoizedState.cache),Pi();break;case 27:case 5:ce(t);break;case 4:se(t,t.stateNode.containerInfo);break;case 10:Bi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Qa(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Za(t),e=Sc(e,t,n),e===null?null:e.sibling):hc(e,t,n):(Za(t),t.flags|=128,null);Za(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Wi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return xc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),B(no,no.current),r)break;return null;case 22:return t.lanes=0,tc(e,t,n,t.pendingProps);case 24:Bi(t,$i,e.memoizedState.cache)}return Sc(e,t,n)}function Tc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Xs=!0;else{if(!Cc(e,n)&&!(t.flags&128))return Xs=!1,wc(e,t,n);Xs=!!(e.flags&131072)}else Xs=!1,K&&t.flags&1048576&&Si(t,hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ba(t.elementType),t.type=e,typeof e==`function`)ni(e)?(r=zs(e,r),t.tag=1,t=uc(null,t,e,r,n)):(t.tag=0,t=cc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=Qs(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=$s(null,t,e,r,n);break a}}throw t=ee(e)||e,Error(i(306,t,``))}}return t;case 0:return cc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=zs(r,t.pendingProps),uc(e,t,r,a,n);case 3:a:{if(se(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Pa(e,t),Va(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Bi(t,$i,r),r!==o.cache&&Ui(t,[$i],n,!0),Ba(),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=dc(e,t,r,n);break a}else if(r!==a){a=di(Error(i(424)),t),Ii(a),t=dc(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(Di=cf(e.firstChild),Ei=t,K=!0,Oi=null,ki=!0,n=ja(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Pi(),r===a){t=Sc(e,t,n);break a}Zs(e,t,r,n)}t=t.child}return t;case 26:return sc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:K||(n=t.type,e=t.pendingProps,r=Bd(ae.current).createElement(n),r[tt]=t,r[W]=e,Pd(r,n,e),ft(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ce(t),e===null&&K&&(r=t.stateNode=ff(t.type,t.pendingProps,ae.current),Ei=t,ki=!0,a=Di,Zd(t.type)?(lf=a,Di=cf(r.firstChild)):Di=a),Zs(e,t,t.pendingProps.children,n),sc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&K&&((a=r=Di)&&(r=tf(r,t.type,t.pendingProps,ki),r===null?a=!1:(t.stateNode=r,Ei=t,Di=cf(r.firstChild),ki=!1,a=!0)),a||ji(t)),ce(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=go(e,t,yo,null,null,n),Qf._currentValue=a),sc(e,t),Zs(e,t,r,n),t.child;case 6:return e===null&&K&&((e=n=Di)&&(n=nf(n,t.pendingProps,ki),n===null?e=!1:(t.stateNode=n,Ei=t,Di=null,e=!0)),e||ji(t)),null;case 13:return hc(e,t,n);case 4:return se(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Aa(t,null,r,n):Zs(e,t,r,n),t.child;case 11:return Qs(e,t,t.type,t.pendingProps,n);case 7:return Zs(e,t,t.pendingProps,n),t.child;case 8:return Zs(e,t,t.pendingProps.children,n),t.child;case 12:return Zs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Bi(t,t.type,r.value),Zs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ki(t),a=qi(a),r=r(a),t.flags|=1,Zs(e,t,r,n),t.child;case 14:return $s(e,t,t.type,t.pendingProps,n);case 15:return ec(e,t,t.type,t.pendingProps,n);case 19:return xc(e,t,n);case 31:return oc(e,t,n);case 22:return tc(e,t,n,t.pendingProps);case 24:return Ki(t),r=qi($i),e===null?(a=da(),a===null&&(a=Fl,o=ea(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Na(t),Bi(t,$i,a)):((e.lanes&n)!==0&&(Pa(e,t),Va(t,null,null,n),Ba()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Bi(t,$i,r),r!==a.cache&&Ui(t,[$i],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Bi(t,$i,r))),Zs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ec(e){e.flags|=4}function Dc(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 xa=_a,ha}else e.flags&=-16777217}function Oc(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 xa=_a,ha}function kc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ue(),e.lanes|=t,ql|=t)}function Ac(e,t){if(!K)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 jc(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 Mc(e,t,n){var r=t.pendingProps;switch(wi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jc(t),null;case 1:return jc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Vi($i),V(),n.pendingContext&&=(n.context=n.pendingContext,null),(e===null||e.child===null)&&(Ni(t)?Ec(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Fi())),jc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ec(t),o===null?(jc(t),Dc(t,a,null,r,n)):(jc(t),Oc(t,o))):o?o===e.memoizedState?(jc(t),t.flags&=-16777217):(Ec(t),jc(t),Oc(t,o)):(e=e.memoizedProps,e!==r&&Ec(t),jc(t),Dc(t,a,e,r,n)),null;case 27:if(le(t),n=ae.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}e=re.current,Ni(t)?Mi(t,e):(e=ff(a,r,n),t.stateNode=e,Ec(t))}return jc(t),null;case 5:if(le(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}if(o=re.current,Ni(t))Mi(t,o);else{var s=Bd(ae.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[W]=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&&Ec(t)}}return jc(t),Dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ae.current,Ni(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ei,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||ji(t,!0)}else e=Bd(e).createTextNode(r),e[tt]=t,t.stateNode=e}return jc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ni(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 Pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),e=!1}else n=Fi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(to(t),t):(to(t),null);if(t.flags&128)throw Error(i(558))}return jc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ni(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 Pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),a=!1}else a=Fi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(to(t),t):(to(t),null)}return to(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),kc(t,t.updateQueue),jc(t),null);case 4:return V(),e===null&&xd(t.stateNode.containerInfo),jc(t),null;case 10:return Vi(t.type),jc(t),null;case 19:if(z(no),r=t.memoizedState,r===null)return jc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Ac(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ro(e),o!==null){for(t.flags|=128,Ac(r,!1),e=o.updateQueue,t.updateQueue=e,kc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ii(n,e),n=n.sibling;return B(no,no.current&1|2),K&&xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&H()>$l&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304)}else{if(!a)if(e=ro(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,kc(t,e),Ac(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!K)return jc(t),null}else 2*H()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,a=!0,Ac(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?(jc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=H(),e.sibling=null,n=no.current,B(no,a?n&1|2:n&1),K&&xi(t,r.treeForkCount),e);case 22:case 23:return to(t),Ja(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(jc(t),t.subtreeFlags&6&&(t.flags|=8192)):jc(t),n=t.updateQueue,n!==null&&kc(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&&z(ua),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Vi($i),jc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Nc(e,t){switch(wi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vi($i),V(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return le(t),null;case 31:if(t.memoizedState!==null){if(to(t),t.alternate===null)throw Error(i(340));Pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(to(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z(no),null;case 4:return V(),null;case 10:return Vi(t.type),null;case 22:case 23:return to(t),Ja(),e!==null&&z(ua),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Vi($i),null;case 25:return null;default:return null}}function Pc(e,t){switch(wi(t),t.tag){case 3:Vi($i),V();break;case 26:case 27:case 5:le(t);break;case 4:V();break;case 31:t.memoizedState!==null&&to(t);break;case 13:to(t);break;case 19:z(no);break;case 10:Vi(t.type);break;case 22:case 23:to(t),Ja(),e!==null&&z(ua);break;case 24:Vi($i)}}function Fc(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 Ic(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 Lc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ua(t,n)}catch(t){Uu(e,e.return,t)}}}function Rc(e,t,n){n.props=zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function zc(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 Bc(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 Vc(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 Hc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[W]=t}catch(t){Uu(e,e.return,t)}}function Uc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(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 Gc(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=Kt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Kc(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(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(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[W]=n}catch(t){Uu(e,e.return,t)}}var Jc=!1,Yc=!1,Xc=!1,Zc=typeof WeakSet==`function`?WeakSet:Set,Qc=null;function $c(e,t){if(e=e.containerInfo,Rd=sp,e=br(e),xr(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,Qc=t;Qc!==null;)if(t=Qc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Qc=e;else for(;Qc!==null;){switch(t=Qc,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=zs(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,Qc=e;break}Qc=t.return}}function el(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:hl(e,n),r&4&&Fc(5,n);break;case 1:if(hl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}r&64&&Lc(n),r&512&&zc(n,n.return);break;case 3:if(hl(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{Ua(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&qc(n);case 26:case 5:hl(e,n),t===null&&r&4&&Vc(n),r&512&&zc(n,n.return);break;case 12:hl(e,n);break;case 31:hl(e,n),r&4&&ol(e,n);break;case 13:hl(e,n),r&4&&sl(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||Jc,!r){t=t!==null&&t.memoizedState!==null||Yc,i=Jc;var a=Yc;Jc=r,(Yc=t)&&!a?_l(e,n,(n.subtreeFlags&8772)!=0):hl(e,n),Jc=i,Yc=a}break;case 30:break;default:hl(e,n)}}function tl(e){var t=e.alternate;t!==null&&(e.alternate=null,tl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&st(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 nl=null,rl=!1;function il(e,t,n){for(n=n.child;n!==null;)al(e,t,n),n=n.sibling}function al(e,t,n){if(je&&typeof je.onCommitFiberUnmount==`function`)try{je.onCommitFiberUnmount(Ae,n)}catch{}switch(n.tag){case 26:Yc||Bc(n,t),il(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Yc||Bc(n,t);var r=nl,i=rl;Zd(n.type)&&(nl=n.stateNode,rl=!1),il(e,t,n),pf(n.stateNode),nl=r,rl=i;break;case 5:Yc||Bc(n,t);case 6:if(r=nl,i=rl,nl=null,il(e,t,n),nl=r,rl=i,nl!==null)if(rl)try{(nl.nodeType===9?nl.body:nl.nodeName===`HTML`?nl.ownerDocument.body:nl).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{nl.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}break;case 18:nl!==null&&(rl?(e=nl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(nl,n.stateNode));break;case 4:r=nl,i=rl,nl=n.stateNode.containerInfo,rl=!0,il(e,t,n),nl=r,rl=i;break;case 0:case 11:case 14:case 15:Ic(2,n,t),Yc||Ic(4,n,t),il(e,t,n);break;case 1:Yc||(Bc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Rc(n,t,r)),il(e,t,n);break;case 21:il(e,t,n);break;case 22:Yc=(r=Yc)||n.memoizedState!==null,il(e,t,n),Yc=r;break;default:il(e,t,n)}}function ol(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 sl(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 cl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zc),t;default:throw Error(i(435,e.tag))}}function ll(e,t){var n=cl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function ul(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)){nl=c.stateNode,rl=!1;break a}break;case 5:nl=c.stateNode,rl=!1;break a;case 3:case 4:nl=c.stateNode.containerInfo,rl=!0;break a}c=c.return}if(nl===null)throw Error(i(160));al(o,s,a),nl=null,rl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fl(t,e),t=t.sibling}var dl=null;function fl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ul(t,e),pl(e),r&4&&(Ic(3,e,e.return),Fc(3,e),Ic(5,e,e.return));break;case 1:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),r&64&&Jc&&(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=dl;if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(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[ot]||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,ft(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,ft(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&&Hc(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:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),n!==null&&r&4&&Hc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),e.flags&32){a=e.stateNode;try{Rt(a,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Hc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Xc=!0);break;case 6:if(ul(t,e),pl(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=dl,dl=gf(t.containerInfo),ul(t,e),dl=a,pl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Uu(e,e.return,t)}Xc&&(Xc=!1,ml(e));break;case 4:r=dl,dl=gf(e.stateNode.containerInfo),ul(t,e),pl(e),dl=r;break;case 12:ul(t,e),pl(e);break;case 31:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 13:ul(t,e),pl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zl=H()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Jc,d=Yc;if(Jc=u||a,Yc=d||l,ul(t,e),Yc=d,Jc=u,pl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Jc||Yc||gl(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,ll(e,n))));break;case 19:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 30:break;case 21:break;default:ul(t,e),pl(e)}}function pl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Uc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Kc(e,Wc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Rt(o,``),n.flags&=-33),Kc(e,Wc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Gc(e,Wc(e),s);break;default:throw Error(i(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ml(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ml(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function hl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)el(e,t.alternate,t),t=t.sibling}function gl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ic(4,t,t.return),gl(t);break;case 1:Bc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Rc(t,t.return,n),gl(t);break;case 27:pf(t.stateNode);case 26:case 5:Bc(t,t.return),gl(t);break;case 22:t.memoizedState===null&&gl(t);break;case 30:gl(t);break;default:gl(t)}e=e.sibling}}function _l(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:_l(i,a,n),Fc(4,a);break;case 1:if(_l(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++)Ha(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&Lc(a),zc(a,a.return);break;case 27:qc(a);case 26:case 5:_l(i,a,n),n&&r===null&&o&4&&Vc(a),zc(a,a.return);break;case 12:_l(i,a,n);break;case 31:_l(i,a,n),n&&o&4&&ol(i,a);break;case 13:_l(i,a,n),n&&o&4&&sl(i,a);break;case 22:a.memoizedState===null&&_l(i,a,n),zc(a,a.return);break;case 30:break;default:_l(i,a,n)}t=t.sibling}}function vl(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&&ta(n))}function yl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ta(e))}function bl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xl(e,t,n,r),t=t.sibling}function xl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:bl(e,t,n,r),i&2048&&Fc(9,t);break;case 1:bl(e,t,n,r);break;case 3:bl(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&&ta(e)));break;case 12:if(i&2048){bl(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 bl(e,t,n,r);break;case 31:bl(e,t,n,r);break;case 13:bl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?bl(e,t,n,r):(a._visibility|=2,Sl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?bl(e,t,n,r):Cl(e,t),i&2048&&vl(o,t);break;case 24:bl(e,t,n,r),i&2048&&yl(t.alternate,t);break;default:bl(e,t,n,r)}}function Sl(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:Sl(a,o,s,c,i),Fc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Sl(a,o,s,c,i)):u._visibility&2?Sl(a,o,s,c,i):Cl(a,o),i&&l&2048&&vl(o.alternate,o);break;case 24:Sl(a,o,s,c,i),i&&l&2048&&yl(o.alternate,o);break;default:Sl(a,o,s,c,i)}t=t.sibling}}function Cl(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:Cl(n,r),i&2048&&vl(r.alternate,r);break;case 24:Cl(n,r),i&2048&&yl(r.alternate,r);break;default:Cl(n,r)}t=t.sibling}}var wl=8192;function Tl(e,t,n){if(e.subtreeFlags&wl)for(e=e.child;e!==null;)El(e,t,n),e=e.sibling}function El(e,t,n){switch(e.tag){case 26:Tl(e,t,n),e.flags&wl&&e.memoizedState!==null&&Gf(n,dl,e.memoizedState,e.memoizedProps);break;case 5:Tl(e,t,n);break;case 3:case 4:var r=dl;dl=gf(e.stateNode.containerInfo),Tl(e,t,n),dl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=wl,wl=16777216,Tl(e,t,n),wl=r):Tl(e,t,n));break;default:Tl(e,t,n)}}function Dl(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 Ol(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)kl(e),e=e.sibling}function kl(e){switch(e.tag){case 0:case 11:case 15:Ol(e),e.flags&2048&&Ic(9,e,e.return);break;case 3:Ol(e);break;case 12:Ol(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Al(e)):Ol(e);break;default:Ol(e)}}function Al(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ic(8,t,t.return),Al(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Al(t));break;default:Al(t)}e=e.sibling}}function jl(e,t){for(;Qc!==null;){var n=Qc;switch(n.tag){case 0:case 11:case 15:Ic(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:ta(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Qc=r;else a:for(n=e;Qc!==null;){r=Qc;var i=r.sibling,a=r.return;if(tl(r),r===n){Qc=null;break a}if(i!==null){i.return=a,Qc=i;break a}Qc=a}}}var Ml={getCacheForType:function(e){var t=qi($i),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return qi($i).controller.signal}},Nl=typeof WeakMap==`function`?WeakMap:Map,Pl=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 Pl&2&&Q!==0?Q&-Q:F.T===null?Qe():ud()}function fu(){if(Kl===0)if(!(Q&536870912)||K){var e=Re;Re<<=1,!(Re&3932160)&&(Re=262144),Kl=e}else Kl=536870912;return e=Ya.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),(!(Pl&2)||e!==Fl)&&(e===Fl&&(!(Pl&2)&&(Wl|=n),Hl===4&&_u(e,Q,Kl,!1)),nd(e))}function mu(e,t,n){if(Pl&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-H(),10<a)){if(_u(r,t,Kl,!Rl),U(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:Kt},El(t,a,d);var m=(a&62914560)===a?Zl-H():(a&4194048)===a?Ql-H():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(!hr(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-Ne(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&qe(e,n,t)}function vu(){return Pl&6?!0:(rd(0,!1),!1)}function yu(){if(Z!==null){if(Il===0)var e=Z.return;else e=Z,zi=Ri=null,So(e),wa=null,Ta=0,e=Z;for(;e!==null;)Pc(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=ri(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-Ne(r),a=1<<i;t|=e[i],r&=~a}return Vl=t,qr(),n}function xu(e,t){J=null,F.H=js,t===ma||t===ga?(t=Sa(),Il=3):t===ha?(t=Sa(),Il=4):Il=t===Ys?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ll=t,Z===null&&(Hl=1,Us(e,di(t,e.current)))}function Su(){var e=Ya.current;return e===null?!0:(Q&4194048)===Q?Xa===null:(Q&62914560)===Q||Q&536870912?e===Xa:!1}function Cu(){var e=F.H;return F.H=js,e===null?js:e}function wu(){var e=F.A;return F.A=Ml,e}function Tu(){Hl=4,Rl||(Q&4194048)!==Q&&Ya.current!==null||(zl=!0),!(Ul&134217727)&&!(Wl&134217727)||Fl===null||_u(Fl,Q,Kl,!1)}function Eu(e,t,n){var r=Pl;Pl|=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:Ya.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++,zi=Ri=null,Pl=r,F.H=i,F.A=a,Z===null&&(Fl=null,Q=0,qr()),o}function Du(){for(;Z!==null;)Au(Z)}function Ou(e,t){var n=Pl;Pl|=2;var r=Cu(),a=wu();Fl!==e||Q!==t?(eu=null,$l=H()+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(va(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:va(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 zi=Ri=null,F.H=r,F.A=a,Pl=n,Z===null?(Fl=null,Q=0,qr(),Hl):0}function ku(){for(;Z!==null&&!be();)Au(Z)}function Au(e){var t=Tc(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=lc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=lc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:So(t);default:Pc(n,t),t=Z=ii(t,Vl),t=Tc(n,t,Vl)}e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function Mu(e,t,n,r){zi=Ri=null,So(t),wa=null,Ta=0;var i=t.return;try{if(Js(e,i,t,n,Q)){Hl=1,Us(e,di(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;Hl=1,Us(e,di(n,e.current)),Z=null;return}t.flags&32768?(K||r===1?e=!0:zl||Q&536870912?e=!1:(Rl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ya.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=Mc(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=Nc(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(Pl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Kr,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(Te,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=Pl,Pl|=4;try{$c(e,t,n)}finally{Pl=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=Pl;Pl|=4;try{fl(t,e);var a=zd,o=br(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&yr(s.ownerDocument.documentElement,s)){if(c!==null&&xr(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 _=vr(s,h),v=vr(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{Pl=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=Pl;Pl|=4;try{el(e,t.alternate,t)}finally{Pl=i,I.p=r,F.T=n}}nu=3}}function Ru(){if(nu===4||nu===3){nu=0,xe();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,je&&typeof je.onCommitFiberRoot==`function`)try{je.onCommitFiberRoot(Ae,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,ta(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,Pl&6)throw Error(i(331));var c=Pl;if(Pl|=4,kl(o.current),xl(o,o.current,s,n),Pl=c,rd(0,!1),je&&typeof je.onPostCommitFiberRoot==`function`)try{je.onPostCommitFiberRoot(Ae,o)}catch{}return!0}finally{I.p=a,F.T=r,zu(e,t)}}function Hu(e,t,n){t=di(n,t),t=Gs(e.stateNode,t,2),e=Ia(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=di(n,e),n=Ks(2),r=Ia(t,n,2),r!==null&&(qs(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 Nl;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>H()-Zl?!(Pl&2)&&bu(e,0):Gl|=n,ql===Q&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=Ue()),e=Xr(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 ve(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-Ne(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=U(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=H(),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-Ne(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=U(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&&ye(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&&ye(r),Ze(n)){case 2:case 8:n=we;break;case 32:n=Te;break;case 268435456:n=De;break;default:n=Te}return r=sd.bind(null,e),n=ve(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ye(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=U(e,e===Fl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mu(e,r,t),od(e,H()),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(){Pl&6?ve(Ce,id):ad()})}function ud(){if(td===0){var e=ia;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:Gt(``+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[W]||null).action),o=r.submitter;o&&(t=(t=o[W]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new mn(`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<Vr.length;md++){var hd=Vr[md];Hr(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Hr(Nr,`onAnimationEnd`),Hr(Pr,`onAnimationIteration`),Hr(Fr,`onAnimationStart`),Hr(`dblclick`,`onDoubleClick`),Hr(`focusin`,`onFocus`),Hr(`focusout`,`onBlur`),Hr(Ir,`onTransitionRun`),Hr(Lr,`onTransitionStart`),Hr(Rr,`onTransitionCancel`),Hr(zr,`onTransitionEnd`),gt(`onMouseEnter`,[`mouseout`,`mouseover`]),gt(`onMouseLeave`,[`mouseout`,`mouseover`]),gt(`onPointerEnter`,[`pointerout`,`pointerover`]),gt(`onPointerLeave`,[`pointerout`,`pointerover`]),ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),ht(`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){Ur(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){Ur(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[rt];n===void 0&&(n=t[rt]=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,pt.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,!nn||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=ct(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}$t(function(){var r=a,i=Jt(n),s=[];a:{var c=Br.get(e);if(c!==void 0){var l=mn,u=e;switch(e){case`keypress`:if(ln(n)===0)break a;case`keydown`:case`keyup`:l=Mn;break;case`focusin`:u=`focus`,l=Cn;break;case`focusout`:u=`blur`,l=Cn;break;case`beforeblur`:case`afterblur`:l=Cn;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=xn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Sn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Pn;break;case Nr:case Pr:case Fr:l=wn;break;case zr:l=Fn;break;case`scroll`:case`scrollend`:l=gn;break;case`wheel`:l=In;break;case`copy`:case`cut`:case`paste`:l=Tn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Nn;break;case`toggle`:case`beforetoggle`:l=Ln}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=en(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!==qt&&(u=n.relatedTarget||n.fromElement)&&(ct(u)||u[nt]))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?ct(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=xn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Nn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ut(l),h=u==null?c:ut(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ct(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?ut(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=rr;else if(Zn(c))if(ir)v=pr;else{v=dr;var y=ur}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Ht(r.elementType)&&(v=rr):v=fr;if(v&&=v(e,r)){Qn(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Pt(c,`number`,c.value)}switch(y=r?ut(r):window,e){case`focusin`:(Zn(y)||y.contentEditable===`true`)&&(Cr=y,wr=r,Tr=null);break;case`focusout`:Tr=wr=Cr=null;break;case`mousedown`:Er=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Er=!1,Dr(s,n,i);break;case`selectionchange`:if(Sr)break;case`keydown`:case`keyup`:Dr(s,n,i)}var b;if(zn)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 qn?Gn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Hn&&n.locale!==`ko`&&(qn||x!==`onCompositionStart`?x===`onCompositionEnd`&&qn&&(b=cn()):(an=i,on=`value`in an?an.value:an.textContent,qn=!0)),y=Td(r,x),0<y.length&&(x=new En(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Kn(n),b!==null&&(x.data=b)))),(b=Vn?Jn(e,n):Yn(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new En(`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=en(e,n),i!=null&&r.unshift(wd(e,i,a)),i=en(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=en(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=en(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===``||Rt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Rt(e,``+r);break;case`className`:St(e,`class`,r);break;case`tabIndex`:St(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:St(e,n,r);break;case`style`:Vt(e,r,o);break;case`data`:if(t!==`object`){St(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=Gt(``+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=Gt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Kt);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=Gt(``+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),xt(e,`popover`,r);break;case`xlinkActuate`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:xt(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=Ut.get(n)||n,xt(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Vt(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`?Rt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Rt(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Kt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!mt.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[W]||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,``):xt(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)}}Nt(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&&Ft(e,!!r,n,!0):Ft(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)}Lt(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(Ht(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)}}Mt(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?Ft(e,!!n,n?[]:``,!1):Ft(e,!!n,t,!0)):Ft(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)}It(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(Ht(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[ot]||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),st(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[ot])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]);st(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=lt(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=jt(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),ft(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="`+jt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+jt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+jt(n.imageSizes)+`"]`)):i+=`[href="`+jt(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),ft(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="`+jt(r)+`"][href="`+jt(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),ft(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=dt(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`);ft(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=dt(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`),ft(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=dt(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`),ft(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=ae.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=dt(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=dt(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=dt(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="`+jt(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),ft(t),e.head.appendChild(t))}function Pf(e){return`[src="`+jt(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~="`+jt(n.href)+`"]`);if(r)return t.instance=r,ft(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`),ft(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,ft(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),ft(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,ft(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ft(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[ot]||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,ft(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),ft(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:L,_currentValue2:L,_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=ti(3,null,null,t),e.current=a,a.stateNode=e,t=ea(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Na(a),e}function tp(e){return e?(e=$r,e):$r}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Fa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ia(e,r,t),n!==null&&(pu(n,e,t),La(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=Xr(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=Xr(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=lt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Be(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ne(o);s.entanglements[1]|=c,o&=~c}nd(a),!(Pl&6)&&($l=H()+500,rd(0,!1))}}break;case 31:case 13:s=Xr(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=Jt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=ct(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(Se()){case Ce:return 2;case we:return 8;case Te:case Ee:return 32;case De: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=lt(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=ct(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);qt=r,n.target.dispatchEvent(r),qt=null}else return t=lt(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=lt(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[W]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[W]||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[nt]=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{Ae=zp.inject(Rp),je=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Bs,s=Vs,c=Hs;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[nt]=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])}function y(e,t){try{return e.getItem(t)}catch{return null}}function b(e,t,n){try{e.setItem(t,n)}catch{}}function x(e,t){try{e.removeItem(t)}catch{}}const S=300*1e3;function C(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,discoveredAt:typeof t.discoveredAt==`string`?t.discoveredAt:void 0,stale:typeof t.stale==`boolean`?t.stale:void 0,staleProviders:Array.isArray(t.staleProviders)?t.staleProviders.filter(e=>typeof e==`string`):void 0}:null}function w(e,t=S){if(!e)return!1;let n=Date.now()-new Date(e).getTime();return Number.isFinite(n)&&n>=0&&n<t}function T(e,t=S){return e?.stale===!0?!0:!w(e?.discoveredAt||e?.cachedAt,t)}function E(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 D(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 O(e){return new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}function k(e){return e?`$${e.toFixed(2)}`:``}function A(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 j(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 M(e){let t=Math.round(e/1024);return t>=1024?`${(t/1024).toFixed(1)}MB`:`${t}KB`}function N(e){return e?e>=999500?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e):`0`}function ee(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`:O(e)}function P(e){let t=Ae(e);if(t)return t;let n=e.replace(/\/$/,``).split(`/`);return n[n.length-1]||e}function F(e){return(e||``).replace(/\s+/g,` `).trim().slice(0,120)}function I(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 L(e){return e.split(`
17
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 P(e){let t=[...e.split(`
18
+ `).trim()}function te(e){let t=[...e.split(`
19
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 re(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 ie(e){if(ne(e)||re(e))return``;let t=/Last login:|Logged in to github\.com|Git operations protocol:|(?:➜|❯)\s+/i.test(e),n=P(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||re(n))||t&&/^[a-z0-9._:-]{1,12}$/i.test(n)?``:n}function ae(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=ie(e||``);!t||i.has(t)||(i.add(t),r.push(t))}let o=ie(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 F(e){return e&&e!==`main`&&e!==`master`?e:void 0}function oe(e){return e.replace(/^space[_-]?/,``).slice(0,6)||e.slice(0,6)}function I(e){let t=e.title?M(ie(e.title)):``;if(t)return t;let n=[...e.prompts||[],e.firstPrompt];for(let e of n){let t=M(ie(e||``));if(t)return t}return e.slug}function se(e){let t=I(e);if(e.replay?.title){let t=M(e.replay.title);if(t)return t}return t}function ce(e,t){let n=I(e),r=M(e.replay?.title);return M(ie(t?.title||``))||(n&&n!==e.slug?n:r||n)}function L(e){return M(e.title)||M(e.firstMessage)||M(e.messages?.[0])||e.slug}function R(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?b(sessionStorage,`vibe_dashboard_state`,JSON.stringify(e)):x(sessionStorage,`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=y(sessionStorage,`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`))}function le(e,t){let n=new URL(window.location.href);for(let e of[`view`,`tab`,`session`,`gist`,`cloud`,`url`,`project`,`q`,`archived`,`v`,`s`])n.searchParams.delete(e);n.searchParams.set(`live`,`1`),n.searchParams.set(`provider`,e),n.searchParams.set(`sessionId`,t),window.history.pushState({},``,n.toString()),window.dispatchEvent(new PopStateEvent(`popstate`))}const ue={"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`,codex:`bg-terminal-purple-subtle text-terminal-purple`,cursor:`bg-terminal-blue-subtle text-terminal-blue`,pi:`bg-terminal-cyan-subtle text-terminal-cyan`};var de={"claude-code":`Claude`,"claude-desktop":`Desktop`,"claude-cowork":`Cowork`,codex:`Codex`,cursor:`Cursor`,pi:`Pi`},fe={"claude-code":`Claude Code`,"claude-desktop":`Claude Desktop`,"claude-cowork":`Claude Cowork`,codex:`Codex`,cursor:`Cursor`,pi:`Pi`},pe={"claude-code":`bg-terminal-orange`,"claude-desktop":`bg-terminal-orange`,"claude-cowork":`bg-terminal-orange`,codex:`bg-terminal-purple`,cursor:`bg-terminal-blue`,pi:`bg-terminal-cyan`};function me(e){return de[e]||e}function he(e){return ue[e]||`bg-terminal-surface text-terminal-dim`}function ge(e){return fe[e]||e}function _e(e){return pe[e]||`bg-terminal-dim`}function ve(e,t,n){return n?`bg-terminal-purple-subtle text-terminal-purple`:e===`jsonl`||e===`jsonl+tools`?`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`}async function ye(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:`,z(t)),n(t=>{let n=new Set(t);return r?n.add(e):n.delete(e),n})}}function z(e){return e instanceof Error?e.message:typeof e==`string`?e:`Unknown error`}function be(e){return e instanceof Error?/failed to fetch|networkerror|load failed|fetch failed/i.test(e.message):!1}function xe(e){return be(e)?`Couldn't reach the local vibe-replay server — it may be starting up or restarting. Try again in a moment.`:z(e)}var Se=e=>new Promise(t=>setTimeout(t,e));async function Ce(e,t,n){let r=n?.retries??4,i=n?.baseDelayMs??250,a;for(let n=0;n<=r;n++)try{let a=await fetch(e,t);if((a.status===502||a.status===503||a.status===504)&&n<r){await Se(i*2**n);continue}return a}catch(e){if(a=e,!be(e)||n===r)throw e;await Se(i*2**n)}throw a??Error(`fetchWithRetry: no attempts were made`)}function B(e){let t=Ae(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 we(e){let t=new Map;for(let n of e)t.set(n,Ae(n)||B(n));return t}function Te(e,t,n){return n?t===`jsonl+tools`?`Cursor SDK + JSONL + agent-tools`:t===`jsonl`?`Cursor SDK + JSONL`:`Cursor SDK`: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 Ee=/^(.+?)\/\.claude\/worktrees\/[^/]+(?:\/.*)?$/;function De(e){let t=e.replace(/\/$/,``).match(Ee);return t?t[1]:null}function Oe(e){return De(e)??e}function ke(e){let t=new Map;for(let n of e){let e=Oe(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 Ae(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 je=`__all__`;function Me(){return new URLSearchParams(window.location.search).get(`project`)||`__all__`}function Ne(){return new URLSearchParams(window.location.search).get(`q`)||``}function Pe(){return new URLSearchParams(window.location.search).get(`archived`)===`true`}function Fe(){let[e,t]=(0,_.useState)(Me),[n,r]=(0,_.useState)(Ne),[i,a]=(0,_.useState)(Pe);return(0,_.useEffect)(()=>{let e=()=>{t(Me()),r(Ne()),a(Pe())};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),{selectedProject:e,filter:n,showArchived:i,handleProjectChange:e=>{t(e),R({project:e===`__all__`?null:e})},handleFilterChange:e=>{r(e),R({q:e||null},{replace:!0})},handleToggleArchived:()=>{let e=!i;a(e),R({archived:e?`true`:null})}}}var Ie=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=Ie()}))(),1);function Le(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 Re({value:e,durationMs:t,formatter:n=e=>Math.round(e).toLocaleString()}){return(0,V.jsx)(V.Fragment,{children:n(Le(e,t))})}function ze(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 Be=()=>(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 Ve({provider:e}){return e.startsWith(`claude-`)?(0,V.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`h-3.5 w-3.5`,fill:`currentColor`,children:(0,V.jsx)(`path`,{d:`m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z`})}):e===`cursor`?(0,V.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`h-3.5 w-3.5`,fill:`currentColor`,children:(0,V.jsx)(`path`,{d:`M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23`})}):e===`codex`?(0,V.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`h-3.5 w-3.5`,fill:`currentColor`,children:(0,V.jsx)(`path`,{d:`M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654 2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z`})}):e===`pi`?(0,V.jsxs)(`svg`,{viewBox:`0 0 800 800`,className:`h-3.5 w-3.5`,fill:`currentColor`,children:[(0,V.jsx)(`path`,{fillRule:`evenodd`,d:`M165.29 165.29H517.36V400H400V517.36H282.65V634.72H165.29ZM282.65 282.65V400H400V282.65Z`}),(0,V.jsx)(`path`,{d:`M517.36 400H634.72V634.72H517.36Z`})]}):(0,V.jsx)(`span`,{className:`font-mono text-[10px] font-bold leading-none uppercase`,children:me(e).slice(0,1)})}function He({provider:e}){let t=ge(e);return(0,V.jsx)(`span`,{className:`inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-lg ring-1 ring-current/15 ${he(e)}`,title:t,"aria-label":t,children:(0,V.jsx)(Ve,{provider:e})})}function Ue({slug:e,title:t,fallbackTitle:n,onSave:r}){let i=M(t||n||e),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(i),[l,u]=(0,_.useState)(!1),d=(0,_.useRef)(null),f=(0,_.useRef)(!1);(0,_.useEffect)(()=>{c(i)},[i]),(0,_.useEffect)(()=>{a&&d.current?.focus()},[a]);let p=async()=>{if(!l){if(f.current){f.current=!1;return}u(!0);try{await r(e,M(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(),p()},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:p,onKeyDown:e=>{e.key===`Escape`&&(f.current=!0,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:()=>{f.current=!1,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 We({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)(Be,{})}),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`]})})]})}function Ge({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 Ke(){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 Ce(`/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(xe(e))}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})]})}var qe=m();function Je(e){let t=e.kind===`malformed-json`?`malformed JSONL line`:e.kind===`missing-image`?`image file`:e.kind===`unreadable-source`?`unreadable source`:`item`,n=e.count===1?t:`${t}s`,r=e.source?` in ${e.source}`:``,i=e.firstLine?` first at line ${e.firstLine}`:``;return`${e.count} ${n} skipped${r}${i}.`}function Ye(e){let t=[...e.dataSourceInfo?.notes||[]];for(let n of e.parseWarnings||[])t.push(Je(n));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 Xe(e){let t=Ye(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 Ze({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,qe.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 Qe(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 $e={sqlite:`SQLite (store.db)`,"global-state":`SQLite (global state.vscdb)`,jsonl:`JSONL transcript`,"jsonl+tools":`JSONL + agent-tools`};function et(e){return e?$e[e]||e:`unknown`}function tt({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 W(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 nt(e){return!e||e<1?``:e<1e3?`${Math.round(e)}ms`:e<1e4?`${(e/1e3).toFixed(1)}s`:W(e)}function rt(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 it=(0,_.createContext)(null);function at(){let e=(0,_.useContext)(it);if(!e)throw Error(`useScanInsightsContext must be used within ScanInsightsProvider`);return e}function ot({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||!w(a.cachedAt,3e5)){r();return}let o=Date.now()-new Date(a.cachedAt).getTime(),s=Math.max(1e3,S-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)(it.Provider,{value:f,children:e})}function st(){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 ct({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,E=(0,_.useMemo)(()=>T?[...ke(T)].sort((e,t)=>t.sessions-e.sessions).slice(0,8):[],[T]);if(d===0)return null;let D=Object.entries(v).sort(([,e],[,t])=>t-e),O=D.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:D.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:[k(e),` `,(0,V.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[t,`x`]})]},e))})]}),ee={month:`short`,day:`numeric`,year:`numeric`},A=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`,ee)}),` — `,(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:new Date(S.last).toLocaleDateString(`en-US`,ee)})]});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)(Ze,{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:[W(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:[lt(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:[lt(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:[lt(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 `,W(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=ze(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))})]}),O,A,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:E.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:W(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)})})]}),O,A]})]})}function lt(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}var ut=864e5,dt=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],ft=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function pt(e){return ze(e)}function mt(e){return e===`7d`?7:e===`30d`?30:e===`90d`?90:0}function ht(e,t){if(t===`all`)return e;let n=mt(t),r=new Date;r.setHours(0,0,0,0),r.setDate(r.getDate()-n);let i=pt(r),a={};for(let[t,n]of Object.entries(e))t>=i&&(a[t]=n);return a}function gt(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=ht(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 _t(e){let t=new Date;t.setHours(0,0,0,0);let n=0,r=new Date(t);for(;;){let t=pt(r);if(e[t]&&e[t]>0)n++,r.setDate(r.getDate()-1);else if(n===0){r.setDate(r.getDate()-1);let t=pt(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())/ut===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 vt(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:ft[t],shortDay:dt[t],count:e}))}function yt(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*ut);for(let r=t-1;r>=0;r--){let t=new Date(o.getTime()-r*7*ut),i=0;for(let n=0;n<7;n++){let r=pt(new Date(t.getTime()+n*ut));i+=e[r]||0}let a=t.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`});n.push({weekLabel:a,sessions:i,startDate:pt(t)})}return n}function bt(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 xt(e){return e===0?`$0`:e<.01?`<$0.01`:e<1||e<100?`$${e.toFixed(2)}`:`$${Math.round(e)}`}function St(e){return e>=1e4?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function Ct(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.floor(e/1e3)}k`:e.toString()}function wt(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(`
20
+ `).trim()}function ne(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 R(e){if(I(e)||ne(e))return``;let t=/Last login:|Logged in to github\.com|Git operations protocol:|(?:➜|❯)\s+/i.test(e),n=te(L(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||ne(n))||t&&/^[a-z0-9._:-]{1,12}$/i.test(n)?``:n}function z(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=R(e||``);!t||i.has(t)||(i.add(t),r.push(t))}let o=R(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 B(e){return e&&e!==`main`&&e!==`master`?e:void 0}function re(e){return e.replace(/^space[_-]?/,``).slice(0,6)||e.slice(0,6)}function ie(e){let t=e.title?F(R(e.title)):``;if(t)return t;let n=[...e.prompts||[],e.firstPrompt];for(let e of n){let t=F(R(e||``));if(t)return t}return e.slug}function ae(e){let t=ie(e);if(e.replay?.title){let t=F(e.replay.title);if(t)return t}return t}function oe(e,t){let n=ie(e),r=F(e.replay?.title);return F(R(t?.title||``))||(n&&n!==e.slug?n:r||n)}function se(e){return F(e.title)||F(e.firstMessage)||F(e.messages?.[0])||e.slug}function V(e,t={}){let n=new URL(window.location.href),r=[`tab`,`project`,`q`,`archived`,`provider`,`repo`,`replay`];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?b(sessionStorage,`vibe_dashboard_state`,JSON.stringify(e)):x(sessionStorage,`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=y(sessionStorage,`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&&t.notify!==!1&&window.dispatchEvent(new PopStateEvent(`popstate`))}function ce(e,t){let n=new URL(window.location.href);for(let e of[`view`,`tab`,`session`,`gist`,`cloud`,`url`,`project`,`q`,`archived`,`repo`,`replay`,`v`,`s`])n.searchParams.delete(e);n.searchParams.set(`live`,`1`),n.searchParams.set(`provider`,e),n.searchParams.set(`sessionId`,t),window.history.pushState({},``,n.toString()),window.dispatchEvent(new PopStateEvent(`popstate`))}const le={"claude-code":`bg-terminal-orange-subtle text-terminal-orange`,"claude-desktop":`bg-terminal-yellow-subtle text-terminal-yellow`,"claude-cowork":`bg-terminal-sienna-subtle text-terminal-sienna`,codex:`bg-terminal-purple-subtle text-terminal-purple`,cursor:`bg-terminal-blue-subtle text-terminal-blue`,pi:`bg-terminal-cyan-subtle text-terminal-cyan`};var ue={"claude-code":`Claude`,"claude-desktop":`Desktop`,"claude-cowork":`Cowork`,codex:`Codex`,cursor:`Cursor`,pi:`Pi`},de={"claude-code":`Claude Code`,"claude-desktop":`Claude Desktop`,"claude-cowork":`Claude Cowork`,codex:`Codex`,cursor:`Cursor`,pi:`Pi`},fe={"claude-code":`bg-terminal-orange`,"claude-desktop":`bg-terminal-yellow`,"claude-cowork":`bg-terminal-sienna`,codex:`bg-terminal-purple`,cursor:`bg-terminal-blue`,pi:`bg-terminal-cyan`};function pe(e){return ue[e]||e}function me(e){return le[e]||`bg-terminal-surface text-terminal-dim`}function he(e){return de[e]||e}function ge(e){return fe[e]||`bg-terminal-dim`}function _e(e,t,n){return n?`bg-terminal-purple-subtle text-terminal-purple`:e===`jsonl`||e===`jsonl+tools`?`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`}async function ve(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:`,ye(t)),n(t=>{let n=new Set(t);return r?n.add(e):n.delete(e),n})}}function ye(e){return e instanceof Error?e.message:typeof e==`string`?e:`Unknown error`}function be(e){return e instanceof Error?/failed to fetch|networkerror|load failed|fetch failed/i.test(e.message):!1}function xe(e){return be(e)?`Couldn't reach the local vibe-replay server — it may be starting up or restarting. Try again in a moment.`:ye(e)}var H=e=>new Promise(t=>setTimeout(t,e));async function Se(e,t,n){let r=n?.retries??4,i=n?.baseDelayMs??250,a;for(let n=0;n<=r;n++)try{let a=await fetch(e,t);if((a.status===502||a.status===503||a.status===504)&&n<r){await H(i*2**n);continue}return a}catch(e){if(a=e,!be(e)||n===r)throw e;await H(i*2**n)}throw a??Error(`fetchWithRetry: no attempts were made`)}function Ce(e){let t=Ae(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 we(e){let t=new Map;for(let n of e)t.set(n,Ae(n)||Ce(n));return t}function Te(e,t,n){return n?t===`jsonl+tools`?`Cursor SDK + JSONL + agent-tools`:t===`jsonl`?`Cursor SDK + JSONL`:`Cursor SDK`: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 Ee=/^(.+?)\/\.claude\/worktrees\/[^/]+(?:\/.*)?$/;function De(e){let t=e.replace(/\/$/,``).match(Ee);return t?t[1]:null}function Oe(e){return De(e)??e}function ke(e){let t=new Map;for(let n of e){let e=Oe(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 Ae(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 je=`__all__`;function Me(e){let t=new URLSearchParams(window.location.search).get(e);return t?t.split(`,`).map(e=>{try{return decodeURIComponent(e.trim())}catch{return e.trim()}}).filter(Boolean):[]}function Ne(e){return e.length>0?e.map(encodeURIComponent).join(`,`):null}function Pe(){return new URLSearchParams(window.location.search).get(`project`)||`__all__`}function Fe(){return new URLSearchParams(window.location.search).get(`q`)||``}function Ie(){return new URLSearchParams(window.location.search).get(`archived`)===`true`}function Le(){return Me(`provider`)}function Re(){return Me(`repo`)}function ze(){let[e,t]=(0,_.useState)(Pe),[n,r]=(0,_.useState)(Fe),[i,a]=(0,_.useState)(Ie),[o,s]=(0,_.useState)(Le),[c,l]=(0,_.useState)(Re),u=(0,_.useRef)(o),d=(0,_.useRef)(c);(0,_.useEffect)(()=>{u.current=o},[o]),(0,_.useEffect)(()=>{d.current=c},[c]),(0,_.useEffect)(()=>{let e=()=>{t(Pe()),r(Fe()),a(Ie());let e=Le(),n=Re();u.current=e,d.current=n,s(e),l(n)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let f=e=>{t(e),V({project:e===`__all__`?null:e},{notify:!1})},p=e=>{r(e),V({q:e||null},{replace:!0})},m=e=>{u.current=e,s(e),V({provider:Ne(e)},{notify:!1})},h=e=>{let t=u.current;m(t.includes(e)?t.filter(t=>t!==e):[...t,e])},g=e=>{d.current=e,l(e),V({repo:Ne(e)},{notify:!1})};return{selectedProject:e,filter:n,showArchived:i,selectedProviders:o,selectedRepos:c,handleProjectChange:f,handleFilterChange:p,handleProviderSet:m,handleProviderToggle:h,handleRepoSet:g,handleRepoToggle:e=>{let t=d.current;g(t.includes(e)?t.filter(t=>t!==e):[...t,e])},handleToggleArchived:()=>{let e=!i;a(e),V({archived:e?`true`:null},{notify:!1})},handleClearAllFilters:()=>{t(je),r(``),u.current=[],d.current=[],s([]),l([]),V({project:null,q:null,provider:null,repo:null,replay:null},{notify:!1})}}}var Be=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})),U=c(o(((e,t)=>{t.exports=Be()}))(),1);function Ve(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 He({value:e,durationMs:t,formatter:n=e=>Math.round(e).toLocaleString()}){return(0,U.jsx)(U.Fragment,{children:n(Ve(e,t))})}function Ue(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 We=()=>(0,U.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`currentColor`,children:[(0,U.jsx)(`circle`,{cx:`8`,cy:`3`,r:`1.5`}),(0,U.jsx)(`circle`,{cx:`8`,cy:`8`,r:`1.5`}),(0,U.jsx)(`circle`,{cx:`8`,cy:`13`,r:`1.5`})]});function Ge({provider:e}){return e.startsWith(`claude-`)?(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`h-3.5 w-3.5`,fill:`currentColor`,children:(0,U.jsx)(`path`,{d:`m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z`})}):e===`cursor`?(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`h-3.5 w-3.5`,fill:`currentColor`,children:(0,U.jsx)(`path`,{d:`M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23`})}):e===`codex`?(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`h-3.5 w-3.5`,fill:`currentColor`,children:(0,U.jsx)(`path`,{d:`M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654 2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z`})}):e===`pi`?(0,U.jsxs)(`svg`,{viewBox:`0 0 800 800`,className:`h-3.5 w-3.5`,fill:`currentColor`,children:[(0,U.jsx)(`path`,{fillRule:`evenodd`,d:`M165.29 165.29H517.36V400H400V517.36H282.65V634.72H165.29ZM282.65 282.65V400H400V282.65Z`}),(0,U.jsx)(`path`,{d:`M517.36 400H634.72V634.72H517.36Z`})]}):(0,U.jsx)(`span`,{className:`font-mono text-[10px] font-bold leading-none uppercase`,children:pe(e).slice(0,1)})}function Ke({provider:e,compact:t=!1,title:n}){let r=he(e);return(0,U.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center ring-1 ring-current/15 ${t?`h-5 w-5 rounded-md`:`h-6 w-6 rounded-lg`} ${me(e)}`,title:n||r,"aria-label":r,children:(0,U.jsx)(Ge,{provider:e})})}function qe({slug:e,title:t,fallbackTitle:n,onSave:r,hideSlug:i=!1}){let a=F(t||n||e),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(a),[u,d]=(0,_.useState)(!1),f=(0,_.useRef)(null),p=(0,_.useRef)(!1);(0,_.useEffect)(()=>{l(a)},[a]),(0,_.useEffect)(()=>{o&&f.current?.focus()},[o]);let m=async()=>{if(!u){if(p.current){p.current=!1;return}d(!0);try{await r(e,F(c))}finally{d(!1),s(!1)}}};return o?(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),m()},className:`flex items-center gap-1.5 min-w-0`,children:(0,U.jsx)(`input`,{ref:f,value:c,onChange:e=>l(e.target.value),onBlur:m,onKeyDown:e=>{e.key===`Escape`&&(p.current=!0,l(a),s(!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:a,maxLength:120,disabled:u})}),!i&&(0,U.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer truncate mt-0.5`,children:[`slug: `,(0,U.jsx)(`span`,{className:`text-terminal-dim`,children:e})]})]}):(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsxs)(`button`,{onClick:()=>{p.current=!1,s(!0)},className:`group flex items-center gap-1 min-w-0 max-w-full text-left`,title:`Click to edit title`,children:[(0,U.jsx)(`span`,{className:`text-sm font-sans font-medium text-terminal-text truncate`,children:a||e}),(0,U.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,U.jsx)(`path`,{d:`M11.5 1.5l3 3-9 9H2.5v-3l9-9z`})})]}),!i&&(0,U.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer truncate mt-0.5`,children:[`slug: `,(0,U.jsx)(`span`,{className:`text-terminal-dim`,children:e})]})]})}function Je({onArchive:e,onDelete:t,onRawData:n,isArchived:r}){let[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),c=(0,_.useRef)(null);return v(c,(0,_.useCallback)(()=>{a(!1),s(!1)},[]),i),(0,U.jsxs)(`div`,{className:`relative`,ref:c,children:[(0,U.jsx)(`button`,{onClick:e=>{e.stopPropagation(),a(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,U.jsx)(We,{})}),i&&(0,U.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:[n&&(0,U.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),n(),a(!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,U.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,U.jsx)(`path`,{d:`M5 3L2 8l3 5M11 3l3 5-3 5M7 12l2-8`})}),`Raw JSON`]}),(0,U.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),e(),a(!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,U.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,U.jsx)(`path`,{d:`M2 4h12v2H2zM3 6v7h10V6M6.5 8h3`})}),r?`Unarchive`:`Archive`]}),t&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`mx-2 my-1 border-t border-terminal-border`}),o?(0,U.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1`,children:[(0,U.jsx)(`button`,{onClick:e=>{e.stopPropagation(),t(),s(!1),a(!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,U.jsx)(`button`,{onClick:e=>{e.stopPropagation(),s(!1)},className:`h-6 px-2 text-xs font-sans rounded text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`})]}):(0,U.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),s(!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,U.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,U.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 replay`]})]})]})]})}function Ye({label:e,value:t,title:n}){return(0,U.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-sans text-terminal-dimmer uppercase tracking-wider shrink-0 w-[68px]`,children:e}),(0,U.jsx)(`span`,{className:`text-sm font-mono text-terminal-dim truncate`,title:n||t,children:t})]})}function Xe(){let[e,t]=(0,_.useState)(!1),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(null);return(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`button`,{onClick:async()=>{t(!0),a(null),r(null);try{let e=await Se(`/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(xe(e))}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,U.jsxs)(`span`,{className:`text-xs font-mono text-terminal-green`,children:[n.regenerated,`/`,n.total,` regenerated`]}),i&&(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-red`,children:i})]})}var Ze=m();function Qe(e){let t=e.kind===`malformed-json`?`malformed JSONL line`:e.kind===`missing-image`?`image file`:e.kind===`unreadable-source`?`unreadable source`:`item`,n=e.count===1?t:`${t}s`,r=e.source?` in ${e.source}`:``,i=e.firstLine?` first at line ${e.firstLine}`:``;return`${e.count} ${n} skipped${r}${i}.`}function $e(e){let t=[...e.dataSourceInfo?.notes||[]];for(let n of e.parseWarnings||[])t.push(Qe(n));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 et(e){let t=$e(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 tt({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,U.jsxs)(`span`,{ref:c,className:`inline-flex ${t}`,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,U.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,Ze.createPortal)((0,U.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,U.jsx)(`div`,{className:`mb-1 text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-orange`,children:`Data Quality`}),(0,U.jsx)(`div`,{className:`space-y-1`,children:l.map(e=>(0,U.jsx)(`div`,{className:`text-[11px] font-mono leading-relaxed text-terminal-dim`,children:e},e))})]}),document.body):null]})}function W(e,t,n=`${t}s`){return e===1?t:n}function nt(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 rt={sqlite:`SQLite (store.db)`,"global-state":`SQLite (global state.vscdb)`,jsonl:`JSONL transcript`,"jsonl+tools":`JSONL + agent-tools`};function it(e){return e?rt[e]||e:`unknown`}function at({label:e,value:t,color:n}){return(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl px-3 py-3 shadow-layer-sm`,children:[(0,U.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,U.jsx)(`div`,{className:`ui-section-title mt-0.5`,children:e})]})}function G(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function ot(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 st(e){return!e||e<1?``:e<1e3?`${Math.round(e)}ms`:e<1e4?`${(e/1e3).toFixed(1)}s`:ot(e)}function ct(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 lt=(0,_.createContext)(null);function ut(){let e=(0,_.useContext)(lt);if(!e)throw Error(`useScanInsightsContext must be used within ScanInsightsProvider`);return e}function dt({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||!w(a.cachedAt,3e5)){r();return}let o=Date.now()-new Date(a.cachedAt).getTime(),s=Math.max(1e3,S-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,U.jsx)(lt.Provider,{value:f,children:e})}var ft=864e5,pt=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],mt=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function ht(e){return Ue(e)}function gt(e){return e===`7d`?7:e===`30d`?30:e===`90d`?90:0}function _t(e,t){if(t===`all`)return e;let n=gt(t),r=new Date;r.setHours(0,0,0,0),r.setDate(r.getDate()-n);let i=ht(r),a={};for(let[t,n]of Object.entries(e))t>=i&&(a[t]=n);return a}function vt(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=_t(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 yt(e){let t=new Date;t.setHours(0,0,0,0);let n=0,r=new Date(t);for(;;){let t=ht(r);if(e[t]&&e[t]>0)n++,r.setDate(r.getDate()-1);else if(n===0){r.setDate(r.getDate()-1);let t=ht(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())/ft===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 bt(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:mt[t],shortDay:pt[t],count:e}))}function xt(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*ft);for(let r=t-1;r>=0;r--){let t=new Date(o.getTime()-r*7*ft),i=0;for(let n=0;n<7;n++){let r=ht(new Date(t.getTime()+n*ft));i+=e[r]||0}let a=t.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`});n.push({weekLabel:a,sessions:i,startDate:ht(t)})}return n}function St(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 Ct(e){return e===0?`$0`:e<.01?`<$0.01`:e<1||e<100?`$${e.toFixed(2)}`:`$${Math.round(e)}`}function wt(e){return e>=1e4?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function Tt(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.floor(e/1e3)}k`:e.toString()}function Et(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
22
  `):void 0,duration:n.length>0?[`Coding time is approximate for Cursor sessions.`,...n].join(`
24
23
  `):void 0,cost:r.length>0?[`Spend is a lower bound for Cursor sessions, not the full total.`,...r].join(`
25
- `):void 0}}function Tt(e){return[...new Set(e.split(`,`).map(e=>e.trim()).filter(Boolean))]}function Et(e){return e===`7d`?`Last 7 Days`:e===`30d`?`Last 30 Days`:e===`90d`?`Last 90 Days`:`All Time`}function Dt({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)*ut),a=t*7,o=new Date(i.getTime()-(a-1)*ut),s=0,c=[],l=new Map,u=-1;for(let t=0;t<a;t++){let n=new Date(o.getTime()+t*ut),r=pt(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 Ot({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=pt(new Date(t.getTime()-i*ut)),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 kt({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])=>ge(e)).join(` + `))},[a]),l=(0,_.useMemo)(()=>wt(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)(Ze,{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:Et(i)}),l.overall?(0,V.jsx)(Ze,{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)(Re,{durationMs:500,value:e.sessions,formatter:St})}),(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)(Re,{durationMs:500,value:e.replays,formatter:St})}),(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)(Re,{durationMs:500,value:e.prompts,formatter:St})}),(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)(Re,{durationMs:500,value:e.toolCalls,formatter:St})}),(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)(Re,{durationMs:500,value:e.durationMs,formatter:e=>ee(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)(Re,{durationMs:500,value:e.cost,formatter:e=>xt(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)(Re,{durationMs:500,value:e.edits,formatter:St})}),(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)(Re,{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)(Ot,{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 At({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 jt(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 Mt({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:jt(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:jt(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:jt(e.percentiles.p90Ms)})]})]}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[e.totalTurns.toLocaleString(),` turns`]})]})]})}var Nt=[{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 Pt({breakdown:e}){let t=e.input+e.output+e.cacheRead+e.cacheCreation;if(t===0)return null;let n=Nt.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:Ct(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:Ct(t)})]})]})}function Ft({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 It({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 Lt({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=j(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&&` · ${xt(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 Rt({models:e}){let t=(0,_.useMemo)(()=>(()=>{let t=new Map;for(let[n,r]of Object.entries(e))for(let e of Tt(n)){let n=k(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 zt({providers:e}){let t=(0,_.useMemo)(()=>Object.entries(e).map(([e,t])=>({provider:e,label:ge(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 ${_e(e.provider)} transition-all duration-500`,style:{width:`${t}%`,opacity:.7}})})]},e.provider)})})}function Bt(){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 Vt({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)(Bt,{})]})})}function Ht(){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=C(e)?.sessions||[],i=C(t)?.sessions||[];(r.length>0||i.length>0)&&n(r,i)})},[n]),e}function Ut(){let{userInsights:e,loading:t,scanStatus:n}=at(),r=Ht(),[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=ht(t,i),a=gt(n,{...e,totalReplays:r?.replays??0},i),o=_t(t),s=vt(n);return{stats:a,streak:o,dayOfWeek:s,bestDay:[...s].sort((e,t)=>t.count-e.count)[0]||null,peak:bt(n),weeklyTrend:yt(t,12),activeDays:Object.values(n).filter(e=>e>0).length,firstSessionDate:e.timeRange?.first||null}},[e,i,r]),h=(0,_.useMemo)(()=>ke(e?.topProjects||[]),[e?.topProjects]);if(!e&&(t||o||n?.phase===`discovering`))return(0,V.jsx)(Vt,{scanStatus:n,hasCachedInsights:!!n?.hasCachedResults});if(!e)return(0,V.jsx)(Bt,{});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())/ut):0,b=r?.sessions??e.totalSessions,x=Math.max(0,b-e.totalSessions),S=!!(n?.running&&n?.hasCachedResults),C=n?.cachedAt?E(n.cachedAt):``,w=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:[C?`Snapshot from ${C} ago.`:`Using the latest cached scan.`,` `,w?`Refreshing ${w} 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)(kt,{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)(Dt,{sessionsPerDay:e.sessionsPerDay||{}})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:[(0,V.jsx)(At,{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)(At,{icon:`⚡`,label:`Avg / Active Day`,value:`${g} sessions`,sub:`${p} active day${p===1?``:`s`}`}),(0,V.jsx)(At,{icon:`💬`,label:`Avg / Session`,value:`${v} prompts`,sub:s.sessions>0?`~${ee(s.durationMs/s.sessions)} each`:void 0}),d?(0,V.jsx)(At,{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)(At,{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)(Mt,{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)(Pt,{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)(Ft,{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)(It,{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)(Lt,{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)(Rt,{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)(zt,{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`,` ·`,` `,W(s.durationMs),` total · `,St(s.toolCalls),` tool calls`]})})]})})}var Wt=[{level:`basic`,label:`basic`},{level:`details`,label:`details`},{level:`counts`,label:`counts`},{level:`metrics`,label:`metrics`}];function Gt(e){return!!(e.title||e.prompts&&e.prompts.length>1||e.model||e.gitBranch||e.promptCount!=null||e.toolCallCount!=null||e.durationMsEst!=null||e.editCountEst!=null)}function Kt(e,t){return t?.promptCount!=null||t?.toolCallCount!=null||e.promptCount!=null||e.toolCallCount!=null}function qt(e){return!!(e&&(e.filesModified&&e.filesModified.length>0||(e.editCount??0)>0||e.durationMs||e.costEstimate||(e.apiErrorCount??0)>0||(e.compactionCount??0)>0||(e.subAgentCount??0)>0||e.tokenUsage||e.prLinks?.length))}function Jt(e,t){return qt(t)?{level:`metrics`,label:`metrics ready`,description:`Rich scan metrics are available: files, edits, duration, errors, cost, tokens, or PR links.`,className:`bg-terminal-green-subtle text-terminal-green`}:t||Kt(e,t)?{level:`counts`,label:`counts ready`,description:`Prompt/tool counts are available, but richer metrics may still be deferred.`,className:`bg-terminal-green-subtle text-terminal-green`}:Gt(e)?{level:`details`,label:`details ready`,description:`Discovery has richer title, prompt previews, model, or lightweight counts for this session.`,className:`bg-terminal-purple-subtle text-terminal-purple`}:{level:`basic`,label:`basic`,description:`Only lightweight discovery data is available so far.`,className:`bg-terminal-surface-2 text-terminal-dimmer`}}function Yt({state:e,compact:t=!1,active:n=!1}){return(0,V.jsxs)(`span`,{className:`relative inline-flex items-center gap-1 overflow-hidden font-mono rounded-md ${e.className} ${n?`ring-1 ring-terminal-blue/25`:``} ${t?`text-[10px] px-1.5 py-0.5`:`text-xs px-1.5 py-0.5`}`,title:e.description,children:[n&&(0,V.jsx)(`span`,{className:`absolute inset-y-0 left-0 w-0.5 bg-terminal-blue animate-pulse`}),n&&(0,V.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-current animate-pulse`}),e.label]})}function Xt({ready:e,label:t,pendingLabel:n}){return(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono`,children:[(0,V.jsx)(`span`,{className:e?`text-terminal-green`:`text-terminal-dimmer`,children:e?`✓`:`○`}),(0,V.jsx)(`span`,{className:e?`text-terminal-dim`:`text-terminal-dimmer`,children:e?t:n})]})}function Zt({state:e,active:t=!1,compact:n=!1,className:r=``}){let i=Math.max(0,Wt.findIndex(t=>t.level===e.level)),a=Math.max(12,(i+1)/Wt.length*100);return(0,V.jsxs)(`div`,{className:r,title:e.description,children:[(0,V.jsx)(`div`,{className:`flex items-center gap-1.5`,children:Wt.map((e,r)=>{let a=r<=i;return(0,V.jsxs)(`div`,{className:`flex items-center gap-1 min-w-0`,children:[(0,V.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full shrink-0 ${a?t&&r===i?`bg-terminal-blue animate-pulse`:`bg-terminal-green`:`bg-terminal-surface-2`}`}),!n&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono uppercase tracking-wide ${a?`text-terminal-dim`:`text-terminal-dimmer`}`,children:e.label}),r<Wt.length-1&&(0,V.jsx)(`span`,{className:`h-px w-4 shrink-0 ${r<i?`bg-terminal-green/50`:`bg-terminal-surface-2`}`})]},e.level)})}),(0,V.jsx)(`div`,{className:`mt-1.5 h-1 overflow-hidden rounded-full bg-terminal-bg ${n?`max-w-32`:`w-full`}`,children:(0,V.jsx)(`div`,{className:`h-full rounded-full transition-all duration-500 ${t?`bg-terminal-blue animate-pulse`:`bg-terminal-green`}`,style:{width:`${a}%`}})}),!n&&(0,V.jsx)(`div`,{className:`mt-1 text-[10px] font-mono text-terminal-dimmer`,children:t?`Fetching richer local session data...`:e.description})]})}function Qt({status:e,title:t,description:n}){let r=e?.total??0,i=e?.processed??0,a=r>0?Math.max(4,Math.min(100,Math.round(i/r*100))):35;return(0,V.jsx)(`div`,{className:`rounded-lg border border-terminal-blue/20 bg-terminal-blue-subtle/95 px-3 py-2 text-terminal-blue shadow-layer-md backdrop-blur-sm`,children:(0,V.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,V.jsx)(`div`,{className:`mt-1.5 h-1.5 w-1.5 rounded-full bg-terminal-blue animate-pulse shrink-0`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,V.jsx)(`div`,{className:`text-xs font-mono truncate`,children:t}),r>0&&(0,V.jsxs)(`div`,{className:`text-[10px] font-mono tabular-nums text-terminal-blue/75`,children:[i,`/`,r]})]}),(0,V.jsx)(`div`,{className:`mt-0.5 text-[10px] font-mono text-terminal-blue/70 leading-relaxed`,children:n}),(0,V.jsx)(`div`,{className:`mt-2 h-1 overflow-hidden rounded-full bg-terminal-bg/60`,children:(0,V.jsx)(`div`,{className:`h-full rounded-full bg-terminal-blue transition-all duration-500 animate-pulse`,style:{width:`${a}%`}})})]})]})})}function $t(e){return(0,V.jsx)(`div`,{className:`fixed right-4 bottom-20 z-50 w-[calc(100vw-2rem)] max-w-sm pointer-events-none animate-in fade-in slide-in-from-bottom-2 duration-300`,children:(0,V.jsx)(Qt,{...e})})}function en(){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,m]=(0,_.useState)(null),h=(0,_.useRef)(!1),g=(0,_.useRef)(void 0),v=(0,_.useMemo)(()=>e.some(e=>e.provider===`cursor`),[e]),y=(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=C(e),o=C(n);i?.sessions.length&&t(i.sessions),o?.sessions.length&&r(o.sessions),(i?.sessions.length||o?.sessions.length)&&a(!1);let c=w(i?.cachedAt),u=w(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),Ce(`/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(Ce(`/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)(()=>{y()},[y]),(0,_.useEffect)(()=>{if(!o&&!v&&!h.current)return;let e=!1,n,r=async()=>{let n=C(await fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null));!e&&n?.sessions.length&&n.cachedAt!==g.current&&(g.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||(m(t),t.running?(h.current=!0,await r()):h.current&&(h.current=!1,await r(),n&&=(window.clearInterval(n),void 0)))};return i(),n=window.setInterval(()=>{i()},2500),()=>{e=!0,n&&window.clearInterval(n)}},[v,o]),{sources:e,setSources:t,replays:n,loading:i,loadingSources:o,loadingReplays:c,enrichmentStatus:p,error:u}}function tn(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 Set;for(let t of e)o.add(t.project);for(let e of t)o.add(e.project);let s={};for(let t of e){let e=ze(t.timestamp);e&&(s[e]=(s[e]||0)+1)}let c=e.length,l=t.length,u=e.filter(e=>e.existingReplay).length,d=c>0?u/c*100:0;return{totalSessions:c,totalReplays:l,totalPrompts:n,totalToolCalls:r,totalDuration:i,projectCount:o.size,sessionsPerDay:s,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:d}}function nn(e){return{project:e,sessions:0,cost:0,prompts:0,durationMs:0,toolCalls:0,edits:0,branchCount:0,prCount:0,memoryFileCount:0,lastActivity:``,sessionsPerDay:{},branches:new Set}}function rn(e,t){let n=new Map,r=new Map(t.map(e=>[e.slug,e])),i=new Set,a=e=>{let t=n.get(e);if(t)return t;let r=nn(e);return n.set(e,r),r},o=(e,t)=>{t>e.lastActivity&&(e.lastActivity=t);let n=ze(t);n&&(e.sessionsPerDay[n]=(e.sessionsPerDay[n]||0)+1)};for(let t of e){let e=r.get(t.slug);e&&i.add(e.slug);let n=a(t.project);n.sessions+=1,n.cost+=e?.stats.costEstimate??0,n.prompts+=t.promptCount??t.prompts?.length??(t.firstPrompt.trim()?1:0),n.toolCalls+=Math.max(t.toolCallCount??0,e?.stats.toolCalls??0),n.durationMs+=t.durationMsEst??e?.stats.durationMs??0,n.edits+=t.editCountEst??0,t.gitBranch&&n.branches.add(t.gitBranch),t.hasPR&&(n.prCount+=1),o(n,t.timestamp)}for(let e of t){if(i.has(e.slug))continue;let t=a(e.project);t.sessions+=1,t.cost+=e.stats.costEstimate??0,t.prompts+=e.stats.userPrompts??0,t.toolCalls+=e.stats.toolCalls??0,t.durationMs+=e.stats.durationMs??0,o(t,e.startTime)}return ke([...n.values()].map(({branches:e,...t})=>({...t,branchCount:e.size})))}var an=6,on=300*1e3;function sn({children:e}){return(0,V.jsxs)(`span`,{className:`instant-tooltip inline-flex h-4 w-4 items-center justify-center rounded-full border border-terminal-border-subtle text-[10px] font-mono text-terminal-dimmer`,children:[`?`,(0,V.jsx)(`span`,{className:`instant-tooltip-text w-64 text-left`,children:e})]})}function cn(e){let t=Date.parse(e.timestamp);return Number.isFinite(t)&&Date.now()-t<on}function ln(e){let t=new Date(e);return t.setHours(0,0,0,0),t}function un(e){let t=ln(e),n=(t.getDay()+6)%7;return t.setDate(t.getDate()-n),t}function dn(){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:an},(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 fn({sessions:e,isLoading:t,enrichmentStatus:n,onGenerate:r,onViewReplay:i,onSessionClick:a,generatingSlug:o,generateErrorSlug:s}){if(e.length===0)return(0,V.jsx)(`div`,{className:`text-center py-6 text-terminal-dimmer text-xs font-mono`,children:t?`Loading recent sessions...`:`No sessions found. Start Claude, Cursor, or Codex.`});let c=(e,t=!1)=>{let n=!!e.existingReplay,a=o===e.slug,c=s===e.slug,l=t?`h-8 px-3.5`:`h-7 px-3`;return n?(0,V.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),i(e.existingReplay)},className:`${l} 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 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`})}),t?`Open replay`:`Open`]}):(0,V.jsx)(`button`,{onClick:t=>{t.stopPropagation(),r(e)},disabled:a,className:`${l} text-xs font-sans font-semibold rounded-md transition-all duration-200 disabled:opacity-50 flex items-center gap-1 shrink-0 ${c?`bg-terminal-red-subtle text-terminal-red`:`bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis`}`,children:a?(0,V.jsx)(`span`,{className:`animate-pulse`,children:t?`Generating...`:`...`}):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`]})})},l=e=>`${e.provider}-${e.project}-${e.slug}`,u=e.find(e=>!e.existingReplay&&!cn(e))??e.find(e=>!e.existingReplay)??e[0],d=l(u),f=e.filter(e=>l(e)!==d),p=Jt(u,null),m=!!n?.running&&u.provider===`cursor`,h=u.promptCount??u.prompts?.length??0,g=u.toolCallCount??u.replay?.stats.toolCalls??0,_=!!u.existingReplay,v=cn(u);return(0,V.jsxs)(`div`,{className:`space-y-3 flex-1 flex flex-col`,children:[(0,V.jsx)(`div`,{onClick:()=>a(u),className:`rounded-xl border bg-terminal-bg/55 px-3 py-3 cursor-pointer transition-all duration-200 hover:bg-terminal-bg/80 ${_?`border-terminal-green/25 hover:border-terminal-green/45`:`border-terminal-blue/25 hover:border-terminal-blue/45`}`,children:(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(He,{provider:u.provider}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-[10px] font-mono uppercase tracking-wider ${_?`bg-terminal-green-subtle text-terminal-green`:`bg-terminal-blue-subtle text-terminal-blue`}`,children:_?`Recent replay`:v?`Current activity`:`Suggested next`}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:te(u.timestamp)}),m&&(0,V.jsx)(Yt,{state:p,active:!0,compact:!0})]}),(0,V.jsx)(`p`,{className:`mt-1 text-sm font-sans font-semibold text-terminal-text truncate`,children:se(u)}),(0,V.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] font-mono text-terminal-dimmer`,children:[(0,V.jsx)(`span`,{className:`truncate`,children:j(u.project)}),h>0&&(0,V.jsxs)(`span`,{children:[h,` prompts`]}),g>0&&(0,V.jsxs)(`span`,{children:[g,` tools`]}),(0,V.jsx)(`span`,{className:_?`text-terminal-green`:`text-terminal-blue`,children:_?`generated`:`not generated`})]})]}),c(u,!0)]})}),(0,V.jsx)(`div`,{className:`space-y-1`,children:f.map(e=>{let t=!!n?.running&&e.provider===`cursor`,r=Jt(e,null);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)(He,{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:se(e)}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,V.jsx)(`p`,{className:`text-[11px] font-mono text-terminal-dimmer truncate`,children:j(e.project)}),t&&(0,V.jsx)(Yt,{state:r,active:!0,compact:!0})]})]}),(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:te(e.timestamp)}),c(e)]})]},l(e))})})]})}function pn({replays:e,isLoading:t,onOpen:n}){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.jsx)(`div`,{className:`space-y-1 flex-1 flex flex-col`,children:e.map(e=>(0,V.jsxs)(`button`,{onClick:()=>n(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)(He,{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:L(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:W(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:te(e.startTime)})]})]},e.slug))})}var mn=[{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 hn(){let[e,t]=(0,_.useState)(()=>mn.map(e=>({...e,installed:!1,detail:`checking...`,loading:!0})));(0,_.useEffect)(()=>{let e=!1;for(let n of mn)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}},[]);let n=e.some(e=>e.loading),r=e.filter(e=>!e.loading&&!e.installed);return n?(0,V.jsx)(`div`,{className:`bg-terminal-surface rounded-xl px-4 py-3 shadow-layer-sm`,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono text-terminal-dim`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),`Checking local replay tools...`]})}):r.length===0?(0,V.jsx)(`div`,{className:`bg-terminal-surface rounded-xl px-4 py-3 shadow-layer-sm`,children:(0,V.jsxs)(`div`,{className:`flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:`System Ready`}),(0,V.jsx)(`p`,{className:`mt-0.5 text-[10px] font-mono text-terminal-dimmer`,children:`Local replay tooling is available.`})]}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-green`,children:`all checks passed`})]})}):(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 Attention Needed`}),(0,V.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-2`,children:r.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 gn({onNavigate:e}){let{sources:t,setSources:n,replays:r,loading:i,loadingSources:a,loadingReplays:o,enrichmentStatus:s,error:c}=en(),l=(0,_.useMemo)(()=>tn(t,r),[t,r]),{userInsights:u}=at(),[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]=(0,_.useState)(0),[T,E]=(0,_.useState)(`today`),D=(0,_.useRef)(``),O=(0,_.useRef)(null),k=(0,_.useRef)(null),A=h?t.find(e=>e.slug===h)??null:null,ne=(0,_.useMemo)(()=>rn(t,r),[t,r]),N=(0,_.useMemo)(()=>u?ke(u.topProjects):[],[u]),P=N.length>0?N:ne,re=a&&P.length===0,ie=Math.max(l.projectCount,u?.totalProjects??0),ae=Math.max(l.totalPrompts,u?.totalPrompts??0),F=Math.max(l.totalToolCalls,u?.totalToolCalls??0),oe=Object.keys(l.sessionsPerDay).length>0?l.sessionsPerDay:u?.sessionsPerDay??{},I=new Date,ce=T===`today`?ln(I):un(I),L=ce.getTime(),le=t.filter(e=>{let t=new Date(e.timestamp).getTime();return Number.isFinite(t)&&t>=L&&t<=I.getTime()}),ue=le.length,de=new Set(le.map(e=>e.project)).size,fe=le.reduce((e,t)=>e+(t.promptCount??t.prompts?.length??0),0),pe=le.reduce((e,t)=>e+(t.toolCallCount??t.replay?.stats.toolCalls??0),0),me=l.recentSources[0]?.timestamp,he=T===`today`?`Today`:`This week`,ge=T===`today`?I.toLocaleDateString(`en-US`,{weekday:`short`,month:`short`,day:`numeric`}):`${ce.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})}–${I.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})}`,_e=e=>{R({view:null,session:e})},ve=async e=>{f(e.slug),m(null);try{let t=se(e),n=await Ce(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,filePaths:e.filePaths,toolPaths:e.toolPaths,title:M(t)||void 0,sessionSlug:e.slug,sessionProject:e.project})}),r=await n.json();if(!n.ok)throw Error(r.error||`Generation failed`);R({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)}},ye=async(e,t)=>{g(null),f(e.slug),m(null);try{let n=await Ce(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,filePaths:e.filePaths,toolPaths:e.toolPaths,title:M(t)||void 0,sessionSlug:e.slug,sessionProject:e.project})}),r=await n.json();if(!n.ok)throw Error(r.error||`Generation failed`);R({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)=>{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))},be=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{}},xe=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)}},Se=()=>{xe()},B=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{}O.current&&clearInterval(O.current),k.current&&clearTimeout(k.current),O.current=setInterval(async()=>{try{(await(await fetch(`/api/auth/get-session`)).json())?.session&&(O.current&&=(clearInterval(O.current),null),k.current&&=(clearTimeout(k.current),null),window.dispatchEvent(new Event(`vibe-auth-change`)),xe())}catch{}},2e3),k.current=setTimeout(()=>{O.current&&=(clearInterval(O.current),null),y(`idle`),x(null)},180*1e3)};(0,_.useEffect)(()=>()=>{O.current&&clearInterval(O.current),k.current&&clearTimeout(k.current)},[]),(0,_.useEffect)(()=>{if(a||l.recentSources.length===0)return;let e=l.recentSources.filter(e=>e.provider===`cursor`).slice(0,10);if(e.length===0)return;let t=e.map(e=>e.slug),n=e.map(e=>e.sessionId).filter(e=>typeof e==`string`&&e.length>0),r=[...new Set(e.map(e=>e.project))].slice(0,5),i=JSON.stringify({slugs:t});D.current!==i&&(D.current=i,fetch(`/api/sources/enrich`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({slugs:t,sessionIds:n,projects:r,limit:Math.max(10,e.length)})}).catch(()=>{}))},[l.recentSources,a]),(0,_.useEffect)(()=>{if(!S)return;let e=setInterval(()=>w(e=>e+1),3e4);return()=>clearInterval(e)},[S]);let we=(()=>{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.jsx)($t,{title:`Fetching local sessions`,description:`Loading cached sessions first, then enriching recent Cursor details in place.`}),(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))})]})}):c&&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:c})})}):(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-5 space-y-5`,children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 lg:grid-cols-[minmax(280px,0.72fr)_minmax(0,1.28fr)] lg: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:`mb-3 flex min-h-7 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(`h2`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:he}),(0,V.jsx)(sn,{children:`Short-term local activity for the selected window. Use this to see whether recent AI work is still actively flowing before jumping into sessions.`})]}),(0,V.jsx)(`div`,{className:`inline-flex h-7 shrink-0 items-center rounded-xl bg-terminal-bg p-0.5 shadow-layer-sm`,children:[`today`,`week`].map(e=>(0,V.jsx)(`button`,{onClick:()=>E(e),className:`h-6 rounded-lg px-3 text-xs font-sans font-semibold transition-all duration-200 ${T===e?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text`}`,children:e===`today`?`Today`:`Week`},e))})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,V.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg px-3 py-2`,children:[(0,V.jsx)(`div`,{className:`text-xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,V.jsx)(Re,{value:ue})}),(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold uppercase tracking-widest text-terminal-dimmer`,children:`sessions`})]}),(0,V.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg px-3 py-2`,children:[(0,V.jsx)(`div`,{className:`text-xl font-mono font-bold text-terminal-blue tabular-nums`,children:(0,V.jsx)(Re,{value:de})}),(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold uppercase tracking-widest text-terminal-dimmer`,children:`projects`})]}),(0,V.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg px-3 py-2`,children:[(0,V.jsx)(`div`,{className:`text-xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,V.jsx)(Re,{value:fe})}),(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold uppercase tracking-widest text-terminal-dimmer`,children:`turns`})]}),(0,V.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg px-3 py-2`,children:[(0,V.jsx)(`div`,{className:`text-xl font-mono font-bold text-terminal-orange tabular-nums`,children:(0,V.jsx)(Re,{value:pe})}),(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold uppercase tracking-widest text-terminal-dimmer`,children:`tools`})]})]}),(0,V.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-between gap-2 text-[10px] font-mono text-terminal-dimmer`,children:[(0,V.jsx)(`span`,{children:ge}),(0,V.jsx)(`span`,{children:me?`latest ${te(me)}`:`No activity yet`})]})]}),(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col`,children:[(0,V.jsxs)(`div`,{className:`mb-3 flex min-h-7 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(`h2`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:`Activity Insights`}),(0,V.jsx)(sn,{children:`Long-term local AI coding totals and contribution-style activity across this machine. Cached data appears first, then provider scans enrich details in place.`})]}),(0,V.jsxs)(`div`,{className:`inline-flex h-7 shrink-0 items-center rounded-xl bg-terminal-bg p-0.5 shadow-layer-sm`,children:[(0,V.jsx)(`button`,{onClick:()=>e(`insights`),className:`h-6 rounded-lg px-3 text-xs font-sans font-semibold text-terminal-dim transition-all duration-200 hover:text-terminal-text`,children:`Insights`}),(0,V.jsx)(`button`,{onClick:Se,disabled:v===`syncing`||v===`awaitingLogin`,className:`h-6 rounded-lg px-3 text-xs font-sans font-semibold transition-all duration-200 disabled:cursor-wait disabled:opacity-50 ${v===`done`?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:v===`error`?`bg-terminal-red-subtle text-terminal-red shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text`}`,title:b||void 0,children:v===`syncing`?`Syncing...`:v===`done`&&we?`\u2713 ${we}`:v===`error`?`Failed`:v===`awaitingLogin`?`Waiting...`:`↑ Sync`})]})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 md:grid-cols-4`,children:[(0,V.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg px-3 py-2`,children:[(0,V.jsx)(`div`,{className:`text-xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,V.jsx)(Re,{value:l.totalSessions})}),(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest`,children:`sessions`})]}),(0,V.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg px-3 py-2`,children:[(0,V.jsx)(`div`,{className:`text-xl font-mono font-bold text-terminal-blue tabular-nums`,children:(0,V.jsx)(Re,{value:ie})}),(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest`,children:`projects`})]}),(0,V.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg px-3 py-2`,children:[(0,V.jsx)(`div`,{className:`text-xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,V.jsx)(Re,{value:ae})}),(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest`,children:`turns`})]}),(0,V.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg px-3 py-2`,children:[(0,V.jsx)(`div`,{className:`text-xl font-mono font-bold text-terminal-orange tabular-nums`,children:(0,V.jsx)(Re,{value:F})}),(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest`,children:`tool calls`})]})]}),(0,V.jsx)(`div`,{className:`mt-3 flex-1 rounded-lg bg-terminal-bg/70 p-2.5`,children:(0,V.jsx)(Dt,{sessionsPerDay:oe,weeks:52,showLegend:!1})})]})]}),(a||s?.running&&s.total>0)&&(0,V.jsx)($t,{status:s?.running?s:null,title:a?`Refreshing local session list`:`Loading more local session details`,description:a?`Home is using cached data while local providers refresh in the background.`:`Recent sessions will update in place as titles, prompt previews, counts, and metrics become available.`}),(0,V.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-[minmax(0,1.25fr)_minmax(320px,0.75fr)] 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.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:`Recent Sessions`}),(0,V.jsx)(sn,{children:`Pick up the sessions most likely to need your next action.`})]}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:[l.totalSessions,` total`]})]}),(0,V.jsx)(`div`,{className:`flex flex-1 flex-col justify-between`,children:(0,V.jsx)(fn,{sessions:l.recentSources,isLoading:a,enrichmentStatus:s,onGenerate:ve,onViewReplay:_e,onSessionClick:e=>g(e.slug),generatingSlug:d,generateErrorSlug:p})}),(0,V.jsx)(`button`,{onClick:()=>e(`sessions`),className:`mt-auto w-full py-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 sessions →`})]}),(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.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:`Recent Replays`}),(0,V.jsx)(sn,{children:`Open something already generated.`})]}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:[l.totalReplays,` total`]})]}),(0,V.jsx)(`div`,{className:`flex flex-1 flex-col justify-between`,children:(0,V.jsx)(pn,{replays:l.recentReplays,isLoading:o,onOpen:_e})}),(0,V.jsx)(`button`,{onClick:()=>e(`replays`),className:`mt-auto w-full py-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 replays →`})]})]}),re?(0,V.jsx)(dn,{}):P.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.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:`Project Shortcuts`}),(0,V.jsx)(sn,{children:`Jump back into the projects with recent AI work.`})]}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:[ie,` total`]})]}),(0,V.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2`,children:[...P].sort((e,t)=>(t.lastActivity||``).localeCompare(e.lastActivity||``)).slice(0,an).map(t=>(0,V.jsxs)(`button`,{onClick:()=>{e(`sessions`),setTimeout(()=>{R({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:j(t.project)}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[t.sessions,` session`,t.sessions>1?`s`:``,` ·`,` `,te(t.lastActivity),t.durationMs>0&&` · ${ee(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))}),P.length>an&&(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)(hn,{})]}),A&&(0,V.jsx)(_r,{session:A,onClose:()=>g(null),onGenerate:ye,onViewReplay:e=>R({view:null,session:e}),onArchive:e=>{fetch(`/api/archive/${e}`,{method:`POST`}).catch(()=>{}),g(null)},onTitleSave:z,onDeleteReplay:be,isGenerating:d===A.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:B,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 _n=null,vn=null,yn=0,bn=4e3;function xn(){let[e,t]=(0,_.useState)(_n??[]),[n,r]=(0,_.useState)(_n===null&&vn===null),[i,a]=(0,_.useState)(_n===null?vn: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}`);_n=(await n.json()).results??[],yn=_n.length,vn=null,e||(t(_n),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;(_n===null||n!==yn)&&await i()}catch(t){let n=t instanceof Error?t.message:`Failed to load`;vn=n,!e&&_n===null&&a(n)}finally{e||r(!1),!e&&t&&(n=setTimeout(s,bn))}}return s(),()=>{e=!0,n&&clearTimeout(n)}},[]),{sessions:e,loading:n,error:i}}function Sn(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=Cn(e)?-10:0,l=t+n+r+i+a+o+s+c;return Math.max(0,Math.min(100,l*4))}function Cn(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 wn(e){return e?new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`}):``}function Tn(e){return e?new Date(e).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!1}):``}function En(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 Dn(e){return M(ie(e.title||``))||M(ie(e.firstPrompt||``))||e.slug}function On(e){return e.durationMs==null?!0:(e.dataQualityNotes||[]).some(e=>/duration is inferred|duration.*estimated|missing duration/i.test(e))}function kn(e){let t=[me(e.provider)],n=e.dataSource?Te(!1,e.dataSource):``;return n&&t.push(n),On(e)&&t.push(`estimated time`),t}function An(e){window.dispatchEvent(new CustomEvent(`vibe-open-session`,{detail:{slug:e}}))}function jn(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 Mn=[{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 Nn(e){return Mn[e%Mn.length]}function Pn(e,t={}){let n=new Map;for(let r of e){let e=t.collapseWorktrees?Oe(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=Qn(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 Fn=4,In=5,Ln=10,Rn=72,zn=40,Bn=14,Vn=12,Hn=6,Un=8,Wn=140,Gn=1100;function Kn(e){return e>=60?.24:.16}function qn(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 Jn(e){return e>=60?.95:.78}function Yn(e){return Un+Math.sqrt(Math.max(0,Math.min(100,e))/100)*(Wn-Un)}function Xn(e){return Ln+Math.max(0,Math.min(100,e))/100*(Rn-Ln)}function Zn(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:In;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 Qn(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 $n(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=Qn(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/Gn,f=new Map,p=0;for(let e of a){if(e.endMs<c||e.startMs>l)continue;if(!r&&Cn(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=Sn(e),i=Yn(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}=Zn(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=Yn(e.score),d=o/100*Gn,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:Xn(e.score),fillAlpha:Kn(e.score),opacity:Jn(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},()=>Ln);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+Fn;let i=r+4,c=Math.max(i,zn),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 er=[{value:`1d`,label:`1D`,days:1},{value:`7d`,label:`7D`,days:7},{value:`30d`,label:`30D`,days:30},{value:`all`,label:`All`}];function tr(e){let t=er.find(t=>t.value===e);if(!t||t.days==null)return{};let n=Date.now();return{start:n-t.days*864e5,end:n}}function nr({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)(()=>tr(t),[t]),{projects:f,ticks:p,totalSessions:m,hiddenAutomatedCount:h}=(0,_.useMemo)(()=>$n(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)On(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:er.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 `,jn(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=Nn(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:j(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=Cn(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-Hn)/Vn)),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:qn(r,n.fillAlpha)},"aria-label":`Open ${Dn(n.session)}`,onClick:()=>An(n.session.slug),onMouseEnter:e=>{o({session:n.session,x:e.clientX,y:e.clientY})},onMouseLeave:()=>o(null),children:[n.heightPx>=Bn&&(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:Dn(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:Dn(a.session)}),(0,V.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-1`,children:kn(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=Qn(e,a.session),n=a.session.startTime,r=new Date(t).toISOString(),i=wn(n)===wn(r);return(0,V.jsxs)(`div`,{children:[wn(n),` `,Tn(n),t!==e&&(0,V.jsxs)(`span`,{children:[` → `,i?``:`${wn(r)} `,Tn(r)]})]})})(),a.session.durationMs&&(0,V.jsx)(`div`,{className:`text-terminal-blue`,children:En(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 rr(e,t){let n=t.replace(/\/$/,``);return n&&e.startsWith(`${n}/`)?e.slice(n.length+1):e.split(`/`).slice(-3).join(`/`)}function ir(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:rr(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 ar({groups:e,hideProjectList:t}){let n=(0,_.useMemo)(()=>ir(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:j(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:j(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:()=>An(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:Nn(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:Dn(e.session)}),(0,V.jsxs)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-0.5`,children:[j(e.session.project),` · `,wn(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 or({view:e,projectFilter:t}){let{sessions:n,loading:r,error:i}=xn(),a=(0,_.useMemo)(()=>t?n.filter(e=>Oe(e.project)===t):n,[n,t]),o=(0,_.useMemo)(()=>Pn(a,{collapseWorktrees:!0}),[a]),s=(0,_.useMemo)(()=>{let e=new Map;for(let t of a){let n=me(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=>On(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:En(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)(nr,{groups:o}),e===`files`&&(0,V.jsx)(ar,{groups:o,hideProjectList:!!t})]})]})}var sr=[{id:`overview`,label:`Overview`},{id:`timeline`,label:`Timeline`},{id:`files`,label:`Hot Files`}];function cr({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[ze(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 lr({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(je),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=j(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:Qe(e.lastActivity,`long`)})]},e.project)})]})]})}function ur({project:e,insight:t,onOpenSessions:n}){let r=j(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:Qe(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)(dr,{label:H(t.sessions,`session`),value:t.sessions.toString(),tone:`text`}),t.durationMs>0&&(0,V.jsx)(dr,{label:`active time`,value:W(t.durationMs),tone:`blue`}),t.cost>0&&(0,V.jsx)(dr,{label:`cost`,value:`$${t.cost.toFixed(2)}`,tone:`orange`}),(0,V.jsx)(dr,{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)(cr,{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 dr({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 fr({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=j(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:Qe(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:W(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)(cr,{sessionsPerDay:e.sessionsPerDay})]},e.project)})})}function pr({onNavigate:e}){let{userInsights:t,scanStatus:n}=at(),[r,i]=(0,_.useState)(je),[a,o]=(0,_.useState)(`overview`),s=(0,_.useMemo)(()=>{if(!t)return[];let e=ke(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(()=>R({tab:`sessions`,project:t}),50)},d=s.map(e=>({project:e.project,sessions:e.sessions,lastActivity:e.lastActivity})),f=r!==je,p=f?sr.filter(e=>e.id!==`timeline`):sr,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)(lr,{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:je,children:[`All projects (`,s.length,`)`]}),s.map(e=>(0,V.jsxs)(`option`,{value:e.project,children:[j(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`:j(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)(fr,{projects:s,onProjectClick:i}),m===`overview`&&c&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ur,{project:r,insight:c,onOpenSessions:()=>u(r)}),(0,V.jsx)(or,{view:`timeline`,projectFilter:h})]}),m===`timeline`&&(0,V.jsx)(or,{view:`timeline`,projectFilter:h}),m===`files`&&(0,V.jsx)(or,{view:`files`,projectFilter:h})]})]})]})}var mr=null,hr=null;function gr(){return mr?Promise.resolve(mr):hr||(hr=fetch(`/api/scan/results`).then(e=>e.ok?e.json():null).then(e=>{let t=e?.results??null;return mr=t,setTimeout(()=>{mr=null,hr=null},3e4),t}).catch(()=>null),hr)}function _r({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,p]=(0,_.useState)(!t),m=se(e),h=ce(e,u),[g,v]=(0,_.useState)(e.replay?.title||h),[y,b]=(0,_.useState)(!1),x=(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=x.current;e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length))},[]),(0,_.useEffect)(()=>{d(t)},[t]),(0,_.useEffect)(()=>{if(t){p(!1);return}let n=!1;return p(!0),gr().then(t=>{if(n)return;let r=t?.find(t=>t.slug===e.slug);r&&d(r),p(!1)}),()=>{n=!0}},[t,e.slug]),(0,_.useEffect)(()=>{v(t=>{let n=M(t),r=M(h),i=M(e.replay?.title);return!n||n===i||n===e.slug||r&&n===M(m)?e.replay?.title||h:t})},[m,h,e.replay?.title,e.slug]);let S=F(u?.gitBranch||e.gitBranch),C=u?.model||e.model,w=ae(e,u,h),T=u?.dataQualityNotes||[],E=Jt(e,u),ee=f&&!qt(u),ne=u?.promptCount??e.promptCount,N=u?.toolCallCount??e.toolCallCount,P=u?.editCount??e.editCountEst,re=u?.durationMs??e.durationMsEst,ie=u?.costEstimate??e.replay?.stats?.costEstimate,oe=u?.tokenUsage?u.tokenUsage.inputTokens+u.tokenUsage.outputTokens:void 0,I=u?.startTime||e.timestamp,L=async()=>{if(!e.replay||y)return;let t=M(g);if(t!==M(e.replay.title||h)){b(!0);try{await o(e.slug,t)}finally{b(!1)}}},R=()=>{r(e,g)};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)(He,{provider:e.provider}),(0,V.jsx)(Yt,{state:E,compact:!0}),C&&(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:k(C)}),(u?.dataSource||e.hasSdk)&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full ${ve(u?.dataSource,e.hasSqlite,e.hasSdk)}`,children:Te(e.hasSqlite,u?.dataSource,e.hasSdk)}),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?L():R()},children:(0,V.jsx)(`textarea`,{ref:x,value:g,onChange:e=>v(e.target.value.replace(/\n/g,``)),onBlur:()=>{e.replay&&L()},onKeyDown:t=>{t.key===`Enter`&&(t.preventDefault(),e.replay?L():R())},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:h,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)(Ge,{label:`Project`,value:j(e.project),title:e.project}),S&&(0,V.jsx)(Ge,{label:`Branch`,value:S}),u?.gitBranches&&u.gitBranches.length>1&&(0,V.jsx)(Ge,{label:`Branches`,value:u.gitBranches.join(`, `)}),u?.skillsUsed&&u.skillsUsed.length>0&&(0,V.jsx)(Ge,{label:`Skills`,value:u.skillsUsed.join(`, `)}),u?.mcpServersUsed&&u.mcpServersUsed.length>0&&(0,V.jsx)(Ge,{label:`MCP Servers`,value:u.mcpServersUsed.join(`, `)}),(0,V.jsx)(Ge,{label:`Started`,value:`${D(I)} (${te(I)})`}),u?.endTime&&(0,V.jsx)(Ge,{label:`Ended`,value:D(u.endTime)}),!!re&&(0,V.jsx)(Ge,{label:`Duration`,value:`~${W(re)}`}),(0,V.jsx)(Ge,{label:`Size`,value:A(e.fileSize)}),(0,V.jsx)(Ge,{label:`Lines`,value:e.lineCount.toLocaleString()}),e.filePaths.length>1&&(0,V.jsx)(Ge,{label:`Parts`,value:`${e.filePaths.length} files`}),(0,V.jsx)(Ge,{label:`Data`,value:Te(e.hasSqlite,u?.dataSource,e.hasSdk)})]}),(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`}),!!ne&&(0,V.jsx)(Ge,{label:`Prompts`,value:String(ne)}),!!N&&(0,V.jsx)(Ge,{label:`Tools`,value:String(N)}),!!P&&(0,V.jsx)(Ge,{label:`Edits`,value:u?String(P):`~${P}`}),ie!=null&&ie>0&&(0,V.jsx)(Ge,{label:`Cost`,value:O(ie)}),oe!=null&&(0,V.jsx)(Ge,{label:`Tokens`,value:oe.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)(Ge,{label:`Agents`,value:`${u.subAgentCount} sub-agents`}),u!=null&&u.compactionCount>0&&(0,V.jsx)(Ge,{label:`Compacts`,value:String(u.compactionCount)}),u!=null&&u.apiErrorCount>0&&(0,V.jsx)(Ge,{label:`Errors`,value:`${u.apiErrorCount} API errors`}),e.hasPR&&!u?.prLinks?.length&&(0,V.jsx)(Ge,{label:`PR`,value:`Yes`}),u?.prLinks?.map(e=>(0,V.jsx)(Ge,{label:`PR`,value:`#${e.prNumber} (${e.prRepository})`},e.prNumber))]})]}),(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl px-5 py-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-3`,children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer`,children:`Data Readiness`}),(0,V.jsx)(Yt,{state:E,active:ee})]}),(0,V.jsx)(Zt,{state:E,active:ee,className:`mb-3`}),(0,V.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-x-5 gap-y-2`,children:[(0,V.jsx)(Xt,{ready:!0,label:`Basic discovery loaded`,pendingLabel:`Waiting for discovery`}),(0,V.jsx)(Xt,{ready:Gt(e),label:`Title, prompt previews, or model enriched`,pendingLabel:`Title and prompt previews not enriched yet`}),(0,V.jsx)(Xt,{ready:Kt(e,u),label:`Prompt/tool counts loaded`,pendingLabel:`Prompt/tool counts not loaded yet`}),(0,V.jsx)(Xt,{ready:qt(u),label:`Rich metrics loaded`,pendingLabel:`Rich metrics deferred for this source`})]})]}),T.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:T.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`]})]})]}),w.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:w.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:A(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.sessionId&&(0,V.jsxs)(`button`,{onClick:()=>le(e.provider,e.sessionId),title:`Stream this source session as the provider writes new turns`,className:`h-11 px-5 text-sm font-sans font-semibold rounded-xl bg-terminal-red-subtle text-terminal-red hover:bg-terminal-red-emphasis transition-all duration-200 flex items-center gap-2`,children:[(0,V.jsxs)(`span`,{className:`relative flex w-2 h-2`,children:[(0,V.jsx)(`span`,{className:`absolute inline-flex h-full w-full rounded-full bg-terminal-red opacity-75 animate-ping`}),(0,V.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-red`})]}),`Watch live`]}),e.replay&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{onClick:()=>r(e,g),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:R,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 vr({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=Oe(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)(Ue,{slug:e.slug,title:e.title,fallbackTitle:L(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:L(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=>ie(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:W(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:O(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:A(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)(He,{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:D(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 yr(){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,b]=(0,_.useState)(()=>Date.now()),{selectedProject:x,filter:S,showArchived:D,handleProjectChange:O,handleFilterChange:ee,handleToggleArchived:ne}=Fe(),{scanStatus:N,userInsights:P,projectInsightsCache:re,fetchProjectInsights:ie}=at(),I=Oe(x);(0,_.useEffect)(()=>{I!==`__all__`&&ie(I)},[I,ie]);let se=I===`__all__`?void 0:re.get(I),[L,le]=(0,_.useState)(null),[ue,de]=(0,_.useState)(null),[fe,pe]=(0,_.useState)(null);(0,_.useEffect)(()=>{(()=>{let e=new URLSearchParams(window.location.search).get(`selected`);if(!e)return;pe(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;pe(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 me=(0,_.useRef)(!1),he=(0,_.useRef)(``),[ge,_e]=(0,_.useState)(new Set),[z,be]=(0,_.useState)(null),Se=e.some(e=>e.provider===`cursor`),B=fe?e.find(e=>e.slug===fe)??null:null,Ee=(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:[]}));_e(new Set(n.slugs));let r=!1,i=C(await fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null)),o=!e?.forceRefresh&&w(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 Ce(`/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(xe(e)||`Failed to load sessions`)}finally{d(!1),s(!1)}},[]),De=e=>ye(e,ge,_e);(0,_.useEffect)(()=>{Ee()},[Ee]),(0,_.useEffect)(()=>{if(e.length===0)return;let t=!1,n=async()=>{let e=await gr();t||!e||r(Object.fromEntries(e.filter(e=>e.slug).map(e=>[e.slug,e])))};n();let i=window.setInterval(()=>{n()},N?.running?5e3:3e4);return()=>{t=!0,window.clearInterval(i)}},[N?.running,e.length]),(0,_.useEffect)(()=>{if(!o&&!Se&&!me.current)return;let e=!1,n,r=async()=>{let n=C(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||(be(t),t.running?(me.current=!0,await r()):me.current&&(me.current=!1,await r(),n&&=(window.clearInterval(n),void 0)))};return i(),n=window.setInterval(()=>{i()},2500),()=>{e=!0,n&&window.clearInterval(n)}},[Se,o]),(0,_.useEffect)(()=>{let e=window.setInterval(()=>b(Date.now()),3e4);return()=>window.clearInterval(e)},[]);let ke=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))},Ae=async(e,t)=>{pe(null),le(e.slug),de(null);try{let n=await Ce(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,filePaths:e.filePaths,toolPaths:e.toolPaths,title:M(t)||void 0,sessionSlug:e.slug,sessionProject:e.project})}),r=await n.json();if(!n.ok)throw Error(r.error||`Generation failed`);R({view:null,session:r.slug})}catch(e){de(xe(e))}finally{le(null)}},Me=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{}},Ne=e.filter(e=>ge.has(e.slug)).length,Pe=D?e:e.filter(e=>!ge.has(e.slug)),Ie=new Map;for(let e of Pe){let t=Oe(e.project);Ie.has(t)||Ie.set(t,[]),Ie.get(t)?.push(e)}let Le=[...Ie.entries()].sort((e,t)=>{let n=e[1][0]?.timestamp||``;return(t[1][0]?.timestamp||``).localeCompare(n)}),Re=we(Le.map(([e])=>e)),ze=I===`__all__`?Pe:Ie.get(I)||[],Be=S?ze.filter(e=>e.slug.toLowerCase().includes(S.toLowerCase())||e.firstPrompt.toLowerCase().includes(S.toLowerCase())||(e.title||``).toLowerCase().includes(S.toLowerCase())||(e.gitBranch||``).toLowerCase().includes(S.toLowerCase())):ze,Ve=g?E(g,y):null,Ue=new Set(Be.slice(0,25).map(e=>e.slug));(0,_.useEffect)(()=>{if(o||Be.length===0)return;let e=Be.slice(0,25),t=e.map(e=>e.slug),n=e.map(e=>e.sessionId).filter(e=>typeof e==`string`&&e.length>0),r=I===`__all__`?[]:[I],i=JSON.stringify({slugs:t,selectedProjectKey:I});he.current!==i&&(he.current=i,fetch(`/api/sources/enrich`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({slugs:t,sessionIds:n,projects:r,limit:Math.max(30,e.length)})}).catch(()=>{}))},[Be,o,I]);let Ge=o&&e.length===0,Ke=e.filter(e=>e.expiresInDays!=null&&e.expiresInDays<=7&&!ge.has(e.slug)),qe=Ke.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 Ee({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&&!Ge?(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 Claude, Cursor, or Codex, 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`}),Ve&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:Ve})]}),(0,V.jsx)(`button`,{onClick:()=>{Ee({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:()=>O(je),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 ${x===`__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 ${x===`__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`}),Le.map(([e,t])=>{let n=t.filter(e=>e.existingReplay).length,r=I===e,i=Re.get(e)||j(e),a=t.some(e=>e.projectExists!==!1),o=t.some(e=>e.isGitRepo||e.gitBranch);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 ${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:te(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:x,onChange:e=>O(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:je,children:[`All projects (`,e.length,`)`]}),Le.map(([e,t])=>(0,V.jsxs)(`option`,{value:e,children:[Re.get(e)||j(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:se&&x!==`__all__`?(0,V.jsx)(ct,{insights:se,variant:`project`}):P&&x===`__all__`?(0,V.jsx)(ct,{insights:P,variant:`all`}):(0,V.jsx)(st,{})}),(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:S,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`})]}),Ne>0&&(0,V.jsx)(`button`,{onClick:ne,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 (${Ne} archived)`,children:D?`Active`:`View all`})]})]}),Ge?(0,V.jsx)($t,{title:`Fetching local sessions`,description:`Reading cached session lists first, then refreshing local providers in the background.`}):u?(0,V.jsx)($t,{title:`Scanning latest sessions`,description:f?`Showing stale cache (${T(f)}) while refreshing.`:`Refreshing provider session lists and lightweight metadata.`}):z?.running&&z.total>0?(0,V.jsx)($t,{status:z,title:`Loading richer details for visible sessions`,description:`Visible cards update in place as local data is enriched.`}):null,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:`×`})]}),ue&&(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:ue}),(0,V.jsx)(`button`,{onClick:()=>de(null),className:`ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors`,children:`×`})]}),Ke.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:[Ke.length,` session`,Ke.length===1?``:`s`,` expiring`,qe===0?` today`:qe===1?` tomorrow`:` within ${qe} 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:Ge?(0,V.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:`Fetching sessions...`}):Be.length===0?(0,V.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:S?`No sessions match your filter`:`No sessions in this project`}):(0,V.jsx)(`div`,{className:`space-y-2.5 px-4 py-3`,children:Be.map(e=>{let t=n[e.slug];if(e.replay){let n=ge.has(e.slug),r=ce(e,t),i=ae(e,t,r);return(0,V.jsx)(vr,{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:()=>R({view:null,session:e.existingReplay}),onShare:()=>R({view:null,session:e.existingReplay,v:`export`}),onTitleSave:ke,onRegenerate:()=>pe(e.slug),isRegenerating:L===e.slug,onDelete:()=>Me(e.slug),onArchive:()=>De(e.slug),isArchived:n},`${e.provider}-${e.slug}`)}let r=ce(e,t),i=ae(e,t,r),a=F(t?.gitBranch||e.gitBranch),o=Oe(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=Te(e.hasSqlite,t?.dataSource,e.hasSdk),m=!!z?.running&&Ue.has(e.slug)&&!qt(t),h=Jt(e,t),g=ge.has(e.slug);return(0,V.jsxs)(`div`,{onClick:()=>pe(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?`ring-1 ring-terminal-blue/20`:``} ${g?`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})]}),(0,V.jsx)(Yt,{state:h,compact:!0,active:m}),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:te(e.timestamp)}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(`button`,{onClick:t=>{t.stopPropagation(),pe(e.slug)},disabled:L===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:L===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)(We,{onArchive:()=>De(e.slug),isArchived:g})]})]})]}),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.isStarred||e.fsDetectedFiles&&e.fsDetectedFiles.length>0||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:[`~`,W(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.isStarred&&(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-orange-subtle text-terminal-orange`,title:`Starred in Claude Cowork`,children:`starred`}),e.fsDetectedFiles&&e.fsDetectedFiles.length>0&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim`,title:e.fsDetectedFiles.join(`
26
- `),children:[e.fsDetectedFiles.length,` files`]}),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)(He,{provider:e.provider}),x===`__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:Re.get(o)||Re.get(e.project)||j(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:k(f)}),e.spaceId&&(0,V.jsxs)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer`,title:e.spaceIdSetBy?`Cowork space ${e.spaceId} (${e.spaceIdSetBy})`:`Cowork space ${e.spaceId}`,children:[`space-`,oe(e.spaceId)]}),e.pluginsEnabled&&(0,V.jsx)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer`,title:`Claude Cowork plugins enabled`,children:`plugins`}),e.skillsEnabled&&(0,V.jsx)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer`,title:`Claude Cowork skills enabled`,children:`skills`}),(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:A(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||e.hasSdk||t?.dataSource)&&(0,V.jsx)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded-md ${ve(t?.dataSource,e.hasSqlite,e.hasSdk)}`,title:p,children:p})]})]},`${e.provider}-${e.slug}`)})})}),B&&(0,V.jsx)(_r,{session:B,scanData:n[B.slug]||null,onClose:()=>pe(null),onGenerate:Ae,onViewReplay:e=>R({view:null,session:e}),onArchive:e=>{De(e)},onTitleSave:ke,onDeleteReplay:Me,isGenerating:L===B.slug,isArchived:ge.has(B.slug)})]})]})}function br(){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,b]=(0,_.useState)(null),{selectedProject:x,filter:S,showArchived:D,handleProjectChange:O,handleFilterChange:k,handleToggleArchived:ee}=Fe(),{userInsights:A,projectInsightsCache:M,fetchProjectInsights:ne}=at(),N=Oe(x);(0,_.useEffect)(()=>{N!==`__all__`&&ne(N)},[N,ne]);let P=N===`__all__`?void 0:M.get(N);(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=C(await fetch(`/api/sessions/cached`).then(e=>e.ok?e.json():null).catch(()=>null)),c=w(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 Ce(`/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 re=e=>ye(e,m,h),ie=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))},ae=e=>{R({view:null,session:e})},F=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`)}},oe=async e=>{b(e.slug);try{let t=await Ce(`/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`);R({view:null,session:n.slug})}catch(e){console.error(`Regenerate error:`,z(e))}finally{b(null)}},I=e.filter(e=>m.has(e.slug)).length,se=D?e:e.filter(e=>!m.has(e.slug)),ce=new Map;for(let e of se){let t=Oe(e.project);ce.has(t)||ce.set(t,[]),ce.get(t)?.push(e)}let L=[...ce.entries()].sort((e,t)=>{let n=e[1][0]?.startTime||``;return(t[1][0]?.startTime||``).localeCompare(n)}),le=we(L.map(([e])=>e)),ue=N===`__all__`?se:ce.get(N)||[],de=S?ue.filter(e=>(e.title||``).toLowerCase().includes(S.toLowerCase())||e.slug.toLowerCase().includes(S.toLowerCase())||e.project.toLowerCase().includes(S.toLowerCase())||e.provider.toLowerCase().includes(S.toLowerCase())||(e.firstMessage||``).toLowerCase().includes(S.toLowerCase())):ue,fe=u?E(u,f):null,pe=n&&e.length===0;return!pe&&(!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)(Ke,{}),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`}),fe&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:fe})]})}),(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-2 space-y-0.5`,children:[(0,V.jsxs)(`button`,{onClick:()=>O(je),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 ${x===`__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 ${x===`__all__`?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer`}`,children:se.length})]}),(0,V.jsx)(`div`,{className:`h-px bg-terminal-border-subtle mx-2 my-1.5`}),L.map(([e,t])=>{let n=N===e,r=le.get(e)||j(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:te(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:x,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:je,children:[`All replays (`,se.length,`)`]}),L.map(([e,t])=>(0,V.jsxs)(`option`,{value:e,children:[le.get(e)||j(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:P&&x!==`__all__`?(0,V.jsx)(ct,{insights:P,variant:`project`}):A&&x===`__all__`?(0,V.jsx)(ct,{insights:A,variant:`all`}):(0,V.jsx)(st,{})}),(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:S,onChange:e=>k(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`})]}),I>0&&(0,V.jsx)(`button`,{onClick:ee,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 (${I} archived)`,children:D?`Active`:`View all`}),(0,V.jsx)(Ke,{})]}),(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:S,onChange:e=>k(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`})]}),I>0&&(0,V.jsx)(`button`,{onClick:ee,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 (${I} archived)`,children:D?`Active`:`View all`})]})]}),(pe||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:pe?(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 (`,T(c),`)`]})]}):c?(0,V.jsxs)(`span`,{children:[`Showing stale cache (`,T(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:pe?(0,V.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:`Fetching replays...`}):de.length===0?(0,V.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:S?`No replays match your filter`:`No replays in this project`}):(0,V.jsx)(`div`,{className:`space-y-2.5 px-4 py-3`,children:de.map(e=>{let t=m.has(e.slug);return(0,V.jsx)(vr,{summary:e,onOpen:()=>ae(e.slug),onShare:()=>R({view:null,session:e.slug,v:`export`}),onTitleSave:ie,onDelete:()=>F(e.slug),onRegenerate:()=>oe(e),onArchive:()=>re(e.slug),isRegenerating:y===e.slug,isArchived:t},e.slug)})})})]})]})}function xr(){let{scanStatus:e}=at(),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 Sr({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`),R({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),R({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)(ot,{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)(gn,{onNavigate:o}):i===`insights`&&n?(0,V.jsx)(Ut,{}):i===`projects`&&n?(0,V.jsx)(pr,{onNavigate:o}):i===`sessions`&&n?(0,V.jsx)(yr,{}):(0,V.jsx)(br,{})]}),(0,V.jsx)(xr,{})]})}function Cr(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 wr(e,t,n){return e.map(e=>e.id===t?{...e,body:n,updatedAt:new Date().toISOString()}:e)}function Tr(e,t){return e.filter(e=>e.id!==t)}function Er(e){return new Set(e.map(e=>e.sceneIndex))}function Dr(e){let t=new Map;for(let n of e)t.set(n.sceneIndex,(t.get(n.sceneIndex)||0)+1);return t}function Or(e,t){return JSON.stringify(e)!==JSON.stringify(t)}function kr(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 jr(e){return e.rawSum>0?e.rawCr/e.rawSum*100:0}function Mr(e){return e.type===`tool-call`&&!e.diff&&!e.bashOutput}function Nr(e,t){let n=e[t];if(!Mr(n))return t;let r=n.toolName,i=t;for(;i+1<e.length&&Mr(e[i+1])&&e[i+1].toolName===r;)i++;return i}function Pr(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 Fr(e){return e===`user-prompt`||e===`compaction-summary`||e===`context-injection`}function Ir(e){let t=[];for(let n=0;n<e.length;n++)e[n].type===`user-prompt`&&t.push(n);return t}function Lr(e,t){return e.find(e=>e>t)}function Rr(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]<t)return e[n]}function zr(e,t,n){let r=t+1;if(r>=e.length)return-1;if(n.promptsOnly){for(;r<e.length&&!Fr(e[r].type);)r++;return r>=e.length?-1:r}if(n.compactAssistant&&!Fr(e[r].type)){let t=r;for(;t+1<e.length&&!Fr(e[t+1].type);)t++;return t}return Nr(e,r)}function Br(e,t,n){let r=Math.max(0,t-1);if(t<=0)return 0;if(n.promptsOnly){for(;r>0&&!Fr(e[r].type);)r--;return r}if(n.compactAssistant){if(!Fr(e[t].type)){let n=t;for(;n>0&&!Fr(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 Vr(e){let t=new URLSearchParams(window.location.search).get(`session`);return t?`${e}${e.includes(`?`)?`&`:`?`}slug=${encodeURIComponent(t)}`:e}var Hr=`vibe-replay-annotations-`;function Ur(e){return Hr+e}function Wr(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(Ur(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=Or(a,s),u=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(r)return u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{fetch(Vr(`/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(Ur(n),JSON.stringify(a))}catch{}},[a,n,r]);let d=(0,_.useMemo)(()=>Er(a),[a]),f=(0,_.useMemo)(()=>Dr(a),[a]),p=(0,_.useCallback)((e,t)=>{o(n=>Cr(n,e,t))},[]),m=(0,_.useCallback)((e,t)=>{o(n=>wr(n,e,t))},[]),h=(0,_.useCallback)(e=>{o(t=>Tr(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(Ur(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(Ur(n))}catch{}},[e,a,n]),[y,b]=(0,_.useState)(!1),x=r?async()=>{b(!0);try{await fetch(Vr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});let e=await fetch(Vr(`/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(Vr(`/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 ee=r&&w?async()=>{let e=new AbortController;O.current=e,D(!0);try{await fetch(Vr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a),signal:e.signal});let t=await fetch(Vr(`/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,A=r?e=>{T(e)}:null,te=r?()=>{O.current&&O.current.abort()}:null,[j,M]=(0,_.useState)(!1),ne=r?async()=>{M(!0);try{await fetch(Vr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});let e=await fetch(Vr(`/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{M(!1)}}:null,[N,P]=(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:ne,exportGithub:r?async()=>{P(!0);try{await fetch(Vr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});let e=await fetch(Vr(`/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{P(!1)}}:null,gistPublishing:y,htmlExporting:j,githubExporting:N,aiCoachTool:k,aiCoachTools:S,aiCoachToolName:w,setAiCoachToolName:A,runAiCoach:ee,cancelAiCoach:te,aiCoachRunning:E}}var Gr={version:1,overlays:[]};function Kr(e,t=`embedded`){let n=t===`editor`,[r,i]=(0,_.useState)(Gr),[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(Vr(`/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(Vr(`/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(Vr(`/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(Gr)},[]),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)}))},[]),ee=(0,_.useCallback)(e=>{o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),A=(0,_.useCallback)(()=>{c(e=>!e)},[]),te=(0,_.useMemo)(()=>n?e=>f(e):null,[n]),j=(0,_.useMemo)(()=>n?()=>{v.current&&v.current.abort()}:null,[n]),M=(0,_.useMemo)(()=>n&&d?async e=>{let t=new AbortController;v.current=t,m(!0);try{let n=await fetch(Vr(`/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]),ne=(0,_.useMemo)(()=>n&&d?async e=>{let t=new AbortController;v.current=t,g(!0);try{let n=await fetch(Vr(`/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:ee,showAllOriginals:s,toggleAllOriginals:A,studioTools:l,studioToolName:d,setStudioToolName:te,studioToolsAvailable:l.length>0,translating:p,toningDown:h,cancelStudio:j,runTranslate:M,runTone:ne}}function qr(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 Jr(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)(()=>Ir(e),[e]),v=(0,_.useCallback)(()=>{d.current&&=(clearTimeout(d.current),null)},[]),y=(0,_.useCallback)(()=>{if(f.current!==`playing`)return;let t=zr(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=Pr(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=Nr(e,0);o(t),u(t+1);let n=Pr(e[t],m.current);d.current=setTimeout(y,n)}else{let t=e[p.current];if(t){let e=Pr(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=Pr(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=Lr(g,p.current);e!==void 0&&C(e)},[g,C]),T=(0,_.useCallback)(()=>{let e=Rr(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=Pr(n,t);d.current=setTimeout(y,e)}}},[e,v,y]);return(0,_.useEffect)(()=>v,[v]),(0,_.useEffect)(()=>{if(!n)return;let t=t=>{if(!qr(t.target))if(t.key===` `)t.preventDefault(),S();else if(t.key===`ArrowDown`||t.key===`j`){f.current===`playing`&&x(),t.preventDefault();let n=zr(e,p.current,h.current);n!==-1&&C(n)}else t.key===`ArrowUp`||t.key===`k`?(f.current===`playing`&&x(),t.preventDefault(),C(Br(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=>zr(e,n,t),[e,t]),computePrevIndex:(0,_.useCallback)(n=>Br(e,n,t),[e,t])}}function Yr(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 Xr=`vibe-replay-view-prefs`,Zr={displayMode:`compact`,hideThinking:!1,collapseAllTools:!1,promptsOnly:!1};function Qr(){try{let e=y(localStorage,Xr);if(e){let t=JSON.parse(e);return t.displayMode?{...Zr,...t}:{...Zr,...t,displayMode:`compact`}}}catch{}return Zr}function $r(){let[e,t]=(0,_.useState)(Qr);return{prefs:e,updatePref:(0,_.useCallback)((e,n)=>{t(t=>{let r={...t,[e]:n};return b(localStorage,Xr,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 b(localStorage,Xr,JSON.stringify(r)),r})},[])}}function ei({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 ti({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 ni({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 ri=[`English`,`Chinese (Simplified)`,`Chinese (Traditional)`,`Japanese`,`Korean`,`Spanish`,`French`,`German`,`Portuguese`,`Russian`],ii=[{value:`professional`,label:`Professional`},{value:`neutral`,label:`Neutral`},{value:`friendly`,label:`Friendly`}];function ai({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),[ee,A]=(0,_.useState)(null),[te,j]=(0,_.useState)(null),M=m||o||s,ne=n.length>0?n:g,N=r||v,P=(0,_.useCallback)(async()=>{if(p){D(null),j(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]),re=(0,_.useCallback)(async()=>{if(l){k(null),j(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]),ie=(0,_.useCallback)(async()=>{if(u){A(null),j(null);try{let e=await u({style:w});A({type:`success`,text:`${e.adjusted} prompt(s) adjusted, ${e.skipped} unchanged`})}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;A({type:`error`,text:e instanceof Error?e.message:`Tone adjustment failed`})}}},[u,w]),ae=e=>t.overlays.overlays.some(t=>t.source.type===e),F=e=>{if(e===`coach`&&x){j(`coach`);return}if(e===`translate`&&ae(`translate`)){j(`translate`);return}if(e===`tone`&&ae(`tone`)){j(`tone`);return}e===`coach`?P():e===`translate`?re():ie()};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)(ei,{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)(ei,{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`}),ne.length>1&&i?(0,V.jsx)(`select`,{value:N||``,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:ne.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:N})]}),(0,V.jsx)(ni,{toolName:N})]}),(0,V.jsxs)(`div`,{className:`p-4 space-y-3`,children:[b&&(0,V.jsx)(oi,{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:M,status:E,buttonLabel:x?`Re-run Coach`:`Run Coach`,runningLabel:`Analyzing...`,onRun:()=>F(`coach`),onCancel:h||void 0,showRerunConfirm:te===`coach`,rerunWarning:`Existing AI feedback will be replaced.`,onConfirmRerun:()=>void P(),onCancelRerun:()=>j(null)}),l&&(0,V.jsx)(oi,{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:M,status:O,buttonLabel:ae(`translate`)?`Re-translate`:`Translate All`,runningLabel:`Translating...`,onRun:()=>F(`translate`),onCancel:c||void 0,showRerunConfirm:te===`translate`,rerunWarning:`Existing translations will be replaced.`,onConfirmRerun:()=>void re(),onCancelRerun:()=>j(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:M,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:ri.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))})]})}),u&&(0,V.jsx)(oi,{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:M,status:ee,buttonLabel:ae(`tone`)?`Re-adjust`:`Soften All`,runningLabel:`Adjusting...`,onRun:()=>F(`tone`),onCancel:c||void 0,showRerunConfirm:te===`tone`,rerunWarning:`Existing tone adjustments will be replaced.`,onConfirmRerun:()=>void ie(),onCancelRerun:()=>j(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:M,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:ii.map(e=>(0,V.jsx)(`option`,{value:e.value,children:e.label},e.value))})]})})]})]})]})}function oi({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)(ti,{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 si({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)(ai,{annotationActions:n,overlayActions:r})]})]})}function ci(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var li=ci();function ui(e){li=e}var di={exec:()=>null};function G(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(pi.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var fi=(()=>{try{return!0}catch{return!1}})(),pi={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)}}>`)},mi=/^(?:[ \t]*(?:\n|$))+/,hi=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,gi=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_i=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,vi=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yi=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,bi=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,xi=G(bi).replace(/bull/g,yi).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(),Si=G(bi).replace(/bull/g,yi).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(),Ci=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,wi=/^[^\n]+/,Ti=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ei=G(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Ti).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Di=G(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,yi).getRegex(),K=`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`,Oi=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,ki=G(`^ {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`,Oi).replace(`tag`,K).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ai=G(Ci).replace(`hr`,_i).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`,K).getRegex(),ji={blockquote:G(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Ai).getRegex(),code:hi,def:Ei,fences:gi,heading:vi,hr:_i,html:ki,lheading:xi,list:Di,newline:mi,paragraph:Ai,table:di,text:wi},Mi=G(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,_i).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`,K).getRegex(),Ni={...ji,lheading:Si,table:Mi,paragraph:G(Ci).replace(`hr`,_i).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Mi).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`,K).getRegex()},Pi={...ji,html:G(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Oi).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:di,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:G(Ci).replace(`hr`,_i).replace(`heading`,` *#{1,6} *[^
27
- ]`).replace(`lheading`,xi).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Fi=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ii=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Li=/^( {2,}|\\)\n(?!\s*$)/,Ri=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,zi=/[\p{P}\p{S}]/u,Bi=/[\s\p{P}\p{S}]/u,Vi=/[^\s\p{P}\p{S}]/u,Hi=G(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,Bi).getRegex(),Ui=/(?!~)[\p{P}\p{S}]/u,Wi=/(?!~)[\s\p{P}\p{S}]/u,Gi=/(?:[^\s\p{P}\p{S}]|~)/u,Ki=/(?![*_])[\p{P}\p{S}]/u,qi=/(?![*_])[\s\p{P}\p{S}]/u,Ji=/(?:[^\s\p{P}\p{S}]|[*_])/u,Yi=G(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,fi?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Xi=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Zi=G(Xi,`u`).replace(/punct/g,zi).getRegex(),Qi=G(Xi,`u`).replace(/punct/g,Ui).getRegex(),$i=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,ea=G($i,`gu`).replace(/notPunctSpace/g,Vi).replace(/punctSpace/g,Bi).replace(/punct/g,zi).getRegex(),ta=G($i,`gu`).replace(/notPunctSpace/g,Gi).replace(/punctSpace/g,Wi).replace(/punct/g,Ui).getRegex(),na=G(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Vi).replace(/punctSpace/g,Bi).replace(/punct/g,zi).getRegex(),ra=G(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,Ki).getRegex(),ia=G(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Ji).replace(/punctSpace/g,qi).replace(/punct/g,Ki).getRegex(),aa=G(/\\(punct)/,`gu`).replace(/punct/g,zi).getRegex(),oa=G(/^<(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(),sa=G(Oi).replace(`(?:-->|$)`,`-->`).getRegex(),ca=G(`^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`,sa).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),la=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,ua=G(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,la).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),da=G(/^!?\[(label)\]\[(ref)\]/).replace(`label`,la).replace(`ref`,Ti).getRegex(),fa=G(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Ti).getRegex(),pa=G(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,da).replace(`nolink`,fa).getRegex(),ma=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ha={_backpedal:di,anyPunctuation:aa,autolink:oa,blockSkip:Yi,br:Li,code:Ii,del:di,delLDelim:di,delRDelim:di,emStrongLDelim:Zi,emStrongRDelimAst:ea,emStrongRDelimUnd:na,escape:Fi,link:ua,nolink:fa,punctuation:Hi,reflink:da,reflinkSearch:pa,tag:ca,text:Ri,url:di},ga={...ha,link:G(/^!?\[(label)\]\((.*?)\)/).replace(`label`,la).getRegex(),reflink:G(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,la).getRegex()},_a={...ha,emStrongRDelimAst:ta,emStrongLDelim:Qi,delLDelim:ra,delRDelim:ia,url:G(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,ma).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:G(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,ma).getRegex()},va={..._a,br:G(Li).replace(`{2,}`,`*`).getRegex(),text:G(_a.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},ya={normal:ji,gfm:Ni,pedantic:Pi},ba={normal:ha,gfm:_a,breaks:va,pedantic:ga},xa={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Sa=e=>xa[e];function Ca(e,t){if(t){if(pi.escapeTest.test(e))return e.replace(pi.escapeReplace,Sa)}else if(pi.escapeTestNoEncode.test(e))return e.replace(pi.escapeReplaceNoEncode,Sa);return e}function wa(e){try{e=encodeURI(e).replace(pi.percentDecode,`%`)}catch{return null}return e}function Ta(e,t){let n=e.replace(pi.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(pi.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(pi.slashPipe,`|`);return n}function Ea(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 Da(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 Oa(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 ka(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(`
24
+ `):void 0}}function Dt(e){return[...new Set(e.split(`,`).map(e=>e.trim()).filter(Boolean))]}function Ot(e){return e===`7d`?`Last 7 Days`:e===`30d`?`Last 30 Days`:e===`90d`?`Last 90 Days`:`All Time`}function kt({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)*ft),a=t*7,o=new Date(i.getTime()-(a-1)*ft),s=0,c=[],l=new Map,u=-1;for(let t=0;t<a;t++){let n=new Date(o.getTime()+t*ft),r=ht(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,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-end gap-[3px]`,children:[(0,U.jsx)(`div`,{className:`shrink-0 w-7`}),(0,U.jsx)(`div`,{className:`flex-1 flex gap-[3px] min-w-0`,children:r.map((e,t)=>(0,U.jsx)(`div`,{className:`flex-1 min-w-0 overflow-visible`,children:i.has(t)&&(0,U.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer whitespace-nowrap`,children:i.get(t)})},t))})]}),(0,U.jsxs)(`div`,{className:`flex gap-[3px]`,children:[(0,U.jsx)(`div`,{className:`shrink-0 w-7 flex flex-col gap-[3px]`,children:[``,`Mon`,``,`Wed`,``,`Fri`,``].map((e,t)=>(0,U.jsx)(`div`,{className:`flex-1 flex items-center text-[9px] font-mono text-terminal-dimmer leading-none`,children:e},t))}),(0,U.jsx)(`div`,{className:`flex-1 flex gap-[3px] min-w-0`,children:r.map((e,t)=>(0,U.jsx)(`div`,{className:`flex-1 flex flex-col gap-[3px] min-w-0`,children:e.map(e=>{let t=o(e.count);return(0,U.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,U.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5 pt-1`,children:[(0,U.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer`,children:`Less`}),(0,U.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-sm bg-terminal-border/20 dark:bg-terminal-surface-2`}),(0,U.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-sm bg-terminal-green`,style:{opacity:.4}}),(0,U.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-sm bg-terminal-green`,style:{opacity:.6}}),(0,U.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-sm bg-terminal-green`,style:{opacity:.8}}),(0,U.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-sm bg-terminal-green`}),(0,U.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer`,children:`More`})]})]})}function At({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=ht(new Date(t.getTime()-i*ft)),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,U.jsx)(`div`,{className:`flex gap-[3px] flex-wrap`,children:t.cells.map(e=>{let t=n(e.count);return(0,U.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-[2px] ${t.className}`,style:t.style},e.key)})})}function jt({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])=>he(e)).join(` + `))},[a]),l=(0,_.useMemo)(()=>Et(o),[o]),u=({label:e,title:t})=>(0,U.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1`,children:[(0,U.jsx)(`div`,{className:`ui-section-title`,children:e}),t?(0,U.jsx)(tt,{title:t,className:`shrink-0`}):null]});return(0,U.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,U.jsx)(`div`,{className:`absolute -top-20 -right-20 w-64 h-64 bg-terminal-green/5 rounded-full blur-3xl pointer-events-none`}),(0,U.jsx)(`div`,{className:`absolute -bottom-20 -left-20 w-48 h-48 bg-terminal-blue/5 rounded-full blur-3xl pointer-events-none`}),(0,U.jsxs)(`div`,{className:`relative z-10`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.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,U.jsx)(`span`,{className:`ui-pill-compact bg-terminal-surface-2 text-terminal-dimmer`,children:Ot(i)}),l.overall?(0,U.jsx)(tt,{title:l.overall,className:`shrink-0`}):null]}),c&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dim`,children:c})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-4 gap-x-6 gap-y-5 mb-6`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,U.jsx)(He,{durationMs:500,value:e.sessions,formatter:wt})}),(0,U.jsx)(u,{label:`sessions`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-blue tabular-nums`,children:(0,U.jsx)(He,{durationMs:500,value:e.replays,formatter:wt})}),(0,U.jsx)(u,{label:`replays`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,U.jsx)(He,{durationMs:500,value:e.prompts,formatter:wt})}),(0,U.jsx)(u,{label:`turns`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-orange tabular-nums`,children:(0,U.jsx)(He,{durationMs:500,value:e.toolCalls,formatter:wt})}),(0,U.jsx)(u,{label:`tool calls`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-text tabular-nums`,children:(0,U.jsx)(He,{durationMs:500,value:e.durationMs,formatter:e=>j(e)})}),(0,U.jsx)(u,{label:`coding`,title:l.duration})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-orange tabular-nums`,children:(0,U.jsx)(He,{durationMs:500,value:e.cost,formatter:e=>Ct(e)})}),(0,U.jsx)(u,{label:`spent`,title:l.cost})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-blue tabular-nums`,children:(0,U.jsx)(He,{durationMs:500,value:e.edits,formatter:wt})}),(0,U.jsx)(u,{label:`file edits`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-purple tabular-nums`,children:(0,U.jsx)(He,{durationMs:500,value:e.projects,formatter:e=>Math.round(e).toString()})}),(0,U.jsx)(u,{label:`projects`})]})]}),(0,U.jsx)(`div`,{className:`mb-4`,children:(0,U.jsx)(At,{sessionsPerDay:r})}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between pt-4 border-t border-terminal-border/30`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-4`,children:[t.current>0&&(0,U.jsxs)(`span`,{className:`ui-caption`,children:[t.current,` day streak`]}),n&&n.count>0&&(0,U.jsxs)(`span`,{className:`ui-caption`,children:[`Most active: `,n.day]})]}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`vibe-replay.com`})]})]})]})}function Mt({icon:e,label:t,value:n,sub:r}){return(0,U.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,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.jsx)(`span`,{className:`text-lg leading-none mt-0.5`,children:e}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`div`,{className:`ui-section-title`,children:t}),(0,U.jsx)(`div`,{className:`text-lg font-mono font-bold text-terminal-text mt-0.5`,children:n}),r&&(0,U.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dimmer mt-0.5`,children:r})]})]})})}function Nt(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 Pt({histogram:e}){let t=Math.max(...e.buckets.map(e=>e.pct),1);return(0,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.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,U.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-end h-full group relative`,children:[(0,U.jsx)(`div`,{className:`absolute bottom-full mb-1 hidden group-hover:block z-10`,children:(0,U.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,U.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dim`,children:e.label}),(0,U.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,U.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,U.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,U.jsx)(`div`,{className:`flex gap-2`,children:e.buckets.map(e=>(0,U.jsx)(`div`,{className:`flex-1 text-center text-[9px] font-mono text-terminal-dimmer`,children:e.label},e.label))}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between pt-2 border-t border-terminal-border/20`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] font-mono text-terminal-dim`,children:[(0,U.jsxs)(`span`,{children:[`P50`,` `,(0,U.jsx)(`span`,{className:`text-terminal-text font-bold`,children:Nt(e.percentiles.p50Ms)})]}),(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:`·`}),(0,U.jsxs)(`span`,{children:[`P75`,` `,(0,U.jsx)(`span`,{className:`text-terminal-text font-bold`,children:Nt(e.percentiles.p75Ms)})]}),(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:`·`}),(0,U.jsxs)(`span`,{children:[`P90`,` `,(0,U.jsx)(`span`,{className:`text-terminal-text font-bold`,children:Nt(e.percentiles.p90Ms)})]})]}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[e.totalTurns.toLocaleString(),` turns`]})]})]})}var Ft=[{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 It({breakdown:e}){let t=e.input+e.output+e.cacheRead+e.cacheCreation;if(t===0)return null;let n=Ft.map(n=>({...n,value:e[n.key],pct:e[n.key]/t*100})).filter(e=>e.value>0);return(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsx)(`div`,{className:`h-4 rounded-full bg-terminal-surface-2 overflow-hidden flex`,children:n.map(e=>(0,U.jsx)(`div`,{className:`h-full ${e.color} transition-all duration-500`,style:{width:`${e.pct}%`,opacity:.7}},e.key))}),(0,U.jsx)(`div`,{className:`space-y-2`,children:n.map(e=>(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-sm ${e.color}`,style:{opacity:.7}}),(0,U.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dim`,children:e.label})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-text tabular-nums`,children:Tt(e.value)}),(0,U.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,U.jsxs)(`div`,{className:`flex items-center justify-between pt-2 border-t border-terminal-border/20`,children:[(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`Total`}),(0,U.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-text font-bold tabular-nums`,children:Tt(t)})]})]})}function Lt({data:e}){let t=Math.max(...e.map(e=>e.sessions),1);if(!e.some(e=>e.sessions>0))return(0,U.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,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.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,U.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-end h-full group relative`,children:[(0,U.jsx)(`div`,{className:`absolute bottom-full mb-1 hidden group-hover:block z-10`,children:(0,U.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,U.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dim`,children:e.weekLabel}),(0,U.jsxs)(`div`,{className:`text-[10px] font-mono text-terminal-green font-bold`,children:[e.sessions,` session`,e.sessions===1?``:`s`]})]})}),(0,U.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,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`div`,{className:`flex gap-1.5 overflow-hidden`,children:e.filter((e,t)=>t%2==0).map(e=>(0,U.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer`,children:e.weekLabel},e.startDate))}),!s&&(0,U.jsxs)(`span`,{className:`text-[10px] font-mono font-bold ${o?`text-terminal-green`:`text-terminal-orange`}`,children:[o?`↑`:`↓`,` `,o?`Trending up`:`Slowing down`]})]})]})}function Rt({data:e}){let t=Math.max(...e.map(e=>e.count),1);return(0,U.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>{let n=t>0?e.count/t*100:0;return(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dim w-7 text-right shrink-0`,children:e.shortDay}),(0,U.jsx)(`div`,{className:`flex-1 h-4 rounded bg-terminal-surface-2 overflow-hidden`,children:(0,U.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,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dim w-6 text-right tabular-nums shrink-0`,children:e.count})]},e.day)})})}function zt({projects:e}){if(e.length===0)return(0,U.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,U.jsx)(`div`,{className:`space-y-2`,children:e.slice(0,8).map(e=>{let n=P(e.project),r=e.sessions/t*100;return(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-text truncate max-w-[60%]`,children:n}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dim tabular-nums`,children:[e.sessions,` session`,e.sessions===1?``:`s`,e.cost>0&&` · ${Ct(e.cost)}`]})]}),(0,U.jsx)(`div`,{className:`h-1.5 rounded-full bg-terminal-surface-2 overflow-hidden`,children:(0,U.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 Bt({models:e}){let t=(0,_.useMemo)(()=>(()=>{let t=new Map;for(let[n,r]of Object.entries(e))for(let e of Dt(n)){let n=A(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,U.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,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.jsx)(`div`,{className:`h-3 rounded-full bg-terminal-surface-2 overflow-hidden flex`,children:t.map((e,t)=>(0,U.jsx)(`div`,{className:`h-full ${r[t%r.length]} transition-all duration-500`,style:{width:`${e.count/n*100}%`,opacity:.7}},e.model))}),(0,U.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:t.map((e,t)=>(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-sm ${r[t%r.length]} shrink-0`,style:{opacity:.7}}),(0,U.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dim truncate`,children:e.model}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums ml-auto shrink-0`,children:e.count})]},e.model))})]})}function Vt({providers:e}){let t=(0,_.useMemo)(()=>Object.entries(e).map(([e,t])=>({provider:e,label:he(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,U.jsx)(`div`,{className:`space-y-3`,children:t.map(e=>{let t=n>0?e.count/n*100:0;return(0,U.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-text`,children:e.label}),(0,U.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dim tabular-nums`,children:[e.count,` (`,Math.round(t),`%)`]})]}),(0,U.jsx)(`div`,{className:`h-2 rounded-full bg-terminal-surface-2 overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full rounded-full ${ge(e.provider)} transition-all duration-500`,style:{width:`${t}%`,opacity:.7}})})]},e.provider)})})}function Ht(){return(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,U.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 md:px-6 py-6 space-y-6`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`div`,{className:`h-6 w-32 skeleton rounded`}),(0,U.jsx)(`div`,{className:`flex gap-1`,children:Array.from({length:4},(e,t)=>(0,U.jsx)(`div`,{className:`h-7 w-10 skeleton rounded-md`},t))})]}),(0,U.jsxs)(`div`,{className:`rounded-2xl bg-terminal-surface border border-terminal-border/30 p-6 space-y-5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`div`,{className:`h-4 w-20 skeleton rounded`}),(0,U.jsx)(`div`,{className:`h-5 w-12 skeleton rounded-md`})]}),(0,U.jsx)(`div`,{className:`h-3 w-28 skeleton rounded`})]}),(0,U.jsx)(`div`,{className:`grid grid-cols-4 gap-6`,children:Array.from({length:8},(e,t)=>(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(`div`,{className:`h-7 skeleton rounded`,style:{width:`${45+t*13%40}%`}}),(0,U.jsx)(`div`,{className:`h-3 w-16 skeleton rounded`})]},t))}),(0,U.jsx)(`div`,{className:`h-2.5 w-full skeleton rounded`}),(0,U.jsxs)(`div`,{className:`flex justify-between`,children:[(0,U.jsx)(`div`,{className:`h-3 w-40 skeleton rounded`}),(0,U.jsx)(`div`,{className:`h-3 w-24 skeleton rounded`})]})]}),(0,U.jsxs)(`div`,{className:`rounded-xl bg-terminal-surface p-5 shadow-layer-sm space-y-4`,children:[(0,U.jsx)(`div`,{className:`h-3 w-16 skeleton rounded`}),(0,U.jsx)(`div`,{className:`space-y-1.5`,children:Array.from({length:3},(e,t)=>(0,U.jsx)(`div`,{className:`h-3 skeleton rounded`},t))})]}),(0,U.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:Array.from({length:4},(e,t)=>(0,U.jsxs)(`div`,{className:`rounded-xl bg-terminal-surface p-4 shadow-layer-sm space-y-2.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`div`,{className:`h-5 w-5 skeleton rounded`}),(0,U.jsx)(`div`,{className:`h-3 w-20 skeleton rounded`})]}),(0,U.jsx)(`div`,{className:`h-6 w-24 skeleton rounded`}),(0,U.jsx)(`div`,{className:`h-2.5 w-16 skeleton rounded`})]},t))}),(0,U.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:Array.from({length:2},(e,t)=>(0,U.jsxs)(`div`,{className:`rounded-xl bg-terminal-surface p-5 shadow-layer-sm space-y-4`,children:[(0,U.jsx)(`div`,{className:`h-3 w-24 skeleton rounded`}),(0,U.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:5},(e,n)=>(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`div`,{className:`h-3 w-8 skeleton rounded shrink-0`}),(0,U.jsx)(`div`,{className:`h-5 skeleton rounded`,style:{width:`${25+(n*17+t*31)%60}%`}})]},n))})]},t))})]})})}function Ut({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,U.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,U.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 md:px-6 py-8 space-y-4`,children:[(0,U.jsxs)(`div`,{className:`rounded-xl border border-terminal-purple/20 bg-terminal-surface px-4 py-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-sans text-terminal-text`,children:[(0,U.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-terminal-purple animate-pulse`}),(0,U.jsx)(`span`,{children:t?`Refreshing cached insights`:`Loading your insights`})]}),(0,U.jsx)(`p`,{className:`mt-1 ui-caption`,children:n})]}),(0,U.jsx)(Ht,{})]})})}function Wt(){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=C(e)?.sessions||[],i=C(t)?.sessions||[];(r.length>0||i.length>0)&&n(r,i)})},[n]),e}function Gt(){let{userInsights:e,loading:t,scanStatus:n}=ut(),r=Wt(),[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=_t(t,i),a=vt(n,{...e,totalReplays:r?.replays??0},i),o=yt(t),s=bt(n);return{stats:a,streak:o,dayOfWeek:s,bestDay:[...s].sort((e,t)=>t.count-e.count)[0]||null,peak:St(n),weeklyTrend:xt(t,12),activeDays:Object.values(n).filter(e=>e>0).length,firstSessionDate:e.timeRange?.first||null}},[e,i,r]),h=(0,_.useMemo)(()=>ke(e?.topProjects||[]),[e?.topProjects]);if(!e&&(t||o||n?.phase===`discovering`))return(0,U.jsx)(Ut,{scanStatus:n,hasCachedInsights:!!n?.hasCachedResults});if(!e)return(0,U.jsx)(Ht,{});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())/ft):0,b=r?.sessions??e.totalSessions,x=Math.max(0,b-e.totalSessions),S=!!(n?.running&&n?.hasCachedResults),C=n?.cachedAt?D(n.cachedAt):``,w=n?.total&&n.total>0?`${Math.min(n.scanned,n.total)}/${n.total}`:void 0;return(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,U.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 md:px-6 py-6 space-y-6`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`h1`,{className:`text-lg font-sans font-bold text-terminal-text`,children:`Your Insights`}),(0,U.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,U.jsx)(`button`,{onClick:()=>a(e),className:`px-3 py-1.5 text-xs font-sans 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,U.jsx)(`div`,{className:`rounded-xl border border-terminal-blue/30 bg-terminal-blue/10 px-4 py-3`,children:(0,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.jsx)(`div`,{className:`mt-0.5 h-2 w-2 shrink-0 rounded-full bg-terminal-blue`}),(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsx)(`div`,{className:`text-xs font-sans font-semibold text-terminal-text`,children:`Showing cached insights snapshot while the background refresh runs`}),(0,U.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dim`,children:[C?`Snapshot from ${C} ago.`:`Using the latest cached scan.`,` `,w?`Refreshing ${w} sessions now.`:`Refreshing now.`]}),x>0&&(0,U.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,U.jsx)(jt,{stats:s,streak:c,bestDay:u,sessionsPerDay:e.sessionsPerDay||{},range:i,providers:e.providers||{},dataQualityNotes:e.dataQuality?.notes}),(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,U.jsx)(`h3`,{className:`ui-section-title-strong`,children:`Activity`}),i!==`all`&&(0,U.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer`,children:`Last 52 weeks`})]}),(0,U.jsx)(kt,{sessionsPerDay:e.sessionsPerDay||{}})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:[(0,U.jsx)(Mt,{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,U.jsx)(Mt,{icon:`⚡`,label:`Avg / Active Day`,value:`${g} sessions`,sub:`${p} active day${p===1?``:`s`}`}),(0,U.jsx)(Mt,{icon:`💬`,label:`Avg / Session`,value:`${v} prompts`,sub:s.sessions>0?`~${j(s.durationMs/s.sessions)} each`:void 0}),d?(0,U.jsx)(Mt,{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,U.jsx)(Mt,{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,U.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[e.turnDurationHistogram&&(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,U.jsx)(`h3`,{className:`ui-section-title-strong mb-4`,children:`Turn Duration Distribution`}),(0,U.jsx)(Pt,{histogram:e.turnDurationHistogram})]}),e.tokenBreakdown&&(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,U.jsx)(`h3`,{className:`ui-section-title-strong mb-4`,children:`Token Usage`}),(0,U.jsx)(It,{breakdown:e.tokenBreakdown})]})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,U.jsx)(`h3`,{className:`ui-section-title-strong mb-4`,children:`Weekly Trend`}),(0,U.jsx)(Lt,{data:f})]}),(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,U.jsx)(`h3`,{className:`ui-section-title-strong mb-4`,children:`Day of Week`}),(0,U.jsx)(Rt,{data:l})]})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,U.jsx)(`h3`,{className:`ui-section-title-strong mb-4`,children:`Top Projects`}),(0,U.jsx)(zt,{projects:h.map(e=>({project:e.project,sessions:e.sessions,cost:e.cost,prompts:e.prompts,durationMs:e.durationMs,edits:e.edits}))})]}),(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm space-y-5`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`ui-section-title-strong mb-4`,children:`Models`}),(0,U.jsx)(Bt,{models:e.models||{}})]}),Object.keys(e.providers||{}).length>1&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`ui-section-title-strong mb-4`,children:`Providers`}),(0,U.jsx)(Vt,{providers:e.providers||{}})]})]})]}),y>0&&(0,U.jsx)(`div`,{className:`text-center py-4`,children:(0,U.jsxs)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer`,children:[`You've been vibe coding for `,y,` day`,y===1?``:`s`,` ·`,` `,ot(s.durationMs),` total · `,wt(s.toolCalls),` tool calls`]})})]})})}var Kt=[{level:`basic`,label:`discovered`},{level:`details`,label:`enriched`},{level:`counts`,label:`counted`},{level:`metrics`,label:`scanned`}];function qt(e){return!!(e.title||e.prompts&&e.prompts.length>1||e.model||e.gitBranch||e.gitRepo||e.promptCount!=null||e.toolCallCount!=null||e.durationMsEst!=null||e.editCountEst!=null)}function Jt(e,t){return t?.promptCount!=null||t?.toolCallCount!=null||e.promptCount!=null||e.toolCallCount!=null}function Yt(e){return!!(e&&(e.filesModified&&e.filesModified.length>0||(e.editCount??0)>0||e.durationMs||e.costEstimate||(e.apiErrorCount??0)>0||(e.compactionCount??0)>0||(e.subAgentCount??0)>0||e.tokenUsage||e.prLinks?.length))}function Xt(e,t){return Yt(t)?{level:`metrics`,label:`Scanned`,description:`Rich scan metrics are available: files, edits, duration, errors, cost, tokens, or PR links.`,className:`bg-terminal-green-subtle text-terminal-green`}:t||Jt(e,t)?{level:`counts`,label:`Counted`,description:`Prompt/tool counts are available; richer scan metrics may still be deferred.`,className:`bg-terminal-green-subtle text-terminal-green`}:qt(e)?{level:`details`,label:`Enriched`,description:`Discovery has title, prompt preview, model, repo, branch, or other enriched details for this session.`,className:`bg-terminal-purple-subtle text-terminal-purple`}:{level:`basic`,label:`Discovered`,description:`Only lightweight discovery data is available so far.`,className:`bg-terminal-surface-2 text-terminal-dimmer`}}function Zt({state:e,compact:t=!1,active:n=!1}){return(0,U.jsxs)(`span`,{className:`relative ui-pill overflow-hidden ${e.className} ${n?`ring-1 ring-terminal-blue/25`:``} ${t?`text-[11px] leading-4`:``}`,title:e.description,children:[n&&(0,U.jsx)(`span`,{className:`absolute inset-y-0 left-0 w-0.5 bg-terminal-blue animate-pulse`}),n&&(0,U.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-current animate-pulse`}),e.label]})}function Qt({state:e,active:t=!1,scannedAtLabel:n}){let r=e.level===`details`?`text-terminal-purple`:e.level===`basic`?`text-terminal-dimmer`:`text-terminal-green`;return(0,U.jsx)(`span`,{title:`${e.label}${n?` · scanned ${n} ago`:``}\n${e.description}${t?`
25
+ Enriching…`:``}`,"aria-label":`Data level: ${e.label}`,className:`inline-flex items-center ${r} ${t?`animate-pulse`:``}`,children:(0,U.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,children:[(0,U.jsx)(`path`,{d:`M8 1.5 1.5 5 8 8.5 14.5 5 8 1.5Z`}),(0,U.jsx)(`path`,{d:`M1.5 8 8 11.5 14.5 8`}),(0,U.jsx)(`path`,{d:`M1.5 11 8 14.5 14.5 11`})]})})}function $t({ready:e,label:t,pendingLabel:n}){return(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono`,children:[(0,U.jsx)(`span`,{className:e?`text-terminal-green`:`text-terminal-dimmer`,children:e?`✓`:`○`}),(0,U.jsx)(`span`,{className:e?`text-terminal-dim`:`text-terminal-dimmer`,children:e?t:n})]})}function en({state:e,active:t=!1,compact:n=!1,className:r=``}){let i=Math.max(0,Kt.findIndex(t=>t.level===e.level)),a=Math.max(12,(i+1)/Kt.length*100);return(0,U.jsxs)(`div`,{className:r,title:e.description,children:[(0,U.jsx)(`div`,{className:`flex items-center gap-1.5`,children:Kt.map((e,r)=>{let a=r<=i;return(0,U.jsxs)(`div`,{className:`flex items-center gap-1 min-w-0`,children:[(0,U.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full shrink-0 ${a?t&&r===i?`bg-terminal-blue animate-pulse`:`bg-terminal-green`:`bg-terminal-surface-2`}`}),!n&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono uppercase tracking-wide ${a?`text-terminal-dim`:`text-terminal-dimmer`}`,children:e.label}),r<Kt.length-1&&(0,U.jsx)(`span`,{className:`h-px w-4 shrink-0 ${r<i?`bg-terminal-green/50`:`bg-terminal-surface-2`}`})]},e.level)})}),(0,U.jsx)(`div`,{className:`mt-1.5 h-1 overflow-hidden rounded-full bg-terminal-bg ${n?`max-w-32`:`w-full`}`,children:(0,U.jsx)(`div`,{className:`h-full rounded-full transition-all duration-500 ${t?`bg-terminal-blue animate-pulse`:`bg-terminal-green`}`,style:{width:`${a}%`}})}),!n&&(0,U.jsx)(`div`,{className:`mt-1 text-[10px] font-mono text-terminal-dimmer`,children:t?`Fetching richer local session data...`:e.description})]})}function tn({status:e,title:t,description:n}){let r=e?.total??0,i=e?.processed??0,a=r>0?Math.max(4,Math.min(100,Math.round(i/r*100))):35;return(0,U.jsx)(`div`,{className:`rounded-lg border border-terminal-blue/20 bg-terminal-blue-subtle/95 px-3 py-2 text-terminal-blue shadow-layer-md backdrop-blur-sm`,children:(0,U.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,U.jsx)(`div`,{className:`mt-1.5 h-1.5 w-1.5 rounded-full bg-terminal-blue animate-pulse shrink-0`}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,U.jsx)(`div`,{className:`text-xs font-mono truncate`,children:t}),r>0&&(0,U.jsxs)(`div`,{className:`text-[10px] font-mono tabular-nums text-terminal-blue/75`,children:[i,`/`,r]})]}),(0,U.jsx)(`div`,{className:`mt-0.5 text-[10px] font-mono text-terminal-blue/70 leading-relaxed`,children:n}),(0,U.jsx)(`div`,{className:`mt-2 h-1 overflow-hidden rounded-full bg-terminal-bg/60`,children:(0,U.jsx)(`div`,{className:`h-full rounded-full bg-terminal-blue transition-all duration-500 animate-pulse`,style:{width:`${a}%`}})})]})]})})}function nn(e){return(0,U.jsx)(`div`,{className:`fixed right-4 bottom-20 z-50 w-[calc(100vw-2rem)] max-w-sm pointer-events-none animate-in fade-in slide-in-from-bottom-2 duration-300`,children:(0,U.jsx)(tn,{...e})})}function rn(){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,m]=(0,_.useState)(null),h=(0,_.useRef)(!1),g=(0,_.useRef)(void 0),v=(0,_.useMemo)(()=>e.some(e=>e.provider===`cursor`),[e]),y=(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=C(e),o=C(n);i?.sessions.length&&t(i.sessions),o?.sessions.length&&r(o.sessions),(i?.sessions.length||o?.sessions.length)&&a(!1);let c=!T(i),u=w(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),Se(`/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(Se(`/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)(()=>{y()},[y]),(0,_.useEffect)(()=>{if(!o&&!v&&!h.current)return;let e=!1,n,r=async()=>{let n=C(await fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null));!e&&n?.sessions.length&&n.cachedAt!==g.current&&(g.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||(m(t),t.running?(h.current=!0,await r()):h.current&&(h.current=!1,await r(),n&&=(window.clearInterval(n),void 0)))};return i(),n=window.setInterval(()=>{i()},2500),()=>{e=!0,n&&window.clearInterval(n)}},[v,o]),{sources:e,setSources:t,replays:n,loading:i,loadingSources:o,loadingReplays:c,enrichmentStatus:p,error:u}}function an(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 Set;for(let t of e)o.add(t.project);for(let e of t)o.add(e.project);let s={};for(let t of e){let e=Ue(t.timestamp);e&&(s[e]=(s[e]||0)+1)}let c=e.length,l=t.length,u=e.filter(e=>e.existingReplay).length,d=c>0?u/c*100:0;return{totalSessions:c,totalReplays:l,totalPrompts:n,totalToolCalls:r,totalDuration:i,projectCount:o.size,sessionsPerDay:s,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:d}}function on(e){return{project:e,sessions:0,cost:0,prompts:0,durationMs:0,toolCalls:0,edits:0,branchCount:0,prCount:0,memoryFileCount:0,lastActivity:``,sessionsPerDay:{},branches:new Set}}function sn(e,t){let n=new Map,r=new Map(t.map(e=>[e.slug,e])),i=new Set,a=e=>{let t=n.get(e);if(t)return t;let r=on(e);return n.set(e,r),r},o=(e,t)=>{t>e.lastActivity&&(e.lastActivity=t);let n=Ue(t);n&&(e.sessionsPerDay[n]=(e.sessionsPerDay[n]||0)+1)};for(let t of e){let e=r.get(t.slug);e&&i.add(e.slug);let n=a(t.project);n.sessions+=1,n.cost+=e?.stats.costEstimate??0,n.prompts+=t.promptCount??t.prompts?.length??(t.firstPrompt.trim()?1:0),n.toolCalls+=Math.max(t.toolCallCount??0,e?.stats.toolCalls??0),n.durationMs+=t.durationMsEst??e?.stats.durationMs??0,n.edits+=t.editCountEst??0,t.gitBranch&&n.branches.add(t.gitBranch),t.hasPR&&(n.prCount+=1),o(n,t.timestamp)}for(let e of t){if(i.has(e.slug))continue;let t=a(e.project);t.sessions+=1,t.cost+=e.stats.costEstimate??0,t.prompts+=e.stats.userPrompts??0,t.toolCalls+=e.stats.toolCalls??0,t.durationMs+=e.stats.durationMs??0,o(t,e.startTime)}return ke([...n.values()].map(({branches:e,...t})=>({...t,branchCount:e.size})))}var cn=6,ln=300*1e3;function un({children:e}){return(0,U.jsxs)(`span`,{className:`instant-tooltip inline-flex h-4 w-4 items-center justify-center rounded-full border border-terminal-border-subtle text-[10px] font-mono text-terminal-dimmer`,children:[`?`,(0,U.jsx)(`span`,{className:`instant-tooltip-text w-64 text-left`,children:e})]})}function dn(e){let t=Date.parse(e.timestamp);return Number.isFinite(t)&&Date.now()-t<ln}function fn(e){let t=new Date(e);return t.setHours(0,0,0,0),t}function pn(e){let t=fn(e),n=(t.getDay()+6)%7;return t.setDate(t.getDate()-n),t}function mn(){return(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,U.jsx)(`div`,{className:`h-3 w-28 skeleton rounded`}),(0,U.jsx)(`div`,{className:`h-3 w-14 skeleton rounded`})]}),(0,U.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2`,children:Array.from({length:cn},(e,t)=>(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-3 rounded-lg bg-terminal-bg`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2.5`,children:[(0,U.jsx)(`div`,{className:`h-3.5 skeleton rounded`,style:{width:`${50+t*17%30}%`}}),(0,U.jsx)(`div`,{className:`h-3 skeleton rounded`,style:{width:`${60+t*23%25}%`}})]}),(0,U.jsx)(`div`,{className:`h-4 w-14 shrink-0 skeleton rounded`})]},t))}),(0,U.jsx)(`div`,{className:`h-8 mt-2 rounded-lg skeleton`})]})}function hn({sessions:e,isLoading:t,enrichmentStatus:n,onGenerate:r,onViewReplay:i,onSessionClick:a,generatingSlug:o,generateErrorSlug:s}){if(e.length===0)return(0,U.jsx)(`div`,{className:`text-center py-6 ui-caption-muted`,children:t?`Loading recent sessions...`:`No sessions found. Start Claude, Cursor, or Codex.`});let c=(e,t=!1)=>{let n=!!e.existingReplay,a=o===e.slug,c=s===e.slug,l=t?`h-8 px-3.5`:`h-7 px-3`;return n?(0,U.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),i(e.existingReplay)},className:`${l} 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 shrink-0`,children:[(0,U.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,U.jsx)(`polygon`,{points:`4 2 14 8 4 14`})}),t?`Open replay`:`Open`]}):(0,U.jsx)(`button`,{onClick:t=>{t.stopPropagation(),r(e)},disabled:a,className:`${l} text-xs font-sans font-semibold rounded-md transition-all duration-200 disabled:opacity-50 flex items-center gap-1 shrink-0 ${c?`bg-terminal-red-subtle text-terminal-red`:`bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis`}`,children:a?(0,U.jsx)(`span`,{className:`animate-pulse`,children:t?`Generating...`:`...`}):c?`Failed`:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,U.jsx)(`path`,{d:`M8 2v12M2 8h12`})}),`Generate`]})})},l=e=>`${e.provider}-${e.project}-${e.slug}`,u=e.find(e=>!e.existingReplay&&!dn(e))??e.find(e=>!e.existingReplay)??e[0],d=l(u),f=e.filter(e=>l(e)!==d),p=Xt(u,null),m=!!n?.running&&u.provider===`cursor`,h=u.promptCount??u.prompts?.length??0,g=u.toolCallCount??u.replay?.stats.toolCalls??0,_=!!u.existingReplay,v=dn(u);return(0,U.jsxs)(`div`,{className:`space-y-3 flex-1 flex flex-col`,children:[(0,U.jsx)(`div`,{onClick:()=>a(u),className:`rounded-xl border bg-terminal-bg/55 px-3 py-3 cursor-pointer transition-all duration-200 hover:bg-terminal-bg/80 ${_?`border-terminal-green/25 hover:border-terminal-green/45`:`border-terminal-blue/25 hover:border-terminal-blue/45`}`,children:(0,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.jsx)(Ke,{provider:u.provider}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`ui-pill-compact ${_?`bg-terminal-green-subtle text-terminal-green`:`bg-terminal-blue-subtle text-terminal-blue`}`,children:_?`Recent replay`:v?`Current activity`:`Suggested next`}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:ee(u.timestamp)}),m&&(0,U.jsx)(Zt,{state:p,active:!0,compact:!0})]}),(0,U.jsx)(`p`,{className:`mt-1 text-sm font-sans font-semibold text-terminal-text truncate`,children:ae(u)}),(0,U.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] font-mono text-terminal-dimmer`,children:[(0,U.jsx)(`span`,{className:`truncate`,children:u.gitRepo||P(u.project)}),h>0&&(0,U.jsxs)(`span`,{children:[h,` prompts`]}),g>0&&(0,U.jsxs)(`span`,{children:[g,` tools`]}),(0,U.jsx)(`span`,{className:_?`text-terminal-green`:`text-terminal-blue`,children:_?`generated`:`not generated`})]})]}),c(u,!0)]})}),(0,U.jsx)(`div`,{className:`space-y-1`,children:f.map(e=>{let t=!!n?.running&&e.provider===`cursor`,r=Xt(e,null);return(0,U.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,U.jsx)(Ke,{provider:e.provider}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsx)(`p`,{className:`text-sm font-sans text-terminal-text truncate`,children:ae(e)}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-terminal-dimmer truncate`,children:e.gitRepo||P(e.project)}),t&&(0,U.jsx)(Zt,{state:r,active:!0,compact:!0})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer tabular-nums`,children:ee(e.timestamp)}),c(e)]})]},l(e))})})]})}function gn({replays:e,isLoading:t,onOpen:n}){return e.length===0?(0,U.jsx)(`div`,{className:`text-center py-6 ui-caption-muted`,children:t?`Loading replays...`:`No replays yet. Generate one from the Sessions tab.`}):(0,U.jsx)(`div`,{className:`space-y-1 flex-1 flex flex-col`,children:e.map(e=>(0,U.jsxs)(`button`,{onClick:()=>n(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,U.jsx)(Ke,{provider:e.provider}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsx)(`p`,{className:`text-sm font-sans text-terminal-text truncate group-hover:text-terminal-green transition-colors`,children:se(e)}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-0.5`,children:[(0,U.jsxs)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer`,children:[e.stats.userPrompts,` prompts`]}),(0,U.jsx)(`span`,{className:`text-terminal-border text-[10px]`,children:`·`}),(0,U.jsxs)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer`,children:[e.stats.toolCalls,` tools`]}),e.stats.durationMs&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-terminal-border text-[10px]`,children:`·`}),(0,U.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer`,children:ot(e.stats.durationMs)})]})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[e.gist?.gistId&&(0,U.jsx)(`span`,{className:`ui-pill-compact bg-terminal-purple-subtle text-terminal-purple`,children:`published`}),(0,U.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer tabular-nums`,children:ee(e.startTime)})]})]},e.slug))})}var _n=[{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 vn(){let[e,t]=(0,_.useState)(()=>_n.map(e=>({...e,installed:!1,detail:`checking...`,loading:!0})));(0,_.useEffect)(()=>{let e=!1;for(let n of _n)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}},[]);let n=e.some(e=>e.loading),r=e.filter(e=>!e.loading&&!e.installed);return n?(0,U.jsx)(`div`,{className:`bg-terminal-surface rounded-xl px-4 py-3 shadow-layer-sm`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 ui-caption`,children:[(0,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),`Checking local replay tools...`]})}):r.length===0?(0,U.jsx)(`div`,{className:`bg-terminal-surface rounded-xl px-4 py-3 shadow-layer-sm`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`ui-section-title-strong`,children:`System Ready`}),(0,U.jsx)(`p`,{className:`mt-0.5 ui-caption-muted`,children:`Local replay tooling is available.`})]}),(0,U.jsx)(`span`,{className:`ui-pill-compact bg-terminal-green-subtle text-terminal-green`,children:`all checks passed`})]})}):(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm`,children:[(0,U.jsx)(`h3`,{className:`ui-section-title-strong mb-3`,children:`System Attention Needed`}),(0,U.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-2`,children:r.map(e=>(0,U.jsxs)(`div`,{className:`flex items-start gap-2.5 px-3 py-2.5 rounded-lg bg-terminal-bg`,children:[(0,U.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,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.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,U.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-dimmer truncate`,children:e.purpose}),e.loading?(0,U.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-blue truncate animate-pulse`,children:`checking...`}):e.installed?(0,U.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-green truncate`,children:e.detail||e.version||`ready`}):(0,U.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-orange truncate`,children:e.detail||`not found`})]})]},e.name))})]})}function yn({onNavigate:e}){let{sources:t,setSources:n,replays:r,loading:i,loadingSources:a,loadingReplays:o,enrichmentStatus:s,error:c}=rn(),l=(0,_.useMemo)(()=>an(t,r),[t,r]),{userInsights:u}=ut(),[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]=(0,_.useState)(0),[T,E]=(0,_.useState)(`today`),D=(0,_.useRef)(``),O=(0,_.useRef)(null),k=(0,_.useRef)(null),A=h?t.find(e=>e.slug===h)??null:null,M=(0,_.useMemo)(()=>sn(t,r),[t,r]),N=(0,_.useMemo)(()=>u?ke(u.topProjects):[],[u]),I=N.length>0?N:M,L=a&&I.length===0,te=Math.max(l.projectCount,u?.totalProjects??0),ne=Math.max(l.totalPrompts,u?.totalPrompts??0),R=Math.max(l.totalToolCalls,u?.totalToolCalls??0),z=Object.keys(l.sessionsPerDay).length>0?l.sessionsPerDay:u?.sessionsPerDay??{},B=new Date,re=T===`today`?fn(B):pn(B),ie=re.getTime(),oe=t.filter(e=>{let t=new Date(e.timestamp).getTime();return Number.isFinite(t)&&t>=ie&&t<=B.getTime()}),se=oe.length,ce=new Set(oe.map(e=>e.project)).size,le=oe.reduce((e,t)=>e+(t.promptCount??t.prompts?.length??0),0),ue=oe.reduce((e,t)=>e+(t.toolCallCount??t.replay?.stats.toolCalls??0),0),de=T===`today`?`Today`:`This week`,fe=T===`today`?B.toLocaleDateString(`en-US`,{weekday:`short`,month:`short`,day:`numeric`}):`${re.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})}–${B.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})}`,pe=e=>{V({view:null,session:e})},me=async e=>{f(e.slug),m(null);try{let t=ae(e),n=await Se(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,filePaths:e.filePaths,toolPaths:e.toolPaths,title:F(t)||void 0,sessionSlug:e.slug,sessionProject:e.project})}),r=await n.json();if(!n.ok)throw Error(r.error||`Generation failed`);V({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)}},he=async(e,t)=>{g(null),f(e.slug),m(null);try{let n=await Se(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,filePaths:e.filePaths,toolPaths:e.toolPaths,title:F(t)||void 0,sessionSlug:e.slug,sessionProject:e.project})}),r=await n.json();if(!n.ok)throw Error(r.error||`Generation failed`);V({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)}},ge=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))},_e=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{}},ve=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)}},ye=()=>{ve()},be=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{}O.current&&clearInterval(O.current),k.current&&clearTimeout(k.current),O.current=setInterval(async()=>{try{(await(await fetch(`/api/auth/get-session`)).json())?.session&&(O.current&&=(clearInterval(O.current),null),k.current&&=(clearTimeout(k.current),null),window.dispatchEvent(new Event(`vibe-auth-change`)),ve())}catch{}},2e3),k.current=setTimeout(()=>{O.current&&=(clearInterval(O.current),null),y(`idle`),x(null)},180*1e3)};(0,_.useEffect)(()=>()=>{O.current&&clearInterval(O.current),k.current&&clearTimeout(k.current)},[]),(0,_.useEffect)(()=>{if(a||l.recentSources.length===0)return;let e=l.recentSources.filter(e=>e.provider===`cursor`).slice(0,10);if(e.length===0)return;let t=e.map(e=>e.slug),n=e.map(e=>e.sessionId).filter(e=>typeof e==`string`&&e.length>0),r=[...new Set(e.map(e=>e.project))].slice(0,5),i=JSON.stringify({slugs:t});D.current!==i&&(D.current=i,fetch(`/api/sources/enrich`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({slugs:t,sessionIds:n,projects:r,limit:Math.max(10,e.length)})}).catch(()=>{}))},[l.recentSources,a]),(0,_.useEffect)(()=>{if(!S)return;let e=setInterval(()=>w(e=>e+1),3e4);return()=>clearInterval(e)},[S]);let xe=(()=>{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,U.jsx)(`div`,{className:`flex-1 overflow-auto animate-in fade-in duration-500`,children:(0,U.jsxs)(`div`,{className:`max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-6`,children:[(0,U.jsx)(nn,{title:`Fetching local sessions`,description:`Loading cached sessions first, then enriching recent Cursor details in place.`}),(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm space-y-4`,children:[(0,U.jsx)(`div`,{className:`grid grid-cols-4 gap-6`,children:Array.from({length:4},(e,t)=>(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(`div`,{className:`h-8 w-20 skeleton rounded`}),(0,U.jsx)(`div`,{className:`h-3 w-14 skeleton rounded`})]},t))}),(0,U.jsx)(`div`,{className:`space-y-1.5 pt-2`,children:Array.from({length:3},(e,t)=>(0,U.jsx)(`div`,{className:`h-3 skeleton rounded`},t))}),(0,U.jsx)(`div`,{className:`h-9 skeleton rounded`})]}),(0,U.jsx)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-3`,children:Array.from({length:2},(e,t)=>(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm space-y-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`div`,{className:`h-3 w-28 skeleton rounded`}),(0,U.jsx)(`div`,{className:`h-3 w-14 skeleton rounded`})]}),Array.from({length:5},(e,t)=>(0,U.jsxs)(`div`,{className:`flex items-center gap-3 px-1 py-1`,children:[(0,U.jsx)(`div`,{className:`h-5 w-14 skeleton rounded-full shrink-0`}),(0,U.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,U.jsx)(`div`,{className:`h-3.5 skeleton rounded`,style:{width:`${55+t*19%35}%`}}),(0,U.jsx)(`div`,{className:`h-2.5 w-20 skeleton rounded`})]}),(0,U.jsx)(`div`,{className:`h-3 w-12 skeleton rounded shrink-0`})]},t)),(0,U.jsx)(`div`,{className:`h-8 skeleton rounded`})]},t))})]})}):c&&t.length===0&&r.length===0?(0,U.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,U.jsx)(`div`,{className:`text-center space-y-2`,children:(0,U.jsx)(`div`,{className:`text-terminal-red font-mono text-sm`,children:c})})}):(0,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,U.jsxs)(`div`,{className:`max-w-6xl mx-auto px-4 md:px-6 py-5 space-y-5`,children:[(0,U.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 lg:grid-cols-[minmax(280px,0.72fr)_minmax(0,1.28fr)] lg:items-stretch`,children:[(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col`,children:[(0,U.jsxs)(`div`,{className:`mb-3 flex min-h-7 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(`h2`,{className:`ui-section-title-strong`,children:de}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:fe}),(0,U.jsx)(un,{children:`Short-term local activity for the selected window. Use this to see whether recent AI work is still actively flowing before jumping into sessions.`})]}),(0,U.jsx)(`div`,{className:`inline-flex h-7 shrink-0 items-center rounded-xl bg-terminal-bg p-0.5 shadow-layer-sm`,children:[`today`,`week`].map(e=>(0,U.jsx)(`button`,{onClick:()=>E(e),className:`h-6 rounded-lg px-3 text-xs font-sans font-semibold transition-all duration-200 ${T===e?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text`}`,children:e===`today`?`Today`:`Week`},e))})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-4 gap-2 lg:grid-cols-2`,children:[(0,U.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg px-3 py-2`,children:[(0,U.jsx)(`div`,{className:`text-xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,U.jsx)(He,{value:se})}),(0,U.jsx)(`div`,{className:`ui-section-title`,children:`sessions`})]}),(0,U.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg px-3 py-2`,children:[(0,U.jsx)(`div`,{className:`text-xl font-mono font-bold text-terminal-blue tabular-nums`,children:(0,U.jsx)(He,{value:ce})}),(0,U.jsx)(`div`,{className:`ui-section-title`,children:`projects`})]}),(0,U.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg px-3 py-2`,children:[(0,U.jsx)(`div`,{className:`text-xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,U.jsx)(He,{value:le})}),(0,U.jsx)(`div`,{className:`ui-section-title`,children:`turns`})]}),(0,U.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg px-3 py-2`,children:[(0,U.jsx)(`div`,{className:`text-xl font-mono font-bold text-terminal-orange tabular-nums`,children:(0,U.jsx)(He,{value:ue})}),(0,U.jsx)(`div`,{className:`ui-section-title`,children:`tools`})]})]})]}),(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col`,children:[(0,U.jsxs)(`div`,{className:`mb-3 flex min-h-7 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(`h2`,{className:`ui-section-title-strong`,children:`Activity Insights`}),(0,U.jsx)(un,{children:`Long-term local AI coding totals and contribution-style activity across this machine. Cached data appears first, then provider scans enrich details in place.`})]}),(0,U.jsxs)(`div`,{className:`inline-flex h-7 shrink-0 items-center rounded-xl bg-terminal-bg p-0.5 shadow-layer-sm`,children:[(0,U.jsx)(`button`,{onClick:()=>e(`insights`),className:`h-6 rounded-lg px-3 text-xs font-sans font-semibold text-terminal-dim transition-all duration-200 hover:text-terminal-text`,children:`Insights`}),(0,U.jsx)(`button`,{onClick:ye,disabled:v===`syncing`||v===`awaitingLogin`,className:`h-6 rounded-lg px-3 text-xs font-sans font-semibold transition-all duration-200 disabled:cursor-wait disabled:opacity-50 ${v===`done`?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:v===`error`?`bg-terminal-red-subtle text-terminal-red shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text`}`,title:b||void 0,children:v===`syncing`?`Syncing...`:v===`done`&&xe?`\u2713 ${xe}`:v===`error`?`Failed`:v===`awaitingLogin`?`Waiting...`:`↑ Sync`})]})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 md:grid-cols-4`,children:[(0,U.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg px-3 py-2`,children:[(0,U.jsx)(`div`,{className:`text-xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,U.jsx)(He,{value:l.totalSessions})}),(0,U.jsx)(`div`,{className:`ui-section-title`,children:`sessions`})]}),(0,U.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg px-3 py-2`,children:[(0,U.jsx)(`div`,{className:`text-xl font-mono font-bold text-terminal-blue tabular-nums`,children:(0,U.jsx)(He,{value:te})}),(0,U.jsx)(`div`,{className:`ui-section-title`,children:`projects`})]}),(0,U.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg px-3 py-2`,children:[(0,U.jsx)(`div`,{className:`text-xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,U.jsx)(He,{value:ne})}),(0,U.jsx)(`div`,{className:`ui-section-title`,children:`turns`})]}),(0,U.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg px-3 py-2`,children:[(0,U.jsx)(`div`,{className:`text-xl font-mono font-bold text-terminal-orange tabular-nums`,children:(0,U.jsx)(He,{value:R})}),(0,U.jsx)(`div`,{className:`ui-section-title`,children:`tool calls`})]})]}),(0,U.jsx)(`div`,{className:`mt-3 flex-1 rounded-lg bg-terminal-bg/70 p-2.5`,children:(0,U.jsx)(kt,{sessionsPerDay:z,weeks:52,showLegend:!1})})]})]}),(a||s?.running&&s.total>0)&&(0,U.jsx)(nn,{status:s?.running?s:null,title:a?`Refreshing local session list`:`Loading more local session details`,description:a?`Home is using cached data while local providers refresh in the background.`:`Recent sessions will update in place as titles, prompt previews, counts, and metrics become available.`}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-[minmax(0,1.25fr)_minmax(320px,0.75fr)] gap-3 items-stretch`,children:[(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(`h3`,{className:`ui-section-title-strong`,children:`Recent Sessions`}),(0,U.jsx)(un,{children:`Pick up the sessions most likely to need your next action.`})]}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:[l.totalSessions,` total`]})]}),(0,U.jsx)(`div`,{className:`flex flex-1 flex-col justify-between`,children:(0,U.jsx)(hn,{sessions:l.recentSources,isLoading:a,enrichmentStatus:s,onGenerate:me,onViewReplay:pe,onSessionClick:e=>g(e.slug),generatingSlug:d,generateErrorSlug:p})}),(0,U.jsx)(`button`,{onClick:()=>e(`sessions`),className:`mt-auto w-full py-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 sessions →`})]}),(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(`h3`,{className:`ui-section-title-strong`,children:`Recent Replays`}),(0,U.jsx)(un,{children:`Open something already generated.`})]}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:[l.totalReplays,` total`]})]}),(0,U.jsx)(`div`,{className:`flex flex-1 flex-col justify-between`,children:(0,U.jsx)(gn,{replays:l.recentReplays,isLoading:o,onOpen:pe})}),(0,U.jsx)(`button`,{onClick:()=>e(`replays`),className:`mt-auto w-full py-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 replays →`})]})]}),L?(0,U.jsx)(mn,{}):I.length>1?(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(`h3`,{className:`ui-section-title-strong`,children:`Project Shortcuts`}),(0,U.jsx)(un,{children:`Jump back into the projects with recent AI work.`})]}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:[te,` total`]})]}),(0,U.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2`,children:[...I].sort((e,t)=>(t.lastActivity||``).localeCompare(e.lastActivity||``)).slice(0,cn).map(t=>(0,U.jsxs)(`button`,{onClick:()=>{e(`sessions`),setTimeout(()=>{V({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,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-text truncate block group-hover:text-terminal-green transition-colors`,children:P(t.project)}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[t.sessions,` session`,t.sessions>1?`s`:``,` ·`,` `,ee(t.lastActivity),t.durationMs>0&&` · ${j(t.durationMs)}`]})]}),t.cost>0&&(0,U.jsxs)(`span`,{className:`text-xs font-mono text-terminal-orange tabular-nums shrink-0`,children:[`$`,t.cost.toFixed(2)]})]},t.project))}),I.length>cn&&(0,U.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,U.jsx)(vn,{})]}),A&&(0,U.jsx)(kr,{session:A,onClose:()=>g(null),onGenerate:he,onViewReplay:e=>V({view:null,session:e}),onArchive:e=>{fetch(`/api/archive/${e}`,{method:`POST`}).catch(()=>{}),g(null)},onTitleSave:ge,onDeleteReplay:_e,isGenerating:d===A.slug,isArchived:!1}),(v===`needsLogin`||v===`awaitingLogin`)&&(0,U.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,U.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,U.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,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`h3`,{className:`text-base font-bold text-terminal-text mb-1`,children:`Sync Insights to the Cloud`}),(0,U.jsx)(`p`,{className:`text-xs text-terminal-dim mb-5`,children:`Sign in with GitHub to unlock your online dashboard.`}),(0,U.jsxs)(`div`,{className:`space-y-3 mb-6`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-sm font-semibold text-terminal-text`,children:`Cross-machine dashboard`}),(0,U.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,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-sm font-semibold text-terminal-text`,children:`Cost tracking & trends`}),(0,U.jsx)(`p`,{className:`text-[11px] text-terminal-dim mt-0.5`,children:`Track spending by model, spot weekly patterns, and monitor project breakdowns.`})]})]}),(0,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-sm font-semibold text-terminal-text`,children:`Share your coding card`}),(0,U.jsx)(`p`,{className:`text-[11px] text-terminal-dim mt-0.5`,children:`Activity heatmaps, streak badges, and project stats — shareable at a glance.`})]})]})]}),(0,U.jsxs)(`button`,{onClick:be,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,U.jsx)(`svg`,{className:`w-5 h-5`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,U.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,U.jsx)(`p`,{className:`text-[10px] text-terminal-dim text-center mt-3`,children:`We'll auto-sync your insights right after sign in.`})]}):(0,U.jsxs)(`div`,{className:`text-center py-4`,children:[(0,U.jsx)(`div`,{className:`text-2xl mb-3 animate-pulse`,children:`↑`}),(0,U.jsx)(`h3`,{className:`text-base font-bold text-terminal-text mb-1`,children:`Waiting for sign in...`}),(0,U.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 bn(e){return e.gitRepo||`__no_repo__`}function xn(e,t){return t.size===0||t.has(e.provider)}function Sn(e,t){return t.size===0||t.has(bn(e))}function Cn(e,t,n,r){return t===n||r(e.project)===t}function wn(e,t){let n=new Set(t.selectedProviders),r=new Set(t.selectedRepos);return e.filter(e=>xn(e,n)&&Sn(e,r)&&Cn(e,t.selectedProjectKey,t.allProjectsKey,t.rollupProject))}var Tn=null,En=null,Dn=0,On=4e3;function kn(){let[e,t]=(0,_.useState)(Tn??[]),[n,r]=(0,_.useState)(Tn===null&&En===null),[i,a]=(0,_.useState)(Tn===null?En: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}`);Tn=(await n.json()).results??[],Dn=Tn.length,En=null,e||(t(Tn),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;(Tn===null||n!==Dn)&&await i()}catch(t){let n=t instanceof Error?t.message:`Failed to load`;En=n,!e&&Tn===null&&a(n)}finally{e||r(!1),!e&&t&&(n=setTimeout(s,On))}}return s(),()=>{e=!0,n&&clearTimeout(n)}},[]),{sessions:e,loading:n,error:i}}function An(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=jn(e)?-10:0,l=t+n+r+i+a+o+s+c;return Math.max(0,Math.min(100,l*4))}function jn(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 Mn(e){return e?new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`}):``}function Nn(e){return e?new Date(e).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!1}):``}function Pn(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 Fn(e){return F(R(e.title||``))||F(R(e.firstPrompt||``))||e.slug}function In(e){return e.durationMs==null?!0:(e.dataQualityNotes||[]).some(e=>/duration is inferred|duration.*estimated|missing duration/i.test(e))}function Ln(e){let t=[pe(e.provider)],n=e.dataSource?Te(!1,e.dataSource):``;return n&&t.push(n),In(e)&&t.push(`estimated time`),t}function Rn(e){window.dispatchEvent(new CustomEvent(`vibe-open-session`,{detail:{slug:e}}))}function zn(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 Bn=[{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 Vn(e){return Bn[e%Bn.length]}function Hn(e,t={}){let n=new Map;for(let r of e){let e=t.collapseWorktrees?Oe(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=or(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 Un=4,Wn=5,Gn=10,Kn=72,qn=40,Jn=14,Yn=12,Xn=6,Zn=8,Qn=140,$n=1100;function er(e){return e>=60?.24:.16}function tr(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 nr(e){return e>=60?.95:.78}function rr(e){return Zn+Math.sqrt(Math.max(0,Math.min(100,e))/100)*(Qn-Zn)}function ir(e){return Gn+Math.max(0,Math.min(100,e))/100*(Kn-Gn)}function ar(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:Wn;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 or(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 sr(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=or(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/$n,f=new Map,p=0;for(let e of a){if(e.endMs<c||e.startMs>l)continue;if(!r&&jn(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=An(e),i=rr(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}=ar(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=rr(e.score),d=o/100*$n,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:ir(e.score),fillAlpha:er(e.score),opacity:nr(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},()=>Gn);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+Un;let i=r+4,c=Math.max(i,qn),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 cr=[{value:`1d`,label:`1D`,days:1},{value:`7d`,label:`7D`,days:7},{value:`30d`,label:`30D`,days:30},{value:`all`,label:`All`}];function lr(e){let t=cr.find(t=>t.value===e);if(!t||t.days==null)return{};let n=Date.now();return{start:n-t.days*864e5,end:n}}function ur({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)(()=>lr(t),[t]),{projects:f,ticks:p,totalSessions:m,hiddenAutomatedCount:h}=(0,_.useMemo)(()=>sr(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)In(n.session)&&e++;return e},[f]);return(0,U.jsxs)(`div`,{className:`space-y-4 p-4 select-none`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`,children:[(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text`,children:`Work Timeline`}),(0,U.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dimmer`,children:[m,` `,W(m,`session`),` · rows are projects · bar position and width show active time`,g>0?` · ${g} estimated`:``]})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 text-[10px] font-mono`,children:[h>0&&!r&&(0,U.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,U.jsx)(`button`,{onClick:()=>i(!1),className:`text-terminal-purple hover:underline`,children:`hide automated`}),(0,U.jsx)(`div`,{className:`inline-flex items-center rounded-xl bg-terminal-surface p-0.5 shadow-layer-sm`,children:cr.map(e=>(0,U.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,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-40 gap-2 text-terminal-dimmer text-sm font-mono`,children:[(0,U.jsxs)(`div`,{children:[`No sessions in `,zn(t),`.`]}),t!==`all`&&(0,U.jsx)(`button`,{onClick:()=>n(`all`),className:`text-terminal-green hover:underline text-xs`,children:`Show all sessions →`})]}):(0,U.jsx)(`div`,{className:`overflow-x-auto rounded-2xl bg-terminal-bg/35 p-3 shadow-inner`,children:(0,U.jsxs)(`div`,{className:`min-w-[760px]`,children:[(0,U.jsx)(`div`,{className:`flex`,style:{paddingLeft:140},children:(0,U.jsxs)(`div`,{className:`relative flex-1 h-6`,children:[p.map((e,t)=>(0,U.jsxs)(`div`,{className:`absolute flex flex-col items-center`,style:{left:`${e.leftPct}%`,transform:`translateX(-50%)`},children:[(0,U.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer whitespace-nowrap`,children:e.label}),(0,U.jsx)(`div`,{className:`w-px h-1.5 bg-terminal-border/20 mt-0.5`})]},t)),(0,U.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,U.jsx)(`div`,{className:`space-y-1.5`,children:f.map(e=>{let t=Vn(e.colorIdx),n=e.totalRowHeightPx,r=t.solid;return(0,U.jsxs)(`div`,{className:`flex items-stretch rounded-xl group`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col justify-center shrink-0 py-1 pr-3 overflow-hidden`,style:{width:140,height:n},children:[(0,U.jsx)(`div`,{className:`text-xs font-sans font-medium truncate ${t.text}`,children:P(e.project)}),(0,U.jsxs)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer truncate`,children:[e.sessions.length,` `,W(e.sessions.length,`session`),e.hiddenInLanesCount>0&&(0,U.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,U.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,U.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,U.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=jn(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-Xn)/Yn)),l=!n.rightAnchored&&n.realDurationFraction<.85;return(0,U.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:tr(r,n.fillAlpha)},"aria-label":`Open ${Fn(n.session)}`,onClick:()=>Rn(n.session.slug),onMouseEnter:e=>{o({session:n.session,x:e.clientX,y:e.clientY})},onMouseLeave:()=>o(null),children:[n.heightPx>=Jn&&(0,U.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:Fn(n.session)}),l&&(0,U.jsxs)(U.Fragment,{children:[(0,U.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,U.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,U.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,U.jsx)(`div`,{className:`text-terminal-text font-medium mb-1.5 break-words leading-snug`,children:Fn(a.session)}),(0,U.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-1`,children:Ln(a.session).map(e=>(0,U.jsx)(`span`,{className:`rounded-md bg-terminal-surface-2 px-1.5 py-0.5 text-[10px] text-terminal-dim`,children:e},e))}),(0,U.jsxs)(`div`,{className:`text-terminal-dimmer space-y-0.5`,children:[a.session.startTime&&(()=>{let e=new Date(a.session.startTime).getTime(),t=or(e,a.session),n=a.session.startTime,r=new Date(t).toISOString(),i=Mn(n)===Mn(r);return(0,U.jsxs)(`div`,{children:[Mn(n),` `,Nn(n),t!==e&&(0,U.jsxs)(`span`,{children:[` → `,i?``:`${Mn(r)} `,Nn(r)]})]})})(),a.session.durationMs&&(0,U.jsx)(`div`,{className:`text-terminal-blue`,children:Pn(a.session.durationMs)}),(0,U.jsxs)(`div`,{children:[a.session.promptCount,`p · `,a.session.editCount,` `,W(a.session.editCount,`edit`),` · `,a.session.toolCallCount,` `,W(a.session.toolCallCount,`tool`)]}),a.session.gitBranch&&(0,U.jsx)(`div`,{className:`text-terminal-purple`,children:a.session.gitBranch}),(a.session.costEstimate??0)>0&&(0,U.jsxs)(`div`,{className:`text-terminal-orange`,children:[`$`,a.session.costEstimate.toFixed(3)]})]})]})]})}function dr(e,t){let n=t.replace(/\/$/,``);return n&&e.startsWith(`${n}/`)?e.slice(n.length+1):e.split(`/`).slice(-3).join(`/`)}function fr(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:dr(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 pr({groups:e,hideProjectList:t}){let n=(0,_.useMemo)(()=>fr(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,U.jsxs)(`div`,{className:`p-8 text-center space-y-2`,children:[(0,U.jsx)(`div`,{className:`text-terminal-dimmer text-sm font-mono`,children:`No hot files found.`}),(0,U.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,U.jsxs)(`div`,{className:`flex h-full min-w-0 flex-col gap-4 p-4 lg:flex-row`,children:[!t&&(0,U.jsxs)(`div`,{className:`w-full shrink-0 space-y-2 overflow-y-auto lg:w-64`,children:[(0,U.jsxs)(`div`,{className:`px-1`,children:[(0,U.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text`,children:`Hot Files`}),(0,U.jsxs)(`div`,{className:`mt-0.5 text-[10px] font-mono text-terminal-dimmer`,children:[n.length,` `,W(n.length,`project`),` with hot files`]})]}),n.map(e=>(0,U.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,U.jsx)(`div`,{className:`truncate text-xs font-sans font-semibold`,children:P(e.project)}),(0,U.jsx)(`div`,{className:`mt-0.5 truncate text-[10px] font-mono text-terminal-dimmer`,children:e.project}),(0,U.jsxs)(`div`,{className:`mt-1 text-[10px] font-mono text-terminal-dimmer`,children:[e.files.length,` `,W(e.files.length,`file`),` ·`,` `,e.totalEdits.toLocaleString(),` `,W(e.totalEdits,`edit`)]})]},e.project))]}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-4`,children:[(0,U.jsxs)(`div`,{className:`relative overflow-hidden rounded-2xl bg-terminal-bg/35 p-4 shadow-inner`,children:[(0,U.jsx)(`div`,{className:`pointer-events-none absolute -right-12 -top-12 h-28 w-28 rounded-full bg-terminal-green/5 blur-2xl`}),(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text`,children:P(s.project)}),(0,U.jsx)(`div`,{className:`mt-0.5 truncate text-xs font-mono text-terminal-dimmer`,children:s.project}),(0,U.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-[10px] font-mono text-terminal-dimmer`,children:[(0,U.jsxs)(`span`,{className:`rounded-md bg-terminal-green-subtle px-1.5 py-0.5 text-terminal-green`,children:[s.files.length,` `,W(s.files.length,`hot file`)]}),(0,U.jsxs)(`span`,{children:[s.totalEdits.toLocaleString(),` `,W(s.totalEdits,`edit`)]}),(0,U.jsxs)(`span`,{children:[s.totalSessions.toLocaleString(),` `,W(s.totalSessions,`session`)]})]})]})]}),(0,U.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[minmax(0,1fr)_22rem]`,children:[(0,U.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,U.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,U.jsx)(`div`,{className:`truncate text-xs font-mono`,children:e.displayName.split(`/`).pop()}),(0,U.jsx)(`div`,{className:`mt-0.5 truncate text-[10px] font-mono text-terminal-dimmer`,children:e.displayName}),(0,U.jsxs)(`div`,{className:`mt-1 text-[10px] font-mono text-terminal-dimmer`,children:[e.totalEdits.toLocaleString(),` `,W(e.totalEdits,`edit`),` ·`,` `,e.sessions.length,` `,W(e.sessions.length,`session`)]})]},e.file)})}),(0,U.jsx)(`div`,{className:`lg:sticky lg:top-3 lg:self-start lg:max-h-[calc(100vh-7rem)] lg:overflow-y-auto`,children:c?(0,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.jsxs)(`div`,{className:`rounded-2xl bg-terminal-surface p-4 shadow-layer-sm`,children:[(0,U.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text truncate`,children:c.displayName.split(`/`).pop()}),(0,U.jsx)(`div`,{className:`text-xs font-mono text-terminal-dimmer mt-0.5 break-all`,children:c.file}),(0,U.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dimmer mt-1`,children:[c.totalEdits.toLocaleString(),` `,W(c.totalEdits,`edit`),` `,`across `,c.sessions.length,` `,W(c.sessions.length,`session`)]})]}),(0,U.jsx)(`div`,{className:`space-y-2`,children:c.sessions.map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>Rn(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,U.jsx)(`div`,{className:`hidden w-2 h-2 rounded-full mt-1.5 shrink-0 sm:block`,style:{backgroundColor:Vn(e.colorIdx).solid}}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-xs font-sans font-medium text-terminal-text truncate`,children:Fn(e.session)}),(0,U.jsxs)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-0.5`,children:[P(e.session.project),` · `,Mn(e.session.startTime)]})]}),(0,U.jsxs)(`div`,{className:`shrink-0 text-xs font-mono text-terminal-orange`,children:[e.editCount,` `,W(e.editCount,`edit`)]})]},e.session.sessionId))})]}):(0,U.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 mr({view:e,projectFilter:t}){let{sessions:n,loading:r,error:i}=kn(),a=(0,_.useMemo)(()=>t?n.filter(e=>Oe(e.project)===t):n,[n,t]),o=(0,_.useMemo)(()=>Hn(a,{collapseWorktrees:!0}),[a]),s=(0,_.useMemo)(()=>{let e=new Map;for(let t of a){let n=pe(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=>In(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,U.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,U.jsx)(`div`,{className:`pointer-events-none absolute -right-24 -top-24 h-64 w-64 rounded-full bg-terminal-green/5 blur-3xl`}),(0,U.jsxs)(`div`,{className:`relative space-y-4 animate-pulse`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,U.jsx)(`div`,{className:`h-3 w-20 rounded bg-terminal-surface-2`}),(0,U.jsx)(`div`,{className:`h-3 w-24 rounded bg-terminal-surface-2 opacity-70`}),(0,U.jsx)(`div`,{className:`h-3 w-32 rounded bg-terminal-surface-2 opacity-50`})]}),(0,U.jsx)(`div`,{className:`rounded-2xl bg-terminal-bg/35 p-3 shadow-inner`,children:(0,U.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:5},(e,t)=>(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`div`,{className:`h-8 w-32 rounded bg-terminal-surface-2 opacity-60`}),(0,U.jsx)(`div`,{className:`h-9 flex-1 rounded-xl bg-terminal-surface/60 shadow-layer-sm`})]},t))})})]})]}):i?(0,U.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,U.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,U.jsxs)(`div`,{className:`text-terminal-dimmer text-sm font-mono`,children:[`Failed to load: `,i]}),(0,U.jsx)(`div`,{className:`text-terminal-dimmer/60 text-xs font-mono`,children:`Make sure the vibe-replay editor server is running.`})]})}):(0,U.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,U.jsx)(`div`,{className:`pointer-events-none absolute -right-24 -top-24 h-64 w-64 rounded-full bg-terminal-green/5 blur-3xl`}),(0,U.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,U.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,U.jsxs)(`span`,{children:[(0,U.jsx)(`span`,{className:`text-terminal-text`,children:a.length}),` `,W(a.length,`session`)]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`span`,{className:`text-terminal-text`,children:o.length}),` `,W(o.length,`project`)]}),s&&(0,U.jsx)(`span`,{children:(0,U.jsx)(`span`,{className:`text-terminal-purple`,children:s})}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`span`,{className:`text-terminal-blue`,children:Pn(l.durationMs)}),` total time`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsxs)(`span`,{className:`text-terminal-orange`,children:[`$`,l.cost.toFixed(2)]}),` total cost`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`span`,{className:`text-terminal-green`,children:l.edits.toLocaleString()}),` `,W(l.edits,`edit`)]}),c>0&&(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:c}),` estimated timing`]})]}),(0,U.jsxs)(`div`,{className:`relative z-10 min-w-0 flex-1 overflow-y-auto overflow-x-hidden`,children:[e===`timeline`&&(0,U.jsx)(ur,{groups:o}),e===`files`&&(0,U.jsx)(pr,{groups:o,hideProjectList:!!t})]})]})}var hr=[{id:`overview`,label:`Overview`},{id:`timeline`,label:`Timeline`},{id:`files`,label:`Hot Files`}];function gr({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[Ue(a)]||0;r.push(t),t>i&&(i=t),a.setDate(a.getDate()+1)}return{data:r,max:i}},[e]);return(0,U.jsx)(`div`,{className:`flex items-end gap-px ${t===`md`?`h-8`:`h-4`}`,children:n.map((e,t)=>(0,U.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 _r({projects:e,selected:t,onSelect:n}){let r=e.reduce((e,t)=>e+t.sessions,0);return(0,U.jsxs)(`div`,{className:`hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20`,children:[(0,U.jsx)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle`,children:(0,U.jsx)(`span`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold`,children:`Projects`})}),(0,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-2 space-y-0.5`,children:[(0,U.jsxs)(`button`,{onClick:()=>n(je),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,U.jsx)(`span`,{className:`font-medium`,children:`All projects`}),(0,U.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,U.jsx)(`div`,{className:`h-px bg-terminal-border-subtle mx-2 my-1.5`}),e.map(e=>{let r=t===e.project,i=P(e.project);return(0,U.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,U.jsxs)(`div`,{className:`flex items-center justify-between gap-1.5`,children:[(0,U.jsx)(`span`,{className:`text-xs font-sans truncate ${r?`text-terminal-green font-medium`:`text-terminal-text`}`,children:i}),(0,U.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,U.jsx)(`div`,{className:`mt-1 ml-0.5 text-xs font-mono truncate ${r?`text-terminal-dim`:`text-terminal-dimmer`}`,children:nt(e.lastActivity,`long`)})]},e.project)})]})]})}function vr({project:e,insight:t,onOpenSessions:n}){let r=P(e);return(0,U.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,U.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,U.jsx)(`span`,{className:`pointer-events-none absolute -right-10 -top-12 h-32 w-32 rounded-full bg-terminal-green/5 blur-2xl`}),(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-base font-sans font-semibold text-terminal-text truncate`,children:r}),(0,U.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dimmer truncate mt-0.5`,children:e})]}),t.lastActivity&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer shrink-0`,children:nt(t.lastActivity,`long`)})]}),(0,U.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 sm:grid-cols-4 gap-3 text-xs font-mono`,children:[(0,U.jsx)(yr,{label:W(t.sessions,`session`),value:t.sessions.toString(),tone:`text`}),t.durationMs>0&&(0,U.jsx)(yr,{label:`active time`,value:ot(t.durationMs),tone:`blue`}),t.cost>0&&(0,U.jsx)(yr,{label:`cost`,value:`$${t.cost.toFixed(2)}`,tone:`orange`}),(0,U.jsx)(yr,{label:W(t.prompts,`prompt`),value:G(t.prompts),tone:`green`})]}),(0,U.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 text-[10px] font-mono text-terminal-dimmer flex-wrap`,children:[t.toolCalls>0&&(0,U.jsxs)(`span`,{children:[G(t.toolCalls),` `,W(t.toolCalls,`tool`)]}),t.edits>0&&(0,U.jsxs)(`span`,{children:[G(t.edits),` `,W(t.edits,`edit`)]}),t.branchCount>0&&(0,U.jsxs)(`span`,{children:[t.branchCount,` `,W(t.branchCount,`branch`,`branches`)]}),t.prCount>0&&(0,U.jsxs)(`span`,{children:[t.prCount,` `,W(t.prCount,`PR`)]}),t.memoryFileCount>0&&(0,U.jsxs)(`span`,{children:[t.memoryFileCount,` `,W(t.memoryFileCount,`memory file`)]})]}),(0,U.jsxs)(`div`,{className:`mt-4`,children:[(0,U.jsx)(gr,{sessionsPerDay:t.sessionsPerDay,size:`md`}),(0,U.jsx)(`div`,{className:`mt-1 text-[10px] font-mono text-terminal-dimmer`,children:`last 30 days`})]}),(0,U.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 yr({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,U.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg/40 p-2.5`,children:[(0,U.jsx)(`div`,{className:`text-sm font-sans font-semibold tabular-nums ${r}`,children:t}),(0,U.jsx)(`div`,{className:`mt-0.5 text-[10px] font-mono text-terminal-dimmer`,children:e})]})}function br({projects:e,onProjectClick:t}){return(0,U.jsx)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-3`,children:e.map(e=>{let n=P(e.project);return(0,U.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,U.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,U.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,U.jsxs)(`div`,{className:`flex items-start justify-between gap-2 mb-3`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-sm font-sans font-medium text-terminal-text truncate group-hover:text-terminal-green transition-colors`,children:n}),(0,U.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dimmer truncate mt-0.5`,children:e.project})]}),e.lastActivity&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer shrink-0`,children:nt(e.lastActivity,`long`)})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3 text-xs font-mono flex-wrap mb-3`,children:[(0,U.jsxs)(`span`,{className:`text-terminal-text tabular-nums`,children:[e.sessions,` `,(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:W(e.sessions,`session`)})]}),e.durationMs>0&&(0,U.jsx)(`span`,{className:`text-terminal-blue tabular-nums`,children:ot(e.durationMs)}),e.cost>0&&(0,U.jsxs)(`span`,{className:`text-terminal-orange tabular-nums`,children:[`$`,e.cost.toFixed(2)]}),(0,U.jsxs)(`span`,{className:`text-terminal-green tabular-nums`,children:[G(e.prompts),` `,(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:W(e.prompts,`prompt`)})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] font-mono text-terminal-dimmer flex-wrap mb-2`,children:[e.toolCalls>0&&(0,U.jsxs)(`span`,{children:[G(e.toolCalls),` `,W(e.toolCalls,`tool`)]}),e.edits>0&&(0,U.jsxs)(`span`,{children:[G(e.edits),` `,W(e.edits,`edit`)]}),e.branchCount>0&&(0,U.jsxs)(`span`,{children:[e.branchCount,` `,W(e.branchCount,`branch`,`branches`)]}),e.prCount>0&&(0,U.jsxs)(`span`,{children:[e.prCount,` `,W(e.prCount,`PR`)]}),e.memoryFileCount>0&&(0,U.jsxs)(`span`,{children:[e.memoryFileCount,` `,e.memoryFileCount===1?`Claude memory`:`Claude memories`]})]}),(0,U.jsx)(gr,{sessionsPerDay:e.sessionsPerDay})]},e.project)})})}function xr({onNavigate:e}){let{userInsights:t,scanStatus:n}=ut(),[r,i]=(0,_.useState)(je),[a,o]=(0,_.useState)(`overview`),s=(0,_.useMemo)(()=>{if(!t)return[];let e=ke(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,U.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,U.jsxs)(`div`,{className:`text-center space-y-2 text-terminal-dimmer text-sm font-mono`,children:[(0,U.jsx)(`p`,{children:`No scan data available yet.`}),(0,U.jsx)(`p`,{className:`text-xs`,children:`Projects will appear once the background scan completes.`})]})});if(!t&&l)return(0,U.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-terminal-dim text-sm font-mono`,children:[(0,U.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(()=>V({tab:`sessions`,project:t}),50)},d=s.map(e=>({project:e.project,sessions:e.sessions,lastActivity:e.lastActivity})),f=r!==je,p=f?hr.filter(e=>e.id!==`timeline`):hr,m=p.some(e=>e.id===a)?a:`overview`,h=f?r:void 0;return(0,U.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,U.jsx)(_r,{projects:d,selected:r,onSelect:e=>{i(e),o(`overview`)}}),(0,U.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-0 min-w-0 overflow-y-auto`,children:[(0,U.jsx)(`div`,{className:`md:hidden px-3 pt-3`,children:(0,U.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,U.jsxs)(`option`,{value:je,children:[`All projects (`,s.length,`)`]}),s.map(e=>(0,U.jsxs)(`option`,{value:e.project,children:[P(e.project),` (`,e.sessions,`)`]},e.project))]})}),(0,U.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,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsxs)(`h2`,{className:`text-sm font-sans font-semibold text-terminal-text truncate`,children:[r===`__all__`?`All Projects`:P(r),r===`__all__`&&(0,U.jsxs)(`span`,{className:`ml-2 text-terminal-dimmer font-normal`,children:[`(`,s.length,`)`]})]}),l&&(0,U.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5 text-[10px] font-mono text-terminal-dim`,children:[(0,U.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-terminal-purple animate-pulse`}),`Analyzing... `,n.scanned,`/`,n.total]})]}),(0,U.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,U.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,U.jsxs)(`div`,{className:`px-4 md:px-6 pb-6 space-y-4`,children:[m===`overview`&&r===`__all__`&&(0,U.jsx)(br,{projects:s,onProjectClick:i}),m===`overview`&&c&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(vr,{project:r,insight:c,onOpenSessions:()=>u(r)}),(0,U.jsx)(mr,{view:`timeline`,projectFilter:h})]}),m===`timeline`&&(0,U.jsx)(mr,{view:`timeline`,projectFilter:h}),m===`files`&&(0,U.jsx)(mr,{view:`files`,projectFilter:h})]})]})]})}var Sr=null,Cr=null;function wr(){return Sr?Promise.resolve(Sr):Cr||(Cr=fetch(`/api/scan/results`).then(e=>e.ok?e.json():null).then(e=>{let t={results:e?.results??null,finishedAt:e?.finishedAt};return Sr=t,setTimeout(()=>{Sr=null,Cr=null},3e4),t}).catch(()=>null),Cr)}function Tr(e,t){let n=e.existingReplay||e.replay?.slug;return[{id:`source`,label:`Session`,description:`Source session discovery JSON, plus the latest scan/enrichment data.`,data:{sourceSession:e,scanData:t,replaySummary:e.replay??null}},...n?[{id:`replay`,label:`Replay`,description:`Full generated replay.json for this source session.`,fetchReplaySlug:n}]:[]]}function Er(e){return[{id:`summary`,label:`Summary`,description:`Dashboard replay summary JSON.`,data:e},{id:`replay`,label:`Replay`,description:`Full generated replay.json including scenes, metadata, and annotations.`,fetchReplaySlug:e.slug}]}function Dr(e){try{return JSON.stringify(e,null,2)}catch(e){return`/* Failed to stringify JSON: ${ye(e)} */`}}function Or({title:e,subtitle:t,items:n,initialItemId:r,onClose:i}){let[a,o]=(0,_.useState)(r||n[0]?.id||``),[s,c]=(0,_.useState)({}),[l,u]=(0,_.useState)({}),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(`idle`),[h,g]=(0,_.useState)(0),v=(0,_.useRef)(null),y=(0,_.useRef)(null),b=(0,_.useRef)(null),x=n.find(e=>e.id===a)||n[0],S=x?.fetchReplaySlug?s[x.id]:x?.data,C=x?s[x.id]!==void 0:!0,w=(0,_.useMemo)(()=>S===void 0?``:Dr(S),[S]);(0,_.useEffect)(()=>(b.current=document.activeElement instanceof HTMLElement?document.activeElement:null,y.current?.focus(),()=>{b.current?.focus()}),[]),(0,_.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){e.preventDefault(),e.stopImmediatePropagation(),i();return}if(e.key!==`Tab`)return;let t=Array.from(v.current?.querySelectorAll(`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)||[]).filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`);if(t.length===0)return;let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[i]),(0,_.useEffect)(()=>{let e=x?.id,t=x?.fetchReplaySlug;if(!e||!t||C)return;let n=!1;return f(e),u(t=>({...t,[e]:``})),fetch(`/api/session?slug=${encodeURIComponent(t)}`).then(async e=>{let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error||`Failed to load replay JSON`);return t}).then(t=>{n||c(n=>({...n,[e]:t}))}).catch(t=>{n||u(n=>({...n,[e]:xe(t)}))}).finally(()=>{n||f(null)}),()=>{n=!0}},[x?.id,x?.fetchReplaySlug,C,h]);let T=async()=>{if(w){try{await navigator.clipboard.writeText(w),m(`copied`)}catch{m(`failed`)}setTimeout(()=>m(`idle`),1500)}};return(0,U.jsxs)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center p-4`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`raw-json-modal-title`,children:[(0,U.jsx)(`div`,{className:`absolute inset-0 bg-black/70 backdrop-blur-md animate-in fade-in duration-200`,onClick:i}),(0,U.jsxs)(`div`,{ref:v,className:`relative w-full max-w-6xl max-h-[88vh] 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 overflow-hidden`,onClick:e=>e.stopPropagation(),children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-6 py-4 border-b border-terminal-border-subtle`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-1`,children:`Raw JSON`}),(0,U.jsx)(`h2`,{id:`raw-json-modal-title`,className:`text-lg font-sans font-semibold text-terminal-text truncate`,children:e}),t&&(0,U.jsx)(`p`,{className:`mt-1 text-xs font-mono text-terminal-dimmer truncate`,children:t})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,U.jsx)(`button`,{onClick:T,disabled:!w,className:`h-8 px-3 text-xs font-sans font-semibold rounded-lg bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors disabled:opacity-40`,children:p===`copied`?`Copied`:p===`failed`?`Copy failed`:`Copy`}),(0,U.jsx)(`button`,{ref:y,onClick:i,className:`h-8 w-8 flex items-center justify-center rounded-lg text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors`,"aria-label":`Close raw JSON modal`,children:(0,U.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,U.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`})})})]})]}),n.length>1&&(0,U.jsx)(`div`,{className:`flex items-center gap-2 px-6 py-3 border-b border-terminal-border-subtle bg-terminal-surface/30`,children:n.map(e=>(0,U.jsx)(`button`,{onClick:()=>{o(e.id),m(`idle`)},className:`h-8 px-3 text-xs font-sans font-semibold rounded-lg transition-colors ${a===e.id?`bg-terminal-green-subtle text-terminal-green`:`bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,children:e.label},e.id))}),(0,U.jsx)(`div`,{className:`px-6 py-3 border-b border-terminal-border-subtle`,children:(0,U.jsx)(`p`,{className:`text-xs font-mono text-terminal-dimmer`,children:x?.description||`Inspect the raw JSON backing this dashboard row.`})}),(0,U.jsx)(`div`,{className:`flex-1 min-h-0 overflow-auto bg-[#050807]`,children:d===x?.id?(0,U.jsx)(`div`,{className:`p-6 text-sm font-mono text-terminal-dim animate-pulse`,children:`Loading JSON...`}):x&&l[x.id]?(0,U.jsxs)(`div`,{className:`p-6 flex items-center gap-3`,children:[(0,U.jsx)(`span`,{className:`text-sm font-mono text-terminal-red`,children:l[x.id]}),x.fetchReplaySlug&&(0,U.jsx)(`button`,{onClick:()=>g(e=>e+1),className:`h-8 px-3 text-xs font-sans font-semibold rounded-lg bg-terminal-red-subtle text-terminal-red hover:bg-terminal-red-emphasis transition-colors`,children:`Retry`})]}):w?(0,U.jsx)(`pre`,{className:`p-6 text-xs leading-relaxed font-mono text-terminal-dim whitespace-pre-wrap break-words`,children:w}):(0,U.jsx)(`div`,{className:`p-6 text-sm font-mono text-terminal-dimmer`,children:`No JSON available.`})})]})]})}function kr({session:e,scanData:t=null,onClose:n,onGenerate:r,onViewReplay:i,onArchive:a,onTitleSave:o,onDeleteReplay:s,onRawData:c,isGenerating:l,isArchived:u}){let[d,f]=(0,_.useState)(t),[p,m]=(0,_.useState)(!t),h=ae(e),g=oe(e,d),[v,y]=(0,_.useState)(e.replay?.title||g),[b,x]=(0,_.useState)(!1),S=(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=S.current;e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length))},[]),(0,_.useEffect)(()=>{f(t)},[t]),(0,_.useEffect)(()=>{if(t){m(!1);return}let n=!1;return m(!0),wr().then(t=>{if(n)return;let r=t?.results?.find(t=>t.slug===e.slug);r&&f(r),m(!1)}),()=>{n=!0}},[t,e.slug]),(0,_.useEffect)(()=>{y(t=>{let n=F(t),r=F(g),i=F(e.replay?.title);return!n||n===i||n===e.slug||r&&n===F(h)?e.replay?.title||g:t})},[h,g,e.replay?.title,e.slug]);let C=B(d?.gitBranch||e.gitBranch),w=d?.model||e.model,T=z(e,d,g),E=d?.dataQualityNotes||[],D=Xt(e,d),j=p&&!Yt(d),N=d?.promptCount??e.promptCount,I=d?.toolCallCount??e.toolCallCount,L=d?.editCount??e.editCountEst,te=d?.durationMs??e.durationMsEst,ne=d?.costEstimate??e.replay?.stats?.costEstimate,R=d?.tokenUsage?d.tokenUsage.inputTokens+d.tokenUsage.outputTokens:void 0,re=d?.startTime||e.timestamp,ie=async()=>{if(!e.replay||b)return;let t=F(v);if(t!==F(e.replay.title||g)){x(!0);try{await o(e.slug,t)}finally{x(!1)}}},se=()=>{r(e,v)};return(0,U.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,children:[(0,U.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-md animate-in fade-in duration-300`,onClick:n}),(0,U.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,U.jsxs)(`div`,{className:`flex items-center justify-between px-7 pt-5 pb-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(Ke,{provider:e.provider}),(0,U.jsx)(Zt,{state:D,compact:!0}),w&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-surface-2 text-terminal-dimmer`,children:A(w)}),(d?.dataSource||e.hasSdk)&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full ${_e(d?.dataSource,e.hasSqlite,e.hasSdk)}`,children:Te(e.hasSqlite,d?.dataSource,e.hasSdk)}),d?.entrypoint&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-surface-2 text-terminal-dimmer`,children:d.entrypoint}),d?.permissionMode===`bypassPermissions`&&(0,U.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`}),d?.skillsUsed?.map(e=>(0,U.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)),d?.mcpServersUsed?.map(e=>(0,U.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,U.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,U.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,U.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,U.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`})})})]}),(0,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-7 space-y-5 pb-5`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-2 px-1`,children:[(0,U.jsx)(`span`,{className:`text-xs font-sans uppercase tracking-widest text-terminal-dimmer`,children:`Title`}),(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:e.slug})]}),(0,U.jsx)(`form`,{onSubmit:t=>{t.preventDefault(),e.replay?ie():se()},children:(0,U.jsx)(`textarea`,{ref:S,value:v,onChange:e=>y(e.target.value.replace(/\n/g,``)),onBlur:()=>{e.replay&&ie()},onKeyDown:t=>{t.key===`Enter`&&(t.preventDefault(),e.replay?ie():se())},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:g,maxLength:120})})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-5`,children:[(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl px-5 py-4 space-y-2.5`,children:[(0,U.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-1`,children:`Session Info`}),(0,U.jsx)(Ye,{label:`Project`,value:P(e.project),title:e.project}),e.gitRepo&&(0,U.jsx)(Ye,{label:`Repo`,value:e.gitRepo}),C&&(0,U.jsx)(Ye,{label:`Branch`,value:C}),d?.gitBranches&&d.gitBranches.length>1&&(0,U.jsx)(Ye,{label:`Branches`,value:d.gitBranches.join(`, `)}),d?.skillsUsed&&d.skillsUsed.length>0&&(0,U.jsx)(Ye,{label:`Skills`,value:d.skillsUsed.join(`, `)}),d?.mcpServersUsed&&d.mcpServersUsed.length>0&&(0,U.jsx)(Ye,{label:`MCP Servers`,value:d.mcpServersUsed.join(`, `)}),(0,U.jsx)(Ye,{label:`Started`,value:`${O(re)} (${ee(re)})`}),d?.endTime&&(0,U.jsx)(Ye,{label:`Ended`,value:O(d.endTime)}),!!te&&(0,U.jsx)(Ye,{label:`Duration`,value:`~${ot(te)}`}),(0,U.jsx)(Ye,{label:`Size`,value:M(e.fileSize)}),(0,U.jsx)(Ye,{label:`Lines`,value:e.lineCount.toLocaleString()}),e.filePaths.length>1&&(0,U.jsx)(Ye,{label:`Parts`,value:`${e.filePaths.length} files`}),(0,U.jsx)(Ye,{label:`Data`,value:Te(e.hasSqlite,d?.dataSource,e.hasSdk)})]}),(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl px-5 py-4 space-y-2.5`,children:[(0,U.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-1`,children:`Stats`}),!!N&&(0,U.jsx)(Ye,{label:`Prompts`,value:String(N)}),!!I&&(0,U.jsx)(Ye,{label:`Tools`,value:String(I)}),!!L&&(0,U.jsx)(Ye,{label:`Edits`,value:d?String(L):`~${L}`}),ne!=null&&ne>0&&(0,U.jsx)(Ye,{label:`Cost`,value:k(ne)}),R!=null&&(0,U.jsx)(Ye,{label:`Tokens`,value:R.toLocaleString(),title:d?.tokenUsage?`In: ${d.tokenUsage.inputTokens.toLocaleString()} / Out: ${d.tokenUsage.outputTokens.toLocaleString()} / Cache write: ${d.tokenUsage.cacheCreationTokens.toLocaleString()} / Cache read: ${d.tokenUsage.cacheReadTokens.toLocaleString()}`:void 0}),d!=null&&d.subAgentCount>0&&(0,U.jsx)(Ye,{label:`Agents`,value:`${d.subAgentCount} sub-agents`}),d!=null&&d.compactionCount>0&&(0,U.jsx)(Ye,{label:`Compacts`,value:String(d.compactionCount)}),d!=null&&d.apiErrorCount>0&&(0,U.jsx)(Ye,{label:`Errors`,value:`${d.apiErrorCount} API errors`}),e.hasPR&&!d?.prLinks?.length&&(0,U.jsx)(Ye,{label:`PR`,value:`Yes`}),d?.prLinks?.map(e=>(0,U.jsx)(Ye,{label:`PR`,value:`#${e.prNumber} (${e.prRepository})`},e.prNumber))]})]}),(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl px-5 py-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-3`,children:[(0,U.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer`,children:`Data Readiness`}),(0,U.jsx)(Zt,{state:D,active:j})]}),(0,U.jsx)(en,{state:D,active:j,className:`mb-3`}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-x-5 gap-y-2`,children:[(0,U.jsx)($t,{ready:!0,label:`Basic discovery loaded`,pendingLabel:`Waiting for discovery`}),(0,U.jsx)($t,{ready:qt(e),label:`Title, prompt previews, or model enriched`,pendingLabel:`Title and prompt previews not enriched yet`}),(0,U.jsx)($t,{ready:Jt(e,d),label:`Prompt/tool counts loaded`,pendingLabel:`Prompt/tool counts not loaded yet`}),(0,U.jsx)($t,{ready:Yt(d),label:`Rich metrics loaded`,pendingLabel:`Rich metrics deferred for this source`})]})]}),E.length>0&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2`,children:`Data Quality`}),(0,U.jsx)(`div`,{className:`bg-terminal-surface rounded-xl px-4 py-3 space-y-1.5`,children:E.map(e=>(0,U.jsxs)(`div`,{className:`flex gap-2 items-start text-xs font-mono text-terminal-dim`,children:[(0,U.jsx)(`span`,{className:`text-terminal-orange shrink-0 mt-px`,children:`!`}),(0,U.jsx)(`span`,{children:e})]},e))})]}),d?.filesModified&&d.filesModified.length>0&&(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2`,children:[`Files Modified (`,d.filesModified.length,`)`]}),(0,U.jsxs)(`div`,{className:`max-h-[120px] overflow-y-auto bg-terminal-surface rounded-xl px-4 py-2.5 space-y-1`,children:[d.filesModified.slice(0,20).map(e=>(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs font-mono`,children:[(0,U.jsx)(`span`,{className:`text-terminal-dim truncate`,children:e.file}),(0,U.jsxs)(`span`,{className:`text-terminal-dimmer shrink-0 tabular-nums`,children:[e.count,`x`]})]},e.file)),d.filesModified.length>20&&(0,U.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dimmer`,children:[`+`,d.filesModified.length-20,` more files`]})]})]}),T.length>0&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2`,children:`Prompts`}),(0,U.jsx)(`div`,{className:`max-h-[180px] overflow-y-auto space-y-1.5 pr-1`,children:T.map((e,t)=>(0,U.jsxs)(`div`,{className:`flex gap-2 items-start`,children:[(0,U.jsx)(`span`,{className:`text-xs text-terminal-green shrink-0 mt-px select-none`,children:`>`}),(0,U.jsx)(`p`,{className:`text-sm text-terminal-dim line-clamp-2 leading-relaxed`,children:e})]},t))})]}),e.replay&&(0,U.jsxs)(`div`,{className:`border-t border-terminal-border-subtle pt-4`,children:[(0,U.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2`,children:`Replay`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[e.replay.replaySize!=null&&(0,U.jsx)(`span`,{className:`text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dim`,children:M(e.replay.replaySize)}),e.replay.generatorVersion&&(0,U.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,U.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,U.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,U.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,U.jsxs)(`div`,{className:`flex items-center justify-between px-7 py-4 border-t border-terminal-border-subtle`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c&&(0,U.jsxs)(`button`,{onClick:()=>c(e,d),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,U.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,U.jsx)(`path`,{d:`M5 3L2 8l3 5M11 3l3 5-3 5M7 12l2-8`})}),`Raw JSON`]}),(0,U.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,U.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,U.jsx)(`path`,{d:`M2 4h12v2H2zM3 6v7h10V6M6.5 8h3`})}),u?`Unarchive`:`Archive`]}),e.replay&&(0,U.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,U.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,U.jsx)(`path`,{d:`M3 4h10M5.5 4V3h5v1M6 7v4M10 7v4M4.5 4l.5 9h6l.5-9`})}),`Delete replay`]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.sessionId&&(0,U.jsxs)(`button`,{onClick:()=>ce(e.provider,e.sessionId),title:`Stream this source session as the provider writes new turns`,className:`h-11 px-5 text-sm font-sans font-semibold rounded-xl bg-terminal-red-subtle text-terminal-red hover:bg-terminal-red-emphasis transition-all duration-200 flex items-center gap-2`,children:[(0,U.jsxs)(`span`,{className:`relative flex w-2 h-2`,children:[(0,U.jsx)(`span`,{className:`absolute inline-flex h-full w-full rounded-full bg-terminal-red opacity-75 animate-ping`}),(0,U.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-red`})]}),`Watch live`]}),e.replay&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{onClick:()=>r(e,v),disabled:l,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:l?(0,U.jsx)(`span`,{className:`animate-pulse`,children:`Regenerating...`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,U.jsx)(`path`,{d:`M21 3v5h-5`}),(0,U.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,U.jsx)(`path`,{d:`M8 16H3v5`})]}),`Regenerate`]})}),(0,U.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,U.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,U.jsx)(`path`,{d:`M5 3l8 5-8 5V3z`})}),`View Replay`]})]}),!e.replay&&(0,U.jsx)(`button`,{onClick:se,disabled:l,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:l?(0,U.jsx)(`span`,{className:`animate-pulse`,children:`Generating...`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,U.jsx)(`path`,{d:`M8 2v12M2 8h12`})}),`Generate Replay`]})})]})]})]})]})}function Ar({summary:e,onOpen:t,onShare:n,onTitleSave:r,onDelete:i,onRegenerate:a,onArchive:o,onRawData:s,isDeleting:c,isRegenerating:l,isArchived:u}){let[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(!1),h=(0,_.useRef)(null);v(h,(0,_.useCallback)(()=>{m(!1),f(!1)},[]),p);let g=Oe(e.project),y=g!==e.project,b=se(e),x=(e.messages||(e.firstMessage?[e.firstMessage]:[])).map(e=>R(e||``)).filter(e=>e.length>0&&F(e)!==b),S=e.gitRepo?`https://github.com/${e.gitRepo}`:void 0,C=[he(e.provider),e.model?A(e.model):null].filter(Boolean).join(` · `),w=!!(e.cloud||e.gist),T=e.replaySize!=null&&e.replaySize>10*1024*1024,E=e.stats.tokenUsage?`${N(e.stats.tokenUsage.cacheReadTokens)} cache read · ${N(e.stats.tokenUsage.cacheCreationTokens)} cache write · ${N(e.stats.tokenUsage.inputTokens)} in · ${N(e.stats.tokenUsage.outputTokens)} out`:`Estimated cost`;return(0,U.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 shadow-layer-sm cursor-pointer hover-lift ${u?`opacity-50`:``}`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-2.5 min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`mt-0.5`,children:(0,U.jsx)(Ke,{provider:e.provider,title:C})}),r?(0,U.jsx)(`div`,{className:`min-w-0 flex-1`,onClick:e=>e.stopPropagation(),children:(0,U.jsx)(qe,{slug:e.slug,title:e.title,fallbackTitle:b,onSave:r,hideSlug:!0})}):(0,U.jsx)(`span`,{className:`text-sm font-sans font-medium text-terminal-text leading-snug line-clamp-2`,children:b})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,U.jsxs)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer whitespace-nowrap hidden sm:inline`,children:[e.slug,` · `,O(e.startTime)]}),(i||o||s)&&(0,U.jsxs)(`div`,{className:`relative`,ref:h,children:[(0,U.jsx)(`button`,{onClick:e=>{e.stopPropagation(),m(e=>!e),f(!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,U.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`currentColor`,children:[(0,U.jsx)(`circle`,{cx:`8`,cy:`3`,r:`1.5`}),(0,U.jsx)(`circle`,{cx:`8`,cy:`8`,r:`1.5`}),(0,U.jsx)(`circle`,{cx:`8`,cy:`13`,r:`1.5`})]})}),p&&(0,U.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:[s&&(0,U.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),s(),m(!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,U.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,U.jsx)(`path`,{d:`M5 3L2 8l3 5M11 3l3 5-3 5M7 12l2-8`})}),`Raw JSON`]}),o&&(0,U.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),o(),m(!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,U.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,U.jsx)(`path`,{d:`M2 4h12v2H2zM3 6v7h10V6M6.5 8h3`})}),u?`Unarchive`:`Archive`]}),i&&(0,U.jsxs)(U.Fragment,{children:[o&&(0,U.jsx)(`div`,{className:`mx-2 my-1 border-t border-terminal-border`}),d?(0,U.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1`,children:[(0,U.jsx)(`button`,{onClick:e=>{e.stopPropagation(),i(),f(!1),m(!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,U.jsx)(`button`,{onClick:()=>f(!1),className:`h-6 px-2 text-xs font-sans rounded text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`})]}):(0,U.jsxs)(`button`,{onClick:()=>f(!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,U.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,U.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`]})]})]})]})]})]}),x.map((e,t)=>(0,U.jsxs)(`div`,{className:`flex gap-2 items-start`,children:[(0,U.jsx)(`span`,{className:`text-xs text-terminal-green shrink-0 mt-px select-none`,children:`>`}),(0,U.jsx)(`p`,{className:`text-sm text-terminal-dim line-clamp-1 leading-relaxed`,children:e})]},t)),(0,U.jsxs)(`div`,{className:`flex items-center gap-x-2.5 gap-y-1 flex-wrap text-xs font-mono text-terminal-dim`,children:[(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1 max-w-[240px] truncate`,title:e.project,children:[(0,U.jsx)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,className:`text-terminal-dimmer shrink-0`,children:(0,U.jsx)(`path`,{d:`M1.5 4.5a1 1 0 0 1 1-1h3l1.5 1.5h5a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1h-10a1 1 0 0 1-1-1z`})}),g]}),e.gitRepo&&S&&(0,U.jsxs)(`a`,{href:S,target:`_blank`,rel:`noreferrer`,onClick:e=>e.stopPropagation(),className:`inline-flex items-center gap-1 hover:text-terminal-blue hover:underline shrink-0`,title:`Open repo on GitHub`,children:[(0,U.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`text-terminal-dimmer`,children:(0,U.jsx)(`path`,{d:`M8 1a7 7 0 0 0-2.2 13.6c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.8-.78-1.02-.78-1.02-.64-.44.05-.43.05-.43.7.05 1.07.72 1.07.72.63 1.08 1.65.77 2.05.59.06-.46.25-.77.45-.95-1.56-.18-3.2-.78-3.2-3.47 0-.77.27-1.4.72-1.89-.07-.18-.31-.9.07-1.87 0 0 .59-.19 1.93.72a6.7 6.7 0 0 1 3.5 0c1.34-.91 1.93-.72 1.93-.72.38.97.14 1.69.07 1.87.45.49.72 1.12.72 1.89 0 2.7-1.64 3.29-3.2 3.46.25.22.48.65.48 1.31v1.95c0 .19.13.4.49.33A7 7 0 0 0 8 1z`})}),e.gitRepo]}),y&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple uppercase tracking-wider shrink-0`,title:`Agent worktree: ${e.project}`,children:`worktree`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-x-3.5 gap-y-1 flex-wrap text-xs font-mono tabular-nums py-2 border-y border-terminal-border-subtle`,children:[!!e.stats.durationMs&&(0,U.jsx)(`span`,{className:`text-terminal-text`,children:ot(e.stats.durationMs)}),(0,U.jsxs)(`span`,{className:`text-terminal-text`,children:[e.stats.userPrompts,` `,(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:`prompts`})]}),(0,U.jsxs)(`span`,{className:`text-terminal-text`,children:[e.stats.toolCalls,` `,(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:`tools`})]}),!!e.stats.costEstimate&&(0,U.jsx)(`span`,{className:`text-terminal-green`,title:E,children:k(e.stats.costEstimate)}),e.hasAnnotations&&(0,U.jsxs)(`span`,{className:`text-terminal-blue`,children:[e.annotationCount,` annotation`,e.annotationCount===1?``:`s`]})]}),(0,U.jsxs)(`div`,{className:`flex items-end justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-x-2 gap-y-1 flex-wrap text-xs font-mono min-w-0`,children:[e.replaySize!=null&&e.replaySize>0&&(0,U.jsx)(`span`,{className:`tabular-nums ${T?`px-1.5 py-0.5 rounded-md bg-terminal-red-subtle text-terminal-red`:`text-terminal-dimmer`}`,title:T?`Exceeds share limit (10MB)`:`Replay size`,children:M(e.replaySize)}),e.replayOutdated&&(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md bg-terminal-orange-subtle text-terminal-orange`,title:`Generated with v${e.generatorVersion||`?`} — regenerate to update`,children:[(0,U.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,U.jsx)(`path`,{d:`M2.5 8a5.5 5.5 0 019.3-4M13.5 8a5.5 5.5 0 01-9.3 4`}),(0,U.jsx)(`path`,{d:`M12.5 1v3h-3M3.5 15v-3h3`})]}),`outdated`]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-mono px-1.5 py-0.5 rounded-md ${w?`bg-terminal-green-subtle text-terminal-green`:`bg-terminal-blue-subtle text-terminal-blue`}`,title:w?`Replay is shared (cloud/gist)`:`Local replay ready to view`,children:w?`Shared`:`Replay`}),e.gist?.outdated&&(0,U.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,U.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,U.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,U.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 ${w?`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:w?`Already shared — view or update`:`Share & Export`,children:[w?(0,U.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,U.jsx)(`path`,{d:`M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z`})}):(0,U.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,U.jsx)(`path`,{d:`M8 2v8M5 5l3-3 3 3M3 11v2h10v-2`})}),w?`Shared`:`Share`]}),a&&(0,U.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),a()},disabled:l,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:[l?(0,U.jsx)(`span`,{className:`animate-pulse`,children:`...`}):(0,U.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,U.jsx)(`path`,{d:`M21 3v5h-5`}),(0,U.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,U.jsx)(`path`,{d:`M8 16H3v5`})]}),`Redo`]}),(0,U.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,U.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,U.jsx)(`polygon`,{points:`4 2 14 8 4 14`})}),`View`]})]})]})]})}var jr=100,Mr=1440*60*1e3;function Nr(e){return e===`__no_repo__`?`No repo`:e}function Pr(e,t){return t.get(e)||P(e)||`(unknown project)`}function Fr(e){return e.toLowerCase()}function Ir(e,t){let n=new Map;for(let r of e){let e=t(r);n.set(e,(n.get(e)||0)+1)}return n}function Lr(e){return[...e.entries()].sort((e,t)=>e[0]===`__no_repo__`&&t[0]!==`__no_repo__`?1:t[0]===`__no_repo__`&&e[0]!==`__no_repo__`?-1:t[1]===e[1]?Fr(e[0]).localeCompare(Fr(t[0])):t[1]-e[1])}function Rr({label:e,value:t,onRemove:n}){return(0,U.jsxs)(`button`,{onClick:n,className:`ui-pill rounded-full bg-terminal-surface text-terminal-dim ring-1 ring-terminal-border-subtle pl-2.5 pr-2 py-1 hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors`,title:`Remove ${e}: ${t}`,children:[(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:e}),(0,U.jsx)(`span`,{className:`max-w-[220px] truncate`,children:t}),(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:`×`})]})}function zr({title:e,count:t}){return(0,U.jsx)(`div`,{className:`mb-2 px-3 pt-0.5`,children:(0,U.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,U.jsx)(`span`,{className:`ui-section-title-strong truncate`,children:e}),t!=null&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono tabular-nums text-terminal-dimmer shrink-0`,children:t})]})})}function Br({title:e,entries:t,selected:n,onToggle:r,labelFor:i,leadingFor:a,titleFor:o,max:s=12}){let[c,l]=(0,_.useState)(!1);(0,_.useEffect)(()=>{t.length<=s&&l(!1)},[t.length,s]);let u=c?t:t.slice(0,s);return(0,U.jsxs)(`div`,{className:`space-y-1 border-t border-terminal-border-subtle pt-4`,children:[(0,U.jsx)(zr,{title:e,count:t.length}),u.map(([e,t])=>{let s=n.includes(e);return(0,U.jsxs)(`button`,{"aria-pressed":s,onClick:()=>r(e),title:o?.(e)||i(e),className:`w-full text-left px-3 py-2 rounded-lg transition-all duration-200 ease-material flex items-center justify-between gap-2 group ${s?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface`}`,children:[(0,U.jsxs)(`span`,{className:`min-w-0 flex items-center gap-2`,children:[a&&(0,U.jsx)(`span`,{className:`shrink-0`,children:a(e)}),(0,U.jsx)(`span`,{className:`text-xs font-sans truncate font-medium`,children:i(e)})]}),(0,U.jsx)(`span`,{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs shrink-0 ${s?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer group-hover:text-terminal-dim`}`,children:t})]},e)}),t.length>s&&!c&&(0,U.jsxs)(`button`,{onClick:()=>l(!0),className:`w-full rounded-md px-3 py-1.5 text-left ui-caption-muted hover:text-terminal-text hover:bg-terminal-surface transition-colors`,children:[`Show `,t.length-s,` more`]}),t.length>s&&c&&(0,U.jsx)(`button`,{onClick:()=>l(!1),className:`w-full rounded-md px-3 py-1.5 text-left ui-caption-muted hover:text-terminal-text hover:bg-terminal-surface transition-colors`,children:`Show fewer`})]})}function Vr(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)({}),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!0),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(!1),[m,h]=(0,_.useState)(null),[g,v]=(0,_.useState)(null),[y,b]=(0,_.useState)(null),[x,S]=(0,_.useState)(()=>Date.now()),{selectedProject:w,filter:O,showArchived:j,selectedProviders:I,selectedRepos:L,handleProjectChange:te,handleFilterChange:ne,handleProviderSet:R,handleProviderToggle:ie,handleRepoSet:ae,handleRepoToggle:se,handleToggleArchived:le,handleClearAllFilters:ue}=ze(),{scanStatus:de}=ut(),fe=Oe(w),[pe,me]=(0,_.useState)(null),[ge,ye]=(0,_.useState)(null),[be,H]=(0,_.useState)(null),[Ce,Ee]=(0,_.useState)(null);(0,_.useEffect)(()=>{(()=>{let e=new URLSearchParams(window.location.search).get(`selected`);if(!e)return;H(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;H(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 De=(0,_.useRef)(!1),ke=(0,_.useRef)(``),[Ae,Me]=(0,_.useState)(new Set),[Ne,Pe]=(0,_.useState)(null),Fe=e.some(e=>e.provider===`cursor`),Ie=be?e.find(e=>e.slug===be)??null:null,Le=(0,_.useCallback)(async e=>{l(!0),d(null),v(null),p(!1),h(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=C(await fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null)),a=!e?.forceRefresh&&!T(i);if(i&&i.sessions.length>0&&(r=!0,t(i.sessions),b(i.cachedAt??null),h(a?null:i.cachedAt??null),l(!1),p(!a)),a){p(!1),l(!1);return}try{let e=await Se(`/api/sources`);if(!e.ok)throw Error(`Failed to load sessions`);let n=await e.json();t(n.sessions),n.cleanupPeriodDays!=null&&s(n.cleanupPeriodDays),b(new Date().toISOString()),h(null)}catch(e){r?v(`Failed to refresh latest sessions. Showing cached data.`):d(xe(e)||`Failed to load sessions`)}finally{p(!1),l(!1)}},[]),Re=e=>ve(e,Ae,Me),Be=(e,t)=>{Ee({source:e,scanData:t??n[e.slug]??null})};(0,_.useEffect)(()=>{Le()},[Le]),(0,_.useEffect)(()=>{if(e.length===0)return;let t=!1,n=async()=>{let e=await wr();t||!e?.results||(a(e.finishedAt??null),r(Object.fromEntries(e.results.filter(e=>e.slug).map(e=>[e.slug,e]))))};n();let i=window.setInterval(()=>{n()},de?.running?5e3:3e4);return()=>{t=!0,window.clearInterval(i)}},[de?.running,e.length]),(0,_.useEffect)(()=>{if(!c&&!Fe&&!De.current)return;let e=!1,n,r=async()=>{let n=C(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||(Pe(t),t.running?(De.current=!0,await r()):De.current&&(De.current=!1,await r(),n&&=(window.clearInterval(n),void 0)))};return i(),n=window.setInterval(()=>{i()},2500),()=>{e=!0,n&&window.clearInterval(n)}},[Fe,c]),(0,_.useEffect)(()=>{let e=window.setInterval(()=>S(Date.now()),3e4);return()=>window.clearInterval(e)},[]);let Ve=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))},He=async(e,t)=>{H(null),me(e.slug),ye(null);try{let n=await Se(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,filePaths:e.filePaths,toolPaths:e.toolPaths,title:F(t)||void 0,sessionSlug:e.slug,sessionProject:e.project})}),r=await n.json();if(!n.ok)throw Error(r.error||`Generation failed`);V({view:null,session:r.slug})}catch(e){ye(xe(e))}finally{me(null)}},Ue=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{}},We=e.filter(e=>Ae.has(e.slug)).length,Ge=j?e:e.filter(e=>!Ae.has(e.slug)),qe=new Set(I),Ye=new Set(L),Xe=O.trim().toLowerCase(),Ze=e=>xn(e,qe),Qe=e=>Sn(e,Ye),$e=e=>Cn(e,fe,je,Oe),et=Ge.filter(e=>{if(!Xe)return!0;let t=n[e.slug],r=oe(e,t),i=z(e,t,r).join(` `);return[e.slug,e.title,r,e.firstPrompt,i,e.gitBranch,e.gitRepo,e.project,e.provider,he(e.provider),e.model,t?.model,t?.gitBranch].filter(Boolean).some(e=>String(e).toLowerCase().includes(Xe))}),tt=et.filter(e=>Qe(e)&&$e(e)),W=et.filter(e=>Ze(e)&&$e(e)),nt=et.filter(e=>Ze(e)&&Qe(e)),rt=Lr(Ir(tt,e=>e.provider)),it=Lr(Ir(W,bn)),at=new Map;for(let e of nt){let t=Oe(e.project);at.has(t)||at.set(t,[]),at.get(t)?.push(e)}let G=[...at.entries()].sort((e,t)=>{let n=e[1][0]?.timestamp||``;return(t[1][0]?.timestamp||``).localeCompare(n)}),st=we(G.map(([e])=>e)),ct=wn(et,{selectedProviders:I,selectedRepos:L,selectedProjectKey:fe,allProjectsKey:je,rollupProject:Oe}),lt=y?D(y,x):null,dt=new Set(ct.slice(0,25).map(e=>e.slug)),ft=!!O||I.length>0||L.length>0||fe!==`__all__`,[pt,mt]=(0,_.useState)(jr),ht=I.join(`\0`),gt=L.join(`\0`),_t=[O,ht,gt,fe,j?`archived`:`active`].join(`\0`);(0,_.useEffect)(()=>{mt(jr)},[O,ht,gt,fe,j]);let vt=ct.slice(0,pt),yt=Math.max(0,ct.length-vt.length);(0,_.useEffect)(()=>{if(c||ct.length===0)return;let e=ct.slice(0,25),t=e.map(e=>e.slug),n=e.map(e=>e.sessionId).filter(e=>typeof e==`string`&&e.length>0),r=fe===`__all__`?[]:[fe],i=JSON.stringify({slugs:t,selectedProjectKey:fe});ke.current!==i&&(ke.current=i,fetch(`/api/sources/enrich`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({slugs:t,sessionIds:n,projects:r,limit:Math.max(30,e.length)})}).catch(()=>{}))},[ct,c,fe]);let bt=c&&e.length===0,xt=e.filter(e=>e.expiresInDays!=null&&e.expiresInDays<=7&&!Ae.has(e.slug)),St=xt.reduce((e,t)=>Math.min(e,t.expiresInDays??1/0),1/0);return u&&e.length===0?(0,U.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,U.jsxs)(`div`,{className:`text-center space-y-3`,children:[(0,U.jsx)(`div`,{className:`text-terminal-red font-mono text-sm`,children:u}),(0,U.jsx)(`button`,{onClick:()=>void Le({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&&!bt?(0,U.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,U.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,U.jsx)(`div`,{className:`text-terminal-dim font-mono text-sm`,children:`No AI sessions found`}),(0,U.jsx)(`div`,{className:`text-terminal-dimmer font-mono text-xs`,children:`Start Claude, Cursor, or Codex, then come back here`})]})}):(0,U.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,U.jsxs)(`div`,{className:`hidden md:flex w-72 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle`,children:[(0,U.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,U.jsx)(`span`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold`,children:`Explorer`})}),(0,U.jsx)(`button`,{onClick:()=>{Le({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,U.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:[(0,U.jsx)(`path`,{d:`M2.5 8a5.5 5.5 0 019.3-4M13.5 8a5.5 5.5 0 01-9.3 4`}),(0,U.jsx)(`path`,{d:`M12.5 1v3h-3M3.5 15v-3h3`})]})})]}),(0,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto [scrollbar-gutter:stable] p-3 space-y-3`,children:[(0,U.jsxs)(`button`,{onClick:()=>te(je),className:`w-full text-left px-3 py-3 text-xs font-sans rounded-xl transition-all duration-200 ease-material flex items-center justify-between border ${fe===`__all__`?`border-terminal-green/25 bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`border-terminal-border-subtle bg-terminal-bg/25 text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface`}`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:`All sessions`}),(0,U.jsx)(`span`,{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${fe===`__all__`?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer`}`,children:nt.length})]}),(0,U.jsx)(Br,{title:`Provider`,entries:rt,selected:I,onToggle:ie,labelFor:he,leadingFor:e=>(0,U.jsx)(Ke,{provider:e,compact:!0}),max:rt.length}),(0,U.jsx)(Br,{title:`Git repo`,entries:it,selected:L,onToggle:se,labelFor:Nr,max:8}),(0,U.jsxs)(`div`,{className:`space-y-1 border-t border-terminal-border-subtle pt-4`,children:[(0,U.jsx)(zr,{title:`Project path`,count:G.length}),G.map(([e,t])=>{let n=t.filter(e=>e.existingReplay).length,r=fe===e,i=Pr(e,st),a=t.some(e=>e.projectExists!==!1),o=t.some(e=>e.isGitRepo||e.gitBranch||e.gitRepo);return(0,U.jsxs)(`button`,{onClick:()=>te(r?je: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,U.jsxs)(`div`,{className:`flex items-center justify-between gap-1.5`,children:[(0,U.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,U.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`shrink-0 ${r?`opacity-70`:`opacity-40`}`,children:(0,U.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,U.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,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-1 ml-0.5`,children:[(0,U.jsx)(`span`,{className:`text-xs font-mono truncate ${r?`text-terminal-dim`:`text-terminal-dimmer`}`,children:ee(t[0]?.timestamp||``)}),n>0&&(0,U.jsxs)(`span`,{className:`text-xs font-mono ${r?`text-terminal-green`:`text-terminal-dimmer`}`,children:[n,` `,n===1?`replay`:`replays`]})]})]},e)})]})]})]}),(0,U.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-0 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`md:hidden px-3 pt-3 grid grid-cols-1 gap-2`,children:[(0,U.jsxs)(`select`,{value:I.length===1?I[0]:I.length>1?`__multiple__`:``,onChange:e=>R(e.target.value?[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:[I.length>1&&(0,U.jsxs)(`option`,{value:`__multiple__`,disabled:!0,children:[I.length,` providers selected`]}),(0,U.jsxs)(`option`,{value:``,children:[`All providers (`,tt.length,`)`]}),rt.map(([e,t])=>(0,U.jsxs)(`option`,{value:e,children:[he(e),` (`,t,`)`]},e))]}),(0,U.jsxs)(`select`,{value:L.length===1?L[0]:L.length>1?`__multiple__`:``,onChange:e=>ae(e.target.value?[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:[L.length>1&&(0,U.jsxs)(`option`,{value:`__multiple__`,disabled:!0,children:[L.length,` repos selected`]}),(0,U.jsxs)(`option`,{value:``,children:[`All repos (`,W.length,`)`]}),it.map(([e,t])=>(0,U.jsxs)(`option`,{value:e,children:[Nr(e),` (`,t,`)`]},e))]}),(0,U.jsxs)(`select`,{value:w,onChange:e=>te(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,U.jsxs)(`option`,{value:je,children:[`All projects (`,nt.length,`)`]}),G.map(([e,t])=>(0,U.jsxs)(`option`,{value:e,children:[Pr(e,st),` (`,t.length,`)`]},e))]})]}),(0,U.jsxs)(`div`,{className:`px-4 pt-4 pb-2 space-y-3 shrink-0`,children:[(0,U.jsxs)(`div`,{className:`hidden md:block border-b border-terminal-border-subtle pb-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,U.jsx)(`h2`,{className:`text-base font-sans font-semibold text-terminal-text truncate`,children:`Sessions`}),(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer shrink-0`,children:ft?`${ct.length.toLocaleString()} matching`:`${Ge.length.toLocaleString()} local sessions`})]}),(0,U.jsxs)(`div`,{className:`mt-0.5 text-xs font-mono text-terminal-dimmer`,children:[ft?`Filtered from ${Ge.length.toLocaleString()} local sessions`:`Use sidebar facets or search to narrow the list`,j&&` · including archived`]})]}),(0,U.jsxs)(`div`,{className:`text-right shrink-0`,children:[(0,U.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer`,children:`Last updated`}),(0,U.jsx)(`div`,{className:`mt-0.5 text-xs font-mono text-terminal-dim`,children:f?`Refreshing…`:lt?`Updated ${lt} ago`:`Local cache`})]})]}),ft&&(0,U.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 flex-wrap`,children:[O&&(0,U.jsx)(Rr,{label:`Search`,value:O,onRemove:()=>ne(``)}),I.map(e=>(0,U.jsx)(Rr,{label:`Provider`,value:he(e),onRemove:()=>ie(e)},e)),L.map(e=>(0,U.jsx)(Rr,{label:`Repo`,value:Nr(e),onRemove:()=>se(e)},e)),fe!==`__all__`&&(0,U.jsx)(Rr,{label:`Project`,value:Pr(fe,st),onRemove:()=>te(`__all__`)}),(0,U.jsx)(`button`,{onClick:ue,className:`text-xs font-mono text-terminal-dimmer hover:text-terminal-text transition-colors`,children:`Clear all`})]})]}),(0,U.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[(0,U.jsxs)(`div`,{className:`relative flex-1`,children:[(0,U.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,U.jsx)(`circle`,{cx:`7`,cy:`7`,r:`5`}),(0,U.jsx)(`path`,{d:`M11 11l3.5 3.5`})]}),(0,U.jsx)(`input`,{value:O,onChange:e=>ne(e.target.value),placeholder:`Search title, prompt, slug, repo, project...`,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`})]}),We>0&&(0,U.jsx)(`button`,{onClick:le,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${j?`bg-terminal-orange-subtle text-terminal-orange`:`bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,title:j?`Hide archived`:`View all (${We} archived)`,children:j?`Active`:`View all`})]}),ft&&(0,U.jsxs)(`div`,{className:`md:hidden flex items-center gap-2 flex-wrap`,children:[O&&(0,U.jsx)(Rr,{label:`Search`,value:O,onRemove:()=>ne(``)}),I.map(e=>(0,U.jsx)(Rr,{label:`Provider`,value:he(e),onRemove:()=>ie(e)},e)),L.map(e=>(0,U.jsx)(Rr,{label:`Repo`,value:Nr(e),onRemove:()=>se(e)},e)),fe!==`__all__`&&(0,U.jsx)(Rr,{label:`Project`,value:Pr(fe,st),onRemove:()=>te(`__all__`)}),(0,U.jsx)(`button`,{onClick:ue,className:`text-xs font-mono text-terminal-dimmer hover:text-terminal-text transition-colors`,children:`Clear all`})]})]}),bt?(0,U.jsx)(nn,{title:`Fetching local sessions`,description:`Reading cached session lists first, then refreshing local providers in the background.`}):f?(0,U.jsx)(nn,{title:`Scanning latest sessions`,description:m?`Showing stale cache (${E(m)}) while refreshing.`:`Refreshing provider session lists and lightweight metadata.`}):Ne?.running&&Ne.total>0?(0,U.jsx)(nn,{status:Ne,title:`Loading richer details for visible sessions`,description:`Visible cards update in place as local data is enriched.`}):null,g&&(0,U.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,U.jsx)(`span`,{children:g}),(0,U.jsx)(`button`,{onClick:()=>v(null),className:`ml-auto text-terminal-orange/60 hover:text-terminal-orange transition-colors`,children:`×`})]}),ge&&(0,U.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,U.jsx)(`span`,{children:ge}),(0,U.jsx)(`button`,{onClick:()=>ye(null),className:`ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors`,children:`×`})]}),xt.length>0&&(0,U.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,U.jsx)(`span`,{className:`text-terminal-orange text-base leading-none mt-0.5`,children:`⚠`}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`text-xs font-sans font-semibold text-terminal-orange`,children:[xt.length,` session`,xt.length===1?``:`s`,` expiring`,St===0?` today`:St===1?` tomorrow`:` within ${St} days`]}),(0,U.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-orange/70 mt-0.5`,children:[`Claude Code auto-deletes transcripts after`,` `,o==null?`the configured period`:`${o} days`,`. Generate replays to preserve them.`]})]})]}),(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto [scrollbar-gutter:stable]`,children:bt?(0,U.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:`Fetching sessions...`}):ct.length===0?(0,U.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:ft?`No sessions match the current filters`:`No local sessions found`}):(0,U.jsxs)(`div`,{className:`space-y-2.5 px-4 py-3`,children:[vt.map(e=>{let t=n[e.slug],r=oe(e,t),a=z(e,t,r).slice(0,2),o=B(t?.gitBranch||e.gitBranch),s=Oe(e.project),c=s!==e.project,l=t?.promptCount??e.promptCount??e.replay?.stats.userPrompts,u=t?.toolCallCount??e.toolCallCount??e.replay?.stats.toolCalls,d=t?.durationMs??e.durationMsEst??e.replay?.stats.durationMs,f=t?.editCount??e.editCountEst,p=t?.model||e.model,m=t?.costEstimate??e.replay?.stats.costEstimate,h=Te(e.hasSqlite,t?.dataSource,e.hasSdk),g=!!Ne?.running&&dt.has(e.slug)&&!Yt(t),_=Xt(e,t),v=t&&i?D(i):null,y=Ae.has(e.slug),b=e.existingReplay||e.replay?.slug,x=st.get(s)||st.get(e.project)||P(s),S=t?.prLinks?.[0],C=e.gitRepo?`https://github.com/${e.gitRepo}`:void 0,w=e.gitRepo&&o?`https://github.com/${e.gitRepo}/tree/${o.split(`/`).map(encodeURIComponent).join(`/`)}`:void 0,T=Date.now()-new Date(e.timestamp).getTime()<Mr,E=t?.apiErrorCount??0,O=t?.compactionCount??0,j=!!t&&E===0,I=[he(e.provider),p?A(p):null,t?.permissionMode?`${t.permissionMode} mode`:null,t?.entrypoint?`via ${t.entrypoint}`:null].filter(Boolean).join(` · `),L=t?.tokenUsage?`${N(t.tokenUsage.cacheReadTokens)} cache read · ${N(t.tokenUsage.cacheCreationTokens)} cache write · ${N(t.tokenUsage.inputTokens)} in · ${N(t.tokenUsage.outputTokens)} out`:`Estimated cost`;return(0,U.jsxs)(`div`,{onClick:()=>{b?V({view:null,session:b}):H(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-3 shadow-layer-sm cursor-pointer hover-lift ${g?`ring-1 ring-terminal-blue/20`:``} ${y?`opacity-50`:``}`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-2.5 min-w-0`,children:[(0,U.jsx)(`span`,{className:`mt-0.5`,children:(0,U.jsx)(Ke,{provider:e.provider,title:I})}),(0,U.jsx)(`span`,{className:`text-sm font-sans font-semibold text-terminal-text leading-snug line-clamp-2`,children:r})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,U.jsxs)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer whitespace-nowrap hidden sm:inline`,children:[e.slug,` · `,ee(e.timestamp)]}),(0,U.jsx)(Je,{onArchive:()=>Re(e.slug),onDelete:b?()=>Ue(e.slug):void 0,onRawData:()=>Be(e,t||null),isArchived:y})]})]}),a.filter(e=>F(e)!==r).map((e,t)=>(0,U.jsxs)(`div`,{className:`flex gap-2 items-start`,children:[(0,U.jsx)(`span`,{className:`text-xs text-terminal-green shrink-0 mt-px select-none`,children:`>`}),(0,U.jsx)(`p`,{className:`text-sm text-terminal-dim line-clamp-2 leading-relaxed`,children:e})]},t)),(0,U.jsxs)(`div`,{className:`flex items-center gap-x-2.5 gap-y-1 flex-wrap text-xs font-mono text-terminal-dim`,children:[(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1 max-w-[240px] truncate`,title:e.project,children:[(0,U.jsx)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,className:`text-terminal-dimmer shrink-0`,children:(0,U.jsx)(`path`,{d:`M1.5 4.5a1 1 0 0 1 1-1h3l1.5 1.5h5a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1h-10a1 1 0 0 1-1-1z`})}),x]}),o&&(w?(0,U.jsxs)(`a`,{href:w,target:`_blank`,rel:`noreferrer`,onClick:e=>e.stopPropagation(),className:`inline-flex items-center gap-1 hover:text-terminal-blue hover:underline shrink-0`,title:`Open branch ${o} on GitHub`,children:[(0,U.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,U.jsx)(`circle`,{cx:`5`,cy:`4`,r:`2`}),(0,U.jsx)(`circle`,{cx:`11`,cy:`12`,r:`2`}),(0,U.jsx)(`path`,{d:`M5 6v4c0 1.1.9 2 2 2h2`})]}),o]}):(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1 shrink-0`,children:[(0,U.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,U.jsx)(`circle`,{cx:`5`,cy:`4`,r:`2`}),(0,U.jsx)(`circle`,{cx:`11`,cy:`12`,r:`2`}),(0,U.jsx)(`path`,{d:`M5 6v4c0 1.1.9 2 2 2h2`})]}),o]})),e.gitRepo&&C&&(0,U.jsxs)(`a`,{href:C,target:`_blank`,rel:`noreferrer`,onClick:e=>e.stopPropagation(),className:`inline-flex items-center gap-1 hover:text-terminal-blue hover:underline shrink-0`,title:`Open repo on GitHub`,children:[(0,U.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`text-terminal-dimmer`,children:(0,U.jsx)(`path`,{d:`M8 1a7 7 0 0 0-2.2 13.6c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.8-.78-1.02-.78-1.02-.64-.44.05-.43.05-.43.7.05 1.07.72 1.07.72.63 1.08 1.65.77 2.05.59.06-.46.25-.77.45-.95-1.56-.18-3.2-.78-3.2-3.47 0-.77.27-1.4.72-1.89-.07-.18-.31-.9.07-1.87 0 0 .59-.19 1.93.72a6.7 6.7 0 0 1 3.5 0c1.34-.91 1.93-.72 1.93-.72.38.97.14 1.69.07 1.87.45.49.72 1.12.72 1.89 0 2.7-1.64 3.29-3.2 3.46.25.22.48.65.48 1.31v1.95c0 .19.13.4.49.33A7 7 0 0 0 8 1z`})}),e.gitRepo]}),c&&(0,U.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`}),e.spaceId&&(0,U.jsxs)(`span`,{className:`text-terminal-dimmer shrink-0`,title:e.spaceIdSetBy?`Cowork space ${e.spaceId} (${e.spaceIdSetBy})`:`Cowork space ${e.spaceId}`,children:[`space-`,re(e.spaceId)]}),e.pluginsEnabled&&(0,U.jsx)(`span`,{className:`text-terminal-dimmer shrink-0`,title:`Claude Cowork plugins enabled`,children:`plugins`}),e.skillsEnabled&&(0,U.jsx)(`span`,{className:`text-terminal-dimmer shrink-0`,title:`Claude Cowork skills enabled`,children:`skills`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-x-3.5 gap-y-1 flex-wrap text-xs font-mono tabular-nums py-2 border-y border-terminal-border-subtle`,children:[(0,U.jsx)(Qt,{state:_,active:g,scannedAtLabel:v}),!!d&&(0,U.jsxs)(`span`,{className:`text-terminal-text`,title:`Active duration`,children:[t?.durationMs==null?`~`:``,ot(d)]}),!!l&&(0,U.jsxs)(`span`,{className:`text-terminal-text`,children:[l,` `,(0,U.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[`prompt`,l===1?``:`s`]})]}),!!u&&(0,U.jsxs)(`span`,{className:`text-terminal-text`,children:[u,` `,(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:`tools`})]}),!!f&&(0,U.jsxs)(`span`,{className:`text-terminal-text`,title:`File edits`,children:[t?.editCount==null?`~`:``,f,` `,(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:`edits`})]}),!!m&&(0,U.jsx)(`span`,{className:`text-terminal-green`,title:L,children:k(m)}),j?(0,U.jsx)(`span`,{className:`text-terminal-green`,title:`No API errors${O===0?` · no compactions`:` · ${O} compaction(s)`}`,children:`✓ no errors`}):E>0&&(0,U.jsxs)(`span`,{className:`text-terminal-red`,title:`${E} API error(s) during this session`,children:[E,` error`,E===1?``:`s`]})]}),(0,U.jsxs)(`div`,{className:`flex items-end justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-x-2 gap-y-1 flex-wrap text-xs font-mono min-w-0`,children:[S?(0,U.jsxs)(`a`,{href:S.prUrl,target:`_blank`,rel:`noreferrer`,onClick:e=>e.stopPropagation(),className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-purple-emphasis transition-colors`,title:`Open PR #${S.prNumber} on GitHub`,children:[(0,U.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,U.jsx)(`circle`,{cx:`4`,cy:`4`,r:`1.5`}),(0,U.jsx)(`circle`,{cx:`4`,cy:`12`,r:`1.5`}),(0,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.5`}),(0,U.jsx)(`path`,{d:`M4 5.5v5M12 5.5v5M12 5.5a3 3 0 0 0-3-3H7`})]}),`PR #`,S.prNumber]}):e.hasPR&&(0,U.jsx)(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md bg-terminal-purple-subtle text-terminal-purple`,title:`Session produced a PR`,children:`PR`}),(0,U.jsx)(`span`,{className:`text-terminal-dimmer tabular-nums`,title:`Transcript size`,children:M(e.fileSize)}),e.filePaths.length>1&&(0,U.jsxs)(`span`,{className:`text-terminal-dimmer tabular-nums`,children:[e.filePaths.length,` parts`]}),(e.hasSqlite||e.hasSdk||t?.dataSource)&&(0,U.jsx)(`span`,{className:`px-1.5 py-0.5 rounded-md ${_e(t?.dataSource,e.hasSqlite,e.hasSdk)}`,title:h,children:h}),e.isStarred&&(0,U.jsx)(`span`,{className:`text-terminal-orange`,title:`Starred in Claude Cowork`,children:`★`}),e.fsDetectedFiles&&e.fsDetectedFiles.length>0&&(0,U.jsxs)(`span`,{className:`text-terminal-dimmer tabular-nums`,title:e.fsDetectedFiles.join(`
26
+ `),children:[e.fsDetectedFiles.length,` files`]}),e.expiresInDays!=null&&e.expiresInDays<=7&&(0,U.jsx)(`span`,{className:`inline-flex items-center gap-1 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,U.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[e.sessionId&&T&&(0,U.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),ce(e.provider,e.sessionId)},title:`Stream this session live as the provider writes new turns`,className:`h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-red-subtle text-terminal-red hover:bg-terminal-red-emphasis transition-all duration-200 ease-material flex items-center gap-1.5`,children:[(0,U.jsxs)(`span`,{className:`relative flex w-1.5 h-1.5`,children:[(0,U.jsx)(`span`,{className:`absolute inline-flex h-full w-full rounded-full bg-terminal-red opacity-75 animate-ping`}),(0,U.jsx)(`span`,{className:`relative inline-flex rounded-full h-1.5 w-1.5 bg-terminal-red`})]}),`Live`]}),b?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{onClick:e=>{e.stopPropagation(),V({view:null,session:b,v:`export`})},className:`h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-purple-emphasis transition-all duration-200 ease-material`,children:`Share`}),(0,U.jsx)(`button`,{onClick:t=>{t.stopPropagation(),H(e.slug)},disabled:pe===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 disabled:opacity-50`,children:pe===e.slug?`...`:`Redo`}),(0,U.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),V({view:null,session:b})},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`,children:[(0,U.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,U.jsx)(`polygon`,{points:`4 2 14 8 4 14`})}),`View`]})]}):(0,U.jsx)(`button`,{onClick:t=>{t.stopPropagation(),H(e.slug)},disabled:pe===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:pe===e.slug?(0,U.jsx)(`span`,{className:`animate-pulse`,children:`Generating...`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,U.jsx)(`path`,{d:`M8 2v12M2 8h12`})}),`Generate`]})})]})]})]},`${e.provider}-${e.slug}`)}),yt>0&&(0,U.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,U.jsxs)(`button`,{onClick:()=>mt(e=>e+jr),className:`rounded-lg bg-terminal-surface px-4 py-2 text-xs font-mono text-terminal-dim shadow-layer-sm ring-1 ring-terminal-border-subtle hover:bg-terminal-surface-hover hover:text-terminal-text transition-colors`,children:[`Showing `,vt.length.toLocaleString(),` of`,` `,ct.length.toLocaleString(),` · Show next`,` `,Math.min(jr,yt).toLocaleString()]})})]},_t)}),Ie&&(0,U.jsx)(kr,{session:Ie,scanData:n[Ie.slug]||null,onClose:()=>H(null),onGenerate:He,onViewReplay:e=>V({view:null,session:e}),onArchive:e=>{Re(e)},onTitleSave:Ve,onDeleteReplay:Ue,onRawData:Be,isGenerating:pe===Ie.slug,isArchived:Ae.has(Ie.slug)}),Ce&&(0,U.jsx)(Or,{title:oe(Ce.source,Ce.scanData),subtitle:`${Ce.source.provider} · slug: ${Ce.source.slug}`,items:Tr(Ce.source,Ce.scanData),onClose:()=>Ee(null)})]})]})}function Hr(){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,b]=(0,_.useState)(null),[x,S]=(0,_.useState)(null),{selectedProject:T,filter:O,showArchived:k,selectedProviders:A,selectedRepos:j,handleProjectChange:M,handleFilterChange:N,handleProviderSet:P,handleProviderToggle:F,handleRepoSet:I,handleRepoToggle:L,handleToggleArchived:te,handleClearAllFilters:ne}=ze(),R=Oe(T);(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=C(await fetch(`/api/sessions/cached`).then(e=>e.ok?e.json():null).catch(()=>null)),c=w(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 Se(`/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 z=e=>ve(e,m,h),B=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=>{V({view:null,session:e})},ie=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`)}},ae=async e=>{b(e.slug);try{let t=await Se(`/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`);V({view:null,session:n.slug})}catch(e){console.error(`Regenerate error:`,ye(e))}finally{b(null)}},oe=e.filter(e=>m.has(e.slug)).length,ce=k?e:e.filter(e=>!m.has(e.slug)),le=new Set(A),ue=new Set(j),de=O.trim().toLowerCase(),fe=e=>xn(e,le),pe=e=>Sn(e,ue),me=e=>Cn(e,R,je,Oe),ge=ce.filter(e=>de?[e.title,se(e),e.slug,e.project,e.gitRepo,e.provider,he(e.provider),e.model,e.firstMessage,...e.messages||[]].filter(Boolean).some(e=>String(e).toLowerCase().includes(de)):!0),_e=ge.filter(e=>pe(e)&&me(e)),be=ge.filter(e=>fe(e)&&me(e)),xe=ge.filter(e=>fe(e)&&pe(e)),H=Lr(Ir(_e,e=>e.provider)),Ce=Lr(Ir(be,bn)),Te=new Map;for(let e of xe){let t=Oe(e.project);Te.has(t)||Te.set(t,[]),Te.get(t)?.push(e)}let Ee=[...Te.entries()].sort((e,t)=>{let n=e[1][0]?.startTime||``;return(t[1][0]?.startTime||``).localeCompare(n)}),De=we(Ee.map(([e])=>e)),ke=wn(ge,{selectedProviders:A,selectedRepos:j,selectedProjectKey:R,allProjectsKey:je,rollupProject:Oe}),Ae=u?D(u,f):null,Me=!!O||A.length>0||j.length>0||R!==`__all__`,[Ne,Pe]=(0,_.useState)(jr),Fe=A.join(`\0`),Ie=j.join(`\0`),Le=[O,Fe,Ie,R,k?`archived`:`active`].join(`\0`);(0,_.useEffect)(()=>{Pe(jr)},[O,Fe,Ie,R,k]);let Re=ke.slice(0,Ne),Be=Math.max(0,ke.length-Re.length),Ve=n&&e.length===0;return!Ve&&(!i||e.length===0)?(0,U.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,U.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 py-6 space-y-6`,children:[(0,U.jsx)(Xe,{}),i&&e.length===0&&(0,U.jsxs)(`div`,{className:`text-center py-12 space-y-2`,children:[(0,U.jsx)(`div`,{className:`text-terminal-dim font-mono text-sm`,children:`No replays yet`}),(0,U.jsx)(`div`,{className:`text-terminal-dimmer font-mono text-xs`,children:`Go to the Sessions tab to generate your first replay`})]}),!i&&(0,U.jsx)(`div`,{className:`text-center py-8 space-y-2`,children:(0,U.jsxs)(`div`,{className:`text-terminal-dimmer font-mono text-xs`,children:[`Or run `,(0,U.jsx)(`span`,{className:`text-terminal-green`,children:`npx vibe-replay`}),` to create a replay from your AI coding sessions`]})})]})}):(0,U.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,U.jsxs)(`div`,{className:`hidden md:flex w-72 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20`,children:[(0,U.jsx)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle`,children:(0,U.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,U.jsx)(`span`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold`,children:`Replays`})})}),(0,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto [scrollbar-gutter:stable] p-3 space-y-3`,children:[(0,U.jsxs)(`button`,{onClick:()=>M(je),className:`w-full text-left px-3 py-3 text-xs font-sans rounded-xl transition-all duration-200 ease-material flex items-center justify-between border ${R===`__all__`?`border-terminal-green/25 bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`border-terminal-border-subtle bg-terminal-bg/25 text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface`}`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:`All replays`}),(0,U.jsx)(`span`,{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${R===`__all__`?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer`}`,children:xe.length})]}),(0,U.jsx)(Br,{title:`Provider`,entries:H,selected:A,onToggle:F,labelFor:he,leadingFor:e=>(0,U.jsx)(Ke,{provider:e,compact:!0}),max:H.length}),(0,U.jsx)(Br,{title:`Git repo`,entries:Ce,selected:j,onToggle:L,labelFor:Nr,max:8}),(0,U.jsxs)(`div`,{className:`space-y-1 border-t border-terminal-border-subtle pt-4`,children:[(0,U.jsx)(zr,{title:`Project path`,count:Ee.length}),Ee.map(([e,t])=>{let n=R===e,r=Pr(e,De),i=t.filter(e=>e.gist?.gistId).length;return(0,U.jsxs)(`button`,{onClick:()=>M(n?je: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,U.jsxs)(`div`,{className:`flex items-center justify-between gap-1.5`,children:[(0,U.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,U.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,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-1 ml-0.5`,children:[(0,U.jsx)(`span`,{className:`text-xs font-mono truncate ${n?`text-terminal-dim`:`text-terminal-dimmer`}`,children:ee(t[0]?.startTime||``)}),i>0&&(0,U.jsxs)(`span`,{className:`text-xs font-mono ${n?`text-terminal-purple`:`text-terminal-dimmer`}`,children:[i,` published`]})]})]},e)})]})]})]}),(0,U.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-0 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`md:hidden px-3 pt-3 grid grid-cols-1 gap-2`,children:[(0,U.jsxs)(`select`,{value:A.length===1?A[0]:A.length>1?`__multiple__`:``,onChange:e=>P(e.target.value?[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:[A.length>1&&(0,U.jsxs)(`option`,{value:`__multiple__`,disabled:!0,children:[A.length,` providers selected`]}),(0,U.jsxs)(`option`,{value:``,children:[`All providers (`,_e.length,`)`]}),H.map(([e,t])=>(0,U.jsxs)(`option`,{value:e,children:[he(e),` (`,t,`)`]},e))]}),(0,U.jsxs)(`select`,{value:j.length===1?j[0]:j.length>1?`__multiple__`:``,onChange:e=>I(e.target.value?[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:[j.length>1&&(0,U.jsxs)(`option`,{value:`__multiple__`,disabled:!0,children:[j.length,` repos selected`]}),(0,U.jsxs)(`option`,{value:``,children:[`All repos (`,be.length,`)`]}),Ce.map(([e,t])=>(0,U.jsxs)(`option`,{value:e,children:[Nr(e),` (`,t,`)`]},e))]}),(0,U.jsxs)(`select`,{value:T,onChange:e=>M(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,U.jsxs)(`option`,{value:je,children:[`All projects (`,xe.length,`)`]}),Ee.map(([e,t])=>(0,U.jsxs)(`option`,{value:e,children:[Pr(e,De),` (`,t.length,`)`]},e))]})]}),(0,U.jsxs)(`div`,{className:`px-4 pt-4 pb-2 space-y-3 shrink-0`,children:[(0,U.jsxs)(`div`,{className:`hidden md:block border-b border-terminal-border-subtle pb-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,U.jsx)(`h2`,{className:`text-base font-sans font-semibold text-terminal-text truncate`,children:`Replays`}),(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer shrink-0`,children:Me?`${ke.length.toLocaleString()} matching`:`${ce.length.toLocaleString()} local replays`})]}),(0,U.jsxs)(`div`,{className:`mt-0.5 text-xs font-mono text-terminal-dimmer`,children:[Me?`Filtered from ${ce.length.toLocaleString()} local replays`:`Use sidebar facets or search to narrow the list`,k&&` · including archived`]})]}),(0,U.jsxs)(`div`,{className:`text-right shrink-0`,children:[(0,U.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer`,children:`Last updated`}),(0,U.jsx)(`div`,{className:`mt-0.5 text-xs font-mono text-terminal-dim`,children:o?`Refreshing…`:Ae?`Updated ${Ae} ago`:`Local cache`})]})]}),Me&&(0,U.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 flex-wrap`,children:[O&&(0,U.jsx)(Rr,{label:`Search`,value:O,onRemove:()=>N(``)}),A.map(e=>(0,U.jsx)(Rr,{label:`Provider`,value:he(e),onRemove:()=>F(e)},e)),j.map(e=>(0,U.jsx)(Rr,{label:`Repo`,value:Nr(e),onRemove:()=>L(e)},e)),R!==`__all__`&&(0,U.jsx)(Rr,{label:`Project`,value:Pr(R,De),onRemove:()=>M(`__all__`)}),(0,U.jsx)(`button`,{onClick:ne,className:`text-xs font-mono text-terminal-dimmer hover:text-terminal-text transition-colors`,children:`Clear all`})]})]}),(0,U.jsxs)(`div`,{className:`hidden md:flex items-center gap-2`,children:[(0,U.jsxs)(`div`,{className:`relative flex-1`,children:[(0,U.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,U.jsx)(`circle`,{cx:`7`,cy:`7`,r:`5`}),(0,U.jsx)(`path`,{d:`M11 11l3.5 3.5`})]}),(0,U.jsx)(`input`,{value:O,onChange:e=>N(e.target.value),placeholder:`Search title, prompt, slug, provider, repo, project...`,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,U.jsx)(`button`,{onClick:te,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${k?`bg-terminal-orange-subtle text-terminal-orange`:`bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,title:k?`Hide archived`:`View all (${oe} archived)`,children:k?`Active`:`View all`}),(0,U.jsx)(Xe,{})]}),(0,U.jsxs)(`div`,{className:`md:hidden flex gap-2 items-center`,children:[(0,U.jsxs)(`div`,{className:`relative flex-1`,children:[(0,U.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,U.jsx)(`circle`,{cx:`7`,cy:`7`,r:`5`}),(0,U.jsx)(`path`,{d:`M11 11l3.5 3.5`})]}),(0,U.jsx)(`input`,{value:O,onChange:e=>N(e.target.value),placeholder:`Search 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`})]}),oe>0&&(0,U.jsx)(`button`,{onClick:te,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${k?`bg-terminal-orange-subtle text-terminal-orange`:`bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,title:k?`Hide archived`:`View all (${oe} archived)`,children:k?`Active`:`View all`})]}),Me&&(0,U.jsxs)(`div`,{className:`md:hidden flex items-center gap-2 flex-wrap`,children:[O&&(0,U.jsx)(Rr,{label:`Search`,value:O,onRemove:()=>N(``)}),A.map(e=>(0,U.jsx)(Rr,{label:`Provider`,value:he(e),onRemove:()=>F(e)},e)),j.map(e=>(0,U.jsx)(Rr,{label:`Repo`,value:Nr(e),onRemove:()=>L(e)},e)),R!==`__all__`&&(0,U.jsx)(Rr,{label:`Project`,value:Pr(R,De),onRemove:()=>M(`__all__`)}),(0,U.jsx)(`button`,{onClick:ne,className:`text-xs font-mono text-terminal-dimmer hover:text-terminal-text transition-colors`,children:`Clear all`})]})]}),(Ve||o||c)&&(0,U.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:Ve?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,U.jsx)(`span`,{children:`FETCHING REPLAYS...`})]}):o?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,U.jsx)(`span`,{children:`SCANNING LATEST REPLAYS...`}),c&&(0,U.jsxs)(`span`,{className:`text-terminal-dim`,children:[`Showing stale cache (`,E(c),`)`]})]}):c?(0,U.jsxs)(`span`,{children:[`Showing stale cache (`,E(c),`)`]}):null}),g&&(0,U.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,U.jsx)(`span`,{children:g}),(0,U.jsx)(`button`,{onClick:()=>v(null),className:`ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors`,children:`×`})]}),(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto [scrollbar-gutter:stable]`,children:Ve?(0,U.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:`Fetching replays...`}):ke.length===0?(0,U.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:Me?`No replays match the current filters`:`No local replays found`}):(0,U.jsxs)(`div`,{className:`space-y-2.5 px-4 py-3`,children:[Re.map(e=>{let t=m.has(e.slug);return(0,U.jsx)(Ar,{summary:e,onOpen:()=>re(e.slug),onShare:()=>V({view:null,session:e.slug,v:`export`}),onTitleSave:B,onDelete:()=>ie(e.slug),onRegenerate:()=>ae(e),onArchive:()=>z(e.slug),onRawData:()=>S(e),isRegenerating:y===e.slug,isArchived:t},e.slug)}),Be>0&&(0,U.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,U.jsxs)(`button`,{onClick:()=>Pe(e=>e+jr),className:`rounded-lg bg-terminal-surface px-4 py-2 text-xs font-mono text-terminal-dim shadow-layer-sm ring-1 ring-terminal-border-subtle hover:bg-terminal-surface-hover hover:text-terminal-text transition-colors`,children:[`Showing `,Re.length.toLocaleString(),` of`,` `,ke.length.toLocaleString(),` · Show next`,` `,Math.min(jr,Be).toLocaleString()]})})]},Le)}),x&&(0,U.jsx)(Or,{title:se(x),subtitle:`${x.provider} · slug: ${x.slug}`,items:Er(x),initialItemId:`replay`,onClose:()=>S(null)})]})]})}function Ur(){let{scanStatus:e}=ut(),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,U.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,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse shrink-0`}),(0,U.jsx)(`span`,{className:`text-terminal-dim`,children:c}),s.total>0&&(0,U.jsx)(`div`,{className:`w-16 h-1 rounded-full bg-terminal-surface-2 overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full bg-terminal-purple rounded-full transition-all duration-300`,style:{width:`${l}%`}})})]})}function Wr({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`),V({tab:`sessions`,selected:t,project:null,q:null,archived:null,provider:null,repo:null,replay:null}))};return window.addEventListener(`vibe-open-session`,e),()=>window.removeEventListener(`vibe-open-session`,e)},[]);let o=e=>{a(e),V({tab:e,project:null,q:null,archived:null,provider:null,repo:null,replay:null})},s=(e,t)=>(0,U.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,U.jsxs)(dt,{children:[(0,U.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-0`,children:[n&&(0,U.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,U.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,U.jsx)(`div`,{className:`flex-1`}),t]}),i===`home`&&n?(0,U.jsx)(yn,{onNavigate:o}):i===`insights`&&n?(0,U.jsx)(Gt,{}):i===`projects`&&n?(0,U.jsx)(xr,{onNavigate:o}):i===`sessions`&&n?(0,U.jsx)(Vr,{}):(0,U.jsx)(Hr,{})]}),(0,U.jsx)(Ur,{})]})}function Gr(e,t,n,r,i,a,o){let s=new Date().toISOString(),c=Number.isInteger(a)&&Number.isInteger(o)&&a>=0&&o>a,l={id:r??crypto.randomUUID(),sceneIndex:t,...i?.trim()?{selectedText:i.trim()}:{},...c?{selectedTextStart:a,selectedTextEnd:o}:{},body:n,author:`anonymous`,createdAt:s,updatedAt:s,resolved:!1};return[...e,l]}function Kr(e,t,n){return e.map(e=>e.id===t?{...e,body:n,updatedAt:new Date().toISOString()}:e)}function qr(e,t){return e.filter(e=>e.id!==t)}function Jr(e){return new Set(e.map(e=>e.sceneIndex))}function Yr(e){let t=new Map;for(let n of e)t.set(n.sceneIndex,(t.get(n.sceneIndex)||0)+1);return t}function Xr(e,t){return JSON.stringify(e)!==JSON.stringify(t)}function Zr(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 Qr(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 $r(e){return e.rawSum>0?e.rawCr/e.rawSum*100:0}function ei(e){return e.type===`tool-call`&&!e.diff&&!e.bashOutput}function ti(e,t){let n=e[t];if(!ei(n))return t;let r=n.toolName,i=t;for(;i+1<e.length&&ei(e[i+1])&&e[i+1].toolName===r;)i++;return i}function ni(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 ri(e){return e===`user-prompt`||e===`compaction-summary`||e===`context-injection`}function ii(e){let t=[];for(let n=0;n<e.length;n++)e[n].type===`user-prompt`&&t.push(n);return t}function ai(e,t){return e.find(e=>e>t)}function oi(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]<t)return e[n]}function si(e,t,n){let r=t+1;if(r>=e.length)return-1;if(n.promptsOnly){for(;r<e.length&&!ri(e[r].type);)r++;return r>=e.length?-1:r}if(n.compactAssistant&&!ri(e[r].type)){let t=r;for(;t+1<e.length&&!ri(e[t+1].type);)t++;return t}return ti(e,r)}function ci(e,t,n){let r=Math.max(0,t-1);if(t<=0)return 0;if(n.promptsOnly){for(;r>0&&!ri(e[r].type);)r--;return r}if(n.compactAssistant){if(!ri(e[t].type)){let n=t;for(;n>0&&!ri(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 li(e){let t=new URLSearchParams(window.location.search).get(`session`);return t?`${e}${e.includes(`?`)?`&`:`?`}slug=${encodeURIComponent(t)}`:e}var ui=`vibe-replay-annotations-`;function di(e){return ui+e}function fi(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(di(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=Xr(a,s),u=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(r)return u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{fetch(li(`/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(di(n),JSON.stringify(a))}catch{}},[a,n,r]);let d=(0,_.useMemo)(()=>Jr(a),[a]),f=(0,_.useMemo)(()=>Yr(a),[a]),p=(0,_.useCallback)((e,t,n,r,i)=>{o(a=>Gr(a,e,t,void 0,n,r,i))},[]),m=(0,_.useCallback)((e,t)=>{o(n=>Kr(n,e,t))},[]),h=(0,_.useCallback)(e=>{o(t=>qr(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(di(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(di(n))}catch{}},[e,a,n]),[y,b]=(0,_.useState)(!1),x=r?async()=>{b(!0);try{await fetch(li(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});let e=await fetch(li(`/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(li(`/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(li(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a),signal:e.signal});let t=await fetch(li(`/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(li(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});let e=await fetch(li(`/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(li(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});let e=await fetch(li(`/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 pi={version:1,overlays:[]};function mi(e,t=`embedded`){let n=t===`editor`,[r,i]=(0,_.useState)(pi),[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(li(`/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(li(`/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(li(`/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(pi)},[]),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(li(`/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(li(`/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 hi(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 gi(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)(()=>ii(e),[e]),v=(0,_.useCallback)(()=>{d.current&&=(clearTimeout(d.current),null)},[]),y=(0,_.useCallback)(()=>{if(f.current!==`playing`)return;let t=si(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=ni(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=ti(e,0);o(t),u(t+1);let n=ni(e[t],m.current);d.current=setTimeout(y,n)}else{let t=e[p.current];if(t){let e=ni(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=ni(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=ai(g,p.current);e!==void 0&&C(e)},[g,C]),T=(0,_.useCallback)(()=>{let e=oi(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=ni(n,t);d.current=setTimeout(y,e)}}},[e,v,y]);return(0,_.useEffect)(()=>v,[v]),(0,_.useEffect)(()=>{if(!n)return;let t=t=>{if(!hi(t.target))if(t.key===` `)t.preventDefault(),S();else if(t.key===`ArrowDown`||t.key===`j`){f.current===`playing`&&x(),t.preventDefault();let n=si(e,p.current,h.current);n!==-1&&C(n)}else t.key===`ArrowUp`||t.key===`k`?(f.current===`playing`&&x(),t.preventDefault(),C(ci(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=>si(e,n,t),[e,t]),computePrevIndex:(0,_.useCallback)(n=>ci(e,n,t),[e,t])}}function _i(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 vi=`vibe-replay-view-prefs`,yi={displayMode:`compact`,hideThinking:!1,collapseAllTools:!1,promptsOnly:!1};function bi(){try{let e=y(localStorage,vi);if(e){let t=JSON.parse(e);return t.displayMode?{...yi,...t}:{...yi,...t,displayMode:`compact`}}}catch{}return yi}function xi(){let[e,t]=(0,_.useState)(bi);return{prefs:e,updatePref:(0,_.useCallback)((e,n)=>{t(t=>{let r={...t,[e]:n};return b(localStorage,vi,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 b(localStorage,vi,JSON.stringify(r)),r})},[])}}function Si({size:e=14}){return(0,U.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,U.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 Ci({className:e=``}){return(0,U.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,U.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,U.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 wi({toolName:e}){return e===`claude`?(0,U.jsxs)(`div`,{className:`mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1`,children:[(0,U.jsxs)(`p`,{children:[`Runs`,` `,(0,U.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,U.jsxs)(`p`,{className:`text-terminal-dimmer`,children:[`Auth issues? Run`,` `,(0,U.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,U.jsxs)(`div`,{className:`mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1`,children:[(0,U.jsxs)(`p`,{children:[`Runs`,` `,(0,U.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,U.jsxs)(`p`,{className:`text-terminal-dimmer`,children:[`Auth issues? Check Cursor IDE settings or run`,` `,(0,U.jsx)(`code`,{className:`px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text`,children:`agent`}),` `,`in your terminal.`]})]}):e===`opencode`?(0,U.jsxs)(`div`,{className:`mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1`,children:[(0,U.jsxs)(`p`,{children:[`Runs`,` `,(0,U.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,U.jsxs)(`p`,{className:`text-terminal-dimmer`,children:[`Not working? Run`,` `,(0,U.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,U.jsxs)(`p`,{className:`mt-2 text-xs font-mono text-terminal-dim leading-relaxed`,children:[`Runs `,(0,U.jsx)(`span`,{className:`text-terminal-text font-medium`,children:e}),` locally on your machine using your existing auth.`]})}var Ti=[`English`,`Chinese (Simplified)`,`Chinese (Traditional)`,`Japanese`,`Korean`,`Spanish`,`French`,`German`,`Portuguese`,`Russian`],Ei=[{value:`professional`,label:`Professional`},{value:`neutral`,label:`Neutral`},{value:`friendly`,label:`Friendly`}];function Di({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]),L=(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]),te=(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]),ne=e=>t.overlays.overlays.some(t=>t.source.type===e),R=e=>{if(e===`coach`&&x){N(`coach`);return}if(e===`translate`&&ne(`translate`)){N(`translate`);return}if(e===`tone`&&ne(`tone`)){N(`tone`);return}e===`coach`?I():e===`translate`?L():te()};return!a&&g.length===0?(0,U.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,U.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-terminal-border-subtle flex items-center gap-2`,children:[(0,U.jsx)(Si,{size:12}),(0,U.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest`,children:`AI Studio`})]}),(0,U.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center px-6 py-8 text-center`,children:[(0,U.jsx)(`div`,{className:`w-10 h-10 rounded-xl bg-terminal-surface flex items-center justify-center mb-3`,children:(0,U.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,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,U.jsx)(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`}),(0,U.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`})]})}),(0,U.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text mb-1`,children:`No AI tools detected`}),(0,U.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,U.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,U.jsxs)(`div`,{className:`px-3 py-2 rounded-lg bg-terminal-surface border border-terminal-border-subtle`,children:[(0,U.jsxs)(`div`,{className:`text-xs font-sans font-medium text-terminal-text flex items-center gap-1.5`,children:[e.name,e.rec&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-green-subtle text-terminal-green`,children:`recommended`})]}),(0,U.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim mt-0.5 break-all`,children:e.cmd})]},e.name))}),(0,U.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,U.jsx)(`span`,{className:`text-terminal-green font-medium`,children:`locally`}),` on your machine.`]})]})]}):(0,U.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,U.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-terminal-border-subtle flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(Si,{size:12}),(0,U.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest`,children:`AI Studio`})]}),d>0&&(0,U.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,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,U.jsxs)(`div`,{className:`px-4 py-3 border-b border-terminal-border-subtle bg-terminal-surface/30`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim`,children:`Tool`}),P.length>1&&i?(0,U.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,U.jsx)(`option`,{value:e.name,children:e.name},e.name))}):(0,U.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,U.jsx)(wi,{toolName:F})]}),(0,U.jsxs)(`div`,{className:`p-4 space-y-3`,children:[b&&(0,U.jsx)(K,{title:`AI Coach`,preview:(0,U.jsxs)(`div`,{className:`mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden`,children:[(0,U.jsx)(`div`,{className:`px-3 py-2.5 border-b border-terminal-border-subtle`,children:(0,U.jsx)(`div`,{className:`text-xs font-mono text-terminal-green leading-relaxed`,children:`Fix the login bug users reported`})}),(0,U.jsxs)(`div`,{className:`px-3 py-2 flex items-start gap-2`,children:[(0,U.jsx)(`span`,{className:`text-xs shrink-0`,children:`💬`}),(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-blue leading-relaxed`,children:`Be specific — which file? what error?`})]}),(0,U.jsxs)(`div`,{className:`px-3 py-2 border-t border-terminal-border-subtle flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-xs font-mono font-semibold text-terminal-orange`,children:`6/10`}),(0,U.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:()=>R(`coach`),onCancel:h||void 0,showRerunConfirm:M===`coach`,rerunWarning:`Existing AI feedback will be replaced.`,onConfirmRerun:()=>void I(),onCancelRerun:()=>N(null)}),l&&(0,U.jsx)(K,{title:`Translate`,preview:(0,U.jsxs)(`div`,{className:`mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`px-3 py-2.5 space-y-1`,children:[(0,U.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim line-through opacity-60`,children:`这个bug怎么修?`}),(0,U.jsx)(`div`,{className:`text-xs font-mono text-terminal-green`,children:`How to fix this bug?`})]}),(0,U.jsxs)(`div`,{className:`px-3 py-2.5 border-t border-terminal-border-subtle space-y-1`,children:[(0,U.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim line-through opacity-60`,children:`已写入。以后用中文问我...`}),(0,U.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:ne(`translate`)?`Re-translate`:`Translate All`,runningLabel:`Translating...`,onRun:()=>R(`translate`),onCancel:c||void 0,showRerunConfirm:M===`translate`,rerunWarning:`Existing translations will be replaced.`,onConfirmRerun:()=>void L(),onCancelRerun:()=>N(null),config:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-2.5`,children:[(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim shrink-0`,children:`Target`}),(0,U.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:Ti.map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))})]})}),u&&(0,U.jsx)(K,{title:`Soften Tone`,preview:(0,U.jsxs)(`div`,{className:`mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`px-3 py-2.5 space-y-1`,children:[(0,U.jsx)(`div`,{className:`text-xs font-mono text-terminal-red line-through opacity-60`,children:`this code is mass garbage, mass delete it`}),(0,U.jsx)(`div`,{className:`text-xs font-mono text-terminal-green`,children:`Let's refactor this module for clarity`})]}),(0,U.jsxs)(`div`,{className:`px-3 py-2.5 border-t border-terminal-border-subtle space-y-1`,children:[(0,U.jsx)(`div`,{className:`text-xs font-mono text-terminal-red line-through opacity-60`,children:`are you stupid? I said fix the auth`}),(0,U.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:ne(`tone`)?`Re-adjust`:`Soften All`,runningLabel:`Adjusting...`,onRun:()=>R(`tone`),onCancel:c||void 0,showRerunConfirm:M===`tone`,rerunWarning:`Existing tone adjustments will be replaced.`,onConfirmRerun:()=>void te(),onCancelRerun:()=>N(null),config:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-2.5`,children:[(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim shrink-0`,children:`Style`}),(0,U.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:Ei.map(e=>(0,U.jsx)(`option`,{value:e.value,children:e.label},e.value))})]})})]})]})]})}function K({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,U.jsxs)(`div`,{className:`rounded-xl border border-terminal-border-subtle bg-terminal-surface/30 overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,U.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text`,children:e}),t,n&&(0,U.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim mt-2 leading-relaxed`,children:n}),m,(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-3`,children:[(0,U.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,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ci,{className:`text-terminal-purple`}),s]}):o}),r&&l&&(0,U.jsx)(`button`,{onClick:l,className:`text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`})]})]}),u&&!r&&(0,U.jsx)(`div`,{className:`px-4 pb-3`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono`,children:[(0,U.jsx)(`span`,{className:`text-terminal-orange flex-1`,children:d}),(0,U.jsx)(`button`,{onClick:p,className:`text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`}),(0,U.jsx)(`button`,{onClick:f,className:`text-terminal-purple hover:text-terminal-text transition-colors font-medium`,children:`Continue`})]})}),a&&(0,U.jsx)(`div`,{className:`px-4 pb-3 text-xs font-mono ${a.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:a.text})]})}function Oi({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,U.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,U.jsx)(`div`,{className:`absolute inset-0 bg-black/30`,onClick:t}),(0,U.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,U.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,U.jsx)(Di,{annotationActions:n,overlayActions:r})]})]})}function ki(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ai=ki();function ji(e){Ai=e}var Mi={exec:()=>null};function q(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(Pi.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Ni=(()=>{try{return!0}catch{return!1}})(),Pi={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)}}>`)},Fi=/^(?:[ \t]*(?:\n|$))+/,Ii=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Li=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ri=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,zi=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bi=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Vi=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Hi=q(Vi).replace(/bull/g,Bi).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(),Ui=q(Vi).replace(/bull/g,Bi).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(),Wi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Gi=/^[^\n]+/,Ki=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,qi=q(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Ki).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ji=q(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Bi).getRegex(),Yi=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Xi=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,Zi=q(`^ {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`,Xi).replace(`tag`,Yi).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Qi=q(Wi).replace(`hr`,Ri).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Yi).getRegex(),$i={blockquote:q(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Qi).getRegex(),code:Ii,def:qi,fences:Li,heading:zi,hr:Ri,html:Zi,lheading:Hi,list:Ji,newline:Fi,paragraph:Qi,table:Mi,text:Gi},ea=q(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Ri).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Yi).getRegex(),ta={...$i,lheading:Ui,table:ea,paragraph:q(Wi).replace(`hr`,Ri).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,ea).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Yi).getRegex()},na={...$i,html:q(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Xi).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:Mi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:q(Wi).replace(`hr`,Ri).replace(`heading`,` *#{1,6} *[^
27
+ ]`).replace(`lheading`,Hi).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},ra=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ia=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,aa=/^( {2,}|\\)\n(?!\s*$)/,oa=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,sa=/[\p{P}\p{S}]/u,ca=/[\s\p{P}\p{S}]/u,la=/[^\s\p{P}\p{S}]/u,ua=q(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,ca).getRegex(),da=/(?!~)[\p{P}\p{S}]/u,fa=/(?!~)[\s\p{P}\p{S}]/u,pa=/(?:[^\s\p{P}\p{S}]|~)/u,ma=/(?![*_])[\p{P}\p{S}]/u,ha=/(?![*_])[\s\p{P}\p{S}]/u,ga=/(?:[^\s\p{P}\p{S}]|[*_])/u,_a=q(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Ni?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),va=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ya=q(va,`u`).replace(/punct/g,sa).getRegex(),ba=q(va,`u`).replace(/punct/g,da).getRegex(),xa=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Sa=q(xa,`gu`).replace(/notPunctSpace/g,la).replace(/punctSpace/g,ca).replace(/punct/g,sa).getRegex(),Ca=q(xa,`gu`).replace(/notPunctSpace/g,pa).replace(/punctSpace/g,fa).replace(/punct/g,da).getRegex(),wa=q(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,la).replace(/punctSpace/g,ca).replace(/punct/g,sa).getRegex(),Ta=q(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,ma).getRegex(),Ea=q(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,ga).replace(/punctSpace/g,ha).replace(/punct/g,ma).getRegex(),Da=q(/\\(punct)/,`gu`).replace(/punct/g,sa).getRegex(),Oa=q(/^<(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(),ka=q(Xi).replace(`(?:-->|$)`,`-->`).getRegex(),Aa=q(`^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`,ka).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ja=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Ma=q(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,ja).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Na=q(/^!?\[(label)\]\[(ref)\]/).replace(`label`,ja).replace(`ref`,Ki).getRegex(),Pa=q(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Ki).getRegex(),Fa=q(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Na).replace(`nolink`,Pa).getRegex(),Ia=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,La={_backpedal:Mi,anyPunctuation:Da,autolink:Oa,blockSkip:_a,br:aa,code:ia,del:Mi,delLDelim:Mi,delRDelim:Mi,emStrongLDelim:ya,emStrongRDelimAst:Sa,emStrongRDelimUnd:wa,escape:ra,link:Ma,nolink:Pa,punctuation:ua,reflink:Na,reflinkSearch:Fa,tag:Aa,text:oa,url:Mi},Ra={...La,link:q(/^!?\[(label)\]\((.*?)\)/).replace(`label`,ja).getRegex(),reflink:q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,ja).getRegex()},za={...La,emStrongRDelimAst:Ca,emStrongLDelim:ba,delLDelim:Ta,delRDelim:Ea,url:q(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Ia).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:q(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Ia).getRegex()},Ba={...za,br:q(aa).replace(`{2,}`,`*`).getRegex(),text:q(za.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Va={normal:$i,gfm:ta,pedantic:na},Ha={normal:La,gfm:za,breaks:Ba,pedantic:Ra},Ua={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Wa=e=>Ua[e];function Ga(e,t){if(t){if(Pi.escapeTest.test(e))return e.replace(Pi.escapeReplace,Wa)}else if(Pi.escapeTestNoEncode.test(e))return e.replace(Pi.escapeReplaceNoEncode,Wa);return e}function Ka(e){try{e=encodeURI(e).replace(Pi.percentDecode,`%`)}catch{return null}return e}function qa(e,t){let n=e.replace(Pi.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Pi.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(Pi.slashPipe,`|`);return n}function Ja(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 Ya(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 Xa(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 Za(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 Qa(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
28
28
  `).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(`
29
- `)}var ja=class{options;rules;lexer;constructor(e){this.options=e||li}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:Ea(e,`
30
- `)}}}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=Ea(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:Ea(t[0],`
31
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Ea(t[0],`
29
+ `)}var $a=class{options;rules;lexer;constructor(e){this.options=e||Ai}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:Ja(e,`
30
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Qa(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=Ja(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:Ja(t[0],`
31
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Ja(t[0],`
32
32
  `).split(`
33
33
  `),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(`
34
34
  `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
@@ -39,17 +39,17 @@ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
39
39
  `),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+`
40
40
  `+e.join(`
41
41
  `),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(`
42
- `);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=Oa(t[2].split(`
42
+ `);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=Xa(t[2].split(`
43
43
  `,1)[0],t[1].length),l=e.split(`
44
44
  `,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+`
45
45
  `,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(`
46
46
  `,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+=`
47
47
  `+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+=`
48
48
  `+l}u=!l.trim(),r+=p+`
49
- `,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=Ta(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
50
- `):[],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(Ta(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)===`
51
- `?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=Ea(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Da(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)),ka(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 ka(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}}}},Ma=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||li,this.options.tokenizer=this.options.tokenizer||new ja,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:pi,block:ya.normal,inline:ba.normal};this.options.pedantic?(t.block=ya.pedantic,t.inline=ba.pedantic):this.options.gfm&&(t.block=ya.gfm,this.options.breaks?t.inline=ba.breaks:t.inline=ba.gfm),this.tokenizer.rules=t}static get rules(){return{block:ya,inline:ba}}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(pi.carriageReturn,`
52
- `),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(pi.tabCharGlobal,` `).replace(pi.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+=`
49
+ `,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=qa(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
50
+ `):[],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(qa(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)===`
51
+ `?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=Ja(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Ya(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)),Za(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 Za(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}}}},eo=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ai,this.options.tokenizer=this.options.tokenizer||new $a,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:Pi,block:Va.normal,inline:Ha.normal};this.options.pedantic?(t.block=Va.pedantic,t.inline=Ha.pedantic):this.options.gfm&&(t.block=Va.gfm,this.options.breaks?t.inline=Ha.breaks:t.inline=Ha.gfm),this.tokenizer.rules=t}static get rules(){return{block:Va,inline:Ha}}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(Pi.carriageReturn,`
52
+ `),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(Pi.tabCharGlobal,` `).replace(Pi.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+=`
53
53
  `: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(`
54
54
  `)?``:`
55
55
  `)+r.raw,n.text+=`
@@ -62,9 +62,9 @@ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
62
62
  `+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(`
63
63
  `)?``:`
64
64
  `)+r.raw,n.text+=`
65
- `+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}},Na=class{options;parser;constructor(e){this.options=e||li}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(pi.notSpaceStart)?.[0],i=e.replace(pi.endingNewline,``)+`
66
- `;return r?`<pre><code class="language-`+Ca(r)+`">`+(n?i:Ca(i,!0))+`</code></pre>
67
- `:`<pre><code>`+(n?i:Ca(i,!0))+`</code></pre>
65
+ `+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}},to=class{options;parser;constructor(e){this.options=e||Ai}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Pi.notSpaceStart)?.[0],i=e.replace(Pi.endingNewline,``)+`
66
+ `;return r?`<pre><code class="language-`+Ga(r)+`">`+(n?i:Ga(i,!0))+`</code></pre>
67
+ `:`<pre><code>`+(n?i:Ga(i,!0))+`</code></pre>
68
68
  `}blockquote({tokens:e}){return`<blockquote>
69
69
  ${this.parser.parse(e)}</blockquote>
70
70
  `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
@@ -80,34 +80,44 @@ ${this.parser.parse(e)}</blockquote>
80
80
  `}tablerow({text:e}){return`<tr>
81
81
  ${e}</tr>
82
82
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
83
- `}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>${Ca(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=wa(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+Ca(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=wa(e);if(i===null)return Ca(n);e=i;let a=`<img src="${e}" alt="${Ca(n)}"`;return t&&(a+=` title="${Ca(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Ca(e.text)}},Pa=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}},Fa=class e{options;renderer;textRenderer;constructor(e){this.options=e||li,this.options.renderer=this.options.renderer||new Na,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Pa}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}},Ia=class{options;block;constructor(e){this.options=e||li}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?Ma.lex:Ma.lexInline}provideParser(){return this.block?Fa.parse:Fa.parseInline}},La=new class{defaults=ci();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Fa;Renderer=Na;TextRenderer=Pa;Lexer=Ma;Tokenizer=ja;Hooks=Ia;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 Na(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 ja(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 Ia;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];Ia.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&Ia.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 Ma.lex(e,t??this.defaults)}parser(e,t){return Fa.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?Ma.lex:Ma.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?Fa.parse:Fa.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?Ma.lex:Ma.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?Fa.parse:Fa.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+=`
84
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Ca(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function q(e,t){return La.parse(e,t)}q.options=q.setOptions=function(e){return La.setOptions(e),q.defaults=La.defaults,ui(q.defaults),q},q.getDefaults=ci,q.defaults=li,q.use=function(...e){return La.use(...e),q.defaults=La.defaults,ui(q.defaults),q},q.walkTokens=function(e,t){return La.walkTokens(e,t)},q.parseInline=La.parseInline,q.Parser=Fa,q.parser=Fa.parse,q.Renderer=Na,q.TextRenderer=Pa,q.Lexer=Ma,q.lexer=Ma.lex,q.Tokenizer=ja,q.Hooks=Ia,q.parse=q,q.options,q.setOptions,q.use,q.walkTokens,q.parseInline,Fa.parse,Ma.lex;var Ra=new Set([`script`,`iframe`,`object`,`embed`,`style`,`link`,`meta`]),za=new Set([`script`,`iframe`,`object`,`embed`,`link`,`meta`]);function Ba(e){let t=new DOMParser().parseFromString(e,`text/html`);return Ha(t.body,Ra),t.body.innerHTML}function Va(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`).documentElement;return t.tagName===`parsererror`||t.querySelector(`parsererror`)?``:(Ha(t,za),new XMLSerializer().serializeToString(t))}function Ha(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)}Ha(r,t)}for(let t of n)e.removeChild(t)}q.setOptions({breaks:!0,gfm:!0});function Ua(e){switch(e.type){case`user-prompt`:return{label:`You`,text:(e.content.split(`
83
+ `}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>${Ga(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=Ka(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+Ga(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=Ka(e);if(i===null)return Ga(n);e=i;let a=`<img src="${e}" alt="${Ga(n)}"`;return t&&(a+=` title="${Ga(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Ga(e.text)}},no=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}},ro=class e{options;renderer;textRenderer;constructor(e){this.options=e||Ai,this.options.renderer=this.options.renderer||new to,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new no}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}},io=class{options;block;constructor(e){this.options=e||Ai}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?eo.lex:eo.lexInline}provideParser(){return this.block?ro.parse:ro.parseInline}},J=new class{defaults=ki();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ro;Renderer=to;TextRenderer=no;Lexer=eo;Tokenizer=$a;Hooks=io;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 to(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 $a(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 io;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];io.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&io.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 eo.lex(e,t??this.defaults)}parser(e,t){return ro.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?eo.lex:eo.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?ro.parse:ro.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?eo.lex:eo.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?ro.parse:ro.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+=`
84
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Ga(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Y(e,t){return J.parse(e,t)}Y.options=Y.setOptions=function(e){return J.setOptions(e),Y.defaults=J.defaults,ji(Y.defaults),Y},Y.getDefaults=ki,Y.defaults=Ai,Y.use=function(...e){return J.use(...e),Y.defaults=J.defaults,ji(Y.defaults),Y},Y.walkTokens=function(e,t){return J.walkTokens(e,t)},Y.parseInline=J.parseInline,Y.Parser=ro,Y.parser=ro.parse,Y.Renderer=to,Y.TextRenderer=no,Y.Lexer=eo,Y.lexer=eo.lex,Y.Tokenizer=$a,Y.Hooks=io,Y.parse=Y,Y.options,Y.setOptions,Y.use,Y.walkTokens,Y.parseInline,ro.parse,eo.lex;var ao=new Set([`script`,`iframe`,`object`,`embed`,`style`,`link`,`meta`]),oo=new Set([`script`,`iframe`,`object`,`embed`,`link`,`meta`]);function so(e){let t=new DOMParser().parseFromString(e,`text/html`);return lo(t.body,ao),t.body.innerHTML}function co(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`).documentElement;return t.tagName===`parsererror`||t.querySelector(`parsererror`)?``:(lo(t,oo),new XMLSerializer().serializeToString(t))}function lo(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)}lo(r,t)}for(let t of n)e.removeChild(t)}Y.setOptions({breaks:!0,gfm:!0});function uo(e){switch(e.type){case`user-prompt`:return{label:`You`,text:(e.content.split(`
85
85
  `).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(`
86
- `).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 Wa(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 Ga({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]?Ua(t[w]):null,ee=w!==null&&t[w]?Wa(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)(Ka,{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 ${ee}`,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 Ka=(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?Ua(t):null,g=t?Wa(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:Ba(q.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 qa({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)(Ga,{actions:n,scenes:r,currentIndex:i,onSeek:a,addingForScene:o,onClearAddingTarget:s,readOnly:c})]})]})}var Ja=[1,5,10];function Ya({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:Ja.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 Xa(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 Za(e){let t=Xa(e);return t?`${t.server} · ${t.tool}`:e}var Qa=3,$a=(0,_.memo)(function({content:e,isActive:t}){let[n,r]=(0,_.useState)(!1),i=e.split(`
87
- `),a=i.length>Qa;(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,Qa).join(`
88
- `):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)`})]})}),eo=600,to=(0,_.memo)(function({content:e,isActive:t}){let n=e.length>eo,[r,i]=(0,_.useState)(!1),a=n&&!r?`${e.slice(0,eo)}...`:e,o=(0,_.useMemo)(()=>Ba(q.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)`})]})}),no=(0,_.memo)(function({content:e,isActive:t,tokens:n}){let[r,i]=(0,_.useState)(!1),a=rt(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 ro(){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`})}function io({ms:e}){let t=nt(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 J({tokens:e}){let t=rt(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}var ao=(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=rt(i),u=nt(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)(ro,{}),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 Y(){}Y.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(oo(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(oo(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 oo(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 Y;function so(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 co(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 lo(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 uo(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 fo(e,t){return lo(e,t,``)}function po(e,t){return uo(e,t,``)}function mo(e,t){return t.slice(0,ho(e,t))}function ho(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 go=`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}`,_o=RegExp(`[${go}]+|\\s+|[^${go}]`,`ug`),vo=new Y;vo.equals=function(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()},vo.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(_o)||[];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},vo.join=function(e){return e.map(function(e,t){return t==0?e:e.replace(/^\s+/,``)}).join(``)},vo.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)&&yo(n,i,r,e),n=e,r=null,i=null)}),(r||i)&&yo(n,i,r,null),e};function yo(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=so(i,o);e.value=uo(e.value,o,c),t.value=fo(t.value,c),n.value=fo(n.value,c)}if(r){var l=co(a,s);r.value=lo(r.value,s,l),t.value=po(t.value,l),n.value=po(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=so(u,d);t.value=fo(t.value,p);var m=co(fo(u,p),f);t.value=po(t.value,m),r.value=lo(r.value,u,m),e.value=uo(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],_=mo(g,h);t.value=po(t.value,_)}else if(e){var v=e.value.match(/\s*$/)[0],y=t.value.match(/^\s*/)[0],b=mo(v,y);t.value=fo(t.value,b)}}var bo=new Y;bo.tokenize=function(e){var t=RegExp(`(\\r?\\n)|[${go}]+|[^\\S\\n\\r]+|[^${go}]`,`ug`);return e.match(t)||[]};var xo=new Y;xo.tokenize=function(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
89
- `));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},xo.equals=function(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
86
+ `).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 fo(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 po({actions:e,scenes:t,currentIndex:n,onSeek:r,onSelectAnnotation:i,addingForScene:a,addingSelectedText:o=null,addingSelectedTextStart:s=null,addingSelectedTextEnd:c=null,focusedAnnotationId:l=null,onClearAddingTarget:u,readOnly:d=!1}){let{annotations:f,add:p,update:m,remove:h}=e,[g,v]=(0,_.useState)(null),[y,b]=(0,_.useState)(``),[x,S]=(0,_.useState)(null),[C,w]=(0,_.useState)(``),T=(0,_.useRef)(null),E=(0,_.useRef)(null),D=(0,_.useRef)(null),O=(0,_.useRef)(null),k=a??g,A=a===null?null:o,j=a===null?null:s,M=a===null?null:c;(0,_.useEffect)(()=>{a!==null&&(b(``),v(null),setTimeout(()=>{O.current?.scrollIntoView({behavior:`smooth`,block:`nearest`}),T.current?.focus()},50))},[a]),(0,_.useEffect)(()=>{k!==null&&T.current&&T.current.focus()},[k]),(0,_.useEffect)(()=>{x&&E.current&&E.current.focus()},[x]);let N=(0,_.useMemo)(()=>[...f].sort((e,t)=>e.sceneIndex-t.sceneIndex),[f]);(0,_.useEffect)(()=>{if(!D.current||k!==null)return;if(l){let e=D.current.querySelector(`[data-annotation-id="${CSS.escape(l)}"]`);if(e instanceof HTMLElement){e.scrollIntoView({behavior:`smooth`,block:`center`});return}}let e=D.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,k,l]);let ee=(0,_.useCallback)(()=>{v(null),b(``),u()},[u]),P=(0,_.useCallback)(()=>{!y.trim()||k===null||(p(k,y.trim(),A??void 0,j??void 0,M??void 0),b(``),v(null),u())},[p,k,A,M,j,y,u]),F=(0,_.useCallback)(()=>{!x||!C.trim()||(m(x,C.trim()),S(null),w(``))},[x,C,m]),I=k!==null&&t[k]?uo(t[k]):null,L=k!==null&&t[k]?fo(t[k]):``;return(0,U.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-terminal-border-subtle`,children:[(0,U.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest`,children:`Comments`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[d&&(0,U.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,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim`,children:f.length})]})]}),(0,U.jsxs)(`div`,{ref:D,className:`flex-1 overflow-y-auto`,children:[N.length===0&&k===null&&(0,U.jsxs)(`div`,{className:`px-3 py-8 text-center`,children:[(0,U.jsx)(`div`,{className:`text-terminal-dim text-xs font-mono mb-2`,children:`No comments yet`}),!d&&(0,U.jsx)(`div`,{className:`text-terminal-dimmer text-xs font-mono`,children:`Hover over any message and click the comment icon to add one`})]}),N.map(e=>(0,U.jsx)(mo,{annotation:e,scene:t[e.sceneIndex],isCurrent:e.sceneIndex===n,isEditing:!d&&x===e.id,isFocused:e.id===l,editBody:x===e.id?C:``,editTextareaRef:x===e.id?E:void 0,onSelect:()=>i?.(e.id)??r(e.sceneIndex),onStartEdit:()=>{S(e.id),w(e.body)},onCancelEdit:()=>{S(null),w(``)},onSaveEdit:F,onEditBodyChange:w,onDelete:()=>h(e.id),readOnly:d},e.id)),!d&&k!==null&&(0,U.jsxs)(`div`,{ref:O,className:`px-3 py-2.5 border-b border-terminal-border-subtle bg-terminal-blue-subtle`,children:[I&&(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 mb-2`,children:[(0,U.jsx)(`span`,{className:`text-xs font-mono font-semibold uppercase ${L}`,children:I.label}),(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim truncate`,children:I.text})]}),A&&(0,U.jsxs)(`div`,{className:`mb-2 rounded-md border border-terminal-blue/20 bg-terminal-blue-subtle/40 px-2 py-1.5`,children:[(0,U.jsx)(`div`,{className:`text-[10px] font-mono font-semibold uppercase tracking-wider text-terminal-blue mb-1`,children:`Selected text`}),(0,U.jsx)(`div`,{className:`text-xs font-mono text-terminal-text/85 max-h-20 overflow-hidden whitespace-pre-wrap break-words`,children:A})]}),(0,U.jsx)(`textarea`,{ref:T,value:y,onChange:e=>b(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),P()),e.key===`Escape`&&ee()},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,U.jsxs)(`div`,{className:`flex items-center justify-between mt-1.5`,children:[(0,U.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:[`⌘`,`+Enter to save`]}),(0,U.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,U.jsx)(`button`,{onClick:ee,className:`px-2 py-1 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`}),(0,U.jsx)(`button`,{onClick:P,disabled:!y.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 mo=(0,_.memo)(function({annotation:e,scene:t,isCurrent:n,isFocused:r,isEditing:i,editBody:a,editTextareaRef:o,onSelect:s,onStartEdit:c,onCancelEdit:l,onSaveEdit:u,onEditBodyChange:d,onDelete:f,readOnly:p=!1}){let[m,h]=(0,_.useState)(!1),g=t?uo(t):null,v=t?fo(t):`text-terminal-dim`,y=(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]),b=e.author===`vibe-feedback`;return(0,U.jsxs)(`div`,{"data-annotation-scene":e.sceneIndex,"data-annotation-id":e.id,className:`cursor-pointer px-3 py-2 border-b border-terminal-border-subtle transition-colors ${b?n?`bg-terminal-purple/10 border-l-2 border-l-terminal-purple`:`bg-terminal-purple/[0.03] hover:bg-terminal-purple/[0.06]`:r?`bg-terminal-blue/15 border-l-2 border-l-terminal-blue shadow-[inset_0_0_0_1px_rgba(96,165,250,0.16)]`:n?`bg-terminal-blue/10 border-l-2 border-l-terminal-blue`:`hover:bg-terminal-surface/50`}`,onClick:()=>{i||s()},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[b&&(0,U.jsx)(`div`,{className:`flex items-center gap-1.5 mb-1`,children:(0,U.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,U.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),s()},className:`flex items-center gap-1.5 mb-1 w-full text-left group/ref`,children:[g&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-xs font-mono font-semibold uppercase shrink-0 ${v}`,children:g.label}),(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim truncate group-hover/ref:text-terminal-text transition-colors`,children:g.text})]}),!g&&(0,U.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dim`,children:[`Step `,e.sceneIndex+1]})]}),(0,U.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[e.selectedText&&(0,U.jsx)(`blockquote`,{title:e.selectedText,className:`mb-2 max-h-11 overflow-hidden rounded-md border-l-2 border-terminal-blue/60 bg-terminal-blue-subtle/30 px-2 py-1.5 text-xs font-mono text-terminal-text/80 whitespace-pre-wrap break-words`,children:e.selectedText}),i?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`textarea`,{ref:o,value:a,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),u()),e.key===`Escape`&&l()},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,U.jsxs)(`div`,{className:`flex justify-end gap-1.5 mt-1`,children:[(0,U.jsx)(`button`,{onClick:e=>{e.stopPropagation(),l()},className:`px-2 py-0.5 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`}),(0,U.jsx)(`button`,{onClick:e=>{e.stopPropagation(),u()},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,U.jsx)(`div`,{className:`prose-terminal text-xs text-terminal-text leading-relaxed`,dangerouslySetInnerHTML:{__html:so(Y.parse(e.body))}})]}),!p&&!i&&(0,U.jsxs)(`div`,{className:`flex w-10 shrink-0 justify-end gap-0.5 pt-0.5 transition-opacity ${m?`opacity-100`:`pointer-events-none opacity-0`}`,children:[(0,U.jsx)(`button`,{onClick:e=>{e.stopPropagation(),c()},className:`p-0.5 text-xs text-terminal-dim hover:text-terminal-blue transition-colors`,title:`Edit`,children:`✎`}),(0,U.jsx)(`button`,{onClick:e=>{e.stopPropagation(),f()},className:`p-0.5 text-xs text-terminal-dim hover:text-terminal-red transition-colors`,title:`Delete`,children:`✕`})]})]}),(0,U.jsx)(`div`,{className:`text-xs font-mono text-terminal-dimmer mt-1`,children:y})]})});function ho({open:e,onClose:t,actions:n,scenes:r,currentIndex:i,onSeek:a,onSelectAnnotation:o,addingForScene:s,addingSelectedText:c,addingSelectedTextStart:l,addingSelectedTextEnd:u,focusedAnnotationId:d,onClearAddingTarget:f,readOnly:p}){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,U.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,U.jsx)(`div`,{className:`absolute inset-0 bg-black/30`,onClick:t}),(0,U.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,U.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,U.jsx)(po,{actions:n,scenes:r,currentIndex:i,onSeek:a,onSelectAnnotation:o,addingForScene:s,addingSelectedText:c,addingSelectedTextStart:l,addingSelectedTextEnd:u,focusedAnnotationId:d,onClearAddingTarget:f,readOnly:p})]})]})}var go=[1,5,10];function _o({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,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex md:hidden items-center justify-between px-3 py-1.5`,children:[(0,U.jsx)(`button`,{onClick:()=>{y(`play`),o()},className:`${S} bg-terminal-green-subtle text-terminal-green ${b(`play`)}`,title:`Play/Pause`,children:(0,U.jsx)(`span`,{className:`text-base`,children:m})}),(0,U.jsx)(`button`,{onClick:()=>{y(`prev`),c()},className:`${S} bg-terminal-surface text-terminal-text ${b(`prev`)}`,title:`Previous turn`,children:(0,U.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,U.jsx)(`path`,{d:`M15 18l-6-6 6-6`})})}),(0,U.jsxs)(`span`,{className:`text-xs font-mono text-terminal-text tabular-nums font-medium`,children:[a,` / `,i]}),(0,U.jsx)(`button`,{onClick:()=>{y(`next`),l()},className:`${S} bg-terminal-surface text-terminal-text ${b(`next`)}`,title:`Next turn`,children:(0,U.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,U.jsx)(`path`,{d:`M9 18l6-6-6-6`})})}),(0,U.jsx)(`button`,{onClick:()=>{y(`search`),u()},className:`${S} bg-terminal-surface text-terminal-text ${b(`search`)}`,title:`Search`,children:(0,U.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,U.jsx)(`path`,{d:`m21 21-4.35-4.35`})]})}),d&&(0,U.jsx)(`button`,{onClick:()=>{y(`outline`),d()},className:`${S} bg-terminal-surface border border-terminal-border text-terminal-text ${b(`outline`)}`,title:`Outline`,children:`☰`})]}),(0,U.jsxs)(`div`,{className:`hidden md:flex items-center justify-between px-5 py-2.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.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,U.jsx)(`span`,{children:m}),(0,U.jsx)(`span`,{className:`ml-1.5`,children:h})]}),(0,U.jsx)(`div`,{className:`flex items-center rounded-lg bg-terminal-surface overflow-hidden`,children:go.map(e=>(0,U.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,U.jsxs)(`div`,{className:`flex items-center`,children:[(0,U.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,U.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,U.jsx)(`span`,{className:`font-mono`,children:a}),(0,U.jsx)(`span`,{children:`/`}),(0,U.jsx)(`span`,{className:`font-mono`,children:i})]}),(0,U.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,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.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,U.jsx)(`span`,{className:`text-sm opacity-70 group-hover/search:opacity-100 transition-opacity`,children:`🔍`}),(0,U.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,U.jsx)(`div`,{className:`flex items-center gap-1 ml-1 opacity-40 group-hover/search:opacity-80 transition-opacity`,children:(0,U.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,U.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,U.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,U.jsx)(`span`,{className:`text-[11px] font-mono font-black`,children:`?`})}),(0,U.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,U.jsxs)(`div`,{className:`flex items-center gap-2 md:gap-3 text-xs text-terminal-dim font-mono shrink-0`,children:[e===`paused`&&(0,U.jsx)(`span`,{className:`text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-orange`,children:`Paused`}),(0,U.jsxs)(`span`,{className:`tabular-nums`,children:[Math.max(0,n+1),` / `,r]})]})]})]})]})}var vo=`rounded bg-terminal-blue/20 text-terminal-text ring-1 ring-terminal-blue/40 cursor-pointer hover:bg-terminal-blue/30 transition-colors`;function yo(e){let t=new Map;return e.filter(e=>e.selectedText?.trim()).forEach(e=>{let n=t.get(e.sceneIndex)??[];n.push({id:e.id,text:e.selectedText.trim(),title:e.body,start:e.selectedTextStart,end:e.selectedTextEnd}),t.set(e.sceneIndex,n)}),t}function bo(e,t,n=!0){let r=[];for(let i of t){if(!i.text)continue;let t=n&&Number.isInteger(i.start)&&Number.isInteger(i.end)&&i.start>=0&&i.end>i.start&&i.end<=e.length&&e.slice(i.start,i.end)===i.text?i.start:e.indexOf(i.text);if(t<0)continue;let a=t+i.text.length;r.some(e=>t<e.end&&a>e.start)||r.push({start:t,end:a,highlight:i})}return r.sort((e,t)=>e.start-t.start)}function xo(e,t){return bo(e,t).length>0}function So(e,t){return typeof DOMParser>`u`?!1:bo(new DOMParser().parseFromString(e,`text/html`).body.textContent??``,t,!1).length>0}function Co(e,t,n){let r=bo(e,t);if(r.length===0)return e;let i=[],a=0;return r.forEach(t=>{t.start>a&&i.push(e.slice(a,t.start)),i.push((0,U.jsx)(`mark`,{"data-vibe-annotation-id":t.highlight.id,title:t.highlight.title,className:vo,onClick:e=>{e.stopPropagation(),n?.(t.highlight.id)},children:e.slice(t.start,t.end)},t.highlight.id)),a=t.end}),a<e.length&&i.push(e.slice(a)),i}function wo(e,t,n){let r=e.createElement(`mark`);return r.dataset.vibeAnnotationId=t.id,r.title=t.title,r.className=vo,r.textContent=n,r}function To(e,t){if(typeof DOMParser>`u`)return e;let n=new DOMParser().parseFromString(e,`text/html`),r=[],i=``,a=e=>{if(e.nodeType===Node.TEXT_NODE){let t=e,n=t.nodeValue??``,a=i.length;i+=n,r.push({node:t,start:a,end:i.length});return}e.childNodes.forEach(a)};a(n.body);let o=bo(i,t,!1);return o.length===0?e:(r.toReversed().forEach(e=>{if(!e.node.parentNode)return;let t=e.node.nodeValue??``,r=o.map(t=>({start:Math.max(t.start,e.start),end:Math.min(t.end,e.end),highlight:t.highlight})).filter(e=>e.start<e.end).sort((e,t)=>e.start-t.start);if(r.length===0)return;let i=n.createDocumentFragment(),a=0;r.forEach(r=>{let o=r.start-e.start,s=r.end-e.start;o>a&&i.appendChild(n.createTextNode(t.slice(a,o))),i.appendChild(wo(n,r.highlight,t.slice(o,s))),a=s}),a<t.length&&i.appendChild(n.createTextNode(t.slice(a))),e.node.parentNode.replaceChild(i,e.node)}),n.body.innerHTML)}function Eo(e,t){let n=e.target;if(!(n instanceof Element))return;let r=n.closest(`[data-vibe-annotation-id]`);if(!(r instanceof HTMLElement))return;let i=r.dataset.vibeAnnotationId;i&&(e.stopPropagation(),t?.(i))}function Do(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 Oo(e){let t=Do(e);return t?`${t.server} · ${t.tool}`:e}var ko=3,Ao=(0,_.memo)(function({content:e,isActive:t,highlights:n=[],onHighlightClick:r}){let[i,a]=(0,_.useState)(!1),o=e.split(`
87
+ `),s=o.length>ko;(0,_.useEffect)(()=>{if(!t)return;let e=e=>{let t=e.detail;t.action===`expand`?a(!0):t.action===`collapse`&&a(!1)};return window.addEventListener(`vibe:toggle-expand`,e),()=>window.removeEventListener(`vibe:toggle-expand`,e)},[t]);let c=s&&!i?o.slice(0,ko).join(`
88
+ `):e;return(0,_.useEffect)(()=>{s&&!i&&xo(e,n)&&!xo(c,n)&&a(!0)},[e,c,i,n,s]),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dimmer whitespace-pre-wrap leading-relaxed ${s&&!i?`max-h-[4.5em] overflow-hidden relative`:``}`,children:[Co(c,n,r),s&&!i&&(0,U.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-8 bg-gradient-to-t from-terminal-surface to-transparent pointer-events-none`})]}),s&&(0,U.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),a(!i)},className:`mt-1 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors cursor-pointer`,children:i?`Show less`:`Show full summary (${o.length} lines)`})]})}),jo=600,Mo=(0,_.memo)(function({content:e,isActive:t,highlights:n=[],onHighlightClick:r}){let i=e.length>jo,[a,o]=(0,_.useState)(!1),s=i&&!a?`${e.slice(0,jo)}...`:e,c=(0,_.useMemo)(()=>so(Y.parse(e)),[e]),l=(0,_.useMemo)(()=>so(Y.parse(s)),[s]);(0,_.useEffect)(()=>{i&&!a&&(xo(e,n)||So(c,n))&&!xo(s,n)&&!So(l,n)&&o(!0)},[e,s,l,a,c,n,i]);let u=(0,_.useMemo)(()=>To(l,n),[l,n]);return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`prose-terminal text-sm text-terminal-text ${t?`typing-cursor`:``} ${i&&!a?`max-h-[200px] overflow-hidden relative`:``}`,children:[(0,U.jsx)(`div`,{onClick:e=>Eo(e,r),dangerouslySetInnerHTML:{__html:u}}),i&&!a&&(0,U.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-terminal-bg to-transparent`})]}),i&&(0,U.jsx)(`button`,{onClick:()=>o(!a),className:`mt-1 text-xs font-mono text-terminal-blue hover:text-terminal-text transition-colors`,children:a?`Show less`:`Show more (${e.length} chars)`})]})}),No=(0,_.memo)(function({content:e,isActive:t,tokens:n,highlights:r=[],onHighlightClick:i}){let[a,o]=(0,_.useState)(!1),s=ct(n);return(0,_.useEffect)(()=>{!a&&xo(e,r)&&o(!0)},[e,a,r]),(0,U.jsxs)(`div`,{className:`ml-6`,children:[(0,U.jsxs)(`button`,{onClick:()=>o(!a),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,U.jsx)(`span`,{className:`transition-transform ${a?`rotate-90`:``}`,children:`▶`}),(0,U.jsx)(`span`,{className:`text-terminal-purple ${t?`animate-pulse`:``}`,children:`Thinking`}),s?(0,U.jsxs)(`span`,{className:`text-terminal-purple/70 text-[10px]`,title:`Approximate thinking tokens (chars/4)`,children:[`~`,s,` tok`]}):(0,U.jsxs)(`span`,{className:`text-terminal-purple/70 text-[10px]`,children:[e.length,` chars`]})]}),a&&(0,U.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:Co(e,r,i)})]})});function Po(){return(0,U.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`})}function Fo({ms:e}){let t=st(e);return t?(0,U.jsx)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`Tool execution: ${t}`,children:t}):null}function Io({tokens:e}){let t=ct(e);return t?(0,U.jsxs)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`~${t} tokens added to context (heuristic estimate)`,children:[`~`,t,` tok`]}):null}var Lo=(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=ct(i),u=st(r);return(0,U.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,U.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,U.jsx)(`span`,{className:`text-xs font-mono font-bold ${a?`text-red-400`:`text-terminal-orange`}`,children:`$`}),(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-text truncate flex-1`,children:e}),a&&(0,U.jsx)(Po,{}),l&&(0,U.jsxs)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`~${l} tokens added to context`,children:[`~`,l,` tok`]}),u&&(0,U.jsx)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`Execution: ${u}`,children:u}),c&&(0,U.jsx)(`span`,{className:`text-xs text-terminal-dim transition-transform ${o?`rotate-90`:``}`,children:`▶`})]}),o&&c&&(0,U.jsx)(`div`,{className:`px-3 py-2 max-h-[300px] overflow-y-auto`,children:(0,U.jsx)(`pre`,{className:`text-xs font-mono text-terminal-dim whitespace-pre-wrap break-words`,children:t})})]})});function Ro(){}Ro.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(zo(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(zo(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 zo(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 Ro;function Bo(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 Vo(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 Ho(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 Uo(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 Wo(e,t){return Ho(e,t,``)}function Go(e,t){return Uo(e,t,``)}function Ko(e,t){return t.slice(0,qo(e,t))}function qo(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 Jo=`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}`,Yo=RegExp(`[${Jo}]+|\\s+|[^${Jo}]`,`ug`),Xo=new Ro;Xo.equals=function(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()},Xo.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(Yo)||[];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},Xo.join=function(e){return e.map(function(e,t){return t==0?e:e.replace(/^\s+/,``)}).join(``)},Xo.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)&&Zo(n,i,r,e),n=e,r=null,i=null)}),(r||i)&&Zo(n,i,r,null),e};function Zo(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=Bo(i,o);e.value=Uo(e.value,o,c),t.value=Wo(t.value,c),n.value=Wo(n.value,c)}if(r){var l=Vo(a,s);r.value=Ho(r.value,s,l),t.value=Go(t.value,l),n.value=Go(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=Bo(u,d);t.value=Wo(t.value,p);var m=Vo(Wo(u,p),f);t.value=Go(t.value,m),r.value=Ho(r.value,u,m),e.value=Uo(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],_=Ko(g,h);t.value=Go(t.value,_)}else if(e){var v=e.value.match(/\s*$/)[0],y=t.value.match(/^\s*/)[0],b=Ko(v,y);t.value=Wo(t.value,b)}}var Qo=new Ro;Qo.tokenize=function(e){var t=RegExp(`(\\r?\\n)|[${Jo}]+|[^\\S\\n\\r]+|[^${Jo}]`,`ug`);return e.match(t)||[]};var $o=new Ro;$o.tokenize=function(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
89
+ `));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},$o.equals=function(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
90
90
  `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
91
91
  `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
92
92
  `)&&(e=e.slice(0,-1)),t.endsWith(`
93
- `)&&(t=t.slice(0,-1))),Y.prototype.equals.call(this,e,t,n)};function So(e,t,n){return xo.diff(e,t,n)}var Co=new Y;Co.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var wo=new Y;wo.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function To(e){"@babel/helpers - typeof";return To=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},To(e)}var Eo=new Y;Eo.useLongestToken=!0,Eo.tokenize=xo.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(Do(e,null,null,i),i,` `)},Eo.equals=function(e,t,n){return Y.prototype.equals.call(Eo,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)};function Do(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]=Do(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),To(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]=Do(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var Oo=new Y;Oo.tokenize=function(e){return e.slice()},Oo.join=Oo.removeEmpty=function(e){return e};function ko(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=ko(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Ao(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ko(e))&&(r&&(r+=` `),r+=t);return r}var jo=Ao,Mo=Object.create,No=Object.defineProperty,Po=Object.defineProperties,Fo=Object.getOwnPropertyDescriptor,Io=Object.getOwnPropertyDescriptors,Lo=Object.getOwnPropertyNames,Ro=Object.getOwnPropertySymbols,zo=Object.getPrototypeOf,Bo=Object.prototype.hasOwnProperty,Vo=Object.prototype.propertyIsEnumerable,Ho=(e,t,n)=>t in e?No(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uo=(e,t)=>{for(var n in t||={})Bo.call(t,n)&&Ho(e,n,t[n]);if(Ro)for(var n of Ro(t))Vo.call(t,n)&&Ho(e,n,t[n]);return e},Wo=(e,t)=>Po(e,Io(t)),Go=(e,t)=>{var n={};for(var r in e)Bo.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ro)for(var r of Ro(e))t.indexOf(r)<0&&Vo.call(e,r)&&(n[r]=e[r]);return n},Ko=(e,t)=>function(){return t||(0,e[Lo(e)[0]])((t={exports:{}}).exports,t),t.exports},qo=(e,t)=>{for(var n in t)No(e,n,{get:t[n],enumerable:!0})},Jo=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Lo(t))!Bo.call(e,i)&&i!==n&&No(e,i,{get:()=>t[i],enumerable:!(r=Fo(t,i))||r.enumerable});return e},X=((e,t,n)=>(n=e==null?{}:Mo(zo(e)),Jo(t||!e||!e.__esModule?No(n,`default`,{value:e,enumerable:!0}):n,e)))(Ko({"../../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,`&amp;`).replace(/</g,`&lt;`).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,`&quot;`)+`"`;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 ee=S;ee!==t.tail&&(k<O||typeof ee.value==`string`);ee=ee.next)T++,k+=ee.value.length;T--,w=e.slice(C,k),E.index-=C}else if(E=a(x,0,w,_),!E)continue;var D=E.index,A=E[0],te=w.slice(0,D),j=w.slice(D+A.length),M=C+w.length;d&&M>d.reach&&(d.reach=M);var ne=S.prev;te&&(ne=c(t,ne,te),C+=te.length),l(t,ne,T);var N=new i(f,g?r.tokenize(A,g):A,y,A);if(S=c(t,ne,N),j&&c(t,S,j),T>1){var P={cause:f+`,`+m,reach:M};o(e,t,n,S.prev,C,P),d&&P.reach>d.reach&&(d.reach=P.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}})());X.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]},X.languages.markup.tag.inside[`attr-value`].inside.entity=X.languages.markup.entity,X.languages.markup.doctype.inside[`internal-subset`].inside=X.languages.markup,X.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&amp;/,`&`))}),Object.defineProperty(X.languages.markup.tag,`addInlined`,{value:function(e,t){var n={},n=(n[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:X.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),t=(n[`language-`+t]={pattern:/[\s\S]+/,inside:X.languages[t]},{});t[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:n},X.languages.insertBefore(`markup`,`cdata`,t)}}),Object.defineProperty(X.languages.markup.tag,`addAttribute`,{value:function(e,t){X.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:X.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),X.languages.html=X.languages.markup,X.languages.mathml=X.languages.markup,X.languages.svg=X.languages.markup,X.languages.xml=X.languages.extend(`markup`,{}),X.languages.ssml=X.languages.xml,X.languages.atom=X.languages.xml,X.languages.rss=X.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`}}}(X),X.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:/[{}[\];(),.:]/},X.languages.javascript=X.languages.extend(`clike`,{"class-name":[X.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}|\?\?=?|\?\.?|[~:]/}),X.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,X.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:X.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:X.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:X.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:X.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:X.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),X.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:X.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`}}),X.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),X.languages.markup&&(X.languages.markup.tag.addInlined(`script`,`javascript`),X.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`)),X.languages.js=X.languages.javascript,X.languages.actionscript=X.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:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),X.languages.actionscript[`class-name`].alias=`function`,delete X.languages.actionscript.parameter,delete X.languages.actionscript[`literal-property`],X.languages.markup&&X.languages.insertBefore(`actionscript`,`string`,{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:X.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}(X),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)}(X),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`))}(X),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})}(X),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}(X),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}(X),X.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:X.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+/},X.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)}}),X.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)})}(X),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}(X),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)}(X),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})}(X),X.languages.n4js=X.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/}),X.languages.insertBefore(`n4js`,`constant`,{annotation:{pattern:/@+\w+/,alias:`operator`}}),X.languages.n4jsd=X.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]*/}}(X),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)})}(X),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}(X),X.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:/[{}[\]();,.:\\]/},X.languages.swift[`string-literal`].forEach(function(e){e.inside.interpolation.inside=X.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}(X),X.languages.c=X.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|[?:~]|[-+*/%&|^!=<>]=?/}),X.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),X.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},X.languages.c.string],char:X.languages.c.char,comment:X.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:X.languages.c}}}}),X.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 X.languages.c.boolean,X.languages.objectivec=X.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 X.languages.objectivec[`class-name`],X.languages.objc=X.languages.objectivec,X.languages.reason=X.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/}),X.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 X.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}(X),X.languages.go=X.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/}),X.languages.insertBefore(`go`,`string`,{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete X.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`])}(X),X.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:/![sra](?=[:}]$)/,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:/[{}[\];(),.:]/},X.languages.python[`string-interpolation`].inside.interpolation.inside.rest=X.languages.python,X.languages.py=X.languages.python,X.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`}},X.languages.webmanifest=X.languages.json;var Yo={};qo(Yo,{dracula:()=>Xo,duotoneDark:()=>Zo,duotoneLight:()=>Qo,github:()=>$o,gruvboxMaterialDark:()=>hs,gruvboxMaterialLight:()=>gs,jettwaveDark:()=>ds,jettwaveLight:()=>fs,nightOwl:()=>es,nightOwlLight:()=>ts,oceanicNext:()=>rs,okaidia:()=>is,oneDark:()=>ps,oneLight:()=>ms,palenight:()=>as,shadesOfPurple:()=>os,synthwave84:()=>ss,ultramin:()=>cs,vsDark:()=>ls,vsLight:()=>us});var Xo={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)`}}]},Zo={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`}}]},Qo={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`}}]},$o={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`}}]},es={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)`}}]},ts={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)`}}]},ns={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`},rs={plain:{backgroundColor:`#282c34`,color:`#ffffff`},styles:[{types:[`attr-name`],style:{color:ns.keyword}},{types:[`attr-value`],style:{color:ns.string}},{types:[`comment`,`block-comment`,`prolog`,`doctype`,`cdata`,`shebang`],style:{color:ns.comment}},{types:[`property`,`number`,`function-name`,`constant`,`symbol`,`deleted`],style:{color:ns.primitive}},{types:[`boolean`],style:{color:ns.boolean}},{types:[`tag`],style:{color:ns.tag}},{types:[`string`],style:{color:ns.string}},{types:[`punctuation`],style:{color:ns.string}},{types:[`selector`,`char`,`builtin`,`inserted`],style:{color:ns.char}},{types:[`function`],style:{color:ns.function}},{types:[`operator`,`entity`,`url`,`variable`],style:{color:ns.variable}},{types:[`keyword`],style:{color:ns.keyword}},{types:[`atrule`,`class-name`],style:{color:ns.className}},{types:[`important`],style:{fontWeight:`400`}},{types:[`bold`],style:{fontWeight:`bold`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`namespace`],style:{opacity:.7}}]},is={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`}}]},as={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)`}}]},os={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)`}}]},ss={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`}}]},cs={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)`}}]},ls={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)`}}]},us={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)`}}]},ds={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`}}]},fs={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`}}]},ps={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%)`}}]},ms={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%)`}}]},hs={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`}}]},gs={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`}}]},_s=e=>(0,_.useCallback)(t=>{var n=t,{className:r,style:i,line:a}=n;let o=Wo(Uo({},Go(n,[`className`,`style`,`line`])),{className:jo(`token-line`,r)});return typeof e==`object`&&`plain`in e&&(o.style=e.plain),typeof i==`object`&&(o.style=Uo(Uo({},o.style||{}),i)),o},[e]),vs=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=Wo(Uo({},Go(n,[`token`,`className`,`style`])),{className:jo(`token`,...r.types,i),children:r.content,style:t(r)});return a!=null&&(o.style=Uo(Uo({},o.style||{}),a)),o},[t])},ys=/\r\n|\r|\n/,bs=e=>{e.length===0?e.push({types:[`plain`],content:`
93
+ `)&&(t=t.slice(0,-1))),Ro.prototype.equals.call(this,e,t,n)};function es(e,t,n){return $o.diff(e,t,n)}var ts=new Ro;ts.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var ns=new Ro;ns.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function rs(e){"@babel/helpers - typeof";return rs=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},rs(e)}var is=new Ro;is.useLongestToken=!0,is.tokenize=$o.tokenize,is.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(as(e,null,null,i),i,` `)},is.equals=function(e,t,n){return Ro.prototype.equals.call(is,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)};function as(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]=as(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),rs(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]=as(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var os=new Ro;os.tokenize=function(e){return e.slice()},os.join=os.removeEmpty=function(e){return e};function ss(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=ss(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function cs(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ss(e))&&(r&&(r+=` `),r+=t);return r}var ls=cs,us=Object.create,ds=Object.defineProperty,fs=Object.defineProperties,ps=Object.getOwnPropertyDescriptor,ms=Object.getOwnPropertyDescriptors,hs=Object.getOwnPropertyNames,gs=Object.getOwnPropertySymbols,_s=Object.getPrototypeOf,vs=Object.prototype.hasOwnProperty,ys=Object.prototype.propertyIsEnumerable,bs=(e,t,n)=>t in e?ds(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xs=(e,t)=>{for(var n in t||={})vs.call(t,n)&&bs(e,n,t[n]);if(gs)for(var n of gs(t))ys.call(t,n)&&bs(e,n,t[n]);return e},Ss=(e,t)=>fs(e,ms(t)),Cs=(e,t)=>{var n={};for(var r in e)vs.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gs)for(var r of gs(e))t.indexOf(r)<0&&ys.call(e,r)&&(n[r]=e[r]);return n},ws=(e,t)=>function(){return t||(0,e[hs(e)[0]])((t={exports:{}}).exports,t),t.exports},Ts=(e,t)=>{for(var n in t)ds(e,n,{get:t[n],enumerable:!0})},Es=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of hs(t))!vs.call(e,i)&&i!==n&&ds(e,i,{get:()=>t[i],enumerable:!(r=ps(t,i))||r.enumerable});return e},X=((e,t,n)=>(n=e==null?{}:us(_s(e)),Es(t||!e||!e.__esModule?ds(n,`default`,{value:e,enumerable:!0}):n,e)))(ws({"../../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,`&amp;`).replace(/</g,`&lt;`).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,`&quot;`)+`"`;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}})());X.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]},X.languages.markup.tag.inside[`attr-value`].inside.entity=X.languages.markup.entity,X.languages.markup.doctype.inside[`internal-subset`].inside=X.languages.markup,X.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&amp;/,`&`))}),Object.defineProperty(X.languages.markup.tag,`addInlined`,{value:function(e,t){var n={},n=(n[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:X.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),t=(n[`language-`+t]={pattern:/[\s\S]+/,inside:X.languages[t]},{});t[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:n},X.languages.insertBefore(`markup`,`cdata`,t)}}),Object.defineProperty(X.languages.markup.tag,`addAttribute`,{value:function(e,t){X.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:X.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),X.languages.html=X.languages.markup,X.languages.mathml=X.languages.markup,X.languages.svg=X.languages.markup,X.languages.xml=X.languages.extend(`markup`,{}),X.languages.ssml=X.languages.xml,X.languages.atom=X.languages.xml,X.languages.rss=X.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`}}}(X),X.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:/[{}[\];(),.:]/},X.languages.javascript=X.languages.extend(`clike`,{"class-name":[X.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}|\?\?=?|\?\.?|[~:]/}),X.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,X.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:X.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:X.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:X.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:X.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:X.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),X.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:X.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`}}),X.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),X.languages.markup&&(X.languages.markup.tag.addInlined(`script`,`javascript`),X.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`)),X.languages.js=X.languages.javascript,X.languages.actionscript=X.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:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),X.languages.actionscript[`class-name`].alias=`function`,delete X.languages.actionscript.parameter,delete X.languages.actionscript[`literal-property`],X.languages.markup&&X.languages.insertBefore(`actionscript`,`string`,{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:X.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}(X),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)}(X),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`))}(X),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})}(X),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}(X),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}(X),X.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:X.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+/},X.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)}}),X.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)})}(X),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}(X),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)}(X),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})}(X),X.languages.n4js=X.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/}),X.languages.insertBefore(`n4js`,`constant`,{annotation:{pattern:/@+\w+/,alias:`operator`}}),X.languages.n4jsd=X.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]*/}}(X),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)})}(X),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}(X),X.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:/[{}[\]();,.:\\]/},X.languages.swift[`string-literal`].forEach(function(e){e.inside.interpolation.inside=X.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}(X),X.languages.c=X.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|[?:~]|[-+*/%&|^!=<>]=?/}),X.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),X.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},X.languages.c.string],char:X.languages.c.char,comment:X.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:X.languages.c}}}}),X.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 X.languages.c.boolean,X.languages.objectivec=X.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 X.languages.objectivec[`class-name`],X.languages.objc=X.languages.objectivec,X.languages.reason=X.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/}),X.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 X.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}(X),X.languages.go=X.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/}),X.languages.insertBefore(`go`,`string`,{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete X.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`])}(X),X.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:/![sra](?=[:}]$)/,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:/[{}[\];(),.:]/},X.languages.python[`string-interpolation`].inside.interpolation.inside.rest=X.languages.python,X.languages.py=X.languages.python,X.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`}},X.languages.webmanifest=X.languages.json;var Ds={};Ts(Ds,{dracula:()=>Os,duotoneDark:()=>ks,duotoneLight:()=>As,github:()=>js,gruvboxMaterialDark:()=>qs,gruvboxMaterialLight:()=>Js,jettwaveDark:()=>Us,jettwaveLight:()=>Ws,nightOwl:()=>Ms,nightOwlLight:()=>Ns,oceanicNext:()=>Fs,okaidia:()=>Is,oneDark:()=>Gs,oneLight:()=>Ks,palenight:()=>Ls,shadesOfPurple:()=>Rs,synthwave84:()=>zs,ultramin:()=>Bs,vsDark:()=>Vs,vsLight:()=>Hs});var Os={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)`}}]},ks={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`}}]},As={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`}}]},js={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`}}]},Ms={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)`}}]},Ns={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)`}}]},Ps={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`},Fs={plain:{backgroundColor:`#282c34`,color:`#ffffff`},styles:[{types:[`attr-name`],style:{color:Ps.keyword}},{types:[`attr-value`],style:{color:Ps.string}},{types:[`comment`,`block-comment`,`prolog`,`doctype`,`cdata`,`shebang`],style:{color:Ps.comment}},{types:[`property`,`number`,`function-name`,`constant`,`symbol`,`deleted`],style:{color:Ps.primitive}},{types:[`boolean`],style:{color:Ps.boolean}},{types:[`tag`],style:{color:Ps.tag}},{types:[`string`],style:{color:Ps.string}},{types:[`punctuation`],style:{color:Ps.string}},{types:[`selector`,`char`,`builtin`,`inserted`],style:{color:Ps.char}},{types:[`function`],style:{color:Ps.function}},{types:[`operator`,`entity`,`url`,`variable`],style:{color:Ps.variable}},{types:[`keyword`],style:{color:Ps.keyword}},{types:[`atrule`,`class-name`],style:{color:Ps.className}},{types:[`important`],style:{fontWeight:`400`}},{types:[`bold`],style:{fontWeight:`bold`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`namespace`],style:{opacity:.7}}]},Is={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`}}]},Ls={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)`}}]},Rs={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)`}}]},zs={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`}}]},Bs={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)`}}]},Vs={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)`}}]},Hs={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)`}}]},Us={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`}}]},Ws={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`}}]},Gs={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%)`}}]},Ks={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%)`}}]},qs={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`}}]},Js={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`}}]},Ys=e=>(0,_.useCallback)(t=>{var n=t,{className:r,style:i,line:a}=n;let o=Ss(xs({},Cs(n,[`className`,`style`,`line`])),{className:ls(`token-line`,r)});return typeof e==`object`&&`plain`in e&&(o.style=e.plain),typeof i==`object`&&(o.style=xs(xs({},o.style||{}),i)),o},[e]),Xs=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=Ss(xs({},Cs(n,[`token`,`className`,`style`])),{className:ls(`token`,...r.types,i),children:r.content,style:t(r)});return a!=null&&(o.style=xs(xs({},o.style||{}),a)),o},[t])},Zs=/\r\n|\r|\n/,Qs=e=>{e.length===0?e.push({types:[`plain`],content:`
94
94
  `,empty:!0}):e.length===1&&e[0].content===``&&(e[0].content=`
95
- `,e[0].empty=!0)},xs=(e,t)=>{let n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},Ss=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=xs(l,u.type),u.alias&&(l=xs(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(ys),f=d.length;s.push({types:l,content:d[0]});for(let e=1;e<f;e++)bs(s),c.push(s=[]),s.push({types:l,content:d[e]})}o--,t.pop(),n.pop(),r.pop(),i.pop()}return bs(s),c},Cs=({prism:e,code:t,grammar:n,language:r})=>(0,_.useMemo)(()=>{if(n==null)return Ss([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),Ss(i.tokens)},[t,n,r,e]),ws=(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]=Uo(Uo({},e[t]),i)}),e},{});return r.root=n,r.plain=Wo(Uo({},n),{backgroundColor:void 0}),r},Ts=({children:e,language:t,code:n,theme:r,prism:i})=>{let a=t.toLowerCase(),o=ws(r,a),s=_s(o),c=vs(o),l=i.languages[a];return e({tokens:Cs({prism:i,language:a,code:n,grammar:l}),className:`prism-code language-${a}`,style:o==null?{}:o.root,getLineProps:s,getTokenProps:c})},Es=e=>(0,_.createElement)(Ts,Wo(Uo({},e),{prism:e.prism||X,theme:e.theme||ls,code:e.code,language:e.language})),Ds=e=>{let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},Os=()=>document.documentElement.classList.contains(`dark`);function ks(e,t){if(!e&&t)return t.split(`
96
- `).map(e=>({type:`add`,content:e}));let n=So(e,t),r=[];for(let e of n){let t=e.value.replace(/\n$/,``).split(`
97
- `),n=e.added?`add`:e.removed?`remove`:`context`;for(let e of t)r.push({type:n,content:e})}return r}function As(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 js=(0,_.memo)(function({toolName:e,filePath:t,oldContent:n,newContent:r,isActive:i,isError:a,durationMs:o,resultTokens:s}){let c=(0,_.useMemo)(()=>ks(n,r),[n,r]),l=As(t),u=(0,_.useSyncExternalStore)(Ds,Os);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)(ro,{}),(0,V.jsx)(J,{tokens:s}),(0,V.jsx)(io,{ms:o}),!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)(Es,{theme:u?Yo.nightOwl:Yo.nightOwlLight,code:c.map(e=>e.content).join(`
98
- `),language:l,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=c[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`:``,o=i.type===`add`?`+`:i.type===`remove`?`-`:` `,s=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 ${s}`,children:o}),(0,V.jsx)(`span`,{children:e.map((e,t)=>(0,V.jsx)(`span`,{...n({token:e})},t))})]},r)})})})})]})}),Ms=`▶`;function Ns(e){return e.tokenUsage?e.tokenUsage.inputTokens+e.tokenUsage.outputTokens+e.tokenUsage.cacheCreationTokens+e.tokenUsage.cacheReadTokens:0}function Ps(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 Fs(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 Is={Explore:`blue`,Plan:`purple`,Shell:`blue`,"general-purpose":`green`,"claude-code-guide":`orange`};function Ls(e){return Is[e]||`purple`}var Rs={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 zs({type:e}){let t=Rs[Ls(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 Bs({theme:e}){return(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold uppercase tracking-widest ${Rs[e].text}`,children:`Subagent`})}function Vs({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)(Us,{scenes:e.scenes})]})}var Hs=20;function Us({scenes:e}){let[t,n]=(0,_.useState)(!1),r=e.length>Hs,i=r&&!t?e.slice(0,Hs):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)(Ws,{scene:e},t))})]})}function Ws({scene:e}){let[t,n]=(0,_.useState)(!1);if(e.type===`thinking`){let t=rt(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:Za(r.toolName)}),(0,V.jsx)(`span`,{className:`text-terminal-dim truncate flex-1`,children:qs(r.toolName,r.input)}),r.isError&&(0,V.jsx)(ro,{}),(0,V.jsx)(J,{tokens:r.resultTokens}),(0,V.jsx)(io,{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 Gs=(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:Fs(e.toolName)}),(0,V.jsx)(`span`,{className:`font-bold ${e.isError?`text-red-400`:`text-terminal-orange`}`,children:Za(e.toolName)}),(0,V.jsx)(`span`,{className:`truncate flex-1`,children:qs(e.toolName,e.input)}),e.subAgent&&(0,V.jsx)(zs,{type:e.subAgent.agentType}),e.isError&&(0,V.jsx)(ro,{}),(0,V.jsx)(J,{tokens:e.resultTokens}),(0,V.jsx)(io,{ms:e.durationMs})]});if(e.bashOutput)return(0,V.jsx)(ao,{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)(js,{toolName:e.toolName,filePath:e.diff.filePath,oldContent:e.diff.oldContent,newContent:e.diff.newContent,isActive:t,isError:e.isError,durationMs:e.durationMs,resultTokens:e.resultTokens});if(e.toolName===`Agent`&&e.subAgent){let t=e.subAgent,n=Ls(t.agentType),a=Rs[n],o=Ns(t),s=Ps(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)(Bs,{theme:n}),(0,V.jsx)(zs,{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:[rt(o),` tok`]}),s>0&&(0,V.jsx)(io,{ms:s}),(0,V.jsx)(`span`,{className:`text-xs text-terminal-dim transition-transform ${r?`rotate-90`:``}`,children:Ms})]}),c&&(0,V.jsx)(`div`,{className:`text-sm text-terminal-text font-sans font-medium leading-snug`,children:c})]}),r&&(0,V.jsx)(Vs,{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:Fs(e.toolName)}),(0,V.jsx)(`span`,{className:`text-xs font-mono font-bold ${e.isError?`text-red-400`:`text-terminal-orange`}`,children:Za(e.toolName)}),(0,V.jsx)(`span`,{className:`text-xs text-terminal-dim font-mono truncate flex-1`,children:qs(e.toolName,e.input)}),e.isError&&(0,V.jsx)(ro,{}),(0,V.jsx)(J,{tokens:e.resultTokens}),(0,V.jsx)(io,{ms:e.durationMs}),(0,V.jsx)(`span`,{className:`text-xs text-terminal-dim transition-transform ${r?`rotate-90`:``}`,children:Ms})]}),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))})})]})]})})}),Ks=200;function qs(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>Ks?`${e.slice(0,Ks)}…`: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 Js(t)}}function Js(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 Ys={lines:8,chars:900},Xs={lines:4,chars:280};function Zs(){return typeof window<`u`&&window.innerWidth<768?Xs:Ys}var Qs=(0,_.memo)(function({content:e,images:t,isActive:n}){let[r,i]=(0,_.useState)(!1),[a]=(0,_.useState)(Zs);(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(`
99
- `),[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(`
100
- `);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:`
101
- ...`})]}),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 $s(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 ec({scenes:e,visibleCount:t,currentIndex:n,effectivePrefs:r,focusIndex:i,annotatedScenes:a,annotationCounts:o,onComment:s,onSeek:c,state:l,overlayActions:u,turnStats:d,isLive:f,liveSessionState:p,liveCursorDiagnostics:m,liveCursorRowsChanged:h,liveCursorProbeAt:g}){let v=(0,_.useRef)(null),[y,b]=(0,_.useState)(null),x=(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]),S=(0,_.useMemo)(()=>r.promptsOnly?x.filter(e=>e.type===`user`||e.type===`compaction`):x,[x,r.promptsOnly]),C=(0,_.useMemo)(()=>{for(let e=S.length-1;e>=0;e--)if(S[e].scenes.some(e=>e.index<=n))return e;return S.length-1},[S,n]),w=(0,_.useMemo)(()=>{let e=new Map;for(let t=1;t<S.length;t++){let n=S[t];if(n.type!==`user`)continue;let r;for(let e=t-1;e>=0;e--){let t=S[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},[S]),T=u?.getEffectiveContent,E=(0,_.useMemo)(()=>{let e=[],t=null;for(let n=0;n<S.length;n++){let r=S[n],i=r.scenes[0]?.index??n;if(r.type===`user`){t={key:`turn-${i}`,groups:[{group:r,gi:n}]},e.push(t);continue}t?t.groups.push({group:r,gi:n}):e.push({key:`prelude-${i}`,groups:[{group:r,gi:n}]})}return e},[S]),D=(0,_.useMemo)(()=>S.filter(e=>e.type===`user`).flatMap(e=>{let t=e.scenes[0];return!t||t.scene.type!==`user-prompt`?[]:[{index:t.index,turnNumber:e.turnNumber,content:T?.(t.index)??t.scene.content}]}),[S,T]);return(0,_.useEffect)(()=>{let e=v.current,t=e?.closest(`[data-replay-scroll-container]`);if(!(e instanceof HTMLElement)||!(t instanceof HTMLElement))return;let n=0,r=null,i=()=>{n=0;let i=t.getBoundingClientRect().top,a=null;for(let t of D){let n=e.querySelector(`[data-sticky-prompt-index="${t.index}"]`);if(n instanceof HTMLElement)if(n.getBoundingClientRect().bottom<=i+2)a=t;else break}let o=a?.index??null;o!==r&&(r=o,b(a))},a=()=>{n||=requestAnimationFrame(i)};return i(),t.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a),()=>{n&&cancelAnimationFrame(n),t.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a)}},[D]),(0,V.jsxs)(`div`,{ref:v,className:`max-w-4xl mx-auto pb-6`,children:[(0,V.jsx)(tc,{prompt:y}),(0,V.jsxs)(`div`,{className:`space-y-5`,children:[E.map(e=>(0,V.jsx)(`div`,{className:`space-y-5`,children:e.groups.map(({group:e,gi:t})=>{let c=(0,V.jsxs)(V.Fragment,{children:[w.has(t)&&(0,V.jsx)(ic,{gapMs:w.get(t)}),(0,V.jsx)(oc,{group:e,currentIndex:n,effectivePrefs:r,focusIndex:i,annotatedScenes:a,annotationCounts:o,onComment:s,overlayActions:u,turnStats:d})]}),l=e.scenes[0]?.index;return(0,V.jsx)(ac,{forceRender:t>=C-15&&t<=C+5,stickyPromptIndex:e.type===`user`?l:void 0,children:c},t)})},e.key)),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&&!f&&(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`})]})]})]}),t>=e.length&&f&&(0,V.jsx)(nc,{cursorDiagnostics:m,cursorRowsChanged:h,cursorProbeAt:g,sessionState:p})]})]})}function tc({prompt:e}){return e?(0,V.jsx)(`div`,{className:`sticky top-0 z-30 h-0`,children:(0,V.jsxs)(`div`,{className:`turn-sticky-summary pointer-events-none -translate-y-3 mx-auto flex max-w-4xl items-center gap-3 rounded-full border border-terminal-green/25 px-4 py-1.5 font-mono text-xs leading-5 text-terminal-green shadow-layer-md`,title:e.content,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.content}),e.turnNumber!==void 0&&(0,V.jsxs)(`span`,{className:`shrink-0 text-[10px] font-bold text-terminal-dimmer`,children:[`#`,String(e.turnNumber).padStart(2,`0`)]})]})}):null}function nc({cursorDiagnostics:e,cursorRowsChanged:t,cursorProbeAt:n,sessionState:r}){let i=r??`busy`;if(i===`unknown`&&e){let r=rc(e.latestBubbleUpdatedAt||e.latestBubbleCreatedAt||e.composerLastUpdatedAt),i=n?rc(new Date(n).toISOString()):``,a=e.latestToolName?`${Za(e.latestToolName)} ${e.latestToolHasResult?`result persisted`:`waiting for result`}`:e.latestTextPreview?`assistant text persisted`:`session rows persisted`,o=t===!1?`db event, rows unchanged`:`rows updated`;return(0,V.jsxs)(`div`,{className:`pt-10 pb-24 flex flex-col items-center justify-center select-none`,children:[(0,V.jsx)(`div`,{className:`h-px w-8 bg-terminal-border-subtle mb-5`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 px-3 py-1.5 rounded-full bg-terminal-blue-subtle/40 border border-terminal-blue/20`,children:[(0,V.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-blue`}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono font-bold text-terminal-blue uppercase tracking-[0.25em]`,children:`Cursor Live`})]}),(0,V.jsxs)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-3 tracking-wide`,children:[a,r?` · durable ${r}`:``]}),(0,V.jsxs)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-1 tracking-wide`,children:[e.bubbleCount,` bubbles`,e.toolCallCount>0?` · ${e.toolResultCount}/${e.toolCallCount} tool results`:``,` · `,o,i?` · probed ${i}`:``]})]})}return i===`stopped`?(0,V.jsxs)(`div`,{className:`pt-10 pb-24 flex flex-col items-center justify-center select-none`,children:[(0,V.jsx)(`div`,{className:`h-px w-8 bg-terminal-border-subtle mb-5`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 px-3 py-1.5 rounded-full bg-terminal-surface/40 border border-terminal-border-subtle`,children:[(0,V.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-dimmer`}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono font-bold text-terminal-dim uppercase tracking-[0.25em]`,children:`Ended`})]}),(0,V.jsx)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-3 tracking-wide`,children:`the claude process exited — no further updates will arrive`})]}):i===`idle`?(0,V.jsxs)(`div`,{className:`pt-10 pb-24 flex flex-col items-center justify-center select-none`,children:[(0,V.jsx)(`div`,{className:`h-px w-8 bg-terminal-border-subtle mb-5`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 px-3 py-1.5 rounded-full bg-terminal-green-subtle/40 border border-terminal-green/20`,children:[(0,V.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-green`}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono font-bold text-terminal-green uppercase tracking-[0.25em]`,children:`Idle`})]}),(0,V.jsx)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-3 tracking-wide`,children:`claude is waiting for your next prompt`})]}):(0,V.jsxs)(`div`,{className:`pt-10 pb-24 flex flex-col items-center justify-center select-none`,children:[(0,V.jsx)(`div`,{className:`h-px w-8 bg-terminal-border-subtle mb-5`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 px-3 py-1.5 rounded-full bg-terminal-red-subtle/50 border border-terminal-red/20`,children:[(0,V.jsxs)(`span`,{className:`relative flex w-2 h-2`,children:[(0,V.jsx)(`span`,{className:`absolute inline-flex h-full w-full rounded-full bg-terminal-red opacity-75 animate-ping`}),(0,V.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-red`})]}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono font-bold text-terminal-red uppercase tracking-[0.25em]`,children:`Busy`})]}),(0,V.jsx)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-3 tracking-wide`,children:`waiting for the next turn to land on disk`})]})}function rc(e){if(!e)return``;let t=Date.now()-Date.parse(e);return!Number.isFinite(t)||t<0?``:t<6e4?`${Math.max(1,Math.round(t/1e3))}s ago`:t<36e5?`${Math.round(t/6e4)}m ago`:t<864e5?`${Math.round(t/36e5)}h ago`:`${Math.round(t/864e5)}d ago`}function ic({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 ac=(0,_.memo)(function({children:e,forceRender:t,stickyPromptIndex:n}){let r=(0,_.useRef)(null),[i,a]=(0,_.useState)(!1),o=(0,_.useRef)(0);(0,_.useEffect)(()=>{let e=r.current;if(!e)return;let t=new IntersectionObserver(([t])=>{a(t.isIntersecting),t.isIntersecting&&e.offsetHeight>0&&(o.current=e.offsetHeight)},{rootMargin:`800px 0px`});return t.observe(e),()=>t.disconnect()},[]);let s=i||t;return(0,_.useEffect)(()=>{s&&r.current&&r.current.offsetHeight>0&&(o.current=r.current.offsetHeight)}),(0,V.jsx)(`div`,{ref:r,"data-sticky-prompt-index":n,style:!s&&o.current>0?{minHeight:o.current}:void 0,children:s?e:null})}),oc=(0,_.memo)(function({group:e,currentIndex:t,effectivePrefs:n,focusIndex:r,annotatedScenes:i,annotationCounts:a,onComment:o,overlayActions:s,turnStats:c}){let[l,u]=(0,_.useState)(!1),d=(0,_.useMemo)(()=>{if(!c?.length)return 2e5;let e=Math.max(...c.map(e=>e.contextTokens||0)),t=0;for(let e=0;e<c.length-1;e++){let n=c[e]?.contextTokens||0,r=c[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},[c]),f=e.scenes,p=f.some(({index:e})=>e===t),m=typeof r==`number`&&f.some(({index:e})=>e===r),h=f[0]?.index;if(f.length===0)return null;let g=e.type===`user`&&a?.get(h)||0,v=e.type===`user`&&o&&(g>0||l)?(0,V.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),o(h)},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 ${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})]}):null;if(e.type===`user`)return(0,V.jsxs)(`div`,{id:`scene-${h}`,"data-scene-index":h,className:`group relative rounded-2xl px-5 py-4 transition-all duration-200 ease-material ml-4 md:ml-12 border ${m?`scene-nav-focused bg-terminal-green-emphasis border-terminal-green shadow-layer-lg`:p?`bg-terminal-green-subtle border-terminal-green/30 shadow-layer-sm`:`bg-terminal-surface border-terminal-border-subtle shadow-sm`}`,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:[v,(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:$s(e.timestamp)}),(0,V.jsx)(`div`,{className:`flex-1`}),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 text-terminal-bg`,children:`Jump Target`}):p&&(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&&c&&(()=>{let t=c[e.turnNumber-1];if(!t?.contextTokens)return null;let n=Math.min(t.contextTokens/d*100,100),r=t.contextTokens/d,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:f.map(({scene:e,index:r})=>{let i=s?.getOverlays(r)??[],a=s?.getEffectiveContent(r),o=s?.showOriginal.has(r);return(0,V.jsxs)(`div`,{className:`scene-enter`,children:[(0,V.jsx)(dc,{scene:e,isActive:r===t,collapseTools:n.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:()=>s?.toggleOriginal(r),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:()=>s?.revertSceneOverlays(r),className:`text-[10px] font-mono text-terminal-dim hover:text-terminal-red transition-colors`,children:`Revert`})]})]},r)})})]});if(e.type===`compaction`){let n=f[0]?.scene;if(!n||n.type!==`compaction-summary`)return null;let r=(()=>{if(!c||c.length<2||e.turnNumber===void 0)return;let t=e.turnNumber-1,n=Math.max(0,t-2),r=Math.min(c.length-1,t+2);for(let e=n;e<r;e++){let t=c[e]?.contextTokens||0,n=c[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-${h}`,"data-scene-index":h,className:`group relative rounded-xl px-5 py-3.5 transition-all duration-200 ease-material ${m?`scene-nav-focused bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm`:p?`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:$s(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)($a,{content:n.content,isActive:h===t})]})}if(e.type===`context-injection`){let n=f[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-${h}`,"data-scene-index":h,className:`group relative rounded-xl px-5 py-3.5 transition-all duration-200 ease-material ${m?`scene-nav-focused bg-terminal-surface border-l-2 border-blue-500/60 shadow-layer-sm`:p?`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:$s(e.timestamp)})]}),(0,V.jsx)($a,{content:n.content,isActive:h===t})]})}let y=n.hideThinking?f.filter(e=>e.scene.type!==`thinking`):f;if(y.length===0)return null;let b=n.hideThinking?e.scenes.filter(e=>e.scene.type!==`thinking`):e.scenes;return n.compactAssistant?(0,V.jsx)(sc,{allScenes:b,filteredScenes:y,firstIndex:h,currentIndex:t,groupHasCurrent:p,groupHasFocusedTarget:m,timestamp:e.timestamp,annotationCounts:a,onComment:o,overlayActions:s,turnDurationMs:e.turnNumber?c?.[e.turnNumber-1]?.durationMs:void 0}):(0,V.jsxs)(`div`,{id:`scene-${h}`,"data-scene-index":h,className:`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`:p?`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:$s(e.timestamp)}),(0,V.jsx)(`div`,{className:`flex-1`}),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-emphasis text-terminal-blue`,children:`Jump Target`}):p&&(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)(cc,{scenes:y,currentIndex:t,collapseTools:n.collapseAllTools,annotationCounts:a,onComment:o,overlayActions:s})})]})});function sc({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=Za(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:$s(o)}),(u||p.turnDurationMs)&&(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[`· `,W(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)(to,{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)(dc,{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 cc({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)(dc,{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)(lc,{batch:e,toolName:o,currentIndex:t,collapseTools:n,annotationCounts:r,onComment:i},e[0].index)})})}function lc({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`?uc(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=rt(u),p=nt(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)(dc,{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 uc(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 dc=(0,_.memo)(function({scene:e,isActive:t,collapseTools:n,effectiveContent:r}){switch(e.type){case`user-prompt`:return(0,V.jsx)(Qs,{content:r??e.content,images:e.images,isActive:t});case`compaction-summary`:return(0,V.jsx)($a,{content:e.content,isActive:t});case`context-injection`:return(0,V.jsx)($a,{content:e.content,isActive:t});case`thinking`:return(0,V.jsx)(no,{content:e.content,isActive:t,tokens:e.tokens});case`text-response`:return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(to,{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)(Gs,{scene:e,isActive:t,forceCollapse:n})}}),fc=8;function pc({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 mc({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 hc(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 gc(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 _c({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 vc({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,ee]=(0,_.useState)(null),[A,te]=(0,_.useState)(`preview`),[j,M]=(0,_.useState)(`unlisted`),[ne,N]=(0,_.useState)(!1),[P,re]=(0,_.useState)(!1),[ie,ae]=(0,_.useState)(null),[F,oe]=(0,_.useState)(null),[I,se]=(0,_.useState)(null),[ce,L]=(0,_.useState)(null),[R,le]=(0,_.useState)(null),[ue,de]=(0,_.useState)(null),[fe,pe]=(0,_.useState)(null),[me,he]=(0,_.useState)(null),[ge,_e]=(0,_.useState)(null),ve=(0,_.useRef)(null),ye=(0,_.useRef)(null),z=(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)(()=>()=>{ve.current&&=(clearInterval(ve.current),null),ye.current&&=(clearTimeout(ye.current),null),z.current&&=(clearTimeout(z.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=>{se(e.storage?.used??null),L(e.storage?.limit??null),r&&fetch(Vr(`/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};oe(e),a.visibility&&M(a.visibility),i||fetch(Vr(`/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(Vr(`/api/gist-info`)).then(e=>e.json()).then(e=>{e.gist&&S(e.gist)}).catch(()=>{}).finally(()=>w(!1))),u&&fetch(Vr(`/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){N(!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(Vr(`/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{N(!1)}}},[r,x,B]),Ae=(0,_.useCallback)(async()=>{if(r){re(!0),ae(null);try{let e=F?.id,t=await B(`/api/cloud-replays`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({replay:r,visibility:j})});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(()=>{}),oe(n),ae({type:`success`,text:e?`Updated!`:`Shared!`}),fetch(Vr(`/api/cloud-info`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...n,visibility:j})}).catch(()=>{});let i=await B(`/api/cloud-replays`).catch(()=>null);if(i){let e=await i.json().catch(()=>null);e?.storage&&(se(e.storage.used??null),L(e.storage.limit??null))}}catch(e){ae({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{re(!1)}}},[r,j,F,B]),je=(0,_.useCallback)(async()=>{if(F?.id){re(!0),ae(null);try{let e=await B(`/api/cloud-replays/${F.id}`,{method:`DELETE`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||`Delete failed`)}oe(null),ae({type:`success`,text:`Removed from cloud`}),fetch(Vr(`/api/cloud-info`),{method:`DELETE`}).catch(()=>{}),B(`/api/cloud-replays`).then(e=>e.json()).then(e=>{se(e.storage?.used??null),L(e.storage?.limit??null)}).catch(()=>{})}catch(e){ae({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{re(!1)}}},[F,B]),Me=(0,_.useCallback)(()=>{B(`/api/cloud-replays`).then(e=>e.json()).then(e=>{se(e.storage?.used??null),L(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`?he:_e;pe(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`?R:ue,s=await B(`/api/files`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:r,contentType:i,filename:a,parentReplayId:F?.id||null,visibility:j})});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`?le(l):de(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{pe(null)}},[T,R,ue,F,j,B,Me]),Pe=(0,_.useCallback)(async()=>{if(u){ee(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){ee(e instanceof Error?e.message:String(e))}finally{O(!1)}}},[u]),Fe=(0,_.useMemo)(()=>{if(!T?.markdown)return``;let e=T.markdown.replace(/\[?!\[[^\]]*\]\([^)]*\.(?:svg|gif)\)\]?(?:\([^)]*\))?\n*/g,``);return Ba(q.parse(e))},[T?.markdown]),Ie=(0,_.useMemo)(()=>T?.svgContent?Va(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 Le=`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)(pc,{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:[gc(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(ve.current&&=(clearInterval(ve.current),null),ye.current&&=(clearTimeout(ye.current),null),z.current&&=(clearTimeout(z.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{}ve.current=setInterval(async()=>{try{(await(await fetch(`/api/auth/get-session`)).json())?.session&&(ve.current&&=(clearInterval(ve.current),null),ye.current&&=(clearTimeout(ye.current),null),b(!0),window.dispatchEvent(new Event(`vibe-auth-change`)))}catch{}},2e3),ye.current=setTimeout(()=>{ve.current&&=(clearInterval(ve.current),null),ye.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,z.current&&=(clearTimeout(z.current),null),b(!0),window.dispatchEvent(new Event(`vibe-auth-change`)))};be.current=e,window.addEventListener(`message`,e),z.current=setTimeout(()=>{window.removeEventListener(`message`,e),z.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:()=>M(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 ${j===e?`bg-terminal-purple-subtle text-terminal-purple`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,children:[n,t]},e))}),I!=null&&ce!=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:[gc(I),` used`]}),(0,V.jsxs)(`span`,{children:[gc(ce),` total`]})]}),(()=>{let e=I/ce*100,t=!F&&we>0,n=t?we/ce*100:0,r=t&&I+we>ce;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:[I>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`}),gc(I),` 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`}`}),`+`,gc(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 `,gc(we),` — exceeds 10MB limit`]}),F&&(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(`${F.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/${F.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/${F.id}`}),(0,V.jsx)(mc,{text:`${xe}/r/${F.id}`})]})]}),(0,V.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,V.jsx)(`button`,{onClick:Ae,disabled:P||Ee,className:`${Le} ${Ee?`bg-terminal-surface-2 text-terminal-dimmer border border-terminal-border cursor-not-allowed`:F?`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:P?`Uploading...`:Ee?`Too large`:F?`Update`:`Share to Cloud`}),F&&(0,V.jsx)(`button`,{onClick:je,disabled:P,className:`${Le} bg-terminal-surface-hover text-terminal-red hover:bg-terminal-red-subtle border border-terminal-border`,children:`Delete`}),ie&&(0,V.jsx)(`span`,{className:`text-[11px] font-mono ${ie.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:ie.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 `,gc(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:hc(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)(mc,{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:ne||De,className:`${Le} ${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:ne?`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)(pc,{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:hc(T.gifGeneratedAt)}),(0,V.jsx)(`button`,{onClick:Pe,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)(_c,{label:`File`,path:`${T.gifPath} (${gc(T.gifContent?.length??0,!0)})`}),R?(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:R.url}),(0,V.jsx)(mc,{text:R.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:`![Session](./session-preview.gif)`})]}),y&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`button`,{onClick:()=>Ne(`gif`),disabled:fe===`gif`,className:`text-[11px] font-mono px-3 py-1.5 rounded-lg transition-colors bg-terminal-purple-subtle text-terminal-purple hover:bg-[rgba(168,85,247,0.25)] border border-[rgba(168,85,247,0.2)]`,children:fe===`gif`?`Uploading...`:R?`Update link`:`Share to Cloud`}),me&&fe===null&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono ${me.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:me.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`,` `,fc,` 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:hc(T.svgGeneratedAt)}),(0,V.jsx)(`button`,{onClick:Pe,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:Ie}}),(0,V.jsxs)(`div`,{className:`px-5 py-3 space-y-2 border-t border-terminal-border-subtle`,children:[(0,V.jsx)(_c,{label:`File`,path:`${T.svgPath} (${gc(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})]}),ue?(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:ue.url}),(0,V.jsx)(mc,{text:ue.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:`![Session](./session-preview.svg)`})]}),y&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`button`,{onClick:()=>Ne(`svg`),disabled:fe===`svg`,className:`text-[11px] font-mono px-3 py-1.5 rounded-lg transition-colors bg-terminal-purple-subtle text-terminal-purple hover:bg-[rgba(168,85,247,0.25)] border border-[rgba(168,85,247,0.2)]`,children:fe===`svg`?`Uploading...`:ue?`Update link`:`Share to Cloud`}),ge&&fe===null&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono ${ge.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:ge.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:hc(T.mdGeneratedAt)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(mc,{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:()=>te(`preview`),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${A===`preview`?`bg-terminal-orange-subtle text-terminal-orange`:`text-terminal-dim hover:text-terminal-text`}`,children:`Preview`}),(0,V.jsx)(`button`,{onClick:()=>te(`source`),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${A===`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:A===`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:Fe}}):(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)(_c,{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:Pe,disabled:D||f,className:`${Le} ${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:`${Le} 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:`${Le} 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:`${Le} bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis border border-terminal-blue/20`,children:`Download JSON`})]})})]})]})]})})})}var yc=[{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 bc({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:yc.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 xc=ge;function Sc({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=W(r.stats.durationMs),c=Oe(r.project),l=r.title||c,u=xc(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 Cc({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:W(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 wc(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 Tc(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 Ec={"user-prompt":`User`,"compaction-summary":`Compaction`,"context-injection":`Injection`,thinking:`Thinking`,"text-response":`Response`,"tool-call":`Tool`},Dc={"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 Oc({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=wc(a);if(o.toLowerCase().includes(t)&&n.push({sceneIndex:r,type:a.type,snippet:Tc(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 ${Dc[e.type]||`text-terminal-dim`}`,children:e.toolName||Ec[e.type]||e.type}),(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-text line-clamp-2 break-words`,children:kc(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 kc(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 Ac(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 jc(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 Mc(e,t){let n=jc(e,t);if(n)return n.length>1?`${n[0]} → ${n[n.length-1]}`:n[0]}function Nc(e,t){return jc(e,t)?.join(` → `)}function Pc(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 Fc({session:e}){let{meta:t,scenes:n}=e,r=(0,_.useMemo)(()=>Ye(t),[t]),i=(0,_.useMemo)(()=>Xe(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(`
95
+ `,e[0].empty=!0)},$s=(e,t)=>{let n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},ec=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=$s(l,u.type),u.alias&&(l=$s(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(Zs),f=d.length;s.push({types:l,content:d[0]});for(let e=1;e<f;e++)Qs(s),c.push(s=[]),s.push({types:l,content:d[e]})}o--,t.pop(),n.pop(),r.pop(),i.pop()}return Qs(s),c},tc=({prism:e,code:t,grammar:n,language:r})=>(0,_.useMemo)(()=>{if(n==null)return ec([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),ec(i.tokens)},[t,n,r,e]),nc=(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]=xs(xs({},e[t]),i)}),e},{});return r.root=n,r.plain=Ss(xs({},n),{backgroundColor:void 0}),r},rc=({children:e,language:t,code:n,theme:r,prism:i})=>{let a=t.toLowerCase(),o=nc(r,a),s=Ys(o),c=Xs(o),l=i.languages[a];return e({tokens:tc({prism:i,language:a,code:n,grammar:l}),className:`prism-code language-${a}`,style:o==null?{}:o.root,getLineProps:s,getTokenProps:c})},ic=e=>(0,_.createElement)(rc,Ss(xs({},e),{prism:e.prism||X,theme:e.theme||Vs,code:e.code,language:e.language})),ac=e=>{let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},oc=()=>document.documentElement.classList.contains(`dark`);function sc(e,t){if(!e&&t)return t.split(`
96
+ `).map(e=>({type:`add`,content:e}));let n=es(e,t),r=[];for(let e of n){let t=e.value.replace(/\n$/,``).split(`
97
+ `),n=e.added?`add`:e.removed?`remove`:`context`;for(let e of t)r.push({type:n,content:e})}return r}function cc(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 lc=(0,_.memo)(function({toolName:e,filePath:t,oldContent:n,newContent:r,isActive:i,isError:a,durationMs:o,resultTokens:s}){let c=(0,_.useMemo)(()=>sc(n,r),[n,r]),l=cc(t),u=(0,_.useSyncExternalStore)(ac,oc);return(0,U.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,U.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 bg-terminal-surface ${a?`bg-red-500/5`:``}`,children:[(0,U.jsx)(`span`,{className:`text-xs font-mono font-bold ${a?`text-red-400`:`text-terminal-orange`}`,children:e}),(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-blue truncate flex-1`,children:t}),a&&(0,U.jsx)(Po,{}),(0,U.jsx)(Io,{tokens:s}),(0,U.jsx)(Fo,{ms:o}),!n&&(0,U.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,U.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded bg-terminal-red/20 text-terminal-red`,children:`deleted`})]}),(0,U.jsx)(`div`,{className:`overflow-x-auto max-h-[400px] overflow-y-auto`,children:(0,U.jsx)(ic,{theme:u?Ds.nightOwl:Ds.nightOwlLight,code:c.map(e=>e.content).join(`
98
+ `),language:l,children:({tokens:e,getLineProps:t,getTokenProps:n})=>(0,U.jsx)(`pre`,{className:`text-xs font-mono !bg-transparent !m-0 p-0`,children:e.map((e,r)=>{let i=c[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`:``,o=i.type===`add`?`+`:i.type===`remove`?`-`:` `,s=i.type===`add`?`text-terminal-green`:i.type===`remove`?`text-terminal-red`:`text-terminal-dim`;return(0,U.jsxs)(`div`,{...t({line:e}),className:`flex ${a} px-3 leading-5`,children:[(0,U.jsx)(`span`,{className:`select-none w-4 shrink-0 ${s}`,children:o}),(0,U.jsx)(`span`,{children:e.map((e,t)=>(0,U.jsx)(`span`,{...n({token:e})},t))})]},r)})})})})]})}),uc=`▶`;function dc(e){return e.tokenUsage?e.tokenUsage.inputTokens+e.tokenUsage.outputTokens+e.tokenUsage.cacheCreationTokens+e.tokenUsage.cacheReadTokens:0}function fc(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 pc(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 mc={Explore:`blue`,Plan:`purple`,Shell:`blue`,"general-purpose":`green`,"claude-code-guide":`orange`};function hc(e){return mc[e]||`purple`}var gc={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 _c({type:e}){let t=gc[hc(e)];return(0,U.jsx)(`span`,{className:`ui-pill-compact px-2 ${t.pill}`,children:e})}function vc({theme:e}){return(0,U.jsx)(`span`,{className:`ui-section-title ${gc[e].text}`,children:`Subagent`})}function yc({subAgent:e}){return(0,U.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[e.prompt&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`ui-section-title mb-1.5`,children:`Prompt`}),(0,U.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,U.jsx)(xc,{scenes:e.scenes})]})}var bc=20;function xc({scenes:e}){let[t,n]=(0,_.useState)(!1),r=e.length>bc,i=r&&!t?e.slice(0,bc):e,a=e.length-i.length;return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5`,children:[(0,U.jsxs)(`span`,{className:`ui-section-title`,children:[`Trace · `,e.length,` `,e.length===1?`scene`:`scenes`]}),r&&(0,U.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,U.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,U.jsx)(Sc,{scene:e},t))})]})}function Sc({scene:e}){let[t,n]=(0,_.useState)(!1);if(e.type===`thinking`){let t=ct(e.tokens);return(0,U.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,U.jsx)(`span`,{className:`text-purple-400/70 font-bold mr-1`,children:`[thinking]`}),t&&(0,U.jsxs)(`span`,{className:`text-purple-400/70 mr-1`,title:`Approximate thinking tokens`,children:[`~`,t,` tok`]}),(0,U.jsxs)(`span`,{className:`text-purple-400/70`,children:[(e.content||``).slice(0,120),(e.content||``).length>120?`...`:``]})]})}if(e.type===`text-response`)return(0,U.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,U.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,U.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,U.jsx)(`span`,{className:`font-bold ${r.isError?`text-red-400`:`text-terminal-orange`}`,children:Oo(r.toolName)}),(0,U.jsx)(`span`,{className:`text-terminal-dim truncate flex-1`,children:Tc(r.toolName,r.input)}),r.isError&&(0,U.jsx)(Po,{}),(0,U.jsx)(Io,{tokens:r.resultTokens}),(0,U.jsx)(Fo,{ms:r.durationMs})]}),t&&r.result&&(0,U.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 Cc=(0,_.memo)(function({scene:e,isActive:t,forceCollapse:n}){let[r,i]=(0,_.useState)(!1);if(n)return(0,U.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,U.jsx)(`span`,{children:pc(e.toolName)}),(0,U.jsx)(`span`,{className:`font-bold ${e.isError?`text-red-400`:`text-terminal-orange`}`,children:Oo(e.toolName)}),(0,U.jsx)(`span`,{className:`truncate flex-1`,children:Tc(e.toolName,e.input)}),e.subAgent&&(0,U.jsx)(_c,{type:e.subAgent.agentType}),e.isError&&(0,U.jsx)(Po,{}),(0,U.jsx)(Io,{tokens:e.resultTokens}),(0,U.jsx)(Fo,{ms:e.durationMs})]});if(e.bashOutput)return(0,U.jsx)(Lo,{command:e.bashOutput.command,stdout:e.bashOutput.stdout,isActive:t,durationMs:e.durationMs,resultTokens:e.resultTokens,isError:e.isError});if(e.diff)return(0,U.jsx)(lc,{toolName:e.toolName,filePath:e.diff.filePath,oldContent:e.diff.oldContent,newContent:e.diff.newContent,isActive:t,isError:e.isError,durationMs:e.durationMs,resultTokens:e.resultTokens});if(e.toolName===`Agent`&&e.subAgent){let t=e.subAgent,n=hc(t.agentType),a=gc[n],o=dc(t),s=fc(t),c=t.description||e.input.description||``;return(0,U.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,U.jsxs)(`button`,{onClick:()=>i(!r),className:`w-full text-left`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap mb-1.5`,children:[(0,U.jsx)(vc,{theme:n}),(0,U.jsx)(_c,{type:t.agentType}),t.model&&(0,U.jsx)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono`,children:t.model}),(0,U.jsx)(`span`,{className:`flex-1`}),(0,U.jsxs)(`span`,{className:`text-[10px] text-terminal-dim font-mono`,children:[t.toolCalls,` tools`]}),t.thinkingBlocks>0&&(0,U.jsxs)(`span`,{className:`text-[10px] text-terminal-dim font-mono`,children:[t.thinkingBlocks,` thinking`]}),o>0&&(0,U.jsxs)(`span`,{className:`text-[10px] font-mono font-semibold ${a.text}`,title:`Total tokens billed for this subagent (input + output + cache)`,children:[ct(o),` tok`]}),s>0&&(0,U.jsx)(Fo,{ms:s}),(0,U.jsx)(`span`,{className:`text-xs text-terminal-dim transition-transform ${r?`rotate-90`:``}`,children:uc})]}),c&&(0,U.jsx)(`div`,{className:`text-sm text-terminal-text font-sans font-medium leading-snug`,children:c})]}),r&&(0,U.jsx)(yc,{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,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl overflow-hidden shadow-layer-sm ${a}`,children:[(0,U.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,U.jsx)(`span`,{className:`text-xs font-mono`,children:pc(e.toolName)}),(0,U.jsx)(`span`,{className:`text-xs font-mono font-bold ${e.isError?`text-red-400`:`text-terminal-orange`}`,children:Oo(e.toolName)}),(0,U.jsx)(`span`,{className:`text-xs text-terminal-dim font-mono truncate flex-1`,children:Tc(e.toolName,e.input)}),e.isError&&(0,U.jsx)(Po,{}),(0,U.jsx)(Io,{tokens:e.resultTokens}),(0,U.jsx)(Fo,{ms:e.durationMs}),(0,U.jsx)(`span`,{className:`text-xs text-terminal-dim transition-transform ${r?`rotate-90`:``}`,children:uc})]}),r&&(0,U.jsxs)(`div`,{className:`border-t border-terminal-border-subtle`,children:[(0,U.jsxs)(`div`,{className:`px-3 py-2`,children:[(0,U.jsx)(`div`,{className:`text-xs text-terminal-dim font-mono mb-1`,children:`Input:`}),(0,U.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,U.jsxs)(`div`,{className:`px-3 py-2 border-t border-terminal-border-subtle`,children:[(0,U.jsx)(`div`,{className:`text-xs text-terminal-dim font-mono mb-1`,children:`Result:`}),(0,U.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,U.jsx)(`div`,{className:`px-3 py-2 border-t border-terminal-border-subtle`,children:(0,U.jsx)(`div`,{className:`flex gap-2 flex-wrap`,children:e.images.map((e,t)=>(0,U.jsx)(`img`,{src:e,alt:`Screenshot ${t+1}`,className:`max-w-[400px] max-h-[300px] rounded-md object-contain`},t))})})]})]})})}),wc=200;function Tc(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>wc?`${e.slice(0,wc)}…`: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 Ec(t)}}function Ec(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 Dc={lines:8,chars:900},Oc={lines:4,chars:280};function kc(){return typeof window<`u`&&window.innerWidth<768?Oc:Dc}var Ac=(0,_.memo)(function({content:e,images:t,isActive:n,highlights:r=[],onHighlightClick:i}){let[a,o]=(0,_.useState)(!1),[s]=(0,_.useState)(kc);(0,_.useEffect)(()=>{let e=e=>{if(!n)return;let t=e.detail;t.action===`expand`?o(!0):t.action===`collapse`&&o(!1)};return window.addEventListener(`vibe:toggle-expand`,e),()=>window.removeEventListener(`vibe:toggle-expand`,e)},[n]);let c=(0,_.useMemo)(()=>e.split(`
99
+ `),[e]),l=c.length>s.lines||e.length>s.chars,u=(0,_.useMemo)(()=>{if(!l||a)return e;let t=c.slice(0,s.lines).join(`
100
+ `);return t.length>s.chars?t.slice(0,s.chars):t},[e,a,l,c,s]);return(0,_.useEffect)(()=>{l&&!a&&xo(e,r)&&!xo(u,r)&&o(!0)},[e,a,r,l,u]),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`text-terminal-green font-mono text-sm whitespace-pre-wrap break-words ${n?`typing-cursor`:``}`,children:[Co(u,r,i),l&&!a&&(0,U.jsx)(`span`,{className:`text-terminal-dim`,children:`
101
+ ...`})]}),l&&(0,U.jsxs)(`button`,{onClick:()=>o(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,U.jsx)(`span`,{className:`text-secondary-text font-bold opacity-70`,children:a?`[←]`:`[→]`}),(0,U.jsx)(`span`,{children:a?`Show less`:`Show more (${c.length} lines)`})]}),t&&t.length>0&&(0,U.jsx)(`div`,{className:`flex gap-2 mt-2 flex-wrap`,children:t.map((e,t)=>(0,U.jsx)(`img`,{src:e,alt:`Attachment ${t+1}`,className:`max-w-[300px] max-h-[200px] rounded-md object-contain`},t))})]})});function jc(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 Mc({scenes:e,visibleCount:t,currentIndex:n,effectivePrefs:r,focusIndex:i,annotatedScenes:a,annotationCounts:o,annotations:s,onComment:c,onAnnotationClick:l,onSeek:u,state:d,overlayActions:f,turnStats:p,isLive:m,liveSessionState:h,liveCursorDiagnostics:g,liveCursorRowsChanged:v,liveCursorProbeAt:y}){let b=(0,_.useRef)(null),[x,S]=(0,_.useState)(null),C=(0,_.useMemo)(()=>yo(s??[]),[s]),w=(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]),T=(0,_.useMemo)(()=>r.promptsOnly?w.filter(e=>e.type===`user`||e.type===`compaction`):w,[w,r.promptsOnly]),E=(0,_.useMemo)(()=>{for(let e=T.length-1;e>=0;e--)if(T[e].scenes.some(e=>e.index<=n))return e;return T.length-1},[T,n]),D=(0,_.useMemo)(()=>{let e=new Map;for(let t=1;t<T.length;t++){let n=T[t];if(n.type!==`user`)continue;let r;for(let e=t-1;e>=0;e--){let t=T[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},[T]),O=f?.getEffectiveContent,k=(0,_.useMemo)(()=>{let e=[],t=null;for(let n=0;n<T.length;n++){let r=T[n],i=r.scenes[0]?.index??n;if(r.type===`user`){t={key:`turn-${i}`,groups:[{group:r,gi:n}]},e.push(t);continue}t?t.groups.push({group:r,gi:n}):e.push({key:`prelude-${i}`,groups:[{group:r,gi:n}]})}return e},[T]),A=(0,_.useMemo)(()=>T.filter(e=>e.type===`user`).flatMap(e=>{let t=e.scenes[0];return!t||t.scene.type!==`user-prompt`?[]:[{index:t.index,turnNumber:e.turnNumber,content:O?.(t.index)??t.scene.content}]}),[T,O]);return(0,_.useEffect)(()=>{let e=b.current,t=e?.closest(`[data-replay-scroll-container]`);if(!(e instanceof HTMLElement)||!(t instanceof HTMLElement))return;let n=0,r=null,i=()=>{n=0;let i=t.getBoundingClientRect().top,a=null;for(let t of A){let n=e.querySelector(`[data-sticky-prompt-index="${t.index}"]`);if(n instanceof HTMLElement)if(n.getBoundingClientRect().bottom<=i+2)a=t;else break}let o=a?.index??null;o!==r&&(r=o,S(a))},a=()=>{n||=requestAnimationFrame(i)};return i(),t.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a),()=>{n&&cancelAnimationFrame(n),t.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a)}},[A]),(0,U.jsxs)(`div`,{ref:b,className:`max-w-4xl mx-auto pb-6`,children:[(0,U.jsx)(Nc,{prompt:x}),(0,U.jsxs)(`div`,{className:`space-y-5`,children:[k.map(e=>(0,U.jsx)(`div`,{className:`space-y-5`,children:e.groups.map(({group:e,gi:t})=>{let s=(0,U.jsxs)(U.Fragment,{children:[D.has(t)&&(0,U.jsx)(Ic,{gapMs:D.get(t)}),(0,U.jsx)(Rc,{group:e,currentIndex:n,effectivePrefs:r,focusIndex:i,annotatedScenes:a,annotationCounts:o,highlightsByScene:C,onComment:c,onAnnotationClick:l,overlayActions:f,turnStats:p})]}),u=e.scenes[0]?.index;return(0,U.jsx)(Lc,{forceRender:t>=E-15&&t<=E+5,stickyPromptIndex:e.type===`user`?u:void 0,children:s},t)})},e.key)),d===`paused`&&t<e.length&&(0,U.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,U.jsxs)(`div`,{className:`group/pause relative flex items-center gap-8 px-4 py-2 bg-transparent backdrop-blur-sm`,children:[(0,U.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,U.jsxs)(`div`,{className:`flex items-center gap-2.5 pr-8 border-r border-terminal-border/20`,children:[(0,U.jsxs)(`div`,{className:`relative flex h-2 w-2`,children:[(0,U.jsx)(`div`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-orange opacity-40`}),(0,U.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,U.jsx)(`span`,{className:`ui-section-title text-terminal-orange drop-shadow-sm`,children:`Paused`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-8`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.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,U.jsx)(`span`,{className:`text-[11px] font-mono font-bold`,children:`↓`})}),(0,U.jsx)(`span`,{className:`ui-caption text-terminal-dim opacity-80`,children:`Explore`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.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,U.jsx)(`span`,{className:`text-[9px] font-mono font-black tracking-tight`,children:`SPACE`})}),(0,U.jsx)(`span`,{className:`ui-caption text-terminal-dim opacity-80`,children:`Resume`})]})]})]})}),t>=e.length&&!m&&(0,U.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,U.jsx)(`div`,{className:`h-px w-8 bg-terminal-border-subtle mb-6`}),(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,U.jsx)(`div`,{className:`text-[10px] font-mono font-bold text-terminal-dimmer uppercase tracking-[0.3em]`,children:`the end`}),(0,U.jsx)(`div`,{className:`text-[9px] font-mono text-terminal-border uppercase tracking-widest mt-1`,children:`session replay complete`})]}),(0,U.jsxs)(`div`,{className:`mt-8 flex flex-col items-center gap-6`,children:[(0,U.jsxs)(`button`,{onClick:()=>u?.(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,U.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,U.jsx)(`path`,{d:`m18 15-6-6-6 6`})}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono font-bold uppercase tracking-widest transition-colors`,children:`Back to Top`}),(0,U.jsxs)(`span`,{className:`text-[9px] font-mono font-bold opacity-0 group-hover:opacity-60 transition-opacity`,children:[` `,`[Home]`]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3 opacity-20`,children:[(0,U.jsx)(`div`,{className:`w-1 h-1 rounded-full bg-terminal-green`}),(0,U.jsx)(`div`,{className:`w-1 h-1 rounded-full bg-terminal-blue`}),(0,U.jsx)(`div`,{className:`w-1 h-1 rounded-full bg-terminal-orange`})]})]})]}),t>=e.length&&m&&(0,U.jsx)(Pc,{cursorDiagnostics:g,cursorRowsChanged:v,cursorProbeAt:y,sessionState:h})]})]})}function Nc({prompt:e}){return e?(0,U.jsx)(`div`,{className:`sticky top-0 z-30 h-0`,children:(0,U.jsxs)(`div`,{className:`turn-sticky-summary pointer-events-none -translate-y-3 mx-auto flex max-w-4xl items-center gap-3 rounded-full border border-terminal-green/25 px-4 py-1.5 font-mono text-xs leading-5 text-terminal-green shadow-layer-md`,title:e.content,children:[(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.content}),e.turnNumber!==void 0&&(0,U.jsxs)(`span`,{className:`shrink-0 text-[10px] font-bold text-terminal-dimmer`,children:[`#`,String(e.turnNumber).padStart(2,`0`)]})]})}):null}function Pc({cursorDiagnostics:e,cursorRowsChanged:t,cursorProbeAt:n,sessionState:r}){let i=r??`busy`;if(i===`unknown`&&e){let r=Fc(e.latestBubbleUpdatedAt||e.latestBubbleCreatedAt||e.composerLastUpdatedAt),i=n?Fc(new Date(n).toISOString()):``,a=e.latestToolName?`${Oo(e.latestToolName)} ${e.latestToolHasResult?`result persisted`:`waiting for result`}`:e.latestTextPreview?`assistant text persisted`:`session rows persisted`,o=t===!1?`db event, rows unchanged`:`rows updated`;return(0,U.jsxs)(`div`,{className:`pt-10 pb-24 flex flex-col items-center justify-center select-none`,children:[(0,U.jsx)(`div`,{className:`h-px w-8 bg-terminal-border-subtle mb-5`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 px-3 py-1.5 rounded-full bg-terminal-blue-subtle/40 border border-terminal-blue/20`,children:[(0,U.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-blue`}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono font-bold text-terminal-blue uppercase tracking-[0.25em]`,children:`Cursor Live`})]}),(0,U.jsxs)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-3 tracking-wide`,children:[a,r?` · durable ${r}`:``]}),(0,U.jsxs)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-1 tracking-wide`,children:[e.bubbleCount,` bubbles`,e.toolCallCount>0?` · ${e.toolResultCount}/${e.toolCallCount} tool results`:``,` · `,o,i?` · probed ${i}`:``]})]})}return i===`stopped`?(0,U.jsxs)(`div`,{className:`pt-10 pb-24 flex flex-col items-center justify-center select-none`,children:[(0,U.jsx)(`div`,{className:`h-px w-8 bg-terminal-border-subtle mb-5`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 px-3 py-1.5 rounded-full bg-terminal-surface/40 border border-terminal-border-subtle`,children:[(0,U.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-dimmer`}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono font-bold text-terminal-dim uppercase tracking-[0.25em]`,children:`Ended`})]}),(0,U.jsx)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-3 tracking-wide`,children:`the claude process exited — no further updates will arrive`})]}):i===`idle`?(0,U.jsxs)(`div`,{className:`pt-10 pb-24 flex flex-col items-center justify-center select-none`,children:[(0,U.jsx)(`div`,{className:`h-px w-8 bg-terminal-border-subtle mb-5`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 px-3 py-1.5 rounded-full bg-terminal-green-subtle/40 border border-terminal-green/20`,children:[(0,U.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-green`}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono font-bold text-terminal-green uppercase tracking-[0.25em]`,children:`Idle`})]}),(0,U.jsx)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-3 tracking-wide`,children:`claude is waiting for your next prompt`})]}):(0,U.jsxs)(`div`,{className:`pt-10 pb-24 flex flex-col items-center justify-center select-none`,children:[(0,U.jsx)(`div`,{className:`h-px w-8 bg-terminal-border-subtle mb-5`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 px-3 py-1.5 rounded-full bg-terminal-red-subtle/50 border border-terminal-red/20`,children:[(0,U.jsxs)(`span`,{className:`relative flex w-2 h-2`,children:[(0,U.jsx)(`span`,{className:`absolute inline-flex h-full w-full rounded-full bg-terminal-red opacity-75 animate-ping`}),(0,U.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-red`})]}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono font-bold text-terminal-red uppercase tracking-[0.25em]`,children:`Busy`})]}),(0,U.jsx)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-3 tracking-wide`,children:`waiting for the next turn to land on disk`})]})}function Fc(e){if(!e)return``;let t=Date.now()-Date.parse(e);return!Number.isFinite(t)||t<0?``:t<6e4?`${Math.max(1,Math.round(t/1e3))}s ago`:t<36e5?`${Math.round(t/6e4)}m ago`:t<864e5?`${Math.round(t/36e5)}h ago`:`${Math.round(t/864e5)}d ago`}function Ic({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,U.jsxs)(`div`,{className:`flex items-center gap-3 py-1 px-4`,children:[(0,U.jsx)(`div`,{className:`flex-1 h-px bg-terminal-border-subtle`}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer whitespace-nowrap`,children:t}),(0,U.jsx)(`div`,{className:`flex-1 h-px bg-terminal-border-subtle`})]})}var Lc=(0,_.memo)(function({children:e,forceRender:t,stickyPromptIndex:n}){let r=(0,_.useRef)(null),[i,a]=(0,_.useState)(!1),o=(0,_.useRef)(0);(0,_.useEffect)(()=>{let e=r.current;if(!e)return;let t=new IntersectionObserver(([t])=>{a(t.isIntersecting),t.isIntersecting&&e.offsetHeight>0&&(o.current=e.offsetHeight)},{rootMargin:`800px 0px`});return t.observe(e),()=>t.disconnect()},[]);let s=i||t;return(0,_.useEffect)(()=>{s&&r.current&&r.current.offsetHeight>0&&(o.current=r.current.offsetHeight)}),(0,U.jsx)(`div`,{ref:r,"data-sticky-prompt-index":n,style:!s&&o.current>0?{minHeight:o.current}:void 0,children:s?e:null})}),Rc=(0,_.memo)(function({group:e,currentIndex:t,effectivePrefs:n,focusIndex:r,annotatedScenes:i,annotationCounts:a,highlightsByScene:o,onComment:s,onAnnotationClick:c,overlayActions:l,turnStats:u}){let[d,f]=(0,_.useState)(!1),p=(0,_.useMemo)(()=>{if(!u?.length)return 2e5;let e=Math.max(...u.map(e=>e.contextTokens||0)),t=0;for(let e=0;e<u.length-1;e++){let n=u[e]?.contextTokens||0,r=u[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},[u]),m=e.scenes,h=m.some(({index:e})=>e===t),g=typeof r==`number`&&m.some(({index:e})=>e===r),v=m[0]?.index;if(m.length===0)return null;let y=e.type===`user`&&a?.get(v)||0,b=e.type===`user`&&s&&(y>0||d)?(0,U.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),s(v)},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 ${y>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:y>0?`${y} comment${y>1?`s`:``}`:`Add comment`,children:[`💬`,y>0&&(0,U.jsx)(`span`,{children:y})]}):null;if(e.type===`user`)return(0,U.jsxs)(`div`,{id:`scene-${v}`,"data-scene-index":v,className:`group relative rounded-2xl px-5 py-4 transition-all duration-200 ease-material ml-4 md:ml-12 border ${g?`scene-nav-focused bg-terminal-green-emphasis border-terminal-green shadow-layer-lg`:h?`bg-terminal-green-subtle border-terminal-green/30 shadow-layer-sm`:`bg-terminal-surface border-terminal-border-subtle shadow-sm`}`,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:[b,(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-2.5`,children:[(0,U.jsx)(`span`,{className:`ui-section-title text-terminal-green`,children:`You`}),e.timestamp&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:jc(e.timestamp)}),(0,U.jsx)(`div`,{className:`flex-1`}),g?(0,U.jsx)(`span`,{className:`ui-pill-compact bg-terminal-green text-terminal-bg`,children:`Jump Target`}):h&&(0,U.jsx)(`span`,{className:`ui-pill-compact bg-terminal-green-subtle text-terminal-green border border-terminal-green/20`,children:`Focused`}),e.turnNumber!==void 0&&(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer font-bold`,children:[`#`,String(e.turnNumber).padStart(2,`0`)]})]}),e.turnNumber!==void 0&&u&&(()=>{let t=u[e.turnNumber-1];if(!t?.contextTokens)return null;let n=Math.min(t.contextTokens/p*100,100),r=t.contextTokens/p,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,U.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,U.jsx)(`div`,{className:`flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full rounded-full ${i} transition-all duration-300`,style:{width:`${n}%`}})}),(0,U.jsxs)(`span`,{className:`text-[9px] font-mono tabular-nums ${a}`,children:[G(t.contextTokens),(0,U.jsx)(`span`,{className:`text-terminal-dimmer ml-1`,children:`context window`})]})]})})(),(0,U.jsx)(`div`,{className:`text-left`,children:m.map(({scene:e,index:r})=>{let i=l?.getOverlays(r)??[],a=l?.getEffectiveContent(r),s=l?.showOriginal.has(r);return(0,U.jsxs)(`div`,{className:`scene-enter`,children:[(0,U.jsx)(Uc,{scene:e,isActive:r===t,collapseTools:n.collapseAllTools,effectiveContent:a??void 0,highlights:o?.get(r)??[],onHighlightClick:c}),i.length>0&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5`,children:[i.map(e=>(0,U.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,U.jsx)(`button`,{onClick:()=>l?.toggleOriginal(r),className:`text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors`,children:s?`Show modified`:`Show original`}),(0,U.jsx)(`button`,{onClick:()=>l?.revertSceneOverlays(r),className:`text-[10px] font-mono text-terminal-dim hover:text-terminal-red transition-colors`,children:`Revert`})]})]},r)})})]});if(e.type===`compaction`){let n=m[0]?.scene;if(!n||n.type!==`compaction-summary`)return null;let r=(()=>{if(!u||u.length<2||e.turnNumber===void 0)return;let t=e.turnNumber-1,n=Math.max(0,t-2),r=Math.min(u.length-1,t+2);for(let e=n;e<r;e++){let t=u[e]?.contextTokens||0,n=u[e+1]?.contextTokens||0;if(t>0&&n>0&&n<t*.5)return{before:t,after:n,freed:t-n}}})();return(0,U.jsxs)(`div`,{id:`scene-${v}`,"data-scene-index":v,className:`group relative rounded-xl px-5 py-3.5 transition-all duration-200 ease-material ${g?`scene-nav-focused bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm`:h?`bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm`:`bg-terminal-surface/50`}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,U.jsx)(`span`,{className:`ui-section-title`,children:`Context Compaction`}),e.timestamp&&(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:jc(e.timestamp)}),r&&(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-green`,children:[G(r.before),` → `,G(r.after),(0,U.jsxs)(`span`,{className:`text-terminal-green/70 ml-1`,children:[`(-`,G(r.freed),` freed)`]})]})]}),(0,U.jsx)(Ao,{content:n.content,isActive:v===t,highlights:o?.get(v)??[],onHighlightClick:c})]})}if(e.type===`context-injection`){let n=m[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,U.jsxs)(`div`,{id:`scene-${v}`,"data-scene-index":v,className:`group relative rounded-xl px-5 py-3.5 transition-all duration-200 ease-material ${g?`scene-nav-focused bg-terminal-surface border-l-2 border-blue-500/60 shadow-layer-sm`:h?`bg-terminal-surface border-l-2 border-blue-500/40 shadow-layer-sm`:`bg-terminal-surface/50`}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,U.jsx)(`span`,{className:`ui-section-title text-blue-400/80`,children:i}),e.timestamp&&(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:jc(e.timestamp)})]}),(0,U.jsx)(Ao,{content:n.content,isActive:v===t,highlights:o?.get(v)??[],onHighlightClick:c})]})}let x=n.hideThinking?m.filter(e=>e.scene.type!==`thinking`):m;if(x.length===0)return null;let S=n.hideThinking?e.scenes.filter(e=>e.scene.type!==`thinking`):e.scenes;return n.compactAssistant?(0,U.jsx)(zc,{allScenes:S,filteredScenes:x,firstIndex:v,currentIndex:t,groupHasCurrent:h,groupHasFocusedTarget:g,timestamp:e.timestamp,annotationCounts:a,highlightsByScene:o,onComment:s,onAnnotationClick:c,overlayActions:l,turnDurationMs:e.turnNumber?u?.[e.turnNumber-1]?.durationMs:void 0}):(0,U.jsxs)(`div`,{id:`scene-${v}`,"data-scene-index":v,className:`relative rounded-xl px-5 py-4 transition-all duration-200 ease-material ${g?`scene-nav-focused bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-lg`:h?`bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-sm`:`bg-terminal-surface shadow-layer-sm`}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,U.jsx)(`span`,{className:`ui-section-title text-terminal-blue`,children:`Assistant`}),e.timestamp&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:jc(e.timestamp)}),(0,U.jsx)(`div`,{className:`flex-1`}),g?(0,U.jsx)(`span`,{className:`ui-pill-compact bg-terminal-blue-emphasis text-terminal-blue`,children:`Jump Target`}):h&&(0,U.jsx)(`span`,{className:`ui-pill-compact bg-terminal-blue-subtle text-terminal-blue`,children:`Focused`}),e.turnNumber!==void 0&&(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer font-bold`,children:[`#`,String(e.turnNumber).padStart(2,`0`)]})]}),(0,U.jsx)(`div`,{className:`space-y-2`,children:(0,U.jsx)(Bc,{scenes:x,currentIndex:t,collapseTools:n.collapseAllTools,annotationCounts:a,onComment:s,highlightsByScene:o,onAnnotationClick:c,overlayActions:l})})]})});function zc({allScenes:e,filteredScenes:t,firstIndex:n,currentIndex:r,groupHasCurrent:i,groupHasFocusedTarget:a,timestamp:o,annotationCounts:s,highlightsByScene:c,onComment:l,onAnnotationClick:u,overlayActions:d,turnDurationMs:f}){let[p,m]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=e=>{if(!i)return;let t=e.detail;t.action===`expand`?m(!0):t.action===`collapse`&&m(!1)};return window.addEventListener(`vibe:toggle-expand`,e),()=>window.removeEventListener(`vibe:toggle-expand`,e)},[i]);let h=(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=Oo(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]),g=(0,_.useMemo)(()=>{for(let t=e.length-1;t>=0;t--)if(e[t].scene.type===`text-response`)return e[t];return null},[e]),v=(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(h.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},[h.toolBreakdown]),y=(0,_.useMemo)(()=>s?e.reduce((e,{index:t})=>e+(s.get(t)||0),0):0,[e,s]),[b,x]=(0,_.useState)(!1);return(0,U.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:()=>x(!0),onMouseLeave:()=>x(!1),children:[l&&(y>0||b)&&!p&&(0,U.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),l(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 ${y>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:y>0?`${y} comment${y>1?`s`:``}`:`Add comment`,children:[`💬`,y>0&&(0,U.jsx)(`span`,{children:y})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,U.jsx)(`span`,{className:`ui-section-title text-terminal-blue`,children:`Assistant`}),o&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:jc(o)}),(f||h.turnDurationMs)&&(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[`· `,ot(f??h.turnDurationMs)]}),(0,U.jsx)(`div`,{className:`flex-1`}),a?(0,U.jsx)(`span`,{className:`ui-pill-compact bg-terminal-blue-emphasis text-terminal-blue`,children:`Jump Target`}):i&&(0,U.jsx)(`span`,{className:`ui-pill-compact bg-terminal-blue-subtle text-terminal-blue`,children:`Focused`})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mb-3 text-[11px] font-mono`,children:[h.responses>0&&(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue`,children:[h.responses,` response`,h.responses>1?`s`:``]}),h.totalTools>0&&(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange`,children:[h.totalTools,` tool`,h.totalTools>1?`s`:``]}),h.subAgentCalls>0&&(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-500/20 text-green-300`,children:[h.subAgentCalls,` agent`,h.subAgentCalls>1?`s`:``,h.subAgentTypes.length>0&&(0,U.jsxs)(`span`,{className:`opacity-70 text-[10px]`,children:[`(`,h.subAgentTypes.join(`, `),`)`]})]}),h.thinking>0&&(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-purple-subtle text-terminal-purple`,children:[h.thinking,` thinking`]}),v.length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-terminal-border mx-0.5`,children:`|`}),v.map(([e,t])=>(0,U.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,U.jsx)(`span`,{className:`text-terminal-orange`,children:e}),e===`Bash`&&h.bashCommands.length>0&&(0,U.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[`(`,h.bashCommands.slice(0,4).join(`, `),h.bashCommands.length>4?`, ...`:``,`)`]}),(0,U.jsx)(`span`,{children:t})]},e))]})]}),g&&!p&&(0,U.jsx)(`div`,{className:`mb-2`,children:(0,U.jsx)(Mo,{content:d?.getEffectiveContent(g.index)??g.scene.content,isActive:g.index===r})}),p&&(0,U.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`?d?.getEffectiveContent(t)??void 0:void 0;return(0,U.jsxs)(`div`,{"data-scene-index":t,className:`group/scene relative scene-enter ${l?`pr-7`:``}`,children:[(0,U.jsx)(Uc,{scene:e,isActive:t===r,collapseTools:!1,effectiveContent:i,highlights:c?.get(t)??[],onHighlightClick:u}),l&&(0,U.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),l(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,U.jsx)(`span`,{children:n})]})]},t)})}),(0,U.jsxs)(`button`,{onClick:()=>m(!p),className:`text-xs font-mono text-terminal-dim hover:text-terminal-blue transition-colors flex items-center gap-1.5`,children:[i&&(0,U.jsx)(`span`,{className:`text-secondary-text font-bold opacity-70`,children:p?`[←]`:`[→]`}),(0,U.jsx)(`span`,{children:p?`Collapse`:`Show all details`})]})]})}function Bc({scenes:e,currentIndex:t,collapseTools:n,annotationCounts:r,onComment:i,highlightsByScene:a,onAnnotationClick:o,overlayActions:s}){let c=[],l=[];for(let t of e){let e=l[l.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?l.push(t):(l.length>0&&c.push(l),l=[t])}return l.length>0&&c.push(l),(0,U.jsx)(U.Fragment,{children:c.map(e=>{if(e.length<=1){let{scene:c,index:l}=e[0],u=r?.get(l)||0,d=c.type===`text-response`?s?.getEffectiveContent(l):void 0,f=c.type===`text-response`?s?.getOverlays(l)??[]:[];return(0,U.jsxs)(`div`,{"data-scene-index":l,className:`group/scene relative scene-enter ${i?`pr-7`:``}`,children:[(0,U.jsx)(Uc,{scene:c,isActive:l===t,collapseTools:n,effectiveContent:d??void 0,highlights:a?.get(l)??[],onHighlightClick:o}),f.length>0&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-1`,children:[f.map(e=>(0,U.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,U.jsx)(`button`,{onClick:()=>s?.toggleOriginal(l),className:`text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors`,children:s?.showOriginal.has(l)?`Show modified`:`Show original`}),(0,U.jsx)(`button`,{onClick:()=>s?.revertSceneOverlays(l),className:`text-[10px] font-mono text-terminal-dim hover:text-terminal-red transition-colors`,children:`Revert`})]}),i&&(0,U.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),i(l)},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 ${u>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:u>0?`${u} comment${u>1?`s`:``}`:`Add comment`,children:[`💬`,u>0&&(0,U.jsx)(`span`,{children:u})]})]},l)}let c=e[0].scene.toolName;return(0,U.jsx)(Vc,{batch:e,toolName:c,currentIndex:t,collapseTools:n,annotationCounts:r,onComment:i},e[0].index)})})}function Vc({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`?Hc(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=ct(u),p=st(d);return(0,U.jsxs)(`div`,{"data-scene-index":e[0].index,className:`group/batch relative ${a?`pr-7`:``}`,children:[(0,U.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,U.jsx)(`span`,{className:`transition-transform text-xs ${o?`rotate-90`:``}`,children:`▶`}),(0,U.jsx)(`span`,{className:`text-terminal-orange font-semibold`,children:t}),(0,U.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[e.length,` call`,e.length>1?`s`:``]}),!o&&(0,U.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,U.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,U.jsx)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`Combined tool execution: ${p}`,children:p})]}),a&&!o&&(0,U.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,U.jsx)(`span`,{children:c})]}),o&&(0,U.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,U.jsxs)(`div`,{"data-scene-index":t,className:`group/scene relative scene-enter ${a?`pr-7`:``}`,children:[(0,U.jsx)(Uc,{scene:e,isActive:t===n,collapseTools:r}),a&&(0,U.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,U.jsx)(`span`,{children:o})]})]},t)})})]})}function Hc(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 Uc=(0,_.memo)(function({scene:e,isActive:t,collapseTools:n,effectiveContent:r,highlights:i=[],onHighlightClick:a}){switch(e.type){case`user-prompt`:return(0,U.jsx)(Ac,{content:r??e.content,images:e.images,isActive:t,highlights:i,onHighlightClick:a});case`compaction-summary`:return(0,U.jsx)(Ao,{content:e.content,isActive:t,highlights:i,onHighlightClick:a});case`context-injection`:return(0,U.jsx)(Ao,{content:e.content,isActive:t,highlights:i,onHighlightClick:a});case`thinking`:return(0,U.jsx)(No,{content:e.content,isActive:t,tokens:e.tokens,highlights:i,onHighlightClick:a});case`text-response`:return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Mo,{content:r??e.content,isActive:t,highlights:i,onHighlightClick:a}),e.isTruncated&&(0,U.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,U.jsx)(Cc,{scene:e,isActive:t,forceCollapse:n})}}),Wc=1200;function Gc(e,t=Wc){let n=e.trim();return n.length<=t?n:`${n.slice(0,t).trimEnd()}\n...`}function Kc(e,t=`markdown`){let n=Math.max(0,...[...e.matchAll(/`+/g)].map(e=>e[0].length)),r="`".repeat(Math.max(3,n+1));return`${r}${t}\n${e}\n${r}`}function qc(e){switch(e.type){case`user-prompt`:return`User prompt`;case`compaction-summary`:return`Context compaction`;case`context-injection`:return e.injectionType?`Context injection (${e.injectionType})`:`Context injection`;case`thinking`:return`Agent thinking`;case`text-response`:return`Assistant response`;case`tool-call`:return`Tool call: ${Oo(e.toolName)}`}}function Jc(e){switch(e.type){case`user-prompt`:case`compaction-summary`:case`context-injection`:case`thinking`:case`text-response`:return{text:Gc(e.content),language:`markdown`};case`tool-call`:{let t=[`Tool: ${Oo(e.toolName)}`];e.diff?.filePath&&t.push(`File: ${e.diff.filePath}`),e.bashOutput?.command&&t.push(`Command: ${e.bashOutput.command}`),e.isError&&t.push(`Result: error`);let n=JSON.stringify(e.input,null,2);return n&&n!==`{}`&&t.push(`Input:\n${n}`),e.result&&t.push(`Output:\n${Gc(e.result,800)}`),{text:Gc(t.join(`
102
+
103
+ `)),language:`text`}}}}function Yc(e,t){let n=[...t].sort((e,t)=>e.sceneIndex===t.sceneIndex?Date.parse(e.createdAt)-Date.parse(t.createdAt):e.sceneIndex-t.sceneIndex),r=e.meta.title||e.meta.slug||`Untitled replay`,i=`# Replay Feedback
104
+
105
+ `;return i+=`Session: **${r}**\n`,i+=`Provider: \`${e.meta.provider}\`\n`,e.meta.project&&(i+=`Project: \`${e.meta.project}\`\n`),e.meta.model&&(i+=`Model: \`${e.meta.model}\`\n`),i+=`
106
+ `,n.length===0?(i+=`No feedback annotations were added to this replay.
107
+ `,i):(i+=`I reviewed this AI coding session and have ${n.length} feedback item${n.length===1?``:`s`}. Please address the comments below, using the cited scene context to understand what happened in the session.\n\n`,n.forEach((t,n)=>{let r=e.scenes[t.sceneIndex];if(i+=`## ${n+1}. Scene ${t.sceneIndex+1}`,r&&(i+=` - ${qc(r)}`),i+=`
108
+
109
+ `,r?.timestamp&&(i+=`Timestamp: \`${r.timestamp}\`\n\n`),t.selectedText&&(i+=`Selected text:\n\n${Kc(t.selectedText)}\n\n`),i+=`Feedback:\n\n> ${t.body.replace(/\n/g,`
110
+ > `)}\n\n`,r){let e=Jc(r);i+=`Scene context:\n\n${Kc(e.text,e.language)}\n\n`}}),`${i.trimEnd()}\n`)}var Xc=8;function Zc({title:e,color:t}){return(0,U.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,U.jsx)(`span`,{className:`ui-section-title ${t}`,children:e}),(0,U.jsx)(`div`,{className:`flex-1 h-px bg-terminal-border-subtle`})]})}function Qc({text:e,label:t}){let[n,r]=(0,_.useState)(!1);return(0,U.jsx)(`button`,{onClick:async()=>{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)},className:`ui-pill-compact text-terminal-dim hover:text-terminal-text transition-colors rounded bg-terminal-surface hover:bg-terminal-surface-hover border border-terminal-border-subtle`,title:`Copy to clipboard`,children:n?`Copied!`:t||`Copy`})}function $c(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 el(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 tl({label:e,path:t}){return(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-mono text-terminal-dim`,children:[(0,U.jsx)(`span`,{className:`text-terminal-dimmer w-8 shrink-0`,children:e}),(0,U.jsx)(`span`,{className:`text-terminal-text truncate`,children:t})]})}function nl({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,annotations:p}=e,m=t===`editor`,[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(null),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)(!1),[E,D]=(0,_.useState)(null),[O,k]=(0,_.useState)(!1),[A,j]=(0,_.useState)(null),[M,N]=(0,_.useState)(`preview`),[ee,P]=(0,_.useState)(`unlisted`),[F,I]=(0,_.useState)(!1),[L,te]=(0,_.useState)(!1),[ne,R]=(0,_.useState)(null),[z,B]=(0,_.useState)(null),[re,ie]=(0,_.useState)(null),[ae,oe]=(0,_.useState)(null),[se,V]=(0,_.useState)(null),[ce,le]=(0,_.useState)(null),[ue,de]=(0,_.useState)(null),[fe,pe]=(0,_.useState)(null),[me,he]=(0,_.useState)(null),ge=(0,_.useRef)(null),_e=(0,_.useRef)(null),ve=(0,_.useRef)(null),ye=(0,_.useRef)(null),be=`https://vibe-replay.com`,xe=m?``:be,H=(0,_.useMemo)(()=>{if(m)return``;try{return new URL(be).origin}catch{return``}},[m,be]),Se=(0,_.useCallback)((e,t={})=>{let n=`${xe}${e}`;return fetch(n,{...t,...m?{}:{credentials:`include`}})},[xe,m]);(0,_.useEffect)(()=>()=>{ge.current&&=(clearInterval(ge.current),null),_e.current&&=(clearTimeout(_e.current),null),ve.current&&=(clearTimeout(ve.current),null),ye.current&&=(window.removeEventListener(`message`,ye.current),null)},[]);let Ce=(0,_.useMemo)(()=>r?new TextEncoder().encode(JSON.stringify(r)).byteLength:0,[r]),we=10*1024*1024,Te=Ce>10485760,Ee=Ce>we,De=(0,_.useMemo)(()=>r?Yc(r,p):``,[p,r]),Oe=(0,_.useCallback)(()=>{m&&Se(`/api/auth/get-session`).then(e=>e.json()).then(e=>{let t=!!e?.session;x(t),t&&Se(`/api/cloud-replays`).then(e=>e.json()).then(e=>{ie(e.storage?.used??null),oe(e.storage?.limit??null),r&&fetch(li(`/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:`${be}/r/${a.id}`,expiresAt:a.expiresAt||``,visibility:a.visibility};B(e),a.visibility&&P(a.visibility),i||fetch(li(`/api/cloud-info`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}).catch(()=>{})}}).catch(()=>{})}).catch(()=>{})}).catch(()=>x(!1))},[m,Se]);(0,_.useEffect)(()=>{m&&(c&&(Oe(),T(!0),fetch(li(`/api/gist-info`)).then(e=>e.json()).then(e=>{e.gist&&C(e.gist)}).catch(()=>{}).finally(()=>T(!1))),u&&fetch(li(`/api/export/github/status`)).then(e=>e.json()).then(e=>{e.exists&&D({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(()=>{}))},[m,c,u,Se,Oe]),(0,_.useEffect)(()=>{if(!m)return;let e=()=>Oe();return window.addEventListener(`vibe-auth-change`,e),()=>window.removeEventListener(`vibe-auth-change`,e)},[m,Oe]);let ke=(0,_.useCallback)(async()=>{if(r){I(!0),y(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 Se(S?`/api/gists/${S.gistId}`:`/api/gists`,{method:S?`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 x(!1),Error(e);if(S&&(i.status===404||e.includes(`not found`))){C(null),fetch(li(`/api/gist-info`),{method:`DELETE`}).catch(()=>{}),y({type:`error`,text:`Gist was deleted on GitHub. Click again to create a new one.`});return}throw Error(e)}let a=await i.json();C({gistId:a.gistId,gistUrl:a.gistUrl,viewerUrl:a.viewerUrl,updatedAt:new Date().toISOString()}),y({type:`success`,text:`Published!`})}catch(e){y({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{I(!1)}}},[r,S,Se]),Ae=(0,_.useCallback)(async()=>{if(r){te(!0),R(null);try{let e=z?.id,t=await Se(`/api/cloud-replays`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({replay:r,visibility:ee})});if(!t.ok){let e=await t.json().catch(()=>({}));throw t.status===401&&x(!1),Error(e.error||`Upload failed`)}let n=await t.json();e&&e!==n.id&&await Se(`/api/cloud-replays/${e}`,{method:`DELETE`}).catch(()=>{}),B(n),R({type:`success`,text:e?`Updated!`:`Shared!`}),fetch(li(`/api/cloud-info`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...n,visibility:ee})}).catch(()=>{});let i=await Se(`/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){R({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{te(!1)}}},[r,ee,z,Se]),je=(0,_.useCallback)(async()=>{if(z?.id){te(!0),R(null);try{let e=await Se(`/api/cloud-replays/${z.id}`,{method:`DELETE`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||`Delete failed`)}B(null),R({type:`success`,text:`Removed from cloud`}),fetch(li(`/api/cloud-info`),{method:`DELETE`}).catch(()=>{}),Se(`/api/cloud-replays`).then(e=>e.json()).then(e=>{ie(e.storage?.used??null),oe(e.storage?.limit??null)}).catch(()=>{})}catch(e){R({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{te(!1)}}},[z,Se]),Me=(0,_.useCallback)(()=>{Se(`/api/cloud-replays`).then(e=>e.json()).then(e=>{ie(e.storage?.used??null),oe(e.storage?.limit??null)}).catch(()=>{})},[Se]),Ne=(0,_.useCallback)(async e=>{let t=e===`gif`?E?.gifContent:E?.svgContent;if(!t)return;let n=e===`gif`?pe:he;de(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:ce,s=await Se(`/api/files`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:r,contentType:i,filename:a,parentReplayId:z?.id||null,visibility:ee})});if(!s.ok){let e=await s.json().catch(()=>({}));throw s.status===401&&x(!1),Error(e.error||`Upload failed`)}let c=await s.json();o&&await Se(`/api/files/${o.id}`,{method:`DELETE`}).catch(()=>{});let l={id:c.id,url:c.url};e===`gif`?V(l):le(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{de(null)}},[E,se,ce,z,ee,Se,Me]),Pe=(0,_.useCallback)(async()=>{if(u){j(null),k(!0);try{let e=await u();await navigator.clipboard.writeText(e.markdown),D({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){j(e instanceof Error?e.message:String(e))}finally{k(!1)}}},[u]),Fe=(0,_.useMemo)(()=>{if(!E?.markdown)return``;let e=E.markdown.replace(/\[?!\[[^\]]*\]\([^)]*\.(?:svg|gif)\)\]?(?:\([^)]*\))?\n*/g,``);return so(Y.parse(e))},[E?.markdown]),Ie=(0,_.useMemo)(()=>E?.svgContent?co(E.svgContent):``,[E?.svgContent]);if(n)return(0,U.jsx)(`div`,{className:`p-6 text-center ui-caption`,children:`Export is not available in read-only mode`});let Le=`px-4 py-2 text-xs font-sans font-semibold rounded-lg transition-colors text-center disabled:opacity-50 shrink-0`;return(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,U.jsx)(`div`,{className:`p-6 max-w-3xl mx-auto`,children:(0,U.jsxs)(`div`,{children:[r&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 mb-5`,children:[(0,U.jsx)(`h2`,{className:`text-sm font-mono font-semibold text-terminal-text truncate`,children:r.meta.title||r.meta.slug}),r.meta.provider&&(0,U.jsx)(`span`,{className:`ui-pill-compact shrink-0 text-terminal-dimmer bg-terminal-surface border border-terminal-border-subtle`,children:r.meta.provider})]}),i&&(0,U.jsx)(`div`,{className:`ui-caption 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`}),r&&(0,U.jsxs)(`div`,{id:`feedback`,className:`mb-12`,children:[(0,U.jsx)(Zc,{title:`Agent Feedback`,color:`text-terminal-blue`}),(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`px-5 py-4 flex items-start justify-between gap-4 border-b border-terminal-border-subtle`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-sm font-mono font-semibold text-terminal-text`,children:`Executable feedback`}),(0,U.jsx)(`p`,{className:`text-xs font-sans text-terminal-dim mt-1 leading-relaxed`,children:`Copy comments and selected text as structured markdown for an agent or PR reviewer.`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,U.jsxs)(`span`,{className:`ui-pill-compact bg-terminal-blue-subtle text-terminal-blue`,children:[p.length,` `,p.length===1?`item`:`items`]}),(0,U.jsx)(Qc,{text:De,label:`Copy feedback`})]})]}),(0,U.jsx)(`div`,{className:`p-5`,children:p.length===0?(0,U.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim rounded-lg border border-dashed border-terminal-border-subtle bg-terminal-bg px-4 py-5 text-center`,children:`Add comments in the replay view, or select text in a scene and annotate it.`}):(0,U.jsx)(`pre`,{className:`max-h-80 overflow-auto rounded-lg bg-terminal-bg border border-terminal-border-subtle p-4 text-xs font-mono text-terminal-text whitespace-pre-wrap break-words`,children:De})})]})]}),m&&(0,U.jsxs)(`div`,{id:`share`,className:`mb-12`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,U.jsx)(Zc,{title:`Share`,color:`text-terminal-purple`}),Ce>0&&(0,U.jsxs)(`span`,{className:`text-[11px] font-mono px-2 py-0.5 rounded-md ${Ce>we?`bg-terminal-red-subtle text-terminal-red`:`bg-terminal-surface-2 text-terminal-dimmer`}`,children:[el(Ce),` replay`]})]}),b===!1?(0,U.jsx)(`div`,{className:`bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden`,children:(0,U.jsxs)(`div`,{className:`p-6`,children:[(0,U.jsx)(`h3`,{className:`text-lg font-sans font-semibold text-terminal-text mb-5`,children:`Share your session — free`}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 mb-6`,children:[(0,U.jsxs)(`div`,{className:`rounded-xl bg-terminal-bg border border-terminal-border-subtle p-5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,U.jsx)(`span`,{className:`text-xs font-sans font-bold text-terminal-purple`,children:`Cloud Share`}),(0,U.jsx)(`span`,{className:`ui-pill-compact font-semibold px-2 bg-terminal-purple-subtle text-terminal-purple`,children:`Private`})]}),(0,U.jsxs)(`ul`,{className:`space-y-2.5 text-sm font-sans text-terminal-dim`,children:[(0,U.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`20 MB free storage`]}),(0,U.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`7-day shareable link`]})]})]}),(0,U.jsxs)(`div`,{className:`rounded-xl bg-terminal-bg border border-terminal-border-subtle p-5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,U.jsx)(`span`,{className:`text-xs font-sans font-bold text-terminal-dim`,children:`GitHub Gist`}),(0,U.jsx)(`span`,{className:`ui-pill-compact font-semibold px-2 bg-terminal-surface-2 text-terminal-dimmer`,children:`Public`})]}),(0,U.jsxs)(`ul`,{className:`space-y-2.5 text-sm font-sans text-terminal-dim`,children:[(0,U.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`No storage limit`]}),(0,U.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`Permanent — never expires`]}),(0,U.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`Great for portfolios`]})]})]})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:async()=>{if(ge.current&&=(clearInterval(ge.current),null),_e.current&&=(clearTimeout(_e.current),null),ve.current&&=(clearTimeout(ve.current),null),ye.current&&=(window.removeEventListener(`message`,ye.current),null),m){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{}ge.current=setInterval(async()=>{try{(await(await fetch(`/api/auth/get-session`)).json())?.session&&(ge.current&&=(clearInterval(ge.current),null),_e.current&&=(clearTimeout(_e.current),null),x(!0),window.dispatchEvent(new Event(`vibe-auth-change`)))}catch{}},2e3),_e.current=setTimeout(()=>{ge.current&&=(clearInterval(ge.current),null),_e.current=null},300*1e3);return}window.open(`${be}/auth/login?callback=/auth/success`,`_blank`);let e=t=>{t.origin===H&&t.data?.type===`vibe-replay-auth`&&t.data.user&&(window.removeEventListener(`message`,e),ye.current=null,ve.current&&=(clearTimeout(ve.current),null),x(!0),window.dispatchEvent(new Event(`vibe-auth-change`)))};ye.current=e,window.addEventListener(`message`,e),ve.current=setTimeout(()=>{window.removeEventListener(`message`,e),ve.current=null,ye.current===e&&(ye.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,U.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`transition-transform group-hover:scale-110`,children:(0,U.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`]})]})}):b===!0?(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden p-5 flex flex-col`,children:[(0,U.jsx)(`div`,{className:`flex items-center gap-2 mb-3`,children:(0,U.jsx)(`span`,{className:`text-sm font-mono font-semibold text-terminal-purple`,children:`Cloud Share`})}),(0,U.jsx)(`div`,{className:`flex items-center h-7 rounded-md overflow-hidden bg-terminal-bg mb-3`,children:[{value:`private`,label:`Private`,icon:(0,U.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`}),(0,U.jsx)(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`})]})},{value:`unlisted`,label:`Link only`,icon:(0,U.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.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,U.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,U.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,U.jsx)(`line`,{x1:`2`,y1:`12`,x2:`22`,y2:`12`}),(0,U.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,U.jsxs)(`button`,{onClick:()=>P(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 ${ee===e?`bg-terminal-purple-subtle text-terminal-purple`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,children:[n,t]},e))}),re!=null&&ae!=null&&(0,U.jsxs)(`div`,{className:`mb-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] font-mono text-terminal-dimmer mb-1.5`,children:[(0,U.jsxs)(`span`,{children:[el(re),` used`]}),(0,U.jsxs)(`span`,{children:[el(ae),` total`]})]}),(()=>{let e=re/ae*100,t=!z&&Ce>0,n=t?Ce/ae*100:0,r=t&&re+Ce>ae;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`h-2 rounded-full bg-terminal-surface-hover overflow-hidden`,children:(0,U.jsxs)(`div`,{className:`h-full flex`,children:[re>0&&(0,U.jsx)(`div`,{className:`h-full bg-terminal-purple transition-all`,style:{width:`${Math.max(e,1)}%`}}),t&&(0,U.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,U.jsxs)(`div`,{className:`flex items-center gap-3 mt-1.5 text-[10px] font-mono text-terminal-dimmer`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-sm bg-terminal-purple`}),el(re),` used`]}),(0,U.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-sm ${r?`bg-terminal-orange`:`bg-terminal-green`}`}),`+`,el(Ce),` this upload`]})]})]})})()]}),(0,U.jsxs)(`p`,{className:`text-[10px] font-mono text-terminal-dimmer flex items-center gap-1.5 mb-1`,children:[(0,U.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,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,U.jsx)(`polyline`,{points:`12 6 12 12 16 14`})]}),`Free tier links expire after 7 days`]}),Te&&(0,U.jsxs)(`p`,{className:`text-[11px] font-mono text-terminal-orange mt-1.5 flex items-center gap-1`,children:[(0,U.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,U.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 `,el(Ce),` — exceeds 10MB limit`]}),z&&(0,U.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.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,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green`}),`Shared`]}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[`expires `,new Date(`${z.expiresAt}Z`).toLocaleDateString()]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle`,children:[(0,U.jsx)(`a`,{href:`${be}/r/${z.id}`,target:`_blank`,rel:`noopener noreferrer`,className:`flex-1 text-xs font-mono text-terminal-purple hover:text-terminal-text transition-colors truncate`,children:`${be}/r/${z.id}`}),(0,U.jsx)(Qc,{text:`${be}/r/${z.id}`})]})]}),(0,U.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,U.jsx)(`button`,{onClick:Ae,disabled:L||Te,className:`${Le} ${Te?`bg-terminal-surface-2 text-terminal-dimmer border border-terminal-border cursor-not-allowed`:z?`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:L?`Uploading...`:Te?`Too large`:z?`Update`:`Share to Cloud`}),z&&(0,U.jsx)(`button`,{onClick:je,disabled:L,className:`${Le} bg-terminal-surface-hover text-terminal-red hover:bg-terminal-red-subtle border border-terminal-border`,children:`Delete`}),ne&&(0,U.jsx)(`span`,{className:`text-[11px] font-mono ${ne.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:ne.text})]})]}),m&&(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden p-5 flex flex-col`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,U.jsx)(`span`,{className:`text-sm font-mono font-semibold text-terminal-dim`,children:`GitHub Gist`}),(0,U.jsx)(`span`,{className:`ui-pill-compact font-semibold px-2 bg-terminal-surface-2 text-terminal-dimmer`,children:`Public`})]}),(0,U.jsxs)(`ul`,{className:`space-y-1.5 text-xs font-sans text-terminal-dim mb-auto`,children:[(0,U.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`Hosted on GitHub forever`]}),(0,U.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`Doesn't use your storage`]}),(0,U.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-terminal-orange shrink-0`,children:`!`}),`Visible to everyone on the internet`]})]}),Ee&&(0,U.jsxs)(`p`,{className:`text-[11px] font-mono text-terminal-red mt-1.5 flex items-center gap-1`,children:[(0,U.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,U.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 `,el(Ce),` — exceeds 10MB limit`]}),S&&(0,U.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.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,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green`}),`Published`]}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:$c(S.updatedAt)})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle`,children:[(0,U.jsx)(`a`,{href:S.viewerUrl,target:`_blank`,rel:`noopener noreferrer`,className:`flex-1 text-xs font-mono text-terminal-blue hover:text-terminal-text transition-colors truncate`,children:S.viewerUrl}),(0,U.jsx)(Qc,{text:S.viewerUrl})]})]}),w&&!S&&(0,U.jsx)(`div`,{className:`mt-4 text-[11px] font-mono text-terminal-dimmer animate-pulse`,children:`Checking...`}),(0,U.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,U.jsx)(`button`,{onClick:ke,disabled:F||Ee,className:`${Le} ${Ee?`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:F?`Publishing...`:Ee?`Too large`:S?`Update Gist`:`Publish to Gist`}),v&&(0,U.jsx)(`span`,{className:`text-[11px] font-mono ${v.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:v.text}),S&&(0,U.jsx)(`a`,{href:S.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,U.jsx)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer animate-pulse p-2`,children:`Checking login status...`})]}),(0,U.jsxs)(`div`,{id:`export`,children:[(0,U.jsx)(Zc,{title:`Export`,color:`text-terminal-green`}),(0,U.jsxs)(`div`,{className:`space-y-4`,children:[m&&u&&(0,U.jsxs)(U.Fragment,{children:[E?.gifContent&&(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-green`,children:`Animated GIF`}),(0,U.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,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[E.gifGeneratedAt&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:$c(E.gifGeneratedAt)}),(0,U.jsx)(`button`,{onClick:Pe,disabled:O||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:O||f?(0,U.jsx)(`span`,{className:`animate-pulse`,children:`...`}):(0,U.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,U.jsx)(`path`,{d:`M21 3v5h-5`}),(0,U.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,U.jsx)(`path`,{d:`M8 16H3v5`})]})})]})]}),(0,U.jsx)(`div`,{className:`bg-terminal-bg p-2 flex justify-center border-y border-terminal-border-subtle`,children:(0,U.jsx)(`img`,{src:`data:image/gif;base64,${E.gifContent}`,alt:`Session preview GIF`,className:`w-full h-auto block`})}),(0,U.jsxs)(`div`,{className:`px-5 py-3 space-y-2 border-t border-terminal-border-subtle`,children:[E.gifPath&&(0,U.jsx)(tl,{label:`File`,path:`${E.gifPath} (${el(E.gifContent?.length??0,!0)})`}),se?(0,U.jsxs)(`div`,{className:`flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle`,children:[(0,U.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,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green`}),`Shared`]}),(0,U.jsx)(`span`,{className:`flex-1 text-xs font-mono text-terminal-purple truncate`,children:se.url}),(0,U.jsx)(Qc,{text:se.url})]}):(0,U.jsxs)(`p`,{className:`text-[10px] font-mono text-terminal-dimmer leading-relaxed`,children:[`Usage:`,` `,(0,U.jsx)(`span`,{className:`text-terminal-text`,children:`![Session](./session-preview.gif)`})]}),b&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`button`,{onClick:()=>Ne(`gif`),disabled:ue===`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:ue===`gif`?`Uploading...`:se?`Update link`:`Share to Cloud`}),fe&&ue===null&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono ${fe.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:fe.text})]})]})]}),E?.svgContent&&(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-orange`,children:`Animated SVG`}),(0,U.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`,` `,Xc,` turns.`]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[E.svgGeneratedAt&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:$c(E.svgGeneratedAt)}),(0,U.jsx)(`button`,{onClick:Pe,disabled:O||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:O||f?(0,U.jsx)(`span`,{className:`animate-pulse`,children:`...`}):(0,U.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,U.jsx)(`path`,{d:`M21 3v5h-5`}),(0,U.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,U.jsx)(`path`,{d:`M8 16H3v5`})]})})]})]}),(0,U.jsx)(`div`,{className:`bg-terminal-bg p-2 border-y border-terminal-border-subtle [&>svg]:w-full [&>svg]:h-auto [&>svg]:block`,dangerouslySetInnerHTML:{__html:Ie}}),(0,U.jsxs)(`div`,{className:`px-5 py-3 space-y-2 border-t border-terminal-border-subtle`,children:[(0,U.jsx)(tl,{label:`File`,path:`${E.svgPath} (${el(E.svgContent?.length??0)})`}),E.replayUrl&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-mono text-terminal-dim`,children:[(0,U.jsx)(`span`,{className:`text-terminal-dimmer w-8 shrink-0`,children:`Link`}),(0,U.jsx)(`a`,{href:E.replayUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-terminal-blue hover:text-terminal-text transition-colors truncate`,children:E.replayUrl})]}),ce?(0,U.jsxs)(`div`,{className:`flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle`,children:[(0,U.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,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green`}),`Shared`]}),(0,U.jsx)(`span`,{className:`flex-1 text-xs font-mono text-terminal-purple truncate`,children:ce.url}),(0,U.jsx)(Qc,{text:ce.url})]}):(0,U.jsxs)(`p`,{className:`text-[10px] font-mono text-terminal-dimmer leading-relaxed`,children:[`Usage:`,` `,(0,U.jsx)(`span`,{className:`text-terminal-text`,children:`![Session](./session-preview.svg)`})]}),b&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`button`,{onClick:()=>Ne(`svg`),disabled:ue===`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:ue===`svg`?`Uploading...`:ce?`Update link`:`Share to Cloud`}),me&&ue===null&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono ${me.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:me.text})]})]})]}),E?.markdown&&(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-orange`,children:`Markdown Summary`}),(0,U.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-dim mt-0.5`,children:`Paste into GitHub PRs, issues, or README files.`})]}),E.mdGeneratedAt&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer self-start mt-0.5`,children:$c(E.mdGeneratedAt)})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(Qc,{text:E.markdown,label:`Copy MD`}),(0,U.jsxs)(`div`,{className:`flex items-center h-6 rounded-md overflow-hidden bg-terminal-bg border border-terminal-border-subtle`,children:[(0,U.jsx)(`button`,{onClick:()=>N(`preview`),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${M===`preview`?`bg-terminal-orange-subtle text-terminal-orange`:`text-terminal-dim hover:text-terminal-text`}`,children:`Preview`}),(0,U.jsx)(`button`,{onClick:()=>N(`source`),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${M===`source`?`bg-terminal-orange-subtle text-terminal-orange`:`text-terminal-dim hover:text-terminal-text`}`,children:`Source`})]})]})]}),(0,U.jsx)(`div`,{className:`p-4`,children:M===`preview`?(0,U.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:Fe}}):(0,U.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:E.markdown})}),(0,U.jsx)(`div`,{className:`px-5 py-3 space-y-1.5 border-t border-terminal-border-subtle`,children:(0,U.jsx)(tl,{label:`File`,path:E.mdPath})}),E.warnings&&E.warnings.length>0&&(0,U.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,U.jsx)(`div`,{className:`font-semibold mb-1`,children:`Security warnings`}),E.warnings.map((e,t)=>(0,U.jsx)(`div`,{className:`text-terminal-dim`,children:e},t))]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`button`,{onClick:Pe,disabled:O||f,className:`${Le} ${E?`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:O||f?`Generating...`:E?`Regenerate GIF + SVG + Markdown`:`Generate GIF + SVG + Markdown`}),A&&(0,U.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-red`,children:A}),!E&&(0,U.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.`})]})]}),m&&l&&(0,U.jsxs)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-green mb-1`,children:`HTML Replay`}),(0,U.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,U.jsx)(`button`,{onClick:async()=>{g(null);try{g({type:`success`,text:await l()})}catch(e){g({type:`error`,text:e instanceof Error?e.message:String(e)})}},disabled:d,className:`${Le} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis border border-terminal-green/20`,children:d?`Exporting...`:`Export HTML`})]}),h&&(0,U.jsx)(`div`,{className:`mt-3 text-[11px] font-mono ${h.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:h.type===`success`?(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green shrink-0`}),`Saved to `,h.text]}):h.text})]}),!m&&a&&(0,U.jsx)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5`,children:(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-green mb-1`,children:`Save HTML`}),(0,U.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,U.jsx)(`button`,{onClick:o,className:`${Le} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis border border-terminal-green/20`,children:`Download HTML`})]})}),(0,U.jsx)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5`,children:(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-blue mb-1`,children:`JSON Data`}),(0,U.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,U.jsx)(`button`,{onClick:s,className:`${Le} bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis border border-terminal-blue/20`,children:`Download JSON`})]})})]})]})]})})})}var rl=[{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 il({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,U.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,U.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,U.jsxs)(`div`,{className:`px-6 py-5 border-b border-terminal-border-subtle flex items-center justify-between`,children:[(0,U.jsx)(`h2`,{className:`text-sm font-sans font-bold uppercase tracking-[0.2em] text-terminal-text`,children:`Keyboard Shortcuts`}),(0,U.jsx)(`button`,{onClick:t,className:`text-terminal-dimmer hover:text-terminal-red transition-colors`,children:(0,U.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,U.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,U.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),(0,U.jsx)(`div`,{className:`px-6 py-4 grid grid-cols-1 gap-8`,children:rl.map(e=>(0,U.jsxs)(`div`,{className:`space-y-3.5`,children:[(0,U.jsx)(`h3`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-[0.15em] pl-1`,children:e.title}),(0,U.jsx)(`div`,{className:`grid grid-cols-1 gap-2.5`,children:e.items.map(e=>(0,U.jsxs)(`div`,{className:`flex items-center justify-between group`,children:[(0,U.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-dim group-hover:text-terminal-text transition-colors`,children:e.label}),(0,U.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,U.jsx)(`div`,{className:`px-6 py-4 bg-terminal-surface/30 border-t border-terminal-border-subtle`,children:(0,U.jsxs)(`p`,{className:`text-[10px] font-sans font-medium text-terminal-dimmer text-center uppercase tracking-wider`,children:[`Press `,(0,U.jsx)(`span`,{className:`text-terminal-text font-mono font-bold`,children:`?`}),` to toggle this menu anytime`]})})]})}):null}var al=he;function ol({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=ot(r.stats.durationMs),c=Oe(r.project),l=r.title||c,u=al(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,U.jsxs)(`div`,{className:`flex-1 flex flex-col items-center overflow-y-auto relative`,children:[(0,U.jsxs)(`div`,{className:`absolute inset-0 pointer-events-none`,children:[(0,U.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-b from-terminal-green-subtle via-transparent to-transparent`}),(0,U.jsx)(`div`,{className:`absolute inset-0 bg-dot-grid`})]}),(0,U.jsx)(`div`,{className:`flex-1 min-h-4 md:min-h-0`}),(0,U.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,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.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,U.jsxs)(`p`,{className:`text-sm font-sans text-terminal-dim`,children:[`A `,u,` session replay by `,(0,U.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,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap mt-2`,children:[r.gitBranch&&(0,U.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,U.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,U.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,U.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,U.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,U.jsx)(`div`,{className:`flex items-center gap-2 mb-2.5`,children:(0,U.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-green uppercase tracking-widest`,children:`You`})}),(0,U.jsx)(`div`,{className:`text-terminal-green font-mono text-sm whitespace-pre-wrap break-words line-clamp-3`,children:a.prompt})]}),(0,U.jsxs)(`div`,{className:`rounded-xl px-5 py-4 bg-terminal-surface shadow-layer-sm`,children:[(0,U.jsx)(`div`,{className:`flex items-center gap-2 mb-2.5`,children:(0,U.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-secondary-text uppercase tracking-widest`,children:`Assistant`})}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mb-3 text-[11px] font-mono`,children:[a.responses>0&&(0,U.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,U.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,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-terminal-border mx-0.5`,children:`|`}),a.toolEntries.map(([e,t])=>(0,U.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,U.jsx)(`span`,{className:`text-terminal-orange`,children:e}),(0,U.jsx)(`span`,{children:t})]},e))]})]}),a.lastResponse&&(0,U.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,U.jsx)(`div`,{className:`text-center`,children:(0,U.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,U.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,U.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,U.jsx)(`div`,{className:`text-base sm:text-xl font-bold font-mono tabular-nums ${e.color}`,children:e.value}),(0,U.jsx)(`div`,{className:`text-[9px] sm:text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-medium`,children:e.label})]},e.label))}),(0,U.jsxs)(`div`,{className:`hidden md:flex items-center justify-center gap-3 flex-wrap`,children:[(0,U.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,U.jsx)(`span`,{className:`text-xl text-terminal-green group-hover:scale-110 transition-transform duration-200`,children:`▶`}),(0,U.jsx)(`span`,{className:`text-base font-sans font-semibold text-terminal-green tracking-wide`,children:`Watch Replay`})]}),n&&(0,U.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,U.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,U.jsx)(`line`,{x1:`18`,x2:`18`,y1:`20`,y2:`10`}),(0,U.jsx)(`line`,{x1:`12`,x2:`12`,y1:`20`,y2:`4`}),(0,U.jsx)(`line`,{x1:`6`,x2:`6`,y1:`20`,y2:`14`})]}),(0,U.jsx)(`span`,{className:`text-sm font-sans font-semibold text-terminal-dim group-hover:text-terminal-text tracking-wide`,children:`View Insights`})]})]}),(0,U.jsx)(`div`,{className:`h-24 md:hidden`})]}),(0,U.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,U.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-dim group-hover:text-terminal-text transition-colors`,children:`or scroll down`}),(0,U.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,U.jsx)(`path`,{d:`M6 9l6 6 6-6`})})]}),(0,U.jsx)(`div`,{className:`flex-1 min-h-0`}),(0,U.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,U.jsxs)(`div`,{className:`flex items-center gap-3 mx-6 my-4`,children:[(0,U.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,U.jsx)(`span`,{className:`text-base`,children:`▶`}),(0,U.jsx)(`span`,{className:`text-sm font-sans`,children:`Watch Replay`})]}),n&&(0,U.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,U.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,U.jsx)(`line`,{x1:`18`,x2:`18`,y1:`20`,y2:`10`}),(0,U.jsx)(`line`,{x1:`12`,x2:`12`,y1:`20`,y2:`4`}),(0,U.jsx)(`line`,{x1:`6`,x2:`6`,y1:`20`,y2:`14`})]}),(0,U.jsx)(`span`,{className:`text-sm font-sans font-medium text-terminal-dim`,children:`Insights`})]})]})})]})}function sl({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,U.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,U.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,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer shrink-0`,children:i}),(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer italic truncate`,children:t})]})},`c-${e.promptIndex}`)}return(0,U.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,U.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,U.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,U.jsx)(`span`,{className:`text-sm font-mono leading-snug line-clamp-2 text-terminal-text`,children:e.prompt})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5 ml-6 flex-wrap`,children:[e.toolCalls>0&&(0,U.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,U.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,U.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,U.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,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:ot(t.durationMs)}):null})()]}),r&&e.toolNames.length>0&&(0,U.jsx)(`div`,{className:`mt-1.5 ml-6 text-xs font-mono text-terminal-dim truncate`,children:e.toolNames.join(`, `)})]},`t-${e.promptIndex}`)})})}function cl(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 ll(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 ul={"user-prompt":`User`,"compaction-summary":`Compaction`,"context-injection":`Injection`,thinking:`Thinking`,"text-response":`Response`,"tool-call":`Tool`},dl={"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 fl({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=cl(a);if(o.toLowerCase().includes(t)&&n.push({sceneIndex:r,type:a.type,snippet:ll(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,U.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,U.jsx)(`div`,{className:`absolute inset-0 bg-black/50 backdrop-blur-sm`}),(0,U.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,U.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-3.5 border-b border-terminal-border-subtle`,children:[(0,U.jsx)(`span`,{className:`text-terminal-dim text-sm`,children:`🔍`}),(0,U.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,U.jsx)(`kbd`,{className:`text-[10px] font-mono text-terminal-dimmer bg-terminal-surface px-2 py-0.5 rounded-md`,children:`ESC`})]}),(0,U.jsx)(`div`,{ref:l,className:`max-h-[50vh] overflow-y-auto`,children:i.length<2?(0,U.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,U.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,U.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,U.jsx)(`span`,{className:`text-[10px] font-sans font-bold uppercase shrink-0 mt-0.5 tracking-wider ${dl[e.type]||`text-terminal-dim`}`,children:e.toolName||ul[e.type]||e.type}),(0,U.jsx)(`span`,{className:`text-xs font-mono text-terminal-text line-clamp-2 break-words`,children:pl(e.snippet,i)}),(0,U.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dimmer shrink-0 mt-0.5`,children:[`#`,e.sceneIndex]})]},e.sceneIndex))}),u.length>0&&(0,U.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,U.jsxs)(`span`,{children:[u.length,` result`,u.length===1?``:`s`]}),(0,U.jsx)(`span`,{children:`↑↓ navigate`}),(0,U.jsx)(`span`,{children:`↵ select`})]})]})]}):null}function pl(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,U.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 ml(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 hl(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 gl(e,t){let n=hl(e,t);if(n)return n.length>1?`${n[0]} → ${n[n.length-1]}`:n[0]}function _l(e,t){return hl(e,t)?.join(` → `)}function vl(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 yl({session:e}){let{meta:t,scenes:n}=e,r=(0,_.useMemo)(()=>$e(t),[t]),i=(0,_.useMemo)(()=>et(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(`
102
111
  `).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(`
103
112
  `).length:0,i=a.diff.newContent?a.diff.newContent.split(`
104
113
  `).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(`
105
114
  `).length:0,a=n.diff.newContent?n.diff.newContent.split(`
106
- `).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=Ac(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)(Ze,{title:r.join(`
107
- `),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:Nc(t.gitBranch,t.gitBranches),children:Mc(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:et(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||t.cursorSidecars.conversationCheckpointLastUpdatedAt||t.cursorSidecars.restrictAgentModeSwitching!==void 0||t.cursorSidecars.glassMetaParentAgent)&&(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,t.cursorSidecars.conversationCheckpointLastUpdatedAt?(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-terminal-orange`,children:`checkpoint updated:`}),` `,new Date(t.cursorSidecars.conversationCheckpointLastUpdatedAt).toLocaleString()]}):null,t.cursorSidecars.restrictAgentModeSwitching===void 0?null:(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-terminal-blue`,children:`mode switching:`}),` `,t.cursorSidecars.restrictAgentModeSwitching?`restricted`:`allowed`]}),t.cursorSidecars.glassMetaParentAgent?(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-terminal-purple`,children:`glass parent:`}),` `,t.cursorSidecars.glassMetaParentAgent]}):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)(tt,{label:`Turns`,value:a.userPrompts,color:`text-terminal-green`}),(0,V.jsx)(tt,{label:`Tool Calls`,value:a.toolCalls,color:`text-terminal-orange`}),(0,V.jsx)(tt,{label:`Files Modified`,value:a.editedFiles.length,color:`text-terminal-blue`}),(0,V.jsx)(tt,{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?W(a.durationMs):`unavailable`}),i.duration&&(0,V.jsx)(Ze,{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)(Ze,{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)(Ze,{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)(Ze,{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)(zc,{turnStats:t.stats.turnStats,costEstimate:t.stats.costEstimate,turnLabels:s}),(0,V.jsx)(Vc,{turnStats:t.stats.turnStats,turnLabels:s}),a.turns.length>=2&&(0,V.jsx)(Wc,{turns:a.turns,turnLabels:s}),t.stats.turnStats.some(e=>e.durationMs)&&(0,V.jsx)(Hc,{turnStats:t.stats.turnStats,turnLabels:s})]}),t.tokenUsageByModel&&Object.keys(t.tokenUsageByModel).length>1&&(0,V.jsx)(Uc,{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)(qc,{turns:a.turns,turnStats:t.stats.turnStats}),(0,V.jsx)(Gc,{editedFiles:a.editedFiles,turns:a.turns}),(a.editedFiles.length>0||a.readOnlyFiles.length>0)&&(0,V.jsx)(Zc,{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 Ic={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 ${Ic[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] ${Ic[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 Rc({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 zc({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}=Pc(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)(Rc,{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)(Bc,{turnStats:e})]})}function Bc({turnStats:e}){let t=kr(e),n=t.map(e=>jr(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 Vc({turnStats:e,turnLabels:t}){let n=e.map(e=>e.contextTokens||0),r=n.length,{hovered:i,ref:a,onMouseMove:o,onMouseLeave:s}=Pc(r);if(!n.some(e=>e>0))return null;let c=Math.max(...n),l=e.some(e=>e.tokenUsage),u=kr(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:jr(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)(Rc,{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 Hc({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)(Rc,{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?W(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 `,W(r)]}),(0,V.jsxs)(`span`,{children:[`Turn `,n.length]})]})]}):null}function Uc({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 Wc({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)(Rc,{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 Gc({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 Kc=20;function qc({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>Kc,f=d&&!n?i.slice(0,Kc):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)(Jc,{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-Kc} more)`})})})})]})})]})}function Jc({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)(Yc,{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)(Yc,{value:e.durationMs?W(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)(Yc,{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)(Yc,{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 Yc({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 Xc=20;function Zc({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>Xc,d=u&&!n?i.slice(0,Xc):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)(Yc,{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)(Yc,{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-Xc} more)`})})})})]})})]})}function Qc(e,t){return t<=0?0:Math.max(0,Math.min(t-1,e))}function $c(e,t,n){if(n<=0||t<=0)return 0;let r=Math.max(0,Math.min(1,e/t));return Qc(Math.floor(r*n),n)}function el(e,t){return t<=0?0:Math.max(0,Math.min(t,e+1))/t*100}function tl(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 nl({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=Qc(t,e.length),o=el(t,e.length),s=(0,_.useRef)(null),c=(0,_.useCallback)(t=>{let r=s.current;if(!r)return;let i=r.getBoundingClientRect();n($c(t.clientX-i.left,i.width,e.length))},[e.length,n]),l=(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]),u=(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]),d=(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:c,onKeyDown:d,role:`slider`,"aria-label":`Scene timeline`,"aria-valuemin":0,"aria-valuemax":e.length-1,"aria-valuenow":a,tabIndex:0,children:[(l.length>0||u.length>0)&&(0,V.jsxs)(`div`,{className:`relative h-2 mb-0.5`,children:[l.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}`)),u.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:s,className:`relative flex h-2 rounded-full overflow-hidden bg-terminal-surface-2`,children:[i.map((e,t)=>(0,V.jsx)(`div`,{className:`flex-1 transition-opacity duration-150`,style:{backgroundColor:tl(e.type),opacity:e.startIndex<=a?1:.15}},t)),u.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:`${o}%`}})]})]})}var rl=[{key:`replay`,label:`Replay`},{key:`summary`,label:`Insights`},{key:`export`,label:`Share & Export`}],il=`vr-insights-seen`;function al(){try{return localStorage.getItem(il)===`1`}catch{return!1}}function ol(){try{localStorage.setItem(il,`1`)}catch{}}function sl({activeView:e,onChangeView:t,className:n=``,rightContent:r,hiddenTabs:i}){let[a,o]=(0,_.useState)(()=>al()||e===`summary`),s=(0,_.useCallback)(e=>{e===`summary`&&!a&&(ol(),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:rl.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 cl(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 ll({session:e,viewPrefs:t,viewerMode:n=`embedded`,activeView:r,setActiveView:i,returnToLandingRef:a,live:o}){let s=n===`readonly`,c=!!o,[l,u]=(0,_.useState)(c);(0,_.useEffect)(()=>{if(a)return a.current=()=>{u(!1),ye(!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[d,f]=(0,_.useState)(void 0),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(!1),[v,y]=(0,_.useState)(null),[b,x]=(0,_.useState)(!0),S=Wr(e,n),C=Kr(e,n),{effectiveSession:w}=C,{annotations:T}=S,E=Yr(c?{...t,displayMode:`all`}:t),{state:D,currentIndex:O,visibleCount:k,speed:ee,play:A,pause:te,togglePlayPause:j,seekTo:M,changeSpeed:ne,totalScenes:N,userPromptIndices:P,computeNextIndex:re}=Jr(e.scenes,E,l),ie=(0,_.useRef)(null),[ae,F]=(0,_.useState)(`outline`),[oe,I]=(0,_.useState)(!1),[se,ce]=(0,_.useState)(!1),L=(0,_.useRef)(null),R=(0,_.useRef)(null),le=(0,_.useRef)(!1),[ue,de]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`?(e.preventDefault(),I(e=>!e)):e.key===`/`?e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||(e.preventDefault(),I(!0)):e.key===`?`?de(e=>!e):e.key===`Escape`&&(ue?de(!1):oe&&I(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[oe,ue]);let fe=P.filter(e=>e<=O).length||0,pe=P.length,me=(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]),he=(0,_.useCallback)((e=!0)=>{u(!0),e?setTimeout(A,300):setTimeout(()=>M(me),100)},[A,M,me]),ge=(0,_.useCallback)(()=>i(`summary`),[i]),_e=(0,_.useRef)(t.displayMode);(0,_.useEffect)(()=>{_e.current!==t.displayMode&&(_e.current=t.displayMode,l||(u(!0),setTimeout(()=>M(me),100)))},[t.displayMode,l,M,me]);let[ve,ye]=(0,_.useState)(()=>new URLSearchParams(window.location.search).get(`s`)!==null);(0,_.useEffect)(()=>{!l&&r!==`replay`&&!ve&&(u(!0),setTimeout(()=>M(me),100))},[r,l,me,M,ve]);let z=(0,_.useCallback)(t=>{let n=Math.max(0,Math.min(t,e.scenes.length-1));te(),L.current=n,f(n),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>f(void 0),2500),M(n)},[te,M,e.scenes.length]);(0,_.useEffect)(()=>{!l&&ve&&(u(!0),setTimeout(()=>z(me),100))},[l,ve,me,z]);let be=(0,_.useCallback)(()=>{let e=P.find(e=>e>O);e!==void 0&&z(e)},[P,O,z]),xe=(0,_.useCallback)(()=>{let e=[...P].toReversed().find(e=>e<O);e!==void 0&&z(e)},[P,O,z]),Se=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(!ie.current||O<0||L.current!==null)return;if(le.current){le.current=!1;return}let t=ie.current;if(Se.current=!0,c){t.scrollTop=t.scrollHeight,setTimeout(()=>{Se.current=!1},50);return}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(O);if(e)if(D===`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 D===`playing`&&t.scrollTo({top:t.scrollHeight,behavior:`smooth`});setTimeout(()=>{Se.current=!1},400)})},[O,D,e.scenes,c]),(0,_.useEffect)(()=>{let e=ie.current;if(!e)return;let t=()=>{Se.current||D===`playing`&&te()};return e.addEventListener(`wheel`,t,{passive:!0}),e.addEventListener(`touchmove`,t,{passive:!0}),()=>{e.removeEventListener(`wheel`,t),e.removeEventListener(`touchmove`,t)}},[D,te]),(0,_.useEffect)(()=>{let t=ie.current;if(!t)return;let n=!1,r=()=>{if(!(D!==`paused`||n)&&!(O>=e.scenes.length-1)&&!(Se.current||L.current!==null)&&t.scrollHeight-t.scrollTop-t.clientHeight<80){n=!0,le.current=!0;let e=re(O);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)}},[D,O,e.scenes.length,M,re]),(0,_.useEffect)(()=>{let e=L.current,t=ie.current;if(e===null||!t||O!==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){Se.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`}),cl(o),setTimeout(()=>{Se.current=!1},450),L.current=null;return}r+=1,r<30?setTimeout(a,80):L.current=null};return requestAnimationFrame(a),()=>{n=!0}},[O]),(0,_.useEffect)(()=>()=>{R.current&&clearTimeout(R.current)},[]);let Ce=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(O<0||!l||c)return;Ce.current&&clearTimeout(Ce.current);let e=D===`playing`?500:0;return Ce.current=setTimeout(()=>{let e=new URL(window.location.href);e.searchParams.set(`s`,String(O)),window.history.replaceState({},``,e.toString())},e),()=>{Ce.current&&clearTimeout(Ce.current)}},[O,D,l,c]);let B=(0,_.useRef)(0);(0,_.useLayoutEffect)(()=>{if(!c)return;let t=e.scenes.length;t===0||t===B.current||(B.current=t,M(t-1))},[c,e.scenes.length,M]);let we=n===`editor`,Te=(0,_.useMemo)(()=>T.some(e=>e.author===`vibe-feedback`),[T]);if(!l&&r===`replay`)return(0,V.jsx)(Sc,{session:w,onStart:he,onViewInsights:ge});let{meta:Ee}=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)(sl,{activeView:r,onChangeView:i,hiddenTabs:s?[`export`]:void 0,rightContent:r===`replay`?(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[C.overlayCount>0&&(0,V.jsxs)(`button`,{onClick:()=>C.toggleAllOriginals(),className:`hidden md:flex items-center gap-2 text-xs font-mono text-terminal-dim`,title:C.showAllOriginals?`Showing originals — click to show modified`:`Showing modified — click to show originals`,children:[(0,V.jsx)(`span`,{children:C.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 ${C.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 ${C.showAllOriginals?`translate-x-[3px]`:`translate-x-[17px]`}`})})]}),(0,V.jsxs)(`button`,{onClick:()=>m(!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`}),S.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:S.annotations.length})]}),(0,V.jsxs)(`button`,{onClick:()=>m(!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`})}),S.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:S.annotations.length})]}),we&&(0,V.jsxs)(`button`,{onClick:()=>g(!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`}),(Te||C.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:[b&&(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:()=>x(!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)(Cc,{scenes:e.scenes,currentIndex:O,onSeek:z,overlayActions:C,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)(tt,{label:`Turns`,value:Ee.stats.userPrompts,color:`text-terminal-green`}),(0,V.jsx)(tt,{label:`Tools`,value:Ee.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:[Ee.model&&(0,V.jsx)(`div`,{children:(0,V.jsx)(`span`,{className:`text-terminal-text`,children:Ee.model})}),Ee.stats.durationMs&&(0,V.jsxs)(`div`,{children:[W(Ee.stats.durationMs),Ee.stats.costEstimate!==void 0&&(0,V.jsxs)(`span`,{children:[` / `,(0,V.jsxs)(`span`,{className:`text-terminal-green`,children:[`$`,Ee.stats.costEstimate<.01?Ee.stats.costEstimate.toFixed(4):Ee.stats.costEstimate.toFixed(2)]})]})]}),Ee.stats.tokenUsage&&(0,V.jsxs)(`div`,{children:[U(Ee.stats.tokenUsage.inputTokens),` in /`,` `,U(Ee.stats.tokenUsage.outputTokens),` out`]}),(()=>{if(!Ee.stats.turnStats?.length)return null;let e=Math.max(...Ee.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:[!b&&(0,V.jsx)(`button`,{onClick:()=>x(!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:ie,"data-replay-scroll-container":!0,className:`flex-1 overflow-y-auto overflow-x-hidden px-5 py-5 pb-10 overscroll-contain`,children:(0,V.jsx)(ec,{scenes:e.scenes,visibleCount:c?e.scenes.length:k,currentIndex:O,effectivePrefs:E,focusIndex:d,annotatedScenes:S.annotatedScenes,annotationCounts:S.annotationCounts,onSeek:z,state:D,overlayActions:C,turnStats:e.meta.stats.turnStats,isLive:c,liveCursorDiagnostics:o?.cursorDiagnostics,liveCursorProbeAt:o?.lastCursorProbe,liveCursorRowsChanged:o?.cursorRowsChanged,liveSessionState:o?.sessionState,onComment:s?void 0:e=>{m(!0),y(e)}})}),(0,V.jsx)(Oc,{scenes:w.scenes,open:oe,onClose:()=>I(!1),onSeek:e=>{z(e),I(!1)}})]})]}),r===`summary`&&(0,V.jsx)(Fc,{session:w}),r===`export`&&(0,V.jsx)(vc,{actions:S,viewerMode:n,readOnly:s,session:w})]}),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)(nl,{scenes:e.scenes,currentIndex:O,onSeek:z,annotatedScenes:S.annotatedScenes}),(0,V.jsx)(Ya,{state:D,speed:ee,currentIndex:O,totalScenes:N,userPromptCount:pe,currentTurn:fe,onTogglePlayPause:j,onChangeSpeed:ne,onPrevPrompt:xe,onNextPrompt:be,onOpenSearch:()=>I(!0),onOpenOutline:()=>ce(!0),onShowHelp:()=>de(!0)})]})]}),(0,V.jsx)(qa,{open:p,onClose:()=>m(!1),actions:S,scenes:w.scenes,currentIndex:O,onSeek:z,addingForScene:v,onClearAddingTarget:()=>y(null),readOnly:s}),(0,V.jsx)(si,{open:h,onClose:()=>g(!1),annotationActions:S,overlayActions:C}),(0,V.jsxs)(`div`,{className:`fixed inset-0 z-40 md:hidden transition-opacity duration-300 ${se?`opacity-100`:`opacity-0 pointer-events-none`}`,onClick:()=>ce(!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 ${se?`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:()=>F(`outline`),className:`flex-1 px-3 py-2.5 text-[10px] font-sans font-semibold uppercase tracking-widest transition-colors ${ae===`outline`?`text-terminal-green border-b-2 border-terminal-green`:`text-terminal-dim hover:text-terminal-text`}`,children:`Outline`}),(0,V.jsxs)(`button`,{onClick:()=>F(`comments`),className:`flex-1 px-3 py-2.5 text-[10px] font-sans font-semibold uppercase tracking-widest transition-colors ${ae===`comments`?`text-terminal-green border-b-2 border-terminal-green`:`text-terminal-dim hover:text-terminal-text`}`,children:[`Comments`,S.annotations.length>0&&(0,V.jsxs)(`span`,{className:`ml-1.5 text-terminal-dimmer`,children:[`(`,S.annotations.length,`)`]})]})]}),(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain`,children:ae===`outline`?(0,V.jsx)(Cc,{scenes:e.scenes,currentIndex:O,onSeek:e=>{z(e),ce(!1)},overlayActions:C,turnStats:e.meta.stats.turnStats}):(0,V.jsx)(Ga,{actions:S,scenes:w.scenes,currentIndex:O,onSeek:e=>{z(e)},addingForScene:v,onClearAddingTarget:()=>y(null),readOnly:s})})]})]}),(0,V.jsx)(bc,{open:ue,onClose:()=>de(!1)})]})}function ul(){let[e,t]=(0,_.useState)({status:`loading`}),n=(0,_.useRef)(null),r=(0,_.useCallback)(()=>{n.current&&=(n.current.close(),null)},[]),i=(0,_.useCallback)(()=>{r(),t({status:`loading`});let e=fl();if(e&&dl()){pl(e,n,t);return}ml().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)}))},[r]);return(0,_.useEffect)(()=>{i();let e=()=>i();return window.addEventListener(`popstate`,e),()=>{window.removeEventListener(`popstate`,e),r()}},[i,r]),e}function dl(){return!!window.__VIBE_REPLAY_EDITOR__}function fl(){let e=new URLSearchParams(window.location.search);if(e.get(`live`)!==`1`||e.get(`view`)===`dashboard`||e.get(`session`))return null;let t=e.get(`provider`),n=e.get(`sessionId`);return!t||!n||!/^[a-zA-Z0-9_.-]{1,64}$/.test(t)||!/^[a-zA-Z0-9_.-]{1,128}$/.test(n)?null:{provider:t,sessionId:n}}function pl(e,t,n){let r=`/api/live?provider=${encodeURIComponent(e.provider)}&sessionId=${encodeURIComponent(e.sessionId)}`,i=new EventSource(r);t.current=i;let a=null,o={state:`connecting`,scenes:0},s=()=>{t.current===i&&(a?n({status:`ready`,session:a,mode:`editor`,live:o}):o.state===`error`&&o.error&&n({status:`error`,message:o.error}))};i.onopen=()=>{o={...o,state:`open`,error:void 0},s()},i.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}t.type===`session`&&t.session?(a=t.session,o={state:`open`,scenes:t.session.scenes.length,lastUpdate:Date.now(),error:void 0,sessionState:t.state??o.sessionState,cursorDiagnostics:t.cursorDiagnostics??o.cursorDiagnostics,cursorRowsChanged:t.cursorRowsChanged??o.cursorRowsChanged,lastCursorProbe:t.cursorDiagnostics?Date.now():o.lastCursorProbe},s()):t.type===`diagnostics`&&t.cursorDiagnostics?(o={...o,state:`open`,cursorDiagnostics:t.cursorDiagnostics,cursorRowsChanged:t.cursorRowsChanged,lastCursorProbe:Date.now()},s()):t.type===`state`&&t.state?(o={...o,sessionState:t.state},s()):t.type===`error`&&(o={...o,state:`error`,error:t.message||`Live stream error`},s())},i.onerror=()=>{o={...o,state:`error`,error:o.error||`Disconnected`},s()}}async function ml(){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 gl(n.gistId);return{session:await hl(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 gl(n),r=await hl(e);return fetch(`https://vibe-replay.com/api/cloud-replays/view-gist/${n}`,{method:`POST`}).catch(()=>{}),{session:r,mode:`readonly`,gistOwner:t}}if(dl()){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 hl(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 hl(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 gl(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 _l(){let[e,t]=(0,_.useState)(()=>{let e=new URLSearchParams(window.location.search).get(`theme`);if(e===`light`||e===`dark`)return e;let t=y(localStorage,`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`),b(localStorage,`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 vl(){let e=new URLSearchParams(window.location.search).get(`v`);return e===`summary`||e===`export`?e:`replay`}var yl=`https://vibe-replay.com`;function bl({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`:`${yl}/api/auth/get-session`,r=``;if(!e)try{r=new URL(yl).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`:`${yl}/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(`${yl}/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`:`${yl}/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 xl(){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 Sl(){let e=ul(),{theme:t,toggleTheme:n}=_l(),{prefs:r,updatePref:i,togglePref:a}=$r(),o=e.status===`ready`?e.session:null,s=e.status===`ready`?e.mode:`embedded`,c=e.status===`ready`?e.gistOwner:void 0,l=e.status===`ready`?e.live:void 0,u=s===`editor`,[d,f]=(0,_.useState)(vl()),p=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=()=>f(vl());return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let m=e=>{f(e),R({v:e===`replay`?null:e})},h=(0,_.useMemo)(()=>o?.scenes.some(e=>e.type===`thinking`)??!1,[o]),[g,y]=(0,_.useState)(!1);(0,_.useEffect)(()=>{if(!g)return;let e=e=>{e.key===`Escape`&&y(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[g]);let[b,x]=(0,_.useState)(!1),S=(0,_.useRef)(null);if((0,_.useEffect)(()=>{r.displayMode!==`custom`&&x(!1)},[r.displayMode]),v(S,(0,_.useCallback)(()=>x(!1),[]),b),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)(Sr,{headerLeft:(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 shrink-0`,children:[(0,V.jsx)(`button`,{onClick:()=>R({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.2.3\nViewer ${window.location.host}
108
- Cloud https://vibe-replay.com`})]})]}),headerRight:(0,V.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,V.jsx)(xl,{}),(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)(bl,{isEditor:!0})]})})});let{meta:C}=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:[u?(0,V.jsx)(`button`,{onClick:()=>R({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`}),u&&(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.2.3\nViewer ${window.location.host}
109
- Cloud https://vibe-replay.com`})]}),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 uppercase tracking-wider border ${l.state===`open`?`bg-terminal-red/10 text-terminal-red border-terminal-red/20`:`bg-terminal-dim/10 text-terminal-dim border-terminal-dim/20`}`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ${l.state===`open`?`bg-terminal-red animate-pulse`:`bg-terminal-dim`}`}),l.state===`open`?`Live`:l.state===`connecting`?`Connecting`:`Offline`,(0,V.jsx)(`span`,{className:`instant-tooltip-text`,children:l.state===`open`?`Streaming ${l.scenes} scene${l.scenes===1?``:`s`}${l.lastUpdate?`\nLast update ${new Date(l.lastUpdate).toLocaleTimeString()}`:``}`:l.error||`Reconnecting...`})]})]}),u&&(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:()=>R({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))}),C.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:()=>{p.current?.(),m(`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:C.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:S,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`),x(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`})]}),b&&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`]}),h&&(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)(xl,{}),(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`?`☾`:`☀`}),u&&(0,V.jsx)(bl,{isEditor:u})]}),(0,V.jsx)(`button`,{onClick:()=>y(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:g?(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`})})})]}),g&&(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`&&y(!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`}),h&&(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(),y(!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)(xl,{})]})]})})]}),g&&(0,V.jsx)(`div`,{className:`md:hidden fixed inset-0 z-30 bg-black/30`,onClick:()=>y(!1)}),(0,V.jsx)(ll,{session:o,viewPrefs:r,viewerMode:s,activeView:d,setActiveView:m,returnToLandingRef:p,live:l})]})}g.createRoot(document.getElementById(`root`)).render((0,V.jsx)(_.StrictMode,{children:(0,V.jsx)(Sl,{})}));</script>
110
- <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-0{top:0;bottom: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-20{bottom:5rem}.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-0{height:0}.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-7{min-height:1.75rem}.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-\[calc\(100vw-2rem\)\]{width:calc(100vw - 2rem)}.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-32{max-width:8rem}.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-y-3{--tw-translate-y:-.75rem;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-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-5{-moz-column-gap:1.25rem;column-gap:1.25rem}.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-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-cyan{border-color:var(--cyan)}.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-current{background-color:currentColor}.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-cyan{background-color:var(--cyan)}.bg-terminal-cyan-subtle{background-color:var(--cyan-subtle)}.bg-terminal-dim{background-color:var(--dim)}.bg-terminal-dimmer{background-color:var(--dimmer)}.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-10{padding-top:2.5rem}.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\.25em\]{letter-spacing:.25em}.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-cyan{color:var(--cyan)}.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;--cyan-emphasis:#56d4dd40;--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;--cyan-emphasis:#0e7c8633;--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}.turn-sticky-summary{background-color:var(--surface);background-image:linear-gradient(var(--green-subtle), var(--green-subtle))}@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\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.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\,1\.25fr\)_minmax\(320px\,0\.75fr\)\]{grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr)}.lg\:grid-cols-\[minmax\(0\,1fr\)_22rem\]{grid-template-columns:minmax(0,1fr) 22rem}.lg\:grid-cols-\[minmax\(280px\,0\.72fr\)_minmax\(0\,1\.28fr\)\]{grid-template-columns:minmax(280px,.72fr) minmax(0,1.28fr)}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:items-stretch{align-items:stretch}.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%}
115
+ `).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=ml(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,U.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,U.jsxs)(`div`,{className:`p-6 space-y-6 max-w-4xl mx-auto`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,U.jsx)(`h2`,{className:`text-sm font-mono font-semibold text-terminal-text truncate`,children:t.title||t.slug}),t.provider&&(0,U.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,U.jsx)(tt,{title:r.join(`
116
+ `),className:`shrink-0`}),t.gitBranch&&(0,U.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:_l(t.gitBranch,t.gitBranches),children:gl(t.gitBranch,t.gitBranches)}),t.permissionMode===`bypassPermissions`&&(0,U.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,U.jsxs)(`div`,{className:`rounded border border-terminal-orange/40 bg-terminal-orange/10 px-3 py-2`,children:[(0,U.jsx)(`div`,{className:`ui-section-title text-terminal-orange mb-1`,children:`Data Quality`}),(0,U.jsx)(`div`,{className:`space-y-0.5`,children:r.slice(0,4).map(e=>(0,U.jsx)(`div`,{className:`ui-caption`,children:e},e))})]}),(t.dataSource||t.dataSourceInfo)&&(0,U.jsxs)(`div`,{className:`rounded border border-terminal-border-subtle bg-terminal-surface/40 px-3 py-2`,children:[(0,U.jsx)(`div`,{className:`ui-section-title mb-1`,children:`Data Source`}),(0,U.jsx)(`div`,{className:`text-xs font-mono text-terminal-text`,children:it(t.dataSourceInfo?.primary||t.dataSource)}),t.dataSourceInfo?.sources&&t.dataSourceInfo.sources.length>0&&(0,U.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:t.dataSourceInfo.sources.map(e=>(0,U.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dim truncate`,title:e,children:[(0,U.jsx)(`span`,{className:`text-terminal-green`,children:`source:`}),` `,e]},e))}),t.dataSourceInfo?.supplements&&t.dataSourceInfo.supplements.length>0&&(0,U.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:t.dataSourceInfo.supplements.map(e=>(0,U.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dim truncate`,title:e,children:[(0,U.jsx)(`span`,{className:`text-terminal-purple`,children:`supplement:`}),` `,e]},e))})]}),t.provider===`cursor`&&t.cursorSidecars&&(t.cursorSidecars.requestContextCount||t.cursorSidecars.checkpointCount||t.cursorSidecars.hasWorkspaceRules||t.cursorSidecars.conversationCheckpointLastUpdatedAt||t.cursorSidecars.restrictAgentModeSwitching!==void 0||t.cursorSidecars.glassMetaParentAgent)&&(0,U.jsxs)(`div`,{className:`rounded border border-terminal-border-subtle bg-terminal-surface/40 px-3 py-2`,children:[(0,U.jsx)(`div`,{className:`ui-section-title mb-1`,children:`Cursor Sidecars`}),(0,U.jsxs)(`div`,{className:`space-y-0.5 text-xs font-mono text-terminal-dim`,children:[t.cursorSidecars.requestContextCount?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-terminal-green`,children:`request context:`}),` `,t.cursorSidecars.requestContextCount,` sidecar`,t.cursorSidecars.requestContextCount===1?``:`s`]}):null,t.cursorSidecars.hasWorkspaceRules?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-terminal-purple`,children:`workspace rules:`}),` included`]}):null,t.cursorSidecars.checkpointCount?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-terminal-orange`,children:`checkpoint state:`}),` `,t.cursorSidecars.checkpointCount,` entr`,t.cursorSidecars.checkpointCount===1?`y`:`ies`]}):null,t.cursorSidecars.conversationCheckpointLastUpdatedAt?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-terminal-orange`,children:`checkpoint updated:`}),` `,new Date(t.cursorSidecars.conversationCheckpointLastUpdatedAt).toLocaleString()]}):null,t.cursorSidecars.restrictAgentModeSwitching===void 0?null:(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-terminal-blue`,children:`mode switching:`}),` `,t.cursorSidecars.restrictAgentModeSwitching?`restricted`:`allowed`]}),t.cursorSidecars.glassMetaParentAgent?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-terminal-purple`,children:`glass parent:`}),` `,t.cursorSidecars.glassMetaParentAgent]}):null]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`ui-section-title mb-3`,children:`Overview`}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3`,children:[(0,U.jsx)(at,{label:`Turns`,value:a.userPrompts,color:`text-terminal-green`}),(0,U.jsx)(at,{label:`Tool Calls`,value:a.toolCalls,color:`text-terminal-orange`}),(0,U.jsx)(at,{label:`Files Modified`,value:a.editedFiles.length,color:`text-terminal-blue`}),(0,U.jsx)(at,{label:`Scenes`,value:a.totalScenes,color:`text-terminal-text`})]}),a.totalDelegatedTools>0&&(0,U.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,U.jsxs)(`span`,{className:`text-green-300`,children:[`+`,a.totalDelegatedTools,` tools delegated`]}),(0,U.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[`to `,a.subAgents.length,` sub-agent`,a.subAgents.length>1?`s`:``]}),a.totalDelegatedTokens>0&&(0,U.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,U.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,U.jsxs)(`div`,{children:[`Model: `,(0,U.jsx)(`span`,{className:`text-terminal-text font-semibold`,children:t.model})]}),(a.durationMs||i.duration)&&(0,U.jsxs)(`div`,{children:[`Duration:`,` `,(0,U.jsx)(`span`,{className:`text-terminal-text`,children:a.durationMs?ot(a.durationMs):`unavailable`}),i.duration&&(0,U.jsx)(tt,{title:i.duration,className:`ml-1`})]}),a.costEstimate!==void 0&&(0,U.jsxs)(`div`,{children:[`Cost:`,` `,(0,U.jsxs)(`span`,{className:`text-terminal-green`,children:[`$`,a.costEstimate<.01?a.costEstimate.toFixed(4):a.costEstimate.toFixed(2)]}),(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:` (est.)`}),i.tokens&&(0,U.jsx)(tt,{title:i.tokens,className:`ml-1`})]}),a.tokenUsage?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{children:[`In:`,` `,(0,U.jsx)(`span`,{className:`text-terminal-blue`,children:G(a.tokenUsage.inputTokens)}),` / `,`Out:`,` `,(0,U.jsx)(`span`,{className:`text-terminal-green`,children:G(a.tokenUsage.outputTokens)})]}),(0,U.jsxs)(`div`,{children:[`Cache:`,` `,(0,U.jsx)(`span`,{className:`text-terminal-purple`,children:G(a.tokenUsage.cacheReadTokens)}),` `,`read /`,` `,(0,U.jsx)(`span`,{className:`text-terminal-orange`,children:G(a.tokenUsage.cacheCreationTokens)}),` `,`created`]})]}):i.tokens&&(0,U.jsxs)(`div`,{children:[`Tokens: `,(0,U.jsx)(`span`,{className:`text-terminal-text`,children:`unavailable`}),(0,U.jsx)(tt,{title:i.tokens,className:`ml-1`})]}),!o&&i.turnStats&&(0,U.jsxs)(`div`,{children:[`Turn Stats: `,(0,U.jsx)(`span`,{className:`text-terminal-text`,children:`limited`}),(0,U.jsx)(tt,{title:i.turnStats,className:`ml-1`})]})]})]}),o&&(0,U.jsxs)(`div`,{className:`space-y-5`,children:[(0,U.jsx)(`div`,{className:`ui-section-title`,children:`Per-Turn Metrics`}),(0,U.jsx)(Cl,{turnStats:t.stats.turnStats,costEstimate:t.stats.costEstimate,turnLabels:s}),(0,U.jsx)(Tl,{turnStats:t.stats.turnStats,turnLabels:s}),a.turns.length>=2&&(0,U.jsx)(Ol,{turns:a.turns,turnLabels:s}),t.stats.turnStats.some(e=>e.durationMs)&&(0,U.jsx)(El,{turnStats:t.stats.turnStats,turnLabels:s})]}),t.tokenUsageByModel&&Object.keys(t.tokenUsageByModel).length>1&&(0,U.jsx)(Dl,{tokenUsageByModel:t.tokenUsageByModel}),t.apiErrors&&t.apiErrors.length>0&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`ui-section-title mb-2`,children:`API Issues`}),(0,U.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,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`text-terminal-text`,children:[a.join(` and `),` `,(0,U.jsxs)(`span`,{className:`text-terminal-red`,children:[e.length,` times`]}),` during this session`,n>1&&(0,U.jsxs)(U.Fragment,{children:[`, with up to`,` `,(0,U.jsxs)(`span`,{className:`text-terminal-orange`,children:[n,` retries`]}),` in a row`]}),`.`]}),(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`ui-section-title mb-2`,children:[`Files Tracked (`,t.trackedFiles.length,`)`]}),(0,U.jsx)(`div`,{className:`space-y-0.5 max-h-[200px] overflow-y-auto`,children:t.trackedFiles.map(e=>(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`ui-section-title mb-2`,children:[`Context Files (inferred, `,t.contextFiles.length,`)`]}),(0,U.jsx)(`div`,{className:`space-y-0.5 max-h-[200px] overflow-y-auto`,children:t.contextFiles.map(e=>(0,U.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,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`ui-section-title mb-2`,children:`Pull Requests`}),(0,U.jsx)(`div`,{className:`space-y-1`,children:t.prLinks.map(e=>(0,U.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,U.jsxs)(`span`,{className:`text-terminal-green`,children:[`#`,e.prNumber]}),e.prRepository&&(0,U.jsx)(`span`,{className:`text-terminal-dimmer truncate`,children:e.prRepository})]},e.prUrl))})]}),a.turns.length>0&&(0,U.jsx)(jl,{turns:a.turns,turnStats:t.stats.turnStats}),(0,U.jsx)(kl,{editedFiles:a.editedFiles,turns:a.turns}),(a.editedFiles.length>0||a.readOnlyFiles.length>0)&&(0,U.jsx)(Fl,{editedFiles:a.editedFiles,readOnlyFiles:a.readOnlyFiles}),a.bashCats.length>1&&(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`ui-section-title mb-2`,children:[`Bash Commands`,a.totalBashErrors>0&&(0,U.jsxs)(`span`,{className:`text-terminal-red ml-2 normal-case tracking-normal`,children:[a.totalBashErrors,` error`,a.totalBashErrors===1?``:`s`]})]}),(0,U.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:a.bashCats.map(([e,t])=>(0,U.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dim bg-terminal-surface rounded px-2 py-1`,children:[e,` `,(0,U.jsx)(`span`,{className:`text-terminal-text tabular-nums`,children:t})]},e))})]}),a.topTools.length>0&&(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`ui-section-title mb-2`,children:[`Top Tools`,(0,U.jsxs)(`span`,{className:`text-terminal-dimmer ml-2 normal-case tracking-normal font-mono`,children:[a.totalTools,` total`]})]}),(0,U.jsx)(`div`,{className:`space-y-1.5`,children:a.topTools.map(([e,t])=>(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono`,children:[(0,U.jsx)(`span`,{className:`text-terminal-text shrink-0 w-24 text-right truncate`,title:e,children:e}),(0,U.jsx)(`div`,{className:`flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full rounded-full bg-terminal-orange`,style:{width:`${t/a.topTools[0][1]*100}%`}})}),(0,U.jsxs)(`span`,{className:`text-terminal-dim shrink-0 w-16 text-right tabular-nums`,children:[t,` `,(0,U.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[`(`,Math.round(t/a.totalTools*100),`%)`]})]})]},e))})]}),a.subAgents.length>0&&(0,U.jsx)(xl,{subAgents:a.subAgents}),a.totalTools>0&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`ui-section-title mb-2`,children:`Activity Distribution`}),(0,U.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,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono`,children:[(0,U.jsx)(`span`,{className:`text-terminal-text shrink-0 w-24 text-right`,children:e}),(0,U.jsx)(`div`,{className:`flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full rounded-full`,style:{width:`${t/a.totalTools*100}%`,backgroundColor:`var(${n})`}})}),(0,U.jsxs)(`span`,{className:`text-terminal-dim shrink-0 w-16 text-right tabular-nums`,children:[t,` (`,Math.round(t/a.totalTools*100),`%)`]})]},e))})]})]})})}var bl={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 xl({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,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`ui-section-title mb-2`,children:[`Sub-Agents (`,e.length,`)`]}),(0,U.jsx)(`div`,{className:`flex flex-wrap gap-2 mb-3`,children:i.map(([e,t])=>(0,U.jsxs)(`span`,{className:`text-[11px] px-2 py-1 rounded border font-mono ${bl[e]||`bg-gray-500/20 text-gray-300 border-gray-500/30`}`,children:[e,` `,(0,U.jsxs)(`span`,{className:`opacity-70`,children:[`x`,t.count,` (`,t.toolCalls,` tools)`]})]},e))}),(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs font-mono text-terminal-dim`,children:[(0,U.jsxs)(`div`,{children:[`Delegated tools: `,(0,U.jsx)(`span`,{className:`text-terminal-text`,children:n})]}),r>0&&(0,U.jsxs)(`div`,{children:[`Delegated tokens:`,` `,(0,U.jsx)(`span`,{className:`text-terminal-text`,children:r>1e6?`${(r/1e6).toFixed(1)}M`:r>1e3?`${(r/1e3).toFixed(0)}K`:r}),(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:` (context-free)`})]})]}),(0,U.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[e.slice(0,20).map((e,t)=>(0,U.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,U.jsx)(`span`,{className:`px-1 py-0.5 rounded border text-[9px] ${bl[e.agentType]||`bg-gray-500/20 text-gray-300 border-gray-500/30`}`,children:e.agentType}),(0,U.jsx)(`span`,{className:`truncate flex-1 text-terminal-text/70`,children:e.description||`(no description)`}),(0,U.jsxs)(`span`,{className:`shrink-0`,children:[e.toolCalls,` tools`]}),e.totalTokens>0&&(0,U.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,U.jsxs)(`div`,{className:`text-[10px] text-terminal-dimmer font-mono px-2`,children:[`... and `,e.length-20,` more`]})]})]})}function Sl({children:e,visible:t,x:n}){if(!t)return null;let r=n>.7;return(0,U.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,U.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 Cl({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}=vl(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,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`ui-section-title mb-1`,children:[`Token Burn`,t?` & Cost`:``]}),(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsxs)(`svg`,{ref:s,viewBox:`0 0 100 60`,preserveAspectRatio:`none`,className:`w-full h-20`,onMouseMove:c,onMouseLeave:l,children:[(0,U.jsx)(`polygon`,{points:`0,60 ${d.join(` `)} 100,60`,style:{fill:`var(--green-subtle)`}}),(0,U.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,U.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,U.jsx)(Sl,{visible:o!==null,x:f,children:o!==null&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`text-terminal-green`,children:[`Turn `,o+1]}),n?.[o]&&(0,U.jsx)(`div`,{className:`text-terminal-dim truncate max-w-[200px]`,children:n[o]}),(0,U.jsxs)(`div`,{children:[`cumulative: `,G(r[o]),` tokens`]}),e[o]?.tokenUsage&&(0,U.jsxs)(`div`,{className:`text-terminal-dimmer`,children:[`this turn: +`,G(e[o].tokenUsage.outputTokens),` out`]})]})})]}),(0,U.jsxs)(`div`,{className:`flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5`,children:[(0,U.jsx)(`span`,{children:`Turn 1`}),(0,U.jsxs)(`span`,{children:[G(u),` tokens`,t?` ($${t<1?t.toFixed(2):t.toFixed(0)})`:``]}),(0,U.jsxs)(`span`,{children:[`Turn `,a]})]}),e.some(e=>e.tokenUsage?.cacheReadTokens)&&(0,U.jsx)(wl,{turnStats:e})]})}function wl({turnStats:e}){let t=Zr(e),n=t.map(e=>$r(e)/100),r=Qr(t)/100,i=n.map((e,t)=>`${n.length===1?100/2:t/(n.length-1)*100},${24-e*20-2}`);return(0,U.jsxs)(`div`,{className:`mt-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`ui-section-title`,children:`Cache Hit Rate`}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-purple`,children:[`avg `,Math.round(r*100),`%`]})]}),(0,U.jsx)(`svg`,{viewBox:`0 0 100 24`,preserveAspectRatio:`none`,className:`w-full h-6`,children:(0,U.jsx)(`polyline`,{points:i.join(` `),fill:`none`,style:{stroke:`var(--purple)`},strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`})})]})}function Tl({turnStats:e,turnLabels:t}){let n=e.map(e=>e.contextTokens||0),r=n.length,{hovered:i,ref:a,onMouseMove:o,onMouseLeave:s}=vl(r);if(!n.some(e=>e>0))return null;let c=Math.max(...n),l=e.some(e=>e.tokenUsage),u=Zr(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=Qr(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:$r(u[i]);return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`ui-section-title mb-1 flex items-center gap-2`,children:[(0,U.jsx)(`span`,{children:`Context Window Usage`}),(0,U.jsxs)(`span`,{className:`font-mono text-terminal-cyan`,children:[`peak `,G(c)]})]}),(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.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,U.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,U.jsxs)(U.Fragment,{children:[v.map((e,t)=>(0,U.jsx)(`polygon`,{points:e,style:{fill:`var(--cyan-subtle)`},opacity:`0.6`},`nd-${t}`)),(0,U.jsx)(`polygon`,{points:_.total,style:{fill:`var(--orange-subtle)`}}),(0,U.jsx)(`polygon`,{points:_.uncached,style:{fill:`var(--purple-subtle)`}}),(0,U.jsx)(`polygon`,{points:_.cacheRead,style:{fill:`var(--green-subtle)`}})]}):(0,U.jsx)(`polygon`,{points:`0,60 ${g.join(` `)} 100,60`,style:{fill:`var(--cyan-subtle)`}}),(0,U.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,U.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,U.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,U.jsx)(Sl,{visible:i!==null,x:C,children:i!==null&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`text-terminal-cyan`,children:[`Turn `,i+1]}),t?.[i]&&(0,U.jsx)(`div`,{className:`text-terminal-dim truncate max-w-[200px]`,children:t[i]}),(0,U.jsxs)(`div`,{children:[G(n[i]),` tokens`]}),l&&u[i].rawSum>0&&(0,U.jsxs)(`div`,{className:`mt-0.5 border-t border-terminal-border-subtle pt-0.5 space-y-px`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--green)`}}),(0,U.jsxs)(`span`,{children:[`cache read `,G(u[i].rawCr)]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--purple)`}}),(0,U.jsxs)(`span`,{children:[`uncached`,` `,G(u[i].rawSum-u[i].rawCr-(e[i].tokenUsage?.cacheCreationTokens||0))]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--orange)`}}),(0,U.jsxs)(`span`,{children:[`cache write `,G(e[i].tokenUsage?.cacheCreationTokens||0)]})]}),(0,U.jsxs)(`div`,{className:`text-terminal-dim`,children:[T.toFixed(0),`% cache hit`]})]})]})})]}),(0,U.jsxs)(`div`,{className:`flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5`,children:[(0,U.jsx)(`span`,{children:`Turn 1`}),(0,U.jsx)(`span`,{children:f?`limit ${G(f)}`:`peak ${G(c)}`}),(0,U.jsxs)(`span`,{children:[`Turn `,r]})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-0.5 mt-1`,children:[b.length>0&&(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`inline-block w-3 border-t border-dashed`,style:{borderColor:`var(--red)`}}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[b.length,` compaction`,b.length===1?``:`s`]})]}),l&&S>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--green)`}}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`cache read`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--purple)`}}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`uncached`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--orange)`}}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`cache write`})]}),y&&(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--cyan-subtle)`,opacity:.6}}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`no breakdown`})]}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-cyan`,children:[x.toFixed(0),`% cache hit`]})]})]})]})}function El({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,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`ui-section-title mb-1`,children:`Turn Duration`}),(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(`div`,{className:`flex items-end gap-px h-16`,onMouseLeave:()=>o(null),children:n.map((e,t)=>(0,U.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,U.jsx)(Sl,{visible:a!==null,x:a===null?0:n.length===1?.5:a/(n.length-1),children:a!==null&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`text-terminal-blue`,children:[`Turn `,a+1]}),t?.[a]&&(0,U.jsx)(`div`,{className:`text-terminal-dim truncate max-w-[200px]`,children:t[a]}),(0,U.jsx)(`div`,{children:n[a]>0?ot(n[a]):`no data`})]})})]}),(0,U.jsxs)(`div`,{className:`flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5`,children:[(0,U.jsx)(`span`,{children:`Turn 1`}),(0,U.jsxs)(`span`,{children:[`max `,ot(r)]}),(0,U.jsxs)(`span`,{children:[`Turn `,n.length]})]})]}):null}function Dl({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,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`ui-section-title mb-2`,children:`Model Breakdown`}),(0,U.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,U.jsx)(`div`,{style:{width:`${a}%`,minWidth:a>2?void 0:`3px`,backgroundColor:`var(${r[i%r.length]})`,opacity:.7},title:`${e}: ${G(t.outputTokens)} output tokens`},e)})}),(0,U.jsx)(`div`,{className:`flex flex-wrap gap-3 mt-1.5`,children:t.map(([e,t],i)=>(0,U.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] font-mono text-terminal-dimmer`,children:[(0,U.jsx)(`div`,{className:`w-2 h-2 rounded-sm`,style:{backgroundColor:`var(${r[i%r.length]})`,opacity:.7}}),(0,U.jsxs)(`span`,{children:[e,` `,G(t.outputTokens),` (`,Math.round(t.outputTokens/n*100),`%)`]})]},e))})]})}function Ol({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,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`ui-section-title mb-1`,children:`Tool Calls per Turn`}),(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(`div`,{className:`flex items-end gap-px h-16`,onMouseLeave:()=>a(null),children:n.map((e,t)=>(0,U.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,U.jsx)(Sl,{visible:i!==null,x:i===null?0:n.length===1?.5:i/(n.length-1),children:i!==null&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`text-terminal-orange`,children:[`Turn `,i+1]}),t?.[i]&&(0,U.jsx)(`div`,{className:`text-terminal-dim truncate max-w-[200px]`,children:t[i]}),(0,U.jsxs)(`div`,{children:[n[i],` tool calls`]})]})})]}),(0,U.jsxs)(`div`,{className:`flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5`,children:[(0,U.jsx)(`span`,{children:`Turn 1`}),(0,U.jsxs)(`span`,{children:[`max `,r]}),(0,U.jsxs)(`span`,{children:[`Turn `,n.length]})]})]})}function kl({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,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`ui-section-title mb-2`,children:[`File Activity Heatmap`,i&&(0,U.jsxs)(`span`,{className:`normal-case tracking-normal font-normal ml-2`,children:[`(last `,60,` of `,r.length,` turns)`]})]}),(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`div`,{className:`grid gap-px text-[10px] font-mono`,style:{gridTemplateColumns:`minmax(80px, 120px) repeat(${a.length}, minmax(16px, 1fr))`},children:[(0,U.jsx)(`div`,{className:`text-terminal-dimmer px-1 py-0.5`}),a.map(e=>(0,U.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,U.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,U.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 Al=20;function jl({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>Al,f=d&&!n?i.slice(0,Al):i;return(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`ui-section-title mb-2`,children:`Per-Turn Breakdown`}),(0,U.jsx)(`div`,{className:`overflow-x-auto rounded border border-terminal-border-subtle`,children:(0,U.jsxs)(`table`,{className:`w-full text-[11px] font-mono border-collapse`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{className:`text-terminal-dimmer text-left`,children:[(0,U.jsx)(`th`,{className:`px-2 py-1.5 font-semibold w-7`,children:`#`}),(0,U.jsx)(`th`,{className:`px-2 py-1.5 font-semibold`,children:`Prompt`}),(0,U.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-14`,children:`Tools`}),s&&(0,U.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-16`,children:`Duration`}),c&&(0,U.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-16`,children:`Context`}),l&&(0,U.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-14`,children:`Output`})]})}),(0,U.jsx)(`tbody`,{children:f.map((e,t)=>(0,U.jsx)(Ml,{row:e,hasDuration:!!s,hasContext:!!c,hasTokens:!!l,colCount:u,showCompaction:a.has(t)},e.sceneIndex))}),d&&(0,U.jsx)(`tfoot`,{children:(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{colSpan:u,children:(0,U.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-Al} more)`})})})})]})})]})}function Ml({row:e,hasDuration:t,hasContext:n,hasTokens:r,colCount:i,showCompaction:a}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`tr`,{className:`border-t border-terminal-border-subtle hover:bg-terminal-surface-hover transition-colors`,children:[(0,U.jsx)(`td`,{className:`px-2 py-1 text-terminal-green tabular-nums`,children:String(e.index).padStart(2,`0`)}),(0,U.jsx)(`td`,{className:`px-2 py-1 text-terminal-text max-w-0`,children:(0,U.jsxs)(`div`,{className:`truncate`,title:e.text,children:[e.text,e.errorCount>0&&(0,U.jsxs)(`span`,{className:`text-terminal-red ml-1.5`,children:[e.errorCount,` err`]})]})}),(0,U.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:(0,U.jsx)(Nl,{value:e.toolCount,ratio:e.toolRatio,color:`--orange`})}),t&&(0,U.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:(0,U.jsx)(Nl,{value:e.durationMs?ot(e.durationMs):`—`,ratio:e.durationRatio,color:`--blue`})}),n&&(0,U.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:(0,U.jsx)(Nl,{value:e.contextTokens?G(e.contextTokens):`—`,ratio:e.contextRatio,color:`--cyan`})}),r&&(0,U.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:(0,U.jsx)(Nl,{value:e.outputTokens?G(e.outputTokens):`—`,ratio:e.outputRatio,color:`--green`})})]}),a&&(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{colSpan:i,className:`px-0 py-0`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-0.5 bg-terminal-red/5`,children:[(0,U.jsx)(`div`,{className:`flex-1 border-t border-dashed border-terminal-red/40`}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-red/70 shrink-0`,children:`context compacted`}),(0,U.jsx)(`div`,{className:`flex-1 border-t border-dashed border-terminal-red/40`})]})})})]})}function Nl({value:e,ratio:t,color:n}){return(0,U.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 Pl=20;function Fl({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>Pl,d=u&&!n?i.slice(0,Pl):i,f=3+(c?1:0)+(l?1:0);return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`ui-section-title mb-2`,children:[`File Impact`,(0,U.jsxs)(`span`,{className:`normal-case tracking-normal ml-1.5`,children:[`(`,e.length,` modified`,t.length>0&&`, ${t.length} read-only`,`)`]})]}),(0,U.jsx)(`div`,{className:`overflow-x-auto rounded border border-terminal-border-subtle`,children:(0,U.jsxs)(`table`,{className:`w-full text-[11px] font-mono border-collapse`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{className:`text-terminal-dimmer text-left`,children:[(0,U.jsx)(`th`,{className:`px-2 py-1.5 font-semibold`,children:`File`}),(0,U.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-14`,children:`Edits`}),(0,U.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-14`,children:`Reads`}),c&&(0,U.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-20`,children:`+/−`}),l&&(0,U.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-14`,children:`Turns`})]})}),(0,U.jsx)(`tbody`,{children:d.map(e=>{let t=e.path.split(`/`).pop()||e.path;return(0,U.jsxs)(`tr`,{className:`border-t border-terminal-border-subtle hover:bg-terminal-surface-hover transition-colors`,children:[(0,U.jsx)(`td`,{className:`px-2 py-1 max-w-0`,children:(0,U.jsxs)(`div`,{className:`truncate ${e.editCount>0?`text-terminal-text`:`text-terminal-dimmer`}`,title:e.path,children:[t,e.editCount>=10&&(0,U.jsx)(`span`,{className:`text-terminal-red ml-1`,title:`${e.editCount} edits — high churn file`,children:`⚠`}),(0,U.jsx)(`span`,{className:`text-terminal-dimmer ml-1`,children:e.path.slice(0,e.path.length-t.length-1)})]})}),(0,U.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:e.editCount>0?(0,U.jsx)(Nl,{value:e.editCount,ratio:e.editCount/a,color:`--orange`}):(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:`—`})}),(0,U.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:e.readCount>0?(0,U.jsx)(Nl,{value:e.readCount,ratio:e.readCount/o,color:`--blue`}):(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:`—`})}),c&&(0,U.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:e.linesAdded>0||e.linesRemoved>0?(0,U.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,U.jsxs)(`span`,{className:`text-terminal-green`,children:[`+`,e.linesAdded]}),(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:`/`}),(0,U.jsxs)(`span`,{className:`text-terminal-red`,children:[`−`,e.linesRemoved]})]}):(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:`—`})}),l&&(0,U.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:e.turnEdits.size>0?(0,U.jsx)(`span`,{className:`text-terminal-dim`,children:e.turnEdits.size}):(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:`—`})})]},e.path)})}),u&&(0,U.jsx)(`tfoot`,{children:(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{colSpan:f,children:(0,U.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-Pl} more)`})})})})]})})]})}function Z(e,t){return t<=0?0:Math.max(0,Math.min(t-1,e))}function Q(e,t,n){if(n<=0||t<=0)return 0;let r=Math.max(0,Math.min(1,e/t));return Z(Math.floor(r*n),n)}function Il(e,t){return t<=0?0:Math.max(0,Math.min(t,e+1))/t*100}function Ll(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 Rl({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=Z(t,e.length),o=Il(t,e.length),s=(0,_.useRef)(null),c=(0,_.useCallback)(t=>{let r=s.current;if(!r)return;let i=r.getBoundingClientRect();n(Q(t.clientX-i.left,i.width,e.length))},[e.length,n]),l=(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]),u=(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]),d=(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,U.jsxs)(`div`,{className:`px-4 pt-3 pb-1 cursor-pointer`,onClick:c,onKeyDown:d,role:`slider`,"aria-label":`Scene timeline`,"aria-valuemin":0,"aria-valuemax":e.length-1,"aria-valuenow":a,tabIndex:0,children:[(l.length>0||u.length>0)&&(0,U.jsxs)(`div`,{className:`relative h-2 mb-0.5`,children:[l.map((e,t)=>(0,U.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}`)),u.map((e,t)=>(0,U.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,U.jsxs)(`div`,{ref:s,className:`relative flex h-2 rounded-full overflow-hidden bg-terminal-surface-2`,children:[i.map((e,t)=>(0,U.jsx)(`div`,{className:`flex-1 transition-opacity duration-150`,style:{backgroundColor:Ll(e.type),opacity:e.startIndex<=a?1:.15}},t)),u.map((e,t)=>(0,U.jsx)(`div`,{className:`absolute top-0 bottom-0 w-px bg-terminal-red/60`,style:{left:`${e}%`}},`cl-${t}`)),(0,U.jsx)(`div`,{className:`absolute top-0 bottom-0 w-0.5 bg-white shadow-layer-sm transition-[left] duration-150 ease-material`,style:{left:`${o}%`}})]})]})}var zl=[{key:`replay`,label:`Replay`},{key:`summary`,label:`Insights`},{key:`export`,label:`Share & Export`}],Bl=`vr-insights-seen`;function Vl(){try{return localStorage.getItem(Bl)===`1`}catch{return!1}}function Hl(){try{localStorage.setItem(Bl,`1`)}catch{}}function Ul({activeView:e,onChangeView:t,className:n=``,rightContent:r,hiddenTabs:i}){let[a,o]=(0,_.useState)(()=>Vl()||e===`summary`),s=(0,_.useCallback)(e=>{e===`summary`&&!a&&(Hl(),o(!0)),t(e)},[t,a]);return(0,U.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,U.jsx)(`div`,{className:`flex bg-terminal-surface/30`,children:zl.filter(e=>!i?.includes(e.key)).map(({key:t,label:n})=>(0,U.jsxs)(`button`,{onClick:()=>s(t),className:`ui-section-title relative px-4 py-2 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,U.jsxs)(`span`,{className:`absolute top-1.5 right-1 flex h-2 w-2`,children:[(0,U.jsx)(`span`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-green opacity-75`}),(0,U.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-green`})]})]},t))}),r&&(0,U.jsx)(`div`,{className:`pr-4 py-1.5 flex items-center`,children:r})]})}function Wl(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 Gl(e){return e instanceof HTMLElement?e:e.parentElement}function Kl(e){return Gl(e)?.closest(`[data-scene-index]`)??null}function ql(e){let t=e.getBoundingClientRect();return t.width>0||t.height>0?t:e.getClientRects()[0]??null}function Jl(e){return e.replace(/\s+\n/g,`
117
+ `).replace(/[ \t]+/g,` `).trim()}function Yl(e){switch(e.type){case`user-prompt`:case`compaction-summary`:case`context-injection`:case`thinking`:case`text-response`:return e.content;case`tool-call`:return null}}function Xl(e,t){let n=document.createRange();return n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset),Jl(n.toString()).length}function Zl(e,t,n){if(!e||!t)return null;let r=-1,i=1/0,a=0;for(;a<=e.length;){let o=e.indexOf(t,a);if(o<0)break;let s=Math.abs(o-n);s<i&&(r=o,i=s),a=o+t.length}return r<0?null:{start:r,end:r+t.length}}function Ql({session:e,viewPrefs:t,viewerMode:n=`embedded`,activeView:r,setActiveView:i,returnToLandingRef:a,live:o}){let s=n===`readonly`,c=!!o,[l,u]=(0,_.useState)(c);(0,_.useEffect)(()=>{if(a)return a.current=()=>{u(!1),xe(!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[d,f]=(0,_.useState)(void 0),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(!1),[v,y]=(0,_.useState)(null),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)(!0),E=fi(e,n),D=mi(e,n),{effectiveSession:O}=D,{annotations:k}=E,A=_i(c?{...t,displayMode:`all`}:t),{state:j,currentIndex:M,visibleCount:N,speed:ee,play:P,pause:F,togglePlayPause:I,seekTo:L,changeSpeed:te,totalScenes:ne,userPromptIndices:R,computeNextIndex:z}=gi(e.scenes,A,l),B=(0,_.useRef)(null),[re,ie]=(0,_.useState)(`outline`),[ae,oe]=(0,_.useState)(!1),[se,V]=(0,_.useState)(!1),ce=(0,_.useRef)(null),le=(0,_.useRef)(null),ue=(0,_.useRef)(!1),[de,fe]=(0,_.useState)(!1),pe=(0,_.useCallback)(()=>{if(s||r!==`replay`){C(null);return}let t=window.getSelection(),n=B.current;if(!t||t.rangeCount===0||t.isCollapsed||!n){C(null);return}let i=t.getRangeAt(0),a=Kl(i.startContainer),o=Kl(i.endContainer);if(!a||!o||a!==o||!n.contains(a)){C(null);return}let c=Jl(t.toString());if(!c){C(null);return}let l=Number(a.dataset.sceneIndex),u=ql(i);if(!Number.isFinite(l)||!u){C(null);return}let d=c.length>4e3?`${c.slice(0,4e3).trimEnd()}...`:c,f=Yl(e.scenes[l]),p=d===c?Zl(f,d,Xl(a,i)):null;C({sceneIndex:l,selectedText:d,selectedTextStart:p?.start,selectedTextEnd:p?.end,top:Math.max(8,u.top-42),left:Math.min(window.innerWidth-112,Math.max(112,u.left+u.width/2))})},[r,s,e.scenes]);(0,_.useEffect)(()=>{if(s||r!==`replay`){C(null);return}let e=0,t=()=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,pe()})},n=()=>C(null),i=B.current;return document.addEventListener(`selectionchange`,t),document.addEventListener(`mouseup`,t),document.addEventListener(`keyup`,t),i?.addEventListener(`scroll`,n,{passive:!0}),()=>{e&&cancelAnimationFrame(e),document.removeEventListener(`selectionchange`,t),document.removeEventListener(`mouseup`,t),document.removeEventListener(`keyup`,t),i?.removeEventListener(`scroll`,n)}},[r,s,pe]),(0,_.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`?(e.preventDefault(),oe(e=>!e)):e.key===`/`?e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||(e.preventDefault(),oe(!0)):e.key===`?`?fe(e=>!e):e.key===`Escape`&&(de?fe(!1):ae&&oe(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[ae,de]);let me=R.filter(e=>e<=M).length||0,he=R.length,ge=(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 R.length>=2?R[1]:Math.min(15,e.scenes.length-1)},[R,e.scenes.length]),_e=(0,_.useCallback)((e=!0)=>{u(!0),e?setTimeout(P,300):setTimeout(()=>L(ge),100)},[P,L,ge]),ve=(0,_.useCallback)(()=>i(`summary`),[i]),ye=(0,_.useRef)(t.displayMode);(0,_.useEffect)(()=>{ye.current!==t.displayMode&&(ye.current=t.displayMode,l||(u(!0),setTimeout(()=>L(ge),100)))},[t.displayMode,l,L,ge]);let[be,xe]=(0,_.useState)(()=>new URLSearchParams(window.location.search).get(`s`)!==null);(0,_.useEffect)(()=>{!l&&r!==`replay`&&!be&&(u(!0),setTimeout(()=>L(ge),100))},[r,l,ge,L,be]);let H=(0,_.useCallback)(t=>{let n=Math.max(0,Math.min(t,e.scenes.length-1));F(),ce.current=n,f(n),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>f(void 0),2500),L(n)},[F,L,e.scenes.length]),Se=(0,_.useCallback)(e=>{let t=E.annotations.find(t=>t.id===e);if(!t)return;let n=!1,r=()=>{if(n)return;let t=B.current?.querySelector(`[data-vibe-annotation-id="${CSS.escape(e)}"]`);t instanceof HTMLElement&&(n=!0,t.scrollIntoView({behavior:`smooth`,block:`center`,inline:`nearest`}),Wl(t))};m(!0),x(e),y(null),C(null),i(`replay`),H(t.sceneIndex),requestAnimationFrame(()=>requestAnimationFrame(r)),window.setTimeout(()=>{n||r()},250)},[E.annotations,H,i]);(0,_.useEffect)(()=>{!l&&be&&(u(!0),setTimeout(()=>H(ge),100))},[l,be,ge,H]);let Ce=(0,_.useCallback)(()=>{let e=R.find(e=>e>M);e!==void 0&&H(e)},[R,M,H]),we=(0,_.useCallback)(()=>{let e=[...R].toReversed().find(e=>e<M);e!==void 0&&H(e)},[R,M,H]),Te=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(!B.current||M<0||ce.current!==null)return;if(ue.current){ue.current=!1;return}let t=B.current;if(Te.current=!0,c){t.scrollTop=t.scrollHeight,setTimeout(()=>{Te.current=!1},50);return}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(M);if(e)if(j===`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 j===`playing`&&t.scrollTo({top:t.scrollHeight,behavior:`smooth`});setTimeout(()=>{Te.current=!1},400)})},[M,j,e.scenes,c]),(0,_.useEffect)(()=>{let e=B.current;if(!e)return;let t=()=>{Te.current||j===`playing`&&F()};return e.addEventListener(`wheel`,t,{passive:!0}),e.addEventListener(`touchmove`,t,{passive:!0}),()=>{e.removeEventListener(`wheel`,t),e.removeEventListener(`touchmove`,t)}},[j,F]),(0,_.useEffect)(()=>{let t=B.current;if(!t)return;let n=!1,r=()=>{if(!(j!==`paused`||n)&&!(M>=e.scenes.length-1)&&!(Te.current||ce.current!==null)&&t.scrollHeight-t.scrollTop-t.clientHeight<80){n=!0,ue.current=!0;let e=z(M);e!==-1&&L(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)}},[j,M,e.scenes.length,L,z]),(0,_.useEffect)(()=>{let e=ce.current,t=B.current;if(e===null||!t||M!==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){Te.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`}),Wl(o),setTimeout(()=>{Te.current=!1},450),ce.current=null;return}r+=1,r<30?setTimeout(a,80):ce.current=null};return requestAnimationFrame(a),()=>{n=!0}},[M]),(0,_.useEffect)(()=>()=>{le.current&&clearTimeout(le.current)},[]);let Ee=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(M<0||!l||c)return;Ee.current&&clearTimeout(Ee.current);let e=j===`playing`?500:0;return Ee.current=setTimeout(()=>{let e=new URL(window.location.href);e.searchParams.set(`s`,String(M)),window.history.replaceState({},``,e.toString())},e),()=>{Ee.current&&clearTimeout(Ee.current)}},[M,j,l,c]);let De=(0,_.useRef)(0);(0,_.useLayoutEffect)(()=>{if(!c)return;let t=e.scenes.length;t===0||t===De.current||(De.current=t,L(t-1))},[c,e.scenes.length,L]);let Oe=n===`editor`,ke=(0,_.useMemo)(()=>k.some(e=>e.author===`vibe-feedback`),[k]);if(!l&&r===`replay`)return(0,U.jsx)(ol,{session:O,onStart:_e,onViewInsights:ve});let{meta:Ae}=e;return(0,U.jsxs)(`div`,{className:`flex flex-1 min-h-0 relative`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 min-w-0`,children:[(0,U.jsx)(Ul,{activeView:r,onChangeView:i,hiddenTabs:s?[`export`]:void 0,rightContent:r===`replay`?(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[D.overlayCount>0&&(0,U.jsxs)(`button`,{onClick:()=>D.toggleAllOriginals(),className:`ui-caption hidden md:flex items-center gap-2`,title:D.showAllOriginals?`Showing originals — click to show modified`:`Showing modified — click to show originals`,children:[(0,U.jsx)(`span`,{children:D.showAllOriginals?`Original`:`Modified`}),(0,U.jsx)(`span`,{className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors duration-200 ${D.showAllOriginals?`bg-terminal-surface border border-terminal-border`:`bg-terminal-purple brightness-75`}`,children:(0,U.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-white shadow-sm transition-transform duration-200 ${D.showAllOriginals?`translate-x-[3px]`:`translate-x-[17px]`}`})})]}),(0,U.jsxs)(`button`,{onClick:()=>{x(null),m(!0)},className:`ui-caption-strong hidden md:flex items-center gap-1.5 hover:text-terminal-green transition-colors`,title:`Open comments`,children:[(0,U.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,U.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,U.jsx)(`span`,{children:`Comments`}),E.annotations.length>0&&(0,U.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:E.annotations.length})]}),(0,U.jsxs)(`button`,{onClick:()=>{x(null),m(!0)},className:`md:hidden flex items-center gap-1 text-terminal-dim hover:text-terminal-text transition-colors`,title:`Comments`,children:[(0,U.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,U.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`})}),E.annotations.length>0&&(0,U.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:E.annotations.length})]}),Oe&&(0,U.jsxs)(`button`,{onClick:()=>g(!0),className:`ui-pill-compact hidden md:flex pl-2 pr-3 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 relative overflow-hidden group shadow-sm`,children:[(0,U.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,U.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,U.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,U.jsx)(`span`,{className:`font-semibold`,children:`AI Studio`}),(ke||D.overlayCount>0)&&(0,U.jsxs)(`span`,{className:`relative flex h-1.5 w-1.5`,children:[(0,U.jsx)(`span`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-purple opacity-75`}),(0,U.jsx)(`span`,{className:`relative inline-flex rounded-full h-1.5 w-1.5 bg-terminal-purple`})]})]})]}):void 0}),(0,U.jsxs)(`div`,{className:`flex flex-1 min-h-0 min-w-0 w-full`,children:[r===`replay`&&(0,U.jsxs)(`div`,{className:`flex flex-1 min-h-0 min-w-0 w-full relative`,children:[w&&(0,U.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,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto min-h-0`,children:[(0,U.jsxs)(`div`,{className:`px-3 py-2 border-b border-terminal-border-subtle flex items-center justify-between group/side`,children:[(0,U.jsx)(`span`,{className:`ui-section-title`,children:`Outline`}),(0,U.jsx)(`button`,{onClick:()=>T(!1),className:`p-1 rounded hover:bg-terminal-surface text-terminal-dimmer hover:text-terminal-text transition-colors`,title:`Hide Sidebar`,children:(0,U.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,U.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}),(0,U.jsx)(`line`,{x1:`9`,x2:`9`,y1:`3`,y2:`21`})]})})]}),(0,U.jsx)(sl,{scenes:e.scenes,currentIndex:M,onSeek:H,overlayActions:D,turnStats:e.meta.stats.turnStats})]}),(0,U.jsxs)(`div`,{className:`shrink-0 border-t border-terminal-border-subtle overflow-y-auto max-h-[35%]`,children:[(0,U.jsx)(`div`,{className:`px-3 py-2 border-b border-terminal-border-subtle`,children:(0,U.jsx)(`button`,{onClick:()=>i(`summary`),className:`ui-section-title hover:text-terminal-green transition-colors`,title:`Open Insights view`,children:`Stats`})}),(0,U.jsxs)(`div`,{className:`p-3`,children:[(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,U.jsx)(at,{label:`Turns`,value:Ae.stats.userPrompts,color:`text-terminal-green`}),(0,U.jsx)(at,{label:`Tools`,value:Ae.stats.toolCalls,color:`text-terminal-orange`})]}),(0,U.jsxs)(`div`,{className:`mt-2 text-xs font-mono text-terminal-dim space-y-0.5`,children:[Ae.model&&(0,U.jsx)(`div`,{children:(0,U.jsx)(`span`,{className:`text-terminal-text`,children:Ae.model})}),Ae.stats.durationMs&&(0,U.jsxs)(`div`,{children:[ot(Ae.stats.durationMs),Ae.stats.costEstimate!==void 0&&(0,U.jsxs)(`span`,{children:[` / `,(0,U.jsxs)(`span`,{className:`text-terminal-green`,children:[`$`,Ae.stats.costEstimate<.01?Ae.stats.costEstimate.toFixed(4):Ae.stats.costEstimate.toFixed(2)]})]})]}),Ae.stats.tokenUsage&&(0,U.jsxs)(`div`,{children:[G(Ae.stats.tokenUsage.inputTokens),` in /`,` `,G(Ae.stats.tokenUsage.outputTokens),` out`]}),(()=>{if(!Ae.stats.turnStats?.length)return null;let e=Math.max(...Ae.stats.turnStats.map(e=>e.contextTokens||0));return e<=0?null:(0,U.jsxs)(`div`,{className:`text-terminal-dim mt-0.5`,children:[`peak ctx: `,(0,U.jsx)(`span`,{className:`text-terminal-cyan`,children:G(e)})]})})()]})]})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 min-w-0 relative`,children:[!w&&(0,U.jsx)(`button`,{onClick:()=>T(!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,U.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,U.jsx)(`polyline`,{points:`9 18 15 12 9 6`})})}),(0,U.jsx)(`div`,{ref:B,"data-replay-scroll-container":!0,className:`flex-1 overflow-y-auto overflow-x-hidden px-5 py-5 pb-10 overscroll-contain`,children:(0,U.jsx)(Mc,{scenes:e.scenes,visibleCount:c?e.scenes.length:N,currentIndex:M,effectivePrefs:A,focusIndex:d,annotatedScenes:E.annotatedScenes,annotationCounts:E.annotationCounts,annotations:E.annotations,onAnnotationClick:Se,onSeek:H,state:j,overlayActions:D,turnStats:e.meta.stats.turnStats,isLive:c,liveCursorDiagnostics:o?.cursorDiagnostics,liveCursorProbeAt:o?.lastCursorProbe,liveCursorRowsChanged:o?.cursorRowsChanged,liveSessionState:o?.sessionState,onComment:s?void 0:e=>{m(!0),y({sceneIndex:e}),x(null),C(null)}})}),S&&(0,U.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{y({sceneIndex:S.sceneIndex,selectedText:S.selectedText,selectedTextStart:S.selectedTextStart,selectedTextEnd:S.selectedTextEnd}),m(!0),x(null),C(null),window.getSelection()?.removeAllRanges()},className:`fixed z-50 -translate-x-1/2 rounded-full border border-terminal-blue/40 bg-terminal-bg px-3 py-1.5 text-xs font-mono font-semibold text-terminal-blue shadow-layer-lg backdrop-blur-md transition-colors hover:bg-terminal-blue-subtle hover:text-terminal-text`,style:{top:S.top,left:S.left},children:`Annotate selection`}),(0,U.jsx)(fl,{scenes:O.scenes,open:ae,onClose:()=>oe(!1),onSeek:e=>{H(e),oe(!1)}})]})]}),r===`summary`&&(0,U.jsx)(yl,{session:O}),r===`export`&&(0,U.jsx)(nl,{actions:E,viewerMode:n,readOnly:s,session:O})]}),r===`replay`&&(0,U.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,U.jsx)(Rl,{scenes:e.scenes,currentIndex:M,onSeek:H,annotatedScenes:E.annotatedScenes}),(0,U.jsx)(_o,{state:j,speed:ee,currentIndex:M,totalScenes:ne,userPromptCount:he,currentTurn:me,onTogglePlayPause:I,onChangeSpeed:te,onPrevPrompt:we,onNextPrompt:Ce,onOpenSearch:()=>oe(!0),onOpenOutline:()=>V(!0),onShowHelp:()=>fe(!0)})]})]}),(0,U.jsx)(ho,{open:p,onClose:()=>m(!1),actions:E,scenes:O.scenes,currentIndex:M,onSeek:H,onSelectAnnotation:Se,addingForScene:v?.sceneIndex??null,addingSelectedText:v?.selectedText??null,addingSelectedTextStart:v?.selectedTextStart??null,addingSelectedTextEnd:v?.selectedTextEnd??null,focusedAnnotationId:b,onClearAddingTarget:()=>y(null),readOnly:s}),(0,U.jsx)(Oi,{open:h,onClose:()=>g(!1),annotationActions:E,overlayActions:D}),(0,U.jsxs)(`div`,{className:`fixed inset-0 z-40 md:hidden transition-opacity duration-300 ${se?`opacity-100`:`opacity-0 pointer-events-none`}`,onClick:()=>V(!1),children:[(0,U.jsx)(`div`,{className:`absolute inset-0 bg-black/40`}),(0,U.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 ${se?`translate-y-0`:`translate-y-full`}`,onClick:e=>e.stopPropagation(),children:[(0,U.jsx)(`div`,{className:`flex justify-center py-2.5 shrink-0`,children:(0,U.jsx)(`div`,{className:`w-10 h-1 rounded-full bg-terminal-border`})}),(0,U.jsxs)(`div`,{className:`flex border-b border-terminal-border-subtle shrink-0`,children:[(0,U.jsx)(`button`,{onClick:()=>ie(`outline`),className:`ui-section-title flex-1 px-3 py-2.5 transition-colors ${re===`outline`?`text-terminal-green border-b-2 border-terminal-green`:`text-terminal-dim hover:text-terminal-text`}`,children:`Outline`}),(0,U.jsxs)(`button`,{onClick:()=>ie(`comments`),className:`ui-section-title flex-1 px-3 py-2.5 transition-colors ${re===`comments`?`text-terminal-green border-b-2 border-terminal-green`:`text-terminal-dim hover:text-terminal-text`}`,children:[`Comments`,E.annotations.length>0&&(0,U.jsxs)(`span`,{className:`ml-1.5 text-terminal-dimmer`,children:[`(`,E.annotations.length,`)`]})]})]}),(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain`,children:re===`outline`?(0,U.jsx)(sl,{scenes:e.scenes,currentIndex:M,onSeek:e=>{H(e),V(!1)},overlayActions:D,turnStats:e.meta.stats.turnStats}):(0,U.jsx)(po,{actions:E,scenes:O.scenes,currentIndex:M,onSeek:e=>{H(e)},onSelectAnnotation:e=>{Se(e),V(!1)},addingForScene:v?.sceneIndex??null,addingSelectedText:v?.selectedText??null,addingSelectedTextStart:v?.selectedTextStart??null,addingSelectedTextEnd:v?.selectedTextEnd??null,focusedAnnotationId:b,onClearAddingTarget:()=>y(null),readOnly:s})})]})]}),(0,U.jsx)(il,{open:de,onClose:()=>fe(!1)})]})}function $l(){let[e,t]=(0,_.useState)({status:`loading`}),n=(0,_.useRef)(null),r=(0,_.useCallback)(()=>{n.current&&=(n.current.close(),null)},[]),i=(0,_.useCallback)(()=>{r(),t({status:`loading`});let e=tu();if(e&&eu()){nu(e,n,t);return}ru().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)}))},[r]);return(0,_.useEffect)(()=>{i();let e=()=>i();return window.addEventListener(`popstate`,e),()=>{window.removeEventListener(`popstate`,e),r()}},[i,r]),e}function eu(){return!!window.__VIBE_REPLAY_EDITOR__}function tu(){let e=new URLSearchParams(window.location.search);if(e.get(`live`)!==`1`||e.get(`view`)===`dashboard`||e.get(`session`))return null;let t=e.get(`provider`),n=e.get(`sessionId`);return!t||!n||!/^[a-zA-Z0-9_.-]{1,64}$/.test(t)||!/^[a-zA-Z0-9_.-]{1,128}$/.test(n)?null:{provider:t,sessionId:n}}function nu(e,t,n){let r=`/api/live?provider=${encodeURIComponent(e.provider)}&sessionId=${encodeURIComponent(e.sessionId)}`,i=new EventSource(r);t.current=i;let a=null,o={state:`connecting`,scenes:0},s=()=>{t.current===i&&(a?n({status:`ready`,session:a,mode:`editor`,live:o}):o.state===`error`&&o.error&&n({status:`error`,message:o.error}))};i.onopen=()=>{o={...o,state:`open`,error:void 0},s()},i.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}t.type===`session`&&t.session?(a=t.session,o={state:`open`,scenes:t.session.scenes.length,lastUpdate:Date.now(),error:void 0,sessionState:t.state??o.sessionState,cursorDiagnostics:t.cursorDiagnostics??o.cursorDiagnostics,cursorRowsChanged:t.cursorRowsChanged??o.cursorRowsChanged,lastCursorProbe:t.cursorDiagnostics?Date.now():o.lastCursorProbe},s()):t.type===`diagnostics`&&t.cursorDiagnostics?(o={...o,state:`open`,cursorDiagnostics:t.cursorDiagnostics,cursorRowsChanged:t.cursorRowsChanged,lastCursorProbe:Date.now()},s()):t.type===`state`&&t.state?(o={...o,sessionState:t.state},s()):t.type===`error`&&(o={...o,state:`error`,error:t.message||`Live stream error`},s())},i.onerror=()=>{o={...o,state:`error`,error:o.error||`Disconnected`},s()}}async function ru(){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 au(n.gistId);return{session:await iu(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 au(n),r=await iu(e);return fetch(`https://vibe-replay.com/api/cloud-replays/view-gist/${n}`,{method:`POST`}).catch(()=>{}),{session:r,mode:`readonly`,gistOwner:t}}if(eu()){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 iu(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 iu(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 au(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 ou(){let[e,t]=(0,_.useState)(()=>{let e=new URLSearchParams(window.location.search).get(`theme`);if(e===`light`||e===`dark`)return e;let t=y(localStorage,`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`),b(localStorage,`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 su(){let e=new URLSearchParams(window.location.search).get(`v`);return e===`summary`||e===`export`?e:`replay`}var cu=`https://vibe-replay.com`;function lu({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`:`${cu}/api/auth/get-session`,r=``;if(!e)try{r=new URL(cu).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,U.jsxs)(`div`,{className:`relative`,ref:a,children:[(0,U.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,U.jsx)(`img`,{src:t.user.image,alt:``,className:`w-full h-full rounded-full object-cover`}):(0,U.jsx)(`span`,{className:`text-[10px] text-terminal-dim`,children:`?`})}),r&&(0,U.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,U.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,U.jsx)(`button`,{type:`button`,onClick:async()=>{let t=e?`/api/auth/sign-out`:`${cu}/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,U.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(`${cu}/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`:`${cu}/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,U.jsx)(`svg`,{className:`w-3.5 h-3.5`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,U.jsx)(`path`,{d:`M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z`})}),`Sign in`]}):null}function uu(){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,U.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,U.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2`,children:[(0,U.jsx)(`svg`,{className:`w-3.5 h-3.5`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,U.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,U.jsx)(`span`,{className:`inline-flex items-center px-2 h-full border-l border-terminal-border`,children:e})]})}function du(){let e=$l(),{theme:t,toggleTheme:n}=ou(),{prefs:r,updatePref:i,togglePref:a}=xi(),o=e.status===`ready`?e.session:null,s=e.status===`ready`?e.mode:`embedded`,c=e.status===`ready`?e.gistOwner:void 0,l=e.status===`ready`?e.live:void 0,u=s===`editor`,[d,f]=(0,_.useState)(su()),p=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=()=>f(su());return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let m=e=>{f(e),V({v:e===`replay`?null:e})},h=(0,_.useMemo)(()=>o?.scenes.some(e=>e.type===`thinking`)??!1,[o]),[g,y]=(0,_.useState)(!1);(0,_.useEffect)(()=>{if(!g)return;let e=e=>{e.key===`Escape`&&y(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[g]);let[b,x]=(0,_.useState)(!1),S=(0,_.useRef)(null);if((0,_.useEffect)(()=>{r.displayMode!==`custom`&&x(!1)},[r.displayMode]),v(S,(0,_.useCallback)(()=>x(!1),[]),b),e.status===`loading`)return(0,U.jsx)(`div`,{className:`h-screen bg-terminal-bg flex items-center justify-center`,children:(0,U.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,U.jsx)(`div`,{className:`text-terminal-green font-sans font-bold text-sm animate-pulse`,children:`LOADING SESSION...`}),(0,U.jsx)(`div`,{className:`text-terminal-dimmer font-mono text-xs`,children:`Preparing replay data`})]})});if(e.status===`error`)return(0,U.jsx)(`div`,{className:`h-screen bg-terminal-bg flex items-center justify-center`,children:(0,U.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,U.jsx)(`div`,{className:`text-terminal-red font-mono text-sm`,children:e.message}),(0,U.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,U.jsx)(`div`,{className:`h-screen bg-terminal-bg flex flex-col overflow-hidden`,children:(0,U.jsx)(Wr,{headerLeft:(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 shrink-0`,children:[(0,U.jsx)(`button`,{onClick:()=>V({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,U.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,U.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-terminal-green animate-pulse`}),`Local`,(0,U.jsx)(`span`,{className:`instant-tooltip-text`,children:`v0.2.4\nViewer ${window.location.host}
118
+ Cloud https://vibe-replay.com`})]})]}),headerRight:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,U.jsx)(uu,{}),(0,U.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,U.jsx)(lu,{isEditor:!0})]})})});let{meta:C}=o;return(0,U.jsxs)(`div`,{className:`h-screen bg-terminal-bg flex flex-col overflow-hidden`,children:[(0,U.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,U.jsxs)(`div`,{className:`flex items-center gap-2.5 shrink-0`,children:[u?(0,U.jsx)(`button`,{onClick:()=>V({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,U.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`}),u&&(0,U.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,U.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-terminal-green animate-pulse`}),`Local`,(0,U.jsx)(`span`,{className:`instant-tooltip-text`,children:`v0.2.4\nViewer ${window.location.host}
119
+ Cloud https://vibe-replay.com`})]}),l&&(0,U.jsxs)(`span`,{className:`instant-tooltip inline-flex items-center gap-1 text-[9px] font-sans font-bold px-2 py-0.5 rounded-full uppercase tracking-wider border ${l.state===`open`?`bg-terminal-red/10 text-terminal-red border-terminal-red/20`:`bg-terminal-dim/10 text-terminal-dim border-terminal-dim/20`}`,children:[(0,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ${l.state===`open`?`bg-terminal-red animate-pulse`:`bg-terminal-dim`}`}),l.state===`open`?`Live`:l.state===`connecting`?`Connecting`:`Offline`,(0,U.jsx)(`span`,{className:`instant-tooltip-text`,children:l.state===`open`?`Streaming ${l.scenes} scene${l.scenes===1?``:`s`}${l.lastUpdate?`\nLast update ${new Date(l.lastUpdate).toLocaleTimeString()}`:``}`:l.error||`Reconnecting...`})]})]}),u&&(0,U.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,U.jsx)(`button`,{onClick:()=>V({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))}),C.title&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,U.jsx)(`span`,{className:`text-terminal-border/40 text-sm select-none hidden md:inline`,children:`|`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>{p.current?.(),m(`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:C.title}),c&&(0,U.jsxs)(`div`,{className:`hidden sm:flex items-center gap-1.5 text-xs font-mono text-terminal-dim`,children:[(0,U.jsx)(`span`,{className:`text-terminal-border`,children:`·`}),(0,U.jsx)(`span`,{className:`text-terminal-dimmer`,children:`shared by`}),(0,U.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,U.jsx)(`div`,{className:`flex-1`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 md:gap-2 shrink-0`,children:[(0,U.jsxs)(`div`,{ref:S,className:`hidden md:flex items-center gap-1.5`,children:[(0,U.jsxs)(`div`,{className:`relative flex items-center`,children:[(0,U.jsxs)(`div`,{className:`flex items-center h-7 rounded-md overflow-hidden bg-terminal-surface`,children:[(0,U.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,U.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,U.jsx)(`button`,{onClick:()=>{i(`displayMode`,`custom`),x(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`})]}),b&&r.displayMode===`custom`&&(0,U.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,U.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,U.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,U.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,U.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`]}),h&&(0,U.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,U.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,U.jsx)(uu,{}),(0,U.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`?`☾`:`☀`}),u&&(0,U.jsx)(lu,{isEditor:u})]}),(0,U.jsx)(`button`,{onClick:()=>y(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:g?(0,U.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,strokeWidth:`2`,children:(0,U.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 18L18 6M6 6l12 12`})}):(0,U.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,strokeWidth:`2`,children:(0,U.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5`})})})]}),g&&(0,U.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,U.jsxs)(`div`,{className:`px-5 py-4 space-y-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-sans font-medium text-terminal-dim`,children:`Display`}),(0,U.jsx)(`div`,{className:`flex items-center h-8 rounded-lg overflow-hidden bg-terminal-surface`,children:[`all`,`compact`,`custom`].map(e=>(0,U.jsx)(`button`,{onClick:()=>{i(`displayMode`,e),e!==`custom`&&y(!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,U.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,U.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,U.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`}),h&&(0,U.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,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-sans font-medium text-terminal-dim`,children:`Theme`}),(0,U.jsxs)(`button`,{onClick:()=>{n(),y(!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,U.jsx)(`span`,{children:t===`dark`?`Light`:`Dark`})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-sans font-medium text-terminal-dim`,children:`GitHub`}),(0,U.jsx)(uu,{})]})]})})]}),g&&(0,U.jsx)(`div`,{className:`md:hidden fixed inset-0 z-30 bg-black/30`,onClick:()=>y(!1)}),(0,U.jsx)(Ql,{session:o,viewPrefs:r,viewerMode:s,activeView:d,setActiveView:m,returnToLandingRef:p,live:l})]})}g.createRoot(document.getElementById(`root`)).render((0,U.jsx)(_.StrictMode,{children:(0,U.jsx)(du,{})}));</script>
120
+ <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%!important}.container{width:100%}@media (min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.ui-section-title{font-family:var(--font-sans);letter-spacing:.025em;color:var(--dim);font-size:.75rem;font-weight:600;line-height:1rem}.ui-section-title-strong{font-family:var(--font-sans);letter-spacing:.025em;color:var(--text);font-size:.75rem;font-weight:600;line-height:1rem}.ui-caption{font-family:var(--font-sans);color:var(--dim);font-size:.75rem;line-height:1.625}.ui-caption-muted{font-family:var(--font-sans);color:var(--dimmer);font-size:.75rem;line-height:1.625}.ui-caption-strong{font-family:var(--font-sans);color:var(--text);font-size:.75rem;font-weight:500;line-height:1.625}.ui-pill{font-family:var(--font-sans);border-radius:.375rem;align-items:center;gap:.25rem;padding:.125rem .375rem;font-size:.75rem;line-height:1.25rem;display:inline-flex}.ui-pill-compact{font-family:var(--font-sans);border-radius:9999px;align-items:center;gap:.25rem;padding:.125rem .375rem;font-size:11px;line-height:1rem;display:inline-flex}.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-0{top:0;bottom: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-20{bottom:5rem}.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-0{height:0}.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-11{max-height:2.75rem}.max-h-20{max-height:5rem}.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-80{max-height:20rem}.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-7{min-height:1.75rem}.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-\[calc\(100vw-2rem\)\]{width:calc(100vw - 2rem)}.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-32{max-width:8rem}.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-\[220px\]{max-width:220px}.max-w-\[240px\]{max-width:240px}.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-1\/2{--tw-translate-x:-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-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-y-3{--tw-translate-y:-.75rem;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-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-2\.5{-moz-column-gap:.625rem;column-gap:.625rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-x-3\.5{-moz-column-gap:.875rem;column-gap:.875rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-5{-moz-column-gap:1.25rem;column-gap:1.25rem}.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-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-cyan{border-color:var(--cyan)}.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-\[\#050807\]{--tw-bg-opacity:1;background-color:rgb(5 8 7/var(--tw-bg-opacity,1))}.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-black\/70{background-color:#000000b3}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/20{background-color:#3b82f633}.bg-current{background-color:currentColor}.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-cyan{background-color:var(--cyan)}.bg-terminal-cyan-subtle{background-color:var(--cyan-subtle)}.bg-terminal-dim{background-color:var(--dim)}.bg-terminal-dimmer{background-color:var(--dimmer)}.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-sienna{background-color:var(--sienna)}.bg-terminal-sienna-subtle{background-color:var(--sienna-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-terminal-yellow{background-color:var(--yellow)}.bg-terminal-yellow-subtle{background-color:var(--yellow-subtle)}.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-2\.5{padding-left:.625rem}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.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-10{padding-top:2.5rem}.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-4{line-height:1rem}.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-\[0\.15em\]{letter-spacing:.15em}.tracking-\[0\.25em\]{letter-spacing:.25em}.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-cyan{color:var(--cyan)}.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-sienna{color:var(--sienna)}.text-terminal-text{color:var(--text)}.text-terminal-yellow{color:var(--yellow)}.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-\[inset_0_0_0_1px_rgba\(96\,165\,250\,0\.16\)\]{--tw-shadow:inset 0 0 0 1px #60a5fa29;--tw-shadow-colored:inset 0 0 0 1px 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)}.\[scrollbar-gutter\:stable\]{scrollbar-gutter:stable}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;--sienna:#e07a3e;--sienna-subtle:#e07a3e26;--sienna-emphasis:#e07a3e40;--yellow:#f0cb35;--yellow-subtle:#f0cb3526;--yellow-emphasis:#f0cb3540;--red:#f85149;--red-subtle:#f8514926;--red-emphasis:#f8514940;--purple:#b392f0;--purple-subtle:#b392f026;--purple-emphasis:#b392f040;--cyan:#56d4dd;--cyan-subtle:#56d4dd26;--cyan-emphasis:#56d4dd40;--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;--sienna:#b8501f;--sienna-subtle:#b8501f1a;--sienna-emphasis:#b8501f33;--yellow:#9e7700;--yellow-subtle:#9e77001a;--yellow-emphasis:#9e770033;--red:#cf222e;--red-subtle:#cf222e1a;--red-emphasis:#cf222e33;--purple:#8250df;--purple-subtle:#8250df1a;--purple-emphasis:#8250df33;--cyan:#0e7c86;--cyan-subtle:#0e7c861a;--cyan-emphasis:#0e7c8633;--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}.turn-sticky-summary{background-color:var(--surface);background-image:linear-gradient(var(--green-subtle), var(--green-subtle))}@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-dim{color:var(--dim)}.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\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.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\,1\.25fr\)_minmax\(320px\,0\.75fr\)\]{grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr)}.lg\:grid-cols-\[minmax\(0\,1fr\)_22rem\]{grid-template-columns:minmax(0,1fr) 22rem}.lg\:grid-cols-\[minmax\(280px\,0\.72fr\)_minmax\(0\,1\.28fr\)\]{grid-template-columns:minmax(280px,.72fr) minmax(0,1.28fr)}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:items-stretch{align-items:stretch}.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%}
111
121
  /*$vite$:1*/</style>
112
122
  </head>
113
123
  <body class="bg-terminal-bg text-terminal-text min-h-screen">