vibe-replay 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/viewer.html +40 -39
- package/dist/index.js +1201 -392
- package/package.json +2 -2
package/assets/viewer.html
CHANGED
|
@@ -5,29 +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 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 P(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 ee(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:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(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:ee}},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 P(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?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var ee=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},ne=[],L=-1;function R(e){return{current:e}}function z(e){0>L||(e.current=ne[L],ne[L]=null,L--)}function B(e,t){L++,ne[L]=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 ce(){z(re),z(ie),z(ae)}function le(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 ue(e){ie.current===e&&(z(re),z(ie)),oe.current===e&&(z(oe),Qf._currentValue=te)}var de,fe;function pe(e){if(de===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);de=t&&t[1]||``,fe=-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 P(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 ee(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:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(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:ee}},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 P(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?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var ee=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function L(e){return{current:e}}function R(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function z(e,t){re++,ne[re]=e.current,e.current=t}var ie=L(null),ae=L(null),oe=L(null),se=L(null);function ce(e,t){switch(z(oe,t),z(ae,e),z(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}R(ie),z(ie,e)}function le(){R(ie),R(ae),R(oe)}function ue(e){e.memoizedState!==null&&z(se,e);var t=ie.current,n=Hd(t,e.type);t!==n&&(z(ae,e),z(ie,n))}function de(e){ae.current===e&&(R(ie),R(ae)),se.current===e&&(R(se),Qf._currentValue=te)}var fe,pe;function me(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,pe=-1<e.stack.indexOf(`
|
|
9
9
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
10
|
-
`+
|
|
10
|
+
`+fe+e+pe}var he=!1;function ge(e,t){if(!e||he)return``;he=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
11
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{
|
|
13
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{he=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?me(n):``}function _e(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me(`Lazy`);case 13:return e.child!==t&&t!==null?me(`Suspense Fallback`):me(`Suspense`);case 19:return me(`SuspenseList`);case 0:case 15:return ge(e.type,!1);case 11:return ge(e.type.render,!1);case 1:return ge(e.type,!0);case 31:return me(`Activity`);default:return``}}function ve(e){try{var t=``,n=null;do t+=_e(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
14
14
|
Error generating stack: `+e.message+`
|
|
15
|
-
`+e.stack}}var ve=Object.prototype.hasOwnProperty,ye=t.unstable_scheduleCallback,be=t.unstable_cancelCallback,xe=t.unstable_shouldYield,Se=t.unstable_requestPaint,V=t.unstable_now,Ce=t.unstable_getCurrentPriorityLevel,we=t.unstable_ImmediatePriority,H=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 U(e){if(typeof Oe==`function`&&ke(e),je&&typeof je.setStrictMode==`function`)try{je.setStrictMode(Ae,e)}catch{}}var Me=Math.clz32?Math.clz32:Fe,Ne=Math.log,Pe=Math.LN2;function Fe(e){return e>>>=0,e===0?32:31-(Ne(e)/Pe|0)|0}var W=256,Ie=262144,Le=4194304;function Re(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 ze(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=Re(n))):i=Re(o):i=Re(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Re(n))):i=Re(o)):i=Re(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 Be(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ve(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 He(){var e=Le;return Le<<=1,!(Le&62914560)&&(Le=4194304),e}function Ue(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function We(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ge(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-Me(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&&Ke(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ke(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Me(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function qe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Me(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Je(e,t){var n=t&-t;return n=n&42?1:Ye(n),(n&(e.suspendedLanes|t))===0?n:0}function Ye(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 Xe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ze(){var e=I.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function Qe(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var $e=Math.random().toString(36).slice(2),et=`__reactFiber$`+$e,tt=`__reactProps$`+$e,nt=`__reactContainer$`+$e,rt=`__reactEvents$`+$e,it=`__reactListeners$`+$e,at=`__reactHandles$`+$e,ot=`__reactResources$`+$e,st=`__reactMarker$`+$e;function ct(e){delete e[et],delete e[tt],delete e[rt],delete e[it],delete e[at]}function lt(e){var t=e[et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nt]||n[et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[et])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function ut(e){if(e=e[et]||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 ve.call(bt,e)?!0:ve.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(ee(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[tt]||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[tt]||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[tt]||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(!ve.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`),G=Nr(`transitioncancel`),zr=Nr(`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),gt(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-Me(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:_e(t)},ui.set(e,t),t):n}return{value:e,source:t,stack:_e(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-Me(r)-1;r&=~(1<<i),n+=1;var a=32-Me(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,yi=1<<32-Me(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(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[et]=e,t[tt]=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=R(null),zi=null,Bi=null;function Vi(e,t,n){B(Ri,t._currentValue),t._currentValue=n}function Hi(e){e._currentValue=Ri.current,z(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===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&&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=F.S;F.S=function(e,t){Ql=V(),typeof t==`object`&&t&&typeof t.then==`function`&&sa(e,t),ua!==null&&ua(e,t)};var q=R(null);function da(){var e=q.current;return e===null?Fl.pooledCache:e}function fa(e,t){t===null?B(q,q.current):B(q,t.pool)}function pa(){var e=da();return e===null?null:{parent:ea._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(qt,qt),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(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,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(ee(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,Yi(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(ee(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,Yi(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(ee(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,Yi(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(ee(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,Yi(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,X&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,qe(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;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===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: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,ao=null,oo=null,so=!1,co=!1,lo=!1,uo=0,fo=0,po=null,mo=0;function ho(){throw Error(i(321))}function go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!gr(e[n],t[n]))return!1;return!0}function _o(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?Ns:Ps,lo=!1,a=n(r,i),lo=!1,co&&(a=yo(t,n,r,i)),vo(e),a}function vo(e){F.H=Ms;var t=ao!==null&&ao.next!==null;if(io=0,oo=ao=J=null,so=!1,fo=0,po=null,t)throw Error(i(300));e===null||Zs||(e=e.dependencies,e!==null&&Ki(e)&&(Zs=!0))}function yo(e,t,n,r){J=e;var a=0;do{if(co&&(po=null),fo=0,co=!1,25<=a)throw Error(i(301));if(a+=1,oo=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)}F.H=Fs,o=t(n,r)}while(co);return o}function bo(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?Eo(t):t,e=e.useState()[0],(ao===null?null:ao.memoizedState)!==e&&(J.flags|=1024),t}function xo(){var e=uo!==0;return uo=0,e}function So(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Y(e){if(so){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}so=!1}io=0,oo=ao=J=null,co=!1,fo=uo=0,po=null}function Co(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return oo===null?J.memoizedState=oo=e:oo=oo.next=e,oo}function wo(){if(ao===null){var e=J.alternate;e=e===null?null:e.memoizedState}else e=ao.next;var t=oo===null?J.memoizedState:oo.next;if(t!==null)oo=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},oo===null?J.memoizedState=oo=e:oo=oo.next=e}return oo}function To(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Eo(e){var t=fo;return fo+=1,po===null&&(po=[]),e=ya(po,e,t),t=J,(oo===null?t.memoizedState:oo.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?Ns:Ps),e}function Do(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Eo(e);if(e.$$typeof===C)return 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]=A;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,lo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,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)&&(Zs=!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)||(Zs=!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,Zs=!0),a=a.queue,is(Io.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||oo!==null&&oo.memoizedState.tag&1){if(r.flags|=2048,$o(9,{destroy:void 0},Fo.bind(null,r,a,n,t),null),Fl===null)throw Error(i(349));o||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=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(),lo){U(!0);try{n()}finally{U(!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(ks(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ho(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ho(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Uo(e,t,s)}catch(n){Go(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Uo(e,t,a)}catch(n){Go(e,t,n)}}function Uo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Wo(e,t,n)},function(n){return Go(e,t,n)}):Wo(e,t,n)}function Wo(e,t,n){t.status=`fulfilled`,t.value=n,Ko(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ho(e,n)))}function Go(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ko(t),t=t.next;while(t!==r)}e.action=null}function Ko(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qo(e,t){return t}function Jo(e,t){if(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=Os.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(),ao,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=ao;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;ao!==null&&r!==null&&go(r,ao.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(X&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ss(e,t){return ns(4,2,e,t)}function cs(e,t){return ns(4,4,e,t)}function ls(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function us(e,t,n){n=n==null?null:n.concat([e]),ns(4,4,ls.bind(null,t,e),n)}function ds(){}function fs(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ps(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&go(t,r[1]))return r[0];if(r=e(),lo){U(!0);try{e()}finally{U(!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 gr(n,t)?n:Wa.current===null?!(io&42)||io&1073741824&&!(Q&261930)?(Zs=!0,e.memoizedState=n):(e=fu(),J.lanes|=e,Ul|=e,t):(e=ms(e,n,r),gr(e,t)||(Zs=!0),e)}function gs(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};F.T=s,Os(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ds(e,t,la(c,r),du(e)):Ds(e,t,r,du(e))}catch(n){Ds(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function _s(){}function vs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ys(e).queue;gs(e,a,t,te,n===null?_s:function(){return bs(e),n(r)})}function ys(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bs(e){var t=ys(e);t.next===null&&(t=e.alternate.memoizedState),Ds(e,t.next.queue,{},du())}function xs(){return Ji(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:ta()},e.payload=t;return}t=t.return}}function Ts(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ks(e)?As(t,n):(n=Yr(e,t,n,r),n!==null&&(pu(n,e,r),js(n,t,r)))}function Es(e,t,n){Ds(e,t,n,du())}function Ds(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ks(e))As(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,gr(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),js(n,t,r),!0}return!1}function Os(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ks(e)){if(t)throw Error(i(479))}else t=Yr(e,n,r,2),t!==null&&pu(t,e,2)}function ks(e){var t=e.alternate;return e===J||t!==null&&t===J}function As(e,t){co=so=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function js(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}var Ms={readContext:Ji,use:Do,useCallback:ho,useContext:ho,useEffect:ho,useImperativeHandle:ho,useLayoutEffect:ho,useInsertionEffect:ho,useMemo:ho,useReducer:ho,useRef:ho,useState:ho,useDebugValue:ho,useDeferredValue:ho,useTransition:ho,useSyncExternalStore:ho,useId:ho,useHostTransitionStatus:ho,useFormState:ho,useActionState:ho,useOptimistic:ho,useMemoCache:ho,useCacheRefresh:ho};Ms.useEffectEvent=ho;var Ns={readContext:Ji,use:Do,useCallback:function(e,t){return Co().memoizedState=[e,t===void 0?null:t],e},useContext:Ji,useEffect:rs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ts(4194308,4,ls.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ts(4194308,4,e,t)},useInsertionEffect:function(e,t){ts(4,2,e,t)},useMemo:function(e,t){var n=Co();t=t===void 0?null:t;var r=e();if(lo){U(!0);try{e()}finally{U(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Co();if(n!==void 0){var i=n(t);if(lo){U(!0);try{n(t)}finally{U(!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-Me(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=uo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=mo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:xs,useFormState:Jo,useActionState:Jo,useOptimistic:function(e){var t=Co();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Os.bind(null,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(X&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ps={readContext:Ji,use:Do,useCallback:fs,useContext:Ji,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(),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:Ss,useHostTransitionStatus:xs,useFormState:Yo,useActionState:Yo,useOptimistic:function(e,t){return Bo(wo(),ao,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};Ps.useEffectEvent=os;var Fs={readContext:Ji,use:Do,useCallback:fs,useContext:Ji,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 ao===null?ms(n,e,t):hs(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:Ss,useHostTransitionStatus:xs,useFormState:Qo,useActionState:Qo,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:Cs};Fs.useEffectEvent=os;function Is(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ls={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),i=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 Rs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!_r(n,r)||!_r(i,a):!0}function zs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ls.enqueueReplaceState(t,t.state,null)}function Bs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Vs(e){Ur(e)}function Hs(e){console.error(e)}function Us(e){Ur(e)}function Ws(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Gs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ks(e,t,n){return n=Fa(n),n.tag=3,n.payload={element:null},n.callback=function(){Ws(e,t)},n}function qs(e){return e=Fa(e),e.tag=3,e}function Js(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Gs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Gs(t,n,r),typeof i!=`function`&&(tu===null?tu=new Set([this]):tu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ys(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&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===_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}),Li(di(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=di(r,n),a=Ks(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(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=Ks(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=qs(a),Js(a,e,n,r),Ra(n,a),!1}n=n.return}while(n!==null);return!1}var Xs=Error(i(461)),Zs=!1;function Qs(e,t,n,r){t.child=e===null?ja(t,null,n,r):Aa(t,e.child,n,r)}function $s(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return qi(t),r=_o(e,t,n,o,a,i),s=xo(),e!==null&&!Zs?(So(e,t,i),Cc(e,t,i)):(K&&s&&Ci(t),t.flags|=1,Qs(e,t,r,i),t.child)}function ec(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ni(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,tc(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,!wc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?_r:n,n(o,r)&&e.ref===t.ref)return Cc(e,t,i)}return t.flags|=1,e=ri(a,r),e.ref=t.ref,e.return=t,t.child=e}function tc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(_r(a,r)&&e.ref===t.ref)if(Zs=!1,t.pendingProps=r=a,wc(e,i))e.flags&131072&&(Zs=!0);else return t.lanes=e.lanes,Cc(e,t,i)}return lc(e,t,n,r,i)}function nc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return ic(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&fa(t,a===null?null:a.cachePool),a===null?qa():Ka(t,a),$a(t);else return r=t.lanes=536870912,ic(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 Qs(e,t,i,n),t.child}function rc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ic(e,t,n,r,i){var a=da();return a=a===null?null:{parent:ea._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&fa(t,null),qa(),$a(t),e!==null&&Gi(e,t,r,!0),t.childLanes=i,null}function ac(e,t){return t=vc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function oc(e,t,n){return Aa(t,e.child,null,n),e=ac(t,t.pendingProps),e.flags|=2,to(t),t.memoizedState=null,e}function sc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(K){if(r.mode===`hidden`)return e=ac(t,r),t.lanes=536870912,rc(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 ac(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=oc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Zs||Gi(e,t,n,!1),a=(n&e.childLanes)!==0,Zs||a){if(r=Fl,r!==null&&(s=Je(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Xr(e,s),pu(r,e,s),Xs;Tu(),t=oc(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=ac(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 cc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function lc(e,t,n,r,i){return qi(t),n=_o(e,t,n,r,void 0,i),r=xo(),e!==null&&!Zs?(So(e,t,i),Cc(e,t,i)):(K&&r&&Ci(t),t.flags|=1,Qs(e,t,n,i),t.child)}function uc(e,t,n,r,i,a){return qi(t),t.updateQueue=null,n=yo(t,r,n,i),vo(e),r=xo(),e!==null&&!Zs?(So(e,t,a),Cc(e,t,a)):(K&&r&&Ci(t),t.flags|=1,Qs(e,t,n,a),t.child)}function dc(e,t,n,r,i){if(qi(t),t.stateNode===null){var a=$r,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=Ls,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?Ji(o):$r,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Is(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ls.enqueueReplaceState(a,a.state,null),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=Bs(n,s);a.props=c;var l=a.context,u=n.contextType;o=$r,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)&&zs(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`&&(Is(t,n,d,r),l=t.memoizedState),(c=Ma||Rs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Pa(e,t),o=t.memoizedProps,u=Bs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=$r,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)&&zs(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&&Ki(e.dependencies)?(typeof s==`function`&&(Is(t,n,s,r),p=t.memoizedState),(u=Ma||Rs(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,cc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Aa(t,e.child,null,i),t.child=Aa(t,null,n,i)):Qs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Cc(e,t,i),e}function fc(e,t,n,r){return Fi(),t.flags|=256,Qs(e,t,n,r),t.child}var pc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mc(e){return{baseLanes:e,cachePool:pa()}}function hc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Kl),e}function gc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(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=vc({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=mc(n),r.childLanes=hc(e,s,n),t.memoizedState=pc,rc(null,r)):(Za(t),_c(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=yc(e,t,n)):t.memoizedState===null?(eo(t),c=r.fallback,a=t.mode,r=vc({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=mc(n),r.childLanes=hc(e,s,n),t.memoizedState=pc,t=rc(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=yc(e,t,n)}else if(Zs||Gi(e,t,n,!1),s=(n&e.childLanes)!==0,Zs||s){if(s=Fl,s!==null&&(r=Je(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Xr(e,r),pu(s,e,r),Xs;af(c)||Tu(),t=yc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Di=cf(c.nextSibling),Ei=t,K=!0,Oi=null,ki=!1,e!==null&&Ti(t,e),t=_c(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,rc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=mc(n):(a=c.cachePool,a===null?a=pa():(l=ea._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=hc(e,s,n),t.memoizedState=pc,rc(e.child,r)):(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 _c(e,t){return t=vc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function vc(e,t){return e=ti(22,e,null,t),e.lanes=0,e}function yc(e,t,n){return Aa(t,e.child,null,n),e=_c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ui(e.return,t,n)}function xc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Sc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=no.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,B(no,o),Qs(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&&bc(e,n,t);else if(e.tag===19)bc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ro(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),xc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ro(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}xc(t,!0,n,null,a,r);break;case`together`:xc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Cc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(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=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 wc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Ki(e))):!0}function Tc(e,t,n){switch(t.tag){case 3:se(t,t.stateNode.containerInfo),Vi(t,ea,e.memoizedState.cache),Fi();break;case 27:case 5:le(t);break;case 4:se(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=Cc(e,t,n),e===null?null:e.sibling):gc(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 Sc(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,nc(e,t,n,t.pendingProps);case 24:Vi(t,ea,e.memoizedState.cache)}return Cc(e,t,n)}function Ec(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Zs=!0;else{if(!wc(e,n)&&!(t.flags&128))return Zs=!1,Tc(e,t,n);Zs=!!(e.flags&131072)}else Zs=!1,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=Bs(e,r),t.tag=1,t=dc(null,t,e,r,n)):(t.tag=0,t=lc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=$s(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=ec(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return lc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Bs(r,t.pendingProps),dc(e,t,r,a,n);case 3:a:{if(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,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=fc(e,t,r,n);break a}else if(r!==a){a=di(Error(i(424)),t),Li(a),t=fc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(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(Fi(),r===a){t=Cc(e,t,n);break a}Qs(e,t,r,n)}t=t.child}return t;case 26:return cc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:K||(n=t.type,e=t.pendingProps,r=Bd(ae.current).createElement(n),r[et]=t,r[tt]=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 le(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),Qs(e,t,t.pendingProps.children,n),cc(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)),le(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=_o(e,t,bo,null,null,n),Qf._currentValue=a),cc(e,t),Qs(e,t,r,n),t.child;case 6:return e===null&&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 gc(e,t,n);case 4:return se(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Aa(t,null,r,n):Qs(e,t,r,n),t.child;case 11:return $s(e,t,t.type,t.pendingProps,n);case 7:return Qs(e,t,t.pendingProps,n),t.child;case 8:return Qs(e,t,t.pendingProps.children,n),t.child;case 12:return Qs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Vi(t,t.type,r.value),Qs(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,Qs(e,t,r,n),t.child;case 14:return ec(e,t,t.type,t.pendingProps,n);case 15:return tc(e,t,t.type,t.pendingProps,n);case 19:return Sc(e,t,n);case 31:return sc(e,t,n);case 22:return nc(e,t,n,t.pendingProps);case 24:return qi(t),r=Ji(ea),e===null?(a=da(),a===null&&(a=Fl,o=ta(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Na(t),Vi(t,ea,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,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))),Qs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Dc(e){e.flags|=4}function Oc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Su())e.flags|=8192;else throw xa=_a,ha}else e.flags&=-16777217}function kc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Su())e.flags|=8192;else throw xa=_a,ha}function Ac(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:He(),e.lanes|=t,ql|=t)}function jc(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 Mc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Nc(e,t,n){var r=t.pendingProps;switch(wi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mc(t),null;case 1:return Mc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Hi(ea),ce(),n.pendingContext&&=(n.context=n.pendingContext,null),(e===null||e.child===null)&&(Pi(t)?Dc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ii())),Mc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Dc(t),o===null?(Mc(t),Oc(t,a,null,r,n)):(Mc(t),kc(t,o))):o?o===e.memoizedState?(Mc(t),t.flags&=-16777217):(Dc(t),Mc(t),kc(t,o)):(e=e.memoizedProps,e!==r&&Dc(t),Mc(t),Oc(t,a,e,r,n)),null;case 27:if(ue(t),n=ae.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}e=re.current,Pi(t)?Mi(t,e):(e=ff(a,r,n),t.stateNode=e,Dc(t))}return Mc(t),null;case 5:if(ue(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}if(o=re.current,Pi(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[et]=t,o[tt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Dc(t)}}return Mc(t),Oc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ae.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[et]=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[et]=t,t.stateNode=e}return Mc(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[et]=t}else Fi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(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 Mc(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[et]=t}else Fi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(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),Ac(t,t.updateQueue),Mc(t),null);case 4:return ce(),e===null&&xd(t.stateNode.containerInfo),Mc(t),null;case 10:return Hi(t.type),Mc(t),null;case 19:if(z(no),r=t.memoizedState,r===null)return Mc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)jc(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ro(e),o!==null){for(t.flags|=128,jc(r,!1),e=o.updateQueue,t.updateQueue=e,Ac(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)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&&V()>$l&&(t.flags|=128,a=!0,jc(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,Ac(t,e),jc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!K)return Mc(t),null}else 2*V()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Mc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=V(),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)&&(Mc(t),t.subtreeFlags&6&&(t.flags|=8192)):Mc(t),n=t.updateQueue,n!==null&&Ac(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&z(q),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Hi(ea),Mc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Pc(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),ce(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ue(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 z(no),null;case 4:return ce(),null;case 10:return Hi(t.type),null;case 22:case 23:return to(t),Ja(),e!==null&&z(q),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 Fc(e,t){switch(wi(t),t.tag){case 3:Hi(ea),ce();break;case 26:case 27:case 5:ue(t);break;case 4:ce();break;case 31:t.memoizedState!==null&&to(t);break;case 13:to(t);break;case 19:z(no);break;case 10:Hi(t.type);break;case 22:case 23:to(t),Ja(),e!==null&&z(q);break;case 24:Hi(ea)}}function Ic(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Uu(t,t.return,e)}}function Lc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function Rc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ua(t,n)}catch(t){Uu(e,e.return,t)}}}function zc(e,t,n){n.props=Bs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function Bc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Uu(e,t,n)}}function Vc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Uu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Uu(e,t,n)}else n.current=null}function Hc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Uu(e,e.return,t)}}function Uc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[tt]=t}catch(t){Uu(e,e.return,t)}}function Wc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Gc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Wc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=qt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[et]=e,t[tt]=n}catch(t){Uu(e,e.return,t)}}var Yc=!1,Xc=!1,Zc=!1,Qc=typeof WeakSet==`function`?WeakSet:Set,$c=null;function el(e,t){if(e=e.containerInfo,Rd=sp,e=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,$c=t;$c!==null;)if(t=$c,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,$c=e;else for(;$c!==null;){switch(t=$c,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Bs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Uu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,$c=e;break}$c=t.return}}function tl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:gl(e,n),r&4&&Ic(5,n);break;case 1:if(gl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=Bs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}r&64&&Rc(n),r&512&&Bc(n,n.return);break;case 3:if(gl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ua(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&Jc(n);case 26:case 5:gl(e,n),t===null&&r&4&&Hc(n),r&512&&Bc(n,n.return);break;case 12:gl(e,n);break;case 31:gl(e,n),r&4&&sl(e,n);break;case 13:gl(e,n),r&4&&cl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Yc,!r){t=t!==null&&t.memoizedState!==null||Xc,i=Yc;var a=Xc;Yc=r,(Xc=t)&&!a?vl(e,n,(n.subtreeFlags&8772)!=0):gl(e,n),Yc=i,Xc=a}break;case 30:break;default:gl(e,n)}}function nl(e){var t=e.alternate;t!==null&&(e.alternate=null,nl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&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 rl=null,il=!1;function al(e,t,n){for(n=n.child;n!==null;)ol(e,t,n),n=n.sibling}function ol(e,t,n){if(je&&typeof je.onCommitFiberUnmount==`function`)try{je.onCommitFiberUnmount(Ae,n)}catch{}switch(n.tag){case 26:Xc||Vc(n,t),al(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Xc||Vc(n,t);var r=rl,i=il;Zd(n.type)&&(rl=n.stateNode,il=!1),al(e,t,n),pf(n.stateNode),rl=r,il=i;break;case 5:Xc||Vc(n,t);case 6:if(r=rl,i=il,rl=null,al(e,t,n),rl=r,il=i,rl!==null)if(il)try{(rl.nodeType===9?rl.body:rl.nodeName===`HTML`?rl.ownerDocument.body:rl).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{rl.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}break;case 18:rl!==null&&(il?(e=rl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(rl,n.stateNode));break;case 4:r=rl,i=il,rl=n.stateNode.containerInfo,il=!0,al(e,t,n),rl=r,il=i;break;case 0:case 11:case 14:case 15:Lc(2,n,t),Xc||Lc(4,n,t),al(e,t,n);break;case 1:Xc||(Vc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&zc(n,t,r)),al(e,t,n);break;case 21:al(e,t,n);break;case 22:Xc=(r=Xc)||n.memoizedState!==null,al(e,t,n),Xc=r;break;default:al(e,t,n)}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Uu(t,t.return,e)}}}function cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Uu(t,t.return,e)}}function ll(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qc),t;default:throw Error(i(435,e.tag))}}function ul(e,t){var n=ll(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function dl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){rl=c.stateNode,il=!1;break a}break;case 5:rl=c.stateNode,il=!1;break a;case 3:case 4:rl=c.stateNode.containerInfo,il=!0;break a}c=c.return}if(rl===null)throw Error(i(160));ol(o,s,a),rl=null,il=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)pl(t,e),t=t.sibling}var fl=null;function pl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dl(t,e),ml(e),r&4&&(Lc(3,e,e.return),Ic(3,e),Lc(5,e,e.return));break;case 1:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&64&&Yc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=fl;if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[st]||o[et]||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[et]=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[et]=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&&Uc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),n!==null&&r&4&&Uc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),e.flags&32){a=e.stateNode;try{zt(a,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Uc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Zc=!0);break;case 6:if(dl(t,e),ml(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Uu(e,e.return,t)}}break;case 3:if(Bf=null,a=fl,fl=gf(t.containerInfo),dl(t,e),fl=a,ml(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Uu(e,e.return,t)}Zc&&(Zc=!1,hl(e));break;case 4:r=fl,fl=gf(e.stateNode.containerInfo),dl(t,e),ml(e),fl=r;break;case 12:dl(t,e),ml(e);break;case 31:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 13:dl(t,e),ml(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zl=V()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Yc,d=Xc;if(Yc=u||a,Xc=d||l,dl(t,e),Xc=d,Yc=u,ml(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Yc||Xc||_l(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Uu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Uu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Uu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ul(e,n))));break;case 19:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 30:break;case 21:break;default:dl(t,e),ml(e)}}function ml(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Wc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;qc(e,Gc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(zt(o,``),n.flags&=-33),qc(e,Gc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Kc(e,Gc(e),s);break;default:throw Error(i(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;hl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function gl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)tl(e,t.alternate,t),t=t.sibling}function _l(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Lc(4,t,t.return),_l(t);break;case 1:Vc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&zc(t,t.return,n),_l(t);break;case 27:pf(t.stateNode);case 26:case 5:Vc(t,t.return),_l(t);break;case 22:t.memoizedState===null&&_l(t);break;case 30:_l(t);break;default:_l(t)}e=e.sibling}}function vl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:vl(i,a,n),Ic(4,a);break;case 1:if(vl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Uu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ha(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&Rc(a),Bc(a,a.return);break;case 27:Jc(a);case 26:case 5:vl(i,a,n),n&&r===null&&o&4&&Hc(a),Bc(a,a.return);break;case 12:vl(i,a,n);break;case 31:vl(i,a,n),n&&o&4&&sl(i,a);break;case 13:vl(i,a,n),n&&o&4&&cl(i,a);break;case 22:a.memoizedState===null&&vl(i,a,n),Bc(a,a.return);break;case 30:break;default:vl(i,a,n)}t=t.sibling}}function yl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&na(n))}function bl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&na(e))}function xl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sl(e,t,n,r),t=t.sibling}function Sl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:xl(e,t,n,r),i&2048&&Ic(9,t);break;case 1:xl(e,t,n,r);break;case 3:xl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&na(e)));break;case 12:if(i&2048){xl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Uu(t,t.return,e)}}else xl(e,t,n,r);break;case 31:xl(e,t,n,r);break;case 13:xl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?xl(e,t,n,r):(a._visibility|=2,Cl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?xl(e,t,n,r):wl(e,t),i&2048&&yl(o,t);break;case 24:xl(e,t,n,r),i&2048&&bl(t.alternate,t);break;default:xl(e,t,n,r)}}function Cl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Cl(a,o,s,c,i),Ic(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Cl(a,o,s,c,i)):u._visibility&2?Cl(a,o,s,c,i):wl(a,o),i&&l&2048&&yl(o.alternate,o);break;case 24:Cl(a,o,s,c,i),i&&l&2048&&bl(o.alternate,o);break;default:Cl(a,o,s,c,i)}t=t.sibling}}function wl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:wl(n,r),i&2048&&yl(r.alternate,r);break;case 24:wl(n,r),i&2048&&bl(r.alternate,r);break;default:wl(n,r)}t=t.sibling}}var Tl=8192;function El(e,t,n){if(e.subtreeFlags&Tl)for(e=e.child;e!==null;)Dl(e,t,n),e=e.sibling}function Dl(e,t,n){switch(e.tag){case 26:El(e,t,n),e.flags&Tl&&e.memoizedState!==null&&Gf(n,fl,e.memoizedState,e.memoizedProps);break;case 5:El(e,t,n);break;case 3:case 4:var r=fl;fl=gf(e.stateNode.containerInfo),El(e,t,n),fl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Tl,Tl=16777216,El(e,t,n),Tl=r):El(e,t,n));break;default:El(e,t,n)}}function Ol(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Al(e),e=e.sibling}function Al(e){switch(e.tag){case 0:case 11:case 15:kl(e),e.flags&2048&&Lc(9,e,e.return);break;case 3:kl(e);break;case 12:kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,jl(e)):kl(e);break;default:kl(e)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Lc(8,t,t.return),jl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,jl(t));break;default:jl(t)}e=e.sibling}}function Ml(e,t){for(;$c!==null;){var n=$c;switch(n.tag){case 0:case 11:case 15:Lc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:na(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,$c=r;else a:for(n=e;$c!==null;){r=$c;var i=r.sibling,a=r.return;if(nl(r),r===n){$c=null;break a}if(i!==null){i.return=a,$c=i;break a}$c=a}}}var Nl={getCacheForType:function(e){var t=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}},Pl=typeof WeakMap==`function`?WeakMap:Map,X=0,Fl=null,Z=null,Q=0,Il=0,Ll=null,Rl=!1,zl=!1,Bl=!1,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=null,Yl=null,Xl=!1,Zl=0,Ql=0,$l=1/0,eu=null,tu=null,nu=0,ru=null,iu=null,au=0,ou=0,su=null,cu=null,lu=0,uu=null;function du(){return X&2&&Q!==0?Q&-Q:F.T===null?Ze():ud()}function fu(){if(Kl===0)if(!(Q&536870912)||K){var e=Ie;Ie<<=1,!(Ie&3932160)&&(Ie=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)),We(e,n),(!(X&2)||e!==Fl)&&(e===Fl&&(!(X&2)&&(Wl|=n),Hl===4&&_u(e,Q,Kl,!1)),nd(e))}function mu(e,t,n){if(X&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Be(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-V(),10<a)){if(_u(r,t,Kl,!Rl),ze(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},Dl(t,a,d);var m=(a&62914560)===a?Zl-V():(a&4194048)===a?Ql-V():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-Me(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ke(e,n,t)}function vu(){return X&6?!0:(rd(0,!1),!1)}function yu(){if(Z!==null){if(Il===0)var e=Z.return;else e=Z,Bi=zi=null,Y(e),wa=null,Ta=0,e=Z;for(;e!==null;)Fc(e.alternate,e),e=e.return;Z=null}}function bu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),au=0,yu(),Fl=e,Z=n=ri(e.current,null),Q=t,Il=0,Ll=null,Rl=!1,zl=Be(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-Me(r),a=1<<i;t|=e[i],r&=~a}return Vl=t,qr(),n}function xu(e,t){J=null,F.H=Ms,t===ma||t===ga?(t=Sa(),Il=3):t===ha?(t=Sa(),Il=4):Il=t===Xs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ll=t,Z===null&&(Hl=1,Ws(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=Ms,e===null?Ms:e}function wu(){var e=F.A;return F.A=Nl,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=X;X|=2;var i=Cu(),a=wu();(Fl!==e||Q!==t)&&(eu=null,bu(e,t)),t=!1;var o=Hl;a:do try{if(Il!==0&&Z!==null){var s=Z,c=Ll;switch(Il){case 8:yu(),o=6;break a;case 3:case 2:case 9:case 6: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,X=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=X;X|=2;var r=Cu(),a=wu();Fl!==e||Q!==t?(eu=null,$l=V()+500,bu(e,t)):zl=Be(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 Bi=zi=null,F.H=r,F.A=a,X=n,Z===null?(Fl=null,Q=0,qr(),Hl):0}function ku(){for(;Z!==null&&!xe();)Au(Z)}function Au(e){var t=Ec(e.alternate,e,Vl);e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=uc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=uc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:Y(t);default:Fc(n,t),t=Z=ii(t,Vl),t=Ec(n,t,Vl)}e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function Mu(e,t,n,r){Bi=zi=null,Y(t),wa=null,Ta=0;var i=t.return;try{if(Ys(e,i,t,n,Q)){Hl=1,Ws(e,di(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;Hl=1,Ws(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=Nc(t.alternate,t,Vl);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);Hl===0&&(Hl=5)}function Pu(e,t){do{var n=Pc(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);Hl=6,Z=null}function Fu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(nu!==0);if(X&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Kr,Ge(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=X,X|=4;try{el(e,t,n)}finally{X=s,I.p=a,F.T=r}}nu=1,Iu(),Lu(),Ru()}}function Iu(){if(nu===1){nu=0;var e=ru,t=iu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=X;X|=4;try{pl(t,e);var a=zd,o=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{X=i,I.p=r,F.T=n}}e.current=t,nu=2}}function Lu(){if(nu===2){nu=0;var e=ru,t=iu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=X;X|=4;try{tl(e,t.alternate,t)}finally{X=i,I.p=r,F.T=n}}nu=3}}function Ru(){if(nu===4||nu===3){nu=0,Se();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),Xe(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,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=Xe(au),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,X&6)throw Error(i(331));var c=X;if(X|=4,Al(o.current),Sl(o,o.current,s,n),X=c,rd(0,!1),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=Ks(e.stateNode,t,2),e=Ia(e,t,2),e!==null&&(We(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=qs(2),r=Ia(t,n,2),r!==null&&(Js(n,r,t,e),We(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Bl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Fl===e&&(Q&n)===n&&(Hl===4||Hl===3&&(Q&62914560)===Q&&300>V()-Zl?!(X&2)&&bu(e,0):Gl|=n,ql===Q&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=He()),e=Xr(e,t),e!==null&&(We(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 ye(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-Me(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=ze(r,r===Fl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Be(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=V(),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-Me(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ve(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Fl,n=Q,n=ze(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&&be(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Be(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&be(r),Xe(n)){case 2:case 8:n=H;break;case 32:n=Te;break;case 268435456:n=De;break;default:n=Te}return r=sd.bind(null,e),n=ye(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&be(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=ze(e,e===Fl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mu(e,r,t),od(e,V()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Bu())return null;mu(e,t,!0)}function ld(){Yd(function(){X&6?ye(we,id):ad()})}function ud(){if(td===0){var e=aa;e===0&&(e=W,W<<=1,!(W&261888)&&(W=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[tt]||null).action),o=r.submitter;o&&(t=(t=o[tt]||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);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(Pr,`onAnimationEnd`),Hr(Fr,`onAnimationIteration`),Hr(Ir,`onAnimationStart`),Hr(`dblclick`,`onDoubleClick`),Hr(`focusin`,`onFocus`),Hr(`focusout`,`onBlur`),Hr(Lr,`onTransitionRun`),Hr(Rr,`onTransitionStart`),Hr(G,`onTransitionCancel`),Hr(zr,`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){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,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=Br.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 zr: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[tt]||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=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=ut(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=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=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=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[et]||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:te,_currentValue2:te,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ue(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ue(0),this.hiddenUpdates=Ue(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=ta(),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=Ye(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=ut(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Re(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Me(o);s.entanglements[1]|=c,o&=~c}nd(a),!(X&6)&&($l=V()+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=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(Ce()){case we:return 2;case H: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=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,Qe(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Qe(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,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[tt]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[tt]||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=Ze();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=Vs,s=Hs,c=Us;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[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])}const y=300*1e3;function b(e){if(!e||typeof e!=`object`)return null;let t=e;return Array.isArray(t.sessions)?{sessions:t.sessions,cachedAt:typeof t.cachedAt==`string`?t.cachedAt:void 0}:null}function x(e,t=y){if(!e)return!1;let n=Date.now()-new Date(e).getTime();return Number.isFinite(n)&&n>=0&&n<t}function S(e){if(!e)return`just now`;let t=Date.now()-new Date(e).getTime();if(!Number.isFinite(t)||t<0)return`just now`;let n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function C(e,t=Date.now()){if(!e)return``;let n=t-new Date(e).getTime();if(!Number.isFinite(n)||n<0)return`0m`;let r=Math.floor(n/6e4);if(r<60)return`${r}m`;let i=Math.floor(r/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function w(e){return new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}function T(e){return e?`$${e.toFixed(2)}`:``}function E(e){if(!e)return``;let t=e.match(/claude-(\d+)-(\d+)-(opus|sonnet|haiku)(?:-\d{8})?/i);if(t)return`${t[3].charAt(0).toUpperCase()+t[3].slice(1).toLowerCase()} ${t[1]}.${t[2]}`;let n=e.match(/claude-(?:(opus|sonnet|haiku)-)?((?:\d+)(?:[.-](?!\d{8})\d+)*)(?:-\d{8})?(?:-(opus|sonnet|haiku))?(?:$|\b)/i);if(n){let e=(n[1]||n[3]||``).toLowerCase(),t=n[2].replace(/-/g,`.`),r=e.charAt(0).toUpperCase()+e.slice(1);return r?`${r} ${t}`:`Claude ${t}`}let r=e.split(/[-/]/);return r.length>1?r.slice(0,2).join(`-`):e}function D(e){if(e===0)return`0m`;let t=Math.floor(e/6e4);if(t<60)return`${t}m`;let n=Math.floor(t/60),r=t%60;if(n<24)return r>0?`${n}h ${r}m`:`${n}h`;let i=Math.floor(n/24),a=n%24;return a>0?`${i}d ${a}h`:`${i}d`}function O(e){let t=Math.round(e/1024);return t>=1024?`${(t/1024).toFixed(1)}MB`:`${t}KB`}function k(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let i=Math.floor(r/24);return i<30?`${i}d ago`:w(e)}function A(e){let t=ye(e);if(t)return t;let n=e.replace(/\/$/,``).split(`/`);return n[n.length-1]||e}function j(e){return(e||``).replace(/\s+/g,` `).trim().slice(0,120)}function M(e){return e.startsWith(`[Request interrupted by user`)||e.startsWith(`<command-name>`)||e.startsWith(`<command-message>`)||e.startsWith(`<local-command-caveat>`)||e.startsWith(`<local-command-stdout>`)||e.startsWith(`<task-notification>`)||e.startsWith(`<bash-input>`)||e.startsWith(`<bash-stdout>`)}function N(e){return e.split(`
|
|
15
|
+
`+e.stack}}var ye=Object.prototype.hasOwnProperty,be=t.unstable_scheduleCallback,xe=t.unstable_cancelCallback,Se=t.unstable_shouldYield,Ce=t.unstable_requestPaint,B=t.unstable_now,we=t.unstable_getCurrentPriorityLevel,Te=t.unstable_ImmediatePriority,V=t.unstable_UserBlockingPriority,Ee=t.unstable_NormalPriority,De=t.unstable_LowPriority,Oe=t.unstable_IdlePriority,ke=t.log,Ae=t.unstable_setDisableYieldValue,je=null,Me=null;function H(e){if(typeof ke==`function`&&Ae(e),Me&&typeof Me.setStrictMode==`function`)try{Me.setStrictMode(je,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 U=256,Le=262144,Re=4194304;function ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Be(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ze(n))):i=ze(o):i=ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ze(n))):i=ze(o)):i=ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ve(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function He(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ue(){var e=Re;return Re<<=1,!(Re&62914560)&&(Re=4194304),e}function We(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ge(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ke(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-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,nt=`__reactProps$`+et,rt=`__reactContainer$`+et,it=`__reactEvents$`+et,at=`__reactListeners$`+et,ot=`__reactHandles$`+et,st=`__reactResources$`+et,ct=`__reactMarker$`+et;function lt(e){delete e[tt],delete e[nt],delete e[it],delete e[at],delete e[ot]}function ut(e){var t=e[tt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[rt]||n[tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[tt])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function dt(e){if(e=e[tt]||e[rt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function pt(e){var t=e[st];return t||=e[st]={hoistableStyles:new Map,hoistableScripts:new Map},t}function mt(e){e[ct]=!0}var ht=new Set,gt={};function _t(e,t){vt(e,t),vt(e+`Capture`,t)}function vt(e,t){for(gt[e]=t,e=0;e<t.length;e++)ht.add(t[e])}var yt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),bt={},xt={};function St(e){return ye.call(xt,e)?!0:ye.call(bt,e)?!1:yt.test(e)?xt[e]=!0:(bt[e]=!0,!1)}function Ct(e,t,n){if(St(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function wt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Tt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Et(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Dt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ot(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kt(e){if(!e._valueTracker){var t=Dt(e)?`checked`:`value`;e._valueTracker=Ot(e,t,``+e[t])}}function At(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Dt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function jt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Mt=/[\n"\\]/g;function Nt(e){return e.replace(Mt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Pt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Et(t)):e.value!==``+Et(t)&&(e.value=``+Et(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):It(e,o,Et(n)):It(e,o,Et(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Et(s):e.removeAttribute(`name`)}function Ft(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){kt(e);return}n=n==null?``:``+Et(n),t=t==null?n:``+Et(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),kt(e)}function It(e,t,n){t===`number`&&jt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Lt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Et(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Rt(e,t,n){if(t!=null&&(t=``+Et(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Et(n)}function zt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ee(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Et(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),kt(e)}function Bt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Vt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Ht(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Vt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ut(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Ht(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Ht(e,o,t[o])}function Wt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Gt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Kt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function qt(e){return Kt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Jt(){}var Yt=null;function Xt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zt=null,Qt=null;function $t(e){var t=dt(e);if(t&&(e=t.stateNode)){var n=e[nt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Pt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Nt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[nt]||null;if(!a)throw Error(i(90));Pt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&At(r)}break a;case`textarea`:Rt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Lt(e,!!n.multiple,t,!1)}}}var en=!1;function tn(e,t,n){if(en)return e(t,n);en=!0;try{return e(t)}finally{if(en=!1,(Zt!==null||Qt!==null)&&(vu(),Zt&&(t=Zt,e=Qt,Qt=Zt=null,$t(t),e)))for(t=0;t<e.length;t++)$t(e[t])}}function nn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[nt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var rn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),an=!1;if(rn)try{var on={};Object.defineProperty(on,`passive`,{get:function(){an=!0}}),window.addEventListener(`test`,on,on),window.removeEventListener(`test`,on,on)}catch{an=!1}var sn=null,cn=null,ln=null;function un(){if(ln)return ln;var e,t=cn,n=t.length,r,i=`value`in sn?sn.value:sn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return ln=i.slice(e,1<r?1-r:void 0)}function dn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function fn(){return!0}function pn(){return!1}function mn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?fn:pn,this.isPropagationStopped=pn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=fn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=fn)},persist:function(){},isPersistent:fn}),t}var hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gn=mn(hn),_n=h({},hn,{view:0,detail:0}),vn=mn(_n),yn,bn,xn,Sn=h({},_n,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==xn&&(xn&&e.type===`mousemove`?(yn=e.screenX-xn.screenX,bn=e.screenY-xn.screenY):bn=yn=0,xn=e),yn)},movementY:function(e){return`movementY`in e?e.movementY:bn}}),Cn=mn(Sn),wn=mn(h({},Sn,{dataTransfer:0})),Tn=mn(h({},_n,{relatedTarget:0})),En=mn(h({},hn,{animationName:0,elapsedTime:0,pseudoElement:0})),Dn=mn(h({},hn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),On=mn(h({},hn,{data:0})),kn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},An={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Mn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jn[e])?!!t[e]:!1}function Nn(){return Mn}var Pn=mn(h({},_n,{key:function(e){if(e.key){var t=kn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=dn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?An[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nn,charCode:function(e){return e.type===`keypress`?dn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?dn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Fn=mn(h({},Sn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),In=mn(h({},_n,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nn})),Ln=mn(h({},hn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=mn(h({},Sn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),zn=mn(h({},hn,{newState:0,oldState:0})),Bn=[9,13,27,32],Vn=rn&&`CompositionEvent`in window,Hn=null;rn&&`documentMode`in document&&(Hn=document.documentMode);var Un=rn&&`TextEvent`in window&&!Hn,Wn=rn&&(!Vn||Hn&&8<Hn&&11>=Hn),Gn=` `,Kn=!1;function qn(e,t){switch(e){case`keyup`:return Bn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Jn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Yn=!1;function Xn(e,t){switch(e){case`compositionend`:return Jn(t);case`keypress`:return t.which===32?(Kn=!0,Gn):null;case`textInput`:return e=t.data,e===Gn&&Kn?null:e;default:return null}}function Zn(e,t){if(Yn)return e===`compositionend`||!Vn&&qn(e,t)?(e=un(),ln=cn=sn=null,Yn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Wn&&t.locale!==`ko`?null:t.data;default:return null}}var Qn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Qn[e.type]:t===`textarea`}function er(e,t,n,r){Zt?Qt?Qt.push(r):Qt=[r]:Zt=r,t=Td(t,`onChange`),0<t.length&&(n=new gn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var tr=null,nr=null;function rr(e){vd(e,0)}function ir(e){if(At(ft(e)))return e}function ar(e,t){if(e===`change`)return t}var or=!1;if(rn){var sr;if(rn){var cr=`oninput`in document;if(!cr){var lr=document.createElement(`div`);lr.setAttribute(`oninput`,`return;`),cr=typeof lr.oninput==`function`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){tr&&(tr.detachEvent(`onpropertychange`,dr),nr=tr=null)}function dr(e){if(e.propertyName===`value`&&ir(nr)){var t=[];er(t,nr,e,Xt(e)),tn(rr,t)}}function fr(e,t,n){e===`focusin`?(ur(),tr=t,nr=n,tr.attachEvent(`onpropertychange`,dr)):e===`focusout`&&ur()}function pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ir(nr)}function mr(e,t){if(e===`click`)return ir(t)}function hr(e,t){if(e===`input`||e===`change`)return ir(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==`function`?Object.is:gr;function vr(e,t){if(_r(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ye.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=yr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=yr(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=jt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=jt(e.document)}return t}function Cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var wr=rn&&`documentMode`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==jt(r)||(r=Tr,`selectionStart`in r&&Cr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Dr&&vr(Dr,r)||(Dr=r,r=Td(Er,`onSelect`),0<r.length&&(t=new gn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var jr={animationend:Ar(`Animation`,`AnimationEnd`),animationiteration:Ar(`Animation`,`AnimationIteration`),animationstart:Ar(`Animation`,`AnimationStart`),transitionrun:Ar(`Transition`,`TransitionRun`),transitionstart:Ar(`Transition`,`TransitionStart`),transitioncancel:Ar(`Transition`,`TransitionCancel`),transitionend:Ar(`Transition`,`TransitionEnd`)},Mr={},Nr={};rn&&(Nr=document.createElement(`div`).style,`AnimationEvent`in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),`TransitionEvent`in window||delete jr.transitionend.transition);function Pr(e){if(Mr[e])return Mr[e];if(!jr[e])return e;var t=jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Fr=Pr(`animationend`),Ir=Pr(`animationiteration`),Lr=Pr(`animationstart`),Rr=Pr(`transitionrun`),zr=Pr(`transitionstart`),Br=Pr(`transitioncancel`),W=Pr(`transitionend`),Vr=new Map,Hr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Hr.push(`scrollEnd`);function Ur(e,t){Vr.set(e,t),_t(t,[e])}var Wr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Gr=[],Kr=0,qr=0;function Jr(){for(var e=Kr,t=qr=Kr=0;t<e;){var n=Gr[t];Gr[t++]=null;var r=Gr[t];Gr[t++]=null;var i=Gr[t];Gr[t++]=null;var a=Gr[t];if(Gr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Qr(n,i,a)}}function Yr(e,t,n,r){Gr[Kr++]=e,Gr[Kr++]=t,Gr[Kr++]=n,Gr[Kr++]=r,qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Xr(e,t,n,r){return Yr(e,t,n,r),$r(e)}function Zr(e,t){return Yr(e,null,null,t),$r(e)}function Qr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ne(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function $r(e){if(50<lu)throw lu=0,uu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ei={};function ti(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ni(e,t,n,r){return new ti(e,t,n,r)}function ri(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ii(e,t){var n=e.alternate;return n===null?(n=ni(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ai(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function oi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ri(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,ie.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ni(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return si(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ni(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ni(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ni(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function si(e,t,n,r){return e=ni(7,e,r,t),e.lanes=n,e}function ci(e,t,n){return e=ni(6,e,null,t),e.lanes=n,e}function li(e){var t=ni(18,null,null,0);return t.stateNode=e,t}function ui(e,t,n){return t=ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var di=new WeakMap;function fi(e,t){if(typeof e==`object`&&e){var n=di.get(e);return n===void 0?(t={value:e,source:t,stack:ve(t)},di.set(e,t),t):n}return{value:e,source:t,stack:ve(t)}}var pi=[],mi=0,hi=null,gi=0,_i=[],vi=0,yi=null,bi=1,xi=``;function Si(e,t){pi[mi++]=gi,pi[mi++]=hi,hi=e,gi=t}function Ci(e,t,n){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,yi=e;var r=bi;e=xi;var i=32-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,bi=1<<32-Ne(t)+i|n<<i|r,xi=a+e}else bi=1<<a|n<<i|r,xi=e}function wi(e){e.return!==null&&(Si(e,1),Ci(e,1,0))}function Ti(e){for(;e===hi;)hi=pi[--mi],pi[mi]=null,gi=pi[--mi],pi[mi]=null;for(;e===yi;)yi=_i[--vi],_i[vi]=null,xi=_i[--vi],_i[vi]=null,bi=_i[--vi],_i[vi]=null}function Ei(e,t){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,bi=t.id,xi=t.overflow,yi=e}var Di=null,Oi=null,G=!1,ki=null,Ai=!1,ji=Error(i(519));function Mi(e){throw Ri(fi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ji}function Ni(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[tt]=e,t[nt]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)$(gd[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),Ft(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),zt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||jd(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=Jt),t=!0):t=!1,t||Mi(e,!0)}function Pi(e){for(Di=e.return;Di;)switch(Di.tag){case 5:case 31:case 13:Ai=!1;return;case 27:case 3:Ai=!0;return;default:Di=Di.return}}function Fi(e){if(e!==Di)return!1;if(!G)return Pi(e),G=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&Oi&&Mi(e),Pi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=uf(e)}else t===27?(t=Oi,Zd(e.type)?(e=lf,lf=null,Oi=e):Oi=t):Oi=Di?cf(e.stateNode.nextSibling):null;return!0}function Ii(){Oi=Di=null,G=!1}function Li(){var e=ki;return e!==null&&(Yl===null?Yl=e:Yl.push.apply(Yl,e),ki=null),e}function Ri(e){ki===null?ki=[e]:ki.push(e)}var zi=L(null),Bi=null,Vi=null;function Hi(e,t,n){z(zi,t._currentValue),t._currentValue=n}function Ui(e){e._currentValue=zi.current,R(zi)}function Wi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Gi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Wi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Wi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ki(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;_r(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===se.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Gi(t,e,n,r),t.flags|=262144}function qi(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ji(e){Bi=e,Vi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yi(e){return Zi(Bi,e)}function Xi(e,t){return Bi===null&&Ji(e),Zi(e,t)}function Zi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Vi===null){if(e===null)throw Error(i(308));Vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Vi=Vi.next=t;return n}var Qi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},$i=t.unstable_scheduleCallback,ea=t.unstable_NormalPriority,ta={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function na(){return{controller:new Qi,data:new Map,refCount:0}}function ra(e){e.refCount--,e.refCount===0&&$i(ea,function(){e.controller.abort()})}var ia=null,aa=0,oa=0,sa=null;function ca(e,t){if(ia===null){var n=ia=[];aa=0,oa=ud(),sa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return aa++,t.then(la,la),t}function la(){if(--aa===0&&ia!==null){sa!==null&&(sa.status=`fulfilled`);var e=ia;ia=null,oa=0,sa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var da=F.S;F.S=function(e,t){Ql=B(),typeof t==`object`&&t&&typeof t.then==`function`&&ca(e,t),da!==null&&da(e,t)};var fa=L(null);function K(){var e=fa.current;return e===null?Fl.pooledCache:e}function pa(e,t){t===null?z(fa,fa.current):z(fa,t.pool)}function ma(){var e=K();return e===null?null:{parent:ta._currentValue,pool:e}}var ha=Error(i(460)),ga=Error(i(474)),_a=Error(i(542)),va={then:function(){}};function ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ba(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Jt,Jt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,wa(e),e;default:if(typeof t.status==`string`)t.then(Jt,Jt);else{if(e=Fl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,wa(e),e}throw Sa=t,ha}}function xa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Sa=e,ha):e}}var Sa=null;function Ca(){if(Sa===null)throw Error(i(459));var e=Sa;return Sa=null,e}function wa(e){if(e===ha||e===_a)throw Error(i(483))}var Ta=null,Ea=0;function Da(e){var t=Ea;return Ea+=1,Ta===null&&(Ta=[]),ba(Ta,e,t)}function Oa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ka(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Aa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ii(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ci(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&xa(i)===t.type)?(t=a(t,n.props),Oa(t,n),t.return=e,t):(t=oi(n.type,n.key,n.props,null,e.mode,r),Oa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ui(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=si(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ci(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=oi(t.type,t.key,t.props,null,e.mode,n),Oa(n,t),n.return=e,n;case v:return t=ui(t,e.mode,n),t.return=e,t;case O:return t=xa(t),f(e,t,n)}if(ee(t)||M(t))return t=si(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Da(t),n);if(t.$$typeof===C)return f(e,Xi(e,t),n);ka(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=xa(n),p(e,t,n,r)}if(ee(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Da(n),r);if(n.$$typeof===C)return p(e,t,Xi(e,n),r);ka(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=xa(r),m(e,t,n,r,i)}if(ee(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Da(r),i);if(r.$$typeof===C)return m(e,t,n,Xi(t,r),i);ka(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),G&&Si(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return G&&Si(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),G&&Si(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),G&&Si(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return G&&Si(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),G&&Si(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&xa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Oa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=oi(o.type,o.key,o.props,null,e.mode,c),Oa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=ui(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=xa(o),b(e,r,o,c)}if(ee(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Da(o),c);if(o.$$typeof===C)return b(e,r,Xi(e,o),c);ka(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ea=0;var i=b(e,t,n,r);return Ta=null,i}catch(t){if(t===ha||t===_a)throw t;var a=ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ja=Aa(!0),Ma=Aa(!1),Na=!1;function Pa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ia(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function La(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,X&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=$r(e),Qr(e,null,n),t}return Yr(e,r,t,n),$r(e)}function Ra(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Je(e,n)}}function za(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ba=!1;function Va(){if(Ba){var e=sa;if(e!==null)throw e}}function Ha(e,t,n,r){Ba=!1;var i=e.updateQueue;Na=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Q&f)===f:(r&f)===f){f!==0&&f===oa&&(Ba=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Na=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ul|=o,e.lanes=o,e.memoizedState=d}}function Ua(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Wa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ua(n[e],t)}var Ga=L(null),Ka=L(0);function qa(e,t){e=Vl,z(Ka,e),z(Ga,t),Vl=e|t.baseLanes}function Ja(){z(Ka,Vl),z(Ga,Ga.current)}function Ya(){Vl=Ka.current,R(Ga),R(Ka)}var Xa=L(null),Za=null;function Qa(e){var t=e.alternate;z(ro,ro.current&1),z(Xa,e),Za===null&&(t===null||Ga.current!==null||t.memoizedState!==null)&&(Za=e)}function $a(e){z(ro,ro.current),z(Xa,e),Za===null&&(Za=e)}function eo(e){e.tag===22?(z(ro,ro.current),z(Xa,e),Za===null&&(Za=e)):to(e)}function to(){z(ro,ro.current),z(Xa,Xa.current)}function no(e){R(Xa),Za===e&&(Za=null),R(ro)}var ro=L(0);function io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ao=0,q=null,J=null,oo=null,so=!1,co=!1,lo=!1,uo=0,fo=0,po=null,mo=0;function ho(){throw Error(i(321))}function go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function _o(e,t,n,r,i,a){return ao=a,q=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?Ns:Ps,lo=!1,a=n(r,i),lo=!1,co&&(a=yo(t,n,r,i)),vo(e),a}function vo(e){F.H=Ms;var t=J!==null&&J.next!==null;if(ao=0,oo=J=q=null,so=!1,fo=0,po=null,t)throw Error(i(300));e===null||Zs||(e=e.dependencies,e!==null&&qi(e)&&(Zs=!0))}function yo(e,t,n,r){q=e;var a=0;do{if(co&&(po=null),fo=0,co=!1,25<=a)throw Error(i(301));if(a+=1,oo=J=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=Fs,o=t(n,r)}while(co);return o}function bo(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?Eo(t):t,e=e.useState()[0],(J===null?null:J.memoizedState)!==e&&(q.flags|=1024),t}function xo(){var e=uo!==0;return uo=0,e}function So(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Co(e){if(so){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}so=!1}ao=0,oo=J=q=null,co=!1,fo=uo=0,po=null}function Y(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return oo===null?q.memoizedState=oo=e:oo=oo.next=e,oo}function wo(){if(J===null){var e=q.alternate;e=e===null?null:e.memoizedState}else e=J.next;var t=oo===null?q.memoizedState:oo.next;if(t!==null)oo=t,J=e;else{if(e===null)throw q.alternate===null?Error(i(467)):Error(i(310));J=e,e={memoizedState:J.memoizedState,baseState:J.baseState,baseQueue:J.baseQueue,queue:J.queue,next:null},oo===null?q.memoizedState=oo=e:oo=oo.next=e}return oo}function To(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Eo(e){var t=fo;return fo+=1,po===null&&(po=[]),e=ba(po,e,t),t=q,(oo===null?t.memoizedState:oo.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?Ns:Ps),e}function Do(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Eo(e);if(e.$$typeof===C)return Yi(e)}throw Error(i(438,String(e)))}function Oo(e){var t=null,n=q.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=q.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=To(),q.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function ko(e,t){return typeof t==`function`?t(e):t}function Ao(e){return jo(wo(),J,e)}function jo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(ao&f)===f:(Q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===oa&&(d=!0);else if((ao&p)===p){u=u.next,p===oa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,q.lanes|=p,Ul|=p;f=u.action,lo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,q.lanes|=f,Ul|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!_r(o,e.memoizedState)&&(Zs=!0,d&&(n=sa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Mo(e){var t=wo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);_r(o,t.memoizedState)||(Zs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function No(e,t,n){var r=q,a=wo(),o=G;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!_r((J||a).memoizedState,n);if(s&&(a.memoizedState=n,Zs=!0),a=a.queue,is(Io.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||oo!==null&&oo.memoizedState.tag&1){if(r.flags|=2048,$o(9,{destroy:void 0},Fo.bind(null,r,a,n,t),null),Fl===null)throw Error(i(349));o||ao&127||Po(r,t,n)}return n}function Po(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=q.updateQueue,t===null?(t=To(),q.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Fo(e,t,n,r){t.value=n,t.getSnapshot=r,Lo(t)&&Ro(e)}function Io(e,t,n){return n(function(){Lo(t)&&Ro(e)})}function Lo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Ro(e){var t=Zr(e,2);t!==null&&pu(t,e,2)}function zo(e){var t=Y();if(typeof e==`function`){var n=e;if(e=n(),lo){H(!0);try{n()}finally{H(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:e},t}function Bo(e,t,n,r){return e.baseState=n,jo(e,J,typeof r==`function`?r:ko)}function Vo(e,t,n,r,a){if(ks(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ho(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ho(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Uo(e,t,s)}catch(n){Go(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Uo(e,t,a)}catch(n){Go(e,t,n)}}function Uo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Wo(e,t,n)},function(n){return Go(e,t,n)}):Wo(e,t,n)}function Wo(e,t,n){t.status=`fulfilled`,t.value=n,Ko(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ho(e,n)))}function Go(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ko(t),t=t.next;while(t!==r)}e.action=null}function Ko(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qo(e,t){return t}function Jo(e,t){if(G){var n=Fl.formState;if(n!==null){a:{var r=q;if(G){if(Oi){b:{for(var i=Oi,a=Ai;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Oi=cf(i.nextSibling),r=i.data===`F!`;break a}}Mi(r)}r=!1}r&&(t=n[0])}}return n=Y(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qo,lastRenderedState:t},n.queue=r,n=Es.bind(null,q,r),r.dispatch=n,r=zo(!1),a=Os.bind(null,q,!1,r.queue),r=Y(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Vo.bind(null,q,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Yo(e){return Xo(wo(),J,e)}function Xo(e,t,n){if(t=jo(e,t,qo)[0],e=Ao(ko)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Eo(t)}catch(e){throw e===ha?_a:e}else r=t;t=wo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(q.flags|=2048,$o(9,{destroy:void 0},Zo.bind(null,i,n),null)),[r,a,e]}function Zo(e,t){e.action=t}function Qo(e){var t=wo(),n=J;if(n!==null)return Xo(t,n,e);wo(),t=t.memoizedState,n=wo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function $o(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=q.updateQueue,t===null&&(t=To(),q.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function es(){return wo().memoizedState}function ts(e,t,n,r){var i=Y();q.flags|=e,i.memoizedState=$o(1|t,{destroy:void 0},n,r===void 0?null:r)}function ns(e,t,n,r){var i=wo();r=r===void 0?null:r;var a=i.memoizedState.inst;J!==null&&r!==null&&go(r,J.memoizedState.deps)?i.memoizedState=$o(t,a,n,r):(q.flags|=e,i.memoizedState=$o(1|t,a,n,r))}function rs(e,t){ts(8390656,8,e,t)}function is(e,t){ns(2048,8,e,t)}function as(e){q.flags|=4;var t=q.updateQueue;if(t===null)t=To(),q.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function os(e){var t=wo().memoizedState;return as({ref:t,nextImpl:e}),function(){if(X&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ss(e,t){return ns(4,2,e,t)}function cs(e,t){return ns(4,4,e,t)}function ls(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function us(e,t,n){n=n==null?null:n.concat([e]),ns(4,4,ls.bind(null,t,e),n)}function ds(){}function fs(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ps(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&go(t,r[1]))return r[0];if(r=e(),lo){H(!0);try{e()}finally{H(!1)}}return n.memoizedState=[r,t],r}function ms(e,t,n){return n===void 0||ao&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),q.lanes|=e,Ul|=e,n)}function hs(e,t,n,r){return _r(n,t)?n:Ga.current===null?!(ao&42)||ao&1073741824&&!(Q&261930)?(Zs=!0,e.memoizedState=n):(e=fu(),q.lanes|=e,Ul|=e,t):(e=ms(e,n,r),_r(e,t)||(Zs=!0),e)}function gs(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};F.T=s,Os(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ds(e,t,ua(c,r),du(e)):Ds(e,t,r,du(e))}catch(n){Ds(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function _s(){}function vs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ys(e).queue;gs(e,a,t,te,n===null?_s:function(){return bs(e),n(r)})}function ys(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bs(e){var t=ys(e);t.next===null&&(t=e.alternate.memoizedState),Ds(e,t.next.queue,{},du())}function xs(){return Yi(Qf)}function Ss(){return wo().memoizedState}function Cs(){return wo().memoizedState}function ws(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=du();e=Ia(n);var r=La(t,e,n);r!==null&&(pu(r,t,n),Ra(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function Ts(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ks(e)?As(t,n):(n=Xr(e,t,n,r),n!==null&&(pu(n,e,r),js(n,t,r)))}function Es(e,t,n){Ds(e,t,n,du())}function Ds(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ks(e))As(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,_r(s,o))return Yr(e,t,i,0),Fl===null&&Jr(),!1}catch{}if(n=Xr(e,t,i,r),n!==null)return pu(n,e,r),js(n,t,r),!0}return!1}function Os(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ks(e)){if(t)throw Error(i(479))}else t=Xr(e,n,r,2),t!==null&&pu(t,e,2)}function ks(e){var t=e.alternate;return e===q||t!==null&&t===q}function As(e,t){co=so=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function js(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Je(e,n)}}var Ms={readContext:Yi,use:Do,useCallback:ho,useContext:ho,useEffect:ho,useImperativeHandle:ho,useLayoutEffect:ho,useInsertionEffect:ho,useMemo:ho,useReducer:ho,useRef:ho,useState:ho,useDebugValue:ho,useDeferredValue:ho,useTransition:ho,useSyncExternalStore:ho,useId:ho,useHostTransitionStatus:ho,useFormState:ho,useActionState:ho,useOptimistic:ho,useMemoCache:ho,useCacheRefresh:ho};Ms.useEffectEvent=ho;var Ns={readContext:Yi,use:Do,useCallback:function(e,t){return Y().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:rs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ts(4194308,4,ls.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ts(4194308,4,e,t)},useInsertionEffect:function(e,t){ts(4,2,e,t)},useMemo:function(e,t){var n=Y();t=t===void 0?null:t;var r=e();if(lo){H(!0);try{e()}finally{H(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Y();if(n!==void 0){var i=n(t);if(lo){H(!0);try{n(t)}finally{H(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ts.bind(null,q,e),[r.memoizedState,e]},useRef:function(e){var t=Y();return e={current:e},t.memoizedState=e},useState:function(e){e=zo(e);var t=e.queue,n=Es.bind(null,q,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ds,useDeferredValue:function(e,t){return ms(Y(),e,t)},useTransition:function(){var e=zo(!1);return e=gs.bind(null,q,e.queue,!0,!1),Y().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=q,a=Y();if(G){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Fl===null)throw Error(i(349));Q&127||Po(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,rs(Io.bind(null,r,o,e),[e]),r.flags|=2048,$o(9,{destroy:void 0},Fo.bind(null,r,o,n,t),null),n},useId:function(){var e=Y(),t=Fl.identifierPrefix;if(G){var n=xi,r=bi;n=(r&~(1<<32-Ne(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=uo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=mo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:xs,useFormState:Jo,useActionState:Jo,useOptimistic:function(e){var t=Y();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Os.bind(null,q,!0,n),n.dispatch=t,[e,t]},useMemoCache:Oo,useCacheRefresh:function(){return Y().memoizedState=ws.bind(null,q)},useEffectEvent:function(e){var t=Y(),n={impl:e};return t.memoizedState=n,function(){if(X&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ps={readContext:Yi,use:Do,useCallback:fs,useContext:Yi,useEffect:is,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Ao,useRef:es,useState:function(){return Ao(ko)},useDebugValue:ds,useDeferredValue:function(e,t){return hs(wo(),J.memoizedState,e,t)},useTransition:function(){var e=Ao(ko)[0],t=wo().memoizedState;return[typeof e==`boolean`?e:Eo(e),t]},useSyncExternalStore:No,useId:Ss,useHostTransitionStatus:xs,useFormState:Yo,useActionState:Yo,useOptimistic:function(e,t){return Bo(wo(),J,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};Ps.useEffectEvent=os;var Fs={readContext:Yi,use:Do,useCallback:fs,useContext:Yi,useEffect:is,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Mo,useRef:es,useState:function(){return Mo(ko)},useDebugValue:ds,useDeferredValue:function(e,t){var n=wo();return J===null?ms(n,e,t):hs(n,J.memoizedState,e,t)},useTransition:function(){var e=Mo(ko)[0],t=wo().memoizedState;return[typeof e==`boolean`?e:Eo(e),t]},useSyncExternalStore:No,useId:Ss,useHostTransitionStatus:xs,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){var n=wo();return J===null?(n.baseState=e,[e,n.queue.dispatch]):Bo(n,J,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};Fs.useEffectEvent=os;function Is(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ls={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),i=Ia(r);i.payload=t,n!=null&&(i.callback=n),t=La(e,i,r),t!==null&&(pu(t,e,r),Ra(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),i=Ia(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=La(e,i,r),t!==null&&(pu(t,e,r),Ra(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=Ia(n);r.tag=2,t!=null&&(r.callback=t),t=La(e,r,n),t!==null&&(pu(t,e,n),Ra(t,e,n))}};function Rs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!vr(n,r)||!vr(i,a):!0}function zs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ls.enqueueReplaceState(t,t.state,null)}function Bs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Vs(e){Wr(e)}function Hs(e){console.error(e)}function Us(e){Wr(e)}function Ws(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Gs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ks(e,t,n){return n=Ia(n),n.tag=3,n.payload={element:null},n.callback=function(){Ws(e,t)},n}function qs(e){return e=Ia(e),e.tag=3,e}function Js(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Gs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Gs(t,n,r),typeof i!=`function`&&(tu===null?tu=new Set([this]):tu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ys(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ki(t,n,a,!0),n=Xa.current,n!==null){switch(n.tag){case 31:case 13:return Za===null?Tu():n.alternate===null&&Hl===0&&(Hl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===va?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,a)),!1;case 22:return n.flags|=65536,r===va?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Wu(e,r,a)),!1}throw Error(i(435,n.tag))}return Wu(e,r,a),Tu(),!1}if(G)return t=Xa.current,t===null?(r!==ji&&(t=Error(i(423),{cause:r}),Ri(fi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=fi(r,n),a=Ks(e.stateNode,r,a),za(e,a),Hl!==4&&(Hl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ji&&(e=Error(i(422),{cause:r}),Ri(fi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=fi(o,n),Jl===null?Jl=[o]:Jl.push(o),Hl!==4&&(Hl=2),t===null)return!0;r=fi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ks(n.stateNode,r,e),za(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(tu===null||!tu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=qs(a),Js(a,e,n,r),za(n,a),!1}n=n.return}while(n!==null);return!1}var Xs=Error(i(461)),Zs=!1;function Qs(e,t,n,r){t.child=e===null?Ma(t,null,n,r):ja(t,e.child,n,r)}function $s(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ji(t),r=_o(e,t,n,o,a,i),s=xo(),e!==null&&!Zs?(So(e,t,i),Cc(e,t,i)):(G&&s&&wi(t),t.flags|=1,Qs(e,t,r,i),t.child)}function ec(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ri(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,tc(e,t,a,r,i)):(e=oi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!wc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?vr:n,n(o,r)&&e.ref===t.ref)return Cc(e,t,i)}return t.flags|=1,e=ii(a,r),e.ref=t.ref,e.return=t,t.child=e}function tc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(vr(a,r)&&e.ref===t.ref)if(Zs=!1,t.pendingProps=r=a,wc(e,i))e.flags&131072&&(Zs=!0);else return t.lanes=e.lanes,Cc(e,t,i)}return lc(e,t,n,r,i)}function nc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return ic(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&pa(t,a===null?null:a.cachePool),a===null?Ja():qa(t,a),eo(t);else return r=t.lanes=536870912,ic(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&pa(t,null),Ja(),to(t)):(pa(t,a.cachePool),qa(t,a),to(t),t.memoizedState=null);return Qs(e,t,i,n),t.child}function rc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ic(e,t,n,r,i){var a=K();return a=a===null?null:{parent:ta._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&pa(t,null),Ja(),eo(t),e!==null&&Ki(e,t,r,!0),t.childLanes=i,null}function ac(e,t){return t=vc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function oc(e,t,n){return ja(t,e.child,null,n),e=ac(t,t.pendingProps),e.flags|=2,no(t),t.memoizedState=null,e}function sc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(G){if(r.mode===`hidden`)return e=ac(t,r),t.lanes=536870912,rc(null,e);if($a(t),(e=Oi)?(e=rf(e,Ai),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Mi(t);return t.lanes=536870912,null}return ac(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if($a(t),a)if(t.flags&256)t.flags&=-257,t=oc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Zs||Ki(e,t,n,!1),a=(n&e.childLanes)!==0,Zs||a){if(r=Fl,r!==null&&(s=Ye(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Zr(e,s),pu(r,e,s),Xs;Tu(),t=oc(e,t,n)}else e=o.treeContext,Oi=cf(s.nextSibling),Di=t,G=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=ac(t,r),t.flags|=4096;return t}return e=ii(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function cc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function lc(e,t,n,r,i){return Ji(t),n=_o(e,t,n,r,void 0,i),r=xo(),e!==null&&!Zs?(So(e,t,i),Cc(e,t,i)):(G&&r&&wi(t),t.flags|=1,Qs(e,t,n,i),t.child)}function uc(e,t,n,r,i,a){return Ji(t),t.updateQueue=null,n=yo(t,r,n,i),vo(e),r=xo(),e!==null&&!Zs?(So(e,t,a),Cc(e,t,a)):(G&&r&&wi(t),t.flags|=1,Qs(e,t,n,a),t.child)}function dc(e,t,n,r,i){if(Ji(t),t.stateNode===null){var a=ei,o=n.contextType;typeof o==`object`&&o&&(a=Yi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ls,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Pa(t),o=n.contextType,a.context=typeof o==`object`&&o?Yi(o):ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Is(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ls.enqueueReplaceState(a,a.state,null),Ha(t,r,a,i),Va(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Bs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ei,typeof u==`object`&&u&&(o=Yi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&zs(t,a,r,o),Na=!1;var f=t.memoizedState;a.state=f,Ha(t,r,a,i),Va(),l=t.memoizedState,s||f!==l||Na?(typeof d==`function`&&(Is(t,n,d,r),l=t.memoizedState),(c=Na||Rs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Fa(e,t),o=t.memoizedProps,u=Bs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ei,typeof l==`object`&&l&&(c=Yi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&zs(t,a,r,c),Na=!1,f=t.memoizedState,a.state=f,Ha(t,r,a,i),Va();var p=t.memoizedState;o!==d||f!==p||Na||e!==null&&e.dependencies!==null&&qi(e.dependencies)?(typeof s==`function`&&(Is(t,n,s,r),p=t.memoizedState),(u=Na||Rs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&qi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,cc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=ja(t,e.child,null,i),t.child=ja(t,null,n,i)):Qs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Cc(e,t,i),e}function fc(e,t,n,r){return Ii(),t.flags|=256,Qs(e,t,n,r),t.child}var pc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mc(e){return{baseLanes:e,cachePool:ma()}}function hc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Kl),e}function gc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(ro.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(G){if(a?Qa(t):to(t),(e=Oi)?(e=rf(e,Ai),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Mi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(to(t),a=t.mode,c=vc({mode:`hidden`,children:c},a),r=si(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=mc(n),r.childLanes=hc(e,s,n),t.memoizedState=pc,rc(null,r)):(Qa(t),_c(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Qa(t),t.flags&=-257,t=yc(e,t,n)):t.memoizedState===null?(to(t),c=r.fallback,a=t.mode,r=vc({mode:`visible`,children:r.children},a),c=si(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,ja(t,e.child,null,n),r=t.child,r.memoizedState=mc(n),r.childLanes=hc(e,s,n),t.memoizedState=pc,t=rc(null,r)):(to(t),t.child=e.child,t.flags|=128,t=null);else if(Qa(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ri({value:r,source:null,stack:null}),t=yc(e,t,n)}else if(Zs||Ki(e,t,n,!1),s=(n&e.childLanes)!==0,Zs||s){if(s=Fl,s!==null&&(r=Ye(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Zr(e,r),pu(s,e,r),Xs;af(c)||Tu(),t=yc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Oi=cf(c.nextSibling),Di=t,G=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=_c(t,r.children),t.flags|=4096);return t}return a?(to(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ii(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=si(c,a,n,null),c.flags|=2):c=ii(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,rc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=mc(n):(a=c.cachePool,a===null?a=ma():(l=ta._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=hc(e,s,n),t.memoizedState=pc,rc(e.child,r)):(Qa(t),n=e.child,e=n.sibling,n=ii(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function _c(e,t){return t=vc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function vc(e,t){return e=ni(22,e,null,t),e.lanes=0,e}function yc(e,t,n){return ja(t,e.child,null,n),e=_c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wi(e.return,t,n)}function xc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Sc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ro.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,z(ro,o),Qs(e,t,r,n),r=G?gi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bc(e,n,t);else if(e.tag===19)bc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&io(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),xc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}xc(t,!0,n,null,a,r);break;case`together`:xc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Cc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ki(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ii(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function wc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&qi(e))):!0}function Tc(e,t,n){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),Hi(t,ta,e.memoizedState.cache),Ii();break;case 27:case 5:ue(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:Hi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,$a(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Qa(t),e=Cc(e,t,n),e===null?null:e.sibling):gc(e,t,n):(Qa(t),t.flags|=128,null);Qa(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ki(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Sc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),z(ro,ro.current),r)break;return null;case 22:return t.lanes=0,nc(e,t,n,t.pendingProps);case 24:Hi(t,ta,e.memoizedState.cache)}return Cc(e,t,n)}function Ec(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Zs=!0;else{if(!wc(e,n)&&!(t.flags&128))return Zs=!1,Tc(e,t,n);Zs=!!(e.flags&131072)}else Zs=!1,G&&t.flags&1048576&&Ci(t,gi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=xa(t.elementType),t.type=e,typeof e==`function`)ri(e)?(r=Bs(e,r),t.tag=1,t=dc(null,t,e,r,n)):(t.tag=0,t=lc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=$s(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=ec(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return lc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Bs(r,t.pendingProps),dc(e,t,r,a,n);case 3:a:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Fa(e,t),Ha(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Hi(t,ta,r),r!==o.cache&&Gi(t,[ta],n,!0),Va(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=fc(e,t,r,n);break a}else if(r!==a){a=fi(Error(i(424)),t),Ri(a),t=fc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Oi=cf(e.firstChild),Di=t,G=!0,ki=null,Ai=!0,n=Ma(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ii(),r===a){t=Cc(e,t,n);break a}Qs(e,t,r,n)}t=t.child}return t;case 26:return cc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:G||(n=t.type,e=t.pendingProps,r=Bd(oe.current).createElement(n),r[tt]=t,r[nt]=e,Pd(r,n,e),mt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ue(t),e===null&&G&&(r=t.stateNode=ff(t.type,t.pendingProps,oe.current),Di=t,Ai=!0,a=Oi,Zd(t.type)?(lf=a,Oi=cf(r.firstChild)):Oi=a),Qs(e,t,t.pendingProps.children,n),cc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&G&&((a=r=Oi)&&(r=tf(r,t.type,t.pendingProps,Ai),r===null?a=!1:(t.stateNode=r,Di=t,Oi=cf(r.firstChild),Ai=!1,a=!0)),a||Mi(t)),ue(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=_o(e,t,bo,null,null,n),Qf._currentValue=a),cc(e,t),Qs(e,t,r,n),t.child;case 6:return e===null&&G&&((e=n=Oi)&&(n=nf(n,t.pendingProps,Ai),n===null?e=!1:(t.stateNode=n,Di=t,Oi=null,e=!0)),e||Mi(t)),null;case 13:return gc(e,t,n);case 4:return ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ja(t,null,r,n):Qs(e,t,r,n),t.child;case 11:return $s(e,t,t.type,t.pendingProps,n);case 7:return Qs(e,t,t.pendingProps,n),t.child;case 8:return Qs(e,t,t.pendingProps.children,n),t.child;case 12:return Qs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Hi(t,t.type,r.value),Qs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ji(t),a=Yi(a),r=r(a),t.flags|=1,Qs(e,t,r,n),t.child;case 14:return ec(e,t,t.type,t.pendingProps,n);case 15:return tc(e,t,t.type,t.pendingProps,n);case 19:return Sc(e,t,n);case 31:return sc(e,t,n);case 22:return nc(e,t,n,t.pendingProps);case 24:return Ji(t),r=Yi(ta),e===null?(a=K(),a===null&&(a=Fl,o=na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Pa(t),Hi(t,ta,a)):((e.lanes&n)!==0&&(Fa(e,t),Ha(t,null,null,n),Va()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Hi(t,ta,r),r!==a.cache&&Gi(t,[ta],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Hi(t,ta,r))),Qs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Dc(e){e.flags|=4}function Oc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Su())e.flags|=8192;else throw Sa=va,ga}else e.flags&=-16777217}function kc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Su())e.flags|=8192;else throw Sa=va,ga}function Ac(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ue(),e.lanes|=t,ql|=t)}function jc(e,t){if(!G)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Mc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Nc(e,t,n){var r=t.pendingProps;switch(Ti(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mc(t),null;case 1:return Mc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ui(ta),le(),n.pendingContext&&=(n.context=n.pendingContext,null),(e===null||e.child===null)&&(Fi(t)?Dc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li())),Mc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Dc(t),o===null?(Mc(t),Oc(t,a,null,r,n)):(Mc(t),kc(t,o))):o?o===e.memoizedState?(Mc(t),t.flags&=-16777217):(Dc(t),Mc(t),kc(t,o)):(e=e.memoizedProps,e!==r&&Dc(t),Mc(t),Oc(t,a,e,r,n)),null;case 27:if(de(t),n=oe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}e=ie.current,Fi(t)?Ni(t,e):(e=ff(a,r,n),t.stateNode=e,Dc(t))}return Mc(t),null;case 5:if(de(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}if(o=ie.current,Fi(t))Ni(t,o);else{var s=Bd(oe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[tt]=t,o[nt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Dc(t)}}return Mc(t),Oc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=oe.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Di,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Mi(t,!0)}else e=Bd(e).createTextNode(r),e[tt]=t,t.stateNode=e}return Mc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Fi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[tt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),e=!1}else n=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(no(t),t):(no(t),null);if(t.flags&128)throw Error(i(558))}return Mc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Fi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[tt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),a=!1}else a=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(no(t),t):(no(t),null)}return no(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ac(t,t.updateQueue),Mc(t),null);case 4:return le(),e===null&&xd(t.stateNode.containerInfo),Mc(t),null;case 10:return Ui(t.type),Mc(t),null;case 19:if(R(ro),r=t.memoizedState,r===null)return Mc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)jc(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=io(e),o!==null){for(t.flags|=128,jc(r,!1),e=o.updateQueue,t.updateQueue=e,Ac(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ai(n,e),n=n.sibling;return z(ro,ro.current&1|2),G&&Si(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&B()>$l&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304)}else{if(!a)if(e=io(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ac(t,e),jc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!G)return Mc(t),null}else 2*B()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Mc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=B(),e.sibling=null,n=ro.current,z(ro,a?n&1|2:n&1),G&&Si(t,r.treeForkCount),e);case 22:case 23:return no(t),Ya(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Mc(t),t.subtreeFlags&6&&(t.flags|=8192)):Mc(t),n=t.updateQueue,n!==null&&Ac(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&R(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(ta),Mc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Pc(e,t){switch(Ti(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ta),le(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(no(t),t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(no(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return R(ro),null;case 4:return le(),null;case 10:return Ui(t.type),null;case 22:case 23:return no(t),Ya(),e!==null&&R(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ui(ta),null;case 25:return null;default:return null}}function Fc(e,t){switch(Ti(t),t.tag){case 3:Ui(ta),le();break;case 26:case 27:case 5:de(t);break;case 4:le();break;case 31:t.memoizedState!==null&&no(t);break;case 13:no(t);break;case 19:R(ro);break;case 10:Ui(t.type);break;case 22:case 23:no(t),Ya(),e!==null&&R(fa);break;case 24:Ui(ta)}}function Ic(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Uu(t,t.return,e)}}function Lc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function Rc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Wa(t,n)}catch(t){Uu(e,e.return,t)}}}function zc(e,t,n){n.props=Bs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function Bc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Uu(e,t,n)}}function Vc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Uu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Uu(e,t,n)}else n.current=null}function Hc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Uu(e,e.return,t)}}function Uc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[nt]=t}catch(t){Uu(e,e.return,t)}}function Wc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Gc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Wc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Jt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[tt]=e,t[nt]=n}catch(t){Uu(e,e.return,t)}}var Yc=!1,Xc=!1,Zc=!1,Qc=typeof WeakSet==`function`?WeakSet:Set,$c=null;function el(e,t){if(e=e.containerInfo,Rd=sp,e=Sr(e),Cr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,$c=t;$c!==null;)if(t=$c,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,$c=e;else for(;$c!==null;){switch(t=$c,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Bs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Uu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,$c=e;break}$c=t.return}}function tl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:gl(e,n),r&4&&Ic(5,n);break;case 1:if(gl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=Bs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}r&64&&Rc(n),r&512&&Bc(n,n.return);break;case 3:if(gl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Wa(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&Jc(n);case 26:case 5:gl(e,n),t===null&&r&4&&Hc(n),r&512&&Bc(n,n.return);break;case 12:gl(e,n);break;case 31:gl(e,n),r&4&&sl(e,n);break;case 13:gl(e,n),r&4&&cl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Yc,!r){t=t!==null&&t.memoizedState!==null||Xc,i=Yc;var a=Xc;Yc=r,(Xc=t)&&!a?vl(e,n,(n.subtreeFlags&8772)!=0):gl(e,n),Yc=i,Xc=a}break;case 30:break;default:gl(e,n)}}function nl(e){var t=e.alternate;t!==null&&(e.alternate=null,nl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&<(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rl=null,il=!1;function al(e,t,n){for(n=n.child;n!==null;)ol(e,t,n),n=n.sibling}function ol(e,t,n){if(Me&&typeof Me.onCommitFiberUnmount==`function`)try{Me.onCommitFiberUnmount(je,n)}catch{}switch(n.tag){case 26:Xc||Vc(n,t),al(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Xc||Vc(n,t);var r=rl,i=il;Zd(n.type)&&(rl=n.stateNode,il=!1),al(e,t,n),pf(n.stateNode),rl=r,il=i;break;case 5:Xc||Vc(n,t);case 6:if(r=rl,i=il,rl=null,al(e,t,n),rl=r,il=i,rl!==null)if(il)try{(rl.nodeType===9?rl.body:rl.nodeName===`HTML`?rl.ownerDocument.body:rl).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{rl.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}break;case 18:rl!==null&&(il?(e=rl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(rl,n.stateNode));break;case 4:r=rl,i=il,rl=n.stateNode.containerInfo,il=!0,al(e,t,n),rl=r,il=i;break;case 0:case 11:case 14:case 15:Lc(2,n,t),Xc||Lc(4,n,t),al(e,t,n);break;case 1:Xc||(Vc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&zc(n,t,r)),al(e,t,n);break;case 21:al(e,t,n);break;case 22:Xc=(r=Xc)||n.memoizedState!==null,al(e,t,n),Xc=r;break;default:al(e,t,n)}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Uu(t,t.return,e)}}}function cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Uu(t,t.return,e)}}function ll(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qc),t;default:throw Error(i(435,e.tag))}}function ul(e,t){var n=ll(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function dl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){rl=c.stateNode,il=!1;break a}break;case 5:rl=c.stateNode,il=!1;break a;case 3:case 4:rl=c.stateNode.containerInfo,il=!0;break a}c=c.return}if(rl===null)throw Error(i(160));ol(o,s,a),rl=null,il=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)pl(t,e),t=t.sibling}var fl=null;function pl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dl(t,e),ml(e),r&4&&(Lc(3,e,e.return),Ic(3,e),Lc(5,e,e.return));break;case 1:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&64&&Yc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=fl;if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ct]||o[tt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[tt]=e,mt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[tt]=e,mt(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Uc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),n!==null&&r&4&&Uc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),e.flags&32){a=e.stateNode;try{Bt(a,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Uc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Zc=!0);break;case 6:if(dl(t,e),ml(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Uu(e,e.return,t)}}break;case 3:if(Bf=null,a=fl,fl=gf(t.containerInfo),dl(t,e),fl=a,ml(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Uu(e,e.return,t)}Zc&&(Zc=!1,hl(e));break;case 4:r=fl,fl=gf(e.stateNode.containerInfo),dl(t,e),ml(e),fl=r;break;case 12:dl(t,e),ml(e);break;case 31:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 13:dl(t,e),ml(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zl=B()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Yc,d=Xc;if(Yc=u||a,Xc=d||l,dl(t,e),Xc=d,Yc=u,ml(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Yc||Xc||_l(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Uu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Uu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Uu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ul(e,n))));break;case 19:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 30:break;case 21:break;default:dl(t,e),ml(e)}}function ml(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Wc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;qc(e,Gc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Bt(o,``),n.flags&=-33),qc(e,Gc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Kc(e,Gc(e),s);break;default:throw Error(i(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;hl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function gl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)tl(e,t.alternate,t),t=t.sibling}function _l(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Lc(4,t,t.return),_l(t);break;case 1:Vc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&zc(t,t.return,n),_l(t);break;case 27:pf(t.stateNode);case 26:case 5:Vc(t,t.return),_l(t);break;case 22:t.memoizedState===null&&_l(t);break;case 30:_l(t);break;default:_l(t)}e=e.sibling}}function vl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:vl(i,a,n),Ic(4,a);break;case 1:if(vl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Uu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ua(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&Rc(a),Bc(a,a.return);break;case 27:Jc(a);case 26:case 5:vl(i,a,n),n&&r===null&&o&4&&Hc(a),Bc(a,a.return);break;case 12:vl(i,a,n);break;case 31:vl(i,a,n),n&&o&4&&sl(i,a);break;case 13:vl(i,a,n),n&&o&4&&cl(i,a);break;case 22:a.memoizedState===null&&vl(i,a,n),Bc(a,a.return);break;case 30:break;default:vl(i,a,n)}t=t.sibling}}function yl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ra(n))}function bl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e))}function xl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sl(e,t,n,r),t=t.sibling}function Sl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:xl(e,t,n,r),i&2048&&Ic(9,t);break;case 1:xl(e,t,n,r);break;case 3:xl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e)));break;case 12:if(i&2048){xl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Uu(t,t.return,e)}}else xl(e,t,n,r);break;case 31:xl(e,t,n,r);break;case 13:xl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?xl(e,t,n,r):(a._visibility|=2,Cl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?xl(e,t,n,r):wl(e,t),i&2048&&yl(o,t);break;case 24:xl(e,t,n,r),i&2048&&bl(t.alternate,t);break;default:xl(e,t,n,r)}}function Cl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Cl(a,o,s,c,i),Ic(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Cl(a,o,s,c,i)):u._visibility&2?Cl(a,o,s,c,i):wl(a,o),i&&l&2048&&yl(o.alternate,o);break;case 24:Cl(a,o,s,c,i),i&&l&2048&&bl(o.alternate,o);break;default:Cl(a,o,s,c,i)}t=t.sibling}}function wl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:wl(n,r),i&2048&&yl(r.alternate,r);break;case 24:wl(n,r),i&2048&&bl(r.alternate,r);break;default:wl(n,r)}t=t.sibling}}var Tl=8192;function El(e,t,n){if(e.subtreeFlags&Tl)for(e=e.child;e!==null;)Dl(e,t,n),e=e.sibling}function Dl(e,t,n){switch(e.tag){case 26:El(e,t,n),e.flags&Tl&&e.memoizedState!==null&&Gf(n,fl,e.memoizedState,e.memoizedProps);break;case 5:El(e,t,n);break;case 3:case 4:var r=fl;fl=gf(e.stateNode.containerInfo),El(e,t,n),fl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Tl,Tl=16777216,El(e,t,n),Tl=r):El(e,t,n));break;default:El(e,t,n)}}function Ol(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Al(e),e=e.sibling}function Al(e){switch(e.tag){case 0:case 11:case 15:kl(e),e.flags&2048&&Lc(9,e,e.return);break;case 3:kl(e);break;case 12:kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,jl(e)):kl(e);break;default:kl(e)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Lc(8,t,t.return),jl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,jl(t));break;default:jl(t)}e=e.sibling}}function Ml(e,t){for(;$c!==null;){var n=$c;switch(n.tag){case 0:case 11:case 15:Lc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,$c=r;else a:for(n=e;$c!==null;){r=$c;var i=r.sibling,a=r.return;if(nl(r),r===n){$c=null;break a}if(i!==null){i.return=a,$c=i;break a}$c=a}}}var Nl={getCacheForType:function(e){var t=Yi(ta),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Yi(ta).controller.signal}},Pl=typeof WeakMap==`function`?WeakMap:Map,X=0,Fl=null,Z=null,Q=0,Il=0,Ll=null,Rl=!1,zl=!1,Bl=!1,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=null,Yl=null,Xl=!1,Zl=0,Ql=0,$l=1/0,eu=null,tu=null,nu=0,ru=null,iu=null,au=0,ou=0,su=null,cu=null,lu=0,uu=null;function du(){return X&2&&Q!==0?Q&-Q:F.T===null?Qe():ud()}function fu(){if(Kl===0)if(!(Q&536870912)||G){var e=Le;Le<<=1,!(Le&3932160)&&(Le=262144),Kl=e}else Kl=536870912;return e=Xa.current,e!==null&&(e.flags|=32),Kl}function pu(e,t,n){(e===Fl&&(Il===2||Il===9)||e.cancelPendingCommit!==null)&&(bu(e,0),_u(e,Q,Kl,!1)),Ge(e,n),(!(X&2)||e!==Fl)&&(e===Fl&&(!(X&2)&&(Wl|=n),Hl===4&&_u(e,Q,Kl,!1)),nd(e))}function mu(e,t,n){if(X&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ve(e,t),a=r?Ou(e,t):Eu(e,t,!0),o=r;do{if(a===0){zl&&!r&&_u(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!gu(n)){a=Eu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Jl;var l=c.current.memoizedState.isDehydrated;if(l&&(bu(c,s).flags|=256),s=Eu(c,s,!1),s!==2){if(Bl&&!l){c.errorRecoveryDisabledLanes|=o,Wl|=o,a=4;break a}o=Yl,Yl=a,o!==null&&(Yl===null?Yl=o:Yl.push.apply(Yl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){bu(e,0),_u(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:_u(r,t,Kl,!Rl);break a;case 2:Yl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Zl+300-B(),10<a)){if(_u(r,t,Kl,!Rl),Be(r,0,!0)!==0)break a;au=t,r.timeoutHandle=Kd(hu.bind(null,r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,`Throttled`,-0,0),a);break a}hu(r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,null,-0,0)}}break}while(1);nd(e)}function hu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jt},Dl(t,a,d);var m=(a&62914560)===a?Zl-B():(a&4194048)===a?Ql-B():0;if(m=qf(d,m),m!==null){au=a,e.cancelPendingCommit=m(Fu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),_u(e,a,o,!l);return}}Fu(e,t,a,n,r,i,o,s,c)}function gu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!_r(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _u(e,t,n,r){t&=~Gl,t&=~Wl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ne(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&qe(e,n,t)}function vu(){return X&6?!0:(rd(0,!1),!1)}function yu(){if(Z!==null){if(Il===0)var e=Z.return;else e=Z,Vi=Bi=null,Co(e),Ta=null,Ea=0,e=Z;for(;e!==null;)Fc(e.alternate,e),e=e.return;Z=null}}function bu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),au=0,yu(),Fl=e,Z=n=ii(e.current,null),Q=t,Il=0,Ll=null,Rl=!1,zl=Ve(e,t),Bl=!1,ql=Kl=Gl=Wl=Ul=Hl=0,Yl=Jl=null,Xl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ne(r),a=1<<i;t|=e[i],r&=~a}return Vl=t,Jr(),n}function xu(e,t){q=null,F.H=Ms,t===ha||t===_a?(t=Ca(),Il=3):t===ga?(t=Ca(),Il=4):Il=t===Xs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ll=t,Z===null&&(Hl=1,Ws(e,fi(t,e.current)))}function Su(){var e=Xa.current;return e===null?!0:(Q&4194048)===Q?Za===null:(Q&62914560)===Q||Q&536870912?e===Za:!1}function Cu(){var e=F.H;return F.H=Ms,e===null?Ms:e}function wu(){var e=F.A;return F.A=Nl,e}function Tu(){Hl=4,Rl||(Q&4194048)!==Q&&Xa.current!==null||(zl=!0),!(Ul&134217727)&&!(Wl&134217727)||Fl===null||_u(Fl,Q,Kl,!1)}function Eu(e,t,n){var r=X;X|=2;var i=Cu(),a=wu();(Fl!==e||Q!==t)&&(eu=null,bu(e,t)),t=!1;var o=Hl;a:do try{if(Il!==0&&Z!==null){var s=Z,c=Ll;switch(Il){case 8:yu(),o=6;break a;case 3:case 2:case 9:case 6:Xa.current===null&&(t=!0);var l=Il;if(Il=0,Ll=null,Mu(e,s,c,l),n&&zl){o=0;break a}break;default:l=Il,Il=0,Ll=null,Mu(e,s,c,l)}}Du(),o=Hl;break}catch(t){xu(e,t)}while(1);return t&&e.shellSuspendCounter++,Vi=Bi=null,X=r,F.H=i,F.A=a,Z===null&&(Fl=null,Q=0,Jr()),o}function Du(){for(;Z!==null;)Au(Z)}function Ou(e,t){var n=X;X|=2;var r=Cu(),a=wu();Fl!==e||Q!==t?(eu=null,$l=B()+500,bu(e,t)):zl=Ve(e,t);a:do try{if(Il!==0&&Z!==null){t=Z;var o=Ll;b:switch(Il){case 1:Il=0,Ll=null,Mu(e,t,o,1);break;case 2:case 9:if(ya(o)){Il=0,Ll=null,ju(t);break}t=function(){Il!==2&&Il!==9||Fl!==e||(Il=7),nd(e)},o.then(t,t);break a;case 3:Il=7;break a;case 4:Il=5;break a;case 7:ya(o)?(Il=0,Ll=null,ju(t)):(Il=0,Ll=null,Mu(e,t,o,7));break;case 5:var s=null;switch(Z.tag){case 26:s=Z.memoizedState;case 5:case 27:var c=Z;if(s?Wf(s):c.stateNode.complete){Il=0,Ll=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,Nu(u))}break b}}Il=0,Ll=null,Mu(e,t,o,5);break;case 6:Il=0,Ll=null,Mu(e,t,o,6);break;case 8:yu(),Hl=6;break a;default:throw Error(i(462))}}ku();break}catch(t){xu(e,t)}while(1);return Vi=Bi=null,F.H=r,F.A=a,X=n,Z===null?(Fl=null,Q=0,Jr(),Hl):0}function ku(){for(;Z!==null&&!Se();)Au(Z)}function Au(e){var t=Ec(e.alternate,e,Vl);e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=uc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=uc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:Co(t);default:Fc(n,t),t=Z=ai(t,Vl),t=Ec(n,t,Vl)}e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function Mu(e,t,n,r){Vi=Bi=null,Co(t),Ta=null,Ea=0;var i=t.return;try{if(Ys(e,i,t,n,Q)){Hl=1,Ws(e,fi(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;Hl=1,Ws(e,fi(n,e.current)),Z=null;return}t.flags&32768?(G||r===1?e=!0:zl||Q&536870912?e=!1:(Rl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Xa.current,r!==null&&r.tag===13&&(r.flags|=16384))),Pu(t,e)):Nu(t)}function Nu(e){var t=e;do{if(t.flags&32768){Pu(t,Rl);return}e=t.return;var n=Nc(t.alternate,t,Vl);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);Hl===0&&(Hl=5)}function Pu(e,t){do{var n=Pc(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);Hl=6,Z=null}function Fu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(nu!==0);if(X&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=qr,Ke(e,n,o,s,c,l),e===Fl&&(Z=Fl=null,Q=0),iu=t,ru=e,au=n,ou=o,su=a,cu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(Ee,function(){return Vu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=F.T,F.T=null,a=I.p,I.p=2,s=X,X|=4;try{el(e,t,n)}finally{X=s,I.p=a,F.T=r}}nu=1,Iu(),Lu(),Ru()}}function Iu(){if(nu===1){nu=0;var e=ru,t=iu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=X;X|=4;try{pl(t,e);var a=zd,o=Sr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&xr(s.ownerDocument.documentElement,s)){if(c!==null&&Cr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=br(s,h),v=br(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{X=i,I.p=r,F.T=n}}e.current=t,nu=2}}function Lu(){if(nu===2){nu=0;var e=ru,t=iu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=X;X|=4;try{tl(e,t.alternate,t)}finally{X=i,I.p=r,F.T=n}}nu=3}}function Ru(){if(nu===4||nu===3){nu=0,Ce();var e=ru,t=iu,n=au,r=cu;t.subtreeFlags&10256||t.flags&10256?nu=5:(nu=0,iu=ru=null,zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(tu=null),Ze(n),t=t.stateNode,Me&&typeof Me.onCommitFiberRoot==`function`)try{Me.onCommitFiberRoot(je,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=F.T,i=I.p,I.p=2,F.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{F.T=t,I.p=i}}au&3&&Bu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===uu?lu++:(lu=0,uu=e):lu=0,rd(0,!1)}}function zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ra(t)))}function Bu(){return Iu(),Lu(),Ru(),Vu()}function Vu(){if(nu!==5)return!1;var e=ru,t=ou;ou=0;var n=Ze(au),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,X&6)throw Error(i(331));var c=X;if(X|=4,Al(o.current),Sl(o,o.current,s,n),X=c,rd(0,!1),Me&&typeof Me.onPostCommitFiberRoot==`function`)try{Me.onPostCommitFiberRoot(je,o)}catch{}return!0}finally{I.p=a,F.T=r,zu(e,t)}}function Hu(e,t,n){t=fi(n,t),t=Ks(e.stateNode,t,2),e=La(e,t,2),e!==null&&(Ge(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(tu===null||!tu.has(r))){e=fi(n,e),n=qs(2),r=La(t,n,2),r!==null&&(Js(n,r,t,e),Ge(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Bl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Fl===e&&(Q&n)===n&&(Hl===4||Hl===3&&(Q&62914560)===Q&&300>B()-Zl?!(X&2)&&bu(e,0):Gl|=n,ql===Q&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=Ue()),e=Zr(e,t),e!==null&&(Ge(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return be(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-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=Be(r,r===Fl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ve(r,a)||(n=!0,cd(r,a));r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=B(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}nu!==0&&nu!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-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=Be(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Il===2||Il===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&xe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ve(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&xe(r),Ze(n)){case 2:case 8:n=V;break;case 32:n=Ee;break;case 268435456:n=Oe;break;default:n=Ee}return r=sd.bind(null,e),n=be(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&xe(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(nu!==0&&nu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bu()&&e.callbackNode!==n)return null;var r=Q;return r=Be(e,e===Fl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mu(e,r,t),od(e,B()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Bu())return null;mu(e,t,!0)}function ld(){Yd(function(){X&6?be(Te,id):ad()})}function ud(){if(td===0){var e=oa;e===0&&(e=U,U<<=1,!(U&261888)&&(U=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:qt(``+e)}function fd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[nt]||null).action),o=r.submitter;o&&(t=(t=o[nt]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new gn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);vs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),vs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Hr.length;md++){var hd=Hr[md];Ur(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Ur(Fr,`onAnimationEnd`),Ur(Ir,`onAnimationIteration`),Ur(Lr,`onAnimationStart`),Ur(`dblclick`,`onDoubleClick`),Ur(`focusin`,`onFocus`),Ur(`focusout`,`onBlur`),Ur(Rr,`onTransitionRun`),Ur(zr,`onTransitionStart`),Ur(Br,`onTransitionCancel`),Ur(W,`onTransitionEnd`),vt(`onMouseEnter`,[`mouseout`,`mouseover`]),vt(`onMouseLeave`,[`mouseout`,`mouseover`]),vt(`onPointerEnter`,[`pointerout`,`pointerover`]),vt(`onPointerLeave`,[`pointerout`,`pointerover`]),_t(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),_t(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),_t(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),_t(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),_t(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),_t(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Wr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Wr(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[it];n===void 0&&(n=t[it]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,ht.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!an||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Cd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ut(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}tn(function(){var r=a,i=Xt(n),s=[];a:{var c=Vr.get(e);if(c!==void 0){var l=gn,u=e;switch(e){case`keypress`:if(dn(n)===0)break a;case`keydown`:case`keyup`:l=Pn;break;case`focusin`:u=`focus`,l=Tn;break;case`focusout`:u=`blur`,l=Tn;break;case`beforeblur`:case`afterblur`:l=Tn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Cn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=In;break;case Fr:case Ir:case Lr:l=En;break;case W:l=Ln;break;case`scroll`:case`scrollend`:l=vn;break;case`wheel`:l=Rn;break;case`copy`:case`cut`:case`paste`:l=Dn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Fn;break;case`toggle`:case`beforetoggle`:l=zn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=nn(m,p),g!=null&&d.push(wd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Yt&&(u=n.relatedTarget||n.fromElement)&&(ut(u)||u[rt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ut(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Cn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Fn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ft(l),h=u==null?c:ft(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ut(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ed,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Dd(s,c,l,d,!1),u!==null&&f!==null&&Dd(s,f,u,d,!0)}}a:{if(c=r?ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ar;else if($n(c))if(or)v=hr;else{v=pr;var y=fr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Wt(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){er(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&It(c,`number`,c.value)}switch(y=r?ft(r):window,e){case`focusin`:($n(y)||y.contentEditable===`true`)&&(Tr=y,Er=r,Dr=null);break;case`focusout`:Dr=Er=Tr=null;break;case`mousedown`:Or=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Or=!1,kr(s,n,i);break;case`selectionchange`:if(wr)break;case`keydown`:case`keyup`:kr(s,n,i)}var b;if(Vn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Yn?qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Wn&&n.locale!==`ko`&&(Yn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Yn&&(b=un()):(sn=i,cn=`value`in sn?sn.value:sn.textContent,Yn=!0)),y=Td(r,x),0<y.length&&(x=new On(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Jn(n),b!==null&&(x.data=b)))),(b=Un?Xn(e,n):Zn(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new On(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),pd(s,e,r,n,i)}vd(s,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=nn(e,n),i!=null&&r.unshift(wd(e,i,a)),i=nn(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=nn(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=nn(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
|
|
16
|
+
`).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Bt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Bt(e,``+r);break;case`className`:wt(e,`class`,r);break;case`tabIndex`:wt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:wt(e,n,r);break;case`style`:Ut(e,r,o);break;case`data`:if(t!==`object`){wt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=qt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,a.name,a,null),Md(e,t,`formEncType`,a.formEncType,a,null),Md(e,t,`formMethod`,a.formMethod,a,null),Md(e,t,`formTarget`,a.formTarget,a,null)):(Md(e,t,`encType`,a.encType,a,null),Md(e,t,`method`,a.method,a,null),Md(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Jt);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=qt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Ct(e,`popover`,r);break;case`xlinkActuate`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ct(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Gt.get(n)||n,Ct(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Ut(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Bt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Bt(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Jt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!gt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[nt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ct(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,o,s,n,null)}}a&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Md(e,t,r,d,n,null)}}Ft(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Md(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Lt(e,!!r,n,!0):Lt(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Md(e,t,s,c,n,null)}zt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Md(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)$(gd[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,u,r,n,null)}return;default:if(Wt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Md(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Md(e,t,p,m,r,f)}}Pt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Md(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Md(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Lt(e,!!n,n?[]:``,!1):Lt(e,!!n,t,!0)):Lt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Md(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Md(e,t,s,a,r,o)}Rt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Md(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Md(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Md(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Md(e,t,u,p,r,m)}return;default:if(Wt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),lt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(r){if(!e[ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}}else if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);lt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=I.d;I.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=vu();return e||t}function yf(e){var t=dt(e);t!==null&&t.tag===5&&t.type===`form`?bs(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Nt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),mt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Nt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Nt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Nt(n.imageSizes)+`"]`)):i+=`[href="`+Nt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),mt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Nt(r)+`"][href="`+Nt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),mt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=pt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);mt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=pt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),mt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=pt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),mt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=oe.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=pt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=pt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=pt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+Nt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),mt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Nt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Nt(n.href)+`"]`);if(r)return t.instance=r,mt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),mt(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,mt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),mt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,mt(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),mt(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ct]||a[tt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,mt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),mt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=We(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=We(0),this.hiddenUpdates=We(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ni(3,null,null,t),e.current=a,a.stateNode=e,t=na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Pa(a),e}function tp(e){return e?(e=ei,e):ei}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ia(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=La(e,r,t),n!==null&&(pu(n,e,t),Ra(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=Zr(e,67108864);t!==null&&pu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=du();t=Xe(t);var n=Zr(e,t);n!==null&&pu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,up(e,t,n,r)}finally{I.p=a,F.T=i}}function lp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,up(e,t,n,r)}finally{I.p=a,F.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ne(o);s.entanglements[1]|=c,o&=~c}nd(a),!(X&6)&&($l=B()+500,rd(0,!1))}}break;case 31:case 13:s=Zr(a,2),s!==null&&pu(s,a,2),vu(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=Xt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=ut(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(we()){case Te:return 2;case V:return 8;case Ee:case De:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=dt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=ut(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,$e(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,$e(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Yt=r,n.target.dispatchEvent(r),Yt=null}else return t=dt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=dt(n);a!==null&&(e.splice(t,3),t-=3,vs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[nt]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[nt]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,du(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),vu(),t[rt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.4`)throw Error(i(527,Lp,`19.2.4`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{je=zp.inject(Rp),Me=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Vs,s=Hs,c=Us;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[rt]=t.current,xd(e),new Fp(t)}})),g=c(o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()}))(),1),_=c(u(),1);function v(e,t,n=!0){(0,_.useEffect)(()=>{if(!n)return;let r=n=>{e.current&&!e.current.contains(n.target)&&t()};return document.addEventListener(`mousedown`,r),()=>document.removeEventListener(`mousedown`,r)},[n,t,e])}const y=300*1e3;function b(e){if(!e||typeof e!=`object`)return null;let t=e;return Array.isArray(t.sessions)?{sessions:t.sessions,cachedAt:typeof t.cachedAt==`string`?t.cachedAt:void 0}:null}function x(e,t=y){if(!e)return!1;let n=Date.now()-new Date(e).getTime();return Number.isFinite(n)&&n>=0&&n<t}function S(e){if(!e)return`just now`;let t=Date.now()-new Date(e).getTime();if(!Number.isFinite(t)||t<0)return`just now`;let n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function C(e,t=Date.now()){if(!e)return``;let n=t-new Date(e).getTime();if(!Number.isFinite(n)||n<0)return`0m`;let r=Math.floor(n/6e4);if(r<60)return`${r}m`;let i=Math.floor(r/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function w(e){return new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}function T(e){return e?`$${e.toFixed(2)}`:``}function E(e){if(!e)return``;let t=e.match(/claude-(\d+)-(\d+)-(opus|sonnet|haiku)(?:-\d{8})?/i);if(t)return`${t[3].charAt(0).toUpperCase()+t[3].slice(1).toLowerCase()} ${t[1]}.${t[2]}`;let n=e.match(/claude-(?:(opus|sonnet|haiku)-)?((?:\d+)(?:[.-](?!\d{8})\d+)*)(?:-\d{8})?(?:-(opus|sonnet|haiku))?(?:$|\b)/i);if(n){let e=(n[1]||n[3]||``).toLowerCase(),t=n[2].replace(/-/g,`.`),r=e.charAt(0).toUpperCase()+e.slice(1);return r?`${r} ${t}`:`Claude ${t}`}let r=e.split(/[-/]/);return r.length>1?r.slice(0,2).join(`-`):e}function D(e){if(e===0)return`0m`;let t=Math.floor(e/6e4);if(t<60)return`${t}m`;let n=Math.floor(t/60),r=t%60;if(n<24)return r>0?`${n}h ${r}m`:`${n}h`;let i=Math.floor(n/24),a=n%24;return a>0?`${i}d ${a}h`:`${i}d`}function O(e){let t=Math.round(e/1024);return t>=1024?`${(t/1024).toFixed(1)}MB`:`${t}KB`}function k(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let i=Math.floor(r/24);return i<30?`${i}d ago`:w(e)}function A(e){let t=be(e);if(t)return t;let n=e.replace(/\/$/,``).split(`/`);return n[n.length-1]||e}function j(e){return(e||``).replace(/\s+/g,` `).trim().slice(0,120)}function M(e){return e.startsWith(`[Request interrupted by user`)||e.startsWith(`<command-name>`)||e.startsWith(`<command-message>`)||e.startsWith(`<local-command-caveat>`)||e.startsWith(`<local-command-stdout>`)||e.startsWith(`<task-notification>`)||e.startsWith(`<bash-input>`)||e.startsWith(`<bash-stdout>`)}function N(e){return e.split(`
|
|
17
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
18
|
`).trim()}function P(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 ee(e){let t=e.trim();return/^\[Previous conversation summary\]:/i.test(t)||/^Summary:\s*1\.\s*Primary Request and Intent:/i.test(t)||/^and merge infrastructure was built for human-paced output/i.test(t)}function F(e){if(M(e)||ee(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||ee(n))||t&&/^[a-z0-9._:-]{1,12}$/i.test(n)?``:n}function I(e){let t=e.title?j(F(e.title)):``;if(t)return t;let n=[...e.prompts||[],e.firstPrompt];for(let e of n){let t=j(F(e||``));if(t)return t}return e.slug}function te(e){let t=I(e);if(e.replay?.title){let t=j(e.replay.title);if(t)return t}return t}function ne(e,t){let n=I(e),r=j(e.replay?.title);return j(F(t?.title||``))||(n&&n!==e.slug?n:r||n)}function
|
|
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,
|
|
22
|
-
`),className:`shrink-0`}),(0,
|
|
20
|
+
`).trim()}function ee(e){let t=e.trim();return/^\[Previous conversation summary\]:/i.test(t)||/^Summary:\s*1\.\s*Primary Request and Intent:/i.test(t)||/^and merge infrastructure was built for human-paced output/i.test(t)}function F(e){if(M(e)||ee(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||ee(n))||t&&/^[a-z0-9._:-]{1,12}$/i.test(n)?``:n}function I(e){let t=e.title?j(F(e.title)):``;if(t)return t;let n=[...e.prompts||[],e.firstPrompt];for(let e of n){let t=j(F(e||``));if(t)return t}return e.slug}function te(e){let t=I(e);if(e.replay?.title){let t=j(e.replay.title);if(t)return t}return t}function ne(e,t){let n=I(e),r=j(e.replay?.title);return j(F(t?.title||``))||(n&&n!==e.slug?n:r||n)}function re(e){return j(e.title)||j(e.firstMessage)||j(e.messages?.[0])||e.slug}function L(e,t={}){let n=new URL(window.location.href),r=[`tab`,`project`,`q`,`archived`];if(n.searchParams.get(`view`)===`dashboard`||!n.searchParams.has(`session`)&&!n.searchParams.has(`gist`)&&!n.searchParams.has(`url`)){let e={};r.forEach(t=>{let r=n.searchParams.get(t);r&&(e[t]=r)}),Object.keys(e).length>0?sessionStorage.setItem(`vibe_dashboard_state`,JSON.stringify(e)):sessionStorage.removeItem(`vibe_dashboard_state`)}if(e.session&&(r.forEach(t=>{e[t]===void 0&&n.searchParams.delete(t)}),e.view===void 0&&n.searchParams.delete(`view`)),e.view===`dashboard`||e.session===null&&!e.view){let t=sessionStorage.getItem(`vibe_dashboard_state`);if(t)try{let r=JSON.parse(t);Object.entries(r).forEach(([t,r])=>{e[t]===void 0&&!n.searchParams.has(t)&&n.searchParams.set(t,r)})}catch(e){console.error(`Failed to restore dashboard state`,e)}n.searchParams.delete(`v`),n.searchParams.delete(`s`)}for(let[t,r]of Object.entries(e))r===null?n.searchParams.delete(t):n.searchParams.set(t,r);let i=n.toString()!==window.location.href;t.replace?window.history.replaceState({},``,n.toString()):window.history.pushState({},``,n.toString()),!t.replace&&i&&window.dispatchEvent(new PopStateEvent(`popstate`))}function R(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 z={"claude-code":`bg-terminal-orange-subtle text-terminal-orange`,"claude-desktop":`bg-terminal-orange-subtle text-terminal-orange`,"claude-cowork":`bg-terminal-orange-subtle text-terminal-orange`,cursor:`bg-terminal-blue-subtle text-terminal-blue`};var ie={"claude-code":`Claude`,"claude-desktop":`Desktop`,"claude-cowork":`Cowork`,cursor:`Cursor`},ae={"claude-code":`Claude Code`,"claude-desktop":`Claude Desktop`,"claude-cowork":`Claude Cowork`,cursor:`Cursor`},oe={"claude-code":`bg-terminal-orange`,"claude-desktop":`bg-terminal-orange`,"claude-cowork":`bg-terminal-orange`,cursor:`bg-terminal-blue`};function se(e){return ie[e]||e}function ce(e){return z[e]||`bg-terminal-surface text-terminal-dim`}function le(e){return ae[e]||e}function ue(e){return oe[e]||`bg-terminal-dim`}async function de(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:`,fe(t)),n(t=>{let n=new Set(t);return r?n.add(e):n.delete(e),n})}}function fe(e){return e instanceof Error?e.message:typeof e==`string`?e:`Unknown error`}function pe(e){let t=be(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 me(e){let t=new Map;for(let n of e)t.set(n,be(n)||pe(n));return t}function he(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 ge=/^(.+?)\/\.claude\/worktrees\/[^/]+(?:\/.*)?$/;function _e(e){let t=e.replace(/\/$/,``).match(ge);return t?t[1]:null}function ve(e){return _e(e)??e}function ye(e){let t=new Map;for(let n of e){let e=ve(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 be(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 xe=`__all__`;function Se(){return new URLSearchParams(window.location.search).get(`project`)||`__all__`}function Ce(){return new URLSearchParams(window.location.search).get(`q`)||``}function B(){return new URLSearchParams(window.location.search).get(`archived`)===`true`}function we(){let[e,t]=(0,_.useState)(Se),[n,r]=(0,_.useState)(Ce),[i,a]=(0,_.useState)(B);return(0,_.useEffect)(()=>{let e=()=>{t(Se()),r(Ce()),a(B())};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),{selectedProject:e,filter:n,showArchived:i,handleProjectChange:e=>{t(e),L({project:e===`__all__`?null:e})},handleFilterChange:e=>{r(e),L({q:e||null},{replace:!0})},handleToggleArchived:()=>{let e=!i;a(e),L({archived:e?`true`:null})}}}var Te=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=Te()}))(),1);function Ee(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 De({value:e,durationMs:t,formatter:n=e=>Math.round(e).toLocaleString()}){return(0,V.jsx)(V.Fragment,{children:n(Ee(e,t))})}function Oe(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 ke=m();function Ae(e){let t=[...e.dataSourceInfo?.notes||[]];return e.provider===`cursor`&&(e.dataSource===`sqlite`||e.dataSource===`global-state`)&&t.unshift(`Some Cursor metrics are best-effort estimates and may be incomplete.`),e.stats.tokenUsage||t.push(`Token and cost metrics may be unavailable.`),[...new Set(t)]}function je(e){let t=Ae(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 Me({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,ke.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 Ne(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 Pe={sqlite:`SQLite (store.db)`,"global-state":`SQLite (global state.vscdb)`,jsonl:`JSONL transcript`,"jsonl+tools":`JSONL + agent-tools`};function Fe(e){return e?Pe[e]||e:`unknown`}function Ie({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 Le(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 Re(e){return!e||e<1?``:e<1e3?`${Math.round(e)}ms`:e<1e4?`${(e/1e3).toFixed(1)}s`:Le(e)}function ze(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 Be=(0,_.createContext)(null);function Ve(){let e=(0,_.useContext)(Be);if(!e)throw Error(`useScanInsightsContext must be used within ScanInsightsProvider`);return e}function He({children:e}){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a]=(0,_.useState)(()=>new Map),o=(0,_.useRef)(!1),[,s]=(0,_.useState)(0),[c,l]=(0,_.useState)(!1),u=(0,_.useRef)(!1);(0,_.useEffect)(()=>{let e=!1,t,r=()=>{e||fetch(`/api/scan/start`,{method:`POST`}).catch(()=>{})};return(async()=>{try{let i=await fetch(`/api/scan/status`);if(!i.ok||e)return;let a=await i.json();if(n(a),a.running)return;if(!a.hasCachedResults||!x(a.cachedAt,3e5)){r();return}let o=Date.now()-new Date(a.cachedAt).getTime(),s=Math.max(1e3,y-o);t=window.setTimeout(r,s)}catch{r()}})(),()=>{e=!0,t&&window.clearTimeout(t)}},[]),(0,_.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await fetch(`/api/scan/status`);if(!t.ok||e)return null;let r=await t.json();return n(r),r}catch{return null}},r=async()=>{l(!0);try{let t=await fetch(`/api/insights`);if(t.ok){let n=await t.json();n.type===`user`&&!e&&i(n.insights)}}catch{}finally{e||l(!1)}};t().then(e=>{e?.hasInsights&&!u.current&&(u.current=!0,r())});let a=setInterval(async()=>{let n=await t();!n||e||(n.hasInsights&&!u.current&&(u.current=!0,r()),!n.running&&n.finishedAt&&(n.resultCount>0&&(o.current=!0,r(),s(e=>(queueMicrotask(()=>{o.current=!1}),e+1))),clearInterval(a)))},2e3);return()=>{e=!0,clearInterval(a)}},[]);let d=(0,_.useCallback)(e=>{a.has(e)&&!o.current||(l(!0),fetch(`/api/insights?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(t=>{t?.type===`project`&&(a.set(e,t.insights),s(e=>e+1))}).catch(()=>{}).finally(()=>l(!1)))},[a]),f=(0,_.useMemo)(()=>({scanStatus:t,userInsights:r,projectInsightsCache:a,fetchProjectInsights:d,loading:c}),[t,r,a,d,c]);return(0,V.jsx)(Be.Provider,{value:f,children:e})}function Ue(){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 We({insights:e,variant:t}){let[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(!1),o=t===`project`,s=o?`text-terminal-green`:`text-terminal-purple`,c=o?`bg-terminal-green`:`bg-terminal-purple`,l=o?e:null,u=o?null:e,d=l?.sessionCount??u?.totalSessions??0,f=l?.totalDurationMs??u?.totalDurationMs??0,p=l?.totalCost??u?.totalCost??0,m=l?.totalPrompts??u?.totalPrompts??0,h=l?.totalToolCalls??u?.totalToolCalls??0,g=l?.totalEdits??u?.totalEdits??0,v=l?.models??u?.models??{},y=l?.avgSessionDurationMs??u?.avgSessionDurationMs??0,b=l?.sessionsPerDay??u?.sessionsPerDay??{},x=l?.dataQuality?.notes??u?.dataQuality?.notes??[],S=l?.timeRange??u?.timeRange,C=l?l.project.split(`/`).pop()||l.project:`All Projects`,w=l?l.project:`${u?.totalProjects??0} projects`,T=u?.topProjects,D=(0,_.useMemo)(()=>T?[...ye(T)].sort((e,t)=>t.sessions-e.sessions).slice(0,8):[],[T]);if(d===0)return null;let O=Object.entries(v).sort(([,e],[,t])=>t-e),k=O.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5`,children:`Models`}),(0,V.jsx)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:O.map(([e,t])=>(0,V.jsxs)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim`,title:e,children:[E(e),` `,(0,V.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[t,`x`]})]},e))})]}),A={month:`short`,day:`numeric`,year:`numeric`},j=S&&(0,V.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dimmer`,children:[`Active`,` `,(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:new Date(S.first).toLocaleDateString(`en-US`,A)}),` — `,(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:new Date(S.last).toLocaleDateString(`en-US`,A)})]});return(0,V.jsxs)(`div`,{className:`border-b border-terminal-border-subtle pb-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-1.5`,children:[(0,V.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ${c} shrink-0 self-center`}),(0,V.jsx)(`h2`,{className:`text-base font-sans font-semibold text-terminal-text truncate`,children:C}),x.length>0&&(0,V.jsx)(Me,{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:[Le(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:[Ge(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:[Ge(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:[Ge(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 `,Le(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=Oe(r);n.push({day:e,count:b[e]||0}),r.setDate(r.getDate()+1)}let i=Math.max(...n.map(e=>e.count),1);return n.map(e=>(0,V.jsx)(`div`,{title:`${e.day}: ${e.count}`,className:`w-1 rounded-sm ${e.count>0?c:`bg-terminal-surface-2`}`,style:{height:e.count>0?`${Math.max(15,e.count/i*100)}%`:`2px`,opacity:e.count>0?.35+e.count/i*.65:.15}},e.day))})()})})]}),n&&l&&(0,V.jsxs)(`div`,{className:`mt-3 pt-3 border-t border-terminal-border-subtle space-y-3`,children:[l.branches.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5`,children:[`Branches (`,l.branches.length,`)`]}),(0,V.jsx)(`div`,{className:`space-y-0.5 max-h-32 overflow-y-auto`,children:l.branches.slice(0,15).map(e=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,V.jsx)(`span`,{className:`font-mono text-terminal-purple truncate`,children:e.branch}),(0,V.jsxs)(`span`,{className:`text-terminal-dimmer tabular-nums shrink-0`,children:[e.sessionIds.length,`x`]}),e.prLinks?.map(e=>(0,V.jsxs)(`a`,{href:e.prUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-terminal-blue hover:underline shrink-0`,children:[`#`,e.prNumber]},e.prUrl))]},e.branch))})]}),l.hotFiles.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5`,children:`Most modified files`}),(0,V.jsx)(`div`,{className:`space-y-0.5 max-h-28 overflow-y-auto`,children:l.hotFiles.slice(0,10).map(e=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,V.jsx)(`span`,{className:`font-mono text-terminal-dim truncate flex-1`,children:e.file}),(0,V.jsxs)(`span`,{className:`text-terminal-dimmer tabular-nums shrink-0`,children:[e.editCount,`x / `,e.sessionCount,`s`]})]},e.file))})]}),k,j,l.memory&&l.memory.memoryFiles.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`button`,{onClick:()=>a(e=>!e),className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5 flex items-center gap-1 hover:text-terminal-dim transition-colors`,children:[(0,V.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 12 12`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,className:`transition-transform duration-200 ${i?`rotate-90`:``}`,children:(0,V.jsx)(`path`,{d:`M4.5 2l4 4-4 4`})}),`Memory (`,l.memory.memoryFiles.length,` files)`]}),i&&(0,V.jsx)(`div`,{className:`space-y-1.5 max-h-48 overflow-y-auto`,children:l.memory.memoryFiles.map(e=>(0,V.jsxs)(`div`,{className:`bg-terminal-surface-2 rounded-lg px-3 py-2 text-xs`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,V.jsx)(`span`,{className:`font-mono text-terminal-text font-medium`,children:e.name}),e.type&&(0,V.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-terminal-surface text-terminal-dimmer text-[10px]`,children:e.type})]}),e.description&&(0,V.jsx)(`div`,{className:`text-terminal-dim text-[11px] mb-1`,children:e.description}),(0,V.jsx)(`div`,{className:`font-mono text-terminal-dimmer whitespace-pre-wrap line-clamp-3 text-[11px] leading-relaxed`,children:e.content})]},e.name))})]})]}),n&&u&&(0,V.jsxs)(`div`,{className:`mt-3 pt-3 border-t border-terminal-border-subtle space-y-3`,children:[u.topProjects.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5`,children:`Top projects`}),(0,V.jsx)(`div`,{className:`space-y-1`,children:D.map(e=>{let t=e.project.split(`/`).pop()||e.project;return(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,V.jsx)(`span`,{className:`font-mono text-terminal-text truncate flex-1`,title:e.project,children:t}),(0,V.jsxs)(`span`,{className:`text-terminal-dimmer tabular-nums shrink-0`,children:[e.sessions,`s`]}),e.durationMs>0&&(0,V.jsx)(`span`,{className:`text-terminal-blue tabular-nums shrink-0`,children:Le(e.durationMs)}),(0,V.jsxs)(`span`,{className:`text-terminal-green tabular-nums shrink-0`,children:[e.prompts,`p`]}),e.edits>0&&(0,V.jsxs)(`span`,{className:`text-terminal-purple tabular-nums shrink-0`,children:[e.edits,`e`]}),e.prCount>0&&(0,V.jsxs)(`span`,{className:`text-terminal-blue tabular-nums shrink-0`,children:[e.prCount,`pr`]}),e.cost>0&&(0,V.jsxs)(`span`,{className:`text-terminal-orange tabular-nums shrink-0`,children:[`$`,e.cost.toFixed(2)]})]},e.project)})})]}),k,j]})]})}function Ge(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}var Ke=864e5,qe=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],Je=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function Ye(e){return Oe(e)}function Xe(e){return e===`7d`?7:e===`30d`?30:e===`90d`?90:0}function Ze(e,t){if(t===`all`)return e;let n=Xe(t),r=new Date;r.setHours(0,0,0,0),r.setDate(r.getDate()-n);let i=Ye(r),a={};for(let[t,n]of Object.entries(e))t>=i&&(a[t]=n);return a}function Qe(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=Ze(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 $e(e){let t=new Date;t.setHours(0,0,0,0);let n=0,r=new Date(t);for(;;){let t=Ye(r);if(e[t]&&e[t]>0)n++,r.setDate(r.getDate()-1);else if(n===0){r.setDate(r.getDate()-1);let t=Ye(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())/Ke===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 et(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:Je[t],shortDay:qe[t],count:e}))}function tt(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*Ke);for(let r=t-1;r>=0;r--){let t=new Date(o.getTime()-r*7*Ke),i=0;for(let n=0;n<7;n++){let r=Ye(new Date(t.getTime()+n*Ke));i+=e[r]||0}let a=t.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`});n.push({weekLabel:a,sessions:i,startDate:Ye(t)})}return n}function nt(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 rt(e){return e===0?`$0`:e<.01?`<$0.01`:e<1||e<100?`$${e.toFixed(2)}`:`$${Math.round(e)}`}function it(e){return e>=1e4?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function at(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.floor(e/1e3)}k`:e.toString()}function ot(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
23
|
`):void 0,duration:n.length>0?[`Coding time is approximate for Cursor sessions.`,...n].join(`
|
|
24
24
|
`):void 0,cost:r.length>0?[`Spend is a lower bound for Cursor sessions, not the full total.`,...r].join(`
|
|
25
|
-
`):void 0}}function ot(e){return[...new Set(e.split(`,`).map(e=>e.trim()).filter(Boolean))]}function st(e){return e===`7d`?`Last 7 Days`:e===`30d`?`Last 30 Days`:e===`90d`?`Last 90 Days`:`All Time`}function ct({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)*Ge),a=t*7,o=new Date(i.getTime()-(a-1)*Ge),s=0,c=[],l=new Map,u=-1;for(let t=0;t<a;t++){let n=new Date(o.getTime()+t*Ge),r=Je(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,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-end gap-[3px]`,children:[(0,H.jsx)(`div`,{className:`shrink-0 w-7`}),(0,H.jsx)(`div`,{className:`flex-1 flex gap-[3px] min-w-0`,children:r.map((e,t)=>(0,H.jsx)(`div`,{className:`flex-1 min-w-0 overflow-visible`,children:i.has(t)&&(0,H.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer whitespace-nowrap`,children:i.get(t)})},t))})]}),(0,H.jsxs)(`div`,{className:`flex gap-[3px]`,children:[(0,H.jsx)(`div`,{className:`shrink-0 w-7 flex flex-col gap-[3px]`,children:[``,`Mon`,``,`Wed`,``,`Fri`,``].map((e,t)=>(0,H.jsx)(`div`,{className:`flex-1 flex items-center text-[9px] font-mono text-terminal-dimmer leading-none`,children:e},t))}),(0,H.jsx)(`div`,{className:`flex-1 flex gap-[3px] min-w-0`,children:r.map((e,t)=>(0,H.jsx)(`div`,{className:`flex-1 flex flex-col gap-[3px] min-w-0`,children:e.map(e=>{let t=o(e.count);return(0,H.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,H.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5 pt-1`,children:[(0,H.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer`,children:`Less`}),(0,H.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-sm bg-terminal-border/20 dark:bg-terminal-surface-2`}),(0,H.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-sm bg-terminal-green`,style:{opacity:.4}}),(0,H.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-sm bg-terminal-green`,style:{opacity:.6}}),(0,H.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-sm bg-terminal-green`,style:{opacity:.8}}),(0,H.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-sm bg-terminal-green`}),(0,H.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer`,children:`More`})]})]})}function lt({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=Je(new Date(t.getTime()-i*Ge)),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,H.jsx)(`div`,{className:`flex gap-[3px] flex-wrap`,children:t.cells.map(e=>{let t=n(e.count);return(0,H.jsx)(`div`,{className:`w-[10px] h-[10px] rounded-[2px] ${t.className}`,style:t.style},e.key)})})}function ut({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])=>ce(e)).join(` + `))},[a]),l=(0,_.useMemo)(()=>at(o),[o]),u=({label:e,title:t})=>(0,H.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1`,children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-medium text-terminal-dim uppercase tracking-wider`,children:e}),t?(0,H.jsx)(je,{title:t,className:`shrink-0`}):null]});return(0,H.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,H.jsx)(`div`,{className:`absolute -top-20 -right-20 w-64 h-64 bg-terminal-green/5 rounded-full blur-3xl pointer-events-none`}),(0,H.jsx)(`div`,{className:`absolute -bottom-20 -left-20 w-48 h-48 bg-terminal-blue/5 rounded-full blur-3xl pointer-events-none`}),(0,H.jsxs)(`div`,{className:`relative z-10`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.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,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer px-2 py-0.5 rounded-full bg-terminal-surface-2`,children:st(i)}),l.overall?(0,H.jsx)(je,{title:l.overall,className:`shrink-0`}):null]}),c&&(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dim`,children:c})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-4 gap-x-6 gap-y-5 mb-6`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,H.jsx)(Ee,{durationMs:500,value:e.sessions,formatter:rt})}),(0,H.jsx)(u,{label:`sessions`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-blue tabular-nums`,children:(0,H.jsx)(Ee,{durationMs:500,value:e.replays,formatter:rt})}),(0,H.jsx)(u,{label:`replays`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,H.jsx)(Ee,{durationMs:500,value:e.prompts,formatter:rt})}),(0,H.jsx)(u,{label:`turns`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-orange tabular-nums`,children:(0,H.jsx)(Ee,{durationMs:500,value:e.toolCalls,formatter:rt})}),(0,H.jsx)(u,{label:`tool calls`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-text tabular-nums`,children:(0,H.jsx)(Ee,{durationMs:500,value:e.durationMs,formatter:e=>D(e)})}),(0,H.jsx)(u,{label:`coding`,title:l.duration})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-orange tabular-nums`,children:(0,H.jsx)(Ee,{durationMs:500,value:e.cost,formatter:e=>nt(e)})}),(0,H.jsx)(u,{label:`spent`,title:l.cost})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-blue tabular-nums`,children:(0,H.jsx)(Ee,{durationMs:500,value:e.edits,formatter:rt})}),(0,H.jsx)(u,{label:`file edits`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-purple tabular-nums`,children:(0,H.jsx)(Ee,{durationMs:500,value:e.projects,formatter:e=>Math.round(e).toString()})}),(0,H.jsx)(u,{label:`projects`})]})]}),(0,H.jsx)(`div`,{className:`mb-4`,children:(0,H.jsx)(lt,{sessionsPerDay:r})}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between pt-4 border-t border-terminal-border/30`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-4`,children:[t.current>0&&(0,H.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dim`,children:[t.current,` day streak`]}),n&&n.count>0&&(0,H.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dim`,children:[`Most active: `,n.day]})]}),(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`vibe-replay.com`})]})]})]})}function dt({icon:e,label:t,value:n,sub:r}){return(0,H.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,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsx)(`span`,{className:`text-lg leading-none mt-0.5`,children:e}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest`,children:t}),(0,H.jsx)(`div`,{className:`text-lg font-mono font-bold text-terminal-text mt-0.5`,children:n}),r&&(0,H.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dimmer mt-0.5`,children:r})]})]})})}function ft(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,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.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,H.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-end h-full group relative`,children:[(0,H.jsx)(`div`,{className:`absolute bottom-full mb-1 hidden group-hover:block z-10`,children:(0,H.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,H.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dim`,children:e.label}),(0,H.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,H.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,H.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,H.jsx)(`div`,{className:`flex gap-2`,children:e.buckets.map(e=>(0,H.jsx)(`div`,{className:`flex-1 text-center text-[9px] font-mono text-terminal-dimmer`,children:e.label},e.label))}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between pt-2 border-t border-terminal-border/20`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] font-mono text-terminal-dim`,children:[(0,H.jsxs)(`span`,{children:[`P50`,` `,(0,H.jsx)(`span`,{className:`text-terminal-text font-bold`,children:ft(e.percentiles.p50Ms)})]}),(0,H.jsx)(`span`,{className:`text-terminal-dimmer`,children:`·`}),(0,H.jsxs)(`span`,{children:[`P75`,` `,(0,H.jsx)(`span`,{className:`text-terminal-text font-bold`,children:ft(e.percentiles.p75Ms)})]}),(0,H.jsx)(`span`,{className:`text-terminal-dimmer`,children:`·`}),(0,H.jsxs)(`span`,{children:[`P90`,` `,(0,H.jsx)(`span`,{className:`text-terminal-text font-bold`,children:ft(e.percentiles.p90Ms)})]})]}),(0,H.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[e.totalTurns.toLocaleString(),` turns`]})]})]})}var mt=[{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 ht({breakdown:e}){let t=e.input+e.output+e.cacheRead+e.cacheCreation;if(t===0)return null;let n=mt.map(n=>({...n,value:e[n.key],pct:e[n.key]/t*100})).filter(e=>e.value>0);return(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(`div`,{className:`h-4 rounded-full bg-terminal-surface-2 overflow-hidden flex`,children:n.map(e=>(0,H.jsx)(`div`,{className:`h-full ${e.color} transition-all duration-500`,style:{width:`${e.pct}%`,opacity:.7}},e.key))}),(0,H.jsx)(`div`,{className:`space-y-2`,children:n.map(e=>(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-sm ${e.color}`,style:{opacity:.7}}),(0,H.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dim`,children:e.label})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-text tabular-nums`,children:it(e.value)}),(0,H.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,H.jsxs)(`div`,{className:`flex items-center justify-between pt-2 border-t border-terminal-border/20`,children:[(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`Total`}),(0,H.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-text font-bold tabular-nums`,children:it(t)})]})]})}function gt({data:e}){let t=Math.max(...e.map(e=>e.sessions),1);if(!e.some(e=>e.sessions>0))return(0,H.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,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.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,H.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-end h-full group relative`,children:[(0,H.jsx)(`div`,{className:`absolute bottom-full mb-1 hidden group-hover:block z-10`,children:(0,H.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,H.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dim`,children:e.weekLabel}),(0,H.jsxs)(`div`,{className:`text-[10px] font-mono text-terminal-green font-bold`,children:[e.sessions,` session`,e.sessions===1?``:`s`]})]})}),(0,H.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,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`div`,{className:`flex gap-1.5 overflow-hidden`,children:e.filter((e,t)=>t%2==0).map(e=>(0,H.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer`,children:e.weekLabel},e.startDate))}),!s&&(0,H.jsxs)(`span`,{className:`text-[10px] font-mono font-bold ${o?`text-terminal-green`:`text-terminal-orange`}`,children:[o?`↑`:`↓`,` `,o?`Trending up`:`Slowing down`]})]})]})}function _t({data:e}){let t=Math.max(...e.map(e=>e.count),1);return(0,H.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>{let n=t>0?e.count/t*100:0;return(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dim w-7 text-right shrink-0`,children:e.shortDay}),(0,H.jsx)(`div`,{className:`flex-1 h-4 rounded bg-terminal-surface-2 overflow-hidden`,children:(0,H.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,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dim w-6 text-right tabular-nums shrink-0`,children:e.count})]},e.day)})})}function vt({projects:e}){if(e.length===0)return(0,H.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,H.jsx)(`div`,{className:`space-y-2`,children:e.slice(0,8).map(e=>{let n=A(e.project),r=e.sessions/t*100;return(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-text truncate max-w-[60%]`,children:n}),(0,H.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dim tabular-nums`,children:[e.sessions,` session`,e.sessions===1?``:`s`,e.cost>0&&` · ${nt(e.cost)}`]})]}),(0,H.jsx)(`div`,{className:`h-1.5 rounded-full bg-terminal-surface-2 overflow-hidden`,children:(0,H.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 yt({models:e}){let t=(0,_.useMemo)(()=>(()=>{let t=new Map;for(let[n,r]of Object.entries(e))for(let e of ot(n)){let n=E(e);t.set(n,(t.get(n)??0)+r)}return[...t.entries()].map(([e,t])=>({model:e,count:t})).sort((e,t)=>t.count-e.count)})(),[e]),n=t.reduce((e,t)=>e+t.count,0);if(t.length===0)return(0,H.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,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(`div`,{className:`h-3 rounded-full bg-terminal-surface-2 overflow-hidden flex`,children:t.map((e,t)=>(0,H.jsx)(`div`,{className:`h-full ${r[t%r.length]} transition-all duration-500`,style:{width:`${e.count/n*100}%`,opacity:.7}},e.model))}),(0,H.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:t.map((e,t)=>(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-sm ${r[t%r.length]} shrink-0`,style:{opacity:.7}}),(0,H.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dim truncate`,children:e.model}),(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums ml-auto shrink-0`,children:e.count})]},e.model))})]})}function bt({providers:e}){let t=(0,_.useMemo)(()=>Object.entries(e).map(([e,t])=>({provider:e,label:ce(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,H.jsx)(`div`,{className:`space-y-3`,children:t.map(e=>{let t=n>0?e.count/n*100:0;return(0,H.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-text`,children:e.label}),(0,H.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dim tabular-nums`,children:[e.count,` (`,Math.round(t),`%)`]})]}),(0,H.jsx)(`div`,{className:`h-2 rounded-full bg-terminal-surface-2 overflow-hidden`,children:(0,H.jsx)(`div`,{className:`h-full rounded-full ${le(e.provider)} transition-all duration-500`,style:{width:`${t}%`,opacity:.7}})})]},e.provider)})})}function xt(){return(0,H.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,H.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 md:px-6 py-6 space-y-6`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`div`,{className:`h-6 w-32 skeleton rounded`}),(0,H.jsx)(`div`,{className:`flex gap-1`,children:Array.from({length:4},(e,t)=>(0,H.jsx)(`div`,{className:`h-7 w-10 skeleton rounded-md`},t))})]}),(0,H.jsxs)(`div`,{className:`rounded-2xl bg-terminal-surface border border-terminal-border/30 p-6 space-y-5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`div`,{className:`h-4 w-20 skeleton rounded`}),(0,H.jsx)(`div`,{className:`h-5 w-12 skeleton rounded-md`})]}),(0,H.jsx)(`div`,{className:`h-3 w-28 skeleton rounded`})]}),(0,H.jsx)(`div`,{className:`grid grid-cols-4 gap-6`,children:Array.from({length:8},(e,t)=>(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`div`,{className:`h-7 skeleton rounded`,style:{width:`${45+t*13%40}%`}}),(0,H.jsx)(`div`,{className:`h-3 w-16 skeleton rounded`})]},t))}),(0,H.jsx)(`div`,{className:`h-2.5 w-full skeleton rounded`}),(0,H.jsxs)(`div`,{className:`flex justify-between`,children:[(0,H.jsx)(`div`,{className:`h-3 w-40 skeleton rounded`}),(0,H.jsx)(`div`,{className:`h-3 w-24 skeleton rounded`})]})]}),(0,H.jsxs)(`div`,{className:`rounded-xl bg-terminal-surface p-5 shadow-layer-sm space-y-4`,children:[(0,H.jsx)(`div`,{className:`h-3 w-16 skeleton rounded`}),(0,H.jsx)(`div`,{className:`space-y-1.5`,children:Array.from({length:3},(e,t)=>(0,H.jsx)(`div`,{className:`h-3 skeleton rounded`},t))})]}),(0,H.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:Array.from({length:4},(e,t)=>(0,H.jsxs)(`div`,{className:`rounded-xl bg-terminal-surface p-4 shadow-layer-sm space-y-2.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`div`,{className:`h-5 w-5 skeleton rounded`}),(0,H.jsx)(`div`,{className:`h-3 w-20 skeleton rounded`})]}),(0,H.jsx)(`div`,{className:`h-6 w-24 skeleton rounded`}),(0,H.jsx)(`div`,{className:`h-2.5 w-16 skeleton rounded`})]},t))}),(0,H.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:Array.from({length:2},(e,t)=>(0,H.jsxs)(`div`,{className:`rounded-xl bg-terminal-surface p-5 shadow-layer-sm space-y-4`,children:[(0,H.jsx)(`div`,{className:`h-3 w-24 skeleton rounded`}),(0,H.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:5},(e,n)=>(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`div`,{className:`h-3 w-8 skeleton rounded shrink-0`}),(0,H.jsx)(`div`,{className:`h-5 skeleton rounded`,style:{width:`${25+(n*17+t*31)%60}%`}})]},n))})]},t))})]})})}function St({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,H.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,H.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 md:px-6 py-8 space-y-4`,children:[(0,H.jsxs)(`div`,{className:`rounded-xl border border-terminal-purple/20 bg-terminal-surface px-4 py-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-sans text-terminal-text`,children:[(0,H.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-terminal-purple animate-pulse`}),(0,H.jsx)(`span`,{children:t?`Refreshing cached insights`:`Loading your insights`})]}),(0,H.jsx)(`p`,{className:`mt-1 text-xs font-mono text-terminal-dim`,children:n})]}),(0,H.jsx)(xt,{})]})})}function Ct(){let[e,t]=(0,_.useState)(null),n=(0,_.useCallback)((e,n)=>{let r=0,i=0,a=0,o=new Map(e.map(e=>[e.slug,e]));for(let t of e)r+=t.promptCount??(t.prompts?.length||(t.firstPrompt?1:0)),i+=t.toolCallCount??0;for(let e of n){let t=o.get(e.slug),n=e.stats.toolCalls||0;t?t.toolCallCount==null?i+=n:n>t.toolCallCount&&(i+=n-t.toolCallCount):(r+=e.stats.userPrompts||0,i+=n),a+=e.stats.durationMs||0}let s=new Set;for(let t of e)s.add(t.project);for(let e of n)s.add(e.project);t({sessions:e.length,replays:n.length,prompts:r,toolCalls:i,duration:a,projects:s.size})},[]);return(0,_.useEffect)(()=>{Promise.all([fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null),fetch(`/api/sessions/cached`).then(e=>e.ok?e.json():null).catch(()=>null)]).then(([e,t])=>{let r=b(e)?.sessions||[],i=b(t)?.sessions||[];(r.length>0||i.length>0)&&n(r,i)})},[n]),e}function wt(){let{userInsights:e,loading:t,scanStatus:n}=Be(),r=Ct(),[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=Xe(t,i),a=Ze(n,{...e,totalReplays:r?.replays??0},i),o=Qe(t),s=$e(n);return{stats:a,streak:o,dayOfWeek:s,bestDay:[...s].sort((e,t)=>t.count-e.count)[0]||null,peak:tt(n),weeklyTrend:et(t,12),activeDays:Object.values(n).filter(e=>e>0).length,firstSessionDate:e.timeRange?.first||null}},[e,i,r]),h=(0,_.useMemo)(()=>ve(e?.topProjects||[]),[e?.topProjects]);if(!e&&(t||o||n?.phase===`discovering`))return(0,H.jsx)(St,{scanStatus:n,hasCachedInsights:!!n?.hasCachedResults});if(!e)return(0,H.jsx)(xt,{});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())/Ge):0,b=r?.sessions??e.totalSessions,x=Math.max(0,b-e.totalSessions),S=!!(n?.running&&n?.hasCachedResults),w=n?.cachedAt?C(n.cachedAt):``,T=n?.total&&n.total>0?`${Math.min(n.scanned,n.total)}/${n.total}`:void 0;return(0,H.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,H.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 md:px-6 py-6 space-y-6`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`h1`,{className:`text-lg font-sans font-bold text-terminal-text`,children:`Your Insights`}),(0,H.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,H.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,H.jsx)(`div`,{className:`rounded-xl border border-terminal-blue/30 bg-terminal-blue/10 px-4 py-3`,children:(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsx)(`div`,{className:`mt-0.5 h-2 w-2 shrink-0 rounded-full bg-terminal-blue`}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`div`,{className:`text-xs font-sans font-semibold text-terminal-text`,children:`Showing cached insights snapshot while the background refresh runs`}),(0,H.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dim`,children:[w?`Snapshot from ${w} ago.`:`Using the latest cached scan.`,` `,T?`Refreshing ${T} sessions now.`:`Refreshing now.`]}),x>0&&(0,H.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,H.jsx)(ut,{stats:s,streak:c,bestDay:u,sessionsPerDay:e.sessionsPerDay||{},range:i,providers:e.providers||{},dataQualityNotes:e.dataQuality?.notes}),(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,H.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:`Activity`}),i!==`all`&&(0,H.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer`,children:`Last 52 weeks`})]}),(0,H.jsx)(ct,{sessionsPerDay:e.sessionsPerDay||{}})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:[(0,H.jsx)(dt,{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,H.jsx)(dt,{icon:`⚡`,label:`Avg / Active Day`,value:`${g} sessions`,sub:`${p} active day${p===1?``:`s`}`}),(0,H.jsx)(dt,{icon:`💬`,label:`Avg / Session`,value:`${v} prompts`,sub:s.sessions>0?`~${D(s.durationMs/s.sessions)} each`:void 0}),d?(0,H.jsx)(dt,{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,H.jsx)(dt,{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,H.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[e.turnDurationHistogram&&(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,H.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4`,children:`Turn Duration Distribution`}),(0,H.jsx)(pt,{histogram:e.turnDurationHistogram})]}),e.tokenBreakdown&&(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,H.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4`,children:`Token Usage`}),(0,H.jsx)(ht,{breakdown:e.tokenBreakdown})]})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,H.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4`,children:`Weekly Trend`}),(0,H.jsx)(gt,{data:f})]}),(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,H.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4`,children:`Day of Week`}),(0,H.jsx)(_t,{data:l})]})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,H.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4`,children:`Top Projects`}),(0,H.jsx)(vt,{projects:h.map(e=>({project:e.project,sessions:e.sessions,cost:e.cost,prompts:e.prompts,durationMs:e.durationMs,edits:e.edits}))})]}),(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm space-y-5`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4`,children:`Models`}),(0,H.jsx)(yt,{models:e.models||{}})]}),Object.keys(e.providers||{}).length>1&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4`,children:`Providers`}),(0,H.jsx)(bt,{providers:e.providers||{}})]})]})]}),y>0&&(0,H.jsx)(`div`,{className:`text-center py-4`,children:(0,H.jsxs)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer`,children:[`You've been vibe coding for `,y,` day`,y===1?``:`s`,` ·`,` `,Ie(s.durationMs),` total · `,rt(s.toolCalls),` tool calls`]})})]})})}function Tt(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(!0),[c,l]=(0,_.useState)(!0),[u,d]=(0,_.useState)(null),[,f]=(0,_.useState)(null),[,p]=(0,_.useState)(null),m=(0,_.useRef)(!1),h=(0,_.useRef)(void 0),g=(0,_.useMemo)(()=>e.some(e=>e.provider===`cursor`),[e]),v=(0,_.useCallback)(async()=>{a(!0),s(!0),l(!0),d(null);try{let[e,n]=await Promise.all([fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null),fetch(`/api/sessions/cached`).then(e=>e.ok?e.json():null).catch(()=>null)]),i=b(e),o=b(n);i?.sessions.length&&t(i.sessions),o?.sessions.length&&r(o.sessions),(i?.sessions.length||o?.sessions.length)&&a(!1);let c=x(i?.cachedAt),u=x(o?.cachedAt),p=[];c&&s(!1),u&&l(!1),c||p.push(new Promise(e=>{f(0);let n=new EventSource(`/api/sources/stream`);n.onmessage=r=>{try{let a=JSON.parse(r.data);a.type===`progress`?f(a.scanned):a.type===`complete`?(t(a.sessions),f(null),n.close(),e()):a.type===`error`&&(i?.sessions.length||d(a.message||`Failed to load sessions`),f(null),n.close(),e())}catch{}},n.onerror=()=>{n.close(),f(null),fetch(`/api/sources`).then(e=>{if(!e.ok)throw Error(`Failed to load sources`);return e.json()}).then(e=>t(e.sessions)).catch(e=>{i?.sessions.length||d(e instanceof Error?e.message:`Failed to load sessions`)}).finally(()=>e())}}).finally(()=>s(!1))),u||p.push(fetch(`/api/sessions`).then(e=>{if(!e.ok)throw Error(`Failed to load replays`);return e.json()}).then(e=>r(e)).catch(e=>{o?.sessions.length||d(e instanceof Error?e.message:`Failed to load replays`)}).finally(()=>l(!1))),p.length>0&&await Promise.allSettled(p)}catch(e){d(e instanceof Error?e.message:`Failed to load data`)}finally{a(!1)}},[]);return(0,_.useEffect)(()=>{v()},[v]),(0,_.useEffect)(()=>{if(!o&&!g&&!m.current)return;let e=!1,n,r=async()=>{let n=b(await fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null));!e&&n?.sessions.length&&n.cachedAt!==h.current&&(h.current=n.cachedAt,t(n.sessions))},i=async()=>{let t=await fetch(`/api/sources/enrichment-status`).then(e=>e.ok?e.json():null).catch(()=>null);!t||e||(p(t),t.running?(m.current=!0,await r()):m.current&&(m.current=!1,await r()))};return i(),n=window.setInterval(()=>{i()},2500),()=>{e=!0,n&&window.clearInterval(n)}},[g,o]),{sources:e,setSources:t,replays:n,loading:i,loadingSources:o,loadingReplays:c,error:u}}function Et(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=De(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 Dt(){return(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,H.jsx)(`div`,{className:`h-3 w-28 skeleton rounded`}),(0,H.jsx)(`div`,{className:`h-3 w-14 skeleton rounded`})]}),(0,H.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2`,children:Array.from({length:5},(e,t)=>(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-3 rounded-lg bg-terminal-bg`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2.5`,children:[(0,H.jsx)(`div`,{className:`h-3.5 skeleton rounded`,style:{width:`${50+t*17%30}%`}}),(0,H.jsx)(`div`,{className:`h-3 skeleton rounded`,style:{width:`${60+t*23%25}%`}})]}),(0,H.jsx)(`div`,{className:`h-4 w-14 shrink-0 skeleton rounded`})]},t))}),(0,H.jsx)(`div`,{className:`h-8 mt-2 rounded-lg skeleton`})]})}function Ot({provider:e}){return(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-medium px-1.5 py-0.5 rounded-full uppercase tracking-wider ${se(e)}`,children:oe(e)})}function kt({sessions:e,isLoading:t,onViewAll:n,onGenerate:r,onViewReplay:i,onSessionClick:a,generatingSlug:o,generateErrorSlug:s}){return e.length===0?(0,H.jsx)(`div`,{className:`text-center py-6 text-terminal-dimmer text-xs font-mono`,children:t?`Loading sessions...`:`No sessions found. Start a coding session with Claude Code or Cursor.`}):(0,H.jsxs)(`div`,{className:`space-y-1 flex-1 flex flex-col`,children:[e.map(e=>{let t=!!e.existingReplay,n=o===e.slug,c=s===e.slug;return(0,H.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,H.jsx)(Ot,{provider:e.provider}),(0,H.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,H.jsx)(`p`,{className:`text-sm font-sans text-terminal-text truncate`,children:te(e)}),(0,H.jsx)(`p`,{className:`text-[11px] font-mono text-terminal-dimmer truncate`,children:A(e.project)})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,H.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer tabular-nums`,children:k(e.timestamp)}),t?(0,H.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),i(e.existingReplay)},className:`h-7 px-3 text-xs font-sans font-semibold rounded-md bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis transition-all duration-200 flex items-center gap-1`,children:[(0,H.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,H.jsx)(`polygon`,{points:`4 2 14 8 4 14`})}),`View`]}):(0,H.jsx)(`button`,{onClick:t=>{t.stopPropagation(),r(e)},disabled:n,className:`h-7 px-3 text-xs font-sans font-semibold rounded-md transition-all duration-200 disabled:opacity-50 flex items-center gap-1 ${c?`bg-terminal-red-subtle text-terminal-red`:`bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis`}`,children:n?(0,H.jsx)(`span`,{className:`animate-pulse`,children:`...`}):c?`Failed`:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,H.jsx)(`path`,{d:`M8 2v12M2 8h12`})}),`Generate`]})})]})]},`${e.provider}-${e.slug}`)}),(0,H.jsx)(`button`,{onClick:n,className:`w-full py-2 mt-auto text-xs font-sans font-semibold rounded-lg bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200`,children:`View all sessions →`})]})}function At({replays:e,isLoading:t,onViewAll:n,onOpen:r}){return e.length===0?(0,H.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,H.jsxs)(`div`,{className:`space-y-1 flex-1 flex flex-col`,children:[e.map(e=>(0,H.jsxs)(`button`,{onClick:()=>r(e.slug),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-terminal-surface-hover transition-colors duration-200 text-left group`,children:[(0,H.jsx)(Ot,{provider:e.provider}),(0,H.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,H.jsx)(`p`,{className:`text-sm font-sans text-terminal-text truncate group-hover:text-terminal-green transition-colors`,children:L(e)}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mt-0.5`,children:[(0,H.jsxs)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer`,children:[e.stats.userPrompts,` prompts`]}),(0,H.jsx)(`span`,{className:`text-terminal-border text-[10px]`,children:`·`}),(0,H.jsxs)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer`,children:[e.stats.toolCalls,` tools`]}),e.stats.durationMs&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`text-terminal-border text-[10px]`,children:`·`}),(0,H.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer`,children:Ie(e.stats.durationMs)})]})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[e.gist?.gistId&&(0,H.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple`,children:`published`}),(0,H.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer tabular-nums`,children:k(e.startTime)})]})]},e.slug)),(0,H.jsx)(`button`,{onClick:n,className:`w-full py-2 mt-auto text-xs font-sans font-semibold rounded-lg bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200`,children:`View all replays →`})]})}var jt=[{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 Mt(){let[e,t]=(0,_.useState)(()=>jt.map(e=>({...e,installed:!1,detail:`checking...`,loading:!0})));return(0,_.useEffect)(()=>{let e=!1;for(let n of jt)fetch(`/api/system-checks?tool=${encodeURIComponent(n.name)}`).then(e=>e.ok?e.json():null).then(r=>{if(e)return;let i=r?.checks?.find(e=>e.name===n.name)||r?.checks?.[0];if(!i){t(e=>e.map(e=>e.name===n.name?{...e,installed:!1,detail:`check failed`,loading:!1}:e));return}t(e=>e.map(e=>e.name===n.name?{...e,installed:!!i.installed,version:i.version,detail:i.detail,loading:!1}:e))}).catch(()=>{e||t(e=>e.map(e=>e.name===n.name?{...e,installed:!1,detail:`check failed`,loading:!1}:e))});return()=>{e=!0}},[]),(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm`,children:[(0,H.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-3`,children:`System`}),(0,H.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-2`,children:e.map(e=>(0,H.jsxs)(`div`,{className:`flex items-start gap-2.5 px-3 py-2.5 rounded-lg bg-terminal-bg`,children:[(0,H.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,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.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,H.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-dimmer truncate`,children:e.purpose}),e.loading?(0,H.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-blue truncate animate-pulse`,children:`checking...`}):e.installed?(0,H.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-green truncate`,children:e.detail||e.version||`ready`}):(0,H.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-orange truncate`,children:e.detail||`not found`})]})]},e.name))})]})}function Nt({onNavigate:e}){let{sources:t,setSources:n,replays:r,loading:i,loadingSources:a,loadingReplays:o,error:s}=Tt(),c=(0,_.useMemo)(()=>Et(t,r),[t,r]),{scanStatus:l,userInsights:u}=Be(),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(null),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(`idle`),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)(0),E=(0,_.useRef)(null),O=(0,_.useRef)(null),k=h?t.find(e=>e.slug===h)??null:null,M=!u&&(a||!!l?.running||t.length>0),N=(0,_.useMemo)(()=>u?ve(u.topProjects):[],[u]),P=Math.max(c.projectCount,u?.totalProjects??0),ee=u?.totalPrompts??c.totalPrompts,F=u?.totalToolCalls??c.totalToolCalls,I=Object.keys(c.sessionsPerDay).length>0?c.sessionsPerDay:u?.sessionsPerDay??{},ne=e=>{R({view:null,session:e})},L=async e=>{f(e.slug),m(null);try{let t=te(e),n=await fetch(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,filePaths:e.filePaths,toolPaths:e.toolPaths,title:j(t)||void 0,sessionSlug:e.slug,sessionProject:e.project})}),r=await n.json();if(!n.ok)throw Error(r.error||`Generation failed`);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)=>{g(null),f(e.slug),m(null);try{let n=await fetch(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,filePaths:e.filePaths,toolPaths:e.toolPaths,title:j(t)||void 0,sessionSlug:e.slug,sessionProject:e.project})}),r=await n.json();if(!n.ok)throw Error(r.error||`Generation failed`);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)}},B=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))},re=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{}},ie=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)}},ae=()=>{ie()},oe=async()=>{y(`awaitingLogin`),x(`Waiting for sign in...`);try{let e=await fetch(`/api/auth/login`,{method:`POST`}),t=await e.json().catch(()=>null);e.ok&&t?.url&&window.open(t.url,`_blank`)}catch{}E.current&&clearInterval(E.current),O.current&&clearTimeout(O.current),E.current=setInterval(async()=>{try{(await(await fetch(`/api/auth/get-session`)).json())?.session&&(E.current&&=(clearInterval(E.current),null),O.current&&=(clearTimeout(O.current),null),window.dispatchEvent(new Event(`vibe-auth-change`)),ie())}catch{}},2e3),O.current=setTimeout(()=>{E.current&&=(clearInterval(E.current),null),y(`idle`),x(null)},180*1e3)};(0,_.useEffect)(()=>()=>{E.current&&clearInterval(E.current),O.current&&clearTimeout(O.current)},[]),(0,_.useEffect)(()=>{if(!S)return;let e=setInterval(()=>T(e=>e+1),3e4);return()=>clearInterval(e)},[S]);let se=(()=>{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,H.jsx)(`div`,{className:`flex-1 overflow-auto animate-in fade-in duration-500`,children:(0,H.jsxs)(`div`,{className:`max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-6`,children:[(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm space-y-4`,children:[(0,H.jsx)(`div`,{className:`grid grid-cols-4 gap-6`,children:Array.from({length:4},(e,t)=>(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`div`,{className:`h-8 w-20 skeleton rounded`}),(0,H.jsx)(`div`,{className:`h-3 w-14 skeleton rounded`})]},t))}),(0,H.jsx)(`div`,{className:`space-y-1.5 pt-2`,children:Array.from({length:3},(e,t)=>(0,H.jsx)(`div`,{className:`h-3 skeleton rounded`},t))}),(0,H.jsx)(`div`,{className:`h-9 skeleton rounded`})]}),(0,H.jsx)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-3`,children:Array.from({length:2},(e,t)=>(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`div`,{className:`h-3 w-28 skeleton rounded`}),(0,H.jsx)(`div`,{className:`h-3 w-14 skeleton rounded`})]}),Array.from({length:5},(e,t)=>(0,H.jsxs)(`div`,{className:`flex items-center gap-3 px-1 py-1`,children:[(0,H.jsx)(`div`,{className:`h-5 w-14 skeleton rounded-full shrink-0`}),(0,H.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,H.jsx)(`div`,{className:`h-3.5 skeleton rounded`,style:{width:`${55+t*19%35}%`}}),(0,H.jsx)(`div`,{className:`h-2.5 w-20 skeleton rounded`})]}),(0,H.jsx)(`div`,{className:`h-3 w-12 skeleton rounded shrink-0`})]},t)),(0,H.jsx)(`div`,{className:`h-8 skeleton rounded`})]},t))})]})}):s&&t.length===0&&r.length===0?(0,H.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,H.jsx)(`div`,{className:`text-center space-y-2`,children:(0,H.jsx)(`div`,{className:`text-terminal-red font-mono text-sm`,children:s})})}):(0,H.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,H.jsxs)(`div`,{className:`max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-6`,children:[(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-4 gap-x-6 gap-y-1 mb-4`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-2xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,H.jsx)(Ee,{value:c.totalSessions})}),(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5`,children:`sessions`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-2xl font-mono font-bold text-terminal-blue tabular-nums`,children:(0,H.jsx)(Ee,{value:c.totalReplays})}),(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5`,children:`replays`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-2xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,H.jsx)(Ee,{value:ee})}),(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5`,children:`turns`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-2xl font-mono font-bold text-terminal-orange tabular-nums`,children:(0,H.jsx)(Ee,{value:F})}),(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5`,children:`tool calls`})]})]}),(0,H.jsx)(ct,{sessionsPerDay:I,weeks:52}),(0,H.jsxs)(`div`,{className:`flex gap-2 mt-3`,children:[(0,H.jsx)(`button`,{onClick:()=>e(`insights`),className:`flex-1 py-2.5 text-xs font-sans font-semibold rounded-lg bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis transition-all duration-200`,children:`View personal insights →`}),(0,H.jsx)(`button`,{onClick:ae,disabled:v===`syncing`||v===`awaitingLogin`,className:`py-2.5 px-4 text-xs font-sans font-semibold rounded-lg border transition-all duration-200 disabled:opacity-50 disabled:cursor-wait shrink-0 ${v===`done`?`bg-terminal-green/8 text-terminal-green border-terminal-green/20`:v===`error`?`bg-red-400/8 text-red-400 border-red-400/20`:`bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover border-terminal-border`}`,title:b||void 0,children:v===`syncing`?`Syncing...`:v===`done`&&se?`\u2713 Synced ${se}`:v===`error`?`Sync failed`:v===`awaitingLogin`?`Waiting...`:`↑ Sync to cloud`}),(0,H.jsx)(`a`,{href:`https://vibe-replay.com/insights/`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center justify-center w-9 h-9 rounded-lg text-terminal-dim hover:text-terminal-green hover:bg-terminal-surface-hover transition-colors shrink-0`,title:`View insights on vibe-replay.com`,children:(0,H.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,strokeWidth:2,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25`})})})]})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-3 items-stretch`,children:[(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,H.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:`Recent Sessions`}),(0,H.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:[c.totalSessions,` total`]})]}),(0,H.jsx)(`div`,{className:`flex-1 flex flex-col justify-between`,children:(0,H.jsx)(kt,{sessions:c.recentSources,isLoading:a,onViewAll:()=>e(`sessions`),onGenerate:L,onViewReplay:ne,onSessionClick:e=>g(e.slug),generatingSlug:d,generateErrorSlug:p})})]}),(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,H.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:`Recent Replays`}),(0,H.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:[c.totalReplays,` total`]})]}),(0,H.jsx)(`div`,{className:`flex-1 flex flex-col justify-between`,children:(0,H.jsx)(At,{replays:c.recentReplays,isLoading:o,onViewAll:()=>e(`replays`),onOpen:ne})})]})]}),M?(0,H.jsx)(Dt,{}):u&&N.length>1?(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,H.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:`Recent Projects`}),(0,H.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:[P,` total`]})]}),(0,H.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2`,children:[...N].sort((e,t)=>(t.lastActivity||``).localeCompare(e.lastActivity||``)).slice(0,5).map(t=>(0,H.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,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-text truncate block group-hover:text-terminal-green transition-colors`,children:A(t.project)}),(0,H.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[t.sessions,` session`,t.sessions>1?`s`:``,` · `,t.prompts,` prompts`,t.durationMs>0&&` · ${D(t.durationMs)}`]})]}),t.cost>0&&(0,H.jsxs)(`span`,{className:`text-xs font-mono text-terminal-orange tabular-nums shrink-0`,children:[`$`,t.cost.toFixed(2)]})]},t.project))}),N.length>5&&(0,H.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,H.jsx)(Mt,{})]}),k&&(0,H.jsx)(Hn,{session:k,onClose:()=>g(null),onGenerate:z,onViewReplay:e=>R({view:null,session:e}),onArchive:e=>{fetch(`/api/archive/${e}`,{method:`POST`}).catch(()=>{}),g(null)},onTitleSave:B,onDeleteReplay:re,isGenerating:d===k.slug,isArchived:!1}),(v===`needsLogin`||v===`awaitingLogin`)&&(0,H.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,H.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,H.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,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h3`,{className:`text-base font-bold text-terminal-text mb-1`,children:`Sync Insights to the Cloud`}),(0,H.jsx)(`p`,{className:`text-xs text-terminal-dim mb-5`,children:`Sign in with GitHub to unlock your online dashboard.`}),(0,H.jsxs)(`div`,{className:`space-y-3 mb-6`,children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.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,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-sm font-semibold text-terminal-text`,children:`Cross-machine dashboard`}),(0,H.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,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.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,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-sm font-semibold text-terminal-text`,children:`Cost tracking & trends`}),(0,H.jsx)(`p`,{className:`text-[11px] text-terminal-dim mt-0.5`,children:`Track spending by model, spot weekly patterns, and monitor project breakdowns.`})]})]}),(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.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,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-sm font-semibold text-terminal-text`,children:`Share your coding card`}),(0,H.jsx)(`p`,{className:`text-[11px] text-terminal-dim mt-0.5`,children:`Activity heatmaps, streak badges, and project stats — shareable at a glance.`})]})]})]}),(0,H.jsxs)(`button`,{onClick:oe,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,H.jsx)(`svg`,{className:`w-5 h-5`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,H.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,H.jsx)(`p`,{className:`text-[10px] text-terminal-dim text-center mt-3`,children:`We'll auto-sync your insights right after sign in.`})]}):(0,H.jsxs)(`div`,{className:`text-center py-4`,children:[(0,H.jsx)(`div`,{className:`text-2xl mb-3 animate-pulse`,children:`↑`}),(0,H.jsx)(`h3`,{className:`text-base font-bold text-terminal-text mb-1`,children:`Waiting for sign in...`}),(0,H.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 Pt=null,Ft=null,It=0,Lt=4e3;function Rt(){let[e,t]=(0,_.useState)(Pt??[]),[n,r]=(0,_.useState)(Pt===null&&Ft===null),[i,a]=(0,_.useState)(Pt===null?Ft: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}`);Pt=(await n.json()).results??[],It=Pt.length,Ft=null,e||(t(Pt),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;(Pt===null||n!==It)&&await i()}catch(t){let n=t instanceof Error?t.message:`Failed to load`;Ft=n,!e&&Pt===null&&a(n)}finally{e||r(!1),!e&&t&&(n=setTimeout(s,Lt))}}return s(),()=>{e=!0,n&&clearTimeout(n)}},[]),{sessions:e,loading:n,error:i}}function zt(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=Bt(e)?-10:0,l=t+n+r+i+a+o+s+c;return Math.max(0,Math.min(100,l*4))}function Bt(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 Vt(e){return e?new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`}):``}function Ht(e){return e?new Date(e).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!1}):``}function Ut(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 Wt(e){return j(F(e.title||``))||j(F(e.firstPrompt||``))||e.slug}function Gt(e){return e.durationMs==null?!0:(e.dataQualityNotes||[]).some(e=>/duration is inferred|duration.*estimated|missing duration/i.test(e))}function Kt(e){let t=[oe(e.provider)],n=e.dataSource?me(!1,e.dataSource):``;return n&&t.push(n),Gt(e)&&t.push(`estimated time`),t}function qt(e){window.dispatchEvent(new CustomEvent(`vibe-open-session`,{detail:{slug:e}}))}function Jt(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 Yt=[{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 Xt(e){return Yt[e%Yt.length]}function Zt(e,t={}){let n=new Map;for(let r of e){let e=t.collapseWorktrees?_e(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=gn(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 Qt=4,$t=5,en=10,tn=72,nn=40,rn=14,an=12,on=6,sn=8,cn=140,ln=1100;function un(e){return e>=60?.24:.16}function dn(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 fn(e){return e>=60?.95:.78}function pn(e){return sn+Math.sqrt(Math.max(0,Math.min(100,e))/100)*(cn-sn)}function mn(e){return en+Math.max(0,Math.min(100,e))/100*(tn-en)}function hn(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:$t;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 gn(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=gn(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/ln,f=new Map,p=0;for(let e of a){if(e.endMs<c||e.startMs>l)continue;if(!r&&Bt(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=zt(e),i=pn(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}=hn(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=pn(e.score),d=o/100*ln,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:mn(e.score),fillAlpha:un(e.score),opacity:fn(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},()=>en);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+Qt;let i=r+4,c=Math.max(i,nn),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 vn=[{value:`1d`,label:`1D`,days:1},{value:`7d`,label:`7D`,days:7},{value:`30d`,label:`30D`,days:30},{value:`all`,label:`All`}];function yn(e){let t=vn.find(t=>t.value===e);if(!t||t.days==null)return{};let n=Date.now();return{start:n-t.days*864e5,end:n}}function bn({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)(()=>yn(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)Gt(n.session)&&e++;return e},[f]);return(0,H.jsxs)(`div`,{className:`space-y-4 p-4 select-none`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text`,children:`Work Timeline`}),(0,H.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dimmer`,children:[m,` `,U(m,`session`),` · rows are projects · bar position and width show active time`,g>0?` · ${g} estimated`:``]})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 text-[10px] font-mono`,children:[h>0&&!r&&(0,H.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,H.jsx)(`button`,{onClick:()=>i(!1),className:`text-terminal-purple hover:underline`,children:`hide automated`}),(0,H.jsx)(`div`,{className:`inline-flex items-center rounded-xl bg-terminal-surface p-0.5 shadow-layer-sm`,children:vn.map(e=>(0,H.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,H.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-40 gap-2 text-terminal-dimmer text-sm font-mono`,children:[(0,H.jsxs)(`div`,{children:[`No sessions in `,Jt(t),`.`]}),t!==`all`&&(0,H.jsx)(`button`,{onClick:()=>n(`all`),className:`text-terminal-green hover:underline text-xs`,children:`Show all sessions →`})]}):(0,H.jsx)(`div`,{className:`overflow-x-auto rounded-2xl bg-terminal-bg/35 p-3 shadow-inner`,children:(0,H.jsxs)(`div`,{className:`min-w-[760px]`,children:[(0,H.jsx)(`div`,{className:`flex`,style:{paddingLeft:140},children:(0,H.jsxs)(`div`,{className:`relative flex-1 h-6`,children:[p.map((e,t)=>(0,H.jsxs)(`div`,{className:`absolute flex flex-col items-center`,style:{left:`${e.leftPct}%`,transform:`translateX(-50%)`},children:[(0,H.jsx)(`span`,{className:`text-[9px] font-mono text-terminal-dimmer whitespace-nowrap`,children:e.label}),(0,H.jsx)(`div`,{className:`w-px h-1.5 bg-terminal-border/20 mt-0.5`})]},t)),(0,H.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,H.jsx)(`div`,{className:`space-y-1.5`,children:f.map(e=>{let t=Xt(e.colorIdx),n=e.totalRowHeightPx,r=t.solid;return(0,H.jsxs)(`div`,{className:`flex items-stretch rounded-xl group`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col justify-center shrink-0 py-1 pr-3 overflow-hidden`,style:{width:140,height:n},children:[(0,H.jsx)(`div`,{className:`text-xs font-sans font-medium truncate ${t.text}`,children:A(e.project)}),(0,H.jsxs)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer truncate`,children:[e.sessions.length,` `,U(e.sessions.length,`session`),e.hiddenInLanesCount>0&&(0,H.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,H.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,H.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,H.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=Bt(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-on)/an)),l=!n.rightAnchored&&n.realDurationFraction<.85;return(0,H.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:dn(r,n.fillAlpha)},"aria-label":`Open ${Wt(n.session)}`,onClick:()=>qt(n.session.slug),onMouseEnter:e=>{o({session:n.session,x:e.clientX,y:e.clientY})},onMouseLeave:()=>o(null),children:[n.heightPx>=rn&&(0,H.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:Wt(n.session)}),l&&(0,H.jsxs)(H.Fragment,{children:[(0,H.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,H.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,H.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,H.jsx)(`div`,{className:`text-terminal-text font-medium mb-1.5 break-words leading-snug`,children:Wt(a.session)}),(0,H.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-1`,children:Kt(a.session).map(e=>(0,H.jsx)(`span`,{className:`rounded-md bg-terminal-surface-2 px-1.5 py-0.5 text-[10px] text-terminal-dim`,children:e},e))}),(0,H.jsxs)(`div`,{className:`text-terminal-dimmer space-y-0.5`,children:[a.session.startTime&&(()=>{let e=new Date(a.session.startTime).getTime(),t=gn(e,a.session),n=a.session.startTime,r=new Date(t).toISOString(),i=Vt(n)===Vt(r);return(0,H.jsxs)(`div`,{children:[Vt(n),` `,Ht(n),t!==e&&(0,H.jsxs)(`span`,{children:[` → `,i?``:`${Vt(r)} `,Ht(r)]})]})})(),a.session.durationMs&&(0,H.jsx)(`div`,{className:`text-terminal-blue`,children:Ut(a.session.durationMs)}),(0,H.jsxs)(`div`,{children:[a.session.promptCount,`p · `,a.session.editCount,` `,U(a.session.editCount,`edit`),` · `,a.session.toolCallCount,` `,U(a.session.toolCallCount,`tool`)]}),a.session.gitBranch&&(0,H.jsx)(`div`,{className:`text-terminal-purple`,children:a.session.gitBranch}),(a.session.costEstimate??0)>0&&(0,H.jsxs)(`div`,{className:`text-terminal-orange`,children:[`$`,a.session.costEstimate.toFixed(3)]})]})]})]})}function xn(e,t){let n=t.replace(/\/$/,``);return n&&e.startsWith(`${n}/`)?e.slice(n.length+1):e.split(`/`).slice(-3).join(`/`)}function Sn(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:xn(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 Cn({groups:e,hideProjectList:t}){let n=(0,_.useMemo)(()=>Sn(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,H.jsxs)(`div`,{className:`p-8 text-center space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-terminal-dimmer text-sm font-mono`,children:`No hot files found.`}),(0,H.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,H.jsxs)(`div`,{className:`flex h-full min-w-0 flex-col gap-4 p-4 lg:flex-row`,children:[!t&&(0,H.jsxs)(`div`,{className:`w-full shrink-0 space-y-2 overflow-y-auto lg:w-64`,children:[(0,H.jsxs)(`div`,{className:`px-1`,children:[(0,H.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text`,children:`Hot Files`}),(0,H.jsxs)(`div`,{className:`mt-0.5 text-[10px] font-mono text-terminal-dimmer`,children:[n.length,` `,U(n.length,`project`),` with hot files`]})]}),n.map(e=>(0,H.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,H.jsx)(`div`,{className:`truncate text-xs font-sans font-semibold`,children:A(e.project)}),(0,H.jsx)(`div`,{className:`mt-0.5 truncate text-[10px] font-mono text-terminal-dimmer`,children:e.project}),(0,H.jsxs)(`div`,{className:`mt-1 text-[10px] font-mono text-terminal-dimmer`,children:[e.files.length,` `,U(e.files.length,`file`),` ·`,` `,e.totalEdits.toLocaleString(),` `,U(e.totalEdits,`edit`)]})]},e.project))]}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-4`,children:[(0,H.jsxs)(`div`,{className:`relative overflow-hidden rounded-2xl bg-terminal-bg/35 p-4 shadow-inner`,children:[(0,H.jsx)(`div`,{className:`pointer-events-none absolute -right-12 -top-12 h-28 w-28 rounded-full bg-terminal-green/5 blur-2xl`}),(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text`,children:A(s.project)}),(0,H.jsx)(`div`,{className:`mt-0.5 truncate text-xs font-mono text-terminal-dimmer`,children:s.project}),(0,H.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-[10px] font-mono text-terminal-dimmer`,children:[(0,H.jsxs)(`span`,{className:`rounded-md bg-terminal-green-subtle px-1.5 py-0.5 text-terminal-green`,children:[s.files.length,` `,U(s.files.length,`hot file`)]}),(0,H.jsxs)(`span`,{children:[s.totalEdits.toLocaleString(),` `,U(s.totalEdits,`edit`)]}),(0,H.jsxs)(`span`,{children:[s.totalSessions.toLocaleString(),` `,U(s.totalSessions,`session`)]})]})]})]}),(0,H.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[minmax(0,1fr)_22rem]`,children:[(0,H.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,H.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,H.jsx)(`div`,{className:`truncate text-xs font-mono`,children:e.displayName.split(`/`).pop()}),(0,H.jsx)(`div`,{className:`mt-0.5 truncate text-[10px] font-mono text-terminal-dimmer`,children:e.displayName}),(0,H.jsxs)(`div`,{className:`mt-1 text-[10px] font-mono text-terminal-dimmer`,children:[e.totalEdits.toLocaleString(),` `,U(e.totalEdits,`edit`),` ·`,` `,e.sessions.length,` `,U(e.sessions.length,`session`)]})]},e.file)})}),(0,H.jsx)(`div`,{className:`lg:sticky lg:top-3 lg:self-start lg:max-h-[calc(100vh-7rem)] lg:overflow-y-auto`,children:c?(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`rounded-2xl bg-terminal-surface p-4 shadow-layer-sm`,children:[(0,H.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text truncate`,children:c.displayName.split(`/`).pop()}),(0,H.jsx)(`div`,{className:`text-xs font-mono text-terminal-dimmer mt-0.5 break-all`,children:c.file}),(0,H.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dimmer mt-1`,children:[c.totalEdits.toLocaleString(),` `,U(c.totalEdits,`edit`),` `,`across `,c.sessions.length,` `,U(c.sessions.length,`session`)]})]}),(0,H.jsx)(`div`,{className:`space-y-2`,children:c.sessions.map(e=>(0,H.jsxs)(`button`,{type:`button`,onClick:()=>qt(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,H.jsx)(`div`,{className:`hidden w-2 h-2 rounded-full mt-1.5 shrink-0 sm:block`,style:{backgroundColor:Xt(e.colorIdx).solid}}),(0,H.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,H.jsx)(`div`,{className:`text-xs font-sans font-medium text-terminal-text truncate`,children:Wt(e.session)}),(0,H.jsxs)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-0.5`,children:[A(e.session.project),` · `,Vt(e.session.startTime)]})]}),(0,H.jsxs)(`div`,{className:`shrink-0 text-xs font-mono text-terminal-orange`,children:[e.editCount,` `,U(e.editCount,`edit`)]})]},e.session.sessionId))})]}):(0,H.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 wn({view:e,projectFilter:t}){let{sessions:n,loading:r,error:i}=Rt(),a=(0,_.useMemo)(()=>t?n.filter(e=>_e(e.project)===t):n,[n,t]),o=(0,_.useMemo)(()=>Zt(a,{collapseWorktrees:!0}),[a]),s=(0,_.useMemo)(()=>{let e=new Map;for(let t of a){let n=oe(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=>Gt(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,H.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,H.jsx)(`div`,{className:`pointer-events-none absolute -right-24 -top-24 h-64 w-64 rounded-full bg-terminal-green/5 blur-3xl`}),(0,H.jsxs)(`div`,{className:`relative space-y-4 animate-pulse`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,H.jsx)(`div`,{className:`h-3 w-20 rounded bg-terminal-surface-2`}),(0,H.jsx)(`div`,{className:`h-3 w-24 rounded bg-terminal-surface-2 opacity-70`}),(0,H.jsx)(`div`,{className:`h-3 w-32 rounded bg-terminal-surface-2 opacity-50`})]}),(0,H.jsx)(`div`,{className:`rounded-2xl bg-terminal-bg/35 p-3 shadow-inner`,children:(0,H.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:5},(e,t)=>(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`div`,{className:`h-8 w-32 rounded bg-terminal-surface-2 opacity-60`}),(0,H.jsx)(`div`,{className:`h-9 flex-1 rounded-xl bg-terminal-surface/60 shadow-layer-sm`})]},t))})})]})]}):i?(0,H.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,H.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,H.jsxs)(`div`,{className:`text-terminal-dimmer text-sm font-mono`,children:[`Failed to load: `,i]}),(0,H.jsx)(`div`,{className:`text-terminal-dimmer/60 text-xs font-mono`,children:`Make sure the vibe-replay editor server is running.`})]})}):(0,H.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,H.jsx)(`div`,{className:`pointer-events-none absolute -right-24 -top-24 h-64 w-64 rounded-full bg-terminal-green/5 blur-3xl`}),(0,H.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,H.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,H.jsxs)(`span`,{children:[(0,H.jsx)(`span`,{className:`text-terminal-text`,children:a.length}),` `,U(a.length,`session`)]}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`span`,{className:`text-terminal-text`,children:o.length}),` `,U(o.length,`project`)]}),s&&(0,H.jsx)(`span`,{children:(0,H.jsx)(`span`,{className:`text-terminal-purple`,children:s})}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`span`,{className:`text-terminal-blue`,children:Ut(l.durationMs)}),` total time`]}),(0,H.jsxs)(`span`,{children:[(0,H.jsxs)(`span`,{className:`text-terminal-orange`,children:[`$`,l.cost.toFixed(2)]}),` total cost`]}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`span`,{className:`text-terminal-green`,children:l.edits.toLocaleString()}),` `,U(l.edits,`edit`)]}),c>0&&(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`span`,{className:`text-terminal-dimmer`,children:c}),` estimated timing`]})]}),(0,H.jsxs)(`div`,{className:`relative z-10 min-w-0 flex-1 overflow-y-auto overflow-x-hidden`,children:[e===`timeline`&&(0,H.jsx)(bn,{groups:o}),e===`files`&&(0,H.jsx)(Cn,{groups:o,hideProjectList:!!t})]})]})}var Tn=[{id:`overview`,label:`Overview`},{id:`timeline`,label:`Timeline`},{id:`files`,label:`Hot Files`}];function En({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[De(a)]||0;r.push(t),t>i&&(i=t),a.setDate(a.getDate()+1)}return{data:r,max:i}},[e]);return(0,H.jsx)(`div`,{className:`flex items-end gap-px ${t===`md`?`h-8`:`h-4`}`,children:n.map((e,t)=>(0,H.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 Dn({projects:e,selected:t,onSelect:n}){let r=e.reduce((e,t)=>e+t.sessions,0);return(0,H.jsxs)(`div`,{className:`hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20`,children:[(0,H.jsx)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle`,children:(0,H.jsx)(`span`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold`,children:`Projects`})}),(0,H.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-2 space-y-0.5`,children:[(0,H.jsxs)(`button`,{onClick:()=>n(be),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,H.jsx)(`span`,{className:`font-medium`,children:`All projects`}),(0,H.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,H.jsx)(`div`,{className:`h-px bg-terminal-border-subtle mx-2 my-1.5`}),e.map(e=>{let r=t===e.project,i=A(e.project);return(0,H.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,H.jsxs)(`div`,{className:`flex items-center justify-between gap-1.5`,children:[(0,H.jsx)(`span`,{className:`text-xs font-sans truncate ${r?`text-terminal-green font-medium`:`text-terminal-text`}`,children:i}),(0,H.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,H.jsx)(`div`,{className:`mt-1 ml-0.5 text-xs font-mono truncate ${r?`text-terminal-dim`:`text-terminal-dimmer`}`,children:Me(e.lastActivity,`long`)})]},e.project)})]})]})}function On({project:e,insight:t,onOpenSessions:n}){let r=A(e);return(0,H.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,H.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,H.jsx)(`span`,{className:`pointer-events-none absolute -right-10 -top-12 h-32 w-32 rounded-full bg-terminal-green/5 blur-2xl`}),(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`text-base font-sans font-semibold text-terminal-text truncate`,children:r}),(0,H.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dimmer truncate mt-0.5`,children:e})]}),t.lastActivity&&(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer shrink-0`,children:Me(t.lastActivity,`long`)})]}),(0,H.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 sm:grid-cols-4 gap-3 text-xs font-mono`,children:[(0,H.jsx)(kn,{label:U(t.sessions,`session`),value:t.sessions.toString(),tone:`text`}),t.durationMs>0&&(0,H.jsx)(kn,{label:`active time`,value:Ie(t.durationMs),tone:`blue`}),t.cost>0&&(0,H.jsx)(kn,{label:`cost`,value:`$${t.cost.toFixed(2)}`,tone:`orange`}),(0,H.jsx)(kn,{label:U(t.prompts,`prompt`),value:W(t.prompts),tone:`green`})]}),(0,H.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 text-[10px] font-mono text-terminal-dimmer flex-wrap`,children:[t.toolCalls>0&&(0,H.jsxs)(`span`,{children:[W(t.toolCalls),` `,U(t.toolCalls,`tool`)]}),t.edits>0&&(0,H.jsxs)(`span`,{children:[W(t.edits),` `,U(t.edits,`edit`)]}),t.branchCount>0&&(0,H.jsxs)(`span`,{children:[t.branchCount,` `,U(t.branchCount,`branch`,`branches`)]}),t.prCount>0&&(0,H.jsxs)(`span`,{children:[t.prCount,` `,U(t.prCount,`PR`)]}),t.memoryFileCount>0&&(0,H.jsxs)(`span`,{children:[t.memoryFileCount,` `,U(t.memoryFileCount,`memory file`)]})]}),(0,H.jsxs)(`div`,{className:`mt-4`,children:[(0,H.jsx)(En,{sessionsPerDay:t.sessionsPerDay,size:`md`}),(0,H.jsx)(`div`,{className:`mt-1 text-[10px] font-mono text-terminal-dimmer`,children:`last 30 days`})]}),(0,H.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 kn({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,H.jsxs)(`div`,{className:`rounded-lg bg-terminal-bg/40 p-2.5`,children:[(0,H.jsx)(`div`,{className:`text-sm font-sans font-semibold tabular-nums ${r}`,children:t}),(0,H.jsx)(`div`,{className:`mt-0.5 text-[10px] font-mono text-terminal-dimmer`,children:e})]})}function An({projects:e,onProjectClick:t}){return(0,H.jsx)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-3`,children:e.map(e=>{let n=A(e.project);return(0,H.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,H.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,H.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,H.jsxs)(`div`,{className:`flex items-start justify-between gap-2 mb-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`text-sm font-sans font-medium text-terminal-text truncate group-hover:text-terminal-green transition-colors`,children:n}),(0,H.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dimmer truncate mt-0.5`,children:e.project})]}),e.lastActivity&&(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer shrink-0`,children:Me(e.lastActivity,`long`)})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-3 text-xs font-mono flex-wrap mb-3`,children:[(0,H.jsxs)(`span`,{className:`text-terminal-text tabular-nums`,children:[e.sessions,` `,(0,H.jsx)(`span`,{className:`text-terminal-dimmer`,children:U(e.sessions,`session`)})]}),e.durationMs>0&&(0,H.jsx)(`span`,{className:`text-terminal-blue tabular-nums`,children:Ie(e.durationMs)}),e.cost>0&&(0,H.jsxs)(`span`,{className:`text-terminal-orange tabular-nums`,children:[`$`,e.cost.toFixed(2)]}),(0,H.jsxs)(`span`,{className:`text-terminal-green tabular-nums`,children:[W(e.prompts),` `,(0,H.jsx)(`span`,{className:`text-terminal-dimmer`,children:U(e.prompts,`prompt`)})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] font-mono text-terminal-dimmer flex-wrap mb-2`,children:[e.toolCalls>0&&(0,H.jsxs)(`span`,{children:[W(e.toolCalls),` `,U(e.toolCalls,`tool`)]}),e.edits>0&&(0,H.jsxs)(`span`,{children:[W(e.edits),` `,U(e.edits,`edit`)]}),e.branchCount>0&&(0,H.jsxs)(`span`,{children:[e.branchCount,` `,U(e.branchCount,`branch`,`branches`)]}),e.prCount>0&&(0,H.jsxs)(`span`,{children:[e.prCount,` `,U(e.prCount,`PR`)]}),e.memoryFileCount>0&&(0,H.jsxs)(`span`,{children:[e.memoryFileCount,` `,e.memoryFileCount===1?`Claude memory`:`Claude memories`]})]}),(0,H.jsx)(En,{sessionsPerDay:e.sessionsPerDay})]},e.project)})})}function jn({onNavigate:e}){let{userInsights:t,scanStatus:n}=Be(),[r,i]=(0,_.useState)(be),[a,o]=(0,_.useState)(`overview`),s=(0,_.useMemo)(()=>{if(!t)return[];let e=ve(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,H.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,H.jsxs)(`div`,{className:`text-center space-y-2 text-terminal-dimmer text-sm font-mono`,children:[(0,H.jsx)(`p`,{children:`No scan data available yet.`}),(0,H.jsx)(`p`,{className:`text-xs`,children:`Projects will appear once the background scan completes.`})]})});if(!t&&l)return(0,H.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-terminal-dim text-sm font-mono`,children:[(0,H.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!==be,p=f?Tn.filter(e=>e.id!==`timeline`):Tn,m=p.some(e=>e.id===a)?a:`overview`,h=f?r:void 0;return(0,H.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,H.jsx)(Dn,{projects:d,selected:r,onSelect:e=>{i(e),o(`overview`)}}),(0,H.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-0 min-w-0 overflow-y-auto`,children:[(0,H.jsx)(`div`,{className:`md:hidden px-3 pt-3`,children:(0,H.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,H.jsxs)(`option`,{value:be,children:[`All projects (`,s.length,`)`]}),s.map(e=>(0,H.jsxs)(`option`,{value:e.project,children:[A(e.project),` (`,e.sessions,`)`]},e.project))]})}),(0,H.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,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`h2`,{className:`text-sm font-sans font-semibold text-terminal-text truncate`,children:[r===`__all__`?`All Projects`:A(r),r===`__all__`&&(0,H.jsxs)(`span`,{className:`ml-2 text-terminal-dimmer font-normal`,children:[`(`,s.length,`)`]})]}),l&&(0,H.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5 text-[10px] font-mono text-terminal-dim`,children:[(0,H.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-terminal-purple animate-pulse`}),`Analyzing... `,n.scanned,`/`,n.total]})]}),(0,H.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,H.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,H.jsxs)(`div`,{className:`px-4 md:px-6 pb-6 space-y-4`,children:[m===`overview`&&r===`__all__`&&(0,H.jsx)(An,{projects:s,onProjectClick:i}),m===`overview`&&c&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(On,{project:r,insight:c,onOpenSessions:()=>u(r)}),(0,H.jsx)(wn,{view:`timeline`,projectFilter:h})]}),m===`timeline`&&(0,H.jsx)(wn,{view:`timeline`,projectFilter:h}),m===`files`&&(0,H.jsx)(wn,{view:`files`,projectFilter:h})]})]})]})}var Mn=()=>(0,H.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`currentColor`,children:[(0,H.jsx)(`circle`,{cx:`8`,cy:`3`,r:`1.5`}),(0,H.jsx)(`circle`,{cx:`8`,cy:`8`,r:`1.5`}),(0,H.jsx)(`circle`,{cx:`8`,cy:`13`,r:`1.5`})]});function Nn({provider:e}){return(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-medium px-1.5 py-0.5 rounded-full uppercase tracking-wider ${se(e)}`,children:oe(e)})}function Pn({slug:e,title:t,fallbackTitle:n,onSave:r}){let i=j(t||n||e),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(i),[l,u]=(0,_.useState)(!1),d=(0,_.useRef)(null);(0,_.useEffect)(()=>{c(i)},[i]),(0,_.useEffect)(()=>{a&&d.current?.focus()},[a]);let f=async()=>{if(!l){u(!0);try{await r(e,j(s))}finally{u(!1),o(!1)}}};return a?(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),f()},className:`flex items-center gap-1.5 min-w-0`,children:(0,H.jsx)(`input`,{ref:d,value:s,onChange:e=>c(e.target.value),onBlur:f,onKeyDown:e=>{e.key===`Escape`&&(c(i),o(!1))},className:`bg-terminal-surface-2 rounded px-2 py-0.5 text-sm font-sans text-terminal-text w-full outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-green/50 transition-shadow duration-200`,placeholder:i,maxLength:120,disabled:l})}),(0,H.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer truncate mt-0.5`,children:[`slug: `,(0,H.jsx)(`span`,{className:`text-terminal-dim`,children:e})]})]}):(0,H.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,H.jsxs)(`button`,{onClick:()=>o(!0),className:`group flex items-center gap-1 min-w-0 max-w-full text-left`,title:`Click to edit title`,children:[(0,H.jsx)(`span`,{className:`text-sm font-sans font-medium text-terminal-text truncate`,children:i||e}),(0,H.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,H.jsx)(`path`,{d:`M11.5 1.5l3 3-9 9H2.5v-3l9-9z`})})]}),(0,H.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer truncate mt-0.5`,children:[`slug: `,(0,H.jsx)(`span`,{className:`text-terminal-dim`,children:e})]})]})}function Fn({onArchive:e,isArchived:t}){let[n,r]=(0,_.useState)(!1),i=(0,_.useRef)(null);return v(i,(0,_.useCallback)(()=>r(!1),[]),n),(0,H.jsxs)(`div`,{className:`relative`,ref:i,children:[(0,H.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,H.jsx)(Mn,{})}),n&&(0,H.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,H.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,H.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,H.jsx)(`path`,{d:`M2 4h12v2H2zM3 6v7h10V6M6.5 8h3`})}),t?`Unarchive`:`Archive`]})})]})}var In=null,Ln=null;function Rn(){return In?Promise.resolve(In):Ln||(Ln=fetch(`/api/scan/results`).then(e=>e.ok?e.json():null).then(e=>{let t=e?.results??null;return In=t,setTimeout(()=>{In=null,Ln=null},3e4),t}).catch(()=>null),Ln)}function zn(e,t,n){let r=[],i=new Set,a=[t?.firstPrompt,...e.prompts||[]];t?.firstPrompt||a.push(e.firstPrompt);for(let e of a){let t=F(e||``);!t||i.has(t)||(i.add(t),r.push(t))}let o=F(n||``);return r.length>1&&o&&r[0]===o&&r.shift(),r.length>1&&/^(?:and|but|or|so|then)\b/i.test(r[0]||``)&&r.shift(),r}function Bn(e){return e&&e!==`main`&&e!==`master`?e:void 0}function Vn(e,t){return e===`jsonl`?`bg-terminal-orange-subtle text-terminal-orange`:e===`global-state`?`bg-terminal-blue-subtle text-terminal-blue`:e===`sqlite`||t?`bg-terminal-green-subtle text-terminal-green`:`bg-terminal-surface-2 text-terminal-dimmer`}function Hn({session:e,scanData:t=null,onClose:n,onGenerate:r,onViewReplay:i,onArchive:a,onTitleSave:o,onDeleteReplay:s,isGenerating:c,isArchived:l}){let[u,d]=(0,_.useState)(t),f=te(e),p=ne(e,u),[m,h]=(0,_.useState)(e.replay?.title||p),[g,v]=(0,_.useState)(!1),y=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n]),(0,_.useEffect)(()=>{let e=y.current;e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length))},[]),(0,_.useEffect)(()=>{d(t)},[t]),(0,_.useEffect)(()=>{if(t)return;let n=!1;return Rn().then(t=>{if(n||!t)return;let r=t.find(t=>t.slug===e.slug);r&&d(r)}),()=>{n=!0}},[t,e.slug]),(0,_.useEffect)(()=>{h(t=>{let n=j(t),r=j(p),i=j(e.replay?.title);return!n||n===i||n===e.slug||r&&n===j(f)?e.replay?.title||p:t})},[f,p,e.replay?.title,e.slug]);let b=Bn(u?.gitBranch||e.gitBranch),x=u?.model||e.model,S=zn(e,u,p),C=u?.dataQualityNotes||[],D=u?.promptCount??e.promptCount,M=u?.toolCallCount??e.toolCallCount,N=u?.editCount??e.editCountEst,P=u?.durationMs??e.durationMsEst,ee=u?.costEstimate??e.replay?.stats?.costEstimate,F=u?.tokenUsage?u.tokenUsage.inputTokens+u.tokenUsage.outputTokens:void 0,I=u?.startTime||e.timestamp,L=async()=>{if(!e.replay||g)return;let t=j(m);if(t!==j(e.replay.title||p)){v(!0);try{await o(e.slug,t)}finally{v(!1)}}},R=()=>{r(e,m)};return(0,H.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,children:[(0,H.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-md animate-in fade-in duration-300`,onClick:n}),(0,H.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,H.jsxs)(`div`,{className:`flex items-center justify-between px-7 pt-5 pb-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Nn,{provider:e.provider}),x&&(0,H.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-surface-2 text-terminal-dimmer`,children:E(x)}),u?.dataSource&&(0,H.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full ${Vn(u.dataSource,e.hasSqlite)}`,children:me(e.hasSqlite,u.dataSource)}),u?.entrypoint&&(0,H.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,H.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,H.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,H.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,H.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,H.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,H.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,H.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`})})})]}),(0,H.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-7 space-y-5 pb-5`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between mb-2 px-1`,children:[(0,H.jsx)(`span`,{className:`text-xs font-sans uppercase tracking-widest text-terminal-dimmer`,children:`Title`}),(0,H.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:e.slug})]}),(0,H.jsx)(`form`,{onSubmit:t=>{t.preventDefault(),e.replay?L():R()},children:(0,H.jsx)(`textarea`,{ref:y,value:m,onChange:e=>h(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:p,maxLength:120})})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-5`,children:[(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl px-5 py-4 space-y-2.5`,children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-1`,children:`Session Info`}),(0,H.jsx)(Un,{label:`Project`,value:A(e.project),title:e.project}),b&&(0,H.jsx)(Un,{label:`Branch`,value:b}),u?.gitBranches&&u.gitBranches.length>1&&(0,H.jsx)(Un,{label:`Branches`,value:u.gitBranches.join(`, `)}),u?.skillsUsed&&u.skillsUsed.length>0&&(0,H.jsx)(Un,{label:`Skills`,value:u.skillsUsed.join(`, `)}),u?.mcpServersUsed&&u.mcpServersUsed.length>0&&(0,H.jsx)(Un,{label:`MCP Servers`,value:u.mcpServersUsed.join(`, `)}),(0,H.jsx)(Un,{label:`Started`,value:`${w(I)} (${k(I)})`}),u?.endTime&&(0,H.jsx)(Un,{label:`Ended`,value:w(u.endTime)}),!!P&&(0,H.jsx)(Un,{label:`Duration`,value:`~${Ie(P)}`}),(0,H.jsx)(Un,{label:`Size`,value:O(e.fileSize)}),(0,H.jsx)(Un,{label:`Lines`,value:e.lineCount.toLocaleString()}),e.filePaths.length>1&&(0,H.jsx)(Un,{label:`Parts`,value:`${e.filePaths.length} files`}),(0,H.jsx)(Un,{label:`Data`,value:me(e.hasSqlite,u?.dataSource)})]}),(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl px-5 py-4 space-y-2.5`,children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-1`,children:`Stats`}),!!D&&(0,H.jsx)(Un,{label:`Prompts`,value:String(D)}),!!M&&(0,H.jsx)(Un,{label:`Tools`,value:String(M)}),!!N&&(0,H.jsx)(Un,{label:`Edits`,value:u?String(N):`~${N}`}),ee!=null&&ee>0&&(0,H.jsx)(Un,{label:`Cost`,value:T(ee)}),F!=null&&(0,H.jsx)(Un,{label:`Tokens`,value:F.toLocaleString(),title:u?.tokenUsage?`In: ${u.tokenUsage.inputTokens.toLocaleString()} / Out: ${u.tokenUsage.outputTokens.toLocaleString()} / Cache write: ${u.tokenUsage.cacheCreationTokens.toLocaleString()} / Cache read: ${u.tokenUsage.cacheReadTokens.toLocaleString()}`:void 0}),u!=null&&u.subAgentCount>0&&(0,H.jsx)(Un,{label:`Agents`,value:`${u.subAgentCount} sub-agents`}),u!=null&&u.compactionCount>0&&(0,H.jsx)(Un,{label:`Compacts`,value:String(u.compactionCount)}),u!=null&&u.apiErrorCount>0&&(0,H.jsx)(Un,{label:`Errors`,value:`${u.apiErrorCount} API errors`}),e.hasPR&&!u?.prLinks?.length&&(0,H.jsx)(Un,{label:`PR`,value:`Yes`}),u?.prLinks?.map(e=>(0,H.jsx)(Un,{label:`PR`,value:`#${e.prNumber} (${e.prRepository})`},e.prNumber))]})]}),C.length>0&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2`,children:`Data Quality`}),(0,H.jsx)(`div`,{className:`bg-terminal-surface rounded-xl px-4 py-3 space-y-1.5`,children:C.map(e=>(0,H.jsxs)(`div`,{className:`flex gap-2 items-start text-xs font-mono text-terminal-dim`,children:[(0,H.jsx)(`span`,{className:`text-terminal-orange shrink-0 mt-px`,children:`!`}),(0,H.jsx)(`span`,{children:e})]},e))})]}),u?.filesModified&&u.filesModified.length>0&&(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2`,children:[`Files Modified (`,u.filesModified.length,`)`]}),(0,H.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,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs font-mono`,children:[(0,H.jsx)(`span`,{className:`text-terminal-dim truncate`,children:e.file}),(0,H.jsxs)(`span`,{className:`text-terminal-dimmer shrink-0 tabular-nums`,children:[e.count,`x`]})]},e.file)),u.filesModified.length>20&&(0,H.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dimmer`,children:[`+`,u.filesModified.length-20,` more files`]})]})]}),S.length>0&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2`,children:`Prompts`}),(0,H.jsx)(`div`,{className:`max-h-[180px] overflow-y-auto space-y-1.5 pr-1`,children:S.map((e,t)=>(0,H.jsxs)(`div`,{className:`flex gap-2 items-start`,children:[(0,H.jsx)(`span`,{className:`text-xs text-terminal-green shrink-0 mt-px select-none`,children:`>`}),(0,H.jsx)(`p`,{className:`text-sm text-terminal-dim line-clamp-2 leading-relaxed`,children:e})]},t))})]}),e.replay&&(0,H.jsxs)(`div`,{className:`border-t border-terminal-border-subtle pt-4`,children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2`,children:`Replay`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[e.replay.replaySize!=null&&(0,H.jsx)(`span`,{className:`text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dim`,children:O(e.replay.replaySize)}),e.replay.generatorVersion&&(0,H.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,H.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,H.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,H.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,H.jsxs)(`div`,{className:`flex items-center justify-between px-7 py-4 border-t border-terminal-border-subtle`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.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,H.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,H.jsx)(`path`,{d:`M2 4h12v2H2zM3 6v7h10V6M6.5 8h3`})}),l?`Unarchive`:`Archive`]}),e.replay&&(0,H.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,H.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,H.jsx)(`path`,{d:`M3 4h10M5.5 4V3h5v1M6 7v4M10 7v4M4.5 4l.5 9h6l.5-9`})}),`Delete replay`]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.sessionId&&(0,H.jsxs)(`button`,{onClick:()=>z(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,H.jsxs)(`span`,{className:`relative flex w-2 h-2`,children:[(0,H.jsx)(`span`,{className:`absolute inline-flex h-full w-full rounded-full bg-terminal-red opacity-75 animate-ping`}),(0,H.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-red`})]}),`Watch live`]}),e.replay&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{onClick:()=>r(e,m),disabled:c,className:`h-11 px-5 text-sm font-sans font-semibold rounded-xl bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200 flex items-center gap-2 disabled:opacity-50`,children:c?(0,H.jsx)(`span`,{className:`animate-pulse`,children:`Regenerating...`}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,H.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,H.jsx)(`path`,{d:`M21 3v5h-5`}),(0,H.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,H.jsx)(`path`,{d:`M8 16H3v5`})]}),`Regenerate`]})}),(0,H.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,H.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,H.jsx)(`path`,{d:`M5 3l8 5-8 5V3z`})}),`View Replay`]})]}),!e.replay&&(0,H.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,H.jsx)(`span`,{className:`animate-pulse`,children:`Generating...`}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,H.jsx)(`path`,{d:`M8 2v12M2 8h12`})}),`Generate Replay`]})})]})]})]})]})}function Un({label:e,value:t,title:n}){return(0,H.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,H.jsx)(`span`,{className:`text-[11px] font-sans text-terminal-dimmer uppercase tracking-wider shrink-0 w-[68px]`,children:e}),(0,H.jsx)(`span`,{className:`text-sm font-mono text-terminal-dim truncate`,title:n||t,children:t})]})}function Wn({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=_e(e.project),g=h!==e.project;return(0,H.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,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,H.jsx)(`div`,{className:`flex-1 flex items-center gap-2 min-w-0`,children:r?(0,H.jsx)(`div`,{className:`flex-1 min-w-0`,onClick:e=>e.stopPropagation(),children:(0,H.jsx)(Pn,{slug:e.slug,title:e.title,fallbackTitle:L(e),onSave:r})}):(0,H.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,H.jsx)(`span`,{className:`text-sm font-sans font-medium text-terminal-text truncate block`,children:L(e)}),(0,H.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer truncate mt-0.5`,children:[`slug: `,(0,H.jsx)(`span`,{className:`text-terminal-dim`,children:e.slug})]})]})}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[e.replayOutdated&&(0,H.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,H.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,H.jsx)(`path`,{d:`M2.5 8a5.5 5.5 0 019.3-4M13.5 8a5.5 5.5 0 01-9.3 4`}),(0,H.jsx)(`path`,{d:`M12.5 1v3h-3M3.5 15v-3h3`})]}),`outdated`]}),e.gist?.outdated&&(0,H.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,H.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,H.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,H.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,H.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,H.jsx)(`path`,{d:`M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z`})}):(0,H.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,H.jsx)(`path`,{d:`M8 2v8M5 5l3-3 3 3M3 11v2h10v-2`})}),e.cloud||e.gist?`Shared`:`Share`]}),a&&(0,H.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,H.jsx)(`span`,{className:`animate-pulse`,children:`...`}):(0,H.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,H.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,H.jsx)(`path`,{d:`M21 3v5h-5`}),(0,H.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,H.jsx)(`path`,{d:`M8 16H3v5`})]}),`Redo`]}),(0,H.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,H.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,H.jsx)(`polygon`,{points:`4 2 14 8 4 14`})}),`View`]}),(i||o)&&(0,H.jsxs)(`div`,{className:`relative`,ref:m,children:[(0,H.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,H.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`currentColor`,children:[(0,H.jsx)(`circle`,{cx:`8`,cy:`3`,r:`1.5`}),(0,H.jsx)(`circle`,{cx:`8`,cy:`8`,r:`1.5`}),(0,H.jsx)(`circle`,{cx:`8`,cy:`13`,r:`1.5`})]})}),f&&(0,H.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,H.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,H.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,H.jsx)(`path`,{d:`M2 4h12v2H2zM3 6v7h10V6M6.5 8h3`})}),l?`Unarchive`:`Archive`]}),i&&(0,H.jsxs)(H.Fragment,{children:[o&&(0,H.jsx)(`div`,{className:`mx-2 my-1 border-t border-terminal-border`}),u?(0,H.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1`,children:[(0,H.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,H.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,H.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,H.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,H.jsx)(`path`,{d:`M3 4h10M5.5 4V3a1 1 0 011-1h3a1 1 0 011 1v1M6.5 7v4M9.5 7v4M4.5 4l.5 9a1 1 0 001 1h4a1 1 0 001-1l.5-9`})}),`Delete`]})]})]})]})]})]}),(e.messages||(e.firstMessage?[e.firstMessage]:[])).map(e=>F(e||``)).filter(e=>e.length>0).map((e,t)=>(0,H.jsxs)(`div`,{className:`flex gap-2 items-start`,children:[(0,H.jsx)(`span`,{className:`text-xs text-terminal-green shrink-0 mt-px select-none`,children:`>`}),(0,H.jsx)(`p`,{className:`text-sm text-terminal-dim line-clamp-1 leading-relaxed`,children:e})]},t)),(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,H.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,H.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,H.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:Ie(e.stats.durationMs)}),e.stats.costEstimate&&(0,H.jsx)(`span`,{className:`inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-green-subtle text-terminal-green`,children:T(e.stats.costEstimate)}),e.hasAnnotations&&(0,H.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,H.jsx)(`span`,{className:`inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md ${e.replaySize>10*1024*1024?`bg-terminal-red-subtle text-terminal-red`:`bg-terminal-surface-2 text-terminal-dimmer`}`,title:e.replaySize>10*1024*1024?`Exceeds share limit (10MB)`:void 0,children:O(e.replaySize)})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono text-terminal-dimmer flex-wrap`,children:[(0,H.jsx)(Nn,{provider:e.provider}),(0,H.jsx)(`span`,{title:g?e.project:void 0,children:h}),g&&(0,H.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,H.jsx)(`span`,{className:`text-terminal-border`,children:`·`}),(0,H.jsx)(`span`,{children:w(e.startTime)}),e.model&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`text-terminal-border`,children:`·`}),(0,H.jsx)(`span`,{children:e.model})]})]})]})}function Gn(){let[e,t]=(0,_.useState)(!1),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(null);return(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`button`,{onClick:async()=>{t(!0),a(null),r(null);try{let e=await fetch(`/api/regenerate-all`,{method:`POST`}),t=await e.json();if(!e.ok)throw Error(t.error||`Failed`);r({regenerated:t.regenerated,total:t.total}),setTimeout(()=>window.location.reload(),1500)}catch(e){a(e instanceof Error?e.message:`Failed to regenerate`)}finally{t(!1)}},disabled:e,className:`px-3 py-1.5 text-xs font-mono rounded-lg bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover border border-terminal-border-subtle transition-colors duration-200 disabled:opacity-40`,children:e?`Regenerating...`:`Regenerate All`}),n&&(0,H.jsxs)(`span`,{className:`text-xs font-mono text-terminal-green`,children:[n.regenerated,`/`,n.total,` regenerated`]}),i&&(0,H.jsx)(`span`,{className:`text-xs font-mono text-terminal-red`,children:i})]})}function Kn(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)({}),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!0),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(null),[g,v]=(0,_.useState)(null),[y,w]=(0,_.useState)(()=>Date.now()),{selectedProject:T,filter:D,showArchived:M,handleProjectChange:N,handleFilterChange:P,handleToggleArchived:ee}=Ce(),{scanStatus:F,userInsights:I,projectInsightsCache:te,fetchProjectInsights:L}=Be(),z=_e(T);(0,_.useEffect)(()=>{z!==`__all__`&&L(z)},[z,L]);let B=z===`__all__`?void 0:te.get(z),[re,ie]=(0,_.useState)(null),[ae,oe]=(0,_.useState)(null),[se,ce]=(0,_.useState)(null);(0,_.useEffect)(()=>{(()=>{let e=new URLSearchParams(window.location.search).get(`selected`);if(!e)return;ce(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;ce(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 le=(0,_.useRef)(!1),[fe,he]=(0,_.useState)(new Set),[ge,ve]=(0,_.useState)(null),ye=e.some(e=>e.provider===`cursor`),xe=se?e.find(e=>e.slug===se)??null:null,Se=(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:[]}));he(new Set(n.slugs));let r=!1,i=b(await fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null)),o=!e?.forceRefresh&&x(i?.cachedAt);if(i&&i.sessions.length>0&&(r=!0,t(i.sessions),v(i.cachedAt??null),p(o?null:i.cachedAt??null),s(!1),d(!o)),o){d(!1),s(!1);return}try{let e=await fetch(`/api/sources`);if(!e.ok)throw Error(`Failed to load sessions`);let n=await e.json();t(n.sessions),n.cleanupPeriodDays!=null&&a(n.cleanupPeriodDays),v(new Date().toISOString()),p(null)}catch(e){r?h(`Failed to refresh latest sessions. Showing cached data.`):l(de(e)||`Failed to load sessions`)}finally{d(!1),s(!1)}},[]),V=e=>ue(e,fe,he);(0,_.useEffect)(()=>{Se()},[Se]),(0,_.useEffect)(()=>{if(e.length===0)return;let t=!1,n=async()=>{let e=await Rn();t||!e||r(Object.fromEntries(e.filter(e=>e.slug).map(e=>[e.slug,e])))};n();let i=window.setInterval(()=>{n()},F?.running?5e3:3e4);return()=>{t=!0,window.clearInterval(i)}},[F?.running,e.length]),(0,_.useEffect)(()=>{if(!o&&!ye&&!le.current)return;let e=!1,n,r=async()=>{let n=b(await fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null));!e&&n?.sessions.length&&t(n.sessions)},i=async()=>{let t=await fetch(`/api/sources/enrichment-status`).then(e=>e.ok?e.json():null).catch(()=>null);!t||e||(ve(t),t.running?(le.current=!0,await r()):le.current&&(le.current=!1,await r()))};return i(),n=window.setInterval(()=>{i()},2500),()=>{e=!0,n&&window.clearInterval(n)}},[ye,o]),(0,_.useEffect)(()=>{let e=window.setInterval(()=>w(Date.now()),3e4);return()=>window.clearInterval(e)},[]);let we=async(e,n)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:n})})).ok)throw Error(`Failed to update title`);t(t=>t.map(t=>t.slug===e&&t.replay?{...t,replay:{...t.replay,title:n||void 0}}:t))},Te=async(e,t)=>{ce(null),ie(e.slug),oe(null);try{let n=await fetch(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,filePaths:e.filePaths,toolPaths:e.toolPaths,title:j(t)||void 0,sessionSlug:e.slug,sessionProject:e.project})}),r=await n.json();if(!n.ok)throw Error(r.error||`Generation failed`);R({view:null,session:r.slug})}catch(e){oe(de(e))}finally{ie(null)}},Ee=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{}},De=e.filter(e=>fe.has(e.slug)).length,Oe=M?e:e.filter(e=>!fe.has(e.slug)),ke=new Map;for(let e of Oe){let t=_e(e.project);ke.has(t)||ke.set(t,[]),ke.get(t)?.push(e)}let Ae=[...ke.entries()].sort((e,t)=>{let n=e[1][0]?.timestamp||``;return(t[1][0]?.timestamp||``).localeCompare(n)}),je=pe(Ae.map(([e])=>e)),U=z===`__all__`?Oe:ke.get(z)||[],Me=D?U.filter(e=>e.slug.toLowerCase().includes(D.toLowerCase())||e.firstPrompt.toLowerCase().includes(D.toLowerCase())||(e.title||``).toLowerCase().includes(D.toLowerCase())||(e.gitBranch||``).toLowerCase().includes(D.toLowerCase())):U,Ne=g?C(g,y):null,Pe=o&&e.length===0,Fe=e.filter(e=>e.expiresInDays!=null&&e.expiresInDays<=7&&!fe.has(e.slug)),W=Fe.reduce((e,t)=>Math.min(e,t.expiresInDays??1/0),1/0);return c&&e.length===0?(0,H.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,H.jsxs)(`div`,{className:`text-center space-y-3`,children:[(0,H.jsx)(`div`,{className:`text-terminal-red font-mono text-sm`,children:c}),(0,H.jsx)(`button`,{onClick:()=>void Se({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&&!Pe?(0,H.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,H.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-terminal-dim font-mono text-sm`,children:`No AI sessions found`}),(0,H.jsx)(`div`,{className:`text-terminal-dimmer font-mono text-xs`,children:`Start a coding session with Claude Code or Cursor, then come back here`})]})}):(0,H.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,H.jsxs)(`div`,{className:`hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold`,children:`Projects`}),Ne&&(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:Ne})]}),(0,H.jsx)(`button`,{onClick:()=>{Se({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,H.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:[(0,H.jsx)(`path`,{d:`M2.5 8a5.5 5.5 0 019.3-4M13.5 8a5.5 5.5 0 01-9.3 4`}),(0,H.jsx)(`path`,{d:`M12.5 1v3h-3M3.5 15v-3h3`})]})})]}),(0,H.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-2 space-y-0.5`,children:[(0,H.jsxs)(`button`,{onClick:()=>N(be),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,H.jsx)(`span`,{className:`font-medium`,children:`All projects`}),(0,H.jsx)(`span`,{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${T===`__all__`?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer`}`,children:e.length})]}),(0,H.jsx)(`div`,{className:`h-px bg-terminal-border-subtle mx-2 my-1.5`}),Ae.map(([e,t])=>{let n=t.filter(e=>e.existingReplay).length,r=z===e,i=je.get(e)||A(e),a=t.some(e=>e.projectExists!==!1),o=t.some(e=>e.isGitRepo||e.gitBranch);return(0,H.jsxs)(`button`,{onClick:()=>N(e),title:e,className:`w-full text-left px-3 py-2.5 rounded-lg transition-all duration-200 ease-material group ${r?`bg-terminal-green-subtle shadow-layer-sm`:`hover:bg-terminal-surface`} ${a?``:`opacity-50`}`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-1.5`,children:[(0,H.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,H.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`shrink-0 ${r?`opacity-70`:`opacity-40`}`,children:(0,H.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,H.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,H.jsxs)(`div`,{className:`flex items-center gap-2 mt-1 ml-0.5`,children:[(0,H.jsx)(`span`,{className:`text-xs font-mono truncate ${r?`text-terminal-dim`:`text-terminal-dimmer`}`,children:k(t[0]?.timestamp||``)}),n>0&&(0,H.jsxs)(`span`,{className:`text-xs font-mono ${r?`text-terminal-green`:`text-terminal-dimmer`}`,children:[n,` `,n===1?`replay`:`replays`]})]})]},e)})]})]}),(0,H.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-0 min-w-0`,children:[(0,H.jsx)(`div`,{className:`md:hidden px-3 pt-3`,children:(0,H.jsxs)(`select`,{value:T,onChange:e=>N(e.target.value),className:`w-full bg-terminal-surface rounded-lg px-3 py-2.5 text-sm font-sans text-terminal-text outline-none shadow-layer-sm`,children:[(0,H.jsxs)(`option`,{value:be,children:[`All projects (`,e.length,`)`]}),Ae.map(([e,t])=>(0,H.jsxs)(`option`,{value:e,children:[je.get(e)||A(e),` (`,t.length,`)`]},e))]})}),(0,H.jsxs)(`div`,{className:`px-4 pt-4 pb-2 space-y-3 shrink-0`,children:[(0,H.jsx)(`div`,{className:`hidden md:block`,children:B&&T!==`__all__`?(0,H.jsx)(Ue,{insights:B,variant:`project`}):I&&T===`__all__`?(0,H.jsx)(Ue,{insights:I,variant:`all`}):(0,H.jsx)(He,{})}),(0,H.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[(0,H.jsxs)(`div`,{className:`relative flex-1`,children:[(0,H.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,H.jsx)(`circle`,{cx:`7`,cy:`7`,r:`5`}),(0,H.jsx)(`path`,{d:`M11 11l3.5 3.5`})]}),(0,H.jsx)(`input`,{value:D,onChange:e=>P(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`})]}),De>0&&(0,H.jsx)(`button`,{onClick:ee,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${M?`bg-terminal-orange-subtle text-terminal-orange`:`bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,title:M?`Hide archived`:`View all (${De} archived)`,children:M?`Active`:`View all`})]})]}),(Pe||u||f)&&(0,H.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,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,H.jsx)(`span`,{children:`FETCHING SESSIONS...`})]}):u?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,H.jsx)(`span`,{children:`SCANNING LATEST SESSIONS...`}),f&&(0,H.jsxs)(`span`,{className:`text-terminal-dim`,children:[`Showing stale cache (`,S(f),`)`]})]}):f?(0,H.jsxs)(`span`,{children:[`Showing stale cache (`,S(f),`)`]}):null}),ge?.running&&ge.total>0&&(0,H.jsxs)(`div`,{className:`mx-4 mb-2 flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue shrink-0 shadow-layer-sm`,children:[(0,H.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,H.jsxs)(`span`,{children:[`BACKFILLING CURSOR STATS... `,ge.processed,`/`,ge.total]})]}),m&&(0,H.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,H.jsx)(`span`,{children:m}),(0,H.jsx)(`button`,{onClick:()=>h(null),className:`ml-auto text-terminal-orange/60 hover:text-terminal-orange transition-colors`,children:`×`})]}),ae&&(0,H.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,H.jsx)(`span`,{children:ae}),(0,H.jsx)(`button`,{onClick:()=>oe(null),className:`ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors`,children:`×`})]}),Fe.length>0&&(0,H.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,H.jsx)(`span`,{className:`text-terminal-orange text-base leading-none mt-0.5`,children:`⚠`}),(0,H.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,H.jsxs)(`div`,{className:`text-xs font-sans font-semibold text-terminal-orange`,children:[Fe.length,` session`,Fe.length===1?``:`s`,` expiring`,W===0?` today`:W===1?` tomorrow`:` within ${W} days`]}),(0,H.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,H.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:Pe?(0,H.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:`Fetching sessions...`}):Me.length===0?(0,H.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:D?`No sessions match your filter`:`No sessions in this project`}):(0,H.jsx)(`div`,{className:`space-y-2.5 px-4 py-3`,children:Me.map(e=>{let t=n[e.slug];if(e.replay){let n=fe.has(e.slug),r=ne(e,t),i=zn(e,t,r);return(0,H.jsx)(Wn,{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:we,onRegenerate:()=>ce(e.slug),isRegenerating:re===e.slug,onDelete:()=>Ee(e.slug),onArchive:()=>V(e.slug),isArchived:n},`${e.provider}-${e.slug}`)}let r=ne(e,t),i=zn(e,t,r),a=Bn(t?.gitBranch||e.gitBranch),o=_e(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=me(e.hasSqlite,t?.dataSource),m=fe.has(e.slug);return(0,H.jsxs)(`div`,{onClick:()=>ce(e.slug),className:`bg-terminal-surface rounded-xl px-5 py-4 hover:bg-terminal-surface-hover transition-all duration-300 ease-material space-y-2.5 shadow-layer-sm cursor-pointer hover-lift ${m?`opacity-50`:``}`,children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,H.jsx)(`span`,{className:`text-sm font-mono text-terminal-text truncate block`,children:r}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,H.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer truncate`,children:[`slug: `,(0,H.jsx)(`span`,{className:`text-terminal-dim`,children:e.slug})]}),a&&(0,H.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,H.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,H.jsx)(`circle`,{cx:`5`,cy:`4`,r:`2`}),(0,H.jsx)(`circle`,{cx:`11`,cy:`12`,r:`2`}),(0,H.jsx)(`path`,{d:`M5 6v4c0 1.1.9 2 2 2h2`})]}),a]}),s&&(0,H.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,H.jsxs)(`div`,{className:`flex flex-col items-end gap-1 shrink-0`,children:[(0,H.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:k(e.timestamp)}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(`button`,{onClick:t=>{t.stopPropagation(),ce(e.slug)},disabled:re===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:re===e.slug?(0,H.jsx)(`span`,{className:`animate-pulse`,children:`Generating...`}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,H.jsx)(`path`,{d:`M8 2v12M2 8h12`})}),`Generate`]})}),(0,H.jsx)(Fn,{onArchive:()=>V(e.slug),isArchived:m})]})]})]}),i.map((e,t)=>(0,H.jsxs)(`div`,{className:`flex gap-2 items-start`,children:[(0,H.jsx)(`span`,{className:`text-xs text-terminal-green shrink-0 mt-px select-none`,children:`>`}),(0,H.jsx)(`p`,{className:`text-sm text-terminal-dim line-clamp-1 leading-relaxed`,children:e})]},t)),(e.promptCount||l||u||d||e.hasPR||e.expiresInDays!=null&&e.expiresInDays<=7)&&(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[!!c&&(0,H.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,H.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,H.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:[`~`,Ie(u)]}),!!d&&(0,H.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,H.jsx)(`span`,{className:`inline-flex items-center gap-1 text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-purple-subtle text-terminal-purple`,title:`Session produced a PR`,children:`PR`}),e.expiresInDays!=null&&e.expiresInDays<=7&&(0,H.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,H.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,H.jsx)(Nn,{provider:e.provider}),T===`__all__`&&(0,H.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:je.get(o)||je.get(e.project)||A(o)}),f&&(0,H.jsx)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer`,children:E(f)}),(0,H.jsx)(`span`,{className:`text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer`,children:O(e.fileSize)}),e.filePaths.length>1&&(0,H.jsxs)(`span`,{className:`text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer`,children:[e.filePaths.length,` parts`]}),(e.hasSqlite||t?.dataSource)&&(0,H.jsx)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded-md ${Vn(t?.dataSource,e.hasSqlite)}`,title:p,children:p})]})]},`${e.provider}-${e.slug}`)})})}),xe&&(0,H.jsx)(Hn,{session:xe,scanData:n[xe.slug]||null,onClose:()=>ce(null),onGenerate:Te,onViewReplay:e=>R({view:null,session:e}),onArchive:e=>{V(e)},onTitleSave:we,onDeleteReplay:Ee,isGenerating:re===xe.slug,isArchived:fe.has(xe.slug)})]})]})}function qn(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(()=>Date.now()),[m,h]=(0,_.useState)(new Set),[g,v]=(0,_.useState)(null),[y,w]=(0,_.useState)(null),{selectedProject:T,filter:E,showArchived:D,handleProjectChange:O,handleFilterChange:j,handleToggleArchived:M}=Ce(),{userInsights:N,projectInsightsCache:P,fetchProjectInsights:ee}=Be(),F=_e(T);(0,_.useEffect)(()=>{F!==`__all__`&&ee(F)},[F,ee]);let I=F===`__all__`?void 0:P.get(F);(0,_.useEffect)(()=>{let e=!0;return(async()=>{r(!0),s(!1),l(null);let n=await fetch(`/api/archived`).then(e=>e.ok?e.json():{slugs:[]}).catch(()=>({slugs:[]}));e&&h(new Set(n.slugs));let i=!1,o=b(await fetch(`/api/sessions/cached`).then(e=>e.ok?e.json():null).catch(()=>null)),c=x(o?.cachedAt);if(e&&o&&(i=!0,t(o.sessions),a(!0),d(o.cachedAt??null),(o.sessions.length>0||c)&&(l(c?null:o.cachedAt??null),r(!1),s(!c))),c){e&&(s(!1),r(!1));return}try{let n=await fetch(`/api/sessions`);if(!n.ok)throw Error(`Failed to load sessions`);let r=await n.json();if(!e)return;t(r),a(!0),d(new Date().toISOString()),l(null)}catch{if(!e)return;i||a(!1)}finally{e&&(s(!1),r(!1))}})(),()=>{e=!1}},[]),(0,_.useEffect)(()=>{let e=window.setInterval(()=>p(Date.now()),3e4);return()=>window.clearInterval(e)},[]);let te=e=>ue(e,m,h),ne=async(e,n)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:n})})).ok)throw Error(`Failed to update title`);t(t=>t.map(t=>t.slug===e?{...t,title:n||void 0}:t))},L=e=>{R({view:null,session:e})},z=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`)}},B=async e=>{w(e.slug);try{let t=await fetch(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,sessionSlug:e.slug,sessionProject:e.project,sessionId:e.sessionId||void 0,title:e.title||void 0})}),n=await t.json();if(!t.ok)throw Error(n.error||`Regeneration failed`);R({view:null,session:n.slug})}catch(e){console.error(`Regenerate error:`,de(e))}finally{w(null)}},re=e.filter(e=>m.has(e.slug)).length,ie=D?e:e.filter(e=>!m.has(e.slug)),ae=new Map;for(let e of ie){let t=_e(e.project);ae.has(t)||ae.set(t,[]),ae.get(t)?.push(e)}let oe=[...ae.entries()].sort((e,t)=>{let n=e[1][0]?.startTime||``;return(t[1][0]?.startTime||``).localeCompare(n)}),se=pe(oe.map(([e])=>e)),ce=F===`__all__`?ie:ae.get(F)||[],le=E?ce.filter(e=>(e.title||``).toLowerCase().includes(E.toLowerCase())||e.slug.toLowerCase().includes(E.toLowerCase())||e.project.toLowerCase().includes(E.toLowerCase())||e.provider.toLowerCase().includes(E.toLowerCase())||(e.firstMessage||``).toLowerCase().includes(E.toLowerCase())):ce,fe=u?C(u,f):null,me=n&&e.length===0;return!me&&(!i||e.length===0)?(0,H.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,H.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 py-6 space-y-6`,children:[(0,H.jsx)(Gn,{}),i&&e.length===0&&(0,H.jsxs)(`div`,{className:`text-center py-12 space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-terminal-dim font-mono text-sm`,children:`No replays yet`}),(0,H.jsx)(`div`,{className:`text-terminal-dimmer font-mono text-xs`,children:`Go to the Sessions tab to generate your first replay`})]}),!i&&(0,H.jsx)(`div`,{className:`text-center py-8 space-y-2`,children:(0,H.jsxs)(`div`,{className:`text-terminal-dimmer font-mono text-xs`,children:[`Or run `,(0,H.jsx)(`span`,{className:`text-terminal-green`,children:`npx vibe-replay`}),` to create a replay from your AI coding sessions`]})})]})}):(0,H.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,H.jsxs)(`div`,{className:`hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20`,children:[(0,H.jsx)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold`,children:`Projects`}),fe&&(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:fe})]})}),(0,H.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-2 space-y-0.5`,children:[(0,H.jsxs)(`button`,{onClick:()=>O(be),className:`w-full text-left px-3 py-2.5 text-xs font-mono rounded-lg transition-all duration-200 ease-material flex items-center justify-between ${T===`__all__`?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface`}`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:`All replays`}),(0,H.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:ie.length})]}),(0,H.jsx)(`div`,{className:`h-px bg-terminal-border-subtle mx-2 my-1.5`}),oe.map(([e,t])=>{let n=F===e,r=se.get(e)||A(e),i=t.filter(e=>e.gist?.gistId).length;return(0,H.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,H.jsxs)(`div`,{className:`flex items-center justify-between gap-1.5`,children:[(0,H.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,H.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,H.jsxs)(`div`,{className:`flex items-center gap-2 mt-1 ml-0.5`,children:[(0,H.jsx)(`span`,{className:`text-xs font-mono truncate ${n?`text-terminal-dim`:`text-terminal-dimmer`}`,children:k(t[0]?.startTime||``)}),i>0&&(0,H.jsxs)(`span`,{className:`text-xs font-mono ${n?`text-terminal-purple`:`text-terminal-dimmer`}`,children:[i,` published`]})]})]},e)})]})]}),(0,H.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-0 min-w-0`,children:[(0,H.jsx)(`div`,{className:`md:hidden px-3 pt-3`,children:(0,H.jsxs)(`select`,{value:T,onChange:e=>O(e.target.value),className:`w-full bg-terminal-surface rounded-lg px-3 py-2.5 text-sm font-mono text-terminal-text outline-none shadow-layer-sm`,children:[(0,H.jsxs)(`option`,{value:be,children:[`All replays (`,ie.length,`)`]}),oe.map(([e,t])=>(0,H.jsxs)(`option`,{value:e,children:[se.get(e)||A(e),` (`,t.length,`)`]},e))]})}),(0,H.jsxs)(`div`,{className:`px-4 pt-4 pb-2 space-y-3 shrink-0`,children:[(0,H.jsx)(`div`,{className:`hidden md:block`,children:I&&T!==`__all__`?(0,H.jsx)(Ue,{insights:I,variant:`project`}):N&&T===`__all__`?(0,H.jsx)(Ue,{insights:N,variant:`all`}):(0,H.jsx)(He,{})}),(0,H.jsxs)(`div`,{className:`hidden md:flex items-center gap-2`,children:[(0,H.jsxs)(`div`,{className:`relative flex-1`,children:[(0,H.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,H.jsx)(`circle`,{cx:`7`,cy:`7`,r:`5`}),(0,H.jsx)(`path`,{d:`M11 11l3.5 3.5`})]}),(0,H.jsx)(`input`,{value:E,onChange:e=>j(e.target.value),placeholder:`Filter replays...`,className:`w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm`})]}),re>0&&(0,H.jsx)(`button`,{onClick:M,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${D?`bg-terminal-orange-subtle text-terminal-orange`:`bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,title:D?`Hide archived`:`View all (${re} archived)`,children:D?`Active`:`View all`}),(0,H.jsx)(Gn,{})]}),(0,H.jsxs)(`div`,{className:`md:hidden flex gap-2 items-center`,children:[(0,H.jsxs)(`div`,{className:`relative flex-1`,children:[(0,H.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,H.jsx)(`circle`,{cx:`7`,cy:`7`,r:`5`}),(0,H.jsx)(`path`,{d:`M11 11l3.5 3.5`})]}),(0,H.jsx)(`input`,{value:E,onChange:e=>j(e.target.value),placeholder:`Filter replays...`,className:`w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm`})]}),re>0&&(0,H.jsx)(`button`,{onClick:M,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${D?`bg-terminal-orange-subtle text-terminal-orange`:`bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,title:D?`Hide archived`:`View all (${re} archived)`,children:D?`Active`:`View all`})]})]}),(me||o||c)&&(0,H.jsx)(`div`,{className:`mx-4 mb-2 flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue shrink-0 shadow-layer-sm`,children:me?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,H.jsx)(`span`,{children:`FETCHING REPLAYS...`})]}):o?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,H.jsx)(`span`,{children:`SCANNING LATEST REPLAYS...`}),c&&(0,H.jsxs)(`span`,{className:`text-terminal-dim`,children:[`Showing stale cache (`,S(c),`)`]})]}):c?(0,H.jsxs)(`span`,{children:[`Showing stale cache (`,S(c),`)`]}):null}),g&&(0,H.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,H.jsx)(`span`,{children:g}),(0,H.jsx)(`button`,{onClick:()=>v(null),className:`ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors`,children:`×`})]}),(0,H.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:me?(0,H.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:`Fetching replays...`}):le.length===0?(0,H.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:E?`No replays match your filter`:`No replays in this project`}):(0,H.jsx)(`div`,{className:`space-y-2.5 px-4 py-3`,children:le.map(e=>{let t=m.has(e.slug);return(0,H.jsx)(Wn,{summary:e,onOpen:()=>L(e.slug),onShare:()=>R({view:null,session:e.slug,v:`export`}),onTitleSave:ne,onDelete:()=>z(e.slug),onRegenerate:()=>B(e),onArchive:()=>te(e.slug),isRegenerating:y===e.slug,isArchived:t},e.slug)})})})]})]})}function Jn(){let{scanStatus:e}=Be(),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,H.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,H.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse shrink-0`}),(0,H.jsx)(`span`,{className:`text-terminal-dim`,children:c}),s.total>0&&(0,H.jsx)(`div`,{className:`w-16 h-1 rounded-full bg-terminal-surface-2 overflow-hidden`,children:(0,H.jsx)(`div`,{className:`h-full bg-terminal-purple rounded-full transition-all duration-300`,style:{width:`${l}%`}})})]})}function Yn({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,H.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,H.jsxs)(Ve,{children:[(0,H.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-0`,children:[n&&(0,H.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,H.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,H.jsx)(`div`,{className:`flex-1`}),t]}),i===`home`&&n?(0,H.jsx)(Nt,{onNavigate:o}):i===`insights`&&n?(0,H.jsx)(wt,{}):i===`projects`&&n?(0,H.jsx)(jn,{onNavigate:o}):i===`sessions`&&n?(0,H.jsx)(Kn,{}):(0,H.jsx)(qn,{})]}),(0,H.jsx)(Jn,{})]})}function Xn(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 Zn(e,t,n){return e.map(e=>e.id===t?{...e,body:n,updatedAt:new Date().toISOString()}:e)}function Qn(e,t){return e.filter(e=>e.id!==t)}function $n(e){return new Set(e.map(e=>e.sceneIndex))}function er(e){let t=new Map;for(let n of e)t.set(n.sceneIndex,(t.get(n.sceneIndex)||0)+1);return t}function tr(e,t){return JSON.stringify(e)!==JSON.stringify(t)}function nr(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 rr(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 ir(e){return e.rawSum>0?e.rawCr/e.rawSum*100:0}function ar(e){return e.type===`tool-call`&&!e.diff&&!e.bashOutput}function or(e,t){let n=e[t];if(!ar(n))return t;let r=n.toolName,i=t;for(;i+1<e.length&&ar(e[i+1])&&e[i+1].toolName===r;)i++;return i}function sr(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 cr(e){return e===`user-prompt`||e===`compaction-summary`||e===`context-injection`}function lr(e){let t=[];for(let n=0;n<e.length;n++)e[n].type===`user-prompt`&&t.push(n);return t}function ur(e,t){return e.find(e=>e>t)}function dr(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]<t)return e[n]}function fr(e,t,n){let r=t+1;if(r>=e.length)return-1;if(n.promptsOnly){for(;r<e.length&&!cr(e[r].type);)r++;return r>=e.length?-1:r}if(n.compactAssistant&&!cr(e[r].type)){let t=r;for(;t+1<e.length&&!cr(e[t+1].type);)t++;return t}return or(e,r)}function pr(e,t,n){let r=Math.max(0,t-1);if(t<=0)return 0;if(n.promptsOnly){for(;r>0&&!cr(e[r].type);)r--;return r}if(n.compactAssistant){if(!cr(e[t].type)){let n=t;for(;n>0&&!cr(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 mr(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 gr(e){return hr+e}function _r(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(gr(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=tr(a,s),u=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(r)return u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{fetch(mr(`/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(gr(n),JSON.stringify(a))}catch{}},[a,n,r]);let d=(0,_.useMemo)(()=>$n(a),[a]),f=(0,_.useMemo)(()=>er(a),[a]),p=(0,_.useCallback)((e,t)=>{o(n=>Xn(n,e,t))},[]),m=(0,_.useCallback)((e,t)=>{o(n=>Zn(n,e,t))},[]),h=(0,_.useCallback)(e=>{o(t=>Qn(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(gr(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(gr(n))}catch{}},[e,a,n]),[y,b]=(0,_.useState)(!1),x=r?async()=>{b(!0);try{await fetch(mr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});let e=await fetch(mr(`/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(mr(`/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(mr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a),signal:e.signal});let t=await fetch(mr(`/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,P]=(0,_.useState)(!1),ee=r?async()=>{P(!0);try{await fetch(mr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});let e=await fetch(mr(`/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{P(!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:ee,exportGithub:r?async()=>{I(!0);try{await fetch(mr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});let e=await fetch(mr(`/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 vr={version:1,overlays:[]};function yr(e,t=`embedded`){let n=t===`editor`,[r,i]=(0,_.useState)(vr),[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(mr(`/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(mr(`/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(mr(`/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(vr)},[]),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]),P=(0,_.useMemo)(()=>n&&d?async e=>{let t=new AbortController;v.current=t,m(!0);try{let n=await fetch(mr(`/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]),ee=(0,_.useMemo)(()=>n&&d?async e=>{let t=new AbortController;v.current=t,g(!0);try{let n=await fetch(mr(`/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:P,runTone:ee}}function br(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 xr(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)(()=>lr(e),[e]),v=(0,_.useCallback)(()=>{d.current&&=(clearTimeout(d.current),null)},[]),y=(0,_.useCallback)(()=>{if(f.current!==`playing`)return;let t=fr(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=sr(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=or(e,0);o(t),u(t+1);let n=sr(e[t],m.current);d.current=setTimeout(y,n)}else{let t=e[p.current];if(t){let e=sr(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=sr(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=ur(g,p.current);e!==void 0&&C(e)},[g,C]),T=(0,_.useCallback)(()=>{let e=dr(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=sr(n,t);d.current=setTimeout(y,e)}}},[e,v,y]);return(0,_.useEffect)(()=>v,[v]),(0,_.useEffect)(()=>{if(!n)return;let t=t=>{if(!br(t.target))if(t.key===` `)t.preventDefault(),S();else if(t.key===`ArrowDown`||t.key===`j`){f.current===`playing`&&x(),t.preventDefault();let n=fr(e,p.current,h.current);n!==-1&&C(n)}else t.key===`ArrowUp`||t.key===`k`?(f.current===`playing`&&x(),t.preventDefault(),C(pr(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=>fr(e,n,t),[e,t]),computePrevIndex:(0,_.useCallback)(n=>pr(e,n,t),[e,t])}}function Sr(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 Cr=`vibe-replay-view-prefs`,wr={displayMode:`compact`,hideThinking:!1,collapseAllTools:!1,promptsOnly:!1};function Tr(){try{let e=localStorage.getItem(Cr);if(e){let t=JSON.parse(e);return t.displayMode?{...wr,...t}:{...wr,...t,displayMode:`compact`}}}catch{}return wr}function Er(){let[e,t]=(0,_.useState)(Tr);return{prefs:e,updatePref:(0,_.useCallback)((e,n)=>{t(t=>{let r={...t,[e]:n};return localStorage.setItem(Cr,JSON.stringify(r)),r})},[]),togglePref:(0,_.useCallback)(e=>{t(t=>{let n=t[e];if(typeof n!=`boolean`)return t;let r={...t,[e]:!n};return localStorage.setItem(Cr,JSON.stringify(r)),r})},[])}}function Dr({size:e=14}){return(0,H.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,H.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 Or({className:e=``}){return(0,H.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,H.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,H.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 kr({toolName:e}){return e===`claude`?(0,H.jsxs)(`div`,{className:`mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1`,children:[(0,H.jsxs)(`p`,{children:[`Runs`,` `,(0,H.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,H.jsxs)(`p`,{className:`text-terminal-dimmer`,children:[`Auth issues? Run`,` `,(0,H.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,H.jsxs)(`div`,{className:`mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1`,children:[(0,H.jsxs)(`p`,{children:[`Runs`,` `,(0,H.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,H.jsxs)(`p`,{className:`text-terminal-dimmer`,children:[`Auth issues? Check Cursor IDE settings or run`,` `,(0,H.jsx)(`code`,{className:`px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text`,children:`agent`}),` `,`in your terminal.`]})]}):e===`opencode`?(0,H.jsxs)(`div`,{className:`mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1`,children:[(0,H.jsxs)(`p`,{children:[`Runs`,` `,(0,H.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,H.jsxs)(`p`,{className:`text-terminal-dimmer`,children:[`Not working? Run`,` `,(0,H.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,H.jsxs)(`p`,{className:`mt-2 text-xs font-mono text-terminal-dim leading-relaxed`,children:[`Runs `,(0,H.jsx)(`span`,{className:`text-terminal-text font-medium`,children:e}),` locally on your machine using your existing auth.`]})}var Ar=[`English`,`Chinese (Simplified)`,`Chinese (Traditional)`,`Japanese`,`Korean`,`Spanish`,`French`,`German`,`Portuguese`,`Russian`],jr=[{value:`professional`,label:`Professional`},{value:`neutral`,label:`Neutral`},{value:`friendly`,label:`Friendly`}];function Mr({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),P=m||o||s,ee=n.length>0?n:g,F=r||v,I=(0,_.useCallback)(async()=>{if(p){D(null),N(null);try{let e=await p();D({type:`success`,text:`Score ${e.score}/10 \u2014 ${e.itemCount} comment(s)`})}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;D({type:`error`,text:e instanceof Error?e.message:`AI Coach failed`})}}},[p]),te=(0,_.useCallback)(async()=>{if(l){k(null),N(null);try{let e=await l({targetLang:S});k({type:`success`,text:`${e.translated} message(s) translated, ${e.skipped} unchanged`})}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;k({type:`error`,text:e instanceof Error?e.message:`Translation failed`})}}},[l,S]),ne=(0,_.useCallback)(async()=>{if(u){j(null),N(null);try{let e=await u({style:w});j({type:`success`,text:`${e.adjusted} prompt(s) adjusted, ${e.skipped} unchanged`})}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;j({type:`error`,text:e instanceof Error?e.message:`Tone adjustment failed`})}}},[u,w]),L=e=>t.overlays.overlays.some(t=>t.source.type===e),R=e=>{if(e===`coach`&&x){N(`coach`);return}if(e===`translate`&&L(`translate`)){N(`translate`);return}if(e===`tone`&&L(`tone`)){N(`tone`);return}e===`coach`?I():e===`translate`?te():ne()};return!a&&g.length===0?(0,H.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,H.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-terminal-border-subtle flex items-center gap-2`,children:[(0,H.jsx)(Dr,{size:12}),(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest`,children:`AI Studio`})]}),(0,H.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center px-6 py-8 text-center`,children:[(0,H.jsx)(`div`,{className:`w-10 h-10 rounded-xl bg-terminal-surface flex items-center justify-center mb-3`,children:(0,H.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,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,H.jsx)(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`}),(0,H.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`})]})}),(0,H.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text mb-1`,children:`No AI tools detected`}),(0,H.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,H.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,H.jsxs)(`div`,{className:`px-3 py-2 rounded-lg bg-terminal-surface border border-terminal-border-subtle`,children:[(0,H.jsxs)(`div`,{className:`text-xs font-sans font-medium text-terminal-text flex items-center gap-1.5`,children:[e.name,e.rec&&(0,H.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-green-subtle text-terminal-green`,children:`recommended`})]}),(0,H.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim mt-0.5 break-all`,children:e.cmd})]},e.name))}),(0,H.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,H.jsx)(`span`,{className:`text-terminal-green font-medium`,children:`locally`}),` on your machine.`]})]})]}):(0,H.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,H.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-terminal-border-subtle flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Dr,{size:12}),(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest`,children:`AI Studio`})]}),d>0&&(0,H.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,H.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,H.jsxs)(`div`,{className:`px-4 py-3 border-b border-terminal-border-subtle bg-terminal-surface/30`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim`,children:`Tool`}),ee.length>1&&i?(0,H.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:ee.map(e=>(0,H.jsx)(`option`,{value:e.name,children:e.name},e.name))}):(0,H.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,H.jsx)(kr,{toolName:F})]}),(0,H.jsxs)(`div`,{className:`p-4 space-y-3`,children:[b&&(0,H.jsx)(Nr,{title:`AI Coach`,preview:(0,H.jsxs)(`div`,{className:`mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden`,children:[(0,H.jsx)(`div`,{className:`px-3 py-2.5 border-b border-terminal-border-subtle`,children:(0,H.jsx)(`div`,{className:`text-xs font-mono text-terminal-green leading-relaxed`,children:`Fix the login bug users reported`})}),(0,H.jsxs)(`div`,{className:`px-3 py-2 flex items-start gap-2`,children:[(0,H.jsx)(`span`,{className:`text-xs shrink-0`,children:`💬`}),(0,H.jsx)(`span`,{className:`text-xs font-mono text-terminal-blue leading-relaxed`,children:`Be specific — which file? what error?`})]}),(0,H.jsxs)(`div`,{className:`px-3 py-2 border-t border-terminal-border-subtle flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-xs font-mono font-semibold text-terminal-orange`,children:`6/10`}),(0,H.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:P,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,H.jsx)(Nr,{title:`Translate`,preview:(0,H.jsxs)(`div`,{className:`mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden`,children:[(0,H.jsxs)(`div`,{className:`px-3 py-2.5 space-y-1`,children:[(0,H.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim line-through opacity-60`,children:`这个bug怎么修?`}),(0,H.jsx)(`div`,{className:`text-xs font-mono text-terminal-green`,children:`How to fix this bug?`})]}),(0,H.jsxs)(`div`,{className:`px-3 py-2.5 border-t border-terminal-border-subtle space-y-1`,children:[(0,H.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim line-through opacity-60`,children:`已写入。以后用中文问我...`}),(0,H.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:P,status:O,buttonLabel:L(`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 te(),onCancelRerun:()=>N(null),config:(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mt-2.5`,children:[(0,H.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim shrink-0`,children:`Target`}),(0,H.jsx)(`select`,{value:S,onChange:e=>C(e.target.value),disabled:P,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:Ar.map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))})]})}),u&&(0,H.jsx)(Nr,{title:`Soften Tone`,preview:(0,H.jsxs)(`div`,{className:`mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden`,children:[(0,H.jsxs)(`div`,{className:`px-3 py-2.5 space-y-1`,children:[(0,H.jsx)(`div`,{className:`text-xs font-mono text-terminal-red line-through opacity-60`,children:`this code is mass garbage, mass delete it`}),(0,H.jsx)(`div`,{className:`text-xs font-mono text-terminal-green`,children:`Let's refactor this module for clarity`})]}),(0,H.jsxs)(`div`,{className:`px-3 py-2.5 border-t border-terminal-border-subtle space-y-1`,children:[(0,H.jsx)(`div`,{className:`text-xs font-mono text-terminal-red line-through opacity-60`,children:`are you stupid? I said fix the auth`}),(0,H.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:P,status:A,buttonLabel:L(`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 ne(),onCancelRerun:()=>N(null),config:(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mt-2.5`,children:[(0,H.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim shrink-0`,children:`Style`}),(0,H.jsx)(`select`,{value:w,onChange:e=>T(e.target.value),disabled:P,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:jr.map(e=>(0,H.jsx)(`option`,{value:e.value,children:e.label},e.value))})]})})]})]})]})}function Nr({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,H.jsxs)(`div`,{className:`rounded-xl border border-terminal-border-subtle bg-terminal-surface/30 overflow-hidden`,children:[(0,H.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,H.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text`,children:e}),t,n&&(0,H.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim mt-2 leading-relaxed`,children:n}),m,(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mt-3`,children:[(0,H.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,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Or,{className:`text-terminal-purple`}),s]}):o}),r&&l&&(0,H.jsx)(`button`,{onClick:l,className:`text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`})]})]}),u&&!r&&(0,H.jsx)(`div`,{className:`px-4 pb-3`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono`,children:[(0,H.jsx)(`span`,{className:`text-terminal-orange flex-1`,children:d}),(0,H.jsx)(`button`,{onClick:p,className:`text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`}),(0,H.jsx)(`button`,{onClick:f,className:`text-terminal-purple hover:text-terminal-text transition-colors font-medium`,children:`Continue`})]})}),a&&(0,H.jsx)(`div`,{className:`px-4 pb-3 text-xs font-mono ${a.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:a.text})]})}function Pr({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,H.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,H.jsx)(`div`,{className:`absolute inset-0 bg-black/30`,onClick:t}),(0,H.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,H.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,H.jsx)(Mr,{annotationActions:n,overlayActions:r})]})]})}function Fr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ir=Fr();function Lr(e){Ir=e}var Rr={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(Br.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var zr=(()=>{try{return!0}catch{return!1}})(),Br={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)}}>`)},Vr=/^(?:[ \t]*(?:\n|$))+/,Hr=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ur=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Wr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Gr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Kr=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,qr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Jr=G(qr).replace(/bull/g,Kr).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(),Yr=G(qr).replace(/bull/g,Kr).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(),Xr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Zr=/^[^\n]+/,Qr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,$r=G(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Qr).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ei=G(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Kr).getRegex(),ti=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,ni=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,ri=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`,ni).replace(`tag`,ti).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ii=G(Xr).replace(`hr`,Wr).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,ti).getRegex(),ai={blockquote:G(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,ii).getRegex(),code:Hr,def:$r,fences:Ur,heading:Gr,hr:Wr,html:ri,lheading:Jr,list:ei,newline:Vr,paragraph:ii,table:Rr,text:Zr},oi=G(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Wr).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,ti).getRegex(),si={...ai,lheading:Yr,table:oi,paragraph:G(Xr).replace(`hr`,Wr).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,oi).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,ti).getRegex()},ci={...ai,html:G(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,ni).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:Rr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:G(Xr).replace(`hr`,Wr).replace(`heading`,` *#{1,6} *[^
|
|
26
|
-
]`).replace(`lheading`,Jr).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},li=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ui=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,di=/^( {2,}|\\)\n(?!\s*$)/,fi=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,pi=/[\p{P}\p{S}]/u,mi=/[\s\p{P}\p{S}]/u,hi=/[^\s\p{P}\p{S}]/u,gi=G(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,mi).getRegex(),_i=/(?!~)[\p{P}\p{S}]/u,vi=/(?!~)[\s\p{P}\p{S}]/u,yi=/(?:[^\s\p{P}\p{S}]|~)/u,bi=/(?![*_])[\p{P}\p{S}]/u,xi=/(?![*_])[\s\p{P}\p{S}]/u,Si=/(?:[^\s\p{P}\p{S}]|[*_])/u,Ci=G(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,zr?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),wi=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ti=G(wi,`u`).replace(/punct/g,pi).getRegex(),Ei=G(wi,`u`).replace(/punct/g,_i).getRegex(),Di=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,K=G(Di,`gu`).replace(/notPunctSpace/g,hi).replace(/punctSpace/g,mi).replace(/punct/g,pi).getRegex(),Oi=G(Di,`gu`).replace(/notPunctSpace/g,yi).replace(/punctSpace/g,vi).replace(/punct/g,_i).getRegex(),ki=G(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,hi).replace(/punctSpace/g,mi).replace(/punct/g,pi).getRegex(),Ai=G(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,bi).getRegex(),ji=G(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Si).replace(/punctSpace/g,xi).replace(/punct/g,bi).getRegex(),Mi=G(/\\(punct)/,`gu`).replace(/punct/g,pi).getRegex(),Ni=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(),Pi=G(ni).replace(`(?:-->|$)`,`-->`).getRegex(),Fi=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`,Pi).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ii=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Li=G(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,Ii).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ri=G(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Ii).replace(`ref`,Qr).getRegex(),zi=G(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Qr).getRegex(),Bi=G(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Ri).replace(`nolink`,zi).getRegex(),Vi=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Hi={_backpedal:Rr,anyPunctuation:Mi,autolink:Ni,blockSkip:Ci,br:di,code:ui,del:Rr,delLDelim:Rr,delRDelim:Rr,emStrongLDelim:Ti,emStrongRDelimAst:K,emStrongRDelimUnd:ki,escape:li,link:Li,nolink:zi,punctuation:gi,reflink:Ri,reflinkSearch:Bi,tag:Fi,text:fi,url:Rr},Ui={...Hi,link:G(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Ii).getRegex(),reflink:G(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Ii).getRegex()},Wi={...Hi,emStrongRDelimAst:Oi,emStrongLDelim:Ei,delLDelim:Ai,delRDelim:ji,url:G(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Vi).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`,Vi).getRegex()},Gi={...Wi,br:G(di).replace(`{2,}`,`*`).getRegex(),text:G(Wi.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Ki={normal:ai,gfm:si,pedantic:ci},qi={normal:Hi,gfm:Wi,breaks:Gi,pedantic:Ui},Ji={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Yi=e=>Ji[e];function Xi(e,t){if(t){if(Br.escapeTest.test(e))return e.replace(Br.escapeReplace,Yi)}else if(Br.escapeTestNoEncode.test(e))return e.replace(Br.escapeReplaceNoEncode,Yi);return e}function Zi(e){try{e=encodeURI(e).replace(Br.percentDecode,`%`)}catch{return null}return e}function Qi(e,t){let n=e.replace(Br.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Br.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(Br.slashPipe,`|`);return n}function $i(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 ea(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 ta(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 na(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 ra(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
25
|
+
`):void 0}}function st(e){return[...new Set(e.split(`,`).map(e=>e.trim()).filter(Boolean))]}function ct(e){return e===`7d`?`Last 7 Days`:e===`30d`?`Last 30 Days`:e===`90d`?`Last 90 Days`:`All Time`}function lt({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)*Ke),a=t*7,o=new Date(i.getTime()-(a-1)*Ke),s=0,c=[],l=new Map,u=-1;for(let t=0;t<a;t++){let n=new Date(o.getTime()+t*Ke),r=Ye(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 ut({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=Ye(new Date(t.getTime()-i*Ke)),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 dt({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])=>le(e)).join(` + `))},[a]),l=(0,_.useMemo)(()=>ot(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)(Me,{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:ct(i)}),l.overall?(0,V.jsx)(Me,{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)(De,{durationMs:500,value:e.sessions,formatter:it})}),(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)(De,{durationMs:500,value:e.replays,formatter:it})}),(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)(De,{durationMs:500,value:e.prompts,formatter:it})}),(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)(De,{durationMs:500,value:e.toolCalls,formatter:it})}),(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)(De,{durationMs:500,value:e.durationMs,formatter:e=>D(e)})}),(0,V.jsx)(u,{label:`coding`,title:l.duration})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl md:text-3xl font-mono font-bold text-terminal-orange tabular-nums`,children:(0,V.jsx)(De,{durationMs:500,value:e.cost,formatter:e=>rt(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)(De,{durationMs:500,value:e.edits,formatter:it})}),(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)(De,{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)(ut,{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 ft({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 pt(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:pt(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:pt(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:pt(e.percentiles.p90Ms)})]})]}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[e.totalTurns.toLocaleString(),` turns`]})]})]})}var ht=[{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 gt({breakdown:e}){let t=e.input+e.output+e.cacheRead+e.cacheCreation;if(t===0)return null;let n=ht.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:at(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:at(t)})]})]})}function _t({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 vt({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 yt({projects:e}){if(e.length===0)return(0,V.jsx)(`div`,{className:`text-terminal-dimmer text-xs font-mono py-4 text-center`,children:`No project data`});let t=Math.max(...e.map(e=>e.sessions),1);return(0,V.jsx)(`div`,{className:`space-y-2`,children:e.slice(0,8).map(e=>{let n=A(e.project),r=e.sessions/t*100;return(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-text truncate max-w-[60%]`,children:n}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dim tabular-nums`,children:[e.sessions,` session`,e.sessions===1?``:`s`,e.cost>0&&` · ${rt(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 bt({models:e}){let t=(0,_.useMemo)(()=>(()=>{let t=new Map;for(let[n,r]of Object.entries(e))for(let e of st(n)){let n=E(e);t.set(n,(t.get(n)??0)+r)}return[...t.entries()].map(([e,t])=>({model:e,count:t})).sort((e,t)=>t.count-e.count)})(),[e]),n=t.reduce((e,t)=>e+t.count,0);if(t.length===0)return(0,V.jsx)(`div`,{className:`text-terminal-dimmer text-xs font-mono py-4 text-center`,children:`No model data`});let r=[`bg-terminal-green`,`bg-terminal-blue`,`bg-terminal-orange`,`bg-terminal-purple`,`bg-terminal-red`,`bg-terminal-dim`];return(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`div`,{className:`h-3 rounded-full bg-terminal-surface-2 overflow-hidden flex`,children:t.map((e,t)=>(0,V.jsx)(`div`,{className:`h-full ${r[t%r.length]} transition-all duration-500`,style:{width:`${e.count/n*100}%`,opacity:.7}},e.model))}),(0,V.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:t.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-sm ${r[t%r.length]} shrink-0`,style:{opacity:.7}}),(0,V.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dim truncate`,children:e.model}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums ml-auto shrink-0`,children:e.count})]},e.model))})]})}function xt({providers:e}){let t=(0,_.useMemo)(()=>Object.entries(e).map(([e,t])=>({provider:e,label:le(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 ${ue(e.provider)} transition-all duration-500`,style:{width:`${t}%`,opacity:.7}})})]},e.provider)})})}function St(){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 Ct({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)(St,{})]})})}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=b(e)?.sessions||[],i=b(t)?.sessions||[];(r.length>0||i.length>0)&&n(r,i)})},[n]),e}function Tt(){let{userInsights:e,loading:t,scanStatus:n}=Ve(),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=Ze(t,i),a=Qe(n,{...e,totalReplays:r?.replays??0},i),o=$e(t),s=et(n);return{stats:a,streak:o,dayOfWeek:s,bestDay:[...s].sort((e,t)=>t.count-e.count)[0]||null,peak:nt(n),weeklyTrend:tt(t,12),activeDays:Object.values(n).filter(e=>e>0).length,firstSessionDate:e.timeRange?.first||null}},[e,i,r]),h=(0,_.useMemo)(()=>ye(e?.topProjects||[]),[e?.topProjects]);if(!e&&(t||o||n?.phase===`discovering`))return(0,V.jsx)(Ct,{scanStatus:n,hasCachedInsights:!!n?.hasCachedResults});if(!e)return(0,V.jsx)(St,{});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())/Ke):0,b=r?.sessions??e.totalSessions,x=Math.max(0,b-e.totalSessions),S=!!(n?.running&&n?.hasCachedResults),w=n?.cachedAt?C(n.cachedAt):``,T=n?.total&&n.total>0?`${Math.min(n.scanned,n.total)}/${n.total}`:void 0;return(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,V.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 md:px-6 py-6 space-y-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`h1`,{className:`text-lg font-sans font-bold text-terminal-text`,children:`Your Insights`}),(0,V.jsx)(`div`,{className:`flex items-center gap-0.5 p-0.5 rounded-lg bg-terminal-surface`,children:[`7d`,`30d`,`90d`,`all`].map(e=>(0,V.jsx)(`button`,{onClick:()=>a(e),className:`px-3 py-1.5 text-[11px] font-mono rounded-md transition-all ${i===e?`bg-terminal-green-subtle text-terminal-green font-bold`:`text-terminal-dim hover:text-terminal-text`}`,children:e===`all`?`All`:e},e))})]}),S&&(0,V.jsx)(`div`,{className:`rounded-xl border border-terminal-blue/30 bg-terminal-blue/10 px-4 py-3`,children:(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(`div`,{className:`mt-0.5 h-2 w-2 shrink-0 rounded-full bg-terminal-blue`}),(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`div`,{className:`text-xs font-sans font-semibold text-terminal-text`,children:`Showing cached insights snapshot while the background refresh runs`}),(0,V.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dim`,children:[w?`Snapshot from ${w} ago.`:`Using the latest cached scan.`,` `,T?`Refreshing ${T} sessions now.`:`Refreshing now.`]}),x>0&&(0,V.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dim`,children:[`Insights currently cover `,e.totalSessions,` scanned sessions;`,` `,x,` additional session`,x===1?``:`s`,` will appear after the refresh completes.`]})]})]})}),(0,V.jsx)(dt,{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)(lt,{sessionsPerDay:e.sessionsPerDay||{}})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:[(0,V.jsx)(ft,{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)(ft,{icon:`⚡`,label:`Avg / Active Day`,value:`${g} sessions`,sub:`${p} active day${p===1?``:`s`}`}),(0,V.jsx)(ft,{icon:`💬`,label:`Avg / Session`,value:`${v} prompts`,sub:s.sessions>0?`~${D(s.durationMs/s.sessions)} each`:void 0}),d?(0,V.jsx)(ft,{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)(ft,{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)(gt,{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)(_t,{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)(vt,{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)(yt,{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)(bt,{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)(xt,{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`,` ·`,` `,Le(s.durationMs),` total · `,it(s.toolCalls),` tool calls`]})})]})})}function Et(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(!0),[c,l]=(0,_.useState)(!0),[u,d]=(0,_.useState)(null),[,f]=(0,_.useState)(null),[,p]=(0,_.useState)(null),m=(0,_.useRef)(!1),h=(0,_.useRef)(void 0),g=(0,_.useMemo)(()=>e.some(e=>e.provider===`cursor`),[e]),v=(0,_.useCallback)(async()=>{a(!0),s(!0),l(!0),d(null);try{let[e,n]=await Promise.all([fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null),fetch(`/api/sessions/cached`).then(e=>e.ok?e.json():null).catch(()=>null)]),i=b(e),o=b(n);i?.sessions.length&&t(i.sessions),o?.sessions.length&&r(o.sessions),(i?.sessions.length||o?.sessions.length)&&a(!1);let c=x(i?.cachedAt),u=x(o?.cachedAt),p=[];c&&s(!1),u&&l(!1),c||p.push(new Promise(e=>{f(0);let n=new EventSource(`/api/sources/stream`);n.onmessage=r=>{try{let a=JSON.parse(r.data);a.type===`progress`?f(a.scanned):a.type===`complete`?(t(a.sessions),f(null),n.close(),e()):a.type===`error`&&(i?.sessions.length||d(a.message||`Failed to load sessions`),f(null),n.close(),e())}catch{}},n.onerror=()=>{n.close(),f(null),fetch(`/api/sources`).then(e=>{if(!e.ok)throw Error(`Failed to load sources`);return e.json()}).then(e=>t(e.sessions)).catch(e=>{i?.sessions.length||d(e instanceof Error?e.message:`Failed to load sessions`)}).finally(()=>e())}}).finally(()=>s(!1))),u||p.push(fetch(`/api/sessions`).then(e=>{if(!e.ok)throw Error(`Failed to load replays`);return e.json()}).then(e=>r(e)).catch(e=>{o?.sessions.length||d(e instanceof Error?e.message:`Failed to load replays`)}).finally(()=>l(!1))),p.length>0&&await Promise.allSettled(p)}catch(e){d(e instanceof Error?e.message:`Failed to load data`)}finally{a(!1)}},[]);return(0,_.useEffect)(()=>{v()},[v]),(0,_.useEffect)(()=>{if(!o&&!g&&!m.current)return;let e=!1,n,r=async()=>{let n=b(await fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null));!e&&n?.sessions.length&&n.cachedAt!==h.current&&(h.current=n.cachedAt,t(n.sessions))},i=async()=>{let t=await fetch(`/api/sources/enrichment-status`).then(e=>e.ok?e.json():null).catch(()=>null);!t||e||(p(t),t.running?(m.current=!0,await r()):m.current&&(m.current=!1,await r()))};return i(),n=window.setInterval(()=>{i()},2500),()=>{e=!0,n&&window.clearInterval(n)}},[g,o]),{sources:e,setSources:t,replays:n,loading:i,loadingSources:o,loadingReplays:c,error:u}}function Dt(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=Oe(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 Ot(){return(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,V.jsx)(`div`,{className:`h-3 w-28 skeleton rounded`}),(0,V.jsx)(`div`,{className:`h-3 w-14 skeleton rounded`})]}),(0,V.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2`,children:Array.from({length:5},(e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-3 rounded-lg bg-terminal-bg`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2.5`,children:[(0,V.jsx)(`div`,{className:`h-3.5 skeleton rounded`,style:{width:`${50+t*17%30}%`}}),(0,V.jsx)(`div`,{className:`h-3 skeleton rounded`,style:{width:`${60+t*23%25}%`}})]}),(0,V.jsx)(`div`,{className:`h-4 w-14 shrink-0 skeleton rounded`})]},t))}),(0,V.jsx)(`div`,{className:`h-8 mt-2 rounded-lg skeleton`})]})}function kt({provider:e}){return(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-medium px-1.5 py-0.5 rounded-full uppercase tracking-wider ${ce(e)}`,children:se(e)})}function At({sessions:e,isLoading:t,onViewAll:n,onGenerate:r,onViewReplay:i,onSessionClick:a,generatingSlug:o,generateErrorSlug:s}){return e.length===0?(0,V.jsx)(`div`,{className:`text-center py-6 text-terminal-dimmer text-xs font-mono`,children:t?`Loading sessions...`:`No sessions found. Start a coding session with Claude Code or Cursor.`}):(0,V.jsxs)(`div`,{className:`space-y-1 flex-1 flex flex-col`,children:[e.map(e=>{let t=!!e.existingReplay,n=o===e.slug,c=s===e.slug;return(0,V.jsxs)(`div`,{onClick:()=>a(e),className:`flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-terminal-surface-hover transition-colors duration-200 cursor-pointer`,children:[(0,V.jsx)(kt,{provider:e.provider}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`p`,{className:`text-sm font-sans text-terminal-text truncate`,children:te(e)}),(0,V.jsx)(`p`,{className:`text-[11px] font-mono text-terminal-dimmer truncate`,children:A(e.project)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,V.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer tabular-nums`,children:k(e.timestamp)}),t?(0,V.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),i(e.existingReplay)},className:`h-7 px-3 text-xs font-sans font-semibold rounded-md bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis transition-all duration-200 flex items-center gap-1`,children:[(0,V.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,V.jsx)(`polygon`,{points:`4 2 14 8 4 14`})}),`View`]}):(0,V.jsx)(`button`,{onClick:t=>{t.stopPropagation(),r(e)},disabled:n,className:`h-7 px-3 text-xs font-sans font-semibold rounded-md transition-all duration-200 disabled:opacity-50 flex items-center gap-1 ${c?`bg-terminal-red-subtle text-terminal-red`:`bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis`}`,children:n?(0,V.jsx)(`span`,{className:`animate-pulse`,children:`...`}):c?`Failed`:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,V.jsx)(`path`,{d:`M8 2v12M2 8h12`})}),`Generate`]})})]})]},`${e.provider}-${e.slug}`)}),(0,V.jsx)(`button`,{onClick:n,className:`w-full py-2 mt-auto text-xs font-sans font-semibold rounded-lg bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200`,children:`View all sessions →`})]})}function jt({replays:e,isLoading:t,onViewAll:n,onOpen:r}){return e.length===0?(0,V.jsx)(`div`,{className:`text-center py-6 text-terminal-dimmer text-xs font-mono`,children:t?`Loading replays...`:`No replays yet. Generate one from the Sessions tab.`}):(0,V.jsxs)(`div`,{className:`space-y-1 flex-1 flex flex-col`,children:[e.map(e=>(0,V.jsxs)(`button`,{onClick:()=>r(e.slug),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-terminal-surface-hover transition-colors duration-200 text-left group`,children:[(0,V.jsx)(kt,{provider:e.provider}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`p`,{className:`text-sm font-sans text-terminal-text truncate group-hover:text-terminal-green transition-colors`,children:re(e)}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-0.5`,children:[(0,V.jsxs)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer`,children:[e.stats.userPrompts,` prompts`]}),(0,V.jsx)(`span`,{className:`text-terminal-border text-[10px]`,children:`·`}),(0,V.jsxs)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer`,children:[e.stats.toolCalls,` tools`]}),e.stats.durationMs&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-terminal-border text-[10px]`,children:`·`}),(0,V.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer`,children:Le(e.stats.durationMs)})]})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[e.gist?.gistId&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple`,children:`published`}),(0,V.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dimmer tabular-nums`,children:k(e.startTime)})]})]},e.slug)),(0,V.jsx)(`button`,{onClick:n,className:`w-full py-2 mt-auto text-xs font-sans font-semibold rounded-lg bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200`,children:`View all replays →`})]})}var Mt=[{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 Nt(){let[e,t]=(0,_.useState)(()=>Mt.map(e=>({...e,installed:!1,detail:`checking...`,loading:!0})));return(0,_.useEffect)(()=>{let e=!1;for(let n of Mt)fetch(`/api/system-checks?tool=${encodeURIComponent(n.name)}`).then(e=>e.ok?e.json():null).then(r=>{if(e)return;let i=r?.checks?.find(e=>e.name===n.name)||r?.checks?.[0];if(!i){t(e=>e.map(e=>e.name===n.name?{...e,installed:!1,detail:`check failed`,loading:!1}:e));return}t(e=>e.map(e=>e.name===n.name?{...e,installed:!!i.installed,version:i.version,detail:i.detail,loading:!1}:e))}).catch(()=>{e||t(e=>e.map(e=>e.name===n.name?{...e,installed:!1,detail:`check failed`,loading:!1}:e))});return()=>{e=!0}},[]),(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-3`,children:`System`}),(0,V.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-2`,children:e.map(e=>(0,V.jsxs)(`div`,{className:`flex items-start gap-2.5 px-3 py-2.5 rounded-lg bg-terminal-bg`,children:[(0,V.jsx)(`div`,{className:`w-2 h-2 mt-1 rounded-full shrink-0 ${e.loading?`bg-terminal-blue animate-pulse`:e.installed?`bg-terminal-green`:`bg-terminal-dim opacity-40`}`}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`span`,{className:`text-xs font-sans font-medium ${e.loading?`text-terminal-dim`:e.installed?`text-terminal-text`:`text-terminal-dimmer`}`,children:e.label}),(0,V.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-dimmer truncate`,children:e.purpose}),e.loading?(0,V.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-blue truncate animate-pulse`,children:`checking...`}):e.installed?(0,V.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-green truncate`,children:e.detail||e.version||`ready`}):(0,V.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-orange truncate`,children:e.detail||`not found`})]})]},e.name))})]})}function Pt({onNavigate:e}){let{sources:t,setSources:n,replays:r,loading:i,loadingSources:a,loadingReplays:o,error:s}=Et(),c=(0,_.useMemo)(()=>Dt(t,r),[t,r]),{scanStatus:l,userInsights:u}=Ve(),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(null),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(`idle`),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)(0),E=(0,_.useRef)(null),O=(0,_.useRef)(null),k=h?t.find(e=>e.slug===h)??null:null,M=!u&&(a||!!l?.running||t.length>0),N=(0,_.useMemo)(()=>u?ye(u.topProjects):[],[u]),P=Math.max(c.projectCount,u?.totalProjects??0),ee=u?.totalPrompts??c.totalPrompts,F=u?.totalToolCalls??c.totalToolCalls,I=Object.keys(c.sessionsPerDay).length>0?c.sessionsPerDay:u?.sessionsPerDay??{},ne=e=>{L({view:null,session:e})},re=async e=>{f(e.slug),m(null);try{let t=te(e),n=await fetch(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,filePaths:e.filePaths,toolPaths:e.toolPaths,title:j(t)||void 0,sessionSlug:e.slug,sessionProject:e.project})}),r=await n.json();if(!n.ok)throw Error(r.error||`Generation failed`);L({view:null,session:r.slug})}catch(t){console.error(`Generate error:`,t),m(e.slug),setTimeout(()=>m(t=>t===e.slug?null:t),2e3)}finally{f(null)}},R=async(e,t)=>{g(null),f(e.slug),m(null);try{let n=await fetch(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,filePaths:e.filePaths,toolPaths:e.toolPaths,title:j(t)||void 0,sessionSlug:e.slug,sessionProject:e.project})}),r=await n.json();if(!n.ok)throw Error(r.error||`Generation failed`);L({view:null,session:r.slug})}catch(t){console.error(`Generate error:`,t),m(e.slug),setTimeout(()=>m(t=>t===e.slug?null:t),2e3)}finally{f(null)}},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))},ie=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{}},ae=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)}},oe=()=>{ae()},se=async()=>{y(`awaitingLogin`),x(`Waiting for sign in...`);try{let e=await fetch(`/api/auth/login`,{method:`POST`}),t=await e.json().catch(()=>null);e.ok&&t?.url&&window.open(t.url,`_blank`)}catch{}E.current&&clearInterval(E.current),O.current&&clearTimeout(O.current),E.current=setInterval(async()=>{try{(await(await fetch(`/api/auth/get-session`)).json())?.session&&(E.current&&=(clearInterval(E.current),null),O.current&&=(clearTimeout(O.current),null),window.dispatchEvent(new Event(`vibe-auth-change`)),ae())}catch{}},2e3),O.current=setTimeout(()=>{E.current&&=(clearInterval(E.current),null),y(`idle`),x(null)},180*1e3)};(0,_.useEffect)(()=>()=>{E.current&&clearInterval(E.current),O.current&&clearTimeout(O.current)},[]),(0,_.useEffect)(()=>{if(!S)return;let e=setInterval(()=>T(e=>e+1),3e4);return()=>clearInterval(e)},[S]);let ce=(()=>{if(!S)return null;let e=Date.now()-S;if(e<6e4)return`just now`;let t=Math.floor(e/6e4);return t<60?`${t}m ago`:`${Math.floor(t/60)}h ago`})();return i&&!t.length&&!r.length?(0,V.jsx)(`div`,{className:`flex-1 overflow-auto animate-in fade-in duration-500`,children:(0,V.jsxs)(`div`,{className:`max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-6`,children:[(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm space-y-4`,children:[(0,V.jsx)(`div`,{className:`grid grid-cols-4 gap-6`,children:Array.from({length:4},(e,t)=>(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`div`,{className:`h-8 w-20 skeleton rounded`}),(0,V.jsx)(`div`,{className:`h-3 w-14 skeleton rounded`})]},t))}),(0,V.jsx)(`div`,{className:`space-y-1.5 pt-2`,children:Array.from({length:3},(e,t)=>(0,V.jsx)(`div`,{className:`h-3 skeleton rounded`},t))}),(0,V.jsx)(`div`,{className:`h-9 skeleton rounded`})]}),(0,V.jsx)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-3`,children:Array.from({length:2},(e,t)=>(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm space-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`div`,{className:`h-3 w-28 skeleton rounded`}),(0,V.jsx)(`div`,{className:`h-3 w-14 skeleton rounded`})]}),Array.from({length:5},(e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-3 px-1 py-1`,children:[(0,V.jsx)(`div`,{className:`h-5 w-14 skeleton rounded-full shrink-0`}),(0,V.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,V.jsx)(`div`,{className:`h-3.5 skeleton rounded`,style:{width:`${55+t*19%35}%`}}),(0,V.jsx)(`div`,{className:`h-2.5 w-20 skeleton rounded`})]}),(0,V.jsx)(`div`,{className:`h-3 w-12 skeleton rounded shrink-0`})]},t)),(0,V.jsx)(`div`,{className:`h-8 skeleton rounded`})]},t))})]})}):s&&t.length===0&&r.length===0?(0,V.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,V.jsx)(`div`,{className:`text-center space-y-2`,children:(0,V.jsx)(`div`,{className:`text-terminal-red font-mono text-sm`,children:s})})}):(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,V.jsxs)(`div`,{className:`max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-6`,children:[(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-5 shadow-layer-sm`,children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-4 gap-x-6 gap-y-1 mb-4`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,V.jsx)(De,{value:c.totalSessions})}),(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5`,children:`sessions`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl font-mono font-bold text-terminal-blue tabular-nums`,children:(0,V.jsx)(De,{value:c.totalReplays})}),(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5`,children:`replays`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl font-mono font-bold text-terminal-green tabular-nums`,children:(0,V.jsx)(De,{value:ee})}),(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5`,children:`turns`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-2xl font-mono font-bold text-terminal-orange tabular-nums`,children:(0,V.jsx)(De,{value:F})}),(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5`,children:`tool calls`})]})]}),(0,V.jsx)(lt,{sessionsPerDay:I,weeks:52}),(0,V.jsxs)(`div`,{className:`flex gap-2 mt-3`,children:[(0,V.jsx)(`button`,{onClick:()=>e(`insights`),className:`flex-1 py-2.5 text-xs font-sans font-semibold rounded-lg bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis transition-all duration-200`,children:`View personal insights →`}),(0,V.jsx)(`button`,{onClick:oe,disabled:v===`syncing`||v===`awaitingLogin`,className:`py-2.5 px-4 text-xs font-sans font-semibold rounded-lg border transition-all duration-200 disabled:opacity-50 disabled:cursor-wait shrink-0 ${v===`done`?`bg-terminal-green/8 text-terminal-green border-terminal-green/20`:v===`error`?`bg-red-400/8 text-red-400 border-red-400/20`:`bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover border-terminal-border`}`,title:b||void 0,children:v===`syncing`?`Syncing...`:v===`done`&&ce?`\u2713 Synced ${ce}`:v===`error`?`Sync failed`:v===`awaitingLogin`?`Waiting...`:`↑ Sync to cloud`}),(0,V.jsx)(`a`,{href:`https://vibe-replay.com/insights/`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center justify-center w-9 h-9 rounded-lg text-terminal-dim hover:text-terminal-green hover:bg-terminal-surface-hover transition-colors shrink-0`,title:`View insights on vibe-replay.com`,children:(0,V.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,strokeWidth:2,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25`})})})]})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-3 items-stretch`,children:[(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:`Recent Sessions`}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:[c.totalSessions,` total`]})]}),(0,V.jsx)(`div`,{className:`flex-1 flex flex-col justify-between`,children:(0,V.jsx)(At,{sessions:c.recentSources,isLoading:a,onViewAll:()=>e(`sessions`),onGenerate:re,onViewReplay:ne,onSessionClick:e=>g(e.slug),generatingSlug:d,generateErrorSlug:p})})]}),(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:`Recent Replays`}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:[c.totalReplays,` total`]})]}),(0,V.jsx)(`div`,{className:`flex-1 flex flex-col justify-between`,children:(0,V.jsx)(jt,{replays:c.recentReplays,isLoading:o,onViewAll:()=>e(`replays`),onOpen:ne})})]})]}),M?(0,V.jsx)(Ot,{}):u&&N.length>1?(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl p-4 shadow-layer-sm`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,V.jsx)(`h3`,{className:`text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider`,children:`Recent Projects`}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:[P,` total`]})]}),(0,V.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2`,children:[...N].sort((e,t)=>(t.lastActivity||``).localeCompare(e.lastActivity||``)).slice(0,5).map(t=>(0,V.jsxs)(`button`,{onClick:()=>{e(`sessions`),setTimeout(()=>{L({tab:`sessions`,project:t.project})},50)},className:`flex items-center justify-between gap-2 px-3 py-2.5 rounded-lg bg-terminal-bg hover:bg-terminal-surface-hover transition-colors text-left group`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-text truncate block group-hover:text-terminal-green transition-colors`,children:A(t.project)}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[t.sessions,` session`,t.sessions>1?`s`:``,` · `,t.prompts,` prompts`,t.durationMs>0&&` · ${D(t.durationMs)}`]})]}),t.cost>0&&(0,V.jsxs)(`span`,{className:`text-xs font-mono text-terminal-orange tabular-nums shrink-0`,children:[`$`,t.cost.toFixed(2)]})]},t.project))}),N.length>5&&(0,V.jsx)(`button`,{onClick:()=>e(`projects`),className:`w-full py-2 mt-2 text-xs font-sans font-semibold rounded-lg bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200`,children:`View all projects →`})]}):null,(0,V.jsx)(Nt,{})]}),k&&(0,V.jsx)(Wn,{session:k,onClose:()=>g(null),onGenerate:R,onViewReplay:e=>L({view:null,session:e}),onArchive:e=>{fetch(`/api/archive/${e}`,{method:`POST`}).catch(()=>{}),g(null)},onTitleSave:z,onDeleteReplay:ie,isGenerating:d===k.slug,isArchived:!1}),(v===`needsLogin`||v===`awaitingLogin`)&&(0,V.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:e=>{e.target===e.currentTarget&&v===`needsLogin`&&y(`idle`)},children:(0,V.jsxs)(`div`,{className:`relative bg-terminal-surface border border-terminal-border rounded-2xl shadow-2xl max-w-md w-full mx-4 p-6`,children:[v===`needsLogin`&&(0,V.jsx)(`button`,{onClick:()=>y(`idle`),className:`absolute top-3 right-3 w-7 h-7 flex items-center justify-center rounded-md text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors cursor-pointer`,children:`×`}),v===`needsLogin`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h3`,{className:`text-base font-bold text-terminal-text mb-1`,children:`Sync Insights to the Cloud`}),(0,V.jsx)(`p`,{className:`text-xs text-terminal-dim mb-5`,children:`Sign in with GitHub to unlock your online dashboard.`}),(0,V.jsxs)(`div`,{className:`space-y-3 mb-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(`span`,{className:`shrink-0 w-7 h-7 rounded-full bg-terminal-green/10 flex items-center justify-center text-xs font-bold font-mono text-terminal-green`,children:`1`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-sm font-semibold text-terminal-text`,children:`Cross-machine dashboard`}),(0,V.jsx)(`p`,{className:`text-[11px] text-terminal-dim mt-0.5`,children:`See all your sessions, costs, and streaks in one place — from any browser.`})]})]}),(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(`span`,{className:`shrink-0 w-7 h-7 rounded-full bg-terminal-orange/10 flex items-center justify-center text-xs font-bold font-mono text-terminal-orange`,children:`2`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-sm font-semibold text-terminal-text`,children:`Cost tracking & trends`}),(0,V.jsx)(`p`,{className:`text-[11px] text-terminal-dim mt-0.5`,children:`Track spending by model, spot weekly patterns, and monitor project breakdowns.`})]})]}),(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(`span`,{className:`shrink-0 w-7 h-7 rounded-full bg-terminal-blue/10 flex items-center justify-center text-xs font-bold font-mono text-terminal-blue`,children:`3`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-sm font-semibold text-terminal-text`,children:`Share your coding card`}),(0,V.jsx)(`p`,{className:`text-[11px] text-terminal-dim mt-0.5`,children:`Activity heatmaps, streak badges, and project stats — shareable at a glance.`})]})]})]}),(0,V.jsxs)(`button`,{onClick:se,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 Ft=null,It=null,Lt=0,Rt=4e3;function zt(){let[e,t]=(0,_.useState)(Ft??[]),[n,r]=(0,_.useState)(Ft===null&&It===null),[i,a]=(0,_.useState)(Ft===null?It: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}`);Ft=(await n.json()).results??[],Lt=Ft.length,It=null,e||(t(Ft),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;(Ft===null||n!==Lt)&&await i()}catch(t){let n=t instanceof Error?t.message:`Failed to load`;It=n,!e&&Ft===null&&a(n)}finally{e||r(!1),!e&&t&&(n=setTimeout(s,Rt))}}return s(),()=>{e=!0,n&&clearTimeout(n)}},[]),{sessions:e,loading:n,error:i}}function Bt(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=Vt(e)?-10:0,l=t+n+r+i+a+o+s+c;return Math.max(0,Math.min(100,l*4))}function Vt(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 Ht(e){return e?new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`}):``}function Ut(e){return e?new Date(e).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!1}):``}function Wt(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 Gt(e){return j(F(e.title||``))||j(F(e.firstPrompt||``))||e.slug}function Kt(e){return e.durationMs==null?!0:(e.dataQualityNotes||[]).some(e=>/duration is inferred|duration.*estimated|missing duration/i.test(e))}function qt(e){let t=[se(e.provider)],n=e.dataSource?he(!1,e.dataSource):``;return n&&t.push(n),Kt(e)&&t.push(`estimated time`),t}function Jt(e){window.dispatchEvent(new CustomEvent(`vibe-open-session`,{detail:{slug:e}}))}function Yt(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 Xt=[{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 Zt(e){return Xt[e%Xt.length]}function Qt(e,t={}){let n=new Map;for(let r of e){let e=t.collapseWorktrees?ve(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=_n(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 $t=4,en=5,tn=10,nn=72,rn=40,an=14,on=12,sn=6,cn=8,ln=140,un=1100;function dn(e){return e>=60?.24:.16}function fn(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 pn(e){return e>=60?.95:.78}function mn(e){return cn+Math.sqrt(Math.max(0,Math.min(100,e))/100)*(ln-cn)}function hn(e){return tn+Math.max(0,Math.min(100,e))/100*(nn-tn)}function gn(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:en;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 _n(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 vn(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=_n(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/un,f=new Map,p=0;for(let e of a){if(e.endMs<c||e.startMs>l)continue;if(!r&&Vt(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=Bt(e),i=mn(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}=gn(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=mn(e.score),d=o/100*un,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:hn(e.score),fillAlpha:dn(e.score),opacity:pn(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},()=>tn);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+$t;let i=r+4,c=Math.max(i,rn),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 yn=[{value:`1d`,label:`1D`,days:1},{value:`7d`,label:`7D`,days:7},{value:`30d`,label:`30D`,days:30},{value:`all`,label:`All`}];function bn(e){let t=yn.find(t=>t.value===e);if(!t||t.days==null)return{};let n=Date.now();return{start:n-t.days*864e5,end:n}}function xn({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)(()=>bn(t),[t]),{projects:f,ticks:p,totalSessions:m,hiddenAutomatedCount:h}=(0,_.useMemo)(()=>vn(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)Kt(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:yn.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 `,Yt(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=Zt(e.colorIdx),n=e.totalRowHeightPx,r=t.solid;return(0,V.jsxs)(`div`,{className:`flex items-stretch rounded-xl group`,children:[(0,V.jsxs)(`div`,{className:`flex flex-col justify-center shrink-0 py-1 pr-3 overflow-hidden`,style:{width:140,height:n},children:[(0,V.jsx)(`div`,{className:`text-xs font-sans font-medium truncate ${t.text}`,children:A(e.project)}),(0,V.jsxs)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer truncate`,children:[e.sessions.length,` `,H(e.sessions.length,`session`),e.hiddenInLanesCount>0&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>l(e.project),className:`ml-1 text-terminal-orange hover:underline cursor-pointer`,title:`Show the ${e.hiddenInLanesCount} session(s) hidden by the lane cap`,children:[`· +`,e.hiddenInLanesCount,` hidden ▸`]}),s.has(e.project)&&(0,V.jsx)(`button`,{type:`button`,onClick:()=>l(e.project),className:`ml-1 text-terminal-purple hover:underline cursor-pointer`,title:`Restore the lane cap`,children:`· collapse`})]})]}),(0,V.jsxs)(`div`,{className:`relative flex-1 overflow-hidden rounded-xl bg-terminal-surface/45 shadow-layer-sm transition-colors group-hover:bg-terminal-surface-hover/70`,style:{height:n},children:[p.map((e,t)=>(0,V.jsx)(`div`,{className:`absolute top-0 bottom-0 w-px bg-terminal-border/[0.06]`,style:{left:`${e.leftPct}%`}},t)),e.sessions.map(n=>{let i=Vt(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-sn)/on)),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:fn(r,n.fillAlpha)},"aria-label":`Open ${Gt(n.session)}`,onClick:()=>Jt(n.session.slug),onMouseEnter:e=>{o({session:n.session,x:e.clientX,y:e.clientY})},onMouseLeave:()=>o(null),children:[n.heightPx>=an&&(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:Gt(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:Gt(a.session)}),(0,V.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-1`,children:qt(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=_n(e,a.session),n=a.session.startTime,r=new Date(t).toISOString(),i=Ht(n)===Ht(r);return(0,V.jsxs)(`div`,{children:[Ht(n),` `,Ut(n),t!==e&&(0,V.jsxs)(`span`,{children:[` → `,i?``:`${Ht(r)} `,Ut(r)]})]})})(),a.session.durationMs&&(0,V.jsx)(`div`,{className:`text-terminal-blue`,children:Wt(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 Sn(e,t){let n=t.replace(/\/$/,``);return n&&e.startsWith(`${n}/`)?e.slice(n.length+1):e.split(`/`).slice(-3).join(`/`)}function Cn(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:Sn(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 wn({groups:e,hideProjectList:t}){let n=(0,_.useMemo)(()=>Cn(e),[e]),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(null);if((0,_.useEffect)(()=>{if(n.length===0){i(null),o(null);return}(!r||!n.some(e=>e.project===r))&&(i(n[0].project),o(null))},[n,r]),n.length===0)return(0,V.jsxs)(`div`,{className:`p-8 text-center space-y-2`,children:[(0,V.jsx)(`div`,{className:`text-terminal-dimmer text-sm font-mono`,children:`No hot files found.`}),(0,V.jsx)(`div`,{className:`text-terminal-dimmer/60 text-xs font-mono`,children:`Cursor sessions without file edits are still shown in List and Timeline.`})]});let s=n.find(e=>e.project===r)??n[0],c=a?s.files.find(e=>e.file===a):null;return(0,V.jsxs)(`div`,{className:`flex h-full min-w-0 flex-col gap-4 p-4 lg:flex-row`,children:[!t&&(0,V.jsxs)(`div`,{className:`w-full shrink-0 space-y-2 overflow-y-auto lg:w-64`,children:[(0,V.jsxs)(`div`,{className:`px-1`,children:[(0,V.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text`,children:`Hot Files`}),(0,V.jsxs)(`div`,{className:`mt-0.5 text-[10px] font-mono text-terminal-dimmer`,children:[n.length,` `,H(n.length,`project`),` with hot files`]})]}),n.map(e=>(0,V.jsxs)(`button`,{onClick:()=>{i(e.project),o(null)},className:`w-full rounded-lg border px-3 py-2.5 text-left transition-all duration-200 ease-material ${s.project===e.project?`border-transparent bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`border-transparent bg-terminal-bg/35 text-terminal-text shadow-layer-sm hover:bg-terminal-surface-hover hover:shadow-layer-md`}`,children:[(0,V.jsx)(`div`,{className:`truncate text-xs font-sans font-semibold`,children:A(e.project)}),(0,V.jsx)(`div`,{className:`mt-0.5 truncate text-[10px] font-mono text-terminal-dimmer`,children:e.project}),(0,V.jsxs)(`div`,{className:`mt-1 text-[10px] font-mono text-terminal-dimmer`,children:[e.files.length,` `,H(e.files.length,`file`),` ·`,` `,e.totalEdits.toLocaleString(),` `,H(e.totalEdits,`edit`)]})]},e.project))]}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-4`,children:[(0,V.jsxs)(`div`,{className:`relative overflow-hidden rounded-2xl bg-terminal-bg/35 p-4 shadow-inner`,children:[(0,V.jsx)(`div`,{className:`pointer-events-none absolute -right-12 -top-12 h-28 w-28 rounded-full bg-terminal-green/5 blur-2xl`}),(0,V.jsxs)(`div`,{className:`relative`,children:[(0,V.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text`,children:A(s.project)}),(0,V.jsx)(`div`,{className:`mt-0.5 truncate text-xs font-mono text-terminal-dimmer`,children:s.project}),(0,V.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-[10px] font-mono text-terminal-dimmer`,children:[(0,V.jsxs)(`span`,{className:`rounded-md bg-terminal-green-subtle px-1.5 py-0.5 text-terminal-green`,children:[s.files.length,` `,H(s.files.length,`hot file`)]}),(0,V.jsxs)(`span`,{children:[s.totalEdits.toLocaleString(),` `,H(s.totalEdits,`edit`)]}),(0,V.jsxs)(`span`,{children:[s.totalSessions.toLocaleString(),` `,H(s.totalSessions,`session`)]})]})]})]}),(0,V.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[minmax(0,1fr)_22rem]`,children:[(0,V.jsx)(`div`,{className:`min-w-0 grid grid-cols-1 gap-2 xl:grid-cols-2 self-start`,children:s.files.map(e=>{let t=a===e.file;return(0,V.jsxs)(`button`,{onClick:()=>o(t?null:e.file),className:`w-full rounded-xl px-3 py-2.5 text-left transition-all duration-200 ease-material ${t?`bg-terminal-green-subtle text-terminal-green shadow-layer-md`:`bg-terminal-bg/40 text-terminal-text shadow-layer-sm hover:bg-terminal-surface-hover hover:shadow-layer-md`}`,children:[(0,V.jsx)(`div`,{className:`truncate text-xs font-mono`,children:e.displayName.split(`/`).pop()}),(0,V.jsx)(`div`,{className:`mt-0.5 truncate text-[10px] font-mono text-terminal-dimmer`,children:e.displayName}),(0,V.jsxs)(`div`,{className:`mt-1 text-[10px] font-mono text-terminal-dimmer`,children:[e.totalEdits.toLocaleString(),` `,H(e.totalEdits,`edit`),` ·`,` `,e.sessions.length,` `,H(e.sessions.length,`session`)]})]},e.file)})}),(0,V.jsx)(`div`,{className:`lg:sticky lg:top-3 lg:self-start lg:max-h-[calc(100vh-7rem)] lg:overflow-y-auto`,children:c?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`rounded-2xl bg-terminal-surface p-4 shadow-layer-sm`,children:[(0,V.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text truncate`,children:c.displayName.split(`/`).pop()}),(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-dimmer mt-0.5 break-all`,children:c.file}),(0,V.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dimmer mt-1`,children:[c.totalEdits.toLocaleString(),` `,H(c.totalEdits,`edit`),` `,`across `,c.sessions.length,` `,H(c.sessions.length,`session`)]})]}),(0,V.jsx)(`div`,{className:`space-y-2`,children:c.sessions.map(e=>(0,V.jsxs)(`button`,{type:`button`,onClick:()=>Jt(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:Zt(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:Gt(e.session)}),(0,V.jsxs)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-0.5`,children:[A(e.session.project),` · `,Ht(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 Tn({view:e,projectFilter:t}){let{sessions:n,loading:r,error:i}=zt(),a=(0,_.useMemo)(()=>t?n.filter(e=>ve(e.project)===t):n,[n,t]),o=(0,_.useMemo)(()=>Qt(a,{collapseWorktrees:!0}),[a]),s=(0,_.useMemo)(()=>{let e=new Map;for(let t of a){let n=se(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=>Kt(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:Wt(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)(xn,{groups:o}),e===`files`&&(0,V.jsx)(wn,{groups:o,hideProjectList:!!t})]})]})}var En=[{id:`overview`,label:`Overview`},{id:`timeline`,label:`Timeline`},{id:`files`,label:`Hot Files`}];function Dn({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[Oe(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 On({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(xe),className:`w-full text-left px-3 py-2.5 text-xs font-sans rounded-lg transition-all duration-200 ease-material flex items-center justify-between ${t===`__all__`?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface`}`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:`All projects`}),(0,V.jsx)(`span`,{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${t===`__all__`?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer`}`,children:r})]}),(0,V.jsx)(`div`,{className:`h-px bg-terminal-border-subtle mx-2 my-1.5`}),e.map(e=>{let r=t===e.project,i=A(e.project);return(0,V.jsxs)(`button`,{onClick:()=>n(e.project),title:e.project,className:`w-full text-left px-3 py-2.5 rounded-lg transition-all duration-200 ease-material group ${r?`bg-terminal-green-subtle shadow-layer-sm`:`hover:bg-terminal-surface`}`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-1.5`,children:[(0,V.jsx)(`span`,{className:`text-xs font-sans truncate ${r?`text-terminal-green font-medium`:`text-terminal-text`}`,children:i}),(0,V.jsx)(`span`,{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs shrink-0 ${r?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer`}`,children:e.sessions})]}),e.lastActivity&&(0,V.jsx)(`div`,{className:`mt-1 ml-0.5 text-xs font-mono truncate ${r?`text-terminal-dim`:`text-terminal-dimmer`}`,children:Ne(e.lastActivity,`long`)})]},e.project)})]})]})}function kn({project:e,insight:t,onOpenSessions:n}){let r=A(e);return(0,V.jsxs)(`div`,{className:`hover-lift relative overflow-hidden rounded-2xl bg-gradient-to-br from-terminal-surface via-terminal-surface to-terminal-bg/70 p-5 shadow-layer-md`,children:[(0,V.jsx)(`span`,{className:`absolute inset-y-3 left-0 w-0.5 rounded-r-full bg-gradient-to-b from-terminal-green to-terminal-blue opacity-60`}),(0,V.jsx)(`span`,{className:`pointer-events-none absolute -right-10 -top-12 h-32 w-32 rounded-full bg-terminal-green/5 blur-2xl`}),(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-base font-sans font-semibold text-terminal-text truncate`,children:r}),(0,V.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dimmer truncate mt-0.5`,children:e})]}),t.lastActivity&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer shrink-0`,children:Ne(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)(An,{label:H(t.sessions,`session`),value:t.sessions.toString(),tone:`text`}),t.durationMs>0&&(0,V.jsx)(An,{label:`active time`,value:Le(t.durationMs),tone:`blue`}),t.cost>0&&(0,V.jsx)(An,{label:`cost`,value:`$${t.cost.toFixed(2)}`,tone:`orange`}),(0,V.jsx)(An,{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)(Dn,{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 An({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 jn({projects:e,onProjectClick:t}){return(0,V.jsx)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-3`,children:e.map(e=>{let n=A(e.project);return(0,V.jsxs)(`button`,{onClick:()=>t(e.project),className:`hover-lift group relative overflow-hidden rounded-xl bg-gradient-to-br from-terminal-surface via-terminal-surface to-terminal-bg/70 p-4 text-left shadow-layer-sm transition-all duration-200 ease-material hover:bg-terminal-surface-hover`,children:[(0,V.jsx)(`span`,{className:`absolute inset-y-3 left-0 w-0.5 rounded-r-full bg-gradient-to-b from-terminal-green to-terminal-blue opacity-50 transition-opacity group-hover:opacity-100`}),(0,V.jsx)(`span`,{className:`pointer-events-none absolute -right-10 -top-12 h-28 w-28 rounded-full bg-terminal-green/5 blur-2xl opacity-0 transition-opacity group-hover:opacity-100`}),(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-2 mb-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-sm font-sans font-medium text-terminal-text truncate group-hover:text-terminal-green transition-colors`,children:n}),(0,V.jsx)(`div`,{className:`text-[10px] font-mono text-terminal-dimmer truncate mt-0.5`,children:e.project})]}),e.lastActivity&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer shrink-0`,children:Ne(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:Le(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)(Dn,{sessionsPerDay:e.sessionsPerDay})]},e.project)})})}function Mn({onNavigate:e}){let{userInsights:t,scanStatus:n}=Ve(),[r,i]=(0,_.useState)(xe),[a,o]=(0,_.useState)(`overview`),s=(0,_.useMemo)(()=>{if(!t)return[];let e=ye(t.topProjects);return e.sort((e,t)=>(t.lastActivity||``).localeCompare(e.lastActivity||``)),e},[t]),c=r===`__all__`?null:s.find(e=>e.project===r)??null,l=n?.running&&n.total>0;if(!t&&!l)return(0,V.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,V.jsxs)(`div`,{className:`text-center space-y-2 text-terminal-dimmer text-sm font-mono`,children:[(0,V.jsx)(`p`,{children:`No scan data available yet.`}),(0,V.jsx)(`p`,{className:`text-xs`,children:`Projects will appear once the background scan completes.`})]})});if(!t&&l)return(0,V.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-terminal-dim text-sm font-mono`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse`}),`Analyzing sessions... `,n.scanned,`/`,n.total]})});let u=t=>{e(`sessions`),setTimeout(()=>L({tab:`sessions`,project:t}),50)},d=s.map(e=>({project:e.project,sessions:e.sessions,lastActivity:e.lastActivity})),f=r!==xe,p=f?En.filter(e=>e.id!==`timeline`):En,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)(On,{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:xe,children:[`All projects (`,s.length,`)`]}),s.map(e=>(0,V.jsxs)(`option`,{value:e.project,children:[A(e.project),` (`,e.sessions,`)`]},e.project))]})}),(0,V.jsxs)(`div`,{className:`px-4 md:px-6 pt-5 pb-3 flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`h2`,{className:`text-sm font-sans font-semibold text-terminal-text truncate`,children:[r===`__all__`?`All Projects`:A(r),r===`__all__`&&(0,V.jsxs)(`span`,{className:`ml-2 text-terminal-dimmer font-normal`,children:[`(`,s.length,`)`]})]}),l&&(0,V.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5 text-[10px] font-mono text-terminal-dim`,children:[(0,V.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-terminal-purple animate-pulse`}),`Analyzing... `,n.scanned,`/`,n.total]})]}),(0,V.jsx)(`div`,{className:`inline-flex w-fit items-center rounded-xl bg-terminal-surface/80 p-0.5 shadow-layer-sm backdrop-blur-sm`,children:p.map(e=>(0,V.jsx)(`button`,{onClick:()=>o(e.id),className:`rounded-lg px-3.5 py-1.5 text-xs font-sans font-semibold transition-all duration-200 ease-material ${m===e.id?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text`}`,children:e.label},e.id))})]}),(0,V.jsxs)(`div`,{className:`px-4 md:px-6 pb-6 space-y-4`,children:[m===`overview`&&r===`__all__`&&(0,V.jsx)(jn,{projects:s,onProjectClick:i}),m===`overview`&&c&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(kn,{project:r,insight:c,onOpenSessions:()=>u(r)}),(0,V.jsx)(Tn,{view:`timeline`,projectFilter:h})]}),m===`timeline`&&(0,V.jsx)(Tn,{view:`timeline`,projectFilter:h}),m===`files`&&(0,V.jsx)(Tn,{view:`files`,projectFilter:h})]})]})]})}var Nn=()=>(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 Pn({provider:e}){return(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-medium px-1.5 py-0.5 rounded-full uppercase tracking-wider ${ce(e)}`,children:se(e)})}function Fn({slug:e,title:t,fallbackTitle:n,onSave:r}){let i=j(t||n||e),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(i),[l,u]=(0,_.useState)(!1),d=(0,_.useRef)(null);(0,_.useEffect)(()=>{c(i)},[i]),(0,_.useEffect)(()=>{a&&d.current?.focus()},[a]);let f=async()=>{if(!l){u(!0);try{await r(e,j(s))}finally{u(!1),o(!1)}}};return a?(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),f()},className:`flex items-center gap-1.5 min-w-0`,children:(0,V.jsx)(`input`,{ref:d,value:s,onChange:e=>c(e.target.value),onBlur:f,onKeyDown:e=>{e.key===`Escape`&&(c(i),o(!1))},className:`bg-terminal-surface-2 rounded px-2 py-0.5 text-sm font-sans text-terminal-text w-full outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-green/50 transition-shadow duration-200`,placeholder:i,maxLength:120,disabled:l})}),(0,V.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer truncate mt-0.5`,children:[`slug: `,(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:e})]})]}):(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsxs)(`button`,{onClick:()=>o(!0),className:`group flex items-center gap-1 min-w-0 max-w-full text-left`,title:`Click to edit title`,children:[(0,V.jsx)(`span`,{className:`text-sm font-sans font-medium text-terminal-text truncate`,children:i||e}),(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,className:`shrink-0 text-terminal-dim opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,V.jsx)(`path`,{d:`M11.5 1.5l3 3-9 9H2.5v-3l9-9z`})})]}),(0,V.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer truncate mt-0.5`,children:[`slug: `,(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:e})]})]})}function In({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)(Nn,{})}),n&&(0,V.jsx)(`div`,{className:`absolute right-0 top-full mt-1 z-50 min-w-[140px] rounded-lg bg-terminal-surface-2 border border-terminal-border shadow-layer-md py-1`,children:(0,V.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),e(),r(!1)},className:`w-full flex items-center gap-2 px-3 py-1.5 text-xs font-sans text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors`,children:[(0,V.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,V.jsx)(`path`,{d:`M2 4h12v2H2zM3 6v7h10V6M6.5 8h3`})}),t?`Unarchive`:`Archive`]})})]})}var Ln=null,Rn=null;function zn(){return Ln?Promise.resolve(Ln):Rn||(Rn=fetch(`/api/scan/results`).then(e=>e.ok?e.json():null).then(e=>{let t=e?.results??null;return Ln=t,setTimeout(()=>{Ln=null,Rn=null},3e4),t}).catch(()=>null),Rn)}function Bn(e,t,n){let r=[],i=new Set,a=[t?.firstPrompt,...e.prompts||[]];t?.firstPrompt||a.push(e.firstPrompt);for(let e of a){let t=F(e||``);!t||i.has(t)||(i.add(t),r.push(t))}let o=F(n||``);return r.length>1&&o&&r[0]===o&&r.shift(),r.length>1&&/^(?:and|but|or|so|then)\b/i.test(r[0]||``)&&r.shift(),r}function Vn(e){return e&&e!==`main`&&e!==`master`?e:void 0}function Hn(e){return e.replace(/^space[_-]?/,``).slice(0,6)||e.slice(0,6)}function Un(e,t,n){return n?`bg-terminal-purple-subtle text-terminal-purple`:e===`jsonl`?`bg-terminal-orange-subtle text-terminal-orange`:e===`global-state`?`bg-terminal-blue-subtle text-terminal-blue`:e===`sqlite`||t?`bg-terminal-green-subtle text-terminal-green`:`bg-terminal-surface-2 text-terminal-dimmer`}function Wn({session:e,scanData:t=null,onClose:n,onGenerate:r,onViewReplay:i,onArchive:a,onTitleSave:o,onDeleteReplay:s,isGenerating:c,isArchived:l}){let[u,d]=(0,_.useState)(t),f=te(e),p=ne(e,u),[m,h]=(0,_.useState)(e.replay?.title||p),[g,v]=(0,_.useState)(!1),y=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n]),(0,_.useEffect)(()=>{let e=y.current;e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length))},[]),(0,_.useEffect)(()=>{d(t)},[t]),(0,_.useEffect)(()=>{if(t)return;let n=!1;return zn().then(t=>{if(n||!t)return;let r=t.find(t=>t.slug===e.slug);r&&d(r)}),()=>{n=!0}},[t,e.slug]),(0,_.useEffect)(()=>{h(t=>{let n=j(t),r=j(p),i=j(e.replay?.title);return!n||n===i||n===e.slug||r&&n===j(f)?e.replay?.title||p:t})},[f,p,e.replay?.title,e.slug]);let b=Vn(u?.gitBranch||e.gitBranch),x=u?.model||e.model,S=Bn(e,u,p),C=u?.dataQualityNotes||[],D=u?.promptCount??e.promptCount,M=u?.toolCallCount??e.toolCallCount,N=u?.editCount??e.editCountEst,P=u?.durationMs??e.durationMsEst,ee=u?.costEstimate??e.replay?.stats?.costEstimate,F=u?.tokenUsage?u.tokenUsage.inputTokens+u.tokenUsage.outputTokens:void 0,I=u?.startTime||e.timestamp,re=async()=>{if(!e.replay||g)return;let t=j(m);if(t!==j(e.replay.title||p)){v(!0);try{await o(e.slug,t)}finally{v(!1)}}},L=()=>{r(e,m)};return(0,V.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,children:[(0,V.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-md animate-in fade-in duration-300`,onClick:n}),(0,V.jsxs)(`div`,{className:`relative max-w-4xl w-full bg-terminal-bg border border-terminal-border-subtle rounded-2xl shadow-layer-xl animate-in zoom-in-95 fade-in duration-200 flex flex-col max-h-[88vh]`,onClick:e=>e.stopPropagation(),children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between px-7 pt-5 pb-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(Pn,{provider:e.provider}),x&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-surface-2 text-terminal-dimmer`,children:E(x)}),(u?.dataSource||e.hasSdk)&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full ${Un(u?.dataSource,e.hasSqlite,e.hasSdk)}`,children:he(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?re():L()},children:(0,V.jsx)(`textarea`,{ref:y,value:m,onChange:e=>h(e.target.value.replace(/\n/g,``)),onBlur:()=>{e.replay&&re()},onKeyDown:t=>{t.key===`Enter`&&(t.preventDefault(),e.replay?re():L())},rows:2,className:`w-full bg-terminal-surface rounded-xl px-5 py-4 text-lg font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-green/40 transition-shadow duration-200 resize-none leading-relaxed`,placeholder:p,maxLength:120})})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-5`,children:[(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl px-5 py-4 space-y-2.5`,children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-1`,children:`Session Info`}),(0,V.jsx)(Gn,{label:`Project`,value:A(e.project),title:e.project}),b&&(0,V.jsx)(Gn,{label:`Branch`,value:b}),u?.gitBranches&&u.gitBranches.length>1&&(0,V.jsx)(Gn,{label:`Branches`,value:u.gitBranches.join(`, `)}),u?.skillsUsed&&u.skillsUsed.length>0&&(0,V.jsx)(Gn,{label:`Skills`,value:u.skillsUsed.join(`, `)}),u?.mcpServersUsed&&u.mcpServersUsed.length>0&&(0,V.jsx)(Gn,{label:`MCP Servers`,value:u.mcpServersUsed.join(`, `)}),(0,V.jsx)(Gn,{label:`Started`,value:`${w(I)} (${k(I)})`}),u?.endTime&&(0,V.jsx)(Gn,{label:`Ended`,value:w(u.endTime)}),!!P&&(0,V.jsx)(Gn,{label:`Duration`,value:`~${Le(P)}`}),(0,V.jsx)(Gn,{label:`Size`,value:O(e.fileSize)}),(0,V.jsx)(Gn,{label:`Lines`,value:e.lineCount.toLocaleString()}),e.filePaths.length>1&&(0,V.jsx)(Gn,{label:`Parts`,value:`${e.filePaths.length} files`}),(0,V.jsx)(Gn,{label:`Data`,value:he(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`}),!!D&&(0,V.jsx)(Gn,{label:`Prompts`,value:String(D)}),!!M&&(0,V.jsx)(Gn,{label:`Tools`,value:String(M)}),!!N&&(0,V.jsx)(Gn,{label:`Edits`,value:u?String(N):`~${N}`}),ee!=null&&ee>0&&(0,V.jsx)(Gn,{label:`Cost`,value:T(ee)}),F!=null&&(0,V.jsx)(Gn,{label:`Tokens`,value:F.toLocaleString(),title:u?.tokenUsage?`In: ${u.tokenUsage.inputTokens.toLocaleString()} / Out: ${u.tokenUsage.outputTokens.toLocaleString()} / Cache write: ${u.tokenUsage.cacheCreationTokens.toLocaleString()} / Cache read: ${u.tokenUsage.cacheReadTokens.toLocaleString()}`:void 0}),u!=null&&u.subAgentCount>0&&(0,V.jsx)(Gn,{label:`Agents`,value:`${u.subAgentCount} sub-agents`}),u!=null&&u.compactionCount>0&&(0,V.jsx)(Gn,{label:`Compacts`,value:String(u.compactionCount)}),u!=null&&u.apiErrorCount>0&&(0,V.jsx)(Gn,{label:`Errors`,value:`${u.apiErrorCount} API errors`}),e.hasPR&&!u?.prLinks?.length&&(0,V.jsx)(Gn,{label:`PR`,value:`Yes`}),u?.prLinks?.map(e=>(0,V.jsx)(Gn,{label:`PR`,value:`#${e.prNumber} (${e.prRepository})`},e.prNumber))]})]}),C.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2`,children:`Data Quality`}),(0,V.jsx)(`div`,{className:`bg-terminal-surface rounded-xl px-4 py-3 space-y-1.5`,children:C.map(e=>(0,V.jsxs)(`div`,{className:`flex gap-2 items-start text-xs font-mono text-terminal-dim`,children:[(0,V.jsx)(`span`,{className:`text-terminal-orange shrink-0 mt-px`,children:`!`}),(0,V.jsx)(`span`,{children:e})]},e))})]}),u?.filesModified&&u.filesModified.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2`,children:[`Files Modified (`,u.filesModified.length,`)`]}),(0,V.jsxs)(`div`,{className:`max-h-[120px] overflow-y-auto bg-terminal-surface rounded-xl px-4 py-2.5 space-y-1`,children:[u.filesModified.slice(0,20).map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs font-mono`,children:[(0,V.jsx)(`span`,{className:`text-terminal-dim truncate`,children:e.file}),(0,V.jsxs)(`span`,{className:`text-terminal-dimmer shrink-0 tabular-nums`,children:[e.count,`x`]})]},e.file)),u.filesModified.length>20&&(0,V.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dimmer`,children:[`+`,u.filesModified.length-20,` more files`]})]})]}),S.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2`,children:`Prompts`}),(0,V.jsx)(`div`,{className:`max-h-[180px] overflow-y-auto space-y-1.5 pr-1`,children:S.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex gap-2 items-start`,children:[(0,V.jsx)(`span`,{className:`text-xs text-terminal-green shrink-0 mt-px select-none`,children:`>`}),(0,V.jsx)(`p`,{className:`text-sm text-terminal-dim line-clamp-2 leading-relaxed`,children:e})]},t))})]}),e.replay&&(0,V.jsxs)(`div`,{className:`border-t border-terminal-border-subtle pt-4`,children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2`,children:`Replay`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[e.replay.replaySize!=null&&(0,V.jsx)(`span`,{className:`text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dim`,children:O(e.replay.replaySize)}),e.replay.generatorVersion&&(0,V.jsxs)(`span`,{className:`text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dimmer`,children:[`v`,e.replay.generatorVersion]}),!!e.replay.annotationCount&&(0,V.jsxs)(`span`,{className:`text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dim`,children:[e.replay.annotationCount,` annotations`]}),(e.replay.cloud||e.replay.gist)&&(0,V.jsx)(`span`,{className:`text-xs font-mono px-2 py-1 rounded-md bg-terminal-green-subtle text-terminal-green`,children:e.replay.cloud?`Cloud`:`Gist`})]})]}),e.expiresInDays!=null&&e.expiresInDays<=7&&(0,V.jsxs)(`div`,{className:`rounded-lg px-4 py-2.5 text-sm font-mono ${e.expiresInDays<=2?`bg-terminal-red-subtle text-terminal-red`:`bg-terminal-orange-subtle text-terminal-orange`}`,children:[e.expiresInDays===0?`Transcript expires today`:`Transcript expires in ${e.expiresInDays} day${e.expiresInDays===1?``:`s`}`,` — generate a replay to preserve it.`]})]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between px-7 py-4 border-t border-terminal-border-subtle`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(`button`,{onClick:()=>{a(e.slug),n()},className:`h-9 px-3 text-xs font-sans rounded-lg text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors flex items-center gap-1.5`,children:[(0,V.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,V.jsx)(`path`,{d:`M2 4h12v2H2zM3 6v7h10V6M6.5 8h3`})}),l?`Unarchive`:`Archive`]}),e.replay&&(0,V.jsxs)(`button`,{onClick:()=>{s(e.slug),n()},className:`h-9 px-3 text-xs font-sans rounded-lg text-terminal-red/70 hover:text-terminal-red hover:bg-terminal-red-subtle transition-colors flex items-center gap-1.5`,children:[(0,V.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,V.jsx)(`path`,{d:`M3 4h10M5.5 4V3h5v1M6 7v4M10 7v4M4.5 4l.5 9h6l.5-9`})}),`Delete replay`]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.sessionId&&(0,V.jsxs)(`button`,{onClick:()=>R(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,m),disabled:c,className:`h-11 px-5 text-sm font-sans font-semibold rounded-xl bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200 flex items-center gap-2 disabled:opacity-50`,children:c?(0,V.jsx)(`span`,{className:`animate-pulse`,children:`Regenerating...`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,V.jsx)(`path`,{d:`M21 3v5h-5`}),(0,V.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,V.jsx)(`path`,{d:`M8 16H3v5`})]}),`Regenerate`]})}),(0,V.jsxs)(`button`,{onClick:()=>i(e.existingReplay),className:`h-11 px-6 text-sm font-sans font-bold rounded-xl bg-terminal-green text-terminal-bg hover:brightness-110 transition-all duration-200 flex items-center gap-2`,children:[(0,V.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,V.jsx)(`path`,{d:`M5 3l8 5-8 5V3z`})}),`View Replay`]})]}),!e.replay&&(0,V.jsx)(`button`,{onClick:L,disabled:c,className:`h-12 px-8 text-sm font-sans font-bold rounded-xl bg-terminal-green text-terminal-bg hover:brightness-110 transition-all duration-200 flex items-center gap-2 shadow-lg shadow-terminal-green/20 disabled:opacity-50`,children:c?(0,V.jsx)(`span`,{className:`animate-pulse`,children:`Generating...`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,V.jsx)(`path`,{d:`M8 2v12M2 8h12`})}),`Generate Replay`]})})]})]})]})]})}function Gn({label:e,value:t,title:n}){return(0,V.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,V.jsx)(`span`,{className:`text-[11px] font-sans text-terminal-dimmer uppercase tracking-wider shrink-0 w-[68px]`,children:e}),(0,V.jsx)(`span`,{className:`text-sm font-mono text-terminal-dim truncate`,title:n||t,children:t})]})}function Kn({summary:e,onOpen:t,onShare:n,onTitleSave:r,onDelete:i,onRegenerate:a,onArchive:o,isDeleting:s,isRegenerating:c,isArchived:l}){let[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(!1),m=(0,_.useRef)(null);v(m,(0,_.useCallback)(()=>{p(!1),d(!1)},[]),f);let h=ve(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)(Fn,{slug:e.slug,title:e.title,fallbackTitle:re(e),onSave:r})}):(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`span`,{className:`text-sm font-sans font-medium text-terminal-text truncate block`,children:re(e)}),(0,V.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer truncate mt-0.5`,children:[`slug: `,(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:e.slug})]})]})}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[e.replayOutdated&&(0,V.jsxs)(`span`,{className:`h-6 px-2 text-[10px] font-mono rounded-md bg-terminal-orange-subtle text-terminal-orange flex items-center gap-1`,title:`Generated with v${e.generatorVersion||`?`} — regenerate to update`,children:[(0,V.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,V.jsx)(`path`,{d:`M2.5 8a5.5 5.5 0 019.3-4M13.5 8a5.5 5.5 0 01-9.3 4`}),(0,V.jsx)(`path`,{d:`M12.5 1v3h-3M3.5 15v-3h3`})]}),`outdated`]}),e.gist?.outdated&&(0,V.jsx)(`button`,{onClick:e=>{e.stopPropagation(),n?.()},className:`h-7 w-7 flex items-center justify-center rounded-md bg-terminal-orange-subtle text-terminal-orange hover:bg-terminal-orange-emphasis transition-all duration-200 ease-material shrink-0`,title:`Gist out of sync — click to update`,children:(0,V.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,V.jsx)(`path`,{d:`M8 1a1 1 0 0 1 1 1v5.5a1 1 0 0 1-2 0V2a1 1 0 0 1 1-1zM8 11a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 8 11z`})})}),n&&(0,V.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),n()},className:`h-7 px-2.5 text-xs font-sans font-semibold rounded-md transition-all duration-200 ease-material flex items-center justify-center gap-1.5 shrink-0 ${e.cloud||e.gist?`bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis`:`bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-purple-emphasis`}`,title:e.cloud||e.gist?`Already shared — view or update`:`Share & Export`,children:[e.cloud||e.gist?(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,V.jsx)(`path`,{d:`M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z`})}):(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,V.jsx)(`path`,{d:`M8 2v8M5 5l3-3 3 3M3 11v2h10v-2`})}),e.cloud||e.gist?`Shared`:`Share`]}),a&&(0,V.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),a()},disabled:c,className:`h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200 ease-material flex items-center justify-center gap-1.5 shrink-0 disabled:opacity-50`,title:`Redo`,children:[c?(0,V.jsx)(`span`,{className:`animate-pulse`,children:`...`}):(0,V.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,V.jsx)(`path`,{d:`M21 3v5h-5`}),(0,V.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,V.jsx)(`path`,{d:`M8 16H3v5`})]}),`Redo`]}),(0,V.jsxs)(`button`,{onClick:t,className:`h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis transition-all duration-200 ease-material flex items-center justify-center gap-1 shrink-0`,children:[(0,V.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,V.jsx)(`polygon`,{points:`4 2 14 8 4 14`})}),`View`]}),(i||o)&&(0,V.jsxs)(`div`,{className:`relative`,ref:m,children:[(0,V.jsx)(`button`,{onClick:e=>{e.stopPropagation(),p(e=>!e),d(!1)},className:`h-7 w-7 flex items-center justify-center rounded-md bg-terminal-surface-2 text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200`,title:`More actions`,children:(0,V.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`currentColor`,children:[(0,V.jsx)(`circle`,{cx:`8`,cy:`3`,r:`1.5`}),(0,V.jsx)(`circle`,{cx:`8`,cy:`8`,r:`1.5`}),(0,V.jsx)(`circle`,{cx:`8`,cy:`13`,r:`1.5`})]})}),f&&(0,V.jsxs)(`div`,{className:`absolute right-0 top-full mt-1 z-50 min-w-[140px] rounded-lg bg-terminal-surface-2 border border-terminal-border shadow-layer-md py-1`,children:[o&&(0,V.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),o(),p(!1)},className:`w-full flex items-center gap-2 px-3 py-1.5 text-xs font-sans text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors`,children:[(0,V.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,V.jsx)(`path`,{d:`M2 4h12v2H2zM3 6v7h10V6M6.5 8h3`})}),l?`Unarchive`:`Archive`]}),i&&(0,V.jsxs)(V.Fragment,{children:[o&&(0,V.jsx)(`div`,{className:`mx-2 my-1 border-t border-terminal-border`}),u?(0,V.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1`,children:[(0,V.jsx)(`button`,{onClick:e=>{e.stopPropagation(),i(),d(!1),p(!1)},className:`h-6 px-2 text-xs font-sans rounded bg-terminal-red-subtle text-terminal-red hover:bg-terminal-red-emphasis transition-colors duration-200`,children:`Confirm`}),(0,V.jsx)(`button`,{onClick:()=>d(!1),className:`h-6 px-2 text-xs font-sans rounded text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`})]}):(0,V.jsxs)(`button`,{onClick:()=>d(!0),className:`w-full flex items-center gap-2 px-3 py-1.5 text-xs font-sans text-terminal-red hover:bg-terminal-red-subtle transition-colors`,children:[(0,V.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,V.jsx)(`path`,{d:`M3 4h10M5.5 4V3a1 1 0 011-1h3a1 1 0 011 1v1M6.5 7v4M9.5 7v4M4.5 4l.5 9a1 1 0 001 1h4a1 1 0 001-1l.5-9`})}),`Delete`]})]})]})]})]})]}),(e.messages||(e.firstMessage?[e.firstMessage]:[])).map(e=>F(e||``)).filter(e=>e.length>0).map((e,t)=>(0,V.jsxs)(`div`,{className:`flex gap-2 items-start`,children:[(0,V.jsx)(`span`,{className:`text-xs text-terminal-green shrink-0 mt-px select-none`,children:`>`}),(0,V.jsx)(`p`,{className:`text-sm text-terminal-dim line-clamp-1 leading-relaxed`,children:e})]},t)),(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim`,children:[e.stats.userPrompts,` prompts`]}),(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-orange-subtle text-terminal-orange`,children:[e.stats.toolCalls,` tools`]}),e.stats.durationMs&&(0,V.jsx)(`span`,{className:`inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim`,children:Le(e.stats.durationMs)}),e.stats.costEstimate&&(0,V.jsx)(`span`,{className:`inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-green-subtle text-terminal-green`,children:T(e.stats.costEstimate)}),e.hasAnnotations&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-blue-subtle text-terminal-blue`,children:[e.annotationCount,` annotation`,e.annotationCount===1?``:`s`]}),e.replaySize!=null&&e.replaySize>0&&(0,V.jsx)(`span`,{className:`inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md ${e.replaySize>10*1024*1024?`bg-terminal-red-subtle text-terminal-red`:`bg-terminal-surface-2 text-terminal-dimmer`}`,title:e.replaySize>10*1024*1024?`Exceeds share limit (10MB)`:void 0,children:O(e.replaySize)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono text-terminal-dimmer flex-wrap`,children:[(0,V.jsx)(Pn,{provider:e.provider}),(0,V.jsx)(`span`,{title:g?e.project:void 0,children:h}),g&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple uppercase tracking-wider`,title:`Agent worktree: ${e.project}`,children:`worktree`}),(0,V.jsx)(`span`,{className:`text-terminal-border`,children:`·`}),(0,V.jsx)(`span`,{children:w(e.startTime)}),e.model&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-terminal-border`,children:`·`}),(0,V.jsx)(`span`,{children:e.model})]})]})]})}function qn(){let[e,t]=(0,_.useState)(!1),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(null);return(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`button`,{onClick:async()=>{t(!0),a(null),r(null);try{let e=await fetch(`/api/regenerate-all`,{method:`POST`}),t=await e.json();if(!e.ok)throw Error(t.error||`Failed`);r({regenerated:t.regenerated,total:t.total}),setTimeout(()=>window.location.reload(),1500)}catch(e){a(e instanceof Error?e.message:`Failed to regenerate`)}finally{t(!1)}},disabled:e,className:`px-3 py-1.5 text-xs font-mono rounded-lg bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover border border-terminal-border-subtle transition-colors duration-200 disabled:opacity-40`,children:e?`Regenerating...`:`Regenerate All`}),n&&(0,V.jsxs)(`span`,{className:`text-xs font-mono text-terminal-green`,children:[n.regenerated,`/`,n.total,` regenerated`]}),i&&(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-red`,children:i})]})}function Jn(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)({}),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!0),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(null),[g,v]=(0,_.useState)(null),[y,w]=(0,_.useState)(()=>Date.now()),{selectedProject:T,filter:D,showArchived:M,handleProjectChange:N,handleFilterChange:P,handleToggleArchived:ee}=we(),{scanStatus:F,userInsights:I,projectInsightsCache:te,fetchProjectInsights:re}=Ve(),R=ve(T);(0,_.useEffect)(()=>{R!==`__all__`&&re(R)},[R,re]);let z=R===`__all__`?void 0:te.get(R),[ie,ae]=(0,_.useState)(null),[oe,se]=(0,_.useState)(null),[ce,le]=(0,_.useState)(null);(0,_.useEffect)(()=>{(()=>{let e=new URLSearchParams(window.location.search).get(`selected`);if(!e)return;le(e);let t=new URL(window.location.href);t.searchParams.delete(`selected`),window.history.replaceState(null,``,t)})();let e=e=>{let t=e.detail?.slug;if(!t)return;le(t);let n=new URL(window.location.href);n.searchParams.delete(`selected`),window.history.replaceState(null,``,n)};return window.addEventListener(`vibe-open-session`,e),()=>window.removeEventListener(`vibe-open-session`,e)},[]);let ue=(0,_.useRef)(!1),[pe,ge]=(0,_.useState)(new Set),[_e,ye]=(0,_.useState)(null),be=e.some(e=>e.provider===`cursor`),Se=ce?e.find(e=>e.slug===ce)??null:null,Ce=(0,_.useCallback)(async e=>{s(!0),l(null),h(null),d(!1),p(null);let n=await fetch(`/api/archived`).then(e=>e.ok?e.json():{slugs:[]}).catch(()=>({slugs:[]}));ge(new Set(n.slugs));let r=!1,i=b(await fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null)),o=!e?.forceRefresh&&x(i?.cachedAt);if(i&&i.sessions.length>0&&(r=!0,t(i.sessions),v(i.cachedAt??null),p(o?null:i.cachedAt??null),s(!1),d(!o)),o){d(!1),s(!1);return}try{let e=await fetch(`/api/sources`);if(!e.ok)throw Error(`Failed to load sessions`);let n=await e.json();t(n.sessions),n.cleanupPeriodDays!=null&&a(n.cleanupPeriodDays),v(new Date().toISOString()),p(null)}catch(e){r?h(`Failed to refresh latest sessions. Showing cached data.`):l(fe(e)||`Failed to load sessions`)}finally{d(!1),s(!1)}},[]),B=e=>de(e,pe,ge);(0,_.useEffect)(()=>{Ce()},[Ce]),(0,_.useEffect)(()=>{if(e.length===0)return;let t=!1,n=async()=>{let e=await zn();t||!e||r(Object.fromEntries(e.filter(e=>e.slug).map(e=>[e.slug,e])))};n();let i=window.setInterval(()=>{n()},F?.running?5e3:3e4);return()=>{t=!0,window.clearInterval(i)}},[F?.running,e.length]),(0,_.useEffect)(()=>{if(!o&&!be&&!ue.current)return;let e=!1,n,r=async()=>{let n=b(await fetch(`/api/sources/cached`).then(e=>e.ok?e.json():null).catch(()=>null));!e&&n?.sessions.length&&t(n.sessions)},i=async()=>{let t=await fetch(`/api/sources/enrichment-status`).then(e=>e.ok?e.json():null).catch(()=>null);!t||e||(ye(t),t.running?(ue.current=!0,await r()):ue.current&&(ue.current=!1,await r()))};return i(),n=window.setInterval(()=>{i()},2500),()=>{e=!0,n&&window.clearInterval(n)}},[be,o]),(0,_.useEffect)(()=>{let e=window.setInterval(()=>w(Date.now()),3e4);return()=>window.clearInterval(e)},[]);let Te=async(e,n)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:n})})).ok)throw Error(`Failed to update title`);t(t=>t.map(t=>t.slug===e&&t.replay?{...t,replay:{...t.replay,title:n||void 0}}:t))},Ee=async(e,t)=>{le(null),ae(e.slug),se(null);try{let n=await fetch(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,filePaths:e.filePaths,toolPaths:e.toolPaths,title:j(t)||void 0,sessionSlug:e.slug,sessionProject:e.project})}),r=await n.json();if(!n.ok)throw Error(r.error||`Generation failed`);L({view:null,session:r.slug})}catch(e){se(fe(e))}finally{ae(null)}},De=async e=>{try{if(!(await fetch(`/api/sessions/${encodeURIComponent(e)}`,{method:`DELETE`})).ok)return;t(t=>t.map(t=>t.slug===e?{...t,replay:void 0,existingReplay:null}:t))}catch{}},Oe=e.filter(e=>pe.has(e.slug)).length,ke=M?e:e.filter(e=>!pe.has(e.slug)),Ae=new Map;for(let e of ke){let t=ve(e.project);Ae.has(t)||Ae.set(t,[]),Ae.get(t)?.push(e)}let je=[...Ae.entries()].sort((e,t)=>{let n=e[1][0]?.timestamp||``;return(t[1][0]?.timestamp||``).localeCompare(n)}),Me=me(je.map(([e])=>e)),H=R===`__all__`?ke:Ae.get(R)||[],Ne=D?H.filter(e=>e.slug.toLowerCase().includes(D.toLowerCase())||e.firstPrompt.toLowerCase().includes(D.toLowerCase())||(e.title||``).toLowerCase().includes(D.toLowerCase())||(e.gitBranch||``).toLowerCase().includes(D.toLowerCase())):H,Pe=g?C(g,y):null,Fe=o&&e.length===0,Ie=e.filter(e=>e.expiresInDays!=null&&e.expiresInDays<=7&&!pe.has(e.slug)),U=Ie.reduce((e,t)=>Math.min(e,t.expiresInDays??1/0),1/0);return c&&e.length===0?(0,V.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,V.jsxs)(`div`,{className:`text-center space-y-3`,children:[(0,V.jsx)(`div`,{className:`text-terminal-red font-mono text-sm`,children:c}),(0,V.jsx)(`button`,{onClick:()=>void Ce({forceRefresh:!0}),className:`px-3 py-1.5 text-xs font-mono rounded-md bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200`,children:`Retry`})]})}):e.length===0&&!Fe?(0,V.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,V.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,V.jsx)(`div`,{className:`text-terminal-dim font-mono text-sm`,children:`No AI sessions found`}),(0,V.jsx)(`div`,{className:`text-terminal-dimmer font-mono text-xs`,children:`Start a coding session with Claude Code or Cursor, then come back here`})]})}):(0,V.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,V.jsxs)(`div`,{className:`hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold`,children:`Projects`}),Pe&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:Pe})]}),(0,V.jsx)(`button`,{onClick:()=>{Ce({forceRefresh:!0})},className:`p-1.5 rounded-md text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200`,title:`Refresh`,children:(0,V.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:[(0,V.jsx)(`path`,{d:`M2.5 8a5.5 5.5 0 019.3-4M13.5 8a5.5 5.5 0 01-9.3 4`}),(0,V.jsx)(`path`,{d:`M12.5 1v3h-3M3.5 15v-3h3`})]})})]}),(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-2 space-y-0.5`,children:[(0,V.jsxs)(`button`,{onClick:()=>N(xe),className:`w-full text-left px-3 py-2.5 text-xs font-sans rounded-lg transition-all duration-200 ease-material flex items-center justify-between ${T===`__all__`?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface`}`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:`All projects`}),(0,V.jsx)(`span`,{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${T===`__all__`?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer`}`,children:e.length})]}),(0,V.jsx)(`div`,{className:`h-px bg-terminal-border-subtle mx-2 my-1.5`}),je.map(([e,t])=>{let n=t.filter(e=>e.existingReplay).length,r=R===e,i=Me.get(e)||A(e),a=t.some(e=>e.projectExists!==!1),o=t.some(e=>e.isGitRepo||e.gitBranch);return(0,V.jsxs)(`button`,{onClick:()=>N(e),title:e,className:`w-full text-left px-3 py-2.5 rounded-lg transition-all duration-200 ease-material group ${r?`bg-terminal-green-subtle shadow-layer-sm`:`hover:bg-terminal-surface`} ${a?``:`opacity-50`}`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-1.5`,children:[(0,V.jsxs)(`span`,{className:`text-xs font-sans truncate flex items-center gap-1.5 ${r?`text-terminal-green font-medium`:a?`text-terminal-text group-hover:text-terminal-text`:`text-terminal-dim`}`,children:[o&&(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`shrink-0 ${r?`opacity-70`:`opacity-40`}`,children:(0,V.jsx)(`path`,{fillRule:`evenodd`,d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z`})}),i]}),(0,V.jsx)(`span`,{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs shrink-0 ${r?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer`}`,children:t.length})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-1 ml-0.5`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono truncate ${r?`text-terminal-dim`:`text-terminal-dimmer`}`,children:k(t[0]?.timestamp||``)}),n>0&&(0,V.jsxs)(`span`,{className:`text-xs font-mono ${r?`text-terminal-green`:`text-terminal-dimmer`}`,children:[n,` `,n===1?`replay`:`replays`]})]})]},e)})]})]}),(0,V.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-0 min-w-0`,children:[(0,V.jsx)(`div`,{className:`md:hidden px-3 pt-3`,children:(0,V.jsxs)(`select`,{value:T,onChange:e=>N(e.target.value),className:`w-full bg-terminal-surface rounded-lg px-3 py-2.5 text-sm font-sans text-terminal-text outline-none shadow-layer-sm`,children:[(0,V.jsxs)(`option`,{value:xe,children:[`All projects (`,e.length,`)`]}),je.map(([e,t])=>(0,V.jsxs)(`option`,{value:e,children:[Me.get(e)||A(e),` (`,t.length,`)`]},e))]})}),(0,V.jsxs)(`div`,{className:`px-4 pt-4 pb-2 space-y-3 shrink-0`,children:[(0,V.jsx)(`div`,{className:`hidden md:block`,children:z&&T!==`__all__`?(0,V.jsx)(We,{insights:z,variant:`project`}):I&&T===`__all__`?(0,V.jsx)(We,{insights:I,variant:`all`}):(0,V.jsx)(Ue,{})}),(0,V.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[(0,V.jsxs)(`div`,{className:`relative flex-1`,children:[(0,V.jsxs)(`svg`,{className:`absolute left-3 top-1/2 -translate-y-1/2 text-terminal-dim`,width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,V.jsx)(`circle`,{cx:`7`,cy:`7`,r:`5`}),(0,V.jsx)(`path`,{d:`M11 11l3.5 3.5`})]}),(0,V.jsx)(`input`,{value:D,onChange:e=>P(e.target.value),placeholder:`Filter by branch, title, prompt...`,className:`w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm`})]}),Oe>0&&(0,V.jsx)(`button`,{onClick:ee,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${M?`bg-terminal-orange-subtle text-terminal-orange`:`bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,title:M?`Hide archived`:`View all (${Oe} archived)`,children:M?`Active`:`View all`})]})]}),(Fe||u||f)&&(0,V.jsx)(`div`,{className:`mx-4 mb-2 flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue shrink-0 shadow-layer-sm`,children:Fe?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,V.jsx)(`span`,{children:`FETCHING SESSIONS...`})]}):u?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,V.jsx)(`span`,{children:`SCANNING LATEST SESSIONS...`}),f&&(0,V.jsxs)(`span`,{className:`text-terminal-dim`,children:[`Showing stale cache (`,S(f),`)`]})]}):f?(0,V.jsxs)(`span`,{children:[`Showing stale cache (`,S(f),`)`]}):null}),_e?.running&&_e.total>0&&(0,V.jsxs)(`div`,{className:`mx-4 mb-2 flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue shrink-0 shadow-layer-sm`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,V.jsxs)(`span`,{children:[`BACKFILLING CURSOR STATS... `,_e.processed,`/`,_e.total]})]}),m&&(0,V.jsxs)(`div`,{className:`mx-4 mb-2 flex items-center gap-2 bg-terminal-orange-subtle rounded-lg px-3 py-2.5 text-xs font-mono text-terminal-orange shrink-0 shadow-layer-sm`,children:[(0,V.jsx)(`span`,{children:m}),(0,V.jsx)(`button`,{onClick:()=>h(null),className:`ml-auto text-terminal-orange/60 hover:text-terminal-orange transition-colors`,children:`×`})]}),oe&&(0,V.jsxs)(`div`,{className:`mx-4 mb-2 flex items-center gap-2 bg-terminal-red-subtle rounded-lg px-3 py-2.5 text-xs font-mono text-terminal-red shrink-0 shadow-layer-sm`,children:[(0,V.jsx)(`span`,{children:oe}),(0,V.jsx)(`button`,{onClick:()=>se(null),className:`ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors`,children:`×`})]}),Ie.length>0&&(0,V.jsxs)(`div`,{className:`mx-4 mb-2 flex items-start gap-2.5 bg-terminal-orange-subtle rounded-lg px-4 py-3 shrink-0 shadow-layer-sm`,children:[(0,V.jsx)(`span`,{className:`text-terminal-orange text-base leading-none mt-0.5`,children:`⚠`}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsxs)(`div`,{className:`text-xs font-sans font-semibold text-terminal-orange`,children:[Ie.length,` session`,Ie.length===1?``:`s`,` expiring`,U===0?` today`:U===1?` tomorrow`:` within ${U} days`]}),(0,V.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-orange/70 mt-0.5`,children:[`Claude Code auto-deletes transcripts after`,` `,i==null?`the configured period`:`${i} days`,`. Generate replays to preserve them.`]})]})]}),(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:Fe?(0,V.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:`Fetching sessions...`}):Ne.length===0?(0,V.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:D?`No sessions match your filter`:`No sessions in this project`}):(0,V.jsx)(`div`,{className:`space-y-2.5 px-4 py-3`,children:Ne.map(e=>{let t=n[e.slug];if(e.replay){let n=pe.has(e.slug),r=ne(e,t),i=Bn(e,t,r);return(0,V.jsx)(Kn,{summary:{...e.replay,title:r,firstMessage:i[0]||t?.firstPrompt||e.replay.firstMessage,messages:i.length>0?i.slice(0,2):t?.firstPrompt?[t.firstPrompt]:e.replay.messages,model:t?.model||e.replay.model},onOpen:()=>L({view:null,session:e.existingReplay}),onShare:()=>L({view:null,session:e.existingReplay,v:`export`}),onTitleSave:Te,onRegenerate:()=>le(e.slug),isRegenerating:ie===e.slug,onDelete:()=>De(e.slug),onArchive:()=>B(e.slug),isArchived:n},`${e.provider}-${e.slug}`)}let r=ne(e,t),i=Bn(e,t,r),a=Vn(t?.gitBranch||e.gitBranch),o=ve(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=he(e.hasSqlite,t?.dataSource,e.hasSdk),m=pe.has(e.slug);return(0,V.jsxs)(`div`,{onClick:()=>le(e.slug),className:`bg-terminal-surface rounded-xl px-5 py-4 hover:bg-terminal-surface-hover transition-all duration-300 ease-material space-y-2.5 shadow-layer-sm cursor-pointer hover-lift ${m?`opacity-50`:``}`,children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,V.jsx)(`span`,{className:`text-sm font-mono text-terminal-text truncate block`,children:r}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,V.jsxs)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer truncate`,children:[`slug: `,(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:e.slug})]}),a&&(0,V.jsxs)(`span`,{className:`text-[11px] font-mono px-1.5 py-0.5 rounded bg-terminal-surface-2 text-terminal-dim shrink-0 inline-flex items-center gap-0.5`,children:[(0,V.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,V.jsx)(`circle`,{cx:`5`,cy:`4`,r:`2`}),(0,V.jsx)(`circle`,{cx:`11`,cy:`12`,r:`2`}),(0,V.jsx)(`path`,{d:`M5 6v4c0 1.1.9 2 2 2h2`})]}),a]}),s&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple shrink-0 uppercase tracking-wider`,title:`Agent worktree: ${e.project}`,children:`worktree`})]})]}),(0,V.jsxs)(`div`,{className:`flex flex-col items-end gap-1 shrink-0`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:k(e.timestamp)}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(`button`,{onClick:t=>{t.stopPropagation(),le(e.slug)},disabled:ie===e.slug,className:`h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200 ease-material flex items-center justify-center gap-1 disabled:opacity-50`,children:ie===e.slug?(0,V.jsx)(`span`,{className:`animate-pulse`,children:`Generating...`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,V.jsx)(`path`,{d:`M8 2v12M2 8h12`})}),`Generate`]})}),(0,V.jsx)(In,{onArchive:()=>B(e.slug),isArchived:m})]})]})]}),i.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex gap-2 items-start`,children:[(0,V.jsx)(`span`,{className:`text-xs text-terminal-green shrink-0 mt-px select-none`,children:`>`}),(0,V.jsx)(`p`,{className:`text-sm text-terminal-dim line-clamp-1 leading-relaxed`,children:e})]},t)),(e.promptCount||l||u||d||e.hasPR||e.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:[`~`,Le(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)(Pn,{provider:e.provider}),T===`__all__`&&(0,V.jsx)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim`,title:e.project,children:Me.get(o)||Me.get(e.project)||A(o)}),f&&(0,V.jsx)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer`,children:E(f)}),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-`,Hn(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:O(e.fileSize)}),e.filePaths.length>1&&(0,V.jsxs)(`span`,{className:`text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer`,children:[e.filePaths.length,` parts`]}),(e.hasSqlite||e.hasSdk||t?.dataSource)&&(0,V.jsx)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded-md ${Un(t?.dataSource,e.hasSqlite,e.hasSdk)}`,title:p,children:p})]})]},`${e.provider}-${e.slug}`)})})}),Se&&(0,V.jsx)(Wn,{session:Se,scanData:n[Se.slug]||null,onClose:()=>le(null),onGenerate:Ee,onViewReplay:e=>L({view:null,session:e}),onArchive:e=>{B(e)},onTitleSave:Te,onDeleteReplay:De,isGenerating:ie===Se.slug,isArchived:pe.has(Se.slug)})]})]})}function Yn(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(()=>Date.now()),[m,h]=(0,_.useState)(new Set),[g,v]=(0,_.useState)(null),[y,w]=(0,_.useState)(null),{selectedProject:T,filter:E,showArchived:D,handleProjectChange:O,handleFilterChange:j,handleToggleArchived:M}=we(),{userInsights:N,projectInsightsCache:P,fetchProjectInsights:ee}=Ve(),F=ve(T);(0,_.useEffect)(()=>{F!==`__all__`&&ee(F)},[F,ee]);let I=F===`__all__`?void 0:P.get(F);(0,_.useEffect)(()=>{let e=!0;return(async()=>{r(!0),s(!1),l(null);let n=await fetch(`/api/archived`).then(e=>e.ok?e.json():{slugs:[]}).catch(()=>({slugs:[]}));e&&h(new Set(n.slugs));let i=!1,o=b(await fetch(`/api/sessions/cached`).then(e=>e.ok?e.json():null).catch(()=>null)),c=x(o?.cachedAt);if(e&&o&&(i=!0,t(o.sessions),a(!0),d(o.cachedAt??null),(o.sessions.length>0||c)&&(l(c?null:o.cachedAt??null),r(!1),s(!c))),c){e&&(s(!1),r(!1));return}try{let n=await fetch(`/api/sessions`);if(!n.ok)throw Error(`Failed to load sessions`);let r=await n.json();if(!e)return;t(r),a(!0),d(new Date().toISOString()),l(null)}catch{if(!e)return;i||a(!1)}finally{e&&(s(!1),r(!1))}})(),()=>{e=!1}},[]),(0,_.useEffect)(()=>{let e=window.setInterval(()=>p(Date.now()),3e4);return()=>window.clearInterval(e)},[]);let te=e=>de(e,m,h),ne=async(e,n)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:n})})).ok)throw Error(`Failed to update title`);t(t=>t.map(t=>t.slug===e?{...t,title:n||void 0}:t))},re=e=>{L({view:null,session:e})},R=async e=>{v(null);try{let n=await fetch(`/api/sessions/${encodeURIComponent(e)}`,{method:`DELETE`});if(!n.ok){v((await n.json().catch(()=>({}))).error||`Failed to delete session`);return}t(t=>t.filter(t=>t.slug!==e))}catch{v(`Failed to delete session`)}},z=async e=>{w(e.slug);try{let t=await fetch(`/api/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,sessionSlug:e.slug,sessionProject:e.project,sessionId:e.sessionId||void 0,title:e.title||void 0})}),n=await t.json();if(!t.ok)throw Error(n.error||`Regeneration failed`);L({view:null,session:n.slug})}catch(e){console.error(`Regenerate error:`,fe(e))}finally{w(null)}},ie=e.filter(e=>m.has(e.slug)).length,ae=D?e:e.filter(e=>!m.has(e.slug)),oe=new Map;for(let e of ae){let t=ve(e.project);oe.has(t)||oe.set(t,[]),oe.get(t)?.push(e)}let se=[...oe.entries()].sort((e,t)=>{let n=e[1][0]?.startTime||``;return(t[1][0]?.startTime||``).localeCompare(n)}),ce=me(se.map(([e])=>e)),le=F===`__all__`?ae:oe.get(F)||[],ue=E?le.filter(e=>(e.title||``).toLowerCase().includes(E.toLowerCase())||e.slug.toLowerCase().includes(E.toLowerCase())||e.project.toLowerCase().includes(E.toLowerCase())||e.provider.toLowerCase().includes(E.toLowerCase())||(e.firstMessage||``).toLowerCase().includes(E.toLowerCase())):le,pe=u?C(u,f):null,he=n&&e.length===0;return!he&&(!i||e.length===0)?(0,V.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,V.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 py-6 space-y-6`,children:[(0,V.jsx)(qn,{}),i&&e.length===0&&(0,V.jsxs)(`div`,{className:`text-center py-12 space-y-2`,children:[(0,V.jsx)(`div`,{className:`text-terminal-dim font-mono text-sm`,children:`No replays yet`}),(0,V.jsx)(`div`,{className:`text-terminal-dimmer font-mono text-xs`,children:`Go to the Sessions tab to generate your first replay`})]}),!i&&(0,V.jsx)(`div`,{className:`text-center py-8 space-y-2`,children:(0,V.jsxs)(`div`,{className:`text-terminal-dimmer font-mono text-xs`,children:[`Or run `,(0,V.jsx)(`span`,{className:`text-terminal-green`,children:`npx vibe-replay`}),` to create a replay from your AI coding sessions`]})})]})}):(0,V.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,V.jsxs)(`div`,{className:`hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20`,children:[(0,V.jsx)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle`,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold`,children:`Projects`}),pe&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer tabular-nums`,children:pe})]})}),(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-2 space-y-0.5`,children:[(0,V.jsxs)(`button`,{onClick:()=>O(xe),className:`w-full text-left px-3 py-2.5 text-xs font-mono rounded-lg transition-all duration-200 ease-material flex items-center justify-between ${T===`__all__`?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface`}`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:`All replays`}),(0,V.jsx)(`span`,{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${T===`__all__`?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer`}`,children:ae.length})]}),(0,V.jsx)(`div`,{className:`h-px bg-terminal-border-subtle mx-2 my-1.5`}),se.map(([e,t])=>{let n=F===e,r=ce.get(e)||A(e),i=t.filter(e=>e.gist?.gistId).length;return(0,V.jsxs)(`button`,{onClick:()=>O(e),title:e,className:`w-full text-left px-3 py-2.5 rounded-lg transition-all duration-200 ease-material group ${n?`bg-terminal-green-subtle shadow-layer-sm`:`hover:bg-terminal-surface`}`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-1.5`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono truncate ${n?`text-terminal-green font-medium`:`text-terminal-text group-hover:text-terminal-text`}`,children:r}),(0,V.jsx)(`span`,{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs shrink-0 ${n?`bg-terminal-green-emphasis text-terminal-green`:`bg-terminal-surface text-terminal-dimmer`}`,children:t.length})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-1 ml-0.5`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono truncate ${n?`text-terminal-dim`:`text-terminal-dimmer`}`,children:k(t[0]?.startTime||``)}),i>0&&(0,V.jsxs)(`span`,{className:`text-xs font-mono ${n?`text-terminal-purple`:`text-terminal-dimmer`}`,children:[i,` published`]})]})]},e)})]})]}),(0,V.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-0 min-w-0`,children:[(0,V.jsx)(`div`,{className:`md:hidden px-3 pt-3`,children:(0,V.jsxs)(`select`,{value:T,onChange:e=>O(e.target.value),className:`w-full bg-terminal-surface rounded-lg px-3 py-2.5 text-sm font-mono text-terminal-text outline-none shadow-layer-sm`,children:[(0,V.jsxs)(`option`,{value:xe,children:[`All replays (`,ae.length,`)`]}),se.map(([e,t])=>(0,V.jsxs)(`option`,{value:e,children:[ce.get(e)||A(e),` (`,t.length,`)`]},e))]})}),(0,V.jsxs)(`div`,{className:`px-4 pt-4 pb-2 space-y-3 shrink-0`,children:[(0,V.jsx)(`div`,{className:`hidden md:block`,children:I&&T!==`__all__`?(0,V.jsx)(We,{insights:I,variant:`project`}):N&&T===`__all__`?(0,V.jsx)(We,{insights:N,variant:`all`}):(0,V.jsx)(Ue,{})}),(0,V.jsxs)(`div`,{className:`hidden md:flex items-center gap-2`,children:[(0,V.jsxs)(`div`,{className:`relative flex-1`,children:[(0,V.jsxs)(`svg`,{className:`absolute left-3 top-1/2 -translate-y-1/2 text-terminal-dim`,width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,V.jsx)(`circle`,{cx:`7`,cy:`7`,r:`5`}),(0,V.jsx)(`path`,{d:`M11 11l3.5 3.5`})]}),(0,V.jsx)(`input`,{value:E,onChange:e=>j(e.target.value),placeholder:`Filter replays...`,className:`w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm`})]}),ie>0&&(0,V.jsx)(`button`,{onClick:M,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${D?`bg-terminal-orange-subtle text-terminal-orange`:`bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,title:D?`Hide archived`:`View all (${ie} archived)`,children:D?`Active`:`View all`}),(0,V.jsx)(qn,{})]}),(0,V.jsxs)(`div`,{className:`md:hidden flex gap-2 items-center`,children:[(0,V.jsxs)(`div`,{className:`relative flex-1`,children:[(0,V.jsxs)(`svg`,{className:`absolute left-3 top-1/2 -translate-y-1/2 text-terminal-dim`,width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,V.jsx)(`circle`,{cx:`7`,cy:`7`,r:`5`}),(0,V.jsx)(`path`,{d:`M11 11l3.5 3.5`})]}),(0,V.jsx)(`input`,{value:E,onChange:e=>j(e.target.value),placeholder:`Filter replays...`,className:`w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm`})]}),ie>0&&(0,V.jsx)(`button`,{onClick:M,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${D?`bg-terminal-orange-subtle text-terminal-orange`:`bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,title:D?`Hide archived`:`View all (${ie} archived)`,children:D?`Active`:`View all`})]})]}),(he||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:he?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,V.jsx)(`span`,{children:`FETCHING REPLAYS...`})]}):o?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse`}),(0,V.jsx)(`span`,{children:`SCANNING LATEST REPLAYS...`}),c&&(0,V.jsxs)(`span`,{className:`text-terminal-dim`,children:[`Showing stale cache (`,S(c),`)`]})]}):c?(0,V.jsxs)(`span`,{children:[`Showing stale cache (`,S(c),`)`]}):null}),g&&(0,V.jsxs)(`div`,{className:`mx-4 mb-2 flex items-center gap-2 bg-terminal-red-subtle rounded-lg px-3 py-2.5 text-xs font-mono text-terminal-red shrink-0 shadow-layer-sm`,children:[(0,V.jsx)(`span`,{children:g}),(0,V.jsx)(`button`,{onClick:()=>v(null),className:`ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors`,children:`×`})]}),(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:he?(0,V.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:`Fetching replays...`}):ue.length===0?(0,V.jsx)(`div`,{className:`text-center py-12 text-terminal-dim font-mono text-sm`,children:E?`No replays match your filter`:`No replays in this project`}):(0,V.jsx)(`div`,{className:`space-y-2.5 px-4 py-3`,children:ue.map(e=>{let t=m.has(e.slug);return(0,V.jsx)(Kn,{summary:e,onOpen:()=>re(e.slug),onShare:()=>L({view:null,session:e.slug,v:`export`}),onTitleSave:ne,onDelete:()=>R(e.slug),onRegenerate:()=>z(e),onArchive:()=>te(e.slug),isRegenerating:y===e.slug,isArchived:t},e.slug)})})})]})]})}function Xn(){let{scanStatus:e}=Ve(),t=!!e?.running,[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(!1),o=(0,_.useRef)(e);e&&(o.current=e);let s=o.current;if((0,_.useEffect)(()=>{if(t)a(!1),r(!0);else if(n){a(!0);let e=setTimeout(()=>{r(!1),a(!1)},300);return()=>clearTimeout(e)}},[t,n]),!n||!s)return null;let c=s.phase===`discovering`?`Discovering sessions...`:s.total>0?`Scanning ${s.scanned}/${s.total}`:`Preparing scan...`,l=s.total>0?Math.round(s.scanned/s.total*100):0;return(0,V.jsxs)(`div`,{className:`fixed bottom-4 right-4 z-50 flex items-center gap-2.5 rounded-lg px-3.5 py-2.5 text-xs font-mono bg-terminal-surface border border-terminal-border shadow-layer-md transition-all duration-300 ${i?`opacity-0 translate-y-2`:`opacity-100 translate-y-0 animate-in fade-in slide-in-from-bottom-2 duration-300`}`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse shrink-0`}),(0,V.jsx)(`span`,{className:`text-terminal-dim`,children:c}),s.total>0&&(0,V.jsx)(`div`,{className:`w-16 h-1 rounded-full bg-terminal-surface-2 overflow-hidden`,children:(0,V.jsx)(`div`,{className:`h-full bg-terminal-purple rounded-full transition-all duration-300`,style:{width:`${l}%`}})})]})}function Zn({headerLeft:e,headerRight:t}){let n=!!window.__VIBE_REPLAY_EDITOR__,r=(0,_.useCallback)(()=>{let e=new URLSearchParams(window.location.search).get(`tab`);return e===`home`||e===`sessions`||e===`replays`||e===`projects`||e===`insights`?e:n?`home`:`replays`},[n]),[i,a]=(0,_.useState)(r());(0,_.useEffect)(()=>{let e=()=>a(r());return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[r]),(0,_.useEffect)(()=>{let e=e=>{let t=e.detail?.slug;t&&(a(`sessions`),L({tab:`sessions`,selected:t,project:null,q:null,archived:null}))};return window.addEventListener(`vibe-open-session`,e),()=>window.removeEventListener(`vibe-open-session`,e)},[]);let o=e=>{a(e),L({tab:e,project:null,q:null,archived:null})},s=(e,t)=>(0,V.jsx)(`button`,{onClick:()=>o(e),className:`px-3.5 py-1.5 text-xs font-sans font-semibold rounded-lg transition-all duration-200 ease-material ${i===e?`bg-terminal-green-subtle text-terminal-green shadow-layer-sm`:`text-terminal-dim hover:text-terminal-text`}`,children:t},e);return(0,V.jsxs)(He,{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)(Pt,{onNavigate:o}):i===`insights`&&n?(0,V.jsx)(Tt,{}):i===`projects`&&n?(0,V.jsx)(Mn,{onNavigate:o}):i===`sessions`&&n?(0,V.jsx)(Jn,{}):(0,V.jsx)(Yn,{})]}),(0,V.jsx)(Xn,{})]})}function Qn(e,t,n,r){let i=new Date().toISOString(),a={id:r??crypto.randomUUID(),sceneIndex:t,body:n,author:`anonymous`,createdAt:i,updatedAt:i,resolved:!1};return[...e,a]}function $n(e,t,n){return e.map(e=>e.id===t?{...e,body:n,updatedAt:new Date().toISOString()}:e)}function er(e,t){return e.filter(e=>e.id!==t)}function tr(e){return new Set(e.map(e=>e.sceneIndex))}function nr(e){let t=new Map;for(let n of e)t.set(n.sceneIndex,(t.get(n.sceneIndex)||0)+1);return t}function rr(e,t){return JSON.stringify(e)!==JSON.stringify(t)}function ir(e){return e.map(e=>{let t=e.contextTokens||0,n=e.tokenUsage?.cacheReadTokens||0,r=e.tokenUsage?.cacheCreationTokens||0,i=e.tokenUsage?.inputTokens||0,a=n+r+i,o=!!e.tokenUsage&&t>0&&a>0;if(!o)return{cacheRead:0,uncached:0,cacheCreate:0,total:0,rawCr:n,rawSum:a,hasData:o};let s=t/a;return{cacheRead:n*s,uncached:i*s,cacheCreate:r*s,total:t,rawCr:n,rawSum:a,hasData:o}})}function ar(e){let t=0,n=0;for(let r of e)t+=r.rawCr,n+=r.rawSum;return n>0?t/n*100:0}function or(e){return e.rawSum>0?e.rawCr/e.rawSum*100:0}function sr(e){return e.type===`tool-call`&&!e.diff&&!e.bashOutput}function cr(e,t){let n=e[t];if(!sr(n))return t;let r=n.toolName,i=t;for(;i+1<e.length&&sr(e[i+1])&&e[i+1].toolName===r;)i++;return i}function lr(e,t){return(()=>{switch(e.type){case`user-prompt`:return 1200;case`thinking`:return 600;case`text-response`:{let t=e.content.length;return Math.max(800,Math.min(t/40,5)*600)}case`tool-call`:return e.diff?1200:e.bashOutput?900:400;case`compaction-summary`:return 800;case`context-injection`:return 600;default:return 800}})()/t}function ur(e){return e===`user-prompt`||e===`compaction-summary`||e===`context-injection`}function dr(e){let t=[];for(let n=0;n<e.length;n++)e[n].type===`user-prompt`&&t.push(n);return t}function fr(e,t){return e.find(e=>e>t)}function pr(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]<t)return e[n]}function mr(e,t,n){let r=t+1;if(r>=e.length)return-1;if(n.promptsOnly){for(;r<e.length&&!ur(e[r].type);)r++;return r>=e.length?-1:r}if(n.compactAssistant&&!ur(e[r].type)){let t=r;for(;t+1<e.length&&!ur(e[t+1].type);)t++;return t}return cr(e,r)}function hr(e,t,n){let r=Math.max(0,t-1);if(t<=0)return 0;if(n.promptsOnly){for(;r>0&&!ur(e[r].type);)r--;return r}if(n.compactAssistant){if(!ur(e[t].type)){let n=t;for(;n>0&&!ur(e[n-1].type);)n--;return Math.max(0,n-1)}return Math.max(0,t-1)}let i=e[r];if(i.type===`tool-call`&&!i.diff&&!i.bashOutput){let t=i.toolName;for(;r>0&&e[r-1].type===`tool-call`&&!e[r-1].diff&&!e[r-1].bashOutput&&e[r-1].toolName===t;)r--}return r}function gr(e){let t=new URLSearchParams(window.location.search).get(`session`);return t?`${e}${e.includes(`?`)?`&`:`?`}slug=${encodeURIComponent(t)}`:e}var _r=`vibe-replay-annotations-`;function vr(e){return _r+e}function yr(e,t=`embedded`){let n=e.meta.sessionId,r=t===`editor`,i=!!window.__VIBE_REPLAY_DATA__||r,[a,o]=(0,_.useState)(()=>{let t=e.annotations??[];if(r)return t;try{let e=localStorage.getItem(vr(n));if(e){let n=JSON.parse(e);if(n.length>0||t.length===0)return n}}catch{}return t}),[s,c]=(0,_.useState)(()=>e.annotations??[]),l=rr(a,s),u=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(r)return u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{fetch(gr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)}).then(e=>{e.ok&&c(a)}).catch(()=>{})},1e3),()=>{u.current&&clearTimeout(u.current)};try{localStorage.setItem(vr(n),JSON.stringify(a))}catch{}},[a,n,r]);let d=(0,_.useMemo)(()=>tr(a),[a]),f=(0,_.useMemo)(()=>nr(a),[a]),p=(0,_.useCallback)((e,t)=>{o(n=>Qn(n,e,t))},[]),m=(0,_.useCallback)((e,t)=>{o(n=>$n(n,e,t))},[]),h=(0,_.useCallback)(e=>{o(t=>er(t,e))},[]),g=(0,_.useCallback)(()=>{if(r)return;let t={...e,annotations:a},i=`window.__VIBE_REPLAY_DATA__ = ${JSON.stringify(t).replace(/<\//g,`<\\/`)};`,o=document.getElementById(`vibe-replay-data`);if(o){let e=o.textContent;o.textContent=i;let t=`<!DOCTYPE html>\n${document.documentElement.outerHTML}`;o.textContent=e,s(t)}else{let e=document.createElement(`script`);e.id=`vibe-replay-data`,e.textContent=i,document.head.appendChild(e);let t=`<!DOCTYPE html>\n${document.documentElement.outerHTML}`;document.head.removeChild(e),s(t)}function s(t){let n=new Blob([t],{type:`text/html`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${e.meta.slug||`replay`}.html`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}c(a);try{localStorage.removeItem(vr(n))}catch{}},[e,a,n,r]),v=(0,_.useCallback)(()=>{let t={...e,annotations:a},r=JSON.stringify(t,null,2),i=new Blob([r],{type:`application/json`}),o=URL.createObjectURL(i),s=document.createElement(`a`);s.href=o,s.download=`replay.json`,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(o),c(a);try{localStorage.removeItem(vr(n))}catch{}},[e,a,n]),[y,b]=(0,_.useState)(!1),x=r?async()=>{b(!0);try{await fetch(gr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});let e=await fetch(gr(`/api/publish/gist`),{method:`POST`}),t=await e.json();if(!e.ok)throw Error(t.error||`Server error: ${e.status}`);return c(a),t}finally{b(!1)}}:null,[S,C]=(0,_.useState)([]),[w,T]=(0,_.useState)(null),[E,D]=(0,_.useState)(!1),O=(0,_.useRef)(null),k=(0,_.useMemo)(()=>w&&S.find(e=>e.name===w)||null,[w,S]);(0,_.useEffect)(()=>{r&&fetch(gr(`/api/feedback/detect`)).then(e=>e.json()).then(e=>{if(!e.available)return;let t=Array.isArray(e.tools)?e.tools:e.tool?[e.tool]:[];C(t),T(e.defaultTool?.name||e.tool?.name||t[0]?.name||null)}).catch(()=>{})},[r]);let A=r&&w?async()=>{let e=new AbortController;O.current=e,D(!0);try{await fetch(gr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a),signal:e.signal});let t=await fetch(gr(`/api/feedback/generate`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({toolName:w}),signal:e.signal}),n=await t.json();if(!t.ok)throw Error(n.error||`AI Coach failed`);return o(n.annotations),c(n.annotations),{score:n.score,itemCount:n.itemCount}}finally{O.current=null,D(!1)}}:null,j=r?e=>{T(e)}:null,M=r?()=>{O.current&&O.current.abort()}:null,[N,P]=(0,_.useState)(!1),ee=r?async()=>{P(!0);try{await fetch(gr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});let e=await fetch(gr(`/api/export/html`),{method:`POST`}),t=await e.json();if(!e.ok)throw Error(t.error||`Export failed: ${e.status}`);let{path:n}=t;return c(a),n}finally{P(!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:ee,exportGithub:r?async()=>{I(!0);try{await fetch(gr(`/api/annotations`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});let e=await fetch(gr(`/api/export/github`),{method:`POST`}),t=await e.json();if(!e.ok)throw Error(t.error||`Export failed: ${e.status}`);return c(a),t}finally{I(!1)}}:null,gistPublishing:y,htmlExporting:N,githubExporting:F,aiCoachTool:k,aiCoachTools:S,aiCoachToolName:w,setAiCoachToolName:j,runAiCoach:A,cancelAiCoach:M,aiCoachRunning:E}}var br={version:1,overlays:[]};function xr(e,t=`embedded`){let n=t===`editor`,[r,i]=(0,_.useState)(br),[a,o]=(0,_.useState)(new Set),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)([]),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(!1),v=(0,_.useRef)(null),y=(0,_.useRef)(null),b=(0,_.useRef)(!1);(0,_.useEffect)(()=>{n&&fetch(gr(`/api/overlays`)).then(e=>e.json()).then(e=>{e&&Array.isArray(e.overlays)&&i(e)}).catch(()=>{}).finally(()=>{b.current=!0})},[n]),(0,_.useEffect)(()=>()=>{v.current&&v.current.abort()},[]),(0,_.useEffect)(()=>{n&&fetch(gr(`/api/feedback/detect`)).then(e=>e.json()).then(e=>{if(!e.available)return;let t=Array.isArray(e.tools)?e.tools:e.tool?[e.tool]:[];u(t),f(e.defaultTool?.name||e.tool?.name||t[0]?.name||null)}).catch(()=>{})},[n]),(0,_.useEffect)(()=>{if(!(!n||!b.current))return y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{fetch(gr(`/api/overlays`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)}).catch(()=>{})},1e3),()=>{y.current&&clearTimeout(y.current)}},[r,n]);let x=(0,_.useCallback)(t=>{let n=e.scenes[t];if(!n||n.type!==`user-prompt`&&n.type!==`text-response`)return null;if(s||a.has(t))return n.content;let i=r.overlays.filter(e=>e.sceneIndex===t);return i.length===0?n.content:i.reduce((e,t)=>e.updatedAt>t.updatedAt?e:t).modifiedValue},[e.scenes,r,a,s]),S=(0,_.useMemo)(()=>{if(r.overlays.length===0||s)return e;let t=new Map;for(let e of r.overlays){let n=t.get(e.sceneIndex);n?n.push(e):t.set(e.sceneIndex,[e])}let n=new Map;for(let[e,r]of t){let t=r.reduce((e,t)=>e.updatedAt>t.updatedAt?e:t);n.set(e,t.modifiedValue)}return n.size===0?e:{...e,scenes:e.scenes.map((e,t)=>{if(a.has(t))return e;let r=n.get(t);return r&&(e.type===`user-prompt`||e.type===`text-response`)?{...e,content:r}:e})}},[e,r,a,s]),C=(0,_.useCallback)(e=>r.overlays.some(t=>t.sceneIndex===e),[r]),w=(0,_.useCallback)(e=>r.overlays.filter(t=>t.sceneIndex===e),[r]),T=(0,_.useCallback)(e=>{i(e)},[]),E=(0,_.useCallback)(e=>{i(t=>({...t,overlays:t.overlays.filter(t=>t.id!==e)}))},[]),D=(0,_.useCallback)(e=>{i(t=>({...t,overlays:t.overlays.filter(t=>t.sceneIndex!==e)}))},[]),O=(0,_.useCallback)(()=>{i(br)},[]),k=(0,_.useCallback)((e,t)=>{i(n=>({...n,overlays:n.overlays.map(n=>n.id===e?{...n,modifiedValue:t,source:{type:`manual`},updatedAt:new Date().toISOString()}:n)}))},[]),A=(0,_.useCallback)(e=>{o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),j=(0,_.useCallback)(()=>{c(e=>!e)},[]),M=(0,_.useMemo)(()=>n?e=>f(e):null,[n]),N=(0,_.useMemo)(()=>n?()=>{v.current&&v.current.abort()}:null,[n]),P=(0,_.useMemo)(()=>n&&d?async e=>{let t=new AbortController;v.current=t,m(!0);try{let n=await fetch(gr(`/api/studio/translate`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({toolName:d,targetLang:e.targetLang,sourceLang:e.sourceLang}),signal:t.signal}),r=await n.json();if(!n.ok)throw Error(r.error||`Translation failed`);return r.overlays&&i(r.overlays),r.stats}finally{v.current=null,m(!1)}}:null,[n,d]),ee=(0,_.useMemo)(()=>n&&d?async e=>{let t=new AbortController;v.current=t,g(!0);try{let n=await fetch(gr(`/api/studio/tone`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({toolName:d,style:e.style}),signal:t.signal}),r=await n.json();if(!n.ok)throw Error(r.error||`Tone adjustment failed`);return r.overlays&&i(r.overlays),r.stats}finally{v.current=null,g(!1)}}:null,[n,d]);return{overlays:r,effectiveSession:S,getEffectiveContent:x,hasOverlay:C,getOverlays:w,overlayCount:r.overlays.length,setOverlays:T,revertOverlay:E,revertSceneOverlays:D,revertAll:O,updateOverlay:k,showOriginal:a,toggleOriginal:A,showAllOriginals:s,toggleAllOriginals:j,studioTools:l,studioToolName:d,setStudioToolName:M,studioToolsAvailable:l.length>0,translating:p,toningDown:h,cancelStudio:N,runTranslate:P,runTone:ee}}function Sr(e){let t=e;if(!t)return!1;let n=t.tagName;if(n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t.isContentEditable)return!0;let r=t.getAttribute(`role`);return r===`textbox`||r===`combobox`}function Cr(e,t,n=!0){let[r,i]=(0,_.useState)(`idle`),[a,o]=(0,_.useState)(-1),[s,c]=(0,_.useState)(1),[l,u]=(0,_.useState)(0),d=(0,_.useRef)(null),f=(0,_.useRef)(r),p=(0,_.useRef)(a),m=(0,_.useRef)(s),h=(0,_.useRef)(t);f.current=r,p.current=a,m.current=s,h.current=t;let g=(0,_.useMemo)(()=>dr(e),[e]),v=(0,_.useCallback)(()=>{d.current&&=(clearTimeout(d.current),null)},[]),y=(0,_.useCallback)(()=>{if(f.current!==`playing`)return;let t=mr(e,p.current,h.current);if(t===-1){i(`ended`),o(e.length-1),u(e.length);return}o(t),u(t+1);let n=lr(e[t],m.current);d.current=setTimeout(y,n)},[e]),b=(0,_.useCallback)(()=>{e.length!==0&&(v(),f.current===`ended`&&(o(-1),u(0)),i(`playing`),d.current=setTimeout(()=>{if(f.current===`playing`)if(p.current<0){let t=cr(e,0);o(t),u(t+1);let n=lr(e[t],m.current);d.current=setTimeout(y,n)}else{let t=e[p.current];if(t){let e=lr(t,m.current)/2;d.current=setTimeout(y,e)}}},50))},[e,y,v]),x=(0,_.useCallback)(()=>{v(),i(`paused`)},[v]),S=(0,_.useCallback)(()=>{f.current===`playing`?x():b()},[b,x]),C=(0,_.useCallback)(t=>{v();let n=Math.max(0,Math.min(t,e.length-1));if(o(n),u(n+1),f.current===`playing`){let t=lr(e[n],m.current);d.current=setTimeout(y,t)}(f.current===`ended`||f.current===`idle`)&&i(`paused`)},[e,v,y]),w=(0,_.useCallback)(()=>{let e=fr(g,p.current);e!==void 0&&C(e)},[g,C]),T=(0,_.useCallback)(()=>{let e=pr(g,p.current);e!==void 0&&C(e)},[g,C]),E=(0,_.useCallback)(t=>{if(c(t),f.current===`playing`){v();let n=e[p.current];if(n){let e=lr(n,t);d.current=setTimeout(y,e)}}},[e,v,y]);return(0,_.useEffect)(()=>v,[v]),(0,_.useEffect)(()=>{if(!n)return;let t=t=>{if(!Sr(t.target))if(t.key===` `)t.preventDefault(),S();else if(t.key===`ArrowDown`||t.key===`j`){f.current===`playing`&&x(),t.preventDefault();let n=mr(e,p.current,h.current);n!==-1&&C(n)}else t.key===`ArrowUp`||t.key===`k`?(f.current===`playing`&&x(),t.preventDefault(),C(hr(e,p.current,h.current))):t.key===`ArrowLeft`||t.key===`h`?(t.preventDefault(),window.dispatchEvent(new CustomEvent(`vibe:toggle-expand`,{detail:{action:`collapse`}}))):t.key===`Escape`?f.current===`playing`&&(t.preventDefault(),x()):t.key===`ArrowRight`||t.key===`l`?(t.preventDefault(),window.dispatchEvent(new CustomEvent(`vibe:toggle-expand`,{detail:{action:`expand`}}))):t.key===`n`?(t.preventDefault(),w()):t.key===`p`?(t.preventDefault(),T()):t.key===`Home`?(t.preventDefault(),C(0)):(t.key===`End`||t.key===`e`)&&(t.preventDefault(),C(e.length-1))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[n,S,C,w,T,e,x]),{state:r,currentIndex:a,visibleCount:l,speed:s,play:b,pause:x,togglePlayPause:S,seekTo:C,changeSpeed:E,jumpToNextUserPrompt:w,jumpToPrevUserPrompt:T,userPromptIndices:g,totalScenes:e.length,computeNextIndex:(0,_.useCallback)(n=>mr(e,n,t),[e,t]),computePrevIndex:(0,_.useCallback)(n=>hr(e,n,t),[e,t])}}function wr(e){switch(e.displayMode){case`all`:return{hideThinking:!1,collapseAllTools:!1,promptsOnly:!1,compactAssistant:!1};case`compact`:return{hideThinking:!0,collapseAllTools:!0,promptsOnly:!1,compactAssistant:!0};case`custom`:return{hideThinking:e.hideThinking,collapseAllTools:e.collapseAllTools,promptsOnly:e.promptsOnly,compactAssistant:!1}}}var Tr=`vibe-replay-view-prefs`,Er={displayMode:`compact`,hideThinking:!1,collapseAllTools:!1,promptsOnly:!1};function Dr(){try{let e=localStorage.getItem(Tr);if(e){let t=JSON.parse(e);return t.displayMode?{...Er,...t}:{...Er,...t,displayMode:`compact`}}}catch{}return Er}function Or(){let[e,t]=(0,_.useState)(Dr);return{prefs:e,updatePref:(0,_.useCallback)((e,n)=>{t(t=>{let r={...t,[e]:n};return localStorage.setItem(Tr,JSON.stringify(r)),r})},[]),togglePref:(0,_.useCallback)(e=>{t(t=>{let n=t[e];if(typeof n!=`boolean`)return t;let r={...t,[e]:!n};return localStorage.setItem(Tr,JSON.stringify(r)),r})},[])}}function kr({size:e=14}){return(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,V.jsx)(`path`,{d:`m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z`})})}function Ar({className:e=``}){return(0,V.jsxs)(`svg`,{className:`animate-spin h-3.5 w-3.5 ${e}`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,V.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,V.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]})}function jr({toolName:e}){return e===`claude`?(0,V.jsxs)(`div`,{className:`mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1`,children:[(0,V.jsxs)(`p`,{children:[`Runs`,` `,(0,V.jsx)(`code`,{className:`px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text`,children:`claude -p`}),` `,`locally with your prompt piped to stdin. Uses your existing auth and token quota.`]}),(0,V.jsxs)(`p`,{className:`text-terminal-dimmer`,children:[`Auth issues? Run`,` `,(0,V.jsx)(`code`,{className:`px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text`,children:`claude`}),` `,`in your terminal to re-login.`]})]}):e===`agent`?(0,V.jsxs)(`div`,{className:`mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1`,children:[(0,V.jsxs)(`p`,{children:[`Runs`,` `,(0,V.jsx)(`code`,{className:`px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text`,children:`agent -p`}),` `,`locally with your prompt piped to stdin. Uses your Cursor subscription or API key.`]}),(0,V.jsxs)(`p`,{className:`text-terminal-dimmer`,children:[`Auth issues? Check Cursor IDE settings or run`,` `,(0,V.jsx)(`code`,{className:`px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text`,children:`agent`}),` `,`in your terminal.`]})]}):e===`opencode`?(0,V.jsxs)(`div`,{className:`mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1`,children:[(0,V.jsxs)(`p`,{children:[`Runs`,` `,(0,V.jsx)(`code`,{className:`px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text`,children:`opencode run`}),` `,`locally with your prompt piped to stdin. Uses your existing OpenCode configuration.`]}),(0,V.jsxs)(`p`,{className:`text-terminal-dimmer`,children:[`Not working? Run`,` `,(0,V.jsx)(`code`,{className:`px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text`,children:`opencode`}),` `,`in your terminal to verify setup.`]})]}):(0,V.jsxs)(`p`,{className:`mt-2 text-xs font-mono text-terminal-dim leading-relaxed`,children:[`Runs `,(0,V.jsx)(`span`,{className:`text-terminal-text font-medium`,children:e}),` locally on your machine using your existing auth.`]})}var Mr=[`English`,`Chinese (Simplified)`,`Chinese (Traditional)`,`Japanese`,`Korean`,`Spanish`,`French`,`German`,`Portuguese`,`Russian`],Nr=[{value:`professional`,label:`Professional`},{value:`neutral`,label:`Neutral`},{value:`friendly`,label:`Friendly`}];function Pr({annotationActions:e,overlayActions:t}){let{studioTools:n,studioToolName:r,setStudioToolName:i,studioToolsAvailable:a,translating:o,toningDown:s,cancelStudio:c,runTranslate:l,runTone:u,overlayCount:d,revertAll:f}=t,{runAiCoach:p,aiCoachRunning:m,cancelAiCoach:h,aiCoachTools:g,aiCoachToolName:v,setAiCoachToolName:y}=e,b=!!p,x=e.annotations.some(e=>e.author===`vibe-feedback`),[S,C]=(0,_.useState)(`English`),[w,T]=(0,_.useState)(`professional`),[E,D]=(0,_.useState)(null),[O,k]=(0,_.useState)(null),[A,j]=(0,_.useState)(null),[M,N]=(0,_.useState)(null),P=m||o||s,ee=n.length>0?n:g,F=r||v,I=(0,_.useCallback)(async()=>{if(p){D(null),N(null);try{let e=await p();D({type:`success`,text:`Score ${e.score}/10 \u2014 ${e.itemCount} comment(s)`})}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;D({type:`error`,text:e instanceof Error?e.message:`AI Coach failed`})}}},[p]),te=(0,_.useCallback)(async()=>{if(l){k(null),N(null);try{let e=await l({targetLang:S});k({type:`success`,text:`${e.translated} message(s) translated, ${e.skipped} unchanged`})}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;k({type:`error`,text:e instanceof Error?e.message:`Translation failed`})}}},[l,S]),ne=(0,_.useCallback)(async()=>{if(u){j(null),N(null);try{let e=await u({style:w});j({type:`success`,text:`${e.adjusted} prompt(s) adjusted, ${e.skipped} unchanged`})}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;j({type:`error`,text:e instanceof Error?e.message:`Tone adjustment failed`})}}},[u,w]),re=e=>t.overlays.overlays.some(t=>t.source.type===e),L=e=>{if(e===`coach`&&x){N(`coach`);return}if(e===`translate`&&re(`translate`)){N(`translate`);return}if(e===`tone`&&re(`tone`)){N(`tone`);return}e===`coach`?I():e===`translate`?te():ne()};return!a&&g.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,V.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-terminal-border-subtle flex items-center gap-2`,children:[(0,V.jsx)(kr,{size:12}),(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest`,children:`AI Studio`})]}),(0,V.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center px-6 py-8 text-center`,children:[(0,V.jsx)(`div`,{className:`w-10 h-10 rounded-xl bg-terminal-surface flex items-center justify-center mb-3`,children:(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-terminal-dim`,children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,V.jsx)(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`}),(0,V.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`})]})}),(0,V.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text mb-1`,children:`No AI tools detected`}),(0,V.jsx)(`p`,{className:`text-xs font-mono text-terminal-dim mb-4 leading-relaxed`,children:`AI Studio requires a local CLI tool. Install one of the following:`}),(0,V.jsx)(`div`,{className:`w-full space-y-2 text-left`,children:[{name:`Claude Code`,cmd:`npm install -g @anthropic-ai/claude-code`,rec:!0},{name:`Cursor CLI`,cmd:`Bundled with Cursor IDE (run as "agent")`},{name:`OpenCode`,cmd:`go install github.com/opencode-ai/opencode@latest`}].map(e=>(0,V.jsxs)(`div`,{className:`px-3 py-2 rounded-lg bg-terminal-surface border border-terminal-border-subtle`,children:[(0,V.jsxs)(`div`,{className:`text-xs font-sans font-medium text-terminal-text flex items-center gap-1.5`,children:[e.name,e.rec&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-green-subtle text-terminal-green`,children:`recommended`})]}),(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim mt-0.5 break-all`,children:e.cmd})]},e.name))}),(0,V.jsxs)(`p`,{className:`mt-4 text-xs font-mono text-terminal-dimmer leading-relaxed text-center`,children:[`AI Studio runs the CLI tool in headless mode,`,` `,(0,V.jsx)(`span`,{className:`text-terminal-green font-medium`,children:`locally`}),` on your machine.`]})]})]}):(0,V.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,V.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-terminal-border-subtle flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(kr,{size:12}),(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest`,children:`AI Studio`})]}),d>0&&(0,V.jsxs)(`button`,{onClick:f,className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-red-subtle hover:text-terminal-red transition-colors`,children:[`Revert All (`,d,`)`]})]}),(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,V.jsxs)(`div`,{className:`px-4 py-3 border-b border-terminal-border-subtle bg-terminal-surface/30`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim`,children:`Tool`}),ee.length>1&&i?(0,V.jsx)(`select`,{value:F||``,onChange:e=>{i(e.target.value),y&&y(e.target.value)},className:`bg-terminal-surface border border-terminal-border rounded-lg px-2 py-0.5 text-xs font-mono text-terminal-text outline-none cursor-pointer hover:border-terminal-purple/30 transition-colors`,children:ee.map(e=>(0,V.jsx)(`option`,{value:e.name,children:e.name},e.name))}):(0,V.jsx)(`span`,{className:`text-xs font-mono font-medium text-terminal-text px-2 py-0.5 rounded-lg bg-terminal-surface border border-terminal-border`,children:F})]}),(0,V.jsx)(jr,{toolName:F})]}),(0,V.jsxs)(`div`,{className:`p-4 space-y-3`,children:[b&&(0,V.jsx)(Fr,{title:`AI Coach`,preview:(0,V.jsxs)(`div`,{className:`mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden`,children:[(0,V.jsx)(`div`,{className:`px-3 py-2.5 border-b border-terminal-border-subtle`,children:(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-green leading-relaxed`,children:`Fix the login bug users reported`})}),(0,V.jsxs)(`div`,{className:`px-3 py-2 flex items-start gap-2`,children:[(0,V.jsx)(`span`,{className:`text-xs shrink-0`,children:`💬`}),(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-blue leading-relaxed`,children:`Be specific — which file? what error?`})]}),(0,V.jsxs)(`div`,{className:`px-3 py-2 border-t border-terminal-border-subtle flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono font-semibold text-terminal-orange`,children:`6/10`}),(0,V.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:[`·`,` 4 comments added inline`]})]})]}),description:`Score your prompting technique and get inline coaching comments.`,running:m,disabled:P,status:E,buttonLabel:x?`Re-run Coach`:`Run Coach`,runningLabel:`Analyzing...`,onRun:()=>L(`coach`),onCancel:h||void 0,showRerunConfirm:M===`coach`,rerunWarning:`Existing AI feedback will be replaced.`,onConfirmRerun:()=>void I(),onCancelRerun:()=>N(null)}),l&&(0,V.jsx)(Fr,{title:`Translate`,preview:(0,V.jsxs)(`div`,{className:`mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`px-3 py-2.5 space-y-1`,children:[(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim line-through opacity-60`,children:`这个bug怎么修?`}),(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-green`,children:`How to fix this bug?`})]}),(0,V.jsxs)(`div`,{className:`px-3 py-2.5 border-t border-terminal-border-subtle space-y-1`,children:[(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim line-through opacity-60`,children:`已写入。以后用中文问我...`}),(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-blue`,children:`Done. Ask me in Chinese...`})]})]}),description:`Translate all prompts and responses for sharing with international teams.`,running:o,disabled:P,status:O,buttonLabel:re(`translate`)?`Re-translate`:`Translate All`,runningLabel:`Translating...`,onRun:()=>L(`translate`),onCancel:c||void 0,showRerunConfirm:M===`translate`,rerunWarning:`Existing translations will be replaced.`,onConfirmRerun:()=>void te(),onCancelRerun:()=>N(null),config:(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-2.5`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim shrink-0`,children:`Target`}),(0,V.jsx)(`select`,{value:S,onChange:e=>C(e.target.value),disabled:P,className:`flex-1 bg-terminal-surface border border-terminal-border rounded px-2 py-1 text-xs font-mono text-terminal-text outline-none disabled:opacity-50`,children:Mr.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))})]})}),u&&(0,V.jsx)(Fr,{title:`Soften Tone`,preview:(0,V.jsxs)(`div`,{className:`mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`px-3 py-2.5 space-y-1`,children:[(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-red line-through opacity-60`,children:`this code is mass garbage, mass delete it`}),(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-green`,children:`Let's refactor this module for clarity`})]}),(0,V.jsxs)(`div`,{className:`px-3 py-2.5 border-t border-terminal-border-subtle space-y-1`,children:[(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-red line-through opacity-60`,children:`are you stupid? I said fix the auth`}),(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-green`,children:`The auth issue is still present, could you revisit?`})]})]}),description:`Rewrite harsh or blunt prompts into professional, constructive language.`,running:s,disabled:P,status:A,buttonLabel:re(`tone`)?`Re-adjust`:`Soften All`,runningLabel:`Adjusting...`,onRun:()=>L(`tone`),onCancel:c||void 0,showRerunConfirm:M===`tone`,rerunWarning:`Existing tone adjustments will be replaced.`,onConfirmRerun:()=>void ne(),onCancelRerun:()=>N(null),config:(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-2.5`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim shrink-0`,children:`Style`}),(0,V.jsx)(`select`,{value:w,onChange:e=>T(e.target.value),disabled:P,className:`flex-1 bg-terminal-surface border border-terminal-border rounded px-2 py-1 text-xs font-mono text-terminal-text outline-none disabled:opacity-50`,children:Nr.map(e=>(0,V.jsx)(`option`,{value:e.value,children:e.label},e.value))})]})})]})]})]})}function Fr({title:e,preview:t,description:n,running:r,disabled:i,status:a,buttonLabel:o,runningLabel:s,onRun:c,onCancel:l,showRerunConfirm:u,rerunWarning:d,onConfirmRerun:f,onCancelRerun:p,config:m}){return(0,V.jsxs)(`div`,{className:`rounded-xl border border-terminal-border-subtle bg-terminal-surface/30 overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,V.jsx)(`div`,{className:`text-sm font-sans font-semibold text-terminal-text`,children:e}),t,n&&(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim mt-2 leading-relaxed`,children:n}),m,(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-3`,children:[(0,V.jsx)(`button`,{onClick:c,disabled:i,className:`px-3.5 py-1.5 text-xs font-mono rounded-lg bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-purple-emphasis transition-colors disabled:opacity-40 flex items-center gap-1.5`,children:r?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Ar,{className:`text-terminal-purple`}),s]}):o}),r&&l&&(0,V.jsx)(`button`,{onClick:l,className:`text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`})]})]}),u&&!r&&(0,V.jsx)(`div`,{className:`px-4 pb-3`,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono`,children:[(0,V.jsx)(`span`,{className:`text-terminal-orange flex-1`,children:d}),(0,V.jsx)(`button`,{onClick:p,className:`text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`}),(0,V.jsx)(`button`,{onClick:f,className:`text-terminal-purple hover:text-terminal-text transition-colors font-medium`,children:`Continue`})]})}),a&&(0,V.jsx)(`div`,{className:`px-4 pb-3 text-xs font-mono ${a.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:a.text})]})}function Ir({open:e,onClose:t,annotationActions:n,overlayActions:r}){return(0,_.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&(e.preventDefault(),t())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),(0,V.jsxs)(`div`,{className:`fixed inset-0 z-50 hidden md:block transition-opacity duration-300 ${e?`opacity-100`:`opacity-0 pointer-events-none`}`,children:[(0,V.jsx)(`div`,{className:`absolute inset-0 bg-black/30`,onClick:t}),(0,V.jsxs)(`div`,{className:`absolute top-0 right-0 bottom-0 w-96 bg-terminal-bg border-l border-terminal-border-subtle shadow-layer-xl flex flex-col transition-transform duration-300 ease-material-decel ${e?`translate-x-0`:`translate-x-full`}`,onClick:e=>e.stopPropagation(),children:[(0,V.jsx)(`button`,{onClick:t,className:`absolute top-2 right-2 z-10 p-1 text-terminal-dim hover:text-terminal-text transition-colors`,title:`Close AI Studio`,children:`✕`}),(0,V.jsx)(Pr,{annotationActions:n,overlayActions:r})]})]})}function Lr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Rr=Lr();function zr(e){Rr=e}var Br={exec:()=>null};function W(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Hr.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Vr=(()=>{try{return!0}catch{return!1}})(),Hr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Ur=/^(?:[ \t]*(?:\n|$))+/,Wr=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Gr=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Kr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,qr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Jr=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Yr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xr=W(Yr).replace(/bull/g,Jr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Zr=W(Yr).replace(/bull/g,Jr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Qr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$r=/^[^\n]+/,ei=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ti=W(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,ei).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ni=W(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Jr).getRegex(),ri=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,ii=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,ai=W(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,ii).replace(`tag`,ri).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oi=W(Qr).replace(`hr`,Kr).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,ri).getRegex(),si={blockquote:W(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,oi).getRegex(),code:Wr,def:ti,fences:Gr,heading:qr,hr:Kr,html:ai,lheading:Xr,list:ni,newline:Ur,paragraph:oi,table:Br,text:$r},ci=W(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Kr).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,ri).getRegex(),li={...si,lheading:Zr,table:ci,paragraph:W(Qr).replace(`hr`,Kr).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,ci).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,ri).getRegex()},ui={...si,html:W(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,ii).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Br,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:W(Qr).replace(`hr`,Kr).replace(`heading`,` *#{1,6} *[^
|
|
27
|
+
]`).replace(`lheading`,Xr).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},di=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fi=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pi=/^( {2,}|\\)\n(?!\s*$)/,mi=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,hi=/[\p{P}\p{S}]/u,gi=/[\s\p{P}\p{S}]/u,_i=/[^\s\p{P}\p{S}]/u,vi=W(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,gi).getRegex(),yi=/(?!~)[\p{P}\p{S}]/u,bi=/(?!~)[\s\p{P}\p{S}]/u,xi=/(?:[^\s\p{P}\p{S}]|~)/u,Si=/(?![*_])[\p{P}\p{S}]/u,Ci=/(?![*_])[\s\p{P}\p{S}]/u,wi=/(?:[^\s\p{P}\p{S}]|[*_])/u,Ti=W(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Vr?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Ei=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Di=W(Ei,`u`).replace(/punct/g,hi).getRegex(),Oi=W(Ei,`u`).replace(/punct/g,yi).getRegex(),G=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,ki=W(G,`gu`).replace(/notPunctSpace/g,_i).replace(/punctSpace/g,gi).replace(/punct/g,hi).getRegex(),Ai=W(G,`gu`).replace(/notPunctSpace/g,xi).replace(/punctSpace/g,bi).replace(/punct/g,yi).getRegex(),ji=W(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,_i).replace(/punctSpace/g,gi).replace(/punct/g,hi).getRegex(),Mi=W(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,Si).getRegex(),Ni=W(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,wi).replace(/punctSpace/g,Ci).replace(/punct/g,Si).getRegex(),Pi=W(/\\(punct)/,`gu`).replace(/punct/g,hi).getRegex(),Fi=W(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ii=W(ii).replace(`(?:-->|$)`,`-->`).getRegex(),Li=W(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Ii).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ri=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,zi=W(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,Ri).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Bi=W(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Ri).replace(`ref`,ei).getRegex(),Vi=W(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,ei).getRegex(),Hi=W(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Bi).replace(`nolink`,Vi).getRegex(),Ui=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Wi={_backpedal:Br,anyPunctuation:Pi,autolink:Fi,blockSkip:Ti,br:pi,code:fi,del:Br,delLDelim:Br,delRDelim:Br,emStrongLDelim:Di,emStrongRDelimAst:ki,emStrongRDelimUnd:ji,escape:di,link:zi,nolink:Vi,punctuation:vi,reflink:Bi,reflinkSearch:Hi,tag:Li,text:mi,url:Br},Gi={...Wi,link:W(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Ri).getRegex(),reflink:W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Ri).getRegex()},Ki={...Wi,emStrongRDelimAst:Ai,emStrongLDelim:Oi,delLDelim:Mi,delRDelim:Ni,url:W(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Ui).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:W(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Ui).getRegex()},qi={...Ki,br:W(pi).replace(`{2,}`,`*`).getRegex(),text:W(Ki.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Ji={normal:si,gfm:li,pedantic:ui},Yi={normal:Wi,gfm:Ki,breaks:qi,pedantic:Gi},Xi={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Zi=e=>Xi[e];function Qi(e,t){if(t){if(Hr.escapeTest.test(e))return e.replace(Hr.escapeReplace,Zi)}else if(Hr.escapeTestNoEncode.test(e))return e.replace(Hr.escapeReplaceNoEncode,Zi);return e}function $i(e){try{e=encodeURI(e).replace(Hr.percentDecode,`%`)}catch{return null}return e}function ea(e,t){let n=e.replace(Hr.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Hr.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(Hr.slashPipe,`|`);return n}function ta(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function na(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function ra(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function ia(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function aa(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
27
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(`
|
|
28
|
-
`)}var
|
|
29
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=
|
|
30
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e
|
|
29
|
+
`)}var oa=class{options;rules;lexer;constructor(e){this.options=e||Rr}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:ta(e,`
|
|
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=ta(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:ta(t[0],`
|
|
31
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=ta(t[0],`
|
|
31
32
|
`).split(`
|
|
32
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(`
|
|
33
34
|
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -38,17 +39,17 @@ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
38
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+`
|
|
39
40
|
`+e.join(`
|
|
40
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(`
|
|
41
|
-
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=
|
|
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=ra(t[2].split(`
|
|
42
43
|
`,1)[0],t[1].length),l=e.split(`
|
|
43
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+`
|
|
44
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(`
|
|
45
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+=`
|
|
46
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+=`
|
|
47
48
|
`+l}u=!l.trim(),r+=p+`
|
|
48
|
-
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=
|
|
49
|
-
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(
|
|
50
|
-
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t
|
|
51
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(
|
|
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=ea(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(ea(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
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=ta(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=na(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),ia(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return ia(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},sa=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Rr,this.options.tokenizer=this.options.tokenizer||new oa,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Hr,block:Ji.normal,inline:Yi.normal};this.options.pedantic?(t.block=Ji.pedantic,t.inline=Yi.pedantic):this.options.gfm&&(t.block=Ji.gfm,this.options.breaks?t.inline=Yi.breaks:t.inline=Yi.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ji,inline:Yi}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Hr.carriageReturn,`
|
|
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(Hr.tabCharGlobal,` `).replace(Hr.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
52
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(`
|
|
53
54
|
`)?``:`
|
|
54
55
|
`)+r.raw,n.text+=`
|
|
@@ -61,9 +62,9 @@ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
61
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(`
|
|
62
63
|
`)?``:`
|
|
63
64
|
`)+r.raw,n.text+=`
|
|
64
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},
|
|
65
|
-
`;return r?`<pre><code class="language-`+
|
|
66
|
-
`:`<pre><code>`+(n?i:
|
|
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}},ca=class{options;parser;constructor(e){this.options=e||Rr}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Hr.notSpaceStart)?.[0],i=e.replace(Hr.endingNewline,``)+`
|
|
66
|
+
`;return r?`<pre><code class="language-`+Qi(r)+`">`+(n?i:Qi(i,!0))+`</code></pre>
|
|
67
|
+
`:`<pre><code>`+(n?i:Qi(i,!0))+`</code></pre>
|
|
67
68
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
68
69
|
${this.parser.parse(e)}</blockquote>
|
|
69
70
|
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
@@ -79,34 +80,34 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
79
80
|
`}tablerow({text:e}){return`<tr>
|
|
80
81
|
${e}</tr>
|
|
81
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}>
|
|
82
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${
|
|
83
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+
|
|
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>${Qi(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=$i(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+Qi(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=$i(e);if(i===null)return Qi(n);e=i;let a=`<img src="${e}" alt="${Qi(n)}"`;return t&&(a+=` title="${Qi(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Qi(e.text)}},la=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},ua=class e{options;renderer;textRenderer;constructor(e){this.options=e||Rr,this.options.renderer=this.options.renderer||new ca,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new la}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},da=class{options;block;constructor(e){this.options=e||Rr}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?sa.lex:sa.lexInline}provideParser(){return this.block?ua.parse:ua.parseInline}},fa=new class{defaults=Lr();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ua;Renderer=ca;TextRenderer=la;Lexer=sa;Tokenizer=oa;Hooks=da;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ca(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new oa(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new da;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];da.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&da.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return sa.lex(e,t??this.defaults)}parser(e,t){return ua.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?sa.lex:sa.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?ua.parse:ua.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?sa.lex:sa.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?ua.parse:ua.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
84
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Qi(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function K(e,t){return fa.parse(e,t)}K.options=K.setOptions=function(e){return fa.setOptions(e),K.defaults=fa.defaults,zr(K.defaults),K},K.getDefaults=Lr,K.defaults=Rr,K.use=function(...e){return fa.use(...e),K.defaults=fa.defaults,zr(K.defaults),K},K.walkTokens=function(e,t){return fa.walkTokens(e,t)},K.parseInline=fa.parseInline,K.Parser=ua,K.parser=ua.parse,K.Renderer=ca,K.TextRenderer=la,K.Lexer=sa,K.lexer=sa.lex,K.Tokenizer=oa,K.Hooks=da,K.parse=K,K.options,K.setOptions,K.use,K.walkTokens,K.parseInline,ua.parse,sa.lex;var pa=new Set([`script`,`iframe`,`object`,`embed`,`style`,`link`,`meta`]),ma=new Set([`script`,`iframe`,`object`,`embed`,`link`,`meta`]);function ha(e){let t=new DOMParser().parseFromString(e,`text/html`);return _a(t.body,pa),t.body.innerHTML}function ga(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`).documentElement;return t.tagName===`parsererror`||t.querySelector(`parsererror`)?``:(_a(t,ma),new XMLSerializer().serializeToString(t))}function _a(e,t){let n=[];for(let r of e.childNodes)if(r.nodeType===Node.ELEMENT_NODE){let e=r,i=e.tagName.toLowerCase();if(t.has(i)){n.push(r);continue}for(let t of Array.from(e.attributes)){t.name.toLowerCase().startsWith(`on`)&&e.removeAttribute(t.name);let n=t.value.trim().toLowerCase();(n.startsWith(`javascript:`)||n.startsWith(`data:text/html`))&&e.removeAttribute(t.name)}_a(r,t)}for(let t of n)e.removeChild(t)}K.setOptions({breaks:!0,gfm:!0});function va(e){switch(e.type){case`user-prompt`:return{label:`You`,text:(e.content.split(`
|
|
84
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(`
|
|
85
|
-
`).find(e=>e.trim())||``).slice(0,100)};case`tool-call`:return{label:e.toolName,text:e.diff?.filePath||e.bashOutput?.command||Object.values(e.input).filter(e=>typeof e==`string`).join(`, `).slice(0,80)||``}}}function _a(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 va({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]?ga(t[w]):null,A=w!==null&&t[w]?_a(t[w]):``;return(0,H.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-terminal-border-subtle`,children:[(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest`,children:`Comments`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o&&(0,H.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,H.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim`,children:s.length})]})]}),(0,H.jsxs)(`div`,{ref:S,className:`flex-1 overflow-y-auto`,children:[T.length===0&&w===null&&(0,H.jsxs)(`div`,{className:`px-3 py-8 text-center`,children:[(0,H.jsx)(`div`,{className:`text-terminal-dim text-xs font-mono mb-2`,children:`No comments yet`}),!o&&(0,H.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,H.jsx)(ya,{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,H.jsxs)(`div`,{ref:C,className:`px-3 py-2.5 border-b border-terminal-border-subtle bg-terminal-blue-subtle`,children:[k&&(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 mb-2`,children:[(0,H.jsx)(`span`,{className:`text-xs font-mono font-semibold uppercase ${A}`,children:k.label}),(0,H.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim truncate`,children:k.text})]}),(0,H.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,H.jsxs)(`div`,{className:`flex items-center justify-between mt-1.5`,children:[(0,H.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:[`⌘`,`+Enter to save`]}),(0,H.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,H.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,H.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 ya=(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?ga(t):null,g=t?_a(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,H.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,H.jsx)(`div`,{className:`flex items-center gap-1.5 mb-1`,children:(0,H.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,H.jsxs)(`button`,{onClick:o,className:`flex items-center gap-1.5 mb-1 w-full text-left group/ref`,children:[h&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`text-xs font-mono font-semibold uppercase shrink-0 ${g}`,children:h.label}),(0,H.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim truncate group-hover/ref:text-terminal-text transition-colors`,children:h.text})]}),!h&&(0,H.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dim`,children:[`Step `,e.sceneIndex+1]})]}),(0,H.jsxs)(`div`,{className:`flex items-start gap-1`,children:[(0,H.jsx)(`div`,{className:`flex-1 min-w-0`,children:r?(0,H.jsxs)(`div`,{children:[(0,H.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,H.jsxs)(`div`,{className:`flex justify-end gap-1.5 mt-1`,children:[(0,H.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,H.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,H.jsx)(`div`,{className:`prose-terminal text-xs text-terminal-text leading-relaxed`,dangerouslySetInnerHTML:{__html:pa(q.parse(e.body))}})}),!f&&p&&!r&&(0,H.jsxs)(`div`,{className:`flex gap-0.5 shrink-0 pt-0.5`,children:[(0,H.jsx)(`button`,{onClick:s,className:`p-0.5 text-xs text-terminal-dim hover:text-terminal-blue transition-colors`,title:`Edit`,children:`✎`}),(0,H.jsx)(`button`,{onClick:d,className:`p-0.5 text-xs text-terminal-dim hover:text-terminal-red transition-colors`,title:`Delete`,children:`✕`})]})]}),(0,H.jsx)(`div`,{className:`text-xs font-mono text-terminal-dimmer mt-1`,children:v})]})});function ba({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,H.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,H.jsx)(`div`,{className:`absolute inset-0 bg-black/30`,onClick:t}),(0,H.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,H.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,H.jsx)(va,{actions:n,scenes:r,currentIndex:i,onSeek:a,addingForScene:o,onClearAddingTarget:s,readOnly:c})]})]})}var xa=[1,5,10];function Sa({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,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex md:hidden items-center justify-between px-3 py-1.5`,children:[(0,H.jsx)(`button`,{onClick:()=>{y(`play`),o()},className:`${S} bg-terminal-green-subtle text-terminal-green ${b(`play`)}`,title:`Play/Pause`,children:(0,H.jsx)(`span`,{className:`text-base`,children:m})}),(0,H.jsx)(`button`,{onClick:()=>{y(`prev`),c()},className:`${S} bg-terminal-surface text-terminal-text ${b(`prev`)}`,title:`Previous turn`,children:(0,H.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,H.jsx)(`path`,{d:`M15 18l-6-6 6-6`})})}),(0,H.jsxs)(`span`,{className:`text-xs font-mono text-terminal-text tabular-nums font-medium`,children:[a,` / `,i]}),(0,H.jsx)(`button`,{onClick:()=>{y(`next`),l()},className:`${S} bg-terminal-surface text-terminal-text ${b(`next`)}`,title:`Next turn`,children:(0,H.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,H.jsx)(`path`,{d:`M9 18l6-6-6-6`})})}),(0,H.jsx)(`button`,{onClick:()=>{y(`search`),u()},className:`${S} bg-terminal-surface text-terminal-text ${b(`search`)}`,title:`Search`,children:(0,H.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,H.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,H.jsx)(`path`,{d:`m21 21-4.35-4.35`})]})}),d&&(0,H.jsx)(`button`,{onClick:()=>{y(`outline`),d()},className:`${S} bg-terminal-surface border border-terminal-border text-terminal-text ${b(`outline`)}`,title:`Outline`,children:`☰`})]}),(0,H.jsxs)(`div`,{className:`hidden md:flex items-center justify-between px-5 py-2.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.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,H.jsx)(`span`,{children:m}),(0,H.jsx)(`span`,{className:`ml-1.5`,children:h})]}),(0,H.jsx)(`div`,{className:`flex items-center rounded-lg bg-terminal-surface overflow-hidden`,children:xa.map(e=>(0,H.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,H.jsxs)(`div`,{className:`flex items-center`,children:[(0,H.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,H.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,H.jsx)(`span`,{className:`font-mono`,children:a}),(0,H.jsx)(`span`,{children:`/`}),(0,H.jsx)(`span`,{className:`font-mono`,children:i})]}),(0,H.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,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.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,H.jsx)(`span`,{className:`text-sm opacity-70 group-hover/search:opacity-100 transition-opacity`,children:`🔍`}),(0,H.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,H.jsx)(`div`,{className:`flex items-center gap-1 ml-1 opacity-40 group-hover/search:opacity-80 transition-opacity`,children:(0,H.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,H.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,H.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,H.jsx)(`span`,{className:`text-[11px] font-mono font-black`,children:`?`})}),(0,H.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,H.jsxs)(`div`,{className:`flex items-center gap-2 md:gap-3 text-xs text-terminal-dim font-mono shrink-0`,children:[e===`paused`&&(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-orange`,children:`Paused`}),(0,H.jsxs)(`span`,{className:`tabular-nums`,children:[Math.max(0,n+1),` / `,r]})]})]})]})]})}function Ca(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 wa(e){let t=Ca(e);return t?`${t.server} · ${t.tool}`:e}var Ta=3,Ea=(0,_.memo)(function({content:e,isActive:t}){let[n,r]=(0,_.useState)(!1),i=e.split(`
|
|
86
|
-
`),a=i.length>
|
|
87
|
-
`):e;return(0,H.jsxs)(`div`,{children:[(0,H.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,H.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,H.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)`})]})}),Da=600,Oa=(0,_.memo)(function({content:e,isActive:t}){let n=e.length>Da,[r,i]=(0,_.useState)(!1),a=n&&!r?`${e.slice(0,Da)}...`:e,o=(0,_.useMemo)(()=>pa(q.parse(a)),[a]);return(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`prose-terminal text-sm text-terminal-text ${t?`typing-cursor`:``} ${n&&!r?`max-h-[200px] overflow-hidden relative`:``}`,children:[(0,H.jsx)(`div`,{dangerouslySetInnerHTML:{__html:o}}),n&&!r&&(0,H.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-terminal-bg to-transparent`})]}),n&&(0,H.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)`})]})}),ka=(0,_.memo)(function({content:e,isActive:t,tokens:n}){let[r,i]=(0,_.useState)(!1),a=Re(n);return(0,H.jsxs)(`div`,{className:`ml-6`,children:[(0,H.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,H.jsx)(`span`,{className:`transition-transform ${r?`rotate-90`:``}`,children:`▶`}),(0,H.jsx)(`span`,{className:`text-terminal-purple ${t?`animate-pulse`:``}`,children:`Thinking`}),a?(0,H.jsxs)(`span`,{className:`text-terminal-purple/70 text-[10px]`,title:`Approximate thinking tokens (chars/4)`,children:[`~`,a,` tok`]}):(0,H.jsxs)(`span`,{className:`text-terminal-purple/70 text-[10px]`,children:[e.length,` chars`]})]}),r&&(0,H.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 Aa(){return(0,H.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 ja({ms:e}){let t=Le(e);return t?(0,H.jsx)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`Tool execution: ${t}`,children:t}):null}function Ma({tokens:e}){let t=Re(e);return t?(0,H.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 Na=(0,_.memo)(function({command:e,stdout:t,isActive:n,durationMs:r,resultTokens:i,isError:a}){let[o,s]=(0,_.useState)(!0),c=t.trim().length>0,l=Re(i),u=Le(r);return(0,H.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,H.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,H.jsx)(`span`,{className:`text-xs font-mono font-bold ${a?`text-red-400`:`text-terminal-orange`}`,children:`$`}),(0,H.jsx)(`span`,{className:`text-xs font-mono text-terminal-text truncate flex-1`,children:e}),a&&(0,H.jsx)(Aa,{}),l&&(0,H.jsxs)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`~${l} tokens added to context`,children:[`~`,l,` tok`]}),u&&(0,H.jsx)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`Execution: ${u}`,children:u}),c&&(0,H.jsx)(`span`,{className:`text-xs text-terminal-dim transition-transform ${o?`rotate-90`:``}`,children:`▶`})]}),o&&c&&(0,H.jsx)(`div`,{className:`px-3 py-2 max-h-[300px] overflow-y-auto`,children:(0,H.jsx)(`pre`,{className:`text-xs font-mono text-terminal-dim whitespace-pre-wrap break-words`,children:t})})]})});function Pa(){}Pa.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={});var i=this;function a(e){return e=i.postProcess(e,n),r?(setTimeout(function(){r(e)},0),!0):e}e=this.castInput(e,n),t=this.castInput(t,n),e=this.removeEmpty(this.tokenize(e,n)),t=this.removeEmpty(this.tokenize(t,n));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength!=null&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0,n);if(f[0].oldPos+1>=s&&p+1>=o)return a(Fa(i,f[0].lastComponent,t,e,i.useLongestToken));var m=-1/0,h=1/0;function g(){for(var r=Math.max(m,-c);r<=Math.min(h,c);r+=2){var l=void 0,u=f[r-1],d=f[r+1];u&&(f[r-1]=void 0);var g=!1;if(d){var _=d.oldPos-r;g=d&&0<=_&&_<o}var v=u&&u.oldPos+1<s;if(!g&&!v){f[r]=void 0;continue}if(l=!v||g&&u.oldPos<d.oldPos?i.addToPath(d,!0,!1,0,n):i.addToPath(u,!1,!0,1,n),p=i.extractCommon(l,t,e,r,n),l.oldPos+1>=s&&p+1>=o)return a(Fa(i,l.lastComponent,t,e,i.useLongestToken));f[r]=l,l.oldPos+1>=s&&(h=Math.min(h,r-1)),p+1>=o&&(m=Math.max(m,r+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r,i){var a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}},extractCommon:function(e,t,n,r,i){for(var a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c},equals:function(e,t,n){return n.comparator?n.comparator(e,t):e===t||n.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return Array.from(e)},join:function(e){return e.join(``)},postProcess:function(e){return e}};function Fa(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(d.removed)d.value=e.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}}return a}new Pa;function Ia(e,t){var n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function La(e,t){var n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function Ra(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function za(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function Ba(e,t){return Ra(e,t,``)}function Va(e,t){return za(e,t,``)}function Ha(e,t){return t.slice(0,Ua(e,t))}function Ua(e,t){var n=0;e.length>t.length&&(n=e.length-t.length);var r=t.length;e.length<t.length&&(r=e.length);var i=Array(r),a=0;i[0]=0;for(var o=1;o<r;o++){for(t[o]==t[a]?i[o]=i[a]:i[o]=a;a>0&&t[o]!=t[a];)a=i[a];t[o]==t[a]&&a++}a=0;for(var s=n;s<e.length;s++){for(;a>0&&e[s]!=t[a];)a=i[a];e[s]==t[a]&&a++}return a}var Wa=`a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,Ga=RegExp(`[${Wa}]+|\\s+|[^${Wa}]`,`ug`),Ka=new Pa;Ka.equals=function(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()},Ka.tokenize=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n;if(t.intlSegmenter){if(t.intlSegmenter.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=Array.from(t.intlSegmenter.segment(e),function(e){return e.segment})}else n=e.match(Ga)||[];var r=[],i=null;return n.forEach(function(e){/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r},Ka.join=function(e){return e.map(function(e,t){return t==0?e:e.replace(/^\s+/,``)}).join(``)},Ka.postProcess=function(e,t){if(!e||t.oneChangePerToken)return e;var n=null,r=null,i=null;return e.forEach(function(e){e.added?r=e:e.removed?i=e:((r||i)&&qa(n,i,r,e),n=e,r=null,i=null)}),(r||i)&&qa(n,i,r,null),e};function qa(e,t,n,r){if(t&&n){var i=t.value.match(/^\s*/)[0],a=t.value.match(/\s*$/)[0],o=n.value.match(/^\s*/)[0],s=n.value.match(/\s*$/)[0];if(e){var c=Ia(i,o);e.value=za(e.value,o,c),t.value=Ba(t.value,c),n.value=Ba(n.value,c)}if(r){var l=La(a,s);r.value=Ra(r.value,s,l),t.value=Va(t.value,l),n.value=Va(n.value,l)}}else if(n)e&&(n.value=n.value.replace(/^\s*/,``)),r&&(r.value=r.value.replace(/^\s*/,``));else if(e&&r){var u=r.value.match(/^\s*/)[0],d=t.value.match(/^\s*/)[0],f=t.value.match(/\s*$/)[0],p=Ia(u,d);t.value=Ba(t.value,p);var m=La(Ba(u,p),f);t.value=Va(t.value,m),r.value=Ra(r.value,u,m),e.value=za(e.value,u,u.slice(0,u.length-m.length))}else if(r){var h=r.value.match(/^\s*/)[0],g=t.value.match(/\s*$/)[0],_=Ha(g,h);t.value=Va(t.value,_)}else if(e){var v=e.value.match(/\s*$/)[0],y=t.value.match(/^\s*/)[0],b=Ha(v,y);t.value=Ba(t.value,b)}}var Ja=new Pa;Ja.tokenize=function(e){var t=RegExp(`(\\r?\\n)|[${Wa}]+|[^\\S\\n\\r]+|[^${Wa}]`,`ug`);return e.match(t)||[]};var Ya=new Pa;Ya.tokenize=function(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
88
|
-
`));var n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var i=0;i<r.length;i++){var a=r[i];i%2&&!t.newlineIsToken?n[n.length-1]+=a:n.push(a)}return n},
|
|
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 ya(e){switch(e.type){case`user-prompt`:return`text-terminal-green`;case`compaction-summary`:return`text-terminal-dim`;case`context-injection`:return`text-blue-400`;case`thinking`:return`text-terminal-purple`;case`text-response`:return`text-terminal-blue`;case`tool-call`:return`text-terminal-orange`}}function ba({actions:e,scenes:t,currentIndex:n,onSeek:r,addingForScene:i,onClearAddingTarget:a,readOnly:o=!1}){let{annotations:s,add:c,update:l,remove:u}=e,[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(``),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(``),b=(0,_.useRef)(null),x=(0,_.useRef)(null),S=(0,_.useRef)(null),C=(0,_.useRef)(null),w=i??d;(0,_.useEffect)(()=>{i!==null&&(m(``),f(null),setTimeout(()=>{C.current?.scrollIntoView({behavior:`smooth`,block:`nearest`}),b.current?.focus()},50))},[i]),(0,_.useEffect)(()=>{w!==null&&b.current&&b.current.focus()},[w]),(0,_.useEffect)(()=>{h&&x.current&&x.current.focus()},[h]);let T=(0,_.useMemo)(()=>[...s].sort((e,t)=>e.sceneIndex-t.sceneIndex),[s]);(0,_.useEffect)(()=>{if(!S.current||w!==null)return;let e=S.current.querySelectorAll(`[data-annotation-scene]`),t=null,r=1/0;e.forEach(e=>{let i=Number(e.getAttribute(`data-annotation-scene`)),a=Math.abs(i-n);a<r&&(r=a,t=e)}),t&&r<=3&&t.scrollIntoView({behavior:`smooth`,block:`nearest`})},[n,w]);let E=(0,_.useCallback)(()=>{f(null),m(``),a()},[a]),D=(0,_.useCallback)(()=>{!p.trim()||w===null||(c(w,p.trim()),m(``),f(null),a())},[c,w,p,a]),O=(0,_.useCallback)(()=>{!h||!v.trim()||(l(h,v.trim()),g(null),y(``))},[h,v,l]),k=w!==null&&t[w]?va(t[w]):null,A=w!==null&&t[w]?ya(t[w]):``;return(0,V.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-terminal-border-subtle`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest`,children:`Comments`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o&&(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer uppercase px-1.5 py-0.5 rounded bg-terminal-surface`,children:`Read-only`}),(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim`,children:s.length})]})]}),(0,V.jsxs)(`div`,{ref:S,className:`flex-1 overflow-y-auto`,children:[T.length===0&&w===null&&(0,V.jsxs)(`div`,{className:`px-3 py-8 text-center`,children:[(0,V.jsx)(`div`,{className:`text-terminal-dim text-xs font-mono mb-2`,children:`No comments yet`}),!o&&(0,V.jsx)(`div`,{className:`text-terminal-dimmer text-xs font-mono`,children:`Hover over any message and click the comment icon to add one`})]}),T.map(e=>(0,V.jsx)(xa,{annotation:e,scene:t[e.sceneIndex],isCurrent:e.sceneIndex===n,isEditing:!o&&h===e.id,editBody:h===e.id?v:``,editTextareaRef:h===e.id?x:void 0,onSeek:()=>r(e.sceneIndex),onStartEdit:()=>{g(e.id),y(e.body)},onCancelEdit:()=>{g(null),y(``)},onSaveEdit:O,onEditBodyChange:y,onDelete:()=>u(e.id),readOnly:o},e.id)),!o&&w!==null&&(0,V.jsxs)(`div`,{ref:C,className:`px-3 py-2.5 border-b border-terminal-border-subtle bg-terminal-blue-subtle`,children:[k&&(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 mb-2`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono font-semibold uppercase ${A}`,children:k.label}),(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim truncate`,children:k.text})]}),(0,V.jsx)(`textarea`,{ref:b,value:p,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),D()),e.key===`Escape`&&E()},placeholder:`Add a comment... (Markdown supported)`,className:`w-full bg-terminal-surface rounded px-2 py-1.5 text-xs font-mono text-terminal-text placeholder-terminal-dimmer resize-none focus:outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-blue/40 transition-shadow duration-200`,rows:3}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between mt-1.5`,children:[(0,V.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:[`⌘`,`+Enter to save`]}),(0,V.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,V.jsx)(`button`,{onClick:E,className:`px-2 py-1 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`}),(0,V.jsx)(`button`,{onClick:D,disabled:!p.trim(),className:`px-2 py-1 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue rounded hover:bg-terminal-blue-emphasis transition-colors disabled:opacity-40`,children:`Comment`})]})]})]})]})]})}var xa=(0,_.memo)(function({annotation:e,scene:t,isCurrent:n,isEditing:r,editBody:i,editTextareaRef:a,onSeek:o,onStartEdit:s,onCancelEdit:c,onSaveEdit:l,onEditBodyChange:u,onDelete:d,readOnly:f=!1}){let[p,m]=(0,_.useState)(!1),h=t?va(t):null,g=t?ya(t):`text-terminal-dim`,v=(0,_.useMemo)(()=>{try{return new Date(e.createdAt).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}catch{return``}},[e.createdAt]),y=e.author===`vibe-feedback`;return(0,V.jsxs)(`div`,{"data-annotation-scene":e.sceneIndex,className:`px-3 py-2 border-b border-terminal-border-subtle transition-colors ${y?n?`bg-terminal-purple/10 border-l-2 border-l-terminal-purple`:`bg-terminal-purple/[0.03] hover:bg-terminal-purple/[0.06]`:n?`bg-terminal-blue/10 border-l-2 border-l-terminal-blue`:`hover:bg-terminal-surface/50`}`,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),children:[y&&(0,V.jsx)(`div`,{className:`flex items-center gap-1.5 mb-1`,children:(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-purple px-2 py-0.5 rounded-full bg-terminal-purple-subtle`,children:`AI Coach`})}),(0,V.jsxs)(`button`,{onClick:o,className:`flex items-center gap-1.5 mb-1 w-full text-left group/ref`,children:[h&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-xs font-mono font-semibold uppercase shrink-0 ${g}`,children:h.label}),(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-dim truncate group-hover/ref:text-terminal-text transition-colors`,children:h.text})]}),!h&&(0,V.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dim`,children:[`Step `,e.sceneIndex+1]})]}),(0,V.jsxs)(`div`,{className:`flex items-start gap-1`,children:[(0,V.jsx)(`div`,{className:`flex-1 min-w-0`,children:r?(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`textarea`,{ref:a,value:i,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),l()),e.key===`Escape`&&c()},className:`w-full bg-terminal-surface rounded px-2 py-1.5 text-xs font-mono text-terminal-text resize-none focus:outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-blue/40 transition-shadow duration-200`,rows:3}),(0,V.jsxs)(`div`,{className:`flex justify-end gap-1.5 mt-1`,children:[(0,V.jsx)(`button`,{onClick:c,className:`px-2 py-0.5 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors`,children:`Cancel`}),(0,V.jsx)(`button`,{onClick:l,className:`px-2 py-0.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue rounded hover:bg-terminal-blue-emphasis transition-colors`,children:`Save`})]})]}):(0,V.jsx)(`div`,{className:`prose-terminal text-xs text-terminal-text leading-relaxed`,dangerouslySetInnerHTML:{__html:ha(K.parse(e.body))}})}),!f&&p&&!r&&(0,V.jsxs)(`div`,{className:`flex gap-0.5 shrink-0 pt-0.5`,children:[(0,V.jsx)(`button`,{onClick:s,className:`p-0.5 text-xs text-terminal-dim hover:text-terminal-blue transition-colors`,title:`Edit`,children:`✎`}),(0,V.jsx)(`button`,{onClick:d,className:`p-0.5 text-xs text-terminal-dim hover:text-terminal-red transition-colors`,title:`Delete`,children:`✕`})]})]}),(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-dimmer mt-1`,children:v})]})});function Sa({open:e,onClose:t,actions:n,scenes:r,currentIndex:i,onSeek:a,addingForScene:o,onClearAddingTarget:s,readOnly:c}){return(0,_.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&(e.preventDefault(),t())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),(0,V.jsxs)(`div`,{className:`fixed inset-0 z-50 hidden md:block transition-opacity duration-300 ${e?`opacity-100`:`opacity-0 pointer-events-none`}`,children:[(0,V.jsx)(`div`,{className:`absolute inset-0 bg-black/30`,onClick:t}),(0,V.jsxs)(`div`,{className:`absolute top-0 right-0 bottom-0 w-80 bg-terminal-bg border-l border-terminal-border-subtle shadow-layer-xl flex flex-col transition-transform duration-300 ease-material-decel ${e?`translate-x-0`:`translate-x-full`}`,onClick:e=>e.stopPropagation(),children:[(0,V.jsx)(`button`,{onClick:t,className:`absolute top-2 right-2 z-10 p-1 text-terminal-dim hover:text-terminal-text transition-colors`,title:`Close comments`,children:`✕`}),(0,V.jsx)(ba,{actions:n,scenes:r,currentIndex:i,onSeek:a,addingForScene:o,onClearAddingTarget:s,readOnly:c})]})]})}var Ca=[1,5,10];function wa({state:e,speed:t,currentIndex:n,totalScenes:r,userPromptCount:i,currentTurn:a,onTogglePlayPause:o,onChangeSpeed:s,onPrevPrompt:c,onNextPrompt:l,onOpenSearch:u,onOpenOutline:d,onShowHelp:f}){let p=e===`playing`,m=p?`⏸`:`▶`,h=p?`Pause`:`Play`,[g,v]=(0,_.useState)(null),y=(0,_.useCallback)(e=>{v(e),setTimeout(()=>v(null),300)},[]),b=e=>g===e?`scale-105`:``,x=`px-2.5 py-1.5 text-xs font-sans rounded-lg transition-all duration-200 ease-material`,S=`w-10 h-10 flex items-center justify-center rounded-lg transition-all duration-200 ease-material`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`flex md:hidden items-center justify-between px-3 py-1.5`,children:[(0,V.jsx)(`button`,{onClick:()=>{y(`play`),o()},className:`${S} bg-terminal-green-subtle text-terminal-green ${b(`play`)}`,title:`Play/Pause`,children:(0,V.jsx)(`span`,{className:`text-base`,children:m})}),(0,V.jsx)(`button`,{onClick:()=>{y(`prev`),c()},className:`${S} bg-terminal-surface text-terminal-text ${b(`prev`)}`,title:`Previous turn`,children:(0,V.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,V.jsx)(`path`,{d:`M15 18l-6-6 6-6`})})}),(0,V.jsxs)(`span`,{className:`text-xs font-mono text-terminal-text tabular-nums font-medium`,children:[a,` / `,i]}),(0,V.jsx)(`button`,{onClick:()=>{y(`next`),l()},className:`${S} bg-terminal-surface text-terminal-text ${b(`next`)}`,title:`Next turn`,children:(0,V.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,V.jsx)(`path`,{d:`M9 18l6-6-6-6`})})}),(0,V.jsx)(`button`,{onClick:()=>{y(`search`),u()},className:`${S} bg-terminal-surface text-terminal-text ${b(`search`)}`,title:`Search`,children:(0,V.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,V.jsx)(`path`,{d:`m21 21-4.35-4.35`})]})}),d&&(0,V.jsx)(`button`,{onClick:()=>{y(`outline`),d()},className:`${S} bg-terminal-surface border border-terminal-border text-terminal-text ${b(`outline`)}`,title:`Outline`,children:`☰`})]}),(0,V.jsxs)(`div`,{className:`hidden md:flex items-center justify-between px-5 py-2.5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(`button`,{onClick:()=>{y(`play`),o()},className:`${x} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis font-medium ${b(`play`)}`,title:`Play/Pause (Space)`,children:[(0,V.jsx)(`span`,{children:m}),(0,V.jsx)(`span`,{className:`ml-1.5`,children:h})]}),(0,V.jsx)(`div`,{className:`flex items-center rounded-lg bg-terminal-surface overflow-hidden`,children:Ca.map(e=>(0,V.jsxs)(`button`,{onClick:()=>{y(`speed-${e}`),s(e)},className:`px-2.5 py-1.5 text-xs font-mono transition-all duration-200 ease-material ${t===e?`bg-terminal-green-subtle text-terminal-green font-medium`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`} ${b(`speed-${e}`)}`,children:[e,`x`]},e))}),(0,V.jsxs)(`div`,{className:`flex items-center`,children:[(0,V.jsx)(`button`,{onClick:()=>{y(`prev`),c()},className:`${x} text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover ${b(`prev`)}`,title:`Previous turn (p)`,children:`‹`}),(0,V.jsxs)(`span`,{className:`px-1.5 py-1.5 text-xs font-sans text-terminal-dim tabular-nums flex items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`font-mono`,children:a}),(0,V.jsx)(`span`,{children:`/`}),(0,V.jsx)(`span`,{className:`font-mono`,children:i})]}),(0,V.jsx)(`button`,{onClick:()=>{y(`next`),l()},className:`${x} text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover ${b(`next`)}`,title:`Next turn (n)`,children:`›`})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(`button`,{onClick:()=>{y(`search`),u()},className:`h-8 flex-grow flex items-center gap-3 px-3 rounded-lg bg-terminal-surface/20 border border-terminal-border-subtle hover:border-terminal-blue/40 hover:bg-terminal-blue-subtle/20 group/search transition-all duration-200 max-w-sm ${b(`search`)}`,title:`Search (/ or Cmd+K)`,children:[(0,V.jsx)(`span`,{className:`text-sm opacity-70 group-hover/search:opacity-100 transition-opacity`,children:`🔍`}),(0,V.jsx)(`span`,{className:`text-[11px] font-sans font-medium text-terminal-dim group-hover/search:text-terminal-blue transition-colors`,children:`Type / to search`}),(0,V.jsx)(`div`,{className:`flex items-center gap-1 ml-1 opacity-40 group-hover/search:opacity-80 transition-opacity`,children:(0,V.jsx)(`span`,{className:`px-1 py-0.5 rounded bg-terminal-surface border border-terminal-border/50 text-[9px] font-mono font-bold text-terminal-text`,children:`/`})})]}),f&&(0,V.jsxs)(`button`,{onClick:()=>{y(`help`),f()},className:`flex items-center gap-2.5 px-3 py-1.5 rounded-lg text-terminal-dimmer hover:text-terminal-text hover:bg-terminal-surface-hover group/help transition-all duration-200 ${b(`help`)}`,title:`Keyboard Shortcuts (?)`,children:[(0,V.jsx)(`div`,{className:`flex items-center justify-center w-5 h-5 rounded border border-terminal-border-subtle/50 bg-terminal-surface group-hover/help:border-terminal-text group-hover/help:text-terminal-bg group-hover/help:bg-terminal-text transition-all duration-200`,children:(0,V.jsx)(`span`,{className:`text-[11px] font-mono font-black`,children:`?`})}),(0,V.jsx)(`span`,{className:`hidden lg:inline text-[10px] font-sans font-bold uppercase tracking-widest opacity-60 group-hover/help:opacity-100`,children:`Press ? for help`})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 md:gap-3 text-xs text-terminal-dim font-mono shrink-0`,children:[e===`paused`&&(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-orange`,children:`Paused`}),(0,V.jsxs)(`span`,{className:`tabular-nums`,children:[Math.max(0,n+1),` / `,r]})]})]})]})]})}function Ta(e){if(!e.startsWith(`mcp__`))return null;let t=e.split(`__`);return t.length<3?null:{server:t[1],tool:t.slice(2).join(`__`)}}function Ea(e){let t=Ta(e);return t?`${t.server} · ${t.tool}`:e}var Da=3,Oa=(0,_.memo)(function({content:e,isActive:t}){let[n,r]=(0,_.useState)(!1),i=e.split(`
|
|
87
|
+
`),a=i.length>Da;(0,_.useEffect)(()=>{if(!t)return;let e=e=>{let t=e.detail;t.action===`expand`?r(!0):t.action===`collapse`&&r(!1)};return window.addEventListener(`vibe:toggle-expand`,e),()=>window.removeEventListener(`vibe:toggle-expand`,e)},[t]);let o=a&&!n?i.slice(0,Da).join(`
|
|
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)`})]})}),ka=600,Aa=(0,_.memo)(function({content:e,isActive:t}){let n=e.length>ka,[r,i]=(0,_.useState)(!1),a=n&&!r?`${e.slice(0,ka)}...`:e,o=(0,_.useMemo)(()=>ha(K.parse(a)),[a]);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`prose-terminal text-sm text-terminal-text ${t?`typing-cursor`:``} ${n&&!r?`max-h-[200px] overflow-hidden relative`:``}`,children:[(0,V.jsx)(`div`,{dangerouslySetInnerHTML:{__html:o}}),n&&!r&&(0,V.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-terminal-bg to-transparent`})]}),n&&(0,V.jsx)(`button`,{onClick:()=>i(!r),className:`mt-1 text-xs font-mono text-terminal-blue hover:text-terminal-text transition-colors`,children:r?`Show less`:`Show more (${e.length} chars)`})]})}),ja=(0,_.memo)(function({content:e,isActive:t,tokens:n}){let[r,i]=(0,_.useState)(!1),a=ze(n);return(0,V.jsxs)(`div`,{className:`ml-6`,children:[(0,V.jsxs)(`button`,{onClick:()=>i(!r),className:`flex items-center gap-2 text-xs text-terminal-dim hover:text-terminal-text transition-colors duration-200 ease-material font-mono`,children:[(0,V.jsx)(`span`,{className:`transition-transform ${r?`rotate-90`:``}`,children:`▶`}),(0,V.jsx)(`span`,{className:`text-terminal-purple ${t?`animate-pulse`:``}`,children:`Thinking`}),a?(0,V.jsxs)(`span`,{className:`text-terminal-purple/70 text-[10px]`,title:`Approximate thinking tokens (chars/4)`,children:[`~`,a,` tok`]}):(0,V.jsxs)(`span`,{className:`text-terminal-purple/70 text-[10px]`,children:[e.length,` chars`]})]}),r&&(0,V.jsx)(`div`,{className:`mt-2 pl-5 text-xs text-terminal-dim font-mono whitespace-pre-wrap break-words border-l-2 border-terminal-purple/30 max-h-[300px] overflow-y-auto`,children:e})]})});function Ma(){return(0,V.jsx)(`span`,{className:`text-[10px] font-mono font-bold px-1.5 py-0.5 rounded bg-red-500/20 text-red-400 border border-red-500/30 shrink-0`,title:`This tool call returned an error`,children:`ERROR`})}function Na({ms:e}){let t=Re(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 Pa({tokens:e}){let t=ze(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 Fa=(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=ze(i),u=Re(r);return(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl overflow-hidden shadow-layer-sm ${a?`ring-1 ring-red-500/40 border-l-2 border-l-red-500`:``}`,children:[(0,V.jsxs)(`button`,{onClick:()=>c&&s(!o),className:`w-full flex items-center gap-2 px-3 py-2 hover:bg-terminal-surface-hover transition-colors duration-200 ease-material text-left ${a?`bg-red-500/5`:``}`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono font-bold ${a?`text-red-400`:`text-terminal-orange`}`,children:`$`}),(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-text truncate flex-1`,children:e}),a&&(0,V.jsx)(Ma,{}),l&&(0,V.jsxs)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`~${l} tokens added to context`,children:[`~`,l,` tok`]}),u&&(0,V.jsx)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`Execution: ${u}`,children:u}),c&&(0,V.jsx)(`span`,{className:`text-xs text-terminal-dim transition-transform ${o?`rotate-90`:``}`,children:`▶`})]}),o&&c&&(0,V.jsx)(`div`,{className:`px-3 py-2 max-h-[300px] overflow-y-auto`,children:(0,V.jsx)(`pre`,{className:`text-xs font-mono text-terminal-dim whitespace-pre-wrap break-words`,children:t})})]})});function Ia(){}Ia.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(La(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(La(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 La(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 Ia;function Ra(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 za(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 Ba(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 Va(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 Ha(e,t){return Ba(e,t,``)}function Ua(e,t){return Va(e,t,``)}function Wa(e,t){return t.slice(0,Ga(e,t))}function Ga(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 Ka=`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}`,qa=RegExp(`[${Ka}]+|\\s+|[^${Ka}]`,`ug`),Ja=new Ia;Ja.equals=function(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()},Ja.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(qa)||[];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},Ja.join=function(e){return e.map(function(e,t){return t==0?e:e.replace(/^\s+/,``)}).join(``)},Ja.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)&&Ya(n,i,r,e),n=e,r=null,i=null)}),(r||i)&&Ya(n,i,r,null),e};function Ya(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=Ra(i,o);e.value=Va(e.value,o,c),t.value=Ha(t.value,c),n.value=Ha(n.value,c)}if(r){var l=za(a,s);r.value=Ba(r.value,s,l),t.value=Ua(t.value,l),n.value=Ua(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=Ra(u,d);t.value=Ha(t.value,p);var m=za(Ha(u,p),f);t.value=Ua(t.value,m),r.value=Ba(r.value,u,m),e.value=Va(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],_=Wa(g,h);t.value=Ua(t.value,_)}else if(e){var v=e.value.match(/\s*$/)[0],y=t.value.match(/^\s*/)[0],b=Wa(v,y);t.value=Ha(t.value,b)}}var Xa=new Ia;Xa.tokenize=function(e){var t=RegExp(`(\\r?\\n)|[${Ka}]+|[^\\S\\n\\r]+|[^${Ka}]`,`ug`);return e.match(t)||[]};var Za=new Ia;Za.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},Za.equals=function(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
89
90
|
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
90
91
|
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
91
92
|
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
92
|
-
`)&&(t=t.slice(0,-1))),Pa.prototype.equals.call(this,e,t,n)};function Xa(e,t,n){return Ya.diff(e,t,n)}var Za=new Pa;Za.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Qa=new Pa;Qa.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function $a(e){"@babel/helpers - typeof";return $a=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},$a(e)}var eo=new Pa;eo.useLongestToken=!0,eo.tokenize=Ya.tokenize,eo.castInput=function(e,t){var n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(e,t){return t===void 0?n:t}:r;return typeof e==`string`?e:JSON.stringify(to(e,null,null,i),i,` `)},eo.equals=function(e,t,n){return Pa.prototype.equals.call(eo,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)};function to(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i,e));var a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];var o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=to(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),$a(e)===`object`&&e!==null){t.push(e),o={},n.push(o);var s=[],c;for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],o[c]=to(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var no=new Pa;no.tokenize=function(e){return e.slice()},no.join=no.removeEmpty=function(e){return e};function ro(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ro(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function io(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ro(e))&&(r&&(r+=` `),r+=t);return r}var J=io,ao=Object.create,oo=Object.defineProperty,so=Object.defineProperties,co=Object.getOwnPropertyDescriptor,lo=Object.getOwnPropertyDescriptors,uo=Object.getOwnPropertyNames,fo=Object.getOwnPropertySymbols,po=Object.getPrototypeOf,mo=Object.prototype.hasOwnProperty,ho=Object.prototype.propertyIsEnumerable,go=(e,t,n)=>t in e?oo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_o=(e,t)=>{for(var n in t||={})mo.call(t,n)&&go(e,n,t[n]);if(fo)for(var n of fo(t))ho.call(t,n)&&go(e,n,t[n]);return e},vo=(e,t)=>so(e,lo(t)),yo=(e,t)=>{var n={};for(var r in e)mo.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fo)for(var r of fo(e))t.indexOf(r)<0&&ho.call(e,r)&&(n[r]=e[r]);return n},bo=(e,t)=>function(){return t||(0,e[uo(e)[0]])((t={exports:{}}).exports,t),t.exports},xo=(e,t)=>{for(var n in t)oo(e,n,{get:t[n],enumerable:!0})},So=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of uo(t))!mo.call(e,i)&&i!==n&&oo(e,i,{get:()=>t[i],enumerable:!(r=co(t,i))||r.enumerable});return e},Y=((e,t,n)=>(n=e==null?{}:ao(po(e)),So(t||!e||!e.__esModule?oo(n,`default`,{value:e,enumerable:!0}):n,e)))(bo({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,`&`).replace(/</g,`<`).replace(/\u00a0/g,` `)},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,`__id`,{value:++t}),e.__id},clone:function e(t,n){n||={};var i,a;switch(r.util.type(t)){case`Object`:if(a=r.util.objId(t),n[a])return n[a];for(var o in i={},n[a]=i,t)t.hasOwnProperty(o)&&(i[o]=e(t[o],n));return i;case`Array`:return a=r.util.objId(t),n[a]?n[a]:(i=[],n[a]=i,t.forEach(function(t,r){i[r]=e(t,n)}),i);default:return t}},getLanguage:function(t){for(;t;){var n=e.exec(t.className);if(n)return n[1].toLowerCase();t=t.parentElement}return`none`},setLanguage:function(t,n){t.className=t.className.replace(RegExp(e,`gi`),``),t.classList.add(`language-`+n)},isActive:function(e,t,n){for(var r=`no-`+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:n,plaintext:n,text:n,txt:n,extend:function(e,t){var n=r.util.clone(r.languages[e]);for(var i in t)n[i]=t[i];return n},insertBefore:function(e,t,n,i){i||=r.languages;var a=i[e],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==t)for(var c in n)n.hasOwnProperty(c)&&(o[c]=n[c]);n.hasOwnProperty(s)||(o[s]=a[s])}var l=i[e];return i[e]=o,r.languages.DFS(r.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,i,a){a||={};var o=r.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],i||s);var c=t[s],l=r.util.type(c);l===`Object`&&!a[o(c)]?(a[o(c)]=!0,e(c,n,null,a)):l===`Array`&&!a[o(c)]&&(a[o(c)]=!0,e(c,n,s,a))}}},plugins:{},highlight:function(e,t,n){var a={code:e,grammar:t,language:n};if(r.hooks.run(`before-tokenize`,a),!a.grammar)throw Error(`The language "`+a.language+`" has no grammar.`);return a.tokens=r.tokenize(a.code,a.grammar),r.hooks.run(`after-tokenize`,a),i.stringify(r.util.encode(a.tokens),a.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new s;return c(i,i.head,e),o(e,i,t,i.head,0),u(i)},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(!(!n||!n.length))for(var i=0,a;a=n[i++];)a(t)}},Token:i};function i(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}i.stringify=function e(t,n){if(typeof t==`string`)return t;if(Array.isArray(t)){var i=``;return t.forEach(function(t){i+=e(t,n)}),i}var a={type:t.type,content:e(t.content,n),tag:`span`,classes:[`token`,t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(a.classes,o):a.classes.push(o)),r.hooks.run(`wrap`,a);var s=``;for(var c in a.attributes)s+=` `+c+`="`+(a.attributes[c]||``).replace(/"/g,`"`)+`"`;return`<`+a.tag+` class="`+a.classes.join(` `)+`"`+s+`>`+a.content+`</`+a.tag+`>`};function a(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function o(e,t,n,s,u,d){for(var f in n)if(!(!n.hasOwnProperty(f)||!n[f])){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+`,`+m)return;var h=p[m],g=h.inside,_=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var b=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,b+`g`)}for(var x=h.pattern||h,S=s.next,C=u;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var w=S.value;if(t.length>e.length)return;if(!(w instanceof i)){var T=1,E;if(v){if(E=a(x,C,e,_),!E||E.index>=e.length)break;var D=E.index,O=E.index+E[0].length,k=C;for(k+=S.value.length;D>=k;)S=S.next,k+=S.value.length;if(k-=S.value.length,C=k,S.value instanceof i)continue;for(var A=S;A!==t.tail&&(k<O||typeof A.value==`string`);A=A.next)T++,k+=A.value.length;T--,w=e.slice(C,k),E.index-=C}else if(E=a(x,0,w,_),!E)continue;var D=E.index,j=E[0],M=w.slice(0,D),N=w.slice(D+j.length),P=C+w.length;d&&P>d.reach&&(d.reach=P);var ee=S.prev;M&&(ee=c(t,ee,M),C+=M.length),l(t,ee,T);var F=new i(f,g?r.tokenize(j,g):j,y,j);if(S=c(t,ee,F),N&&c(t,S,N),T>1){var I={cause:f+`,`+m,reach:P};o(e,t,n,S.prev,C,I),d&&I.reach>d.reach&&(d.reach=I.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function l(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function u(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}return r}();t.exports=n,n.default=n}})());Y.languages.markup={comment:{pattern:/\x3C!--(?:(?!\x3C!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|\x3C!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},Y.languages.markup.tag.inside[`attr-value`].inside.entity=Y.languages.markup.entity,Y.languages.markup.doctype.inside[`internal-subset`].inside=Y.languages.markup,Y.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&/,`&`))}),Object.defineProperty(Y.languages.markup.tag,`addInlined`,{value:function(e,t){var n={},n=(n[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Y.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),t=(n[`language-`+t]={pattern:/[\s\S]+/,inside:Y.languages[t]},{});t[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:n},Y.languages.insertBefore(`markup`,`cdata`,t)}}),Object.defineProperty(Y.languages.markup.tag,`addAttribute`,{value:function(e,t){Y.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:Y.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),Y.languages.html=Y.languages.markup,Y.languages.mathml=Y.languages.markup,Y.languages.svg=Y.languages.markup,Y.languages.xml=Y.languages.extend(`markup`,{}),Y.languages.ssml=Y.languages.xml,Y.languages.atom=Y.languages.xml,Y.languages.rss=Y.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:`escape`},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r=`(?:[^\\\\-]|`+n.source+`)`,r=RegExp(r+`-`+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:`variable`};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:`operator`},"char-class-punctuation":{pattern:/^\[|\]$/,alias:`punctuation`},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:`operator`}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:`class-name`},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:`class-name`},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:`keyword`},{pattern:/\\k<[^<>']+>/,alias:`keyword`,inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:`function`},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:`punctuation`,inside:{"group-name":i}},{pattern:/\)/,alias:`punctuation`}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:`number`},alternation:{pattern:/\|/,alias:`keyword`}}}(Y),Y.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Y.languages.javascript=Y.languages.extend(`clike`,{"class-name":[Y.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Y.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Y.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:Y.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Y.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Y.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Y.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Y.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Y.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:Y.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),Y.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),Y.languages.markup&&(Y.languages.markup.tag.addInlined(`script`,`javascript`),Y.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),Y.languages.js=Y.languages.javascript,Y.languages.actionscript=Y.languages.extend(`javascript`,{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),Y.languages.actionscript[`class-name`].alias=`function`,delete Y.languages.actionscript.parameter,delete Y.languages.actionscript[`literal-property`],Y.languages.markup&&Y.languages.insertBefore(`actionscript`,`string`,{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:Y.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:`variable`};e.languages.coffeescript=e.languages.extend(`javascript`,{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:`variable`}}),e.languages.insertBefore(`coffeescript`,`comment`,{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:`comment`},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:`regex`,inside:{comment:t,interpolation:n}}}),e.languages.insertBefore(`coffeescript`,`string`,{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:`punctuation`},script:{pattern:/[\s\S]+/,alias:`language-javascript`,inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:`string`},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:`string`,inside:{interpolation:n}}]}),e.languages.insertBefore(`coffeescript`,`keyword`,{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript[`template-string`],e.languages.coffee=e.languages.coffeescript}(Y),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,`addSupport`,{value:function(t,n){(t=typeof t==`string`?[t]:t).forEach(function(t){var r=function(e){e.inside||={},e.inside.rest=n},i=`doc-comment`;if(a=e.languages[t]){var a,o=a[i];if((o||=(a=e.languages.insertBefore(t,`comment`,{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:`comment`}}))[i])instanceof RegExp&&(o=a[i]={pattern:o}),Array.isArray(o))for(var s=0,c=o.length;s<c;s++)o[s]instanceof RegExp&&(o[s]={pattern:o[s]}),r(o[s]);else r(o)}})}}),t.addSupport([`java`,`javascript`,`php`],t)}(Y),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined(`style`,`css`),t.tag.addAttribute(`style`,`css`))}(Y),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+`)*\\]`),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:`keyword`},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside[`selector-function-argument`].inside=t,e.languages.insertBefore(`css`,`property`,{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore(`css`,`function`,{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:`color`},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(Y),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r=`(?:`+n.source+`(?:[ ]+`+t.source+`)?|`+t.source+`(?:[ ]+`+n.source+`)?)`,i=`(?:[^\\s\\x00-\\x08\\x0e-\\x1f!"#%&'*,\\-:>?@[\\]\`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \\t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*`.replace(/<PLAIN>/g,function(){return`[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]`}),a=`"(?:[^"\\\\\\r\\n]|\\\\.)*"|'(?:[^'\\\\\\r\\n]|\\\\.)*'`;function o(e,t){t=(t||``).replace(/m/g,``)+`m`;var n=`([:\\-,[{]\\s*(?:\\s<<prop>>[ \\t]+)?)(?:<<value>>)(?=[ \\t]*(?:$|,|\\]|\\}|(?:[\\r\\n]\\s*)?#))`.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return e});return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<<prop>>[ \\t]+)?[|>])[ \\t]*(?:((?:\\r?\\n|\\r)[ \\t]+)\\S[^\\r\\n]*(?:\\2[^\\r\\n]+)*)`.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:`string`},comment:/#.*/,key:{pattern:RegExp(`((?:^|[:\\-,[{\\r\\n?])[ \\t]*(?:<<prop>>[ \\t]+)?)<<key>>(?=\\s*:\\s)`.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return`(?:`+i+`|`+a+`)`})),lookbehind:!0,greedy:!0,alias:`atrule`},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:`important`},datetime:{pattern:o(`\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \\t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \\t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?`),lookbehind:!0,alias:`number`},boolean:{pattern:o(`false|true`,`i`),lookbehind:!0,alias:`important`},null:{pattern:o(`null|~`,`i`),lookbehind:!0,alias:`important`},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(`[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)`,`i`),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Y),function(e){var t=`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`;function n(e){return e=e.replace(/<inner>/g,function(){return t}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var r="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",i=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return r}),a=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`,o=(e.languages.markdown=e.languages.extend(`markup`,{}),e.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+i+a+`(?:`+i+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+i+a+`)(?:`+i+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+i+`)`+a+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+i+`$`),inside:{"table-header":{pattern:RegExp(r),alias:`important`,inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:n(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:n(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){e.language!==`markdown`&&e.language!==`md`||function e(t){if(t&&typeof t!=`string`)for(var n=0,r=t.length;n<r;n++){var i,a=t[n];a.type===`code`?(i=a.content[1],a=a.content[3],i&&a&&i.type===`code-language`&&a.type===`code-block`&&typeof i.content==`string`&&(i=i.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`),i=`language-`+(i=(/[a-z][\w-]*/i.exec(i)||[``])[0].toLowerCase()),a.alias?typeof a.alias==`string`?a.alias=[a.alias,i]:a.alias.push(i):a.alias=[i])):e(a.content)}}(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],a=/language-(.+)/.exec(a);if(a){n=a[1];break}}var l,u=e.languages[n];u?t.content=e.highlight(function(e){return e=e.replace(o,``),e=e.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(e,t){var n;return(t=t.toLowerCase())[0]===`#`?(n=t[1]===`x`?parseInt(t.slice(2),16):Number(t.slice(1)),c(n)):s[t]||e})}(t.content),u,n):n&&n!==`none`&&e.plugins.autoloader&&(l=`md-`+new Date().valueOf()+`-`+Math.floor(0x2386f26fc10000*Math.random()),t.attributes.id=l,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(l);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}),RegExp(e.languages.markup.tag.pattern.source,`gi`)),s={amp:`&`,lt:`<`,gt:`>`,quot:`"`},c=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Y),Y.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:`string`,inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:Y.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:`function`},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:`class-name`},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:`function`},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:`function`},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:`function`},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},Y.hooks.add(`after-tokenize`,function(e){if(e.language===`graphql`)for(var t=e.tokens.filter(function(e){return typeof e!=`string`&&e.type!==`comment`&&e.type!==`scalar`}),n=0;n<t.length;){var r=t[n++];if(r.type===`keyword`&&r.content===`mutation`){var i=[];if(d([`definition-mutation`,`punctuation`])&&u(1).content===`(`){n+=2;var a=f(/^\($/,/^\)$/);if(a===-1)continue;for(;n<a;n++){var o=u(0);o.type===`variable`&&(p(o,`variable-input`),i.push(o.content))}n=a+1}if(d([`punctuation`,`property-query`])&&u(0).content===`{`&&(n++,p(u(0),`property-mutation`),0<i.length)){var s=f(/^\{$/,/^\}$/);if(s!==-1)for(var c=n;c<s;c++){var l=t[c];l.type===`variable`&&0<=i.indexOf(l.content)&&p(l,`variable-input`)}}}}function u(e){return t[n+e]}function d(e,t){t||=0;for(var n=0;n<e.length;n++){var r=u(n+t);if(!r||r.type!==e[n])return}return 1}function f(e,r){for(var i=1,a=n;a<t.length;a++){var o=t[a],s=o.content;if(o.type===`punctuation`&&typeof s==`string`){if(e.test(s))i++;else if(r.test(s)&&--i===0)return a}}return-1}function p(e,t){var n=e.alias;n?Array.isArray(n)||(e.alias=n=[n]):e.alias=n=[],n.push(t)}}),Y.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript[`template-string`],n=t.pattern.source,r=t.inside.interpolation,i=r.inside[`interpolation-punctuation`],a=r.pattern.source;function o(t,r){if(e.languages[t])return{pattern:RegExp(`((?:`+r+`)\\s*)`+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function s(t,n,r){return t={code:t,grammar:n,language:r},e.hooks.run(`before-tokenize`,t),t.tokens=e.tokenize(t.code,t.grammar),e.hooks.run(`after-tokenize`,t),t.tokens}function c(t,n,o){var c=e.tokenize(t,{interpolation:{pattern:RegExp(a),lookbehind:!0}}),l=0,u={},c=s(c.map(function(e){if(typeof e==`string`)return e;for(var n,r,e=e.content;t.indexOf((r=l++,n=`___`+o.toUpperCase()+`_`+r+`___`))!==-1;);return u[n]=e,n}).join(``),n,o),d=Object.keys(u);return l=0,function t(n){for(var a=0;a<n.length;a++){if(l>=d.length)return;var o,c,f,p,m,h,g,_=n[a];typeof _==`string`||typeof _.content==`string`?(o=d[l],(g=(h=typeof _==`string`?_:_.content).indexOf(o))!==-1&&(++l,c=h.substring(0,g),m=u[o],f=void 0,(p={})[`interpolation-punctuation`]=i,(p=e.tokenize(m,p)).length===3&&((f=[1,1]).push.apply(f,s(p[1],e.languages.javascript,`javascript`)),p.splice.apply(p,f)),f=new e.Token(`interpolation`,p,r.alias,m),p=h.substring(g+o.length),m=[],c&&m.push(c),m.push(f),p&&(t(h=[p]),m.push.apply(m,h)),typeof _==`string`?(n.splice.apply(n,[a,1].concat(m)),a+=m.length-1):_.content=m)):(g=_.content,t(Array.isArray(g)?g:[g]))}}(c),new e.Token(o,c,`language-`+o,t)}e.languages.javascript[`template-string`]=[o(`css`,`\\b(?:styled(?:\\([^)]*\\))?(?:\\s*\\.\\s*\\w+(?:\\([^)]*\\))*)*|css(?:\\s*\\.\\s*(?:global|resolve))?|createGlobalStyle|keyframes)`),o(`html`,`\\bhtml|\\.\\s*(?:inner|outer)HTML\\s*\\+?=`),o(`svg`,`\\bsvg`),o(`markdown`,`\\b(?:markdown|md)`),o(`graphql`,`\\b(?:gql|graphql(?:\\s*\\.\\s*experimental)?)`),o(`sql`,`\\bsql`),t].filter(Boolean);var l={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function u(e){return typeof e==`string`?e:Array.isArray(e)?e.map(u).join(``):u(e.content)}e.hooks.add(`after-tokenize`,function(t){t.language in l&&function t(n){for(var r=0,i=n.length;r<i;r++){var a,o,s,l=n[r];typeof l!=`string`&&(a=l.content,Array.isArray(a)?l.type===`template-string`?(l=a[1],a.length===3&&typeof l!=`string`&&l.type===`embedded-code`&&(o=u(l),l=l.alias,l=Array.isArray(l)?l[0]:l,s=e.languages[l])&&(a[1]=c(o,s,l))):t(a):typeof a!=`string`&&t([a]))}}(t.tokens)})}(Y),function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript}(Y),function(e){var t=e.languages.javascript,n=`\\{(?:[^{}]|\\{(?:[^{}]|\\{[^{}]*\\})*\\})+\\}`,r=`(@(?:arg|argument|param|property)\\s+(?:`+n+`\\s+)?)`;e.languages.jsdoc=e.languages.extend(`javadoclike`,{parameter:{pattern:RegExp(r+`(?:(?!\\s)[$\\w\\xA0-\\uFFFF.])+(?=\\s|$)`),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore(`jsdoc`,`keyword`,{"optional-parameter":{pattern:RegExp(r+`\\[(?:(?!\\s)[$\\w\\xA0-\\uFFFF.])+(?:=[^[\\]]+)?\\](?=\\s|$)`),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:`language-javascript`},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(`(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\\s+(?:<TYPE>\\s+)?)[A-Z]\\w*(?:\\.[A-Z]\\w*)*`.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp(`(@[a-z]+\\s+)`+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:`language-javascript`}}}}),e.languages.javadoclike.addSupport(`javascript`,e.languages.jsdoc)}(Y),function(e){e.languages.flow=e.languages.extend(`javascript`,{}),e.languages.insertBefore(`flow`,`keyword`,{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:`class-name`}]}),e.languages.flow[`function-variable`].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore(`flow`,`operator`,{"flow-punctuation":{pattern:/\{\||\|\}/,alias:`punctuation`}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(Y),Y.languages.n4js=Y.languages.extend(`javascript`,{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),Y.languages.insertBefore(`n4js`,`constant`,{annotation:{pattern:/@+\w+/,alias:`operator`}}),Y.languages.n4jsd=Y.languages.n4js,function(e){function t(e,t){return RegExp(e.replace(/<ID>/g,function(){return`(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*`}),t)}e.languages.insertBefore(`javascript`,`function-variable`,{"method-variable":{pattern:RegExp(`(\\.\\s*)`+e.languages.javascript[`function-variable`].pattern.source),lookbehind:!0,alias:[`function-variable`,`method`,`function`,`property-access`]}}),e.languages.insertBefore(`javascript`,`function`,{method:{pattern:RegExp(`(\\.\\s*)`+e.languages.javascript.function.source),lookbehind:!0,alias:[`function`,`property-access`]}}),e.languages.insertBefore(`javascript`,`constant`,{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:`class-name`},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:`class-name`}]}),e.languages.insertBefore(`javascript`,`keyword`,{imports:{pattern:t(`(\\bimport\\b\\s*)(?:<ID>(?:\\s*,\\s*(?:\\*\\s*as\\s+<ID>|\\{[^{}]*\\}))?|\\*\\s*as\\s+<ID>|\\{[^{}]*\\})(?=\\s*\\bfrom\\b)`),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(`(\\bexport\\b\\s*)(?:\\*(?:\\s*as\\s+<ID>)?(?=\\s*\\bfrom\\b)|\\{[^{}]*\\})`),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:`module`},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:`control-flow`},{pattern:/\bnull\b/,alias:[`null`,`nil`]},{pattern:/\bundefined\b/,alias:`nil`}),e.languages.insertBefore(`javascript`,`operator`,{spread:{pattern:/\.{3}/,alias:`operator`},arrow:{pattern:/=>/,alias:`operator`}}),e.languages.insertBefore(`javascript`,`punctuation`,{"property-access":{pattern:t(`(\\.\\s*)#?<ID>`),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:`variable`},console:{pattern:/\bconsole(?=\s*\.)/,alias:`class-name`}});for(var n=[`function`,`function-variable`,`method`,`method-variable`,`property-access`],r=0;r<n.length;r++){var i=n[r],a=e.languages.javascript[i],i=(a=e.util.type(a)===`RegExp`?e.languages.javascript[i]={pattern:a}:a).inside||{};(a.inside=i)[`maybe-class-name`]=/^[A-Z][\s\S]*/}}(Y),function(e){var t=e.util.clone(e.languages.javascript),n=`(?:\\s|\\/\\/.*(?!.)|\\/\\*(?:[^*]|\\*(?!\\/))\\*\\/)`,r=`(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})`,i=`(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})`;function a(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(e,t)}i=a(i).source,e.languages.jsx=e.languages.extend(`markup`,t),e.languages.jsx.tag.pattern=a(`<\\/?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[\\s\\S]|[^\\\\"])*"|'(?:\\\\[\\s\\S]|[^\\\\'])*'|[^\\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\\/?)?>`),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside[`attr-value`].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside[`class-name`]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore(`inside`,`attr-name`,{spread:{pattern:a(`<SPREAD>`),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore(`inside`,`special-attr`,{script:{pattern:a(`=<BRACES>`),alias:`language-javascript`,inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:`punctuation`},rest:e.languages.jsx}}},e.languages.jsx.tag);function o(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],a=!1;typeof i!=`string`&&(i.type===`tag`&&i.content[0]&&i.content[0].type===`tag`?i.content[0].content[0].content===`</`?0<n.length&&n[n.length-1].tagName===s(i.content[0].content[1])&&n.pop():i.content[i.content.length-1].content!==`/>`&&n.push({tagName:s(i.content[0].content[1]),openedBraces:0}):0<n.length&&i.type===`punctuation`&&i.content===`{`?n[n.length-1].openedBraces++:0<n.length&&0<n[n.length-1].openedBraces&&i.type===`punctuation`&&i.content===`}`?n[n.length-1].openedBraces--:a=!0),(a||typeof i==`string`)&&0<n.length&&n[n.length-1].openedBraces===0&&(a=s(i),r<t.length-1&&(typeof t[r+1]==`string`||t[r+1].type===`plain-text`)&&(a+=s(t[r+1]),t.splice(r+1,1)),0<r&&(typeof t[r-1]==`string`||t[r-1].type===`plain-text`)&&(a=s(t[r-1])+a,t.splice(r-1,1),r--),t[r]=new e.Token(`plain-text`,a,null,a)),i.content&&typeof i.content!=`string`&&o(i.content)}}var s=function(e){return e?typeof e==`string`?e:typeof e.content==`string`?e.content:e.content.map(s).join(``):``};e.hooks.add(`after-tokenize`,function(e){e.language!==`jsx`&&e.language!==`tsx`||o(e.tokens)})}(Y),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend(`jsx`,t),delete e.languages.tsx.parameter,delete e.languages.tsx[`literal-property`],e.languages.tsx.tag);t.pattern=RegExp(`(^|[^\\w$]|(?=<\\/))(?:`+t.pattern.source+`)`,t.pattern.flags),t.lookbehind=!0}(Y),Y.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(`(^|[^"#])(?:"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^(])|[^\\\\\\r\\n"])*"|"""(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|[^(])|[^\\\\"]|"(?!""))*""")(?!["#])`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:`punctuation`},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(`(^|[^"#])(#+)(?:"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^#])|[^\\\\\\r\\n])*?"|"""(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|[^#])|[^\\\\])*?""")\\2`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:`punctuation`},string:/[\s\S]+/}}],directive:{pattern:RegExp(`#(?:(?:elseif|if)\\b(?:[ ]*(?:![ \\t]*)?(?:\\b\\w+\\b(?:[ \\t]*\\((?:[^()]|\\([^()]*\\))*\\))?|\\((?:[^()]|\\([^()]*\\))*\\))(?:[ \\t]*(?:&&|\\|\\|))?)+|(?:else|endif)\\b)`),alias:`property`,inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:`constant`},"other-directive":{pattern:/#\w+\b/,alias:`property`},attribute:{pattern:/@\w+/,alias:`atrule`},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:`function`},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:`important`},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:`constant`},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:`keyword`},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Y.languages.swift[`string-literal`].forEach(function(e){e.inside.interpolation.inside=Y.languages.swift}),function(e){e.languages.kotlin=e.languages.extend(`clike`,{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin[`class-name`];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:`punctuation`},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore(`kotlin`,`string`,{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:`multiline`,inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:`singleline`,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore(`kotlin`,`keyword`,{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:`builtin`}}),e.languages.insertBefore(`kotlin`,`function`,{label:{pattern:/\b\w+@|@\w+\b/,alias:`symbol`}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(Y),Y.languages.c=Y.languages.extend(`clike`,{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Y.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Y.languages.insertBefore(`c`,`string`,{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:`property`,inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Y.languages.c.string],char:Y.languages.c.char,comment:Y.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:`function`}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:`keyword`},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Y.languages.c}}}}),Y.languages.insertBefore(`c`,`function`,{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Y.languages.c.boolean,Y.languages.objectivec=Y.languages.extend(`c`,{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Y.languages.objectivec[`class-name`],Y.languages.objc=Y.languages.objectivec,Y.languages.reason=Y.languages.extend(`clike`,{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),Y.languages.insertBefore(`reason`,`class-name`,{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:`symbol`}}),delete Y.languages.reason.function,function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Y),Y.languages.go=Y.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Y.languages.insertBefore(`go`,`string`,{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Y.languages.go[`class-name`],function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),e.languages.insertBefore(`cpp`,`keyword`,{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:e.languages.cpp}}}}),e.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),e.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend(`cpp`,{})}}),e.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp[`base-clause`])}(Y),Y.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Y.languages.python[`string-interpolation`].inside.interpolation.inside.rest=Y.languages.python,Y.languages.py=Y.languages.python,Y.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},Y.languages.webmanifest=Y.languages.json;var Co={};xo(Co,{dracula:()=>wo,duotoneDark:()=>To,duotoneLight:()=>Eo,github:()=>Do,gruvboxMaterialDark:()=>Uo,gruvboxMaterialLight:()=>Wo,jettwaveDark:()=>zo,jettwaveLight:()=>Bo,nightOwl:()=>Oo,nightOwlLight:()=>ko,oceanicNext:()=>jo,okaidia:()=>Mo,oneDark:()=>Vo,oneLight:()=>Ho,palenight:()=>No,shadesOfPurple:()=>Po,synthwave84:()=>Fo,ultramin:()=>Io,vsDark:()=>Lo,vsLight:()=>Ro});var wo={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)`}}]},To={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`}}]},Eo={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`}}]},Do={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`}}]},Oo={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)`}}]},ko={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)`}}]},Ao={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`},jo={plain:{backgroundColor:`#282c34`,color:`#ffffff`},styles:[{types:[`attr-name`],style:{color:Ao.keyword}},{types:[`attr-value`],style:{color:Ao.string}},{types:[`comment`,`block-comment`,`prolog`,`doctype`,`cdata`,`shebang`],style:{color:Ao.comment}},{types:[`property`,`number`,`function-name`,`constant`,`symbol`,`deleted`],style:{color:Ao.primitive}},{types:[`boolean`],style:{color:Ao.boolean}},{types:[`tag`],style:{color:Ao.tag}},{types:[`string`],style:{color:Ao.string}},{types:[`punctuation`],style:{color:Ao.string}},{types:[`selector`,`char`,`builtin`,`inserted`],style:{color:Ao.char}},{types:[`function`],style:{color:Ao.function}},{types:[`operator`,`entity`,`url`,`variable`],style:{color:Ao.variable}},{types:[`keyword`],style:{color:Ao.keyword}},{types:[`atrule`,`class-name`],style:{color:Ao.className}},{types:[`important`],style:{fontWeight:`400`}},{types:[`bold`],style:{fontWeight:`bold`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`namespace`],style:{opacity:.7}}]},Mo={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`}}]},No={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)`}}]},Po={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)`}}]},Fo={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`}}]},Io={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)`}}]},Lo={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)`}}]},Ro={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)`}}]},zo={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`}}]},Bo={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`}}]},Vo={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%)`}}]},Ho={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%)`}}]},Uo={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`}}]},Wo={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`}}]},Go=e=>(0,_.useCallback)(t=>{var n=t,{className:r,style:i,line:a}=n;let o=vo(_o({},yo(n,[`className`,`style`,`line`])),{className:J(`token-line`,r)});return typeof e==`object`&&`plain`in e&&(o.style=e.plain),typeof i==`object`&&(o.style=_o(_o({},o.style||{}),i)),o},[e]),Ko=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=vo(_o({},yo(n,[`token`,`className`,`style`])),{className:J(`token`,...r.types,i),children:r.content,style:t(r)});return a!=null&&(o.style=_o(_o({},o.style||{}),a)),o},[t])},qo=/\r\n|\r|\n/,Jo=e=>{e.length===0?e.push({types:[`plain`],content:`
|
|
93
|
+
`)&&(t=t.slice(0,-1))),Ia.prototype.equals.call(this,e,t,n)};function Qa(e,t,n){return Za.diff(e,t,n)}var $a=new Ia;$a.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var eo=new Ia;eo.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 no=new Ia;no.useLongestToken=!0,no.tokenize=Za.tokenize,no.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(ro(e,null,null,i),i,` `)},no.equals=function(e,t,n){return Ia.prototype.equals.call(no,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)};function ro(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]=ro(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]=ro(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var io=new Ia;io.tokenize=function(e){return e.slice()},io.join=io.removeEmpty=function(e){return e};function ao(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=ao(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function q(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ao(e))&&(r&&(r+=` `),r+=t);return r}var J=q,oo=Object.create,so=Object.defineProperty,co=Object.defineProperties,lo=Object.getOwnPropertyDescriptor,uo=Object.getOwnPropertyDescriptors,fo=Object.getOwnPropertyNames,po=Object.getOwnPropertySymbols,mo=Object.getPrototypeOf,ho=Object.prototype.hasOwnProperty,go=Object.prototype.propertyIsEnumerable,_o=(e,t,n)=>t in e?so(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vo=(e,t)=>{for(var n in t||={})ho.call(t,n)&&_o(e,n,t[n]);if(po)for(var n of po(t))go.call(t,n)&&_o(e,n,t[n]);return e},yo=(e,t)=>co(e,uo(t)),bo=(e,t)=>{var n={};for(var r in e)ho.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&po)for(var r of po(e))t.indexOf(r)<0&&go.call(e,r)&&(n[r]=e[r]);return n},xo=(e,t)=>function(){return t||(0,e[fo(e)[0]])((t={exports:{}}).exports,t),t.exports},So=(e,t)=>{for(var n in t)so(e,n,{get:t[n],enumerable:!0})},Co=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of fo(t))!ho.call(e,i)&&i!==n&&so(e,i,{get:()=>t[i],enumerable:!(r=lo(t,i))||r.enumerable});return e},Y=((e,t,n)=>(n=e==null?{}:oo(mo(e)),Co(t||!e||!e.__esModule?so(n,`default`,{value:e,enumerable:!0}):n,e)))(xo({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,`&`).replace(/</g,`<`).replace(/\u00a0/g,` `)},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,`__id`,{value:++t}),e.__id},clone:function e(t,n){n||={};var i,a;switch(r.util.type(t)){case`Object`:if(a=r.util.objId(t),n[a])return n[a];for(var o in i={},n[a]=i,t)t.hasOwnProperty(o)&&(i[o]=e(t[o],n));return i;case`Array`:return a=r.util.objId(t),n[a]?n[a]:(i=[],n[a]=i,t.forEach(function(t,r){i[r]=e(t,n)}),i);default:return t}},getLanguage:function(t){for(;t;){var n=e.exec(t.className);if(n)return n[1].toLowerCase();t=t.parentElement}return`none`},setLanguage:function(t,n){t.className=t.className.replace(RegExp(e,`gi`),``),t.classList.add(`language-`+n)},isActive:function(e,t,n){for(var r=`no-`+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:n,plaintext:n,text:n,txt:n,extend:function(e,t){var n=r.util.clone(r.languages[e]);for(var i in t)n[i]=t[i];return n},insertBefore:function(e,t,n,i){i||=r.languages;var a=i[e],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==t)for(var c in n)n.hasOwnProperty(c)&&(o[c]=n[c]);n.hasOwnProperty(s)||(o[s]=a[s])}var l=i[e];return i[e]=o,r.languages.DFS(r.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,i,a){a||={};var o=r.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],i||s);var c=t[s],l=r.util.type(c);l===`Object`&&!a[o(c)]?(a[o(c)]=!0,e(c,n,null,a)):l===`Array`&&!a[o(c)]&&(a[o(c)]=!0,e(c,n,s,a))}}},plugins:{},highlight:function(e,t,n){var a={code:e,grammar:t,language:n};if(r.hooks.run(`before-tokenize`,a),!a.grammar)throw Error(`The language "`+a.language+`" has no grammar.`);return a.tokens=r.tokenize(a.code,a.grammar),r.hooks.run(`after-tokenize`,a),i.stringify(r.util.encode(a.tokens),a.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new s;return c(i,i.head,e),o(e,i,t,i.head,0),u(i)},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(!(!n||!n.length))for(var i=0,a;a=n[i++];)a(t)}},Token:i};function i(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}i.stringify=function e(t,n){if(typeof t==`string`)return t;if(Array.isArray(t)){var i=``;return t.forEach(function(t){i+=e(t,n)}),i}var a={type:t.type,content:e(t.content,n),tag:`span`,classes:[`token`,t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(a.classes,o):a.classes.push(o)),r.hooks.run(`wrap`,a);var s=``;for(var c in a.attributes)s+=` `+c+`="`+(a.attributes[c]||``).replace(/"/g,`"`)+`"`;return`<`+a.tag+` class="`+a.classes.join(` `)+`"`+s+`>`+a.content+`</`+a.tag+`>`};function a(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function o(e,t,n,s,u,d){for(var f in n)if(!(!n.hasOwnProperty(f)||!n[f])){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+`,`+m)return;var h=p[m],g=h.inside,_=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var b=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,b+`g`)}for(var x=h.pattern||h,S=s.next,C=u;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var w=S.value;if(t.length>e.length)return;if(!(w instanceof i)){var T=1,E;if(v){if(E=a(x,C,e,_),!E||E.index>=e.length)break;var D=E.index,O=E.index+E[0].length,k=C;for(k+=S.value.length;D>=k;)S=S.next,k+=S.value.length;if(k-=S.value.length,C=k,S.value instanceof i)continue;for(var A=S;A!==t.tail&&(k<O||typeof A.value==`string`);A=A.next)T++,k+=A.value.length;T--,w=e.slice(C,k),E.index-=C}else if(E=a(x,0,w,_),!E)continue;var D=E.index,j=E[0],M=w.slice(0,D),N=w.slice(D+j.length),P=C+w.length;d&&P>d.reach&&(d.reach=P);var ee=S.prev;M&&(ee=c(t,ee,M),C+=M.length),l(t,ee,T);var F=new i(f,g?r.tokenize(j,g):j,y,j);if(S=c(t,ee,F),N&&c(t,S,N),T>1){var I={cause:f+`,`+m,reach:P};o(e,t,n,S.prev,C,I),d&&I.reach>d.reach&&(d.reach=I.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function l(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function u(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}return r}();t.exports=n,n.default=n}})());Y.languages.markup={comment:{pattern:/\x3C!--(?:(?!\x3C!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|\x3C!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},Y.languages.markup.tag.inside[`attr-value`].inside.entity=Y.languages.markup.entity,Y.languages.markup.doctype.inside[`internal-subset`].inside=Y.languages.markup,Y.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&/,`&`))}),Object.defineProperty(Y.languages.markup.tag,`addInlined`,{value:function(e,t){var n={},n=(n[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Y.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),t=(n[`language-`+t]={pattern:/[\s\S]+/,inside:Y.languages[t]},{});t[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:n},Y.languages.insertBefore(`markup`,`cdata`,t)}}),Object.defineProperty(Y.languages.markup.tag,`addAttribute`,{value:function(e,t){Y.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:Y.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),Y.languages.html=Y.languages.markup,Y.languages.mathml=Y.languages.markup,Y.languages.svg=Y.languages.markup,Y.languages.xml=Y.languages.extend(`markup`,{}),Y.languages.ssml=Y.languages.xml,Y.languages.atom=Y.languages.xml,Y.languages.rss=Y.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:`escape`},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r=`(?:[^\\\\-]|`+n.source+`)`,r=RegExp(r+`-`+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:`variable`};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:`operator`},"char-class-punctuation":{pattern:/^\[|\]$/,alias:`punctuation`},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:`operator`}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:`class-name`},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:`class-name`},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:`keyword`},{pattern:/\\k<[^<>']+>/,alias:`keyword`,inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:`function`},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:`punctuation`,inside:{"group-name":i}},{pattern:/\)/,alias:`punctuation`}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:`number`},alternation:{pattern:/\|/,alias:`keyword`}}}(Y),Y.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Y.languages.javascript=Y.languages.extend(`clike`,{"class-name":[Y.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Y.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Y.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:Y.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Y.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Y.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Y.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Y.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Y.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:Y.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),Y.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),Y.languages.markup&&(Y.languages.markup.tag.addInlined(`script`,`javascript`),Y.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),Y.languages.js=Y.languages.javascript,Y.languages.actionscript=Y.languages.extend(`javascript`,{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),Y.languages.actionscript[`class-name`].alias=`function`,delete Y.languages.actionscript.parameter,delete Y.languages.actionscript[`literal-property`],Y.languages.markup&&Y.languages.insertBefore(`actionscript`,`string`,{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:Y.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:`variable`};e.languages.coffeescript=e.languages.extend(`javascript`,{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:`variable`}}),e.languages.insertBefore(`coffeescript`,`comment`,{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:`comment`},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:`regex`,inside:{comment:t,interpolation:n}}}),e.languages.insertBefore(`coffeescript`,`string`,{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:`punctuation`},script:{pattern:/[\s\S]+/,alias:`language-javascript`,inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:`string`},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:`string`,inside:{interpolation:n}}]}),e.languages.insertBefore(`coffeescript`,`keyword`,{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript[`template-string`],e.languages.coffee=e.languages.coffeescript}(Y),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,`addSupport`,{value:function(t,n){(t=typeof t==`string`?[t]:t).forEach(function(t){var r=function(e){e.inside||={},e.inside.rest=n},i=`doc-comment`;if(a=e.languages[t]){var a,o=a[i];if((o||=(a=e.languages.insertBefore(t,`comment`,{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:`comment`}}))[i])instanceof RegExp&&(o=a[i]={pattern:o}),Array.isArray(o))for(var s=0,c=o.length;s<c;s++)o[s]instanceof RegExp&&(o[s]={pattern:o[s]}),r(o[s]);else r(o)}})}}),t.addSupport([`java`,`javascript`,`php`],t)}(Y),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined(`style`,`css`),t.tag.addAttribute(`style`,`css`))}(Y),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+`)*\\]`),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:`keyword`},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside[`selector-function-argument`].inside=t,e.languages.insertBefore(`css`,`property`,{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore(`css`,`function`,{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:`color`},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(Y),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r=`(?:`+n.source+`(?:[ ]+`+t.source+`)?|`+t.source+`(?:[ ]+`+n.source+`)?)`,i=`(?:[^\\s\\x00-\\x08\\x0e-\\x1f!"#%&'*,\\-:>?@[\\]\`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \\t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*`.replace(/<PLAIN>/g,function(){return`[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]`}),a=`"(?:[^"\\\\\\r\\n]|\\\\.)*"|'(?:[^'\\\\\\r\\n]|\\\\.)*'`;function o(e,t){t=(t||``).replace(/m/g,``)+`m`;var n=`([:\\-,[{]\\s*(?:\\s<<prop>>[ \\t]+)?)(?:<<value>>)(?=[ \\t]*(?:$|,|\\]|\\}|(?:[\\r\\n]\\s*)?#))`.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return e});return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<<prop>>[ \\t]+)?[|>])[ \\t]*(?:((?:\\r?\\n|\\r)[ \\t]+)\\S[^\\r\\n]*(?:\\2[^\\r\\n]+)*)`.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:`string`},comment:/#.*/,key:{pattern:RegExp(`((?:^|[:\\-,[{\\r\\n?])[ \\t]*(?:<<prop>>[ \\t]+)?)<<key>>(?=\\s*:\\s)`.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return`(?:`+i+`|`+a+`)`})),lookbehind:!0,greedy:!0,alias:`atrule`},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:`important`},datetime:{pattern:o(`\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \\t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \\t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?`),lookbehind:!0,alias:`number`},boolean:{pattern:o(`false|true`,`i`),lookbehind:!0,alias:`important`},null:{pattern:o(`null|~`,`i`),lookbehind:!0,alias:`important`},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(`[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)`,`i`),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Y),function(e){var t=`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`;function n(e){return e=e.replace(/<inner>/g,function(){return t}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var r="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",i=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return r}),a=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`,o=(e.languages.markdown=e.languages.extend(`markup`,{}),e.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+i+a+`(?:`+i+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+i+a+`)(?:`+i+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+i+`)`+a+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+i+`$`),inside:{"table-header":{pattern:RegExp(r),alias:`important`,inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:n(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:n(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){e.language!==`markdown`&&e.language!==`md`||function e(t){if(t&&typeof t!=`string`)for(var n=0,r=t.length;n<r;n++){var i,a=t[n];a.type===`code`?(i=a.content[1],a=a.content[3],i&&a&&i.type===`code-language`&&a.type===`code-block`&&typeof i.content==`string`&&(i=i.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`),i=`language-`+(i=(/[a-z][\w-]*/i.exec(i)||[``])[0].toLowerCase()),a.alias?typeof a.alias==`string`?a.alias=[a.alias,i]:a.alias.push(i):a.alias=[i])):e(a.content)}}(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],a=/language-(.+)/.exec(a);if(a){n=a[1];break}}var l,u=e.languages[n];u?t.content=e.highlight(function(e){return e=e.replace(o,``),e=e.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(e,t){var n;return(t=t.toLowerCase())[0]===`#`?(n=t[1]===`x`?parseInt(t.slice(2),16):Number(t.slice(1)),c(n)):s[t]||e})}(t.content),u,n):n&&n!==`none`&&e.plugins.autoloader&&(l=`md-`+new Date().valueOf()+`-`+Math.floor(0x2386f26fc10000*Math.random()),t.attributes.id=l,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(l);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}),RegExp(e.languages.markup.tag.pattern.source,`gi`)),s={amp:`&`,lt:`<`,gt:`>`,quot:`"`},c=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Y),Y.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:`string`,inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:Y.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:`function`},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:`class-name`},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:`function`},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:`function`},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:`function`},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},Y.hooks.add(`after-tokenize`,function(e){if(e.language===`graphql`)for(var t=e.tokens.filter(function(e){return typeof e!=`string`&&e.type!==`comment`&&e.type!==`scalar`}),n=0;n<t.length;){var r=t[n++];if(r.type===`keyword`&&r.content===`mutation`){var i=[];if(d([`definition-mutation`,`punctuation`])&&u(1).content===`(`){n+=2;var a=f(/^\($/,/^\)$/);if(a===-1)continue;for(;n<a;n++){var o=u(0);o.type===`variable`&&(p(o,`variable-input`),i.push(o.content))}n=a+1}if(d([`punctuation`,`property-query`])&&u(0).content===`{`&&(n++,p(u(0),`property-mutation`),0<i.length)){var s=f(/^\{$/,/^\}$/);if(s!==-1)for(var c=n;c<s;c++){var l=t[c];l.type===`variable`&&0<=i.indexOf(l.content)&&p(l,`variable-input`)}}}}function u(e){return t[n+e]}function d(e,t){t||=0;for(var n=0;n<e.length;n++){var r=u(n+t);if(!r||r.type!==e[n])return}return 1}function f(e,r){for(var i=1,a=n;a<t.length;a++){var o=t[a],s=o.content;if(o.type===`punctuation`&&typeof s==`string`){if(e.test(s))i++;else if(r.test(s)&&--i===0)return a}}return-1}function p(e,t){var n=e.alias;n?Array.isArray(n)||(e.alias=n=[n]):e.alias=n=[],n.push(t)}}),Y.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript[`template-string`],n=t.pattern.source,r=t.inside.interpolation,i=r.inside[`interpolation-punctuation`],a=r.pattern.source;function o(t,r){if(e.languages[t])return{pattern:RegExp(`((?:`+r+`)\\s*)`+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function s(t,n,r){return t={code:t,grammar:n,language:r},e.hooks.run(`before-tokenize`,t),t.tokens=e.tokenize(t.code,t.grammar),e.hooks.run(`after-tokenize`,t),t.tokens}function c(t,n,o){var c=e.tokenize(t,{interpolation:{pattern:RegExp(a),lookbehind:!0}}),l=0,u={},c=s(c.map(function(e){if(typeof e==`string`)return e;for(var n,r,e=e.content;t.indexOf((r=l++,n=`___`+o.toUpperCase()+`_`+r+`___`))!==-1;);return u[n]=e,n}).join(``),n,o),d=Object.keys(u);return l=0,function t(n){for(var a=0;a<n.length;a++){if(l>=d.length)return;var o,c,f,p,m,h,g,_=n[a];typeof _==`string`||typeof _.content==`string`?(o=d[l],(g=(h=typeof _==`string`?_:_.content).indexOf(o))!==-1&&(++l,c=h.substring(0,g),m=u[o],f=void 0,(p={})[`interpolation-punctuation`]=i,(p=e.tokenize(m,p)).length===3&&((f=[1,1]).push.apply(f,s(p[1],e.languages.javascript,`javascript`)),p.splice.apply(p,f)),f=new e.Token(`interpolation`,p,r.alias,m),p=h.substring(g+o.length),m=[],c&&m.push(c),m.push(f),p&&(t(h=[p]),m.push.apply(m,h)),typeof _==`string`?(n.splice.apply(n,[a,1].concat(m)),a+=m.length-1):_.content=m)):(g=_.content,t(Array.isArray(g)?g:[g]))}}(c),new e.Token(o,c,`language-`+o,t)}e.languages.javascript[`template-string`]=[o(`css`,`\\b(?:styled(?:\\([^)]*\\))?(?:\\s*\\.\\s*\\w+(?:\\([^)]*\\))*)*|css(?:\\s*\\.\\s*(?:global|resolve))?|createGlobalStyle|keyframes)`),o(`html`,`\\bhtml|\\.\\s*(?:inner|outer)HTML\\s*\\+?=`),o(`svg`,`\\bsvg`),o(`markdown`,`\\b(?:markdown|md)`),o(`graphql`,`\\b(?:gql|graphql(?:\\s*\\.\\s*experimental)?)`),o(`sql`,`\\bsql`),t].filter(Boolean);var l={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function u(e){return typeof e==`string`?e:Array.isArray(e)?e.map(u).join(``):u(e.content)}e.hooks.add(`after-tokenize`,function(t){t.language in l&&function t(n){for(var r=0,i=n.length;r<i;r++){var a,o,s,l=n[r];typeof l!=`string`&&(a=l.content,Array.isArray(a)?l.type===`template-string`?(l=a[1],a.length===3&&typeof l!=`string`&&l.type===`embedded-code`&&(o=u(l),l=l.alias,l=Array.isArray(l)?l[0]:l,s=e.languages[l])&&(a[1]=c(o,s,l))):t(a):typeof a!=`string`&&t([a]))}}(t.tokens)})}(Y),function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript}(Y),function(e){var t=e.languages.javascript,n=`\\{(?:[^{}]|\\{(?:[^{}]|\\{[^{}]*\\})*\\})+\\}`,r=`(@(?:arg|argument|param|property)\\s+(?:`+n+`\\s+)?)`;e.languages.jsdoc=e.languages.extend(`javadoclike`,{parameter:{pattern:RegExp(r+`(?:(?!\\s)[$\\w\\xA0-\\uFFFF.])+(?=\\s|$)`),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore(`jsdoc`,`keyword`,{"optional-parameter":{pattern:RegExp(r+`\\[(?:(?!\\s)[$\\w\\xA0-\\uFFFF.])+(?:=[^[\\]]+)?\\](?=\\s|$)`),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:`language-javascript`},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(`(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\\s+(?:<TYPE>\\s+)?)[A-Z]\\w*(?:\\.[A-Z]\\w*)*`.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp(`(@[a-z]+\\s+)`+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:`language-javascript`}}}}),e.languages.javadoclike.addSupport(`javascript`,e.languages.jsdoc)}(Y),function(e){e.languages.flow=e.languages.extend(`javascript`,{}),e.languages.insertBefore(`flow`,`keyword`,{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:`class-name`}]}),e.languages.flow[`function-variable`].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore(`flow`,`operator`,{"flow-punctuation":{pattern:/\{\||\|\}/,alias:`punctuation`}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(Y),Y.languages.n4js=Y.languages.extend(`javascript`,{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),Y.languages.insertBefore(`n4js`,`constant`,{annotation:{pattern:/@+\w+/,alias:`operator`}}),Y.languages.n4jsd=Y.languages.n4js,function(e){function t(e,t){return RegExp(e.replace(/<ID>/g,function(){return`(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*`}),t)}e.languages.insertBefore(`javascript`,`function-variable`,{"method-variable":{pattern:RegExp(`(\\.\\s*)`+e.languages.javascript[`function-variable`].pattern.source),lookbehind:!0,alias:[`function-variable`,`method`,`function`,`property-access`]}}),e.languages.insertBefore(`javascript`,`function`,{method:{pattern:RegExp(`(\\.\\s*)`+e.languages.javascript.function.source),lookbehind:!0,alias:[`function`,`property-access`]}}),e.languages.insertBefore(`javascript`,`constant`,{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:`class-name`},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:`class-name`}]}),e.languages.insertBefore(`javascript`,`keyword`,{imports:{pattern:t(`(\\bimport\\b\\s*)(?:<ID>(?:\\s*,\\s*(?:\\*\\s*as\\s+<ID>|\\{[^{}]*\\}))?|\\*\\s*as\\s+<ID>|\\{[^{}]*\\})(?=\\s*\\bfrom\\b)`),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(`(\\bexport\\b\\s*)(?:\\*(?:\\s*as\\s+<ID>)?(?=\\s*\\bfrom\\b)|\\{[^{}]*\\})`),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:`module`},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:`control-flow`},{pattern:/\bnull\b/,alias:[`null`,`nil`]},{pattern:/\bundefined\b/,alias:`nil`}),e.languages.insertBefore(`javascript`,`operator`,{spread:{pattern:/\.{3}/,alias:`operator`},arrow:{pattern:/=>/,alias:`operator`}}),e.languages.insertBefore(`javascript`,`punctuation`,{"property-access":{pattern:t(`(\\.\\s*)#?<ID>`),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:`variable`},console:{pattern:/\bconsole(?=\s*\.)/,alias:`class-name`}});for(var n=[`function`,`function-variable`,`method`,`method-variable`,`property-access`],r=0;r<n.length;r++){var i=n[r],a=e.languages.javascript[i],i=(a=e.util.type(a)===`RegExp`?e.languages.javascript[i]={pattern:a}:a).inside||{};(a.inside=i)[`maybe-class-name`]=/^[A-Z][\s\S]*/}}(Y),function(e){var t=e.util.clone(e.languages.javascript),n=`(?:\\s|\\/\\/.*(?!.)|\\/\\*(?:[^*]|\\*(?!\\/))\\*\\/)`,r=`(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})`,i=`(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})`;function a(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(e,t)}i=a(i).source,e.languages.jsx=e.languages.extend(`markup`,t),e.languages.jsx.tag.pattern=a(`<\\/?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[\\s\\S]|[^\\\\"])*"|'(?:\\\\[\\s\\S]|[^\\\\'])*'|[^\\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\\/?)?>`),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside[`attr-value`].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside[`class-name`]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore(`inside`,`attr-name`,{spread:{pattern:a(`<SPREAD>`),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore(`inside`,`special-attr`,{script:{pattern:a(`=<BRACES>`),alias:`language-javascript`,inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:`punctuation`},rest:e.languages.jsx}}},e.languages.jsx.tag);function o(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],a=!1;typeof i!=`string`&&(i.type===`tag`&&i.content[0]&&i.content[0].type===`tag`?i.content[0].content[0].content===`</`?0<n.length&&n[n.length-1].tagName===s(i.content[0].content[1])&&n.pop():i.content[i.content.length-1].content!==`/>`&&n.push({tagName:s(i.content[0].content[1]),openedBraces:0}):0<n.length&&i.type===`punctuation`&&i.content===`{`?n[n.length-1].openedBraces++:0<n.length&&0<n[n.length-1].openedBraces&&i.type===`punctuation`&&i.content===`}`?n[n.length-1].openedBraces--:a=!0),(a||typeof i==`string`)&&0<n.length&&n[n.length-1].openedBraces===0&&(a=s(i),r<t.length-1&&(typeof t[r+1]==`string`||t[r+1].type===`plain-text`)&&(a+=s(t[r+1]),t.splice(r+1,1)),0<r&&(typeof t[r-1]==`string`||t[r-1].type===`plain-text`)&&(a=s(t[r-1])+a,t.splice(r-1,1),r--),t[r]=new e.Token(`plain-text`,a,null,a)),i.content&&typeof i.content!=`string`&&o(i.content)}}var s=function(e){return e?typeof e==`string`?e:typeof e.content==`string`?e.content:e.content.map(s).join(``):``};e.hooks.add(`after-tokenize`,function(e){e.language!==`jsx`&&e.language!==`tsx`||o(e.tokens)})}(Y),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend(`jsx`,t),delete e.languages.tsx.parameter,delete e.languages.tsx[`literal-property`],e.languages.tsx.tag);t.pattern=RegExp(`(^|[^\\w$]|(?=<\\/))(?:`+t.pattern.source+`)`,t.pattern.flags),t.lookbehind=!0}(Y),Y.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(`(^|[^"#])(?:"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^(])|[^\\\\\\r\\n"])*"|"""(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|[^(])|[^\\\\"]|"(?!""))*""")(?!["#])`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:`punctuation`},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(`(^|[^"#])(#+)(?:"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^#])|[^\\\\\\r\\n])*?"|"""(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|[^#])|[^\\\\])*?""")\\2`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:`punctuation`},string:/[\s\S]+/}}],directive:{pattern:RegExp(`#(?:(?:elseif|if)\\b(?:[ ]*(?:![ \\t]*)?(?:\\b\\w+\\b(?:[ \\t]*\\((?:[^()]|\\([^()]*\\))*\\))?|\\((?:[^()]|\\([^()]*\\))*\\))(?:[ \\t]*(?:&&|\\|\\|))?)+|(?:else|endif)\\b)`),alias:`property`,inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:`constant`},"other-directive":{pattern:/#\w+\b/,alias:`property`},attribute:{pattern:/@\w+/,alias:`atrule`},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:`function`},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:`important`},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:`constant`},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:`keyword`},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Y.languages.swift[`string-literal`].forEach(function(e){e.inside.interpolation.inside=Y.languages.swift}),function(e){e.languages.kotlin=e.languages.extend(`clike`,{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin[`class-name`];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:`punctuation`},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore(`kotlin`,`string`,{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:`multiline`,inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:`singleline`,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore(`kotlin`,`keyword`,{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:`builtin`}}),e.languages.insertBefore(`kotlin`,`function`,{label:{pattern:/\b\w+@|@\w+\b/,alias:`symbol`}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(Y),Y.languages.c=Y.languages.extend(`clike`,{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Y.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Y.languages.insertBefore(`c`,`string`,{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:`property`,inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Y.languages.c.string],char:Y.languages.c.char,comment:Y.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:`function`}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:`keyword`},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Y.languages.c}}}}),Y.languages.insertBefore(`c`,`function`,{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Y.languages.c.boolean,Y.languages.objectivec=Y.languages.extend(`c`,{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Y.languages.objectivec[`class-name`],Y.languages.objc=Y.languages.objectivec,Y.languages.reason=Y.languages.extend(`clike`,{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),Y.languages.insertBefore(`reason`,`class-name`,{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:`symbol`}}),delete Y.languages.reason.function,function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Y),Y.languages.go=Y.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Y.languages.insertBefore(`go`,`string`,{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Y.languages.go[`class-name`],function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),e.languages.insertBefore(`cpp`,`keyword`,{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:e.languages.cpp}}}}),e.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),e.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend(`cpp`,{})}}),e.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp[`base-clause`])}(Y),Y.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Y.languages.python[`string-interpolation`].inside.interpolation.inside.rest=Y.languages.python,Y.languages.py=Y.languages.python,Y.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},Y.languages.webmanifest=Y.languages.json;var wo={};So(wo,{dracula:()=>To,duotoneDark:()=>Eo,duotoneLight:()=>Do,github:()=>Oo,gruvboxMaterialDark:()=>Wo,gruvboxMaterialLight:()=>Go,jettwaveDark:()=>Bo,jettwaveLight:()=>Vo,nightOwl:()=>ko,nightOwlLight:()=>Ao,oceanicNext:()=>Mo,okaidia:()=>No,oneDark:()=>Ho,oneLight:()=>Uo,palenight:()=>Po,shadesOfPurple:()=>Fo,synthwave84:()=>Io,ultramin:()=>Lo,vsDark:()=>Ro,vsLight:()=>zo});var To={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)`}}]},Eo={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`}}]},Do={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`}}]},Oo={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`}}]},ko={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)`}}]},Ao={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)`}}]},jo={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`},Mo={plain:{backgroundColor:`#282c34`,color:`#ffffff`},styles:[{types:[`attr-name`],style:{color:jo.keyword}},{types:[`attr-value`],style:{color:jo.string}},{types:[`comment`,`block-comment`,`prolog`,`doctype`,`cdata`,`shebang`],style:{color:jo.comment}},{types:[`property`,`number`,`function-name`,`constant`,`symbol`,`deleted`],style:{color:jo.primitive}},{types:[`boolean`],style:{color:jo.boolean}},{types:[`tag`],style:{color:jo.tag}},{types:[`string`],style:{color:jo.string}},{types:[`punctuation`],style:{color:jo.string}},{types:[`selector`,`char`,`builtin`,`inserted`],style:{color:jo.char}},{types:[`function`],style:{color:jo.function}},{types:[`operator`,`entity`,`url`,`variable`],style:{color:jo.variable}},{types:[`keyword`],style:{color:jo.keyword}},{types:[`atrule`,`class-name`],style:{color:jo.className}},{types:[`important`],style:{fontWeight:`400`}},{types:[`bold`],style:{fontWeight:`bold`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`namespace`],style:{opacity:.7}}]},No={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`}}]},Po={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)`}}]},Fo={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)`}}]},Io={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`}}]},Lo={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)`}}]},Ro={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)`}}]},zo={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)`}}]},Bo={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`}}]},Vo={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`}}]},Ho={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%)`}}]},Uo={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%)`}}]},Wo={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`}}]},Go={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`}}]},Ko=e=>(0,_.useCallback)(t=>{var n=t,{className:r,style:i,line:a}=n;let o=yo(vo({},bo(n,[`className`,`style`,`line`])),{className:J(`token-line`,r)});return typeof e==`object`&&`plain`in e&&(o.style=e.plain),typeof i==`object`&&(o.style=vo(vo({},o.style||{}),i)),o},[e]),qo=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=yo(vo({},bo(n,[`token`,`className`,`style`])),{className:J(`token`,...r.types,i),children:r.content,style:t(r)});return a!=null&&(o.style=vo(vo({},o.style||{}),a)),o},[t])},Jo=/\r\n|\r|\n/,Yo=e=>{e.length===0?e.push({types:[`plain`],content:`
|
|
93
94
|
`,empty:!0}):e.length===1&&e[0].content===``&&(e[0].content=`
|
|
94
|
-
`,e[0].empty=!0)},
|
|
95
|
-
`).map(e=>({type:`add`,content:e}));let n=
|
|
96
|
-
`),n=e.added?`add`:e.removed?`remove`:`context`;for(let e of t)r.push({type:n,content:e})}return r}function
|
|
97
|
-
`),language:l,children:({tokens:e,getLineProps:t,getTokenProps:n})=>(0,H.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,H.jsxs)(`div`,{...t({line:e}),className:`flex ${a} px-3 leading-5`,children:[(0,H.jsx)(`span`,{className:`select-none w-4 shrink-0 ${s}`,children:o}),(0,H.jsx)(`span`,{children:e.map((e,t)=>(0,H.jsx)(`span`,{...n({token:e})},t))})]},r)})})})})]})}),os=`▶`;function ss(e){return e.tokenUsage?e.tokenUsage.inputTokens+e.tokenUsage.outputTokens+e.tokenUsage.cacheCreationTokens+e.tokenUsage.cacheReadTokens:0}function cs(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 ls(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 us={Explore:`blue`,Plan:`purple`,Shell:`blue`,"general-purpose":`green`,"claude-code-guide":`orange`};function ds(e){return us[e]||`purple`}var fs={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 ps({type:e}){let t=fs[ds(e)];return(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full ${t.pill}`,children:e})}function ms({theme:e}){return(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-semibold uppercase tracking-widest ${fs[e].text}`,children:`Subagent`})}function hs({subAgent:e}){return(0,H.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[e.prompt&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-dim mb-1.5`,children:`Prompt`}),(0,H.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,H.jsx)(_s,{scenes:e.scenes})]})}var gs=20;function _s({scenes:e}){let[t,n]=(0,_.useState)(!1),r=e.length>gs,i=r&&!t?e.slice(0,gs):e,a=e.length-i.length;return(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5`,children:[(0,H.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,H.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,H.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,H.jsx)(vs,{scene:e},t))})]})}function vs({scene:e}){let[t,n]=(0,_.useState)(!1);if(e.type===`thinking`){let t=Re(e.tokens);return(0,H.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,H.jsx)(`span`,{className:`text-purple-400/70 font-bold mr-1`,children:`[thinking]`}),t&&(0,H.jsxs)(`span`,{className:`text-purple-400/70 mr-1`,title:`Approximate thinking tokens`,children:[`~`,t,` tok`]}),(0,H.jsxs)(`span`,{className:`text-purple-400/70`,children:[(e.content||``).slice(0,120),(e.content||``).length>120?`...`:``]})]})}if(e.type===`text-response`)return(0,H.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,H.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,H.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,H.jsx)(`span`,{className:`font-bold ${r.isError?`text-red-400`:`text-terminal-orange`}`,children:wa(r.toolName)}),(0,H.jsx)(`span`,{className:`text-terminal-dim truncate flex-1`,children:xs(r.toolName,r.input)}),r.isError&&(0,H.jsx)(Aa,{}),(0,H.jsx)(Ma,{tokens:r.resultTokens}),(0,H.jsx)(ja,{ms:r.durationMs})]}),t&&r.result&&(0,H.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 ys=(0,_.memo)(function({scene:e,isActive:t,forceCollapse:n}){let[r,i]=(0,_.useState)(!1);if(n)return(0,H.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,H.jsx)(`span`,{children:ls(e.toolName)}),(0,H.jsx)(`span`,{className:`font-bold ${e.isError?`text-red-400`:`text-terminal-orange`}`,children:wa(e.toolName)}),(0,H.jsx)(`span`,{className:`truncate flex-1`,children:xs(e.toolName,e.input)}),e.subAgent&&(0,H.jsx)(ps,{type:e.subAgent.agentType}),e.isError&&(0,H.jsx)(Aa,{}),(0,H.jsx)(Ma,{tokens:e.resultTokens}),(0,H.jsx)(ja,{ms:e.durationMs})]});if(e.bashOutput)return(0,H.jsx)(Na,{command:e.bashOutput.command,stdout:e.bashOutput.stdout,isActive:t,durationMs:e.durationMs,resultTokens:e.resultTokens,isError:e.isError});if(e.diff)return(0,H.jsx)(as,{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=ds(t.agentType),a=fs[n],o=ss(t),s=cs(t),c=t.description||e.input.description||``;return(0,H.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,H.jsxs)(`button`,{onClick:()=>i(!r),className:`w-full text-left`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap mb-1.5`,children:[(0,H.jsx)(ms,{theme:n}),(0,H.jsx)(ps,{type:t.agentType}),t.model&&(0,H.jsx)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono`,children:t.model}),(0,H.jsx)(`span`,{className:`flex-1`}),(0,H.jsxs)(`span`,{className:`text-[10px] text-terminal-dim font-mono`,children:[t.toolCalls,` tools`]}),t.thinkingBlocks>0&&(0,H.jsxs)(`span`,{className:`text-[10px] text-terminal-dim font-mono`,children:[t.thinkingBlocks,` thinking`]}),o>0&&(0,H.jsxs)(`span`,{className:`text-[10px] font-mono font-semibold ${a.text}`,title:`Total tokens billed for this subagent (input + output + cache)`,children:[Re(o),` tok`]}),s>0&&(0,H.jsx)(ja,{ms:s}),(0,H.jsx)(`span`,{className:`text-xs text-terminal-dim transition-transform ${r?`rotate-90`:``}`,children:os})]}),c&&(0,H.jsx)(`div`,{className:`text-sm text-terminal-text font-sans font-medium leading-snug`,children:c})]}),r&&(0,H.jsx)(hs,{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,H.jsx)(`div`,{children:(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl overflow-hidden shadow-layer-sm ${a}`,children:[(0,H.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,H.jsx)(`span`,{className:`text-xs font-mono`,children:ls(e.toolName)}),(0,H.jsx)(`span`,{className:`text-xs font-mono font-bold ${e.isError?`text-red-400`:`text-terminal-orange`}`,children:wa(e.toolName)}),(0,H.jsx)(`span`,{className:`text-xs text-terminal-dim font-mono truncate flex-1`,children:xs(e.toolName,e.input)}),e.isError&&(0,H.jsx)(Aa,{}),(0,H.jsx)(Ma,{tokens:e.resultTokens}),(0,H.jsx)(ja,{ms:e.durationMs}),(0,H.jsx)(`span`,{className:`text-xs text-terminal-dim transition-transform ${r?`rotate-90`:``}`,children:os})]}),r&&(0,H.jsxs)(`div`,{className:`border-t border-terminal-border-subtle`,children:[(0,H.jsxs)(`div`,{className:`px-3 py-2`,children:[(0,H.jsx)(`div`,{className:`text-xs text-terminal-dim font-mono mb-1`,children:`Input:`}),(0,H.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,H.jsxs)(`div`,{className:`px-3 py-2 border-t border-terminal-border-subtle`,children:[(0,H.jsx)(`div`,{className:`text-xs text-terminal-dim font-mono mb-1`,children:`Result:`}),(0,H.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,H.jsx)(`div`,{className:`px-3 py-2 border-t border-terminal-border-subtle`,children:(0,H.jsx)(`div`,{className:`flex gap-2 flex-wrap`,children:e.images.map((e,t)=>(0,H.jsx)(`img`,{src:e,alt:`Screenshot ${t+1}`,className:`max-w-[400px] max-h-[300px] rounded-md object-contain`},t))})})]})]})})}),bs=200;function xs(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>bs?`${e.slice(0,bs)}…`: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 Ss(t)}}function Ss(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 Cs={lines:8,chars:900},ws={lines:4,chars:280};function Ts(){return typeof window<`u`&&window.innerWidth<768?ws:Cs}var Es=(0,_.memo)(function({content:e,images:t,isActive:n}){let[r,i]=(0,_.useState)(!1),[a]=(0,_.useState)(Ts);(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(`
|
|
95
|
+
`,e[0].empty=!0)},Xo=(e,t)=>{let n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},Zo=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=Xo(l,u.type),u.alias&&(l=Xo(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(Jo),f=d.length;s.push({types:l,content:d[0]});for(let e=1;e<f;e++)Yo(s),c.push(s=[]),s.push({types:l,content:d[e]})}o--,t.pop(),n.pop(),r.pop(),i.pop()}return Yo(s),c},Qo=({prism:e,code:t,grammar:n,language:r})=>(0,_.useMemo)(()=>{if(n==null)return Zo([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),Zo(i.tokens)},[t,n,r,e]),$o=(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]=vo(vo({},e[t]),i)}),e},{});return r.root=n,r.plain=yo(vo({},n),{backgroundColor:void 0}),r},es=({children:e,language:t,code:n,theme:r,prism:i})=>{let a=t.toLowerCase(),o=$o(r,a),s=Ko(o),c=qo(o),l=i.languages[a];return e({tokens:Qo({prism:i,language:a,code:n,grammar:l}),className:`prism-code language-${a}`,style:o==null?{}:o.root,getLineProps:s,getTokenProps:c})},ts=e=>(0,_.createElement)(es,yo(vo({},e),{prism:e.prism||Y,theme:e.theme||Ro,code:e.code,language:e.language})),ns=e=>{let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},rs=()=>document.documentElement.classList.contains(`dark`);function is(e,t){if(!e&&t)return t.split(`
|
|
96
|
+
`).map(e=>({type:`add`,content:e}));let n=Qa(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 os=(0,_.memo)(function({toolName:e,filePath:t,oldContent:n,newContent:r,isActive:i,isError:a,durationMs:o,resultTokens:s}){let c=(0,_.useMemo)(()=>is(n,r),[n,r]),l=as(t),u=(0,_.useSyncExternalStore)(ns,rs);return(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl overflow-hidden shadow-layer-sm ${a?`ring-1 ring-red-500/40 border-l-2 border-l-red-500`:``}`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 bg-terminal-surface ${a?`bg-red-500/5`:``}`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono font-bold ${a?`text-red-400`:`text-terminal-orange`}`,children:e}),(0,V.jsx)(`span`,{className:`text-xs font-mono text-terminal-blue truncate flex-1`,children:t}),a&&(0,V.jsx)(Ma,{}),(0,V.jsx)(Pa,{tokens:s}),(0,V.jsx)(Na,{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)(ts,{theme:u?wo.nightOwl:wo.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)})})})})]})}),ss=`▶`;function cs(e){return e.tokenUsage?e.tokenUsage.inputTokens+e.tokenUsage.outputTokens+e.tokenUsage.cacheCreationTokens+e.tokenUsage.cacheReadTokens:0}function ls(e){let t=0;for(let n of e.scenes)n.type===`tool-call`&&n.toolName!==`Agent`&&n.durationMs&&(t+=n.durationMs);return t}function us(e){if(e.startsWith(`mcp__`))return`🔌`;switch(e){case`Read`:return`📄`;case`Write`:return`✏️`;case`Edit`:return`✂️`;case`Delete`:return`🗑️`;case`Bash`:return`$`;case`Glob`:return`🔍`;case`Grep`:return`🔎`;case`Agent`:return`🤖`;default:return`⚙️`}}var ds={Explore:`blue`,Plan:`purple`,Shell:`blue`,"general-purpose":`green`,"claude-code-guide":`orange`};function fs(e){return ds[e]||`purple`}var ps={blue:{text:`text-terminal-blue`,bgSubtle:`bg-terminal-blue-subtle`,borderL:`border-terminal-blue`,pill:`bg-terminal-blue-emphasis text-terminal-blue`},purple:{text:`text-terminal-purple`,bgSubtle:`bg-terminal-purple-subtle`,borderL:`border-terminal-purple`,pill:`bg-terminal-purple-emphasis text-terminal-purple`},green:{text:`text-terminal-green`,bgSubtle:`bg-terminal-green-subtle`,borderL:`border-terminal-green`,pill:`bg-terminal-green-emphasis text-terminal-green`},orange:{text:`text-terminal-orange`,bgSubtle:`bg-terminal-orange-subtle`,borderL:`border-terminal-orange`,pill:`bg-terminal-orange-emphasis text-terminal-orange`}};function ms({type:e}){let t=ps[fs(e)];return(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full ${t.pill}`,children:e})}function hs({theme:e}){return(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold uppercase tracking-widest ${ps[e].text}`,children:`Subagent`})}function gs({subAgent:e}){return(0,V.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[e.prompt&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-dim mb-1.5`,children:`Prompt`}),(0,V.jsx)(`div`,{className:`text-[11px] text-terminal-text/85 font-mono whitespace-pre-wrap break-words max-h-[120px] overflow-y-auto rounded-md bg-terminal-surface-inset px-3 py-2`,children:e.prompt})]}),e.scenes.length>0&&(0,V.jsx)(vs,{scenes:e.scenes})]})}var _s=20;function vs({scenes:e}){let[t,n]=(0,_.useState)(!1),r=e.length>_s,i=r&&!t?e.slice(0,_s):e,a=e.length-i.length;return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5`,children:[(0,V.jsxs)(`span`,{className:`text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-dim`,children:[`Trace · `,e.length,` `,e.length===1?`scene`:`scenes`]}),r&&(0,V.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),n(e=>!e)},className:`text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors`,children:t?`Show first 20`:`Show all (+${a})`})]}),(0,V.jsx)(`div`,{className:`space-y-1 max-h-[500px] overflow-y-auto rounded-md bg-terminal-surface-inset px-3 py-2`,children:i.map((e,t)=>(0,V.jsx)(ys,{scene:e},t))})]})}function ys({scene:e}){let[t,n]=(0,_.useState)(!1);if(e.type===`thinking`){let t=ze(e.tokens);return(0,V.jsxs)(`div`,{className:`text-[10px] font-mono text-purple-400/80 pl-2 border-l-2 border-purple-500/30 py-0.5`,children:[(0,V.jsx)(`span`,{className:`text-purple-400/70 font-bold mr-1`,children:`[thinking]`}),t&&(0,V.jsxs)(`span`,{className:`text-purple-400/70 mr-1`,title:`Approximate thinking tokens`,children:[`~`,t,` tok`]}),(0,V.jsxs)(`span`,{className:`text-purple-400/70`,children:[(e.content||``).slice(0,120),(e.content||``).length>120?`...`:``]})]})}if(e.type===`text-response`)return(0,V.jsxs)(`div`,{className:`text-[10px] font-mono text-terminal-text/80 pl-2 border-l-2 border-blue-500/30 py-0.5`,children:[(e.content||``).slice(0,200),(e.content||``).length>200?`...`:``]});if(e.type===`tool-call`){let r=e;return(0,V.jsxs)(`div`,{className:`pl-2 border-l-2 py-0.5 ${r.isError?`border-l-red-500 bg-red-500/5`:`border-l-orange-500/30`}`,children:[(0,V.jsxs)(`button`,{onClick:()=>n(!t),className:`flex items-center gap-1 text-[10px] font-mono w-full text-left hover:bg-terminal-surface-hover/30 rounded px-1`,children:[(0,V.jsx)(`span`,{className:`font-bold ${r.isError?`text-red-400`:`text-terminal-orange`}`,children:Ea(r.toolName)}),(0,V.jsx)(`span`,{className:`text-terminal-dim truncate flex-1`,children:Ss(r.toolName,r.input)}),r.isError&&(0,V.jsx)(Ma,{}),(0,V.jsx)(Pa,{tokens:r.resultTokens}),(0,V.jsx)(Na,{ms:r.durationMs})]}),t&&r.result&&(0,V.jsx)(`pre`,{className:`text-[9px] text-terminal-dim font-mono whitespace-pre-wrap break-words max-h-[100px] overflow-y-auto mt-0.5 px-1 bg-terminal-bg/50 rounded`,children:r.result.slice(0,500)})]})}return null}var bs=(0,_.memo)(function({scene:e,isActive:t,forceCollapse:n}){let[r,i]=(0,_.useState)(!1);if(n)return(0,V.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1 text-xs font-mono text-terminal-dim ${e.isError?`border-l-2 border-l-red-500 bg-red-500/5`:``}`,children:[(0,V.jsx)(`span`,{children:us(e.toolName)}),(0,V.jsx)(`span`,{className:`font-bold ${e.isError?`text-red-400`:`text-terminal-orange`}`,children:Ea(e.toolName)}),(0,V.jsx)(`span`,{className:`truncate flex-1`,children:Ss(e.toolName,e.input)}),e.subAgent&&(0,V.jsx)(ms,{type:e.subAgent.agentType}),e.isError&&(0,V.jsx)(Ma,{}),(0,V.jsx)(Pa,{tokens:e.resultTokens}),(0,V.jsx)(Na,{ms:e.durationMs})]});if(e.bashOutput)return(0,V.jsx)(Fa,{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)(os,{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=fs(t.agentType),a=ps[n],o=cs(t),s=ls(t),c=t.description||e.input.description||``;return(0,V.jsxs)(`div`,{className:`relative rounded-xl px-5 py-4 border-l-2 ${a.borderL} ${a.bgSubtle} shadow-layer-sm transition-all duration-200 ease-material`,children:[(0,V.jsxs)(`button`,{onClick:()=>i(!r),className:`w-full text-left`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap mb-1.5`,children:[(0,V.jsx)(hs,{theme:n}),(0,V.jsx)(ms,{type:t.agentType}),t.model&&(0,V.jsx)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono`,children:t.model}),(0,V.jsx)(`span`,{className:`flex-1`}),(0,V.jsxs)(`span`,{className:`text-[10px] text-terminal-dim font-mono`,children:[t.toolCalls,` tools`]}),t.thinkingBlocks>0&&(0,V.jsxs)(`span`,{className:`text-[10px] text-terminal-dim font-mono`,children:[t.thinkingBlocks,` thinking`]}),o>0&&(0,V.jsxs)(`span`,{className:`text-[10px] font-mono font-semibold ${a.text}`,title:`Total tokens billed for this subagent (input + output + cache)`,children:[ze(o),` tok`]}),s>0&&(0,V.jsx)(Na,{ms:s}),(0,V.jsx)(`span`,{className:`text-xs text-terminal-dim transition-transform ${r?`rotate-90`:``}`,children:ss})]}),c&&(0,V.jsx)(`div`,{className:`text-sm text-terminal-text font-sans font-medium leading-snug`,children:c})]}),r&&(0,V.jsx)(gs,{subAgent:t})]})}let a=e.isError?`ring-1 ring-red-500/40 border-l-2 border-l-red-500`:``,o=e.isError?`bg-red-500/5`:``;return(0,V.jsx)(`div`,{children:(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl overflow-hidden shadow-layer-sm ${a}`,children:[(0,V.jsxs)(`button`,{onClick:()=>i(!r),className:`w-full flex items-center gap-2 px-3 py-2 hover:bg-terminal-surface-hover transition-colors duration-200 ease-material text-left ${o||`bg-terminal-surface`}`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono`,children:us(e.toolName)}),(0,V.jsx)(`span`,{className:`text-xs font-mono font-bold ${e.isError?`text-red-400`:`text-terminal-orange`}`,children:Ea(e.toolName)}),(0,V.jsx)(`span`,{className:`text-xs text-terminal-dim font-mono truncate flex-1`,children:Ss(e.toolName,e.input)}),e.isError&&(0,V.jsx)(Ma,{}),(0,V.jsx)(Pa,{tokens:e.resultTokens}),(0,V.jsx)(Na,{ms:e.durationMs}),(0,V.jsx)(`span`,{className:`text-xs text-terminal-dim transition-transform ${r?`rotate-90`:``}`,children:ss})]}),r&&(0,V.jsxs)(`div`,{className:`border-t border-terminal-border-subtle`,children:[(0,V.jsxs)(`div`,{className:`px-3 py-2`,children:[(0,V.jsx)(`div`,{className:`text-xs text-terminal-dim font-mono mb-1`,children:`Input:`}),(0,V.jsx)(`pre`,{className:`text-xs text-terminal-text font-mono whitespace-pre-wrap break-words max-h-[200px] overflow-y-auto`,children:JSON.stringify(e.input,null,2)})]}),e.result&&(0,V.jsxs)(`div`,{className:`px-3 py-2 border-t border-terminal-border-subtle`,children:[(0,V.jsx)(`div`,{className:`text-xs text-terminal-dim font-mono mb-1`,children:`Result:`}),(0,V.jsx)(`pre`,{className:`text-xs text-terminal-text font-mono whitespace-pre-wrap break-words max-h-[200px] overflow-y-auto`,children:e.result})]}),e.images&&e.images.length>0&&(0,V.jsx)(`div`,{className:`px-3 py-2 border-t border-terminal-border-subtle`,children:(0,V.jsx)(`div`,{className:`flex gap-2 flex-wrap`,children:e.images.map((e,t)=>(0,V.jsx)(`img`,{src:e,alt:`Screenshot ${t+1}`,className:`max-w-[400px] max-h-[300px] rounded-md object-contain`},t))})})]})]})})}),xs=200;function Ss(e,t){switch(e){case`Read`:case`Write`:case`Edit`:case`MultiEdit`:return t.file_path||``;case`NotebookEdit`:return t.notebook_path||``;case`Glob`:return t.pattern||``;case`Grep`:return`/${t.pattern||``}/ ${t.path||``}`.trim();case`Bash`:{let e=(t.command||t.description||``).replace(/\s+/g,` `).trim();return e.length>xs?`${e.slice(0,xs)}…`:e}case`BashOutput`:return t.bash_id||``;case`Agent`:case`Task`:{let e=t.description||``,n=t.subagent_type;return n?`${n} — ${e}`:e}case`TodoWrite`:{let e=Array.isArray(t.todos)?t.todos:[];if(e.length===0)return``;let n=e.find(e=>e?.status===`in_progress`);return n?.content?`${e.length} todos · ${n.content}`:`${e.length} todos`}case`WebSearch`:return t.query||``;case`WebFetch`:return t.url||``;case`SlashCommand`:return t.command||``;case`ExitPlanMode`:return(t.plan||``).slice(0,80);default:return Cs(t)}}function Cs(e){for(let t of[`url`,`path`,`file_path`,`query`,`name`,`id`]){let n=e[t];if(typeof n==`string`&&n)return n.slice(0,80)}return Object.values(e).filter(e=>typeof e==`string`).join(` `).slice(0,80)}var ws={lines:8,chars:900},Ts={lines:4,chars:280};function Es(){return typeof window<`u`&&window.innerWidth<768?Ts:ws}var Ds=(0,_.memo)(function({content:e,images:t,isActive:n}){let[r,i]=(0,_.useState)(!1),[a]=(0,_.useState)(Es);(0,_.useEffect)(()=>{let e=e=>{if(!n)return;let t=e.detail;t.action===`expand`?i(!0):t.action===`collapse`&&i(!1)};return window.addEventListener(`vibe:toggle-expand`,e),()=>window.removeEventListener(`vibe:toggle-expand`,e)},[n]);let o=(0,_.useMemo)(()=>e.split(`
|
|
98
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(`
|
|
99
|
-
`);return t.length>a.chars?t.slice(0,a.chars):t},[e,r,s,o,a]);return(0,
|
|
100
|
-
...`})]}),s&&(0,H.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,H.jsx)(`span`,{className:`text-secondary-text font-bold opacity-70`,children:r?`[←]`:`[→]`}),(0,H.jsx)(`span`,{children:r?`Show less`:`Show more (${o.length} lines)`})]}),t&&t.length>0&&(0,H.jsx)(`div`,{className:`flex gap-2 mt-2 flex-wrap`,children:t.map((e,t)=>(0,H.jsx)(`img`,{src:e,alt:`Attachment ${t+1}`,className:`max-w-[300px] max-h-[200px] rounded-md object-contain`},t))})]})});function Ds(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 Os({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}){let m=(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]),h=(0,_.useMemo)(()=>r.promptsOnly?m.filter(e=>e.type===`user`||e.type===`compaction`):m,[m,r.promptsOnly]),g=(0,_.useMemo)(()=>{for(let e=h.length-1;e>=0;e--)if(h[e].scenes.some(e=>e.index<=n))return e;return h.length-1},[h,n]),v=(0,_.useMemo)(()=>{let e=new Map;for(let t=1;t<h.length;t++){let n=h[t];if(n.type!==`user`)continue;let r;for(let e=t-1;e>=0;e--){let t=h[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},[h]);return(0,H.jsxs)(`div`,{className:`max-w-4xl mx-auto space-y-5 pb-6`,children:[h.map((e,t)=>(0,H.jsxs)(js,{forceRender:t>=g-15&&t<=g+5,children:[v.has(t)&&(0,H.jsx)(As,{gapMs:v.get(t)}),(0,H.jsx)(Ms,{group:e,currentIndex:n,effectivePrefs:r,focusIndex:i,annotatedScenes:a,annotationCounts:o,onComment:s,overlayActions:u,turnStats:d})]},t)),l===`paused`&&t<e.length&&(0,H.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,H.jsxs)(`div`,{className:`group/pause relative flex items-center gap-8 px-4 py-2 bg-transparent backdrop-blur-sm`,children:[(0,H.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,H.jsxs)(`div`,{className:`flex items-center gap-2.5 pr-8 border-r border-terminal-border/20`,children:[(0,H.jsxs)(`div`,{className:`relative flex h-2 w-2`,children:[(0,H.jsx)(`div`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-orange opacity-40`}),(0,H.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,H.jsx)(`span`,{className:`text-[10px] font-sans font-black text-terminal-orange uppercase tracking-[.25em] drop-shadow-sm`,children:`Paused`})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-8`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.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,H.jsx)(`span`,{className:`text-[11px] font-mono font-bold`,children:`↓`})}),(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest opacity-80`,children:`Explore`})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.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,H.jsx)(`span`,{className:`text-[9px] font-mono font-black tracking-tight`,children:`SPACE`})}),(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest opacity-80`,children:`Resume`})]})]})]})}),t>=e.length&&!f&&(0,H.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,H.jsx)(`div`,{className:`h-px w-8 bg-terminal-border-subtle mb-6`}),(0,H.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,H.jsx)(`div`,{className:`text-[10px] font-mono font-bold text-terminal-dimmer uppercase tracking-[0.3em]`,children:`the end`}),(0,H.jsx)(`div`,{className:`text-[9px] font-mono text-terminal-border uppercase tracking-widest mt-1`,children:`session replay complete`})]}),(0,H.jsxs)(`div`,{className:`mt-8 flex flex-col items-center gap-6`,children:[(0,H.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,H.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,H.jsx)(`path`,{d:`m18 15-6-6-6 6`})}),(0,H.jsx)(`span`,{className:`text-[10px] font-mono font-bold uppercase tracking-widest transition-colors`,children:`Back to Top`}),(0,H.jsxs)(`span`,{className:`text-[9px] font-mono font-bold opacity-0 group-hover:opacity-60 transition-opacity`,children:[` `,`[Home]`]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-3 opacity-20`,children:[(0,H.jsx)(`div`,{className:`w-1 h-1 rounded-full bg-terminal-green`}),(0,H.jsx)(`div`,{className:`w-1 h-1 rounded-full bg-terminal-blue`}),(0,H.jsx)(`div`,{className:`w-1 h-1 rounded-full bg-terminal-orange`})]})]})]}),t>=e.length&&f&&(0,H.jsx)(ks,{sessionState:p})]})}function ks({sessionState:e}){let t=e??`busy`;return t===`stopped`?(0,H.jsxs)(`div`,{className:`pt-10 pb-24 flex flex-col items-center justify-center select-none`,children:[(0,H.jsx)(`div`,{className:`h-px w-8 bg-terminal-border-subtle mb-5`}),(0,H.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,H.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-dimmer`}),(0,H.jsx)(`span`,{className:`text-[10px] font-mono font-bold text-terminal-dim uppercase tracking-[0.25em]`,children:`Ended`})]}),(0,H.jsx)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-3 tracking-wide`,children:`the claude process exited — no further updates will arrive`})]}):t===`idle`?(0,H.jsxs)(`div`,{className:`pt-10 pb-24 flex flex-col items-center justify-center select-none`,children:[(0,H.jsx)(`div`,{className:`h-px w-8 bg-terminal-border-subtle mb-5`}),(0,H.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,H.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-green`}),(0,H.jsx)(`span`,{className:`text-[10px] font-mono font-bold text-terminal-green uppercase tracking-[0.25em]`,children:`Idle`})]}),(0,H.jsx)(`div`,{className:`text-[9px] font-mono text-terminal-dimmer mt-3 tracking-wide`,children:`claude is waiting for your next prompt`})]}):(0,H.jsxs)(`div`,{className:`pt-10 pb-24 flex flex-col items-center justify-center select-none`,children:[(0,H.jsx)(`div`,{className:`h-px w-8 bg-terminal-border-subtle mb-5`}),(0,H.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,H.jsxs)(`span`,{className:`relative flex w-2 h-2`,children:[(0,H.jsx)(`span`,{className:`absolute inline-flex h-full w-full rounded-full bg-terminal-red opacity-75 animate-ping`}),(0,H.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-red`})]}),(0,H.jsx)(`span`,{className:`text-[10px] font-mono font-bold text-terminal-red uppercase tracking-[0.25em]`,children:`Busy`})]}),(0,H.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 As({gapMs:e}){let t=e>=36e5?`${Math.floor(e/36e5)}h ${Math.floor(e%36e5/6e4)}m later`:`${Math.floor(e/6e4)}m later`;return(0,H.jsxs)(`div`,{className:`flex items-center gap-3 py-1 px-4`,children:[(0,H.jsx)(`div`,{className:`flex-1 h-px bg-terminal-border-subtle`}),(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer whitespace-nowrap`,children:t}),(0,H.jsx)(`div`,{className:`flex-1 h-px bg-terminal-border-subtle`})]})}var js=(0,_.memo)(function({children:e,forceRender:t}){let n=(0,_.useRef)(null),[r,i]=(0,_.useState)(!1),a=(0,_.useRef)(0);(0,_.useEffect)(()=>{let e=n.current;if(!e)return;let t=new IntersectionObserver(([t])=>{i(t.isIntersecting),t.isIntersecting&&e.offsetHeight>0&&(a.current=e.offsetHeight)},{rootMargin:`800px 0px`});return t.observe(e),()=>t.disconnect()},[]);let o=r||t;return(0,_.useEffect)(()=>{o&&n.current&&n.current.offsetHeight>0&&(a.current=n.current.offsetHeight)}),(0,H.jsx)(`div`,{ref:n,style:!o&&a.current>0?{minHeight:a.current}:void 0,children:o?e:null})}),Ms=(0,_.memo)(function({group:e,currentIndex:t,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,H.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,H.jsx)(`span`,{children:g})]}):null;if(e.type===`user`)return(0,H.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,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-2.5`,children:[(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-green uppercase tracking-widest`,children:`You`}),e.timestamp&&(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:Ds(e.timestamp)}),(0,H.jsx)(`div`,{className:`flex-1`}),m?(0,H.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,H.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,H.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,H.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,H.jsx)(`div`,{className:`flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden`,children:(0,H.jsx)(`div`,{className:`h-full rounded-full ${i} transition-all duration-300`,style:{width:`${n}%`}})}),(0,H.jsxs)(`span`,{className:`text-[9px] font-mono tabular-nums ${a}`,children:[W(t.contextTokens),(0,H.jsx)(`span`,{className:`text-terminal-dimmer ml-1`,children:`context window`})]})]})})(),(0,H.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,H.jsxs)(`div`,{className:`scene-enter`,children:[(0,H.jsx)(Ls,{scene:e,isActive:r===t,collapseTools:n.collapseAllTools,effectiveContent:a??void 0}),i.length>0&&(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5`,children:[i.map(e=>(0,H.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,H.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,H.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,H.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,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-dim uppercase tracking-widest`,children:`Context Compaction`}),e.timestamp&&(0,H.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:Ds(e.timestamp)}),r&&(0,H.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-green`,children:[W(r.before),` → `,W(r.after),(0,H.jsxs)(`span`,{className:`text-terminal-green/70 ml-1`,children:[`(-`,W(r.freed),` freed)`]})]})]}),(0,H.jsx)(Ea,{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,H.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,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-blue-400/80 uppercase tracking-widest`,children:i}),e.timestamp&&(0,H.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer`,children:Ds(e.timestamp)})]}),(0,H.jsx)(Ea,{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,H.jsx)(Ns,{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,H.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,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-blue uppercase tracking-widest`,children:`Assistant`}),e.timestamp&&(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:Ds(e.timestamp)}),(0,H.jsx)(`div`,{className:`flex-1`}),m?(0,H.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,H.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,H.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer font-bold`,children:[`#`,String(e.turnNumber).padStart(2,`0`)]})]}),(0,H.jsx)(`div`,{className:`space-y-2`,children:(0,H.jsx)(Ps,{scenes:y,currentIndex:t,collapseTools:n.collapseAllTools,annotationCounts:a,onComment:o,overlayActions:s})})]})});function Ns({allScenes:e,filteredScenes:t,firstIndex:n,currentIndex:r,groupHasCurrent:i,groupHasFocusedTarget:a,timestamp:o,annotationCounts:s,onComment:c,overlayActions:l,turnDurationMs:u}){let[d,f]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=e=>{if(!i)return;let t=e.detail;t.action===`expand`?f(!0):t.action===`collapse`&&f(!1)};return window.addEventListener(`vibe:toggle-expand`,e),()=>window.removeEventListener(`vibe:toggle-expand`,e)},[i]);let p=(0,_.useMemo)(()=>{let t={},n=new Set,r=0,i=0,a=0,o=0,s=[];for(let{scene:c}of e)if(c.type===`tool-call`){a++,c.toolName===`Agent`&&c.subAgent&&(o++,s.includes(c.subAgent.agentType)||s.push(c.subAgent.agentType));let e=wa(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,H.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,H.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,H.jsx)(`span`,{children:g})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-blue uppercase tracking-widest`,children:`Assistant`}),o&&(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:Ds(o)}),(u||p.turnDurationMs)&&(0,H.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[`· `,Ie(u??p.turnDurationMs)]}),(0,H.jsx)(`div`,{className:`flex-1`}),a?(0,H.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,H.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,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mb-3 text-[11px] font-mono`,children:[p.responses>0&&(0,H.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,H.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,H.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,H.jsxs)(`span`,{className:`opacity-70 text-[10px]`,children:[`(`,p.subAgentTypes.join(`, `),`)`]})]}),p.thinking>0&&(0,H.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,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`text-terminal-border mx-0.5`,children:`|`}),h.map(([e,t])=>(0,H.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,H.jsx)(`span`,{className:`text-terminal-orange`,children:e}),e===`Bash`&&p.bashCommands.length>0&&(0,H.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[`(`,p.bashCommands.slice(0,4).join(`, `),p.bashCommands.length>4?`, ...`:``,`)`]}),(0,H.jsx)(`span`,{children:t})]},e))]})]}),m&&!d&&(0,H.jsx)(`div`,{className:`mb-2`,children:(0,H.jsx)(Oa,{content:l?.getEffectiveContent(m.index)??m.scene.content,isActive:m.index===r})}),d&&(0,H.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,H.jsxs)(`div`,{"data-scene-index":t,className:`group/scene relative scene-enter ${c?`pr-7`:``}`,children:[(0,H.jsx)(Ls,{scene:e,isActive:t===r,collapseTools:!1,effectiveContent:i}),c&&(0,H.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,H.jsx)(`span`,{children:n})]})]},t)})}),(0,H.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,H.jsx)(`span`,{className:`text-secondary-text font-bold opacity-70`,children:d?`[←]`:`[→]`}),(0,H.jsx)(`span`,{children:d?`Collapse`:`Show all details`})]})]})}function Ps({scenes:e,currentIndex:t,collapseTools:n,annotationCounts:r,onComment:i,overlayActions:a}){let o=[],s=[];for(let t of e){let e=s[s.length-1];e&&e.scene.type===`tool-call`&&t.scene.type===`tool-call`&&e.scene.toolName===t.scene.toolName&&!t.scene.diff&&!t.scene.bashOutput&&!e.scene.diff&&!e.scene.bashOutput?s.push(t):(s.length>0&&o.push(s),s=[t])}return s.length>0&&o.push(s),(0,H.jsx)(H.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,H.jsxs)(`div`,{"data-scene-index":s,className:`group/scene relative scene-enter ${i?`pr-7`:``}`,children:[(0,H.jsx)(Ls,{scene:o,isActive:s===t,collapseTools:n,effectiveContent:l??void 0}),u.length>0&&(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mt-1`,children:[u.map(e=>(0,H.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,H.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,H.jsx)(`button`,{onClick:()=>a?.revertSceneOverlays(s),className:`text-[10px] font-mono text-terminal-dim hover:text-terminal-red transition-colors`,children:`Revert`})]}),i&&(0,H.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,H.jsx)(`span`,{children:c})]})]},s)}let o=e[0].scene.toolName;return(0,H.jsx)(Fs,{batch:e,toolName:o,currentIndex:t,collapseTools:n,annotationCounts:r,onComment:i},e[0].index)})})}function Fs({batch:e,toolName:t,currentIndex:n,collapseTools:r,annotationCounts:i,onComment:a}){let[o,s]=(0,_.useState)(!1),c=i?e.reduce((e,{index:t})=>e+(i.get(t)||0),0):0,l=e.map(({scene:e})=>e.type===`tool-call`?Is(e.toolName,e.input):``),u=0,d=0;for(let{scene:t}of e)t.type===`tool-call`&&(t.resultTokens&&(u+=t.resultTokens),t.durationMs&&(d+=t.durationMs));let f=Re(u),p=Le(d);return(0,H.jsxs)(`div`,{"data-scene-index":e[0].index,className:`group/batch relative ${a?`pr-7`:``}`,children:[(0,H.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,H.jsx)(`span`,{className:`transition-transform text-xs ${o?`rotate-90`:``}`,children:`▶`}),(0,H.jsx)(`span`,{className:`text-terminal-orange font-semibold`,children:t}),(0,H.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[e.length,` call`,e.length>1?`s`:``]}),!o&&(0,H.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,H.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,H.jsx)(`span`,{className:`text-[10px] text-terminal-dimmer font-mono shrink-0`,title:`Combined tool execution: ${p}`,children:p})]}),a&&!o&&(0,H.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,H.jsx)(`span`,{children:c})]}),o&&(0,H.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,H.jsxs)(`div`,{"data-scene-index":t,className:`group/scene relative scene-enter ${a?`pr-7`:``}`,children:[(0,H.jsx)(Ls,{scene:e,isActive:t===n,collapseTools:r}),a&&(0,H.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,H.jsx)(`span`,{children:o})]})]},t)})})]})}function Is(e,t){switch(e){case`Read`:return t.file_path||``;case`Glob`:return t.pattern||``;case`Grep`:return t.pattern||``;case`Agent`:return t.description||``;default:return``}}var Ls=(0,_.memo)(function({scene:e,isActive:t,collapseTools:n,effectiveContent:r}){switch(e.type){case`user-prompt`:return(0,H.jsx)(Es,{content:r??e.content,images:e.images,isActive:t});case`compaction-summary`:return(0,H.jsx)(Ea,{content:e.content,isActive:t});case`context-injection`:return(0,H.jsx)(Ea,{content:e.content,isActive:t});case`thinking`:return(0,H.jsx)(ka,{content:e.content,isActive:t,tokens:e.tokens});case`text-response`:return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Oa,{content:r??e.content,isActive:t}),e.isTruncated&&(0,H.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,H.jsx)(ys,{scene:e,isActive:t,forceCollapse:n})}}),Rs=8;function zs({title:e,color:t}){return(0,H.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-semibold uppercase tracking-widest ${t}`,children:e}),(0,H.jsx)(`div`,{className:`flex-1 h-px bg-terminal-border-subtle`})]})}function Bs({text:e,label:t}){let[n,r]=(0,_.useState)(!1);return(0,H.jsx)(`button`,{onClick:async()=>{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)},className:`text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors px-1.5 py-0.5 rounded bg-terminal-surface hover:bg-terminal-surface-hover border border-terminal-border-subtle`,title:`Copy to clipboard`,children:n?`Copied!`:t||`Copy`})}function Vs(e){try{let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}catch{return``}}function Hs(e,t=!1){let n=t?Math.round(e*.75):e;if(n<1024)return`${n} B`;let r=n/1024;return r<1024?`${r.toFixed(1)} KB`:`${(r/1024).toFixed(1)} MB`}function Us({label:e,path:t}){return(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-mono text-terminal-dim`,children:[(0,H.jsx)(`span`,{className:`text-terminal-dimmer w-8 shrink-0`,children:e}),(0,H.jsx)(`span`,{className:`text-terminal-text truncate`,children:t})]})}function Ws({actions:e,viewerMode:t,readOnly:n,session:r}){let{hasUnsaved:i,canSaveHtml:a,downloadHtml:o,downloadJson:s,publishGist:c,exportHtml:l,exportGithub:u,htmlExporting:d,githubExporting:f}=e,p=t===`editor`,[m,h]=(0,_.useState)(null),[g,v]=(0,_.useState)(null),[y,b]=(0,_.useState)(null),[x,S]=(0,_.useState)(null),[C,w]=(0,_.useState)(!1),[T,E]=(0,_.useState)(null),[D,O]=(0,_.useState)(!1),[k,A]=(0,_.useState)(null),[j,M]=(0,_.useState)(`preview`),[N,P]=(0,_.useState)(`unlisted`),[ee,F]=(0,_.useState)(!1),[I,te]=(0,_.useState)(!1),[ne,L]=(0,_.useState)(null),[R,z]=(0,_.useState)(null),[B,re]=(0,_.useState)(null),[ie,ae]=(0,_.useState)(null),[oe,se]=(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=p?``:be,Se=(0,_.useMemo)(()=>{if(p)return``;try{return new URL(be).origin}catch{return``}},[p,be]),V=(0,_.useCallback)((e,t={})=>{let n=`${xe}${e}`;return fetch(n,{...t,...p?{}:{credentials:`include`}})},[xe,p]);(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,_.useCallback)(()=>{p&&V(`/api/auth/get-session`).then(e=>e.json()).then(e=>{let t=!!e?.session;b(t),t&&V(`/api/cloud-replays`).then(e=>e.json()).then(e=>{re(e.storage?.used??null),ae(e.storage?.limit??null),r&&fetch(mr(`/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};z(e),a.visibility&&P(a.visibility),i||fetch(mr(`/api/cloud-info`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}).catch(()=>{})}}).catch(()=>{})}).catch(()=>{})}).catch(()=>b(!1))},[p,V]);(0,_.useEffect)(()=>{p&&(c&&(De(),w(!0),fetch(mr(`/api/gist-info`)).then(e=>e.json()).then(e=>{e.gist&&S(e.gist)}).catch(()=>{}).finally(()=>w(!1))),u&&fetch(mr(`/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,V,De]),(0,_.useEffect)(()=>{if(!p)return;let e=()=>De();return window.addEventListener(`vibe-auth-change`,e),()=>window.removeEventListener(`vibe-auth-change`,e)},[p,De]);let Oe=(0,_.useCallback)(async()=>{if(r){F(!0),v(null);try{let e=JSON.stringify(r),t=r.meta.title||r.meta.slug,n=`${t.replace(/[^a-zA-Z0-9_-]/g,`-`).replace(/-+/g,`-`).slice(0,60)}.json`,i=await V(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(mr(`/api/gist-info`),{method:`DELETE`}).catch(()=>{}),v({type:`error`,text:`Gist was deleted on GitHub. Click again to create a new one.`});return}throw Error(e)}let a=await i.json();S({gistId:a.gistId,gistUrl:a.gistUrl,viewerUrl:a.viewerUrl,updatedAt:new Date().toISOString()}),v({type:`success`,text:`Published!`})}catch(e){v({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{F(!1)}}},[r,x,V]),ke=(0,_.useCallback)(async()=>{if(r){te(!0),L(null);try{let e=R?.id,t=await V(`/api/cloud-replays`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({replay:r,visibility:N})});if(!t.ok){let e=await t.json().catch(()=>({}));throw t.status===401&&b(!1),Error(e.error||`Upload failed`)}let n=await t.json();e&&e!==n.id&&await V(`/api/cloud-replays/${e}`,{method:`DELETE`}).catch(()=>{}),z(n),L({type:`success`,text:e?`Updated!`:`Shared!`}),fetch(mr(`/api/cloud-info`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...n,visibility:N})}).catch(()=>{});let i=await V(`/api/cloud-replays`).catch(()=>null);if(i){let e=await i.json().catch(()=>null);e?.storage&&(re(e.storage.used??null),ae(e.storage.limit??null))}}catch(e){L({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{te(!1)}}},[r,N,R,V]),Ae=(0,_.useCallback)(async()=>{if(R?.id){te(!0),L(null);try{let e=await V(`/api/cloud-replays/${R.id}`,{method:`DELETE`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||`Delete failed`)}z(null),L({type:`success`,text:`Removed from cloud`}),fetch(mr(`/api/cloud-info`),{method:`DELETE`}).catch(()=>{}),V(`/api/cloud-replays`).then(e=>e.json()).then(e=>{re(e.storage?.used??null),ae(e.storage?.limit??null)}).catch(()=>{})}catch(e){L({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{te(!1)}}},[R,V]),je=(0,_.useCallback)(()=>{V(`/api/cloud-replays`).then(e=>e.json()).then(e=>{re(e.storage?.used??null),ae(e.storage?.limit??null)}).catch(()=>{})},[V]),U=(0,_.useCallback)(async e=>{let t=e===`gif`?T?.gifContent:T?.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`?oe:ce,s=await V(`/api/files`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:r,contentType:i,filename:a,parentReplayId:R?.id||null,visibility:N})});if(!s.ok){let e=await s.json().catch(()=>({}));throw s.status===401&&b(!1),Error(e.error||`Upload failed`)}let c=await s.json();o&&await V(`/api/files/${o.id}`,{method:`DELETE`}).catch(()=>{});let l={id:c.id,url:c.url};e===`gif`?se(l):le(l),n({type:`success`,text:`Shared!`}),navigator.clipboard.writeText(c.url).catch(()=>{}),je()}catch(e){n({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{de(null)}},[T,oe,ce,R,N,V,je]),Me=(0,_.useCallback)(async()=>{if(u){A(null),O(!0);try{let e=await u();await navigator.clipboard.writeText(e.markdown),E({svgContent:e.svgContent,markdown:e.markdown,svgPath:e.svgPath,mdPath:e.mdPath,gifContent:e.gifContent??null,gifPath:e.gifPath??null,gifGeneratedAt:e.gifGeneratedAt,svgGeneratedAt:e.svgGeneratedAt,mdGeneratedAt:e.mdGeneratedAt,replayUrl:e.replayUrl,warnings:e.warnings})}catch(e){A(e instanceof Error?e.message:String(e))}finally{O(!1)}}},[u]),Ne=(0,_.useMemo)(()=>{if(!T?.markdown)return``;let e=T.markdown.replace(/\[?!\[[^\]]*\]\([^)]*\.(?:svg|gif)\)\]?(?:\([^)]*\))?\n*/g,``);return pa(q.parse(e))},[T?.markdown]),Pe=(0,_.useMemo)(()=>T?.svgContent?ma(T.svgContent):``,[T?.svgContent]);if(n)return(0,H.jsx)(`div`,{className:`p-6 text-center text-xs font-mono text-terminal-dim`,children:`Export is not available in read-only mode`});let Fe=`px-4 py-2 text-xs font-mono rounded-lg transition-colors text-center disabled:opacity-50 shrink-0`;return(0,H.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,H.jsx)(`div`,{className:`p-6 max-w-3xl mx-auto`,children:(0,H.jsxs)(`div`,{children:[r&&(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5 mb-5`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-mono font-semibold text-terminal-text truncate`,children:r.meta.title||r.meta.slug}),r.meta.provider&&(0,H.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,H.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,H.jsxs)(`div`,{id:`share`,className:`mb-12`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,H.jsx)(zs,{title:`Share`,color:`text-terminal-purple`}),Ce>0&&(0,H.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:[Hs(Ce),` replay`]})]}),y===!1?(0,H.jsx)(`div`,{className:`bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden`,children:(0,H.jsxs)(`div`,{className:`p-6`,children:[(0,H.jsx)(`h3`,{className:`text-lg font-sans font-semibold text-terminal-text mb-5`,children:`Share your session — free`}),(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 mb-6`,children:[(0,H.jsxs)(`div`,{className:`rounded-xl bg-terminal-bg border border-terminal-border-subtle p-5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,H.jsx)(`span`,{className:`text-xs font-sans font-bold text-terminal-purple`,children:`Cloud Share`}),(0,H.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,H.jsxs)(`ul`,{className:`space-y-2.5 text-sm font-sans text-terminal-dim`,children:[(0,H.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`20 MB free storage`]}),(0,H.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`7-day shareable link`]})]})]}),(0,H.jsxs)(`div`,{className:`rounded-xl bg-terminal-bg border border-terminal-border-subtle p-5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,H.jsx)(`span`,{className:`text-xs font-sans font-bold text-terminal-dim`,children:`GitHub Gist`}),(0,H.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,H.jsxs)(`ul`,{className:`space-y-2.5 text-sm font-sans text-terminal-dim`,children:[(0,H.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`No storage limit`]}),(0,H.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`Permanent — never expires`]}),(0,H.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`Great for portfolios`]})]})]})]}),(0,H.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),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{}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),b(!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===Se&&t.data?.type===`vibe-replay-auth`&&t.data.user&&(window.removeEventListener(`message`,e),ye.current=null,ve.current&&=(clearTimeout(ve.current),null),b(!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,H.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`transition-transform group-hover:scale-110`,children:(0,H.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,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden p-5 flex flex-col`,children:[(0,H.jsx)(`div`,{className:`flex items-center gap-2 mb-3`,children:(0,H.jsx)(`span`,{className:`text-sm font-mono font-semibold text-terminal-purple`,children:`Cloud Share`})}),(0,H.jsx)(`div`,{className:`flex items-center h-7 rounded-md overflow-hidden bg-terminal-bg mb-3`,children:[{value:`private`,label:`Private`,icon:(0,H.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,H.jsx)(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`}),(0,H.jsx)(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`})]})},{value:`unlisted`,label:`Link only`,icon:(0,H.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,H.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,H.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,H.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,H.jsx)(`line`,{x1:`2`,y1:`12`,x2:`22`,y2:`12`}),(0,H.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,H.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 ${N===e?`bg-terminal-purple-subtle text-terminal-purple`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,children:[n,t]},e))}),B!=null&&ie!=null&&(0,H.jsxs)(`div`,{className:`mb-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] font-mono text-terminal-dimmer mb-1.5`,children:[(0,H.jsxs)(`span`,{children:[Hs(B),` used`]}),(0,H.jsxs)(`span`,{children:[Hs(ie),` total`]})]}),(()=>{let e=B/ie*100,t=!R&&Ce>0,n=t?Ce/ie*100:0,r=t&&B+Ce>ie;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`h-2 rounded-full bg-terminal-surface-hover overflow-hidden`,children:(0,H.jsxs)(`div`,{className:`h-full flex`,children:[B>0&&(0,H.jsx)(`div`,{className:`h-full bg-terminal-purple transition-all`,style:{width:`${Math.max(e,1)}%`}}),t&&(0,H.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,H.jsxs)(`div`,{className:`flex items-center gap-3 mt-1.5 text-[10px] font-mono text-terminal-dimmer`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-sm bg-terminal-purple`}),Hs(B),` used`]}),(0,H.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-sm ${r?`bg-terminal-orange`:`bg-terminal-green`}`}),`+`,Hs(Ce),` this upload`]})]})]})})()]}),(0,H.jsxs)(`p`,{className:`text-[10px] font-mono text-terminal-dimmer flex items-center gap-1.5 mb-1`,children:[(0,H.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,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,H.jsx)(`polyline`,{points:`12 6 12 12 16 14`})]}),`Free tier links expire after 7 days`]}),Te&&(0,H.jsxs)(`p`,{className:`text-[11px] font-mono text-terminal-orange mt-1.5 flex items-center gap-1`,children:[(0,H.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,H.jsx)(`path`,{d:`M8 1a1 1 0 0 1 1 1v5.5a1 1 0 0 1-2 0V2a1 1 0 0 1 1-1zM8 11a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 8 11z`})}),`Replay is `,Hs(Ce),` — exceeds 10MB limit`]}),R&&(0,H.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.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,H.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green`}),`Shared`]}),(0,H.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[`expires `,new Date(`${R.expiresAt}Z`).toLocaleDateString()]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle`,children:[(0,H.jsx)(`a`,{href:`${be}/r/${R.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/${R.id}`}),(0,H.jsx)(Bs,{text:`${be}/r/${R.id}`})]})]}),(0,H.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,H.jsx)(`button`,{onClick:ke,disabled:I||Te,className:`${Fe} ${Te?`bg-terminal-surface-2 text-terminal-dimmer border border-terminal-border cursor-not-allowed`:R?`bg-terminal-surface-hover text-terminal-purple hover:bg-terminal-purple-subtle border border-terminal-border`:`bg-terminal-purple-subtle text-terminal-purple hover:bg-[rgba(168,85,247,0.25)] border border-[rgba(168,85,247,0.2)]`}`,children:I?`Uploading...`:Te?`Too large`:R?`Update`:`Share to Cloud`}),R&&(0,H.jsx)(`button`,{onClick:Ae,disabled:I,className:`${Fe} bg-terminal-surface-hover text-terminal-red hover:bg-terminal-red-subtle border border-terminal-border`,children:`Delete`}),ne&&(0,H.jsx)(`span`,{className:`text-[11px] font-mono ${ne.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:ne.text})]})]}),p&&(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden p-5 flex flex-col`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,H.jsx)(`span`,{className:`text-sm font-mono font-semibold text-terminal-dim`,children:`GitHub Gist`}),(0,H.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,H.jsxs)(`ul`,{className:`space-y-1.5 text-xs font-sans text-terminal-dim mb-auto`,children:[(0,H.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`Hosted on GitHub forever`]}),(0,H.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`Doesn't use your storage`]}),(0,H.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-terminal-orange shrink-0`,children:`!`}),`Visible to everyone on the internet`]})]}),Ee&&(0,H.jsxs)(`p`,{className:`text-[11px] font-mono text-terminal-red mt-1.5 flex items-center gap-1`,children:[(0,H.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,H.jsx)(`path`,{d:`M8 1a1 1 0 0 1 1 1v5.5a1 1 0 0 1-2 0V2a1 1 0 0 1 1-1zM8 11a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 8 11z`})}),`Replay is `,Hs(Ce),` — exceeds 10MB limit`]}),x&&(0,H.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.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,H.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green`}),`Published`]}),(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:Vs(x.updatedAt)})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle`,children:[(0,H.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,H.jsx)(Bs,{text:x.viewerUrl})]})]}),C&&!x&&(0,H.jsx)(`div`,{className:`mt-4 text-[11px] font-mono text-terminal-dimmer animate-pulse`,children:`Checking...`}),(0,H.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,H.jsx)(`button`,{onClick:Oe,disabled:ee||Ee,className:`${Fe} ${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:ee?`Publishing...`:Ee?`Too large`:x?`Update Gist`:`Publish to Gist`}),g&&(0,H.jsx)(`span`,{className:`text-[11px] font-mono ${g.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:g.text}),x&&(0,H.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,H.jsx)(`div`,{className:`text-[11px] font-mono text-terminal-dimmer animate-pulse p-2`,children:`Checking login status...`})]}),(0,H.jsxs)(`div`,{id:`export`,children:[(0,H.jsx)(zs,{title:`Export`,color:`text-terminal-green`}),(0,H.jsxs)(`div`,{className:`space-y-4`,children:[p&&u&&(0,H.jsxs)(H.Fragment,{children:[T?.gifContent&&(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden`,children:[(0,H.jsxs)(`div`,{className:`px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-green`,children:`Animated GIF`}),(0,H.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,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[T.gifGeneratedAt&&(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:Vs(T.gifGeneratedAt)}),(0,H.jsx)(`button`,{onClick:Me,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,H.jsx)(`span`,{className:`animate-pulse`,children:`...`}):(0,H.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,H.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,H.jsx)(`path`,{d:`M21 3v5h-5`}),(0,H.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,H.jsx)(`path`,{d:`M8 16H3v5`})]})})]})]}),(0,H.jsx)(`div`,{className:`bg-terminal-bg p-2 flex justify-center border-y border-terminal-border-subtle`,children:(0,H.jsx)(`img`,{src:`data:image/gif;base64,${T.gifContent}`,alt:`Session preview GIF`,className:`w-full h-auto block`})}),(0,H.jsxs)(`div`,{className:`px-5 py-3 space-y-2 border-t border-terminal-border-subtle`,children:[T.gifPath&&(0,H.jsx)(Us,{label:`File`,path:`${T.gifPath} (${Hs(T.gifContent?.length??0,!0)})`}),oe?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle`,children:[(0,H.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,H.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green`}),`Shared`]}),(0,H.jsx)(`span`,{className:`flex-1 text-xs font-mono text-terminal-purple truncate`,children:oe.url}),(0,H.jsx)(Bs,{text:oe.url})]}):(0,H.jsxs)(`p`,{className:`text-[10px] font-mono text-terminal-dimmer leading-relaxed`,children:[`Usage:`,` `,(0,H.jsx)(`span`,{className:`text-terminal-text`,children:``})]}),y&&(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`button`,{onClick:()=>U(`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...`:oe?`Update link`:`Share to Cloud`}),fe&&ue===null&&(0,H.jsx)(`span`,{className:`text-[10px] font-mono ${fe.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:fe.text})]})]})]}),T?.svgContent&&(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden`,children:[(0,H.jsxs)(`div`,{className:`px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-orange`,children:`Animated SVG`}),(0,H.jsxs)(`p`,{className:`text-[10px] font-mono text-terminal-dim mt-0.5`,children:[`Embed in READMEs, PRs, or anywhere that renders SVG. Shows up to`,` `,Rs,` turns.`]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[T.svgGeneratedAt&&(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:Vs(T.svgGeneratedAt)}),(0,H.jsx)(`button`,{onClick:Me,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,H.jsx)(`span`,{className:`animate-pulse`,children:`...`}):(0,H.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,H.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,H.jsx)(`path`,{d:`M21 3v5h-5`}),(0,H.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,H.jsx)(`path`,{d:`M8 16H3v5`})]})})]})]}),(0,H.jsx)(`div`,{className:`bg-terminal-bg p-2 border-y border-terminal-border-subtle [&>svg]:w-full [&>svg]:h-auto [&>svg]:block`,dangerouslySetInnerHTML:{__html:Pe}}),(0,H.jsxs)(`div`,{className:`px-5 py-3 space-y-2 border-t border-terminal-border-subtle`,children:[(0,H.jsx)(Us,{label:`File`,path:`${T.svgPath} (${Hs(T.svgContent?.length??0)})`}),T.replayUrl&&(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-mono text-terminal-dim`,children:[(0,H.jsx)(`span`,{className:`text-terminal-dimmer w-8 shrink-0`,children:`Link`}),(0,H.jsx)(`a`,{href:T.replayUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-terminal-blue hover:text-terminal-text transition-colors truncate`,children:T.replayUrl})]}),ce?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle`,children:[(0,H.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,H.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green`}),`Shared`]}),(0,H.jsx)(`span`,{className:`flex-1 text-xs font-mono text-terminal-purple truncate`,children:ce.url}),(0,H.jsx)(Bs,{text:ce.url})]}):(0,H.jsxs)(`p`,{className:`text-[10px] font-mono text-terminal-dimmer leading-relaxed`,children:[`Usage:`,` `,(0,H.jsx)(`span`,{className:`text-terminal-text`,children:``})]}),y&&(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`button`,{onClick:()=>U(`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,H.jsx)(`span`,{className:`text-[10px] font-mono ${me.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:me.text})]})]})]}),T?.markdown&&(0,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden`,children:[(0,H.jsxs)(`div`,{className:`px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-orange`,children:`Markdown Summary`}),(0,H.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,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer self-start mt-0.5`,children:Vs(T.mdGeneratedAt)})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Bs,{text:T.markdown,label:`Copy MD`}),(0,H.jsxs)(`div`,{className:`flex items-center h-6 rounded-md overflow-hidden bg-terminal-bg border border-terminal-border-subtle`,children:[(0,H.jsx)(`button`,{onClick:()=>M(`preview`),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${j===`preview`?`bg-terminal-orange-subtle text-terminal-orange`:`text-terminal-dim hover:text-terminal-text`}`,children:`Preview`}),(0,H.jsx)(`button`,{onClick:()=>M(`source`),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${j===`source`?`bg-terminal-orange-subtle text-terminal-orange`:`text-terminal-dim hover:text-terminal-text`}`,children:`Source`})]})]})]}),(0,H.jsx)(`div`,{className:`p-4`,children:j===`preview`?(0,H.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:Ne}}):(0,H.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,H.jsx)(`div`,{className:`px-5 py-3 space-y-1.5 border-t border-terminal-border-subtle`,children:(0,H.jsx)(Us,{label:`File`,path:T.mdPath})}),T.warnings&&T.warnings.length>0&&(0,H.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,H.jsx)(`div`,{className:`font-semibold mb-1`,children:`Security warnings`}),T.warnings.map((e,t)=>(0,H.jsx)(`div`,{className:`text-terminal-dim`,children:e},t))]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`button`,{onClick:Me,disabled:D||f,className:`${Fe} ${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,H.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-red`,children:k}),!T&&(0,H.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,H.jsxs)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5`,children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-green mb-1`,children:`HTML Replay`}),(0,H.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,H.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:`${Fe} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis border border-terminal-green/20`,children:d?`Exporting...`:`Export HTML`})]}),m&&(0,H.jsx)(`div`,{className:`mt-3 text-[11px] font-mono ${m.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:m.type===`success`?(0,H.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,H.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,H.jsx)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5`,children:(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-green mb-1`,children:`Save HTML`}),(0,H.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,H.jsx)(`button`,{onClick:o,className:`${Fe} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis border border-terminal-green/20`,children:`Download HTML`})]})}),(0,H.jsx)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5`,children:(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-blue mb-1`,children:`JSON Data`}),(0,H.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,H.jsx)(`button`,{onClick:s,className:`${Fe} bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis border border-terminal-blue/20`,children:`Download JSON`})]})})]})]})]})})})}var Gs=[{title:`Playback`,items:[{key:`Space`,label:`Play / Pause`},{key:`↑ / ↓`,label:`Step Back / Forward`},{key:`Home`,label:`Reset to Start`},{key:`End / e`,label:`Jump to End`}]},{title:`Navigation`,items:[{key:`n / p`,label:`Next / Prev Turn`},{key:`← / →`,label:`Collapse / Expand Item`}]},{title:`Global`,items:[{key:`?`,label:`Show Keyboard Shortcuts`},{key:`⌘ K`,label:`Open Search`},{key:`Esc`,label:`Close Modal / Search`}]}];function Ks({open:e,onClose:t}){let n=(0,_.useCallback)(e=>{(e.key===`Escape`||e.key===`?`)&&t()},[t]);return(0,_.useEffect)(()=>{if(e)return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,n]),e?(0,H.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,H.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,H.jsxs)(`div`,{className:`px-6 py-5 border-b border-terminal-border-subtle flex items-center justify-between`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-sans font-bold uppercase tracking-[0.2em] text-terminal-text`,children:`Keyboard Shortcuts`}),(0,H.jsx)(`button`,{onClick:t,className:`text-terminal-dimmer hover:text-terminal-red transition-colors`,children:(0,H.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,H.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,H.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),(0,H.jsx)(`div`,{className:`px-6 py-4 grid grid-cols-1 gap-8`,children:Gs.map(e=>(0,H.jsxs)(`div`,{className:`space-y-3.5`,children:[(0,H.jsx)(`h3`,{className:`text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-[0.15em] pl-1`,children:e.title}),(0,H.jsx)(`div`,{className:`grid grid-cols-1 gap-2.5`,children:e.items.map(e=>(0,H.jsxs)(`div`,{className:`flex items-center justify-between group`,children:[(0,H.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-dim group-hover:text-terminal-text transition-colors`,children:e.label}),(0,H.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,H.jsx)(`div`,{className:`px-6 py-4 bg-terminal-surface/30 border-t border-terminal-border-subtle`,children:(0,H.jsxs)(`p`,{className:`text-[10px] font-sans font-medium text-terminal-dimmer text-center uppercase tracking-wider`,children:[`Press `,(0,H.jsx)(`span`,{className:`text-terminal-text font-mono font-bold`,children:`?`}),` to toggle this menu anytime`]})})]})}):null}var qs=ce;function Js({session:e,onStart:t,onViewInsights:n}){let{meta:r,scenes:i}=e,a=(0,_.useMemo)(()=>{let e=i.find(e=>e.type===`user-prompt`);if(!e||e.type!==`user-prompt`)return null;let t=e.content,n={},r=0,a=0,o=``,s=0;for(let e of i){if(e.type===`user-prompt`){if(s++,s>1)break;continue}if(s===1)if(e.type===`tool-call`){a++;let t=e.toolName.replace(/^mcp__.*__/,``);n[t]=(n[t]||0)+1}else e.type===`text-response`&&(r++,o=e.content)}let c=Object.entries(n).sort((e,t)=>t[1]-e[1]);return{prompt:t,responses:r,totalTools:a,toolEntries:c,lastResponse:o}},[i]),o=(0,_.useMemo)(()=>{let e=new Set;for(let t of i)t.type===`tool-call`&&t.diff&&e.add(t.diff.filePath);return e.size},[i]),s=Ie(r.stats.durationMs),c=_e(r.project),l=r.title||c,u=qs(r.provider),d=(0,_.useMemo)(()=>{let e=[];if(s&&e.push({value:s,label:`Duration`,color:`text-terminal-text`}),e.push({value:String(r.stats.userPrompts),label:`Turns`,color:`text-terminal-green`}),o>0&&e.push({value:String(o),label:`Files`,color:`text-terminal-blue`}),r.stats.costEstimate!==void 0){let t=r.stats.costEstimate;e.push({value:`$${t<.01?t.toFixed(4):t.toFixed(2)}`,label:`Cost`,color:`text-terminal-orange`})}return e.length<3&&r.stats.toolCalls>0&&e.push({value:String(r.stats.toolCalls),label:`Tool Calls`,color:`text-terminal-orange`}),e},[s,o,r.stats]),f=(0,_.useRef)(!1),p=(0,_.useRef)(0);return(0,_.useEffect)(()=>{let e=e=>{f.current||e.deltaY>0&&(f.current=!0,t(!1))},n=e=>{p.current=e.touches[0].clientY},r=e=>{f.current||p.current-e.touches[0].clientY>15&&(f.current=!0,t(!1))};return window.addEventListener(`wheel`,e,{passive:!0}),window.addEventListener(`touchstart`,n,{passive:!0}),window.addEventListener(`touchmove`,r,{passive:!0}),()=>{window.removeEventListener(`wheel`,e),window.removeEventListener(`touchstart`,n),window.removeEventListener(`touchmove`,r)}},[t]),(0,_.useEffect)(()=>{let e=e=>{(e.key===` `||e.key===`Enter`||e.key===`ArrowDown`||e.key===`ArrowRight`)&&(e.preventDefault(),t())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]),(0,H.jsxs)(`div`,{className:`flex-1 flex flex-col items-center overflow-y-auto relative`,children:[(0,H.jsxs)(`div`,{className:`absolute inset-0 pointer-events-none`,children:[(0,H.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-b from-terminal-green-subtle via-transparent to-transparent`}),(0,H.jsx)(`div`,{className:`absolute inset-0 bg-dot-grid`})]}),(0,H.jsx)(`div`,{className:`flex-1 min-h-4 md:min-h-0`}),(0,H.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,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.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,H.jsxs)(`p`,{className:`text-sm font-sans text-terminal-dim`,children:[`A `,u,` session replay by `,(0,H.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,H.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap mt-2`,children:[r.gitBranch&&(0,H.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,H.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,H.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,H.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,H.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,H.jsx)(`div`,{className:`flex items-center gap-2 mb-2.5`,children:(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-green uppercase tracking-widest`,children:`You`})}),(0,H.jsx)(`div`,{className:`text-terminal-green font-mono text-sm whitespace-pre-wrap break-words line-clamp-3`,children:a.prompt})]}),(0,H.jsxs)(`div`,{className:`rounded-xl px-5 py-4 bg-terminal-surface shadow-layer-sm`,children:[(0,H.jsx)(`div`,{className:`flex items-center gap-2 mb-2.5`,children:(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-secondary-text uppercase tracking-widest`,children:`Assistant`})}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mb-3 text-[11px] font-mono`,children:[a.responses>0&&(0,H.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,H.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,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`text-terminal-border mx-0.5`,children:`|`}),a.toolEntries.map(([e,t])=>(0,H.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,H.jsx)(`span`,{className:`text-terminal-orange`,children:e}),(0,H.jsx)(`span`,{children:t})]},e))]})]}),a.lastResponse&&(0,H.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,H.jsx)(`div`,{className:`text-center`,children:(0,H.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,H.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,H.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,H.jsx)(`div`,{className:`text-base sm:text-xl font-bold font-mono tabular-nums ${e.color}`,children:e.value}),(0,H.jsx)(`div`,{className:`text-[9px] sm:text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-medium`,children:e.label})]},e.label))}),(0,H.jsxs)(`div`,{className:`hidden md:flex items-center justify-center gap-3 flex-wrap`,children:[(0,H.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,H.jsx)(`span`,{className:`text-xl text-terminal-green group-hover:scale-110 transition-transform duration-200`,children:`▶`}),(0,H.jsx)(`span`,{className:`text-base font-sans font-semibold text-terminal-green tracking-wide`,children:`Watch Replay`})]}),n&&(0,H.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,H.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,H.jsx)(`line`,{x1:`18`,x2:`18`,y1:`20`,y2:`10`}),(0,H.jsx)(`line`,{x1:`12`,x2:`12`,y1:`20`,y2:`4`}),(0,H.jsx)(`line`,{x1:`6`,x2:`6`,y1:`20`,y2:`14`})]}),(0,H.jsx)(`span`,{className:`text-sm font-sans font-semibold text-terminal-dim group-hover:text-terminal-text tracking-wide`,children:`View Insights`})]})]}),(0,H.jsx)(`div`,{className:`h-24 md:hidden`})]}),(0,H.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,H.jsx)(`span`,{className:`text-xs font-sans font-medium text-terminal-dim group-hover:text-terminal-text transition-colors`,children:`or scroll down`}),(0,H.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,H.jsx)(`path`,{d:`M6 9l6 6 6-6`})})]}),(0,H.jsx)(`div`,{className:`flex-1 min-h-0`}),(0,H.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,H.jsxs)(`div`,{className:`flex items-center gap-3 mx-6 my-4`,children:[(0,H.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,H.jsx)(`span`,{className:`text-base`,children:`▶`}),(0,H.jsx)(`span`,{className:`text-sm font-sans`,children:`Watch Replay`})]}),n&&(0,H.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,H.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,H.jsx)(`line`,{x1:`18`,x2:`18`,y1:`20`,y2:`10`}),(0,H.jsx)(`line`,{x1:`12`,x2:`12`,y1:`20`,y2:`4`}),(0,H.jsx)(`line`,{x1:`6`,x2:`6`,y1:`20`,y2:`14`})]}),(0,H.jsx)(`span`,{className:`text-sm font-sans font-medium text-terminal-dim`,children:`Insights`})]})]})})]})}function Ys({scenes:e,currentIndex:t,onSeek:n,overlayActions:r,turnStats:i}){let a=(0,_.useMemo)(()=>{let t=[],n=null,i=0;return e.forEach((e,a)=>{if(e.type===`user-prompt`){n&&(n.endIndex=a-1,t.push(n)),i++;let o=r?.getEffectiveContent(a)??e.content;n={kind:`turn`,turnNumber:i,promptIndex:a,prompt:o.replace(/\n/g,` `).slice(0,120),toolCalls:0,toolNames:[],thinkingBlocks:0,textBlocks:0,subAgentCalls:0,endIndex:a}}else e.type===`compaction-summary`||e.type===`context-injection`?(n&&=(n.endIndex=a-1,t.push(n),null),t.push({kind:e.type===`context-injection`?`injection`:`compaction`,promptIndex:a,preview:e.content.replace(/\n/g,` `).slice(0,80)})):n&&(n.endIndex=a,e.type===`tool-call`?(n.toolCalls++,e.toolName===`Agent`&&e.subAgent&&n.subAgentCalls++,n.toolNames.includes(e.toolName)||n.toolNames.push(e.toolName)):e.type===`thinking`?n.thinkingBlocks++:e.type===`text-response`&&n.textBlocks++)}),n&&t.push(n),t},[e,r?.getEffectiveContent]),o=(0,_.useMemo)(()=>{for(let e=a.length-1;e>=0;e--)if(t>=a[e].promptIndex)return e;return-1},[a,t]);return(0,H.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,H.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,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer shrink-0`,children:i}),(0,H.jsx)(`span`,{className:`text-xs font-mono text-terminal-dimmer italic truncate`,children:t})]})},`c-${e.promptIndex}`)}return(0,H.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,H.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,H.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,H.jsx)(`span`,{className:`text-sm font-mono leading-snug line-clamp-2 text-terminal-text`,children:e.prompt})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5 ml-6 flex-wrap`,children:[e.toolCalls>0&&(0,H.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,H.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,H.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,H.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,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:Ie(t.durationMs)}):null})()]}),r&&e.toolNames.length>0&&(0,H.jsx)(`div`,{className:`mt-1.5 ml-6 text-xs font-mono text-terminal-dim truncate`,children:e.toolNames.join(`, `)})]},`t-${e.promptIndex}`)})})}function Xs(e){switch(e.type){case`user-prompt`:return e.content;case`compaction-summary`:return e.content;case`context-injection`:return e.content;case`thinking`:return e.content;case`text-response`:return e.content;case`tool-call`:return[e.toolName,JSON.stringify(e.input),e.result||``,e.bashOutput?.command||``,e.bashOutput?.stdout||``].join(` `);default:return``}}function Zs(e,t){let n=e.toLowerCase().indexOf(t.toLowerCase());if(n===-1)return e.slice(0,120);let r=Math.max(0,n-40),i=Math.min(e.length,n+t.length+60);return(r>0?`...`:``)+e.slice(r,i)+(i<e.length?`...`:``)}var Qs={"user-prompt":`User`,"compaction-summary":`Compaction`,"context-injection":`Injection`,thinking:`Thinking`,"text-response":`Response`,"tool-call":`Tool`},$s={"user-prompt":`text-terminal-green`,"compaction-summary":`text-terminal-dim`,"context-injection":`text-blue-400`,thinking:`text-terminal-purple`,"text-response":`text-terminal-blue`,"tool-call":`text-terminal-orange`};function ec({scenes:e,open:t,onClose:n,onSeek:r}){let[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(0),c=(0,_.useRef)(null),l=(0,_.useRef)(null);(0,_.useEffect)(()=>{t&&(a(``),s(0),setTimeout(()=>c.current?.focus(),50))},[t]);let u=(0,_.useMemo)(()=>{if(i.length<2)return[];let t=i.toLowerCase(),n=[];for(let r=0;r<e.length;r++){let a=e[r],o=Xs(a);if(o.toLowerCase().includes(t)&&n.push({sceneIndex:r,type:a.type,snippet:Zs(o,i),toolName:a.type===`tool-call`?a.toolName:void 0}),n.length>=50)break}return n},[e,i]);(0,_.useEffect)(()=>{l.current&&l.current.children[o]?.scrollIntoView({block:`nearest`})},[o]);let d=(0,_.useCallback)(e=>{let t=u[e];t&&(r(t.sceneIndex),n())},[u,r,n]),f=(0,_.useCallback)(e=>{e.key===`ArrowDown`?(e.preventDefault(),s(e=>Math.min(e+1,u.length-1))):e.key===`ArrowUp`?(e.preventDefault(),s(e=>Math.max(e-1,0))):e.key===`Enter`?(e.preventDefault(),d(o)):e.key===`Escape`&&n()},[u.length,o,d,n]);return t?(0,H.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,H.jsx)(`div`,{className:`absolute inset-0 bg-black/50 backdrop-blur-sm`}),(0,H.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,H.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-3.5 border-b border-terminal-border-subtle`,children:[(0,H.jsx)(`span`,{className:`text-terminal-dim text-sm`,children:`🔍`}),(0,H.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,H.jsx)(`kbd`,{className:`text-[10px] font-mono text-terminal-dimmer bg-terminal-surface px-2 py-0.5 rounded-md`,children:`ESC`})]}),(0,H.jsx)(`div`,{ref:l,className:`max-h-[50vh] overflow-y-auto`,children:i.length<2?(0,H.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,H.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,H.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,H.jsx)(`span`,{className:`text-[10px] font-sans font-bold uppercase shrink-0 mt-0.5 tracking-wider ${$s[e.type]||`text-terminal-dim`}`,children:e.toolName||Qs[e.type]||e.type}),(0,H.jsx)(`span`,{className:`text-xs font-mono text-terminal-text line-clamp-2 break-words`,children:tc(e.snippet,i)}),(0,H.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dimmer shrink-0 mt-0.5`,children:[`#`,e.sceneIndex]})]},e.sceneIndex))}),u.length>0&&(0,H.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,H.jsxs)(`span`,{children:[u.length,` result`,u.length===1?``:`s`]}),(0,H.jsx)(`span`,{children:`↑↓ navigate`}),(0,H.jsx)(`span`,{children:`↵ select`})]})]})]}):null}function tc(e,t){if(!t)return e;let n=[],r=e.toLowerCase(),i=t.toLowerCase(),a=0,o=r.indexOf(i);for(;o!==-1;)o>a&&n.push(e.slice(a,o)),n.push((0,H.jsx)(`mark`,{className:`bg-terminal-green/30 text-terminal-green rounded-sm px-0.5`,children:e.slice(o,o+t.length)},o)),a=o+t.length,o=r.indexOf(i,a);return a<e.length&&n.push(e.slice(a)),n}function nc(e){let t=e.toLowerCase();return/\b(test|jest|vitest|pytest|cargo\s+test|mocha|spec)\b/.test(t)?`test`:/\b(build|compile|tsc|webpack|vite\s+build|rollup)\b/.test(t)?`build`:t.trimStart().startsWith(`git `)?`git`:/\b(lint|biome|eslint|prettier|format)\b/.test(t)?`lint`:`other`}function rc(e,t){if(!e)return;if(!t||t.length<=1)return[e];let n=[...t],r=n.lastIndexOf(e);return r>=0&&r!==n.length-1&&(n.splice(r,1),n.push(e)),n}function ic(e,t){let n=rc(e,t);if(n)return n.length>1?`${n[0]} → ${n[n.length-1]}`:n[0]}function ac(e,t){return rc(e,t)?.join(` → `)}function oc(e){let[t,n]=(0,_.useState)(null),r=(0,_.useRef)(null);return{hovered:t,ref:r,onMouseMove:(0,_.useCallback)(t=>{let i=r.current;if(!i||e<=1)return;let a=i.getBoundingClientRect(),o=(t.clientX-a.left)/a.width,s=Math.round(o*(e-1));n(Math.max(0,Math.min(e-1,s)))},[e]),onMouseLeave:(0,_.useCallback)(()=>n(null),[])}}function sc({session:e}){let{meta:t,scenes:n}=e,r=(0,_.useMemo)(()=>ke(t),[t]),i=(0,_.useMemo)(()=>Ae(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(`
|
|
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 Os(e){if(!e)return``;try{return new Date(e).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}catch{return``}}function ks({scenes:e,visibleCount:t,currentIndex:n,effectivePrefs:r,focusIndex:i,annotatedScenes:a,annotationCounts:o,onComment:s,onSeek:c,state:l,overlayActions:u,turnStats:d,isLive:f,liveSessionState:p}){let m=(0,_.useRef)(null),[h,g]=(0,_.useState)(null),v=(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]),y=(0,_.useMemo)(()=>r.promptsOnly?v.filter(e=>e.type===`user`||e.type===`compaction`):v,[v,r.promptsOnly]),b=(0,_.useMemo)(()=>{for(let e=y.length-1;e>=0;e--)if(y[e].scenes.some(e=>e.index<=n))return e;return y.length-1},[y,n]),x=(0,_.useMemo)(()=>{let e=new Map;for(let t=1;t<y.length;t++){let n=y[t];if(n.type!==`user`)continue;let r;for(let e=t-1;e>=0;e--){let t=y[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},[y]),S=u?.getEffectiveContent,C=(0,_.useMemo)(()=>{let e=[],t=null;for(let n=0;n<y.length;n++){let r=y[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},[y]),w=(0,_.useMemo)(()=>y.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:S?.(t.index)??t.scene.content}]}),[y,S]);return(0,_.useEffect)(()=>{let e=m.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 w){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,g(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)}},[w]),(0,V.jsxs)(`div`,{ref:m,className:`max-w-4xl mx-auto pb-6`,children:[(0,V.jsx)(As,{prompt:h}),(0,V.jsxs)(`div`,{className:`space-y-5`,children:[C.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:[x.has(t)&&(0,V.jsx)(Ms,{gapMs:x.get(t)}),(0,V.jsx)(Ps,{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)(Ns,{forceRender:t>=b-15&&t<=b+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)(js,{sessionState:p})]})]})}function As({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 js({sessionState:e}){let t=e??`busy`;return t===`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`})]}):t===`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 Ms({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 Ns=(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})}),Ps=(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:Os(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)(zs,{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:Os(e.timestamp)}),r&&(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-green`,children:[U(r.before),` → `,U(r.after),(0,V.jsxs)(`span`,{className:`text-terminal-green/70 ml-1`,children:[`(-`,U(r.freed),` freed)`]})]})]}),(0,V.jsx)(Oa,{content:n.content,isActive: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:Os(e.timestamp)})]}),(0,V.jsx)(Oa,{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)(Fs,{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:Os(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)(Is,{scenes:y,currentIndex:t,collapseTools:n.collapseAllTools,annotationCounts:a,onComment:o,overlayActions:s})})]})});function Fs({allScenes:e,filteredScenes:t,firstIndex:n,currentIndex:r,groupHasCurrent:i,groupHasFocusedTarget:a,timestamp:o,annotationCounts:s,onComment:c,overlayActions:l,turnDurationMs:u}){let[d,f]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=e=>{if(!i)return;let t=e.detail;t.action===`expand`?f(!0):t.action===`collapse`&&f(!1)};return window.addEventListener(`vibe:toggle-expand`,e),()=>window.removeEventListener(`vibe:toggle-expand`,e)},[i]);let p=(0,_.useMemo)(()=>{let t={},n=new Set,r=0,i=0,a=0,o=0,s=[];for(let{scene:c}of e)if(c.type===`tool-call`){a++,c.toolName===`Agent`&&c.subAgent&&(o++,s.includes(c.subAgent.agentType)||s.push(c.subAgent.agentType));let e=Ea(c.toolName);if(t[e]=(t[e]||0)+1,c.toolName===`Bash`&&c.input?.command){let e=c.input.command.trim().split(/[\s|;&]/)[0];e&&n.add(e)}}else c.type===`text-response`?r++:c.type===`thinking`&&i++;let c,l=e[0]?.scene.timestamp,u=e[e.length-1]?.scene.timestamp;if(l&&u){let e=Date.parse(u)-Date.parse(l);e>0&&(c=e)}return{totalTools:a,toolBreakdown:t,responses:r,thinking:i,bashCommands:[...n],subAgentCalls:o,subAgentTypes:s,turnDurationMs:c}},[e]),m=(0,_.useMemo)(()=>{for(let t=e.length-1;t>=0;t--)if(e[t].scene.type===`text-response`)return e[t];return null},[e]),h=(0,_.useMemo)(()=>{let e=[`Read`,`Write`,`Edit`,`MultiEdit`,`Delete`,`Bash`,`Glob`,`Grep`,`SemanticSearch`,`Browser`,`Agent`],t=t=>{let n=e.indexOf(t);return n>=0?n:100},n=Object.entries(p.toolBreakdown);return n.sort((e,n)=>{let r=t(e[0])-t(n[0]);if(r!==0)return r;let i=n[1]-e[1];return i===0?e[0].localeCompare(n[0]):i}),n},[p.toolBreakdown]),g=(0,_.useMemo)(()=>s?e.reduce((e,{index:t})=>e+(s.get(t)||0),0):0,[e,s]),[v,y]=(0,_.useState)(!1);return(0,V.jsxs)(`div`,{id:`scene-${n}`,"data-scene-index":n,className:`group relative rounded-xl px-5 py-4 transition-all duration-200 ease-material ${a?`scene-nav-focused bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-lg`:i?`bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-sm`:`bg-terminal-surface shadow-layer-sm`}`,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[c&&(g>0||v)&&!d&&(0,V.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),c(n)},className:`absolute right-3 top-3 z-10 flex items-center gap-1 px-1.5 py-1 rounded-md text-xs font-mono transition-all duration-150 ${g>0?`bg-terminal-blue text-terminal-bg shadow-layer-sm`:`text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover:opacity-100`}`,title:g>0?`${g} comment${g>1?`s`:``}`:`Add comment`,children:[`💬`,g>0&&(0,V.jsx)(`span`,{children:g})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-blue uppercase tracking-widest`,children:`Assistant`}),o&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:Os(o)}),(u||p.turnDurationMs)&&(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[`· `,Le(u??p.turnDurationMs)]}),(0,V.jsx)(`div`,{className:`flex-1`}),a?(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-emphasis text-terminal-blue`,children:`Jump Target`}):i&&(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue`,children:`Focused`})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mb-3 text-[11px] font-mono`,children:[p.responses>0&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue`,children:[p.responses,` response`,p.responses>1?`s`:``]}),p.totalTools>0&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange`,children:[p.totalTools,` tool`,p.totalTools>1?`s`:``]}),p.subAgentCalls>0&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-500/20 text-green-300`,children:[p.subAgentCalls,` agent`,p.subAgentCalls>1?`s`:``,p.subAgentTypes.length>0&&(0,V.jsxs)(`span`,{className:`opacity-70 text-[10px]`,children:[`(`,p.subAgentTypes.join(`, `),`)`]})]}),p.thinking>0&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-purple-subtle text-terminal-purple`,children:[p.thinking,` thinking`]}),h.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-terminal-border mx-0.5`,children:`|`}),h.map(([e,t])=>(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-terminal-surface-hover text-terminal-dim`,children:[(0,V.jsx)(`span`,{className:`text-terminal-orange`,children:e}),e===`Bash`&&p.bashCommands.length>0&&(0,V.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[`(`,p.bashCommands.slice(0,4).join(`, `),p.bashCommands.length>4?`, ...`:``,`)`]}),(0,V.jsx)(`span`,{children:t})]},e))]})]}),m&&!d&&(0,V.jsx)(`div`,{className:`mb-2`,children:(0,V.jsx)(Aa,{content:l?.getEffectiveContent(m.index)??m.scene.content,isActive:m.index===r})}),d&&(0,V.jsx)(`div`,{className:`space-y-2 mb-2`,children:t.map(({scene:e,index:t})=>{let n=s?.get(t)||0,i=e.type===`text-response`?l?.getEffectiveContent(t)??void 0:void 0;return(0,V.jsxs)(`div`,{"data-scene-index":t,className:`group/scene relative scene-enter ${c?`pr-7`:``}`,children:[(0,V.jsx)(zs,{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 Is({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)(zs,{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)(Ls,{batch:e,toolName:o,currentIndex:t,collapseTools:n,annotationCounts:r,onComment:i},e[0].index)})})}function Ls({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`?Rs(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=ze(u),p=Re(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)(zs,{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 Rs(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 zs=(0,_.memo)(function({scene:e,isActive:t,collapseTools:n,effectiveContent:r}){switch(e.type){case`user-prompt`:return(0,V.jsx)(Ds,{content:r??e.content,images:e.images,isActive:t});case`compaction-summary`:return(0,V.jsx)(Oa,{content:e.content,isActive:t});case`context-injection`:return(0,V.jsx)(Oa,{content:e.content,isActive:t});case`thinking`:return(0,V.jsx)(ja,{content:e.content,isActive:t,tokens:e.tokens});case`text-response`:return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Aa,{content:r??e.content,isActive:t}),e.isTruncated&&(0,V.jsx)(`div`,{className:`mt-1 text-[10px] font-mono text-terminal-orange/70 italic`,children:`Response truncated (max_tokens reached)`})]});case`tool-call`:return(0,V.jsx)(bs,{scene:e,isActive:t,forceCollapse:n})}}),Bs=8;function Vs({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 Hs({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 Us(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 Ws(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 Gs({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 Ks({actions:e,viewerMode:t,readOnly:n,session:r}){let{hasUnsaved:i,canSaveHtml:a,downloadHtml:o,downloadJson:s,publishGist:c,exportHtml:l,exportGithub:u,htmlExporting:d,githubExporting:f}=e,p=t===`editor`,[m,h]=(0,_.useState)(null),[g,v]=(0,_.useState)(null),[y,b]=(0,_.useState)(null),[x,S]=(0,_.useState)(null),[C,w]=(0,_.useState)(!1),[T,E]=(0,_.useState)(null),[D,O]=(0,_.useState)(!1),[k,A]=(0,_.useState)(null),[j,M]=(0,_.useState)(`preview`),[N,P]=(0,_.useState)(`unlisted`),[ee,F]=(0,_.useState)(!1),[I,te]=(0,_.useState)(!1),[ne,re]=(0,_.useState)(null),[L,R]=(0,_.useState)(null),[z,ie]=(0,_.useState)(null),[ae,oe]=(0,_.useState)(null),[se,ce]=(0,_.useState)(null),[le,ue]=(0,_.useState)(null),[de,fe]=(0,_.useState)(null),[pe,me]=(0,_.useState)(null),[he,ge]=(0,_.useState)(null),_e=(0,_.useRef)(null),ve=(0,_.useRef)(null),ye=(0,_.useRef)(null),be=(0,_.useRef)(null),xe=`https://vibe-replay.com`,Se=p?``:xe,Ce=(0,_.useMemo)(()=>{if(p)return``;try{return new URL(xe).origin}catch{return``}},[p,xe]),B=(0,_.useCallback)((e,t={})=>{let n=`${Se}${e}`;return fetch(n,{...t,...p?{}:{credentials:`include`}})},[Se,p]);(0,_.useEffect)(()=>()=>{_e.current&&=(clearInterval(_e.current),null),ve.current&&=(clearTimeout(ve.current),null),ye.current&&=(clearTimeout(ye.current),null),be.current&&=(window.removeEventListener(`message`,be.current),null)},[]);let we=(0,_.useMemo)(()=>r?new TextEncoder().encode(JSON.stringify(r)).byteLength:0,[r]),Te=10*1024*1024,Ee=we>10485760,De=we>Te,Oe=(0,_.useCallback)(()=>{p&&B(`/api/auth/get-session`).then(e=>e.json()).then(e=>{let t=!!e?.session;b(t),t&&B(`/api/cloud-replays`).then(e=>e.json()).then(e=>{ie(e.storage?.used??null),oe(e.storage?.limit??null),r&&fetch(gr(`/api/cloud-info`)).then(e=>e.json()).then(t=>{let n=t?.cloud?.id,i=n?(e.replays||[]).find(e=>e.id===n):null,a=i||(e.replays||[]).find(e=>e.storageType===`r2`&&e.title===(r.meta.title||r.meta.slug));if(a){let e={id:a.id,url:`${xe}/r/${a.id}`,expiresAt:a.expiresAt||``,visibility:a.visibility};R(e),a.visibility&&P(a.visibility),i||fetch(gr(`/api/cloud-info`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}).catch(()=>{})}}).catch(()=>{})}).catch(()=>{})}).catch(()=>b(!1))},[p,B]);(0,_.useEffect)(()=>{p&&(c&&(Oe(),w(!0),fetch(gr(`/api/gist-info`)).then(e=>e.json()).then(e=>{e.gist&&S(e.gist)}).catch(()=>{}).finally(()=>w(!1))),u&&fetch(gr(`/api/export/github/status`)).then(e=>e.json()).then(e=>{e.exists&&E({svgContent:e.svgContent,markdown:e.markdown,svgPath:e.svgPath,mdPath:e.mdPath,gifContent:e.gifContent??null,gifPath:e.gifPath??null,gifGeneratedAt:e.gifGeneratedAt,svgGeneratedAt:e.svgGeneratedAt,mdGeneratedAt:e.mdGeneratedAt,replayUrl:e.replayUrl})}).catch(()=>{}))},[p,c,u,B,Oe]),(0,_.useEffect)(()=>{if(!p)return;let e=()=>Oe();return window.addEventListener(`vibe-auth-change`,e),()=>window.removeEventListener(`vibe-auth-change`,e)},[p,Oe]);let ke=(0,_.useCallback)(async()=>{if(r){F(!0),v(null);try{let e=JSON.stringify(r),t=r.meta.title||r.meta.slug,n=`${t.replace(/[^a-zA-Z0-9_-]/g,`-`).replace(/-+/g,`-`).slice(0,60)}.json`,i=await B(x?`/api/gists/${x.gistId}`:`/api/gists`,{method:x?`PATCH`:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filename:n,content:e,description:`vibe-replay: ${t}`,public:!0})});if(!i.ok){let e=(await i.json().catch(()=>({}))).error||`Gist publish failed`;if(i.status===401)throw b(!1),Error(e);if(x&&(i.status===404||e.includes(`not found`))){S(null),fetch(gr(`/api/gist-info`),{method:`DELETE`}).catch(()=>{}),v({type:`error`,text:`Gist was deleted on GitHub. Click again to create a new one.`});return}throw Error(e)}let a=await i.json();S({gistId:a.gistId,gistUrl:a.gistUrl,viewerUrl:a.viewerUrl,updatedAt:new Date().toISOString()}),v({type:`success`,text:`Published!`})}catch(e){v({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{F(!1)}}},[r,x,B]),Ae=(0,_.useCallback)(async()=>{if(r){te(!0),re(null);try{let e=L?.id,t=await B(`/api/cloud-replays`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({replay:r,visibility:N})});if(!t.ok){let e=await t.json().catch(()=>({}));throw t.status===401&&b(!1),Error(e.error||`Upload failed`)}let n=await t.json();e&&e!==n.id&&await B(`/api/cloud-replays/${e}`,{method:`DELETE`}).catch(()=>{}),R(n),re({type:`success`,text:e?`Updated!`:`Shared!`}),fetch(gr(`/api/cloud-info`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...n,visibility:N})}).catch(()=>{});let i=await B(`/api/cloud-replays`).catch(()=>null);if(i){let e=await i.json().catch(()=>null);e?.storage&&(ie(e.storage.used??null),oe(e.storage.limit??null))}}catch(e){re({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{te(!1)}}},[r,N,L,B]),je=(0,_.useCallback)(async()=>{if(L?.id){te(!0),re(null);try{let e=await B(`/api/cloud-replays/${L.id}`,{method:`DELETE`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||`Delete failed`)}R(null),re({type:`success`,text:`Removed from cloud`}),fetch(gr(`/api/cloud-info`),{method:`DELETE`}).catch(()=>{}),B(`/api/cloud-replays`).then(e=>e.json()).then(e=>{ie(e.storage?.used??null),oe(e.storage?.limit??null)}).catch(()=>{})}catch(e){re({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{te(!1)}}},[L,B]),Me=(0,_.useCallback)(()=>{B(`/api/cloud-replays`).then(e=>e.json()).then(e=>{ie(e.storage?.used??null),oe(e.storage?.limit??null)}).catch(()=>{})},[B]),H=(0,_.useCallback)(async e=>{let t=e===`gif`?T?.gifContent:T?.svgContent;if(!t)return;let n=e===`gif`?me:ge;fe(e),n(null);try{let r=e===`svg`?btoa(Array.from(new TextEncoder().encode(t),e=>String.fromCharCode(e)).join(``)):t,i=e===`gif`?`image/gif`:`image/svg+xml`,a=`session-preview.${e}`,o=e===`gif`?se:le,s=await B(`/api/files`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:r,contentType:i,filename:a,parentReplayId:L?.id||null,visibility:N})});if(!s.ok){let e=await s.json().catch(()=>({}));throw s.status===401&&b(!1),Error(e.error||`Upload failed`)}let c=await s.json();o&&await B(`/api/files/${o.id}`,{method:`DELETE`}).catch(()=>{});let l={id:c.id,url:c.url};e===`gif`?ce(l):ue(l),n({type:`success`,text:`Shared!`}),navigator.clipboard.writeText(c.url).catch(()=>{}),Me()}catch(e){n({type:`error`,text:e instanceof Error?e.message:String(e)})}finally{fe(null)}},[T,se,le,L,N,B,Me]),Ne=(0,_.useCallback)(async()=>{if(u){A(null),O(!0);try{let e=await u();await navigator.clipboard.writeText(e.markdown),E({svgContent:e.svgContent,markdown:e.markdown,svgPath:e.svgPath,mdPath:e.mdPath,gifContent:e.gifContent??null,gifPath:e.gifPath??null,gifGeneratedAt:e.gifGeneratedAt,svgGeneratedAt:e.svgGeneratedAt,mdGeneratedAt:e.mdGeneratedAt,replayUrl:e.replayUrl,warnings:e.warnings})}catch(e){A(e instanceof Error?e.message:String(e))}finally{O(!1)}}},[u]),Pe=(0,_.useMemo)(()=>{if(!T?.markdown)return``;let e=T.markdown.replace(/\[?!\[[^\]]*\]\([^)]*\.(?:svg|gif)\)\]?(?:\([^)]*\))?\n*/g,``);return ha(K.parse(e))},[T?.markdown]),Fe=(0,_.useMemo)(()=>T?.svgContent?ga(T.svgContent):``,[T?.svgContent]);if(n)return(0,V.jsx)(`div`,{className:`p-6 text-center text-xs font-mono text-terminal-dim`,children:`Export is not available in read-only mode`});let Ie=`px-4 py-2 text-xs font-mono rounded-lg transition-colors text-center disabled:opacity-50 shrink-0`;return(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,V.jsx)(`div`,{className:`p-6 max-w-3xl mx-auto`,children:(0,V.jsxs)(`div`,{children:[r&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 mb-5`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-mono font-semibold text-terminal-text truncate`,children:r.meta.title||r.meta.slug}),r.meta.provider&&(0,V.jsx)(`span`,{className:`shrink-0 text-[10px] font-mono text-terminal-dimmer px-1.5 py-0.5 rounded bg-terminal-surface border border-terminal-border-subtle`,children:r.meta.provider})]}),i&&(0,V.jsx)(`div`,{className:`text-xs font-mono text-terminal-orange text-center mb-5 px-3 py-2 rounded-lg bg-terminal-orange-subtle border border-terminal-orange/20`,children:`You have unsaved annotation changes`}),p&&(0,V.jsxs)(`div`,{id:`share`,className:`mb-12`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,V.jsx)(Vs,{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:[Ws(we),` replay`]})]}),y===!1?(0,V.jsx)(`div`,{className:`bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden`,children:(0,V.jsxs)(`div`,{className:`p-6`,children:[(0,V.jsx)(`h3`,{className:`text-lg font-sans font-semibold text-terminal-text mb-5`,children:`Share your session — free`}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 mb-6`,children:[(0,V.jsxs)(`div`,{className:`rounded-xl bg-terminal-bg border border-terminal-border-subtle p-5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,V.jsx)(`span`,{className:`text-xs font-sans font-bold text-terminal-purple`,children:`Cloud Share`}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono font-semibold px-2 py-0.5 rounded-md bg-terminal-purple-subtle text-terminal-purple`,children:`Private`})]}),(0,V.jsxs)(`ul`,{className:`space-y-2.5 text-sm font-sans text-terminal-dim`,children:[(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`20 MB free storage`]}),(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`7-day shareable link`]})]})]}),(0,V.jsxs)(`div`,{className:`rounded-xl bg-terminal-bg border border-terminal-border-subtle p-5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,V.jsx)(`span`,{className:`text-xs font-sans font-bold text-terminal-dim`,children:`GitHub Gist`}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono font-semibold px-2 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer`,children:`Public`})]}),(0,V.jsxs)(`ul`,{className:`space-y-2.5 text-sm font-sans text-terminal-dim`,children:[(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`No storage limit`]}),(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`Permanent — never expires`]}),(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`Great for portfolios`]})]})]})]}),(0,V.jsxs)(`button`,{type:`button`,onClick:async()=>{if(_e.current&&=(clearInterval(_e.current),null),ve.current&&=(clearTimeout(ve.current),null),ye.current&&=(clearTimeout(ye.current),null),be.current&&=(window.removeEventListener(`message`,be.current),null),p){try{let e=await fetch(`/api/auth/login`,{method:`POST`}),t=await e.json().catch(()=>null);e.ok&&t?.url&&window.open(t.url,`_blank`)}catch{}_e.current=setInterval(async()=>{try{(await(await fetch(`/api/auth/get-session`)).json())?.session&&(_e.current&&=(clearInterval(_e.current),null),ve.current&&=(clearTimeout(ve.current),null),b(!0),window.dispatchEvent(new Event(`vibe-auth-change`)))}catch{}},2e3),ve.current=setTimeout(()=>{_e.current&&=(clearInterval(_e.current),null),ve.current=null},300*1e3);return}window.open(`${xe}/auth/login?callback=/auth/success`,`_blank`);let e=t=>{t.origin===Ce&&t.data?.type===`vibe-replay-auth`&&t.data.user&&(window.removeEventListener(`message`,e),be.current=null,ye.current&&=(clearTimeout(ye.current),null),b(!0),window.dispatchEvent(new Event(`vibe-auth-change`)))};be.current=e,window.addEventListener(`message`,e),ye.current=setTimeout(()=>{window.removeEventListener(`message`,e),ye.current=null,be.current===e&&(be.current=null)},300*1e3)},className:`group inline-flex items-center gap-2.5 px-6 py-3 rounded-xl bg-terminal-green-subtle hover:bg-terminal-green-emphasis text-terminal-green text-sm font-sans font-semibold transition-all duration-200 ease-material shadow-layer-sm hover:shadow-layer-md hover:-translate-y-0.5`,children:[(0,V.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`transition-transform group-hover:scale-110`,children:(0,V.jsx)(`path`,{d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z`})}),`Sign in with GitHub`]})]})}):y===!0?(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden p-5 flex flex-col`,children:[(0,V.jsx)(`div`,{className:`flex items-center gap-2 mb-3`,children:(0,V.jsx)(`span`,{className:`text-sm font-mono font-semibold text-terminal-purple`,children:`Cloud Share`})}),(0,V.jsx)(`div`,{className:`flex items-center h-7 rounded-md overflow-hidden bg-terminal-bg mb-3`,children:[{value:`private`,label:`Private`,icon:(0,V.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`}),(0,V.jsx)(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`})]})},{value:`unlisted`,label:`Link only`,icon:(0,V.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}),(0,V.jsx)(`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`})]})},{value:`public`,label:`Public`,icon:(0,V.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,V.jsx)(`line`,{x1:`2`,y1:`12`,x2:`22`,y2:`12`}),(0,V.jsx)(`path`,{d:`M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z`})]})}].map(({value:e,label:t,icon:n})=>(0,V.jsxs)(`button`,{onClick:()=>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 ${N===e?`bg-terminal-purple-subtle text-terminal-purple`:`text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover`}`,children:[n,t]},e))}),z!=null&&ae!=null&&(0,V.jsxs)(`div`,{className:`mb-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] font-mono text-terminal-dimmer mb-1.5`,children:[(0,V.jsxs)(`span`,{children:[Ws(z),` used`]}),(0,V.jsxs)(`span`,{children:[Ws(ae),` total`]})]}),(()=>{let e=z/ae*100,t=!L&&we>0,n=t?we/ae*100:0,r=t&&z+we>ae;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`h-2 rounded-full bg-terminal-surface-hover overflow-hidden`,children:(0,V.jsxs)(`div`,{className:`h-full flex`,children:[z>0&&(0,V.jsx)(`div`,{className:`h-full bg-terminal-purple transition-all`,style:{width:`${Math.max(e,1)}%`}}),t&&(0,V.jsx)(`div`,{className:`h-full transition-all ${r?`bg-terminal-orange`:`bg-terminal-green`}`,style:{width:`${Math.max(Math.min(n,100-e),1)}%`}})]})}),t&&(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mt-1.5 text-[10px] font-mono text-terminal-dimmer`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-sm bg-terminal-purple`}),Ws(z),` used`]}),(0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-sm ${r?`bg-terminal-orange`:`bg-terminal-green`}`}),`+`,Ws(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 `,Ws(we),` — exceeds 10MB limit`]}),L&&(0,V.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] font-mono font-semibold text-terminal-green px-2 py-0.5 rounded-full bg-terminal-green-subtle`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green`}),`Shared`]}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[`expires `,new Date(`${L.expiresAt}Z`).toLocaleDateString()]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle`,children:[(0,V.jsx)(`a`,{href:`${xe}/r/${L.id}`,target:`_blank`,rel:`noopener noreferrer`,className:`flex-1 text-xs font-mono text-terminal-purple hover:text-terminal-text transition-colors truncate`,children:`${xe}/r/${L.id}`}),(0,V.jsx)(Hs,{text:`${xe}/r/${L.id}`})]})]}),(0,V.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,V.jsx)(`button`,{onClick:Ae,disabled:I||Ee,className:`${Ie} ${Ee?`bg-terminal-surface-2 text-terminal-dimmer border border-terminal-border cursor-not-allowed`:L?`bg-terminal-surface-hover text-terminal-purple hover:bg-terminal-purple-subtle border border-terminal-border`:`bg-terminal-purple-subtle text-terminal-purple hover:bg-[rgba(168,85,247,0.25)] border border-[rgba(168,85,247,0.2)]`}`,children:I?`Uploading...`:Ee?`Too large`:L?`Update`:`Share to Cloud`}),L&&(0,V.jsx)(`button`,{onClick:je,disabled:I,className:`${Ie} bg-terminal-surface-hover text-terminal-red hover:bg-terminal-red-subtle border border-terminal-border`,children:`Delete`}),ne&&(0,V.jsx)(`span`,{className:`text-[11px] font-mono ${ne.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:ne.text})]})]}),p&&(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden p-5 flex flex-col`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,V.jsx)(`span`,{className:`text-sm font-mono font-semibold text-terminal-dim`,children:`GitHub Gist`}),(0,V.jsx)(`span`,{className:`text-[10px] font-mono font-semibold px-2 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer`,children:`Public`})]}),(0,V.jsxs)(`ul`,{className:`space-y-1.5 text-xs font-sans text-terminal-dim mb-auto`,children:[(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`Hosted on GitHub forever`]}),(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-terminal-green shrink-0`,children:`✓`}),`Doesn't use your storage`]}),(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-terminal-orange shrink-0`,children:`!`}),`Visible to everyone on the internet`]})]}),De&&(0,V.jsxs)(`p`,{className:`text-[11px] font-mono text-terminal-red mt-1.5 flex items-center gap-1`,children:[(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,V.jsx)(`path`,{d:`M8 1a1 1 0 0 1 1 1v5.5a1 1 0 0 1-2 0V2a1 1 0 0 1 1-1zM8 11a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 8 11z`})}),`Replay is `,Ws(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:Us(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)(Hs,{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:ee||De,className:`${Ie} ${De?`bg-terminal-surface-2 text-terminal-dimmer border border-terminal-border cursor-not-allowed`:`bg-terminal-surface-hover text-terminal-dim hover:bg-terminal-surface-2 border border-terminal-border`}`,children:ee?`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)(Vs,{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:Us(T.gifGeneratedAt)}),(0,V.jsx)(`button`,{onClick:Ne,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)(Gs,{label:`File`,path:`${T.gifPath} (${Ws(T.gifContent?.length??0,!0)})`}),se?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle`,children:[(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] font-mono font-semibold text-terminal-green px-1.5 py-0.5 rounded-full bg-terminal-green-subtle shrink-0`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green`}),`Shared`]}),(0,V.jsx)(`span`,{className:`flex-1 text-xs font-mono text-terminal-purple truncate`,children:se.url}),(0,V.jsx)(Hs,{text:se.url})]}):(0,V.jsxs)(`p`,{className:`text-[10px] font-mono text-terminal-dimmer leading-relaxed`,children:[`Usage:`,` `,(0,V.jsx)(`span`,{className:`text-terminal-text`,children:``})]}),y&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`button`,{onClick:()=>H(`gif`),disabled:de===`gif`,className:`text-[11px] font-mono px-3 py-1.5 rounded-lg transition-colors bg-terminal-purple-subtle text-terminal-purple hover:bg-[rgba(168,85,247,0.25)] border border-[rgba(168,85,247,0.2)]`,children:de===`gif`?`Uploading...`:se?`Update link`:`Share to Cloud`}),pe&&de===null&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono ${pe.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:pe.text})]})]})]}),T?.svgContent&&(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-orange`,children:`Animated SVG`}),(0,V.jsxs)(`p`,{className:`text-[10px] font-mono text-terminal-dim mt-0.5`,children:[`Embed in READMEs, PRs, or anywhere that renders SVG. Shows up to`,` `,Bs,` 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:Us(T.svgGeneratedAt)}),(0,V.jsx)(`button`,{onClick:Ne,disabled:D||f,className:`text-[11px] font-mono text-terminal-dim hover:text-terminal-orange transition-colors px-1.5 py-0.5 rounded bg-terminal-bg hover:bg-terminal-surface-hover border border-terminal-border-subtle`,title:`Regenerate all exports`,children:D||f?(0,V.jsx)(`span`,{className:`animate-pulse`,children:`...`}):(0,V.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,V.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,V.jsx)(`path`,{d:`M21 3v5h-5`}),(0,V.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,V.jsx)(`path`,{d:`M8 16H3v5`})]})})]})]}),(0,V.jsx)(`div`,{className:`bg-terminal-bg p-2 border-y border-terminal-border-subtle [&>svg]:w-full [&>svg]:h-auto [&>svg]:block`,dangerouslySetInnerHTML:{__html:Fe}}),(0,V.jsxs)(`div`,{className:`px-5 py-3 space-y-2 border-t border-terminal-border-subtle`,children:[(0,V.jsx)(Gs,{label:`File`,path:`${T.svgPath} (${Ws(T.svgContent?.length??0)})`}),T.replayUrl&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-mono text-terminal-dim`,children:[(0,V.jsx)(`span`,{className:`text-terminal-dimmer w-8 shrink-0`,children:`Link`}),(0,V.jsx)(`a`,{href:T.replayUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-terminal-blue hover:text-terminal-text transition-colors truncate`,children:T.replayUrl})]}),le?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle`,children:[(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] font-mono font-semibold text-terminal-green px-1.5 py-0.5 rounded-full bg-terminal-green-subtle shrink-0`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green`}),`Shared`]}),(0,V.jsx)(`span`,{className:`flex-1 text-xs font-mono text-terminal-purple truncate`,children:le.url}),(0,V.jsx)(Hs,{text:le.url})]}):(0,V.jsxs)(`p`,{className:`text-[10px] font-mono text-terminal-dimmer leading-relaxed`,children:[`Usage:`,` `,(0,V.jsx)(`span`,{className:`text-terminal-text`,children:``})]}),y&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`button`,{onClick:()=>H(`svg`),disabled:de===`svg`,className:`text-[11px] font-mono px-3 py-1.5 rounded-lg transition-colors bg-terminal-purple-subtle text-terminal-purple hover:bg-[rgba(168,85,247,0.25)] border border-[rgba(168,85,247,0.2)]`,children:de===`svg`?`Uploading...`:le?`Update link`:`Share to Cloud`}),he&&de===null&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono ${he.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:he.text})]})]})]}),T?.markdown&&(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-orange`,children:`Markdown Summary`}),(0,V.jsx)(`p`,{className:`text-[10px] font-mono text-terminal-dim mt-0.5`,children:`Paste into GitHub PRs, issues, or README files.`})]}),T.mdGeneratedAt&&(0,V.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer self-start mt-0.5`,children:Us(T.mdGeneratedAt)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(Hs,{text:T.markdown,label:`Copy MD`}),(0,V.jsxs)(`div`,{className:`flex items-center h-6 rounded-md overflow-hidden bg-terminal-bg border border-terminal-border-subtle`,children:[(0,V.jsx)(`button`,{onClick:()=>M(`preview`),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${j===`preview`?`bg-terminal-orange-subtle text-terminal-orange`:`text-terminal-dim hover:text-terminal-text`}`,children:`Preview`}),(0,V.jsx)(`button`,{onClick:()=>M(`source`),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${j===`source`?`bg-terminal-orange-subtle text-terminal-orange`:`text-terminal-dim hover:text-terminal-text`}`,children:`Source`})]})]})]}),(0,V.jsx)(`div`,{className:`p-4`,children:j===`preview`?(0,V.jsx)(`div`,{className:`prose-terminal text-xs leading-relaxed bg-terminal-bg rounded-lg border border-terminal-border-subtle p-4 overflow-x-auto`,dangerouslySetInnerHTML:{__html:Pe}}):(0,V.jsx)(`pre`,{className:`bg-terminal-bg rounded-lg border border-terminal-border-subtle p-3 text-[11px] font-mono text-terminal-dim leading-relaxed overflow-x-auto max-h-72 overflow-y-auto whitespace-pre-wrap`,children:T.markdown})}),(0,V.jsx)(`div`,{className:`px-5 py-3 space-y-1.5 border-t border-terminal-border-subtle`,children:(0,V.jsx)(Gs,{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:Ne,disabled:D||f,className:`${Ie} ${T?`bg-terminal-surface-hover text-terminal-orange hover:bg-terminal-orange-subtle border border-terminal-border`:`bg-terminal-orange-subtle text-terminal-orange hover:bg-terminal-orange-emphasis border border-terminal-orange/20`}`,children:D||f?`Generating...`:T?`Regenerate GIF + SVG + Markdown`:`Generate GIF + SVG + Markdown`}),k&&(0,V.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-red`,children:k}),!T&&(0,V.jsx)(`span`,{className:`text-[11px] font-mono text-terminal-dim`,children:`For GitHub PRs, READMEs, websites, email, Slack, and more. Shows up to 8 turns.`})]})]}),p&&l&&(0,V.jsxs)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5`,children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-green mb-1`,children:`HTML Replay`}),(0,V.jsx)(`p`,{className:`text-[11px] font-mono text-terminal-dim leading-relaxed`,children:`Self-contained HTML file with zero external requests. Includes all scenes, metadata, and annotations. Share via email, Slack, or host on any static server.`})]}),(0,V.jsx)(`button`,{onClick:async()=>{h(null);try{h({type:`success`,text:await l()})}catch(e){h({type:`error`,text:e instanceof Error?e.message:String(e)})}},disabled:d,className:`${Ie} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis border border-terminal-green/20`,children:d?`Exporting...`:`Export HTML`})]}),m&&(0,V.jsx)(`div`,{className:`mt-3 text-[11px] font-mono ${m.type===`success`?`text-terminal-green`:`text-terminal-red`}`,children:m.type===`success`?(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-terminal-green shrink-0`}),`Saved to `,m.text]}):m.text})]}),!p&&a&&(0,V.jsx)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5`,children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-green mb-1`,children:`Save HTML`}),(0,V.jsx)(`p`,{className:`text-[11px] font-mono text-terminal-dim leading-relaxed`,children:`Download a self-contained HTML replay file with your comments included.`})]}),(0,V.jsx)(`button`,{onClick:o,className:`${Ie} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis border border-terminal-green/20`,children:`Download HTML`})]})}),(0,V.jsx)(`div`,{className:`bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5`,children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-sm font-mono font-semibold text-terminal-blue mb-1`,children:`JSON Data`}),(0,V.jsx)(`p`,{className:`text-[11px] font-mono text-terminal-dim leading-relaxed`,children:`Raw replay data including all scenes, metadata, and annotations. Useful for backup, re-import, or programmatic analysis.`})]}),(0,V.jsx)(`button`,{onClick:s,className:`${Ie} bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis border border-terminal-blue/20`,children:`Download JSON`})]})})]})]})]})})})}var qs=[{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 Js({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:qs.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 Ys=le;function Xs({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=Le(r.stats.durationMs),c=ve(r.project),l=r.title||c,u=Ys(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 Zs({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:Le(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 Qs(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 $s(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`},tc={"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 nc({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=Qs(a);if(o.toLowerCase().includes(t)&&n.push({sceneIndex:r,type:a.type,snippet:$s(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 ${tc[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:rc(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 rc(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 ic(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 ac(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 oc(e,t){let n=ac(e,t);if(n)return n.length>1?`${n[0]} → ${n[n.length-1]}`:n[0]}function sc(e,t){return ac(e,t)?.join(` → `)}function cc(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 lc({session:e}){let{meta:t,scenes:n}=e,r=(0,_.useMemo)(()=>Ae(t),[t]),i=(0,_.useMemo)(()=>je(t),[t]),a=(0,_.useMemo)(()=>{let e=[],r=0,i=0,a=new Map,o=e=>{let t=a.get(e);return t||(t={path:e,editCount:0,readCount:0,linesAdded:0,linesRemoved:0,turnEdits:new Map},a.set(e,t)),t},s=new Map,c=new Map,l=0,u=0,d=0,f=0,p=0,m=0,h=[],g=()=>{if(e.length>0){let t=e[e.length-1];t.toolCount=r,t.errorCount=i}};for(let t=0;t<n.length;t++){let a=n[t];switch(a.type){case`user-prompt`:{g(),r=0,i=0,d+=a.content.length;let n=a.content.split(`
|
|
101
102
|
`).find(e=>e.trim())||``;e.push({index:e.length+1,text:n.slice(0,120),sceneIndex:t,toolCount:0,errorCount:0});break}case`thinking`:l+=a.content.length;break;case`text-response`:u+=a.content.length;break;case`tool-call`:{r++;let t=a.toolName;if(s.set(t,(s.get(t)||0)+1),t===`Read`){let e=a.input?.file_path;e&&o(e).readCount++}else if(t===`Edit`||t===`Write`){if(a.diff){let t=o(a.diff.filePath);t.editCount++;let n=e.length;t.turnEdits.set(n,(t.turnEdits.get(n)||0)+1);let r=a.diff.oldContent?a.diff.oldContent.split(`
|
|
102
103
|
`).length:0,i=a.diff.newContent?a.diff.newContent.split(`
|
|
103
104
|
`).length:0;t.linesAdded+=Math.max(0,i-r),t.linesRemoved+=Math.max(0,r-i)}}else if(t===`Agent`&&a.subAgent){let t=a.subAgent,n=t.tokenUsage,r=n?n.inputTokens+n.outputTokens+n.cacheCreationTokens+n.cacheReadTokens:0;p+=t.toolCalls,m+=r,h.push({agentType:t.agentType,description:t.description,toolCalls:t.toolCalls,thinkingBlocks:t.thinkingBlocks,textResponses:t.textResponses,totalTokens:r,model:t.model,sceneCount:t.scenes.length});for(let n of t.scenes)if(n.type===`tool-call`&&n.diff){let t=o(n.diff.filePath);t.editCount++;let r=e.length;t.turnEdits.set(r,(t.turnEdits.get(r)||0)+1);let i=n.diff.oldContent?n.diff.oldContent.split(`
|
|
104
105
|
`).length:0,a=n.diff.newContent?n.diff.newContent.split(`
|
|
105
|
-
`).length:0;t.linesAdded+=Math.max(0,a-i),t.linesRemoved+=Math.max(0,i-a)}}else if(t===`Bash`){if(a.bashOutput){let e=
|
|
106
|
-
`),className:`shrink-0`}),t.gitBranch&&(0,H.jsx)(`span`,{className:`shrink-0 text-[10px] font-mono text-terminal-purple px-1.5 py-0.5 rounded bg-terminal-purple/10 border border-terminal-purple/20`,title:ac(t.gitBranch,t.gitBranches),children:ic(t.gitBranch,t.gitBranches)}),t.permissionMode===`bypassPermissions`&&(0,H.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,H.jsxs)(`div`,{className:`rounded border border-terminal-orange/40 bg-terminal-orange/10 px-3 py-2`,children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-orange uppercase tracking-widest mb-1`,children:`Data Quality`}),(0,H.jsx)(`div`,{className:`space-y-0.5`,children:r.slice(0,4).map(e=>(0,H.jsx)(`div`,{className:`text-xs font-mono text-terminal-dim`,children:e},e))})]}),(t.dataSource||t.dataSourceInfo)&&(0,H.jsxs)(`div`,{className:`rounded border border-terminal-border-subtle bg-terminal-surface/40 px-3 py-2`,children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1`,children:`Data Source`}),(0,H.jsx)(`div`,{className:`text-xs font-mono text-terminal-text`,children:Pe(t.dataSourceInfo?.primary||t.dataSource)}),t.dataSourceInfo?.sources&&t.dataSourceInfo.sources.length>0&&(0,H.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:t.dataSourceInfo.sources.map(e=>(0,H.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dim truncate`,title:e,children:[(0,H.jsx)(`span`,{className:`text-terminal-green`,children:`source:`}),` `,e]},e))}),t.dataSourceInfo?.supplements&&t.dataSourceInfo.supplements.length>0&&(0,H.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:t.dataSourceInfo.supplements.map(e=>(0,H.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dim truncate`,title:e,children:[(0,H.jsx)(`span`,{className:`text-terminal-purple`,children:`supplement:`}),` `,e]},e))})]}),t.provider===`cursor`&&t.cursorSidecars&&(t.cursorSidecars.requestContextCount||t.cursorSidecars.checkpointCount||t.cursorSidecars.hasWorkspaceRules)&&(0,H.jsxs)(`div`,{className:`rounded border border-terminal-border-subtle bg-terminal-surface/40 px-3 py-2`,children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1`,children:`Cursor Sidecars`}),(0,H.jsxs)(`div`,{className:`space-y-0.5 text-xs font-mono text-terminal-dim`,children:[t.cursorSidecars.requestContextCount?(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{className:`text-terminal-green`,children:`request context:`}),` `,t.cursorSidecars.requestContextCount,` sidecar`,t.cursorSidecars.requestContextCount===1?``:`s`]}):null,t.cursorSidecars.hasWorkspaceRules?(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{className:`text-terminal-purple`,children:`workspace rules:`}),` included`]}):null,t.cursorSidecars.checkpointCount?(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{className:`text-terminal-orange`,children:`checkpoint state:`}),` `,t.cursorSidecars.checkpointCount,` entr`,t.cursorSidecars.checkpointCount===1?`y`:`ies`]}):null]})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-3`,children:`Overview`}),(0,H.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3`,children:[(0,H.jsx)(Fe,{label:`Turns`,value:a.userPrompts,color:`text-terminal-green`}),(0,H.jsx)(Fe,{label:`Tool Calls`,value:a.toolCalls,color:`text-terminal-orange`}),(0,H.jsx)(Fe,{label:`Files Modified`,value:a.editedFiles.length,color:`text-terminal-blue`}),(0,H.jsx)(Fe,{label:`Scenes`,value:a.totalScenes,color:`text-terminal-text`})]}),a.totalDelegatedTools>0&&(0,H.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,H.jsxs)(`span`,{className:`text-green-300`,children:[`+`,a.totalDelegatedTools,` tools delegated`]}),(0,H.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[`to `,a.subAgents.length,` sub-agent`,a.subAgents.length>1?`s`:``]}),a.totalDelegatedTokens>0&&(0,H.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,H.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,H.jsxs)(`div`,{children:[`Model: `,(0,H.jsx)(`span`,{className:`text-terminal-text font-semibold`,children:t.model})]}),(a.durationMs||i.duration)&&(0,H.jsxs)(`div`,{children:[`Duration:`,` `,(0,H.jsx)(`span`,{className:`text-terminal-text`,children:a.durationMs?Ie(a.durationMs):`unavailable`}),i.duration&&(0,H.jsx)(je,{title:i.duration,className:`ml-1`})]}),a.costEstimate!==void 0&&(0,H.jsxs)(`div`,{children:[`Cost:`,` `,(0,H.jsxs)(`span`,{className:`text-terminal-green`,children:[`$`,a.costEstimate<.01?a.costEstimate.toFixed(4):a.costEstimate.toFixed(2)]}),(0,H.jsx)(`span`,{className:`text-terminal-dimmer`,children:` (est.)`}),i.tokens&&(0,H.jsx)(je,{title:i.tokens,className:`ml-1`})]}),a.tokenUsage?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{children:[`In:`,` `,(0,H.jsx)(`span`,{className:`text-terminal-blue`,children:W(a.tokenUsage.inputTokens)}),` / `,`Out:`,` `,(0,H.jsx)(`span`,{className:`text-terminal-green`,children:W(a.tokenUsage.outputTokens)})]}),(0,H.jsxs)(`div`,{children:[`Cache:`,` `,(0,H.jsx)(`span`,{className:`text-terminal-purple`,children:W(a.tokenUsage.cacheReadTokens)}),` `,`read /`,` `,(0,H.jsx)(`span`,{className:`text-terminal-orange`,children:W(a.tokenUsage.cacheCreationTokens)}),` `,`created`]})]}):i.tokens&&(0,H.jsxs)(`div`,{children:[`Tokens: `,(0,H.jsx)(`span`,{className:`text-terminal-text`,children:`unavailable`}),(0,H.jsx)(je,{title:i.tokens,className:`ml-1`})]}),!o&&i.turnStats&&(0,H.jsxs)(`div`,{children:[`Turn Stats: `,(0,H.jsx)(`span`,{className:`text-terminal-text`,children:`limited`}),(0,H.jsx)(je,{title:i.turnStats,className:`ml-1`})]})]})]}),o&&(0,H.jsxs)(`div`,{className:`space-y-5`,children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest`,children:`Per-Turn Metrics`}),(0,H.jsx)(dc,{turnStats:t.stats.turnStats,costEstimate:t.stats.costEstimate,turnLabels:s}),(0,H.jsx)(pc,{turnStats:t.stats.turnStats,turnLabels:s}),a.turns.length>=2&&(0,H.jsx)(gc,{turns:a.turns,turnLabels:s}),t.stats.turnStats.some(e=>e.durationMs)&&(0,H.jsx)(mc,{turnStats:t.stats.turnStats,turnLabels:s})]}),t.tokenUsageByModel&&Object.keys(t.tokenUsageByModel).length>1&&(0,H.jsx)(hc,{tokenUsageByModel:t.tokenUsageByModel}),t.apiErrors&&t.apiErrors.length>0&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:`API Issues`}),(0,H.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,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`text-terminal-text`,children:[a.join(` and `),` `,(0,H.jsxs)(`span`,{className:`text-terminal-red`,children:[e.length,` times`]}),` during this session`,n>1&&(0,H.jsxs)(H.Fragment,{children:[`, with up to`,` `,(0,H.jsxs)(`span`,{className:`text-terminal-orange`,children:[n,` retries`]}),` in a row`]}),`.`]}),(0,H.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,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:[`Files Tracked (`,t.trackedFiles.length,`)`]}),(0,H.jsx)(`div`,{className:`space-y-0.5 max-h-[200px] overflow-y-auto`,children:t.trackedFiles.map(e=>(0,H.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,H.jsxs)(`div`,{children:[(0,H.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,H.jsx)(`div`,{className:`space-y-0.5 max-h-[200px] overflow-y-auto`,children:t.contextFiles.map(e=>(0,H.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,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:`Pull Requests`}),(0,H.jsx)(`div`,{className:`space-y-1`,children:t.prLinks.map(e=>(0,H.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,H.jsxs)(`span`,{className:`text-terminal-green`,children:[`#`,e.prNumber]}),e.prRepository&&(0,H.jsx)(`span`,{className:`text-terminal-dimmer truncate`,children:e.prRepository})]},e.prUrl))})]}),a.turns.length>0&&(0,H.jsx)(yc,{turns:a.turns,turnStats:t.stats.turnStats}),(0,H.jsx)(_c,{editedFiles:a.editedFiles,turns:a.turns}),(a.editedFiles.length>0||a.readOnlyFiles.length>0)&&(0,H.jsx)(Cc,{editedFiles:a.editedFiles,readOnlyFiles:a.readOnlyFiles}),a.bashCats.length>1&&(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:[`Bash Commands`,a.totalBashErrors>0&&(0,H.jsxs)(`span`,{className:`text-terminal-red ml-2 normal-case tracking-normal`,children:[a.totalBashErrors,` error`,a.totalBashErrors===1?``:`s`]})]}),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:a.bashCats.map(([e,t])=>(0,H.jsxs)(`span`,{className:`text-xs font-mono text-terminal-dim bg-terminal-surface rounded px-2 py-1`,children:[e,` `,(0,H.jsx)(`span`,{className:`text-terminal-text tabular-nums`,children:t})]},e))})]}),a.topTools.length>0&&(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:[`Top Tools`,(0,H.jsxs)(`span`,{className:`text-terminal-dimmer ml-2 normal-case tracking-normal font-mono`,children:[a.totalTools,` total`]})]}),(0,H.jsx)(`div`,{className:`space-y-1.5`,children:a.topTools.map(([e,t])=>(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono`,children:[(0,H.jsx)(`span`,{className:`text-terminal-text shrink-0 w-24 text-right truncate`,title:e,children:e}),(0,H.jsx)(`div`,{className:`flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden`,children:(0,H.jsx)(`div`,{className:`h-full rounded-full bg-terminal-orange`,style:{width:`${t/a.topTools[0][1]*100}%`}})}),(0,H.jsxs)(`span`,{className:`text-terminal-dim shrink-0 w-16 text-right tabular-nums`,children:[t,` `,(0,H.jsxs)(`span`,{className:`text-terminal-dimmer`,children:[`(`,Math.round(t/a.totalTools*100),`%)`]})]})]},e))})]}),a.subAgents.length>0&&(0,H.jsx)(lc,{subAgents:a.subAgents}),a.totalTools>0&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:`Activity Distribution`}),(0,H.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,H.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono`,children:[(0,H.jsx)(`span`,{className:`text-terminal-text shrink-0 w-24 text-right`,children:e}),(0,H.jsx)(`div`,{className:`flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden`,children:(0,H.jsx)(`div`,{className:`h-full rounded-full`,style:{width:`${t/a.totalTools*100}%`,backgroundColor:`var(${n})`}})}),(0,H.jsxs)(`span`,{className:`text-terminal-dim shrink-0 w-16 text-right tabular-nums`,children:[t,` (`,Math.round(t/a.totalTools*100),`%)`]})]},e))})]})]})})}var cc={Explore:`bg-blue-500/20 text-blue-300 border-blue-500/30`,Plan:`bg-purple-500/20 text-purple-300 border-purple-500/30`,Shell:`bg-cyan-500/20 text-cyan-300 border-cyan-500/30`,"general-purpose":`bg-green-500/20 text-green-300 border-green-500/30`,"claude-code-guide":`bg-amber-500/20 text-amber-300 border-amber-500/30`};function lc({subAgents:e}){let t=new Map,n=0,r=0;for(let i of e){let e=t.get(i.agentType)||{count:0,toolCalls:0,totalTokens:0};e.count++,e.toolCalls+=i.toolCalls,e.totalTokens+=i.totalTokens,t.set(i.agentType,e),n+=i.toolCalls,r+=i.totalTokens}let i=[...t.entries()].sort((e,t)=>t[1].count-e[1].count);return(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:[`Sub-Agents (`,e.length,`)`]}),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-2 mb-3`,children:i.map(([e,t])=>(0,H.jsxs)(`span`,{className:`text-[11px] px-2 py-1 rounded border font-mono ${cc[e]||`bg-gray-500/20 text-gray-300 border-gray-500/30`}`,children:[e,` `,(0,H.jsxs)(`span`,{className:`opacity-70`,children:[`x`,t.count,` (`,t.toolCalls,` tools)`]})]},e))}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs font-mono text-terminal-dim`,children:[(0,H.jsxs)(`div`,{children:[`Delegated tools: `,(0,H.jsx)(`span`,{className:`text-terminal-text`,children:n})]}),r>0&&(0,H.jsxs)(`div`,{children:[`Delegated tokens:`,` `,(0,H.jsx)(`span`,{className:`text-terminal-text`,children:r>1e6?`${(r/1e6).toFixed(1)}M`:r>1e3?`${(r/1e3).toFixed(0)}K`:r}),(0,H.jsx)(`span`,{className:`text-terminal-dimmer`,children:` (context-free)`})]})]}),(0,H.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[e.slice(0,20).map((e,t)=>(0,H.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,H.jsx)(`span`,{className:`px-1 py-0.5 rounded border text-[9px] ${cc[e.agentType]||`bg-gray-500/20 text-gray-300 border-gray-500/30`}`,children:e.agentType}),(0,H.jsx)(`span`,{className:`truncate flex-1 text-terminal-text/70`,children:e.description||`(no description)`}),(0,H.jsxs)(`span`,{className:`shrink-0`,children:[e.toolCalls,` tools`]}),e.totalTokens>0&&(0,H.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,H.jsxs)(`div`,{className:`text-[10px] text-terminal-dimmer font-mono px-2`,children:[`... and `,e.length-20,` more`]})]})]})}function uc({children:e,visible:t,x:n}){if(!t)return null;let r=n>.7;return(0,H.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,H.jsx)(`div`,{className:`bg-terminal-surface border border-terminal-border-subtle rounded px-2 py-1 text-[10px] font-mono text-terminal-text shadow-md whitespace-nowrap ${r?`text-right`:``}`,children:e})})}function dc({turnStats:e,costEstimate:t,turnLabels:n}){let r=[],i=0;for(let t of e)i+=t.tokenUsage?.outputTokens||0,r.push(i);let a=r.length,{hovered:o,ref:s,onMouseMove:c,onMouseLeave:l}=oc(a);if(i===0)return null;let u=r[r.length-1],d=r.map((e,t)=>`${a===1?100/2:t/(a-1)*100},${60-e/u*54-3}`),f=o===null?0:a===1?.5:o/(a-1);return(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1`,children:[`Token Burn`,t?` & Cost`:``]}),(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsxs)(`svg`,{ref:s,viewBox:`0 0 100 60`,preserveAspectRatio:`none`,className:`w-full h-20`,onMouseMove:c,onMouseLeave:l,children:[(0,H.jsx)(`polygon`,{points:`0,60 ${d.join(` `)} 100,60`,style:{fill:`var(--green-subtle)`}}),(0,H.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,H.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,H.jsx)(uc,{visible:o!==null,x:f,children:o!==null&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`text-terminal-green`,children:[`Turn `,o+1]}),n?.[o]&&(0,H.jsx)(`div`,{className:`text-terminal-dim truncate max-w-[200px]`,children:n[o]}),(0,H.jsxs)(`div`,{children:[`cumulative: `,W(r[o]),` tokens`]}),e[o]?.tokenUsage&&(0,H.jsxs)(`div`,{className:`text-terminal-dimmer`,children:[`this turn: +`,W(e[o].tokenUsage.outputTokens),` out`]})]})})]}),(0,H.jsxs)(`div`,{className:`flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5`,children:[(0,H.jsx)(`span`,{children:`Turn 1`}),(0,H.jsxs)(`span`,{children:[W(u),` tokens`,t?` ($${t<1?t.toFixed(2):t.toFixed(0)})`:``]}),(0,H.jsxs)(`span`,{children:[`Turn `,a]})]}),e.some(e=>e.tokenUsage?.cacheReadTokens)&&(0,H.jsx)(fc,{turnStats:e})]})}function fc({turnStats:e}){let t=nr(e),n=t.map(e=>ir(e)/100),r=rr(t)/100,i=n.map((e,t)=>`${n.length===1?100/2:t/(n.length-1)*100},${24-e*20-2}`);return(0,H.jsxs)(`div`,{className:`mt-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest`,children:`Cache Hit Rate`}),(0,H.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-purple`,children:[`avg `,Math.round(r*100),`%`]})]}),(0,H.jsx)(`svg`,{viewBox:`0 0 100 24`,preserveAspectRatio:`none`,className:`w-full h-6`,children:(0,H.jsx)(`polyline`,{points:i.join(` `),fill:`none`,style:{stroke:`var(--purple)`},strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`})})]})}function pc({turnStats:e,turnLabels:t}){let n=e.map(e=>e.contextTokens||0),r=n.length,{hovered:i,ref:a,onMouseMove:o,onMouseLeave:s}=oc(r);if(!n.some(e=>e>0))return null;let c=Math.max(...n),l=e.some(e=>e.tokenUsage),u=nr(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=rr(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:ir(u[i]);return(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1 flex items-center gap-2`,children:[(0,H.jsx)(`span`,{children:`Context Window Usage`}),(0,H.jsxs)(`span`,{className:`font-mono text-terminal-cyan`,children:[`peak `,W(c)]})]}),(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.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,H.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,H.jsxs)(H.Fragment,{children:[v.map((e,t)=>(0,H.jsx)(`polygon`,{points:e,style:{fill:`var(--cyan-subtle)`},opacity:`0.6`},`nd-${t}`)),(0,H.jsx)(`polygon`,{points:_.total,style:{fill:`var(--orange-subtle)`}}),(0,H.jsx)(`polygon`,{points:_.uncached,style:{fill:`var(--purple-subtle)`}}),(0,H.jsx)(`polygon`,{points:_.cacheRead,style:{fill:`var(--green-subtle)`}})]}):(0,H.jsx)(`polygon`,{points:`0,60 ${g.join(` `)} 100,60`,style:{fill:`var(--cyan-subtle)`}}),(0,H.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,H.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,H.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,H.jsx)(uc,{visible:i!==null,x:C,children:i!==null&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`text-terminal-cyan`,children:[`Turn `,i+1]}),t?.[i]&&(0,H.jsx)(`div`,{className:`text-terminal-dim truncate max-w-[200px]`,children:t[i]}),(0,H.jsxs)(`div`,{children:[W(n[i]),` tokens`]}),l&&u[i].rawSum>0&&(0,H.jsxs)(`div`,{className:`mt-0.5 border-t border-terminal-border-subtle pt-0.5 space-y-px`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--green)`}}),(0,H.jsxs)(`span`,{children:[`cache read `,W(u[i].rawCr)]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--purple)`}}),(0,H.jsxs)(`span`,{children:[`uncached`,` `,W(u[i].rawSum-u[i].rawCr-(e[i].tokenUsage?.cacheCreationTokens||0))]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--orange)`}}),(0,H.jsxs)(`span`,{children:[`cache write `,W(e[i].tokenUsage?.cacheCreationTokens||0)]})]}),(0,H.jsxs)(`div`,{className:`text-terminal-dim`,children:[T.toFixed(0),`% cache hit`]})]})]})})]}),(0,H.jsxs)(`div`,{className:`flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5`,children:[(0,H.jsx)(`span`,{children:`Turn 1`}),(0,H.jsx)(`span`,{children:f?`limit ${W(f)}`:`peak ${W(c)}`}),(0,H.jsxs)(`span`,{children:[`Turn `,r]})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-0.5 mt-1`,children:[b.length>0&&(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`inline-block w-3 border-t border-dashed`,style:{borderColor:`var(--red)`}}),(0,H.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:[b.length,` compaction`,b.length===1?``:`s`]})]}),l&&S>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--green)`}}),(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`cache read`})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--purple)`}}),(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`uncached`})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--orange)`}}),(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`cache write`})]}),y&&(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-sm`,style:{background:`var(--cyan-subtle)`,opacity:.6}}),(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-dimmer`,children:`no breakdown`})]}),(0,H.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-cyan`,children:[x.toFixed(0),`% cache hit`]})]})]})]})}function mc({turnStats:e,turnLabels:t}){let n=e.map(e=>e.durationMs||0),r=Math.max(...n,1),i=n.some(e=>e>0),[a,o]=(0,_.useState)(null);return i?(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1`,children:`Turn Duration`}),(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(`div`,{className:`flex items-end gap-px h-16`,onMouseLeave:()=>o(null),children:n.map((e,t)=>(0,H.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,H.jsx)(uc,{visible:a!==null,x:a===null?0:n.length===1?.5:a/(n.length-1),children:a!==null&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`text-terminal-blue`,children:[`Turn `,a+1]}),t?.[a]&&(0,H.jsx)(`div`,{className:`text-terminal-dim truncate max-w-[200px]`,children:t[a]}),(0,H.jsx)(`div`,{children:n[a]>0?Ie(n[a]):`no data`})]})})]}),(0,H.jsxs)(`div`,{className:`flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5`,children:[(0,H.jsx)(`span`,{children:`Turn 1`}),(0,H.jsxs)(`span`,{children:[`max `,Ie(r)]}),(0,H.jsxs)(`span`,{children:[`Turn `,n.length]})]})]}):null}function hc({tokenUsageByModel:e}){let t=Object.entries(e).sort((e,t)=>t[1].outputTokens-e[1].outputTokens),n=t.reduce((e,[,t])=>e+t.outputTokens,0);if(n===0)return null;let r=[`--green`,`--blue`,`--purple`,`--orange`,`--red`];return(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:`Model Breakdown`}),(0,H.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,H.jsx)(`div`,{style:{width:`${a}%`,minWidth:a>2?void 0:`3px`,backgroundColor:`var(${r[i%r.length]})`,opacity:.7},title:`${e}: ${W(t.outputTokens)} output tokens`},e)})}),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-3 mt-1.5`,children:t.map(([e,t],i)=>(0,H.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] font-mono text-terminal-dimmer`,children:[(0,H.jsx)(`div`,{className:`w-2 h-2 rounded-sm`,style:{backgroundColor:`var(${r[i%r.length]})`,opacity:.7}}),(0,H.jsxs)(`span`,{children:[e,` `,W(t.outputTokens),` (`,Math.round(t.outputTokens/n*100),`%)`]})]},e))})]})}function gc({turns:e,turnLabels:t}){let n=e.map(e=>e.toolCount),r=Math.max(...n,1),[i,a]=(0,_.useState)(null);return e.length<2?null:(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1`,children:`Tool Calls per Turn`}),(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(`div`,{className:`flex items-end gap-px h-16`,onMouseLeave:()=>a(null),children:n.map((e,t)=>(0,H.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,H.jsx)(uc,{visible:i!==null,x:i===null?0:n.length===1?.5:i/(n.length-1),children:i!==null&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`text-terminal-orange`,children:[`Turn `,i+1]}),t?.[i]&&(0,H.jsx)(`div`,{className:`text-terminal-dim truncate max-w-[200px]`,children:t[i]}),(0,H.jsxs)(`div`,{children:[n[i],` tool calls`]})]})})]}),(0,H.jsxs)(`div`,{className:`flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5`,children:[(0,H.jsx)(`span`,{children:`Turn 1`}),(0,H.jsxs)(`span`,{children:[`max `,r]}),(0,H.jsxs)(`span`,{children:[`Turn `,n.length]})]})]})}function _c({editedFiles:e,turns:t}){if(t.length<3||e.length<1)return null;let n=e.slice(0,8),r=t.map(e=>e.index),i=r.length>60,a=i?r.slice(-60):r,o=1;for(let e of n)for(let t of a){let n=e.turnEdits.get(t)||0;n>o&&(o=n)}return(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:[`File Activity Heatmap`,i&&(0,H.jsxs)(`span`,{className:`normal-case tracking-normal font-normal ml-2`,children:[`(last `,60,` of `,r.length,` turns)`]})]}),(0,H.jsx)(`div`,{className:`overflow-x-auto`,children:(0,H.jsxs)(`div`,{className:`grid gap-px text-[10px] font-mono`,style:{gridTemplateColumns:`minmax(80px, 120px) repeat(${a.length}, minmax(16px, 1fr))`},children:[(0,H.jsx)(`div`,{className:`text-terminal-dimmer px-1 py-0.5`}),a.map(e=>(0,H.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,H.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,H.jsx)(`div`,{className:`rounded-sm`,style:{backgroundColor:r===0?`transparent`:`color-mix(in srgb, var(--orange) ${i}%, transparent)`,minHeight:14},title:r>0?`${t} — Turn ${n}: ${r} edit${r===1?``:`s`}`:void 0},`${e.path}-${n}`)})]})]})})]})}var vc=20;function yc({turns:e,turnStats:t}){let[n,r]=(0,_.useState)(!1),{rows:i,compactionAfter:a}=(0,_.useMemo)(()=>{let n=Math.max(...e.map(e=>e.toolCount),1),r=Math.max(...t?.map(e=>e.durationMs||0)||[0],1),i=Math.max(...t?.map(e=>e.contextTokens||0)||[0],1),a=Math.max(...t?.map(e=>e.tokenUsage?.outputTokens||0)||[0],1),o=new Set;if(t)for(let e=0;e<t.length-1;e++){let n=t[e]?.contextTokens||0,r=t[e+1]?.contextTokens||0;n>0&&r>0&&r<n*.5&&o.add(e)}return{rows:e.map((e,o)=>{let s=t?.[o];return{...e,durationMs:s?.durationMs,contextTokens:s?.contextTokens,outputTokens:s?.tokenUsage?.outputTokens,toolRatio:e.toolCount/n,durationRatio:(s?.durationMs||0)/r,contextRatio:(s?.contextTokens||0)/i,outputRatio:(s?.tokenUsage?.outputTokens||0)/a}}),compactionAfter:o}},[e,t]),o=t&&t.length>0,s=o&&t.some(e=>e.durationMs),c=o&&t.some(e=>e.contextTokens),l=o&&t.some(e=>e.tokenUsage),u=3+(s?1:0)+(c?1:0)+(l?1:0),d=i.length>vc,f=d&&!n?i.slice(0,vc):i;return(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:`Per-Turn Breakdown`}),(0,H.jsx)(`div`,{className:`overflow-x-auto rounded border border-terminal-border-subtle`,children:(0,H.jsxs)(`table`,{className:`w-full text-[11px] font-mono border-collapse`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{className:`text-terminal-dimmer text-left`,children:[(0,H.jsx)(`th`,{className:`px-2 py-1.5 font-semibold w-7`,children:`#`}),(0,H.jsx)(`th`,{className:`px-2 py-1.5 font-semibold`,children:`Prompt`}),(0,H.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-14`,children:`Tools`}),s&&(0,H.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-16`,children:`Duration`}),c&&(0,H.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-16`,children:`Context`}),l&&(0,H.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-14`,children:`Output`})]})}),(0,H.jsx)(`tbody`,{children:f.map((e,t)=>(0,H.jsx)(bc,{row:e,hasDuration:!!s,hasContext:!!c,hasTokens:!!l,colCount:u,showCompaction:a.has(t)},e.sceneIndex))}),d&&(0,H.jsx)(`tfoot`,{children:(0,H.jsx)(`tr`,{children:(0,H.jsx)(`td`,{colSpan:u,children:(0,H.jsx)(`button`,{type:`button`,className:`w-full py-1.5 text-[11px] font-mono text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors`,onClick:()=>r(!n),children:n?`▴ Collapse`:`▾ Show all ${i.length} turns (${i.length-vc} more)`})})})})]})})]})}function bc({row:e,hasDuration:t,hasContext:n,hasTokens:r,colCount:i,showCompaction:a}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`tr`,{className:`border-t border-terminal-border-subtle hover:bg-terminal-surface-hover transition-colors`,children:[(0,H.jsx)(`td`,{className:`px-2 py-1 text-terminal-green tabular-nums`,children:String(e.index).padStart(2,`0`)}),(0,H.jsx)(`td`,{className:`px-2 py-1 text-terminal-text max-w-0`,children:(0,H.jsxs)(`div`,{className:`truncate`,title:e.text,children:[e.text,e.errorCount>0&&(0,H.jsxs)(`span`,{className:`text-terminal-red ml-1.5`,children:[e.errorCount,` err`]})]})}),(0,H.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:(0,H.jsx)(xc,{value:e.toolCount,ratio:e.toolRatio,color:`--orange`})}),t&&(0,H.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:(0,H.jsx)(xc,{value:e.durationMs?Ie(e.durationMs):`—`,ratio:e.durationRatio,color:`--blue`})}),n&&(0,H.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:(0,H.jsx)(xc,{value:e.contextTokens?W(e.contextTokens):`—`,ratio:e.contextRatio,color:`--cyan`})}),r&&(0,H.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:(0,H.jsx)(xc,{value:e.outputTokens?W(e.outputTokens):`—`,ratio:e.outputRatio,color:`--green`})})]}),a&&(0,H.jsx)(`tr`,{children:(0,H.jsx)(`td`,{colSpan:i,className:`px-0 py-0`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-0.5 bg-terminal-red/5`,children:[(0,H.jsx)(`div`,{className:`flex-1 border-t border-dashed border-terminal-red/40`}),(0,H.jsx)(`span`,{className:`text-[10px] font-mono text-terminal-red/70 shrink-0`,children:`context compacted`}),(0,H.jsx)(`div`,{className:`flex-1 border-t border-dashed border-terminal-red/40`})]})})})]})}function xc({value:e,ratio:t,color:n}){return(0,H.jsx)(`span`,{className:`inline-block w-full px-1 py-0.5 rounded-sm text-terminal-text`,style:{backgroundColor:t>0?`color-mix(in srgb, var(${n}) ${Math.round(t*40)}%, transparent)`:void 0},children:e})}var Sc=20;function Cc({editedFiles:e,readOnlyFiles:t}){let[n,r]=(0,_.useState)(!1),i=(0,_.useMemo)(()=>[...e,...t],[e,t]),a=(0,_.useMemo)(()=>Math.max(...i.map(e=>e.editCount),1),[i]),o=(0,_.useMemo)(()=>Math.max(...i.map(e=>e.readCount),1),[i]),s=(0,_.useMemo)(()=>Math.max(...i.map(e=>e.linesAdded+e.linesRemoved),1),[i]),c=i.some(e=>e.linesAdded>0||e.linesRemoved>0),l=i.some(e=>e.turnEdits.size>0),u=i.length>Sc,d=u&&!n?i.slice(0,Sc):i,f=3+(c?1:0)+(l?1:0);return(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2`,children:[`File Impact`,(0,H.jsxs)(`span`,{className:`normal-case tracking-normal ml-1.5`,children:[`(`,e.length,` modified`,t.length>0&&`, ${t.length} read-only`,`)`]})]}),(0,H.jsx)(`div`,{className:`overflow-x-auto rounded border border-terminal-border-subtle`,children:(0,H.jsxs)(`table`,{className:`w-full text-[11px] font-mono border-collapse`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{className:`text-terminal-dimmer text-left`,children:[(0,H.jsx)(`th`,{className:`px-2 py-1.5 font-semibold`,children:`File`}),(0,H.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-14`,children:`Edits`}),(0,H.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-14`,children:`Reads`}),c&&(0,H.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-20`,children:`+/−`}),l&&(0,H.jsx)(`th`,{className:`px-2 py-1.5 font-semibold text-right w-14`,children:`Turns`})]})}),(0,H.jsx)(`tbody`,{children:d.map(e=>{let t=e.path.split(`/`).pop()||e.path;return(0,H.jsxs)(`tr`,{className:`border-t border-terminal-border-subtle hover:bg-terminal-surface-hover transition-colors`,children:[(0,H.jsx)(`td`,{className:`px-2 py-1 max-w-0`,children:(0,H.jsxs)(`div`,{className:`truncate ${e.editCount>0?`text-terminal-text`:`text-terminal-dimmer`}`,title:e.path,children:[t,e.editCount>=10&&(0,H.jsx)(`span`,{className:`text-terminal-red ml-1`,title:`${e.editCount} edits — high churn file`,children:`⚠`}),(0,H.jsx)(`span`,{className:`text-terminal-dimmer ml-1`,children:e.path.slice(0,e.path.length-t.length-1)})]})}),(0,H.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:e.editCount>0?(0,H.jsx)(xc,{value:e.editCount,ratio:e.editCount/a,color:`--orange`}):(0,H.jsx)(`span`,{className:`text-terminal-dimmer`,children:`—`})}),(0,H.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:e.readCount>0?(0,H.jsx)(xc,{value:e.readCount,ratio:e.readCount/o,color:`--blue`}):(0,H.jsx)(`span`,{className:`text-terminal-dimmer`,children:`—`})}),c&&(0,H.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:e.linesAdded>0||e.linesRemoved>0?(0,H.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,H.jsxs)(`span`,{className:`text-terminal-green`,children:[`+`,e.linesAdded]}),(0,H.jsx)(`span`,{className:`text-terminal-dimmer`,children:`/`}),(0,H.jsxs)(`span`,{className:`text-terminal-red`,children:[`−`,e.linesRemoved]})]}):(0,H.jsx)(`span`,{className:`text-terminal-dimmer`,children:`—`})}),l&&(0,H.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:e.turnEdits.size>0?(0,H.jsx)(`span`,{className:`text-terminal-dim`,children:e.turnEdits.size}):(0,H.jsx)(`span`,{className:`text-terminal-dimmer`,children:`—`})})]},e.path)})}),u&&(0,H.jsx)(`tfoot`,{children:(0,H.jsx)(`tr`,{children:(0,H.jsx)(`td`,{colSpan:f,children:(0,H.jsx)(`button`,{type:`button`,className:`w-full py-1.5 text-[11px] font-mono text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors`,onClick:()=>r(!n),children:n?`▴ Collapse`:`▾ Show all ${i.length} files (${i.length-Sc} more)`})})})})]})})]})}function wc(e){switch(e){case`user-prompt`:return`#3fb950`;case`compaction-summary`:return`#666666`;case`context-injection`:return`#4488cc`;case`thinking`:return`#b392f0`;case`text-response`:return`#79b8ff`;case`tool-call`:return`#d29922`}}function Tc({scenes:e,currentIndex:t,onSeek:n,annotatedScenes:r}){let i=(0,_.useMemo)(()=>{if(e.length<=200)return e.map((e,t)=>({startIndex:t,endIndex:t,type:e.type}));let t=e.length/200,n=[];for(let r=0;r<200;r++){let i=Math.floor(r*t),a=Math.floor((r+1)*t)-1,o={"user-prompt":4,"compaction-summary":1,"context-injection":1,"tool-call":3,"text-response":2,thinking:1},s=e[i].type,c=o[s];for(let t=i+1;t<=a&&t<e.length;t++){let n=o[e[t].type];n>c&&(s=e[t].type,c=n)}n.push({startIndex:i,endIndex:a,type:s})}return n},[e]),a=e.length>0?(t+1)/e.length*100:0,o=(0,_.useRef)(null),s=(0,_.useCallback)(t=>{let r=o.current;if(!r)return;let i=r.getBoundingClientRect(),a=t.clientX-i.left,s=Math.max(0,Math.min(1,a/i.width));n(Math.floor(s*e.length))},[e.length,n]),c=(0,_.useMemo)(()=>{if(!r||r.size===0)return[];let t=[];return r.forEach(n=>{n>=0&&n<e.length&&t.push((n+.5)/e.length*100)}),t},[r,e.length]),l=(0,_.useMemo)(()=>{let t=[];for(let n=0;n<e.length;n++)e[n].type===`compaction-summary`&&t.push((n+.5)/e.length*100);return t},[e]),u=(0,_.useCallback)(r=>{r.key===`ArrowRight`||r.key===`ArrowUp`?(r.preventDefault(),n(Math.min(t+1,e.length-1))):r.key===`ArrowLeft`||r.key===`ArrowDown`?(r.preventDefault(),n(Math.max(t-1,0))):r.key===`Home`?(r.preventDefault(),n(0)):r.key===`End`&&(r.preventDefault(),n(e.length-1))},[t,e.length,n]);return e.length===0?null:(0,H.jsxs)(`div`,{className:`px-4 pt-3 pb-1 cursor-pointer`,onClick:s,onKeyDown:u,role:`slider`,"aria-label":`Scene timeline`,"aria-valuemin":0,"aria-valuemax":e.length-1,"aria-valuenow":t,tabIndex:0,children:[(c.length>0||l.length>0)&&(0,H.jsxs)(`div`,{className:`relative h-2 mb-0.5`,children:[c.map((e,t)=>(0,H.jsx)(`div`,{className:`absolute w-1.5 h-1.5 rounded-full bg-terminal-blue shadow-layer-sm`,style:{left:`${e}%`,top:`50%`,transform:`translate(-50%, -50%)`}},`a-${t}`)),l.map((e,t)=>(0,H.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,H.jsxs)(`div`,{ref:o,className:`relative flex h-2 rounded-full overflow-hidden bg-terminal-surface-2`,children:[i.map((e,n)=>(0,H.jsx)(`div`,{className:`flex-1 transition-opacity duration-150`,style:{backgroundColor:wc(e.type),opacity:e.startIndex<=t?1:.15}},n)),l.map((e,t)=>(0,H.jsx)(`div`,{className:`absolute top-0 bottom-0 w-px bg-terminal-red/60`,style:{left:`${e}%`}},`cl-${t}`)),(0,H.jsx)(`div`,{className:`absolute top-0 bottom-0 w-0.5 bg-white shadow-layer-sm transition-[left] duration-150 ease-material`,style:{left:`${a}%`}})]})]})}var Ec=[{key:`replay`,label:`Replay`},{key:`summary`,label:`Insights`},{key:`export`,label:`Share & Export`}],Dc=`vr-insights-seen`;function Oc(){try{return localStorage.getItem(Dc)===`1`}catch{return!1}}function kc(){try{localStorage.setItem(Dc,`1`)}catch{}}function Ac({activeView:e,onChangeView:t,className:n=``,rightContent:r,hiddenTabs:i}){let[a,o]=(0,_.useState)(()=>Oc()||e===`summary`),s=(0,_.useCallback)(e=>{e===`summary`&&!a&&(kc(),o(!0)),t(e)},[t,a]);return(0,H.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,H.jsx)(`div`,{className:`flex bg-terminal-surface/30`,children:Ec.filter(e=>!i?.includes(e.key)).map(({key:t,label:n})=>(0,H.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,H.jsxs)(`span`,{className:`absolute top-1.5 right-1 flex h-2 w-2`,children:[(0,H.jsx)(`span`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-green opacity-75`}),(0,H.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-terminal-green`})]})]},t))}),r&&(0,H.jsx)(`div`,{className:`pr-4 py-1.5 flex items-center`,children:r})]})}function jc(e){e.classList.remove(`jump-target-flash`),e.offsetWidth,e.classList.add(`jump-target-flash`),window.setTimeout(()=>{e.classList.remove(`jump-target-flash`)},900)}function Mc({session:e,viewPrefs:t,viewerMode:n=`embedded`,activeView:r,setActiveView:i,returnToLandingRef:a,live:o}){let s=n===`readonly`,c=!!o,[l,u]=(0,_.useState)(c);(0,_.useEffect)(()=>{if(a)return a.current=()=>{u(!1),_e(!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=_r(e,n),C=yr(e,n),{effectiveSession:w}=C,{annotations:T}=S,E=Sr(c?{...t,displayMode:`all`}:t),{state:D,currentIndex:O,visibleCount:k,speed:A,play:j,pause:M,togglePlayPause:N,seekTo:P,changeSpeed:ee,totalScenes:F,userPromptIndices:I,computeNextIndex:te}=xr(e.scenes,E,l),ne=(0,_.useRef)(null),[L,R]=(0,_.useState)(`outline`),[z,B]=(0,_.useState)(!1),[re,ie]=(0,_.useState)(!1),ae=(0,_.useRef)(null),oe=(0,_.useRef)(null),se=(0,_.useRef)(!1),[ce,le]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`?(e.preventDefault(),B(e=>!e)):e.key===`/`?e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||(e.preventDefault(),B(!0)):e.key===`?`?le(e=>!e):e.key===`Escape`&&(ce?le(!1):z&&B(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[z,ce]);let ue=I.filter(e=>e<=O).length||0,de=I.length,fe=(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 I.length>=2?I[1]:Math.min(15,e.scenes.length-1)},[I,e.scenes.length]),pe=(0,_.useCallback)((e=!0)=>{u(!0),e?setTimeout(j,300):setTimeout(()=>P(fe),100)},[j,P,fe]),me=(0,_.useCallback)(()=>i(`summary`),[i]),he=(0,_.useRef)(t.displayMode);(0,_.useEffect)(()=>{he.current!==t.displayMode&&(he.current=t.displayMode,l||(u(!0),setTimeout(()=>P(fe),100)))},[t.displayMode,l,P,fe]);let[ge,_e]=(0,_.useState)(()=>new URLSearchParams(window.location.search).get(`s`)!==null);(0,_.useEffect)(()=>{!l&&r!==`replay`&&!ge&&(u(!0),setTimeout(()=>P(fe),100))},[r,l,fe,P,ge]);let ve=(0,_.useCallback)(t=>{let n=Math.max(0,Math.min(t,e.scenes.length-1));M(),ae.current=n,f(n),oe.current&&clearTimeout(oe.current),oe.current=setTimeout(()=>f(void 0),2500),P(n)},[M,P,e.scenes.length]);(0,_.useEffect)(()=>{!l&&ge&&(u(!0),setTimeout(()=>ve(fe),100))},[l,ge,fe,ve]);let ye=(0,_.useCallback)(()=>{let e=I.find(e=>e>O);e!==void 0&&ve(e)},[I,O,ve]),be=(0,_.useCallback)(()=>{let e=[...I].toReversed().find(e=>e<O);e!==void 0&&ve(e)},[I,O,ve]),xe=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(!ne.current||O<0||ae.current!==null)return;if(se.current){se.current=!1;return}let t=ne.current;if(xe.current=!0,c){t.scrollTop=t.scrollHeight,setTimeout(()=>{xe.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(()=>{xe.current=!1},400)})},[O,D,e.scenes,c]),(0,_.useEffect)(()=>{let e=ne.current;if(!e)return;let t=()=>{xe.current||D===`playing`&&M()};return e.addEventListener(`wheel`,t,{passive:!0}),e.addEventListener(`touchmove`,t,{passive:!0}),()=>{e.removeEventListener(`wheel`,t),e.removeEventListener(`touchmove`,t)}},[D,M]),(0,_.useEffect)(()=>{let t=ne.current;if(!t)return;let n=!1,r=()=>{if(!(D!==`paused`||n)&&!(O>=e.scenes.length-1)&&!(xe.current||ae.current!==null)&&t.scrollHeight-t.scrollTop-t.clientHeight<80){n=!0,se.current=!0;let e=te(O);e!==-1&&P(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,P,te]),(0,_.useEffect)(()=>{let e=ae.current,t=ne.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){xe.current=!0;let e=t.getBoundingClientRect(),n=o.getBoundingClientRect().top-e.top+t.scrollTop-e.height*.3;t.scrollTo({top:Math.max(0,n),behavior:`smooth`}),jc(o),setTimeout(()=>{xe.current=!1},450),ae.current=null;return}r+=1,r<30?setTimeout(a,80):ae.current=null};return requestAnimationFrame(a),()=>{n=!0}},[O]),(0,_.useEffect)(()=>()=>{oe.current&&clearTimeout(oe.current)},[]);let Se=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(O<0||!l||c)return;Se.current&&clearTimeout(Se.current);let e=D===`playing`?500:0;return Se.current=setTimeout(()=>{let e=new URL(window.location.href);e.searchParams.set(`s`,String(O)),window.history.replaceState({},``,e.toString())},e),()=>{Se.current&&clearTimeout(Se.current)}},[O,D,l,c]);let V=(0,_.useRef)(0);(0,_.useLayoutEffect)(()=>{if(!c)return;let t=e.scenes.length;t===0||t===V.current||(V.current=t,P(t-1))},[c,e.scenes.length,P]);let Ce=n===`editor`,we=(0,_.useMemo)(()=>T.some(e=>e.author===`vibe-feedback`),[T]);if(!l&&r===`replay`)return(0,H.jsx)(Js,{session:w,onStart:pe,onViewInsights:me});let{meta:Te}=e;return(0,H.jsxs)(`div`,{className:`flex flex-1 min-h-0 relative`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 min-w-0`,children:[(0,H.jsx)(Ac,{activeView:r,onChangeView:i,hiddenTabs:s?[`export`]:void 0,rightContent:r===`replay`?(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[C.overlayCount>0&&(0,H.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,H.jsx)(`span`,{children:C.showAllOriginals?`Original`:`Modified`}),(0,H.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,H.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,H.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,H.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,H.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,H.jsx)(`span`,{children:`Comments`}),S.annotations.length>0&&(0,H.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,H.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,H.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,H.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,H.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})]}),Ce&&(0,H.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,H.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,H.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,H.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,H.jsx)(`span`,{className:`font-semibold tracking-wide`,children:`AI Studio`}),(we||C.overlayCount>0)&&(0,H.jsxs)(`span`,{className:`relative flex h-1.5 w-1.5`,children:[(0,H.jsx)(`span`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-purple opacity-75`}),(0,H.jsx)(`span`,{className:`relative inline-flex rounded-full h-1.5 w-1.5 bg-terminal-purple`})]})]})]}):void 0}),(0,H.jsxs)(`div`,{className:`flex flex-1 min-h-0 min-w-0 w-full`,children:[r===`replay`&&(0,H.jsxs)(`div`,{className:`flex flex-1 min-h-0 min-w-0 w-full relative`,children:[b&&(0,H.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,H.jsxs)(`div`,{className:`flex-1 overflow-y-auto min-h-0`,children:[(0,H.jsxs)(`div`,{className:`px-3 py-2 border-b border-terminal-border-subtle flex items-center justify-between group/side`,children:[(0,H.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest`,children:`Outline`}),(0,H.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,H.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,H.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}),(0,H.jsx)(`line`,{x1:`9`,x2:`9`,y1:`3`,y2:`21`})]})})]}),(0,H.jsx)(Ys,{scenes:e.scenes,currentIndex:O,onSeek:ve,overlayActions:C,turnStats:e.meta.stats.turnStats})]}),(0,H.jsxs)(`div`,{className:`shrink-0 border-t border-terminal-border-subtle overflow-y-auto max-h-[35%]`,children:[(0,H.jsx)(`div`,{className:`px-3 py-2 border-b border-terminal-border-subtle`,children:(0,H.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,H.jsxs)(`div`,{className:`p-3`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,H.jsx)(Fe,{label:`Turns`,value:Te.stats.userPrompts,color:`text-terminal-green`}),(0,H.jsx)(Fe,{label:`Tools`,value:Te.stats.toolCalls,color:`text-terminal-orange`})]}),(0,H.jsxs)(`div`,{className:`mt-2 text-xs font-mono text-terminal-dim space-y-0.5`,children:[Te.model&&(0,H.jsx)(`div`,{children:(0,H.jsx)(`span`,{className:`text-terminal-text`,children:Te.model})}),Te.stats.durationMs&&(0,H.jsxs)(`div`,{children:[Ie(Te.stats.durationMs),Te.stats.costEstimate!==void 0&&(0,H.jsxs)(`span`,{children:[` / `,(0,H.jsxs)(`span`,{className:`text-terminal-green`,children:[`$`,Te.stats.costEstimate<.01?Te.stats.costEstimate.toFixed(4):Te.stats.costEstimate.toFixed(2)]})]})]}),Te.stats.tokenUsage&&(0,H.jsxs)(`div`,{children:[W(Te.stats.tokenUsage.inputTokens),` in /`,` `,W(Te.stats.tokenUsage.outputTokens),` out`]}),(()=>{if(!Te.stats.turnStats?.length)return null;let e=Math.max(...Te.stats.turnStats.map(e=>e.contextTokens||0));return e<=0?null:(0,H.jsxs)(`div`,{className:`text-terminal-dim mt-0.5`,children:[`peak ctx: `,(0,H.jsx)(`span`,{className:`text-terminal-cyan`,children:W(e)})]})})()]})]})]})]}),(0,H.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 min-w-0 relative`,children:[!b&&(0,H.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,H.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,H.jsx)(`polyline`,{points:`9 18 15 12 9 6`})})}),(0,H.jsx)(`div`,{ref:ne,className:`flex-1 overflow-y-auto overflow-x-hidden px-5 py-5 pb-10 overscroll-contain`,children:(0,H.jsx)(Os,{scenes:e.scenes,visibleCount:c?e.scenes.length:k,currentIndex:O,effectivePrefs:E,focusIndex:d,annotatedScenes:S.annotatedScenes,annotationCounts:S.annotationCounts,onSeek:ve,state:D,overlayActions:C,turnStats:e.meta.stats.turnStats,isLive:c,liveSessionState:o?.sessionState,onComment:s?void 0:e=>{m(!0),y(e)}})}),(0,H.jsx)(ec,{scenes:w.scenes,open:z,onClose:()=>B(!1),onSeek:e=>{ve(e),B(!1)}})]})]}),r===`summary`&&(0,H.jsx)(sc,{session:w}),r===`export`&&(0,H.jsx)(Ws,{actions:S,viewerMode:n,readOnly:s,session:w})]}),r===`replay`&&(0,H.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,H.jsx)(Tc,{scenes:e.scenes,currentIndex:O,onSeek:ve,annotatedScenes:S.annotatedScenes}),(0,H.jsx)(Sa,{state:D,speed:A,currentIndex:O,totalScenes:F,userPromptCount:de,currentTurn:ue,onTogglePlayPause:N,onChangeSpeed:ee,onPrevPrompt:be,onNextPrompt:ye,onOpenSearch:()=>B(!0),onOpenOutline:()=>ie(!0),onShowHelp:()=>le(!0)})]})]}),(0,H.jsx)(ba,{open:p,onClose:()=>m(!1),actions:S,scenes:w.scenes,currentIndex:O,onSeek:ve,addingForScene:v,onClearAddingTarget:()=>y(null),readOnly:s}),(0,H.jsx)(Pr,{open:h,onClose:()=>g(!1),annotationActions:S,overlayActions:C}),(0,H.jsxs)(`div`,{className:`fixed inset-0 z-40 md:hidden transition-opacity duration-300 ${re?`opacity-100`:`opacity-0 pointer-events-none`}`,onClick:()=>ie(!1),children:[(0,H.jsx)(`div`,{className:`absolute inset-0 bg-black/40`}),(0,H.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 ${re?`translate-y-0`:`translate-y-full`}`,onClick:e=>e.stopPropagation(),children:[(0,H.jsx)(`div`,{className:`flex justify-center py-2.5 shrink-0`,children:(0,H.jsx)(`div`,{className:`w-10 h-1 rounded-full bg-terminal-border`})}),(0,H.jsxs)(`div`,{className:`flex border-b border-terminal-border-subtle shrink-0`,children:[(0,H.jsx)(`button`,{onClick:()=>R(`outline`),className:`flex-1 px-3 py-2.5 text-[10px] font-sans font-semibold uppercase tracking-widest transition-colors ${L===`outline`?`text-terminal-green border-b-2 border-terminal-green`:`text-terminal-dim hover:text-terminal-text`}`,children:`Outline`}),(0,H.jsxs)(`button`,{onClick:()=>R(`comments`),className:`flex-1 px-3 py-2.5 text-[10px] font-sans font-semibold uppercase tracking-widest transition-colors ${L===`comments`?`text-terminal-green border-b-2 border-terminal-green`:`text-terminal-dim hover:text-terminal-text`}`,children:[`Comments`,S.annotations.length>0&&(0,H.jsxs)(`span`,{className:`ml-1.5 text-terminal-dimmer`,children:[`(`,S.annotations.length,`)`]})]})]}),(0,H.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain`,children:L===`outline`?(0,H.jsx)(Ys,{scenes:e.scenes,currentIndex:O,onSeek:e=>{ve(e),ie(!1)},overlayActions:C,turnStats:e.meta.stats.turnStats}):(0,H.jsx)(va,{actions:S,scenes:w.scenes,currentIndex:O,onSeek:e=>{ve(e)},addingForScene:v,onClearAddingTarget:()=>y(null),readOnly:s})})]})]}),(0,H.jsx)(Ks,{open:ce,onClose:()=>le(!1)})]})}function Nc(){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=Fc();if(e&&Pc()){Ic(e,n,t);return}Lc().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 Pc(){return!!window.__VIBE_REPLAY_EDITOR__}function Fc(){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 Ic(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},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 Lc(){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 zc(n.gistId);return{session:await Rc(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 zc(n),r=await Rc(e);return fetch(`https://vibe-replay.com/api/cloud-replays/view-gist/${n}`,{method:`POST`}).catch(()=>{}),{session:r,mode:`readonly`,gistOwner:t}}if(Pc()){if(e.get(`view`)===`dashboard`)return`dashboard`;let t=e.get(`session`);if(t){let e=await fetch(`/api/session?slug=${encodeURIComponent(t)}`);if(!e.ok)throw Error(`Session not found: ${t}`);return{session:await e.json(),mode:`editor`}}return`dashboard`}let r=e.get(`url`);if(r)return{session:await Rc(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 Rc(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 zc(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 Bc(){let[e,t]=(0,_.useState)(()=>{let e=new URLSearchParams(window.location.search).get(`theme`);if(e===`light`||e===`dark`)return e;let t=localStorage.getItem(`vibe-replay-theme`);return t===`light`||t===`dark`?t:`dark`});return(0,_.useEffect)(()=>{let t=document.documentElement;t.classList.add(`theme-transition`),t.classList.toggle(`dark`,e===`dark`),t.classList.toggle(`light`,e===`light`),localStorage.setItem(`vibe-replay-theme`,e);let n=setTimeout(()=>t.classList.remove(`theme-transition`),300);return()=>clearTimeout(n)},[e]),{theme:e,toggleTheme:(0,_.useCallback)(()=>{t(e=>e===`dark`?`light`:`dark`)},[])}}function Vc(){let e=new URLSearchParams(window.location.search).get(`v`);return e===`summary`||e===`export`?e:`replay`}var Hc=`https://vibe-replay.com`;function Uc({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`:`${Hc}/api/auth/get-session`,r=``;if(!e)try{r=new URL(Hc).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,H.jsxs)(`div`,{className:`relative`,ref:a,children:[(0,H.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,H.jsx)(`img`,{src:t.user.image,alt:``,className:`w-full h-full rounded-full object-cover`}):(0,H.jsx)(`span`,{className:`text-[10px] text-terminal-dim`,children:`?`})}),r&&(0,H.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,H.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,H.jsx)(`button`,{type:`button`,onClick:async()=>{let t=e?`/api/auth/sign-out`:`${Hc}/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,H.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(`${Hc}/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`:`${Hc}/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,H.jsx)(`svg`,{className:`w-3.5 h-3.5`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,H.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 Wc(){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,H.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,H.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2`,children:[(0,H.jsx)(`svg`,{className:`w-3.5 h-3.5`,viewBox:`0 0 16 16`,fill:`currentColor`,children:(0,H.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,H.jsx)(`span`,{className:`inline-flex items-center px-2 h-full border-l border-terminal-border`,children:e})]})}function Gc(){let e=Nc(),{theme:t,toggleTheme:n}=Bc(),{prefs:r,updatePref:i,togglePref:a}=Er(),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)(Vc()),p=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=()=>f(Vc());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,H.jsx)(`div`,{className:`h-screen bg-terminal-bg flex items-center justify-center`,children:(0,H.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-terminal-green font-sans font-bold text-sm animate-pulse`,children:`LOADING SESSION...`}),(0,H.jsx)(`div`,{className:`text-terminal-dimmer font-mono text-xs`,children:`Preparing replay data`})]})});if(e.status===`error`)return(0,H.jsx)(`div`,{className:`h-screen bg-terminal-bg flex items-center justify-center`,children:(0,H.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-terminal-red font-mono text-sm`,children:e.message}),(0,H.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,H.jsx)(`div`,{className:`h-screen bg-terminal-bg flex flex-col overflow-hidden`,children:(0,H.jsx)(Yn,{headerLeft:(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5 shrink-0`,children:[(0,H.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,H.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,H.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-terminal-green animate-pulse`}),`Local`,(0,H.jsx)(`span`,{className:`instant-tooltip-text`,children:`v0.2.0\nViewer ${window.location.host}
|
|
107
|
-
Cloud https://vibe-replay.com`})]})]}),headerRight:(0,
|
|
108
|
-
Cloud https://vibe-replay.com`})]}),l&&(0,
|
|
109
|
-
<style rel="stylesheet" crossorigin>*,:before,:after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border:0 solid #e5e7eb}:before,:after{--tw-content:""}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--font-sans);font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder{opacity:1;color:#9ca3af}textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{scrollbar-width:thin;scrollbar-color:var(--border) var(--bg)}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:var(--bg)}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}.tabular-nums{font-variant-numeric:tabular-nums}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-y-3{top:.75rem;bottom:.75rem}.-bottom-20{bottom:-5rem}.-bottom-24{bottom:-6rem}.-left-20{left:-5rem}.-left-24{left:-6rem}.-right-10{right:-2.5rem}.-right-12{right:-3rem}.-right-20{right:-5rem}.-right-24{right:-6rem}.-top-12{top:-3rem}.-top-20{top:-5rem}.-top-24{top:-6rem}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.bottom-full{bottom:100%}.left-0{left:0}.left-3{left:.75rem}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3{top:.75rem}.top-full{top:100%}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[120\]{z-index:120}.z-\[60\]{z-index:60}.\!m-0{margin:0!important}.mx-0\.5{margin-left:.125rem;margin-right:.125rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-1\.5{margin-top:.375rem;margin-bottom:.375rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-auto{margin-bottom:auto}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-28{height:7rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-56{height:14rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[10px\]{height:10px}.h-\[2px\]{height:2px}.h-\[65vh\]{height:65vh}.h-\[6px\]{height:6px}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-28{max-height:7rem}.max-h-32{max-height:8rem}.max-h-40{max-height:10rem}.max-h-48{max-height:12rem}.max-h-60{max-height:15rem}.max-h-72{max-height:18rem}.max-h-\[100px\]{max-height:100px}.max-h-\[120px\]{max-height:120px}.max-h-\[180px\]{max-height:180px}.max-h-\[200px\]{max-height:200px}.max-h-\[300px\]{max-height:300px}.max-h-\[35\%\]{max-height:35%}.max-h-\[4\.5em\]{max-height:4.5em}.max-h-\[400px\]{max-height:400px}.max-h-\[500px\]{max-height:500px}.max-h-\[50vh\]{max-height:50vh}.max-h-\[88vh\]{max-height:88vh}.min-h-0{min-height:0}.min-h-4{min-height:1rem}.min-h-screen{min-height:100vh}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[10px\]{width:10px}.w-\[2px\]{width:2px}.w-\[68px\]{width:68px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0}.min-w-4{min-width:1rem}.min-w-\[140px\]{min-width:140px}.min-w-\[40px\]{min-width:40px}.min-w-\[760px\]{min-width:760px}.max-w-0{max-width:0}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-6xl{max-width:72rem}.max-w-\[120px\]{max-width:120px}.max-w-\[180px\]{max-width:180px}.max-w-\[200px\]{max-width:200px}.max-w-\[300px\]{max-width:300px}.max-w-\[400px\]{max-width:400px}.max-w-\[60\%\]{max-width:60%}.max-w-\[calc\(100vw-2rem\)\]{max-width:calc(100vw - 2rem)}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.flex-1{flex:1}.flex-\[2\]{flex:2}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-full{--tw-translate-x:-100%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x:0px;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[17px\]{--tw-translate-x:17px;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[3px\]{--tw-translate-x:3px;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x:100%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y:0px;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-2{--tw-translate-y:.5rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y:100%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate:180deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate:90deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-105{--tw-scale-x:1.05;--tw-scale-y:1.05;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}.animate-bounce{animation:1s infinite bounce}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}.animate-ping{animation:1s cubic-bezier(0,0,.2,1) infinite ping}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:2s cubic-bezier(.4,0,.6,1) infinite pulse}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:1s linear infinite spin}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.appearance-none{appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-\[3px\]{gap:3px}.gap-px{gap:1px}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-y-0\.5{row-gap:.125rem}.gap-y-1{row-gap:.25rem}.gap-y-2{row-gap:.5rem}.gap-y-5{row-gap:1.25rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-2\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.625rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-3\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.875rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.875rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-px>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1px * var(--tw-space-y-reverse))}.self-start{align-self:flex-start}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overscroll-contain{overscroll-behavior:contain}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-b-2xl{border-bottom-right-radius:1rem;border-bottom-left-radius:1rem}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-xl{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.rounded-t-sm{border-top-left-radius:.125rem;border-top-right-radius:.125rem}.border{border-width:1px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\[rgba\(168\,85\,247\,0\.2\)\]{border-color:#a855f733}.border-\[rgba\(168\,85\,247\,0\.3\)\]{border-color:#a855f74d}.border-amber-500\/30{border-color:#f59e0b4d}.border-blue-500\/30{border-color:#3b82f64d}.border-blue-500\/40{border-color:#3b82f666}.border-blue-500\/60{border-color:#3b82f699}.border-cyan-500\/30{border-color:#06b6d44d}.border-gray-500\/30{border-color:#6b72804d}.border-green-500\/15{border-color:#22c55e26}.border-green-500\/30{border-color:#22c55e4d}.border-purple-500\/30{border-color:#a855f74d}.border-red-400\/20{border-color:#f8717133}.border-red-500\/30{border-color:#ef44444d}.border-terminal-blue{border-color:var(--blue)}.border-terminal-border{border-color:var(--border)}.border-terminal-border-subtle{border-color:var(--border-subtle)}.border-terminal-dim{border-color:var(--dim)}.border-terminal-green{border-color:var(--green)}.border-terminal-orange{border-color:var(--orange)}.border-terminal-purple{border-color:var(--purple)}.border-transparent{border-color:#0000}.border-white\/10{border-color:#ffffff1a}.border-l-orange-500\/30{border-left-color:#f973164d}.border-l-red-500{--tw-border-opacity:1;border-left-color:rgb(239 68 68/var(--tw-border-opacity,1))}.border-l-terminal-blue{border-left-color:var(--blue)}.border-l-terminal-purple{border-left-color:var(--purple)}.\!bg-transparent{background-color:#0000!important}.bg-\[\#24292f\]{--tw-bg-opacity:1;background-color:rgb(36 41 47/var(--tw-bg-opacity,1))}.bg-\[rgba\(168\,85\,247\,0\.1\)\]{background-color:#a855f71a}.bg-amber-500\/20{background-color:#f59e0b33}.bg-black\/30{background-color:#0000004d}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/20{background-color:#3b82f633}.bg-cyan-500\/20{background-color:#06b6d433}.bg-gray-500\/20{background-color:#6b728033}.bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.bg-green-500\/20{background-color:#22c55e33}.bg-green-500\/5{background-color:#22c55e0d}.bg-purple-500\/10{background-color:#a855f71a}.bg-purple-500\/20{background-color:#a855f733}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.bg-red-500\/20{background-color:#ef444433}.bg-red-500\/5{background-color:#ef44440d}.bg-terminal-bg{background-color:var(--bg)}.bg-terminal-blue{background-color:var(--blue)}.bg-terminal-blue-emphasis{background-color:var(--blue-emphasis)}.bg-terminal-blue-subtle{background-color:var(--blue-subtle)}.bg-terminal-border{background-color:var(--border)}.bg-terminal-border-subtle{background-color:var(--border-subtle)}.bg-terminal-dim{background-color:var(--dim)}.bg-terminal-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-dim{color:var(--dim)}.text-terminal-dimmer{color:var(--dimmer)}.text-terminal-green{color:var(--green)}.text-terminal-orange{color:var(--orange)}.text-terminal-purple{color:var(--purple)}.text-terminal-red{color:var(--red)}.text-terminal-text{color:var(--text)}.text-transparent{color:#0000}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.line-through{text-decoration-line:line-through}.placeholder-terminal-dim::placeholder{color:var(--dim)}.placeholder-terminal-dimmer::placeholder{color:var(--dimmer)}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.shadow-2xl{--tw-shadow:0 25px 50px -12px #00000040;--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(251\,146\,60\,0\.5\)\]{--tw-shadow:0 0 8px #fb923c80;--tw-shadow-colored:0 0 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 #0000000d;--tw-shadow-colored:inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-layer-lg{--tw-shadow:var(--shadow-lg);--tw-shadow-colored:var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-layer-md{--tw-shadow:var(--shadow-md);--tw-shadow-colored:var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-layer-sm{--tw-shadow:var(--shadow-sm);--tw-shadow-colored:var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-layer-xl{--tw-shadow:var(--shadow-xl);--tw-shadow-colored:var(--shadow-xl);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 #0000000d;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.outline-none{outline-offset:2px;outline:2px solid #0000}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.ring-red-500\/40{--tw-ring-color:#ef444466}.ring-terminal-border-subtle{--tw-ring-color:var(--border-subtle)}.ring-transparent{--tw-ring-color:transparent}.blur-2xl{--tw-blur:blur(40px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-3xl{--tw-blur:blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-75{--tw-brightness:brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-sm{--tw-drop-shadow:drop-shadow(0 1px 1px #0000000d);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur:blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\[left\]{transition-property:left;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-shadow{transition-property:box-shadow;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-property:transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-1000{transition-duration:1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-material{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-material-decel,.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}html,body{max-width:100vw;overflow-x:hidden}:root{--font-sans:"Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif}:root,.dark{--bg:#0d1117;--surface:#161b22;--surface-hover:#21262d;--surface-2:#1c2129;--surface-inset:#010409;--border:#30363d;--border-subtle:#30363d80;--text:#c9d1d9;--dim:#8b949e;--dimmer:#7d8590;--green:#3fb950;--green-subtle:#3fb95026;--green-emphasis:#3fb95040;--blue:#79b8ff;--blue-subtle:#79b8ff26;--blue-emphasis:#79b8ff40;--orange:#d29922;--orange-subtle:#d2992226;--orange-emphasis:#d2992240;--red:#f85149;--red-subtle:#f8514926;--red-emphasis:#f8514940;--purple:#b392f0;--purple-subtle:#b392f026;--purple-emphasis:#b392f040;--cyan:#56d4dd;--cyan-subtle:#56d4dd26;--shadow-color:215 28% 4%;--shadow-sm:0 1px 2px hsl(var(--shadow-color) / .5);--shadow-md:0 1px 2px hsl(var(--shadow-color) / .4), 0 4px 8px hsl(var(--shadow-color) / .3);--shadow-lg:0 1px 3px hsl(var(--shadow-color) / .4), 0 4px 8px hsl(var(--shadow-color) / .3), 0 12px 24px hsl(var(--shadow-color) / .25);--shadow-xl:0 2px 4px hsl(var(--shadow-color) / .4), 0 8px 16px hsl(var(--shadow-color) / .3), 0 24px 48px hsl(var(--shadow-color) / .25);--surface-subtle-glass:#0d1117b3}.light{--bg:#fff;--surface:#f6f8fa;--surface-hover:#e6edf3;--surface-2:#ebeef1;--surface-inset:#f0f2f5;--border:#d0d7de;--border-subtle:#d0d7de80;--text:#24292f;--dim:#57606a;--dimmer:#697078;--green:#1a7f37;--green-subtle:#1a7f371a;--green-emphasis:#1a7f3733;--blue:#0969da;--blue-subtle:#0969da1a;--blue-emphasis:#0969da33;--orange:#9a6700;--orange-subtle:#9a67001a;--orange-emphasis:#9a670033;--red:#cf222e;--red-subtle:#cf222e1a;--red-emphasis:#cf222e33;--purple:#8250df;--purple-subtle:#8250df1a;--purple-emphasis:#8250df33;--cyan:#0e7c86;--cyan-subtle:#0e7c861a;--shadow-color:220 10% 50%;--shadow-sm:0 1px 2px hsl(var(--shadow-color) / .1);--shadow-md:0 1px 2px hsl(var(--shadow-color) / .08), 0 4px 8px hsl(var(--shadow-color) / .06);--shadow-lg:0 1px 3px hsl(var(--shadow-color) / .08), 0 4px 8px hsl(var(--shadow-color) / .06), 0 12px 24px hsl(var(--shadow-color) / .05);--shadow-xl:0 2px 4px hsl(var(--shadow-color) / .08), 0 8px 16px hsl(var(--shadow-color) / .06), 0 24px 48px hsl(var(--shadow-color) / .05);--surface-subtle-glass:#ffffffbf}html.theme-transition,html.theme-transition *,html.theme-transition :before,html.theme-transition :after{transition:background-color .25s,border-color .25s,color .25s}@media (prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}button,[role=button]{-webkit-tap-highlight-color:transparent}:focus:not(:focus-visible){outline:none}:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:4px}@supports (padding:env(safe-area-inset-top)){.safe-top{padding-top:max(env(safe-area-inset-top), 1.25rem)}.safe-bottom{padding-bottom:env(safe-area-inset-bottom)}}@keyframes blink{0%,to{opacity:1}50%{opacity:0}}.typing-cursor:after{content:"█";color:var(--green);animation:1s step-end infinite blink}@keyframes fade-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.scene-enter{animation:.3s cubic-bezier(.4,0,.2,1) fade-in}@keyframes pulse-border{0%,to{border-color:#d299224d}50%{border-color:#d2992299}}.pause-overlay{animation:2s ease-in-out infinite pulse-border}@keyframes jump-target-flash{0%{outline-color:#3fb95000;box-shadow:0 0 #3fb95000}30%{outline-color:#3fb95099;box-shadow:0 0 0 3px #3fb95040}to{outline-color:#3fb95000;box-shadow:0 0 #3fb95000}}.jump-target-flash{outline:1px solid #0000;animation:.85s ease-out jump-target-flash}@keyframes nav-focus-pulse{0%,to{transform:translateY(0)}50%{transform:translateY(-1px)}}.scene-nav-focused{animation:.9s ease-in-out 2 nav-focus-pulse}@keyframes landing-glow{0%,to{box-shadow:0 0 #3fb95000}50%{box-shadow:0 0 20px 2px #3fb95026}}.landing-pulse{animation:2.5s ease-in-out infinite landing-glow}.instant-tooltip{position:relative}.instant-tooltip .instant-tooltip-text{visibility:hidden;opacity:0;background:var(--surface);border:1px solid var(--border-subtle);box-shadow:var(--shadow-md);color:var(--text);font:11px / 1.4 var(--font-sans), monospace;text-transform:none;letter-spacing:normal;white-space:pre-line;pointer-events:none;z-index:50;border-radius:6px;margin-top:6px;padding:4px 8px;transition:opacity 80ms;position:absolute;top:100%;left:50%;transform:translate(-50%)}.instant-tooltip:hover .instant-tooltip-text{visibility:visible;opacity:1}.hover-lift{transition:transform .25s cubic-bezier(.175,.885,.32,1.275),box-shadow .25s cubic-bezier(.175,.885,.32,1.275),background-color .2s}.hover-lift:hover{box-shadow:var(--shadow-lg);transform:translateY(-2px)}.glass-effect{-webkit-backdrop-filter:blur(12px)saturate(180%);background-color:var(--surface-subtle-glass)}.premium-card{position:relative}.premium-card:before{content:"";border-radius:inherit;background:linear-gradient(135deg, var(--green-subtle), var(--blue-subtle));-webkit-mask-composite:xor;pointer-events:none;opacity:.5;padding:1px;position:absolute;inset:0;-webkit-mask-image:linear-gradient(#fff 0 0),linear-gradient(#fff 0 0);mask-image:linear-gradient(#fff 0 0),linear-gradient(#fff 0 0);-webkit-mask-position:0 0,0 0;mask-position:0 0,0 0;-webkit-mask-size:auto,auto;mask-size:auto,auto;-webkit-mask-repeat:repeat,repeat;mask-repeat:repeat,repeat;-webkit-mask-clip:content-box,border-box;mask-clip:content-box,border-box;-webkit-mask-origin:content-box,border-box;mask-origin:content-box,border-box;-webkit-mask-composite:xor;mask-composite:exclude;-webkit-mask-source-type:auto,auto;mask-mode:match-source,match-source}@keyframes shimmer{0%{background-position:-1000px 0}to{background-position:1000px 0}}.skeleton{background:linear-gradient(90deg, var(--surface-2) 25%, var(--surface-hover) 50%, var(--surface-2) 75%);background-size:1000px 100%;border-radius:4px;animation:2s linear infinite shimmer}.bg-dot-grid{background-image:radial-gradient(circle, var(--text) 1px, transparent 1px);opacity:.03;background-size:24px 24px}.minimap-item{transition:background-color .2s cubic-bezier(.4,0,.2,1),border-color .2s cubic-bezier(.4,0,.2,1)}.prose-terminal{line-height:1.6}.prose-terminal p{margin:.5em 0}.prose-terminal code{background:var(--surface);border-radius:4px;padding:.15em .4em;font-size:.9em}.prose-terminal pre{background:var(--surface);border-radius:6px;margin:.5em 0;padding:.75em 1em;overflow-x:auto}.prose-terminal pre code{background:0 0;padding:0}.prose-terminal ul,.prose-terminal ol{margin:.5em 0;padding-left:1.5em}.prose-terminal li{margin:.25em 0}.prose-terminal h1,.prose-terminal h2,.prose-terminal h3{margin:.75em 0 .5em;font-weight:600}.prose-terminal blockquote{border-left:3px solid var(--border);color:var(--dim);margin:.5em 0;padding-left:1em}.prose-terminal a{color:var(--blue);text-decoration:underline}.prose-terminal table{border-collapse:collapse;margin:.5em 0}.prose-terminal th,.prose-terminal td{border:1px solid var(--border);padding:.4em .8em}.placeholder\:text-terminal-dimmer::placeholder{color:var(--dimmer)}.hover\:z-10:hover{z-index:10}.hover\:-translate-y-0\.5:hover{--tw-translate-y:-.125rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-\[rgba\(168\,85\,247\,0\.5\)\]:hover{border-color:#a855f780}.hover\:border-terminal-border:hover{border-color:var(--border)}.hover\:bg-\[\#32383f\]:hover{--tw-bg-opacity:1;background-color:rgb(50 56 63/var(--tw-bg-opacity,1))}.hover\:bg-\[rgba\(168\,85\,247\,0\.2\)\]:hover{background-color:#a855f733}.hover\:bg-\[rgba\(168\,85\,247\,0\.25\)\]:hover{background-color:#a855f740}.hover\:bg-terminal-blue-emphasis:hover{background-color:var(--blue-emphasis)}.hover\:bg-terminal-blue-subtle:hover{background-color:var(--blue-subtle)}.hover\:bg-terminal-green-emphasis:hover{background-color:var(--green-emphasis)}.hover\:bg-terminal-orange-emphasis:hover{background-color:var(--orange-emphasis)}.hover\:bg-terminal-orange-subtle:hover{background-color:var(--orange-subtle)}.hover\:bg-terminal-purple-emphasis:hover{background-color:var(--purple-emphasis)}.hover\:bg-terminal-purple-subtle:hover{background-color:var(--purple-subtle)}.hover\:bg-terminal-red-emphasis:hover{background-color:var(--red-emphasis)}.hover\:bg-terminal-red-subtle:hover{background-color:var(--red-subtle)}.hover\:bg-terminal-surface:hover{background-color:var(--surface)}.hover\:bg-terminal-surface-2:hover{background-color:var(--surface-2)}.hover\:bg-terminal-surface-hover:hover{background-color:var(--surface-hover)}.hover\:text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\:text-terminal-blue:hover{color:var(--blue)}.hover\:text-terminal-dim:hover{color:var(--dim)}.hover\:text-terminal-green:hover{color:var(--green)}.hover\:text-terminal-orange:hover{color:var(--orange)}.hover\:text-terminal-red:hover{color:var(--red)}.hover\:text-terminal-text:hover{color:var(--text)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-layer-lg:hover{--tw-shadow:var(--shadow-lg);--tw-shadow-colored:var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.hover\:shadow-layer-md:hover{--tw-shadow:var(--shadow-md);--tw-shadow-colored:var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.hover\:ring-1:hover{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.hover\:brightness-110:hover{--tw-brightness:brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:outline-none:focus{outline-offset:2px;outline:2px solid #0000}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.disabled\:cursor-wait:disabled{cursor:wait}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:-translate-y-0\.5{--tw-translate-y:-.125rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:translate-x-full{--tw-translate-x:100%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-110{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group\/help:hover .group-hover\/help\:border-terminal-text{border-color:var(--text)}.group\/help:hover .group-hover\/help\:bg-terminal-text{background-color:var(--text)}.group\/help:hover .group-hover\/help\:text-terminal-bg{color:var(--bg)}.group\/ref:hover .group-hover\/ref\:text-terminal-text{color:var(--text)}.group\/search:hover .group-hover\/search\:text-terminal-blue{color:var(--blue)}.group:hover .group-hover\:text-terminal-green{color:var(--green)}.group:hover .group-hover\:text-terminal-text{color:var(--text)}.group\/batch:hover .group-hover\/batch\:opacity-100,.group\/help:hover .group-hover\/help\:opacity-100,.group\/pause:hover .group-hover\/pause\:opacity-100,.group\/scene:hover .group-hover\/scene\:opacity-100,.group\/search:hover .group-hover\/search\:opacity-100{opacity:1}.group\/search:hover .group-hover\/search\:opacity-80{opacity:.8}.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-60{opacity:.6}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-red-900\/30:is(.dark *){background-color:#7f1d1d4d}.dark\:bg-terminal-surface-2:is(.dark *){background-color:var(--surface-2)}.dark\:bg-white\/5:is(.dark *){background-color:#ffffff0d}@media (min-width:640px){.sm\:mx-0{margin-left:0;margin-right:0}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-start{align-items:flex-start}.sm\:gap-3{gap:.75rem}.sm\:rounded-xl{border-radius:.75rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:py-3{padding-top:.75rem;padding-bottom:.75rem}.sm\:pt-\[15vh\]{padding-top:15vh}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-\[10px\]{font-size:10px}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width:768px){.md\:ml-12{margin-left:3rem}.md\:mt-10{margin-top:2.5rem}.md\:block{display:block}.md\:inline{display:inline}.md\:flex{display:flex}.md\:inline-flex{display:inline-flex}.md\:hidden{display:none}.md\:min-h-0{min-height:0}.md\:max-w-\[300px\]{max-width:300px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:gap-2{gap:.5rem}.md\:gap-3{gap:.75rem}.md\:space-y-7>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.75rem * var(--tw-space-y-reverse))}.md\:p-8{padding:2rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:pt-0{padding-top:0}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-5xl{font-size:3rem;line-height:1}}@media (min-width:1024px){.lg\:sticky{position:sticky}.lg\:top-3{top:.75rem}.lg\:inline{display:inline}.lg\:max-h-\[calc\(100vh-7rem\)\]{max-height:calc(100vh - 7rem)}.lg\:w-64{width:16rem}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_22rem\]{grid-template-columns:minmax(0,1fr) 22rem}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:justify-between{justify-content:space-between}.lg\:self-start{align-self:flex-start}.lg\:overflow-y-auto{overflow-y:auto}}@media (min-width:1280px){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1536px){.\32 xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}.\[\&\>svg\]\:block>svg{display:block}.\[\&\>svg\]\:h-auto>svg{height:auto}.\[\&\>svg\]\:w-full>svg{width:100%}
|
|
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=ic(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)(Me,{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:sc(t.gitBranch,t.gitBranches),children:oc(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:Fe(t.dataSourceInfo?.primary||t.dataSource)}),t.dataSourceInfo?.sources&&t.dataSourceInfo.sources.length>0&&(0,V.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:t.dataSourceInfo.sources.map(e=>(0,V.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dim truncate`,title:e,children:[(0,V.jsx)(`span`,{className:`text-terminal-green`,children:`source:`}),` `,e]},e))}),t.dataSourceInfo?.supplements&&t.dataSourceInfo.supplements.length>0&&(0,V.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:t.dataSourceInfo.supplements.map(e=>(0,V.jsxs)(`div`,{className:`text-xs font-mono text-terminal-dim truncate`,title:e,children:[(0,V.jsx)(`span`,{className:`text-terminal-purple`,children:`supplement:`}),` `,e]},e))})]}),t.provider===`cursor`&&t.cursorSidecars&&(t.cursorSidecars.requestContextCount||t.cursorSidecars.checkpointCount||t.cursorSidecars.hasWorkspaceRules)&&(0,V.jsxs)(`div`,{className:`rounded border border-terminal-border-subtle bg-terminal-surface/40 px-3 py-2`,children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1`,children:`Cursor Sidecars`}),(0,V.jsxs)(`div`,{className:`space-y-0.5 text-xs font-mono text-terminal-dim`,children:[t.cursorSidecars.requestContextCount?(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-terminal-green`,children:`request context:`}),` `,t.cursorSidecars.requestContextCount,` sidecar`,t.cursorSidecars.requestContextCount===1?``:`s`]}):null,t.cursorSidecars.hasWorkspaceRules?(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-terminal-purple`,children:`workspace rules:`}),` included`]}):null,t.cursorSidecars.checkpointCount?(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-terminal-orange`,children:`checkpoint state:`}),` `,t.cursorSidecars.checkpointCount,` entr`,t.cursorSidecars.checkpointCount===1?`y`:`ies`]}):null]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-3`,children:`Overview`}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3`,children:[(0,V.jsx)(Ie,{label:`Turns`,value:a.userPrompts,color:`text-terminal-green`}),(0,V.jsx)(Ie,{label:`Tool Calls`,value:a.toolCalls,color:`text-terminal-orange`}),(0,V.jsx)(Ie,{label:`Files Modified`,value:a.editedFiles.length,color:`text-terminal-blue`}),(0,V.jsx)(Ie,{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?Le(a.durationMs):`unavailable`}),i.duration&&(0,V.jsx)(Me,{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)(Me,{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)(Me,{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)(Me,{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)(pc,{turnStats:t.stats.turnStats,costEstimate:t.stats.costEstimate,turnLabels:s}),(0,V.jsx)(hc,{turnStats:t.stats.turnStats,turnLabels:s}),a.turns.length>=2&&(0,V.jsx)(vc,{turns:a.turns,turnLabels:s}),t.stats.turnStats.some(e=>e.durationMs)&&(0,V.jsx)(gc,{turnStats:t.stats.turnStats,turnLabels:s})]}),t.tokenUsageByModel&&Object.keys(t.tokenUsageByModel).length>1&&(0,V.jsx)(_c,{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)(xc,{turns:a.turns,turnStats:t.stats.turnStats}),(0,V.jsx)(yc,{editedFiles:a.editedFiles,turns:a.turns}),(a.editedFiles.length>0||a.readOnlyFiles.length>0)&&(0,V.jsx)(Tc,{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)(dc,{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 uc={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 dc({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 ${uc[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] ${uc[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 fc({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 pc({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}=cc(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)(fc,{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)(mc,{turnStats:e})]})}function mc({turnStats:e}){let t=ir(e),n=t.map(e=>or(e)/100),r=ar(t)/100,i=n.map((e,t)=>`${n.length===1?100/2:t/(n.length-1)*100},${24-e*20-2}`);return(0,V.jsxs)(`div`,{className:`mt-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest`,children:`Cache Hit Rate`}),(0,V.jsxs)(`span`,{className:`text-[10px] font-mono text-terminal-purple`,children:[`avg `,Math.round(r*100),`%`]})]}),(0,V.jsx)(`svg`,{viewBox:`0 0 100 24`,preserveAspectRatio:`none`,className:`w-full h-6`,children:(0,V.jsx)(`polyline`,{points:i.join(` `),fill:`none`,style:{stroke:`var(--purple)`},strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`})})]})}function hc({turnStats:e,turnLabels:t}){let n=e.map(e=>e.contextTokens||0),r=n.length,{hovered:i,ref:a,onMouseMove:o,onMouseLeave:s}=cc(r);if(!n.some(e=>e>0))return null;let c=Math.max(...n),l=e.some(e=>e.tokenUsage),u=ir(e),d=0;for(let e=0;e<n.length-1;e++)n[e]>0&&n[e+1]>0&&n[e+1]<n[e]*.5&&(d=Math.max(d,n[e]));let f=d>2e5||c>2e5?1e6:2e5,p=f>c?f:c,m=e=>60-e/p*54-3,h=e=>r===1?100/2:e/(r-1)*100,g=n.map((e,t)=>`${h(t)},${m(e)}`),_=null;if(l){let e=u.map((e,t)=>`${h(t)},${m(e.cacheRead)}`),t=u.map((e,t)=>`${h(t)},${m(e.cacheRead+e.uncached)}`),n=u.map((e,t)=>`${h(t)},${m(e.total)}`);_={cacheRead:`0,60 ${e.join(` `)} 100,60`,uncached:`${e.join(` `)} ${[...t].toReversed().join(` `)}`,total:`0,60 ${n.join(` `)} 100,60`}}let v=[];if(l){let e=r>1?100/(r-1)/2:100/2;for(let t=0;t<u.length;t++){if(u[t].hasData)continue;let r=n[t];if(r<=0)continue;let i=h(t),a=m(r),o=Math.max(0,i-e),s=Math.min(100,i+e);v.push(`${o},60 ${o},${a} ${s},${a} ${s},60`)}}let y=v.length>0,b=[];for(let e=0;e<n.length-1;e++){let t=n[e],r=n[e+1];t>0&&r>0&&r<t*.5&&b.push(e)}let x=ar(u),S=u.reduce((e,t)=>e+t.rawSum,0),C=i===null?0:r===1?.5:i/(r-1),w=f?m(f):void 0,T=i===null?0:or(u[i]);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1 flex items-center gap-2`,children:[(0,V.jsx)(`span`,{children:`Context Window Usage`}),(0,V.jsxs)(`span`,{className:`font-mono text-terminal-cyan`,children:[`peak `,U(c)]})]}),(0,V.jsxs)(`div`,{className:`relative`,children:[(0,V.jsxs)(`svg`,{ref:a,viewBox:`0 0 100 60`,preserveAspectRatio:`none`,className:`w-full h-20`,onMouseMove:o,onMouseLeave:s,children:[w!==void 0&&(0,V.jsx)(`line`,{x1:`0`,y1:w,x2:100,y2:w,style:{stroke:`var(--dim)`},strokeWidth:`0.5`,strokeDasharray:`3,2`,vectorEffect:`non-scaling-stroke`,opacity:`0.4`}),_?(0,V.jsxs)(V.Fragment,{children:[v.map((e,t)=>(0,V.jsx)(`polygon`,{points:e,style:{fill:`var(--cyan-subtle)`},opacity:`0.6`},`nd-${t}`)),(0,V.jsx)(`polygon`,{points:_.total,style:{fill:`var(--orange-subtle)`}}),(0,V.jsx)(`polygon`,{points:_.uncached,style:{fill:`var(--purple-subtle)`}}),(0,V.jsx)(`polygon`,{points:_.cacheRead,style:{fill:`var(--green-subtle)`}})]}):(0,V.jsx)(`polygon`,{points:`0,60 ${g.join(` `)} 100,60`,style:{fill:`var(--cyan-subtle)`}}),(0,V.jsx)(`polyline`,{points:g.join(` `),fill:`none`,style:{stroke:_?`var(--orange)`:`var(--cyan)`},strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`}),b.map(e=>{let t=h(e);return(0,V.jsx)(`line`,{x1:t,y1:`0`,x2:t,y2:60,style:{stroke:`var(--red)`},strokeWidth:`1`,strokeDasharray:`2,1`,vectorEffect:`non-scaling-stroke`,opacity:`0.6`},e)}),i!==null&&(0,V.jsx)(`line`,{x1:C*100,y1:`0`,x2:C*100,y2:60,stroke:`var(--dim)`,strokeWidth:`0.5`,vectorEffect:`non-scaling-stroke`,opacity:`0.5`})]}),(0,V.jsx)(fc,{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 gc({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)(fc,{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?Le(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 `,Le(r)]}),(0,V.jsxs)(`span`,{children:[`Turn `,n.length]})]})]}):null}function _c({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 vc({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)(fc,{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 yc({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 bc=20;function xc({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>bc,f=d&&!n?i.slice(0,bc):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)(Sc,{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-bc} more)`})})})})]})})]})}function Sc({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)(Cc,{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)(Cc,{value:e.durationMs?Le(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)(Cc,{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)(Cc,{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 Cc({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 wc=20;function Tc({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>wc,d=u&&!n?i.slice(0,wc):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)(Cc,{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)(Cc,{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-wc} more)`})})})})]})})]})}function Ec(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 Dc({scenes:e,currentIndex:t,onSeek:n,annotatedScenes:r}){let i=(0,_.useMemo)(()=>{if(e.length<=200)return e.map((e,t)=>({startIndex:t,endIndex:t,type:e.type}));let t=e.length/200,n=[];for(let r=0;r<200;r++){let i=Math.floor(r*t),a=Math.floor((r+1)*t)-1,o={"user-prompt":4,"compaction-summary":1,"context-injection":1,"tool-call":3,"text-response":2,thinking:1},s=e[i].type,c=o[s];for(let t=i+1;t<=a&&t<e.length;t++){let n=o[e[t].type];n>c&&(s=e[t].type,c=n)}n.push({startIndex:i,endIndex:a,type:s})}return n},[e]),a=e.length>0?(t+1)/e.length*100:0,o=(0,_.useRef)(null),s=(0,_.useCallback)(t=>{let r=o.current;if(!r)return;let i=r.getBoundingClientRect(),a=t.clientX-i.left,s=Math.max(0,Math.min(1,a/i.width));n(Math.floor(s*e.length))},[e.length,n]),c=(0,_.useMemo)(()=>{if(!r||r.size===0)return[];let t=[];return r.forEach(n=>{n>=0&&n<e.length&&t.push((n+.5)/e.length*100)}),t},[r,e.length]),l=(0,_.useMemo)(()=>{let t=[];for(let n=0;n<e.length;n++)e[n].type===`compaction-summary`&&t.push((n+.5)/e.length*100);return t},[e]),u=(0,_.useCallback)(r=>{r.key===`ArrowRight`||r.key===`ArrowUp`?(r.preventDefault(),n(Math.min(t+1,e.length-1))):r.key===`ArrowLeft`||r.key===`ArrowDown`?(r.preventDefault(),n(Math.max(t-1,0))):r.key===`Home`?(r.preventDefault(),n(0)):r.key===`End`&&(r.preventDefault(),n(e.length-1))},[t,e.length,n]);return e.length===0?null:(0,V.jsxs)(`div`,{className:`px-4 pt-3 pb-1 cursor-pointer`,onClick:s,onKeyDown:u,role:`slider`,"aria-label":`Scene timeline`,"aria-valuemin":0,"aria-valuemax":e.length-1,"aria-valuenow":t,tabIndex:0,children:[(c.length>0||l.length>0)&&(0,V.jsxs)(`div`,{className:`relative h-2 mb-0.5`,children:[c.map((e,t)=>(0,V.jsx)(`div`,{className:`absolute w-1.5 h-1.5 rounded-full bg-terminal-blue shadow-layer-sm`,style:{left:`${e}%`,top:`50%`,transform:`translate(-50%, -50%)`}},`a-${t}`)),l.map((e,t)=>(0,V.jsx)(`div`,{role:`img`,"aria-label":`Compaction`,title:`Compaction`,className:`absolute w-1.5 h-1.5 rounded-sm bg-terminal-red shadow-layer-sm`,style:{left:`${e}%`,top:`50%`,transform:`translate(-50%, -50%) rotate(45deg)`}},`c-${t}`))]}),(0,V.jsxs)(`div`,{ref:o,className:`relative flex h-2 rounded-full overflow-hidden bg-terminal-surface-2`,children:[i.map((e,n)=>(0,V.jsx)(`div`,{className:`flex-1 transition-opacity duration-150`,style:{backgroundColor:Ec(e.type),opacity:e.startIndex<=t?1:.15}},n)),l.map((e,t)=>(0,V.jsx)(`div`,{className:`absolute top-0 bottom-0 w-px bg-terminal-red/60`,style:{left:`${e}%`}},`cl-${t}`)),(0,V.jsx)(`div`,{className:`absolute top-0 bottom-0 w-0.5 bg-white shadow-layer-sm transition-[left] duration-150 ease-material`,style:{left:`${a}%`}})]})]})}var Oc=[{key:`replay`,label:`Replay`},{key:`summary`,label:`Insights`},{key:`export`,label:`Share & Export`}],kc=`vr-insights-seen`;function Ac(){try{return localStorage.getItem(kc)===`1`}catch{return!1}}function jc(){try{localStorage.setItem(kc,`1`)}catch{}}function Mc({activeView:e,onChangeView:t,className:n=``,rightContent:r,hiddenTabs:i}){let[a,o]=(0,_.useState)(()=>Ac()||e===`summary`),s=(0,_.useCallback)(e=>{e===`summary`&&!a&&(jc(),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:Oc.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 Nc(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 Pc({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),ve(!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=yr(e,n),C=xr(e,n),{effectiveSession:w}=C,{annotations:T}=S,E=wr(c?{...t,displayMode:`all`}:t),{state:D,currentIndex:O,visibleCount:k,speed:A,play:j,pause:M,togglePlayPause:N,seekTo:P,changeSpeed:ee,totalScenes:F,userPromptIndices:I,computeNextIndex:te}=Cr(e.scenes,E,l),ne=(0,_.useRef)(null),[re,L]=(0,_.useState)(`outline`),[R,z]=(0,_.useState)(!1),[ie,ae]=(0,_.useState)(!1),oe=(0,_.useRef)(null),se=(0,_.useRef)(null),ce=(0,_.useRef)(!1),[le,ue]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`?(e.preventDefault(),z(e=>!e)):e.key===`/`?e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||(e.preventDefault(),z(!0)):e.key===`?`?ue(e=>!e):e.key===`Escape`&&(le?ue(!1):R&&z(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[R,le]);let de=I.filter(e=>e<=O).length||0,fe=I.length,pe=(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 I.length>=2?I[1]:Math.min(15,e.scenes.length-1)},[I,e.scenes.length]),me=(0,_.useCallback)((e=!0)=>{u(!0),e?setTimeout(j,300):setTimeout(()=>P(pe),100)},[j,P,pe]),he=(0,_.useCallback)(()=>i(`summary`),[i]),ge=(0,_.useRef)(t.displayMode);(0,_.useEffect)(()=>{ge.current!==t.displayMode&&(ge.current=t.displayMode,l||(u(!0),setTimeout(()=>P(pe),100)))},[t.displayMode,l,P,pe]);let[_e,ve]=(0,_.useState)(()=>new URLSearchParams(window.location.search).get(`s`)!==null);(0,_.useEffect)(()=>{!l&&r!==`replay`&&!_e&&(u(!0),setTimeout(()=>P(pe),100))},[r,l,pe,P,_e]);let ye=(0,_.useCallback)(t=>{let n=Math.max(0,Math.min(t,e.scenes.length-1));M(),oe.current=n,f(n),se.current&&clearTimeout(se.current),se.current=setTimeout(()=>f(void 0),2500),P(n)},[M,P,e.scenes.length]);(0,_.useEffect)(()=>{!l&&_e&&(u(!0),setTimeout(()=>ye(pe),100))},[l,_e,pe,ye]);let be=(0,_.useCallback)(()=>{let e=I.find(e=>e>O);e!==void 0&&ye(e)},[I,O,ye]),xe=(0,_.useCallback)(()=>{let e=[...I].toReversed().find(e=>e<O);e!==void 0&&ye(e)},[I,O,ye]),Se=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(!ne.current||O<0||oe.current!==null)return;if(ce.current){ce.current=!1;return}let t=ne.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=ne.current;if(!e)return;let t=()=>{Se.current||D===`playing`&&M()};return e.addEventListener(`wheel`,t,{passive:!0}),e.addEventListener(`touchmove`,t,{passive:!0}),()=>{e.removeEventListener(`wheel`,t),e.removeEventListener(`touchmove`,t)}},[D,M]),(0,_.useEffect)(()=>{let t=ne.current;if(!t)return;let n=!1,r=()=>{if(!(D!==`paused`||n)&&!(O>=e.scenes.length-1)&&!(Se.current||oe.current!==null)&&t.scrollHeight-t.scrollTop-t.clientHeight<80){n=!0,ce.current=!0;let e=te(O);e!==-1&&P(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,P,te]),(0,_.useEffect)(()=>{let e=oe.current,t=ne.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`}),Nc(o),setTimeout(()=>{Se.current=!1},450),oe.current=null;return}r+=1,r<30?setTimeout(a,80):oe.current=null};return requestAnimationFrame(a),()=>{n=!0}},[O]),(0,_.useEffect)(()=>()=>{se.current&&clearTimeout(se.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,P(t-1))},[c,e.scenes.length,P]);let we=n===`editor`,Te=(0,_.useMemo)(()=>T.some(e=>e.author===`vibe-feedback`),[T]);if(!l&&r===`replay`)return(0,V.jsx)(Xs,{session:w,onStart:me,onViewInsights:he});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)(Mc,{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)(Zs,{scenes:e.scenes,currentIndex:O,onSeek:ye,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)(Ie,{label:`Turns`,value:Ee.stats.userPrompts,color:`text-terminal-green`}),(0,V.jsx)(Ie,{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:[Le(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:ne,"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)(ks,{scenes:e.scenes,visibleCount:c?e.scenes.length:k,currentIndex:O,effectivePrefs:E,focusIndex:d,annotatedScenes:S.annotatedScenes,annotationCounts:S.annotationCounts,onSeek:ye,state:D,overlayActions:C,turnStats:e.meta.stats.turnStats,isLive:c,liveSessionState:o?.sessionState,onComment:s?void 0:e=>{m(!0),y(e)}})}),(0,V.jsx)(nc,{scenes:w.scenes,open:R,onClose:()=>z(!1),onSeek:e=>{ye(e),z(!1)}})]})]}),r===`summary`&&(0,V.jsx)(lc,{session:w}),r===`export`&&(0,V.jsx)(Ks,{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)(Dc,{scenes:e.scenes,currentIndex:O,onSeek:ye,annotatedScenes:S.annotatedScenes}),(0,V.jsx)(wa,{state:D,speed:A,currentIndex:O,totalScenes:F,userPromptCount:fe,currentTurn:de,onTogglePlayPause:N,onChangeSpeed:ee,onPrevPrompt:xe,onNextPrompt:be,onOpenSearch:()=>z(!0),onOpenOutline:()=>ae(!0),onShowHelp:()=>ue(!0)})]})]}),(0,V.jsx)(Sa,{open:p,onClose:()=>m(!1),actions:S,scenes:w.scenes,currentIndex:O,onSeek:ye,addingForScene:v,onClearAddingTarget:()=>y(null),readOnly:s}),(0,V.jsx)(Ir,{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 ${ie?`opacity-100`:`opacity-0 pointer-events-none`}`,onClick:()=>ae(!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 ${ie?`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:()=>L(`outline`),className:`flex-1 px-3 py-2.5 text-[10px] font-sans font-semibold uppercase tracking-widest transition-colors ${re===`outline`?`text-terminal-green border-b-2 border-terminal-green`:`text-terminal-dim hover:text-terminal-text`}`,children:`Outline`}),(0,V.jsxs)(`button`,{onClick:()=>L(`comments`),className:`flex-1 px-3 py-2.5 text-[10px] font-sans font-semibold uppercase tracking-widest transition-colors ${re===`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:re===`outline`?(0,V.jsx)(Zs,{scenes:e.scenes,currentIndex:O,onSeek:e=>{ye(e),ae(!1)},overlayActions:C,turnStats:e.meta.stats.turnStats}):(0,V.jsx)(ba,{actions:S,scenes:w.scenes,currentIndex:O,onSeek:e=>{ye(e)},addingForScene:v,onClearAddingTarget:()=>y(null),readOnly:s})})]})]}),(0,V.jsx)(Js,{open:le,onClose:()=>ue(!1)})]})}function Fc(){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=Lc();if(e&&Ic()){Rc(e,n,t);return}zc().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 Ic(){return!!window.__VIBE_REPLAY_EDITOR__}function Lc(){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 Rc(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},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 zc(){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 Vc(n.gistId);return{session:await Bc(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 Vc(n),r=await Bc(e);return fetch(`https://vibe-replay.com/api/cloud-replays/view-gist/${n}`,{method:`POST`}).catch(()=>{}),{session:r,mode:`readonly`,gistOwner:t}}if(Ic()){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 Bc(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 Bc(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 Vc(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 Hc(){let[e,t]=(0,_.useState)(()=>{let e=new URLSearchParams(window.location.search).get(`theme`);if(e===`light`||e===`dark`)return e;let t=localStorage.getItem(`vibe-replay-theme`);return t===`light`||t===`dark`?t:`dark`});return(0,_.useEffect)(()=>{let t=document.documentElement;t.classList.add(`theme-transition`),t.classList.toggle(`dark`,e===`dark`),t.classList.toggle(`light`,e===`light`),localStorage.setItem(`vibe-replay-theme`,e);let n=setTimeout(()=>t.classList.remove(`theme-transition`),300);return()=>clearTimeout(n)},[e]),{theme:e,toggleTheme:(0,_.useCallback)(()=>{t(e=>e===`dark`?`light`:`dark`)},[])}}function Uc(){let e=new URLSearchParams(window.location.search).get(`v`);return e===`summary`||e===`export`?e:`replay`}var Wc=`https://vibe-replay.com`;function Gc({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`:`${Wc}/api/auth/get-session`,r=``;if(!e)try{r=new URL(Wc).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`:`${Wc}/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(`${Wc}/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`:`${Wc}/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 Kc(){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 qc(){let e=Fc(),{theme:t,toggleTheme:n}=Hc(),{prefs:r,updatePref:i,togglePref:a}=Or(),o=e.status===`ready`?e.session:null,s=e.status===`ready`?e.mode:`embedded`,c=e.status===`ready`?e.gistOwner:void 0,l=e.status===`ready`?e.live:void 0,u=s===`editor`,[d,f]=(0,_.useState)(Uc()),p=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=()=>f(Uc());return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let m=e=>{f(e),L({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)(Zn,{headerLeft:(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 shrink-0`,children:[(0,V.jsx)(`button`,{onClick:()=>L({view:null,session:null}),className:`text-sm font-sans font-bold bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent hover:opacity-80 transition-opacity`,children:`vibe-replay`}),(0,V.jsxs)(`span`,{className:`instant-tooltip inline-flex items-center gap-1 text-[9px] font-sans font-bold px-2 py-0.5 rounded-full bg-terminal-green/10 text-terminal-green uppercase tracking-wider border border-terminal-green/20`,children:[(0,V.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-terminal-green animate-pulse`}),`Local`,(0,V.jsx)(`span`,{className:`instant-tooltip-text`,children:`v0.2.1\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)(Kc,{}),(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)(Gc,{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:()=>L({view:`dashboard`,session:null}),className:`text-sm font-sans font-bold shrink-0 hover:opacity-80 transition-opacity bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent`,children:`vibe-replay`}):(0,V.jsx)(`a`,{href:`https://vibe-replay.com`,target:`_blank`,rel:`noopener noreferrer`,className:`text-sm font-sans font-bold shrink-0 hover:opacity-80 transition-opacity bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent`,children:`vibe-replay`}),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.1\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:()=>L({view:`dashboard`,session:null,tab:e}),className:`px-3.5 py-1.5 text-xs font-sans font-semibold rounded-lg text-terminal-dim hover:text-terminal-text transition-all duration-200 ease-material`,children:e.charAt(0).toUpperCase()+e.slice(1)},e))}),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)(Kc,{}),(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)(Gc,{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)(Kc,{})]})]})})]}),g&&(0,V.jsx)(`div`,{className:`md:hidden fixed inset-0 z-30 bg-black/30`,onClick:()=>y(!1)}),(0,V.jsx)(Pc,{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)(qc,{})}));</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-3{top:.75rem;bottom:.75rem}.-bottom-20{bottom:-5rem}.-bottom-24{bottom:-6rem}.-left-20{left:-5rem}.-left-24{left:-6rem}.-right-10{right:-2.5rem}.-right-12{right:-3rem}.-right-20{right:-5rem}.-right-24{right:-6rem}.-top-12{top:-3rem}.-top-20{top:-5rem}.-top-24{top:-6rem}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.bottom-full{bottom:100%}.left-0{left:0}.left-3{left:.75rem}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3{top:.75rem}.top-full{top:100%}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[120\]{z-index:120}.z-\[60\]{z-index:60}.\!m-0{margin:0!important}.mx-0\.5{margin-left:.125rem;margin-right:.125rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-1\.5{margin-top:.375rem;margin-bottom:.375rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-auto{margin-bottom:auto}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1}.h-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-screen{min-height:100vh}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[10px\]{width:10px}.w-\[2px\]{width:2px}.w-\[68px\]{width:68px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0}.min-w-4{min-width:1rem}.min-w-\[140px\]{min-width:140px}.min-w-\[40px\]{min-width:40px}.min-w-\[760px\]{min-width:760px}.max-w-0{max-width:0}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-6xl{max-width:72rem}.max-w-\[120px\]{max-width:120px}.max-w-\[180px\]{max-width:180px}.max-w-\[200px\]{max-width:200px}.max-w-\[300px\]{max-width:300px}.max-w-\[400px\]{max-width:400px}.max-w-\[60\%\]{max-width:60%}.max-w-\[calc\(100vw-2rem\)\]{max-width:calc(100vw - 2rem)}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.flex-1{flex:1}.flex-\[2\]{flex:2}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-full{--tw-translate-x:-100%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-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-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-y-0\.5{row-gap:.125rem}.gap-y-1{row-gap:.25rem}.gap-y-2{row-gap:.5rem}.gap-y-5{row-gap:1.25rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-2\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.625rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-3\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.875rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.875rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-px>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1px * var(--tw-space-y-reverse))}.self-start{align-self:flex-start}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overscroll-contain{overscroll-behavior:contain}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-b-2xl{border-bottom-right-radius:1rem;border-bottom-left-radius:1rem}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-xl{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.rounded-t-sm{border-top-left-radius:.125rem;border-top-right-radius:.125rem}.border{border-width:1px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\[rgba\(168\,85\,247\,0\.2\)\]{border-color:#a855f733}.border-\[rgba\(168\,85\,247\,0\.3\)\]{border-color:#a855f74d}.border-amber-500\/30{border-color:#f59e0b4d}.border-blue-500\/30{border-color:#3b82f64d}.border-blue-500\/40{border-color:#3b82f666}.border-blue-500\/60{border-color:#3b82f699}.border-cyan-500\/30{border-color:#06b6d44d}.border-gray-500\/30{border-color:#6b72804d}.border-green-500\/15{border-color:#22c55e26}.border-green-500\/30{border-color:#22c55e4d}.border-purple-500\/30{border-color:#a855f74d}.border-red-400\/20{border-color:#f8717133}.border-red-500\/30{border-color:#ef44444d}.border-terminal-blue{border-color:var(--blue)}.border-terminal-border{border-color:var(--border)}.border-terminal-border-subtle{border-color:var(--border-subtle)}.border-terminal-dim{border-color:var(--dim)}.border-terminal-green{border-color:var(--green)}.border-terminal-orange{border-color:var(--orange)}.border-terminal-purple{border-color:var(--purple)}.border-transparent{border-color:#0000}.border-white\/10{border-color:#ffffff1a}.border-l-orange-500\/30{border-left-color:#f973164d}.border-l-red-500{--tw-border-opacity:1;border-left-color:rgb(239 68 68/var(--tw-border-opacity,1))}.border-l-terminal-blue{border-left-color:var(--blue)}.border-l-terminal-purple{border-left-color:var(--purple)}.\!bg-transparent{background-color:#0000!important}.bg-\[\#24292f\]{--tw-bg-opacity:1;background-color:rgb(36 41 47/var(--tw-bg-opacity,1))}.bg-\[rgba\(168\,85\,247\,0\.1\)\]{background-color:#a855f71a}.bg-amber-500\/20{background-color:#f59e0b33}.bg-black\/30{background-color:#0000004d}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/20{background-color:#3b82f633}.bg-cyan-500\/20{background-color:#06b6d433}.bg-gray-500\/20{background-color:#6b728033}.bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.bg-green-500\/20{background-color:#22c55e33}.bg-green-500\/5{background-color:#22c55e0d}.bg-purple-500\/10{background-color:#a855f71a}.bg-purple-500\/20{background-color:#a855f733}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.bg-red-500\/20{background-color:#ef444433}.bg-red-500\/5{background-color:#ef44440d}.bg-terminal-bg{background-color:var(--bg)}.bg-terminal-blue{background-color:var(--blue)}.bg-terminal-blue-emphasis{background-color:var(--blue-emphasis)}.bg-terminal-blue-subtle{background-color:var(--blue-subtle)}.bg-terminal-border{background-color:var(--border)}.bg-terminal-border-subtle{background-color:var(--border-subtle)}.bg-terminal-dim{background-color:var(--dim)}.bg-terminal-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-dim{color:var(--dim)}.text-terminal-dimmer{color:var(--dimmer)}.text-terminal-green{color:var(--green)}.text-terminal-orange{color:var(--orange)}.text-terminal-purple{color:var(--purple)}.text-terminal-red{color:var(--red)}.text-terminal-text{color:var(--text)}.text-transparent{color:#0000}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.line-through{text-decoration-line:line-through}.placeholder-terminal-dim::placeholder{color:var(--dim)}.placeholder-terminal-dimmer::placeholder{color:var(--dimmer)}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.shadow-2xl{--tw-shadow:0 25px 50px -12px #00000040;--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(251\,146\,60\,0\.5\)\]{--tw-shadow:0 0 8px #fb923c80;--tw-shadow-colored:0 0 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 #0000000d;--tw-shadow-colored:inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-layer-lg{--tw-shadow:var(--shadow-lg);--tw-shadow-colored:var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-layer-md{--tw-shadow:var(--shadow-md);--tw-shadow-colored:var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-layer-sm{--tw-shadow:var(--shadow-sm);--tw-shadow-colored:var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-layer-xl{--tw-shadow:var(--shadow-xl);--tw-shadow-colored:var(--shadow-xl);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 #0000000d;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.outline-none{outline-offset:2px;outline:2px solid #0000}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.ring-red-500\/40{--tw-ring-color:#ef444466}.ring-terminal-border-subtle{--tw-ring-color:var(--border-subtle)}.ring-transparent{--tw-ring-color:transparent}.blur-2xl{--tw-blur:blur(40px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-3xl{--tw-blur:blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-75{--tw-brightness:brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-sm{--tw-drop-shadow:drop-shadow(0 1px 1px #0000000d);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur:blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\[left\]{transition-property:left;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-shadow{transition-property:box-shadow;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-property:transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-1000{transition-duration:1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-material{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-material-decel,.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}html,body{max-width:100vw;overflow-x:hidden}:root{--font-sans:"Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif}:root,.dark{--bg:#0d1117;--surface:#161b22;--surface-hover:#21262d;--surface-2:#1c2129;--surface-inset:#010409;--border:#30363d;--border-subtle:#30363d80;--text:#c9d1d9;--dim:#8b949e;--dimmer:#7d8590;--green:#3fb950;--green-subtle:#3fb95026;--green-emphasis:#3fb95040;--blue:#79b8ff;--blue-subtle:#79b8ff26;--blue-emphasis:#79b8ff40;--orange:#d29922;--orange-subtle:#d2992226;--orange-emphasis:#d2992240;--red:#f85149;--red-subtle:#f8514926;--red-emphasis:#f8514940;--purple:#b392f0;--purple-subtle:#b392f026;--purple-emphasis:#b392f040;--cyan:#56d4dd;--cyan-subtle:#56d4dd26;--shadow-color:215 28% 4%;--shadow-sm:0 1px 2px hsl(var(--shadow-color) / .5);--shadow-md:0 1px 2px hsl(var(--shadow-color) / .4), 0 4px 8px hsl(var(--shadow-color) / .3);--shadow-lg:0 1px 3px hsl(var(--shadow-color) / .4), 0 4px 8px hsl(var(--shadow-color) / .3), 0 12px 24px hsl(var(--shadow-color) / .25);--shadow-xl:0 2px 4px hsl(var(--shadow-color) / .4), 0 8px 16px hsl(var(--shadow-color) / .3), 0 24px 48px hsl(var(--shadow-color) / .25);--surface-subtle-glass:#0d1117b3}.light{--bg:#fff;--surface:#f6f8fa;--surface-hover:#e6edf3;--surface-2:#ebeef1;--surface-inset:#f0f2f5;--border:#d0d7de;--border-subtle:#d0d7de80;--text:#24292f;--dim:#57606a;--dimmer:#697078;--green:#1a7f37;--green-subtle:#1a7f371a;--green-emphasis:#1a7f3733;--blue:#0969da;--blue-subtle:#0969da1a;--blue-emphasis:#0969da33;--orange:#9a6700;--orange-subtle:#9a67001a;--orange-emphasis:#9a670033;--red:#cf222e;--red-subtle:#cf222e1a;--red-emphasis:#cf222e33;--purple:#8250df;--purple-subtle:#8250df1a;--purple-emphasis:#8250df33;--cyan:#0e7c86;--cyan-subtle:#0e7c861a;--shadow-color:220 10% 50%;--shadow-sm:0 1px 2px hsl(var(--shadow-color) / .1);--shadow-md:0 1px 2px hsl(var(--shadow-color) / .08), 0 4px 8px hsl(var(--shadow-color) / .06);--shadow-lg:0 1px 3px hsl(var(--shadow-color) / .08), 0 4px 8px hsl(var(--shadow-color) / .06), 0 12px 24px hsl(var(--shadow-color) / .05);--shadow-xl:0 2px 4px hsl(var(--shadow-color) / .08), 0 8px 16px hsl(var(--shadow-color) / .06), 0 24px 48px hsl(var(--shadow-color) / .05);--surface-subtle-glass:#ffffffbf}html.theme-transition,html.theme-transition *,html.theme-transition :before,html.theme-transition :after{transition:background-color .25s,border-color .25s,color .25s}@media (prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}button,[role=button]{-webkit-tap-highlight-color:transparent}:focus:not(:focus-visible){outline:none}:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:4px}@supports (padding:env(safe-area-inset-top)){.safe-top{padding-top:max(env(safe-area-inset-top), 1.25rem)}.safe-bottom{padding-bottom:env(safe-area-inset-bottom)}}@keyframes blink{0%,to{opacity:1}50%{opacity:0}}.typing-cursor:after{content:"█";color:var(--green);animation:1s step-end infinite blink}@keyframes fade-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.scene-enter{animation:.3s cubic-bezier(.4,0,.2,1) fade-in}@keyframes pulse-border{0%,to{border-color:#d299224d}50%{border-color:#d2992299}}.pause-overlay{animation:2s ease-in-out infinite pulse-border}@keyframes jump-target-flash{0%{outline-color:#3fb95000;box-shadow:0 0 #3fb95000}30%{outline-color:#3fb95099;box-shadow:0 0 0 3px #3fb95040}to{outline-color:#3fb95000;box-shadow:0 0 #3fb95000}}.jump-target-flash{outline:1px solid #0000;animation:.85s ease-out jump-target-flash}@keyframes nav-focus-pulse{0%,to{transform:translateY(0)}50%{transform:translateY(-1px)}}.scene-nav-focused{animation:.9s ease-in-out 2 nav-focus-pulse}.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\:gap-3{gap:.75rem}.sm\:rounded-xl{border-radius:.75rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:py-3{padding-top:.75rem;padding-bottom:.75rem}.sm\:pt-\[15vh\]{padding-top:15vh}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-\[10px\]{font-size:10px}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width:768px){.md\:ml-12{margin-left:3rem}.md\:mt-10{margin-top:2.5rem}.md\:block{display:block}.md\:inline{display:inline}.md\:flex{display:flex}.md\:inline-flex{display:inline-flex}.md\:hidden{display:none}.md\:min-h-0{min-height:0}.md\:max-w-\[300px\]{max-width:300px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:gap-2{gap:.5rem}.md\:gap-3{gap:.75rem}.md\:space-y-7>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.75rem * var(--tw-space-y-reverse))}.md\:p-8{padding:2rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:pt-0{padding-top:0}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-5xl{font-size:3rem;line-height:1}}@media (min-width:1024px){.lg\:sticky{position:sticky}.lg\:top-3{top:.75rem}.lg\:inline{display:inline}.lg\:max-h-\[calc\(100vh-7rem\)\]{max-height:calc(100vh - 7rem)}.lg\:w-64{width:16rem}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_22rem\]{grid-template-columns:minmax(0,1fr) 22rem}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:justify-between{justify-content:space-between}.lg\:self-start{align-self:flex-start}.lg\:overflow-y-auto{overflow-y:auto}}@media (min-width:1280px){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1536px){.\32 xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}.\[\&\>svg\]\:block>svg{display:block}.\[\&\>svg\]\:h-auto>svg{height:auto}.\[\&\>svg\]\:w-full>svg{width:100%}
|
|
110
111
|
/*$vite$:1*/</style>
|
|
111
112
|
</head>
|
|
112
113
|
<body class="bg-terminal-bg text-terminal-text min-h-screen">
|