@nextclaw/ui 0.12.19 → 0.12.20-beta.1

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 (185) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/assets/api-BcqDx0tm.js +15 -0
  3. package/dist/assets/app-manager-provider-DVYBjif-.js +1 -0
  4. package/dist/assets/app-navigation.config-CMoWvFEI.js +1 -0
  5. package/dist/assets/{book-open-CVEuA0y5.js → book-open-DgLqYpNY.js} +1 -1
  6. package/dist/assets/{channels-list-page-BqhqaBf1.js → channels-list-page-CsoI4OJm.js} +2 -2
  7. package/dist/assets/{chat-D4KecKjB.js → chat-CA3aRmhx.js} +13 -12
  8. package/dist/assets/chat-page-gdSN6Pr6.js +1 -0
  9. package/dist/assets/chunk-JZWAC4HX-u4uYphxM.js +3 -0
  10. package/dist/assets/{config-split-page-BGjVACdO.js → config-split-page-BMRGuCJQ.js} +1 -1
  11. package/dist/assets/{createLucideIcon-PPrXCGK8.js → createLucideIcon-BZkY6emz.js} +1 -1
  12. package/dist/assets/desktop-update-config-CD6-2PfI.js +1 -0
  13. package/dist/assets/{dialog-CTCX7oLf.js → dialog-csshWetU.js} +1 -1
  14. package/dist/assets/{dist-FL5e8mMi.js → dist-Bl94Ahwx.js} +1 -1
  15. package/dist/assets/{doc-browser-C02neCIE.js → doc-browser-BUlCkZo2.js} +1 -1
  16. package/dist/assets/doc-browser-CzCV73NJ.js +1 -0
  17. package/dist/assets/doc-browser-Doh2541x.js +1 -0
  18. package/dist/assets/{doc-browser-context-C-WPOji4.js → doc-browser-context-DfLHAWbG.js} +1 -1
  19. package/dist/assets/{es2015-BNy4R8AC.js → es2015-JCM5-KtW.js} +1 -1
  20. package/dist/assets/{external-link-BNtqJE01.js → external-link-Sw3ah_JD.js} +1 -1
  21. package/dist/assets/{folder-QyJHVUNz.js → folder-D7-VTnkz.js} +1 -1
  22. package/dist/assets/{hash-BGYUE-zr.js → hash-zajSTDXZ.js} +1 -1
  23. package/dist/assets/i18n-C5Mibli1.js +1 -0
  24. package/dist/assets/index-BTDFuKka.js +2 -0
  25. package/dist/assets/index-CUmk8xFK.css +1 -0
  26. package/dist/assets/{key-round-DenCfA2w.js → key-round-CnI1mc9F.js} +1 -1
  27. package/dist/assets/loader-circle-B5i8oMMY.js +1 -0
  28. package/dist/assets/{logo-badge-CKAxvQFc.js → logo-badge-BQgKnVtz.js} +1 -1
  29. package/dist/assets/{logos-CqXnaJIm.js → logos-CqVm0q0W.js} +1 -1
  30. package/dist/assets/marketplace-page-DJGDpTAo.js +1 -0
  31. package/dist/assets/{marketplace-page-XnDa2ulT.js → marketplace-page-DxlxHCFm.js} +2 -2
  32. package/dist/assets/mcp-marketplace-page-5UjYRWOR.js +40 -0
  33. package/dist/assets/mcp-marketplace-page-C1XaHZZO.js +1 -0
  34. package/dist/assets/message-square-D6Z4NwpG.js +1 -0
  35. package/dist/assets/{model-config-ByeL6Toe.js → model-config-PccJ9XyH.js} +1 -1
  36. package/dist/assets/{notice-card-D00-02yg.js → notice-card-CCgk6FvF.js} +1 -1
  37. package/dist/assets/play-D8WJLnJe.js +1 -0
  38. package/dist/assets/plus-Di0KAkiO.js +1 -0
  39. package/dist/assets/{popover-AmJkxio3.js → popover-YAsxDBhY.js} +1 -1
  40. package/dist/assets/{provider-scoped-model-input-CfFJsJp-.js → provider-scoped-model-input-CzpF7cug.js} +1 -1
  41. package/dist/assets/{providers-list-HMQzW2WV.js → providers-list-8qDMER8o.js} +1 -1
  42. package/dist/assets/{refresh-ccw-B-dhb3yS.js → refresh-ccw-Bii4w8aB.js} +1 -1
  43. package/dist/assets/refresh-cw-BxojR62w.js +1 -0
  44. package/dist/assets/remote-D4TtLPAp.js +1 -0
  45. package/dist/assets/{rotate-cw-BWqAG3Fv.js → rotate-cw-1Xqa7LZ8.js} +1 -1
  46. package/dist/assets/runtime-config-page-D-4c5H5z.js +1 -0
  47. package/dist/assets/{save-DpdkGieJ.js → save--BVI5wZX.js} +1 -1
  48. package/dist/assets/search-config-D3a65l3r.js +1 -0
  49. package/dist/assets/{search-CQUdr7j_.js → search-vChioOoe.js} +1 -1
  50. package/dist/assets/{secrets-config-YCsGd1am.js → secrets-config-CoMlR_7i.js} +2 -2
  51. package/dist/assets/{select-DVUtSFHZ.js → select-DIZrwsKU.js} +1 -1
  52. package/dist/assets/{sessions-config-page-BKN-XdKr.js → sessions-config-page-Cc0TJStn.js} +2 -2
  53. package/dist/assets/{setting-row-Cb5-lFs-.js → setting-row-DiQyrE81.js} +1 -1
  54. package/dist/assets/{settings-DgtZZlnF.js → settings-CiRChctQ.js} +1 -1
  55. package/dist/assets/skeleton-CFQRIUzt.js +1 -0
  56. package/dist/assets/{sparkles-DNSCyDhL.js → sparkles-D1ZKWdm4.js} +1 -1
  57. package/dist/assets/{status-dot-X_j51OfA.js → status-dot-Dv_hiUVa.js} +1 -1
  58. package/dist/assets/{tabs-custom-CcWmekaF.js → tabs-custom-CsACkVji.js} +1 -1
  59. package/dist/assets/{tag-chip-fdbK2wE6.js → tag-chip-C3wDBe_-.js} +1 -1
  60. package/dist/assets/theme-provider-aOmrJ9J6.js +1 -0
  61. package/dist/assets/{tooltip-BkZCQcKw.js → tooltip-Dq5Xehpk.js} +1 -1
  62. package/dist/assets/{trash-2-CqciSCsg.js → trash-2-rY9ZteZX.js} +1 -1
  63. package/dist/assets/use-config-BQJjq1mP.js +1 -0
  64. package/dist/assets/{use-confirm-dialog-DSrb9205.js → use-confirm-dialog-DBoV5n5P.js} +1 -1
  65. package/dist/assets/{use-infinite-scroll-loader-DmowtyTI.js → use-infinite-scroll-loader-JAicqVC5.js} +1 -1
  66. package/dist/assets/{use-viewport-layout-CaALCA51.js → use-viewport-layout-BX3XqzJ4.js} +1 -1
  67. package/dist/assets/x-DpTzXQcX.js +1 -0
  68. package/dist/index.html +40 -39
  69. package/package.json +9 -6
  70. package/src/app/hooks/use-realtime-query-bridge.ts +5 -5
  71. package/src/app/index.tsx +7 -1
  72. package/src/features/channels/components/config/channel-form.tsx +3 -3
  73. package/src/features/channels/components/config/weixin-channel-auth-section.tsx +1 -1
  74. package/src/features/chat/components/conversation/chat-conversation-panel.tsx +1 -0
  75. package/src/features/chat/components/conversation/chat-input-bar.container.tsx +9 -4
  76. package/src/features/chat/components/conversation/chat-message-list.container.test.tsx +64 -6
  77. package/src/features/chat/components/conversation/chat-message-list.container.tsx +185 -17
  78. package/src/features/chat/components/session/session-context-icon.tsx +1 -4
  79. package/src/features/chat/hooks/use-ncp-chat-derived-state.ts +3 -1
  80. package/src/features/chat/hooks/use-ncp-chat-page-data.ts +7 -6
  81. package/src/features/chat/hooks/use-ncp-session-conversation.test.tsx +74 -2
  82. package/src/features/chat/hooks/use-ncp-session-conversation.ts +32 -10
  83. package/src/features/chat/hooks/use-selected-session-context-window-indicator.ts +20 -0
  84. package/src/features/chat/managers/ncp-chat-input.manager.test.ts +25 -0
  85. package/src/features/chat/managers/ncp-chat-input.manager.ts +5 -1
  86. package/src/features/chat/pages/ncp-chat-page.test.ts +22 -8
  87. package/src/features/chat/pages/ncp-chat-page.tsx +15 -11
  88. package/src/features/chat/stores/chat-thread.store.ts +8 -2
  89. package/src/features/chat/utils/chat-context-window-indicator.utils.ts +50 -0
  90. package/src/features/chat/utils/chat-runtime.utils.ts +1 -1
  91. package/src/features/chat/utils/chat-session-preference-governance.utils.test.tsx +114 -0
  92. package/src/features/chat/utils/chat-session-preference-governance.utils.ts +30 -36
  93. package/src/features/chat/utils/ncp-chat-runtime-availability.utils.test.ts +165 -0
  94. package/src/features/chat/utils/ncp-chat-runtime-availability.utils.ts +50 -0
  95. package/src/features/chat/utils/ncp-session-adapter.utils.test.ts +27 -0
  96. package/src/features/chat/utils/ncp-session-adapter.utils.ts +6 -4
  97. package/src/features/chat/utils/ncp-session-context-metadata.utils.ts +121 -0
  98. package/src/features/chat/utils/session-context.utils.ts +1 -2
  99. package/src/features/system-status/components/config/runtime-config-editor.tsx +6 -0
  100. package/src/features/system-status/components/config/runtime-settings-card.tsx +12 -0
  101. package/src/features/system-status/components/desktop-update-config.test.tsx +17 -7
  102. package/src/features/system-status/components/desktop-update-config.tsx +75 -30
  103. package/src/features/system-status/hooks/use-system-status.ts +0 -11
  104. package/src/features/system-status/index.ts +4 -1
  105. package/src/features/system-status/managers/runtime-update.manager.ts +330 -0
  106. package/src/features/system-status/managers/system-status.manager.test.ts +0 -25
  107. package/src/features/system-status/managers/system-status.manager.ts +1 -30
  108. package/src/features/system-status/stores/runtime-update.store.ts +24 -0
  109. package/src/features/system-status/types/system-status.types.ts +0 -2
  110. package/src/features/system-status/utils/runtime-config-agent.utils.ts +6 -1
  111. package/src/features/system-status/utils/system-status.utils.test.ts +1 -85
  112. package/src/features/system-status/utils/system-status.utils.ts +1 -23
  113. package/src/platforms/desktop/managers/desktop-update.manager.ts +6 -0
  114. package/src/platforms/desktop/types/desktop-update.types.ts +21 -19
  115. package/src/shared/components/common/brand-header.test.tsx +142 -0
  116. package/src/shared/components/common/brand-header.tsx +93 -0
  117. package/src/shared/components/cron-config.tsx +1 -1
  118. package/src/shared/components/doc-browser/doc-browser-context.test.tsx +1 -1
  119. package/src/shared/components/doc-browser/doc-browser.tsx +1 -1
  120. package/src/shared/components/search-config.tsx +3 -3
  121. package/src/shared/lib/api/README.md +3 -0
  122. package/src/shared/lib/api/index.ts +13 -11
  123. package/src/shared/lib/api/ncp-session.test.ts +17 -18
  124. package/src/shared/lib/api/ncp-session.types.ts +92 -0
  125. package/src/shared/lib/api/raw-client.utils.ts +3 -126
  126. package/src/shared/lib/api/services/agents.service.ts +18 -0
  127. package/src/shared/lib/api/services/channel-auth.service.ts +21 -0
  128. package/src/shared/lib/api/{client.ts → services/client.service.ts} +45 -1
  129. package/src/shared/lib/api/services/config.service.ts +171 -0
  130. package/src/shared/lib/api/services/marketplace.service.ts +66 -0
  131. package/src/shared/lib/api/services/mcp-marketplace.service.ts +70 -0
  132. package/src/shared/lib/api/services/ncp-attachments.service.ts +14 -0
  133. package/src/shared/lib/api/services/ncp-session.service.ts +39 -0
  134. package/src/shared/lib/api/services/remote.service.ts +50 -0
  135. package/src/shared/lib/api/services/runtime-control.service.ts +18 -0
  136. package/src/shared/lib/api/services/runtime-update.service.ts +26 -0
  137. package/src/shared/lib/api/services/server-path.service.ts +16 -0
  138. package/src/shared/lib/api/types.ts +9 -74
  139. package/src/shared/lib/i18n/{chat.ts → chat-labels.utils.ts} +13 -1
  140. package/src/shared/lib/i18n/desktop-update-labels.utils.ts +65 -0
  141. package/src/shared/lib/i18n/index.ts +4 -5
  142. package/src/shared/lib/i18n/runtime/i18n-language-owner.ts +5 -5
  143. package/src/shared/lib/transport/index.ts +1 -0
  144. package/src/shared/lib/transport/local-transport.service.ts +24 -4
  145. package/src/shared/lib/transport/remote-transport.service.ts +2 -2
  146. package/src/shared/lib/transport/request-raw-api-response.utils.ts +133 -0
  147. package/src/shared/lib/transport/transport.types.ts +8 -2
  148. package/src/shared/lib/ui-document-title/index.ts +1 -1
  149. package/tsconfig.json +1 -0
  150. package/dist/assets/api-BurjmW4A.js +0 -15
  151. package/dist/assets/app-manager-provider-DhxUmyTv.js +0 -1
  152. package/dist/assets/app-navigation.config-Bpd16Pem.js +0 -1
  153. package/dist/assets/chat-page-Cc7n80lW.js +0 -1
  154. package/dist/assets/chunk-JZWAC4HX-24FLdHl7.js +0 -3
  155. package/dist/assets/desktop-update-config-fMLlSStv.js +0 -1
  156. package/dist/assets/doc-browser-COj7x090.js +0 -1
  157. package/dist/assets/doc-browser-fyn7eDTp.js +0 -1
  158. package/dist/assets/i18n-CM4y8Mw9.js +0 -1
  159. package/dist/assets/index-CtVSzMPM.js +0 -2
  160. package/dist/assets/index-N3hjuljD.css +0 -1
  161. package/dist/assets/loader-circle-R23uEPkM.js +0 -1
  162. package/dist/assets/marketplace-page-mF-M5mku.js +0 -1
  163. package/dist/assets/mcp-marketplace-page-BArKWcRZ.js +0 -40
  164. package/dist/assets/mcp-marketplace-page-DBUcIIHJ.js +0 -1
  165. package/dist/assets/message-square-Dm34zD6k.js +0 -1
  166. package/dist/assets/play-ul4L6MWm.js +0 -1
  167. package/dist/assets/plus-D14303DH.js +0 -1
  168. package/dist/assets/remote-B4ELSd3u.js +0 -1
  169. package/dist/assets/runtime-config-page-N4FP6H0M.js +0 -1
  170. package/dist/assets/search-config-B62TY-z2.js +0 -1
  171. package/dist/assets/skeleton-BCPi52jT.js +0 -1
  172. package/dist/assets/theme-provider-WTWq_jYq.js +0 -1
  173. package/dist/assets/use-config-CyvhbRhf.js +0 -1
  174. package/dist/assets/x-tYcSDsrY.js +0 -1
  175. package/src/shared/lib/api/agents.ts +0 -34
  176. package/src/shared/lib/api/channel-auth.ts +0 -35
  177. package/src/shared/lib/api/config.ts +0 -362
  178. package/src/shared/lib/api/marketplace.ts +0 -156
  179. package/src/shared/lib/api/mcp-marketplace.ts +0 -138
  180. package/src/shared/lib/api/ncp-attachments.ts +0 -41
  181. package/src/shared/lib/api/ncp-session.ts +0 -78
  182. package/src/shared/lib/api/remote.ts +0 -86
  183. package/src/shared/lib/api/runtime-control.ts +0 -34
  184. package/src/shared/lib/api/server-path.ts +0 -46
  185. /package/dist/assets/{config-hints-CPNzbMEp.js → config-hints-MogHYQ8G.js} +0 -0
