pisper 0.6.27 → 0.6.28

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.
Files changed (169) hide show
  1. package/package.json +6 -6
  2. package/web/.vite/manifest.json +825 -665
  3. package/web/assets/{AppDialog-BSwETcOe.js → AppDialog-Cjnspn8J.js} +1 -1
  4. package/web/assets/{AppOverlays-_EStnaiK.js → AppOverlays-ielr5J2J.js} +1 -1
  5. package/web/assets/AssetsPage-BC1mYvQw.js +1 -0
  6. package/web/assets/BoardPage-BS3oBeRU.js +3 -0
  7. package/web/assets/{ChannelsPage-BlTQXqjl.js → ChannelsPage-DOysYIcY.js} +1 -1
  8. package/web/assets/{ChatAppearancePage-DzAq4wj8.js → ChatAppearancePage-DqNJD2hC.js} +1 -1
  9. package/web/assets/{ChatHistoryPage-B4v3MEb8.js → ChatHistoryPage-DcTFMdWO.js} +1 -1
  10. package/web/assets/ChatPage-DaKslieG.js +553 -0
  11. package/web/assets/ConfigPage-Cg93xSDY.js +7 -0
  12. package/web/assets/{DesktopWindowControls-gaFTmZN5.js → DesktopWindowControls-Zz88RwFF.js} +1 -1
  13. package/web/assets/{FeaturePage-IWVjXcVp.js → FeaturePage-bqByIxYg.js} +1 -1
  14. package/web/assets/{FileAttachmentPreview-DxwMjwfS.js → FileAttachmentPreview-Dc92kq62.js} +1 -1
  15. package/web/assets/{FloatingWidgets-D8VLtEFT.js → FloatingWidgets-CwJuWUMz.js} +1 -1
  16. package/web/assets/FocusRuntimeControls-huHLWDdy.js +1 -0
  17. package/web/assets/{GitDiffViewer-CEMK-4P4.js → GitDiffViewer-b4QqrnGx.js} +1 -1
  18. package/web/assets/{ManageProjectsDialog-BxB9J7IY.js → ManageProjectsDialog-DpwUwosB.js} +1 -1
  19. package/web/assets/{MarkdownMessage-gnw-y810.js → MarkdownMessage-BEmTlPSn.js} +1 -1
  20. package/web/assets/McpPage-COTq4Jjj.js +1 -0
  21. package/web/assets/{MemoryEvolution-DG9gtC6n.js → MemoryEvolution-CNi44VEB.js} +1 -1
  22. package/web/assets/MemoryPage-fUDrPE_v.js +2 -0
  23. package/web/assets/{MobileNavigation-Chysgboq.js → MobileNavigation-BvCRGO5c.js} +1 -1
  24. package/web/assets/MorePage-BuKQ5rBF.js +1 -0
  25. package/web/assets/NewFolderDialog-Btk5x-Ar.js +1 -0
  26. package/web/assets/{PageHeader-DK5D_R5_.js → PageHeader-BjhZ50ed.js} +1 -1
  27. package/web/assets/{PhoneDrawer-BbjnEawt.js → PhoneDrawer-Cs-ka4ZZ.js} +1 -1
  28. package/web/assets/{PhoneMenuButton-mlilY9bo.js → PhoneMenuButton-CTlyYTpl.js} +1 -1
  29. package/web/assets/{PhoneTopBar-CEnUC7MQ.js → PhoneTopBar-Cx2DM1ne.js} +1 -1
  30. package/web/assets/PluginsPage-B9Xlbo-c.js +1 -0
  31. package/web/assets/{SafeModePrompt-CalnTUf0.js → SafeModePrompt-BCrBZdI6.js} +1 -1
  32. package/web/assets/{SchedulesPage-CgHGU15C.js → SchedulesPage-Eh7MyRAr.js} +1 -1
  33. package/web/assets/SessionBrowserPane-Zeec5cZP.js +2 -0
  34. package/web/assets/SessionContextPanel-CVKmX-do.js +2 -0
  35. package/web/assets/{SessionHome-DVWSDkiq.js → SessionHome-CJR_Ufgl.js} +1 -1
  36. package/web/assets/SessionInspector-D5tmy63H.js +1 -0
  37. package/web/assets/{SessionShell-McHYcUMD.js → SessionShell-w3sKK33I.js} +1 -1
  38. package/web/assets/{SettingsSidebar-B6B_0bT6.js → SettingsSidebar-CseRAdbZ.js} +1 -1
  39. package/web/assets/{ShortcutHelpDialog-BuPN71vl.js → ShortcutHelpDialog-R4Gx-9DQ.js} +1 -1
  40. package/web/assets/{ShortcutKeys-DNpsGYcw.js → ShortcutKeys-DksC1OkE.js} +1 -1
  41. package/web/assets/{SidebarUpdateStatus-B9E-HRrS.js → SidebarUpdateStatus-BCd1eq_6.js} +1 -1
  42. package/web/assets/{SkillsPage-Ffz15Nmx.js → SkillsPage-Bn2y_EfT.js} +1 -1
  43. package/web/assets/{TaskProcessesPane-ML4UTyA9.js → TaskProcessesPane-FwGhuWob.js} +1 -1
  44. package/web/assets/{TaskTerminalView-CEWghfPZ.js → TaskTerminalView-Cd4PIsW7.js} +1 -1
  45. package/web/assets/{TerminalPanel-Dq1eeEaE.js → TerminalPanel-48zgvDnP.js} +1 -1
  46. package/web/assets/{WebDesktopPet-C5oPRBKd.js → WebDesktopPet-gSDBRZ3C.js} +1 -1
  47. package/web/assets/WorkflowsPage-Cs8PPuKK.js +1 -0
  48. package/web/assets/{WorkspacePicker-CZP9fnUA.js → WorkspacePicker-93gmdtjf.js} +1 -1
  49. package/web/assets/{alert-firawb0H.js → alert-DRIrgNI4.js} +1 -1
  50. package/web/assets/api-AeFmYDtL.js +1 -0
  51. package/web/assets/{app-update-HRbiPDT4.js → app-update-Cf9JJ7WK.js} +1 -1
  52. package/web/assets/{approval-confirm-C0RA-dqX.js → approval-confirm-D-cfu-xY.js} +1 -1
  53. package/web/assets/board-messages-D6AWGHuF.js +1 -0
  54. package/web/assets/board-projects-CjfuDvHx.js +1 -0
  55. package/web/assets/bots-store-vErH7x9u.js +1 -0
  56. package/web/assets/chat-api-CSAs7Y6E.js +1 -0
  57. package/web/assets/{client-store-DvE_NEoR.js → client-store-B5wZ2IWH.js} +1 -1
  58. package/web/assets/{config-search-Cr0TsTRS.js → config-search-eh2zQyZD.js} +1 -1
  59. package/web/assets/desktop-hosts-BNXtrr7R.js +191 -0
  60. package/web/assets/{dialog-9LXtFD-0.js → dialog-BDNbY1pW.js} +1 -1
  61. package/web/assets/event-stream-Dh7h5sXJ.js +2 -0
  62. package/web/assets/{events-oPlZB-qC.js → events-CuVwhRWu.js} +1 -1
  63. package/web/assets/{focus-session-composer-bits-VRvsf-4b.js → focus-session-composer-bits-Dkc0qSzm.js} +1 -1
  64. package/web/assets/folder-paths-BKS24lJ6.js +1 -0
  65. package/web/assets/{hosts-5EeWX76B.js → hosts-B_02vF1S.js} +1 -1
  66. package/web/assets/http-Bp65Kb4t.js +2 -0
  67. package/web/assets/http-response-PZN5QIRk.js +1 -0
  68. package/web/assets/i18n-D80GstlU.js +1 -0
  69. package/web/assets/index-BnQCk-QI.css +2 -0
  70. package/web/assets/{index-rOrQSojS.js → index-CiRnxTh1.js} +2 -2
  71. package/web/assets/machine-messages-Y3INM-Uy.js +1 -0
  72. package/web/assets/machines-api-08M8wQiu.js +1 -0
  73. package/web/assets/{memory-api-sER80Rta.js → memory-api-DSpQSQ5N.js} +1 -1
  74. package/web/assets/mount-app-DRohHSG7.js +9 -0
  75. package/web/assets/{mutation-CEbxdVYy.js → mutation-b4pPvB7p.js} +1 -1
  76. package/web/assets/{palette-navigation-HbVGltCo.js → palette-navigation-C8WTTMd3.js} +1 -1
  77. package/web/assets/permission-rules-api-D931wxo9.js +1 -0
  78. package/web/assets/{pick-system-directory-CWhZCX6d.js → pick-system-directory-CaiscVfr.js} +1 -1
  79. package/web/assets/placements-BERPVxJD.js +2 -0
  80. package/web/assets/{popover-DlJP3VbH.js → popover-BKgOyW2Z.js} +1 -1
  81. package/web/assets/public-CEKKZh7R.js +2 -0
  82. package/web/assets/{public-D4ziZ0_l.js → public-CwI1S0by.js} +1 -1
  83. package/web/assets/{public-Pwc0VWsG.js → public-D9GopZqN.js} +2 -2
  84. package/web/assets/{web-preview-DIo7zGil.js → public-DrlrVRdl.js} +1 -1
  85. package/web/assets/{public-components-DzeaQBwj.js → public-components-BX9oxLC6.js} +1 -1
  86. package/web/assets/public-diff-DpNMZ8NJ.js +1 -0
  87. package/web/assets/public-events-CLCgth5h.js +1 -0
  88. package/web/assets/public-flags-DaG3PoAy.js +1 -0
  89. package/web/assets/public-folder-dialog-_QoxpOd4.js +1 -0
  90. package/web/assets/{public-greeting-BTftKeXA.js → public-greeting-hvhJuZMw.js} +1 -1
  91. package/web/assets/{public-session-BQEMyJz3.js → public-session-DUzugr9Y.js} +1 -1
  92. package/web/assets/{public-sidebar-TnRh2L95.js → public-sidebar-QGIKY-SE.js} +1 -1
  93. package/web/assets/query-DFQayLF5.js +1 -0
  94. package/web/assets/runtime-capabilities-B7qveLBm.js +1 -0
  95. package/web/assets/{runtime-capabilities-store-SnV1V9_K.js → runtime-capabilities-store-Bd3gWIM7.js} +1 -1
  96. package/web/assets/{safe-mode-instance-D5jkqqdG.js → safe-mode-instance-B7_JMLGQ.js} +1 -1
  97. package/web/assets/safe-mode-sentinel-B_NPQ0qy.js +1 -0
  98. package/web/assets/{session-change-summary-api-orjhsMHB.js → session-change-summary-api-BHpd8dcW.js} +1 -1
  99. package/web/assets/{session-home-CwRaSks0.js → session-home-BmAnhROp.js} +1 -1
  100. package/web/assets/session-inspector-store-DHEIlh_X.js +1 -0
  101. package/web/assets/{session-organization-api-BbD_xU9l.js → session-organization-api-D9hTSIh7.js} +1 -1
  102. package/web/assets/session-scope-yI3Hi_8F.js +1 -0
  103. package/web/assets/{session-tree-actions-wrMgK5VF.js → session-tree-actions-BhCOaiTd.js} +1 -1
  104. package/web/assets/{session-tree-summary-BO-Oz0d-.js → session-tree-summary-BLv-bkYC.js} +1 -1
  105. package/web/assets/session-web-preview-guvsmkWE.js +1 -0
  106. package/web/assets/session-workspaces-Brm-8lHh.js +1 -0
  107. package/web/assets/{settings-navigation-DiP_AM1C.js → settings-navigation-C6_RpGgI.js} +1 -1
  108. package/web/assets/{shortcuts-BmJZiLby.js → shortcuts-Dsd4mjfP.js} +1 -1
  109. package/web/assets/side-chat-context-scyCH7W7.js +7 -0
  110. package/web/assets/{sidebar-COyrGoC_.js → sidebar-BKgF_JcM.js} +1 -1
  111. package/web/assets/{sidebar-store-CRsJYE3n.js → sidebar-store-DHwAOBnN.js} +1 -1
  112. package/web/assets/{speech-session-BUTlvobj.js → speech-session-B7DFYRtL.js} +1 -1
  113. package/web/assets/{startup-queries-Cz_Djz3X.js → startup-queries-BlA4Hayt.js} +1 -1
  114. package/web/assets/tool-labels-D-3gybP7.js +1 -0
  115. package/web/assets/{use-i18n-CaxKosZm.js → use-i18n-BVRhlQ1v.js} +1 -1
  116. package/web/assets/{use-open-bot-BcuoHEet.js → use-open-bot-DyXtOatN.js} +1 -1
  117. package/web/assets/{use-studio-actions-D0_lMh6m.js → use-studio-actions-DEeR_rS9.js} +1 -1
  118. package/web/assets/{useCatalogProjects-B10EehnV.js → useCatalogProjects-BD5GyCxg.js} +1 -1
  119. package/web/assets/useMachines-CwX7YqNe.js +1 -0
  120. package/web/assets/useNativeBrowser-C0j3zafh.js +1 -0
  121. package/web/assets/useNewProjectPicker-COxPJj6n.js +2 -0
  122. package/web/assets/{useNow-BZ7RxPrw.js → useNow-CfPk0uIz.js} +1 -1
  123. package/web/assets/{usePhoneShell-0IX6-LbH.js → usePhoneShell-BpuKJgci.js} +1 -1
  124. package/web/assets/{useQuery-DdcpUQhO.js → useQuery-DfOU-27z.js} +1 -1
  125. package/web/assets/useSessionListQuery-CURESPBn.js +2 -0
  126. package/web/assets/{useSessionRowActions-DCeaGwuL.js → useSessionRowActions-DoCwFh8w.js} +1 -1
  127. package/web/assets/{useSidebarModel-DNcSN-4f.js → useSidebarModel-CY79-mYl.js} +1 -1
  128. package/web/assets/web-preview-C7DdG9JP.js +1 -0
  129. package/web/assets/{web-preview-events-BvZrLClr.js → web-preview-events-D7F0Z-Hy.js} +1 -1
  130. package/web/assets/{workspace-order-store-BYpf9Z59.js → workspace-order-store-C-jYrC0l.js} +1 -1
  131. package/web/index.html +2 -2
  132. package/web/assets/AssetsPage-V8CwPJ-g.js +0 -1
  133. package/web/assets/BoardPage-CeCxAAr2.js +0 -3
  134. package/web/assets/ChatPage-D8Etebyo.js +0 -553
  135. package/web/assets/ConfigPage-Dgp9JPFH.js +0 -5
  136. package/web/assets/FocusRuntimeControls-DLdIWv0j.js +0 -1
  137. package/web/assets/McpPage-C0czFuy7.js +0 -1
  138. package/web/assets/MemoryPage-CGpPJtAj.js +0 -2
  139. package/web/assets/MorePage-CxS1EaML.js +0 -1
  140. package/web/assets/NewFolderDialog-Dgo2ZRmr.js +0 -1
  141. package/web/assets/PluginsPage-CcrK4yJY.js +0 -1
  142. package/web/assets/SessionBrowserPane-BISoBe8t.js +0 -2
  143. package/web/assets/SessionContextPanel-C9F4h-Qa.js +0 -2
  144. package/web/assets/SessionInspector-BUBN0O36.js +0 -1
  145. package/web/assets/WorkflowsPage-BSlpEhf2.js +0 -1
  146. package/web/assets/api-MVoWVwmh.js +0 -3
  147. package/web/assets/board-messages-BptuVfY-.js +0 -1
  148. package/web/assets/board-projects-DF-0RkuW.js +0 -1
  149. package/web/assets/bots-store-BmFj9w2F.js +0 -1
  150. package/web/assets/chat-api-D9RzUTQi.js +0 -1
  151. package/web/assets/folder-paths-DlIGURu0.js +0 -1
  152. package/web/assets/i18n-Cl3sIF9G.js +0 -1
  153. package/web/assets/index-l96Dl6z6.css +0 -2
  154. package/web/assets/mount-app-COPez7JX.js +0 -9
  155. package/web/assets/permission-rules-api-M-EIynsN.js +0 -1
  156. package/web/assets/placements-BDYSXHzl.js +0 -2
  157. package/web/assets/public-BDWkdvCh.js +0 -1
  158. package/web/assets/public-diff-C6x0INNk.js +0 -1
  159. package/web/assets/public-events-BXREjvNl.js +0 -1
  160. package/web/assets/public-flags-Dvf3q-4D.js +0 -1
  161. package/web/assets/query-Bj-DUNYq.js +0 -1
  162. package/web/assets/runtime-capabilities-CHYOF_hE.js +0 -1
  163. package/web/assets/safe-mode-sentinel-B3v6JZTG.js +0 -1
  164. package/web/assets/session-scope-CFKKqbrz.js +0 -1
  165. package/web/assets/session-workspaces-Csgpuzxd.js +0 -1
  166. package/web/assets/side-chat-context-DhztplBz.js +0 -7
  167. package/web/assets/tool-labels-Bexnwp5q.js +0 -1
  168. package/web/assets/useNewProjectPicker-CD-xwRhH.js +0 -2
  169. package/web/assets/useSessionListQuery-DXeYJTOA.js +0 -2
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-CaxKosZm.js";import{t as i}from"./createLucideIcon-Cd-3GVxJ.js";import{t as a}from"./arrow-up-DST6-qVQ.js";import{t as o}from"./braces-DQcXLGFF.js";import{t as s}from"./pencil-U08v_vV9.js";import{t as c}from"./refresh-cw-TbWxTY4K.js";import{t as l}from"./square-bHHVTT3G.js";import{t as u}from"./wrench-6pg6_bqI.js";import{t as d}from"./x-07u4-129.js";import{t as f}from"./utils-C8uzG5AZ.js";import{n as p}from"./button-CCcCN8tE.js";import{t as m}from"./kbd-CAufZTkl.js";import{s as h}from"./shortcuts-BmJZiLby.js";import{t as g}from"./StatusGlyph-1KgitlUg.js";import{s as _}from"./run-activity-CwfO0cui.js";var v=i(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),y=e(t(),1),b=n(),x=`relative max-[650px]:after:absolute max-[650px]:after:-inset-1`,S=`inline-flex h-7 min-w-0 shrink cursor-pointer items-center gap-1.5 rounded-sm border border-transparent px-2 text-[13px] text-content-secondary transition-colors hover:bg-surface-hover hover:text-content aria-expanded:bg-surface-hover aria-expanded:text-content max-[650px]:h-9 max-[650px]:rounded-full max-[650px]:bg-surface-muted max-[650px]:dark:bg-surface-active max-[650px]:px-3 max-[650px]:text-content min-[651px]:pointer-coarse:h-11 ${x}`,C=`grid size-8 min-w-8 flex-none cursor-pointer place-items-center rounded-sm border-0 bg-transparent text-content-muted transition-colors hover:bg-surface-hover hover:text-content disabled:cursor-not-allowed disabled:opacity-50 max-[650px]:size-9 max-[650px]:min-w-9 min-[651px]:pointer-coarse:size-11 min-[651px]:pointer-coarse:min-w-11 ${x}`,w=`max-[650px]:size-4`;function T(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=String(t%60).padStart(2,`0`);return n?`${n}:${String(r).padStart(2,`0`)}:${i}`:`${r}:${i}`}function E({startedAt:e}){let[t,n]=(0,y.useState)(()=>Date.now());(0,y.useEffect)(()=>{let e=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(e)},[]);let r=_(e,null,t);return r?(0,b.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 font-mono text-[12.5px] text-content-muted tabular-nums`,"data-tray-clock":!0,children:T(r)}):null}var D=`flex min-h-[34px] min-w-0 items-center gap-2 pr-1.5 pl-3 text-[13px] max-[650px]:min-h-11 max-[650px]:pr-0 pointer-coarse:min-h-11`,O=`grid size-[26px] flex-none cursor-pointer place-items-center rounded-sm text-content-muted opacity-0 transition-opacity duration-(--d-fast) group-hover/queued:opacity-100 group-focus-within/queued:opacity-100 hover:bg-surface-hover hover:text-content focus-visible:opacity-100 disabled:cursor-default disabled:opacity-40 max-[650px]:size-11 max-[650px]:opacity-100 pointer-coarse:size-11 pointer-coarse:opacity-100 [@media(hover:none)]:opacity-100`;function k({streaming:e,compaction:t,startedAt:n,stopping:i=!1,onStop:a,queuedInputs:o=[],withdrawingInputIds:c=[],onEdit:u,onCancel:h,onSendNow:_,runRow:y=!0,queueList:x=!0}){let{t:S}=r(),C=!!t?.active,w=!!e&&y||C,T=x?o:[];if(!w&&!T.length)return null;let k=S(`chat:focusSession.sentToTheRunningAgent`);return(0,b.jsxs)(`div`,{className:`composer-tray mx-3.5 flex min-w-0 flex-col overflow-hidden rounded-t-(--r-lg) border border-b-0 border-stroke bg-well text-content-secondary max-[650px]:mx-2 [&>*+*]:border-t [&>*+*]:border-stroke`,"data-composer-tray":!0,children:[w&&(0,b.jsxs)(`div`,{className:D,"data-run-bar":C?`compacting`:`running`,children:[(0,b.jsxs)(`span`,{role:`status`,className:`flex min-w-0 flex-1 items-center gap-2`,children:[C?(0,b.jsx)(p,{className:`size-3.5 flex-none text-content-secondary`}):(0,b.jsx)(g,{status:`run`,className:`size-4`}),(0,b.jsx)(`span`,{className:`shrink-0 text-content`,children:S(C?`chat:focusSession.compactingContext`:`chat:focusSession.running`)}),e&&(0,b.jsx)(E,{startedAt:n})]}),e&&a&&(0,b.jsxs)(`button`,{type:`button`,className:`inline-flex h-[26px] shrink-0 cursor-pointer items-center gap-1.5 rounded-sm px-2 text-[13px] text-content transition-colors hover:bg-surface-hover disabled:cursor-default disabled:opacity-60 max-[650px]:h-11 max-[650px]:min-w-[72px] max-[650px]:justify-center pointer-coarse:h-11 pointer-coarse:min-w-[72px]`,"aria-label":S(i?`chat:focusSession.stopping`:`chat:focusSession.stop`),title:S(`chat:focusSession.stopRunShortcut`),"aria-busy":i||void 0,disabled:i,onClick:a,"data-run-stop":!0,children:[(0,b.jsx)(l,{size:10,fill:`currentColor`,"aria-hidden":`true`}),S(i?`chat:focusSession.stopping`:`chat:focusSession.stop`),(0,b.jsx)(m,{className:`max-[650px]:hidden pointer-coarse:hidden`,children:`Esc`})]})]}),T.length>0&&(0,b.jsx)(`ul`,{className:`m-0 flex max-h-[136px] min-w-0 list-none flex-col overflow-x-hidden overflow-y-auto overscroll-contain p-0 [&>*+*]:border-t [&>*+*]:border-stroke-soft`,"aria-label":k,"data-pisper-queue-size":T.length,tabIndex:T.length>3?0:void 0,children:T.map((e,t)=>{let n=typeof e.id==`string`?e.id:``,r=c.includes(n),i=!n||r,a=String(e.text||``);return(0,b.jsxs)(`li`,{className:f(D,`group/queued`),"aria-busy":r||void 0,children:[(0,b.jsx)(`span`,{className:`inline-flex h-[18px] flex-none items-center rounded-xs border border-stroke bg-solid px-1.5 text-[11.5px] text-content-muted`,"data-queued-behavior":e.behavior===`steer`?`steer`:`followUp`,children:e.behavior===`steer`?S(`board:composer.queuedSteer`):S(`board:composer.queuedFollowUp`)}),(0,b.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-content [overflow-wrap:anywhere]`,title:a,children:a}),_&&(0,b.jsx)(`button`,{type:`button`,className:O,"aria-label":S(`board:composer.sendQueuedNow`),title:S(`board:composer.sendQueuedNow`),disabled:i,"data-queued-send-now":!0,onClick:()=>_(n),children:(0,b.jsx)(v,{size:14,"aria-hidden":`true`})}),u&&(0,b.jsx)(`button`,{type:`button`,className:O,"aria-label":S(`board:composer.editQueued`),title:S(`board:composer.editQueued`),disabled:i,"data-queued-edit":!0,onClick:()=>void u(n),children:(0,b.jsx)(s,{size:14,"aria-hidden":`true`})}),h&&(0,b.jsx)(`button`,{type:`button`,className:O,"aria-label":S(`board:composer.cancelQueued`),title:S(`board:composer.cancelQueued`),disabled:i,"data-queued-cancel":!0,onClick:()=>void h(n),children:(0,b.jsx)(d,{size:14,"aria-hidden":`true`})})]},n||`${e.behavior}-${t}`)})})]})}function A({invocation:e,onRemove:t}){let{t:n}=r();return(0,b.jsxs)(`div`,{className:`composer-resource-chip [&.workflow]:border-success-border [&.workflow]:bg-success-soft [&.workflow]:text-success-strong [&_button]:grid [&_button]:size-6 [&_button]:place-items-center [&_button]:rounded-xs [&_button]:text-content-muted [&_button]:hover:bg-surface-hover [&_button]:hover:text-content inline-flex h-7 self-start items-center gap-1.5 rounded-sm border border-star-border bg-star-soft pr-0.5 pl-2 text-xs font-medium text-star-strong max-[650px]:h-11 max-[650px]:[&_button]:size-11 ${e.kind}`,children:[e.kind===`tool`?(0,b.jsx)(u,{size:13}):(0,b.jsx)(o,{size:13}),(0,b.jsxs)(`span`,{children:[e.kind===`skill`?`Skill`:e.kind===`tool`?n(`chat:resourcePicker.tool`):n(`chat:resourcePicker.workflow`),` `,`· `,e.resourceName]}),(0,b.jsx)(`button`,{type:`button`,"aria-label":n(`chat:resourcePicker.remove`),onClick:t,children:(0,b.jsx)(d,{size:13})})]})}function j({streaming:e,queueing:t,submitting:n=!1,stopping:i=!1,preparing:o=!1,hasDraft:s=!1,canQueue:u=!1,blockedReason:d,disabled:f,onLongPress:p,longPressHint:m,onStop:g}){let{t:_}=r(),v=h(`sendMessage`),S=(0,y.useRef)(null),C=(0,y.useRef)(!1),T=()=>{S.current&&clearTimeout(S.current),S.current=null};(0,y.useEffect)(()=>{let e=S;return()=>{e.current&&clearTimeout(e.current)}},[]);let E=!!(g&&e&&!s),D=!!(e&&!(s&&u))&&!E,O=t||n||i||o,k=f||O||D||!!d,A=_(o?`chat:focusSession.preparingAttachments`:i?`chat:focusSession.stopping`:E?`chat:focusSession.stop`:`chat:focusSession.sendMessage`);return(0,b.jsx)(`button`,{type:E?`button`:`submit`,"data-send-mode":E?`stop`:`send`,className:`send-button grid size-8 min-w-8 flex-none cursor-pointer place-items-center rounded-full border border-transparent bg-star text-on-accent transition-[background-color,opacity] select-none [-webkit-touch-callout:none] hover:enabled:bg-star-hover active:enabled:translate-y-px disabled:cursor-not-allowed disabled:opacity-30 aria-disabled:opacity-30 max-[650px]:disabled:bg-surface-muted max-[650px]:disabled:text-content max-[650px]:disabled:opacity-100 max-[650px]:aria-disabled:bg-surface-muted max-[650px]:aria-disabled:text-content max-[650px]:aria-disabled:opacity-100 max-[650px]:dark:disabled:bg-surface-active max-[650px]:dark:aria-disabled:bg-surface-active data-[send-mode=stop]:bg-surface-muted data-[send-mode=stop]:text-content data-[send-mode=stop]:hover:enabled:bg-surface-hover dark:data-[send-mode=stop]:bg-surface-active max-[650px]:size-9 max-[650px]:min-w-9 min-[651px]:pointer-coarse:size-11 min-[651px]:pointer-coarse:min-w-11 ${x}`,title:d||(!O&&v?`${A} (${v})`:A),"aria-label":d?`${A}: ${d}`:A,"aria-busy":O||void 0,"aria-disabled":k||void 0,"aria-description":p&&!E?m:void 0,"data-long-press":p&&!E?`steer`:void 0,onPointerDown:e=>{C.current=!1,!(!p||E||k||e.pointerType===`mouse`)&&(T(),S.current=setTimeout(()=>{S.current=null,C.current=!0,p()},500))},onPointerUp:T,onPointerCancel:T,onPointerLeave:T,onContextMenu:e=>{p&&e.preventDefault()},onClick:e=>{if(C.current){C.current=!1,e.preventDefault();return}if(k){e.preventDefault();return}E&&g?.()},disabled:!d&&k,children:O?(0,b.jsx)(c,{className:`animate-spin ${w}`,size:17}):E?(0,b.jsx)(l,{size:13,fill:`currentColor`,"aria-hidden":`true`}):(0,b.jsx)(a,{size:17,strokeWidth:2.1,className:w})})}export{A as a,T as c,x as i,C as n,j as o,w as r,k as s,S as t};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-BVRhlQ1v.js";import{t as i}from"./createLucideIcon-Cd-3GVxJ.js";import{t as a}from"./arrow-up-DST6-qVQ.js";import{t as o}from"./braces-DQcXLGFF.js";import{t as s}from"./pencil-U08v_vV9.js";import{t as c}from"./refresh-cw-TbWxTY4K.js";import{t as l}from"./square-bHHVTT3G.js";import{t as u}from"./wrench-6pg6_bqI.js";import{t as d}from"./x-07u4-129.js";import{t as f}from"./utils-C8uzG5AZ.js";import{n as p}from"./button-CCcCN8tE.js";import{t as m}from"./kbd-CAufZTkl.js";import{s as h}from"./shortcuts-Dsd4mjfP.js";import{t as g}from"./StatusGlyph-1KgitlUg.js";import{s as _}from"./run-activity-CwfO0cui.js";var v=i(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),y=e(t(),1),b=n(),x=`relative max-[650px]:after:absolute max-[650px]:after:-inset-1`,S=`inline-flex h-7 min-w-0 shrink cursor-pointer items-center gap-1.5 rounded-sm border border-transparent px-2 text-[13px] text-content-secondary transition-colors hover:bg-surface-hover hover:text-content aria-expanded:bg-surface-hover aria-expanded:text-content max-[650px]:h-9 max-[650px]:rounded-full max-[650px]:bg-surface-muted max-[650px]:dark:bg-surface-active max-[650px]:px-3 max-[650px]:text-content min-[651px]:pointer-coarse:h-11 ${x}`,C=`grid size-8 min-w-8 flex-none cursor-pointer place-items-center rounded-sm border-0 bg-transparent text-content-muted transition-colors hover:bg-surface-hover hover:text-content disabled:cursor-not-allowed disabled:opacity-50 max-[650px]:size-9 max-[650px]:min-w-9 min-[651px]:pointer-coarse:size-11 min-[651px]:pointer-coarse:min-w-11 ${x}`,w=`max-[650px]:size-4`;function T(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=String(t%60).padStart(2,`0`);return n?`${n}:${String(r).padStart(2,`0`)}:${i}`:`${r}:${i}`}function E({startedAt:e}){let[t,n]=(0,y.useState)(()=>Date.now());(0,y.useEffect)(()=>{let e=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(e)},[]);let r=_(e,null,t);return r?(0,b.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 font-mono text-[12.5px] text-content-muted tabular-nums`,"data-tray-clock":!0,children:T(r)}):null}var D=`flex min-h-[34px] min-w-0 items-center gap-2 pr-1.5 pl-3 text-[13px] max-[650px]:min-h-11 max-[650px]:pr-0 pointer-coarse:min-h-11`,O=`grid size-[26px] flex-none cursor-pointer place-items-center rounded-sm text-content-muted opacity-0 transition-opacity duration-(--d-fast) group-hover/queued:opacity-100 group-focus-within/queued:opacity-100 hover:bg-surface-hover hover:text-content focus-visible:opacity-100 disabled:cursor-default disabled:opacity-40 max-[650px]:size-11 max-[650px]:opacity-100 pointer-coarse:size-11 pointer-coarse:opacity-100 [@media(hover:none)]:opacity-100`;function k({streaming:e,compaction:t,startedAt:n,stopping:i=!1,onStop:a,queuedInputs:o=[],withdrawingInputIds:c=[],onEdit:u,onCancel:h,onSendNow:_,runRow:y=!0,queueList:x=!0}){let{t:S}=r(),C=!!t?.active,w=!!e&&y||C,T=x?o:[];if(!w&&!T.length)return null;let k=S(`chat:focusSession.sentToTheRunningAgent`);return(0,b.jsxs)(`div`,{className:`composer-tray mx-3.5 flex min-w-0 flex-col overflow-hidden rounded-t-(--r-lg) border border-b-0 border-stroke bg-well text-content-secondary max-[650px]:mx-2 [&>*+*]:border-t [&>*+*]:border-stroke`,"data-composer-tray":!0,children:[w&&(0,b.jsxs)(`div`,{className:D,"data-run-bar":C?`compacting`:`running`,children:[(0,b.jsxs)(`span`,{role:`status`,className:`flex min-w-0 flex-1 items-center gap-2`,children:[C?(0,b.jsx)(p,{className:`size-3.5 flex-none text-content-secondary`}):(0,b.jsx)(g,{status:`run`,className:`size-4`}),(0,b.jsx)(`span`,{className:`shrink-0 text-content`,children:S(C?`chat:focusSession.compactingContext`:`chat:focusSession.running`)}),e&&(0,b.jsx)(E,{startedAt:n})]}),e&&a&&(0,b.jsxs)(`button`,{type:`button`,className:`inline-flex h-[26px] shrink-0 cursor-pointer items-center gap-1.5 rounded-sm px-2 text-[13px] text-content transition-colors hover:bg-surface-hover disabled:cursor-default disabled:opacity-60 max-[650px]:h-11 max-[650px]:min-w-[72px] max-[650px]:justify-center pointer-coarse:h-11 pointer-coarse:min-w-[72px]`,"aria-label":S(i?`chat:focusSession.stopping`:`chat:focusSession.stop`),title:S(`chat:focusSession.stopRunShortcut`),"aria-busy":i||void 0,disabled:i,onClick:a,"data-run-stop":!0,children:[(0,b.jsx)(l,{size:10,fill:`currentColor`,"aria-hidden":`true`}),S(i?`chat:focusSession.stopping`:`chat:focusSession.stop`),(0,b.jsx)(m,{className:`max-[650px]:hidden pointer-coarse:hidden`,children:`Esc`})]})]}),T.length>0&&(0,b.jsx)(`ul`,{className:`m-0 flex max-h-[136px] min-w-0 list-none flex-col overflow-x-hidden overflow-y-auto overscroll-contain p-0 [&>*+*]:border-t [&>*+*]:border-stroke-soft`,"aria-label":k,"data-pisper-queue-size":T.length,tabIndex:T.length>3?0:void 0,children:T.map((e,t)=>{let n=typeof e.id==`string`?e.id:``,r=c.includes(n),i=!n||r,a=String(e.text||``);return(0,b.jsxs)(`li`,{className:f(D,`group/queued`),"aria-busy":r||void 0,children:[(0,b.jsx)(`span`,{className:`inline-flex h-[18px] flex-none items-center rounded-xs border border-stroke bg-solid px-1.5 text-[11.5px] text-content-muted`,"data-queued-behavior":e.behavior===`steer`?`steer`:`followUp`,children:e.behavior===`steer`?S(`board:composer.queuedSteer`):S(`board:composer.queuedFollowUp`)}),(0,b.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-content [overflow-wrap:anywhere]`,title:a,children:a}),_&&(0,b.jsx)(`button`,{type:`button`,className:O,"aria-label":S(`board:composer.sendQueuedNow`),title:S(`board:composer.sendQueuedNow`),disabled:i,"data-queued-send-now":!0,onClick:()=>_(n),children:(0,b.jsx)(v,{size:14,"aria-hidden":`true`})}),u&&(0,b.jsx)(`button`,{type:`button`,className:O,"aria-label":S(`board:composer.editQueued`),title:S(`board:composer.editQueued`),disabled:i,"data-queued-edit":!0,onClick:()=>void u(n),children:(0,b.jsx)(s,{size:14,"aria-hidden":`true`})}),h&&(0,b.jsx)(`button`,{type:`button`,className:O,"aria-label":S(`board:composer.cancelQueued`),title:S(`board:composer.cancelQueued`),disabled:i,"data-queued-cancel":!0,onClick:()=>void h(n),children:(0,b.jsx)(d,{size:14,"aria-hidden":`true`})})]},n||`${e.behavior}-${t}`)})})]})}function A({invocation:e,onRemove:t}){let{t:n}=r();return(0,b.jsxs)(`div`,{className:`composer-resource-chip [&.workflow]:border-success-border [&.workflow]:bg-success-soft [&.workflow]:text-success-strong [&_button]:grid [&_button]:size-6 [&_button]:place-items-center [&_button]:rounded-xs [&_button]:text-content-muted [&_button]:hover:bg-surface-hover [&_button]:hover:text-content inline-flex h-7 self-start items-center gap-1.5 rounded-sm border border-star-border bg-star-soft pr-0.5 pl-2 text-xs font-medium text-star-strong max-[650px]:h-11 max-[650px]:[&_button]:size-11 ${e.kind}`,children:[e.kind===`tool`?(0,b.jsx)(u,{size:13}):(0,b.jsx)(o,{size:13}),(0,b.jsxs)(`span`,{children:[e.kind===`skill`?`Skill`:e.kind===`tool`?n(`chat:resourcePicker.tool`):n(`chat:resourcePicker.workflow`),` `,`· `,e.resourceName]}),(0,b.jsx)(`button`,{type:`button`,"aria-label":n(`chat:resourcePicker.remove`),onClick:t,children:(0,b.jsx)(d,{size:13})})]})}function j({streaming:e,queueing:t,submitting:n=!1,stopping:i=!1,preparing:o=!1,hasDraft:s=!1,canQueue:u=!1,blockedReason:d,disabled:f,onLongPress:p,longPressHint:m,onStop:g}){let{t:_}=r(),v=h(`sendMessage`),S=(0,y.useRef)(null),C=(0,y.useRef)(!1),T=()=>{S.current&&clearTimeout(S.current),S.current=null};(0,y.useEffect)(()=>{let e=S;return()=>{e.current&&clearTimeout(e.current)}},[]);let E=!!(g&&e&&!s),D=!!(e&&!(s&&u))&&!E,O=t||n||i||o,k=f||O||D||!!d,A=_(o?`chat:focusSession.preparingAttachments`:i?`chat:focusSession.stopping`:E?`chat:focusSession.stop`:`chat:focusSession.sendMessage`);return(0,b.jsx)(`button`,{type:E?`button`:`submit`,"data-send-mode":E?`stop`:`send`,className:`send-button grid size-8 min-w-8 flex-none cursor-pointer place-items-center rounded-full border border-transparent bg-star text-on-accent transition-[background-color,opacity] select-none [-webkit-touch-callout:none] hover:enabled:bg-star-hover active:enabled:translate-y-px disabled:cursor-not-allowed disabled:opacity-30 aria-disabled:opacity-30 max-[650px]:disabled:bg-surface-muted max-[650px]:disabled:text-content max-[650px]:disabled:opacity-100 max-[650px]:aria-disabled:bg-surface-muted max-[650px]:aria-disabled:text-content max-[650px]:aria-disabled:opacity-100 max-[650px]:dark:disabled:bg-surface-active max-[650px]:dark:aria-disabled:bg-surface-active data-[send-mode=stop]:bg-surface-muted data-[send-mode=stop]:text-content data-[send-mode=stop]:hover:enabled:bg-surface-hover dark:data-[send-mode=stop]:bg-surface-active max-[650px]:size-9 max-[650px]:min-w-9 min-[651px]:pointer-coarse:size-11 min-[651px]:pointer-coarse:min-w-11 ${x}`,title:d||(!O&&v?`${A} (${v})`:A),"aria-label":d?`${A}: ${d}`:A,"aria-busy":O||void 0,"aria-disabled":k||void 0,"aria-description":p&&!E?m:void 0,"data-long-press":p&&!E?`steer`:void 0,onPointerDown:e=>{C.current=!1,!(!p||E||k||e.pointerType===`mouse`)&&(T(),S.current=setTimeout(()=>{S.current=null,C.current=!0,p()},500))},onPointerUp:T,onPointerCancel:T,onPointerLeave:T,onContextMenu:e=>{p&&e.preventDefault()},onClick:e=>{if(C.current){C.current=!1,e.preventDefault();return}if(k){e.preventDefault();return}E&&g?.()},disabled:!d&&k,children:O?(0,b.jsx)(c,{className:`animate-spin ${w}`,size:17}):E?(0,b.jsx)(l,{size:13,fill:`currentColor`,"aria-hidden":`true`}):(0,b.jsx)(a,{size:17,strokeWidth:2.1,className:w})})}export{A as a,T as c,x as i,C as n,j as o,w as r,k as s,S as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./index-CiRnxTh1.js";import{t}from"./storage-DtvZ_lEu.js";import{n}from"./startup-queries-BlA4Hayt.js";import{t as r}from"./api-AeFmYDtL.js";import{n as i,t as a}from"./workspace-order-store-C-jYrC0l.js";import{c as o,u as s}from"./events-CuVwhRWu.js";import{s as c,t as l,u}from"./session-workspaces-Brm-8lHh.js";import{t as d}from"./pick-system-directory-CaiscVfr.js";function f(e){return e.cwd?`${e.label} · ${e.cwd}`:e.label}async function p(){return(await n(`sessions`,!0)).sessions}function m(n,r,i){try{let a=e.getItem(t.activeSession)||``,s=c(a,n,r,i);if(s===null)return;s?e.setItem(t.activeSession,s):e.removeItem(t.activeSession),o(s)}catch{}}async function h(e,{t,notify:n,requestConfirm:a}){let o=f(e);try{let c=await p(),d=u(c,e.key);if(!d.length)return n(t(`navigation:appSidebar.projectNoChats`,{project:o}),`info`),`empty`;if(!await a({title:t(`navigation:appSidebar.deleteProject`),message:t(`navigation:appSidebar.deleteProjectConfirm`,{project:o,count:d.length}),confirmLabel:t(`navigation:appSidebar.deleteProjectAction`)}))return`cancelled`;let f=await l(d.map(e=>e.id),e=>r(`/api/sessions/${encodeURIComponent(e)}`,{method:`DELETE`}));s(f.deletedIds.length?{deletedIds:f.deletedIds}:void 0);let h=new Set(f.deletedIds),g=null;try{g=await p()}catch{}if(m(g??c.filter(e=>!h.has(e.id)),h,g!==null),g===null)return n(t(`navigation:appSidebar.projectDeleteUnverified`,{project:o,deleted:f.deletedIds.length}),`error`),`unverified`;let _=u(g,e.key).length;return f.failedId!==null||_?(n(t(`navigation:appSidebar.projectDeletePartial`,{project:o,deleted:f.deletedIds.length,remaining:_}),`error`),`partial`):(e.cwd&&i.getState().unregisterProject(e.cwd),n(t(`navigation:appSidebar.projectDeleted`,{project:o})),`deleted`)}catch(e){return n(e instanceof Error?e.message:String(e),`error`),`failed`}}function g(e,{t,notify:n}){if(!e.cwd||e.key===`\0`)return!1;let r=i.getState().unregisterProject(e.cwd);return r&&n(t(`navigation:appSidebar.projectRemoved`,{project:f(e)})),r}function _(e,t,{t:n,notify:r}){try{return a.getState().setWorkspaceName(e.cwd,t),r(n(`navigation:appSidebar.projectNameUpdated`)),!0}catch{return r(n(`navigation:appSidebar.projectNameSaveFailed`),`error`),!1}}async function v(e,t,n,r){if(!e.cwd||e.key===`\0`)return!1;let{t:i,requestText:o}=n,s=(await o({title:i(`navigation:appSidebar.renameProject`),message:r.description,inputLabel:i(`navigation:appSidebar.projectName`),value:e.label,maxLength:120,confirmLabel:i(`chat:chatHistoryPage.save`)}))?.trim()||``;if(!s)return!1;let c=s===t?``:s;return c!==(a.getState().names[e.key]||``)&&_(e,c,n)}function y(e,t){return!e.cwd||!a.getState().names[e.key]?!1:_(e,``,t)}function b(e){return d(``,e(`common:workspacePicker.setWorkingDirectory`))}function x(e,t){return r(`/api/workspace-folders`,{method:`POST`,body:JSON.stringify({parent:e,name:t})})}function S(e){return e.includes(`\\`)&&!e.includes(`/`)?`\\`:`/`}function C(e){let t=e.trim().replace(/[\\/]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));if(n<0)return``;let r=t.slice(0,n);return r?/^[a-z]:$/i.test(r)?`${r}${t[n]}`:r:t[0]}function w(e,t){let n=e.trim();return n?/[\\/]$/.test(n)?`${n}${t}`:`${n}${S(n)}${t}`:t}export{b as a,y as c,h as i,C as n,g as o,x as r,v as s,w as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{u as t}from"./vendor-router-CSN_DGvx.js";import{t as n}from"./index-rOrQSojS.js";import{i as r,r as i}from"./vendor-react-DwNgTV1j.js";import{o as a,r as o}from"./routes-DIeaqWVc.js";import{t as s}from"./use-i18n-CaxKosZm.js";import{a as c,i as l,o as u}from"./vendor-state-GkUciC5H.js";import{r as d,t as f}from"./useQuery-DdcpUQhO.js";import{A as p,j as m,n as h,r as g,t as _}from"./session-scope-CFKKqbrz.js";import{t as v}from"./createLucideIcon-Cd-3GVxJ.js";import{t as y}from"./ellipsis-CfGKfbq6.js";import{t as b}from"./grip-vertical-B__LYT0s.js";import{t as x}from"./plus-fQbSqB1n.js";import{t as S}from"./rotate-ccw-C0v8V77_.js";import{t as C}from"./settings-2-CXJjXJS9.js";import{t as w}from"./x-07u4-129.js";import{c as T,d as E,f as D,i as O,p as k,r as A,t as ee,u as te}from"./dropdown-menu-Ds0gD8S8.js";import{i as ne,n as re,t as j}from"./popover-DlJP3VbH.js";import{t as M}from"./utils-C8uzG5AZ.js";import{t as N}from"./button-CCcCN8tE.js";import{A as P,D as ie,E as ae,I as oe,O as se,S as F,f as ce,i as I,t as L,u as R}from"./use-studio-actions-D0_lMh6m.js";var le=v(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),ue=v(`square-arrow-out-up-right`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),z=e(r(),1),B=e=>Math.min(1,Math.max(0,e)),V=e=>Number.isFinite(e)?Math.max(0,e):0,H=8,U=12,de=160;function fe(e,t,n=0){let r=Math.max(0,V(e.width)-V(t.width)),i=Math.max(0,V(e.height)-V(t.height)),a=Math.max(0,i-de),o=Math.max(0,a-H),s=V(t.height)+U,c=s?Math.floor(o/s)+1:1,l=Math.max(0,Math.floor(n)),u=Math.floor(l/c),d=l%c,f=r-H-u*(V(t.width)+U),p=a-d*s;return{x:r?B(f/r):1,y:i?B(p/i):1}}function pe(e,t){return`${t?`mobile`:`desktop`}:${e}`}function W(e,t,n){return{x:B(e.x)*Math.max(0,V(t.width)-V(n.width)),y:B(e.y)*Math.max(0,V(t.height)-V(n.height))}}function G(e,t,n,r){let i=W(e,n,r),a=Math.max(0,V(n.width)-V(r.width)),o=Math.max(0,V(n.height)-V(r.height));return{x:B(a?(i.x+t.x)/a:e.x),y:B(o?(i.y+t.y)/o:e.y)}}function K(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q(e){if(!Array.isArray(e))return[];let t=new Map;for(let n of e)!K(n)||typeof n.key!=`string`||!/^(desktop|mobile):[a-zA-Z0-9][a-zA-Z0-9._:-]{0,95}$/.test(n.key)||!K(n.position)||typeof n.position.x!=`number`||!Number.isFinite(n.position.x)||typeof n.position.y!=`number`||!Number.isFinite(n.position.y)||(t.delete(n.key),t.set(n.key,{x:B(n.position.x),y:B(n.position.y)}),t.size>128&&t.delete(t.keys().next().value??``));return[...t].map(([e,t])=>({key:e,position:t}))}function me(e,t,n){return q([...e.filter(e=>e.key!==t),{key:t,position:n}])}var he=l(()=>({getItem:e=>{try{return n.getItem(e)}catch{return null}},setItem:(e,t)=>{try{n.setItem(e,t)}catch{}},removeItem:e=>{try{n.removeItem(e)}catch{}}})),J=u()(c(e=>({positions:[],setPosition:(t,n)=>e(e=>({positions:me(e.positions,t,n)})),resetPosition:t=>e(e=>({positions:e.positions.filter(e=>e.key!==t)}))}),{name:`pisper-floating-placement`,version:1,storage:he,partialize:({positions:e})=>({positions:e}),merge:(e,t)=>({...t,positions:q(e&&typeof e==`object`&&`positions`in e?e.positions:void 0)})})),Y=i(),X={width:0,height:0},ge=/^(?:desktop|mobile):[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Z=`flex items-center justify-center rounded-full bg-key text-content-muted shadow-key ring-1 ring-key-border hover:text-content`;function _e(e){let t=e.component.manifest,n=t&&se(t,`floating`)?.size||ae;return{width:n.w,height:n.h}}function ve({placed:e,boundaryRef:t,activeSessionId:n,notify:r,onClose:i,stackIndex:a}){let{t:o}=s(),{instance:c,component:l}=e,u=R(l,r),d=pe(c.instanceId,!1),f=J(e=>e.positions.find(e=>e.key===d)?.position),p=(0,z.useRef)(null),m=(0,z.useRef)(null),[h,g]=(0,z.useState)(null),[_,v]=(0,z.useState)({bounds:X,widget:X}),y=f??fe(_.bounds,_.widget,a),x=(0,z.useId)(),C=_e(e),T=c.title||l.manifest?.name||l.name;(0,z.useEffect)(()=>{let e=t.current,n=p.current;if(!e||!n)return;let r=()=>{let t={bounds:{width:e.clientWidth,height:e.clientHeight},widget:{width:n.offsetWidth,height:n.offsetHeight}};v(e=>e.bounds.width===t.bounds.width&&e.bounds.height===t.bounds.height&&e.widget.width===t.widget.width&&e.widget.height===t.widget.height?e:t)},i=new ResizeObserver(()=>r());return r(),i.observe(e),i.observe(n),window.addEventListener(`resize`,r),()=>{i.disconnect(),window.removeEventListener(`resize`,r)}},[t]),(0,z.useEffect)(()=>(g(null),()=>{let e=m.current;m.current=null,e?.element.hasPointerCapture(e.pointerId)&&e.element.releasePointerCapture(e.pointerId)}),[d]);let E=(e,t)=>{let n=m.current;!n||n.pointerId!==e.pointerId||(m.current=null,t&&J.getState().setPosition(d,n.latest),g(null),n.element.hasPointerCapture(n.pointerId)&&n.element.releasePointerCapture(n.pointerId))},D=()=>J.getState().resetPosition(d),O=e=>{let t=e.shiftKey?32:12,n={ArrowLeft:{x:-t,y:0},ArrowRight:{x:t,y:0},ArrowUp:{x:0,y:-t},ArrowDown:{x:0,y:t}};if(e.key===`Home`){e.preventDefault(),D();return}let r=n[e.key];r&&(e.preventDefault(),J.getState().setPosition(d,G(y,r,_.bounds,_.widget)))},k=W(h??y,_.bounds,_.widget);return(0,Y.jsxs)(`div`,{ref:p,role:`group`,"aria-label":T,"data-floating-widget":c.instanceId,"data-floating-component":l.id,className:`pointer-events-auto absolute flex max-w-full flex-col px-6`,style:{left:k.x,top:k.y,width:C.width+48,maxHeight:`100%`,visibility:_.bounds.width>0?`visible`:`hidden`},children:[(0,Y.jsxs)(`div`,{className:`absolute top-1/2 left-0 z-10 flex -translate-y-1/2 flex-col items-center gap-1`,children:[(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.move`),"aria-describedby":x,title:o(`custom-ui:floating.moveHint`),className:M(Z,`h-6 w-5 touch-none`),style:{cursor:h?`grabbing`:`grab`},"data-floating-move":!0,onKeyDown:O,onPointerDown:e=>{e.button!==0||m.current||(e.preventDefault(),e.currentTarget.focus({preventScroll:!0}),e.currentTarget.setPointerCapture(e.pointerId),m.current={pointerId:e.pointerId,element:e.currentTarget,x:e.clientX,y:e.clientY,initial:y,latest:y},g(y))},onPointerMove:e=>{let t=m.current;if(!t||t.pointerId!==e.pointerId)return;let n=G(t.initial,{x:e.clientX-t.x,y:e.clientY-t.y},_.bounds,_.widget);t.latest=n,g(n)},onPointerUp:e=>E(e,!0),onPointerCancel:e=>E(e,!1),onLostPointerCapture:e=>E(e,!1),children:(0,Y.jsx)(b,{className:`size-3`})}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.resetPosition`),title:o(`custom-ui:floating.resetPosition`),onClick:D,className:M(Z,`size-5`),children:(0,Y.jsx)(S,{className:`size-3`})}),(0,Y.jsx)(`span`,{id:x,className:`sr-only`,children:o(`custom-ui:floating.moveHint`)})]}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.close`),title:o(`custom-ui:floating.close`),"data-floating-close":!0,onClick:()=>i(c.instanceId),className:M(Z,`absolute top-1/2 right-0 z-10 size-5 -translate-y-1/2`),children:(0,Y.jsx)(w,{className:`size-3`})}),(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-md border border-stroke bg-panel shadow-key`,style:{height:C.height},children:(0,Y.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`floating`,title:c.title,props:c.props},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onRequestFix:u,className:`h-full`})})]})}function ye({placed:e,activeSessionId:t,notify:n,hidden:r=!1}){let{t:i}=s(),a=d(),o=(0,z.useRef)(null);(0,z.useEffect)(()=>{let e=J.getState();for(let t of e.positions)ge.test(t.key)||e.resetPosition(t.key)},[]);let c=e=>{p(e,{enabled:!1}).then(()=>a.invalidateQueries({queryKey:m.instances()}),()=>n(i(`custom-ui:floating.closeFailed`)))};return(0,Y.jsx)(`div`,{ref:o,className:`pointer-events-none fixed inset-x-2 top-12 bottom-2 z-40 overflow-hidden`,hidden:r,"data-floating-custom-ui":!0,children:e.map((e,r)=>(0,Y.jsx)(ve,{placed:e,boundaryRef:o,activeSessionId:t,notify:n,onClose:c,stackIndex:r},e.instance.instanceId))})}var be=[`session-panel`,`feature-page`,`floating`];function xe(e,t){let{instance:n,component:r}=e;return n.title||r.manifest?.i18n[t]?.name||r.name}function Q({placed:e,label:n,instances:r,notify:i}){let{t:o}=s(),c=t(),l=L(i),[u,d]=(0,z.useState)(!1),{instance:f,component:p}=e,m=async e=>{if(!u){d(!0);try{if(!await l.place(p,r,{surface:e,...f.title?{title:f.title}:{},props:f.props}))return;await l.unplace(f)&&i(o(`custom-ui:overview.moved`,{place:I(e,o)}))}finally{d(!1)}}};return(0,Y.jsxs)(ee,{children:[(0,Y.jsx)(k,{asChild:!0,children:(0,Y.jsx)(N,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`flex-none`,disabled:u,"aria-label":o(`custom-ui:overview.menu`,{name:n}),title:o(`custom-ui:overview.menu`,{name:n}),"data-overview-component-menu":!0,children:(0,Y.jsx)(y,{"aria-hidden":`true`})})}),(0,Y.jsxs)(A,{align:`end`,className:`w-52`,children:[(0,Y.jsxs)(O,{onSelect:()=>c(a(p.id),{state:{componentInstanceId:f.instanceId}}),children:[(0,Y.jsx)(C,{"aria-hidden":`true`}),o(`custom-ui:overview.settings`)]}),(0,Y.jsxs)(O,{onSelect:()=>c(a(p.id)),children:[(0,Y.jsx)(ue,{"aria-hidden":`true`}),o(`custom-ui:tool.openInStudio`)]}),(0,Y.jsxs)(te,{children:[(0,Y.jsxs)(D,{"data-overview-component-move":!0,children:[(0,Y.jsx)(le,{"aria-hidden":`true`}),o(`custom-ui:overview.move`)]}),(0,Y.jsx)(E,{className:`w-48`,children:be.map(e=>{let t=F(p.manifest,e),n=r.some(t=>t.componentId===p.id&&t.surface===e&&t.enabled);return(0,Y.jsxs)(O,{disabled:!t||n,"data-overview-component-move-to":e,onSelect:()=>void m(e),children:[I(e,o),(0,Y.jsx)(`span`,{className:`ml-auto text-xs text-content-muted`,children:t?n?o(`custom-ui:studio.placed`):``:o(`custom-ui:studio.placeUndeclaredShort`)})]},e)})})]}),(0,Y.jsx)(T,{}),(0,Y.jsxs)(O,{"data-overview-component-remove":!0,onSelect:()=>{l.unplace(f).then(e=>{e&&i(o(`custom-ui:overview.removed`,{name:n}))})},children:[(0,Y.jsx)(w,{"aria-hidden":`true`}),o(`custom-ui:overview.remove`)]})]})]})}function Se({placed:e,instances:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a,language:o}=s(),{instance:c,component:l}=e,u=c.size===`M`?`M`:`S`,d=xe(e,o),f=R(l,r);return(0,Y.jsxs)(`article`,{"aria-label":d,"data-overview-component":c.instanceId,"data-overview-component-id":l.id,"data-overview-component-size":u,className:`flex-none overflow-hidden rounded-[var(--r-lg)] bg-panel ring-1 ring-stroke`,children:[(0,Y.jsxs)(`header`,{className:`flex h-9 items-center gap-2 border-b border-stroke-soft pr-1 pl-3 pointer-coarse:h-12`,children:[(0,Y.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[13px] leading-5 font-medium text-content`,children:d}),(0,Y.jsx)(`span`,{className:`flex-none rounded-xs border border-stroke px-1.5 text-[11px] leading-4 text-content-muted`,children:a(`custom-ui:overview.badge`)}),(0,Y.jsx)(Q,{placed:e,label:d,instances:t,notify:r})]}),(0,Y.jsx)(`div`,{"data-overview-component-body":!0,className:`overflow-hidden`,style:{height:ie[u].h},children:(0,Y.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`overview-card`,title:c.title,props:c.props,size:u},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onOpenSession:i,onRequestFix:f,className:`h-full`})})]})}function $({className:e}){let{t:n}=s(),r=t();return(0,Y.jsxs)(`button`,{type:`button`,"data-overview-component-place":!0,onClick:()=>r(o.components),className:M(`flex h-9 w-full flex-none items-center justify-center gap-1.5 rounded-[var(--r-lg)] border border-dashed border-stroke-strong text-[12.5px] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,e),children:[(0,Y.jsx)(x,{className:`size-3.5`,"aria-hidden":`true`}),n(`custom-ui:overview.place`)]})}function Ce({placed:e,layout:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a}=s(),o=f(g()).data?.instances??[],c=e.map(e=>(0,Y.jsx)(Se,{placed:e,instances:o,activeSessionId:n,notify:r,onOpenSession:i},e.instance.instanceId));return t===`popover`?(0,Y.jsxs)(j,{children:[(0,Y.jsx)(ne,{asChild:!0,children:(0,Y.jsx)(N,{variant:`outline`,"data-overview-components-trigger":!0,children:a(`custom-ui:overview.trigger`,{count:e.length})})}),(0,Y.jsxs)(re,{align:`end`,"aria-label":a(`custom-ui:overview.heading`),"data-overview-components":`popover`,className:`max-h-(--radix-popover-content-available-height) w-[344px] gap-3 overflow-y-auto p-3`,children:[c,(0,Y.jsx)($,{})]})]}):(0,Y.jsxs)(`div`,{"data-overview-components":t,className:M(`flex flex-col gap-3`,t===`phone`&&`mt-6`),children:[(0,Y.jsx)(`h2`,{className:`text-[13px] leading-5 font-medium text-content-secondary`,children:a(`custom-ui:overview.heading`)}),c,(0,Y.jsx)($,{})]})}function we({placed:e,sessionId:t,cwd:n,notify:r,onOpenSession:i}){let a=oe().find(e=>e.id===t),o=a?.title??``,s=a?.status??`idle`,c=(0,z.useMemo)(()=>({id:t,title:o,cwd:a?.cwd||n,status:s}),[n,t,s,a?.cwd,o]),{instance:l,component:u}=e,d=R(u,r);return(0,Y.jsx)(`div`,{"data-session-panel-component":l.instanceId,className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:(0,Y.jsx)(P,{component:u,instance:{instanceId:l.instanceId,surface:`session-panel`,title:l.title,props:l.props},session:c,notify:r,onOpenSession:i,onRequestFix:d,className:`h-full`},t)})}function Te(e,t){return e.manifest?.i18n[t]?.name||e.name}function Ee({cwd:e,notify:t,onAdded:n}){let{t:r,language:i}=s(),a=f(h()),o=f(g()),c=L(t),[l,u]=(0,z.useState)(null),d=o.data?.instances??[],p=(a.data?.components??[]).filter(e=>ce(e)&&F(e.manifest,`session-panel`)),m=async(e,t)=>{if(!l){u(e.id);try{let r=await c.place(e,d,{surface:`session-panel`,scope:t});r&&n(r.instance.instanceId)}finally{u(null)}}};return a.isPending||o.isPending?(0,Y.jsx)(`p`,{role:`status`,className:`text-content-muted`,children:r(`custom-ui:customUiPage.loading`)}):a.error||o.error?(0,Y.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,Y.jsx)(`p`,{role:`alert`,className:`text-content-secondary`,children:r(`custom-ui:widget.catalogFailed`)}),(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,onClick:()=>{a.refetch(),o.refetch()},children:r(`custom-ui:widget.retry`)})]}):p.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-session-component-add-menu":!0,children:[(0,Y.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.addHint`)}),(0,Y.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:p.map(t=>{let a=Te(t,i),o=d.find(e=>e.componentId===t.id&&e.surface===`session-panel`),s=!!(o?.enabled&&_(o.scope,e));return(0,Y.jsxs)(`li`,{"data-session-component-candidate":t.id,className:`flex flex-col gap-1.5 rounded-sm px-1.5 py-1.5`,children:[(0,Y.jsx)(`span`,{className:`truncate text-[13px] font-medium text-content`,children:a}),s&&o?(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`ghost`,className:`self-start`,onClick:()=>n(o.instanceId),children:r(`custom-ui:studio.placed`)}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null,"data-session-component-scope":`all`,onClick:()=>void m(t,{type:`all`}),children:r(`custom-ui:studio.scopeAll`)}),(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null||!e,"data-session-component-scope":`project`,onClick:()=>void m(t,{type:`project`,cwd:e}),children:r(`custom-ui:sessionPanel.thisProject`)})]})]},t.id)})})]}):(0,Y.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.empty`)})}export{P as ComponentHost,ye as FloatingComponents,Ce as OverviewComponents,Ee as SessionComponentAddMenu,we as SessionPanelComponent};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{u as t}from"./vendor-router-CSN_DGvx.js";import{t as n}from"./index-CiRnxTh1.js";import{i as r,r as i}from"./vendor-react-DwNgTV1j.js";import{o as a,r as o}from"./routes-DIeaqWVc.js";import{t as s}from"./use-i18n-BVRhlQ1v.js";import{a as c,i as l,o as u}from"./vendor-state-GkUciC5H.js";import{r as d,t as f}from"./useQuery-DfOU-27z.js";import{A as p,j as m,n as h,r as g,t as _}from"./session-scope-yI3Hi_8F.js";import{t as v}from"./createLucideIcon-Cd-3GVxJ.js";import{t as y}from"./ellipsis-CfGKfbq6.js";import{t as b}from"./grip-vertical-B__LYT0s.js";import{t as x}from"./plus-fQbSqB1n.js";import{t as S}from"./rotate-ccw-C0v8V77_.js";import{t as C}from"./settings-2-CXJjXJS9.js";import{t as w}from"./x-07u4-129.js";import{c as T,d as E,f as D,i as O,p as k,r as A,t as ee,u as te}from"./dropdown-menu-Ds0gD8S8.js";import{i as ne,n as re,t as j}from"./popover-BKgOyW2Z.js";import{t as M}from"./utils-C8uzG5AZ.js";import{t as N}from"./button-CCcCN8tE.js";import{A as P,D as ie,E as ae,I as oe,O as se,S as F,f as ce,i as I,t as L,u as R}from"./use-studio-actions-DEeR_rS9.js";var le=v(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),ue=v(`square-arrow-out-up-right`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),z=e(r(),1),B=e=>Math.min(1,Math.max(0,e)),V=e=>Number.isFinite(e)?Math.max(0,e):0,H=8,U=12,de=160;function fe(e,t,n=0){let r=Math.max(0,V(e.width)-V(t.width)),i=Math.max(0,V(e.height)-V(t.height)),a=Math.max(0,i-de),o=Math.max(0,a-H),s=V(t.height)+U,c=s?Math.floor(o/s)+1:1,l=Math.max(0,Math.floor(n)),u=Math.floor(l/c),d=l%c,f=r-H-u*(V(t.width)+U),p=a-d*s;return{x:r?B(f/r):1,y:i?B(p/i):1}}function pe(e,t){return`${t?`mobile`:`desktop`}:${e}`}function W(e,t,n){return{x:B(e.x)*Math.max(0,V(t.width)-V(n.width)),y:B(e.y)*Math.max(0,V(t.height)-V(n.height))}}function G(e,t,n,r){let i=W(e,n,r),a=Math.max(0,V(n.width)-V(r.width)),o=Math.max(0,V(n.height)-V(r.height));return{x:B(a?(i.x+t.x)/a:e.x),y:B(o?(i.y+t.y)/o:e.y)}}function K(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q(e){if(!Array.isArray(e))return[];let t=new Map;for(let n of e)!K(n)||typeof n.key!=`string`||!/^(desktop|mobile):[a-zA-Z0-9][a-zA-Z0-9._:-]{0,95}$/.test(n.key)||!K(n.position)||typeof n.position.x!=`number`||!Number.isFinite(n.position.x)||typeof n.position.y!=`number`||!Number.isFinite(n.position.y)||(t.delete(n.key),t.set(n.key,{x:B(n.position.x),y:B(n.position.y)}),t.size>128&&t.delete(t.keys().next().value??``));return[...t].map(([e,t])=>({key:e,position:t}))}function me(e,t,n){return q([...e.filter(e=>e.key!==t),{key:t,position:n}])}var he=l(()=>({getItem:e=>{try{return n.getItem(e)}catch{return null}},setItem:(e,t)=>{try{n.setItem(e,t)}catch{}},removeItem:e=>{try{n.removeItem(e)}catch{}}})),J=u()(c(e=>({positions:[],setPosition:(t,n)=>e(e=>({positions:me(e.positions,t,n)})),resetPosition:t=>e(e=>({positions:e.positions.filter(e=>e.key!==t)}))}),{name:`pisper-floating-placement`,version:1,storage:he,partialize:({positions:e})=>({positions:e}),merge:(e,t)=>({...t,positions:q(e&&typeof e==`object`&&`positions`in e?e.positions:void 0)})})),Y=i(),X={width:0,height:0},ge=/^(?:desktop|mobile):[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Z=`flex items-center justify-center rounded-full bg-key text-content-muted shadow-key ring-1 ring-key-border hover:text-content`;function _e(e){let t=e.component.manifest,n=t&&se(t,`floating`)?.size||ae;return{width:n.w,height:n.h}}function ve({placed:e,boundaryRef:t,activeSessionId:n,notify:r,onClose:i,stackIndex:a}){let{t:o}=s(),{instance:c,component:l}=e,u=R(l,r),d=pe(c.instanceId,!1),f=J(e=>e.positions.find(e=>e.key===d)?.position),p=(0,z.useRef)(null),m=(0,z.useRef)(null),[h,g]=(0,z.useState)(null),[_,v]=(0,z.useState)({bounds:X,widget:X}),y=f??fe(_.bounds,_.widget,a),x=(0,z.useId)(),C=_e(e),T=c.title||l.manifest?.name||l.name;(0,z.useEffect)(()=>{let e=t.current,n=p.current;if(!e||!n)return;let r=()=>{let t={bounds:{width:e.clientWidth,height:e.clientHeight},widget:{width:n.offsetWidth,height:n.offsetHeight}};v(e=>e.bounds.width===t.bounds.width&&e.bounds.height===t.bounds.height&&e.widget.width===t.widget.width&&e.widget.height===t.widget.height?e:t)},i=new ResizeObserver(()=>r());return r(),i.observe(e),i.observe(n),window.addEventListener(`resize`,r),()=>{i.disconnect(),window.removeEventListener(`resize`,r)}},[t]),(0,z.useEffect)(()=>(g(null),()=>{let e=m.current;m.current=null,e?.element.hasPointerCapture(e.pointerId)&&e.element.releasePointerCapture(e.pointerId)}),[d]);let E=(e,t)=>{let n=m.current;!n||n.pointerId!==e.pointerId||(m.current=null,t&&J.getState().setPosition(d,n.latest),g(null),n.element.hasPointerCapture(n.pointerId)&&n.element.releasePointerCapture(n.pointerId))},D=()=>J.getState().resetPosition(d),O=e=>{let t=e.shiftKey?32:12,n={ArrowLeft:{x:-t,y:0},ArrowRight:{x:t,y:0},ArrowUp:{x:0,y:-t},ArrowDown:{x:0,y:t}};if(e.key===`Home`){e.preventDefault(),D();return}let r=n[e.key];r&&(e.preventDefault(),J.getState().setPosition(d,G(y,r,_.bounds,_.widget)))},k=W(h??y,_.bounds,_.widget);return(0,Y.jsxs)(`div`,{ref:p,role:`group`,"aria-label":T,"data-floating-widget":c.instanceId,"data-floating-component":l.id,className:`pointer-events-auto absolute flex max-w-full flex-col px-6`,style:{left:k.x,top:k.y,width:C.width+48,maxHeight:`100%`,visibility:_.bounds.width>0?`visible`:`hidden`},children:[(0,Y.jsxs)(`div`,{className:`absolute top-1/2 left-0 z-10 flex -translate-y-1/2 flex-col items-center gap-1`,children:[(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.move`),"aria-describedby":x,title:o(`custom-ui:floating.moveHint`),className:M(Z,`h-6 w-5 touch-none`),style:{cursor:h?`grabbing`:`grab`},"data-floating-move":!0,onKeyDown:O,onPointerDown:e=>{e.button!==0||m.current||(e.preventDefault(),e.currentTarget.focus({preventScroll:!0}),e.currentTarget.setPointerCapture(e.pointerId),m.current={pointerId:e.pointerId,element:e.currentTarget,x:e.clientX,y:e.clientY,initial:y,latest:y},g(y))},onPointerMove:e=>{let t=m.current;if(!t||t.pointerId!==e.pointerId)return;let n=G(t.initial,{x:e.clientX-t.x,y:e.clientY-t.y},_.bounds,_.widget);t.latest=n,g(n)},onPointerUp:e=>E(e,!0),onPointerCancel:e=>E(e,!1),onLostPointerCapture:e=>E(e,!1),children:(0,Y.jsx)(b,{className:`size-3`})}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.resetPosition`),title:o(`custom-ui:floating.resetPosition`),onClick:D,className:M(Z,`size-5`),children:(0,Y.jsx)(S,{className:`size-3`})}),(0,Y.jsx)(`span`,{id:x,className:`sr-only`,children:o(`custom-ui:floating.moveHint`)})]}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.close`),title:o(`custom-ui:floating.close`),"data-floating-close":!0,onClick:()=>i(c.instanceId),className:M(Z,`absolute top-1/2 right-0 z-10 size-5 -translate-y-1/2`),children:(0,Y.jsx)(w,{className:`size-3`})}),(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-md border border-stroke bg-panel shadow-key`,style:{height:C.height},children:(0,Y.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`floating`,title:c.title,props:c.props},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onRequestFix:u,className:`h-full`})})]})}function ye({placed:e,activeSessionId:t,notify:n,hidden:r=!1}){let{t:i}=s(),a=d(),o=(0,z.useRef)(null);(0,z.useEffect)(()=>{let e=J.getState();for(let t of e.positions)ge.test(t.key)||e.resetPosition(t.key)},[]);let c=e=>{p(e,{enabled:!1}).then(()=>a.invalidateQueries({queryKey:m.instances()}),()=>n(i(`custom-ui:floating.closeFailed`)))};return(0,Y.jsx)(`div`,{ref:o,className:`pointer-events-none fixed inset-x-2 top-12 bottom-2 z-40 overflow-hidden`,hidden:r,"data-floating-custom-ui":!0,children:e.map((e,r)=>(0,Y.jsx)(ve,{placed:e,boundaryRef:o,activeSessionId:t,notify:n,onClose:c,stackIndex:r},e.instance.instanceId))})}var be=[`session-panel`,`feature-page`,`floating`];function xe(e,t){let{instance:n,component:r}=e;return n.title||r.manifest?.i18n[t]?.name||r.name}function Q({placed:e,label:n,instances:r,notify:i}){let{t:o}=s(),c=t(),l=L(i),[u,d]=(0,z.useState)(!1),{instance:f,component:p}=e,m=async e=>{if(!u){d(!0);try{if(!await l.place(p,r,{surface:e,...f.title?{title:f.title}:{},props:f.props}))return;await l.unplace(f)&&i(o(`custom-ui:overview.moved`,{place:I(e,o)}))}finally{d(!1)}}};return(0,Y.jsxs)(ee,{children:[(0,Y.jsx)(k,{asChild:!0,children:(0,Y.jsx)(N,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`flex-none`,disabled:u,"aria-label":o(`custom-ui:overview.menu`,{name:n}),title:o(`custom-ui:overview.menu`,{name:n}),"data-overview-component-menu":!0,children:(0,Y.jsx)(y,{"aria-hidden":`true`})})}),(0,Y.jsxs)(A,{align:`end`,className:`w-52`,children:[(0,Y.jsxs)(O,{onSelect:()=>c(a(p.id),{state:{componentInstanceId:f.instanceId}}),children:[(0,Y.jsx)(C,{"aria-hidden":`true`}),o(`custom-ui:overview.settings`)]}),(0,Y.jsxs)(O,{onSelect:()=>c(a(p.id)),children:[(0,Y.jsx)(ue,{"aria-hidden":`true`}),o(`custom-ui:tool.openInStudio`)]}),(0,Y.jsxs)(te,{children:[(0,Y.jsxs)(D,{"data-overview-component-move":!0,children:[(0,Y.jsx)(le,{"aria-hidden":`true`}),o(`custom-ui:overview.move`)]}),(0,Y.jsx)(E,{className:`w-48`,children:be.map(e=>{let t=F(p.manifest,e),n=r.some(t=>t.componentId===p.id&&t.surface===e&&t.enabled);return(0,Y.jsxs)(O,{disabled:!t||n,"data-overview-component-move-to":e,onSelect:()=>void m(e),children:[I(e,o),(0,Y.jsx)(`span`,{className:`ml-auto text-xs text-content-muted`,children:t?n?o(`custom-ui:studio.placed`):``:o(`custom-ui:studio.placeUndeclaredShort`)})]},e)})})]}),(0,Y.jsx)(T,{}),(0,Y.jsxs)(O,{"data-overview-component-remove":!0,onSelect:()=>{l.unplace(f).then(e=>{e&&i(o(`custom-ui:overview.removed`,{name:n}))})},children:[(0,Y.jsx)(w,{"aria-hidden":`true`}),o(`custom-ui:overview.remove`)]})]})]})}function Se({placed:e,instances:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a,language:o}=s(),{instance:c,component:l}=e,u=c.size===`M`?`M`:`S`,d=xe(e,o),f=R(l,r);return(0,Y.jsxs)(`article`,{"aria-label":d,"data-overview-component":c.instanceId,"data-overview-component-id":l.id,"data-overview-component-size":u,className:`flex-none overflow-hidden rounded-[var(--r-lg)] bg-panel ring-1 ring-stroke`,children:[(0,Y.jsxs)(`header`,{className:`flex h-9 items-center gap-2 border-b border-stroke-soft pr-1 pl-3 pointer-coarse:h-12`,children:[(0,Y.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[13px] leading-5 font-medium text-content`,children:d}),(0,Y.jsx)(`span`,{className:`flex-none rounded-xs border border-stroke px-1.5 text-[11px] leading-4 text-content-muted`,children:a(`custom-ui:overview.badge`)}),(0,Y.jsx)(Q,{placed:e,label:d,instances:t,notify:r})]}),(0,Y.jsx)(`div`,{"data-overview-component-body":!0,className:`overflow-hidden`,style:{height:ie[u].h},children:(0,Y.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`overview-card`,title:c.title,props:c.props,size:u},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onOpenSession:i,onRequestFix:f,className:`h-full`})})]})}function $({className:e}){let{t:n}=s(),r=t();return(0,Y.jsxs)(`button`,{type:`button`,"data-overview-component-place":!0,onClick:()=>r(o.components),className:M(`flex h-9 w-full flex-none items-center justify-center gap-1.5 rounded-[var(--r-lg)] border border-dashed border-stroke-strong text-[12.5px] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,e),children:[(0,Y.jsx)(x,{className:`size-3.5`,"aria-hidden":`true`}),n(`custom-ui:overview.place`)]})}function Ce({placed:e,layout:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a}=s(),o=f(g()).data?.instances??[],c=e.map(e=>(0,Y.jsx)(Se,{placed:e,instances:o,activeSessionId:n,notify:r,onOpenSession:i},e.instance.instanceId));return t===`popover`?(0,Y.jsxs)(j,{children:[(0,Y.jsx)(ne,{asChild:!0,children:(0,Y.jsx)(N,{variant:`outline`,"data-overview-components-trigger":!0,children:a(`custom-ui:overview.trigger`,{count:e.length})})}),(0,Y.jsxs)(re,{align:`end`,"aria-label":a(`custom-ui:overview.heading`),"data-overview-components":`popover`,className:`max-h-(--radix-popover-content-available-height) w-[344px] gap-3 overflow-y-auto p-3`,children:[c,(0,Y.jsx)($,{})]})]}):(0,Y.jsxs)(`div`,{"data-overview-components":t,className:M(`flex flex-col gap-3`,t===`phone`&&`mt-6`),children:[(0,Y.jsx)(`h2`,{className:`text-[13px] leading-5 font-medium text-content-secondary`,children:a(`custom-ui:overview.heading`)}),c,(0,Y.jsx)($,{})]})}function we({placed:e,sessionId:t,cwd:n,notify:r,onOpenSession:i}){let a=oe().find(e=>e.id===t),o=a?.title??``,s=a?.status??`idle`,c=(0,z.useMemo)(()=>({id:t,title:o,cwd:a?.cwd||n,status:s}),[n,t,s,a?.cwd,o]),{instance:l,component:u}=e,d=R(u,r);return(0,Y.jsx)(`div`,{"data-session-panel-component":l.instanceId,className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:(0,Y.jsx)(P,{component:u,instance:{instanceId:l.instanceId,surface:`session-panel`,title:l.title,props:l.props},session:c,notify:r,onOpenSession:i,onRequestFix:d,className:`h-full`},t)})}function Te(e,t){return e.manifest?.i18n[t]?.name||e.name}function Ee({cwd:e,notify:t,onAdded:n}){let{t:r,language:i}=s(),a=f(h()),o=f(g()),c=L(t),[l,u]=(0,z.useState)(null),d=o.data?.instances??[],p=(a.data?.components??[]).filter(e=>ce(e)&&F(e.manifest,`session-panel`)),m=async(e,t)=>{if(!l){u(e.id);try{let r=await c.place(e,d,{surface:`session-panel`,scope:t});r&&n(r.instance.instanceId)}finally{u(null)}}};return a.isPending||o.isPending?(0,Y.jsx)(`p`,{role:`status`,className:`text-content-muted`,children:r(`custom-ui:customUiPage.loading`)}):a.error||o.error?(0,Y.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,Y.jsx)(`p`,{role:`alert`,className:`text-content-secondary`,children:r(`custom-ui:widget.catalogFailed`)}),(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,onClick:()=>{a.refetch(),o.refetch()},children:r(`custom-ui:widget.retry`)})]}):p.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-session-component-add-menu":!0,children:[(0,Y.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.addHint`)}),(0,Y.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:p.map(t=>{let a=Te(t,i),o=d.find(e=>e.componentId===t.id&&e.surface===`session-panel`),s=!!(o?.enabled&&_(o.scope,e));return(0,Y.jsxs)(`li`,{"data-session-component-candidate":t.id,className:`flex flex-col gap-1.5 rounded-sm px-1.5 py-1.5`,children:[(0,Y.jsx)(`span`,{className:`truncate text-[13px] font-medium text-content`,children:a}),s&&o?(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`ghost`,className:`self-start`,onClick:()=>n(o.instanceId),children:r(`custom-ui:studio.placed`)}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null,"data-session-component-scope":`all`,onClick:()=>void m(t,{type:`all`}),children:r(`custom-ui:studio.scopeAll`)}),(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null||!e,"data-session-component-scope":`project`,onClick:()=>void m(t,{type:`project`,cwd:e}),children:r(`custom-ui:sessionPanel.thisProject`)})]})]},t.id)})})]}):(0,Y.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.empty`)})}export{P as ComponentHost,ye as FloatingComponents,Ce as OverviewComponents,Ee as SessionComponentAddMenu,we as SessionPanelComponent};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mobile-runtime-recovery-tbTyacip.js","assets/rolldown-runtime-B0Z9INg1.js"])))=>i.map(i=>d[i]);
2
+ import{h as e}from"./vendor-router-CSN_DGvx.js";import{i as t,n}from"./abort-signal-f4JsiYKX.js";import{i as r,n as i,r as a}from"./http-response-PZN5QIRk.js";async function o(r){if(typeof window>`u`||!window.__PISPER_MOBILE_APP__)return;let i=n(r,s);try{await t(e(()=>import(`./mobile-runtime-recovery-tbTyacip.js`).then(e=>e.t).then(async e=>{e.installMobileRuntimeForegroundRecovery(),await e.waitForMobileRuntimeReady()}),__vite__mapDeps([0,1])),i.signal)}finally{i.dispose()}}var s=3e4;function c(e,t){return e instanceof Error&&e.message?e.message:typeof e==`string`&&e?e:t}async function l(e,t,n){let{body:a,data:l,headers:u,signal:d,timeout:f=s,...p}=t,m=l===void 0?a:l,h=new Headers(u),g;m!==void 0&&(m instanceof Blob?(g=m,h.has(`Content-Type`)||h.set(`Content-Type`,m.type||`application/octet-stream`)):(g=typeof m==`string`?m:JSON.stringify(m),h.has(`Content-Type`)||h.set(`Content-Type`,`application/json`)));let _=new AbortController,v=!1,y=()=>_.abort(d?.reason);d?.aborted?y():d?.addEventListener(`abort`,y,{once:!0});let b=f>0?setTimeout(()=>{v=!0,_.abort(new DOMException(`Request timed out`,`TimeoutError`))},f):void 0;try{if(await o(_.signal),_.signal.aborted)throw _.signal.reason;let t=await fetch(e,{...p,body:g,headers:h,signal:_.signal});if(!t.ok)throw await i(t);return await n(t)}catch(e){throw e instanceof r?e:v?new r(`请求超时 (${f}ms)`,{kind:`timeout`}):d?.aborted?new r(c(d.reason,`请求已取消`),{kind:`cancelled`}):new r(c(e,`请求失败 (network)`),{kind:`network`})}finally{b!==void 0&&clearTimeout(b),d?.removeEventListener(`abort`,y)}}function u(e,t={}){let{parse:n,...r}=t;return l(e,r,async e=>{let t=await a(e);return n?n(t):t})}function d(e,t={}){return l(e,t,e=>e.text())}function f(e,t={}){return l(e,t,e=>e.blob())}export{o as i,u as n,d as r,f as t};
@@ -0,0 +1 @@
1
+ import{c as e,d as t,l as n,u as r}from"./i18n-D80GstlU.js";var i=class extends Error{status;data;kind;constructor(e,t={}){super(e),this.name=`ApiError`,this.status=t.status,this.data=t.data,this.kind=t.kind}};function a(a){return new i(t(`common:api.invalidResponse`,n(e.language)?e.language:r()),{status:a,kind:`protocol`,data:{code:`INVALID_RESPONSE`}})}function o(e){if(e)try{let t=JSON.parse(e);return typeof t==`object`&&t&&!Array.isArray(t)?{...t,error:`error`in t&&typeof t.error==`string`?t.error:void 0}:{error:typeof t==`string`?t:e,body:t}}catch{return{error:e}}}async function s(e){let t=o(await e.text());return new i(t?.error||e.statusText||`HTTP ${e.status}`,{status:e.status,data:t,kind:`http`})}async function c(e){if(e.status===204)return;let t=await e.text();if(t)try{return JSON.parse(t)}catch{throw a(e.status)}}export{i,s as n,c as r,a as t};