pisper 0.6.24 → 0.6.25

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 (156) hide show
  1. package/package.json +5 -5
  2. package/web/.vite/manifest.json +769 -631
  3. package/web/assets/{AppDialog-BcXOXBcR.js → AppDialog-CuxO26Km.js} +1 -1
  4. package/web/assets/{AppOverlays-DhOsSE6q.js → AppOverlays-Bt5SL3PY.js} +1 -1
  5. package/web/assets/{AppSelect-BD6RAaJ5.js → AppSelect-DQYKUW5E.js} +1 -1
  6. package/web/assets/{AssetsPage-7Fuwati9.js → AssetsPage-BE6AzOGC.js} +1 -1
  7. package/web/assets/{BoardPage-C81aOK4p.js → BoardPage-DX0fJ_ap.js} +3 -3
  8. package/web/assets/ChannelsPage-CyT7oDYZ.js +1 -0
  9. package/web/assets/{ChatAppearancePage-DQr-uhHb.js → ChatAppearancePage-B6Dzj2Bj.js} +1 -1
  10. package/web/assets/ChatHistoryPage-Cq20l93c.js +1 -0
  11. package/web/assets/ChatPage-DgiS-Qj_.js +553 -0
  12. package/web/assets/ConfigPage-CgrWdzb5.js +5 -0
  13. package/web/assets/{DesktopWindowControls-BWe5YIjj.js → DesktopWindowControls-D8axeuEx.js} +1 -1
  14. package/web/assets/FeaturePage-BB1TeMlr.js +1 -0
  15. package/web/assets/{FileAttachmentPreview-IZzA3f8k.js → FileAttachmentPreview-DPjT_iYk.js} +1 -1
  16. package/web/assets/{FloatingWidgets-DgIJkrEC.js → FloatingWidgets-FI1S4hdn.js} +1 -1
  17. package/web/assets/FocusRuntimeControls-CvAx-KDV.js +1 -0
  18. package/web/assets/{GitDiffViewer-CypHOHdP.js → GitDiffViewer-DwFfeFOA.js} +1 -1
  19. package/web/assets/{ManageProjectsDialog-DxiTEqYf.js → ManageProjectsDialog-BSLNf6qD.js} +1 -1
  20. package/web/assets/{MarkdownMessage-CuaozZah.js → MarkdownMessage-NK7Ixb4Y.js} +1 -1
  21. package/web/assets/{McpPage-BbmxMKuy.js → McpPage-Cn-yDgC5.js} +1 -1
  22. package/web/assets/MemoryEvolution-B8IeSLcd.js +1 -0
  23. package/web/assets/MemoryPage-ZwoG_oj6.js +2 -0
  24. package/web/assets/{MobileNavigation-IZrksubf.js → MobileNavigation-DK5a0kZU.js} +1 -1
  25. package/web/assets/{MorePage-DObfXE0e.js → MorePage-BL8nDnTQ.js} +1 -1
  26. package/web/assets/{NewFolderDialog-CeRiD1xe.js → NewFolderDialog-COkq83LW.js} +1 -1
  27. package/web/assets/{PageHeader-D8QTuWd6.js → PageHeader-BBTCMqXc.js} +1 -1
  28. package/web/assets/{PhoneDrawer-Dfmmixh5.js → PhoneDrawer-BcPKJWl-.js} +1 -1
  29. package/web/assets/{PhoneMenuButton-Bbna_Bcf.js → PhoneMenuButton-D6vdTZdF.js} +1 -1
  30. package/web/assets/{PhoneTopBar-Dz94PR8O.js → PhoneTopBar-MqNeI69v.js} +1 -1
  31. package/web/assets/{PluginsPage-0rmSVMfr.js → PluginsPage-Bp71HpKD.js} +1 -1
  32. package/web/assets/{SafeModePrompt-CAfT8lBS.js → SafeModePrompt-CpvvU5wL.js} +1 -1
  33. package/web/assets/SchedulesPage-Drs10rEV.js +1 -0
  34. package/web/assets/{SessionBrowserPane-DMTNqq-e.js → SessionBrowserPane-DjtB4MCI.js} +2 -2
  35. package/web/assets/SessionContextPanel-ETfnp4pT.js +2 -0
  36. package/web/assets/{SessionHome-047YRkeb.js → SessionHome-CHBw3ZvP.js} +1 -1
  37. package/web/assets/SessionInspector-DVaRflQy.js +1 -0
  38. package/web/assets/{SessionShell-BqNSjTbQ.js → SessionShell-CwfQAX7i.js} +1 -1
  39. package/web/assets/{SettingsSidebar-a9IEYCfr.js → SettingsSidebar-FgC-tlY2.js} +1 -1
  40. package/web/assets/{ShortcutHelpDialog-B1RT_EMe.js → ShortcutHelpDialog-DKbIkUnk.js} +1 -1
  41. package/web/assets/{ShortcutKeys-DIEI9JQZ.js → ShortcutKeys-BuHXNKVW.js} +1 -1
  42. package/web/assets/{SidebarUpdateStatus-phIx4K_T.js → SidebarUpdateStatus-LKwNKESF.js} +1 -1
  43. package/web/assets/{SkillsPage-CZuR-0QX.js → SkillsPage-BbnerW44.js} +1 -1
  44. package/web/assets/{TaskProcessesPane-x73TNzuV.js → TaskProcessesPane-B2fyZEK9.js} +1 -1
  45. package/web/assets/{TaskTerminalView-D2UVtmT1.js → TaskTerminalView-CKApgF75.js} +1 -1
  46. package/web/assets/{TerminalPanel-C0U35k57.js → TerminalPanel-D03WycYm.js} +1 -1
  47. package/web/assets/{WebDesktopPet-CJtB44aG.js → WebDesktopPet-K2dbcbnQ.js} +1 -1
  48. package/web/assets/WorkflowsPage-CmzftCtz.js +1 -0
  49. package/web/assets/{WorkspacePicker-C7hhcfZV.js → WorkspacePicker-DbdbTOV2.js} +1 -1
  50. package/web/assets/{api-BmSvZCuH.js → api-BW_X0FMZ.js} +1 -1
  51. package/web/assets/{app-update-DhpOY37a.js → app-update-DYFXTosD.js} +1 -1
  52. package/web/assets/{approval-confirm-Dc3BZGo4.js → approval-confirm-DQ5N_lJB.js} +1 -1
  53. package/web/assets/archive-ojKJT7Fp.js +1 -0
  54. package/web/assets/{board-projects-C7DazgZG.js → board-projects-CrejrMrn.js} +1 -1
  55. package/web/assets/book-open-BuHHD9os.js +1 -0
  56. package/web/assets/bots-store-CNXTx3UY.js +1 -0
  57. package/web/assets/{chat-api-DHqVwcpJ.js → chat-api-Bo6nhq40.js} +1 -1
  58. package/web/assets/chevrons-up-down-C2sEPdAh.js +1 -0
  59. package/web/assets/{client-store-Dif482Kx.js → client-store-DzgOPMlh.js} +1 -1
  60. package/web/assets/{config-search-CKpXm_hp.js → config-search-BiQmWst4.js} +1 -1
  61. package/web/assets/{dialog-DFcH7POi.js → dialog-DFZX_Dek.js} +1 -1
  62. package/web/assets/dist-BS3ekNDj.js +1 -0
  63. package/web/assets/{events-C7sXXop4.js → events-PfANjkHx.js} +1 -1
  64. package/web/assets/{focus-session-composer-bits-D2XiGLcj.js → focus-session-composer-bits-C_LOpJH_.js} +1 -1
  65. package/web/assets/{folder-paths-CsQLylLL.js → folder-paths-aRRH_MYq.js} +1 -1
  66. package/web/assets/{hosts-CwTc21QE.js → hosts-lvoPwC3T.js} +1 -1
  67. package/web/assets/i18n-EVP8yIdy.js +1 -0
  68. package/web/assets/index-D_zLThH_.js +2 -0
  69. package/web/assets/index-l96Dl6z6.css +2 -0
  70. package/web/assets/memory-api-DkPje--t.js +1 -0
  71. package/web/assets/message-circle-D-XrK6Ft.js +1 -0
  72. package/web/assets/{mobile-remote-fallback-C2Q0wAa6.js → mobile-remote-fallback-LLMZWoIu.js} +1 -1
  73. package/web/assets/mount-app-7pFSwVLO.js +9 -0
  74. package/web/assets/{permission-rules-api-D1Tbe4E9.js → permission-rules-api-CAJsSBA5.js} +1 -1
  75. package/web/assets/{pick-system-directory-CQS5pqM-.js → pick-system-directory-yk6L7wR2.js} +1 -1
  76. package/web/assets/pin-off-BpRu_vrC.js +1 -0
  77. package/web/assets/placements-CMrgmg3t.js +2 -0
  78. package/web/assets/{popover-CXB2yzW6.js → popover--q2hs_pT.js} +1 -1
  79. package/web/assets/{public-D1nVPEiV.js → public-62LVX7HU.js} +1 -1
  80. package/web/assets/public-DWbrDr0p.js +3 -0
  81. package/web/assets/{public-BVKkvQiF.js → public-DkqrpWXx.js} +2 -2
  82. package/web/assets/{public-components-B6uxO_ZB.js → public-components-DHMvCgH2.js} +1 -1
  83. package/web/assets/public-diff-WjbTu91T.js +1 -0
  84. package/web/assets/public-events-CTdTIu5Q.js +1 -0
  85. package/web/assets/{public-flags-KylDNCsK.js → public-flags-D9LdpQwJ.js} +1 -1
  86. package/web/assets/public-greeting-DEKYruJJ.js +1 -0
  87. package/web/assets/{public-session-DjI86F5J.js → public-session-B9UHA6rN.js} +1 -1
  88. package/web/assets/{public-sidebar-PhHPuas_.js → public-sidebar-Lne86i_K.js} +1 -1
  89. package/web/assets/{runtime-capabilities-store-CTtXyNjK.js → runtime-capabilities-store-BNM5Ug-5.js} +1 -1
  90. package/web/assets/{safe-mode-instance-_WZgKT1M.js → safe-mode-instance-DnTP7EUr.js} +1 -1
  91. package/web/assets/safe-mode-sentinel-DOhqH4gj.js +1 -0
  92. package/web/assets/select-Bbk9bmXO.js +1 -0
  93. package/web/assets/send-Cj-W03w_.js +1 -0
  94. package/web/assets/{session-change-summary-api-DENj-A9c.js → session-change-summary-api-DMTwGz7o.js} +1 -1
  95. package/web/assets/{session-home-D1MkpdBS.js → session-home-DUpZt2dn.js} +1 -1
  96. package/web/assets/session-list-BRMu9JWa.js +1 -0
  97. package/web/assets/{session-organization-api-Cm9HoIme.js → session-organization-api-BGyp66Uv.js} +1 -1
  98. package/web/assets/{session-scope-BnKeB5vZ.js → session-scope-DZITSvZr.js} +1 -1
  99. package/web/assets/{session-tree-actions-DhF8lJLn.js → session-tree-actions-CRWyFqAD.js} +1 -1
  100. package/web/assets/{session-tree-summary-DEJ52bdp.js → session-tree-summary-HTmAo_9V.js} +1 -1
  101. package/web/assets/{shortcuts-DnykOp5e.js → shortcuts-D72gQCwH.js} +1 -1
  102. package/web/assets/side-chat-context-D1hZOT7g.js +7 -0
  103. package/web/assets/{sidebar-bemTfe07.js → sidebar-sj8X80Y9.js} +1 -1
  104. package/web/assets/{sidebar-store-Be8dU3KV.js → sidebar-store-CXZ7QrOr.js} +1 -1
  105. package/web/assets/slider-De8rWVNs.js +1 -0
  106. package/web/assets/sliders-horizontal-Dryf1XyC.js +1 -0
  107. package/web/assets/{speech-session-4UWWW7HR.js → speech-session-D2GQEOAL.js} +1 -1
  108. package/web/assets/{startup-queries-iq2o5pqJ.js → startup-queries-CuEXV1Zu.js} +1 -1
  109. package/web/assets/{storage-8QW6lXuT.js → storage-DtvZ_lEu.js} +1 -1
  110. package/web/assets/tool-labels-Bexnwp5q.js +1 -0
  111. package/web/assets/undo-2-C-xQ0UVT.js +1 -0
  112. package/web/assets/{use-i18n-DCxQRXLH.js → use-i18n-_vdxObu5.js} +1 -1
  113. package/web/assets/{use-open-bot-BTTe7141.js → use-open-bot-BTxzOAbZ.js} +1 -1
  114. package/web/assets/{use-studio-actions-CvTVL6vy.js → use-studio-actions-CbMHRZpd.js} +1 -1
  115. package/web/assets/{useCatalogProjects-D0_Xilel.js → useCatalogProjects-BEkCpADy.js} +1 -1
  116. package/web/assets/{useNewProjectPicker-C3dVgDqI.js → useNewProjectPicker-CUtLjwYE.js} +2 -2
  117. package/web/assets/{useNow-BrhALV5l.js → useNow-eQeBCqQk.js} +1 -1
  118. package/web/assets/{usePhoneShell-BleJZMk4.js → usePhoneShell-DZHZWXnN.js} +1 -1
  119. package/web/assets/{useSessionListQuery-CSTrzBD6.js → useSessionListQuery-BoUzmjZC.js} +1 -1
  120. package/web/assets/{useSessionRowActions-CBOzJhLW.js → useSessionRowActions-DCqDrGZY.js} +1 -1
  121. package/web/assets/{useSidebarModel-AYsswvjm.js → useSidebarModel-CZAfH4Fa.js} +1 -1
  122. package/web/assets/{web-preview-B9ooQu6f.js → web-preview-XrRFo42l.js} +1 -1
  123. package/web/assets/{web-preview-events-DZb37WWK.js → web-preview-events-Ba6duwGi.js} +1 -1
  124. package/web/assets/workflow-messages-Cc4pX_oo.js +1 -0
  125. package/web/assets/{workspace-order-store-CQ4SHO-9.js → workspace-order-store-Ao4OZ13V.js} +1 -1
  126. package/web/index.html +2 -2
  127. package/web/assets/ChannelsPage-LM4bpKzy.js +0 -1
  128. package/web/assets/ChatHistoryPage-DcjG1hoQ.js +0 -1
  129. package/web/assets/ChatPage-HBq1cr2I.js +0 -553
  130. package/web/assets/ConfigPage-Bcjc5mbO.js +0 -5
  131. package/web/assets/FeaturePage-DGauTCbU.js +0 -1
  132. package/web/assets/FocusRuntimeControls-Bgq7LvMl.js +0 -1
  133. package/web/assets/MemoryPage-BeI2YTUn.js +0 -1
  134. package/web/assets/SchedulesPage-C3TpSm9t.js +0 -1
  135. package/web/assets/SessionContextPanel-DoS-Xqny.js +0 -2
  136. package/web/assets/SessionInspector-GXGZ9n87.js +0 -1
  137. package/web/assets/WorkflowsPage-o4p12fMI.js +0 -1
  138. package/web/assets/bots-store-CeTfxdyY.js +0 -1
  139. package/web/assets/dist-V8chnW6-.js +0 -1
  140. package/web/assets/i18n-YQ8mc9k7.js +0 -1
  141. package/web/assets/index-DJA4qaOu.css +0 -2
  142. package/web/assets/index-DjSjahBi.js +0 -2
  143. package/web/assets/mount-app-DAxz1ll-.js +0 -9
  144. package/web/assets/placements-BuU0Zuqy.js +0 -2
  145. package/web/assets/public-BVuJa7Dh.js +0 -3
  146. package/web/assets/public-diff-CCVYk91T.js +0 -1
  147. package/web/assets/public-events-CVn8fEHx.js +0 -1
  148. package/web/assets/safe-mode-sentinel-CVhmZl77.js +0 -1
  149. package/web/assets/select-DD_WO-gs.js +0 -1
  150. package/web/assets/send-QxBfLFo-.js +0 -1
  151. package/web/assets/session-list-BeyOEzyU.js +0 -1
  152. package/web/assets/side-chat-context-C2SzUmd5.js +0 -7
  153. package/web/assets/slider-DTmAZl-R.js +0 -1
  154. package/web/assets/tool-labels-ghvpPFmc.js +0 -1
  155. package/web/assets/workflow-messages-Cj35aJZc.js +0 -1
  156. package/web/memory-galaxy-background.webp +0 -0
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t}from"./vendor-react-DwNgTV1j.js";import{d as n}from"./i18n-YQ8mc9k7.js";import{i as r,r as i,t as a}from"./runtime-capabilities-CHYOF_hE.js";var o=e(t(),1),s=`section`,c={models:`config:configPage.models`,notifications:`config:configPage.notifications`,interface:`config:configPage.interface`,shortcuts:`config:configPage.shortcuts`,"desktop-pet":`config:configPage.desktopPet`,updates:`config:configPage.appUpdates`,labs:`config:configPage.labs`,about:`config:configPage.about`,"remote-access":`config:configPage.remoteAccess`,"mobile-server":`config:configPage.mobileServer`},l=[{id:`sec-models`,section:`models`,card:s,titleKey:`config:configPage.models`,keywords:[`model`,`provider`,`llm`,`api`,`模型`,`供应商`,`大模型`]},{id:`sec-notifications`,section:`notifications`,card:s,titleKey:`config:configPage.notifications`,keywords:[`notification`,`push`,`alert`,`通知`,`推送`,`提醒`]},{id:`sec-interface`,section:`interface`,card:s,titleKey:`config:configPage.interface`,keywords:[`interface`,`theme`,`appearance`,`display`,`界面`,`主题`,`外观`,`显示`]},{id:`sec-shortcuts`,section:`shortcuts`,card:s,titleKey:`config:configPage.shortcuts`,keywords:[`keyboard`,`shortcut`,`hotkey`,`keybinding`,`voice`,`push to talk`,`快捷键`,`按键`,`键盘`,`语音`,`长按`]},{id:`sec-desktop-pet`,section:`desktop-pet`,card:s,titleKey:`config:configPage.desktopPet`,keywords:[`pet`,`petdex`,`宠物`,`桌宠`]},{id:`sec-updates`,section:`updates`,card:s,titleKey:`config:configPage.appUpdates`,keywords:[`update`,`upgrade`,`version`,`更新`,`升级`,`版本`]},{id:`sec-labs`,section:`labs`,card:s,titleKey:`config:configPage.labs`,keywords:[`labs`,`beta`,`experimental`,`preview`,`实验`,`测试版`,`尝鲜`,`内测`]},{id:`sec-about`,section:`about`,card:s,titleKey:`config:configPage.about`,keywords:[`about`,`info`,`license`,`关于`,`信息`,`许可`]},{id:`sec-remote-access`,section:`remote-access`,card:s,titleKey:`config:configPage.remoteAccess`,keywords:[`remote`,`network`,`phone`,`远程`,`网络`,`手机`]},{id:`sec-mobile-server`,section:`mobile-server`,card:s,titleKey:`config:configPage.mobileServer`,keywords:[`server`,`remote`,`network`,`服务器`,`远程`,`网络`]},{id:`models-current-model`,section:`models`,card:`models-current-model`,targetId:`models-connections`,titleKey:`config:configPage.currentChatModel`,keywords:[`model`,`provider`,`quick setup`,`模型`,`供应商`,`快速配置`,`对话模型`]},{id:`models-connections`,section:`models`,card:`models-connections`,titleKey:`config:configPage.manageConnections`,keywords:[`provider`,`connection`,`api key`,`import`,`连接`,`供应商`,`导入`,`密钥`]},{id:`models-runtime-policy`,section:`models`,card:`models-current-model`,targetId:`models-runtime-policy`,titleKey:`config:configPage.agentRuntimePolicy`,keywords:[`runtime`,`agent`,`policy`,`thinking`,`tools`,`运行策略`,`运行时`,`执行策略`,`思考强度`,`可用工具`]},{id:`models-fallback`,section:`models`,card:`models-current-model`,targetId:`models-runtime-policy`,titleKey:`config:providerWorkbench.fallbackModels`,keywords:[`fallback`,`backup`,`failover`,`quota`,`备用模型`,`备选`,`额度`,`切换模型`]},{id:`models-auxiliary`,section:`models`,card:`models-current-model`,targetId:`models-runtime-policy`,titleKey:`config:providerWorkbench.auxiliaryModel`,keywords:[`auxiliary`,`helper model`,`title`,`compaction`,`summary`,`辅助模型`,`标题`,`压缩`,`摘要`,`记忆`]},{id:`models-subagents`,section:`models`,card:`models-subagents`,targetId:`models-subagents`,titleKey:`config:subagents.title`,keywords:[`subagent`,`agent definition`,`tier`,`fast`,`strong`,`子代理`,`子 Agent`,`档位`,`便宜模型`,`.pisper/agents`]},{id:`models-permission-rules`,section:`models`,card:`models-permission-rules`,targetId:`models-permission-rules`,titleKey:`config:permissionRules.title`,keywords:[`permission`,`allow`,`deny`,`approval`,`rule`,`权限`,`审批`,`允许`,`禁止`,`规则`]},{id:`models-visual`,section:`models`,card:`models-visual`,targetId:`models-visual`,expandGroup:`models-advanced`,titleKey:`config:configPage.currentVisualModel`,keywords:[`image`,`video`,`visual`,`图片`,`图像`,`视频`,`视觉`,`生图`]},{id:`notifications-browser`,section:`notifications`,card:`notifications-browser`,titleKey:`config:notificationSettings.notification`,keywords:[`browser`,`system`,`push`,`浏览器通知`,`系统通知`,`推送`]},{id:`notifications-templates`,section:`notifications`,card:`notifications-templates`,titleKey:`config:notificationSettings.notificationTemplates`,keywords:[`template`,`模板`,`通知模板`]},{id:`interface-custom-ui`,section:`interface`,card:`interface-custom-ui`,titleKey:`navigation:shell.components`,sectionTitleKey:`custom-ui:moved.title`,keywords:[`custom ui`,`standalone widgets`,`component`,`native`,`manifest`,`独立组件`,`自定义组件`,`组件`]},{id:`interface-appearance`,section:`interface`,card:`interface-appearance`,titleKey:`config:interfaceSettings.appearance`,keywords:[`theme`,`dark`,`light`,`accent`,`主题`,`深色`,`浅色`,`强调色`,`外观`]},{id:`interface-style`,section:`interface`,card:`interface-style`,expandGroup:`interface-advanced`,titleKey:`config:interfaceSettings.interfaceStyle`,keywords:[`font`,`corner`,`radius`,`字体`,`字号`,`圆角`]},{id:`interface-motion`,section:`interface`,card:`interface-motion`,expandGroup:`interface-advanced`,titleKey:`config:interfaceSettings.displayAndMotion`,keywords:[`motion`,`density`,`animation`,`动效`,`动画`,`密度`,`显示`]},{id:`interface-language`,section:`interface`,card:`interface-language`,titleKey:`config:languageSettings.displayLanguage`,keywords:[`language`,`chinese`,`english`,`语言`,`中文`,`英文`,`英语`]},{id:`desktop-pet-settings`,section:`desktop-pet`,card:`desktop-pet-settings`,titleKey:`config:desktopPetSettings.title`,keywords:[`pet`,`宠物`,`桌宠`,`宠物设置`]},{id:`desktop-pet-install`,section:`desktop-pet`,card:`desktop-pet-install`,titleKey:`config:desktopPetSettings.installTitle`,keywords:[`petdex`,`install`,`宠物安装`,`添加宠物`]},{id:`desktop-pet-installed`,section:`desktop-pet`,card:`desktop-pet-installed`,titleKey:`config:desktopPetSettings.installedTitle`,keywords:[`installed`,`已安装`,`宠物列表`]},{id:`mobile-server-main`,section:`mobile-server`,card:`mobile-server-main`,titleKey:`config:mobileServer.title`,keywords:[`server`,`remote`,`服务器`,`远程`,`手机访问`]},{id:`mobile-server-local`,section:`mobile-server`,card:`mobile-server-local`,titleKey:`config:mobileServer.localTitle`,keywords:[`local`,`on-device`,`本机`,`本地运行`]},{id:`remote-workspaces`,section:`remote-access`,card:`remote-workspaces`,titleKey:`config:remoteWorkspace.title`,keywords:[`linux`,`remote workspace`,`服务器`,`远程工作区`]},{id:`remote-access-main`,section:`remote-access`,card:`remote-access-main`,titleKey:`config:remoteAccess.title`,keywords:[`remote`,`network`,`phone`,`远程`,`网络`,`手机`]},{id:`remote-access-pairing`,section:`remote-access`,card:`remote-access-pairing`,titleKey:`config:remoteAccess.pairing`,keywords:[`pairing`,`qr`,`配对`,`二维码`]},{id:`remote-access-devices`,section:`remote-access`,card:`remote-access-devices`,titleKey:`config:remoteAccess.devices`,keywords:[`device`,`paired`,`设备`,`已配对`,`授权`]},{id:`updates-main`,section:`updates`,card:`updates-main`,titleKey:`config:updateSettings.pisperAppUpdates`,keywords:[`update`,`version`,`channel`,`更新`,`版本`,`升级`,`渠道`]},{id:`updates-components`,section:`updates`,card:`updates-components`,titleKey:`config:updateSettings.appComponents`,keywords:[`component`,`runtime`,`sidecar`,`组件`,`运行时`]},{id:`updates-cli`,section:`updates`,card:`updates-cli`,titleKey:`config:cliSettings.title`,keywords:[`cli`,`terminal`,`command`,`命令行`,`终端`,`命令`]},{id:`about-project`,section:`about`,card:`about-project`,titleKey:`config:aboutSettings.projectInformation`,keywords:[`project`,`version`,`license`,`项目`,`版本`,`许可`]},{id:`about-support`,section:`about`,card:`about-support`,titleKey:`config:aboutSettings.supportPisper`,keywords:[`support`,`donate`,`sponsor`,`支持`,`捐赠`,`赞助`]}],u={provider:[`sec-models`,`models-current-model`,`models-connections`],供应商:[`sec-models`,`models-current-model`,`models-connections`],model:[`sec-models`,`models-current-model`,`models-connections`],模型:[`sec-models`,`models-current-model`,`models-connections`],theme:[`sec-interface`,`interface-appearance`],主题:[`sec-interface`,`interface-appearance`],interface:[`sec-interface`,`interface-appearance`],界面:[`sec-interface`,`interface-appearance`,`interface-language`],diy:[`interface-custom-ui`],components:[`interface-custom-ui`],widgets:[`interface-custom-ui`],组件:[`interface-custom-ui`],pet:[`sec-desktop-pet`,`desktop-pet-settings`,`desktop-pet-install`,`desktop-pet-installed`],宠物:[`sec-desktop-pet`,`desktop-pet-settings`,`desktop-pet-install`,`desktop-pet-installed`],update:[`sec-updates`,`updates-main`,`updates-components`],更新:[`sec-updates`,`updates-main`,`updates-components`],network:[`sec-remote-access`,`sec-mobile-server`,`remote-access-main`],网络:[`sec-remote-access`,`sec-mobile-server`,`remote-access-main`],remote:[`sec-remote-access`,`sec-mobile-server`,`remote-access-main`],远程:[`sec-remote-access`,`sec-mobile-server`,`remote-access-main`],notification:[`sec-notifications`,`notifications-browser`,`notifications-templates`],通知:[`sec-notifications`,`notifications-browser`,`notifications-templates`],language:[`interface-language`],语言:[`interface-language`]},d=12;function f(e){return[n(e.titleKey,`zh-CN`).toLowerCase(),n(e.titleKey,`en-US`).toLowerCase()]}function p(e,t,{capabilities:o=a,mobileApp:s}={}){let p=e.trim().toLowerCase();if(!p)return[];let m=new Set(u[p]||[]);for(let e of p.split(/\s+/))for(let t of u[e]||[])m.add(t);let h=[];for(let e of l){if(!i(o,e.section)||e.id===`models-visual`&&!r(o,`visualGeneration`)||s!==void 0&&(e.section===`mobile-server`&&!s||e.section===`remote-access`&&s)||typeof window<`u`&&(e.id===`remote-workspaces`&&!window.pisperDesktop?.remoteWorkspaces||e.id===`remote-access-main`&&window.__PISPER_REMOTE_WORKSPACE__))continue;let[t,n]=f(e),a=0;m.has(e.id)?a=100:t===p||n===p?a=90:t.startsWith(p)||n.startsWith(p)?a=80:t.includes(p)||n.includes(p)?a=65:(e.keywords||[]).some(e=>{let t=e.toLowerCase();return t.includes(p)?p.length>=2||/[\u4e00-\u9fff]/.test(p):/[\u4e00-\u9fff]/.test(t)&&t.includes(p)})&&(a=40),a>0&&h.push({entry:e,score:a})}h.sort((e,t)=>t.score-e.score);let g=new Set,_=[];for(let{entry:e}of h){let r={entry:e,title:n(e.titleKey,t),sectionTitle:n(e.sectionTitleKey||c[e.section],t)},i=`${e.section}|${r.title}`;if(!g.has(i)&&(g.add(i),_.push(r),_.length>=d))break}return _}var m=`pisper:config-card-highlight`,h=null,g=0,_=new Set;function v(){for(let e of _)e()}function y(e){return _.add(e),()=>{_.delete(e)}}function b(e,t,n={}){h={card:e,section:t,...n,targetId:n.targetId||e,navigationKey:++g},v(),window.dispatchEvent(new Event(m))}function x(e){let t=(0,o.useSyncExternalStore)(y,()=>h,()=>null);return(0,o.useEffect)(()=>{if(!t||t.section!==e)return;let n=0,r=()=>{cancelAnimationFrame(n),n=requestAnimationFrame(()=>{if(h?.navigationKey!==t.navigationKey)return;let e=Array.from(document.querySelectorAll(`[data-config-target], [data-config-card]`)).find(e=>e.dataset.configTarget===t.targetId||e.dataset.configCard===t.targetId);if(!e||!e.getClientRects().length)return;let n=e.querySelector(`input:not([disabled]), button:not([disabled]), select:not([disabled]), [tabindex="0"]`)||e;!n.hasAttribute(`tabindex`)&&n===e&&(n.tabIndex=-1),n.focus({preventScroll:!0}),e.scrollIntoView({block:`center`}),i.disconnect(),h=null,v()})},i=new MutationObserver(r);return i.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`hidden`,`style`,`data-state`]}),r(),()=>{cancelAnimationFrame(n),i.disconnect()}},[t,e]),t?.section===e?t:null}export{x as i,b as n,p as r,s as t};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t}from"./vendor-react-DwNgTV1j.js";import{d as n}from"./i18n-EVP8yIdy.js";import{i as r,r as i,t as a}from"./runtime-capabilities-CHYOF_hE.js";var o=e(t(),1),s=`section`,c={models:`config:configPage.models`,notifications:`config:configPage.notifications`,interface:`config:configPage.interface`,shortcuts:`config:configPage.shortcuts`,"desktop-pet":`config:configPage.desktopPet`,updates:`config:configPage.appUpdates`,labs:`config:configPage.labs`,about:`config:configPage.about`,"remote-access":`config:configPage.remoteAccess`,"mobile-server":`config:configPage.mobileServer`},l=[{id:`sec-models`,section:`models`,card:s,titleKey:`config:configPage.models`,keywords:[`model`,`provider`,`llm`,`api`,`模型`,`供应商`,`大模型`]},{id:`sec-notifications`,section:`notifications`,card:s,titleKey:`config:configPage.notifications`,keywords:[`notification`,`push`,`alert`,`通知`,`推送`,`提醒`]},{id:`sec-interface`,section:`interface`,card:s,titleKey:`config:configPage.interface`,keywords:[`interface`,`theme`,`appearance`,`display`,`界面`,`主题`,`外观`,`显示`]},{id:`sec-shortcuts`,section:`shortcuts`,card:s,titleKey:`config:configPage.shortcuts`,keywords:[`keyboard`,`shortcut`,`hotkey`,`keybinding`,`voice`,`push to talk`,`快捷键`,`按键`,`键盘`,`语音`,`长按`]},{id:`sec-desktop-pet`,section:`desktop-pet`,card:s,titleKey:`config:configPage.desktopPet`,keywords:[`pet`,`petdex`,`宠物`,`桌宠`]},{id:`sec-updates`,section:`updates`,card:s,titleKey:`config:configPage.appUpdates`,keywords:[`update`,`upgrade`,`version`,`更新`,`升级`,`版本`]},{id:`sec-labs`,section:`labs`,card:s,titleKey:`config:configPage.labs`,keywords:[`labs`,`beta`,`experimental`,`preview`,`实验`,`测试版`,`尝鲜`,`内测`]},{id:`sec-about`,section:`about`,card:s,titleKey:`config:configPage.about`,keywords:[`about`,`info`,`license`,`关于`,`信息`,`许可`]},{id:`sec-remote-access`,section:`remote-access`,card:s,titleKey:`config:configPage.remoteAccess`,keywords:[`remote`,`network`,`phone`,`远程`,`网络`,`手机`]},{id:`sec-mobile-server`,section:`mobile-server`,card:s,titleKey:`config:configPage.mobileServer`,keywords:[`server`,`remote`,`network`,`服务器`,`远程`,`网络`]},{id:`models-current-model`,section:`models`,card:`models-current-model`,targetId:`models-connections`,titleKey:`config:configPage.currentChatModel`,keywords:[`model`,`provider`,`quick setup`,`模型`,`供应商`,`快速配置`,`对话模型`]},{id:`models-connections`,section:`models`,card:`models-connections`,titleKey:`config:configPage.manageConnections`,keywords:[`provider`,`connection`,`api key`,`import`,`连接`,`供应商`,`导入`,`密钥`]},{id:`models-runtime-policy`,section:`models`,card:`models-current-model`,targetId:`models-runtime-policy`,titleKey:`config:configPage.agentRuntimePolicy`,keywords:[`runtime`,`agent`,`policy`,`thinking`,`tools`,`运行策略`,`运行时`,`执行策略`,`思考强度`,`可用工具`]},{id:`models-fallback`,section:`models`,card:`models-current-model`,targetId:`models-runtime-policy`,titleKey:`config:providerWorkbench.fallbackModels`,keywords:[`fallback`,`backup`,`failover`,`quota`,`备用模型`,`备选`,`额度`,`切换模型`]},{id:`models-auxiliary`,section:`models`,card:`models-current-model`,targetId:`models-runtime-policy`,titleKey:`config:providerWorkbench.auxiliaryModel`,keywords:[`auxiliary`,`helper model`,`title`,`compaction`,`summary`,`辅助模型`,`标题`,`压缩`,`摘要`,`记忆`]},{id:`models-subagents`,section:`models`,card:`models-subagents`,targetId:`models-subagents`,titleKey:`config:subagents.title`,keywords:[`subagent`,`agent definition`,`tier`,`fast`,`strong`,`子代理`,`子 Agent`,`档位`,`便宜模型`,`.pisper/agents`]},{id:`models-permission-rules`,section:`models`,card:`models-permission-rules`,targetId:`models-permission-rules`,titleKey:`config:permissionRules.title`,keywords:[`permission`,`allow`,`deny`,`approval`,`rule`,`权限`,`审批`,`允许`,`禁止`,`规则`]},{id:`models-visual`,section:`models`,card:`models-visual`,targetId:`models-visual`,expandGroup:`models-advanced`,titleKey:`config:configPage.currentVisualModel`,keywords:[`image`,`video`,`visual`,`图片`,`图像`,`视频`,`视觉`,`生图`]},{id:`notifications-browser`,section:`notifications`,card:`notifications-browser`,titleKey:`config:notificationSettings.notification`,keywords:[`browser`,`system`,`push`,`浏览器通知`,`系统通知`,`推送`]},{id:`notifications-templates`,section:`notifications`,card:`notifications-templates`,titleKey:`config:notificationSettings.notificationTemplates`,keywords:[`template`,`模板`,`通知模板`]},{id:`interface-custom-ui`,section:`interface`,card:`interface-custom-ui`,titleKey:`navigation:shell.components`,sectionTitleKey:`custom-ui:moved.title`,keywords:[`custom ui`,`standalone widgets`,`component`,`native`,`manifest`,`独立组件`,`自定义组件`,`组件`]},{id:`interface-appearance`,section:`interface`,card:`interface-appearance`,titleKey:`config:interfaceSettings.appearance`,keywords:[`theme`,`dark`,`light`,`accent`,`主题`,`深色`,`浅色`,`强调色`,`外观`]},{id:`interface-style`,section:`interface`,card:`interface-style`,expandGroup:`interface-advanced`,titleKey:`config:interfaceSettings.interfaceStyle`,keywords:[`font`,`corner`,`radius`,`字体`,`字号`,`圆角`]},{id:`interface-motion`,section:`interface`,card:`interface-motion`,expandGroup:`interface-advanced`,titleKey:`config:interfaceSettings.displayAndMotion`,keywords:[`motion`,`density`,`animation`,`动效`,`动画`,`密度`,`显示`]},{id:`interface-language`,section:`interface`,card:`interface-language`,titleKey:`config:languageSettings.displayLanguage`,keywords:[`language`,`chinese`,`english`,`语言`,`中文`,`英文`,`英语`]},{id:`desktop-pet-settings`,section:`desktop-pet`,card:`desktop-pet-settings`,titleKey:`config:desktopPetSettings.title`,keywords:[`pet`,`宠物`,`桌宠`,`宠物设置`]},{id:`desktop-pet-install`,section:`desktop-pet`,card:`desktop-pet-install`,titleKey:`config:desktopPetSettings.installTitle`,keywords:[`petdex`,`install`,`宠物安装`,`添加宠物`]},{id:`desktop-pet-installed`,section:`desktop-pet`,card:`desktop-pet-installed`,titleKey:`config:desktopPetSettings.installedTitle`,keywords:[`installed`,`已安装`,`宠物列表`]},{id:`mobile-server-main`,section:`mobile-server`,card:`mobile-server-main`,titleKey:`config:mobileServer.title`,keywords:[`server`,`remote`,`服务器`,`远程`,`手机访问`]},{id:`mobile-server-local`,section:`mobile-server`,card:`mobile-server-local`,titleKey:`config:mobileServer.localTitle`,keywords:[`local`,`on-device`,`本机`,`本地运行`]},{id:`remote-workspaces`,section:`remote-access`,card:`remote-workspaces`,titleKey:`config:remoteWorkspace.title`,keywords:[`linux`,`remote workspace`,`服务器`,`远程工作区`]},{id:`remote-access-main`,section:`remote-access`,card:`remote-access-main`,titleKey:`config:remoteAccess.title`,keywords:[`remote`,`network`,`phone`,`远程`,`网络`,`手机`]},{id:`remote-access-pairing`,section:`remote-access`,card:`remote-access-pairing`,titleKey:`config:remoteAccess.pairing`,keywords:[`pairing`,`qr`,`配对`,`二维码`]},{id:`remote-access-devices`,section:`remote-access`,card:`remote-access-devices`,titleKey:`config:remoteAccess.devices`,keywords:[`device`,`paired`,`设备`,`已配对`,`授权`]},{id:`updates-main`,section:`updates`,card:`updates-main`,titleKey:`config:updateSettings.pisperAppUpdates`,keywords:[`update`,`version`,`channel`,`更新`,`版本`,`升级`,`渠道`]},{id:`updates-components`,section:`updates`,card:`updates-components`,titleKey:`config:updateSettings.appComponents`,keywords:[`component`,`runtime`,`sidecar`,`组件`,`运行时`]},{id:`updates-cli`,section:`updates`,card:`updates-cli`,titleKey:`config:cliSettings.title`,keywords:[`cli`,`terminal`,`command`,`命令行`,`终端`,`命令`]},{id:`about-project`,section:`about`,card:`about-project`,titleKey:`config:aboutSettings.projectInformation`,keywords:[`project`,`version`,`license`,`项目`,`版本`,`许可`]},{id:`about-support`,section:`about`,card:`about-support`,titleKey:`config:aboutSettings.supportPisper`,keywords:[`support`,`donate`,`sponsor`,`支持`,`捐赠`,`赞助`]}],u={provider:[`sec-models`,`models-current-model`,`models-connections`],供应商:[`sec-models`,`models-current-model`,`models-connections`],model:[`sec-models`,`models-current-model`,`models-connections`],模型:[`sec-models`,`models-current-model`,`models-connections`],theme:[`sec-interface`,`interface-appearance`],主题:[`sec-interface`,`interface-appearance`],interface:[`sec-interface`,`interface-appearance`],界面:[`sec-interface`,`interface-appearance`,`interface-language`],diy:[`interface-custom-ui`],components:[`interface-custom-ui`],widgets:[`interface-custom-ui`],组件:[`interface-custom-ui`],pet:[`sec-desktop-pet`,`desktop-pet-settings`,`desktop-pet-install`,`desktop-pet-installed`],宠物:[`sec-desktop-pet`,`desktop-pet-settings`,`desktop-pet-install`,`desktop-pet-installed`],update:[`sec-updates`,`updates-main`,`updates-components`],更新:[`sec-updates`,`updates-main`,`updates-components`],network:[`sec-remote-access`,`sec-mobile-server`,`remote-access-main`],网络:[`sec-remote-access`,`sec-mobile-server`,`remote-access-main`],remote:[`sec-remote-access`,`sec-mobile-server`,`remote-access-main`],远程:[`sec-remote-access`,`sec-mobile-server`,`remote-access-main`],notification:[`sec-notifications`,`notifications-browser`,`notifications-templates`],通知:[`sec-notifications`,`notifications-browser`,`notifications-templates`],language:[`interface-language`],语言:[`interface-language`]},d=12;function f(e){return[n(e.titleKey,`zh-CN`).toLowerCase(),n(e.titleKey,`en-US`).toLowerCase()]}function p(e,t,{capabilities:o=a,mobileApp:s}={}){let p=e.trim().toLowerCase();if(!p)return[];let m=new Set(u[p]||[]);for(let e of p.split(/\s+/))for(let t of u[e]||[])m.add(t);let h=[];for(let e of l){if(!i(o,e.section)||e.id===`models-visual`&&!r(o,`visualGeneration`)||s!==void 0&&(e.section===`mobile-server`&&!s||e.section===`remote-access`&&s)||typeof window<`u`&&(e.id===`remote-workspaces`&&!window.pisperDesktop?.remoteWorkspaces||e.id===`remote-access-main`&&window.__PISPER_REMOTE_WORKSPACE__))continue;let[t,n]=f(e),a=0;m.has(e.id)?a=100:t===p||n===p?a=90:t.startsWith(p)||n.startsWith(p)?a=80:t.includes(p)||n.includes(p)?a=65:(e.keywords||[]).some(e=>{let t=e.toLowerCase();return t.includes(p)?p.length>=2||/[\u4e00-\u9fff]/.test(p):/[\u4e00-\u9fff]/.test(t)&&t.includes(p)})&&(a=40),a>0&&h.push({entry:e,score:a})}h.sort((e,t)=>t.score-e.score);let g=new Set,_=[];for(let{entry:e}of h){let r={entry:e,title:n(e.titleKey,t),sectionTitle:n(e.sectionTitleKey||c[e.section],t)},i=`${e.section}|${r.title}`;if(!g.has(i)&&(g.add(i),_.push(r),_.length>=d))break}return _}var m=`pisper:config-card-highlight`,h=null,g=0,_=new Set;function v(){for(let e of _)e()}function y(e){return _.add(e),()=>{_.delete(e)}}function b(e,t,n={}){h={card:e,section:t,...n,targetId:n.targetId||e,navigationKey:++g},v(),window.dispatchEvent(new Event(m))}function x(e){let t=(0,o.useSyncExternalStore)(y,()=>h,()=>null);return(0,o.useEffect)(()=>{if(!t||t.section!==e)return;let n=0,r=()=>{cancelAnimationFrame(n),n=requestAnimationFrame(()=>{if(h?.navigationKey!==t.navigationKey)return;let e=Array.from(document.querySelectorAll(`[data-config-target], [data-config-card]`)).find(e=>e.dataset.configTarget===t.targetId||e.dataset.configCard===t.targetId);if(!e||!e.getClientRects().length)return;let n=e.querySelector(`input:not([disabled]), button:not([disabled]), select:not([disabled]), [tabindex="0"]`)||e;!n.hasAttribute(`tabindex`)&&n===e&&(n.tabIndex=-1),n.focus({preventScroll:!0}),e.scrollIntoView({block:`center`}),i.disconnect(),h=null,v()})},i=new MutationObserver(r);return i.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`hidden`,`style`,`data-state`]}),r(),()=>{cancelAnimationFrame(n),i.disconnect()}},[t,e]),t?.section===e?t:null}export{x as i,b as n,p as r,s as t};
@@ -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-DCxQRXLH.js";import{t as i}from"./x-07u4-129.js";import{a,c as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./dist-BHkR6BLP.js";import{t as p}from"./utils-C8uzG5AZ.js";import{t as m}from"./button-CCcCN8tE.js";var h=e(t(),1),g=n(),_=h.createContext(!1),v=h.createContext(null);function y({busy:e=!1,open:t,defaultOpen:n=!1,onOpenChange:r,...i}){let[a,o]=h.useState(n);return(0,g.jsx)(_.Provider,{value:e,children:(0,g.jsx)(f,{"data-slot":`dialog`,open:t??a,onOpenChange:n=>{!n&&e||(t===void 0&&o(n),r?.(n))},...i})})}function b({...e}){return(0,g.jsx)(o,{"data-slot":`dialog-trigger`,...e})}function x({...e}){return(0,g.jsx)(l,{"data-slot":`dialog-portal`,...e})}function S({...e}){return(0,g.jsx)(c,{"data-slot":`dialog-close`,...e})}function C({className:e,...t}){return(0,g.jsx)(a,{"data-slot":`dialog-overlay`,className:p(`fixed inset-0 isolate z-50 bg-[var(--overlay-scrim)] duration-[var(--duration-fast,150ms)] data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function w({className:e,overlayClassName:t,children:n,showCloseButton:a=!0,size:o=`default`,surface:s=`default`,scrollMode:l=`content`,ref:d,onEscapeKeyDown:f,onPointerDownOutside:y,onInteractOutside:b,...S}){let{t:w}=r(),T=h.useContext(_),[E,D]=h.useState(null),O=h.useCallback(e=>{if(D(e),typeof d==`function`)return d(e);d&&(d.current=e)},[d]);return(0,g.jsxs)(x,{children:[(0,g.jsx)(C,{className:t}),(0,g.jsx)(u,{...S,ref:O,"data-slot":`dialog-content`,"data-surface":s,"data-scroll-mode":l,"aria-busy":T||S[`aria-busy`]||void 0,onEscapeKeyDown:e=>{f?.(e),T&&e.preventDefault()},onPointerDownOutside:e=>{y?.(e),T&&e.preventDefault()},onInteractOutside:e=>{b?.(e),T&&e.preventDefault()},className:p(`fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100vh-2rem)] supports-[height:100dvh]:max-h-[calc(100dvh-2rem)] w-full -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto overscroll-contain rounded-[var(--r-lg)] bg-popover p-4 text-sm text-popover-foreground shadow-float duration-[var(--duration-fast,150ms)] outline-none data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,o==="default"&&`max-w-[min(92vw,520px)]`,o===`compact`&&`max-w-[min(92vw,430px)]`,o===`wide`&&`max-w-[min(92vw,600px)]`,s===`confirmation`&&`border border-stroke`,l===`body`&&`flex flex-col overflow-hidden`,e),children:(0,g.jsxs)(v.Provider,{value:E,children:[n,a&&(0,g.jsx)(c,{"data-slot":`dialog-close`,asChild:!0,children:(0,g.jsxs)(m,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,disabled:T,children:[(0,g.jsx)(i,{}),(0,g.jsx)(`span`,{className:`sr-only`,children:w(`common:ui.closeDialog`)})]})})]})})]})}function T({className:e,...t}){return(0,g.jsx)(`div`,{"data-slot":`dialog-body`,className:p(`min-h-0 flex-1 overflow-y-auto overscroll-contain`,e),...t})}function E({className:e,...t}){return(0,g.jsx)(`div`,{"data-slot":`dialog-header`,className:p(`flex shrink-0 flex-col gap-2`,e),...t})}function D({className:e,showCloseButton:t=!1,children:n,...i}){let{t:a}=r();return(0,g.jsxs)(`div`,{"data-slot":`dialog-footer`,className:p(`-mx-4 -mb-4 flex shrink-0 flex-col-reverse gap-2 rounded-b-[var(--r-lg)] border-t border-stroke bg-surface-subtle px-4 py-3 sm:flex-row sm:justify-end`,e),...i,children:[n,t&&(0,g.jsx)(c,{asChild:!0,children:(0,g.jsx)(m,{variant:`outline`,size:`dialogAction`,children:a(`common:ui.closeDialog`)})})]})}function O({className:e,...t}){return(0,g.jsx)(d,{"data-slot":`dialog-title`,className:p(`font-heading text-[15px] leading-snug font-medium`,e),...t})}function k({className:e,...t}){return(0,g.jsx)(s,{"data-slot":`dialog-description`,className:p(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}export{k as a,v as c,w as i,O as l,T as n,D as o,S as r,E as s,y as t,b as u};
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-_vdxObu5.js";import{t as i}from"./x-07u4-129.js";import{a,c as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./dist-BHkR6BLP.js";import{t as p}from"./utils-C8uzG5AZ.js";import{t as m}from"./button-CCcCN8tE.js";var h=e(t(),1),g=n(),_=h.createContext(!1),v=h.createContext(null);function y({busy:e=!1,open:t,defaultOpen:n=!1,onOpenChange:r,...i}){let[a,o]=h.useState(n);return(0,g.jsx)(_.Provider,{value:e,children:(0,g.jsx)(f,{"data-slot":`dialog`,open:t??a,onOpenChange:n=>{!n&&e||(t===void 0&&o(n),r?.(n))},...i})})}function b({...e}){return(0,g.jsx)(o,{"data-slot":`dialog-trigger`,...e})}function x({...e}){return(0,g.jsx)(l,{"data-slot":`dialog-portal`,...e})}function S({...e}){return(0,g.jsx)(c,{"data-slot":`dialog-close`,...e})}function C({className:e,...t}){return(0,g.jsx)(a,{"data-slot":`dialog-overlay`,className:p(`fixed inset-0 isolate z-50 bg-[var(--overlay-scrim)] duration-[var(--duration-fast,150ms)] data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function w({className:e,overlayClassName:t,children:n,showCloseButton:a=!0,size:o=`default`,surface:s=`default`,scrollMode:l=`content`,ref:d,onEscapeKeyDown:f,onPointerDownOutside:y,onInteractOutside:b,...S}){let{t:w}=r(),T=h.useContext(_),[E,D]=h.useState(null),O=h.useCallback(e=>{if(D(e),typeof d==`function`)return d(e);d&&(d.current=e)},[d]);return(0,g.jsxs)(x,{children:[(0,g.jsx)(C,{className:t}),(0,g.jsx)(u,{...S,ref:O,"data-slot":`dialog-content`,"data-surface":s,"data-scroll-mode":l,"aria-busy":T||S[`aria-busy`]||void 0,onEscapeKeyDown:e=>{f?.(e),T&&e.preventDefault()},onPointerDownOutside:e=>{y?.(e),T&&e.preventDefault()},onInteractOutside:e=>{b?.(e),T&&e.preventDefault()},className:p(`fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100vh-2rem)] supports-[height:100dvh]:max-h-[calc(100dvh-2rem)] w-full -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto overscroll-contain rounded-[var(--r-lg)] bg-popover p-4 text-sm text-popover-foreground shadow-float duration-[var(--duration-fast,150ms)] outline-none data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,o==="default"&&`max-w-[min(92vw,520px)]`,o===`compact`&&`max-w-[min(92vw,430px)]`,o===`wide`&&`max-w-[min(92vw,600px)]`,s===`confirmation`&&`border border-stroke`,l===`body`&&`flex flex-col overflow-hidden`,e),children:(0,g.jsxs)(v.Provider,{value:E,children:[n,a&&(0,g.jsx)(c,{"data-slot":`dialog-close`,asChild:!0,children:(0,g.jsxs)(m,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,disabled:T,children:[(0,g.jsx)(i,{}),(0,g.jsx)(`span`,{className:`sr-only`,children:w(`common:ui.closeDialog`)})]})})]})})]})}function T({className:e,...t}){return(0,g.jsx)(`div`,{"data-slot":`dialog-body`,className:p(`min-h-0 flex-1 overflow-y-auto overscroll-contain`,e),...t})}function E({className:e,...t}){return(0,g.jsx)(`div`,{"data-slot":`dialog-header`,className:p(`flex shrink-0 flex-col gap-2`,e),...t})}function D({className:e,showCloseButton:t=!1,children:n,...i}){let{t:a}=r();return(0,g.jsxs)(`div`,{"data-slot":`dialog-footer`,className:p(`-mx-4 -mb-4 flex shrink-0 flex-col-reverse gap-2 rounded-b-[var(--r-lg)] border-t border-stroke bg-surface-subtle px-4 py-3 sm:flex-row sm:justify-end`,e),...i,children:[n,t&&(0,g.jsx)(c,{asChild:!0,children:(0,g.jsx)(m,{variant:`outline`,size:`dialogAction`,children:a(`common:ui.closeDialog`)})})]})}function O({className:e,...t}){return(0,g.jsx)(d,{"data-slot":`dialog-title`,className:p(`font-heading text-[15px] leading-snug font-medium`,e),...t})}function k({className:e,...t}){return(0,g.jsx)(s,{"data-slot":`dialog-description`,className:p(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}export{k as a,v as c,w as i,O as l,T as n,D as o,S as r,E as s,y as t,b as u};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t}from"./vendor-react-DwNgTV1j.js";var n=e(t(),1),r=Object.defineProperty,i=(e,t)=>r(e,`name`,{value:t,configurable:!0});function a(e){let t=n.useRef({value:e,previous:e});return n.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}i(a,`usePrevious`);var o=Object.defineProperty,s=(e,t)=>o(e,`name`,{value:t,configurable:!0});function c(e,[t,n]){return Math.min(n,Math.max(t,e))}s(c,`clamp`);export{a as n,c as t};
@@ -1 +1 @@
1
- import{t as e}from"./index-DjSjahBi.js";import{t}from"./storage-8QW6lXuT.js";var n=Object.freeze([`open`,`left`,`right`,`above`,`below`]);function r(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function i(e,t=`open`,r=``){return!e||!n.includes(t)?null:{sessionId:e,disposition:t,...r?{targetEntryId:r}:{}}}function a(e){if(!e)return null;try{let t=typeof e==`string`?JSON.parse(e):e;return r(t)?i(typeof t.sessionId==`string`?t.sessionId:``,typeof t.disposition==`string`?t.disposition:`open`,typeof t.targetEntryId==`string`?t.targetEntryId:``):null}catch{return null}}var o=`pisper:task-view-will-change`,s=`pisper:session-navigation-will-change`,c=`pisper:session-selected`,l=`pisper:active-session-changed`,u=`pisper:sessions-updated`,d=`pisper:command-palette-requested`,f=`pisper:session-command`,p=`pisper:session-branch-changed`,m=`pisper:new-task-focus`;function h(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.sessionId==`string`&&typeof t.entryId==`string`?{sessionId:t.sessionId,entryId:t.entryId}:null}catch{return null}}var g=``;function _(e=``){g=typeof e==`string`?e.slice(0,200):``,window.dispatchEvent(new Event(d))}function v(){let e=g;return g=``,e}function y(e){window.dispatchEvent(new CustomEvent(f,{detail:e}))}var b=!1;function x(){b=!0,window.dispatchEvent(new Event(m))}function S(){let e=b;return b=!1,e}function C(n,r=`open`,a=``){let o=i(n,r,a);o&&(window.dispatchEvent(new Event(s)),e.setItem(t.activeSession,n),localStorage.setItem(t.sessionOpenRequest,JSON.stringify(o)),a?localStorage.setItem(t.sessionMessageTarget,JSON.stringify({sessionId:n,entryId:a})):localStorage.removeItem(t.sessionMessageTarget),window.dispatchEvent(new CustomEvent(c,{detail:o})))}function w(e){let n=h(localStorage.getItem(t.sessionMessageTarget));return n?.sessionId===e?n.entryId:``}function T(e,n){let r=h(localStorage.getItem(t.sessionMessageTarget));r?.sessionId===e&&r.entryId===n&&localStorage.removeItem(t.sessionMessageTarget)}function E(){let e=a(localStorage.getItem(t.sessionOpenRequest));return localStorage.removeItem(t.sessionOpenRequest),e}function D(){let e=a(localStorage.getItem(t.sessionOpenRequest));return e?{type:`open`,sessionId:e.sessionId}:null}function O(e,t=``){window.dispatchEvent(new CustomEvent(l,{detail:{id:e||``,model:t||``}}))}function k(e){window.dispatchEvent(e?new CustomEvent(u,{detail:e}):new Event(u))}function A(e){let t=`detail`in e?e.detail:null;if(!t||typeof t!=`object`)return null;let{id:n,pinned:r,archived:i,unread:a,needsAttention:o,attentionReason:s}=t;return typeof n!=`string`||!n||typeof r!=`boolean`||typeof i!=`boolean`||typeof a!=`boolean`||typeof o!=`boolean`||s!==null&&s!==`approval`&&s!==`failure`?null:{id:n,pinned:r,archived:i,unread:a,needsAttention:o,attentionReason:s}}function j(e,t){let n=e=>{let n=A(e);n&&t(n)};return e.addEventListener(u,n),()=>e.removeEventListener(u,n)}function M(e){let t=`detail`in e?e.detail:null;if(!t||typeof t!=`object`)return null;let{id:n,name:r}=t;return typeof n==`string`&&n.length>0&&typeof r==`string`?{id:n,name:r}:null}function N(e,t){let n=e=>{let n=M(e);n&&t(n)};return e.addEventListener(u,n),()=>e.removeEventListener(u,n)}function P(e){let t=`detail`in e?e.detail:null;if(!t||typeof t!=`object`)return null;let{deletedIds:n}=t;return!Array.isArray(n)||!n.length||!n.every(e=>typeof e==`string`&&e.length>0)?null:{deletedIds:[...new Set(n)]}}function F(e,t){let n=e=>{let n=P(e);n&&t(n)};return e.addEventListener(u,n),()=>e.removeEventListener(u,n)}function I(e){e&&window.dispatchEvent(new CustomEvent(p,{detail:{sessionId:e}}))}function L(e){let t=t=>{let n=`detail`in t?t.detail:null,r=n&&typeof n==`object`?n.sessionId:null;typeof r==`string`&&r&&e(r)};return window.addEventListener(p,t),()=>window.removeEventListener(p,t)}export{N as C,j as S,x as _,s as a,L as b,O as c,T as d,S as f,_ as g,D as h,f as i,I as l,w as m,d as n,c as o,E as p,m as r,o as s,l as t,k as u,y as v,v as w,F as x,C as y};
1
+ import{t as e}from"./index-D_zLThH_.js";import{t}from"./storage-DtvZ_lEu.js";var n=Object.freeze([`open`,`left`,`right`,`above`,`below`]);function r(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function i(e,t=`open`,r=``){return!e||!n.includes(t)?null:{sessionId:e,disposition:t,...r?{targetEntryId:r}:{}}}function a(e){if(!e)return null;try{let t=typeof e==`string`?JSON.parse(e):e;return r(t)?i(typeof t.sessionId==`string`?t.sessionId:``,typeof t.disposition==`string`?t.disposition:`open`,typeof t.targetEntryId==`string`?t.targetEntryId:``):null}catch{return null}}var o=`pisper:task-view-will-change`,s=`pisper:session-navigation-will-change`,c=`pisper:session-selected`,l=`pisper:active-session-changed`,u=`pisper:sessions-updated`,d=`pisper:command-palette-requested`,f=`pisper:session-command`,p=`pisper:session-branch-changed`,m=`pisper:new-task-focus`;function h(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.sessionId==`string`&&typeof t.entryId==`string`?{sessionId:t.sessionId,entryId:t.entryId}:null}catch{return null}}var g=``;function _(e=``){g=typeof e==`string`?e.slice(0,200):``,window.dispatchEvent(new Event(d))}function v(){let e=g;return g=``,e}function y(e){window.dispatchEvent(new CustomEvent(f,{detail:e}))}var b=!1;function x(){b=!0,window.dispatchEvent(new Event(m))}function S(){let e=b;return b=!1,e}function C(n,r=`open`,a=``){let o=i(n,r,a);o&&(window.dispatchEvent(new Event(s)),e.setItem(t.activeSession,n),localStorage.setItem(t.sessionOpenRequest,JSON.stringify(o)),a?localStorage.setItem(t.sessionMessageTarget,JSON.stringify({sessionId:n,entryId:a})):localStorage.removeItem(t.sessionMessageTarget),window.dispatchEvent(new CustomEvent(c,{detail:o})))}function w(e){let n=h(localStorage.getItem(t.sessionMessageTarget));return n?.sessionId===e?n.entryId:``}function T(e,n){let r=h(localStorage.getItem(t.sessionMessageTarget));r?.sessionId===e&&r.entryId===n&&localStorage.removeItem(t.sessionMessageTarget)}function E(){let e=a(localStorage.getItem(t.sessionOpenRequest));return localStorage.removeItem(t.sessionOpenRequest),e}function D(){let e=a(localStorage.getItem(t.sessionOpenRequest));return e?{type:`open`,sessionId:e.sessionId}:null}function O(e,t=``){window.dispatchEvent(new CustomEvent(l,{detail:{id:e||``,model:t||``}}))}function k(e){window.dispatchEvent(e?new CustomEvent(u,{detail:e}):new Event(u))}function A(e){let t=`detail`in e?e.detail:null;if(!t||typeof t!=`object`)return null;let{id:n,pinned:r,archived:i,unread:a,needsAttention:o,attentionReason:s}=t;return typeof n!=`string`||!n||typeof r!=`boolean`||typeof i!=`boolean`||typeof a!=`boolean`||typeof o!=`boolean`||s!==null&&s!==`approval`&&s!==`failure`?null:{id:n,pinned:r,archived:i,unread:a,needsAttention:o,attentionReason:s}}function j(e,t){let n=e=>{let n=A(e);n&&t(n)};return e.addEventListener(u,n),()=>e.removeEventListener(u,n)}function M(e){let t=`detail`in e?e.detail:null;if(!t||typeof t!=`object`)return null;let{id:n,name:r}=t;return typeof n==`string`&&n.length>0&&typeof r==`string`?{id:n,name:r}:null}function N(e,t){let n=e=>{let n=M(e);n&&t(n)};return e.addEventListener(u,n),()=>e.removeEventListener(u,n)}function P(e){let t=`detail`in e?e.detail:null;if(!t||typeof t!=`object`)return null;let{id:n,cwd:r}=t;return typeof n==`string`&&n.length>0&&typeof r==`string`&&r.length>0?{id:n,cwd:r}:null}function F(e,t){let n=e=>{let n=P(e);n&&t(n)};return e.addEventListener(u,n),()=>e.removeEventListener(u,n)}function I(e){let t=`detail`in e?e.detail:null;if(!t||typeof t!=`object`)return null;let{deletedIds:n}=t;return!Array.isArray(n)||!n.length||!n.every(e=>typeof e==`string`&&e.length>0)?null:{deletedIds:[...new Set(n)]}}function L(e,t){let n=e=>{let n=I(e);n&&t(n)};return e.addEventListener(u,n),()=>e.removeEventListener(u,n)}function R(e){e&&window.dispatchEvent(new CustomEvent(p,{detail:{sessionId:e}}))}function z(e){let t=t=>{let n=`detail`in t?t.detail:null,r=n&&typeof n==`object`?n.sessionId:null;typeof r==`string`&&r&&e(r)};return window.addEventListener(p,t),()=>window.removeEventListener(p,t)}export{j as C,L as S,v as T,x as _,s as a,z as b,O as c,T as d,S as f,_ as g,D as h,f as i,R as l,w as m,d as n,c as o,E as p,m as r,o as s,l as t,k as u,y as v,N as w,F as x,C as y};
@@ -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-DCxQRXLH.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-DnykOp5e.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-_vdxObu5.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-D72gQCwH.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 +1 @@
1
- import{t as e}from"./index-DjSjahBi.js";import{t}from"./storage-8QW6lXuT.js";import{n}from"./startup-queries-iq2o5pqJ.js";import{t as r}from"./api-BmSvZCuH.js";import{n as i,t as a}from"./workspace-order-store-CQ4SHO-9.js";import{c as o,u as s}from"./events-C7sXXop4.js";import{l as c,o as l,t as u}from"./session-workspaces-Csgpuzxd.js";import{t as d}from"./pick-system-directory-CQS5pqM-.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=l(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 l=await p(),d=c(l,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 u(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??l.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 _=c(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
+ import{t as e}from"./index-D_zLThH_.js";import{t}from"./storage-DtvZ_lEu.js";import{n}from"./startup-queries-CuEXV1Zu.js";import{t as r}from"./api-BW_X0FMZ.js";import{n as i,t as a}from"./workspace-order-store-Ao4OZ13V.js";import{c as o,u as s}from"./events-PfANjkHx.js";import{l as c,o as l,t as u}from"./session-workspaces-Csgpuzxd.js";import{t as d}from"./pick-system-directory-yk6L7wR2.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=l(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 l=await p(),d=c(l,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 u(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??l.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 _=c(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-DjSjahBi.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-DCxQRXLH.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-BnKeB5vZ.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-CXB2yzW6.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-CvTVL6vy.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-D_zLThH_.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-_vdxObu5.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-DZITSvZr.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--q2hs_pT.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-CbMHRZpd.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};