pisper 0.6.28 → 0.6.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/package.json +6 -6
  2. package/web/.vite/manifest.json +654 -641
  3. package/web/assets/{AppDialog-Cjnspn8J.js → AppDialog-CX0n4qav.js} +1 -1
  4. package/web/assets/{AppOverlays-ielr5J2J.js → AppOverlays-J_rOhlw3.js} +1 -1
  5. package/web/assets/{AssetsPage-BC1mYvQw.js → AssetsPage-BuAZJf2M.js} +1 -1
  6. package/web/assets/{BoardPage-BS3oBeRU.js → BoardPage-BT684h8Y.js} +3 -3
  7. package/web/assets/{ChannelsPage-DOysYIcY.js → ChannelsPage-CznKEDyh.js} +1 -1
  8. package/web/assets/{ChatAppearancePage-DqNJD2hC.js → ChatAppearancePage-BrZ30LfD.js} +1 -1
  9. package/web/assets/{ChatHistoryPage-DcTFMdWO.js → ChatHistoryPage-BEJbiMs3.js} +1 -1
  10. package/web/assets/{ChatPage-DaKslieG.js → ChatPage-CCL8A95i.js} +3 -3
  11. package/web/assets/{ConfigPage-Cg93xSDY.js → ConfigPage-_YQZcZlC.js} +2 -2
  12. package/web/assets/{DesktopWindowControls-Zz88RwFF.js → DesktopWindowControls-C-LzcrLu.js} +1 -1
  13. package/web/assets/{FeaturePage-bqByIxYg.js → FeaturePage-C4fMefC-.js} +1 -1
  14. package/web/assets/{FileAttachmentPreview-Dc92kq62.js → FileAttachmentPreview-DCdc0GFC.js} +1 -1
  15. package/web/assets/{FloatingWidgets-CwJuWUMz.js → FloatingWidgets-C5PMwmK1.js} +1 -1
  16. package/web/assets/{FocusRuntimeControls-huHLWDdy.js → FocusRuntimeControls-D6Rj2AHK.js} +1 -1
  17. package/web/assets/{GitDiffViewer-b4QqrnGx.js → GitDiffViewer-D2QUzasQ.js} +1 -1
  18. package/web/assets/{ManageProjectsDialog-DpwUwosB.js → ManageProjectsDialog-CCg0vZ07.js} +1 -1
  19. package/web/assets/{MarkdownMessage-BEmTlPSn.js → MarkdownMessage-DbPFHAG0.js} +1 -1
  20. package/web/assets/{McpPage-COTq4Jjj.js → McpPage-DAg9VlnU.js} +1 -1
  21. package/web/assets/{MemoryEvolution-CNi44VEB.js → MemoryEvolution-CVF6CYuV.js} +1 -1
  22. package/web/assets/{MemoryPage-fUDrPE_v.js → MemoryPage-C4C8Efhi.js} +2 -2
  23. package/web/assets/{MobileNavigation-BvCRGO5c.js → MobileNavigation-EsJOtmUl.js} +1 -1
  24. package/web/assets/{MorePage-BuKQ5rBF.js → MorePage-BslKLMFa.js} +1 -1
  25. package/web/assets/{NewFolderDialog-Btk5x-Ar.js → NewFolderDialog-Bb4T0UPO.js} +1 -1
  26. package/web/assets/{PageHeader-BjhZ50ed.js → PageHeader-DjJ0Ab6e.js} +1 -1
  27. package/web/assets/{PhoneDrawer-Cs-ka4ZZ.js → PhoneDrawer-Cu2FDUc1.js} +1 -1
  28. package/web/assets/{PhoneMenuButton-CTlyYTpl.js → PhoneMenuButton-C8pYulkt.js} +1 -1
  29. package/web/assets/{PhoneTopBar-Cx2DM1ne.js → PhoneTopBar-CvMWkksM.js} +1 -1
  30. package/web/assets/{PluginsPage-B9Xlbo-c.js → PluginsPage-DxjMMa05.js} +1 -1
  31. package/web/assets/{SafeModePrompt-BCrBZdI6.js → SafeModePrompt-DG64bady.js} +1 -1
  32. package/web/assets/{SchedulesPage-Eh7MyRAr.js → SchedulesPage-Bd0sjkiZ.js} +1 -1
  33. package/web/assets/{SessionBrowserPane-Zeec5cZP.js → SessionBrowserPane-CigWhKGU.js} +2 -2
  34. package/web/assets/{SessionContextPanel-CVKmX-do.js → SessionContextPanel-HfjETMcF.js} +2 -2
  35. package/web/assets/{SessionHome-CJR_Ufgl.js → SessionHome-DtzbkF19.js} +1 -1
  36. package/web/assets/{SessionInspector-D5tmy63H.js → SessionInspector-BZyFstFl.js} +1 -1
  37. package/web/assets/{SessionShell-w3sKK33I.js → SessionShell-BCIVsKr9.js} +1 -1
  38. package/web/assets/{SettingsSidebar-CseRAdbZ.js → SettingsSidebar-F20r1qhh.js} +1 -1
  39. package/web/assets/{ShortcutHelpDialog-R4Gx-9DQ.js → ShortcutHelpDialog-BSiv5k3S.js} +1 -1
  40. package/web/assets/{ShortcutKeys-DksC1OkE.js → ShortcutKeys-BWYkyL77.js} +1 -1
  41. package/web/assets/{SidebarUpdateStatus-BCd1eq_6.js → SidebarUpdateStatus-BA3cyY6N.js} +1 -1
  42. package/web/assets/{SkillsPage-Bn2y_EfT.js → SkillsPage-C6cF2A7j.js} +1 -1
  43. package/web/assets/{TaskProcessesPane-FwGhuWob.js → TaskProcessesPane-B6O5Mirv.js} +1 -1
  44. package/web/assets/{TaskTerminalView-Cd4PIsW7.js → TaskTerminalView-IR5bGXk7.js} +1 -1
  45. package/web/assets/{TerminalPanel-48zgvDnP.js → TerminalPanel-BAl1Ytmx.js} +1 -1
  46. package/web/assets/{WebDesktopPet-gSDBRZ3C.js → WebDesktopPet-CLjE98zM.js} +1 -1
  47. package/web/assets/{WorkflowsPage-Cs8PPuKK.js → WorkflowsPage-5kMzkdP5.js} +1 -1
  48. package/web/assets/{WorkspacePicker-93gmdtjf.js → WorkspacePicker-Dy3QRSbL.js} +1 -1
  49. package/web/assets/{api-AeFmYDtL.js → api-BhPOJ07B.js} +1 -1
  50. package/web/assets/app-update-DK-2lnli.js +34 -0
  51. package/web/assets/{approval-confirm-D-cfu-xY.js → approval-confirm-BiKVYJXn.js} +1 -1
  52. package/web/assets/{board-projects-CjfuDvHx.js → board-projects-BmfKMy9W.js} +1 -1
  53. package/web/assets/{bots-store-vErH7x9u.js → bots-store-sXgxSYjm.js} +1 -1
  54. package/web/assets/browser-notifications-CvHO-BlP.js +1 -0
  55. package/web/assets/{chat-api-CSAs7Y6E.js → chat-api-CdqM-TFw.js} +1 -1
  56. package/web/assets/{client-store-B5wZ2IWH.js → client-store-CkmBBzE5.js} +1 -1
  57. package/web/assets/{config-search-eh2zQyZD.js → config-search-DTHZrqfb.js} +1 -1
  58. package/web/assets/{desktop-hosts-BNXtrr7R.js → desktop-hosts-BzI81G6K.js} +1 -1
  59. package/web/assets/{dialog-BDNbY1pW.js → dialog-BVAtioHy.js} +1 -1
  60. package/web/assets/{event-stream-Dh7h5sXJ.js → event-stream-B9eeQcgA.js} +1 -1
  61. package/web/assets/{events-CuVwhRWu.js → events-CcKmvwE6.js} +1 -1
  62. package/web/assets/{focus-session-composer-bits-Dkc0qSzm.js → focus-session-composer-bits-BuYWKdXR.js} +1 -1
  63. package/web/assets/{folder-paths-BKS24lJ6.js → folder-paths-D8nYAh7q.js} +1 -1
  64. package/web/assets/{hosts-B_02vF1S.js → hosts-BRNTbndS.js} +1 -1
  65. package/web/assets/{http-Bp65Kb4t.js → http-CXQuFoDX.js} +1 -1
  66. package/web/assets/{http-response-PZN5QIRk.js → http-response-scdqC11Q.js} +1 -1
  67. package/web/assets/i18n-D5XUOwJ3.js +1 -0
  68. package/web/assets/{index-CiRnxTh1.js → index-at6jiRd2.js} +2 -2
  69. package/web/assets/{machine-messages-Y3INM-Uy.js → machine-messages-BhLpbeyp.js} +1 -1
  70. package/web/assets/{machines-api-08M8wQiu.js → machines-api-c4gyvYeB.js} +1 -1
  71. package/web/assets/{memory-api-DSpQSQ5N.js → memory-api-BZLLcIF1.js} +1 -1
  72. package/web/assets/mount-app-713eDAlJ.js +9 -0
  73. package/web/assets/notification-sound-synth-DIRfyEoK.js +1 -0
  74. package/web/assets/{permission-rules-api-D931wxo9.js → permission-rules-api-BoggV-So.js} +1 -1
  75. package/web/assets/{pick-system-directory-CaiscVfr.js → pick-system-directory-COxOQmRm.js} +1 -1
  76. package/web/assets/{placements-BERPVxJD.js → placements-CWg24KPB.js} +2 -2
  77. package/web/assets/{popover-BKgOyW2Z.js → popover-BKEwGK6p.js} +1 -1
  78. package/web/assets/{public-DrlrVRdl.js → public-CFmAK4C5.js} +1 -1
  79. package/web/assets/{public-D9GopZqN.js → public-Ds92tfxs.js} +2 -2
  80. package/web/assets/{public-CEKKZh7R.js → public-DyoA5qbn.js} +2 -2
  81. package/web/assets/{public-CwI1S0by.js → public-_SuCE3iR.js} +1 -1
  82. package/web/assets/{public-components-BX9oxLC6.js → public-components-CiFLJxlo.js} +1 -1
  83. package/web/assets/public-diff-ByaSqbeU.js +1 -0
  84. package/web/assets/public-events-BZoQRupR.js +1 -0
  85. package/web/assets/{public-flags-DaG3PoAy.js → public-flags-wwqdZl3u.js} +1 -1
  86. package/web/assets/{public-folder-dialog-_QoxpOd4.js → public-folder-dialog-MYvmKYka.js} +1 -1
  87. package/web/assets/{public-greeting-hvhJuZMw.js → public-greeting-DFC9u9sY.js} +1 -1
  88. package/web/assets/{public-session-DUzugr9Y.js → public-session-qSMh175y.js} +1 -1
  89. package/web/assets/{public-sidebar-QGIKY-SE.js → public-sidebar-WFoUZVnB.js} +1 -1
  90. package/web/assets/{runtime-capabilities-store-Bd3gWIM7.js → runtime-capabilities-store-D0EC-a9c.js} +1 -1
  91. package/web/assets/{safe-mode-instance-B7_JMLGQ.js → safe-mode-instance-Ct43-TDv.js} +1 -1
  92. package/web/assets/safe-mode-sentinel-BKPGGJEL.js +1 -0
  93. package/web/assets/{session-change-summary-api-BHpd8dcW.js → session-change-summary-api-CyghX14t.js} +1 -1
  94. package/web/assets/{session-home-BmAnhROp.js → session-home-DY7RkKbH.js} +1 -1
  95. package/web/assets/{session-inspector-store-DHEIlh_X.js → session-inspector-store-BocK0l86.js} +1 -1
  96. package/web/assets/{session-organization-api-D9hTSIh7.js → session-organization-api-CGRK7VMP.js} +1 -1
  97. package/web/assets/{session-scope-yI3Hi_8F.js → session-scope-DDZF_AQ6.js} +1 -1
  98. package/web/assets/{session-tree-actions-BhCOaiTd.js → session-tree-actions-g769G3qz.js} +1 -1
  99. package/web/assets/{session-tree-summary-BLv-bkYC.js → session-tree-summary-CqrRroey.js} +1 -1
  100. package/web/assets/{shortcuts-Dsd4mjfP.js → shortcuts-BsrTXPiU.js} +1 -1
  101. package/web/assets/{side-chat-context-scyCH7W7.js → side-chat-context-DNQ3tThq.js} +4 -4
  102. package/web/assets/{sidebar-BKgF_JcM.js → sidebar-R690QKPw.js} +1 -1
  103. package/web/assets/{sidebar-store-DHwAOBnN.js → sidebar-store-QvX0w7hQ.js} +1 -1
  104. package/web/assets/{speech-session-B7DFYRtL.js → speech-session-DnBIZldd.js} +1 -1
  105. package/web/assets/{startup-queries-BlA4Hayt.js → startup-queries-BpV9-ykp.js} +1 -1
  106. package/web/assets/{use-i18n-BVRhlQ1v.js → use-i18n-AM3jlRYR.js} +1 -1
  107. package/web/assets/{use-open-bot-DyXtOatN.js → use-open-bot-BDco631W.js} +1 -1
  108. package/web/assets/{use-studio-actions-DEeR_rS9.js → use-studio-actions-C7W6Soh6.js} +1 -1
  109. package/web/assets/{useCatalogProjects-BD5GyCxg.js → useCatalogProjects-DCT51aGo.js} +1 -1
  110. package/web/assets/{useMachines-CwX7YqNe.js → useMachines-BJtbuUVt.js} +1 -1
  111. package/web/assets/{useNewProjectPicker-COxPJj6n.js → useNewProjectPicker-B85EuCYh.js} +2 -2
  112. package/web/assets/{useNow-CfPk0uIz.js → useNow-BUhFR4QI.js} +1 -1
  113. package/web/assets/{usePhoneShell-BpuKJgci.js → usePhoneShell-CK9XBtgf.js} +1 -1
  114. package/web/assets/{useSessionListQuery-CURESPBn.js → useSessionListQuery-B4Xmcfwa.js} +1 -1
  115. package/web/assets/{useSessionRowActions-DoCwFh8w.js → useSessionRowActions-BMestf2F.js} +1 -1
  116. package/web/assets/{useSidebarModel-CY79-mYl.js → useSidebarModel-BDfzya9Z.js} +1 -1
  117. package/web/assets/{workspace-order-store-C-jYrC0l.js → workspace-order-store-C_t43Zgq.js} +1 -1
  118. package/web/index.html +1 -1
  119. package/web/assets/app-update-Cf9JJ7WK.js +0 -34
  120. package/web/assets/browser-notifications-DBS0oXqN.js +0 -1
  121. package/web/assets/i18n-D80GstlU.js +0 -1
  122. package/web/assets/mount-app-DRohHSG7.js +0 -9
  123. package/web/assets/public-diff-DpNMZ8NJ.js +0 -1
  124. package/web/assets/public-events-CLCgth5h.js +0 -1
  125. package/web/assets/safe-mode-sentinel-B_NPQ0qy.js +0 -1