@@ -1,2 +1,2 @@
1
- import{_ as e,i as t,m as n,n as r,p as i,t as a,u as o}from"./i18n-CM4y8Mw9.js";import{At as s,Dt as c,Et as l,kt as u}from"./api-BurjmW4A.js";import{t as d}from"./createLucideIcon-PPrXCGK8.js";import{h as f,p,y as m}from"./theme-provider-WTWq_jYq.js";import{t as h}from"./search-CQUdr7j_.js";import{F as g,N as _,f as v,p as y,w as b}from"./chat-D4KecKjB.js";import{a as x,i as S,n as C,r as w,t as T}from"./select-DVUtSFHZ.js";import{t as E}from"./hash-BGYUE-zr.js";import{t as D}from"./settings-DgtZZlnF.js";import{t as O}from"./use-viewport-layout-CaALCA51.js";import{S as k,c as A,f as j,m as M}from"./use-config-CyvhbRhf.js";import{a as N,c as P,i as F,o as I}from"./config-split-page-BGjVACdO.js";import{t as L}from"./use-confirm-dialog-DSrb9205.js";var R=d(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),z=d(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),B=e(n(),1),V=i();function H(e){return e===`service`?`system`:e===`tool`?`tool`:e}function U(e){let t=[];for(let n of e.parts){if(n.type===`text`||n.type===`rich-text`||n.type===`reasoning`){t.push(n.text);continue}if(n.type!==`tool-invocation`)continue;let e=n.toolName?.trim()?`[${n.toolName.trim()}]`:`[tool]`;if(n.state===`result`&&typeof n.result==`string`&&n.result.trim()){t.push(`${e} ${n.result.trim()}`);continue}t.push(e)}return t.join(`
2
- `).trim()}function W({message:e}){let t=H(e.role),n=t===`user`,i=U(e);return(0,V.jsx)(`div`,{className:o(`flex w-full mb-6`,n?`justify-end`:`justify-start`),children:(0,V.jsxs)(`div`,{className:o(`max-w-[85%] rounded-[1.25rem] p-5 flex gap-3 text-sm`,n?`bg-primary text-white rounded-tr-sm`:`bg-gray-50 text-gray-800 rounded-tl-sm border border-gray-100/50`),children:[(0,V.jsx)(`div`,{className:`shrink-0 pt-0.5`,children:n?(0,V.jsx)(g,{className:`w-4 h-4 text-primary-100`}):(0,V.jsx)(m,{className:`w-4 h-4 text-gray-400`})}),(0,V.jsxs)(`div`,{className:`flex-1 space-y-1 overflow-x-hidden`,children:[(0,V.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 mb-2`,children:[(0,V.jsx)(`span`,{className:o(`font-semibold text-xs capitalize`,n?`text-primary-50`:`text-gray-900`),children:t}),(0,V.jsx)(`span`,{className:o(`text-[10px]`,n?`text-primary-200`:`text-gray-400`),children:r(e.timestamp)})]}),(0,V.jsx)(`div`,{className:`whitespace-pre-wrap break-words leading-relaxed text-[15px]`,children:i||`-`})]})]})})}function G(e){let[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(e.session.label||``),[c,l]=(0,B.useState)(e.session.preferredModel||``);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(s,{variant:`outline`,size:`sm`,onClick:()=>r(e=>!e),className:o(`h-8.5 rounded-lg shadow-none border-gray-200 transition-all text-xs font-semibold`,n?`bg-gray-100 text-gray-900`:`hover:bg-gray-50 hover:text-gray-900`),children:[(0,V.jsx)(D,{className:`w-3.5 h-3.5 mr-1.5`}),t(`sessionsMetadata`)]}),n?(0,V.jsxs)(`div`,{className:`flex items-center gap-3 bg-gray-50/50 p-3 rounded-lg border border-gray-100 animate-slide-in`,children:[(0,V.jsx)(u,{placeholder:t(`sessionsLabelPlaceholder`),value:i,onChange:e=>a(e.target.value),className:`h-8 text-sm bg-white`}),(0,V.jsx)(u,{placeholder:t(`sessionsModelPlaceholder`),value:c,onChange:e=>l(e.target.value),className:`h-8 text-sm bg-white`}),(0,V.jsx)(s,{size:`sm`,onClick:()=>{e.onSave({label:i,preferredModel:c}),r(!1)},className:`h-8 px-4 shrink-0 shadow-none`,disabled:e.isPending,children:t(`sessionsSaveMeta`)})]}):null]})}function K(){return(0,V.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center text-gray-400 p-8 h-full bg-white`,children:[(0,V.jsx)(`div`,{className:`w-20 h-20 bg-gray-50 rounded-3xl flex items-center justify-center mb-6 border border-gray-100 shadow-[0_2px_8px_-2px_rgba(0,0,0,0.02)] rotate-3`,children:(0,V.jsx)(z,{className:`h-8 w-8 text-gray-300 -rotate-3`})}),(0,V.jsx)(`h3`,{className:`text-lg font-bold text-gray-900 mb-2`,children:t(`sessionsNoSelectionTitle`)}),(0,V.jsx)(`p`,{className:`text-sm text-center max-w-sm leading-relaxed`,children:t(`sessionsNoSelectionDescription`)})]})}function q(e){let n=j(e.sessionKey,300),r=k(),i=A(),{confirm:a,ConfirmDialog:o}=L();return(0,V.jsxs)(`div`,{className:`flex-1 min-w-0 flex flex-col overflow-hidden relative bg-white rounded-2xl shadow-sm border border-gray-200`,children:[r.isPending||i.isPending?(0,V.jsx)(`div`,{className:`absolute top-0 left-0 w-full h-1 bg-primary/20 overflow-hidden z-20`,children:(0,V.jsx)(`div`,{className:`h-full bg-primary animate-pulse w-1/3 rounded-r-full`})}):null,e.sessionKey&&e.session&&e.summary&&e.channelLabel?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`shrink-0 border-b border-gray-100 bg-white px-4 py-4 z-10 space-y-4 sm:px-8 sm:py-5`,children:(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,V.jsx)(`div`,{className:`h-12 w-12 rounded-[14px] bg-gray-50 border border-gray-100 flex items-center justify-center text-gray-400 shrink-0`,children:(0,V.jsx)(E,{className:`h-6 w-6`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 mb-1.5`,children:[(0,V.jsx)(`h3`,{className:`text-lg font-bold text-gray-900 tracking-tight`,children:e.session.label?.trim()||e.session.key.split(`:`).pop()||e.session.key}),(0,V.jsx)(`span`,{className:`text-[10px] font-bold px-2 py-0.5 rounded-full bg-gray-100 text-gray-500 uppercase tracking-widest`,children:e.channelLabel}),e.summary.status===`running`?(0,V.jsx)(_,{status:`running`,className:`h-4 w-4`}):null]}),(0,V.jsx)(`div`,{className:`text-xs text-gray-500 font-mono break-all line-clamp-1 opacity-70`,title:e.sessionKey,children:e.sessionKey})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,V.jsx)(G,{session:e.session,isPending:r.isPending,onSave:t=>{e.sessionKey&&r.mutate({sessionId:e.sessionKey,data:{label:t.label.trim()||null,preferredModel:t.preferredModel.trim()||null}})}},e.session.key),(0,V.jsx)(s,{variant:`outline`,size:`sm`,onClick:async()=>{e.sessionKey&&await a({title:t(`sessionsDeleteConfirm`)+`?`,variant:`destructive`,confirmLabel:t(`sessionsDeleteConfirm`)})&&i.mutate({sessionId:e.sessionKey},{onSuccess:()=>e.onClearSelection()})},className:`h-8.5 rounded-lg shadow-none hover:bg-red-50 hover:text-red-600 hover:border-red-200 border-gray-200 text-xs font-semibold text-red-500`,children:t(`delete`)})]})]})}),(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4 relative [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:bg-gray-300/80 [&::-webkit-scrollbar-thumb]:rounded-full sm:p-6`,children:[n.isLoading?(0,V.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-gray-50/50 backdrop-blur-sm z-10`,children:(0,V.jsxs)(`div`,{className:`flex flex-col items-center gap-3 animate-pulse`,children:[(0,V.jsx)(p,{className:`w-6 h-6 text-primary animate-spin`}),(0,V.jsx)(`span`,{className:`text-sm font-medium text-gray-500`,children:t(`sessionsHistoryLoading`)})]})}):null,n.error?(0,V.jsx)(`div`,{className:`text-center p-6 bg-red-50 rounded-xl text-red-600 border border-red-100 text-sm`,children:n.error.message}):null,!n.isLoading&&n.data?.messages.length===0?(0,V.jsxs)(`div`,{className:`h-full flex flex-col items-center justify-center text-gray-400`,children:[(0,V.jsx)(f,{className:`w-12 h-12 mb-3 text-gray-300`}),(0,V.jsx)(`p`,{className:`text-sm`,children:t(`sessionsEmpty`)})]}):null,(0,V.jsx)(`div`,{className:`max-w-3xl mx-auto`,children:(n.data?.messages??[]).map(e=>(0,V.jsx)(W,{message:e},e.id))})]})]}):(0,V.jsx)(K,{}),(0,V.jsx)(o,{})]})}var J=`__unknown_channel__`;function Y(e){let t=e.indexOf(`:`);return t<=0?J:e.slice(0,t).trim()||J}function X(e){return e===J?t(`sessionsUnknownChannel`):e}function Z(e){return(0,V.jsxs)(`button`,{onClick:e.onSelect,className:o(`w-full text-left p-3.5 rounded-xl transition-all duration-200 outline-none focus:outline-none focus:ring-0 group`,e.isSelected?`bg-brand-50 border border-brand-100/50`:`bg-transparent border border-transparent hover:bg-gray-50/80`),children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between mb-1.5`,children:[(0,V.jsx)(`div`,{className:o(`font-semibold truncate pr-2 flex-1 text-sm`,e.isSelected?`text-brand-800`:`text-gray-900`),children:v(e.session)}),(0,V.jsx)(`div`,{className:o(`text-[10px] font-bold px-2 py-0.5 rounded-full shrink-0 capitalize`,e.isSelected?`bg-white text-brand-600 shadow-[0_1px_2px_rgba(0,0,0,0.02)]`:`bg-gray-100 text-gray-500`),children:e.channelLabel})]}),(0,V.jsxs)(`div`,{className:o(`flex items-center text-xs justify-between mt-2 font-medium`,e.isSelected?`text-brand-600/80`:`text-gray-400`),children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(`span`,{className:`inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center`,children:e.summary.status===`running`?(0,V.jsx)(_,{status:`running`}):null}),(0,V.jsx)(R,{className:`w-3.5 h-3.5 opacity-70`}),(0,V.jsx)(`span`,{className:`truncate max-w-[100px]`,children:a(e.summary.updatedAt)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(f,{className:`w-3.5 h-3.5 opacity-70`}),(0,V.jsx)(`span`,{children:e.summary.messageCount})]})]})]})}function Q(){let{isMobile:e}=O(),[n,r]=(0,B.useState)(``),[i,a]=(0,B.useState)(null),[d,f]=(0,B.useState)(`all`),m=M({limit:100}),g=(0,B.useMemo)(()=>m.data?.sessions??[],[m.data?.sessions]),_=(0,B.useMemo)(()=>b(g),[g]),v=(0,B.useMemo)(()=>new Map(g.map(e=>[e.sessionId,e])),[g]),E=(0,B.useMemo)(()=>_.filter(e=>d!==`all`&&Y(e.key)!==d?!1:y(e,n)),[n,d,_]),D=(0,B.useMemo)(()=>{let e=new Set;for(let t of _)e.add(Y(t.key));return Array.from(e).sort((e,t)=>e===J?1:t===J?-1:e.localeCompare(t))},[_]),k=i&&v.has(i)?i:null,A=(0,B.useMemo)(()=>_.find(e=>e.key===k)??null,[k,_]),j=k?v.get(k)??null:null,L=A?X(Y(A.key)):null;return(0,V.jsxs)(c,{className:`pb-0 xl:flex xl:h-full xl:min-h-0 xl:flex-col`,children:[(0,V.jsx)(l,{title:t(`sessionsPageTitle`),description:t(`sessionsPageDescription`)}),(0,V.jsxs)(F,{className:`xl:min-h-0`,mobileView:e?k?`detail`:`list`:void 0,onMobileBack:()=>a(null),mobileListLabel:t(`sessionsPageTitle`),children:[(0,V.jsxs)(N,{className:`xl:w-[320px] xl:flex-none`,children:[(0,V.jsxs)(P,{className:`space-y-3 px-4 py-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`span`,{className:`text-[11px] font-semibold text-gray-400 uppercase tracking-wider`,children:[_.length,` `,t(`sessionsListTitle`)]}),(0,V.jsx)(s,{variant:`ghost`,size:`icon`,className:`h-7 w-7 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100`,onClick:()=>m.refetch(),children:(0,V.jsx)(p,{className:o(`h-3.5 w-3.5`,m.isFetching&&`animate-spin`)})})]}),(0,V.jsxs)(T,{value:d,onValueChange:f,children:[(0,V.jsx)(S,{className:`w-full h-8.5 rounded-lg bg-gray-50/50 hover:bg-gray-100 border-gray-200 focus:ring-0 shadow-none text-xs font-medium text-gray-700`,children:(0,V.jsx)(x,{placeholder:t(`sessionsAllChannels`)})}),(0,V.jsxs)(C,{className:`rounded-xl shadow-lg border-gray-100 max-w-[280px]`,children:[(0,V.jsx)(w,{value:`all`,className:`rounded-lg text-xs`,children:t(`sessionsAllChannels`)}),D.map(e=>(0,V.jsx)(w,{value:e,className:`rounded-lg text-xs truncate pr-6`,children:X(e)},e))]})]}),(0,V.jsxs)(`div`,{className:`relative w-full`,children:[(0,V.jsx)(h,{className:`h-3.5 w-3.5 absolute left-3 top-2.5 text-gray-400`}),(0,V.jsx)(u,{value:n,onChange:e=>r(e.target.value),placeholder:t(`sessionsSearchPlaceholder`),className:`pl-8 h-8.5 rounded-lg bg-gray-50/50 border-gray-200 focus-visible:bg-white text-xs`})]})]}),(0,V.jsx)(I,{className:`space-y-1 p-3 pb-10`,children:m.isLoading?(0,V.jsx)(`div`,{className:`text-sm text-gray-400 p-4 text-center`,children:t(`sessionsLoading`)}):E.length===0?(0,V.jsxs)(`div`,{className:`text-sm text-gray-400 p-4 text-center border-2 border-dashed border-gray-100 rounded-xl mt-4`,children:[(0,V.jsx)(z,{className:`w-8 h-8 mx-auto mb-2 text-gray-300`}),t(`sessionsEmpty`)]}):E.map(e=>{let t=v.get(e.key);return t?(0,V.jsx)(Z,{session:e,summary:t,channelLabel:X(Y(e.key)),isSelected:k===e.key,onSelect:()=>a(e.key)},e.key):null})})]}),(0,V.jsx)(q,{sessionKey:k,session:A,summary:j,channelLabel:L,onClearSelection:()=>a(null)})]})]})}export{Q as SessionsConfig};
1
+ import{_ as e,i as t,m as n,n as r,p as i,t as a,u as o}from"./i18n-C5Mibli1.js";import{At as s,Dt as c,Ot as l,jt as u}from"./api-BcqDx0tm.js";import{t as d}from"./createLucideIcon-BZkY6emz.js";import{_ as f,m as p}from"./theme-provider-aOmrJ9J6.js";import{t as m}from"./search-vChioOoe.js";import{F as h,L as g,O as _,d as v,u as y}from"./chat-CA3aRmhx.js";import{a as b,i as x,n as S,r as C,t as w}from"./select-DIZrwsKU.js";import{t as T}from"./refresh-cw-BxojR62w.js";import{t as E}from"./hash-zajSTDXZ.js";import{t as D}from"./settings-CiRChctQ.js";import{t as O}from"./use-viewport-layout-BX3XqzJ4.js";import{S as k,c as A,f as j,m as M}from"./use-config-BQJjq1mP.js";import{a as N,c as P,i as F,o as I}from"./config-split-page-BMRGuCJQ.js";import{t as L}from"./use-confirm-dialog-DBoV5n5P.js";var R=d(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),z=d(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),B=e(n(),1),V=i();function H(e){return e===`service`?`system`:e===`tool`?`tool`:e}function U(e){let t=[];for(let n of e.parts){if(n.type===`text`||n.type===`rich-text`||n.type===`reasoning`){t.push(n.text);continue}if(n.type!==`tool-invocation`)continue;let e=n.toolName?.trim()?`[${n.toolName.trim()}]`:`[tool]`;if(n.state===`result`&&typeof n.result==`string`&&n.result.trim()){t.push(`${e} ${n.result.trim()}`);continue}t.push(e)}return t.join(`
2
+ `).trim()}function W({message:e}){let t=H(e.role),n=t===`user`,i=U(e);return(0,V.jsx)(`div`,{className:o(`flex w-full mb-6`,n?`justify-end`:`justify-start`),children:(0,V.jsxs)(`div`,{className:o(`max-w-[85%] rounded-[1.25rem] p-5 flex gap-3 text-sm`,n?`bg-primary text-white rounded-tr-sm`:`bg-gray-50 text-gray-800 rounded-tl-sm border border-gray-100/50`),children:[(0,V.jsx)(`div`,{className:`shrink-0 pt-0.5`,children:n?(0,V.jsx)(g,{className:`w-4 h-4 text-primary-100`}):(0,V.jsx)(f,{className:`w-4 h-4 text-gray-400`})}),(0,V.jsxs)(`div`,{className:`flex-1 space-y-1 overflow-x-hidden`,children:[(0,V.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 mb-2`,children:[(0,V.jsx)(`span`,{className:o(`font-semibold text-xs capitalize`,n?`text-primary-50`:`text-gray-900`),children:t}),(0,V.jsx)(`span`,{className:o(`text-[10px]`,n?`text-primary-200`:`text-gray-400`),children:r(e.timestamp)})]}),(0,V.jsx)(`div`,{className:`whitespace-pre-wrap break-words leading-relaxed text-[15px]`,children:i||`-`})]})]})})}function G(e){let[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(e.session.label||``),[c,l]=(0,B.useState)(e.session.preferredModel||``);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(u,{variant:`outline`,size:`sm`,onClick:()=>r(e=>!e),className:o(`h-8.5 rounded-lg shadow-none border-gray-200 transition-all text-xs font-semibold`,n?`bg-gray-100 text-gray-900`:`hover:bg-gray-50 hover:text-gray-900`),children:[(0,V.jsx)(D,{className:`w-3.5 h-3.5 mr-1.5`}),t(`sessionsMetadata`)]}),n?(0,V.jsxs)(`div`,{className:`flex items-center gap-3 bg-gray-50/50 p-3 rounded-lg border border-gray-100 animate-slide-in`,children:[(0,V.jsx)(s,{placeholder:t(`sessionsLabelPlaceholder`),value:i,onChange:e=>a(e.target.value),className:`h-8 text-sm bg-white`}),(0,V.jsx)(s,{placeholder:t(`sessionsModelPlaceholder`),value:c,onChange:e=>l(e.target.value),className:`h-8 text-sm bg-white`}),(0,V.jsx)(u,{size:`sm`,onClick:()=>{e.onSave({label:i,preferredModel:c}),r(!1)},className:`h-8 px-4 shrink-0 shadow-none`,disabled:e.isPending,children:t(`sessionsSaveMeta`)})]}):null]})}function K(){return(0,V.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center text-gray-400 p-8 h-full bg-white`,children:[(0,V.jsx)(`div`,{className:`w-20 h-20 bg-gray-50 rounded-3xl flex items-center justify-center mb-6 border border-gray-100 shadow-[0_2px_8px_-2px_rgba(0,0,0,0.02)] rotate-3`,children:(0,V.jsx)(z,{className:`h-8 w-8 text-gray-300 -rotate-3`})}),(0,V.jsx)(`h3`,{className:`text-lg font-bold text-gray-900 mb-2`,children:t(`sessionsNoSelectionTitle`)}),(0,V.jsx)(`p`,{className:`text-sm text-center max-w-sm leading-relaxed`,children:t(`sessionsNoSelectionDescription`)})]})}function q(e){let n=j(e.sessionKey,300),r=k(),i=A(),{confirm:a,ConfirmDialog:o}=L();return(0,V.jsxs)(`div`,{className:`flex-1 min-w-0 flex flex-col overflow-hidden relative bg-white rounded-2xl shadow-sm border border-gray-200`,children:[r.isPending||i.isPending?(0,V.jsx)(`div`,{className:`absolute top-0 left-0 w-full h-1 bg-primary/20 overflow-hidden z-20`,children:(0,V.jsx)(`div`,{className:`h-full bg-primary animate-pulse w-1/3 rounded-r-full`})}):null,e.sessionKey&&e.session&&e.summary&&e.channelLabel?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`shrink-0 border-b border-gray-100 bg-white px-4 py-4 z-10 space-y-4 sm:px-8 sm:py-5`,children:(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,V.jsx)(`div`,{className:`h-12 w-12 rounded-[14px] bg-gray-50 border border-gray-100 flex items-center justify-center text-gray-400 shrink-0`,children:(0,V.jsx)(E,{className:`h-6 w-6`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 mb-1.5`,children:[(0,V.jsx)(`h3`,{className:`text-lg font-bold text-gray-900 tracking-tight`,children:e.session.label?.trim()||e.session.key.split(`:`).pop()||e.session.key}),(0,V.jsx)(`span`,{className:`text-[10px] font-bold px-2 py-0.5 rounded-full bg-gray-100 text-gray-500 uppercase tracking-widest`,children:e.channelLabel}),e.summary.status===`running`?(0,V.jsx)(h,{status:`running`,className:`h-4 w-4`}):null]}),(0,V.jsx)(`div`,{className:`text-xs text-gray-500 font-mono break-all line-clamp-1 opacity-70`,title:e.sessionKey,children:e.sessionKey})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,V.jsx)(G,{session:e.session,isPending:r.isPending,onSave:t=>{e.sessionKey&&r.mutate({sessionId:e.sessionKey,data:{label:t.label.trim()||null,preferredModel:t.preferredModel.trim()||null}})}},e.session.key),(0,V.jsx)(u,{variant:`outline`,size:`sm`,onClick:async()=>{e.sessionKey&&await a({title:t(`sessionsDeleteConfirm`)+`?`,variant:`destructive`,confirmLabel:t(`sessionsDeleteConfirm`)})&&i.mutate({sessionId:e.sessionKey},{onSuccess:()=>e.onClearSelection()})},className:`h-8.5 rounded-lg shadow-none hover:bg-red-50 hover:text-red-600 hover:border-red-200 border-gray-200 text-xs font-semibold text-red-500`,children:t(`delete`)})]})]})}),(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4 relative [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:bg-gray-300/80 [&::-webkit-scrollbar-thumb]:rounded-full sm:p-6`,children:[n.isLoading?(0,V.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-gray-50/50 backdrop-blur-sm z-10`,children:(0,V.jsxs)(`div`,{className:`flex flex-col items-center gap-3 animate-pulse`,children:[(0,V.jsx)(T,{className:`w-6 h-6 text-primary animate-spin`}),(0,V.jsx)(`span`,{className:`text-sm font-medium text-gray-500`,children:t(`sessionsHistoryLoading`)})]})}):null,n.error?(0,V.jsx)(`div`,{className:`text-center p-6 bg-red-50 rounded-xl text-red-600 border border-red-100 text-sm`,children:n.error.message}):null,!n.isLoading&&n.data?.messages.length===0?(0,V.jsxs)(`div`,{className:`h-full flex flex-col items-center justify-center text-gray-400`,children:[(0,V.jsx)(p,{className:`w-12 h-12 mb-3 text-gray-300`}),(0,V.jsx)(`p`,{className:`text-sm`,children:t(`sessionsEmpty`)})]}):null,(0,V.jsx)(`div`,{className:`max-w-3xl mx-auto`,children:(n.data?.messages??[]).map(e=>(0,V.jsx)(W,{message:e},e.id))})]})]}):(0,V.jsx)(K,{}),(0,V.jsx)(o,{})]})}var J=`__unknown_channel__`;function Y(e){let t=e.indexOf(`:`);return t<=0?J:e.slice(0,t).trim()||J}function X(e){return e===J?t(`sessionsUnknownChannel`):e}function Z(e){return(0,V.jsxs)(`button`,{onClick:e.onSelect,className:o(`w-full text-left p-3.5 rounded-xl transition-all duration-200 outline-none focus:outline-none focus:ring-0 group`,e.isSelected?`bg-brand-50 border border-brand-100/50`:`bg-transparent border border-transparent hover:bg-gray-50/80`),children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between mb-1.5`,children:[(0,V.jsx)(`div`,{className:o(`font-semibold truncate pr-2 flex-1 text-sm`,e.isSelected?`text-brand-800`:`text-gray-900`),children:y(e.session)}),(0,V.jsx)(`div`,{className:o(`text-[10px] font-bold px-2 py-0.5 rounded-full shrink-0 capitalize`,e.isSelected?`bg-white text-brand-600 shadow-[0_1px_2px_rgba(0,0,0,0.02)]`:`bg-gray-100 text-gray-500`),children:e.channelLabel})]}),(0,V.jsxs)(`div`,{className:o(`flex items-center text-xs justify-between mt-2 font-medium`,e.isSelected?`text-brand-600/80`:`text-gray-400`),children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(`span`,{className:`inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center`,children:e.summary.status===`running`?(0,V.jsx)(h,{status:`running`}):null}),(0,V.jsx)(R,{className:`w-3.5 h-3.5 opacity-70`}),(0,V.jsx)(`span`,{className:`truncate max-w-[100px]`,children:a(e.summary.updatedAt)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(p,{className:`w-3.5 h-3.5 opacity-70`}),(0,V.jsx)(`span`,{children:e.summary.messageCount})]})]})]})}function Q(){let{isMobile:e}=O(),[n,r]=(0,B.useState)(``),[i,a]=(0,B.useState)(null),[d,f]=(0,B.useState)(`all`),p=M({limit:100}),h=(0,B.useMemo)(()=>p.data?.sessions??[],[p.data?.sessions]),g=(0,B.useMemo)(()=>_(h),[h]),y=(0,B.useMemo)(()=>new Map(h.map(e=>[e.sessionId,e])),[h]),E=(0,B.useMemo)(()=>g.filter(e=>d!==`all`&&Y(e.key)!==d?!1:v(e,n)),[n,d,g]),D=(0,B.useMemo)(()=>{let e=new Set;for(let t of g)e.add(Y(t.key));return Array.from(e).sort((e,t)=>e===J?1:t===J?-1:e.localeCompare(t))},[g]),k=i&&y.has(i)?i:null,A=(0,B.useMemo)(()=>g.find(e=>e.key===k)??null,[k,g]),j=k?y.get(k)??null:null,L=A?X(Y(A.key)):null;return(0,V.jsxs)(l,{className:`pb-0 xl:flex xl:h-full xl:min-h-0 xl:flex-col`,children:[(0,V.jsx)(c,{title:t(`sessionsPageTitle`),description:t(`sessionsPageDescription`)}),(0,V.jsxs)(F,{className:`xl:min-h-0`,mobileView:e?k?`detail`:`list`:void 0,onMobileBack:()=>a(null),mobileListLabel:t(`sessionsPageTitle`),children:[(0,V.jsxs)(N,{className:`xl:w-[320px] xl:flex-none`,children:[(0,V.jsxs)(P,{className:`space-y-3 px-4 py-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`span`,{className:`text-[11px] font-semibold text-gray-400 uppercase tracking-wider`,children:[g.length,` `,t(`sessionsListTitle`)]}),(0,V.jsx)(u,{variant:`ghost`,size:`icon`,className:`h-7 w-7 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100`,onClick:()=>p.refetch(),children:(0,V.jsx)(T,{className:o(`h-3.5 w-3.5`,p.isFetching&&`animate-spin`)})})]}),(0,V.jsxs)(w,{value:d,onValueChange:f,children:[(0,V.jsx)(x,{className:`w-full h-8.5 rounded-lg bg-gray-50/50 hover:bg-gray-100 border-gray-200 focus:ring-0 shadow-none text-xs font-medium text-gray-700`,children:(0,V.jsx)(b,{placeholder:t(`sessionsAllChannels`)})}),(0,V.jsxs)(S,{className:`rounded-xl shadow-lg border-gray-100 max-w-[280px]`,children:[(0,V.jsx)(C,{value:`all`,className:`rounded-lg text-xs`,children:t(`sessionsAllChannels`)}),D.map(e=>(0,V.jsx)(C,{value:e,className:`rounded-lg text-xs truncate pr-6`,children:X(e)},e))]})]}),(0,V.jsxs)(`div`,{className:`relative w-full`,children:[(0,V.jsx)(m,{className:`h-3.5 w-3.5 absolute left-3 top-2.5 text-gray-400`}),(0,V.jsx)(s,{value:n,onChange:e=>r(e.target.value),placeholder:t(`sessionsSearchPlaceholder`),className:`pl-8 h-8.5 rounded-lg bg-gray-50/50 border-gray-200 focus-visible:bg-white text-xs`})]})]}),(0,V.jsx)(I,{className:`space-y-1 p-3 pb-10`,children:p.isLoading?(0,V.jsx)(`div`,{className:`text-sm text-gray-400 p-4 text-center`,children:t(`sessionsLoading`)}):E.length===0?(0,V.jsxs)(`div`,{className:`text-sm text-gray-400 p-4 text-center border-2 border-dashed border-gray-100 rounded-xl mt-4`,children:[(0,V.jsx)(z,{className:`w-8 h-8 mx-auto mb-2 text-gray-300`}),t(`sessionsEmpty`)]}):E.map(e=>{let t=y.get(e.key);return t?(0,V.jsx)(Z,{session:e,summary:t,channelLabel:X(Y(e.key)),isSelected:k===e.key,onSelect:()=>a(e.key)},e.key):null})})]}),(0,V.jsx)(q,{sessionKey:k,session:A,summary:j,channelLabel:L,onClearSelection:()=>a(null)})]})]})}export{Q as SessionsConfig};
@@ -1 +1 @@
1
- import{_ as e,m as t,p as n,u as r}from"./i18n-CM4y8Mw9.js";import{jt as i}from"./api-BurjmW4A.js";var a=e(t(),1),o=n(),s=i(`flex items-start justify-between gap-4 rounded-xl border p-4`,{variants:{tone:{default:`border-gray-200 bg-white`,muted:`border-gray-200 bg-gray-50`}},defaultVariants:{tone:`default`}}),c=a.forwardRef(({className:e,tone:t,title:n,description:i,control:a,children:c,...l},u)=>(0,o.jsxs)(`div`,{ref:u,className:r(s({tone:t}),e),...l,children:[(0,o.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,o.jsx)(`div`,{className:`text-sm font-medium text-gray-900`,children:n}),i?(0,o.jsx)(`p`,{className:`text-sm leading-6 text-gray-500`,children:i}):null,c]}),a?(0,o.jsx)(`div`,{className:`shrink-0`,children:a}):null]}));c.displayName=`SettingRow`;export{c as t};
1
+ import{_ as e,m as t,p as n,u as r}from"./i18n-C5Mibli1.js";import{Mt as i}from"./api-BcqDx0tm.js";var a=e(t(),1),o=n(),s=i(`flex items-start justify-between gap-4 rounded-xl border p-4`,{variants:{tone:{default:`border-gray-200 bg-white`,muted:`border-gray-200 bg-gray-50`}},defaultVariants:{tone:`default`}}),c=a.forwardRef(({className:e,tone:t,title:n,description:i,control:a,children:c,...l},u)=>(0,o.jsxs)(`div`,{ref:u,className:r(s({tone:t}),e),...l,children:[(0,o.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,o.jsx)(`div`,{className:`text-sm font-medium text-gray-900`,children:n}),i?(0,o.jsx)(`p`,{className:`text-sm leading-6 text-gray-500`,children:i}):null,c]}),a?(0,o.jsx)(`div`,{className:`shrink-0`,children:a}):null]}));c.displayName=`SettingRow`;export{c as t};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-PPrXCGK8.js";var t=e(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-BZkY6emz.js";var t=e(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{p as e,u as t}from"./i18n-C5Mibli1.js";var n=e();function r({className:e,...r}){return(0,n.jsx)(`div`,{className:t(`animate-pulse rounded-md bg-slate-200`,e),...r})}export{r as t};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-PPrXCGK8.js";var t=e(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-BZkY6emz.js";var t=e(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]);export{t};
@@ -1 +1 @@
1
- import{p as e,u as t}from"./i18n-CM4y8Mw9.js";var n=e(),r={active:{dot:`bg-emerald-500`,text:`text-emerald-600`,bg:`bg-emerald-50`},ready:{dot:`bg-emerald-500`,text:`text-emerald-600`,bg:`bg-emerald-50`},inactive:{dot:`bg-gray-300`,text:`text-gray-400`,bg:`bg-gray-100/80`},setup:{dot:`bg-gray-300`,text:`text-gray-400`,bg:`bg-gray-100/80`},warning:{dot:`bg-amber-400`,text:`text-amber-600`,bg:`bg-amber-50`}};function i({status:e,label:i,className:a}){let o=r[e];return(0,n.jsxs)(`div`,{className:t(`inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-2 py-0.5`,o.bg,a),children:[(0,n.jsx)(`span`,{className:t(`h-1.5 w-1.5 rounded-full`,o.dot)}),(0,n.jsx)(`span`,{className:t(`text-[11px] font-medium`,o.text),children:i})]})}export{i as t};
1
+ import{p as e,u as t}from"./i18n-C5Mibli1.js";var n=e(),r={active:{dot:`bg-emerald-500`,text:`text-emerald-600`,bg:`bg-emerald-50`},ready:{dot:`bg-emerald-500`,text:`text-emerald-600`,bg:`bg-emerald-50`},inactive:{dot:`bg-gray-300`,text:`text-gray-400`,bg:`bg-gray-100/80`},setup:{dot:`bg-gray-300`,text:`text-gray-400`,bg:`bg-gray-100/80`},warning:{dot:`bg-amber-400`,text:`text-amber-600`,bg:`bg-amber-50`}};function i({status:e,label:i,className:a}){let o=r[e];return(0,n.jsxs)(`div`,{className:t(`inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-2 py-0.5`,o.bg,a),children:[(0,n.jsx)(`span`,{className:t(`h-1.5 w-1.5 rounded-full`,o.dot)}),(0,n.jsx)(`span`,{className:t(`text-[11px] font-medium`,o.text),children:i})]})}export{i as t};
@@ -1 +1 @@
1
- import{m as e,p as t,r as n,u as r}from"./i18n-CM4y8Mw9.js";e();var i=t();function a({tabs:e,activeTab:t,onChange:a,className:o}){return(0,i.jsx)(`div`,{className:r(`flex items-center gap-6 border-b border-gray-200/60 mb-6`,o),children:e.map(e=>{let o=t===e.id;return(0,i.jsxs)(`button`,{onClick:()=>a(e.id),className:r(`relative pb-3 text-[14px] font-medium transition-all duration-fast flex items-center gap-1.5`,o?`text-gray-900`:`text-gray-600 hover:text-gray-900`),children:[e.label,e.count!==void 0&&(0,i.jsx)(`span`,{className:r(`text-[11px] font-medium`,`text-gray-500`),children:n(e.count)}),o&&(0,i.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-[2px] bg-primary rounded-full`})]},e.id)})})}export{a as t};
1
+ import{m as e,p as t,r as n,u as r}from"./i18n-C5Mibli1.js";e();var i=t();function a({tabs:e,activeTab:t,onChange:a,className:o}){return(0,i.jsx)(`div`,{className:r(`flex items-center gap-6 border-b border-gray-200/60 mb-6`,o),children:e.map(e=>{let o=t===e.id;return(0,i.jsxs)(`button`,{onClick:()=>a(e.id),className:r(`relative pb-3 text-[14px] font-medium transition-all duration-fast flex items-center gap-1.5`,o?`text-gray-900`:`text-gray-600 hover:text-gray-900`),children:[e.label,e.count!==void 0&&(0,i.jsx)(`span`,{className:r(`text-[11px] font-medium`,`text-gray-500`),children:n(e.count)}),o&&(0,i.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-[2px] bg-primary rounded-full`})]},e.id)})})}export{a as t};
@@ -1 +1 @@
1
- import{_ as e,m as t,p as n,u as r}from"./i18n-CM4y8Mw9.js";import{jt as i}from"./api-BurjmW4A.js";var a=e(t(),1),o=n(),s=i(`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px] font-medium`,{variants:{tone:{subtle:`border-gray-200 bg-gray-50 text-gray-600`,neutral:`border-gray-200 bg-white text-gray-600`,success:`border-emerald-200 bg-emerald-50 text-emerald-700`,warning:`border-amber-200 bg-amber-50 text-amber-800`,danger:`border-rose-200 bg-rose-50 text-rose-600`,info:`border-primary/20 bg-primary/10 text-primary`}},defaultVariants:{tone:`subtle`}}),c=a.forwardRef(({className:e,tone:t,...n},i)=>(0,o.jsx)(`span`,{ref:i,className:r(s({tone:t}),e),...n}));c.displayName=`TagChip`;export{c as t};
1
+ import{_ as e,m as t,p as n,u as r}from"./i18n-C5Mibli1.js";import{Mt as i}from"./api-BcqDx0tm.js";var a=e(t(),1),o=n(),s=i(`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px] font-medium`,{variants:{tone:{subtle:`border-gray-200 bg-gray-50 text-gray-600`,neutral:`border-gray-200 bg-white text-gray-600`,success:`border-emerald-200 bg-emerald-50 text-emerald-700`,warning:`border-amber-200 bg-amber-50 text-amber-800`,danger:`border-rose-200 bg-rose-50 text-rose-600`,info:`border-primary/20 bg-primary/10 text-primary`}},defaultVariants:{tone:`subtle`}}),c=a.forwardRef(({className:e,tone:t,...n},i)=>(0,o.jsx)(`span`,{ref:i,className:r(s({tone:t}),e),...n}));c.displayName=`TagChip`;export{c as t};
@@ -0,0 +1 @@
1
+ import{_ as e,i as t,m as n,p as r,u as i}from"./i18n-C5Mibli1.js";import{Ct as a,Et as o,Ft as s,St as c,Tt as l,bt as u,ft as d,ht as f,jt as p,pt as ee,wt as te,yt as m}from"./api-BcqDx0tm.js";import{r as h}from"./chunk-JZWAC4HX-u4uYphxM.js";import{t as g}from"./createLucideIcon-BZkY6emz.js";import{i as _,n as v,t as y}from"./select-DIZrwsKU.js";import{n as b,t as ne}from"./refresh-cw-BxojR62w.js";import{t as re}from"./x-DpTzXQcX.js";import{t as ie}from"./use-config-BQJjq1mP.js";import{n as ae,r as oe,t as se}from"./popover-YAsxDBhY.js";var ce=g(`AlarmClock`,[[`circle`,{cx:`12`,cy:`13`,r:`8`,key:`3y4lt7`}],[`path`,{d:`M12 9v4l2 2`,key:`1c63tq`}],[`path`,{d:`M5 3 2 6`,key:`18tl5t`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.38 18.7 4 21`,key:`17xu3x`}],[`path`,{d:`M17.64 18.67 20 21`,key:`kv2oe2`}]]),le=g(`Bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),ue=g(`BrainCircuit`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`,key:`10igwf`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`,key:`105ag5`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M16 8V5a2 2 0 0 1 2-2`,key:`u6izg6`}],[`circle`,{cx:`16`,cy:`13`,r:`.5`,key:`ry7gng`}],[`circle`,{cx:`18`,cy:`3`,r:`.5`,key:`1aiba7`}],[`circle`,{cx:`20`,cy:`21`,r:`.5`,key:`yhc1fs`}],[`circle`,{cx:`20`,cy:`8`,r:`.5`,key:`1e43v0`}]]),de=g(`Languages`,[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),fe=g(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),pe=g(`Palette`,[[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`path`,{d:`M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z`,key:`12rzf8`}]]),me=g(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),he=g(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),x=`nextclaw.ui.theme`,ge=[{value:`warm`,labelKey:`themeWarm`},{value:`cool`,labelKey:`themeCool`}],S=`warm`,C=!1,w=new Set;function T(e){return e===`warm`||e===`cool`}function E(e){typeof document>`u`||document.documentElement.setAttribute(`data-theme`,e)}function D(){if(typeof window>`u`)return`warm`;try{let e=window.localStorage.getItem(x);if(T(e))return e}catch{}return`warm`}function O(){return C||=(S=D(),E(S),!0),S}function k(){return C?S:O()}function A(e){if(O(),e!==S){if(S=e,E(S),typeof window<`u`)try{window.localStorage.setItem(x,S)}catch{}w.forEach(e=>e(S))}}function j(e){return w.add(e),()=>{w.delete(e)}}var M=r(),N={healthy:`bg-emerald-500 shadow-[0_0_0_3px_rgba(16,185,129,0.14)]`,attention:`bg-amber-400 shadow-[0_0_0_3px_rgba(251,191,36,0.16)]`,inactive:`bg-gray-300 shadow-[0_0_0_3px_rgba(156,163,175,0.12)]`};function P(){let e=f(),n=e.actionLabel===t(`runtimeStatusRestartAction`),r=async()=>{if(n)try{let e=await m.runRuntimeControlAction(`restart-service`);s.success(e.message)}catch(e){let n=e instanceof Error?e.message:t(`runtimeControlActionFailed`);s.error(`${t(`runtimeControlActionFailed`)}: ${n}`)}};return(0,M.jsxs)(se,{children:[(0,M.jsx)(oe,{asChild:!0,children:(0,M.jsx)(`button`,{type:`button`,className:`inline-flex items-center justify-center rounded-full p-0.5 transition-transform hover:scale-105`,"aria-label":e.title,title:e.title,"data-testid":`runtime-status-entry`,children:(0,M.jsx)(`span`,{className:i(`h-2.5 w-2.5 rounded-full`,N[e.tone])})})}),(0,M.jsxs)(ae,{align:`start`,sideOffset:10,className:`w-[290px] space-y-3 rounded-2xl border border-gray-200 bg-white p-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(`div`,{className:`text-sm font-semibold text-gray-900`,children:e.title}),(0,M.jsx)(`p`,{className:`text-xs leading-5 text-gray-600`,children:e.description})]}),e.reasonLines.length>0?(0,M.jsx)(`div`,{className:`space-y-2`,children:e.reasonLines.map(e=>(0,M.jsx)(`div`,{className:`rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-xs leading-5 text-amber-900`,children:e},e))}):null,e.actionLabel?(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-t border-gray-100 pt-1`,children:[(0,M.jsx)(`span`,{className:`text-[11px] text-gray-500`,children:t(`runtimeStatusActionHint`)}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>void r(),disabled:e.isBusy,className:`text-sm font-semibold text-sky-600 transition-colors hover:text-sky-700 disabled:text-gray-400`,children:e.isBusy?t(`runtimeStatusRestartingAction`):e.actionLabel})]}):null]})]})}function F({className:e,suffix:t}){let{data:n}=ie(),r=n?.name??`NextClaw`,i=n?.productVersion?.trim(),a=t??(0,M.jsx)(P,{});return(0,M.jsxs)(`div`,{className:e??`flex items-center gap-2.5`,children:[(0,M.jsx)(`div`,{className:`h-7 w-7 rounded-lg overflow-hidden flex items-center justify-center`,children:(0,M.jsx)(`img`,{src:`/logo.svg`,alt:r,className:`h-full w-full object-contain`})}),(0,M.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,M.jsx)(`span`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-gray-800`,children:r}),i?(0,M.jsxs)(`span`,{className:`text-[13px] font-medium text-gray-500`,children:[`v`,i]}):null,(0,M.jsx)(I,{}),a?(0,M.jsx)(`span`,{className:`inline-flex items-center shrink-0`,children:a}):null]})]})}function I(){let{supported:e,busyAction:n,snapshot:r}=ee();return!e||!r?null:r.status===`downloading`||r.status===`blocked`||r.status===`failed`?(0,M.jsx)(L,{snapshot:r}):r.status===`downloaded`?(0,M.jsx)(`button`,{type:`button`,className:i(`inline-flex h-5 shrink-0 items-center rounded-full px-2 text-[11px] font-semibold leading-none ring-1 transition-colors`,R(r.status)),disabled:n===`applying`,onClick:()=>void d.applyDownloadedUpdate(),children:t(n===`applying`?`desktopUpdatesInlineApplying`:`desktopUpdatesInlineReady`)}):r.status===`update-available`?(0,M.jsx)(`button`,{type:`button`,className:i(`inline-flex h-5 shrink-0 items-center rounded-full px-2 text-[11px] font-semibold leading-none ring-1 transition-colors`,R(r.status)),disabled:n===`downloading`,onClick:()=>void d.downloadUpdate(),children:t(n===`downloading`?`desktopUpdatesInlineDownloading`:`desktopUpdatesInlineDownload`)}):null}function L({snapshot:e}){let n=_e(e);return n?(0,M.jsx)(`span`,{className:i(`inline-flex h-5 shrink-0 items-center rounded-full px-2 text-[11px] font-semibold leading-none ring-1 transition-colors`,R(e.status)),title:t(`updates`),children:n}):null}function _e(e){if(e.status===`downloading`){let n=e.progress?.percent;return n==null?t(`desktopUpdatesInlineDownloading`):t(`desktopUpdatesInlineDownloadingPercent`).replace(`{percent}`,String(n))}return e.status===`downloaded`?t(`desktopUpdatesInlineReady`):e.status===`update-available`?t(`desktopUpdatesInlineDownload`):e.status===`blocked`||e.status===`failed`?t(`desktopUpdatesInlineAttention`):null}function R(e){return e===`downloaded`?`bg-emerald-50 text-emerald-700 ring-emerald-100 hover:bg-emerald-100 disabled:opacity-70`:e===`blocked`||e===`failed`?`bg-red-50 text-red-700 ring-red-100`:`bg-amber-50 text-amber-700 ring-amber-100 hover:bg-amber-100 disabled:opacity-70`}var ve={default:{row:`gap-3 px-3 py-2.5 text-[14px]`,icon:`h-[17px] w-[17px]`,value:`text-xs`,gap:`gap-3`},compact:{row:`gap-2.5 px-3 py-2 text-[13px]`,icon:`h-4 w-4`,value:`text-[11px]`,gap:`gap-2.5`}};function z(e){return ve[e]}function ye({to:e,label:t,icon:n,density:r=`default`,className:a}){let o=z(r);return(0,M.jsx)(h,{to:e,className:({isActive:e})=>i(`group flex w-full items-center rounded-xl font-medium transition-colors duration-base`,o.row,e?`bg-gray-200 text-gray-900 shadow-sm`:`text-gray-600 hover:bg-gray-200/60 hover:text-gray-900`,a),children:({isActive:e})=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(n,{className:i(o.icon,`transition-colors`,e?`text-gray-900`:`text-gray-500 group-hover:text-gray-800`)}),(0,M.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:t})]})})}function be({label:e,icon:t,onClick:n,density:r=`default`,className:a,labelClassName:o,trailing:s,trailingClassName:c,testId:l,trailingTestId:u}){let d=z(r);return(0,M.jsxs)(`button`,{type:`button`,onClick:n,className:i(`flex w-full items-center rounded-xl font-medium text-gray-600 transition-all duration-base hover:bg-gray-200/60 hover:text-gray-800`,d.row,a),"data-testid":l,children:[(0,M.jsx)(t,{className:i(d.icon,`shrink-0 text-gray-400`)}),(0,M.jsx)(`span`,{className:i(`min-w-0 flex-1 text-left`,o),children:e}),s?(0,M.jsx)(`span`,{className:i(`shrink-0 text-gray-500`,d.value,c),"data-testid":u,children:s}):null]})}function xe({label:e,icon:t,value:n,valueLabel:r,onValueChange:a,density:o=`default`,children:s}){let c=z(o);return(0,M.jsxs)(y,{value:n,onValueChange:a,children:[(0,M.jsxs)(_,{className:i(`h-auto w-full rounded-xl border-0 bg-transparent font-medium text-gray-600 shadow-none hover:bg-gray-200/60 focus:ring-0`,c.row),children:[(0,M.jsxs)(`div`,{className:i(`flex min-w-0 items-center`,c.gap),children:[(0,M.jsx)(t,{className:i(c.icon,`text-gray-400`)}),(0,M.jsx)(`span`,{className:`text-left`,children:e})]}),(0,M.jsx)(`span`,{className:i(`ml-auto text-gray-500`,c.value),children:r})]}),(0,M.jsx)(v,{children:s})]})}var B=`nextclaw-pwa-install-banner-dismissed`,V=`nextclaw-pwa-install-banner-dismissed-until`;function H(){let e=W();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:Ce(e):!1}function Se(){let e=W();e?.setItem(B,`1`),e?.removeItem(V)}function U(){let e=W();e?.removeItem(B),e?.removeItem(V)}function W(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Ce(e){let t=e.getItem(V);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(V),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(B,`1`),!0)}function G(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:H(),updateAvailable:!1,registrationFailed:!1}}var K=u(()=>G()),q=`nextclaw-pwa-dev-sw-reset`,J=new class{constructor(){this.started=!1,this.registration=null,this.reloadWhenControllerChanges=!1,this.start=async()=>{if(!(this.started||typeof window>`u`)&&(this.started=!0,!(!(`serviceWorker`in navigator)||!this.isEligibleInstallContext()))){if(this.isDevelopmentServer()){await this.cleanupDevelopmentRegistrations();return}try{let e=await navigator.serviceWorker.register(`/sw.js`);this.registration=e,this.bindRegistration(e),navigator.serviceWorker.addEventListener(`controllerchange`,this.handleControllerChange),await this.syncUpdateAvailability()}catch{K.setState({registrationFailed:!0})}}},this.syncUpdateAvailability=async()=>{if(typeof window>`u`||!(`serviceWorker`in navigator)||typeof navigator.serviceWorker.getRegistration!=`function`){K.setState({updateAvailable:!1});return}let e=this.registration??await navigator.serviceWorker.getRegistration(`/sw.js`)??null;K.setState({updateAvailable:this.shouldSurfaceUpdate(e)})},this.applyUpdate=async()=>{let e=this.registration??await navigator.serviceWorker.getRegistration(`/sw.js`)??null;if(!e){window.location.reload();return}e.waiting||await e.update();let t=e.waiting;if(!t){window.location.reload();return}this.reloadWhenControllerChanges=!0,t.postMessage({type:`SKIP_WAIT`})},this.stop=()=>{!this.started||typeof window>`u`||!(`serviceWorker`in navigator)||(navigator.serviceWorker.removeEventListener(`controllerchange`,this.handleControllerChange),this.started=!1,this.registration=null,this.reloadWhenControllerChanges=!1)},this.bindRegistration=e=>{e.addEventListener(`updatefound`,()=>{let t=e.installing;t&&t.addEventListener(`statechange`,()=>{t.state===`installed`&&this.syncUpdateAvailability()})})},this.handleControllerChange=()=>{this.reloadWhenControllerChanges&&(this.reloadWhenControllerChanges=!1,window.location.reload())},this.isEligibleInstallContext=()=>window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>!1,this.shouldSurfaceUpdate=e=>!e?.waiting||!navigator.serviceWorker.controller?!1:K.getState().installability===`installed`,this.cleanupDevelopmentRegistrations=async()=>{if(typeof navigator.serviceWorker.getRegistrations!=`function`)return;let e=(await navigator.serviceWorker.getRegistrations()).filter(e=>[e.active?.scriptURL,e.installing?.scriptURL,e.waiting?.scriptURL].filter(e=>!!e).some(e=>e.endsWith(`/sw.js`)));if(e.length===0){this.clearDevResetMarker();return}if(await Promise.all(e.map(async e=>await e.unregister())),await this.clearNextClawCaches(),navigator.serviceWorker.controller&&!this.hasDevResetMarker()){this.setDevResetMarker(),window.location.reload();return}this.clearDevResetMarker()},this.clearNextClawCaches=async()=>{if(typeof window>`u`||!(`caches`in window)||typeof caches.keys!=`function`)return;let e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith(`nextclaw-ui-`)).map(async e=>await caches.delete(e)))},this.hasDevResetMarker=()=>{try{return window.sessionStorage.getItem(q)===`1`}catch{return!1}},this.setDevResetMarker=()=>{try{window.sessionStorage.setItem(q,`1`)}catch{}},this.clearDevResetMarker=()=>{try{window.sessionStorage.removeItem(q)}catch{}}}},Y=new class{constructor(){this.started=!1,this.deferredPrompt=null,this.displayModeMediaQuery=null,this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.addEventListener(`appinstalled`,this.handleAppInstalled),typeof window.matchMedia==`function`&&(this.displayModeMediaQuery=window.matchMedia(`(display-mode: standalone)`),this.bindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged)),this.refreshState())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.removeEventListener(`appinstalled`,this.handleAppInstalled),this.displayModeMediaQuery&&=(this.unbindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged),null),this.deferredPrompt=null,this.started=!1)},this.resetForTests=()=>{this.stop(),K.setState(G())},this.refreshState=()=>{let e=this.resolveInstallability();K.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:H()})),J.syncUpdateAvailability()},this.dismissInstallPrompt=()=>{Se(),K.setState({dismissedInstallPrompt:!0})},this.promptInstall=async()=>{let e=this.resolveInstallability();if(e.installability!==`available`)return`unavailable`;if(e.installMethod===`manual`||!this.deferredPrompt)return`manual`;this.deferredPrompt.prompt();let n=await this.deferredPrompt.userChoice;return this.deferredPrompt=null,n.outcome===`accepted`?(U(),this.refreshState(),s.success(t(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,U(),K.setState({dismissedInstallPrompt:!0}),s.success(t(`pwaInstalledToast`)),this.refreshState()},this.handleDisplayModeChanged=()=>{this.refreshState()},this.resolveInstallability=()=>this.isDevelopmentServer()?{installability:`unsupported`,installMethod:`none`,blockedReason:`dev-server`}:this.hasDesktopHost()?{installability:`suppressed`,installMethod:`none`,blockedReason:`desktop-host`}:this.isStandalone()?{installability:`installed`,installMethod:`none`,blockedReason:null}:this.hasInstallSurfaceSupport()?this.isEligibleInstallContext()?{installability:`available`,installMethod:this.deferredPrompt?`prompt`:`manual`,blockedReason:null}:{installability:`unsupported`,installMethod:`none`,blockedReason:`insecure-context`}:{installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`},this.hasDesktopHost=()=>typeof window<`u`&&!!window.nextclawDesktop,this.hasInstallSurfaceSupport=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&`serviceWorker`in navigator,this.isEligibleInstallContext=()=>typeof window>`u`?!1:window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>typeof window<`u`&&!1,this.isStandalone=()=>{if(typeof window>`u`)return!1;let e=window.navigator;return typeof window.matchMedia==`function`&&window.matchMedia(`(display-mode: standalone)`).matches||e.standalone===!0},this.bindDisplayModeListener=(e,t)=>{if(`addEventListener`in e){e.addEventListener(`change`,t);return}e.addListener?.(t)},this.unbindDisplayModeListener=(e,t)=>{if(`removeEventListener`in e){e.removeEventListener(`change`,t);return}e.removeListener?.(t)}}};function we(){let e=K(e=>e.installability);return(0,M.jsx)(`span`,{className:i(`inline-flex items-center rounded-full border px-3 py-1 text-xs font-medium`,e===`installed`?`bg-emerald-50 text-emerald-700 border-emerald-200`:e===`available`?`bg-amber-50 text-amber-700 border-amber-200`:`bg-gray-100 text-gray-600 border-gray-200`),children:Te(e)})}function Te(e){return t(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function Ee(e,n,r){return t(e===`installed`?`pwaInstallCardInstalled`:e===`suppressed`?`pwaInstallCardSuppressed`:e===`available`&&n===`prompt`?`pwaInstallCardPrompt`:e===`available`?`pwaInstallCardManual`:r===`insecure-context`?`pwaInstallCardInsecureContext`:r===`dev-server`?`pwaInstallCardDevServer`:`pwaInstallCardUnsupported`)}function De(){let e=K(e=>e.installability),n=K(e=>e.installMethod),r=K(e=>e.blockedReason);return(0,M.jsxs)(c,{children:[(0,M.jsxs)(l,{className:`flex flex-row items-start justify-between gap-4 space-y-0`,children:[(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(o,{children:t(`pwaInstallTitle`)}),(0,M.jsx)(te,{children:t(`pwaInstallDescription`)})]}),(0,M.jsx)(we,{})]}),(0,M.jsxs)(a,{className:`space-y-4`,children:[(0,M.jsx)(`div`,{className:`rounded-2xl border border-gray-200 bg-gray-50/90 p-4`,children:(0,M.jsx)(`p`,{className:`text-sm leading-6 text-gray-700`,children:Ee(e,n,r)})}),e===`available`&&n===`prompt`?(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,M.jsxs)(p,{type:`button`,className:`gap-2`,onClick:()=>{Y.promptInstall()},children:[(0,M.jsx)(b,{className:`h-4 w-4`}),t(`pwaInstallAction`)]}),(0,M.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`pwaInstallPromptHint`)})]}):null,e===`available`&&n===`manual`?(0,M.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl border border-dashed border-gray-300 bg-white p-4`,children:[(0,M.jsx)(me,{className:`mt-0.5 h-4 w-4 text-gray-500`}),(0,M.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:t(`pwaInstallManualHint`)})]}):null]})]})}function Oe(){let e=K(e=>e.installability),n=K(e=>e.installMethod),r=K(e=>e.dismissedInstallPrompt);return e!==`available`||n!==`prompt`||r?null:(0,M.jsxs)(`div`,{className:`fixed bottom-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,M.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:t(`pwaInstallBannerTitle`)}),(0,M.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:t(`pwaInstallBannerDescription`)})]}),(0,M.jsx)(`button`,{type:`button`,"aria-label":t(`pwaInstallDismiss`),className:`rounded-full p-1 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600`,onClick:()=>{Y.dismissInstallPrompt()},children:(0,M.jsx)(re,{className:`h-4 w-4`})})]}),(0,M.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,M.jsxs)(p,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{Y.promptInstall()},children:[(0,M.jsx)(b,{className:`h-4 w-4`}),t(`pwaInstallAction`)]}),(0,M.jsx)(p,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{Y.dismissInstallPrompt()},children:t(`pwaInstallDismiss`)})]})]})}function ke(){let e=K(e=>e.updateAvailable),n=K(e=>e.installability);return!e||n!==`installed`?null:(0,M.jsxs)(`div`,{className:`fixed top-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,M.jsx)(`div`,{className:`flex items-start justify-between gap-4`,children:(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:t(`pwaUpdateBannerTitle`)}),(0,M.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:t(`pwaUpdateBannerDescription`)})]})}),(0,M.jsx)(`div`,{className:`mt-4`,children:(0,M.jsxs)(p,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{J.applyUpdate()},children:[(0,M.jsx)(ne,{className:`h-4 w-4`}),t(`pwaUpdateAction`)]})})]})}var X=!1;function Z(){X||typeof window>`u`||(X=!0,Y.start(),J.start())}var Ae={warm:`#F9F8F5`,cool:`#F8FAFB`},je=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=Ae[e];this.updateThemeMeta(t),this.updateSurfaceBackgrounds(t),document.documentElement.style.colorScheme=`light`},this.syncCurrentTheme=()=>{if(typeof document>`u`)return;let e=document.documentElement.getAttribute(`data-theme`)===`cool`?`cool`:`warm`;this.syncTheme(e)},this.updateThemeMeta=e=>{let t=document.querySelector(`meta[name="theme-color"]`);t instanceof HTMLMetaElement&&(t.content=e)},this.updateSurfaceBackgrounds=e=>{document.documentElement.style.backgroundColor=e,document.body.style.backgroundColor=e;let t=document.getElementById(`root`);t&&(t.style.backgroundColor=e)}}},Q=e(n(),1),$=(0,Q.createContext)(null);function Me({children:e}){let[t,n]=(0,Q.useState)(()=>O());(0,Q.useEffect)(()=>{je.syncTheme(t)},[t]),(0,Q.useEffect)(()=>j(e=>{n(e)}),[]);let r=(0,Q.useCallback)(e=>{A(e),n(k())},[]),i=(0,Q.useMemo)(()=>({theme:t,setTheme:r}),[t,r]);return(0,M.jsx)($.Provider,{value:i,children:e})}function Ne(){let e=(0,Q.useContext)($);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}export{le as _,De as a,ye as c,ge as d,he as f,ue as g,de as h,Oe as i,xe as l,fe as m,Ne as n,ke as o,pe as p,Z as r,be as s,Me as t,F as u,ce as v};
@@ -1 +1 @@
1
- import{_ as e,m as t,p as n,u as r}from"./i18n-CM4y8Mw9.js";import{_ as i,c as a,d as o,f as s,g as c,h as l,i as u,o as d,u as f}from"./es2015-BNy4R8AC.js";import{t as p}from"./dist-FL5e8mMi.js";import{C as m,E as h,S as g,T as _,w as v,x as y}from"./select-DVUtSFHZ.js";var b=e(t(),1),x=n(),[S,C]=l(`Tooltip`,[h]),w=h(),T=`TooltipProvider`,E=700,D=`tooltip.open`,[O,k]=S(T),A=e=>{let{__scopeTooltip:t,delayDuration:n=E,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=b.useRef(!0),s=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,x.jsx)(O,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:b.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};A.displayName=T;var j=`Tooltip`,[ee,M]=S(j),N=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:c,delayDuration:l}=e,u=k(j,e.__scopeTooltip),d=w(t),[f,p]=b.useState(null),m=s(),h=b.useRef(0),g=c??u.disableHoverableContent,v=l??u.delayDuration,y=b.useRef(!1),[S,C]=o({prop:r,defaultProp:i??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(D))):u.onClose(),a?.(e)},caller:j}),T=b.useMemo(()=>S?y.current?`delayed-open`:`instant-open`:`closed`,[S]),E=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,C(!0)},[C]),O=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,C(!1)},[C]),A=b.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,C(!0),h.current=0},v)},[v,C]);return b.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]),(0,x.jsx)(_,{...d,children:(0,x.jsx)(ee,{scope:t,contentId:m,open:S,stateAttribute:T,trigger:f,onTriggerChange:p,onTriggerEnter:b.useCallback(()=>{u.isOpenDelayedRef.current?A():E()},[u.isOpenDelayedRef,A,E]),onTriggerLeave:b.useCallback(()=>{g?O():(window.clearTimeout(h.current),h.current=0)},[O,g]),onOpen:E,onClose:O,disableHoverableContent:g,children:n})})};N.displayName=j;var P=`TooltipTrigger`,F=b.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,o=M(P,n),s=k(P,n),l=w(n),u=c(t,b.useRef(null),o.onTriggerChange),d=b.useRef(!1),f=b.useRef(!1),p=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener(`pointerup`,p),[p]),(0,x.jsx)(g,{asChild:!0,...l,children:(0,x.jsx)(a.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:i(e.onPointerMove,e=>{e.pointerType!==`touch`&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:i(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:i(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener(`pointerup`,p,{once:!0})}),onFocus:i(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:i(e.onBlur,o.onClose),onClick:i(e.onClick,o.onClose)})})});F.displayName=P;var I=`TooltipPortal`,[L,R]=S(I,{forceMount:void 0}),z=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=M(I,t);return(0,x.jsx)(L,{scope:t,forceMount:n,children:(0,x.jsx)(p,{present:n||a.open,children:(0,x.jsx)(u,{asChild:!0,container:i,children:r})})})};z.displayName=I;var B=`TooltipContent`,V=b.forwardRef((e,t)=>{let n=R(B,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=M(B,e.__scopeTooltip);return(0,x.jsx)(p,{present:r||o.open,children:o.disableHoverableContent?(0,x.jsx)(K,{side:i,...a,ref:t}):(0,x.jsx)(H,{side:i,...a,ref:t})})}),H=b.forwardRef((e,t)=>{let n=M(B,e.__scopeTooltip),r=k(B,e.__scopeTooltip),i=b.useRef(null),a=c(t,i),[o,s]=b.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,p=b.useCallback(()=>{s(null),f(!1)},[f]),m=b.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=re(r,ne(r,n.getBoundingClientRect())),a=ie(t.getBoundingClientRect());s(oe([...i,...a])),f(!0)},[f]);return b.useEffect(()=>()=>p(),[p]),b.useEffect(()=>{if(l&&d){let e=e=>m(e,d),t=e=>m(e,l);return l.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{l.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[l,d,m,p]),b.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=l?.contains(t)||d?.contains(t),i=!ae(n,o);r?p():i&&(p(),u())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[l,d,o,u,p]),(0,x.jsx)(K,{...e,ref:a})}),[U,W]=S(j,{isInside:!1}),G=f(`TooltipContent`),K=b.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=M(B,n),l=w(n),{onClose:u}=c;return b.useEffect(()=>(document.addEventListener(D,u),()=>document.removeEventListener(D,u)),[u]),b.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,x.jsx)(d,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,x.jsxs)(v,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,x.jsx)(G,{children:r}),(0,x.jsx)(U,{scope:n,isInside:!0,children:(0,x.jsx)(y,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});V.displayName=B;var q=`TooltipArrow`,te=b.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=w(n);return W(q,n).isInside?null:(0,x.jsx)(m,{...i,...r,ref:t})});te.displayName=q;function ne(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function re(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ie(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ae(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function oe(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),se(t)}function se(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var J=A,Y=N,X=F,Z=z,Q=V,ce=J,le=Y,ue=X,$=b.forwardRef(({className:e,sideOffset:t=4,...n},i)=>(0,x.jsx)(Z,{children:(0,x.jsx)(Q,{ref:i,sideOffset:t,className:r(`z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));$.displayName=Q.displayName;export{Q as a,Y as c,ue as i,X as l,$ as n,Z as o,ce as r,J as s,le as t};
1
+ import{_ as e,m as t,p as n,u as r}from"./i18n-C5Mibli1.js";import{_ as i,c as a,d as o,f as s,g as c,h as l,i as u,o as d,u as f}from"./es2015-JCM5-KtW.js";import{t as p}from"./dist-Bl94Ahwx.js";import{C as m,E as h,S as g,T as _,w as v,x as y}from"./select-DIZrwsKU.js";var b=e(t(),1),x=n(),[S,C]=l(`Tooltip`,[h]),w=h(),T=`TooltipProvider`,E=700,D=`tooltip.open`,[O,k]=S(T),A=e=>{let{__scopeTooltip:t,delayDuration:n=E,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=b.useRef(!0),s=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,x.jsx)(O,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:b.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};A.displayName=T;var j=`Tooltip`,[ee,M]=S(j),N=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:c,delayDuration:l}=e,u=k(j,e.__scopeTooltip),d=w(t),[f,p]=b.useState(null),m=s(),h=b.useRef(0),g=c??u.disableHoverableContent,v=l??u.delayDuration,y=b.useRef(!1),[S,C]=o({prop:r,defaultProp:i??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(D))):u.onClose(),a?.(e)},caller:j}),T=b.useMemo(()=>S?y.current?`delayed-open`:`instant-open`:`closed`,[S]),E=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,C(!0)},[C]),O=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,C(!1)},[C]),A=b.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,C(!0),h.current=0},v)},[v,C]);return b.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]),(0,x.jsx)(_,{...d,children:(0,x.jsx)(ee,{scope:t,contentId:m,open:S,stateAttribute:T,trigger:f,onTriggerChange:p,onTriggerEnter:b.useCallback(()=>{u.isOpenDelayedRef.current?A():E()},[u.isOpenDelayedRef,A,E]),onTriggerLeave:b.useCallback(()=>{g?O():(window.clearTimeout(h.current),h.current=0)},[O,g]),onOpen:E,onClose:O,disableHoverableContent:g,children:n})})};N.displayName=j;var P=`TooltipTrigger`,F=b.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,o=M(P,n),s=k(P,n),l=w(n),u=c(t,b.useRef(null),o.onTriggerChange),d=b.useRef(!1),f=b.useRef(!1),p=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener(`pointerup`,p),[p]),(0,x.jsx)(g,{asChild:!0,...l,children:(0,x.jsx)(a.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:i(e.onPointerMove,e=>{e.pointerType!==`touch`&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:i(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:i(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener(`pointerup`,p,{once:!0})}),onFocus:i(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:i(e.onBlur,o.onClose),onClick:i(e.onClick,o.onClose)})})});F.displayName=P;var I=`TooltipPortal`,[L,R]=S(I,{forceMount:void 0}),z=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=M(I,t);return(0,x.jsx)(L,{scope:t,forceMount:n,children:(0,x.jsx)(p,{present:n||a.open,children:(0,x.jsx)(u,{asChild:!0,container:i,children:r})})})};z.displayName=I;var B=`TooltipContent`,V=b.forwardRef((e,t)=>{let n=R(B,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=M(B,e.__scopeTooltip);return(0,x.jsx)(p,{present:r||o.open,children:o.disableHoverableContent?(0,x.jsx)(K,{side:i,...a,ref:t}):(0,x.jsx)(H,{side:i,...a,ref:t})})}),H=b.forwardRef((e,t)=>{let n=M(B,e.__scopeTooltip),r=k(B,e.__scopeTooltip),i=b.useRef(null),a=c(t,i),[o,s]=b.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,p=b.useCallback(()=>{s(null),f(!1)},[f]),m=b.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=re(r,ne(r,n.getBoundingClientRect())),a=ie(t.getBoundingClientRect());s(oe([...i,...a])),f(!0)},[f]);return b.useEffect(()=>()=>p(),[p]),b.useEffect(()=>{if(l&&d){let e=e=>m(e,d),t=e=>m(e,l);return l.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{l.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[l,d,m,p]),b.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=l?.contains(t)||d?.contains(t),i=!ae(n,o);r?p():i&&(p(),u())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[l,d,o,u,p]),(0,x.jsx)(K,{...e,ref:a})}),[U,W]=S(j,{isInside:!1}),G=f(`TooltipContent`),K=b.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=M(B,n),l=w(n),{onClose:u}=c;return b.useEffect(()=>(document.addEventListener(D,u),()=>document.removeEventListener(D,u)),[u]),b.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,x.jsx)(d,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,x.jsxs)(v,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,x.jsx)(G,{children:r}),(0,x.jsx)(U,{scope:n,isInside:!0,children:(0,x.jsx)(y,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});V.displayName=B;var q=`TooltipArrow`,te=b.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=w(n);return W(q,n).isInside?null:(0,x.jsx)(m,{...i,...r,ref:t})});te.displayName=q;function ne(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function re(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ie(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ae(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function oe(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),se(t)}function se(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var J=A,Y=N,X=F,Z=z,Q=V,ce=J,le=Y,ue=X,$=b.forwardRef(({className:e,sideOffset:t=4,...n},i)=>(0,x.jsx)(Z,{children:(0,x.jsx)(Q,{ref:i,sideOffset:t,className:r(`z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));$.displayName=Q.displayName;export{Q as a,Y as c,ue as i,X as l,$ as n,Z as o,ce as r,J as s,le as t};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-PPrXCGK8.js";var t=e(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-BZkY6emz.js";var t=e(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{i as e}from"./i18n-C5Mibli1.js";import{$ as t,B as n,Bt as r,F as i,Ft as a,G as o,H as s,I as c,It as l,J as u,K as d,L as f,Lt as p,M as m,N as h,P as g,Q as _,R as v,U as y,W as b,X as x,Y as S,Z as C,_ as w,f as T,g as E,h as D,m as O,p as k,q as A,v as j,z as ee}from"./api-BcqDx0tm.js";function M(){return p({queryKey:[`config`],queryFn:f,staleTime:3e4,refetchOnWindowFocus:!0})}function N(){return p({queryKey:[`app-meta`],queryFn:c,staleTime:1/0})}function P(){return p({queryKey:[`config-meta`],queryFn:v,staleTime:1/0})}function F(){return p({queryKey:[`config-schema`],queryFn:ee,staleTime:1/0})}function I(){let t=r();return l({mutationFn:S,onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),a.success(e(`configSaved`))},onError:t=>{a.error(e(`configSaveFailed`)+`: `+t.message)}})}function L(){let t=r();return l({mutationFn:({data:e})=>_(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),t.invalidateQueries({queryKey:[`config-meta`]}),a.success(e(`configSavedApplied`))},onError:t=>{a.error(e(`configSaveFailed`)+`: `+t.message)}})}function R(){let t=r();return l({mutationFn:({provider:e,data:t})=>x(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),t.invalidateQueries({queryKey:[`config-meta`]}),a.success(e(`configSaved`))},onError:t=>{a.error(e(`configSaveFailed`)+`: `+t.message)}})}function z(){let t=r();return l({mutationFn:({data:e})=>m(e??{}),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),t.invalidateQueries({queryKey:[`config-meta`]}),a.success(e(`configSaved`))},onError:t=>{a.error(e(`configSaveFailed`)+`: `+t.message)}})}function B(){let t=r();return l({mutationFn:({provider:e})=>g(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),t.invalidateQueries({queryKey:[`config-meta`]}),a.success(e(`configSaved`))},onError:t=>{a.error(e(`configSaveFailed`)+`: `+t.message)}})}function V(){return l({mutationFn:({provider:e,data:t})=>A(e,t)})}function H(){return l({mutationFn:({provider:e,data:t})=>d(e,t)})}function U(){return l({mutationFn:({provider:e,data:t})=>y(e,t)})}function W(){return l({mutationFn:({provider:e})=>s(e)})}function G(){let t=r();return l({mutationFn:({channel:e,data:t})=>u(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),t.invalidateQueries({queryKey:[`config-meta`]}),a.success(e(`configSavedApplying`))},onError:t=>{a.error(e(`configSaveFailed`)+`: `+t.message)}})}function K(){let t=r();return l({mutationFn:({data:e})=>C(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),a.success(e(`configSavedApplied`))},onError:t=>{a.error(e(`configSaveFailed`)+`: `+t.message)}})}function q(){let n=r();return l({mutationFn:({data:e})=>t(e),onSuccess:()=>{n.invalidateQueries({queryKey:[`config`]}),a.success(e(`configSavedApplied`))},onError:t=>{a.error(e(`configSaveFailed`)+`: `+t.message)}})}function J(){return l({mutationFn:({actionId:e,data:t})=>i(e,t),onError:t=>{a.error(e(`error`)+`: `+t.message)}})}function Y(e){return p({queryKey:[`ncp-sessions`,e?.limit??null],queryFn:()=>w(e),staleTime:5e3,retry:!1})}function X(e,t=200){return p({queryKey:[`ncp-session-messages`,e,t],queryFn:()=>D(e,t),enabled:!!e,staleTime:5e3,retry:!1})}function Z(e){return p({queryKey:[`ncp-session-skills`,e.sessionId,e.projectRoot??null],queryFn:()=>E(e.sessionId,{...Object.prototype.hasOwnProperty.call(e,`projectRoot`)?{projectRoot:e.projectRoot??null}:{}}),enabled:!!e.sessionId,staleTime:5e3,retry:!1})}function Q(){let t=r();return l({mutationFn:({sessionId:e})=>O(e),onSuccess:(n,r)=>{T(t,r.sessionId),t.removeQueries({queryKey:[`ncp-session-messages`,r.sessionId]}),a.success(e(`configSavedApplied`))},onError:t=>{a.error(e(`configSaveFailed`)+`: `+t.message)}})}function $(){let t=r();return l({mutationFn:({sessionId:e,data:t})=>j(e,t),onSuccess:n=>{k(t,n),t.invalidateQueries({queryKey:[`ncp-session-skills`,n.sessionId]}),a.success(e(`configSavedApplied`))},onError:t=>{a.error(e(`configSaveFailed`)+`: `+t.message)}})}function te(e={all:!0}){return p({queryKey:[`cron`,e],queryFn:()=>n(e),staleTime:1e4})}function ne(){let t=r();return l({mutationFn:({id:e})=>h(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`cron`]}),a.success(e(`configSavedApplied`))},onError:t=>{a.error(e(`configSaveFailed`)+`: `+t.message)}})}function re(){let t=r();return l({mutationFn:({id:e,enabled:t})=>o(e,{enabled:t}),onSuccess:()=>{t.invalidateQueries({queryKey:[`cron`]}),a.success(e(`configSavedApplied`))},onError:t=>{a.error(e(`configSaveFailed`)+`: `+t.message)}})}function ie(){let t=r();return l({mutationFn:({id:e,force:t})=>b(e,{force:t}),onSuccess:()=>{t.invalidateQueries({queryKey:[`cron`]}),a.success(e(`configSavedApplied`))},onError:t=>{a.error(e(`configSaveFailed`)+`: `+t.message)}})}export{R as C,q as E,$ as S,L as T,H as _,z as a,G as b,Q as c,W as d,X as f,ie as g,U as h,F as i,B as l,Y as m,M as n,te as o,Z as p,P as r,ne as s,N as t,J as u,V as v,K as w,I as x,re as y};
@@ -1 +1 @@
1
- import{_ as e,i as t,m as n,p as r}from"./i18n-CM4y8Mw9.js";import{At as i}from"./api-BurjmW4A.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./dialog-CTCX7oLf.js";var d=e(n(),1),f=r(),p=({open:e,onOpenChange:n,title:r,description:d,confirmLabel:p=t(`confirm`),cancelLabel:m=t(`cancel`),variant:h=`default`,onConfirm:g,onCancel:_})=>(0,f.jsx)(u,{open:e,onOpenChange:n,children:(0,f.jsxs)(s,{className:`[&>:last-child]:hidden`,onCloseAutoFocus:e=>e.preventDefault(),children:[(0,f.jsxs)(a,{children:[(0,f.jsx)(c,{children:r}),d?(0,f.jsx)(l,{children:d}):null]}),(0,f.jsxs)(o,{className:`gap-2 sm:gap-0`,children:[(0,f.jsx)(i,{type:`button`,variant:`outline`,onClick:()=>{_(),n(!1)},children:m}),(0,f.jsx)(i,{type:`button`,variant:h===`destructive`?`destructive`:`default`,onClick:()=>{g(),n(!1)},children:p})]})]})}),m={open:!1,title:``,description:``,confirmLabel:t(`confirm`),cancelLabel:t(`cancel`),variant:`default`,resolve:null};function h(){let[e,n]=(0,d.useState)(m),r=(0,d.useCallback)(e=>new Promise(r=>{n({open:!0,title:e.title,description:e.description??``,confirmLabel:e.confirmLabel??t(`confirm`),cancelLabel:e.cancelLabel??t(`cancel`),variant:e.variant??`default`,resolve:e=>{r(e),n(e=>({...e,open:!1,resolve:null}))}})}),[]),i=(0,d.useCallback)(e=>{n(t=>(!e&&t.resolve&&t.resolve(!1),{...t,open:e,resolve:e?t.resolve:null}))},[]);return{confirm:r,ConfirmDialog:(0,d.useCallback)(()=>(0,f.jsx)(p,{open:e.open,onOpenChange:i,title:e.title,description:e.description||void 0,confirmLabel:e.confirmLabel,cancelLabel:e.cancelLabel,variant:e.variant,onConfirm:()=>e.resolve?.(!0),onCancel:()=>e.resolve?.(!1)}),[e,i])}}export{h as t};
1
+ import{_ as e,i as t,m as n,p as r}from"./i18n-C5Mibli1.js";import{jt as i}from"./api-BcqDx0tm.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./dialog-csshWetU.js";var d=e(n(),1),f=r(),p=({open:e,onOpenChange:n,title:r,description:d,confirmLabel:p=t(`confirm`),cancelLabel:m=t(`cancel`),variant:h=`default`,onConfirm:g,onCancel:_})=>(0,f.jsx)(u,{open:e,onOpenChange:n,children:(0,f.jsxs)(s,{className:`[&>:last-child]:hidden`,onCloseAutoFocus:e=>e.preventDefault(),children:[(0,f.jsxs)(a,{children:[(0,f.jsx)(c,{children:r}),d?(0,f.jsx)(l,{children:d}):null]}),(0,f.jsxs)(o,{className:`gap-2 sm:gap-0`,children:[(0,f.jsx)(i,{type:`button`,variant:`outline`,onClick:()=>{_(),n(!1)},children:m}),(0,f.jsx)(i,{type:`button`,variant:h===`destructive`?`destructive`:`default`,onClick:()=>{g(),n(!1)},children:p})]})]})}),m={open:!1,title:``,description:``,confirmLabel:t(`confirm`),cancelLabel:t(`cancel`),variant:`default`,resolve:null};function h(){let[e,n]=(0,d.useState)(m),r=(0,d.useCallback)(e=>new Promise(r=>{n({open:!0,title:e.title,description:e.description??``,confirmLabel:e.confirmLabel??t(`confirm`),cancelLabel:e.cancelLabel??t(`cancel`),variant:e.variant??`default`,resolve:e=>{r(e),n(e=>({...e,open:!1,resolve:null}))}})}),[]),i=(0,d.useCallback)(e=>{n(t=>(!e&&t.resolve&&t.resolve(!1),{...t,open:e,resolve:e?t.resolve:null}))},[]);return{confirm:r,ConfirmDialog:(0,d.useCallback)(()=>(0,f.jsx)(p,{open:e.open,onOpenChange:i,title:e.title,description:e.description||void 0,confirmLabel:e.confirmLabel,cancelLabel:e.cancelLabel,variant:e.variant,onConfirm:()=>e.resolve?.(!0),onCancel:()=>e.resolve?.(!1)}),[e,i])}}export{h as t};
@@ -1 +1 @@
1
- import{_ as e,i as t,m as n,p as r}from"./i18n-CM4y8Mw9.js";import{Bt as i,Ht as a,Lt as o,Ut as s,Vt as c}from"./api-BurjmW4A.js";import{t as l}from"./createLucideIcon-PPrXCGK8.js";import{a as u,i as d,n as f,r as p,t as m}from"./select-DVUtSFHZ.js";import{t as h}from"./skeleton-BCPi52jT.js";var g=class extends s{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:a()})}getOptimisticResult(e){return e.behavior=a(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:a,isRefetching:o,isError:s,isRefetchError:l}=r,u=n.fetchMeta?.fetchMore?.direction,d=s&&u===`forward`,f=a&&u===`forward`,p=s&&u===`backward`,m=a&&u===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:i(t,n.data),hasPreviousPage:c(t,n.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:o&&!f&&!m}}};function _(e,t){return o(e,g,t)}var v=l(`PackageSearch`,[[`path`,{d:`M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14`,key:`e7tb2h`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`12`,key:`a4e8g8`}],[`circle`,{cx:`18.5`,cy:`15.5`,r:`2.5`,key:`b5zd12`}],[`path`,{d:`M20.27 17.27 22 19`,key:`1l4muz`}]]);function y(e){if(!e||e.pages.length===0)return;let t=e.pages.flatMap(e=>e.items);return{...e.pages[e.pages.length-1],items:t,pages:e.pages,loadedItems:t.length,loadedPages:e.pages.length}}var b=r();function x({scope:e,searchText:n,searchPlaceholder:r,sort:i,onSearchTextChange:a,onSortChange:o}){return(0,b.jsx)(`div`,{className:`mb-4`,children:(0,b.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,b.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,b.jsx)(v,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,b.jsx)(`input`,{value:n,onChange:e=>a(e.target.value),placeholder:r,className:`h-9 w-full rounded-xl border border-gray-200/80 pl-9 pr-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary/40`})]}),e===`all`&&(0,b.jsxs)(m,{value:i,onValueChange:e=>o(e),children:[(0,b.jsx)(d,{className:`h-9 w-[150px] shrink-0 rounded-lg`,children:(0,b.jsx)(u,{})}),(0,b.jsxs)(f,{children:[(0,b.jsx)(p,{value:`relevance`,children:t(`marketplaceSortRelevance`)}),(0,b.jsx)(p,{value:`updated`,children:t(`marketplaceSortUpdated`)})]})]})]})})}function S({count:e}){return(0,b.jsx)(b.Fragment,{children:Array.from({length:e},(e,t)=>(0,b.jsx)(`article`,{className:`rounded-2xl border border-gray-200/40 bg-white px-5 py-4 shadow-sm`,children:(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-3.5`,children:[(0,b.jsxs)(`div`,{className:`flex min-w-0 flex-1 gap-3`,children:[(0,b.jsx)(h,{className:`h-10 w-10 shrink-0 rounded-xl`}),(0,b.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2 pt-0.5`,children:[(0,b.jsx)(h,{className:`h-4 w-32 max-w-[70%]`}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(h,{className:`h-3 w-12`}),(0,b.jsx)(h,{className:`h-3 w-24`})]}),(0,b.jsx)(h,{className:`h-3 w-full`})]})]}),(0,b.jsx)(h,{className:`h-8 w-20 shrink-0 rounded-xl`})]})},`marketplace-skeleton-${t}`))})}function C({hasMore:e,loading:n,sentinelRef:r}){return!e&&!n?null:(0,b.jsxs)(`div`,{className:`py-4`,children:[e&&(0,b.jsx)(`div`,{ref:r,className:`h-1 w-full`,"aria-hidden":`true`}),n&&(0,b.jsx)(`div`,{"data-testid":`marketplace-loading-more`,className:`pt-3 text-center text-xs text-gray-500`,children:t(`loading`)})]})}function w(e){let t=e.trim().toLowerCase().replace(/_/g,`-`),n=[t,t.split(`-`)[0],`en`];return Array.from(new Set(n.filter(Boolean)))}function T(e){return e.trim().toLowerCase().replace(/_/g,`-`)}function E(e,t,n){if(e){let t=Object.entries(e).map(([e,t])=>({locale:T(e),text:typeof t==`string`?t.trim():``})).filter(e=>e.text.length>0);if(t.length>0){let e=new Map(t.map(e=>[e.locale,e.text]));for(let t of n){let n=T(t),r=e.get(n);if(r)return r}for(let e of n){let n=T(e).split(`-`)[0];if(!n)continue;let r=t.find(e=>e.locale===n||e.locale.startsWith(`${n}-`));if(r)return r.text}return t[0]?.text??``}}return t?.trim()??``}function D(e,t){if(!e)return``;for(let n of t)if(T(n).split(`-`)[0]===`zh`&&e.descriptionZh?.trim())return e.descriptionZh.trim();return e.description?.trim()?e.description.trim():e.descriptionZh?.trim()?e.descriptionZh.trim():``}var O=e(n(),1),k=160;function A(e){let t=(0,O.useRef)(null),n=(0,O.useRef)(null),r=(0,O.useRef)(e.onLoadMore),i=(0,O.useRef)(!1);return(0,O.useEffect)(()=>{r.current=e.onLoadMore},[e.onLoadMore]),(0,O.useEffect)(()=>{e.disabled&&(i.current=!1)},[e.disabled]),(0,O.useEffect)(()=>{let a=t.current,o=n.current,s=e.thresholdPx??k;if(e.disabled||!a||!o)return;let c=()=>{i.current||e.disabled||(i.current=!0,Promise.resolve(r.current()).finally(()=>{i.current=!1}))},l=()=>{o.getBoundingClientRect().top-a.getBoundingClientRect().bottom<=s&&c()};if(typeof IntersectionObserver==`function`){let e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&c()},{root:a,rootMargin:`0px 0px ${s}px 0px`});return e.observe(o),l(),()=>{e.disconnect()}}return a.addEventListener(`scroll`,l,{passive:!0}),l(),()=>{a.removeEventListener(`scroll`,l)}},[e.disabled,e.thresholdPx,e.watchValue]),{containerRef:t,sentinelRef:n}}export{x as a,y as c,E as i,_ as l,w as n,C as o,D as r,S as s,A as t};
1
+ import{_ as e,i as t,m as n,p as r}from"./i18n-C5Mibli1.js";import{Ht as i,Rt as a,Ut as o,Vt as s,Wt as c}from"./api-BcqDx0tm.js";import{t as l}from"./createLucideIcon-BZkY6emz.js";import{a as u,i as d,n as f,r as p,t as m}from"./select-DIZrwsKU.js";import{t as h}from"./skeleton-CFQRIUzt.js";var g=class extends c{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:o()})}getOptimisticResult(e){return e.behavior=o(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:a,isRefetching:o,isError:c,isRefetchError:l}=r,u=n.fetchMeta?.fetchMore?.direction,d=c&&u===`forward`,f=a&&u===`forward`,p=c&&u===`backward`,m=a&&u===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:s(t,n.data),hasPreviousPage:i(t,n.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:o&&!f&&!m}}};function _(e,t){return a(e,g,t)}var v=l(`PackageSearch`,[[`path`,{d:`M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14`,key:`e7tb2h`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`12`,key:`a4e8g8`}],[`circle`,{cx:`18.5`,cy:`15.5`,r:`2.5`,key:`b5zd12`}],[`path`,{d:`M20.27 17.27 22 19`,key:`1l4muz`}]]);function y(e){if(!e||e.pages.length===0)return;let t=e.pages.flatMap(e=>e.items);return{...e.pages[e.pages.length-1],items:t,pages:e.pages,loadedItems:t.length,loadedPages:e.pages.length}}var b=r();function x({scope:e,searchText:n,searchPlaceholder:r,sort:i,onSearchTextChange:a,onSortChange:o}){return(0,b.jsx)(`div`,{className:`mb-4`,children:(0,b.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,b.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,b.jsx)(v,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,b.jsx)(`input`,{value:n,onChange:e=>a(e.target.value),placeholder:r,className:`h-9 w-full rounded-xl border border-gray-200/80 pl-9 pr-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary/40`})]}),e===`all`&&(0,b.jsxs)(m,{value:i,onValueChange:e=>o(e),children:[(0,b.jsx)(d,{className:`h-9 w-[150px] shrink-0 rounded-lg`,children:(0,b.jsx)(u,{})}),(0,b.jsxs)(f,{children:[(0,b.jsx)(p,{value:`relevance`,children:t(`marketplaceSortRelevance`)}),(0,b.jsx)(p,{value:`updated`,children:t(`marketplaceSortUpdated`)})]})]})]})})}function S({count:e}){return(0,b.jsx)(b.Fragment,{children:Array.from({length:e},(e,t)=>(0,b.jsx)(`article`,{className:`rounded-2xl border border-gray-200/40 bg-white px-5 py-4 shadow-sm`,children:(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-3.5`,children:[(0,b.jsxs)(`div`,{className:`flex min-w-0 flex-1 gap-3`,children:[(0,b.jsx)(h,{className:`h-10 w-10 shrink-0 rounded-xl`}),(0,b.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2 pt-0.5`,children:[(0,b.jsx)(h,{className:`h-4 w-32 max-w-[70%]`}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(h,{className:`h-3 w-12`}),(0,b.jsx)(h,{className:`h-3 w-24`})]}),(0,b.jsx)(h,{className:`h-3 w-full`})]})]}),(0,b.jsx)(h,{className:`h-8 w-20 shrink-0 rounded-xl`})]})},`marketplace-skeleton-${t}`))})}function C({hasMore:e,loading:n,sentinelRef:r}){return!e&&!n?null:(0,b.jsxs)(`div`,{className:`py-4`,children:[e&&(0,b.jsx)(`div`,{ref:r,className:`h-1 w-full`,"aria-hidden":`true`}),n&&(0,b.jsx)(`div`,{"data-testid":`marketplace-loading-more`,className:`pt-3 text-center text-xs text-gray-500`,children:t(`loading`)})]})}function w(e){let t=e.trim().toLowerCase().replace(/_/g,`-`),n=[t,t.split(`-`)[0],`en`];return Array.from(new Set(n.filter(Boolean)))}function T(e){return e.trim().toLowerCase().replace(/_/g,`-`)}function E(e,t,n){if(e){let t=Object.entries(e).map(([e,t])=>({locale:T(e),text:typeof t==`string`?t.trim():``})).filter(e=>e.text.length>0);if(t.length>0){let e=new Map(t.map(e=>[e.locale,e.text]));for(let t of n){let n=T(t),r=e.get(n);if(r)return r}for(let e of n){let n=T(e).split(`-`)[0];if(!n)continue;let r=t.find(e=>e.locale===n||e.locale.startsWith(`${n}-`));if(r)return r.text}return t[0]?.text??``}}return t?.trim()??``}function D(e,t){if(!e)return``;for(let n of t)if(T(n).split(`-`)[0]===`zh`&&e.descriptionZh?.trim())return e.descriptionZh.trim();return e.description?.trim()?e.description.trim():e.descriptionZh?.trim()?e.descriptionZh.trim():``}var O=e(n(),1),k=160;function A(e){let t=(0,O.useRef)(null),n=(0,O.useRef)(null),r=(0,O.useRef)(e.onLoadMore),i=(0,O.useRef)(!1);return(0,O.useEffect)(()=>{r.current=e.onLoadMore},[e.onLoadMore]),(0,O.useEffect)(()=>{e.disabled&&(i.current=!1)},[e.disabled]),(0,O.useEffect)(()=>{let a=t.current,o=n.current,s=e.thresholdPx??k;if(e.disabled||!a||!o)return;let c=()=>{i.current||e.disabled||(i.current=!0,Promise.resolve(r.current()).finally(()=>{i.current=!1}))},l=()=>{o.getBoundingClientRect().top-a.getBoundingClientRect().bottom<=s&&c()};if(typeof IntersectionObserver==`function`){let e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&c()},{root:a,rootMargin:`0px 0px ${s}px 0px`});return e.observe(o),l(),()=>{e.disconnect()}}return a.addEventListener(`scroll`,l,{passive:!0}),l(),()=>{a.removeEventListener(`scroll`,l)}},[e.disabled,e.thresholdPx,e.watchValue]),{containerRef:t,sentinelRef:n}}export{x as a,y as c,E as i,_ as l,w as n,C as o,D as r,S as s,A as t};
@@ -1 +1 @@
1
- import{_ as e,m as t}from"./i18n-CM4y8Mw9.js";import{bt as n}from"./api-BurjmW4A.js";function r(e){return typeof e!=`number`||!Number.isFinite(e)?`desktop`:e<=767?`mobile`:`desktop`}function i(){let e=typeof window>`u`?null:window.innerWidth??null;return{mode:r(e),width:e}}var a=n(()=>i()),o=new class{constructor(){this.consumerCount=0,this.started=!1,this.attach=()=>(this.consumerCount+=1,this.consumerCount===1&&this.start(),()=>{this.consumerCount=Math.max(0,this.consumerCount-1),this.consumerCount===0&&this.stop()}),this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`resize`,this.handleViewportChange),window.addEventListener(`orientationchange`,this.handleViewportChange),this.syncFromWindow())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`resize`,this.handleViewportChange),window.removeEventListener(`orientationchange`,this.handleViewportChange),this.started=!1)},this.getSnapshot=()=>a.getState(),this.resetForTests=()=>{this.consumerCount=0,this.stop(),a.setState(i())},this.handleViewportChange=()=>{this.syncFromWindow()},this.syncFromWindow=()=>{if(typeof window>`u`)return;let e=window.innerWidth??null;a.setState({width:e,mode:r(e)})}}},s=e(t(),1);function c(){(0,s.useEffect)(()=>o.attach(),[]);let e=a(e=>e.mode);return{mode:e,isMobile:e===`mobile`,isDesktop:e===`desktop`}}export{o as n,c as t};
1
+ import{_ as e,m as t}from"./i18n-C5Mibli1.js";import{bt as n}from"./api-BcqDx0tm.js";function r(e){return typeof e!=`number`||!Number.isFinite(e)?`desktop`:e<=767?`mobile`:`desktop`}function i(){let e=typeof window>`u`?null:window.innerWidth??null;return{mode:r(e),width:e}}var a=n(()=>i()),o=new class{constructor(){this.consumerCount=0,this.started=!1,this.attach=()=>(this.consumerCount+=1,this.consumerCount===1&&this.start(),()=>{this.consumerCount=Math.max(0,this.consumerCount-1),this.consumerCount===0&&this.stop()}),this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`resize`,this.handleViewportChange),window.addEventListener(`orientationchange`,this.handleViewportChange),this.syncFromWindow())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`resize`,this.handleViewportChange),window.removeEventListener(`orientationchange`,this.handleViewportChange),this.started=!1)},this.getSnapshot=()=>a.getState(),this.resetForTests=()=>{this.consumerCount=0,this.stop(),a.setState(i())},this.handleViewportChange=()=>{this.syncFromWindow()},this.syncFromWindow=()=>{if(typeof window>`u`)return;let e=window.innerWidth??null;a.setState({width:e,mode:r(e)})}}},s=e(t(),1);function c(){(0,s.useEffect)(()=>o.attach(),[]);let e=a(e=>e.mode);return{mode:e,isMobile:e===`mobile`,isDesktop:e===`desktop`}}export{o as n,c as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-BZkY6emz.js";var t=e(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
package/dist/index.html CHANGED
@@ -78,45 +78,46 @@
78
78
  })();
