pisper 0.6.14 → 0.6.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/pisper.mjs +5 -1
- package/lib/executor-node.mjs +590 -0
- package/lib/npm-update.mjs +2 -0
- package/package.json +5 -5
- package/web/.vite/manifest.json +852 -856
- package/web/assets/{AppDialog-DrhCZm1r.js → AppDialog-CgJEhcYw.js} +1 -1
- package/web/assets/{AppOverlays-CxgReqGn.js → AppOverlays-BBlYyb_U.js} +1 -1
- package/web/assets/{AppSelect-BGVBQRP1.js → AppSelect-BD6RAaJ5.js} +1 -1
- package/web/assets/{AssetsPage-CKK-byQY.js → AssetsPage-D3F4T0_j.js} +1 -1
- package/web/assets/BoardPage-CO7nU2Mw.js +3 -0
- package/web/assets/BotAvatar-CNL-APwP.js +1 -0
- package/web/assets/ChannelsPage-CsRbj9St.js +1 -0
- package/web/assets/{ChatAppearancePage-BhqRLf-2.js → ChatAppearancePage-Sc1V75I3.js} +1 -1
- package/web/assets/{ChatHistoryPage-DBsNyGYj.js → ChatHistoryPage-BT0mIaDN.js} +1 -1
- package/web/assets/ChatPage-C-hswZf9.js +553 -0
- package/web/assets/ConfigPage-DH2d8YGn.js +5 -0
- package/web/assets/{DesktopWindowControls-DCtIkpTs.js → DesktopWindowControls-Bo5vvIFH.js} +1 -1
- package/web/assets/{FeaturePage-Bkt1wWVg.js → FeaturePage-B3wCvGpC.js} +1 -1
- package/web/assets/{FileAttachmentPreview-Cnmi_2U-.js → FileAttachmentPreview-D8YqjbeC.js} +1 -1
- package/web/assets/{FloatingWidgets-BIJSFz34.js → FloatingWidgets-Dz_T7XWC.js} +1 -1
- package/web/assets/FocusRuntimeControls-hYDoXwg7.js +1 -0
- package/web/assets/{GitDiffViewer-rjt5_KOt.js → GitDiffViewer-CBju_Sj4.js} +3 -3
- package/web/assets/ManageProjectsDialog-Dtb2K7BK.js +1 -0
- package/web/assets/{MarkdownMessage-yl-PSRAz.js → MarkdownMessage-BDztlYIy.js} +1 -1
- package/web/assets/{McpPage-D6GyZCpt.js → McpPage-DQ6AILOH.js} +1 -1
- package/web/assets/MemoryPage-CK4evs_P.js +1 -0
- package/web/assets/{MobileNavigation-DcBH2I9Y.js → MobileNavigation-BICCops3.js} +1 -1
- package/web/assets/MobileViewportStabilizer-uKI4Zp7f.js +1 -0
- package/web/assets/{MorePage-BBfiQbiP.js → MorePage-DuML7bhr.js} +1 -1
- package/web/assets/NewBotDialog--2DSe9Sy.js +1 -0
- package/web/assets/{NewFolderDialog-BinpbTs8.js → NewFolderDialog-S-Qzjzfu.js} +1 -1
- package/web/assets/{PageHeader-D_J-19ni.js → PageHeader-B78dHJed.js} +1 -1
- package/web/assets/{PhoneDrawer-CwxDkWZQ.js → PhoneDrawer-DHRBi4XA.js} +1 -1
- package/web/assets/PhoneMenuButton-BjDV-dPl.js +1 -0
- package/web/assets/PhoneTopBar-BuyzXL4Z.js +1 -0
- package/web/assets/PluginsPage-Cd9bu2AS.js +1 -0
- package/web/assets/{SafeModePrompt-CLyt-z14.js → SafeModePrompt-BnoccbWI.js} +1 -1
- package/web/assets/SchedulesPage-DUhUUQP5.js +1 -0
- package/web/assets/SessionBrowserPane-B3weAiaB.js +2 -0
- package/web/assets/SessionContextPanel-BtxUlk9m.js +2 -0
- package/web/assets/SessionHome-ByiFmH18.js +1 -0
- package/web/assets/SessionInspector-VKOz4Rxs.js +1 -0
- package/web/assets/SessionShell-BsDAwWHd.js +1 -0
- package/web/assets/{SettingsSidebar-IqsOv5h1.js → SettingsSidebar-B-COw6Uw.js} +1 -1
- package/web/assets/{ShortcutHelpDialog-DKDAF94g.js → ShortcutHelpDialog-DquhK-Uh.js} +1 -1
- package/web/assets/{ShortcutKeys-DQFnMnX1.js → ShortcutKeys-BgwCWvNY.js} +1 -1
- package/web/assets/{SidebarUpdateStatus-Cbwy5ii9.js → SidebarUpdateStatus-Ci0ugb91.js} +1 -1
- package/web/assets/{SkillsPage-DTOzYSaS.js → SkillsPage-B46uoO_g.js} +1 -1
- package/web/assets/{TaskProcessesPane-DRFmGkE3.js → TaskProcessesPane-CI_5lWbf.js} +1 -1
- package/web/assets/{TaskTerminalView-DWNACXyI.js → TaskTerminalView-C2acHnAH.js} +1 -1
- package/web/assets/{TerminalPanel-QEt-SRiM.js → TerminalPanel-BAQ2VwKg.js} +1 -1
- package/web/assets/{WebDesktopPet-4CDch3gC.js → WebDesktopPet-D3bdxKPz.js} +1 -1
- package/web/assets/{WorkflowsPage-AMKQBlPo.js → WorkflowsPage-Dp1PRKQb.js} +1 -1
- package/web/assets/WorkspacePicker-BJhBGRH0.js +1 -0
- package/web/assets/accordion-CiJMkjqX.js +1 -0
- package/web/assets/{api-BO7LAPSQ.js → api-CKJOip3Q.js} +1 -1
- package/web/assets/{app-update-DKWPHTUY.js → app-update-yPQVXuw5.js} +1 -1
- package/web/assets/{approval-confirm-ByiI22Wo.js → approval-confirm-Cv754IjO.js} +1 -1
- package/web/assets/board-messages-CIYKjAla.js +1 -0
- package/web/assets/board-projects-wd79Rqt5.js +2 -0
- package/web/assets/channels-messages-KabR1HOR.js +1 -0
- package/web/assets/chat-api-Bvirerdj.js +1 -0
- package/web/assets/{client-store-6GNC8uyK.js → client-store-BaTctJrB.js} +1 -1
- package/web/assets/collapsible-Dcoy-qnz.js +1 -0
- package/web/assets/config-search-KYVClDpx.js +1 -0
- package/web/assets/{dialog-CUhFgsVd.js → dialog-Cb_sjjQV.js} +1 -1
- package/web/assets/{collapsible-DMaUQRX4.js → dist-DUSSw9eQ.js} +1 -1
- package/web/assets/events-CZTn9wa-.js +1 -0
- package/web/assets/file-diff-GxOMJkLj.js +1 -0
- package/web/assets/folder-paths--euvEC5U.js +1 -0
- package/web/assets/{hosts-1yQREdMi.js → hosts-BRPznOHU.js} +1 -1
- package/web/assets/i18n-DEs6BBob.js +1 -0
- package/web/assets/{index-CsE52ydO.js → index-C5aKcTGw.js} +2 -2
- package/web/assets/index-DD2H2OOC.css +2 -0
- package/web/assets/message-circle-question-mark-D7ehy_mi.js +1 -0
- package/web/assets/{mobile-remote-fallback-NJCTBu85.js → mobile-remote-fallback-DG_urwIg.js} +1 -1
- package/web/assets/mount-app-BdXRP9D-.js +9 -0
- package/web/assets/navigation-DkcKi1_5.js +1 -0
- package/web/assets/new-task-uLEgjs2Z.js +1 -0
- package/web/assets/{palette-navigation-ByC1_QS5.js → palette-navigation-HbVGltCo.js} +1 -1
- package/web/assets/{permission-rules-api-BoJ_1W-m.js → permission-rules-api-C9oRUm6Z.js} +1 -1
- package/web/assets/{pick-system-directory-B_RJmP26.js → pick-system-directory-B__qKy-X.js} +1 -1
- package/web/assets/placements-Bn0vPyEI.js +2 -0
- package/web/assets/{popover--UmYQ9yB.js → popover-CiVxYUEU.js} +1 -1
- package/web/assets/public-9meoHs0K.js +4 -0
- package/web/assets/public-D6X148yH.js +2 -0
- package/web/assets/public-DenVz3gW.js +2 -0
- package/web/assets/{public-components-DYGekkA7.js → public-components-BfHcj0Pn.js} +1 -1
- package/web/assets/public-diff-BqcNo4lt.js +1 -0
- package/web/assets/public-events-DCyxz5zX.js +1 -0
- package/web/assets/public-flags-BOI2nkm4.js +1 -0
- package/web/assets/public-launch-D0t4Hqf5.js +1 -0
- package/web/assets/public-sidebar-CdxAohEH.js +1 -0
- package/web/assets/react-bits-BsPlLi8F.css +1 -0
- package/web/assets/routes-DIeaqWVc.js +1 -0
- package/web/assets/runtime-capabilities-CHYOF_hE.js +1 -0
- package/web/assets/{runtime-capabilities-store-C2Qv7uDP.js → runtime-capabilities-store-D2d_9z0D.js} +1 -1
- package/web/assets/{safe-mode-instance-BiAPYJ2-.js → safe-mode-instance-hnF1BJYr.js} +1 -1
- package/web/assets/safe-mode-sentinel-CPmhLLXT.js +1 -0
- package/web/assets/{session-change-summary-api-DgRT32uh.js → session-change-summary-api-DmmNGbP7.js} +1 -1
- package/web/assets/{session-home-BktP6sGF.js → session-home-BAFT2Fk1.js} +1 -1
- package/web/assets/{session-organization-api-DFu3Chto.js → session-organization-api-Bs8DdxU1.js} +1 -1
- package/web/assets/{session-scope-DQPNgQMm.js → session-scope-XRVRtwow.js} +1 -1
- package/web/assets/{session-tree-actions-DfO8QHBO.js → session-tree-actions-Dzj7hrvM.js} +1 -1
- package/web/assets/{session-tree-summary-BwYRdui2.js → session-tree-summary-BXVKYODc.js} +1 -1
- package/web/assets/settings-navigation-DiP_AM1C.js +1 -0
- package/web/assets/{shortcuts-Cvp9WD9O.js → shortcuts-IA6Uq_O6.js} +1 -1
- package/web/assets/side-chat-context-CZ4IqNxt.js +7 -0
- package/web/assets/sidebar-Do_8-Hyh.js +2 -0
- package/web/assets/sidebar-store-DuRlD5qg.js +1 -0
- package/web/assets/{speech-session-DK_09Wky.js → speech-session-D_W5Ulli.js} +1 -1
- package/web/assets/{startup-queries-6Oztqpto.js → startup-queries-DeNu46nT.js} +1 -1
- package/web/assets/storage-DH3bQdy6.js +1 -0
- package/web/assets/tool-labels-ghvpPFmc.js +1 -0
- package/web/assets/{use-i18n-B5p-Kzvz.js → use-i18n-CUS2_EGy.js} +1 -1
- package/web/assets/use-mobile-C2tPBAza.js +1 -0
- package/web/assets/use-studio-actions-CYnwfaOn.js +3 -0
- package/web/assets/useNewProjectPicker-CacWA0IS.js +1 -0
- package/web/assets/usePhoneShell-cYrS53S8.js +1 -0
- package/web/assets/useSessionRowActions-DtunSg_Q.js +1 -0
- package/web/assets/useSidebarModel-6sqN4VA5.js +1 -0
- package/web/assets/web-preview-Dgng80ZD.js +1 -0
- package/web/assets/{web-preview-events-DQchQHt3.js → web-preview-events-JGegs4uF.js} +1 -1
- package/web/assets/workflow-messages-Cj35aJZc.js +1 -0
- package/web/assets/workspace-order-store-BuPmheRT.js +1 -0
- package/web/index.html +2 -2
- package/web/assets/BoardPage-vwv5vTDm.js +0 -3
- package/web/assets/ChannelsPage-L-wcVDSN.js +0 -1
- package/web/assets/ChatPage-DS0euFxR.js +0 -553
- package/web/assets/ConfigPage-pOzONr8e.js +0 -5
- package/web/assets/DispatchOverlay-n-qbkOP-.js +0 -1
- package/web/assets/FocusRuntimeControls-C7NIdpV4.js +0 -1
- package/web/assets/LaunchConsole-DtxzpXJo.js +0 -3
- package/web/assets/ManageProjectsDialog-RiFg3h1p.js +0 -1
- package/web/assets/MemoryPage-Dsx_6JpI.js +0 -1
- package/web/assets/MobileViewportStabilizer-OtwVmIPm.js +0 -1
- package/web/assets/PhoneMenuButton-B0AwvqEo.js +0 -1
- package/web/assets/PhoneTopBar-Dw0mIaWC.js +0 -1
- package/web/assets/PluginsPage-BzxPAX26.js +0 -1
- package/web/assets/QuickPromptIdeas-Cd3SwBqS.js +0 -1
- package/web/assets/SchedulesPage-Cbgl5v_8.js +0 -1
- package/web/assets/SessionBrowserPane-CB7jn-MS.js +0 -2
- package/web/assets/SessionContextPanel-CNmAp0ed.js +0 -2
- package/web/assets/SessionHome-Ck_daJT0.js +0 -1
- package/web/assets/SessionInspector-cSzwsc4b.js +0 -1
- package/web/assets/SessionShell-BOZ7h0yz.js +0 -1
- package/web/assets/WorkspacePicker-B9vYtfab.js +0 -1
- package/web/assets/board-launch-BmmPYZe8.js +0 -1
- package/web/assets/board-messages-BOWWyhz_.js +0 -1
- package/web/assets/board-projects-BU9fZB1q.js +0 -1
- package/web/assets/channels-messages-DazltGVm.js +0 -1
- package/web/assets/chat-api-DkdyVQY9.js +0 -1
- package/web/assets/config-search-HBKDuym0.js +0 -1
- package/web/assets/events-DrAPv0se.js +0 -1
- package/web/assets/file-text-N9JICX6E.js +0 -1
- package/web/assets/folder-paths-DQTpuGh9.js +0 -1
- package/web/assets/i18n-CHmr7GzM.js +0 -1
- package/web/assets/index-CfTBR7Rs.css +0 -2
- package/web/assets/list-checks-B5Jl4aiO.js +0 -1
- package/web/assets/mount-app-DfSFF0xv.js +0 -9
- package/web/assets/navigation-EoDz3gT8.js +0 -1
- package/web/assets/new-task-C3wuHTor.js +0 -1
- package/web/assets/placements-CqwqXPTp.js +0 -2
- package/web/assets/public-diff-DK-VNIar.js +0 -1
- package/web/assets/public-fqyTjQ0F.js +0 -2
- package/web/assets/public-jQjEc6OO.js +0 -1
- package/web/assets/public-launch-CT_m9KWo.js +0 -1
- package/web/assets/react-bits-DQli9s7O.css +0 -1
- package/web/assets/routes-Da0OHSy6.js +0 -1
- package/web/assets/runtime-capabilities-4_ZwLBqF.js +0 -1
- package/web/assets/safe-mode-sentinel-Ccu3Vmta.js +0 -1
- package/web/assets/session-workspaces-BWTBYaGT.js +0 -1
- package/web/assets/settings-navigation-_yUm71Uk.js +0 -1
- package/web/assets/shield-B1ruzHd0.js +0 -1
- package/web/assets/side-chat-context-BfOm4dFp.js +0 -7
- package/web/assets/sidebar-BLeRyb55.js +0 -2
- package/web/assets/sidebar-commands-ZA1UOA_F.js +0 -1
- package/web/assets/sidebar-store-1-aNPlDu.js +0 -1
- package/web/assets/storage-BY6wEHPw.js +0 -1
- package/web/assets/tool-labels-BUEvdohv.js +0 -1
- package/web/assets/use-mobile-DauOEda6.js +0 -1
- package/web/assets/use-studio-actions-D6c_pSJK.js +0 -3
- package/web/assets/useBoardItems-CzEbgTLJ.js +0 -1
- package/web/assets/useFleetSystemInfo-Bd8zJIFa.js +0 -1
- package/web/assets/useNewProjectPicker-DQY1X_ua.js +0 -1
- package/web/assets/useNow-Bxn4_OW9.js +0 -1
- package/web/assets/usePagePrimaryAction-CWPC0C_f.js +0 -1
- package/web/assets/usePhoneShell-Bvb7m-m4.js +0 -1
- package/web/assets/useSessionListQuery-D44XZfGr.js +0 -2
- package/web/assets/useSessionRowActions-Cr6SUAeE.js +0 -1
- package/web/assets/useSidebarModel-CWED0rsw.js +0 -1
- package/web/assets/wand-sparkles-CvEBNUFz.js +0 -1
- package/web/assets/web-preview-CqwSe9Zn.js +0 -1
- package/web/assets/workflow-messages-CMCQrs5q.js +0 -1
- package/web/assets/workspace-order-store-RYWvGOeR.js +0 -1
- /package/web/assets/{AnimatedList-D8fxDNGr.js → AnimatedList-DB5vqafO.js} +0 -0
- /package/web/assets/{ClickSpark-DmnEAJNI.js → ClickSpark-B1Rn7ZwL.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-Cd-3GVxJ.js";var t=e(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]);export{t};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MobileNavigation-DcBH2I9Y.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-react-DwNgTV1j.js","assets/use-i18n-B5p-Kzvz.js","assets/i18n-CHmr7GzM.js","assets/vendor-router-CSN_DGvx.js","assets/index-CsE52ydO.js","assets/index-CfTBR7Rs.css","assets/storage-BY6wEHPw.js","assets/vendor-state-GkUciC5H.js","assets/runtime-capabilities-store-C2Qv7uDP.js","assets/api-BO7LAPSQ.js","assets/abort-signal-f4JsiYKX.js","assets/runtime-capabilities-4_ZwLBqF.js","assets/chevron-left-BAtyp3_6.js","assets/createLucideIcon-Cd-3GVxJ.js","assets/chevron-right-C3t2Rckj.js","assets/settings-navigation-_yUm71Uk.js","assets/bell-BjONAtgH.js","assets/bot-B3TaBp_T.js","assets/info-DATxy0fb.js","assets/monitor-ORxecA9m.js","assets/refresh-cw-TbWxTY4K.js","assets/DesktopWindowControls-DCtIkpTs.js","assets/minus-BuutOHSj.js","assets/square-bHHVTT3G.js","assets/x-07u4-129.js","assets/FloatingWidgets-BIJSFz34.js","assets/routes-Da0OHSy6.js","assets/placements-CqwqXPTp.js","assets/useQuery-DdcpUQhO.js","assets/query-Bj-DUNYq.js","assets/component-changes-Q9Bf64Ob.js","assets/session-scope-DQPNgQMm.js","assets/session-board-status-D2lpFPiI.js","assets/safe-mode-sentinel-Ccu3Vmta.js","assets/usePhoneShell-Bvb7m-m4.js","assets/use-mobile-DauOEda6.js","assets/client-store-6GNC8uyK.js","assets/AppOverlays-CxgReqGn.js","assets/startup-queries-6Oztqpto.js","assets/mutation-CEbxdVYy.js","assets/circle-alert-DCChabnT.js","assets/loader-circle-BOwQzHB-.js","assets/message-square-SKjZyY3v.js","assets/plus-fQbSqB1n.js","assets/search-D0mqDaf_.js","assets/square-terminal-BVG6cUT1.js","assets/tag-CqkeJlBf.js","assets/utils-C8uzG5AZ.js","assets/vendor-ui-DvrYggeS.js","assets/kbd-CAufZTkl.js","assets/events-DrAPv0se.js","assets/shortcuts-Cvp9WD9O.js","assets/chat-api-DkdyVQY9.js","assets/format-DMJQzoZ7.js","assets/dialog-CUhFgsVd.js","assets/dist-BHkR6BLP.js","assets/dist-41X0pdUs.js","assets/dist-BsRXXcSL.js","assets/es2015-DTZdOI9P.js","assets/button-CCcCN8tE.js","assets/useOverlayFocusReturn-NkxBSSjb.js","assets/palette-navigation-ByC1_QS5.js","assets/blocks-Olsdp5Lp.js","assets/brain-qxhnKqYP.js","assets/calendar-clock-VIxTaqqy.js","assets/folder-open-FIShC5Qk.js","assets/list-T5PqlpS2.js","assets/plug-BsIeHRwC.js","assets/radio-tower-jGQwrFWB.js","assets/rotate-ccw-clock-CO6Bw-sF.js","assets/server-BgNvmqwJ.js","assets/settings-QX0oWnVK.js","assets/sparkles-S_eeuqn9.js","assets/workflow-Bg94dy8I.js","assets/AppDialog-DrhCZm1r.js","assets/label-CVWjEcfV.js","assets/input-CPw-zkYh.js","assets/WebDesktopPet-4CDch3gC.js","assets/public-components-DYGekkA7.js","assets/arrow-right-DqLOhpA2.js","assets/download-BCfIiuaL.js","assets/key-round-C29uZbsf.js","assets/config-search-HBKDuym0.js","assets/BrandLogo-k3CvJjd4.js","assets/sidebar-BLeRyb55.js","assets/chevron-down-CxtxIjiP.js","assets/ellipsis-CfGKfbq6.js","assets/useSessionRowActions-Cr6SUAeE.js","assets/useNewProjectPicker-DQY1X_ua.js","assets/useBoardItems-CzEbgTLJ.js","assets/useSessionListQuery-D44XZfGr.js","assets/session-organization-api-DFu3Chto.js","assets/session-workspaces-BWTBYaGT.js","assets/session-questions-Cf-1g85h.js","assets/workspace-order-store-RYWvGOeR.js","assets/folder-paths-DQTpuGh9.js","assets/pick-system-directory-B_RJmP26.js","assets/dropdown-menu-CFIFNaKO.js","assets/check-2vYc6QaP.js","assets/dist-DzGQ7sLi.js","assets/dist-BRjj4UeB.js","assets/dist-OB2r6Xsr.js","assets/dist-BaBySQmo.js","assets/useNow-Bxn4_OW9.js","assets/card-presentation-1oph2b8P.js","assets/board-projects-BU9fZB1q.js","assets/session-home-BktP6sGF.js","assets/motion-DTR4ZVle.js","assets/folder-plus-OPHZsJho.js","assets/pin-CU0FG0lI.js","assets/sidebar-store-1-aNPlDu.js","assets/useSidebarModel-CWED0rsw.js","assets/new-task-C3wuHTor.js","assets/shortcut-aria-jHRmld9z.js","assets/StatusGlyph-1KgitlUg.js","assets/sidebar-commands-ZA1UOA_F.js","assets/PhoneTopBar-Dw0mIaWC.js","assets/PhoneMenuButton-B0AwvqEo.js","assets/public-jQjEc6OO.js","assets/useFleetSystemInfo-Bd8zJIFa.js","assets/square-pen-hYbjKh6A.js","assets/PhoneDrawer-CwxDkWZQ.js","assets/sheet-BTaIEX4w.js","assets/SidebarUpdateStatus-Cbwy5ii9.js","assets/external-link-CEQqPcqc.js","assets/rocket-BgLSjoHY.js","assets/SettingsSidebar-IqsOv5h1.js","assets/arrow-left-B8oVrQ2S.js","assets/back-navigation-CK7X_5Bc.js","assets/DispatchOverlay-n-qbkOP-.js","assets/LaunchConsole-DtxzpXJo.js","assets/arrow-up-DST6-qVQ.js","assets/shield-alert-oZqX6MNu.js","assets/shield-B1ruzHd0.js","assets/FocusRuntimeControls-C7NIdpV4.js","assets/braces-DQcXLGFF.js","assets/dist-V8chnW6-.js","assets/file-text-N9JICX6E.js","assets/popover--UmYQ9yB.js","assets/slider-DTmAZl-R.js","assets/input-group-h8z63MzW.js","assets/textarea-DmATpOqT.js","assets/model-display-kDwvtxrW.js","assets/run-activity-CwfO0cui.js","assets/board-launch-BmmPYZe8.js","assets/public-launch-CT_m9KWo.js","assets/QuickPromptIdeas-Cd3SwBqS.js","assets/code-xml-BrUXrBax.js","assets/wand-sparkles-CvEBNUFz.js","assets/list-checks-B5Jl4aiO.js","assets/session-change-summary-api-DgRT32uh.js","assets/touch-target-BsyCgjR5.js","assets/ShortcutHelpDialog-DKDAF94g.js","assets/ShortcutKeys-DQFnMnX1.js","assets/PageHeader-D_J-19ni.js","assets/more-pages-D_PnxLN0.js","assets/TerminalPanel-QEt-SRiM.js","assets/terminal-context-aIsIJPn8.js","assets/TaskTerminalView-DWNACXyI.js","assets/PageState-Cz6vFMXv.js","assets/AppSelect-BGVBQRP1.js","assets/select-DD_WO-gs.js","assets/chevron-up-D_ZcXjqr.js","assets/dist-BiRPwy4W.js","assets/TaskTerminalView-BrP-ENHg.css","assets/MobileViewportStabilizer-OtwVmIPm.js","assets/session-tree-actions-DfO8QHBO.js","assets/session-tree-summary-BwYRdui2.js","assets/BoardPage-vwv5vTDm.js","assets/arrow-down-CDGua-ue.js","assets/corner-down-right--hxi-Ihy.js","assets/rotate-ccw-C0v8V77_.js","assets/trash-2-CNrPOoPR.js","assets/brand-DIEc3fK8.js","assets/segmented-control-BlM_GKV6.js","assets/tooltip-D4MFbqcG.js","assets/esm-DCV8yILT.js","assets/ChatPage-DS0euFxR.js","assets/permission-rules-api-BoJ_1W-m.js","assets/session-list-BeyOEzyU.js","assets/circle-check-iEdCm3Pw.js","assets/image-plus-D7bzZog0.js","assets/GitDiffViewer-rjt5_KOt.js","assets/file-Bllajneu.js","assets/side-chat-context-BfOm4dFp.js","assets/copy-DHmIFc52.js","assets/eye-uWAPXNzJ.js","assets/shield-check-Gvek4RJ7.js","assets/collapsible-DMaUQRX4.js","assets/alert-firawb0H.js","assets/vendor-motion-DSW3wzXK.js","assets/MarkdownMessage-yl-PSRAz.js","assets/vendor-markdown-plugins-CT5L3KA9.js","assets/vendor-shiki-runtime-DM7fm4Bl.js","assets/vendor-markdown-plugins-DEcVZfaU.css","assets/vendor-markdown-CT6Z4fh8.js","assets/route-context-DvWDul4T.js","assets/HoldToConfirmButton-BxdJ7icc.js","assets/card-C3A0b5KR.js","assets/FileAttachmentPreview-Cnmi_2U-.js","assets/tabs-DsgBuvJv.js","assets/git-branch-N7LGjtzt.js","assets/link-2-mgasYn21.js","assets/panel-right-BSUtqUd8.js","assets/paperclip-BCXrwYpb.js","assets/pencil-U08v_vV9.js","assets/play-DNDjDNGn.js","assets/triangle-alert-CE1q54ci.js","assets/wrench-6pg6_bqI.js","assets/checkbox-BrEHgFV0.js","assets/progress-5odAz3B9.js","assets/switch-D_G8wFhs.js","assets/WorkspacePicker-B9vYtfab.js","assets/app-primitives-Drz_SjnR.js","assets/badge-CWB3lj2H.js","assets/usePagePrimaryAction-CWPC0C_f.js","assets/web-preview-CqwSe9Zn.js","assets/tool-labels-BUEvdohv.js","assets/speech-session-DK_09Wky.js","assets/web-preview-events-DQchQHt3.js","assets/SessionShell-BOZ7h0yz.js","assets/SessionHome-Ck_daJT0.js","assets/MorePage-BBfiQbiP.js","assets/app-window-CPNdvYNt.js","assets/image-BY_c3FYU.js","assets/monitor-smartphone-B1gIjItA.js","assets/ChatHistoryPage-DBsNyGYj.js","assets/FeaturePage-Bkt1wWVg.js","assets/AssetsPage-CKK-byQY.js","assets/queryOptions-Dfvzj6n2.js","assets/mobile-runtime-recovery-tbTyacip.js","assets/field-DoLEb0np.js","assets/separator-BPh_qxvc.js","assets/ChannelsPage-L-wcVDSN.js","assets/send-QxBfLFo-.js","assets/SchedulesPage-Cbgl5v_8.js","assets/ConfigPage-pOzONr8e.js","assets/arrow-up-right-B6l8qFZz.js","assets/zap-DZHw5afO.js","assets/app-update-DKWPHTUY.js","assets/browser-notifications-DBS0oXqN.js","assets/ChatAppearancePage-BhqRLf-2.js","assets/PluginsPage-BzxPAX26.js","assets/earth-Ddy13fHh.js","assets/file-code-corner-BnE1ljT0.js","assets/package-BOmkLaKS.js","assets/save-CHBB52P8.js","assets/MemoryPage-Dsx_6JpI.js","assets/McpPage-D6GyZCpt.js","assets/SkillsPage-DTOzYSaS.js","assets/public-fqyTjQ0F.js","assets/settings-2-CXJjXJS9.js","assets/use-studio-actions-D6c_pSJK.js","assets/safe-mode-instance-BiAPYJ2-.js","assets/PageFrame-DNwGZ-Dz.js","assets/WorkflowsPage-AMKQBlPo.js","assets/grip-vertical-B__LYT0s.js","assets/vendor-xyflow-hxQFvEHK.js","assets/vendor-xyflow-DLioOiRN.css","assets/navigation-EoDz3gT8.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{a as t,d as n,f as r,h as i,i as a,l as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./vendor-router-CSN_DGvx.js";import{t as p}from"./index-CsE52ydO.js";import{i as m,n as h,r as g,t as _}from"./vendor-react-DwNgTV1j.js";import{t as v}from"./vendor-ui-DvrYggeS.js";import{a as y,c as b,d as x,f as S,i as ee,l as C,n as w,o as te,r as T,s as ne,t as re,u as ie}from"./routes-Da0OHSy6.js";import{a as E,c as ae,i as oe,l as se,o as ce,r as D,s as le,t as O}from"./i18n-CHmr7GzM.js";import{n as ue,r as k,t as A}from"./use-i18n-B5p-Kzvz.js";import{t as j}from"./storage-BY6wEHPw.js";import{n as de,t as fe}from"./useQuery-DdcpUQhO.js";import{a as pe,i as me,n as he,o as ge,r as _e,s as ve,t as ye}from"./startup-queries-6Oztqpto.js";import{s as be,t as xe}from"./api-BO7LAPSQ.js";import{a as Se,i as Ce,r as we}from"./runtime-capabilities-4_ZwLBqF.js";import{t as Te}from"./runtime-capabilities-store-C2Qv7uDP.js";import{n as Ee,r as De}from"./use-mobile-DauOEda6.js";import{t as Oe}from"./client-store-6GNC8uyK.js";import{t as M}from"./createLucideIcon-Cd-3GVxJ.js";import{t as ke}from"./circle-check-iEdCm3Pw.js";import{t as Ae}from"./info-DATxy0fb.js";import{a as je,i as Me,n as Ne,o as Pe,t as Fe}from"./settings-navigation-_yUm71Uk.js";import{n as Ie,t as Le}from"./list-T5PqlpS2.js";import{t as Re}from"./search-D0mqDaf_.js";import{t as ze}from"./settings-QX0oWnVK.js";import{t as Be}from"./square-pen-hYbjKh6A.js";import{t as Ve}from"./triangle-alert-CE1q54ci.js";import{t as He}from"./x-07u4-129.js";import{i as Ue,n as We,r as Ge,t as Ke}from"./more-pages-D_PnxLN0.js";import{a as qe}from"./dist-41X0pdUs.js";import{a as Je,c as N,i as Ye,l as Xe,o as P,r as Ze,s as Qe,t as F}from"./dist-BsRXXcSL.js";import{r as $e}from"./dist-BiRPwy4W.js";import{n as et}from"./dist-DzGQ7sLi.js";import{c as tt,i as nt,o as rt}from"./es2015-DTZdOI9P.js";import{r as it}from"./tooltip-D4MFbqcG.js";import{t as I}from"./utils-C8uzG5AZ.js";import{n as at,t as ot}from"./button-CCcCN8tE.js";import{t as st}from"./kbd-CAufZTkl.js";import{_ as ct,h as lt,n as ut,t as dt,v as ft}from"./events-DrAPv0se.js";import{a as pt,c as L,i as mt,n as ht,r as R,s as z}from"./shortcuts-Cvp9WD9O.js";import{t as B}from"./sidebar-store-1-aNPlDu.js";import{n as gt,t as _t}from"./new-task-C3wuHTor.js";import{a as vt,i as yt,l as bt,o as xt,s as St,t as V}from"./dialog-CUhFgsVd.js";import{t as Ct}from"./shortcut-aria-jHRmld9z.js";import{i as wt,t as Tt}from"./back-navigation-CK7X_5Bc.js";import{t as Et}from"./route-context-DvWDul4T.js";import{n as Dt}from"./sidebar-commands-ZA1UOA_F.js";import{r as H}from"./app-primitives-Drz_SjnR.js";import{n as U,r as Ot}from"./web-preview-CqwSe9Zn.js";import{t as kt}from"./BrandLogo-k3CvJjd4.js";import{r as W}from"./web-preview-events-DQchQHt3.js";import{_ as At,a as jt,c as Mt,f as G,h as Nt,l as Pt,n as Ft,r as It,s as Lt,u as K,v as q}from"./app-update-DKWPHTUY.js";import{i as Rt}from"./browser-notifications-DBS0oXqN.js";import{n as zt,t as Bt}from"./navigation-EoDz3gT8.js";var J=e(m());function Vt({i18n:e,defaultNS:t,children:n}){let r=(0,J.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,J.createElement)(k.Provider,{value:r},n)}var Y=M(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),Ht=M(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),Ut=e(h(),1),X=g(),Z=Object.defineProperty,Q=(e,t)=>Z(e,`name`,{value:t,configurable:!0}),Wt=`ToastProvider`,[Gt,Kt,qt]=et(`Toast`),[Jt,Yt]=Qe(`Toast`,[qt]),[Xt,Zt]=Jt(Wt),Qt=Q(e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,announcerContainer:o,children:s}=e,[c,l]=J.useState(null),[u,d]=J.useState(0),f=J.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Wt}\`. Expected non-empty \`string\`.`),(0,X.jsx)(Gt.Provider,{scope:t,children:(0,X.jsx)(Xt,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:J.useCallback(()=>d(e=>e+1),[]),onToastRemove:J.useCallback(()=>d(e=>e-1),[]),isClosePausedRef:f,announcerContainer:o,children:s})})},`ToastProvider`),$t=`ToastViewport`,en=[`F8`],tn=`toast.viewportPause`,nn=`toast.viewportResume`,rn=J.forwardRef(Q(function(e,t){let{__scopeToast:n,hotkey:r=en,label:i=`Notifications ({hotkey})`,...a}=e,o=Zt($t,n),s=Kt(n),c=J.useRef(null),l=J.useRef(null),u=J.useRef(null),d=J.useRef(null),f=qe(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;J.useEffect(()=>{let e=Q(e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()},`handleKeyDown`);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),J.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=Q(()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(tn);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},`handlePause`),r=Q(()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(nn);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},`handleResume`),i=Q(t=>{e.contains(t.relatedTarget)||r()},`handleFocusOutResume`),a=Q(()=>{e.contains(document.activeElement)||r()},`handlePointerLeaveResume`);return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=J.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...On(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return J.useEffect(()=>{let e=d.current;if(e){let t=Q(t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);kn(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}},`handleKeyDown`);return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,X.jsxs)(rt,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,X.jsx)(on,{ref:l,onFocusFromOutsideViewport:()=>{kn(h({tabbingDirection:`forwards`}))}}),(0,X.jsx)(Gt.Slot,{scope:n,children:(0,X.jsx)(N.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,X.jsx)(on,{ref:u,onFocusFromOutsideViewport:()=>{kn(h({tabbingDirection:`backwards`}))}})]})},`ToastViewport`)),an=`ToastFocusProxy`,on=J.forwardRef(Q(function(e,t){let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=Zt(an,n);return(0,X.jsx)($e,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})},`ToastFocusProxy`)),sn=`Toast`,cn=`toast.swipeStart`,ln=`toast.swipeMove`,un=`toast.swipeCancel`,dn=`toast.swipeEnd`,fn=J.forwardRef(Q(function(e,t){let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Ye({prop:r,defaultProp:i??!0,onChange:a,caller:sn});return(0,X.jsx)(Ze,{present:n||s,children:(0,X.jsx)(hn,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:F(e.onPause),onResume:F(e.onResume),onSwipeStart:P(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:P(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:P(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:P(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})},`Toast`)),[pn,mn]=Jt(sn,{onClose(){}}),hn=J.forwardRef(Q(function(e,t){let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=Zt(sn,n),g=Kt(n),[_,v]=J.useState(null),y=qe(t,v),b=J.useRef(null),x=J.useRef(null),S=i||h.duration,ee=J.useRef(0),C=J.useRef(S),w=J.useRef(0),{onToastAdd:te,onToastRemove:T}=h,ne=F(()=>{_?.contains(document.activeElement)&&h.viewport?.focus(),o()}),re=J.useCallback(e=>{!e||e===1/0||(window.clearTimeout(w.current),ee.current=new Date().getTime(),w.current=window.setTimeout(ne,e))},[ne]);J.useEffect(()=>{let e=h.viewport;if(e){let t=Q(()=>{re(C.current),l?.()},`handleResume`),n=Q(()=>{let e=new Date().getTime()-ee.current;C.current-=e,window.clearTimeout(w.current),c?.()},`handlePause`);return e.addEventListener(tn,n),e.addEventListener(nn,t),()=>{e.removeEventListener(tn,n),e.removeEventListener(nn,t)}}},[h.viewport,S,c,l,re]),J.useEffect(()=>{a&&!h.isClosePausedRef.current&&re(S)},[a,S,h.isClosePausedRef,re]),J.useEffect(()=>()=>{window.clearTimeout(w.current)},[]),J.useEffect(()=>(te(),()=>T()),[te,T]);let ie=J.useMemo(()=>_?Cn(_):null,[_]);return h.viewport?(0,X.jsxs)(X.Fragment,{children:[ie&&(0,X.jsx)(gn,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:ie}),(0,X.jsx)(pn,{scope:n,onClose:ne,children:Ut.createPortal((0,X.jsx)(Gt.ItemSlot,{scope:n,children:(0,X.jsx)(tt,{asChild:!0,onEscapeKeyDown:P(s,e=>{g().some(t=>t.ref.current?.contains(e.target))||ne()}),children:(0,X.jsx)(N.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:P(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||ne())}),onPointerDown:P(e.onPointerDown,e=>{e.button===0&&(b.current={x:e.clientX,y:e.clientY})}),onPointerMove:P(e.onPointerMove,e=>{if(!b.current)return;let t=e.clientX-b.current.x,n=e.clientY-b.current.y,r=!!x.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(x.current=l,wn(ln,d,f,{discrete:!1})):Tn(l,h.swipeDirection,c)?(x.current=l,wn(cn,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(b.current=null)}),onPointerUp:P(e.onPointerUp,e=>{let t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,b.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Tn(t,h.swipeDirection,h.swipeThreshold)?wn(dn,p,r,{discrete:!0}):wn(un,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null},`ToastImpl`)),gn=Q(e=>{let{__scopeToast:t,children:n,...r}=e,i=Zt(sn,t),[a,o]=J.useState(!1),[s,c]=J.useState(!1);return En(()=>o(!0)),J.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,X.jsx)(nt,{asChild:!0,container:i.announcerContainer||void 0,children:(0,X.jsx)($e,{...r,children:a&&(0,X.jsxs)(X.Fragment,{children:[i.label,` `,n]})})})},`ToastAnnounce`),_n=J.forwardRef(Q(function(e,t){let{__scopeToast:n,...r}=e;return(0,X.jsx)(N.div,{...r,ref:t})},`ToastDescription`)),vn=`ToastAction`,yn=J.forwardRef(Q(function(e,t){let{altText:n,...r}=e;return n.trim()?(0,X.jsx)(Sn,{altText:n,asChild:!0,children:(0,X.jsx)(xn,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${vn}\`. Expected non-empty \`string\`.`),null)},`ToastAction`)),bn=`ToastClose`,xn=J.forwardRef(Q(function(e,t){let{__scopeToast:n,...r}=e,i=mn(bn,n);return(0,X.jsx)(Sn,{asChild:!0,children:(0,X.jsx)(N.button,{type:`button`,...r,ref:t,onClick:P(e.onClick,i.onClose)})})},`ToastClose`)),Sn=J.forwardRef(Q(function(e,t){let{__scopeToast:n,altText:r,...i}=e;return(0,X.jsx)(N.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})},`ToastAnnounceExclude`));function Cn(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),Dn(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n){if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Cn(e))}}}),t}Q(Cn,`getAnnounceTextContent`);function wn(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Xe(i,a):i.dispatchEvent(a)}Q(wn,`handleAndDispatchCustomEvent`);var Tn=Q((e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n},`isDeltaInDirection`);function En(e=()=>{}){let t=F(e);Je(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}Q(En,`useNextFrame`);function Dn(e){return e.nodeType===e.ELEMENT_NODE}Q(Dn,`isHTMLElement`);function On(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Q(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Q(On,`getTabbableCandidates`);function kn(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}Q(kn,`focusFirst`);var An=Qt,jn=rn,Mn=fn,Nn=_n,Pn=yn,Fn=xn,In=_();function Ln({children:e}){let{i18n:t}=ue(),n=se(t.resolvedLanguage)?t.resolvedLanguage:O;return(0,J.useEffect)(()=>{document.documentElement.lang=n;try{p.setItem(j.language,n)}catch{}window.pisperDesktop?.setLanguage?.(n)},[n]),e}function Rn({children:e}){return(0,X.jsx)(Vt,{i18n:ae,children:(0,X.jsx)(Ln,{children:e})})}function zn({children:e}){return(0,J.useEffect)(()=>_e(window),[]),(0,X.jsx)(de,{client:pe,children:(0,X.jsx)(Rn,{children:(0,X.jsx)(it,{delayDuration:200,children:e})})})}function Bn(){return[...document.querySelectorAll(`[role="dialog"], [role="alertdialog"], [role="menu"], [data-slot="popover-content"]`)].some(e=>e.dataset.state!==`closed`&&e.getAttribute(`aria-hidden`)!==`true`&&e.getClientRects().length>0)}function Vn({onRouteBack:e}){let t=(0,J.useRef)(e);return t.current=e,(0,J.useEffect)(()=>{let e=new WeakSet,n=t=>{t.key===`Escape`&&Bn()&&e.add(t)},r=t=>{t.key!==`Escape`||t.defaultPrevented||t.isComposing||e.has(t)||Tt.dismiss()&&t.preventDefault()},i=()=>{let e=Bn(),n=new KeyboardEvent(`keydown`,{key:`Escape`,bubbles:!0,cancelable:!0});return wt(n),(document.activeElement||document.body).dispatchEvent(n),e||n.defaultPrevented?!0:t.current?.()??!1},a=window;return a.__pisperRequestBack=i,window.addEventListener(`keydown`,n,!0),window.addEventListener(`keydown`,r),()=>{a.__pisperRequestBack===i&&delete a.__pisperRequestBack,window.removeEventListener(`keydown`,n,!0),window.removeEventListener(`keydown`,r)}},[]),null}function Hn(){let e=null,t=!1;return{register(n){return e=n,t&&(t=!1,n()),()=>{e===n&&(e=null)}},invoke(){if(e)return e();t=!0},clear(){e=null}}}Object.freeze([`session`,`board`,`more`,`settings`]);var Un=Object.freeze({board:`board`,more:`more`,settings:`config`});function Wn(e,t){return t?`settings`:e===`session`||e===`chat`?`session`:e===`board`?`board`:e===`components`||e===`more`||e===`config`||Ge.has(e)?`more`:null}function Gn({location:e,navigation:t}){return t.state!==`idle`&&t.location?.pathname||e.pathname}function Kn({location:e,navigation:t}){return C(Gn({location:e,navigation:t}))===`session`?null:t.state!==`idle`&&C(e.pathname)===`session`?{to:e.pathname+(e.search||``),replace:!0,state:e.state}:{to:`/`}}var qn=/^\/components\/([^/]+)\/?$/;function Jn(e,t,n,{phone:r=!1,homeEntry:i=!1,canGoBack:a=!1}={}){return e===`session`?i||t===`/`||t===``?null:a?-1:null:e===`components`&&qn.test(t)?`/components`:r&&n&&/^\/config\/[^/]+/.test(t)?ee:Wn(e,n)===`more`&&e!==`more`?`/more`:`/`}var Yn=`flex w-full min-w-0 items-center gap-2.5 rounded-[var(--r-md)] px-2.5 text-base text-content transition-colors duration-(--d-fast) hover:bg-surface-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus`,Xn=`grid size-8 flex-none place-items-center rounded-[var(--r-sm)] text-content-secondary transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus pointer-coarse:size-11`,Zn=`grid size-10 place-items-center rounded-[var(--r-md)] text-content-secondary transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus pointer-coarse:size-11`;function Qn(e){let t=e.takeover,n=B(e=>e.collapsed)&&!t,r=B(e=>e.peeking),i=B(e=>e.setPeeking),a=(0,J.useRef)(null),o=(0,J.useRef)(null),s=(0,J.useRef)(!1);return(0,J.useLayoutEffect)(()=>{if(!s.current)return;let e=document.activeElement;e&&e!==document.body&&o.current?.contains(e)||o.current?.querySelector(`[data-sidebar-toggle]`)?.focus()},[n]),(0,J.useEffect)(()=>{t&&r&&i(!1)},[r,i,t]),(0,J.useEffect)(()=>{if(!n||!r)return;let e=e=>e instanceof Element&&!!(a.current?.contains(e)||e.closest(`[role="menu"], [role="dialog"], [data-radix-popper-content-wrapper]`)),t=t=>{e(t.target)||i(!1)},o=t=>{e(t.target)||i(!1)},s=t=>{t.key!==`Escape`||t.defaultPrevented||!e(t.target)||(t.preventDefault(),i(!1))};return document.addEventListener(`focusin`,t),document.addEventListener(`pointerdown`,o),document.addEventListener(`keydown`,s),()=>{document.removeEventListener(`focusin`,t),document.removeEventListener(`pointerdown`,o),document.removeEventListener(`keydown`,s)}},[n,r,i]),(0,X.jsxs)(`div`,{ref:o,"data-shell-sidebar":t?`settings`:n?`rail`:`expanded`,"data-focus-region":`sidebar`,onFocus:()=>{s.current=!0},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(s.current=!1)},className:I(`relative z-20 flex h-full flex-none flex-col bg-sidebar transition-[width] duration-(--d-base) ease-out motion-reduce:transition-none`,n?`w-[60px]`:`w-[268px]`,`dark:border-r dark:border-stroke-soft`),children:[t??(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col animate-in fade-in duration-(--d-fast) motion-reduce:animate-none`,children:n?(0,X.jsx)(nr,{...e}):(0,X.jsx)(tr,{...e})},n?`rail`:`expanded`),n&&r&&(0,X.jsx)(`div`,{ref:a,"data-shell-sidebar-peek":!0,className:`absolute inset-y-0 left-0 z-40 flex w-[268px] flex-col bg-sidebar shadow-float`,children:(0,X.jsx)(tr,{...e,peek:!0})})]})}var $n={newTask:`primaryAction`,search:`commandPalette`,board:`openBoard`,features:`openMore`,settings:`openSettings`};function er(){let{t:e}=A();return{newTask:e(`navigation:shell.newTask`),search:e(`navigation:sidebar.search`),board:e(`navigation:sidebar.allAgents`),features:e(`navigation:sidebar.features`),settings:e(`navigation:navigation.settings`)}}function tr({active:e,onNewTask:t,onSearch:n,onOpenBoard:r,onOpenFeatures:i,onOpenSettings:a,content:o,update:s,peek:c=!1}){let{t:l}=A(),u=er(),d=B(e=>e.toggleCollapsed),f=B(e=>e.setPeeking),p=L(e=>e.bindings),m=p.toggleSidebar,h=z(`toggleSidebar`),g={newTask:z(`primaryAction`),search:z(`commandPalette`),board:z(`openBoard`),features:z(`openMore`),settings:z(`openSettings`)},_=l(c?`navigation:sidebar.expand`:`navigation:sidebar.collapse`),v=(t,n,r)=>{let i=t===`board`?u.board:t===`features`?u.features:u[t],a=g[t],o=t===e;return(0,X.jsxs)(`button`,{type:`button`,"data-sidebar-entry":t,"aria-current":o?`page`:void 0,"aria-keyshortcuts":Ct(p[$n[t]]),className:I(Yn,`h-9 pointer-coarse:h-11`,o&&`bg-surface-active font-medium hover:bg-surface-active`),onClick:r,children:[(0,X.jsx)(n,{className:`size-[18px] flex-none text-content-secondary`,strokeWidth:1.75,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:i}),a&&(0,X.jsx)(st,{"aria-hidden":`true`,className:`border-transparent bg-transparent text-content-faint shadow-none pointer-coarse:hidden`,children:a})]})};return(0,X.jsxs)(`nav`,{"aria-label":l(`navigation:sidebar.label`),className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{"data-window-drag-region":!0,className:`flex h-[52px] flex-none items-center gap-2 pr-2.5 pl-4`,children:[(0,X.jsx)(kt,{size:22}),(0,X.jsx)(`span`,{className:`text-[15px] font-semibold tracking-[-.01em] text-content`,children:`Pisper`}),(0,X.jsx)(`span`,{className:`flex-1`}),(0,X.jsx)(`button`,{type:`button`,"data-sidebar-toggle":c?void 0:`collapse`,"aria-expanded":!c||void 0,className:Xn,"aria-label":_,"aria-keyshortcuts":c?void 0:Ct(m),title:!c&&h?`${_} (${h})`:_,onClick:()=>c?f(!1):d(),children:c?(0,X.jsx)(Ht,{className:`size-[18px]`,strokeWidth:1.75,"aria-hidden":`true`}):(0,X.jsx)(Y,{className:`size-[18px]`,strokeWidth:1.75,"aria-hidden":`true`})})]}),(0,X.jsxs)(`div`,{className:`flex flex-none flex-col gap-px px-2 pt-0.5 pb-1.5`,children:[v(`newTask`,Be,t),v(`search`,Re,n),v(`board`,Le,r),v(`features`,Ie,i)]}),(0,X.jsx)(`div`,{"data-sidebar-scroll":!0,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-2 pt-1.5`,children:o}),(0,X.jsxs)(`div`,{className:`flex flex-none items-center gap-1 p-2`,children:[(0,X.jsx)(`div`,{className:`min-w-0 flex-1`,children:v(`settings`,ze,a)}),s]})]})}function nr({active:e,onNewTask:t,onSearch:n,onOpenBoard:r,onOpenFeatures:i,onOpenSettings:a,railCounts:o,update:s}){let{t:c}=A(),l=er(),u=B(e=>e.toggleCollapsed),d=L(e=>e.bindings),f=d.toggleSidebar,p=z(`toggleSidebar`),m=c(`navigation:sidebar.expand`),h=(t,n,r)=>{let i=t===`board`?l.board:t===`features`?l.features:l[t],a=t===e;return(0,X.jsx)(`button`,{type:`button`,"data-sidebar-entry":t,"aria-keyshortcuts":Ct(d[$n[t]]),"aria-label":i,"aria-current":a?`page`:void 0,title:i,className:I(Zn,a&&`bg-surface-active text-content`),onClick:r,children:(0,X.jsx)(n,{className:`size-[18px]`,strokeWidth:1.75,"aria-hidden":`true`})})};return(0,X.jsxs)(`nav`,{"aria-label":c(`navigation:sidebar.labelCollapsed`),className:`flex min-h-0 flex-1 flex-col items-center gap-1 pb-2`,children:[(0,X.jsx)(`div`,{"data-window-drag-region":!0,className:`flex h-[52px] flex-none items-center`,children:(0,X.jsx)(`button`,{type:`button`,"data-sidebar-toggle":`expand`,"aria-expanded":!1,className:Zn,"aria-label":m,"aria-keyshortcuts":Ct(f),title:p?`${m} (${p})`:m,onClick:u,children:(0,X.jsx)(Ht,{className:`size-[18px]`,strokeWidth:1.75,"aria-hidden":`true`})})}),h(`newTask`,Be,t),h(`search`,Re,n),(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`my-1.5 h-px w-6 bg-stroke-strong`}),o,(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`my-1.5 h-px w-6 bg-stroke-strong`}),h(`board`,Le,r),h(`features`,Ie,i),(0,X.jsx)(`span`,{className:`flex-1`}),s,h(`settings`,ze,a)]})}function rr({collapsed:e=!1}){let{t}=A();return e?(0,X.jsxs)(`div`,{"aria-hidden":`true`,className:`flex flex-col items-center gap-1`,children:[(0,X.jsx)(`span`,{className:`size-10 rounded-[var(--r-md)] bg-surface-hover`}),(0,X.jsx)(`span`,{className:`size-10 rounded-[var(--r-md)] bg-surface-hover`})]}):(0,X.jsx)(`div`,{role:`status`,"aria-busy":`true`,"aria-label":t(`navigation:sidebar.loading`),children:[60,44,70].map(e=>(0,X.jsxs)(`div`,{"aria-hidden":`true`,className:`flex h-9 items-center gap-2.5 px-2.5`,children:[(0,X.jsx)(`span`,{className:`size-4 rounded-full bg-surface-hover`}),(0,X.jsx)(`span`,{className:`h-3 rounded-sm bg-surface-hover`,style:{width:`${e}%`}})]},e))})}var ir=`pisper-custom-accent-style`,ar=[`xs`,`sm`,`base`,`lg`,`xl`,`2xl`,`3xl`],or=[12,13,14,16,20,24,28];function sr(e){let{uiFontSize:t}=Nt(typeof e==`number`?{uiFontSize:e}:{fontScale:e});return or.map(e=>Math.round(e*t/14))}function cr(e,t,n=new Date().getHours()){return e===`dark`?!0:e===`light`?!1:e===`system`?t:n>=18||n<8}function lr(e){let t=document.documentElement;t.dataset.accent=e.accent,t.dataset.density=e.density,t.dataset.fontScale=e.fontScale,t.dataset.motion=e.motion,t.dataset.radius=e.radius;let n=Nt(e.uiFontSize===void 0?{fontScale:e.fontScale,codeFontSize:e.codeFontSize}:e);t.style.setProperty(`--ui-font-size`,`${n.uiFontSize}px`),t.style.setProperty(`--font-code-size`,`${n.codeFontSize}px`),sr(n.uiFontSize).forEach((e,n)=>{t.style.setProperty(`--font-ui-${ar[n]}`,`${e}px`)});let r=e.accent===`custom`?q(e.customAccent||``):null,i=document.getElementById(ir);r?(i||(i=document.createElement(`style`),i.id=ir,document.head.append(i)),i.textContent=At(r)):i?.remove()}function ur(e,t){if(!e)return``;let n=t?.sessions?.find(t=>t?.id===e);return n&&n.archived!==!0?e:``}function dr(){let e=o(),t=f();return(0,J.useEffect)(()=>{let n=n=>{if(n.defaultPrevented)return;let r=(n.target instanceof Element?n.target:null)?.closest(`a[href]`);if(!r)return;let i=U({href:r.href,baseUrl:window.location.href,button:n.button,download:r.hasAttribute(`download`),altKey:n.altKey,ctrlKey:n.ctrlKey,metaKey:n.metaKey,shiftKey:n.shiftKey,behavior:r.dataset.webPreview});if(!i)return;if(n.preventDefault(),n.stopPropagation(),x(e.pathname)){W(i);return}let a=ur(p.getItem(j.activeSession),pe.getQueryData(ye));if(!a){window.open(i,`_blank`,`noopener,noreferrer`);return}W(i),t(S(a))};return document.addEventListener(`click`,n,!0),()=>document.removeEventListener(`click`,n,!0)},[e.pathname,t]),null}function fr({blocked:e,onCommandPalette:t,onPrimary:n,onSearch:r,onToggleTerminal:i,onToggleSidebar:a,onAgentPanel:o,onPreviousAgent:s,onNextAgent:c,onSettings:l,onOpenSession:u,onOpenBoard:d,onOpenComponents:f,onOpenMore:p,onJumpToAttention:m,onSessionTree:h,onSideChat:g,onCycleFocusRegion:_,onShortcutHelp:v}){let y=L(e=>e.bindings);return(0,J.useLayoutEffect)(()=>{let b=b=>{if(e||pt(b)||mt(b)&&!b.key.startsWith(`Arrow`))return;let x;R(b,y.commandPalette)?x=t:R(b,y.primaryAction)?x=n:R(b,y.openSession)?x=u:R(b,y.openBoard)?x=d:R(b,y.openComponents)?x=f:R(b,y.openMore)?x=p:R(b,y.jumpToAttention)?x=m:R(b,y.sessionTree)?x=h:R(b,y.sideChat)?x=g:R(b,y.cycleFocusRegion)?x=_:R(b,y.toggleSidebar)?x=a:R(b,y.agentPanel)?x=o:R(b,y.previousAgent)?x=s:R(b,y.nextAgent)?x=c:R(b,y.toggleTerminal)?x=i:R(b,y.openSettings)?x=l:R(b,y.shortcutHelp)?x=v:!ht(b.target)&&R(b,y.focusSearch)&&(x=r),x&&(b.preventDefault(),x())};return window.addEventListener(`keydown`,b),()=>window.removeEventListener(`keydown`,b)},[y,e,o,t,_,m,c,d,f,p,u,s,n,r,h,l,v,g,i,a]),null}var pr=v(`group pointer-events-auto relative flex min-h-11 w-full items-center gap-2 overflow-hidden rounded-md border px-3.5 py-2.5 pr-10 text-[13px] leading-5 font-medium tracking-[0] shadow-float transition data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-right-full data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none`,{variants:{tone:{success:`border-success-border bg-success-soft text-success-strong`,error:`border-danger-border bg-danger-soft text-danger`,info:`border-stroke bg-popover text-foreground`}},defaultVariants:{tone:`success`}});function mr({className:e,tone:t,...n}){return(0,X.jsx)(Mn,{"data-slot":`toast`,className:I(pr({tone:t}),e),...n})}function hr({...e}){return(0,X.jsx)(An,{"data-slot":`toast-provider`,...e})}function gr({className:e,...t}){return(0,X.jsx)(jn,{"data-slot":`toast-viewport`,className:I(`fixed right-5 bottom-5 z-[80] flex w-[min(420px,calc(100vw-40px))] max-w-full flex-col gap-2 outline-none max-sm:right-3 max-sm:bottom-3 max-sm:left-3 max-sm:w-auto`,e),...t})}function _r({className:e,...t}){return(0,X.jsx)(Nn,{"data-slot":`toast-description`,className:I(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e),...t})}function vr({className:e,...t}){return(0,X.jsx)(Fn,{"data-slot":`toast-close`,className:I(`absolute top-1/2 right-1.5 grid size-7 -translate-y-1/2 place-items-center rounded-sm text-current opacity-70 transition hover:bg-black/5 hover:opacity-100 dark:hover:bg-white/10`,e),...t})}var yr={success:ke,error:Ve,info:Ae};function br({message:e,tone:t,closeLabel:n,action:r,...i}){let a=yr[t];return(0,X.jsxs)(mr,{tone:t,type:t===`error`?`foreground`:`background`,...i,children:[(0,X.jsx)(a,{className:`size-[18px] shrink-0`}),(0,X.jsx)(_r,{children:e}),r&&(0,X.jsx)(Pn,{altText:r.label,asChild:!0,children:(0,X.jsx)(`button`,{type:`button`,className:`h-7 shrink-0 rounded-sm border border-current/30 px-2 text-xs font-semibold hover:bg-current/10`,onClick:r.onAction,children:r.label})}),(0,X.jsx)(vr,{"aria-label":n,title:n,children:(0,X.jsx)(He,{className:`size-4`})})]})}function xr(){let{t:e}=A(),[t,n]=(0,J.useState)(null),r=(0,J.useRef)(null),i=(0,J.useCallback)(e=>{r.current?.(e),r.current=null,n(null)},[]),a=(0,J.useCallback)(e=>new Promise(t=>{r.current?.(null),r.current=t,n(e)}),[]),o=(0,J.useCallback)((t={})=>a({type:`confirm`,title:e(`common:useAppDialog.confirmAction`),confirmLabel:e(`common:useAppDialog.confirm`),tone:`danger`,...t}).then(e=>e===!0),[a,e]),s=(0,J.useCallback)((t={})=>a({type:`prompt`,title:e(`common:useAppDialog.enterContent`),confirmLabel:e(`common:useAppDialog.save`),tone:`primary`,value:``,...t}).then(e=>typeof e==`string`?e:null),[a,e]),c=(0,J.useCallback)(()=>i(null),[i]);return(0,J.useEffect)(()=>()=>r.current?.(null),[]),{dialog:t,confirm:o,prompt:s,close:c,finish:i}}var Sr=15e3,Cr=216e5,wr=new Set([`checking`,`downloading`,`downloaded`]);function Tr(e){return!wr.has(e)}function Er(e,t=window){let n=!1,r=!1,i=()=>{n||r||(n=!0,Promise.resolve().then(e).catch(()=>{}).finally(()=>{n=!1}))},a=t.setTimeout(i,Sr),o=t.setInterval(i,Cr);return()=>{r=!0,t.clearTimeout(a),t.clearInterval(o)}}var Dr=new Set([`available`,`downloading`,`installed`,`error`]);function Or(e,t){return t?.find(e=>e.component===`desktop`)?.currentVersion.trim()||e}function kr(e){return e.filter(e=>e.size>0&&(Dr.has(e.state)||e.canInstall))}function Ar(e){return e.replace(/\r/g,``).split(`
|
|
3
|
-
`).filter(e=>!/^\s*#{1,6}\s+Pisper\s+(?:Desktop|TUI|Runtime)\s+v?\d+\.\d+\.\d+\s*$/i.test(e)&&!/^\s*#{1,6}\s+What['’]?s Changed\s*$/i.test(e)&&!/^\s*(?:\*\*)?(?:Full Changelog|完整变更)(?:\*\*)?\s*[::].*$/i.test(e)).join(`
|
|
4
|
-
`).replace(/\n{3,}/g,`
|
|
5
|
-
|
|
6
|
-
`).trim()}function jr(e){let t=e.filter(e=>e.state===`available`||e.state===`downloading`).map(e=>Ar(e.notes)).filter((e,t,n)=>e&&n.indexOf(e)===t);return t.length?`## What's Changed\n\n${t.join(`
|
|
7
|
-
|
|
8
|
-
`)}`:``}function Mr(e,t=new Date().toISOString()){let n=e.filter(e=>e.state===`error`),r=e.filter(e=>e.state===`available`),i=e.some(e=>e.state===`checking`),a=e.filter(e=>e.state===`downloading`),o=e.some(e=>e.state===`installed`),s=a[0]||r[0]||n[0]||e[0],c=jr(e),l=kr(e),u=l.reduce((e,t)=>e+t.size,0),d=l.reduce((e,t)=>t.state===`installed`?e+t.size:t.state===`downloading`?e+Math.min(t.size,Math.max(0,t.transferred||0)):e,0);return{state:a.length?`downloading`:i?`checking`:n.length?`error`:r.length?`available`:o?`installed`:e.length?`current`:`idle`,checkedAt:t,message:n.map(e=>`${e.component}: ${e.message}`).join(`
|
|
9
|
-
`),releaseUrl:s?.releaseUrl,canDownload:r.length>0,availableVersion:s?.availableVersion,notes:c,total:u,transferred:d,percent:u>0?Math.min(100,d/u*100):0}}async function Nr({refresh:e=!1,fetcher:t=fetch}={}){let n=await t(`/api/app-update${e?`?refresh=1`:``}`,{cache:`no-store`}),r=await n.json().catch(()=>null);if(!n.ok){let e=r&&`error`in r&&typeof r.error==`string`?r.error.trim():``;throw Error(e||`更新检查失败:HTTP ${n.status}`)}return r}var Pr=Object.freeze({desktop:!1,packaged:!1,version:`0.6.11`,platform:`browser`,arch:``,releasesUrl:Ft});function Fr(){let e=window.pisperDesktop,t=e?void 0:window.__TAURI__?.core?.invoke??window.__TAURI_INTERNALS__?.invoke,[n,r]=(0,J.useState)(Pr),[i,a]=(0,J.useState)({state:`idle`,checkedAt:null}),[o,s]=(0,J.useState)([]),c=(0,J.useRef)(i),l=(0,J.useRef)(null),u=(0,J.useRef)(!1),d=(0,J.useRef)(!1),f=(0,J.useCallback)(e=>{c.current=e,a(e)},[]),p=(0,J.useCallback)(({refresh:n=!0}={})=>{if(l.current)return l.current;f({...c.current,state:`checking`,message:``});let r=(async()=>{try{if(u.current=!1,e?.checkForUpdates)try{let t=await e.checkForUpdates();if(t.state===`available`&&t.canDownload)return u.current=!0,f(t),t}catch{}if(e?.checkComponentUpdates){let t=await e.checkComponentUpdates();s(t);let n=Mr(t);return f(n),!t.some(e=>e.state===`error`||e.state===`available`)&&t.some(e=>e.restartRequired)&&await e.restartForComponentUpdate?.(),n}if(d.current&&t){let e=await t(`mobile_check_app_update`,{refresh:n});return f(e),e}let r=await Nr({refresh:n});return f(r),r}catch(e){let t={state:`error`,message:e instanceof Error?e.message:String(e),checkedAt:new Date().toISOString()};return f(t),t}})();return l.current=r,r.finally(()=>{l.current===r&&(l.current=null)}),r},[f,e,t]);(0,J.useEffect)(()=>{let n=!0,i=()=>{},a=()=>{},o=()=>{i=Er(()=>{if(Tr(c.current.state))return p({refresh:!1})})};if(!e){let e=()=>{n&&p({refresh:!1})};return t?(t(`mobile_app_info`).then(t=>{if(!n)return;if(!t.mobile){e();return}d.current=!0,r(t),s([]),t.update&&f(t.update),p({refresh:!1}),o();let i=()=>{document.visibilityState===`visible`&&Tr(c.current.state)&&p({refresh:!1})};document.addEventListener(`visibilitychange`,i),a=()=>document.removeEventListener(`visibilitychange`,i)}).catch(e),()=>{n=!1,i(),a()}):(e(),()=>{n=!1})}return e.getAppInfo().then(t=>{n&&(r({...t,hostVersion:t.version}),e.componentUpdateStatus?.().then(e=>{n&&(s(e),f(Mr(e)))}).catch(()=>{}),t.packaged&&o())}).catch(()=>{}),()=>{n=!1,i()}},[f,e,p,t]);let m=(0,J.useCallback)(async()=>{if(u.current&&e?.downloadUpdate){f({...c.current,state:`downloading`,message:``,transferred:0,percent:0});let t=e.onUpdateStatus?.(f);try{let t=await e.downloadUpdate();f(t),t.state===`downloaded`&&t.canInstall&&await e.installUpdate?.()}finally{t?.()}return[]}if(!e?.installComponentUpdates)return[];f({...c.current,state:`downloading`,message:``,transferred:0,percent:0});let t=!1,n=!1,r=async()=>{if(!(n||t||!e.componentUpdateStatus)){t=!0;try{let t=await e.componentUpdateStatus();if(n)return;s(t);let r=Mr(t);r.state!==`available`&&f(r)}catch{}finally{t=!1}}},i=window.setInterval(()=>void r(),250);try{let t=await e.installComponentUpdates();return n=!0,s(t),f(Mr(t)),!t.some(e=>e.state===`error`)&&t.some(e=>e.restartRequired)&&await e.restartForComponentUpdate?.(),t}finally{n=!0,window.clearInterval(i)}},[f,e]),h=(0,J.useCallback)(async()=>{if(e)return e.openReleases();let r=i.releaseUrl||n.releasesUrl||`https://github.com/ling-kong-ran/pisper/releases`;return d.current&&t?t(`mobile_open_app_update`,{url:r}):(window.open(r,`_blank`,`noopener,noreferrer`),!0)},[e,n.releasesUrl,t,i.releaseUrl]),g=(0,J.useCallback)(()=>e?.openUpdateLog?.(),[e]),_=(0,J.useCallback)(()=>d.current&&t&&i.downloadUrl?t(`mobile_open_app_update`,{url:i.downloadUrl}):h(),[t,h,i.downloadUrl]),v=(0,J.useCallback)(()=>_(),[_]);return{info:(0,J.useMemo)(()=>({...n,version:n.desktop?Or(n.hostVersion||n.version,o):n.version}),[o,n]),status:i,components:o,check:p,installComponents:m,download:_,install:v,openReleases:h,openUpdateLog:g}}function Ir(e){return!!e.providers?.some(e=>e.configured&&e.models?.some(e=>e.kind===`chat`))}function Lr(e,t){return!t&&!Ir(e)}function Rr(){try{return JSON.parse(p.getItem(j.terminalPanel)||`{}`)}catch{return{}}}var zr=()=>i(()=>import(`./MobileNavigation-DcBH2I9Y.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22])),Br=(0,J.lazy)(()=>zr().then(e=>({default:e.MobileSettingsBack}))),Vr=(0,J.lazy)(()=>zr().then(e=>({default:e.MobileSettingsList}))),Hr=(0,J.lazy)(()=>i(()=>import(`./DesktopWindowControls-DCtIkpTs.js`).then(e=>({default:e.DesktopWindowControls})),__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,24,15,25,26]))),Ur=(0,J.lazy)(()=>i(()=>import(`./FloatingWidgets-BIJSFz34.js`).then(e=>({default:e.FloatingWidgets})),__vite__mapDeps([27,1,5,2,6,7,28,29,4,8,3,9,30,31,32,10,11,12,13,33,34,35,36,37,38]))),Wr=(0,J.lazy)(async()=>{let[{CommandPalette:e},{getNavigation:t}]=await Promise.all([i(()=>import(`./AppOverlays-CxgReqGn.js`),__vite__mapDeps([39,1,2,3,4,5,6,7,8,9,30,31,40,41,11,12,13,10,15,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,26,57,58,59,60,61,62])),i(()=>import(`./palette-navigation-ByC1_QS5.js`),__vite__mapDeps([63,13,64,15,1,2,65,66,67,68,44,69,70,71,72,73,74,75]))]);function n(n){let{t:r}=A(),i=Te(e=>e.capabilities),a=(0,J.useMemo)(()=>t(r,i),[i,r]);return(0,X.jsx)(e,{...n,navigation:a})}return{default:n}}),Gr=(0,J.lazy)(()=>i(()=>import(`./AppDialog-DrhCZm1r.js`).then(e=>({default:e.AppDialog})),__vite__mapDeps([76,1,2,3,4,5,6,7,8,9,26,15,77,59,58,49,50,61,56,57,60,78]))),Kr=(0,J.lazy)(()=>i(()=>import(`./WebDesktopPet-4CDch3gC.js`).then(e=>({default:e.WebDesktopPet})),__vite__mapDeps([79,1,6,5,2,7,3,4,8,9,11,12]))),qr=(0,J.lazy)(()=>i(()=>import(`./public-components-DYGekkA7.js`).then(e=>({default:e.ConfigSearchBox})),__vite__mapDeps([80,1,2,3,4,5,6,7,8,9,10,11,12,13,81,15,82,83,46,72,26,49,50,61,58,51,84,53,56,57,59,60,78,85]))),Jr=(0,J.lazy)(()=>i(()=>import(`./public-components-DYGekkA7.js`).then(e=>({default:e.ModelOnboardingDialog})),__vite__mapDeps([80,1,2,3,4,5,6,7,8,9,10,11,12,13,81,15,82,83,46,72,26,49,50,61,58,51,84,53,56,57,59,60,78,85]))),Yr=()=>Promise.all([i(()=>import(`./sidebar-BLeRyb55.js`),__vite__mapDeps([86,1,5,2,28,3,4,6,7,8,9,15,87,16,88,89,34,90,91,10,11,12,13,92,31,30,40,41,32,54,93,52,94,95,96,97,98,99,100,58,59,101,60,102,103,104,49,50,105,106,107,108,109,110,111,71,53,112,113,114,115,116,117])),D()]).then(([e])=>e),Xr=(0,J.lazy)(()=>Yr().then(e=>({default:e.SidebarSessions}))),Zr=(0,J.lazy)(()=>Yr().then(e=>({default:e.SidebarRailCounts}))),Qr=(0,J.lazy)(()=>Yr().then(e=>({default:e.SidebarCommands}))),$r=(0,J.lazy)(()=>Yr().then(e=>({default:e.SidebarBoardFilters}))),ei=(0,J.lazy)(()=>Yr().then(e=>({default:e.SidebarFleetLine}))),ti=(0,J.lazy)(()=>Promise.all([i(()=>import(`./PhoneTopBar-Dw0mIaWC.js`),__vite__mapDeps([118,2,1,3,4,5,6,7,8,9,119,15,49,50,112,113,105,40,31,41,11,12,34,52,54,92,30,32,10,13,93,94,95,91,106,120,121,55,114,46,122])),D()]).then(([e])=>({default:e.PhoneTopBar}))),ni=(0,J.lazy)(()=>i(()=>import(`./PhoneDrawer-CwxDkWZQ.js`).then(e=>({default:e.PhoneDrawer})),__vite__mapDeps([123,2,1,3,4,5,6,7,8,9,68,15,46,73,122,49,50,124,26,57,58,59,60,61,112]))),ri=(0,J.lazy)(()=>i(()=>import(`./SidebarUpdateStatus-Cbwy5ii9.js`),__vite__mapDeps([125,2,1,3,4,5,6,7,8,9,82,15,126,22,127]))),ii=(0,J.lazy)(()=>i(()=>import(`./SettingsSidebar-IqsOv5h1.js`).then(e=>({default:e.SettingsSidebar})),__vite__mapDeps([128,1,2,3,4,5,6,7,8,9,10,11,12,13,129,15,81,17,18,19,20,21,22,49,50,51,53,130]))),ai=(0,J.lazy)(async()=>{let[{DispatchOverlay:e}]=await Promise.all([i(()=>import(`./DispatchOverlay-n-qbkOP-.js`),__vite__mapDeps([131,2,1,3,4,5,6,7,8,9,132,30,31,40,41,11,12,10,13,15,81,133,87,67,110,90,91,92,32,34,54,93,52,94,95,96,97,98,134,135,136,137,100,16,138,139,46,58,59,57,60,140,102,103,49,50,56,26,61,141,101,124,55,142,78,143,144,145,99,104,53,106,146,147,148,14,149,150,151,152,115,153,107,20,62])),D()]);return{default:e}}),oi=(0,J.lazy)(async()=>{let[{ShortcutHelpDialog:e}]=await Promise.all([i(()=>import(`./ShortcutHelpDialog-DKDAF94g.js`),__vite__mapDeps([154,1,2,3,4,5,6,7,8,9,73,15,61,50,58,49,53,56,26,57,59,60,155,51])),D()]);return{default:e}}),si=(0,J.lazy)(()=>i(()=>import(`./PageHeader-D_J-19ni.js`).then(e=>({default:e.PageHeader})),__vite__mapDeps([156,2,1,3,4,5,6,7,8,9,14,15,47,157,49,50,61,58,53]))),ci=(0,J.lazy)(()=>i(()=>import(`./TerminalPanel-QEt-SRiM.js`).then(e=>({default:e.TerminalPanel})),__vite__mapDeps([158,1,2,3,4,5,6,7,8,9,15,24,45,47,26,61,50,58,49,159,160,25,161,162,37,163,100,87,164,138,59,165,101,60,102,103,166]))),li=(0,J.lazy)(()=>i(()=>import(`./MobileViewportStabilizer-OtwVmIPm.js`).then(e=>({default:e.MobileViewportStabilizer})),__vite__mapDeps([167,1,2])));function ui(e,t){return String(e||``).replace(/\{\{\s*([\w.]+)\s*\}\}/g,(e,n)=>{let r=n.split(`.`).reduce((e,t)=>{if(!(!e||typeof e!=`object`))return e[t]},t);return r==null?`{{${n}}}`:String(r)})}function di(e){try{return decodeURIComponent(e)}catch{return``}}function fi(e,t){let n=window.__TAURI__?.core?.invoke??window.__TAURI_INTERNALS__?.invoke;return n?n(e,t):Promise.reject(Error(`native bridge unavailable`))}function pi({routerState:e}){let{t}=A();(0,J.useEffect)(()=>ve(`react-app-mounted`),[]);let n=o(),r=f(),s=(0,J.useCallback)(()=>e?.()??{location:n,navigation:{state:`idle`}},[n,e]),c=Te(e=>e.capabilities),l=Te(e=>e.loaded),u=Te(e=>e.load),d=(0,J.useMemo)(()=>Bt(t),[t]),m=C(n.pathname)||`board`,h=!!x(n.pathname),g=m===`config`?di(n.pathname.split(`/`)[2]||`models`):`models`,_=Fe.has(g)&&we(c,g)?g:`models`,v=je(m,_),b=(0,J.useRef)(m),[te,E]=(0,J.useState)(``),[ae,oe]=(0,J.useState)(()=>p.getItem(j.activeSession)||``),se=y(n.pathname,ae),ce=Oe(e=>e.client===`mobile-app`),D=Oe(e=>e.loaded),le=Ee(),O=ce||le,ue=De()&&ce,k=O&&!window.pisperDesktop&&!ue,de=Wn(m,v),_e=de===`board`?`board`:de===`more`?`features`:de===`settings`?`settings`:null,ye=B(e=>e.toggleCollapsed);(0,J.useEffect)(()=>{document.documentElement.toggleAttribute(`data-phone-shell`,k)},[k]),(0,J.useEffect)(()=>{B.getState().setDrawerOpen(!1)},[n.pathname,k]);let[be,M]=(0,J.useState)(!1),[ke,Ae]=(0,J.useState)(!1),[Ie,Le]=(0,J.useState)(!1),Re=G(e=>e.theme),ze=G(e=>e.cycleTheme),Be=G(e=>e.density),Ve=G(e=>e.accent),He=G(e=>e.customAccent),Ge=G(e=>e.fontScale),qe=G(e=>e.uiFontSize),Je=G(e=>e.codeFontSize),N=G(e=>e.radius),Ye=G(e=>e.motion),[Xe,P]=(0,J.useState)([]),[Ze,Qe]=(0,J.useState)(!1),F=Ze?void 0:Xe[0],$e=(0,J.useRef)(F);$e.current=F;let[et,tt]=(0,J.useState)(!1),[nt,rt]=(0,J.useState)(null),{data:it,isPending:I,isSuccess:at}=fe(ge(`config`)),{data:ot}=fe(ge(`notification-settings`)),[st,pt]=(0,J.useState)(!1),[L,mt]=(0,J.useState)({browser:{enabled:!1},connections:{},scopes:[],templates:[]}),[ht,R]=(0,J.useState)(null),z=(0,J.useMemo)(()=>({terminal:t(`terminal:terminalPanel.terminal`),resizeTerminal:t(`terminal:terminalPanel.resizeTerminal`),hideTerminal:t(`terminal:terminalPanel.hideTerminal`),showTerminal:t(`terminal:terminalPanel.showTerminal`),newTerminal:t(`terminal:terminalPanel.newTerminal`),closeTerminal:t(`terminal:terminalPanel.closeTerminal`),maximizeTerminal:t(`terminal:terminalPanel.maximizeTerminal`),openTerminal:t(`terminal:terminalPanel.openTerminal`),usesActiveSessionWorkspace:t(`terminal:terminalPanel.usesActiveSessionWorkspace`),orphanedTerminal:t(`terminal:terminalPanel.orphanedTerminal`),starting:t(`terminal:terminalPanel.starting`),processExited:e=>t(`terminal:terminalPanel.processExited`,{code:e??`-`})}),[t]),[vt,yt]=(0,J.useState)(()=>!!Rr().open),[bt,xt]=(0,J.useState)(()=>Math.max(180,Math.min(640,Number(Rr().height)||300)));(0,J.useEffect)(()=>{let e=()=>{window.pisperDesktop?.terminalProfiles&&Ce(c,`terminal`)&&yt(e=>!e)};return window.addEventListener(`pisper:toggle-terminal`,e),()=>window.removeEventListener(`pisper:toggle-terminal`,e)},[c]);let St=(0,J.useRef)(``),[V]=(0,J.useState)(Hn),Ct=(0,J.useRef)(null),wt=(0,J.useRef)(null),Tt=(0,J.useRef)(0),H=xr(),U=Fr();(0,J.useEffect)(()=>{lr({accent:Ve,density:Be,fontScale:Ge,motion:Ye,radius:N,customAccent:He,uiFontSize:qe,codeFontSize:Je})},[Ve,Be,Ge,Ye,N,He,qe,Je]),(0,J.useEffect)(()=>{p.setItem(j.terminalPanel,JSON.stringify({open:vt,height:bt}))},[bt,vt]),(0,J.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>{let t=cr(Re,e.matches);document.documentElement.dataset.theme=t?`dark`:`light`,document.documentElement.classList.toggle(`dark`,t)};if(t(),Re===`system`)return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t);if(Re===`scheduled`){let e=window.setInterval(t,6e4);return()=>window.clearInterval(e)}},[Re]);let W=(0,J.useCallback)((e,t=`success`,n)=>{Tt.current+=1;let r={id:Tt.current,message:e,tone:t,action:n?.action};P(e=>[...e,r])},[]);(0,J.useEffect)(()=>{let e=e=>{let t=$e.current;if(e.key!==`Escape`||!e.isTrusted||!t||!document.querySelector(`[data-radix-popper-content-wrapper], [role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]`))return;e.stopImmediatePropagation(),e.preventDefault();let n=document.activeElement instanceof HTMLElement?document.activeElement:document.body;Qe(!0),P(e=>e.filter(e=>e.id!==t.id)),requestAnimationFrame(()=>requestAnimationFrame(()=>{n.dispatchEvent(new KeyboardEvent(`keydown`,{key:`Escape`,code:`Escape`,bubbles:!0,cancelable:!0})),Qe(!1)}))};return document.addEventListener(`keydown`,e,{capture:!0}),()=>document.removeEventListener(`keydown`,e,{capture:!0})},[]),(0,J.useEffect)(()=>{let e=e=>{let t=e.detail?.id;oe(t??p.getItem(j.activeSession)??``)};window.addEventListener(dt,e);let t=e=>{let t=e.detail;t?.message&&W(t.message,t.tone===`error`?`error`:`info`)};return window.addEventListener(Et,t),Oe.getState().load({refresh:!1}).then(()=>ve(`client-info-loaded`)),u({refresh:!1}).then(()=>ve(`capabilities-loaded`)),()=>{window.removeEventListener(dt,e),window.removeEventListener(Et,t)}},[u,W]);let At=(0,J.useRef)(!1);(0,J.useEffect)(()=>{!D||!ce||At.current||(At.current=!0,(async()=>{await fi(`mobile_ensure_local_network_permission`).catch(()=>void 0)})())},[D,ce]);let Mt=(0,J.useCallback)((e,t,{force:n=!1}={})=>{if(L.browser?.enabled&&!(!n&&document.visibilityState===`visible`&&document.hasFocus())){if(window.pisperDesktop?.showNotification){window.pisperDesktop.showNotification({title:e,body:t}).catch(()=>{});return}if(It()){jt(e,t).catch(()=>{});return}Rt({title:e,body:t,tag:`pisper-${e}`,url:window.location.href}).catch(()=>{})}},[L.browser?.enabled]),Nt=(0,J.useCallback)((e,t,n)=>{let r=L.templates?.find(t=>t.id===e),i=r?.channels?.browser?.content;!r?.enabled||r.channels?.browser?.enabled===!1||!i||Mt(r.name,ui(i,t||{}),n)},[L.templates,Mt]),Pt=(0,J.useCallback)(e=>V.register(e),[V]),Ft=(0,J.useCallback)(()=>{V.invoke()},[V]),Lt=(0,J.useCallback)(e=>(R(e),()=>R(t=>t===e?null:t)),[]),K=(0,J.useCallback)((e,t)=>{if(!(!w.has(e)||!Se(c,e))){if(e===`chat`){if(!h){let e=lt();r(e?.type===`create`?S():e?.type===`open`?S(e.sessionId):`/`,t)}}else r(ie(e),t);E(``)}},[c,r,h]),q=(0,J.useCallback)((e,t=``)=>{e&&(ft(e,`open`,t),h||r(S(e)),E(``))},[r,h]),Vt=(0,J.useRef)(null),Y=(0,J.useCallback)(e=>{if(Gn(s())!==n.pathname){Vt.current=e;return}(m===`board`||m===`session`)&>(e)||Ae(!0)},[n.pathname,m,s]);(0,J.useEffect)(()=>{let e=Vt.current;!e||Gn(s())!==n.pathname||(Vt.current=null,Y(e))},[n,s,Y]);let Ht=(0,J.useCallback)((e,{open:n})=>{Ae(!1),n?q(e):W(t(`board:launch.dispatched`))},[W,q,t]),Ut=(0,J.useCallback)(e=>W(e,`error`,{action:{label:t(`board:dispatch.reopen`),onAction:()=>Ae(!0)}}),[W,t]);(0,J.useEffect)(()=>{if(l&&!Se(c,m)){r(`/`,{replace:!0});return}m===`config`&&g!==_&&r(`/config/${_}`,{replace:!0})},[c,l,_,m,g,r]);let Z=(0,J.useCallback)((e,t)=>{let n=Fe.has(e)&&we(c,e)?e:`models`;r(n===`interface`&&t===`widgets`?T.components:`/config/${n}`),E(``)},[c,r]),Q=(0,J.useCallback)(e=>{if(e===`session`){let e=Kn(s());e&&r(e.to,{replace:e.replace,state:e.state}),E(``)}else e===`settings`?k?r(ee):Z(`models`):K(Un[e])},[K,k,s,r,Z]),Wt=(0,J.useCallback)(()=>x(Gn(s())),[s]),Gt=(0,J.useCallback)(e=>{if(!e)return;let t=s(),n=Gn(t);if(x(n)===e)return;if(E(``),C(n)!==`session`){r(S(e));return}let i=n===`/`?re:t.location.state;r(S(e),{replace:!0,state:i})},[s,r]),Kt=(0,J.useCallback)(e=>{Wt()===e&&r(`/`,{replace:!0})},[Wt,r]),qt=(0,J.useCallback)(()=>{try{p.setItem(j.modelOnboardingDismissed,`1`)}catch{}tt(!1)},[]),Jt=(0,J.useCallback)(()=>{qt(),V.clear(),V.invoke(),Z(`models`)},[qt,V,Z]),Yt=(0,J.useCallback)(()=>{qt(),r(`/config/models?import=1`),E(``)},[qt,r]),Xt=(0,J.useCallback)(()=>Z(`updates`),[Z]),Zt=(0,J.useCallback)(()=>Z(`notifications`),[Z]),Qt=(0,J.useRef)(null);(0,J.useEffect)(()=>{if(!v){Qt.current=null;return}if(Qt.current!==null)return;let e=window.history.state?.idx;Qt.current=typeof e==`number`?e:0},[n.key,v]);let $t=(0,J.useCallback)(()=>{let e=Qt.current,t=window.history.state?.idx;r(e!==null&&e>0&&typeof t==`number`&&t>=e?-(t-e+1):`/`)},[r]),en=(0,J.useCallback)(async e=>e&&(await he(`sessions`)).sessions?.find(t=>t.id===e)?.cwd||``,[]),tn=(0,J.useCallback)(e=>{let t=p.getItem(j.activeSession)||``;rt({asset:e,targetSessionId:t}),t?q(t):r(S())},[q,r]);(0,J.useEffect)(()=>{let e=()=>{!H.dialog&&!et&&M(!0)},t=e=>{if(!(e.defaultPrevented||e.isComposing||e.keyCode===229)&&e.key===`Escape`&&!H.dialog){be&&(M(!1),e.preventDefault());return}};return window.addEventListener(`keydown`,t),window.addEventListener(ut,e),()=>{window.removeEventListener(`keydown`,t),window.removeEventListener(ut,e)}},[H.dialog,et,be]);let nn=(0,J.useRef)(!1);(0,J.useEffect)(()=>{if(I||nn.current||(nn.current=!0,pt(!0),!at||!it))return;ve(`config-loaded`);let e=!1;try{e=p.getItem(j.modelOnboardingDismissed)===`1`}catch{}b.current!==`config`&&Lr(it,e)&&tt(!0)},[it,I,at]),(0,J.useEffect)(()=>{st&&l&&(m===`board`||m===`session`)&&ve(`chat-shell-ready`)},[l,m,st]);let rn=(0,J.useRef)(m);(0,J.useLayoutEffect)(()=>{rn.current===`config`&&m!==`config`&&(me(`config`),me(`notification-settings`)),rn.current=m},[m]),(0,J.useEffect)(()=>{ot&&mt(ot)},[ot]),(0,J.useEffect)(()=>{let e=!0,t=async()=>{try{let t=St.current,n=await pe.fetchQuery({queryKey:[`browser-notification-events`,t],queryFn:()=>xe(`/api/settings/notifications/browser/events?after=${encodeURIComponent(t)}`),staleTime:0,retry:!1});if(!e)return;for(let e of n.events||[])Mt(e.title,e.body,{force:!0});St.current=n.latestId||St.current}catch{}};t();let n=window.setInterval(t,3e3);return()=>{e=!1,window.clearInterval(n)}},[Mt]);let an=m===`chat`?[t(`common:app.sessions`),O?``:t(`common:app.dragTabsOrSplitChatsInAnyDirectionFromTheSessionList`)]:m===`config`?[v&&Me(_)?Pe(t,_):Ne(t,_),``]:m===`workflowCreate`?zt(t,ht?ht.editing:di(n.pathname.split(`/`)[2]||`new`)!==`new`):d[m]||[t(`common:app.sessions`),``],on=(0,J.useCallback)(e=>{pe.cancelQueries({queryKey:[`notification-settings`],exact:!0}),pe.setQueryData([`notification-settings`],e),mt(e)},[]),sn=de===`more`&&m!==`more`,cn=(0,J.useCallback)(()=>r(T.more),[r]),ln={activeSessionId:se,navigate:K,notify:W,browserNotify:Nt,registerPrimaryAction:Pt,invokePrimaryAction:Ft,pendingAsset:nt,onAssetConsumed:()=>rt(null),onUseAsset:tn,requestText:H.prompt,requestConfirm:H.confirm,openNotificationSettings:Zt,configSection:_,setConfigSection:Z,setNotificationSettings:on,appUpdate:U,registerWorkflowActions:Lt,startNewTask:()=>Y(`board`),onBackToFeatures:sn?cn:void 0},un=(0,J.useCallback)(()=>{let e=window.history.state?.idx,t=Jn(m,n.pathname,v,{phone:k,homeEntry:ne(n.state),canGoBack:typeof e==`number`&&e>0});return t===-1?r(-1):t&&r(t),t!==null},[n.pathname,n.state,m,k,r,v]),dn=(0,J.useCallback)(()=>{if(m===`more`)document.getElementById(Ue)?.focus();else if(We.has(m))document.getElementById(Ke)?.focus();else if(m===`board`){let e=document.getElementById(_t);if(e)e.focus();else if(!k&&B.getState().collapsed){B.getState().setPeeking(!0);let e=0,t=()=>{let n=document.getElementById(_t);n?n.focus():(e+=1)<20&&requestAnimationFrame(t)};requestAnimationFrame(t)}}else Ct.current?.focus()},[m,k]),fn=k&&m!==`session`,pn=k&&v&&/^\/config\/?$/.test(n.pathname),mn=![`board`,`session`,`more`,`chat`,`workflowCreate`,`config`].includes(m)&&!We.has(m),hn=v&&!k;if(!st||!l)return(0,X.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`app-startup flex min-h-[100vh] w-full items-center justify-center gap-2.5 bg-chrome text-[13px] text-content-muted`,children:[(0,X.jsx)(kt,{size:30,className:`startup-logo`}),(0,X.jsx)(`strong`,{className:`font-medium`,children:t(`common:app.wakingPisper`)})]});let gn=e=>(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(qr,{query:te,onQueryChange:E,onSelect:Z,inputRef:Ct,placement:e})});return(0,X.jsx)(hr,{duration:2800,swipeDirection:`right`,children:(0,X.jsx)(Ot,{bridge:window.pisperDesktop,children:(0,X.jsxs)(`div`,{ref:wt,className:`app-shell flex w-full h-full min-h-0 flex-col overflow-hidden bg-chrome text-content [&[data-phone-shell]]:bg-panel [&[data-phone-shell][data-shell-canvas]]:bg-background [&[data-phone-shell][data-shell-chrome]]:bg-chrome pt-[var(--pisper-safe-area-top)] pr-[var(--pisper-safe-area-right)] pb-[var(--pisper-safe-area-bottom)] pl-[var(--pisper-safe-area-left)] [&[data-mobile-app]]:h-[100dvh] [&[data-mobile-app]]:min-h-0 [&[data-mobile-app]]:overflow-hidden [&[data-mobile-keyboard='open']]:pb-0 [&[data-phone-shell]]:pb-0`,"data-mobile-app":O||void 0,"data-phone-shell":k||void 0,"data-shell-canvas":m===`board`||m===`more`||void 0,"data-shell-chrome":m===`session`||void 0,"data-custom-titlebar":window.pisperDesktop?.customTitlebar||void 0,children:[window.pisperDesktop?.customTitlebar&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(Hr,{})}),(0,X.jsx)(dr,{}),O&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(li,{enabled:D&&st,shellRef:wt})}),Ce(c,`desktopPet`)&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(Kr,{})}),(0,X.jsx)(Vn,{onRouteBack:O?un:void 0}),(0,X.jsx)(fr,{blocked:!!(H.dialog||et||be||ke),onCommandPalette:()=>M(!0),onPrimary:()=>Y(`shortcut`),onSearch:dn,onToggleTerminal:window.pisperDesktop?.terminalProfiles&&Ce(c,`terminal`)?()=>yt(e=>!e):void 0,onSettings:()=>Q(`settings`),onOpenSession:()=>Q(`session`),onOpenBoard:()=>Q(`board`),onOpenComponents:()=>K(`components`),onOpenMore:()=>Q(`more`),onToggleSidebar:k?void 0:ye,onAgentPanel:()=>Dt({kind:`focus-list`}),onPreviousAgent:()=>Dt({kind:`adjacent`,direction:-1}),onNextAgent:()=>Dt({kind:`adjacent`,direction:1}),onJumpToAttention:()=>Dt({kind:`focus-attention`}),onSessionTree:m===`session`?()=>ct(`tree`):void 0,onSideChat:m===`session`?()=>ct(`side-chat`):void 0,onCycleFocusRegion:()=>void i(()=>import(`./focus-regions-B9MkPSKC.js`).then(e=>e.cycleFocusRegion()),[]),onShortcutHelp:()=>Le(!0)}),(0,X.jsxs)(`div`,{className:`app-body flex min-h-0 flex-1 overflow-hidden`,"data-mobile-app":O||void 0,children:[!k&&(0,X.jsx)(Qn,{active:_e,onNewTask:()=>Y(`sidebar`),onSearch:()=>M(!0),onOpenBoard:()=>Q(`board`),onOpenFeatures:()=>Q(`more`),onOpenSettings:()=>Q(`settings`),content:(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(rr,{}),children:m===`board`?(0,X.jsx)($r,{notify:W,requestConfirm:H.confirm,requestText:H.prompt,onNewTask:()=>Y(`sidebar`),onOpenHistory:()=>K(`chatHistory`)}):(0,X.jsx)(Xr,{currentId:x(n.pathname),notify:W,requestText:H.prompt,onOpenSession:Gt,onOpenBoard:()=>Q(`board`),onOpenHistory:()=>K(`chatHistory`),onArchived:Kt})}),takeover:hn?(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(`nav`,{"aria-busy":`true`,"aria-label":t(`config:settingsShell.settingsNavigation`),className:`flex-1`}),children:(0,X.jsx)(ii,{configSection:_,onSelectSection:Z,onBack:$t,onOpenFeatures:()=>Q(`more`),search:gn(`sidebar`),version:U.info?.version,footer:(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(ei,{onOpenBoard:()=>Q(`board`)})})})}):void 0,railCounts:(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(rr,{collapsed:!0}),children:(0,X.jsx)(Zr,{onOpenBoard:()=>Q(`board`)})}),update:U.status&&[`available`,`downloading`,`downloaded`].includes(U.status.state)?(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(`div`,{className:`flex-none [&>button]:size-8 [&>button]:min-h-0 pointer-coarse:[&>button]:size-11`,children:(0,X.jsx)(ri,{update:U,collapsed:!0,onOpen:Xt})})}):void 0}),(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(Qr,{resolveCurrentId:Wt,renderedSessionId:m===`session`?x(n.pathname):null,onOpenSession:Gt,onWaiting:({title:e,reason:t})=>Nt(`chat.waiting`,{chat:{title:e,tool:t,reason:t}})})}),(0,X.jsxs)(`main`,{"data-focus-region":`main`,className:`main-surface relative flex min-w-0 flex-1 flex-col overflow-hidden bg-panel`,children:[fn&&(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(`div`,{className:`h-14 flex-none bg-panel`,"aria-hidden":`true`}),children:(0,X.jsx)(ti,{title:pn?t(`navigation:navigation.settings`):an[0],onNewTask:()=>Y(`topbar`),onSearch:m===`board`?()=>M(!0):void 0})}),k&&v&&!pn&&(0,X.jsxs)(J.Suspense,{fallback:null,children:[(0,X.jsx)(Br,{onBack:()=>r(`/config`)}),(0,X.jsx)(`div`,{"data-mobile-settings-search":!0,className:`flex-none px-4 pb-1`,children:gn()})]}),mn&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(si,{meta:an,page:m,desktopPlatform:window.pisperDesktop?.platform||``,terminalOpen:vt,onToggleTerminal:()=>yt(e=>!e),onBackToMore:sn?cn:void 0,phoneShell:k})}),(0,X.jsx)(`div`,{className:`page-content flex-1 min-h-0 overflow-auto ${m===`session`||m===`chat`?`page-chat flex overflow-hidden p-0`:w.has(m)?`page-${m} overflow-hidden p-0`:`page-${m} px-6 pt-5 pb-5 max-[650px]:px-3 max-[650px]:pt-0`}`,children:pn?(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(Vr,{onNavigate:Z,onOpenFeatures:()=>Q(`more`)})}):(0,X.jsx)(a,{context:ln})},m),window.pisperDesktop?.terminalProfiles&&Ce(c,`terminal`)&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(ci,{open:vt,height:bt,labels:z,activeSessionId:se,resolveSessionCwd:en,onOpenChange:yt,onHeightChange:xt})})]})]}),k&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(ni,{active:_e,onSearch:()=>M(!0),onNewTask:()=>Y(`sidebar`),onOpenBoard:()=>Q(`board`),onOpenFeatures:()=>Q(`more`),onOpenSettings:()=>Q(`settings`),content:(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(rr,{}),children:(0,X.jsx)(Xr,{drawer:!0,currentId:x(n.pathname),notify:W,requestText:H.prompt,onOpenSession:Gt,onOpenBoard:()=>Q(`board`),onOpenHistory:()=>K(`chatHistory`),onArchived:Kt})}),update:U.status&&[`available`,`downloading`,`downloaded`].includes(U.status.state)?(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(`div`,{className:`flex-none [&>button]:size-11 [&>button]:min-h-0`,children:(0,X.jsx)(ri,{update:U,collapsed:!0,onOpen:Xt})})}):void 0})}),(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(Ur,{activeSessionId:se,notify:W})}),F&&(0,X.jsx)(br,{open:!0,message:F.message,tone:F.tone,action:F.action,duration:F.action?1e4:void 0,closeLabel:t(`common:ui.closeDialog`),onOpenChange:e=>!e&&P(e=>e.filter(e=>e.id!==F.id))},F.id),(0,X.jsx)(gr,{hotkey:[],label:t(`common:ui.notifications`)}),H.dialog&&(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(`span`,{role:`status`,className:`sr-only`,children:t(`common:pageTemplate.loading`)}),children:(0,X.jsx)(Gr,{dialog:H.dialog,onClose:H.close,onFinish:H.finish})}),(0,X.jsx)(J.Suspense,{fallback:null,children:et&&(0,X.jsx)(Jr,{open:!0,onDismiss:qt,onOpenImport:Yt,onOpenSettings:Jt})}),(0,X.jsxs)(J.Suspense,{fallback:null,children:[be&&(0,X.jsx)(Wr,{onClose:()=>M(!1),onNavigate:K,onOpenSession:async(e,n,r)=>{try{if(n&&!r){let{switchToTurnOnOtherBranch:r}=await i(async()=>{let{switchToTurnOnOtherBranch:e}=await import(`./session-tree-actions-DfO8QHBO.js`);return{switchToTurnOnOtherBranch:e}},__vite__mapDeps([168,52,6,5,1,2,7,8,54,40,31,41,11,4,12,169,30]));await r({sessionId:e,entryId:n,confirm:H.confirm,open:q,notify:W,t});return}q(e,n)}catch(e){throw W(t(`navigation:appOverlays.openLabeledTurnFailed`),`error`),e}},onNewChat:()=>Y(`palette`),onToggleTheme:ze}),Ie&&(0,X.jsx)(oi,{open:!0,onOpenChange:Le,onCustomize:()=>r(`/config/shortcuts`)})]}),(0,X.jsx)(J.Suspense,{fallback:null,children:ke&&(0,X.jsx)(ai,{open:!0,phone:k,onOpenChange:Ae,onDispatched:Ht,onDetachedFailure:Ut,onConfigureModels:()=>r(`/config/models`)})})]})})})}function mi({children:e}){let{t}=A(),n=f(),r=o(),i=(0,J.useRef)(new Map),a=(0,J.useRef)(new Map),s=(0,J.useRef)(0),[c,l]=(0,J.useState)(0),[d,p]=(0,J.useState)(null),m=(0,J.useRef)(null),[h,g]=(0,J.useState)(!1),_=u(({currentLocation:e,nextLocation:t})=>Pt(e,t)&&Object.values(K(i.current.values())).some(Boolean)),v=(0,J.useRef)(_);v.current=_;let y=(0,J.useCallback)(e=>{m.current=e,p(e)},[]),b=(0,J.useCallback)(e=>{let t=i.current.get(e.id);i.current.set(e.id,e),(!t||t.dirty!==e.dirty||t.saving!==e.saving)&&l(e=>e+1)},[]),x=(0,J.useCallback)(e=>{i.current.delete(e)&&l(e=>e+1)},[]),S=(0,J.useCallback)(()=>{y(null),a.current.clear(),v.current.state===`blocked`&&v.current.reset()},[y]),ee=(0,J.useCallback)((e,t,r)=>{a.current.clear();let i=`navigation-${++s.current}`;r&&a.current.set(i,r),n(e,{...t,state:{...t?.state,[Lt]:i}})},[n]),C=(0,J.useCallback)((e,t)=>{let n=i.current.get(e);if(n?.saving){S(),g(!0);return}if(v.current.state===`blocked`&&v.current.reset(),a.current.clear(),!n?.dirty){y(null),t();return}g(!1),y({kind:`close`,id:e,close:t})},[S,y]);(0,J.useLayoutEffect)(()=>{let e=K(i.current.values());if(_.state===`blocked`)e.saving||!e.dirty?(S(),g(e.saving)):(g(!1),y({kind:`route`}));else if(m.current?.kind===`close`){let e=i.current.get(m.current.id);(!e||e.saving||!e.dirty)&&(y(null),g(!!e?.saving))}},[_,c,S,y]),(0,J.useLayoutEffect)(()=>{let e=r.state?.[Lt],t=typeof e==`string`?a.current.get(e):void 0;t&&(a.current.delete(e),t())},[r]);let w=K(i.current.values());(0,J.useEffect)(()=>{if(!w.dirty&&!w.saving)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[w.dirty,w.saving]);let te=()=>{let e=m.current;if(!e)return;let t=e.kind===`close`?[i.current.get(e.id)].filter(e=>!!e):[...i.current.values()];if(t.some(e=>e.saving)){S(),g(!0);return}y(null);for(let e of t)e.dirty&&e.discard();e.kind===`close`?e.close():v.current.state===`blocked`&&v.current.proceed()},T=(0,J.useMemo)(()=>({update:b,remove:x,requestClose:C,navigate:ee}),[b,x,C,ee]);return(0,X.jsxs)(Mt.Provider,{value:T,children:[e,h&&(0,X.jsx)(`p`,{role:`status`,className:`fixed right-4 bottom-4 z-[300] rounded-lg border bg-popover p-3 text-sm text-popover-foreground shadow-md`,children:t(`common:unsaved.saving`)}),(0,X.jsx)(V,{open:!!d,onOpenChange:e=>{e||S()},children:(0,X.jsxs)(yt,{size:`compact`,surface:`confirmation`,showCloseButton:!1,className:`z-[400]`,overlayClassName:`z-[400]`,children:[(0,X.jsxs)(St,{children:[(0,X.jsx)(bt,{children:t(`common:unsaved.title`)}),(0,X.jsx)(vt,{children:t(`common:unsaved.description`)})]}),(0,X.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),te()},children:(0,X.jsxs)(xt,{children:[(0,X.jsx)(ot,{type:`button`,variant:`outline`,size:`dialogAction`,onClick:S,autoFocus:!0,children:t(`common:unsaved.keepEditing`)}),(0,X.jsx)(ot,{type:`submit`,variant:`destructive`,size:`dialogAction`,children:t(`common:unsaved.discard`)})]})})]})})]})}function hi(){let{t:e}=A();return(0,X.jsxs)(H,{children:[(0,X.jsx)(`span`,{className:`grid place-items-center`,children:(0,X.jsx)(at,{className:`size-6`})}),(0,X.jsx)(`h2`,{children:e(`navigation:pageLoader.lightingUpThisPage`)}),(0,X.jsx)(`p`,{children:e(`navigation:pageLoader.bringingTheNeededCapabilitiesIntoPlace`)})]})}async function gi(){window.__PISPER_MOBILE_APP__&&await be().catch(()=>void 0);let e=new URL(window.location.href);window.__PISPER_MOBILE_APP__&&e.protocol===`http:`&&e.hostname===`127.0.0.1`&&e.searchParams.set(`_pisper_recovery`,String(Date.now())),window.location.replace(e.href)}function _i(){let e=c(),t=s(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:`页面加载失败`;return(0,X.jsxs)(`main`,{className:`app-startup flex min-h-[100vh] w-full items-center justify-center gap-2.5 bg-chrome text-[13px] text-content-muted`,role:`alert`,children:[(0,X.jsx)(`strong`,{className:`font-medium`,children:t}),(0,X.jsx)(ot,{variant:`secondary`,type:`button`,onClick:()=>void gi(),children:`重新加载`})]})}function $(){return n()}async function vi(){let[{BoardPage:e}]=await Promise.all([i(()=>import(`./BoardPage-vwv5vTDm.js`),__vite__mapDeps([170,1,5,2,3,4,6,7,8,9,30,31,29,32,10,11,12,13,33,34,35,37,36,38,15,171,81,133,87,16,172,88,89,28,90,91,92,40,41,54,93,52,94,95,96,97,98,99,100,58,59,101,60,102,103,104,49,50,105,106,107,108,109,111,45,173,122,174,26,175,176,153,177,165,61,51,53,112,121,55,161,152,147,148,14,149,139,150,151,136,137,138,46,57,140,56,141,124,142,78,143,144,145,178,116])),D()]);function t(e){let{origin:t,pathname:n,search:r,hash:i}=window.location;return i.startsWith(`#/`)?`${t}${n}${r}#${S(e)}`:`${t}${S(e)}`}function n(){let n=$(),r=f();return(0,X.jsx)(e,{activeSessionId:n.activeSessionId,onOpenSession:e=>r(S(e)),onOpenHistory:()=>n.navigate(`chatHistory`),onConfigureModels:()=>r(`/config/models`),sessionHref:t,notify:n.notify,requestConfirm:n.requestConfirm,requestText:n.requestText,onNewTask:n.startNewTask})}return{Component:n}}async function yi(){let[{ChatPage:e},{SessionShell:t}]=await Promise.all([i(()=>import(`./ChatPage-DS0euFxR.js`),__vite__mapDeps([179,1,5,2,6,7,3,4,8,9,31,30,40,41,11,12,13,10,37,38,15,180,181,133,19,137,100,87,14,16,182,183,172,82,184,26,49,50,61,58,52,178,139,185,186,28,34,36,171,164,187,88,188,67,20,43,21,22,71,173,134,189,48,174,190,59,99,101,60,102,103,104,140,56,57,177,165,53,54,55,161,78,145,191,192,193,194,195,196,197,198,116,109,199,200,85,169,201,202,203,204,44,205,206,207,208,45,46,73,135,122,136,138,141,124,142,143,144,25,209,75,210,175,211,212,213,51,93,95,152,115,153,98,130,214,215,216,217,218,159,219,168,220,221])),i(()=>import(`./SessionShell-BOZ7h0yz.js`),__vite__mapDeps([222,1,5,2,28,3,4,6,7,8,9,29,30,31,32,10,11,12,13,33,34,35,38,36,37,119,15,49,50,112,113,105,40,41,52,54,92,93,94,95,91,106,120,121,55,114,108])),D()]);function n(){return(0,X.jsx)(t,{context:$(),ChatPage:e})}return{Component:n}}async function bi(){yi().catch(()=>void 0);let[{SessionHome:e}]=await Promise.all([i(()=>import(`./SessionHome-Ck_daJT0.js`),__vite__mapDeps([223,1,5,2,28,3,4,6,7,8,9,36,37,38,11,12,132,30,31,40,41,10,13,15,81,133,87,67,110,90,91,92,32,34,54,93,52,94,95,96,97,98,134,135,136,137,100,16,138,139,46,58,59,57,60,140,102,103,49,50,56,26,61,141,101,124,55,142,78,143,144,145,99,104,53,106,146,147,148,14,149,150,151,152,115,153,107,119,112,113,105,120,121,114,44,161,108])),D()]);function t(){return(0,X.jsx)(e,{context:$()})}return{Component:t}}async function xi(){let{MorePage:e}=await i(async()=>{let{MorePage:e}=await import(`./MorePage-BBfiQbiP.js`);return{MorePage:e}},__vite__mapDeps([224,1,2,3,4,5,6,7,8,9,30,31,11,12,13,10,29,32,33,34,35,38,36,37,15,225,64,19,65,66,16,226,227,69,45,70,71,46,72,74,75,26,175,157,49,50,61,58,51,52,84,53]));function t(){let t=$(),n=f();return(0,X.jsx)(e,{onOpen:e=>{e.type===`page`?n(ie(e.id)):e.type===`config`?t.setConfigSection(e.id):n(`/tools/components/${encodeURIComponent(e.id)}`)}})}return{Component:t}}async function Si(){let{ChatHistoryPage:e}=await i(async()=>{let{ChatHistoryPage:e}=await import(`./ChatHistoryPage-DBsNyGYj.js`);return{ChatHistoryPage:e}},__vite__mapDeps([228,1,6,5,2,7,3,4,8,9,30,31,40,41,11,12,36,37,38,15,181,88,207,111,22,122,174,175,157,99,100,16,58,59,101,60,102,103,104,49,50,61,52,53,93,55,161,152,229,87,14,46,209,26,51,116,216]));function t(){let t=$();return(0,X.jsx)(e,{navigate:t.navigate,onBack:t.onBackToFeatures,onNewTask:t.startNewTask,notify:t.notify,requestConfirm:t.requestConfirm,requestText:t.requestText})}return{Component:t}}async function Ci(){let{AssetsPage:e}=await i(async()=>{let{AssetsPage:e}=await import(`./AssetsPage-CKK-byQY.js`);return{AssetsPage:e}},__vite__mapDeps([230,1,2,4,5,6,7,8,3,9,30,31,231,11,12,15,82,126,185,204,206,45,22,174,209,26,157,99,100,16,58,59,101,60,102,103,104,49,50,61,53,55,161,56,57,78,229,36,37,38,87,14,46,51,232,233,77,234,193,194,195,196,197,187,198]));function t(){let t=$();return(0,X.jsx)(e,{activeSessionId:t.activeSessionId,onBack:t.onBackToFeatures,notify:t.notify,requestConfirm:t.requestConfirm,onUse:t.onUseAsset})}return{Component:t}}async function wi(){let[{ChannelsPage:e}]=await Promise.all([i(()=>import(`./ChannelsPage-L-wcVDSN.js`),__vite__mapDeps([235,1,2,3,4,5,6,7,8,9,11,12,15,19,126,67,236,44,45,22,189,174,209,26,175,157,49,50,61,58,53,55,161,78,142,143,229,36,37,38,87,14,46,51,233,77,59,234,116,215,213,103,202,101,104,216,200,162,163,100,164,138,165,60,102])),oe()]);function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,onBack:t.onBackToFeatures,requestConfirm:t.requestConfirm})}return{Component:t}}async function Ti(){let{SchedulesPage:e}=await i(async()=>{let{SchedulesPage:e}=await import(`./SchedulesPage-Cbgl5v_8.js`);return{SchedulesPage:e}},__vite__mapDeps([237,1,2,3,4,5,6,7,8,9,11,12,18,15,19,66,182,67,236,208,45,174,209,157,213,58,59,103,49,50,61,53,55,161,56,26,57,60,78,143,98,214,100,191,229,36,37,38,87,14,46,51,233,77,234,116,215,202,101,104,216,200,162,163,164,138,165,102]));function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,onBack:t.onBackToFeatures,requestConfirm:t.requestConfirm,openNotificationSettings:t.openNotificationSettings})}return{Component:t}}async function Ei(){let[{ConfigPage:e},{ChatAppearancePage:t}]=await Promise.all([i(()=>import(`./ConfigPage-pOzONr8e.js`),__vite__mapDeps([238,1,5,2,6,7,4,8,3,9,11,12,13,10,38,15,180,129,81,239,18,19,65,100,87,14,42,182,149,187,82,88,126,150,226,17,20,21,22,43,44,227,240,45,127,173,46,72,189,74,47,174,209,210,26,175,58,59,101,190,103,104,99,16,60,102,49,50,140,56,57,61,163,164,138,165,234,141,213,51,84,53,55,161,78,143,144,62,229,36,37,233,77,193,194,195,196,197,198,116,216,215,202,200,162,217,85,241,155,242])),i(()=>import(`./ChatAppearancePage-BhqRLf-2.js`),__vite__mapDeps([243,5,1,2,28,3,4,6,7,8,9])),D(),E()]);function n(){let n=$();return(0,X.jsx)(e,{notify:n.notify,registerPrimaryAction:n.registerPrimaryAction,invokePrimaryAction:n.invokePrimaryAction,section:n.configSection,onBackToFeatures:n.onBackToFeatures,onBrowserNotificationChange:n.setNotificationSettings,requestConfirm:n.requestConfirm,update:n.appUpdate,renderInterfaceSettings:e=>(0,X.jsx)(t,{appearance:e})})}return{Component:n}}async function Di(){let{PluginsPage:e}=await i(async()=>{let{PluginsPage:e}=await import(`./PluginsPage-BzxPAX26.js`);return{PluginsPage:e}},__vite__mapDeps([244,1,2,3,4,5,6,7,8,9,11,12,13,10,15,182,245,126,188,246,67,226,247,69,248,46,72,134,174,209,157,58,59,57,60,49,50,61,53,161,56,26,78,98,229,36,37,38,87,14,51,215,213,103,202,101,104,216,200,162,163,100,164,138,165,102,219]));function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,onBack:t.onBackToFeatures,requestText:t.requestText,requestConfirm:t.requestConfirm})}return{Component:t}}async function Oi(){let{MemoryPage:e}=await i(async()=>{let{MemoryPage:e}=await import(`./MemoryPage-Dsx_6JpI.js`);return{MemoryPage:e}},__vite__mapDeps([249,1,2,3,4,5,6,7,8,9,11,12,15,100,246,20,207,45,22,74,174,26,157,177,58,59,165,60,102,103,49,50,61,53,161,78,143,229,36,37,38,87,14,46,209,51,233,77,234,215,213,202,101,104,216,200,162,163,164,138]));function t(){let t=$();return(0,X.jsx)(e,{onBack:t.onBackToFeatures,notify:t.notify,requestConfirm:t.requestConfirm})}return{Component:t}}async function ki(){let[{McpPage:e}]=await Promise.all([i(()=>import(`./McpPage-D6GyZCpt.js`),__vite__mapDeps([250,1,2,3,4,5,6,7,8,9,31,30,41,231,11,12,100,15,187,83,45,22,71,72,174,210,26,157,213,58,59,103,49,50,61,53,55,161,56,57,60,143,191,229,36,37,38,87,14,46,209,51])),ce()]);function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,onBack:t.onBackToFeatures,requestText:t.requestText,requestConfirm:t.requestConfirm})}return{Component:t}}async function Ai(){let{SkillsPage:e}=await i(async()=>{let{SkillsPage:e}=await import(`./SkillsPage-DTOzYSaS.js`);return{SkillsPage:e}},__vite__mapDeps([251,1,2,3,4,5,6,7,8,9,11,12,246,15,226,247,45,248,74,174,210,157,211,100,58,59,103,49,50,61,53,161,229,36,37,38,87,14,46,209,26,51,215,213,202,101,104,216,200]));function t(){let t=$();return(0,X.jsx)(e,{activeSessionId:t.activeSessionId,notify:t.notify,onBack:t.onBackToFeatures,requestText:t.requestText,requestConfirm:t.requestConfirm})}return{Component:t}}var ji=Object.freeze({componentFromList:!0});function Mi(e){return typeof e==`object`&&!!e&&e.componentFromList===!0}async function Ni(){let[{CustomUiPage:e}]=await Promise.all([i(()=>import(`./public-fqyTjQ0F.js`),__vite__mapDeps([252,1,5,2,28,3,4,6,7,8,9,30,31,32,33,11,12,34,29,10,13,35,36,37,38,15,225,239,64,100,87,14,16,149,187,82,88,205,45,71,46,253,134,74,174,26,211,58,59,103,49,50,99,101,60,102,104,77,163,164,138,165,213,176,153,61,51,53,124,57,112,121,92,40,41,54,93,52,94,95,105,91,106,55,120,113,114,161,146,56,78,143,62,216,254,212,234,177,116,255,256])),E()]);function t(){let t=$(),n=f(),i=o(),{componentId:a=``}=r();return(0,X.jsx)(e,{activeSessionId:t.activeSessionId,notify:t.notify,selectedId:a,onSelect:(e,t)=>{!e&&!t&&Mi(i.state)?n(-1):n(te(e),{replace:t||!e,state:e&&!t?ji:void 0})}})}return{Component:t}}async function Pi(){let[{CustomUiToolPage:e}]=await Promise.all([i(()=>import(`./public-fqyTjQ0F.js`),__vite__mapDeps([252,1,5,2,28,3,4,6,7,8,9,30,31,32,33,11,12,34,29,10,13,35,36,37,38,15,225,239,64,100,87,14,16,149,187,82,88,205,45,71,46,253,134,74,174,26,211,58,59,103,49,50,99,101,60,102,104,77,163,164,138,165,213,176,153,61,51,53,124,57,112,121,92,40,41,54,93,52,94,95,105,91,106,55,120,113,114,161,146,56,78,143,62,216,254,212,234,177,116,255,256])),E()]);function t(){let t=$(),{componentId:n=``}=r();return(0,X.jsx)(e,{componentId:n,activeSessionId:t.activeSessionId,notify:t.notify})}return{Component:t}}async function Fi(){let[{WorkflowsPage:e}]=await Promise.all([i(()=>import(`./WorkflowsPage-AMKQBlPo.js`),__vite__mapDeps([257,1,5,2,28,4,6,7,8,3,9,30,31,11,12,36,37,38,15,171,133,18,19,137,100,87,14,16,182,183,149,187,82,88,246,185,203,258,226,43,236,240,205,206,207,208,45,22,127,248,46,72,253,25,174,209,75,26,157,190,58,59,99,101,60,102,103,104,49,50,77,140,56,57,61,212,141,138,213,202,53,124,55,161,78,143,191,229,51,233,234,116,162,163,164,165,242,256,259,260,261])),le()]);function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,onBack:t.onBackToFeatures,requestConfirm:t.requestConfirm})}return{Component:t}}async function Ii(){let[{WorkflowBuilder:e}]=await Promise.all([i(()=>import(`./WorkflowsPage-AMKQBlPo.js`),__vite__mapDeps([257,1,5,2,28,4,6,7,8,3,9,30,31,11,12,36,37,38,15,171,133,18,19,137,100,87,14,16,182,183,149,187,82,88,246,185,203,258,226,43,236,240,205,206,207,208,45,22,127,248,46,72,253,25,174,209,75,26,157,190,58,59,99,101,60,102,103,104,49,50,77,140,56,57,61,212,141,138,213,202,53,124,55,161,78,143,191,229,51,233,234,116,162,163,164,165,242,256,259,260,261])),le()]);function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,registerWorkflowActions:t.registerWorkflowActions})}return{Component:t}}var Li=t([{element:(0,X.jsx)(mi,{children:(0,X.jsx)(pi,{routerState:()=>Li.state})}),errorElement:(0,X.jsx)(_i,{}),hydrateFallbackElement:(0,X.jsx)(hi,{}),children:[{index:!0,lazy:bi},{path:T.board,lazy:vi},{path:`/board/:sessionId`,lazy:yi},{path:T.more,lazy:xi},{path:T.chat,element:(0,X.jsx)(l,{to:`/`,replace:!0})},{path:T.chatHistory,lazy:Si},{path:T.assets,lazy:Ci},{path:T.channels,lazy:wi},{path:T.schedules,lazy:Ti},{path:T.config,lazy:Ei},{path:`/config/:configSection`,lazy:Ei},{path:`/config`,element:(0,X.jsx)(l,{to:T.config,replace:!0})},{path:T.plugins,lazy:Di},{path:T.memory,lazy:Oi},{path:T.mcp,lazy:ki},{path:T.skills,lazy:Ai},{path:`/components/:componentId?`,lazy:Ni},{path:`/tools/components/:componentId`,lazy:Pi},{path:T.workflows,lazy:Fi},{path:T.workflowCreate,lazy:Ii},{path:`/workflows/:workflowId`,lazy:Ii},{path:`*`,element:(0,X.jsx)(l,{to:`/`,replace:!0})}]}]),Ri=()=>{document.documentElement.dataset.pageVisibility=document.visibilityState};Ri(),document.addEventListener(`visibilitychange`,Ri);var zi=b(window.location.hash);zi&&window.history.replaceState(null,``,`${window.location.pathname}${window.location.search}#${zi}`);var Bi=document.getElementById(`root`);if(!Bi)throw Error(`Missing #root application mount point`);(0,In.createRoot)(Bi).render((0,X.jsx)(J.StrictMode,{children:(0,X.jsx)(zn,{children:(0,X.jsx)(d,{router:Li})})}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e=e=>e){return{board:[e(`navigation:sidebar.allAgents`),e(`navigation:shell.boardDescription`)],session:[e(`navigation:navigation.chat`),``],more:[e(`navigation:sidebar.features`),e(`navigation:shell.moreDescription`)],chat:[e(`navigation:navigation.chat`),e(`navigation:navigation.chatDescription`)],chatHistory:[e(`navigation:navigation.chatHistory`),e(`navigation:navigation.chatHistoryDescription`)],assets:[e(`navigation:navigation.assets`),e(`navigation:navigation.assetsDescription`)],channels:[e(`navigation:navigation.channels`),e(`navigation:navigation.channelsDescription`)],schedules:[e(`navigation:navigation.schedules`),e(`navigation:navigation.schedulesDescription`)],config:[e(`navigation:navigation.settings`),e(`navigation:navigation.settingsDescription`)],plugins:[e(`navigation:navigation.plugins`),e(`navigation:navigation.pluginsDescription`)],memory:[e(`navigation:navigation.memory`),e(`navigation:navigation.memoryDescription`)],mcp:[e(`navigation:navigation.mcp`),e(`navigation:navigation.mcpDescription`)],skills:[e(`navigation:navigation.skills`),e(`navigation:navigation.skillsDescription`)],components:[e(`navigation:shell.components`),e(`navigation:navigation.componentsDescription`)],workflows:[e(`navigation:navigation.workflows`),e(`navigation:navigation.workflowsDescription`)],customComponentTool:[e(`navigation:more.groupComponents`),``],workflowCreate:t(e,!1)}}function t(e,t){return t?[e(`navigation:navigation.editWorkflow`),e(`navigation:navigation.editWorkflowDescription`)]:[e(`navigation:navigation.newWorkflow`),e(`navigation:navigation.newWorkflowDescription`)]}export{t as n,e as t};
|
|
@@ -1 +0,0 @@
|
|
|
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=`pisper:board-new-task`;function i(e){let t=new CustomEvent(r,{detail:{source:e},cancelable:!0});return!window.dispatchEvent(t)}function a(e,t=!0){let i=(0,n.useRef)(e);i.current=e,(0,n.useLayoutEffect)(()=>{if(!t)return;let e=e=>{let t=e.detail;!t||i.current(t)===!1||e.preventDefault()};return window.addEventListener(r,e),()=>window.removeEventListener(r,e)},[t])}var o=`board-filter`;export{i as n,a as r,o as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/hosts-1yQREdMi.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-router-CSN_DGvx.js","assets/vendor-react-DwNgTV1j.js","assets/index-CsE52ydO.js","assets/index-CfTBR7Rs.css","assets/routes-Da0OHSy6.js","assets/use-i18n-B5p-Kzvz.js","assets/i18n-CHmr7GzM.js","assets/storage-BY6wEHPw.js","assets/vendor-state-GkUciC5H.js","assets/useQuery-DdcpUQhO.js","assets/query-Bj-DUNYq.js","assets/session-scope-DQPNgQMm.js","assets/api-BO7LAPSQ.js","assets/abort-signal-f4JsiYKX.js","assets/session-board-status-D2lpFPiI.js","assets/createLucideIcon-Cd-3GVxJ.js","assets/ellipsis-CfGKfbq6.js","assets/grip-vertical-B__LYT0s.js","assets/plus-fQbSqB1n.js","assets/rotate-ccw-C0v8V77_.js","assets/settings-2-CXJjXJS9.js","assets/x-07u4-129.js","assets/dropdown-menu-CFIFNaKO.js","assets/check-2vYc6QaP.js","assets/chevron-right-C3t2Rckj.js","assets/dist-41X0pdUs.js","assets/dist-BsRXXcSL.js","assets/dist-DzGQ7sLi.js","assets/es2015-DTZdOI9P.js","assets/dist-BRjj4UeB.js","assets/dist-OB2r6Xsr.js","assets/dist-BaBySQmo.js","assets/utils-C8uzG5AZ.js","assets/vendor-ui-DvrYggeS.js","assets/popover--UmYQ9yB.js","assets/dialog-CUhFgsVd.js","assets/dist-BHkR6BLP.js","assets/button-CCcCN8tE.js","assets/use-studio-actions-D6c_pSJK.js","assets/checkbox-BrEHgFV0.js","assets/progress-5odAz3B9.js","assets/separator-BPh_qxvc.js","assets/switch-D_G8wFhs.js","assets/segmented-control-BlM_GKV6.js","assets/touch-target-BsyCgjR5.js","assets/tooltip-D4MFbqcG.js","assets/dist-BiRPwy4W.js","assets/kbd-CAufZTkl.js","assets/useSessionListQuery-D44XZfGr.js","assets/startup-queries-6Oztqpto.js","assets/mutation-CEbxdVYy.js","assets/component-changes-Q9Bf64Ob.js","assets/runtime-capabilities-store-C2Qv7uDP.js","assets/runtime-capabilities-4_ZwLBqF.js","assets/chat-api-DkdyVQY9.js","assets/session-organization-api-DFu3Chto.js","assets/events-DrAPv0se.js","assets/session-workspaces-BWTBYaGT.js","assets/session-questions-Cf-1g85h.js","assets/useFleetSystemInfo-Bd8zJIFa.js","assets/useNow-Bxn4_OW9.js","assets/useBoardItems-CzEbgTLJ.js","assets/card-presentation-1oph2b8P.js","assets/format-DMJQzoZ7.js","assets/public-jQjEc6OO.js","assets/useSidebarModel-CWED0rsw.js","assets/new-task-C3wuHTor.js","assets/board-launch-BmmPYZe8.js","assets/input-CPw-zkYh.js","assets/textarea-DmATpOqT.js","assets/StatusGlyph-1KgitlUg.js","assets/badge-CWB3lj2H.js","assets/safe-mode-instance-BiAPYJ2-.js","assets/safe-mode-sentinel-Ccu3Vmta.js","assets/SafeModePrompt-CLyt-z14.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{h as t}from"./vendor-router-CSN_DGvx.js";import{i as n}from"./vendor-react-DwNgTV1j.js";import{a as r}from"./i18n-CHmr7GzM.js";import{t as i}from"./use-i18n-B5p-Kzvz.js";import{r as a,t as o}from"./useQuery-DdcpUQhO.js";import{n as s}from"./component-changes-Q9Bf64Ob.js";import{t as c}from"./runtime-capabilities-store-C2Qv7uDP.js";import{_ as l,j as u,k as d,n as f,r as p,t as m}from"./session-scope-DQPNgQMm.js";import"./safe-mode-sentinel-Ccu3Vmta.js";var h=e(n(),1);function g(e){return e.id===`*`?[u.all]:e.reason===`instances`?[u.instances()]:[u.catalog(),u.describe(e.id),u.errors(e.id),u.versions(e.id),u.trash(),u.instances()]}function _(e){let t=0,n=null,r=null;return{retain(i){r=i,t+=1,n??=e(e=>{for(let t of g(e))Promise.resolve(r?.invalidateQueries({queryKey:t})).catch(()=>void 0)});let a=!1;return()=>{a||(a=!0,--t,!(t>0)&&(n?.(),n=null,r=null))}},users:()=>t}}var v=_(s);function y(e){let t=a();(0,h.useEffect)(()=>e?v.retain(t):void 0,[t,e])}function b(){return c(e=>e.capabilities.features[`components.native`])}function x(){let e=b();return y(e),o(f(e))}function S(e){return y(e),o(p(e))}function C(){return S(b())}function w(e){let t=b(),n=S(t),r=(0,h.useMemo)(()=>(n.data?.instances??[]).filter(t=>t.surface===e&&t.enabled),[n.data,e]),i=o(f(t&&r.length>0));return{available:t,placed:(0,h.useMemo)(()=>{if(!i.data)return[];let e=new Map(i.data.components.map(e=>[e.id,e])),t=[];for(let n of r){let r=e.get(n.componentId);r?.kind===`native`&&r.status===`ready`&&r.enabled&&t.push({instance:n,component:r})}return t},[r,i.data]),revision:n.data?.revision??null,isLoading:t&&(n.isPending||r.length>0&&i.isPending),error:n.error??i.error??null,refetch:()=>{n.refetch(),r.length&&i.refetch()}}}function T(e,t,n){return e.filter(({instance:e})=>m(e.scope,t)).map(({instance:e,component:t})=>({id:e.instanceId,label:e.title||t.manifest?.i18n[n]?.name||t.name}))}function E(){let e=S(b());return(0,h.useMemo)(()=>(e.data?.instances??[]).filter(e=>e.enabled).length,[e.data])}function D(){let{language:e}=i(),t=w(`feature-page`),n=(0,h.useMemo)(()=>t.placed.map(({instance:t,component:n})=>({instanceId:t.instanceId,componentId:n.id,name:n.manifest?.i18n[e]?.name||n.name,description:n.manifest?.i18n[e]?.description||n.description,icon:n.manifest?.icon||``})),[e,t.placed]);return{...t,items:n}}var O=()=>Promise.all([t(()=>import(`./hosts-1yQREdMi.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75])),r()]).then(([e])=>e),k=(0,h.lazy)(()=>O().then(e=>({default:e.ComponentHost}))),A=(0,h.lazy)(()=>O().then(e=>({default:e.FloatingComponents}))),j=(0,h.lazy)(()=>Promise.all([t(()=>import(`./SafeModePrompt-CLyt-z14.js`),__vite__mapDeps([76,1,3,7,8,2,4,5,9,10,39,35,27,34,37,23,17,38,28,30,74,75])),r()]).then(([e])=>({default:e.SafeModePrompt})));function M(){let e=a();return async()=>{let t=(await l()).components.filter(e=>e.kind===`native`&&e.enabled),n=await Promise.allSettled(t.map(e=>d(e.id,!1)));return e.invalidateQueries({queryKey:u.all}),n.every(e=>e.status===`fulfilled`)}}var N=(0,h.lazy)(()=>O().then(e=>({default:e.OverviewComponents}))),P=(0,h.lazy)(()=>O().then(e=>({default:e.SessionPanelComponent}))),F=(0,h.lazy)(()=>O().then(e=>({default:e.SessionComponentAddMenu})));export{F as a,x as c,b as d,M as f,j as i,C as l,D as m,A as n,P as o,E as p,N as r,T as s,k as t,w as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./GitDiffViewer-rjt5_KOt.js";export{e as InlineGitDiff};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/public-diff-DK-VNIar.js","assets/GitDiffViewer-rjt5_KOt.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-react-DwNgTV1j.js","assets/use-i18n-B5p-Kzvz.js","assets/i18n-CHmr7GzM.js","assets/vendor-router-CSN_DGvx.js","assets/index-CsE52ydO.js","assets/index-CfTBR7Rs.css","assets/storage-BY6wEHPw.js","assets/vendor-state-GkUciC5H.js","assets/createLucideIcon-Cd-3GVxJ.js","assets/x-07u4-129.js","assets/utils-C8uzG5AZ.js","assets/vendor-ui-DvrYggeS.js","assets/button-CCcCN8tE.js","assets/dist-41X0pdUs.js","assets/events-DrAPv0se.js","assets/esm-DCV8yILT.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{h as t,l as n,n as r,u as i}from"./vendor-router-CSN_DGvx.js";import{i as a,r as o}from"./vendor-react-DwNgTV1j.js";import{f as s,o as c,r as l}from"./routes-Da0OHSy6.js";import{t as u}from"./use-i18n-B5p-Kzvz.js";import{r as d,t as f}from"./useQuery-DdcpUQhO.js";import{n as p}from"./component-changes-Q9Bf64Ob.js";import{T as m,g as h,i as g,j as _,n as v,o as y,v as b}from"./session-scope-DQPNgQMm.js";import{c as x,d as S,l as C,t as w,u as T}from"./placements-CqwqXPTp.js";import{t as ee}from"./usePhoneShell-Bvb7m-m4.js";import{t as E}from"./createLucideIcon-Cd-3GVxJ.js";import{t as te}from"./app-window-CPNdvYNt.js";import{t as D}from"./arrow-up-right-B6l8qFZz.js";import{t as O}from"./blocks-Olsdp5Lp.js";import{t as ne}from"./check-2vYc6QaP.js";import{t as re}from"./chevron-down-CxtxIjiP.js";import{t as ie}from"./chevron-left-BAtyp3_6.js";import{t as ae}from"./chevron-right-C3t2Rckj.js";import{t as k}from"./code-xml-BrUXrBax.js";import{t as oe}from"./copy-DHmIFc52.js";import{t as se}from"./download-BCfIiuaL.js";import{t as ce}from"./ellipsis-CfGKfbq6.js";import{t as le}from"./panel-right-BSUtqUd8.js";import{t as ue}from"./plus-fQbSqB1n.js";import{t as de}from"./rotate-ccw-clock-CO6Bw-sF.js";import{t as fe}from"./search-D0mqDaf_.js";import{t as A}from"./settings-2-CXJjXJS9.js";import{t as pe}from"./shield-alert-oZqX6MNu.js";import{t as me}from"./sparkles-S_eeuqn9.js";import{t as j}from"./trash-2-CNrPOoPR.js";import{t as he}from"./x-07u4-129.js";import{t as ge}from"./checkbox-BrEHgFV0.js";import{a as _e,c as ve,i as M,p as ye,r as N,t as be}from"./dropdown-menu-CFIFNaKO.js";import{t as xe}from"./label-CVWjEcfV.js";import{a as Se,i as Ce,n as we,r as Te,t as Ee}from"./select-DD_WO-gs.js";import{t as De}from"./switch-D_G8wFhs.js";import{t as P}from"./segmented-control-BlM_GKV6.js";import{t as F}from"./utils-C8uzG5AZ.js";import{r as Oe,t as I}from"./button-CCcCN8tE.js";import{t as ke}from"./kbd-CAufZTkl.js";import{t as Ae}from"./shortcuts-Cvp9WD9O.js";import{a as je,i as Me,n as Ne,o as Pe,r as Fe,t as Ie}from"./sheet-BTaIEX4w.js";import{t as Le}from"./sidebar-store-1-aNPlDu.js";import{n as Re}from"./useFleetSystemInfo-Bd8zJIFa.js";import{a as ze,n as Be}from"./format-DMJQzoZ7.js";import"./public-jQjEc6OO.js";import{n as L,t as R}from"./PageState-Cz6vFMXv.js";import{i as Ve}from"./board-launch-BmmPYZe8.js";import{a as z,i as B,l as V,n as He,o as H,s as U,t as W}from"./dialog-CUhFgsVd.js";import{t as G}from"./input-CPw-zkYh.js";import{t as Ue}from"./textarea-DmATpOqT.js";import{t as K}from"./useOverlayFocusReturn-NkxBSSjb.js";import{t as We}from"./badge-CWB3lj2H.js";import{A as Ge,B as Ke,C as qe,F as Je,G as Ye,H as Xe,I as q,J as Ze,K as Qe,L as $e,M as et,N as tt,O as nt,R as rt,S as it,U as at,V as ot,W as st,X as ct,Y as lt,_ as ut,a as dt,b as ft,c as pt,d as mt,f as J,g as ht,h as gt,i as _t,j as vt,k as yt,l as bt,m as xt,n as St,o as Ct,p as wt,q as Tt,r as Y,s as Et,t as Dt,v as Ot,w as kt,x as At,y as jt,z as Mt}from"./use-studio-actions-D6c_pSJK.js";import{t as X}from"./PageFrame-DNwGZ-Dz.js";var Nt=E(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),Pt=E(`git-compare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),Ft=E(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),Z=e(a(),1);function It(){let e=null,t=new Set;return{set(n){let r=Math.round(n*10)/10;if(r!==e){e=r;for(let e of[...t])e()}},get:()=>e,subscribe(e){return t.add(e),()=>{t.delete(e)}}}}var Q=o();function Lt({manifest:e,target:t,window:n,phone:r=!1,onTarget:i,onWindow:a}){let{t:o}=u(),s=Ot(e);return(0,Q.jsxs)(`div`,{"data-studio-preview-bar":!0,className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2 text-xs text-content-muted`,children:[(0,Q.jsx)(`span`,{className:F(r&&`sr-only`),children:o(`custom-ui:studio.previewPlacement`)}),(0,Q.jsx)(P,{size:`sm`,"aria-label":o(`custom-ui:studio.previewPlacement`),value:t,onValueChange:i,className:F(`max-w-full overflow-x-auto`,r&&`w-full`),options:s.map(e=>({value:e,label:_t(e,o)}))}),!r&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`ml-auto`,children:o(`custom-ui:studio.previewWindow`)}),(0,Q.jsx)(P,{size:`sm`,"aria-label":o(`custom-ui:studio.previewWindow`),value:n,onValueChange:a,options:[{value:`standard`,label:o(`custom-ui:studio.windowStandard`)},{value:`min`,label:o(`custom-ui:studio.windowMin`)}]}),(0,Q.jsx)(`span`,{className:`rounded-sm border border-stroke px-2 py-1 text-content-secondary`,title:o(`custom-ui:studio.themeFollowHint`),children:o(`custom-ui:studio.themeFollow`)})]})]})}function Rt({activeSessionId:e=``,row:t,target:n,window:r,instanceId:i,title:a,props:o,phone:s=!1,notify:c,commits:l}){let{t:d}=u(),f=bt(t,c),p=ut(n,t.manifest,s?`standard`:r),m=qe(n),h=p.width===`fill`||s?`100%`:p.width,g=p.width===`fill`||s&&m===`overview-card`?`100%`:p.width,_=p.height===`fill`;return(0,Q.jsxs)(`div`,{"data-component-preview":!0,"data-component-preview-target":n,className:F(`flex min-h-0 min-w-0 flex-1 flex-col gap-2 overflow-auto rounded-[var(--r-lg)] border border-stroke bg-surface-subtle bg-[radial-gradient(var(--stroke-strong)_1px,transparent_1px)] [background-size:16px_16px]`,s?`min-h-[min(420px,55dvh)] p-3`:`p-5`),children:[(0,Q.jsxs)(`p`,{className:`flex flex-none items-baseline gap-2 text-xs text-content-muted`,children:[(0,Q.jsx)(`span`,{className:`text-content-secondary`,children:Y(m,d)}),p.label&&(0,Q.jsx)(`span`,{"data-component-preview-size":!0,className:`font-mono tabular-nums`,children:s&&m===`overview-card`?p.label.split(` · `)[0]:p.label})]}),(0,Q.jsx)(`div`,{"data-component-preview-frame":!0,className:F(`flex min-w-0 flex-col overflow-hidden rounded-[var(--r-lg)] bg-panel shadow-edge ring-1 ring-stroke`,_?`min-h-[320px] flex-1`:`flex-none`),style:{width:h,maxWidth:g,minWidth:s||p.width===`fill`?void 0:p.width,height:_?void 0:p.height},children:(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(yt,{component:t,instance:{instanceId:i??`preview:${t.id}`,surface:m,title:a,props:o,size:it(n)},preview:!0,session:e?{id:e,title:``,cwd:``,status:`idle`}:void 0,notify:e=>c(e),onRequestFix:f,onCommitSample:e=>l.set(e),className:`h-full animate-[fade-in_120ms_var(--ease-enter)] [:root[data-motion=reduced]_&]:animate-none motion-reduce:[:root:not([data-motion=full])_&]:animate-none`},`${t.id}@${t.rev}:${n}:${i??``}`)})})]})}function zt({componentId:e,errors:t,commits:n}){let{t:r}=u(),i=(0,Z.useSyncExternalStore)(n.subscribe,n.get,n.get),a=tt(),o=(0,Z.useSyncExternalStore)(a.subscribe,()=>a.reloadRecommended(e),()=>!1),s=(0,Z.useMemo)(()=>t?.entries.filter(e=>e.level===`error`).length??0,[t]),c=Object.keys(t?.network.hosts??{});return(0,Q.jsxs)(`p`,{"data-studio-status":!0,className:`flex min-w-0 flex-none flex-wrap items-center gap-x-3 gap-y-1 text-xs text-content-muted`,children:[(0,Q.jsx)(`span`,{"data-studio-status-errors":!0,className:F(s>0&&`text-content`),children:r(`custom-ui:studio.statusErrors`,{count:s})}),(0,Q.jsx)(`span`,{className:`font-mono tabular-nums`,children:i===null?r(`custom-ui:studio.statusRenderNone`):r(`custom-ui:studio.statusRender`,{ms:i})}),(0,Q.jsxs)(`span`,{className:`min-w-0 truncate`,children:[r(`custom-ui:studio.statusNetwork`,{count:t?.network.count??0}),c.length>0&&(0,Q.jsxs)(`span`,{className:`font-mono`,children:[` · `,c.slice(0,3).join(`, `)]})]}),o&&(0,Q.jsx)(`span`,{className:`text-content`,children:r(`custom-ui:studio.reloadRecommended`)}),(0,Q.jsx)(`span`,{className:`ml-auto`,children:r(`custom-ui:studio.statusHotReload`)})]})}function Bt({onCreate:e,phone:t=!1,className:n}){let{t:r}=u(),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(!1),p=(0,Z.useRef)(null),m=K(i,p),h=(0,Z.useId)(),g=(0,Z.useId)(),_=async(t,n,r)=>{f(!0);try{await e(t,n,r)&&(a(!1),s(``),l(``))}finally{f(!1)}},v=o.trim(),y=c.trim(),b=()=>{v&&_(`blank`,v,y||void 0)},x=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xe,{htmlFor:h,className:`-mb-1.5 text-xs text-content-secondary`,children:r(`custom-ui:studio.componentName`)}),(0,Q.jsx)(G,{id:h,autoFocus:!0,value:o,maxLength:120,placeholder:r(`custom-ui:studio.componentNamePlaceholder`),"data-component-new-name":!0,className:t?`min-h-11`:void 0,onChange:e=>s(e.target.value)}),(0,Q.jsx)(xe,{htmlFor:g,className:`-mb-1.5 text-xs text-content-secondary`,children:r(`custom-ui:agent.newPromptLabel`)}),(0,Q.jsx)(Ue,{id:g,rows:3,value:c,maxLength:Ct,placeholder:r(`custom-ui:agent.newPromptPlaceholder`),"data-component-new-prompt":!0,className:`max-h-48 resize-none`,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key!==`Enter`||!(e.metaKey||e.ctrlKey)||e.nativeEvent.isComposing||(e.preventDefault(),b())}})]}),S=r(y?`custom-ui:agent.createAndGenerate`:`custom-ui:studio.create`);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(be,{children:[(0,Q.jsx)(ye,{asChild:!0,children:(0,Q.jsxs)(I,{ref:p,size:`sm`,variant:`secondary`,disabled:d,"data-component-new":!0,className:F(n),children:[(0,Q.jsx)(ue,{}),r(`custom-ui:studio.new`),(0,Q.jsx)(re,{className:`text-content-muted`})]})}),(0,Q.jsxs)(N,{align:`end`,className:`w-56`,children:[(0,Q.jsx)(M,{"data-component-new-blank":!0,onSelect:()=>a(!0),children:r(`custom-ui:studio.newBlank`)}),(0,Q.jsx)(ve,{}),(0,Q.jsx)(_e,{className:`text-xs font-normal text-content-muted`,children:r(`custom-ui:studio.fromTemplate`)}),(0,Q.jsx)(M,{"data-component-new-template":`usage-today`,onSelect:()=>void _(`usage-today`),children:r(`custom-ui:studio.templateUsageToday`)}),(0,Q.jsx)(M,{"data-component-new-template":`notes`,onSelect:()=>void _(`notes`),children:r(`custom-ui:studio.templateNotes`)})]})]}),t?(0,Q.jsx)(Ie,{open:i,onOpenChange:e=>!d&&a(e),children:(0,Q.jsx)(Ne,{side:`bottom`,onCloseAutoFocus:m,"data-component-new-sheet":!0,className:`gap-0 rounded-t-[var(--r-lg)] p-0`,children:(0,Q.jsxs)(`form`,{className:`flex flex-col gap-3 px-4 pt-4 pb-[max(16px,env(safe-area-inset-bottom))]`,onSubmit:e=>{e.preventDefault(),b()},children:[(0,Q.jsxs)(je,{className:`p-0`,children:[(0,Q.jsx)(Pe,{children:r(`custom-ui:studio.newBlankTitle`)}),(0,Q.jsx)(Fe,{children:r(`custom-ui:studio.newBlankHint`)})]}),x,(0,Q.jsxs)(Me,{className:`flex-row p-0`,children:[(0,Q.jsx)(I,{type:`button`,variant:`outline`,className:`min-h-11 flex-1`,disabled:d,onClick:()=>a(!1),children:r(`custom-ui:studio.cancel`)}),(0,Q.jsx)(I,{type:`submit`,className:`min-h-11 flex-1`,disabled:d||!v,children:S})]})]})})}):(0,Q.jsx)(W,{open:i,onOpenChange:e=>!d&&a(e),children:(0,Q.jsx)(B,{onCloseAutoFocus:m,children:(0,Q.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),b()},children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:r(`custom-ui:studio.newBlankTitle`)}),(0,Q.jsx)(z,{children:r(`custom-ui:studio.newBlankHint`)})]}),x,(0,Q.jsxs)(H,{children:[(0,Q.jsx)(I,{type:`button`,variant:`outline`,disabled:d,onClick:()=>a(!1),children:r(`custom-ui:studio.cancel`)}),(0,Q.jsx)(I,{type:`submit`,disabled:d||!v,children:S})]})]})})})]})}function Vt(e,t){return e.length?e.map(e=>{let n=Y(e.surface,t);if(e.surface!==`overview-card`)return n;let r=e.sizes.join(`/`),i=r?`${n} ${r}`:n;return e.count>1?`${i} ×${e.count}`:i}).join(` · `):t(`custom-ui:studio.notPlaced`)}function Ht(e,t,n){if(e.kind===`broken`||e.status!==`ready`){let t=e.errors[0];return t?q(t.code,n,t.params):n(`custom-ui:studio.statusInvalid`)}return Vt(ht(e.id,t),n)}function Ut(e,t){return e.kind===`broken`?t(`custom-ui:studio.statusBroken`):e.status===`ready`?e.enabled?null:t(`custom-ui:studio.statusDisabled`):t(`custom-ui:studio.statusInvalid`)}function Wt({row:e,instances:t,active:n,phone:r=!1,onSelect:i}){let{t:a,language:o}=u(),s=Ut(e,a);return(0,Q.jsxs)(`button`,{type:`button`,"data-component-row":e.id,"data-component-kind":e.kind,"aria-current":n||void 0,onClick:i,className:F(`flex w-full min-w-0 items-center gap-3 text-left transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus`,r?`min-h-14 px-3.5 py-2 hover:bg-surface-hover active:bg-surface-hover`:F(`rounded-[var(--r-md)] px-2.5 py-2`,n?`bg-surface-active`:`hover:bg-surface-hover`)),children:[(0,Q.jsx)(`span`,{className:F(`grid flex-none place-items-center rounded-[var(--r-md)] border border-stroke bg-solid text-content-secondary`,r?`size-9`:`size-8`),children:(0,Q.jsx)(O,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0})}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Q.jsx)(`strong`,{className:`min-w-0 truncate text-sm font-medium text-content`,children:J(e,o)}),e.version&&(0,Q.jsxs)(`span`,{className:`flex-none font-mono text-xs text-content-muted tabular-nums`,children:[`v`,e.version]}),s&&(0,Q.jsx)(We,{className:`ml-auto flex-none text-content-secondary`,children:s})]}),(0,Q.jsx)(`small`,{className:`truncate text-xs text-content-muted`,"data-component-row-detail":!0,children:Ht(e,t,a)})]}),r&&(0,Q.jsx)(ae,{className:`size-4 flex-none text-content-muted`,"aria-hidden":`true`})]})}function Gt({componentId:e,onOpenLogs:t,onReload:n,onRequestFix:r}){let{t:i}=u(),a=et(),o=(0,Z.useSyncExternalStore)(e=>a.subscribe(e),()=>{let t=a.read(e);for(let e=t.length-1;e>=0;--e)if(t[e].level===`error`)return t[e];return null}),s=o?.message??``;return(0,Q.jsxs)(`div`,{role:`status`,"data-component-crash":e,className:`mx-1 mt-1 mb-1.5 flex flex-col gap-1.5 rounded-[var(--r-md)] border border-stroke bg-surface-subtle px-2.5 py-2`,children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs font-medium text-st-fail`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-st-fail`}),i(`custom-ui:host.renderErrorTitle`)]}),s&&(0,Q.jsx)(`p`,{className:`truncate font-mono text-xs text-content-secondary`,title:s,children:s}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,Q.jsx)(I,{size:`xs`,variant:`ghost`,onClick:t,children:i(`custom-ui:host.viewError`)}),(0,Q.jsx)(I,{size:`xs`,variant:`secondary`,onClick:n,children:i(`custom-ui:host.reload`)}),r&&s&&(0,Q.jsx)(I,{size:`xs`,variant:`ghost`,"data-component-crash-fix":e,onClick:()=>r(Je(s,o?.stack)),children:i(`custom-ui:host.askAgentFix`)})]})]})}function Kt({rows:e,allCount:t,counts:n,instances:r,selectedId:i,troubled:a,filter:o,query:s,root:c,onFilter:l,onQuery:d,onSelect:f,onCreate:p,onOpenLogs:m,onReload:h,onRequestFix:g,importButton:_,staged:v,footer:y}){let{t:b}=u();return(0,Q.jsxs)(`section`,{"data-studio-library":!0,"aria-label":b(`custom-ui:studio.library`),className:`flex min-h-0 min-w-0 flex-col border-r border-stroke`,children:[(0,Q.jsxs)(`header`,{className:`flex flex-col gap-2.5 px-3 pt-3.5 pb-2.5`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Q.jsxs)(`h2`,{className:`mr-auto flex min-w-0 items-baseline gap-1.5 truncate text-base font-semibold`,children:[b(`custom-ui:studio.libraryTitle`),(0,Q.jsx)(`span`,{className:`text-sm font-normal text-content-muted tabular-nums`,children:t})]}),_,(0,Q.jsx)(Bt,{onCreate:p})]}),(0,Q.jsxs)(`label`,{className:`relative block`,children:[(0,Q.jsx)(fe,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-content-muted`}),(0,Q.jsx)(G,{type:`search`,value:s,placeholder:b(`custom-ui:studio.search`),"aria-label":b(`custom-ui:studio.search`),className:`pl-8`,onChange:e=>d(e.target.value)})]}),(0,Q.jsx)(P,{size:`sm`,"aria-label":b(`custom-ui:studio.filter`),value:o,onValueChange:l,className:`w-full [&>*]:flex-1`,options:[{value:`all`,label:b(`custom-ui:studio.filterAll`)},{value:`enabled`,label:b(`custom-ui:studio.filterEnabled`),count:n.enabled},{value:`attention`,label:b(`custom-ui:studio.filterAttention`),count:n.attention}]})]}),(0,Q.jsxs)(`ul`,{className:`flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 pb-2`,children:[v&&(0,Q.jsx)(`li`,{className:`flex flex-col gap-1.5 pb-1`,children:v}),e.map(e=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(Wt,{row:e,instances:r,active:e.id===i,onSelect:()=>f(e.id)}),a.has(e.id)&&(0,Q.jsx)(Gt,{componentId:e.id,onOpenLogs:()=>m(e.id),onReload:()=>h(e.id),onRequestFix:g&&(t=>g(e,t))})]},e.id)),!e.length&&!v&&(0,Q.jsx)(`li`,{className:`px-2.5 py-6 text-center text-sm text-content-muted`,children:b(`custom-ui:studio.noMatches`)})]}),y,(0,Q.jsxs)(`p`,{"data-studio-hot-reload":!0,className:`flex flex-none flex-col gap-0.5 border-t border-stroke px-3.5 py-2.5 text-xs text-content-muted`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-content-secondary`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-content-muted`}),b(`custom-ui:studio.hotReloadOn`)]}),(0,Q.jsx)(`span`,{className:`break-all`,children:b(`custom-ui:studio.directory`,{path:c})})]})]})}function qt(e,t,n){let r=e.i18n?.[n];return{label:r?.title||e.title||t,description:r?.description||e.description||``}}function Jt(e,t){if(!e||typeof e.properties!=`object`||!e.properties)return[];let n=new Set(Array.isArray(e.required)?e.required:[]),r=[];for(let[i,a]of Object.entries(e.properties)){if(!a||typeof a!=`object`)continue;let e={key:i,...qt(a,i,t),required:n.has(i)};switch(a.type){case`string`:Array.isArray(a.enum)&&a.enum.length?r.push({...e,kind:a.enum.length<=4?`segmented`:`select`,options:[...a.enum],...a.default===void 0?{}:{defaultValue:a.default}}):r.push({...e,kind:a.format===`textarea`||a.format===`url`||a.format===`color`?a.format:`text`,maxLength:a.maxLength,...a.default===void 0?{}:{defaultValue:a.default}});break;case`number`:case`integer`:r.push({...e,kind:`number`,integer:a.type===`integer`,...a.minimum===void 0?{}:{min:a.minimum},...a.maximum===void 0?{}:{max:a.maximum},...a.step===void 0?{}:{step:a.step},unit:a.unit||``,...a.default===void 0?{}:{defaultValue:a.default}});break;case`boolean`:r.push({...e,kind:`switch`,...a.default===void 0?{}:{defaultValue:a.default}});break;case`array`:r.push({...e,kind:`tags`,maxItems:a.maxItems,itemMaxLength:a.itemMaxLength,...a.default===void 0?{}:{defaultValue:[...a.default]}})}}return r}function Yt(e,t){let n={};for(let r of e){let e=t&&Object.hasOwn(t,r.key)?t[r.key]:r.defaultValue;switch(r.kind){case`switch`:n[r.key]=e===!0;break;case`tags`:n[r.key]=Array.isArray(e)?e.filter(e=>typeof e==`string`):[];break;case`number`:n[r.key]=typeof e==`number`&&Number.isFinite(e)?String(e):``;break;default:n[r.key]=typeof e==`string`?e:``}}return n}function Xt(e,t){let n={};for(let r of e){let e=t[r.key];switch(r.kind){case`switch`:n[r.key]=e===!0;break;case`tags`:Array.isArray(e)&&e.length&&(n[r.key]=[...e]);break;case`number`:{let t=typeof e==`string`?e.trim():``;if(!t)break;let i=Number(t);n[r.key]=Number.isFinite(i)?i:t;break}case`segmented`:case`select`:typeof e==`string`&&e&&(n[r.key]=e);break;default:typeof e==`string`&&e&&(n[r.key]=e)}}return n}function Zt(e,t){let n=[...e];for(let e of t.split(/[,,\n]/)){let t=e.trim();t&&!n.includes(t)&&n.push(t)}return n}function Qt(e){let t={};for(let n of e){let e=/^props(?:\.([^.]+))?/.exec(n.path||``),r=e?e[1]??``:``;Object.hasOwn(t,r)||(t[r]=n.params?{code:n.code,params:n.params}:{code:n.code})}return t}function $t(e,t){let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let r of n){let n=e[r],i=t[r];if(Array.isArray(n)||Array.isArray(i)){if(!Array.isArray(n)||!Array.isArray(i)||n.length!==i.length||n.some((e,t)=>e!==i[t]))return!1}else if(n!==i)return!1}return!0}function en({id:e,label:t,description:n,error:r,required:i,children:a,inline:o=!1}){return(0,Q.jsxs)(`div`,{className:F(`flex min-w-0 gap-1.5`,o?`items-center justify-between`:`flex-col`),"data-props-field":e,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,Q.jsxs)(`label`,{htmlFor:e,className:`text-sm text-content`,children:[t,i&&(0,Q.jsx)(`span`,{className:`ml-0.5 text-content-muted`,children:`*`})]}),n&&(0,Q.jsx)(`span`,{id:`${e}-hint`,className:`text-xs text-content-muted`,children:n})]}),a,r&&(0,Q.jsx)(`p`,{id:`${e}-error`,role:`alert`,"data-props-error":!0,className:`text-xs text-danger`,children:r})]})}function tn({id:e,value:t,invalid:n,disabled:r,describedBy:i,onChange:a}){let{t:o}=u(),[s,c]=(0,Z.useState)(``),l=()=>{s.trim()&&(a(Zt(t,s)),c(``))};return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[t.length>0&&(0,Q.jsx)(`ul`,{className:`flex flex-wrap gap-1`,children:t.map(e=>(0,Q.jsxs)(`li`,{className:`inline-flex max-w-full items-center gap-1 rounded-sm border border-stroke-strong bg-solid py-0.5 pr-0.5 pl-2 text-xs`,children:[(0,Q.jsx)(`span`,{className:`truncate`,children:e}),(0,Q.jsx)(`button`,{type:`button`,disabled:r,"aria-label":o(`custom-ui:studio.removeTag`,{tag:e}),className:`grid size-5 place-items-center rounded-xs text-content-muted hover:bg-surface-hover hover:text-content`,onClick:()=>a(t.filter(t=>t!==e)),children:(0,Q.jsx)(he,{className:`size-3`})})]},e))}),(0,Q.jsx)(G,{id:e,value:s,disabled:r,"aria-invalid":n||void 0,"aria-describedby":i,placeholder:o(`custom-ui:studio.tagsPlaceholder`),onChange:e=>c(e.target.value),onBlur:l,onKeyDown:e=>{e.key===`Enter`||e.key===`,`?(e.preventDefault(),l()):e.key===`Backspace`&&!s&&t.length&&a(t.slice(0,-1))}})]})}function nn({field:e,id:t,value:n,error:r,disabled:i,onChange:a}){let{t:o}=u(),s=[e.description?`${t}-hint`:``,r?`${t}-error`:``].filter(Boolean).join(` `)||void 0,c={id:t,disabled:i,"aria-invalid":r?!0:void 0,"aria-describedby":s};switch(e.kind){case`switch`:return(0,Q.jsx)(De,{...c,checked:n===!0,onCheckedChange:e=>a(e)});case`segmented`:return(0,Q.jsx)(P,{size:`sm`,"aria-label":e.label,disabled:i,value:typeof n==`string`&&n?n:e.defaultValue??``,onValueChange:e=>a(e),options:e.options.map(e=>({value:e,label:e}))});case`select`:return(0,Q.jsxs)(Ee,{value:typeof n==`string`&&n?n:void 0,disabled:i,onValueChange:e=>a(e),children:[(0,Q.jsx)(Ce,{...c,className:`w-full`,children:(0,Q.jsx)(Se,{placeholder:o(`custom-ui:studio.selectPlaceholder`)})}),(0,Q.jsx)(we,{children:e.options.map(e=>(0,Q.jsx)(Te,{value:e,children:e},e))})]});case`tags`:return(0,Q.jsx)(tn,{id:t,value:Array.isArray(n)?n:[],invalid:!!r,disabled:i,describedBy:s,onChange:a});case`textarea`:return(0,Q.jsx)(Ue,{...c,rows:3,maxLength:e.maxLength,value:typeof n==`string`?n:``,onChange:e=>a(e.target.value)});case`number`:return(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(G,{...c,inputMode:e.integer?`numeric`:`decimal`,value:typeof n==`string`?n:``,placeholder:e.defaultValue===void 0?void 0:String(e.defaultValue),className:`font-mono tabular-nums`,onChange:e=>a(e.target.value)}),e.unit&&(0,Q.jsx)(`span`,{className:`flex-none text-xs text-content-muted`,children:e.unit})]});case`color`:return(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`size-6 flex-none rounded-sm border border-stroke-strong`,style:{background:typeof n==`string`&&n?n:`transparent`}}),(0,Q.jsx)(G,{...c,maxLength:e.maxLength,value:typeof n==`string`?n:``,placeholder:`#RRGGBB`,className:`font-mono`,onChange:e=>a(e.target.value)})]});default:return(0,Q.jsx)(G,{...c,type:e.kind===`url`?`url`:`text`,maxLength:e.maxLength,value:typeof n==`string`?n:``,className:F(e.kind===`url`&&`font-mono`),onChange:e=>a(e.target.value)})}}function rn({row:e,instance:t,notify:n,onPreview:r,onSave:i}){let{t:a,language:o}=u(),s=(0,Z.useId)(),c=e.manifest?.props,l=(0,Z.useMemo)(()=>Jt(c,o),[o,c]),d=(0,Z.useMemo)(()=>Yt(l,t?.props),[l,t]),[f,p]=(0,Z.useState)(d),[m,h]=(0,Z.useState)(t?.title??``),[_,v]=(0,Z.useState)({}),[b,x]=(0,Z.useState)(``),[S,C]=(0,Z.useState)(!1),w=!$t(f,d)||m!==(t?.title??``);(0,Z.useEffect)(()=>{let e=nt(c,Xt(l,f));e.errors.length||r({title:m,props:e.value})},[l,r,c,m,f]);let T=(e,t)=>{p(n=>({...n,[e]:t})),v(t=>{if(!Object.hasOwn(t,e))return t;let n={...t};return delete n[e],n})},ee=async()=>{if(t){C(!0),v({}),x(``);try{await i(t,{title:m.trim(),props:Xt(l,f)}),n(a(`custom-ui:studio.propsSaved`))}catch(e){let t=g(e);if(t===`component_props_invalid`){let t=Qt(y(e));v(t);let n=l.find(e=>Object.hasOwn(t,e.key));n&&document.getElementById(`${s}-${n.key}`)?.focus()}else t===`component_title_invalid`?x(q(t,a)):n(t?`${a(`custom-ui:studio.saveFailed`)} ${q(t,a)}`:a(`custom-ui:studio.saveFailed`))}finally{C(!1)}}},E=e=>{let t=_[e];return t?q(t.code,a,t.params):void 0},te=l.some(e=>e.kind===`url`||e.kind===`textarea`),D=`${s}-title`;return(0,Q.jsxs)(`form`,{"data-props-form":t?.instanceId??`preview`,className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),ee()},children:[!t&&(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:a(`custom-ui:studio.previewPropsHint`)}),(0,Q.jsx)(en,{id:D,label:a(`custom-ui:studio.cardTitle`),error:b,children:(0,Q.jsx)(G,{id:D,value:m,maxLength:80,disabled:S,"aria-invalid":b?!0:void 0,placeholder:a(`custom-ui:studio.cardTitlePlaceholder`),onChange:e=>{h(e.target.value),x(``)}})}),l.map(e=>{let t=`${s}-${e.key}`,n=E(e.key);return(0,Q.jsx)(en,{id:t,label:e.label,description:e.description,required:e.required,error:n,inline:e.kind===`switch`,children:(0,Q.jsx)(nn,{field:e,id:t,value:f[e.key]??``,error:n,disabled:S,onChange:t=>T(e.key,t)})},e.key)}),_[``]&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:q(_[``].code,a,_[``].params)}),te&&(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:a(`custom-ui:studio.propsPlaintext`)}),t&&(0,Q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Q.jsx)(I,{type:`button`,size:`sm`,variant:`ghost`,disabled:S||!w,onClick:()=>{p(d),h(t.title),v({}),x(``)},children:a(`custom-ui:studio.propsReset`)}),(0,Q.jsx)(I,{type:`submit`,size:`sm`,disabled:S||!w,"data-props-save":!0,children:a(`custom-ui:studio.propsSave`)})]})]})}function an({title:e,aside:t,children:n,className:r}){return(0,Q.jsxs)(`section`,{className:F(`flex flex-col gap-2.5`,r),children:[(0,Q.jsxs)(`header`,{className:`flex items-baseline justify-between gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-semibold text-content`,children:e}),t&&(0,Q.jsx)(`span`,{className:`text-xs text-content-muted`,children:t})]}),n]})}function on(e,t){return f({queryKey:_.versions(e),queryFn:({signal:t})=>at(e,t),enabled:t&&!!e,retry:!1,staleTime:1e4,refetchOnWindowFocus:!1})}function sn(e,t){return f({queryKey:_.usage(e),queryFn:({signal:t})=>Ke(e,t),enabled:t&&!!e,retry:!1,refetchInterval:15e3,refetchOnWindowFocus:!1})}function cn(e){return f({queryKey:_.trash(),queryFn:({signal:e})=>Xe(e),enabled:e,retry:!1,refetchOnWindowFocus:!1})}function ln(e){return f({queryKey:_.staged(e),queryFn:({signal:t})=>ot(e,t),enabled:!!e,retry:!1,refetchOnWindowFocus:!1,staleTime:1/0})}function un(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),window.setTimeout(()=>URL.revokeObjectURL(n),1e3)}function dn(e){let t=d(),{t:n}=u();return(0,Z.useMemo)(()=>{let r=()=>t.invalidateQueries({queryKey:_.all}),i=async(t,i)=>{try{let e=await t();return await r(),e}catch(t){let r=g(t);return e(r?`${i} ${q(r,n)}`:i),null}};return{notify:e,restoreVersion:async(t,r)=>{let a=await i(()=>Qe(t.id,r),n(`custom-ui:versions.restoreFailed`));return a&&e(n(`custom-ui:versions.restored`,{n:r})),a},exportZip:async t=>{try{un(await Mt(t.id),`${t.id}.zip`),e(n(`custom-ui:exporting.done`,{name:t.name}))}catch(t){let r=g(t);e(r?`${n(`custom-ui:exporting.failed`)} ${q(r,n)}`:n(`custom-ui:exporting.failed`))}},stageImport:e=>i(()=>lt(e),n(`custom-ui:importing.stageFailed`)),trust:async t=>{let r=await i(()=>ct(t),n(`custom-ui:importing.trustFailed`));return r&&e(r.replaced?n(`custom-ui:importing.replaced`,{name:r.component.name}):n(`custom-ui:importing.trusted`,{name:r.component.name})),r},discard:async t=>{let r=await i(()=>rt(t).then(()=>!0),n(`custom-ui:importing.discardFailed`));return r&&e(n(`custom-ui:importing.discarded`)),r},restoreTrash:async t=>{let r=await i(()=>Tt(t.entry),n(`custom-ui:trash.restoreFailed`));return r&&e(n(`custom-ui:trash.restored`,{name:t.name})),r},purgeTrash:async t=>{let r=await i(()=>st(t.entry).then(()=>!0),n(`custom-ui:trash.purgeFailed`));return r&&e(n(`custom-ui:trash.purged`,{name:t.name})),r},setRevoked:(e,t)=>i(()=>Ze(e.id,t),n(`custom-ui:usage.revokeFailed`))}},[t,e,n])}var fn=(0,Z.lazy)(()=>t(()=>import(`./public-diff-DK-VNIar.js`).then(e=>({default:e.InlineGitDiff})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])));function pn({version:e}){let{t}=u();return!e.files.length&&!e.deleted.length?null:(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-wrap gap-1`,"data-version-files":!0,children:[e.files.map(e=>(0,Q.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1 rounded-sm border border-stroke bg-surface-subtle px-1.5 font-mono text-[11px] text-content-secondary`,children:[(0,Q.jsx)(`span`,{className:`truncate`,children:e.path}),e.added>0&&(0,Q.jsxs)(`span`,{className:`text-st-done tabular-nums`,children:[`+`,e.added]}),e.removed>0&&(0,Q.jsxs)(`span`,{className:`text-st-fail tabular-nums`,children:[`−`,e.removed]})]},e.path)),e.deleted.map(e=>(0,Q.jsx)(`span`,{className:`inline-flex max-w-full items-center gap-1 rounded-sm border border-stroke px-1.5 font-mono text-[11px] text-content-muted line-through`,title:t(`custom-ui:versions.deletedFile`),children:e},`deleted:${e}`))]})}function mn(e,t,n){return[dt(e,t),e.summary,e.at?ze(e.at,n):``].filter(Boolean).join(` · `)}function hn({row:e,enabled:t,notify:n,actions:r}){let{t:i,language:a}=u(),o=on(e.id,t),[s,c]=(0,Z.useState)(null),[l,d]=(0,Z.useState)(0),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(!1),_=(0,Z.useRef)(null),v=K(!!f);if(!t)return null;let y=o.data,b=async(t,r)=>{_.current=r,d(t.n);try{c({...await $e(e.id,t.n),n:t.n})}catch(e){let t=g(e);n(t?`${i(`custom-ui:versions.diffFailed`)} ${q(t,i)}`:i(`custom-ui:versions.diffFailed`))}finally{d(0)}},x=async()=>{if(!f)return;h(!0);let t=await r.restoreVersion(e,f.n);h(!1),t&&p(null)};return(0,Q.jsxs)(an,{title:i(`custom-ui:versions.title`),aside:y?i(`custom-ui:versions.keep`,{count:y.max}):void 0,children:[o.isPending?(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:i(`custom-ui:versions.loading`)}):o.error||!y?(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:i(`custom-ui:versions.failed`)}):(0,Q.jsxs)(`ol`,{"data-component-versions":!0,className:`overflow-hidden rounded-[var(--r-md)] border border-stroke`,children:[(0,Q.jsxs)(`li`,{"data-component-version":y.current.n,"data-version-current":!0,className:`flex min-w-0 flex-col gap-1 border-b border-stroke px-3 py-2 last:border-b-0`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2 text-sm`,children:[(0,Q.jsxs)(`strong`,{className:`font-mono font-medium tabular-nums`,children:[`v`,y.current.n]}),(0,Q.jsx)(`span`,{className:`text-xs text-content-secondary`,children:i(`custom-ui:versions.current`)}),(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs text-content-muted`,children:mn(y.current,i,a)})]}),(0,Q.jsx)(pn,{version:y.current})]}),y.versions.map(e=>(0,Q.jsxs)(`li`,{"data-component-version":e.n,className:`flex min-w-0 items-center gap-2 border-b border-stroke px-3 py-1.5 last:border-b-0`,children:[(0,Q.jsxs)(`strong`,{className:`flex-none font-mono text-sm font-medium tabular-nums`,children:[`v`,e.n]}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-content-muted`,children:mn(e,i,a)||i(`custom-ui:versions.noSummary`)}),(0,Q.jsxs)(I,{size:`xs`,variant:`ghost`,disabled:l===e.n,"data-version-compare":e.n,onClick:t=>void b(e,t.currentTarget),children:[(0,Q.jsx)(Pt,{}),i(`custom-ui:versions.compare`)]}),(0,Q.jsxs)(I,{size:`xs`,variant:`ghost`,"data-version-restore":e.n,onClick:t=>{_.current=t.currentTarget,p(e)},children:[(0,Q.jsx)(de,{}),i(`custom-ui:versions.restore`)]})]},e.n)),!y.versions.length&&(0,Q.jsx)(`li`,{className:`px-3 py-2 text-xs text-content-muted`,children:i(`custom-ui:versions.onlyCurrent`)})]}),(0,Q.jsx)(W,{open:!!f,onOpenChange:e=>!e&&!m&&p(null),children:(0,Q.jsxs)(B,{onCloseAutoFocus:v,children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:i(`custom-ui:versions.restoreTitle`,{n:f?.n??0})}),(0,Q.jsx)(z,{children:i(`custom-ui:versions.restoreHint`,{n:f?.n??0,next:(y?.current.n??0)+1,current:y?.current.n??0})})]}),(0,Q.jsxs)(H,{children:[(0,Q.jsx)(I,{variant:`outline`,disabled:m,onClick:()=>p(null),children:i(`custom-ui:studio.cancel`)}),(0,Q.jsx)(I,{disabled:m,"data-version-restore-confirm":!0,onClick:()=>void x(),children:i(`custom-ui:versions.restoreConfirm`,{n:f?.n??0})})]})]})}),(0,Q.jsx)(W,{open:!!s,onOpenChange:e=>!e&&c(null),children:(0,Q.jsxs)(B,{"data-version-diff":s?.n,scrollMode:`body`,className:`h-[min(760px,calc(100dvh-2rem))] max-w-[min(960px,calc(100vw-2rem))]`,onCloseAutoFocus:e=>{e.preventDefault(),_.current?.focus()},children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:i(`custom-ui:versions.diffTitle`,{n:s?.n??0,current:y?.current.n??0})}),(0,Q.jsx)(z,{children:s?.files.length?s.files.map(e=>e.path).join(` · `):i(`custom-ui:versions.noDiff`)})]}),(0,Q.jsx)(He,{className:`-mx-4 border-t border-stroke`,children:s&&s.files.length>0&&(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(fn,{diff:s.diff,truncated:s.truncated,mode:`unified`})})})]})})]})}var gn=[`overview-card`,`session-panel`,`feature-page`,`floating`],_n={"overview-card":Ft,"session-panel":le,"feature-page":te,floating:O};function vn(e,t){return e.source===`agent`?t(`custom-ui:studio.sourceAgent`):e.source===`template`?t(`custom-ui:studio.sourceTemplate`):e.source===`import`?t(`custom-ui:studio.sourceImport`):t(`custom-ui:studio.sourceLocal`)}function yn(e,t){let n=Y(e.surface,t),r=e.size?`${n} ${e.size}`:n;return e.title?`${r} · ${e.title}`:r}function bn(e){let t=e.replace(/[\\/]+$/,``).split(/[\\/]/);return t[t.length-1]||e}function xn({row:e,actions:t}){let{t:n,language:r}=u(),[i,a]=(0,Z.useState)(!1);return(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`grid size-10 flex-none place-items-center rounded-[var(--r-md)] border border-stroke bg-solid text-content-secondary`,children:(0,Q.jsx)(O,{className:`size-5`,strokeWidth:1.75,"aria-hidden":!0})}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,Q.jsx)(`strong`,{className:`truncate text-[15px] font-semibold`,children:J(e,r)}),(0,Q.jsx)(`span`,{className:`truncate text-xs text-content-muted`,children:[e.version?`v${e.version}`:``,e.kind===`broken`?n(`custom-ui:studio.statusBroken`):n(`custom-ui:studio.nativeComponent`),e.kind===`native`?vn(e,n):``].filter(Boolean).join(` · `)})]}),e.kind===`native`&&(0,Q.jsxs)(`label`,{className:`inline-flex flex-none items-center gap-2 text-xs text-content-secondary`,children:[n(`custom-ui:studio.enable`),(0,Q.jsx)(De,{checked:e.enabled,disabled:i,"aria-label":n(`custom-ui:studio.enable`),"data-component-enable":!0,onCheckedChange:async n=>{a(!0),await t.setEnabled(e,n),a(!1)}})]})]})}function Sn({row:e}){let{t}=u();return e.errors.length?(0,Q.jsx)(`ul`,{"data-component-errors":!0,className:`flex flex-col gap-1 rounded-[var(--r-md)] border border-stroke bg-surface-subtle px-3 py-2 text-xs text-content-secondary`,children:e.errors.map(e=>(0,Q.jsxs)(`li`,{className:`min-w-0 break-all`,children:[e.path&&(0,Q.jsx)(`code`,{className:`mr-1.5 font-mono`,children:e.path}),q(e.code,t,e.params)]},`${e.path}:${e.code}`))}):null}function Cn({row:e,instances:t,selectedInstanceId:n,notify:r,actions:i,onSelectInstance:a,onPreview:o}){let{t:s}=u(),c=t.filter(t=>t.componentId===e.id),l=c.find(e=>e.instanceId===n)??null;return(0,Q.jsxs)(an,{title:s(`custom-ui:studio.props`),aside:s(`custom-ui:studio.propsPerInstance`),children:[c.length>0&&(0,Q.jsxs)(Ee,{value:l?.instanceId??`preview`,onValueChange:e=>a(e===`preview`?null:e),children:[(0,Q.jsx)(Ce,{className:`w-full`,"aria-label":s(`custom-ui:studio.editingInstance`),"data-props-instance":!0,children:(0,Q.jsx)(Se,{})}),(0,Q.jsxs)(we,{children:[(0,Q.jsx)(Te,{value:`preview`,children:s(`custom-ui:studio.previewProps`)}),c.map(e=>(0,Q.jsxs)(Te,{value:e.instanceId,children:[yn(e,s),!e.enabled&&` · ${s(`custom-ui:studio.instanceClosed`)}`]},e.instanceId))]})]}),(0,Q.jsx)(rn,{row:e,instance:l,notify:r,onPreview:o,onSave:i.saveProps},l?.instanceId??`preview:${e.id}`)]})}function wn({row:e,usageEnabled:t=!1,canRevoke:n=!1,lifecycle:r}){let{t:i,language:a}=u(),o=e.manifest?.capabilities??{},s=sn(e.id,t),[c,l]=(0,Z.useState)(``),d=[`network`,`notify`,`sessions.read`,`sessions.open`,`storage`,`provider.request`].filter(e=>o[e]),f=[`sessions.read`,`notify`,`network`,`storage`,`provider.request`].filter(e=>!o[e]).map(e=>St(e,i)),p=r?.notify??(()=>void 0),m=async(t,n)=>{if(!r)return;l(t);let a=n?[...new Set([...e.revoked,t])]:e.revoked.filter(e=>e!==t),o=await r.setRevoked(e,a);l(``),o&&p(i(n?`custom-ui:usage.revoked`:`custom-ui:usage.unrevoked`,{capability:St(t,i)}))};return(0,Q.jsxs)(an,{title:i(`custom-ui:studio.capabilities`),children:[d.length?(0,Q.jsx)(`ul`,{"data-component-capabilities":!0,className:`overflow-hidden rounded-[var(--r-md)] border border-stroke`,children:d.map(l=>{let u=o[l],d=e.revoked.includes(l),f=s.data?.usage[l],p=l===`network`?o.network?.hosts.join(`, `):l===`storage`?i(`custom-ui:studio.capStorageQuota`,{kb:o.storage?.quotaKb??0}):l===`provider.request`?`${o[`provider.request`]?.methods.join(`/`)} ${o[`provider.request`]?.paths.join(`, `)}`:``;return(0,Q.jsxs)(`li`,{"data-component-capability":l,"data-capability-revoked":d||void 0,className:`flex min-w-0 items-start gap-2 border-b border-stroke px-3 py-2 last:border-b-0`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2 text-sm`,children:[(0,Q.jsx)(`span`,{className:F(d&&`text-content-muted line-through`),children:St(l,i)}),p&&(0,Q.jsx)(`code`,{title:p,className:`min-w-0 truncate font-mono text-xs text-content-secondary`,children:p}),d&&(0,Q.jsx)(We,{className:`flex-none text-content-secondary`,children:i(`custom-ui:usage.revokedBadge`)})]}),u?.reason&&(0,Q.jsx)(`span`,{className:`text-xs text-content-muted`,children:u.reason}),t&&(0,Q.jsx)(`span`,{className:`text-xs text-content-muted`,"data-capability-usage":!0,children:f?[i(`custom-ui:usage.last`,{time:ze(f.lastAt,a)}),f.target,i(`custom-ui:usage.today`,{count:f.today})].filter(Boolean).join(` · `):i(`custom-ui:usage.never`)})]}),n&&r&&(0,Q.jsx)(I,{size:`xs`,variant:`ghost`,disabled:c===l,"data-capability-toggle":l,className:`flex-none`,onClick:()=>void m(l,!d),children:i(d?`custom-ui:usage.restore`:`custom-ui:usage.revoke`)})]},l)})}):(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:i(`custom-ui:studio.capNone`)}),(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:i(`custom-ui:studio.capUndeclared`,{list:[...f,i(`custom-ui:studio.capFiles`),i(`custom-ui:studio.capClipboard`)].join(` · `)})}),(0,Q.jsx)(`p`,{className:`text-xs leading-relaxed text-content-muted`,children:i(`custom-ui:studio.capExplainer`)})]})}function Tn({value:e,disabled:t,onChange:n}){let{t:r}=u(),{projects:i}=Re(),a=i.filter(e=>e.cwd),o=e.type===`project`?e.cwd:`*`;return e.type===`project`&&!a.some(t=>t.cwd===e.cwd)&&a.push({key:e.cwd,cwd:e.cwd,count:0}),(0,Q.jsxs)(Ee,{value:o,disabled:t,onValueChange:e=>n(e===`*`?{type:`all`}:{type:`project`,cwd:e}),children:[(0,Q.jsx)(Ce,{size:`sm`,className:`w-full min-w-0`,"aria-label":r(`custom-ui:studio.scope`),"data-placement-scope":!0,children:(0,Q.jsx)(Se,{})}),(0,Q.jsxs)(we,{children:[(0,Q.jsx)(Te,{value:`*`,children:r(`custom-ui:studio.scopeAll`)}),a.map(e=>(0,Q.jsx)(Te,{value:e.cwd,children:r(`custom-ui:studio.scopeProject`,{name:bn(e.cwd)})},e.cwd))]})]})}function En({row:e,instances:t,actions:n}){let{t:r}=u(),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(wt(e.manifest)),[c,l]=(0,Z.useState)({type:`all`}),[d,f]=(0,Z.useState)(null),p=K(d!==null),m=mt(e),h=t.filter(t=>t.componentId===e.id),g=e.manifest?.placements.find(e=>e.surface===`overview-card`)?.sizes??[`S`,`M`],_=async e=>{a(!0);try{await e()}finally{a(!1)}};return(0,Q.jsxs)(an,{title:r(`custom-ui:studio.placements`),aside:!m&&e.kind===`native`?r(`custom-ui:studio.placeNeedsEnable`):void 0,children:[(0,Q.jsx)(`ul`,{className:`grid grid-cols-1 gap-2 min-[360px]:grid-cols-2`,"data-component-placements":!0,children:gn.map(a=>{let u=_n[a],d=h.filter(e=>e.surface===a),p=d.filter(e=>e.enabled),v=p.length>0,y=At(e.manifest,a),b=i||!m||!y,x=a===`overview-card`&&p.length===1?p[0]:null,S=()=>{v?p.length>1?f(p):_(()=>n.unplace(p[0])):_(()=>n.place(e,t,{surface:a,...a===`overview-card`?{size:o}:{},...a===`session-panel`?{scope:c}:{}}))},C=d[0];return(0,Q.jsxs)(`li`,{"data-placement-tile":a,"data-placement-checked":v||void 0,className:F(`flex min-w-0 flex-col gap-2 rounded-[var(--r-md)] border px-2.5 py-2`,v?`border-stroke-strong bg-surface-subtle`:`border-stroke`,!y&&`opacity-60`),children:[(0,Q.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-sm pointer-coarse:min-h-11`,children:[(0,Q.jsx)(ge,{checked:v,disabled:b,"aria-describedby":y?void 0:`placement-${a}-hint`,onCheckedChange:S}),(0,Q.jsx)(u,{className:`size-3.5 flex-none text-content-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:Y(a,r)}),a===`overview-card`&&p.length>1&&(0,Q.jsxs)(We,{className:`flex-none`,children:[`×`,p.length]})]}),!y&&(0,Q.jsx)(`span`,{id:`placement-${a}-hint`,className:`text-xs text-content-muted`,children:r(`custom-ui:studio.placeUndeclared`)}),y&&a===`overview-card`&&(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[g.length>1&&(0,Q.jsx)(P,{size:`sm`,"aria-label":r(`custom-ui:studio.cardSize`),disabled:b,value:x?.size??o,onValueChange:e=>{s(e),x&&_(()=>n.patchInstance(x,{size:e}))},options:g.map(e=>({value:e,label:e}))}),v&&(0,Q.jsx)(I,{size:`xs`,variant:`ghost`,disabled:b,title:r(`custom-ui:studio.addCard`),"aria-label":r(`custom-ui:studio.addCard`),onClick:()=>void _(()=>n.place(e,t,{surface:a,size:o})),children:(0,Q.jsx)(ue,{})})]}),y&&a===`session-panel`&&(0,Q.jsx)(Tn,{value:C?.scope??c,disabled:b,onChange:e=>{l(e),C&&_(()=>n.patchInstance(C,{scope:e}))}}),y&&a===`floating`&&(0,Q.jsx)(`span`,{className:`text-xs text-content-muted`,children:r(`custom-ui:studio.floatingPhoneHint`)})]},a)})}),(0,Q.jsx)(W,{open:d!==null,onOpenChange:e=>!e&&f(null),children:(0,Q.jsxs)(B,{onCloseAutoFocus:p,children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:r(`custom-ui:studio.unplaceAllTitle`,{count:d?.length??0})}),(0,Q.jsx)(z,{children:r(`custom-ui:studio.unplaceAllHint`)})]}),(0,Q.jsxs)(H,{children:[(0,Q.jsx)(I,{variant:`outline`,onClick:()=>f(null),children:r(`custom-ui:studio.cancel`)}),(0,Q.jsx)(I,{variant:`destructive`,disabled:i,onClick:()=>{let e=d??[];f(null),_(async()=>{for(let t of e)await n.unplace(t)})},children:r(`custom-ui:studio.unplaceAll`)})]})]})})]})}function Dn({row:e,instances:t,actions:n,className:r}){let{t:i}=u(),a=mt(e);return(0,Q.jsxs)(be,{children:[(0,Q.jsx)(ye,{asChild:!0,children:(0,Q.jsxs)(I,{size:`sm`,disabled:!a,"data-component-place":!0,className:r,children:[i(`custom-ui:studio.placeTo`),(0,Q.jsx)(re,{})]})}),(0,Q.jsx)(N,{align:`start`,className:`w-56`,children:gn.map(r=>{let a=At(e.manifest,r),o=r!==`overview-card`&&t.some(t=>t.componentId===e.id&&t.surface===r&&t.enabled);return(0,Q.jsxs)(M,{disabled:!a||o,"data-component-place-item":r,onSelect:()=>void n.place(e,t,{surface:r,...r===`overview-card`?{size:wt(e.manifest)}:{}}),children:[Y(r,i),(0,Q.jsx)(`span`,{className:`ml-auto text-xs text-content-muted`,children:a?o?i(`custom-ui:studio.placed`):``:i(`custom-ui:studio.placeUndeclaredShort`)})]},r)})})]})}function On({row:e,actions:t,onDeleted:n,variant:r=`menu`}){let{t:i,language:a}=u(),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(!1),d=(0,Z.useRef)(null),f=K(o,d),p=J(e,a),m=async()=>{l(!0);let r=await t.remove(e);l(!1),r&&(s(!1),n())};return(0,Q.jsxs)(Q.Fragment,{children:[r===`menu`?(0,Q.jsxs)(be,{children:[(0,Q.jsx)(ye,{asChild:!0,children:(0,Q.jsx)(I,{ref:d,size:`icon-sm`,variant:`ghost`,"aria-label":i(`custom-ui:studio.more`),"data-component-more":!0,children:(0,Q.jsx)(ce,{})})}),(0,Q.jsx)(N,{align:`end`,children:(0,Q.jsxs)(M,{variant:`destructive`,"data-component-delete":!0,onSelect:()=>s(!0),children:[(0,Q.jsx)(j,{}),i(`custom-ui:studio.deleteComponent`)]})})]}):(0,Q.jsxs)(I,{variant:`ghost`,size:`sm`,className:`text-danger`,"data-component-delete":!0,onClick:()=>s(!0),children:[(0,Q.jsx)(j,{}),i(`custom-ui:studio.deleteComponent`)]}),(0,Q.jsx)(W,{open:o,onOpenChange:e=>!e&&!c&&s(!1),children:(0,Q.jsxs)(B,{onCloseAutoFocus:f,children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:i(`custom-ui:studio.deleteTitle`,{name:p})}),(0,Q.jsx)(z,{children:i(`custom-ui:studio.deleteHint`)})]}),(0,Q.jsxs)(H,{children:[(0,Q.jsx)(I,{variant:`outline`,disabled:c,onClick:()=>s(!1),children:i(`custom-ui:studio.cancel`)}),(0,Q.jsx)(I,{variant:`destructive`,disabled:c,"data-component-delete-confirm":!0,onClick:()=>void m(),children:i(`custom-ui:studio.delete`)})]})]})})]})}function kn({row:e,lifecycle:t,className:n}){let{t:r}=u(),[i,a]=(0,Z.useState)(!1);return(0,Q.jsxs)(I,{size:`sm`,variant:`secondary`,disabled:i,"data-component-export":!0,className:n,onClick:async()=>{a(!0),await t.exportZip(e),a(!1)},children:[(0,Q.jsx)(se,{}),r(`custom-ui:exporting.button`)]})}function An({row:e,instances:t,selectedInstanceId:n,canDelete:r,features:i,notify:a,actions:o,lifecycle:s,onSelectInstance:c,onPreview:l,onViewSource:d,onDeleted:f}){let{t:p}=u(),m=e.kind===`native`&&e.status===`ready`&&!!e.manifest;return(0,Q.jsxs)(`div`,{"data-studio-settings":!0,className:`flex h-full min-h-0 flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto px-4 pt-4 pb-5`,children:[(0,Q.jsx)(xn,{row:e,actions:o}),(0,Q.jsx)(Sn,{row:e}),m&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Cn,{row:e,instances:t,selectedInstanceId:n,notify:a,actions:o,onSelectInstance:c,onPreview:l}),(0,Q.jsx)(wn,{row:e,usageEnabled:i.usage,canRevoke:i.revoke,lifecycle:s}),(0,Q.jsx)(En,{row:e,instances:t,actions:o})]}),e.kind===`native`&&(0,Q.jsx)(hn,{row:e,enabled:i.versions,notify:a,actions:s})]}),(0,Q.jsxs)(`footer`,{className:`flex flex-none items-center gap-2 border-t border-stroke bg-panel px-4 py-2.5`,children:[m&&(0,Q.jsx)(Dn,{row:e,instances:t,actions:o}),(0,Q.jsxs)(I,{size:`sm`,variant:`secondary`,onClick:d,"data-component-view-source":!0,children:[(0,Q.jsx)(k,{}),p(`custom-ui:studio.viewSource`)]}),i.export&&e.kind===`native`&&(0,Q.jsx)(kn,{row:e,lifecycle:s}),r&&(0,Q.jsx)(`span`,{className:`ml-auto`,children:(0,Q.jsx)(On,{row:e,actions:o,onDeleted:f})})]})]})}var jn=(0,Z.createContext)({code:``}),Mn=({code:e,language:t,className:n,showLineNumbers:r=!1,children:i,...a})=>{let o={code:e};return(0,Q.jsx)(jn.Provider,{value:o,children:(0,Q.jsxs)(`div`,{className:F(`group relative w-full overflow-hidden rounded-md border bg-background text-foreground`,n),"data-language":t,...a,children:[(0,Q.jsx)(`div`,{className:`relative overflow-auto`,children:(0,Q.jsx)(`pre`,{className:`m-0 p-4 text-sm leading-relaxed`,children:(0,Q.jsx)(`code`,{className:`font-mono whitespace-pre`,children:e})})}),i]})})},Nn=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,...a})=>{let[o,s]=(0,Z.useState)(!1),{code:c}=(0,Z.useContext)(jn),l=async()=>{if(typeof window>`u`||!navigator?.clipboard?.writeText){t?.(Error(`Clipboard API not available`));return}try{await navigator.clipboard.writeText(c),s(!0),e?.(),setTimeout(()=>s(!1),n)}catch(e){t?.(e)}},u=o?ne:oe;return(0,Q.jsx)(I,{className:F(`shrink-0`,i),onClick:l,size:`icon`,variant:`ghost`,...a,children:r??(0,Q.jsx)(u,{size:14})})},Pn=(0,Z.lazy)(()=>t(()=>import(`./public-diff-DK-VNIar.js`).then(e=>({default:e.InlineGitDiff})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]))),Fn=/\.(?:m?js|css|json|svg|md|txt)$/i;function In(e){return/\.m?js$/i.test(e)?`javascript`:/\.css$/i.test(e)?`css`:/\.json$/i.test(e)?`json`:/\.svg$/i.test(e)?`xml`:`text`}function Ln({enabled:e,lifecycle:t,onStaged:n,className:r}){let{t:i}=u(),a=(0,Z.useRef)(null),[o,s]=(0,Z.useState)(!1);return!e||!t?(0,Q.jsxs)(I,{size:`sm`,variant:`ghost`,"aria-disabled":`true`,title:i(`custom-ui:importing.unsupported`),"aria-label":`${i(`custom-ui:studio.importZip`)} · ${i(`custom-ui:importing.unsupported`)}`,"data-component-import":!0,className:r,onClick:e=>e.preventDefault(),children:[(0,Q.jsx)(Nt,{}),i(`custom-ui:studio.importZip`)]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(I,{size:`sm`,variant:`ghost`,disabled:o,"data-component-import":!0,className:r,onClick:()=>a.current?.click(),children:[(0,Q.jsx)(Nt,{}),i(o?`custom-ui:importing.staging`:`custom-ui:studio.importZip`)]}),(0,Q.jsx)(`input`,{ref:a,type:`file`,accept:`.zip,application/zip`,hidden:!0,"data-component-import-input":!0,onChange:async e=>{let r=e.target.files?.[0];if(e.target.value=``,!r)return;s(!0);let i=await t.stageImport(r);s(!1),i&&n?.(i)}})]})}function Rn({staged:e,phone:t=!1,onReview:n}){let{t:r}=u();return(0,Q.jsxs)(`div`,{"data-staged-row":e.stageId,className:F(`flex flex-col gap-1.5 rounded-[var(--r-md)] border border-dashed border-st-attn-border bg-st-attn-soft px-2.5 py-2`,t&&`px-3.5 py-3`),children:[(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-sm`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 flex-none rounded-full bg-st-attn-fill`}),(0,Q.jsx)(`strong`,{className:`min-w-0 truncate font-medium`,children:e.fileName}),(0,Q.jsx)(`span`,{className:`flex-none text-xs text-content-muted`,children:r(`custom-ui:importing.shared`)})]}),(0,Q.jsx)(`p`,{className:`text-xs text-content-secondary`,children:r(`custom-ui:importing.needsReview`)}),(0,Q.jsxs)(I,{size:t?`sm`:`xs`,variant:`secondary`,className:F(`w-fit`,t&&`min-h-11`),"data-staged-review":e.stageId,onClick:n,children:[(0,Q.jsx)(pe,{}),r(`custom-ui:importing.review`)]})]})}function zn(e){return e===`danger`?`text-st-fail`:`text-content-secondary`}function Bn(e,t){switch(e){case`fetch`:return t(`custom-ui:scan.ruleFetch`);case`xhr`:return t(`custom-ui:scan.ruleXhr`);case`websocket`:return t(`custom-ui:scan.ruleWebsocket`);case`eval`:return t(`custom-ui:scan.ruleEval`);case`function`:return t(`custom-ui:scan.ruleFunction`);case`cookie`:return t(`custom-ui:scan.ruleCookie`);case`local-storage`:return t(`custom-ui:scan.ruleLocalStorage`);case`app-api`:return t(`custom-ui:scan.ruleAppApi`);case`dynamic-import`:return t(`custom-ui:scan.ruleDynamicImport`);default:return e}}function Vn({scan:e}){let{t}=u();if(e.status!==`ok`)return(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:t(`custom-ui:scan.unsupported`)});let n=!e.findings.length&&!e.summary.undeclaredHosts;return(0,Q.jsxs)(`div`,{"data-component-scan":!0,className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`p`,{className:F(`text-xs`,e.summary.danger||e.summary.undeclaredHosts?`text-st-fail`:`text-content-secondary`),"data-scan-summary":!0,children:n?t(`custom-ui:scan.clean`):t(`custom-ui:scan.summary`,{danger:e.summary.danger,warn:e.summary.warn+e.summary.info,hosts:e.summary.undeclaredHosts})}),e.hosts.length>0&&(0,Q.jsx)(`ul`,{className:`flex flex-col gap-0.5 text-xs`,"data-scan-hosts":!0,children:e.hosts.map(e=>(0,Q.jsxs)(`li`,{"data-scan-host":e.host,"data-declared":e.declared,className:`flex min-w-0 items-baseline gap-2`,children:[(0,Q.jsx)(`code`,{className:F(`min-w-0 truncate font-mono`,e.declared?`text-content-secondary`:`text-st-fail`),children:e.host}),(0,Q.jsx)(`span`,{className:e.declared?`text-content-muted`:`text-st-fail`,children:e.declared?t(`custom-ui:scan.hostDeclared`):t(`custom-ui:scan.hostUndeclared`)})]},e.host))}),e.findings.length>0&&(0,Q.jsx)(`ul`,{className:`flex flex-col gap-1.5`,"data-scan-findings":!0,children:e.findings.map((e,n)=>(0,Q.jsxs)(`li`,{"data-scan-finding":e.rule,"data-severity":e.severity,className:`flex min-w-0 flex-col gap-0.5 text-xs`,children:[(0,Q.jsxs)(`span`,{className:F(`flex items-center gap-1.5`,zn(e.severity)),children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:F(`size-1.5 flex-none rounded-full`,e.severity===`danger`?`bg-st-fail`:`bg-content-muted`)}),Bn(e.rule,t),(0,Q.jsxs)(`code`,{className:`ml-auto flex-none font-mono text-content-muted`,children:[e.file,`:`,e.line]})]}),e.excerpt&&(0,Q.jsx)(`code`,{className:`block truncate rounded-sm bg-surface-subtle px-1.5 py-0.5 font-mono text-[11px] text-content-secondary`,children:e.excerpt})]},`${e.file}:${e.line}:${e.rule}:${n}`))}),e.truncated&&(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:t(`custom-ui:scan.truncated`)})]})}function Hn({title:e,children:t}){return(0,Q.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`h3`,{className:`text-xs font-semibold text-content-secondary`,children:e}),t]})}function Un({stageId:e,lifecycle:t,onClose:n,onTrusted:r}){let{t:i}=u(),a=ln(e),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),[d,p]=(0,Z.useState)(!1),m=(0,Z.useId)(),h=a.data,g=(h?.files??[]).filter(e=>Fn.test(e.path)),v=h?.manifest?.entry??``,y=g.find(e=>e.path===o)?.path??g.find(e=>e.path===v)?.path??g[0]?.path??``;(0,Z.useEffect)(()=>{s(``),p(!1)},[e]);let b=f({queryKey:[..._.staged(e),`file`,y],queryFn:({signal:t})=>Ye(e,y,t),enabled:!!(e&&y),retry:!1,staleTime:1/0,refetchOnWindowFocus:!1}),x=h?.staged,S=h?.manifest?.capabilities??{},C=[`network`,`notify`,`sessions.read`,`sessions.open`,`storage`,`provider.request`].filter(e=>S[e]),w=async()=>{l(`trust`);let n=await t.trust(e);l(``),n&&r(n.component)},T=async()=>{l(`discard`);let r=await t.discard(e);l(``),r&&n()};return(0,Q.jsx)(W,{open:!!e,onOpenChange:e=>!e&&!c&&n(),children:(0,Q.jsxs)(B,{"data-trust-dialog":e,scrollMode:`body`,className:`h-[min(820px,calc(100dvh-2rem))] max-w-[min(1040px,calc(100vw-2rem))]`,children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:x?i(`custom-ui:importing.reviewTitle`,{name:h?.manifest?.name||x.name,version:x.version?` v${x.version}`:``}):i(`custom-ui:importing.reviewLoading`)}),(0,Q.jsx)(z,{className:`flex flex-wrap gap-x-2 gap-y-0.5 font-mono text-xs`,children:x&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{children:x.fileName}),(0,Q.jsx)(`span`,{children:Be(x.bytes)}),(0,Q.jsxs)(`span`,{className:`break-all`,"data-trust-sha256":!0,children:[`sha256 `,x.sha256]})]})})]}),(0,Q.jsx)(He,{className:`-mx-4 border-y border-stroke`,children:a.isPending?(0,Q.jsx)(`p`,{className:`p-4 text-sm text-content-muted`,children:i(`custom-ui:importing.reviewLoading`)}):a.error||!h?(0,Q.jsx)(`p`,{className:`p-4 text-sm text-content-muted`,children:i(`custom-ui:importing.reviewFailed`)}):(0,Q.jsxs)(`div`,{className:`grid min-h-full grid-cols-1 md:grid-cols-[minmax(0,1fr)_320px]`,children:[(0,Q.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-col gap-2 p-4 md:border-r md:border-stroke`,children:[(0,Q.jsx)(`div`,{role:`group`,id:m,"aria-label":i(`custom-ui:importing.files`),className:`flex flex-wrap gap-1`,"data-trust-files":!0,children:h.files.map(e=>Fn.test(e.path)?(0,Q.jsxs)(Ve,{size:`sm`,"aria-pressed":e.path===y,"data-trust-file":e.path,className:`font-mono`,onClick:()=>{p(!1),s(e.path)},children:[e.path,(0,Q.jsx)(`span`,{className:`text-content-muted`,children:Be(e.size)})]},e.path):(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-1.5 font-mono text-xs text-content-muted`,children:[e.path,` · `,Be(e.size)]},e.path))}),d&&h.diff?(0,Q.jsx)(`div`,{"data-trust-diff-view":!0,className:`min-h-[240px] flex-1 overflow-auto rounded-[var(--r-md)] border border-stroke`,children:(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(Pn,{diff:h.diff.diff,truncated:h.diff.truncated,mode:`unified`})})}):y&&b.data?(0,Q.jsx)(Mn,{code:b.data.content,language:In(y),"data-trust-source":y,className:`min-h-[240px] flex-1 overflow-auto bg-code [&>div]:h-full`}):(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:b.isPending&&y?i(`custom-ui:studio.sourceLoading`):i(`custom-ui:studio.sourceUnavailable`)}),b.data?.truncated&&(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:i(`custom-ui:importing.truncated`)})]}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4 p-4`,children:[h.installed&&(0,Q.jsxs)(`div`,{"data-trust-replaces":!0,className:`flex flex-col gap-1.5 rounded-[var(--r-md)] border border-stroke bg-surface-subtle px-3 py-2 text-xs text-content-secondary`,children:[(0,Q.jsx)(`p`,{children:i(`custom-ui:importing.replaces`,{version:h.installed.version?`v${h.installed.version}`:``})}),h.diff&&h.diff.files.length>0&&(0,Q.jsxs)(I,{size:`xs`,variant:`secondary`,className:`w-fit`,"data-trust-diff":!0,"aria-pressed":d,onClick:()=>p(e=>!e),children:[(0,Q.jsx)(Pt,{}),d?i(`custom-ui:importing.hideDiff`):i(`custom-ui:importing.viewDiff`,{count:h.diff.files.length})]})]}),(0,Q.jsx)(Hn,{title:i(`custom-ui:importing.manifest`),children:h.manifest?(0,Q.jsxs)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-0.5 text-xs`,children:[(0,Q.jsx)(`dt`,{className:`text-content-muted`,children:`id`}),(0,Q.jsx)(`dd`,{className:`truncate font-mono`,children:h.manifest.id}),(0,Q.jsx)(`dt`,{className:`text-content-muted`,children:i(`custom-ui:importing.entry`)}),(0,Q.jsx)(`dd`,{className:`truncate font-mono`,children:h.manifest.entry}),(0,Q.jsx)(`dt`,{className:`text-content-muted`,children:i(`custom-ui:studio.placements`)}),(0,Q.jsx)(`dd`,{children:h.manifest.placements.map(e=>Y(e.surface,i)).join(` · `)||`—`})]}):(0,Q.jsx)(`p`,{className:`text-xs text-st-fail`,children:i(`custom-ui:importing.manifestInvalid`)})}),(0,Q.jsx)(Hn,{title:i(`custom-ui:importing.capabilities`),children:C.length?(0,Q.jsx)(`ul`,{className:`flex flex-col gap-1 text-xs`,"data-trust-capabilities":!0,children:C.map(e=>(0,Q.jsxs)(`li`,{className:`flex min-w-0 flex-col`,children:[(0,Q.jsxs)(`span`,{children:[St(e,i),e===`provider.request`&&(0,Q.jsxs)(`code`,{className:`ml-1 break-all font-mono text-content-secondary`,children:[S[`provider.request`]?.methods.join(`/`),` `,S[`provider.request`]?.paths.join(`, `)]}),e===`network`&&(0,Q.jsx)(`code`,{className:`ml-1.5 font-mono text-content-secondary`,children:S.network?.hosts.join(`, `)})]}),S[e]?.reason&&(0,Q.jsx)(`span`,{className:`text-content-muted`,children:S[e]?.reason})]},e))}):(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:i(`custom-ui:studio.capNone`)})}),(0,Q.jsx)(Hn,{title:i(`custom-ui:importing.scan`),children:(0,Q.jsx)(Vn,{scan:h.scan})}),(0,Q.jsx)(`p`,{className:`text-xs leading-relaxed text-content-muted`,children:i(`custom-ui:importing.explainer`)})]})]})}),(0,Q.jsxs)(H,{className:`flex-row flex-wrap items-center gap-2 sm:justify-between`,children:[(0,Q.jsx)(I,{variant:`ghost`,size:`sm`,className:`text-danger`,disabled:!!c,"data-trust-discard":!0,onClick:()=>void T(),children:i(`custom-ui:importing.discard`)}),(0,Q.jsxs)(`span`,{className:`ml-auto flex gap-2`,children:[(0,Q.jsx)(I,{variant:`outline`,size:`sm`,disabled:!!c,onClick:n,children:i(`custom-ui:studio.cancel`)}),(0,Q.jsx)(I,{size:`sm`,disabled:!!c||!h?.manifest,"data-trust-confirm":!0,onClick:()=>void w(),children:i(`custom-ui:importing.trust`)})]})]})]})})}var Wn=864e5;function Gn({enabled:e,lifecycle:t,onRestored:n,className:r}){let{t:i,language:a}=u(),o=cn(e),[s,c]=(0,Z.useState)(!1),[l,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(null);if(!e)return null;let m=o.data?.entries??[],h=async e=>{d(e.entry);let r=await t.restoreTrash(e);d(``),r&&(c(!1),n?.(r.component))},g=async()=>{if(!f)return;d(f.entry);let e=await t.purgeTrash(f);d(``),e&&p(null)},_=e=>{if(!e.expiresAt)return i(`custom-ui:trash.keptLegacy`);let t=Math.max(0,Math.ceil((Date.parse(e.expiresAt)-Date.now())/Wn));return i(`custom-ui:trash.expiresIn`,{count:t})};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(I,{size:`xs`,variant:`ghost`,"data-component-trash":!0,className:r,onClick:()=>c(!0),children:[(0,Q.jsx)(j,{}),i(`custom-ui:trash.button`),m.length>0&&(0,Q.jsx)(`span`,{className:`tabular-nums`,children:m.length})]}),(0,Q.jsx)(W,{open:s,onOpenChange:e=>!l&&c(e),children:(0,Q.jsxs)(B,{size:`wide`,scrollMode:`body`,"data-trash-dialog":!0,children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:i(`custom-ui:trash.title`)}),(0,Q.jsx)(z,{children:i(`custom-ui:trash.hint`,{days:o.data?.retentionDays??7})})]}),(0,Q.jsx)(He,{className:`-mx-4 border-t border-stroke`,children:o.isPending?(0,Q.jsx)(`p`,{className:`p-4 text-sm text-content-muted`,children:i(`custom-ui:trash.loading`)}):o.error?(0,Q.jsx)(`p`,{className:`p-4 text-sm text-content-muted`,children:i(`custom-ui:trash.failed`)}):m.length?(0,Q.jsx)(`ul`,{className:`flex flex-col`,children:m.map(e=>(0,Q.jsxs)(`li`,{"data-trash-entry":e.entry,className:`flex min-w-0 items-center gap-3 border-b border-stroke px-4 py-2.5 last:border-b-0`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1.5 text-sm`,children:[(0,Q.jsx)(`strong`,{className:`min-w-0 truncate font-medium`,children:e.name}),e.version&&(0,Q.jsxs)(`span`,{className:`flex-none font-mono text-xs text-content-muted`,children:[`v`,e.version]})]}),(0,Q.jsx)(`span`,{className:`truncate text-xs text-content-muted`,children:[e.reason===`legacy-retired`?i(`custom-ui:trash.legacyRetired`):i(`custom-ui:trash.deletedAt`,{time:ze(e.deletedAt,a)}),e.instances?i(`custom-ui:trash.instances`,{count:e.instances}):``,_(e)].filter(Boolean).join(` · `)})]}),e.kind===`native`&&(0,Q.jsx)(I,{size:`xs`,variant:`secondary`,disabled:!!l,"data-trash-restore":e.entry,onClick:()=>void h(e),children:i(`custom-ui:trash.restore`)}),(0,Q.jsx)(I,{size:`xs`,variant:`ghost`,className:`text-danger`,disabled:!!l,"data-trash-purge":e.entry,onClick:()=>p(e),children:i(`custom-ui:trash.purge`)})]},e.entry))}):(0,Q.jsx)(`p`,{className:`p-4 text-sm text-content-muted`,children:i(`custom-ui:trash.empty`)})})]})}),(0,Q.jsx)(W,{open:!!f,onOpenChange:e=>!e&&!l&&p(null),children:(0,Q.jsxs)(B,{size:`compact`,surface:`confirmation`,children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:i(`custom-ui:trash.purgeTitle`,{name:f?.name??``})}),(0,Q.jsx)(z,{children:i(`custom-ui:trash.purgeHint`)})]}),(0,Q.jsxs)(H,{children:[(0,Q.jsx)(I,{variant:`outline`,disabled:!!l,onClick:()=>p(null),children:i(`custom-ui:studio.cancel`)}),(0,Q.jsx)(I,{variant:`destructive`,disabled:!!l,"data-trash-purge-confirm":!0,onClick:()=>void g(),children:i(`custom-ui:trash.purgeConfirm`)})]})]})})]})}function Kn(e){let t=et(),[n,r]=(0,Z.useState)(()=>t.read(e));return(0,Z.useEffect)(()=>(r(t.read(e)),t.subscribe(n=>{n===e&&r(t.read(e))})),[t,e]),n}function qn(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleTimeString(void 0,{hour12:!1})}function Jn({at:e,level:t,kind:n,message:r,stack:i}){return(0,Q.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-0.5 border-b border-stroke px-3 py-2 last:border-b-0`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2 font-mono text-xs`,children:[(0,Q.jsx)(`span`,{className:`flex-none text-content-muted tabular-nums`,children:qn(e)}),(0,Q.jsx)(`span`,{className:F(`flex-none uppercase`,t===`error`?`text-st-fail font-medium`:`text-content-muted`),children:t}),(0,Q.jsx)(`span`,{className:`flex-none text-content-muted`,children:n}),(0,Q.jsx)(`span`,{className:`min-w-0 break-all text-content`,children:r})]}),i&&(0,Q.jsx)(`pre`,{className:`max-h-28 overflow-auto font-mono text-xs whitespace-pre-wrap text-content-muted`,children:i})]})}function Yn({componentId:e,errors:t,errorsFailed:n}){let{t:r}=u(),i=et(),a=Kn(e),o=t?.entries??[];return(0,Q.jsxs)(`div`,{"data-studio-logs":!0,className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3 overflow-y-auto`,children:[(0,Q.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsxs)(`header`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-xs font-medium text-content-secondary`,children:r(`custom-ui:studio.logsLocal`)}),a.length>0&&(0,Q.jsx)(I,{size:`xs`,variant:`ghost`,onClick:()=>i.clear(e),children:r(`custom-ui:studio.logsClear`)})]}),a.length?(0,Q.jsx)(`ul`,{className:`overflow-hidden rounded-[var(--r-md)] border border-stroke bg-panel`,children:[...a].reverse().map((e,t)=>(0,Q.jsx)(Jn,{...e},`${e.at}:${t}`))}):(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:r(`custom-ui:studio.logsLocalEmpty`)})]}),(0,Q.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsxs)(`h3`,{className:`text-xs font-medium text-content-secondary`,children:[r(`custom-ui:studio.logsRuntime`),t&&t.dropped>0&&(0,Q.jsx)(`span`,{className:`ml-2 font-normal text-content-muted`,children:r(`custom-ui:studio.logsDropped`,{count:t.dropped})})]}),n?(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:r(`custom-ui:studio.logsRuntimeFailed`)}):o.length?(0,Q.jsx)(`ul`,{"data-studio-runtime-logs":!0,className:`overflow-hidden rounded-[var(--r-md)] border border-stroke bg-panel`,children:[...o].reverse().map((e,t)=>(0,Q.jsx)(Jn,{...e},`${e.at}:${t}`))}):(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:r(`custom-ui:studio.logsRuntimeEmpty`)})]})]})}function Xn(e,t){let n=d(),r=f({queryKey:_.errors(e),queryFn:({signal:t})=>b(e,t),enabled:t,retry:!1,refetchInterval:15e3,refetchOnWindowFocus:!1});return(0,Z.useEffect)(()=>{if(!t)return;let r=null,i=et().subscribe(t=>{t===e&&r===null&&(r=window.setTimeout(()=>{r=null,n.invalidateQueries({queryKey:_.errors(e)})},800))});return()=>{i(),r!==null&&window.clearTimeout(r)}},[n,e,t]),r}var Zn=new Map;function Qn({sessionId:e,onOpen:t}){let{t:n}=u(),r=Re({doneWindow:`today`}).all.find(t=>t.id===e)?.lane,i=n(r===`running`?`custom-ui:agent.statusRunning`:r===`attention`?`custom-ui:agent.statusAttention`:r===`queued`?`custom-ui:agent.statusQueued`:r===`done`?`custom-ui:agent.statusDone`:`custom-ui:agent.statusSent`);return(0,Q.jsxs)(`span`,{"data-component-agent-status":r??`sent`,className:`flex min-w-0 items-center gap-1.5 text-xs text-content-muted`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:F(`size-1.5 flex-none rounded-full`,r===`attention`?`bg-st-attn`:r===`running`?`bg-st-run`:`bg-st-done`)}),(0,Q.jsx)(`span`,{className:`truncate`,children:i}),(0,Q.jsxs)(I,{size:`xs`,variant:`ghost`,"data-component-agent-open":e,className:`flex-none`,onClick:t,children:[n(`custom-ui:agent.openSession`),(0,Q.jsx)(D,{})]})]})}function $n({row:e,notify:t,autoFocus:n=!1,onSent:r,className:a}){let{t:o,language:c}=u(),l=i(),d=(0,Z.useId)(),p=f(v()),m=on(e.id,p.data?.features.versions===!0).data?.current,h=m?.source===`agent`?m:null,g=Et(t),{pending:_,sessionId:y}=pt(e.id),[b,x]=(0,Z.useState)(()=>Zn.get(e.id)??``),S=t=>{t?Zn.set(e.id,t):Zn.delete(e.id),x(t)},C=b.trim(),w=async()=>{if(!C||_)return;let t=await g.generate(e,C);t&&(S(``),r?.(t))};return(0,Q.jsxs)(`form`,{"data-component-prompt":e.id,className:F(`flex flex-col gap-2 rounded-[var(--r-lg)] border border-stroke bg-panel p-3`,a),onSubmit:e=>{e.preventDefault(),w()},children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`label`,{htmlFor:d,className:`mr-auto text-xs font-medium text-content-secondary`,children:o(`custom-ui:agent.promptTitle`)}),m&&(0,Q.jsx)(Ve,{asChild:!0,size:`sm`,className:`hover:bg-solid hover:text-content-secondary`,children:(0,Q.jsx)(`span`,{"data-prompt-base":m.n,children:o(`custom-ui:agent.basedOn`,{n:m.n})})})]}),(0,Q.jsx)(Ue,{id:d,autoFocus:n,rows:2,value:b,maxLength:Ct,placeholder:o(`custom-ui:agent.promptPlaceholder`),"aria-keyshortcuts":`Meta+Enter Control+Enter`,"data-component-prompt-input":!0,className:`max-h-40 min-h-14 resize-none`,onChange:e=>S(e.target.value),onKeyDown:e=>{e.key!==`Enter`||!(e.metaKey||e.ctrlKey)||e.nativeEvent.isComposing||(e.preventDefault(),w())}}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[y?(0,Q.jsx)(Qn,{sessionId:y,onOpen:()=>l(s(y))}):(0,Q.jsx)(`span`,{className:`text-xs text-content-muted`,children:o(`custom-ui:agent.promptHint`)}),(0,Q.jsxs)(I,{type:`submit`,size:`sm`,disabled:!C||_,"aria-keyshortcuts":`Meta+Enter Control+Enter`,"data-component-generate":!0,className:`ml-auto`,children:[_&&(0,Q.jsx)(Oe,{}),o(_?`custom-ui:agent.sending`:`custom-ui:agent.generate`),!_&&(0,Q.jsx)(ke,{className:`bg-transparent text-current`,children:Ae(`Mod+Enter`)})]})]}),h&&(0,Q.jsxs)(`div`,{"data-prompt-result":h.n,className:`flex min-w-0 flex-col gap-1`,children:[(0,Q.jsx)(`p`,{className:`truncate text-xs text-content-muted`,children:[o(`custom-ui:agent.generatedVersion`,{n:h.n}),h.files.length?o(`custom-ui:agent.wrote`,{files:h.files.map(e=>e.path).join(` `)}):``,o(`custom-ui:versions.sourceAgent`),h.at?ze(h.at,c):``].filter(Boolean).join(` · `)}),(0,Q.jsx)(pn,{version:h})]})]})}var $=`manifest.json`,er=/\.(?:m?js|css|json|svg|txt|md)$/i;function tr(e){return/\.m?js$/i.test(e)?`javascript`:/\.css$/i.test(e)?`css`:/\.json$/i.test(e)?`json`:/\.svg$/i.test(e)?`xml`:`text`}function nr({row:e}){let{t}=u(),n=f({queryKey:_.describe(e.id),queryFn:({signal:t})=>h(e.id,t),retry:!1,refetchOnWindowFocus:!1}),r=(n.data?.files??[]).map(e=>e.path).filter(e=>e===$||er.test(e)&&e.split(`/`).length<=3),i=[...r.filter(t=>t===e.entry),...r.filter(t=>t!==e.entry)],[a,o]=(0,Z.useState)(``),s=i.includes(a)?a:i[0]??``;(0,Z.useEffect)(()=>o(``),[e.id]);let c=f({queryKey:[..._.describe(e.id),`source`,e.rev??``,s],queryFn:({signal:t})=>m(e.id,e.rev??``,s,t),enabled:!!(s&&s!==$&&e.rev),retry:!1,refetchOnWindowFocus:!1,staleTime:1/0});if(n.isPending)return(0,Q.jsx)(`p`,{className:`p-4 text-sm text-content-muted`,children:t(`custom-ui:studio.sourceLoading`)});if(n.error||!i.length)return(0,Q.jsx)(R,{className:`flex-1`,title:t(`custom-ui:studio.sourceUnavailable`)});let l=JSON.stringify(e.manifest??{errors:e.errors},null,2),d=s===$?l:c.data===void 0?``:c.data;return(0,Q.jsxs)(`div`,{"data-studio-source":!0,className:`flex min-h-0 min-w-0 flex-1 flex-col gap-2`,children:[(0,Q.jsx)(`div`,{role:`group`,"aria-label":t(`custom-ui:studio.sourceFiles`),className:`flex flex-none flex-wrap gap-1`,children:i.map(e=>(0,Q.jsx)(Ve,{size:`sm`,"aria-pressed":e===s,"data-studio-source-file":e,className:`font-mono`,onClick:()=>o(e),children:e},e))}),s===$&&(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:t(`custom-ui:studio.sourceManifestHint`)}),s!==$&&!e.rev?(0,Q.jsx)(R,{className:`flex-1`,title:t(`custom-ui:studio.sourceNotReady`)}):c.error&&s!==$?(0,Q.jsx)(R,{className:`flex-1`,title:t(`custom-ui:studio.sourceUnavailable`)}):(0,Q.jsx)(Mn,{code:d,language:tr(s),"data-studio-source-code":s,className:`min-h-0 flex-1 overflow-auto bg-code [&>div]:h-full`,children:(0,Q.jsx)(Nn,{"aria-label":t(`custom-ui:studio.copySource`),title:t(`custom-ui:studio.copySource`),className:`absolute top-1.5 right-1.5`})})]})}function rr(e){let[t,n]=(0,Z.useState)(null);return(0,Z.useEffect)(()=>(n(null),p(t=>{t.id===e&&t.reason===`files`&&n(Date.now())})),[e]),t}function ir({at:e}){let{t}=u(),[n,r]=(0,Z.useState)(()=>Date.now());(0,Z.useEffect)(()=>{let e=window.setInterval(()=>r(Date.now()),1e3);return()=>window.clearInterval(e)},[]);let i=Math.max(0,Math.round((n-e)/1e3));return(0,Q.jsxs)(`span`,{"data-studio-reloaded":!0,className:`flex items-center gap-1.5 text-xs text-content-muted`,children:[(0,Q.jsxs)(`span`,{"aria-hidden":!0,className:`relative flex size-1.5 flex-none`,children:[(0,Q.jsx)(`span`,{className:`absolute inset-0 rounded-full bg-content-muted animate-[ping_700ms_cubic-bezier(0,0,0.2,1)_1] [:root[data-motion=reduced]_&]:animate-none motion-reduce:[:root:not([data-motion=full])_&]:animate-none`},e),(0,Q.jsx)(`span`,{className:`relative size-1.5 rounded-full bg-content-muted`})]}),(0,Q.jsx)(`span`,{children:i<60?t(`custom-ui:studio.reloadedSeconds`,{count:i}):t(`custom-ui:studio.reloadedMinutes`,{count:Math.floor(i/60)})})]})}function ar({activeSessionId:e=``,row:t,tab:n,target:r,window:i,instanceId:a,draft:o,notify:s,commits:c,settingsButton:l,onTab:d,onTarget:f,onWindow:p}){let{t:m,language:h}=u(),g=t.kind===`native`&&t.status===`ready`&&!!(t.manifest&&t.rev),_=rr(t.id),v=Xn(t.id,t.kind===`native`);return(0,Q.jsxs)(`section`,{"data-studio-workbench":!0,"data-component-stage":t.id,"data-component-kind":t.kind,"aria-label":m(`custom-ui:studio.workbench`),className:`flex min-h-0 min-w-0 flex-col`,children:[(0,Q.jsxs)(`header`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2 border-b border-stroke px-5 py-3`,children:[(0,Q.jsxs)(`h2`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-base font-semibold`,children:J(t,h)}),t.version&&(0,Q.jsxs)(`span`,{className:`flex-none font-mono text-xs text-content-muted tabular-nums`,children:[`v`,t.version]})]}),_!==null&&(0,Q.jsx)(ir,{at:_}),(0,Q.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[(0,Q.jsx)(P,{size:`sm`,"aria-label":m(`custom-ui:studio.workbenchView`),value:n,onValueChange:d,options:[{value:`preview`,label:m(`custom-ui:studio.tabPreview`)},{value:`source`,label:m(`custom-ui:studio.tabSource`)},{value:`logs`,label:m(`custom-ui:studio.tabLogs`)}]}),l]})]}),(0,Q.jsxs)(`div`,{className:F(`flex min-h-0 flex-1 flex-col gap-3 px-5 pt-4 pb-3`),children:[t.kind===`native`&&(0,Q.jsx)($n,{row:t,notify:s,className:`flex-none`}),n===`source`?(0,Q.jsx)(nr,{row:t}):n===`logs`?(0,Q.jsx)(Yn,{componentId:t.id,errors:v.data,errorsFailed:!!v.error}):g?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Lt,{manifest:t.manifest,target:r,window:i,onTarget:f,onWindow:p}),(0,Q.jsx)(Rt,{activeSessionId:e,row:t,target:r,window:i,instanceId:a,title:o.title,props:o.props,notify:s,commits:c}),(0,Q.jsx)(zt,{componentId:t.id,errors:v.data,commits:c})]}):(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto`,children:[(0,Q.jsx)(Sn,{row:t}),(0,Q.jsx)(R,{className:`flex-1`,title:t.kind===`broken`?m(`custom-ui:studio.brokenTitle`):m(`custom-ui:studio.invalidTitle`),description:t.kind===`broken`?m(`custom-ui:studio.brokenHint`):m(`custom-ui:studio.invalidHint`)})]})]})]})}function or({onOpen:e}){let{t}=u();return(0,Q.jsxs)(I,{size:`sm`,variant:`secondary`,"data-studio-settings-open":!0,"aria-label":t(`custom-ui:studio.openSettings`),onClick:e,children:[(0,Q.jsx)(A,{}),t(`custom-ui:studio.settings`)]})}var sr=``,cr=[],lr=[],ur={import:!1,versions:!1,export:!1,trash:`none`,trashRestore:!1,usage:!1,revoke:!1};function dr({children:e}){let t=(0,Z.useRef)(null),n=Ge(t),r=n.measured&&n.width>=1360;return(0,Q.jsx)(X,{variant:`workbench`,children:(0,Q.jsx)(`div`,{ref:t,"data-component-studio":!0,"data-studio-settings-mode":r?`inline`:`drawer`,className:`h-full min-h-0`,children:e(r)})})}function fr(e){(0,Z.useLayoutEffect)(()=>{if(e)return Le.getState().enterRouteRail(),()=>Le.getState().leaveRouteRail()},[e])}function pr(e,t){let n=vt(),[r,i]=(0,Z.useState)(()=>n.version());(0,Z.useEffect)(()=>n.subscribe(()=>i(n.version())),[n]);let a=(0,Z.useRef)(new Map);return(0,Z.useEffect)(()=>{for(let t of e){let e=a.current.get(t.id);e&&t.rev&&e!==t.rev&&n.resume(`preview:${t.id}`),t.rev&&a.current.set(t.id,t.rev)}},[n,e]),(0,Z.useMemo)(()=>{let r=new Set;for(let i of e)(n.hasTrouble(`preview:${i.id}`,i.rev)||t.some(e=>e.componentId===i.id&&n.hasTrouble(e.instanceId,i.rev)))&&r.add(i.id);return r},[n,t,e,r])}function mr(e){if(typeof e!=`object`||!e)return``;let t=e.componentInstanceId;return typeof t==`string`&&t.length<=64?t:``}function hr(e,t,n){let[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)({id:``,instanceId:null}),[s,c]=(0,Z.useState)(`standard`),l=e?.id??``;(0,Z.useEffect)(()=>{!l||!n||(o({id:l,instanceId:n}),i(null))},[n,l]);let u=Ot(e?.manifest),d=e?t.filter(t=>t.componentId===e.id):[],f=e&&a.id===e.id?a.instanceId:void 0,p=f===null?null:f&&d.some(e=>e.instanceId===f)?f:d[0]?.instanceId??null,m=d.find(e=>e.instanceId===p)??null,h=e&&r?.id===e.id&&u.includes(r.target)?r.target:m&&u.includes(gt(m))?gt(m):u[0]??`feature-page`,g=`${e?.id??``}:${p??`preview`}`,[_,v]=(0,Z.useState)({key:``,title:``,props:{}}),y=(0,Z.useCallback)(e=>v({key:g,...e}),[g]);return{target:h,window:s,instanceId:p,draft:_.key===g?_:{title:m?.title??``,props:m?.props??{}},onPreview:y,setWindow:c,setTarget:t=>e&&i({id:e.id,target:t}),selectInstance:t=>{if(!e)return;o({id:e.id,instanceId:t});let n=d.find(e=>e.instanceId===t);n&&u.includes(gt(n))&&i({id:e.id,target:gt(n)})}}}function gr({activeSessionId:e=``,notify:t,selectedId:r=``,onSelect:i}){let{t:a,language:o}=u(),s=ee(),c=S(),l=x(),d=C().data?.instances??cr,f=Dt(t),p=dn(t),m=Et(t),[h,g]=(0,Z.useState)(``),[_,v]=(0,Z.useState)(!1),y=K(_),b=(0,Z.useMemo)(()=>kt(l.data?.components??[]),[l.data]),w=l.data?.root||``,T=l.data?.features??ur,E=T.trash===`move`,te=l.data?.staged??lr,[D,O]=(0,Z.useState)(`all`),[ne,re]=(0,Z.useState)(``),[ae,k]=(0,Z.useState)(`preview`),[oe,se]=(0,Z.useState)(!1),ce=K(oe),[le,ue]=(0,Z.useState)(0),[de]=(0,Z.useState)(It),fe=pr(b,d),A=s?b.find(e=>e.id===r)??null:jt(b,r,sr),pe=A?.id??``;(0,Z.useEffect)(()=>{pe&&(sr=pe)},[pe]);let j=hr(A,d,mr(n().state));fr(!s&&c&&!l.data?.legacyShape);let ge=e=>{k(`preview`),i(e,!0)},_e=async(e,n,r)=>{let c=await f.createFromTemplate(e,n);return c&&(O(`all`),re(``),i(c.id,!s),r?.trim()?m.generate(c,r):t(a(`custom-ui:studio.created`,{name:J(c,o)}))),c};if(!c||l.data?.legacyShape)return(0,Q.jsx)(X,{variant:`collection`,children:(0,Q.jsx)(L,{kind:`empty`,title:a(`custom-ui:studio.unsupportedTitle`),description:a(`custom-ui:studio.unsupportedHint`)})});if(l.isPending)return(0,Q.jsx)(L,{kind:`loading`,title:a(`custom-ui:customUiPage.loading`)});if(l.error&&!l.data)return(0,Q.jsx)(X,{variant:`collection`,children:(0,Q.jsx)(L,{kind:`error`,title:a(`custom-ui:widget.catalogFailed`),action:(0,Q.jsx)(I,{variant:`secondary`,size:`sm`,onClick:()=>void l.refetch(),children:a(`custom-ui:widget.retry`)})})});let ve=ft(b,fe),M={...ve,attention:ve.attention+te.length},ye=xt(b,{filter:D,query:ne,language:o,troubled:fe}),N=te.length>0&&D!==`enabled`,be=e=>N?te.map(t=>(0,Q.jsx)(Rn,{staged:t,phone:e,onReview:()=>g(t.stageId)},t.stageId)):null,xe=e=>(0,Q.jsx)(Ln,{enabled:T.import,lifecycle:p,className:e,onStaged:e=>g(e.stageId)}),Se=(0,Q.jsx)(Un,{stageId:h,lifecycle:p,onClose:()=>g(``),onTrusted:e=>{g(``),O(`all`),re(``),i(e.id,!s)}}),Ce=(0,Q.jsxs)(Q.Fragment,{children:[a(`custom-ui:customUiPage.emptyHint`),w&&(0,Q.jsx)(`code`,{className:`mx-auto mt-2 block max-w-full rounded-xs bg-inline-code px-2 py-1 font-mono text-xs break-all text-content-secondary`,children:w}),(0,Q.jsx)(`span`,{className:`mt-2 block`,children:a(`custom-ui:customUiPage.directoryLocationHint`)})]});if(s){let n=()=>i(``,!1);return r?(0,Q.jsx)(X,{variant:`collection`,children:(0,Q.jsxs)(`div`,{"data-components-phone":`detail`,className:`flex min-w-0 flex-col gap-4`,children:[(0,Q.jsxs)(I,{variant:`ghost`,className:`-ml-2 min-h-11 w-fit px-2 text-content-secondary`,onClick:n,children:[(0,Q.jsx)(ie,{"aria-hidden":`true`}),a(`custom-ui:phone.allComponents`)]}),A?(0,Q.jsxs)(`div`,{"data-component-stage":A.id,"data-component-kind":A.kind,className:`flex min-w-0 flex-col gap-5`,children:[(0,Q.jsx)(xn,{row:A,actions:f}),(0,Q.jsx)(Sn,{row:A}),A.kind===`native`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(I,{variant:`secondary`,"data-component-prompt-open":!0,className:`min-h-11 w-full`,onClick:()=>v(!0),children:[(0,Q.jsx)(me,{}),a(`custom-ui:agent.editWithPrompt`)]}),(0,Q.jsx)(Ie,{open:_,onOpenChange:v,children:(0,Q.jsxs)(Ne,{side:`bottom`,onCloseAutoFocus:y,"data-component-prompt-sheet":!0,className:`gap-0 rounded-t-[var(--r-lg)] p-0`,children:[(0,Q.jsxs)(je,{className:`px-4 pt-4 pb-0`,children:[(0,Q.jsx)(Pe,{children:J(A,o)}),(0,Q.jsx)(Fe,{className:`sr-only`,children:a(`custom-ui:agent.promptTitle`)})]}),(0,Q.jsx)(`div`,{className:`px-4 pt-3 pb-[max(16px,env(safe-area-inset-bottom))]`,children:(0,Q.jsx)($n,{row:A,notify:t,autoFocus:!0,className:`border-0 bg-transparent p-0`,onSent:()=>v(!1)})})]})})]}),A.kind===`native`&&A.status===`ready`&&A.manifest&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(Lt,{manifest:A.manifest,target:j.target,window:`standard`,phone:!0,onTarget:j.setTarget,onWindow:j.setWindow}),(0,Q.jsx)(Rt,{activeSessionId:e,row:A,target:j.target,window:`standard`,instanceId:j.instanceId,title:j.draft.title,props:j.draft.props,phone:!0,notify:t,commits:de},le)]}),(0,Q.jsx)(Cn,{row:A,instances:d,selectedInstanceId:j.instanceId,notify:t,actions:f,onSelectInstance:j.selectInstance,onPreview:j.onPreview}),(0,Q.jsx)(wn,{row:A,usageEnabled:T.usage,canRevoke:T.revoke,lifecycle:p}),(0,Q.jsx)(En,{row:A,instances:d,actions:f})]}),A.kind===`native`&&(0,Q.jsx)(hn,{row:A,enabled:T.versions,notify:t,actions:p}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[T.export&&A.kind===`native`&&(0,Q.jsx)(kn,{row:A,lifecycle:p,className:`min-h-11`}),E&&(0,Q.jsx)(On,{row:A,actions:f,variant:`button`,onDeleted:n})]})]}):(0,Q.jsx)(L,{kind:`empty`,title:a(`custom-ui:phone.missingTitle`),description:a(`custom-ui:phone.missingHint`),action:(0,Q.jsx)(I,{variant:`secondary`,className:`min-h-11`,onClick:n,children:a(`custom-ui:phone.allComponents`)})})]})}):(0,Q.jsxs)(X,{variant:`collection`,children:[(0,Q.jsxs)(`div`,{"data-components-phone":`list`,className:`flex min-w-0 flex-col gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`mr-auto text-sm font-medium text-content-secondary tabular-nums`,children:a(`custom-ui:customUiPage.installedComponents`,{count:b.length})}),xe(`min-h-11`),(0,Q.jsx)(Bt,{onCreate:_e,phone:!0,className:`min-h-11`})]}),N&&(0,Q.jsx)(`div`,{className:`flex flex-col gap-2`,children:be(!0)}),b.length?(0,Q.jsx)(`ul`,{className:`flex flex-col divide-y divide-stroke overflow-hidden rounded-[var(--r-lg)] border border-stroke bg-panel`,children:b.map(e=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(Wt,{row:e,instances:d,active:!1,phone:!0,onSelect:()=>i(e.id,!1)})},e.id))}):(0,Q.jsx)(R,{title:a(`custom-ui:customUiPage.emptyTitle`),description:Ce}),(0,Q.jsx)(Gn,{enabled:T.trashRestore,lifecycle:p,className:`min-h-11 w-fit`,onRestored:e=>i(e.id,!1)}),(0,Q.jsx)(`p`,{className:`text-xs leading-relaxed break-all text-content-muted`,children:a(`custom-ui:customUiPage.directoryHint`,{path:w})})]}),Se]})}let we=A&&(0,Q.jsx)(An,{row:A,instances:d,selectedInstanceId:j.instanceId,canDelete:E,features:T,notify:t,actions:f,lifecycle:p,onSelectInstance:j.selectInstance,onPreview:j.onPreview,onViewSource:()=>{k(`source`),se(!1)},onDeleted:()=>i(``,!0)},A.id);return(0,Q.jsx)(dr,{children:n=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{"data-studio-columns":!0,className:n?`grid h-full min-h-0 grid-cols-[284px_minmax(0,1fr)_372px]`:`grid h-full min-h-0 grid-cols-[284px_minmax(0,1fr)]`,children:[(0,Q.jsx)(Kt,{rows:ye,allCount:b.length,counts:M,instances:d,selectedId:A?.id??``,troubled:fe,filter:D,query:ne,root:w,onFilter:O,onQuery:re,onSelect:ge,onCreate:_e,importButton:xe(),staged:be(!1),footer:T.trashRestore?(0,Q.jsx)(`div`,{className:`flex flex-none border-t border-stroke px-2 py-1.5`,children:(0,Q.jsx)(Gn,{enabled:!0,lifecycle:p,onRestored:e=>i(e.id,!0)})}):void 0,onOpenLogs:e=>{i(e,!0),k(`logs`)},onRequestFix:(e,t)=>void m.fix(e,t),onReload:e=>{vt().resume(`preview:${e}`),ue(e=>e+1),k(`preview`),i(e,!0)}}),A?(0,Q.jsx)(ar,{activeSessionId:e,row:A,tab:ae,target:j.target,window:j.window,instanceId:j.instanceId,draft:j.draft,notify:t,commits:de,settingsButton:!n&&(0,Q.jsx)(or,{onOpen:()=>se(!0)}),onTab:k,onTarget:j.setTarget,onWindow:j.setWindow},`${A.id}#${le}`):(0,Q.jsx)(R,{className:`min-h-0`,title:b.length?a(`custom-ui:phone.missingTitle`):a(`custom-ui:customUiPage.emptyTitle`),description:b.length?a(`custom-ui:phone.missingHint`):Ce}),n&&A&&(0,Q.jsx)(`aside`,{"aria-label":a(`custom-ui:studio.settings`),className:`flex min-h-0 min-w-0 flex-col border-l border-stroke`,children:we})]}),!n&&(0,Q.jsx)(Ie,{open:oe&&!!A,onOpenChange:se,children:(0,Q.jsxs)(Ne,{side:`right`,showCloseButton:!1,onCloseAutoFocus:ce,"data-studio-settings-drawer":!0,className:`w-[372px] max-w-[calc(100vw-48px)] gap-0 p-0 sm:max-w-[372px]`,children:[(0,Q.jsxs)(je,{className:`flex-row items-center justify-between border-b border-stroke px-4 py-2.5`,children:[(0,Q.jsx)(Pe,{className:`text-sm`,children:a(`custom-ui:studio.settings`)}),(0,Q.jsx)(Fe,{className:`sr-only`,children:a(`custom-ui:studio.settingsHint`)}),(0,Q.jsx)(I,{size:`icon-sm`,variant:`ghost`,"aria-label":a(`custom-ui:studio.closeSettings`),onClick:()=>se(!1),children:(0,Q.jsx)(he,{})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:we})]})}),Se]})})}function _r({activeSessionId:e,component:t,instance:n,notify:r}){let i=bt(t,r);return(0,Q.jsx)(w,{component:t,instance:{instanceId:n.instanceId,surface:`feature-page`,title:n.title,props:n.props},session:e?{id:e,title:``,cwd:``,status:`idle`}:void 0,notify:e=>r(e),onRequestFix:i,className:`h-full`})}function vr({componentId:e,activeSessionId:t=``,notify:n}){let{t:i}=u(),a=T(`feature-page`),o=a.placed.find(t=>t.component.id===e),s=c(e);return(0,Q.jsx)(X,{variant:`workbench`,children:(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex min-h-11 shrink-0 flex-wrap items-center gap-1 border-b border-stroke-soft px-2 py-1.5`,children:[o&&(0,Q.jsx)(`strong`,{className:`min-w-0 flex-1 truncate px-1 text-sm font-medium`,children:o.instance.title||o.component.manifest?.name||o.component.name}),(0,Q.jsx)(I,{variant:`ghost`,size:`sm`,className:`ml-auto max-[650px]:h-11`,asChild:!0,children:(0,Q.jsxs)(r,{to:l.components,children:[(0,Q.jsx)(A,{}),i(`custom-ui:tool.openSettings`)]})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden`,"data-feature-page-host":e,children:o?(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(L,{kind:`loading`,title:i(`custom-ui:customUiPage.loading`)}),children:(0,Q.jsx)(_r,{activeSessionId:t,component:o.component,instance:o.instance,notify:n},o.instance.instanceId)}):a.isLoading?(0,Q.jsx)(L,{kind:`loading`,title:i(`custom-ui:customUiPage.loading`)}):a.error?(0,Q.jsx)(L,{kind:`error`,title:i(`custom-ui:widget.catalogFailed`),action:(0,Q.jsx)(I,{variant:`secondary`,onClick:a.refetch,children:i(`custom-ui:widget.retry`)})}):(0,Q.jsx)(L,{kind:`empty`,title:i(`custom-ui:tool.notPlacedTitle`),description:i(`custom-ui:tool.notPlacedHint`),action:(0,Q.jsx)(I,{variant:`secondary`,asChild:!0,children:(0,Q.jsx)(r,{to:s,children:i(`custom-ui:tool.openInStudio`)})})})})]})})}export{gr as CustomUiPage,vr as CustomUiToolPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./useSessionListQuery-D44XZfGr.js";import"./useNow-Bxn4_OW9.js";import"./useFleetSystemInfo-Bd8zJIFa.js";import"./useSidebarModel-CWED0rsw.js";import"./new-task-C3wuHTor.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./QuickPromptIdeas-Cd3SwBqS.js";import"./FocusRuntimeControls-C7NIdpV4.js";import{t as e}from"./chat-api-DkdyVQY9.js";import"./session-change-summary-api-DgRT32uh.js";var t=t=>e.getWorkspaceCommands(t);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.rb-shiny-text{background:linear-gradient(110deg, var(--text) 0%, var(--text) 38%, var(--star-strong) 48%, var(--brand-blue-strong) 52%, var(--text) 62%, var(--text) 100%);color:#0000;-webkit-text-fill-color:transparent;animation:rb-shiny-text 1.2s var(--ease-out) 1;background-size:240% 100%;-webkit-background-clip:text;background-clip:text;display:inline-block}@keyframes rb-shiny-text{0%{background-position:120%}to{background-position:-120%}}.rb-blur-text{display:inline}.rb-blur-text-word{opacity:0;filter:blur(8px);animation:rb-blur-text .55s var(--ease-out) forwards;animation-delay:var(--rb-delay,0s);display:inline-block;transform:translateY(5px)}@keyframes rb-blur-text{to{opacity:1;filter:blur();transform:translateY(0)}}.rb-spotlight-card{--rb-spotlight-x:50%;--rb-spotlight-y:50%;isolation:isolate;position:relative;overflow:hidden}.rb-spotlight-card:before{z-index:0;background:radial-gradient(circle, color-mix(in srgb, var(--brand-blue) 14%, transparent), transparent 68%);content:"";opacity:0;pointer-events:none;width:260px;height:260px;transform:translate(calc(var(--rb-spotlight-x) - 50%), calc(var(--rb-spotlight-y) - 50%));transition:opacity var(--d1) var(--ease-out);border-radius:50%;position:absolute}.rb-spotlight-card:hover:before{opacity:1}.rb-spotlight-card>*{z-index:1;position:relative}.rb-animated-list-item,.rb-animated-list-item>*{width:100%}.rb-click-spark{display:inline-flex;position:relative}.rb-click-spark-burst{z-index:20;pointer-events:none;width:1px;height:1px;position:absolute}.rb-click-spark-burst i{--rb-spark-angle:0deg;border-radius:var(--r-pill);background:var(--star-strong);width:7px;height:1.5px;box-shadow:0 0 5px color-mix(in srgb, var(--star) 55%, transparent);transform:rotate(var(--rb-spark-angle)) translateX(3px) scaleX(.4);transform-origin:0;animation:rb-click-spark .48s var(--ease-out) forwards;position:absolute;top:0;left:0}@keyframes rb-click-spark{0%{opacity:0;transform:rotate(var(--rb-spark-angle)) translateX(2px) scaleX(.2)}22%{opacity:1}to{opacity:0;transform:rotate(var(--rb-spark-angle)) translateX(17px) scaleX(1)}}.rb-aurora{pointer-events:none;position:absolute;inset:0;overflow:hidden}.rb-aurora i{opacity:.16;background:radial-gradient(currentColor 0%,#0000 72%);border-radius:50%;width:42%;height:74%;position:absolute}.rb-aurora i:first-child{color:var(--brand-blue);top:2%;left:8%;transform:translate(-6%,-3%)scale(.92)rotate(-8deg)}.rb-aurora i:nth-child(2){color:var(--star);bottom:0;right:5%;transform:translate(9%,6%)scale(1.12)rotate(10deg)}.rb-aurora i:nth-child(3){color:var(--success);opacity:.08;top:30%;left:38%;transform:rotate(4deg)}.rb-threads{pointer-events:none;width:100%;height:100%;position:absolute;inset:0;overflow:visible}.rb-threads path{fill:none;stroke:color-mix(in srgb, var(--brand-blue) 34%, var(--stroke-soft));stroke-width:1.1px;stroke-dasharray:9 13;vector-effect:non-scaling-stroke;animation:6s linear infinite rb-threads}@keyframes rb-threads{to{stroke-dashoffset:-44px}}.rb-ascii-text{width:min(430px,100%);height:88px;color:color-mix(in srgb, var(--star-strong) 72%, var(--text));filter:drop-shadow(0 0 9px color-mix(in srgb, var(--star) 22%, transparent));opacity:.88;display:block}.rb-target-cursor{isolation:isolate;position:relative}.rb-target-cursor-dot,.rb-target-cursor-frame{z-index:8;pointer-events:none;opacity:0;will-change:transform;position:absolute;top:0;left:0}.rb-target-cursor-dot{border:1px solid color-mix(in srgb, var(--solid) 86%, transparent);background:var(--star-strong);width:6px;height:6px;box-shadow:0 0 9px color-mix(in srgb, var(--star) 45%, transparent);border-radius:50%;margin:-3px 0 0 -3px;transition:opacity 90ms linear}.rb-target-cursor-frame{transition:width .18s var(--ease-out), height .18s var(--ease-out), transform .18s var(--ease-out), opacity .12s linear}.rb-target-cursor-dot[data-visible=true],.rb-target-cursor-frame[data-visible=true]{opacity:.82}.rb-target-cursor-frame i{border-color:var(--star-strong);width:8px;height:8px;filter:drop-shadow(0 0 4px color-mix(in srgb, var(--star) 35%, transparent));border-style:solid;position:absolute}.rb-target-cursor-frame i:first-child{border-width:1px 0 0 1px;top:0;left:0}.rb-target-cursor-frame i:nth-child(2){border-width:1px 1px 0 0;top:0;right:0}.rb-target-cursor-frame i:nth-child(3){border-width:0 1px 1px 0;bottom:0;right:0}.rb-target-cursor-frame i:nth-child(4){border-width:0 0 1px 1px;bottom:0;left:0}@media (pointer:coarse){.rb-shiny-text{color:inherit;-webkit-text-fill-color:currentColor;background:0 0;animation:none}.rb-target-cursor-dot,.rb-target-cursor-frame{display:none}}@media (prefers-reduced-motion:reduce){.rb-shiny-text,.rb-blur-text-word,.rb-click-spark-burst i,.rb-aurora i,.rb-threads path{animation:none}.rb-target-cursor-dot,.rb-target-cursor-frame{display:none}.rb-ascii-text{filter:none;opacity:.64}.rb-shiny-text{color:inherit;-webkit-text-fill-color:currentColor;background:0 0}.rb-blur-text-word{opacity:1;filter:none;transform:none}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.freeze({board:`/board`,session:`/board/new`,more:`/more`,chat:`/chat`,chatHistory:`/chat/history`,assets:`/assets`,channels:`/channels`,schedules:`/schedules`,plugins:`/plugins`,memory:`/memory`,mcp:`/mcp`,skills:`/skills`,components:`/components`,workflows:`/workflows`,workflowCreate:`/workflows/new`,customComponentTool:`/tools/components`,config:`/config/models`}),t=`/config`,n=new Set(Object.keys(e)),r=new Map(Object.entries(e).map(([e,t])=>[t,e]));function i(t){return e[t]||`/`}var a=Object.freeze({navOrigin:`home`});function o(e){return typeof e==`object`&&!!e&&e.navOrigin===a.navOrigin}function s(e){let t=e.length>1?e.replace(/\/+$/,``):e;return t===`/`||/^\/board\/[^/]+$/.test(t)?`session`:/^\/workflows\/[^/]+$/.test(t)?`workflowCreate`:/^\/tools\/components\/[^/]+$/.test(t)?`customComponentTool`:/^\/components\/[^/]+$/.test(t)?`components`:/^\/config(?:\/[^/]+)?$/.test(t)?`config`:r.get(t)||null}function c(e=`new`){return`/board/${encodeURIComponent(e||`new`)}`}function l(e){let t=/^\/board\/([^/]+)\/?$/.exec(e);if(!t)return``;try{return decodeURIComponent(t[1])}catch{return``}}function u(e,t){let n=l(e);return n?n===`new`?``:n:t}function d(e=``){return e?`/components/${encodeURIComponent(e)}`:`/components`}function f(e=`new`){return`/workflows/${encodeURIComponent(e||`new`)}`}function p(e){let t=String(e||``).replace(/^#/,``);return t===`session`?null:n.has(t)?i(t):null}export{u as a,p as c,l as d,c as f,t as i,s as l,n,d as o,f as p,e as r,o as s,a as t,i as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={version:0,profile:`desktop`,engine:`node`,degraded:!1,modules:{childProcess:!0,workerThreads:!0,sqlite:!0,wasm:!0},features:{chat:!0,sessions:!0,providers:!0,filesystem:!0,assets:!0,skills:!0,webSearch:!0,visualGeneration:!0,imageProcessing:!0,imageAssets:!0,processes:!0,shell:!0,terminal:!0,vcs:!0,memory:!0,workers:!0,plugins:!0,mcp:!0,goals:!0,plans:!0,multiAgent:!0,channels:!0,workflows:!0,schedules:!0,computerUse:!0,browserAutomation:!0,remoteAccess:!0,desktopPet:!0,"board.view":!1,"board.events":!1,askUser:!1,sessionQueue:!1,sessionExport:!1,workspaceFolders:!1,codemode:!1,"components.native":!1},tools:[]};function t(e,t){return e.features[t]!==!1}var n={assets:`assets`,channels:`channels`,schedules:`schedules`,memory:`memory`,mcp:`mcp`,skills:`skills`,workflows:`workflows`,workflowCreate:`workflows`},r={"desktop-pet":`desktopPet`,"remote-access":`remoteAccess`};function i(e,r){let i=n[r];return!i||t(e,i)}function a(e,n){let i=r[n];return!i||t(e,i)}function o(e,t,{mobileApp:n}){return t===`mobile-server`?n?{supported:!0}:{supported:!1,reason:`mobile-only`}:n?{supported:!1,reason:`desktop-only`}:a(e,t)?{supported:!0}:{supported:!1,reason:`runtime`}}export{i as a,t as i,o as n,a as r,e as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./index-CsE52ydO.js";var t=`pisper-components-safe-mode`;function n(){try{return e.getItem(t)!==null}catch{return!1}}export{n,t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e=``){let t=e.trim().replace(/\\/g,`/`),n=/^\/+$/u.test(t)?`/`:t.replace(/\/+$/,``);return/^[A-Za-z]:(?:\/|$)/.test(n)?n.toLowerCase():n}function t(t){return!t.projectless&&e(t.cwd)||`\0`}function n(e){return t(e)===`\0`?``:e.cwd||``}function r(e){let r=new Map;for(let i of e){let e=t(i),a=r.get(e)||{key:e,cwd:n(i),sessions:[]};a.sessions.push(i),r.set(e,a)}return[...r.values()]}function i(t){return Array.isArray(t)?[...new Set(t.filter(e=>typeof e==`string`).map(e))].filter(e=>e===`\0`||e.length>0&&!e.includes(`\0`)):[]}function a(e,t){return i([...e,...t])}function o(e,t,n,r){let o=a(e,t),s=new Set(i(t)),c=o.filter(e=>s.has(e)),l=c.indexOf(n),u=c[l+r];return l<0||u===void 0?o:o.map(e=>e===n?u:e===u?n:e)}function s(e,n){return e.filter(e=>t(e)===n)}function c(e,t,n,r){return!e||!n.has(e)&&(!r||t.some(t=>t.id===e))?null:t[0]?.id||``}async function l(e,t){let n=[];for(let r of e)try{await t(r),n.push(r)}catch(e){return{deletedIds:n,failedId:r,error:e}}return{deletedIds:n,failedId:null,error:null}}export{a,t as c,i,s as l,r as n,c as o,o as r,n as s,l as t,e as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./runtime-capabilities-4_ZwLBqF.js";import{t as n}from"./createLucideIcon-Cd-3GVxJ.js";import{t as r}from"./bell-BjONAtgH.js";import{t as i}from"./bot-B3TaBp_T.js";import{t as a}from"./info-DATxy0fb.js";import{t as o}from"./monitor-ORxecA9m.js";import{t as s}from"./refresh-cw-TbWxTY4K.js";var c=n(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),l=Object.freeze([`models`,`interface`,`notifications`,`shortcuts`,`updates`,`about`]),u=new Set([`remote-access`,`mobile-server`,`desktop-pet`]),d=new Set([...l,...u]);function f(e){return l.includes(e)}function p(e,t){return e===`config`&&!u.has(t)}var m={models:i,interface:o,notifications:r,shortcuts:c,updates:s,about:a};function h(e,t){switch(t){case`interface`:return e(`config:configPage.interface`);case`notifications`:return e(`config:configPage.notifications`);case`shortcuts`:return e(`config:configPage.shortcuts`);case`updates`:return e(`config:configPage.appUpdates`);case`about`:return e(`config:configPage.about`);case`remote-access`:return e(`config:configPage.remoteAccess`);case`mobile-server`:return e(`config:configPage.mobileServer`);case`desktop-pet`:return e(`config:configPage.desktopPet`);default:return e(`config:configPage.models`)}}function g(e,t){switch(t){case`interface`:return e(`config:settingsShell.section.interface`);case`notifications`:return e(`config:settingsShell.section.notifications`);case`shortcuts`:return e(`config:settingsShell.section.shortcuts`);case`updates`:return e(`config:settingsShell.section.updates`);case`about`:return e(`config:settingsShell.section.about`);default:return e(`config:settingsShell.section.models`)}}function _(n,{capabilities:r=t}={}){return l.filter(t=>e(r,t)).map(e=>({section:e,label:g(n,e),icon:m[e]}))}export{p as a,f as i,h as n,g as o,_ as r,d as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-Cd-3GVxJ.js";var t=e(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]);export{t};
|