@@ -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-CiRnxTh1.js";import{i as r,r as i}from"./vendor-react-DwNgTV1j.js";import{o as a,r as o}from"./routes-DIeaqWVc.js";import{t as s}from"./use-i18n-BVRhlQ1v.js";import{a as c,i as l,o as u}from"./vendor-state-GkUciC5H.js";import{r as d,t as f}from"./useQuery-DfOU-27z.js";import{A as p,j as m,n as h,r as g,t as _}from"./session-scope-yI3Hi_8F.js";import{t as v}from"./createLucideIcon-Cd-3GVxJ.js";import{t as y}from"./ellipsis-CfGKfbq6.js";import{t as b}from"./grip-vertical-B__LYT0s.js";import{t as x}from"./plus-fQbSqB1n.js";import{t as S}from"./rotate-ccw-C0v8V77_.js";import{t as C}from"./settings-2-CXJjXJS9.js";import{t as w}from"./x-07u4-129.js";import{c as T,d as E,f as D,i as O,p as k,r as A,t as ee,u as te}from"./dropdown-menu-Ds0gD8S8.js";import{i as ne,n as re,t as j}from"./popover-BKgOyW2Z.js";import{t as M}from"./utils-C8uzG5AZ.js";import{t as N}from"./button-CCcCN8tE.js";import{A as P,D as ie,E as ae,I as oe,O as se,S as F,f as ce,i as I,t as L,u as R}from"./use-studio-actions-DEeR_rS9.js";var le=v(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),ue=v(`square-arrow-out-up-right`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),z=e(r(),1),B=e=>Math.min(1,Math.max(0,e)),V=e=>Number.isFinite(e)?Math.max(0,e):0,H=8,U=12,de=160;function fe(e,t,n=0){let r=Math.max(0,V(e.width)-V(t.width)),i=Math.max(0,V(e.height)-V(t.height)),a=Math.max(0,i-de),o=Math.max(0,a-H),s=V(t.height)+U,c=s?Math.floor(o/s)+1:1,l=Math.max(0,Math.floor(n)),u=Math.floor(l/c),d=l%c,f=r-H-u*(V(t.width)+U),p=a-d*s;return{x:r?B(f/r):1,y:i?B(p/i):1}}function pe(e,t){return`${t?`mobile`:`desktop`}:${e}`}function W(e,t,n){return{x:B(e.x)*Math.max(0,V(t.width)-V(n.width)),y:B(e.y)*Math.max(0,V(t.height)-V(n.height))}}function G(e,t,n,r){let i=W(e,n,r),a=Math.max(0,V(n.width)-V(r.width)),o=Math.max(0,V(n.height)-V(r.height));return{x:B(a?(i.x+t.x)/a:e.x),y:B(o?(i.y+t.y)/o:e.y)}}function K(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q(e){if(!Array.isArray(e))return[];let t=new Map;for(let n of e)!K(n)||typeof n.key!=`string`||!/^(desktop|mobile):[a-zA-Z0-9][a-zA-Z0-9._:-]{0,95}$/.test(n.key)||!K(n.position)||typeof n.position.x!=`number`||!Number.isFinite(n.position.x)||typeof n.position.y!=`number`||!Number.isFinite(n.position.y)||(t.delete(n.key),t.set(n.key,{x:B(n.position.x),y:B(n.position.y)}),t.size>128&&t.delete(t.keys().next().value??``));return[...t].map(([e,t])=>({key:e,position:t}))}function me(e,t,n){return q([...e.filter(e=>e.key!==t),{key:t,position:n}])}var he=l(()=>({getItem:e=>{try{return n.getItem(e)}catch{return null}},setItem:(e,t)=>{try{n.setItem(e,t)}catch{}},removeItem:e=>{try{n.removeItem(e)}catch{}}})),J=u()(c(e=>({positions:[],setPosition:(t,n)=>e(e=>({positions:me(e.positions,t,n)})),resetPosition:t=>e(e=>({positions:e.positions.filter(e=>e.key!==t)}))}),{name:`pisper-floating-placement`,version:1,storage:he,partialize:({positions:e})=>({positions:e}),merge:(e,t)=>({...t,positions:q(e&&typeof e==`object`&&`positions`in e?e.positions:void 0)})})),Y=i(),X={width:0,height:0},ge=/^(?:desktop|mobile):[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Z=`flex items-center justify-center rounded-full bg-key text-content-muted shadow-key ring-1 ring-key-border hover:text-content`;function _e(e){let t=e.component.manifest,n=t&&se(t,`floating`)?.size||ae;return{width:n.w,height:n.h}}function ve({placed:e,boundaryRef:t,activeSessionId:n,notify:r,onClose:i,stackIndex:a}){let{t:o}=s(),{instance:c,component:l}=e,u=R(l,r),d=pe(c.instanceId,!1),f=J(e=>e.positions.find(e=>e.key===d)?.position),p=(0,z.useRef)(null),m=(0,z.useRef)(null),[h,g]=(0,z.useState)(null),[_,v]=(0,z.useState)({bounds:X,widget:X}),y=f??fe(_.bounds,_.widget,a),x=(0,z.useId)(),C=_e(e),T=c.title||l.manifest?.name||l.name;(0,z.useEffect)(()=>{let e=t.current,n=p.current;if(!e||!n)return;let r=()=>{let t={bounds:{width:e.clientWidth,height:e.clientHeight},widget:{width:n.offsetWidth,height:n.offsetHeight}};v(e=>e.bounds.width===t.bounds.width&&e.bounds.height===t.bounds.height&&e.widget.width===t.widget.width&&e.widget.height===t.widget.height?e:t)},i=new ResizeObserver(()=>r());return r(),i.observe(e),i.observe(n),window.addEventListener(`resize`,r),()=>{i.disconnect(),window.removeEventListener(`resize`,r)}},[t]),(0,z.useEffect)(()=>(g(null),()=>{let e=m.current;m.current=null,e?.element.hasPointerCapture(e.pointerId)&&e.element.releasePointerCapture(e.pointerId)}),[d]);let E=(e,t)=>{let n=m.current;!n||n.pointerId!==e.pointerId||(m.current=null,t&&J.getState().setPosition(d,n.latest),g(null),n.element.hasPointerCapture(n.pointerId)&&n.element.releasePointerCapture(n.pointerId))},D=()=>J.getState().resetPosition(d),O=e=>{let t=e.shiftKey?32:12,n={ArrowLeft:{x:-t,y:0},ArrowRight:{x:t,y:0},ArrowUp:{x:0,y:-t},ArrowDown:{x:0,y:t}};if(e.key===`Home`){e.preventDefault(),D();return}let r=n[e.key];r&&(e.preventDefault(),J.getState().setPosition(d,G(y,r,_.bounds,_.widget)))},k=W(h??y,_.bounds,_.widget);return(0,Y.jsxs)(`div`,{ref:p,role:`group`,"aria-label":T,"data-floating-widget":c.instanceId,"data-floating-component":l.id,className:`pointer-events-auto absolute flex max-w-full flex-col px-6`,style:{left:k.x,top:k.y,width:C.width+48,maxHeight:`100%`,visibility:_.bounds.width>0?`visible`:`hidden`},children:[(0,Y.jsxs)(`div`,{className:`absolute top-1/2 left-0 z-10 flex -translate-y-1/2 flex-col items-center gap-1`,children:[(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.move`),"aria-describedby":x,title:o(`custom-ui:floating.moveHint`),className:M(Z,`h-6 w-5 touch-none`),style:{cursor:h?`grabbing`:`grab`},"data-floating-move":!0,onKeyDown:O,onPointerDown:e=>{e.button!==0||m.current||(e.preventDefault(),e.currentTarget.focus({preventScroll:!0}),e.currentTarget.setPointerCapture(e.pointerId),m.current={pointerId:e.pointerId,element:e.currentTarget,x:e.clientX,y:e.clientY,initial:y,latest:y},g(y))},onPointerMove:e=>{let t=m.current;if(!t||t.pointerId!==e.pointerId)return;let n=G(t.initial,{x:e.clientX-t.x,y:e.clientY-t.y},_.bounds,_.widget);t.latest=n,g(n)},onPointerUp:e=>E(e,!0),onPointerCancel:e=>E(e,!1),onLostPointerCapture:e=>E(e,!1),children:(0,Y.jsx)(b,{className:`size-3`})}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.resetPosition`),title:o(`custom-ui:floating.resetPosition`),onClick:D,className:M(Z,`size-5`),children:(0,Y.jsx)(S,{className:`size-3`})}),(0,Y.jsx)(`span`,{id:x,className:`sr-only`,children:o(`custom-ui:floating.moveHint`)})]}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.close`),title:o(`custom-ui:floating.close`),"data-floating-close":!0,onClick:()=>i(c.instanceId),className:M(Z,`absolute top-1/2 right-0 z-10 size-5 -translate-y-1/2`),children:(0,Y.jsx)(w,{className:`size-3`})}),(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-md border border-stroke bg-panel shadow-key`,style:{height:C.height},children:(0,Y.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`floating`,title:c.title,props:c.props},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onRequestFix:u,className:`h-full`})})]})}function ye({placed:e,activeSessionId:t,notify:n,hidden:r=!1}){let{t:i}=s(),a=d(),o=(0,z.useRef)(null);(0,z.useEffect)(()=>{let e=J.getState();for(let t of e.positions)ge.test(t.key)||e.resetPosition(t.key)},[]);let c=e=>{p(e,{enabled:!1}).then(()=>a.invalidateQueries({queryKey:m.instances()}),()=>n(i(`custom-ui:floating.closeFailed`)))};return(0,Y.jsx)(`div`,{ref:o,className:`pointer-events-none fixed inset-x-2 top-12 bottom-2 z-40 overflow-hidden`,hidden:r,"data-floating-custom-ui":!0,children:e.map((e,r)=>(0,Y.jsx)(ve,{placed:e,boundaryRef:o,activeSessionId:t,notify:n,onClose:c,stackIndex:r},e.instance.instanceId))})}var be=[`session-panel`,`feature-page`,`floating`];function xe(e,t){let{instance:n,component:r}=e;return n.title||r.manifest?.i18n[t]?.name||r.name}function Q({placed:e,label:n,instances:r,notify:i}){let{t:o}=s(),c=t(),l=L(i),[u,d]=(0,z.useState)(!1),{instance:f,component:p}=e,m=async e=>{if(!u){d(!0);try{if(!await l.place(p,r,{surface:e,...f.title?{title:f.title}:{},props:f.props}))return;await l.unplace(f)&&i(o(`custom-ui:overview.moved`,{place:I(e,o)}))}finally{d(!1)}}};return(0,Y.jsxs)(ee,{children:[(0,Y.jsx)(k,{asChild:!0,children:(0,Y.jsx)(N,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`flex-none`,disabled:u,"aria-label":o(`custom-ui:overview.menu`,{name:n}),title:o(`custom-ui:overview.menu`,{name:n}),"data-overview-component-menu":!0,children:(0,Y.jsx)(y,{"aria-hidden":`true`})})}),(0,Y.jsxs)(A,{align:`end`,className:`w-52`,children:[(0,Y.jsxs)(O,{onSelect:()=>c(a(p.id),{state:{componentInstanceId:f.instanceId}}),children:[(0,Y.jsx)(C,{"aria-hidden":`true`}),o(`custom-ui:overview.settings`)]}),(0,Y.jsxs)(O,{onSelect:()=>c(a(p.id)),children:[(0,Y.jsx)(ue,{"aria-hidden":`true`}),o(`custom-ui:tool.openInStudio`)]}),(0,Y.jsxs)(te,{children:[(0,Y.jsxs)(D,{"data-overview-component-move":!0,children:[(0,Y.jsx)(le,{"aria-hidden":`true`}),o(`custom-ui:overview.move`)]}),(0,Y.jsx)(E,{className:`w-48`,children:be.map(e=>{let t=F(p.manifest,e),n=r.some(t=>t.componentId===p.id&&t.surface===e&&t.enabled);return(0,Y.jsxs)(O,{disabled:!t||n,"data-overview-component-move-to":e,onSelect:()=>void m(e),children:[I(e,o),(0,Y.jsx)(`span`,{className:`ml-auto text-xs text-content-muted`,children:t?n?o(`custom-ui:studio.placed`):``:o(`custom-ui:studio.placeUndeclaredShort`)})]},e)})})]}),(0,Y.jsx)(T,{}),(0,Y.jsxs)(O,{"data-overview-component-remove":!0,onSelect:()=>{l.unplace(f).then(e=>{e&&i(o(`custom-ui:overview.removed`,{name:n}))})},children:[(0,Y.jsx)(w,{"aria-hidden":`true`}),o(`custom-ui:overview.remove`)]})]})]})}function Se({placed:e,instances:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a,language:o}=s(),{instance:c,component:l}=e,u=c.size===`M`?`M`:`S`,d=xe(e,o),f=R(l,r);return(0,Y.jsxs)(`article`,{"aria-label":d,"data-overview-component":c.instanceId,"data-overview-component-id":l.id,"data-overview-component-size":u,className:`flex-none overflow-hidden rounded-[var(--r-lg)] bg-panel ring-1 ring-stroke`,children:[(0,Y.jsxs)(`header`,{className:`flex h-9 items-center gap-2 border-b border-stroke-soft pr-1 pl-3 pointer-coarse:h-12`,children:[(0,Y.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[13px] leading-5 font-medium text-content`,children:d}),(0,Y.jsx)(`span`,{className:`flex-none rounded-xs border border-stroke px-1.5 text-[11px] leading-4 text-content-muted`,children:a(`custom-ui:overview.badge`)}),(0,Y.jsx)(Q,{placed:e,label:d,instances:t,notify:r})]}),(0,Y.jsx)(`div`,{"data-overview-component-body":!0,className:`overflow-hidden`,style:{height:ie[u].h},children:(0,Y.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`overview-card`,title:c.title,props:c.props,size:u},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onOpenSession:i,onRequestFix:f,className:`h-full`})})]})}function $({className:e}){let{t:n}=s(),r=t();return(0,Y.jsxs)(`button`,{type:`button`,"data-overview-component-place":!0,onClick:()=>r(o.components),className:M(`flex h-9 w-full flex-none items-center justify-center gap-1.5 rounded-[var(--r-lg)] border border-dashed border-stroke-strong text-[12.5px] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,e),children:[(0,Y.jsx)(x,{className:`size-3.5`,"aria-hidden":`true`}),n(`custom-ui:overview.place`)]})}function Ce({placed:e,layout:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a}=s(),o=f(g()).data?.instances??[],c=e.map(e=>(0,Y.jsx)(Se,{placed:e,instances:o,activeSessionId:n,notify:r,onOpenSession:i},e.instance.instanceId));return t===`popover`?(0,Y.jsxs)(j,{children:[(0,Y.jsx)(ne,{asChild:!0,children:(0,Y.jsx)(N,{variant:`outline`,"data-overview-components-trigger":!0,children:a(`custom-ui:overview.trigger`,{count:e.length})})}),(0,Y.jsxs)(re,{align:`end`,"aria-label":a(`custom-ui:overview.heading`),"data-overview-components":`popover`,className:`max-h-(--radix-popover-content-available-height) w-[344px] gap-3 overflow-y-auto p-3`,children:[c,(0,Y.jsx)($,{})]})]}):(0,Y.jsxs)(`div`,{"data-overview-components":t,className:M(`flex flex-col gap-3`,t===`phone`&&`mt-6`),children:[(0,Y.jsx)(`h2`,{className:`text-[13px] leading-5 font-medium text-content-secondary`,children:a(`custom-ui:overview.heading`)}),c,(0,Y.jsx)($,{})]})}function we({placed:e,sessionId:t,cwd:n,notify:r,onOpenSession:i}){let a=oe().find(e=>e.id===t),o=a?.title??``,s=a?.status??`idle`,c=(0,z.useMemo)(()=>({id:t,title:o,cwd:a?.cwd||n,status:s}),[n,t,s,a?.cwd,o]),{instance:l,component:u}=e,d=R(u,r);return(0,Y.jsx)(`div`,{"data-session-panel-component":l.instanceId,className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:(0,Y.jsx)(P,{component:u,instance:{instanceId:l.instanceId,surface:`session-panel`,title:l.title,props:l.props},session:c,notify:r,onOpenSession:i,onRequestFix:d,className:`h-full`},t)})}function Te(e,t){return e.manifest?.i18n[t]?.name||e.name}function Ee({cwd:e,notify:t,onAdded:n}){let{t:r,language:i}=s(),a=f(h()),o=f(g()),c=L(t),[l,u]=(0,z.useState)(null),d=o.data?.instances??[],p=(a.data?.components??[]).filter(e=>ce(e)&&F(e.manifest,`session-panel`)),m=async(e,t)=>{if(!l){u(e.id);try{let r=await c.place(e,d,{surface:`session-panel`,scope:t});r&&n(r.instance.instanceId)}finally{u(null)}}};return a.isPending||o.isPending?(0,Y.jsx)(`p`,{role:`status`,className:`text-content-muted`,children:r(`custom-ui:customUiPage.loading`)}):a.error||o.error?(0,Y.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,Y.jsx)(`p`,{role:`alert`,className:`text-content-secondary`,children:r(`custom-ui:widget.catalogFailed`)}),(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,onClick:()=>{a.refetch(),o.refetch()},children:r(`custom-ui:widget.retry`)})]}):p.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-session-component-add-menu":!0,children:[(0,Y.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.addHint`)}),(0,Y.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:p.map(t=>{let a=Te(t,i),o=d.find(e=>e.componentId===t.id&&e.surface===`session-panel`),s=!!(o?.enabled&&_(o.scope,e));return(0,Y.jsxs)(`li`,{"data-session-component-candidate":t.id,className:`flex flex-col gap-1.5 rounded-sm px-1.5 py-1.5`,children:[(0,Y.jsx)(`span`,{className:`truncate text-[13px] font-medium text-content`,children:a}),s&&o?(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`ghost`,className:`self-start`,onClick:()=>n(o.instanceId),children:r(`custom-ui:studio.placed`)}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null,"data-session-component-scope":`all`,onClick:()=>void m(t,{type:`all`}),children:r(`custom-ui:studio.scopeAll`)}),(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null||!e,"data-session-component-scope":`project`,onClick:()=>void m(t,{type:`project`,cwd:e}),children:r(`custom-ui:sessionPanel.thisProject`)})]})]},t.id)})})]}):(0,Y.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.empty`)})}export{P as ComponentHost,ye as FloatingComponents,Ce as OverviewComponents,Ee as SessionComponentAddMenu,we as SessionPanelComponent};
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-at6jiRd2.js";import{i as r,r as i}from"./vendor-react-DwNgTV1j.js";import{o as a,r as o}from"./routes-DIeaqWVc.js";import{t as s}from"./use-i18n-AM3jlRYR.js";import{a as c,i as l,o as u}from"./vendor-state-GkUciC5H.js";import{r as d,t as f}from"./useQuery-DfOU-27z.js";import{A as p,j as m,n as h,r as g,t as _}from"./session-scope-DDZF_AQ6.js";import{t as v}from"./createLucideIcon-Cd-3GVxJ.js";import{t as y}from"./ellipsis-CfGKfbq6.js";import{t as b}from"./grip-vertical-B__LYT0s.js";import{t as x}from"./plus-fQbSqB1n.js";import{t as S}from"./rotate-ccw-C0v8V77_.js";import{t as C}from"./settings-2-CXJjXJS9.js";import{t as w}from"./x-07u4-129.js";import{c as T,d as E,f as D,i as O,p as k,r as A,t as ee,u as te}from"./dropdown-menu-Ds0gD8S8.js";import{i as ne,n as re,t as j}from"./popover-BKEwGK6p.js";import{t as M}from"./utils-C8uzG5AZ.js";import{t as N}from"./button-CCcCN8tE.js";import{A as P,D as ie,E as ae,I as oe,O as se,S as F,f as ce,i as I,t as L,u as R}from"./use-studio-actions-C7W6Soh6.js";var le=v(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),ue=v(`square-arrow-out-up-right`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),z=e(r(),1),B=e=>Math.min(1,Math.max(0,e)),V=e=>Number.isFinite(e)?Math.max(0,e):0,H=8,U=12,de=160;function fe(e,t,n=0){let r=Math.max(0,V(e.width)-V(t.width)),i=Math.max(0,V(e.height)-V(t.height)),a=Math.max(0,i-de),o=Math.max(0,a-H),s=V(t.height)+U,c=s?Math.floor(o/s)+1:1,l=Math.max(0,Math.floor(n)),u=Math.floor(l/c),d=l%c,f=r-H-u*(V(t.width)+U),p=a-d*s;return{x:r?B(f/r):1,y:i?B(p/i):1}}function pe(e,t){return`${t?`mobile`:`desktop`}:${e}`}function W(e,t,n){return{x:B(e.x)*Math.max(0,V(t.width)-V(n.width)),y:B(e.y)*Math.max(0,V(t.height)-V(n.height))}}function G(e,t,n,r){let i=W(e,n,r),a=Math.max(0,V(n.width)-V(r.width)),o=Math.max(0,V(n.height)-V(r.height));return{x:B(a?(i.x+t.x)/a:e.x),y:B(o?(i.y+t.y)/o:e.y)}}function K(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q(e){if(!Array.isArray(e))return[];let t=new Map;for(let n of e)!K(n)||typeof n.key!=`string`||!/^(desktop|mobile):[a-zA-Z0-9][a-zA-Z0-9._:-]{0,95}$/.test(n.key)||!K(n.position)||typeof n.position.x!=`number`||!Number.isFinite(n.position.x)||typeof n.position.y!=`number`||!Number.isFinite(n.position.y)||(t.delete(n.key),t.set(n.key,{x:B(n.position.x),y:B(n.position.y)}),t.size>128&&t.delete(t.keys().next().value??``));return[...t].map(([e,t])=>({key:e,position:t}))}function me(e,t,n){return q([...e.filter(e=>e.key!==t),{key:t,position:n}])}var he=l(()=>({getItem:e=>{try{return n.getItem(e)}catch{return null}},setItem:(e,t)=>{try{n.setItem(e,t)}catch{}},removeItem:e=>{try{n.removeItem(e)}catch{}}})),J=u()(c(e=>({positions:[],setPosition:(t,n)=>e(e=>({positions:me(e.positions,t,n)})),resetPosition:t=>e(e=>({positions:e.positions.filter(e=>e.key!==t)}))}),{name:`pisper-floating-placement`,version:1,storage:he,partialize:({positions:e})=>({positions:e}),merge:(e,t)=>({...t,positions:q(e&&typeof e==`object`&&`positions`in e?e.positions:void 0)})})),Y=i(),X={width:0,height:0},ge=/^(?:desktop|mobile):[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Z=`flex items-center justify-center rounded-full bg-key text-content-muted shadow-key ring-1 ring-key-border hover:text-content`;function _e(e){let t=e.component.manifest,n=t&&se(t,`floating`)?.size||ae;return{width:n.w,height:n.h}}function ve({placed:e,boundaryRef:t,activeSessionId:n,notify:r,onClose:i,stackIndex:a}){let{t:o}=s(),{instance:c,component:l}=e,u=R(l,r),d=pe(c.instanceId,!1),f=J(e=>e.positions.find(e=>e.key===d)?.position),p=(0,z.useRef)(null),m=(0,z.useRef)(null),[h,g]=(0,z.useState)(null),[_,v]=(0,z.useState)({bounds:X,widget:X}),y=f??fe(_.bounds,_.widget,a),x=(0,z.useId)(),C=_e(e),T=c.title||l.manifest?.name||l.name;(0,z.useEffect)(()=>{let e=t.current,n=p.current;if(!e||!n)return;let r=()=>{let t={bounds:{width:e.clientWidth,height:e.clientHeight},widget:{width:n.offsetWidth,height:n.offsetHeight}};v(e=>e.bounds.width===t.bounds.width&&e.bounds.height===t.bounds.height&&e.widget.width===t.widget.width&&e.widget.height===t.widget.height?e:t)},i=new ResizeObserver(()=>r());return r(),i.observe(e),i.observe(n),window.addEventListener(`resize`,r),()=>{i.disconnect(),window.removeEventListener(`resize`,r)}},[t]),(0,z.useEffect)(()=>(g(null),()=>{let e=m.current;m.current=null,e?.element.hasPointerCapture(e.pointerId)&&e.element.releasePointerCapture(e.pointerId)}),[d]);let E=(e,t)=>{let n=m.current;!n||n.pointerId!==e.pointerId||(m.current=null,t&&J.getState().setPosition(d,n.latest),g(null),n.element.hasPointerCapture(n.pointerId)&&n.element.releasePointerCapture(n.pointerId))},D=()=>J.getState().resetPosition(d),O=e=>{let t=e.shiftKey?32:12,n={ArrowLeft:{x:-t,y:0},ArrowRight:{x:t,y:0},ArrowUp:{x:0,y:-t},ArrowDown:{x:0,y:t}};if(e.key===`Home`){e.preventDefault(),D();return}let r=n[e.key];r&&(e.preventDefault(),J.getState().setPosition(d,G(y,r,_.bounds,_.widget)))},k=W(h??y,_.bounds,_.widget);return(0,Y.jsxs)(`div`,{ref:p,role:`group`,"aria-label":T,"data-floating-widget":c.instanceId,"data-floating-component":l.id,className:`pointer-events-auto absolute flex max-w-full flex-col px-6`,style:{left:k.x,top:k.y,width:C.width+48,maxHeight:`100%`,visibility:_.bounds.width>0?`visible`:`hidden`},children:[(0,Y.jsxs)(`div`,{className:`absolute top-1/2 left-0 z-10 flex -translate-y-1/2 flex-col items-center gap-1`,children:[(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.move`),"aria-describedby":x,title:o(`custom-ui:floating.moveHint`),className:M(Z,`h-6 w-5 touch-none`),style:{cursor:h?`grabbing`:`grab`},"data-floating-move":!0,onKeyDown:O,onPointerDown:e=>{e.button!==0||m.current||(e.preventDefault(),e.currentTarget.focus({preventScroll:!0}),e.currentTarget.setPointerCapture(e.pointerId),m.current={pointerId:e.pointerId,element:e.currentTarget,x:e.clientX,y:e.clientY,initial:y,latest:y},g(y))},onPointerMove:e=>{let t=m.current;if(!t||t.pointerId!==e.pointerId)return;let n=G(t.initial,{x:e.clientX-t.x,y:e.clientY-t.y},_.bounds,_.widget);t.latest=n,g(n)},onPointerUp:e=>E(e,!0),onPointerCancel:e=>E(e,!1),onLostPointerCapture:e=>E(e,!1),children:(0,Y.jsx)(b,{className:`size-3`})}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.resetPosition`),title:o(`custom-ui:floating.resetPosition`),onClick:D,className:M(Z,`size-5`),children:(0,Y.jsx)(S,{className:`size-3`})}),(0,Y.jsx)(`span`,{id:x,className:`sr-only`,children:o(`custom-ui:floating.moveHint`)})]}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.close`),title:o(`custom-ui:floating.close`),"data-floating-close":!0,onClick:()=>i(c.instanceId),className:M(Z,`absolute top-1/2 right-0 z-10 size-5 -translate-y-1/2`),children:(0,Y.jsx)(w,{className:`size-3`})}),(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-md border border-stroke bg-panel shadow-key`,style:{height:C.height},children:(0,Y.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`floating`,title:c.title,props:c.props},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onRequestFix:u,className:`h-full`})})]})}function ye({placed:e,activeSessionId:t,notify:n,hidden:r=!1}){let{t:i}=s(),a=d(),o=(0,z.useRef)(null);(0,z.useEffect)(()=>{let e=J.getState();for(let t of e.positions)ge.test(t.key)||e.resetPosition(t.key)},[]);let c=e=>{p(e,{enabled:!1}).then(()=>a.invalidateQueries({queryKey:m.instances()}),()=>n(i(`custom-ui:floating.closeFailed`)))};return(0,Y.jsx)(`div`,{ref:o,className:`pointer-events-none fixed inset-x-2 top-12 bottom-2 z-40 overflow-hidden`,hidden:r,"data-floating-custom-ui":!0,children:e.map((e,r)=>(0,Y.jsx)(ve,{placed:e,boundaryRef:o,activeSessionId:t,notify:n,onClose:c,stackIndex:r},e.instance.instanceId))})}var be=[`session-panel`,`feature-page`,`floating`];function xe(e,t){let{instance:n,component:r}=e;return n.title||r.manifest?.i18n[t]?.name||r.name}function Q({placed:e,label:n,instances:r,notify:i}){let{t:o}=s(),c=t(),l=L(i),[u,d]=(0,z.useState)(!1),{instance:f,component:p}=e,m=async e=>{if(!u){d(!0);try{if(!await l.place(p,r,{surface:e,...f.title?{title:f.title}:{},props:f.props}))return;await l.unplace(f)&&i(o(`custom-ui:overview.moved`,{place:I(e,o)}))}finally{d(!1)}}};return(0,Y.jsxs)(ee,{children:[(0,Y.jsx)(k,{asChild:!0,children:(0,Y.jsx)(N,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`flex-none`,disabled:u,"aria-label":o(`custom-ui:overview.menu`,{name:n}),title:o(`custom-ui:overview.menu`,{name:n}),"data-overview-component-menu":!0,children:(0,Y.jsx)(y,{"aria-hidden":`true`})})}),(0,Y.jsxs)(A,{align:`end`,className:`w-52`,children:[(0,Y.jsxs)(O,{onSelect:()=>c(a(p.id),{state:{componentInstanceId:f.instanceId}}),children:[(0,Y.jsx)(C,{"aria-hidden":`true`}),o(`custom-ui:overview.settings`)]}),(0,Y.jsxs)(O,{onSelect:()=>c(a(p.id)),children:[(0,Y.jsx)(ue,{"aria-hidden":`true`}),o(`custom-ui:tool.openInStudio`)]}),(0,Y.jsxs)(te,{children:[(0,Y.jsxs)(D,{"data-overview-component-move":!0,children:[(0,Y.jsx)(le,{"aria-hidden":`true`}),o(`custom-ui:overview.move`)]}),(0,Y.jsx)(E,{className:`w-48`,children:be.map(e=>{let t=F(p.manifest,e),n=r.some(t=>t.componentId===p.id&&t.surface===e&&t.enabled);return(0,Y.jsxs)(O,{disabled:!t||n,"data-overview-component-move-to":e,onSelect:()=>void m(e),children:[I(e,o),(0,Y.jsx)(`span`,{className:`ml-auto text-xs text-content-muted`,children:t?n?o(`custom-ui:studio.placed`):``:o(`custom-ui:studio.placeUndeclaredShort`)})]},e)})})]}),(0,Y.jsx)(T,{}),(0,Y.jsxs)(O,{"data-overview-component-remove":!0,onSelect:()=>{l.unplace(f).then(e=>{e&&i(o(`custom-ui:overview.removed`,{name:n}))})},children:[(0,Y.jsx)(w,{"aria-hidden":`true`}),o(`custom-ui:overview.remove`)]})]})]})}function Se({placed:e,instances:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a,language:o}=s(),{instance:c,component:l}=e,u=c.size===`M`?`M`:`S`,d=xe(e,o),f=R(l,r);return(0,Y.jsxs)(`article`,{"aria-label":d,"data-overview-component":c.instanceId,"data-overview-component-id":l.id,"data-overview-component-size":u,className:`flex-none overflow-hidden rounded-[var(--r-lg)] bg-panel ring-1 ring-stroke`,children:[(0,Y.jsxs)(`header`,{className:`flex h-9 items-center gap-2 border-b border-stroke-soft pr-1 pl-3 pointer-coarse:h-12`,children:[(0,Y.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[13px] leading-5 font-medium text-content`,children:d}),(0,Y.jsx)(`span`,{className:`flex-none rounded-xs border border-stroke px-1.5 text-[11px] leading-4 text-content-muted`,children:a(`custom-ui:overview.badge`)}),(0,Y.jsx)(Q,{placed:e,label:d,instances:t,notify:r})]}),(0,Y.jsx)(`div`,{"data-overview-component-body":!0,className:`overflow-hidden`,style:{height:ie[u].h},children:(0,Y.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`overview-card`,title:c.title,props:c.props,size:u},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onOpenSession:i,onRequestFix:f,className:`h-full`})})]})}function $({className:e}){let{t:n}=s(),r=t();return(0,Y.jsxs)(`button`,{type:`button`,"data-overview-component-place":!0,onClick:()=>r(o.components),className:M(`flex h-9 w-full flex-none items-center justify-center gap-1.5 rounded-[var(--r-lg)] border border-dashed border-stroke-strong text-[12.5px] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,e),children:[(0,Y.jsx)(x,{className:`size-3.5`,"aria-hidden":`true`}),n(`custom-ui:overview.place`)]})}function Ce({placed:e,layout:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a}=s(),o=f(g()).data?.instances??[],c=e.map(e=>(0,Y.jsx)(Se,{placed:e,instances:o,activeSessionId:n,notify:r,onOpenSession:i},e.instance.instanceId));return t===`popover`?(0,Y.jsxs)(j,{children:[(0,Y.jsx)(ne,{asChild:!0,children:(0,Y.jsx)(N,{variant:`outline`,"data-overview-components-trigger":!0,children:a(`custom-ui:overview.trigger`,{count:e.length})})}),(0,Y.jsxs)(re,{align:`end`,"aria-label":a(`custom-ui:overview.heading`),"data-overview-components":`popover`,className:`max-h-(--radix-popover-content-available-height) w-[344px] gap-3 overflow-y-auto p-3`,children:[c,(0,Y.jsx)($,{})]})]}):(0,Y.jsxs)(`div`,{"data-overview-components":t,className:M(`flex flex-col gap-3`,t===`phone`&&`mt-6`),children:[(0,Y.jsx)(`h2`,{className:`text-[13px] leading-5 font-medium text-content-secondary`,children:a(`custom-ui:overview.heading`)}),c,(0,Y.jsx)($,{})]})}function we({placed:e,sessionId:t,cwd:n,notify:r,onOpenSession:i}){let a=oe().find(e=>e.id===t),o=a?.title??``,s=a?.status??`idle`,c=(0,z.useMemo)(()=>({id:t,title:o,cwd:a?.cwd||n,status:s}),[n,t,s,a?.cwd,o]),{instance:l,component:u}=e,d=R(u,r);return(0,Y.jsx)(`div`,{"data-session-panel-component":l.instanceId,className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:(0,Y.jsx)(P,{component:u,instance:{instanceId:l.instanceId,surface:`session-panel`,title:l.title,props:l.props},session:c,notify:r,onOpenSession:i,onRequestFix:d,className:`h-full`},t)})}function Te(e,t){return e.manifest?.i18n[t]?.name||e.name}function Ee({cwd:e,notify:t,onAdded:n}){let{t:r,language:i}=s(),a=f(h()),o=f(g()),c=L(t),[l,u]=(0,z.useState)(null),d=o.data?.instances??[],p=(a.data?.components??[]).filter(e=>ce(e)&&F(e.manifest,`session-panel`)),m=async(e,t)=>{if(!l){u(e.id);try{let r=await c.place(e,d,{surface:`session-panel`,scope:t});r&&n(r.instance.instanceId)}finally{u(null)}}};return a.isPending||o.isPending?(0,Y.jsx)(`p`,{role:`status`,className:`text-content-muted`,children:r(`custom-ui:customUiPage.loading`)}):a.error||o.error?(0,Y.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,Y.jsx)(`p`,{role:`alert`,className:`text-content-secondary`,children:r(`custom-ui:widget.catalogFailed`)}),(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,onClick:()=>{a.refetch(),o.refetch()},children:r(`custom-ui:widget.retry`)})]}):p.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-session-component-add-menu":!0,children:[(0,Y.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.addHint`)}),(0,Y.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:p.map(t=>{let a=Te(t,i),o=d.find(e=>e.componentId===t.id&&e.surface===`session-panel`),s=!!(o?.enabled&&_(o.scope,e));return(0,Y.jsxs)(`li`,{"data-session-component-candidate":t.id,className:`flex flex-col gap-1.5 rounded-sm px-1.5 py-1.5`,children:[(0,Y.jsx)(`span`,{className:`truncate text-[13px] font-medium text-content`,children:a}),s&&o?(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`ghost`,className:`self-start`,onClick:()=>n(o.instanceId),children:r(`custom-ui:studio.placed`)}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null,"data-session-component-scope":`all`,onClick:()=>void m(t,{type:`all`}),children:r(`custom-ui:studio.scopeAll`)}),(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null||!e,"data-session-component-scope":`project`,onClick:()=>void m(t,{type:`project`,cwd:e}),children:r(`custom-ui:sessionPanel.thisProject`)})]})]},t.id)})})]}):(0,Y.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.empty`)})}export{P as ComponentHost,ye as FloatingComponents,Ce as OverviewComponents,Ee as SessionComponentAddMenu,we as SessionPanelComponent};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mobile-runtime-recovery-tbTyacip.js","assets/rolldown-runtime-B0Z9INg1.js"])))=>i.map(i=>d[i]);
2
- import{h as e}from"./vendor-router-CSN_DGvx.js";import{i as t,n}from"./abort-signal-f4JsiYKX.js";import{i as r,n as i,r as a}from"./http-response-PZN5QIRk.js";async function o(r){if(typeof window>`u`||!window.__PISPER_MOBILE_APP__)return;let i=n(r,s);try{await t(e(()=>import(`./mobile-runtime-recovery-tbTyacip.js`).then(e=>e.t).then(async e=>{e.installMobileRuntimeForegroundRecovery(),await e.waitForMobileRuntimeReady()}),__vite__mapDeps([0,1])),i.signal)}finally{i.dispose()}}var s=3e4;function c(e,t){return e instanceof Error&&e.message?e.message:typeof e==`string`&&e?e:t}async function l(e,t,n){let{body:a,data:l,headers:u,signal:d,timeout:f=s,...p}=t,m=l===void 0?a:l,h=new Headers(u),g;m!==void 0&&(m instanceof Blob?(g=m,h.has(`Content-Type`)||h.set(`Content-Type`,m.type||`application/octet-stream`)):(g=typeof m==`string`?m:JSON.stringify(m),h.has(`Content-Type`)||h.set(`Content-Type`,`application/json`)));let _=new AbortController,v=!1,y=()=>_.abort(d?.reason);d?.aborted?y():d?.addEventListener(`abort`,y,{once:!0});let b=f>0?setTimeout(()=>{v=!0,_.abort(new DOMException(`Request timed out`,`TimeoutError`))},f):void 0;try{if(await o(_.signal),_.signal.aborted)throw _.signal.reason;let t=await fetch(e,{...p,body:g,headers:h,signal:_.signal});if(!t.ok)throw await i(t);return await n(t)}catch(e){throw e instanceof r?e:v?new r(`请求超时 (${f}ms)`,{kind:`timeout`}):d?.aborted?new r(c(d.reason,`请求已取消`),{kind:`cancelled`}):new r(c(e,`请求失败 (network)`),{kind:`network`})}finally{b!==void 0&&clearTimeout(b),d?.removeEventListener(`abort`,y)}}function u(e,t={}){let{parse:n,...r}=t;return l(e,r,async e=>{let t=await a(e);return n?n(t):t})}function d(e,t={}){return l(e,t,e=>e.text())}function f(e,t={}){return l(e,t,e=>e.blob())}export{o as i,u as n,d as r,f as t};
2
+ import{h as e}from"./vendor-router-CSN_DGvx.js";import{i as t,n}from"./abort-signal-f4JsiYKX.js";import{i as r,n as i,r as a}from"./http-response-scdqC11Q.js";async function o(r){if(typeof window>`u`||!window.__PISPER_MOBILE_APP__)return;let i=n(r,s);try{await t(e(()=>import(`./mobile-runtime-recovery-tbTyacip.js`).then(e=>e.t).then(async e=>{e.installMobileRuntimeForegroundRecovery(),await e.waitForMobileRuntimeReady()}),__vite__mapDeps([0,1])),i.signal)}finally{i.dispose()}}var s=3e4;function c(e,t){return e instanceof Error&&e.message?e.message:typeof e==`string`&&e?e:t}async function l(e,t,n){let{body:a,data:l,headers:u,signal:d,timeout:f=s,...p}=t,m=l===void 0?a:l,h=new Headers(u),g;m!==void 0&&(m instanceof Blob?(g=m,h.has(`Content-Type`)||h.set(`Content-Type`,m.type||`application/octet-stream`)):(g=typeof m==`string`?m:JSON.stringify(m),h.has(`Content-Type`)||h.set(`Content-Type`,`application/json`)));let _=new AbortController,v=!1,y=()=>_.abort(d?.reason);d?.aborted?y():d?.addEventListener(`abort`,y,{once:!0});let b=f>0?setTimeout(()=>{v=!0,_.abort(new DOMException(`Request timed out`,`TimeoutError`))},f):void 0;try{if(await o(_.signal),_.signal.aborted)throw _.signal.reason;let t=await fetch(e,{...p,body:g,headers:h,signal:_.signal});if(!t.ok)throw await i(t);return await n(t)}catch(e){throw e instanceof r?e:v?new r(`请求超时 (${f}ms)`,{kind:`timeout`}):d?.aborted?new r(c(d.reason,`请求已取消`),{kind:`cancelled`}):new r(c(e,`请求失败 (network)`),{kind:`network`})}finally{b!==void 0&&clearTimeout(b),d?.removeEventListener(`abort`,y)}}function u(e,t={}){let{parse:n,...r}=t;return l(e,r,async e=>{let t=await a(e);return n?n(t):t})}function d(e,t={}){return l(e,t,e=>e.text())}function f(e,t={}){return l(e,t,e=>e.blob())}export{o as i,u as n,d as r,f as t};
@@ -1 +1 @@
1
- import{c as e,d as t,l as n,u as r}from"./i18n-D80GstlU.js";var i=class extends Error{status;data;kind;constructor(e,t={}){super(e),this.name=`ApiError`,this.status=t.status,this.data=t.data,this.kind=t.kind}};function a(a){return new i(t(`common:api.invalidResponse`,n(e.language)?e.language:r()),{status:a,kind:`protocol`,data:{code:`INVALID_RESPONSE`}})}function o(e){if(e)try{let t=JSON.parse(e);return typeof t==`object`&&t&&!Array.isArray(t)?{...t,error:`error`in t&&typeof t.error==`string`?t.error:void 0}:{error:typeof t==`string`?t:e,body:t}}catch{return{error:e}}}async function s(e){let t=o(await e.text());return new i(t?.error||e.statusText||`HTTP ${e.status}`,{status:e.status,data:t,kind:`http`})}async function c(e){if(e.status===204)return;let t=await e.text();if(t)try{return JSON.parse(t)}catch{throw a(e.status)}}export{i,s as n,c as r,a as t};
1
+ import{c as e,d as t,l as n,u as r}from"./i18n-D5XUOwJ3.js";var i=class extends Error{status;data;kind;constructor(e,t={}){super(e),this.name=`ApiError`,this.status=t.status,this.data=t.data,this.kind=t.kind}};function a(a){return new i(t(`common:api.invalidResponse`,n(e.language)?e.language:r()),{status:a,kind:`protocol`,data:{code:`INVALID_RESPONSE`}})}function o(e){if(e)try{let t=JSON.parse(e);return typeof t==`object`&&t&&!Array.isArray(t)?{...t,error:`error`in t&&typeof t.error==`string`?t.error:void 0}:{error:typeof t==`string`?t:e,body:t}}catch{return{error:e}}}async function s(e){let t=o(await e.text());return new i(t?.error||e.statusText||`HTTP ${e.status}`,{status:e.status,data:t,kind:`http`})}async function c(e){if(e.status===204)return;let t=await e.text();if(t)try{return JSON.parse(t)}catch{throw a(e.status)}}export{i,s as n,c as r,a as t};