79
79
  </script>
80
80
  <title>NextClaw</title>
81
- <script type="module" crossorigin src="/assets/index-CtVSzMPM.js"></script>
82
- <link rel="modulepreload" crossorigin href="/assets/i18n-CM4y8Mw9.js">
83
- <link rel="modulepreload" crossorigin href="/assets/api-BurjmW4A.js">
84
- <link rel="modulepreload" crossorigin href="/assets/es2015-BNy4R8AC.js">
85
- <link rel="modulepreload" crossorigin href="/assets/createLucideIcon-PPrXCGK8.js">
86
- <link rel="modulepreload" crossorigin href="/assets/select-DVUtSFHZ.js">
87
- <link rel="modulepreload" crossorigin href="/assets/dist-FL5e8mMi.js">
88
- <link rel="modulepreload" crossorigin href="/assets/x-tYcSDsrY.js">
89
- <link rel="modulepreload" crossorigin href="/assets/dialog-CTCX7oLf.js">
90
- <link rel="modulepreload" crossorigin href="/assets/popover-AmJkxio3.js">
91
- <link rel="modulepreload" crossorigin href="/assets/tooltip-BkZCQcKw.js">
92
- <link rel="modulepreload" crossorigin href="/assets/chunk-JZWAC4HX-24FLdHl7.js">
93
- <link rel="modulepreload" crossorigin href="/assets/use-config-CyvhbRhf.js">
94
- <link rel="modulepreload" crossorigin href="/assets/theme-provider-WTWq_jYq.js">
95
- <link rel="modulepreload" crossorigin href="/assets/search-CQUdr7j_.js">
96
- <link rel="modulepreload" crossorigin href="/assets/book-open-CVEuA0y5.js">
97
- <link rel="modulepreload" crossorigin href="/assets/external-link-BNtqJE01.js">
98
- <link rel="modulepreload" crossorigin href="/assets/folder-QyJHVUNz.js">
99
- <link rel="modulepreload" crossorigin href="/assets/logos-CqXnaJIm.js">
100
- <link rel="modulepreload" crossorigin href="/assets/loader-circle-R23uEPkM.js">
101
- <link rel="modulepreload" crossorigin href="/assets/plus-D14303DH.js">
102
- <link rel="modulepreload" crossorigin href="/assets/refresh-ccw-B-dhb3yS.js">
103
- <link rel="modulepreload" crossorigin href="/assets/settings-DgtZZlnF.js">
104
- <link rel="modulepreload" crossorigin href="/assets/sparkles-DNSCyDhL.js">
105
- <link rel="modulepreload" crossorigin href="/assets/trash-2-CqciSCsg.js">
106
- <link rel="modulepreload" crossorigin href="/assets/doc-browser-context-C-WPOji4.js">
107
- <link rel="modulepreload" crossorigin href="/assets/doc-browser-fyn7eDTp.js">
108
- <link rel="modulepreload" crossorigin href="/assets/doc-browser-C02neCIE.js">
109
- <link rel="modulepreload" crossorigin href="/assets/use-viewport-layout-CaALCA51.js">
110
- <link rel="modulepreload" crossorigin href="/assets/logo-badge-CKAxvQFc.js">
111
- <link rel="modulepreload" crossorigin href="/assets/skeleton-BCPi52jT.js">
112
- <link rel="modulepreload" crossorigin href="/assets/chat-D4KecKjB.js">
113
- <link rel="modulepreload" crossorigin href="/assets/key-round-DenCfA2w.js">
114
- <link rel="modulepreload" crossorigin href="/assets/message-square-Dm34zD6k.js">
115
- <link rel="modulepreload" crossorigin href="/assets/app-navigation.config-Bpd16Pem.js">
116
- <link rel="modulepreload" crossorigin href="/assets/notice-card-D00-02yg.js">
117
- <link rel="modulepreload" crossorigin href="/assets/status-dot-X_j51OfA.js">
118
- <link rel="modulepreload" crossorigin href="/assets/app-manager-provider-DhxUmyTv.js">
119
- <link rel="stylesheet" crossorigin href="/assets/index-N3hjuljD.css">
81
+ <script type="module" crossorigin src="/assets/index-BTDFuKka.js"></script>
82
+ <link rel="modulepreload" crossorigin href="/assets/i18n-C5Mibli1.js">
83
+ <link rel="modulepreload" crossorigin href="/assets/chunk-JZWAC4HX-u4uYphxM.js">
84
+ <link rel="modulepreload" crossorigin href="/assets/api-BcqDx0tm.js">
85
+ <link rel="modulepreload" crossorigin href="/assets/es2015-JCM5-KtW.js">
86
+ <link rel="modulepreload" crossorigin href="/assets/createLucideIcon-BZkY6emz.js">
87
+ <link rel="modulepreload" crossorigin href="/assets/select-DIZrwsKU.js">
88
+ <link rel="modulepreload" crossorigin href="/assets/dist-Bl94Ahwx.js">
89
+ <link rel="modulepreload" crossorigin href="/assets/x-DpTzXQcX.js">
90
+ <link rel="modulepreload" crossorigin href="/assets/dialog-csshWetU.js">
91
+ <link rel="modulepreload" crossorigin href="/assets/popover-YAsxDBhY.js">
92
+ <link rel="modulepreload" crossorigin href="/assets/tooltip-Dq5Xehpk.js">
93
+ <link rel="modulepreload" crossorigin href="/assets/refresh-cw-BxojR62w.js">
94
+ <link rel="modulepreload" crossorigin href="/assets/use-config-BQJjq1mP.js">
95
+ <link rel="modulepreload" crossorigin href="/assets/theme-provider-aOmrJ9J6.js">
96
+ <link rel="modulepreload" crossorigin href="/assets/search-vChioOoe.js">
97
+ <link rel="modulepreload" crossorigin href="/assets/book-open-DgLqYpNY.js">
98
+ <link rel="modulepreload" crossorigin href="/assets/external-link-Sw3ah_JD.js">
99
+ <link rel="modulepreload" crossorigin href="/assets/folder-D7-VTnkz.js">
100
+ <link rel="modulepreload" crossorigin href="/assets/logos-CqVm0q0W.js">
101
+ <link rel="modulepreload" crossorigin href="/assets/loader-circle-B5i8oMMY.js">
102
+ <link rel="modulepreload" crossorigin href="/assets/plus-Di0KAkiO.js">
103
+ <link rel="modulepreload" crossorigin href="/assets/refresh-ccw-Bii4w8aB.js">
104
+ <link rel="modulepreload" crossorigin href="/assets/settings-CiRChctQ.js">
105
+ <link rel="modulepreload" crossorigin href="/assets/sparkles-D1ZKWdm4.js">
106
+ <link rel="modulepreload" crossorigin href="/assets/trash-2-rY9ZteZX.js">
107
+ <link rel="modulepreload" crossorigin href="/assets/doc-browser-context-DfLHAWbG.js">
108
+ <link rel="modulepreload" crossorigin href="/assets/doc-browser-CzCV73NJ.js">
109
+ <link rel="modulepreload" crossorigin href="/assets/doc-browser-BUlCkZo2.js">
110
+ <link rel="modulepreload" crossorigin href="/assets/use-viewport-layout-BX3XqzJ4.js">
111
+ <link rel="modulepreload" crossorigin href="/assets/logo-badge-BQgKnVtz.js">
112
+ <link rel="modulepreload" crossorigin href="/assets/skeleton-CFQRIUzt.js">
113
+ <link rel="modulepreload" crossorigin href="/assets/chat-CA3aRmhx.js">
114
+ <link rel="modulepreload" crossorigin href="/assets/key-round-CnI1mc9F.js">
115
+ <link rel="modulepreload" crossorigin href="/assets/message-square-D6Z4NwpG.js">
116
+ <link rel="modulepreload" crossorigin href="/assets/app-navigation.config-CMoWvFEI.js">
117
+ <link rel="modulepreload" crossorigin href="/assets/notice-card-CCgk6FvF.js">
118
+ <link rel="modulepreload" crossorigin href="/assets/status-dot-Dv_hiUVa.js">
119
+ <link rel="modulepreload" crossorigin href="/assets/app-manager-provider-DVYBjif-.js">
120
+ <link rel="stylesheet" crossorigin href="/assets/index-CUmk8xFK.css">
120
121
  </head>
