pisper 0.6.9 → 0.6.10
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/lib/npm-platform.mjs +0 -1
- package/lib/platform.mjs +2 -1
- package/package.json +6 -7
- package/web/.vite/manifest.json +943 -844
- package/web/assets/{AppDialog-DJZWnxzH.js → AppDialog-1E6olv_T.js} +1 -1
- package/web/assets/{AppOverlays-DICzFYsW.js → AppOverlays-BV_gIt77.js} +1 -1
- package/web/assets/AppSelect-BGVBQRP1.js +1 -0
- package/web/assets/AssetsPage-6HTR2IpQ.js +1 -0
- package/web/assets/{BoardPage-DKjz8Sj_.js → BoardPage-CL2e-8j4.js} +3 -3
- package/web/assets/BrandLogo-k3CvJjd4.js +1 -0
- package/web/assets/ChannelsPage-CmczBcSA.js +1 -0
- package/web/assets/{ChatAppearancePage-6Mq1uFuU.js → ChatAppearancePage-DMAnYGNb.js} +1 -1
- package/web/assets/{ChatHistoryPage-j-_vMM-M.js → ChatHistoryPage-DedOh6aO.js} +1 -1
- package/web/assets/ChatPage-b16p3qWl.js +553 -0
- package/web/assets/ConfigPage-BYB0rL_V.js +5 -0
- package/web/assets/{DesktopWindowControls-BOrn8KGA.js → DesktopWindowControls-DAuHMZFO.js} +1 -1
- package/web/assets/DispatchOverlay-CEbzXIct.js +1 -0
- package/web/assets/{FeaturePage-1MUXz3Y-.js → FeaturePage-BJGDVZ_u.js} +1 -1
- package/web/assets/{FileAttachmentPreview-B17OgdVi.js → FileAttachmentPreview-Cw5-ApIr.js} +1 -1
- package/web/assets/{FloatingWidgets-CcPNUEFB.js → FloatingWidgets-BQXBxVDd.js} +1 -1
- package/web/assets/FocusRuntimeControls-C7b1I2L5.js +1 -0
- package/web/assets/{GitDiffViewer-CSl-SGa1.js → GitDiffViewer-BAZTiiDo.js} +1 -1
- package/web/assets/{HoldToConfirmButton-CVyju89W.js → HoldToConfirmButton-BxdJ7icc.js} +1 -1
- package/web/assets/LaunchConsole-uKHKx4h0.js +2 -0
- package/web/assets/{ManageProjectsDialog-DSN8QUPg.js → ManageProjectsDialog-03d7p6Td.js} +1 -1
- package/web/assets/{MarkdownMessage-BPZcFjyR.js → MarkdownMessage-B_9d8KI-.js} +1 -1
- package/web/assets/McpPage-7NEAc3Rv.js +1 -0
- package/web/assets/MemoryPage-_mnn45jY.js +1 -0
- package/web/assets/{MobileNavigation-Cc4zcU3a.js → MobileNavigation-IXJN0OuM.js} +1 -1
- package/web/assets/{MorePage-B-qsYMAv.js → MorePage-DtqJlHAA.js} +1 -1
- package/web/assets/{PageHeader-mUKoAR30.js → PageHeader-6KRCT1j1.js} +1 -1
- package/web/assets/{PageState-aWHrkE1D.js → PageState-Cz6vFMXv.js} +1 -1
- package/web/assets/{PhoneDrawer-qES4OwMx.js → PhoneDrawer-Cp6X4_ei.js} +1 -1
- package/web/assets/{PhoneMenuButton-DEbqHUUP.js → PhoneMenuButton-Cl7FEYYw.js} +1 -1
- package/web/assets/{PhoneTopBar-CLPmKZ4Q.js → PhoneTopBar-CR1m9vf3.js} +1 -1
- package/web/assets/{PluginsPage-B53DParo.js → PluginsPage-CNddCaYt.js} +1 -1
- package/web/assets/{QuickPromptIdeas-gKobqAO3.js → QuickPromptIdeas-C7X4T7kx.js} +1 -1
- package/web/assets/{SafeModePrompt-Dlq8rlix.js → SafeModePrompt-jSCZVMGa.js} +1 -1
- package/web/assets/SchedulesPage-BRqBCtCf.js +1 -0
- package/web/assets/SessionBrowserPane-maCbfzXl.js +2 -0
- package/web/assets/SessionContextPanel-BSY6NaRx.js +2 -0
- package/web/assets/{SessionHome-CVdMY-bT.js → SessionHome-Wu8JWsto.js} +1 -1
- package/web/assets/SessionInspector-BRIFfuiZ.js +1 -0
- package/web/assets/{SessionShell-Vv2oGR0M.js → SessionShell-Dp94FUuk.js} +1 -1
- package/web/assets/{SettingsSidebar-cG_oKSWN.js → SettingsSidebar-CP1qDAcx.js} +1 -1
- package/web/assets/{ShortcutHelpDialog-C5KKKBZd.js → ShortcutHelpDialog-C5f_x4XG.js} +1 -1
- package/web/assets/{ShortcutKeys-zuzmq8eW.js → ShortcutKeys-Cx8hNJ62.js} +1 -1
- package/web/assets/{SidebarUpdateStatus-BXimwZ77.js → SidebarUpdateStatus-YxE_hT2l.js} +1 -1
- package/web/assets/{SkillsPage-AhmayxVl.js → SkillsPage-z6rTYJ8Z.js} +1 -1
- package/web/assets/TaskProcessesPane-yhEsHe1N.js +1 -0
- package/web/assets/TaskTerminalView-CT6V8AGR.js +18 -0
- package/web/assets/{TerminalPanel-wvzi7jBd.js → TerminalPanel-598uzwoB.js} +1 -1
- package/web/assets/{WebDesktopPet-qREBG08n.js → WebDesktopPet-D6bkGOwL.js} +1 -1
- package/web/assets/WorkflowsPage-DrltlXh1.js +1 -0
- package/web/assets/{WorkspacePicker-B68VTV5x.js → WorkspacePicker-DPwlN6KA.js} +1 -1
- package/web/assets/{api-DVgYxLec.js → api-45iTnFjN.js} +1 -1
- package/web/assets/{app-primitives-Cmdj4cIW.js → app-primitives-Drz_SjnR.js} +1 -1
- package/web/assets/{app-update-BEymQxyl.js → app-update-kStNhVOh.js} +1 -1
- package/web/assets/{approval-confirm-JevCpyyv.js → approval-confirm-CCo7v8Ln.js} +1 -1
- package/web/assets/{badge-Dk1N1mVf.js → badge-CWB3lj2H.js} +1 -1
- package/web/assets/{board-launch-CUV0KEKT.js → board-launch-YigjCnZf.js} +1 -1
- package/web/assets/board-messages-xFeTO3o6.js +1 -0
- package/web/assets/{board-projects-VBEGB9VD.js → board-projects-LnEYyP4h.js} +1 -1
- package/web/assets/{button-Bu_vuij9.js → button-CCcCN8tE.js} +1 -1
- package/web/assets/{chat-api-CQ9MShHZ.js → chat-api-BBuYjxwz.js} +1 -1
- package/web/assets/checkbox-BrEHgFV0.js +1 -0
- package/web/assets/client-store-CAhvptv1.js +1 -0
- package/web/assets/{collapsible-C__hRcbA.js → collapsible-DMaUQRX4.js} +1 -1
- package/web/assets/{config-search-ClE5BFDz.js → config-search-C1YtwJAQ.js} +1 -1
- package/web/assets/{dialog-Kx6RCn3A.js → dialog-2cmY5V75.js} +1 -1
- package/web/assets/{dist-Cfh4kzCK.js → dist-41X0pdUs.js} +1 -1
- package/web/assets/{dist-BdkTa5R3.js → dist-BHkR6BLP.js} +1 -1
- package/web/assets/dist-BRjj4UeB.js +1 -0
- package/web/assets/dist-BaBySQmo.js +1 -0
- package/web/assets/{dist-BlIIpW6W.js → dist-BiRPwy4W.js} +1 -1
- package/web/assets/{dist-B_a0oV4U.js → dist-BsRXXcSL.js} +1 -1
- package/web/assets/dist-DzGQ7sLi.js +1 -0
- package/web/assets/{dist-TksYpDID.js → dist-OB2r6Xsr.js} +1 -1
- package/web/assets/dist-V8chnW6-.js +1 -0
- package/web/assets/dropdown-menu-CFIFNaKO.js +1 -0
- package/web/assets/es2015-DTZdOI9P.js +41 -0
- package/web/assets/{events-ulSEiNKt.js → events-n27XPFgs.js} +1 -1
- package/web/assets/{field-Bnm9KAi2.js → field-DaxtcBBA.js} +1 -1
- package/web/assets/{hosts-B-POTAmu.js → hosts-CmK7Yt82.js} +1 -1
- package/web/assets/i18n-DfsxGeh5.js +1 -0
- package/web/assets/{index-C4CqzQNY.js → index-BDgCJ4Fs.js} +2 -2
- package/web/assets/index-CfTBR7Rs.css +2 -0
- package/web/assets/input-CPw-zkYh.js +1 -0
- package/web/assets/input-group-CDEyjyK4.js +1 -0
- package/web/assets/{label-BzlNatZM.js → label-CVWjEcfV.js} +1 -1
- package/web/assets/{launch-defaults-store-7CojCPDE.js → launch-defaults-store-CGeglXDI.js} +1 -1
- package/web/assets/model-display-kDwvtxrW.js +1 -0
- package/web/assets/mount-app-Bxa7xF8d.js +9 -0
- package/web/assets/{permission-rules-api-BQlSNrYK.js → permission-rules-api-BvKOF7rS.js} +1 -1
- package/web/assets/{pick-system-directory-BgN7vwKS.js → pick-system-directory-DSupTk88.js} +1 -1
- package/web/assets/placements--Zk5njsN.js +2 -0
- package/web/assets/{popover-DT3PkPcL.js → popover-BtcdIPRz.js} +1 -1
- package/web/assets/{progress-YhljaYNy.js → progress-5odAz3B9.js} +1 -1
- package/web/assets/public--8F2_oqP.js +1 -0
- package/web/assets/public-CgydVZuV.js +2 -0
- package/web/assets/public-components-CeIuV0FY.js +1 -0
- package/web/assets/public-diff-DWbitsnS.js +1 -0
- package/web/assets/public-launch-DtVwSANs.js +1 -0
- package/web/assets/run-activity-CwfO0cui.js +1 -0
- package/web/assets/{runtime-capabilities-store--7mKyYAM.js → runtime-capabilities-store-D1FwQXKw.js} +1 -1
- package/web/assets/{safe-mode-instance-fnZLVjjd.js → safe-mode-instance-TonxlRrq.js} +1 -1
- package/web/assets/safe-mode-sentinel-BG78O0yJ.js +1 -0
- package/web/assets/segmented-control-BlM_GKV6.js +1 -0
- package/web/assets/select-DD_WO-gs.js +1 -0
- package/web/assets/{separator-cVAjxx3U.js → separator-BPh_qxvc.js} +1 -1
- package/web/assets/{session-change-summary-api-3216hpjE.js → session-change-summary-api-B9M9m1C0.js} +1 -1
- package/web/assets/{session-home-CM2_V5SZ.js → session-home-BDT4lMMJ.js} +1 -1
- package/web/assets/{session-organization-api-KZqrJZdA.js → session-organization-api-BgCoIi2X.js} +1 -1
- package/web/assets/{session-scope-Bw40iOXx.js → session-scope-t_l7TRH5.js} +1 -1
- package/web/assets/{session-tree-actions-oMnZOFG4.js → session-tree-actions-7q68B3e-.js} +1 -1
- package/web/assets/{session-tree-summary-PpU7AyqE.js → session-tree-summary-CMgz9Uf-.js} +1 -1
- package/web/assets/{sheet-CASx5kBt.js → sheet-BTaIEX4w.js} +1 -1
- package/web/assets/{shortcuts-BOeaPAvF.js → shortcuts-BGzXmClx.js} +1 -1
- package/web/assets/{side-chat-context-BcCF9VZz.js → side-chat-context-D36twdWd.js} +7 -7
- package/web/assets/{sidebar-4xAUV3YP.js → sidebar-BIagLnrN.js} +2 -2
- package/web/assets/{sidebar-store-we4gMwQq.js → sidebar-store-DztdHlUn.js} +1 -1
- package/web/assets/slider-DTmAZl-R.js +1 -0
- package/web/assets/{speech-session-ClA_5hmd.js → speech-session-D0GE-Pym.js} +1 -1
- package/web/assets/{startup-queries--JqGB_Cp.js → startup-queries-BAWDaQY5.js} +1 -1
- package/web/assets/{switch-DRkmP9uM.js → switch-D_G8wFhs.js} +1 -1
- package/web/assets/tabs-DsgBuvJv.js +1 -0
- package/web/assets/{tooltip-EomUbN9-.js → tooltip-D4MFbqcG.js} +1 -1
- package/web/assets/{use-i18n-D2P6OO3w.js → use-i18n-CVZdp2ZN.js} +1 -1
- package/web/assets/use-mobile-DauOEda6.js +1 -0
- package/web/assets/{use-studio-actions-CIA2TwfZ.js → use-studio-actions-C4Zh15Vx.js} +2 -2
- package/web/assets/{useBoardItems-BU9aonpg.js → useBoardItems-DCo-4he0.js} +1 -1
- package/web/assets/{useFleetSystemInfo-BMpdQSqr.js → useFleetSystemInfo-BbQQId7X.js} +1 -1
- package/web/assets/{useNow-DAVNVxdo.js → useNow-CxO2FUQY.js} +1 -1
- package/web/assets/usePhoneShell-m3H_98m_.js +1 -0
- package/web/assets/{useSessionListQuery-DqZ3m8O9.js → useSessionListQuery-CJ-BYuqu.js} +1 -1
- package/web/assets/{useSessionRowActions-DTxXBruc.js → useSessionRowActions-D0GKtBhg.js} +1 -1
- package/web/assets/{useSidebarModel-DtY4PopW.js → useSidebarModel-b5cdTj9-.js} +1 -1
- package/web/assets/{web-preview-tGGVFpDI.js → web-preview-Bdrxyj-l.js} +1 -1
- package/web/assets/{web-preview-events-Bl80SpFF.js → web-preview-events-BBbAgfr4.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/AppSelect-fH3gqflO.js +0 -1
- package/web/assets/AssetsPage-BhrkErwt.js +0 -1
- package/web/assets/BrandLogo-C6O8cv-b.js +0 -1
- package/web/assets/ChannelsPage-C6A-ClM6.js +0 -1
- package/web/assets/ChatPage-B1V00hUs.js +0 -553
- package/web/assets/ComposerCommandMenu-BnwvT15Y.js +0 -1
- package/web/assets/ConfigPage-DwVhvmWL.js +0 -3
- package/web/assets/DispatchOverlay-ByJYJO36.js +0 -1
- package/web/assets/LaunchConsole-DRnR4Irg.js +0 -2
- package/web/assets/McpPage-DeuJ0HzI.js +0 -1
- package/web/assets/MemoryPage-CxFJYVZs.js +0 -1
- package/web/assets/SchedulesPage-BUDQGrHe.js +0 -1
- package/web/assets/SessionBrowserPane-Bq_U_5i9.js +0 -2
- package/web/assets/SessionContextPanel-V4QZj7xu.js +0 -2
- package/web/assets/SessionInspector-C14ilfNC.js +0 -1
- package/web/assets/TaskProcessesPane-hcChPVpA.js +0 -1
- package/web/assets/TaskTerminalView-DcFp0oHH.js +0 -18
- package/web/assets/WorkflowsPage-Dg9Mh9ND.js +0 -1
- package/web/assets/board-messages-CcVs4aSw.js +0 -1
- package/web/assets/checkbox-CG2AnYPm.js +0 -1
- package/web/assets/client-store-B-3_7075.js +0 -1
- package/web/assets/dist-DAs5KRGl.js +0 -1
- package/web/assets/dist-alOyD2Bh.js +0 -1
- package/web/assets/dropdown-menu-gZkWDhaR.js +0 -1
- package/web/assets/es2015-0QT3KgdC.js +0 -41
- package/web/assets/i18n-DPvJ0T4T.js +0 -1
- package/web/assets/index-DbL8igcD.css +0 -2
- package/web/assets/input-DIwJDpj9.js +0 -1
- package/web/assets/mount-app-CxpqEKPV.js +0 -9
- package/web/assets/placements-5xDVBdPk.js +0 -2
- package/web/assets/public-CyIfRdzo.js +0 -1
- package/web/assets/public-DwUlE0fE.js +0 -2
- package/web/assets/public-components-Cv7X4fW8.js +0 -1
- package/web/assets/public-diff-1bDiNGBB.js +0 -1
- package/web/assets/public-launch-D8n5o2kS.js +0 -1
- package/web/assets/safe-mode-sentinel-DEJ0ZBB_.js +0 -1
- package/web/assets/segmented-control-BOJt5SLj.js +0 -1
- package/web/assets/select-JC5m2BRQ.js +0 -1
- package/web/assets/tabs-C4VeYYS2.js +0 -1
- package/web/assets/usePhoneShell-w7JLYU3H.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-B0Z9INg1.js";import{i as e,r as t}from"./vendor-react-DwNgTV1j.js";import{t as n}from"./utils-C8uzG5AZ.js";e();var r=t();function i({className:e,type:t,...i}){return(0,r.jsx)(`input`,{type:t,"data-slot":`input`,className:n(`h-8.5 pointer-coarse:h-11 w-full min-w-0 rounded-sm border border-input bg-panel px-2.5 py-1 text-base caret-focus transition-[border-color,box-shadow] outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-focus focus-visible:ring-3 focus-visible:ring-focus-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-surface-muted disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm`,e),...i})}export{i as t};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MobileNavigation-Cc4zcU3a.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-react-DwNgTV1j.js","assets/use-i18n-D2P6OO3w.js","assets/i18n-DPvJ0T4T.js","assets/vendor-router-CSN_DGvx.js","assets/index-C4CqzQNY.js","assets/index-DbL8igcD.css","assets/storage-BY6wEHPw.js","assets/vendor-state-GkUciC5H.js","assets/runtime-capabilities-store--7mKyYAM.js","assets/api-DVgYxLec.js","assets/abort-signal-f4JsiYKX.js","assets/runtime-capabilities-BhAMiYhG.js","assets/chevron-left-BAtyp3_6.js","assets/createLucideIcon-Cd-3GVxJ.js","assets/chevron-right-C3t2Rckj.js","assets/settings-navigation-DV3N_utl.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-BOrn8KGA.js","assets/minus-BuutOHSj.js","assets/square-bHHVTT3G.js","assets/x-07u4-129.js","assets/FloatingWidgets-CcPNUEFB.js","assets/routes-Da0OHSy6.js","assets/placements-5xDVBdPk.js","assets/useQuery-Bg3cTjsY.js","assets/component-changes-Q9Bf64Ob.js","assets/session-scope-Bw40iOXx.js","assets/session-board-status-D2lpFPiI.js","assets/safe-mode-sentinel-DEJ0ZBB_.js","assets/usePhoneShell-w7JLYU3H.js","assets/client-store-B-3_7075.js","assets/AppOverlays-DICzFYsW.js","assets/startup-queries--JqGB_Cp.js","assets/mutation-Difliohy.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-ulSEiNKt.js","assets/shortcuts-BOeaPAvF.js","assets/chat-api-CQ9MShHZ.js","assets/format-DMJQzoZ7.js","assets/dialog-Kx6RCn3A.js","assets/dist-BdkTa5R3.js","assets/dist-Cfh4kzCK.js","assets/dist-B_a0oV4U.js","assets/es2015-0QT3KgdC.js","assets/button-Bu_vuij9.js","assets/useOverlayFocusReturn-NkxBSSjb.js","assets/palette-navigation-Bni8Mp34.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-DJZWnxzH.js","assets/label-BzlNatZM.js","assets/input-DIwJDpj9.js","assets/WebDesktopPet-qREBG08n.js","assets/public-components-Cv7X4fW8.js","assets/arrow-right-DqLOhpA2.js","assets/download-BCfIiuaL.js","assets/key-round-C29uZbsf.js","assets/config-search-ClE5BFDz.js","assets/BrandLogo-C6O8cv-b.js","assets/sidebar-4xAUV3YP.js","assets/chevron-down-CxtxIjiP.js","assets/ellipsis-CfGKfbq6.js","assets/useSessionRowActions-DTxXBruc.js","assets/launch-defaults-store-7CojCPDE.js","assets/useBoardItems-BU9aonpg.js","assets/useSessionListQuery-DqZ3m8O9.js","assets/session-organization-api-KZqrJZdA.js","assets/session-questions-Cf-1g85h.js","assets/dropdown-menu-gZkWDhaR.js","assets/check-2vYc6QaP.js","assets/dist-DAs5KRGl.js","assets/dist-alOyD2Bh.js","assets/dist-TksYpDID.js","assets/useNow-DAVNVxdo.js","assets/card-presentation-1oph2b8P.js","assets/board-projects-VBEGB9VD.js","assets/session-home-CM2_V5SZ.js","assets/motion-DTR4ZVle.js","assets/pick-system-directory-BgN7vwKS.js","assets/folder-plus-OPHZsJho.js","assets/pin-CU0FG0lI.js","assets/sidebar-store-we4gMwQq.js","assets/useSidebarModel-DtY4PopW.js","assets/new-task-C3wuHTor.js","assets/shortcut-aria-jHRmld9z.js","assets/StatusGlyph-1KgitlUg.js","assets/sidebar-commands-ZA1UOA_F.js","assets/PhoneTopBar-CLPmKZ4Q.js","assets/PhoneMenuButton-DEbqHUUP.js","assets/public-CyIfRdzo.js","assets/useFleetSystemInfo-BMpdQSqr.js","assets/square-pen-hYbjKh6A.js","assets/PhoneDrawer-qES4OwMx.js","assets/sheet-CASx5kBt.js","assets/SidebarUpdateStatus-BXimwZ77.js","assets/external-link-CEQqPcqc.js","assets/rocket-BgLSjoHY.js","assets/SettingsSidebar-cG_oKSWN.js","assets/arrow-left-B8oVrQ2S.js","assets/back-navigation-CK7X_5Bc.js","assets/DispatchOverlay-ByJYJO36.js","assets/LaunchConsole-DRnR4Irg.js","assets/arrow-up-DST6-qVQ.js","assets/shield-alert-oZqX6MNu.js","assets/shield-B1ruzHd0.js","assets/ComposerCommandMenu-BnwvT15Y.js","assets/braces-DQcXLGFF.js","assets/file-text-N9JICX6E.js","assets/board-launch-CUV0KEKT.js","assets/public-launch-D8n5o2kS.js","assets/QuickPromptIdeas-gKobqAO3.js","assets/code-xml-BrUXrBax.js","assets/wand-sparkles-CvEBNUFz.js","assets/list-checks-B5Jl4aiO.js","assets/session-change-summary-api-3216hpjE.js","assets/touch-target-BsyCgjR5.js","assets/ShortcutHelpDialog-C5KKKBZd.js","assets/ShortcutKeys-zuzmq8eW.js","assets/PageHeader-mUKoAR30.js","assets/more-pages-D_PnxLN0.js","assets/TerminalPanel-wvzi7jBd.js","assets/terminal-context-aIsIJPn8.js","assets/TaskTerminalView-DcFp0oHH.js","assets/PageState-aWHrkE1D.js","assets/TaskTerminalView-BrP-ENHg.css","assets/MobileViewportStabilizer-OtwVmIPm.js","assets/session-tree-actions-oMnZOFG4.js","assets/session-tree-summary-PpU7AyqE.js","assets/BoardPage-DKjz8Sj_.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-BOJt5SLj.js","assets/tooltip-EomUbN9-.js","assets/dist-BlIIpW6W.js","assets/esm-DCV8yILT.js","assets/ChatPage-B1V00hUs.js","assets/permission-rules-api-BQlSNrYK.js","assets/session-list-BeyOEzyU.js","assets/select-JC5m2BRQ.js","assets/chevron-up-D_ZcXjqr.js","assets/circle-check-iEdCm3Pw.js","assets/image-plus-D7bzZog0.js","assets/GitDiffViewer-CSl-SGa1.js","assets/file-Bllajneu.js","assets/side-chat-context-BcCF9VZz.js","assets/copy-DHmIFc52.js","assets/eye-uWAPXNzJ.js","assets/shield-check-Gvek4RJ7.js","assets/collapsible-C__hRcbA.js","assets/popover-DT3PkPcL.js","assets/alert-firawb0H.js","assets/vendor-motion-DSW3wzXK.js","assets/MarkdownMessage-BPZcFjyR.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-CVyju89W.js","assets/card-C3A0b5KR.js","assets/FileAttachmentPreview-B17OgdVi.js","assets/tabs-C4VeYYS2.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/progress-YhljaYNy.js","assets/WorkspacePicker-B68VTV5x.js","assets/app-primitives-Cmdj4cIW.js","assets/switch-DRkmP9uM.js","assets/badge-Dk1N1mVf.js","assets/AppSelect-fH3gqflO.js","assets/usePagePrimaryAction-CWPC0C_f.js","assets/web-preview-tGGVFpDI.js","assets/tool-labels-BUEvdohv.js","assets/speech-session-ClA_5hmd.js","assets/web-preview-events-Bl80SpFF.js","assets/SessionShell-Vv2oGR0M.js","assets/SessionHome-CVdMY-bT.js","assets/MorePage-B-qsYMAv.js","assets/app-window-CPNdvYNt.js","assets/image-BY_c3FYU.js","assets/monitor-smartphone-B1gIjItA.js","assets/ChatHistoryPage-j-_vMM-M.js","assets/FeaturePage-1MUXz3Y-.js","assets/AssetsPage-BhrkErwt.js","assets/queryOptions-Dfvzj6n2.js","assets/mobile-runtime-recovery-tbTyacip.js","assets/field-Bnm9KAi2.js","assets/separator-cVAjxx3U.js","assets/ChannelsPage-C6A-ClM6.js","assets/send-QxBfLFo-.js","assets/SchedulesPage-BUDQGrHe.js","assets/ConfigPage-DwVhvmWL.js","assets/arrow-up-right-B6l8qFZz.js","assets/zap-DZHw5afO.js","assets/app-update-BEymQxyl.js","assets/browser-notifications-DBS0oXqN.js","assets/ChatAppearancePage-6Mq1uFuU.js","assets/PluginsPage-B53DParo.js","assets/earth-Ddy13fHh.js","assets/file-code-corner-BnE1ljT0.js","assets/package-BOmkLaKS.js","assets/save-CHBB52P8.js","assets/MemoryPage-CxFJYVZs.js","assets/McpPage-DeuJ0HzI.js","assets/textarea-DmATpOqT.js","assets/SkillsPage-AhmayxVl.js","assets/checkbox-CG2AnYPm.js","assets/public-DwUlE0fE.js","assets/settings-2-CXJjXJS9.js","assets/use-studio-actions-CIA2TwfZ.js","assets/safe-mode-instance-fnZLVjjd.js","assets/PageFrame-DNwGZ-Dz.js","assets/WorkflowsPage-Dg9Mh9ND.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-C4CqzQNY.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-DPvJ0T4T.js";import{n as ue,r as k,t as A}from"./use-i18n-D2P6OO3w.js";import{t as j}from"./storage-BY6wEHPw.js";import{n as de,t as fe}from"./useQuery-Bg3cTjsY.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--JqGB_Cp.js";import{s as be,t as xe}from"./api-DVgYxLec.js";import{a as Se,i as Ce,r as we}from"./runtime-capabilities-BhAMiYhG.js";import{t as Te}from"./runtime-capabilities-store--7mKyYAM.js";import{a as Ee,i as De,t as Oe}from"./client-store-B-3_7075.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-DV3N_utl.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{i as qe}from"./dist-Cfh4kzCK.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-B_a0oV4U.js";import{r as $e}from"./dist-BlIIpW6W.js";import{a as et}from"./dist-DAs5KRGl.js";import{c as tt,i as nt,o as rt}from"./es2015-0QT3KgdC.js";import{r as it}from"./tooltip-EomUbN9-.js";import{t as I}from"./utils-C8uzG5AZ.js";import{n as at,t as ot}from"./button-Bu_vuij9.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-ulSEiNKt.js";import{a as pt,c as mt,i as ht,n as gt,r as L,s as R}from"./shortcuts-BOeaPAvF.js";import{t as z}from"./sidebar-store-we4gMwQq.js";import{n as _t,t as vt}from"./new-task-C3wuHTor.js";import{t as B}from"./shortcut-aria-jHRmld9z.js";import{i as yt,t as bt}from"./back-navigation-CK7X_5Bc.js";import{a as xt,i as St,l as V,o as Ct,s as wt,t as Tt}from"./dialog-Kx6RCn3A.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-Cmdj4cIW.js";import{n as U,r as Ot}from"./web-preview-tGGVFpDI.js";import{t as kt}from"./BrandLogo-C6O8cv-b.js";import{r as W}from"./web-preview-events-Bl80SpFF.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-BEymQxyl.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)||bt.dismiss()&&t.preventDefault()},i=()=>{let e=Bn(),n=new KeyboardEvent(`keydown`,{key:`Escape`,bubbles:!0,cancelable:!0});return yt(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=z(e=>e.collapsed)&&!t,r=z(e=>e.peeking),i=z(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=z(e=>e.toggleCollapsed),f=z(e=>e.setPeeking),p=mt(e=>e.bindings),m=p.toggleSidebar,h=R(`toggleSidebar`),g={newTask:R(`primaryAction`),search:R(`commandPalette`),board:R(`openBoard`),features:R(`openMore`),settings:R(`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":B(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:B(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=z(e=>e.toggleCollapsed),d=mt(e=>e.bindings),f=d.toggleSidebar,p=R(`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":B(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":B(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=mt(e=>e.bindings);return(0,J.useLayoutEffect)(()=>{let b=b=>{if(e||pt(b)||ht(b)&&!b.key.startsWith(`Arrow`))return;let x;L(b,y.commandPalette)?x=t:L(b,y.primaryAction)?x=n:L(b,y.openSession)?x=u:L(b,y.openBoard)?x=d:L(b,y.openComponents)?x=f:L(b,y.openMore)?x=p:L(b,y.jumpToAttention)?x=m:L(b,y.sessionTree)?x=h:L(b,y.sideChat)?x=g:L(b,y.cycleFocusRegion)?x=_:L(b,y.toggleSidebar)?x=a:L(b,y.agentPanel)?x=o:L(b,y.previousAgent)?x=s:L(b,y.nextAgent)?x=c:L(b,y.toggleTerminal)?x=i:L(b,y.openSettings)?x=l:L(b,y.shortcutHelp)?x=v:!gt(b.target)&&L(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.5`,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-Cc4zcU3a.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-BOrn8KGA.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-CcPNUEFB.js`).then(e=>({default:e.FloatingWidgets})),__vite__mapDeps([27,1,5,2,6,7,28,29,4,8,3,9,30,31,10,11,12,13,32,33,34,35,36]))),Wr=(0,J.lazy)(async()=>{let[{CommandPalette:e},{getNavigation:t}]=await Promise.all([i(()=>import(`./AppOverlays-DICzFYsW.js`),__vite__mapDeps([37,1,2,3,4,5,6,7,8,9,30,38,39,11,12,13,10,15,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,26,55,56,57,58,59,60])),i(()=>import(`./palette-navigation-Bni8Mp34.js`),__vite__mapDeps([61,13,62,15,1,2,63,64,65,66,42,67,68,69,70,71,72,73]))]);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-DJZWnxzH.js`).then(e=>({default:e.AppDialog})),__vite__mapDeps([74,1,2,3,4,5,6,7,8,9,26,15,75,57,56,47,48,59,54,55,58,76]))),Kr=(0,J.lazy)(()=>i(()=>import(`./WebDesktopPet-qREBG08n.js`).then(e=>({default:e.WebDesktopPet})),__vite__mapDeps([77,1,6,5,2,7,3,4,8,9,11,12]))),qr=(0,J.lazy)(()=>i(()=>import(`./public-components-Cv7X4fW8.js`).then(e=>({default:e.ConfigSearchBox})),__vite__mapDeps([78,1,2,3,4,5,6,7,8,9,10,11,12,13,79,15,80,81,44,70,26,47,48,59,56,49,82,51,54,55,57,58,76,83]))),Jr=(0,J.lazy)(()=>i(()=>import(`./public-components-Cv7X4fW8.js`).then(e=>({default:e.ModelOnboardingDialog})),__vite__mapDeps([78,1,2,3,4,5,6,7,8,9,10,11,12,13,79,15,80,81,44,70,26,47,48,59,56,49,82,51,54,55,57,58,76,83]))),Yr=()=>Promise.all([i(()=>import(`./sidebar-4xAUV3YP.js`),__vite__mapDeps([84,1,5,2,28,3,4,6,7,8,9,15,85,16,86,87,38,30,39,11,12,33,88,89,10,13,90,31,52,91,50,92,93,94,56,57,95,58,96,97,47,48,98,99,100,101,102,103,104,105,69,51,106,107,108,109,110,111])),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-CLPmKZ4Q.js`),__vite__mapDeps([112,2,1,3,4,5,6,7,8,9,113,15,47,48,106,107,98,38,30,39,11,12,33,50,52,90,31,10,13,91,92,89,99,114,115,53,108,44,116])),D()]).then(([e])=>({default:e.PhoneTopBar}))),ni=(0,J.lazy)(()=>i(()=>import(`./PhoneDrawer-qES4OwMx.js`).then(e=>({default:e.PhoneDrawer})),__vite__mapDeps([117,2,1,3,4,5,6,7,8,9,66,15,44,71,116,47,48,118,26,55,56,57,58,59,106]))),ri=(0,J.lazy)(()=>i(()=>import(`./SidebarUpdateStatus-BXimwZ77.js`),__vite__mapDeps([119,2,1,3,4,5,6,7,8,9,80,15,120,22,121]))),ii=(0,J.lazy)(()=>i(()=>import(`./SettingsSidebar-cG_oKSWN.js`).then(e=>({default:e.SettingsSidebar})),__vite__mapDeps([122,1,2,3,4,5,6,7,8,9,10,11,12,13,123,15,79,17,18,19,20,21,22,47,48,49,51,124]))),ai=(0,J.lazy)(async()=>{let[{DispatchOverlay:e}]=await Promise.all([i(()=>import(`./DispatchOverlay-ByJYJO36.js`),__vite__mapDeps([125,2,1,3,4,5,6,7,8,9,126,30,38,39,11,12,10,13,15,79,127,19,85,88,89,90,31,33,52,91,50,92,128,129,130,131,94,132,93,16,56,57,95,58,96,97,47,48,59,51,99,133,134,135,14,136,137,138,139,109,140,100,20,118,26,55,54,60])),D()]);return{default:e}}),oi=(0,J.lazy)(async()=>{let[{ShortcutHelpDialog:e}]=await Promise.all([i(()=>import(`./ShortcutHelpDialog-C5KKKBZd.js`),__vite__mapDeps([141,1,2,3,4,5,6,7,8,9,71,15,59,48,56,47,51,54,26,55,57,58,142,49])),D()]);return{default:e}}),si=(0,J.lazy)(()=>i(()=>import(`./PageHeader-mUKoAR30.js`).then(e=>({default:e.PageHeader})),__vite__mapDeps([143,2,1,3,4,5,6,7,8,9,14,15,45,144,47,48,59,56,51]))),ci=(0,J.lazy)(()=>i(()=>import(`./TerminalPanel-wvzi7jBd.js`).then(e=>({default:e.TerminalPanel})),__vite__mapDeps([145,1,2,3,4,5,6,7,8,9,15,24,43,45,26,59,48,56,47,146,147,25,148,149]))),li=(0,J.lazy)(()=>i(()=>import(`./MobileViewportStabilizer-OtwVmIPm.js`).then(e=>({default:e.MobileViewportStabilizer})),__vite__mapDeps([150,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=De(),O=ce||le,ue=Ee()&&ce,k=O&&!window.pisperDesktop&&!ue,de=Wn(m,v),_e=de===`board`?`board`:de===`more`?`features`:de===`settings`?`settings`:null,ye=z(e=>e.toggleCollapsed);(0,J.useEffect)(()=>{document.documentElement.toggleAttribute(`data-phone-shell`,k)},[k]),(0,J.useEffect)(()=>{z.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),[mt,ht]=(0,J.useState)({browser:{enabled:!1},connections:{},scopes:[],templates:[]}),[gt,L]=(0,J.useState)(null),R=(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]),[B,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:B,height:bt}))},[bt,B]),(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(mt.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(()=>{})}},[mt.browser?.enabled]),Nt=(0,J.useCallback)((e,t,n)=>{let r=mt.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)},[mt.templates,Mt]),Pt=(0,J.useCallback)(e=>V.register(e),[V]),Ft=(0,J.useCallback)(()=>{V.invoke()},[V]),Lt=(0,J.useCallback)(e=>(L(e),()=>L(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`)&&_t(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&&ht(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,gt?gt.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),ht(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(vt);if(e)e.focus();else if(!k&&z.getState().collapsed){z.getState().setPeeking(!0);let e=0,t=()=>{let n=document.getElementById(vt);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:B,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:B,height:bt,labels:R,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-oMnZOFG4.js`);return{switchToTurnOnOtherBranch:e}},__vite__mapDeps([151,50,6,5,1,2,7,8,52,38,30,39,11,4,12,152]));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)(Tt,{open:!!d,onOpenChange:e=>{e||S()},children:(0,X.jsxs)(St,{size:`compact`,surface:`confirmation`,showCloseButton:!1,className:`z-[400]`,overlayClassName:`z-[400]`,children:[(0,X.jsxs)(wt,{children:[(0,X.jsx)(V,{children:t(`common:unsaved.title`)}),(0,X.jsx)(xt,{children:t(`common:unsaved.description`)})]}),(0,X.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),te()},children:(0,X.jsxs)(Ct,{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-DKjz8Sj_.js`),__vite__mapDeps([153,1,5,2,3,4,6,7,8,9,30,29,31,10,11,12,13,32,33,34,36,35,15,154,79,127,85,16,155,86,87,28,38,39,88,89,90,52,91,50,92,93,94,56,57,95,58,96,97,47,48,98,99,100,101,102,103,105,43,156,116,157,26,158,159,140,160,161,59,49,51,106,115,53,148,139,134,135,14,136,132,137,138,130,131,162,110])),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-B1V00hUs.js`),__vite__mapDeps([163,1,5,2,6,7,3,4,8,9,30,38,39,11,12,13,10,36,15,164,165,127,19,131,94,85,14,16,166,167,56,57,161,95,58,96,97,47,48,168,169,155,80,170,26,59,50,162,132,171,172,28,33,35,154,173,86,174,65,20,41,21,22,69,156,128,175,46,157,176,93,177,54,55,160,51,52,53,148,178,76,179,180,181,182,183,184,185,110,102,186,187,83,152,188,189,190,191,42,192,193,194,195,43,44,71,129,116,130,25,196,73,197,158,198,49,118,91,92,139,109,140,124,199,103,200,201,202,203,204,205,146,206,151,207,208])),i(()=>import(`./SessionShell-Vv2oGR0M.js`),__vite__mapDeps([209,1,5,2,28,3,4,6,7,8,9,29,30,31,10,11,12,13,32,33,34,36,35,113,15,47,48,106,107,98,38,39,50,52,90,91,92,89,99,114,115,53,108,101])),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-CVdMY-bT.js`),__vite__mapDeps([210,1,5,2,28,3,4,6,7,8,9,35,36,11,12,126,30,38,39,10,13,15,79,127,19,85,88,89,90,31,33,52,91,50,92,128,129,130,131,94,132,93,16,56,57,95,58,96,97,47,48,59,51,99,133,134,135,14,136,137,138,139,109,140,100,113,106,107,98,114,115,53,108,42,148,101])),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-B-qsYMAv.js`);return{MorePage:e}},__vite__mapDeps([211,1,2,3,4,5,6,7,8,9,30,11,12,13,10,29,31,32,33,34,36,35,15,212,62,19,63,64,16,213,214,67,43,68,69,44,70,72,73,26,158,144,47,48,59,56,49,50,82,51]));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-j-_vMM-M.js`);return{ChatHistoryPage:e}},__vite__mapDeps([215,1,6,5,2,7,3,4,8,9,30,38,39,11,12,35,36,15,165,86,194,105,22,116,157,158,144,93,94,16,56,57,95,58,96,97,47,48,59,50,51,91,53,148,139,216,85,14,44,196,26,49,110,202]));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-BhrkErwt.js`);return{AssetsPage:e}},__vite__mapDeps([217,1,2,4,5,6,7,8,3,9,30,218,11,12,15,80,120,171,191,193,43,22,157,196,26,144,93,94,16,56,57,95,58,96,97,47,48,59,51,53,148,54,55,216,35,36,85,14,44,49,219,220,75,221,180,181,182,183,184,173,185]));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-C6A-ClM6.js`),__vite__mapDeps([222,1,2,3,4,5,6,7,8,9,11,12,15,19,120,65,223,42,43,22,175,157,196,26,158,144,47,48,59,56,51,53,148,76,216,35,36,85,14,44,49,220,75,57,221,110,200,201,97,189,95,202,187,203,166,94,167,161,58,96])),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-BUDQGrHe.js`);return{SchedulesPage:e}},__vite__mapDeps([224,1,2,3,4,5,6,7,8,9,11,12,18,15,19,64,168,65,223,195,43,157,196,144,47,48,59,56,51,53,148,54,26,55,57,58,199,94,178,76,216,35,36,85,14,44,49,220,75,221,110,103,200,201,97,189,95,202,187,203,166,167,161,96]));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-DwVhvmWL.js`),__vite__mapDeps([225,1,5,2,6,7,4,8,3,9,11,12,13,10,36,15,164,123,79,226,18,19,63,94,85,14,166,167,56,57,161,95,58,96,97,47,48,40,168,136,173,80,86,120,137,213,17,20,21,22,41,42,214,227,43,121,156,44,70,175,72,45,157,196,197,26,158,176,93,16,177,54,55,59,221,201,49,82,51,53,148,76,60,216,35,220,75,180,181,182,183,184,185,110,202,200,189,187,203,204,83,228,142,229])),i(()=>import(`./ChatAppearancePage-6Mq1uFuU.js`),__vite__mapDeps([230,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-B53DParo.js`);return{PluginsPage:e}},__vite__mapDeps([231,1,2,3,4,5,6,7,8,9,11,12,13,10,15,168,232,120,174,233,65,213,234,67,235,44,70,128,157,196,144,56,57,55,58,47,48,59,51,148,54,26,76,216,35,36,85,14,49,103,200,201,97,189,95,202,187,203,166,94,167,161,96,206]));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-CxFJYVZs.js`);return{MemoryPage:e}},__vite__mapDeps([236,1,2,3,4,5,6,7,8,9,11,12,15,94,233,20,194,43,22,72,157,26,144,160,56,57,161,58,96,97,47,48,59,51,148,76,216,35,36,85,14,44,196,49,220,75,221,200,201,189,95,202,187,203,166,167]));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-DeuJ0HzI.js`),__vite__mapDeps([237,1,2,3,4,5,6,7,8,9,30,39,218,11,12,94,15,173,81,43,22,69,70,157,197,26,144,201,56,57,97,47,48,59,51,53,148,178,54,55,58,216,35,36,85,14,44,196,49,238])),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-AhmayxVl.js`);return{SkillsPage:e}},__vite__mapDeps([239,1,2,3,4,5,6,7,8,9,11,12,233,15,213,234,43,235,72,157,197,144,240,94,56,57,97,47,48,59,51,148,216,35,36,85,14,44,196,26,49,200,201,189,95,202,187]));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-DwUlE0fE.js`),__vite__mapDeps([241,1,5,2,28,3,4,6,7,8,9,30,31,32,11,12,33,29,10,13,34,35,36,15,212,226,62,94,85,14,16,166,167,56,57,161,95,58,96,97,47,48,136,173,80,86,192,43,69,44,242,128,72,157,26,240,93,75,201,159,140,59,49,51,118,55,106,115,90,38,39,52,91,50,92,98,89,99,53,114,107,108,148,133,54,76,60,202,243,198,221,160,110,244,238,245])),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-DwUlE0fE.js`),__vite__mapDeps([241,1,5,2,28,3,4,6,7,8,9,30,31,32,11,12,33,29,10,13,34,35,36,15,212,226,62,94,85,14,16,166,167,56,57,161,95,58,96,97,47,48,136,173,80,86,192,43,69,44,242,128,72,157,26,240,93,75,201,159,140,59,49,51,118,55,106,115,90,38,39,52,91,50,92,98,89,99,53,114,107,108,148,133,54,76,60,202,243,198,221,160,110,244,238,245])),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-Dg9Mh9ND.js`),__vite__mapDeps([246,1,5,2,28,4,6,7,8,3,9,30,11,12,35,36,15,154,127,18,19,131,94,85,14,16,168,169,136,173,80,86,233,171,190,247,213,41,223,227,192,193,194,195,43,22,121,235,44,70,242,25,157,196,73,26,144,176,56,57,93,95,58,96,97,47,48,75,177,54,55,59,198,201,189,51,118,53,148,178,76,216,49,220,221,110,203,166,167,161,229,238,245,248,249,250])),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-Dg9Mh9ND.js`),__vite__mapDeps([246,1,5,2,28,4,6,7,8,3,9,30,11,12,35,36,15,154,127,18,19,131,94,85,14,16,168,169,136,173,80,86,233,171,190,247,213,41,223,227,192,193,194,195,43,22,121,235,44,70,242,25,157,196,73,26,144,176,56,57,93,95,58,96,97,47,48,75,177,54,55,59,198,201,189,51,118,53,148,178,76,216,49,220,221,110,203,166,167,161,229,238,245,248,249,250])),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,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/hosts-B-POTAmu.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-router-CSN_DGvx.js","assets/vendor-react-DwNgTV1j.js","assets/index-C4CqzQNY.js","assets/index-DbL8igcD.css","assets/routes-Da0OHSy6.js","assets/use-i18n-D2P6OO3w.js","assets/i18n-DPvJ0T4T.js","assets/storage-BY6wEHPw.js","assets/vendor-state-GkUciC5H.js","assets/useQuery-Bg3cTjsY.js","assets/session-scope-Bw40iOXx.js","assets/api-DVgYxLec.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-gZkWDhaR.js","assets/check-2vYc6QaP.js","assets/chevron-right-C3t2Rckj.js","assets/dist-Cfh4kzCK.js","assets/dist-B_a0oV4U.js","assets/dist-DAs5KRGl.js","assets/es2015-0QT3KgdC.js","assets/dist-alOyD2Bh.js","assets/dist-TksYpDID.js","assets/utils-C8uzG5AZ.js","assets/vendor-ui-DvrYggeS.js","assets/popover-DT3PkPcL.js","assets/dialog-Kx6RCn3A.js","assets/dist-BdkTa5R3.js","assets/button-Bu_vuij9.js","assets/use-studio-actions-CIA2TwfZ.js","assets/checkbox-CG2AnYPm.js","assets/progress-YhljaYNy.js","assets/separator-cVAjxx3U.js","assets/switch-DRkmP9uM.js","assets/segmented-control-BOJt5SLj.js","assets/touch-target-BsyCgjR5.js","assets/tooltip-EomUbN9-.js","assets/dist-BlIIpW6W.js","assets/kbd-CAufZTkl.js","assets/useSessionListQuery-DqZ3m8O9.js","assets/startup-queries--JqGB_Cp.js","assets/mutation-Difliohy.js","assets/component-changes-Q9Bf64Ob.js","assets/runtime-capabilities-store--7mKyYAM.js","assets/runtime-capabilities-BhAMiYhG.js","assets/chat-api-CQ9MShHZ.js","assets/session-organization-api-KZqrJZdA.js","assets/events-ulSEiNKt.js","assets/session-questions-Cf-1g85h.js","assets/useFleetSystemInfo-BMpdQSqr.js","assets/useNow-DAVNVxdo.js","assets/useBoardItems-BU9aonpg.js","assets/card-presentation-1oph2b8P.js","assets/format-DMJQzoZ7.js","assets/public-CyIfRdzo.js","assets/useSidebarModel-DtY4PopW.js","assets/new-task-C3wuHTor.js","assets/board-launch-CUV0KEKT.js","assets/input-DIwJDpj9.js","assets/StatusGlyph-1KgitlUg.js","assets/badge-Dk1N1mVf.js","assets/safe-mode-instance-fnZLVjjd.js","assets/safe-mode-sentinel-DEJ0ZBB_.js","assets/textarea-DmATpOqT.js","assets/SafeModePrompt-Dlq8rlix.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-DPvJ0T4T.js";import{t as i}from"./use-i18n-D2P6OO3w.js";import{r as a,t as o}from"./useQuery-Bg3cTjsY.js";import{n as s}from"./component-changes-Q9Bf64Ob.js";import{t as c}from"./runtime-capabilities-store--7mKyYAM.js";import{_ as l,j as u,k as d,n as f,r as p,t as m}from"./session-scope-Bw40iOXx.js";import"./safe-mode-sentinel-DEJ0ZBB_.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-B-POTAmu.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])),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-Dlq8rlix.js`),__vite__mapDeps([73,1,3,7,8,2,4,5,9,10,37,33,26,32,35,22,16,36,27,29,70,71])),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"./useSessionListQuery-DqZ3m8O9.js";import"./useNow-DAVNVxdo.js";import"./useFleetSystemInfo-BMpdQSqr.js";import"./useSidebarModel-DtY4PopW.js";import"./new-task-C3wuHTor.js";
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/public-diff-1bDiNGBB.js","assets/GitDiffViewer-CSl-SGa1.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-react-DwNgTV1j.js","assets/use-i18n-D2P6OO3w.js","assets/i18n-DPvJ0T4T.js","assets/vendor-router-CSN_DGvx.js","assets/index-C4CqzQNY.js","assets/index-DbL8igcD.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-Bu_vuij9.js","assets/dist-Cfh4kzCK.js","assets/events-ulSEiNKt.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-D2P6OO3w.js";import{r as d,t as f}from"./useQuery-Bg3cTjsY.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-Bw40iOXx.js";import{c as x,d as S,l as C,t as w,u as T}from"./placements-5xDVBdPk.js";import{t as ee}from"./usePhoneShell-w7JLYU3H.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{a as k,i as oe,n as A,r as j,t as se}from"./select-JC5m2BRQ.js";import{t as ce}from"./code-xml-BrUXrBax.js";import{t as le}from"./copy-DHmIFc52.js";import{t as ue}from"./download-BCfIiuaL.js";import{t as M}from"./ellipsis-CfGKfbq6.js";import{t as de}from"./panel-right-BSUtqUd8.js";import{t as N}from"./plus-fQbSqB1n.js";import{t as fe}from"./rotate-ccw-clock-CO6Bw-sF.js";import{t as pe}from"./search-D0mqDaf_.js";import{t as me}from"./settings-2-CXJjXJS9.js";import{t as he}from"./shield-alert-oZqX6MNu.js";import{t as ge}from"./sparkles-S_eeuqn9.js";import{t as _e}from"./trash-2-CNrPOoPR.js";import{t as ve}from"./x-07u4-129.js";import{t as ye}from"./checkbox-CG2AnYPm.js";import{a as be,c as xe,i as P,p as Se,r as Ce,t as we}from"./dropdown-menu-gZkWDhaR.js";import{t as Te}from"./label-BzlNatZM.js";import{t as Ee}from"./switch-DRkmP9uM.js";import{t as F}from"./segmented-control-BOJt5SLj.js";import{t as I}from"./utils-C8uzG5AZ.js";import{r as De,t as L}from"./button-Bu_vuij9.js";import{t as Oe}from"./kbd-CAufZTkl.js";import{t as ke}from"./shortcuts-BOeaPAvF.js";import{a as Ae,i as je,n as Me,o as Ne,r as Pe,t as Fe}from"./sheet-CASx5kBt.js";import{t as Ie}from"./sidebar-store-we4gMwQq.js";import{n as Le}from"./useFleetSystemInfo-BMpdQSqr.js";import{a as Re,n as ze}from"./format-DMJQzoZ7.js";import"./public-CyIfRdzo.js";import{n as R,t as z}from"./PageState-aWHrkE1D.js";import{i as Be}from"./board-launch-CUV0KEKT.js";import{a as B,i as V,l as H,n as Ve,o as U,s as W,t as G}from"./dialog-Kx6RCn3A.js";import{t as K}from"./input-DIwJDpj9.js";import{t as q}from"./useOverlayFocusReturn-NkxBSSjb.js";import{t as He}from"./badge-Dk1N1mVf.js";import{A as Ue,B as We,C as Ge,F as Ke,G as qe,H as Je,I as J,J as Ye,K as Xe,L as Ze,M as Qe,N as $e,O as et,R as tt,S as nt,U as rt,V as it,W as at,X as ot,Y as st,_ as ct,a as lt,b as ut,c as dt,d as ft,f as Y,g as pt,h as mt,i as ht,j as gt,k as _t,l as vt,m as yt,n as bt,o as xt,p as St,q as Ct,r as X,s as wt,t as Tt,v as Et,w as Dt,x as Ot,y as kt,z as At}from"./use-studio-actions-CIA2TwfZ.js";import{t as jt}from"./textarea-DmATpOqT.js";import{t as Mt}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=Et(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:I(r&&`sr-only`),children:o(`custom-ui:studio.previewPlacement`)}),(0,Q.jsx)(F,{size:`sm`,"aria-label":o(`custom-ui:studio.previewPlacement`),value:t,onValueChange:i,className:I(`max-w-full overflow-x-auto`,r&&`w-full`),options:s.map(e=>({value:e,label:ht(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)(F,{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=vt(t,c),p=ct(n,t.manifest,s?`standard`:r),m=Ge(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:I(`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:X(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:I(`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)(_t,{component:t,instance:{instanceId:i??`preview:${t.id}`,surface:m,title:a,props:o,size:nt(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=$e(),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:I(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=q(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)(Te,{htmlFor:h,className:`-mb-1.5 text-xs text-content-secondary`,children:r(`custom-ui:studio.componentName`)}),(0,Q.jsx)(K,{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)(Te,{htmlFor:g,className:`-mb-1.5 text-xs text-content-secondary`,children:r(`custom-ui:agent.newPromptLabel`)}),(0,Q.jsx)(jt,{id:g,rows:3,value:c,maxLength:xt,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)(we,{children:[(0,Q.jsx)(Se,{asChild:!0,children:(0,Q.jsxs)(L,{ref:p,size:`sm`,variant:`secondary`,disabled:d,"data-component-new":!0,className:I(n),children:[(0,Q.jsx)(N,{}),r(`custom-ui:studio.new`),(0,Q.jsx)(re,{className:`text-content-muted`})]})}),(0,Q.jsxs)(Ce,{align:`end`,className:`w-56`,children:[(0,Q.jsx)(P,{"data-component-new-blank":!0,onSelect:()=>a(!0),children:r(`custom-ui:studio.newBlank`)}),(0,Q.jsx)(xe,{}),(0,Q.jsx)(be,{className:`text-xs font-normal text-content-muted`,children:r(`custom-ui:studio.fromTemplate`)}),(0,Q.jsx)(P,{"data-component-new-template":`usage-today`,onSelect:()=>void _(`usage-today`),children:r(`custom-ui:studio.templateUsageToday`)}),(0,Q.jsx)(P,{"data-component-new-template":`notes`,onSelect:()=>void _(`notes`),children:r(`custom-ui:studio.templateNotes`)})]})]}),t?(0,Q.jsx)(Fe,{open:i,onOpenChange:e=>!d&&a(e),children:(0,Q.jsx)(Me,{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)(Ae,{className:`p-0`,children:[(0,Q.jsx)(Ne,{children:r(`custom-ui:studio.newBlankTitle`)}),(0,Q.jsx)(Pe,{children:r(`custom-ui:studio.newBlankHint`)})]}),x,(0,Q.jsxs)(je,{className:`flex-row p-0`,children:[(0,Q.jsx)(L,{type:`button`,variant:`outline`,className:`min-h-11 flex-1`,disabled:d,onClick:()=>a(!1),children:r(`custom-ui:studio.cancel`)}),(0,Q.jsx)(L,{type:`submit`,className:`min-h-11 flex-1`,disabled:d||!v,children:S})]})]})})}):(0,Q.jsx)(G,{open:i,onOpenChange:e=>!d&&a(e),children:(0,Q.jsx)(V,{onCloseAutoFocus:m,children:(0,Q.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),b()},children:[(0,Q.jsxs)(W,{children:[(0,Q.jsx)(H,{children:r(`custom-ui:studio.newBlankTitle`)}),(0,Q.jsx)(B,{children:r(`custom-ui:studio.newBlankHint`)})]}),x,(0,Q.jsxs)(U,{children:[(0,Q.jsx)(L,{type:`button`,variant:`outline`,disabled:d,onClick:()=>a(!1),children:r(`custom-ui:studio.cancel`)}),(0,Q.jsx)(L,{type:`submit`,disabled:d||!v,children:S})]})]})})})]})}function Vt(e,t){return e.length?e.map(e=>{let n=X(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?J(t.code,n,t.params):n(`custom-ui:studio.statusInvalid`)}return Vt(pt(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:I(`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`:I(`rounded-[var(--r-md)] px-2.5 py-2`,n?`bg-surface-active`:`hover:bg-surface-hover`)),children:[(0,Q.jsx)(`span`,{className:I(`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:Y(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)(He,{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=Qe(),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)(L,{size:`xs`,variant:`ghost`,onClick:t,children:i(`custom-ui:host.viewError`)}),(0,Q.jsx)(L,{size:`xs`,variant:`secondary`,onClick:n,children:i(`custom-ui:host.reload`)}),r&&s&&(0,Q.jsx)(L,{size:`xs`,variant:`ghost`,"data-component-crash-fix":e,onClick:()=>r(Ke(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)(pe,{"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)(K,{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)(F,{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:I(`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)(ve,{className:`size-3`})})]},e))}),(0,Q.jsx)(K,{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)(Ee,{...c,checked:n===!0,onCheckedChange:e=>a(e)});case`segmented`:return(0,Q.jsx)(F,{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)(se,{value:typeof n==`string`&&n?n:void 0,disabled:i,onValueChange:e=>a(e),children:[(0,Q.jsx)(oe,{...c,className:`w-full`,children:(0,Q.jsx)(k,{placeholder:o(`custom-ui:studio.selectPlaceholder`)})}),(0,Q.jsx)(A,{children:e.options.map(e=>(0,Q.jsx)(j,{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)(jt,{...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)(K,{...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)(K,{...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)(K,{...c,type:e.kind===`url`?`url`:`text`,maxLength:e.maxLength,value:typeof n==`string`?n:``,className:I(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=et(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(J(t,a)):n(t?`${a(`custom-ui:studio.saveFailed`)} ${J(t,a)}`:a(`custom-ui:studio.saveFailed`))}finally{C(!1)}}},E=e=>{let t=_[e];return t?J(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)(K,{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:J(_[``].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)(L,{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)(L,{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:I(`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})=>rt(e,t),enabled:t&&!!e,retry:!1,staleTime:1e4,refetchOnWindowFocus:!1})}function sn(e,t){return f({queryKey:_.usage(e),queryFn:({signal:t})=>We(e,t),enabled:t&&!!e,retry:!1,refetchInterval:15e3,refetchOnWindowFocus:!1})}function cn(e){return f({queryKey:_.trash(),queryFn:({signal:e})=>Je(e),enabled:e,retry:!1,refetchOnWindowFocus:!1})}function ln(e){return f({queryKey:_.staged(e),queryFn:({signal:t})=>it(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} ${J(r,n)}`:i),null}};return{notify:e,restoreVersion:async(t,r)=>{let a=await i(()=>Xe(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 At(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`)} ${J(r,n)}`:n(`custom-ui:exporting.failed`))}},stageImport:e=>i(()=>st(e),n(`custom-ui:importing.stageFailed`)),trust:async t=>{let r=await i(()=>ot(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(()=>tt(t).then(()=>!0),n(`custom-ui:importing.discardFailed`));return r&&e(n(`custom-ui:importing.discarded`)),r},restoreTrash:async t=>{let r=await i(()=>Ct(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(()=>at(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(()=>Ye(e.id,t),n(`custom-ui:usage.revokeFailed`))}},[t,e,n])}var fn=(0,Z.lazy)(()=>t(()=>import(`./public-diff-1bDiNGBB.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[lt(e,t),e.summary,e.at?Re(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=q(!!f);if(!t)return null;let y=o.data,b=async(t,r)=>{_.current=r,d(t.n);try{c({...await Ze(e.id,t.n),n:t.n})}catch(e){let t=g(e);n(t?`${i(`custom-ui:versions.diffFailed`)} ${J(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)(L,{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)(L,{size:`xs`,variant:`ghost`,"data-version-restore":e.n,onClick:t=>{_.current=t.currentTarget,p(e)},children:[(0,Q.jsx)(fe,{}),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)(G,{open:!!f,onOpenChange:e=>!e&&!m&&p(null),children:(0,Q.jsxs)(V,{onCloseAutoFocus:v,children:[(0,Q.jsxs)(W,{children:[(0,Q.jsx)(H,{children:i(`custom-ui:versions.restoreTitle`,{n:f?.n??0})}),(0,Q.jsx)(B,{children:i(`custom-ui:versions.restoreHint`,{n:f?.n??0,next:(y?.current.n??0)+1,current:y?.current.n??0})})]}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(L,{variant:`outline`,disabled:m,onClick:()=>p(null),children:i(`custom-ui:studio.cancel`)}),(0,Q.jsx)(L,{disabled:m,"data-version-restore-confirm":!0,onClick:()=>void x(),children:i(`custom-ui:versions.restoreConfirm`,{n:f?.n??0})})]})]})}),(0,Q.jsx)(G,{open:!!s,onOpenChange:e=>!e&&c(null),children:(0,Q.jsxs)(V,{"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)(W,{children:[(0,Q.jsx)(H,{children:i(`custom-ui:versions.diffTitle`,{n:s?.n??0,current:y?.current.n??0})}),(0,Q.jsx)(B,{children:s?.files.length?s.files.map(e=>e.path).join(` · `):i(`custom-ui:versions.noDiff`)})]}),(0,Q.jsx)(Ve,{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":de,"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=X(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:Y(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)(Ee,{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}),J(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)(se,{value:l?.instanceId??`preview`,onValueChange:e=>a(e===`preview`?null:e),children:[(0,Q.jsx)(oe,{className:`w-full`,"aria-label":s(`custom-ui:studio.editingInstance`),"data-props-instance":!0,children:(0,Q.jsx)(k,{})}),(0,Q.jsxs)(A,{children:[(0,Q.jsx)(j,{value:`preview`,children:s(`custom-ui:studio.previewProps`)}),c.map(e=>(0,Q.jsxs)(j,{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=>bt(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:bt(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:I(d&&`text-content-muted line-through`),children:bt(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)(He,{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:Re(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)(L,{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}=Le(),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)(se,{value:o,disabled:t,onValueChange:e=>n(e===`*`?{type:`all`}:{type:`project`,cwd:e}),children:[(0,Q.jsx)(oe,{size:`sm`,className:`w-full min-w-0`,"aria-label":r(`custom-ui:studio.scope`),"data-placement-scope":!0,children:(0,Q.jsx)(k,{})}),(0,Q.jsxs)(A,{children:[(0,Q.jsx)(j,{value:`*`,children:r(`custom-ui:studio.scopeAll`)}),a.map(e=>(0,Q.jsx)(j,{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)(St(e.manifest)),[c,l]=(0,Z.useState)({type:`all`}),[d,f]=(0,Z.useState)(null),p=q(d!==null),m=ft(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=Ot(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:I(`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)(ye,{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:X(a,r)}),a===`overview-card`&&p.length>1&&(0,Q.jsxs)(He,{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)(F,{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)(L,{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)(N,{})})]}),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)(G,{open:d!==null,onOpenChange:e=>!e&&f(null),children:(0,Q.jsxs)(V,{onCloseAutoFocus:p,children:[(0,Q.jsxs)(W,{children:[(0,Q.jsx)(H,{children:r(`custom-ui:studio.unplaceAllTitle`,{count:d?.length??0})}),(0,Q.jsx)(B,{children:r(`custom-ui:studio.unplaceAllHint`)})]}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(L,{variant:`outline`,onClick:()=>f(null),children:r(`custom-ui:studio.cancel`)}),(0,Q.jsx)(L,{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=ft(e);return(0,Q.jsxs)(we,{children:[(0,Q.jsx)(Se,{asChild:!0,children:(0,Q.jsxs)(L,{size:`sm`,disabled:!a,"data-component-place":!0,className:r,children:[i(`custom-ui:studio.placeTo`),(0,Q.jsx)(re,{})]})}),(0,Q.jsx)(Ce,{align:`start`,className:`w-56`,children:gn.map(r=>{let a=Ot(e.manifest,r),o=r!==`overview-card`&&t.some(t=>t.componentId===e.id&&t.surface===r&&t.enabled);return(0,Q.jsxs)(P,{disabled:!a||o,"data-component-place-item":r,onSelect:()=>void n.place(e,t,{surface:r,...r===`overview-card`?{size:St(e.manifest)}:{}}),children:[X(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=q(o,d),p=Y(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)(we,{children:[(0,Q.jsx)(Se,{asChild:!0,children:(0,Q.jsx)(L,{ref:d,size:`icon-sm`,variant:`ghost`,"aria-label":i(`custom-ui:studio.more`),"data-component-more":!0,children:(0,Q.jsx)(M,{})})}),(0,Q.jsx)(Ce,{align:`end`,children:(0,Q.jsxs)(P,{variant:`destructive`,"data-component-delete":!0,onSelect:()=>s(!0),children:[(0,Q.jsx)(_e,{}),i(`custom-ui:studio.deleteComponent`)]})})]}):(0,Q.jsxs)(L,{variant:`ghost`,size:`sm`,className:`text-danger`,"data-component-delete":!0,onClick:()=>s(!0),children:[(0,Q.jsx)(_e,{}),i(`custom-ui:studio.deleteComponent`)]}),(0,Q.jsx)(G,{open:o,onOpenChange:e=>!e&&!c&&s(!1),children:(0,Q.jsxs)(V,{onCloseAutoFocus:f,children:[(0,Q.jsxs)(W,{children:[(0,Q.jsx)(H,{children:i(`custom-ui:studio.deleteTitle`,{name:p})}),(0,Q.jsx)(B,{children:i(`custom-ui:studio.deleteHint`)})]}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(L,{variant:`outline`,disabled:c,onClick:()=>s(!1),children:i(`custom-ui:studio.cancel`)}),(0,Q.jsx)(L,{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)(L,{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)(ue,{}),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)(L,{size:`sm`,variant:`secondary`,onClick:d,"data-component-view-source":!0,children:[(0,Q.jsx)(ce,{}),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:I(`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:le;return(0,Q.jsx)(L,{className:I(`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-1bDiNGBB.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)(L,{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)(L,{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:I(`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)(L,{size:t?`sm`:`xs`,variant:`secondary`,className:I(`w-fit`,t&&`min-h-11`),"data-staged-review":e.stageId,onClick:n,children:[(0,Q.jsx)(he,{}),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:I(`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:I(`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:I(`flex items-center gap-1.5`,zn(e.severity)),children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:I(`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})=>qe(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)(G,{open:!!e,onOpenChange:e=>!e&&!c&&n(),children:(0,Q.jsxs)(V,{"data-trust-dialog":e,scrollMode:`body`,className:`h-[min(820px,calc(100dvh-2rem))] max-w-[min(1040px,calc(100vw-2rem))]`,children:[(0,Q.jsxs)(W,{children:[(0,Q.jsx)(H,{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)(B,{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:ze(x.bytes)}),(0,Q.jsxs)(`span`,{className:`break-all`,"data-trust-sha256":!0,children:[`sha256 `,x.sha256]})]})})]}),(0,Q.jsx)(Ve,{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)(Be,{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:ze(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,` · `,ze(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)(L,{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=>X(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:[bt(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)(U,{className:`flex-row flex-wrap items-center gap-2 sm:justify-between`,children:[(0,Q.jsx)(L,{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)(L,{variant:`outline`,size:`sm`,disabled:!!c,onClick:n,children:i(`custom-ui:studio.cancel`)}),(0,Q.jsx)(L,{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)(L,{size:`xs`,variant:`ghost`,"data-component-trash":!0,className:r,onClick:()=>c(!0),children:[(0,Q.jsx)(_e,{}),i(`custom-ui:trash.button`),m.length>0&&(0,Q.jsx)(`span`,{className:`tabular-nums`,children:m.length})]}),(0,Q.jsx)(G,{open:s,onOpenChange:e=>!l&&c(e),children:(0,Q.jsxs)(V,{size:`wide`,scrollMode:`body`,"data-trash-dialog":!0,children:[(0,Q.jsxs)(W,{children:[(0,Q.jsx)(H,{children:i(`custom-ui:trash.title`)}),(0,Q.jsx)(B,{children:i(`custom-ui:trash.hint`,{days:o.data?.retentionDays??7})})]}),(0,Q.jsx)(Ve,{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:Re(e.deletedAt,a)}),e.instances?i(`custom-ui:trash.instances`,{count:e.instances}):``,_(e)].filter(Boolean).join(` · `)})]}),e.kind===`native`&&(0,Q.jsx)(L,{size:`xs`,variant:`secondary`,disabled:!!l,"data-trash-restore":e.entry,onClick:()=>void h(e),children:i(`custom-ui:trash.restore`)}),(0,Q.jsx)(L,{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)(G,{open:!!f,onOpenChange:e=>!e&&!l&&p(null),children:(0,Q.jsxs)(V,{size:`compact`,surface:`confirmation`,children:[(0,Q.jsxs)(W,{children:[(0,Q.jsx)(H,{children:i(`custom-ui:trash.purgeTitle`,{name:f?.name??``})}),(0,Q.jsx)(B,{children:i(`custom-ui:trash.purgeHint`)})]}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(L,{variant:`outline`,disabled:!!l,onClick:()=>p(null),children:i(`custom-ui:studio.cancel`)}),(0,Q.jsx)(L,{variant:`destructive`,disabled:!!l,"data-trash-purge-confirm":!0,onClick:()=>void g(),children:i(`custom-ui:trash.purgeConfirm`)})]})]})})]})}function Kn(e){let t=Qe(),[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:I(`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=Qe(),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)(L,{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=Qe().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=Le({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:I(`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)(L,{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=wt(t),{pending:_,sessionId:y}=dt(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:I(`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)(Be,{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)(jt,{id:d,autoFocus:n,rows:2,value:b,maxLength:xt,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)(L,{type:`submit`,size:`sm`,disabled:!C||_,"aria-keyshortcuts":`Meta+Enter Control+Enter`,"data-component-generate":!0,className:`ml-auto`,children:[_&&(0,Q.jsx)(De,{}),o(_?`custom-ui:agent.sending`:`custom-ui:agent.generate`),!_&&(0,Q.jsx)(Oe,{className:`bg-transparent text-current`,children:ke(`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?Re(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)(z,{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)(Be,{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)(z,{className:`flex-1`,title:t(`custom-ui:studio.sourceNotReady`)}):c.error&&s!==$?(0,Q.jsx)(z,{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:Y(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)(F,{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:I(`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)(z,{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)(L,{size:`sm`,variant:`secondary`,"data-studio-settings-open":!0,"aria-label":t(`custom-ui:studio.openSettings`),onClick:e,children:[(0,Q.jsx)(me,{}),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=Ue(t),r=n.measured&&n.width>=1360;return(0,Q.jsx)(Mt,{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 Ie.getState().enterRouteRail(),()=>Ie.getState().leaveRouteRail()},[e])}function pr(e,t){let n=gt(),[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=Et(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(mt(m))?mt(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(mt(n))&&i({id:e.id,target:mt(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=Tt(t),p=dn(t),m=wt(t),[h,g]=(0,Z.useState)(``),[_,v]=(0,Z.useState)(!1),y=q(_),b=(0,Z.useMemo)(()=>Dt(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,A]=(0,Z.useState)(!1),j=q(oe),[se,ce]=(0,Z.useState)(0),[le]=(0,Z.useState)(It),ue=pr(b,d),M=s?b.find(e=>e.id===r)??null:kt(b,r,sr),de=M?.id??``;(0,Z.useEffect)(()=>{de&&(sr=de)},[de]);let N=hr(M,d,mr(n().state));fr(!s&&c&&!l.data?.legacyShape);let fe=e=>{k(`preview`),i(e,!0)},pe=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:Y(c,o)}))),c};if(!c||l.data?.legacyShape)return(0,Q.jsx)(Mt,{variant:`collection`,children:(0,Q.jsx)(R,{kind:`empty`,title:a(`custom-ui:studio.unsupportedTitle`),description:a(`custom-ui:studio.unsupportedHint`)})});if(l.isPending)return(0,Q.jsx)(R,{kind:`loading`,title:a(`custom-ui:customUiPage.loading`)});if(l.error&&!l.data)return(0,Q.jsx)(Mt,{variant:`collection`,children:(0,Q.jsx)(R,{kind:`error`,title:a(`custom-ui:widget.catalogFailed`),action:(0,Q.jsx)(L,{variant:`secondary`,size:`sm`,onClick:()=>void l.refetch(),children:a(`custom-ui:widget.retry`)})})});let me=ut(b,ue),he={...me,attention:me.attention+te.length},_e=yt(b,{filter:D,query:ne,language:o,troubled:ue}),ye=te.length>0&&D!==`enabled`,be=e=>ye?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)}),P=(0,Q.jsx)(Un,{stageId:h,lifecycle:p,onClose:()=>g(``),onTrusted:e=>{g(``),O(`all`),re(``),i(e.id,!s)}}),Se=(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)(Mt,{variant:`collection`,children:(0,Q.jsxs)(`div`,{"data-components-phone":`detail`,className:`flex min-w-0 flex-col gap-4`,children:[(0,Q.jsxs)(L,{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`)]}),M?(0,Q.jsxs)(`div`,{"data-component-stage":M.id,"data-component-kind":M.kind,className:`flex min-w-0 flex-col gap-5`,children:[(0,Q.jsx)(xn,{row:M,actions:f}),(0,Q.jsx)(Sn,{row:M}),M.kind===`native`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(L,{variant:`secondary`,"data-component-prompt-open":!0,className:`min-h-11 w-full`,onClick:()=>v(!0),children:[(0,Q.jsx)(ge,{}),a(`custom-ui:agent.editWithPrompt`)]}),(0,Q.jsx)(Fe,{open:_,onOpenChange:v,children:(0,Q.jsxs)(Me,{side:`bottom`,onCloseAutoFocus:y,"data-component-prompt-sheet":!0,className:`gap-0 rounded-t-[var(--r-lg)] p-0`,children:[(0,Q.jsxs)(Ae,{className:`px-4 pt-4 pb-0`,children:[(0,Q.jsx)(Ne,{children:Y(M,o)}),(0,Q.jsx)(Pe,{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:M,notify:t,autoFocus:!0,className:`border-0 bg-transparent p-0`,onSent:()=>v(!1)})})]})})]}),M.kind===`native`&&M.status===`ready`&&M.manifest&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(Lt,{manifest:M.manifest,target:N.target,window:`standard`,phone:!0,onTarget:N.setTarget,onWindow:N.setWindow}),(0,Q.jsx)(Rt,{activeSessionId:e,row:M,target:N.target,window:`standard`,instanceId:N.instanceId,title:N.draft.title,props:N.draft.props,phone:!0,notify:t,commits:le},se)]}),(0,Q.jsx)(Cn,{row:M,instances:d,selectedInstanceId:N.instanceId,notify:t,actions:f,onSelectInstance:N.selectInstance,onPreview:N.onPreview}),(0,Q.jsx)(wn,{row:M,usageEnabled:T.usage,canRevoke:T.revoke,lifecycle:p}),(0,Q.jsx)(En,{row:M,instances:d,actions:f})]}),M.kind===`native`&&(0,Q.jsx)(hn,{row:M,enabled:T.versions,notify:t,actions:p}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[T.export&&M.kind===`native`&&(0,Q.jsx)(kn,{row:M,lifecycle:p,className:`min-h-11`}),E&&(0,Q.jsx)(On,{row:M,actions:f,variant:`button`,onDeleted:n})]})]}):(0,Q.jsx)(R,{kind:`empty`,title:a(`custom-ui:phone.missingTitle`),description:a(`custom-ui:phone.missingHint`),action:(0,Q.jsx)(L,{variant:`secondary`,className:`min-h-11`,onClick:n,children:a(`custom-ui:phone.allComponents`)})})]})}):(0,Q.jsxs)(Mt,{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:pe,phone:!0,className:`min-h-11`})]}),ye&&(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)(z,{title:a(`custom-ui:customUiPage.emptyTitle`),description:Se}),(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})})]}),P]})}let Ce=M&&(0,Q.jsx)(An,{row:M,instances:d,selectedInstanceId:N.instanceId,canDelete:E,features:T,notify:t,actions:f,lifecycle:p,onSelectInstance:N.selectInstance,onPreview:N.onPreview,onViewSource:()=>{k(`source`),A(!1)},onDeleted:()=>i(``,!0)},M.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:_e,allCount:b.length,counts:he,instances:d,selectedId:M?.id??``,troubled:ue,filter:D,query:ne,root:w,onFilter:O,onQuery:re,onSelect:fe,onCreate:pe,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=>{gt().resume(`preview:${e}`),ce(e=>e+1),k(`preview`),i(e,!0)}}),M?(0,Q.jsx)(ar,{activeSessionId:e,row:M,tab:ae,target:N.target,window:N.window,instanceId:N.instanceId,draft:N.draft,notify:t,commits:le,settingsButton:!n&&(0,Q.jsx)(or,{onOpen:()=>A(!0)}),onTab:k,onTarget:N.setTarget,onWindow:N.setWindow},`${M.id}#${se}`):(0,Q.jsx)(z,{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`):Se}),n&&M&&(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:Ce})]}),!n&&(0,Q.jsx)(Fe,{open:oe&&!!M,onOpenChange:A,children:(0,Q.jsxs)(Me,{side:`right`,showCloseButton:!1,onCloseAutoFocus:j,"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)(Ae,{className:`flex-row items-center justify-between border-b border-stroke px-4 py-2.5`,children:[(0,Q.jsx)(Ne,{className:`text-sm`,children:a(`custom-ui:studio.settings`)}),(0,Q.jsx)(Pe,{className:`sr-only`,children:a(`custom-ui:studio.settingsHint`)}),(0,Q.jsx)(L,{size:`icon-sm`,variant:`ghost`,"aria-label":a(`custom-ui:studio.closeSettings`),onClick:()=>A(!1),children:(0,Q.jsx)(ve,{})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:Ce})]})}),P]})})}function _r({activeSessionId:e,component:t,instance:n,notify:r}){let i=vt(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)(Mt,{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)(L,{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)(me,{}),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)(R,{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)(R,{kind:`loading`,title:i(`custom-ui:customUiPage.loading`)}):a.error?(0,Q.jsx)(R,{kind:`error`,title:i(`custom-ui:widget.catalogFailed`),action:(0,Q.jsx)(L,{variant:`secondary`,onClick:a.refetch,children:i(`custom-ui:widget.retry`)})}):(0,Q.jsx)(R,{kind:`empty`,title:i(`custom-ui:tool.notPlacedTitle`),description:i(`custom-ui:tool.notPlacedHint`),action:(0,Q.jsx)(L,{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{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-D2P6OO3w.js";import{t as i}from"./runtime-capabilities-store--7mKyYAM.js";import{t as a}from"./arrow-right-DqLOhpA2.js";import{t as o}from"./download-BCfIiuaL.js";import{t as s}from"./key-round-C29uZbsf.js";import{t as c}from"./search-D0mqDaf_.js";import{t as l}from"./server-BgNvmqwJ.js";import{t as u}from"./x-07u4-129.js";import{t as d}from"./utils-C8uzG5AZ.js";import{t as f}from"./button-Bu_vuij9.js";import{t as p}from"./kbd-CAufZTkl.js";import{n as m,r as h}from"./config-search-ClE5BFDz.js";import{s as g}from"./shortcuts-BOeaPAvF.js";import{a as _,i as v,l as y,o as b,s as x,t as S}from"./dialog-Kx6RCn3A.js";import{t as C}from"./input-DIwJDpj9.js";import{t as w}from"./BrandLogo-C6O8cv-b.js";var T=e(t(),1),E=n();function D({query:e,onQueryChange:t,onSelect:n,inputRef:a,placement:o=`toolbar`}){let{t:s,language:l}=r(),[u,f]=(0,T.useState)(!1),[_,v]=(0,T.useState)(0),y=(0,T.useRef)(null),b=i(e=>e.capabilities),x=g(`focusSearch`),S=(0,T.useMemo)(()=>h(e,l,{capabilities:b,mobileApp:!!window.__PISPER_MOBILE_APP__}),[l,e,b]);(0,T.useEffect)(()=>v(0),[e]),(0,T.useEffect)(()=>{if(!u)return;let e=e=>{y.current&&!y.current.contains(e.target)&&f(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[u]);let w=e=>{if(f(!1),t(``),e.entry.card===`interface-custom-ui`){n(e.entry.section,`widgets`);return}m(e.entry.card,e.entry.section,{targetId:e.entry.targetId,targetText:e.title,expandGroup:e.entry.expandGroup}),n(e.entry.section)},D=u&&e.trim().length>0;return(0,E.jsxs)(`div`,{ref:y,className:d(`relative`,o===`sidebar`?`w-full`:`w-[min(250px,24vw)] max-[900px]:w-[190px] max-[650px]:col-start-1 max-[650px]:row-start-1 max-[650px]:w-full max-[650px]:min-w-0`),children:[(0,E.jsx)(c,{size:15,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-content-muted`}),(0,E.jsx)(C,{ref:a,value:e,title:s(`navigation:pageHeader.search`),"aria-label":s(`navigation:pageHeader.search`),className:d(`h-8.5 pl-8 text-sm pointer-coarse:min-h-11`,o!==`sidebar`&&`max-[650px]:h-11 max-[650px]:text-[16px]`,o===`sidebar`&&`h-8 border-key-border bg-key pr-9 text-ellipsis shadow-key`),placeholder:s(o===`sidebar`?`config:configSearch.placeholderShort`:`config:configSearch.placeholder`),onChange:e=>{t(e.target.value),f(!0)},onFocus:()=>{e.trim()&&f(!0)},onKeyDown:e=>{e.key===`Escape`?(e.stopPropagation(),t(``),f(!1)):e.key===`ArrowDown`?(e.preventDefault(),v(e=>Math.min(e+1,S.length-1))):e.key===`ArrowUp`?(e.preventDefault(),v(e=>Math.max(e-1,0))):e.key===`Enter`&&S[_]&&(e.preventDefault(),w(S[_]))}}),o===`sidebar`&&x&&!e&&(0,E.jsx)(p,{className:`absolute top-1/2 right-2 -translate-y-1/2 pointer-coarse:hidden`,children:x}),D&&(0,E.jsx)(`div`,{className:`absolute top-full left-0 z-50 mt-1.5 w-full overflow-hidden rounded-md bg-solid shadow-float`,children:S.length===0?(0,E.jsx)(`p`,{role:`status`,className:`px-3 py-3 text-xs text-content-muted`,children:s(`config:configSearch.noResults`)}):(0,E.jsx)(`ul`,{className:`max-h-[280px] overflow-auto py-1`,children:S.map((e,t)=>(0,E.jsx)(`li`,{children:(0,E.jsxs)(`button`,{type:`button`,className:d(`flex w-full flex-col gap-0.5 px-3 py-1.5 text-left pointer-coarse:min-h-11`,t===_?`bg-surface-hover`:`hover:bg-surface-subtle`),onMouseEnter:()=>v(t),onClick:()=>w(e),children:[(0,E.jsx)(`span`,{className:`text-sm text-content`,children:e.title}),(0,E.jsx)(`span`,{className:`text-xs text-content-muted`,children:e.sectionTitle})]})},e.entry.id))})})]})}function O({open:e,onDismiss:t,onOpenImport:n,onOpenSettings:i}){let{t:c}=r();return(0,E.jsx)(S,{open:e,onOpenChange:e=>!e&&t(),children:(0,E.jsxs)(v,{showCloseButton:!1,overlayClassName:`z-[220]`,className:`z-[220] gap-0 rounded-[var(--r-lg)] border border-stroke bg-solid p-0`,style:{maxWidth:`min(28rem, calc(100vw - max(1rem, env(safe-area-inset-left), env(safe-area-inset-right)) - max(1rem, env(safe-area-inset-left), env(safe-area-inset-right))))`,maxHeight:`calc(100dvh - max(1rem, env(safe-area-inset-top), env(safe-area-inset-bottom)) - max(1rem, env(safe-area-inset-top), env(safe-area-inset-bottom)))`},"aria-describedby":`model-onboarding-description`,children:[(0,E.jsxs)(`div`,{className:`relative px-5 pt-5 pb-2 max-[650px]:px-4 max-[650px]:pt-4`,children:[(0,E.jsxs)(x,{className:`gap-3 pr-9 text-left`,children:[(0,E.jsx)(`span`,{"aria-hidden":`true`,className:`w-fit rounded-[13px] shadow-raise`,children:(0,E.jsx)(w,{size:44})}),(0,E.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,E.jsx)(`p`,{className:`text-xs font-medium text-content-muted`,children:c(`config:modelOnboarding.eyebrow`)}),(0,E.jsx)(y,{className:`text-[length:calc(var(--ui-font-size)*10/7)] leading-[1.3] font-semibold tracking-[-.015em]`,children:c(`config:modelOnboarding.title`)}),(0,E.jsx)(_,{id:`model-onboarding-description`,className:`leading-6`,children:c(`config:modelOnboarding.description`)})]})]}),(0,E.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`absolute top-3 right-3 pointer-coarse:size-11`,"aria-label":c(`common:ui.closeDialog`),title:c(`common:ui.closeDialog`),onClick:t,children:(0,E.jsx)(u,{})})]}),(0,E.jsxs)(`div`,{className:`grid gap-3 px-5 pt-2 pb-4 max-[650px]:px-4`,children:[(0,E.jsx)(`ol`,{className:`m-0 list-none divide-y divide-stroke-soft border-y border-stroke-soft p-0`,children:[{Icon:l,title:c(`config:modelOnboarding.connectionTitle`),description:c(`config:modelOnboarding.connectionDescription`)},{Icon:s,title:c(`config:modelOnboarding.modelTitle`),description:c(`config:modelOnboarding.modelDescription`)}].map(({Icon:e,title:t,description:n},r)=>(0,E.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,E.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-7 shrink-0 place-items-center rounded-full bg-surface-subtle text-xs font-medium text-content-secondary tabular-nums`,children:r+1}),(0,E.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,E.jsxs)(`strong`,{className:`flex items-center gap-1.5 text-sm font-medium text-content`,children:[(0,E.jsx)(e,{className:`size-3.5 text-content-muted`,"aria-hidden":`true`}),t]}),(0,E.jsx)(`p`,{className:`text-xs leading-5 text-content-muted`,children:n})]})]},t))}),(0,E.jsxs)(f,{type:`button`,variant:`secondary`,className:`w-full max-[650px]:h-11`,onClick:n,children:[(0,E.jsx)(o,{}),c(`config:modelOnboarding.findExisting`)]})]}),(0,E.jsxs)(b,{className:`m-0 rounded-none px-5 pt-3 max-[650px]:px-4`,style:{paddingBottom:`max(env(safe-area-inset-bottom), 1rem)`},children:[(0,E.jsx)(f,{type:`button`,variant:`ghost`,className:`max-[650px]:h-11`,onClick:t,children:c(`config:modelOnboarding.later`)}),(0,E.jsxs)(f,{type:`button`,className:`max-[650px]:h-11`,onClick:i,children:[c(`config:modelOnboarding.openSettings`),(0,E.jsx)(a,{})]})]})]})})}export{D as ConfigSearchBox,O as ModelOnboardingDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./GitDiffViewer-CSl-SGa1.js";export{e as InlineGitDiff};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./QuickPromptIdeas-gKobqAO3.js";import"./ComposerCommandMenu-BnwvT15Y.js";import{t as e}from"./chat-api-CQ9MShHZ.js";import"./session-change-summary-api-3216hpjE.js";var t=t=>e.getWorkspaceCommands(t);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./index-C4CqzQNY.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
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{c as r,i,o as a,s as o}from"./dist-B_a0oV4U.js";import{i as s,n as c,r as l,t as u}from"./dist-DAs5KRGl.js";import{t as d}from"./utils-C8uzG5AZ.js";import{t as f}from"./touch-target-BsyCgjR5.js";var p=e(t(),1),m=n(),h=Object.defineProperty,g=(e,t)=>h(e,`name`,{value:t,configurable:!0}),_=`Toggle`,v=p.forwardRef(g(function(e,t){let{pressed:n,defaultPressed:o,onPressedChange:s,...c}=e,[l,u]=i({prop:n,onChange:s,defaultProp:o??!1,caller:_});return(0,m.jsx)(r.button,{type:`button`,"aria-pressed":l,"data-state":l?`on`:`off`,"data-disabled":e.disabled?``:void 0,...c,ref:t,onClick:a(e.onClick,()=>{e.disabled||u(!l)})})},`Toggle`)),y=Object.defineProperty,b=(e,t)=>y(e,`name`,{value:t,configurable:!0}),x=`ToggleGroup`,[S,C]=o(x,[l]),w=l(),T=p.forwardRef(b(function(e,t){let{type:n,...r}=e;if(n===`single`)return(0,m.jsx)(O,{role:`radiogroup`,...r,ref:t});if(n===`multiple`)return(0,m.jsx)(k,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${x}\``)},`ToggleGroup`)),[E,D]=S(x),O=p.forwardRef(b(function(e,t){let{value:n,defaultValue:r,onValueChange:a=b(()=>{},`onValueChange`),...o}=e,[s,c]=i({prop:n,defaultProp:r??``,onChange:a,caller:x});return(0,m.jsx)(E,{scope:e.__scopeToggleGroup,type:`single`,value:p.useMemo(()=>s?[s]:[],[s]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(``),[c]),children:(0,m.jsx)(M,{...o,ref:t})})},`ToggleGroupImplSingle`)),k=p.forwardRef(b(function(e,t){let{value:n,defaultValue:r,onValueChange:a=b(()=>{},`onValueChange`),...o}=e,[s,c]=i({prop:n,defaultProp:r??[],onChange:a,caller:x}),l=p.useCallback(e=>c((t=[])=>[...t,e]),[c]),u=p.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return(0,m.jsx)(E,{scope:e.__scopeToggleGroup,type:`multiple`,value:s,onItemActivate:l,onItemDeactivate:u,children:(0,m.jsx)(M,{...o,ref:t})})},`ToggleGroupImplMultiple`)),[A,j]=S(x),M=p.forwardRef(b(function(e,t){let{__scopeToggleGroup:n,disabled:i=!1,rovingFocus:a=!0,orientation:o,dir:l,loop:u=!0,...d}=e,f=w(n),p=s(l),h={dir:p,...d};return(0,m.jsx)(A,{scope:n,rovingFocus:a,disabled:i,children:a?(0,m.jsx)(c,{asChild:!0,...f,orientation:o,dir:p,loop:u,children:(0,m.jsx)(r.div,{...h,ref:t})}):(0,m.jsx)(r.div,{...h,ref:t})})},`ToggleGroupImpl`)),N=`ToggleGroupItem`,P=p.forwardRef(b(function(e,t){let n=D(N,e.__scopeToggleGroup),r=j(N,e.__scopeToggleGroup),i=w(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=p.useRef(null);return r.rovingFocus?(0,m.jsx)(u,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,m.jsx)(F,{...s,ref:t})}):(0,m.jsx)(F,{...s,ref:t})},`ToggleGroupItem`)),F=p.forwardRef(b(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=D(N,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===`single`?o:void 0;return(0,m.jsx)(v,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),I={default:`h-8 pointer-coarse:h-11`,sm:`h-7 pointer-coarse:h-11`},L={default:`h-7 gap-1.5 px-2.5 text-sm pointer-coarse:h-10`,sm:`h-6 gap-1 px-2 text-xs pointer-coarse:h-10`};function R({value:e,onValueChange:t,options:n,size:r=`default`,disabled:i=!1,className:a,...o}){return(0,m.jsx)(T,{type:`single`,role:`radiogroup`,"data-slot":`segmented-control`,"data-size":r,value:e,disabled:i,onValueChange:e=>{e&&t(e)},className:d(`inline-flex w-fit max-w-full items-center gap-0.5 rounded-md bg-surface-muted p-0.5 shadow-[inset_0_0_0_1px_var(--stroke)]`,I[r],a),...o,children:n.map(e=>(0,m.jsxs)(P,{value:e.value,disabled:e.disabled,"aria-label":e.ariaLabel,"data-slot":`segmented-control-item`,className:d(`inline-flex min-w-0 shrink-0 items-center justify-center rounded-sm font-medium whitespace-nowrap text-content-secondary transition-colors duration-(--d-fast) select-none hover:text-foreground focus-visible:z-10 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-solid data-[state=on]:text-foreground data-[state=on]:shadow-[inset_0_0_0_1px_var(--stroke-strong),var(--sh-1)] [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,L[r],`pointer-coarse:min-w-11`,f),children:[e.icon,e.label,e.count!==void 0&&e.count!==null&&(0,m.jsx)(`span`,{className:`font-mono text-xs text-content-muted tabular-nums`,children:e.count})]},e.value))})}export{R as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,n,r}from"./vendor-react-DwNgTV1j.js";import{t as i}from"./createLucideIcon-Cd-3GVxJ.js";import{t as a}from"./check-2vYc6QaP.js";import{t as o}from"./chevron-down-CxtxIjiP.js";import{t as s}from"./chevron-up-D_ZcXjqr.js";import{i as c,n as l}from"./dist-Cfh4kzCK.js";import{a as u,c as d,i as f,n as p,o as m,r as h,s as g,t as _}from"./dist-B_a0oV4U.js";import{n as v}from"./dist-BlIIpW6W.js";import{a as y,i as b}from"./dist-DAs5KRGl.js";import{a as x,i as S,n as C,r as w,s as T,t as E}from"./es2015-0QT3KgdC.js";import{a as D,i as O,r as k,t as A}from"./dist-alOyD2Bh.js";import{t as j}from"./utils-C8uzG5AZ.js";var M=i(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),ee=e(n(),1),N=e(t(),1),te=Object.defineProperty,P=(e,t)=>te(e,`name`,{value:t,configurable:!0});function F(e){let t=N.useRef({value:e,previous:e});return N.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}P(F,`usePrevious`);var ne=Object.defineProperty,I=(e,t)=>ne(e,`name`,{value:t,configurable:!0});function L(e,[t,n]){return Math.min(n,Math.max(t,e))}I(L,`clamp`);var R=r(),z=Object.defineProperty,B=(e,t)=>z(e,`name`,{value:t,configurable:!0}),V=[` `,`Enter`,`ArrowUp`,`ArrowDown`],H=[` `,`Enter`],U=`Select`,[W,G,re]=y(U),[K,ie]=g(U,[re,D]),q=D(),[ae,J]=K(U),[oe,se]=K(U);function ce(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:m,required:h,form:g,internal_do_not_use_render:_}=e,v=q(t),[y,x]=N.useState(null),[S,C]=N.useState(null),[w,T]=N.useState(!1),E=b(l),[D,k]=f({prop:r,defaultProp:i??!1,onChange:a,caller:U}),[A,j]=f({prop:o,defaultProp:s,onChange:c,caller:U}),M=N.useRef(null),ee=N.useRef(A);N.useEffect(()=>{let e=g?y?.ownerDocument.getElementById(g):y?.form;if(e instanceof HTMLFormElement){let t=B(()=>j(ee.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[g,y,j]);let te=!y||!!g||!!y.closest(`form`),[P,F]=N.useState(new Set),ne=p(),I=Array.from(P).map(e=>e.props.value).join(`;`),L=N.useCallback(e=>{F(t=>new Set(t).add(e))},[]),z=N.useCallback(e=>{F(t=>{let n=new Set(t);return n.delete(e),n})},[]),V={required:h,trigger:y,onTriggerChange:x,valueNode:S,onValueNodeChange:C,valueNodeHasChildren:w,onValueNodeHasChildrenChange:T,contentId:ne,value:A,onValueChange:j,open:D,onOpenChange:k,dir:E,triggerPointerDownPosRef:M,disabled:m,name:u,autoComplete:d,form:g,nativeOptions:P,nativeSelectKey:I,isFormControl:te};return(0,R.jsx)(O,{...v,children:(0,R.jsx)(ae,{scope:t,...V,children:(0,R.jsx)(W.Provider,{scope:t,children:(0,R.jsx)(oe,{scope:t,onNativeOptionAdd:L,onNativeOptionRemove:z,children:Ge(_)?_(V):n})})})})}B(ce,`SelectProvider`);var le=B(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,R.jsx)(ce,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,R.jsxs)(R.Fragment,{children:[n,e?(0,R.jsx)(We,{__scopeSelect:t}):null]})})},`Select`),ue=`SelectTrigger`,de=N.forwardRef(B(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=q(n),o=J(ue,n),s=o.disabled||r,l=c(t,o.onTriggerChange),u=G(n),f=N.useRef(`touch`),[p,h,g]=Ke(e=>{let t=u().filter(e=>!e.disabled),n=qe(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),_=B(e=>{s||(o.onOpenChange(!0),g()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,R.jsx)(A,{asChild:!0,...a,children:(0,R.jsx)(d.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":$(o.value)?``:void 0,...i,ref:l,onClick:m(i.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&_(e)}),onPointerDown:m(i.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(_(e),e.preventDefault())}),onKeyDown:m(i.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&h(e.key),!(t&&e.key===` `)&&V.includes(e.key)&&(_(),e.preventDefault())})})})},`SelectTrigger`)),fe=`SelectValue`,pe=N.forwardRef(B(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,l=J(fe,n),{onValueNodeHasChildrenChange:f}=l,p=a!==void 0,m=c(t,l.onValueNodeChange);u(()=>{f(p)},[f,p]);let h=$(l.value);return(0,R.jsx)(d.span,{...s,asChild:!h&&s.asChild,ref:m,style:{pointerEvents:`none`},children:(0,R.jsx)(N.Fragment,{children:h?o:a},h?`placeholder`:`value`)})},`SelectValue`)),me=N.forwardRef(B(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,R.jsx)(d.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[he,ge]=K(`SelectPortal`,{forceMount:void 0}),_e=B(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,R.jsx)(he,{scope:e.__scopeSelect,forceMount:n,children:(0,R.jsx)(S,{asChild:!0,...r})})},`SelectPortal`),Y=`SelectContent`,ve=N.forwardRef(B(function(e,t){let n=ge(Y,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=J(Y,e.__scopeSelect),[o,s]=N.useState();return u(()=>{s(new DocumentFragment)},[]),(0,R.jsx)(h,{present:r||a.open,children:({present:e})=>e?(0,R.jsx)(Se,{...i,ref:t}):(0,R.jsx)(ye,{...i,fragment:o})})},`SelectContent`)),ye=N.forwardRef(B(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?ee.createPortal((0,R.jsx)(be,{scope:n,children:(0,R.jsx)(W.Slot,{scope:n,children:(0,R.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),X=10,[be,Z]=K(Y),xe=l(`SelectContent.RemoveScroll`),Se=N.forwardRef(B(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v,...y}=e,b=J(Y,n),[S,D]=N.useState(null),[O,k]=N.useState(null),A=c(t,D),[j,M]=N.useState(null),[ee,te]=N.useState(null),P=G(n),[F,ne]=N.useState(!1),I=N.useRef(!1);N.useEffect(()=>{if(S)return E(S)},[S]),w();let L=N.useCallback(e=>{let[t,...n]=P().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[P,O]),z=N.useCallback(()=>L([j,S]),[L,j,S]);N.useEffect(()=>{F&&z()},[F,z]);let{onOpenChange:V,triggerPointerDownPosRef:H}=b;N.useEffect(()=>{if(S){let e={x:0,y:0},t=B(t=>{e={x:Math.abs(Math.round(t.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(H.current?.y??0))}},`handlePointerMove`),n=B(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(S)||V(!1),document.removeEventListener(`pointermove`,t),H.current=null},`handlePointerUp`);return H.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[S,V,H]),N.useEffect(()=>{let e=B(()=>V(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[V]);let[U,W]=Ke(e=>{let t=P().filter(e=>!e.disabled),n=qe(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),re=N.useCallback((e,t,n)=>{let r=!I.current&&!n;(b.value!==void 0&&b.value===t||r)&&(M(e),r&&(I.current=!0))},[b.value]),K=N.useCallback(()=>S?.focus(),[S]),ie=N.useCallback((e,t,n)=>{let r=!I.current&&!n;(b.value!==void 0&&b.value===t||r)&&te(e)},[b.value]),q=r===`popper`?we:Ce,ae=q===we?{side:s,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v}:{};return(0,R.jsx)(be,{scope:n,content:S,viewport:O,onViewportChange:k,itemRefCallback:re,selectedItem:j,onItemLeave:K,itemTextRefCallback:ie,focusSelectedItem:z,selectedItemText:ee,position:r,isPositioned:F,searchRef:U,children:(0,R.jsx)(C,{as:xe,allowPinchZoom:!0,children:(0,R.jsx)(x,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:m(i,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,R.jsx)(T,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,R.jsx)(q,{role:`listbox`,id:b.contentId,"data-state":b.open?`open`:`closed`,dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...ae,onPlaced:()=>ne(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...y.style},onKeyDown:m(y.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&W(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=P().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>L(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Ce=N.forwardRef(B(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=J(Y,n),o=Z(Y,n),[s,l]=N.useState(null),[f,p]=N.useState(null),m=c(t,p),h=G(n),g=N.useRef(!1),_=N.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=o,S=N.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&f&&v&&y&&b){let e=a.trigger.getBoundingClientRect(),t=f.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-X,d=L(a,[X,Math.max(X,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-X,d=L(a,[X,Math.max(X,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=h(),c=window.innerHeight-X*2,l=v.scrollHeight,u=window.getComputedStyle(f),d=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),m=parseInt(u.borderBottomWidth,10),_=parseInt(u.paddingBottom,10),x=d+p+l+_+m,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(v),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-X,D=c-E,O=y.offsetHeight/2,k=y.offsetTop+O,A=d+p+k,j=x-A;if(A<=E){let e=o.length>0&&y===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=f.clientHeight-v.offsetTop-v.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+m);s.style.height=n+`px`}else{let e=o.length>0&&y===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,d+v.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,v.scrollTop=A-E+v.offsetTop}s.style.margin=`${X}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>g.current=!0)}},[h,a.trigger,a.valueNode,s,f,v,y,b,a.dir,r]);u(()=>S(),[S]);let[C,w]=N.useState();u(()=>{f&&w(window.getComputedStyle(f).zIndex)},[f]);let T=N.useCallback(e=>{e&&_.current===!0&&(S(),x?.(),_.current=!1)},[S,x]);return(0,R.jsx)(Te,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:g,onScrollButtonChange:T,children:(0,R.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,R.jsx)(d.div,{...i,ref:m,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),we=N.forwardRef(B(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=X,...a}=e,o=q(n);return(0,R.jsx)(k,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[Te,Ee]=K(Y,{}),De=`SelectViewport`,Oe=N.forwardRef(B(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Z(De,n),o=Ee(De,n),s=c(t,a.onViewportChange),l=N.useRef(0);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,R.jsx)(W.Slot,{scope:n,children:(0,R.jsx)(d.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:m(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-X*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})},`SelectViewport`)),[ke,Ae]=K(`SelectGroup`),je=`SelectItem`,[Me,Ne]=K(je),Pe=N.forwardRef(B(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=J(je,n),l=Z(je,n),u=s.value===r,[f,h]=N.useState(a??``),[g,v]=N.useState(!1),y=_(e=>l.itemRefCallback?.(e,r,i)),b=c(t,y),x=p(),S=N.useRef(`touch`),C=B(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,R.jsx)(Me,{scope:n,value:r,disabled:i,textId:x,isSelected:u,onItemTextChange:N.useCallback(e=>{h(t=>t||(e?.textContent??``).trim())},[]),children:(0,R.jsx)(W.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:(0,R.jsx)(d.div,{role:`option`,"aria-labelledby":x,"data-highlighted":g?``:void 0,"aria-selected":u&&g,"data-state":u?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:b,onFocus:m(o.onFocus,()=>v(!0)),onBlur:m(o.onBlur,()=>v(!1)),onClick:m(o.onClick,()=>{S.current!==`mouse`&&C()}),onPointerUp:m(o.onPointerUp,()=>{S.current===`mouse`&&C()}),onPointerDown:m(o.onPointerDown,e=>{S.current=e.pointerType}),onPointerMove:m(o.onPointerMove,e=>{S.current=e.pointerType,i?l.onItemLeave?.():S.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:m(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:m(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(l.searchRef?.current===``||e.key!==` `)&&(H.includes(e.key)&&C(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Q=`SelectItemText`,Fe=N.forwardRef(B(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=J(Q,n),s=Z(Q,n),l=Ne(Q,n),f=se(Q,n),[p,m]=N.useState(null),h=_(e=>s.itemTextRefCallback?.(e,l.value,l.disabled)),g=c(t,m,l.onItemTextChange,h),v=p?.textContent,y=N.useMemo(()=>(0,R.jsx)(`option`,{value:l.value,disabled:l.disabled,children:v},l.value),[l.disabled,l.value,v]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=f;return u(()=>(b(y),()=>x(y)),[b,x,y]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(d.span,{id:l.textId,...a,ref:g}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!$(o.value)?ee.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Ie=`SelectItemIndicator`,Le=N.forwardRef(B(function(e,t){let{__scopeSelect:n,...r}=e;return Ne(Ie,n).isSelected?(0,R.jsx)(d.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Re=`SelectScrollUpButton`,ze=N.forwardRef(B(function(e,t){let n=Z(Re,e.__scopeSelect),r=Ee(Re,e.__scopeSelect),[i,a]=N.useState(!1),o=c(t,r.onScrollButtonChange);return u(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};B(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,R.jsx)(He,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Be=`SelectScrollDownButton`,Ve=N.forwardRef(B(function(e,t){let n=Z(Be,e.__scopeSelect),r=Ee(Be,e.__scopeSelect),[i,a]=N.useState(!1),o=c(t,r.onScrollButtonChange);return u(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};B(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,R.jsx)(He,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),He=N.forwardRef(B(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Z(`SelectScrollButton`,n),o=N.useRef(null),s=G(n),c=N.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return N.useEffect(()=>()=>c(),[c]),u(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,R.jsx)(d.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:m(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:m(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:m(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),Ue=`SelectBubbleInput`,We=N.forwardRef(B(function({__scopeSelect:e,...t},n){let r=J(Ue,e),{value:i,onValueChange:a,required:o,disabled:s,name:l,autoComplete:u,form:f}=r,{nativeOptions:p,nativeSelectKey:m}=r,h=N.useRef(null),g=c(n,h),_=i??``,y=F(_),b=Array.from(p).some(e=>(e.props.value??``)===``);return N.useEffect(()=>{let e=h.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(y!==_&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,_),e.dispatchEvent(t)}},[y,_]),(0,R.jsxs)(d.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:l,autoComplete:u,disabled:s,form:f,onChange:e=>a(e.target.value),...t,style:{...v,...t.style},ref:g,defaultValue:_,children:[$(i)&&!b?(0,R.jsx)(`option`,{value:``}):null,Array.from(p)]},m)},`SelectBubbleInput`));function Ge(e){return typeof e==`function`}B(Ge,`isFunction`);function $(e){return e===``||e===void 0}B($,`shouldShowPlaceholder`);function Ke(e){let t=_(e),n=N.useRef(``),r=N.useRef(0),i=N.useCallback(e=>{let i=n.current+e;t(i),B((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=N.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}B(Ke,`useTypeaheadSearch`);function qe(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Je(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}B(qe,`findNextItem`);function Je(e,t){return e.map((n,r)=>e[(t+r)%e.length])}B(Je,`wrapArray`);function Ye({...e}){return(0,R.jsx)(le,{"data-slot":`select`,...e})}function Xe({...e}){return(0,R.jsx)(pe,{"data-slot":`select-value`,...e})}function Ze({className:e,size:t=`default`,children:n,...r}){return(0,R.jsxs)(de,{"data-slot":`select-trigger`,"data-size":t,className:j(`flex w-fit items-center justify-between gap-1.5 rounded-sm border border-input bg-panel py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-[border-color,box-shadow] outline-none select-none focus-visible:border-focus focus-visible:ring-3 focus-visible:ring-focus-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8.5 data-[size=sm]:h-7 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,R.jsx)(me,{asChild:!0,children:(0,R.jsx)(M,{className:`pointer-events-none size-3.5 text-muted-foreground`})})]})}function Qe({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,R.jsx)(_e,{children:(0,R.jsxs)(ve,{"data-slot":`select-content`,"data-align-trigger":n===`item-aligned`,className:j(`relative z-[200] max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-float duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,R.jsx)(et,{}),(0,R.jsx)(Oe,{"data-position":n,className:j(`data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)`,n===`popper`&&``),children:t}),(0,R.jsx)(tt,{})]})})}function $e({className:e,children:t,...n}){return(0,R.jsxs)(Pe,{"data-slot":`select-item`,className:j(`relative flex min-h-7.5 w-full cursor-default items-center gap-1.5 rounded-sm py-1 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,R.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`,children:(0,R.jsx)(Le,{children:(0,R.jsx)(a,{className:`pointer-events-none text-accent-fg`})})}),(0,R.jsx)(Fe,{children:t})]})}function et({className:e,...t}){return(0,R.jsx)(ze,{"data-slot":`select-scroll-up-button`,className:j(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,R.jsx)(s,{})})}function tt({className:e,...t}){return(0,R.jsx)(Ve,{"data-slot":`select-scroll-down-button`,className:j(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,R.jsx)(o,{})})}export{Xe as a,M as c,Ze as i,Qe as n,L as o,$e as r,F as s,Ye as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./vendor-ui-DvrYggeS.js";import{c as i,i as a,n as o,o as s,r as c,s as l}from"./dist-B_a0oV4U.js";import{i as u,n as d,r as f,t as p}from"./dist-DAs5KRGl.js";import{t as m}from"./utils-C8uzG5AZ.js";var h=e(t(),1),g=n(),_=Object.defineProperty,v=(e,t)=>_(e,`name`,{value:t,configurable:!0}),y=`Tabs`,[b,x]=l(y,[f]),S=f(),[C,w]=b(y),T=h.forwardRef(v(function(e,t){let{__scopeTabs:n,value:r,onValueChange:s,defaultValue:c,orientation:l=`horizontal`,dir:d,activationMode:f=`automatic`,...p}=e,m=u(d),[h,_]=a({prop:r,onChange:s,defaultProp:c??``,caller:y});return(0,g.jsx)(C,{scope:n,baseId:o(),value:h,onValueChange:_,orientation:l,dir:m,activationMode:f,children:(0,g.jsx)(i.div,{dir:m,"data-orientation":l,...p,ref:t})})},`Tabs`)),E=`TabsList`,D=h.forwardRef(v(function(e,t){let{__scopeTabs:n,loop:r=!0,...a}=e,o=w(E,n),s=S(n);return(0,g.jsx)(d,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:(0,g.jsx)(i.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:t})})},`TabsList`)),O=`TabsTrigger`,k=h.forwardRef(v(function(e,t){let{__scopeTabs:n,value:r,disabled:a=!1,...o}=e,c=w(O,n),l=S(n),u=M(c.baseId,r),d=N(c.baseId,r),f=r===c.value;return(0,g.jsx)(p,{asChild:!0,...l,focusable:!a,active:f,children:(0,g.jsx)(i.button,{type:`button`,role:`tab`,"aria-selected":f,"aria-controls":d,"data-state":f?`active`:`inactive`,"data-disabled":a?``:void 0,disabled:a,id:u,...o,ref:t,onMouseDown:s(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?c.onValueChange(r):e.preventDefault()}),onKeyDown:s(e.onKeyDown,e=>{a||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&c.onValueChange(r)}),onFocus:s(e.onFocus,()=>{let e=c.activationMode!==`manual`;!f&&!a&&e&&c.onValueChange(r)})})})},`TabsTrigger`)),A=`TabsContent`,j=h.forwardRef(v(function(e,t){let{__scopeTabs:n,value:r,forceMount:a,children:o,...s}=e,l=w(A,n),u=M(l.baseId,r),d=N(l.baseId,r),f=r===l.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(c,{present:a||f,children:({present:n})=>(0,g.jsx)(i.div,{"data-state":f?`active`:`inactive`,"data-orientation":l.orientation,role:`tabpanel`,"aria-labelledby":u,hidden:!n,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&o})})},`TabsContent`));function M(e,t){return`${e}-trigger-${t}`}v(M,`makeTriggerId`);function N(e,t){return`${e}-content-${t}`}v(N,`makeContentId`);var P=T,F=D,I=k,L=j;function R({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(P,{"data-slot":`tabs`,"data-orientation":t,className:m(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var z=r(`group/tabs-list inline-flex w-fit items-center justify-center rounded-md p-[3px] text-content-secondary group-data-horizontal/tabs:h-8.5 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`border border-stroke bg-chrome`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function B({className:e,variant:t=`default`,...n}){return(0,g.jsx)(F,{"data-slot":`tabs-list`,"data-variant":t,className:m(z({variant:t}),e),...n})}function V({className:e,...t}){return(0,g.jsx)(I,{"data-slot":`tabs-trigger`,className:m(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-sm border border-transparent px-2 py-0.5 text-sm whitespace-nowrap transition-colors group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`data-active:font-medium data-active:text-foreground group-data-[variant=default]/tabs-list:data-active:border-key-border group-data-[variant=default]/tabs-list:data-active:bg-key group-data-[variant=default]/tabs-list:data-active:shadow-key`,`after:absolute after:bg-star after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function H({className:e,...t}){return(0,g.jsx)(L,{"data-slot":`tabs-content`,className:m(`flex-1 text-sm outline-none`,e),...t})}export{V as i,H as n,B as r,R as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./client-store-B-3_7075.js";function r(){let r=n(e=>e.client===`mobile-app`),i=t(),a=e()&&r;return(r||i)&&!a&&typeof window<`u`&&!window.pisperDesktop}function i(){let t=n(e=>e.client===`mobile-app`);return e()&&t}export{i as n,r as t};
|