parasor 0.1.2 → 0.1.3
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/README.md +2 -0
- package/node_modules/@parasor/shared/dist/builtin-shell-presets.d.ts +74 -0
- package/node_modules/@parasor/shared/dist/builtin-shell-presets.d.ts.map +1 -0
- package/node_modules/@parasor/shared/dist/builtin-shell-presets.js +89 -0
- package/node_modules/@parasor/shared/dist/builtin-shell-presets.js.map +1 -0
- package/node_modules/@parasor/shared/dist/pane-commands.d.ts +1 -0
- package/node_modules/@parasor/shared/dist/pane-commands.d.ts.map +1 -1
- package/node_modules/@parasor/shared/dist/pane-commands.js +23 -3
- package/node_modules/@parasor/shared/dist/pane-commands.js.map +1 -1
- package/node_modules/@parasor/shared/dist/runtime.d.ts +21 -0
- package/node_modules/@parasor/shared/dist/runtime.d.ts.map +1 -1
- package/node_modules/@parasor/shared/dist/shell-presets.d.ts +43 -0
- package/node_modules/@parasor/shared/dist/shell-presets.d.ts.map +1 -0
- package/node_modules/@parasor/shared/dist/shell-presets.js +82 -0
- package/node_modules/@parasor/shared/dist/shell-presets.js.map +1 -0
- package/node_modules/@parasor/shared/dist/state.d.ts +41 -3
- package/node_modules/@parasor/shared/dist/state.d.ts.map +1 -1
- package/node_modules/@parasor/shared/dist/state.js +195 -0
- package/node_modules/@parasor/shared/dist/state.js.map +1 -1
- package/node_modules/@parasor/shared/dist/types.d.ts +2 -0
- package/node_modules/@parasor/shared/dist/types.d.ts.map +1 -1
- package/node_modules/@parasor/shared/dist/types.js +2 -0
- package/node_modules/@parasor/shared/dist/types.js.map +1 -1
- package/node_modules/@parasor/shared/dist/ws-events.d.ts +5 -1
- package/node_modules/@parasor/shared/dist/ws-events.d.ts.map +1 -1
- package/package.json +1 -1
- package/server/agent-detector/event-map.d.ts +1 -1
- package/server/agent-detector/event-map.d.ts.map +1 -1
- package/server/agent-detector/event-map.js +24 -1
- package/server/agent-detector/event-map.js.map +1 -1
- package/server/agent-detector/manual-agent-tracker.d.ts.map +1 -1
- package/server/agent-detector/manual-agent-tracker.js +2 -16
- package/server/agent-detector/manual-agent-tracker.js.map +1 -1
- package/server/agent-detector/output-eligibility.d.ts.map +1 -1
- package/server/agent-detector/output-eligibility.js +3 -23
- package/server/agent-detector/output-eligibility.js.map +1 -1
- package/server/agent-detector/runtime-registry.d.ts +7 -0
- package/server/agent-detector/runtime-registry.d.ts.map +1 -0
- package/server/agent-detector/runtime-registry.js +50 -0
- package/server/agent-detector/runtime-registry.js.map +1 -0
- package/server/application/integrations/hook-notify.d.ts.map +1 -1
- package/server/application/integrations/hook-notify.js +4 -1
- package/server/application/integrations/hook-notify.js.map +1 -1
- package/server/application/integrations/native-status-integrations.d.ts +90 -0
- package/server/application/integrations/native-status-integrations.d.ts.map +1 -0
- package/server/application/integrations/native-status-integrations.js +110 -0
- package/server/application/integrations/native-status-integrations.js.map +1 -0
- package/server/application/workspace/project-queries.d.ts +3 -2
- package/server/application/workspace/project-queries.d.ts.map +1 -1
- package/server/application/workspace/project-queries.js +13 -3
- package/server/application/workspace/project-queries.js.map +1 -1
- package/server/application/workspace/session-commands.d.ts +2 -1
- package/server/application/workspace/session-commands.d.ts.map +1 -1
- package/server/application/workspace/session-commands.js +3 -0
- package/server/application/workspace/session-commands.js.map +1 -1
- package/server/application/workspace/sidebar-state-commands.d.ts +15 -0
- package/server/application/workspace/sidebar-state-commands.d.ts.map +1 -0
- package/server/application/workspace/sidebar-state-commands.js +32 -0
- package/server/application/workspace/sidebar-state-commands.js.map +1 -0
- package/server/application/workspace/worktree-commands.d.ts +17 -2
- package/server/application/workspace/worktree-commands.d.ts.map +1 -1
- package/server/application/workspace/worktree-commands.js +56 -1
- package/server/application/workspace/worktree-commands.js.map +1 -1
- package/server/bootstrap/create-app-server.d.ts.map +1 -1
- package/server/bootstrap/create-app-server.js +21 -2
- package/server/bootstrap/create-app-server.js.map +1 -1
- package/server/bootstrap/wire-runtime.d.ts.map +1 -1
- package/server/bootstrap/wire-runtime.js +4 -1
- package/server/bootstrap/wire-runtime.js.map +1 -1
- package/server/cli/shim-installer.d.ts +2 -0
- package/server/cli/shim-installer.d.ts.map +1 -1
- package/server/cli/shim-installer.js +191 -9
- package/server/cli/shim-installer.js.map +1 -1
- package/server/debug/terminal-trace-recorder.d.ts +1 -1
- package/server/debug/terminal-trace-recorder.d.ts.map +1 -1
- package/server/debug/terminal-trace-recorder.js.map +1 -1
- package/server/index.d.ts.map +1 -1
- package/server/index.js +8 -2
- package/server/index.js.map +1 -1
- package/server/pty/headless-replay-snapshot.d.ts.map +1 -1
- package/server/pty/headless-replay-snapshot.js +40 -3
- package/server/pty/headless-replay-snapshot.js.map +1 -1
- package/server/pty/host-daemon/daemon.d.ts.map +1 -1
- package/server/pty/host-daemon/daemon.js +1 -0
- package/server/pty/host-daemon/daemon.js.map +1 -1
- package/server/pty/host-protocol/messages.d.ts +3 -2
- package/server/pty/host-protocol/messages.d.ts.map +1 -1
- package/server/pty/host-protocol/messages.js +6 -1
- package/server/pty/host-protocol/messages.js.map +1 -1
- package/server/pty/host.d.ts +2 -1
- package/server/pty/host.d.ts.map +1 -1
- package/server/pty/host.js.map +1 -1
- package/server/pty/in-process-host.d.ts +1 -0
- package/server/pty/in-process-host.d.ts.map +1 -1
- package/server/pty/in-process-host.js +43 -4
- package/server/pty/in-process-host.js.map +1 -1
- package/server/pty/remote-host.d.ts.map +1 -1
- package/server/pty/remote-host.js +1 -0
- package/server/pty/remote-host.js.map +1 -1
- package/server/routes/debug-terminal-trace.d.ts.map +1 -1
- package/server/routes/debug-terminal-trace.js +22 -9
- package/server/routes/debug-terminal-trace.js.map +1 -1
- package/server/routes/files.d.ts.map +1 -1
- package/server/routes/files.js +9 -8
- package/server/routes/files.js.map +1 -1
- package/server/routes/projects.d.ts +1 -1
- package/server/routes/projects.d.ts.map +1 -1
- package/server/routes/projects.js +90 -0
- package/server/routes/projects.js.map +1 -1
- package/server/routes/sessions.d.ts.map +1 -1
- package/server/routes/sessions.js +4 -0
- package/server/routes/sessions.js.map +1 -1
- package/server/state/app-state.d.ts.map +1 -1
- package/server/state/app-state.js +49 -1
- package/server/state/app-state.js.map +1 -1
- package/server/state/project-manager.d.ts.map +1 -1
- package/server/state/project-manager.js +3 -1
- package/server/state/project-manager.js.map +1 -1
- package/web/assets/EditorPane-BBPzKK75.js +123 -0
- package/web/assets/TerminalPane-DYSXTHu8.js +68 -0
- package/web/assets/file-icons-COR4RKgC.js +6 -0
- package/web/assets/index-CvIpZExy.css +2 -0
- package/web/assets/index-CvefG2gF.js +34 -0
- package/web/assets/session-resume-BtVz3PUc.js +2 -0
- package/web/assets/{terminal-trace-PuuFRybC.js → terminal-trace-B9iHKCkB.js} +9 -9
- package/web/assets/useVirtualKeyboard-BJO7-jU-.js +1 -0
- package/web/index.html +2 -2
- package/web/assets/EditorPane-CzzT3iYY.js +0 -123
- package/web/assets/TerminalPane-D3z_3Lr8.js +0 -68
- package/web/assets/file-icons-JBi09j0r.js +0 -6
- package/web/assets/index-CTTkRpnn.css +0 -2
- package/web/assets/index-KWVrWl8l.js +0 -34
- package/web/assets/session-resume-7f-tB-ZU.js +0 -2
- package/web/assets/useVirtualKeyboard-DgJb9u9d.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{W as e,gt as t,mt as n,w as r}from"./terminal-trace-B9iHKCkB.js";var i=e();function a({sessionTitle:e,command:t,endReason:n,socketDisconnectedReason:a,onRestart:s,onClose:c}){let l=o(t,n,a);return(0,i.jsx)(`div`,{className:`flex h-full w-full items-center justify-center bg-bg-primary p-6`,children:(0,i.jsx)(r,{tone:l.tone,tag:l.tag,title:l.heading,body:(0,i.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,i.jsx)(`span`,{className:`cm-mono text-xs text-text-primary`,children:e}),(0,i.jsx)(`span`,{className:`whitespace-pre-line`,children:l.detail})]}),primary:l.showRestart&&s?{label:`Re-run`,onClick:s}:void 0,secondary:c?{label:`Close`,onClick:c}:void 0})})}function o(e,t,n){if(n)return{tone:`warn`,tag:`DISCONNECTED`,heading:`Disconnected`,detail:`${n}\nReopen this session from the sidebar.`,showRestart:!1};if(t?.type===`server-crash`)return{tone:`err`,tag:`FAILED`,heading:`parasor server exited unexpectedly`,detail:`This session will not auto-resume to avoid duplicate processes.
|
|
2
|
+
Start a new session from the sidebar.`,showRestart:!1};if(t?.type===`daemon-crash`)return{tone:`err`,tag:`CRASHED`,heading:`parasor PTY host exited unexpectedly`,detail:`The daemon that owned this terminal crashed. Re-running may double-spawn an orphaned process -- start a new session from the sidebar instead.`,showRestart:!1};if(t?.type===`daemon-graceful`)return{tone:`warn`,tag:`DAEMON SHUTDOWN`,heading:`Session ended when the PTY host shut down`,detail:`Re-run to start a fresh session.`,showRestart:!0};let r=e?.type===`custom`?`"${e.command}"`:`Command`;return t?.type===`exit`?{tone:`info`,tag:`EXITED`,heading:`${r} exited (exit ${t.code})`,detail:`Re-run if needed.`,showRestart:!0}:t?.type===`signal`?{tone:`info`,tag:`STOPPED`,heading:`${r} stopped (signal ${t.signal})`,detail:`Re-run if needed.`,showRestart:!0}:{tone:`info`,tag:`ENDED`,heading:`Session ended`,detail:`Re-run if needed.`,showRestart:!0}}var s=new Set([`localhost`,`127.0.0.1`,`::1`,`[::1]`]),c=new Set([`0.0.0.0`,`[::]`]),l=[`localhost`,`127.0.0.1`,`[::1]`,`0.0.0.0`,`[::]`];function u(e){return s.has(e.toLowerCase())}function d(e){return c.has(e.toLowerCase())}function f(e){return typeof e==`number`&&Number.isInteger(e)&&e>0&&e<65536}function p(e,t){try{let n=new URL(e);return(t??l).some(e=>n.hostname===e)}catch{return!1}}function m(e,t){let n;try{n=new URL(e)}catch{return e}let r=u(n.hostname);if(!r&&!d(n.hostname)||typeof window>`u`)return e;let i=window.location.hostname;return!i||u(i)?e:r?f(t.reachablePort)?(n.hostname=i,n.port=String(t.reachablePort),n.toString()):t.fallbackToPageHostWithoutReachablePort?(n.hostname=i,n.toString()):e:(n.hostname=i,n.toString())}var h=`parasor:terminal-internal-clipboard`;function g(e){try{return window.localStorage.setItem(h,e),!0}catch{return!1}}function _(){try{let e=window.localStorage.getItem(h);return e&&e.length>0?e:null}catch{return null}}function v(){return _()!==null||!!navigator.clipboard?.readText}var y=t(n(),1),b=new Map,x=new Map;function S(e,t){return b.set(e,t),x.has(e)&&(x.delete(e),t()),()=>{b.get(e)===t&&b.delete(e)}}function C(e){let t=b.get(e);if(t){t();return}x.set(e,!0)}function w(e,t,n){(0,y.useEffect)(()=>{if(!(!e||!n))return S(e,t)},[e,t,n])}function T(){return typeof window>`u`?!1:window.matchMedia?.(`(pointer: coarse)`).matches??!1}var E=`application/x-parasor-paths`;function D(e){if(!e)return!1;let t=e.types,n=!1;for(let e of t){if(e===`application/x-parasor-paths`)return!1;e===`Files`&&(n=!0)}return n}function O(e){return e.includes(`application/x-parasor-paths`)?`internal`:e.includes(`Files`)?`os-files`:e.includes(`text/plain`)?`internal`:`none`}function k(e){return e===``?`''`:`'${e.replace(/'/g,`'\\''`)}'`}function A(e){return e.map(k).join(` `)}var j=[];function M(e){let t=j.indexOf(e);return t!==-1&&j.splice(t,1),j.push(e),()=>{let t=j.indexOf(e);t!==-1&&j.splice(t,1)}}function N(){return j.length>0}function P(e){let t=j[j.length-1];return t?(t(e),!0):!1}var F=1e3,I=3e4,L=3e3;function R(e){return e*(1+(Math.random()*.4-.2))}function z(e){let t=Math.min(F*2**e,I);return Math.round(R(t))}function B(e){let t;try{t=new URL(e)}catch{return}if(t.protocol!==`http:`&&t.protocol!==`https:`||typeof document>`u`)return;let n=document.createElement(`a`);n.href=t.toString(),n.target=`_blank`,n.rel=`noopener noreferrer`,n.referrerPolicy=`no-referrer`,document.body?.appendChild(n),n.click(),n.remove()}function V(e,t){return!e||!t||e.type!==`shell`&&e.type!==`claude`?!1:t.type===`exit`||t.type===`signal`||t.type===`server-graceful`||t.type===`daemon-graceful`}export{a as S,_,N as a,m as b,k as c,O as d,D as f,v as g,C as h,z as i,A as l,w as m,B as n,M as o,T as p,L as r,P as s,V as t,E as u,g as v,p as x,u as y};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
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)),l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function te(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function ne(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 A(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,A(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+te(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+te(a,u),c+=A(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+te(a,u++),c+=A(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return A(ne(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 j(e,t,n){if(e==null)return e;var r=[],i=0;return A(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(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 ie=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)},ae={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(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=ae,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:re}},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,ie)}catch(e){ie(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=>{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`})),f=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=d()})),p=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})),m=o(((e,t)=>{t.exports=p()})),h=c(u(),1),g=f(),_=m(),v=`a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])`;function y(e){return e?Array.from(e.querySelectorAll(v)):[]}function b({open:e,onDismiss:t,children:n,panelClassName:r=``,contentClassName:i=``,closeOnScrim:a=!0,closeOnEscape:o=!0,dragHandle:s=!0,manageFocus:c=!0,ariaLabel:l,ariaLabelledBy:u,dialogRole:d=`dialog`}){let f=(0,h.useRef)(null),p=(0,h.useRef)(null),m=(0,h.useRef)(null),[v,b]=(0,h.useState)(0),[x,S]=(0,h.useState)(!1),[C,w]=(0,h.useState)(!1);(0,h.useEffect)(()=>{if(!e){w(!1);return}let t=window.requestAnimationFrame(()=>w(!0));return()=>{window.cancelAnimationFrame(t),w(!1)}},[e]),(0,h.useEffect)(()=>{if(!e){b(0),S(!1);return}if(!c)return;p.current=document.activeElement;let t=window.requestAnimationFrame(()=>{y(f.current)[0]?.focus()});return()=>{window.cancelAnimationFrame(t),p.current?.focus?.()}},[e,c]),(0,h.useEffect)(()=>{if(!e)return;let n=e=>{if(e.key===`Escape`){if(!o)return;e.preventDefault(),e.stopPropagation(),t();return}if(e.key!==`Tab`||!c)return;let n=y(f.current);if(n.length===0){e.preventDefault();return}let r=n[0],i=n[n.length-1],a=document.activeElement;e.shiftKey&&(a===r||!f.current?.contains(a))?(e.preventDefault(),i.focus()):!e.shiftKey&&a===i&&(e.preventDefault(),r.focus())};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[o,e,t,c]);let T=(0,h.useCallback)(e=>{e.touches.length===1&&(m.current=e.touches[0].clientY,S(!0))},[]),E=(0,h.useCallback)(e=>{if(m.current==null||e.touches.length!==1)return;let t=e.touches[0].clientY-m.current;b(Math.max(0,t))},[]),D=(0,h.useCallback)(()=>{if(m.current==null)return;let e=v;m.current=null,S(!1);let n=f.current?.getBoundingClientRect().height??0;e>Math.max(80,n*.25)&&a?t():b(0)},[a,v,t]),O=e&&C?`translateY(${v}px)`:`translateY(100%)`,k=(0,_.jsxs)(`div`,{"aria-hidden":!e,inert:!e||void 0,className:`fixed inset-0 z-50 ${e?`pointer-events-auto`:`pointer-events-none`}`,children:[(0,_.jsx)(`div`,{className:`absolute inset-0 bg-black/55 transition-opacity duration-200 motion-reduce:transition-none ${e&&C?`opacity-100`:`opacity-0`}`,onClick:a?t:void 0,role:`presentation`}),(0,_.jsxs)(`div`,{ref:f,role:d,"aria-modal":`true`,"aria-label":l,"aria-labelledby":u,style:{transform:O,transition:x?`none`:`transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1)`},className:`absolute right-0 bottom-0 left-0 max-h-[80vh] w-full max-w-full overflow-hidden rounded-t-xl border-t border-border bg-bg-secondary ${e?`shadow-[0_-8px_24px_rgba(0,0,0,0.45)]`:`shadow-none`} ${r}`,children:[s&&(0,_.jsx)(`div`,{className:`flex cursor-grab justify-center pt-2 pb-1 select-none touch-none`,onTouchStart:T,onTouchMove:E,onTouchEnd:D,onTouchCancel:D,children:(0,_.jsx)(`div`,{className:`h-1 w-10 rounded-tag bg-border`})}),(0,_.jsx)(`div`,{className:`max-h-[calc(80vh-1.5rem)] w-full min-w-0 overflow-x-hidden overflow-y-auto pb-[env(safe-area-inset-bottom)] ${i}`,children:n})]})]});return typeof document>`u`?null:(0,g.createPortal)(k,document.body)}function x({items:e,density:t=`compact`,itemRole:n=`menuitem`,onItemSelect:r,onItemPointerDown:i}){let a=t===`touch`?`px-3 py-2.5 text-sm`:`px-3 py-1.5 text-sm`;return(0,_.jsx)(`div`,{className:`py-1`,children:e.map((e,t)=>(0,_.jsxs)(`div`,{children:[e.separatorBefore&&(0,_.jsx)(`div`,{"aria-hidden":!0,className:`mx-2 my-1 border-t border-border`}),(0,_.jsxs)(`button`,{type:`button`,role:n,"data-item-index":t,disabled:e.disabled,...e.title?{title:e.title}:{},onPointerDown:i,onClick:()=>{e.disabled||(e.onSelect(),r?.())},className:`flex w-full items-center gap-2 rounded-control text-left text-text-primary hover:bg-row-hover-bg focus:bg-row-hover-bg focus:outline-none disabled:cursor-not-allowed disabled:text-text-secondary disabled:opacity-60 disabled:hover:bg-transparent ${e.tone===`danger`?`text-danger`:``} ${a}`,children:[e.leading,(0,_.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.trailing&&(0,_.jsx)(`span`,{className:`shrink-0 text-xs text-text-secondary`,children:e.trailing})]})]},e.id))})}function S({items:e,align:t=`end`,placement:n=`bottom`,portal:r=!1,anchorPoint:i,open:a,onOpenChange:o,onClose:s,renderTrigger:c}){let[l,u]=(0,h.useState)(!!i),[d,f]=(0,h.useState)(0),[p,m]=(0,h.useState)(null),v=(0,h.useRef)(null),y=(0,h.useRef)(null),b=(0,h.useId)(),S=a??l,C=r||!!i,T=(0,h.useCallback)(e=>{e||s?.(),a===void 0&&u(e),o?.(e)},[a,s,o]),E=(0,h.useCallback)(()=>{if(!C||typeof window>`u`)return;if(i){m({left:Math.min(Math.max(i.x,8),Math.max(8,window.innerWidth-160-8)),minWidth:160,position:`fixed`,top:i.y});return}let e=v.current?.getBoundingClientRect();if(!e)return;let r=t===`end`?e.right-160:e.left;m({left:Math.min(Math.max(r,8),Math.max(8,window.innerWidth-160-8)),minWidth:160,position:`fixed`,top:n===`bottom`?e.bottom+4:e.top-4,transform:n===`top`?`translateY(-100%)`:void 0})},[t,i,C,n]),D=(0,h.useCallback)(()=>{T(!1),v.current?.focus()},[T]),O=(0,h.useCallback)(()=>{S||(f(0),E()),T(!S)},[S,T,E]);(0,h.useEffect)(()=>{if(!S)return;let e=e=>{let t=e.target;y.current?.contains(t)||v.current?.contains(t)||D()},t=e=>{e.key===`Escape`&&(e.preventDefault(),D())};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),C&&(E(),window.addEventListener(`resize`,E),window.addEventListener(`scroll`,E,!0)),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t),C&&(window.removeEventListener(`resize`,E),window.removeEventListener(`scroll`,E,!0))}},[D,C,S,E]),(0,h.useEffect)(()=>{S&&y.current?.querySelector(`[data-item-index="${d}"]`)?.focus()},[S,d]);let k=S?(0,_.jsx)(`div`,{ref:y,id:b,role:`menu`,onKeyDown:t=>{if(t.key===` `||t.key===`Enter`){t.stopPropagation();return}t.key===`ArrowDown`?(t.preventDefault(),f(t=>w(e,t,1))):t.key===`ArrowUp`?(t.preventDefault(),f(t=>w(e,t,-1))):t.key===`Home`?(t.preventDefault(),f(w(e,-1,1))):t.key===`End`&&(t.preventDefault(),f(w(e,e.length,-1)))},style:C?p??void 0:void 0,className:C?`z-40 rounded-window border border-border bg-bg-secondary shadow-lg`:`absolute z-40 min-w-[160px] rounded-window border border-border bg-bg-secondary shadow-lg ${n===`top`?`bottom-full mb-1`:`top-full mt-1`} ${t===`end`?`right-0`:`left-0`}`,children:(0,_.jsx)(x,{items:e,onItemSelect:D})}):null;return i?!k||typeof document>`u`?null:(0,g.createPortal)(k,document.body):(0,_.jsxs)(`div`,{className:C?`contents`:`relative inline-flex`,children:[c?.({open:S,toggle:O,triggerRef:e=>{v.current=e},menuId:b}),C?k&&(0,g.createPortal)(k,document.body):k]})}function C({open:e,items:t,onDismiss:n,ariaLabel:r,title:i,cancelLabel:a=`Cancel`,manageFocus:o=!0}){return(0,_.jsx)(b,{open:e,onDismiss:n,ariaLabel:r,manageFocus:o,children:(0,_.jsxs)(`div`,{className:`p-2`,children:[i&&(0,_.jsx)(`div`,{className:`mb-2 truncate px-3 py-1 text-xs text-text-secondary`,children:i}),(0,_.jsx)(x,{items:t,density:`touch`,itemRole:`button`,onItemSelect:n}),(0,_.jsx)(`button`,{type:`button`,className:`mt-1 w-full rounded-control px-3 py-2.5 text-center text-sm text-text-secondary`,onClick:n,children:a})]})})}function w(e,t,n){let r=e.length;if(r===0)return 0;for(let i=1;i<=r;i++){let a=(t+n*i+r)%r;if(!e[a]?.disabled)return a}return t}function T({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M18 6 6 18`}),(0,_.jsx)(`path`,{d:`m6 6 12 12`})]})}function E({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M5 12h14`}),(0,_.jsx)(`path`,{d:`M12 5v14`})]})}function D({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1`}),(0,_.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1`}),(0,_.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1`})]})}function O({className:e,...t}){return(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:(0,_.jsx)(`path`,{d:`m9 18 6-6-6-6`})})}function k({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M14 17H5`}),(0,_.jsx)(`path`,{d:`M19 7h-9`}),(0,_.jsx)(`circle`,{cx:`17`,cy:`17`,r:`3`}),(0,_.jsx)(`circle`,{cx:`7`,cy:`7`,r:`3`})]})}function ee({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`m21 21-4.34-4.34`}),(0,_.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`})]})}function te({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1`}),(0,_.jsx)(`path`,{d:`m12 15 5 6H7Z`})]})}function ne({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M4 5h16`}),(0,_.jsx)(`path`,{d:`M4 12h16`}),(0,_.jsx)(`path`,{d:`M4 19h16`})]})}function A({className:e,...t}){return(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:(0,_.jsx)(`path`,{d:`m15 18-6-6 6-6`})})}function j({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,_.jsx)(`path`,{d:`m10 8 4 4-4 4`})]})}function re({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M12 12h.01`}),(0,_.jsx)(`path`,{d:`M16 12h.01`}),(0,_.jsx)(`path`,{d:`m17 7 5 5-5 5`}),(0,_.jsx)(`path`,{d:`m7 7-5 5 5 5`}),(0,_.jsx)(`path`,{d:`M8 12h.01`})]})}function ie({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`circle`,{cx:`18`,cy:`18`,r:`3`}),(0,_.jsx)(`circle`,{cx:`6`,cy:`6`,r:`3`}),(0,_.jsx)(`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`}),(0,_.jsx)(`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`})]})}function ae({className:e,...t}){return(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:(0,_.jsx)(`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`})})}function oe({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,_.jsx)(`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`}),(0,_.jsx)(`path`,{d:`M2 12h20`})]})}function se({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}),(0,_.jsx)(`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}),(0,_.jsx)(`path`,{d:`M10 9H8`}),(0,_.jsx)(`path`,{d:`M16 13H8`}),(0,_.jsx)(`path`,{d:`M16 17H8`})]})}function ce({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}),(0,_.jsx)(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`})]})}function le({className:e,...t}){return(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:(0,_.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`})})}function ue({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M15 6a9 9 0 0 0-9 9V3`}),(0,_.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,_.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`})]})}function de({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M7 21h10`}),(0,_.jsx)(`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`})]})}function fe({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M4 11a9 9 0 0 1 9 9`}),(0,_.jsx)(`path`,{d:`M4 4a16 16 0 0 1 16 16`}),(0,_.jsx)(`circle`,{cx:`5`,cy:`19`,r:`1`})]})}function pe({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M12 17V3`}),(0,_.jsx)(`path`,{d:`m6 11 6 6 6-6`}),(0,_.jsx)(`path`,{d:`M19 21H5`})]})}function me({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`m18 9-6-6-6 6`}),(0,_.jsx)(`path`,{d:`M12 3v14`}),(0,_.jsx)(`path`,{d:`M5 21h14`})]})}function he({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,_.jsx)(`path`,{d:`M21 3v5h-5`}),(0,_.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,_.jsx)(`path`,{d:`M8 16H3v5`})]})}function ge({className:e,...t}){return(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:(0,_.jsx)(`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`})})}function _e({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`}),(0,_.jsx)(`circle`,{cx:`12`,cy:`13`,r:`2`}),(0,_.jsx)(`path`,{d:`M12 15v5`})]})}function ve({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M18 19a5 5 0 0 1-5-5v8`}),(0,_.jsx)(`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`}),(0,_.jsx)(`circle`,{cx:`13`,cy:`12`,r:`2`}),(0,_.jsx)(`circle`,{cx:`20`,cy:`19`,r:`2`})]})}function ye({className:e,...t}){return(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:(0,_.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})})}function be({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,_.jsx)(`path`,{d:`M10 15V9`}),(0,_.jsx)(`path`,{d:`M14 15V9`})]})}function xe({className:e,...t}){return(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:(0,_.jsx)(`circle`,{cx:`12`,cy:`12`,r:`6`})})}function Se({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M12 6v12`}),(0,_.jsx)(`path`,{d:`M17.196 9 6.804 15`}),(0,_.jsx)(`path`,{d:`m6.804 9 10.392 6`})]})}function Ce({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`m10 10-6.157 6.162a2 2 0 0 0-.5.833l-1.322 4.36a.5.5 0 0 0 .622.624l4.358-1.323a2 2 0 0 0 .83-.5L14 13.982`}),(0,_.jsx)(`path`,{d:`m12.829 7.172 4.359-4.346a1 1 0 1 1 3.986 3.986l-4.353 4.353`}),(0,_.jsx)(`path`,{d:`m2 2 20 20`})]})}function we({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M9 14 4 9l5-5`}),(0,_.jsx)(`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`})]})}function Te({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M12 13v8`}),(0,_.jsx)(`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`}),(0,_.jsx)(`path`,{d:`m8 17 4-4 4 4`})]})}function Ee({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,_.jsx)(`path`,{d:`M12 3v18`})]})}function De({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}),(0,_.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]})}function Oe({className:e,...t}){return(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,_.jsx)(`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}),(0,_.jsx)(`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}),(0,_.jsx)(`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}),(0,_.jsx)(`path`,{d:`m2 2 20 20`})]})}var M={close:T,add:E,more:D,disclosure:O,settings:k,search:ee,pin:te,menu:ne,back:A,terminal:j,diff:re,git:ie,files:ae,folder:ae,browser:oe,doc:se,readOnlyProject:ce,unknownKind:le,branch:ue,monitor:de,connection:fe,pull:pe,push:me,refresh:he,agent:ge,worktreeActive:_e,worktreeInactive:ve,working:ye,attention:be,circleSmall:xe,modified:Se,readOnlyFile:Ce,revert:we,save:Te,split:Ee,eye:De,eyeOff:Oe},ke={idle:`idle`,working:`working`,attention:`needs input`,review:`review`,none:`default`};function Ae({state:e=`idle`,size:t=16,title:n}){let r=n??ke[e],i={width:t,height:t},a=`h-full w-full`;return e===`working`?(0,_.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center text-[var(--theme-git-modified)]`,style:i,role:`img`,"aria-label":r,children:(0,_.jsx)(M.working,{className:`agent-status-working ${a}`})}):e===`attention`?(0,_.jsx)(`span`,{className:`agent-status-attention inline-flex shrink-0 items-center justify-center text-danger`,style:i,role:`img`,"aria-label":r,children:(0,_.jsx)(M.attention,{className:a})}):e===`review`?(0,_.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center text-success`,style:i,role:`img`,"aria-label":r,children:(0,_.jsx)(M.circleSmall,{className:a})}):(0,_.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center text-text-secondary/70`,style:i,role:`img`,"aria-label":r,children:(0,_.jsx)(M.circleSmall,{className:a})})}function je({className:e=``,label:t=`Close`,onClick:n}){return(0,_.jsx)(`button`,{type:`button`,onClick:n,"aria-label":t,className:`flex h-tap-md w-tap-md shrink-0 items-center justify-center rounded-control text-text-secondary transition-colors hover:bg-row-hover-bg hover:text-text-primary focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent ${e}`,children:(0,_.jsx)(M.close,{})})}var Me=`a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])`;function Ne(e){return Array.from(e.querySelectorAll(Me))}function Pe(e,t){let n=(0,h.useRef)(null);(0,h.useEffect)(()=>{if(e)return n.current=document.activeElement,()=>{let e=n.current;n.current=null,e&&document.contains(e)&&e.focus?.()}},[e]),(0,h.useEffect)(()=>{if(!e)return;let n=e=>{if(e.key!==`Tab`)return;let n=t.current;if(!n)return;let r=Ne(n);if(r.length===0){e.preventDefault();return}let i=r[0],a=r[r.length-1],o=document.activeElement;e.shiftKey&&(o===i||!n.contains(o))?(e.preventDefault(),a.focus()):!e.shiftKey&&(o===a||!n.contains(o))&&(e.preventDefault(),i.focus())};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e,t])}var Fe=`inline-flex items-center justify-center gap-1.5 rounded-control border font-normal leading-[1.4] transition-colors disabled:cursor-not-allowed disabled:opacity-50`,Ie={xs:`px-2 py-0.5 text-xs`,sm:`px-2.5 py-1 text-sm`},Le={submit:`border-transparent bg-accent text-bg-primary font-medium hover:bg-accent/90`,destroy:`border-transparent bg-danger text-bg-primary font-medium hover:bg-danger/90`,normal:`border-transparent bg-button-secondary-bg text-text-primary hover:bg-button-secondary-hover-bg`,dismiss:`border-transparent bg-transparent text-text-secondary hover:bg-row-hover-bg hover:text-text-primary`};function N({kind:e=`normal`,size:t=`sm`,className:n,children:r,...i}){return(0,_.jsx)(`button`,{className:`${Fe} ${Ie[t]} ${Le[e]}${n?` ${n}`:``}`,...i,children:r})}function Re({open:e,ariaLabel:t,ariaLabelledBy:n,onClose:r,children:i,closeOnBackdrop:a=!0,closeOnEscape:o=!0,dialogRole:s=`dialog`,presentation:c=`modal`,backdropClassName:l=`bg-black/60`,onPanelContextMenu:u,panelClassName:d=``,panelTabIndex:f,widthClassName:p=`max-w-surface-md`}){let m=(0,h.useRef)(null),[g,v]=(0,h.useState)(!1);return Pe(e&&c!==`sheet`,m),(0,h.useEffect)(()=>{if(!e||c===`sheet`){v(!1);return}let t=requestAnimationFrame(()=>v(!0));return()=>{cancelAnimationFrame(t),v(!1)}},[e,c]),(0,h.useEffect)(()=>{if(!e||c===`sheet`||!o)return;function t(e){e.key===`Escape`&&(e.preventDefault(),r())}return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[o,e,r,c]),e?c===`sheet`?(0,_.jsx)(b,{open:e,onDismiss:r,ariaLabel:t,ariaLabelledBy:n,dialogRole:s,closeOnScrim:a,closeOnEscape:o,contentClassName:`flex flex-col ${d}`,children:i}):c===`fullscreen`?(0,_.jsx)(`div`,{className:`fixed inset-0 z-50 transition-opacity duration-150 ease-out motion-reduce:transition-none ${g?`opacity-100`:`opacity-0`} ${l}`,role:`presentation`,children:(0,_.jsx)(`div`,{ref:m,role:s,"aria-modal":`true`,"aria-label":t,"aria-labelledby":n,tabIndex:f,onContextMenu:u,className:`flex h-full w-full min-w-0 bg-bg-secondary transition-opacity duration-150 ease-out motion-reduce:transition-none ${g?`opacity-100`:`opacity-0`} ${d}`,children:i})}):(0,_.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center transition-opacity duration-150 ease-out motion-reduce:transition-none ${g?`opacity-100`:`opacity-0`} ${l}`,onClick:e=>{a&&e.target===e.currentTarget&&r()},children:(0,_.jsx)(`div`,{ref:m,role:s,"aria-modal":`true`,"aria-label":t,"aria-labelledby":n,tabIndex:f,onContextMenu:u,className:`w-full ${p} rounded-window border border-border bg-bg-secondary shadow-xl transition-[opacity,transform] duration-150 ease-out motion-reduce:transition-none ${g?`translate-y-0 scale-100 opacity-100`:`translate-y-1 scale-[0.98] opacity-0`} ${d}`,children:i})}):null}function ze({title:e,subject:t,onClose:n}){return(0,_.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 border-b border-border px-4 py-3`,children:[(0,_.jsx)(`span`,{className:`min-w-0 truncate text-sm ${t?`text-text-secondary`:`font-semibold text-text-primary`}`,children:e}),t&&(0,_.jsx)(`span`,{className:`cm-mono min-w-0 truncate text-sm font-semibold text-text-primary`,children:t}),(0,_.jsx)(je,{className:`ml-auto`,onClick:n})]})}function Be({children:e,layout:t=`end`}){return t===`stack`?(0,_.jsx)(`div`,{className:`flex w-full min-w-0 flex-col items-stretch gap-2 pt-1`,children:e}):(0,_.jsx)(`div`,{className:`flex w-full min-w-0 flex-wrap items-center justify-end gap-2 overflow-hidden pt-1`,children:e})}function Ve({children:e,type:t=`button`,variant:n=`normal`,ref:r,className:i,...a}){return(0,_.jsx)(N,{ref:r,type:t,kind:n===`danger`?`destroy`:n===`primary`?`submit`:`normal`,size:`sm`,className:`min-w-0 max-w-full overflow-hidden ${i??``}`,...a,children:(0,_.jsx)(`span`,{className:`min-w-0 truncate`,children:e})})}function He({ariaLabel:e,children:t,confirmLabel:n,confirmVariant:r=`primary`,onCancel:i,onConfirm:a,panelClassName:o=``}){let s=(0,h.useRef)(null);return(0,h.useEffect)(()=>{let e=requestAnimationFrame(()=>s.current?.focus());return()=>cancelAnimationFrame(e)},[]),(0,_.jsxs)(Re,{open:!0,ariaLabel:e,onClose:i,widthClassName:`max-w-surface-sm`,panelClassName:`p-6 ${o}`,children:[(0,_.jsx)(`div`,{className:`mb-4 text-sm leading-[1.55] text-text-primary`,children:t}),(0,_.jsxs)(Be,{children:[(0,_.jsx)(Ve,{onClick:i,children:`Cancel`}),(0,_.jsx)(Ve,{ref:s,variant:r,onClick:a,children:n})]})]})}function Ue({children:e,className:t}){return(0,_.jsx)(`span`,{className:`cm-kbd${t?` ${t}`:``}`,children:e})}function We({items:e,align:t=`end`,placement:n=`bottom`,renderTrigger:r}){return(0,_.jsx)(S,{items:e,align:t,placement:n,renderTrigger:r})}var Ge={pane:`bg-pane-header-bg`,sidebar:``};function Ke({desktopOnly:e=!1,status:t,actions:n,tone:r=`pane`,horizontalPaddingClassName:i=`px-3`}){let a=e?`hidden md:flex`:`flex`,o=Ge[r];return(0,_.jsx)(`div`,{className:`${a} shrink-0 flex-col border-t border-border ${o} ${r===`sidebar`?`cm-safe-area-bottom-standalone`:``}`,children:(0,_.jsxs)(`div`,{className:`flex h-bar items-center gap-2 ${i}`,children:[t===void 0?(0,_.jsx)(`span`,{className:`flex-1`}):(0,_.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-text-secondary`,children:t}),n]})})}var qe={accent:`text-accent`,warning:`text-warning`};function Je({icon:e,iconTone:t=`accent`,desktopOnly:n=!1,title:r,titleAttr:i,titleElement:a,titleMono:o=!1,titleAdornment:s,subtitle:c,subtitleAttr:l,inline:u,actions:d}){return(0,_.jsxs)(`div`,{className:`${n?`hidden md:flex`:`flex`} h-bar shrink-0 items-center gap-2 border-b border-border bg-pane-header-bg px-3`,children:[e&&(0,_.jsx)(`span`,{"aria-hidden":!0,className:`flex shrink-0 ${qe[t]}`,children:e}),a??(0,_.jsx)(`span`,{title:i,className:`min-w-0 flex-shrink truncate text-sm font-semibold tracking-[-0.005em] text-text-primary${o?` cm-mono`:``}`,children:r}),s,c&&(0,_.jsx)(`span`,{title:l,className:`min-w-0 flex-shrink truncate text-xs text-text-secondary/75`,children:c}),u,(0,_.jsx)(`span`,{className:`flex-1`}),d]})}var Ye={sm:`h-tap-sm w-tap-sm`,md:`h-tap-md w-tap-md`},Xe={normal:`text-text-secondary hover:bg-row-hover-bg hover:text-text-primary`,active:`text-text-primary hover:bg-row-hover-bg`,accent:`text-accent hover:bg-row-hover-bg`,danger:`text-text-secondary hover:bg-danger/15 hover:text-danger`};function Ze({label:e,size:t=`sm`,tone:n=`normal`,pressed:r,title:i,className:a,children:o,...s}){return(0,_.jsx)(`button`,{type:`button`,"aria-label":e,title:i,...r===void 0?{}:{"aria-pressed":r},className:`flex ${Ye[t]} shrink-0 items-center justify-center rounded-control transition-colors disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-text-secondary ${Xe[n]}${a?` ${a}`:``}`,...s,children:o})}function Qe({value:e,options:t,onChange:n,className:r}){return(0,_.jsx)(`div`,{role:`tablist`,className:`flex min-w-0 border-b border-border${r?` ${r}`:``}`,children:t.map(t=>{let r=t.value===e;return(0,_.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":r,onClick:()=>n(t.value),className:`min-w-0 flex-1 truncate border-b-2 px-3 py-2 text-xs transition-colors ${r?`border-accent text-accent`:`border-transparent text-text-secondary hover:text-text-primary`}`,children:t.label},t.value)})})}var $e={err:`bg-danger`,warn:`bg-warning`,info:`bg-accent`},et={err:`text-danger`,warn:`text-warning`,info:`text-accent`},tt={err:`FAILED`,warn:`NEEDS ATTENTION`,info:`PAUSED`};function nt({tone:e,tag:t,title:n,body:r,primary:i,secondary:a,ternary:o,className:s}){let c=t??tt[e];return(0,_.jsxs)(`div`,{className:`flex w-surface-sm max-w-full flex-col overflow-hidden rounded-window border border-border bg-bg-secondary shadow-lg${s?` ${s}`:``}`,children:[(0,_.jsx)(`div`,{"aria-hidden":!0,className:`h-1 shrink-0 ${$e[e]}`}),(0,_.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 py-3.5`,children:[(0,_.jsx)(`span`,{className:`cm-mono self-start text-xs font-bold uppercase tracking-[0.08em] ${et[e]}`,children:c}),(0,_.jsx)(`div`,{className:`text-sm font-semibold tracking-[-0.005em] text-text-primary`,children:n}),(0,_.jsx)(`div`,{className:`text-sm leading-[1.55] text-text-secondary`,children:r}),(i||a||o)&&(0,_.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:[i&&(0,_.jsx)(N,{kind:i.kind??`submit`,size:`sm`,onClick:i.onClick,children:i.label}),a&&(0,_.jsx)(N,{kind:a.kind??`normal`,size:`sm`,onClick:a.onClick,children:a.label}),o&&(0,_.jsx)(N,{kind:o.kind??`dismiss`,size:`sm`,onClick:o.onClick,children:o.label})]})]})]})}var rt=`parasor:auth-expired`,it=class extends Error{constructor(){super(`parasor session expired`),this.name=`AuthExpiredError`}},at=!1,P=0;function ot(){P=0,!at&&(at=!0,typeof window<`u`&&window.dispatchEvent(new Event(rt)))}async function st(e,t){let n=await fetch(e,t);if(n.status===401)throw P=0,ot(),new it;return n}async function ct(e={}){let t=e.dispatchOn401??!0;if(e.reuseRecentSuccess&&P>0&&Date.now()-P<3e4)return!0;let n;try{n=await fetch(`/api/auth/verify`,{cache:`no-store`,credentials:`same-origin`})}catch{return!0}return n.status===401?(P=0,t&&ot(),!1):n.status>=500?!0:(n.ok&&(P=Date.now()),n.ok)}var lt=`parasor-font-face-`,ut=new Set;async function dt({family:e,url:t,format:n=`truetype`}){if(ut.has(e))return;if(typeof FontFace==`function`&&document.fonts){let r=new FontFace(e,`url("${t}") format("${n}")`);try{await r.load()}catch(n){throw Error(`Failed to load font "${e}" from ${t}: ${n.message}`)}document.fonts.add(r),ut.add(e);return}let r=document.createElement(`style`);r.id=`${lt}${e}`,r.textContent=`@font-face{font-family:"${e}";src:url("${t}") format("${n}");font-display:swap;}`,document.head.appendChild(r),ut.add(e)}var ft=`"SF Mono", ui-monospace, Menlo, Consolas, "Symbols Nerd Font", "Noto Sans Mono CJK JP", monospace`,pt=`system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,mt=/^[a-zA-Z_][a-zA-Z0-9_-]*$/,ht=new Set([`serif`,`sans-serif`,`monospace`,`-apple-system`,`cursive`,`fantasy`,`system-ui`,`ui-serif`,`ui-sans-serif`,`ui-monospace`,`ui-rounded`,`math`,`emoji`,`fangsong`,`inherit`,`initial`,`unset`,`revert`,`revert-layer`]);function gt(e){let t=e.trim();return t.length===0||t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)||ht.has(t)||mt.test(t)?t:`"${t.replace(/"/g,``)}"`}function _t(e,t=ft){let n=e.trim();if(n.length===0)return t;let r=n.split(`,`).map(e=>gt(e)).filter(e=>e.length>0);return r.length===0?t:`${r.join(`, `)}, ${t}`}var vt=`// This theme's colors are based on the original Monokai:
|
|
1
|
+
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)),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 ee=b.prototype=new y;ee.constructor=b,g(ee,v.prototype),ee.isPureReactComponent=!0;var x=Array.isArray;function te(){}var S={H:null,A:null,T:null,S:null},ne=Object.prototype.hasOwnProperty;function re(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ie(e,t){return re(e.type,t,e.props)}function C(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ae(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var oe=/\/+/g;function se(e,t){return typeof e==`object`&&e&&e.key!=null?ae(``+e.key):t.toString(36)}function ce(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(te,te):(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 w(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,w(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+se(e,0):a,x(o)?(i=``,c!=null&&(i=c.replace(oe,`$&/`)+`/`),w(o,r,i,``,function(e){return e})):o!=null&&(C(o)&&(o=ie(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(oe,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(x(e))for(var u=0;u<e.length;u++)a=e[u],s=l+se(a,u),c+=w(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+se(a,u++),c+=w(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return w(ce(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 T(e,t,n){if(e==null)return e;var r=[],i=0;return w(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function le(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 ue=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)},de={map:T,forEach:function(e,t,n){T(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return T(e,function(){t++}),t},toArray:function(e){return T(e,function(e){return e})||[]},only:function(e){if(!C(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=de,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=S,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return S.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)!ne.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 re(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)ne.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 re(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=C,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:le}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=S.T,n={};S.T=n;try{var r=e(),i=S.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(te,ue)}catch(e){ue(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),S.T=t}},e.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},e.use=function(e){return S.H.use(e)},e.useActionState=function(e,t,n){return S.H.useActionState(e,t,n)},e.useCallback=function(e,t){return S.H.useCallback(e,t)},e.useContext=function(e){return S.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return S.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return S.H.useEffect(e,t)},e.useEffectEvent=function(e){return S.H.useEffectEvent(e)},e.useId=function(){return S.H.useId()},e.useImperativeHandle=function(e,t,n){return S.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return S.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return S.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return S.H.useMemo(e,t)},e.useOptimistic=function(e,t){return S.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return S.H.useReducer(e,t,n)},e.useRef=function(e){return S.H.useRef(e)},e.useState=function(e){return S.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return S.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return S.H.useTransition()},e.version=`19.2.4`})),u=o(((e,t)=>{t.exports=l()})),d=[{id:`builtin:terminal`,source:`builtin`,label:`Terminal`,iconKey:`terminal`,group:`terminal`,commandLine:``,appendEnter:!1,runtimeHint:{runtimeId:`terminal`,tier:`generic-terminal`,expectedProcesses:[`sh`,`bash`,`zsh`,`fish`]}},{id:`builtin:claude`,source:`builtin`,label:`Claude`,iconKey:`agent`,group:`agent`,commandLine:`claude`,appendEnter:!0,runtimeHint:{runtimeId:`claude`,tier:`native-managed`,expectedProcesses:[`claude`],detectCommands:[`claude`]}},{id:`builtin:codex`,source:`builtin`,label:`Codex`,iconKey:`agent`,group:`agent`,commandLine:`codex`,appendEnter:!0,runtimeHint:{runtimeId:`codex`,tier:`native-managed`,expectedProcesses:[`codex`],detectCommands:[`codex`]}},{id:`builtin:opencode`,source:`builtin`,label:`OpenCode`,iconKey:`agent`,group:`agent`,commandLine:`opencode`,appendEnter:!0,runtimeHint:{runtimeId:`opencode`,tier:`native-managed`,expectedProcesses:[`opencode`],detectCommands:[`opencode`]}},{id:`builtin:gemini`,source:`builtin`,label:`Gemini`,iconKey:`agent`,group:`agent`,commandLine:`gemini`,appendEnter:!0,runtimeHint:{runtimeId:`gemini`,tier:`process-aware`,expectedProcesses:[`gemini`,`gemini-cli`],detectCommands:[`gemini`,`gemini-cli`]}}];function f(e){return{presetId:e.id,source:e.source,label:e.label,commandLine:e.commandLine,...e.runtimeHint&&{runtimeHint:e.runtimeHint}}}var p=50,m=128,h=200,g=1e3,_=50,v=1e3,y=new Set([`cursor`,`vscode`]);function b(e){if(!Array.isArray(e))return[];let t=[],n=new Set;for(let r of e){if(!ee(r))continue;let e=r.id,i=r.label,a=r.command,o=r.args;if(typeof e!=`string`||typeof i!=`string`||typeof a!=`string`||!Array.isArray(o)||e.length>m)continue;let s=e.trim(),c=i.trim(),l=a.trim(),u=o.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(e=>e.length>0&&e.length<=v).slice(0,_);if(!(!s||y.has(s)||n.has(s)||!c||c.length>h||!l||l.length>g)&&(n.add(s),t.push({id:s,label:c,command:l,args:u}),t.length>=p))break}return t}function ee(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var x=100,te=128,S=200,ne=4e3,re=new Map(d.map(e=>[e.id,e]));function ie(e){if(!Array.isArray(e))return[];let t=[],n=new Set;for(let r of e){if(!C(r))continue;let e=r.id,i=r.label,a=r.initialInput;if(typeof e!=`string`||typeof i!=`string`||typeof a!=`string`||e.length>te||a.length>ne)continue;let o=i.trim(),s=a.trim();if(!e||n.has(e))continue;let c=re.get(e);if(c){if(s.length>ne||c.commandLine&&!s)continue;if(n.add(e),t.push({id:e,label:c.label,initialInput:s,enabled:c.group===`terminal`?!0:r.enabled!==!1}),t.length>=x)break;continue}if(!(e.startsWith(`builtin:`)||!o||o.length>S||!s)&&(n.add(e),t.push({id:e,label:o,initialInput:s}),t.length>=x))break}return t}function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ae(e){return`files:${e}`}function oe(e){return`git:${e}`}function se(e){return`terminal:${e}`}var ce=[35,65];function w(e){return{id:ae(e),kind:`files`,worktreePath:e,state:{kind:`files`,selectedFilePath:null}}}function T(e){return{id:oe(e),kind:`git`,worktreePath:e,state:{kind:`git`,selectedCommitSha:null}}}function le(e,t,n){return{id:e,kind:`terminal`,worktreePath:t,state:{kind:`terminal`,sessionId:n}}}function ue(e,t,n){return{id:e,kind:`browser`,worktreePath:t,state:{kind:`browser`,url:n}}}function de(e){let t=e.filter(e=>e.kind===`files`),n=e.filter(e=>e.kind===`terminal`),r=e.filter(e=>e.kind===`browser`),i=e.filter(e=>e.kind===`git`);return[...t,...n,...r,...i]}function fe(e,t){let n=t.some(e=>e.kind===`files`),r=t.some(e=>e.kind===`git`);if(n&&r)return t;let i=[...t];return n||i.unshift(w(e)),r||i.push(T(e)),i}var pe=10*1024*1024,me=100*1024*1024;function he(){return{paneOrder:{},worktreeOpen:{}}}function ge(e){return be(e)?{paneOrder:ve(e.paneOrder),worktreeOpen:ye(e.worktreeOpen)}:he()}function _e(e,t){let n=ge(e),r={paneOrder:{...n.paneOrder},worktreeOpen:{...n.worktreeOpen}};for(let[e,n]of Object.entries(t.paneOrder??{}))n===null?delete r.paneOrder[e]:r.paneOrder[e]=n;for(let[e,n]of Object.entries(t.worktreeOpen??{}))n===null?delete r.worktreeOpen[e]:r.worktreeOpen[e]=n;return r}function ve(e){if(!be(e))return{};let t={};for(let[n,r]of Object.entries(e)){if(!Array.isArray(r))continue;let e=r.filter(e=>typeof e==`string`);e.length>0&&(t[n]=e)}return t}function ye(e){if(!be(e))return{};let t={};for(let[n,r]of Object.entries(e))typeof r==`boolean`&&(t[n]=r);return t}function be(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var E={INPUT:0,RESIZE:1,REFRESH:2,FLOW_PAUSE:3,FLOW_RESUME:4,OUTPUT:16,EXIT:17};function xe(e,t){let n=new Uint8Array(5+t.length),r=new DataView(n.buffer,n.byteOffset,n.byteLength);return n[0]=E.INPUT,r.setUint32(1,e>>>0,!1),n.set(t,5),n}function Se(e,t){let n=new Uint8Array(9),r=new DataView(n.buffer,n.byteOffset,n.byteLength);return n[0]=E.RESIZE,r.setUint32(1,e>>>0,!1),r.setUint32(5,t>>>0,!1),n}function Ce(){return new Uint8Array([E.REFRESH])}function we(){return new Uint8Array([E.FLOW_PAUSE])}function Te(){return new Uint8Array([E.FLOW_RESUME])}function Ee(e){if(e.length<1)return{ok:!1,reason:`empty buffer`};let t=e[0],n=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(t){case E.INPUT:return e.length<5?{ok:!1,reason:`input header`}:{ok:!0,frame:{kind:`input`,generation:n.getUint32(1,!1),data:e.subarray(5)}};case E.RESIZE:{if(e.length!==9)return{ok:!1,reason:`resize length`};let t=n.getUint32(1,!1),r=n.getUint32(5,!1);return t===0||r===0||t>8192||r>8192?{ok:!1,reason:`resize range`}:{ok:!0,frame:{kind:`resize`,cols:t,rows:r}}}case E.REFRESH:return e.length===1?{ok:!0,frame:{kind:`refresh`}}:{ok:!1,reason:`refresh length`};case E.FLOW_PAUSE:return e.length===1?{ok:!0,frame:{kind:`flow-pause`}}:{ok:!1,reason:`flow-pause length`};case E.FLOW_RESUME:return e.length===1?{ok:!0,frame:{kind:`flow-resume`}}:{ok:!1,reason:`flow-resume length`};case E.OUTPUT:return e.length<13?{ok:!1,reason:`output header`}:{ok:!0,frame:{kind:`output`,generation:n.getUint32(1,!1),seq:n.getBigUint64(5,!1),data:e.subarray(13)}};case E.EXIT:return e.length===5?{ok:!0,frame:{kind:`exit`,exitCode:n.getInt32(1,!1)}}:{ok:!1,reason:`exit length`};default:return{ok:!1,reason:`unknown prefix 0x${t.toString(16)}`}}}var De=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})),Oe=o(((e,t)=>{t.exports=De()})),D=Oe(),ke=`h-icon-base w-icon-base`;function Ae(e,t,n){return e===void 0?t===16&&n===16?ke:void 0:e}function O({className:e,children:t,viewBox:n=`0 0 24 24`,width:r=16,height:i=16,...a}){return(0,D.jsx)(`svg`,{viewBox:n,width:r,height:i,className:Ae(e,r,i),fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...a,children:t})}function je({className:e,children:t,viewBox:n=`0 0 24 24`,width:r=16,height:i=16,...a}){return(0,D.jsx)(`svg`,{viewBox:n,width:r,height:i,className:Ae(e,r,i),fill:`currentColor`,"aria-hidden":!0,...a,children:t})}function Me({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M18 6 6 18`}),(0,D.jsx)(`path`,{d:`m6 6 12 12`})]})}function Ne({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M5 12h14`}),(0,D.jsx)(`path`,{d:`M12 5v14`})]})}function Pe({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1`}),(0,D.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1`}),(0,D.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1`})]})}function Fe({className:e,...t}){return(0,D.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:(0,D.jsx)(`path`,{d:`m9 18 6-6-6-6`})})}function Ie({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M14 17H5`}),(0,D.jsx)(`path`,{d:`M19 7h-9`}),(0,D.jsx)(`circle`,{cx:`17`,cy:`17`,r:`3`}),(0,D.jsx)(`circle`,{cx:`7`,cy:`7`,r:`3`})]})}function Le({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`m21 21-4.34-4.34`}),(0,D.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`})]})}function Re({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1`}),(0,D.jsx)(`path`,{d:`m12 15 5 6H7Z`})]})}function ze({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M4 5h16`}),(0,D.jsx)(`path`,{d:`M4 12h16`}),(0,D.jsx)(`path`,{d:`M4 19h16`})]})}function Be({className:e,...t}){return(0,D.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:(0,D.jsx)(`path`,{d:`m15 18-6-6 6-6`})})}function Ve({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,D.jsx)(`path`,{d:`m10 8 4 4-4 4`})]})}function He({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M12 12h.01`}),(0,D.jsx)(`path`,{d:`M16 12h.01`}),(0,D.jsx)(`path`,{d:`m17 7 5 5-5 5`}),(0,D.jsx)(`path`,{d:`m7 7-5 5 5 5`}),(0,D.jsx)(`path`,{d:`M8 12h.01`})]})}function Ue({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`circle`,{cx:`18`,cy:`18`,r:`3`}),(0,D.jsx)(`circle`,{cx:`6`,cy:`6`,r:`3`}),(0,D.jsx)(`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`}),(0,D.jsx)(`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`})]})}function We({className:e,...t}){return(0,D.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:(0,D.jsx)(`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`})})}function Ge({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,D.jsx)(`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`}),(0,D.jsx)(`path`,{d:`M2 12h20`})]})}function Ke({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}),(0,D.jsx)(`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}),(0,D.jsx)(`path`,{d:`M10 9H8`}),(0,D.jsx)(`path`,{d:`M16 13H8`}),(0,D.jsx)(`path`,{d:`M16 17H8`})]})}function qe({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}),(0,D.jsx)(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`})]})}function Je({className:e,...t}){return(0,D.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:(0,D.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`})})}function Ye({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M15 6a9 9 0 0 0-9 9V3`}),(0,D.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,D.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`})]})}function Xe({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M7 21h10`}),(0,D.jsx)(`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`})]})}function Ze({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M4 11a9 9 0 0 1 9 9`}),(0,D.jsx)(`path`,{d:`M4 4a16 16 0 0 1 16 16`}),(0,D.jsx)(`circle`,{cx:`5`,cy:`19`,r:`1`})]})}function Qe({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M12 17V3`}),(0,D.jsx)(`path`,{d:`m6 11 6 6 6-6`}),(0,D.jsx)(`path`,{d:`M19 21H5`})]})}function $e({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`m18 9-6-6-6 6`}),(0,D.jsx)(`path`,{d:`M12 3v14`}),(0,D.jsx)(`path`,{d:`M5 21h14`})]})}function et({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,D.jsx)(`path`,{d:`M21 3v5h-5`}),(0,D.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,D.jsx)(`path`,{d:`M8 16H3v5`})]})}function tt({className:e,...t}){return(0,D.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:(0,D.jsx)(`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`})})}function nt({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`}),(0,D.jsx)(`circle`,{cx:`12`,cy:`13`,r:`2`}),(0,D.jsx)(`path`,{d:`M12 15v5`})]})}function rt({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M18 19a5 5 0 0 1-5-5v8`}),(0,D.jsx)(`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`}),(0,D.jsx)(`circle`,{cx:`13`,cy:`12`,r:`2`}),(0,D.jsx)(`circle`,{cx:`20`,cy:`19`,r:`2`})]})}function it({className:e,...t}){return(0,D.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:(0,D.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})})}function at({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,D.jsx)(`path`,{d:`M10 15V9`}),(0,D.jsx)(`path`,{d:`M14 15V9`})]})}function ot({className:e,...t}){return(0,D.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:(0,D.jsx)(`circle`,{cx:`12`,cy:`12`,r:`6`})})}function st({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M12 6v12`}),(0,D.jsx)(`path`,{d:`M17.196 9 6.804 15`}),(0,D.jsx)(`path`,{d:`m6.804 9 10.392 6`})]})}function ct({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`m10 10-6.157 6.162a2 2 0 0 0-.5.833l-1.322 4.36a.5.5 0 0 0 .622.624l4.358-1.323a2 2 0 0 0 .83-.5L14 13.982`}),(0,D.jsx)(`path`,{d:`m12.829 7.172 4.359-4.346a1 1 0 1 1 3.986 3.986l-4.353 4.353`}),(0,D.jsx)(`path`,{d:`m2 2 20 20`})]})}function lt({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M9 14 4 9l5-5`}),(0,D.jsx)(`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`})]})}function ut({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M12 13v8`}),(0,D.jsx)(`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`}),(0,D.jsx)(`path`,{d:`m8 17 4-4 4 4`})]})}function dt({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,D.jsx)(`path`,{d:`M12 3v18`})]})}function ft({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}),(0,D.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]})}function pt({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}),(0,D.jsx)(`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}),(0,D.jsx)(`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}),(0,D.jsx)(`path`,{d:`m2 2 20 20`})]})}function mt({className:e,...t}){return(0,D.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e??`h-icon-base w-icon-base`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...t,children:[(0,D.jsx)(`path`,{d:`M12 22v-5`}),(0,D.jsx)(`path`,{d:`M9 8V2`}),(0,D.jsx)(`path`,{d:`M15 8V2`}),(0,D.jsx)(`path`,{d:`M18 8v5a6 6 0 0 1-12 0V8Z`})]})}var ht={close:Me,add:Ne,more:Pe,disclosure:Fe,settings:Ie,search:Le,pin:Re,menu:ze,back:Be,terminal:Ve,diff:He,git:Ue,files:We,folder:We,browser:Ge,doc:Ke,readOnlyProject:qe,unknownKind:Je,branch:Ye,monitor:Xe,connection:Ze,pull:Qe,push:$e,refresh:et,agent:tt,worktreeActive:nt,worktreeInactive:rt,working:it,attention:at,circleSmall:ot,modified:st,readOnlyFile:ct,revert:lt,save:ut,split:dt,eye:ft,eyeOff:pt,plug:mt};function gt(e){return(0,D.jsxs)(O,{...e,children:[(0,D.jsx)(`path`,{d:`m5 12 7-7 7 7`}),(0,D.jsx)(`path`,{d:`M12 19V5`})]})}function _t(e){return(0,D.jsxs)(O,{...e,children:[(0,D.jsx)(`path`,{d:`M12 5v14`}),(0,D.jsx)(`path`,{d:`m19 12-7 7-7-7`})]})}function vt(e){return(0,D.jsxs)(O,{...e,children:[(0,D.jsx)(`path`,{d:`m12 19-7-7 7-7`}),(0,D.jsx)(`path`,{d:`M19 12H5`})]})}function yt(e){return(0,D.jsxs)(O,{...e,children:[(0,D.jsx)(`path`,{d:`M5 12h14`}),(0,D.jsx)(`path`,{d:`m12 5 7 7-7 7`})]})}function bt(e){return(0,D.jsx)(O,{viewBox:`0 0 16 16`,...e,children:(0,D.jsx)(`path`,{d:`M4 10l4-4 4 4`})})}function xt(e){return(0,D.jsx)(O,{viewBox:`0 0 16 16`,...e,children:(0,D.jsx)(`path`,{d:`M4 6l4 4 4-4`})})}function St(e){return(0,D.jsx)(O,{viewBox:`0 0 16 16`,...e,children:(0,D.jsx)(`path`,{d:`M6 4l4 4-4 4`})})}function Ct(e){return(0,D.jsxs)(O,{...e,children:[(0,D.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,D.jsx)(`path`,{d:`M8 12h8`}),(0,D.jsx)(`path`,{d:`M12 8v8`})]})}function wt(e){return(0,D.jsxs)(O,{...e,children:[(0,D.jsx)(`path`,{d:`m9 10-5 5 5 5`}),(0,D.jsx)(`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`})]})}function Tt(e){return(0,D.jsxs)(O,{...e,children:[(0,D.jsx)(`path`,{d:`M10 8h.01`}),(0,D.jsx)(`path`,{d:`M12 12h.01`}),(0,D.jsx)(`path`,{d:`M14 8h.01`}),(0,D.jsx)(`path`,{d:`M16 12h.01`}),(0,D.jsx)(`path`,{d:`M18 8h.01`}),(0,D.jsx)(`path`,{d:`M6 8h.01`}),(0,D.jsx)(`path`,{d:`M7 16h10`}),(0,D.jsx)(`path`,{d:`M8 12h.01`}),(0,D.jsx)(`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`})]})}function Et(e){return(0,D.jsxs)(O,{viewBox:`0 0 20 20`,...e,children:[(0,D.jsx)(`path`,{d:`M3 7.5h2.5l1.5-2h6l1.5 2H17v8.5H3z`}),(0,D.jsx)(`circle`,{cx:`10`,cy:`11.5`,r:`3`})]})}function Dt(e){return(0,D.jsxs)(O,{viewBox:`0 0 20 20`,...e,children:[(0,D.jsx)(`rect`,{x:`3`,y:`4`,width:`14`,height:`11`,rx:`1.5`}),(0,D.jsx)(`path`,{d:`m6 12 2.2-2.2 2 2 1.3-1.3L15 14`}),(0,D.jsx)(`circle`,{cx:`12.5`,cy:`7.5`,r:`.8`})]})}function Ot(e){return(0,D.jsxs)(O,{...e,children:[(0,D.jsx)(`path`,{d:`M8 6L4 10l4 4`}),(0,D.jsx)(`path`,{d:`M4 10h10a4 4 0 0 1 4 4v4`})]})}function kt(e){return(0,D.jsxs)(O,{...e,children:[(0,D.jsx)(`path`,{d:`M16 6l4 4-4 4`}),(0,D.jsx)(`path`,{d:`M20 10H10a4 4 0 0 0-4 4v4`})]})}function At(e){return(0,D.jsx)(O,{viewBox:`0 0 16 16`,...e,children:(0,D.jsx)(`path`,{d:`M8 3a5 5 0 1 1-4.2 2.3`})})}function jt(e){return(0,D.jsx)(O,{viewBox:`0 0 24 24`,...e,children:(0,D.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8`,stroke:`currentColor`,strokeDasharray:`20 30`})})}function Mt(e){return(0,D.jsxs)(je,{viewBox:`0 0 16 16`,...e,children:[(0,D.jsx)(`path`,{d:`M12.8266 13.112C12.1639 13.112 11.6319 12.916 11.2306 12.524C10.8386 12.132 10.6426 11.614 10.6426 10.97V7.94595C10.6426 7.31129 10.8432 6.79795 11.2446 6.40595C11.6459 6.00462 12.1732 5.80396 12.8266 5.80396C13.2652 5.80396 13.6526 5.89262 13.9886 6.06995C14.3246 6.24729 14.5812 6.48529 14.7586 6.78395C14.9452 7.07329 15.0386 7.39529 15.0386 7.74996V7.88995C15.0386 7.98329 14.9919 8.02995 14.8986 8.02995L14.1846 8.05795C14.0912 8.05795 14.0446 8.01129 14.0446 7.91796V7.81995C14.0446 7.51195 13.9279 7.24595 13.6946 7.02195C13.4706 6.78862 13.1812 6.67196 12.8266 6.67196C12.4719 6.67196 12.1826 6.79796 11.9586 7.04996C11.7439 7.29262 11.6366 7.61462 11.6366 8.01595V10.9C11.6366 11.3013 11.7439 11.628 11.9586 11.88C12.1826 12.1226 12.4719 12.244 12.8266 12.244C13.1812 12.244 13.4706 12.132 13.6946 11.908C13.9279 11.6746 14.0446 11.404 14.0446 11.096V10.998C14.0446 10.9046 14.0912 10.858 14.1846 10.858L14.8986 10.872C14.9919 10.872 15.0386 10.9186 15.0386 11.012V11.166C15.0386 11.726 14.8332 12.1926 14.4226 12.566C14.0212 12.93 13.4892 13.112 12.8266 13.112Z`}),(0,D.jsx)(`path`,{d:`M7.68824 13.0699C7.04424 13.0699 6.52624 12.9066 6.13424 12.5799C5.75158 12.2439 5.56024 11.8006 5.56024 11.2499V11.1519C5.56024 11.0586 5.60691 11.0119 5.70024 11.0119H6.37224C6.46558 11.0119 6.51224 11.0586 6.51224 11.1519V11.2359C6.51224 11.5346 6.61958 11.7866 6.83424 11.9919C7.05824 12.1973 7.34757 12.2999 7.70224 12.2999C8.03824 12.2999 8.30891 12.1973 8.51424 11.9919C8.71958 11.7866 8.82224 11.5253 8.82224 11.2079C8.82224 10.9653 8.75691 10.7646 8.62624 10.6059C8.49558 10.4379 8.34158 10.3073 8.16424 10.2139C7.99624 10.1206 7.73958 9.99928 7.39424 9.84995C7.03024 9.70061 6.72691 9.55595 6.48424 9.41595C6.25091 9.26661 6.04558 9.06128 5.86824 8.79995C5.70024 8.52928 5.61624 8.18861 5.61624 7.77795C5.61624 7.18061 5.79824 6.70928 6.16224 6.36395C6.53558 6.01861 7.03491 5.84595 7.66024 5.84595C8.29491 5.84595 8.79891 6.02328 9.17224 6.37795C9.54558 6.73261 9.73224 7.20395 9.73224 7.79195V7.83395C9.73224 7.92728 9.68558 7.97395 9.59224 7.97395H8.94824C8.85491 7.97395 8.80824 7.92728 8.80824 7.83395V7.74995C8.80824 7.43261 8.70091 7.17128 8.48624 6.96595C8.28091 6.76061 8.01024 6.65795 7.67424 6.65795C7.33824 6.65795 7.06758 6.76528 6.86224 6.97995C6.66624 7.18528 6.56824 7.44195 6.56824 7.74995C6.56824 7.97395 6.62891 8.16528 6.75024 8.32395C6.87158 8.47328 7.02091 8.59928 7.19824 8.70195C7.37557 8.79528 7.62291 8.91195 7.94024 9.05195C8.32291 9.21995 8.63558 9.37861 8.87824 9.52795C9.13024 9.67728 9.34958 9.88728 9.53624 10.1579C9.72291 10.4286 9.81624 10.7646 9.81624 11.1659C9.81624 11.7446 9.62491 12.2066 9.24224 12.5519C8.85958 12.8973 8.34157 13.0699 7.68824 13.0699Z`}),(0,D.jsx)(`path`,{d:`M4.946 3.92795C4.946 4.02129 4.89933 4.06795 4.806 4.06795H1.558C1.52066 4.06795 1.502 4.08662 1.502 4.12395V7.59595C1.502 7.63328 1.52066 7.65195 1.558 7.65195H3.602C3.69533 7.65195 3.742 7.69862 3.742 7.79195V8.39395C3.742 8.48729 3.69533 8.53395 3.602 8.53395H1.558C1.52066 8.53395 1.502 8.55262 1.502 8.58995V12.076C1.502 12.1133 1.52066 12.132 1.558 12.132H4.806C4.89933 12.132 4.946 12.1786 4.946 12.272V12.86C4.946 12.9533 4.89933 13 4.806 13H0.647996C0.554662 13 0.507996 12.9533 0.507996 12.86V3.33995C0.507996 3.24662 0.554662 3.19995 0.647996 3.19995H4.806C4.89933 3.19995 4.946 3.24662 4.946 3.33995V3.92795Z`})]})}function Nt(e){return(0,D.jsxs)(je,{viewBox:`0 0 16 16`,...e,children:[(0,D.jsx)(`path`,{d:`M13.1244 5.80395C13.7124 5.80395 14.1837 5.99995 14.5384 6.39195C14.9024 6.77462 15.0844 7.29262 15.0844 7.94595V10.97C15.0844 11.6046 14.907 12.1226 14.5524 12.524C14.1977 12.916 13.7217 13.112 13.1244 13.112C12.8724 13.112 12.6297 13.0653 12.3964 12.972C12.163 12.8693 11.9577 12.72 11.7804 12.524C11.7617 12.5053 11.743 12.5006 11.7244 12.51C11.715 12.5193 11.7104 12.5333 11.7104 12.552V12.86C11.7104 12.9533 11.6637 13 11.5704 13H10.8564C10.763 13 10.7164 12.9533 10.7164 12.86V3.33995C10.7164 3.24662 10.763 3.19995 10.8564 3.19995H11.5704C11.6637 3.19995 11.7104 3.24662 11.7104 3.33995V6.36395C11.7104 6.38262 11.7197 6.39662 11.7384 6.40595C11.757 6.41528 11.7757 6.40595 11.7944 6.37795C11.9624 6.19128 12.163 6.05128 12.3964 5.95795C12.6297 5.85529 12.8724 5.80395 13.1244 5.80395ZM14.0904 8.01595C14.0904 7.61462 13.9784 7.29262 13.7544 7.04995C13.5304 6.79795 13.2364 6.67195 12.8724 6.67195C12.527 6.67195 12.247 6.79795 12.0324 7.04995C11.8177 7.29262 11.7104 7.61462 11.7104 8.01595V10.914C11.7104 11.306 11.8177 11.628 12.0324 11.88C12.247 12.1226 12.527 12.244 12.8724 12.244C13.2364 12.244 13.5304 12.1226 13.7544 11.88C13.9784 11.628 14.0904 11.306 14.0904 10.914V8.01595Z`}),(0,D.jsx)(`path`,{d:`M7.42514 5.80396C8.07848 5.80396 8.60114 6.01862 8.99314 6.44795C9.38514 6.86795 9.58114 7.43262 9.58114 8.14196V12.86C9.58114 12.9533 9.53448 13 9.44114 13H8.72714C8.63381 13 8.58714 12.9533 8.58714 12.86V12.44C8.58714 12.4213 8.57781 12.412 8.55914 12.412C8.54981 12.4026 8.53581 12.4073 8.51714 12.426C8.17181 12.8833 7.65381 13.112 6.96314 13.112C6.44981 13.112 6.00181 12.9673 5.61914 12.678C5.24581 12.3793 5.05914 11.8566 5.05914 11.11C5.05914 10.3166 5.28781 9.73795 5.74514 9.37395C6.20248 9.00062 6.80448 8.81395 7.55114 8.81395H8.53114C8.56848 8.81395 8.58714 8.79529 8.58714 8.75796V8.21196C8.58714 7.74529 8.47981 7.37196 8.26514 7.09196C8.05048 6.81196 7.76114 6.67196 7.39714 6.67196C7.11714 6.67196 6.87448 6.76529 6.66914 6.95195C6.47314 7.13862 6.35648 7.37662 6.31914 7.66595C6.31914 7.75929 6.27248 7.80595 6.17914 7.80595L5.39514 7.79195C5.34848 7.79195 5.31114 7.77796 5.28314 7.74996C5.26448 7.72196 5.25981 7.68929 5.26914 7.65195C5.31581 7.10129 5.53981 6.65795 5.94114 6.32195C6.34248 5.97662 6.83714 5.80396 7.42514 5.80396ZM7.17314 12.244C7.55581 12.244 7.88714 12.1226 8.16714 11.88C8.44714 11.628 8.58714 11.2826 8.58714 10.844V9.66796C8.58714 9.63062 8.56848 9.61195 8.53114 9.61195H7.53714C7.08914 9.61195 6.73448 9.73329 6.47314 9.97596C6.21181 10.2093 6.08114 10.5593 6.08114 11.026C6.08114 11.4366 6.17914 11.7446 6.37514 11.95C6.58048 12.146 6.84648 12.244 7.17314 12.244Z`}),(0,D.jsx)(`path`,{d:`M5.30601 3.19995C5.39935 3.19995 5.44601 3.24662 5.44601 3.33995V3.92795C5.44601 4.02129 5.39935 4.06795 5.30601 4.06795H3.45801C3.42068 4.06795 3.40201 4.08662 3.40201 4.12395V12.86C3.40201 12.9533 3.35535 13 3.26201 13H2.54801C2.45468 13 2.40801 12.9533 2.40801 12.86V4.12395C2.40801 4.08662 2.38935 4.06795 2.35201 4.06795H0.616013C0.52268 4.06795 0.476013 4.02129 0.476013 3.92795V3.33995C0.476013 3.24662 0.52268 3.19995 0.616013 3.19995H5.30601Z`})]})}function Pt(e){return(0,D.jsxs)(je,{viewBox:`0 0 16 16`,...e,children:[(0,D.jsx)(`path`,{d:`M13.2984 13C13.2051 13 13.1584 12.9533 13.1584 12.86V3.33995C13.1584 3.24662 13.2051 3.19995 13.2984 3.19995H14.0124C14.1057 3.19995 14.1524 3.24662 14.1524 3.33995V12.86C14.1524 12.9533 14.1057 13 14.0124 13H13.2984Z`}),(0,D.jsx)(`path`,{d:`M12.1085 5.84595C12.3418 5.84595 12.5425 5.89728 12.7105 5.99995C12.7758 6.03728 12.7991 6.09795 12.7805 6.18195L12.6125 6.90995C12.6031 6.99395 12.5471 7.02195 12.4445 6.99395C12.3325 6.93795 12.1925 6.90995 12.0245 6.90995C11.9498 6.90995 11.8938 6.91461 11.8565 6.92395C11.5205 6.94261 11.2451 7.11995 11.0305 7.45595C10.8158 7.78261 10.7085 8.18395 10.7085 8.65995V12.8599C10.7085 12.9533 10.6618 12.9999 10.5685 12.9999H9.85448C9.76114 12.9999 9.71448 12.9533 9.71448 12.8599V6.05595C9.71448 5.96261 9.76114 5.91595 9.85448 5.91595H10.5685C10.6618 5.91595 10.7085 5.96261 10.7085 6.05595V6.89595C10.7085 6.92395 10.7131 6.93795 10.7225 6.93795C10.7411 6.93795 10.7598 6.92861 10.7785 6.90995C11.0491 6.20061 11.4925 5.84595 12.1085 5.84595Z`}),(0,D.jsx)(`path`,{d:`M9.03406 6.51798C9.03406 6.61131 8.9874 6.65798 8.89406 6.65798H7.83006C7.79273 6.65798 7.77406 6.67664 7.77406 6.71398V10.998C7.77406 11.4273 7.84873 11.726 7.99806 11.894C8.1474 12.0526 8.37606 12.1273 8.68406 12.118H8.82406C8.9174 12.118 8.96406 12.1646 8.96406 12.258V12.86C8.96406 12.9533 8.9174 13 8.82406 13H8.47406C7.9234 13 7.5034 12.8833 7.21406 12.65C6.93406 12.4073 6.79406 11.9546 6.79406 11.292V6.71398C6.79406 6.67664 6.7754 6.65798 6.73806 6.65798H6.19206C6.09873 6.65798 6.05206 6.61131 6.05206 6.51798V6.05598C6.05206 5.96264 6.09873 5.91598 6.19206 5.91598H6.73806C6.7754 5.91598 6.79406 5.89731 6.79406 5.85998V4.29198C6.79406 4.19864 6.84073 4.15198 6.93406 4.15198H7.63406C7.7274 4.15198 7.77406 4.19864 7.77406 4.29198V5.85998C7.77406 5.89731 7.79273 5.91598 7.83006 5.91598H8.89406C8.9874 5.91598 9.03406 5.96264 9.03406 6.05598V6.51798Z`}),(0,D.jsx)(`path`,{d:`M3.15002 13.112C2.43135 13.112 1.85269 12.8927 1.41402 12.454C0.984686 12.0153 0.77002 11.4273 0.77002 10.69V5.49601C0.77002 4.76801 0.984686 4.18468 1.41402 3.74601C1.85269 3.30735 2.43135 3.08801 3.15002 3.08801C3.87802 3.08801 4.45669 3.30735 4.88602 3.74601C5.32469 4.17535 5.54402 4.75868 5.54402 5.49601V5.73401C5.54402 5.82735 5.49735 5.87401 5.40402 5.87401L4.67602 5.91601C4.58269 5.91601 4.53602 5.86935 4.53602 5.77601V5.42601C4.53602 4.98735 4.41002 4.63268 4.15802 4.36201C3.90602 4.09135 3.57002 3.95601 3.15002 3.95601C2.73935 3.95601 2.40335 4.09135 2.14202 4.36201C1.89002 4.63268 1.76402 4.98735 1.76402 5.42601V10.774C1.76402 11.2127 1.89002 11.5673 2.14202 11.838C2.40335 12.1087 2.73935 12.244 3.15002 12.244C3.57002 12.244 3.90602 12.1087 4.15802 11.838C4.41002 11.5673 4.53602 11.2127 4.53602 10.774V10.424C4.53602 10.3307 4.58269 10.284 4.67602 10.284L5.40402 10.326C5.49735 10.326 5.54402 10.3727 5.54402 10.466V10.69C5.54402 11.4273 5.32469 12.0153 4.88602 12.454C4.44735 12.8927 3.86869 13.112 3.15002 13.112Z`})]})}var Ft={...ht,arrowDown:_t,arrowLeft:vt,arrowRight:yt,arrowUp:gt,camera:Et,chevronDown:xt,chevronRight:St,chevronUp:bt,circlePlus:Ct,cornerDownLeft:wt,historyLoading:At,imageLibrary:Dt,keyboard:Tt,keyCtrl:Pt,keyEsc:Mt,keyTab:Nt,redo:kt,spinner:jt,undo:Ot},It=`inline-flex items-center justify-center gap-1.5 rounded-control border font-normal leading-[1.4] transition-colors disabled:cursor-not-allowed disabled:opacity-50`,Lt={xs:`px-2 py-0.5 text-xs`,sm:`px-2.5 py-1 text-sm`},Rt={submit:`border-transparent bg-accent text-bg-primary font-medium hover:bg-accent/90`,destroy:`border-transparent bg-danger text-bg-primary font-medium hover:bg-danger/90`,normal:`border-transparent bg-button-secondary-bg text-text-primary hover:bg-button-secondary-hover-bg`,dismiss:`border-transparent bg-transparent text-text-secondary hover:bg-row-hover-bg hover:text-text-primary`};function zt({kind:e=`normal`,size:t=`sm`,className:n,children:r,...i}){return(0,D.jsx)(`button`,{className:`${It} ${Lt[t]} ${Rt[e]}${n?` ${n}`:``}`,...i,children:r})}var Bt={err:`bg-danger`,warn:`bg-warning`,info:`bg-accent`},Vt={err:`text-danger`,warn:`text-warning`,info:`text-accent`},Ht={err:`FAILED`,warn:`NEEDS ATTENTION`,info:`PAUSED`};function Ut({tone:e,tag:t,title:n,body:r,primary:i,secondary:a,ternary:o,className:s}){let c=t??Ht[e];return(0,D.jsxs)(`div`,{className:`flex w-surface-sm max-w-full flex-col overflow-hidden rounded-window border border-border bg-bg-secondary shadow-lg${s?` ${s}`:``}`,children:[(0,D.jsx)(`div`,{"aria-hidden":!0,className:`h-1 shrink-0 ${Bt[e]}`}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 py-3.5`,children:[(0,D.jsx)(`span`,{className:`cm-mono self-start text-xs font-bold uppercase tracking-[0.08em] ${Vt[e]}`,children:c}),(0,D.jsx)(`div`,{className:`text-sm font-semibold tracking-[-0.005em] text-text-primary`,children:n}),(0,D.jsx)(`div`,{className:`text-sm leading-[1.55] text-text-secondary`,children:r}),(i||a||o)&&(0,D.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:[i&&(0,D.jsx)(zt,{kind:i.kind??`submit`,size:`sm`,onClick:i.onClick,children:i.label}),a&&(0,D.jsx)(zt,{kind:a.kind??`normal`,size:`sm`,onClick:a.onClick,children:a.label}),o&&(0,D.jsx)(zt,{kind:o.kind??`dismiss`,size:`sm`,onClick:o.onClick,children:o.label})]})]})]})}var k=c(u(),1),Wt=`parasor:auth-expired`,Gt=class extends Error{constructor(){super(`parasor session expired`),this.name=`AuthExpiredError`}},Kt=!1,A=0;function qt(e,t){try{e?.(t)}catch{}}function Jt(){return`auth-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function Yt(){return{snapshot:()=>({}),cleanup:()=>{}}}function Xt(){return typeof window>`u`?{}:{visibilityState:document.visibilityState,hidden:document.hidden,online:navigator.onLine}}function Zt(){if(typeof window>`u`)return Yt();let e={visibilityChanges:0,pageHideCount:0,pageShowCount:0,focusCount:0,onlineCount:0,offlineCount:0},t=()=>{e.visibilityChanges+=1},n=()=>{e.pageHideCount+=1},r=()=>{e.pageShowCount+=1},i=()=>{e.focusCount+=1},a=()=>{e.onlineCount+=1},o=()=>{e.offlineCount+=1};return document.addEventListener(`visibilitychange`,t),window.addEventListener(`pagehide`,n),window.addEventListener(`pageshow`,r),window.addEventListener(`focus`,i),window.addEventListener(`online`,a),window.addEventListener(`offline`,o),{snapshot:()=>({...e}),cleanup:()=>{document.removeEventListener(`visibilitychange`,t),window.removeEventListener(`pagehide`,n),window.removeEventListener(`pageshow`,r),window.removeEventListener(`focus`,i),window.removeEventListener(`online`,a),window.removeEventListener(`offline`,o)}}}function Qt(){A=0,!Kt&&(Kt=!0,typeof window<`u`&&window.dispatchEvent(new Event(Wt)))}async function $t(e,t){let n=await fetch(e,t);if(n.status===401)throw A=0,Qt(),new Gt;return n}async function en(e={}){let t=e.dispatchOn401??!0,n=e.trace;if(e.reuseRecentSuccess&&A>0&&Date.now()-A<3e4)return!0;let r=n?Jt():void 0,i=performance.now(),a=Date.now(),o=n?Zt():Yt();r&&qt(n,{phase:`start`,traceId:r,source:e.source,startedAtWallMs:a,...Xt()});let s;try{s=await fetch(`/api/auth/verify`,{cache:`no-store`,credentials:`same-origin`,...r?{headers:{"x-parasor-auth-trace-id":r}}:{}})}catch(t){if(r){let s=Date.now();qt(n,{phase:`error`,traceId:r,source:e.source,startedAtWallMs:a,endedAtWallMs:s,durationMs:performance.now()-i,wallMs:s-a,errorName:t instanceof Error?t.name:typeof t,errorMessage:t instanceof Error?t.message:String(t),...Xt(),...o.snapshot()})}return o.cleanup(),!0}if(r){let t=Date.now();qt(n,{phase:`complete`,traceId:r,source:e.source,httpStatus:s.status,ok:s.ok,startedAtWallMs:a,endedAtWallMs:t,durationMs:performance.now()-i,wallMs:t-a,...Xt(),...o.snapshot()})}return o.cleanup(),s.status===401?(A=0,t&&Qt(),!1):s.status>=500?!0:(s.ok&&(A=Date.now()),s.ok)}var tn=`parasor-font-face-`,nn=new Set;async function rn({family:e,url:t,format:n=`truetype`}){if(nn.has(e))return;if(typeof FontFace==`function`&&document.fonts){let r=new FontFace(e,`url("${t}") format("${n}")`);try{await r.load()}catch(n){throw Error(`Failed to load font "${e}" from ${t}: ${n.message}`)}document.fonts.add(r),nn.add(e);return}let r=document.createElement(`style`);r.id=`${tn}${e}`,r.textContent=`@font-face{font-family:"${e}";src:url("${t}") format("${n}");font-display:swap;}`,document.head.appendChild(r),nn.add(e)}var an=`"SF Mono", ui-monospace, Menlo, Consolas, "Symbols Nerd Font", "Noto Sans Mono CJK JP", monospace`,on=`system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,sn=/^[a-zA-Z_][a-zA-Z0-9_-]*$/,cn=new Set([`serif`,`sans-serif`,`monospace`,`-apple-system`,`cursive`,`fantasy`,`system-ui`,`ui-serif`,`ui-sans-serif`,`ui-monospace`,`ui-rounded`,`math`,`emoji`,`fangsong`,`inherit`,`initial`,`unset`,`revert`,`revert-layer`]);function ln(e){let t=e.trim();return t.length===0||t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)||cn.has(t)||sn.test(t)?t:`"${t.replace(/"/g,``)}"`}function un(e,t=an){let n=e.trim();if(n.length===0)return t;let r=n.split(`,`).map(e=>ln(e)).filter(e=>e.length>0);return r.length===0?t:`${r.join(`, `)}, ${t}`}var dn=`// This theme's colors are based on the original Monokai:
|
|
2
2
|
// #1e1f1c (tab well, borders)
|
|
3
3
|
// #272822 (editor background)
|
|
4
4
|
// #414339 (selection)
|
|
@@ -487,7 +487,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
487
487
|
],
|
|
488
488
|
"semanticHighlighting": true
|
|
489
489
|
}
|
|
490
|
-
`,
|
|
490
|
+
`,fn=`{
|
|
491
491
|
"name": "parasor Dark",
|
|
492
492
|
"type": "dark",
|
|
493
493
|
"colors": {
|
|
@@ -541,7 +541,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
541
541
|
"scmGraph.historyItemRefColor": "#00aaaa"
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
`,
|
|
544
|
+
`,pn=`{
|
|
545
545
|
"name": "parasor Light",
|
|
546
546
|
"type": "light",
|
|
547
547
|
"colors": {
|
|
@@ -595,7 +595,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
595
595
|
"scmGraph.historyItemRefColor": "#00aaaa"
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
|
-
`,
|
|
598
|
+
`,mn=`{
|
|
599
599
|
"name": "Solarized Light",
|
|
600
600
|
"tokenColors": [
|
|
601
601
|
{
|
|
@@ -1074,7 +1074,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
1074
1074
|
},
|
|
1075
1075
|
"semanticHighlighting": true
|
|
1076
1076
|
}
|
|
1077
|
-
`,
|
|
1077
|
+
`,hn=`{
|
|
1078
1078
|
"name": "Tokyo Night",
|
|
1079
1079
|
"author": "Enkia",
|
|
1080
1080
|
"maintainers": ["Enkia <enki77@gmail.com>"],
|
|
@@ -2677,7 +2677,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
2677
2677
|
}
|
|
2678
2678
|
]
|
|
2679
2679
|
}
|
|
2680
|
-
`,
|
|
2680
|
+
`,gn=`{
|
|
2681
2681
|
"name": "VSCode Default Dark (baseline)",
|
|
2682
2682
|
"type": "dark",
|
|
2683
2683
|
"colors": {
|
|
@@ -2737,7 +2737,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
2737
2737
|
"scmGraph.historyItemRefColor": "#59A4F9"
|
|
2738
2738
|
}
|
|
2739
2739
|
}
|
|
2740
|
-
`,
|
|
2740
|
+
`,_n=`{
|
|
2741
2741
|
"name": "VSCode Default Light (baseline)",
|
|
2742
2742
|
"type": "light",
|
|
2743
2743
|
"colors": {
|
|
@@ -2797,7 +2797,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
2797
2797
|
"scmGraph.historyItemRefColor": "#0063D3"
|
|
2798
2798
|
}
|
|
2799
2799
|
}
|
|
2800
|
-
`,
|
|
2800
|
+
`,vn=[{target:`tab.activeBackground`,source:`editor.background`},{target:`terminal.background`,source:`editor.background`},{target:`terminal.selectionBackground`,source:`editor.selectionBackground`},{target:`terminalCursor.foreground`,source:`terminal.foreground`},{target:`terminalCursor.background`,source:`terminal.background`},{target:`sideBar.foreground`,source:`editor.foreground`},{target:`descriptionForeground`,source:`editor.foreground`,alpha:.7},{target:`editorWidget.border`,source:`editor.foreground`,alpha:.2},{target:`button.secondaryBackground`,source:`list.hoverBackground`}],j=class extends Error{constructor(e){super(e),this.name=`ThemeValidationError`}};function yn(e){let t=``,n=0,r=e.length;for(;n<r;){let i=e[n],a=e[n+1];if(i===`"`){for(t+=i,n++;n<r;){let i=e[n];if(t+=i,i===`\\`&&n+1<r){t+=e[n+1],n+=2;continue}if(n++,i===`"`)break}continue}if(i===`/`&&a===`/`){for(;n<r&&e[n]!==`
|
|
2801
2801
|
`;)n++;continue}if(i===`/`&&a===`*`){for(n+=2;n<r&&!(e[n]===`*`&&e[n+1]===`/`);)e[n]===`
|
|
2802
2802
|
`&&(t+=`
|
|
2803
|
-
`),n++;n+=2;continue}t+=i,n++}return t}function Dt(e){let t=``,n=0,r=e.length;for(;n<r;){let i=e[n];if(i===`"`){for(t+=i,n++;n<r;){let i=e[n];if(t+=i,i===`\\`&&n+1<r){t+=e[n+1],n+=2;continue}if(n++,i===`"`)break}continue}if(i===`,`){let t=n+1;for(;t<r&&/\s/.test(e[t]);)t++;if(t<r&&(e[t]===`}`||e[t]===`]`)){n++;continue}}t+=i,n++}return t}function I(e){let t;try{t=JSON.parse(Dt(Et(e)))}catch(e){throw new F(`Invalid JSON: ${e.message}`)}if(!t||typeof t!=`object`)throw new F(`Theme JSON must be an object`);let n=t;if(!n.colors||typeof n.colors!=`object`)throw new F("Theme JSON must have a `colors` object");let r=n.colors,i={};for(let[e,t]of Object.entries(r))typeof t==`string`&&(i[e]=t);let a=n.type;if(a!==void 0&&a!==`dark`&&a!==`light`&&a!==`hc`&&a!==`hcLight`)throw new F(`Theme \`type\` must be "dark" | "light" | "hc" | "hcLight" (got ${JSON.stringify(a)})`);return{name:typeof n.name==`string`?n.name:``,type:a,colors:i}}function Ot(e){return e.type===`light`||e.type===`hcLight`?`light`:e.type===`dark`||e.type===`hc`||kt(e.colors[`editor.background`]??`#000000`)?`dark`:`light`}function kt(e){let t=At(e);return t?(t.r*299+t.g*587+t.b*114)/1e3<128:!0}function At(e){let t=/^#([0-9a-fA-F]{6,8})$/.exec(e);if(!t)return null;let n=t[1];return{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16)}}function jt(e,t){let n=/^#([0-9a-fA-F]{6})([0-9a-fA-F]{2})$/.exec(e);if(n){let e=parseInt(n[2],16)/255,r=Math.round(Math.max(0,Math.min(1,e*t))*255);return`#${n[1]}${r.toString(16).padStart(2,`0`)}`}return/^#[0-9a-fA-F]{6}$/.test(e)?`${e}${Math.round(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,`0`)}`:e}var Mt=I(Ct),Nt=I(wt);function Pt(e){let t={...(Ot(e)===`dark`?Mt:Nt).colors,...e.colors};for(let e=0;e<8;e++){let e=!1;for(let n of Tt){if(t[n.target])continue;let r=t[n.source];r&&(t[n.target]=n.alpha==null?r:jt(r,n.alpha),e=!0)}if(!e)break}return{...e,colors:t}}function Ft(e){let t=e.colors,n=Ot(e);return{"--theme-editor-bg":t[`editor.background`],"--theme-editor-fg":t[`editor.foreground`],"--theme-sidebar-bg":t[`sideBar.background`],"--theme-sidebar-fg":t[`sideBar.foreground`],"--theme-terminal-bg":t[`terminal.background`],"--theme-description-fg":t.descriptionForeground,"--theme-border":t[`panel.border`],"--theme-link-fg":t[`textLink.foreground`],"--theme-list-active-bg":t[`list.activeSelectionBackground`],"--theme-list-inactive-bg":t[`list.inactiveSelectionBackground`],"--theme-list-active-fg":t[`list.activeSelectionForeground`],"--theme-list-hover-bg":t[`list.hoverBackground`],"--theme-button-secondary-bg":t[`button.secondaryBackground`],"--theme-button-secondary-hover-bg":t[`button.secondaryHoverBackground`],"--theme-tab-active-bg":t[`tab.activeBackground`],"--theme-tab-inactive-bg":t[`tab.inactiveBackground`],"--theme-tab-strip-bg":t[`editorGroupHeader.tabsBackground`],"--theme-git-added":t[`gitDecoration.addedResourceForeground`],"--theme-git-modified":t[`gitDecoration.modifiedResourceForeground`],"--theme-git-deleted":t[`gitDecoration.deletedResourceForeground`],"--theme-warning":t[`list.warningForeground`]??t[`editorWarning.foreground`]??t[`inputValidation.warningBorder`]??t[`notificationsWarningIcon.foreground`]??(n===`light`?`#855f00`:`#d7ba7d`),"--theme-diff-added-bg":t[`diffEditor.insertedLineBackground`]??t[`diffEditor.insertedTextBackground`]??(n===`light`?`#e3ffef`:`#243733`),"--theme-diff-deleted-bg":t[`diffEditor.removedLineBackground`]??t[`diffEditor.removedTextBackground`]??(n===`light`?`#ffe6ed`:`#3f282d`),"--theme-graph-branch-1":t[`scmGraph.foreground1`],"--theme-graph-branch-2":t[`scmGraph.foreground2`],"--theme-graph-branch-3":t[`scmGraph.foreground3`],"--theme-graph-branch-4":t[`scmGraph.foreground4`],"--theme-graph-branch-5":t[`scmGraph.foreground5`],"--theme-graph-ref-base":t[`scmGraph.historyItemRefColor`]}}function It(e){let t=e.colors;return{background:t[`terminal.background`],foreground:t[`terminal.foreground`],cursor:t[`terminalCursor.foreground`],cursorAccent:t[`terminalCursor.background`],selectionBackground:t[`terminal.selectionBackground`],black:t[`terminal.ansiBlack`],red:t[`terminal.ansiRed`],green:t[`terminal.ansiGreen`],yellow:t[`terminal.ansiYellow`],blue:t[`terminal.ansiBlue`],magenta:t[`terminal.ansiMagenta`],cyan:t[`terminal.ansiCyan`],white:t[`terminal.ansiWhite`],brightBlack:t[`terminal.ansiBrightBlack`],brightRed:t[`terminal.ansiBrightRed`],brightGreen:t[`terminal.ansiBrightGreen`],brightYellow:t[`terminal.ansiBrightYellow`],brightBlue:t[`terminal.ansiBrightBlue`],brightMagenta:t[`terminal.ansiBrightMagenta`],brightCyan:t[`terminal.ansiBrightCyan`],brightWhite:t[`terminal.ansiBrightWhite`]}}function Lt(e,t,n){let r=Pt(t);return{id:e,name:t.name,mode:Ot(t),source:n,tokens:Ft(r),terminal:It(r)}}function L(e,t){return Lt(e,I(t),`builtin`)}var R=[L(`parasor-dark`,yt),L(`parasor-light`,bt),L(`tokyo-night`,St),L(`solarized-light`,xt),L(`monokai`,vt)],Rt=R[0].id,zt=Object.keys(R[0].tokens),z=[{id:`jetbrains-mono`,name:`JetBrains Mono`,category:`latin`,family:`JetBrains Mono`,zipSizeMb:5,description:`Popular coding font with ligatures.`},{id:`fira-code`,name:`Fira Code`,category:`latin`,family:`Fira Code`,zipSizeMb:3,description:`Monospace font with programming ligatures.`},{id:`udev-gothic`,name:`UDEV Gothic`,category:`asian`,family:`UDEV Gothic`,zipSizeMb:59,description:`JetBrains Mono + BIZ UDGothic. Japanese, 2:1 CJK alignment.`},{id:`d2-coding`,name:`D2 Coding`,category:`asian`,family:`D2 Coding`,zipSizeMb:20,description:`Naver D2 Coding. Korean coding font with Hangul support.`},{id:`maple-mono-cn`,name:`Maple Mono CN`,category:`asian`,family:`Maple Mono CN`,zipSizeMb:134,description:`Maple Mono with Simplified Chinese coverage.`}];function Bt(e){return z.find(t=>t.id===e)}async function Vt(){try{let e=await st(`/api/fonts/catalog`,{credentials:`same-origin`});if(!e.ok)return z.map(Ht);let t=await e.json(),n=new Map;for(let e of t.presets??[])n.set(e.id,e.installed);return z.map(e=>({...e,installed:n.get(e.id)??!1}))}catch{return z.map(Ht)}}function Ht(e){return{...e,installed:!1}}async function Ut(e){let t=await st(`/api/fonts/install`,{method:`POST`,headers:{"content-type":`application/json`},credentials:`same-origin`,body:JSON.stringify({id:e})}),n=await t.json().catch(()=>null);if(!t.ok)throw Error(n?.error??`install failed (${t.status})`);return n}var Wt=`parasor:settings`,Gt=`parasor:custom-themes`,Kt=`custom:`,qt=`parasor:active-theme-tokens`,Jt=`parasor:active-theme-mode`,B={min:12,max:22},V={min:12,max:22},H={themeId:Rt,uiFontSize:16,contentFontSize:16,uiFontFamily:``,customFontFamily:``,fontPresetId:``,playAttentionSound:!1,playCompletionSound:!1};function Yt(){try{let e=localStorage.getItem(Gt);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>!!e&&typeof e==`object`&&typeof e.id==`string`&&typeof e.json==`string`):[]}catch{return[]}}function Xt(e){let t=[];for(let n of e)try{t.push(Lt(n.id,I(n.json),`custom`))}catch{}return t}function Zt(e){try{localStorage.setItem(Gt,JSON.stringify(e))}catch{}}function Qt(){try{let e=localStorage.getItem(Wt);if(!e)return H;let t=JSON.parse(e);return{themeId:typeof t.themeId==`string`&&t.themeId?t.themeId:H.themeId,uiFontSize:typeof t.uiFontSize==`number`?Math.min(V.max,Math.max(V.min,t.uiFontSize)):H.uiFontSize,contentFontSize:typeof t.contentFontSize==`number`?Math.min(B.max,Math.max(B.min,t.contentFontSize)):H.contentFontSize,customFontFamily:typeof t.customFontFamily==`string`?t.customFontFamily:H.customFontFamily,uiFontFamily:typeof t.uiFontFamily==`string`?t.uiFontFamily:H.uiFontFamily,fontPresetId:typeof t.fontPresetId==`string`?t.fontPresetId:H.fontPresetId,playAttentionSound:typeof t.playAttentionSound==`boolean`?t.playAttentionSound:H.playAttentionSound,playCompletionSound:typeof t.playCompletionSound==`boolean`?t.playCompletionSound:H.playCompletionSound}}catch{return H}}function $t(e){try{localStorage.setItem(Wt,JSON.stringify(e))}catch{}}function en(e,t=()=>Date.now()){for(let n=0;n<1e3;n++){let r=`${Kt}${t().toString(36)}-${n}`;if(!e.has(r))return r}throw Error(`Failed to generate unique theme id`)}function tn(e,t,n=()=>Date.now()){let r=e.name.trim();if(!r)throw new F(`Theme name is required`);let i=I(e.json),a=en(new Set(t),n),o={...i,name:r};return{entry:Lt(a,o,`custom`),storedTheme:{id:a,json:JSON.stringify(o)}}}var nn=(0,h.createContext)(null),rn=1200;function an(e){if(typeof window>`u`)return()=>{};let t=!1,n=window.setTimeout(()=>{n=null,o()},rn),r=window.requestAnimationFrame(()=>{r=null,i=window.requestAnimationFrame(()=>{i=null,n!==null&&(window.clearTimeout(n),n=null);let e=window.requestIdleCallback;if(e){a=e(o,{timeout:2e3});return}o()})}),i=null,a=null;function o(){t||(t=!0,e())}return()=>{t=!0,n!==null&&window.clearTimeout(n),r!==null&&window.cancelAnimationFrame(r),i!==null&&window.cancelAnimationFrame(i),a!==null&&window.cancelIdleCallback?.(a)}}function on({children:e}){let[t,n]=(0,h.useState)(()=>Qt()),[r,i]=(0,h.useState)(()=>Yt()),a=(0,h.useMemo)(()=>Xt(r),[r]),o=(0,h.useMemo)(()=>[...R,...a],[a]),s=(0,h.useMemo)(()=>o.find(e=>e.id===t.themeId)??R[0],[o,t.themeId]),c=(0,h.useMemo)(()=>{let e=t.fontPresetId?Bt(t.fontPresetId):void 0,n=[],r=t.customFontFamily.trim();return r.length>0&&n.push(r),e&&n.push(e.family),_t(n.join(`, `))},[t.customFontFamily,t.fontPresetId]),l=(0,h.useMemo)(()=>_t(t.uiFontFamily,pt),[t.uiFontFamily]);(0,h.useEffect)(()=>{let e=t.fontPresetId?Bt(t.fontPresetId):void 0;if(e)return an(()=>{dt({family:e.family,url:`/api/fonts/file/${e.id}`}).catch(()=>{})})},[t.fontPresetId]),(0,h.useEffect)(()=>{let e=document.documentElement;e.dataset.theme=s.mode,e.style.setProperty(`--parasor-ui-font-size`,`${t.uiFontSize}px`),e.style.setProperty(`--parasor-ui-font`,l),e.style.setProperty(`--parasor-content-font-size`,`${t.contentFontSize}px`),e.style.setProperty(`--parasor-font-size`,`${t.contentFontSize}px`),e.style.setProperty(`--parasor-content-font`,c),e.style.setProperty(`--parasor-font`,c);for(let t of zt)e.style.setProperty(t,s.tokens[t]);try{localStorage.setItem(qt,JSON.stringify(s.tokens)),localStorage.setItem(Jt,s.mode)}catch{}},[s,c,l,t.contentFontSize,t.uiFontSize]),(0,h.useEffect)(()=>{$t(t)},[t]),(0,h.useEffect)(()=>{Zt(r)},[r]),(0,h.useEffect)(()=>{o.some(e=>e.id===t.themeId)||n(e=>({...e,themeId:Rt}))},[o,t.themeId]);let u=(0,h.useCallback)(e=>{n(t=>({...t,themeId:e}))},[]),d=(0,h.useCallback)(e=>{let t=Math.min(V.max,Math.max(V.min,Math.round(e)));n(e=>({...e,uiFontSize:t}))},[]),f=(0,h.useCallback)(e=>{n(t=>({...t,uiFontFamily:e}))},[]),p=(0,h.useCallback)(e=>{let t=Math.min(B.max,Math.max(B.min,Math.round(e)));n(e=>({...e,contentFontSize:t}))},[]),m=(0,h.useCallback)(e=>{n(t=>({...t,customFontFamily:e}))},[]),g=(0,h.useCallback)(e=>{n(t=>({...t,fontPresetId:e}))},[]),v=(0,h.useCallback)(e=>{n(t=>({...t,playAttentionSound:e}))},[]),y=(0,h.useCallback)(e=>{n(t=>({...t,playCompletionSound:e}))},[]),b=(0,h.useCallback)(e=>{let{entry:t,storedTheme:n}=tn(e,[...R.map(e=>e.id),...r.map(e=>e.id)]);return i(e=>[...e,n]),t},[r]),x=(0,h.useCallback)(e=>{i(t=>t.filter(t=>t.id!==e))},[]),S=(0,h.useMemo)(()=>({...t,themes:o,activeTheme:s,customThemes:a,resolvedFontStack:c,resolvedUiFontStack:l,setThemeId:u,setUiFontFamily:f,setUiFontSize:d,setContentFontSize:p,setCustomFontFamily:m,setFontPresetId:g,setPlayAttentionSound:v,setPlayCompletionSound:y,addCustomTheme:b,removeCustomTheme:x}),[s,b,a,x,l,c,p,m,g,v,y,f,d,u,t,o]);return(0,_.jsx)(nn.Provider,{value:S,children:e})}function sn(){let e=(0,h.useContext)(nn);if(!e)throw Error(`useSettings must be used within SettingsProvider`);return e}function cn(e){if(e.length===0)return{count:0,minMs:0,medianMs:0,maxMs:0};let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2),r=t.length%2==0?(t[n-1]+t[n])/2:t[n];return{count:t.length,minMs:ln(t[0]),medianMs:ln(r),maxMs:ln(t[t.length-1])}}function ln(e){return Math.round(e*10)/10}function U(e,t,n,r=1/0){let i=new Map,a=[];for(let o of e){let e=o.sessionId??``;if(o.type===t){let t=i.get(e)??[];t.push(o.t),i.set(e,t);continue}if(o.type===n){let t=i.get(e)?.shift();if(t===void 0)continue;let n=o.t-t;n>=0&&n<=r&&a.push(n)}}return a}var un=8e3,dn=2e3;function fn(e){let t=U(e,`terminal-mount`,`xterm-cache-replay-paint`,un).concat(U(e,`terminal-mount`,`xterm-replay-paint`,un)).concat(U(e,`terminal-visible-refresh`,`xterm-render`,dn)),n=U(e,`xterm-replay-reset`,`xterm-replay-paint`,un).concat(U(e,`xterm-cache-replay-start`,`xterm-cache-replay-paint`,un)),r=e.filter(e=>e.type===`terminal-resize-apply`),i=r.map(e=>e.durationMs).filter(e=>typeof e==`number`),a=r.map(e=>e.resizeDurationMs).filter(e=>typeof e==`number`),o=0,s=0;for(let t of e)t.type===`main-thread-drift`&&(s+=1,typeof t.driftMs==`number`&&(o=Math.max(o,t.driftMs)));return{k1SwitchToPaint:cn(t),k2KeyboardResize:cn(i),k2ResizeInner:cn(a),k3ClearRedrawBlank:cn(n),signatures:{anchorChangedResizes:r.filter(e=>e.reason===`anchor-changed`).length,deferredResizeFlushes:e.filter(e=>e.type===`terminal-resize-deferred-flush`).length,historyLoadSuppressed:e.filter(e=>e.type===`terminal-history-load-suppressed`).length,mainThreadDriftEvents:s,maxMainThreadDriftMs:ln(o)}}}var pn=`parasor:terminal-trace`,W=2e3,mn=250,hn=50,gn=2e3,_n=100,vn=new Set([`socket-output`,`xterm-output-batch`,`xterm-write-start`,`xterm-write-callback`]),yn=1e3,bn=1500,xn=250,Sn=5e3,Cn=`terminal-input-background`,wn=`client-startup-load`,Tn=80,En=12,Dn=24,On=16,kn=Array(W),G=0,K=0,q=0,An=!1,jn=null,Mn=new Map,J=[],Nn=new Set,Pn=0,Fn=new Set,In=0;function Y(){return performance.now()}function Ln(){try{let e=new URLSearchParams(window.location.search).get(`terminalTrace`);return e===`1`||e===`true`}catch{return!1}}function Rn(){try{return Ln()?(window.localStorage.setItem(pn,`1`),!0):window.localStorage.getItem(pn)===`1`}catch{return Ln()}}function zn(e){jn=e;try{e?window.localStorage.setItem(pn,`1`):window.localStorage.removeItem(pn)}catch{}}function Bn(){Q(),zn(!0)}function Vn(){zn(!1)}function X(){return typeof window>`u`?!1:(Q(),jn===null&&(jn=Rn()),jn)}function Hn(){let e={},t=0,n=0,r=new Map,i=Z();for(let a of i)if(e[a.type]=(e[a.type]??0)+1,a.type===`main-thread-drift`&&typeof a.driftMs==`number`&&(t=Math.max(t,a.driftMs)),a.type===`xterm-write-start`)r.set(a.seq,a);else if(a.type===`xterm-write-callback`){let e=[...r.values()].filter(e=>e.sessionId===a.sessionId).at(-1);e&&(n=Math.max(n,a.t-e.t))}return{enabled:X(),eventCount:K,firstEventAt:i[0]?.t??null,lastEventAt:i.at(-1)?.t??null,maxMainThreadDriftMs:t,maxWriteCallbackMs:n,byType:e}}function Un(e){return`${e.type}:${e.sessionId??``}:${e.clientId??``}`}function Wn(e){if(!vn.has(e.type))return e;let t=Un(e),n=Mn.get(t),r=e.dataLength??0,i=e.byteLength??0;if(!n)return Mn.set(t,{firstAt:e.t,count:1,dataLength:r,byteLength:i}),{...e,sampledEvents:1,sampledDataLength:r,sampledByteLength:i,sampleWindowMs:0};n.count+=1,n.dataLength+=r,n.byteLength+=i;let a=e.t-n.firstAt;if(n.count<_n&&a<gn)return null;let o={...e,dataLength:n.dataLength,byteLength:n.byteLength,sampledEvents:n.count,sampledDataLength:n.dataLength,sampledByteLength:n.byteLength,sampleWindowMs:a};return Mn.delete(t),o}function Gn(e){if(K<W){kn[(G+K)%W]=e,K+=1;return}kn[G]=e,G=(G+1)%W}function Z(){let e=[];for(let t=0;t<K;t++)e.push(kn[(G+t)%W]);return e}function Q(){typeof window>`u`||An||(An=!0,window.parasorTerminalTrace={dump:Z,dumpBottomRows:Yn,captureTerminalInput:Zn,clear:()=>{G=0,K=0,q=0,Mn.clear(),Nn.clear(),Pn=0,Fn.clear(),In=0},summary:Hn,kpi:()=>fn(Z()),enabled:X,enable:Bn,disable:Vn,flush:()=>{}})}function $(e){if(!e)return;let t=typeof e.sessionId==`string`&&e.sessionId.length>0?e.sessionId:void 0,n=typeof e.paneId==`string`&&e.paneId.length>0?e.paneId:void 0;if(!(!t&&!n))return{...t?{sessionId:t}:{},...n?{paneId:n}:{}}}function Kn(e,t){return!(t.sessionId&&e.sessionId!==t.sessionId||t.paneId&&e.paneId!==t.paneId)}function qn(e){let t=$(e);if(t){let e=[...J].reverse().find(e=>Kn(e.source,t))??null;return{entry:e,source:{status:e?`selected`:`missing`,requested:t,...e?{selected:e.source}:{}}}}let n=J.at(-1)??null;return{entry:n,source:{status:n?`selected`:`missing`,...n?{selected:n.source}:{}}}}function Jn(e){return typeof e==`number`?{rowCount:e}:typeof e==`object`&&e?{rowCount:typeof e.rowCount==`number`?e.rowCount:void 0,target:$(e)}:{}}function Yn(e){let{rowCount:t,target:n}=Jn(e),{entry:r}=qn(n);return r?.provider(t)??null}function Xn(e,t){for(let n=e.length-1;n>=0;--n){let r=e[n]?.[t];if(typeof r==`string`&&r.length>0)return r}}async function Zn(e=`manual`,t){let n=await er(Qn(e,[],t));return n.json().catch(()=>({ok:n.ok}))}function Qn(e,t=[],n){Q();let r=[...Z(),...t].slice(-Tn),i=Xn(r,`sessionId`),a=$(n)??$({sessionId:i}),{entry:o,source:s}=qn(a),c=o?.provider(En)??null;return{diagnostic:Cn,reason:e,sessionId:a?.sessionId??s.selected?.sessionId??i,clientId:Xn(r,`clientId`),source:s,events:r,bottomRows:c}}function $n(e,t=[]){Q();let n=[...Z(),...t].slice(-Tn);return{diagnostic:wn,reason:e,sessionId:Xn(n,`sessionId`),clientId:Xn(n,`clientId`),events:n,bottomRows:null}}function er(e){return st(`/api/debug/terminal-trace/client-diagnostic`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})}function tr(e){if(typeof e!=`object`||!e)return null;let t=e,n=Array.isArray(t.rowsSampled)?t.rowsSampled.slice(-4).map(e=>{if(typeof e!=`object`||!e)return null;let t=e;return{line:t.line,viewportRow:t.viewportRow,text:t.text,attrRuns:t.attrRuns}}):[];return{cols:t.cols,rows:t.rows,cursorX:t.cursorX,cursorY:t.cursorY,viewportY:t.viewportY,baseY:t.baseY,renderer:t.renderer,rowsSampled:n}}function nr(e){let t=e.events.at(-1);return JSON.stringify({reason:e.reason,sessionId:e.sessionId,clientId:e.clientId,eventType:t?.type,cols:t?.cols,rows:t?.rows,viewportY:t?.viewportY,baseY:t?.baseY,ptyResizeSent:t?.ptyResizeSent,ptyResizeSuppressedReason:t?.ptyResizeSuppressedReason,source:e.source,bottomRows:tr(e.bottomRows)})}function rr(e){let t=e.events.at(-1);return JSON.stringify({reason:e.reason,eventType:t?.type,durationMs:t?.durationMs,delayMs:t?.delayMs,timeoutMs:t?.timeoutMs,routeKind:t?.routeKind,status:t?.status})}function ir(e,t){if(typeof window>`u`||Pn>=Dn)return;let n=Qn(e,[{seq:q+1,t:Y(),...t}]),r=nr(n);Nn.has(r)||(Nn.add(r),Pn+=1,er(n).catch(()=>{}))}function ar(e,t){if(typeof window>`u`||In>=On)return;let n=$n(e,[{seq:q+1,t:Y(),...t}]),r=rr(n);Fn.has(r)||(Fn.add(r),In+=1,er(n).catch(()=>{}))}function or(e,t={}){Q();let n={provider:e,source:$(t)??{}},r=J.findIndex(t=>t.provider===e);return r!==-1&&J.splice(r,1),J.push(n),()=>{let t=J.findIndex(t=>t.provider===e);t!==-1&&J.splice(t,1)}}function sr(e){let t=[[`driftMs`,xn],[`sinceReplayStartMs`,bn],[`durationMs`,yn],[`delayMs`,Sn]];for(let[n,r]of t){let t=e[n];if(typeof t==`number`&&t>=r)return{warning:!0,warningMetric:n,warningThresholdMs:r}}return e.type.endsWith(`-timeout`)?{warning:!0,warningMetric:`timeoutMs`,warningThresholdMs:e.timeoutMs??0}:null}function cr(e,t={}){let n={t:Y(),type:e,...t},r=sr(n);if(!X()&&!r)return;let i=Wn({...n,...r});i&&Gn({seq:++q,...i})}function lr(e,t){if(!X())return;let n=Wn({t:Y(),type:e,...t()});n&&Gn({seq:++q,...n})}function ur(e){if(!X())return()=>{};Q();let t=Y()+mn,n=window.setInterval(()=>{let n=Y(),r=n-t;t=n+mn,r>=hn&&cr(`main-thread-drift`,{sessionId:e,driftMs:r})},mn);return()=>clearInterval(n)}export{He as A,S as B,nt as C,Ke as D,Je as E,N as F,o as G,m as H,je as I,c as K,Ae as L,Be as M,ze as N,We as O,Re as P,M as R,ct as S,Ze as T,f as U,b as V,u as W,_t as _,ur as a,it as b,on as c,V as d,z as f,pt as g,F as h,ir as i,Ve as j,Ue as k,sn as l,Ut as m,or as n,cr as o,Vt as p,ar as r,lr as s,X as t,B as u,dt as v,Qe as w,st as x,rt as y,C as z};
|
|
2803
|
+
`),n++;n+=2;continue}t+=i,n++}return t}function bn(e){let t=``,n=0,r=e.length;for(;n<r;){let i=e[n];if(i===`"`){for(t+=i,n++;n<r;){let i=e[n];if(t+=i,i===`\\`&&n+1<r){t+=e[n+1],n+=2;continue}if(n++,i===`"`)break}continue}if(i===`,`){let t=n+1;for(;t<r&&/\s/.test(e[t]);)t++;if(t<r&&(e[t]===`}`||e[t]===`]`)){n++;continue}}t+=i,n++}return t}function M(e){let t;try{t=JSON.parse(bn(yn(e)))}catch(e){throw new j(`Invalid JSON: ${e.message}`)}if(!t||typeof t!=`object`)throw new j(`Theme JSON must be an object`);let n=t;if(!n.colors||typeof n.colors!=`object`)throw new j("Theme JSON must have a `colors` object");let r=n.colors,i={};for(let[e,t]of Object.entries(r))typeof t==`string`&&(i[e]=t);let a=n.type;if(a!==void 0&&a!==`dark`&&a!==`light`&&a!==`hc`&&a!==`hcLight`)throw new j(`Theme \`type\` must be "dark" | "light" | "hc" | "hcLight" (got ${JSON.stringify(a)})`);return{name:typeof n.name==`string`?n.name:``,type:a,colors:i}}function xn(e){return e.type===`light`||e.type===`hcLight`?`light`:e.type===`dark`||e.type===`hc`||Sn(e.colors[`editor.background`]??`#000000`)?`dark`:`light`}function Sn(e){let t=Cn(e);return t?(t.r*299+t.g*587+t.b*114)/1e3<128:!0}function Cn(e){let t=/^#([0-9a-fA-F]{6,8})$/.exec(e);if(!t)return null;let n=t[1];return{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16)}}function wn(e,t){let n=/^#([0-9a-fA-F]{6})([0-9a-fA-F]{2})$/.exec(e);if(n){let e=parseInt(n[2],16)/255,r=Math.round(Math.max(0,Math.min(1,e*t))*255);return`#${n[1]}${r.toString(16).padStart(2,`0`)}`}return/^#[0-9a-fA-F]{6}$/.test(e)?`${e}${Math.round(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,`0`)}`:e}var Tn=M(gn),En=M(_n);function Dn(e){let t={...(xn(e)===`dark`?Tn:En).colors,...e.colors};for(let e=0;e<8;e++){let e=!1;for(let n of vn){if(t[n.target])continue;let r=t[n.source];r&&(t[n.target]=n.alpha==null?r:wn(r,n.alpha),e=!0)}if(!e)break}return{...e,colors:t}}function On(e){let t=e.colors,n=xn(e);return{"--theme-editor-bg":t[`editor.background`],"--theme-editor-fg":t[`editor.foreground`],"--theme-sidebar-bg":t[`sideBar.background`],"--theme-sidebar-fg":t[`sideBar.foreground`],"--theme-terminal-bg":t[`terminal.background`],"--theme-description-fg":t.descriptionForeground,"--theme-border":t[`panel.border`],"--theme-link-fg":t[`textLink.foreground`],"--theme-list-active-bg":t[`list.activeSelectionBackground`],"--theme-list-inactive-bg":t[`list.inactiveSelectionBackground`],"--theme-list-active-fg":t[`list.activeSelectionForeground`],"--theme-list-hover-bg":t[`list.hoverBackground`],"--theme-button-secondary-bg":t[`button.secondaryBackground`],"--theme-button-secondary-hover-bg":t[`button.secondaryHoverBackground`],"--theme-tab-active-bg":t[`tab.activeBackground`],"--theme-tab-inactive-bg":t[`tab.inactiveBackground`],"--theme-tab-strip-bg":t[`editorGroupHeader.tabsBackground`],"--theme-git-added":t[`gitDecoration.addedResourceForeground`],"--theme-git-modified":t[`gitDecoration.modifiedResourceForeground`],"--theme-git-deleted":t[`gitDecoration.deletedResourceForeground`],"--theme-warning":t[`list.warningForeground`]??t[`editorWarning.foreground`]??t[`inputValidation.warningBorder`]??t[`notificationsWarningIcon.foreground`]??(n===`light`?`#855f00`:`#d7ba7d`),"--theme-diff-added-bg":t[`diffEditor.insertedLineBackground`]??t[`diffEditor.insertedTextBackground`]??(n===`light`?`#e3ffef`:`#243733`),"--theme-diff-deleted-bg":t[`diffEditor.removedLineBackground`]??t[`diffEditor.removedTextBackground`]??(n===`light`?`#ffe6ed`:`#3f282d`),"--theme-graph-branch-1":t[`scmGraph.foreground1`],"--theme-graph-branch-2":t[`scmGraph.foreground2`],"--theme-graph-branch-3":t[`scmGraph.foreground3`],"--theme-graph-branch-4":t[`scmGraph.foreground4`],"--theme-graph-branch-5":t[`scmGraph.foreground5`],"--theme-graph-ref-base":t[`scmGraph.historyItemRefColor`]}}function kn(e){let t=e.colors;return{background:t[`terminal.background`],foreground:t[`terminal.foreground`],cursor:t[`terminalCursor.foreground`],cursorAccent:t[`terminalCursor.background`],selectionBackground:t[`terminal.selectionBackground`],black:t[`terminal.ansiBlack`],red:t[`terminal.ansiRed`],green:t[`terminal.ansiGreen`],yellow:t[`terminal.ansiYellow`],blue:t[`terminal.ansiBlue`],magenta:t[`terminal.ansiMagenta`],cyan:t[`terminal.ansiCyan`],white:t[`terminal.ansiWhite`],brightBlack:t[`terminal.ansiBrightBlack`],brightRed:t[`terminal.ansiBrightRed`],brightGreen:t[`terminal.ansiBrightGreen`],brightYellow:t[`terminal.ansiBrightYellow`],brightBlue:t[`terminal.ansiBrightBlue`],brightMagenta:t[`terminal.ansiBrightMagenta`],brightCyan:t[`terminal.ansiBrightCyan`],brightWhite:t[`terminal.ansiBrightWhite`]}}function An(e,t,n){let r=Dn(t);return{id:e,name:t.name,mode:xn(t),source:n,tokens:On(r),terminal:kn(r)}}function N(e,t){return An(e,M(t),`builtin`)}var P=[N(`parasor-dark`,fn),N(`parasor-light`,pn),N(`tokyo-night`,hn),N(`solarized-light`,mn),N(`monokai`,dn)],jn=P[0].id,Mn=Object.keys(P[0].tokens),F=[{id:`jetbrains-mono`,name:`JetBrains Mono`,category:`latin`,family:`JetBrains Mono`,zipSizeMb:5,description:`Popular coding font with ligatures.`},{id:`fira-code`,name:`Fira Code`,category:`latin`,family:`Fira Code`,zipSizeMb:3,description:`Monospace font with programming ligatures.`},{id:`udev-gothic`,name:`UDEV Gothic`,category:`asian`,family:`UDEV Gothic`,zipSizeMb:59,description:`JetBrains Mono + BIZ UDGothic. Japanese, 2:1 CJK alignment.`},{id:`d2-coding`,name:`D2 Coding`,category:`asian`,family:`D2 Coding`,zipSizeMb:20,description:`Naver D2 Coding. Korean coding font with Hangul support.`},{id:`maple-mono-cn`,name:`Maple Mono CN`,category:`asian`,family:`Maple Mono CN`,zipSizeMb:134,description:`Maple Mono with Simplified Chinese coverage.`}];function Nn(e){return F.find(t=>t.id===e)}async function Pn(){try{let e=await $t(`/api/fonts/catalog`,{credentials:`same-origin`});if(!e.ok)return F.map(Fn);let t=await e.json(),n=new Map;for(let e of t.presets??[])n.set(e.id,e.installed);return F.map(e=>({...e,installed:n.get(e.id)??!1}))}catch{return F.map(Fn)}}function Fn(e){return{...e,installed:!1}}async function In(e){let t=await $t(`/api/fonts/install`,{method:`POST`,headers:{"content-type":`application/json`},credentials:`same-origin`,body:JSON.stringify({id:e})}),n=await t.json().catch(()=>null);if(!t.ok)throw Error(n?.error??`install failed (${t.status})`);return n}var Ln=`parasor:settings`,Rn=`parasor:custom-themes`,zn=`custom:`,Bn=`parasor:active-theme-tokens`,Vn=`parasor:active-theme-mode`,I={min:12,max:22},L={min:12,max:22},R={themeId:jn,uiFontSize:16,contentFontSize:16,uiFontFamily:``,customFontFamily:``,fontPresetId:``,playAttentionSound:!1,playCompletionSound:!1};function Hn(){try{let e=localStorage.getItem(Rn);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>!!e&&typeof e==`object`&&typeof e.id==`string`&&typeof e.json==`string`):[]}catch{return[]}}function Un(e){let t=[];for(let n of e)try{t.push(An(n.id,M(n.json),`custom`))}catch{}return t}function Wn(e){try{localStorage.setItem(Rn,JSON.stringify(e))}catch{}}function Gn(){try{let e=localStorage.getItem(Ln);if(!e)return R;let t=JSON.parse(e);return{themeId:typeof t.themeId==`string`&&t.themeId?t.themeId:R.themeId,uiFontSize:typeof t.uiFontSize==`number`?Math.min(L.max,Math.max(L.min,t.uiFontSize)):R.uiFontSize,contentFontSize:typeof t.contentFontSize==`number`?Math.min(I.max,Math.max(I.min,t.contentFontSize)):R.contentFontSize,customFontFamily:typeof t.customFontFamily==`string`?t.customFontFamily:R.customFontFamily,uiFontFamily:typeof t.uiFontFamily==`string`?t.uiFontFamily:R.uiFontFamily,fontPresetId:typeof t.fontPresetId==`string`?t.fontPresetId:R.fontPresetId,playAttentionSound:typeof t.playAttentionSound==`boolean`?t.playAttentionSound:R.playAttentionSound,playCompletionSound:typeof t.playCompletionSound==`boolean`?t.playCompletionSound:R.playCompletionSound}}catch{return R}}function Kn(e){try{localStorage.setItem(Ln,JSON.stringify(e))}catch{}}function qn(e,t=()=>Date.now()){for(let n=0;n<1e3;n++){let r=`${zn}${t().toString(36)}-${n}`;if(!e.has(r))return r}throw Error(`Failed to generate unique theme id`)}function Jn(e,t,n=()=>Date.now()){let r=e.name.trim();if(!r)throw new j(`Theme name is required`);let i=M(e.json),a=qn(new Set(t),n),o={...i,name:r};return{entry:An(a,o,`custom`),storedTheme:{id:a,json:JSON.stringify(o)}}}var Yn=(0,k.createContext)(null),Xn=1200;function Zn(e){if(typeof window>`u`)return()=>{};let t=!1,n=window.setTimeout(()=>{n=null,o()},Xn),r=window.requestAnimationFrame(()=>{r=null,i=window.requestAnimationFrame(()=>{i=null,n!==null&&(window.clearTimeout(n),n=null);let e=window.requestIdleCallback;if(e){a=e(o,{timeout:2e3});return}o()})}),i=null,a=null;function o(){t||(t=!0,e())}return()=>{t=!0,n!==null&&window.clearTimeout(n),r!==null&&window.cancelAnimationFrame(r),i!==null&&window.cancelAnimationFrame(i),a!==null&&window.cancelIdleCallback?.(a)}}function Qn({children:e}){let[t,n]=(0,k.useState)(()=>Gn()),[r,i]=(0,k.useState)(()=>Hn()),a=(0,k.useMemo)(()=>Un(r),[r]),o=(0,k.useMemo)(()=>[...P,...a],[a]),s=(0,k.useMemo)(()=>o.find(e=>e.id===t.themeId)??P[0],[o,t.themeId]),c=(0,k.useMemo)(()=>{let e=t.fontPresetId?Nn(t.fontPresetId):void 0,n=[],r=t.customFontFamily.trim();return r.length>0&&n.push(r),e&&n.push(e.family),un(n.join(`, `))},[t.customFontFamily,t.fontPresetId]),l=(0,k.useMemo)(()=>un(t.uiFontFamily,on),[t.uiFontFamily]);(0,k.useEffect)(()=>{let e=t.fontPresetId?Nn(t.fontPresetId):void 0;if(e)return Zn(()=>{rn({family:e.family,url:`/api/fonts/file/${e.id}`}).catch(()=>{})})},[t.fontPresetId]),(0,k.useEffect)(()=>{let e=document.documentElement;e.dataset.theme=s.mode,e.style.setProperty(`--parasor-ui-font-size`,`${t.uiFontSize}px`),e.style.setProperty(`--parasor-ui-font`,l),e.style.setProperty(`--parasor-content-font-size`,`${t.contentFontSize}px`),e.style.setProperty(`--parasor-font-size`,`${t.contentFontSize}px`),e.style.setProperty(`--parasor-content-font`,c),e.style.setProperty(`--parasor-font`,c);for(let t of Mn)e.style.setProperty(t,s.tokens[t]);try{localStorage.setItem(Bn,JSON.stringify(s.tokens)),localStorage.setItem(Vn,s.mode)}catch{}},[s,c,l,t.contentFontSize,t.uiFontSize]),(0,k.useEffect)(()=>{Kn(t)},[t]),(0,k.useEffect)(()=>{Wn(r)},[r]),(0,k.useEffect)(()=>{o.some(e=>e.id===t.themeId)||n(e=>({...e,themeId:jn}))},[o,t.themeId]);let u=(0,k.useCallback)(e=>{n(t=>({...t,themeId:e}))},[]),d=(0,k.useCallback)(e=>{let t=Math.min(L.max,Math.max(L.min,Math.round(e)));n(e=>({...e,uiFontSize:t}))},[]),f=(0,k.useCallback)(e=>{n(t=>({...t,uiFontFamily:e}))},[]),p=(0,k.useCallback)(e=>{let t=Math.min(I.max,Math.max(I.min,Math.round(e)));n(e=>({...e,contentFontSize:t}))},[]),m=(0,k.useCallback)(e=>{n(t=>({...t,customFontFamily:e}))},[]),h=(0,k.useCallback)(e=>{n(t=>({...t,fontPresetId:e}))},[]),g=(0,k.useCallback)(e=>{n(t=>({...t,playAttentionSound:e}))},[]),_=(0,k.useCallback)(e=>{n(t=>({...t,playCompletionSound:e}))},[]),v=(0,k.useCallback)(e=>{let{entry:t,storedTheme:n}=Jn(e,[...P.map(e=>e.id),...r.map(e=>e.id)]);return i(e=>[...e,n]),t},[r]),y=(0,k.useCallback)(e=>{i(t=>t.filter(t=>t.id!==e))},[]),b=(0,k.useMemo)(()=>({...t,themes:o,activeTheme:s,customThemes:a,resolvedFontStack:c,resolvedUiFontStack:l,setThemeId:u,setUiFontFamily:f,setUiFontSize:d,setContentFontSize:p,setCustomFontFamily:m,setFontPresetId:h,setPlayAttentionSound:g,setPlayCompletionSound:_,addCustomTheme:v,removeCustomTheme:y}),[s,v,a,y,l,c,p,m,h,g,_,f,d,u,t,o]);return(0,D.jsx)(Yn.Provider,{value:b,children:e})}function $n(){let e=(0,k.useContext)(Yn);if(!e)throw Error(`useSettings must be used within SettingsProvider`);return e}function z(e){if(e.length===0)return{count:0,minMs:0,medianMs:0,maxMs:0};let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2),r=t.length%2==0?(t[n-1]+t[n])/2:t[n];return{count:t.length,minMs:er(t[0]),medianMs:er(r),maxMs:er(t[t.length-1])}}function er(e){return Math.round(e*10)/10}function B(e,t,n,r=1/0){let i=new Map,a=[];for(let o of e){let e=o.sessionId??``;if(o.type===t){let t=i.get(e)??[];t.push(o.t),i.set(e,t);continue}if(o.type===n){let t=i.get(e)?.shift();if(t===void 0)continue;let n=o.t-t;n>=0&&n<=r&&a.push(n)}}return a}var tr=8e3,nr=2e3;function rr(e){let t=B(e,`terminal-mount`,`xterm-cache-replay-paint`,tr).concat(B(e,`terminal-mount`,`xterm-replay-paint`,tr)).concat(B(e,`terminal-visible-refresh`,`xterm-render`,nr)),n=B(e,`xterm-replay-reset`,`xterm-replay-paint`,tr).concat(B(e,`xterm-cache-replay-start`,`xterm-cache-replay-paint`,tr)),r=e.filter(e=>e.type===`terminal-resize-apply`),i=r.map(e=>e.durationMs).filter(e=>typeof e==`number`),a=r.map(e=>e.resizeDurationMs).filter(e=>typeof e==`number`),o=0,s=0;for(let t of e)t.type===`main-thread-drift`&&(s+=1,typeof t.driftMs==`number`&&(o=Math.max(o,t.driftMs)));return{k1SwitchToPaint:z(t),k2KeyboardResize:z(i),k2ResizeInner:z(a),k3ClearRedrawBlank:z(n),signatures:{anchorChangedResizes:r.filter(e=>e.reason===`anchor-changed`).length,deferredResizeFlushes:e.filter(e=>e.type===`terminal-resize-deferred-flush`).length,historyLoadSuppressed:e.filter(e=>e.type===`terminal-history-load-suppressed`).length,mainThreadDriftEvents:s,maxMainThreadDriftMs:er(o)}}}var V=`parasor:terminal-trace`,ir=`parasor:terminal-trace-enabled-change`,H=2e3,ar=250,or=50,sr=2e3,cr=100,lr=new Set([`socket-output`,`xterm-output-batch`,`xterm-write-start`,`xterm-write-callback`]),ur=1e3,dr=1500,fr=250,pr=5e3,mr=`terminal-input-background`,hr=`client-startup-load`,gr=80,_r=12,vr=24,yr=16,br=Array(H),U=0,W=0,G=0,xr=!1,K=null,Sr=new Set,Cr=new Map,q=[],wr=new Set,Tr=0,Er=new Set,Dr=0;function J(){return performance.now()}function Or(){try{let e=new URLSearchParams(window.location.search).get(`terminalTrace`);return e===`1`||e===`true`?!0:e===`0`||e===`false`?!1:null}catch{return null}}function kr(){try{let e=Or();return e===!0?(window.localStorage.setItem(V,`1`),!0):e===!1?(window.localStorage.removeItem(V),!1):window.localStorage.getItem(V)===`1`}catch{return Or()??!1}}function Ar(){for(let e of Sr)e();typeof window<`u`&&window.dispatchEvent(new Event(ir))}function jr(e){let t=K!==e;K=e;try{e?window.localStorage.setItem(V,`1`):window.localStorage.removeItem(V)}catch{}t&&Ar()}function Mr(){Z(),jr(!0)}function Nr(){jr(!1)}function Y(){return typeof window>`u`?!1:(Z(),K===null&&(K=kr()),K)}function Pr(e){return Sr.add(e),()=>Sr.delete(e)}function Fr(){let e={},t=0,n=0,r=new Map,i=X();for(let a of i)if(e[a.type]=(e[a.type]??0)+1,a.type===`main-thread-drift`&&typeof a.driftMs==`number`&&(t=Math.max(t,a.driftMs)),a.type===`xterm-write-start`)r.set(a.seq,a);else if(a.type===`xterm-write-callback`){let e=[...r.values()].filter(e=>e.sessionId===a.sessionId).at(-1);e&&(n=Math.max(n,a.t-e.t))}return{enabled:Y(),eventCount:W,firstEventAt:i[0]?.t??null,lastEventAt:i.at(-1)?.t??null,maxMainThreadDriftMs:t,maxWriteCallbackMs:n,byType:e}}function Ir(e){return`${e.type}:${e.sessionId??``}:${e.clientId??``}`}function Lr(e){if(!lr.has(e.type))return e;let t=Ir(e),n=Cr.get(t),r=e.dataLength??0,i=e.byteLength??0;if(!n)return Cr.set(t,{firstAt:e.t,count:1,dataLength:r,byteLength:i}),{...e,sampledEvents:1,sampledDataLength:r,sampledByteLength:i,sampleWindowMs:0};n.count+=1,n.dataLength+=r,n.byteLength+=i;let a=e.t-n.firstAt;if(n.count<cr&&a<sr)return null;let o={...e,dataLength:n.dataLength,byteLength:n.byteLength,sampledEvents:n.count,sampledDataLength:n.dataLength,sampledByteLength:n.byteLength,sampleWindowMs:a};return Cr.delete(t),o}function Rr(e){if(W<H){br[(U+W)%H]=e,W+=1;return}br[U]=e,U=(U+1)%H}function X(){let e=[];for(let t=0;t<W;t++)e.push(br[(U+t)%H]);return e}function Z(){typeof window>`u`||xr||(xr=!0,window.parasorTerminalTrace={dump:X,dumpBottomRows:Hr,captureTerminalInput:Ur,clear:()=>{U=0,W=0,G=0,Cr.clear(),wr.clear(),Tr=0,Er.clear(),Dr=0},summary:Fr,kpi:()=>rr(X()),enabled:Y,enable:Mr,disable:Nr,flush:()=>{}})}function Q(e){if(!e)return;let t=typeof e.sessionId==`string`&&e.sessionId.length>0?e.sessionId:void 0,n=typeof e.paneId==`string`&&e.paneId.length>0?e.paneId:void 0;if(!(!t&&!n))return{...t?{sessionId:t}:{},...n?{paneId:n}:{}}}function zr(e,t){return!(t.sessionId&&e.sessionId!==t.sessionId||t.paneId&&e.paneId!==t.paneId)}function Br(e){let t=Q(e);if(t){let e=[...q].reverse().find(e=>zr(e.source,t))??null;return{entry:e,source:{status:e?`selected`:`missing`,requested:t,...e?{selected:e.source}:{}}}}let n=q.at(-1)??null;return{entry:n,source:{status:n?`selected`:`missing`,...n?{selected:n.source}:{}}}}function Vr(e){return typeof e==`number`?{rowCount:e}:typeof e==`object`&&e?{rowCount:typeof e.rowCount==`number`?e.rowCount:void 0,target:Q(e)}:{}}function Hr(e){let{rowCount:t,target:n}=Vr(e),{entry:r}=Br(n);return r?.provider(t)??null}function $(e,t){for(let n=e.length-1;n>=0;--n){let r=e[n]?.[t];if(typeof r==`string`&&r.length>0)return r}}async function Ur(e=`manual`,t){if(!Y())return{ok:!1,enabled:!1,skipped:`terminal-trace-disabled`};let n=await Kr(Wr(e,[],t));return n.json().catch(()=>({ok:n.ok}))}function Wr(e,t=[],n){Z();let r=[...X(),...t].slice(-gr),i=$(r,`sessionId`),a=Q(n)??Q({sessionId:i}),{entry:o,source:s}=Br(a),c=o?.provider(_r)??null;return{diagnostic:mr,reason:e,sessionId:a?.sessionId??s.selected?.sessionId??i,clientId:$(r,`clientId`),source:s,events:r,bottomRows:c}}function Gr(e,t=[]){Z();let n=[...X(),...t].slice(-gr);return{diagnostic:hr,reason:e,sessionId:$(n,`sessionId`),clientId:$(n,`clientId`),events:n,bottomRows:null}}function Kr(e){return $t(`/api/debug/terminal-trace/client-diagnostic`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})}function qr(e){if(typeof e!=`object`||!e)return null;let t=e,n=Array.isArray(t.rowsSampled)?t.rowsSampled.slice(-4).map(e=>{if(typeof e!=`object`||!e)return null;let t=e;return{line:t.line,viewportRow:t.viewportRow,text:t.text,attrRuns:t.attrRuns}}):[];return{cols:t.cols,rows:t.rows,cursorX:t.cursorX,cursorY:t.cursorY,viewportY:t.viewportY,baseY:t.baseY,renderer:t.renderer,rowsSampled:n}}function Jr(e){let t=e.events.at(-1);return JSON.stringify({reason:e.reason,sessionId:e.sessionId,clientId:e.clientId,eventType:t?.type,cols:t?.cols,rows:t?.rows,viewportY:t?.viewportY,baseY:t?.baseY,ptyResizeSent:t?.ptyResizeSent,ptyResizeSuppressedReason:t?.ptyResizeSuppressedReason,source:e.source,bottomRows:qr(e.bottomRows)})}function Yr(e){let t=e.events.at(-1);return JSON.stringify({reason:e.reason,eventType:t?.type,durationMs:t?.durationMs,delayMs:t?.delayMs,timeoutMs:t?.timeoutMs,routeKind:t?.routeKind,status:t?.status})}function Xr(e,t){if(typeof window>`u`||!Y()||Tr>=vr)return;let n=Wr(e,[{seq:G+1,t:J(),...t}]),r=Jr(n);wr.has(r)||(wr.add(r),Tr+=1,Kr(n).catch(()=>{}))}function Zr(e,t){if(typeof window>`u`||!Y()||Dr>=yr)return;let n=Gr(e,[{seq:G+1,t:J(),...t}]),r=Yr(n);Er.has(r)||(Er.add(r),Dr+=1,Kr(n).catch(()=>{}))}function Qr(e,t={}){Z();let n={provider:e,source:Q(t)??{}},r=q.findIndex(t=>t.provider===e);return r!==-1&&q.splice(r,1),q.push(n),()=>{let t=q.findIndex(t=>t.provider===e);t!==-1&&q.splice(t,1)}}function $r(e){let t=[[`driftMs`,fr],[`sinceReplayStartMs`,dr],[`durationMs`,ur],[`delayMs`,pr]];for(let[n,r]of t){let t=e[n];if(typeof t==`number`&&t>=r)return{warning:!0,warningMetric:n,warningThresholdMs:r}}return e.type.endsWith(`-timeout`)?{warning:!0,warningMetric:`timeoutMs`,warningThresholdMs:e.timeoutMs??0}:null}function ei(e,t={}){if(!Y())return;let n={t:J(),type:e,...t},r=$r(n),i=Lr({...n,...r});i&&Rr({seq:++G,...i})}function ti(e,t){if(!Y())return;let n=Lr({t:J(),type:e,...t()});n&&Rr({seq:++G,...n})}function ni(e){if(!Y())return()=>{};Z();let t=J()+ar,n=window.setInterval(()=>{let n=J(),r=n-t;t=n+ar,r>=or&&ei(`main-thread-drift`,{sessionId:e,driftMs:r})},ar);return()=>clearInterval(n)}export{_e as $,gt as A,Tt as B,en as C,_t as D,Ft as E,wt as F,Ee as G,jt as H,At as I,xe as J,we as K,Pt as L,St as M,bt as N,vt as O,Ct as P,pe as Q,Mt as R,$t as S,zt as T,Ot as U,kt as V,Oe as W,Se as X,Ce as Y,me as Z,on as _,ni as a,oe as at,Wt as b,ti as c,de as ct,I as d,b as dt,he as et,L as f,d as ft,j as g,c as gt,In as h,o as ht,Xr as i,ae as it,xt as j,yt as k,Qn as l,se as lt,Pn as m,u as mt,Qr as n,ce as nt,Pr as o,ue as ot,F as p,f as pt,Te as q,Zr as r,fe as rt,ei as s,le as st,Y as t,ge as tt,$n as u,ie as ut,un as v,Ut as w,Gt as x,rn as y,Nt as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{gt as e,mt as t,s as n}from"./terminal-trace-B9iHKCkB.js";var r=e(t(),1),i=120;function a(){let[e,t]=(0,r.useState)(0),[a,o]=(0,r.useState)(!1),s=(0,r.useRef)(0),c=(0,r.useRef)(0),l=(0,r.useRef)(null),u=(0,r.useRef)(0),d=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let e=window.visualViewport;if(!e)return;let r=()=>{l.current=null;let e=c.current,r=s.current,i=performance.now()-u.current;if(e===r){n(`virtual-keyboard-height-skip`,{height:e,previousHeight:r,durationMs:i,reason:`unchanged`});return}s.current=e,n(`virtual-keyboard-height-change`,{height:e,previousHeight:r,durationMs:i}),t(e)},a=()=>{d.current!==null&&(window.clearTimeout(d.current),d.current=null)},f=()=>{o(!0),a(),d.current=window.setTimeout(()=>{d.current=null,!(typeof window>`u`)&&(o(!1),n(`virtual-keyboard-settled`,{height:s.current,delayMs:i}))},i)},p=t=>{let i=window.innerHeight-e.height-e.offsetTop,a=i>1?Math.round(i):0;c.current=a,t&&f(),n(`virtual-keyboard-viewport-event`,{height:a,previousHeight:s.current,settling:t,skipped:l.current!==null}),l.current===null&&(u.current=performance.now(),l.current=window.requestAnimationFrame(r))};p(!1);let m=()=>p(!0);e.addEventListener(`resize`,m),e.addEventListener(`scroll`,m);let h=()=>{document.visibilityState===`visible`&&p(!0)};return document.addEventListener(`visibilitychange`,h),window.addEventListener(`focus`,h),()=>{e.removeEventListener(`resize`,m),e.removeEventListener(`scroll`,m),document.removeEventListener(`visibilitychange`,h),window.removeEventListener(`focus`,h),l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null),a()}},[]),{height:e,settling:a}}export{a as t};
|
package/web/index.html
CHANGED
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
})();
|
|
44
44
|
</script>
|
|
45
45
|
<style>html,body{background:var(--theme-editor-bg,#2E3033);color:var(--theme-editor-fg,#d3dbeb)}</style>
|
|
46
|
-
<script type="module" crossorigin src="/assets/index-
|
|
47
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
46
|
+
<script type="module" crossorigin src="/assets/index-CvefG2gF.js"></script>
|
|
47
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CvIpZExy.css">
|
|
48
48
|
</head>
|
|
49
49
|
<body>
|
|
50
50
|
<div id="root"></div>
|