121
122
 
122
123
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/ui",
3
- "version": "0.12.19",
3
+ "version": "0.12.20-beta.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -28,11 +28,14 @@
28
28
  "tailwind-merge": "^2.5.4",
29
29
  "zod": "^3.23.8",
30
30
  "zustand": "^5.0.2",
31
- "@nextclaw/ncp": "0.5.5",
32
- "@nextclaw/agent-chat": "0.1.10",
33
- "@nextclaw/ncp-react": "0.4.25",
34
- "@nextclaw/ncp-http-agent-client": "0.3.17",
35
- "@nextclaw/agent-chat-ui": "0.3.12"
31
+ "@nextclaw/agent-chat": "0.1.11-beta.0",
32
+ "@nextclaw/kernel": "0.1.2-beta.2",
33
+ "@nextclaw/ncp": "0.5.6-beta.0",
34
+ "@nextclaw/client-sdk": "0.1.1-beta.1",
35
+ "@nextclaw/ncp-http-agent-client": "0.3.18-beta.1",
36
+ "@nextclaw/server": "0.12.13-beta.1",
37
+ "@nextclaw/agent-chat-ui": "0.3.13-beta.0",
38
+ "@nextclaw/ncp-react": "0.4.26-beta.1"
36
39
  },
37
40
  "devDependencies": {
38
41
  "@testing-library/react": "^16.3.0",
@@ -1,8 +1,8 @@
1
1
  import { useEffect, useRef } from 'react';
2
- import { applyNcpSessionRealtimeEvent } from '@/shared/lib/api';
2
+ import { applyNcpSessionRealtimeEvent, nextclawClient } from '@/shared/lib/api';
3
3
  import { systemStatusManager } from '@/features/system-status';
4
- import { appClient } from '@/shared/lib/transport';
5
4
  import type { QueryClient } from '@tanstack/react-query';
5
+ import type { NextClawRealtimeEvent } from '@nextclaw/client-sdk';
6
6
 
7
7
  function shouldInvalidateConfigQuery(configPath: string) {
8
8
  const normalized = configPath.trim().toLowerCase();
@@ -41,7 +41,7 @@ function handleRealtimeEvent(
41
41
  shouldResyncSessions: boolean;
42
42
  clearShouldResyncSessions: () => void;
43
43
  markShouldResyncSessions: () => void;
44
- event: Parameters<Parameters<typeof appClient.subscribe>[0]>[0];
44
+ event: NextClawRealtimeEvent;
45
45
  }
46
46
  ): void {
47
47
  const {
@@ -88,7 +88,7 @@ export function useRealtimeQueryBridge(queryClient?: QueryClient) {
88
88
  const shouldResyncSessionsRef = useRef(false);
89
89
 
90
90
  useEffect(() => {
91
- return appClient.subscribe((event) =>
91
+ return nextclawClient.realtime.subscribe((event) =>
92
92
  handleRealtimeEvent({
93
93
  queryClient,
94
94
  shouldResyncSessions: shouldResyncSessionsRef.current,
@@ -100,6 +100,6 @@ export function useRealtimeQueryBridge(queryClient?: QueryClient) {
100
100
  },
101
101
  event,
102
102
  })
103
- );
103
+ ).close;
104
104
  }, [queryClient]);
105
105
  }
package/src/app/index.tsx CHANGED
@@ -10,7 +10,7 @@ import { LanguageSettingsPage } from "@/features/settings";
10
10
  import { SettingsEntryPage } from "@/app/components/layout/settings-entry-page";
11
11
  import { LoginPage } from "@/components/auth/login-page";
12
12
  import { AccountPanel } from "@/features/account";
13
- import { useSystemStatusSources } from "@/features/system-status";
13
+ import { runtimeUpdateManager, useSystemStatusSources } from "@/features/system-status";
14
14
  import {
15
15
  isTransientAuthStatusBootstrapError,
16
16
  useAuthStatus,
@@ -214,6 +214,12 @@ function ProtectedRoutes() {
214
214
  function ProtectedApp() {
215
215
  useRealtimeQueryBridge(appQueryClient);
216
216
  useSystemStatusSources();
217
+ useEffect(() => {
218
+ void runtimeUpdateManager.start();
219
+ return () => {
220
+ runtimeUpdateManager.stop();
221
+ };
222
+ }, []);
217
223
 
218
224
  return (
219
225
  <AppManagerProvider>
@@ -5,7 +5,7 @@ import { toast } from 'sonner';
5
5
  import { LogoBadge } from '@/shared/components/common/logo-badge';
6
6
  import { Button } from '@/shared/components/ui/button';
7
7
  import { StatusDot } from '@/shared/components/ui/status-dot';
8
- import { appClient } from '@/shared/lib/transport';
8
+ import { nextclawClient } from '@/shared/lib/api';
9
9
  import { useConfig, useConfigMeta, useConfigSchema, useExecuteConfigAction, useUpdateChannel } from '@/shared/hooks/use-config';
10
10
  import type { ConfigActionManifest, ConfigUiHints } from '@/shared/lib/api';
11
11
  import { ChannelFormFieldsSection } from '@/features/channels/components/channel-form-fields-section';
@@ -77,7 +77,7 @@ function ensureChannelApplySubscription() {
77
77
  if (channelApplyUnsubscribe) {
78
78
  return;
79
79
  }
80
- channelApplyUnsubscribe = appClient.subscribe((event) => {
80
+ channelApplyUnsubscribe = nextclawClient.realtime.subscribe((event) => {
81
81
  if (event.type !== 'channel.config.apply-status') {
82
82
  return;
83
83
  }
@@ -90,7 +90,7 @@ function ensureChannelApplySubscription() {
90
90
  : { status: 'failed', message: event.payload.message }
91
91
  );
92
92
  channelApplyListeners.forEach((listener) => listener());
93
- });
93
+ }).close;
94
94
  }
95
95
 
96
96
  function subscribeChannelApplyStore(listener: () => void) {
@@ -17,7 +17,7 @@ type WeixinChannelAuthSectionProps = {
17
17
  };
18
18
 
19
19
  function resolveConnectedAccountIds(channelConfig: Record<string, unknown>): string[] {
20
- const accounts = channelConfig.accounts;
20
+ const { accounts } = channelConfig;
21
21
  const ids = new Set<string>();
22
22
  if (typeof channelConfig.defaultAccountId === 'string' && channelConfig.defaultAccountId.trim()) {
23
23
  ids.add(channelConfig.defaultAccountId.trim());
@@ -160,6 +160,7 @@ type ChatConversationContentProps = {
160
160
  onToolAction: ChatToolActionHandler;
161
161
  onFileOpen: ChatFileOpenHandler;
162
162
  };
163
+
163
164
  function ChatConversationContent({
164
165
  snapshot,
165
166
  availableAgents,
@@ -12,11 +12,14 @@ import { chatRecentModelsManager, CHAT_RECENT_MODELS_MIN_OPTIONS } from '@/featu
12
12
  import { chatRecentSkillsManager, CHAT_RECENT_SKILLS_MIN_OPTIONS } from '@/features/chat/managers/chat-recent-skills.manager';
13
13
  import { deriveSelectedSkillsFromComposer } from '@/features/chat/utils/chat-composer-state.utils';
14
14
  import { hasNcpChatModelOptions, isNcpChatComposerDisabled, isNcpChatModelOptionsEmpty, isNcpChatModelOptionsLoading, isNcpChatSendDisabled } from '@/features/chat/utils/ncp-chat-input-availability.utils';
15
- import { useChatRuntimeAvailability } from '@/features/system-status';
15
+ import { useSelectedSessionContextWindowIndicator } from '@/features/chat/hooks/use-selected-session-context-window-indicator';
16
+ import { useSystemStatus } from '@/features/system-status';
17
+ import { isNcpChatRuntimeBlocked } from '@/features/chat/utils/ncp-chat-runtime-availability.utils';
16
18
  import { t } from '@/shared/lib/i18n';
17
19
  import { toast } from 'sonner';
18
20
 
19
21
  type ChatInputStoreSnapshot = ReturnType<typeof useChatInputStore.getState>['snapshot']; type ChatPresenter = ReturnType<typeof usePresenter>;
22
+
20
23
  function buildThinkingLabels(): Record<ChatThinkingLevel, string> {
21
24
  return {
22
25
  off: t('chatThinkingLevelOff'),
@@ -206,7 +209,7 @@ export function ChatInputBarContainer() {
206
209
  const { language } = useI18n();
207
210
  const { isMobile } = useViewportLayout();
208
211
  const snapshot = useChatInputStore((state) => state.snapshot);
209
- const runtimeAvailability = useChatRuntimeAvailability();
212
+ const isRuntimeBlocked = isNcpChatRuntimeBlocked(useSystemStatus());
210
213
  const [slashQuery, setSlashQuery] = useState<string | null>(null);
211
214
  const inputBarRef = useRef<ChatInputBarHandle | null>(null);
212
215
  const fileInputRef = useRef<HTMLInputElement | null>(null);
@@ -224,6 +227,7 @@ export function ChatInputBarContainer() {
224
227
  () => buildChatSlashItems(skillRecords, slashQuery ?? '', labels.slashTexts, recentSkillValues),
225
228
  [labels.slashTexts, recentSkillValues, skillRecords, slashQuery]
226
229
  );
230
+ const contextWindowIndicator = useSelectedSessionContextWindowIndicator();
227
231
  const selectedModelOption = modelRecords.find((option) => option.value === snapshot.selectedModel);
228
232
  const thinkingSupportedLevels = selectedModelOption?.thinkingCapability?.supported ?? [];
229
233
  const resolvedStopHint = snapshot.stopDisabledReason === '__preparing__'
@@ -311,18 +315,19 @@ export function ChatInputBarContainer() {
311
315
  ],
312
316
  skillPicker,
313
317
  actions: {
314
- sendError: runtimeAvailability.isBlocked ? null : snapshot.sendError,
318
+ sendError: isRuntimeBlocked ? null : snapshot.sendError,
315
319
  isSending: snapshot.isSending,
316
320
  canStopGeneration: snapshot.canStopGeneration,
317
321
  sendDisabled: isNcpChatSendDisabled({
318
322
  snapshot,
319
323
  hasSendableDraft,
320
- isRuntimeBlocked: runtimeAvailability.isBlocked
324
+ isRuntimeBlocked
321
325
  }),
322
326
  stopDisabled: !snapshot.canStopGeneration,
323
327
  stopHint: resolvedStopHint,
324
328
  sendButtonLabel: t('chatSend'),
325
329
  stopButtonLabel: t('chatStop'),
330
+ contextWindow: contextWindowIndicator,
326
331
  onSend: presenter.chatInputManager.send,
327
332
  onStop: presenter.chatInputManager.stop
328
333
  }