@openchambery/web 1.17.1-beta.11 → 1.17.1-beta.13
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/dist/assets/{AgentAvatar-C6Hxu5_o.js → AgentAvatar-Coq-zdWI.js} +1 -1
- package/dist/assets/AssistantView-BXLxZXL5.js +1 -0
- package/dist/assets/{ChatContainer-CCyV53_o.js → ChatContainer-BJGlptbG.js} +22 -22
- package/dist/assets/DiagramView-Czx_DVw0.js +1 -0
- package/dist/assets/{FadeInOnReveal-CvNA_aGD.js → FadeInOnReveal-1KpYuooP.js} +1 -1
- package/dist/assets/{Icon-BPJ_quEe.js → Icon-Vc-aDche.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl-DswfuLC-.js → MarkdownRendererImpl-B9Bv95Vd.js} +2 -2
- package/dist/assets/MobileDetailNavigation-RupyXzPu.js +1 -0
- package/dist/assets/MobileShareBridge-LVT1_q5C.js +4 -0
- package/dist/assets/MobileSurface-BVwSEqn4.js +2 -0
- package/dist/assets/MultiRunWindow-C7hbEpv9.js +1 -0
- package/dist/assets/OnboardingScreen-CrekVj31.js +1 -0
- package/dist/assets/OverlayScrollbar-vZXoSFA9.js +1 -0
- package/dist/assets/SettingsView-C1sYcHr1.js +25 -0
- package/dist/assets/SettingsWindow-MtcqpoiN.js +1 -0
- package/dist/assets/TerminalView-DXQZlHNA.js +8 -0
- package/dist/assets/{ToolOutputDialog-IVZYEtTZ.js → ToolOutputDialog-_Qzdo46T.js} +1 -1
- package/dist/assets/appThemeRegistry-Chv6_pxq.js +2 -0
- package/dist/assets/{button-BmNJBT13.js → button-rDAIP5kY.js} +1 -1
- package/dist/assets/{collapsible-68IqWBM1.js → collapsible-nLeZm1kw.js} +1 -1
- package/dist/assets/{context-menu-m2Ep287d.js → context-menu-DeJdA9F6.js} +1 -1
- package/dist/assets/desktopHosts-RE7NIkeq.js +1 -0
- package/dist/assets/desktopRelayRestore-BzyaU7-i.js +1 -0
- package/dist/assets/{diagram-YN0GZ1Q0.js → diagram-C7qK82ZL.js} +1 -1
- package/dist/assets/dialog-DlUK6mj-.js +1 -0
- package/dist/assets/es-DMX-Uo1i.js +15 -0
- package/dist/assets/{fileQueries-i4oziMnC.js → fileQueries-D8m3PQr0.js} +1 -1
- package/dist/assets/{fr-jWNPO91J.js → fr-CSFYzSd8.js} +2 -2
- package/dist/assets/{gitApi-CwRDHIOl.js → gitApi-DV6F5KKI.js} +1 -1
- package/dist/assets/gitApiHttp-BswZXfrf.js +2 -0
- package/dist/assets/i18n-BAqcSln8.js +1 -0
- package/dist/assets/{input-BLVhPvhN.js → input-CxulMZ9j.js} +1 -1
- package/dist/assets/insertionBoundaries-7-TvMfgn.js +1 -0
- package/dist/assets/{ja-Dcb0VtDE.js → ja-C3eCimlB.js} +2 -2
- package/dist/assets/{ko-CX71xNDX.js → ko-gnciIU9a.js} +2 -2
- package/dist/assets/main-CADHVH9Y.js +172 -0
- package/dist/assets/main-q1V-_wWx.js +2 -0
- package/dist/assets/{markdown-worker-Cq3Twp1A.js → markdown-worker-DmBYud1m.js} +1 -1
- package/dist/assets/{markdownTheme-CCnvI6L0.js → markdownTheme-CNJf24L-.js} +1 -1
- package/dist/assets/miniChat-VXuyA8mS.js +2 -0
- package/dist/assets/mobile-CaKZM4y3.js +2 -0
- package/dist/assets/multirun-QqMnIbXa.js +4 -0
- package/dist/assets/persistence-CFtygeYy.js +3 -0
- package/dist/assets/{pl-mR_3Sqr8.js → pl-CNk6BfNS.js} +1 -1
- package/dist/assets/projectMeta-WJhNyk90.js +3 -0
- package/dist/assets/pt-BR-D4G-0rLj.js +15 -0
- package/dist/assets/radio-C1riLnF0.js +1 -0
- package/dist/assets/renderElectronMiniChatApp-CnmMV1o9.js +2 -0
- package/dist/assets/renderMobileApp-Bhe41b2q.js +23 -0
- package/dist/assets/runtimeConfig-D4ETkuTj.js +1 -0
- package/dist/assets/runtimeEndpointReset-GtJt8YhT.js +145 -0
- package/dist/assets/sortable-tabs-strip-Fiq5nrkF.js +1 -0
- package/dist/assets/src-DrgsP0XF.css +2 -0
- package/dist/assets/{store-oojlrF4d.js → store-CS6l6pH7.js} +3 -3
- package/dist/assets/{terminalApi-BYTA045F.js → terminalApi-MQ285A_s.js} +1 -1
- package/dist/assets/{tooltip-BYGBBTc2.js → tooltip-CbxKYhKv.js} +1 -1
- package/dist/assets/ui-D5j3JxkE.js +475 -0
- package/dist/assets/uk-BUry1gqt.js +15 -0
- package/dist/assets/{url-CGHw6D-E.js → url-BSalv2ov.js} +1 -1
- package/dist/assets/useAppFontEffects-CaGwli-K.js +7 -0
- package/dist/assets/{useAssistantUIStore-ESTV1mEY.js → useAssistantUIStore-DGtjM827.js} +1 -1
- package/dist/assets/useDesktopWindowControlsLayout-DCZXksMp.js +1 -0
- package/dist/assets/useEffectiveDirectory-CssNtlqg.js +1 -0
- package/dist/assets/{useFontPreferences-Bu4ME5hk.js → useFontPreferences-C7FEHFns.js} +1 -1
- package/dist/assets/useSessionAutoCleanup-B_mSwN7n.js +1 -0
- package/dist/assets/useUIStore-WQV8IuFw.js +1 -0
- package/dist/assets/{useWorkerHighlightedLines-BGHFpbvZ.js → useWorkerHighlightedLines-C74ZKDtw.js} +1 -1
- package/dist/assets/{utils-DyUyiLje.js → utils-Cwlw2GM0.js} +1 -1
- package/dist/assets/zh-CN-CJJZzHVW.js +15 -0
- package/dist/assets/zh-TW-DxhIXjND.js +15 -0
- package/dist/index.html +9 -9
- package/dist/mini-chat.html +9 -9
- package/dist/mobile.html +9 -9
- package/package.json +1 -1
- package/server/index.d.ts +2 -0
- package/server/index.js +8 -0
- package/server/lib/client-auth/pairing.js +7 -1
- package/server/lib/client-auth/pairing.test.js +45 -0
- package/server/lib/desktop-hosts/routes.js +152 -0
- package/server/lib/desktop-hosts/routes.test.js +194 -0
- package/server/lib/opencode/bootstrap-runtime.js +5 -0
- package/server/lib/opencode/core-routes.js +3 -0
- package/server/lib/opencode/core-routes.test.js +15 -0
- package/server/lib/opencode/openchamber-routes.js +10 -0
- package/server/lib/package-manager.js +3 -1
- package/server/lib/relay/DOCUMENTATION.md +43 -0
- package/server/lib/relay/host-client.js +4 -1
- package/server/lib/relay/service.js +4 -0
- package/server/lib/relay/tunnel-host.js +57 -4
- package/server/lib/relay/tunnel-host.test.js +250 -2
- package/dist/assets/AssistantView-CCYDEoHv.js +0 -1
- package/dist/assets/DiagramView-ClKA8FV3.js +0 -1
- package/dist/assets/MobileDetailNavigation-DLoODj_O.js +0 -1
- package/dist/assets/MobileShareBridge-CAc7AFue.js +0 -4
- package/dist/assets/MobileSurface-76JUp8KU.js +0 -2
- package/dist/assets/MultiRunWindow-DkKQaIfX.js +0 -1
- package/dist/assets/OnboardingScreen-CdvaEBtt.js +0 -1
- package/dist/assets/OverlayScrollbar-B-K9NJfL.js +0 -1
- package/dist/assets/SettingsView-zu_QFVkf.js +0 -25
- package/dist/assets/SettingsWindow-D2q5mZqr.js +0 -1
- package/dist/assets/TerminalView-BSkAxeUb.js +0 -8
- package/dist/assets/appThemeRegistry-b9Hk2IDb.js +0 -2
- package/dist/assets/clipboard-CXWbHCAk.js +0 -1
- package/dist/assets/desktopHosts-BpjUSDz4.js +0 -1
- package/dist/assets/desktopRelayRestore-BzUEk1i7.js +0 -1
- package/dist/assets/dialog-BV1ENlLf.js +0 -1
- package/dist/assets/es-EXZUX1sB.js +0 -15
- package/dist/assets/gitApiHttp-C1DaEMKR.js +0 -2
- package/dist/assets/insertionBoundaries-hP0Vo_9C.js +0 -1
- package/dist/assets/main-BLqbjxPt.js +0 -2
- package/dist/assets/main-C7LjTesY.js +0 -172
- package/dist/assets/miniChat-Cr9SuyZk.js +0 -2
- package/dist/assets/mobile-Bp-qiKtn.js +0 -2
- package/dist/assets/multirun-_rwgORX-.js +0 -4
- package/dist/assets/persistence-C_KCiMcY.js +0 -3
- package/dist/assets/projectMeta-7TXLLSNB.js +0 -3
- package/dist/assets/pt-BR-D1RpVOvC.js +0 -15
- package/dist/assets/radio-CDEqI-yy.js +0 -1
- package/dist/assets/renderElectronMiniChatApp-ChsEWTbg.js +0 -2
- package/dist/assets/renderMobileApp-B1pX9NK3.js +0 -23
- package/dist/assets/runtimeConfig-JSaYFA5x.js +0 -1
- package/dist/assets/runtimeEndpointReset-BS3Sd-xn.js +0 -145
- package/dist/assets/sortable-tabs-strip-DUk_Td2z.js +0 -1
- package/dist/assets/src-8zziWB78.css +0 -2
- package/dist/assets/uk-UvnVqWv-.js +0 -15
- package/dist/assets/useAppFontEffects-VKLeTcCY.js +0 -7
- package/dist/assets/useDesktopWindowControlsLayout-DLuCJzOs.js +0 -1
- package/dist/assets/useEffectiveDirectory-Bt1X5uGs.js +0 -1
- package/dist/assets/useMobileNavigationStore-DRbvzR8W.js +0 -475
- package/dist/assets/useSessionAutoCleanup-C8clHymf.js +0 -1
- package/dist/assets/useUIStore-D6BTB4va.js +0 -1
- package/dist/assets/zh-CN-9v-RC966.js +0 -15
- package/dist/assets/zh-TW-BZ_wZdC-.js +0 -15
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{$ as t,J as n,X as r,Y as i,Z as a,nt as o,rt as s}from"./vendor-base-ui-CnHfUmDN.js";import{n as c}from"./vendor-react-DLPElpoQ.js";import{n as l}from"./clipboard-CXWbHCAk.js";import{t as u}from"./utils-DyUyiLje.js";import{t as d}from"./SettingsView-zu_QFVkf.js";var f=c(),p=e(s(),1),m=o(),h=e=>{let o=(0,f.c)(19),{open:s,onOpenChange:c}=e,{t:h}=l(),_=p.useId(),v=g,y;o[0]===c?y=o[1]:(y=e=>{!e&&v()||c(e)},o[0]=c,o[1]=y);let b;o[2]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,m.jsx)(t,{className:u(`fixed inset-0 z-50 bg-black/50 dark:bg-black/75`,`transition-opacity duration-150 ease-out`,`data-[starting-style]:opacity-0 data-[ending-style]:opacity-0`)}),o[2]=b):b=o[2];let x;o[3]===Symbol.for(`react.memo_cache_sentinel`)?(x=u(`relative pointer-events-auto`,`w-[90vw] max-w-[1200px] h-[85vh] max-h-[900px]`,`rounded-xl border shadow-none overflow-hidden origin-center`,`bg-background`,`transition-all duration-150 ease-out`,`data-[starting-style]:opacity-0 data-[starting-style]:scale-[0.98]`,`data-[ending-style]:opacity-0 data-[ending-style]:scale-[0.98]`,`data-[nested-dialog-open]:brightness-[0.55] dark:data-[nested-dialog-open]:brightness-[0.4]`),o[3]=x):x=o[3];let S;o[4]===h?S=o[5]:(S=h(`settings.window.description`),o[4]=h,o[5]=S);let C;o[6]!==_||o[7]!==S?(C=(0,m.jsx)(a,{id:_,className:`sr-only`,children:S}),o[6]=_,o[7]=S,o[8]=C):C=o[8];let w;o[9]===c?w=o[10]:(w=(0,m.jsx)(d,{onClose:()=>c(!1),isWindowed:!0}),o[9]=c,o[10]=w);let T;o[11]!==_||o[12]!==C||o[13]!==w?(T=(0,m.jsxs)(i,{children:[b,(0,m.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center pointer-events-none`,children:(0,m.jsxs)(r,{"aria-describedby":_,className:x,children:[C,w]})})]}),o[11]=_,o[12]=C,o[13]=w,o[14]=T):T=o[14];let E;return o[15]!==s||o[16]!==y||o[17]!==T?(E=(0,m.jsx)(n,{open:s,onOpenChange:y,children:T}),o[15]=s,o[16]=y,o[17]=T,o[18]=E):E=o[18],E};function g(){return typeof document>`u`?!1:!!document.querySelector(`[data-slot="dropdown-menu-content"][data-open], [data-slot="select-content"][data-open]`)}export{h as SettingsWindow};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{c as t,s as n,t as r}from"./useUIStore-D6BTB4va.js";import{Xt as i,kn as a}from"./persistence-C_KCiMcY.js";import{nt as o,rt as s,tt as c}from"./vendor-base-ui-CnHfUmDN.js";import{o as l}from"./terminalApi-BYTA045F.js";import{n as u,r as d,t as f}from"./vendor-ghostty-web-HohRXr3g.js";import{n as ee,t as p}from"./clipboard-CXWbHCAk.js";import{l as m}from"./useMobileNavigationStore-DRbvzR8W.js";import{t as h}from"./utils-DyUyiLje.js";import{n as g}from"./Icon-BPJ_quEe.js";import{t as _}from"./button-BmNJBT13.js";import{n as v}from"./useThemeSystem-DMzWVJaW.js";import{i as y,t as b}from"./OverlayScrollbar-B-K9NJfL.js";import{n as te}from"./useRuntimeAPIs-DSLXJybW.js";import{n as x}from"./useEffectiveDirectory-Bt1X5uGs.js";import{t as S}from"./sortable-tabs-strip-DUk_Td2z.js";import{n as C,t as w}from"./useFontPreferences-Bu4ME5hk.js";import{r as T}from"./projectActions-CWvNGKfA.js";var E=e(s(),1);function ne(e){let{colors:t}=e,n=t.syntax.base;return{background:t.surface.background,foreground:n.foreground,cursor:t.interactive.cursor,cursorAccent:t.surface.background,selectionBackground:t.interactive.selection,selectionForeground:t.interactive.selectionForeground,selectionInactiveBackground:t.interactive.selection+`50`,black:t.surface.muted,red:t.status.error,green:t.status.success,yellow:t.status.warning,blue:n.function,magenta:n.keyword,cyan:n.type,white:n.foreground,brightBlack:n.comment,brightRed:t.status.error,brightGreen:t.status.success,brightYellow:t.status.warning,brightBlue:n.function,brightMagenta:n.keyword,brightCyan:n.type,brightWhite:t.surface.elevatedForeground}}function re(e,t,n,r,i=!1){return{cursorBlink:!1,cursorStyle:`bar`,fontSize:t,lineHeight:1.15,fontFamily:`${e}, "JetBrainsMonoNL Nerd Font", "FiraCode Nerd Font", "Cascadia Code PL", "Fira Code", "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "Courier New", monospace`,allowTransparency:!1,theme:{background:n.background,foreground:n.foreground,cursor:n.cursor,cursorAccent:n.cursorAccent,selectionBackground:n.selectionBackground,selectionForeground:n.selectionForeground,black:n.black,red:n.red,green:n.green,yellow:n.yellow,blue:n.blue,magenta:n.magenta,cyan:n.cyan,white:n.white,brightBlack:n.brightBlack,brightRed:n.brightRed,brightGreen:n.brightGreen,brightYellow:n.brightYellow,brightBlue:n.brightBlue,brightMagenta:n.brightMagenta,brightCyan:n.brightCyan,brightWhite:n.brightWhite},scrollback:1e4,ghostty:r,disableStdin:i}}var ie=e(c(),1),D=o(),O=null;function k(){return O||=d.load(),O}function ae(e){if(typeof window>`u`)return null;let t=[e,...Array.from(e.querySelectorAll(`*`))],n=null;for(let e of t){let t=window.getComputedStyle(e).overflowY;if(t===`auto`||t===`scroll`){if(e.scrollHeight-e.clientHeight>2)return e;n||=e}}return n}var oe=E.forwardRef(({sessionKey:e,chunks:t,onInput:n,onResize:r,theme:i,fontFamily:a,fontSize:o,className:s,enableTouchScroll:c,autoFocus:l=!0,isVisible:d=!0},m)=>{let{t:g}=ee(),_=E.useRef(null),v=E.useRef(null),y=E.useRef(null),te=E.useRef(null),x=E.useRef(n),S=E.useRef(r),C=E.useRef(null),w=E.useRef(``),T=E.useRef(null),ne=E.useRef(!1),O=E.useRef(null),oe=E.useRef(!0),A=E.useRef(null),j=E.useRef(null),se=E.useRef(0),ce=E.useRef(null),M=E.useRef(null),N=E.useRef(!1),P=E.useRef(!1),le=E.useRef(null),ue=E.useRef(null),de=E.useRef(null),F=E.useRef(``),fe=E.useRef(null),pe=E.useRef(!c),me=E.useRef(d),[,he]=E.useReducer(e=>e+1,0),[ge,_e]=E.useReducer(e=>e+1,0);x.current=n,S.current=r;let ve=typeof navigator<`u`&&(/Android/i.test(navigator.userAgent)||navigator.userAgentData?.platform===`Android`),I=!!c;E.useEffect(()=>{if(!c){pe.current=!0,me.current=d;return}!me.current&&d&&(pe.current=!1),me.current=d},[c,d]);let ye=E.useCallback(()=>{if(!I)return;let e=_.current,t=ce.current;if(!e)return;let n=[];e.getAttribute(`contenteditable`)===`true`&&n.push(e),n.push(...Array.from(e.querySelectorAll(`[contenteditable="true"]`))),n.forEach(e=>{e.setAttribute(`data-terminal-disabled-contenteditable`,`true`),e.setAttribute(`contenteditable`,`false`),e.setAttribute(`aria-hidden`,`true`),e.tabIndex=-1,e.style.setProperty(`caret-color`,`transparent`),e.style.color=`transparent`,e.style.setProperty(`-webkit-text-fill-color`,`transparent`),e.style.background=`transparent`,e.style.outline=`none`,e.style.boxShadow=`none`,e.style.textShadow=`none`,e.style.setProperty(`user-select`,`none`),e.style.setProperty(`-webkit-user-select`,`none`)}),e.tabIndex=-1,e.removeAttribute(`role`),e.removeAttribute(`aria-multiline`),Array.from(e.querySelectorAll(`textarea`)).forEach(e=>{e.style.setProperty(`caret-color`,`transparent`),e.style.color=`transparent`,e.style.setProperty(`-webkit-text-fill-color`,`transparent`),e.style.background=`transparent`,e.style.border=`0`,e.style.outline=`none`,e.style.boxShadow=`none`,e.style.textShadow=`none`,e.style.fontSize=`0`,e.style.lineHeight=`0`,e!==t&&e.getAttribute(`data-terminal-disabled-input`)!==`true`&&(e.setAttribute(`data-terminal-disabled-input`,`true`),e.setAttribute(`aria-hidden`,`true`),e.tabIndex=-1,e.disabled=!0,e.style.position=`absolute`,e.style.opacity=`0`,e.style.width=`0px`,e.style.height=`0px`,e.style.pointerEvents=`none`,e.style.zIndex=`-1`)})},[I]),L=E.useCallback(e=>{if(fe.current===e)return;let t=y.current;if(t)try{if(typeof t.setOption==`function`){t.setOption(`cursorBlink`,e),fe.current=e;return}t.options&&(t.options.cursorBlink=e,fe.current=e)}catch{}},[]),R=I&&ve,z=E.useCallback((e,t)=>{let n=R?M.current:ce.current,r=_.current;if(!n||!r)return;let i=r.getBoundingClientRect(),a=typeof window<`u`?window.innerWidth:i.width,o=typeof window<`u`?window.innerHeight:i.height,s=i.left+i.width/2,c=i.top+i.height-12,l=typeof e==`number`?e:s,u=typeof t==`number`?t:c,d=Math.max(8,Math.min(a-8,l)),f=Math.max(8,Math.min(o-8,u));n.style.left=`${d}px`,n.style.top=`${f}px`,n.style.bottom=``,(n instanceof HTMLTextAreaElement||n instanceof HTMLInputElement)&&(n.disabled=!1,n.readOnly=!1,n.removeAttribute(`disabled`),n.removeAttribute(`readonly`));try{n.focus({preventScroll:!0})}catch{try{n.focus()}catch{}}},[R]),B=E.useCallback(()=>{if(I){z(),L(!0);return}y.current?.focus(),L(!0)},[z,L,I]),V=E.useCallback(e=>e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement?e.value:e.textContent??``,[]),H=E.useCallback(e=>{if(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement){e.value=``;return}e.textContent=``},[]),be=E.useCallback(e=>{if(typeof window>`u`||R)return;de.current!==null&&(window.clearTimeout(de.current),de.current=null);let t=0,n=()=>{de.current=window.setTimeout(()=>{de.current=null;let r=V(e);if(!r){if(t+=1,t<3){n();return}return}let i=F.current;F.current=r;let a=r.startsWith(i)?r.slice(i.length):r;a&&x.current(a.replace(/\r\n|\r|\n/g,`\r`)),H(e),F.current=``},t===0?0:24)};n()},[H,V,R]);E.useEffect(()=>{let e=_.current;if(!I||!e||c)return;let t=t=>{let n=t.target;if(n&&n.getAttribute(`data-terminal-hidden-input`)!==`true`&&e.contains(n)){try{n.blur()}catch{}z()}};return e.addEventListener(`focusin`,t,!0),()=>{e.removeEventListener(`focusin`,t,!0)}},[c,I,z]);let U=E.useCallback(()=>{let e=y.current;if(!e||typeof e.getSelection!=`function`)return``;let t=e.getSelection();return typeof t==`string`?t:``},[]),xe=E.useCallback(()=>{if(typeof window>`u`)return``;let e=window.getSelection();if(!e)return``;let t=e.toString();if(!t.trim())return``;let n=_.current;if(!n)return``;let r=e.anchorNode,i=e.focusNode;return r&&!n.contains(r)||i&&!n.contains(i)?``:t},[]),Se=E.useCallback(async()=>{if(typeof document>`u`)return;let e=U()||xe();e.trim()&&await p(e)},[xe,U]),Ce=E.useCallback(()=>U().trim()?!0:!!xe().trim(),[xe,U]);E.useEffect(()=>{if(typeof window>`u`)return;let e=e=>{Ce()&&(e.preventDefault(),Se())};return window.addEventListener(`openchamber:copy`,e),()=>{window.removeEventListener(`openchamber:copy`,e)}},[Se,Ce]);let W=E.useCallback(()=>{w.current=``,T.current!==null&&typeof window<`u`&&window.cancelAnimationFrame(T.current),T.current=null,ne.current=!1,O.current=null},[]),G=E.useCallback(()=>{let e=te.current,t=y.current,n=_.current;if(!e||!t||!n)return;let r=n.getBoundingClientRect();if(!(r.width<24||r.height<24))try{e.fit();let n={cols:t.cols,rows:t.rows},r=C.current;(!r||r.cols!==n.cols||r.rows!==n.rows)&&(C.current=n,S.current(n.cols,n.rows))}catch{}},[]),K=E.useCallback(()=>{if(ne.current)return;let e=y.current;if(!e){W();return}if(!w.current)return;let t=w.current;w.current=``,ne.current=!0,e.write(t,()=>{ne.current=!1,w.current&&(typeof window<`u`?T.current=window.requestAnimationFrame(()=>{T.current=null,K()}):K())})},[W]),we=E.useCallback(()=>{T.current===null&&(typeof window<`u`?T.current=window.requestAnimationFrame(()=>{T.current=null,K()}):K())},[K]),q=E.useCallback(e=>{e&&(w.current+=e,we())},[we]),Te=E.useCallback(()=>{if(A.current?.(),A.current=null,j.current!==null&&typeof window<`u`&&(window.clearTimeout(j.current),j.current=null),!c){se.current=0;return}let e=_.current;if(!e)return;let t=y.current;if(!t)return;se.current=0;let n=2.2,r=2.8,i=.25,a=.05,s=.015,l={lastY:null,lastTime:null,velocity:0,rafId:null,startX:null,startY:null,didMove:!1},u=()=>typeof performance<`u`?performance.now():Date.now(),d=Math.max(12,Math.round(o*1.35)),f=0,ee=e=>{if(!e)return!1;let n=t.getViewportY(),r=f+e,i=Math.trunc(r/d);return f=r-i*d,i!==0&&t.scrollLines(i),t.getViewportY()!==n},p=()=>{l.rafId!==null&&typeof window<`u`&&window.cancelAnimationFrame(l.rafId),l.rafId=null},m={passive:!1,capture:!1};if(typeof window<`u`&&`PointerEvent`in window){let t=Object.assign(l,{pointerId:null,startX:null,startY:null,moved:!1}),o=n=>{if(n.pointerType===`touch`){p(),t.pointerId=n.pointerId,t.startX=n.clientX,t.startY=n.clientY,t.moved=!1,t.lastY=n.clientY,t.lastTime=u(),t.velocity=0;try{e.setPointerCapture(n.pointerId)}catch{}}},d=e=>{if(e.pointerType!==`touch`||t.pointerId!==e.pointerId)return;if(t.startX!==null&&t.startY!==null&&!t.moved){let n=e.clientX-t.startX,r=e.clientY-t.startY;Math.hypot(n,r)>=6&&(t.moved=!0)}if(t.lastY===null){t.lastY=e.clientY,t.lastTime=u();return}let a=t.lastY,o=t.lastTime??u(),s=u();t.lastY=e.clientY,t.lastTime=s;let c=a-e.clientY;if(Math.abs(c)<1)return;let l=Math.max(s-o,8),d=c*(n+Math.min(r,Math.abs(c)/25)),f=d/l;t.velocity=t.velocity*.75+f*i,t.velocity>8?t.velocity=8:t.velocity<-8&&(t.velocity=-8),t.moved&&(e.cancelable&&e.preventDefault(),e.stopPropagation()),ee(d)},f=n=>{if(n.pointerType!==`touch`||t.pointerId!==n.pointerId)return;let r=!t.moved;t.pointerId=null,t.startX=null,t.startY=null,t.moved=!1,t.lastY=null,t.lastTime=null;try{e.releasePointerCapture(n.pointerId)}catch{}if(r){I?z(n.clientX,n.clientY):c&&!pe.current&&(pe.current=!0,y.current?.focus());return}if(typeof window>`u`)return;if(Math.abs(t.velocity)<a){t.velocity=0;return}let i=u(),o=()=>{let e=u(),n=Math.max(e-i,8);i=e;let r=ee(t.velocity*n)??!1,c=Math.sign(t.velocity),l=Math.max(0,Math.abs(t.velocity)-s*n);if(t.velocity=l*c,!r||l<=a){p(),t.velocity=0;return}t.rafId=window.requestAnimationFrame(o)};t.rafId=window.requestAnimationFrame(o)};e.addEventListener(`pointerdown`,o,m),e.addEventListener(`pointermove`,d,m),e.addEventListener(`pointerup`,f,m),e.addEventListener(`pointercancel`,f,m);let h=e.style.touchAction,g=e.style.overscrollBehaviorY;e.style.touchAction=`none`,e.style.overscrollBehaviorY=`contain`,A.current=()=>{p(),j.current!==null&&typeof window<`u`&&(window.clearTimeout(j.current),j.current=null),se.current=0,e.removeEventListener(`pointerdown`,o,m),e.removeEventListener(`pointermove`,d,m),e.removeEventListener(`pointerup`,f,m),e.removeEventListener(`pointercancel`,f,m),e.style.touchAction=h,e.style.overscrollBehaviorY=g};return}let h=e=>{e.touches.length===1&&(p(),l.lastY=e.touches[0].clientY,l.lastTime=u(),l.velocity=0,l.startX=e.touches[0].clientX,l.startY=e.touches[0].clientY,l.didMove=!1)},g=e=>{if(e.touches.length!==1){l.lastY=null,l.lastTime=null,l.velocity=0,l.startX=null,l.startY=null,l.didMove=!1,p();return}let t=e.touches[0].clientX,a=e.touches[0].clientY;if(l.startX!==null&&l.startY!==null&&!l.didMove){let e=t-l.startX,n=a-l.startY;Math.hypot(e,n)>=6&&(l.didMove=!0)}if(l.lastY===null){l.lastY=a,l.lastTime=u();return}let o=l.lastY,s=l.lastTime??u(),c=u();l.lastY=a,l.lastTime=c;let d=o-a;if(Math.abs(d)<1)return;let f=Math.max(c-s,8),m=d*(n+Math.min(r,Math.abs(d)/25)),h=m/f;l.velocity=l.velocity*.75+h*i,l.velocity>8?l.velocity=8:l.velocity<-8&&(l.velocity=-8),l.didMove&&(e.preventDefault(),e.stopPropagation()),ee(m)},v=e=>{let t=!l.didMove;l.lastY=null,l.lastTime=null;let n=l.velocity;if(l.startX=null,l.startY=null,l.didMove=!1,t){let t=e.changedTouches?.[0];I?z(t?.clientX,t?.clientY):c&&!pe.current&&(pe.current=!0,y.current?.focus());return}if(typeof window>`u`)return;if(Math.abs(n)<a){l.velocity=0;return}let r=u(),i=()=>{let e=u(),t=Math.max(e-r,8);r=e;let n=ee(l.velocity*t)??!1,o=Math.sign(l.velocity),c=Math.max(0,Math.abs(l.velocity)-s*t);if(l.velocity=c*o,!n||c<=a){p(),l.velocity=0;return}l.rafId=window.requestAnimationFrame(i)};l.rafId=window.requestAnimationFrame(i)};e.addEventListener(`touchstart`,h,m),e.addEventListener(`touchmove`,g,m),e.addEventListener(`touchend`,v,m),e.addEventListener(`touchcancel`,v,m);let b=e.style.touchAction,te=e.style.overscrollBehaviorY;e.style.touchAction=`none`,e.style.overscrollBehaviorY=`contain`,A.current=()=>{p(),j.current!==null&&typeof window<`u`&&(window.clearTimeout(j.current),j.current=null),se.current=0,e.removeEventListener(`touchstart`,h,m),e.removeEventListener(`touchmove`,g,m),e.removeEventListener(`touchend`,v,m),e.removeEventListener(`touchcancel`,v,m),e.style.touchAction=b,e.style.overscrollBehaviorY=te}},[c,I,z,o]);E.useEffect(()=>{let e=!1,t=null,n=null,r=null,s=[],l=null,d=null,ee=null,p=_.current;if(!p)return;if(p.tabIndex=I?-1:0,I){let e=p.focus.bind(p),t=p;t.focus=((...e)=>{z()}),ee=()=>{t.focus=e}}let m=()=>{L(!0)},h=()=>{L(!1)},g=e=>{let t=e.target;if(t&&p.contains(t)){if(I&&t instanceof HTMLElement){window.setTimeout(()=>{t.blur(),z()},0),L(!1);return}if(c&&!pe.current&&t instanceof HTMLElement){window.setTimeout(()=>{t.blur()},0),L(!1);return}L(!0);return}L(!1)},b=()=>{L(!1)},S=null;return(async()=>{try{let ee=await k();if(e)return;let g=re(a,o,i,ee,!1),_=new u(g);oe.current=!0,I&&(_.focus=()=>{});let b=_;if(typeof b.scrollToBottom==`function`){let e=b.scrollToBottom.bind(b);b.scrollToBottom=()=>{oe.current&&e()},l=()=>{b.scrollToBottom=e}}let C=new f;if(t=_,y.current=_,te.current=C,_.loadAddon(C),_.open(p),c){let e=_.renderer;if(e&&typeof e.renderScrollbar==`function`){let t=e.renderScrollbar.bind(e);e.renderScrollbar=()=>{},d=()=>{e.renderScrollbar=t}}}_e(),fe.current=!1,S=_.textarea??p.querySelector(`textarea`),S&&(S.addEventListener(`focus`,m),S.addEventListener(`blur`,h)),ye(),typeof MutationObserver<`u`&&(r=new MutationObserver(()=>{ye()}),r.observe(p,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`contenteditable`,`role`,`tabindex`,`aria-label`]}));let w=ae(p);w?(w.classList.add(`overlay-scrollbar-target`,`overlay-scrollbar-container`),v.current=w,he()):v.current=null,G();let T=C;typeof T.observeResize==`function`&&T.observeResize(),Te(),s=[_.onData(e=>{x.current(e)}),_.onScroll(e=>{if(typeof e==`number`&&Number.isFinite(e)){let t=typeof _.hasSelection==`function`&&_.hasSelection();oe.current=!t&&e<=.5}}),_.onSelectionChange(()=>{if(typeof _.hasSelection==`function`&&_.hasSelection()){oe.current=!1;return}let e=typeof _.getViewportY==`function`?_.getViewportY():0;oe.current=e<=.5})],n=new ResizeObserver(()=>{G()}),n.observe(p),typeof window<`u`&&window.setTimeout(()=>{G()},0)}catch{}})(),document.addEventListener(`focusin`,g,!0),window.addEventListener(`blur`,b),()=>{e=!0,A.current?.(),A.current=null,document.removeEventListener(`focusin`,g,!0),window.removeEventListener(`blur`,b),s.forEach(e=>e.dispose()),l?.(),l=null,d?.(),d=null,S&&(S.removeEventListener(`focus`,m),S.removeEventListener(`blur`,h)),n?.disconnect(),r?.disconnect(),ee?.(),t?.dispose(),y.current=null,te.current=null,v.current=null,C.current=null,fe.current=null,W()}},[ye,c,G,z,a,o,Te,i,W,L,I]),E.useEffect(()=>{let e=y.current;e&&(e.reset(),W(),C.current=null,G())},[e,ge,G,W]),E.useEffect(()=>{l&&y.current&&B()},[l,B,e,ge]),E.useEffect(()=>(Te(),()=>{A.current?.(),A.current=null}),[Te,e]),E.useEffect(()=>{let e=y.current;if(!e)return;if(t.length===0){O.current!==null&&(e.reset(),W(),G());return}let n=O.current,r;if(n===null)r=t;else{let e=t.findIndex(e=>e.id===n);r=e>=0?t.slice(e+1):t}r.length>0&&q(r.map(e=>e.data).join(``)),O.current=t[t.length-1].id},[t,ge,q,G,W]),E.useImperativeHandle(m,()=>({focus:()=>{B()},clear:()=>{let e=y.current;e&&(e.reset(),W(),G())},fit:()=>{G()}}),[B,G,W]);let J=E.useCallback(e=>{if(!I)return;let t=_.current,n=e.relatedTarget,r=n?.tagName;r===`INPUT`||r===`TEXTAREA`||n?.isContentEditable,n?.getAttribute(`data-terminal-hidden-input`),n&&t?.contains(n)},[I]),Y=E.useCallback(e=>{let t=e.nativeEvent,n=t?.inputType??``,r=typeof t?.data==`string`?t.data:``;if(ue.current=typeof performance<`u`?performance.now():Date.now(),n===`insertCompositionText`){N.current=!0;return}if(!n&&r){if(N.current)return;e.preventDefault(),x.current(r),le.current={type:`insertText`,at:typeof performance<`u`?performance.now():Date.now()},P.current=!0;return}if(n===`insertText`&&r){if(N.current)return;e.preventDefault(),x.current(r),le.current={type:n,at:typeof performance<`u`?performance.now():Date.now()},P.current=!0;return}if(n===`insertLineBreak`){if(N.current)return;e.preventDefault(),x.current(`\r`),le.current={type:n,at:typeof performance<`u`?performance.now():Date.now()},P.current=!0;return}if(n===`deleteContentBackward`){if(N.current)return;e.preventDefault(),x.current(``),le.current={type:n,at:typeof performance<`u`?performance.now():Date.now()},P.current=!0}},[]),X=E.useCallback(e=>{let t=e.currentTarget;if(ue.current=typeof performance<`u`?performance.now():Date.now(),N.current)return;if(P.current){let e=le.current,n=typeof performance<`u`?performance.now():Date.now();if(e&&n-e.at<50){P.current=!1,H(t);return}P.current=!1}let n=V(t);if(!n)return;F.current=n;let r=n.replace(/\r\n|\r|\n/g,`\r`);x.current(r),H(t),F.current=``},[H,V]),Ee=E.useCallback(e=>{e.stopPropagation();let t=e.key.toLowerCase(),n=e.metaKey&&!e.ctrlKey&&!e.altKey&&t===`c`,r=e.ctrlKey&&e.shiftKey&&!e.metaKey&&!e.altKey&&t===`c`;if((n||r)&&Ce()){e.preventDefault(),Se();return}if(e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.length===1){let t=e.key.toUpperCase();if(t>=`A`&&t<=`Z`){e.preventDefault(),e.nativeEvent?.stopImmediatePropagation(),x.current(String.fromCharCode(t.charCodeAt(0)-64)),H(e.currentTarget);return}}if(e.altKey&&!e.ctrlKey&&!e.metaKey&&e.key.length===1){e.preventDefault(),e.nativeEvent?.stopImmediatePropagation(),x.current(`\x1B`+e.key),H(e.currentTarget);return}let i={ArrowUp:`\x1B[A`,ArrowDown:`\x1B[B`,ArrowRight:`\x1B[C`,ArrowLeft:`\x1B[D`,Escape:`\x1B`,Tab:` `,Delete:`\x1B[3~`,Home:`\x1B[H`,End:`\x1B[F`}[e.key];if(i){e.preventDefault(),x.current(i),H(e.currentTarget);return}let a=e.currentTarget;if(e.nativeEvent?.isComposing)return;let o=le.current,s=typeof performance<`u`?performance.now():Date.now(),c=!!(o&&s-o.at<50);if(e.key===`Enter`){if(c&&o?.type===`insertLineBreak`)return;e.preventDefault(),x.current(`\r`),H(a);return}if(e.key===`Backspace`){if(e.preventDefault(),c&&o?.type===`deleteContentBackward`)return;V(a)||x.current(``)}if(e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let t=ue.current;t&&s-t<50||(e.preventDefault(),x.current(e.key),P.current=!0,le.current={type:`keydown-text`,at:s})}be(a)},[H,Se,Ce,V,be]),De=E.useCallback(e=>{e.stopPropagation();let t=e.currentTarget;e.nativeEvent?.isComposing||be(t)},[be]),Oe=E.useCallback(e=>{let t=e.currentTarget;N.current=!1;let n=e.data||V(t);if(ue.current=typeof performance<`u`?performance.now():Date.now(),!n)return;let r=n.replace(/\r\n|\r|\n/g,`\r`);x.current(r),H(t),le.current={type:`compositionend`,at:typeof performance<`u`?performance.now():Date.now()},P.current=!0},[H,V]),ke=E.useCallback(e=>{e.stopPropagation();let t=e.clipboardData?.getData(`text`)??``;if(!t)return;e.preventDefault();let n=y.current?.hasBracketedPaste?.()?`\x1b[200~${t}\x1b[201~`:t;x.current(n)},[]),Ae={position:`fixed`,left:0,top:0,width:1,height:1,opacity:0,zIndex:-1,background:`transparent`,color:`transparent`,WebkitTextFillColor:`transparent`,caretColor:`transparent`,textShadow:`none`,WebkitAppearance:`none`,appearance:`none`,resize:`none`,overflow:`hidden`,whiteSpace:`nowrap`,border:`0`,padding:0,margin:0,outline:`none`,outlineOffset:0,fontSize:16,fontWeight:400,pointerEvents:`none`,WebkitUserSelect:`none`,userSelect:`none`};return(0,D.jsxs)(`div`,{ref:_,className:h(`relative h-full w-full terminal-viewport-container`,s),"data-hidden-input-overlay-active":I?`true`:void 0,style:{backgroundColor:i.background},onTouchStart:e=>{if(!(!I||c)&&!Ce()){let t=e.touches?.[0];z(t?.clientX,t?.clientY)}},onClick:e=>{if(!c)if(I){if(Ce())return;z(e.clientX,e.clientY)}else y.current?.focus()},onMouseUp:()=>{!c&&Ce()&&Se()},onTouchEnd:()=>{!c&&Ce()&&Se()},children:[I&&typeof document<`u`?(0,ie.createPortal)((0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`input`,{ref:M,type:`text`,inputMode:`text`,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,tabIndex:-1,enterKeyHint:`send`,"data-terminal-hidden-input":`true`,"aria-label":g(`terminalView.viewport.inputAria`),"aria-hidden":`true`,style:{...Ae,display:R?`block`:`none`},onBlur:J,onBeforeInput:Y,onCompositionStart:()=>{N.current=!0},onInput:X,onKeyDown:Ee,onKeyUp:De,onCompositionEnd:Oe,onPaste:ke}),(0,D.jsx)(`textarea`,{ref:ce,inputMode:`text`,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,tabIndex:-1,enterKeyHint:`send`,"data-terminal-hidden-input":`true`,"aria-label":g(`terminalView.viewport.inputAria`),"aria-hidden":`true`,style:{...Ae,display:R?`none`:`block`},onBlur:J,onBeforeInput:Y,onCompositionStart:()=>{N.current=!0},onInput:X,onKeyDown:Ee,onKeyUp:De,onCompositionEnd:Oe,onPaste:ke})]}),document.body):null,v.current&&!c?(0,D.jsx)(b,{containerRef:v,disableHorizontal:!0,className:`overlay-scrollbar--flush overlay-scrollbar--dense overlay-scrollbar--zero`}):null]})});oe.displayName=`TerminalViewport`;var A=RegExp(`\x1B\\[[0-9;?]*[ -/]*[@-~]`,`g`),j=/(https?:\/\/(?:localhost|127\.0\.0\.1|0\.0\.0\.0|\[(?:::1|::)\])(?::\d{2,5})?(?:\/[^\s<>'"`]*)?)/gi,se=/(?:➜\s*(?:Local|Network):)|\b(?:local|network|loopback|serving|listening|available|ready|started|running|server|vite|webpack|next\.js|astro|sveltekit|nuxt)\b/i,ce=/Serving HTTP on .*? port (\d{2,5})/i,M=new Set([`.`,`,`,`;`,`:`,`!`,`?`]),N=e=>{let t=e;for(;t.length>0;){let e=t[t.length-1];if(e===`)`||e===`]`||e===`}`||e===`>`){let n=e===`)`?`(`:e===`]`?`[`:e===`}`?`{`:`<`,r=t.slice(0,-1);if((r.match(RegExp(`\\${n}`,`g`))||[]).length>(r.match(RegExp(`\\${e}`,`g`))||[]).length)break;t=r;continue}if(M.has(e)){t=t.slice(0,-1);continue}break}return t},P=e=>{let t=N(e);return t=t.replace(`0.0.0.0`,`127.0.0.1`),t=t.replace(`[::1]`,`127.0.0.1`),t=t.replace(`[::]`,`127.0.0.1`),t},le=e=>{if(!e)return null;let t=e.replace(A,``),n=t.match(ce);if(n?.[1]){let e=Number.parseInt(n[1],10);if(Number.isFinite(e)&&e>0&&e<=65535)return`http://127.0.0.1:${e}/`}let r=t.split(`
|
|
2
|
-
`);for(let e of r){if(!se.test(e))continue;let t=Array.from(e.matchAll(j));if(t.length!==0)return P((t.find(e=>{try{return!!new URL(P(e[1])).port}catch{return!1}})??t[0])[1])}return null},ue=async(e,t=1500)=>{if(!e||typeof window>`u`)return!1;let n;try{n=new URL(e)}catch{return!1}if(n.protocol!==`http:`&&n.protocol!==`https:`)return!1;let r=n.hostname.toLowerCase();if(r!==`localhost`&&r!==`127.0.0.1`&&r!==`0.0.0.0`&&r!==`::1`&&r!==`::`)return!1;let i=new AbortController,o=window.setTimeout(()=>i.abort(),t);try{let e=await a(`/api/system/probe-url`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({url:n.toString()}),cache:`no-store`,signal:i.signal});return e.ok?(await e.json().catch(()=>null))?.ok===!0:!1}catch{return!1}finally{window.clearTimeout(o)}},de={esc:`\x1B`,tab:` `,enter:`\r`,"arrow-up":`\x1B[A`,"arrow-down":`\x1B[B`,"arrow-left":`\x1B[D`,"arrow-right":`\x1B[C`},F={ctrl:`5`,cmd:`3`},fe={retry:{maxRetries:3,initialDelayMs:500,maxDelayMs:8e3},connectionTimeoutMs:1e4},pe={retry:{maxRetries:8,initialDelayMs:400,maxDelayMs:8e3},connectionTimeoutMs:15e3},me=(e,t)=>{if(t)switch(e){case`arrow-up`:return`\u001b[1;${F[t]}A`;case`arrow-down`:return`\u001b[1;${F[t]}B`;case`arrow-right`:return`\u001b[1;${F[t]}C`;case`arrow-left`:return`\u001b[1;${F[t]}D`}return de[e]??null},he=()=>{let{t:e}=ee(),{terminal:a,runtime:o}=te(),{currentTheme:s}=v(),{monoFont:c}=w(),u=r(e=>e.terminalFontSize),d=r(e=>e.bottomTerminalHeight),f=r(e=>e.isBottomTerminalExpanded),{isMobile:p,isTablet:b,hasTouchOnlyPointer:re}=y(),ie=p||b,O=(ie||re)&&o.platform===`web`,k=o.platform!==`vscode`,ae=r(e=>e.showTerminalQuickKeysOnDesktop),A=!i()&&(ie||ae),j=m(e=>e.currentSessionId),se=m(e=>e.newSessionDraft),ce=j!==null||se?.open===!0,M=x()??null,N=C(e=>e.sessions),P=C(e=>e.hasHydrated),de=C(e=>e.ensureDirectory),F=C(e=>e.createTab),he=C(e=>e.setActiveTab),ge=C(e=>e.closeTab),_e=C(e=>e.setTabSessionId),ve=C(e=>e.setTabLifecycle),I=C(e=>e.setConnecting),ye=C(e=>e.appendToBuffer),L=C(e=>e.setTabPreviewUrl),R=C(e=>e.clearBuffer),z=r(e=>e.openContextPreview),B=E.useMemo(()=>{if(M)return N.get(M)},[N,M]),V=E.useMemo(()=>B?k?B.activeTabId??B.tabs[0]?.id??null:B.tabs[0]?.id??null:null,[B,k]),H=E.useMemo(()=>{if(B)return V?B.tabs.find(e=>e.id===V)??B.tabs[0]:B.tabs[0]},[B,V]),be=E.useMemo(()=>(B?.tabs??[]).map(t=>({icon:(()=>{let e=t.iconKey?T[t.iconKey]??`terminal`:`terminal`;return(0,D.jsx)(g,{name:e,className:`h-4 w-4`})})(),id:t.id,label:t.label,title:t.label,closeLabel:e(`terminalView.tabs.closeTabTitle`)})),[B?.tabs,e]),U=H?.terminalSessionId??null,xe=H?.lifecycle??`idle`,Se=H?.bufferChunks??[],Ce=H?.isConnecting??!1,W=H?.previewUrl??null,[G,K]=E.useState(null),[we,q]=E.useState(!1),[Te,J]=E.useState(!1),[Y,X]=E.useState(null),[Ee,De]=E.useState(!1),[Oe,ke]=E.useState(0),Ae=E.useRef(null),je=E.useRef(null),Me=E.useRef(V),Ne=E.useRef(U),Pe=E.useRef(M),Fe=E.useRef(null),Ie=E.useRef(null),Le=E.useRef(!1),Re=E.useRef(!1),ze=E.useRef(null),Be=E.useRef(null),Ve=E.useRef(new Set),He=E.useRef(!1),Ue=E.useRef(``),We=E.useRef(new Set),Ge=E.useRef(0),Ke=E.useCallback(()=>{Ue.current=``,We.current.clear(),Ge.current+=1},[]),qe=E.useCallback(()=>{O||typeof document<`u`&&!document.hasFocus()||Fe.current?.focus()},[O]),Je=E.useCallback(()=>{O||Fe.current?.focus()},[O]);E.useEffect(()=>{if(!P||He.current)return;He.current=!0;let e=new Set;for(let[,t]of C.getState().sessions.entries())for(let n of t.tabs)n.terminalSessionId&&e.add(n.terminalSessionId);Ve.current=e},[P]);let Ye=r(e=>e.activeMainTab),Xe=r(e=>e.isBottomTerminalOpen),Ze=r(e=>e.setBottomTerminalOpen),Qe=r(e=>e.setBottomTerminalExpanded),$e=Ye===`terminal`,Z=$e||Xe,[et,tt]=E.useState(Z);E.useEffect(()=>{!Z||o.platform===`vscode`||l()},[Z,o.platform]),E.useEffect(()=>{Z&&tt(!0)},[Z]),E.useEffect(()=>{Re.current=Z},[Z]),E.useEffect(()=>{Ne.current=U},[U]),E.useEffect(()=>{Me.current=V,Ke()},[V,Ke]),E.useEffect(()=>{Pe.current=M},[M]),E.useEffect(()=>{!A&&Y!==null&&X(null)},[A,Y,X]),E.useEffect(()=>{!U&&Y!==null&&X(null)},[U,Y,X]);let Q=E.useCallback(()=>{Ae.current?.(),Ae.current=null,je.current=null,ze.current=null,J(!1)},[]);E.useEffect(()=>()=>{Q(),Ne.current=null},[Q]);let nt=E.useCallback((e,t,n)=>{if(!n)return;let r=`${Ue.current}${n}`.replace(/\r\n|\r/g,`
|
|
3
|
-
`),i=r.split(`
|
|
4
|
-
`),a=r.endsWith(`
|
|
5
|
-
`)?i.join(`
|
|
6
|
-
`):i.slice(0,-1).join(`
|
|
7
|
-
`);if(Ue.current=r.endsWith(`
|
|
8
|
-
`)?``:(i[i.length-1]??``).slice(-1024),!a)return;let o=le(a);if(!o||We.current.has(o))return;let s=Ge.current;We.current.add(o),ue(o).then(n=>{if(We.current.delete(o),!n||Ge.current!==s)return;let r=C.getState().getDirectoryState(e)?.tabs.find(e=>e.id===t);!r||r.previewUrlLocked||r.previewUrl===o||L(e,t,o,{locked:!1,autoOpened:!1})})},[L]),rt=E.useCallback((t,n,r,i=fe,o=!1)=>{if(je.current===r)return;Q(),je.current=r;let s=a.connect(r,{onEvent:i=>{if(je.current===r)switch(i.type){case`connected`:ze.current=r,I(t,n,!1),K(null),q(!1),J(!1),qe(),Be.current===r&&(Be.current=null,a.sendInput(r,`\r`).catch(()=>{}));break;case`reconnecting`:K(null),q(!1),J(!0);break;case`data`:i.data&&(ye(t,n,i.data),nt(t,n,i.data));break;case`exit`:{let r=typeof i.exitCode==`number`?i.exitCode:null,a=typeof i.signal==`number`?i.signal:null,o=!!(C.getState().getDirectoryState(t)?.tabs.find(e=>e.id===n))?.label?.startsWith(`Action:`);ye(t,n,e(`terminalView.stream.processExitedMessage`,{exitCodeSegment:r===null?``:e(`terminalView.stream.processExitedWithCode`,{exitCode:r}),signalSegment:a===null?``:e(`terminalView.stream.processExitedWithSignal`,{signal:a})})),ve(t,n,`exited`),_e(t,n,null),I(t,n,!1),K(o?null:e(`terminalView.error.sessionEnded`)),q(!1),J(!1),Q();break}}},onError:(i,a)=>{if(je.current===r){if(!a){K(null),q(!1);return}if(/session not found/i.test(i.message)||o){J(!1),K(null),q(!1),I(t,n,!0),R(t,n),ve(t,n,`idle`),_e(t,n,null),Q();return}J(!1),K(e(`terminalView.error.connectionFailed`,{message:i.message})),q(!0),I(t,n,!1),R(t,n),ve(t,n,`exited`),_e(t,n,null),Q()}}},i);Ae.current=()=>{s.close(),je.current=null}},[ye,R,Q,qe,nt,I,ve,_e,e,a]);E.useEffect(()=>{let t=!1;if(!(!P||!et)){if(!M){K(e(ce?`terminalView.empty.noWorkingDirectory`:`terminalView.empty.selectSession`));return}return(async()=>{let n=M;if(!Pe.current||Pe.current!==n)return;de(n);let r=C.getState().getDirectoryState(n);if(!r||r.tabs.length===0)return;let i=k?r.activeTabId??r.tabs[0]?.id??null:r.tabs[0]?.id??null;if(!i)return;let o=r.tabs.find(e=>e.id===i)??r.tabs[0],s=o?.terminalSessionId??null,c=o?.lifecycle??`idle`,l=!!o?.label?.startsWith(`Action:`),u=(o?.bufferLength??0)>0||(o?.bufferChunks?.length??0)>0;if(s)return;if(c===`exited`){I(n,i,!1);return}if(l&&u){I(n,i,!1);return}let d=Ie.current;if(!(!d&&Re.current)){K(null),q(!1),J(!1),I(n,i,!0);try{let e=await a.createSession({cwd:n,cols:d?.cols,rows:d?.rows});if(!(!t&&Pe.current===n&&Me.current===i)){try{await a.close(e.sessionId)}catch{}return}if(C.getState().getDirectoryState(n)?.tabs.find(e=>e.id===i)?.terminalSessionId){try{await a.close(e.sessionId)}catch{}return}_e(n,i,e.sessionId)}catch(r){t||(K(r instanceof Error?r.message:e(`terminalView.error.startSessionFailed`)),q(!0),J(!1),I(n,i,!1))}}})(),()=>{t=!0}}},[ce,M,U,xe,V,et,Oe,k,P,de,I,_e,e,a]);let it=E.useRef(rt);it.current=rt;let at=E.useRef(Q);at.current=Q,E.useEffect(()=>{if(!P||!et)return;if(!M){at.current();return}let e=M,t=C.getState().getDirectoryState(e);if(!t||t.tabs.length===0){at.current();return}let n=k?t.activeTabId??t.tabs[0]?.id??null:t.tabs[0]?.id??null;if(!n){at.current();return}let r=t.tabs.find(e=>e.id===n)??t.tabs[0],i=r?.terminalSessionId??null;if(!i){at.current(),Ne.current=null;return}if(je.current===i&&Ae.current){Ne.current=i;return}Ne.current=i;let a=Ve.current.has(i),o=a&&(r?.bufferLength??0)===0&&(r?.bufferChunks?.length??0)===0;a&&Ve.current.delete(i),o&&(Be.current=i),it.current(e,n,i,a?pe:fe,a)},[M,U,V,k,et,P]),E.useEffect(()=>{if(!Z||O)return;if(typeof window>`u`){qe();return}let e=window.requestAnimationFrame(()=>{qe()});return()=>{window.cancelAnimationFrame(e)}},[V,qe,Z,O]);let ot=E.useCallback(async()=>{if(!M||Ee)return;let t=C.getState().getDirectoryState(M),n=k?V??t?.activeTabId??t?.tabs[0]?.id??null:t?.tabs[0]?.id??null;if(n){De(!0),K(null),q(!1),J(!1),Q(),R(M,n),Ke();try{await ge(M,n)}catch(t){K(t instanceof Error?t.message:e(`terminalView.error.restartFailed`)),q(!0),J(!1)}finally{De(!1)}}},[V,R,ge,Q,M,k,Ee,Ke,e]),st=E.useCallback(async()=>{await ot()},[ot]),ct=E.useCallback(()=>{if(!M)return;let e=F(M);he(M,e),K(null),q(!1),J(!1),Q()},[F,Q,M,he]),lt=E.useCallback(e=>{M&&(he(M,e),K(null),q(!1),J(!1),Q())},[Q,M,he]),ut=E.useCallback(e=>{M&&(e===V&&Q(),K(null),q(!1),J(!1),ge(M,e))},[V,ge,Q,M]),dt=E.useCallback(t=>{if(!t||Te)return;let n=t,r=!1;if(Y&&t.length>0){let e=t[0];if(e.length===1&&/[a-zA-Z]/.test(e)){let t=e.toUpperCase();(Y===`ctrl`||Y===`cmd`)&&(n=String.fromCharCode(t.charCodeAt(0)&31),r=!0)}r||=!0}let i=Ne.current;!i||ze.current!==i||(a.sendInput(i,n).catch(t=>{Te||K(t instanceof Error?t.message:e(`terminalView.error.sendInputFailed`))}),r&&(X(null),Je()))},[Y,Je,Te,X,e,a]),ft=E.useCallback((e,t)=>{let n=Ie.current;if((!n||n.cols!==e||n.rows!==t)&&(Ie.current={cols:e,rows:t}),Le.current||(Le.current=!0,ke(e=>e+1)),!Re.current)return;let r=Ne.current;!r||ze.current!==r||a.resize({sessionId:r,cols:e,rows:t}).catch(()=>{})},[a]),pt=E.useCallback(e=>{X(t=>t===e?null:e),Je()},[Je,X]),mt=E.useCallback(e=>{let t=me(e,Y);t&&(dt(t),X(null),Je())},[Y,Je,dt,X]);E.useEffect(()=>{if(!A||!Y||!U)return;let e=e=>{if(e.repeat)return;let t=e.key;if(!t||t===`Control`||t===`Meta`||t===`Alt`||t===`Shift`)return;let n=t.length===1?t.toLowerCase():t,r=e.code??``,i=r.startsWith(`Key`)&&r.length===4?r.slice(3).toUpperCase():null,a=t.length===1&&/[a-zA-Z]/.test(t)?t.toUpperCase():i,o={Tab:`tab`,Enter:`enter`,ArrowUp:`arrow-up`,ArrowDown:`arrow-down`,ArrowLeft:`arrow-left`,ArrowRight:`arrow-right`,Escape:`esc`,tab:`tab`,enter:`enter`,arrowup:`arrow-up`,arrowdown:`arrow-down`,arrowleft:`arrow-left`,arrowright:`arrow-right`,escape:`esc`};if(n in o){e.preventDefault(),e.stopPropagation(),mt(o[n]);return}if(Y===`ctrl`&&a&&a.length===1&&a>=`A`&&a<=`Z`){let t=String.fromCharCode(a.charCodeAt(0)&31);e.preventDefault(),e.stopPropagation(),dt(t),X(null),Je()}};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[Y,mt,dt,Je,A,X,U]);let ht=E.useMemo(()=>{let e=n[t].stack;if(typeof window>`u`)return(n[c]??n[`system-mono`]).stack;let r=window.getComputedStyle(document.documentElement).getPropertyValue(`--font-family-mono`);return r&&r.trim().length>0?r.trim():(n[c]??n[`system-mono`]).stack??e},[c]),gt=E.useMemo(()=>ne(s),[s]),_t=E.useMemo(()=>`${M??`no-dir`}::${V??`no-tab`}`,[M,V]);if(E.useEffect(()=>{if(!Z||O)return;let e=Fe.current;if(!e)return;let t=()=>{e.fit()};if(typeof window<`u`){let e=window.requestAnimationFrame(()=>{t(),qe()}),n=[220,400].map(e=>window.setTimeout(t,e));return()=>{window.cancelAnimationFrame(e),n.forEach(e=>window.clearTimeout(e))}}t()},[qe,Z,O,_t,U]),E.useEffect(()=>{if(O||!Z||!Xe)return;let e=Fe.current;if(!e)return;let t=()=>{e.fit()};if(typeof window<`u`){let e=window.requestAnimationFrame(()=>{t()}),n=[0,80,180,320].map(e=>window.setTimeout(t,e));return()=>{window.cancelAnimationFrame(e),n.forEach(e=>window.clearTimeout(e))}}t()},[d,f,Xe,Z,O]),!ce)return(0,D.jsx)(`div`,{className:`flex h-full items-center justify-center p-4 text-center text-sm text-muted-foreground`,children:e(`terminalView.empty.selectSession`)});if(!M)return(0,D.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 p-4 text-center text-sm text-muted-foreground`,children:[(0,D.jsx)(`p`,{children:e(`terminalView.empty.noWorkingDirectoryForSession`)}),(0,D.jsx)(`button`,{onClick:ot,className:`rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90`,children:e(`terminalView.actions.retry`)})]});let $=!U||Ce||Ee||Te,vt=et,yt=!ie&&Xe&&!$e,bt=(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 px-2 text-xs`,onClick:()=>mt(`esc`),disabled:$,children:e(`terminalView.quickKeys.escape`)}),(0,D.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 w-9 p-0`,onClick:()=>mt(`tab`),disabled:$,children:[(0,D.jsx)(g,{name:`arrow-right`,className:`h-4 w-4`}),(0,D.jsx)(`span`,{className:`sr-only`,children:e(`terminalView.quickKeys.tabAria`)})]}),(0,D.jsxs)(_,{type:`button`,size:`sm`,variant:`chip`,"aria-pressed":Y===`ctrl`,className:`h-6 w-9 p-0`,onClick:()=>pt(`ctrl`),disabled:$,children:[(0,D.jsx)(`span`,{className:`text-xs font-medium`,children:e(`terminalView.quickKeys.controlLabel`)}),(0,D.jsx)(`span`,{className:`sr-only`,children:e(`terminalView.quickKeys.controlModifierAria`)})]}),(0,D.jsxs)(_,{type:`button`,size:`sm`,variant:`chip`,"aria-pressed":Y===`cmd`,className:`h-6 w-9 p-0`,onClick:()=>pt(`cmd`),disabled:$,children:[(0,D.jsx)(g,{name:`command`}),(0,D.jsx)(`span`,{className:`sr-only`,children:e(`terminalView.quickKeys.commandModifierAria`)})]}),(0,D.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 w-9 p-0`,onClick:()=>mt(`arrow-up`),disabled:$,children:[(0,D.jsx)(g,{name:`arrow-up`}),(0,D.jsx)(`span`,{className:`sr-only`,children:e(`terminalView.quickKeys.arrowUpAria`)})]}),(0,D.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 w-9 p-0`,onClick:()=>mt(`arrow-left`),disabled:$,children:[(0,D.jsx)(g,{name:`arrow-left`}),(0,D.jsx)(`span`,{className:`sr-only`,children:e(`terminalView.quickKeys.arrowLeftAria`)})]}),(0,D.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 w-9 p-0`,onClick:()=>mt(`arrow-down`),disabled:$,children:[(0,D.jsx)(g,{name:`arrow-down`}),(0,D.jsx)(`span`,{className:`sr-only`,children:e(`terminalView.quickKeys.arrowDownAria`)})]}),(0,D.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 w-9 p-0`,onClick:()=>mt(`arrow-right`),disabled:$,children:[(0,D.jsx)(g,{name:`arrow-right`}),(0,D.jsx)(`span`,{className:`sr-only`,children:e(`terminalView.quickKeys.arrowRightAria`)})]}),(0,D.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 w-9 p-0`,onClick:()=>mt(`enter`),disabled:$,children:[(0,D.jsx)(g,{name:`arrow-go-back`}),(0,D.jsx)(`span`,{className:`sr-only`,children:e(`terminalView.quickKeys.enterAria`)})]})]});return(0,D.jsxs)(`div`,{"data-terminal-view":`true`,className:`flex h-full flex-col overflow-hidden bg-[var(--surface-background)]`,children:[(0,D.jsxs)(`div`,{className:h(`app-region-no-drag sticky top-0 z-20 shrink-0 bg-[var(--surface-background)] text-xs`,ie?`px-3 py-1.5`:`pl-3 pr-1.5 py-1`),children:[k&&B?(0,D.jsxs)(`div`,{className:`flex items-center gap-2 pl-1 pr-1`,children:[(0,D.jsx)(`div`,{className:h(`min-w-0 flex-1`,ie?`h-8`:`h-7`),children:(0,D.jsx)(S,{items:be,activeId:V,onSelect:lt,onClose:ut,layoutMode:`scrollable`,variant:`default`,className:`h-full bg-transparent`})}),(0,D.jsx)(_,{type:`button`,size:`xs`,variant:`ghost`,className:h(`shrink-0`,ie?`h-8 w-8 p-0`:`h-7 w-7 p-0`),onClick:ct,title:e(`terminalView.tabs.newTabTitle`),children:(0,D.jsx)(g,{name:`add`,className:`${ie?`h-[18px] w-[18px]`:`h-4 w-4`}`})}),(0,D.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 overflow-visible`,children:[W?(0,D.jsxs)(_,{type:`button`,size:`xs`,variant:`outline`,className:`h-6 shrink-0 gap-1 px-2`,onClick:()=>{M&&z(M,W)},title:e(`terminalView.preview.openTitle`),children:[(0,D.jsx)(g,{name:`global`,className:`h-3.5 w-3.5 shrink-0`}),(0,D.jsx)(`span`,{className:`whitespace-nowrap`,children:e(`terminalView.preview.open`)})]}):null,yt?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(_,{type:`button`,size:`xs`,variant:`ghost`,onClick:()=>Qe(!f),className:h(`shrink-0 p-0`,p?`h-8 w-8`:`h-7 w-7`),title:e(f?`terminalView.bottomDock.restoreTitle`:`terminalView.bottomDock.expandTitle`),"aria-label":e(f?`terminalView.bottomDock.restoreAria`:`terminalView.bottomDock.expandAria`),children:f?(0,D.jsx)(g,{name:`fullscreen-exit`,className:`h-4 w-4`}):(0,D.jsx)(g,{name:`fullscreen`,className:`h-4 w-4`})}),(0,D.jsx)(_,{type:`button`,size:`xs`,variant:`ghost`,onClick:()=>Ze(!1),className:h(`shrink-0 p-0`,p?`h-8 w-8`:`h-7 w-7`),title:e(`terminalView.bottomDock.closeTitle`),"aria-label":e(`terminalView.bottomDock.closeAria`),children:(0,D.jsx)(g,{name:`close`,className:`h-4 w-4`})})]}):null]})]}):null,!p&&A&&k&&B?(0,D.jsx)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1 pl-1 pr-1`,children:bt}):null,A&&(p||!k||!B)?(0,D.jsx)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1`,children:bt}):null]}),(0,D.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,style:{backgroundColor:gt.background},children:[(0,D.jsx)(`div`,{className:`h-full w-full box-border pl-4 pr-1.5 pt-3 pb-4`,children:vt?(0,D.jsx)(oe,{ref:e=>{Fe.current=e},sessionKey:_t,chunks:Se,onInput:dt,onResize:ft,theme:gt,fontFamily:ht,fontSize:u,enableTouchScroll:O,autoFocus:!O&&Z,isVisible:Z},_t):null}),!Te&&G&&(0,D.jsxs)(`div`,{className:`absolute inset-x-0 bottom-0 bg-[var(--status-error-background)] px-3 py-2 text-xs text-[var(--status-error-foreground)] flex items-center justify-between gap-2`,children:[(0,D.jsx)(`span`,{children:G}),we&&p&&(0,D.jsx)(_,{size:`sm`,variant:`secondary`,className:`h-6 px-2 py-0 text-xs`,onClick:st,disabled:Ee,title:e(`terminalView.actions.hardRestartTitle`),type:`button`,children:e(`terminalView.actions.hardRestart`)})]})]})]})};export{he as TerminalView};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownRendererImpl-DswfuLC-.js","assets/rolldown-runtime-C0FnF6B9.js","assets/useUIStore-D6BTB4va.js","assets/vendor-zustand-B4dlGEM2.js","assets/vendor-base-ui-CnHfUmDN.js","assets/persistence-C_KCiMcY.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-react-DLPElpoQ.js","assets/vendor-tanstack-query-core-BWz0ose6.js","assets/vendor-reactuses-core-DDoDDyM9.js","assets/vendor-lodash-es-DfLbG5Af.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/clipboard-CXWbHCAk.js","assets/store-oojlrF4d.js","assets/vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js","assets/useMobileNavigationStore-DRbvzR8W.js","assets/gitApiHttp-C1DaEMKR.js","assets/vendor-opencode-sdk-C07HQypa.js","assets/vendor-tanstack-react-query-D7pys_c9.js","assets/vendor-sonner-DVzioF3d.js","assets/useAssistantUIStore-ESTV1mEY.js","assets/vendor-fuse.js-DB5wDJbI.js","assets/utils-DyUyiLje.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/useThemeSystem-DMzWVJaW.js","assets/markdownTheme-CCnvI6L0.js","assets/vendor-pierre-diffs-BenIz2TM.js","assets/vendor-hast-util-to-html-B0p1k5Xa.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-DpDied8H.js","assets/useRuntimeAPIs-DSLXJybW.js","assets/url-CGHw6D-E.js","assets/markdown-worker-Cq3Twp1A.js","assets/useEffectiveDirectory-Bt1X5uGs.js","assets/FadeInOnReveal-CvNA_aGD.js","assets/vendor-morphdom-BbKiNDAu.js","assets/vendor-beautiful-mermaid-DykqIK5D.js","assets/vendor-marked-WVekxjAN.js","assets/vendor-remend-C3cXc-tf.js","assets/vendor-katex-CNGgSigB.js","assets/vendor-dompurify-CeJNOzik.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{nt as t,rt as n}from"./vendor-base-ui-CnHfUmDN.js";import{a as r,n as i,o as a}from"./vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js";import{n as o}from"./vendor-react-DLPElpoQ.js";import{n as s}from"./vendor-reactuses-core-DDoDDyM9.js";import{Co as c}from"./useMobileNavigationStore-DRbvzR8W.js";import{t as l}from"./utils-DyUyiLje.js";import{a as u,c as d,i as f}from"./markdown-worker-Cq3Twp1A.js";import{r as p}from"./vendor-pierre-diffs-BenIz2TM.js";var m=o(),h=e(n(),1),g=`openchamber:chunk-import-reload`,_=250,v=3e4,y=[/Importing a module script failed/i,/Failed to fetch dynamically imported module/i,/error loading dynamically imported module/i,/Loading chunk \S+ failed/i,/ChunkLoadError/i];function b(e){if(e instanceof Error)return`${e.name}\n${e.message}\n${e.stack??``}`;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function x(e){let t=b(e);return y.some(e=>e.test(t))}function ee(e){return`1.17.1-beta.11:${b(e).slice(0,500)}`}function S(e){if(typeof window>`u`)return;let t=Date.now(),n=ee(e),r=null;try{let e=window.sessionStorage.getItem(g);if(e)try{r=JSON.parse(e)}catch{r=null}}catch{return}let i=typeof r?.timestamp==`number`?r.timestamp:0;if(!(r?.signature===n&&t-i<v)){try{window.sessionStorage.setItem(g,JSON.stringify({signature:n,timestamp:t}))}catch{return}console.error(`[refresh-debug] chunk-import-reload`,{error:b(e).slice(0,1e3)}),window.setTimeout(()=>{window.location.reload()},0)}}async function te(e,t={}){let n=t.retries??1,r;for(let t=0;t<=n;t+=1)try{return await e()}catch(e){if(r=e,!x(e)||t>=n)break;await new Promise(e=>setTimeout(e,_*(t+1)))}throw x(r)&&S(r),r}var C=e=>(0,h.lazy)(()=>te(e)),w=`__openchamberMobileBackRoute`,T=()=>typeof window>`u`||c()?null:{currentState:()=>window.history.state&&typeof window.history.state==`object`?window.history.state:null,pushState:e=>window.history.pushState(e,``,window.location.href),back:()=>window.history.back(),subscribe:e=>{let t=t=>e(t.state&&typeof t.state==`object`?t.state:null);return window.addEventListener(`popstate`,t),()=>window.removeEventListener(`popstate`,t)}},E=e=>{let t=e?.[w];return typeof t==`number`&&Number.isFinite(t)?t:null},D=new class{routes=[];listeners=new Set;nextToken=1;history;removeHistoryListener=null;programmaticHistoryBackToken=null;pendingHistoryRemovals=new Map;animatedBackDriver=null;presentationCancelDriver=null;constructor(e=T()){this.history=e}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getTopRoute=()=>this.routes.at(-1)??null;register=e=>{let t=this.pendingHistoryRemovals.get(e.id);this.pendingHistoryRemovals.delete(e.id);let n=!!(this.history&&t!==void 0&&E(this.history.currentState())===t),r={...e,token:n&&t!==void 0?t:this.nextToken++};this.routes.push(r),this.ensureHistoryListener(),this.history&&!n&&this.history.pushState({...this.history.currentState()??{},[w]:r.token}),this.notify();let i=!0;return()=>{if(!i)return;i=!1;let e=this.routes.indexOf(r);e<0||(this.routes.splice(e,1),this.history&&E(this.history.currentState())===r.token?(this.pendingHistoryRemovals.set(r.id,r.token),queueMicrotask(()=>{if(this.pendingHistoryRemovals.get(r.id)===r.token){if(this.pendingHistoryRemovals.delete(r.id),!this.history||E(this.history.currentState())!==r.token){this.routes.length===0&&this.pendingHistoryRemovals.size===0&&this.disposeHistoryListener();return}this.programmaticHistoryBackToken=r.token,this.history.back(),this.routes.length===0&&this.pendingHistoryRemovals.size===0&&this.disposeHistoryListener()}})):this.routes.length===0&&this.pendingHistoryRemovals.size===0&&this.disposeHistoryListener(),this.notify())}};backImmediately=e=>{let t=this.getTopRoute();return!t||e&&t.layer!==e?!1:t.onBack()!==!1};requestAnimatedBack=e=>{let t=this.getTopRoute();return!t||e&&t.layer!==e?!1:this.animatedBackDriver?.(t)?!0:this.backImmediately(e)};setAnimatedBackDriver=e=>(this.animatedBackDriver=e,()=>{this.animatedBackDriver===e&&(this.animatedBackDriver=null)});setPresentationCancelDriver=e=>(this.presentationCancelDriver=e,()=>{this.presentationCancelDriver===e&&(this.presentationCancelDriver=null)});cancelPresentation=()=>{this.presentationCancelDriver?.()};requestBrowserBack=()=>{let e=this.getTopRoute();return e?this.history&&E(this.history.currentState())===e.token?(this.history.back(),!0):e.onBack()!==!1:!1};ensureHistoryListener(){!this.history||this.removeHistoryListener||(this.removeHistoryListener=this.history.subscribe(e=>{if(this.programmaticHistoryBackToken!==null){this.programmaticHistoryBackToken=null;return}let t=this.getTopRoute();t&&E(e)!==t.token&&t.onBack()===!1&&this.history&&this.history.pushState({...this.history.currentState()??{},[w]:t.token})}))}disposeHistoryListener(){this.removeHistoryListener?.(),this.removeHistoryListener=null,this.programmaticHistoryBackToken=null,this.pendingHistoryRemovals.clear()}notify(){this.listeners.forEach(e=>e())}},ne=e=>{let t=(0,m.c)(8),{id:n,active:r,layer:i,onBack:a,surfaceRef:o,underlayRef:c}=e,l=i===void 0?`root`:i,u=s(a),d,f;t[0]!==r||t[1]!==u||t[2]!==n||t[3]!==l||t[4]!==o||t[5]!==c?(d=()=>{if(r)return D.register({id:n,layer:l,onBack:u,getSurface:()=>o.current,getUnderlay:()=>c?.current??null})},f=[r,u,n,l,o,c],t[0]=r,t[1]=u,t[2]=n,t[3]=l,t[4]=o,t[5]=c,t[6]=d,t[7]=f):(d=t[6],f=t[7]),h.useEffect(d,f)},O=r(`OpenChamberNavigation`),k=e=>Math.min(1,Math.max(0,Number.isFinite(e)?e:0)),A=(e,t)=>!e||!t?!1:e.onBack()!==!1,j=e=>{let t=k(e.progress),n=e.commit?1-t:t;if(n<=.001)return 0;let r=Math.max(1,e.viewportWidth??390),i=Math.abs(e.velocityX??0)/r,a=n/Math.max(e.commit?2.4:2.8,i)*1e3,o=e.commit?90:100,s=e.commit?320:260;return Math.round(Math.min(s,Math.max(o,a)))},M=e=>{let{surface:t,underlay:n,surfaceTransition:r,surfaceAnimation:i,underlayTransition:a,underlayAnimation:o}=e;t.style.removeProperty(`transform`),t.style.removeProperty(`opacity`),t.style.removeProperty(`will-change`),t.style.removeProperty(`box-shadow`),t.style.transition=r,t.style.animation=i,n&&(n.style.removeProperty(`transform`),n.style.removeProperty(`opacity`),n.style.removeProperty(`will-change`),n.style.transition=a??``,n.style.animation=o??``)},N=(e,t)=>{let n=k(t),{surface:r}=e;r.style.transform=`translate3d(${n*100}%, 0, 0)`},re=e=>!e.surfaceConnected||e.topRouteToken!==e.routeToken||e.routeSurface!==e.outgoingSurface,ie=async(e,t,n,r)=>{if(!r&&typeof e.animate==`function`){let r=e.style.transform||`translate3d(0%, 0, 0)`,i=`translate3d(${t}%, 0, 0)`,a=e.animate([{transform:r},{transform:i}],{duration:n,easing:`cubic-bezier(0.22, 1, 0.36, 1)`,fill:`forwards`}),o=!1;try{await a.finished,o=!0}catch{}finally{o&&(e.style.transform=i),a.cancel()}return}e.style.transform=`translate3d(${t}%, 0, 0)`},ae=async(e,t,n=typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches,r=j({progress:Number.parseFloat(e.style.transform.match(/translate3d\(([-\d.]+)%/)?.[1]??`0`)/100,commit:t}))=>ie(e,t?100:0,r,n),oe=class{pending=0;enqueue(){this.pending+=1}take(){return this.pending!==0&&(--this.pending,!0)}clear(){this.pending=0}},se=e=>{let t=(0,m.c)(4),{enabled:n,rootRoutesBlocked:r}=e,a,o;t[0]!==n||t[1]!==r?(a=()=>{if(!n||!c()||i.getPlatform()===`web`)return;let e=!1,t=null,a=null,o=0,s=0,l=0,u=new oe,d=[],f=e=>!!e&&(!r||e?.layer===`overlay`),p=()=>{let e=f(D.getTopRoute());O.setEnabled({enabled:e}).catch(ce)},m=()=>{if(D.cancelPresentation(),a)return;let e=D.getTopRoute();if(!f(e))return;let n=e.getSurface();if(!n)return;n.getAnimations().forEach(le),a=null;let r=e.layer===`root`?e.getUnderlay():null,i=n.style.transition,o=n.style.animation,s=r?.style.transition??null,c=r?.style.animation??null;r?.getAnimations().forEach(P),n.style.transition=`none`,n.style.animation=`none`,n.style.willChange=`transform`,r&&(r.style.removeProperty(`transform`),r.style.removeProperty(`will-change`)),l+=1,t={route:e,surface:n,underlay:r,surfaceTransition:i,surfaceAnimation:o,underlayTransition:s,underlayAnimation:c},N(t,0)},h=e=>{s=k(e),!o&&(o=window.requestAnimationFrame(()=>{o=0,t&&N(t,s)}))},g=F,_=(n,r,i)=>{if(a)return n&&f(D.getTopRoute())?(u.enqueue(),!0):!1;o&&=(window.cancelAnimationFrame(o),0),t||m(),t&&r!==void 0&&N(t,r);let c=t,d=l;if(t=null,!c){if(!n)return!1;let e=D.getTopRoute();return A(e,f(e))}a=c;let p=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1,h=j({progress:k(r??s),commit:n,velocityX:i,viewportWidth:window.innerWidth});return ae(c.surface,n,p,h).then(async()=>{d===l&&(!e&&n&&(c.route.onBack(),await g(c)),d===l&&(M(c),a===c&&(a=null),!e&&u.take()&&_(!0,0,0)))}),!0},v=D.setAnimatedBackDriver(e=>e!==D.getTopRoute()||!f(e)?!1:_(!0,0,0)),y=D.subscribe(p);return(async()=>{let t=await O.addListener(`backStarted`,m),n=await O.addListener(`backProgressed`,e=>h(e.progress??0)),r=await O.addListener(`backCancelled`,e=>_(!1,e.progress,e.velocityX)),i=await O.addListener(`backInvoked`,e=>_(!0,e.progress,e.velocityX));if(e){await Promise.all([t.remove(),n.remove(),r.remove(),i.remove()]);return}d.push(t,n,r,i),p()})().catch(I),p(),()=>{e=!0,l+=1,u.clear(),y(),v(),o&&window.cancelAnimationFrame(o),t&&M(t),a&&(a.surface.getAnimations().forEach(L),a.underlay?.getAnimations().forEach(R),M(a)),t=null,a=null,O.setEnabled({enabled:!1}).catch(z),d.forEach(B)}},o=[n,r],t[0]=n,t[1]=r,t[2]=a,t[3]=o):(a=t[2],o=t[3]),h.useEffect(a,o)};function ce(){}function le(e){return e.cancel()}function P(e){return e.cancel()}function F(e){return new Promise(t=>{let n=0,r=12,i=!1,a=()=>{i||(i=!0,c(),n&&window.cancelAnimationFrame(n),t())},o=()=>{let t=D.getTopRoute();return re({surfaceConnected:e.surface.isConnected,routeToken:e.route.token,topRouteToken:t?.token??null,routeSurface:e.route.getSurface(),outgoingSurface:e.surface})},s=()=>{if(o()||r<=0){a();return}--r,n=window.requestAnimationFrame(s)},c=D.subscribe(()=>{o()&&a()});s()})}function I(){}function L(e){return e.cancel()}function R(e){return e.cancel()}function z(){}function B(e){e.remove()}var V=null,H=()=>(V??=a(()=>import(`./MarkdownRendererImpl-DswfuLC-.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47])).catch(e=>{throw V=null,e}),V),U=()=>{H().catch(()=>void 0)},W=h.createContext(!0),G=()=>h.useContext(W),K=t(),ue=C(()=>H().then(e=>({default:e.MarkdownRenderer}))),de=C(()=>H().then(e=>({default:e.SimpleMarkdownRenderer}))),fe=e=>e===`tool`?`markdown-content markdown-tool`:e===`reasoning`?`markdown-content markdown-reasoning`:`markdown-content leading-relaxed`,q=e=>{let t=(0,m.c)(14),n=typeof e.content==`string`?e.content:``,r=typeof e.variant==`string`?e.variant:`assistant`,i;t[0]!==n||t[1]!==e.reserveMeasuredHeight||t[2]!==r?(i=e.reserveMeasuredHeight?u(f(n,r)):void 0,t[0]=n,t[1]=e.reserveMeasuredHeight,t[2]=r,t[3]=i):i=t[3];let a=i,o;t[4]!==e.className||t[5]!==e.variant?(o=l(`relative break-words w-full min-w-0`,fe(e.variant),typeof e.className==`string`?e.className:void 0),t[4]=e.className,t[5]=e.variant,t[6]=o):o=t[6];let s;t[7]!==n||t[8]!==e.animated||t[9]!==a?(s=(0,K.jsx)(d,{animated:e.animated,content:n,reservedHeight:a}),t[7]=n,t[8]=e.animated,t[9]=a,t[10]=s):s=t[10];let c;return t[11]!==o||t[12]!==s?(c=(0,K.jsx)(`div`,{className:o,"aria-busy":`true`,"data-markdown-hydration":`deferred`,children:s}),t[11]=o,t[12]=s,t[13]=c):c=t[13],c},pe=e=>{let t=(0,m.c)(4);if(!G()&&e.isStreaming!==!0){let n;return t[0]===e?n=t[1]:(n=(0,K.jsx)(q,{...e,animated:!1,reserveMeasuredHeight:!0}),t[0]=e,t[1]=n),n}let n;return t[2]===e?n=t[3]:(n=(0,K.jsx)(h.Suspense,{fallback:(0,K.jsx)(q,{...e,reserveMeasuredHeight:!0}),children:(0,K.jsx)(ue,{...e})}),t[2]=e,t[3]=n),n},me=e=>{let t=(0,m.c)(4);if(!G()){let n;return t[0]===e?n=t[1]:(n=(0,K.jsx)(q,{...e,animated:!1}),t[0]=e,t[1]=n),n}let n;return t[2]===e?n=t[3]:(n=(0,K.jsx)(h.Suspense,{fallback:(0,K.jsx)(q,{...e}),children:(0,K.jsx)(de,{...e})}),t[2]=e,t[3]=n),n},he=e=>/^#[0-9a-fA-F]{6}$/.test(e),ge=e=>/^#[0-9a-fA-F]{8}$/.test(e),_e=(e,t)=>/^[0-9a-fA-F]{2}$/.test(t)?he(e)?`${e}${t}`:ge(e)?`${e.slice(0,7)}${t}`:e:e,J=(e,t)=>typeof e==`string`&&e.trim().length>0?e:t,Y=e=>{let t=e.colors.syntax.base,n=e.colors.syntax.tokens??{},r=(e,t)=>J(n[e],t);return[{name:`plain`,scope:[`source`,`support.type.property-name.css`],settings:{foreground:t.foreground}},{name:`classes`,scope:[`entity.name.type.class`],settings:{foreground:r(`className`,r(`class`,t.function))}},{name:`interfaces`,scope:[`entity.name.type.interface`,`entity.name.type`],settings:{foreground:r(`interface`,t.type)}},{name:`structs`,scope:[`entity.name.type.struct`],settings:{foreground:r(`struct`,t.function)}},{name:`enums`,scope:[`entity.name.type.enum`],settings:{foreground:r(`enum`,t.function)}},{name:`keys`,scope:[`meta.object-literal.key`,`support.type.property-name`],settings:{foreground:r(`key`,t.function)}},{name:`methods`,scope:[`entity.name.function.method`,`meta.function.method`],settings:{foreground:r(`method`,e.colors.status.success)}},{name:`functions`,scope:[`entity.name.function`,`support.function`,`meta.function-call.generic`],settings:{foreground:t.function,fontStyle:`bold`}},{name:`variables`,scope:[`variable`,`meta.variable`,`variable.other.object.property`],settings:{foreground:t.variable}},{name:`variablesOther`,scope:[`variable.other.object`,`variable.other.readwrite.alias`],settings:{foreground:r(`variableOther`,r(`method`,e.colors.status.success))}},{name:`globalVariables`,scope:[`variable.other.global`,`variable.language.this`],settings:{foreground:r(`variableGlobal`,t.number)}},{name:`localVariables`,scope:[`variable.other.local`],settings:{foreground:r(`variableLocal`,e.colors.surface.elevated)}},{name:`parameters`,scope:[`variable.parameter`,`meta.parameter`],settings:{foreground:r(`parameter`,t.foreground)}},{name:`properties`,scope:[`variable.other.property`,`meta.property`],settings:{foreground:r(`variableProperty`,e.colors.status.info)}},{name:`strings`,scope:[`string`,`string.other.link`,`markup.inline.raw.string.markdown`],settings:{foreground:t.string}},{name:`stringEscapeSequences`,scope:[`constant.character.escape`,`constant.other.placeholder`],settings:{foreground:r(`stringEscape`,t.foreground)}},{name:`keywords`,scope:[`keyword`],settings:{foreground:t.keyword}},{name:`keywordsControl`,scope:[`keyword.control.import`,`keyword.control.from`,`keyword.import`],settings:{foreground:r(`keywordImport`,t.operator)}},{name:`storageModifiers`,scope:[`storage.modifier`,`keyword.modifier`,`storage.type`],settings:{foreground:r(`storageModifier`,t.keyword)}},{name:`comments`,scope:[`comment`,`punctuation.definition.comment`],settings:{foreground:t.comment}},{name:`docComments`,scope:[`comment.documentation`,`comment.line.documentation`],settings:{foreground:r(`commentDoc`,e.colors.surface.mutedForeground)}},{name:`numbers`,scope:[`constant.numeric`],settings:{foreground:t.number}},{name:`booleans`,scope:[`constant.language.boolean`,`constant.language.json`],settings:{foreground:r(`boolean`,t.type)}},{name:`operators`,scope:[`keyword.operator`],settings:{foreground:t.operator}},{name:`macros`,scope:[`entity.name.function.preprocessor`,`meta.preprocessor`],settings:{foreground:r(`macro`,t.keyword)}},{name:`preprocessor`,scope:[`meta.preprocessor`],settings:{foreground:r(`preprocessor`,r(`label`,t.number))}},{name:`urls`,scope:[`markup.underline.link`],settings:{foreground:r(`url`,e.colors.status.info)}},{name:`tags`,scope:[`entity.name.tag`],settings:{foreground:r(`tag`,t.keyword)}},{name:`jsxTags`,scope:[`support.class.component`],settings:{foreground:r(`jsxTag`,r(`label`,t.number))}},{name:`attributes`,scope:[`entity.other.attribute-name`,`meta.attribute`],settings:{foreground:r(`tagAttribute`,t.type)}},{name:`types`,scope:[`support.type`],settings:{foreground:t.type}},{name:`constants`,scope:[`variable.other.constant`,`variable.readonly`],settings:{foreground:r(`constant`,t.foreground)}},{name:`labels`,scope:[`entity.name.label`,`punctuation.definition.label`],settings:{foreground:r(`label`,r(`variableGlobal`,t.number))}},{name:`namespaces`,scope:[`entity.name.namespace`,`storage.modifier.namespace`,`markup.bold.markdown`],settings:{foreground:r(`namespace`,t.type)}},{name:`modules`,scope:[`entity.name.module`,`storage.modifier.module`],settings:{foreground:r(`module`,t.operator)}},{name:`typeParameters`,scope:[`variable.type.parameter`,`variable.parameter.type`],settings:{foreground:r(`typeParameter`,t.function)}},{name:`exceptions`,scope:[`keyword.control.exception`,`keyword.control.trycatch`],settings:{foreground:r(`exception`,r(`label`,t.number))}},{name:`decorators`,scope:[`meta.decorator`,`punctuation.decorator`,`entity.name.function.decorator`],settings:{foreground:r(`decorator`,t.type)}},{name:`calls`,scope:[`variable.function`],settings:{foreground:t.foreground}},{name:`punctuation`,scope:[`punctuation`,`punctuation.terminator`,`punctuation.definition.tag`,`punctuation.separator`,`punctuation.definition.string`,`punctuation.section.block`],settings:{foreground:r(`punctuation`,t.comment)}},{name:`yellow`,scope:[`storage.type.numeric.go`,`storage.type.byte.go`,`storage.type.boolean.go`,`storage.type.string.go`,`storage.type.uintptr.go`,`storage.type.error.go`,`storage.type.rune.go`,`constant.language.go`,`support.class.dart`,`keyword.other.documentation`,`storage.modifier.import.java`,`punctuation.definition.list.begin.markdown`,`punctuation.definition.quote.begin.markdown`,`meta.separator.markdown`,`entity.name.section.markdown`],settings:{foreground:t.type}},{name:`green`,scope:[],settings:{foreground:r(`method`,e.colors.status.success)}},{name:`cyan`,scope:[`markup.italic.markdown`,`support.type.python`,`variable.legacy.builtin.python`,`support.constant.property-value.css`,`storage.modifier.attribute.swift`],settings:{foreground:t.string}},{name:`blue`,scope:[],settings:{foreground:t.keyword}},{name:`purple`,scope:[`keyword.channel.go`,`keyword.other.platform.os.swift`],settings:{foreground:t.number}},{name:`magenta`,scope:[`punctuation.definition.heading.markdown`],settings:{foreground:r(`label`,r(`variableGlobal`,t.number))}},{name:`red`,scope:[],settings:{foreground:t.operator}},{name:`orange`,scope:[],settings:{foreground:t.function}}]},ve=e=>{let t=e.colors.surface,n=e.colors.interactive,r=e.colors.status,i=e.colors.syntax.base,a=e.colors.syntax.highlights??{},o=J(a.diffAddedBackground,r.successBackground),s=J(a.diffRemovedBackground,r.errorBackground);return{"editor.background":t.background,"editor.foreground":t.foreground,"editor.hoverHighlightBackground":J(n.hover,t.subtle),"editor.lineHighlightBackground":t.muted,"editor.selectionBackground":n.selection,"editor.selectionHighlightBackground":n.selection,"editor.findMatchBackground":i.type,"editor.findMatchHighlightBackground":_e(i.type,`cc`),"editor.findRangeHighlightBackground":t.muted,"editor.inactiveSelectionBackground":t.elevated,"editor.lineHighlightBorder":t.elevated,"editor.rangeHighlightBackground":J(n.active,n.borderHover),"notifications.background":t.elevated,"editorInlayHint.typeBackground":t.subtle,"editorInlayHint.typeForeground":t.foreground,"editorWhitespace.foreground":n.borderHover,"editorIndentGuide.background1":t.subtle,"editorHoverWidget.background":t.elevated,"editorLineNumber.activeForeground":J(a.lineNumberActive,t.foreground),"editorLineNumber.foreground":J(a.lineNumber,t.mutedForeground),"editorGutter.background":t.background,"editorGutter.modifiedBackground":r.info,"editorGutter.addedBackground":r.success,"editorGutter.deletedBackground":r.error,"editorBracketMatch.background":t.elevated,"editorBracketMatch.border":t.subtle,"editorError.foreground":r.error,"editorWarning.foreground":r.warning,"editorInfo.foreground":r.info,"diffEditor.insertedTextBackground":o,"diffEditor.removedTextBackground":s,"editorGroupHeader.tabsBackground":t.background,"editorGroup.border":n.border,"tab.activeBackground":t.background,"tab.inactiveBackground":t.muted,"tab.inactiveForeground":t.mutedForeground,"tab.activeForeground":t.foreground,"tab.hoverBackground":t.subtle,"tab.unfocusedHoverBackground":t.subtle,"tab.border":n.border,"tab.activeModifiedBorder":i.type,"tab.inactiveModifiedBorder":r.info,"tab.unfocusedActiveModifiedBorder":i.type,"tab.unfocusedInactiveModifiedBorder":r.info,"editorWidget.background":t.muted,"editorWidget.border":n.border,"editorSuggestWidget.background":t.background,"editorSuggestWidget.border":n.border,"editorSuggestWidget.foreground":t.foreground,"editorSuggestWidget.highlightForeground":t.mutedForeground,"editorSuggestWidget.selectedBackground":t.subtle,"peekView.border":n.border,"peekViewEditor.background":t.background,"peekViewEditor.matchHighlightBackground":t.subtle,"peekViewResult.background":t.muted,"peekViewResult.fileForeground":t.foreground,"peekViewResult.lineForeground":t.mutedForeground,"peekViewResult.matchHighlightBackground":t.subtle,"peekViewResult.selectionBackground":t.elevated,"peekViewResult.selectionForeground":t.mutedForeground,"peekViewTitle.background":t.subtle,"peekViewTitleDescription.foreground":t.mutedForeground,"peekViewTitleLabel.foreground":t.foreground,"merge.currentHeaderBackground":r.success,"merge.currentContentBackground":J(a.diffAdded,r.success),"merge.incomingHeaderBackground":r.info,"merge.incomingContentBackground":J(a.diffModified,r.info),"merge.border":n.border,"merge.commonContentBackground":t.subtle,"merge.commonHeaderBackground":t.muted,"panel.background":t.background,"panel.border":n.border,"panelTitle.activeBorder":n.borderHover,"panelTitle.activeForeground":t.foreground,"panelTitle.inactiveForeground":t.mutedForeground,"statusBar.background":t.background,"statusBar.foreground":t.foreground,"statusBar.border":n.border,"statusBar.debuggingBackground":r.error,"statusBar.debuggingForeground":r.errorForeground,"statusBar.noFolderBackground":t.subtle,"statusBar.noFolderForeground":t.mutedForeground,"titleBar.activeBackground":t.background,"titleBar.activeForeground":t.foreground,"titleBar.inactiveBackground":t.muted,"titleBar.inactiveForeground":t.mutedForeground,"titleBar.border":n.border,"menu.foreground":t.foreground,"menu.background":t.background,"menu.selectionForeground":t.foreground,"menu.selectionBackground":t.subtle,"menu.border":n.border,"editorInlayHint.foreground":t.mutedForeground,"editorInlayHint.background":t.subtle,"terminal.foreground":t.foreground,"terminal.background":t.background,"terminalCursor.foreground":t.foreground,"terminalCursor.background":t.background,"terminal.ansiRed":J(a.diffRemoved,r.error),"terminal.ansiGreen":J(a.diffAdded,r.success),"terminal.ansiYellow":r.warning,"terminal.ansiBlue":J(a.diffModified,r.info),"terminal.ansiMagenta":i.keyword,"terminal.ansiCyan":i.type,"activityBar.background":t.background,"activityBar.foreground":t.foreground,"activityBar.inactiveForeground":t.mutedForeground,"activityBar.activeBorder":t.foreground,"activityBar.border":n.border,"sideBar.background":t.background,"sideBar.foreground":t.foreground,"sideBar.border":n.border,"sideBarTitle.foreground":t.foreground,"sideBarSectionHeader.background":t.muted,"sideBarSectionHeader.foreground":t.foreground,"sideBarSectionHeader.border":n.border,"sideBar.activeBackground":t.subtle,"sideBar.activeForeground":t.foreground,"sideBar.hoverBackground":t.muted,"sideBar.hoverForeground":t.foreground,"list.warningForeground":r.warning,"list.errorForeground":r.error,"list.inactiveSelectionBackground":t.subtle,"list.activeSelectionBackground":t.elevated,"list.inactiveSelectionForeground":t.foreground,"list.activeSelectionForeground":t.foreground,"list.hoverForeground":t.foreground,"list.hoverBackground":t.muted,"input.background":t.muted,"input.foreground":t.foreground,"input.border":n.border,"input.placeholderForeground":t.mutedForeground,"inputOption.activeBorder":n.border,"inputOption.activeBackground":t.elevated,"inputOption.activeForeground":t.foreground,"inputValidation.infoBackground":r.infoBackground,"inputValidation.infoBorder":r.infoBorder,"inputValidation.warningBackground":r.warningBackground,"inputValidation.warningBorder":r.warningBorder,"inputValidation.errorBackground":r.errorBackground,"inputValidation.errorBorder":r.errorBorder,"dropdown.background":t.muted,"dropdown.foreground":t.foreground,"dropdown.border":n.border,"dropdown.listBackground":t.background,"badge.background":e.colors.primary.base,"activityBarBadge.background":e.colors.primary.base,"button.background":e.colors.primary.base,"button.foreground":J(e.colors.primary.foreground,t.background),"badge.foreground":J(e.colors.primary.foreground,t.background),"activityBarBadge.foreground":J(e.colors.primary.foreground,t.background)}};function ye(e){return{name:e.metadata.name,type:e.metadata.variant,colors:ve(e),tokenColors:Y(e)}}var be=e=>/^#[0-9a-fA-F]{8}$/.test(e),X=e=>be(e)?e.slice(0,7):e;function xe(e,t){return Object.defineProperty(e,"toString",{value:()=>t,enumerable:!1,configurable:!0}),Object.defineProperty(e,Symbol.toPrimitive,{value:()=>t,enumerable:!1,configurable:!0}),e}var Z=new Map,Q=new Set,Se=(e,t)=>{let n=e.colors?.[`editor.background`],r=e.colors?.[`editor.foreground`],i=n?X(n):void 0,a=r?X(r):void 0;if(!i||!a)throw Error(`Theme "${t}" is missing editor.background/editor.foreground`);let o=e.tokenColors??[];return xe({...e,name:t,fg:a,bg:i,settings:o},t)},Ce=e=>ye(e),$=e=>{let t=Z.get(e.metadata.id);if(t)return t;let n=Se(Ce(e),e.metadata.id);return Z.set(e.metadata.id,n),n},we=e=>{let t=e.metadata.id;if(Q.has(t))return;let n=$(e);p(t,async()=>n),Q.add(t)};export{W as a,ne as c,me as i,se as l,$ as n,U as o,pe as r,D as s,we as t,C as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{Kt as t,Xt as n,qt as r}from"./persistence-C_KCiMcY.js";import{nt as i,rt as a}from"./vendor-base-ui-CnHfUmDN.js";import{n as o}from"./vendor-react-DLPElpoQ.js";import{a as s,i as c,o as l,t as u}from"./store-oojlrF4d.js";var d=e(a(),1),f=o(),p=async(e,n)=>{if(!t())throw Error(`Desktop runtime is not available`);return r(e,n)},m=async()=>{if(n())try{await p(`desktop_start_window_drag`)}catch{}},h=async e=>{if(n())try{await p(`desktop_set_window_title`,{title:e})}catch{}},g=async(e,t)=>{if(n())try{await p(`desktop_set_window_theme`,{themeMode:e,themeVariant:t})}catch{}},_=async e=>{if(n())try{await p(`desktop_set_menu_locale`,{locale:e})}catch{}},v=async()=>{if(!n())return null;try{let e=await p(`desktop_get_app_version`);return typeof e==`string`&&e.trim().length>0?e:null}catch{return null}},y=d.createContext(null),b=i(),x=e=>{let t=(0,f.c)(19),{children:n}=e,r=c(S),i=c(C),a=c(w),o=c(T),p,m;t[0]===r?(p=t[1],m=t[2]):(p=()=>{typeof document>`u`||(document.documentElement.lang=r)},m=[r],t[0]=r,t[1]=p,t[2]=m),d.useEffect(p,m);let h,g;t[3]!==a||t[4]!==r?(h=()=>{a===null&&_(r)},g=[r,a],t[3]=a,t[4]=r,t[5]=h,t[6]=g):(h=t[5],g=t[6]),d.useEffect(h,g);let v;t[7]===i?v=t[8]:(v=(e,t)=>u(i,e,t),t[7]=i,t[8]=v);let x=v,E;t[9]===x?E=t[10]:(E=e=>x(l[e]),t[9]=x,t[10]=E);let D;t[11]!==r||t[12]!==o||t[13]!==x||t[14]!==E?(D={locale:r,locales:s,setLocale:o,label:E,t:x},t[11]=r,t[12]=o,t[13]=x,t[14]=E,t[15]=D):D=t[15];let O=D,k;return t[16]!==n||t[17]!==O?(k=(0,b.jsx)(y.Provider,{value:O,children:n}),t[16]=n,t[17]=O,t[18]=k):k=t[18],k};function S(e){return e.locale}function C(e){return e.dictionary}function w(e){return e.loadingLocale}function T(e){return e.setLocale}var E={en:`en-US`,fr:`fr-FR`,"zh-CN":`zh-CN`,"zh-TW":`zh-TW`,uk:`uk-UA`,es:`es-ES`,"pt-BR":`pt-BR`,ko:`ko-KR`,pl:`pl-PL`,ja:`ja-JP`},D=e=>E[e]??`en-US`,O=()=>D(c.getState().locale);function k(){let e=d.useContext(y);if(!e)throw Error(`useI18n must be used within I18nProvider`);return e}async function A(e){let t=null;if(typeof navigator<`u`&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),{ok:!0,method:`clipboard`}}catch(e){t=e instanceof Error?e.message:String(e)}if(typeof document<`u`&&document.body){let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.top=`-1000px`,t.style.left=`-1000px`,document.body.appendChild(t),t.select(),t.setSelectionRange(0,t.value.length);let n=document.execCommand(`copy`);if(document.body.removeChild(t),n)return{ok:!0,method:`execCommand`}}return{ok:!1,error:t??`Clipboard access denied in current context`}}export{v as a,h as c,x as i,m as l,k as n,p as o,O as r,g as s,A as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Z as e}from"./useUIStore-D6BTB4va.js";import{Kt as t,qt as n}from"./persistence-C_KCiMcY.js";var r=e=>typeof e==`object`&&!!e,i=e=>e.trim().toLowerCase()===`authorization`,a=e=>{if(!r(e))return;let t={};for(let[n,r]of Object.entries(e)){let e=n.trim(),a=typeof r==`string`?r.trim():``;!e||!a||/[\r\n:]/.test(e)||/[\r\n]/.test(a)||i(e)||(t[e]=a)}return Object.keys(t).length>0?t:void 0},o=`connect-link`,s=(e,t)=>e.source===`connect-link`||e.relay?!0:t.has(e.id),c=e=>`relay://${e}`,l=e=>{if(!r(e))return null;let t=h(e,`relayUrl`)||h(e,`relay_url`),n=h(e,`serverId`)||h(e,`server_id`),i=e.hostEncPubJwk??e.host_enc_pub_jwk;return!t||!n||!r(i)?null:{relayUrl:t,serverId:n,hostEncPubJwk:i}},u=/^(t|.*(?:token|auth|secret|api).*)$/i,d=e=>{let t=e.trim();if(!t)return null;try{let e=new URL(t);return e.protocol!==`http:`&&e.protocol!==`https:`?null:t.split(`#`)[0]||null}catch{return null}},f=e=>{let t=d(e);if(!t)return null;try{let e=new URL(t);if((e.pathname.replace(/\/+$/,``)||`/`)===`/connect`&&e.searchParams.has(`t`))return{persistedUrl:e.origin,redeemUrl:e.toString(),kind:`tunnel-connect-link`}}catch{return null}return{persistedUrl:t,redeemUrl:null,kind:`normal-host`}},p=e=>{let t=d(e);if(!t)return e;try{let e=new URL(t);(e.username||e.password)&&(e.username=``,e.password=``);let n=Array.from(new Set(Array.from(e.searchParams.keys())));for(let t of n)u.test(t)&&e.searchParams.set(t,`[REDACTED]`);return e.toString()}catch{return t}},m=(e,t)=>{let n=d(e),r=d(t);if(!n||!r)return!1;try{let e=new URL(n),t=new URL(r);if(e.origin!==t.origin||t.search&&e.search!==t.search)return!1;let i=t.pathname.length>1?t.pathname.replace(/\/+$/,``):t.pathname,a=e.pathname.length>1?e.pathname.replace(/\/+$/,``):e.pathname;return i===`/`||a===i||a.startsWith(`${i}/`)}catch{return!1}},h=(e,t)=>{let n=e[t];return typeof n==`string`?n:null},g=(e,t)=>{let n=e[t];return typeof n==`number`&&Number.isFinite(n)?n:null},_=e=>{if(!r(e))return null;let t=h(e,`id`),n=h(e,`label`),i=h(e,`url`),s=h(e,`apiUrl`)||h(e,`api_url`),c=h(e,`clientToken`)||h(e,`client_token`),u=a(e.requestHeaders),d=l(e.relay),f=h(e,`source`)===`connect-link`?o:void 0;return!t||!n||!i?null:{id:t,label:n,url:i,...s?{apiUrl:s}:{},...c?{clientToken:c}:{},...u?{requestHeaders:u}:{},...d?{relay:d}:{},...f?{source:f}:{}}},v=e=>d(e.apiUrl||e.url)||e.apiUrl||e.url,y=()=>t()?(e,t)=>n(e,t):null,b=async()=>{let e=y();if(!e)return{hosts:[],defaultHostId:`local`,initialHostChoiceCompleted:!1};let t=await e(`desktop_hosts_get`);if(!r(t))return{hosts:[],defaultHostId:null,initialHostChoiceCompleted:!1};let n=t.hosts;return{hosts:Array.isArray(n)?n.map(_).filter(e=>!!e):[],defaultHostId:h(t,`defaultHostId`)||h(t,`default_host_id`)||h(t,`defaultHostID`),initialHostChoiceCompleted:t.initialHostChoiceCompleted===!0||t.initial_host_choice_completed===!0,localOrigin:h(t,`localOrigin`)||h(t,`local_origin`)}},x=async e=>{let t=y();if(!t)return;let n={hosts:e.hosts,defaultHostId:e.defaultHostId,initialHostChoiceCompleted:e.initialHostChoiceCompleted};e.localClientToken!==void 0&&(n.localClientToken=e.localClientToken),await t(`desktop_hosts_set`,{input:n})},S=async()=>{let e=y();if(!e)return``;let t=await e(`desktop_local_client_token_get`).catch(()=>null);return typeof t==`string`?t.trim():``},C=async()=>{let e=y();if(!e)return``;let t=await e(`desktop_install_id_get`).catch(()=>null);return typeof t==`string`?t.trim():``},w=8e3,T=async(t,n)=>{let r=e({relayUrl:t.relayUrl,serverId:t.serverId,hostEncPubJwk:t.hostEncPubJwk}),i=Date.now(),a=!1;try{return(await Promise.race([r.fetch(`/health`),new Promise(e=>{let t=window.setTimeout(()=>e(null),w);typeof t!=`number`&&typeof t.unref==`function`&&t.unref()})]))?.ok?(a=n?.keepTunnel===!0,{status:`ok`,latencyMs:Math.max(0,Date.now()-i),...a?{tunnel:r}:{}}):{status:`unreachable`,latencyMs:0}}catch{return{status:`unreachable`,latencyMs:0}}finally{a||r.close()}},E=async(e,t)=>{let n=y();if(!n)return{status:`unreachable`,latencyMs:0};let i=await n(`desktop_host_probe`,{url:e,clientToken:t?.clientToken||void 0,requestHeaders:t?.requestHeaders||void 0,expectedServerId:t?.expectedServerId||void 0});if(!r(i))return{status:`unreachable`,latencyMs:0};let a=i.status;return{status:a===`ok`||a===`auth`||a===`update-recommended`||a===`incompatible`||a===`wrong-service`||a===`unreachable`?a:`unreachable`,latencyMs:g(i,`latencyMs`)??g(i,`latency_ms`)??0}},D=async(e,t)=>{let n=y();n&&await n(`desktop_new_window_at_url`,{url:e,clientToken:t?.clientToken||void 0,requestHeaders:t?.requestHeaders||void 0})},O=async e=>{let t=y();t&&await t(`desktop_new_window_for_host`,{hostId:e})};export{C as a,O as c,m as d,d as f,f as g,c as h,x as i,v as l,p as m,E as n,S as o,T as p,b as r,D as s,o as t,s as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{T as e,j as t}from"./useUIStore-D6BTB4va.js";import{Zt as n,kn as r}from"./persistence-C_KCiMcY.js";import{f as i,i as a,l as o,n as s,r as c}from"./desktopHosts-BpjUSDz4.js";var l=5e3,u=1500,d=!1,f=async o=>{if(!n()||d)return;let l=`host:${o}`;if(e()===l){d=!0;try{let n=await c().catch(()=>null),u=n?.hosts.find(e=>e.id===o);if(!n||!u?.relay)return;let d=u.apiUrl?i(u.apiUrl):null;if(d&&d.startsWith(`https://`))return;let f=await r(`/api/client-auth/connection/candidates`).catch(()=>null);if(!f?.ok)return;let p=await f.json().catch(()=>null);if(!p||p.serverId!==u.relay.serverId)return;let m=Array.isArray(p.candidates)?p.candidates:[],h=[];for(let e of m){if(!e||typeof e!=`object`)continue;let t=e;if(t.type!==`lan`||typeof t.url!=`string`)continue;let n=i(t.url);n&&!h.includes(n)&&h.push(n)}if(h.length===0)return;let g=d&&h.includes(d)?d:h[0];g!==d&&await a({hosts:n.hosts.map(e=>e.id===o?{...e,apiUrl:g}:e),defaultHostId:n.defaultHostId,initialHostChoiceCompleted:n.initialHostChoiceCompleted}).catch(()=>void 0);let _=await s(g,{clientToken:u.clientToken||null,requestHeaders:u.requestHeaders||null,expectedServerId:u.relay.serverId}).catch(()=>({status:`unreachable`,latencyMs:0}));if(_.status===`unreachable`||_.status===`wrong-service`||_.status===`incompatible`||e()!==l)return;t({apiBaseUrl:g,clientToken:u.clientToken||null,requestHeaders:u.requestHeaders||null,runtimeKey:l})}finally{d=!1}}},p=e=>{typeof window>`u`||window.setTimeout(()=>{f(e).catch(()=>void 0)},l)},m=async r=>{if(!n())return;let a=await c().catch(()=>null);if(!a)return;let l=r||(a.defaultHostId===`local`?null:a.defaultHostId);if(!l)return;let d=a.hosts.find(e=>e.id===l);if(!d?.relay)return;let f=`host:${d.id}`;if(e()===f)return;let m=e=>{t({apiBaseUrl:e,clientToken:d.clientToken||null,requestHeaders:d.requestHeaders||null,runtimeKey:f})},h=()=>{t({apiBaseUrl:typeof window<`u`?window.location.origin:``,clientToken:d.clientToken||null,runtimeKey:f,relay:d.relay??void 0}),p(d.id)},g=d.apiUrl?i(o(d)):null;if(!g){h();return}let _=e=>e.status!==`unreachable`&&e.status!==`wrong-service`&&e.status!==`incompatible`,v=s(g,{clientToken:d.clientToken||null,requestHeaders:d.requestHeaders||null,expectedServerId:d.relay.serverId}).catch(()=>({status:`unreachable`,latencyMs:0})),y=await Promise.race([v,new Promise(e=>setTimeout(()=>e(null),u))]);if(y){if(_(y)){m(g);return}h();return}h(),v.then(t=>{_(t)&&e()===f&&m(g)})};export{p as n,m as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{$ as t,J as n,K as r,Q as i,X as a,Y as o,Z as s,nt as c,q as l,rt as u}from"./vendor-base-ui-CnHfUmDN.js";import{n as d}from"./vendor-react-DLPElpoQ.js";import{n as f}from"./clipboard-CXWbHCAk.js";import{t as p}from"./utils-DyUyiLje.js";import{n as m}from"./Icon-BPJ_quEe.js";var h=d(),g=e(u(),1),_=c(),v=0;function y(e,t){return e&&g.isValidElement(t)?{render:t}:{children:t}}function b(e){let t=(0,h.c)(4),r;t[0]===e?r=t[1]:({...r}=e,t[0]=e,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,_.jsx)(n,{...r}),t[2]=r,t[3]=i),i}function x(e){let t=(0,h.c)(10),n,i,a;t[0]===e?(n=t[1],i=t[2],a=t[3]):({asChild:n,children:i,...a}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a);let o;t[4]!==n||t[5]!==i?(o=y(n,i),t[4]=n,t[5]=i,t[6]=o):o=t[6];let s=o,c;return t[7]!==a||t[8]!==s?(c=(0,_.jsx)(r,{"data-slot":`dialog-trigger`,...a,...s}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function S(e){let t=(0,h.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,_.jsx)(o,{...n}),t[2]=n,t[3]=r),r}var C=g.forwardRef((e,n)=>{let r=(0,h.c)(10),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let o;r[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=[],r[3]=o):o=r[3],g.useEffect(A,o);let s=n,c;r[4]===i?c=r[5]:(c=p(`fixed inset-0 z-50 bg-black/50 dark:bg-black/75`,`transition-opacity duration-150 ease-out`,`data-[starting-style]:opacity-0 data-[ending-style]:opacity-0`,i),r[4]=i,r[5]=c);let l;return r[6]!==a||r[7]!==s||r[8]!==c?(l=(0,_.jsx)(t,{ref:s,"data-slot":`dialog-overlay`,className:c,...a}),r[6]=a,r[7]=s,r[8]=c,r[9]=l):l=r[9],l});C.displayName=`DialogOverlay`;function w(e){let t=(0,h.c)(29),n,r,o,s,c,l;t[0]===e?(n=t[1],r=t[2],o=t[3],s=t[4],c=t[5],l=t[6]):({className:r,overlayClassName:s,containerClassName:o,children:n,showCloseButton:l,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=c,t[6]=l);let u=l===void 0||l,{t:d}=f(),g;t[7]===s?g=t[8]:(g=p(`rounded-none`,s),t[7]=s,t[8]=g);let v;t[9]===g?v=t[10]:(v=(0,_.jsx)(C,{className:g}),t[9]=g,t[10]=v);let y=o??`items-center p-4`,b;t[11]===y?b=t[12]:(b=p(`fixed inset-0 z-50 flex justify-center pointer-events-none`,y),t[11]=y,t[12]=b);let x;t[13]===r?x=t[14]:(x=p(`relative pointer-events-auto bg-background text-foreground flex flex-col w-full max-w-lg max-h-full gap-4 rounded-xl border p-6 shadow-none overflow-y-auto pwa-dialog-content origin-center`,`transition-all duration-150 ease-out`,`data-[starting-style]:opacity-0 data-[starting-style]:scale-[0.98]`,`data-[ending-style]:opacity-0 data-[ending-style]:scale-[0.98]`,`data-[nested-dialog-open]:brightness-[0.55] dark:data-[nested-dialog-open]:brightness-[0.4]`,r),t[13]=r,t[14]=x);let w;t[15]!==u||t[16]!==d?(w=u&&(0,_.jsxs)(i,{"data-slot":`dialog-close`,className:`ring-offset-background focus:ring-ring data-[open]:bg-interactive-active data-[open]:text-foreground absolute top-2 right-2 rounded-lg opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none text-muted-foreground hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,_.jsx)(m,{name:`close`}),(0,_.jsx)(`span`,{className:`sr-only`,children:d(`dialog.common.actions.close`)})]}),t[15]=u,t[16]=d,t[17]=w):w=t[17];let T;t[18]!==n||t[19]!==c||t[20]!==x||t[21]!==w?(T=(0,_.jsxs)(a,{"data-slot":`dialog-content`,"data-state-slot":`dialog`,className:x,...c,children:[n,w]}),t[18]=n,t[19]=c,t[20]=x,t[21]=w,t[22]=T):T=t[22];let E;t[23]!==b||t[24]!==T?(E=(0,_.jsx)(`div`,{className:b,children:T}),t[23]=b,t[24]=T,t[25]=E):E=t[25];let D;return t[26]!==v||t[27]!==E?(D=(0,_.jsxs)(S,{children:[v,E]}),t[26]=v,t[27]=E,t[28]=D):D=t[28],D}function T(e){let t=(0,h.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=p(`flex flex-col gap-2 text-center sm:text-left`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,_.jsx)(`div`,{"data-slot":`dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function E(e){let t=(0,h.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=p(`flex flex-col-reverse gap-2 bottom-safe-area sm:flex-row sm:justify-end`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,_.jsx)(`div`,{"data-slot":`dialog-footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function D(e){let t=(0,h.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=p(`typography-markdown leading-none font-semibold text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,_.jsx)(l,{"data-slot":`dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function O(e){let t=(0,h.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=p(`text-muted-foreground typography-ui-label`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,_.jsx)(s,{"data-slot":`dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function k(){v=Math.max(0,v-1),v===0&&document.documentElement.classList.remove(`oc-dialog-open`)}function A(){return v+=1,document.documentElement.classList.add(`oc-dialog-open`),k}export{T as a,E as i,w as n,D as o,O as r,x as s,b as t};
|