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
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,n,r}from"./vendor-react-DwNgTV1j.js";import{a as i}from"./dist-41X0pdUs.js";import{a,c as o,l as s,o as c,t as l}from"./dist-BsRXXcSL.js";var u=e(t(),1),d=r(),f=Object.defineProperty,p=(e,t)=>f(e,`name`,{value:t,configurable:!0}),m=`dismissableLayer.update`,h=`dismissableLayer.pointerDownOutside`,g=`dismissableLayer.focusOutside`,_,v=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),y=u.forwardRef(p(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:f,onInteractOutside:h,onDismiss:g,...y}=e,b=u.useContext(v),[x,S]=u.useState(null),T=x?.ownerDocument??globalThis?.document,[,te]=u.useState({}),ne=i(t,S),E=Array.from(b.layers),[D]=[...b.layersWithOutsidePointerEventsDisabled].slice(-1),O=D?E.indexOf(D):-1,k=x?E.indexOf(x):-1,re=b.layersWithOutsidePointerEventsDisabled.size>0,A=k>=O,j=u.useRef(!1),M=C(e=>{s?.(e),h?.(e),e.defaultPrevented||g?.()},{ownerDocument:T,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:j,dismissableSurfaces:b.dismissableSurfaces,shouldHandlePointerDownOutside:u.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...b.branches].some(t=>t.contains(e));return A&&!t},[b.branches,A])}),N=w(e=>{if(r&&j.current)return;let t=e.target;[...b.branches].some(e=>e.contains(t))||(f?.(e),h?.(e),e.defaultPrevented||g?.())},T),P=x?k===E.length-1:!1,F=l(e=>{e.key===`Escape`&&(a?.(e),!e.defaultPrevented&&g&&(e.preventDefault(),g()))});return u.useEffect(()=>{if(P)return T.addEventListener(`keydown`,F,{capture:!0}),()=>T.removeEventListener(`keydown`,F,{capture:!0})},[T,P,F]),u.useEffect(()=>{if(x)return n&&(b.layersWithOutsidePointerEventsDisabled.size===0&&(_=T.body.style.pointerEvents,T.body.style.pointerEvents=`none`),b.layersWithOutsidePointerEventsDisabled.add(x)),b.layers.add(x),ee(),()=>{n&&(b.layersWithOutsidePointerEventsDisabled.delete(x),b.layersWithOutsidePointerEventsDisabled.size===0&&(T.body.style.pointerEvents=_))}},[x,T,n,b]),u.useEffect(()=>()=>{x&&(b.layers.delete(x),b.layersWithOutsidePointerEventsDisabled.delete(x),ee())},[x,b]),u.useEffect(()=>{let e=p(()=>te({}),`handleUpdate`);return document.addEventListener(m,e),()=>document.removeEventListener(m,e)},[]),(0,d.jsx)(o.div,{...y,ref:ne,style:{pointerEvents:re?A?`auto`:`none`:void 0,...e.style},onFocusCapture:c(e.onFocusCapture,N.onFocusCapture),onBlurCapture:c(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:c(e.onPointerDownCapture,M.onPointerDownCapture)})},`DismissableLayer`)),b=u.forwardRef(p(function(e,t){let n=u.useContext(v),r=u.useRef(null),a=i(t,r);return u.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,d.jsx)(o.div,{...e,ref:a})},`DismissableLayerBranch`));function x(){let e=u.useContext(v),[t,n]=u.useState(null);return u.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}p(x,`useDismissableLayerSurface`);var S=p(()=>!0,`IS_TRUE`);function C(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=S}=t,s=l(e),c=u.useRef(!1),d=u.useRef(!1),f=u.useRef(new Map),m=u.useRef(()=>{});return u.useEffect(()=>{function e(){d.current=!1,i.current=!1,f.current.clear()}p(e,`resetOutsideInteraction`);function t(){return Array.from(f.current.values()).some(Boolean)}p(t,`isOutsideInteractionIntercepted`);function l(e){if(!d.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||f.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{d.current&&m.current()},0)}p(l,`handleInteractionCapture`);function u(e){d.current&&f.current.set(e.type,!1)}p(u,`handleInteractionBubble`);let g=p(a=>{if(a.target&&!c.current){let l=function(){n.removeEventListener(`click`,m.current);let r=t();e(),r||T(h,s,u,{discrete:!0})};if(p(l,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,m.current),e(),c.current=!1;return}let u={originalEvent:a};d.current=!0,i.current=r&&a.button===0,f.current.clear(),!r||a.button!==0?l():(n.removeEventListener(`click`,m.current),m.current=l,n.addEventListener(`click`,m.current,{once:!0}))}else n.removeEventListener(`click`,m.current),e();c.current=!1},`handlePointerDown`),_=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of _)n.addEventListener(e,l,!0),n.addEventListener(e,u);let v=window.setTimeout(()=>{n.addEventListener(`pointerdown`,g)},0);return()=>{window.clearTimeout(v),n.removeEventListener(`pointerdown`,g),n.removeEventListener(`click`,m.current);for(let e of _)n.removeEventListener(e,l,!0),n.removeEventListener(e,u)}},[n,s,r,i,a,o]),{onPointerDownCapture:p(()=>c.current=!0,`onPointerDownCapture`)}}p(C,`usePointerDownOutside`);function w(e,t=globalThis?.document){let n=l(e),r=u.useRef(!1);return u.useEffect(()=>{let e=p(e=>{e.target&&!r.current&&T(g,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:p(()=>r.current=!0,`onFocusCapture`),onBlurCapture:p(()=>r.current=!1,`onBlurCapture`)}}p(w,`useFocusOutside`);function ee(){let e=new CustomEvent(m);document.dispatchEvent(e)}p(ee,`dispatchUpdate`);function T(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?s(i,a):i.dispatchEvent(a)}p(T,`handleAndDispatchCustomEvent`);var te=y,ne=b,E=Object.defineProperty,D=(e,t)=>E(e,`name`,{value:t,configurable:!0}),O=`focusScope.autoFocusOnMount`,k=`focusScope.autoFocusOnUnmount`,re={bubbles:!1,cancelable:!0},A=u.forwardRef(D(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...c}=e,[f,p]=u.useState(null),m=l(a),h=l(s),g=u.useRef(null),_=i(t,p),v=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let e=function(e){if(v.paused||!f)return;let t=e.target;f.contains(t)?g.current=t:I(g.current,{select:!0})},t=function(e){if(v.paused||!f)return;let t=e.relatedTarget;t!==null&&(f.contains(t)||I(g.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&I(f)};D(e,`handleFocusIn`),D(t,`handleFocusOut`),D(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return f&&r.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,f,v.paused]),u.useEffect(()=>{if(f){ae.add(v);let e=document.activeElement;if(!f.contains(e)){let t=new CustomEvent(O,re);f.addEventListener(O,m),f.dispatchEvent(t),t.defaultPrevented||(j(ce(N(f)),{select:!0}),document.activeElement===e&&I(f))}return()=>{f.removeEventListener(O,m),setTimeout(()=>{let t=new CustomEvent(k,re);f.addEventListener(k,h),f.dispatchEvent(t),t.defaultPrevented||I(e??document.body,{select:!0}),f.removeEventListener(k,h),ae.remove(v)},0)}}},[f,m,h,v]);let y=u.useCallback(e=>{if(!n&&!r||v.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=M(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&I(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&I(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,v.paused]);return(0,d.jsx)(o.div,{tabIndex:-1,...c,ref:_,onKeyDown:y})},`FocusScope`));function j(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(I(r,{select:t}),document.activeElement!==n)return}D(j,`focusFirst`);function M(e){let t=N(e);return[P(t,e),P(t.reverse(),e)]}D(M,`getTabbableEdges`);function N(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:D(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}D(N,`getTabbableCandidates`);function P(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):F(r,{upTo:t})))return r}D(P,`findVisible`);function F(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}D(F,`isHidden`);function ie(e){return e instanceof HTMLInputElement&&`select`in e}D(ie,`isSelectableInput`);function I(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ie(e)&&t&&e.select()}}D(I,`focus`);var ae=oe();function oe(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=se(e,t),e.unshift(t)},remove(t){e=se(e,t),e[0]?.resume()}}}D(oe,`createFocusScopesStack`);function se(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}D(se,`arrayRemove`);function ce(e){return e.filter(e=>e.tagName!==`A`)}D(ce,`removeLinks`);var le=e(n(),1),ue=Object.defineProperty,de=u.forwardRef(((e,t)=>ue(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,s]=u.useState(!1);a(()=>s(!0),[]);let c=n||i&&globalThis?.document?.body;return c?le.createPortal((0,d.jsx)(o.div,{...r,ref:t}),c):null},`Portal`)),fe=Object.defineProperty,pe=(e,t)=>fe(e,`name`,{value:t,configurable:!0}),L=0,R=null;function me(e){return he(),e.children}pe(me,`FocusGuards`);function he(){u.useEffect(()=>{R||={start:z(),end:z()};let{start:e,end:t}=R;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),L++,()=>{L===1&&(R?.start.remove(),R?.end.remove(),R=null),L=Math.max(0,L-1)}},[])}pe(he,`useFocusGuards`);function z(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}pe(z,`createFocusGuard`);var B=function(){return B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},B.apply(this,arguments)};function ge(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function _e(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var V=`right-scroll-bar-position`,H=`width-before-scroll-bar`,ve=`with-scroll-bars-hidden`,ye=`--removed-body-scroll-bar-size`;function U(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function be(e,t){var n=(0,u.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var xe=typeof window<`u`?u.useLayoutEffect:u.useEffect,Se=new WeakMap;function Ce(e,t){var n=be(t||null,function(t){return e.forEach(function(e){return U(e,t)})});return xe(function(){var t=Se.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||U(e,null)}),i.forEach(function(e){r.has(e)||U(e,a)})}Se.set(n,e)},[e]),n}function we(e){return e}function Te(e,t){t===void 0&&(t=we);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ee(e){e===void 0&&(e={});var t=Te(null);return t.options=B({async:!0,ssr:!1},e),t}var De=function(e){var t=e.sideCar,n=ge(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return u.createElement(r,B({},n))};De.isSideCarExport=!0;function Oe(e,t){return e.useMedium(t),De}var ke=Ee(),W=function(){},G=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:W,onWheelCapture:W,onTouchMoveCapture:W}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=ge(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Ce([n,t]),w=B(B({},x),i);return u.createElement(u.Fragment,null,d&&u.createElement(S,{sideCar:ke,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?u.cloneElement(u.Children.only(s),B(B({},w),{ref:C})):u.createElement(y,B({},w,{className:c,ref:C}),s))});G.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},G.classNames={fullWidth:H,zeroRight:V};var Ae,je=function(){if(Ae)return Ae;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Me(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=je();return t&&e.setAttribute(`nonce`,t),e}function Ne(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Pe(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Fe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Me())&&(Ne(t,n),Pe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ie=function(){var e=Fe();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Le=function(){var e=Ie();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Re={left:0,top:0,right:0,gap:0},ze=function(e){return parseInt(e||``,10)||0},Be=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[ze(n),ze(r),ze(i)]},Ve=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Re;var t=Be(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},He=Le(),K=`data-scroll-locked`,Ue=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
+
.${ve} {
|
|
3
|
+
overflow: hidden ${r};
|
|
4
|
+
padding-right: ${s}px ${r};
|
|
5
|
+
}
|
|
6
|
+
body[${K}] {
|
|
7
|
+
overflow: hidden ${r};
|
|
8
|
+
overscroll-behavior: contain;
|
|
9
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
+
padding-left: ${i}px;
|
|
11
|
+
padding-top: ${a}px;
|
|
12
|
+
padding-right: ${o}px;
|
|
13
|
+
margin-left:0;
|
|
14
|
+
margin-top:0;
|
|
15
|
+
margin-right: ${s}px ${r};
|
|
16
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.${V} {
|
|
20
|
+
right: ${s}px ${r};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.${H} {
|
|
24
|
+
margin-right: ${s}px ${r};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.${V} .${V} {
|
|
28
|
+
right: 0 ${r};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.${H} .${H} {
|
|
32
|
+
margin-right: 0 ${r};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[${K}] {
|
|
36
|
+
${ye}: ${s}px;
|
|
37
|
+
}
|
|
38
|
+
`},We=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Ge=function(){u.useEffect(function(){return document.body.setAttribute(K,(We()+1).toString()),function(){var e=We()-1;e<=0?document.body.removeAttribute(K):document.body.setAttribute(K,e.toString())}},[])},Ke=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Ge();var a=u.useMemo(function(){return Ve(i)},[i]);return u.createElement(He,{styles:Ue(a,!t,i,n?``:`!important`)})},qe=!1;if(typeof window<`u`)try{var q=Object.defineProperty({},"passive",{get:function(){return qe=!0,!0}});window.addEventListener(`test`,q,q),window.removeEventListener(`test`,q,q)}catch{qe=!1}var J=qe?{passive:!1}:!1,Je=function(e){return e.tagName===`TEXTAREA`},Ye=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Je(e)&&n[t]===`visible`)},Xe=function(e){return Ye(e,`overflowY`)},Ze=function(e){return Ye(e,`overflowX`)},Qe=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),tt(e,r)){var i=nt(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},$e=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},et=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},tt=function(e,t){return e===`v`?Xe(t):Ze(t)},nt=function(e,t){return e===`v`?$e(t):et(t)},rt=function(e,t){return e===`h`&&t===`rtl`?-1:1},it=function(e,t,n,r,i){var a=rt(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=nt(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&tt(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Y=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},at=function(e){return[e.deltaX,e.deltaY]},ot=function(e){return e&&`current`in e?e.current:e},st=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ct=function(e){return`
|
|
39
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
+
`},lt=0,X=[];function ut(e){var t=u.useRef([]),n=u.useRef([0,0]),r=u.useRef(),i=u.useState(lt++)[0],a=u.useState(Le)[0],o=u.useRef(e);u.useEffect(function(){o.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=_e([e.lockRef.current],(e.shards||[]).map(ot),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=u.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Y(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Qe(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Qe(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return it(h,t,e,h===`h`?s:c,!0)},[]),c=u.useCallback(function(e){var n=e;if(!(!X.length||X[X.length-1]!==a)){var r=`deltaY`in n?at(n):Y(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&st(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(ot).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=u.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:dt(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=u.useCallback(function(e){n.current=Y(e),r.current=void 0},[]),f=u.useCallback(function(t){l(t.type,at(t),t.target,s(t,e.lockRef.current))},[]),p=u.useCallback(function(t){l(t.type,Y(t),t.target,s(t,e.lockRef.current))},[]);u.useEffect(function(){return X.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,c,J),document.addEventListener(`touchmove`,c,J),document.addEventListener(`touchstart`,d,J),function(){X=X.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,J),document.removeEventListener(`touchmove`,c,J),document.removeEventListener(`touchstart`,d,J)}},[]);var m=e.removeScrollBar,h=e.inert;return u.createElement(u.Fragment,null,h?u.createElement(a,{styles:ct(i)}):null,m?u.createElement(Ke,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ft=Oe(ke,ut),pt=u.forwardRef(function(e,t){return u.createElement(G,B({},e,{ref:t,sideCar:ft}))});pt.classNames=G.classNames;var mt=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Z=new WeakMap,Q=new WeakMap,$={},ht=0,gt=function(e){return e&&(e.host||gt(e.parentNode))},_t=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=gt(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},vt=function(e,t,n,r){var i=_t(t,Array.isArray(e)?e:[e]);$[n]||($[n]=new WeakMap);var a=$[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Z.get(e)||0)+1,l=(a.get(e)||0)+1;Z.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Q.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),ht++,function(){o.forEach(function(e){var t=Z.get(e)-1,i=a.get(e)-1;Z.set(e,t),a.set(e,i),t||(Q.has(e)||e.removeAttribute(r),Q.delete(e)),i||e.removeAttribute(n)}),ht--,ht||(Z=new WeakMap,Z=new WeakMap,Q=new WeakMap,$={})}},yt=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||mt(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),vt(r,i,n,`aria-hidden`)):function(){return null}};export{A as a,te as c,de as i,x as l,pt as n,ne as o,he as r,y as s,yt as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./index-
|
|
1
|
+
import{t as e}from"./index-BDgCJ4Fs.js";import{t}from"./storage-BY6wEHPw.js";var n=Object.freeze([`open`,`left`,`right`,`above`,`below`]);function r(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function i(e,t=`open`,r=``){return!e||!n.includes(t)?null:{sessionId:e,disposition:t,...r?{targetEntryId:r}:{}}}function a(e){if(!e)return null;try{let t=typeof e==`string`?JSON.parse(e):e;return r(t)?i(typeof t.sessionId==`string`?t.sessionId:``,typeof t.disposition==`string`?t.disposition:`open`,typeof t.targetEntryId==`string`?t.targetEntryId:``):null}catch{return null}}var o=`pisper:task-view-will-change`,s=`pisper:session-navigation-will-change`,c=`pisper:session-selected`,l=`pisper:session-create-requested`,u=`pisper:active-session-changed`,d=`pisper:sessions-updated`,f=`pisper:command-palette-requested`,p=`pisper:session-command`,m=`pisper:session-branch-changed`;function h(e){if(!e||typeof e!=`object`)return null;let{cwd:t,prompt:n}=e;if(t!==void 0&&typeof t!=`string`)return null;let r=typeof n==`string`&&n.trim()?n.trim():void 0;return{cwd:typeof t==`string`?t:``,...r?{prompt:r}:{}}}function g(e){if(!e)return null;try{return h(JSON.parse(e))}catch{return null}}function _(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.sessionId==`string`&&typeof t.entryId==`string`?{sessionId:t.sessionId,entryId:t.entryId}:null}catch{return null}}var v=``;function y(e=``){v=typeof e==`string`?e.slice(0,200):``,window.dispatchEvent(new Event(f))}function b(){let e=v;return v=``,e}function x(e){window.dispatchEvent(new CustomEvent(p,{detail:e}))}function S(){let e=g(localStorage.getItem(t.sessionCreateRequest));return localStorage.removeItem(t.sessionCreateRequest),e}function C(n,r=`open`,a=``){let o=i(n,r,a);o&&(window.dispatchEvent(new Event(s)),e.setItem(t.activeSession,n),localStorage.setItem(t.sessionOpenRequest,JSON.stringify(o)),a?localStorage.setItem(t.sessionMessageTarget,JSON.stringify({sessionId:n,entryId:a})):localStorage.removeItem(t.sessionMessageTarget),window.dispatchEvent(new CustomEvent(c,{detail:o})))}function w(e){let n=_(localStorage.getItem(t.sessionMessageTarget));return n?.sessionId===e?n.entryId:``}function T(e,n){let r=_(localStorage.getItem(t.sessionMessageTarget));r?.sessionId===e&&r.entryId===n&&localStorage.removeItem(t.sessionMessageTarget)}function E(){let e=a(localStorage.getItem(t.sessionOpenRequest));return localStorage.removeItem(t.sessionOpenRequest),e}function D(){if(g(localStorage.getItem(t.sessionCreateRequest)))return{type:`create`};let e=a(localStorage.getItem(t.sessionOpenRequest));return e?{type:`open`,sessionId:e.sessionId}:null}function O(e,t=``){window.dispatchEvent(new CustomEvent(u,{detail:{id:e||``,model:t||``}}))}function k(e){window.dispatchEvent(e?new CustomEvent(d,{detail:e}):new Event(d))}function A(e){let t=`detail`in e?e.detail:null;if(!t||typeof t!=`object`)return null;let{id:n,pinned:r,archived:i,unread:a,needsAttention:o,attentionReason:s}=t;return typeof n!=`string`||!n||typeof r!=`boolean`||typeof i!=`boolean`||typeof a!=`boolean`||typeof o!=`boolean`||s!==null&&s!==`approval`&&s!==`failure`?null:{id:n,pinned:r,archived:i,unread:a,needsAttention:o,attentionReason:s}}function j(e,t){let n=e=>{let n=A(e);n&&t(n)};return e.addEventListener(d,n),()=>e.removeEventListener(d,n)}function M(e){let t=`detail`in e?e.detail:null;if(!t||typeof t!=`object`)return null;let{id:n,name:r}=t;return typeof n==`string`&&n.length>0&&typeof r==`string`?{id:n,name:r}:null}function N(e,t){let n=e=>{let n=M(e);n&&t(n)};return e.addEventListener(d,n),()=>e.removeEventListener(d,n)}function P(e){let t=`detail`in e?e.detail:null;if(!t||typeof t!=`object`)return null;let{deletedIds:n}=t;return!Array.isArray(n)||!n.length||!n.every(e=>typeof e==`string`&&e.length>0)?null:{deletedIds:[...new Set(n)]}}function F(e,t){let n=e=>{let n=P(e);n&&t(n)};return e.addEventListener(d,n),()=>e.removeEventListener(d,n)}function I(e){e&&window.dispatchEvent(new CustomEvent(m,{detail:{sessionId:e}}))}function L(e){let t=t=>{let n=`detail`in t?t.detail:null,r=n&&typeof n==`object`?n.sessionId:null;typeof r==`string`&&r&&e(r)};return window.addEventListener(m,t),()=>window.removeEventListener(m,t)}export{b as C,N as S,x as _,s as a,F as b,O as c,T as d,S as f,y as g,D as h,l as i,I as l,w as m,f as n,c as o,E as p,p as r,o as s,u as t,k as u,C as v,j as x,L as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-B0Z9INg1.js";import{i as e,r as t}from"./vendor-react-DwNgTV1j.js";import{t as n}from"./vendor-ui-DvrYggeS.js";import{t as r}from"./label-
|
|
1
|
+
import"./rolldown-runtime-B0Z9INg1.js";import{i as e,r as t}from"./vendor-react-DwNgTV1j.js";import{t as n}from"./vendor-ui-DvrYggeS.js";import{t as r}from"./label-CVWjEcfV.js";import"./separator-BPh_qxvc.js";import{t as i}from"./utils-C8uzG5AZ.js";e();var a=t();n(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function o({className:e,variant:t=`default`,...n}){return(0,a.jsx)(r,{"data-slot":`field-label`,"data-variant":t,className:i(t==="default"&&`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-star-border has-data-checked:bg-star-soft has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,t===`control`&&`mt-2.5 flex w-full min-w-0 flex-col items-stretch gap-1.5 text-xs font-medium text-content-secondary [&_[data-slot=input]]:font-normal [&_[data-slot=textarea]]:font-normal`,e),...n})}export{o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{u as t}from"./vendor-router-CSN_DGvx.js";import{t as n}from"./index-C4CqzQNY.js";import{i as r,r as i}from"./vendor-react-DwNgTV1j.js";import{o as a,r as o}from"./routes-Da0OHSy6.js";import{t as s}from"./use-i18n-D2P6OO3w.js";import{a as c,i as l,o as u}from"./vendor-state-GkUciC5H.js";import{r as d,t as f}from"./useQuery-Bg3cTjsY.js";import{A as p,j as m,n as h,r as g,t as _}from"./session-scope-Bw40iOXx.js";import{t as v}from"./createLucideIcon-Cd-3GVxJ.js";import{t as y}from"./ellipsis-CfGKfbq6.js";import{t as ee}from"./grip-vertical-B__LYT0s.js";import{t as b}from"./plus-fQbSqB1n.js";import{t as te}from"./rotate-ccw-C0v8V77_.js";import{t as x}from"./settings-2-CXJjXJS9.js";import{t as S}from"./x-07u4-129.js";import{c as C,d as w,f as T,i as E,p as D,r as ne,t as re,u as O}from"./dropdown-menu-gZkWDhaR.js";import{i as k,n as ie,t as ae}from"./popover-DT3PkPcL.js";import{t as A}from"./utils-C8uzG5AZ.js";import{t as j}from"./button-Bu_vuij9.js";import{D as M,E as N,P as oe,T as se,d as ce,k as P,l as F,r as I,t as L,x as R}from"./use-studio-actions-CIA2TwfZ.js";var le=v(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),ue=v(`square-arrow-out-up-right`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),z=e(r(),1),B=e=>Math.min(1,Math.max(0,e)),V=e=>Number.isFinite(e)?Math.max(0,e):0,H=8,U=12,de=160;function fe(e,t,n=0){let r=Math.max(0,V(e.width)-V(t.width)),i=Math.max(0,V(e.height)-V(t.height)),a=Math.max(0,i-de),o=Math.max(0,a-H),s=V(t.height)+U,c=s?Math.floor(o/s)+1:1,l=Math.max(0,Math.floor(n)),u=Math.floor(l/c),d=l%c,f=r-H-u*(V(t.width)+U),p=a-d*s;return{x:r?B(f/r):1,y:i?B(p/i):1}}function W(e,t){return`${t?`mobile`:`desktop`}:${e}`}function G(e,t,n){return{x:B(e.x)*Math.max(0,V(t.width)-V(n.width)),y:B(e.y)*Math.max(0,V(t.height)-V(n.height))}}function K(e,t,n,r){let i=G(e,n,r),a=Math.max(0,V(n.width)-V(r.width)),o=Math.max(0,V(n.height)-V(r.height));return{x:B(a?(i.x+t.x)/a:e.x),y:B(o?(i.y+t.y)/o:e.y)}}function q(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J(e){if(!Array.isArray(e))return[];let t=new Map;for(let n of e)!q(n)||typeof n.key!=`string`||!/^(desktop|mobile):[a-zA-Z0-9][a-zA-Z0-9._:-]{0,95}$/.test(n.key)||!q(n.position)||typeof n.position.x!=`number`||!Number.isFinite(n.position.x)||typeof n.position.y!=`number`||!Number.isFinite(n.position.y)||(t.delete(n.key),t.set(n.key,{x:B(n.position.x),y:B(n.position.y)}),t.size>128&&t.delete(t.keys().next().value??``));return[...t].map(([e,t])=>({key:e,position:t}))}function pe(e,t,n){return J([...e.filter(e=>e.key!==t),{key:t,position:n}])}var me=l(()=>({getItem:e=>{try{return n.getItem(e)}catch{return null}},setItem:(e,t)=>{try{n.setItem(e,t)}catch{}},removeItem:e=>{try{n.removeItem(e)}catch{}}})),Y=u()(c(e=>({positions:[],setPosition:(t,n)=>e(e=>({positions:pe(e.positions,t,n)})),resetPosition:t=>e(e=>({positions:e.positions.filter(e=>e.key!==t)}))}),{name:`pisper-floating-placement`,version:1,storage:me,partialize:({positions:e})=>({positions:e}),merge:(e,t)=>({...t,positions:J(e&&typeof e==`object`&&`positions`in e?e.positions:void 0)})})),X=i(),Z={width:0,height:0},he=/^(?:desktop|mobile):[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Q=`flex items-center justify-center rounded-full bg-key text-content-muted shadow-key ring-1 ring-key-border hover:text-content`;function ge(e){let t=e.component.manifest,n=t&&M(t,`floating`)?.size||se;return{width:n.w,height:n.h}}function _e({placed:e,boundaryRef:t,activeSessionId:n,notify:r,onClose:i,stackIndex:a}){let{t:o}=s(),{instance:c,component:l}=e,u=F(l,r),d=W(c.instanceId,!1),f=Y(e=>e.positions.find(e=>e.key===d)?.position),p=(0,z.useRef)(null),m=(0,z.useRef)(null),[h,g]=(0,z.useState)(null),[_,v]=(0,z.useState)({bounds:Z,widget:Z}),y=f??fe(_.bounds,_.widget,a),b=(0,z.useId)(),x=ge(e),C=c.title||l.manifest?.name||l.name;(0,z.useEffect)(()=>{let e=t.current,n=p.current;if(!e||!n)return;let r=()=>{let t={bounds:{width:e.clientWidth,height:e.clientHeight},widget:{width:n.offsetWidth,height:n.offsetHeight}};v(e=>e.bounds.width===t.bounds.width&&e.bounds.height===t.bounds.height&&e.widget.width===t.widget.width&&e.widget.height===t.widget.height?e:t)},i=new ResizeObserver(()=>r());return r(),i.observe(e),i.observe(n),window.addEventListener(`resize`,r),()=>{i.disconnect(),window.removeEventListener(`resize`,r)}},[t]),(0,z.useEffect)(()=>(g(null),()=>{let e=m.current;m.current=null,e?.element.hasPointerCapture(e.pointerId)&&e.element.releasePointerCapture(e.pointerId)}),[d]);let w=(e,t)=>{let n=m.current;!n||n.pointerId!==e.pointerId||(m.current=null,t&&Y.getState().setPosition(d,n.latest),g(null),n.element.hasPointerCapture(n.pointerId)&&n.element.releasePointerCapture(n.pointerId))},T=()=>Y.getState().resetPosition(d),E=e=>{let t=e.shiftKey?32:12,n={ArrowLeft:{x:-t,y:0},ArrowRight:{x:t,y:0},ArrowUp:{x:0,y:-t},ArrowDown:{x:0,y:t}};if(e.key===`Home`){e.preventDefault(),T();return}let r=n[e.key];r&&(e.preventDefault(),Y.getState().setPosition(d,K(y,r,_.bounds,_.widget)))},D=G(h??y,_.bounds,_.widget);return(0,X.jsxs)(`div`,{ref:p,role:`group`,"aria-label":C,"data-floating-widget":c.instanceId,"data-floating-component":l.id,className:`pointer-events-auto absolute flex max-w-full flex-col px-6`,style:{left:D.x,top:D.y,width:x.width+48,maxHeight:`100%`,visibility:_.bounds.width>0?`visible`:`hidden`},children:[(0,X.jsxs)(`div`,{className:`absolute top-1/2 left-0 z-10 flex -translate-y-1/2 flex-col items-center gap-1`,children:[(0,X.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.move`),"aria-describedby":b,title:o(`custom-ui:floating.moveHint`),className:A(Q,`h-6 w-5 touch-none`),style:{cursor:h?`grabbing`:`grab`},"data-floating-move":!0,onKeyDown:E,onPointerDown:e=>{e.button!==0||m.current||(e.preventDefault(),e.currentTarget.focus({preventScroll:!0}),e.currentTarget.setPointerCapture(e.pointerId),m.current={pointerId:e.pointerId,element:e.currentTarget,x:e.clientX,y:e.clientY,initial:y,latest:y},g(y))},onPointerMove:e=>{let t=m.current;if(!t||t.pointerId!==e.pointerId)return;let n=K(t.initial,{x:e.clientX-t.x,y:e.clientY-t.y},_.bounds,_.widget);t.latest=n,g(n)},onPointerUp:e=>w(e,!0),onPointerCancel:e=>w(e,!1),onLostPointerCapture:e=>w(e,!1),children:(0,X.jsx)(ee,{className:`size-3`})}),(0,X.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.resetPosition`),title:o(`custom-ui:floating.resetPosition`),onClick:T,className:A(Q,`size-5`),children:(0,X.jsx)(te,{className:`size-3`})}),(0,X.jsx)(`span`,{id:b,className:`sr-only`,children:o(`custom-ui:floating.moveHint`)})]}),(0,X.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.close`),title:o(`custom-ui:floating.close`),"data-floating-close":!0,onClick:()=>i(c.instanceId),className:A(Q,`absolute top-1/2 right-0 z-10 size-5 -translate-y-1/2`),children:(0,X.jsx)(S,{className:`size-3`})}),(0,X.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-md border border-stroke bg-panel shadow-key`,style:{height:x.height},children:(0,X.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`floating`,title:c.title,props:c.props},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onRequestFix:u,className:`h-full`})})]})}function ve({placed:e,activeSessionId:t,notify:n,hidden:r=!1}){let{t:i}=s(),a=d(),o=(0,z.useRef)(null);(0,z.useEffect)(()=>{let e=Y.getState();for(let t of e.positions)he.test(t.key)||e.resetPosition(t.key)},[]);let c=e=>{p(e,{enabled:!1}).then(()=>a.invalidateQueries({queryKey:m.instances()}),()=>n(i(`custom-ui:floating.closeFailed`)))};return(0,X.jsx)(`div`,{ref:o,className:`pointer-events-none fixed inset-x-2 top-12 bottom-2 z-40 overflow-hidden`,hidden:r,"data-floating-custom-ui":!0,children:e.map((e,r)=>(0,X.jsx)(_e,{placed:e,boundaryRef:o,activeSessionId:t,notify:n,onClose:c,stackIndex:r},e.instance.instanceId))})}var ye=[`session-panel`,`feature-page`,`floating`];function be(e,t){let{instance:n,component:r}=e;return n.title||r.manifest?.i18n[t]?.name||r.name}function xe({placed:e,label:n,instances:r,notify:i}){let{t:o}=s(),c=t(),l=L(i),[u,d]=(0,z.useState)(!1),{instance:f,component:p}=e,m=async e=>{if(!u){d(!0);try{if(!await l.place(p,r,{surface:e,...f.title?{title:f.title}:{},props:f.props}))return;await l.unplace(f)&&i(o(`custom-ui:overview.moved`,{place:I(e,o)}))}finally{d(!1)}}};return(0,X.jsxs)(re,{children:[(0,X.jsx)(D,{asChild:!0,children:(0,X.jsx)(j,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`flex-none`,disabled:u,"aria-label":o(`custom-ui:overview.menu`,{name:n}),title:o(`custom-ui:overview.menu`,{name:n}),"data-overview-component-menu":!0,children:(0,X.jsx)(y,{"aria-hidden":`true`})})}),(0,X.jsxs)(ne,{align:`end`,className:`w-52`,children:[(0,X.jsxs)(E,{onSelect:()=>c(a(p.id),{state:{componentInstanceId:f.instanceId}}),children:[(0,X.jsx)(x,{"aria-hidden":`true`}),o(`custom-ui:overview.settings`)]}),(0,X.jsxs)(E,{onSelect:()=>c(a(p.id)),children:[(0,X.jsx)(ue,{"aria-hidden":`true`}),o(`custom-ui:tool.openInStudio`)]}),(0,X.jsxs)(O,{children:[(0,X.jsxs)(T,{"data-overview-component-move":!0,children:[(0,X.jsx)(le,{"aria-hidden":`true`}),o(`custom-ui:overview.move`)]}),(0,X.jsx)(w,{className:`w-48`,children:ye.map(e=>{let t=R(p.manifest,e),n=r.some(t=>t.componentId===p.id&&t.surface===e&&t.enabled);return(0,X.jsxs)(E,{disabled:!t||n,"data-overview-component-move-to":e,onSelect:()=>void m(e),children:[I(e,o),(0,X.jsx)(`span`,{className:`ml-auto text-xs text-content-muted`,children:t?n?o(`custom-ui:studio.placed`):``:o(`custom-ui:studio.placeUndeclaredShort`)})]},e)})})]}),(0,X.jsx)(C,{}),(0,X.jsxs)(E,{"data-overview-component-remove":!0,onSelect:()=>{l.unplace(f).then(e=>{e&&i(o(`custom-ui:overview.removed`,{name:n}))})},children:[(0,X.jsx)(S,{"aria-hidden":`true`}),o(`custom-ui:overview.remove`)]})]})]})}function Se({placed:e,instances:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a,language:o}=s(),{instance:c,component:l}=e,u=c.size===`M`?`M`:`S`,d=be(e,o),f=F(l,r);return(0,X.jsxs)(`article`,{"aria-label":d,"data-overview-component":c.instanceId,"data-overview-component-id":l.id,"data-overview-component-size":u,className:`flex-none overflow-hidden rounded-[var(--r-lg)] bg-panel ring-1 ring-stroke`,children:[(0,X.jsxs)(`header`,{className:`flex h-9 items-center gap-2 border-b border-stroke-soft pr-1 pl-3 pointer-coarse:h-12`,children:[(0,X.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[13px] leading-5 font-medium text-content`,children:d}),(0,X.jsx)(`span`,{className:`flex-none rounded-xs border border-stroke px-1.5 text-[11px] leading-4 text-content-muted`,children:a(`custom-ui:overview.badge`)}),(0,X.jsx)(xe,{placed:e,label:d,instances:t,notify:r})]}),(0,X.jsx)(`div`,{"data-overview-component-body":!0,className:`overflow-hidden`,style:{height:N[u].h},children:(0,X.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`overview-card`,title:c.title,props:c.props,size:u},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onOpenSession:i,onRequestFix:f,className:`h-full`})})]})}function $({className:e}){let{t:n}=s(),r=t();return(0,X.jsxs)(`button`,{type:`button`,"data-overview-component-place":!0,onClick:()=>r(o.components),className:A(`flex h-9 w-full flex-none items-center justify-center gap-1.5 rounded-[var(--r-lg)] border border-dashed border-stroke-strong text-[12.5px] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,e),children:[(0,X.jsx)(b,{className:`size-3.5`,"aria-hidden":`true`}),n(`custom-ui:overview.place`)]})}function Ce({placed:e,layout:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a}=s(),o=f(g()).data?.instances??[],c=e.map(e=>(0,X.jsx)(Se,{placed:e,instances:o,activeSessionId:n,notify:r,onOpenSession:i},e.instance.instanceId));return t===`popover`?(0,X.jsxs)(ae,{children:[(0,X.jsx)(k,{asChild:!0,children:(0,X.jsx)(j,{variant:`outline`,"data-overview-components-trigger":!0,children:a(`custom-ui:overview.trigger`,{count:e.length})})}),(0,X.jsxs)(ie,{align:`end`,"aria-label":a(`custom-ui:overview.heading`),"data-overview-components":`popover`,className:`max-h-(--radix-popover-content-available-height) w-[344px] gap-3 overflow-y-auto p-3`,children:[c,(0,X.jsx)($,{})]})]}):(0,X.jsxs)(`div`,{"data-overview-components":t,className:A(`flex flex-col gap-3`,t===`phone`&&`mt-6`),children:[(0,X.jsx)(`h2`,{className:`text-[13px] leading-5 font-medium text-content-secondary`,children:a(`custom-ui:overview.heading`)}),c,(0,X.jsx)($,{})]})}function we({placed:e,sessionId:t,cwd:n,notify:r,onOpenSession:i}){let a=oe().find(e=>e.id===t),o=a?.title??``,s=a?.status??`idle`,c=(0,z.useMemo)(()=>({id:t,title:o,cwd:a?.cwd||n,status:s}),[n,t,s,a?.cwd,o]),{instance:l,component:u}=e,d=F(u,r);return(0,X.jsx)(`div`,{"data-session-panel-component":l.instanceId,className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:(0,X.jsx)(P,{component:u,instance:{instanceId:l.instanceId,surface:`session-panel`,title:l.title,props:l.props},session:c,notify:r,onOpenSession:i,onRequestFix:d,className:`h-full`},t)})}function Te(e,t){return e.manifest?.i18n[t]?.name||e.name}function Ee({cwd:e,notify:t,onAdded:n}){let{t:r,language:i}=s(),a=f(h()),o=f(g()),c=L(t),[l,u]=(0,z.useState)(null),d=o.data?.instances??[],p=(a.data?.components??[]).filter(e=>ce(e)&&R(e.manifest,`session-panel`)),m=async(e,t)=>{if(!l){u(e.id);try{let r=await c.place(e,d,{surface:`session-panel`,scope:t});r&&n(r.instance.instanceId)}finally{u(null)}}};return a.isPending||o.isPending?(0,X.jsx)(`p`,{role:`status`,className:`text-content-muted`,children:r(`custom-ui:customUiPage.loading`)}):a.error||o.error?(0,X.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,X.jsx)(`p`,{role:`alert`,className:`text-content-secondary`,children:r(`custom-ui:widget.catalogFailed`)}),(0,X.jsx)(j,{type:`button`,size:`sm`,variant:`secondary`,onClick:()=>{a.refetch(),o.refetch()},children:r(`custom-ui:widget.retry`)})]}):p.length?(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-session-component-add-menu":!0,children:[(0,X.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.addHint`)}),(0,X.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:p.map(t=>{let a=Te(t,i),o=d.find(e=>e.componentId===t.id&&e.surface===`session-panel`),s=!!(o?.enabled&&_(o.scope,e));return(0,X.jsxs)(`li`,{"data-session-component-candidate":t.id,className:`flex flex-col gap-1.5 rounded-sm px-1.5 py-1.5`,children:[(0,X.jsx)(`span`,{className:`truncate text-[13px] font-medium text-content`,children:a}),s&&o?(0,X.jsx)(j,{type:`button`,size:`sm`,variant:`ghost`,className:`self-start`,onClick:()=>n(o.instanceId),children:r(`custom-ui:studio.placed`)}):(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,X.jsx)(j,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null,"data-session-component-scope":`all`,onClick:()=>void m(t,{type:`all`}),children:r(`custom-ui:studio.scopeAll`)}),(0,X.jsx)(j,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null||!e,"data-session-component-scope":`project`,onClick:()=>void m(t,{type:`project`,cwd:e}),children:r(`custom-ui:sessionPanel.thisProject`)})]})]},t.id)})})]}):(0,X.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.empty`)})}export{P as ComponentHost,ve as FloatingComponents,Ce as OverviewComponents,Ee as SessionComponentAddMenu,we as SessionPanelComponent};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{u as t}from"./vendor-router-CSN_DGvx.js";import{t as n}from"./index-BDgCJ4Fs.js";import{i as r,r as i}from"./vendor-react-DwNgTV1j.js";import{o as a,r as o}from"./routes-Da0OHSy6.js";import{t as s}from"./use-i18n-CVZdp2ZN.js";import{a as c,i as l,o as u}from"./vendor-state-GkUciC5H.js";import{r as d,t as f}from"./useQuery-Bg3cTjsY.js";import{A as p,j as m,n as h,r as g,t as _}from"./session-scope-t_l7TRH5.js";import{t as v}from"./createLucideIcon-Cd-3GVxJ.js";import{t as y}from"./ellipsis-CfGKfbq6.js";import{t as ee}from"./grip-vertical-B__LYT0s.js";import{t as b}from"./plus-fQbSqB1n.js";import{t as te}from"./rotate-ccw-C0v8V77_.js";import{t as x}from"./settings-2-CXJjXJS9.js";import{t as S}from"./x-07u4-129.js";import{c as C,d as w,f as T,i as E,p as D,r as ne,t as re,u as O}from"./dropdown-menu-CFIFNaKO.js";import{i as k,n as ie,t as ae}from"./popover-BtcdIPRz.js";import{t as A}from"./utils-C8uzG5AZ.js";import{t as j}from"./button-CCcCN8tE.js";import{D as M,E as N,P as oe,T as se,d as ce,k as P,l as F,r as I,t as L,x as R}from"./use-studio-actions-C4Zh15Vx.js";var le=v(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),ue=v(`square-arrow-out-up-right`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),z=e(r(),1),B=e=>Math.min(1,Math.max(0,e)),V=e=>Number.isFinite(e)?Math.max(0,e):0,H=8,U=12,de=160;function fe(e,t,n=0){let r=Math.max(0,V(e.width)-V(t.width)),i=Math.max(0,V(e.height)-V(t.height)),a=Math.max(0,i-de),o=Math.max(0,a-H),s=V(t.height)+U,c=s?Math.floor(o/s)+1:1,l=Math.max(0,Math.floor(n)),u=Math.floor(l/c),d=l%c,f=r-H-u*(V(t.width)+U),p=a-d*s;return{x:r?B(f/r):1,y:i?B(p/i):1}}function W(e,t){return`${t?`mobile`:`desktop`}:${e}`}function G(e,t,n){return{x:B(e.x)*Math.max(0,V(t.width)-V(n.width)),y:B(e.y)*Math.max(0,V(t.height)-V(n.height))}}function K(e,t,n,r){let i=G(e,n,r),a=Math.max(0,V(n.width)-V(r.width)),o=Math.max(0,V(n.height)-V(r.height));return{x:B(a?(i.x+t.x)/a:e.x),y:B(o?(i.y+t.y)/o:e.y)}}function q(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J(e){if(!Array.isArray(e))return[];let t=new Map;for(let n of e)!q(n)||typeof n.key!=`string`||!/^(desktop|mobile):[a-zA-Z0-9][a-zA-Z0-9._:-]{0,95}$/.test(n.key)||!q(n.position)||typeof n.position.x!=`number`||!Number.isFinite(n.position.x)||typeof n.position.y!=`number`||!Number.isFinite(n.position.y)||(t.delete(n.key),t.set(n.key,{x:B(n.position.x),y:B(n.position.y)}),t.size>128&&t.delete(t.keys().next().value??``));return[...t].map(([e,t])=>({key:e,position:t}))}function pe(e,t,n){return J([...e.filter(e=>e.key!==t),{key:t,position:n}])}var me=l(()=>({getItem:e=>{try{return n.getItem(e)}catch{return null}},setItem:(e,t)=>{try{n.setItem(e,t)}catch{}},removeItem:e=>{try{n.removeItem(e)}catch{}}})),Y=u()(c(e=>({positions:[],setPosition:(t,n)=>e(e=>({positions:pe(e.positions,t,n)})),resetPosition:t=>e(e=>({positions:e.positions.filter(e=>e.key!==t)}))}),{name:`pisper-floating-placement`,version:1,storage:me,partialize:({positions:e})=>({positions:e}),merge:(e,t)=>({...t,positions:J(e&&typeof e==`object`&&`positions`in e?e.positions:void 0)})})),X=i(),Z={width:0,height:0},he=/^(?:desktop|mobile):[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Q=`flex items-center justify-center rounded-full bg-key text-content-muted shadow-key ring-1 ring-key-border hover:text-content`;function ge(e){let t=e.component.manifest,n=t&&M(t,`floating`)?.size||se;return{width:n.w,height:n.h}}function _e({placed:e,boundaryRef:t,activeSessionId:n,notify:r,onClose:i,stackIndex:a}){let{t:o}=s(),{instance:c,component:l}=e,u=F(l,r),d=W(c.instanceId,!1),f=Y(e=>e.positions.find(e=>e.key===d)?.position),p=(0,z.useRef)(null),m=(0,z.useRef)(null),[h,g]=(0,z.useState)(null),[_,v]=(0,z.useState)({bounds:Z,widget:Z}),y=f??fe(_.bounds,_.widget,a),b=(0,z.useId)(),x=ge(e),C=c.title||l.manifest?.name||l.name;(0,z.useEffect)(()=>{let e=t.current,n=p.current;if(!e||!n)return;let r=()=>{let t={bounds:{width:e.clientWidth,height:e.clientHeight},widget:{width:n.offsetWidth,height:n.offsetHeight}};v(e=>e.bounds.width===t.bounds.width&&e.bounds.height===t.bounds.height&&e.widget.width===t.widget.width&&e.widget.height===t.widget.height?e:t)},i=new ResizeObserver(()=>r());return r(),i.observe(e),i.observe(n),window.addEventListener(`resize`,r),()=>{i.disconnect(),window.removeEventListener(`resize`,r)}},[t]),(0,z.useEffect)(()=>(g(null),()=>{let e=m.current;m.current=null,e?.element.hasPointerCapture(e.pointerId)&&e.element.releasePointerCapture(e.pointerId)}),[d]);let w=(e,t)=>{let n=m.current;!n||n.pointerId!==e.pointerId||(m.current=null,t&&Y.getState().setPosition(d,n.latest),g(null),n.element.hasPointerCapture(n.pointerId)&&n.element.releasePointerCapture(n.pointerId))},T=()=>Y.getState().resetPosition(d),E=e=>{let t=e.shiftKey?32:12,n={ArrowLeft:{x:-t,y:0},ArrowRight:{x:t,y:0},ArrowUp:{x:0,y:-t},ArrowDown:{x:0,y:t}};if(e.key===`Home`){e.preventDefault(),T();return}let r=n[e.key];r&&(e.preventDefault(),Y.getState().setPosition(d,K(y,r,_.bounds,_.widget)))},D=G(h??y,_.bounds,_.widget);return(0,X.jsxs)(`div`,{ref:p,role:`group`,"aria-label":C,"data-floating-widget":c.instanceId,"data-floating-component":l.id,className:`pointer-events-auto absolute flex max-w-full flex-col px-6`,style:{left:D.x,top:D.y,width:x.width+48,maxHeight:`100%`,visibility:_.bounds.width>0?`visible`:`hidden`},children:[(0,X.jsxs)(`div`,{className:`absolute top-1/2 left-0 z-10 flex -translate-y-1/2 flex-col items-center gap-1`,children:[(0,X.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.move`),"aria-describedby":b,title:o(`custom-ui:floating.moveHint`),className:A(Q,`h-6 w-5 touch-none`),style:{cursor:h?`grabbing`:`grab`},"data-floating-move":!0,onKeyDown:E,onPointerDown:e=>{e.button!==0||m.current||(e.preventDefault(),e.currentTarget.focus({preventScroll:!0}),e.currentTarget.setPointerCapture(e.pointerId),m.current={pointerId:e.pointerId,element:e.currentTarget,x:e.clientX,y:e.clientY,initial:y,latest:y},g(y))},onPointerMove:e=>{let t=m.current;if(!t||t.pointerId!==e.pointerId)return;let n=K(t.initial,{x:e.clientX-t.x,y:e.clientY-t.y},_.bounds,_.widget);t.latest=n,g(n)},onPointerUp:e=>w(e,!0),onPointerCancel:e=>w(e,!1),onLostPointerCapture:e=>w(e,!1),children:(0,X.jsx)(ee,{className:`size-3`})}),(0,X.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.resetPosition`),title:o(`custom-ui:floating.resetPosition`),onClick:T,className:A(Q,`size-5`),children:(0,X.jsx)(te,{className:`size-3`})}),(0,X.jsx)(`span`,{id:b,className:`sr-only`,children:o(`custom-ui:floating.moveHint`)})]}),(0,X.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.close`),title:o(`custom-ui:floating.close`),"data-floating-close":!0,onClick:()=>i(c.instanceId),className:A(Q,`absolute top-1/2 right-0 z-10 size-5 -translate-y-1/2`),children:(0,X.jsx)(S,{className:`size-3`})}),(0,X.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-md border border-stroke bg-panel shadow-key`,style:{height:x.height},children:(0,X.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`floating`,title:c.title,props:c.props},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onRequestFix:u,className:`h-full`})})]})}function ve({placed:e,activeSessionId:t,notify:n,hidden:r=!1}){let{t:i}=s(),a=d(),o=(0,z.useRef)(null);(0,z.useEffect)(()=>{let e=Y.getState();for(let t of e.positions)he.test(t.key)||e.resetPosition(t.key)},[]);let c=e=>{p(e,{enabled:!1}).then(()=>a.invalidateQueries({queryKey:m.instances()}),()=>n(i(`custom-ui:floating.closeFailed`)))};return(0,X.jsx)(`div`,{ref:o,className:`pointer-events-none fixed inset-x-2 top-12 bottom-2 z-40 overflow-hidden`,hidden:r,"data-floating-custom-ui":!0,children:e.map((e,r)=>(0,X.jsx)(_e,{placed:e,boundaryRef:o,activeSessionId:t,notify:n,onClose:c,stackIndex:r},e.instance.instanceId))})}var ye=[`session-panel`,`feature-page`,`floating`];function be(e,t){let{instance:n,component:r}=e;return n.title||r.manifest?.i18n[t]?.name||r.name}function xe({placed:e,label:n,instances:r,notify:i}){let{t:o}=s(),c=t(),l=L(i),[u,d]=(0,z.useState)(!1),{instance:f,component:p}=e,m=async e=>{if(!u){d(!0);try{if(!await l.place(p,r,{surface:e,...f.title?{title:f.title}:{},props:f.props}))return;await l.unplace(f)&&i(o(`custom-ui:overview.moved`,{place:I(e,o)}))}finally{d(!1)}}};return(0,X.jsxs)(re,{children:[(0,X.jsx)(D,{asChild:!0,children:(0,X.jsx)(j,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`flex-none`,disabled:u,"aria-label":o(`custom-ui:overview.menu`,{name:n}),title:o(`custom-ui:overview.menu`,{name:n}),"data-overview-component-menu":!0,children:(0,X.jsx)(y,{"aria-hidden":`true`})})}),(0,X.jsxs)(ne,{align:`end`,className:`w-52`,children:[(0,X.jsxs)(E,{onSelect:()=>c(a(p.id),{state:{componentInstanceId:f.instanceId}}),children:[(0,X.jsx)(x,{"aria-hidden":`true`}),o(`custom-ui:overview.settings`)]}),(0,X.jsxs)(E,{onSelect:()=>c(a(p.id)),children:[(0,X.jsx)(ue,{"aria-hidden":`true`}),o(`custom-ui:tool.openInStudio`)]}),(0,X.jsxs)(O,{children:[(0,X.jsxs)(T,{"data-overview-component-move":!0,children:[(0,X.jsx)(le,{"aria-hidden":`true`}),o(`custom-ui:overview.move`)]}),(0,X.jsx)(w,{className:`w-48`,children:ye.map(e=>{let t=R(p.manifest,e),n=r.some(t=>t.componentId===p.id&&t.surface===e&&t.enabled);return(0,X.jsxs)(E,{disabled:!t||n,"data-overview-component-move-to":e,onSelect:()=>void m(e),children:[I(e,o),(0,X.jsx)(`span`,{className:`ml-auto text-xs text-content-muted`,children:t?n?o(`custom-ui:studio.placed`):``:o(`custom-ui:studio.placeUndeclaredShort`)})]},e)})})]}),(0,X.jsx)(C,{}),(0,X.jsxs)(E,{"data-overview-component-remove":!0,onSelect:()=>{l.unplace(f).then(e=>{e&&i(o(`custom-ui:overview.removed`,{name:n}))})},children:[(0,X.jsx)(S,{"aria-hidden":`true`}),o(`custom-ui:overview.remove`)]})]})]})}function Se({placed:e,instances:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a,language:o}=s(),{instance:c,component:l}=e,u=c.size===`M`?`M`:`S`,d=be(e,o),f=F(l,r);return(0,X.jsxs)(`article`,{"aria-label":d,"data-overview-component":c.instanceId,"data-overview-component-id":l.id,"data-overview-component-size":u,className:`flex-none overflow-hidden rounded-[var(--r-lg)] bg-panel ring-1 ring-stroke`,children:[(0,X.jsxs)(`header`,{className:`flex h-9 items-center gap-2 border-b border-stroke-soft pr-1 pl-3 pointer-coarse:h-12`,children:[(0,X.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[13px] leading-5 font-medium text-content`,children:d}),(0,X.jsx)(`span`,{className:`flex-none rounded-xs border border-stroke px-1.5 text-[11px] leading-4 text-content-muted`,children:a(`custom-ui:overview.badge`)}),(0,X.jsx)(xe,{placed:e,label:d,instances:t,notify:r})]}),(0,X.jsx)(`div`,{"data-overview-component-body":!0,className:`overflow-hidden`,style:{height:N[u].h},children:(0,X.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`overview-card`,title:c.title,props:c.props,size:u},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onOpenSession:i,onRequestFix:f,className:`h-full`})})]})}function $({className:e}){let{t:n}=s(),r=t();return(0,X.jsxs)(`button`,{type:`button`,"data-overview-component-place":!0,onClick:()=>r(o.components),className:A(`flex h-9 w-full flex-none items-center justify-center gap-1.5 rounded-[var(--r-lg)] border border-dashed border-stroke-strong text-[12.5px] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,e),children:[(0,X.jsx)(b,{className:`size-3.5`,"aria-hidden":`true`}),n(`custom-ui:overview.place`)]})}function Ce({placed:e,layout:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a}=s(),o=f(g()).data?.instances??[],c=e.map(e=>(0,X.jsx)(Se,{placed:e,instances:o,activeSessionId:n,notify:r,onOpenSession:i},e.instance.instanceId));return t===`popover`?(0,X.jsxs)(ae,{children:[(0,X.jsx)(k,{asChild:!0,children:(0,X.jsx)(j,{variant:`outline`,"data-overview-components-trigger":!0,children:a(`custom-ui:overview.trigger`,{count:e.length})})}),(0,X.jsxs)(ie,{align:`end`,"aria-label":a(`custom-ui:overview.heading`),"data-overview-components":`popover`,className:`max-h-(--radix-popover-content-available-height) w-[344px] gap-3 overflow-y-auto p-3`,children:[c,(0,X.jsx)($,{})]})]}):(0,X.jsxs)(`div`,{"data-overview-components":t,className:A(`flex flex-col gap-3`,t===`phone`&&`mt-6`),children:[(0,X.jsx)(`h2`,{className:`text-[13px] leading-5 font-medium text-content-secondary`,children:a(`custom-ui:overview.heading`)}),c,(0,X.jsx)($,{})]})}function we({placed:e,sessionId:t,cwd:n,notify:r,onOpenSession:i}){let a=oe().find(e=>e.id===t),o=a?.title??``,s=a?.status??`idle`,c=(0,z.useMemo)(()=>({id:t,title:o,cwd:a?.cwd||n,status:s}),[n,t,s,a?.cwd,o]),{instance:l,component:u}=e,d=F(u,r);return(0,X.jsx)(`div`,{"data-session-panel-component":l.instanceId,className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:(0,X.jsx)(P,{component:u,instance:{instanceId:l.instanceId,surface:`session-panel`,title:l.title,props:l.props},session:c,notify:r,onOpenSession:i,onRequestFix:d,className:`h-full`},t)})}function Te(e,t){return e.manifest?.i18n[t]?.name||e.name}function Ee({cwd:e,notify:t,onAdded:n}){let{t:r,language:i}=s(),a=f(h()),o=f(g()),c=L(t),[l,u]=(0,z.useState)(null),d=o.data?.instances??[],p=(a.data?.components??[]).filter(e=>ce(e)&&R(e.manifest,`session-panel`)),m=async(e,t)=>{if(!l){u(e.id);try{let r=await c.place(e,d,{surface:`session-panel`,scope:t});r&&n(r.instance.instanceId)}finally{u(null)}}};return a.isPending||o.isPending?(0,X.jsx)(`p`,{role:`status`,className:`text-content-muted`,children:r(`custom-ui:customUiPage.loading`)}):a.error||o.error?(0,X.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,X.jsx)(`p`,{role:`alert`,className:`text-content-secondary`,children:r(`custom-ui:widget.catalogFailed`)}),(0,X.jsx)(j,{type:`button`,size:`sm`,variant:`secondary`,onClick:()=>{a.refetch(),o.refetch()},children:r(`custom-ui:widget.retry`)})]}):p.length?(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-session-component-add-menu":!0,children:[(0,X.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.addHint`)}),(0,X.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:p.map(t=>{let a=Te(t,i),o=d.find(e=>e.componentId===t.id&&e.surface===`session-panel`),s=!!(o?.enabled&&_(o.scope,e));return(0,X.jsxs)(`li`,{"data-session-component-candidate":t.id,className:`flex flex-col gap-1.5 rounded-sm px-1.5 py-1.5`,children:[(0,X.jsx)(`span`,{className:`truncate text-[13px] font-medium text-content`,children:a}),s&&o?(0,X.jsx)(j,{type:`button`,size:`sm`,variant:`ghost`,className:`self-start`,onClick:()=>n(o.instanceId),children:r(`custom-ui:studio.placed`)}):(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,X.jsx)(j,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null,"data-session-component-scope":`all`,onClick:()=>void m(t,{type:`all`}),children:r(`custom-ui:studio.scopeAll`)}),(0,X.jsx)(j,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null||!e,"data-session-component-scope":`project`,onClick:()=>void m(t,{type:`project`,cwd:e}),children:r(`custom-ui:sessionPanel.thisProject`)})]})]},t.id)})})]}):(0,X.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.empty`)})}export{P as ComponentHost,ve as FloatingComponents,Ce as OverviewComponents,Ee as SessionComponentAddMenu,we as SessionPanelComponent};
|